解决了iPhone背景图片发白的问题

This commit is contained in:
yuanteng0011 2025-04-19 18:05:58 +08:00
parent aabda4cca2
commit 939b49072c
10 changed files with 43 additions and 70 deletions

View File

@ -6,7 +6,6 @@
import { onLaunch } from '@dcloudio/uni-app' import { onLaunch } from '@dcloudio/uni-app'
import { reactive } from 'vue' import { reactive } from 'vue'
// //
const globalData = reactive({});
onLaunch( async ()=>{ onLaunch( async ()=>{
if (!wx.cloud) { if (!wx.cloud) {
console.error('请使用 2.2.3 或以上的基础库以使用云能力'); console.error('请使用 2.2.3 或以上的基础库以使用云能力');

View File

@ -26,7 +26,6 @@ text {
width: 100vw; width: 100vw;
height: 100vh; height: 100vh;
} }
.flex-row { .flex-row {
display: flex; display: flex;
flex-direction: row; flex-direction: row;

View File

@ -1,39 +1,40 @@
import { bkgPubilcPath,loginUrl } from "./globalImagesUrl"; import { bkgPubilcPath,loginUrl } from "./globalImagesUrl";
import { ref } from 'vue'; import { ref } from 'vue';
const bkgUrl = ref(loginUrl + '/bkg.png') // const bkgUrl = ref('https://www.carboner.cn:8888/api/file/downloadFile?objectKey=feiyi/miniProgram/login/bkg.png')
//缓存背景图片 //缓存背景图片
const bkgCache = 'bkgCache'; //缓存的键 // const bkgCache = 'bkgCache'; //缓存的键
export const getFonts =()=>{ //改为查询背景图片 export const getFonts =()=>{ //改为查询背景图片
wx.getStorage({ // wx.getStorage({
key: bkgCache, // key: bkgCache,
success: (res) => { // success: (res) => {
// console.log('缓存图片的路径--->',res.data); // console.log('缓存图片的路径--->',res.data);
bkgPubilcPath.value = res.data // bkgPubilcPath.value = res.data
}, // },
fail: ()=> { // fail: ()=> {
wx.downloadFile({ // wx.downloadFile({
url: bkgUrl.value, // url: 'https://www.carboner.cn:8888/api/file/downloadFile?objectKey=feiyi/miniProgram/login/bkg.png',
success: (res) => { // success: (res) => {
console.log('成功res--->',res); // console.log('成功res--->',res);
if(res.statusCode === 200) { // if(res.statusCode === 200) {
const filePath = res.tempFilePath; // const filePath = res.tempFilePath;
wx.setStorage({ // wx.setStorage({
key: bkgCache, // key: bkgCache,
data: filePath // data: filePath
}); // });
// console.log('图片下载并缓存成功,本地路径--->',filePath); // console.log('图片下载并缓存成功,本地路径--->',filePath);
bkgPubilcPath.value= filePath // bkgPubilcPath.value= filePath
} else { // } else {
console.log('图片下载失败'); // console.log('图片下载失败');
} // }
}, // },
fail: (err) => { // fail: (err) => {
console.log('下载失败',err); // console.log('下载失败',err);
} // }
}) // })
} // }
}) // })
} }

View File

@ -16,4 +16,4 @@ export const storeHomeUrl = publicPath + subPath + '/store-home'
export const mineUrl = publicPath + subPath + '/mine' export const mineUrl = publicPath + subPath + '/mine'
export const clothesRentUrl = publicPath + subPath + '/clothesRent' export const clothesRentUrl = publicPath + subPath + '/clothesRent'
export const bkgPubilcPath = ref('') export const bkgPubilcPath = ref('https://www.carboner.cn:8888/api/file/downloadFile?objectKey=feiyi/miniProgram/login/bkg.png')

View File

@ -53,8 +53,8 @@
"appid" : "wx61b63e27bddf4ea2", "appid" : "wx61b63e27bddf4ea2",
"setting" : { "setting" : {
"urlCheck" : false, "urlCheck" : false,
"minified" : true, "minified" : false,
"es6" : false, "es6" : true,
"postcss" : true "postcss" : true
}, },
"usingComponents" : true, "usingComponents" : true,

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -7,7 +7,8 @@
<view class="flex-col group"> <view class="flex-col group">
<view class="flex-row items-center group_2"> <view class="flex-row items-center group_2">
<button class="avatar_button" open-type="chooseAvatar" @chooseavatar="onChooseAvatar" > <button class="avatar_button" open-type="chooseAvatar" @chooseavatar="onChooseAvatar" >
<image class="avatar_son" mode="aspectFill" :src="publicPath + myAvatar" /> <image v-if="nickName === '未登录'" class="avatar_son" mode="aspectFill" :src="myAvatar" />
<image v-if="nickName !== '未登录'" class="avatar_son" mode="aspectFill" :src="publicPath + myAvatar" />
</button> </button>

File diff suppressed because one or more lines are too long

View File

@ -150,6 +150,7 @@
id: val id: val
} }
}) })
console.log('订单信息--->',res.data.data);
order.value = res.data.data order.value = res.data.data
orderStatusObj.value = photoOrderMap.get(res.data.data.orderStatus) orderStatusObj.value = photoOrderMap.get(res.data.data.orderStatus)
console.log('orderStatusObj--->',orderStatusObj.value); console.log('orderStatusObj--->',orderStatusObj.value);
@ -158,7 +159,7 @@
} else if (order.value.orderStatus === '待发货') { } else if (order.value.orderStatus === '待发货') {
order.value.operationList = [false, false, true] order.value.operationList = [false, false, true]
} else if (order.value.orderStatus === '已退款') { } else if (order.value.orderStatus === '已退款') {
order.value.operationList = [false, false, true] order.value.operationList = [false, true, false]
} else if (order.value.orderStatus === '交易成功') { } else if (order.value.orderStatus === '交易成功') {
order.value.operationList = [false, false, true] order.value.operationList = [false, false, true]
} else if (order.value.orderStatus === '交易关闭') { } else if (order.value.orderStatus === '交易关闭') {