@@ -41,6 +41,11 @@ const props = defineProps({ | |||
type: String, | |||
default: "", //1正常发验证码 2 ETC预留手机号验证码发送 3 ETC预留手机号修改-新手机验证码发送 | |||
}, | |||
businessType: { | |||
type: Number, | |||
default: 0, //0-登录 1-注册 2-忘记密码 3-修改手机号 | |||
}, | |||
}); | |||
let interval = null; | |||
@@ -73,7 +78,10 @@ const sendSmsCode = async () => { | |||
if(props.type=="1"){ | |||
const options = { | |||
type: 2, | |||
data: { mobile: props.mobile }, | |||
data: { | |||
mobile: props.mobile, | |||
businessType:props.businessType | |||
}, | |||
method: "POST", | |||
showLoading: true, | |||
}; |
@@ -20,7 +20,7 @@ | |||
<view class="form-input" v-if="state.loginType === 'code'"> | |||
<input class="input" v-model="state.code" placeholder="请输入验证码" placeholder-class="form-placeholder" | |||
maxlength="6" type="number" /> | |||
<verification-code :bg="false" :mobile="state.username"></verification-code> | |||
<verification-code :bg="false" :mobile="state.username" businessType=0></verification-code> | |||
</view> | |||
</view> | |||
@@ -71,13 +71,12 @@ | |||
<script setup lang="ts"> | |||
import { reactive } from "vue"; | |||
import { checkStr, msg, navTo, subscribeMessages } from "@/utils/utils"; | |||
import { checkStr, msg, navTo, subscribeMessages} from "@/utils/utils"; | |||
import { onLoad, onUnload } from "@dcloudio/uni-app"; | |||
import { login, loginCode, loginTime, wechatAppID } from "@/utils/network/api.js"; | |||
import { requestNew} from "@/utils/network/request.js"; | |||
import { stringToJson } from "@/utils/network/encryption"; | |||
import { useUserStore } from "@/stores/user"; | |||
import { setItem } from "@/utils/storage"; | |||
import { setItem,getItem } from "@/utils/storage"; | |||
const userStore = useUserStore(); | |||
const { fetchToken } = userStore; | |||
@@ -141,7 +140,10 @@ | |||
msg("请勾选我已阅读并同意《平台用户服务隐私协议》"); | |||
return; | |||
} | |||
if(!getItem('mpOpenId')){ | |||
navTo(`/subpackage/after-sale/wxWebView`) | |||
return; | |||
} | |||
//判断是验证码登录,还是账号密码登录 | |||
if (state.loginType === "code") { | |||
reqLogin(loginCode, { |
@@ -50,14 +50,14 @@ export const useUserStore = defineStore("userStore", { | |||
/*根据登录code获取token信息*/ | |||
fetchToken(code) { | |||
if(getItem("QYorder") && getItem("QYorder").openid){ | |||
if(getItem("wxOpenid")){ | |||
const options = { | |||
type: 2, | |||
data: { | |||
deviceId: "", | |||
code: code, | |||
loginSource: getItem("loginSource"), | |||
wxOpenid: getItem("QYorder").openid, | |||
wxOpenid: getItem("wxOpenid"), | |||
zfbOpenId: getItem("zfbOpenId"), | |||
zfbUserId: getItem("zfbUserId"), | |||
}, | |||
@@ -84,7 +84,7 @@ export const useUserStore = defineStore("userStore", { | |||
uni.login({ | |||
provider: "weixin", | |||
success: function(e) { | |||
console.log("jsCode",e.code) | |||
console.log("jsCode",e) | |||
const options = { | |||
type: 2, | |||
data: { | |||
@@ -96,17 +96,17 @@ export const useUserStore = defineStore("userStore", { | |||
requestNew(getOpenId, options).then((res) => { | |||
const result =res; | |||
console.log("getOpenId===",result) | |||
const openidData = stringToJson(result.data); | |||
setItem("QYorder", openidData); | |||
setItem("wxOpenid", result.openid); | |||
const options = { | |||
type: 2, | |||
data: { | |||
deviceId: "", | |||
code: code, | |||
loginSource: getItem("loginSource"), | |||
wxOpenid: getItem("QYorder").openid, | |||
wxOpenid: getItem("wxOpenid"), | |||
zfbOpenId: getItem("zfbOpenId"), | |||
zfbUserId: getItem("zfbUserId"), | |||
mpOpenId:getItem('mpOpenId')//用户在微信公众号的唯一身份标识openid | |||
}, | |||
method: "POST", | |||
showLoading: false, |
@@ -258,7 +258,7 @@ export const orderCancel= "/iaw/issue/order/orderCancel" //订单取消 | |||
export const queryPage= "/iaw/issue/order/queryPage" //订单分页查询 | |||
export const orderReceiveGoods= "/iaw/issue/order/orderReceiveGoods" //订单收货 | |||
export const orderDetailQuery= "/iaw/issue/order/orderDetailQuery" //订单详情查询 | |||
export const getOpenId= "/iaw/issue/userBasic/getOpenId" //获取微信小程序openid | |||
export const getOpenId= "/iaw/portal/getWxOpenId" //获取微信小程序openid | |||
export const agreementInSertOrder= "/iaw/issue/order/agreementInSertOrder" //订单查询协议 | |||
export const agreeOrderProdcut= "/iaw/issue/order/agreeOrderProduct" //订单确认协议 | |||
export const monthlyStatementQuery= "/iaw/app/issue/monthlyStatement/query" //月结单查询 | |||
@@ -309,7 +309,8 @@ export const totalbill= "/iaw/app/issue/cardAnnounce/totalbill" //账单合计 | |||
export const passbill= "/iaw/app/issue/cardAnnounce/passbill" //ETC通行流水记录查询 | |||
// 验证码 | |||
export const sendMessage= "/iaw/message/sendMessage" //发送短信验证码 | |||
// export const sendMessage= "/iaw/message/sendMessage" //发送短信验证码 | |||
export const sendMessage= "/iaw/portal/sendCode" //发送短信验证码 | |||
export const messageValid= "/iaw/message/messageValid" //短信验证码验证 | |||
// 卡签挂失解挂 |
@@ -344,7 +344,8 @@ export function requestNew(code, options = {}, start = false,clie=()=>{}) { | |||
Common['orderSource'] = "WECHAT" | |||
// #endif | |||
// options.url = envs[process.env.NODE_ENV].baseUrl+'/prod' + code | |||
options.url = envs[process.env.NODE_ENV].baseUrl+'/ndev' + code | |||
options.url = envs[process.env.NODE_ENV].baseUrl+'/newDev/ndev' + code | |||
// options.url = envs[process.env.NODE_ENV].baseUrl+'/ndev' + code | |||
//默认json数据格式提交` | |||
let contentType = 'application/json' | |||
@@ -393,11 +394,11 @@ export function requestNew(code, options = {}, start = false,clie=()=>{}) { | |||
resolve(res.data.data) | |||
} else { | |||
if(res.data.code == 401002){ | |||
updateGetTokenNew().then((data) => { | |||
console.log("token刷新", data); | |||
clie(data) | |||
requestNew(code, options, true) | |||
}) | |||
// updateGetTokenNew().then((data) => { | |||
// console.log("token刷新", data); | |||
// clie(data) | |||
// requestNew(code, options, true) | |||
// }) | |||
}else if(res.data.code == 403001 || res.data.code == 403004 || res.data.code == 403003){ | |||
// 会详细列出具体字段的错误信息。 | |||
uni.showModal({ |
@@ -524,8 +524,9 @@ export const uploadFile = (tempImagePath, imageType, code) => { | |||
success: (uploadFileRes) => { | |||
let uploadFileImage = 'http://100.64.2.113:9000' + '/default-bucket/' + JSON.parse(uploadFileRes.data).data.ossFilePath | |||
console.log("111", JSON.parse(uploadFileRes.data).data.ossFilePath,JSON.parse(uploadFileRes.data)); | |||
var data={} | |||
if (code == "/iaw/txOcr/idCardOcr") { //身份证 imageType 1 2 | |||
var data = { | |||
data = { | |||
source: "1", | |||
agencyId: agentId, | |||
imageType: imageType, | |||
@@ -533,7 +534,7 @@ export const uploadFile = (tempImagePath, imageType, code) => { | |||
url: uploadFileImage | |||
}; | |||
} else if (code == "/iaw/txOcr/vehicleLicenseOcr") { //行驶证 imageType 1正 2反 | |||
var data = { | |||
data = { | |||
source: "1", | |||
agencyId: agentId, | |||
imageType: imageType, | |||
@@ -546,8 +547,8 @@ export const uploadFile = (tempImagePath, imageType, code) => { | |||
console.log("17", uploadFileImage) | |||
resolve(uploadFileImage) | |||
return; | |||
} else if (code == '/iaw/txOcr/businessLicenseOcrNew') { //营业执照 | |||
var data = { | |||
} else if (code == '/iaw/txOcr/businessLicenseOcr') { //营业执照 | |||
data = { | |||
type: 'business_license', | |||
url: uploadFileImage, | |||
agencyId: agentId, |