From 94a4ee91f90338b9b2f77f5199d8bf51feb28b25 Mon Sep 17 00:00:00 2001 From: liugongyu <290219706@qq.com> Date: Tue, 25 Jul 2023 10:03:52 +0800 Subject: [PATCH] 宣化 聚合支付 --- config/index.js | 8 ++++---- src/router/index.js | 2 +- src/utils/filters.js | 22 +++++++++++++++++++++- src/utils/utils.js | 8 +++++--- src/views/binding/binDing.vue | 41 +++++++++++++++++++++-------------------- src/views/cards/buyVipCard.vue | 2 +- src/views/mySelf/selfNav.vue | 7 +++++-- src/views/parkPay/orderPay.vue | 1 + 8 files changed, 59 insertions(+), 32 deletions(-) diff --git a/config/index.js b/config/index.js index f030a2a..3177bcf 100644 --- a/config/index.js +++ b/config/index.js @@ -8,7 +8,7 @@ module.exports = { dev: { // Paths - assetsSubDirectory: 'static', + assetsSubDirectory: 'ceshi', assetsPublicPath: '/', // proxyTable: { // '/api':{ @@ -47,11 +47,11 @@ module.exports = { build: { // Template for index.html - index: path.resolve(__dirname, '../dist/index.html'), + index: path.resolve(__dirname, '../ceshi/ceshi.html'), // Paths - assetsRoot: path.resolve(__dirname, '../dist'), - assetsSubDirectory: 'static', + assetsRoot: path.resolve(__dirname, '../ceshi'), + assetsSubDirectory: 'ceshi', assetsPublicPath: './', /** diff --git a/src/router/index.js b/src/router/index.js index 2763f45..a1ac640 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -9,7 +9,7 @@ export default new Router({ { path: "/", redirect: { - name: "plateNumber" + name: "selfNav" } }, // { diff --git a/src/utils/filters.js b/src/utils/filters.js index b50c586..5af766a 100644 --- a/src/utils/filters.js +++ b/src/utils/filters.js @@ -19,6 +19,26 @@ const vFilter = { } } }; + +const formateColor = function(val) { + switch (val) { + case "0": + return "carBlue"; + break; + case "1": + return "carYellow"; + break; + case "2": + return "carWhite"; + break; + case "3": + return "carBlack"; + break; + case "4": + return "carGreen"; + break; + } +} const numFilter = function(value) { // 截取当前数据到小数点后两位 let realVal = (Number(value) / 100).toFixed(2); @@ -62,4 +82,4 @@ const cardType = function(cardType) { -export default { vFilter, numFilter, carType, cardType }; +export default { vFilter, formateColor, numFilter, carType, cardType }; diff --git a/src/utils/utils.js b/src/utils/utils.js index f2c1b7c..49c1c39 100644 --- a/src/utils/utils.js +++ b/src/utils/utils.js @@ -117,7 +117,9 @@ export default { myVxAppId: "wx1489e48e6a547023", userToken:localStorage.getItem('userToken'), userPhoneNum:localStorage.getItem('userPhoneNum'), - openId: "oWw3o5rY_bFsiT_nFd2CEQWGZfhs", + // openId: "oWw3o5rY_bFsiT_nFd2CEQWGZfhs", + + openId:localStorage.getItem('openId'), myOrgId: "10120", // 归属地 赤峰id 10003 黄石 10079 @@ -129,8 +131,8 @@ export default { jsonObj.app_id = "lrpo55tmveqe07w3gpovzgx34pdez7eh"; jsonObj.deviceInfo = "BC0703A4-AFB0-4B51-9089-9B7487C0CC6E"; jsonObj.salt = myCommonSalt(32); - // jsonObj.token = localStorage.getItem('userToken'); - jsonObj.token = 'e3b5417a987641219efb8dc1f8b5fbce' // 为了测试 + jsonObj.token = localStorage.getItem('userToken'); + // jsonObj.token = 'e3b5417a987641219efb8dc1f8b5fbce' // 为了测试 let sort = []; for (let k in jsonObj) { diff --git a/src/views/binding/binDing.vue b/src/views/binding/binDing.vue index 0528be3..601baad 100644 --- a/src/views/binding/binDing.vue +++ b/src/views/binding/binDing.vue @@ -29,7 +29,7 @@ export default { }, created() { this.timeNum = this.timeText; - // this.webAppCode = this.getWxCode(); // 正式打开注释 + this.webAppCode = this.getWxCode(); // 正式打开注释 }, methods: { getWxCode() { @@ -87,35 +87,36 @@ export default { }, getOpenIdByCode() { // 获取openid - this.bindCustByOpenId() // 正式注释 + // this.bindCustByOpenId() // 正式注释 // 正式打开注释 - // let jsondata = { - // appId: this.$utils.myVxAppId, - // code: this.webAppCode - // }; - // jsondata.sign = this.$utils.signObject(jsondata); - // console.log("停车记录传参 " + JSON.stringify(jsondata)); - // getOpenIdByCode(jsondata).then(response => { - // if(response.code=='0'){ - // this.bindCustByOpenId() // 获取token和用户手机号 - // } - // }); + let jsondata = { + appId: this.$utils.myVxAppId, + code: this.webAppCode + }; + jsondata.sign = this.$utils.signObject(jsondata); + console.log("停车记录传参 " + JSON.stringify(jsondata)); + getOpenIdByCode(jsondata).then(response => { + if(response.code=='0'){ + let openId = response.data + this.bindCustByOpenId(openId) // 获取token和用户手机号 + } + }); }, - bindCustByOpenId(){ // + bindCustByOpenId(openId){ // let jsondata = { phoneNum: this.phone, verifyCode: this.codeText, - // openid: this.$utils.openId // 正式打开注释 - openid:'oWw3o5rY_bFsiT_nFd2CEQWGZfhs' // 正式注释 + openid: openId // 正式打开注释 + // openid:'oWw3o5rY_bFsiT_nFd2CEQWGZfhs' // 正式注释 }; jsondata.sign = this.$utils.signObject(jsondata); bindCustByOpenId(jsondata).then(response => { if(response.code=='0'){ - this.getTokenByOpenId() // 获取token和用户手机号 + this.getTokenByOpenId(openId) // 获取token和用户手机号 }else if(response.code=='1017'||response.code==1017){ this.$toast("已经绑定过"); @@ -124,10 +125,10 @@ export default { } }); }, - getTokenByOpenId(){ // 获取token和用户手机号 + getTokenByOpenId(openId){ // 获取token和用户手机号 let jsondata = { - // openid: this.$utils.openId // 正式打开注释 - openid:'oWw3o5rY_bFsiT_nFd2CEQWGZfhs' // 正式注释 + openid:openId // 正式打开注释 + // openid:'oWw3o5rY_bFsiT_nFd2CEQWGZfhs' // 正式注释 }; jsondata.sign = this.$utils.signObject(jsondata); getTokenByOpenId(jsondata).then(response => { diff --git a/src/views/cards/buyVipCard.vue b/src/views/cards/buyVipCard.vue index 7d2b55e..cc2626a 100644 --- a/src/views/cards/buyVipCard.vue +++ b/src/views/cards/buyVipCard.vue @@ -228,7 +228,7 @@ export default { this.carList = response.data; if (this.carList.length == 0) { this.carNum = "点击选择车牌"; - this.carList = { + this.actions = { name: "前往绑定车牌页面" }; } else if (this.carList.length == 3) { diff --git a/src/views/mySelf/selfNav.vue b/src/views/mySelf/selfNav.vue index 1e45e99..d6b5af6 100644 --- a/src/views/mySelf/selfNav.vue +++ b/src/views/mySelf/selfNav.vue @@ -61,14 +61,17 @@ export default { phoneNum: ""//手机号 }; }, + + created() { + + }, mounted() { // this.openId = this.$utils.openId; // if (this.openId) { // this.getTokenAndphoneNum(); // } // console.log(this.openId); - }, - created() { + this.phoneNum = this.$utils.userPhoneNum console.log(this.$utils.userPhoneNum) }, diff --git a/src/views/parkPay/orderPay.vue b/src/views/parkPay/orderPay.vue index e6d44c5..77b838e 100644 --- a/src/views/parkPay/orderPay.vue +++ b/src/views/parkPay/orderPay.vue @@ -72,6 +72,7 @@ export default { }, created() { this.carWrapBG = this.$route.query.carColor //车牌颜色 + console.log(this.carWrapBG) this.carNumber = this.$route.query.carNumber this.arrearageTotalFee = this.$route.query.arrearageTotalFee // 应收 this.arrearageDiscFee = this.$route.query.arrearageDiscFee // 优惠 -- libgit2 0.21.4