You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
133 lines
3.1 KiB
JavaScript
133 lines
3.1 KiB
JavaScript
const app = getApp()
|
|
// let app = null;
|
|
Component({
|
|
data: {
|
|
labelColor: ["#c41d7f", "#096dd9", "#531dab", "#d46b08", "#389e0d", "#08979c", "#cf1322"],
|
|
bgColor: ["#fff0f6", "#e6f7ff", "#f9f0ff", "#fff7e6", "#f6ffed", "#e6fffb", "#fff1f0"],
|
|
corpUserFlag: false,
|
|
},
|
|
properties: {
|
|
// 抽屉高度
|
|
recordList: {
|
|
type: Array,
|
|
value: [],
|
|
},
|
|
isLogin: {
|
|
type: Boolean,
|
|
value: true
|
|
},
|
|
storeJobListSearchForm: {
|
|
type: Object,
|
|
value: {},
|
|
},
|
|
agencyStatus: {
|
|
type: Number,
|
|
value: 0
|
|
},
|
|
hasUserInfo: {
|
|
type: Number,
|
|
value: 0
|
|
},
|
|
selectJob: {
|
|
type: Boolean,
|
|
value: false
|
|
},
|
|
loginUserInfo: {
|
|
type: Object,
|
|
value: {}
|
|
},
|
|
type: {
|
|
type: String,
|
|
value: ''
|
|
}
|
|
|
|
|
|
},
|
|
lifetimes: {
|
|
attached: function () {
|
|
console.log('wx.getStorageSync)', wx.getStorageSync('loginUser'));
|
|
let loginUserInfo = wx.getStorageSync('loginUser')
|
|
// app.getLoginUserTokenInfo().then(() => {
|
|
this.setData({
|
|
corpUserFlag: loginUserInfo.corpUserFlag,
|
|
agencyStatus: loginUserInfo.agencyStatus,
|
|
})
|
|
// });
|
|
|
|
// 在组件实例进入页面节点树时执行
|
|
},
|
|
detached: function () {
|
|
// 在组件实例被从页面节点树移除时执行
|
|
},
|
|
},
|
|
ready () {
|
|
// console.log('app.globalData.loginUserInfo.corpUserFlag', app.globalData.loginUserInfo.corpUserFlag);
|
|
console.log('this.properties.loginUserInfo', this.properties.loginUserInfo);
|
|
// app.getLoginUserTokenInfo().then(() => {
|
|
|
|
// });
|
|
|
|
},
|
|
methods: {
|
|
|
|
goLogin () {
|
|
wx.setStorageSync("comeFromPage", "firstBill");
|
|
wx.navigateTo({
|
|
url: "/pages/login/index",
|
|
});
|
|
},
|
|
stoptap (e) {
|
|
return false;
|
|
},
|
|
getPhoneNumber (e) {
|
|
let that = this
|
|
that.triggerEvent("getPhoneNumber", e.detail);
|
|
},
|
|
collectPaste (e) {
|
|
let that = this
|
|
console.log('collectPaste', e);
|
|
that.triggerEvent("collectPaste", e.currentTarget);
|
|
|
|
},
|
|
getUserInfoBtn (e) {
|
|
let that = this
|
|
console.log('getUserInfoBtn', e);
|
|
that.triggerEvent("getUserInfoBtn", e.currentTarget);
|
|
|
|
},
|
|
goDetail (e) {
|
|
console.log(e);
|
|
var that = this;
|
|
if (!that.data.isLogin) {
|
|
wx.navigateTo({
|
|
url: `../login/index`
|
|
});
|
|
}
|
|
if (that.data.selectJob) {
|
|
that.triggerEvent("getDetail", e.currentTarget);
|
|
|
|
} else {
|
|
wx.navigateTo({
|
|
url: `../detail/index?storeJobId=${e.currentTarget.dataset.id}&jobClassify=${e.currentTarget.dataset.info.jobClassify}`,
|
|
});
|
|
}
|
|
|
|
},
|
|
tobeAgencyToast () {
|
|
wx.showModal({
|
|
title: '',
|
|
content: '抱歉,您需先成为伯才代理以获得使用权限。',
|
|
confirmColor: '#1890ff',
|
|
confirmText: '成为代理',
|
|
cancelText: '知道了',
|
|
success (res) {
|
|
if (res.confirm) {
|
|
wx.navigateTo({
|
|
url: '/pages/tobeAgency/index'
|
|
})
|
|
}
|
|
}
|
|
})
|
|
}
|
|
}
|
|
}) |