diff --git a/package1/group/groupBuyList.vue b/package1/group/groupBuyList.vue index 7aff7c3..b36508d 100644 --- a/package1/group/groupBuyList.vue +++ b/package1/group/groupBuyList.vue @@ -20,39 +20,33 @@ - - - - - - - + {{item.name}} - + {{item.name}} - + 综合排序 - + 销量优先 - + 评分优先 @@ -61,307 +55,64 @@ 区域选择 - 最热 - 最新 - 最新 - 最新 + {{item.title}} - + - + - + - + - 牛仔农庄(医专店) + {{item.shopName}} - 4.3 - + {{item.shopScore}} + - 炒菜 + {{item.shopTypeTitle}} - 已拼 12 单 - - - 月售 100+ - - - - - - - - - - - - 啤酒价格 - - - ¥90.00 - - - 拼团 ¥85.00 - - - - - - - - - - 啤酒价格 - - - ¥90.00 - - - 拼团 ¥85.00 - - - - - - - - - - 啤酒价格 - - - ¥90.00 - - - 拼团 ¥85.00 - - - - - - - - - - 啤酒价格 - - - ¥90.00 - - - 拼团 ¥85.00 - - - - - - - - - - 啤酒价格 - - - ¥90.00 - - - 拼团 ¥85.00 - - - - - - - - - - 啤酒价格 - - - ¥90.00 - - - 拼团 ¥85.00 - - - - - - - - - - 啤酒价格 - - - ¥90.00 - - - 拼团 ¥85.00 - - - - - - - - - - - - - - 牛仔农庄(医专店) - - - - 4.3 - - - - - 炒菜 + + {{item.subtitle}} - - - - 已拼 12 单 - - 月售 100+ + 已拼 {{item.saleCount != null ? item.saleCount : 0}} - - - - - - - - 啤酒价格 - - - ¥90.00 - - - 拼团 ¥85.00 - - - - - - - - - - 啤酒价格 - - - ¥90.00 - - - 拼团 ¥85.00 - - - - - - - - - - 啤酒价格 - - - ¥90.00 - - - 拼团 ¥85.00 - - - - + + - + - 啤酒价格 + {{item1.productName}} - ¥90.00 + ¥{{item1.attributeListPrice | sliceMsg}} - 拼团 ¥85.00 - - - - - - - - - - 啤酒价格 - - - ¥90.00 - - - 拼团 ¥85.00 - - - - - - - - - - 啤酒价格 - - - ¥90.00 - - - 拼团 ¥85.00 - - - - - - - - - - 啤酒价格 - - - ¥90.00 - - - 拼团 ¥85.00 + 拼团 ¥{{item1.productGroupBuyPrices | slicePrice}} - + 当前2000名配送员在线 @@ -379,6 +130,27 @@ autoplay: true, interval: 4000, duration: 1000, + searchScore: false, + searchSale: false, + pageNum:1, + shopArea:[], + totalPages:1, + searchForm:{ + regionId:JSON.parse(uni.getStorageSync('area')).id, + shopType:'', + shopArea:'', + pageNum: 1, + pageSize: '10', + sort: "createTime", + order: "desc", + sortOrder:'shoprank', + orderOrder:'desc', + sortScore:'', + orderScore:'', + sortSale:'', + orderSale:'' + }, + shopList:[], menuBtn:[{ name:'美食', url:'https://jewel-shop.oss-cn-beijing.aliyuncs.com/d6b53eb217644e74bbf957ff7462c27b.png', @@ -405,7 +177,7 @@ url:'https://jewel-shop.oss-cn-beijing.aliyuncs.com/8d2f7ffb67a4477ebe663f562b3bd018.png', index:6 },{ - name:'家常菜', + name:'烤肉拌饭', url:'https://jewel-shop.oss-cn-beijing.aliyuncs.com/5e4fa14df92942eeb62254c8eb82f122.png', index:7 },{ @@ -426,18 +198,149 @@ }, components: { + }, + filters: { + sliceMsg(val) { + var name = '' + if (typeof(val) == 'string') { + let newObj = JSON.parse(val) + for (let as in newObj) { + name = newObj[as].specPrice + } + } + return name; + }, + slicePrice(val){ + let begin = '' + if(val != null){ + begin = val[0].groupPrice + for(let i = 0;i < val.length;i++){ + if(val[i].groupPrice < begin){ + begin = val[i].groupPrice + } + } + } + return begin; + } }, onLoad() { - + this.getEatType(); + this.getShopArea(); }, onShow() { this.menuButtonInfo = uni.getMenuButtonBoundingClientRect() + uni.showLoading({ + title: '加载中...', + mask: true + }) + this.getShopList(); }, methods: { - goDetail(type){ - if(type == 'shopDetail'){ + searchShop(type,value){ + if(type == 'area'){ + this.searchForm.shopArea = value + }else if(type == 'score'){ + this.searchScore = !this.searchScore + this.searchSale = false + }else if(type == 'sale'){ + this.searchSale = !this.searchSale + this.searchScore = false + }else if(type == 'all'){ + this.searchForm.sortOrder = 'shoprank' + this.searchForm.orderOrder = 'desc' + this.searchForm.shopArea = '' + this.searchScore = false + this.searchSale = false + }else if(type == 'typeUp'){ + //TODO跳转新页面 + } + this.getShopList(); + }, + getEatType(){ + let that = this + that.tui.request("/dictData/getByCondition", "GET", { + sort:'sortOrder', + order:'asc', + dictId:'1712359407444168704' + }, false, true).then((res) => { + if (res.code == 200) { + for(let i = 0;i {}) + }, + getShopArea(){ + let that = this + that.tui.request("/app/shopArea/getByParentId/"+JSON.parse(uni.getStorageSync('area')).id, "GET", {}, false, true).then((res) => { + if (res.code == 200) { + if(res.result != null){ + for(let m = 0;m {}) + }, + getShopList(){ + if(this.searchSale){ + this.searchForm.sortSale = 'saleCount' + this.searchForm.orderSale = 'desc' + this.searchForm.sortOrder = '' + }else{ + this.searchForm.sortSale = '' + } + if(this.searchScore){ + this.searchForm.sortScore = 'shopScore' + this.searchForm.orderScore = 'desc' + this.searchForm.sortOrder = '' + }else{ + this.searchForm.sortScore = '' + } + let that = this + that.tui.request("/app/shop/getByCondition", "GET", this.searchForm, false, true).then((res) => { + if (res.code == 200) { + if (that.pageNum == 1) { + that.shopList = res.result.content + } else { + that.shopList = [...that.shopList, ...res.result.content] + } + that.totalPages = res.result.totalPages + this.isArea = false + that.$forceUpdate() + } else { + that.tui.toast(res.message) + return + } + uni.hideLoading() + }).catch((res) => {}) + }, + goDetail(type,item){ + if(type == 'shop'){ + uni.navigateTo({ + url:'/package1/group/groupBuySingle?type=shop&item=' + JSON.stringify(item) + }) + }else{ uni.navigateTo({ - url:'/package1/group/groupBuySingle' + url:'/package1/group/groupBuySingle?type=product&item=' + JSON.stringify(item) }) } }, @@ -670,6 +573,7 @@ } .shop-menu-price{ margin-top: 6rpx; + font-weight: 700; } .shop-menu-purchase{ display: flex; @@ -678,6 +582,7 @@ line-height: 36rpx; padding: 0 0 0 4rpx; border-radius: 8rpx; + font-weight: 700; margin-top: 10rpx; color: #777; } diff --git a/package1/group/groupBuySingle.vue b/package1/group/groupBuySingle.vue index fcddc5e..89513a7 100644 --- a/package1/group/groupBuySingle.vue +++ b/package1/group/groupBuySingle.vue @@ -16,25 +16,25 @@ - + - 牛仔农庄(医专店) + {{shopItem.shopName}} - 4.3 + {{shopItem.shopScore}} + :value="shopItem.shopScore" /> - 炒菜 + {{shopItem.shopTypeTitle}} @@ -43,13 +43,13 @@ 店铺评价 - 月售 100+ + 销量 {{shopItem.saleCount != null ? shopItem.saleCount : 0}} - 公告:这里是第三食堂美食top1,好吃不贵,欢迎下好吃不贵,欢迎下单!欢迎下单! + 公告:{{shopItem.remark}} @@ -390,15 +390,26 @@ export default { data() { return { + type:'', + shopId:'', + shopItem:{}, + productItem:{}, + productId:'', menuButtonInfo: {}, - isPintuan:true, + isPintuan:true } }, components: { }, - onLoad() { - + onLoad(option) { + this.type = option.type + if(this.type == 'shop'){ + this.shopItem = JSON.parse(option.item) + }else{ + this.productItem = JSON.parse(option.item) + } + console.log(this.shopItem) }, onShow() { this.menuButtonInfo = uni.getMenuButtonBoundingClientRect()