diff --git a/components/shortPopup.vue b/components/shortPopup.vue index 3ce2623..1bdc649 100644 --- a/components/shortPopup.vue +++ b/components/shortPopup.vue @@ -1,38 +1,57 @@ diff --git a/pages/nongKe/cloud_entrepot/indexb.vue b/pages/nongKe/cloud_entrepot/indexb.vue index 46f403c..84d297a 100644 --- a/pages/nongKe/cloud_entrepot/indexb.vue +++ b/pages/nongKe/cloud_entrepot/indexb.vue @@ -4,23 +4,23 @@ - - - + - - - 供销综合云市场 + + + + 供销综合云市场 + + + 供销综合云商品 + - - 供销综合云商品 - - {{street||'定位中'}} - - + + - @@ -62,6 +62,11 @@ + + + + + @@ -69,15 +74,20 @@ - {{item.cate_name}} + {{item.cate_name}} - 综合 + 综合 - 销量 - 价格 + 销量 + + 价格 + + + + @@ -97,7 +107,7 @@ {{item.product.store_info}} - + {{ item.product.price.split('.')[0] }}.{{item.product.price.split('.')[1]}} @@ -148,7 +158,22 @@ @cancel="showPicker = false" @change="changeHandler" keyName="name"> - + + + 请选择商品分类 + + + + {{item.cate_name}} + + + + + + + @@ -201,6 +226,7 @@ import Cache from '@/utils/cache'; import shortPopup from "@/components/shortPopup.vue" + import { Toast } from '../../../libs/uniApi'; const app = getApp(); export default { components: { @@ -238,6 +264,7 @@ street: "", showPicker: false, status: "loadmore", + price_order: 'price_asc', //价格排序方式(升降), price_asc, price_desc // 下拉菜单 downMenu: [{ title: '默认', @@ -260,15 +287,13 @@ order: 'location' } ], - // 是否第一个 - firstKey: 0, // 商铺列表 storeList: [], storeParam: { keyword: '', page: 1, limit: 10, - order: 'location', + order: '', category_id: '', type_id: '', street_id: '', @@ -276,8 +301,8 @@ }, storeKey: 0, storeScroll: true, - changeCategory: '', // 当前选中一级分类 - category_tow_id: '', //当前选中二级分类id + merchant: '', // 当前选中一级分类 + merchantTow: '', //当前选中二级分类 mer_id: '', sortId: '', price_on: '', @@ -299,8 +324,8 @@ goodsNum: 0, totalMoney: 0, goodsList: [], //商品列表 - changeItem: null, //选择的商品 showLoading: false, //是否显示加载 + allShow: false, //是否显示全部类型弹窗 }; }, async onLoad(options) { @@ -320,6 +345,7 @@ this.storeParam.type_id = options.type_id && options.type_id.split(',').toString() || '' this.storeParam.category_id = options.cate_id && options.cate_id.split(',').toString() || '' this.storeList = []; + this.showLoading = true; await this.getCloundShop(); this.cartFn(); if (this.mer_location == 1) { @@ -371,21 +397,9 @@ type: 2 }) this.cloudList = data; - this.changeCategory = this.cloudList[0]; - await townCloud({ - street_code: this.street_id, - category_id: this.category_id, - location: this.latitude + ',' + this.longitude - }).then(res => { - this.trnList = [] - this.goodsList = res.data.list; - this.goodsList.forEach(item => { - this.trnList.push({ - left: 0, - bottom: 0 - }) - }) - }) + this.merchant = this.cloudList[0]; + this.merchantTow = this.merchant?.children[0]; + this.storeParam.category_id = this.merchantTow.store_category_id; return null; }, selectLocation() { @@ -439,10 +453,8 @@ }, onInputConfirm() { - this.showSerch = false this.searchSubmit() - }, // 对象转数组 objToArr(data) { @@ -575,7 +587,10 @@ }, selfLocation() { let self = this - if (uni.getStorageSync('RejectTarget')) return; + if (uni.getStorageSync('RejectTarget')){ + this.getStoreList(); + return; + } if (this.$store?.state?.storage?.location?.lat) { this.latitude = this.$store?.state?.storage?.location?.lat; this.longitude = this.$store?.state?.storage?.location?.long; @@ -589,11 +604,13 @@ this.recommend_address = res.data.address.length > 4 ? res.data.address .slice(0, 4) + '...' : res.data.address; + this.getStoreList(); }).catch(err => { uni.showToast({ title: err, icon: 'none' }) + this.getStoreList(); }) } else uni.getLocation({ type: 'gcj02', @@ -618,11 +635,13 @@ this.recommend_address = res.data.address.length > 4 ? res.data.address .slice(0, 4) + '...' : res.data.address + this.getStoreList(); }).catch(err => { uni.showToast({ title: err, icon: 'none' }) + this.getStoreList(); }) }, fail: (res) => { @@ -651,20 +670,23 @@ }, // 搜索 searchSubmit: function() { + console.log('搜索', this.storeParam.keyword); let that = this; that.$set(that.storeParam, 'keyword', this.storeParam.keyword); - this.set_where(this.firstKey) + this.set_where('') this.showSerch = false }, //点击事件处理 set_where: function(e) { if (this.loading) return this.storeList = [] - this.firstKey = e this.storeParam.page = 1 // this.storeParam.order = this.downMenu[e].order - this.storeParam.order = 'location' //使用距离进行排序 + // this.storeParam.order = 'location' //使用距离进行排序 + this.storeParam.order = e //选择排序方式 this.getStoreList(); + if(e=='price_asc') return this.price_order = 'price_desc'; + if(e=='price_desc') return this.price_order = 'price_asc'; }, backjJump() { uni.navigateBack({ @@ -672,34 +694,39 @@ }) }, // 点击商品一级分类 - changeMerchant(item) { - this.changeMerchant = item; - this.storeParam.category_id = this.category_id; + changeMerchant(item, type=false) { + this.merchant = item; + this.merchantTow = item.children[0]; + this.storeParam.category_id = this.merchant.store_category_id; this.storeParam.page = 1; this.goodsList = []; + if(type) this.$refs.allRef.close(); this.getStoreList() }, // 点击商品二级分类 - changeMerchantTow(){ - this.storeParam.category_id = this.category_id; + changeMerchantTow(item){ + this.merchantTow = item; + this.storeParam.category_id = this.merchantTow.store_category_id; this.storeParam.page = 1; this.getStoreList() }, // 商品列表 - getStoreList() { - console.log('加载商品'); + getStoreList(load=false) { this.showLoading = true this.status = "loading" - this.storeParam.page = 1; + if(!load) { + this.storeParam.page = 1; + this.goodsList = []; + } townCloud({ street_code: this.street_id, - category_id: this.category_id || "22", - // order: this.storeParam.order, - keyword: this.keyword, + category_id: this.storeParam.category_id, + order: this.storeParam.order, + keyword: this.storeParam.keyword, page: this.storeParam.page, location: this.latitude+','+this.longitude, }).then(res => { - this.goodsList = res.data.list + this.goodsList = [...this.goodsList, ...res.data.list] this.showLoading = false this.goodsList.forEach(item => { this.trnList.push({ @@ -708,7 +735,7 @@ }) }) }).catch(e=>{ - console.log(e); + Toast(e.msg||e.message||e) this.showLoading = false; }) }, @@ -717,11 +744,14 @@ }, loadMoreRight() { // 加载更多右侧内容的逻辑 - console.log('右侧'); + this.storeParam.page++; + this.getStoreList(true); }, // 购物车信息 cartFn() { - getCartList().then(res => { + getCartList({ + source: 103 + }).then(res => { this.totalMoney = 0 this.cartList = res.data.list this.cartList.forEach(e => { @@ -731,14 +761,35 @@ }) this.totalMoney = this.totalMoney.toFixed(2) }) - getCartCounts().then(res => { + getCartCounts({ + source: 103 + }).then(res => { this.goodsNum = res.data[0].count }) }, // 点击商品 clickProduct(data){ - this.changeItem = data; + this.$refs.shortPopupRef.setDatas(data, this.goodsNum); this.$refs.shortPopupRef.open(); + }, + // 点击全部 + showAllRef(){ + this.$refs.allRef.open(); + }, + changeAllRef(e){ + this.allShow = e.show; + }, + // 搜索 + navToSearch(){ + uni.navigateTo({ + url: `/pages/columnGoods/goods_search/index?back=${true}&searchVal=${this.storeParam.keyword}`, + success:()=> { + uni.$once('searchValue', (e)=>{ + this.storeParam.keyword = e; + this.searchSubmit(); + }) + } + }) } }, //刷新 @@ -748,32 +799,16 @@ onShow() { this.showSelect = false }, - //上划加载更多 - onReachBottom() { - this.storeParam.page += 1 - - let rqData = { - keyword: this.storeParam.keyword, - page: this.storeParam.page, - limit: 10, - order: this.storeParam.order, - category_id: this.storeParam.category_id, - type_id: this.storeParam.type_id, - street_id: this.storeParam.street_id, - credit_buy: this.credit_buy + // 页面返回 + onBackPress() { + if(this.$refs.shortPopupRef.isShow){ + this.$refs.shortPopupRef.close(); + return true; + } else if(this.allShow){ + this.$refs.allRef.close(); + return true; } - if (this.latitude) { - rqData.location = this.latitude + ',' + this.longitude - } - // console.log(rqData) - getStoreList(rqData).then(res => { - console.log(res.data.list.length); - if (res.data.list.length < rqData.limit) { - this.status = "nomore" - } - this.count = res.data.count - this.storeList.push(...res.data.list) - }) + else return false; } } @@ -788,6 +823,64 @@ page { background-color: #f5f5f5; } + + .all_ref{ + height: 100vh; + width: 510rpx; + background-color: #fff; + padding: 30rpx; + .header{ + height: 100rpx; + font-size: 33rpx; + font-weight: bold; + display: flex; + align-items: center; + } + .all_list{ + display: flex; + flex-wrap: wrap; + justify-content: flex-start; + align-items: flex-start; + } + .menu_li { + display: flex; + flex-direction: column; + align-items: center; + width: 150rpx; + height: 150rpx; + overflow: hidden; + + // width: 120rpx; + // display: inline-block; + .image { + border-radius: 50%; + border: 5rpx solid #fff; + } + + .li_text { + width: 100%; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; + text-align: center; + padding: 4rpx 10rpx; + } + } + + .menu_li_on { + .image { + border: 5rpx solid #ff6d20; + border-radius: 50%; + } + + .li_text { + background-color: #ff6d20; + border-radius: 2em; + color: #fff; + padding: 4rpx 10rpx; + } + } + } .com_name { font-size: 33.29rpx; @@ -833,17 +926,34 @@ .content { flex: 1; - padding: 20rpx; - padding-top: 0; + padding: 0 20rpx 10rpx 20rpx; } .menu_cls { - background-color: white; + // background-color: white; // height: 199.77rpx; border-radius: 21.03rpx 21.03rpx 21.03rpx 21.03rpx; - padding: 20rpx 20rpx 0 20rpx; + padding: 10rpx 70rpx 0 0; font-size: 26.29rpx; - height: 220rpx; + height: 155rpx; + overflow: hidden; + position: relative; + + .all{ + position: absolute; + top: 0; + right: 0; + padding: 0 15rpx; + height: 100%; + display: flex; + justify-content: center; + flex-direction: column; + background-color: #f5f5f5; + image{ + width: 30rpx; + height: 30rpx; + } + } .menu_li { margin-right: 20rpx; @@ -858,6 +968,7 @@ // width: 120rpx; // display: inline-block; .image { + border-radius: 50%; border: 5rpx solid #fff; } @@ -889,7 +1000,7 @@ .container { display: flex; - height: calc(100vh - 400rpx - var(--status-bar-height)); + height: calc(100vh - 320rpx - var(--status-bar-height)); .left-panel { width: 180rpx; @@ -936,7 +1047,7 @@ background-color: #fff; .right-panel-head { - height: 100rpx; + height: 70rpx; box-sizing: border-box; display: flex; justify-content: space-between; @@ -946,11 +1057,18 @@ view { display: flex; + align-items: center; margin-left: 40rpx; } .active { color: #333; + font-weight: bold; + } + + .icon{ + height: 22rpx; + width: 18rpx; } } @@ -962,8 +1080,8 @@ display: flex; .image { - height: 175.23rpx; - width: 175.23rpx; + height: 145.23rpx; + width: 145.23rpx; border-radius: 21.03rpx 21.03rpx 21.03rpx 21.03rpx; margin-right: 20rpx; flex-shrink: 0; @@ -1128,7 +1246,7 @@ } .hot_serch { - height: 20rpx; + height: 0rpx; } .productList .search .input { @@ -1624,7 +1742,7 @@ } .sswz { - margin-top: 30rpx; + margin-top: 10rpx; display: flex; justify-content: space-between; box-sizing: border-box; diff --git a/pages/nongKe/supply_chain/supplierB.vue b/pages/nongKe/supply_chain/supplierB.vue index cff2b73..5175013 100644 --- a/pages/nongKe/supply_chain/supplierB.vue +++ b/pages/nongKe/supply_chain/supplierB.vue @@ -7,21 +7,23 @@ - + - - - 供销综合云市场 - - - 供销综合云商品 - - + + + + 供销综合云市场 + + + 供销综合云商品 + + + {{street||'定位中'}} @@ -46,8 +48,8 @@ --> - - + + @@ -111,47 +113,53 @@ - - - - - - {{item.mer_name}} - {{item.type_name}} - - - - - - - - - {{item.service_score}} - 月销{{item.sales}} - {{item.distance}} - - - - {{item.service_phone}} - - {{item.street_name}} - - - - {{item.mer_take_time[0]}}-{{item.mer_take_time[1]}} - - - - {{item.mer_address}} - - + + + + {{item.mer_name}} + {{item.type_name}} + + 月销{{item.sales}} + + + + + + + + + {{item.street_name}} + + + + + + + + + + + {{item.service_score}} + {{item.distance}} + + + + {{item.service_phone}} + + {{item.mer_take_time[0]}}-{{item.mer_take_time[1]}} + + + + {{item.mer_address}} + + + @@ -843,6 +851,17 @@ this.storeParam.category_id = this.merchant_category_id; this.storeParam.page = 1; this.storeMerchantList() + }, + navToSearch(){ + uni.navigateTo({ + url: `/pages/columnGoods/goods_search/index?back=${true}&searchVal=${this.storeParam.keyword}`, + success:()=> { + uni.$once('searchValue', (e)=>{ + this.storeParam.keyword = e; + this.searchSubmit(); + }) + } + }) } }, //刷新 @@ -896,12 +915,11 @@ font-size: 33.29rpx; // background-color: red; // max-width: 45vw; - max-width: 40vw; - white-space: nowrap; - /* 防止文字换行 */ - overflow: hidden; - /* 超出部分隐藏 */ - text-overflow: ellipsis; + // white-space: nowrap; + // /* 防止文字换行 */ + // overflow: hidden; + // /* 超出部分隐藏 */ + // text-overflow: ellipsis; /* 使用省略号表示溢出的内容 */ // width: 200px; /* 可根据实际情况调整容器宽度 */ @@ -1011,40 +1029,73 @@ background-color: white; padding: 20rpx; // border-radius: 20rpx; - display: flex; + // display: flex; border-radius: 21rpx 21rpx 21rpx 21rpx; // align-items: center; - - .left { - margin-right: 20rpx; - width: 158rpx; - height: 158rpx; - border-radius: 20rpx; - overflow: hidden; - } - - .right { - flex: 1; - color: #737373; + .head{ + display: flex; + justify-content: space-between; + align-items: center; + width: 100%; .head { font-weight: bold; // color: red; color: #333; - } + } - .li { + .left { + margin-right: 20rpx; + width: 140.19rpx; + height: 140.19rpx; + border-radius: 20rpx; + overflow: hidden; + position: relative; + .left_text{ + position: absolute; + bottom: 0; + left: 0; + background-color: rgba(#000, 0.5); width: 100%; - display: flex; - font-size: 28.04rpx; - margin-bottom: 10rpx; - align-items: center; - - text { - margin: 0 20rpx 0 5rpx; - } - } + font-size: 21rpx; + font-weight: 400; + color: #FFFFFF; + display: flex; + justify-content: center; + align-items: center; + image{ + width: 21.03rpx; + height: 21.03rpx; + flex-shrink: 0; + } + view{ + overflow: hidden; + white-space: nowrap; + text-overflow: ellipsis; + } + } } + + .right { + flex: 1; + display: flex; + flex-direction: column; + justify-content: space-evenly; + color: #737373; + } + + + .li { + width: 100%; + display: flex; + font-size: 28.04rpx; + margin-bottom: 10rpx; + align-items: center; + + text { + margin: 0 20rpx 0 5rpx; + } + } } } @@ -1596,7 +1647,7 @@ } .sswz { - margin-top: 30rpx; + margin-top: 10rpx; display: flex; justify-content: space-between; box-sizing: border-box; diff --git a/static/images/icon/all.png b/static/images/icon/all.png new file mode 100644 index 0000000..fa4b98f Binary files /dev/null and b/static/images/icon/all.png differ diff --git a/static/images/icon/close.png b/static/images/icon/close.png new file mode 100644 index 0000000..9f510ac Binary files /dev/null and b/static/images/icon/close.png differ diff --git a/static/images/icon/short.png b/static/images/icon/short.png new file mode 100644 index 0000000..9821ac0 Binary files /dev/null and b/static/images/icon/short.png differ diff --git a/static/images/location.png b/static/images/location.png new file mode 100644 index 0000000..08448ee Binary files /dev/null and b/static/images/location.png differ