deguodaigou/pages/yue/yue.js
2019-12-28 10:13:48 +08:00

38 lines
854 B
JavaScript

import bin from "../../utils/bin"
Page({
data: {
money:"",
list:[]
},
onLoad(a) {
bin.request({
url:"User/validateOpenid"
}).then((res)=>{
console.log(res)
if(res.data.code == 200){
this.setData({
money : res.data.data.user_money
})
}
})
bin.getuserid().then((userid) => {
bin.request({
url: "User/account",
urldata: {
user_id : userid,
page:0
}
}).then((res)=>{
console.log(res)
for(let i in res.data.result){
let linshi = res.data.result[i].change_time.split(" ")
res.data.result[i].date = linshi[0]
res.data.result[i].time = linshi[1]
}
this.setData({
list:res.data.result
})
})
})
}
})