|
@@ -397,11 +397,14 @@
|
|
this.scrollTop = e.scrollTop;
|
|
this.scrollTop = e.scrollTop;
|
|
},
|
|
},
|
|
onShow() {
|
|
onShow() {
|
|
- if (uni.getStorageSync('compName')) {
|
|
|
|
- this.haveCompany = true
|
|
|
|
- } else {
|
|
|
|
- this.haveCompany = false
|
|
|
|
- }
|
|
|
|
|
|
+ console.log("uni.getStorageSync('compName1')")
|
|
|
|
+ // console.log(uni.getStorageSync("compName1"))
|
|
|
|
+
|
|
|
|
+ // if (uni.getStorageSync("compName1")) {
|
|
|
|
+ // this.haveCompany = true
|
|
|
|
+ // } else {
|
|
|
|
+ // this.haveCompany = false
|
|
|
|
+ // }
|
|
this.isShow();
|
|
this.isShow();
|
|
uni.hideKeyboard()
|
|
uni.hideKeyboard()
|
|
uni.showTabBar()
|
|
uni.showTabBar()
|
|
@@ -409,7 +412,8 @@
|
|
index: 4
|
|
index: 4
|
|
})
|
|
})
|
|
this.loadData()
|
|
this.loadData()
|
|
- console.log("hasLogin", this.hasLogin)
|
|
|
|
|
|
+ console.log("hasLogin", this.hasLogin)
|
|
|
|
+ var that = this
|
|
if (this.userInfo) {
|
|
if (this.userInfo) {
|
|
if (!this.userInfo.avatarUrl) {
|
|
if (!this.userInfo.avatarUrl) {
|
|
this.headUrl = "../../static/img/myimg/YongHu@3x.png"
|
|
this.headUrl = "../../static/img/myimg/YongHu@3x.png"
|
|
@@ -419,7 +423,6 @@
|
|
this.username = this.userInfo.userName ? this.userInfo.userName : uni.getStorageSync("userInfo").data
|
|
this.username = this.userInfo.userName ? this.userInfo.userName : uni.getStorageSync("userInfo").data
|
|
.userName
|
|
.userName
|
|
this.userphone = this.userInfo.phone ? this.userInfo.phone : uni.getStorageSync("userInfo").data.phone
|
|
this.userphone = this.userInfo.phone ? this.userInfo.phone : uni.getStorageSync("userInfo").data.phone
|
|
- var that = this
|
|
|
|
this.$api.doRequest('get', '/newNoticeTask/query/noticeTasks').then(res => {
|
|
this.$api.doRequest('get', '/newNoticeTask/query/noticeTasks').then(res => {
|
|
console.log("noticeNumber", res)
|
|
console.log("noticeNumber", res)
|
|
if (res.data.data) {
|
|
if (res.data.data) {
|
|
@@ -449,22 +452,39 @@
|
|
// });
|
|
// });
|
|
}
|
|
}
|
|
})
|
|
})
|
|
- if (!uni.getStorageSync('compName')) {
|
|
|
|
- this.$api.doRequest('get', '/commonUser/getCompOwn', {
|
|
|
|
- phone: this.userInfo.phone
|
|
|
|
- }).then(res => {
|
|
|
|
- if (res.data.data) {
|
|
|
|
- this.companyList = res.data.data
|
|
|
|
- if (this.companyList.length > 0) {
|
|
|
|
- this.compName = this.companyList[0].compName
|
|
|
|
- uni.setStorageSync('compName', this.companyList[0].compName)
|
|
|
|
- this.haveCompany = true
|
|
|
|
- }
|
|
|
|
|
|
+ console.log("this.1111")
|
|
|
|
+ uni.getStorage({
|
|
|
|
+ key: 'compName1',
|
|
|
|
+ success: function (res) {
|
|
|
|
+ console.log("this.2222")
|
|
|
|
+ console.log(res.data);
|
|
|
|
+ if(res.data){
|
|
|
|
+ that.compName = res.data
|
|
|
|
+ that.haveCompany = true
|
|
}
|
|
}
|
|
- })
|
|
|
|
- } else {
|
|
|
|
- this.compName = uni.getStorageSync('compName')
|
|
|
|
- }
|
|
|
|
|
|
+ },
|
|
|
|
+ fail() {
|
|
|
|
+ that.$api.doRequest('get', '/commonUser/getCompOwn', {
|
|
|
|
+ phone: that.userInfo.phone
|
|
|
|
+ }).then(res => {
|
|
|
|
+ if (res.data.data) {
|
|
|
|
+ that.companyList = res.data.data
|
|
|
|
+ console.log("that.3333")
|
|
|
|
+ console.log(that.companyList)
|
|
|
|
+ if (that.companyList.length > 0) {
|
|
|
|
+ that.compName = that.companyList[0].compName
|
|
|
|
+ console.log("this.compName")
|
|
|
|
+ console.log(that.compName)
|
|
|
|
+ uni.setStorageSync('compName1', that.companyList[0].compName)
|
|
|
|
+ that.haveCompany = true
|
|
|
|
+ }
|
|
|
|
+ else{
|
|
|
|
+ that.haveCompany = false
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
|
|
} else {
|
|
} else {
|
|
this.headUrl = "../../static/img/myimg/YongHu@3x.png"
|
|
this.headUrl = "../../static/img/myimg/YongHu@3x.png"
|
|
@@ -491,7 +511,7 @@
|
|
}).then(res1 => {
|
|
}).then(res1 => {
|
|
if (res1.data.code == 200) {
|
|
if (res1.data.code == 200) {
|
|
uni.setStorageSync('pcUserInfo', res1.data.data)
|
|
uni.setStorageSync('pcUserInfo', res1.data.data)
|
|
- uni.setStorageSync('compName', that.companyList[e[0]].compName)
|
|
|
|
|
|
+ uni.setStorageSync('compName1', that.companyList[e[0]].compName)
|
|
that.compName = that.companyList[e[0]].compName
|
|
that.compName = that.companyList[e[0]].compName
|
|
helper.getListByUserId()
|
|
helper.getListByUserId()
|
|
that.$api.msg('切换成功')
|
|
that.$api.msg('切换成功')
|
|
@@ -502,7 +522,7 @@
|
|
veriCode: "123456",
|
|
veriCode: "123456",
|
|
}).then(res2 => {
|
|
}).then(res2 => {
|
|
uni.setStorageSync('pcUserInfo', res2.data.data)
|
|
uni.setStorageSync('pcUserInfo', res2.data.data)
|
|
- uni.setStorageSync('compName', that.companyList[e[0]].compName)
|
|
|
|
|
|
+ uni.setStorageSync('compName1', that.companyList[e[0]].compName)
|
|
that.compName = that.companyList[e[0]].compName
|
|
that.compName = that.companyList[e[0]].compName
|
|
helper.getListByUserId()
|
|
helper.getListByUserId()
|
|
that.$api.msg('切换成功')
|
|
that.$api.msg('切换成功')
|