完善功能
This commit is contained in:
@ -119,7 +119,7 @@
|
||||
<view class="flex justify-end">
|
||||
<view class="flex items-center">
|
||||
<view class="font-400 text-[#303133] text-30rpx leading-42rpx">
|
||||
2.14.12
|
||||
2.14.16
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
@ -169,7 +169,7 @@
|
||||
</view>
|
||||
|
||||
<!-- 茶艺师资格证书 -->
|
||||
<view class="bg-white rounded-16rpx px-30rpx py-28rpx mt-20rpx">
|
||||
<!-- <view class="bg-white rounded-16rpx px-30rpx py-28rpx mt-20rpx">
|
||||
<view class="flex items-center">
|
||||
<view class="text-32rpx leading-44rpx text-#303133 mr-10rpx">茶艺师资格证书</view>
|
||||
<view class="flex items-center">
|
||||
@ -191,7 +191,7 @@
|
||||
</view>
|
||||
</wd-upload>
|
||||
</view>
|
||||
</view>
|
||||
</view> -->
|
||||
|
||||
<!-- 身份证 -->
|
||||
<view class="bg-white rounded-16rpx px-30rpx py-28rpx mt-20rpx">
|
||||
@ -253,7 +253,7 @@
|
||||
</view>
|
||||
|
||||
<!-- 健康证书信息 -->
|
||||
<view class="bg-white rounded-16rpx px-30rpx py-28rpx mt-20rpx">
|
||||
<!-- <view class="bg-white rounded-16rpx px-30rpx py-28rpx mt-20rpx">
|
||||
<view class="flex items-center">
|
||||
<view class="text-32rpx leading-44rpx text-#303133 mr-10rpx">健康证</view>
|
||||
</view>
|
||||
@ -272,7 +272,7 @@
|
||||
</wd-upload>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view> -->
|
||||
|
||||
<!-- 联系方式 -->
|
||||
<view class="bg-white rounded-16rpx px-30rpx py-32rpx mt-20rpx">
|
||||
@ -327,8 +327,12 @@
|
||||
class="text-32rpx leading-44rpx flex items-center justify-center leading-90rpx text-center text-[#303133] mt-112rpx pb-66rpx">
|
||||
<view class="w-330rpx h-90rpx bg-[#FFFFFF] rounded-8rpx mr-30rpx"
|
||||
@click="router.navigateTo('/bundle/contact/contact')">联系我们</view>
|
||||
<view class="w-330rpx h-90rpx bg-[#4C9F44] rounded-8rpx text-#fff" @click="TeaSpecialist.handleSubmit">
|
||||
提交申请</view>
|
||||
<view class="w-330rpx h-90rpx bg-[#4C9F44] rounded-8rpx text-#fff flex items-center justify-center"
|
||||
:class="{ 'bg-[#C9C9C9]': isSubmitting }"
|
||||
@click="TeaSpecialist.handleSubmit">
|
||||
<text v-if="!isSubmitting">提交申请</text>
|
||||
<text v-else>提交中...</text>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
@ -369,10 +373,13 @@ const countDownTime = ref<number>(1 * 60 * 1000) // 60s倒计时
|
||||
const startCountDown = ref<boolean>(false) // 是否开始倒计时
|
||||
const countDown = ref<any>(null) // 倒计时组件
|
||||
|
||||
// 防重复提交
|
||||
const isSubmitting = ref<boolean>(false) // 是否正在提交
|
||||
|
||||
|
||||
// 表单
|
||||
const form = ref<{
|
||||
license_img: string // 营业执照
|
||||
// license_img: string // 营业执照
|
||||
username: string // 茶艺师名字
|
||||
gender: number // 茶艺师性别(1男 2女)
|
||||
both: number | string // 出生年月
|
||||
@ -382,7 +389,7 @@ const form = ref<{
|
||||
avatar: string // 头像
|
||||
mobile: string // 联系电话
|
||||
code: string // 验证码
|
||||
health_certificate?: string // 健康证
|
||||
// health_certificate?: string // 健康证
|
||||
information?: string // 个人展示
|
||||
image?: string // 个人展示
|
||||
front_card?: string // 身份证正面
|
||||
@ -390,7 +397,7 @@ const form = ref<{
|
||||
broker_user_id?: number // 经纪人ID(可选,扫码绑定经纪人时携带)
|
||||
label_id?: string // 专属圈子标签ID,逗号分隔
|
||||
}>({
|
||||
license_img: '', // 营业执照
|
||||
// license_img: '', // 营业执照
|
||||
username: '', // 茶艺师名字
|
||||
gender: 2, // 茶艺师性别(1男 2女)
|
||||
both: '', // 出生年月
|
||||
@ -400,7 +407,7 @@ const form = ref<{
|
||||
avatar: '', // 头像
|
||||
mobile: '', // 联系电话
|
||||
code: '', // 验证码
|
||||
health_certificate: '', // 健康证
|
||||
// health_certificate: '', // 健康证
|
||||
information: '', // 个人展示(2026-04-07暂时废弃)
|
||||
image: '', // 本人照片
|
||||
front_card: '', // 身份证正面
|
||||
@ -572,10 +579,10 @@ const TeaSpecialist = {
|
||||
// return false
|
||||
// }
|
||||
|
||||
if (fileList.value.length == 0) {
|
||||
toast.show('请上传茶艺师资格证书')
|
||||
return false
|
||||
}
|
||||
// if (fileList.value.length == 0) {
|
||||
// toast.show('请上传茶艺师资格证书')
|
||||
// return false
|
||||
// }
|
||||
|
||||
// if (fileList4.value.length == 0) {
|
||||
// toast.show('请至少上传一张个人展示照片')
|
||||
@ -593,9 +600,9 @@ const TeaSpecialist = {
|
||||
}
|
||||
|
||||
form.value.label_id = selectedTags.value.join(',') // 专属圈子标签ID,逗号分隔
|
||||
form.value.license_img = fileList.value.length > 0 ? removeImageUrlPrefix(fileList.value)[0] : '' // 茶艺师资格证书
|
||||
// form.value.license_img = fileList.value.length > 0 ? removeImageUrlPrefix(fileList.value)[0] : '' // 茶艺师资格证书
|
||||
form.value.avatar = fileList2.value.length > 0 ? removeImageUrlPrefix(fileList2.value)[0] : '' // 个人照片
|
||||
form.value.health_certificate = fileList3.value.length > 0 ? removeImageUrlPrefix(fileList3.value)[0] : '' // 健康证
|
||||
// form.value.health_certificate = fileList3.value.length > 0 ? removeImageUrlPrefix(fileList3.value)[0] : '' // 健康证
|
||||
form.value.image = fileList4.value.length > 0 ? removeImageUrlPrefix(fileList4.value) : '' // 个人展示
|
||||
form.value.image = Array.isArray(form.value.image) ? form.value.image.join(',') : form.value.image
|
||||
form.value.front_card = frontCard.value.length > 0 ? removeImageUrlPrefix(frontCard.value)[0] : '' // 身份证正面
|
||||
@ -604,6 +611,12 @@ const TeaSpecialist = {
|
||||
let data = form.value
|
||||
data.both = both.value
|
||||
|
||||
// 防重复提交
|
||||
if (isSubmitting.value) {
|
||||
return
|
||||
}
|
||||
isSubmitting.value = true
|
||||
|
||||
toast.loading({
|
||||
loadingType: 'ring',
|
||||
loadingColor: '#4C9F44',
|
||||
@ -619,7 +632,8 @@ const TeaSpecialist = {
|
||||
}, 100)
|
||||
} catch (e) {
|
||||
toast.close()
|
||||
return
|
||||
} finally {
|
||||
isSubmitting.value = false // 无论成功失败都要重置状态
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -412,7 +412,7 @@
|
||||
*/
|
||||
handleToRecharge: () => {
|
||||
// router.navigateTo(`/bundle/store-recharge/store-recharge?id=${teaRoom.value.id}&storeName=${teaRoom.value.name}`)
|
||||
router.navigateTo('/bundle/wallet/recharge?storeId=' + teaRoom.value.id)
|
||||
router.navigateTo('/bundle/wallet/recharge-store?storeId=' + teaRoom.value.id)
|
||||
},
|
||||
|
||||
/**
|
||||
|
||||
183
src/bundle/wallet/recharge-store.vue
Normal file
183
src/bundle/wallet/recharge-store.vue
Normal file
@ -0,0 +1,183 @@
|
||||
<route lang="jsonc" type="page">
|
||||
{
|
||||
"needLogin": true,
|
||||
"layout": "default",
|
||||
"style": {
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
}
|
||||
</route>
|
||||
|
||||
<template>
|
||||
<view class="bg">
|
||||
<view>
|
||||
<navbar title="平台充值" custom-class='!bg-[#F6F7F8]'></navbar>
|
||||
</view>
|
||||
|
||||
<view class="mt-24rpx text-center font-400 text-30rpx leading-42rpx text-[#303133]" v-if="rechargeList.length == 0">
|
||||
当前平台暂无充值活动
|
||||
</view>
|
||||
|
||||
|
||||
<view class="mt-24rpx mx-30rpx" v-if="rechargeList.length > 0">
|
||||
<view class="ml-70rpx flex items-center">
|
||||
<view class="font-400 text-30rpx leading-42rpx text-[#303133]">
|
||||
充值活动
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="mt-32rpx recharge-radio" >
|
||||
<wd-radio-group v-model="rechargeValue">
|
||||
<view
|
||||
class="bg-white rounded-16rpx mt-20rpx px-30rpx py-28rpx flex items-center justify-between border border-2rpx border-solid border-[#FFF]"
|
||||
:class="{acitve: item.id === rechargeValue }"
|
||||
v-for="item in rechargeList" :key="item.id"
|
||||
@click="rechargeValue = item.id">
|
||||
<view class="text-28rpx text-[#606266] leading-40rpx flex items-center">
|
||||
<view class="text-36rpx leading-50rpx text-[#121212] mr-24rpx">充{{ item.price }}</view>
|
||||
<view class="flex items-center">
|
||||
<view class="w-44rpx h-44rpx rounded-44rpx bg-[#FF5951] text-[#fff] text-30rpx text-center leading-44rpx mr-18rpx">送</view>
|
||||
<view class="font-bold text-32rpx leading-40rpx text-[#FF5951]">{{ item.gift_price }}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="flex items-center">
|
||||
<wd-radio :value="item.id" checked-color="#4C9F44" size='large' shape="dot"></wd-radio>
|
||||
</view>
|
||||
</view>
|
||||
</wd-radio-group>
|
||||
</view>
|
||||
|
||||
|
||||
<view class="fixed left-0 right-0 bottom-92rpx z-2 bg-[#4C9F44] text-[#fff] flex justify-center items-center h-90rpx rounded-8rpx mx-60rpx" @click="Recharge.handleRecharge">
|
||||
充值
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { PayList, PayCategory, PayValue, PayOrderType, PayOrderSource, PayValueMap } from '@/utils/pay'
|
||||
import { teaRoomRecharge, getRechargeActivity } from '@/api/tea-room'
|
||||
import { wechatPay } from '@/hooks/usePay'
|
||||
import { createRechargeOrder, newPrePay } from '@/api/pay'
|
||||
import { useToast } from 'wot-design-uni'
|
||||
|
||||
const toast = useToast()
|
||||
|
||||
// 门店ID
|
||||
const storeId = ref<number>(0)
|
||||
const rechargeList = ref<Array<{
|
||||
id: number
|
||||
price: number
|
||||
gift_price: number
|
||||
title: string
|
||||
}>>([]) // 充值活动列表
|
||||
const rechargeValue = ref<number>(0) // 充值活动选择
|
||||
|
||||
|
||||
onLoad((args) => {
|
||||
storeId.value = Number(args.storeId) || 0
|
||||
if (storeId.value) {
|
||||
Recharge.handleInit()
|
||||
}
|
||||
})
|
||||
|
||||
const Recharge = {
|
||||
/**
|
||||
* 充值活动列表
|
||||
*/
|
||||
handleInit: async () => {
|
||||
const res = await getRechargeActivity({store_id: storeId.value})
|
||||
rechargeList.value = res || []
|
||||
},
|
||||
|
||||
/**
|
||||
* 购买套餐
|
||||
*/
|
||||
handleRecharge: async () => {
|
||||
if (rechargeValue.value === 0) {
|
||||
toast.show('请选择充值套餐')
|
||||
return
|
||||
}
|
||||
|
||||
toast.loading({
|
||||
loadingType: 'ring',
|
||||
loadingColor: '#4C9F44',
|
||||
msg: '操作中...'
|
||||
})
|
||||
try {
|
||||
// 先请求充值接口
|
||||
const res = await createRechargeOrder({id: rechargeValue.value})
|
||||
|
||||
if (res.order_id) {
|
||||
// 预支付
|
||||
const pay = await newPrePay({
|
||||
from: PayValueMap[PayValue.WeChatPay],
|
||||
order_id: res.order_id, //如果是续单的话,则用续单的订单ID
|
||||
pay_way: PayValue.WeChatPay,
|
||||
order_source: PayOrderSource.MINI, //订单来源:1-小程序; 2-h5; 3app
|
||||
order_type: PayOrderType.TeaRoomRecharge, // 茶艺师订单
|
||||
})
|
||||
|
||||
wechatPay(pay.config).then((res) => {
|
||||
uni.hideLoading()
|
||||
if (res === 'success') {
|
||||
setTimeout(() => {
|
||||
toast.success('支付成功')
|
||||
}, 100);
|
||||
return
|
||||
} else if (res === 'cancel') {
|
||||
setTimeout(() => {
|
||||
toast.show('已取消支付')
|
||||
}, 100);
|
||||
return
|
||||
} else {
|
||||
setTimeout(() => {
|
||||
toast.show('支付失败,请重试')
|
||||
}, 100);
|
||||
return
|
||||
}
|
||||
}).catch(() => {
|
||||
toast.close()
|
||||
})
|
||||
} else {
|
||||
toast.close()
|
||||
}
|
||||
} catch (error) {
|
||||
toast.close()
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
page {
|
||||
background: $cz-page-background;
|
||||
}
|
||||
|
||||
.pay-tabs {
|
||||
:deep() {
|
||||
.wd-tabs__line {
|
||||
background-color: #4C9F44;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.recharge-radio {
|
||||
:deep() {
|
||||
.wd-radio-group {
|
||||
background-color: transparent !important;
|
||||
}
|
||||
|
||||
.wd-radio {
|
||||
margin-top: 0 !important;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.acitve {
|
||||
background: #FFF4F4;
|
||||
border: 2rpx solid #FF5951;
|
||||
}
|
||||
</style>
|
||||
@ -11,147 +11,191 @@
|
||||
<template>
|
||||
<view class="bg">
|
||||
<view>
|
||||
<navbar title="平台充值" custom-class='!bg-[#F6F7F8]'></navbar>
|
||||
<navbar title="充值" custom-class='!bg-[#F6F7F8]'></navbar>
|
||||
</view>
|
||||
|
||||
<view class="mt-24rpx text-center font-400 text-30rpx leading-42rpx text-[#303133]" v-if="rechargeList.length == 0">
|
||||
当前平台暂无充值活动
|
||||
</view>
|
||||
|
||||
|
||||
<view class="mt-24rpx mx-30rpx" v-if="rechargeList.length > 0">
|
||||
<view class="mt-24rpx mx-30rpx">
|
||||
<view class="ml-70rpx flex items-center">
|
||||
<view class="font-400 text-30rpx leading-42rpx text-[#303133]">
|
||||
充值活动
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="mt-32rpx recharge-radio" >
|
||||
<wd-radio-group v-model="rechargeValue">
|
||||
<view
|
||||
class="bg-white rounded-16rpx mt-20rpx px-30rpx py-28rpx flex items-center justify-between border border-2rpx border-solid border-[#FFF]"
|
||||
:class="{acitve: item.id === rechargeValue }"
|
||||
v-for="item in rechargeList" :key="item.id"
|
||||
@click="rechargeValue = item.id">
|
||||
<view class="text-28rpx text-[#606266] leading-40rpx flex items-center">
|
||||
<view class="text-36rpx leading-50rpx text-[#121212] mr-24rpx">充{{ item.price }}</view>
|
||||
<view class="flex items-center">
|
||||
<view class="w-44rpx h-44rpx rounded-44rpx bg-[#FF5951] text-[#fff] text-30rpx text-center leading-44rpx mr-18rpx">送</view>
|
||||
<view class="font-bold text-32rpx leading-40rpx text-[#FF5951]">{{ item.gift_price }}</view>
|
||||
</view>
|
||||
<view class="mr-72rpx font-400 text-30rpx leading-42rpx text-[#303133]">
|
||||
充值方式
|
||||
</view>
|
||||
<view class="flex items-center">
|
||||
<wd-radio :value="item.id" checked-color="#4C9F44" size='large' shape="dot"></wd-radio>
|
||||
<view class="flex items-center mr-20rpx">
|
||||
<wd-img width="50rpx" height="50rpx" :src="`${OSS}icon/icon_weichat.png`"></wd-img>
|
||||
</view>
|
||||
<view class="font-bold text-32rpx leading-44rpx text-[#303133]">微信</view>
|
||||
</view>
|
||||
</wd-radio-group>
|
||||
</view>
|
||||
|
||||
<view class="bg-white rounded-16rpx px-38rpx py-28rpx mt-28rpx">
|
||||
<view class="font-400 text-28rpx leading-40rpx text-[#303133]">
|
||||
充值方式
|
||||
</view>
|
||||
<view class="flex items-center">
|
||||
<view class="font-400 text-36rpx leading-50rpx text-[#303133] mr-20rpx mt-40rpx">¥</view>
|
||||
<view class="mt-44rpx">
|
||||
<wd-input type="text" v-model="rechargeMoney" placeholder="请输入金额" no-border custom-input-class="!h-80rpx !text-48rpx !leading-66rpx" >
|
||||
</wd-input>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="fixed left-0 right-0 bottom-92rpx z-2 bg-[#4C9F44] text-[#fff] flex justify-center items-center h-90rpx rounded-8rpx mx-60rpx" @click="Recharge.handleRecharge">
|
||||
充值
|
||||
<!-- 推广方式 -->
|
||||
<!-- <view class="mt-60rpx">
|
||||
<view class="mx-30rpx text-32rpx leading-44rpx text-[#303133]">
|
||||
<text class="mr-12rpx">推广方式</text>
|
||||
<text class="text-26rpx leading-36rpx text-[#909399]">(选填)</text>
|
||||
</view>
|
||||
<view class="bg-white rounded-16rpx py-26rpx mt-28rpx pay-tabs">
|
||||
<wd-tabs v-model="tab" swipeable slidable="always">
|
||||
<wd-tab title="门店">
|
||||
<view>
|
||||
<wd-gap height="2rpx" bg-color="#F6F7F9"></wd-gap>
|
||||
</view>
|
||||
<view class="mx-30rpx mt-34rpx flex items-center">
|
||||
<view class="font-bold text-30rpx leading-42rpx text-[#303133] mr-28rpx">门店推广</view>
|
||||
<view class="bg-[#F8F9FA] px-28rpx p-20rpx text-30rpx text-[#C9C9C9] h-80rpx rounded-8rpx flex items-center flex-1" @click="showStorePopup = true">
|
||||
<text class="mr-14rpx">请选择门店</text>
|
||||
<wd-icon name="arrow-down" size="22rpx"></wd-icon>
|
||||
</view>
|
||||
</view>
|
||||
</wd-tab>
|
||||
<wd-tab title="茶艺师">
|
||||
<view>
|
||||
<wd-gap height="2rpx" bg-color="#F6F7F9"></wd-gap>
|
||||
</view>
|
||||
<view class="mx-30rpx mt-34rpx flex items-center">
|
||||
<view class="font-bold text-30rpx leading-42rpx text-[#303133] mr-28rpx">茶艺师推广</view>
|
||||
<view class="flex items-center flex-1">
|
||||
<wd-input type="text" v-model="person" no-border custom-class="!bg-[#F6F7F8] !rounded-8rpx w-full" custom-input-class="!px-32rpx !h-80rpx">
|
||||
</wd-input>
|
||||
</view>
|
||||
</view>
|
||||
</wd-tab>
|
||||
</wd-tabs>
|
||||
</view>
|
||||
</view> -->
|
||||
|
||||
<view class="fixed left-0 right-0 bottom-92rpx z-2 bg-[#4C9F44] text-[#fff] flex justify-center items-center h-90rpx rounded-8rpx mx-60rpx" @click="buy.handleRecharge">
|
||||
确定充值
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 推广方式 -->
|
||||
<wd-popup v-model="showStorePopup" lock-scroll custom-style="border-radius: 32rpx 32rpx 0rpx 0rpx;" position="bottom">
|
||||
<view class="relative">
|
||||
<view class="absolute top-18rpx right-30rpx" @click="showStorePopup = false">
|
||||
<wd-img width="60rpx" height='60rpx' :src="`${OSS}icon/icon_close.png`"></wd-img>
|
||||
</view>
|
||||
<view class="text-36rpx text-[#121212] leading-50rpx text-center pt-50rpx pb-40rpx">推广方式 </view>
|
||||
<scroll-view scroll-y class="h-500rpx pb-20rpx">
|
||||
<view class="mx-56rpx" v-for="(item, index) in 5" :key="index">
|
||||
<view class="flex items-center justify-between mb-66rpx" @click="buy.handleChooseStore(item)">
|
||||
<view class="mr-32rpx">
|
||||
<wd-img width="80rpx" height='80rpx' :src="`${OSS}icon/icon_location3.png`"></wd-img>
|
||||
</view>
|
||||
<view class="flex-1">
|
||||
<view>这是茶馆名字</view>
|
||||
<view class="text-28rpx leading-40rpx text-[#909399] flex items-center mt-10rpx">
|
||||
<view>距您5.3km</view>
|
||||
<view>
|
||||
<wd-divider vertical />
|
||||
</view>
|
||||
<view class="w-350rpx line-1">北京市海淀区宏福苑西区20号楼2单元30</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</scroll-view>
|
||||
</view>
|
||||
</wd-popup>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { PayList, PayCategory, PayValue, PayOrderType, PayOrderSource, PayValueMap } from '@/utils/pay'
|
||||
import { teaRoomRecharge, getRechargeActivity } from '@/api/tea-room'
|
||||
import { PayList, PayCategory, PayValue, PayOrderType, PayOrderSource } from '@/utils/pay'
|
||||
import { teaRoomRecharge } from '@/api/tea-room'
|
||||
import { wechatPay } from '@/hooks/usePay'
|
||||
import { createRechargeOrder, newPrePay } from '@/api/pay'
|
||||
import { useToast } from 'wot-design-uni'
|
||||
import { prePay, balancePay } from '@/api/pay'
|
||||
import { toast } from '@/utils/toast'
|
||||
|
||||
const toast = useToast()
|
||||
const pay = ref<number>(PayValue.WeChatPay) // 默认微信支付方式
|
||||
const OSS = inject('OSS')
|
||||
|
||||
// 门店ID
|
||||
const storeId = ref<number>(0)
|
||||
const rechargeList = ref<Array<{
|
||||
id: number
|
||||
price: number
|
||||
gift_price: number
|
||||
title: string
|
||||
}>>([]) // 充值活动列表
|
||||
const rechargeValue = ref<number>(0) // 充值活动选择
|
||||
// 推广方式
|
||||
const tab = ref<number>(0)
|
||||
const person = ref<string>('') // 个人推广码
|
||||
const showStorePopup = ref<boolean>(false) // 显示门店列表弹窗
|
||||
const rechargeMoney = ref<string>('')
|
||||
|
||||
onLoad(() => {
|
||||
|
||||
onLoad((args) => {
|
||||
storeId.value = Number(args.storeId) || 0
|
||||
if (storeId.value) {
|
||||
Recharge.handleInit()
|
||||
}
|
||||
})
|
||||
|
||||
const Recharge = {
|
||||
/**
|
||||
* 充值活动列表
|
||||
*/
|
||||
handleInit: async () => {
|
||||
const res = await getRechargeActivity({store_id: storeId.value})
|
||||
rechargeList.value = res || []
|
||||
const buy = {
|
||||
// 选择门店
|
||||
handleChooseStore: (item: any) => {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 购买套餐
|
||||
*/
|
||||
// 确定充值
|
||||
handleConfirmRecharge: () => {
|
||||
uni.navigateTo({
|
||||
url: '/pages/notice/pay?type=vip'
|
||||
})
|
||||
},
|
||||
|
||||
// 充值
|
||||
handleRecharge: async () => {
|
||||
if (rechargeValue.value === 0) {
|
||||
toast.show('请选择充值套餐')
|
||||
if (!rechargeMoney.value) {
|
||||
toast.info('请输入充值金额')
|
||||
return
|
||||
}
|
||||
|
||||
toast.loading({
|
||||
loadingType: 'ring',
|
||||
loadingColor: '#4C9F44',
|
||||
msg: '操作中...'
|
||||
})
|
||||
uni.showLoading({ title: '支付中...' })
|
||||
try {
|
||||
// 先请求充值接口
|
||||
const res = await createRechargeOrder({id: rechargeValue.value})
|
||||
const res = await teaRoomRecharge(Number(rechargeMoney.value))
|
||||
|
||||
if (res.order_id) {
|
||||
// 预支付
|
||||
const pay = await newPrePay({
|
||||
from: PayValueMap[PayValue.WeChatPay],
|
||||
order_id: res.order_id, //如果是续单的话,则用续单的订单ID
|
||||
pay_way: PayValue.WeChatPay,
|
||||
const pay = await prePay({
|
||||
from: 'recharge',
|
||||
order_id: res.order_id,
|
||||
pay_way: 2,
|
||||
order_source: PayOrderSource.MINI, //订单来源:1-小程序; 2-h5; 3app
|
||||
order_type: PayOrderType.TeaRoomRecharge, // 茶艺师订单
|
||||
order_type: PayOrderType.Recharge,
|
||||
store_id: 0
|
||||
})
|
||||
|
||||
wechatPay(pay.config).then((res) => {
|
||||
wechatPay(pay.pay.config).then((res) => {
|
||||
uni.hideLoading()
|
||||
if (res === 'success') {
|
||||
setTimeout(() => {
|
||||
toast.success('支付成功')
|
||||
}, 100);
|
||||
setTimeout(() => {
|
||||
uni.navigateBack()
|
||||
}, 800)
|
||||
return
|
||||
} else if (res === 'cancel') {
|
||||
setTimeout(() => {
|
||||
toast.show('已取消支付')
|
||||
}, 100);
|
||||
toast.info('已取消支付')
|
||||
return
|
||||
} else {
|
||||
setTimeout(() => {
|
||||
toast.show('支付失败,请重试')
|
||||
}, 100);
|
||||
toast.info('支付失败,请重试')
|
||||
return
|
||||
}
|
||||
}).catch(() => {
|
||||
toast.close()
|
||||
uni.hideLoading()
|
||||
toast.info('支付失败,请重试')
|
||||
})
|
||||
} else {
|
||||
toast.close()
|
||||
}
|
||||
} catch (error) {
|
||||
toast.close()
|
||||
uni.hideLoading()
|
||||
toast.info('支付失败,请重试')
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
<style lang="scss" scoped>
|
||||
page {
|
||||
background: $cz-page-background;
|
||||
}
|
||||
@ -163,21 +207,4 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.recharge-radio {
|
||||
:deep() {
|
||||
.wd-radio-group {
|
||||
background-color: transparent !important;
|
||||
}
|
||||
|
||||
.wd-radio {
|
||||
margin-top: 0 !important;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.acitve {
|
||||
background: #FFF4F4;
|
||||
border: 2rpx solid #FF5951;
|
||||
}
|
||||
</style>
|
||||
|
||||
@ -524,8 +524,6 @@ const Detail = {
|
||||
* 处理收藏
|
||||
*/
|
||||
handleCollect: async () => {
|
||||
console.log("🚀 ~ Detail.handleCollect:", 123)
|
||||
|
||||
if (!userInfo.value.id) {
|
||||
toast.info('请先登录')
|
||||
router.navigateTo('/pages/login/login', 200)
|
||||
|
||||
@ -431,6 +431,15 @@
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "wallet/recharge-store",
|
||||
"type": "page",
|
||||
"needLogin": true,
|
||||
"layout": "default",
|
||||
"style": {
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "wallet/recharge",
|
||||
"type": "page",
|
||||
|
||||
@ -202,7 +202,7 @@
|
||||
</view>
|
||||
|
||||
<!-- 茶艺师订单 -->
|
||||
<view class="bg-white rounded-16rpx mx-30rpx mt-28rpx pb-34rpx">
|
||||
<view class="bg-white rounded-16rpx mx-30rpx mt-28rpx pb-34rpx" v-if="setting.status == 1">
|
||||
<view class="px-30rpx pt-30rpx py-24rpx">茶艺师订单</view>
|
||||
<view class="flex relative px-30rpx">
|
||||
<view v-for="(item, index) in teaReserveMenuList" :key="index">
|
||||
@ -270,6 +270,7 @@
|
||||
import { useUserStore } from '@/store'
|
||||
import { getUserInfo, getMyCoupon, claimMyCoupon, getUserMember, getConfig } from '@/api/user'
|
||||
import type { IUserResult } from '@/api/types/user'
|
||||
import { getSetting } from '@/api/tea-specialist'
|
||||
|
||||
const OSS = inject('OSS')
|
||||
const navbarHeight = inject('navbarHeight')
|
||||
@ -337,6 +338,9 @@
|
||||
// 过期时间
|
||||
const expireTime = ref<string>('')
|
||||
|
||||
// 获取设置
|
||||
const setting = ref<any>({})
|
||||
|
||||
onShow(() => {
|
||||
const userStore = useUserStore()
|
||||
isLogin.value = userStore.isLoggedIn
|
||||
@ -402,6 +406,10 @@
|
||||
sheetMenu.value = [{ name: serviceMobile }]
|
||||
}
|
||||
})
|
||||
|
||||
getSetting().then(res => {
|
||||
setting.value = res
|
||||
})
|
||||
},
|
||||
|
||||
/**
|
||||
|
||||
@ -26,7 +26,7 @@
|
||||
<view class="tabs">
|
||||
<wd-tabs v-model="tab" swipeable slidable="always" @change="Reserve.handleChangeTab" :lazy="false">
|
||||
<wd-tab title="茶室预约"></wd-tab>
|
||||
<wd-tab title="茶艺师预约"></wd-tab>
|
||||
<wd-tab title="茶艺师预约" v-if="setting.status == 1"></wd-tab>
|
||||
</wd-tabs>
|
||||
</view>
|
||||
</view>
|
||||
@ -57,6 +57,7 @@
|
||||
import { router } from '@/utils/tools'
|
||||
import { getTeaRoomOrderList } from '@/api/tea-room'
|
||||
import { getTeaSpecialistOrderList } from '@/api/teaSpecialist-order'
|
||||
import { getSetting } from '@/api/tea-specialist'
|
||||
|
||||
const OSS = inject('OSS')
|
||||
const navbarHeight = Number(inject('navbarHeight')) + 42 + 14 // 42为tabs的高度 14是边距值
|
||||
@ -65,6 +66,9 @@
|
||||
const tab = ref<number>(0)
|
||||
const reserveType = ref<number>(0) // 0:茶室预约 1:茶艺师预约
|
||||
|
||||
// 获取设置
|
||||
const setting = ref<any>({})
|
||||
|
||||
// mescroll
|
||||
const { mescrollInit, downCallback, getMescroll } = useMescroll(onPageScroll, onReachBottom) // 调用mescroll的hook
|
||||
const downOption = {
|
||||
@ -96,6 +100,10 @@
|
||||
list.value = []
|
||||
getMescroll().resetUpScroll()
|
||||
})
|
||||
|
||||
getSetting().then(res => {
|
||||
setting.value = res
|
||||
})
|
||||
})
|
||||
|
||||
onUnload(() => {
|
||||
|
||||
Reference in New Issue
Block a user