diff --git a/api/user.js b/api/user.js index 2dcaa73..7f85bac 100644 --- a/api/user.js +++ b/api/user.js @@ -132,4 +132,9 @@ export const getUserShip = (data) => { export const getCreateLists = (data) => { return request.get('/store/store/create_lists', data); +} + + +export const getloginSms = (data) => { + return request.post('/user/user/login_sms', data); } \ No newline at end of file diff --git a/pageQuota/vipUser/index.vue b/pageQuota/vipUser/index.vue index 1efe700..4cc6f86 100644 --- a/pageQuota/vipUser/index.vue +++ b/pageQuota/vipUser/index.vue @@ -11,7 +11,6 @@ - @@ -22,7 +21,6 @@ 已开通列表 - @@ -259,7 +257,8 @@ auth_code: "", address: "", label_name: "", - label_id: "" + label_id: "", + user_ship: '' }) const conformRole = (e) => { @@ -376,6 +375,7 @@ success: function(res) { formData.auth_code = res.result formData.recharge_type = 'INDUSTRYMEMBERS' + formData.user_ship = 1 vipRechargeApi(formData).then(res => { uni.$u.toast('操作成功'); currentTab.value = 2 @@ -383,6 +383,13 @@ formData.mobile = '' formData.address = '' formData.label_name = '' + formData.city = '' + formData.area = '' + formData.street = '' + formData.village = '' + formData.brigade = '' + currentAddressIndex.value = 0 + tabsList.forEach(item => { item.name = '请选择' }) @@ -395,6 +402,7 @@ } else { delete formData.recharge_type delete formData.auth_code + formData.user_ship = 4 vipRechargeApi(formData).then(res => { uni.$u.toast('操作成功'); currentTab.value = 2 @@ -402,6 +410,12 @@ formData.mobile = '' formData.address = '' formData.label_name = '' + formData.city = '' + formData.area = '' + formData.street = '' + formData.village = '' + formData.brigade = '' + currentAddressIndex.value = 0 tabsList.forEach(item => { item.name = '请选择' }) diff --git a/pages.json b/pages.json index 49114dc..c1ae891 100644 --- a/pages.json +++ b/pages.json @@ -31,7 +31,7 @@ }, { "path": "pages/login/test", "style": { - "navigationBarTitleText": "", + "navigationBarTitleText": "账号登录", "enablePullDownRefresh": false // "navigationStyle": "custom" } diff --git a/pages/login/test.vue b/pages/login/test.vue index 6949adb..83fc13b 100644 --- a/pages/login/test.vue +++ b/pages/login/test.vue @@ -1,8 +1,41 @@ @@ -10,13 +43,51 @@ import { userLoginApi, userInfoApi, - getStoreInfo + getStoreInfo, + getloginSms } from "@/api/user.js"; import { - ref + ref, + reactive } from "vue" import useUserStore from "@/store/user"; const userStore = useUserStore(); + + + + + const formData = reactive({ + account: "", + code: "", + terminal: 1, + scene: 2 + }) + + + // 获取验证码 + const cutDown = ref(0) + const flag = ref(true) + const code = ref('') + const checkPhone = (phone) => { + const regex = /^1[3-9]\d{9}$/; + return regex.test(phone) ? true : false + } + + const getCode = async () => { + if (!checkPhone(formData.account)) return uni.$u.toast('请输入正确的手机号') + await getloginSms({ + account: formData.account + }) + flag.value = false + cutDown.value = 60 + let timer = setInterval(() => { + cutDown.value-- + if (cutDown.value <= 0) clearInterval(timer) + }, 1000) + } + // 获取验证码结束 + + const zh = ref("") const submit = () => { @@ -48,5 +119,46 @@ } - \ No newline at end of file