@@ -23,7 +23,7 @@ | |||
</view> | |||
<view class="btn"> | |||
<submit-button title="同意协议并获取验证码" @submit="nextStep"></submit-button> | |||
<submit-button title="同意协议并获取验证码" @submit="mobileIsRepeat"></submit-button> | |||
</view> | |||
</template> | |||
@@ -31,9 +31,9 @@ | |||
// import uCheckBox from "@/uni_modules/vk-uview-ui/components/u-checkbox/u-checkbox.vue"; | |||
import { reactive } from "vue"; | |||
import { checkStr, msg, navTo } from "@/utils/utils"; | |||
import { sendCode, regist } from "@/utils/network/api.js"; | |||
import { sendCode, regist, mobileIsRepeatApi } from "@/utils/network/api.js"; | |||
import { request } from "@/utils/network/request.js"; | |||
import { stringToJson } from "@/utils/network/encryption"; | |||
const state = reactive({ | |||
phone: "", //电话 | |||
checked: false, //是否勾选阅读协议 | |||
@@ -42,12 +42,12 @@ | |||
console.log(e); | |||
state.checked = !state.checked; | |||
}; | |||
// 去协议页面 | |||
const toRead=()=>{ | |||
const toRead = () => { | |||
navTo("/login/agreement") | |||
} | |||
/* 下一步 */ | |||
const nextStep = () => { | |||
if (!state.phone) { | |||
@@ -83,6 +83,40 @@ | |||
console.log(err); | |||
}); | |||
}; | |||
const mobileIsRepeat = () => { | |||
if (!state.phone) { | |||
msg("请输入手机号!"); | |||
return; | |||
} | |||
if (!checkStr(state.phone, "mobile")) { | |||
msg("请输入正确的手机号!"); | |||
return; | |||
} | |||
if (!state.checked) { | |||
msg("请勾选我已阅读并同意《平台用户服务隐私协议》"); | |||
return; | |||
} | |||
const options = { | |||
type: 2, | |||
data: { mobile: state.phone }, | |||
method: "POST", | |||
showLoading: true, | |||
}; | |||
request(mobileIsRepeatApi, options) | |||
.then((res) => { | |||
const result = stringToJson(res.bizContent); | |||
console.log("个人账号重复注册校验", result.canRegister) | |||
if (result.canRegister) { | |||
nextStep(); | |||
} else { | |||
msg("该手机号已注册!"); | |||
} | |||
}) | |||
.catch((err) => { | |||
console.log(err); | |||
}); | |||
}; | |||
</script> | |||
<style lang="scss" scoped> |
@@ -1,23 +1,23 @@ | |||
/* 接口中常量 */ | |||
// export const URL = "192.168.100.63"; | |||
// export const URL = "trial.etcjz.cn"; | |||
export const URL = "qtzl.etcjz.cn"; | |||
export const URL = "trial.etcjz.cn"; | |||
// export const URL = "qtzl.etcjz.cn"; | |||
/** | |||
* 配置信息,针对不同的平台进行配置 | |||
*/ | |||
export const envs = { | |||
//开发环境配置 | |||
development: { | |||
baseUrl: "https://qtzl.etcjz.cn", | |||
// baseUrl: "https://trial.etcjz.cn", | |||
// baseUrl: "https://qtzl.etcjz.cn", | |||
baseUrl: "https://trial.etcjz.cn", | |||
// baseUrl: "http://192.168.100.158:8085", | |||
}, | |||
//生产环境配置 | |||
production: { | |||
// baseUrl: "http://192.168.124.6:8087", | |||
// baseUrl: "http://222.85.144.89:19002", | |||
baseUrl: "https://qtzl.etcjz.cn", | |||
// baseUrl: "https://trial.etcjz.cn", | |||
// baseUrl: "https://qtzl.etcjz.cn", | |||
baseUrl: "https://trial.etcjz.cn", | |||
// baseUrl: "http://192.168.100.158:8085", | |||
}, | |||
} | |||
@@ -245,4 +245,5 @@ export const PAYMENTORDERAPPLY = "377421d6ed4f48a29575aa126838a4d2" //CSMSN-订 | |||
export const businessApi = "b275644e586b447791eede4ad6a41640" //业务完成日志 | |||
export const inventoryEquipmentApi = "5570160d4b8d46408664b6c289de6b57" //库存设备统计 | |||
export const getOpenidApi = "53c0698b512a44539ea05cc88157e68b" //获取微信小程序openid | |||
export const getAgreementApi = "32a9d99a781a4bf2af29a46d903702bd" //根据订单编号获取渠道产品的补充协议 | |||
export const getAgreementApi = "32a9d99a781a4bf2af29a46d903702bd" //根据订单编号获取渠道产品的补充协议 | |||
export const mobileIsRepeatApi = "19d58812148d41bbb7d435ab93928787" //个人账号重复注册校验 |