Pārlūkot izejas kodu

恢复签约

yxb
DESKTOP-2IO5MST\huting pirms 1 gada
vecāks
revīzija
6cbdf7df56

+ 19
- 1
App.vue Parādīt failu

@@ -8,7 +8,8 @@
getGlobalParam,
wechatAppID,
wechatSecret,
getOpenidApi
getOpenidApi,
getZfbOpenid
} from "@/utils/network/api.js";
import {
msg
@@ -56,6 +57,23 @@
scopes: 'auth_base',
success: res => {
console.log("支付宝授权码", res)
const options = {
type: 2,
data: {
"code": res.authCode
},
method: "POST",
showLoading: true,
};
request(getZfbOpenid, options).then((res) => {
const result = stringToJson(res.bizContent);
console.log("getOpenidApi====", result, result.data, result.userId)
if (result.data) {
setItem("zfbOpenId", result.data);
} else {
setItem("zfbUserId", result.userId);
}
});
},
});
// #endif

+ 12
- 0
pages.json Parādīt failu

@@ -1991,6 +1991,18 @@
}
}
]
},
{
//其他服务模块
"root": "subpackage/carPark",
"pages": [{
"path": "channelSing/select-car",
"style": {
"navigationBarTitleText": "选择车辆"
}
}
]
}
],
"tabBar": {

+ 7
- 1
pages/index/index.vue Parādīt failu

@@ -223,7 +223,8 @@
import {
navTo,
confirm,
msg
msg,
noticeUser
} from "@/utils/utils";
import {
getCodeName
@@ -301,6 +302,11 @@
quanKeyAction().then((val : any) => {
setItem('key', val.dictTypeAndItem)
})
// #ifdef MP-ALIPAY
noticeUser(() => {
console.log("dingyuele")
});
// #endif

})


+ 6
- 4
pages/nfc/nfc.vue Parādīt failu

@@ -57,6 +57,7 @@
}
if (option.payMoney) {
state.payMoney = option.payMoney
setItem("payMoney", option.payMoney)
}
console.log("传过来的参数", option, routeType.value)
});
@@ -79,8 +80,6 @@
NFCAPI.remove(() => {
console.log("routeType.value2=======", routeType.value)
//开始扫描设备
// NFCAPI.startScanDeviceNfc(routeType.value, function(res, routeType) {
// routeType.value = routeType
const ConRouteType = routeType.value
NFCAPI.startScanDevice((res) => {
tools.hideLoadingAlert();
@@ -99,7 +98,10 @@
return;
} else {
console.log("2222", routeType.value)
NFCAPI.connectDevice(function() {
NFCAPI.connectDevice(function(res) {
console.log("resnfc", res)
// datas.setData("bluLinkStatus", true);
// datas.setData("connectPrefixName", connectPrefixName.value);
if (res.code != 0) {
tools.showToastAlert(res.msg);
return;
@@ -115,7 +117,7 @@
} else if (getItem('routeType') ==
"7") { //7消费明细去修复nfc
tools.toUrl(
`/subpackage/personal-center/trapping-and-repairing/recharge-two?rechargeMoney=${state.rechargeMoney}&&orderNum=${state.orderNum}&&payMoney=${state.payMoney}&&transWay=nfc`
`/subpackage/personal-center/trapping-and-repairing/recharge-two?rechargeMoney=${state.rechargeMoney}&&orderNum=${state.orderNum}&&payMoney=${getItem('payMoney')}&&transWay=nfc`
); //跳转到圈存界面
}
})

+ 2
- 1
pages/recharge/recharge-weixin.vue Parādīt failu

@@ -458,7 +458,8 @@
//圈存修复COS指令Response信息不足,重新进行修复初始化
if (fixStatus === 3) {
let xfcmdArr = value.command.split(",");
bluetoothUtil.transCmd(xfcmdArr, "10", function (resValueData) {
console.log("xfcmdArr", xfcmdArr)
transCmd(xfcmdArr, function (resValueData) {
var status = resValueData[1].substring(
resValueData[1].length - 4,
resValueData[1].length

+ 1
- 1
static/etcUtil/index.js Parādīt failu

@@ -132,7 +132,7 @@ function disconnectDevice() {
*/
function transCmd(cmdArr, type, func, callBack = null) {
var connectPrefixName = datas.getData("connectPrefixName");
console.log('指令执行内容', cmdArr, type)
console.log('指令执行内容1', datas.getData("connectPrefixName"), cmdArr, type)
switch (connectPrefixName) {
case "WJ":
console.log('WJ执行内容====', cmdArr, type)

+ 1
- 1
static/nfc/NFCDeviceWechat.js Parādīt failu

@@ -77,7 +77,7 @@ export function ICCTransCmd(cmdArr, callBack) {
transTimeId = setTimeout(res => {
callBack.call(this, {
code: config.timeOutCode(),
msg: "连接设备蓝牙超时",
msg: "NFC连接超时",
data: null
})
}, timeOut);

+ 3
- 1
stores/user.js Parādīt failu

@@ -55,7 +55,9 @@ export const useUserStore = defineStore("userStore", {
deviceId: "",
code: code,
loginSource: getItem("loginSource"),
wxOpenid: getItem("QYorder").openid
wxOpenid: getItem("QYorder").openid,
zfbOpenId: getItem("zfbOpenId"),
zfbUserId: getItem("zfbUserId"),
},
method: "POST",
showLoading: false,

+ 1
- 1
subpackage/after-sale/account-recharge/recharge-weixin.vue Parādīt failu

@@ -268,7 +268,7 @@
//圈存修复COS指令Response信息不足,重新进行修复初始化
if (fixStatus === 3) {
let xfcmdArr = value.command.split(",");
bluetoothUtil.transCmd(xfcmdArr, "10", function (resValueData) {
transCmd(xfcmdArr, function (resValueData) {
var status = resValueData[1].substring(
resValueData[1].length - 4,
resValueData[1].length

+ 152
- 0
subpackage/carPark/channelSing/select-car.vue Parādīt failu

@@ -0,0 +1,152 @@
<template>
<view class="selectCar-box">
<view v-if="state.list.length > 0" @click="choose(item)" class="item" v-for="(item, i) in state.list" :key="i">
<view class="iten-left">
<image :src="`${$imgUrl}che.png`" mode="aspectFill"></image>
<text>{{ item.vehiclePlate }}</text>
</view>
<view class="choose-item">
<view class="active" v-if="flag == i"> </view>
</view>
</view>
<view v-else class="flex"> 暂无车辆订单信息 </view>
</view>
</template>

<script lang="ts" setup>
import { reactive, ref } from "vue";
import { navTo } from "@/utils/utils";
import { onLoad } from "@dcloudio/uni-app";
import { orderList } from "@/utils/network/api.js";
import { request } from "@/utils/network/request.js";
import { msg } from "@/utils/utils";
import { getItem, StorageKeys } from "@/utils/storage";
import { stringToJson } from "@/utils/network/encryption";

const state = reactive({
list: [],
starts: false
});
onLoad(() => {
quanCheckActionTrue().then((item : any) => {
state.list = item.data;
console.log(item);
});
});


const quanCheckActionTrue = () => {
let source = ""
// #ifdef MP-ALIPAY
source = "ALI"
// #endif
// #ifdef MP-WEIXIN
source = "WECHAT"
// #endif
var data = {
opId: getItem(StorageKeys.OpenId),
source: source,
tabIndex: "0",
isValueCard: "",
};
const options = {
type: 2,
data: data,
method: "POST",
showLoading: true,
};
return new Promise(async (resolve, reject) => {
const res = await request(orderList, options);
const data = stringToJson(res.bizContent);

resolve(data);
}).catch((error) => {
reject(error);
});
};

const flag = ref("0");
const choose = (item) => {
console.log("item", item);
// #ifdef MP-ALIPAY
uni.navigateTo({
url: `/subpackage/orders/sign-up-ali?orderId=${item.orderId}&&channelSing=1&&vehiclePlate=${item.vehiclePlate}`,
});
// #endif
// #ifdef MP-WEIXIN
uni.navigateTo({
url: `/subpackage/orders/sign-up?orderId=${item.orderId}&&channelSing=1&&vehiclePlate=${item.vehiclePlate}`,
});
// #endif
};
</script>

<style>
page {
width: 100%;
height: 100%;
background-color: #eef7f7;
}
</style>
<style lang="scss" scoped>
.flex {
display: flex;
justify-content: center;
}

.selectCar-box {
// width: 100%;
height: 100%;
padding: 30rpx;

.item {
padding: 20rpx;
display: flex;
justify-content: space-between;
align-items: center;
height: 130rpx;
background: #ffffff;
box-shadow: 0rpx 2rpx 6rpx 0rpx rgba(223, 223, 223, 0.8);
border-radius: 20rpx;
margin-bottom: 30rpx;

.iten-left {
display: flex;
align-items: center;

image {
width: 150rpx;
height: 90rpx;
}

text {
margin-left: 20rpx;
font-size: 32rpx;
font-family: Noto Sans S Chinese;
font-weight: 400;
color: #333333;
}
}

.choose-item {
width: 44rpx;
height: 44rpx;
background: #ffffff;
border: 2rpx solid #00b38b;
border-radius: 50%;
margin-right: 20rpx;
display: flex;
justify-content: center;
align-items: center;
box-sizing: content-box;
}

.active {
width: 34rpx;
height: 34rpx;
background: #00b38b;
border-radius: 50%;
}
}
}
</style>

+ 90
- 29
subpackage/orders/sign-up.vue Parādīt failu

@@ -26,7 +26,7 @@
</view>
<view class="action">
<button type="default" class="button" @click="savaHandle()">
开通服务
{{state.channelSing=="0"?'开通服务':'恢复签约'}}
</button>
</view>
</template>
@@ -34,7 +34,7 @@
<script setup lang="ts">
import { onLoad, onShow } from "@dcloudio/uni-app";
import { reactive } from "vue";
import { etcQYAction } from "@/utils/network/api.js";
import { etcQYAction, channelSingQueryApi } from "@/utils/network/api.js";
import { request } from "@/utils/network/request.js";

import { stringToJson } from "@/utils/network/encryption";
@@ -60,10 +60,17 @@
clientFee: "",
checked: false,
agreeURL: "",
channelSing: "0",//0 正常签约 1恢复签约
vehiclePlate: "",
code: ""
});
onLoad((option : any) => {
getOpenID();
state.orderId = option.orderId;
if (option.channelSing) {
state.channelSing = option.channelSing;
}
state.vehiclePlate = option.vehiclePlate;
getInfo();
});
const checkboxChange = (e) => {
@@ -101,6 +108,7 @@
provider: "weixin",
success: function (e) {
console.log(e);
state.code = e.code
getOpenid(e.code);
},
});
@@ -175,33 +183,86 @@
const data = stringToJson(res.bizContent);
console.log("data", data)
if (data.userState === "UNAUTHORIZED") {
uni.navigateToMiniProgram({
appId: "wxbcad394b3d99dac9",
path: "pages/route/index",
extraData: {
appid: "wxcb1388c809fe25a9",
sub_appid: "wx008c60533388527a",
mch_id: "1500877591",
sub_mch_id: "1622652848",
nonce_str: data.nonceStr,
sign_type: "HMAC-SHA256",
trade_scene: "HIGHWAY",
plate_number: data.plateNumber,
sub_openid: data.subOpenId,
sign: data.sign,
channel_type: "ETC"
},
success(res) {
console.log(res);
},
complete(res) {
console.log(res);
},
fail(res) {
console.log(res);
// 未成功跳转到车主小程序
},
});
if (state.channelSing == "0") {
uni.navigateToMiniProgram({
appId: "wxbcad394b3d99dac9",
path: "pages/route/index",
extraData: {
appid: "wxcb1388c809fe25a9",
sub_appid: "wx008c60533388527a",
mch_id: "1500877591",
sub_mch_id: "1622652848",
nonce_str: data.nonceStr,
sign_type: "HMAC-SHA256",
trade_scene: "HIGHWAY",
plate_number: data.plateNumber,
sub_openid: data.subOpenId,
sign: data.sign,
channel_type: "ETC"
},
success(res) {
console.log(res);
},
complete(res) {
console.log(res);
},
fail(res) {
console.log(res);
// 未成功跳转到车主小程序
},
});
} else {
// 恢复签约
const optionss = {
type: 2,
data: {
plateNumber: state.vehiclePlate,
openid: state.openid,
channelId: '52010188925',
tradeScene: 'HIGHWAY',
code: state.code
},
method: "POST",
showLoading: true,
};
request(channelSingQueryApi, optionss)
.then((res) => {
let data = stringToJson(res.bizContent)
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) {

},
complete(res) {
console.log(res);
},
fail(res) {
console.log(res);

// 未成功跳转到车主小程序
},
});

})
.catch((err) => {
console.log(err);
});
}

} else if (data.userState === "NORMAL") {
msg("已开通车主服务");
setTimeout(() => {

+ 1
- 1
subpackage/personal-center/trapping-and-repairing-account/recharge-two.vue Parādīt failu

@@ -326,7 +326,7 @@
//圈存修复COS指令Response信息不足,重新进行修复初始化
if (fixStatus === 3) {
let xfcmdArr = value.command.split(",");
bluetoothUtil.transCmd(xfcmdArr, "10", function (resValueData) {
transCmd(xfcmdArr, function (resValueData) {
var status = resValueData[1].substring(
resValueData[1].length - 4,
resValueData[1].length

+ 1
- 1
subpackage/personal-center/trapping-and-repairing/recharge-two.vue Parādīt failu

@@ -425,7 +425,7 @@
//圈存修复COS指令Response信息不足,重新进行修复初始化
if (fixStatus === 3) {
let xfcmdArr = value.command.split(",");
bluetoothUtil.transCmd(xfcmdArr, "10", function (resValueData) {
transCmd(xfcmdArr, function (resValueData) {
var status = resValueData[1].substring(
resValueData[1].length - 4,
resValueData[1].length

+ 23
- 5
subpackage/service/equity/equity.vue Parādīt failu

@@ -109,7 +109,8 @@
卡卷状态:正常
</text>
<button style="background-color: #4caf50;" class="copy-btn"
data-code="{{item}}" @click.stop="copyCode(item,'EXPIRED',null)">
data-code="{{item}}"
@click.stop="copyCode(item,'EXPIRED',item['couponInfoItem'])">
去使用
</button>
</view>
@@ -173,6 +174,7 @@
let alonePurchase = res.data.alonePurchase;
if (newCodes) {
console.log(res, '111=========', newCodes);
let newCodesNew = []
newCodes.forEach(item => {
//1 不能领取 0 可以领取 1(不能领取原因 notUseCase)
// item.equityInfoItems[0].equityType
@@ -198,17 +200,26 @@
.equityInfoItems[0].couponInfoItem.redeemCode
item.drawTime = item.equityInfoItems[0].drawTime && item.equityInfoItems[0]
.drawTime.split('T')[0]
// item.periodOfValidity = item.equityInfoItems[0].periodOfValidity.replace(/T/g, " ");
// item.periodOfValidity = item.equityInfoItems[0].periodOfValidity.split('T')[0]
console.log("item", item.equityInfoItems)
// 不展示付宝数据
for (var k = 0; k < item.equityInfoItems.length; k++) {
if (item.equityInfoItems[k]['equityType'] != "ZFB") {
console.log("alonePurchase1111", alonePurchase)
newCodesNew.push(item)
}
}

});
exchangeCodes.value = newCodes
exchangeCodes.value = newCodesNew

// 购买的权益产品展示
console.log("exchangeCodes.value", exchangeCodes.value);
}
let newAlonePurchase = []
if (alonePurchase) {
console.log("alonePurchase", alonePurchase)
alonePurchase.forEach(item => {
console.log("index", item.equityType == "ZFB")
//1 不能领取 0 可以领取 1(不能领取原因 notUseCase)
// item.equityInfoItems[0].equityType
// WAIT_GET
@@ -232,8 +243,14 @@
.couponInfoItem.redeemCode
item.drawTime = item.drawTime && item
.drawTime.split('T')[0]
// 不展示付宝数据
if (item.equityType != "ZFB") {
console.log("alonePurchase1111", alonePurchase)
newAlonePurchase.push(item)
}
});
alonePurchaseData.value = alonePurchase

alonePurchaseData.value = newAlonePurchase
}
})
}
@@ -266,6 +283,7 @@
}

function copyCode(e, start, items) {
console.log("items", e, items, e.redeemCode)
let item = e;
// // 复制兑换码到剪贴板
let code = e.redeemCode ? e.redeemCode : items.redeemCode;

+ 7
- 1
utils/network/api.js Parādīt failu

@@ -311,4 +311,10 @@ export const invoiceQueryApi = "bd1340041fab4303899d41d23109e46a" // 发票查
export const flowServiceFee = "1a78cda7cace443f9cff63902fb3d35c" // 通行流水服务费批量开票
export const silentLoginApi = "abaf0013caa24dafad12b0f571e8ee40" // 无感登录
export const carMessageApi = "854899f6244049d69b6ff883f28dcb28" // 车辆信息上传带出车辆信息
export const carMessageApi = "854899f6244049d69b6ff883f28dcb28" // 车辆信息上传带出车辆信息
export const getZfbOpenid = "62f02a3fd5eb462d9541aa21b78bba06" // 获取支付宝Openid支付宝
export const channelSingApi = "5c7a7614cf5746aa8db6215c5b46f8f0"
export const channelSingQueryApi = "0c6d650d94274ee086008652fa0fe41a"
export const isChannelSingApi = "IF01001202308301001" //是否签约

+ 14
- 0
utils/utils.ts Parādīt failu

@@ -654,6 +654,8 @@ export function subscribeMessages() {
}
// 通知用户消息订阅
export const noticeUser = (callback : Function) => {

// #ifdef MP-WEIXIN
uni.requestSubscribeMessage({
tmplIds: ['u7u0yO2dkYBISpox815e1S_fcUyl9B9qyxAK7aBjuho'],
complete(res) {
@@ -661,6 +663,18 @@ export const noticeUser = (callback : Function) => {
callback()
}
})
// #endif
// #ifdef MP-ALIPAY
my.requestSubscribeMessage({
entityIds: [
'f1f2d14d608e48dca5c4f4775d3d2424'
],
complete(res) {
console.log("通知用户消息订阅", res)
callback()
}
})
// #endif
}
// 压缩图片
export const compressImage = (tempFilePaths : any, callback : Function) => {

Notiek ielāde…
Atcelt
Saglabāt