Commit 297a096b by fengzhaoyu

MOD: 修改钱补零

parent 4db97799
...@@ -12,16 +12,16 @@ const $http = (url, data, type, loadingType) => { ...@@ -12,16 +12,16 @@ const $http = (url, data, type, loadingType) => {
let loginTime = hasToken.expires_in || ''; // 用户登陆时间 let loginTime = hasToken.expires_in || ''; // 用户登陆时间
let token = hasToken.access_token || ''; let token = hasToken.access_token || '';
let refresh_token = hasToken.refresh_token // 刷新token let refresh_token = hasToken.refresh_token // 刷新token
let mingUserId = dd.getStorageSync({ key: 'mingUserId' }.data) let mingUserId = dd.getStorageSync({ key: 'mingUserId' }).data
// 时间戳未过期 // 时间戳未过期
if(!!hasToken && ((new Date()).getTime() - hasToken.loginTime < hasToken.expires_in * 1000)){ if(!!hasToken && ((new Date()).getTime() - hasToken.loginTime < hasToken.expires_in * 1000)){
// if(!!hasToken && ((new Date()).getTime() - hasToken.loginTime)< 30 * 1000){
data.orgId = dd.corpId; data.orgId = dd.corpId;
let sendData = ''; let sendData = '';
for(let key in data){ for(let key in data){
sendData = `${sendData}${key}=${data[key]}&` sendData = `${sendData}${key}=${data[key]}&`
} }
sendData = sendData.substring(0, sendData.length - 1); sendData = sendData.substring(0, sendData.length - 1);
console.log(sendData);
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
dd.httpRequest({ dd.httpRequest({
headers: { headers: {
...@@ -33,6 +33,7 @@ const $http = (url, data, type, loadingType) => { ...@@ -33,6 +33,7 @@ const $http = (url, data, type, loadingType) => {
dataType: 'json', dataType: 'json',
success: function(res) { success: function(res) {
if(res.data.resultCode === 0) { if(res.data.resultCode === 0) {
console.log(res.data.data)
return resolve(res.data.data) return resolve(res.data.data)
} else { } else {
// 修改系统繁忙时loading隐藏 // 修改系统繁忙时loading隐藏
...@@ -44,6 +45,7 @@ const $http = (url, data, type, loadingType) => { ...@@ -44,6 +45,7 @@ const $http = (url, data, type, loadingType) => {
} }
}, },
fail: function(res) { fail: function(res) {
console.log('调用失败')
dd.hideLoading(); dd.hideLoading();
dd.alert({ dd.alert({
content: '系统繁忙', content: '系统繁忙',
...@@ -55,8 +57,9 @@ const $http = (url, data, type, loadingType) => { ...@@ -55,8 +57,9 @@ const $http = (url, data, type, loadingType) => {
} }
// 时间戳过期 // 时间戳过期
else { else {
dd.getNetworkType({ return new Promise((resolve,reject) => {
success: (res) => { dd.getNetworkType({
success: (res) => {
// 有网的情况下 // 有网的情况下
if (res.networkAvailable) { if (res.networkAvailable) {
dd.httpRequest({ dd.httpRequest({
...@@ -64,11 +67,9 @@ const $http = (url, data, type, loadingType) => { ...@@ -64,11 +67,9 @@ const $http = (url, data, type, loadingType) => {
'Authorization': 'Basic bWluZ3BheS1waG9uZTptaW5ncGF5LXBob25l', 'Authorization': 'Basic bWluZ3BheS1waG9uZTptaW5ncGF5LXBob25l',
'Content-Type': 'application/x-www-form-urlencoded' 'Content-Type': 'application/x-www-form-urlencoded'
}, },
dataType: 'json',
data: { data: {
username: mingUserId, grant_type: 'refresh_token',
password: mingUserId,
scope: 'server',
grant_type: 'password',
refresh_token: refresh_token refresh_token: refresh_token
}, },
url:`http://${app.globalData.globalUrl}/auth/oauth/token`, url:`http://${app.globalData.globalUrl}/auth/oauth/token`,
...@@ -83,7 +84,13 @@ const $http = (url, data, type, loadingType) => { ...@@ -83,7 +84,13 @@ const $http = (url, data, type, loadingType) => {
loginTime: (new Date()).getTime() loginTime: (new Date()).getTime()
} }
}) })
$http(url, data, type) dd.setStorageSync({
key: 'a',
data: 1
})
$http(url, data, type).then(res => {
return resolve(res)
})
}, },
fail: function(res) { fail: function(res) {
console.log('err',res) console.log('err',res)
...@@ -94,44 +101,6 @@ const $http = (url, data, type, loadingType) => { ...@@ -94,44 +101,6 @@ const $http = (url, data, type, loadingType) => {
dd.hideLoading() dd.hideLoading()
} }
}) })
// dd.getAuthCode({
// success:function(resultCode){
// dd.httpRequest({
// headers: {"Content-Type": "application/json"},
// url: `http://${app.globalUrl}/v1/auth/token?version=v1&code=${resultCode.authCode}&orgId=${dd.corpId}`,
// method: 'POST',
// dataType: 'json',
// success: function(res) {
// // 全局存储用户信息token和用户信息
// const data = res.data.data
// // 更新用户内部信息
// dd.setStorageSync({
// key: 'token',
// data: {
// access_token: data.accessToken.access_token,
// token_type: data.accessToken.token_type,
// expires_in: data.accessToken.expires_in,
// loginTime: (new Date()).getTime()
// }
// });
// dd.setStorageSync({
// key: 'userId',
// data: data.oapiUser.userid
// });
// $http(url, data, type)
// },
// fail: function(res) {
// console.log(res)
// }
// });
// },
// fail:function(err){
// dd.alert({
// content: '系统繁忙',
// buttonText: '确定'
// });
// }
// });
} }
else { else {
dd.alert({ dd.alert({
...@@ -141,7 +110,11 @@ const $http = (url, data, type, loadingType) => { ...@@ -141,7 +110,11 @@ const $http = (url, data, type, loadingType) => {
dd.hideLoading() dd.hideLoading()
} }
} }
}); });
})
} }
} }
export default {$http} export default {$http}
\ No newline at end of file
...@@ -14,11 +14,12 @@ App({ ...@@ -14,11 +14,12 @@ App({
}, },
// axios.defaults.baseURL = 'http://192.168.1.106:8400' // 本地荣 // axios.defaults.baseURL = 'http://192.168.1.106:8400' // 本地荣
// axios.defaults.baseURL = 'http://192.168.1.102:8400' // 本地钱 // axios.defaults.baseURL = 'http://192.168.1.102:8400' // 本地钱
// axios.defaults.baseURL = 'http://139.196.213.18:8400' // beta环境 // axios.defaults.baseURL = 'http://139.224.55.14:9999' // beta环境
globalData: { globalData: {
loadingType: 0, loadingType: 0,
globalUrl: '192.168.1.101:9999' // globalUrl: '192.168.1.101:9999'
// globalUrl: '192.168.1.102:8400' // globalUrl: '192.168.1.102:9999'
// globalUrl: '139.196.213.18:8400' globalUrl: '139.224.55.14:9999'
// globalUrl: ':9999'
} }
}); });
...@@ -35,6 +35,7 @@ Page({ ...@@ -35,6 +35,7 @@ Page({
content: '系统繁忙', content: '系统繁忙',
buttonText: '确定' buttonText: '确定'
}); });
dd.hideLoading()
} }
} }
} }
......
...@@ -27,7 +27,8 @@ Page({ ...@@ -27,7 +27,8 @@ Page({
}) })
}, },
endTimeToStr (time) { endTimeToStr (time) {
let timeData = new Date(parseInt(time)) time = time.replace(/\-/g, "/")
let timeData = new Date(time)
let year = timeData.getFullYear() let year = timeData.getFullYear()
let month = timeData.getMonth() + 1 let month = timeData.getMonth() + 1
let date = timeData.getDate() let date = timeData.getDate()
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
<view> <view>
<view class="listType"> <view class="listType">
<text>充值</text> <text>充值</text>
<text>+{{item.orderAmount}}</text> <text>+{{item.orderAmount.toFixed(2)}}</text>
</view> </view>
<view class="listTime"> <view class="listTime">
<text>{{item.createDate}}</text> <text>{{item.createDate}}</text>
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
<view> <view>
<view class="listType"> <view class="listType">
<text>消费</text> <text>消费</text>
<text>-{{item.orderAmount}}</text> <text>-{{item.orderAmount.toFixed(2)}}</text>
</view> </view>
<view class="listTime"> <view class="listTime">
<text>{{item.createDate}}</text> <text>{{item.createDate}}</text>
...@@ -41,7 +41,7 @@ ...@@ -41,7 +41,7 @@
<view> <view>
<view class="listType"> <view class="listType">
<text>退款</text> <text>退款</text>
<text style="color: #FFC64F">+{{item.orderAmount}}</text> <text style="color: #FFC64F">+{{item.orderAmount.toFixed(2)}}</text>
</view> </view>
<view class="listTime">{{item.createDate}}</view> <view class="listTime">{{item.createDate}}</view>
</view> </view>
......
...@@ -12,7 +12,6 @@ Page({ ...@@ -12,7 +12,6 @@ Page({
onLoad(query) { onLoad(query) {
this.resetData() this.resetData()
dd.setNavigationBar({title: '账单记录'}); dd.setNavigationBar({title: '账单记录'});
console.log(query);
this.setData({ this.setData({
subsidyNo: query.subsidyNo subsidyNo: query.subsidyNo
}) })
...@@ -27,7 +26,6 @@ Page({ ...@@ -27,7 +26,6 @@ Page({
}) })
}, },
queryListPaymentRecord(str) { queryListPaymentRecord(str) {
console.log(str)
const _that = this; const _that = this;
let data = { let data = {
currentPage: this.data.currentPage, currentPage: this.data.currentPage,
...@@ -36,11 +34,12 @@ Page({ ...@@ -36,11 +34,12 @@ Page({
subsidyNo: this.data.subsidyNo subsidyNo: this.data.subsidyNo
} }
$http.$http('isv/consume/list_payment_record', data, 'GET').then((res) => { $http.$http('isv/consume/list_payment_record', data, 'GET').then((res) => {
console.log('allowanceRecordList.js'+ res) console.log('allowanceRecordList.js',res)
let dataList = [...res.recordList]; let dataList = [...res.recordList];
let recordAlliwanceListDataSource = _that.data.recordAlliwanceListData let recordAlliwanceListDataSource = _that.data.recordAlliwanceListData
if (dataList.length > 0) { if (dataList.length > 0) {
dataList.map((item, index) => { dataList.map((item, index) => {
console.log('item.createDate',item.createDate)
item.createDate = _that.timeToStr(item.createDate) item.createDate = _that.timeToStr(item.createDate)
recordAlliwanceListDataSource.push(item) recordAlliwanceListDataSource.push(item)
}) })
...@@ -68,7 +67,9 @@ Page({ ...@@ -68,7 +67,9 @@ Page({
this.queryListPaymentRecord() this.queryListPaymentRecord()
}, },
timeToStr (time) { timeToStr (time) {
let timeData = new Date(parseInt(time)) time = time.replace(/\-/g, "/")
let timeData = new Date(time)
console.log('timeData',timeData)
let year = timeData.getFullYear() let year = timeData.getFullYear()
let month = timeData.getMonth() + 1 let month = timeData.getMonth() + 1
let date = timeData.getDate() let date = timeData.getDate()
......
...@@ -2,18 +2,18 @@ ...@@ -2,18 +2,18 @@
<view class="title" a:if="{{recordData.payTypeCode === 'INTERNAL_RECHAGE' || recordData.payTypeCode === 'EXTERNAL_ALI_RECHAGE'}}">充值</view> <view class="title" a:if="{{recordData.payTypeCode === 'INTERNAL_RECHAGE' || recordData.payTypeCode === 'EXTERNAL_ALI_RECHAGE'}}">充值</view>
<view class="title" a:else="{{recordData.status === 'SUCCESS' && recordData.payTypeCode === 'INTERNAL_CONSUME'}}">消费</view> <view class="title" a:else="{{recordData.status === 'SUCCESS' && recordData.payTypeCode === 'INTERNAL_CONSUME'}}">消费</view>
<view class="title" a:else="{{recordData.status === 'REFUND_SUCCESS' && recordData.payTypeCode === 'INTERNAL_CONSUME'}}">退款</view> <view class="title" a:else="{{recordData.status === 'REFUND_SUCCESS' && recordData.payTypeCode === 'INTERNAL_CONSUME'}}">退款</view>
<view class="money" a:if="{{recordData.payTypeCode === 'INTERNAL_RECHAGE' || recordData.payTypeCode === 'EXTERNAL_ALI_RECHAGE'}}">+{{recordData.orderAmount}}</view> <view class="money" a:if="{{recordData.payTypeCode === 'INTERNAL_RECHAGE' || recordData.payTypeCode === 'EXTERNAL_ALI_RECHAGE'}}">+{{recordData.orderAmount.toFixed(2)}}</view>
<view class="money" a:else="{{recordData.status === 'SUCCESS' && recordData.payTypeCode === 'INTERNAL_CONSUME'}}">-{{recordData.orderAmount}}</view> <view class="money" a:else="{{recordData.status === 'SUCCESS' && recordData.payTypeCode === 'INTERNAL_CONSUME'}}">-{{recordData.orderAmount.toFixed(2)}}</view>
<view class="money" a:else="{{recordData.status === 'REFUND_SUCCESS' && recordData.payTypeCode === 'INTERNAL_CONSUME'}}">+{{recordData.orderAmount}}</view> <view class="money" a:else="{{recordData.status === 'REFUND_SUCCESS' && recordData.payTypeCode === 'INTERNAL_CONSUME'}}">+{{recordData.orderAmount.toFixed(2)}}</view>
<view class="{{recordData.payTypeCode === 'INTERNAL_CONSUME' && recordData.orderStatus === 'REFUND_SUCCESS' ? 'type colorChange' : 'type'}}">{{recordData.payTypeCode === 'INTERNAL_CONSUME' && recordData.orderStatus === 'REFUND_SUCCESS' ? '已退款' : '交易成功'}}</view> <view class="{{recordData.payTypeCode === 'INTERNAL_CONSUME' && recordData.orderStatus === 'REFUND_SUCCESS' ? 'type colorChange' : 'type'}}">{{recordData.payTypeCode === 'INTERNAL_CONSUME' && recordData.orderStatus === 'REFUND_SUCCESS' ? '已退款' : '交易成功'}}</view>
<view class="detailsItem" a:if="{{recordData.status === 'SUCCESS' && recordData.payTypeCode === 'INTERNAL_CONSUME'}}"> <view class="detailsItem" a:if="{{recordData.status === 'SUCCESS' && recordData.payTypeCode === 'INTERNAL_CONSUME'}}">
<view> <view>
<view>实付金额</view> <view>实付金额</view>
<view>-{{recordData.realityAmount}}</view> <view>-{{recordData.realityAmount.toFixed(2)}}</view>
</view> </view>
<view> <view>
<view>津贴金额</view> <view>津贴金额</view>
<view>-{{recordData.subsidyAmount}}</view> <view>-{{recordData.subsidyAmountc}}</view>
</view> </view>
<view> <view>
<view>创建时间</view> <view>创建时间</view>
...@@ -31,11 +31,11 @@ ...@@ -31,11 +31,11 @@
<view class="detailsItem" a:if="{{recordData.status === 'REFUND_SUCCESS' && recordData.payTypeCode === 'INTERNAL_CONSUME'}}"> <view class="detailsItem" a:if="{{recordData.status === 'REFUND_SUCCESS' && recordData.payTypeCode === 'INTERNAL_CONSUME'}}">
<view> <view>
<view>退款金额</view> <view>退款金额</view>
<view>+{{recordData.realityAmount}}</view> <view>+{{recordData.realityAmount.toFixed(2)}}</view>
</view> </view>
<view> <view>
<view>退款津贴</view> <view>退款津贴</view>
<view>+{{recordData.subsidyAmount}}</view> <view>+{{recordData.subsidyAmount.toFixed(2)}}</view>
</view> </view>
<view> <view>
<view>创建时间</view> <view>创建时间</view>
...@@ -49,7 +49,7 @@ ...@@ -49,7 +49,7 @@
<view class="detailsItem" a:if="{{recordData.payTypeCode === 'INTERNAL_RECHAGE' || recordData.payTypeCode === 'EXTERNAL_ALI_RECHAGE'}}"> <view class="detailsItem" a:if="{{recordData.payTypeCode === 'INTERNAL_RECHAGE' || recordData.payTypeCode === 'EXTERNAL_ALI_RECHAGE'}}">
<view> <view>
<view>充值金额</view> <view>充值金额</view>
<view>+{{recordData.orderAmount}}</view> <view>+{{recordData.orderAmount.toFixed(2)}}</view>
</view> </view>
<view> <view>
<view>创建时间</view> <view>创建时间</view>
......
...@@ -17,7 +17,8 @@ Page({ ...@@ -17,7 +17,8 @@ Page({
this.queryListPaymentRecord() this.queryListPaymentRecord()
}, },
timeToStr (time) { timeToStr (time) {
let timeData = new Date(parseInt(time)) time = time.replace(/\-/g, "/")
let timeData = new Date(time)
let year = timeData.getFullYear() let year = timeData.getFullYear()
let month = timeData.getMonth() + 1 let month = timeData.getMonth() + 1
let date = timeData.getDate() let date = timeData.getDate()
......
...@@ -19,6 +19,7 @@ ...@@ -19,6 +19,7 @@
<view touchStart="touchStyle" onTap="navigatorToAllowanceList"><image mode="scaleToFill" src="./../../assets/allowance.png"/>津贴</view> <view touchStart="touchStyle" onTap="navigatorToAllowanceList"><image mode="scaleToFill" src="./../../assets/allowance.png"/>津贴</view>
<view touchStart="touchStyle" onTap="navigatorToRecordList"><image mode="scaleToFill" src="./../../assets/bill.png"/>账单</view> <view touchStart="touchStyle" onTap="navigatorToRecordList"><image mode="scaleToFill" src="./../../assets/bill.png"/>账单</view>
</view> </view>
<!-- <button size="default" type="primary" onTap="clear">琴姐专用按钮</button> -->
<!-- <!--
<view onTap="navigatorToAlipayRecharge"> <view onTap="navigatorToAlipayRecharge">
......
...@@ -8,6 +8,13 @@ Page({ ...@@ -8,6 +8,13 @@ Page({
realityBalance: '', realityBalance: '',
cardNo: '' cardNo: ''
}, },
// clear() {
// console.log(11111111111)
// dd.removeStorageSync({
// key: 'token.data.access_token',
// });
// },
onLoad(query) { onLoad(query) {
const _that = this; const _that = this;
dd.setNavigationBar({ dd.setNavigationBar({
...@@ -39,7 +46,6 @@ Page({ ...@@ -39,7 +46,6 @@ Page({
ddUserId: ddUserId ddUserId: ddUserId
} }
$http.$http('isv/account/queryAccountDetail', data, 'GET').then((res) => { $http.$http('isv/account/queryAccountDetail', data, 'GET').then((res) => {
console.log(res)
this.setData({ this.setData({
name: res.name, name: res.name,
realityBalance: res.realityBalance, realityBalance: res.realityBalance,
......
...@@ -20,6 +20,7 @@ Page({ ...@@ -20,6 +20,7 @@ Page({
title: '付款码' title: '付款码'
}); });
}, },
// 点击刷新二维码
clickRefreshQRcode(){ clickRefreshQRcode(){
const _that = this; const _that = this;
clearInterval(timeRefreshQRcode); clearInterval(timeRefreshQRcode);
...@@ -28,21 +29,113 @@ Page({ ...@@ -28,21 +29,113 @@ Page({
_that.refreshQRcode(); _that.refreshQRcode();
}, 55000); }, 55000);
}, },
// 生成二维码
refreshQRcode(){ refreshQRcode(){
const _that = this;
let hasToken = dd.getStorageSync({ key: 'token' }).data;
let token = dd.getStorageSync({ key: 'token' }).data.access_token; let token = dd.getStorageSync({ key: 'token' }).data.access_token;
let timestamp = (new Date()).getTime(); let expires_in = dd.getStorageSync({ key: 'token' }).data.expires_in;
let url = aes.getAES(JSON.stringify({ let refresh_token = dd.getStorageSync({ key: 'token' }).data.refresh_token;
"token": token,
"timestamp": timestamp, if(!!hasToken && ((new Date()).getTime() - hasToken.loginTime < (hasToken.expires_in - 60) * 1000)) {
})) // if(!!hasToken && ((new Date()).getTime() - hasToken.loginTime < 30 * 1000)) {
let size = 272 let timestamp = (new Date()).getTime();
let ecc = 2 let url = aes.getAES(JSON.stringify({
let name = 'myQrcode' "token": token,
const ctx = dd.createCanvasContext(name); "timestamp": timestamp,
QR.draw(url, ctx, size, Number(ecc)); }))
let size = 272
let ecc = 2
let name = 'myQrcode'
console.log(111111111111)
const ctx = dd.createCanvasContext(name);
QR.draw(url, ctx, size, Number(ecc));
console.log(11111111111111)
}
else {
dd.getNetworkType({
success: (res => {
// 网络可用的情况下 刷新token
if(res.networkAvailable) {
dd.httpRequest({
headers: {
'Authorization': 'Basic bWluZ3BheS1waG9uZTptaW5ncGF5LXBob25l',
'Content-Type': 'application/x-www-form-urlencoded'
},
url: `http://${app.globalData.globalUrl}/auth/oauth/token`,
dataType: 'json',
data: {
grant_type: 'refresh_token',
refresh_token: refresh_token
},
method: 'POST',
success: function(res) {
console.log(res)
dd.setStorageSync({
key: 'token',
data: {
access_token: res.data.access_token,
expires_in: res.data.expires_in,
refresh_token: res.data.refresh_token,
loginTime: (new Date()).getTime()
}
})
_that.setData({
b:1
})
hasToken = dd.getStorageSync({ key: 'token' }).data;
token = dd.getStorageSync({ key: 'token' }).data.access_token;
expires_in = dd.getStorageSync({ key: 'token' }).data.expires_in;
refresh_token = dd.getStorageSync({ key: 'token' }).data.refresh_token;
let timestamp = (new Date()).getTime();
let url = aes.getAES(JSON.stringify({
"token": token,
"timestamp": timestamp,
}))
let size = 272
let ecc = 2
let name = 'myQrcode'
const ctx = dd.createCanvasContext(name);
QR.draw(url, ctx, size, Number(ecc));
},
fail: function(res) {
dd.alert({
content: '系统繁忙',
buttonText: '确定'
})
dd.hideLoading()
}
})
}
else {
dd.alert({
content: '请连接网络后重新进入',
buttonText: '确定'
})
dd.hideLoading()
}
})
})
}
// let timestamp = (new Date()).getTime();
// let url = aes.getAES(JSON.stringify({
// "token": token,
// "timestamp": timestamp,
// }))
// let size = 272
// let ecc = 2
// let name = 'myQrcode'
// const ctx = dd.createCanvasContext(name);
// QR.draw(url, ctx, size, Number(ecc));
}, },
onReady() { onReady() {
// 页面加载完成 // 页面加载完成
console.log(' onReady')
clearInterval(timeRefreshQRcode); clearInterval(timeRefreshQRcode);
const _that = this; const _that = this;
_that.refreshQRcode(); _that.refreshQRcode();
...@@ -51,9 +144,10 @@ Page({ ...@@ -51,9 +144,10 @@ Page({
}, 55000); }, 55000);
}, },
onShow() { onShow() {
console.log('进入onshow')
//刷新二维码 //刷新二维码
const _that = this;
clearInterval(timeRefreshQRcode); clearInterval(timeRefreshQRcode);
const _that = this;
_that.refreshQRcode(); _that.refreshQRcode();
timeRefreshQRcode = setInterval(function () { timeRefreshQRcode = setInterval(function () {
_that.refreshQRcode(); _that.refreshQRcode();
......
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
<view> <view>
<view class="listType"> <view class="listType">
<text>充值</text> <text>充值</text>
<text>+{{item.orderAmount}}</text> <text>+{{item.orderAmount.toFixed(2)}}</text>
</view> </view>
<view class="listTime"> <view class="listTime">
<text>{{item.createDate}}</text> <text>{{item.createDate}}</text>
...@@ -45,7 +45,7 @@ ...@@ -45,7 +45,7 @@
<view> <view>
<view class="listType"> <view class="listType">
<text>消费</text> <text>消费</text>
<text>-{{item.orderAmount}}</text> <text>-{{item.orderAmount.toFixed(2)}}</text>
</view> </view>
<view class="listTime"> <view class="listTime">
<text>{{item.createDate}}</text> <text>{{item.createDate}}</text>
...@@ -60,7 +60,7 @@ ...@@ -60,7 +60,7 @@
<view> <view>
<view class="listType"> <view class="listType">
<text>退款</text> <text>退款</text>
<text style="color: #FFC64F">+{{item.orderAmount}}</text> <text style="color: #FFC64F">+{{item.orderAmount.toFixed(2)}}</text>
</view> </view>
<view class="listTime">{{item.createDate}}</view> <view class="listTime">{{item.createDate}}</view>
</view> </view>
......
...@@ -119,6 +119,7 @@ Page({ ...@@ -119,6 +119,7 @@ Page({
let recordListDataSource = _that.data.recordListData let recordListDataSource = _that.data.recordListData
if (dataList.length > 0) { if (dataList.length > 0) {
dataList.map((item, index) => { dataList.map((item, index) => {
console.log(' item.createDate', item.createDate)
item.createDate = _that.timeToStr(item.createDate) item.createDate = _that.timeToStr(item.createDate)
recordListDataSource.push(item) recordListDataSource.push(item)
}) })
...@@ -183,7 +184,10 @@ Page({ ...@@ -183,7 +184,10 @@ Page({
this.queryListPaymentRecord() this.queryListPaymentRecord()
}, },
timeToStr (time) { timeToStr (time) {
let timeData = new Date(parseInt(time)) time = time.replace(/\-/g, "/")
let timeData = new Date(time)
console.log('time',time)
console.log('timeData',timeData)
let year = timeData.getFullYear() let year = timeData.getFullYear()
let month = timeData.getMonth() + 1 let month = timeData.getMonth() + 1
let date = timeData.getDate() let date = timeData.getDate()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment