对接接口
This commit is contained in:
@ -113,21 +113,6 @@
|
||||
import { getVerificationCode } from '@/api/user'
|
||||
import { SMS_ENUM } from '@/enum/sms'
|
||||
|
||||
|
||||
const OSS = inject('OSS')
|
||||
|
||||
// 选择银行卡
|
||||
const showBankCardPopup = ref<boolean>(false)
|
||||
const selectedBankCardIndex = ref<number>(0)
|
||||
const bankList = ref<Array<{ id: number, bankName: string, bankCard: string }>>([
|
||||
{ id: 1, bankName: '招商银行', bankCard: '3265' },
|
||||
{ id: 2, bankName: '建设银行', bankCard: '1234' },
|
||||
{ id: 3, bankName: '农业银行', bankCard: '5678' },
|
||||
])
|
||||
|
||||
// 提现金额
|
||||
const withdrawMoney = ref<number>(0)
|
||||
|
||||
// 验证码倒计时
|
||||
const countDownTime = ref<number>(1 * 60 * 1000) // 60s倒计时
|
||||
const startCountDown = ref<boolean>(false) // 是否开始倒计时
|
||||
|
||||
@ -12,7 +12,7 @@
|
||||
<view>
|
||||
<view class="mt-76rpx">
|
||||
<!-- 进度1-平台审核中 -->
|
||||
<view class="mx-98rpx flex">
|
||||
<view class="mx-98rpx flex" v-if="billDetails.order.status == 0">
|
||||
<view class="mr-44rpx">
|
||||
<wd-img width="40rpx" height="260rpx" :src="`${OSS}images/withdraw/withdraw_image1.png`"></wd-img>
|
||||
</view>
|
||||
@ -20,11 +20,11 @@
|
||||
<view>
|
||||
<view class="font-400 text-#606266">
|
||||
<view class="text-26rpx leading-36rpx">发起提现申请</view>
|
||||
<view class="mt-8rpx text-24rpx leading-34rpx ">2025-04-08 21:25:25</view>
|
||||
<view class="mt-8rpx text-24rpx leading-34rpx">{{ billDetails.order.dtime }}</view>
|
||||
</view>
|
||||
<view class="font-400 text-#606266 mt-26rpx">
|
||||
<view class="text-30rpx leading-42rpx">平台审核中</view>
|
||||
<view class="mt-10rpx text-26rpx leading-36rpx ">2025-04-08 21:25:25</view>
|
||||
<view class="mt-10rpx text-26rpx leading-36rpx">{{ billDetails.order.dtime }}</view>
|
||||
</view>
|
||||
<view class="mt-44rpx font-400 text-26rpx leading-36rpx text-#BFC2CC">
|
||||
到账成功
|
||||
@ -33,7 +33,7 @@
|
||||
</view>
|
||||
|
||||
<!-- 进度2-到账成功 -->
|
||||
<!-- <view class="mx-98rpx flex">
|
||||
<view class="mx-98rpx flex" v-if="billDetails.order.status == 1">
|
||||
<view class="mr-44rpx">
|
||||
<wd-img width="22rpx" height="260rpx" :src="`${OSS}images/withdraw/withdraw_image2.png`"></wd-img>
|
||||
</view>
|
||||
@ -41,18 +41,18 @@
|
||||
<view>
|
||||
<view class="font-400 text-#606266">
|
||||
<view class="text-26rpx leading-36rpx">发起提现申请</view>
|
||||
<view class="mt-8rpx text-24rpx leading-34rpx ">2025-04-08 21:25:25</view>
|
||||
<view class="mt-8rpx text-24rpx leading-34rpx">{{ billDetails.order.dtime }}</view>
|
||||
</view>
|
||||
<view class="font-400 text-#606266 mt-26rpx">
|
||||
<view class="text-30rpx leading-42rpx">平台审核中</view>
|
||||
<view class="mt-10rpx text-26rpx leading-36rpx ">2025-04-08 21:25:25</view>
|
||||
<view class="mt-10rpx text-26rpx leading-36rpx">{{ billDetails.order.dtime }}</view>
|
||||
</view>
|
||||
<view class="mt-44rpx font-400 text-30rpx leading-44rpx">
|
||||
<view>到账成功</view>
|
||||
<view class="mt-10rpx text-26rpx leading-36rpx">2025-04-08 21:25:25</view>
|
||||
<view class="mt-10rpx text-26rpx leading-36rpx">{{ billDetails.order.update_dtime }}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view> -->
|
||||
</view>
|
||||
|
||||
<view class="mt-82rpx mb-38rpx mx-30rpx">
|
||||
<wd-gap height="2rpx" bg-color="#F6F7F9"></wd-gap>
|
||||
@ -61,15 +61,15 @@
|
||||
<view class="mx-60rpx">
|
||||
<view class="flex items-center justify-between font-400 text-28rpx leading-40rpx">
|
||||
<view class="text-#606266">提现金额</view>
|
||||
<view class="text-#303133">¥5000.00</view>
|
||||
<view class="text-#303133">¥{{ billDetails.order.amount }}</view>
|
||||
</view>
|
||||
<view class="flex items-center justify-between font-400 text-28rpx leading-40rpx">
|
||||
<view class="text-#606266">到账银行卡</view>
|
||||
<view class="text-#303133">招商银行(3265)</view>
|
||||
<view class="text-#303133">{{ billDetails.order.bank_name }}({{ Progress.handleFormatBankCardNumber(billDetails.order.bank_card) }})</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="mx-60rpx mt-90rpx bg-#F6F7F8 rounded-8rpx h-90rpx leading-90rpx text-center">
|
||||
<view class="mx-60rpx mt-90rpx bg-#F6F7F8 rounded-8rpx h-90rpx leading-90rpx text-center" @click="router.navigateBack">
|
||||
完成
|
||||
</view>
|
||||
</view>
|
||||
@ -78,6 +78,7 @@
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { getUserTransactionDetailsInfo } from '@/api/user'
|
||||
import { router } from '@/utils/tools'
|
||||
|
||||
const OSS = inject('OSS')
|
||||
|
||||
@ -88,12 +89,12 @@
|
||||
amount: 0,
|
||||
change_type: 0,
|
||||
order: {
|
||||
order_sn: '',
|
||||
pay_way: '', // 支付方式 1余额支付 2微信支付 3门店支付
|
||||
nickname: '',
|
||||
mobile: '',
|
||||
update_dtime: '',
|
||||
service_price: ''
|
||||
dtime: "",
|
||||
bank_card: "",
|
||||
bank_name: "",
|
||||
status: 0,
|
||||
amount: 0,
|
||||
update_dtime: ""
|
||||
}
|
||||
})
|
||||
|
||||
@ -104,6 +105,19 @@
|
||||
console.log("🚀 ~ billDetails.value:", billDetails.value)
|
||||
})
|
||||
|
||||
const Progress = {
|
||||
/**
|
||||
* 格式化银行卡号
|
||||
* @param bankCardNumber 银行卡号
|
||||
*/
|
||||
handleFormatBankCardNumber: (bankCardNumber: string) => {
|
||||
if (!bankCardNumber) return ''
|
||||
const noSpace = bankCardNumber.replace(/\s/g, '')
|
||||
if (noSpace.length <= 4) return noSpace
|
||||
return noSpace.slice(-4)
|
||||
},
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
@ -210,7 +210,9 @@
|
||||
|
||||
uni.hideLoading
|
||||
toast.success('提现申请提交成功')
|
||||
router.redirectTo('/bundle/wallet/wallet', 500)
|
||||
|
||||
uni.$emit('refreshWalletPage')
|
||||
router.navigateBack(1, 500)
|
||||
} catch (error) {
|
||||
uni.hideLoading
|
||||
toast.info('获取可提现金额失败,请稍后重试')
|
||||
@ -218,7 +220,9 @@
|
||||
}
|
||||
},
|
||||
|
||||
// 添加银行卡
|
||||
/**
|
||||
* 添加新银行卡
|
||||
*/
|
||||
handleAddNewBankCard: () => {
|
||||
showBankCardPopup.value = false
|
||||
uni.navigateTo({
|
||||
|
||||
@ -27,7 +27,7 @@
|
||||
no-border
|
||||
custom-class="!bg-[#F6F7F8] !border !border-solid !border-[#EAECF0] !rounded-16rpx"
|
||||
custom-input-class="!px-32rpx !h-104rpx"
|
||||
@input="mobile.handleInputMobile"
|
||||
@input="ChangeMobile.handleInputMobile"
|
||||
/>
|
||||
</view>
|
||||
</view>
|
||||
@ -43,9 +43,9 @@
|
||||
</view>
|
||||
|
||||
<view class="flex items-center">
|
||||
<view class="text-[#4C9F44] text-32rpx font-400 leading-44rpx" v-if="!startCountDown" @click="mobile.handleCountDown">发送验证码</view>
|
||||
<view class="text-[#4C9F44] text-32rpx font-400 leading-44rpx" v-if="!startCountDown" @click="ChangeMobile.handleCountDown">发送验证码</view>
|
||||
<view class="!text-[#C9C9C9] text-32rpx font-400 leading-44rpx flex items-center" v-if="startCountDown">
|
||||
<wd-count-down ref="countDown" :time="countDownTime" millisecond :auto-start="false" format="ss" custom-class="!text-[#C9C9C9] !text-32rpx" @finish="mobile.handleFinishCountDown"></wd-count-down>
|
||||
<wd-count-down ref="countDown" :time="countDownTime" millisecond :auto-start="false" format="ss" custom-class="!text-[#C9C9C9] !text-32rpx" @finish="ChangeMobile.handleFinishCountDown"></wd-count-down>
|
||||
<view> S后重发</view>
|
||||
</view>
|
||||
</view>
|
||||
@ -57,7 +57,7 @@
|
||||
</wd-form>
|
||||
</view>
|
||||
|
||||
<view class="h-90rpx leading-90rpx mx-60rpx rounded-8rpx text-center mt-112rpx bg-[#4C9F44] text-[#fff]" :class="disabled ? 'opacity-40' : ''" @click="mobile.handleToLogin">登录</view>
|
||||
<view class="h-90rpx leading-90rpx mx-60rpx rounded-8rpx text-center mt-112rpx bg-[#4C9F44] text-[#fff]" :class="disabled ? 'opacity-40' : ''" @click="ChangeMobile.handleConfirm">确定</view>
|
||||
|
||||
<!-- 手机号修改成功 -->
|
||||
<wd-popup v-model="showEditSuccessPopup" lock-scroll custom-style="border-radius: 32rpx 32rpx 0rpx 0rpx;" position="bottom">
|
||||
@ -69,7 +69,7 @@
|
||||
</view>
|
||||
<view class="text-[#303133] text-36rpx leading-46rpx text-center mt-48rpx">手机号修改成功</view>
|
||||
<view class="text-[#9CA3AF] text-28rpx leading-44rpx mt-16rpx text-center">{{ page.desc }}</view>
|
||||
<view class="w-630rpx h-90rpx leading-90rpx text-center bg-[#4C9F44] rounded-8rpx text-[#fff] mt-174rpx mx-auto" @click="mobile.handleToBack">好的</view>
|
||||
<view class="w-630rpx h-90rpx leading-90rpx text-center bg-[#4C9F44] rounded-8rpx text-[#fff] mt-174rpx mx-auto" @click="router.switchTab('/pages/my/my')">好的</view>
|
||||
</view>
|
||||
</wd-popup>
|
||||
</view>
|
||||
@ -80,23 +80,25 @@
|
||||
import {mobile as testMobile} from '@/utils/test'
|
||||
import { useToast } from 'wot-design-uni'
|
||||
import { router } from '@/utils/tools'
|
||||
import { SMS_ENUM } from '@/enum/sms'
|
||||
import { getVerificationCode, updateUserInfo } from '@/api/user'
|
||||
|
||||
const OSS = inject('OSS')
|
||||
const toast = useToast()
|
||||
const disabled = ref<boolean>(true)
|
||||
|
||||
/** 页面 **/
|
||||
// 页面
|
||||
const pageType = ref<string>('') // 页面类型 login:登录 edit:修改手机号
|
||||
const page = ref<{title: string, desc: string}>({title: '其他手机号登录', desc: '请输入你要登录的手机号'})
|
||||
const showEditSuccessPopup = ref<boolean>(false) // 显示手机号修改成功弹窗
|
||||
const userId = ref<number>(0) // 用户ID,修改手机号时需要传
|
||||
|
||||
/** 验证码倒计时 **/
|
||||
// 验证码倒计时
|
||||
const countDownTime = ref<number>(1 * 60 * 1000) // 60s倒计时
|
||||
const startCountDown = ref<boolean>(false) // 是否开始倒计时
|
||||
const countDown = ref<any>(null) // 倒计时组件
|
||||
|
||||
/** 表单相关 **/
|
||||
// 表单相关
|
||||
const model = reactive<{
|
||||
mobile: string
|
||||
code: string
|
||||
@ -104,7 +106,6 @@
|
||||
mobile: '',
|
||||
code: ''
|
||||
})
|
||||
/** 结束 **/
|
||||
|
||||
|
||||
onLoad((args) => {
|
||||
@ -121,15 +122,20 @@
|
||||
}
|
||||
})
|
||||
|
||||
const mobile = {
|
||||
// 验证手机号
|
||||
const ChangeMobile = {
|
||||
/**
|
||||
* 验证手机号
|
||||
* @param e
|
||||
*/
|
||||
handleInputMobile: (e: {value: string}) => {
|
||||
model.mobile = e.value
|
||||
disabled.value = !testMobile(model.mobile)
|
||||
},
|
||||
|
||||
// 发送验证码
|
||||
handleCountDown: () => {
|
||||
/**
|
||||
* 发送验证码
|
||||
*/
|
||||
handleCountDown: async () => {
|
||||
if (disabled.value) {
|
||||
toast.show({
|
||||
iconClass: 'info-circle',
|
||||
@ -139,6 +145,8 @@
|
||||
return
|
||||
}
|
||||
|
||||
await getVerificationCode({ scene: SMS_ENUM.BGSJHM, mobile: String(model.mobile)})
|
||||
|
||||
startCountDown.value = true
|
||||
nextTick(() => {
|
||||
countDown.value?.start()
|
||||
@ -152,19 +160,10 @@
|
||||
startCountDown.value = false
|
||||
},
|
||||
|
||||
// 登录
|
||||
handleToLogin: () => {
|
||||
// TODO 如果是edit的话就是修改手机号
|
||||
|
||||
if (pageType === 'login' && !agree.value) {
|
||||
toast.show({
|
||||
iconClass: 'info-circle',
|
||||
msg: '请同意服务协议和隐私政策',
|
||||
direction: 'vertical'
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改
|
||||
*/
|
||||
handleConfirm: async() => {
|
||||
if (!testMobile(model.mobile)) {
|
||||
toast.show({
|
||||
iconClass: 'info-circle',
|
||||
@ -174,16 +173,30 @@
|
||||
return
|
||||
}
|
||||
|
||||
if (!model.code) {
|
||||
toast.show({
|
||||
iconClass: 'info-circle',
|
||||
msg: '验证码错误',
|
||||
direction: 'vertical'
|
||||
if (pageType.value == 'edit') {
|
||||
// TODO 如果是edit的话就是修改手机号
|
||||
if (!model.code) {
|
||||
toast.show({
|
||||
iconClass: 'info-circle',
|
||||
msg: '验证码错误',
|
||||
direction: 'vertical'
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
await updateUserInfo({
|
||||
mobile: Number(model.mobile),
|
||||
code: model.code
|
||||
})
|
||||
return
|
||||
|
||||
showEditSuccessPopup.value = true
|
||||
} else if (pageType.value == 'change') {
|
||||
await updateUserInfo({
|
||||
band_mobile: model.mobile,
|
||||
})
|
||||
toast.success('绑定手机号修改成功')
|
||||
router.switchTab('/pages/my/my', 500)
|
||||
}
|
||||
|
||||
router.navigateTo('/bundle/profile/set-password')
|
||||
},
|
||||
|
||||
// 获取手机号
|
||||
|
||||
@ -27,7 +27,7 @@
|
||||
no-border
|
||||
custom-class="!bg-[#F6F7F8] !border !border-solid !border-[#EAECF0] !rounded-16rpx"
|
||||
custom-input-class="!px-32rpx !h-104rpx"
|
||||
@input="mobile.handleInputMobile"
|
||||
@input="Mobile.handleInputMobile"
|
||||
/>
|
||||
</view>
|
||||
</view>
|
||||
@ -43,9 +43,9 @@
|
||||
</view>
|
||||
|
||||
<view class="flex items-center">
|
||||
<view class="text-[#4C9F44] text-32rpx font-400 leading-44rpx" v-if="!startCountDown" @click="mobile.handleCountDown">发送验证码</view>
|
||||
<view class="text-[#4C9F44] text-32rpx font-400 leading-44rpx" v-if="!startCountDown" @click="Mobile.handleCountDown">发送验证码</view>
|
||||
<view class="!text-[#C9C9C9] text-32rpx font-400 leading-44rpx flex items-center" v-if="startCountDown">
|
||||
<wd-count-down ref="countDown" :time="countDownTime" millisecond :auto-start="false" format="ss" custom-class="!text-[#C9C9C9] !text-32rpx" @finish="mobile.handleFinishCountDown"></wd-count-down>
|
||||
<wd-count-down ref="countDown" :time="countDownTime" millisecond :auto-start="false" format="ss" custom-class="!text-[#C9C9C9] !text-32rpx" @finish="Mobile.handleFinishCountDown"></wd-count-down>
|
||||
<view> S后重发</view>
|
||||
</view>
|
||||
</view>
|
||||
@ -57,38 +57,25 @@
|
||||
</wd-form>
|
||||
</view>
|
||||
|
||||
<view class="h-90rpx leading-90rpx mx-60rpx rounded-8rpx text-center mt-112rpx bg-[#4C9F44] text-[#fff]" :class="disabled ? 'opacity-40' : ''" @click="mobile.handleToLogin">下一步</view>
|
||||
|
||||
<!-- 手机号修改成功 -->
|
||||
<wd-popup v-model="showEditSuccessPopup" lock-scroll custom-style="border-radius: 32rpx 32rpx 0rpx 0rpx;" position="bottom">
|
||||
<view class="relative pt-64rpx pb-74rpx">
|
||||
<view class="flex justify-center items-center">
|
||||
<view class="bg-[#4C9F44] w-280rpx rounded-280rpx">
|
||||
<wd-img width="280rpx" height="280rpx" :src="`${OSS}images/reserve_room/reserve_room_image7.png`"/>
|
||||
</view>
|
||||
</view>
|
||||
<view class="text-[#303133] text-36rpx leading-46rpx text-center mt-48rpx">手机号修改成功</view>
|
||||
<view class="text-[#9CA3AF] text-28rpx leading-44rpx mt-16rpx text-center">{{ page.desc }}</view>
|
||||
<view class="w-630rpx h-90rpx leading-90rpx text-center bg-[#4C9F44] rounded-8rpx text-[#fff] mt-174rpx mx-auto" @click="mobile.handleToBack">好的</view>
|
||||
</view>
|
||||
</wd-popup>
|
||||
<view class="h-90rpx leading-90rpx mx-60rpx rounded-8rpx text-center mt-112rpx bg-[#4C9F44] text-[#fff]" :class="disabled ? 'opacity-40' : ''" @click="Mobile.handleNext">下一步</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
|
||||
<script lang="ts" setup>
|
||||
import {mobile as testMobile} from '@/utils/test'
|
||||
import { mobile as testMobile } from '@/utils/test'
|
||||
import { useToast } from 'wot-design-uni'
|
||||
import { getVerificationCode } from '@/api/user'
|
||||
import { SMS_ENUM } from '@/enum/sms'
|
||||
import { router } from '@/utils/tools'
|
||||
|
||||
const OSS = inject('OSS')
|
||||
const toast = useToast()
|
||||
const disabled = ref<boolean>(true)
|
||||
|
||||
/** 页面 **/
|
||||
let pageType = 'login' // 页面类型 login:登录 edit:修改手机号
|
||||
const page = ref<{title: string, desc: string}>({title: '其他手机号登录', desc: '请输入你要登录的手机号'})
|
||||
const showEditSuccessPopup = ref<boolean>(false) // 显示手机号修改成功弹窗
|
||||
const userId = ref<number>(0) // 用户ID,修改手机号时需要传
|
||||
|
||||
/** 验证码倒计时 **/
|
||||
const countDownTime = ref<number>(1 * 60 * 1000) // 60s倒计时
|
||||
@ -103,32 +90,25 @@
|
||||
mobile: '',
|
||||
code: ''
|
||||
})
|
||||
/** 结束 **/
|
||||
|
||||
/** 服务协议和隐私政策 **/
|
||||
const agree = ref<boolean>(false)
|
||||
/** 结束 **/
|
||||
|
||||
onLoad((args) => {
|
||||
// 从个人登录页面进入
|
||||
if (args.type === 'edit') {
|
||||
userId.value = Number(args.userId) || 0 // userId仅做测试使用,实际请传真实用户ID
|
||||
|
||||
page.value.title = '修改手机号'
|
||||
page.value.desc = '手机号一年内可修改2次'
|
||||
pageType = 'edit'
|
||||
}
|
||||
|
||||
})
|
||||
|
||||
const mobile = {
|
||||
// 验证手机号
|
||||
const Mobile = {
|
||||
/**
|
||||
* 验证手机号码
|
||||
* @param e 手机号
|
||||
*/
|
||||
handleInputMobile: (e: {value: string}) => {
|
||||
model.mobile = e.value
|
||||
disabled.value = !testMobile(model.mobile)
|
||||
},
|
||||
|
||||
// 发送验证码
|
||||
handleCountDown: () => {
|
||||
/**
|
||||
* 发送验证码
|
||||
*/
|
||||
handleCountDown: async () => {
|
||||
if (disabled.value) {
|
||||
toast.show({
|
||||
iconClass: 'info-circle',
|
||||
@ -138,6 +118,8 @@
|
||||
return
|
||||
}
|
||||
|
||||
await getVerificationCode({ scene: SMS_ENUM.ZHDLMM, mobile: String(model.mobile)})
|
||||
|
||||
startCountDown.value = true
|
||||
nextTick(() => {
|
||||
countDown.value?.start()
|
||||
@ -178,25 +160,30 @@
|
||||
console.log("🚀 ~ e:", e)
|
||||
},
|
||||
|
||||
handleAgree: (e: any) => {
|
||||
console.log('e', e)
|
||||
/**
|
||||
* 下一步
|
||||
*/
|
||||
handleNext: () => {
|
||||
if (disabled.value) {
|
||||
toast.show({
|
||||
iconClass: 'info-circle',
|
||||
msg: '手机号码错误请重新输入',
|
||||
direction: 'vertical'
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
if (!model.code) {
|
||||
toast.show({
|
||||
iconClass: 'info-circle',
|
||||
msg: '请输入验证码',
|
||||
direction: 'vertical'
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
router.navigateTo(`/bundle/profile/set-password?mobile=${model.mobile}&code=${model.code}`)
|
||||
},
|
||||
|
||||
// 跳转到服务协议页面
|
||||
handleToService: () => {
|
||||
disabled.value = !disabled.value
|
||||
console.log("🚀 ~ disabled:", disabled)
|
||||
},
|
||||
|
||||
// 跳转到隐私政策页面
|
||||
handleToPrivacy: () => {
|
||||
|
||||
},
|
||||
|
||||
// 修改手机成功后返回
|
||||
handleToBack: () => {
|
||||
uni.navigateBack()
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
@ -20,37 +20,35 @@
|
||||
<view class="font-400 text-30rpx text-[#606266] leading-44rpx">密码</view>
|
||||
<view class="mt-20rpx">
|
||||
<wd-input
|
||||
v-model="model.mobile"
|
||||
v-model="model.password"
|
||||
type="text"
|
||||
placeholder="请输入密码"
|
||||
inputmode="numeric"
|
||||
no-border
|
||||
custom-class="!bg-[#F6F7F8] !border !border-solid !border-[#EAECF0] !rounded-16rpx"
|
||||
custom-input-class="!px-32rpx !h-104rpx"
|
||||
@input="mobile.handleInputMobile"
|
||||
/>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view>
|
||||
<view class="mt-40rpx">
|
||||
<view class="font-400 text-30rpx text-[#606266] leading-44rpx">再次确认</view>
|
||||
<view class="mt-20rpx">
|
||||
<wd-input
|
||||
v-model="model.mobile"
|
||||
v-model="model.password_confirm"
|
||||
type="text"
|
||||
placeholder="再次确认新的密码"
|
||||
inputmode="numeric"
|
||||
no-border
|
||||
custom-class="!bg-[#F6F7F8] !border !border-solid !border-[#EAECF0] !rounded-16rpx"
|
||||
custom-input-class="!px-32rpx !h-104rpx"
|
||||
@input="mobile.handleInputMobile"
|
||||
/>
|
||||
</view>
|
||||
</view>
|
||||
</wd-form>
|
||||
</view>
|
||||
|
||||
<view class="h-90rpx leading-90rpx mx-60rpx rounded-8rpx text-center mt-112rpx bg-[#4C9F44] text-[#fff]" :class="disabled ? 'opacity-40' : ''" @click="mobile.handleToLogin">确定</view>
|
||||
<view class="h-90rpx leading-90rpx mx-60rpx rounded-8rpx text-center mt-112rpx bg-[#4C9F44] text-[#fff]" @click="SetPassword.handleToConfirm">确定</view>
|
||||
|
||||
<!-- 手机号修改成功 -->
|
||||
<wd-popup v-model="showEditSuccessPopup" lock-scroll custom-style="border-radius: 32rpx 32rpx 0rpx 0rpx;" position="bottom">
|
||||
@ -62,7 +60,7 @@
|
||||
</view>
|
||||
<view class="text-[#303133] text-36rpx leading-46rpx text-center mt-48rpx">密码修改成功</view>
|
||||
<view class="text-[#9CA3AF] text-28rpx leading-44rpx mt-16rpx text-center">请记住你的登录密码</view>
|
||||
<view class="w-630rpx h-90rpx leading-90rpx text-center bg-[#4C9F44] rounded-8rpx text-[#fff] mt-174rpx mx-auto" @click="mobile.handleToBack">好的</view>
|
||||
<view class="w-630rpx h-90rpx leading-90rpx text-center bg-[#4C9F44] rounded-8rpx text-[#fff] mt-174rpx mx-auto" @click="router.switchTab('/pages/my/my')">好的</view>
|
||||
</view>
|
||||
</wd-popup>
|
||||
</view>
|
||||
@ -71,134 +69,92 @@
|
||||
|
||||
<script lang="ts" setup>
|
||||
import {mobile as testMobile} from '@/utils/test'
|
||||
import { resetPassword } from '@/api/user'
|
||||
import { useToast } from 'wot-design-uni'
|
||||
import { useUserStore } from '@/store'
|
||||
import { router } from '@/utils/tools'
|
||||
|
||||
const OSS = inject('OSS')
|
||||
const toast = useToast()
|
||||
const disabled = ref<boolean>(true)
|
||||
|
||||
/** 页面 **/
|
||||
let pageType = 'login' // 页面类型 login:登录 edit:修改手机号
|
||||
const page = ref<{title: string, desc: string}>({title: '其他手机号登录', desc: '请输入你要登录的手机号'})
|
||||
// 弹窗
|
||||
const showEditSuccessPopup = ref<boolean>(false) // 显示手机号修改成功弹窗
|
||||
const userId = ref<number>(0) // 用户ID,修改手机号时需要传
|
||||
|
||||
/** 验证码倒计时 **/
|
||||
const countDownTime = ref<number>(1 * 60 * 1000) // 60s倒计时
|
||||
const startCountDown = ref<boolean>(false) // 是否开始倒计时
|
||||
const countDown = ref<any>(null) // 倒计时组件
|
||||
|
||||
/** 表单相关 **/
|
||||
// 表单相关
|
||||
const model = reactive<{
|
||||
mobile: string
|
||||
code: string
|
||||
password: string
|
||||
password_confirm: string
|
||||
}>({
|
||||
mobile: '',
|
||||
code: ''
|
||||
password: '',
|
||||
password_confirm: ''
|
||||
})
|
||||
/** 结束 **/
|
||||
|
||||
/** 服务协议和隐私政策 **/
|
||||
const agree = ref<boolean>(false)
|
||||
/** 结束 **/
|
||||
// 手机和验证码
|
||||
const mobile = ref<string>('')
|
||||
const code = ref<string>('')
|
||||
|
||||
onLoad((args) => {
|
||||
// 从个人登录页面进入
|
||||
if (args.type === 'edit') {
|
||||
userId.value = Number(args.userId) || 0 // userId仅做测试使用,实际请传真实用户ID
|
||||
|
||||
page.value.title = '修改手机号'
|
||||
page.value.desc = '手机号一年内可修改2次'
|
||||
pageType = 'edit'
|
||||
}
|
||||
mobile.value = args.mobile || ''
|
||||
code.value = args.code || ''
|
||||
})
|
||||
|
||||
const mobile = {
|
||||
// 验证手机号
|
||||
handleInputMobile: (e: {value: string}) => {
|
||||
model.mobile = e.value
|
||||
disabled.value = !testMobile(model.mobile)
|
||||
},
|
||||
|
||||
// 发送验证码
|
||||
handleCountDown: () => {
|
||||
if (disabled.value) {
|
||||
const SetPassword = {
|
||||
/**
|
||||
* 确认密码
|
||||
*/
|
||||
handleToConfirm: async () => {
|
||||
if (!mobile) {
|
||||
toast.show({
|
||||
iconClass: 'info-circle',
|
||||
msg: '手机号码错误请重新输入',
|
||||
msg: '手机号异常,请重新操作',
|
||||
direction: 'vertical'
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
startCountDown.value = true
|
||||
nextTick(() => {
|
||||
countDown.value?.start()
|
||||
if (!code) {
|
||||
toast.show({
|
||||
iconClass: 'info-circle',
|
||||
msg: '验证码异常,请重新操作',
|
||||
direction: 'vertical'
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
// 发送验证码请求
|
||||
if (!model.password) {
|
||||
toast.show({
|
||||
iconClass: 'info-circle',
|
||||
msg: '请输入密码',
|
||||
direction: 'vertical'
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
if (model.password !== model.password_confirm) {
|
||||
toast.show({
|
||||
iconClass: 'info-circle',
|
||||
msg: '两次输入的密码不一致',
|
||||
direction: 'vertical'
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
await resetPassword({
|
||||
mobile: mobile.value,
|
||||
code: code.value,
|
||||
password: model.password,
|
||||
password_confirm: model.password_confirm
|
||||
})
|
||||
},
|
||||
|
||||
// 验证码倒计时结束
|
||||
handleFinishCountDown: () => {
|
||||
startCountDown.value = false
|
||||
},
|
||||
|
||||
// 登录
|
||||
handleToLogin: () => {
|
||||
// TODO 如果是edit的话就是修改手机号
|
||||
showEditSuccessPopup.value = true
|
||||
|
||||
if (pageType === 'login' && !agree.value) {
|
||||
toast.show({
|
||||
iconClass: 'info-circle',
|
||||
msg: '请同意服务协议和隐私政策',
|
||||
direction: 'vertical'
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
if (!testMobile(model.mobile)) {
|
||||
toast.show({
|
||||
iconClass: 'info-circle',
|
||||
msg: '手机号码错误请重新输入',
|
||||
direction: 'vertical'
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
if (!model.code) {
|
||||
toast.show({
|
||||
iconClass: 'info-circle',
|
||||
msg: '验证码错误',
|
||||
direction: 'vertical'
|
||||
})
|
||||
return
|
||||
}
|
||||
},
|
||||
|
||||
// 获取手机号
|
||||
handleGetPhoneNumber: (e: object) => {
|
||||
console.log("🚀 ~ e:", e)
|
||||
},
|
||||
|
||||
handleAgree: (e: any) => {
|
||||
console.log('e', e)
|
||||
},
|
||||
|
||||
// 跳转到服务协议页面
|
||||
handleToService: () => {
|
||||
disabled.value = !disabled.value
|
||||
console.log("🚀 ~ disabled:", disabled)
|
||||
},
|
||||
|
||||
// 跳转到隐私政策页面
|
||||
handleToPrivacy: () => {
|
||||
|
||||
},
|
||||
|
||||
// 修改手机成功后返回
|
||||
handleToBack: () => {
|
||||
uni.navigateBack()
|
||||
// const userStore = useUserStore()
|
||||
// await userStore.logout()
|
||||
// if (!userStore.isLoggedIn) {
|
||||
// toast.info('退出成功')
|
||||
// router.redirectTo('/pages/login/login')
|
||||
// }
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
@ -272,6 +272,7 @@
|
||||
<!-- 适用包间 -->
|
||||
<view class="mt-28rpx">
|
||||
<view class="flex items-center mb-20rpx">
|
||||
<!-- TODO 有包间的显示包间(还需要添加一个全使适合用),没有包间的显示通用 -->
|
||||
<view class="text-30rpx leading-44rpx text-#303133 mr-10rpx font-bold">适用包间</view>
|
||||
<view class="flex items-center">
|
||||
<wd-img width="16rpx" height="16rpx" :src="`${OSS}icon/icon_validate.png`"></wd-img>
|
||||
@ -334,6 +335,7 @@
|
||||
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { router } from '@/utils/tools'
|
||||
|
||||
const OSS = inject('OSS')
|
||||
|
||||
|
||||
@ -117,6 +117,7 @@
|
||||
import { toast } from '@/utils/toast'
|
||||
import { getStoreDetails, editStoreInfo } from '@/api/store'
|
||||
import { useStoreStore } from '@/store'
|
||||
import { router } from '@/utils/tools'
|
||||
|
||||
const OSS = inject('OSS')
|
||||
const useStore = useStoreStore()
|
||||
@ -300,9 +301,13 @@
|
||||
|
||||
try {
|
||||
await editStoreInfo(form.value)
|
||||
// 更新默认store信息
|
||||
useStore.defaultStore.name = form.value.name
|
||||
|
||||
EditStore.handleGetStoreDetails()
|
||||
uni.hideLoading()
|
||||
toast.info('保存成功')
|
||||
router.navigateBack(1, 500)
|
||||
} catch (error) {
|
||||
uni.hideLoading()
|
||||
toast.info('保存失败,请稍后重试')
|
||||
|
||||
@ -118,6 +118,7 @@
|
||||
import type { IUserResult } from '@/api/types/user'
|
||||
import { getUserInfo, getUserTransactionDetails } from '@/api/user'
|
||||
import { router } from '@/utils/tools'
|
||||
import { u } from '@tanstack/vue-query/build/legacy/queryClient-CAHOJcvF'
|
||||
|
||||
const OSS = inject('OSS')
|
||||
const userStore = useUserStore()
|
||||
@ -142,7 +143,10 @@
|
||||
})
|
||||
|
||||
const Wallet = {
|
||||
// 上拉加载的回调: 其中num:当前页 从1开始, size:每页数据条数,默认10
|
||||
/**
|
||||
* 上拉加载
|
||||
* @param mescroll
|
||||
*/
|
||||
upCallback: (mescroll) => {
|
||||
const filter = {
|
||||
page: mescroll.num,
|
||||
@ -179,6 +183,12 @@
|
||||
* 去提现
|
||||
*/
|
||||
handleToRecharge: () => {
|
||||
uni.$on('refreshWalletPage', () => {
|
||||
uni.$off('refreshWalletPage')
|
||||
// 切换tab时,重置当前的mescroll
|
||||
list.value = []
|
||||
getMescroll().resetUpScroll();
|
||||
})
|
||||
uni.navigateTo({
|
||||
url: '/bundle/parten/pages/withdraw/withdraw'
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user