From f5aab724124ffde943e208d69811b8b7bf6fa14c Mon Sep 17 00:00:00 2001
From: MrShi <1878285526@qq.com>
Date: 星期三, 28 二月 2024 12:03:14 +0800
Subject: [PATCH] mrshi
---
h5/pages/cropping/cropping.vue | 37 ++++++++++++++++++++++---------------
1 files changed, 22 insertions(+), 15 deletions(-)
diff --git a/h5/pages/cropping/cropping.vue b/h5/pages/cropping/cropping.vue
index cd95adc..cae2d62 100644
--- a/h5/pages/cropping/cropping.vue
+++ b/h5/pages/cropping/cropping.vue
@@ -8,7 +8,10 @@
:style="{ width: preImgW + 'px', height: preImgH + 'px', transform: `translate(${x}px,${y}px)` }"></canvas>
</view>
<!-- 宸ュ叿 -->
- <view class="setting-btns"><text @click="onCrop">纭畾</text></view>
+ <view class="setting-btns">
+ <!-- <text @click="onCrop">纭畾</text> -->
+ <u-button text="纭畾" @click="onCrop"></u-button>
+ </view>
</view>
</template>
@@ -39,20 +42,23 @@
computed: {},
onLoad(option) {
// 閫夋嫨鐓х墖淇℃伅
- let data = JSON.parse(decodeURIComponent(option.item));
- const query = uni.createSelectorQuery();
- query.select('.settingHeadImage').boundingClientRect();
- query.exec(res => {
- // 璁剧疆灞忓箷澶у皬
- this.screenWidth = res[0].width;
- this.screenHeight = res[0].height;
- // 璁剧疆鍥惧儚鍩哄噯鍊硷紝鍥惧儚鍩哄噯鍊兼寜灞忓箷瀹藉害璁剧疆锛屼袱杈圭暀鐧藉悇40
- this.maxH = res[0].width - 80;
- this.maxW = res[0].width - 80;
- // 璁剧疆X杞村�硷紝绠楀紡锛氬睆骞曢珮搴︾殑涓�鍗婂噺鍘诲熀鍑嗘楂樺害鐨勪竴鍗�
- this.xToTop = this.screenHeight / 2 - this.maxH / 2;
- this.setImageSize(data);
- });
+ let data = JSON.parse(option.item);
+ console.log(data)
+ this.$nextTick(() => {
+ const query = uni.createSelectorQuery();
+ query.select('.settingHeadImage').boundingClientRect();
+ query.exec(res => {
+ // 璁剧疆灞忓箷澶у皬
+ this.screenWidth = res[0].width;
+ this.screenHeight = res[0].height;
+ // 璁剧疆鍥惧儚鍩哄噯鍊硷紝鍥惧儚鍩哄噯鍊兼寜灞忓箷瀹藉害璁剧疆锛屼袱杈圭暀鐧藉悇40
+ this.maxH = res[0].width - 80;
+ this.maxW = res[0].width - 80;
+ // 璁剧疆X杞村�硷紝绠楀紡锛氬睆骞曢珮搴︾殑涓�鍗婂噺鍘诲熀鍑嗘楂樺害鐨勪竴鍗�
+ this.xToTop = this.screenHeight / 2 - this.maxH / 2;
+ this.setImageSize(data);
+ });
+ })
},
methods: {
// 瀹介珮澶勭悊
@@ -274,6 +280,7 @@
left: 0;
z-index: 20;
font-size: 14px;
+ width: 100%;
color: #ffffff;
}
}
--
Gitblit v1.9.3