deguodaigou/pages/yue/yue.js

38 lines
854 B
JavaScript
Raw Normal View History

2019-12-28 10:13:48 +08:00
import bin from "../../utils/bin"
Page({
2019-12-23 10:04:09 +08:00
data: {
2019-12-28 10:13:48 +08:00
money:"",
list:[]
2019-12-23 10:04:09 +08:00
},
2019-12-28 10:13:48 +08:00
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
})
})
})
2019-12-23 10:04:09 +08:00
}
2019-12-28 10:13:48 +08:00
})