Commit 49f05bfe by wangjian

1

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