Commit 879a0a9d by wjw

ww--畅玩修复

parent c2acc8b4

660 Bytes | W: | H:

660 Bytes | W: | H:

image/icon/evaluate-2.png.png
image/icon/evaluate-2.png
image/icon/evaluate-2.png.png
image/icon/evaluate-2.png
  • 2-up
  • Swipe
  • Onion skin

503 Bytes | W: | H:

503 Bytes | W: | H:

image/icon/shop-2.png.png
image/icon/shop-2.png
image/icon/shop-2.png.png
image/icon/shop-2.png
  • 2-up
  • Swipe
  • Onion skin
<!-- 畅玩 - 活动列表 --> <!-- 畅玩 - 活动列表 -->
<navigation class="navigation" titleText="{{shopInfo.name + navigationTitle}}" background="#ffffff" backIcon="/image/back.png"></navigation> <navigation class="navigation" titleText="{{navigationTitle}}" background="#ffffff" backIcon="/image/back.png"></navigation>
<view class="container con-s"> <view class="container con-s">
<!-- 活动类别 --> <!-- 活动类别 -->
......
...@@ -48,7 +48,7 @@ Page({ ...@@ -48,7 +48,7 @@ Page({
// 内容类型 // 内容类型
contentType: 'evaluate', contentType: 'detail',
// banner 列表数据 // banner 列表数据
banner: [], banner: [],
...@@ -72,6 +72,14 @@ Page({ ...@@ -72,6 +72,14 @@ Page({
commodityTitle: '', commodityTitle: '',
officeService: 0,
officeServiceText: '5.0', // 门店服务评分
officeProduct: 0,
officeProductText: '5.0', // 门店产品评分
officeEnvironmental: 0,
officeEnvironmentalText: '5.0', // 门店环境评分
winActivity: false, // 近期活动 winActivity: false, // 近期活动
winCommodity: false, // 商品列表 winCommodity: false, // 商品列表
winCommodityMenu: false, winCommodityMenu: false,
...@@ -140,7 +148,7 @@ Page({ ...@@ -140,7 +148,7 @@ Page({
default: default:
this.queryCommodity() this.queryCommodity()
} }
this.getOfficeAppraise()
this.getAppraise() this.getAppraise()
}, },
...@@ -390,8 +398,44 @@ Page({ ...@@ -390,8 +398,44 @@ Page({
'officeId': this.data.shopInfo.id, 'officeId': this.data.shopInfo.id,
}, },
success: (response) => { success: (response) => {
let funcResponse = response.data.list
console.log(funcResponse)
let funcList = []
for (let i = 0, l = funcResponse.length; i < l; i++) {
let funcItem = {
'cover': funcResponse[i].cover,
'id': funcResponse[i].id,
'title': funcResponse[i].name,
'officeId': funcResponse[i].officeId,
'price': funcResponse[i].visitorPrice, // 普通价
'priceText': App.modular.utils.formatAmount(funcResponse[i].visitorPrice), // 普通价文本格式
'priceSpecial': funcResponse[i].ownerPrice, // 业主价
'priceSpecialText': App.modular.utils.formatAmount(funcResponse[i].ownerPrice), // 业主价文本格式
'tagIds': funcResponse[i].tagIds,
'tagNames': funcResponse[i].tagNames,
'date': funcResponse[i].activeDate + ' ' + funcResponse[i].activeTime, // 活动时间
'priceType': 1,
}
let funcUserType = wx.getStorageSync('userInfo').userType
// 根据后台判断价格显示类型
// 活动价优先级最高,如果存在活动价,则只显示活动价和普通价
if (funcItem.priceDiscount) {
funcItem.priceType = 1
} else {
// 活动价不存在,进一步判断普通价与业主价是否一致,如果不一致,则显示两者
if (funcItem.price !== funcItem.priceSpecial && funcUserType) {
funcItem.priceType = 2
} else {
funcItem.priceType = 3
}
}
console.log(funcItem)
funcList.push(funcItem)
}
this.setData({ this.setData({
winActivity: true winActivity: true,
detailActivity: funcList
}) })
} }
}) })
...@@ -611,7 +655,51 @@ Page({ ...@@ -611,7 +655,51 @@ Page({
url: '/pages/home/guide/guide?id=' + Number(this.data.option.id) url: '/pages/home/guide/guide?id=' + Number(this.data.option.id)
}) })
}, },
// 缓存商店信息
setShopInfo: function (funcShopAppId, funcShopType) {
// 获取门店基本信息
let funcShopId = App.globalData.shopId
for (let i = 0, l = funcShopId.length; i < l; i++) {
if (funcShopAppId === funcShopId[i].appId) {
let funcShopInfo = {
'id': funcShopId[i].id,
'appId': funcShopId[i].appId,
'name': funcShopId[i].title[funcShopType],
'logo': funcShopId[i].logo,
'cover': funcShopId[i].cover,
'shopType': funcShopType,
'commodityLogo': funcShopId[i].commodityLogo
}
wx.setStorageSync('shopInfoBuffer', funcShopInfo)
break
}
}
},
// 跳转到活动详情
onActivityDetail: function (event) {
let id = event.currentTarget.dataset.id
wx.navigateTo({
url: '/pages/play/activity-detail/activity-detail?id=' + id,
})
},
onBuyCommodity: function (event) {
let id = event.currentTarget.dataset.id
let classifyId = event.currentTarget.dataset.classid
wx.navigateTo({
url: '/pages/commodity/menu-food/menu-food?commodityId=' + id + '&sideBarId=' + classifyId
})
},
// 跳转到能量补给站
onBuySnacks(event) {
// funcShopType 使用函数区分商品类型,所以每个函数里的数值是固定的
let funcShopType = 5
let funcShopAppId = event.currentTarget.dataset.id
this.setShopInfo(funcShopAppId, funcShopType)
wx.navigateTo({
url: '/pages/commodity/menu-food/menu-food',
})
},
/** /**
* 简介,评价切换 * 简介,评价切换
* @function * @function
...@@ -636,8 +724,8 @@ Page({ ...@@ -636,8 +724,8 @@ Page({
}, },
onContact: function () { onContact: function () {
wx.makePhoneCall({ wx.navigateTo({
phoneNumber: this.data.info.contact url: '/pages/commodity/project-detail/project-detail'
}) })
}, },
...@@ -772,6 +860,25 @@ Page({ ...@@ -772,6 +860,25 @@ Page({
url: '/pages/play/movie/movie', url: '/pages/play/movie/movie',
}) })
}, },
// 查询门店评分
getOfficeAppraise: function () {
let that = this
let officeId = wx.getStorageSync('shopInfoBuffer').id
App.wxRequest({
url: '/api/v1/appraise/getOfficeAppraise',
data: {
'officeId': officeId
},
success: function (response) {
let funcData = response.data
that.setData({
officeServiceText: funcData.serviceEvaluation.toFixed(1),
officeProductText: funcData.productEvaluatio.toFixed(1),
officeEnvironmentalText: funcData.environmentalEvaluation.toFixed(1),
})
}
})
},
/** /**
* 评论查看全部 * 评论查看全部
......
...@@ -53,21 +53,36 @@ ...@@ -53,21 +53,36 @@
</view> </view>
<view class="commodity-card-list row"> <view class="commodity-card-list row">
<block wx:for="{{detailActivity}}" wx:for-index="index" wx:for-item="item" wx:key="index"> <block wx:for="{{detailActivity}}" wx:for-index="index" wx:for-item="item" wx:key="index">
<view class="commodity-card-item col"> <view class="commodity-card-item col" bindtap="onActivityDetail" data-id="{{item.id}}">
<image src="{{item.cover}}"></image> <image src="{{item.cover}}"></image>
<view class="commodity-card-item-title row con-b align-c"> <view class="commodity-card-item-title row con-b align-c">
<text>{{item.title}}</text> <text>{{item.title}}</text>
<text>{{item.tab}}</text> <text>{{item.tagNames[0]}}</text>
</view> </view>
<view class="commodity-card-item-date row align-c"> <view class="commodity-card-item-date row align-c">
<image src="{{imageBase + 'icon/clock-2.png'}}"></image> <image src="{{imageBase + 'icon/clock-2.png'}}"></image>
<text>{{item.time}}</text> <text>{{item.date}}</text>
</view> </view>
<view class="commodity-card-item-operation row con-b align-c"> <view class="commodity-card-item-operation row con-b align-c">
<view class="row align-c"> <!-- 活动价样式 -->
<text>业主价</text> <view class="row align-c" wx:if="{{item.priceType === 1}}">
<text>免费</text> <text class="detail-price-discount">活动价</text>
<text>{{item.price}}</text> <text class="price-symbol">¥</text>
<text>{{item.priceDiscountText == '0' ? '免费' : item.priceDiscountText}}</text>
<text>{{'¥' + item.priceText}}</text>
</view>
<!-- 业主价样式 -->
<view class="row align-c" wx:if="{{item.priceType === 2}}">
<text class="detail-price-special">业主价</text>
<text class="price-symbol">¥</text>
<text>{{item.priceSpecialText == '0' ? '免费' : item.priceSpecialText}}</text>
<text>{{'¥' + item.priceText}}</text>
</view>
<!-- 普通价样式 -->
<view class="row align-c" wx:if="{{item.priceType === 3}}">
<text class="">业主价</text>
<text class="price-symbol">¥</text>
<text>{{item.priceText == '0' ? '免费' : item.priceText}}</text>
</view> </view>
<view> <view>
<button class="row con-c align-c">报名</button> <button class="row con-c align-c">报名</button>
...@@ -102,13 +117,11 @@ ...@@ -102,13 +117,11 @@
<text>{{item.describe}}</text> <text>{{item.describe}}</text>
</view> </view>
<view class="commodity-card-item-operation row con-b align-c"> <view class="commodity-card-item-operation row con-b align-c">
<!-- 活动价样式 --> <!-- 活动价样式 -->
<view class="row align-c" wx:if="{{item.priceType === 1}}"> <view class="row align-c" wx:if="{{item.priceType === 1}}">
<text class="detail-price-discount">活动价</text> <text class="detail-price-discount">活动价</text>
<text class="price-symbol">¥</text> <text class="price-symbol">¥</text>
<text>{{item.priceDiscountText == '0' ? '免费' : item.priceDiscountText}}</text> <text>{{item.priceDiscountText == '0' ? '免费' : item.priceDiscountText}}</text>
<text class="price-unit">/人</text>
<text>{{'¥' + item.priceText}}</text> <text>{{'¥' + item.priceText}}</text>
</view> </view>
...@@ -117,20 +130,16 @@ ...@@ -117,20 +130,16 @@
<text class="detail-price-special">业主价</text> <text class="detail-price-special">业主价</text>
<text class="price-symbol">¥</text> <text class="price-symbol">¥</text>
<text>{{item.priceSpecialText == '0' ? '免费' : item.priceSpecialText}}</text> <text>{{item.priceSpecialText == '0' ? '免费' : item.priceSpecialText}}</text>
<text class="price-unit">/人</text>
<text>{{'¥' + item.priceText}}</text> <text>{{'¥' + item.priceText}}</text>
</view> </view>
<!-- 普通价样式 --> <!-- 普通价样式 -->
<view class="row align-c" wx:if="{{item.priceType === 3}}"> <view class="row align-c" wx:if="{{item.priceType === 3}}">
<text class="">业主价</text> <text class="">业主价</text>
<text class="price-symbol">¥</text> <text class="price-symbol">¥</text>
<text>{{item.priceText == '0' ? '免费' : item.priceText}}</text> <text>{{item.priceText == '0' ? '免费' : item.priceText}}</text>
<text class="price-unit">/人</text>
<text></text>
</view> </view>
<view> <view>
<button class="row con-c align-c" data-item="{{item}}" bindtap="onBuy">购买</button> <button class="row con-c align-c" data-id="{{item.id}}" data-classid="{{item.classifyId}}" bindtap="onBuyCommodity">购买</button>
</view> </view>
</view> </view>
</view> </view>
...@@ -139,8 +148,18 @@ ...@@ -139,8 +148,18 @@
</view> </view>
</view> </view>
<view class="commodity-menu" wx:if="{{winCommodityMenu}}"> <view class="commodity-menu col" wx:if="{{winCommodityMenu}}" bindtap="onBuySnacks" data-id="{{5}}">
<view></view> <image class="commodity-menu-bg" src="{{resourcesBase + 'play/service/service-flower.png'}}"></image>
<view>
<image class="commodity-menu-icon"></image>
</view>
<view>
<text>能量补给站</text>
</view>
<view class="row align-c">
<text>饮品预订</text>
<image src="{{imageBase + 'more-w.png'}}"></image>
</view>
</view> </view>
<!-- 简介,评价 --> <!-- 简介,评价 -->
......
...@@ -357,19 +357,55 @@ ...@@ -357,19 +357,55 @@
/* 能量补给跳转 */ /* 能量补给跳转 */
.commodity-menu { .commodity-menu {
position: relative;
width: 750rpx; width: 750rpx;
height: 256rpx; height: 256rpx;
margin-top: 80rpx;
padding: 0 40rpx; padding: 0 40rpx;
border-radius: 4px; border-radius: 4px;
overflow: hidden; overflow: hidden;
} }
.commodity-menu > view { .commodity-menu-bg {
position: absolute;
z-index: -1;
width: 670rpx; width: 670rpx;
height: 256rpx; height: 256rpx;
background: #999999; background: #999999;
} }
.commodity-menu-icon {
}
.commodity-menu-icon {
margin: 56rpx 0 0 54rpx;
width: 52rpx;
height: 37rpx;
background: #15191F;
}
.commodity-menu view:nth-child(3) {
margin: 26rpx 0 0 50rpx;
font-size: 30rpx;
color: #FFFFFF;
line-height: 42rpx;
}
.commodity-menu view:nth-child(4) {
margin: 8rpx 0 0 50rpx;
font-size: 26rpx;
color: #FFFFFF;
line-height: 40rpx;
}
.commodity-menu view:nth-child(4) image {
margin-left: 16rpx;
width: 32rpx;
height: 32rpx;
}
.movie-card-item-info { .movie-card-item-info {
height: 33rpx; height: 33rpx;
margin-top: 10rpx; margin-top: 10rpx;
...@@ -567,6 +603,7 @@ ...@@ -567,6 +603,7 @@
/* 详情 */ /* 详情 */
.detail { .detail {
margin-top: 62rpx;
padding-bottom: 160rpx; padding-bottom: 160rpx;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment