|
@@ -1,938 +0,0 @@
|
|
|
-<template>
|
|
|
- <view class="container all-type-list-wrapper">
|
|
|
- <!-- 自定义顶部 -->
|
|
|
- <custom-floor :systeminfo='systeminfo' :navbar-data='nvabarData' :headerBtnPosi ="headerBtnPosi"></custom-floor>
|
|
|
- <view class="tui-header-screen" :style="{top:CustomBar+'px'}">
|
|
|
- <view class="tui-screen-top">
|
|
|
- <view class="tui-top-item" :class="[tabIndex ==0 ?'tui-active':'']" @tap="handleScreen" data-index="0">综合</view>
|
|
|
- <view class="tui-top-item tui-icon-ml" :class="[tabIndex==1?'tui-active':'']" data-index="1" @tap="handleScreen">
|
|
|
- <view>销量</view>
|
|
|
- <text class="iconfont icon-shangxiajiantou" v-if="isSearchSalesFirst"></text>
|
|
|
- <template v-else>
|
|
|
- <tui-icon :name="isSearchSales ? 'turningdown':'turningup'" :size="18" :color="tabIndex==1 ?'#e15616':'#999'" tui-icon-class="tui-ml"></tui-icon>
|
|
|
- </template>
|
|
|
- </view>
|
|
|
- <view class="tui-top-item tui-icon-ml" :class="[tabIndex==2?'tui-active':'']" data-index="2" @tap="handleScreen">
|
|
|
- <view>人气</view>
|
|
|
- <text class="iconfont icon-shangxiajiantou" v-if="isSearchMoodFirst"></text>
|
|
|
- <template v-else>
|
|
|
- <tui-icon :name="isSearchMood ? 'turningdown':'turningup'" :size="18" :color="tabIndex==2 ?'#e15616':'#999'" tui-icon-class="tui-ml"></tui-icon>
|
|
|
- </template>
|
|
|
- </view>
|
|
|
- <view class="tui-top-item tui-icon-ml" :class="[tabIndex==3?'tui-active':'']" data-index="3" @tap="handleScreen">
|
|
|
- <view>价格</view>
|
|
|
- <text class="iconfont icon-shangxiajiantou" v-if="isSearchPriceFirst"></text>
|
|
|
- <template v-else>
|
|
|
- <tui-icon :name="isSearchPrice ? 'turningdown':'turningup'" :size="18" :color="tabIndex==3?'#e15616':'#999'" tui-icon-class="tui-ml"></tui-icon>
|
|
|
- </template>
|
|
|
- </view>
|
|
|
- <view class="tui-top-item" @tap="handleScreen" data-index="4">
|
|
|
- <view>筛选</view>
|
|
|
- <text class="iconfont icon-shaixuan"></text>
|
|
|
- </view>
|
|
|
- </view>
|
|
|
- </view>
|
|
|
- <!-- 商品列表 -->
|
|
|
- <list-skeleton v-if="showSkeleton" :listType='0'></list-skeleton>
|
|
|
- <template v-else>
|
|
|
- <view class="empty-container" v-if="showEmpty">
|
|
|
- <image class="empty-container-image" src="https://img.caimei365.com/group1/M00/03/71/Cmis2F3wna6AY2ZjAABpmnBICH4247.png"></image>
|
|
|
- <text class="error-text">{{emptyText}}</text>
|
|
|
- </view>
|
|
|
- <template v-else>
|
|
|
- <view class="container-list" :style="{'height':scrollHeight+'px',paddingTop:(CustomBar+44)+'px'}">
|
|
|
- <view v-for="(item,index) in listData" :key="index" :id="item.p_id" class="all-type-list-content commodity-list" @click.stop="navToDetailPage(item.p_id)">
|
|
|
- <image mode='widthFix' :src="item.p_image" class="list-img" alt="list-img"></image>
|
|
|
- <view class="list-details-info">
|
|
|
- <text class="list-details-title">
|
|
|
- <text class="mclap-tag" v-if="item.p_act_flag == '1'">美博会</text>
|
|
|
- <text class="mclap" :class="item.p_act_flag =='1' ? 'indent' : ''">{{ item.p_name }}</text>
|
|
|
- </text>
|
|
|
- <text class="list-details-specs">规格:{{item.p_unit}}</text>
|
|
|
- <view class="list-details-specs" v-if="item.p_code!=''&&item.p_code!=null">商品编码:{{item.p_code}}</view>
|
|
|
- <view class="list-details-price">
|
|
|
- <template v-if="userIdentity == 3">
|
|
|
- <view class="floor-item-act" v-if="item.actStatus==1">
|
|
|
- <view class="floor-tags" v-if="PromotionsFormat(item.promotions)">
|
|
|
- {{item.promotions.name}}<text v-if="item.p_price_flag != '1' && item.supplierId === shopId">:¥{{ item.price | NumFormat }}</text>
|
|
|
- </view>
|
|
|
- <view class="floor-tags" v-else>{{item.promotions.name}}</view>
|
|
|
- </view>
|
|
|
- <view class="floor-item-act" v-if="item.actStatus ==0 && item.ladderPriceFlag==1">
|
|
|
- <view class="floor-tags">阶梯价格</view>
|
|
|
- </view>
|
|
|
- </template>
|
|
|
- <template v-else>
|
|
|
- <view class="floor-item-act" v-if="item.actStatus==1">
|
|
|
- <view class="floor-tags" v-if="PromotionsFormat(item.promotions)">
|
|
|
- {{item.promotions.name}}<text v-if="hasLogin && item.p_price_flag != '1'">:¥{{ item.price | NumFormat }}</text>
|
|
|
- </view>
|
|
|
- <view class="floor-tags" v-else>{{item.promotions.name}}</view>
|
|
|
- </view>
|
|
|
- <view class="floor-item-act" v-if="item.actStatus ==0 && item.ladderPriceFlag==1">
|
|
|
- <view class="floor-tags">阶梯价格</view>
|
|
|
- </view>
|
|
|
- </template>
|
|
|
- <view v-if="hasLogin" class="list-price">
|
|
|
- <template v-if="userIdentity == 1">
|
|
|
- <text v-if="priceLoading" class="price-larger small">正在获取价格...</text>
|
|
|
- <template v-else>
|
|
|
- <text class="price-larger" :class="PromotionsFormat(item.promotions) ? 'none' : ''">
|
|
|
- ¥{{ (PromotionsFormat(item.promotions) ? item.originalPrice : item.price) | NumFormat}}
|
|
|
- </text>
|
|
|
- </template>
|
|
|
- </template>
|
|
|
- <template v-if="userIdentity == 4">
|
|
|
- <view class="price-larger" v-if="item.p_price_flag == '1'">
|
|
|
- <text class="txt">¥未公开价格</text>
|
|
|
- </view>
|
|
|
- <view class="price-larger" v-if="item.p_price_flag == '2'">
|
|
|
- <text class="txt">¥价格仅会员可见</text>
|
|
|
- </view>
|
|
|
- <text v-else-if="priceLoading" class="price-larger small">正在获取价格...</text>
|
|
|
- <template v-else>
|
|
|
- <text class="price-larger" :class="PromotionsFormat(item.promotions) ? 'none' : ''">
|
|
|
- ¥{{ (PromotionsFormat(item.promotions) ? item.originalPrice : item.price) | NumFormat}}
|
|
|
- </text>
|
|
|
- </template>
|
|
|
- </template>
|
|
|
- <template v-if="userIdentity == 3">
|
|
|
- <template v-if="item.supplierId === shopId">
|
|
|
- <view class="price-larger" v-if="item.p_price_flag == '1'">
|
|
|
- <text class="txt">¥未公开价格</text>
|
|
|
- </view>
|
|
|
- <text v-else-if="priceLoading" class="price-larger small">正在获取价格...</text>
|
|
|
- <text v-else class="price-larger" :class="PromotionsFormat(item.promotions) ? 'none' : ''">
|
|
|
- ¥{{ (PromotionsFormat(item.promotions) ? item.originalPrice : item.price) | NumFormat}}
|
|
|
- </text>
|
|
|
- </template>
|
|
|
- <template v-else>
|
|
|
- <view class="list-login-now">
|
|
|
- <text class="p-no">¥</text>
|
|
|
- <uni-grader :grade="Number(item.p_price_grade)"></uni-grader>
|
|
|
- </view>
|
|
|
- </template>
|
|
|
- </template>
|
|
|
- <template v-if="userIdentity == 2">
|
|
|
- <view class="price-larger" v-if="item.p_price_flag == '1'">
|
|
|
- <text class="txt">¥未公开价格</text>
|
|
|
- </view>
|
|
|
- <text v-else-if="priceLoading" class="price-larger small">正在获取价格...</text>
|
|
|
- <template v-else>
|
|
|
- <text class="price-larger" :class="PromotionsFormat(item.promotions) ? 'none' : ''">
|
|
|
- ¥{{ (PromotionsFormat(item.promotions) ? item.originalPrice : item.price) | NumFormat}}
|
|
|
- </text>
|
|
|
- </template>
|
|
|
- </template>
|
|
|
- </view>
|
|
|
- <view v-else class="list-login-now">
|
|
|
- <text class="p-no">¥</text>
|
|
|
- <uni-grader :grade="Number(item.p_price_grade)"></uni-grader>
|
|
|
- </view>
|
|
|
- </view>
|
|
|
- </view>
|
|
|
- </view>
|
|
|
- <!--加载loadding-->
|
|
|
- <tui-loadmore :visible="loadding" :index="3" type="black"></tui-loadmore>
|
|
|
- <tui-nomore :visible="!pullUpOn" :backgroundColor="'#ffffff'" :text='nomoreText'></tui-nomore>
|
|
|
- <!--加载loadding-->
|
|
|
- </view>
|
|
|
- </template>
|
|
|
- </template>
|
|
|
- <!--右抽屉-->
|
|
|
- <tui-drawer mode="right" :visible="rightDrawer" @close="closeDrawer">
|
|
|
- <view class="drawer-container clearfix" :style="{paddingTop:CustomBar+'px'}">
|
|
|
- <view class="drawer-title">{{ classData.name }}</view>
|
|
|
- <view class="drawer-main">
|
|
|
- <template v-if="classData.smalltypeList">
|
|
|
- <view class="drawer-item-cell" v-for="(item,index) in classData.smalltypeList" :key="index">
|
|
|
- <view class="drawer-item-title">{{ item.name }}</view>
|
|
|
- <view class="drawer-item-main" v-if="item.tinytypeList">
|
|
|
- <text class="drawer-item-text" :class="tiny.isChecked ? 'checked' : ''" v-for="(tiny,tinyIndex) in item.tinytypeList" :key="tinyIndex" @click="SearchCondition(3,item,tiny)">{{ tiny.name }}</text>
|
|
|
- </view>
|
|
|
- <view class="drawer-item-main" v-else>
|
|
|
- <text class="drawer-item-text" :class="item.isChecked ? 'checked' : ''" @click="SearchCondition(2,item)">全部商品</text>
|
|
|
- </view>
|
|
|
- </view>
|
|
|
- </template>
|
|
|
- <template v-else>
|
|
|
- <view class="drawer-item-cell">
|
|
|
- <view class="drawer-item-main none">
|
|
|
- <text class="drawer-item-text" :class="classData.isChecked ? 'checked' : ''" @click="SearchCondition(1,classData)">全部商品</text>
|
|
|
- </view>
|
|
|
- </view>
|
|
|
- </template>
|
|
|
- </view>
|
|
|
- <view class="drawer-input btn" :style="{bottom :isIphoneX ? '68rpx' : '34rpx'}">
|
|
|
- <view class="drawer-btn clear" @click="closeDrawer">取消</view>
|
|
|
- <view class="drawer-btn comfrim" @click="handSearchList">确定</view>
|
|
|
- </view>
|
|
|
- </view>
|
|
|
- </tui-drawer>
|
|
|
- <!-- 透明模态层 -->
|
|
|
- <modal-layer v-if='isModallayer'></modal-layer>
|
|
|
- </view>
|
|
|
-</template>
|
|
|
-
|
|
|
-<script>
|
|
|
- import { mapState,mapMutations} from 'vuex';
|
|
|
- import listSkeleton from '@/components/cm-module/listTemplate/listSkeleton'
|
|
|
- import customFloor from '@/components/cm-custom/custom-floor' //自定义导航
|
|
|
- import uniGrader from '@/components/uni-grade/uni-grade.vue'
|
|
|
- import modalLayer from "@/components/modal-layer"
|
|
|
- import authorize from '@/common/config/authorize.js'
|
|
|
- import wxLogin from "@/common/config/wxLogin.js"
|
|
|
-
|
|
|
- const defaultListQuery = {
|
|
|
- id:0,
|
|
|
- pageNum:1,
|
|
|
- pageSize:10,
|
|
|
- sortField:'',
|
|
|
- sortType:1,
|
|
|
- idType:0,//一级
|
|
|
- };
|
|
|
- export default{
|
|
|
- components:{
|
|
|
- customFloor,
|
|
|
- listSkeleton,
|
|
|
- uniGrader,
|
|
|
- modalLayer
|
|
|
- },
|
|
|
- data(){
|
|
|
- return{
|
|
|
- shopID:0,
|
|
|
- tabIndex:0,
|
|
|
- isModallayer:false,
|
|
|
- isSearchSalesFirst:true,
|
|
|
- isSearchMoodFirst:true,
|
|
|
- isSearchPriceFirst:true,
|
|
|
- isSearchSales:true,
|
|
|
- isSearchMood:true,
|
|
|
- isSearchPrice:true,
|
|
|
- headerBtnPosi: this.setHeaderBtnPosi(), //获取设备顶部胶囊高度
|
|
|
- systeminfo: this.setSysteminfo(), //获取设备信息
|
|
|
- CustomBar:this.CustomBar,// 顶部导航栏高度
|
|
|
- isIphoneX:this.$store.state.isIphoneX,
|
|
|
- emptyText: '该分类暂时还没有商品哟,去逛逛别的吧~',
|
|
|
- isRequest:false,
|
|
|
- showSkeleton: true,
|
|
|
- showEmpty: false,
|
|
|
- userID: 0,
|
|
|
- userIdentity:'',
|
|
|
- listData: [],
|
|
|
- windowHeight: '',
|
|
|
- scrollHeight: '',
|
|
|
- listQuery:Object.assign({}, defaultListQuery),
|
|
|
- priceLoading:true,
|
|
|
- loadding: false,
|
|
|
- pullUpOn: true,
|
|
|
- pullFlag: true,
|
|
|
- totalPage: 0,
|
|
|
- nomoreText: '上拉显示更多',
|
|
|
- rightDrawer: false,
|
|
|
- classifyType:0,
|
|
|
- classData:{},
|
|
|
- searchCheckedId:null
|
|
|
- }
|
|
|
- },
|
|
|
- onLoad(option) {
|
|
|
- console.log(option)
|
|
|
- if(option.type =='share'){
|
|
|
- authorize.getSetting().then(wxResponse =>{// console.log('是否已授权',res);//0:为取消授权 1:为已授权 2:为未操作
|
|
|
- console.log(wxResponse)
|
|
|
- if(wxResponse == 1){
|
|
|
- wxLogin.wxLoginAuthorize()
|
|
|
- }else{
|
|
|
- console.log(new Date +'用户未授权微信信息')
|
|
|
- }
|
|
|
- })
|
|
|
- }
|
|
|
- this.SetScrollHeight()
|
|
|
- this.InitOption(option)
|
|
|
- },
|
|
|
- computed: {
|
|
|
- ...mapState(['hasLogin','userInfo','identity'])
|
|
|
- },
|
|
|
- filters: {
|
|
|
- NumFormat:function(text) {//处理金额
|
|
|
- return Number(text).toFixed(2);
|
|
|
- },
|
|
|
- },
|
|
|
- methods:{
|
|
|
- InitOption(option) {
|
|
|
- this.listQuery.id = option.id;
|
|
|
- this.listQuery.idType = this.classifyType = Number(option.classType);
|
|
|
- uni.setNavigationBarTitle({title:option.title});
|
|
|
- this.$api.getComStorage('userInfo').then((resolve) =>{
|
|
|
- this.userID = resolve.userID ? resolve.userID : 0
|
|
|
- this.shopID = resolve.shopID ? resolve.shopID : 0
|
|
|
- this.userIdentity = resolve.userIdentity
|
|
|
- this.isRequest = true
|
|
|
- this.GetProductListInfo()
|
|
|
- this.GetProductOneClassly()
|
|
|
- }).catch(error =>{
|
|
|
- this.GetProductListInfo()
|
|
|
- this.GetProductOneClassly()
|
|
|
- })
|
|
|
- console.log(this.classifyID)
|
|
|
- },
|
|
|
- GetProductOneClassly(){//根据分类ID 查询二三级分类
|
|
|
- this.CommonService.GetProductOneClassly({typeId:this.listQuery.id,idType:this.classifyType,source :'crm'}).then(response =>{
|
|
|
- console.log(response.data)
|
|
|
- this.classData = response.data
|
|
|
- }).catch(error =>{
|
|
|
- this.$util.msg(error.msg,2000)
|
|
|
- })
|
|
|
- },
|
|
|
- GetProductListInfo(){//查询分类商品列表
|
|
|
- this.listQuery.pageNum = 1
|
|
|
- this.ProductService.GetSearchProductTypeData(this.listQuery).then(response =>{
|
|
|
- const resData = JSON.parse(response.data);
|
|
|
- const resList = resData.items;
|
|
|
- this.showSkeleton = false
|
|
|
- if(resList && resList.length > 0){
|
|
|
- this.showEmpty = false
|
|
|
- this.totalPage = resData.total;
|
|
|
- this.listData = [...resList];
|
|
|
- this.GetProductPrice()
|
|
|
- // 防上拉暴滑
|
|
|
- this.pullFlag = false;
|
|
|
- setTimeout(()=>{ this.pullFlag = true; },500)
|
|
|
- // 底部提示文案
|
|
|
- if(this.totalPage>this.listData.length) {
|
|
|
- this.pullUpOn = false
|
|
|
- this.nomoreText = '上拉显示更多'
|
|
|
- } else {
|
|
|
- if(this.listData.length>4){
|
|
|
- this.pullUpOn = false
|
|
|
- this.loadding = false
|
|
|
- this.nomoreText = '已至底部'
|
|
|
- }else{
|
|
|
- this.pullUpOn = true
|
|
|
- this.loadding = false
|
|
|
- this.nomoreText = '已至底部'
|
|
|
- }
|
|
|
- }
|
|
|
- } else {
|
|
|
- this.showEmpty = true;
|
|
|
- }
|
|
|
- }).catch(error =>{
|
|
|
- this.$util.msg(error.msg,2000);
|
|
|
- })
|
|
|
- },
|
|
|
- GetOnReachBottomData(){//上拉加载
|
|
|
- this.listQuery.pageNum += 1
|
|
|
- this.ProductService.GetSearchProductTypeData(this.listQuery).then(response =>{
|
|
|
- const resData = JSON.parse(response.data);
|
|
|
- const resList = resData.items;
|
|
|
- this.totalPage = resData.total;
|
|
|
- this.listData = [...this.listData,...resList];
|
|
|
- this.GetProductPrice()
|
|
|
- // 防上拉暴滑
|
|
|
- this.pullFlag = false;
|
|
|
- setTimeout(()=>{ this.pullFlag = true; },500)
|
|
|
- // 底部提示文案
|
|
|
- if(this.totalPage>this.listData.length) {
|
|
|
- this.pullUpOn = false
|
|
|
- this.nomoreText = '上拉显示更多'
|
|
|
- } else {
|
|
|
- this.pullUpOn = false
|
|
|
- this.loadding = false
|
|
|
- this.nomoreText = '已至底部'
|
|
|
- }
|
|
|
- }).catch(error =>{
|
|
|
- this.$util.msg(error.msg,2000);
|
|
|
- })
|
|
|
- },
|
|
|
- GetProductPrice(){//获取价格
|
|
|
- let productIdArr = [];
|
|
|
- this.listData.map(item=>{// 0公开价格 1不公开价格 2仅对会员机构公开
|
|
|
- productIdArr.push(item.p_id)
|
|
|
- })
|
|
|
- this.priceLoading = true;
|
|
|
- this.productIds = productIdArr.join(",");
|
|
|
- this.ProductService.querySearchProductPrice({userId: this.userID,productIds:this.productIds}).then(response =>{
|
|
|
- if(response.data) {
|
|
|
- this.listData = this.ReturnNewProducts(this.listData,response.data);
|
|
|
- }
|
|
|
- this.priceLoading = false;
|
|
|
- }).catch(error =>{
|
|
|
- this.$util.msg(error.msg,2000)
|
|
|
- })
|
|
|
- },
|
|
|
- ReturnNewProducts(Array,list){//处理对应商品ID的商品价格
|
|
|
- let NewArray = []
|
|
|
- Array.map(item=>{
|
|
|
- for (let i = 0; i < list.length; i++) {
|
|
|
- if( item.p_id == list[i].productId ){
|
|
|
- NewArray.push(Object.assign(item,list[i]))
|
|
|
- }
|
|
|
- }
|
|
|
- });
|
|
|
- return NewArray
|
|
|
- },
|
|
|
- handleScreen(e) {
|
|
|
- let index = e.currentTarget.dataset.index;
|
|
|
- console.log(index)
|
|
|
- if (index == 0) {
|
|
|
- this.tabIndex = 0
|
|
|
- this.isSearchSalesFirst = true
|
|
|
- this.isSearchMoodFirst = true
|
|
|
- this.isSearchPriceFirst = true
|
|
|
- this.listQuery.sortType = 1
|
|
|
- this.listQuery.sortField = ''
|
|
|
- } else if (index == 1) {
|
|
|
- this.tabIndex = 1
|
|
|
- this.isSearchSalesFirst = false
|
|
|
- this.isSearchMoodFirst = true
|
|
|
- this.isSearchPriceFirst = true
|
|
|
- this.isSearchSales = !this.isSearchSales
|
|
|
- if(this.isSearchSales){
|
|
|
- this.listQuery.sortType = 1
|
|
|
- }else{
|
|
|
- this.listQuery.sortType = 0
|
|
|
- }
|
|
|
- this.listQuery.sortField = 'p_sales'
|
|
|
- } else if (index == 2) {
|
|
|
- this.tabIndex = 2
|
|
|
- this.isSearchSalesFirst = true
|
|
|
- this.isSearchPriceFirst = true
|
|
|
- this.isSearchMoodFirst= false
|
|
|
- this.isSearchMood = !this.isSearchMood
|
|
|
- if(this.isSearchMood){
|
|
|
- this.listQuery.sortType = 1
|
|
|
- }else{
|
|
|
- this.listQuery.sortType = 0
|
|
|
- }
|
|
|
- this.listQuery.sortField = 'p_favorite'
|
|
|
- } else if (index == 3) {
|
|
|
- this.tabIndex = 3
|
|
|
- this.isSearchSalesFirst = true
|
|
|
- this.isSearchMoodFirst = true
|
|
|
- this.isSearchPriceFirst= false
|
|
|
- this.isSearchPrice = !this.isSearchPrice
|
|
|
- if(this.isSearchPrice){
|
|
|
- this.listQuery.sortType = 1
|
|
|
- }else{
|
|
|
- this.listQuery.sortType = 0
|
|
|
- }
|
|
|
- this.listQuery.sortField = 'p_price'
|
|
|
- } else if (index == 4) {
|
|
|
- this.searchClickFn()
|
|
|
- }
|
|
|
- this.GetProductListInfo()
|
|
|
- },
|
|
|
- handSearchList(){//确定筛选
|
|
|
- if(this.searchCheckedId == ''){
|
|
|
- this.listQuery.id = this.classData.bigTypeID
|
|
|
- }else{
|
|
|
- this.listQuery.id = this.searchCheckedId
|
|
|
- }
|
|
|
- this.leftDrawer = false;
|
|
|
- this.rightDrawer = false;
|
|
|
- this.GetProductListInfo()
|
|
|
- },
|
|
|
- SearchCondition(type,item,tiny){//选择筛选分类
|
|
|
- this.listQuery.idType = type;
|
|
|
- const { classData, classData: { smalltypeList } } = this;
|
|
|
- classData.isChecked = false;
|
|
|
- if(smalltypeList && smalltypeList.length > 0) {
|
|
|
- smalltypeList.forEach((item, index) => {
|
|
|
- item.isChecked = false;
|
|
|
- const { tinytypeList } = item;
|
|
|
- if(tinytypeList && tinytypeList.length > 0) {
|
|
|
- tinytypeList.forEach((tinyItem, tinyIndex) => {
|
|
|
- tinyItem.isChecked = false;
|
|
|
- })
|
|
|
- }
|
|
|
- });
|
|
|
- }
|
|
|
- switch(type){
|
|
|
- case 1:
|
|
|
- console.log('1级分类全部商品',item);
|
|
|
- item.isChecked = !item.isChecked
|
|
|
- this.searchCheckedId = item.bigTypeID
|
|
|
- break;
|
|
|
- case 2:
|
|
|
- console.log('2级分类全部商品',item);
|
|
|
- item.isChecked = !item.isChecked
|
|
|
- if(item.isChecked){
|
|
|
- this.searchCheckedId = item.smallTypeID
|
|
|
- }else{
|
|
|
- this.searchCheckedId = ''
|
|
|
- }
|
|
|
- break;
|
|
|
- case 3:
|
|
|
- console.log('3级分类',tiny);
|
|
|
- tiny.isChecked = !tiny.isChecked
|
|
|
- if(tiny.isChecked){
|
|
|
- this.searchCheckedId = tiny.tinyTypeID
|
|
|
- }else{
|
|
|
- this.searchCheckedId = ''
|
|
|
- }
|
|
|
- break;
|
|
|
- }
|
|
|
- },
|
|
|
- navToDetailPage(id) {
|
|
|
- this.isModallayer = true;
|
|
|
- this.$api.navigateTo(`/pages/goods/product?id=${id}`);
|
|
|
- this.isModallayer = false;
|
|
|
- },
|
|
|
- PromotionsFormat(promo){//促销活动类型数据处理
|
|
|
- if(promo!=null){
|
|
|
- if(promo.type == 1 && promo.mode == 1){
|
|
|
- return true
|
|
|
- }else{
|
|
|
- return false
|
|
|
- }
|
|
|
- }
|
|
|
- return false
|
|
|
- },
|
|
|
- SetScrollHeight() {
|
|
|
- const {windowHeight, pixelRatio} = wx.getSystemInfoSync();
|
|
|
- this.windowHeight = windowHeight - 1;
|
|
|
- this.scrollHeight = windowHeight - 1;
|
|
|
- },
|
|
|
- setHeaderBtnPosi(){
|
|
|
- // 获得胶囊按钮位置信息
|
|
|
- let headerBtnPosi = uni.getMenuButtonBoundingClientRect();
|
|
|
- return headerBtnPosi
|
|
|
- },
|
|
|
- searchClickFn() {//弹出抽屉
|
|
|
- this.rightDrawer = true;
|
|
|
- },
|
|
|
- closeDrawer(e) {//关闭抽屉
|
|
|
- this.leftDrawer = false;
|
|
|
- this.rightDrawer = false;
|
|
|
- },
|
|
|
- setSysteminfo(){
|
|
|
- let systeminfo;
|
|
|
- uni.getSystemInfo({ // 获取设备信息
|
|
|
- success: (res) => {
|
|
|
- systeminfo = res
|
|
|
- },
|
|
|
- })
|
|
|
- return systeminfo
|
|
|
- },
|
|
|
- },
|
|
|
- onPullDownRefresh() {
|
|
|
- setTimeout(() => {
|
|
|
- this.GetProductListInfo()
|
|
|
- uni.stopPullDownRefresh()
|
|
|
- }, 200)
|
|
|
- },
|
|
|
- onReachBottom() {
|
|
|
- if(this.totalPage>this.listData.length) {
|
|
|
- this.loadding = true
|
|
|
- this.pullUpOn = true
|
|
|
- this.GetOnReachBottomData()
|
|
|
- }
|
|
|
- },
|
|
|
- onShareAppMessage(res){//分享转发
|
|
|
- if (res.from === 'button') {
|
|
|
- // 来自页面内转发按钮
|
|
|
- }
|
|
|
- return {
|
|
|
- title: `点击查看“${this.classData.name}”相关的商品`,
|
|
|
- path: `pages/goods/goods-classify?type=share&classType=${this.classifyType}&id=${this.listQuery.id}&title=${this.classData.name}`
|
|
|
- }
|
|
|
- },
|
|
|
- onShow() {
|
|
|
-
|
|
|
- }
|
|
|
- }
|
|
|
-</script>
|
|
|
-
|
|
|
-<style lang="scss">
|
|
|
- page {
|
|
|
- background: #FFFFFF;
|
|
|
- .all-type-list-wrapper {
|
|
|
- display: flex;
|
|
|
- flex-direction: column;
|
|
|
- }
|
|
|
- }
|
|
|
- .container-list{
|
|
|
- width: 100%;
|
|
|
- height: auto;
|
|
|
- }
|
|
|
- .all-type-list-content {
|
|
|
- height: 216rpx;
|
|
|
- padding: 24rpx;
|
|
|
- background: #fff;
|
|
|
- margin-bottom: 2rpx;
|
|
|
- display: flex;
|
|
|
- flex-direction: row;
|
|
|
- box-sizing: content-box;
|
|
|
- .list-img {
|
|
|
- width: 210rpx;
|
|
|
- height: 218rpx !important;
|
|
|
- margin-right: 26rpx;
|
|
|
- border-radius: 10rpx;
|
|
|
- border: 2rpx solid #f3f3f3;
|
|
|
- }
|
|
|
- }
|
|
|
- .list-details-info {
|
|
|
- width: 466rpx;
|
|
|
- display: flex;
|
|
|
- flex-direction: column;
|
|
|
- font-size: 26rpx;
|
|
|
- position: relative;
|
|
|
- .list-details-title {
|
|
|
- position: relative;
|
|
|
- .mclap{
|
|
|
- line-height: 38rpx;
|
|
|
- text-overflow: ellipsis;
|
|
|
- overflow: hidden;
|
|
|
- display: -webkit-box;
|
|
|
- -webkit-line-clamp: 2;
|
|
|
- line-clamp: 2;
|
|
|
- -webkit-box-orient: vertical;
|
|
|
- &.indent{
|
|
|
- text-indent: 95rpx;
|
|
|
- }
|
|
|
- }
|
|
|
- .mclap-tag{
|
|
|
- display: block;
|
|
|
- width: 84rpx;
|
|
|
- height: 32rpx;
|
|
|
- background-image: linear-gradient(270deg, #f9c023 0%, #f83600 100%);
|
|
|
- border-radius: 4rpx 48rpx 4px 4px;
|
|
|
- line-height: 32rpx;
|
|
|
- font-size: $font-size-22;
|
|
|
- color: #FFFFFF;
|
|
|
- text-align: center;
|
|
|
- position: absolute;
|
|
|
- left: 0;
|
|
|
- top: 0;
|
|
|
- }
|
|
|
- }
|
|
|
- .list-details-specs {
|
|
|
- margin-top: 8rpx;
|
|
|
- color: #666666;
|
|
|
- }
|
|
|
- .list-details-miniQuantity {
|
|
|
- margin-top: 7rpx;
|
|
|
- }
|
|
|
- }
|
|
|
- .list-details-price {
|
|
|
- width: 100%;
|
|
|
- height: 54rpx;
|
|
|
- line-height: 54rpx;
|
|
|
- position: absolute;
|
|
|
- bottom: -10rpx;
|
|
|
- right: 0;
|
|
|
- .floor-item-act{
|
|
|
- height: 54rpx;
|
|
|
- text-align: center;
|
|
|
- box-sizing: border-box;
|
|
|
- float: right;
|
|
|
- .floor-tags{
|
|
|
- height: 28rpx;
|
|
|
- border-radius: 6rpx;
|
|
|
- background-color: #FFFFFF;
|
|
|
- line-height: 28rpx;
|
|
|
- color: $color-system;
|
|
|
- text-align: center;
|
|
|
- display: inline-block;
|
|
|
- padding:0 16rpx;
|
|
|
- font-size: $font-size-20;
|
|
|
- margin-left: 15rpx;
|
|
|
- border: 1px solid #E15616;
|
|
|
- }
|
|
|
- }
|
|
|
- .price-icon {
|
|
|
- width: 22rpx;
|
|
|
- height: 28rpx;
|
|
|
- vertical-align: middle;
|
|
|
- margin-right: 10rpx;
|
|
|
- }
|
|
|
- .price-icon + text {
|
|
|
- font-size: 25rpx;
|
|
|
- vertical-align: middle;
|
|
|
- }
|
|
|
- .list-login-now {
|
|
|
- color: #F8C499;
|
|
|
- float: left;
|
|
|
- line-height: 54rpx;
|
|
|
- .p-no{
|
|
|
- float: left;
|
|
|
- font-size: $font-size-24;
|
|
|
- color: $text-color;
|
|
|
- }
|
|
|
- }
|
|
|
- .login-now {
|
|
|
- padding: 10rpx 10rpx 10rpx 0;
|
|
|
- }
|
|
|
- .list-price {
|
|
|
- color: #FF2A2A;
|
|
|
- height: 44rpx;
|
|
|
- float: left;
|
|
|
- .price-larger {
|
|
|
- width: 100%;
|
|
|
- height: 44rpx;
|
|
|
- font-size: 32rpx;
|
|
|
- &.none{
|
|
|
- text-decoration: line-through;
|
|
|
- color: #999999;
|
|
|
- }
|
|
|
- &.small{
|
|
|
- font-size: $font-size-24;
|
|
|
- }
|
|
|
- .txt{
|
|
|
- font-size: $font-size-24;
|
|
|
- display: inline-block;
|
|
|
- line-height: 44rpx;
|
|
|
- text-align: left;
|
|
|
- float: left;
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- .add-cart-btn {
|
|
|
- width: 156rpx;
|
|
|
- height: 64rpx;
|
|
|
- line-height: 64rpx;
|
|
|
- border-radius: 32rpx;
|
|
|
- color: #fff;
|
|
|
- font-size: 26rpx;
|
|
|
- margin-right: 0;
|
|
|
- background:linear-gradient(45deg,rgba(255,41,41,1) 0%,rgba(255,109,27,1) 100%);
|
|
|
- }
|
|
|
- }
|
|
|
- /*screen*/
|
|
|
- .tui-header-screen {
|
|
|
- width: 100%;
|
|
|
- box-sizing: border-box;
|
|
|
- background: #fff;
|
|
|
- position: fixed;
|
|
|
- z-index: 1000;
|
|
|
- /* padding-top: 12rpx; */
|
|
|
- }
|
|
|
- .tui-screen-top,
|
|
|
- .tui-screen-bottom {
|
|
|
- display: flex;
|
|
|
- align-items: center;
|
|
|
- justify-content: space-between;
|
|
|
- font-size: 28rpx;
|
|
|
- color: #999999;
|
|
|
- }
|
|
|
- .tui-screen-top {
|
|
|
- height: 88rpx;
|
|
|
- position: relative;
|
|
|
- background: #fff;
|
|
|
- border-bottom: 1px solid #EFEFEF;
|
|
|
- }
|
|
|
- .tui-top-item {
|
|
|
- height: 28rpx;
|
|
|
- line-height: 28rpx;
|
|
|
- flex: 1;
|
|
|
- display: flex;
|
|
|
- align-items: center;
|
|
|
- justify-content: center;
|
|
|
- }
|
|
|
- .icon-shangxiajiantou{
|
|
|
- font-size: 20rpx;
|
|
|
- color: #999999;
|
|
|
- margin-left: 8rpx;
|
|
|
- }
|
|
|
- .tui-topitem-active {
|
|
|
- color: #e15616;
|
|
|
- }
|
|
|
-
|
|
|
- .tui-screen-bottom {
|
|
|
- height: 100rpx;
|
|
|
- padding: 0 30rpx;
|
|
|
- box-sizing: border-box;
|
|
|
- font-size: 24rpx;
|
|
|
- align-items: center;
|
|
|
- overflow: hidden;
|
|
|
- }
|
|
|
-
|
|
|
- .tui-bottom-text {
|
|
|
- line-height: 26rpx;
|
|
|
- max-width: 82%;
|
|
|
- white-space: nowrap;
|
|
|
- overflow: hidden;
|
|
|
- text-overflow: ellipsis;
|
|
|
- }
|
|
|
-
|
|
|
- .tui-bottom-item {
|
|
|
- flex: 1;
|
|
|
- width: 0;
|
|
|
- display: flex;
|
|
|
- align-items: center;
|
|
|
- justify-content: center;
|
|
|
- padding: 0 12rpx;
|
|
|
- box-sizing: border-box;
|
|
|
- background: #f7f7f7;
|
|
|
- margin-right: 20rpx;
|
|
|
- white-space: nowrap;
|
|
|
- height: 60rpx;
|
|
|
- border-radius: 40rpx;
|
|
|
- }
|
|
|
-
|
|
|
- .tui-bottom-item:last-child {
|
|
|
- margin-right: 0;
|
|
|
- }
|
|
|
-
|
|
|
- .tui-btmItem-active {
|
|
|
- background: #fcedea !important;
|
|
|
- color: #e15616;
|
|
|
- font-weight: bold;
|
|
|
- position: relative;
|
|
|
- }
|
|
|
-
|
|
|
- .tui-btmItem-active::after {
|
|
|
- content: "";
|
|
|
- position: absolute;
|
|
|
- border: 1rpx solid #e15616;
|
|
|
- width: 100%;
|
|
|
- height: 100%;
|
|
|
- border-radius: 40rpx;
|
|
|
- left: 0;
|
|
|
- top: 0;
|
|
|
- }
|
|
|
-
|
|
|
- .tui-btmItem-tap {
|
|
|
- position: relative;
|
|
|
- border-bottom-left-radius: 0;
|
|
|
- border-bottom-right-radius: 0;
|
|
|
- }
|
|
|
-
|
|
|
- .tui-btmItem-tap::after {
|
|
|
- content: "";
|
|
|
- position: absolute;
|
|
|
- width: 100%;
|
|
|
- height: 22rpx;
|
|
|
- background: #f7f7f7;
|
|
|
- left: 0;
|
|
|
- top: 58rpx;
|
|
|
- }
|
|
|
- .tui-active {
|
|
|
- color: #e15616;
|
|
|
- }
|
|
|
- .tui-icon-ml .tui-icon-class {
|
|
|
- margin-left: 6rpx;
|
|
|
- }
|
|
|
-
|
|
|
- .tui-ml {
|
|
|
- margin-left: 6rpx;
|
|
|
- }
|
|
|
-
|
|
|
- .tui-seizeaseat-20 {
|
|
|
- height: 20rpx;
|
|
|
- }
|
|
|
-
|
|
|
- .tui-seizeaseat-30 {
|
|
|
- height: 30rpx;
|
|
|
- }
|
|
|
-
|
|
|
- .tui-icon-middle .tui-icon-class {
|
|
|
- vertical-align: middle;
|
|
|
- }
|
|
|
-
|
|
|
- .tui-middle {
|
|
|
- vertical-align: middle;
|
|
|
- }
|
|
|
-
|
|
|
- /*screen*/
|
|
|
- .drawer-container {
|
|
|
- width: 560rpx;
|
|
|
- height: 100%;
|
|
|
- padding: 80rpx 0;
|
|
|
- box-sizing: border-box;
|
|
|
- .drawer-title{
|
|
|
- width: 100%;
|
|
|
- height: 72rpx;
|
|
|
- line-height: 72rpx;
|
|
|
- box-sizing: border-box;
|
|
|
- padding: 0 30rpx;
|
|
|
- text-align: left;
|
|
|
- font-size: $font-size-26;
|
|
|
- color: #e15616;
|
|
|
- font-weight: bold;
|
|
|
- background-color: #F7F7F7;
|
|
|
- }
|
|
|
- .drawer-main{
|
|
|
- width: 100%;
|
|
|
- height: auto;
|
|
|
- box-sizing: border-box;
|
|
|
- padding: 0 30rpx;
|
|
|
- .drawer-item-cell{
|
|
|
- width: 100%;
|
|
|
- height: auto;
|
|
|
- float: left;
|
|
|
- .drawer-item-title{
|
|
|
- width: 100%;
|
|
|
- height: 82rpx;
|
|
|
- line-height: 82rpx;
|
|
|
- text-align: left;
|
|
|
- font-size: $font-size-26;
|
|
|
- color: $text-color;
|
|
|
- float: left;
|
|
|
- }
|
|
|
- .drawer-item-main{
|
|
|
- width: 100%;
|
|
|
- height: auto;
|
|
|
- float: left;
|
|
|
- &.none{
|
|
|
- margin-top: 24rpx;
|
|
|
- }
|
|
|
- .drawer-item-text{
|
|
|
- display: inline-block;
|
|
|
- float: left;
|
|
|
- padding: 0 30rpx;
|
|
|
- height: 56rpx;
|
|
|
- border-radius: 28rpx;
|
|
|
- background-color: #F7F7F7;
|
|
|
- line-height: 56rpx;
|
|
|
- text-align: center;
|
|
|
- color: #999999;
|
|
|
- font-size: $font-size-26;
|
|
|
- margin-right: 24rpx;
|
|
|
- margin-bottom: 24rpx;
|
|
|
- &.checked{
|
|
|
- background-color: #fef6f3;
|
|
|
- color: $color-system;
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- .drawer-input{
|
|
|
- width: 100%;
|
|
|
- height: 80rpx;
|
|
|
- float: left;
|
|
|
- box-sizing: border-box;
|
|
|
- padding: 0 10rpx;
|
|
|
- border: 1px solid rgba(0,0,0,0.2);
|
|
|
- border-radius: 4rpx;
|
|
|
- margin-bottom: 30rpx;
|
|
|
- position: relative;
|
|
|
- &.btn{
|
|
|
- border: none;
|
|
|
- margin-top: 40rpx;
|
|
|
- display: flex;
|
|
|
- position: absolute;
|
|
|
- left: 0;
|
|
|
- }
|
|
|
- .drawer-btn{
|
|
|
- width: 210rpx;
|
|
|
- height: 84rpx;
|
|
|
- border-radius: 42rpx;
|
|
|
- background: $btn-confirm;
|
|
|
- line-height: 84rpx;
|
|
|
- text-align: center;
|
|
|
- font-size: $font-size-26;
|
|
|
- color: #FFFFFF;
|
|
|
- flex: 1;
|
|
|
- margin: 0 10rpx;
|
|
|
- &.comfrim{
|
|
|
- background: $btn-confirm;
|
|
|
- }
|
|
|
- &.clear{
|
|
|
- background: #e1e1e1;
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
-</style>
|