@@ -1,130 +1,134 @@ | |||
<script> | |||
import { | |||
request | |||
} from "@/utils/network/request.js" | |||
import { | |||
etcQYAction | |||
} from "@/utils/network/api.js" | |||
import { | |||
msg, | |||
} from "./utils/utils"; | |||
import { | |||
getItem | |||
} from "./utils/storage" | |||
export default { | |||
onLaunch: function(option) { | |||
wx.setStorageSync("extraData", option.referrerInfo.extraData) | |||
console.log('App Launch', uni.getLaunchOptionsSync().path) | |||
// #ifdef MP-WEIXIN | |||
//获取小程序更新机制兼容 | |||
if (uni.canIUse('getUpdateManager')) { | |||
// pdateManager,用于管理小程序更新。 | |||
const updateManager = uni.getUpdateManager(); | |||
updateManager.onCheckForUpdate(function(res) { | |||
// 请求完新版本信息的回调 | |||
if (res.hasUpdate) { | |||
updateManager.onUpdateReady(function() { | |||
uni.showModal({ | |||
title: '更新提示', | |||
content: '新版本已经准备好,是否重启应用?', | |||
success: function(res) { | |||
if (res.confirm) { | |||
// 新的版本已经下载好,调用 applyUpdate 应用新版本并重启 | |||
updateManager.applyUpdate() | |||
} | |||
} | |||
}) | |||
}); | |||
updateManager.onUpdateFailed(function() { | |||
// 新的版本下载失败 | |||
uni.showModal({ | |||
title: '已经有新版本了哟~', | |||
content: '新版本已经上线啦~,请您删除当前小程序,重新搜索打开哟~', | |||
showCancel: false, | |||
confirmText: '我知道了' | |||
}) | |||
}); | |||
} | |||
}); | |||
} else { | |||
// 如果希望用户在最新版本的客户端上体验您的小程序,可以这样子提示 | |||
uni.showModal({ | |||
title: '提示', | |||
content: '当前微信版本过低,无法更好体验程序,请升级到最新微信版本后重试。', | |||
showCancel: false, | |||
confirmText: '我知道了' | |||
}); | |||
} | |||
// #endif | |||
}, | |||
onShow: function(option) { | |||
console.log(option); | |||
if (option && option.scene === 1038) { | |||
// 场景值1038:从被打开的小程序返回 | |||
const { | |||
appId, | |||
extraData | |||
} = option.referrerInfo; | |||
if (appId == "wxbcad394b3d99dac9") { | |||
console.log(getItem("QYorder")); | |||
const orders = getItem("QYorder") | |||
// appId为wxbcad394b3d99dac9:从车主小程序跳转回来 | |||
// TODO | |||
// 客户端小程序不确定授权结果,需要发起‘查询车牌服务开通信息’确认授权结果 | |||
var data = { | |||
orderId: orders.orderId, | |||
subOpenId: orders.openid, | |||
}; | |||
const options = { | |||
type: 2, | |||
data: data, | |||
method: "POST", | |||
showLoading: true, | |||
}; | |||
request(etcQYAction, options).then((res) => { | |||
console.log(res); | |||
msg("授权成功"); | |||
//如果我当前路由是签约页面才能跳转 | |||
let routes = getCurrentPages(); | |||
let curRoute = routes[routes.length - 1].route | |||
console.log(curRoute) | |||
if (curRoute === 'applyCard/sign-up') { | |||
uni.navigateTo({ | |||
url: `/applyCard/product-detail?orderId=${orders.orderId}&&clientFee=${getItem("clientFee")}&&id=${getItem("productId")}`, | |||
}); | |||
} | |||
if (curRoute === 'pages/app/sign') { | |||
//扫描签约成功 | |||
uni.switchTab({ | |||
url:"/pages/index/index" | |||
}) | |||
} | |||
}); | |||
return; | |||
} | |||
} | |||
console.log(option); | |||
}, | |||
onLoad: function(option) { | |||
<script> | |||
import { | |||
request | |||
} from "@/utils/network/request.js" | |||
import { | |||
etcQYAction, | |||
queryKey | |||
} from "@/utils/network/api.js" | |||
import { | |||
msg, | |||
} from "./utils/utils"; | |||
import { | |||
getItem | |||
} from "./utils/storage" | |||
import { log } from "console"; | |||
export default { | |||
onLaunch: function(option) { | |||
wx.setStorageSync("extraData", option.referrerInfo.extraData) | |||
console.log('App Launch', uni.getLaunchOptionsSync().path) | |||
// #ifdef MP-WEIXIN | |||
//获取小程序更新机制兼容 | |||
if (uni.canIUse('getUpdateManager')) { | |||
// pdateManager,用于管理小程序更新。 | |||
const updateManager = uni.getUpdateManager(); | |||
updateManager.onCheckForUpdate(function(res) { | |||
// 请求完新版本信息的回调 | |||
if (res.hasUpdate) { | |||
updateManager.onUpdateReady(function() { | |||
uni.showModal({ | |||
title: '更新提示', | |||
content: '新版本已经准备好,是否重启应用?', | |||
success: function(res) { | |||
if (res.confirm) { | |||
// 新的版本已经下载好,调用 applyUpdate 应用新版本并重启 | |||
updateManager.applyUpdate() | |||
} | |||
} | |||
}) | |||
}); | |||
updateManager.onUpdateFailed(function() { | |||
// 新的版本下载失败 | |||
uni.showModal({ | |||
title: '已经有新版本了哟~', | |||
content: '新版本已经上线啦~,请您删除当前小程序,重新搜索打开哟~', | |||
showCancel: false, | |||
confirmText: '我知道了' | |||
}) | |||
}); | |||
} | |||
}); | |||
} else { | |||
// 如果希望用户在最新版本的客户端上体验您的小程序,可以这样子提示 | |||
uni.showModal({ | |||
title: '提示', | |||
content: '当前微信版本过低,无法更好体验程序,请升级到最新微信版本后重试。', | |||
showCancel: false, | |||
confirmText: '我知道了' | |||
}); | |||
} | |||
// #endif | |||
}, | |||
onShow: function(option) { | |||
console.log(option); | |||
if (option && option.scene === 1038) { | |||
// 场景值1038:从被打开的小程序返回 | |||
const { | |||
appId, | |||
extraData | |||
} = option.referrerInfo; | |||
if (appId == "wxbcad394b3d99dac9") { | |||
console.log(getItem("QYorder")); | |||
const orders = getItem("QYorder") | |||
// appId为wxbcad394b3d99dac9:从车主小程序跳转回来 | |||
// TODO | |||
// 客户端小程序不确定授权结果,需要发起‘查询车牌服务开通信息’确认授权结果 | |||
var data = { | |||
orderId: orders.orderId, | |||
subOpenId: orders.openid, | |||
}; | |||
const options = { | |||
type: 2, | |||
data: data, | |||
method: "POST", | |||
showLoading: true, | |||
}; | |||
request(etcQYAction, options).then((res) => { | |||
console.log(res); | |||
msg("授权成功"); | |||
//如果我当前路由是签约页面才能跳转 | |||
let routes = getCurrentPages(); | |||
let curRoute = routes[routes.length - 1].route | |||
console.log(curRoute) | |||
if (curRoute === 'applyCard/sign-up') { | |||
uni.navigateTo({ | |||
url: `/applyCard/product-detail?orderId=${orders.orderId}&&clientFee=${getItem("clientFee")}&&id=${getItem("productId")}`, | |||
}); | |||
} | |||
if (curRoute === 'pages/app/sign') { | |||
//扫描签约成功 | |||
uni.switchTab({ | |||
url: "/pages/index/index" | |||
}) | |||
} | |||
}); | |||
return; | |||
} | |||
} | |||
console.log(option); | |||
}, | |||
onLoad: function(option) { | |||
console.log(option) | |||
}, | |||
onHide: function() { | |||
console.log('App Hide') | |||
} | |||
} | |||
</script> | |||
<style lang="scss"> | |||
/*每个页面公共css */ | |||
@import './static/css/common.scss'; | |||
// @import './uni_modules/vk-uview-ui/index.scss'; | |||
page { | |||
font-family: "Microsoft Yahei"; | |||
// filter: grayscale(1) | |||
} | |||
console.log('进入主视图') | |||
}, | |||
onHide: function() { | |||
console.log('App Hide') | |||
}, | |||
} | |||
</script> | |||
<style lang="scss"> | |||
/*每个页面公共css */ | |||
@import './static/css/common.scss'; | |||
// @import './uni_modules/vk-uview-ui/index.scss'; | |||
page { | |||
font-family: "Microsoft Yahei"; | |||
// filter: grayscale(1) | |||
} | |||
</style> |
@@ -30,7 +30,7 @@ | |||
</u-radio-group> | |||
</view> | |||
</u-form-item> | |||
<u-form-item prop="phone"> | |||
<!-- <u-form-item prop="phone"> | |||
<view class="from_item" style="background-color: #f7f7f7"> | |||
<text><text style="color: red"></text>手机号:</text> | |||
<u-input v-model="form.mobile" :disabled="true" class="input" /> | |||
@@ -47,7 +47,7 @@ | |||
}}</view> | |||
</view> | |||
</view> | |||
</u-form-item> | |||
</u-form-item> --> | |||
</view> | |||
</u-form> | |||
<button style="margin-top: 50rpx;" class="submit" @click="toPage()">OBU增补申请</button> | |||
@@ -275,34 +275,12 @@ | |||
//下一步 | |||
const toPage = () => { | |||
myForm.value.validate((valid) => { | |||
if (valid) { | |||
const options = { | |||
type: 2, | |||
data: { | |||
mobile: form.mobile, | |||
code: form.code | |||
}, | |||
method: "POST", | |||
showLoading: true, | |||
}; | |||
request(checkCode, options) | |||
.then(() => { | |||
queryOBUAddAction().then(val => { | |||
navTo( | |||
`/after-sale/additional-equipment/result` | |||
) | |||
}) | |||
}) | |||
.catch((err) => { | |||
console.log(err); | |||
}); | |||
} else { | |||
console.log("验证未通过"); | |||
} | |||
}); | |||
queryOBUAddAction().then(val => { | |||
navTo( | |||
`/after-sale/additional-equipment/result` | |||
) | |||
}) | |||
}; | |||
</script> | |||
@@ -27,7 +27,7 @@ | |||
</view> | |||
</u-form-item> | |||
<u-form-item prop="phone"> | |||
<!-- <u-form-item prop="phone"> | |||
<view class="from_item" style="background-color: #f7f7f7"> | |||
<text><text style="color: red"></text>手机号:</text> | |||
<u-input v-model="form.mobile" :disabled="true" class="input" /> | |||
@@ -44,7 +44,7 @@ | |||
}}</view> | |||
</view> | |||
</view> | |||
</u-form-item> | |||
</u-form-item> --> | |||
</view> | |||
</u-form> | |||
<button style="margin-top: 50rpx;" class="submit" v-if="apply.data.status === 'APPLY'||!apply.data.status" | |||
@@ -274,19 +274,19 @@ | |||
//下一步 | |||
const toPage = () => { | |||
myForm.value.validate((valid) => { | |||
if (valid) { | |||
const options = { | |||
type: 2, | |||
data: { | |||
mobile: form.mobile, | |||
code: form.code | |||
}, | |||
method: "POST", | |||
showLoading: true, | |||
}; | |||
request(checkCode, options) | |||
.then(() => { | |||
// myForm.value.validate((valid) => { | |||
// if (valid) { | |||
// const options = { | |||
// type: 2, | |||
// data: { | |||
// mobile: form.mobile, | |||
// code: form.code | |||
// }, | |||
// method: "POST", | |||
// showLoading: true, | |||
// }; | |||
// request(checkCode, options) | |||
// .then(() => { | |||
if (apply.data.status === 'APPLY') { | |||
navTo( | |||
`/after-sale/replace-equipment/form?orderId=${params.orderId}&&id=${apply.data.id}` | |||
@@ -312,14 +312,14 @@ | |||
}) | |||
} | |||
}) | |||
.catch((err) => { | |||
console.log(err); | |||
}); | |||
} else { | |||
console.log("验证未通过"); | |||
} | |||
}); | |||
// }) | |||
// .catch((err) => { | |||
// console.log(err); | |||
// }); | |||
// } else { | |||
// console.log("验证未通过"); | |||
// } | |||
// }); | |||
}; | |||
</script> | |||
@@ -2,7 +2,7 @@ | |||
<view class="oderPage"> | |||
<u-form :model="form" ref="myForm" :error-type="errorType"> | |||
<view class="from"> | |||
<u-form-item prop="phone"> | |||
<!-- <u-form-item prop="phone"> | |||
<view class="from_item" style="background-color: #f7f7f7"> | |||
<text><text style="color: red"></text>手机号:</text> | |||
<u-input v-model="form.mobile" :disabled="true" class="input" /> | |||
@@ -19,7 +19,7 @@ | |||
}}</view> | |||
</view> | |||
</view> | |||
</u-form-item> | |||
</u-form-item> --> | |||
</view> | |||
</u-form> | |||
@@ -140,7 +140,8 @@ | |||
//申请 | |||
const queryCckChangejzCardAction = () => { | |||
var data = { | |||
orderId:params.orderId | |||
orderId:params.orderId, | |||
}; | |||
const options = { | |||
type: 2, | |||
@@ -160,33 +161,32 @@ | |||
//下一步 | |||
const toPage = () => { | |||
myForm.value.validate((valid) => { | |||
if (valid) { | |||
const options = { | |||
type: 2, | |||
data: { | |||
mobile: form.mobile, | |||
code: form.code | |||
}, | |||
method: "POST", | |||
showLoading: true, | |||
}; | |||
request(checkCode, options) | |||
.then(() => { | |||
// myForm.value.validate((valid) => { | |||
// if (valid) { | |||
// const options = { | |||
// type: 2, | |||
// data: { | |||
// mobile: form.mobile, | |||
// code: form.code | |||
// }, | |||
// method: "POST", | |||
// showLoading: true, | |||
// }; | |||
// request(checkCode, options) | |||
// .then(() => { | |||
queryCckChangejzCardAction().then(val => { | |||
navTo( | |||
`/after-sale/to-bookkeeping-card/mailing_information?orderId=${params.orderId}&&applyId=${val.applyId}` | |||
) | |||
}) | |||
}) | |||
.catch((err) => { | |||
console.log(err); | |||
}); | |||
} else { | |||
console.log("验证未通过"); | |||
} | |||
}); | |||
// }) | |||
// .catch((err) => { | |||
// console.log(err); | |||
// }); | |||
// } else { | |||
// console.log("验证未通过"); | |||
// } | |||
// }); | |||
}; | |||
</script> | |||
@@ -15,7 +15,7 @@ | |||
</view> | |||
</u-form-item> | |||
<u-form-item prop="phone"> | |||
<!-- <u-form-item prop="phone"> | |||
<view class="from_item" style="background-color: #f7f7f7"> | |||
<text><text style="color: red"></text>手机号:</text> | |||
<u-input v-model="form.mobile" :disabled="true" class="input" /> | |||
@@ -32,7 +32,7 @@ | |||
}}</view> | |||
</view> | |||
</view> | |||
</u-form-item> | |||
</u-form-item> --> | |||
</view> | |||
</u-form> | |||
<button class="submit" @click="toPage()">下一步</button> | |||
@@ -137,25 +137,25 @@ | |||
} else { | |||
form.serviceType = 'WITHCUSTOMER' | |||
} | |||
const options = { | |||
type: 2, | |||
data: { | |||
mobile: form.mobile, | |||
code: form.code | |||
}, | |||
method: "POST", | |||
showLoading: true, | |||
}; | |||
request(checkCode, options) | |||
.then((res) => { | |||
// const options = { | |||
// type: 2, | |||
// data: { | |||
// mobile: form.mobile, | |||
// code: form.code | |||
// }, | |||
// method: "POST", | |||
// showLoading: true, | |||
// }; | |||
// request(checkCode, options) | |||
// .then((res) => { | |||
uni.$emit('queryCardlossStatus', { | |||
type: form.serviceType | |||
}) | |||
uni.navigateBack() | |||
}) | |||
.catch((err) => { | |||
console.log(err); | |||
}); | |||
// }) | |||
// .catch((err) => { | |||
// console.log(err); | |||
// }); | |||
}; | |||
</script> | |||
@@ -211,6 +211,12 @@ | |||
getItem, | |||
StorageKeys | |||
} from "../../utils/storage"; | |||
import { | |||
onLoad, | |||
} from "@dcloudio/uni-app"; | |||
import { | |||
queryKey | |||
} from "@/utils/network/api.js"; | |||
import { | |||
reactive | |||
} from "vue"; | |||
@@ -313,6 +319,30 @@ | |||
}); | |||
}; | |||
onLoad(() => { | |||
quanKeyAction().then((val: any) => { | |||
console.log(val) | |||
}) | |||
}); | |||
const quanKeyAction = (val: any) => { | |||
var data = {}; | |||
const options = { | |||
type: 2, | |||
data: data, | |||
method: "POST", | |||
showLoading: true, | |||
}; | |||
return new Promise(async (resolve, reject) => { | |||
const res = await request(queryKey, options); | |||
const data = stringToJson(res.bizContent); | |||
resolve(data); | |||
}).catch((error) => { | |||
reject(error); | |||
}); | |||
} | |||
const toCreatOrder = (val: any) => { | |||
state.userType = val; | |||
if (val === "1") { |
@@ -4,7 +4,9 @@ export const loginTime = 86400; //登录有效时间(单位s) 1天 | |||
export const wechatPayConfigId = "6a9a54bc01f6443faea7ffe132b19f6"; //支付配置编号 微信小程序支付 | |||
export const wechatAppID = "wx008c60533388527a"; //小程序APPid | |||
export const wechatSecret = "95197718b43b497f02732bd9f8011080"; //小程序AppSecret | |||
//字典 | |||
export const queryKey = 'c48706c8fe4c47dcb9dd24f1c7fe6074'//全量KEY | |||
/*统一 会员平台*/ | |||
export const sendCode = "2"; //统一会员平台发送验证码接口 | |||
export const regist = "3"; // 统一会员平台个人账号注册 |