@@ -1,5 +1,5 @@ | |||
// 订单跳转统一工具类 | |||
import { msg, navTo, interceptND } from "@/utils/utils"; | |||
import { msg, navTo, interceptND, objectToQueryString } from "@/utils/utils"; | |||
import { OrderStatus } from "@/datas/enum"; | |||
import { OrderTypes } from "@/datas/enum"; | |||
import { getItem, setItem } from "@/utils/storage"; | |||
@@ -192,7 +192,15 @@ export default function useOrderSkip() { | |||
const params = encodeURIComponent(JSON.stringify(orderInfo)) | |||
jump("14", params) | |||
} else { | |||
navTo(`/subpackage/after-sale/activation/operation-tips?id=${orderInfo.id}&orderId=${orderInfo.orderId ? orderInfo.orderId : orderInfo.orderNo}&cardStatus=${orderInfo.cardStatus}&obuStatus=${orderInfo.obuStatus}&transfer=${1}`); | |||
let params = { | |||
id: orderInfo.id, | |||
orderId: orderInfo.orderId ? orderInfo.orderId : orderInfo.orderNo, | |||
cardStatus: orderInfo.cardStatus, | |||
obuStatus: orderInfo.obuStatus, | |||
transfer: 1, | |||
} | |||
let url = `/subpackage/after-sale/activation/operation-tips?${objectToQueryString(params)}`; | |||
navTo(url); | |||
} | |||
} | |||
@@ -0,0 +1,14 @@ | |||
export const environment = { | |||
// 开发环境配置 | |||
development: { | |||
baseUrl: "https://qtzl.etcjz.cn", | |||
fileUrl: "https://qtzl.etcjz.cn", // 文件服务器路径 | |||
appid: "wxa2d9acdd1054e69b" | |||
}, | |||
// 生产环境配置 | |||
production: { | |||
baseUrl: "https://qtzl.etcjz.cn", | |||
fileUrl: "https://qtzl.etcjz.cn", // 文件服务器路径 | |||
appid: "wx06bc6021dc900553" | |||
} | |||
} |
@@ -24,5 +24,29 @@ | |||
"devDependencies": { | |||
"@babel/core": "^7.22.9", | |||
"@babel/preset-env": "^7.22.9" | |||
}, | |||
"uni-app": { | |||
"scripts": { | |||
"development": { | |||
"title": "微信小程序—测试环境", | |||
"env": { | |||
"ENV_TYPE": "development", | |||
"UNI_PLATFORM": "mp-weixin" | |||
}, | |||
"define": { | |||
"MP-WEIXIN": true | |||
} | |||
}, | |||
"production": { | |||
"title": "微信小程序—生产环境", | |||
"env": { | |||
"ENV_TYPE": "production", | |||
"UNI_PLATFORM": "mp-weixin" | |||
}, | |||
"define": { | |||
"MP-WEIXIN": true | |||
} | |||
} | |||
} | |||
} | |||
} |
@@ -22,11 +22,16 @@ | |||
<!-- <view class="btn"> | |||
<submit-button title="点击重新搜索蓝牙" @submit="load"></submit-button> | |||
</view> --> | |||
<view class="action"> | |||
<!-- <view class="action"> | |||
<button type="default" class="ui-btn" @click="load"> | |||
点击重新搜索蓝牙 | |||
</button> | |||
</view> | |||
</view> --> | |||
<FixedFooter> | |||
<button type="default" class="ui-btn" @click="load"> | |||
点击重新搜索蓝牙 | |||
</button> | |||
</FixedFooter> | |||
</view> | |||
</template> | |||
@@ -35,6 +40,7 @@ | |||
import { onLoad, onReady, onShow,onUnload } from "@dcloudio/uni-app"; | |||
import { fileURL } from "@/datas/fileURL.js"; | |||
import { startHeartbeat, stopHeartbeat } from "@/pages/bluetooth/heartbeatService" | |||
import FixedFooter from '@/components/common/FixedFooter.vue' | |||
const cmd = require("../../static/etcUtil/cmdConfig.js"); | |||
const imgURL = `${fileURL}image/`; |
@@ -35,11 +35,16 @@ | |||
<view class="grey-txt"><view class="point"></view>如因激活的ETC设备未安装到对应车辆上产生的异常扣费,我司不承担任何赔偿责任。</view> | |||
<view class="grey-txt"><view class="point"></view>激活时,需要录入您的车牌号和手机号并确保OBU蓝牙和手机蓝牙处于打开状态。</view> | |||
</view> | |||
<view class="action"> | |||
<!-- <view class="action"> | |||
<button type="default" class="ui-btn" @click="gotoNextStep"> | |||
已知悉,下一步 | |||
</button> | |||
</view> | |||
</view> --> | |||
<FixedFooter> | |||
<button type="default" class="ui-btn" @click="gotoNextStep"> | |||
已知悉,下一步 | |||
</button> | |||
</FixedFooter> | |||
</view> | |||
</template> | |||
@@ -51,6 +56,7 @@ | |||
} from '@/utils/utils'; | |||
import { setItem,getItem } from "@/utils/storage"; | |||
import { onLoad } from "@dcloudio/uni-app"; | |||
import FixedFooter from '@/components/common/FixedFooter.vue' | |||
let transfer = 0; | |||
let isAfter = ''; | |||
onLoad((option) => { |
@@ -47,11 +47,16 @@ | |||
</view> | |||
</view> | |||
<view class="action"> | |||
<!-- <view class="action"> | |||
<button type="default" class="ui-btn" @click="gotoNextStep"> | |||
下一步 | |||
</button> | |||
</view> | |||
</view> --> | |||
<FixedFooter> | |||
<button type="default" class="ui-btn" @click="gotoNextStep"> | |||
下一步 | |||
</button> | |||
</FixedFooter> | |||
</view> | |||
</template> | |||
@@ -80,6 +85,7 @@ | |||
import { | |||
onLoad | |||
} from '@dcloudio/uni-app' | |||
import FixedFooter from '@/components/common/FixedFooter.vue' | |||
const height = uni.getSystemInfoSync().windowHeight | |||
const defHeadstockImg = imgURL + "issuance/chetou.png"; |
@@ -34,7 +34,7 @@ | |||
PAYMENTORDERAPPLY, | |||
aliPayConfigIdTwo, | |||
obtainUserId, | |||
getOpenId, payApply, payQuery, orderQueryDetail, payAfterOrder | |||
getOpenId, payApply, payQuery, orderDetailQuery, payAfterOrder | |||
} from "@/utils/network/api.js"; | |||
import { request, requestNew } from "@/utils/network/request.js"; | |||
import { stringToJson } from "@/utils/network/encryption"; | |||
@@ -313,7 +313,8 @@ | |||
}); | |||
// 车辆详情 | |||
// 订单详情 | |||
const orderDetail = () => { | |||
const options = { | |||
type: 2, | |||
@@ -324,7 +325,7 @@ | |||
showLoading: true, | |||
}; | |||
return new Promise(async (resolve, reject) => { | |||
const res = await requestNew(orderQueryDetail, options); | |||
const res = await requestNew(orderDetailQuery, options); | |||
setItem('orderQueryActivate', res) | |||
resolve(res); | |||
@@ -503,8 +504,8 @@ | |||
method: "POST", | |||
showLoading: true, | |||
} | |||
requestNew(payAfterOrder, options).then((res) => { | |||
console.log("res",res) | |||
requestNew(payAfterOrder, options).then(async (res) => { | |||
const orderDetailData = await orderDetail() | |||
if (res.orderStep === 'WAITING_ACTIVE') { | |||
// 前往激活 | |||
console.log("前往激活") |
@@ -31,19 +31,26 @@ | |||
</view> | |||
</view> | |||
<view class="action"> | |||
<!-- <view class="action"> | |||
<button type="default" class="button" @click="queryAgreement()"> | |||
确认办理 | |||
</button> | |||
<!-- <button type="default" class="button" @click="sign()"> | |||
<button type="default" class="button" @click="sign()"> | |||
去签署协议 | |||
</button> --> | |||
</view> | |||
</button> | |||
</view> --> | |||
<FixedFooter> | |||
<button type="default" class="ui-btn" @click="queryAgreement()"> | |||
确认办理 | |||
</button> | |||
</FixedFooter> | |||
</view> | |||
</template> | |||
<script setup lang="ts"> | |||
import FixedFooter from '@/components/common/FixedFooter.vue' | |||
import { | |||
onLoad, onShow | |||
} from "@dcloudio/uni-app"; |
@@ -25,7 +25,7 @@ | |||
</view> | |||
</view> | |||
<view class="action"> | |||
<!-- <view class="action"> | |||
<view class="btn-tip"> | |||
<image :src="`${$imgUrl}issuance/note.png`" mode="aspectFit" class="tip-icon"></image> | |||
注:签约成功后请返回本页面,再次点击{{state.channelSing=="0"?'开通服务':'恢复签约'}} | |||
@@ -33,7 +33,19 @@ | |||
<button type="default" class="button" @click="savaHandle()"> | |||
{{state.channelSing=="0"?'开通服务':'恢复签约'}} | |||
</button> | |||
</view> | |||
</view> --> | |||
<FixedFooter> | |||
<view class="footer-action"> | |||
<view class="btn-tip"> | |||
<image :src="`${$imgUrl}issuance/note.png`" mode="aspectFit" class="tip-icon"></image> | |||
注:签约成功后请返回本页面,再次点击{{state.channelSing=="0"?'开通服务':'恢复签约'}} | |||
</view> | |||
<button type="default" class="button" @click="savaHandle()"> | |||
{{state.channelSing=="0"?'开通服务':'恢复签约'}} | |||
</button> | |||
</view> | |||
</FixedFooter> | |||
</view> | |||
</template> | |||
@@ -46,9 +58,10 @@ | |||
import { fileURL } from "@/datas/fileURL.js"; | |||
import { getItem, setItem } from "@/utils/storage"; | |||
import { msg } from "@/utils/utils"; | |||
import FixedFooter from '@/components/common/FixedFooter.vue' | |||
import { | |||
infoQuery, | |||
envs, channelSingQueryApi, userSign, getOpenId, reSign | |||
envs, channelSingQueryApi, userSign, getOpenId, reSign, getSignParams | |||
} from "@/utils/network/api"; | |||
const imgURL = `${fileURL}image/`; | |||
import useOrderSkip from "@/composables/order/useOrderSkip"; | |||
@@ -66,7 +79,7 @@ | |||
orderQuery:"0", | |||
from: "", | |||
vehicleId: "", | |||
isTestSign: 0 // 是否开始检测已经签约,大于等于1的时候再去检测 | |||
}); | |||
onLoad((option : any) => { | |||
getOpenID(); | |||
@@ -83,10 +96,61 @@ | |||
state.orderQuery = option.orderQuery; | |||
getInfo(); | |||
}); | |||
onShow(() => { | |||
if (state.isTestSign >= 1) { | |||
isUserSign() | |||
} else { | |||
state.isTestSign += 1 | |||
} | |||
}) | |||
const checkboxChange = (e) => { | |||
state.checked = !state.checked; | |||
console.log(state.checked); | |||
}; | |||
// 签约检测 | |||
const isUserSign = () => { | |||
let options = { | |||
type: 2, //type: 2,JSON格式提交数据(默认表单形式提交) | |||
data: { | |||
orderNo: state.orderId, | |||
subOpenId: state.openid, | |||
signChannelType: 1, | |||
}, //请求参数 | |||
method: "POST", //提交方式(默认POST) | |||
showLoading: true, //是否显示加载中(默认显示) | |||
}; | |||
requestNew(userSign, options).then(res => { | |||
console.log(res) | |||
let { userState, step } = res | |||
if (userState === "NORMAL") { | |||
msg("已开通车主服务"); | |||
// 如果是等待激活 | |||
if(step === 'WAITING_ACTIVE'){ | |||
gotoActiveOrder(getItem('orderQueryActivate')) | |||
}else{ | |||
// 正常订单 | |||
setTimeout(() => { | |||
uni.redirectTo({ | |||
url: `/pages/order/order?index=0` | |||
}) | |||
}, 1500) | |||
} | |||
} else if (userState === "PAUSED") { | |||
msg("已暂停车主服务"); | |||
return; | |||
} else if (userState === "OVERDUE") { | |||
msg("用户已开通车主服务,但欠费状态。提示用户还款,请跳转到车主服务"); | |||
return; | |||
} | |||
}) | |||
} | |||
const getInfo = () => { | |||
//参数说明 | |||
let options = { | |||
@@ -161,11 +225,17 @@ | |||
showLoading: true, | |||
}; | |||
// #ifdef MP-WEIXIN | |||
uni.showLoading({ | |||
mask: true | |||
}) | |||
requestNew(getOpenId, options).then((res) => { | |||
const result = res; | |||
state.openid = result.openid; | |||
console.log("获取微信小程序openid", state.openid); | |||
setItem("wxOpenid", result.openid); | |||
uni.hideLoading() | |||
}).catch(() => { | |||
uni.hideLoading() | |||
}); | |||
// #endif | |||
} | |||
@@ -227,6 +297,7 @@ | |||
var data = { | |||
orderNo: state.orderId, | |||
subOpenId: state.openid, | |||
signChannelType: 1, | |||
}; | |||
const options = { | |||
type: 2, | |||
@@ -234,64 +305,94 @@ | |||
method: "POST", | |||
showLoading: true, | |||
}; | |||
requestNew(userSign, options).then((res) => { | |||
requestNew(getSignParams, options).then((res) => { | |||
const data = res; | |||
console.log("data", data) | |||
if (data.userState === "UNAUTHORIZED") { | |||
console.log("state.channelSing",state.channelSing,state.channelSing=="0") | |||
if (state.channelSing == "0") { | |||
uni.navigateToMiniProgram({ | |||
appId: "wxbcad394b3d99dac9", | |||
path: "pages/route/index", | |||
extraData: { | |||
appid: data.appId, | |||
sub_appid: data.subAppId, | |||
mch_id: data.mchId, | |||
sub_mch_id: data.subMchId, | |||
nonce_str: data.nonceStr, | |||
sign_type: data.signType, | |||
trade_scene: data.tradeScene, | |||
plate_number: data.plateNumber, | |||
sub_openid: data.subOpenId, | |||
sign: data.sign, | |||
channel_type: data.channelType | |||
}, | |||
success(res) { | |||
console.log("签约返回信息返回信息",res); | |||
}, | |||
complete(res) { | |||
console.log(res); | |||
}, | |||
fail(res) { | |||
console.log(res); | |||
// 未成功跳转到车主小程序 | |||
}, | |||
}); | |||
} | |||
uni.navigateToMiniProgram({ | |||
appId: "wxbcad394b3d99dac9", | |||
path: "pages/route/index", | |||
extraData: { | |||
appid: data.appId, | |||
sub_appid: data.subAppId, | |||
mch_id: data.mchId, | |||
sub_mch_id: data.subMchId, | |||
nonce_str: data.nonceStr, | |||
sign_type: data.signType, | |||
trade_scene: data.tradeScene, | |||
plate_number: data.plateNumber, | |||
sub_openid: data.subOpenId, | |||
sign: data.sign, | |||
channel_type: data.channelType | |||
}, | |||
success(res) { | |||
console.log("签约返回信息返回信息",res); | |||
}, | |||
complete(res) { | |||
console.log(res); | |||
}, | |||
fail(res) { | |||
console.log(res); | |||
// 未成功跳转到车主小程序 | |||
}, | |||
}); | |||
// if (data.userState === "UNAUTHORIZED") { | |||
// console.log("state.channelSing",state.channelSing,state.channelSing=="0") | |||
// if (state.channelSing == "0") { | |||
// uni.navigateToMiniProgram({ | |||
// appId: "wxbcad394b3d99dac9", | |||
// path: "pages/route/index", | |||
// extraData: { | |||
// appid: data.appId, | |||
// sub_appid: data.subAppId, | |||
// mch_id: data.mchId, | |||
// sub_mch_id: data.subMchId, | |||
// nonce_str: data.nonceStr, | |||
// sign_type: data.signType, | |||
// trade_scene: data.tradeScene, | |||
// plate_number: data.plateNumber, | |||
// sub_openid: data.subOpenId, | |||
// sign: data.sign, | |||
// channel_type: data.channelType | |||
// }, | |||
// success(res) { | |||
// console.log("签约返回信息返回信息",res); | |||
// }, | |||
// complete(res) { | |||
// console.log(res); | |||
// }, | |||
// fail(res) { | |||
// console.log(res); | |||
// // 未成功跳转到车主小程序 | |||
// }, | |||
// }); | |||
// } | |||
} else if (data.userState === "NORMAL") { | |||
msg("已开通车主服务"); | |||
console.log("开通车主服务",data) | |||
if(data.step === 'WAITING_ACTIVE'){ | |||
// 查询订单直接去激活 | |||
// 待激活 | |||
gotoActiveOrder(getItem('orderQueryActivate')) | |||
}else{ | |||
// 正常订单 | |||
setTimeout(() => { | |||
uni.redirectTo({ | |||
url: `/pages/order/order?index=0` | |||
}) | |||
}, 1500) | |||
} | |||
// } else if (data.userState === "NORMAL") { | |||
// msg("已开通车主服务"); | |||
// console.log("开通车主服务",data) | |||
// if(data.step === 'WAITING_ACTIVE'){ | |||
// // 查询订单直接去激活 | |||
// // 待激活 | |||
// gotoActiveOrder(getItem('orderQueryActivate')) | |||
// }else{ | |||
// // 正常订单 | |||
// setTimeout(() => { | |||
// uni.redirectTo({ | |||
// url: `/pages/order/order?index=0` | |||
// }) | |||
// }, 1500) | |||
// } | |||
} else if (data.userState === "PAUSED") { | |||
msg("已暂停车主服务"); | |||
return; | |||
} else if (data.userState === "OVERDUE") { | |||
msg("用户已开通车主服务,但欠费状态。提示用户还款,请跳转到车主服务"); | |||
return; | |||
} | |||
// } else if (data.userState === "PAUSED") { | |||
// msg("已暂停车主服务"); | |||
// return; | |||
// } else if (data.userState === "OVERDUE") { | |||
// msg("用户已开通车主服务,但欠费状态。提示用户还款,请跳转到车主服务"); | |||
// return; | |||
// } | |||
}); | |||
} else { | |||
//如果获取openId失败 | |||
@@ -321,14 +422,7 @@ | |||
} | |||
} | |||
.action { | |||
position: absolute; | |||
bottom: 0rpx; | |||
left: 0; | |||
height: 188rpx; | |||
background-color: #fff; | |||
border-radius: 30rpx 30rpx 0 0; | |||
width: 100vw; | |||
.footer-action { | |||
display: flex; | |||
align-items: center; | |||
justify-content: center; |
@@ -1,3 +1,5 @@ | |||
import { environment } from '@/config/environment.js' | |||
/* 接口中常量 */ | |||
export const URL = "qtzl.etcjz.cn"; | |||
/** | |||
@@ -5,20 +7,7 @@ export const URL = "qtzl.etcjz.cn"; | |||
*/ | |||
// cardType 1 记账卡 2 储值卡 3 寄存卡 | |||
// isValueCard 1 储值卡 2 记账卡 | |||
export const envs = { | |||
//开发环境配置 | |||
development: { | |||
// baseUrl: "https://qtzl.etcjz.cn", | |||
baseUrl: "https://qtzl.etcjz.cn", | |||
fileUrl: "https://qtzl.etcjz.cn", // 文件服务器路径 | |||
// baseUrl: "http://192.168.1.249:8080", | |||
}, | |||
//生产环境配置 | |||
production: { | |||
baseUrl: "https://qtzl.etcjz.cn", | |||
fileUrl: "https://qtzl.etcjz.cn", // 文件服务器路径 | |||
}, | |||
} | |||
export const envs = environment // 环境配置提取出去了,在config里面 | |||
export const appId = "52030131"; //应用appid 综合业务支撑平台使用 | |||
export const loginTime = 86400; //登录有效时间(单位s) 1天 | |||
@@ -544,3 +533,7 @@ export const readAndWriteRenewalInst = "/iaw/api/renewal/readAndWriteRenewalInst | |||
export const renewalConfirm = "/iaw/api/renewal/confirm" // 卡签续期确认 | |||
export const getChannleOrder = "/iaw/issue/order/qdOrderQuery" // 查询渠道订单 | |||
// 签约 | |||
export const getSignParams = "/iaw/issue/order/getCarsign" // 获取签约参数 |
@@ -320,7 +320,12 @@ export function requestNew(code, options = {}, start = false, clie = () => {}) { | |||
console.log("Common", Common, getItem("customerObj")); | |||
// options.url = envs[process.env.NODE_ENV].baseUrl+'/prod' + code | |||
// options.url = envs[process.env.NODE_ENV].baseUrl + "/newProd/prod" + code; | |||
options.url = envs[process.env.NODE_ENV].baseUrl + "/newDev/ndev" + code; | |||
if (process.env.NODE_ENV === 'development') { | |||
options.url = envs[process.env.NODE_ENV].baseUrl + "/newDev/ndev" + code; | |||
// options.url = envs[process.env.NODE_ENV].baseUrl + "/newProd/prod" + code; | |||
} else if (process.env.NODE_ENV === 'production') { | |||
options.url = envs[process.env.NODE_ENV].baseUrl + "/newProd/prod" + code; | |||
} | |||
//默认json数据格式提交` | |||
let contentType = "application/json"; | |||
@@ -815,9 +815,11 @@ export const getUrlParameters = (url: string) => { | |||
return params; | |||
} | |||
// 将路径转化为url中的params | |||
// 将对象转化为url中的params | |||
export const objectToQueryString = (obj: object) => { | |||
return Object.keys(obj).map(key => | |||
encodeURIComponent(key) + '=' + encodeURIComponent(obj[key]) | |||
).join('&'); | |||
// 对空值无值的属性做个过滤 | |||
const filteredObj = Object.fromEntries(Object.entries(obj).filter(([key, value]) => value !== undefined && value !== null && value !== "")); | |||
return Object.keys(filteredObj).map(key => | |||
key + '=' + filteredObj[key] | |||
).join('&'); | |||
} |
@@ -1,3 +1,49 @@ | |||
console.log('vue.config.js 已加载,当前环境:', process.env.NODE_ENV) | |||
const fs = require('fs') | |||
const ENV_CONFIG = require('./config/environment.js') | |||
const manifestPath = `${__dirname}/manifest.json`; | |||
let Manifest = fs.readFileSync(manifestPath, { | |||
encoding: 'utf-8' | |||
}) | |||
function replaceManifest(path, value) { | |||
const arr = path.split('.') | |||
const len = arr.length | |||
const lastItem = arr[len - 1] | |||
let i = 0 | |||
let ManifestArr = Manifest.split(/\n/) | |||
for (let index = 0; index < ManifestArr.length; index++) { | |||
const item = ManifestArr[index] | |||
if (new RegExp(`"${arr[i]}"`).test(item)) ++i | |||
if (i === len) { | |||
const hasComma = /,/.test(item) | |||
ManifestArr[index] = item.replace( | |||
new RegExp(`"${lastItem}"[\\s\\S]*:[\\s\\S]*`), | |||
`"${lastItem}": ${value}${hasComma ? ',' : ''}` | |||
) | |||
break | |||
} | |||
} | |||
Manifest = ManifestArr.join('\n') | |||
} | |||
// 读取环境变量内容 | |||
const appid = ENV_CONFIG[process.env.UNI_SCRIPT].appid | |||
console.log(9999) | |||
console.log(appid) | |||
if (appid) { | |||
replaceManifest('mp-weixin.appid', `"${appid}"`) | |||
} | |||
fs.writeFileSync(manifestPath, Manifest, { | |||
flag: 'w' | |||
}) | |||
module.exports = { | |||
parallel: true, // 开启编译缓存 | |||
productionSourceMap: false, // 关闭 Sourcemap |