From 0ed8e370659ad4e0582301ae31cfa155da114590 Mon Sep 17 00:00:00 2001 From: Liuyi <candymxq888@outlook.com> Date: 星期二, 12 十一月 2024 17:28:54 +0800 Subject: [PATCH] 添加柜台充值,修改扫码取水支付方式 --- unpackage/dist/dev/mp-weixin/pages/index/index.js | 88 +++++++++++++++++++------------------------- 1 files changed, 38 insertions(+), 50 deletions(-) diff --git a/unpackage/dist/dev/mp-weixin/pages/index/index.js b/unpackage/dist/dev/mp-weixin/pages/index/index.js index 104ed16..67bbf93 100644 --- a/unpackage/dist/dev/mp-weixin/pages/index/index.js +++ b/unpackage/dist/dev/mp-weixin/pages/index/index.js @@ -1,6 +1,7 @@ "use strict"; const common_vendor = require("../../common/vendor.js"); const common_assets = require("../../common/assets.js"); +const config_baseUrl = require("../../config/baseUrl.js"); const api_index = require("../../api/index.js"); const _sfc_main = { __name: "index", @@ -21,6 +22,8 @@ count: "", state: "", //state:true:挂失,false:正常 + cardType: "", + //卡类型01卡消费 02计次消费 03游客消费 04电子卡 userCardType: "" //userCardType:true:共享卡,false:正常卡 }); @@ -64,22 +67,8 @@ scanType: ["qrCode"], success: async function(res) { console.log("条码内容:" + res.result); - let data = { - cardType: cardInfo.value.cardType, - card: cardInfo.value.waterCardNumber, - sn: res.result - }; - await api_index.buyWaterApi(data).then((res2) => { - if (res2.code == 200) { - common_vendor.index.navigateTo({ - url: "/pages/scanWater/index" - }); - } else { - common_vendor.index.showToast({ - title: "扫码失败!", - icon: "none" - }); - } + common_vendor.index.navigateTo({ + url: `/pages/scanWater/index?facilityCode=${res.result}` }); } }); @@ -92,7 +81,7 @@ { text: "故障上报", icon: "../../static/images/index/icon35.png", bgColor: "#a88ff1", url: "/pages/infoBreakdown/index", isUrl: 1 }, { text: "优惠卷", icon: "../../static/images/index/icon36.png", bgColor: "#18bfc4", url: "", isUrl: 4 }, { text: "会员卡挂失", icon: "../../static/images/index/icon37.png", bgColor: "#4875f0", url: "", isUrl: 2 }, - { text: "会员卡注销", icon: "../../static/images/index/icon38.png", bgColor: "#f45088", url: "", isUrl: 3 } + { text: "会员卡解绑", icon: "../../static/images/index/icon38.png", bgColor: "#f45088", url: "", isUrl: 3 } ]); function navTo(itemUrl) { if (itemUrl) { @@ -223,7 +212,7 @@ return common_vendor.e({ a: cardInfo.value.headImg }, cardInfo.value.headImg ? { - b: cardInfo.value.headImg + b: common_vendor.unref(config_baseUrl.BASE_URL) + "/upload" + cardInfo.value.headImg } : { c: common_assets._imports_0$2 }, { @@ -232,44 +221,43 @@ f: common_vendor.o(($event) => navTo("/pages/userInfo/index")), g: common_assets._imports_1$1, h: common_assets._imports_2, - i: common_vendor.o(($event) => navTo("/pages/addCard/index")), - j: common_assets._imports_0$1, - k: isShareCard.value + i: common_assets._imports_0$1, + j: isShareCard.value }, isShareCard.value ? { - l: common_vendor.t(cardInfo.value.waterCardNumber) + k: common_vendor.t(cardInfo.value.waterCardNumber) } : {}, { - m: !isShareCard.value + l: !isShareCard.value }, !isShareCard.value ? common_vendor.e({ - n: isVip.value + m: isVip.value }, isVip.value ? { - o: common_assets._imports_4 + n: common_assets._imports_4 } : {}, { - p: isLoss.value && isVip.value + o: isLoss.value && isVip.value }, isLoss.value && isVip.value ? {} : {}, { - q: isVip.value + p: isVip.value }, isVip.value ? { - r: common_vendor.t(cardInfo.value.waterCardNumber) + q: common_vendor.t(cardInfo.value.waterCardNumber) } : {}, { - s: isVip.value + r: isVip.value }, isVip.value ? {} : {}, { - t: !isVip.value + s: !isVip.value }, !isVip.value ? {} : {}, { - v: isVip.value + t: isVip.value }, isVip.value ? { - w: common_vendor.t(cardInfo.value.balance) + v: common_vendor.t(cardInfo.value.balance) } : {}, { - x: isVip.value + w: isVip.value }, isVip.value ? { - y: common_vendor.o(($event) => navTo("/pages/recharge/index")) + x: common_vendor.o(($event) => navTo("/pages/recharge/index")) } : {}) : {}, { - z: topHeight.value + "rpx", - A: common_assets._imports_5, - B: common_vendor.o(($event) => upGrade()), - C: common_assets._imports_1, - D: common_vendor.o(($event) => navTo("/pages/facilityList/index")), - E: common_assets._imports_7, - F: common_vendor.o(($event) => toScan()), - G: common_vendor.f(functionList.value, (item, index, i0) => { + y: topHeight.value + "rpx", + z: common_assets._imports_5, + A: common_vendor.o(($event) => navTo("/pages/sendWater/index")), + B: common_assets._imports_1, + C: common_vendor.o(($event) => navTo("/pages/facilityList/index")), + D: common_assets._imports_7, + E: common_vendor.o(($event) => toScan()), + F: common_vendor.f(functionList.value, (item, index, i0) => { return { a: item.icon, b: item.bgColor, @@ -278,14 +266,14 @@ e: index }; }), - H: common_assets._imports_8, - I: common_vendor.o(upGrade), - J: common_assets._imports_9, - K: common_assets._imports_10, - L: common_vendor.o(($event) => navTo("/pages/station/index")), - M: common_assets._imports_11, - N: common_assets._imports_10, - O: common_vendor.o(upGrade) + G: common_assets._imports_8, + H: common_vendor.o(upGrade), + I: common_assets._imports_9, + J: common_assets._imports_10, + K: common_vendor.o(($event) => navTo("/pages/station/index")), + L: common_assets._imports_11, + M: common_assets._imports_10, + N: common_vendor.o(($event) => navTo("/pages/counterRecharge/index")) }); }; } -- Gitblit v1.9.3