xuxueyang
2024-09-11 1a8ac8e42a0ee286f1f67de3fbf8fa5f422d7dd4
sub_pages/customer/self/history.vue
@@ -26,6 +26,7 @@
      },
      onLoad() {
         this.listApi = '/api/browse/history/list'
         this.page.size = 30
         this.getList()
         this.$http.request('get', '/api/code/value', {
@@ -54,7 +55,31 @@
            })
         })
      },
      onShow() {
         // 页面显示时重新加载浏览记录数据
         this.listApi = '/api/browse/history/list'
         this.page.size = 30
         this.refreshList()
      },
      methods: {
         async deleteExpired() {
            await this.$message.confirm('是否清空已失效的商品')
            this.$message.showLoading()
            const {
               code
            } = await this.$http.request('post', '/api/browse/history/clear', {
               data: {
               }
            })
            this.$message.hideLoading()
            if (code === 0) {
               this.refreshList()
            }
         },
         toDetail(item) {
            if (item.status == 'UP') {
@@ -169,13 +194,19 @@
            </view>
         </view>
         <view class="component-filter-container p10">
            <view class="flex1" @click.stop="order_show=true">
               {{ this.query.columnStr || '排序' }}
            <!-- @click.stop="order_show=true" -->
            <view class="flex1" @click.stop="$refs.popup_column.open()">
               排序{{ query.columnStr&&('-'+query.columnStr) || '' }}
               <image src="../../../static/common/icon-arrow-down.png" class="icon-arrow-down"></image>
            </view>
            <view class="flex1" @click.stop="level_show=true">
               {{ this.query.levelStr || '级别' }}
            <!-- @click.stop="level_show=true" -->
            <view class="flex1" @click.stop="$refs.popup_level.open()">
               {{ query.levelStr || '级别' }}
               <image src="../../../static/common/icon-arrow-down.png" class="icon-arrow-down"></image>
            </view>
            <view class="flex1" @click="deleteExpired()">
               一键清空已失效
               <!-- <image src="../../../static/common/icon-arrow-down.png" class="icon-arrow-down"></image> -->
            </view>
         </view>
      </view>
@@ -189,24 +220,32 @@
         @cancel="order_show=false"></u-picker>
      <view class="trade-list-container">
         <view class="trade-info-container flex"  :class="[dto.status]"
         v-for="(dto,index) of list" :key="index">
            <image class="img img100 br-4 m-r-10" :src="dto.url||dto.cover" @click.stop="toDetail(dto)"></image>
         <view class="trade-info-container flex" :class="[dto.status!=='UP'?'OFF':'']" v-for="(dto,index) of list"
            :key="index">
            <image class="img img100 br-4 m-r-10" :class="[!dto.stock?'component-stock-zero':'',dto.status!=='UP'?'component-status-zero':'']"
               :src="dto.url||dto.cover" @click.stop="toDetail(dto)"></image>
            <view class="flex1">
               <view class="flex" @click.stop="toDetail(dto)">
                  <view class="title">
                     <span class="m-r-5" style="display: inline-block;"
                        v-if="dto.categoryStr">{{dto.categoryStr||''}}</span>
                     <!-- <span class="m-r-5" style="display: inline-block;" -->
                        <!-- v-if="dto.categoryStr">{{dto.categoryStr||''}}</span> -->
                     <span v-if="dto.levelStr" class="m-r-5"
                        style="display: inline-block;">{{ dto.levelStr || '' }}</span>
                     {{ dto.name || '-' }}
                  </view>
                  <view class="price m-l-a m-r-0">
                     ¥{{ dto.price || '-' }}/扎
                  <view class="price m-l-a m-r-0 component-price-new">
                     <span class="tip">会员价</span>¥<span class="p">{{ dto.priceMember || dto.price || '-' }}</span>/扎
                     <view class="component-price-old">
                        ¥{{dto.price}}/扎
                     </view>
                  </view>
               </view>
               <view class="flex">
                  <view class="desc p-t-12 flex" @click.stop="toDetail(dto)">
                     <view class="m-r-15"> 已售:{{ ((dto.sales||0) +(dto.realSales||0))  || 0 }}                     </view>
                     <view class="m-r-15">剩余:{{ dto.stock || 0 }}</view>
                     <view class="m-r-15">颜色:{{ dto.color || '-' }}</view>
                  </view>
@@ -232,6 +271,58 @@
         </view>
      </view>
      <uni-popup ref="popup_level" type="bottom">
         <view class="component-popup_input_all">
            <view class="text-center m-b-40" style="font-size: 48rpx;font-weight: 600;">点击选择不同级别</view>
            <view v-for="(item,i) in level_columns" :key="i" class="m-t-20">
               <view class="m-t-12 flex value-items">
                  <view class="value-item" @click="()=>{
                     if(each.value!==query.value){
                        query.level = each.value
                        query.levelStr = each.label
                        refreshList()
                        $refs.popup_level.close()
                     }
                  }" :class="[query.level==each.value?'cur':'']" v-for="(each, j) in item" :key="j">
                     {{ each.label || '-' }}
                  </view>
               </view>
            </view>
            <view class="button-space"></view>
            <view>
               <view class="button-green" @click="$refs.popup_level.close()">关闭
               </view>
            </view>
         </view>
      </uni-popup>
      <uni-popup ref="popup_column" type="bottom">
         <view class="component-popup_input_all">
            <view class="text-center m-b-40" style="font-size: 48rpx;font-weight: 600;">点击选择不同排序</view>
            <view v-for="(item,i) in order_columns" :key="i" class="m-t-20">
               <view class="m-t-12 flex value-items">
                  <view class="value-item" @click="()=>{
                     if(each.value!==query.value){
                        query.column = each.value
                        query.columnStr = each.label
                        refreshList()
                        $refs.popup_column.close()
                     }
                  }" :class="[query.column==each.value?'cur':'']" v-for="(each, j) in item" :key="j">
                     {{ each.label || '-' }}
                  </view>
               </view>
            </view>
            <view class="button-space"></view>
            <view>
               <view class="button-green" @click="$refs.popup_column.close()">关闭
               </view>
            </view>
         </view>
      </uni-popup>
   </view>
</template>
@@ -269,9 +360,9 @@
      }
      .trade-info-container.UP {
      .trade-info-container.OFF {
         .title {
            color: #000000;
            color: #666;
         }
      }
@@ -294,7 +385,7 @@
            font-weight: 600;
            font-size: 28rpx;
            color: #333;
            color: #000;
            line-height: 40rpx;
            .level {