|
@@ -4,7 +4,6 @@
|
|
|
<image class="xj-image" v-if="!deptListurl.avatarUrl" src="@/static/images/common/tianjiazhaopian@2x.png">
|
|
|
</image>
|
|
|
<image :src="deptListurl.avatarUrl" v-if="deptListurl.avatarUrl" style="width: 100%;height: 100%;"></image>
|
|
|
-
|
|
|
</view>
|
|
|
<view @click="submit" class="submit">提交</view>
|
|
|
<u-action-sheet :actions="$helper.imgTypeList" :title="$helper.imgType" :show="isShowimgType"
|
|
@@ -40,25 +39,21 @@
|
|
|
},
|
|
|
methods: {
|
|
|
upload() {
|
|
|
- this.isShowimgType = true
|
|
|
+ this.imgTypeSelect()
|
|
|
},
|
|
|
imgTypeSelect(val) {
|
|
|
- console.log(val)
|
|
|
- if (val.name == '相册') {
|
|
|
+ // if (val.name == '相册') {
|
|
|
uni.chooseImage({
|
|
|
count: 1,
|
|
|
- sourceType: that.$helper.chooseImage.sourceType,
|
|
|
+ // sourceType: that.$helper.chooseImage.sourceType,
|
|
|
success: function(res) {
|
|
|
- console.log(JSON.stringify(res.tempFilePaths));
|
|
|
uploadImage('image',res.tempFilePaths[0], 'appData/',
|
|
|
result => {
|
|
|
// 上传成功
|
|
|
- console.log('图片地址', result)
|
|
|
that.$request.baseRequest('get', '/BDAccessToken/getAuth', {
|
|
|
apiKey: 'yNWLRW6unoUxo2KXiCZxOxGS',
|
|
|
secretKey: 'E8hqzKWdFdTGnFnpAwZ7ixtL89SN3deR'
|
|
|
}).then(res => {
|
|
|
- console.log(res)
|
|
|
that.$request.baseRequest('post',
|
|
|
'/commonUser/getUserDefinedBean', {
|
|
|
accessToken: res.data,
|
|
@@ -73,51 +68,48 @@
|
|
|
.catch(res => {
|
|
|
uni.$u.toast(res.message);
|
|
|
});
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
}
|
|
|
)
|
|
|
}
|
|
|
});
|
|
|
|
|
|
- } else {
|
|
|
- uni.chooseImage({
|
|
|
- count: 1,
|
|
|
- sourceType: ['camera'],
|
|
|
- success: function(res) {
|
|
|
- console.log(JSON.stringify(res.tempFilePaths));
|
|
|
- uploadImage(res.tempFilePaths[0], 'appData/',
|
|
|
- result => {
|
|
|
- // 上传成功
|
|
|
- console.log('图片地址', result)
|
|
|
- that.$request.baseRequest('get', '/BDAccessToken/getAuth', {
|
|
|
- apiKey: 'yNWLRW6unoUxo2KXiCZxOxGS',
|
|
|
- secretKey: 'E8hqzKWdFdTGnFnpAwZ7ixtL89SN3deR'
|
|
|
- }).then(res => {
|
|
|
- console.log(res)
|
|
|
- that.$request.baseRequest('post',
|
|
|
- '/commonUser/getUserDefinedBean', {
|
|
|
- accessToken: res.data,
|
|
|
- imagePath: result
|
|
|
- }).then(res1 => {
|
|
|
- that.deptListurl.avatarUrl = result
|
|
|
- })
|
|
|
- .catch(res => {
|
|
|
- uni.$u.toast(res.message);
|
|
|
- });
|
|
|
- })
|
|
|
- .catch(res => {
|
|
|
- uni.$u.toast(res.message);
|
|
|
- });
|
|
|
+ // } else {
|
|
|
+ // uni.chooseImage({
|
|
|
+ // count: 1,
|
|
|
+ // sourceType: ['camera'],
|
|
|
+ // success: function(res) {
|
|
|
+ // console.log(JSON.stringify(res.tempFilePaths));
|
|
|
+ // uploadImage(res.tempFilePaths[0], 'appData/',
|
|
|
+ // result => {
|
|
|
+ // // 上传成功
|
|
|
+ // console.log('图片地址', result)
|
|
|
+ // that.$request.baseRequest('get', '/BDAccessToken/getAuth', {
|
|
|
+ // apiKey: 'yNWLRW6unoUxo2KXiCZxOxGS',
|
|
|
+ // secretKey: 'E8hqzKWdFdTGnFnpAwZ7ixtL89SN3deR'
|
|
|
+ // }).then(res => {
|
|
|
+ // console.log(res)
|
|
|
+ // that.$request.baseRequest('post',
|
|
|
+ // '/commonUser/getUserDefinedBean', {
|
|
|
+ // accessToken: res.data,
|
|
|
+ // imagePath: result
|
|
|
+ // }).then(res1 => {
|
|
|
+ // that.deptListurl.avatarUrl = result
|
|
|
+ // })
|
|
|
+ // .catch(res => {
|
|
|
+ // uni.$u.toast(res.message);
|
|
|
+ // });
|
|
|
+ // })
|
|
|
+ // .catch(res => {
|
|
|
+ // uni.$u.toast(res.message);
|
|
|
+ // });
|
|
|
|
|
|
|
|
|
|
|
|
- }
|
|
|
- )
|
|
|
- }
|
|
|
- });
|
|
|
- }
|
|
|
+ // }
|
|
|
+ // )
|
|
|
+ // }
|
|
|
+ // });
|
|
|
+ // }
|
|
|
|
|
|
},
|
|
|
submit() {
|