|
@@ -1,36 +1,37 @@
|
|
|
<template>
|
|
<template>
|
|
|
- <view class="bind-tel-page">
|
|
|
|
|
- <!-- 返回 -->
|
|
|
|
|
- <view class="icon-title-navBar-box">
|
|
|
|
|
- <view @click="handleBack" class="nav-bar-icon"></view>
|
|
|
|
|
- <view class="nav-bar-title">绑定手机号</view>
|
|
|
|
|
|
|
+ <view class="bind-tel-page">
|
|
|
|
|
+ <!-- 返回 -->
|
|
|
|
|
+ <view class="icon-title-navBar-box">
|
|
|
|
|
+ <view @click="handleBack" class="nav-bar-icon"></view>
|
|
|
|
|
+ <view class="nav-bar-title">绑定手机号</view>
|
|
|
|
|
+ </view>
|
|
|
|
|
+ <view class="ezy-page-body bind-tel-body">
|
|
|
|
|
+ <!-- 手机号 -->
|
|
|
|
|
+ <view class="tel-input">
|
|
|
|
|
+ <input class="phone-input" type="text" v-model="loginData.phoneNumber" placeholder="请输入手机号"
|
|
|
|
|
+ maxlength="11" @input="clearTelInput" />
|
|
|
|
|
+ <view class="close-btn" v-if="loginData.clearTelIcon" @click="clearTel"></view>
|
|
|
</view>
|
|
</view>
|
|
|
- <view class="ezy-page-body bind-tel-body">
|
|
|
|
|
- <!-- 手机号 -->
|
|
|
|
|
|
|
+
|
|
|
|
|
+ <!-- 验证码 -->
|
|
|
|
|
+ <view class="yzm-row">
|
|
|
<view class="tel-input">
|
|
<view class="tel-input">
|
|
|
- <input class="phone-input" type="text" v-model="loginData.phoneNumber" placeholder="请输入手机号" maxlength="11"
|
|
|
|
|
- @input="clearTelInput" />
|
|
|
|
|
- <view class="close-btn" v-if="loginData.clearTelIcon" @click="clearTel"></view>
|
|
|
|
|
|
|
+ <input class="phone-input" type="text" v-model="loginData.yzmNumber" placeholder="请输入验证码"
|
|
|
|
|
+ maxlength="4" @input="clearYzmInput" />
|
|
|
|
|
+ <view class="close-btn" v-if="loginData.clearYzmIcon" @click="clearYzm"></view>
|
|
|
</view>
|
|
</view>
|
|
|
-
|
|
|
|
|
- <!-- 验证码 -->
|
|
|
|
|
- <view class="yzm-row">
|
|
|
|
|
- <view class="tel-input">
|
|
|
|
|
- <input class="phone-input" type="text" v-model="loginData.yzmNumber" placeholder="请输入验证码" maxlength="4"
|
|
|
|
|
- @input="clearYzmInput" />
|
|
|
|
|
- <view class="close-btn" v-if="loginData.clearYzmIcon" @click="clearYzm"></view>
|
|
|
|
|
- </view>
|
|
|
|
|
-
|
|
|
|
|
- <text class="yzm-btn" @click="startCountdown"
|
|
|
|
|
- :class="{ 'cxfs-btn-disabled': loginData.isDisabled}">{{loginData.buttonText}}</text>
|
|
|
|
|
- </view>
|
|
|
|
|
- <ezyActiveVue class="ezy-btn-active login-btn yzm-btn" @aclick="bangdingFun" :class="loginData.yzmStatus">确认绑定
|
|
|
|
|
- </ezyActiveVue>
|
|
|
|
|
|
|
+
|
|
|
|
|
+ <text class="yzm-btn" @click="startCountdown"
|
|
|
|
|
+ :class="{ 'cxfs-btn-disabled': loginData.isDisabled}">{{loginData.buttonText}}</text>
|
|
|
</view>
|
|
</view>
|
|
|
- <!-- 图形验证码 -->
|
|
|
|
|
- <captchaVue ref="captcha" :config="config" @captchaSuccess="captchaSuccess" @captchaError="captchaError"
|
|
|
|
|
- @captchaFail="captchaFail" @captchaReady="captchaReady" @captchaClose="captchaClose"></captchaVue>
|
|
|
|
|
|
|
+ <ezyActiveVue class="ezy-btn-active login-btn yzm-btn" @aclick="bangdingFun" :class="loginData.yzmStatus">
|
|
|
|
|
+ 确认绑定
|
|
|
|
|
+ </ezyActiveVue>
|
|
|
</view>
|
|
</view>
|
|
|
|
|
+ <!-- 图形验证码 -->
|
|
|
|
|
+ <captchaVue ref="captcha" :config="config" @captchaSuccess="captchaSuccess" @captchaError="captchaError"
|
|
|
|
|
+ @captchaFail="captchaFail" @captchaReady="captchaReady" @captchaClose="captchaClose"></captchaVue>
|
|
|
|
|
+ </view>
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
|
<script setup>
|
|
<script setup>
|
|
@@ -42,6 +43,10 @@
|
|
|
toast
|
|
toast
|
|
|
} from "@/utils/common";
|
|
} from "@/utils/common";
|
|
|
import {
|
|
import {
|
|
|
|
|
+ onLoad,
|
|
|
|
|
+ onShow
|
|
|
|
|
+ } from '@dcloudio/uni-app';
|
|
|
|
|
+ import {
|
|
|
login,
|
|
login,
|
|
|
telBind,
|
|
telBind,
|
|
|
sendCode
|
|
sendCode
|
|
@@ -61,6 +66,7 @@
|
|
|
const agreeContentDialogRef = ref(null);
|
|
const agreeContentDialogRef = ref(null);
|
|
|
|
|
|
|
|
const isAgreed = ref(false);
|
|
const isAgreed = ref(false);
|
|
|
|
|
+ const from = ref('');
|
|
|
const config = ref({
|
|
const config = ref({
|
|
|
captchaId: "9d5837b0807b8de44da0de310a0b2813",
|
|
captchaId: "9d5837b0807b8de44da0de310a0b2813",
|
|
|
});
|
|
});
|
|
@@ -92,6 +98,11 @@
|
|
|
dlRef.value.open(props.openFangshi);
|
|
dlRef.value.open(props.openFangshi);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ onLoad((options) => {
|
|
|
|
|
+ console.log('options', options);
|
|
|
|
|
+ from.value = options.from
|
|
|
|
|
+ })
|
|
|
|
|
+
|
|
|
function closeDl() {
|
|
function closeDl() {
|
|
|
loginData.phoneNumber = null;
|
|
loginData.phoneNumber = null;
|
|
|
loginData.yzmNumber = null;
|
|
loginData.yzmNumber = null;
|
|
@@ -106,7 +117,20 @@
|
|
|
loginData.isDisabled = false;
|
|
loginData.isDisabled = false;
|
|
|
loginData.buttonText = '获取验证码';
|
|
loginData.buttonText = '获取验证码';
|
|
|
isAgreed.value = false;
|
|
isAgreed.value = false;
|
|
|
- dlRef.value.close();
|
|
|
|
|
|
|
+ if (from.value = 'my') {
|
|
|
|
|
+ uni.switchTab({
|
|
|
|
|
+ url: "/pages/chanpinMy/my"
|
|
|
|
|
+ })
|
|
|
|
|
+ } else if (from.value = 'order') {
|
|
|
|
|
+ uni.navigateTo({
|
|
|
|
|
+ url: '/pages/chanpinMy/order'
|
|
|
|
|
+ })
|
|
|
|
|
+ } else {
|
|
|
|
|
+ uni.switchTab({
|
|
|
|
|
+ url: "/pages/chanpinMy/my"
|
|
|
|
|
+ })
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// 返回
|
|
// 返回
|
|
@@ -114,9 +138,7 @@
|
|
|
closeDl();
|
|
closeDl();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- function skipFun() {
|
|
|
|
|
- closeDl();
|
|
|
|
|
- }
|
|
|
|
|
|
|
+
|
|
|
|
|
|
|
|
// 手机号校验规则
|
|
// 手机号校验规则
|
|
|
const validatePhoneNumber = (value) => {
|
|
const validatePhoneNumber = (value) => {
|
|
@@ -194,7 +216,7 @@
|
|
|
// cacheManager.set('auth', res.data)
|
|
// cacheManager.set('auth', res.data)
|
|
|
// 返回重新支付
|
|
// 返回重新支付
|
|
|
handleBack();
|
|
handleBack();
|
|
|
- emits('success', res.data,loginData.phoneNumber)
|
|
|
|
|
|
|
+ toast("绑定成功")
|
|
|
}
|
|
}
|
|
|
})
|
|
})
|
|
|
}
|
|
}
|
|
@@ -276,10 +298,6 @@
|
|
|
function captchaReady() {}
|
|
function captchaReady() {}
|
|
|
|
|
|
|
|
function captchaClose() {}
|
|
function captchaClose() {}
|
|
|
-
|
|
|
|
|
- defineExpose({
|
|
|
|
|
- showDl
|
|
|
|
|
- })
|
|
|
|
|
</script>
|
|
</script>
|
|
|
|
|
|
|
|
<style>
|
|
<style>
|