From c8cef398fbf1f9b63dbf23637ef520b421515dc9 Mon Sep 17 00:00:00 2001
From: zxl <763096477@qq.com>
Date: 星期四, 20 十一月 2025 10:13:08 +0800
Subject: [PATCH] 领劵中心修改显示,售后修改银行信息非必填
---
pages/tabbar/user/my.vue | 473 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++--
1 files changed, 451 insertions(+), 22 deletions(-)
diff --git a/pages/tabbar/user/my.vue b/pages/tabbar/user/my.vue
index a86a497..dd17c49 100644
--- a/pages/tabbar/user/my.vue
+++ b/pages/tabbar/user/my.vue
@@ -6,7 +6,8 @@
</view>
<view class="header" @click="userDetail">
<view class="head-1">
- <image :src="userInfo.face || userImage"></image>
+ <image v-if="userInfo.face" :src="endpoint + '/' + userInfo.face"></image>
+ <image v-else :src="userImage"></image>
</view>
<view class="head-2" v-if="userInfo.id">
<view class="user-name">{{ userInfo.nickName }}</view>
@@ -16,11 +17,38 @@
</view>
<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" 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>
@@ -68,24 +96,76 @@
</view>
</view>
</div>
+
+ <!-- 瑙嗛鐩稿叧锛� -->
+ <div class="pointBox box" style="margin-top: 20rpx;">
+ <view class="order">
+ <view class="order-item" @click="jumpToVideoHome()">
+ <view>
+ <text class="iconfont"></text>
+ </view>
+ <view>鎴戠殑瑙嗛</view>
+ </view>
+ <view class="order-item" @click="navigateTo('/pages/mine/myAttention')">
+ <view>
+ <text class="iconfont"></text>
+ </view>
+ <view>鎴戠殑鍏虫敞</view>
+ </view>
+<!-- <view class="order-item" @click="navigateTo('/pages/mine/myCollect/myCollect')">
+ <view>
+ <text class="iconfont"></text>
+ </view>
+ <view>鏀惰棌鍒楄〃</view>
+ </view -->
+ <view class="order-item" @click="navigateTo('/pages/mine/activity/myActivity')">
+ <view>
+ <text class="iconfont"></text>
+ </view>
+ <view>鎴戠殑娲诲姩</view>
+ </view>
+<!-- <view class="order-item" @click="navigateTo('/pages/mine/myTracks')">
+ <view>
+ <text class="iconfont"></text>
+ </view>
+ <view>娴忚璁板綍</view>
+ </view> -->
+ </view>
+ </div>
+
<!-- 甯哥敤宸ュ叿 -->
-
- <tool />
+ <view class="pointBox box" style="margin-top: 20rpx;">
+ <tool />
+ </view>
+ <!-- 鎾戣捣涓嬫柟 -->
+ <view style="height:64px;">
+
+ </view>
<custom-tabbar bgColor="#ffffff" selected="my"></custom-tabbar>
+
</view>
</template>
<script>
-import '@/components/uview-components/uview-ui';
+import '@/pages/subComponents/uview-components/uview-ui';
import tool from "@/pages/tabbar/user/utils/tool.vue";
-import { getCouponsNum, getFootprintNum } from "@/api/members.js";
+import { getSTSToken } from "@/api/common.js";
+import { getCouponsNum, getFootprintNum,bindMemberAndStore } from "@/api/members.js";
import { getUserWallet } from "@/api/members";
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,
coverTransform: "translateY(0px)",
@@ -95,10 +175,83 @@
couponNum: "",
footNum: "",
walletNum: "",
+ pageSessionNo:"",
+ actionParam:{
+ sessionId:'',
+ actionType:"PAGE",
+ joinType:"SELF",
+ pageCode:"TBA_BAR_MY",
+ pageParams:"{}",
+ pageStatus:"JOIN",
+ pageType:"DETAIL"
+ }
};
},
- onLoad() { },
+ onLoad(option) {
+ this.actionParam.pageParams = JSON.stringify(option)
+ console.log('-----------鍒嗕韩鍑虹殑鏁版嵁---------->', option)
+ let shareStoreId = null;
+ let shareTime = null;
+ // 妫�鏌ユ槸鍚﹀瓨鍦╭鍙傛暟
+ if (option.q) {
+ // 鍙岄噸瑙g爜锛氬井淇″URL杩涜浜嗕袱娆$紪鐮�
+ const decodedUrl = decodeURIComponent(decodeURIComponent(option.q));
+ console.log('鍘熷URL:', decodedUrl);
+
+ // 瑙f瀽URL涓殑鏌ヨ鍙傛暟
+ const params = this.parseUrlParams(decodedUrl);
+ shareStoreId = params.shareStoreId;
+ try {
+ // 灏嗘暟鎹瓨鍌ㄥ埌鏈湴缂撳瓨
+ uni.setStorageSync('shareStoreId', shareStoreId);
+ //鍒涘缓涓�涓壂鐮佺殑鏃堕棿
+ // 鑾峰彇褰撳墠鏃堕棿骞舵牸寮忓寲涓� yyyy-MM-dd HH:mm:ss
+ const now = new Date();
+ const year = now.getFullYear();
+ const month = String(now.getMonth() + 1).padStart(2, '0'); // 鏈堜唤浠�0寮�濮嬶紝闇�瑕�+1
+ const day = String(now.getDate()).padStart(2, '0');
+ const hours = String(now.getHours()).padStart(2, '0');
+ const minutes = String(now.getMinutes()).padStart(2, '0');
+ const seconds = String(now.getSeconds()).padStart(2, '0');
+
+ shareTime = `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
+ uni.setStorageSync('shareTime', shareTime);
+ console.log('鏁版嵁瀛樺偍鎴愬姛');
+ } catch (e) {
+ console.error('瀛樺偍澶辫触锛�', e);
+ }
+ }
+ this.initCOS()
+ },
+ onUnload() {
+ let param = Object.assign({}, this.actionParam);
+ if (this.sendOnShow)return
+ param.pageStatus = "LEAVE"
+ userAction(param)
+ },
+ onHide() {
+ this.startHidenTime = Date.now()
+ let param =Object.assign({}, this.actionParam);
+ this.sendOnShow = true;
+ param.pageStatus = "LEAVE"
+ userAction(param)
+ },
+ // 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 = Object.assign({}, this.actionParam);
+ param.sessionId = this.pageSessionNo
+ userAction(param)
+ }
+ })
+
this.userInfo = this.$options.filters.isLogin() || {};
if (this.$options.filters.isLogin("auth")) {
this.getUserOrderNum();
@@ -107,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) {
@@ -123,6 +287,89 @@
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,
+ shareTime: shareTime
+ }
+ // let form ={
+ // shareStoreId: "1376433565247471616",
+ // shareTime: "2025-09-26 16:18:00"
+ // }
+ try {
+ const res = await bindMemberAndStore(form);
+ if(res.statusCode === 200){
+ //娓呴櫎缂撳瓨
+ uni.removeStorageSync('shareStoreId');
+ uni.removeStorageSync('shareTime');
+ }
+ }
+ catch(error) {
+ console.error('鍑洪敊:', error);
+ };
+ },
+ // goTOSuccess(){
+ // uni.redirectTo({
+ // url:"/pages/cart/payment/success?paymentMethod=WECHAT" +
+ // "&payPrice=" +
+ // 10,
+ // });
+ // },
+ // 鍒濆鍖栬吘璁簯cos瀹㈡埛绔�
+ initCOS() {
+ // 璋冪敤鍚庣鑾峰彇sts涓存椂璁块棶鍑瘉
+ getSTSToken().then(res => {
+ this.endpoint = res.data.data.endpoint
+ })
+ },
+ // 璺宠浆瑙嗛涓婚〉
+ jumpToVideoHome() {
+ uni.navigateTo({
+ url: '/pages/video/home-page?authorId=' + storage.getUserInfo().id
+ });
+ },
/**
* 缁熶竴璺宠浆鎺ュ彛,鎷︽埅鏈櫥褰曡矾鐢�
* navigator鏍囩鐜板湪榛樿娌℃湁杞満鍔ㄧ敾锛屾墍浠ョ敤view
@@ -155,27 +402,207 @@
</script>
<style lang="scss" scoped>
+ @import url("/pages/subComponents/static/bgStyle.css");
html,
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;
+ margin: 1% 1%;
+ background: linear-gradient(135deg, #FF7A45 0%, #FF5252 100%);
+ border-radius: 24rpx;
+ box-shadow: 0 8rpx 30rpx rgba(255, 82, 82, 0.3);
+ transition: all 0.3s ease;
+
+ &: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%;
+ height: 100%;
+ display: flex;
+ align-items: center;
+ padding: 0 40rpx;
+ box-sizing: border-box;
+}
+/* 浼氬憳淇℃伅 */
+.vip-info {
+ flex: 1;
+ .vip-level {
+ font-size: 40rpx;
+ font-weight: bold;
+ color: #FFFFFF;
+ margin: 0;
+ line-height: 1;
+ text-shadow: 0 2rpx 4rpx rgba(0, 0, 0, 0.1);
+ }
+
+ .vip-validity {
+ font-size: 26rpx;
+ color: rgba(255, 255, 255, 0.9);
+ margin: 10rpx 0 0 0;
+ }
+}
+
+/* 浼氬憳鍥炬爣 */
+.vip-icon {
+ width: 100rpx;
+ height: 100rpx;
+ margin-right: 30rpx;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ background-color: rgba(255, 255, 255, 0.2);
+ border-radius: 50%;
+}
+
+.vip-icon image {
+ width: 60rpx;
+ height: 60rpx;
+}
+/* 鐗规潈鏍囪瘑 */
+.vip-badge {
+ padding: 8rpx 20rpx;
+ background-color: rgba(255, 215, 0, 0.9);
+ border-radius: 30rpx;
+ box-shadow: 0 3rpx 6rpx rgba(0, 0, 0, 0.1);
+}
+
+.badge-text {
+ font-size: 24rpx;
+ color: #E63946;
+ font-weight: 600;
+}
.money {
overflow: hidden;
-
text-overflow: ellipsis;
white-space: nowrap;
}
.user {
+ background: #e7e7e7;
.header {
max-width: 100%;
padding: calc(50rpx + var(--status-bar-height)) 30rpx 0 6%;
- height: calc(var(--status-bar-height) + 360rpx);
+ height: calc(360rpx);
background-size: cover;
border-bottom-left-radius: 30rpx;
border-bottom-right-radius: 30rpx;
- background-image: url("/static/img/main-bg.png");
+ background-image: var(--main-bg);
background-position: bottom;
background-repeat: no-repeat;
color: #ffffff;
@@ -226,14 +653,6 @@
}
}
- .pointBox {
- width: 94%;
- margin: 0 3%;
- background: #fff;
- border-radius: 20rpx;
- box-shadow: 0 4rpx 24rpx 0 rgba($color: #f6f6f6, $alpha: 1);
- }
-
.point {
text-align: center;
height: 160rpx;
@@ -265,8 +684,12 @@
justify-content: space-around;
align-items: center;
padding: 0 3%;
- color: #999;
-
+ color: #666;
+ background: #fff;
+ border-radius: 20rpx;
+ box-shadow: 0 4rpx 24rpx 0 #f6f6f6;
+ margin: 0 20rpx;
+
.order-item {
position: relative;
line-height: 2em;
@@ -274,14 +697,20 @@
:first-child {
font-size: 48rpx;
- margin-bottom: 10rpx;
+ margin-bottom: 12rpx;
+ color: #333;
}
}
}
+
}
.box {
- transform: translateY(-30rpx);
+ width: 95%;
+ margin: auto;
+ background: #fff;
+ border-radius: 20rpx;
+ box-shadow: 0 4rpx 24rpx 0 #f6f6f6;
}
.user-name {
--
Gitblit v1.8.0