From 796977e24baa7c1d3a333e2c1c8e06ca73fd9a56 Mon Sep 17 00:00:00 2001
From: zxl <763096477@qq.com>
Date: 星期三, 19 十一月 2025 18:08:35 +0800
Subject: [PATCH] 优惠劵

---
 pages/tabbar/user/my.vue |  247 +++++++++++++++++++++++++++++++++++++++++-------
 1 files changed, 208 insertions(+), 39 deletions(-)

diff --git a/pages/tabbar/user/my.vue b/pages/tabbar/user/my.vue
index eaf717e..dd17c49 100644
--- a/pages/tabbar/user/my.vue
+++ b/pages/tabbar/user/my.vue
@@ -18,28 +18,37 @@
       <u-icon style="display: flex;align-items: flex-start;" name="arrow-right"></u-icon>
     </view>
 	<!-- <button  type="default" @click="goTOSuccess">绔嬪嵆鏌ョ湅</button> -->
-	<view class="member-gradient-bg">	
-	 <view class="member-content">
-	      <view class="vip-icon">
-	        <image src="/static/tabbar/vip.png" mode="widthFix"></image>
-	      </view>
-	      <view class="vip-info">
-	        <p class="vip-level">缁挎弧绛愪細鍛�</p>
-	        <p class="vip-validity">闀挎湡鏈夋晥</p>
-	      </view>
-	      
-	      <!-- 浼氬憳鏍囪瘑瑁呴グ -->
-	      <view class="vip-badge">
-	        <text class="badge-text">灏婁韩鐗规潈</text>
-	      </view>
-	    </view>
+	<view class="member-gradient-bg" v-if="prizeActivity.enableStatus === 'ON'">
+    <view class="member-gradient-bg" @click="gotoPrizeActivity" >
+      <view class="activity-content">
+        <!-- 娲诲姩鍥炬爣锛堜娇鐢ㄦ帴鍙h繑鍥炵殑 activityCoverUrl锛� -->
+        <view class="activity-icon">
+          <view class="floating-btn-content">
+            <text class="floating-btn-icon">馃巵</text>
+          </view>
+
+<!--          <image :src="prizeActivity.activityCoverUrl" mode="aspectFit"></image>-->
+        </view>
+        <!-- 娲诲姩淇℃伅锛堝悕绉般�佹弿杩般�佸�掕鏃讹級 -->
+        <view class="activity-info">
+          <p class="activity-name">{{ prizeActivity.activityName }}</p>
+          <p class="activity-desc">{{ prizeActivity.activityDes }}</p>
+          <p class="activity-desc">{{ formatDate(prizeActivity.beginTime) }} - {{ formatDate(prizeActivity.endTime)}}</p>
+        </view>
+        <!-- 绔嬪嵆鍙備笌鍏ュ彛 -->
+        <view class="activity-enter">
+          <text class="enter-text">绔嬪嵆鍙備笌</text>
+          <u-icon name="arrow-right"></u-icon>
+        </view>
+      </view>
+    </view>
 		
 	</view>
     <!-- 绉垎锛屼紭鎯犲埜锛屽叧娉紝 -->
     <div class="pointBox box">
       <u-row text-align="center" gutter="16" class="point">
         <u-col text-align="center" span="4" @click="navigateTo('/pages/mine/deposit/operation')">
-          <view>棰勫瓨娆�</view>
+          <view>浣欓</view>
           <view class="money">{{ walletNum | unitPrice }}</view>
         </u-col>
 
@@ -95,13 +104,13 @@
 	      <view>
 	        <text class="iconfont">&#xe676;</text>
 	      </view>
-	      <view>瑙嗛涓婚〉</view>
+	      <view>鎴戠殑瑙嗛</view>
 	    </view>
 	    <view class="order-item" @click="navigateTo('/pages/mine/myAttention')">
 	      <view>
 	        <text class="iconfont">&#xe66f;</text>
 	      </view>
-	      <view>鍏虫敞鍒楄〃</view>
+	      <view>鎴戠殑鍏虫敞</view>
 	    </view>
 <!-- 	    <view class="order-item" @click="navigateTo('/pages/mine/myCollect/myCollect')">
 	      <view>
@@ -115,12 +124,12 @@
 		  </view>
 		  <view>鎴戠殑娲诲姩</view>
 		</view>
-		<view class="order-item" @click="navigateTo('/pages/mine/myTracks')">
+<!-- 		<view class="order-item" @click="navigateTo('/pages/mine/myTracks')">
 		  <view>
 		    <text class="iconfont">&#xe738;</text>
 		  </view>
 		  <view>娴忚璁板綍</view>
-		</view>
+		</view> -->
 	  </view>
 	</div>
 	
@@ -145,12 +154,17 @@
 import configs from '@/config/config'
 import storage from '@/utils/storage.js'
 import { getSessionId, userAction } from "@/api/userAction.js";
+import {getONPrizeActivity} from "@/api/prize-activity";
+import UIcon from "../../subComponents/uview-components/uview-ui/components/u-icon/u-icon.vue";
+
 export default {
   components: {
+    UIcon,
     tool
   },
   data() {
     return {
+      prizeActivity: {},
 	  endpoint: '',
       configs,
       userImage:configs.defaultUserPhoto,
@@ -174,6 +188,7 @@
     };
   },
   onLoad(option) {
+    this.actionParam.pageParams = JSON.stringify(option)
     console.log('-----------鍒嗕韩鍑虹殑鏁版嵁---------->', option)
     let shareStoreId = null;
     let shareTime = null;
@@ -205,45 +220,38 @@
       } catch (e) {
         console.error('瀛樺偍澶辫触锛�', e);
       }
-    }else{
-      shareStoreId = uni.getStorageSync('shareStoreId');
-      shareStoreId = uni.getStorageSync('shareTime');
-      console.log('浠庣紦瀛樿鍙栧弬鏁�:', { shareStoreId, shareTime });
-      // this.bindMemberAndStore(shareStoreId, shareTime)
-      if (shareStoreId && shareTime) {
-        console.log('妫�娴嬪埌鏈夋晥鍙傛暟锛岃皟鐢ㄥ悗绔帴鍙�');
-        this.bindMemberAndStore(shareStoreId, shareTime);
-      } else {
-        console.log('鏃犳湁鏁堝弬鏁帮紝鎵ц姝e父閫昏緫');
-      }
     }
     this.initCOS()
+	},
   onUnload() {
-    let	param = this.actionParam;
+    let	param = Object.assign({}, this.actionParam);
     if (this.sendOnShow)return
     param.pageStatus = "LEAVE"
     userAction(param)
   },
   onHide() {
     this.startHidenTime = Date.now()
-    let	param = this.actionParam;
+    let	param =Object.assign({}, this.actionParam);
     this.sendOnShow = true;
     param.pageStatus = "LEAVE"
     userAction(param)
   },
-  onLoad(options) {
-	  this.actionParam.pageParams = JSON.stringify(options)
-	  this.initCOS()
-  },
+  // onLoad(options) {
+	//
+	//   this.initCOS()
+  // },
   onShow() {
+    this.getONPrizeActivity();
 	  getSessionId().then(res=>{
 		this.pageSessionNo = res.data.data
+		this.actionParam.sessionId = res.data.data
 		if(this.pageSessionNo){
-		let	param = this.actionParam;
+		let	param = Object.assign({}, this.actionParam);
 			param.sessionId = this.pageSessionNo
 			userAction(param)
 		}
 	  })
+
     this.userInfo = this.$options.filters.isLogin() || {};
     if (this.$options.filters.isLogin("auth")) {
       this.getUserOrderNum();
@@ -252,10 +260,21 @@
       this.couponNum = 0;
       this.footNum = 0;
     }
+
+	let shareStoreId = uni.getStorageSync('shareStoreId');
+	let shareTime = uni.getStorageSync('shareTime');
+	console.log('浠庣紦瀛樿鍙栧弬鏁�:', { shareStoreId, shareTime });
+	if (shareStoreId && shareTime) {
+	  console.log('妫�娴嬪埌鏈夋晥鍙傛暟锛岃皟鐢ㄥ悗绔帴鍙�');
+	  this.bindMemberAndStore(shareStoreId, shareTime);
+	} else {
+	  console.log('鏃犳湁鏁堝弬鏁帮紝鎵ц姝e父閫昏緫');
+	}
   },
   onPullDownRefresh() {
     this.getUserOrderNum();
     this.userInfo = this.$options.filters.isLogin();
+    this.getONPrizeActivity(); // 涓嬫媺鍒锋柊鍚屾鏈�鏂版椿鍔ㄧ姸鎬�
   },
   // #ifndef MP
   onNavigationBarButtonTap(e) {
@@ -268,6 +287,48 @@
 
   mounted() { },
   methods: {
+    formatDate(isoTime) {
+      if (!isoTime) return '';
+      const date = new Date(isoTime);
+      const year = date.getFullYear();
+      const month = String(date.getMonth() + 1).padStart(2, '0');
+      const day = String(date.getDate()).padStart(2, '0');
+      return `${year}骞�${month}鏈�${day}鏃; // 杞崲涓轰腑鏂囨牸寮�
+    },
+    getONPrizeActivity(){
+      getONPrizeActivity().then(res =>{
+        if(res.statusCode=== 200){
+          //鍚庣娌℃煡鍒板紑鍚殑鎶藉娲诲姩 res.data.data.id鍊间负null
+          this.prizeActivity = res.data.data; // 瀛樺偍瀹屾暣娲诲姩鏁版嵁
+          if (this.prizeActivity.endTime) {
+          }else {
+            this.prizeActivity = {}; // 鏃犳椿鍔ㄦ椂娓呯┖
+          }
+        }
+      })
+    },
+    gotoPrizeActivity(){
+      uni.navigateTo({
+        url:'/pages/prize/PrizeDetail/PrizeDetail?id=' + this.prizeActivity.id,
+      });
+    },
+	  // 瑙f瀽URL鍙傛暟
+	  parseUrlParams(url) {
+	  	const params = {};
+	  	// 澶勭悊鍙兘瀛樺湪鐨刪ash锛堝鏋滄湁鐨勮瘽锛�
+	  	const cleanUrl = url.split('#')[0];
+	  	const queryStr = cleanUrl.split('?')[1] || '';
+
+	  	queryStr.split('&').forEach(pair => {
+	  		const [key, value] = pair.split('=');
+	  		if (key) {
+	  			// 濡傛灉鍊煎瓨鍦紝鍒欒В鐮侊紝鍚﹀垯璁句负绌哄瓧绗︿覆
+	  			params[key] = value ? decodeURIComponent(value) : '';
+	  		}
+	  	});
+
+	  	return params;
+	  },
     async bindMemberAndStore(shareStoreId, shareTime){
       let form ={
         shareStoreId: shareStoreId,
@@ -346,7 +407,28 @@
 body {
   overflow: auto;
 }
-  
+  .floating-btn-content {
+    display: flex;
+    flex-direction: column;
+    align-items: center;
+    justify-content: center;
+    z-index: 1;
+    position: relative;
+  }
+  .floating-btn-icon {
+    font-size: 75rpx;
+    color: white;
+    filter: drop-shadow(0 2rpx 4rpx rgba(0, 0, 0, 0.2));
+    margin-bottom: 5rpx;
+  }
+  .floating-btn-text {
+    font-size: 20rpx;
+    color: white;
+    z-index: 1;
+    position: relative;
+    text-shadow: 0 1rpx 3rpx rgba(0, 0, 0, 0.2);
+    white-space: nowrap;
+  }
 .member-gradient-bg {
 	width: 98%;
 	height: 250rpx;
@@ -359,7 +441,94 @@
 	  &:active {
 	    transform: scale(0.98);
 	  }
+  cursor: pointer; // 澧炲姞鐐瑰嚮鎸囬拡鏍峰紡
+  overflow: hidden; // 闃叉鍐呭婧㈠嚭
+  .activity-content {
+    width: 100%;
+    height: 100%;
+    display: flex;
+    align-items: center;
+    padding: 0 40rpx;
+    box-sizing: border-box;
+  }
+
+  // 娲诲姩鍥炬爣
+  .activity-icon {
+    width: 130rpx;
+    height: 130rpx;
+    margin-right: 24rpx;
+    border-radius: 16rpx;
+    overflow: hidden;
+    image {
+      width: 100%;
+      height: 100%;
+      object-fit: cover;
+    }
+  }
+
+  // 娲诲姩淇℃伅鍖哄煙
+  .activity-info {
+    flex: 1;
+    .activity-name {
+      font-size: 32rpx;
+      font-weight: bold;
+      color: #fff;
+      margin: 0 0 8rpx 0;
+      text-shadow: 0 2rpx 4rpx rgba(0,0,0,0.1);
+    }
+    .activity-desc {
+      font-size: 22rpx;
+      color: rgba(255,255,255,0.9);
+      margin: 0;
+    }
+  }
+
+  // 鍊掕鏃舵牱寮�
+  .activity-countdown {
+    display: flex;
+    align-items: center;
+    margin-top: 12rpx;
+    .countdown-label {
+      font-size: 20rpx;
+      color: rgba(255,255,255,0.8);
+      margin-right: 8rpx;
+    }
+    .countdown-box {
+      display: flex;
+      align-items: center;
+    }
+    .countdown-item {
+      display: inline-block;
+      width: 36rpx;
+      height: 36rpx;
+      line-height: 36rpx;
+      background: rgba(255,255,255,0.3);
+      border-radius: 8rpx;
+      color: #fff;
+      font-size: 20rpx;
+      text-align: center;
+      margin: 0 4rpx;
+    }
+    .countdown-sep {
+      color: #fff;
+      font-size: 22rpx;
+      margin: 0 4rpx;
+    }
+  }
+
+  // 绔嬪嵆鍙備笌鍏ュ彛
+  .activity-enter {
+    display: flex;
+    align-items: center;
+    .enter-text {
+      font-size: 24rpx;
+      color: #fff;
+      margin-right: 8rpx;
+      font-weight: 500;
+    }
+  }
 }
+
 /* 鍐呭鍖哄煙 */
 .member-content {
   width: 100%;

--
Gitblit v1.8.0