You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

134 lines
2.5 KiB

12 months ago
import { urlPrefix } from '../../config/index'
Page({
/**
* 页面的初始数据
*/
data: {
id: 0,
jd_count: 0,
pay_status: 0
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
},
onShow() {
this.loadData();
this.getSystemInfo();
this.getTabBar().init();
},
loadData() {
let that = this;
let _id = wx.getStorageSync('id');
wx.request({
url: urlPrefix + '/QingLong/HuiYa/wxGetUserJinDou',
method: 'POST',
header: {
'content-type': 'application/x-www-form-urlencoded'
},
data: {
token: wx.getStorageSync('token'),
},
success(res) {
if (res.data.success) {
if (res.data.token) {
wx.setStorageSync('token', res.data.token);
}
that.setData({
id: _id,
jd_count: res.data.jd_count
})
} else {
console.log('获取token失败' + res.errMsg)
}
}
});
},
getSystemInfo() {
let that = this;
wx.getSystemInfo({
success(res) {
let platform = res.platform;
if (platform == 'android' || platform == 'windows' || platform == 'devtools') {
that.setData({ pay_status: 1 });
}
}
})
},
topupHandle(e) {
wx.navigateTo({
url: '/pages/topup/index',
});
},
clickHandAITxt(e){
wx.navigateTo({
url: '/pages/text/index',
});
},
12 months ago
clickHandAIVid(e){
wx.navigateTo({
url: '/pages/video/index',
});
},
clickHandAIMuc(e){
wx.navigateTo({
url: '/pages/music/index',
});
},
12 months ago
clickHandle(e) {
wx.navigateTo({
url: '/pages/agree_privacy/index',
});
},
clickHandlezf(e) {
wx.navigateTo({
url: '/pages/agree/index',
});
},
clickHandjl(e) {
wx.navigateTo({
url: '/pages/records/index',
});
},
11 months ago
testHandle(e) {
wx.navigateToMiniProgram({
appId: 'wxf077d1a84a951991',
path: 'pages/labor-union/labor-union',
extraData: {
name: '张三',
phone:'13888888888'
},
envVersion: 'trial',
success(res) {
console.log(res);
}
});
},
12 months ago
exitHandle(e) {
wx.showModal({
title: '提示',
content: '您确定要退出吗?',
success(res) {
if (res.confirm) {
wx.exitMiniProgram({ success: (res) => { } });
}
}
});
}
})