mirror of
https://gitee.com/java110/WechatOwnerService.git
synced 2026-02-23 21:36:38 +08:00
优化商圈部分功能
This commit is contained in:
parent
b334cfe674
commit
bb1615c42b
@ -56,8 +56,7 @@ export function queryPhoneMainCategoryProduct(dataObj) {
|
||||
//动态数据
|
||||
success: function(res) {
|
||||
if (res.statusCode == 200) {
|
||||
let _products = res.data.data;
|
||||
resolve(_products);
|
||||
resolve(res.data);
|
||||
return;
|
||||
}
|
||||
reject();
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<!-- @scrolltolower="lower" -->
|
||||
<scroll-view class="scroll-restaurants-list " scroll-y="true" style="height:300upx">
|
||||
<scroll-view class="scroll-restaurants-list " scroll-x="true" style="height:300upx">
|
||||
<swiper class=" padding-top-xs margin-top-sm bg-white c-radius" style="height: 280upx;" indicator-dots="true" indicator-color="rgba(228,228,228,1)"
|
||||
indicator-active-color="#FECA49">
|
||||
<block v-for="(item, index) in categoryList" :key="index">
|
||||
|
||||
@ -3,7 +3,8 @@
|
||||
<view>
|
||||
<view class="text-left ">
|
||||
<scroll-view scroll-x class="nav" scroll-with-animation>
|
||||
<view class="cu-item" :class="item.mainCategoryId==curCategoryId?'text-catagory-select ':'text-catagory'"
|
||||
<view class="cu-item"
|
||||
:class="item.mainCategoryId==curCategoryId?'text-catagory-select ':'text-catagory'"
|
||||
v-for="(item,index) in mainCatagorys" :key="index" @tap="_doSelect(item)" :data-id="index">
|
||||
{{item.categoryName}}
|
||||
</view>
|
||||
@ -57,7 +58,9 @@
|
||||
}],
|
||||
products: [],
|
||||
communityId: "",
|
||||
noPic:''
|
||||
noPic: '',
|
||||
pagesize: 10,
|
||||
pagefrom: 1,
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
@ -71,6 +74,10 @@
|
||||
page: 1,
|
||||
row: 10
|
||||
}
|
||||
|
||||
this.products=[];
|
||||
this.pagefrom =1;
|
||||
|
||||
queryMainCategory(_data)
|
||||
.then((products) => {
|
||||
if (!products || products.length < 1) {
|
||||
@ -86,14 +93,19 @@
|
||||
let _that = this;
|
||||
_that.communityId = getMallCommunityId();
|
||||
let _data = {
|
||||
page: 1,
|
||||
row: 10,
|
||||
page: this.pagefrom,
|
||||
row: this.pagesize,
|
||||
communityId: _that.communityId,
|
||||
mainCategoryId: _that.curCategoryId
|
||||
}
|
||||
queryPhoneMainCategoryProduct(_data)
|
||||
.then((products) => {
|
||||
_that.products = products;
|
||||
.then((_data) => {
|
||||
_that.products = _that.products.concat(_data.data);
|
||||
if (_that.pagefrom <= _data.records) {
|
||||
_that.pagefrom = _that.pagefrom + 1;
|
||||
} else {
|
||||
_that.loadingText = "已经到底了";
|
||||
}
|
||||
})
|
||||
},
|
||||
_toGoodsDetail: function(_product) {
|
||||
@ -103,6 +115,8 @@
|
||||
},
|
||||
_doSelect: function(item) {
|
||||
this.curCategoryId = item.mainCategoryId;
|
||||
this.pagefrom =1;
|
||||
this.products=[];
|
||||
this._loadRecommendProdcut();
|
||||
}
|
||||
}
|
||||
@ -122,11 +136,13 @@
|
||||
.goods-image {
|
||||
height: 180upx;
|
||||
}
|
||||
|
||||
.text-catagory {
|
||||
color: #656565;
|
||||
font-size: 28upx;
|
||||
|
||||
}
|
||||
|
||||
.text-catagory-select {
|
||||
color: #000000;
|
||||
font-size: 40upx;
|
||||
|
||||
@ -97,6 +97,9 @@
|
||||
}
|
||||
this.shopTypeId = 0
|
||||
},
|
||||
onReachBottom() {
|
||||
this.$refs.vcRecommendRef._loadRecommendProdcut();
|
||||
},
|
||||
methods: {
|
||||
selectType(index) {
|
||||
let shopTypeId = this.navList[index].shopTypeId;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user