限制截止时间为整数,首页切换城市后传入探店列表中,添加答题之后的弹框,手机号加验证
正在显示
15 个修改的文件
包含
179 行增加
和
14 行删除
images/achieve-answer-img@2x.png
0 → 100644
3.0 KB
images/gold@2x.png
0 → 100644
15.1 KB
@@ -85,7 +85,12 @@ Page({ | @@ -85,7 +85,12 @@ Page({ | ||
85 | }, | 85 | }, |
86 | //输入截止时间 | 86 | //输入截止时间 |
87 | inputOverTime(e) { | 87 | inputOverTime(e) { |
88 | - this.setData({over_time:e.detail.value}) | 88 | + this.setData({over_time:e.detail.value}); |
89 | + if(this.data.over_time.indexOf('.') !== -1) { | ||
90 | + wx.showToast({title:'截止时间为整数',icon:'none'}); | ||
91 | + this.setData({over_time:''}); | ||
92 | + } | ||
93 | + console.log(this.data.over_time.indexOf('.') !== -1); | ||
89 | }, | 94 | }, |
90 | //获取分类 | 95 | //获取分类 |
91 | getType() { | 96 | getType() { |
@@ -90,7 +90,7 @@ | @@ -90,7 +90,7 @@ | ||
90 | </view> | 90 | </view> |
91 | <view class="time-limit"> | 91 | <view class="time-limit"> |
92 | <text>时限 活动开始前</text> | 92 | <text>时限 活动开始前</text> |
93 | - <input type="number" bindinput="inputOverTime" value=""/> | 93 | + <input type="number" bindinput="inputOverTime" value="{{over_time}}"/> |
94 | <text>小时 停止拼单</text> | 94 | <text>小时 停止拼单</text> |
95 | </view> | 95 | </view> |
96 | </view> | 96 | </view> |
@@ -111,6 +111,7 @@ Page({ | @@ -111,6 +111,7 @@ Page({ | ||
111 | }); | 111 | }); |
112 | console.log('total_score', total_score); | 112 | console.log('total_score', total_score); |
113 | this.setData({score: total_score}); | 113 | this.setData({score: total_score}); |
114 | + wx.setStorageSync('score', total_score); | ||
114 | let url = '/portal/Send/answer'; | 115 | let url = '/portal/Send/answer'; |
115 | let params = { | 116 | let params = { |
116 | token: wx.getStorageSync('token'), | 117 | token: wx.getStorageSync('token'), |
@@ -28,6 +28,10 @@ Page({ | @@ -28,6 +28,10 @@ Page({ | ||
28 | hasUserInfo: false, | 28 | hasUserInfo: false, |
29 | canIUse: wx.canIUse('button.open-type.getUserInfo') | 29 | canIUse: wx.canIUse('button.open-type.getUserInfo') |
30 | }, | 30 | }, |
31 | + //关闭金火柴勋章弹框 | ||
32 | + close() { | ||
33 | + this.setData({show_gold_modal:false,show_normal_modal:false}) | ||
34 | + }, | ||
31 | //获取城市列表 | 35 | //获取城市列表 |
32 | getCityList() { | 36 | getCityList() { |
33 | const self = this; | 37 | const self = this; |
@@ -50,7 +54,7 @@ Page({ | @@ -50,7 +54,7 @@ Page({ | ||
50 | cityPickerChange(e) { | 54 | cityPickerChange(e) { |
51 | this.setData({ | 55 | this.setData({ |
52 | current_city: e.detail.value, | 56 | current_city: e.detail.value, |
53 | - // is_sex_change: true | 57 | + is_city_change: true |
54 | }); | 58 | }); |
55 | const lat = this.data.cityList[e.detail.value].latng.split(',')[1]; | 59 | const lat = this.data.cityList[e.detail.value].latng.split(',')[1]; |
56 | const lng = this.data.cityList[e.detail.value].latng.split(',')[0]; | 60 | const lng = this.data.cityList[e.detail.value].latng.split(',')[0]; |
@@ -112,8 +116,16 @@ Page({ | @@ -112,8 +116,16 @@ Page({ | ||
112 | }, | 116 | }, |
113 | //查看更多 | 117 | //查看更多 |
114 | goMore() { | 118 | goMore() { |
119 | + let city = null; | ||
120 | + if(this.data.is_city_change) { | ||
121 | + city = JSON.stringify({ | ||
122 | + name:this.data.cityList[this.data.current_city].title, | ||
123 | + lat: this.data.lat, | ||
124 | + lng: this.data.lng, | ||
125 | + }) | ||
126 | + } | ||
115 | wx.navigateTo({ | 127 | wx.navigateTo({ |
116 | - url: '/pages/index/tandian-list/tandian-list', | 128 | + url: '/pages/index/tandian-list/tandian-list?city=' + city, |
117 | }) | 129 | }) |
118 | }, | 130 | }, |
119 | //进入拼餐详情 | 131 | //进入拼餐详情 |
@@ -288,7 +300,14 @@ Page({ | @@ -288,7 +300,14 @@ Page({ | ||
288 | }); | 300 | }); |
289 | // }; | 301 | // }; |
290 | } | 302 | } |
291 | - }) | 303 | + }); |
304 | + // wx.setStorageSync('score',30); | ||
305 | + console.log('score',wx.getStorageSync('score')); | ||
306 | + if(wx.getStorageSync('score') !== '' && wx.getStorageSync('score')>=80) { | ||
307 | + self.setData({show_gold_modal:true}) | ||
308 | + }else if(wx.getStorageSync('score') !== '' && wx.getStorageSync('score')<80) { | ||
309 | + self.setData({show_normal_modal:true}) | ||
310 | + } | ||
292 | }, | 311 | }, |
293 | //获取首页内容 | 312 | //获取首页内容 |
294 | getIndex(res) { | 313 | getIndex(res) { |
@@ -377,4 +396,32 @@ Page({ | @@ -377,4 +396,32 @@ Page({ | ||
377 | this.setData({hidden_top: false}) | 396 | this.setData({hidden_top: false}) |
378 | } | 397 | } |
379 | }, | 398 | }, |
399 | + /** | ||
400 | + * 用户点击右上角分享 | ||
401 | + */ | ||
402 | + onShareAppMessage: function () { | ||
403 | + let self = this; | ||
404 | + self.setData({show_gold_modal:false}); | ||
405 | + // 设置菜单中的转发按钮触发转发事件时的转发内容 | ||
406 | + var shareObj = { | ||
407 | + title: '火柴西路', // 默认是小程序的名称(可以写slogan等) | ||
408 | + path: '', // 默认是当前页面,必须是以‘/’开头的完整路径 | ||
409 | + imageUrl: '', //自定义图片路径,可以是本地文件路径、代码包文件路径或者网络图片路径,支持PNG及JPG,不传入 imageUrl 则使用默认截图。显示图片长宽比是 5:4 | ||
410 | + success: function (res) { | ||
411 | + if (res.errMsg == 'shareAppMessage:ok') { | ||
412 | + } | ||
413 | + }, | ||
414 | + fail: function () { | ||
415 | + // 转发失败之后的回调 | ||
416 | + if (res.errMsg == 'shareAppMessage:fail cancel') { | ||
417 | + // 用户取消转发 | ||
418 | + } else if (res.errMsg == 'shareAppMessage:fail') { | ||
419 | + // 转发失败,其中 detail message 为详细失败信息 | ||
420 | + } | ||
421 | + }, | ||
422 | + complete: function () { | ||
423 | + // 转发结束之后的回调(转发成不成功都会执行) | ||
424 | + } | ||
425 | + } | ||
426 | + }, | ||
380 | }); | 427 | }); |
@@ -166,4 +166,28 @@ | @@ -166,4 +166,28 @@ | ||
166 | </view> | 166 | </view> |
167 | </view> | 167 | </view> |
168 | <view class="modal_box" wx:if="{{is_showRelease}}" bindtap="handleBackground" catchtouchmove="disableScroll"></view> | 168 | <view class="modal_box" wx:if="{{is_showRelease}}" bindtap="handleBackground" catchtouchmove="disableScroll"></view> |
169 | + | ||
170 | + | ||
171 | + <!--分数>=80弹框--> | ||
172 | + <view class="input-box score-box" wx:if="{{show_gold_modal}}" catchtouchmove="disableScroll"> | ||
173 | + <image class="sorry-img gold-img" src="../../images/gold@2x.png"></image> | ||
174 | + <view class="title text">恭喜您</view> | ||
175 | + <view class="title text">获得首批入场卷</view> | ||
176 | + <view class="tips text">并得到一枚金火柴等级勋章</view> | ||
177 | + <view class="tips share-text">将喜悦分享给好友</view> | ||
178 | + <view class="share-box"> | ||
179 | + <view class="answer-btn close" catchtap="close">完成</view> | ||
180 | + <button class="answer-btn share" open-type="share">去分享</button> | ||
181 | + </view> | ||
182 | + </view> | ||
183 | + <view class="modal_box" wx:if="{{show_gold_modal}}" bindtap="handleBackground" catchtouchmove="disableScroll"></view> | ||
184 | + | ||
185 | + <!--分数<80弹框--> | ||
186 | + <view class="input-box score-box normal-box" wx:if="{{show_normal_modal}}" catchtouchmove="disableScroll"> | ||
187 | + <image class="sorry-img img" src="../../images/achieve-answer-img@2x.png"></image> | ||
188 | + <view class="title text margin">恭喜您获得入场卷</view> | ||
189 | + <view class="title text margin">等待开放权限</view> | ||
190 | + <view class="answer-btn close close-btn" catchtap="close">随便看看</view> | ||
191 | + </view> | ||
192 | + <view class="modal_box" wx:if="{{show_normal_modal}}" bindtap="handleBackground" catchtouchmove="disableScroll"></view> | ||
169 | </view> | 193 | </view> |
@@ -526,7 +526,7 @@ swiper { | @@ -526,7 +526,7 @@ swiper { | ||
526 | top: 48%; | 526 | top: 48%; |
527 | left: 50%; | 527 | left: 50%; |
528 | transform: translate(-50%,-50%); | 528 | transform: translate(-50%,-50%); |
529 | - padding: 46rpx 88rpx; | 529 | + padding: 46rpx 78rpx; |
530 | -webkit-box-sizing: border-box; | 530 | -webkit-box-sizing: border-box; |
531 | -moz-box-sizing: border-box; | 531 | -moz-box-sizing: border-box; |
532 | box-sizing: border-box; | 532 | box-sizing: border-box; |
@@ -592,3 +592,61 @@ swiper { | @@ -592,3 +592,61 @@ swiper { | ||
592 | color: #ffffff; | 592 | color: #ffffff; |
593 | font-size: 26rpx; | 593 | font-size: 26rpx; |
594 | } | 594 | } |
595 | +.score-box { | ||
596 | + height:696rpx; | ||
597 | + /* top:68%; */ | ||
598 | + background-image: url('http://pk86rwhci.bkt.clouddn.com/dsdfhgfhfdh@2x.png'); | ||
599 | + background-repeat: no-repeat; | ||
600 | + -webkit-background-size: 100%; | ||
601 | + background-size: 100%; | ||
602 | + background-color: transparent; | ||
603 | + border-radius: 0; | ||
604 | + /* top:29%; */ | ||
605 | +} | ||
606 | +.score-box .gold-img { | ||
607 | + width: 212rpx; | ||
608 | + height: 212rpx; | ||
609 | + margin-top: -56rpx; | ||
610 | + margin-bottom: 0; | ||
611 | +} | ||
612 | +.share-box { | ||
613 | + display: flex; | ||
614 | + align-items: center; | ||
615 | + justify-content: space-between; | ||
616 | +} | ||
617 | +.share-box .close, .share-box .share { | ||
618 | + width: 200rpx; | ||
619 | + height: 66rpx; | ||
620 | + margin-top: 0; | ||
621 | +} | ||
622 | +.share-box .close { | ||
623 | + margin-right: 20rpx; | ||
624 | +} | ||
625 | +.share-box .share { | ||
626 | + padding: 0; | ||
627 | +} | ||
628 | +.share-box .share::after { | ||
629 | + border:0; | ||
630 | +} | ||
631 | +.score-box .share-text { | ||
632 | + margin: 56rpx 0 26rpx 0; | ||
633 | +} | ||
634 | +.score-box .text { | ||
635 | + margin-bottom: 10rpx; | ||
636 | + font-size: 36rpx; | ||
637 | + color:#343434; | ||
638 | +} | ||
639 | +.score-box .img { | ||
640 | + width: 106rpx; | ||
641 | + height: 106rpx; | ||
642 | +} | ||
643 | +.margin { | ||
644 | + margin-top: 30rpx; | ||
645 | +} | ||
646 | +.normal-box { | ||
647 | + height: 540rpx; | ||
648 | + background-image: url('http://pk86rwhci.bkt.clouddn.com/safsfdsghk@2x.png'); | ||
649 | +} | ||
650 | +.normal-box .close-btn { | ||
651 | + margin-top: 52rpx; | ||
652 | +} |
@@ -20,6 +20,7 @@ Page({ | @@ -20,6 +20,7 @@ Page({ | ||
20 | list: [], | 20 | list: [], |
21 | page_number:1, | 21 | page_number:1, |
22 | hasMore:true, | 22 | hasMore:true, |
23 | + city_params:'', | ||
23 | }, | 24 | }, |
24 | goPostDetail(e) { | 25 | goPostDetail(e) { |
25 | const id = +e.currentTarget.dataset.id; | 26 | const id = +e.currentTarget.dataset.id; |
@@ -143,6 +144,12 @@ Page({ | @@ -143,6 +144,12 @@ Page({ | ||
143 | * 生命周期函数--监听页面加载 | 144 | * 生命周期函数--监听页面加载 |
144 | */ | 145 | */ |
145 | onLoad: function (options) { | 146 | onLoad: function (options) { |
147 | + console.log('options',options); | ||
148 | + if(options.city !== 'null') { | ||
149 | + this.setData({city_params:JSON.parse(options.city)}); | ||
150 | + console.log('load里的调用'); | ||
151 | + // this.getTypeList(); | ||
152 | + } | ||
146 | 153 | ||
147 | }, | 154 | }, |
148 | 155 | ||
@@ -158,9 +165,9 @@ Page({ | @@ -158,9 +165,9 @@ Page({ | ||
158 | console.log('city',self.data.city); | 165 | console.log('city',self.data.city); |
159 | let url = '/portal/Index/meal'; | 166 | let url = '/portal/Index/meal'; |
160 | let params = { | 167 | let params = { |
161 | - lat: self.data.latitude, | ||
162 | - lng: self.data.longitude, | ||
163 | - addr: self.data.city, // 浮点型 必填 - - 用户位置名称 | 168 | + lat: self.data.city_params !== ''?self.data.city_params.lat:self.data.latitude, |
169 | + lng: self.data.city_params !== ''?self.data.city_params.lng:self.data.longitude, | ||
170 | + addr: self.data.city_params !== ''?self.data.city_params.name:self.data.city, // 浮点型 必填 - - 用户位置名称 | ||
164 | keyword: '', // 浮点型 非必填 - - 搜索关键字 | 171 | keyword: '', // 浮点型 非必填 - - 搜索关键字 |
165 | score: self.data.score, // 浮点型 非必填 - - 排序(1智能排序,2最具人气,3距离最近) | 172 | score: self.data.score, // 浮点型 非必填 - - 排序(1智能排序,2最具人气,3距离最近) |
166 | startTime: self.data.start_time_date,// 浮点型 非必填 - - 筛选开始时间 | 173 | startTime: self.data.start_time_date,// 浮点型 非必填 - - 筛选开始时间 |
@@ -222,7 +229,10 @@ Page({ | @@ -222,7 +229,10 @@ Page({ | ||
222 | */ | 229 | */ |
223 | onShow: function () { | 230 | onShow: function () { |
224 | const self = this; | 231 | const self = this; |
232 | + // if(self.data.city !== 'null') { | ||
233 | + // console.log('show里的调用'); | ||
225 | self.getLocation(); | 234 | self.getLocation(); |
235 | + // } | ||
226 | }, | 236 | }, |
227 | 237 | ||
228 | /** | 238 | /** |
@@ -74,7 +74,11 @@ Page({ | @@ -74,7 +74,11 @@ Page({ | ||
74 | }, | 74 | }, |
75 | //输入截止时间 | 75 | //输入截止时间 |
76 | inputOverTime(e) { | 76 | inputOverTime(e) { |
77 | - this.setData({over_time:e.detail.value}) | 77 | + this.setData({over_time:e.detail.value}); |
78 | + if(this.data.over_time.indexOf('.') !== -1) { | ||
79 | + wx.showToast({title:'截止时间为整数',icon:'none'}); | ||
80 | + this.setData({over_time:''}); | ||
81 | + } | ||
78 | }, | 82 | }, |
79 | //获取分类 | 83 | //获取分类 |
80 | getType() { | 84 | getType() { |
@@ -89,7 +89,7 @@ | @@ -89,7 +89,7 @@ | ||
89 | </view> | 89 | </view> |
90 | <view class="time-limit"> | 90 | <view class="time-limit"> |
91 | <text class="limit-title">时限 开餐前</text> | 91 | <text class="limit-title">时限 开餐前</text> |
92 | - <input type="number" bindinput="inputOverTime" value=""/> | 92 | + <input type="number" bindinput="inputOverTime" value="{{over_time}}"/> |
93 | <text>小时 停止拼餐</text> | 93 | <text>小时 停止拼餐</text> |
94 | </view> | 94 | </view> |
95 | </view> | 95 | </view> |
@@ -16,6 +16,7 @@ Page({ | @@ -16,6 +16,7 @@ Page({ | ||
16 | phone_number:'', | 16 | phone_number:'', |
17 | phone_number_params:'', | 17 | phone_number_params:'', |
18 | introduce:'', | 18 | introduce:'', |
19 | + is_change:false, | ||
19 | }, | 20 | }, |
20 | //选择性别 | 21 | //选择性别 |
21 | sexPickerChange(e) { | 22 | sexPickerChange(e) { |
@@ -88,7 +89,18 @@ Page({ | @@ -88,7 +89,18 @@ Page({ | ||
88 | this.setData({ | 89 | this.setData({ |
89 | currentnum: len, | 90 | currentnum: len, |
90 | introduce: textcontent, | 91 | introduce: textcontent, |
91 | - }) | 92 | + }); |
93 | + console.log('textcontent', textcontent); | ||
94 | + if(this.data.current_sex !== undefined && | ||
95 | + this.data.country !== '' && | ||
96 | + this.data.city !== '' && | ||
97 | + this.data.phone_number !== '' && | ||
98 | + !this.data.is_wrong_phone && | ||
99 | + this.data.introduce !== '') { | ||
100 | + this.setData({is_change:true}); | ||
101 | + }else { | ||
102 | + this.setData({is_change:false}); | ||
103 | + } | ||
92 | } | 104 | } |
93 | }, | 105 | }, |
94 | //保存 | 106 | //保存 |
@@ -38,7 +38,7 @@ | @@ -38,7 +38,7 @@ | ||
38 | <view class='word_num'>{{currentnum}}/{{maxlength}}</view> | 38 | <view class='word_num'>{{currentnum}}/{{maxlength}}</view> |
39 | </view> | 39 | </view> |
40 | </view> | 40 | </view> |
41 | - <view class="complete" bindtap="submit"> | 41 | + <view class="complete {{!is_change?'gray':''}}" bindtap="submit"> |
42 | <view class="btn">完成</view> | 42 | <view class="btn">完成</view> |
43 | </view> | 43 | </view> |
44 | </view> | 44 | </view> |
1 | <!--pages/my/my.wxml--> | 1 | <!--pages/my/my.wxml--> |
2 | <view class="head-box"> | 2 | <view class="head-box"> |
3 | <view wx:if="{{isLogin}}" bindtap="EditUserInfo"> | 3 | <view wx:if="{{isLogin}}" bindtap="EditUserInfo"> |
4 | - <view class="head"></view> | 4 | + <view class="head" style="background-image: {{user.pic!==''?user.pic:''}}"></view> |
5 | <!--<image src="../../images/user-img@2x.png" class="user-img"></image>--> | 5 | <!--<image src="../../images/user-img@2x.png" class="user-img"></image>--> |
6 | <image src="{{user.pic}}" class="user-img"></image> | 6 | <image src="{{user.pic}}" class="user-img"></image> |
7 | <view class="left"> | 7 | <view class="left"> |
-
请 注册 或 登录 后发表评论