wangfukang 1 week ago
parent
commit
7912f8ffe1
  1. 83
      package2/group/groupBuyDetail.vue
  2. 3
      package2/group/groupBuySingle.vue

83
package2/group/groupBuyDetail.vue

@ -16,15 +16,15 @@
<view class="left"> <view class="left">
<view style="display: flex;"> <view style="display: flex;">
<img src="https://jewel-shop.oss-cn-beijing.aliyuncs.com/3721d2aa18ac4700aa7ac4dfeb272b09.png" alt="" style="width: 48rpx;height: 48rpx;"/> <img src="https://jewel-shop.oss-cn-beijing.aliyuncs.com/3721d2aa18ac4700aa7ac4dfeb272b09.png" alt="" style="width: 48rpx;height: 48rpx;"/>
<text style="height: 48rpx;line-height: 48rpx;font-size: 28rpx;font-weight: 700;margin-left: 10rpx;">{{shopItem.shopName}}</text> <text style="height: 48rpx;line-height: 48rpx;font-size: 28rpx;font-weight: 700;margin-left: 10rpx;">{{shopItem.shopName || ''}}</text>
</view> </view>
<view style="line-height: 60rpx;height: 60rpx;color: #777;"> <view style="line-height: 60rpx;height: 60rpx;color: #777;">
<uni-icons type="location" size="13"></uni-icons> <uni-icons type="location" size="13"></uni-icons>
<text style="padding-left: 10rpx;">{{shopItem.shopAddress}}</text> <text style="padding-left: 10rpx;">{{shopItem.shopAddress || '暂无地址'}}</text>
</view> </view>
<view style="line-height: 60rpx;height: 60rpx;color: #777;"> <view style="line-height: 60rpx;height: 60rpx;color: #777;">
<uni-icons type="loop" size="13"></uni-icons> <uni-icons type="loop" size="13"></uni-icons>
<text style="padding-left: 10rpx;">周一到周日 {{shopItem.shopTakeaway.businessHourBegin}}-{{shopItem.shopTakeaway.businessHourEnd}}</text> <text style="padding-left: 10rpx;">{{businessTimeText}}</text>
</view> </view>
</view> </view>
<view class="right"> <view class="right">
@ -40,6 +40,7 @@
</view> </view>
<view style="display: flex;margin-top: 20rpx;"> <view style="display: flex;margin-top: 20rpx;">
<img @tap="largeImg(item)" :src="item" v-for="(item,index) in shopImages" :key="index" alt="" style="width: 156rpx;height: 48rpx;margin-right: 40rpx;" /> <img @tap="largeImg(item)" :src="item" v-for="(item,index) in shopImages" :key="index" alt="" style="width: 156rpx;height: 48rpx;margin-right: 40rpx;" />
<text v-if="shopImages.length == 0" style="color: #777;">暂无资质图片</text>
</view> </view>
</view> </view>
<view class="box1"> <view class="box1">
@ -48,16 +49,10 @@
<text style="height: 48rpx;line-height: 48rpx;font-size: 28rpx;font-weight: 700;margin-left: 10rpx;">商家公告</text> <text style="height: 48rpx;line-height: 48rpx;font-size: 28rpx;font-weight: 700;margin-left: 10rpx;">商家公告</text>
</view> </view>
<view style="color: #777;line-height: 48rpx;margin-top: 20rpx;"> <view style="color: #777;line-height: 48rpx;margin-top: 20rpx;">
公告{{shopItem.remark}} 公告{{shopItem.remark || '暂无公告'}}
</view> </view>
</view> </view>
</view> </view>
<!-- 查看大图弹出层 -->
<uni-popup ref="imgPopup" background-color="#fff">
<view class="img-popup-content">
<img :src="bigImg" alt="" style="width: 100%;height: 100%;">
</view>
</uni-popup>
</view> </view>
</template> </template>
@ -68,25 +63,77 @@
menuButtonInfo: {}, menuButtonInfo: {},
isPintuan:true, isPintuan:true,
shopItem:{}, shopItem:{},
shopImages:[], shopImages:[]
bigImg:'' }
},
computed: {
businessTimeText() {
const takeaway = this.shopItem.shopTakeaway || {};
if (!takeaway.businessHourBegin || !takeaway.businessHourEnd) return '营业时间暂无';
return '周一到周日 ' + takeaway.businessHourBegin + '-' + takeaway.businessHourEnd;
} }
}, },
components: { components: {
}, },
onLoad(option) { onLoad(option) {
this.shopItem = JSON.parse(option.item) this.initShopItem(option)
this.shopImages = this.shopItem.shopImages.split('@@')
}, },
onShow() { onShow() {
this.menuButtonInfo = uni.getMenuButtonBoundingClientRect() this.menuButtonInfo = uni.getMenuButtonBoundingClientRect()
}, },
methods: { methods: {
initShopItem(option) {
const cacheItem = uni.getStorageSync('groupShopDetail');
if (cacheItem) {
this.shopItem = cacheItem;
} else if (option.item) {
this.shopItem = this.parseRouteItem(option.item) || {};
}
this.setShopImages();
if (option.id || this.shopItem.id) {
this.getShopDetail(option.id || this.shopItem.id);
}
},
parseRouteItem(item) {
if (item == null || item === '') return null;
try {
return JSON.parse(decodeURIComponent(item));
} catch (e) {
try {
return JSON.parse(item);
} catch (err) {
return null;
}
}
},
setShopImages() {
if (!this.shopItem.shopImages) {
this.shopImages = [];
return;
}
this.shopImages = this.shopItem.shopImages.split('@@').filter(item => item && item !== 'undefined' && item !== 'null');
},
getShopDetail(id) {
this.tui.request("/app/shop/getShopInfoById", "POST", {
id: id,
regionId: JSON.parse(uni.getStorageSync('area')).id
}, false, false).then((res) => {
if (res.code == 200 && res.result) {
this.shopItem = res.result;
uni.setStorageSync('groupShopDetail', res.result);
this.setShopImages();
}
uni.hideLoading();
}).catch(() => {});
},
// //
largeImg(img) { largeImg(img) {
this.bigImg = img if (!img) return;
this.$refs.imgPopup.open() uni.previewImage({
current: img,
urls: this.shopImages
})
}, },
// //
makeCall(phone) { makeCall(phone) {
@ -164,8 +211,4 @@
width: 20%; width: 20%;
height: 160rpx; height: 160rpx;
} }
.img-popup-content {
width: 500rpx;
height: 500rpx;
}
</style> </style>

3
package2/group/groupBuySingle.vue

@ -1682,8 +1682,9 @@
}, },
goDetail(type) { goDetail(type) {
if (type == 'shopDetail') { if (type == 'shopDetail') {
uni.setStorageSync('groupShopDetail', this.shopItem)
uni.navigateTo({ uni.navigateTo({
url: '/package2/group/groupBuyDetail?item=' + JSON.stringify(this.shopItem) url: '/package2/group/groupBuyDetail?id=' + this.shopItem.id
}) })
} else if (type == 'shopEvaluate') { } else if (type == 'shopEvaluate') {
uni.navigateTo({ uni.navigateTo({

Loading…
Cancel
Save