Commit 49f05bfe by wangjian

1

parent 6dec8742
...@@ -150,13 +150,13 @@ export function refreshToken (token) { ...@@ -150,13 +150,13 @@ export function refreshToken (token) {
export function uploadImage (image, name, type) { export function uploadImage (image, name, type) {
// type 100 头像 200 退货 300 商品 其他type // type 100 头像 200 退货 300 商品 其他type
let header = headerCom() let header = headerCom()
header.type = type||200
let postObj = new Promise((resolve, reject) => { let postObj = new Promise((resolve, reject) => {
uni.uploadFile({ uni.uploadFile({
url: base_url + '/upload', url: base_url + '/staff/upload',
header: header, header: header,
filePath: image, filePath: image,
name:name, name:name,
formData: {'uploadType': 1000},
success(res) { success(res) {
resolve(JSON.parse(res.data)) resolve(JSON.parse(res.data))
}, },
......
...@@ -80,19 +80,10 @@ ...@@ -80,19 +80,10 @@
this.getUserInfo() this.getUserInfo()
}, },
onTabItemTap () { onTabItemTap () {
if (!this.$store.state.isLogin) { if (this.$store.state.isLogin) {
this.$router.push('login')
}
this.getUserInfo()
},
onShow() {
if (uni.getStorageSync('tokenArr').token == undefined) {
uni.switchTab({
url: '../home/home'
})
this.$router.push('Login') this.$router.push('Login')
} else {
} }
this.getUserInfo()
}, },
methods: { methods: {
getUserInfo() { getUserInfo() {
...@@ -112,13 +103,24 @@ ...@@ -112,13 +103,24 @@
sizeType: ['original', 'compressed'], //original 原图,compressed 压缩图,默认二者都有 sizeType: ['original', 'compressed'], //original 原图,compressed 压缩图,默认二者都有
sourceType: ['album', 'camera'], //album 从相册选图,camera 使用相机,默认二者都有。如需直接开相机或直接选相册,请只使用一个选项 sourceType: ['album', 'camera'], //album 从相册选图,camera 使用相机,默认二者都有。如需直接开相机或直接选相册,请只使用一个选项
success: function (res) { success: function (res) {
console.log(JSON.stringify(res.tempFilePaths)); that.$net.uploadImage(res.tempFilePaths[0], 'uploadFile', 1000).then((res)=>{
that.imgArr = res.tempFilePaths if (res && res.code==200) {
that.getUserInfo()
} else {
that.toast(res.message)
}
})
} }
}); });
}, },
clickItem(index) { clickItem(index) {
if (index === 1) {
} else if (index === 2) {
this.$router.push('IntegralDetail')
} else if (index === 3) {
}
}, },
setting() { setting() {
this.$router.push('Setting') this.$router.push('Setting')
......
...@@ -104,10 +104,12 @@ ...@@ -104,10 +104,12 @@
this.loading.loadingHide() this.loading.loadingHide()
if (res.code === 200) { if (res.code === 200) {
this.$net.tokenSave(res.data.token || '') this.$net.tokenSave(res.data.token || '')
if (res.date&&res.date.list) { this.$store.commit('refreshUserLogin', true)
if (res.data.list&&res.data.list.length>0) {
this.$router.replaceTo('SelectAccount')
} else {
this.$router.pop()
} }
this.$router.push('SelectAccount')
} else { } else {
this.toast(res.message) this.toast(res.message)
} }
...@@ -115,6 +117,9 @@ ...@@ -115,6 +117,9 @@
}, },
liteLogin(liteCode) { liteLogin(liteCode) {
this.showGetPhoneBtn = false this.showGetPhoneBtn = false
if (!liteCode) {
return
}
this.loading.loadingShow('登录中...') this.loading.loadingShow('登录中...')
let params = {'authType':'lite','authAccount':liteCode, 'resetToken':'not'} let params = {'authType':'lite','authAccount':liteCode, 'resetToken':'not'}
this.$net.post('/auth/authorization', params).then(res => { this.$net.post('/auth/authorization', params).then(res => {
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
</view> </view>
</view> </view>
<view class="bottom"> <view class="bottom">
<image v-if="!selectTips" class="select-img" src="../../static/select-n.png" mode="" @click="selectTips=true"></image> <image v-if="!selectTips" class="select-img" src="../../static/select-n.png" mode="" @click="selectTips=!selectTips"></image>
<image v-else class="select-img" src="../../static/select-h.png" mode="" @click="selectTips=false"></image> <image v-else class="select-img" src="../../static/select-h.png" mode="" @click="selectTips=false"></image>
<view class="tips"> <view class="tips">
查看并同意<text>《隐私政策》</text><text>《服务协议》</text> 查看并同意<text>《隐私政策》</text><text>《服务协议》</text>
...@@ -28,26 +28,7 @@ ...@@ -28,26 +28,7 @@
return { return {
topTitle: '选择账号', topTitle: '选择账号',
subTitle: '系统检测到该手机号已在多家公司注册', subTitle: '系统检测到该手机号已在多家公司注册',
accountList: [ accountList: [],
{
'avatar': '',
'staffName': 'xoakjsbfoq',
'accountName': '手机号的不干胶王本岗位能力跟你',
'staffState': 100
},
{
'avatar': '',
'staffName': 'xoakjsbfoq',
'accountName': '手机号的不干胶王本岗位能力跟你',
'staffState': 100
},
{
'avatar': '',
'staffName': 'xoakjsbfoq',
'accountName': '手机号的不干胶王本岗位能力跟你',
'staffState': 200
}
],
selectTips: false selectTips: false
}; };
}, },
...@@ -56,14 +37,22 @@ ...@@ -56,14 +37,22 @@
}, },
methods: { methods: {
goAccount(item) { goAccount(item) {
if (!this.selectTips) {
this.toast('请先查看并同意《隐私政策》和《服务协议》')
return
}
this.$net.post('/account/change', {'accountCode': item.accountCode}).then(res => { this.$net.post('/account/change', {'accountCode': item.accountCode}).then(res => {
if (res.code === 200) {
this.$router.pop()
} else {
this.toast(res.message)
}
}) })
}, },
getAllAccount() { getAllAccount() {
this.$net.get('/staff/query').then(res => { this.$net.get('/staff/query').then(res => {
if (res.code === 200) { if (res.code === 200) {
this.accountList = this.accountList.concat(res.data) this.accountList = this.accountList.concat(res.data.QueryAccountOutput)
} else { } else {
this.toast(res.message) this.toast(res.message)
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment