mirror of
https://gitee.com/java110/WechatOwnerService.git
synced 2026-02-23 21:36:38 +08:00
优化代码
This commit is contained in:
parent
ef9a364da5
commit
bf6254b74e
@ -86,6 +86,7 @@
|
||||
|
||||
<script>
|
||||
const context = require("../../context/Java110Context.js");
|
||||
import * as TanslateImage from '../../utils/translate-image.js';
|
||||
const constant = context.constant;
|
||||
const factory = context.factory;
|
||||
export default {
|
||||
@ -115,7 +116,7 @@
|
||||
var _that = this;
|
||||
wx.chooseImage({
|
||||
count: 1,
|
||||
sizeType: ['original', 'compressed'],
|
||||
sizeType: ['compressed'],
|
||||
sourceType: ['album', 'camera'],
|
||||
success: function(res) {
|
||||
// console.log(res)
|
||||
@ -127,11 +128,20 @@
|
||||
});
|
||||
var tempFilePaths = res.tempFilePaths
|
||||
console.log('头像地址', tempFilePaths);
|
||||
//#ifdef H5
|
||||
TanslateImage.translate(tempFilePaths, (_baseInfo) => {
|
||||
_that.headerImg = _baseInfo;
|
||||
_that._uploadOwnerHeaderImg();
|
||||
wx.hideLoading()
|
||||
})
|
||||
//#endif
|
||||
//#ifdef MP-WEIXIN
|
||||
factory.base64.urlTobase64(tempFilePaths[0]).then(function(_baseInfo) {
|
||||
_that.headerImg = _baseInfo;
|
||||
_that._uploadOwnerHeaderImg();
|
||||
wx.hideLoading()
|
||||
});
|
||||
//#endif
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
Loading…
Reference in New Issue
Block a user