add
This commit is contained in:
parent
c899d8f472
commit
ec33cc6119
|
@ -760,7 +760,7 @@
|
|||
}
|
||||
if (type == 2) {
|
||||
if (!formData2.mobile) return uni.$u.toast('请填写电话号码');
|
||||
if (formData2.price < formData2.label_limit) return uni.$u.toast(
|
||||
if (Number(formData2.price) < Number(formData2.label_limit)) return uni.$u.toast(
|
||||
`${formData2.label_name}角色最低金额不能低于${formData2.label_limit}元`);
|
||||
formData2.store_id = STORE_INFO.id
|
||||
// formData2.recharge_type = 'INDUSTRYMEMBERS'
|
||||
|
@ -800,9 +800,13 @@
|
|||
if (!formData.code) return uni.$u.toast('请输入短信验证码');
|
||||
if (!formData.address) return uni.$u.toast('请选择地址');
|
||||
if (!formData.label_id) return uni.$u.toast('请选择用户身份');
|
||||
if (formData.price < formData.label_limit) return uni.$u.toast(
|
||||
if (Number(formData.price) < Number(formData.label_limit)) {
|
||||
return uni.$u.toast(
|
||||
`${formData.label_name}角色最低金额不能低于${formData.label_limit}元`);
|
||||
formData.store_id = STORE_INFO.id
|
||||
|
||||
}
|
||||
|
||||
if (Role.value == 1) {
|
||||
// formData.recharge_type = 'INDUSTRYMEMBERS'
|
||||
// formData.user_ship = formData.label_id
|
||||
|
|
|
@ -34,8 +34,8 @@
|
|||
<up-transition :show="!showWeixin">
|
||||
<view class="form">
|
||||
<view class="input">
|
||||
<up-input :customStyle="{ height: '100%' }" v-model="loginForm.phone" placeholderClass="place"
|
||||
border="none" placeholder="请输入手机号" type="number">
|
||||
<up-input :customStyle="{ height: '100%' }" v-model="loginForm.phone"
|
||||
placeholderClass="place" border="none" placeholder="请输入手机号" type="number">
|
||||
<template #prefix>
|
||||
<image style="height: 40rpx;width: 40rpx;margin-top: 6rpx;"
|
||||
src="https://lihai001.oss-cn-chengdu.aliyuncs.com/def/48491202404281006484208.png">
|
||||
|
@ -81,28 +81,28 @@
|
|||
</template>
|
||||
|
||||
<script setup>
|
||||
import {
|
||||
import {
|
||||
onBackPress
|
||||
} from "@dcloudio/uni-app"
|
||||
import {
|
||||
} from "@dcloudio/uni-app"
|
||||
import {
|
||||
ref
|
||||
} from "vue"
|
||||
import {
|
||||
} from "vue"
|
||||
import {
|
||||
userLoginApi,
|
||||
userLoginWeixinApi,
|
||||
getMobileByMnpApi,
|
||||
getStoreInfo
|
||||
} from "@/api/user.js";
|
||||
import useUserStore from "@/store/user.js"
|
||||
import bindPhone from "@/components/bindPhone.vue"
|
||||
import modal from "@/components/modal.vue"
|
||||
import {
|
||||
} from "@/api/user.js";
|
||||
import useUserStore from "@/store/user.js"
|
||||
import bindPhone from "@/components/bindPhone.vue"
|
||||
import modal from "@/components/modal.vue"
|
||||
import {
|
||||
config
|
||||
} from "@/config/app.js"
|
||||
} from "@/config/app.js"
|
||||
|
||||
|
||||
const showOfficial = ref(false);
|
||||
const navToIndex = () => {
|
||||
const showOfficial = ref(false);
|
||||
const navToIndex = () => {
|
||||
if (userStore.userInfo && userStore.token) uni.reLaunch({
|
||||
url: '/pages/index/index'
|
||||
})
|
||||
|
@ -116,10 +116,10 @@ const navToIndex = () => {
|
|||
// url: '/pageQuota/quotation/index'
|
||||
// })
|
||||
// }
|
||||
}
|
||||
}
|
||||
|
||||
// 微信公众号绑定
|
||||
const officialCode = () => {
|
||||
// 微信公众号绑定
|
||||
const officialCode = () => {
|
||||
console.log("jinfas")
|
||||
return
|
||||
|
||||
|
@ -131,20 +131,20 @@ const officialCode = () => {
|
|||
userStore.setUserInfo(user);
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
const userStore = useUserStore(); //使用pinia进行状态管理
|
||||
if (userStore.userInfo && userStore.userInfo.mobile) {
|
||||
const userStore = useUserStore(); //使用pinia进行状态管理
|
||||
if (userStore.userInfo && userStore.userInfo.mobile) {
|
||||
navToIndex();
|
||||
} else {
|
||||
} else {
|
||||
userStore.setToken('');
|
||||
userStore.setUserInfo({});
|
||||
}
|
||||
}
|
||||
|
||||
const showWeixin = ref(true); //是否显示微信登录
|
||||
const isAgree = ref(false); //是否同意协议
|
||||
const showWeixin = ref(true); //是否显示微信登录
|
||||
const isAgree = ref(false); //是否同意协议
|
||||
|
||||
const weixinLogin = () => {
|
||||
const weixinLogin = () => {
|
||||
if (!isAgree.value) {
|
||||
uni.$u.sleep(1000).then(res => {
|
||||
isAgree.value = true;
|
||||
|
@ -201,10 +201,10 @@ const weixinLogin = () => {
|
|||
uni.$u.toast('登录失败');
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
const showBind = ref(false); //是否显示绑定手机号弹窗
|
||||
const getPhoneNumber = (e) => {
|
||||
const showBind = ref(false); //是否显示绑定手机号弹窗
|
||||
const getPhoneNumber = (e) => {
|
||||
if (e.detail?.errMsg == 'getPhoneNumber:ok') {
|
||||
getMobileByMnpApi({
|
||||
code: e.detail.code
|
||||
|
@ -239,17 +239,17 @@ const getPhoneNumber = (e) => {
|
|||
console.log("用户拒绝授权");
|
||||
return uni.$u.toast('您拒绝了授权');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const loginForm = ref({
|
||||
const loginForm = ref({
|
||||
phone: '15366662222',
|
||||
code: ''
|
||||
})
|
||||
const isPhone = () => { //检验手机号是否正确
|
||||
})
|
||||
const isPhone = () => { //检验手机号是否正确
|
||||
loginForm.value.phone = loginForm.value.phone.replace(/\s*/g, ""); //去除空格
|
||||
return !/^1[3456789]\d{9}$/.test(loginForm.value.phone);
|
||||
}
|
||||
const codeLogin = () => {
|
||||
}
|
||||
const codeLogin = () => {
|
||||
if (!isAgree.value) return uni.$u.toast('请先阅读并同意协议');
|
||||
// 验证码登录
|
||||
if (isPhone()) return uni.$u.toast('请输入正确的手机号码');
|
||||
|
@ -262,17 +262,17 @@ const codeLogin = () => {
|
|||
}).then(res => {
|
||||
console.log(res);
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
const tips = ref('');
|
||||
const seconds = ref(60);
|
||||
const uCodeRef = ref(null);
|
||||
const tips = ref('');
|
||||
const seconds = ref(60);
|
||||
const uCodeRef = ref(null);
|
||||
|
||||
const codeChange = (text) => {
|
||||
const codeChange = (text) => {
|
||||
tips.value = text;
|
||||
};
|
||||
};
|
||||
|
||||
const getCode = () => {
|
||||
const getCode = () => {
|
||||
if (!isAgree.value) return uni.$u.toast('请先阅读并同意协议');
|
||||
if (uCodeRef.value.canGetCode) {
|
||||
if (isPhone()) return uni.$u.toast('请输入正确的手机号码');
|
||||
|
@ -290,28 +290,28 @@ const getCode = () => {
|
|||
} else {
|
||||
uni.$u.toast('倒计时结束后再发送');
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
// 微信小程序无法拦截原生返回按钮,所以使用自定义导航拦截返回
|
||||
const navBack = () => {
|
||||
// 微信小程序无法拦截原生返回按钮,所以使用自定义导航拦截返回
|
||||
const navBack = () => {
|
||||
if (showWeixin.value == false) {
|
||||
showWeixin.value = true;
|
||||
return true;
|
||||
} else uni.navigateBack();
|
||||
}
|
||||
const navgo = (url) => {
|
||||
}
|
||||
const navgo = (url) => {
|
||||
uni.navigateTo({
|
||||
url
|
||||
})
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
page {
|
||||
page {
|
||||
background-color: #fff;
|
||||
}
|
||||
}
|
||||
|
||||
.login-box {
|
||||
.login-box {
|
||||
width: 700rpx;
|
||||
height: 80vh;
|
||||
margin: 0 auto;
|
||||
|
@ -394,5 +394,5 @@ page {
|
|||
color: #20B128;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
Loading…
Reference in New Issue