Commit 4bcdf52ffa86ab8e0976bfd544832c190ef6d3cc

Authored by vking
1 parent c5ba3518

taocan

@@ -38,7 +38,8 @@ @@ -38,7 +38,8 @@
38 "pages/reserve/remark", 38 "pages/reserve/remark",
39 "pages/reserve/findSeller", 39 "pages/reserve/findSeller",
40 "pages/customer/cancel", 40 "pages/customer/cancel",
41 - "pages/customer/welcome" 41 + "pages/customer/welcome",
  42 + "pages/taocan/index"
42 ], 43 ],
43 "subpackages": [ 44 "subpackages": [
44 { 45 {
@@ -4,7 +4,7 @@ Component({ @@ -4,7 +4,7 @@ Component({
4 * 组件的属性列表 4 * 组件的属性列表
5 */ 5 */
6 properties: { 6 properties: {
7 - 7 + detail:Object,//套餐
8 }, 8 },
9 9
10 /** 10 /**
@@ -10,7 +10,7 @@ @@ -10,7 +10,7 @@
10 </view> 10 </view>
11 <view class="view flex align-end text-gray"> 11 <view class="view flex align-end text-gray">
12 <view class="text-orange txt-28-h" style="margin-bottom: 4rpx;">¥</view> 12 <view class="text-orange txt-28-h" style="margin-bottom: 4rpx;">¥</view>
13 - <view class="text-orange txt-40-h margin-right-sm">123</view> 13 + <view class="text-orange txt-40-h margin-right-sm text-bold">123</view>
14 <view class="huaxian flex align-end"> 14 <view class="huaxian flex align-end">
15 <view class="txt-20-h" style="margin-bottom: 8rpx;">¥</view> 15 <view class="txt-20-h" style="margin-bottom: 8rpx;">¥</view>
16 <view class="txt-28-h" style="margin-bottom: 4rpx;">123</view> 16 <view class="txt-28-h" style="margin-bottom: 4rpx;">123</view>
@@ -21,5 +21,7 @@ @@ -21,5 +21,7 @@
21 <view class="view margin-left-xs txt-24-h">8折</view> 21 <view class="view margin-left-xs txt-24-h">8折</view>
22 </view> 22 </view>
23 </view> 23 </view>
24 - <view class="button bg-blue-blue txt-28-h text-bold flex align-center justify-center">抢购</view> 24 + <navigator url="/pages/taocan/index?sid={{detail.sid}}&pid={{detail.id}}" hover-class="navigator-hover">
  25 + <view class="button bg-blue-blue txt-28-h text-bold flex align-center justify-center">抢购</view>
  26 + </navigator>
25 </view> 27 </view>
  1 +// pages/taocan/index.js
  2 +import util from '../../utils/util';
  3 +import App from '../../utils/api';
  4 +Page({
  5 +
  6 + /**
  7 + * 页面的初始数据
  8 + */
  9 + data: {
  10 + current:0,
  11 + activityId:1,
  12 + packs:[
  13 + {id:1,},
  14 + {id:2,},
  15 + {id:3,},
  16 + {id:4,},
  17 + {id:5,},
  18 + ],
  19 + },
  20 +
  21 + /**
  22 + * 生命周期函数--监听页面加载
  23 + * sid 商家id
  24 + * pid 套餐id
  25 + */
  26 + onLoad: function (options) {
  27 +
  28 + },
  29 +
  30 + /**
  31 + * 生命周期函数--监听页面初次渲染完成
  32 + */
  33 + onReady: function () {
  34 +
  35 + },
  36 +
  37 + /**
  38 + * 生命周期函数--监听页面显示
  39 + */
  40 + onShow: function () {
  41 +
  42 + },
  43 +
  44 + /**
  45 + * 生命周期函数--监听页面隐藏
  46 + */
  47 + onHide: function () {
  48 +
  49 + },
  50 +
  51 + /**
  52 + * 生命周期函数--监听页面卸载
  53 + */
  54 + onUnload: function () {
  55 +
  56 + },
  57 +
  58 + /**
  59 + * 页面相关事件处理函数--监听用户下拉动作
  60 + */
  61 + onPullDownRefresh: function () {
  62 +
  63 + },
  64 +
  65 + /**
  66 + * 页面上拉触底事件的处理函数
  67 + */
  68 + onReachBottom: function () {
  69 +
  70 + },
  71 +
  72 + /**
  73 + * 用户点击右上角分享
  74 + */
  75 + onShareAppMessage: function () {
  76 +
  77 + },
  78 + touchTab(e){
  79 + let obj={
  80 + activityId:util.attr(e,'id'),
  81 + }
  82 + let index=util.attr(e,'index')
  83 + let length=this.data.packs.length;
  84 + let current=0
  85 + if(index>length-3){
  86 + current=length-3;
  87 + }else{
  88 + current=index>0?(index-1):0
  89 + }
  90 + obj.current=current
  91 + this.setData(obj)
  92 + },
  93 + swiperChange(e){
  94 + console.log(e)
  95 + if(e.detail.source!='touch') return;
  96 + this.setData({
  97 + current:e.detail.current
  98 + })
  99 + },
  100 +})
  1 +{
  2 + "usingComponents": {
  3 + "nav":"/components/nav/nav"
  4 + }
  5 +}
  1 +<!--pages/taocan/index.wxml-->
  2 +<nav hasHome>套餐详情</nav>
  3 +<view class="view">
  4 + <swiper
  5 + display-multiple-items="3"
  6 + class="view margin-left-lg"
  7 + bindchange="swiperChange"
  8 + current="{{current}}"
  9 + style="height: 80rpx;">
  10 + <block wx:for="{{packs}}" wx:key="*this">
  11 + <swiper-item
  12 + bindtap="touchTab" data-id="{{item.id}}" data-index="{{index}}"
  13 + class="swiper-item {{activityId==item.id?'active':''}} flex align-center">
  14 + <view class="txt-28-h">招牌六十人餐</view>
  15 + </swiper-item>
  16 + </block>
  17 + </swiper>
  18 + <view class="view box margin-lr margin-top-lg margin-bottom-sm padding">
  19 + <view class="view txt-40-h text-bold">招牌花开富贵六十人餐</view>
  20 + <view class="view flex align-end">
  21 + <view class="text-orange txt-28-h" style="margin-bottom: 4rpx;">¥</view>
  22 + <view class="text-orange txt-40-h margin-right-sm text-bold">123</view>
  23 + <view class="huaxian flex align-end">
  24 + <view class="txt-20-h" style="margin-bottom: 8rpx;">¥</view>
  25 + <view class="txt-28-h" style="margin-bottom: 4rpx;">123</view>
  26 + </view>
  27 + <view class="view flex text-orange align-end margin-left-sm" >
  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>
  30 + </view>
  31 + </view>
  32 + <view class="view flex align-center txt-28-h margin-bottom" style="margin-top: 10rpx;">
  33 + <view class="view margin-right">
  34 + <view class="icon"></view>
  35 + <view>1111</view>
  36 + </view>
  37 + <view class="view margin-right">
  38 + <view class="icon"></view>
  39 + <view>1111</view>
  40 + </view>
  41 + <view class="view margin-right">
  42 + <view class="icon"></view>
  43 + <view>1111</view>
  44 + </view>
  45 + </view>
  46 + <image src="" style="width:100%;" mode="widthFix"></image>
  47 + </view>
  48 +</view>
  1 +/* pages/taocan/index.wxss */
  2 +@import "../../colorui/main.wxss";
  3 +.swiper-item{
  4 + position: relative;
  5 +}
  6 +.swiper-item.active:after{
  7 + position: absolute;
  8 + bottom: 4rpx;
  9 + width: 60rpx;
  10 + height: 6rpx;
  11 + background: linear-gradient(90deg, #3BBFF5 0%, #57A0FF 100%);
  12 + border-radius: 3rpx;
  13 + content: "";
  14 + left:calc(50% - 60rpx);
  15 +}
  16 +.swiper-item.active .txt-28-h{
  17 + font-weight: bold;
  18 +}
  19 +.box{
  20 + background: #FFFFFF;
  21 + box-shadow: 0px 0px 30rpx 0px #E5E5E5;
  22 + border-radius: 20rpx;
  23 +}
  24 +.huaxian{
  25 + position: relative;
  26 +}
  27 +.huaxian:after{
  28 + position: absolute;
  29 + content: "";
  30 + width: 100%;
  31 + height: 2rpx;
  32 + background-color: #CCCCCC;
  33 + left:0rpx;
  34 + top:20rpx;
  35 +}
  36 +.tag{
  37 + width: 22rpx;
  38 + height: 22rpx;
  39 + background: #FF7A00;
  40 +}
@@ -720,6 +720,12 @@ @@ -720,6 +720,12 @@
720 "pathName": "pack-book/pages/book/b_index", 720 "pathName": "pack-book/pages/book/b_index",
721 "query": "seller_id=80&seller_openid=oGefL4qKBWIh5xwyg3LVfkMbDumA&manager_id=763&goPath=roomtype/roomtype", 721 "query": "seller_id=80&seller_openid=oGefL4qKBWIh5xwyg3LVfkMbDumA&manager_id=763&goPath=roomtype/roomtype",
722 "scene": null 722 "scene": null
  723 + },
  724 + {
  725 + "name": "pages/taocan/index",
  726 + "pathName": "pages/taocan/index",
  727 + "query": "sid=1&pid=1",
  728 + "scene": null
723 } 729 }
724 ] 730 ]
725 } 731 }