@@ -61,6 +61,7 @@ | |||
"minified": true | |||
}, | |||
"usingComponents": true, | |||
"lazyCodeLoading": "requiredComponents", | |||
"permission": { | |||
"scope.userLocation": { | |||
"desc": "你的位置信息将用于小程序位置接口的效果展示" // 高速公路行驶持续后台定位 |
@@ -20,30 +20,45 @@ | |||
onLoad, | |||
onReady | |||
} from "@dcloudio/uni-app"; | |||
import { | |||
getItem, | |||
setItem | |||
} from "@/utils/storage"; | |||
import { | |||
ref, | |||
reactive | |||
} from "vue"; | |||
import { | |||
login | |||
} from "../../utils/network/api"; | |||
import * as NFCAPI from "../../static/nfc/NFCAPI.js"; | |||
const tools = require("../../static/etcUtil/tools.js"); | |||
const NFCAPI = require('../../static/nfc/NFCAPI.js'); | |||
// const NFCAPI = require('../../static/nfc/NFCAPI.js'); | |||
const cmd = require("../../static/etcUtil/cmdConfig.js"); | |||
const routeType = ref(null); //来源 1激活 2圈存 3信息重写 4信息读取 | |||
const routeType = ref(null); //来源 1激活 2圈存 3信息重写 4信息读取 7消费明细修复 | |||
const state = reactive({ | |||
fee: "", | |||
cardId: "" | |||
cardId: "", | |||
rechargeMoney: "", //消费明细圈存传过来的金额 | |||
orderNum: 0, //消费明细 传orderNum说明去支付 | |||
payMoney: 0, //0 修复 1 支付 | |||
}); | |||
onLoad((option) => { | |||
routeType.value = option.routeType ? option.routeType : "1"; | |||
setItem("routeType", option.routeType) | |||
state.cardId = option.cardId; | |||
if (option.fee) { | |||
state.fee = option.fee; | |||
} | |||
console.log("传过来的参数", option) | |||
if (option.rechargeMoney) { | |||
state.rechargeMoney = option.rechargeMoney | |||
} | |||
if (option.orderNum) { | |||
state.orderNum = option.orderNum | |||
} | |||
if (option.payMoney) { | |||
state.payMoney = option.payMoney | |||
} | |||
console.log("传过来的参数", option, routeType.value) | |||
}); | |||
//已准备 | |||
@@ -56,12 +71,20 @@ | |||
} | |||
function scanNfc() { | |||
console.log("routeType.value1", routeType.value) | |||
tools.showLoadingAlert("扫描NFC中"); | |||
//先断开所有设备 | |||
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(); | |||
console.log("routeType.value3===123===1111", ConRouteType, res.code) | |||
if (res.code != 0) { | |||
console.log("1111111") | |||
if (res.code == 1203) { | |||
@@ -75,7 +98,7 @@ | |||
} | |||
return; | |||
} else { | |||
console.log("2222") | |||
console.log("2222", routeType.value) | |||
NFCAPI.connectDevice(function() { | |||
if (res.code != 0) { | |||
tools.showToastAlert(res.msg); | |||
@@ -84,10 +107,16 @@ | |||
//获取卡信息 | |||
transCmd(function(items) { | |||
getCardId(items, function() { | |||
if (routeType.value == "2") { | |||
console.log("routeType.value", routeType.value) | |||
if (getItem('routeType') == "2") { | |||
tools.toUrl( | |||
`/pages/recharge/recharge-weixin?connectSuccess=1&&cardId=${state.cardId}&&fee=${state.fee}&&transWay=nfc` | |||
); //跳转到圈存界面 | |||
} 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` | |||
); //跳转到圈存界面 | |||
} | |||
}) | |||
}) |
@@ -50,9 +50,7 @@ | |||
cardCzPayResult, | |||
cardCzXFCheck, | |||
quanConfirm, | |||
wechatAppID, | |||
wechatPayConfigId, | |||
wechatSecret, | |||
aliPayConfigId, | |||
obtainUserId, | |||
getOpenidApi | |||
@@ -693,6 +691,8 @@ | |||
cardId: state.cardId, | |||
openId: getItem(StorageKeys.OpenId), | |||
rechargeMoney: state.fee, | |||
tradeType: 14, | |||
preBalance: card.money, | |||
}; | |||
const options = { | |||
type: 2, |
@@ -5,11 +5,18 @@ var NFCSDK = require('./NFCDeviceWechat.js'); | |||
* @param {*} callBack | |||
*/ | |||
export function startScanDevice(callBack) { | |||
NFCSDK.startScanDevice( | |||
(res) => { | |||
callBack.call(this, res); | |||
} | |||
) | |||
NFCSDK.startScanDevice( | |||
(res) => { | |||
callBack.call(this, res); | |||
} | |||
) | |||
} | |||
export function startScanDeviceNfc(routeType, callBack) { | |||
NFCSDK.startScanDevice( | |||
(res) => { | |||
callBack.call(this, res, routeType); | |||
} | |||
) | |||
} | |||
/** | |||
@@ -17,31 +24,31 @@ export function startScanDevice(callBack) { | |||
* @param {回调} callBack | |||
*/ | |||
export function stopScanDevice(callBack) { | |||
NFCSDK.stopScanDevice( | |||
(res) => { | |||
callBack.call(this, res); | |||
} | |||
); | |||
NFCSDK.stopScanDevice( | |||
(res) => { | |||
callBack.call(this, res); | |||
} | |||
); | |||
} | |||
/** | |||
* 连接卡片 | |||
* @param {回调} callBack | |||
*/ | |||
export function connectDevice(callBack) { | |||
NFCSDK.connectDevice( | |||
(res) => { | |||
callBack.call(this, res); | |||
} | |||
) | |||
NFCSDK.connectDevice( | |||
(res) => { | |||
callBack.call(this, res); | |||
} | |||
) | |||
} | |||
/** | |||
* 断开连接 | |||
* @param {回调} callBack | |||
*/ | |||
export function disconnectDevice(callBack) { | |||
NFCSDK.disConnectDevice((res) => { | |||
callBack.call(this, res); | |||
}) | |||
NFCSDK.disConnectDevice((res) => { | |||
callBack.call(this, res); | |||
}) | |||
} | |||
@@ -51,9 +58,9 @@ export function disconnectDevice(callBack) { | |||
* @param {回调} callback | |||
*/ | |||
export function transCmd(cmdArr, callback) { | |||
NFCSDK.ICCTransCmd(cmdArr, (res) => { | |||
callback.call(this, res); | |||
}) | |||
NFCSDK.ICCTransCmd(cmdArr, (res) => { | |||
callback.call(this, res); | |||
}) | |||
} | |||
/** | |||
@@ -61,7 +68,7 @@ export function transCmd(cmdArr, callback) { | |||
* @param {回调} callBack | |||
*/ | |||
export function remove(callback) { | |||
NFCSDK.remove((res) => { | |||
callback.call(this, res); | |||
}) | |||
NFCSDK.remove((res) => { | |||
callback.call(this, res); | |||
}) | |||
} |
@@ -29,14 +29,10 @@ | |||
import { stringToJson } from "@/utils/network/encryption"; | |||
import { fileURL } from "@/datas/fileURL.js"; | |||
import navBar from "../../components/nav-bar/nav-bar2.vue"; | |||
import navBgCar from "./components/nav-bg-car4"; | |||
import { getItem, StorageKeys } from "@/utils/storage.ts"; | |||
import { msg } from "@/utils/utils"; | |||
import { | |||
checkOrderStatus, | |||
wechatAppID, | |||
wechatPayConfigId, | |||
wechatSecret, | |||
} from "@/utils/network/api"; | |||
const imgURL = `${fileURL}image/`; |
@@ -40,9 +40,7 @@ | |||
cardCzPayResult, | |||
cardCzXFCheck, | |||
quanConfirm, | |||
wechatAppID, | |||
wechatPayConfigId, | |||
wechatSecret, | |||
aliPayConfigId, | |||
obtainUserId, | |||
getOpenidApi, |
@@ -41,9 +41,13 @@ | |||
onLoad((options) => { | |||
let data = JSON.parse(decodeURIComponent(options.params)) | |||
for (var i in data) { | |||
console.log("options.promoteId", data['confirmTime']) | |||
data['confirmTime'] = data['confirmTime'].replace("T", " ") | |||
data['createTime'] = data['createTime'].replace("T", " ") | |||
// console.log("options.promoteId", data['confirmTime']) | |||
if (data['confirmTime']) { | |||
data['confirmTime'] = data['confirmTime'].replace("T", " ") | |||
} | |||
if (data['createTime']) { | |||
data['createTime'] = data['createTime'].replace("T", " ") | |||
} | |||
} | |||
state.params = data | |||
}) |
@@ -29,21 +29,8 @@ | |||
import { stringToJson } from "@/utils/network/encryption"; | |||
import { fileURL } from "@/datas/fileURL.js"; | |||
import navBar from "../../components/nav-bar/nav-bar2.vue"; | |||
import navBgCar from "./components/nav-bg-car4"; | |||
import { getItem, StorageKeys } from "@/utils/storage.ts"; | |||
import { msg } from "@/utils/utils"; | |||
import { | |||
checkOrderStatus, | |||
wechatAppID, | |||
wechatPayConfigId, | |||
wechatSecret, | |||
} from "@/utils/network/api"; | |||
const imgURL = `${fileURL}image/`; | |||
const savaHandle = () => { | |||
}; | |||
const state = reactive({ | |||
openid: "", | |||
orderId: "", |
@@ -108,7 +108,6 @@ | |||
}; | |||
const downAuthD = () => { | |||
// tools.showLoadingAlert("加载中"); | |||
console.log('=======123') | |||
console.log("uni.env.USER_DATA_PATH '", uni.env.USER_DATA_PATH + '/' + '产品协议.docx') | |||
uni.downloadFile({ |
@@ -41,12 +41,8 @@ | |||
import navBar from "@/components/nav-bar/nav-bar2.vue"; | |||
import navBgCar from "./components/nav-bg-car4"; | |||
import { setItem } from "@/utils/storage"; | |||
import { msg, confirm, getOrderStatusName } from "@/utils/utils"; | |||
import { msg, confirm } from "@/utils/utils"; | |||
import { | |||
checkOrderStatus, | |||
wechatAppID, | |||
wechatPayConfigId, | |||
wechatSecret, | |||
aliPayConfigIdTwo, | |||
obtainUserId, | |||
infoQuery, | |||
@@ -72,7 +68,6 @@ | |||
console.log(state.checked); | |||
}; | |||
const downAuthD = () => { | |||
// tools.showLoadingAlert("加载中"); | |||
uni.downloadFile({ | |||
url: state.agreeURL, | |||
filePath: uni.env.USER_DATA_PATH + '/' + '代扣协议.docx', | |||
@@ -83,7 +78,6 @@ | |||
fileType: 'docx', | |||
showMenu: true, //关键点 | |||
success: function (res) { | |||
// msg("打开文档成功"); | |||
}, | |||
fail: function (err) { | |||
msg("打开文档失败"); |
@@ -46,7 +46,6 @@ | |||
import { | |||
checkOrderStatus, | |||
wechatAppID, | |||
wechatPayConfigId, | |||
wechatSecret, | |||
getOpenidApi, | |||
infoQuery, |
@@ -39,7 +39,6 @@ | |||
import { | |||
checkOrderStatus, | |||
wechatAppID, | |||
wechatPayConfigId, | |||
wechatSecret, | |||
aliPayConfigIdTwo, | |||
obtainUserId, |
@@ -34,9 +34,7 @@ | |||
cardCzPayResult, | |||
cardCzXFCheck, | |||
quanConfirm, | |||
wechatAppID, | |||
wechatPayConfigId, | |||
wechatSecret, | |||
aliPayConfigId, | |||
obtainUserId, | |||
getOpenidApi |
@@ -4,7 +4,8 @@ | |||
src="https://qtzl.etcjz.cn/default-bucket/20240322/7380a0422a1e49fdb2fefc9d_beijing.png"></image> | |||
<view style="position: absolute;width: 100%;top: 30%;"> | |||
<view class="top" style="display: flex;flex-direction: column; justify-content: center;padding: 20px 40px;"> | |||
<view class="top" | |||
style="display: flex;flex-direction: column; justify-content: center;padding: 20px 40px;background-color: rgb(246, 246, 250);"> | |||
<view style="margin-bottom: 20px;font-size: 38rpx; text-align: center;font-family: Microsoft Yahei;"> | |||
我的权益</view> | |||
@@ -63,6 +64,60 @@ | |||
</view> | |||
</view> | |||
</view> | |||
<view v-for="(item, index) in alonePurchaseData" :key="index" class="item" | |||
@click.stop="click(item)"> | |||
<view style="display: flex;flex-direction: column;flex: 1;margin: 10px;"> | |||
<view style="display: flex;flex-direction: column;"> | |||
<!-- <text style="margin-top: 10rpx;">车牌号:{{item.vehiclePlate}}</text> --> | |||
<text v-if="item.drawTime" style="margin-top: 10rpx;">领取时间:{{item.drawTime}}</text> | |||
<text style="margin-top: 10rpx;">领取时间:{{item.getStatus}}</text> | |||
<text style="margin-top: 10rpx;">有效期:{{ item.periodOfValidity }}</text> | |||
<view | |||
style="display: flex;justify-content: flex-start;flex-direction: row;width: 100%;margin-top: 10rpx;"> | |||
<text v-if="item.redeemCodeStr" class="code">券码:{{ item.redeemCodeStr}}</text> | |||
</view> | |||
</view> | |||
<view> | |||
<view v-if="item.equityType == 'COUPONS'"> | |||
<div class="horizontal-line"></div> | |||
<view style="display: flex;flex-direction: column;"> | |||
<text style="width: 100%;">权益名称:{{item.productName}}</text> | |||
<view | |||
style="display: flex;flex-direction: row;min-height: 60rpx;justify-content: space-between;text-align: baseline;"> | |||
<text class="text-w" style="flex: 1;margin-top: 5rpx;" | |||
:style="functBackName(item) == 'WAIT_ACTIVATED' ? 'color: #023F8F;' : functBackName(item) == 'WAIT_USE' ? 'color: orange;' : functBackName(item) == 'USED' ? 'color: green;' : 'color: gray;'">卡卷状态:{{functBackName(item) == 'WAIT_ACTIVATED' ? '待激活' : functBackName(item) == 'WAIT_USE' ? '待领取' : functBackName(item) == 'USED' ? '已领取' : '已失效'}}</text> | |||
<button | |||
v-if="functBackName(item) != 'EXPIRED' && item && item.equityType !='ZFB'" | |||
:style="functBackName(item) == 'WAIT_ACTIVATED' ? 'background-color: #023F8F;' : functBackName(item) == 'WAIT_USE' ? 'background-color: orange;' : functBackName(item) == 'USED' ? 'background-color: green;' : 'background-color: gray;'" | |||
class="copy-btn" data-code="{{item}}" | |||
@click.stop="copyCode(item,functBackName(item),item['couponInfoItem'])"> | |||
{{functBackName(item) == 'WAIT_ACTIVATED' ? '去激活' : functBackName(item) == 'WAIT_USE' ? '立即领取' : | |||
functBackName(item) == 'USED' ? '复制' : '已失效'}}</button> | |||
</view> | |||
</view> | |||
</view> | |||
<view v-if="item.equityType == 'ZFB'"> | |||
<div class="horizontal-line"></div> | |||
<view style="display: flex;flex-direction: column;"> | |||
<text style="width: 100%;">权益名称:{{item.productName}}</text> | |||
<view | |||
style="display: flex;flex-direction: row;min-height: 60rpx;justify-content: space-between;text-align: baseline;"> | |||
<text class="text-w" style="flex: 1;margin-top: 5rpx;color: #4caf50;"> | |||
卡卷状态:正常 | |||
</text> | |||
<button style="background-color: #4caf50;" class="copy-btn" | |||
data-code="{{item}}" @click.stop="copyCode(item,'EXPIRED',null)"> | |||
去使用 | |||
</button> | |||
</view> | |||
</view> | |||
</view> | |||
</view> | |||
</view> | |||
</view> | |||
</scroll-view> | |||
</view> | |||
</view> | |||
@@ -87,6 +142,7 @@ | |||
let couponAgencyType = ref('') | |||
let couponId = ref('') | |||
let exchangeCodes: any = ref([]) | |||
let alonePurchaseData: any = ref([]) | |||
let page = ref('') | |||
onLoad((options) => { | |||
@@ -112,7 +168,9 @@ | |||
showLoading: true, | |||
}).then((item) => { | |||
let res = JSON.parse(item.bizContent) | |||
console.log("res===", res) | |||
let newCodes = res.data.orderItems; | |||
let alonePurchase = res.data.alonePurchase; | |||
if (newCodes) { | |||
console.log(res, '111=========', newCodes); | |||
newCodes.forEach(item => { | |||
@@ -144,8 +202,39 @@ | |||
// item.periodOfValidity = item.equityInfoItems[0].periodOfValidity.split('T')[0] | |||
}); | |||
exchangeCodes.value = newCodes | |||
// 购买的权益产品展示 | |||
console.log("exchangeCodes.value", exchangeCodes.value); | |||
} | |||
if (alonePurchase) { | |||
console.log("alonePurchase", alonePurchase) | |||
alonePurchase.forEach(item => { | |||
//1 不能领取 0 可以领取 1(不能领取原因 notUseCase) | |||
// item.equityInfoItems[0].equityType | |||
// WAIT_GET | |||
item.status = | |||
item.isUse == '0' && item.couponStatus == | |||
'WAIT_GET' ? 'WAIT_USE' : | |||
item.isUse == '1' && item.couponStatus == | |||
'WAIT_GET' ? 'WAIT_ACTIVATED' : item.couponStatus == 'USED' ? | |||
'USED' : ''; | |||
//WAIT_ACTIVATED(待激活) WAIT_USE(待领取使用) USED(已使用) EXPIRED(已过期) OUINGSYNREE | |||
console.log(item.periodOfValidity, | |||
item.isUse, item.notUseCase, | |||
item.status, item.couponStatus, '=================', | |||
item.vehiclePlate); | |||
item.getStatus = getStatusValue(item.status) | |||
item.redeemCodeStr = item.couponInfoItem && desensitize(item | |||
.couponInfoItem.redeemCode) | |||
item.periodOfValidity = item.periodOfValidity ? item | |||
.periodOfValidity.split('T')[0] : '激活领取后展示' | |||
item.redeemCode = item.couponInfoItem && item | |||
.couponInfoItem.redeemCode | |||
item.drawTime = item.drawTime && item | |||
.drawTime.split('T')[0] | |||
}); | |||
alonePurchaseData.value = alonePurchase | |||
} | |||
}) | |||
} | |||
@@ -176,7 +265,7 @@ | |||
'USED' : ''; | |||
} | |||
function copyCode(e, start,items) { | |||
function copyCode(e, start, items) { | |||
let item = e; | |||
// // 复制兑换码到剪贴板 | |||
let code = e.redeemCode; | |||
@@ -217,7 +306,7 @@ | |||
cardIds: [items.id], | |||
couponId: couponId.value, | |||
equityId: item.singleEquityId, | |||
orderId: items.orderId | |||
orderId: items.orderId ? items.orderId : items.purchasedEquityId | |||
}, | |||
method: "POST", | |||
showLoading: true, |
@@ -24,7 +24,7 @@ export const envs = { | |||
export const appId = "52030131"; //应用appid 综合业务支撑平台使用 | |||
export const loginTime = 86400; //登录有效时间(单位s) 1天 | |||
export const wechatPayConfigId = "6a9a54bc01f6443faea7ffe132b19f6"; //支付配置编号 微信小程序支付:6a9a54bc01f6443faea7ffe132b19f6 | |||
export const wechatPayConfigId = "6a9a54bc01f6443faea7ffe132b19f8"; //支付配置编号 微信小程序支付:6a9a54bc01f6443faea7ffe132b19f6 | |||
export const aliPayConfigId = "6a9a54bc01f6443123452b1234"; //支付配置编号 支付宝小程序支付:6a9a54bc01f6443123452b1234 | |||
export const aliPayConfigIdTwo = "6a9a54bc01f644312543761234"; | |||
// export const aliPayConfigIdTwo = "6a9a54bc01f6443123452b1"; |