From f84321103bc873303c7184accbc2d7e8aeca7171 Mon Sep 17 00:00:00 2001
From: zxl <763096477@qq.com>
Date: 星期四, 20 十一月 2025 14:57:46 +0800
Subject: [PATCH] 表情
---
pages/cart/coupon/couponCenter.vue | 66 +++++++++++++++++++++++++++++---
1 files changed, 59 insertions(+), 7 deletions(-)
diff --git a/pages/cart/coupon/couponCenter.vue b/pages/cart/coupon/couponCenter.vue
index 67cca9e..775247d 100644
--- a/pages/cart/coupon/couponCenter.vue
+++ b/pages/cart/coupon/couponCenter.vue
@@ -24,15 +24,27 @@
<view>
<!-- 鏍规嵁scopeType 鍒ゆ柇鏄惁鏄� 骞冲彴銆佸搧绫绘垨搴楅摵 -->
<view class="coupon-title wes-3" v-if="item.scopeType">
- <span v-if="item.scopeType == 'ALL' && item.storeId == '0'">鍏ㄥ钩鍙�</span>
- <span v-if="item.scopeType == 'PORTION_GOODS_CATEGORY'">浠呴檺鍝佺被</span>
- <view v-else>{{ item.storeName == 'platform' ? '鍏ㄥ钩鍙�' :item.storeName+'搴楅摵' }}浣跨敤
- </view>
+ 浣跨敤鑼冨洿锛歿{
+ item.scopeType == "ALL" && item.storeId == "0"
+ ? "鍏ㄥ钩鍙�"
+ : item.scopeType == "PORTION_GOODS"
+ ? "閮ㄥ垎鍟嗗搧"
+ : item.scopeType == "PORTION_GOODS_CATEGORY"
+ ? "閮ㄥ垎鍒嗙被鍟嗗搧"
+ : item.storeName == "platform"
+ ? "鍏ㄥ钩鍙�"
+ : item.storeName + ""
+ }}浣跨敤
+<!-- <span v-if="item.scopeType == 'ALL' && item.storeId == '0'">鍏ㄥ钩鍙�</span>-->
+<!-- <span v-if="item.scopeType == 'PORTION_GOODS_CATEGORY'">浠呴檺鍝佺被</span>-->
+<!-- <view v-else>{{ item.storeName == 'platform' ? '鍏ㄥ钩鍙�' :item.storeName+'搴楅摵' }}浣跨敤-->
+<!-- </view>-->
+
</view>
<view v-if="item.endTime">鏈夋晥鏈熻嚦锛歿{ item.endTime.split(" ")[0] }}</view>
</view>
<view class="receive" @click="receive(item)">
- <text>鐐瑰嚮</text><br />
+ <text>{{item.owned ? '宸�' : '鐐瑰嚮'}}</text><br />
<text>棰嗗彇</text>
</view>
<view class="bg-quan"> 鍒� </view>
@@ -50,9 +62,11 @@
import {
receiveCoupons
} from "@/api/members.js";
+ import { getMemberCoupons } from "@/api/members.js";
import {
getAllCoupons
} from "@/api/promotions.js";
+ import { getSessionId, userAction } from "@/api/userAction.js";
export default {
data() {
return {
@@ -64,10 +78,45 @@
pageSize: 10,
},
storeId: "", //搴楅摵 id,
- couponData: ""
+ couponData: "",
+ sendOnShow:false,
+ pageSessionNo:"",
+ actionParam:{
+ sessionId:'',
+ actionType:"PAGE",
+ joinType:"SELF",
+ pageCode:"COUPON_CENTER",
+ pageParams:"{}",
+ pageStatus:"JOIN",
+ pageType:"LIST"
+ }
};
},
+ 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)
+ },
+ onShow() {
+ getSessionId().then(res=>{
+ this.pageSessionNo = res.data.data
+ this.actionParam.sessionId = this.pageSessionNo
+ if(this.pageSessionNo){
+ let param = Object.assign({}, this.actionParam);
+ userAction(param)
+ }
+ })
+ },
onLoad(option) {
+ this.actionParam.pageParams = JSON.stringify(option)
this.storeId = option.storeId;
this.getCoupon();
},
@@ -116,6 +165,7 @@
.catch((err) => {
if (this.$store.state.isShowToast){ uni.hideLoading() };
});
+ console.log(this.couponList)
},
/**
* 棰嗗彇浼樻儬鍒�
@@ -124,12 +174,14 @@
this.$u.throttle(()=>{
this.fetchCoupon(val)
}, 1500)
-
},
fetchCoupon(val){
receiveCoupons(val.id).then((res) => {
if (res.data.code == 200) {
+ //淇敼鐐瑰嚮鐨勪紭鎯犲嵎褰撳墠鐨勯鍙栫姸鎬�
+ val.owned = res.data.result.owned;
+ console.log(res.data)
uni.showToast({
title: "棰嗗彇鎴愬姛",
icon: "none",
--
Gitblit v1.8.0