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
+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'
})
}
});
}
}
};