From 2f871e37176f0dc85816e71bd730b085670fbf58 Mon Sep 17 00:00:00 2001 From: zpc Date: Thu, 17 Apr 2025 23:34:17 +0800 Subject: [PATCH] =?UTF-8?q?=E9=A6=96=E9=A1=B5=E5=BC=B9=E7=AA=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- App.vue | 15 + pages/shouye/index.vue | 154 ++- pages/user/index.vue | 2712 ++++++++++++++++++++-------------------- 3 files changed, 1492 insertions(+), 1389 deletions(-) diff --git a/App.vue b/App.vue index eebadb1..8baccb7 100644 --- a/App.vue +++ b/App.vue @@ -222,4 +222,19 @@ button.hide { .uni-tabbar__icon { height: 50px !important; } + +@keyframes m-zoom { + 0% { + transform: scale(1); + } + + 50% { + transform: scale(0.9); + } + + 100% { + transform: scale(1); + } +} + diff --git a/pages/shouye/index.vue b/pages/shouye/index.vue index 0b60684..bb1ee44 100644 --- a/pages/shouye/index.vue +++ b/pages/shouye/index.vue @@ -15,7 +15,7 @@ - + - - - - - - - 添加客服领优惠 - 识别图中二维码 - - - - - - - + @@ -152,25 +134,29 @@ - - - - - - - - - - - + + + + + + + + + + + + + + + @@ -218,6 +204,8 @@ export default { couponData: "", canGetCoupon: false, swCur: 0, + floatBall: [], + ballItem: null }; }, @@ -267,6 +255,7 @@ export default { selected: 0, }); } + this.getFloatBall(); }, onReady() { @@ -274,6 +263,7 @@ export default { this.getCoupon(); // this.$refs.rulePop.open() this.getnews(); + }, onShareAppMessage() { @@ -284,7 +274,63 @@ export default { path: "/pages/shouye/index?pid=" + uni.getStorageSync("userinfo").ID, }; }, + computed: { + getBallStyle() { + return (item) => { + //判断item.position_x 第一位是否是-号 + let s = { + width: item.width, + height: item.height, + top: item.position_y, + }; + if (item.position_x.indexOf('-') > -1) { + //是-号 + // 获取-号后面的值 + let position_x = item.position_x.split('-')[1]; + s.right = position_x; + + } else { + s.left = item.position_x; + } + if (item.effect == 1) { + s.animation = "m-zoom 1.2s ease-in-out infinite"; + } + return s; + } + }, + getPopupStyle() { + return (item) => { + if (item == null) { + return {}; + } + let s = { + width: item.image_details_w , + height: item.image_details_h, + position: 'relative', + }; + if (item.image_details_x != "0") { + s.left = item.image_details_x ; + } + if (item.image_details_y != "0") { + s.top = item.image_details_y; + } + return s; + }; + } + }, methods: { + BallClick(item) { + console.log(item); + if (item.type == 2) { + this.$c.nav(item.link_url); + return; + } + if (item.type == 1) { + // this.$c.nav(item.link_url); + this.ballItem = item; + this.$refs.floatBall_popup.open(); + } + }, /** * @description: 是否弹公告 * @return {*} @@ -301,7 +347,14 @@ export default { uni.setStorageSync("_is_this_show", true); } }, + async getFloatBall() { + const { status, data, msg } = await this.$request.get("getFloatBall"); + if (status == 1) { + this.floatBall = data; + } + + }, swChange(e) { this.swCur = e.detail.current; }, @@ -508,6 +561,7 @@ export default { height: 380px; position: relative; background: #b198e2; + box-shadow: 0rpx 0rpx 16rpx 0rpx rgba(137, 77, 211, 0.33); border-radius: 44rpx; @@ -1222,4 +1276,26 @@ export default { height: 100%; } } + +.pop-ball { + width: 506rpx; + height: 380px; + position: relative; + // background: #b198e2; + border-radius: 25rpx; + display: flex; + align-items: center; + justify-content: center; + + +} + +.pop-ball-close { + margin-top: 20rpx; + width: 100%; + height: 50rpx; + display: flex; + align-items: center; + justify-content: center; +} \ No newline at end of file diff --git a/pages/user/index.vue b/pages/user/index.vue index 047be42..46fd4ba 100644 --- a/pages/user/index.vue +++ b/pages/user/index.vue @@ -4,7 +4,7 @@ :fixed="false"> -