添加组件及页面
This commit is contained in:
@@ -1,43 +1,80 @@
|
||||
import { Subscribe } from "@/utils/subscribe";
|
||||
import { setStorage } from "@/utils/util";
|
||||
import { base } from '@/utils/config';
|
||||
import { checkSesskey, loginStatus, post } from '@/utils/https';
|
||||
import { getStorage, toObject } from '@/utils/util';
|
||||
|
||||
Page({
|
||||
data: {
|
||||
columns: [
|
||||
{ title: "我的收藏", width: "100px", dataIndex: "name" },
|
||||
{ title: "我的点赞", width: "200px", dataIndex: "count" },
|
||||
{ title: "我的评论", width: "300px", dataIndex: "desc" },
|
||||
],
|
||||
data: [
|
||||
// { name: "张三", count: 1, desc: "11111" },
|
||||
// { name: "张三", count: 1, desc: "11111" },
|
||||
// { name: "张三", count: 1, desc: "11111" },
|
||||
// { name: "张三", count: 1, desc: "11111" },
|
||||
// { name: "张三", count: 1, desc: "11111" },
|
||||
// { name: "张三", count: 1, desc: "11111" },
|
||||
// { name: "张三", count: 1, desc: "11111" },
|
||||
// { name: "张三", count: 1, desc: "11111" },
|
||||
// { name: "张三", count: 1, desc: "11111" },
|
||||
// { name: "张三", count: 1, desc: "11111" },
|
||||
// { name: "张三", count: 1, desc: "11111" },
|
||||
],
|
||||
version: wx.getAccountInfoSync().miniProgram.version || '开发1.0',
|
||||
isLogin: false,
|
||||
host: base.apiHost,
|
||||
user_info: {},
|
||||
company_info: {},
|
||||
loading: true,
|
||||
// staffType: StaffType,
|
||||
company_list: [],
|
||||
show: false,
|
||||
hideTabKeys: [],
|
||||
},
|
||||
change() {
|
||||
setStorage("isLogin", 1);
|
||||
Subscribe.set("isLogin", "zzzuz");
|
||||
// wx.navigateTo({ url: "/pages/my/my" });
|
||||
init() {
|
||||
const companyInfo = toObject(getStorage('company_info'));
|
||||
this.setData({
|
||||
user_info: toObject(getStorage('user_info')),
|
||||
company_info: companyInfo,
|
||||
});
|
||||
},
|
||||
searchChange(e: any) {
|
||||
console.log(e);
|
||||
},
|
||||
ok() {
|
||||
console.log("ok");
|
||||
// 腾讯文档
|
||||
txDoc() {
|
||||
return;
|
||||
wx.navigateToMiniProgram({
|
||||
appId: 'wxd45c635d754dbf59',
|
||||
path:
|
||||
`pages/detail/detail?url=` +
|
||||
encodeURIComponent('https://docs.qq.com/aio/DS2NCRFFseG9Ma3Ja?p=7umJTJ6bznQtaBK2RSLmPD'),
|
||||
});
|
||||
},
|
||||
handleLogin(e: any) {
|
||||
this.setData({ isLogin: e.detail });
|
||||
if (e.detail) {
|
||||
this.init();
|
||||
}
|
||||
},
|
||||
/**
|
||||
* 生命周期函数--监听页面加载
|
||||
*/
|
||||
onLoad() {},
|
||||
|
||||
onLoad() {
|
||||
this.setData({ loading: true });
|
||||
loginStatus()
|
||||
.then(() => {
|
||||
console.log('ssss');
|
||||
this.setData({ isLogin: true, loading: false });
|
||||
this.init();
|
||||
})
|
||||
.catch((err) => {
|
||||
this.setData({ isLogin: false, loading: false });
|
||||
console.log('调用登录状态请求失败', err);
|
||||
});
|
||||
},
|
||||
loginOut() {
|
||||
wx.showModal({
|
||||
title: '确认退出?',
|
||||
// content: '',
|
||||
complete: (res: any) => {
|
||||
if (res.confirm) {
|
||||
post('Applet/loginOut').then((res: any) => {
|
||||
this.setData({ isLogin: false });
|
||||
checkSesskey({ showLoading: false, showError: false })
|
||||
.then((res) => {})
|
||||
.catch((err) => {
|
||||
console.log('checkSesskey', err);
|
||||
});
|
||||
});
|
||||
}
|
||||
},
|
||||
});
|
||||
},
|
||||
/**
|
||||
* 生命周期函数--监听页面初次渲染完成
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user