Browse Source

···

master
wangjiahai 2 years ago
parent
commit
fd61cc0454
  1. 83
      pages/home/UserFragment.vue

83
pages/home/UserFragment.vue

@ -13,17 +13,17 @@
</view>
<view class="user-item-bg">
<!-- <view class="user-item-bg">
<UserItem src='https://supervise.yxtsoft.com/img/user/wdxm.png' text="我的项目" @click="click" clickId="0">
</UserItem>
</view>
</view> -->
<!-- <view class="user-item-bg">
<UserItem src='https://supervise.yxtsoft.com/img/user/smxx.png' text="实名信息" notes="完善信息" @click="click" clickId="1"></UserItem>
</view> -->
<view class="user-item-bg">
<!-- <view class="user-item-bg">
<UserItem src='https://supervise.yxtsoft.com/img/user/sz.png' text="设置" @click="click" clickId="2">
</UserItem>
</view>
@ -31,7 +31,7 @@
<view class="user-item-bg">
<UserItem src='https://supervise.yxtsoft.com/img/user/wdxm.png' text="关注公众号" @click="click" clickId="8">
</UserItem>
</view>
</view> -->
<!-- #ifdef APP-PLUS -->
<!-- <view class="user-item-bg"> -->
@ -48,91 +48,22 @@
</template>
<script>
import APPUpdate, {
getCurrentNo
} from '../../plugins/APPUpdate/index.js'
export default {
data() {
return {
baseUrl: "",
name: "",
orgName: "",
version: ""
};
},
onLoad() {
/* #ifdef APP-PLUS */
let that = this;
getCurrentNo(version => {
that.version = version.version
console.log("version", version)
console.log("qqqq", that.version)
})
/* #endif */
},
onShow() {
console.log('onShow', getApp().globalData.isLogin)
let token = uni.getStorageSync("Global-Auth-Token")
if (token != null && token.length != 0) {
getApp().globalData.token = token
}
let isLogin = uni.getStorageSync("isLogin")
if (isLogin != null && isLogin == 1) {
getApp().globalData.isLogin = isLogin
}
let sid = uni.getStorageSync("sid")
if (sid != null && sid.length != 0) {
getApp().globalData.sid = sid
}
console.log('用户Sid', getApp().globalData.sid)
console.log('token', getApp().globalData.token)
console.log('是否登陆', getApp().globalData.isLogin)
// setTimeout(() => {
if (getApp().globalData.isLogin) {
var userSid = getApp().globalData.sid
var headImage = getApp().globalData.headImage
var username = getApp().globalData.username
var orgNamePath = getApp().globalData.orgNamePath
console.log(">>>>>", userSid)
console.log(">>>>>", headImage)
console.log(">>>>>", username)
console.log(">>>>>", orgNamePath)
this.name = username == "" ? "用户名称" : username
this.orgName = orgNamePath == "" ? "暂无部门信息" : orgNamePath
this.baseUrl = headImage == "" ? "https://supervise.yxtsoft.com/img/user/userImage.png" : headImage
// this.getData(userSid, true)
// uni.setTabBarBadge({ //
// index: 0, //tabbar
// text: '100' //
// })
} else {
/* #ifdef MP-WEIXIN */
this.WxSilentLogin()
/* #endif */
/* #ifdef APP-PLUS */
uni.redirectTo({
url: '../login/login'
})
/* #endif */
}
},
methods: {
chooseImage() {
uni.navigateTo({
url: '../index/SetUp2'
});
// uni.navigateTo({
// url: '../index/SetUp2'
// });
},
click(id) {

Loading…
Cancel
Save