Browse Source

修改bug

yxb
DESKTOP-2IO5MST\huting 1 year ago
parent
commit
03feeb8df3

+ 0
- 1
composables/order/useOrderListItem.ts View File

@@ -165,7 +165,6 @@ export default function useOrderListItem(props) {
}
}
}
// uni.$emit('refreshFinish');
uni.$emit("refreshOrder");
console.log('输出内容小程序', ordersList)
})

+ 59
- 37
composables/order/useOrderSkip.ts View File

@@ -17,7 +17,7 @@ export default function useOrderSkip() {
// #endif
}
//根据订单类型 跳转到不同的订单详情页面
const gotoOrderDetails = (orderInfo,isWeiXin) => {
const gotoOrderDetails = (orderInfo, isWeiXin) => {
console.log('输出内容=====', orderInfo)
// if (orderInfo.orderType === 'ISSUE') {
navTo(`/subpackage/orders/order-details-new?id=${orderInfo.id}&appraise=${orderInfo.appraise}&isWeiXin=${isWeiXin}`);
@@ -199,47 +199,69 @@ export default function useOrderSkip() {
}
//再次使用订单
const gotoAgainUseOrder = (orderInfo : any) => {
const options = {
type: 2,
data: {
orderId: orderInfo.orderId,
orderSource: "WECHAT",
openId: getItem('openId'),
},
method: "POST",
showLoading: true,
};
request(gotoAgainUseOrderApi, options).then((res) => {
const data = stringToJson(res.bizContent);
// 刷新本页面
console.log("再次使用订单", data)
// doSearch()
uni.reLaunch({
url: `/pages/order/order?index=${0}`
})
uni.showModal({
title: '温馨提示',
content: '确定再次使用订单',
success: function (res) {
if (res.confirm) {
const options = {
type: 2,
data: {
orderId: orderInfo.orderId,
orderSource: "WECHAT",
openId: getItem('openId'),
},
method: "POST",
showLoading: true,
};
request(gotoAgainUseOrderApi, options).then((res) => {
const data = stringToJson(res.bizContent);
// 刷新本页面
console.log("再次使用订单", data)
uni.reLaunch({
url: `/pages/order/order?index=${0}`
})
});
} else if (res.cancel) {
console.log('用户点击取消');
}
}
});


}
// 结束订单
const closeOrder = (orderInfo : any) => {
const options = {
type: 2,
data: {
orderId: orderInfo.orderId,
orderSource: "WECHAT",
openId: getItem('openId'),
},
method: "POST",
showLoading: true,
};
request(finishUseOrderApi, options).then((res) => {
const data = stringToJson(res.bizContent);
// 刷新本页面
console.log("结束订单", orderInfo)
// doSearch()
uni.reLaunch({
url: `/pages/order/order?index=${0}`
})
uni.showModal({
title: '温馨提示',
content: '订单结束后,30天内可申请再次使用',
success: function (res) {
if (res.confirm) {
const options = {
type: 2,
data: {
orderId: orderInfo.orderId,
orderSource: "WECHAT",
openId: getItem('openId'),
},
method: "POST",
showLoading: true,
};
request(finishUseOrderApi, options).then((res) => {
const data = stringToJson(res.bizContent);
// 刷新本页面
console.log("结束订单", orderInfo)
uni.reLaunch({
url: `/pages/order/order?index=${0}`
})
});
} else if (res.cancel) {
console.log('用户点击取消');
}
}
});


}
return {
gotoEditAddress, gotoCancelOrder, gotoEditUserOrUnitInfo,

+ 21
- 0
pages.json View File

@@ -1451,6 +1451,27 @@
{
"root": "subpackage/personal-center", //个人中心
"pages": [{
"path": "trapping-and-repairing/result",
"style": {
"navigationBarTitleText": "修复成功",
"enablePullDownRefresh": false
}
},
{
"path": "trapping-and-repairing/recharge-two",
"style": {
"navigationBarTitleText": "圈存",
"enablePullDownRefresh": false
}
},
{
"path": "trapping-and-repairing/recharge-pay",
"style": {
"navigationBarTitleText": "去修复",
"enablePullDownRefresh": false
}
},
{
"path": "car-message-change",
"style": {
"navigationBarTitleText": "车辆信息变更",

+ 18
- 2
pages/bluetooth/bluetooth.vue View File

@@ -76,7 +76,10 @@
},
],
connectSuccess: 1,
transfer: 0
transfer: 0,
rechargeMoney: "",//消费明细圈存传过来的金额
orderNum: 0,//消费明细 传orderNum说明去支付
payMoney: 0,//0 修复 1 支付
});
const deviceList = ref([]);
const connectPrefixName = ref(null);
@@ -111,6 +114,15 @@
if (option.transfer) {
state.transfer = option.transfer;
}
if (option.rechargeMoney) {
state.rechargeMoney = option.rechargeMoney
}
if (option.orderNum) {
state.orderNum = option.orderNum
}
if (option.payMoney) {
state.payMoney = option.payMoney
}
console.log("传过来的参数", option)
});

@@ -528,7 +540,7 @@
};

function oks() {
//routeType 1.激活(订单来) 2.圈存 (/pages/recharge/recharge来)3.ping码解锁 4.信息读取 5从哪里来回哪里去监听bluetoothLink
//routeType 1.激活(订单来) 2.圈存 (/pages/recharge/recharge来)3.ping码解锁 4.信息读取 5从哪里来回哪里去监听bluetoothLink 7消费明细去圈存
if (routeType.value == "1") {
uni.navigateTo({
url: `/subpackage/after-sale/activation/activate?transfer=${state.transfer}`,
@@ -567,6 +579,10 @@
uni.navigateTo({
url: "/subpackage/after-sale/activation-once-again/activation-once-again?state=true&id=" + state.id
});
} else if (routeType.value == "7") {
uni.navigateTo({
url: `/subpackage/personal-center/trapping-and-repairing/recharge-two?rechargeMoney=${state.rechargeMoney}&&orderNum=${state.orderNum}&&payMoney=${state.payMoney}`,
});
} else {
return;
}

+ 10
- 1
pages/index/index.vue View File

@@ -209,7 +209,7 @@
</filter>
</view>
</view>
<button @click="dingyue">订阅</button>
</template>

<script setup lang="ts">
@@ -629,6 +629,15 @@
}
// #endif
}
const dingyue = () => {
uni.requestSubscribeMessage({
tmplIds: ['zPVvoFmSckOrC-M_JE6FUTQo8FmVH7O8i-RO1z2SWQQ'],
success(res) {
console.log("通知用户消息订阅", res)
console.log("getItem(StorageKeys.OpenId)", getItem(StorageKeys.OpenId))
}
})
}
</script>

<style>

+ 0
- 6
pages/order/components/order-list-item-new.vue View File

@@ -114,18 +114,13 @@
已评价
</view>
<view class='evaluation' v-else>
<!-- <view class="btn btn-primary" @click.stop="gotoEvaluateOrder(item)">去评价最初的</view> -->
<view class="btn btn-primary" v-if="item.isProduct==0 || item.isService==0"
@click.stop="gotoEvaluateProduct(item)">去评价产品</view>
<!-- promotionModes字段判断的,1-线上模式 ,2-线下模式 ,线上模式就是自主办理不展示业务员评价 -->
<!-- <view class="btn btn-primary" v-if="(item.isService==0) " @click.stop="gotoEvaluateSalesman(item)">
去评价业务员</view> -->
</view>
</view>

<!-- 已结束 -->
<view class="btns" v-else-if="item.orderStep == OrderStatus.已结束 && item.isUseAgain">
<!-- <view class="btn btn-primary" @click.stop="showActiveOrder = true">重新激活订单</view> --> <!-- 以前的 -->
<view class="btn btn-primary" @click.stop="gotoAgainUseOrder(item)">再次使用订单</view>
</view>

@@ -147,7 +142,6 @@
<view class="btns" v-if="item.orderStep == OrderStatus.待激活 ">
<view class="btn btn-primary" @click.stop="gotoActiveOrder(item)">去激活</view>
</view>

</view>
</view>


+ 25
- 14
pages/recharge/recharge-pay.vue View File

@@ -21,12 +21,6 @@
</radio-group>
</view>
</view>
<!-- <view>
<view style="display: flex;align-items: center;">
<image class="photo" :src="fileURL + 'image/index/consumptionDetails.png'"></image>消费明细
</view>
<image class="photo1" src="../../static/image/icon-back.png" mode="widthFix"></image>
</view> -->
</view>
<view class="tips" v-if="source=='WECHAT'">温馨提示: <text class="red">NFC充值</text>仅支持在<text
class="red">安卓手机</text>进行ETC储值卡充值!</view>
@@ -71,19 +65,13 @@
}],
// #endif
// #ifdef MP-WEIXIN
transWayTypeList: [{
name: "蓝牙",
value: "blu",
}, {
name: "NFC",
value: "nfc",
}],
transWayTypeList: [],
// #endif
tableIndex: 0,
transWayName: "蓝牙",
transWay: "blu", //“blu”为蓝牙充值方式、“nfc”为NFC充值方式
cardId: "", //卡号 需要传参
current: 0
current: 0,
});

const selectConfirm = (item : any) => {
@@ -92,6 +80,29 @@
};

onLoad((option) => {
// #ifdef MP-WEIXIN
uni.getSystemInfo({
success: (res) => {
console.log("res", res['osName'])
// ios
if (res['osName'] == 'ios') {
state.transWayTypeList = [{
name: "蓝牙",
value: "blu",
}]
} else {
// 安卓
state.transWayTypeList = [{
name: "蓝牙",
value: "blu",
}, {
name: "NFC",
value: "nfc",
}]
}
}
});
// #endif
});

function radioChange(evt) {

+ 2
- 7
pages/recharge/recharge-weixin.vue View File

@@ -191,7 +191,7 @@
if (checkResult.orders && checkResult.orders.length > 0) {
//拿到订单,存起来
state.orderNum = checkResult.orders[0].orderNum;
setItem("orderNum", state.orderNum);
// setItem("orderNum", state.orderNum);
// 检测用户是否存在有半条流水
} else {
console.log('没有可修复的流水')
@@ -234,7 +234,6 @@
if (checkResult.orders && checkResult.orders.length > 0) {
//拿到订单,存起来
state.orderNum = checkResult.orders[0].orderNum;
// setItem("orderNum", state.orderNum);
// 检测用户是否存在有半条流水
getCardId()
} else {
@@ -243,9 +242,7 @@
});
} else {
// 检测用户是否存在有半条流水
// let fixFee = val.fixFee / 100
// console.log("fixFee", fixFee)
// go(fixFee)

getCardId()
}
});
@@ -290,14 +287,12 @@
state.money = checkResult.orders[0]['rechargeMoney'] / 100
//拿到订单,存起来
state.orderNum = checkResult.orders[0].orderNum;
// setItem("orderNum", state.orderNum);
//链接蓝牙
go(state.money)
} else {
cardCzApplyAction().then((applyResult : any) => {
//拿到订单 存起来
state.orderNum = applyResult.orderNum;
// setItem("orderNum", state.orderNum);
//如果订单没有支付 走支付
if (applyResult.orderStatus === "ORDER_NOT_PAY") {
//走支付

+ 1
- 1
pages/recharge/result.vue View File

@@ -51,4 +51,4 @@
margin: 300rpx 40rpx 0;
text-align: center;
}
</style>
</style>

+ 25
- 0
subpackage/after-sale/activation/operation-upload.vue View File

@@ -29,6 +29,21 @@
<image :src="`${$imgUrl}common/icon-hint.png`" class="icon"></image>
<view>请打开手机蓝牙后再进行下一步操作。</view>
</view>
<view class="open-tips">
<view>开启蓝牙</view>
<view class="item-tips">
<view>方式一</view>
<view>&nbsp;&nbsp;1.打开手机的【设置】菜单。</view>
<view>&nbsp;&nbsp;2.在【设置】菜单中,找到【蓝牙】选项。</view>
<view>&nbsp;&nbsp;3.点击【蓝牙】选项,然后打开蓝牙开关。</view>
</view>
<view class="item-tips">
<view>方式二</view>
<view>&nbsp;&nbsp;1.下拉打开通知栏。</view>
<view>&nbsp;&nbsp;2.然后打开蓝牙开关。</view>
</view>
</view>

<view class="btn">
<submit-button @submit="gotoNextStep" title="下一步"></submit-button>
</view>
@@ -291,4 +306,14 @@
margin: 60rpx 40rpx;
}
}

.open-tips {
width: 94%;
margin: 20rpx auto;
font-size: 30rpx;
}

.item-tips {
margin-top: 10rpx;
}
</style>

+ 0
- 1
subpackage/after-sale/rescind-carId/rescind-carId-select.vue View File

@@ -544,7 +544,6 @@
state.FormData.vehiclePlate = data.plate_a
state.FormData.vehPosImgUrl = data.imageUrl

state.FormData.idcardBacktImgUrl = data.imageUrl
} else if (state.choiceIndex === "4") {
state.form.approvedCount = parseFloat(data.apc);
state.form.maintenaceMass = parseFloat(data.unladen);

+ 6
- 116
subpackage/orders/order-confirm-receipt.vue View File

@@ -17,22 +17,20 @@

<view class="hint">请核对实收货物与上述货物编号是否一致!</view>
<view class="btn">
<submit-button title="确认收货" @submit="$util.confirm('是否确认收到货?', confirmReceiptClick, '收货确认')"></submit-button>
<submit-button title="确认收货" @submit="$util.confirm('是否确认收到货?', confirmReceipt, '收货确认')"></submit-button>
</view>
</template>

<script setup lang="ts">
import orderInfoItem from "./components/order-info-item";
import { reactive } from "vue";
import { onLoad, onUnload, onShow } from "@dcloudio/uni-app";
import { onLoad } from "@dcloudio/uni-app";
import { request } from "@/utils/network/request.js";
import { msg, confirm, getOrderStatusName, navTo } from "@/utils/utils";
import { msg, confirm, getOrderStatusName } from "@/utils/utils";
import { orderDetail, receiveOrder } from "@/utils/network/api";
import { getItem, StorageKeys } from "@/utils/storage";
import { stringToJson } from "@/utils/network/encryption";
const bluetoothUtil = require("../../static/etcUtil/index.js");
const cmd = require("../../static/etcUtil/cmdConfig.js");
const tools = require("../../static/etcUtil/tools.js");

const state = reactive({
//订单信息
orderInfo: {} as any,
@@ -59,109 +57,10 @@
value: "",
},
],
readCardId: "",//蓝牙读取的
readObuId: "",//蓝牙读取的
});
onShow((option) => {
uni.$on('bluetoothLink', res => {
console.log(res);
if (res.status) {
getCardId()
}
})

})
/**
* 获取卡号 读卡
*/
const getCardId = () => {
console.log('======获取卡信息======')
let cmdArr = [
cmd.HOME_DIRECTORY,
//选择主目
cmd.APPLICATION_DIRECTORY,
//选择文件1001--DF01联网收费应用目录
cmd.CMD_READBINARY,
//15文件--卡片发行基本数据文件
cmd.CMD_GETBALANCE
//钱包
];
tools.showLoadingAlert("正在执行指令");
bluetoothUtil.transCmd(cmdArr, "10", function (res) {
tools.hideLoadingAlert();
//10:写卡 20:写OBU
let str = res[2].substring(res[2].length - 4, res[2].length);
let str3 = res[3].substring(res[3].length - 4, res[3].length);
if (str == "9000" || str3 == "9000") {
if (res[2].length > 86 || res[3] >= 12) {
state.readCardId = res[2].substring(20, 40); //卡号
if (state.orderInfo.cardId != state.readCardId) {
uni.showModal({
title: '提示',
content: '卡号不一致,前往订单管理页面申请退货',
showCancel: false,
success: function (res) {
if (res.confirm) {
console.log('用户点击确定');
uni.switchTab({
url: "/pages/order/order"
})
} else if (res.cancel) {
console.log('用户点击取消');
}
}
});
} else {
getObuId()
}

} else {
console.error("CMD_READBINARY指令长度不符" + res[2])
tools.hideLoadingAlert();
}
}
tools.hideLoadingAlert();
});
};
/**
* 获取OBU号 读OBU
*/
const getObuId = () => {
console.log('======获取OBU号======')
let cmdArray = [cmd.HOME_DIRECTORY, cmd.OBU_SYSTEM_FILE, cmd.RANDOM_NUMBER];
tools.showLoadingAlert("正在执行指令");
bluetoothUtil.transCmd(cmdArray, "20", function (res) {
tools.hideLoadingAlert();
var status = res[1].substring(res[1].length - 4, res[1].length);

console.log('获取OBU号执行结果' + status, res)
//第一次获取随机数
if (status == "9000") {
state.readObuId = res[1].substring(20, 36);
if (state.orderInfo.obuId != state.readObuId) {
uni.showModal({
title: '提示',
content: '签号不一致,前往订单管理页面申请退货',
showCancel: false,
success: function (res) {
if (res.confirm) {
console.log('用户点击确定');
uni.switchTab({
url: "/pages/order/order"
})
} else if (res.cancel) {
console.log('用户点击取消');
}
}
});
} else {
// 确认收货
confirmReceipt()
}
}
});
};
const confirmReceipt = () => {
//确认收货
const confirmReceipt = (e) => {
const options = {
type: 2,
data: {
@@ -183,15 +82,6 @@
false
);
});
}
onUnload(() => {
//移除监听
uni.$off('bluetoothLink')
})
//确认收货
const confirmReceiptClick = (e) => {
navTo("/pages/bluetooth/bluetooth?routeType=5"); //去连接蓝牙

};

//获取订单详情

+ 51
- 21
subpackage/orders/order-details-new.vue View File

@@ -57,6 +57,10 @@
<text class="d-label">车辆类型:</text>
<text class="d-value">{{getCarTypeName(state.orderInfo.type)}}</text>
</view>
<view class="d-row" v-if="getCarTypeName(state.orderInfo.type)=='货车'">
<text class="d-label">牵引车:</text>
<text class="d-value">{{state.orderInfo.tractorSign=='1'?'是':'否'}}</text>
</view>
<view class="d-row">
<text class="d-label">订单金额:</text>
<text class="d-value text-orange">¥
@@ -380,9 +384,15 @@
<!-- TODO 已完成订单存在售后信息的要显示售后信息,但是不知道用什么字段来来判断已完成订单有没有售后信息及哪一种售后信息,需走完订单所有流程在进行测试修改 -->
</view>
</view>

<!-- orderSource类型 SERVICE_HALL app只展示待激活按钮-->
<!-- WECHAT("WECHAT", "九州ETC小程序"),
SERVICE_HALL("SERVICE_HALL", "线上营业厅"),
WEB("WEB", "后台PC端",),
H5("H5", "H5页面", ),
ALI("ALI", "支付宝小程序", ) -->
<!-- 按钮区 -->
<view class="btn-view" v-if="state.orderInfo.orderStatus != OrderStatus.已取消">
<view class="btn-view"
v-if="state.orderInfo.orderStatus != OrderStatus.已取消 && state.orderInfo['orderSource'] !='SERVICE_HALL'">
<!-- 信息填写未完成 -->
<view class="btn-status"
v-if="state.orderInfo.orderStep == OrderStatus['完成个人/单位信息上传'] || state.orderInfo.orderStep == OrderStatus.完成填写基本信息 || state.orderInfo.orderStep == OrderStatus.待支付3">
@@ -404,7 +414,6 @@
v-if="state.orderInfo.orderStep == OrderStatus['完成车辆信息上传/待支付'] || state.orderInfo.orderStep == OrderStatus.待支付2 "
class="btn-status">
<view class="btn space" @click="gotoCancelOrder(state.orderInfo)">取消订单</view>
<!-- <view class="btn-green width-num-1" @click="gotoPay(state.orderInfo)">支付</view> -->
<view class="btn-green width-num-1" @click="gotoOrderDetailsPay(state.orderInfo)">支付</view>
</view>
<!-- 待签约-->
@@ -421,21 +430,22 @@
<view v-if="state.orderInfo.orderStep == OrderStatus.待收货" class="btn-status">
<view class="btn space" @click="gotoCheckLogistics(state.orderInfo)">查看物流</view>
<view class="btn space" @click="gotoReturnOrder(state.orderInfo)">申请退货</view>
<view class="btn-green" @click="gotoConfirmReceipt(state.orderInfo)">确认收货</view>
<view class="btn space" @click.stop="closeOrder(state.orderInfo)"
<view class="btn-green space" @click="gotoConfirmReceipt(state.orderInfo)">确认收货</view>
<view class="btn-green" @click.stop="closeOrder(state.orderInfo)"
v-if="state.orderInfo.finishOrder">结束订单</view>
</view>
<!-- 待激活 -->
<view v-if="state.orderInfo.orderStep == OrderStatus.待激活" class="btn-status">
<view class="btn space" @click="gotoReturnOrder(state.orderInfo)">申请退货</view>
<view class="btn space" @click="gotoExchangeOrder(state.orderInfo)">申请换货</view>
<view class="btn-green" @click="gotoActiveOrder(state.orderInfo)">去激活</view>
<view class="btn space" @click.stop="closeOrder(state.orderInfo)"
<view class="btn-green space" @click="gotoActiveOrder(state.orderInfo)">去激活</view>
<view class="btn-green" @click.stop="closeOrder(state.orderInfo)"
v-if="state.orderInfo.finishOrder">结束订单</view>
</view>
<!-- 订单已结束 -->
<view v-if="state.orderInfo.orderStep == OrderStatus.已结束" class="btn-status">
<view class="btn-green width-num-3" @click="state.showActiveOrder = true">重新激活订单</view>
<view v-if="state.orderInfo.orderStep == OrderStatus.已结束 && state.orderInfo.isUseAgain"
class="btn-status">
<view class="btn-green" @click.stop="gotoAgainUseOrder(state.orderInfo)">再次使用订单</view>
</view>
<!-- 订单完成 -->
<view v-if="state.isWeiXin==1">
@@ -466,9 +476,16 @@
<view class="btn-green" @click="gotoConfirmReceipt(state.orderInfo)">确认收货</view>
</view> -->
</view>
<view v-else>
<!-- 待激活 -->
<view class="btns" v-if="state.orderInfo.orderStep == OrderStatus.待激活 ">
<view class="btn btn-primary" @click.stop="gotoActiveOrder(state.orderInfo)">去激活</view>
</view>
</view>
</view>
</view>
</view>

<!-- 弹窗 -->
<u-popup v-model="state.showActiveOrder" mode="center">
<popup-active-order content="确认是否重新激活订单" @cancel="state.showActiveOrder = false"
@@ -484,7 +501,7 @@
import { editOrderAddr, orderDetail } from "@/utils/network/api";
import { stringToJson } from "@/utils/network/encryption";
import useOrderSkip from "@/composables/order/useOrderSkip";
import { getETCStatusName, getOBUStatusName, msg, getOrderTypeName, getCarTypeName, getOrderTime, isBlank } from "@/utils/utils";
import { getETCStatusName, getOBUStatusName, msg, getOrderTypeName, getCarTypeName, getOrderTime, isBlank, timesDiff } from "@/utils/utils";
import { OrderStatus } from "@/datas/enum";

const state = reactive({
@@ -498,7 +515,7 @@
//按钮跳转业务逻辑
const { gotoEditAddress, gotoCancelOrder, gotoEditUserOrUnitInfo,
gotoConfirmReceipt, gotoCheckLogistics, gotoEvaluateProduct,
gotoActiveOrder, gotoReturnOrder, gotoExchangeOrder, gotoPay, gotoOrderSign, gotoOrderDetailsPay, gotoEvaluateSalesman, closeOrder } = useOrderSkip();
gotoActiveOrder, gotoReturnOrder, gotoExchangeOrder, gotoPay, gotoOrderSign, gotoOrderDetailsPay, gotoEvaluateSalesman, closeOrder, gotoAgainUseOrder } = useOrderSkip();


//获取订单详情
@@ -511,9 +528,23 @@
}
request(orderDetail, options).then((res) => {
state.orderInfo = stringToJson(res.bizContent);
// for(var i in state.orderInfo){
// if(state.orderInfo[i])
// }
// 订单发货后未激活 30天 以后 结束订单功能 insertTime >30 算出来距离今天是负数 updateTime<30(结束订单)
for (var i in state.orderInfo) {
if (state.orderInfo['insertTime']) {
if (timesDiff(state.orderInfo['insertTime'].replace("T", " ")).days > 30) {
state.orderInfo['finishOrder'] = true //可以结束
} else {
state.orderInfo['finishOrder'] = false //不可以结束
}
}
if (state.orderInfo['updateTime']) {
if (timesDiff(state.orderInfo['updateTime'].replace("T", " ")).days <= 30) {
state.orderInfo['isUseAgain'] = true //可以结束
} else {
state.orderInfo['isUseAgain'] = false //不可以结束
}
}
}
state.orderInfo.appraise = appraise;
console.log("获取订单详情", state.orderInfo)
//测试
@@ -720,25 +751,24 @@
border: 1px solid #DCDCDC;
border-radius: 30rpx;
color: #333333;
font-size: 26rpx;
height: 61rpx;
width: 141rpx;
font-size: 24rpx;
height: 52rpx;
width: 130rpx;
display: flex;
justify-content: center;
align-items: center;
font-size: 26rpx;
}

.btn-green {
border: 1px solid #00B38B;
border-radius: 30rpx;
color: #00B38B;
height: 61rpx;
width: 141rpx;
height: 52rpx;
padding: 0 10rpx;
display: flex;
justify-content: center;
align-items: center;
font-size: 26rpx;
font-size: 24rpx;
}

.width-num-1 {

+ 107
- 8
subpackage/personal-center/consumption-record.vue View File

@@ -4,7 +4,16 @@
<view>ETC卡号:{{item.cardId}}<text class="payStatus">{{item.payStatusC}}</text></view>
<view>充值金额:¥{{item.rechargeMoney/100}}</view>
<view>申请时间:{{item.insertTime}}</view>
<view>圈存状态:{{item.chargeStatus}}</view>
<view>圈存状态:{{item.statusC}}</view>
<!-- 支付成功和未圈存 -->
<view class="but-wrap" v-if="item.statusC =='待支付'">
<text @click="pay(item.rechargeMoney,item.orderNum)">去支付</text>
</view>
<view class="but-wrap" v-else-if="item.statusC =='已支付' && item.chargeStatus=='未圈存'">
<text @click="toTrap(item.rechargeMoney)">修复</text>
<text @click="queryRefound(item.cardId,item.orderNum)">退款</text>

</view>
</view>
<view style="text-align: center;margin: 20rpx;" v-if="state.flags">我是有底线的~</view>
</view>
@@ -14,11 +23,14 @@
<script lang="ts" setup>
import { reactive } from "vue";
import { request } from "@/utils/network/request.js";
import { queryCardRecord } from "@/utils/network/api.js";
import { queryCardRecord, refundQuan, queryRefoundResult } from "@/utils/network/api.js";
import { stringToJson } from "@/utils/network/encryption.js";
import { onLoad, onReachBottom } from "@dcloudio/uni-app";
import { getItem } from "@/utils/storage";
import { onLoad, onReachBottom, onShow } from "@dcloudio/uni-app";
import { getItem, StorageKeys } from "@/utils/storage";
import { getCodeName } from "@/datas/queryKey.js";
import {
navTo, msg, timesDiff
} from "@/utils/utils";
const state = reactive({
list: '', //所有数据
newList: '', //最终展示的
@@ -33,11 +45,17 @@
state.cardId = option.cardId;
getList();
})
onShow(() => {
state.pageNo = 1
state.newList = []
getList();
})
const getList = () => {
const options = {
type: 2,
data: {
'cardId': state.cardId,
// 'cardId': "52011328220202137230",
'openId': getItem('openId'),
'pageNo': state.pageNo,
'pageSize': state.pageSize
@@ -46,14 +64,18 @@
showLoading: true,
};
request(queryCardRecord, options).then((res) => {
state.newList = [...stringToJson(res.bizContent).data, ...state.newList]
for (var i = 0; i < state.newList.length; i++) {
console.log("getCodeName", getCodeName('VCR_ORDER_STATUS', state.newList[i]['status']))
state.newList[i]['payStatusC'] = getCodeName('VCR_ORDER_PAY_STATUS', state.newList[i]['payStatus'])
let data = [...state.newList, ...stringToJson(res.bizContent).data]
for (var i = 0; i < data.length; i++) {
console.log("getCodeName", getCodeName('VCR_ORDER_STATUS', data[i]['status']))
data[i]['payStatusC'] = getCodeName('VCR_ORDER_PAY_STATUS', data[i]['payStatus'])
// 大于5分钟就不能去支付了
data[i]['statusC'] = getCodeName('VCR_ORDER_STATUS', data[i]['status'])
}
state.newList = data
console.log("交易记录", state.newList)
})
}

// 触底加载
onReachBottom(() => {
if (state.newList.length < state.pageNo * 16) return state.flags = true
@@ -61,6 +83,64 @@
state.pageNo++
getList()
})
const toTrap = (rechargeMoney) => {
uni.navigateTo({
url: `/subpackage/personal-center/trapping-and-repairing/recharge-pay?rechargeMoney=${rechargeMoney}&&payMoney=0`
})
}
// 退款代码
const queryRefound = (cardId, orderId) => {
const options = {
type: 2,
data: {
"orderId": orderId,
"cardId": cardId,
"openId": getItem(StorageKeys.OpenId),
},
method: 'POST',
showLoading: true,
}
console.log("refundQuan", refundQuan, options)
request(refundQuan, options).then((res) => {
const data = stringToJson(res.bizContent);
refoundResult(cardId, orderId);
console.log("222", data)
})
}
const refoundResult = (cardId, orderId) => {
const options = {
type: 2,
data: {
"orderId": orderId,
"cardId": cardId,
},
method: 'POST',
showLoading: true,
}
console.log("queryRefoundResult", queryRefoundResult, options)
request(queryRefoundResult, options).then((res) => {
const data = stringToJson(res.bizContent);
console.log("data", data)
if (data.refundStatus == "SUCCESS") {
// 刷新列表
state.pageNo == 1
getList();
} else if (data.refundStatus == "CLOSED") {
msg('退款关闭')
} else if (data.refundStatus == "HANDLING") {
msg('退款处理中')
} else if (data.refundStatus == "EXCEPTION") {
msg('退款异常')
}
})
}
// 退款代码完成
// 去支付
const pay = (rechargeMoney, orderNum) => {
uni.navigateTo({
url: `/subpackage/personal-center/trapping-and-repairing/recharge-pay?rechargeMoney=${rechargeMoney}&&payMoney=1&&orderNum=${orderNum}`
})
}
</script>

<style scoped>
@@ -74,6 +154,7 @@
padding: 0 30rpx;
overflow: hidden;
font-size: 32rpx;
min-height: 100vh;
}

.search_wrap {
@@ -111,4 +192,22 @@
color: red;
float: right;
}

.but-wrap {
display: flex;
justify-content: flex-end;
margin-top: 10rpx;
}

.but-wrap>text {
border: 1px solid #00b38b;
color: #00b38b;
height: 50rpx;
line-height: 50rpx;
border-radius: 30rpx;
padding: 0 24rpx;
font-size: 28rpx;
box-sizing: border-box;
margin-left: 12rpx;
}
</style>

+ 61
- 46
subpackage/personal-center/operation-upload.vue View File

@@ -9,7 +9,8 @@
</view>
<view class="item-right" @click="chooseImage(1)">
<view class="empty-node"></view>
<image :src="state.headstockImg ?state.headstockImg: defHeadstockImg" :data-url="state.headstockImg ?state.headstockImg: defHeadstockImg" ></image>
<image :src="state.headstockImg ?state.headstockImg: defHeadstockImg"
:data-url="state.headstockImg ?state.headstockImg: defHeadstockImg"></image>
</view>
</view>
<view class="item-row">
@@ -20,7 +21,7 @@
</view>
<view class="item-right" @click="chooseImage(2)">
<view class="empty-node"></view>
<image :src="state.installImg ?state.installImg: defInstallImg" ></image>
<image :src="state.installImg ?state.installImg: defInstallImg"></image>
</view>
</view>
<view class="hint">
@@ -28,7 +29,7 @@
<view>请打开手机蓝牙后再进行下一步操作。</view>
</view>
<view class="btn">
<submit-button @submit="gotoNextStep" title="下一步" ></submit-button>
<submit-button @submit="gotoNextStep" title="下一步"></submit-button>
</view>
</view>
</template>
@@ -36,20 +37,20 @@
<script lang="ts" setup>
import { reactive } from "vue";
import { msg, navTo } from '@/utils/utils';
import {fileURL} from "@/datas/fileURL.js";
import { fileURL } from "@/datas/fileURL.js";
const imgURL = `${fileURL}image/`;
const height = uni.getSystemInfoSync().windowHeight
const defHeadstockImg = imgURL + "bluetooth/device-active-img1.png";
const defInstallImg = imgURL + "bluetooth/device-active-img2.png";
const state = reactive({
headstockImg:null, //车头照
installImg:null //安装照
headstockImg: null, //车头照
installImg: null //安装照
});
//选择图片
const chooseImage = (type:number) => {
const chooseImage = (type : number) => {
uni.chooseImage({
count: 1,
sizeType: ['original', 'compressed'], //可以指定是原图还是压缩图,默认二者都有
@@ -64,43 +65,44 @@
}
});
}
//下一步
const gotoNextStep = ()=>{
if(!state.headstockImg || !state.installImg){
const gotoNextStep = () => {
if (!state.headstockImg || !state.installImg) {
msg('请按照要求上传图片!');
return;
}
uni.openBluetoothAdapter()
/* 判断是否打开蓝牙 */
uni.getBluetoothAdapterState({
success(res) {
//如果res.avaliable==false 说明没打开蓝牙 反之则打开
if (res.available == false) {
if (res.available == false) {
uni.showToast({
title: '请打开手机蓝牙',
icon:"error",
duration: 2000
title: '请打开手机蓝牙',
icon: "error",
duration: 2000
})
return
} else {
navTo('/pages/bluetooth/bluetooth?routeType=1')
}
}
})
})
}
</script>

<style>
page{
page {
background: #F3F3F3;
}
</style>
<style lang="scss" scoped>
.main{
.main {
overflow: hidden;
.item-row{

.item-row {
width: calc(100% - 60rpx);
margin-left: 30rpx;
display: flex;
@@ -109,19 +111,22 @@
background: white;
padding: 30rpx;
border-radius: 20rpx;
box-shadow: 0rpx 4rpx 13rpx 3rpx rgba(223,223,223,0.8);
.item-left{
.title{
box-shadow: 0rpx 4rpx 13rpx 3rpx rgba(223, 223, 223, 0.8);

.item-left {
.title {
font-size: 34rpx;
color: #333;
font-weight: bold;
}
.desc{

.desc {
font-size: 24rpx;
color: #999;
margin: 10rpx 0;
}
.flag{

.flag {
width: 110rpx;
height: 45rpx;
line-height: 42rpx;
@@ -133,18 +138,21 @@
background: #D9F8F1;
}
}
.item-right{

.item-right {
width: 295rpx;
height: 188rpx;
position: relative;
image{

image {
position: relative;
z-index: 10;
width: 100%;
height: 188rpx;
}
&::before{
content:'';

&::before {
content: '';
position: absolute;
width: 22rpx;
height: 22rpx;
@@ -152,11 +160,12 @@
border-bottom: none;
border-right: none;
z-index: 0;
left:-4rpx;
left: -4rpx;
top: -4rpx;
}
&::after{
content:'';

&::after {
content: '';
position: absolute;
width: 22rpx;
height: 22rpx;
@@ -168,13 +177,15 @@
bottom: -4rpx;
}
}
.empty-node{

.empty-node {
position: absolute;
z-index: 0;
width: 100%;
height: 100%;
&::before{
content:'';

&::before {
content: '';
position: absolute;
width: 22rpx;
height: 22rpx;
@@ -182,11 +193,12 @@
border-left: none;
border-bottom: none;
z-index: 0;
right:-4rpx;
right: -4rpx;
top: -4rpx;
}
&::after{
content:'';

&::after {
content: '';
position: absolute;
width: 22rpx;
height: 22rpx;
@@ -199,7 +211,8 @@
}
}
}
.hint{

.hint {
display: flex;
flex-direction: row;
justify-content: center;
@@ -207,18 +220,20 @@
color: #666666;
padding: 0px 30rpx;
margin-top: 60rpx;
.icon{
.icon {
width: 36rpx;
height: 36rpx;
margin-right: 10rpx;
}
view{

view {
width: calc(100% - 36rpx);
}
}
.btn{
margin:60rpx 40rpx;

.btn {
margin: 60rpx 40rpx;
}
}
</style>

+ 0
- 5
subpackage/personal-center/setting/personal-information/user-card.vue View File

@@ -176,11 +176,6 @@
// agentIdVld: '',
}
})
// const strReplace = (str : string) => {
// let imgUrl = str.replace("http://192.168.101.145:9000", envs[process.env.NODE_ENV].baseUrl);
// imgUrl = imgUrl.replace("http://100.64.2.113:9000", envs[process.env.NODE_ENV].baseUrl);
// return imgUrl;
// };

const getCode = () => {
console.log(123);

+ 239
- 0
subpackage/personal-center/trapping-and-repairing/recharge-pay.vue View File

@@ -0,0 +1,239 @@
<template>
<view class="content">
<view @click="rechargeAction">
<view style="display: flex;align-items: center;">
<image class="photo" :src="fileURL + 'image/index/goRecharge.png'"></image>去修复
</view>
<image class="photo1" src="../../static/image/icon-back.png" mode="widthFix"></image>
</view>
<view>
<view>选择充值方式:</view>
<view style="width: 67%;display: flex;align-items: center;">
<radio-group @change="radioChange" style="display: flex;align-items: center;">
<label style="align-items: center;margin-right: 40rpx;margin-top: 0;"
class="uni-list-cell uni-list-cell-pd" v-for="(item, index) in state.transWayTypeList"
:key="item.value">
<view>
<radio :value="item.value" :checked="index === state.current" />
</view>
<view>{{item.name}}</view>
</label>
</radio-group>
</view>
</view>
</view>
<view class="tips" v-if="source=='WECHAT'">温馨提示: <text class="red">NFC修复</text>仅支持在<text
class="red">安卓手机</text>进行ETC储值卡充值!</view>
</template>

<script setup lang="ts">
import {
stringToJson
} from "@/utils/network/encryption";
import {
onLoad,
onShow
} from "@dcloudio/uni-app";
import {
request
} from "@/utils/network/request.js";
import {
reactive
} from "vue";
import {
navTo, msg
} from "@/utils/utils";
import {
fileURL
} from "@/datas/fileURL.js";
import { source } from "@/utils/network/difference";
const datas = require("../../../static/etcUtil/datas.js");
const bluetoothUtil = require("../../../static/etcUtil/index.js");
const cmd = require("../../../static/etcUtil/cmdConfig.js");
const tools = require("../../../static/etcUtil/tools.js");
const NFCAPI = require('../../../static/nfc/NFCAPI.js');

const state = reactive({
transWayTypeShow: false,
// #ifdef MP-ALIPAY
transWayTypeList: [{
name: "蓝牙",
value: "blu",
}],
// #endif
// #ifdef MP-WEIXIN
transWayTypeList: [],
// #endif
tableIndex: 0,
transWayName: "蓝牙",
transWay: "blu", //“blu”为蓝牙充值方式、“nfc”为NFC充值方式
cardId: "", //卡号 需要传参
current: 0,
rechargeMoney: "", //圈存金额
orderNum: "",//消费明细 传orderNum说明去支付
payMoney: 0, //0 修复 1支付
});

const selectConfirm = (item : any) => {
state.transWayName = item[0].label
state.transWay = item[0].value
};

onLoad((option) => {
// #ifdef MP-WEIXIN
state.rechargeMoney = option.rechargeMoney
state.orderNum = option.orderNum
state.payMoney = option.payMoney
console.log("参数", option)
uni.getSystemInfo({
success: (res) => {
console.log("res", res['osName'])
// ios
if (res['osName'] == 'ios') {
state.transWayTypeList = [{
name: "蓝牙",
value: "blu",
}]
} else {
// 安卓
state.transWayTypeList = [{
name: "蓝牙",
value: "blu",
}, {
name: "NFC",
value: "nfc",
}]
}
}
});
// #endif
});

function radioChange(evt) {
console.log('输出内容', evt)
state.transWay = evt.detail.value; //“blu”为蓝牙充值方式、“nfc”为NFC充值方式
for (var k = 0; k < state.transWayTypeList.length; k++) {
if (state.transWayTypeList[k]['value'] == evt.detail.value) {
state.transWayName = state.transWayTypeList[k]['name']
return;
}
}
}

/*点击充值按钮*/
const rechargeAction = () => {
if (state.transWay == 'blu') {
uni.redirectTo({
url: `/pages/bluetooth/bluetooth?routeType=7&&rechargeMoney=${state.rechargeMoney}&&orderNum=${state.orderNum}&&payMoney=${state.payMoney}`,
});
} else {
uni.redirectTo({
url: `/pages/nfc/nfc?routeType=7&&rechargeMoney=${state.rechargeMoney}&&orderNum=${state.orderNum}&&payMoney=${state.payMoney}`,
});
}


};
const goRecord = () => {
uni.navigateTo({
url: `/subpackage/personal-center/consumption-record?cardId=${state.cardId}`
})
}
</script>

<style>
.record {
width: 90%;
display: flex;
justify-content: space-between;
margin: 0 auto;
align-items: center;
}

.arrow {
width: 14rpx;
height: 26rpx;
}

.tabs .tab-tit {
font-size: 30rpx;
color: #333;
padding: 45rpx 0 22rpx 30rpx;
}

.tabs .tab {
display: flex;
flex-wrap: wrap;
justify-content: space-evenly;
}

.tabs .tab .item {
width: 210rpx;
height: 100rpx;
background: #f6fff7;
border: 1px solid #dcdde1;
box-sizing: border-box;
line-height: 100rpx;
border-radius: 6rpx;
text-align: center;
margin-bottom: 24rpx;
color: #333333;
font-size: 32rpx;
}

.tabs .tab .item.active {
border: 1px solid #24cc49;
color: #24cc49;
}

.btn-primary {
width: 670rpx;
height: 80rpx;
line-height: 80rpx;
background: linear-gradient(-90deg, #43a1e0 0%, #13e7c1 100%);
border-radius: 40rpx;
font-size: 32rpx;
color: #ffffff;
margin: 200rpx 40rpx 0;
text-align: center;
}

label {
display: flex;
justify-content: space-between;
margin-top: 30rpx;
}

.photo {
width: 40rpx;
height: 40rpx;
margin-right: 40rpx;
}

.photo1 {
width: 40rpx;
transform: rotateY(180deg);
}

.content {
font-size: 32rpx;
}

.content>view {
border-bottom: 1rpx solid #c1c1c1;
display: flex;
padding: 16rpx 20rpx;
align-items: center;
justify-content: space-between;
height: 60rpx;
}

.red {
color: red;
}

.tips {
font-size: 32rpx;
padding: 20rpx;
}
</style>

+ 1059
- 0
subpackage/personal-center/trapping-and-repairing/recharge-two.vue
File diff suppressed because it is too large
View File


+ 56
- 0
subpackage/personal-center/trapping-and-repairing/result.vue View File

@@ -0,0 +1,56 @@
<template>
<view class="wrapper">
<image :src="`${$imgUrl}common/reharge-success.png`" class="pic-status" mode="widthFix"></image>
<view class="text-result">修复成功</view>
<view class="sub-text">您办理的账户充值业务已生成订单</view>
<view class="btn btn-primary" @click="view">返回查看</view>
</view>
</template>

<script lang="ts" setup>
const view = () => {
uni.navigateBack({
delta: 3
})
}
</script>

<style>
.wrapper {
display: flex;
flex-direction: column;
justify-content: center;
text-align: center;
}

.text-result {
font-size: 36rpx;
color: #333;
font-weight: 400;
}

.sub-text {
font-size: 26rpx;
font-weight: 400;
color: #999999;
padding-top: 40rpx;
}

.pic-status {
width: 690rpx;
height: 300rpx;
margin: 98rpx 30rpx 25rpx;
}

.btn-primary {
width: 670rpx;
height: 80rpx;
line-height: 80rpx;
background: linear-gradient(-90deg, #43A1E0 0%, #13E7C1 100%);
border-radius: 40rpx;
font-size: 32rpx;
color: #ffffff;
margin: 300rpx 40rpx 0;
text-align: center;
}
</style>

+ 10
- 0
utils/utils.ts View File

@@ -641,4 +641,14 @@ export function subscribeMessages() {
console.log("订阅消息", res)
}
})
}
// 通知用户消息订阅
export function noticeUser() {
uni.requestSubscribeMessage({
tmplIds: [''],
success(res) {
console.log("通知用户消息订阅", res)
return true
}
})
}

Loading…
Cancel
Save