接口
This commit is contained in:
+414
-414
@@ -1,465 +1,465 @@
|
||||
<template>
|
||||
<view class="detail-container">
|
||||
<!-- 设备状态卡片 -->
|
||||
<view class="device-card">
|
||||
<view class="device-header">
|
||||
<view class="device-title">
|
||||
<text class="name">共享风扇</text>
|
||||
<text class="id">设备号:{{ deviceId }}</text>
|
||||
</view>
|
||||
<view class="status" :class="deviceStatus.class">{{ deviceStatus.text }}</view>
|
||||
</view>
|
||||
<view class="device-info">
|
||||
<view class="info-item">
|
||||
<text class="label">设备位置</text>
|
||||
<text class="value">{{ deviceLocation }}</text>
|
||||
</view>
|
||||
<view class="info-item">
|
||||
<text class="label">电池电量</text>
|
||||
<text class="value">{{ batteryLevel }}%</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="detail-container">
|
||||
<!-- 设备状态卡片 -->
|
||||
<view class="device-card">
|
||||
<view class="device-header">
|
||||
<view class="device-title">
|
||||
<text class="name">共享风扇</text>
|
||||
<text class="id">设备号:{{ deviceId }}</text>
|
||||
</view>
|
||||
<view class="status" :class="deviceStatus.class">{{ deviceStatus.text }}</view>
|
||||
</view>
|
||||
<view class="device-info">
|
||||
<view class="info-item">
|
||||
<text class="label">设备位置</text>
|
||||
<text class="value">{{ deviceLocation }}</text>
|
||||
</view>
|
||||
<view class="info-item">
|
||||
<text class="label">电池电量</text>
|
||||
<text class="value">{{ batteryLevel }}%</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 套餐选择 -->
|
||||
<view class="package-section" v-if="!hasActiveOrder">
|
||||
<view class="section-title">选择套餐</view>
|
||||
<view class="package-list">
|
||||
<view
|
||||
v-for="(pkg, index) in packages"
|
||||
:key="index"
|
||||
class="package-item"
|
||||
:class="{ active: selectedPackage === index }"
|
||||
@click="selectPackage(index)"
|
||||
>
|
||||
<view class="package-content">
|
||||
<text class="time">{{ pkg.time }}</text>
|
||||
<text class="price">¥{{ pkg.price }}</text>
|
||||
</view>
|
||||
<text class="unit-price">约{{ pkg.unitPrice }}元/小时</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 套餐选择 -->
|
||||
<view class="package-section" v-if="!hasActiveOrder">
|
||||
<view class="section-title">选择套餐</view>
|
||||
<view class="package-list">
|
||||
<view v-for="(pkg, index) in packages" :key="index" class="package-item"
|
||||
:class="{ active: selectedPackage === index }" @click="selectPackage(index)">
|
||||
<view class="package-content">
|
||||
<text class="time">{{ pkg.time }}</text>
|
||||
<text class="price">¥{{ pkg.price }}</text>
|
||||
</view>
|
||||
<text class="unit-price">约{{ pkg.unitPrice }}元/小时</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 使用说明 -->
|
||||
<view class="notice-section">
|
||||
<view class="section-title">使用说明</view>
|
||||
<view class="notice-list">
|
||||
<view class="notice-item">
|
||||
<view class="dot"></view>
|
||||
<text>请在使用前检查设备是否完好</text>
|
||||
</view>
|
||||
<view class="notice-item">
|
||||
<view class="dot"></view>
|
||||
<text>超出使用时间将自动按小时计费</text>
|
||||
</view>
|
||||
<view class="notice-item">
|
||||
<view class="dot"></view>
|
||||
<text>请在指定区域内使用设备</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 使用说明 -->
|
||||
<view class="notice-section">
|
||||
<view class="section-title">使用说明</view>
|
||||
<view class="notice-list">
|
||||
<view class="notice-item">
|
||||
<view class="dot"></view>
|
||||
<text>请在使用前检查设备是否完好</text>
|
||||
</view>
|
||||
<view class="notice-item">
|
||||
<view class="dot"></view>
|
||||
<text>超出使用时间将自动按小时计费</text>
|
||||
</view>
|
||||
<view class="notice-item">
|
||||
<view class="dot"></view>
|
||||
<text>请在指定区域内使用设备</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 底部操作栏 -->
|
||||
<view class="bottom-bar">
|
||||
<view class="price-info" v-if="!hasActiveOrder">
|
||||
<text class="deposit-text">押金:</text>
|
||||
<text class="deposit-amount">¥99</text>
|
||||
</view>
|
||||
<button
|
||||
class="action-btn"
|
||||
:class="hasActiveOrder ? 'return' : 'rent'"
|
||||
@click="handleAction"
|
||||
>
|
||||
{{ hasActiveOrder ? '归还设备' : '立即租借' }}
|
||||
</button>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 底部操作栏 -->
|
||||
<view class="bottom-bar">
|
||||
<view class="price-info" v-if="!hasActiveOrder">
|
||||
<text class="deposit-text">押金:</text>
|
||||
<text class="deposit-amount">¥99</text>
|
||||
</view>
|
||||
<button class="action-btn" :class="hasActiveOrder ? 'return' : 'rent'" @click="handleAction">
|
||||
{{ hasActiveOrder ? '归还设备' : '立即租借' }}
|
||||
</button>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
deviceId: '',
|
||||
deviceLocation: '一号教学楼大厅',
|
||||
batteryLevel: 95,
|
||||
hasActiveOrder: false,
|
||||
deviceStatus: {
|
||||
text: '可使用',
|
||||
class: 'available'
|
||||
},
|
||||
selectedPackage: 0,
|
||||
packages: [
|
||||
{ time: '1小时', price: '2.00', unitPrice: '2.00' },
|
||||
{ time: '4小时', price: '6.00', unitPrice: '1.50' },
|
||||
{ time: '12小时', price: '15.00', unitPrice: '1.25' }
|
||||
],
|
||||
isLoggedIn: false
|
||||
}
|
||||
},
|
||||
onLoad(options) {
|
||||
this.deviceId = options.deviceId
|
||||
this.checkLoginAndOrder()
|
||||
},
|
||||
methods: {
|
||||
// 检查登录状态和订单
|
||||
async checkLoginAndOrder() {
|
||||
try {
|
||||
// 检查登录状态
|
||||
const token = uni.getStorageSync('token')
|
||||
if (!token) {
|
||||
this.isLoggedIn = false
|
||||
this.showLoginTip()
|
||||
return
|
||||
}
|
||||
import {
|
||||
getDeviceInfo
|
||||
} from '@/config/user.js'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
deviceInfo: {},
|
||||
deviceId: '',
|
||||
deviceLocation: '一号教学楼大厅',
|
||||
batteryLevel: 95,
|
||||
hasActiveOrder: false,
|
||||
deviceStatus: {
|
||||
text: '可使用',
|
||||
class: 'available'
|
||||
},
|
||||
selectedPackage: 1,
|
||||
packages: [{
|
||||
time: '1小时',
|
||||
price: '2.00',
|
||||
unitPrice: '2.00'
|
||||
},
|
||||
{
|
||||
time: '4小时',
|
||||
price: '6.00',
|
||||
unitPrice: '1.50'
|
||||
},
|
||||
{
|
||||
time: '12小时',
|
||||
price: '15.00',
|
||||
unitPrice: '1.25'
|
||||
}
|
||||
],
|
||||
isLoggedIn: false
|
||||
}
|
||||
},
|
||||
onLoad(options) {
|
||||
// console.log(options);
|
||||
this.deviceId = options.deviceNo
|
||||
console.log(options.deviceNo);
|
||||
this.getDeviceInfo()
|
||||
},
|
||||
methods: {
|
||||
// 检查登录状态和订单
|
||||
async getDeviceInfo() {
|
||||
const res = await getDeviceInfo(this.deviceId);
|
||||
if (res.code == 200) {
|
||||
this.deviceInfo = res.data
|
||||
}
|
||||
},
|
||||
|
||||
this.isLoggedIn = true
|
||||
// 检查是否有进行中的订单
|
||||
await this.checkOrderStatus()
|
||||
} catch (error) {
|
||||
uni.showToast({
|
||||
title: '网络错误,请重试',
|
||||
icon: 'none'
|
||||
})
|
||||
}
|
||||
},
|
||||
// 显示登录提示
|
||||
showLoginTip() {
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '请先登录后再操作',
|
||||
confirmText: '去登录',
|
||||
success: (res) => {
|
||||
if (res.confirm) {
|
||||
uni.navigateTo({
|
||||
url: '/pages/login/index'
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
// 显示登录提示
|
||||
showLoginTip() {
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '请先登录后再操作',
|
||||
confirmText: '去登录',
|
||||
success: (res) => {
|
||||
if (res.confirm) {
|
||||
uni.navigateTo({
|
||||
url: '/pages/login/index'
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
selectPackage(index) {
|
||||
this.selectedPackage = index;
|
||||
},
|
||||
|
||||
// 检查订单状态
|
||||
async checkOrderStatus() {
|
||||
try {
|
||||
// 调用接口检查是否有进行中的订单
|
||||
const result = await this.$api.checkActiveOrder()
|
||||
|
||||
if (result.hasOrder) {
|
||||
// 如果有正在进行的订单,跳转到归还页面,带上设备ID
|
||||
uni.redirectTo({
|
||||
url: `/pages/device/return?deviceId=${this.deviceId}`
|
||||
})
|
||||
}
|
||||
} catch (error) {
|
||||
uni.showToast({
|
||||
title: '订单状态查询失败',
|
||||
icon: 'none'
|
||||
})
|
||||
}
|
||||
},
|
||||
// 检查订单状态
|
||||
async checkOrderStatus() {
|
||||
try {
|
||||
// 调用接口检查是否有进行中的订单
|
||||
const result = await this.$api.checkActiveOrder()
|
||||
|
||||
// 处理租借操作
|
||||
handleRent() {
|
||||
if (!this.isLoggedIn) {
|
||||
this.showLoginTip()
|
||||
return
|
||||
}
|
||||
if (result.hasOrder) {
|
||||
// 如果有正在进行的订单,跳转到归还页面,带上设备ID
|
||||
uni.redirectTo({
|
||||
url: `/pages/device/return?deviceId=${this.deviceId}`
|
||||
})
|
||||
}
|
||||
} catch (error) {
|
||||
uni.showToast({
|
||||
title: '订单状态查询失败',
|
||||
icon: 'none'
|
||||
})
|
||||
}
|
||||
},
|
||||
|
||||
const selectedPkg = this.packages[this.selectedPackage]
|
||||
uni.showModal({
|
||||
title: '确认租借',
|
||||
content: `确认支付押金¥99.00及${selectedPkg.time}套餐费用¥${selectedPkg.price}?`,
|
||||
success: (res) => {
|
||||
if (res.confirm) {
|
||||
this.submitRentOrder()
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
// 处理租借操作
|
||||
handleRent() {
|
||||
if (!this.isLoggedIn) {
|
||||
this.showLoginTip()
|
||||
return
|
||||
}
|
||||
|
||||
// 提交租借订单
|
||||
async submitRentOrder() {
|
||||
try {
|
||||
uni.showLoading({
|
||||
title: '处理中'
|
||||
})
|
||||
|
||||
const selectedPkg = this.packages[this.selectedPackage]
|
||||
// TODO: 调用租借接口
|
||||
const result = await this.$api.createOrder({
|
||||
deviceId: this.deviceId,
|
||||
packageId: this.selectedPackage,
|
||||
duration: selectedPkg.time,
|
||||
amount: selectedPkg.price
|
||||
})
|
||||
const selectedPkg = this.packages[this.selectedPackage]
|
||||
uni.showModal({
|
||||
title: '确认租借',
|
||||
content: `确认支付押金¥99.00及${selectedPkg.time}套餐费用¥${selectedPkg.price}?`,
|
||||
success: (res) => {
|
||||
if (res.confirm) {
|
||||
this.submitRentOrder()
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
uni.hideLoading()
|
||||
|
||||
if (result.success) {
|
||||
uni.showToast({
|
||||
title: '租借成功',
|
||||
icon: 'success'
|
||||
})
|
||||
// 跳转到使用中页面
|
||||
setTimeout(() => {
|
||||
uni.redirectTo({
|
||||
url: `/pages/return/index?deviceId=${this.deviceId}&orderId=${result.orderId}`
|
||||
})
|
||||
}, 1500)
|
||||
}
|
||||
} catch (error) {
|
||||
uni.hideLoading()
|
||||
uni.showToast({
|
||||
title: '租借失败,请重试',
|
||||
icon: 'none'
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// 提交租借订单
|
||||
async submitRentOrder() {
|
||||
try {
|
||||
uni.showLoading({
|
||||
title: '处理中'
|
||||
})
|
||||
|
||||
const selectedPkg = this.packages[this.selectedPackage]
|
||||
// TODO: 调用租借接口
|
||||
const result = await this.$api.createOrder({
|
||||
deviceId: this.deviceId,
|
||||
packageId: this.selectedPackage,
|
||||
duration: selectedPkg.time,
|
||||
amount: selectedPkg.price
|
||||
})
|
||||
|
||||
uni.hideLoading()
|
||||
|
||||
if (result.success) {
|
||||
uni.showToast({
|
||||
title: '租借成功',
|
||||
icon: 'success'
|
||||
})
|
||||
// 跳转到使用中页面
|
||||
setTimeout(() => {
|
||||
uni.redirectTo({
|
||||
url: `/pages/return/index?deviceId=${this.deviceId}&orderId=${result.orderId}`
|
||||
})
|
||||
}, 1500)
|
||||
}
|
||||
} catch (error) {
|
||||
uni.hideLoading()
|
||||
uni.showToast({
|
||||
title: '租借失败,请重试',
|
||||
icon: 'none'
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.detail-container {
|
||||
min-height: 100vh;
|
||||
background: #f8f8f8;
|
||||
padding: 30rpx;
|
||||
padding-bottom: 180rpx;
|
||||
box-sizing: border-box;
|
||||
.detail-container {
|
||||
min-height: 100vh;
|
||||
background: #f8f8f8;
|
||||
padding: 30rpx;
|
||||
padding-bottom: 180rpx;
|
||||
box-sizing: border-box;
|
||||
|
||||
.device-card {
|
||||
background: #fff;
|
||||
border-radius: 24rpx;
|
||||
padding: 30rpx;
|
||||
margin-bottom: 30rpx;
|
||||
box-shadow: 0 4rpx 16rpx rgba(0,0,0,0.04);
|
||||
.device-card {
|
||||
background: #fff;
|
||||
border-radius: 24rpx;
|
||||
padding: 30rpx;
|
||||
margin-bottom: 30rpx;
|
||||
box-shadow: 0 4rpx 16rpx rgba(0, 0, 0, 0.04);
|
||||
|
||||
.device-header {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
margin-bottom: 30rpx;
|
||||
.device-header {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
margin-bottom: 30rpx;
|
||||
|
||||
.device-title {
|
||||
.name {
|
||||
font-size: 36rpx;
|
||||
font-weight: 600;
|
||||
color: #333;
|
||||
margin-right: 20rpx;
|
||||
}
|
||||
.device-title {
|
||||
.name {
|
||||
font-size: 36rpx;
|
||||
font-weight: 600;
|
||||
color: #333;
|
||||
margin-right: 20rpx;
|
||||
}
|
||||
|
||||
.id {
|
||||
font-size: 24rpx;
|
||||
color: #999;
|
||||
}
|
||||
}
|
||||
.id {
|
||||
font-size: 24rpx;
|
||||
color: #999;
|
||||
}
|
||||
}
|
||||
|
||||
.status {
|
||||
padding: 8rpx 24rpx;
|
||||
border-radius: 24rpx;
|
||||
font-size: 24rpx;
|
||||
|
||||
&.available {
|
||||
background: #E8F5E9;
|
||||
color: #4CAF50;
|
||||
}
|
||||
|
||||
&.in-use {
|
||||
background: #E3F2FD;
|
||||
color: #1976D2;
|
||||
}
|
||||
}
|
||||
}
|
||||
.status {
|
||||
padding: 8rpx 24rpx;
|
||||
border-radius: 24rpx;
|
||||
font-size: 24rpx;
|
||||
|
||||
.device-info {
|
||||
.info-item {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
margin-bottom: 16rpx;
|
||||
&.available {
|
||||
background: #E8F5E9;
|
||||
color: #4CAF50;
|
||||
}
|
||||
|
||||
&:last-child {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
&.in-use {
|
||||
background: #E3F2FD;
|
||||
color: #1976D2;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.label {
|
||||
font-size: 28rpx;
|
||||
color: #666;
|
||||
}
|
||||
.device-info {
|
||||
.info-item {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
margin-bottom: 16rpx;
|
||||
|
||||
.value {
|
||||
font-size: 28rpx;
|
||||
color: #333;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
&:last-child {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
.package-section {
|
||||
background: #fff;
|
||||
border-radius: 24rpx;
|
||||
padding: 30rpx;
|
||||
margin-bottom: 30rpx;
|
||||
box-shadow: 0 4rpx 16rpx rgba(0,0,0,0.04);
|
||||
.label {
|
||||
font-size: 28rpx;
|
||||
color: #666;
|
||||
}
|
||||
|
||||
.section-title {
|
||||
font-size: 32rpx;
|
||||
font-weight: 600;
|
||||
color: #333;
|
||||
margin-bottom: 24rpx;
|
||||
}
|
||||
.value {
|
||||
font-size: 28rpx;
|
||||
color: #333;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.package-list {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
.package-section {
|
||||
background: #fff;
|
||||
border-radius: 24rpx;
|
||||
padding: 30rpx;
|
||||
margin-bottom: 30rpx;
|
||||
box-shadow: 0 4rpx 16rpx rgba(0, 0, 0, 0.04);
|
||||
|
||||
.package-item {
|
||||
flex: 1;
|
||||
margin: 0 10rpx;
|
||||
padding: 24rpx;
|
||||
background: #F5F5F5;
|
||||
border-radius: 16rpx;
|
||||
text-align: center;
|
||||
transition: all 0.3s;
|
||||
.section-title {
|
||||
font-size: 32rpx;
|
||||
font-weight: 600;
|
||||
color: #333;
|
||||
margin-bottom: 24rpx;
|
||||
}
|
||||
|
||||
&:first-child {
|
||||
margin-left: 0;
|
||||
}
|
||||
.package-list {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
|
||||
&:last-child {
|
||||
margin-right: 0;
|
||||
}
|
||||
.package-item {
|
||||
flex: 1;
|
||||
margin: 0 10rpx;
|
||||
padding: 24rpx;
|
||||
background: #F5F5F5;
|
||||
border-radius: 16rpx;
|
||||
text-align: center;
|
||||
transition: all 0.3s;
|
||||
|
||||
&.active {
|
||||
background: #E3F2FD;
|
||||
border: 2rpx solid #1976D2;
|
||||
&:first-child {
|
||||
margin-left: 0;
|
||||
}
|
||||
|
||||
.package-content {
|
||||
.time, .price {
|
||||
color: #1976D2;
|
||||
}
|
||||
}
|
||||
}
|
||||
&:last-child {
|
||||
margin-right: 0;
|
||||
}
|
||||
|
||||
.package-content {
|
||||
margin-bottom: 8rpx;
|
||||
&.active {
|
||||
background: #E3F2FD;
|
||||
border: 2rpx solid #1976D2;
|
||||
|
||||
.time {
|
||||
font-size: 28rpx;
|
||||
color: #333;
|
||||
margin-bottom: 8rpx;
|
||||
display: block;
|
||||
}
|
||||
.package-content {
|
||||
|
||||
.price {
|
||||
font-size: 36rpx;
|
||||
font-weight: 600;
|
||||
color: #333;
|
||||
}
|
||||
}
|
||||
.time,
|
||||
.price {
|
||||
color: #1976D2;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.unit-price {
|
||||
font-size: 24rpx;
|
||||
color: #999;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
.package-content {
|
||||
margin-bottom: 8rpx;
|
||||
|
||||
.notice-section {
|
||||
background: #fff;
|
||||
border-radius: 24rpx;
|
||||
padding: 30rpx;
|
||||
box-shadow: 0 4rpx 16rpx rgba(0,0,0,0.04);
|
||||
.time {
|
||||
font-size: 28rpx;
|
||||
color: #333;
|
||||
margin-bottom: 8rpx;
|
||||
display: block;
|
||||
}
|
||||
|
||||
.section-title {
|
||||
font-size: 32rpx;
|
||||
font-weight: 600;
|
||||
color: #333;
|
||||
margin-bottom: 24rpx;
|
||||
}
|
||||
.price {
|
||||
font-size: 36rpx;
|
||||
font-weight: 600;
|
||||
color: #333;
|
||||
}
|
||||
}
|
||||
|
||||
.notice-list {
|
||||
.notice-item {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
margin-bottom: 16rpx;
|
||||
.unit-price {
|
||||
font-size: 24rpx;
|
||||
color: #999;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
&:last-child {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
.notice-section {
|
||||
background: #fff;
|
||||
border-radius: 24rpx;
|
||||
padding: 30rpx;
|
||||
box-shadow: 0 4rpx 16rpx rgba(0, 0, 0, 0.04);
|
||||
|
||||
.dot {
|
||||
width: 12rpx;
|
||||
height: 12rpx;
|
||||
background: #1976D2;
|
||||
border-radius: 50%;
|
||||
margin-right: 16rpx;
|
||||
}
|
||||
.section-title {
|
||||
font-size: 32rpx;
|
||||
font-weight: 600;
|
||||
color: #333;
|
||||
margin-bottom: 24rpx;
|
||||
}
|
||||
|
||||
text {
|
||||
font-size: 28rpx;
|
||||
color: #666;
|
||||
line-height: 1.5;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
.notice-list {
|
||||
.notice-item {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
margin-bottom: 16rpx;
|
||||
|
||||
.bottom-bar {
|
||||
position: fixed;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
background: #fff;
|
||||
padding: 20rpx 30rpx;
|
||||
padding-bottom: calc(20rpx + env(safe-area-inset-bottom));
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
box-shadow: 0 -4rpx 16rpx rgba(0,0,0,0.04);
|
||||
&:last-child {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
.price-info {
|
||||
.deposit-text {
|
||||
font-size: 28rpx;
|
||||
color: #666;
|
||||
}
|
||||
.dot {
|
||||
width: 12rpx;
|
||||
height: 12rpx;
|
||||
background: #1976D2;
|
||||
border-radius: 50%;
|
||||
margin-right: 16rpx;
|
||||
}
|
||||
|
||||
.deposit-amount {
|
||||
font-size: 36rpx;
|
||||
font-weight: 600;
|
||||
color: #FF9800;
|
||||
}
|
||||
}
|
||||
text {
|
||||
font-size: 28rpx;
|
||||
color: #666;
|
||||
line-height: 1.5;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.action-btn {
|
||||
flex: 1;
|
||||
margin-left: 30rpx;
|
||||
height: 88rpx;
|
||||
border-radius: 44rpx;
|
||||
font-size: 32rpx;
|
||||
font-weight: 600;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
border: none;
|
||||
.bottom-bar {
|
||||
position: fixed;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
background: #fff;
|
||||
padding: 20rpx 30rpx;
|
||||
padding-bottom: calc(20rpx + env(safe-area-inset-bottom));
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
box-shadow: 0 -4rpx 16rpx rgba(0, 0, 0, 0.04);
|
||||
|
||||
&.rent {
|
||||
background: linear-gradient(135deg, #1976D2, #42A5F5);
|
||||
color: #fff;
|
||||
}
|
||||
.price-info {
|
||||
.deposit-text {
|
||||
font-size: 28rpx;
|
||||
color: #666;
|
||||
}
|
||||
|
||||
&.return {
|
||||
background: linear-gradient(135deg, #FF9800, #FFB74D);
|
||||
color: #fff;
|
||||
}
|
||||
.deposit-amount {
|
||||
font-size: 36rpx;
|
||||
font-weight: 600;
|
||||
color: #FF9800;
|
||||
}
|
||||
}
|
||||
|
||||
&:active {
|
||||
transform: scale(0.98);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
.action-btn {
|
||||
flex: 1;
|
||||
margin-left: 30rpx;
|
||||
height: 88rpx;
|
||||
border-radius: 44rpx;
|
||||
font-size: 32rpx;
|
||||
font-weight: 600;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
border: none;
|
||||
|
||||
&.rent {
|
||||
background: linear-gradient(135deg, #1976D2, #42A5F5);
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
&.return {
|
||||
background: linear-gradient(135deg, #FF9800, #FFB74D);
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
&:active {
|
||||
transform: scale(0.98);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -48,13 +48,16 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {getQueryString }from '@/util/index.js'
|
||||
export default {
|
||||
methods: {
|
||||
handleScan() {
|
||||
uni.scanCode({
|
||||
success: (res) => {
|
||||
let deviceNo = getQueryString(res.path,'deviceNo')
|
||||
// console.log(res.path);
|
||||
uni.navigateTo({
|
||||
url: `/pages/device/detail?deviceId=${res.result}`
|
||||
url: `/pages/serve/bagCheck/index?deviceNo=${deviceNo}`
|
||||
})
|
||||
},
|
||||
fail: (err) => {
|
||||
|
||||
+462
-344
@@ -1,384 +1,502 @@
|
||||
<template>
|
||||
<view class="my-container">
|
||||
<!-- 用户信息区域 -->
|
||||
<view class="user-info">
|
||||
<view class="floating-dots"></view>
|
||||
<view class="user-info-content" @click="handleLogin">
|
||||
<view class="avatar-wrap">
|
||||
<image class="avatar" src="/static/user.png" mode="aspectFill" />
|
||||
</view>
|
||||
<view class="info-content" v-if="userInfo.nickName">
|
||||
<text class="nickname">{{ userInfo.nickName }}</text>
|
||||
<text class="phone">{{ userInfo.phone }}</text>
|
||||
</view>
|
||||
<view class="info-content not-login" v-else>
|
||||
<text class="login-text">点击登录</text>
|
||||
<text class="login-desc">登录后享受更多服务</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="wave-decoration"></view>
|
||||
</view>
|
||||
<view class="my-container">
|
||||
<!-- 用户信息区域 -->
|
||||
<view class="user-info">
|
||||
<view class="floating-dots"></view>
|
||||
<view class="user-info-content" @click="showPopup">
|
||||
<view class="avatar-wrap">
|
||||
<image class="avatar" :src="userInfo.avatar || '/static/user.png'" mode="aspectFill" />
|
||||
</view>
|
||||
<view class="info-content" v-if="userInfo.nickName">
|
||||
<view class="text-group">
|
||||
<text class="nickname">{{ userInfo.nickName }}</text>
|
||||
<text class="phone">{{ userInfo.phone || "" }}</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="info-content not-login" v-else>
|
||||
<text class="login-text">点击登录</text>
|
||||
<text class="login-desc">登录后享受更多服务</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="wave-decoration"></view>
|
||||
</view>
|
||||
|
||||
<!-- 押金卡片 -->
|
||||
<view class="balance-card">
|
||||
<view class="balance-content">
|
||||
<text class="label">押金余额</text>
|
||||
<text class="amount">¥{{ deposit }}</text>
|
||||
</view>
|
||||
<view class="withdraw-btn" @click="navigateTo('/pages/deposit/index')">
|
||||
提现
|
||||
<view class="arrow"></view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 押金卡片 -->
|
||||
<view class="balance-card">
|
||||
<view class="balance-content">
|
||||
<text class="label">押金余额</text>
|
||||
<text class="amount">¥{{ deposit }}</text>
|
||||
</view>
|
||||
<view class="withdraw-btn" @click="navigateTo('/pages/deposit/index')">
|
||||
提现
|
||||
<view class="arrow"></view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 功能模块 -->
|
||||
<view class="function-list">
|
||||
<!-- 订单 -->
|
||||
<view class="function-item" @click="navigateTo('/pages/order/index')">
|
||||
<view class="item-left">
|
||||
<view class="icon-wrap order">
|
||||
<image src="/static/jl.png" mode="aspectFit" class="icon-image" />
|
||||
</view>
|
||||
<text class="title">租借记录</text>
|
||||
</view>
|
||||
<view class="arrow"></view>
|
||||
</view>
|
||||
<!-- 功能模块 -->
|
||||
<view class="function-list">
|
||||
<!-- 订单 -->
|
||||
<view class="function-item" @click="navigateTo('/pages/order/index')">
|
||||
<view class="item-left">
|
||||
<view class="icon-wrap order">
|
||||
<image src="/static/jl.png" mode="aspectFit" class="icon-image" />
|
||||
</view>
|
||||
<text class="title">租借记录</text>
|
||||
</view>
|
||||
<view class="arrow"></view>
|
||||
</view>
|
||||
|
||||
<!-- 投诉建议 -->
|
||||
<view class="function-item" @click="navigateTo('/pages/feedback/index')">
|
||||
<view class="item-left">
|
||||
<view class="icon-wrap feedback">
|
||||
<image src="/static/complaint.png" mode="aspectFit" class="icon-image" />
|
||||
</view>
|
||||
<text class="title">投诉与建议</text>
|
||||
</view>
|
||||
<view class="arrow"></view>
|
||||
</view>
|
||||
<!-- 投诉建议 -->
|
||||
<view class="function-item" @click="navigateTo('/pages/feedback/index')">
|
||||
<view class="item-left">
|
||||
<view class="icon-wrap feedback">
|
||||
<image src="/static/complaint.png" mode="aspectFit" class="icon-image" />
|
||||
</view>
|
||||
<text class="title">投诉与建议</text>
|
||||
</view>
|
||||
<view class="arrow"></view>
|
||||
</view>
|
||||
|
||||
<!-- 帮助中心 -->
|
||||
<view class="function-item" @click="navigateTo('/pages/help/index')">
|
||||
<view class="item-left">
|
||||
<view class="icon-wrap help">
|
||||
<image src="/static/hlep.png" mode="aspectFit" class="icon-image" />
|
||||
</view>
|
||||
<text class="title">帮助中心</text>
|
||||
</view>
|
||||
<view class="arrow"></view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 帮助中心 -->
|
||||
<view class="function-item" @click="navigateTo('/pages/help/index')">
|
||||
<view class="item-left">
|
||||
<view class="icon-wrap help">
|
||||
<image src="/static/hlep.png" mode="aspectFit" class="icon-image" />
|
||||
</view>
|
||||
<text class="title">帮助中心</text>
|
||||
</view>
|
||||
<view class="arrow"></view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
userInfo: {},
|
||||
deposit: '0.00'
|
||||
}
|
||||
},
|
||||
onShow() {
|
||||
this.getUserInfo()
|
||||
},
|
||||
methods: {
|
||||
getUserInfo() {
|
||||
const userInfo = uni.getStorageSync('userInfo')
|
||||
if (userInfo) {
|
||||
this.userInfo = userInfo
|
||||
}
|
||||
},
|
||||
handleLogin() {
|
||||
if (!this.userInfo.nickName) {
|
||||
uni.navigateTo({
|
||||
url: '/pages/login/index'
|
||||
})
|
||||
}
|
||||
},
|
||||
navigateTo(url) {
|
||||
// 判断是否需要登录
|
||||
// if (!this.userInfo.nickName && url !== '/pages/help/index') {
|
||||
// this.handleLogin()
|
||||
// return
|
||||
// }
|
||||
uni.navigateTo({ url })
|
||||
}
|
||||
}
|
||||
}
|
||||
import {
|
||||
wxLogin,
|
||||
getUserInfo,
|
||||
} from '../../util/index.js'
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
userInfo: {},
|
||||
deposit: '0.00',
|
||||
tempAvatar: '',
|
||||
tempNickname: '',
|
||||
show: false,
|
||||
}
|
||||
},
|
||||
onShow() {
|
||||
this.getInfo();
|
||||
},
|
||||
methods: {
|
||||
async getInfo() {
|
||||
try {
|
||||
const token = uni.getStorageSync('token')
|
||||
if (!token) {
|
||||
await wxLogin()
|
||||
this.getInfo()
|
||||
return
|
||||
}
|
||||
|
||||
const res = await getUserInfo()
|
||||
console.log(res);
|
||||
if (res.code === 200) {
|
||||
|
||||
const userInfo = {
|
||||
nickName: res.data.nickname,
|
||||
phone: res.data.phone,
|
||||
avatar: res.data.iconUrl,
|
||||
isAdmin: res.data.isAdmin
|
||||
}
|
||||
|
||||
this.userInfo = userInfo
|
||||
uni.setStorageSync('userInfo', userInfo)
|
||||
this.deposit = res.data.balanceAmount || '0.00'
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('获取用户信息失败:', error)
|
||||
uni.showToast({
|
||||
title: '获取用户信息失败',
|
||||
icon: 'none'
|
||||
})
|
||||
}
|
||||
},
|
||||
navigateTo(url) {
|
||||
uni.navigateTo({
|
||||
url
|
||||
})
|
||||
},
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.my-container {
|
||||
min-height: 87.5vh;
|
||||
background: #f8f8f8;
|
||||
padding-bottom: env(safe-area-inset-bottom);
|
||||
.my-container {
|
||||
min-height: 87.5vh;
|
||||
background: #f8f8f8;
|
||||
padding-bottom: env(safe-area-inset-bottom);
|
||||
|
||||
.user-info {
|
||||
height: 360rpx;
|
||||
background: linear-gradient(135deg, #1976D2, #42A5F5);
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
.user-info {
|
||||
height: 360rpx;
|
||||
background: linear-gradient(135deg, #1976D2, #42A5F5);
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
|
||||
&::before,
|
||||
&::after {
|
||||
content: '';
|
||||
position: absolute;
|
||||
background-repeat: no-repeat;
|
||||
opacity: 0.1;
|
||||
}
|
||||
&::before,
|
||||
&::after {
|
||||
content: '';
|
||||
position: absolute;
|
||||
background-repeat: no-repeat;
|
||||
opacity: 0.1;
|
||||
}
|
||||
|
||||
&::before {
|
||||
width: 200rpx;
|
||||
height: 200rpx;
|
||||
left: -40rpx;
|
||||
top: -40rpx;
|
||||
background-image: radial-gradient(circle, #fff 2rpx, transparent 3rpx);
|
||||
background-size: 30rpx 30rpx;
|
||||
transform: rotate(30deg);
|
||||
}
|
||||
&::before {
|
||||
width: 200rpx;
|
||||
height: 200rpx;
|
||||
left: -40rpx;
|
||||
top: -40rpx;
|
||||
background-image: radial-gradient(circle, #fff 2rpx, transparent 3rpx);
|
||||
background-size: 30rpx 30rpx;
|
||||
transform: rotate(30deg);
|
||||
}
|
||||
|
||||
&::after {
|
||||
width: 300rpx;
|
||||
height: 300rpx;
|
||||
right: -60rpx;
|
||||
bottom: -60rpx;
|
||||
background:
|
||||
radial-gradient(circle at center, rgba(255,255,255,0.2) 0%, rgba(255,255,255,0.2) 30%, transparent 30.5%),
|
||||
radial-gradient(circle at center, rgba(255,255,255,0.2) 0%, rgba(255,255,255,0.2) 20%, transparent 20.5%);
|
||||
background-size: 60rpx 60rpx;
|
||||
background-position: 0 0, 30rpx 30rpx;
|
||||
transform: rotate(-15deg);
|
||||
}
|
||||
&::after {
|
||||
width: 300rpx;
|
||||
height: 300rpx;
|
||||
right: -60rpx;
|
||||
bottom: -60rpx;
|
||||
background:
|
||||
radial-gradient(circle at center, rgba(255, 255, 255, 0.2) 0%, rgba(255, 255, 255, 0.2) 30%, transparent 30.5%),
|
||||
radial-gradient(circle at center, rgba(255, 255, 255, 0.2) 0%, rgba(255, 255, 255, 0.2) 20%, transparent 20.5%);
|
||||
background-size: 60rpx 60rpx;
|
||||
background-position: 0 0, 30rpx 30rpx;
|
||||
transform: rotate(-15deg);
|
||||
}
|
||||
|
||||
.floating-dots {
|
||||
position: absolute;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
top: 0;
|
||||
left: 0;
|
||||
pointer-events: none;
|
||||
.floating-dots {
|
||||
position: absolute;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
top: 0;
|
||||
left: 0;
|
||||
pointer-events: none;
|
||||
|
||||
&::before,
|
||||
&::after {
|
||||
content: '';
|
||||
position: absolute;
|
||||
width: 12rpx;
|
||||
height: 12rpx;
|
||||
border-radius: 50%;
|
||||
background: rgba(255,255,255,0.3);
|
||||
animation: float 3s infinite ease-in-out;
|
||||
}
|
||||
&::before,
|
||||
&::after {
|
||||
content: '';
|
||||
position: absolute;
|
||||
width: 12rpx;
|
||||
height: 12rpx;
|
||||
border-radius: 50%;
|
||||
background: rgba(255, 255, 255, 0.3);
|
||||
animation: float 3s infinite ease-in-out;
|
||||
}
|
||||
|
||||
&::before {
|
||||
top: 20%;
|
||||
right: 10%;
|
||||
animation-delay: -2s;
|
||||
}
|
||||
&::before {
|
||||
top: 20%;
|
||||
right: 10%;
|
||||
animation-delay: -2s;
|
||||
}
|
||||
|
||||
&::after {
|
||||
top: 50%;
|
||||
right: 20%;
|
||||
width: 8rpx;
|
||||
height: 8rpx;
|
||||
animation-delay: -1s;
|
||||
}
|
||||
}
|
||||
&::after {
|
||||
top: 50%;
|
||||
right: 20%;
|
||||
width: 8rpx;
|
||||
height: 8rpx;
|
||||
animation-delay: -1s;
|
||||
}
|
||||
}
|
||||
|
||||
.user-info-content {
|
||||
position: relative;
|
||||
z-index: 2;
|
||||
padding: 60rpx 40rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
.user-info-content {
|
||||
position: relative;
|
||||
z-index: 2;
|
||||
padding: 60rpx 40rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
.avatar-wrap {
|
||||
width: 140rpx;
|
||||
height: 140rpx;
|
||||
border-radius: 70rpx;
|
||||
border: 6rpx solid rgba(255,255,255,0.3);
|
||||
overflow: hidden;
|
||||
box-shadow: 0 4rpx 16rpx rgba(0,0,0,0.1),
|
||||
0 0 0 6rpx rgba(255,255,255,0.1);
|
||||
margin-right: 40rpx;
|
||||
position: relative;
|
||||
|
||||
&::after {
|
||||
content: '';
|
||||
position: absolute;
|
||||
top: -10%;
|
||||
left: -10%;
|
||||
right: -10%;
|
||||
bottom: -10%;
|
||||
background: linear-gradient(45deg, transparent, rgba(255,255,255,0.1), transparent);
|
||||
animation: shine 2s infinite;
|
||||
}
|
||||
|
||||
.avatar {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background: #fff;
|
||||
}
|
||||
}
|
||||
.avatar-wrap {
|
||||
width: 140rpx;
|
||||
height: 140rpx;
|
||||
border-radius: 70rpx;
|
||||
border: 6rpx solid rgba(255, 255, 255, 0.3);
|
||||
overflow: hidden;
|
||||
box-shadow: 0 4rpx 16rpx rgba(0, 0, 0, 0.1),
|
||||
0 0 0 6rpx rgba(255, 255, 255, 0.1);
|
||||
margin-right: 40rpx;
|
||||
position: relative;
|
||||
|
||||
.info-content {
|
||||
flex: 1;
|
||||
&::after {
|
||||
content: '';
|
||||
position: absolute;
|
||||
top: -10%;
|
||||
left: -10%;
|
||||
right: -10%;
|
||||
bottom: -10%;
|
||||
background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.1), transparent);
|
||||
animation: shine 2s infinite;
|
||||
}
|
||||
|
||||
&.not-login {
|
||||
.login-text {
|
||||
font-size: 40rpx;
|
||||
color: #fff;
|
||||
font-weight: 500;
|
||||
margin-bottom: 12rpx;
|
||||
display: block;
|
||||
}
|
||||
.avatar {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background: #fff;
|
||||
}
|
||||
}
|
||||
|
||||
.login-desc {
|
||||
font-size: 28rpx;
|
||||
color: rgba(255,255,255,0.9);
|
||||
display: block;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
.info-content {
|
||||
|
||||
.wave-decoration {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
height: 120rpx;
|
||||
background: url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAxNDQwIDMyMCI+PHBhdGggZmlsbD0icmdiYSgyNTUsMjU1LDI1NSwwLjEpIiBkPSJNMCwyNjAuMjI3YzE3My42NjEsMCwzMjEuMTM3LDAsNDQyLjQyOCwwYzE4MS41MTcsMCwyODUuNjQ1LDAsMzk3LjU3MiwwQzk1Mi4zODksMjYwLjIyNywxMTQwLjI3MSwyNjAuMjI3LDE0NDAsMjYwLjIyN1YwSDBWMjYwLjIyN3oiLz48L3N2Zz4=') bottom/100% no-repeat;
|
||||
opacity: 0.8;
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes float {
|
||||
0%, 100% {
|
||||
transform: translateY(0) scale(1);
|
||||
}
|
||||
50% {
|
||||
transform: translateY(-20rpx) scale(1.1);
|
||||
}
|
||||
}
|
||||
&.not-login {
|
||||
.login-text {
|
||||
font-size: 40rpx;
|
||||
color: #fff;
|
||||
font-weight: 500;
|
||||
margin-bottom: 12rpx;
|
||||
display: block;
|
||||
}
|
||||
|
||||
@keyframes shine {
|
||||
0% {
|
||||
transform: translateX(-100%) rotate(45deg);
|
||||
}
|
||||
80%, 100% {
|
||||
transform: translateX(100%) rotate(45deg);
|
||||
}
|
||||
}
|
||||
.login-desc {
|
||||
font-size: 28rpx;
|
||||
color: rgba(255, 255, 255, 0.9);
|
||||
display: block;
|
||||
}
|
||||
}
|
||||
|
||||
.balance-card {
|
||||
margin: -60rpx 30rpx 30rpx;
|
||||
background: #fff;
|
||||
border-radius: 24rpx;
|
||||
padding: 40rpx;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
position: relative;
|
||||
z-index: 3;
|
||||
box-shadow: 0 8rpx 32rpx rgba(25,118,210,0.1);
|
||||
.text-group {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
gap: 16rpx;
|
||||
|
||||
.balance-content {
|
||||
.label {
|
||||
font-size: 28rpx;
|
||||
color: #666;
|
||||
margin-bottom: 12rpx;
|
||||
display: block;
|
||||
}
|
||||
.nickname {
|
||||
font-size: 42rpx;
|
||||
color: #ffffff;
|
||||
font-weight: 600;
|
||||
text-shadow: 0 2rpx 4rpx rgba(0, 0, 0, 0.1);
|
||||
letter-spacing: 2rpx;
|
||||
}
|
||||
|
||||
.amount {
|
||||
font-size: 52rpx;
|
||||
color: #1976D2;
|
||||
font-weight: bold;
|
||||
}
|
||||
}
|
||||
.phone {
|
||||
font-size: 30rpx;
|
||||
color: rgba(255, 255, 255, 0.85);
|
||||
font-weight: 400;
|
||||
letter-spacing: 1rpx;
|
||||
position: relative;
|
||||
padding: 4rpx 24rpx;
|
||||
background: rgba(255, 255, 255, 0.15);
|
||||
border-radius: 24rpx;
|
||||
backdrop-filter: blur(4px);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.withdraw-btn {
|
||||
padding: 20rpx 36rpx;
|
||||
background: linear-gradient(135deg, #1976D2, #42A5F5);
|
||||
color: #fff;
|
||||
border-radius: 36rpx;
|
||||
font-size: 30rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
box-shadow: 0 4rpx 12rpx rgba(25,118,210,0.2);
|
||||
|
||||
&:active {
|
||||
transform: scale(0.98);
|
||||
}
|
||||
|
||||
.arrow {
|
||||
width: 12rpx;
|
||||
height: 12rpx;
|
||||
border-top: 3rpx solid #fff;
|
||||
border-right: 3rpx solid #fff;
|
||||
transform: rotate(45deg);
|
||||
margin-left: 12rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
.wave-decoration {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
height: 120rpx;
|
||||
background: url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAxNDQwIDMyMCI+PHBhdGggZmlsbD0icmdiYSgyNTUsMjU1LDI1NSwwLjEpIiBkPSJNMCwyNjAuMjI3YzE3My42NjEsMCwzMjEuMTM3LDAsNDQyLjQyOCwwYzE4MS41MTcsMCwyODUuNjQ1LDAsMzk3LjU3MiwwQzk1Mi4zODksMjYwLjIyNywxMTQwLjI3MSwyNjAuMjI3LDE0NDAsMjYwLjIyN1YwSDBWMjYwLjIyN3oiLz48L3N2Zz4=') bottom/100% no-repeat;
|
||||
opacity: 0.8;
|
||||
}
|
||||
}
|
||||
|
||||
.function-list {
|
||||
margin: 0 30rpx;
|
||||
background: #fff;
|
||||
border-radius: 24rpx;
|
||||
padding: 10rpx 20rpx;
|
||||
box-shadow: 0 4rpx 16rpx rgba(0,0,0,0.04);
|
||||
@keyframes float {
|
||||
|
||||
.function-item {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
padding: 32rpx 20rpx;
|
||||
border-bottom: 1rpx solid #f5f5f5;
|
||||
transition: all 0.3s;
|
||||
0%,
|
||||
100% {
|
||||
transform: translateY(0) scale(1);
|
||||
}
|
||||
|
||||
&:active {
|
||||
background: #f9f9f9;
|
||||
}
|
||||
50% {
|
||||
transform: translateY(-20rpx) scale(1.1);
|
||||
}
|
||||
}
|
||||
|
||||
&:last-child {
|
||||
border-bottom: none;
|
||||
}
|
||||
@keyframes shine {
|
||||
0% {
|
||||
transform: translateX(-100%) rotate(45deg);
|
||||
}
|
||||
|
||||
.item-left {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
80%,
|
||||
100% {
|
||||
transform: translateX(100%) rotate(45deg);
|
||||
}
|
||||
}
|
||||
|
||||
.icon-wrap {
|
||||
width: 80rpx;
|
||||
height: 80rpx;
|
||||
margin-right: 24rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
border-radius: 20rpx;
|
||||
background: #F5F9FF;
|
||||
.balance-card {
|
||||
margin: -60rpx 30rpx 30rpx;
|
||||
background: #fff;
|
||||
border-radius: 24rpx;
|
||||
padding: 40rpx;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
position: relative;
|
||||
z-index: 3;
|
||||
box-shadow: 0 8rpx 32rpx rgba(25, 118, 210, 0.1);
|
||||
|
||||
.icon-image {
|
||||
width: 44rpx;
|
||||
height: 44rpx;
|
||||
}
|
||||
}
|
||||
.balance-content {
|
||||
.label {
|
||||
font-size: 28rpx;
|
||||
color: #666;
|
||||
margin-bottom: 12rpx;
|
||||
display: block;
|
||||
}
|
||||
|
||||
.title {
|
||||
font-size: 32rpx;
|
||||
color: #333;
|
||||
font-weight: 500;
|
||||
}
|
||||
}
|
||||
.amount {
|
||||
font-size: 52rpx;
|
||||
color: #1976D2;
|
||||
font-weight: bold;
|
||||
}
|
||||
}
|
||||
|
||||
.arrow {
|
||||
width: 16rpx;
|
||||
height: 16rpx;
|
||||
border-top: 3rpx solid #999;
|
||||
border-right: 3rpx solid #999;
|
||||
transform: rotate(45deg);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
.withdraw-btn {
|
||||
padding: 20rpx 36rpx;
|
||||
background: linear-gradient(135deg, #1976D2, #42A5F5);
|
||||
color: #fff;
|
||||
border-radius: 36rpx;
|
||||
font-size: 30rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
box-shadow: 0 4rpx 12rpx rgba(25, 118, 210, 0.2);
|
||||
|
||||
&:active {
|
||||
transform: scale(0.98);
|
||||
}
|
||||
|
||||
.arrow {
|
||||
width: 12rpx;
|
||||
height: 12rpx;
|
||||
border-top: 3rpx solid #fff;
|
||||
border-right: 3rpx solid #fff;
|
||||
transform: rotate(45deg);
|
||||
margin-left: 12rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.function-list {
|
||||
margin: 0 30rpx;
|
||||
background: #fff;
|
||||
border-radius: 24rpx;
|
||||
padding: 10rpx 20rpx;
|
||||
box-shadow: 0 4rpx 16rpx rgba(0, 0, 0, 0.04);
|
||||
|
||||
.function-item {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
padding: 32rpx 20rpx;
|
||||
border-bottom: 1rpx solid #f5f5f5;
|
||||
transition: all 0.3s;
|
||||
|
||||
&:active {
|
||||
background: #f9f9f9;
|
||||
}
|
||||
|
||||
&:last-child {
|
||||
border-bottom: none;
|
||||
}
|
||||
|
||||
.item-left {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
.icon-wrap {
|
||||
width: 80rpx;
|
||||
height: 80rpx;
|
||||
margin-right: 24rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
border-radius: 20rpx;
|
||||
background: #F5F9FF;
|
||||
|
||||
.icon-image {
|
||||
width: 44rpx;
|
||||
height: 44rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.title {
|
||||
font-size: 32rpx;
|
||||
color: #333;
|
||||
font-weight: 500;
|
||||
}
|
||||
}
|
||||
|
||||
.arrow {
|
||||
width: 16rpx;
|
||||
height: 16rpx;
|
||||
border-top: 3rpx solid #999;
|
||||
border-right: 3rpx solid #999;
|
||||
transform: rotate(45deg);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.popup-content {
|
||||
background-color: #fff;
|
||||
border-radius: 24rpx 24rpx 0 0;
|
||||
padding: 40rpx 30rpx;
|
||||
|
||||
.popup-title {
|
||||
font-size: 32rpx;
|
||||
font-weight: 500;
|
||||
text-align: center;
|
||||
margin-bottom: 40rpx;
|
||||
}
|
||||
|
||||
.popup-body {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 30rpx;
|
||||
}
|
||||
|
||||
.avatar-btn {
|
||||
height: 88rpx;
|
||||
line-height: 88rpx;
|
||||
background: #f5f5f5;
|
||||
border-radius: 44rpx;
|
||||
font-size: 28rpx;
|
||||
color: #333;
|
||||
|
||||
&::after {
|
||||
border: none;
|
||||
}
|
||||
|
||||
&:active {
|
||||
opacity: 0.8;
|
||||
}
|
||||
}
|
||||
|
||||
.nickname-input {
|
||||
height: 88rpx;
|
||||
background: #f5f5f5;
|
||||
border-radius: 44rpx;
|
||||
padding: 0 30rpx;
|
||||
font-size: 28rpx;
|
||||
}
|
||||
|
||||
.submit-btn {
|
||||
height: 88rpx;
|
||||
line-height: 88rpx;
|
||||
background: #1976D2;
|
||||
color: #fff;
|
||||
border-radius: 44rpx;
|
||||
font-size: 30rpx;
|
||||
margin-top: 20rpx;
|
||||
|
||||
&:active {
|
||||
opacity: 0.9;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -51,6 +51,7 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {getOrderList} from '../../config/user.js'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
@@ -78,6 +79,10 @@ export default {
|
||||
]
|
||||
}
|
||||
},
|
||||
async onLoad() {
|
||||
const res= await getOrderList()
|
||||
console.log(res);
|
||||
},
|
||||
methods: {
|
||||
switchTab(index) {
|
||||
this.currentTab = index
|
||||
|
||||
@@ -0,0 +1,48 @@
|
||||
<template>
|
||||
<view>
|
||||
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
wxLogin,
|
||||
} from '../../../util/index'
|
||||
|
||||
import {
|
||||
queryHasOrder
|
||||
} from '@/config/user.js'
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
|
||||
}
|
||||
},
|
||||
async onLoad(option) {
|
||||
|
||||
if (!uni.getStorageSync('token')) {
|
||||
const res = await wxLogin();
|
||||
console.log(333, res);
|
||||
}
|
||||
|
||||
const reuslt = await queryHasOrder(111)
|
||||
if (reuslt.data.length != 0) {
|
||||
uni.reLaunch({
|
||||
url: `/pages/device/return?deviceNo=${option.deviceNo}`
|
||||
})
|
||||
} else {
|
||||
uni.reLaunch({
|
||||
url: `/pages/device/detail?deviceNo=${option.deviceNo}`
|
||||
})
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
|
||||
</style>
|
||||
Reference in New Issue
Block a user