Commit 1cea5358fd3629bb29efe3203aaa3194b1588c35

Authored by 刘淇
1 parent 227ef1fb

停车记录详情

common/common.js
1 import md5 from './md5.min.js'; 1 import md5 from './md5.min.js';
2 -  
3 // 江阴正式环境 2 // 江阴正式环境
4 var serverUrl = "https://bus.jycrtc.com"; 3 var serverUrl = "https://bus.jycrtc.com";
5 -  
6 //江阴微信小程序appid 4 //江阴微信小程序appid
7 -const hs_wxPay_appId = 'wxfdc1af620d3ab750';  
8 - 5 +const hs_wxPay_appId = 'wxfdc1af620d3ab750';
9 // 江阴慧停车orgId 6 // 江阴慧停车orgId
10 const public_orgId = '10107'; 7 const public_orgId = '10107';
11 const appName = '江阴慧停车'; 8 const appName = '江阴慧停车';
12 const ACompany = '©江阴慧停车管理有限公司'; 9 const ACompany = '©江阴慧停车管理有限公司';
13 const BCompany = '由中兴智能交通股份有限公司提供技术支持'; 10 const BCompany = '由中兴智能交通股份有限公司提供技术支持';
14 const appVerson = '1.0.0'; 11 const appVerson = '1.0.0';
15 -  
16 const SetToken = uni.getStorageSync("globalUser").token; 12 const SetToken = uni.getStorageSync("globalUser").token;
17 -  
18 // ----江阴项目 接口---- 13 // ----江阴项目 接口----
19 // 商户登录 14 // 商户登录
20 const userLogin = serverUrl + "/business/h5/index/login"; 15 const userLogin = serverUrl + "/business/h5/index/login";
21 -  
22 // 获取已登录商户用户信息 16 // 获取已登录商户用户信息
23 const indexInfo = serverUrl + "/business/h5/index/info"; 17 const indexInfo = serverUrl + "/business/h5/index/info";
24 -  
25 // 商户退出登录 18 // 商户退出登录
26 const userLoginout = serverUrl + "/business/h5/index/logout"; 19 const userLoginout = serverUrl + "/business/h5/index/logout";
27 -  
28 // 商户关于我们 20 // 商户关于我们
29 const useraboutUs = serverUrl + "/business/h5/index/aboutUs"; 21 const useraboutUs = serverUrl + "/business/h5/index/aboutUs";
30 -  
31 // 商户账户余额信息 22 // 商户账户余额信息
32 const walletAccount = serverUrl + "/business/h5/wallet/account"; 23 const walletAccount = serverUrl + "/business/h5/wallet/account";
33 -  
34 // 商户充值金额列表 24 // 商户充值金额列表
35 const rechargeList = serverUrl + "/business/h5/wallet/rechargeList"; 25 const rechargeList = serverUrl + "/business/h5/wallet/rechargeList";
36 -  
37 // 通过商户ID查询停车记录信息 26 // 通过商户ID查询停车记录信息
38 const getBusinessParkOrderByBusIdForPage = serverUrl + "/business/h5/order/getBusinessParkOrderByBusIdForPage"; 27 const getBusinessParkOrderByBusIdForPage = serverUrl + "/business/h5/order/getBusinessParkOrderByBusIdForPage";
39 -  
40 // 通过商户ID查询停车记录信息 28 // 通过商户ID查询停车记录信息
41 const getPayOrderByOrderId = serverUrl + "/business/h5/order/getPayOrderByOrderId"; 29 const getPayOrderByOrderId = serverUrl + "/business/h5/order/getPayOrderByOrderId";
  30 +//刘淇接口
  31 +
  32 +
42 33
43 34
44 35
45 -//  
46 -const requestSign = function(inputData) {  
47 -  
48 - var jsonList = inputData || {};  
49 -  
50 - jsonList.orgId = public_orgId;  
51 - jsonList.sign_type = "md5";  
52 - jsonList.app_id = "0eca8f5373ca4866aec2f8e9d9367104";  
53 - jsonList.deviceInfo = "BC0703A4-AFB0-4B51-9089-9B7487C0CC6E";  
54 - jsonList.salt = getSalt();  
55 - jsonList.terminalSource = "11";  
56 - // jsonList.token = getGlobalUser("globalUser").token;  
57 - jsonList.token = getGlobalUser("globalUser").token;  
58 - // jsonList.token = 'af7ed65335f842ee8f754e841ff940ea';  
59 -  
60 - var arrData = [];  
61 - for (var key in jsonList) {  
62 - var obj = {};  
63 - // console.log("key = "+key);  
64 - // // obj[key] =jsonList[key];  
65 - obj.keyname = key;  
66 - obj.value = jsonList[key];  
67 - // console.log(obj);  
68 - arrData.push(obj);  
69 - }  
70 - var sign = getSign(arrData);  
71 - jsonList.sign = sign;  
72 - return jsonList;  
73 -}  
74 36
  37 +//陈彪接口
75 38
  39 +
  40 +
  41 +
  42 +const requestSign = function (inputData) {
  43 + var jsonList = inputData || {};
  44 + jsonList.orgId = public_orgId;
  45 + jsonList.sign_type = "md5";
  46 + jsonList.app_id = "0eca8f5373ca4866aec2f8e9d9367104";
  47 + jsonList.deviceInfo = "BC0703A4-AFB0-4B51-9089-9B7487C0CC6E";
  48 + jsonList.salt = getSalt();
  49 + jsonList.terminalSource = "11";
  50 + // jsonList.token = getGlobalUser("globalUser").token;
  51 + jsonList.token = getGlobalUser("globalUser").token;
  52 + // jsonList.token = 'af7ed65335f842ee8f754e841ff940ea';
  53 + var arrData = [];
  54 + for (var key in jsonList) {
  55 + var obj = {};
  56 + // console.log("key = "+key);
  57 + // // obj[key] =jsonList[key];
  58 + obj.keyname = key;
  59 + obj.value = jsonList[key];
  60 + // console.log(obj);
  61 + arrData.push(obj);
  62 + }
  63 + var sign = getSign(arrData);
  64 + jsonList.sign = sign;
  65 + return jsonList;
  66 +}
76 //获取sign 67 //获取sign
77 -var getSign = function(objb) {  
78 - var compare = function(obj1, obj2) {  
79 - var val1 = obj1.keyname;  
80 - var val2 = obj2.keyname;  
81 - if (val1 < val2) {  
82 - return -1;  
83 - } else if (val1 > val2) {  
84 - return 1;  
85 - } else {  
86 - return 0;  
87 - }  
88 - }  
89 - objb.sort(compare);  
90 - var strmd5 = '14318527b13840c2a4af63fef52c2d6e';  
91 - for (var i = 0; i < objb.length; i++) {  
92 - if (objb[i].value != null && objb[i].value != '') {  
93 - strmd5 += objb[i].keyname + objb[i].value;  
94 - }  
95 - }  
96 - strmd5 += '14318527b13840c2a4af63fef52c2d6e';  
97 - // console.log('strmd5-------->'+strmd5);  
98 - strmd5 = md5(strmd5);  
99 - strmd5 = strmd5.toUpperCase();  
100 - return strmd5; 68 +var getSign = function (objb) {
  69 + var compare = function (obj1, obj2) {
  70 + var val1 = obj1.keyname;
  71 + var val2 = obj2.keyname;
  72 + if (val1 < val2) {
  73 + return -1;
  74 + } else if (val1 > val2) {
  75 + return 1;
  76 + } else {
  77 + return 0;
  78 + }
  79 + }
  80 + objb.sort(compare);
  81 + var strmd5 = '14318527b13840c2a4af63fef52c2d6e';
  82 + for (var i = 0; i < objb.length; i++) {
  83 + if (objb[i].value != null && objb[i].value != '') {
  84 + strmd5 += objb[i].keyname + objb[i].value;
  85 + }
  86 + }
  87 + strmd5 += '14318527b13840c2a4af63fef52c2d6e';
  88 + // console.log('strmd5-------->'+strmd5);
  89 + strmd5 = md5(strmd5);
  90 + strmd5 = strmd5.toUpperCase();
  91 + return strmd5;
101 } 92 }
102 -  
103 //获取盐值 93 //获取盐值
104 -var getSalt = function() {  
105 - var len = parseInt(32);  
106 - var $chars = 'ABCDEFGHJKMNPQRSTWXYZabcdefhijkmnprstwxyz2345678';  
107 - var maxPos = $chars.length;  
108 - var pwd = '';  
109 - for (var i = 0; i < len; i++) {  
110 - pwd += $chars.charAt(Math.floor(Math.random() * maxPos));  
111 - }  
112 - // console.log(pwd);  
113 - return pwd; 94 +var getSalt = function () {
  95 + var len = parseInt(32);
  96 + var $chars = 'ABCDEFGHJKMNPQRSTWXYZabcdefhijkmnprstwxyz2345678';
  97 + var maxPos = $chars.length;
  98 + var pwd = '';
  99 + for (var i = 0; i < len; i++) {
  100 + pwd += $chars.charAt(Math.floor(Math.random() * maxPos));
  101 + }
  102 + // console.log(pwd);
  103 + return pwd;
114 } 104 }
115 -  
116 -var getGlobalUser = function(key) {  
117 - var userInfo = uni.getStorageSync("globalUser");  
118 - if (userInfo != null && userInfo != "" && userInfo != undefined) {  
119 - return userInfo;  
120 - } else {  
121 - return '';  
122 - } 105 +var getGlobalUser = function (key) {
  106 + var userInfo = uni.getStorageSync("globalUser");
  107 + if (userInfo != null && userInfo != "" && userInfo != undefined) {
  108 + return userInfo;
  109 + } else {
  110 + return '';
  111 + }
123 } 112 }
124 -  
125 // 除了金额 113 // 除了金额
126 var moneyFormat = function (val) { 114 var moneyFormat = function (val) {
127 - return (val/100).toFixed(2) 115 + return (val / 100).toFixed(2)
128 } 116 }
129 -  
130 var dateFormat = function (msd) { // 时间转换 117 var dateFormat = function (msd) { // 时间转换
131 var time = msd 118 var time = msd
132 -  
133 if (null != time && "" != time) { 119 if (null != time && "" != time) {
134 -  
135 if (time > 60 && time < 60 * 60) { 120 if (time > 60 && time < 60 * 60) {
136 -  
137 time = parseInt(time / 60.0) + "分钟" + parseInt((parseFloat(time / 60.0) - 121 time = parseInt(time / 60.0) + "分钟" + parseInt((parseFloat(time / 60.0) -
138 -  
139 parseInt(time / 60.0)) * 60) + "秒"; 122 parseInt(time / 60.0)) * 60) + "秒";
140 -  
141 } 123 }
142 -  
143 else if (time >= 60 * 60 && time < 60 * 60 * 24) { 124 else if (time >= 60 * 60 && time < 60 * 60 * 24) {
144 -  
145 time = parseInt(time / 3600.0) + "小时" + parseInt((parseFloat(time / 3600.0) - 125 time = parseInt(time / 3600.0) + "小时" + parseInt((parseFloat(time / 3600.0) -
146 -  
147 parseInt(time / 3600.0)) * 60) + "分钟" + 126 parseInt(time / 3600.0)) * 60) + "分钟" +
148 -  
149 parseInt((parseFloat((parseFloat(time / 3600.0) - parseInt(time / 3600.0)) * 60) - 127 parseInt((parseFloat((parseFloat(time / 3600.0) - parseInt(time / 3600.0)) * 60) -
150 -  
151 parseInt((parseFloat(time / 3600.0) - parseInt(time / 3600.0)) * 60)) * 60) + "秒"; 128 parseInt((parseFloat(time / 3600.0) - parseInt(time / 3600.0)) * 60)) * 60) + "秒";
152 -  
153 } else if (time >= 60 * 60 * 24) { 129 } else if (time >= 60 * 60 * 24) {
154 -  
155 time = parseInt(time / 3600.0 / 24) + "天" + parseInt((parseFloat(time / 3600.0 / 24) - 130 time = parseInt(time / 3600.0 / 24) + "天" + parseInt((parseFloat(time / 3600.0 / 24) -
156 -  
157 parseInt(time / 3600.0 / 24)) * 24) + "小时" + parseInt((parseFloat(time / 3600.0) - 131 parseInt(time / 3600.0 / 24)) * 24) + "小时" + parseInt((parseFloat(time / 3600.0) -
158 -  
159 parseInt(time / 3600.0)) * 60) + "分钟" + 132 parseInt(time / 3600.0)) * 60) + "分钟" +
160 -  
161 parseInt((parseFloat((parseFloat(time / 3600.0) - parseInt(time / 3600.0)) * 60) - 133 parseInt((parseFloat((parseFloat(time / 3600.0) - parseInt(time / 3600.0)) * 60) -
162 -  
163 parseInt((parseFloat(time / 3600.0) - parseInt(time / 3600.0)) * 60)) * 60) + "秒"; 134 parseInt((parseFloat(time / 3600.0) - parseInt(time / 3600.0)) * 60)) * 60) + "秒";
164 -  
165 } 135 }
166 -  
167 else { 136 else {
168 -  
169 time = parseInt(time) + "秒"; 137 time = parseInt(time) + "秒";
170 -  
171 } 138 }
172 -  
173 } 139 }
174 -  
175 return time; 140 return time;
176 } 141 }
177 -  
178 export default { 142 export default {
179 -  
180 - // deviceInfo,  
181 - hs_wxPay_appId,  
182 - public_orgId,  
183 - appName,  
184 - ACompany,  
185 - BCompany,  
186 - appVerson,  
187 - SetToken,  
188 - requestSign,  
189 - moneyFormat,  
190 -  
191 - // 接口  
192 - userLogin,  
193 - indexInfo,  
194 - userLoginout,  
195 - useraboutUs,  
196 - walletAccount,  
197 - //刘淇接口  
198 - getBusinessParkOrderByBusIdForPage,  
199 - getPayOrderByOrderId,  
200 -  
201 - 143 + // deviceInfo,
  144 + hs_wxPay_appId,
  145 + public_orgId,
  146 + appName,
  147 + ACompany,
  148 + BCompany,
  149 + appVerson,
  150 + SetToken,
  151 + requestSign,
  152 + moneyFormat,
  153 + // 接口
  154 + userLogin,
  155 + indexInfo,
  156 + userLoginout,
  157 + useraboutUs,
  158 + walletAccount,
  159 + //刘淇接口
  160 + getBusinessParkOrderByBusIdForPage,
  161 + getPayOrderByOrderId,
202 162
203 163
204 164
205 165
206 166
  167 + //陈彪接口
  168 + rechargeList,
207 169
208 170
209 - //陈彪接口  
210 - rechargeList,  
211 171
212 172
213 173
pages/parkRecordList/recordDetail.vue
1 <template> 1 <template>
2 <view class="container"> 2 <view class="container">
3 - 3 +
4 <view class="uni-title uni-common-pl recordCarNum">车牌号码:{{carNumber}}</view> 4 <view class="uni-title uni-common-pl recordCarNum">车牌号码:{{carNumber}}</view>
5 <view class="uni-list" style="margin-bottom: 4px"> 5 <view class="uni-list" style="margin-bottom: 4px">
6 <view class="uni-list-cell recordPadding"> 6 <view class="uni-list-cell recordPadding">
@@ -17,7 +17,7 @@ @@ -17,7 +17,7 @@
17 入场时间 17 入场时间
18 </view> 18 </view>
19 <view class="uni-list-cell-db"> 19 <view class="uni-list-cell-db">
20 - <uni-dateformat :date="parkInTime" format="yyyy-MM-dd hh:mm:ss"></uni-dateformat> 20 + <uni-dateformat :date="parkInTime" format="yyyy-MM-dd hh:mm:ss"></uni-dateformat>
21 </view> 21 </view>
22 </view> 22 </view>
23 23
@@ -134,7 +134,6 @@ @@ -134,7 +134,6 @@
134 134
135 <script> 135 <script>
136 export default { 136 export default {
137 -  
138 data() { 137 data() {
139 const currentDate = this.getDate({ 138 const currentDate = this.getDate({
140 format: true 139 format: true
@@ -144,29 +143,26 @@ export default { @@ -144,29 +143,26 @@ export default {
144 mycarNumber: '', 143 mycarNumber: '',
145 userIsLogin: false, 144 userIsLogin: false,
146 shownoFlag: 0, 145 shownoFlag: 0,
147 - orderId:'',// 订单号  
148 - plName:'',// 停车场名称  
149 - parkOutTime:'',// 出场时间  
150 - parkInTime:'',// 入场时间  
151 - parkingDuration:'',// 停车时长  
152 - carNumber:'',// 车牌号 146 + orderId: '',// 订单号
  147 + plName: '',// 停车场名称
  148 + parkOutTime: '',// 出场时间
  149 + parkInTime: '',// 入场时间
  150 + parkingDuration: '',// 停车时长
  151 + carNumber: '',// 车牌号
153 } 152 }
154 }, 153 },
155 onLoad(params) { 154 onLoad(params) {
156 wx.showShareMenu({ 155 wx.showShareMenu({
157 withShareTicket: true 156 withShareTicket: true
158 }) 157 })
159 - console.log(params.optionData)  
160 - let option = JSON.parse(params.optionData)  
161 - this.orderId = option.orderId  
162 - this.plName = option.plName  
163 - this.parkOutTime = option.parkOutTime  
164 - this.parkInTime = option.parkInTime  
165 - this.parkingDuration = option.parkingDuration  
166 - this.carNumber = option.carNumber  
167 -  
168 -  
169 - 158 + // console.log(params.optionData)
  159 + // let option = JSON.parse(params.optionData)
  160 + // this.orderId = option.orderId
  161 + // this.plName = option.plName
  162 + // this.parkOutTime = option.parkOutTime
  163 + // this.parkInTime = option.parkInTime
  164 + // this.parkingDuration = 3600
  165 + // this.carNumber = option.carNumber
170 console.log(this.orderId) 166 console.log(this.orderId)
171 this.getPayOrderByOrderId(); 167 this.getPayOrderByOrderId();
172 }, 168 },
@@ -203,7 +199,7 @@ export default { @@ -203,7 +199,7 @@ export default {
203 method: 'POST', 199 method: 'POST',
204 data: that.$common.requestSign(paramsData) 200 data: that.$common.requestSign(paramsData)
205 }).then(res => { 201 }).then(res => {
206 - console.log(res) 202 + console.log(res)
207 }) 203 })
208 }, 204 },
209 bindDateChange: function (e) { 205 bindDateChange: function (e) {
@@ -251,10 +247,12 @@ export default { @@ -251,10 +247,12 @@ export default {
251 display: flex; 247 display: flex;
252 justify-content: space-between; 248 justify-content: space-between;
253 } 249 }
254 - .colorBlue{ 250 +
  251 + .colorBlue {
255 color: #0A98D5; 252 color: #0A98D5;
256 } 253 }
257 - .colorGreen{ 254 +
  255 + .colorGreen {
258 color: #1AAD19; 256 color: #1AAD19;
259 } 257 }
260 </style> 258 </style>