Showing
4 changed files
with
145 additions
and
72 deletions
| 1 | // pages/reserve/detail.js | 1 | // pages/reserve/detail.js |
| 2 | Page({ | 2 | Page({ |
| 3 | 3 | ||
| 4 | - /** | ||
| 5 | - * 页面的初始数据 | ||
| 6 | - */ | ||
| 7 | - data: { | ||
| 8 | - | ||
| 9 | - }, | ||
| 10 | - | ||
| 11 | - /** | ||
| 12 | - * 生命周期函数--监听页面加载 | ||
| 13 | - */ | ||
| 14 | - onLoad: function (options) { | ||
| 15 | - console.log('onLoad',options) | ||
| 16 | - }, | ||
| 17 | - | ||
| 18 | - /** | ||
| 19 | - * 生命周期函数--监听页面初次渲染完成 | ||
| 20 | - */ | ||
| 21 | - onReady: function () { | ||
| 22 | - | ||
| 23 | - }, | ||
| 24 | - | ||
| 25 | - /** | ||
| 26 | - * 生命周期函数--监听页面显示 | ||
| 27 | - */ | ||
| 28 | - onShow: function () { | ||
| 29 | - | ||
| 30 | - }, | ||
| 31 | - | ||
| 32 | - /** | ||
| 33 | - * 生命周期函数--监听页面隐藏 | ||
| 34 | - */ | ||
| 35 | - onHide: function () { | ||
| 36 | - | 4 | + /** |
| 5 | + * 页面的初始数据 | ||
| 6 | + */ | ||
| 7 | + data: { | ||
| 8 | + seller:{ | ||
| 9 | + id:1, | ||
| 10 | + seller_name:'陕西风味面馆', | ||
| 11 | + banner:[ | ||
| 12 | + 'http://qn.colorcun.com/custom/lite-online/image/def-banner.png' | ||
| 13 | + ], | ||
| 14 | + baos:[ | ||
| 15 | + 'http://qn.colorcun.com/custom/lite-online/image/def-banner.png', | ||
| 16 | + 'http://qn.colorcun.com/custom/lite-online/image/def-banner.png', | ||
| 17 | + 'http://qn.colorcun.com/custom/lite-online/image/def-banner.png' | ||
| 18 | + ] | ||
| 37 | }, | 19 | }, |
| 38 | - | ||
| 39 | - /** | ||
| 40 | - * 生命周期函数--监听页面卸载 | ||
| 41 | - */ | ||
| 42 | - onUnload: function () { | ||
| 43 | - | ||
| 44 | - }, | ||
| 45 | - | ||
| 46 | - /** | ||
| 47 | - * 页面相关事件处理函数--监听用户下拉动作 | ||
| 48 | - */ | ||
| 49 | - onPullDownRefresh: function () { | ||
| 50 | - | ||
| 51 | - }, | ||
| 52 | - | ||
| 53 | - /** | ||
| 54 | - * 页面上拉触底事件的处理函数 | ||
| 55 | - */ | ||
| 56 | - onReachBottom: function () { | ||
| 57 | - | ||
| 58 | - }, | ||
| 59 | - | ||
| 60 | - /** | ||
| 61 | - * 用户点击右上角分享 | ||
| 62 | - */ | ||
| 63 | - onShareAppMessage: function () { | ||
| 64 | - | 20 | + }, |
| 21 | + | ||
| 22 | + /** | ||
| 23 | + * 生命周期函数--监听页面加载 | ||
| 24 | + */ | ||
| 25 | + onLoad: function (options) { | ||
| 26 | + console.log('onLoad', options) | ||
| 27 | + }, | ||
| 28 | + | ||
| 29 | + /** | ||
| 30 | + * 生命周期函数--监听页面初次渲染完成 | ||
| 31 | + */ | ||
| 32 | + onReady: function () { | ||
| 33 | + | ||
| 34 | + }, | ||
| 35 | + | ||
| 36 | + /** | ||
| 37 | + * 生命周期函数--监听页面显示 | ||
| 38 | + */ | ||
| 39 | + onShow: function () { | ||
| 40 | + | ||
| 41 | + }, | ||
| 42 | + | ||
| 43 | + /** | ||
| 44 | + * 生命周期函数--监听页面隐藏 | ||
| 45 | + */ | ||
| 46 | + onHide: function () { | ||
| 47 | + | ||
| 48 | + }, | ||
| 49 | + | ||
| 50 | + /** | ||
| 51 | + * 生命周期函数--监听页面卸载 | ||
| 52 | + */ | ||
| 53 | + onUnload: function () { | ||
| 54 | + | ||
| 55 | + }, | ||
| 56 | + | ||
| 57 | + /** | ||
| 58 | + * 页面相关事件处理函数--监听用户下拉动作 | ||
| 59 | + */ | ||
| 60 | + onPullDownRefresh: function () { | ||
| 61 | + | ||
| 62 | + }, | ||
| 63 | + | ||
| 64 | + /** | ||
| 65 | + * 页面上拉触底事件的处理函数 | ||
| 66 | + */ | ||
| 67 | + onReachBottom: function () { | ||
| 68 | + | ||
| 69 | + }, | ||
| 70 | + | ||
| 71 | + /** | ||
| 72 | + * 用户点击右上角分享 | ||
| 73 | + */ | ||
| 74 | + onShareAppMessage: function () { | ||
| 75 | + | ||
| 76 | + }, | ||
| 77 | + reserve(){ | ||
| 78 | + if(false){//只有一个电话 | ||
| 79 | + wx.makePhoneCall({ | ||
| 80 | + phoneNumber:this.data.seller.phone | ||
| 81 | + }) | ||
| 82 | + }else{ | ||
| 83 | + this.selectComponent('#as').show(); | ||
| 65 | } | 84 | } |
| 85 | + }, | ||
| 86 | + reservePhone(e){ | ||
| 87 | + wx.makePhoneCall({ | ||
| 88 | + phoneNumber:e.detail.value | ||
| 89 | + }) | ||
| 90 | + }, | ||
| 91 | + follow(e){ | ||
| 92 | + console.log('收藏',e) | ||
| 93 | + }, | ||
| 66 | }) | 94 | }) |
| @@ -5,6 +5,7 @@ | @@ -5,6 +5,7 @@ | ||
| 5 | "usingComponents": { | 5 | "usingComponents": { |
| 6 | "formids":"/components/formids/formids", | 6 | "formids":"/components/formids/formids", |
| 7 | "stat":"/components/stat/stat", | 7 | "stat":"/components/stat/stat", |
| 8 | + "as":"/components/actionSheet/index", | ||
| 8 | "nav":"/components/nav/nav" | 9 | "nav":"/components/nav/nav" |
| 9 | } | 10 | } |
| 10 | } | 11 | } |
| @@ -4,11 +4,11 @@ | @@ -4,11 +4,11 @@ | ||
| 4 | <swiper | 4 | <swiper |
| 5 | indicator-dots="{{false}}" autoplay="{{false}}" circular="{{false}}" vertical="{{false}}" | 5 | indicator-dots="{{false}}" autoplay="{{false}}" circular="{{false}}" vertical="{{false}}" |
| 6 | interval="2000" duration="500" | 6 | interval="2000" duration="500" |
| 7 | - previous-margin="{{20}}px" next-margin="{{20}}px" | 7 | + previous-margin="{{0}}px" next-margin="{{0}}px" |
| 8 | current="{{current}}" bindchange="bindtransition"> | 8 | current="{{current}}" bindchange="bindtransition"> |
| 9 | - <block wx:for="{{sellers}}" wx:key="sellers.key"> | ||
| 10 | - <swiper-item bindtap="gotoDetail" data-sid="{{item.id}}"> | ||
| 11 | - <image src="" class="image" mode="aspectFill"></image> | 9 | + <block wx:for="{{seller.banner}}" wx:key="sellers.key"> |
| 10 | + <swiper-item> | ||
| 11 | + <image src="{{item}}" class="image" mode="aspectFill"></image> | ||
| 12 | </swiper-item> | 12 | </swiper-item> |
| 13 | </block> | 13 | </block> |
| 14 | </swiper> | 14 | </swiper> |
| @@ -16,7 +16,7 @@ | @@ -16,7 +16,7 @@ | ||
| 16 | <view class="pages"> | 16 | <view class="pages"> |
| 17 | <view class="seller"> | 17 | <view class="seller"> |
| 18 | <view class="base flex-vc"> | 18 | <view class="base flex-vc"> |
| 19 | - <view class="name">陕西风味面馆</view> | 19 | + <view class="name">{{seller.seller_name}}</view> |
| 20 | <view class="ping flex-cc"> | 20 | <view class="ping flex-cc"> |
| 21 | <view class="item flex-lr fen"> | 21 | <view class="item flex-lr fen"> |
| 22 | <stat stat="2"></stat> | 22 | <stat stat="2"></stat> |
| @@ -33,7 +33,7 @@ | @@ -33,7 +33,7 @@ | ||
| 33 | </view> | 33 | </view> |
| 34 | <view class="addr"> | 34 | <view class="addr"> |
| 35 | <view class="addr-text flex-ll"> | 35 | <view class="addr-text flex-ll"> |
| 36 | - <image src=""></image> | 36 | + <image src="http://qn.colorcun.com/custom/lite-online/image/%E5%AE%9A%E4%BD%8D.png"></image> |
| 37 | <view>高新区唐延南路35号旺座现代城D座二层</view> | 37 | <view>高新区唐延南路35号旺座现代城D座二层</view> |
| 38 | </view> | 38 | </view> |
| 39 | <view class="addr-long">距您当前位置100m</view> | 39 | <view class="addr-long">距您当前位置100m</view> |
| @@ -46,18 +46,21 @@ | @@ -46,18 +46,21 @@ | ||
| 46 | <view class="name">包间环境</view> | 46 | <view class="name">包间环境</view> |
| 47 | </view> | 47 | </view> |
| 48 | <scroll-view | 48 | <scroll-view |
| 49 | - scroll-y | ||
| 50 | - style="height: 200px;" | 49 | + scroll-x |
| 50 | + class="baos" | ||
| 51 | bindscrolltoupper="upper" | 51 | bindscrolltoupper="upper" |
| 52 | bindscrolltolower="lower" | 52 | bindscrolltolower="lower" |
| 53 | bindscroll="scroll" | 53 | bindscroll="scroll" |
| 54 | scroll-into-view="{{toView}}" | 54 | scroll-into-view="{{toView}}" |
| 55 | scroll-top="{{scrollTop}}" | 55 | scroll-top="{{scrollTop}}" |
| 56 | > | 56 | > |
| 57 | - <view id="green" class="scroll-view-item bc_green"></view> | ||
| 58 | - <view id="red" class="scroll-view-item bc_red"></view> | ||
| 59 | - <view id="yellow" class="scroll-view-item bc_yellow"></view> | ||
| 60 | - <view id="blue" class="scroll-view-item bc_blue"></view> | 57 | + |
| 58 | + <block wx:for="{{seller.baos}}" wx:key="sellers.key"> | ||
| 59 | + <view class="image"> | ||
| 60 | + <image src="{{item}}" mode="aspectFill"></image> | ||
| 61 | + </view> | ||
| 62 | + </block> | ||
| 63 | + | ||
| 61 | </scroll-view> | 64 | </scroll-view> |
| 62 | </view> | 65 | </view> |
| 63 | <view class="block"> | 66 | <view class="block"> |
| @@ -89,6 +92,7 @@ | @@ -89,6 +92,7 @@ | ||
| 89 | </formids> | 92 | </formids> |
| 90 | <formids class="follow flex-vc" bindclick="follow"> | 93 | <formids class="follow flex-vc" bindclick="follow"> |
| 91 | <image src="http://qn.colorcun.com/custom/lite-online/image/%E6%94%B6%E8%97%8F.png"></image> | 94 | <image src="http://qn.colorcun.com/custom/lite-online/image/%E6%94%B6%E8%97%8F.png"></image> |
| 95 | + <image src="http://qn.colorcun.com/custom/lite-online/image/%E5%B7%B2%E6%94%B6%E8%97%8F.png"></image> | ||
| 92 | <view class="text">收藏</view> | 96 | <view class="text">收藏</view> |
| 93 | </formids> | 97 | </formids> |
| 94 | </view> | 98 | </view> |
| @@ -98,3 +102,4 @@ | @@ -98,3 +102,4 @@ | ||
| 98 | </formids> | 102 | </formids> |
| 99 | </view> | 103 | </view> |
| 100 | </view> | 104 | </view> |
| 105 | +<as id="as" items="{{['1','2']}}" bindclick="reservePhone">拨打电话预定</as> |
| @@ -10,6 +10,9 @@ | @@ -10,6 +10,9 @@ | ||
| 10 | width: 100%; | 10 | width: 100%; |
| 11 | height: 400rpx; | 11 | height: 400rpx; |
| 12 | } | 12 | } |
| 13 | +.seller-banner swiper,.seller-banner swiper-item{ | ||
| 14 | + height: 100%; | ||
| 15 | +} | ||
| 13 | .seller-banner .image{ | 16 | .seller-banner .image{ |
| 14 | width: 100%; | 17 | width: 100%; |
| 15 | height: 100%; | 18 | height: 100%; |
| @@ -53,6 +56,23 @@ | @@ -53,6 +56,23 @@ | ||
| 53 | } | 56 | } |
| 54 | .base .peitao{ | 57 | .base .peitao{ |
| 55 | margin-top: 10rpx; | 58 | margin-top: 10rpx; |
| 59 | + width: 100%; | ||
| 60 | +} | ||
| 61 | +.peitao .icon{ | ||
| 62 | + margin-right: 20rpx; | ||
| 63 | + background-size: 28rpx 26rpx; | ||
| 64 | + background-repeat: no-repeat; | ||
| 65 | + text-indent: 38rpx; | ||
| 66 | + line-height: 26rpx; | ||
| 67 | +} | ||
| 68 | +.peitao .icon.bao{ | ||
| 69 | + background-image: url("http://qn.colorcun.com/custom/lite-online/image/%E5%8C%85%E9%97%B4.png"); | ||
| 70 | +} | ||
| 71 | +.peitao .icon.ka{ | ||
| 72 | + background-image: url("http://qn.colorcun.com/custom/lite-online/image/%E5%8D%A1%E5%BA%A7.png"); | ||
| 73 | +} | ||
| 74 | +.peitao .icon.car{ | ||
| 75 | + background-image: url("http://qn.colorcun.com/custom/lite-online/image/%E5%81%9C%E8%BD%A6.png"); | ||
| 56 | } | 76 | } |
| 57 | 77 | ||
| 58 | 78 | ||
| @@ -90,6 +110,7 @@ | @@ -90,6 +110,7 @@ | ||
| 90 | .block .header{ | 110 | .block .header{ |
| 91 | height: 44rpx; | 111 | height: 44rpx; |
| 92 | line-height: 44rpx; | 112 | line-height: 44rpx; |
| 113 | + margin-bottom: 60rpx; | ||
| 93 | } | 114 | } |
| 94 | .block .line{ | 115 | .block .line{ |
| 95 | height: 44rpx; | 116 | height: 44rpx; |
| @@ -147,4 +168,22 @@ | @@ -147,4 +168,22 @@ | ||
| 147 | height: 42rpx; | 168 | height: 42rpx; |
| 148 | font-size: 30rpx; | 169 | font-size: 30rpx; |
| 149 | color:#ffffff; | 170 | color:#ffffff; |
| 171 | +} | ||
| 172 | + | ||
| 173 | +.baos{ | ||
| 174 | + height: 282rpx; | ||
| 175 | + width: 100%; | ||
| 176 | + white-space: nowrap; | ||
| 177 | +} | ||
| 178 | +.baos .image{ | ||
| 179 | + width: 400rpx; | ||
| 180 | + border-radius: 10rpx; | ||
| 181 | + margin-right: 20rpx; | ||
| 182 | + display: inline-block; | ||
| 183 | + overflow: hidden; | ||
| 184 | + height: 100%; | ||
| 185 | +} | ||
| 186 | +.baos .image image{ | ||
| 187 | + width: 100%; | ||
| 188 | + height: 100%; | ||
| 150 | } | 189 | } |
-
Please register or login to post a comment