绿满眶商城微信小程序-uniapp
zxl
2 天以前 f84321103bc873303c7184accbc2d7e8aeca7171
pages/cart/coupon/couponCenter.vue
@@ -24,10 +24,22 @@
                     <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>
@@ -54,6 +66,7 @@
   import {
      getAllCoupons
   } from "@/api/promotions.js";
   import { getSessionId, userAction } from "@/api/userAction.js";
   export default {
      data() {
         return {
@@ -65,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();
      },