This commit is contained in:
weipengfei 2024-03-18 17:24:38 +08:00
parent 3d4b24e383
commit a3e20397f9
3 changed files with 403 additions and 376 deletions

View File

@ -8,7 +8,7 @@
<view class="nav" v-if="showTab"> <view class="nav" v-if="showTab">
<view class="nav-item" @click="navTo('/pages/cloud_warehouse/home/home')"> <view class="nav-item" @click="navTo('/pages/cloud_warehouse/home/home')">
<view class="nav-item-up"> <view class="nav-item-up">
<image src="https://lihai001.oss-cn-chengdu.aliyuncs.com/def/1c050202403121539159687.png" mode=""></image> <image src="https://lihai001.oss-cn-chengdu.aliyuncs.com/def/10c5e202403181723158647.webp" mode=""></image>
</view> </view>
<view class="nav-item-down"> <view class="nav-item-down">
<view class="nav-item-down-title">里海云仓</view> <view class="nav-item-down-title">里海云仓</view>
@ -17,7 +17,7 @@
</view> </view>
<view class="nav-item" @click="navTo('/pages/cloud_warehouse/market/market')"> <view class="nav-item" @click="navTo('/pages/cloud_warehouse/market/market')">
<view class="nav-item-up"> <view class="nav-item-up">
<image src="https://lihai001.oss-cn-chengdu.aliyuncs.com/def/9d4d720240312153933187.png" mode=""></image> <image src="https://lihai001.oss-cn-chengdu.aliyuncs.com/def/2d5b3202403181723524392.webp" mode=""></image>
</view> </view>
<view class="nav-item-down"> <view class="nav-item-down">
<view class="nav-item-down-title">供销云市场</view> <view class="nav-item-down-title">供销云市场</view>
@ -26,7 +26,7 @@
</view> </view>
<view class="nav-item" @click="navTo('/pages/cloud_warehouse/specialty/specialty')"> <view class="nav-item" @click="navTo('/pages/cloud_warehouse/specialty/specialty')">
<view class="nav-item-up"> <view class="nav-item-up">
<image src="https://lihai001.oss-cn-chengdu.aliyuncs.com/def/cef80202403121539479409.png" mode=""></image> <image src="https://lihai001.oss-cn-chengdu.aliyuncs.com/def/0fccd202403181724074622.webp" mode=""></image>
</view> </view>
<view class="nav-item-down"> <view class="nav-item-down">
<view class="nav-item-down-title">名优特产</view> <view class="nav-item-down-title">名优特产</view>

View File

@ -2,8 +2,8 @@
"name" : "惠农生活", "name" : "惠农生活",
"appid" : "__UNI__3A527D1", "appid" : "__UNI__3A527D1",
"description" : "", "description" : "",
"versionName" : "2.0.0", "versionName" : "2.0.1",
"versionCode" : 200, "versionCode" : 201,
"transformPx" : false, "transformPx" : false,
/* 5+App */ /* 5+App */
"app-plus" : { "app-plus" : {

View File

@ -128,6 +128,7 @@
} }
} }
} }
.cate { .cate {
width: 100%; width: 100%;
overflow: auto; overflow: auto;
@ -184,7 +185,7 @@
} }
.comp-color{ .comp-color {
text { text {
margin-right: 12rpx; margin-right: 12rpx;
@ -209,8 +210,8 @@
<scroll-view scroll-x="true" :scroll-top="100" :show-scrollbar="false" scroll-into-view="a1"> <scroll-view scroll-x="true" :scroll-top="100" :show-scrollbar="false" scroll-into-view="a1">
<view class="scrollview"> <view class="scrollview">
<block v-for="(item,indx) in tabsArr" :key="indx"> <block v-for="(item,indx) in tabsArr" :key="indx">
<view class="scrollview-item" :id="'a' + indx" <view class="scrollview-item" :id="'a' + indx" :class="{'scrollview-active':tabsCurr == item.val}"
:class="{'scrollview-active':tabsCurr == item.val}" @click="tabsChange(item.val)"> @click="tabsChange(item.val)">
{{item.name}} {{item.name}}
</view> </view>
</block> </block>
@ -223,12 +224,12 @@
<view class="wholeSale-nav"> <view class="wholeSale-nav">
<!-- <u-icon class="icon" name="arrow-left" size="20" @click="navBack"></u-icon> --> <!-- <u-icon class="icon" name="arrow-left" size="20" @click="navBack"></u-icon> -->
<!-- 搜索 --> <!-- 搜索 -->
<view @click="navTo(`/pages/columnGoods/goods_search/index?back=true&searchVal=${where.keyword}`)" hover-class="none" <view @click="navTo(`/pages/columnGoods/goods_search/index?back=true&searchVal=${where.keyword}`)"
class="search_content flex_a_c_j_sb"> hover-class="none" class="search_content flex_a_c_j_sb">
<view class="flex_a_c search_content_wrap"> <view class="flex_a_c search_content_wrap">
<view class="iconfont icon-sousuo" style="font-size: 39rpx;"></view> <view class="iconfont icon-sousuo" style="font-size: 39rpx;"></view>
<input type="text" placeholder="搜索您需要批发进货的产品名称" :value="where.keyword" placeholder-style="font-size: 30rpx;color:#999;" <input type="text" placeholder="搜索您需要批发进货的产品名称" :value="where.keyword"
disabled style="pointer-events: none;"> placeholder-style="font-size: 30rpx;color:#999;" disabled style="pointer-events: none;">
</view> </view>
<!-- <button class="search_btn">搜索</button> --> <!-- <button class="search_btn">搜索</button> -->
</view> </view>
@ -239,7 +240,8 @@
<scroll-view scroll-x="true"> <scroll-view scroll-x="true">
<view class="category-wrap"> <view class="category-wrap">
<block v-for="(item,index) in store_category" :key="index"> <block v-for="(item,index) in store_category" :key="index">
<view class="category-item" :class="{'category-item-active': index==cate_change}" @click="changeCate(index)"> <view class="category-item" :class="{'category-item-active': index==cate_change}"
@click="changeCate(index)">
<u--image class="category-item-img" width="108rpx" :src="item.pic" height="108rpx" shape="circle"> <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" />
@ -257,7 +259,8 @@
<scroll-view scroll-x="true"> <scroll-view scroll-x="true">
<view class="cate-wrap"> <view class="cate-wrap">
<block v-for="(item,index) in store_category_children" :key="index"> <block v-for="(item,index) in store_category_children" :key="index">
<view class="cate-item" :class="{'cate-item-active':index == cate_change_children}" @click="changeChildrenCate(index)"> <view class="cate-item" :class="{'cate-item-active':index == cate_change_children}"
@click="changeChildrenCate(index)">
<text>{{item.cate_name}}</text> <text>{{item.cate_name}}</text>
</view> </view>
</block> </block>
@ -274,17 +277,36 @@
<view class="comprehensive-sales_num" :class="{'comp-color': orderCurr==2}" @click="toOrder('sales', 2)"> <view class="comprehensive-sales_num" :class="{'comp-color': orderCurr==2}" @click="toOrder('sales', 2)">
<text>销量</text> <text>销量</text>
</view> </view>
<view class="comprehensive-discount" :class="{'comp-color': orderCurr==3}" v-if="tabsCurr!=1" @click="toOrder('', 3)"> <view class="comprehensive-discount" :class="{'comp-color': orderCurr==3}" v-if="tabsCurr!=1"
@click="toOrder('', 3)">
<text>综合</text> <text>综合</text>
</view> </view>
<view class="comprehensive-discount" v-else > <view class="comprehensive-discount" v-else @click="deduction_rate=!deduction_rate;">
<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>
<!-- 综合查询 -->
<view class="comprehensive" v-if="deduction_rate">
<view class="comprehensive-sales_num" :class="{'comp-color': where.deduction_rate==''}" @click="changeDeduction('')">
<text>全部</text>
</view>
<view class="comprehensive-sales_num" :class="{'comp-color': where.deduction_rate=='10'}" @click="changeDeduction('10')">
<text>1:9</text>
</view>
<view class="comprehensive-sales_num" :class="{'comp-color': where.deduction_rate=='15'}" @click="changeDeduction('15')">
<text>2:8</text>
</view>
<view class="comprehensive-sales_num" :class="{'comp-color': where.deduction_rate=='20'}" @click="changeDeduction('20')">
<text>3:7</text>
</view>
<view class="comprehensive-sales_num" :class="{'comp-color': where.deduction_rate=='25'}" @click="changeDeduction('25')">
<text>4:6</text>
</view>
</view>
<!-- 流水瀑布 --> <!-- 流水瀑布 -->
<WaterfallsFlow :wfList='hostProduct' @itemTap="goDetail" :type="0" :sale_type="2"/> <WaterfallsFlow :wfList='hostProduct' @itemTap="goDetail" :type="0" :sale_type="2" />
<loadmore :type="isLoading" style="padding: 40rpx 0 150rpx; 0"></loadmore> <loadmore :type="isLoading" style="padding: 40rpx 0 150rpx; 0"></loadmore>
</view> </view>
@ -335,7 +357,8 @@
cate_change: 0, cate_change: 0,
cate_change_children: 0, cate_change_children: 0,
isLoading: 0, isLoading: 0,
where:{ deduction_rate: false, //
where: {
page: 1, page: 1,
limit: 20, limit: 20,
sale_type: 2, //1, 2 sale_type: 2, //1, 2
@ -360,20 +383,24 @@
this.getProductslist(); this.getProductslist();
}, },
methods: { methods: {
toOrder(type, index = -1){ changeDeduction(e){
this.orderCurr = index; this.where.deduction_rate = e;
if(type=='price'){
if(this.where.order=='price_asc') this.where.order = 'price_desc';
else this.where.order = 'price_asc';
}else this.where.order = type;
this.getProductslist(true); this.getProductslist(true);
}, },
navTo(url){ toOrder(type, index = -1) {
this.orderCurr = index;
if (type == 'price') {
if (this.where.order == 'price_asc') this.where.order = 'price_desc';
else this.where.order = 'price_asc';
} else this.where.order = type;
this.getProductslist(true);
},
navTo(url) {
uni.navigateTo({ uni.navigateTo({
url:url, url: url,
success: () => { success: () => {
uni.$once('searchValue', (e)=>{ uni.$once('searchValue', (e) => {
this.$nextTick(()=>{ this.$nextTick(() => {
this.where.keyword = e; this.where.keyword = e;
this.getProductslist(true); this.getProductslist(true);
}) })
@ -406,36 +433,36 @@
this.getStoreCategory(); this.getStoreCategory();
this.getProductslist(true); this.getProductslist(true);
}, },
changeCate(e){ changeCate(e) {
this.cate_change = e; this.cate_change = e;
this.store_category_children = []; this.store_category_children = [];
if(this.store_category[e].children) this.store_category_children = [...this.store_category[e].children]; if (this.store_category[e].children) this.store_category_children = [...this.store_category[e].children];
this.store_category_children.unshift({ this.store_category_children.unshift({
cate_name: '全部', cate_name: '全部',
store_category_id: '' store_category_id: ''
}) })
this.cate_change_children = 0; this.cate_change_children = 0;
if(this.tabsCurr==1) this.where.mer_cate_id = this.store_category[e].store_category_id; 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 else this.where.cate_id = this.store_category[e].store_category_id
this.getProductslist(true); this.getProductslist(true);
}, },
changeChildrenCate(e){ changeChildrenCate(e) {
this.cate_change_children = e; this.cate_change_children = e;
let key = 'mer_cate_id'; let key = 'mer_cate_id';
if(this.tabsCurr!=1) key = 'cate_id'; if (this.tabsCurr != 1) key = 'cate_id';
this.where[key] = this.store_category_children[e].store_category_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 if (e == 0) this.where[key] = this.store_category[this.cate_change].store_category_id; // , id
this.getProductslist(true); this.getProductslist(true);
}, },
getStoreCategory(){ getStoreCategory() {
if(this.tabsCurr==1) getStoreCategory(259).then(res=>{ if (this.tabsCurr == 1) getStoreCategory(259).then(res => {
this.initStoreCate(res); this.initStoreCate(res);
}) })
else getCategoryIndexList().then(res=>{ else getCategoryIndexList().then(res => {
this.initStoreCate(res); this.initStoreCate(res);
}) })
}, },
initStoreCate(res){ initStoreCate(res) {
this.store_category = [{ this.store_category = [{
cate_name: '全部', cate_name: '全部',
pic: 'https://lihai001.oss-cn-chengdu.aliyuncs.com/def/de2be202312151001024597.png', pic: 'https://lihai001.oss-cn-chengdu.aliyuncs.com/def/de2be202312151001024597.png',
@ -447,18 +474,18 @@
store_category_id: '' store_category_id: ''
}) })
}, },
getProductslist(reLoad=false){ getProductslist(reLoad = false) {
if(reLoad){ if (reLoad) {
this.where.page = 1; this.where.page = 1;
this.hostProduct = []; this.hostProduct = [];
this.isLoading = 0; this.isLoading = 0;
} }
if(this.isLoading==-1)return; if (this.isLoading == -1) return;
this.isLoading = 1; this.isLoading = 1;
getProductslist(this.where).then(res=>{ getProductslist(this.where).then(res => {
this.hostProduct = [...this.hostProduct, ...res.data.list]; this.hostProduct = [...this.hostProduct, ...res.data.list];
this.isLoading = 0; this.isLoading = 0;
if(res.data.list.length<this.where.limit) this.isLoading = -1; if (res.data.list.length < this.where.limit) this.isLoading = -1;
this.where.page++; this.where.page++;
}) })
}, },