优化小程序没法上传头像bug

This commit is contained in:
wuxw 2025-01-08 19:33:39 +08:00
parent e89c2b3161
commit 808a3fab95
5 changed files with 9 additions and 5 deletions

BIN
.DS_Store vendored Normal file

Binary file not shown.

View File

@ -15,10 +15,10 @@ const baseUrl = '/';
// #ifndef H5
//服务器域名 小程序 或者 app 时 后端地址
const baseUrl = 'https://crsdt.cn/';
const baseUrl = 'https://wuye.beefuwu.com/';
// #endif
let commonBaseUrl = 'https://crsdt.cn/';
let commonBaseUrl = 'https://wuye.beefuwu.com/';
//商城的url
let mallUrl = 'https://mallapp.crsdt.cn/';

View File

@ -76,8 +76,9 @@ export function translateH5(imgSrc, callback) {
* @param callback 回调
*/
function translateMP(that, imageUrl, callback) {
console.log(imageUrl)
uni.getImageInfo({
src: imageUrl,
src: imageUrl[0],
success(imgData) {
const query = that.createSelectorQuery();
query.select('#materCanvas').fields({

View File

@ -59,7 +59,7 @@
"quickapp" : {},
"mp-weixin" : {
"usingComponents" : true,
"appid" : "wx44c2329a271b1e29",
"appid" : "wxa2546d522c10515b",
"setting" : {
"urlCheck" : false,
"es6" : false

View File

@ -81,6 +81,9 @@
</view>
</view>
</view>
<!--#ifdef MP-WEIXIN -->
<canvas canvas-id="materCanvas" style="display: none;" type="2d" id="materCanvas"></canvas>
<!--#endif -->
</view>
</template>
@ -134,7 +137,7 @@
});
var tempFilePaths = res.tempFilePaths
console.log('头像地址', tempFilePaths);
TanslateImage.translate(this,tempFilePaths, (_baseInfo) => {
TanslateImage.translate(_that,tempFilePaths, (_baseInfo) => {
_that.headerImg = _baseInfo;
_that._uploadOwnerHeaderImg();
wx.hideLoading()