|
@@ -1,5 +1,5 @@
|
|
<template>
|
|
<template>
|
|
- <view class="container all-type-list-wrapper" :style="{paddingTop:(CustomBar+44)+'px'}">
|
|
|
|
|
|
+ <view class="container all-type-list-wrapper">
|
|
<!-- 自定义顶部 -->
|
|
<!-- 自定义顶部 -->
|
|
<custom-floor :systeminfo='systeminfo' :navbar-data='nvabarData' :headerBtnPosi ="headerBtnPosi"></custom-floor>
|
|
<custom-floor :systeminfo='systeminfo' :navbar-data='nvabarData' :headerBtnPosi ="headerBtnPosi"></custom-floor>
|
|
<view class="tui-header-screen" :style="{top:CustomBar+'px'}">
|
|
<view class="tui-header-screen" :style="{top:CustomBar+'px'}">
|
|
@@ -40,7 +40,7 @@
|
|
<text class="error-text">{{emptyText}}</text>
|
|
<text class="error-text">{{emptyText}}</text>
|
|
</view>
|
|
</view>
|
|
<template v-else>
|
|
<template v-else>
|
|
- <view class="container-list" :style="{'height':scrollHeight+'px'}">
|
|
|
|
|
|
+ <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)">
|
|
<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>
|
|
<image mode='widthFix' :src="item.p_image" class="list-img" alt="list-img"></image>
|
|
<view class="list-details-info">
|
|
<view class="list-details-info">
|
|
@@ -177,7 +177,8 @@
|
|
import customFloor from '@/components/cm-custom/custom-floor' //自定义导航
|
|
import customFloor from '@/components/cm-custom/custom-floor' //自定义导航
|
|
import uniGrader from '@/components/uni-grade/uni-grade.vue'
|
|
import uniGrader from '@/components/uni-grade/uni-grade.vue'
|
|
import modalLayer from "@/components/modal-layer"
|
|
import modalLayer from "@/components/modal-layer"
|
|
-
|
|
|
|
|
|
+ import authorize from '@/common/config/authorize.js'
|
|
|
|
+ import wxLogin from "@/common/config/wxLogin.js"
|
|
|
|
|
|
const defaultListQuery = {
|
|
const defaultListQuery = {
|
|
id:0,
|
|
id:0,
|
|
@@ -232,7 +233,18 @@
|
|
},
|
|
},
|
|
onLoad(option) {
|
|
onLoad(option) {
|
|
console.log(option)
|
|
console.log(option)
|
|
- this.initOption(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: {
|
|
computed: {
|
|
...mapState(['hasLogin','userInfo','identity'])
|
|
...mapState(['hasLogin','userInfo','identity'])
|
|
@@ -243,7 +255,7 @@
|
|
},
|
|
},
|
|
},
|
|
},
|
|
methods:{
|
|
methods:{
|
|
- initOption(option) {
|
|
|
|
|
|
+ InitOption(option) {
|
|
this.listQuery.id = option.id;
|
|
this.listQuery.id = option.id;
|
|
this.listQuery.idType = this.classifyType = Number(option.classType);
|
|
this.listQuery.idType = this.classifyType = Number(option.classType);
|
|
uni.setNavigationBarTitle({title:option.title});
|
|
uni.setNavigationBarTitle({title:option.title});
|
|
@@ -361,8 +373,8 @@
|
|
this.isSearchSalesFirst = true
|
|
this.isSearchSalesFirst = true
|
|
this.isSearchMoodFirst = true
|
|
this.isSearchMoodFirst = true
|
|
this.isSearchPriceFirst = true
|
|
this.isSearchPriceFirst = true
|
|
- this.listQuery.sortType = ''
|
|
|
|
- this.GetProductListInfo();
|
|
|
|
|
|
+ this.listQuery.sortType = 1
|
|
|
|
+ this.listQuery.sortField = ''
|
|
} else if (index == 1) {
|
|
} else if (index == 1) {
|
|
this.tabIndex = 1
|
|
this.tabIndex = 1
|
|
this.isSearchSalesFirst = false
|
|
this.isSearchSalesFirst = false
|
|
@@ -415,14 +427,27 @@
|
|
this.GetProductListInfo()
|
|
this.GetProductListInfo()
|
|
},
|
|
},
|
|
SearchCondition(type,item,tiny){//选择筛选分类
|
|
SearchCondition(type,item,tiny){//选择筛选分类
|
|
- this.listQuery.idType = type
|
|
|
|
|
|
+ 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){
|
|
switch(type){
|
|
- case 1:
|
|
|
|
|
|
+ case 1:
|
|
console.log('1级分类全部商品',item);
|
|
console.log('1级分类全部商品',item);
|
|
item.isChecked = !item.isChecked
|
|
item.isChecked = !item.isChecked
|
|
this.searchCheckedId = item.bigTypeID
|
|
this.searchCheckedId = item.bigTypeID
|
|
break;
|
|
break;
|
|
- case 2:
|
|
|
|
|
|
+ case 2:
|
|
console.log('2级分类全部商品',item);
|
|
console.log('2级分类全部商品',item);
|
|
item.isChecked = !item.isChecked
|
|
item.isChecked = !item.isChecked
|
|
if(item.isChecked){
|
|
if(item.isChecked){
|
|
@@ -431,17 +456,16 @@
|
|
this.searchCheckedId = ''
|
|
this.searchCheckedId = ''
|
|
}
|
|
}
|
|
break;
|
|
break;
|
|
- case 3:
|
|
|
|
|
|
+ case 3:
|
|
console.log('3级分类',tiny);
|
|
console.log('3级分类',tiny);
|
|
tiny.isChecked = !tiny.isChecked
|
|
tiny.isChecked = !tiny.isChecked
|
|
if(tiny.isChecked){
|
|
if(tiny.isChecked){
|
|
this.searchCheckedId = tiny.tinyTypeID
|
|
this.searchCheckedId = tiny.tinyTypeID
|
|
}else{
|
|
}else{
|
|
- this.searchCheckedId = ''
|
|
|
|
|
|
+ this.searchCheckedId = ''
|
|
}
|
|
}
|
|
break;
|
|
break;
|
|
- }
|
|
|
|
-
|
|
|
|
|
|
+ }
|
|
},
|
|
},
|
|
navToDetailPage(id) {
|
|
navToDetailPage(id) {
|
|
this.isModallayer = true;
|
|
this.isModallayer = true;
|
|
@@ -458,7 +482,7 @@
|
|
}
|
|
}
|
|
return false
|
|
return false
|
|
},
|
|
},
|
|
- setScrollHeight() {
|
|
|
|
|
|
+ SetScrollHeight() {
|
|
const {windowHeight, pixelRatio} = wx.getSystemInfoSync();
|
|
const {windowHeight, pixelRatio} = wx.getSystemInfoSync();
|
|
this.windowHeight = windowHeight - 1;
|
|
this.windowHeight = windowHeight - 1;
|
|
this.scrollHeight = windowHeight - 1;
|
|
this.scrollHeight = windowHeight - 1;
|
|
@@ -500,6 +524,15 @@
|
|
this.GetOnReachBottomData()
|
|
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() {
|
|
onShow() {
|
|
|
|
|
|
}
|
|
}
|