绿满眶商城微信小程序-uniapp
peng
昨天 d50a3ed44e2edab2a7a661c43491c3aa42c57794
pages/commodity-square/commoditySquare.vue
@@ -48,13 +48,13 @@
                     <view class="goodsName">
                        <text>{{item.goodsName}}</text>
                     </view>
                     <view class="goodsContent">
                     <view class="goodsContent" style="font-size: 24rpx;">
                        {{item.sellingPoint}}
                     </view>
                     <view
                        style="display: flex; justify-content: space-between;align-items:center; 100%;width: 100%;">
                        <view class="goodsPrice">¥{{item.price}}</view>
                        <view class="addCard" style="display: flex; align-items: center;">
                     <view
                        style="display: flex; justify-content: space-between;align-items:center;height: 100%;width: 100%;">
                        <view class="goodsPrice" style="padding: 20rpx 0;">¥{{item.price}}</view>
                        <view class="addCard" style="display: flex; align-items: center;" v-if="item.goodsType !=='VIRTUAL_GOODS'">
                           <view style="padding: 20rpx 0 20rpx 20rpx;" v-show="item.cardNum && item.cardNum>0"
                              @click.stop="miousCardNum($event,item.id)">
                              <uni-icons type="minus" size="30" color="#96a6bc"></uni-icons>
@@ -100,6 +100,7 @@
<script>
   import TopBar from "@/components/TopBar.vue";
   import { getSessionId, userAction } from "@/api/userAction.js";
   import {
      getCategoryList,
      getGoodsList,
@@ -155,6 +156,17 @@
               order: 'asc',
               sort: 'goodsSort'
            },
              pageSessionNo:"",
          sendOnShow:false,
              actionParam:{
                  sessionId:'',
                  actionType:"PAGE",
                  joinType:"SELF",
                  pageCode:"SHOPPING_SQUARE",
                  pageParams:"{}",
                  pageStatus:"JOIN",
                  pageType:"LIST"
               }
         }
      },
      methods: {
@@ -413,8 +425,32 @@
            console.log(this.maxPages)
         }
      },
    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)
    },
      onShow() {
        getSessionId().then(res=>{
         this.pageSessionNo = res.data.data
         if(this.pageSessionNo){
         let   param = this.actionParam;
            param.sessionId = this.pageSessionNo
            userAction(param)
         }
        })
      },
      async onLoad(options) {
         this.actionParam.pageParams = JSON.stringify(options)
      async onLoad() {
         await this.getCartList();
         // 获取状态栏高度
         const systemInfo = uni.getSystemInfoSync();
@@ -518,6 +554,7 @@
      overflow: hidden;
      text-overflow: ellipsis;
      vertical-align: middle;
      color: #e7c463;
   }
   .goodsPrice {