This commit is contained in:
2025-03-20 10:58:18 +08:00
parent 4d21314fc6
commit ce0ab24c57
24 changed files with 791 additions and 138 deletions
+26 -19
View File
@@ -46,31 +46,33 @@
<block v-for="(item,index) in orderList" :key="index">
<uni-card :border="false" :is-shadow="false" :padding="0">
<template v-slot:title>
<div class="order-title web-cell">
<view class="order-title web-cell text-25">
<view class="web-cell web-cell-content">
<text class="merchant-name">订单号: {{ item.orderNum }}</text>
</view>
<view class="web-cell web-cell-content flex justify-between items-center" v-if="orderType === 1">
<text class="merchant-name">{{ item.siteNames }}</text>
<view class="web-cell web-cell-content flex justify-end items-end" v-if="orderType === 1">
<!-- <text class="merchant-name">{{ item.siteNames }}</text>-->
<text class="text-25 text-red" v-if="item.status === 2">待支付</text>
<text class="text-25 text-green" v-else-if="item.status === 1">已支付</text>
<text class="text-25 text-gray" v-else-if="item.status === 3">已退款</text>
<text class="text-25 text-gray" v-else-if="item.status === 0">已取消</text>
</view>
<block v-if="item.orderStatus === 3">
<text class="btn-status web-text-secondary">已取消</text>
</block>
<block v-else-if="item.orderStatus === 1">
<text class="btn-status web-text-success">已完成</text>
</block>
<block v-else>
<text v-if="item.payStatus === 1" class="btn-status web-text-success">已支付</text>
<view v-if="item.payStatus === 0" class="btn-status web-text-danger">
<uv-count-down :time="item.timestamp" format="mm:ss"></uv-count-down>
<text class="no-pay" style="margin-left: 10rpx;">未支付</text>
</view>
</block>
</div>
<template v-else>
<block v-if="item.orderStatus === 3">
<text class=" web-text-secondary">已取消</text>
</block>
<block v-else-if="item.orderStatus === 1">
<text class=" web-text-success">已完成</text>
</block>
<block v-else>
<text v-if="item.payStatus === 1" class=" web-text-success">已支付</text>
<view v-if="item.payStatus === 0" class=" web-text-danger">
<uv-count-down :time="item.timestamp" format="mm:ss"></uv-count-down>
<text class="no-pay" style="margin-left: 10rpx;">未支付</text>
</view>
</block>
</template>
</view>
</template>
<view class="order-body web-cell web-cell-align-top">
<view class="web-cell-content" @click="toDetail(item.id)">
@@ -295,7 +297,9 @@ export default {
this.hasMerchantClerkRole = userInfo.roles.find((d) => d.roleCode === 'merchantClerk');
this.hasSuperAdminRole = userInfo.roles.find((d) => d.roleCode === 'superAdmin');
}
await this.reload()
if (uni.getStorageSync('orderType')) {
this.confirmOrderType({value: [JSON.parse(uni.getStorageSync('orderType'))]})
} else this.reset()
},
// 触底函数
onReachBottom() {
@@ -319,6 +323,9 @@ export default {
confirmOrderType({value}) {
this.orderType = value[0].value
this.orderTypeStr = value[0].label
if (uni.getStorageSync('orderType')) {
uni.removeStorageSync('orderType')
}
this.reload()
},
confirmOrderStatus({value}) {
@@ -591,7 +598,7 @@ export default {
})
await addThinkOrderRefundLog({
uid: order.uid,
refundAmount: order.payPrice,
refundAmount: order.price,
sid: order.sid,
oid: order.id,
status: 1,
+73 -20
View File
@@ -35,22 +35,22 @@
</view>
</block>
</block>
<view class="flex justify-between items-center py-20 border-bottom" @click="scan">
<view class="flex justify-between items-center py-20 border-bottom" @click="showActionSheet">
<view class="flex justify-start items-center">
<uv-icon name="https://oss.wsdns.cn/20241126/92f728b3b4e146d6a916259bde11a209.png"/>
<text class="text-30 ml-20">扫码核销</text>
</view>
<uv-icon name="arrow-right" size="24rpx"/>
</view>
<!-- <button class="share-btn" open-type="contact">-->
<!-- <view class="flex justify-between items-center py-20 border-bottom">-->
<!-- <view class="flex justify-start items-center">-->
<!-- <uv-icon name="https://oss.wsdns.cn/20240806/670b965e729b4a92a60927bf51bc8afe.png"/>-->
<!-- <text class="text-30 ml-20" style="font-weight: normal!important;">联系客服</text>-->
<!-- </view>-->
<!-- <uv-icon name="arrow-right" size="24rpx"/>-->
<!-- </view>-->
<!-- </button>-->
<!-- <button class="share-btn" open-type="contact">-->
<!-- <view class="flex justify-between items-center py-20 border-bottom">-->
<!-- <view class="flex justify-start items-center">-->
<!-- <uv-icon name="https://oss.wsdns.cn/20240806/670b965e729b4a92a60927bf51bc8afe.png"/>-->
<!-- <text class="text-30 ml-20" style="font-weight: normal!important;">联系客服</text>-->
<!-- </view>-->
<!-- <uv-icon name="arrow-right" size="24rpx"/>-->
<!-- </view>-->
<!-- </button>-->
</view>
<!-- <view class="server" style="min-height: 200px">-->
<!-- <uni-list :border="false">-->
@@ -93,15 +93,15 @@
</view>
</block>
</block>
<!-- <button class="share-btn" open-type="contact">-->
<!-- <view class="flex justify-between items-center py-20 border-bottom">-->
<!-- <view class="flex justify-start items-center">-->
<!-- <uv-icon name="https://oss.wsdns.cn/20240806/670b965e729b4a92a60927bf51bc8afe.png"/>-->
<!-- <text class="text-30 ml-20" style="font-weight: normal!important;">联系客服</text>-->
<!-- </view>-->
<!-- <uv-icon name="arrow-right" size="24rpx"/>-->
<!-- </view>-->
<!-- </button>-->
<!-- <button class="share-btn" open-type="contact">-->
<!-- <view class="flex justify-between items-center py-20 border-bottom">-->
<!-- <view class="flex justify-start items-center">-->
<!-- <uv-icon name="https://oss.wsdns.cn/20240806/670b965e729b4a92a60927bf51bc8afe.png"/>-->
<!-- <text class="text-30 ml-20" style="font-weight: normal!important;">联系客服</text>-->
<!-- </view>-->
<!-- <uv-icon name="arrow-right" size="24rpx"/>-->
<!-- </view>-->
<!-- </button>-->
</view>
<!-- <uni-list :border="false">-->
<!-- <block v-for="(item, index) in mpMenus" :key="index">-->
@@ -170,6 +170,16 @@
<!-- 退出按钮 -->
<ws-logout v-if="isLogin" @done="reload"></ws-logout>
</block>
<uv-action-sheet
safeAreaInsetBottom
closeOnClickOverlay
round="15"
cancelText="取消"
ref="actionSheet"
:actions="[{name: '订单核销'}, {name: '游泳年/月卡使用'}]"
title="请选择操作"
@select="selectActionSheet">
</uv-action-sheet>
</layout>
</template>
@@ -186,7 +196,7 @@ import Layout from "@/components/layout.vue";
import {useTenantStore} from '@/store/modules/tenant';
import {authUser} from "@/api/user";
import UvAvatar from "@/uni_modules/uv-avatar/components/uv-avatar/uv-avatar.vue";
import {getThinkOrderByCode} from "@/api/think/thinkOrder";
import {getThinkOrderByCode, thinkOrderCheckCode} from "@/api/think/thinkOrder";
const tenantStore = useTenantStore();
const mpStore = useMpStore();
@@ -388,6 +398,49 @@ export default {
})
}
});
},
showActionSheet(){
this.$refs.actionSheet.open()
},
selectActionSheet({name}){
if (name === '订单核销') {
this.scan()
}
else if (name === '游泳年/月卡使用') {
this.useCard()
}
},
async useCard(){
uni.scanCode({
onlyFromCamera: true,
success: async ({result}) => {
const res = await thinkOrderCheckCode({qrcode: result}).catch(err => {
uni.showToast({
title: err.data,
icon: 'none'
})
})
if (res) {
uni.showToast({
title: '使用成功',
icon: 'success'
})
}
// if (!res.res) return uni.showToast({
// title: res.msg,
// icon: 'none'
// })
// uni.navigateTo({url: `/package/order/check?id=${res.data.id}`})
console.log(res)
},
fail: (err) => {
uni.showToast({
title: '扫码失败',
icon: 'none'
})
}
});
}
}
};