更新
This commit is contained in:
parent
3c828dd8ac
commit
29cb63a4f2
@ -13,15 +13,15 @@ import request from "@/utils/request.js";
|
|||||||
* 获取购物车列表
|
* 获取购物车列表
|
||||||
* @param numType boolean true 购物车数量,false=购物车产品数量
|
* @param numType boolean true 购物车数量,false=购物车产品数量
|
||||||
*/
|
*/
|
||||||
export function getCartCounts() {
|
export function getCartCounts(data) {
|
||||||
return request.get("user/cart/count");
|
return request.get("user/cart/count", data);
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* 获取购物车列表
|
* 获取购物车列表
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
export function getCartList() {
|
export function getCartList(data) {
|
||||||
return request.get("user/cart/lst");
|
return request.get("user/cart/lst", data);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -65,9 +65,9 @@ export default{
|
|||||||
if (that.loadImg || that.isLoadError) return;
|
if (that.loadImg || that.isLoadError) return;
|
||||||
const id = that.uid
|
const id = that.uid
|
||||||
const query = uni.createSelectorQuery().in(that);
|
const query = uni.createSelectorQuery().in(that);
|
||||||
|
let t = 0;
|
||||||
query.select('#' + id).boundingClientRect(data => {
|
query.select('#' + id).boundingClientRect(data => {
|
||||||
if (!data) return;
|
if (!data) return;
|
||||||
|
|
||||||
if (data.top - that.viewHeight < 0) {
|
if (data.top - that.viewHeight < 0) {
|
||||||
that.loadImg = !!that.imageSrc;
|
that.loadImg = !!that.imageSrc;
|
||||||
that.isLoadError = !that.loadImg;
|
that.isLoadError = !that.loadImg;
|
||||||
@ -102,7 +102,7 @@ export default{
|
|||||||
mounted() {
|
mounted() {
|
||||||
this.init()
|
this.init()
|
||||||
uni.$on('scroll', this.scrollFn);
|
uni.$on('scroll', this.scrollFn);
|
||||||
this.onScroll()
|
this.onScroll();
|
||||||
},
|
},
|
||||||
beforeDestroy() {
|
beforeDestroy() {
|
||||||
uni.$off('scroll', this.scrollFn);
|
uni.$off('scroll', this.scrollFn);
|
||||||
|
@ -316,6 +316,9 @@
|
|||||||
},
|
},
|
||||||
onReachBottom() {
|
onReachBottom() {
|
||||||
this.getProductslist();
|
this.getProductslist();
|
||||||
|
},
|
||||||
|
onPageScroll() {
|
||||||
|
uni.$emit('scroll');
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
navBack(){
|
navBack(){
|
||||||
|
@ -452,6 +452,9 @@
|
|||||||
onReachBottom() {
|
onReachBottom() {
|
||||||
this.storeMerchantList();
|
this.storeMerchantList();
|
||||||
},
|
},
|
||||||
|
onPageScroll() {
|
||||||
|
uni.$emit('scroll');
|
||||||
|
},
|
||||||
methods: {
|
methods: {
|
||||||
navBack() {
|
navBack() {
|
||||||
uni.navigateBack();
|
uni.navigateBack();
|
||||||
|
@ -314,6 +314,9 @@
|
|||||||
},
|
},
|
||||||
onReachBottom() {
|
onReachBottom() {
|
||||||
this.getProductslist();
|
this.getProductslist();
|
||||||
|
},
|
||||||
|
onPageScroll() {
|
||||||
|
uni.$emit('scroll');
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
navBack(){
|
navBack(){
|
||||||
|
@ -157,14 +157,13 @@
|
|||||||
<!--轮播图-->
|
<!--轮播图-->
|
||||||
<view class="swiperBg">
|
<view class="swiperBg">
|
||||||
<view class="swiper page_swiper">
|
<view class="swiper page_swiper">
|
||||||
<swiper :autoplay="false" :circular="circular" :interval="intervals" :duration="duration"
|
<swiper :autoplay="true" loop
|
||||||
indicator-color="rgba(255,255,255,0.6)" indicator-active-color="#fff" :current="swiperCur"
|
indicator-color="rgba(255,255,255,0.6)" indicator-active-color="#fff" :current="swiperCur"
|
||||||
style="height:330rpx;margin: 0 auto;width:710rpx;" @change="swiperChange"
|
style="height:330rpx;margin: 0 auto;width:710rpx;">
|
||||||
:class="{ scalex:isScale }">
|
|
||||||
<block v-for="(item,index) in imgUrls" :key="index">
|
<block v-for="(item,index) in imgUrls" :key="index">
|
||||||
<swiper-item :class="{ active: index == swiperCur,scalex:isScale }">
|
<swiper-item :class="{ active: index == swiperCur }">
|
||||||
<view @click="goDetail(item)" class='slide-navigator acea-row row-between-wrapper'>
|
<view class='slide-navigator acea-row row-between-wrapper'>
|
||||||
<image src="https://lihai001.oss-cn-chengdu.aliyuncs.com/def/e2f0520240203154207556.png"
|
<image :src="item.img"
|
||||||
class="slide-image aa" style="height:330rpx;" mode="aspectFill">
|
class="slide-image aa" style="height:330rpx;" mode="aspectFill">
|
||||||
</image>
|
</image>
|
||||||
</view>
|
</view>
|
||||||
@ -224,6 +223,9 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<Loading></Loading>
|
<Loading></Loading>
|
||||||
|
|
||||||
|
<!--自定义底部tab栏-->
|
||||||
|
<customTab :newData="newData" :activeRouter="activeRouter"></customTab>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@ -242,16 +244,25 @@
|
|||||||
import {
|
import {
|
||||||
applet
|
applet
|
||||||
} from '@/api/public.js';
|
} from '@/api/public.js';
|
||||||
|
import customTab from '@/components/customTab';
|
||||||
|
import {
|
||||||
|
getVersion,
|
||||||
|
getNavigation
|
||||||
|
} from "@/api/public";
|
||||||
// #ifdef APP-PLUS
|
// #ifdef APP-PLUS
|
||||||
import uniMP from '@/utils/uniMP.js';
|
import uniMP from '@/utils/uniMP.js';
|
||||||
// #endif
|
// #endif
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
components:{
|
||||||
|
customTab
|
||||||
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
imgUrls: [{
|
imgUrls: [{
|
||||||
img: 'https://lihai001.oss-cn-chengdu.aliyuncs.com/def/e2f0520240203154207556.png'
|
img: 'https://lihai001.oss-cn-chengdu.aliyuncs.com/def/e2f0520240203154207556.png'
|
||||||
}],
|
}],
|
||||||
|
swiperCur: 0,
|
||||||
locationArr: ({}),
|
locationArr: ({}),
|
||||||
isshow: false,
|
isshow: false,
|
||||||
emptyText: '暂无可用应用',
|
emptyText: '暂无可用应用',
|
||||||
@ -275,7 +286,9 @@
|
|||||||
showPicker: false,
|
showPicker: false,
|
||||||
columnData: [],
|
columnData: [],
|
||||||
isFshow: false,
|
isFshow: false,
|
||||||
backColor: 'rgba(252, 252, 252, 0)'
|
backColor: 'rgba(252, 252, 252, 0)',
|
||||||
|
newData: {},
|
||||||
|
activeRouter: '',
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
@ -284,6 +297,7 @@
|
|||||||
created() {},
|
created() {},
|
||||||
onLoad() {},
|
onLoad() {},
|
||||||
onShow() {
|
onShow() {
|
||||||
|
this.getNav();
|
||||||
if (this.isLogin) {
|
if (this.isLogin) {
|
||||||
this.emptyText = '暂无可用应用'
|
this.emptyText = '暂无可用应用'
|
||||||
this.jurisdiction = false
|
this.jurisdiction = false
|
||||||
@ -293,6 +307,7 @@
|
|||||||
this.jurisdiction = true
|
this.jurisdiction = true
|
||||||
}
|
}
|
||||||
this.getUserInfo();
|
this.getUserInfo();
|
||||||
|
this.imgUrls = uni.getStorageSync('swiperImgList');
|
||||||
},
|
},
|
||||||
onPullDownRefresh() {
|
onPullDownRefresh() {
|
||||||
this.getUserInfo()
|
this.getUserInfo()
|
||||||
@ -321,6 +336,16 @@
|
|||||||
uni.$emit('showLoading', false);
|
uni.$emit('showLoading', false);
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
getNav() {
|
||||||
|
getNavigation().then(res => {
|
||||||
|
this.newData = res.data
|
||||||
|
if (this.newData.status && this.newData.status.status) {
|
||||||
|
uni.hideTabBar()
|
||||||
|
} else {
|
||||||
|
uni.showTabBar()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
initAllAppLet() {
|
initAllAppLet() {
|
||||||
applet().then(res => {
|
applet().then(res => {
|
||||||
this.AllMenuList = res.data;
|
this.AllMenuList = res.data;
|
||||||
|
@ -25,7 +25,7 @@
|
|||||||
<!--轮播图-->
|
<!--轮播图-->
|
||||||
<view class="swiperBg" :style="{ marginTop: (swiperTop + 15)+'px'}">
|
<view class="swiperBg" :style="{ marginTop: (swiperTop + 15)+'px'}">
|
||||||
<view class="swiper page_swiper" v-if="imgUrls.length">
|
<view class="swiper page_swiper" v-if="imgUrls.length">
|
||||||
<swiper :autoplay="false" :circular="circular" :interval="intervals" :duration="duration"
|
<swiper :autoplay="true" :circular="circular" :interval="intervals" :duration="duration"
|
||||||
indicator-color="rgba(255,255,255,0.6)" indicator-active-color="#fff" :current="swiperCur"
|
indicator-color="rgba(255,255,255,0.6)" indicator-active-color="#fff" :current="swiperCur"
|
||||||
style="height:330rpx;margin: 0 auto;width:710rpx;" @change="swiperChange"
|
style="height:330rpx;margin: 0 auto;width:710rpx;" @change="swiperChange"
|
||||||
:class="{ scalex:isScale }">
|
:class="{ scalex:isScale }">
|
||||||
|
@ -760,7 +760,8 @@
|
|||||||
if (item.name == 'headerSerch' || item.name == 'homeComb') {
|
if (item.name == 'headerSerch' || item.name == 'homeComb') {
|
||||||
that.isHeaderSerch = true
|
that.isHeaderSerch = true
|
||||||
if (item.name == 'homeComb') {
|
if (item.name == 'homeComb') {
|
||||||
that.$set(that, 'homeCombData', item)
|
that.$set(that, 'homeCombData', item);
|
||||||
|
uni.setStorageSync('swiperImgList', item.swiperConfig.list);
|
||||||
that.smallPage = true;
|
that.smallPage = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2,38 +2,40 @@
|
|||||||
<view :style="viewColor">
|
<view :style="viewColor">
|
||||||
<view class='shoppingCart'>
|
<view class='shoppingCart'>
|
||||||
|
|
||||||
<!-- 头部 -->
|
<view style="position: fixed;top: 0;left: 0;width: 100%;z-index: 999;">
|
||||||
<view class="shoppingCart-head">
|
<!-- 头部 -->
|
||||||
<view style="height: var(--status-bar-height);"></view>
|
<view class="shoppingCart-head">
|
||||||
<!-- 滚动tab -->
|
<view style="height: var(--status-bar-height);"></view>
|
||||||
<scroll-view scroll-x="true">
|
<!-- 滚动tab -->
|
||||||
<view class="scrollview">
|
<scroll-view scroll-x="true">
|
||||||
<block v-for="(item,indx) in tabsArr" :key="indx">
|
<view class="scrollview">
|
||||||
<view class="scrollview-item" :class="{'scrollview-active':tabsCurr == item.val}"
|
<block v-for="(item,indx) in tabsArr" :key="indx">
|
||||||
@click="tabsChange(item.val)">
|
<view class="scrollview-item" :class="{'scrollview-active':tabsCurr == item.val}"
|
||||||
{{item.name}}
|
@click="tabsChange(item.val)">
|
||||||
</view>
|
{{item.name}}
|
||||||
</block>
|
</view>
|
||||||
</view>
|
</block>
|
||||||
</scroll-view>
|
</view>
|
||||||
</view>
|
</scroll-view>
|
||||||
|
</view>
|
||||||
<view class="func">
|
|
||||||
<!-- 分段器 -->
|
<view class="func" style="padding-top: 0;">
|
||||||
<view class="subsection">
|
<!-- 分段器 -->
|
||||||
<u-subsection :list="['综合云市场','商户购物车']" activeColor="#40AE36" :current="subsecCurr"
|
<!-- <view class="subsection">
|
||||||
mode="subsection" @change="subsecChange"></u-subsection>
|
<u-subsection :list="['综合云市场','商户购物车']" activeColor="#40AE36" :current="subsecCurr"
|
||||||
</view>
|
mode="subsection" @change="subsecChange"></u-subsection>
|
||||||
|
</view> -->
|
||||||
<view class='nav acea-row row-between-wrapper'>
|
<view class='nav acea-row row-between-wrapper'>
|
||||||
<view>购物数量:<text class='num t-color'>{{cartTotalCount}}</text></view>
|
<view>购物数量:<text class='num t-color'>{{cartTotalCount}}</text></view>
|
||||||
<view v-if="cartList.valid.length > 0 || cartList.invalid.length > 0"
|
<view v-if="cartList.valid.length > 0 || cartList.invalid.length > 0"
|
||||||
class='administrate acea-row row-center-wrapper' @click='manage'>{{ footerswitch ? '管理' : '取消'}}
|
class='administrate acea-row row-center-wrapper' @click='manage'>{{ footerswitch ? '管理' : '取消'}}
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view style="height: calc(var(--status-bar-height) + 180rpx);"></view>
|
||||||
|
|
||||||
<view v-if="cartList.valid.length > 0 || cartList.invalid.length > 0">
|
<view v-if="cartList.valid.length > 0 || cartList.invalid.length > 0">
|
||||||
<view class='list'>
|
<view class='list'>
|
||||||
<block v-for="(item,index) in cartList.valid" :key="index">
|
<block v-for="(item,index) in cartList.valid" :key="index">
|
||||||
@ -125,7 +127,7 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class='noCart' v-if="recommend"
|
<view class='noCart' v-if="recommend"
|
||||||
:style="{marginTop:cartList.invalid.length ==0 && cartList.invalid.length ==0?'170rpx':'' }">
|
:style="{paddingTop:cartList.invalid.length ==0 && cartList.invalid.length ==0?'170rpx':'' }">
|
||||||
<view class='pictrue'>
|
<view class='pictrue'>
|
||||||
<image :src="`${domain}/static/images/noCart.png`"></image>
|
<image :src="`${domain}/static/images/noCart.png`"></image>
|
||||||
<view>暂无商品,去添加点什么吧</view>
|
<view>暂无商品,去添加点什么吧</view>
|
||||||
@ -236,9 +238,6 @@
|
|||||||
tabsArr: [{
|
tabsArr: [{
|
||||||
name: '用户购物车',
|
name: '用户购物车',
|
||||||
val: 1
|
val: 1
|
||||||
}, {
|
|
||||||
name: '商户购物车',
|
|
||||||
val: 2
|
|
||||||
}],
|
}],
|
||||||
tabsCurr: 1,
|
tabsCurr: 1,
|
||||||
subsecCurr: 0,
|
subsecCurr: 0,
|
||||||
@ -297,7 +296,10 @@
|
|||||||
onReady() {},
|
onReady() {},
|
||||||
mounted: function() {},
|
mounted: function() {},
|
||||||
onLoad: function(options) {
|
onLoad: function(options) {
|
||||||
|
if(this.$store.state.app.userInfo.mer_info.mer_settlement_agree_status) this.tabsArr.push({
|
||||||
|
name: '商户购物车',
|
||||||
|
val: 2
|
||||||
|
})
|
||||||
},
|
},
|
||||||
onShow: function() {
|
onShow: function() {
|
||||||
let that = this
|
let that = this
|
||||||
@ -326,10 +328,20 @@
|
|||||||
methods: {
|
methods: {
|
||||||
tabsChange(e) {
|
tabsChange(e) {
|
||||||
this.tabsCurr = e;
|
this.tabsCurr = e;
|
||||||
|
this.getCartList();
|
||||||
|
this.getCartNum();
|
||||||
|
this.goodsHidden = true;
|
||||||
|
this.footerswitch = true;
|
||||||
|
this.isAllSelect = true; //全选
|
||||||
|
this.selectValue = []; //选中的数据
|
||||||
|
uni.setStorage({
|
||||||
|
key: 'invoice_Data',
|
||||||
|
data: {},
|
||||||
|
success: function() {}
|
||||||
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
subsecChange(e) {
|
subsecChange(e) {
|
||||||
console.log(e);
|
|
||||||
this.subsecCurr = e;
|
this.subsecCurr = e;
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -379,12 +391,12 @@
|
|||||||
}).then(res => {
|
}).then(res => {
|
||||||
this.getCartList();
|
this.getCartList();
|
||||||
this.getCartNum();
|
this.getCartNum();
|
||||||
return that.$util.Tips({
|
return this.$util.Tips({
|
||||||
title: res.message,
|
title: res.message,
|
||||||
icon: 'success'
|
icon: 'success'
|
||||||
});
|
});
|
||||||
}).catch(err => {
|
}).catch(err => {
|
||||||
return that.$util.Tips({
|
return this.$util.Tips({
|
||||||
title: err
|
title: err
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
@ -710,14 +722,18 @@
|
|||||||
},
|
},
|
||||||
getCartNum: function() {
|
getCartNum: function() {
|
||||||
let that = this;
|
let that = this;
|
||||||
getCartCounts().then(res => {
|
getCartCounts({
|
||||||
|
sale_type: this.tabsCurr
|
||||||
|
}).then(res => {
|
||||||
that.cartTotalCount = res.data[0].count || 0;
|
that.cartTotalCount = res.data[0].count || 0;
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
// 购物车列表
|
// 购物车列表
|
||||||
getCartList: function(isChange) {
|
getCartList: function(isChange) {
|
||||||
let that = this;
|
let that = this;
|
||||||
getCartList().then(res => {
|
getCartList({
|
||||||
|
sale_type: this.tabsCurr
|
||||||
|
}).then(res => {
|
||||||
res.data.list.forEach((item, index) => {
|
res.data.list.forEach((item, index) => {
|
||||||
item.allCheck = true
|
item.allCheck = true
|
||||||
item.list.forEach((goods, j) => {
|
item.list.forEach((goods, j) => {
|
||||||
|
@ -82,7 +82,7 @@
|
|||||||
.category {
|
.category {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
overflow: auto;
|
overflow: auto;
|
||||||
margin-bottom: 70rpx;
|
// margin-bottom: 70rpx;
|
||||||
|
|
||||||
.category-wrap {
|
.category-wrap {
|
||||||
display: flex;
|
display: flex;
|
||||||
@ -152,7 +152,7 @@
|
|||||||
display: flex;
|
display: flex;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
padding: 0 50rpx;
|
padding: 20rpx 50rpx;
|
||||||
|
|
||||||
[class^=comprehensive-] {
|
[class^=comprehensive-] {
|
||||||
display: flex;
|
display: flex;
|
||||||
@ -182,7 +182,7 @@
|
|||||||
<view class="wholeSale">
|
<view class="wholeSale">
|
||||||
|
|
||||||
<!-- 顶部 -->
|
<!-- 顶部 -->
|
||||||
<view class="wholeSale-header">
|
<view class="wholeSale-header" style="position: fixed;top: 0;left: 0;width: 100%;z-index: 999;">
|
||||||
<!-- 适配不同机 -->
|
<!-- 适配不同机 -->
|
||||||
<view style="height: var(--status-bar-height);"></view>
|
<view style="height: var(--status-bar-height);"></view>
|
||||||
|
|
||||||
@ -200,67 +200,74 @@
|
|||||||
</view>
|
</view>
|
||||||
|
|
||||||
<!-- 内容 -->
|
<!-- 内容 -->
|
||||||
<view class="wholeSale-con">
|
<view class="wholeSale-con" style="padding-top: calc(var(--status-bar-height) + 120rpx);">
|
||||||
<!-- 搜索 -->
|
<view class="wholeSale-nav">
|
||||||
<navigator url="/pages/columnGoods/goods_search/index" hover-class="none"
|
<!-- <u-icon class="icon" name="arrow-left" size="20" @click="navBack"></u-icon> -->
|
||||||
class="search_content flex_a_c_j_sb">
|
<!-- 搜索 -->
|
||||||
<view class="flex_a_c search_content_wrap">
|
<navigator url="/pages/columnGoods/goods_search/index" hover-class="none"
|
||||||
<view class="iconfont icon-sousuo" style="font-size: 39rpx;"></view>
|
class="search_content flex_a_c_j_sb">
|
||||||
<input type="text" placeholder="搜索您需要批发进货的产品名称" placeholder-style="font-size: 30rpx;color:#999;"
|
<view class="flex_a_c search_content_wrap">
|
||||||
disabled>
|
<view class="iconfont icon-sousuo" style="font-size: 39rpx;"></view>
|
||||||
</view>
|
<input type="text" placeholder="搜索您需要批发进货的产品名称" placeholder-style="font-size: 30rpx;color:#999;"
|
||||||
<button class="search_btn">搜索</button>
|
disabled style="pointer-events: none;">
|
||||||
</navigator>
|
</view>
|
||||||
|
<!-- <button class="search_btn">搜索</button> -->
|
||||||
|
</navigator>
|
||||||
|
</view>
|
||||||
|
|
||||||
<!-- 商品大分类 -->
|
<!-- 商品大分类 -->
|
||||||
<view class="category">
|
<view class="category">
|
||||||
<scroll-view scroll-x="true">
|
<scroll-view scroll-x="true">
|
||||||
<view class="category-wrap">
|
<view class="category-wrap">
|
||||||
<block v-for="(item,index) in 10" :key="index">
|
<block v-for="(item,index) in store_category" :key="index">
|
||||||
<view class="category-item category-item-active">
|
<view class="category-item" :class="{'category-item-active': index==cate_change}" @click="changeCate(index)">
|
||||||
<u-image width="108rpx" height="108rpx" shape="circle" :lazy-load="true">
|
<u--image class="category-item-img" width="108rpx" :src="item.pic" height="108rpx" shape="circle">
|
||||||
<template v-slot:loading>
|
<template v-slot:loading>
|
||||||
<u-loading-icon color="#999" size="15" />
|
<u-loading-icon color="#999" size="15" />
|
||||||
</template>
|
</template>
|
||||||
</u-image>
|
</u--image>
|
||||||
<text>水果蔬菜</text>
|
<text class="category-item-text">{{item.cate_name}}</text>
|
||||||
</view>
|
</view>
|
||||||
</block>
|
</block>
|
||||||
</view>
|
</view>
|
||||||
</scroll-view>
|
</scroll-view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<!-- 商品小分类 -->
|
<!-- 商品小分类 -->
|
||||||
<view class="cate">
|
<view class="cate" v-if="store_category_children.length>1">
|
||||||
<scroll-view scroll-x="true">
|
<scroll-view scroll-x="true">
|
||||||
<view class="cate-wrap">
|
<view class="cate-wrap">
|
||||||
<block v-for="(item,index) in 10" :key="index">
|
<block v-for="(item,index) in store_category_children" :key="index">
|
||||||
<view class="cate-item" :class="{'cate-item-active':index == 0}">
|
<view class="cate-item" :class="{'cate-item-active':index == cate_change_children}" @click="changeChildrenCate(index)">
|
||||||
<text>水果</text>
|
<text>{{item.cate_name}}</text>
|
||||||
</view>
|
</view>
|
||||||
</block>
|
</block>
|
||||||
</view>
|
</view>
|
||||||
</scroll-view>
|
</scroll-view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<!-- 综合查询 -->
|
<!-- 综合查询 -->
|
||||||
<view class="comprehensive">
|
<view class="comprehensive">
|
||||||
<view class="comprehensive-price">
|
<view class="comprehensive-price">
|
||||||
<text>价格</text>
|
<text>价格</text>
|
||||||
<image src="../../static/new_define/priceChange.png"></image>
|
<image src="@/static/new_define/priceChange.png"></image>
|
||||||
</view>
|
</view>
|
||||||
<view class="comprehensive-sales_num">
|
<view class="comprehensive-sales_num">
|
||||||
<text>销量</text>
|
<text>销量</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="comprehensive-discount">
|
<view class="comprehensive-discount">
|
||||||
<text>抵扣</text>
|
<text>抵扣</text>
|
||||||
<image class="loudou" src="../../static/new_define/loudou.png"></image>
|
<image class="loudou" src="@/static/new_define/loudou.png"></image>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<!-- 流水瀑布 -->
|
<!-- 流水瀑布 -->
|
||||||
<WaterfallsFlow :wfList='hostProduct' @itemTap="goDetail" :type="0" />
|
<WaterfallsFlow :wfList='hostProduct' @itemTap="goDetail" :type="0" />
|
||||||
|
<loadmore :type="isLoading" style="padding: 40rpx 0 150rpx; 0"></loadmore>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
|
<!--自定义底部tab栏-->
|
||||||
|
<customTab :newData="newData" :activeRouter="activeRouter"></customTab>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@ -268,10 +275,21 @@
|
|||||||
import {
|
import {
|
||||||
goShopDetail
|
goShopDetail
|
||||||
} from '@/libs/order.js'
|
} from '@/libs/order.js'
|
||||||
|
import {
|
||||||
|
getStoreCategory,
|
||||||
|
getProductslist,
|
||||||
|
getCategoryIndexList
|
||||||
|
} from "@/api/store.js"
|
||||||
|
import customTab from '@/components/customTab';
|
||||||
|
import {
|
||||||
|
getVersion,
|
||||||
|
getNavigation
|
||||||
|
} from "@/api/public";
|
||||||
import WaterfallsFlow from '@/components/WaterfallsFlow/WaterfallsFlow.vue'
|
import WaterfallsFlow from '@/components/WaterfallsFlow/WaterfallsFlow.vue'
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
WaterfallsFlow
|
WaterfallsFlow,
|
||||||
|
customTab
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
@ -285,13 +303,120 @@
|
|||||||
name: '名优特产批发',
|
name: '名优特产批发',
|
||||||
val: 3
|
val: 3
|
||||||
}],
|
}],
|
||||||
tabsCurr: 1
|
tabsCurr: 1,
|
||||||
|
newData: {},
|
||||||
|
activeRouter: '',
|
||||||
|
hostProduct: [],
|
||||||
|
store_category: [], //商品大分类
|
||||||
|
store_category_children: [], //商品小分类
|
||||||
|
cate_change: 0,
|
||||||
|
cate_change_children: 0,
|
||||||
|
isLoading: 0,
|
||||||
|
where:{
|
||||||
|
page: 1,
|
||||||
|
limit: 20,
|
||||||
|
sale_type: 2, //1为零售, 2为批发
|
||||||
|
mer_id: 259,
|
||||||
|
mer_cate_id: '', //
|
||||||
|
cate_id: '',
|
||||||
|
keyword: '',
|
||||||
|
deduction_rate: '', //抵扣比例
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
onLoad() {
|
||||||
|
this.getNav();
|
||||||
|
this.getStoreCategory();
|
||||||
|
this.getProductslist(true);
|
||||||
|
},
|
||||||
|
onPageScroll() {
|
||||||
|
uni.$emit('scroll');
|
||||||
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
getNav() {
|
||||||
|
getNavigation().then(res => {
|
||||||
|
this.newData = res.data
|
||||||
|
if (this.newData.status && this.newData.status.status) {
|
||||||
|
uni.hideTabBar()
|
||||||
|
} else {
|
||||||
|
uni.showTabBar()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
tabsChange(e) {
|
tabsChange(e) {
|
||||||
this.tabsCurr = e;
|
this.tabsCurr = e;
|
||||||
|
this.where = {
|
||||||
|
page: 1,
|
||||||
|
limit: 20,
|
||||||
|
sale_type: 1
|
||||||
|
}
|
||||||
|
this.cate_change = 0;
|
||||||
|
this.cate_change_children = 0;
|
||||||
|
if(e==1) {
|
||||||
|
this.where.mer_id = 259;
|
||||||
|
}
|
||||||
|
if(e==3){
|
||||||
|
this.where.label_name = '名优特产';
|
||||||
|
}
|
||||||
|
this.getStoreCategory();
|
||||||
|
this.getProductslist(true);
|
||||||
},
|
},
|
||||||
|
changeCate(e){
|
||||||
|
this.cate_change = e;
|
||||||
|
this.store_category_children = [];
|
||||||
|
if(this.store_category[e].children) this.store_category_children = [...this.store_category[e].children];
|
||||||
|
this.store_category_children.unshift({
|
||||||
|
cate_name: '全部',
|
||||||
|
store_category_id: ''
|
||||||
|
})
|
||||||
|
this.cate_change_children = 0;
|
||||||
|
if(this.tabsCurr==1) this.where.mer_cate_id = this.store_category[e].store_category_id;
|
||||||
|
else this.where.cate_id = this.store_category[e].store_category_id
|
||||||
|
this.getProductslist(true);
|
||||||
|
},
|
||||||
|
changeChildrenCate(e){
|
||||||
|
this.cate_change_children = e;
|
||||||
|
let key = 'mer_cate_id';
|
||||||
|
if(this.tabsCurr!=1) key = 'cate_id';
|
||||||
|
this.where[key] = this.store_category_children[e].store_category_id;
|
||||||
|
if(e==0) this.where[key] = this.store_category[this.cate_change].store_category_id; // 如若选中全部, 则取父级id
|
||||||
|
this.getProductslist(true);
|
||||||
|
},
|
||||||
|
getStoreCategory(){
|
||||||
|
if(this.tabsCurr==1) getStoreCategory(259).then(res=>{
|
||||||
|
this.initStoreCate(res);
|
||||||
|
})
|
||||||
|
else getCategoryIndexList().then(res=>{
|
||||||
|
this.initStoreCate(res);
|
||||||
|
})
|
||||||
|
},
|
||||||
|
initStoreCate(res){
|
||||||
|
this.store_category = [{
|
||||||
|
cate_name: '全部',
|
||||||
|
pic: 'https://lihai001.oss-cn-chengdu.aliyuncs.com/def/de2be202312151001024597.png',
|
||||||
|
store_category_id: ''
|
||||||
|
}, ...res.data];
|
||||||
|
this.store_category_children = this.store_category[0].children || [];
|
||||||
|
this.store_category_children.unshift({
|
||||||
|
cate_name: '全部',
|
||||||
|
store_category_id: ''
|
||||||
|
})
|
||||||
|
},
|
||||||
|
getProductslist(reLoad=false){
|
||||||
|
if(reLoad){
|
||||||
|
this.where.page = 1;
|
||||||
|
this.hostProduct = [];
|
||||||
|
this.isLoading = 0;
|
||||||
|
}
|
||||||
|
if(this.isLoading==-1)return;
|
||||||
|
this.isLoading = 1;
|
||||||
|
getProductslist(this.where).then(res=>{
|
||||||
|
this.hostProduct = [...this.hostProduct, ...res.data.list];
|
||||||
|
this.where.page++;
|
||||||
|
this.isLoading = 0;
|
||||||
|
if(res.data.list.length<this.where.limit) this.isLoading = -1;
|
||||||
|
})
|
||||||
|
},
|
||||||
goDetail(item) {
|
goDetail(item) {
|
||||||
goShopDetail(item, this.uid).then(res => {
|
goShopDetail(item, this.uid).then(res => {
|
||||||
if (this.isLogin) {
|
if (this.isLogin) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user