This commit is contained in:
zmj 2024-07-04 13:46:05 +08:00
parent c899d8f472
commit ec33cc6119
2 changed files with 293 additions and 289 deletions

View File

@ -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

View File

@ -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>