Commit 10e6e35db42ed5d99daf0911f56f6f1e92e39174

Authored by vking
1 parent 6bd67311

taocan

@@ -8,14 +8,8 @@ Page({ @@ -8,14 +8,8 @@ Page({
8 */ 8 */
9 data: { 9 data: {
10 current:0, 10 current:0,
11 - activityId:1,  
12 - packs:[  
13 - {id:1,},  
14 - {id:2,},  
15 - {id:3,},  
16 - {id:4,},  
17 - {id:5,},  
18 - ], 11 + activityId:'',
  12 + packs:{},
19 }, 13 },
20 14
21 /** 15 /**
@@ -24,6 +18,18 @@ Page({ @@ -24,6 +18,18 @@ Page({
24 * pid 套餐id 18 * pid 套餐id
25 */ 19 */
26 onLoad: function (options) { 20 onLoad: function (options) {
  21 + App.Foodset.GetFoodsetList({sid:options.sid}).then(res=>{
  22 + let packs={}
  23 + res.data.some(r=>{
  24 + r['包间可用']=r.service.indexOf('包间可用');
  25 + r.sid=this.data.sid
  26 + packs[r.id]=r
  27 + })
  28 + this.setData({
  29 + packs:packs,
  30 + activityId:options.pid,
  31 + })
  32 + })
27 33
28 }, 34 },
29 35
@@ -10,40 +10,40 @@ @@ -10,40 +10,40 @@
10 <swiper-item 10 <swiper-item
11 bindtap="touchTab" data-id="{{item.id}}" data-index="{{index}}" 11 bindtap="touchTab" data-id="{{item.id}}" data-index="{{index}}"
12 class="swiper-item {{activityId==item.id?'active':''}} flex align-center"> 12 class="swiper-item {{activityId==item.id?'active':''}} flex align-center">
13 - <view class="txt-28-h">招牌六十人餐</view> 13 + <view class="txt-28-h">{{item.name}}</view>
14 </swiper-item> 14 </swiper-item>
15 </block> 15 </block>
16 </swiper> 16 </swiper>
17 <view class="view" style="padding-bottom: 150rpx;padding-top: 80rpx;"> 17 <view class="view" style="padding-bottom: 150rpx;padding-top: 80rpx;">
18 <view class="view box margin-lr margin-top-lg margin-bottom-sm padding"> 18 <view class="view box margin-lr margin-top-lg margin-bottom-sm padding">
19 - <view class="view txt-40-h text-bold">招牌花开富贵六十人餐</view> 19 + <view class="view txt-40-h text-bold">{{packs[activityId].name}}</view>
20 <view class="view flex align-end"> 20 <view class="view flex align-end">
21 <view class="text-orange txt-28-h" style="margin-bottom: 4rpx;">¥</view> 21 <view class="text-orange txt-28-h" style="margin-bottom: 4rpx;">¥</view>
22 - <view class="text-orange txt-44-h margin-right-sm text-bold">123</view> 22 + <view class="text-orange txt-44-h margin-right-sm text-bold">{{packs[activityId].sale_price}}</view>
23 <view class="huaxian flex align-end"> 23 <view class="huaxian flex align-end">
24 <view class="txt-20-h" style="margin-bottom: 8rpx;">¥</view> 24 <view class="txt-20-h" style="margin-bottom: 8rpx;">¥</view>
25 - <view class="txt-28-h" style="margin-bottom: 4rpx;">123</view> 25 + <view class="txt-28-h" style="margin-bottom: 4rpx;">{{packs[activityId].market_price}}</view>
26 </view> 26 </view>
27 <view class="view flex text-orange align-end margin-left-sm" > 27 <view class="view flex text-orange align-end margin-left-sm" >
28 <view class="view tag" style="margin-bottom: 16rpx;"></view> 28 <view class="view tag" style="margin-bottom: 16rpx;"></view>
29 - <view class="view margin-left-xs txt-24-h" style="margin-bottom: 10rpx;">8折</view> 29 + <view class="view margin-left-xs txt-24-h" style="margin-bottom: 10rpx;">{{packs[activityId].discount*10}}折</view>
30 </view> 30 </view>
31 </view> 31 </view>
32 <view class="view flex align-center txt-28-h margin-bottom labels" style="margin-top: 10rpx;"> 32 <view class="view flex align-center txt-28-h margin-bottom labels" style="margin-top: 10rpx;">
33 - <view class="view margin-right flex align-center"> 33 + <view class="view margin-right flex align-center" wx:if="{{packs[activityId]['包间可用']}}">
34 <view class="view icon icon1"></view> 34 <view class="view icon icon1"></view>
35 <view class="view txt-28-h bg-white">包间可用</view> 35 <view class="view txt-28-h bg-white">包间可用</view>
36 </view> 36 </view>
37 - <view class="view margin-right flex align-center"> 37 + <view class="view margin-right flex align-center" wx:if="{{packs[activityId]['免预约']}}">
38 <view class="view icon icon2"></view> 38 <view class="view icon icon2"></view>
39 <view class="view txt-28-h bg-white">免预约</view> 39 <view class="view txt-28-h bg-white">免预约</view>
40 </view> 40 </view>
41 - <view class="view margin-right flex align-center"> 41 + <view class="view margin-right flex align-center" wx:if="{{packs[activityId]['随时退']}}">
42 <view class="view icon icon3"></view> 42 <view class="view icon icon3"></view>
43 <view class="view txt-28-h bg-white">随时退</view> 43 <view class="view txt-28-h bg-white">随时退</view>
44 </view> 44 </view>
45 </view> 45 </view>
46 - <image src="" style="width:100%;background-color: #cccccc;border-radius: 10rpx;" mode="widthFix"></image> 46 + <image src="{{packs[activityId].main_url}}" style="width:100%;background-color: #cccccc;border-radius: 10rpx;" mode="widthFix"></image>
47 </view> 47 </view>
48 <view class="view box margin-lr margin-top-sm margin-bottom-sm"> 48 <view class="view box margin-lr margin-top-sm margin-bottom-sm">
49 <view class="txt-30-h padding solid-bottom">购买须知</view> 49 <view class="txt-30-h padding solid-bottom">购买须知</view>
@@ -497,7 +497,12 @@ export default { @@ -497,7 +497,12 @@ export default {
497 silence: false, 497 silence: false,
498 }, 498 },
499 //获取商家菜品套餐列列表 499 //获取商家菜品套餐列列表
500 - 'App.Foodset.GetFoodsetList':null, 500 + 'App.Foodset.GetFoodsetList':{
  501 + cachetime: 120,
  502 + },
  503 + //获取商家菜品套餐详情
  504 + 'App.Foodset.GetFoodsetDetail':null,
  505 +
501 506
502 //获取商家优惠对接人信息 507 //获取商家优惠对接人信息
503 'App.Customer.GetSellerPreferentialDocking':null, 508 'App.Customer.GetSellerPreferentialDocking':null,