diff --git a/package1/group/groupBuyDetail.vue b/package1/group/groupBuyDetail.vue index bba6a2c..ef32980 100644 --- a/package1/group/groupBuyDetail.vue +++ b/package1/group/groupBuyDetail.vue @@ -16,29 +16,28 @@ - 竹仔园牛仔农庄(第六分店) + {{shopItem.shopName}} - 北校区沁园春食堂3楼321窗口 + {{shopItem.shopAddress}} - 周一到周日 10:50-21:00 + 周一到周日 {{shopItem.shopTakeaway.businessHourBegin}}-{{shopItem.shopTakeaway.businessHourEnd}} - + - 商家承诺 + 商家资质 - - + @@ -47,7 +46,7 @@ 商家公告 - 公告:这里是第三食堂美食top1,好吃不贵,欢迎下好吃不贵,欢欢迎下单迎下单!欢迎下单! + 公告:{{shopItem.remark}} @@ -66,14 +65,17 @@ return { menuButtonInfo: {}, isPintuan:true, + shopItem:{}, + shopImages:[], bigImg:'' } }, components: { }, - onLoad() { - + onLoad(option) { + this.shopItem = JSON.parse(option.item) + this.shopImages = this.shopItem.shopImages.split('@@') }, onShow() { this.menuButtonInfo = uni.getMenuButtonBoundingClientRect() @@ -85,9 +87,9 @@ this.$refs.imgPopup.open() }, //拨打电话 - makeCall() { + makeCall(phone) { uni.makePhoneCall({ - phoneNumber: '15533910775' + phoneNumber: phone }); }, back() { diff --git a/package1/group/groupBuyList.vue b/package1/group/groupBuyList.vue index b36508d..a7f258f 100644 --- a/package1/group/groupBuyList.vue +++ b/package1/group/groupBuyList.vue @@ -78,7 +78,7 @@ - {{item.shopTypeTitle}} + {{item.shopTakeaway.type}} @@ -226,6 +226,7 @@ onLoad() { this.getEatType(); this.getShopArea(); + this.getShopList(); }, onShow() { this.menuButtonInfo = uni.getMenuButtonBoundingClientRect() @@ -233,7 +234,6 @@ title: '加载中...', mask: true }) - this.getShopList(); }, methods: { searchShop(type,value){ diff --git a/package1/group/groupBuySingle.vue b/package1/group/groupBuySingle.vue index 42b378b..c44aa11 100644 --- a/package1/group/groupBuySingle.vue +++ b/package1/group/groupBuySingle.vue @@ -80,21 +80,21 @@ - {{item.name}} + {{item.categoryName}} - + - + - 牛仔农庄(医专店) + {{item.productName}} @@ -111,23 +111,21 @@ - - - ¥90.00 - - - 拼团¥59.90 - + + + {{item.attributeListPrice | sliceMsg1}} + - - 直接购买 + 直接购买¥{{item.attributeListPrice | sliceMsg}} - - 拼团购买¥15.00 + + 拼团购买¥{{item.productGroupBuyPrices | slicePrice}} @@ -136,7 +134,7 @@ - + 1 @@ -159,7 +157,7 @@ - + @@ -197,7 +195,7 @@ - + @@ -220,7 +218,7 @@ - + @@ -396,28 +394,56 @@ shopItem:{}, productItem:{}, productId:'', + productItem:[], + buyCar:new Map(), + pageNum:1, + searchForm:{ + shopId:'', + pageNum: 1, + pageSize: '10', + categoryId:'' + }, menuButtonInfo: {}, isPintuan:true, menuList:[{ - name:'猜你喜欢', + categoryName:'猜你喜欢', + id:'', checked:true - },{ - name:'超值套餐', - checked:false - },{ - name:'清爽解腻', - checked:false - },{ - name:'随心搭配', - checked:false - },{ - name:'风味炸鸡', - checked:false }] } }, 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; + }, + sliceMsg1(val) { + var name = '正在有' + let aa = Math.floor(Math.random() * (15 - 5 + 1)) + 1; + name+=aa+'人下单' + 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(option) { this.type = option.type @@ -426,12 +452,52 @@ }else{ this.productItem = JSON.parse(option.item) } - console.log(this.shopItem) + this.getCategory(this.shopItem.id) + this.getProduct('') }, onShow() { this.menuButtonInfo = uni.getMenuButtonBoundingClientRect() }, methods: { + getProduct(categoryId){ + let that = this + this.searchForm.shopId = this.shopItem.id + this.searchForm.categoryId = categoryId + that.tui.request("/app/product/getShareList", "POST", this.searchForm, false, false).then((res) => { + if (res.code == 200) { + if (that.pageNum == 1) { + that.productItem = res.result.records + } else { + that.productItem = [...that.productItem, ...res.result.records] + } + that.$forceUpdate() + } else { + that.tui.toast(res.message) + return + } + uni.hideLoading() + }).catch((res) => {}) + }, + getCategory(id){ + let that = this + that.tui.request("/app/productCategory/list", "GET", { + shopId:id + }, false, true).then((res) => { + if (res.code == 200) { + if(res.result.length >0){ + for(let i = 0;i {}) + }, checkTab(index){ for(let i=0;i + - 商家回复 {{ replyText }} + {{item1.createByName}} : {{ item1.remark }} 展开 @@ -113,17 +90,29 @@ menuButtonInfo: {}, isPintuan: true, bigImg: '', + shopItem:{}, + pageNum:1, + searchAll:true, + total:0, + shopComments:[], + searchForm:{ + shopId:'', + pageNum: 1, + score:0, + picture:0, + pageSize: '10' + }, menuList: [{ name: '全部', - num: 31, + num: 0, checked: true }, { name: '有图/视频', - num: 21, + num: '', checked: false }, { name: '中差评', - num: 10, + num: '', checked: false }] } @@ -131,13 +120,36 @@ components: { }, - onLoad() { - + onLoad(option) { + this.shopItem = JSON.parse(option.item) + this.getshopComments(this.shopItem.id) }, onShow() { this.menuButtonInfo = uni.getMenuButtonBoundingClientRect() + }, methods: { + getshopComments(id){ + let that = this + this.searchForm.shopId = id + that.tui.request("/app/comment/getCommentList", "POST", this.searchForm, false, false).then((res) => { + if (res.code == 200) { + if (that.pageNum == 1) { + that.shopComments = res.result.records + } else { + that.shopComments = [...that.shopComments, ...res.result.records] + } + that.$forceUpdate() + if(this.searchAll){ + that.menuList[0].num = res.result.total + } + } else { + that.tui.toast(res.message) + return + } + uni.hideLoading() + }).catch((res) => {}) + }, toggleReply() { this.isExpanded = !this.isExpanded; }, @@ -149,6 +161,19 @@ this.menuList[i].checked = false } } + if(index == 0){ + this.searchForm.picture = 0 + this.searchForm.score = 0 + }else if(index ==1){ + this.searchAll = false + this.searchForm.picture = 1 + this.searchForm.score = 0 + }else{ + this.searchAll = false + this.searchForm.picture = 0 + this.searchForm.score = 1 + } + this.getshopComments(this.shopItem.id) }, //查看大图 largeImg(img) {