绿满眶商城微信小程序-uniapp
peng
2 天以前 d50a3ed44e2edab2a7a661c43491c3aa42c57794
pages/cusbar/cart/cartList.vue
@@ -14,7 +14,7 @@
      </view>
    </view>
    <!-- 店铺商品信息 -->
    <div class="content" :style="{height: windowHeight - marginBottom - 50 + 'px'}">
    <div class="content" :style="{height: windowHeight - marginBottom - 200 + 'px'}">
      <div class="box box2" :class="{ invalid: isInvalid(item) }" v-for="(item, index) in cartDetail.cartList"
        :key="index">
        <view class="tab">
@@ -188,6 +188,7 @@
import '@/components/uview-components/uview-ui';
import * as API_Trade from "@/api/trade";
import { debounce } from "@/utils/tools.js";
import { getSessionId, userAction } from "@/api/userAction.js";
// import uniNumberBox from '@/components/uni-number-box'
export default {
  data() {
@@ -220,7 +221,18 @@
      checkout: false, //全选按钮
      WEIXIN_num: "", //购物车兼容微信步进器
     marginBottom: 0 ,// 底部安全区域
     windowHeight: 0 // 可使用屏幕高度
     windowHeight: 0 ,// 可使用屏幕高度
     pageSessionNo:"",
    sendOnShow:false,
     actionParam:{
         sessionId:'',
         actionType:"PAGE",
         joinType:"SELF",
         pageCode:"CART_LIST",
         pageParams:"{}",
         pageStatus:"JOIN",
         pageType:"DETAIL"
      }
    };
  },
@@ -235,10 +247,35 @@
  onPullDownRefresh(){
    this.getCardData();
  },
  onUnload() {
    let   param = this.actionParam;
    if (this.sendOnShow)return
    param.pageStatus = "LEAVE"
    userAction(param)
  },
  onHide() {
    this.startHidenTime = Date.now()
    let   param = this.actionParam;
    this.sendOnShow = true;
    param.pageStatus = "LEAVE"
    userAction(param)
  },
  onLoad(options) {
        this.actionParam.pageParams = JSON.stringify(options)
  },
  /**
   * 初始化信息
   */
  onShow() {
     getSessionId().then(res=>{
      this.pageSessionNo = res.data.data
      if(this.pageSessionNo){
      let   param = this.actionParam;
         param.sessionId = this.pageSessionNo
         userAction(param)
      }
     })
    this.deleteShow ? (this.deleteShow = false) : true;
   this.getCardData();
      // if (this.$refs.swiperAction) {
@@ -719,6 +756,7 @@
.content {
  padding: 20rpx 0 20rpx 0;
  margin-bottom: 80rpx;
  overflow: auto;
}
.line {