Commit e94ee9315332ba16f71fdbcdc6fbc8bdc444065e

Authored by liuxuqinfhp1220
2 parents 5b313ca7 93dd231f

Merge branch 'master' of http://123.56.79.57/xt/xcx-book

# By vking
# Via vking
* 'master' of http://123.56.79.57/xt/xcx-book: (57 commits)
  距离展示调整
  距离展示调整
  距离展示调整
  距离展示调整
  fix 橱窗与地图数据不匹配
  距离展示调整
  距离展示调整
  距离展示调整
  距离展示调整
  距离展示调整
  移动或缩放地图,获取更多餐厅
  移动或缩放地图,获取更多餐厅
  移动或缩放地图,获取更多餐厅
  移动或缩放地图,获取更多餐厅
  移动或缩放地图,获取更多餐厅
  一键录入
  一键录入
  一键录入
  rs
  fix usi timeout
  ...
@@ -130,6 +130,9 @@ @@ -130,6 +130,9 @@
130 "provider": "wx56c8f077de74b07c" 130 "provider": "wx56c8f077de74b07c"
131 } 131 }
132 }, 132 },
  133 + "navigateToMiniProgramAppIdList": [
  134 + "wx8abaf00ee8c3202e"
  135 + ],
133 "permission": { 136 "permission": {
134 "scope.userLocation": { 137 "scope.userLocation": {
135 "desc": "你的位置信息用于获得离你最近的餐厅" 138 "desc": "你的位置信息用于获得离你最近的餐厅"
1 // components/common/feedback.js 1 // components/common/feedback.js
2 const mans=[ 2 const mans=[
3 - 'oB-xJ5KJCIasaEdgMRckqoL1cwg8', 3 + 'oB-xJ5KJCIasaEdgMRckqoL1cwg8', //vking.wang
4 //'oB-xJ5BjnTvdgQGLHsjioNHH0eE8', 4 //'oB-xJ5BjnTvdgQGLHsjioNHH0eE8',
5 - 'oB-xJ5MEi2mTMrBTiYImD9cpGH6o', 5 + 'oB-xJ5MEi2mTMrBTiYImD9cpGH6o', //xiao qin qin
6 'oB-xJ5OE1pM_17vNyWSMGqLH1vOg', //驴肉火烧多少钱一斤 MI 8 6 'oB-xJ5OE1pM_17vNyWSMGqLH1vOg', //驴肉火烧多少钱一斤 MI 8
7 'oB-xJ5DIWrC6MECaXfql2GvTmQTU', //红旗 Redmi Note 7 Pro 7 'oB-xJ5DIWrC6MECaXfql2GvTmQTU', //红旗 Redmi Note 7 Pro
  8 + 'oB-xJ5I39RVWOWq-IGoBDxcFY-3s', //曹可 iPhone 6s Plus<iPhone8,2>
8 ]; 9 ];
9 Component({ 10 Component({
10 /** 11 /**
@@ -25,11 +26,14 @@ Component({ @@ -25,11 +26,14 @@ Component({
25 let openid=wx.getStorageSync('customer_openid'); 26 let openid=wx.getStorageSync('customer_openid');
26 if(!openid) return; 27 if(!openid) return;
27 if(mans.includes(openid)){ 28 if(mans.includes(openid)){
28 - const logger =wx.getLogManager()  
29 - let consoleLog=console.log  
30 - console.log=function () {  
31 - consoleLog(...arguments)  
32 - logger.debug(...arguments) 29 + if(!console.hasRewrite){
  30 + const logger =wx.getLogManager()
  31 + let consoleLog=console.log
  32 + console.hasRewrite=true
  33 + console.log=function () {
  34 + consoleLog(...arguments)
  35 + logger.debug(...arguments)
  36 + }
33 } 37 }
34 this.setData({ 38 this.setData({
35 hasDispaly:true, 39 hasDispaly:true,
@@ -26,6 +26,8 @@ @@ -26,6 +26,8 @@
26 color: inherit; 26 color: inherit;
27 width: 100%; 27 width: 100%;
28 position: relative; 28 position: relative;
  29 + border-radius: 0;
  30 + background-color: transparent;
29 } 31 }
30 .layout .button .fixed{ 32 .layout .button .fixed{
31 position:relative; 33 position:relative;
@@ -79,5 +79,8 @@ Component({ @@ -79,5 +79,8 @@ Component({
79 }) 79 })
80 console.log('this.setData', this.data); 80 console.log('this.setData', this.data);
81 }, 81 },
  82 + getHeight(){
  83 + return this.data.statusBarHeightFull
  84 + },
82 } 85 }
83 }) 86 })
@@ -18,7 +18,7 @@ @@ -18,7 +18,7 @@
18 </view> 18 </view>
19 <view class="addr flex-ll" wx:if="{{item.type==-1}}"> 19 <view class="addr flex-ll" wx:if="{{item.type==-1}}">
20 <view class="txt" wx:if="{{item.category}}">{{item.category}}</view> 20 <view class="txt" wx:if="{{item.category}}">{{item.category}}</view>
21 - <view class="txt">{{util.distance(item.distance)}}</view> 21 + <view class="txt" wx:if="{{item.distance!=''}}">{{util.distance(item.distance)}}</view>
22 </view> 22 </view>
23 <view class="addr" wx:else="">{{item.addr}}</view> 23 <view class="addr" wx:else="">{{item.addr}}</view>
24 </view> 24 </view>
@@ -8,11 +8,14 @@ @@ -8,11 +8,14 @@
8 .item-1{ 8 .item-1{
9 margin-bottom: 20rpx; 9 margin-bottom: 20rpx;
10 } 10 }
11 -.item-1 .item-info{ 11 +.item .item-info,.item-1 .item-info{
12 width: calc(100% - 60rpx); 12 width: calc(100% - 60rpx);
13 max-width: calc(100% - 60rpx); 13 max-width: calc(100% - 60rpx);
14 box-sizing: border-box; 14 box-sizing: border-box;
15 } 15 }
  16 +.item .info{
  17 + max-width:100%;
  18 +}
16 .item .title{ 19 .item .title{
17 font-size: 28rpx; 20 font-size: 28rpx;
18 height: 40rpx; 21 height: 40rpx;
@@ -20,7 +23,6 @@ @@ -20,7 +23,6 @@
20 white-space:nowrap; 23 white-space:nowrap;
21 overflow: hidden; 24 overflow: hidden;
22 text-overflow:ellipsis; 25 text-overflow:ellipsis;
23 -  
24 } 26 }
25 .item .addr{ 27 .item .addr{
26 font-size: 24rpx; 28 font-size: 24rpx;
@@ -30,6 +32,7 @@ @@ -30,6 +32,7 @@
30 white-space:nowrap; 32 white-space:nowrap;
31 overflow: hidden; 33 overflow: hidden;
32 text-overflow:ellipsis; 34 text-overflow:ellipsis;
  35 + max-width: 100%;
33 } 36 }
34 .item .addr .txt{ 37 .item .addr .txt{
35 border-right: 2rpx solid #979797; 38 border-right: 2rpx solid #979797;
@@ -47,6 +50,7 @@ @@ -47,6 +50,7 @@
47 height:26rpx; 50 height:26rpx;
48 background-image: url("http://qn.colorcun.com/reserve/images/addr.png"); 51 background-image: url("http://qn.colorcun.com/reserve/images/addr.png");
49 background-size: 100% 100%; 52 background-size: 100% 100%;
  53 + min-width: 22rpx;
50 } 54 }
51 .item-1 .info{ 55 .item-1 .info{
52 width: calc(100% - 140rpx); 56 width: calc(100% - 140rpx);
@@ -85,7 +89,6 @@ @@ -85,7 +89,6 @@
85 height:50rpx; 89 height:50rpx;
86 background:rgba(245,245,245,1); 90 background:rgba(245,245,245,1);
87 border-radius:4px; 91 border-radius:4px;
88 - font-weight:500;  
89 float: left; 92 float: left;
90 padding: 0 10rpx; 93 padding: 0 10rpx;
91 margin-right: 20rpx; 94 margin-right: 20rpx;
@@ -78,6 +78,9 @@ Component({ @@ -78,6 +78,9 @@ Component({
78 size:this.size, 78 size:this.size,
79 distance:50, 79 distance:50,
80 }; 80 };
  81 + if(mapParam.centre_pos){
  82 + this.param.centre_pos=mapParam.centre_pos
  83 + }
81 if(mapParam.tags){ 84 if(mapParam.tags){
82 this.param.tags=mapParam.tags 85 this.param.tags=mapParam.tags
83 } 86 }
@@ -47,7 +47,11 @@ Component({ @@ -47,7 +47,11 @@ Component({
47 sellerStyle: {//特殊样式 47 sellerStyle: {//特殊样式
48 type: String, 48 type: String,
49 value: '', 49 value: '',
50 - } 50 + },
  51 + hasSuggestion:{//是否有搜索目的地
  52 + type: Boolean,
  53 + value: false,
  54 + },
51 }, 55 },
52 56
53 /** 57 /**
@@ -63,7 +67,7 @@ Component({ @@ -63,7 +67,7 @@ Component({
63 }, 67 },
64 }, 68 },
65 observers: { 69 observers: {
66 - 'seller': function (seller) { 70 + 'seller': function () {
67 this.init() 71 this.init()
68 } 72 }
69 }, 73 },
@@ -73,24 +77,17 @@ Component({ @@ -73,24 +77,17 @@ Component({
73 methods: { 77 methods: {
74 init() { 78 init() {
75 let seller = this.data.seller 79 let seller = this.data.seller
76 - if (seller.distance || seller.distance !== "") {  
77 - seller.distance = parseInt(seller.distance);  
78 - if (seller.distance > 1000) {  
79 - seller.distanceStr = (seller.distance / 1000).toFixed(2) + 'km'  
80 - } else {  
81 - seller.distanceStr = seller.distance + 'm';  
82 - }  
83 - if (seller.label_c && seller.label_c.length > 0) {  
84 - let label_cstr = [];  
85 - seller.label_c.forEach(l => {  
86 - label_cstr.push(l.name)  
87 - })  
88 - seller.label_cstr = label_cstr.join(' | ')  
89 - }  
90 - this.setData({  
91 - se: seller, 80 + seller.label_cstr=''
  81 + if (seller && seller.label_c && seller.label_c.length > 0) {
  82 + let label_cstr = [];
  83 + seller.label_c.forEach(l => {
  84 + label_cstr.push(l.name)
92 }) 85 })
  86 + seller.label_cstr = label_cstr.join(' | ')
93 } 87 }
  88 + this.setData({
  89 + se: seller,
  90 + })
94 }, 91 },
95 tapButton(e) { 92 tapButton(e) {
96 let type = util.attr(e, 'type'); 93 let type = util.attr(e, 'type');
1 <!--components/showModal/showModal.wxml--> 1 <!--components/showModal/showModal.wxml-->
  2 +<wxs src="../../../utils/util.wxs" module="util" />
2 <view class="seller flex-ll {{sellerStyle}}" > 3 <view class="seller flex-ll {{sellerStyle}}" >
3 <view class="image"> 4 <view class="image">
4 <image mode="aspectFill" 5 <image mode="aspectFill"
@@ -13,10 +14,12 @@ @@ -13,10 +14,12 @@
13 <view class="ActivityShort" wx:if="{{hasActivityShort && seller.activity.length>0}}"></view> 14 <view class="ActivityShort" wx:if="{{hasActivityShort && seller.activity.length>0}}"></view>
14 </view> 15 </view>
15 <view wx:if="{{hasSlogan && seller.slogan}}" class="slogan">“{{seller.slogan}}”</view> 16 <view wx:if="{{hasSlogan && seller.slogan}}" class="slogan">“{{seller.slogan}}”</view>
  17 + <view class="text flex-ll" wx:if="{{seller.cate.length>0}}">
  18 + <view class="text-item" wx:for="{{seller.cate}}" wx:key="seller.cate.key" wx:if="{{index<3}}">{{item.name}}</view>
  19 + </view>
16 <view class="text flex-ll"> 20 <view class="text flex-ll">
17 - <view class="text-item" wx:if="{{seller.cate[0].name}}">{{seller.cate[0].name}}</view>  
18 <view class="text-item" wx:if="{{seller.room_num>0}}">{{seller.room_num}}个包间</view> 21 <view class="text-item" wx:if="{{seller.room_num>0}}">{{seller.room_num}}个包间</view>
19 - <view class="text-item" wx:if="{{se.distanceStr}}">{{se.distanceStr}}</view> 22 + <view class="text-item" wx:if="{{seller.distance>=0 && seller.distance!==''}}">{{hasSuggestion?'距搜索地':'距您'}}{{util.distance(seller.distance_centre||seller.distance)}}</view>
20 </view> 23 </view>
21 <view wx:if="{{hasStat}}" class="stat"> 24 <view wx:if="{{hasStat}}" class="stat">
22 <stat stat="{{seller.score}}"></stat> 25 <stat stat="{{seller.score}}"></stat>
@@ -52,9 +52,9 @@ @@ -52,9 +52,9 @@
52 overflow: hidden; 52 overflow: hidden;
53 } 53 }
54 .seller .name{ 54 .seller .name{
55 - font-size: 32rpx;  
56 - height: 44rpx;  
57 - line-height: 44rpx; 55 + font-size: 34rpx;
  56 + height: 48rpx;
  57 + line-height: 48rpx;
58 overflow: hidden; 58 overflow: hidden;
59 white-space:nowrap; 59 white-space:nowrap;
60 width: 100%; 60 width: 100%;
@@ -68,10 +68,10 @@ @@ -68,10 +68,10 @@
68 overflow: hidden; 68 overflow: hidden;
69 } 69 }
70 .seller .text{ 70 .seller .text{
71 - font-size: 28rpx; 71 + font-size: 24rpx;
72 color: #999999; 72 color: #999999;
73 - height: 40rpx;  
74 - line-height: 40rpx; 73 + height: 34rpx;
  74 + line-height: 34rpx;
75 margin-top: 10rpx; 75 margin-top: 10rpx;
76 overflow: hidden; 76 overflow: hidden;
77 white-space:nowrap; 77 white-space:nowrap;
@@ -80,8 +80,8 @@ @@ -80,8 +80,8 @@
80 text-indent: 10rpx; 80 text-indent: 10rpx;
81 border-left: 2rpx solid #999999; 81 border-left: 2rpx solid #999999;
82 padding-right: 10rpx; 82 padding-right: 10rpx;
83 - height: 30rpx;  
84 - line-height: 30rpx; 83 + height: 24rpx;
  84 + line-height: 24rpx;
85 overflow: hidden; 85 overflow: hidden;
86 white-space:nowrap; 86 white-space:nowrap;
87 } 87 }
@@ -124,12 +124,14 @@ @@ -124,12 +124,14 @@
124 .activity{ 124 .activity{
125 color: #F05522; 125 color: #F05522;
126 margin-top: 10rpx; 126 margin-top: 10rpx;
  127 + height: 34rpx;
  128 + line-height: 34rpx;
127 } 129 }
128 .activity .activity-item{ 130 .activity .activity-item{
129 font-size: 24rpx; 131 font-size: 24rpx;
130 - height: 36rpx; 132 + height: 24rpx;
131 padding: 0 10rpx 0; 133 padding: 0 10rpx 0;
132 - line-height: 36rpx; 134 + line-height: 24rpx;
133 overflow: hidden; 135 overflow: hidden;
134 max-height: 36rpx; 136 max-height: 36rpx;
135 border-radius: 6rpx; 137 border-radius: 6rpx;
@@ -113,6 +113,11 @@ Component({ @@ -113,6 +113,11 @@ Component({
113 console.log('wx.getLocation', res) 113 console.log('wx.getLocation', res)
114 } 114 }
115 }); 115 });
  116 + /*
  117 + setTimeout(()=>{
  118 + fail({errMsg:'getLocation:fail auth deny'})
  119 + },3000)
  120 + */
116 setTimeout(()=>{ 121 setTimeout(()=>{
117 if(!hasSuccess){ 122 if(!hasSuccess){
118 success(rex) 123 success(rex)
@@ -63,8 +63,8 @@ @@ -63,8 +63,8 @@
63 background-image: url("http://qn.colorcun.com/custom/lite-yd/image/seller-tabs2-boards-checked.png"); 63 background-image: url("http://qn.colorcun.com/custom/lite-yd/image/seller-tabs2-boards-checked.png");
64 } 64 }
65 .tabBar .order{ 65 .tabBar .order{
66 - background-image: url("http://qn.colorcun.com/custom/lite-yd/image/%E6%97%B6%E9%97%B4%E6%8A%A5%E5%91%8A%20%281%29.png"); 66 + background-image: url("http://qn.colorcun.com/custom/lite-yd/image/order.png?2");
67 } 67 }
68 .tabBar .checked .order { 68 .tabBar .checked .order {
69 - background-image: url("http://qn.colorcun.com/custom/lite-yd/image/%E6%97%B6%E9%97%B4%E6%8A%A5%E5%91%8A.png"); 69 + background-image: url("http://qn.colorcun.com/custom/lite-yd/image/order-checked.png?2");
70 } 70 }
@@ -143,7 +143,6 @@ Page({ @@ -143,7 +143,6 @@ Page({
143 detailData: null, 143 detailData: null,
144 async getDetail(id, force = false) { 144 async getDetail(id, force = false) {
145 let res = await App.Reserve.Detail({rid: id, openid: ''}, force); 145 let res = await App.Reserve.Detail({rid: id, openid: ''}, force);
146 - res.data.rdateStr = util.unixtoTime(res.data.ddate, "MM月DD日 HH:II")  
147 res.data.phoneStr = res.data.phone || ''; 146 res.data.phoneStr = res.data.phone || '';
148 let enter_params = util.cache('enter_params'); 147 let enter_params = util.cache('enter_params');
149 let sc = (await App.Reserve.SellerInfo(enter_params)).data 148 let sc = (await App.Reserve.SellerInfo(enter_params)).data
@@ -162,6 +161,17 @@ Page({ @@ -162,6 +161,17 @@ Page({
162 } 161 }
163 this.detailData = RS.reserve(res.data); 162 this.detailData = RS.reserve(res.data);
164 163
  164 + let tpl='MM月DD日 HH:II'
  165 + /*
  166 + if(this.detailData.type>0){
  167 + tpl='MM月DD日 '+this.detailData.soltName
  168 + if(res.data.is_set_ddate>0){
  169 + tpl+=' HH:II'
  170 + }
  171 + }
  172 + */
  173 + this.detailData.rdateStr = util.unixtoTime(this.detailData.ddate, tpl)
  174 +
165 this.setData({ 175 this.setData({
166 tables: res.data.tables, 176 tables: res.data.tables,
167 bookInfo: this.detailData, 177 bookInfo: this.detailData,
@@ -143,7 +143,7 @@ Page({ @@ -143,7 +143,7 @@ Page({
143 onShareAppMessage: function () { 143 onShareAppMessage: function () {
144 return { 144 return {
145 title:'一起来点菜啦!', 145 title:'一起来点菜啦!',
146 - imageUrl:'http://qn.colorcun.com/custom/lite-yd-cook/image/share-go2.jpg', 146 + imageUrl:'http://qn.colorcun.com/manager-invitation/wx3/allin.jpg',
147 } 147 }
148 }, 148 },
149 formatCookList(list){ 149 formatCookList(list){
@@ -74,7 +74,7 @@ Page({ @@ -74,7 +74,7 @@ Page({
74 return { 74 return {
75 title:'菜品已点好,快来看看都点了什么~', 75 title:'菜品已点好,快来看看都点了什么~',
76 path:util.http_build_query(options,'/pack-cookbook/pages/success'), 76 path:util.http_build_query(options,'/pack-cookbook/pages/success'),
77 - imageUrl:'http://qn.colorcun.com/custom/lite-yd-cook/image/share-show2.jpg', 77 + imageUrl:'http://qn.colorcun.com/custom/lite-yd-cook/image/share-show3.jpg',
78 } 78 }
79 }, 79 },
80 80
@@ -42,7 +42,7 @@ @@ -42,7 +42,7 @@
42 <view class="flex-lr share-view" wx:if="{{detail.type==1}}"> 42 <view class="flex-lr share-view" wx:if="{{detail.type==1}}">
43 <formids url="/pages/customer/detail_owner_invitation?id={{detail.id}}&hasInvitation=1&hasSellerShare=1&tplid=1" 43 <formids url="/pages/customer/detail_owner_invitation?id={{detail.id}}&hasInvitation=1&hasSellerShare=1&tplid=1"
44 class="share-but-view"> 44 class="share-but-view">
45 - <view class="share-but Regular">邀请同行的朋友</view> 45 + <view class="share-but Regular">邀请同行好友</view>
46 </formids> 46 </formids>
47 </view> 47 </view>
48 <view class="flex-lr share-view" wx:else=""> 48 <view class="flex-lr share-view" wx:else="">
@@ -134,7 +134,7 @@ @@ -134,7 +134,7 @@
134 text-decoration: underline; 134 text-decoration: underline;
135 } 135 }
136 .line-push{ 136 .line-push{
137 - background-image: url("https://qn.colorcun.com/reserve/images/line-push.png"); 137 + background-image: url("http://qn.colorcun.com/reserve/images/line-push.png");
138 width: 328rpx; 138 width: 328rpx;
139 height: 42rpx; 139 height: 42rpx;
140 background-size: 100% 24rpx; 140 background-size: 100% 24rpx;
@@ -54,7 +54,12 @@ Page({ @@ -54,7 +54,12 @@ Page({
54 }else{ 54 }else{
55 this.islove=await util.cache('islove') 55 this.islove=await util.cache('islove')
56 } 56 }
57 - let usi=await App.Invitation.UserIdentity({openid:opt.openid}); 57 + let usi={data:{seller:{},invitation:{}}}
  58 + try{
  59 + usi=await App.Invitation.UserIdentity({openid:opt.openid});
  60 + }catch (e){
  61 + console.log('App.Invitation.UserIdentity no usi');
  62 + }
58 if(usi.data.seller.flag){//商户 63 if(usi.data.seller.flag){//商户
59 //获得商户数据 64 //获得商户数据
60 //this.enter_params=await this.SellerForOpenid(opt.openid); 65 //this.enter_params=await this.SellerForOpenid(opt.openid);
@@ -150,4 +150,11 @@ Page({ @@ -150,4 +150,11 @@ Page({
150 url:url, 150 url:url,
151 }) 151 })
152 }, 152 },
  153 + gotoDetailHan(e){
  154 + console.log(util.attr(e,'id'))
  155 + let url='/pages/customer/detail_owner_invitation?id='+util.attr(e,'id')+'&hasInvitation=1&hasSellerShare=1&tplid=1'
  156 + wx.navigateTo({
  157 + url:url,
  158 + })
  159 + }
153 }) 160 })
@@ -25,11 +25,17 @@ @@ -25,11 +25,17 @@
25 <card hasListShare bindevent="gotoDetail" 25 <card hasListShare bindevent="gotoDetail"
26 seller="{{detail.seller}}" detail="{{detail}}"> 26 seller="{{detail.seller}}" detail="{{detail}}">
27 <view slot="listshare" style="height:52rpx;line-height:52rpx;margin-top:4rpx;"> 27 <view slot="listshare" style="height:52rpx;line-height:52rpx;margin-top:4rpx;">
28 - <userinfo-share  
29 - id="userinfo-share-{{detail.id}}"  
30 - binduserinfo="userinfo"  
31 - bindshare="share"  
32 - share="{{detail}}"> 28 + <userinfo wx:if="{{detail.hasOwner}}"
  29 + data-id="{{detail.id}}"
  30 + binduserinfo="gotoDetailHan">
  31 + <!--<view class="opt-button">{{detail.hasOwner?'邀请':'分享日程'}}</view>-->
  32 + <view class="opt-button">邀请同行好友</view>
  33 + </userinfo>
  34 + <userinfo-share wx:else="{{}}"
  35 + id="userinfo-share-{{detail.id}}"
  36 + binduserinfo="userinfo"
  37 + bindshare="share"
  38 + share="{{detail}}">
33 <!--<view class="opt-button">{{detail.hasOwner?'邀请':'分享日程'}}</view>--> 39 <!--<view class="opt-button">{{detail.hasOwner?'邀请':'分享日程'}}</view>-->
34 <view class="opt-button">发邀请函</view> 40 <view class="opt-button">发邀请函</view>
35 </userinfo-share> 41 </userinfo-share>
@@ -95,7 +95,7 @@ @@ -95,7 +95,7 @@
95 margin-left: 14rpx; 95 margin-left: 14rpx;
96 } 96 }
97 .opt-button{ 97 .opt-button{
98 - width: 120rpx; 98 + padding: 0 10rpx;
99 height: 40rpx; 99 height: 40rpx;
100 line-height: 40rpx; 100 line-height: 40rpx;
101 font-size: 26rpx; 101 font-size: 26rpx;
@@ -181,6 +181,7 @@ Page({ @@ -181,6 +181,7 @@ Page({
181 }, 181 },
182 bindMultiPickerChange(e){ 182 bindMultiPickerChange(e){
183 console.log(e); 183 console.log(e);
  184 + if(e.detail.value[0]<0) return;
184 this.setData({ 185 this.setData({
185 pickerValue:e.detail.value, 186 pickerValue:e.detail.value,
186 timeStr:util.unixtoTime(this.getTimeStr(e.detail.value),this.data.tpl.timeStr) 187 timeStr:util.unixtoTime(this.getTimeStr(e.detail.value),this.data.tpl.timeStr)
@@ -277,7 +278,7 @@ Page({ @@ -277,7 +278,7 @@ Page({
277 ...this.data.options, 278 ...this.data.options,
278 },'./review') 279 },'./review')
279 }) 280 })
280 - }) 281 + }).catch(()=>{})
281 }, 282 },
282 chooseImage(){ 283 chooseImage(){
283 wx.chooseImage({ 284 wx.chooseImage({
@@ -122,7 +122,7 @@ Page({ @@ -122,7 +122,7 @@ Page({
122 } 122 }
123 App.Invitation.SetSellerInfo(param).then(res=>{ 123 App.Invitation.SetSellerInfo(param).then(res=>{
124 wx.navigateBack(); 124 wx.navigateBack();
125 - }) 125 + }).catch(()=>{})
126 }, 126 },
127 onChangeAddress(){ 127 onChangeAddress(){
128 wx.chooseLocation({ 128 wx.chooseLocation({
@@ -10,6 +10,9 @@ Page({ @@ -10,6 +10,9 @@ Page({
10 data: { 10 data: {
11 hasSellerBook:false, 11 hasSellerBook:false,
12 hasManagerInvitation:false, 12 hasManagerInvitation:false,
  13 + extraData:{
  14 + id:55214,
  15 + }
13 }, 16 },
14 /** 17 /**
15 * 生命周期函数--监听页面加载 18 * 生命周期函数--监听页面加载
@@ -78,5 +81,10 @@ Page({ @@ -78,5 +81,10 @@ Page({
78 81
79 }) 82 })
80 83
  84 + },
  85 + gotoList(e){
  86 + wx.navigateTo({
  87 + url:'/pages/me/list?type='+util.attr(e,'type')
  88 + })
81 } 89 }
82 }) 90 })
1 { 1 {
2 "navigationBarBackgroundColor": "#ffffff", 2 "navigationBarBackgroundColor": "#ffffff",
3 - "navigationBarTextStyle": "black", 3 + "navigationBarTextStyle": "white",
4 "navigationBarTitleText":"我的", 4 "navigationBarTitleText":"我的",
5 "usingComponents": { 5 "usingComponents": {
6 "nav":"/components/nav/nav", 6 "nav":"/components/nav/nav",
1 <!--pages/me/index.wxml--> 1 <!--pages/me/index.wxml-->
2 -<nav>周到安排</nav>  
3 -<view class="page">  
4 - <view class="header flex-ll"> 2 +<nav backgroundColor="#262628" color="#ffffff">周到安排</nav>
  3 +<layout>
  4 + <view class="meHeader flex-ll" >
5 <view class="avatar"> 5 <view class="avatar">
6 <open-data type="userAvatarUrl"></open-data> 6 <open-data type="userAvatarUrl"></open-data>
7 </view> 7 </view>
@@ -10,51 +10,83 @@ @@ -10,51 +10,83 @@
10 <view class="info">查看并编辑个人资料</view> 10 <view class="info">查看并编辑个人资料</view>
11 </view> 11 </view>
12 </view> 12 </view>
13 - <view class="shadow" >  
14 - <view class="shadow-mask" ></view>  
15 - </view>  
16 -  
17 - <view class="list">  
18 - <formids url="/pages/me/list">  
19 - <view class="item flex-lr">  
20 - <view class="left">我的订单</view>  
21 - <view class="right">  
22 - <image src="http://qn.colorcun.com/custom/lite-yd/image/click.png"></image> 13 + <view class="pages">
  14 + <view class="block-rev">
  15 + <navigator url="/pages/me/list">
  16 + <view class="title flex-lr">
  17 + <view >我的订单</view>
  18 + <view class="more"></view>
23 </view> 19 </view>
24 - </view>  
25 - </formids>  
26 - <!-- <formids url="/pages/me/setting">  
27 - <view class="item flex-lr">  
28 - <view class="left">常用信息</view>  
29 - <view class="right">  
30 - <image src="http://qn.colorcun.com/custom/lite-yd/image/click.png"></image> 20 + </navigator>
  21 + <view class="content flex-ll">
  22 + <view class="flex-vc" bindtap="gotoList" data-type="1">
  23 + <view class="icon o1"></view>
  24 + <view class="text">等待确认</view>
31 </view> 25 </view>
32 - </view>  
33 - </formids> -->  
34 - <formids url="/pages/me/concat">  
35 - <view class="item flex-lr">  
36 - <view class="left">常用联系人</view>  
37 - <view class="right">  
38 - <image src="http://qn.colorcun.com/custom/lite-yd/image/click.png"></image>  
39 - </view>  
40 - </view>  
41 - </formids>  
42 - <formids bindclick="gotoSellerBook" wx:if="{{hasSellerBook}}">  
43 - <view class="item flex-lr">  
44 - <view class="left">切换到商户模式</view>  
45 - <view class="right">  
46 - <image src="http://qn.colorcun.com/custom/lite-yd/image/click.png"></image> 26 + <view class="flex-vc" bindtap="gotoList" data-type="2">
  27 + <view class="icon o2"></view>
  28 + <view class="text">预订成功</view>
  29 + </view>
  30 + <view class="flex-vc" bindtap="gotoList" data-type="3">
  31 + <view class="icon o3"></view>
  32 + <view class="text">历史订单</view>
  33 + </view>
  34 + <view class="flex-vc" bindtap="gotoList" data-type="4">
  35 + <view class="icon o4"></view>
  36 + <view class="text">无效预订</view>
47 </view> 37 </view>
48 </view> 38 </view>
49 - </formids>  
50 - <formids url="/pages/manager-invitation/index" wx:if="{{hasManagerInvitation}}">  
51 - <view class="item flex-lr">  
52 - <view class="left">客户经理模式</view>  
53 - <view class="right">  
54 - <image src="http://qn.colorcun.com/custom/lite-yd/image/click.png"></image> 39 + </view>
  40 + <view class="block-rev">
  41 + <view class="title flex-lr">
  42 + <view >常用操作</view>
  43 + </view>
  44 + <view class="content flex-ll">
  45 + <navigator class="flex-vc" url="/pages/me/concat">
  46 + <view class="icon picon p1"></view>
  47 + <view class="text">常用联系人</view>
  48 + </navigator>
  49 + <view class="flex-vc" bindtap="gotoSellerBook" wx:if="{{hasSellerBook}}">
  50 + <view class="icon picon p2"></view>
  51 + <view class="text">商户模式</view>
55 </view> 52 </view>
  53 + <navigator class="flex-vc"
  54 + open-type="redirect"
  55 + url="/pages/manager-invitation/index" wx:if="{{hasManagerInvitation}}">
  56 + <view class="icon picon p3"></view>
  57 + <view class="text">客户经理模式</view>
  58 + </navigator>
56 </view> 59 </view>
57 - </formids> 60 + </view>
  61 + <view class="block-list">
  62 + <button class="button-none"
  63 + open-type="contact">
  64 + <view class="item flex-lr item-border">
  65 + <view class="item-name flex-ll">
  66 + <view class="kefu"></view>
  67 + <view>联系客服</view>
  68 + </view>
  69 + <view class="item-info flex-rr">
  70 + <view>09:00~21:00</view>
  71 + <view class="more"></view>
  72 + </view>
  73 + </view>
  74 + </button>
  75 + <navigator
  76 + target="miniProgram"
  77 + open-type="navigate"
  78 + app-id="wx8abaf00ee8c3202e"
  79 + extra-data="{{extraData}}"
  80 + version="release">
  81 + <view class="item flex-lr">
  82 + <view class="item-name flex-ll">
  83 + <view class="tuco"></view>
  84 + <view>我要吐槽</view>
  85 + </view>
  86 + <view class="more"></view>
  87 + </view>
  88 + </navigator>
  89 + </view>
58 </view> 90 </view>
59 -</view>  
60 -<fb></fb> 91 +</layout>
  92 +<fb></fb>
1 /* pages/me/index.wxss */ 1 /* pages/me/index.wxss */
2 -.page{  
3 - width: 90%;  
4 - margin: 0 5%; 2 +page{
  3 + background-color: #F5F5F5;
  4 +}
  5 +.pages{
  6 + width: calc(100% - 40rpx);
  7 + margin: -24rpx 20rpx 40rpx;
5 color:#353535; 8 color:#353535;
6 - background-color: #ffffff;  
7 } 9 }
8 image{ 10 image{
9 width:100%; 11 width:100%;
10 height: 100%; 12 height: 100%;
11 display: inherit; 13 display: inherit;
12 } 14 }
13 -.header{  
14 - margin-top: 76rpx;  
15 - padding-bottom: 54rpx;  
16 -  
17 -}  
18 -.shadow{  
19 - height: 0rpx;  
20 - margin-left: -5%;  
21 - width: 110%;  
22 - box-shadow: 0 12rpx 14rpx 14rpx RGBA(231, 228, 228, 0.5);  
23 - margin-bottom: 98rpx;  
24 - position: relative;  
25 -}  
26 -.shadow-mask{  
27 - position: relative;  
28 - top:-7rpx;  
29 - height: 20rpx;  
30 - left:-2rpx;  
31 - width: 110%;  
32 - background-color: #ffffff; 15 +.meHeader{
  16 + padding-top: 26rpx;
  17 + padding-bottom: 64rpx;
  18 + padding-left: 40rpx;
  19 + background-color: #262628;
  20 + color:#fff;
  21 + box-sizing: border-box;
  22 + margin-top: -10rpx;
33 } 23 }
34 .avatar{ 24 .avatar{
35 width: 80rpx; 25 width: 80rpx;
@@ -47,16 +37,113 @@ image{ @@ -47,16 +37,113 @@ image{
47 font-size: 26rpx; 37 font-size: 26rpx;
48 margin-top: 4rpx; 38 margin-top: 4rpx;
49 } 39 }
  40 +.block-rev{
  41 + height: 300rpx;
  42 + box-sizing: border-box;
  43 + width: 100%;
  44 + background:rgba(255,255,255,1);
  45 + border-radius:10rpx;
  46 + margin-bottom: 20rpx;
  47 +}
  48 +.block-rev .title{
  49 + box-sizing: border-box;
  50 + height: 100rpx;
  51 + line-height: 100rpx;
  52 + border-bottom: 2rpx solid #F5F5F5;
  53 + width: calc(100% - 80rpx);
  54 + margin: 0 auto;
  55 + font-size:30rpx;
  56 + font-weight:600;
  57 +}
  58 +.block-rev .content{
  59 + height: 198rpx;
  60 + box-sizing: border-box;
  61 + font-size: 24rpx;
  62 +}
  63 +.content .flex-vc{
  64 + width: 25%;
  65 + min-width: 25%;
  66 +}
  67 +
  68 +.block-rev .icon{
  69 + width:36rpx;
  70 + height:42rpx;
  71 + background-size: 100% 100%;
  72 + margin-bottom: 20rpx;
  73 +}
  74 +.icon.o1{
  75 + background-image: url("http://qn.colorcun.com/custom/me/image/o1.png");
  76 +}
  77 +.icon.o2{
  78 + background-image: url("http://qn.colorcun.com/custom/me/image/o2.png");
  79 +}
  80 +.icon.o3{
  81 + background-image: url("http://qn.colorcun.com/custom/me/image/o3.png");
  82 +}
  83 +.icon.o4{
  84 + background-image: url("http://qn.colorcun.com/custom/me/image/o4.png");
  85 +}
  86 +.block-rev .picon{
  87 + width:38rpx;
  88 + height:38rpx;
  89 +}
  90 +.picon.p1{
  91 + background-image: url("http://qn.colorcun.com/custom/me/image/p1.png");
  92 +}
  93 +.picon.p2{
  94 + background-image: url("http://qn.colorcun.com/custom/me/image/p2.png");
  95 +}
  96 +.picon.p3{
  97 + background-image: url("http://qn.colorcun.com/custom/me/image/p3.png");
  98 +}
  99 +.block-rev .width3{
  100 + width: 75%;
  101 +}
  102 +
  103 +
  104 +
  105 +.block-list{
  106 + box-sizing: border-box;
  107 + width: 100%;
  108 + background:rgba(255,255,255,1);
  109 + border-radius:10rpx;
  110 + padding: 0 40rpx;
  111 +}
50 .item{ 112 .item{
51 height: 107rpx; 113 height: 107rpx;
52 line-height: 107rpx; 114 line-height: 107rpx;
53 font-size: 30rpx; 115 font-size: 30rpx;
  116 + box-sizing: border-box;
  117 +}
  118 +.item-border{
  119 + border-bottom: 2rpx solid #F5F5F5;
  120 +}
  121 +.item-name{
  122 + height:42rpx;
  123 + font-size:30rpx;
  124 + color:rgba(53,53,53,1);
  125 + line-height:42rpx;
  126 +}
  127 +.item-info{
  128 + height:34rpx;
  129 + font-size:24rpx;
  130 + color:rgba(53,53,53,1);
  131 + line-height:34rpx;
54 } 132 }
55 -.item .left{  
56 - height: 42rpx;  
57 - line-height: 42rpx; 133 +.item-info .more{
  134 + margin-left: 20rpx;
58 } 135 }
59 -.item .right{  
60 - width: 12rpx;  
61 - height: 22rpx; 136 +.item-name .kefu{
  137 + width: 32rpx;
  138 + height:30rpx;
  139 + background-size: 100%;
  140 + background-image: url("http://qn.colorcun.com/custom/me/image/l1.png");
  141 + margin-right: 20rpx;
  142 +}
  143 +.item-name .tuco{
  144 + width: 34rpx;
  145 + height:26rpx;
  146 + background-size: 100%;
  147 + background-image: url("http://qn.colorcun.com/custom/me/image/l2.png");
  148 + margin-right: 20rpx;
62 } 149 }
@@ -10,7 +10,7 @@ Page({ @@ -10,7 +10,7 @@ Page({
10 * 页面的初始数据 10 * 页面的初始数据
11 */ 11 */
12 data: { 12 data: {
13 - list: [], 13 + list: [[],[],[],[],[]],
14 total: 0, 14 total: 0,
15 tabType:1, 15 tabType:1,
16 hasMore:true, 16 hasMore:true,
@@ -24,6 +24,12 @@ Page({ @@ -24,6 +24,12 @@ Page({
24 * 生命周期函数--监听页面加载 24 * 生命周期函数--监听页面加载
25 */ 25 */
26 onLoad: function (options) { 26 onLoad: function (options) {
  27 + if(options.type){
  28 + this.tabType=options.type
  29 + this.setData({
  30 + tabType:this.tabType
  31 + })
  32 + }
27 this.selectComponent('#getpos').getPos(); 33 this.selectComponent('#getpos').getPos();
28 }, 34 },
29 35
@@ -55,8 +61,9 @@ Page({ @@ -55,8 +61,9 @@ Page({
55 61
56 }, 62 },
57 getListData() { 63 getListData() {
  64 + let tabType=this.tabType
58 App.Customer.GetMyOrder({ 65 App.Customer.GetMyOrder({
59 - type: this.tabType, 66 + type: tabType,
60 openid: getApp().openid, 67 openid: getApp().openid,
61 offset:this.offset, 68 offset:this.offset,
62 limit:this.limit, 69 limit:this.limit,
@@ -68,7 +75,7 @@ Page({ @@ -68,7 +75,7 @@ Page({
68 this.offset+=this.limit 75 this.offset+=this.limit
69 } 76 }
70 this.setData({ 77 this.setData({
71 - list: this.data.list.concat(data), 78 + [`list[`+tabType+`]`]: this.data.list[tabType].concat(data),
72 hasMore:this.hasMore 79 hasMore:this.hasMore
73 }) 80 })
74 if(res.data.length==0){ 81 if(res.data.length==0){
@@ -129,7 +136,7 @@ Page({ @@ -129,7 +136,7 @@ Page({
129 this.tabType=util.attr(e,'type') 136 this.tabType=util.attr(e,'type')
130 this.setData({ 137 this.setData({
131 tabType:this.tabType, 138 tabType:this.tabType,
132 - list: [], 139 + list: [[],[],[],[],[]],
133 hasMore:false 140 hasMore:false
134 }) 141 })
135 this.getListData() 142 this.getListData()
@@ -7,14 +7,14 @@ @@ -7,14 +7,14 @@
7 <view class="item {{tabType==4?'active':''}}" data-type="4" bindtap="switchType">无效预订</view> 7 <view class="item {{tabType==4?'active':''}}" data-type="4" bindtap="switchType">无效预订</view>
8 </view> 8 </view>
9 <view class="page"> 9 <view class="page">
10 - <block wx:if="{{list.length==0}}"> 10 + <block wx:if="{{list[tabType].length==0}}">
11 <view class="flex-vc empry"> 11 <view class="flex-vc empry">
12 <image src="http://qn.colorcun.com/reserve/images/order-empty.png"></image> 12 <image src="http://qn.colorcun.com/reserve/images/order-empty.png"></image>
13 <view class="Medium">暂无订单</view> 13 <view class="Medium">暂无订单</view>
14 </view> 14 </view>
15 </block> 15 </block>
16 <block wx:else=""> 16 <block wx:else="">
17 - <block wx:for="{{list}}" wx:key="success.key" wx:for-item="detail" wx:for-index="dateIndex"> 17 + <block wx:for="{{list[tabType]}}" wx:key="success.key" wx:for-item="detail" wx:for-index="dateIndex">
18 <view class="card"> 18 <view class="card">
19 <card 19 <card
20 hasShowStatus bindevent="gotoDetail" 20 hasShowStatus bindevent="gotoDetail"
@@ -23,7 +23,7 @@ @@ -23,7 +23,7 @@
23 </block> 23 </block>
24 </block> 24 </block>
25 </view> 25 </view>
26 -<block wx:if="{{list.length==0 && rsl.length>0}}"> 26 +<block wx:if="{{list[tabType].length==0 && rsl.length>0}}">
27 <view class="rsl-block"> 27 <view class="rsl-block">
28 <view class="line-push">为你推荐</view> 28 <view class="line-push">为你推荐</view>
29 <view class="transverse-list"> 29 <view class="transverse-list">
@@ -110,7 +110,7 @@ @@ -110,7 +110,7 @@
110 } 110 }
111 111
112 .line-push{ 112 .line-push{
113 - background-image: url("https://qn.colorcun.com/reserve/images/line-push.png"); 113 + background-image: url("http://qn.colorcun.com/reserve/images/line-push.png");
114 width: 328rpx; 114 width: 328rpx;
115 height: 42rpx; 115 height: 42rpx;
116 background-size: 100% 24rpx; 116 background-size: 100% 24rpx;
@@ -79,7 +79,7 @@ Page({ @@ -79,7 +79,7 @@ Page({
79 } 79 }
80 } 80 }
81 wx.navigateBack() 81 wx.navigateBack()
82 - }) 82 + }).catch(()=>{})
83 }, 83 },
84 changeInput(e) { 84 changeInput(e) {
85 console.log(e) 85 console.log(e)
@@ -159,7 +159,7 @@ Page({ @@ -159,7 +159,7 @@ Page({
159 phoneNumber:'400-000-9690' 159 phoneNumber:'400-000-9690'
160 }) 160 })
161 }else{ 161 }else{
162 - let seller_tel=this.data.seller.seller_tel 162 + let seller_tel=this.data.seller.seller_tel||[]
163 if(seller_tel.length<1) return util.toast('商家电话错误','none') 163 if(seller_tel.length<1) return util.toast('商家电话错误','none')
164 if(seller_tel.length==1){//只有一个电话 164 if(seller_tel.length==1){//只有一个电话
165 let phone=seller_tel[0].replace(/[^\d]/,'') 165 let phone=seller_tel[0].replace(/[^\d]/,'')
@@ -533,7 +533,7 @@ @@ -533,7 +533,7 @@
533 height: 70rpx; 533 height: 70rpx;
534 background-size: 40rpx 36rpx; 534 background-size: 40rpx 36rpx;
535 background-position: center center; 535 background-position: center center;
536 - background-image: url("https://qn.colorcun.com/reserve/images/sphone.png"); 536 + background-image: url("http://qn.colorcun.com/reserve/images/sphone.png");
537 } 537 }
538 .reserve-button{ 538 .reserve-button{
539 width:680rpx; 539 width:680rpx;
@@ -15,7 +15,7 @@ const renNum=function(){ @@ -15,7 +15,7 @@ const renNum=function(){
15 } 15 }
16 return arr; 16 return arr;
17 } 17 }
18 -const cates_version='?1.1'; 18 +const cates_version='?1.2';
19 const hasSellerConcat=false;//变量存储所有商户 19 const hasSellerConcat=false;//变量存储所有商户
20 const def_latitude=39.684670; 20 const def_latitude=39.684670;
21 const def_longitude=118.176300; 21 const def_longitude=118.176300;
@@ -26,8 +26,8 @@ Page({ @@ -26,8 +26,8 @@ Page({
26 */ 26 */
27 data: { 27 data: {
28 map: { 28 map: {
29 - latitude: def_latitude,  
30 - longitude: def_longitude, 29 + latitude: def_latitude+0.0001,
  30 + longitude: def_longitude+0.0001,
31 scale: mapScale, 31 scale: mapScale,
32 height: 300, 32 height: 300,
33 }, 33 },
@@ -49,6 +49,7 @@ Page({ @@ -49,6 +49,7 @@ Page({
49 {id:3,name:'超大包间'}, 49 {id:3,name:'超大包间'},
50 ], 50 ],
51 listMoreCount:0, 51 listMoreCount:0,
  52 + hasSearchLimit:false,
52 }, 53 },
53 hasClickMoveToLocation:false,//点击回到我的位置 54 hasClickMoveToLocation:false,//点击回到我的位置
54 hasSellerConcat:hasSellerConcat, 55 hasSellerConcat:hasSellerConcat,
@@ -183,7 +184,7 @@ Page({ @@ -183,7 +184,7 @@ Page({
183 this.selectComponent('#getpos').getPos(); 184 this.selectComponent('#getpos').getPos();
184 if(!this.hasClickMoveToLocation){ 185 if(!this.hasClickMoveToLocation){
185 //this.getMarkers(); 186 //this.getMarkers();
186 - this.timeoutGetMarkers(); 187 + //this.timeoutGetMarkers();
187 } 188 }
188 189
189 }, 190 },
@@ -244,20 +245,24 @@ Page({ @@ -244,20 +245,24 @@ Page({
244 sdobj.markers=[] 245 sdobj.markers=[]
245 } 246 }
246 this.setData(sdobj) 247 this.setData(sdobj)
  248 + this.timeoutGetMarkers()
  249 + /*
247 if(this.mapCtx){ 250 if(this.mapCtx){
248 //this.mapCtx.moveToLocation(); 251 //this.mapCtx.moveToLocation();
249 this.mapCtx.getRegion({ 252 this.mapCtx.getRegion({
250 success:(res)=>{ 253 success:(res)=>{
251 console.log('onpos.getRegion',res) 254 console.log('onpos.getRegion',res)
252 - //if(res.southwest.latitude!=this.mapData.region.southwest.latitude) {  
253 - this.mapData.region = res  
254 - //this.getMarkers();  
255 - //} 255 + if(this.mapData.region.southwest.latitude) {
  256 + this.mapData.region = res
  257 + this.timeoutGetMarkers()
  258 + }
256 }, 259 },
257 }) 260 })
258 } 261 }
  262 + */
259 }, 263 },
260 regionchange(e){ 264 regionchange(e){
  265 + if(e.type!='end') return;
261 console.log('regionchange', e) 266 console.log('regionchange', e)
262 if(typeof this.mapCtx=='undefined' || !this.mapCtx) return; 267 if(typeof this.mapCtx=='undefined' || !this.mapCtx) return;
263 this.getClassNameFlag=true; 268 this.getClassNameFlag=true;
@@ -282,7 +287,9 @@ Page({ @@ -282,7 +287,9 @@ Page({
282 success:(res)=>{ 287 success:(res)=>{
283 console.log('regionchange.getRegion',res.southwest.latitude,this.mapData.region.southwest.latitude,res) 288 console.log('regionchange.getRegion',res.southwest.latitude,this.mapData.region.southwest.latitude,res)
284 this.hasClickMoveToLocation=false 289 this.hasClickMoveToLocation=false
285 - this.mapData.region = res 290 + if(res.southwest.latitude) {
  291 + this.mapData.region = res
  292 + };
286 this.timeoutGetMarkers(); 293 this.timeoutGetMarkers();
287 }, 294 },
288 }) 295 })
@@ -295,7 +302,7 @@ Page({ @@ -295,7 +302,7 @@ Page({
295 } 302 }
296 this.setTimeoutGetMarkers=setTimeout(()=>{ 303 this.setTimeoutGetMarkers=setTimeout(()=>{
297 this.getMarkers(); 304 this.getMarkers();
298 - },500) 305 + },300)
299 }, 306 },
300 mapUpdated(e){ 307 mapUpdated(e){
301 console.log('mapUpdated', e) 308 console.log('mapUpdated', e)
@@ -320,18 +327,16 @@ Page({ @@ -320,18 +327,16 @@ Page({
320 }); 327 });
321 this.mapCtx.getRegion({ 328 this.mapCtx.getRegion({
322 success:(res)=>{ 329 success:(res)=>{
323 - console.log('mapUpdated.getRegion',res)  
324 - //if(res.southwest.latitude!=this.mapData.region.southwest.latitude){  
325 - this.mapData.region=res  
326 - //this.getMarkers();  
327 - //}  
328 - 330 + if(this.mapData.region.southwest.latitude=='' || !res.southwest.latitude) return;
  331 + console.log('mapUpdated.getRegion',[res.southwest.latitude,this.mapData.region.southwest.latitude])
  332 + this.mapData.region=res
  333 + //this.timeoutGetMarkers();
329 }, 334 },
330 }) 335 })
331 }, 336 },
332 hasMarkertap:false, 337 hasMarkertap:false,
333 markertap(e,flag=true){ 338 markertap(e,flag=true){
334 - if(e.markerId=='location')return; 339 + if(e.markerId=='location' || e.markerId=='locationMe')return;
335 this.hasMarkertap=false 340 this.hasMarkertap=false
336 let markers=this.data.markers; 341 let markers=this.data.markers;
337 console.log('markertap',e) 342 console.log('markertap',e)
@@ -457,11 +462,17 @@ Page({ @@ -457,11 +462,17 @@ Page({
457 if(tags.length>0){ 462 if(tags.length>0){
458 param.tags=tags; 463 param.tags=tags;
459 } 464 }
  465 + if(param.lat){
  466 + param.centre_pos=`${param.lat},${param.lng}`
  467 + }
  468 + if(this.data.hasSuggestion){
  469 + param.centre_pos=`${this.data.suggestion.latitude},${this.data.suggestion.longitude}`
  470 + }
460 this.selectComponent('#list').getList(param); 471 this.selectComponent('#list').getList(param);
461 this.param=param; 472 this.param=param;
462 let now_sid=[]; 473 let now_sid=[];
463 - App.Customer.SellerList(param).then(res => {  
464 - this.mapData.region.southwest.latitude=''; 474 + App.Customer.SellerList(param).then(async res => {
  475 + //this.mapData.region.southwest.latitude='';
465 if (res.ret == 200) { 476 if (res.ret == 200) {
466 let sellersList=res.data; 477 let sellersList=res.data;
467 let sellersLength=sellersList.length; 478 let sellersLength=sellersList.length;
@@ -496,7 +507,7 @@ Page({ @@ -496,7 +507,7 @@ Page({
496 seller:seller, 507 seller:seller,
497 }; 508 };
498 marker.callout={ 509 marker.callout={
499 - content: ' ' + seller.sellername + ' ', 510 + content: ' ' + seller.sellername + ' ',
500 color: '#353535', 511 color: '#353535',
501 fontSize: 12, 512 fontSize: 12,
502 borderWidth: 1, 513 borderWidth: 1,
@@ -537,7 +548,8 @@ Page({ @@ -537,7 +548,8 @@ Page({
537 this.sellersNow=now_sid; 548 this.sellersNow=now_sid;
538 let obj={ 549 let obj={
539 hasSellers:now_sid.length>0, 550 hasSellers:now_sid.length>0,
540 - hasGetSellersEnd:true 551 + hasGetSellersEnd:true,
  552 + hasSearchLimit:tags.length>0 || this.data.multiIndex[0]>0
541 } 553 }
542 if(this.hasSellerConcat){ 554 if(this.hasSellerConcat){
543 obj.markers=this.data.markers.concat(markers); 555 obj.markers=this.data.markers.concat(markers);
@@ -550,7 +562,7 @@ Page({ @@ -550,7 +562,7 @@ Page({
550 mk.display=''; 562 mk.display='';
551 } 563 }
552 }) 564 })
553 - obj.markers=this.setLocationMarker(obj.markers); 565 + obj.markers=await this.setLocationMarker(obj.markers);
554 this.setData(obj) 566 this.setData(obj)
555 if(now_sid.length>0) { 567 if(now_sid.length>0) {
556 setTimeout(() => { 568 setTimeout(() => {
@@ -689,7 +701,7 @@ Page({ @@ -689,7 +701,7 @@ Page({
689 }) 701 })
690 }, 702 },
691 a2lshow(e){ 703 a2lshow(e){
692 - console.log('a2lshow',e) 704 + //console.log('a2lshow',e)
693 let ds=this.selectComponent('#ds'); 705 let ds=this.selectComponent('#ds');
694 if(!ds){ 706 if(!ds){
695 return setTimeout(()=>{ 707 return setTimeout(()=>{
@@ -698,17 +710,54 @@ Page({ @@ -698,17 +710,54 @@ Page({
698 } 710 }
699 ds.setA2LHeight(e.type=='hide'?0:40); 711 ds.setA2LHeight(e.type=='hide'?0:40);
700 }, 712 },
701 - setLocationMarker(markers){ 713 + async setMapRegion(){
  714 + return new Promise((success,fail)=>{
  715 + if(this.mapCtx){
  716 + this.mapCtx.getRegion({
  717 + success:(res)=>{
  718 + if(res.southwest.latitude) {
  719 + this.mapData.region = res
  720 + success()
  721 + }
  722 + },
  723 + fail:()=>{
  724 + fail()
  725 + }
  726 + })
  727 + }else{
  728 + fail()
  729 + }
  730 + })
  731 + },
  732 + async setLocationMarker(markers){
  733 + try{
  734 + await this.setMapRegion();
  735 + }catch (e){
  736 + this.timeoutGetMarkers()
  737 + return []
  738 + }
  739 +
  740 + let map = this.mapData;
702 let mks=[] 741 let mks=[]
  742 + let matchPosNum=1
703 if(markers.length>0){ 743 if(markers.length>0){
704 markers.forEach(mk=>{ 744 markers.forEach(mk=>{
705 - if(mk.id!='location'){ 745 + if(mk.id!='location' && mk.id!='locationMe'
  746 + && mk.latitude>map.region.southwest.latitude
  747 + && mk.longitude>map.region.southwest.longitude
  748 + && mk.latitude<map.region.northeast.latitude
  749 + && mk.longitude<map.region.northeast.longitude){
706 mks.push(mk); 750 mks.push(mk);
707 } 751 }
708 }) 752 })
709 } 753 }
710 - //if(this.data.hasSuggestion){  
711 - let map = this.data.map; 754 + if(mks.length-markers.length<0){
  755 + this.timeoutGetMarkers()
  756 + return []
  757 + }
  758 +
  759 + if(this.data.hasSuggestion){
  760 + map=this.data.suggestion
712 mks.push({ 761 mks.push({
713 id: 'location', 762 id: 'location',
714 iconPath: "http://qn.colorcun.com/reserve/images/location.png"+cates_version, 763 iconPath: "http://qn.colorcun.com/reserve/images/location.png"+cates_version,
@@ -717,10 +766,19 @@ Page({ @@ -717,10 +766,19 @@ Page({
717 width: 20, 766 width: 20,
718 height: 25, 767 height: 25,
719 }) 768 })
720 - //} 769 + }
  770 + mks.push({
  771 + id: 'locationMe',
  772 + iconPath: "http://qn.colorcun.com/reserve/images/lme.png"+cates_version,
  773 + latitude: this.user.latitude,
  774 + longitude: this.user.longitude,
  775 + width: 18,
  776 + height: 30,
  777 + })
721 return mks; 778 return mks;
722 }, 779 },
723 tagsChange(e){ 780 tagsChange(e){
  781 + if(this.data.listMoreCount<1 && !this.data.hasSearchLimit) return
724 let id=util.attr(e,'id'); 782 let id=util.attr(e,'id');
725 let tags=this.data.tags; 783 let tags=this.data.tags;
726 let activeNum=0; 784 let activeNum=0;
@@ -758,6 +816,7 @@ Page({ @@ -758,6 +816,7 @@ Page({
758 }) 816 })
759 }, 817 },
760 caixiShow(){ 818 caixiShow(){
  819 + if(this.data.listMoreCount<1 && !this.data.hasSearchLimit) return
761 this.selectComponent('#caixi').show(); 820 this.selectComponent('#caixi').show();
762 }, 821 },
763 listEvent(e){ 822 listEvent(e){
@@ -782,7 +841,27 @@ Page({ @@ -782,7 +841,27 @@ Page({
782 map:this.param.map, 841 map:this.param.map,
783 multiIndex:this.data.multiIndex, 842 multiIndex:this.data.multiIndex,
784 tags:this.param.tags, 843 tags:this.param.tags,
  844 + centre_pos:this.param.centre_pos,
  845 + hasSuggestion:this.data.hasSuggestion?1:''
785 },'./indexList') 846 },'./indexList')
786 }); 847 });
787 }, 848 },
  849 + setTSLocal(){
  850 + let map=this.data.map;
  851 + map.latitude=def_latitude
  852 + map.longitude=def_longitude
  853 + map.scale=mapScale
  854 + this.sellersIds=[]
  855 + this.sellers=[]
  856 + let sdobj={
  857 + map: map,
  858 + hasGetSellersEnd:false,
  859 + hasSuggestion:false,
  860 + suggestion:{},
  861 + }
  862 + if(!this.hasSellerConcat){
  863 + sdobj.markers=[]
  864 + }
  865 + this.setData(sdobj)
  866 + },
788 }) 867 })
@@ -13,9 +13,8 @@ @@ -13,9 +13,8 @@
13 enable-zoom 13 enable-zoom
14 enable-scroll 14 enable-scroll
15 enable-rotate 15 enable-rotate
16 - show-compass  
17 subkey="SDEBZ-I74W4-QLGUX-XXYXU-HIR23-3QFBJ" 16 subkey="SDEBZ-I74W4-QLGUX-XXYXU-HIR23-3QFBJ"
18 - style="width: 100%; height: {{map.height}}px;"></map> 17 + style="width: 100%; height: {{map.height+30}}px;"></map>
19 <formids url="/pages/reserve/search" style="position: fixed;"> 18 <formids url="/pages/reserve/search" style="position: fixed;">
20 <cover-view 19 <cover-view
21 class="flex-ll" 20 class="flex-ll"
@@ -31,11 +30,13 @@ @@ -31,11 +30,13 @@
31 </cover-view> 30 </cover-view>
32 </formids> 31 </formids>
33 </view> 32 </view>
34 - <view class="seller-view">  
35 - <cover-view class="flex-vc transverse-view-top" bindtap="listShow"> 33 + <view class="seller-view {{(listMoreCount<1)?(hasSearchLimit?'disabled enabled':'disabled'):''}}">
  34 + <cover-view class="toast" wx:if="{{hasGetSellersEnd && listMoreCount<1 && !hasSearchLimit && markers.length<2}}">该地区没有可供预订的餐厅哦!努力开通中</cover-view>
  35 + <cover-view class="toast" wx:if="{{hasGetSellersEnd && markers.length<2 && listMoreCount>0}}">移动或缩放地图,获取更多餐厅</cover-view>
  36 + <cover-view class="flex-vc transverse-view-top" bindtap="listShow" wx:if="{{hasGetSellersEnd && listMoreCount>0}}">
36 <cover-view class="line"></cover-view> 37 <cover-view class="line"></cover-view>
37 <cover-view class="text"> 38 <cover-view class="text">
38 - <cover-view wx:if="{{hasGetSellersEnd}}">{{hasSellers?'查看其它':'已扩大范围为你找到'}}{{listMoreCount}}家餐厅</cover-view> 39 + <cover-view>{{hasSellers?'查看其它':'已扩大范围为你找到'}}{{listMoreCount}}家餐厅</cover-view>
39 </cover-view> 40 </cover-view>
40 </cover-view> 41 </cover-view>
41 <view class="transverse-search flex-ll"> 42 <view class="transverse-search flex-ll">
@@ -63,13 +64,14 @@ @@ -63,13 +64,14 @@
63 interval="2000" duration="500" 64 interval="2000" duration="500"
64 previous-margin="{{15}}px" next-margin="{{15}}px" style="height: 350rpx;" 65 previous-margin="{{15}}px" next-margin="{{15}}px" style="height: 350rpx;"
65 current="{{current}}" bindchange="bindtransition" hidden="{{!hasSellers}}"> 66 current="{{current}}" bindchange="bindtransition" hidden="{{!hasSellers}}">
66 - <block wx:for="{{markers}}" wx:key="markers.key" wx:if="{{item.id!='location'}}"> 67 + <block wx:for="{{markers}}" wx:key="markers.key" wx:if="{{item.id!='location' && item.id!='locationMe'}}">
67 <swiper-item bindtap="gotoDetail" data-sid="{{item.id}}" wx:if="{{item.display!='none'}}"> 68 <swiper-item bindtap="gotoDetail" data-sid="{{item.id}}" wx:if="{{item.display!='none'}}">
68 <view class="seller" id="seller-{{item.id}}"> 69 <view class="seller" id="seller-{{item.id}}">
69 <sb-tr seller="{{item.seller}}" 70 <sb-tr seller="{{item.seller}}"
70 hasActivityTags="{{false}}" 71 hasActivityTags="{{false}}"
71 hasActivityShort="{{true}}" 72 hasActivityShort="{{true}}"
72 hasBrand="true" hasActivityTese="true" 73 hasBrand="true" hasActivityTese="true"
  74 + hasSuggestion="{{hasSuggestion}}"
73 hasSlogan="{{false}}"></sb-tr> 75 hasSlogan="{{false}}"></sb-tr>
74 </view> 76 </view>
75 </swiper-item> 77 </swiper-item>
@@ -88,14 +90,25 @@ @@ -88,14 +90,25 @@
88 </swiper> 90 </swiper>
89 <view class="empty-txt flex-vc"> 91 <view class="empty-txt flex-vc">
90 <view class="seller" wx:if="{{hasGetSellersEnd}}"> 92 <view class="seller" wx:if="{{hasGetSellersEnd}}">
91 - <view class="empty" bindtap="listShow">  
92 - <view class="info"> 93 + <view class="empty">
  94 + <view class="info" wx:if="{{listMoreCount>0}}" bindtap="listShow">
93 <view class="info-msg Semibold">已扩大范围为你找到餐厅</view> 95 <view class="info-msg Semibold">已扩大范围为你找到餐厅</view>
94 <view class="info-button flex-lr"> 96 <view class="info-button flex-lr">
95 <view>去挑选</view> 97 <view>去挑选</view>
96 <view class="info-button-gt"></view> 98 <view class="info-button-gt"></view>
97 </view> 99 </view>
98 </view> 100 </view>
  101 + <view class="info" wx:elif="{{hasSearchLimit}}">
  102 + <view class="info-msg Semibold">未找到符合要求的餐厅</view>
  103 + <view class="info-txt">修改或减少条件,获取更多餐厅</view>
  104 + </view>
  105 + <view class="info" wx:else="hasSearchLimit" bindtap="setTSLocal">
  106 + <view class="info-msg Semibold">你可以切换到其他城市看看</view>
  107 + <view class="info-button full flex-lr">
  108 + <view>唐山市</view>
  109 + <view class="info-button-gt"></view>
  110 + </view>
  111 + </view>
99 </view> 112 </view>
100 </view> 113 </view>
101 </view> 114 </view>
@@ -111,10 +111,21 @@ page{ @@ -111,10 +111,21 @@ page{
111 height: 16rpx; 111 height: 16rpx;
112 min-width:12rpx; 112 min-width:12rpx;
113 } 113 }
  114 +.disabled .tags{
  115 + color: #999;
  116 +}
  117 +.enabled .tags{
  118 + color: #353535;
  119 +}
114 .tags.active .picker .more{ 120 .tags.active .picker .more{
115 background-image: url("http://qn.colorcun.com/reserve/images/%E8%8F%9C%E7%B3%BB%E9%80%89%E4%B8%AD.png"); 121 background-image: url("http://qn.colorcun.com/reserve/images/%E8%8F%9C%E7%B3%BB%E9%80%89%E4%B8%AD.png");
116 } 122 }
117 - 123 +.disabled .picker .more{
  124 + background-image: url("http://qn.colorcun.com/custom/lite-yd/image/%E5%BE%AE%E4%BF%A1%E5%9B%BE%E7%89%87_20190925174046.png");
  125 +}
  126 +.enabled .picker .more{
  127 + background-image: url("http://qn.colorcun.com/reserve/images/%E8%8F%9C%E7%B3%BB%E9%80%89%E4%B8%AD.png");
  128 +}
118 .searchAddr { 129 .searchAddr {
119 margin-left: 15rpx; 130 margin-left: 15rpx;
120 width: 400rpx; 131 width: 400rpx;
@@ -198,8 +209,9 @@ page{ @@ -198,8 +209,9 @@ page{
198 padding: 0 20rpx; 209 padding: 0 20rpx;
199 color: #F05522; 210 color: #F05522;
200 font-size: 28rpx; 211 font-size: 28rpx;
201 - width: 106rpx;  
202 - max-width: 106rpx; 212 + width: 146rpx;
  213 + max-width: 146rpx;
  214 + box-sizing: border-box;
203 } 215 }
204 .info-button-gt{ 216 .info-button-gt{
205 background-image: url("http://qn.colorcun.com/reserve/images/gt-cheng.png"); 217 background-image: url("http://qn.colorcun.com/reserve/images/gt-cheng.png");
@@ -208,7 +220,13 @@ page{ @@ -208,7 +220,13 @@ page{
208 height: 20rpx; 220 height: 20rpx;
209 221
210 } 222 }
211 - 223 +.info-button.full{
  224 + background-color: #F05522;
  225 + color:#fefefe;
  226 +}
  227 +.info-button.full .info-button-gt{
  228 + background-image: url("http://qn.colorcun.com/%E5%BE%AE%E4%BF%A1%E5%9B%BE%E7%89%87_20190925175650.png");
  229 +}
212 .transverse-search .tags{ 230 .transverse-search .tags{
213 height: 50rpx; 231 height: 50rpx;
214 line-height: 50rpx; 232 line-height: 50rpx;
@@ -238,6 +256,9 @@ page{ @@ -238,6 +256,9 @@ page{
238 box-shadow: -4rpx 0 4rpx 2rpx #C5C1C1; 256 box-shadow: -4rpx 0 4rpx 2rpx #C5C1C1;
239 overflow: hidden; 257 overflow: hidden;
240 } 258 }
  259 +.seller-view.disabled{
  260 + height: 410rpx;
  261 +}
241 .transverse-view-top{ 262 .transverse-view-top{
242 height: 58rpx; 263 height: 58rpx;
243 overflow: hidden; 264 overflow: hidden;
@@ -266,4 +287,35 @@ page{ @@ -266,4 +287,35 @@ page{
266 padding-left: 40rpx; 287 padding-left: 40rpx;
267 line-height: 90rpx; 288 line-height: 90rpx;
268 padding-top: 58rpx; 289 padding-top: 58rpx;
  290 +}
  291 +.disabled .transverse-search{
  292 + padding-top: 0;
  293 +}
  294 +.toast{
  295 + background-color: #000;
  296 + width: calc(100% - 272rpx);
  297 + position: fixed;
  298 + bottom:490rpx;
  299 + color: #fefefe;
  300 + height:60rpx;
  301 + font-size:26rpx;
  302 + line-height:60rpx;
  303 + left: 136rpx;
  304 + text-align: center;
  305 + border-radius:30rpx;
  306 + opacity:0.64;
  307 +}
  308 +.disabled .toast{
  309 + background-color: #000;
  310 + width: calc(100% - 72rpx);
  311 + position: fixed;
  312 + bottom:430rpx;
  313 + color: #fefefe;
  314 + height:60rpx;
  315 + font-size:26rpx;
  316 + line-height:60rpx;
  317 + left: 36rpx;
  318 + text-align: center;
  319 + border-radius:30rpx;
  320 + opacity:0.64;
269 } 321 }
@@ -19,6 +19,8 @@ Page({ @@ -19,6 +19,8 @@ Page({
19 ], 19 ],
20 markers:[], 20 markers:[],
21 hasMore:true, 21 hasMore:true,
  22 + hasDisabled:true,
  23 + hasSuggestion:false,
22 }, 24 },
23 25
24 /** 26 /**
@@ -27,6 +29,11 @@ Page({ @@ -27,6 +29,11 @@ Page({
27 onLoad: async function (options) { 29 onLoad: async function (options) {
28 //lat=34.21719&lng=108.89155&map={"errMsg":"getMapRegion:ok","southwest":{"longitude":108.87545674591064,"latitude":34.204520114013846},"northeast":{"longitude":108.90764325408935,"latitude":34.229857981005225},"scale":15}&multiIndex=1&tags=1,2 30 //lat=34.21719&lng=108.89155&map={"errMsg":"getMapRegion:ok","southwest":{"longitude":108.87545674591064,"latitude":34.204520114013846},"northeast":{"longitude":108.90764325408935,"latitude":34.229857981005225},"scale":15}&multiIndex=1&tags=1,2
29 this.options=options; 31 this.options=options;
  32 + if(options.hasSuggestion){
  33 + this.setData({
  34 + hasSuggestion:true
  35 + })
  36 + }
30 let tags=[ 37 let tags=[
31 {id:1,name:'环境好'}, 38 {id:1,name:'环境好'},
32 {id:2,name:'菜品有特色'}, 39 {id:2,name:'菜品有特色'},
@@ -100,8 +107,11 @@ Page({ @@ -100,8 +107,11 @@ Page({
100 keyword:mapParam.keyword, 107 keyword:mapParam.keyword,
101 offset:this.offset, 108 offset:this.offset,
102 size:this.size, 109 size:this.size,
103 - distance:5000, 110 + distance:500000,
104 }; 111 };
  112 + if(mapParam.lat){
  113 + this.param.centre_pos=`${mapParam.lat},${mapParam.lng}`
  114 + }
105 }else{ 115 }else{
106 //计算视窗中心 116 //计算视窗中心
107 let map=JSON.parse(mapParam.map); 117 let map=JSON.parse(mapParam.map);
@@ -116,7 +126,11 @@ Page({ @@ -116,7 +126,11 @@ Page({
116 size:this.size, 126 size:this.size,
117 distance:50, 127 distance:50,
118 }; 128 };
  129 + if(mapParam.centre_pos){
  130 + this.param.centre_pos=mapParam.centre_pos
  131 + }
119 } 132 }
  133 +
120 if(this.data.multiIndex[0]>0){ 134 if(this.data.multiIndex[0]>0){
121 this.param.cuisine=await DA.getCatesID(this.data.multiIndex[0]-1); 135 this.param.cuisine=await DA.getCatesID(this.data.multiIndex[0]-1);
122 } 136 }
@@ -133,10 +147,21 @@ Page({ @@ -133,10 +147,21 @@ Page({
133 this.setData({ 147 this.setData({
134 hasMore:res.data.length==this.size, 148 hasMore:res.data.length==this.size,
135 markers:this.sellerFormat(res.data), 149 markers:this.sellerFormat(res.data),
  150 + hasDisabled:this.getHasDisabled(res.data.length>0,this.data.multiIndex[0]>0 || tags.length>0)
136 }) 151 })
137 this.triggerEvent('event',{type:'getListEnd',total:res.data.length}) 152 this.triggerEvent('event',{type:'getListEnd',total:res.data.length})
138 }) 153 })
139 }, 154 },
  155 + /**
  156 + * @param hasLimit 是否有搜索条件
  157 + * @returns {boolean}
  158 + */
  159 + getHasDisabled(hasData,hasLimit){
  160 + if(this.offset==1 && !hasLimit && !hasData) {
  161 + return true
  162 + }
  163 + return false
  164 + },
140 getListMore(){ 165 getListMore(){
141 this.param.offset+=1; 166 this.param.offset+=1;
142 let markers=this.data.markers; 167 let markers=this.data.markers;
@@ -148,6 +173,7 @@ Page({ @@ -148,6 +173,7 @@ Page({
148 }) 173 })
149 }, 174 },
150 caixiShow(){ 175 caixiShow(){
  176 + if(this.data.hasDisabled) return
151 this.selectComponent('#caixi').show(); 177 this.selectComponent('#caixi').show();
152 }, 178 },
153 caixiActive(e){ 179 caixiActive(e){
@@ -173,6 +199,7 @@ Page({ @@ -173,6 +199,7 @@ Page({
173 setTimeout(()=>{this.getList();},0) 199 setTimeout(()=>{this.getList();},0)
174 }, 200 },
175 tagsChange(e){ 201 tagsChange(e){
  202 + if(this.data.hasDisabled) return
176 let id=util.attr(e,'id'); 203 let id=util.attr(e,'id');
177 let tags=this.data.tags; 204 let tags=this.data.tags;
178 let activeNum=0; 205 let activeNum=0;
1 <!--pages/reserve/indexList.wxml--> 1 <!--pages/reserve/indexList.wxml-->
2 <nav>周到安排</nav> 2 <nav>周到安排</nav>
3 <view class="header"> 3 <view class="header">
4 - <view class="transverse-search flex-ll"> 4 + <view class="transverse-search flex-ll {{hasDisabled?'disabled':''}}">
5 <view 5 <view
6 bindtap="caixiShow" 6 bindtap="caixiShow"
7 class="tags {{multiIndex[0]>0?'active':''}}" 7 class="tags {{multiIndex[0]>0?'active':''}}"
@@ -22,18 +22,33 @@ @@ -22,18 +22,33 @@
22 </view> 22 </view>
23 </view> 23 </view>
24 <view class="pages"> 24 <view class="pages">
25 - <view class="follow">  
26 - <view class="seller" wx:for="{{markers}}" wx:key="sellers.key"  
27 - bindtap="gotoDetail" data-sid="{{item.id}}">  
28 - <sb-tr seller="{{item}}"  
29 - hasActivityTags="{{false}}"  
30 - hasActivityShort="{{true}}"  
31 - hasBrand="true" hasActivityTese="true"  
32 - hasSlogan="{{false}}"  
33 - sellerStyle="noborder noshadow noradius"></sb-tr>  
34 - </view>  
35 - <hr class="flex-vc nomore" wx:if="{{!hasMore}}" bgColor="#f5f5f5">我是有底线的</hr> 25 + <view class="flex-vc empty" wx:if="{{markers.length<1}}">
  26 + <block wx:if="{{!hasFirstShow}}">
  27 + <image src="http://qn.colorcun.com/custom/lite-online/image/follow-empty.png"></image>
  28 + <block wx:if="{{hasDisabled}}">
  29 + <view>该地区没有可供预订的餐厅,努力开通中</view>
  30 + </block>
  31 + <block wx:else="">
  32 + <view class="empry-info1">未找到符合要求的餐厅</view>
  33 + <view class="empry-info2">修改或减少条件,获取更多餐厅</view>
  34 + </block>
  35 + </block>
36 </view> 36 </view>
  37 + <block wx:else="">
  38 + <view class="follow" >
  39 + <view class="seller" wx:for="{{markers}}" wx:key="sellers.key"
  40 + bindtap="gotoDetail" data-sid="{{item.id}}">
  41 + <sb-tr seller="{{item}}"
  42 + hasActivityTags="{{false}}"
  43 + hasActivityShort="{{true}}"
  44 + hasBrand="true" hasActivityTese="true"
  45 + hasSlogan="{{false}}"
  46 + hasSuggestion="{{hasSuggestion}}"
  47 + sellerStyle="noborder noshadow noradius"></sb-tr>
  48 + </view>
  49 + </view>
  50 + <hr class="flex-vc nomore" wx:if="{{!hasMore}}" bgColor="#ffffff">我是有底线的</hr>
  51 + </block>
37 </view> 52 </view>
38 <caixi multiArray="{{multiArray}}" multiIndex="{{multiIndex}}" 53 <caixi multiArray="{{multiArray}}" multiIndex="{{multiIndex}}"
39 bindactive="caixiActive" id="caixi" 54 bindactive="caixiActive" id="caixi"
@@ -47,12 +47,14 @@ @@ -47,12 +47,14 @@
47 height: 16rpx; 47 height: 16rpx;
48 min-width:12rpx; 48 min-width:12rpx;
49 } 49 }
  50 +.disabled .tags{
  51 + color: #999;
  52 +}
50 .tags.active .picker .more{ 53 .tags.active .picker .more{
51 background-image: url("http://qn.colorcun.com/reserve/images/%E8%8F%9C%E7%B3%BB%E9%80%89%E4%B8%AD.png"); 54 background-image: url("http://qn.colorcun.com/reserve/images/%E8%8F%9C%E7%B3%BB%E9%80%89%E4%B8%AD.png");
52 } 55 }
53 -  
54 -page{  
55 - background-color: #F5F5F5; 56 +.disabled .picker .more{
  57 + background-image: url("http://qn.colorcun.com/custom/lite-yd/image/%E5%BE%AE%E4%BF%A1%E5%9B%BE%E7%89%87_20190925174046.png");
56 } 58 }
57 .pages{ 59 .pages{
58 width: 100%; 60 width: 100%;
@@ -62,22 +64,36 @@ page{ @@ -62,22 +64,36 @@ page{
62 } 64 }
63 .follow { 65 .follow {
64 padding-top: 0; 66 padding-top: 0;
65 - padding-bottom: 40rpx; 67 + padding-bottom: 10rpx;
66 } 68 }
67 .follow .seller{ 69 .follow .seller{
68 background-color: #ffffff; 70 background-color: #ffffff;
69 overflow: hidden; 71 overflow: hidden;
70 - margin: 0 0 20rpx; 72 + border-bottom: 20rpx solid #f5f5f5;
  73 +}
  74 +.follow .seller:last-child{
  75 + border-bottom: 20rpx solid #ffffff;
71 } 76 }
72 .nomore{ 77 .nomore{
73 color: #999; 78 color: #999;
74 font-size: 28rpx; 79 font-size: 28rpx;
75 width: calc(100% - 36rpx); 80 width: calc(100% - 36rpx);
76 - margin: 40rpx auto 0; 81 + margin: 0rpx auto 40rpx;
77 } 82 }
78 .hr{ 83 .hr{
79 height: 2rpx; 84 height: 2rpx;
80 - background-color: #F5F5F5;  
81 width: 90%; 85 width: 90%;
82 margin: 19rpx auto 0; 86 margin: 19rpx auto 0;
  87 +}
  88 +.empty{margin-top: 230rpx; color: #353535}
  89 +.empty image{
  90 + width: 191px;
  91 + height: 158px;
  92 +}
  93 +.empty view{
  94 + font-size: 28rpx;
  95 + margin-top: 86rpx;
  96 +}
  97 +.empty view.empry-info2{
  98 + margin-top: 20rpx;
83 } 99 }
@@ -19,13 +19,14 @@ Page({ @@ -19,13 +19,14 @@ Page({
19 hasSellerMore:false, 19 hasSellerMore:false,
20 keyword:'', 20 keyword:'',
21 sellerSplit:-1, 21 sellerSplit:-1,
  22 + navHeight:100,
22 }, 23 },
23 24
24 /** 25 /**
25 * 生命周期函数--监听页面加载 26 * 生命周期函数--监听页面加载
26 */ 27 */
27 onLoad: function (options) { 28 onLoad: function (options) {
28 - this.getPos() 29 + this.selectComponent('#getpos').getPos();
29 }, 30 },
30 31
31 /** 32 /**
@@ -40,6 +41,10 @@ Page({ @@ -40,6 +41,10 @@ Page({
40 */ 41 */
41 onShow: function () { 42 onShow: function () {
42 this.getHistory(); 43 this.getHistory();
  44 + this.setData({
  45 + navHeight:this.selectComponent('#nav').getHeight()
  46 + })
  47 +
43 }, 48 },
44 49
45 /** 50 /**
@@ -98,37 +103,50 @@ Page({ @@ -98,37 +103,50 @@ Page({
98 getsuggest: function (e) { 103 getsuggest: function (e) {
99 //调用关键词提示接口 104 //调用关键词提示接口
100 this.inputVal=e.detail.value; 105 this.inputVal=e.detail.value;
101 - if(e.detail.value.length<1){ 106 + if(this.inputVal.length<1){
102 return this.setData({ 107 return this.setData({
103 - suggestion: [] 108 + suggestion: [],
  109 + keyword:''
104 }) 110 })
105 } 111 }
106 - App.Customer.KeywordTips({ 112 + let prarms={
107 keyword:this.inputVal, 113 keyword:this.inputVal,
108 region:this.location.city||'', 114 region:this.location.city||'',
109 region_fix:0, 115 region_fix:0,
110 - location:this.location.latitude+','+this.location.longitude,  
111 page_size:20, 116 page_size:20,
112 page_index:1, 117 page_index:1,
113 key:map_key, 118 key:map_key,
114 - }).then(res=>{  
115 - res.data=res.data.data 119 + }
  120 + if(this.location.latitude){
  121 + prarms.location=this.location.latitude+','+this.location.longitude
  122 + }
  123 + App.Customer.KeywordTips(prarms).then(res=>{
  124 + if(this.inputVal.length<1){
  125 + return this.setData({
  126 + suggestion: []
  127 + })
  128 + }
116 var sug = [],hasSellerMore=false,sellerSplit=-1 129 var sug = [],hasSellerMore=false,sellerSplit=-1
117 - for (var i = 0; i < res.data.length; i++) {  
118 - if(i==2 && res.data[i].type==-1){  
119 - hasSellerMore=true  
120 - continue; 130 + try{
  131 + res.data=res.data.data
  132 + if(res.data instanceof Array){
  133 + for (var i = 0; i < res.data.length; i++) {
  134 + if(i==2 && res.data[i].type==-1){
  135 + hasSellerMore=true
  136 + continue;
  137 + }
  138 + if((i==1 || i==2) && res.data[i-1].type==-1 && res.data[i].type!=-1){
  139 + sellerSplit=i-1
  140 + }
  141 + let item=res.data[i]
  142 + item.latitude=item.location.lat
  143 + item.longitude=item.location.lng
  144 + item.addr=item.address
  145 + item.titles=item.title.match(new RegExp('(.*)('+this.inputVal+')(.*)'))
  146 + sug.push(item);
  147 + }
121 } 148 }
122 - if((i==1 || i==2) && res.data[i-1].type==-1 && res.data[i].type!=-1){  
123 - sellerSplit=i-1  
124 - }  
125 - let item=res.data[i]  
126 - item.latitude=item.location.lat  
127 - item.longitude=item.location.lng  
128 - item.addr=item.address  
129 - item.titles=item.title.match(new RegExp('(.*)('+this.inputVal+')(.*)'))  
130 - sug.push(item);  
131 - } 149 + }catch(e){}
132 this.setData({ //设置suggestion属性,将关键词搜索结果以列表形式展示 150 this.setData({ //设置suggestion属性,将关键词搜索结果以列表形式展示
133 suggestion: sug, 151 suggestion: sug,
134 hasSellerMore:hasSellerMore, 152 hasSellerMore:hasSellerMore,
@@ -168,41 +186,11 @@ Page({ @@ -168,41 +186,11 @@ Page({
168 }) 186 })
169 }, 187 },
170 location:'', 188 location:'',
171 - getPos(){  
172 - this._getPos().then(res => {  
173 - console.log('wx.getLocation.then', res);  
174 - this.location=res  
175 - this.getCity()  
176 - }).catch((e) => {  
177 - console.log('wx.getLocation.catch', e);  
178 - if ('getLocation:fail auth deny' == e.errMsg || 'getLocation:fail:auth denied' == e.errMsg) {  
179 - this.selectComponent('#showModal').options({  
180 - header: '定位失败',  
181 - body: '需要地理位置授权'  
182 - }).show();  
183 - } else {  
184 - setTimeout(() => {  
185 - this.getPos()  
186 - }, 500)  
187 - }  
188 -  
189 - })  
190 - },  
191 - _getPos(){  
192 - return new Promise((success, fail) => {  
193 - wx.getLocation({  
194 - type: 'gcj02',  
195 - success: (res) => {  
196 - success(res)  
197 - },  
198 - fail: (res) => {  
199 - fail(res)  
200 - },  
201 - complete: (res) => {  
202 - console.log('wx.getLocation', res)  
203 - }  
204 - });  
205 - }) 189 + onpos(e){
  190 + console.log(e);
  191 + this.location=e.detail
  192 + this.GetRecommendSellerLists()
  193 + this.getCity()
206 }, 194 },
207 getCity(){ 195 getCity(){
208 qqmapsdk.reverseGeocoder({ 196 qqmapsdk.reverseGeocoder({
@@ -261,4 +249,46 @@ Page({ @@ -261,4 +249,46 @@ Page({
261 }) 249 })
262 }) 250 })
263 }, 251 },
  252 + clearKeyword(){
  253 + this.setData({
  254 + keyword:'',
  255 + suggestion:[],
  256 + })
  257 + },
  258 + GetRecommendSellerLists(){
  259 + if(!this.location.latitude) return;
  260 + let param={}
  261 + param={
  262 + lat:this.location.latitude,
  263 + lng:this.location.longitude
  264 + }
  265 + App.Customer.GetRecommendSellerLists(param).then(res=>{
  266 + this.setData({
  267 + rsl:res.data
  268 + })
  269 + })
  270 + },
  271 + hasGoto:false,
  272 + bindtransition(e){
  273 + console.log(e)
  274 + if('change'==e.type){
  275 + this.hasGoto=false
  276 + }
  277 + if('animationfinish'==e.type){
  278 + if(this.hasGoto && (e.detail.current+1)==this.data.rsl.length){
  279 + wx.switchTab({
  280 + url: '/pages/reserve/index'
  281 + })
  282 + return;
  283 + }else{
  284 + this.hasGoto=true
  285 + }
  286 + }
  287 + },
  288 + gotoSellerDetail(e){
  289 + let url='/pages/reserve/detail?id='+e.currentTarget.id
  290 + wx.navigateTo({
  291 + url:url,
  292 + })
  293 + },
264 }) 294 })
@@ -4,7 +4,9 @@ @@ -4,7 +4,9 @@
4 "navigationBarTitleText":"周到安排", 4 "navigationBarTitleText":"周到安排",
5 "usingComponents": { 5 "usingComponents": {
6 "formids":"/components/formids/formids", 6 "formids":"/components/formids/formids",
  7 + "getpos":"/components/userinfo/getpos",
7 "nav":"/components/nav/nav", 8 "nav":"/components/nav/nav",
8 - "search-item":"/components/reserve/search/item" 9 + "search-item":"/components/reserve/search/item",
  10 + "sb-tr":"/components/reserve/seller-box-transverse/seller-box"
9 } 11 }
10 } 12 }
1 <!--pages/reserve/search.wxml--> 1 <!--pages/reserve/search.wxml-->
2 -<nav>搜索</nav>  
3 -<view class="pages">  
4 - <view class="searchAddrView">  
5 - <view class="searchAddr flex-ll">  
6 - <image class="icon" src="http://qn.colorcun.com/custom/lite-online/image/search26.png"></image>  
7 - <input style="width: 100%;" placeholder="输入餐厅名或地名,快速订包间"  
8 - type="text" confirm-type="done"  
9 - focus  
10 - bindinput="getsuggest" value="{{backfill}}"/>  
11 - </view> 2 +<nav id="nav">搜索</nav>
  3 +<view class="searchAddrView" style="height: {{navHeight+40}}px;">
  4 + <view class="searchAddr flex-ll" style="margin-top: {{navHeight+5}}px;">
  5 + <image class="icon" src="http://qn.colorcun.com/custom/lite-online/image/search26.png"></image>
  6 + <input style="width: 100%;" placeholder="输入餐厅名或地名,快速订包间"
  7 + type="text" confirm-type="done"
  8 + focus
  9 + bindinput="getsuggest" value="{{keyword}}"/>
  10 + <image class="icon icon-del" wx:if="{{keyword.length>0}}"
  11 + catchtap="clearKeyword"
  12 + src="http://qn.colorcun.com/reserve/images/del.png"></image>
12 </view> 13 </view>
  14 +</view>
  15 +<view class="pages">
13 <view class="res-view"> 16 <view class="res-view">
14 <!--绑定回填事件--> 17 <!--绑定回填事件-->
15 <block wx:for="{{suggestion}}" wx:key="index" 18 <block wx:for="{{suggestion}}" wx:key="index"
@@ -21,8 +24,39 @@ @@ -21,8 +24,39 @@
21 <view class="see-more bottom" wx:if="{{suggestion.length>0}}"></view> 24 <view class="see-more bottom" wx:if="{{suggestion.length>0}}"></view>
22 </view> 25 </view>
23 </view> 26 </view>
24 -<view class="history" wx:if="{{history.length>0 && suggestion.length<1}}">  
25 - <view class="pages"> 27 +<view class="history" wx:if="{{suggestion.length<1}}">
  28 + <view wx:if="{{keyword.length>0}}">
  29 + <view class="flex-vc empty">
  30 + <block wx:if="{{!hasFirstShow}}">
  31 + <image src="http://qn.colorcun.com/custom/lite-online/image/follow-empty.png"></image>
  32 + <view class="empty-t1">抱歉,没有找到符合的内容</view>
  33 + <view class="empty-t2">试试搜搜别的</view>
  34 + </block>
  35 + </view>
  36 + <view class="rsl-block" wx:if="{{rsl.length>0}}">
  37 + <view class="line-push">为你推荐</view>
  38 + <view class="transverse-list">
  39 + <swiper
  40 + indicator-dots="{{false}}" autoplay="{{false}}" circular="{{false}}" vertical="{{false}}"
  41 + interval="2000" duration="500"
  42 + previous-margin="{{15}}px" next-margin="{{15}}px" style="height: 350rpx;"
  43 + current="{{current}}" bindchange="bindtransition" bindanimationfinish="bindtransition">
  44 + <block wx:for="{{rsl}}" wx:key="rsl.key">
  45 + <swiper-item bindtap="gotoSellerDetail" id="{{item.id}}">
  46 + <view class="seller" id="seller-{{item.id}}">
  47 + <sb-tr seller="{{item}}"
  48 + hasActivityTags="{{false}}"
  49 + hasActivityShort="{{true}}"
  50 + hasBrand="true" hasActivityTese="true"
  51 + hasSlogan="{{false}}"></sb-tr>
  52 + </view>
  53 + </swiper-item>
  54 + </block>
  55 + </swiper>
  56 + </view>
  57 + </view>
  58 + </view>
  59 + <view class="pages" wx:elif="{{history.length>0}}">
26 <view class="flex-lr"> 60 <view class="flex-lr">
27 <view class="history-title">最近搜索</view> 61 <view class="history-title">最近搜索</view>
28 <view class="history-empty" bindtap="historyEmpty"></view> 62 <view class="history-empty" bindtap="historyEmpty"></view>
@@ -34,4 +68,5 @@ @@ -34,4 +68,5 @@
34 </view> 68 </view>
35 </view> 69 </view>
36 </view> 70 </view>
37 -<fb></fb>  
  71 +<fb></fb>
  72 +<getpos bindpos="onpos" id="getpos" hasAllowFail></getpos>
@@ -6,16 +6,13 @@ @@ -6,16 +6,13 @@
6 } 6 }
7 .searchAddrView{ 7 .searchAddrView{
8 position: fixed; 8 position: fixed;
9 - top:100rpx;  
10 - width: 110%;  
11 - height: 110rpx;  
12 - background-color: #fefefe;  
13 - z-index: 10;  
14 - margin-left: -5%; 9 + top:0rpx;
  10 + width: 100%;
  11 + height: 240rpx;
  12 + background-color: #ffffff;
  13 + z-index: 9;
15 } 14 }
16 .searchAddr { 15 .searchAddr {
17 - position: fixed;  
18 - top:150rpx;  
19 width: 90%; 16 width: 90%;
20 height: 60rpx; 17 height: 60rpx;
21 background-color: #F5F5F5; 18 background-color: #F5F5F5;
@@ -24,8 +21,7 @@ @@ -24,8 +21,7 @@
24 color:#999999; 21 color:#999999;
25 line-height: 60rpx; 22 line-height: 60rpx;
26 font-size: 28rpx; 23 font-size: 28rpx;
27 - z-index: 99;  
28 - left: 5%; 24 + margin:0 auto;
29 } 25 }
30 .searchAddr .icon{ 26 .searchAddr .icon{
31 min-width: 26rpx; 27 min-width: 26rpx;
@@ -33,8 +29,13 @@ @@ -33,8 +29,13 @@
33 height: 26rpx; 29 height: 26rpx;
34 margin: 0 20rpx; 30 margin: 0 20rpx;
35 } 31 }
  32 +.searchAddr .icon-del{
  33 + min-width: 28rpx;
  34 + width: 28rpx;
  35 + height: 28rpx;
  36 +}
36 .res-view{ 37 .res-view{
37 - margin-top: 110rpx; 38 + margin-top: 120rpx;
38 } 39 }
39 40
40 .search-but{ 41 .search-but{
@@ -51,7 +52,7 @@ @@ -51,7 +52,7 @@
51 } 52 }
52 .history .history-title{ 53 .history .history-title{
53 font-size: 28rpx; 54 font-size: 28rpx;
54 - color:#999999; 55 + color:#353535;
55 height: 40rpx; 56 height: 40rpx;
56 line-height: 40rpx; 57 line-height: 40rpx;
57 font-weight:600; 58 font-weight:600;
@@ -79,7 +80,6 @@ @@ -79,7 +80,6 @@
79 width:136rpx; 80 width:136rpx;
80 height:34rpx; 81 height:34rpx;
81 font-size:24rpx; 82 font-size:24rpx;
82 - font-weight:500;  
83 color:rgba(153,153,153,1); 83 color:rgba(153,153,153,1);
84 line-height:34rpx; 84 line-height:34rpx;
85 background-color: #fefefe; 85 background-color: #fefefe;
@@ -94,6 +94,9 @@ @@ -94,6 +94,9 @@
94 content: "我是有底线的"; 94 content: "我是有底线的";
95 left:calc(50% - 100rpx); 95 left:calc(50% - 100rpx);
96 } 96 }
  97 +.see-more.bottom{
  98 + padding-bottom: 40rpx;
  99 +}
97 .see-split{ 100 .see-split{
98 width: 100%; 101 width: 100%;
99 height: 20rpx; 102 height: 20rpx;
@@ -103,4 +106,49 @@ @@ -103,4 +106,49 @@
103 height: 28rpx; 106 height: 28rpx;
104 background-image: url("http://qn.colorcun.com/reserve/images/empty.png"); 107 background-image: url("http://qn.colorcun.com/reserve/images/empty.png");
105 background-size: 100% 100%; 108 background-size: 100% 100%;
  109 +}
  110 +
  111 +.empty{margin-top: 150rpx; color: #353535}
  112 +.empty image{
  113 + width: 191px;
  114 + height: 158px;
  115 +}
  116 +.empty .empty-t1{
  117 + font-size: 28rpx;
  118 + margin-top: 60rpx;
  119 + height:40px;
  120 + line-height:40px;
  121 +}
  122 +.empty .empty-t2{
  123 + font-size: 28rpx;
  124 + margin-top: 20rpx;
  125 + height:40px;
  126 + line-height:40px;
  127 +}
  128 +
  129 +.line-push{
  130 + background-image: url("http://qn.colorcun.com/reserve/images/line-push.png");
  131 + width: 328rpx;
  132 + height: 42rpx;
  133 + background-size: 100% 24rpx;
  134 + margin: 0 auto;
  135 + font-size:30rpx;
  136 + color: #C0A369;
  137 + line-height: 24rpx;
  138 + background-repeat: no-repeat;
  139 + text-align: center;
  140 + margin-bottom: 60rpx;
  141 +}
  142 +.rsl-block{
  143 + position: fixed;
  144 + bottom: 0rpx;
  145 + width: 100%;
  146 +}
  147 +.transverse-list{
  148 + background-color: #fefefe;
  149 + width: 100%;
  150 +}
  151 +.transverse-list .seller{
  152 + width: 98%;
  153 + margin: 0 auto;
106 } 154 }
@@ -169,9 +169,11 @@ Page({ @@ -169,9 +169,11 @@ Page({
169 firstShowMsg:firstShowMsg, 169 firstShowMsg:firstShowMsg,
170 },'/pages/customer/detail_owner') 170 },'/pages/customer/detail_owner')
171 }) 171 })
172 - }).catch(()=>{ 172 + }).catch((res)=>{
173 this.hasSubmit=true//出错后可再次提交 173 this.hasSubmit=true//出错后可再次提交
174 - return util.toast('提交失败,请重试','none'); 174 + if(!res.msgSecCheck){
  175 + return util.toast('提交失败,请重试','none');
  176 + }
175 }) 177 })
176 }, 178 },
177 getRdate(){ 179 getRdate(){
@@ -62,7 +62,7 @@ @@ -62,7 +62,7 @@
62 <view class="flex-rr"> 62 <view class="flex-rr">
63 <!-- 一键获取 --> 63 <!-- 一键获取 -->
64 <phone bindgetphone="getphone"> 64 <phone bindgetphone="getphone">
65 - <view class="smooth white-font get-phone flex-vc" style="font-size:28rpx;">一键获取</view> 65 + <view class="smooth white-font get-phone flex-vc" style="font-size:28rpx;">一键录入</view>
66 </phone> 66 </phone>
67 </view> 67 </view>
68 </view> 68 </view>
@@ -16,7 +16,7 @@ @@ -16,7 +16,7 @@
16 background-size: 100%; 16 background-size: 100%;
17 } 17 }
18 .shangwu-line{ 18 .shangwu-line{
19 - background-image: url("http://qn.colorcun.com/manager-invitation/wx2/%E5%95%86%E5%8A%A1%E7%BA%BF%E6%9D%A1.png"); 19 + background-image: url("http://qn.colorcun.com/manager-invitation/wx2/zd-line.png");
20 background-size: 100% 100%; 20 background-size: 100% 100%;
21 width: 604rpx; 21 width: 604rpx;
22 height: 30rpx; 22 height: 30rpx;
@@ -143,7 +143,7 @@ @@ -143,7 +143,7 @@
143 width: 600rpx; 143 width: 600rpx;
144 height: 30rpx; 144 height: 30rpx;
145 background-size: 100% 100%; 145 background-size: 100% 100%;
146 - background-image: url("http://qn.colorcun.com/manager-invitation/wx2/%E6%B8%A9%E9%A6%A8%E7%BA%BF%E6%9D%A1.png"); 146 + background-image: url("http://qn.colorcun.com/manager-invitation/wx3/wx-line.png");
147 } 147 }
148 .wenxin .seller{ 148 .wenxin .seller{
149 margin-top: 10rpx; 149 margin-top: 10rpx;
@@ -3,15 +3,15 @@ @@ -3,15 +3,15 @@
3 "setting": { 3 "setting": {
4 "urlCheck": true, 4 "urlCheck": true,
5 "es6": true, 5 "es6": true,
  6 + "enhance": true,
6 "postcss": true, 7 "postcss": true,
7 "minified": true, 8 "minified": true,
8 "newFeature": true, 9 "newFeature": true,
  10 + "coverView": true,
9 "nodeModules": true, 11 "nodeModules": true,
10 "autoAudits": false, 12 "autoAudits": false,
11 "uglifyFileName": false, 13 "uglifyFileName": false,
12 "checkInvalidKey": true, 14 "checkInvalidKey": true,
13 - "enhance": true,  
14 - "coverView": true,  
15 "checkSiteMap": true, 15 "checkSiteMap": true,
16 "uploadWithSourceMap": true, 16 "uploadWithSourceMap": true,
17 "babelSetting": { 17 "babelSetting": {
@@ -443,7 +443,7 @@ @@ -443,7 +443,7 @@
443 "id": 52, 443 "id": 52,
444 "name": "pages/reserve/indexList", 444 "name": "pages/reserve/indexList",
445 "pathName": "pages/reserve/indexList", 445 "pathName": "pages/reserve/indexList",
446 - "query": "lat=34.21719&lng=108.89155&map={\"errMsg\":\"getMapRegion:ok\",\"southwest\":{\"longitude\":108.87545674591064,\"latitude\":34.204520114013846},\"northeast\":{\"longitude\":108.90764325408935,\"latitude\":34.229857981005225},\"scale\":15}&multiIndex=1&tags=", 446 + "query": "lat=34.216529&lng=108.891677&map={\"errMsg\":\"getMapRegion:ok\",\"southwest\":{\"longitude\":108.85949049182128,\"latitude\":34.18927020234597},\"northeast\":{\"longitude\":108.9238635081787,\"latitude\":34.24377898163213},\"scale\":14}&multiIndex=0&tags=1,2",
447 "scene": null 447 "scene": null
448 }, 448 },
449 { 449 {
@@ -3,12 +3,60 @@ @@ -3,12 +3,60 @@
3 */ 3 */
4 //接口地址,测试环境请修改以下地址 4 //接口地址,测试环境请修改以下地址
5 //const server_host='https://xt04.colorcun.com/?s='; 5 //const server_host='https://xt04.colorcun.com/?s=';
6 -const api_timeout=2000; //接口超时时间,默认2s 6 +const api_timeout = 2000; //接口超时时间,默认2s
7 7
8 //引入接口映射关系表 8 //引入接口映射关系表
9 import api from './api.url' 9 import api from './api.url'
10 import uri_dc from './uri' 10 import uri_dc from './uri'
11 -const server_host=uri_dc.HOST__LINE; 11 +
  12 +const server_host = uri_dc.HOST__LINE;
  13 +
  14 +class rpcm {
  15 + tasks = {}
  16 +
  17 + check(key) {
  18 + let nt = new Date().getTime()
  19 + if (this.tasks[key]) {
  20 + //console.log('resSetIntervalnt',nt , this.tasks[key].timeout)
  21 + if (nt <= this.tasks[key].timeout) {
  22 + return true
  23 + }
  24 + }
  25 + return false
  26 + }
  27 +
  28 + get(key) {
  29 + return new Promise((success, fail) => {
  30 + let resSetInterval=setInterval(()=>{
  31 + console.log('resSetInterval',key,this.tasks[key])
  32 + if(this.tasks[key].type=='success'){
  33 + wx.hideLoading();
  34 + success(this.tasks[key].res)
  35 + clearInterval(resSetInterval)
  36 + }
  37 + if(this.tasks[key].type=='fail'){
  38 + wx.hideLoading();
  39 + fail(this.tasks[key].res)
  40 + clearInterval(resSetInterval)
  41 + }
  42 + },500)
  43 + })
  44 +
  45 + }
  46 +
  47 + set(key,type='',res=null) {
  48 + let nt = new Date().getTime()
  49 + this.tasks[key] = {
  50 + timeout: nt + 1000
  51 + }
  52 + if(type){
  53 + this.tasks[key]['type']=type
  54 + this.tasks[key]['res']=JSON.parse(JSON.stringify(res))
  55 + }
  56 + }
  57 +}
  58 +
  59 +const RMT = new rpcm()
12 60
13 /** 61 /**
14 * 62 *
@@ -21,178 +69,220 @@ const server_host=uri_dc.HOST__LINE; @@ -21,178 +69,220 @@ const server_host=uri_dc.HOST__LINE;
21 * @param timeout 接口超时 69 * @param timeout 接口超时
22 * @returns {Promise} 70 * @returns {Promise}
23 */ 71 */
24 -function rpc(host='',act,data={},fouce=false,header={},silence=true,cachetime=0,timeout=api_timeout,api={}){  
25 - host=host?host:server_host;  
26 - let param="";  
27 - for(let key in data){  
28 - let val=data[key];  
29 - if(val!=="" && val!==null){  
30 - param+='&'+key+'='+val  
31 - } 72 +function rpc(host = '', act, data = {}, fouce = false, header = {}, silence = true, cachetime = 0, timeout = api_timeout, api = {}) {
  73 + host = host ? host : server_host;
  74 + let param = "";
  75 + for (let key in data) {
  76 + let val = data[key];
  77 + if (val !== "" && val !== null) {
  78 + param += '&' + key + '=' + val
32 } 79 }
33 - let cache_key=act;  
34 - if(param){  
35 - cache_key+='?'+param.substr((param.length-1)*-1); 80 + }
  81 + let cache_key = act;
  82 + if (param) {
  83 + cache_key += '?' + param.substr((param.length - 1) * -1);
  84 + }
  85 + if (fouce == 'clear' || fouce == 'clean') {
  86 + return wx.removeStorageSync(cache_key);
  87 + }
  88 + if (!fouce && cachetime != 0) {//优先使用缓存
  89 + let getCache = cache(cache_key);
  90 + //console.log('getCache.'+getCache,cache_key);
  91 + if (getCache != -99999) {
  92 + return new Promise((success, fail) => {
  93 + getCache.isCache = true;
  94 + console.log(cache_key + '\nuse cache', getCache);
  95 + success(getCache);
  96 + })
36 } 97 }
37 - if(fouce=='clear' || fouce=='clean'){  
38 - return wx.removeStorageSync(cache_key); 98 + }
  99 + if (!silence) {
  100 + wx.showLoading({
  101 + title: '处理中',
  102 + mask: true
  103 + })
  104 + }
  105 + if (RMT.check(cache_key)) return RMT.get(cache_key)
  106 + RMT.set(cache_key)
  107 + return new Promise(async(success, fail) => {
  108 + if(api.msgSecCheck){//数据安全检查
  109 + try{
  110 + await msgSecCheck(host,data)
  111 + }catch (e){
  112 + wx.showToast({
  113 + title:'内容含有违法违规内容',
  114 + icon:'none'
  115 + })
  116 + return fail({msgSecCheck:true})
  117 + }
39 } 118 }
40 - if(!fouce && cachetime!=0){//优先使用缓存  
41 - let getCache= cache(cache_key);  
42 - //console.log('getCache.'+getCache,cache_key);  
43 - if(getCache!=-99999){  
44 - return new Promise((success,fail)=>{  
45 - getCache.isCache=true;  
46 - console.log(cache_key+'\nuse cache',getCache);  
47 - success(getCache);  
48 - })  
49 - } 119 + let openid = wx.getStorageSync('customer_openid');
  120 + let formids = wx.getStorageSync('formids');
  121 + if (formids) {
  122 + wx.removeStorage({key: 'formids'});
50 } 123 }
51 - if(!silence){  
52 - wx.showLoading({  
53 - title: '处理中',  
54 - mask:true  
55 - }) 124 + let enter_params = wx.getStorageSync('enter_params');
  125 + let operator = ''
  126 + if (enter_params) {
  127 + operator = JSON.stringify({
  128 + uid: enter_params.manager_id,
  129 + openid: enter_params.seller_openid,
  130 + sid: enter_params.seller_id,
  131 + })
56 } 132 }
57 - return new Promise((success,fail)=>{  
58 - let openid = wx.getStorageSync('customer_openid');  
59 - let formids = wx.getStorageSync('formids');  
60 - if(formids){  
61 - wx.removeStorage({key:'formids'});  
62 - }  
63 - let enter_params = wx.getStorageSync('enter_params');  
64 - let operator=''  
65 - if(enter_params){  
66 - operator=JSON.stringify({  
67 - uid:enter_params.manager_id,  
68 - openid: enter_params.seller_openid,  
69 - sid:enter_params.seller_id,  
70 - })  
71 - }  
72 - if(api.openid){  
73 - data[api.openid]=data[api.openid]||openid;  
74 - }  
75 - let stime=new Date();  
76 - wx.request({  
77 - url: host+act,  
78 - method: 'POST',  
79 - data: data,  
80 - header: {  
81 - ...header,  
82 - openid:openid,  
83 - formids:formids.toString(),  
84 - operator:operator,  
85 - 'content-type': 'application/x-www-form-urlencoded'  
86 - },  
87 - success: function (res) {  
88 - console.log('request.api['+(new Date()-stime)+'ms]==>',host+cache_key+('&formids='+formids.toString())+'\nrequest.success',res.data);  
89 - // return;  
90 - if(res.data){  
91 - if(cachetime!=0 && res.data.ret==200){  
92 - cache(cache_key,res.data,cachetime);//.then().catch();  
93 - }  
94 - if(res.data.ret!==200){  
95 - try{  
96 - res.data.msg=res.data.msg.replace('非法请求:','');  
97 - }catch(e){  
98 - console.log('res-fail',res,e);  
99 - if (wx.getRealtimeLogManager) {  
100 - const logger = wx.getRealtimeLogManager()  
101 - logger.error('接口错误',{url:host+cache_key,res:res.data})  
102 - }  
103 - }  
104 - }  
105 - }else{  
106 - if (wx.getRealtimeLogManager) {  
107 - const logger = wx.getRealtimeLogManager()  
108 - logger.error('接口错误',{url:host+cache_key,res:res})  
109 - }  
110 - }  
111 - success(res.data);  
112 - },  
113 - fail: function (res) {  
114 - console.log('request.api==>',host+cache_key+'\nrequest.fail',res);  
115 - fail(res);  
116 - // let query = wx.createSelectorQuery().selectComponent("#network");  
117 - // let net=query.exec(function(){  
118 - // console.log('back=>',arguments);  
119 - // });  
120 - //query.show();  
121 - //console.log('net',query); 133 + if (api.openid) {
  134 + data[api.openid] = data[api.openid] || openid;
  135 + }
  136 + let stime = new Date();
  137 + wx.request({
  138 + url: host + act,
  139 + method: 'POST',
  140 + data: data,
  141 + header: {
  142 + ...header,
  143 + openid: openid,
  144 + formids: formids.toString(),
  145 + operator: operator,
  146 + 'content-type': 'application/x-www-form-urlencoded'
  147 + },
  148 + success: function (res) {
  149 + console.log('request.api[' + (new Date() - stime) + 'ms]==>', host + cache_key + ('&formids=' + formids.toString()) + '\nrequest.success', res.data);
  150 + // return;
  151 + if (res.data) {
  152 + if (cachetime != 0 && res.data.ret == 200) {
  153 + cache(cache_key, res.data, cachetime);//.then().catch();
  154 + }
  155 + if (res.data.ret !== 200) {
  156 + try {
  157 + res.data.msg = res.data.msg.replace('非法请求:', '');
  158 + } catch (e) {
  159 + console.log('res-fail', res, e);
122 if (wx.getRealtimeLogManager) { 160 if (wx.getRealtimeLogManager) {
123 const logger = wx.getRealtimeLogManager() 161 const logger = wx.getRealtimeLogManager()
124 - logger.error('调用失败',{url:host+cache_key,res:res}) 162 + logger.error('接口错误', {url: host + cache_key, res: res.data})
125 } 163 }
126 - },  
127 - complete:function(){  
128 - wx.hideLoading();  
129 } 164 }
130 - }) 165 + }
  166 + } else {
  167 + if (wx.getRealtimeLogManager) {
  168 + const logger = wx.getRealtimeLogManager()
  169 + logger.error('接口错误', {url: host + cache_key, res: res})
  170 + }
  171 + }
  172 + success(res.data);
  173 + RMT.set(cache_key,'success',res.data)
  174 + },
  175 + fail: function (res) {
  176 + console.log('request.api==>', host + cache_key + '\nrequest.fail', res);
  177 + fail(res);
  178 + RMT.set(cache_key,'fail',res)
  179 + // let query = wx.createSelectorQuery().selectComponent("#network");
  180 + // let net=query.exec(function(){
  181 + // console.log('back=>',arguments);
  182 + // });
  183 + //query.show();
  184 + //console.log('net',query);
  185 + if (wx.getRealtimeLogManager) {
  186 + const logger = wx.getRealtimeLogManager()
  187 + logger.error('调用失败', {url: host + cache_key, res: res})
  188 + }
  189 + },
  190 + complete: function () {
  191 + wx.hideLoading();
  192 + }
131 }) 193 })
  194 + })
132 } 195 }
133 196
134 -function __api(){  
135 - let tmpApi={}  
136 - let keys=[];  
137 - for(let key in api){  
138 - api[key]=api[key]||{};  
139 - keys=key.split('.');  
140 - tmpApi[keys[0]]=tmpApi[keys[0]]?tmpApi[keys[0]]:{};  
141 - tmpApi[keys[0]][keys[1]]=tmpApi[keys[0]][keys[1]]?tmpApi[keys[0]][keys[1]]:{};  
142 - tmpApi[keys[0]][keys[1]][keys[2]]=function(data,fouce=false,header){  
143 - //console.log('api[key].host',api[key].host);  
144 - return rpc(api[key].host,api[key].alias||key,data,fouce,header,  
145 - api[key].silence,api[key].cachetime,api[key].timeout,api[key]);  
146 - } 197 +function __api() {
  198 + let tmpApi = {}
  199 + let keys = [];
  200 + for (let key in api) {
  201 + api[key] = api[key] || {};
  202 + keys = key.split('.');
  203 + tmpApi[keys[0]] = tmpApi[keys[0]] ? tmpApi[keys[0]] : {};
  204 + tmpApi[keys[0]][keys[1]] = tmpApi[keys[0]][keys[1]] ? tmpApi[keys[0]][keys[1]] : {};
  205 + tmpApi[keys[0]][keys[1]][keys[2]] = function (data, fouce = false, header) {
  206 + //console.log('api[key].host',api[key].host);
  207 + return rpc(api[key].host, api[key].alias || key, data, fouce, header,
  208 + api[key].silence, api[key].cachetime, api[key].timeout, api[key]);
147 } 209 }
148 - for(let xkey in uri_dc){  
149 - let key=uri_dc[xkey].toString();  
150 - if(key.indexOf('App.')>-1){  
151 - keys=key.split('.');  
152 - try{  
153 - if(typeof tmpApi[keys[0]][keys[1]][keys[2]]=='undefined'){  
154 - throw new Error('undefined');  
155 - }  
156 - }catch(e){  
157 - api[key]=api[key]||{};  
158 - tmpApi[keys[0]]=tmpApi[keys[0]]?tmpApi[keys[0]]:{};  
159 - tmpApi[keys[0]][keys[1]]=tmpApi[keys[0]][keys[1]]?tmpApi[keys[0]][keys[1]]:{};  
160 - tmpApi[keys[0]][keys[1]][keys[2]]=function(data,fouce=false,header){  
161 - //console.log('api[key].host',api[key]);  
162 - return rpc(api[key].host,api[key].alias||key,data,fouce,header,  
163 - api[key].silence,api[key].cachetime,api[key].timeout,api[key]);  
164 - }  
165 - } 210 + }
  211 + for (let xkey in uri_dc) {
  212 + let key = uri_dc[xkey].toString();
  213 + if (key.indexOf('App.') > -1) {
  214 + keys = key.split('.');
  215 + try {
  216 + if (typeof tmpApi[keys[0]][keys[1]][keys[2]] == 'undefined') {
  217 + throw new Error('undefined');
166 } 218 }
  219 + } catch (e) {
  220 + api[key] = api[key] || {};
  221 + tmpApi[keys[0]] = tmpApi[keys[0]] ? tmpApi[keys[0]] : {};
  222 + tmpApi[keys[0]][keys[1]] = tmpApi[keys[0]][keys[1]] ? tmpApi[keys[0]][keys[1]] : {};
  223 + tmpApi[keys[0]][keys[1]][keys[2]] = function (data, fouce = false, header) {
  224 + //console.log('api[key].host',api[key]);
  225 + return rpc(api[key].host, api[key].alias || key, data, fouce, header,
  226 + api[key].silence, api[key].cachetime, api[key].timeout, api[key]);
  227 + }
  228 + }
167 } 229 }
168 - //console.log(tmpApi[keys[0]]);  
169 - return tmpApi[keys[0]]; 230 + }
  231 + //console.log(tmpApi[keys[0]]);
  232 + return tmpApi[keys[0]];
170 } 233 }
171 -function cache(key,val=-99999,timeout=-1){  
172 - if(val!=-99999){//写入  
173 - return new Promise((success,fail)=>{  
174 - let data={  
175 - data:val,  
176 - timeout:timeout==-1?-1:(Date.parse(new Date())/1000+timeout)  
177 - }  
178 - wx.setStorage({  
179 - key:key,  
180 - data:data,  
181 - success:()=>{  
182 - success()  
183 - },  
184 - fail:()=>{  
185 - fail()  
186 - }  
187 - });  
188 - })  
189 - }  
190 - let res=wx.getStorageSync(key);  
191 - let time=Date.parse(new Date())/1000;  
192 - if(res && (res.timeout==-1 || res.timeout>time) && res.data){  
193 - return res.data;  
194 - }else{  
195 - return -99999  
196 - } 234 +
  235 +function cache(key, val = -99999, timeout = -1) {
  236 + if (val != -99999) {//写入
  237 + return new Promise((success, fail) => {
  238 + let data = {
  239 + data: val,
  240 + timeout: timeout == -1 ? -1 : (Date.parse(new Date()) / 1000 + timeout)
  241 + }
  242 + wx.setStorage({
  243 + key: key,
  244 + data: data,
  245 + success: () => {
  246 + success()
  247 + },
  248 + fail: () => {
  249 + fail()
  250 + }
  251 + });
  252 + })
  253 + }
  254 + let res = wx.getStorageSync(key);
  255 + let time = Date.parse(new Date()) / 1000;
  256 + if (res && (res.timeout == -1 || res.timeout > time) && res.data) {
  257 + return res.data;
  258 + } else {
  259 + return -99999
  260 + }
  261 +}
  262 +function msgSecCheck(host,params){
  263 + let content=JSON.stringify(params);
  264 + return new Promise(function(success,fail){
  265 + wx.request({
  266 + url: host + 'App.Wechat.MsgSecCheck',
  267 + method: 'POST',
  268 + data: {content:content},
  269 + header: {
  270 + 'content-type': 'application/x-www-form-urlencoded'
  271 + },
  272 + success: res => {
  273 + if(res.data.data.errcode==0){
  274 + success()
  275 + }else{
  276 + fail()
  277 + }
  278 + },
  279 + fail: res => {
  280 + fail()
  281 + },
  282 + complete:res=>{
  283 + wx.hideLoading();
  284 + }
  285 + })
  286 + })
197 } 287 }
198 export default __api(); 288 export default __api();
@@ -5,7 +5,9 @@ export default { @@ -5,7 +5,9 @@ export default {
5 cachetime: 0, //缓存 0无,-1永久,86400秒; 默认 0 不缓存 5 cachetime: 0, //缓存 0无,-1永久,86400秒; 默认 0 不缓存
6 timeout: 2000, //接口超时时间,默认2s 6 timeout: 2000, //接口超时时间,默认2s
7 host: '', //默认空使用04服务器,测试填写 'https://xt05.colorcun.com:10006/?s=' 7 host: '', //默认空使用04服务器,测试填写 'https://xt05.colorcun.com:10006/?s='
  8 + //ximing http://www.dzapi.com/index.php?s=
8 alias: 'App.TestManagement.TestReal', //真实接口名称,默认为空 9 alias: 'App.TestManagement.TestReal', //真实接口名称,默认为空
  10 + msgSecCheck:true, //进行内容安全检查
9 }, 11 },
10 12
11 //预订信息详情 13 //预订信息详情
@@ -57,10 +59,14 @@ export default { @@ -57,10 +59,14 @@ export default {
57 }, 59 },
58 60
59 //地图页-商家 61 //地图页-商家
60 - 'App.Customer.SellerList': null, 62 + 'App.Customer.SellerList': {
  63 + //alias: 'App.Customer.NewSellerList'
  64 + },
61 65
62 //地图页-商家-列表 66 //地图页-商家-列表
63 - 'App.Customer.SellerLists':null, 67 + 'App.Customer.SellerLists':{
  68 + //alias: 'App.Customer.NewSellerLists'
  69 + },
64 70
65 //桌位列表 71 //桌位列表
66 'App.Tables.GetTableListsBySellerId': { 72 'App.Tables.GetTableListsBySellerId': {
@@ -204,12 +210,14 @@ export default { @@ -204,12 +210,14 @@ export default {
204 //编辑、增加商家信息 210 //编辑、增加商家信息
205 'App.Invitation.SetSellerInfo':{ 211 'App.Invitation.SetSellerInfo':{
206 openid:'openid', 212 openid:'openid',
  213 + msgSecCheck:true,
207 }, 214 },
208 215
209 //修改、录入邀请函信息,同时生成对应的商家信息 216 //修改、录入邀请函信息,同时生成对应的商家信息
210 'App.Invitation.SetInvitationInfo':{ 217 'App.Invitation.SetInvitationInfo':{
211 silence: false, 218 silence: false,
212 openid:'openid', 219 openid:'openid',
  220 + msgSecCheck:true,
213 }, 221 },
214 222
215 //邀请函详情 223 //邀请函详情
@@ -260,6 +268,7 @@ export default { @@ -260,6 +268,7 @@ export default {
260 'App.Customer.SetCustomerInfo':{ 268 'App.Customer.SetCustomerInfo':{
261 openid:'openid', 269 openid:'openid',
262 silence:false, 270 silence:false,
  271 + msgSecCheck:true,
263 }, 272 },
264 273
265 //根据openid获取用的常用信息 274 //根据openid获取用的常用信息
@@ -272,6 +281,7 @@ export default { @@ -272,6 +281,7 @@ export default {
272 'App.Customer.SetReserveInfo':{ 281 'App.Customer.SetReserveInfo':{
273 openid:'openid', 282 openid:'openid',
274 silence:false, 283 silence:false,
  284 + msgSecCheck:true,
275 }, 285 },
276 286
277 //获得小程序码 287 //获得小程序码
  1 +/*
  2 +channel 预定渠道 1/2/3/4 微信小程序/电话机/安卓手机客户端/C端
  3 +is_set_ddate 是否设置到底时间 1/0 是/否
  4 +action 默认为0 未发短信 1 已发短信 2已回访
  5 +type 0商家 1顾客
  6 +status 0:待确认1:已定座2:确认到店(到店)3:用餐完成(离店)4:取消预定 5:C端在线预定(分配包间)6:拒单
  7 +ddate_solt 未设置/早市/午市/晚市/夜宵 0/1/2/3/4
  8 +*/
1 import util from './util' 9 import util from './util'
2 -//0:待确认1:已定座2:确认到店(到店)3:用餐完成(离店)4:取消预定 5:C端在线预定(分配包间)6:拒单  
3 const status=[ 10 const status=[
4 '待确认',//0:待确认 11 '待确认',//0:待确认
5 '已预订',//1:已定座 12 '已预订',//1:已定座
@@ -9,21 +16,9 @@ const status=[ @@ -9,21 +16,9 @@ const status=[
9 '已预订',//5:C端在线预定(分配包间) 16 '已预订',//5:C端在线预定(分配包间)
10 '已拒绝'//6:拒单 17 '已拒绝'//6:拒单
11 ]; 18 ];
  19 +const soltName=['','早餐','午餐','晚餐','夜宵']
12 export default { 20 export default {
13 reserve(detail){ 21 reserve(detail){
14 - /*  
15 - let ns = new Date() / 1000  
16 - //取消  
17 - detail.hasCancel=detail.status==4;  
18 - //结束  
19 - detail.hasOvered= (ns > detail.edate || (detail.status >= 2 && detail.status <= 3)) && detail.status!=6  
20 - //正常运行已接单  
21 - if(detail.type==0){//B端  
22 - detail.hasRunning = !detail.hasOvered && !detail.hasCancel  
23 - }else{//C端  
24 - detail.hasRunning = !detail.hasOvered && !detail.hasCancel && detail.status==5  
25 - }  
26 - */  
27 detail.hasRunning=this.hasRunningFlag(detail) 22 detail.hasRunning=this.hasRunningFlag(detail)
28 if(!detail.hasRunning){ 23 if(!detail.hasRunning){
29 detail.hasCancel=detail.status==4; 24 detail.hasCancel=detail.status==4;
@@ -54,6 +49,7 @@ export default { @@ -54,6 +49,7 @@ export default {
54 detail.room_demand_str+=' 等'+how+'间' 49 detail.room_demand_str+=' 等'+how+'间'
55 } 50 }
56 } 51 }
  52 + detail.soltName=soltName[detail.ddate_solt]
57 return detail; 53 return detail;
58 }, 54 },
59 hasRunningFlag(detail){//判断订单正在运行 55 hasRunningFlag(detail){//判断订单正在运行
@@ -6,8 +6,8 @@ let tpls=[ @@ -6,8 +6,8 @@ let tpls=[
6 name: '商务', 6 name: '商务',
7 hasImage:false, 7 hasImage:false,
8 timeStr:'YYYY/MM/DD 星期WW HH:II', 8 timeStr:'YYYY/MM/DD 星期WW HH:II',
9 - shareFirstImage:'http://qn.colorcun.com/manager-invitation/wx2/%E9%A2%84%E5%AE%9A%E5%AE%89%E6%8E%92-%E5%95%86%E5%8A%A1.jpg',  
10 - shareImage:'http://qn.colorcun.com/manager-invitation/wx2/%E9%82%80%E8%AF%B7%E5%87%BD-%E5%95%86%E5%8A%A1.jpg', 9 + shareFirstImage:'http://qn.colorcun.com/manager-invitation/wx3/sw1.jpg',
  10 + shareImage:'http://qn.colorcun.com/manager-invitation/wx3/sw2.jpg',
11 shareFirstTitle:'用餐已为您安排,点击查看详情', 11 shareFirstTitle:'用餐已为您安排,点击查看详情',
12 shareTitle:'您收到一个用餐邀请,点击快速导航', 12 shareTitle:'您收到一个用餐邀请,点击快速导航',
13 }, 13 },
@@ -17,8 +17,8 @@ let tpls=[ @@ -17,8 +17,8 @@ let tpls=[
17 name: '温馨', 17 name: '温馨',
18 hasImage:true, 18 hasImage:true,
19 timeStr:'YYYY年MM月DD日HH时II分', 19 timeStr:'YYYY年MM月DD日HH时II分',
20 - shareFirstImage:'http://qn.colorcun.com/manager-invitation/wx2/%E9%A2%84%E5%AE%9A%E5%AE%89%E6%8E%92-%E6%B8%A9%E9%A6%A8.jpg',  
21 - shareImage:'http://qn.colorcun.com/manager-invitation/wx/share-wx.jpg', 20 + shareFirstImage:'http://qn.colorcun.com/manager-invitation/wx3/wx1.jpg',
  21 + shareImage:'http://qn.colorcun.com/manager-invitation/wx3/wx2.jpg',
22 shareFirstTitle:'用餐已为您安排,点击查看详情', 22 shareFirstTitle:'用餐已为您安排,点击查看详情',
23 shareTitle:'您收到一个用餐邀请,点击快速导航', 23 shareTitle:'您收到一个用餐邀请,点击快速导航',
24 }, 24 },
@@ -72,12 +72,16 @@ module.exports = { @@ -72,12 +72,16 @@ module.exports = {
72 return name 72 return name
73 }, 73 },
74 distance:function(mi){ 74 distance:function(mi){
75 - if(mi>=0){ 75 + if(mi>=0 && mi!==''){
76 mi=mi*1 76 mi=mi*1
77 var gl='m' 77 var gl='m'
78 if(mi>=1000){ 78 if(mi>=1000){
79 mi=mi/1000 79 mi=mi/1000
80 gl='km' 80 gl='km'
  81 + }else{
  82 + if(mi<5){
  83 + return '5m'
  84 + }
81 } 85 }
82 return mi.toFixed(2)+gl 86 return mi.toFixed(2)+gl
83 } 87 }