修改王者荣耀裁剪图片方式

This commit is contained in:
tangxinyue 2026-06-12 15:39:01 +08:00
parent 9c5f267b5f
commit 8657afdbd7
2 changed files with 54 additions and 25 deletions

View File

@ -119,10 +119,10 @@
</view> -->
<view class="form-item avatar-form-item">
<text class="label">头像</text>
<view class="avatar-uploader">
<view class="avatar-uploader" @click="handleChooseAvatar">
<view class="avatar-preview" v-if="tempData.avatar">
<image class="preview-img" :src="tempData.avatar" mode="aspectFill"></image>
<view class="delete-icon" @click="handleDeleteAvatar">
<view class="delete-icon">
<text>×</text>
</view>
</view>
@ -226,7 +226,7 @@
<script setup>
import { ref, reactive, onMounted, getCurrentInstance } from 'vue'
import { onLoad, onReady } from '@dcloudio/uni-app'
import { onLoad, onReady, onUnload } from '@dcloudio/uni-app'
const rightButtonText = ref("编辑");
const instance = getCurrentInstance();
const { proxy } = getCurrentInstance();
@ -270,6 +270,15 @@ onLoad(() => {
Object.assign(honorData, cachedData);
}
uni.$on('editFormPhoto', (info) => {
tempData.avatar = info;
// #ifndef H5
if (info && !info.startsWith('/static/')) {
newAvatars.value.push(info);
}
// #endif
});
//
proxy.$apiUserEvent('all', {
type: 'click',
@ -371,6 +380,10 @@ onLoad(() => {
loadSingleFont(fontUrl2, 'WangZheFont2', 'wangzhe_font2_path', checkAllLoaded);
})
onUnload(() => {
uni.$off('editFormPhoto');
})
const finalPosterPath = ref('');
const editPopup = ref(null);
@ -393,25 +406,10 @@ function onRightClick() {
const handleChooseAvatar = () => {
uni.chooseImage({
count: 1,
crop: {
quality: 100,
width: 400,
height: 400
},
success: (res) => {
const tempPath = res.tempFilePaths[0];
// #ifndef H5
uni.saveFile({
tempFilePath: tempPath,
success: (saveRes) => {
tempData.avatar = saveRes.savedFilePath;
newAvatars.value.push(saveRes.savedFilePath);
}
uni.navigateTo({
url: `/pages/other/qf-image/qf-image?src=${res.tempFilePaths[0]}&width=200&height=200`
});
// #endif
// #ifdef H5
tempData.avatar = tempPath;
// #endif
}
});
};

View File

@ -1,7 +1,6 @@
<template>
<view class="container">
<nav-bar bgColor="transparent" :isBack="false" tipLayerType="wx-payment-tip" isTipLayer tipLayerText="修改支付信息"
:buttonGroup="buttonGroup" @button-click="util.clickTitlePopupButton">
<nav-bar bgColor="transparent" :isBack="false">
<template v-slot:center>
<view class="flex-cneter title-box flex">
<image class="wx-logo" src="/static/image/other/payment-success/payment-success.png"></image>
@ -9,7 +8,7 @@
</view>
</template>
</nav-bar>
<view class="content-box flex-column flex-cneter">
<view class="content-box flex-column flex-cneter" @click="editPaymentInfo">
<text class="product-name">{{ paymetInfo.productName }}</text>
<view class="money flex wx-font-medium">
<image class="symbol" src="/static/image/other/payment-success/symbol-yuan.png"></image>{{
@ -38,14 +37,27 @@
</view>
</uni-popup>
</view>
<!-- 水印 -->
<view v-if="$isVip()">
<watermark dark="light" source="uni_alipay_other_wx_pay_success" />
<liu-drag-button :canDocking="false"
@clickBtn="$goRechargePage('watermark', 'uni_alipay_other_wx_pay_success')">
<c-lottie ref="cLottieRef" :src='$watermark()' width="94px" height='74px' :loop="true"></c-lottie>
</liu-drag-button>
</view>
</template>
<script setup>
import { ref } from 'vue';
import { onShow } from '@dcloudio/uni-app';
import { ref, getCurrentInstance } from 'vue';
import { onShow, onLoad } from '@dcloudio/uni-app';
import { util } from '@/utils/common';
import { storage } from '@/utils/storage';
const {
proxy
} = getCurrentInstance();
const editPaymentInfoPopup = ref(null);
const editPaymentInfo = () => {
@ -79,6 +91,25 @@ onShow(() => {
} else {
paymetInfo.value = { productName: '王者荣耀', money: 168 };
}
// #ifdef APP-PLUS&&!APP-HARMONY
util.setAndroidSystemBarColor('#FFFFFF')
setTimeout(() => {
plus.navigator.setStatusBarStyle("light");
}, 500)
// #endif
})
onLoad(async () => {
//
proxy.$apiUserEvent('all', {
type: 'event',
key: 'wx_pay_success',
prefix: '.uni.other.',
value: "微信支付成功"
})
})
</script>