2024-05-24 17:24:28 +08:00

71 lines
1.4 KiB
TypeScript

// e:\project\dy_video_all\初晴剧场\pages\my\my.ts
import { httpRequest } from "../../utils/httpReques";
Page({
myModal: null as any,
data: {
userInfo: {},
platform: '',
historyList: []
},
onLoad() {
tt.getSystemInfo({
success: (res: any) => {
this.setData({
platform: res.platform
})
}
})
},
onShow() {
httpRequest('/user', 'POST').then((res: any) => {
if (res.status == 1) {
this.setData({
userInfo: res.data.info,
})
}
})
httpRequest('/history', 'POST').then((res: any) => {
console.log(res, "history")
if (res.status == 1 && Array.isArray(res.data)) {
this.setData({
historyList: res.data,
})
}
})
},
handelTipsGold() {
this.myModal?.show?.();
},
myModalRef(ref: any) {
this.myModal = ref
},
toPathVideo(ev: any) {
const sid = ev.currentTarget.dataset.sid;
tt.navigateTo({
url: `/pages/videoDetail/videoDetail?sid=${sid}`,
});
},
toPathRechargeRecord() {
tt.navigateTo({
url: `/pages/rechargeRecord/rechargeRecord`,
});
},
toPathPay() {
tt.navigateTo({
url: `/pages/pay/pay`,
});
},
toPathSubScribe() {
tt.navigateTo({
url: `/pages/subscribe/subscribe`,
});
},
toPathConsumption() {
tt.navigateTo({
url: `/pages/consumption/consumption`,
});
}
})