Showing
7 changed files
with
227 additions
and
3 deletions
| @@ -11,7 +11,7 @@ | @@ -11,7 +11,7 @@ | ||
| 11 | <view wx:if="{{hasSlogan && seller.slogan}}" class="slogan">“{{seller.slogan}}”</view> | 11 | <view wx:if="{{hasSlogan && seller.slogan}}" class="slogan">“{{seller.slogan}}”</view> |
| 12 | <view class="text flex-ll"> | 12 | <view class="text flex-ll"> |
| 13 | <view class="text-item" wx:if="{{seller.cate[0].name}}">{{seller.cate[0].name}}</view> | 13 | <view class="text-item" wx:if="{{seller.cate[0].name}}">{{seller.cate[0].name}}</view> |
| 14 | - <view class="text-item" wx:if="{{seller.distance}}">距当前位置{{seller.distance}}</view> | 14 | + <view class="text-item" wx:if="{{seller.distance}}">距当前位置{{se.distance}}</view> |
| 15 | </view> | 15 | </view> |
| 16 | <view wx:if="{{hasStat}}" class="stat"> | 16 | <view wx:if="{{hasStat}}" class="stat"> |
| 17 | <stat stat="{{seller.score}}"></stat> | 17 | <stat stat="{{seller.score}}"></stat> |
| @@ -4,7 +4,7 @@ | @@ -4,7 +4,7 @@ | ||
| 4 | height: 300rpx; | 4 | height: 300rpx; |
| 5 | overflow: hidden; | 5 | overflow: hidden; |
| 6 | color: #353535; | 6 | color: #353535; |
| 7 | - width: 100%; | 7 | + width: 99%; |
| 8 | border: 2rpx solid #E0E0E0; | 8 | border: 2rpx solid #E0E0E0; |
| 9 | border-radius: 6rpx; | 9 | border-radius: 6rpx; |
| 10 | box-shadow: 0 4rpx 8rpx 0 #E0E0E0; | 10 | box-shadow: 0 4rpx 8rpx 0 #E0E0E0; |
| @@ -415,6 +415,7 @@ Page({ | @@ -415,6 +415,7 @@ Page({ | ||
| 415 | param.tags=tags; | 415 | param.tags=tags; |
| 416 | } | 416 | } |
| 417 | this.selectComponent('#list').getList(param); | 417 | this.selectComponent('#list').getList(param); |
| 418 | + this.param=param; | ||
| 418 | let now_sid=[]; | 419 | let now_sid=[]; |
| 419 | App.Customer.SellerList(param).then(res => { | 420 | App.Customer.SellerList(param).then(res => { |
| 420 | this.mapData.region.southwest.latitude=''; | 421 | this.mapData.region.southwest.latitude=''; |
| @@ -719,6 +720,9 @@ Page({ | @@ -719,6 +720,9 @@ Page({ | ||
| 719 | } | 720 | } |
| 720 | }, | 721 | }, |
| 721 | listShow(){ | 722 | listShow(){ |
| 722 | - this.selectComponent('#list').show(); | 723 | + //this.selectComponent('#list').show(); |
| 724 | + wx.navigateTo({ | ||
| 725 | + url:util.http_build_query(this.param,'./indexList') | ||
| 726 | + }); | ||
| 723 | }, | 727 | }, |
| 724 | }) | 728 | }) |
pages/reserve/indexList.js
0 → 100644
| 1 | +// pages/reserve/indexList.js | ||
| 2 | +import util from '../../utils/util'; | ||
| 3 | +import App from '../../utils/api'; | ||
| 4 | +const {regeneratorRuntime} = global | ||
| 5 | +Page({ | ||
| 6 | + | ||
| 7 | + /** | ||
| 8 | + * 页面的初始数据 | ||
| 9 | + */ | ||
| 10 | + data: { | ||
| 11 | + multiArray: ['全部菜系'], | ||
| 12 | + multiIndex: [0], | ||
| 13 | + tags:[ | ||
| 14 | + {id:1,name:'环境好'}, | ||
| 15 | + {id:2,name:'菜品有特色'}, | ||
| 16 | + {id:3,name:'超大包间'}, | ||
| 17 | + ], | ||
| 18 | + markers:[], | ||
| 19 | + hasMore:true, | ||
| 20 | + }, | ||
| 21 | + | ||
| 22 | + /** | ||
| 23 | + * 生命周期函数--监听页面加载 | ||
| 24 | + */ | ||
| 25 | + onLoad: function (options) { | ||
| 26 | + //lat=34.21719&lng=108.89155&offset=0&rows=50&distance=100000&map={"errMsg":"getMapRegion:ok","southwest":{"longitude":108.87545674591064,"latitude":34.204520114013846},"northeast":{"longitude":108.90764325408935,"latitude":34.229857981005225},"scale":15}&cuisine=6&tags=1,2,3 | ||
| 27 | + this.options=options; | ||
| 28 | + this.getList(); | ||
| 29 | + }, | ||
| 30 | + | ||
| 31 | + /** | ||
| 32 | + * 生命周期函数--监听页面初次渲染完成 | ||
| 33 | + */ | ||
| 34 | + onReady: function () { | ||
| 35 | + | ||
| 36 | + }, | ||
| 37 | + | ||
| 38 | + /** | ||
| 39 | + * 生命周期函数--监听页面显示 | ||
| 40 | + */ | ||
| 41 | + onShow: function () { | ||
| 42 | + | ||
| 43 | + }, | ||
| 44 | + | ||
| 45 | + /** | ||
| 46 | + * 生命周期函数--监听页面隐藏 | ||
| 47 | + */ | ||
| 48 | + onHide: function () { | ||
| 49 | + | ||
| 50 | + }, | ||
| 51 | + | ||
| 52 | + /** | ||
| 53 | + * 生命周期函数--监听页面卸载 | ||
| 54 | + */ | ||
| 55 | + onUnload: function () { | ||
| 56 | + | ||
| 57 | + }, | ||
| 58 | + | ||
| 59 | + /** | ||
| 60 | + * 页面相关事件处理函数--监听用户下拉动作 | ||
| 61 | + */ | ||
| 62 | + onPullDownRefresh: function () { | ||
| 63 | + | ||
| 64 | + }, | ||
| 65 | + | ||
| 66 | + /** | ||
| 67 | + * 页面上拉触底事件的处理函数 | ||
| 68 | + */ | ||
| 69 | + onReachBottom: function () { | ||
| 70 | + | ||
| 71 | + }, | ||
| 72 | + getList(){ | ||
| 73 | + let mapParam=this.options | ||
| 74 | + this.offset=1 //page | ||
| 75 | + this.size=20 //page size | ||
| 76 | + //计算视窗中心 | ||
| 77 | + let map=JSON.parse(mapParam.map); | ||
| 78 | + let lat=map.northeast.latitude-(map.northeast.latitude-map.southwest.latitude)/2; | ||
| 79 | + let lng=map.northeast.longitude-(map.northeast.longitude-map.southwest.longitude)/2; | ||
| 80 | + this.param={ | ||
| 81 | + lat:lat, | ||
| 82 | + lng:lng, | ||
| 83 | + lat_extend:mapParam.lat, | ||
| 84 | + lng_extend:mapParam.lng, | ||
| 85 | + offset:this.offset, | ||
| 86 | + size:this.size, | ||
| 87 | + distance:50, | ||
| 88 | + }; | ||
| 89 | + if(mapParam.tags){ | ||
| 90 | + this.param.tags=mapParam.tags | ||
| 91 | + } | ||
| 92 | + if(mapParam.cuisine){ | ||
| 93 | + this.param.cuisine=mapParam.cuisine | ||
| 94 | + } | ||
| 95 | + App.Customer.SellerLists(this.param).then(res=>{ | ||
| 96 | + this.setData({ | ||
| 97 | + hasMore:res.data.length==this.size, | ||
| 98 | + markers:res.data, | ||
| 99 | + }) | ||
| 100 | + this.triggerEvent('event',{type:'getListEnd',total:res.data.length}) | ||
| 101 | + }) | ||
| 102 | + }, | ||
| 103 | + getListMore(){ | ||
| 104 | + this.param.offset+=1; | ||
| 105 | + let markers=this.data.markers; | ||
| 106 | + App.Customer.SellerLists(this.param).then(res=>{ | ||
| 107 | + this.setData({ | ||
| 108 | + hasMore:res.data.length==this.size, | ||
| 109 | + markers:markers.concat(res.data), | ||
| 110 | + }) | ||
| 111 | + }) | ||
| 112 | + }, | ||
| 113 | +}) |
pages/reserve/indexList.json
0 → 100644
| 1 | +{ | ||
| 2 | + "navigationBarBackgroundColor": "#ffffff", | ||
| 3 | + "navigationBarTextStyle": "black", | ||
| 4 | + "navigationBarTitleText":"一键订", | ||
| 5 | + "usingComponents": { | ||
| 6 | + "formids":"/components/formids/formids", | ||
| 7 | + "nav":"/components/nav/nav", | ||
| 8 | + "getpos":"/components/userinfo/getpos", | ||
| 9 | + "sb-tr":"/components/reserve/seller-box-transverse/seller-box" | ||
| 10 | + } | ||
| 11 | +} |
pages/reserve/indexList.wxml
0 → 100644
| 1 | +<!--pages/reserve/indexList.wxml--> | ||
| 2 | +<nav>一键订</nav> | ||
| 3 | +<view class="transverse-search flex-ll"> | ||
| 4 | + <view | ||
| 5 | + bindtap="caixiShow" | ||
| 6 | + class="tags {{multiIndex[0]>0?'active':''}}" | ||
| 7 | + > | ||
| 8 | + <view class="picker flex-lr"> | ||
| 9 | + <view class="input"> | ||
| 10 | + <block wx:if="{{multiIndex[0]==0}}">菜系</block> | ||
| 11 | + <block wx:else="">{{multiArray[0][multiIndex[0]]}}</block> | ||
| 12 | + </view> | ||
| 13 | + <view class="more"></view> | ||
| 14 | + </view> | ||
| 15 | + </view> | ||
| 16 | + <block wx:for="{{tags}}" wx:key="tags.key"> | ||
| 17 | + <view class="tags {{item.active?'active':''}}" | ||
| 18 | + bindtap="tagsChange" | ||
| 19 | + data-id="{{item.id}}">{{item.name}}</view> | ||
| 20 | + </block> | ||
| 21 | +</view> | ||
| 22 | +<view class="pages"> | ||
| 23 | + <view class="follow"> | ||
| 24 | + <view class="seller" wx:for="{{markers}}" wx:key="sellers.key" | ||
| 25 | + bindtap="gotoDetail" data-sid="{{item.id}}"> | ||
| 26 | + <sb-tr seller="{{item}}" | ||
| 27 | + hasActivity="{{true}}" hasAverage="{{false}}" | ||
| 28 | + hasSlogan="{{true}}" ></sb-tr> | ||
| 29 | + </view> | ||
| 30 | + <view class="flex-vc" wx:if="{{!hasMore}}">没有更多了</view> | ||
| 31 | + </view> | ||
| 32 | +</view> |
pages/reserve/indexList.wxss
0 → 100644
| 1 | +/* pages/reserve/indexList.wxss */ | ||
| 2 | +.transverse-search{ | ||
| 3 | + background-color: #fefefe; | ||
| 4 | + height: 60rpx; | ||
| 5 | + width: 100%; | ||
| 6 | + margin: 0 auto; | ||
| 7 | + font-size: 24rpx; | ||
| 8 | + padding-left: 40rpx; | ||
| 9 | + position: fixed; | ||
| 10 | + z-index: 10; | ||
| 11 | + | ||
| 12 | +} | ||
| 13 | +.transverse-search .tags{ | ||
| 14 | + height: 50rpx; | ||
| 15 | + line-height: 50rpx; | ||
| 16 | + background-color: #F0F0F9; | ||
| 17 | + border-radius: 4rpx; | ||
| 18 | + margin-right: 30rpx; | ||
| 19 | + padding: 0 16rpx; | ||
| 20 | +} | ||
| 21 | +.transverse-search .tags:last-child{ | ||
| 22 | + margin-right: 0; | ||
| 23 | +} | ||
| 24 | +.transverse-search .tags.active{ | ||
| 25 | + background-color: #F4DAB9; | ||
| 26 | + color:#8B5318; | ||
| 27 | + font-weight: 900; | ||
| 28 | +} | ||
| 29 | + | ||
| 30 | +.picker{ | ||
| 31 | + height: 50rpx; | ||
| 32 | + line-height: 50rpx; | ||
| 33 | +} | ||
| 34 | +.picker .input{ | ||
| 35 | + height: 50rpx; | ||
| 36 | + line-height: 50rpx; | ||
| 37 | + margin-right: 10rpx; | ||
| 38 | +} | ||
| 39 | +.picker .more{ | ||
| 40 | + background-image: url("http://qn.colorcun.com/reserve/images/%E8%8F%9C%E7%B3%BB.png"); | ||
| 41 | + width: 12rpx; | ||
| 42 | + height: 16rpx; | ||
| 43 | + min-width:12rpx; | ||
| 44 | +} | ||
| 45 | +.tags.active .picker .more{ | ||
| 46 | + background-image: url("http://qn.colorcun.com/reserve/images/%E8%8F%9C%E7%B3%BB%E9%80%89%E4%B8%AD.png"); | ||
| 47 | +} | ||
| 48 | + | ||
| 49 | + | ||
| 50 | +.pages{ | ||
| 51 | + width: 90%; | ||
| 52 | + margin: 100rpx auto 0; | ||
| 53 | + color:#fff; | ||
| 54 | + font-size: 28rpx; | ||
| 55 | +} | ||
| 56 | +.follow { | ||
| 57 | + padding-bottom: 50rpx; | ||
| 58 | +} | ||
| 59 | +.follow .seller{ | ||
| 60 | + margin-bottom:20rpx; | ||
| 61 | + background-color: #ffffff; | ||
| 62 | + border-radius: 6rpx; | ||
| 63 | + overflow: hidden; | ||
| 64 | +} |
-
Please register or login to post a comment