From 3b7af3a28da39037c9c2ba31fbd345d0e3aa293e Mon Sep 17 00:00:00 2001 From: chenbiao Date: Fri, 13 May 2022 15:26:11 +0800 Subject: [PATCH] add 我的钱包 接口联调 --- common/common.js | 6 +++--- common/filters.js | 16 ++-------------- main.js | 2 +- pages/index/index.vue | 28 ++++++++++++++-------------- pages/moneyRecharge/moneyRecharge.vue | 424 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ 5 files changed, 234 insertions(+), 242 deletions(-) diff --git a/common/common.js b/common/common.js index 3d3d18b..011473a 100644 --- a/common/common.js +++ b/common/common.js @@ -36,15 +36,15 @@ const requestSign = function(inputData) { var jsonList = inputData || {}; - jsonList.orgId = public_orgId; + // jsonList.orgId = public_orgId; jsonList.sign_type = "md5"; jsonList.app_id = "0eca8f5373ca4866aec2f8e9d9367104"; jsonList.deviceInfo = "BC0703A4-AFB0-4B51-9089-9B7487C0CC6E"; jsonList.salt = getSalt(); jsonList.terminalSource = "11"; - // jsonList.token = getGlobalUser("globalUser").token; + jsonList.token = getGlobalUser("globalUser").token; // jsonList.token = getGlobalUser("globalUser").token; - jsonList.token = 'eb1538c4c2ee45d7b2610cf071c4a27f'; + // jsonList.token = 'eb1538c4c2ee45d7b2610cf071c4a27f'; var arrData = []; for (var key in jsonList) { diff --git a/common/filters.js b/common/filters.js index 1ac5c61..13c812e 100644 --- a/common/filters.js +++ b/common/filters.js @@ -31,21 +31,9 @@ const RMB = (value) => { return `¥${value}` } -// 保留两位小数 +// 钱保留两位小数 const toFixed2 = num => { - let f = Number(parseFloat(num)); - if (isNaN(f)) return false; - let z = Math.round(num * 100) / 100; - let s = z.toString(); - let rs = s.indexOf('.'); - if (rs < 0) { - rs = s.length; - s += '.'; - } - while (s.length <= rs + 2) { - s += '0'; - } - return s + return isNaN(num) ? 0.00 : parseFloat((num/100).toFixed(2)); } // 数字每三位加个逗号 diff --git a/main.js b/main.js index fff4540..f06ca47 100644 --- a/main.js +++ b/main.js @@ -4,7 +4,7 @@ import store from './store' import common from "./common/common.js"; import { myRequest } from './common/requestServer.js' //引入封装的过滤器 filters -import * as filters from './common/filters.js' +import filters from './common/filters.js' // 挂在Vue属性 全局通过this.$myRequest()可以访问到 Vue.prototype.$common = common Vue.prototype.$myRequest = myRequest diff --git a/pages/index/index.vue b/pages/index/index.vue index 2b99320..4f79b5f 100644 --- a/pages/index/index.vue +++ b/pages/index/index.vue @@ -103,15 +103,15 @@ } }, onLoad() { - let userToken= uni.getStorageSync("globalUser").token; - if(userToken){ - this.userIsLogin = false; - let indexInfo= uni.getStorageSync("indexInfo"); - this.userName=indexInfo.userName; - - }else{ - this.userIsLogin = true; - } + let userToken = uni.getStorageSync("globalUser").token; + if (userToken) { + this.userIsLogin = false; + let indexInfo = uni.getStorageSync("indexInfo"); + this.userName = indexInfo.userName; + + } else { + this.userIsLogin = true; + } }, methods: { login() { @@ -193,12 +193,12 @@ }); }, - toRecordPage() { - uni.navigateTo({ - url: '../parkRecordList/parkRecordList' + toRecordPage() { + uni.navigateTo({ + url: '../parkRecordList/parkRecordList' - }); - }, + }); + }, diff --git a/pages/moneyRecharge/moneyRecharge.vue b/pages/moneyRecharge/moneyRecharge.vue index 5884c42..07289f7 100644 --- a/pages/moneyRecharge/moneyRecharge.vue +++ b/pages/moneyRecharge/moneyRecharge.vue @@ -1,219 +1,223 @@ -- libgit2 0.21.4