优化我的钱包背景图,添加倒计时结束调用的接口,发布和参与添加formid,添加城市切换
正在显示
37 个修改的文件
包含
472 行增加
和
168 行删除
@@ -106,7 +106,7 @@ App({ | @@ -106,7 +106,7 @@ App({ | ||
106 | header: header, | 106 | header: header, |
107 | success: function (res) {//返回取得的数据 | 107 | success: function (res) {//返回取得的数据 |
108 | // console.log('返回取得的数据res', res); | 108 | // console.log('返回取得的数据res', res); |
109 | - if(res.data.code == 1){ | 109 | + if(+res.data.code == 1){ |
110 | resolve(res.data); | 110 | resolve(res.data); |
111 | }else if (res.data.code == '20000') { | 111 | }else if (res.data.code == '20000') { |
112 | console.log('20000'); | 112 | console.log('20000'); |
@@ -127,50 +127,14 @@ App({ | @@ -127,50 +127,14 @@ App({ | ||
127 | } | 127 | } |
128 | }); | 128 | }); |
129 | resolve(res.data.data); | 129 | resolve(res.data.data); |
130 | - } else if (res.data.data.code == '30000') { | ||
131 | - resolve(res.data); | ||
132 | - } else if (res.data.data.code == '40001') {//返回错误提示信息 | ||
133 | - console.log(555); | ||
134 | - wx.showModal({ | ||
135 | - title: '提示', | ||
136 | - content: res.data.data.msg, | ||
137 | - showCancel: false, | ||
138 | - success: function (res) { | ||
139 | - if (res.confirm) { | ||
140 | - // wx.removeStorageSync('token'); | ||
141 | - // wx.navigateTo({ | ||
142 | - // url: '/pages/start/start', | ||
143 | - // }) | ||
144 | - } | ||
145 | - } | ||
146 | - }); | ||
147 | - resolve(res.data.msg); | ||
148 | - } else if (res.data.code == '40000') { | ||
149 | - console.log(333); | ||
150 | - // wx.showModal({ | ||
151 | - // title: '提示', | ||
152 | - // content: res.data.data.msg, | ||
153 | - // showCancel: false, | ||
154 | - // success: function (res) { } | ||
155 | - // }); | ||
156 | - resolve(res.data.data); | ||
157 | - } else if (res.data.data.code == '40106') { | ||
158 | - console.log('重复绑定'); | ||
159 | - resolve(res.data.data); | ||
160 | - } else if (res.data.data.code == '40107') { | ||
161 | - console.log('手机号已注册'); | ||
162 | - resolve(res.data.data); | ||
163 | - } else if (res.data.data.code == '40111') { | ||
164 | - console.log('新旧密码不能相同'); | ||
165 | - resolve(res.data.data); | ||
166 | - } else { | 130 | + } else if(+res.data.code === 0){ |
167 | console.log('code=0'); | 131 | console.log('code=0'); |
168 | console.log(res.data); | 132 | console.log(res.data); |
169 | wx.showModal({ | 133 | wx.showModal({ |
170 | title: '提示', | 134 | title: '提示', |
171 | content: res.data.message, | 135 | content: res.data.message, |
172 | showCancel: false, | 136 | showCancel: false, |
173 | - }) | 137 | + }); |
174 | resolve(res.data.data); | 138 | resolve(res.data.data); |
175 | reject(res.data) | 139 | reject(res.data) |
176 | } | 140 | } |
@@ -20,6 +20,7 @@ | @@ -20,6 +20,7 @@ | ||
20 | "pages/my/suggest/suggest", | 20 | "pages/my/suggest/suggest", |
21 | "pages/my/about/about", | 21 | "pages/my/about/about", |
22 | "pages/meal/meal", | 22 | "pages/meal/meal", |
23 | + "pages/meal/detail/detail", | ||
23 | "pages/order/complain/complain", | 24 | "pages/order/complain/complain", |
24 | "pages/order/order-detail/order-detail", | 25 | "pages/order/order-detail/order-detail", |
25 | "pages/comment/comment" | 26 | "pages/comment/comment" |
images/end-flag@2x.png
0 → 100644
12.0 KB
@@ -150,12 +150,12 @@ Page({ | @@ -150,12 +150,12 @@ Page({ | ||
150 | address: this.data.address_position, | 150 | address: this.data.address_position, |
151 | latng: this.data.latng, | 151 | latng: this.data.latng, |
152 | over_time:this.data.over_time,// 报名截止时间 | 152 | over_time:this.data.over_time,// 报名截止时间 |
153 | - // formId: e.detail.formId, | 153 | + formId: e.detail.formId, |
154 | }; | 154 | }; |
155 | app.post(url, params, {}).then((res) => { | 155 | app.post(url, params, {}).then((res) => { |
156 | console.log('确定发布', res); | 156 | console.log('确定发布', res); |
157 | if(+res.code === 1 && res.message == '发布成功') { | 157 | if(+res.code === 1 && res.message == '发布成功') { |
158 | - this.setData({is_showRelease_modal:true,id:+res.data.id}) | 158 | + this.setData({is_showRelease_modal:true,id:+res.data.activeId}) |
159 | }else { | 159 | }else { |
160 | wx.showToast({title:res.message,icon:'none'}) | 160 | wx.showToast({title:res.message,icon:'none'}) |
161 | } | 161 | } |
1 | <!--pages/activity/activity.wxml--> | 1 | <!--pages/activity/activity.wxml--> |
2 | -<!--<form bindsubmit="confirmRelease" bindreset="formReset" report-submit="true">--> | ||
3 | -<view class="content"> | 2 | +<form bindsubmit="confirmRelease" bindreset="formReset" report-submit="true"> |
3 | + <view class="content"> | ||
4 | <view class="input-box"> | 4 | <view class="input-box"> |
5 | <input type="text" placeholder="标题" bindinput="inputTitle" maxlength="15" placeholder-class="placeholder"/> | 5 | <input type="text" placeholder="标题" bindinput="inputTitle" maxlength="15" placeholder-class="placeholder"/> |
6 | <textarea maxlength="-1" type="text" placeholder="发布描述..." bindinput="inputContent" | 6 | <textarea maxlength="-1" type="text" placeholder="发布描述..." bindinput="inputContent" |
@@ -35,7 +35,8 @@ | @@ -35,7 +35,8 @@ | ||
35 | </view> | 35 | </view> |
36 | <view class="min-num"> | 36 | <view class="min-num"> |
37 | <text class="title type-title">类别</text> | 37 | <text class="title type-title">类别</text> |
38 | - <picker bindchange="bindTypeChange" value="{{current_type}}" range="{{type_picker_list}}" class="picker"> | 38 | + <picker bindchange="bindTypeChange" value="{{current_type}}" range="{{type_picker_list}}" |
39 | + class="picker"> | ||
39 | <view class="input"> | 40 | <view class="input"> |
40 | <text class="variety-text">{{type_picker_list[current_type]}}</text> | 41 | <text class="variety-text">{{type_picker_list[current_type]}}</text> |
41 | <!--<text class="variety-text" wx:else>{{pet_info.sex===2?'MM':'GG'}}</text>--> | 42 | <!--<text class="variety-text" wx:else>{{pet_info.sex===2?'MM':'GG'}}</text>--> |
@@ -46,7 +47,8 @@ | @@ -46,7 +47,8 @@ | ||
46 | </view> | 47 | </view> |
47 | <view class="time-box"> | 48 | <view class="time-box"> |
48 | <text class="time-title">时间</text> | 49 | <text class="time-title">时间</text> |
49 | - <picker mode='date' bindchange="bindDateChange" value='{{date}}' start="{{start_time}}" end='2060-01-01'> | 50 | + <picker mode='date' bindchange="bindDateChange" value='{{date}}' start="{{start_time}}" |
51 | + end='2060-01-01'> | ||
50 | <view class='select'> | 52 | <view class='select'> |
51 | <view class="picker">{{month}} | 53 | <view class="picker">{{month}} |
52 | <text class="iconfont icon-xiangxia min-icon"></text> | 54 | <text class="iconfont icon-xiangxia min-icon"></text> |
@@ -61,8 +63,8 @@ | @@ -61,8 +63,8 @@ | ||
61 | </picker> | 63 | </picker> |
62 | <picker mode="time" | 64 | <picker mode="time" |
63 | value="{{time}}" | 65 | value="{{time}}" |
64 | - start="09:01" | ||
65 | - end="21:01" | 66 | + start="00:00" |
67 | + end="24:00" | ||
66 | bindchange="bindTimeChange"> | 68 | bindchange="bindTimeChange"> |
67 | <view class='select'> | 69 | <view class='select'> |
68 | <view class="picker">{{hour}} | 70 | <view class="picker">{{hour}} |
@@ -93,18 +95,19 @@ | @@ -93,18 +95,19 @@ | ||
93 | </view> | 95 | </view> |
94 | </view> | 96 | </view> |
95 | 97 | ||
96 | - <!--<button class="complete" form-type="submit">--> | ||
97 | - <view class="complete" bindtap="confirmRelease"> | 98 | + <button class="complete" form-type="submit"> |
99 | + <!--<view class="complete" bindtap="confirmRelease">--> | ||
98 | <view class="btn">确定发布</view> | 100 | <view class="btn">确定发布</view> |
101 | + <!--</view>--> | ||
102 | + </button> | ||
99 | </view> | 103 | </view> |
100 | - <!--</button>--> | ||
101 | -</view> | ||
102 | -<!--发布成功弹框--> | ||
103 | -<view class="modal" wx:if="{{is_showRelease_modal}}" catchtouchmove="disableScroll"> | 104 | + <!--发布成功弹框--> |
105 | + <view class="modal" wx:if="{{is_showRelease_modal}}" catchtouchmove="disableScroll"> | ||
104 | <image class="sorry-img" src="../../images/success@2x.png"></image> | 106 | <image class="sorry-img" src="../../images/success@2x.png"></image> |
105 | <view class="title">恭喜您发布成功</view> | 107 | <view class="title">恭喜您发布成功</view> |
106 | <view class="view-btn" catchtap="goMyRelease">查看我的发布</view> | 108 | <view class="view-btn" catchtap="goMyRelease">查看我的发布</view> |
107 | <view class="complete-btn" catchtap="goBack">完成</view> | 109 | <view class="complete-btn" catchtap="goBack">完成</view> |
108 | -</view> | ||
109 | -<view class="modal_box" wx:if="{{is_showRelease_modal}}" bindtap="handleBackground" catchtouchmove="disableScroll"></view> | ||
110 | -<!--</form>--> | 110 | + </view> |
111 | + <view class="modal_box" wx:if="{{is_showRelease_modal}}" bindtap="handleBackground" | ||
112 | + catchtouchmove="disableScroll"></view> | ||
113 | +</form> |
@@ -149,6 +149,10 @@ | @@ -149,6 +149,10 @@ | ||
149 | min-height: 38rpx; | 149 | min-height: 38rpx; |
150 | border:1rpx solid #eee; | 150 | border:1rpx solid #eee; |
151 | padding: 0 10rpx; | 151 | padding: 0 10rpx; |
152 | + overflow : hidden; | ||
153 | + display: -webkit-box; | ||
154 | + -webkit-line-clamp: 1; | ||
155 | + -webkit-box-orient: vertical; | ||
152 | } | 156 | } |
153 | .icon-location { | 157 | .icon-location { |
154 | color: #C7C7C7; | 158 | color: #C7C7C7; |
@@ -194,7 +194,8 @@ Page({ | @@ -194,7 +194,8 @@ Page({ | ||
194 | min: '00', | 194 | min: '00', |
195 | sec: '00' | 195 | sec: '00' |
196 | }; | 196 | }; |
197 | - clearTimeout(t) | 197 | + clearTimeout(t); |
198 | + this.end() | ||
198 | } | 199 | } |
199 | countDownArr.push(obj); | 200 | countDownArr.push(obj); |
200 | // 渲染,然后每隔一秒执行一次倒计时函数 | 201 | // 渲染,然后每隔一秒执行一次倒计时函数 |
@@ -204,21 +205,65 @@ Page({ | @@ -204,21 +205,65 @@ Page({ | ||
204 | }); | 205 | }); |
205 | // console.log('time',this.data.detail.time); | 206 | // console.log('time',this.data.detail.time); |
206 | }, | 207 | }, |
207 | - | 208 | + //倒计时结束 |
209 | + end() { | ||
210 | + const self = this; | ||
211 | + let url = '/portal/Active/activity'; | ||
212 | + let params = { | ||
213 | + activeId: self.data.detail_id, | ||
214 | + }; | ||
215 | + let header = { | ||
216 | + "token": wx.getStorageSync('token') | ||
217 | + }; | ||
218 | + app.post(url, params, {}).then((res) => { | ||
219 | + console.log('倒计时结束', res); | ||
220 | + if (+res.code === 1) { | ||
221 | + // wx.showToast({title:'拼活动结束',icon:'success'}) | ||
222 | + } | ||
223 | + }) | ||
224 | + }, | ||
208 | //导航 | 225 | //导航 |
209 | getNavigate() { | 226 | getNavigate() { |
210 | const self = this; | 227 | const self = this; |
211 | - const arr = self.data.detail.latng.split(); | ||
212 | - console.log('arr', arr[0], arr[1]); | 228 | + const arr = self.data.detail.latng.split(','); |
229 | + console.log('arr',arr,arr[0],arr[1]); | ||
213 | wx.openLocation({//使用微信内置地图查看位置。 | 230 | wx.openLocation({//使用微信内置地图查看位置。 |
214 | - latitude: +arr[0],//要去的纬度-地址 | ||
215 | - longitude: +arr[1],//要去的经度-地址 | 231 | + latitude: +arr[1],//要去的纬度-地址 |
232 | + longitude: +arr[0],//要去的经度-地址 | ||
216 | // lat:39.086437, | 233 | // lat:39.086437, |
217 | // lng:117.122583, | 234 | // lng:117.122583, |
218 | - name: "", | 235 | + name: self.data.detail.address, |
219 | address: self.data.detail.address | 236 | address: self.data.detail.address |
220 | }) | 237 | }) |
221 | }, | 238 | }, |
239 | + //确认拼活动 | ||
240 | + confirmJoin(e) { | ||
241 | + const self = this; | ||
242 | + let url = '/portal/Active/join'; | ||
243 | + let params = { | ||
244 | + token: wx.getStorageSync('token'), | ||
245 | + number: self.data.num, | ||
246 | + activeId: self.data.detail_id, | ||
247 | + formId: e.detail.formId, | ||
248 | + }; | ||
249 | + let header = { | ||
250 | + "token": wx.getStorageSync('token') | ||
251 | + }; | ||
252 | + app.post(url, params, {}).then((res) => { | ||
253 | + console.log('确认拼餐', res); | ||
254 | + if (+res.code === 1) { | ||
255 | + wx.showToast({title:'拼餐成功',icon:'success'}) | ||
256 | + // self.setData({ | ||
257 | + // detail: res.data.active, | ||
258 | + // end_time: res.data.active.time, | ||
259 | + // over_hours:res.data.active.over_time,//几小时截止 | ||
260 | + // join_people: res.data.son, | ||
261 | + // commenList:res.data.common | ||
262 | + // }); | ||
263 | + // self.countDown(); | ||
264 | + } | ||
265 | + }) | ||
266 | + }, | ||
222 | /** | 267 | /** |
223 | * 生命周期函数--监听页面加载 | 268 | * 生命周期函数--监听页面加载 |
224 | */ | 269 | */ |
1 | <!--pages/activity/detail/detail.wxml--> | 1 | <!--pages/activity/detail/detail.wxml--> |
2 | -<view class="content"> | 2 | +<form bindsubmit="confirmJoin" bindreset="formReset" report-submit="true"> |
3 | + <view class="content"> | ||
3 | <!--swiper--> | 4 | <!--swiper--> |
4 | <view class="head"> | 5 | <view class="head"> |
5 | <view class="position {{hidden_top?'hidden-active':'visible-active'}}"> | 6 | <view class="position {{hidden_top?'hidden-active':'visible-active'}}"> |
@@ -54,7 +55,8 @@ | @@ -54,7 +55,8 @@ | ||
54 | <view class="title">{{detail.title}}</view> | 55 | <view class="title">{{detail.title}}</view> |
55 | <view class="over-time"> | 56 | <view class="over-time"> |
56 | <text class=''>{{detail.time[0].hou}}:{{detail.time[0].min}}:{{detail.time[0].sec}}</text> | 57 | <text class=''>{{detail.time[0].hou}}:{{detail.time[0].min}}:{{detail.time[0].sec}}</text> |
57 | - 后停止拼餐</view> | 58 | + 后停止拼餐 |
59 | + </view> | ||
58 | <!--<view>--> | 60 | <!--<view>--> |
59 | <!--<text class=''>{{detail.time[0].hou}}</text>--> | 61 | <!--<text class=''>{{detail.time[0].hou}}</text>--> |
60 | <!--<text>:</text>--> | 62 | <!--<text>:</text>--> |
@@ -83,7 +85,9 @@ | @@ -83,7 +85,9 @@ | ||
83 | <view class="join-num">已加入人员</view> | 85 | <view class="join-num">已加入人员</view> |
84 | <view class="people-list" wx:if="{{join_people.length>0}}"> | 86 | <view class="people-list" wx:if="{{join_people.length>0}}"> |
85 | <view class="people" wx:for="{{join_people}}" wx:key="index"> | 87 | <view class="people" wx:for="{{join_people}}" wx:key="index"> |
86 | - <view class="bg"><image src="{{item.pic}}" class="people-img"></image></view> | 88 | + <view class="bg"> |
89 | + <image src="{{item.pic}}" class="people-img"></image> | ||
90 | + </view> | ||
87 | <view class="name">{{item.name}}</view> | 91 | <view class="name">{{item.name}}</view> |
88 | </view> | 92 | </view> |
89 | </view> | 93 | </view> |
@@ -147,8 +151,9 @@ | @@ -147,8 +151,9 @@ | ||
147 | <view class='iconfont icon-jia1' bindtap='addCount'></view> | 151 | <view class='iconfont icon-jia1' bindtap='addCount'></view> |
148 | </view> | 152 | </view> |
149 | </view> | 153 | </view> |
150 | - <view class="confirm-join-btn"> | 154 | + <button class="confirm-join-btn" form-type="submit"> |
151 | <text>确认拼活动</text> | 155 | <text>确认拼活动</text> |
156 | + </button> | ||
152 | </view> | 157 | </view> |
153 | </view> | 158 | </view> |
154 | -</view> | 159 | +</form> |
@@ -257,7 +257,7 @@ swiper { | @@ -257,7 +257,7 @@ swiper { | ||
257 | -webkit-box-sizing: border-box; | 257 | -webkit-box-sizing: border-box; |
258 | -moz-box-sizing: border-box; | 258 | -moz-box-sizing: border-box; |
259 | box-sizing: border-box; | 259 | box-sizing: border-box; |
260 | - margin-bottom: 100rpx; | 260 | + padding-bottom: 100rpx; |
261 | } | 261 | } |
262 | .comment-box .title-box { | 262 | .comment-box .title-box { |
263 | display: flex; | 263 | display: flex; |
@@ -296,6 +296,10 @@ swiper { | @@ -296,6 +296,10 @@ swiper { | ||
296 | justify-content: space-between; | 296 | justify-content: space-between; |
297 | 297 | ||
298 | } | 298 | } |
299 | +.top-left { | ||
300 | + display: flex; | ||
301 | + align-items: center; | ||
302 | +} | ||
299 | .top-left .release-img{ | 303 | .top-left .release-img{ |
300 | width: 40rpx; | 304 | width: 40rpx; |
301 | height: 40rpx; | 305 | height: 40rpx; |
@@ -395,6 +399,12 @@ swiper { | @@ -395,6 +399,12 @@ swiper { | ||
395 | color:#E1C8AF; | 399 | color:#E1C8AF; |
396 | background-color: #323232; | 400 | background-color: #323232; |
397 | font-size: 30rpx; | 401 | font-size: 30rpx; |
402 | + border-radius: 0; | ||
403 | + margin: 0; | ||
404 | + padding: 0; | ||
405 | +} | ||
406 | +.confirm-join-btn::after { | ||
407 | + border:0; | ||
398 | } | 408 | } |
399 | .input_box { | 409 | .input_box { |
400 | display: flex; | 410 | display: flex; |
@@ -29,32 +29,62 @@ Page({ | @@ -29,32 +29,62 @@ Page({ | ||
29 | noticeList: [], | 29 | noticeList: [], |
30 | is_showAnswer: false, | 30 | is_showAnswer: false, |
31 | is_showUserInfo: false, | 31 | is_showUserInfo: false, |
32 | - is_showRelease:false, | ||
33 | - is_write:2,//1:已填写,2:未填写 | 32 | + is_showRelease: false, |
33 | + is_write: 2,//1:已填写,2:未填写 | ||
34 | is_answer: false, | 34 | is_answer: false, |
35 | current_swiper: 0, | 35 | current_swiper: 0, |
36 | page_number: 1, | 36 | page_number: 1, |
37 | - | 37 | + cityList: [], |
38 | + addr:'', //切换地址 | ||
38 | 39 | ||
39 | motto: 'Hello World', | 40 | motto: 'Hello World', |
40 | userInfo: {}, | 41 | userInfo: {}, |
41 | hasUserInfo: false, | 42 | hasUserInfo: false, |
42 | canIUse: wx.canIUse('button.open-type.getUserInfo') | 43 | canIUse: wx.canIUse('button.open-type.getUserInfo') |
43 | }, | 44 | }, |
45 | + //获取城市列表 | ||
46 | + getCityList() { | ||
47 | + const self = this; | ||
48 | + let url = '/portal/Index/cityList'; | ||
49 | + app.post(url, {}, {}).then((res) => { | ||
50 | + console.log('获取城市列表', res); | ||
51 | + if (+res.code === 1) { | ||
52 | + const arr = []; | ||
53 | + res.data.list.forEach((item) => { | ||
54 | + arr.push(item.title) | ||
55 | + }); | ||
56 | + self.setData({ | ||
57 | + city_picker_list: arr, | ||
58 | + cityList:res.data.list, | ||
59 | + }); | ||
60 | + } | ||
61 | + }) | ||
62 | + }, | ||
63 | + //切换城市 | ||
64 | + cityPickerChange(e) { | ||
65 | + this.setData({ | ||
66 | + current_city: e.detail.value, | ||
67 | + // is_sex_change: true | ||
68 | + }); | ||
69 | + const lat = this.data.cityList[e.detail.value].latng.split(',')[1]; | ||
70 | + const lng = this.data.cityList[e.detail.value].latng.split(',')[0]; | ||
71 | + this.setData({lat: lat, lng: lng,addr:this.data.cityList[e.detail.value].title}); | ||
72 | + // console.log('lat', 'lng',lat,lng); | ||
73 | + this.getIndex(); | ||
74 | + }, | ||
44 | swiperChange(e) { | 75 | swiperChange(e) { |
45 | - // console.log(e); | ||
46 | this.setData({current_swiper: e.detail.current}) | 76 | this.setData({current_swiper: e.detail.current}) |
47 | }, | 77 | }, |
48 | //发布拼活动 | 78 | //发布拼活动 |
49 | releaseActivity() { | 79 | releaseActivity() { |
50 | - this.setData({is_showRelease:false,}); | 80 | + this.setData({is_showRelease: false,}); |
51 | wx.navigateTo({ | 81 | wx.navigateTo({ |
52 | url: '/pages/activity/activity', | 82 | url: '/pages/activity/activity', |
53 | }); | 83 | }); |
54 | }, | 84 | }, |
55 | //发布拼餐 | 85 | //发布拼餐 |
56 | releaseMeal() { | 86 | releaseMeal() { |
57 | - this.setData({is_showRelease:false,}); | 87 | + this.setData({is_showRelease: false,}); |
58 | wx.navigateTo({ | 88 | wx.navigateTo({ |
59 | url: '/pages/meal/meal', | 89 | url: '/pages/meal/meal', |
60 | }) | 90 | }) |
@@ -77,13 +107,14 @@ Page({ | @@ -77,13 +107,14 @@ Page({ | ||
77 | }, | 107 | }, |
78 | handleBackground() { | 108 | handleBackground() { |
79 | console.log('dianji'); | 109 | console.log('dianji'); |
80 | - this.setData({is_showAnswer: false, is_showUserInfo: false,is_showRelease:false,}) | 110 | + this.setData({is_showAnswer: false, is_showUserInfo: false, is_showRelease: false,}) |
81 | }, | 111 | }, |
82 | //进入分类详情 | 112 | //进入分类详情 |
83 | goTypeDetail(e) { | 113 | goTypeDetail(e) { |
84 | const id = +e.currentTarget.dataset.id; | 114 | const id = +e.currentTarget.dataset.id; |
115 | + const name = e.currentTarget.dataset.name; | ||
85 | wx.navigateTo({ | 116 | wx.navigateTo({ |
86 | - url: '/pages/index/type-detail/type-detail?id=' + id, | 117 | + url: '/pages/index/type-detail/type-detail?id=' + id + '&name=' + name, |
87 | }) | 118 | }) |
88 | }, | 119 | }, |
89 | //进入号外公告详情 | 120 | //进入号外公告详情 |
@@ -134,6 +165,7 @@ Page({ | @@ -134,6 +165,7 @@ Page({ | ||
134 | }) | 165 | }) |
135 | }, | 166 | }, |
136 | onLoad: function () { | 167 | onLoad: function () { |
168 | + this.getCityList(); | ||
137 | this._doRefreshMasonry(this.data.items) | 169 | this._doRefreshMasonry(this.data.items) |
138 | }, | 170 | }, |
139 | 171 | ||
@@ -193,21 +225,21 @@ Page({ | @@ -193,21 +225,21 @@ Page({ | ||
193 | release(e) { | 225 | release(e) { |
194 | console.log('发布'); | 226 | console.log('发布'); |
195 | const self = this; | 227 | const self = this; |
196 | - if (+self.data.is_write === 2 && wx.getStorageSync('is_canSend') === 2 ){ //没填写个人信息并且不可以发布 =>去填写 | 228 | + if (+self.data.is_write === 2 && wx.getStorageSync('is_canSend') === 2) { //没填写个人信息并且不可以发布 =>去填写 |
197 | self.setData({ | 229 | self.setData({ |
198 | is_showUserInfo: true //弹出 去填写个人信息弹框 | 230 | is_showUserInfo: true //弹出 去填写个人信息弹框 |
199 | }); | 231 | }); |
200 | 232 | ||
201 | - } else if(+self.data.is_write === 1 && wx.getStorageSync('is_canSend') === 2 && wx.getStorageSync('is_answer') === 2) { //已填写且不能发布=>去答题 | 233 | + } else if (+self.data.is_write === 1 && wx.getStorageSync('is_canSend') === 2 && wx.getStorageSync('is_answer') === 2) { //已填写且不能发布=>去答题 |
202 | self.setData({ | 234 | self.setData({ |
203 | is_showAnswer: true //弹出 去答题弹框 | 235 | is_showAnswer: true //弹出 去答题弹框 |
204 | }); | 236 | }); |
205 | - }else if(+self.data.is_write === 1 && wx.getStorageSync('is_canSend') === 1 && wx.getStorageSync('is_answer') === 1){ //已填写且可以发布 =>去发布 | 237 | + } else if (+self.data.is_write === 1 && wx.getStorageSync('is_canSend') === 1 && wx.getStorageSync('is_answer') === 1) { //已填写且可以发布 =>去发布 |
206 | self.setData({ | 238 | self.setData({ |
207 | is_showRelease: true //弹出 去答题弹框 | 239 | is_showRelease: true //弹出 去答题弹框 |
208 | }); | 240 | }); |
209 | - }else { | ||
210 | - wx.showToast({title:'等级不够,无法使用发布功能',icon:'none'}) | 241 | + } else if (+self.data.is_write === 1 && wx.getStorageSync('is_canSend') === 2 && wx.getStorageSync('is_answer') === 1) { |
242 | + wx.showToast({title: '等级不够,无法使用发布功能', icon: 'none'}) | ||
211 | } | 243 | } |
212 | }, | 244 | }, |
213 | //订单-导航 | 245 | //订单-导航 |
@@ -257,7 +289,8 @@ Page({ | @@ -257,7 +289,8 @@ Page({ | ||
257 | // console.log('show-callback-res', res); | 289 | // console.log('show-callback-res', res); |
258 | app.getLogin().then(function (res) { | 290 | app.getLogin().then(function (res) { |
259 | console.log('res', res); | 291 | console.log('res', res); |
260 | - self.getIndex(res.token)//获取首页 | 292 | + self.getIndex(res.token);//获取首页 |
293 | + self.getIsWrite(); //判断是否已填写个人信息 | ||
261 | }); | 294 | }); |
262 | // }; | 295 | // }; |
263 | } | 296 | } |
@@ -273,6 +306,7 @@ Page({ | @@ -273,6 +306,7 @@ Page({ | ||
273 | lng: self.data.lng, | 306 | lng: self.data.lng, |
274 | token: wx.getStorageSync('token'), | 307 | token: wx.getStorageSync('token'), |
275 | page: self.data.page_number, | 308 | page: self.data.page_number, |
309 | + addr: self.data.addr, | ||
276 | }; | 310 | }; |
277 | let header = { | 311 | let header = { |
278 | "token": wx.getStorageSync('token') | 312 | "token": wx.getStorageSync('token') |
@@ -287,10 +321,10 @@ Page({ | @@ -287,10 +321,10 @@ Page({ | ||
287 | noticeList: res.data.extra, | 321 | noticeList: res.data.extra, |
288 | meal_banner: res.data.meal, | 322 | meal_banner: res.data.meal, |
289 | items: res.data.active, | 323 | items: res.data.active, |
290 | - is_canSend:res.data.is_canSend, | 324 | + is_canSend: res.data.is_canSend, |
291 | }); | 325 | }); |
292 | - wx.setStorageSync('is_canSend',res.data.is_canSend);//1:可以发布2:不可以发布 | ||
293 | - wx.setStorageSync('is_answer',res.data.is_answer);//1:已答题2:未答题 | 326 | + wx.setStorageSync('is_canSend', res.data.is_canSend);//1:可以发布2:不可以发布 |
327 | + wx.setStorageSync('is_answer', res.data.is_answer);//1:已答题2:未答题 | ||
294 | // is_answer | 328 | // is_answer |
295 | self._doRefreshMasonry(res.data.active); | 329 | self._doRefreshMasonry(res.data.active); |
296 | // console.log(this.data.this_week_test_info); | 330 | // console.log(this.data.this_week_test_info); |
@@ -311,9 +345,9 @@ Page({ | @@ -311,9 +345,9 @@ Page({ | ||
311 | console.log('是否填写个人信息', res); | 345 | console.log('是否填写个人信息', res); |
312 | if (+res.code === 1) { | 346 | if (+res.code === 1) { |
313 | self.setData({ | 347 | self.setData({ |
314 | - is_write:res.data.is_write,//1:已填写2:未填写 | 348 | + is_write: res.data.is_write,//1:已填写2:未填写 |
315 | }); | 349 | }); |
316 | - wx.setStorageSync('is_write',res.data.is_write);//1:已填写2:未填写 | 350 | + wx.setStorageSync('is_write', res.data.is_write);//1:已填写2:未填写 |
317 | // console.log(this.data.this_week_test_info); | 351 | // console.log(this.data.this_week_test_info); |
318 | } | 352 | } |
319 | }) | 353 | }) |
@@ -334,7 +368,6 @@ Page({ | @@ -334,7 +368,6 @@ Page({ | ||
334 | // }) | 368 | // }) |
335 | console.log('index-show'); | 369 | console.log('index-show'); |
336 | console.log(app.globalData.userInfo); | 370 | console.log(app.globalData.userInfo); |
337 | - this.getIsWrite(); | ||
338 | }, | 371 | }, |
339 | onPageScroll(e) { | 372 | onPageScroll(e) { |
340 | // console.log('页面滚动', e); | 373 | // console.log('页面滚动', e); |
@@ -3,11 +3,13 @@ | @@ -3,11 +3,13 @@ | ||
3 | <!--swiper--> | 3 | <!--swiper--> |
4 | <view class="head"> | 4 | <view class="head"> |
5 | <view class="position {{hidden_top?'hidden-active':'visible-active'}}"> | 5 | <view class="position {{hidden_top?'hidden-active':'visible-active'}}"> |
6 | + <picker class="picker" bindchange="cityPickerChange" value="{{current_city}}" range="{{city_picker_list}}" class="picker"> | ||
6 | <view class="left"> | 7 | <view class="left"> |
7 | <view class="iconfont icon-location"></view> | 8 | <view class="iconfont icon-location"></view> |
8 | - <text>{{china_city}}</text> | 9 | + <text>{{city_picker_list[current_city] || china_city}}</text> |
9 | <view class="iconfont icon-arrow-down"></view> | 10 | <view class="iconfont icon-arrow-down"></view> |
10 | </view> | 11 | </view> |
12 | + </picker> | ||
11 | <view class="right" bindtap="search"> | 13 | <view class="right" bindtap="search"> |
12 | <view class="input"></view> | 14 | <view class="input"></view> |
13 | <view class="iconfont icon-arrow-down"></view> | 15 | <view class="iconfont icon-arrow-down"></view> |
@@ -34,7 +36,8 @@ | @@ -34,7 +36,8 @@ | ||
34 | <!--分类导航--> | 36 | <!--分类导航--> |
35 | <view class="padding-box"> | 37 | <view class="padding-box"> |
36 | <view class="navigator-box"> | 38 | <view class="navigator-box"> |
37 | - <view class="img-box" wx:for="{{cate}}" wx:key="index" bindtap="goTypeDetail" data-id="{{item.id}}"> | 39 | + <view class="img-box" wx:for="{{cate}}" wx:key="index" |
40 | + bindtap="goTypeDetail" data-id="{{item.id}}" data-name="{{item.name}}"> | ||
38 | <!--<image src="{{item.pic}}"></image>--> | 41 | <!--<image src="{{item.pic}}"></image>--> |
39 | <!--<view class="text">{{item.name}}</view>--> | 42 | <!--<view class="text">{{item.name}}</view>--> |
40 | <image src="{{item.pic}}"></image> | 43 | <image src="{{item.pic}}"></image> |
@@ -419,7 +419,7 @@ swiper { | @@ -419,7 +419,7 @@ swiper { | ||
419 | -webkit-box-sizing: border-box; | 419 | -webkit-box-sizing: border-box; |
420 | -moz-box-sizing: border-box; | 420 | -moz-box-sizing: border-box; |
421 | box-sizing: border-box; | 421 | box-sizing: border-box; |
422 | - margin-bottom:120rpx; | 422 | + padding-bottom:130rpx; |
423 | } | 423 | } |
424 | 424 | ||
425 | 425 |
@@ -21,10 +21,19 @@ Page({ | @@ -21,10 +21,19 @@ Page({ | ||
21 | page_number:1, | 21 | page_number:1, |
22 | hasMore:true, | 22 | hasMore:true, |
23 | }, | 23 | }, |
24 | - goPostDetail() { | 24 | + goPostDetail(e) { |
25 | + const id = +e.currentTarget.dataset.id; | ||
26 | + const type = +e.currentTarget.dataset.type; | ||
27 | + console.log('type', type); | ||
28 | + if(type === 1) { //1是活动,2是拼餐 | ||
25 | wx.navigateTo({ | 29 | wx.navigateTo({ |
26 | - url: '/pages/activity/detail/detail', | 30 | + url: '/pages/activity/detail/detail?id=' + id, |
27 | }) | 31 | }) |
32 | + }else { | ||
33 | + wx.navigateTo({ | ||
34 | + url: '/pages/meal/detail/detail?id=' + id, | ||
35 | + }) | ||
36 | + } | ||
28 | }, | 37 | }, |
29 | //搜索 | 38 | //搜索 |
30 | search() { | 39 | search() { |
@@ -63,7 +63,7 @@ | @@ -63,7 +63,7 @@ | ||
63 | <view class='content_box'> | 63 | <view class='content_box'> |
64 | <view class="no-data" wx:if="{{list.length === 0}}">暂无活动</view> | 64 | <view class="no-data" wx:if="{{list.length === 0}}">暂无活动</view> |
65 | <view class='content_item' wx:for='{{list}}' wx:key="index" wx:if="{{list.length>0}}" | 65 | <view class='content_item' wx:for='{{list}}' wx:key="index" wx:if="{{list.length>0}}" |
66 | - bindtap='goPostDetail' data-index="{{index}}"> | 66 | + bindtap='goPostDetail' data-id="{{item.id}}" data-type="{{item.type}}"> |
67 | <!--<image src="http://pk86rwhci.bkt.clouddn.com/activity_img@2x.png"></image>--> | 67 | <!--<image src="http://pk86rwhci.bkt.clouddn.com/activity_img@2x.png"></image>--> |
68 | <image src="{{item.pic}}"></image> | 68 | <image src="{{item.pic}}"></image> |
69 | <view class="title"> | 69 | <view class="title"> |
@@ -144,7 +144,8 @@ Page({ | @@ -144,7 +144,8 @@ Page({ | ||
144 | */ | 144 | */ |
145 | onLoad: function (options) { | 145 | onLoad: function (options) { |
146 | console.log('options', options); | 146 | console.log('options', options); |
147 | - this.setData({select_id:+options.id?+options.id:''}) | 147 | + this.setData({select_id:+options.id?+options.id:''}); |
148 | + wx.setNavigationBarTitle({title:options.name}) | ||
148 | }, | 149 | }, |
149 | 150 | ||
150 | /** | 151 | /** |
@@ -166,18 +166,19 @@ Page({ | @@ -166,18 +166,19 @@ Page({ | ||
166 | }); | 166 | }); |
167 | self.countDown(); | 167 | self.countDown(); |
168 | } | 168 | } |
169 | - wx.hideLoading() | 169 | + // wx.hideLoading() |
170 | }) | 170 | }) |
171 | 171 | ||
172 | }, | 172 | }, |
173 | //确认拼餐 | 173 | //确认拼餐 |
174 | - confirmJoin() { | 174 | + confirmJoin(e) { |
175 | const self = this; | 175 | const self = this; |
176 | let url = '/portal/Active/join'; | 176 | let url = '/portal/Active/join'; |
177 | let params = { | 177 | let params = { |
178 | token: wx.getStorageSync('token'), | 178 | token: wx.getStorageSync('token'), |
179 | number: self.data.num, | 179 | number: self.data.num, |
180 | activeId: self.data.detail_id, | 180 | activeId: self.data.detail_id, |
181 | + formId: e.detail.formId, | ||
181 | }; | 182 | }; |
182 | let header = { | 183 | let header = { |
183 | "token": wx.getStorageSync('token') | 184 | "token": wx.getStorageSync('token') |
@@ -233,7 +234,8 @@ Page({ | @@ -233,7 +234,8 @@ Page({ | ||
233 | min: '00', | 234 | min: '00', |
234 | sec: '00' | 235 | sec: '00' |
235 | }; | 236 | }; |
236 | - clearTimeout(t) | 237 | + clearTimeout(t); |
238 | + this.end(); | ||
237 | } | 239 | } |
238 | countDownArr.push(obj); | 240 | countDownArr.push(obj); |
239 | // 渲染,然后每隔一秒执行一次倒计时函数 | 241 | // 渲染,然后每隔一秒执行一次倒计时函数 |
@@ -243,17 +245,35 @@ Page({ | @@ -243,17 +245,35 @@ Page({ | ||
243 | }); | 245 | }); |
244 | // console.log('time',this.data.detail.time); | 246 | // console.log('time',this.data.detail.time); |
245 | }, | 247 | }, |
248 | + //倒计时结束 | ||
249 | + end() { | ||
250 | + const self = this; | ||
251 | + let url = '/portal/Active/activity'; | ||
252 | + let params = { | ||
253 | + activeId: self.data.detail_id, | ||
254 | + }; | ||
255 | + let header = { | ||
256 | + "token": wx.getStorageSync('token') | ||
257 | + }; | ||
258 | + app.post(url, params, {}).then((res) => { | ||
259 | + console.log('倒计时结束', res); | ||
260 | + if (+res.code === 1) { | ||
261 | + // wx.showToast({title:'拼活动结束',icon:'success'}) | ||
262 | + } | ||
263 | + }) | ||
264 | + }, | ||
246 | //导航 | 265 | //导航 |
247 | getNavigate() { | 266 | getNavigate() { |
248 | const self = this; | 267 | const self = this; |
249 | - const arr = self.data.detail.latng.split(); | ||
250 | - console.log('arr', arr[0], arr[1]); | 268 | + const arr = self.data.detail.latng.split(','); |
269 | + console.log('arr',arr,arr[0],arr[1]); | ||
270 | + | ||
251 | wx.openLocation({//使用微信内置地图查看位置。 | 271 | wx.openLocation({//使用微信内置地图查看位置。 |
252 | latitude: +arr[0],//要去的纬度-地址 | 272 | latitude: +arr[0],//要去的纬度-地址 |
253 | longitude: +arr[1],//要去的经度-地址 | 273 | longitude: +arr[1],//要去的经度-地址 |
254 | // lat:39.086437, | 274 | // lat:39.086437, |
255 | // lng:117.122583, | 275 | // lng:117.122583, |
256 | - name: "", | 276 | + name: self.data.detail.address, |
257 | address: self.data.detail.address | 277 | address: self.data.detail.address |
258 | }) | 278 | }) |
259 | }, | 279 | }, |
1 | <!--pages/activity/detail/detail.wxml--> | 1 | <!--pages/activity/detail/detail.wxml--> |
2 | -<view class="content"> | 2 | +<form bindsubmit="confirmJoin" bindreset="formReset" report-submit="true"> |
3 | + <view class="content"> | ||
3 | <!--swiper--> | 4 | <!--swiper--> |
4 | <view class="head"> | 5 | <view class="head"> |
5 | <view class="position {{hidden_top?'hidden-active':'visible-active'}}"> | 6 | <view class="position {{hidden_top?'hidden-active':'visible-active'}}"> |
@@ -54,7 +55,8 @@ | @@ -54,7 +55,8 @@ | ||
54 | <view class="title">{{detail.title}}</view> | 55 | <view class="title">{{detail.title}}</view> |
55 | <view class="over-time"> | 56 | <view class="over-time"> |
56 | <text class=''>{{detail.time[0].hou}}:{{detail.time[0].min}}:{{detail.time[0].sec}}</text> | 57 | <text class=''>{{detail.time[0].hou}}:{{detail.time[0].min}}:{{detail.time[0].sec}}</text> |
57 | - 后停止拼餐</view> | 58 | + 后停止拼餐 |
59 | + </view> | ||
58 | <!--<view>--> | 60 | <!--<view>--> |
59 | <!--<text class=''>{{detail.time[0].hou}}</text>--> | 61 | <!--<text class=''>{{detail.time[0].hou}}</text>--> |
60 | <!--<text>:</text>--> | 62 | <!--<text>:</text>--> |
@@ -88,7 +90,9 @@ | @@ -88,7 +90,9 @@ | ||
88 | <view class="join-num">已加入人员</view> | 90 | <view class="join-num">已加入人员</view> |
89 | <view class="people-list" wx:if="{{join_people.length>0}}"> | 91 | <view class="people-list" wx:if="{{join_people.length>0}}"> |
90 | <view class="people" wx:for="{{join_people}}" wx:key="index"> | 92 | <view class="people" wx:for="{{join_people}}" wx:key="index"> |
91 | - <view class="bg"><image src="{{item.pic}}" class="people-img"></image></view> | 93 | + <view class="bg"> |
94 | + <image src="{{item.pic}}" class="people-img"></image> | ||
95 | + </view> | ||
92 | <view class="name">{{item.name}}</view> | 96 | <view class="name">{{item.name}}</view> |
93 | </view> | 97 | </view> |
94 | </view> | 98 | </view> |
@@ -153,8 +157,12 @@ | @@ -153,8 +157,12 @@ | ||
153 | <view class='iconfont icon-jia1' bindtap='addCount'></view> | 157 | <view class='iconfont icon-jia1' bindtap='addCount'></view> |
154 | </view> | 158 | </view> |
155 | </view> | 159 | </view> |
156 | - <view class="confirm-join-btn" bindtap="confirmJoin"> | 160 | + <button class="confirm-join-btn" form-type="submit"> |
157 | <text>确认拼餐</text> | 161 | <text>确认拼餐</text> |
162 | + </button> | ||
163 | + <!--<view class="confirm-join-btn" bindtap="confirmJoin">--> | ||
164 | + <!--<text>确认拼餐</text>--> | ||
165 | + <!--</view>--> | ||
158 | </view> | 166 | </view> |
159 | </view> | 167 | </view> |
160 | -</view> | 168 | +</form> |
@@ -256,7 +256,7 @@ swiper { | @@ -256,7 +256,7 @@ swiper { | ||
256 | -webkit-box-sizing: border-box; | 256 | -webkit-box-sizing: border-box; |
257 | -moz-box-sizing: border-box; | 257 | -moz-box-sizing: border-box; |
258 | box-sizing: border-box; | 258 | box-sizing: border-box; |
259 | - margin-bottom: 100rpx; | 259 | + padding-bottom: 100rpx; |
260 | } | 260 | } |
261 | .comment-box .title-box { | 261 | .comment-box .title-box { |
262 | display: flex; | 262 | display: flex; |
@@ -295,6 +295,10 @@ swiper { | @@ -295,6 +295,10 @@ swiper { | ||
295 | justify-content: space-between; | 295 | justify-content: space-between; |
296 | 296 | ||
297 | } | 297 | } |
298 | +.top-left { | ||
299 | + display: flex; | ||
300 | + align-items: center; | ||
301 | +} | ||
298 | .top-left .release-img{ | 302 | .top-left .release-img{ |
299 | width: 40rpx; | 303 | width: 40rpx; |
300 | height: 40rpx; | 304 | height: 40rpx; |
@@ -394,6 +398,12 @@ swiper { | @@ -394,6 +398,12 @@ swiper { | ||
394 | color:#E1C8AF; | 398 | color:#E1C8AF; |
395 | background-color: #323232; | 399 | background-color: #323232; |
396 | font-size: 30rpx; | 400 | font-size: 30rpx; |
401 | + border-radius: 0; | ||
402 | + margin: 0; | ||
403 | + padding: 0; | ||
404 | +} | ||
405 | +.confirm-join-btn::after { | ||
406 | + border:0; | ||
397 | } | 407 | } |
398 | .input_box { | 408 | .input_box { |
399 | display: flex; | 409 | display: flex; |
@@ -136,13 +136,13 @@ Page({ | @@ -136,13 +136,13 @@ Page({ | ||
136 | address: this.data.address_position, | 136 | address: this.data.address_position, |
137 | latng: this.data.latng, | 137 | latng: this.data.latng, |
138 | over_time:this.data.over_time,// 报名截止时间 | 138 | over_time:this.data.over_time,// 报名截止时间 |
139 | - // formId: e.detail.formId, | 139 | + formId: e.detail.formId, |
140 | }; | 140 | }; |
141 | var list = []; | 141 | var list = []; |
142 | app.post(url, params, {}).then((res) => { | 142 | app.post(url, params, {}).then((res) => { |
143 | console.log('确定发布', res); | 143 | console.log('确定发布', res); |
144 | if(+res.code === 1 && res.message == '发布成功') { | 144 | if(+res.code === 1 && res.message == '发布成功') { |
145 | - this.setData({is_showRelease_modal:true,order_id:+res.data.id}) | 145 | + this.setData({is_showRelease_modal:true,order_id:+res.data.activeId}) |
146 | }else { | 146 | }else { |
147 | wx.showToast({title:res.message,icon:'none'}) | 147 | wx.showToast({title:res.message,icon:'none'}) |
148 | } | 148 | } |
1 | <!--pages/activity/activity.wxml--> | 1 | <!--pages/activity/activity.wxml--> |
2 | -<!--<form bindsubmit="confirmRelease" bindreset="formReset" report-submit="true">--> | 2 | +<form bindsubmit="confirmRelease" bindreset="formReset" report-submit="true"> |
3 | <view class="content"> | 3 | <view class="content"> |
4 | <view class="input-box"> | 4 | <view class="input-box"> |
5 | <input type="text" placeholder="标题" bindinput="inputTitle" maxlength="15" placeholder-class="placeholder"/> | 5 | <input type="text" placeholder="标题" bindinput="inputTitle" maxlength="15" placeholder-class="placeholder"/> |
@@ -62,8 +62,8 @@ | @@ -62,8 +62,8 @@ | ||
62 | </picker> | 62 | </picker> |
63 | <picker mode="time" | 63 | <picker mode="time" |
64 | value="{{time}}" | 64 | value="{{time}}" |
65 | - start="09:01" | ||
66 | - end="21:01" | 65 | + start="00:00" |
66 | + end="24:00" | ||
67 | bindchange="bindTimeChange"> | 67 | bindchange="bindTimeChange"> |
68 | <view class='select'> | 68 | <view class='select'> |
69 | <view class="picker">{{hour}} | 69 | <view class="picker">{{hour}} |
@@ -94,9 +94,11 @@ | @@ -94,9 +94,11 @@ | ||
94 | </view> | 94 | </view> |
95 | </view> | 95 | </view> |
96 | 96 | ||
97 | - <view class="complete" bindtap="confirmRelease"> | 97 | + <button class="complete" form-type="submit"> |
98 | + <!--<view class="complete" bindtap="confirmRelease">--> | ||
98 | <view class="btn">确定发布</view> | 99 | <view class="btn">确定发布</view> |
99 | - </view> | 100 | + <!--</view>--> |
101 | + </button> | ||
100 | </view> | 102 | </view> |
101 | <!--发布成功弹框--> | 103 | <!--发布成功弹框--> |
102 | <view class="modal" wx:if="{{is_showRelease_modal}}" catchtouchmove="disableScroll"> | 104 | <view class="modal" wx:if="{{is_showRelease_modal}}" catchtouchmove="disableScroll"> |
@@ -107,4 +109,4 @@ | @@ -107,4 +109,4 @@ | ||
107 | </view> | 109 | </view> |
108 | <view class="modal_box" wx:if="{{is_showRelease_modal}}" bindtap="handleBackground" | 110 | <view class="modal_box" wx:if="{{is_showRelease_modal}}" bindtap="handleBackground" |
109 | catchtouchmove="disableScroll"></view> | 111 | catchtouchmove="disableScroll"></view> |
110 | -<!--</form>--> | ||
112 | +</form> |
1 | // pages/my/about/about.js | 1 | // pages/my/about/about.js |
2 | +var wxParse = require('../../../wxParse/wxParse.js'); | ||
3 | +const app = getApp(); | ||
2 | Page({ | 4 | Page({ |
3 | 5 | ||
4 | /** | 6 | /** |
5 | * 页面的初始数据 | 7 | * 页面的初始数据 |
6 | */ | 8 | */ |
7 | - data: { | ||
8 | - | 9 | + data: {}, |
10 | + // | ||
11 | + //关于火柴 | ||
12 | + getAbout() { | ||
13 | + let url = '/portal/Member/about'; | ||
14 | + let params = { | ||
15 | + token: wx.getStorageSync('token'), | ||
16 | + }; | ||
17 | + app.post(url, {}, {}).then((res) => { | ||
18 | + console.log('关于火柴', res); | ||
19 | + if (+res.code === 1) { | ||
20 | + wxParse.wxParse('content', 'html', res.data.content, this, 5); | ||
21 | + this.setData({ | ||
22 | + // list: res.data.list, | ||
23 | + }); | ||
24 | + // console.log(self.data.questionList); | ||
25 | + } | ||
26 | + }); | ||
9 | }, | 27 | }, |
10 | - | ||
11 | /** | 28 | /** |
12 | * 生命周期函数--监听页面加载 | 29 | * 生命周期函数--监听页面加载 |
13 | */ | 30 | */ |
@@ -26,7 +43,7 @@ Page({ | @@ -26,7 +43,7 @@ Page({ | ||
26 | * 生命周期函数--监听页面显示 | 43 | * 生命周期函数--监听页面显示 |
27 | */ | 44 | */ |
28 | onShow: function () { | 45 | onShow: function () { |
29 | - | 46 | + this.getAbout() |
30 | }, | 47 | }, |
31 | 48 | ||
32 | /** | 49 | /** |
@@ -2,6 +2,8 @@ | @@ -2,6 +2,8 @@ | ||
2 | <view class="content"> | 2 | <view class="content"> |
3 | <view class="main"> | 3 | <view class="main"> |
4 | <view class="title">关于火柴一盒</view> | 4 | <view class="title">关于火柴一盒</view> |
5 | - <view class="detail">Lorem ipsum dolor sit amet, consectetur adipisicing elit. Asperiores debitis, fuga nisi officia quae soluta sunt vero. Debitis dolorem ea eos est laudantium, modi non reiciendis sapiente ut, vero voluptate?</view> | 5 | + <!--<view class="detail">Lorem ipsum dolor sit amet, consectetur adipisicing elit. Asperiores debitis, fuga nisi officia quae soluta sunt vero. Debitis dolorem ea eos est laudantium, modi non reiciendis sapiente ut, vero voluptate?</view>--> |
6 | + <import src="../../../wxParse/wxParse.wxml" /> | ||
7 | + <template is='wxParse' data='{{wxParseData:content.nodes}}' /> | ||
6 | </view> | 8 | </view> |
7 | </view> | 9 | </view> |
@@ -12,6 +12,21 @@ Page({ | @@ -12,6 +12,21 @@ Page({ | ||
12 | {name:'旦巴',num:'13456895785'}, | 12 | {name:'旦巴',num:'13456895785'}, |
13 | ] | 13 | ] |
14 | }, | 14 | }, |
15 | + //导航 | ||
16 | + getNavigate() { | ||
17 | + const self = this; | ||
18 | + const arr = self.data.detail.latng.split(','); | ||
19 | + // console.log('arr',arr,arr[0],arr[1]); | ||
20 | + | ||
21 | + wx.openLocation({//使用微信内置地图查看位置。 | ||
22 | + latitude: +arr[0],//要去的纬度-地址 | ||
23 | + longitude: +arr[1],//要去的经度-地址 | ||
24 | + // lat:39.086437, | ||
25 | + // lng:117.122583, | ||
26 | + name: self.data.detail.address, | ||
27 | + address: self.data.detail.address | ||
28 | + }) | ||
29 | + }, | ||
15 | getScreenHeight() { | 30 | getScreenHeight() { |
16 | console.log('获取屏幕', wx.getSystemInfoSync()); | 31 | console.log('获取屏幕', wx.getSystemInfoSync()); |
17 | this.setData({screenHeight:wx.getSystemInfoSync().windowHeight}) | 32 | this.setData({screenHeight:wx.getSystemInfoSync().windowHeight}) |
@@ -27,7 +42,8 @@ Page({ | @@ -27,7 +42,8 @@ Page({ | ||
27 | console.log('获取我的钱包详情', res); | 42 | console.log('获取我的钱包详情', res); |
28 | if (+res.code === 1) { | 43 | if (+res.code === 1) { |
29 | this.setData({ | 44 | this.setData({ |
30 | - // collectList: this.data.collectList.concat(res.data), | 45 | + detail: res.data.list, |
46 | + join:res.data.join, | ||
31 | }); | 47 | }); |
32 | // console.log(self.data.questionList); | 48 | // console.log(self.data.questionList); |
33 | } | 49 | } |
@@ -37,7 +53,8 @@ Page({ | @@ -37,7 +53,8 @@ Page({ | ||
37 | * 生命周期函数--监听页面加载 | 53 | * 生命周期函数--监听页面加载 |
38 | */ | 54 | */ |
39 | onLoad: function (options) { | 55 | onLoad: function (options) { |
40 | - | 56 | + console.log('options', options); |
57 | + this.setData({id:+options.id?+options.id:''}) | ||
41 | }, | 58 | }, |
42 | 59 | ||
43 | /** | 60 | /** |
@@ -4,30 +4,33 @@ | @@ -4,30 +4,33 @@ | ||
4 | <view class="detail"> | 4 | <view class="detail"> |
5 | <view class="bg"> | 5 | <view class="bg"> |
6 | <view class="head"> | 6 | <view class="head"> |
7 | - <image src="../../../../images/avatar@2x.png"></image> | ||
8 | - <text class="name">蚂蚁</text> | 7 | + <!--<image src="../../../../images/avatar@2x.png"></image>--> |
8 | + <image src="{{detail.userPic}}"></image> | ||
9 | + <text class="name">{{detail.userName}}</text> | ||
9 | <text class="phone">手机号: 13026256485</text> | 10 | <text class="phone">手机号: 13026256485</text> |
10 | - <text class="num">1人</text> | 11 | + <text class="num">{{detail.number}}人</text> |
11 | </view> | 12 | </view> |
12 | 13 | ||
13 | <view class="area"> | 14 | <view class="area"> |
14 | - <text class="title">Opera Bomb</text> | ||
15 | - <text class="restaurant-name">Opera Bomb</text> | ||
16 | - <text class="date">2018.12.26</text> | ||
17 | - <text class="time">15:30</text> | ||
18 | - <view class="address"> | ||
19 | - <text>地址:北京市朝阳区东北部一号地国际艺术区</text> | 15 | + <text class="title">{{detail.title}}</text> |
16 | + <text class="restaurant-name">{{detail.address}}</text> | ||
17 | + <text class="date">{{detail.time}}</text> | ||
18 | + <!--<text class="time">15:30</text>--> | ||
19 | + <view class="address" bindtap="getNavigate"> | ||
20 | + <text>地址:{{detail.address}}</text> | ||
20 | <view class="iconfont icon-location"></view> | 21 | <view class="iconfont icon-location"></view> |
21 | </view> | 22 | </view> |
22 | </view> | 23 | </view> |
23 | 24 | ||
24 | <view class="people"> | 25 | <view class="people"> |
25 | <view class="title">成员:</view> | 26 | <view class="title">成员:</view> |
26 | - <view wx:for="{{peopleList}}" wx:key="index" class="list"> | ||
27 | - <image src="../../../../images/avatar@2x.png"></image> | 27 | + <scroll-view class="scroll" scroll-y> |
28 | + <view wx:for="{{join}}" wx:key="index" class="list"> | ||
29 | + <image src="{{item.pic}}"></image> | ||
28 | <view class="people-name">{{item.name}}</view> | 30 | <view class="people-name">{{item.name}}</view> |
29 | - <view class="people-phone">手机号: {{item.num}}</view> | 31 | + <view class="people-phone">手机号: {{item.tel}}</view> |
30 | </view> | 32 | </view> |
33 | + </scroll-view> | ||
31 | </view> | 34 | </view> |
32 | </view> | 35 | </view> |
33 | 36 |
@@ -53,6 +53,7 @@ | @@ -53,6 +53,7 @@ | ||
53 | display: flex; | 53 | display: flex; |
54 | flex-direction: column; | 54 | flex-direction: column; |
55 | justify-content: flex-start; | 55 | justify-content: flex-start; |
56 | + margin-top:30rpx; | ||
56 | } | 57 | } |
57 | .area .title { | 58 | .area .title { |
58 | font-size: 34rpx; | 59 | font-size: 34rpx; |
@@ -144,3 +145,11 @@ | @@ -144,3 +145,11 @@ | ||
144 | height: 10rpx; | 145 | height: 10rpx; |
145 | border-bottom: 16rpx dotted #fff; | 146 | border-bottom: 16rpx dotted #fff; |
146 | } | 147 | } |
148 | +.scroll { | ||
149 | + height: 300rpx; | ||
150 | + /*overflow-y: scroll;*/ | ||
151 | + /*display: -webkit-box;*/ | ||
152 | + /*-webkit-overflow-scrolling: touch;*/ | ||
153 | + display: flex; | ||
154 | + flex-direction: column; | ||
155 | +} |
@@ -12,8 +12,9 @@ Page({ | @@ -12,8 +12,9 @@ Page({ | ||
12 | {area:'意大利维多餐厅',user:'旦巴',date:'时间:2018.5.24',time:'08:24',address:'地址:北京朝阳望京',type:'饭票'}, | 12 | {area:'意大利维多餐厅',user:'旦巴',date:'时间:2018.5.24',time:'08:24',address:'地址:北京朝阳望京',type:'饭票'}, |
13 | ] | 13 | ] |
14 | }, | 14 | }, |
15 | - goDetail() { | ||
16 | - wx.navigateTo({url:'/pages/my/my-wallet/detail/detail'}) | 15 | + goDetail(e) { |
16 | + const id = e.currentTarget.dataset.id; | ||
17 | + wx.navigateTo({url:'/pages/my/my-wallet/detail/detail?id=' + id}) | ||
17 | }, | 18 | }, |
18 | //获取我的钱包 | 19 | //获取我的钱包 |
19 | getMyWallet() { | 20 | getMyWallet() { |
@@ -25,7 +26,7 @@ Page({ | @@ -25,7 +26,7 @@ Page({ | ||
25 | console.log('获取我的钱包', res); | 26 | console.log('获取我的钱包', res); |
26 | if (+res.code === 1) { | 27 | if (+res.code === 1) { |
27 | this.setData({ | 28 | this.setData({ |
28 | - // collectList: this.data.collectList.concat(res.data), | 29 | + list: res.data.list, |
29 | }); | 30 | }); |
30 | // console.log(self.data.questionList); | 31 | // console.log(self.data.questionList); |
31 | } | 32 | } |
1 | <!--pages/my/my-wallet/my-wallet.wxml--> | 1 | <!--pages/my/my-wallet/my-wallet.wxml--> |
2 | <view class="list-box"> | 2 | <view class="list-box"> |
3 | -<view class="bg"> | ||
4 | - <view class="list-item" wx:for="{{list}}" wx:key="index" data-current="{{index}}" bindtap="goDetail"> | ||
5 | - <view class="detail"> | 3 | + <view class="bg"> |
4 | + <!--(0全部,2待处理,4已拼成,5已取消,6已完成)--> | ||
5 | + <view class="no-data" wx:if="{{list.length===0}}">钱包是空的~</view> | ||
6 | + <view class="list-item {{item.type === 1?'change-bg':''}} {{item.status === 6?'change-bg-end':''}}" | ||
7 | + wx:for="{{list}}" wx:key="index" data-id="{{item.id}}" bindtap="goDetail"> | ||
8 | + <image src="../../../images/end-flag@2x.png" wx:if="{{item.status === 6}}" class="flag-img"></image> | ||
9 | + <view class="detail {{item.status === 6?'change-color':''}}"> | ||
6 | <view class="area"> | 10 | <view class="area"> |
7 | - <text>{{item.area}}</text> | ||
8 | - <text>{{item.user}}</text> | 11 | + <text class="addr">{{item.addr}}</text> |
12 | + <text>{{item.userName}}</text> | ||
9 | </view> | 13 | </view> |
10 | <view class="time"> | 14 | <view class="time"> |
11 | - <text>{{item.date}}</text> | ||
12 | - <text>{{item.time}}</text> | 15 | + <text>时间:{{item.time}}</text> |
13 | </view> | 16 | </view> |
14 | <view class="address"> | 17 | <view class="address"> |
15 | - <text>{{item.address}}</text> | ||
16 | - <text>1人</text> | 18 | + <text class="addr">地址:{{item.address}}</text> |
19 | + <text>{{item.number}}人</text> | ||
17 | </view> | 20 | </view> |
18 | </view> | 21 | </view> |
19 | <view class="code"></view> | 22 | <view class="code"></view> |
20 | - <view class="name">{{item.type}}</view> | 23 | + <view class="name">{{item.type === 1?'活动票':'饭票'}}</view> |
24 | + </view> | ||
21 | </view> | 25 | </view> |
22 | -</view> | ||
23 | 26 | ||
24 | </view> | 27 | </view> |
1 | /* pages/my/my-wallet/my-wallet.wxss */ | 1 | /* pages/my/my-wallet/my-wallet.wxss */ |
2 | +@import "/wxParse/wxParse.wxss"; | ||
3 | +.no-data { | ||
4 | + width: 100%; | ||
5 | + display: flex; | ||
6 | + align-items: center; | ||
7 | + justify-content: center; | ||
8 | + font-size: 30rpx; | ||
9 | + color: #cccccc; | ||
10 | + margin-top: 300rpx; | ||
11 | +} | ||
2 | .bg { | 12 | .bg { |
3 | /* background: pink; */ | 13 | /* background: pink; */ |
4 | /* border-radius:4rpx; */ | 14 | /* border-radius:4rpx; */ |
@@ -24,6 +34,12 @@ | @@ -24,6 +34,12 @@ | ||
24 | padding:20rpx 24rpx; | 34 | padding:20rpx 24rpx; |
25 | position: relative; | 35 | position: relative; |
26 | } | 36 | } |
37 | +.change-bg { | ||
38 | + background-image: url('http://pk86rwhci.bkt.clouddn.com/huodongpuao@2x.png'); | ||
39 | +} | ||
40 | +.change-bg-end { | ||
41 | + background-image: url('http://pk86rwhci.bkt.clouddn.com/yiwancheng@2x.png'); | ||
42 | +} | ||
27 | .detail { | 43 | .detail { |
28 | width:390rpx; | 44 | width:390rpx; |
29 | display: flex; | 45 | display: flex; |
@@ -39,12 +55,15 @@ | @@ -39,12 +55,15 @@ | ||
39 | margin-bottom: 20rpx; | 55 | margin-bottom: 20rpx; |
40 | } | 56 | } |
41 | .area { | 57 | .area { |
42 | - font-size: 28rpx; | 58 | + font-size: 24rpx; |
43 | color: #323232; | 59 | color: #323232; |
44 | } | 60 | } |
61 | +.area .addr,.address .addr { | ||
62 | + flex:1; | ||
63 | +} | ||
45 | .address { | 64 | .address { |
46 | - font-size: 26rpx; | ||
47 | - color: #cccccc; | 65 | + font-size: 20rpx; |
66 | + color: #666666; | ||
48 | margin: 10rpx 0; | 67 | margin: 10rpx 0; |
49 | } | 68 | } |
50 | .time { | 69 | .time { |
@@ -52,8 +71,8 @@ | @@ -52,8 +71,8 @@ | ||
52 | align-items:center; | 71 | align-items:center; |
53 | padding-bottom: 20rpx; | 72 | padding-bottom: 20rpx; |
54 | border-bottom: 1rpx solid #f3f3f3; | 73 | border-bottom: 1rpx solid #f3f3f3; |
55 | - font-size: 26rpx; | ||
56 | - color: #cccccc; | 74 | + font-size: 22rpx; |
75 | + color: #333333; | ||
57 | } | 76 | } |
58 | .code { | 77 | .code { |
59 | width: 130rpx; | 78 | width: 130rpx; |
@@ -68,3 +87,13 @@ | @@ -68,3 +87,13 @@ | ||
68 | color:#ffffff; | 87 | color:#ffffff; |
69 | font-weight: bold; | 88 | font-weight: bold; |
70 | } | 89 | } |
90 | +.change-color text{ | ||
91 | + color: #999999; | ||
92 | +} | ||
93 | +.flag-img { | ||
94 | + width: 176rpx; | ||
95 | + height: 154rpx; | ||
96 | + position: absolute; | ||
97 | + bottom:0; | ||
98 | + left:229rpx; | ||
99 | +} |
@@ -76,11 +76,12 @@ Page({ | @@ -76,11 +76,12 @@ Page({ | ||
76 | avatar: e.detail.userInfo.avatarUrl | 76 | avatar: e.detail.userInfo.avatarUrl |
77 | }, {}).then((ret) => { | 77 | }, {}).then((ret) => { |
78 | console.log('获取token', ret); | 78 | console.log('获取token', ret); |
79 | - wx.setStorageSync('token', ret.token); | 79 | + wx.setStorageSync('token', ret.data.token); |
80 | wx.showToast({title:'登录成功',icon:'success'}); | 80 | wx.showToast({title:'登录成功',icon:'success'}); |
81 | app.globalData.userInfo = e.detail.userInfo; | 81 | app.globalData.userInfo = e.detail.userInfo; |
82 | app.globalData.isLogin = true; | 82 | app.globalData.isLogin = true; |
83 | - self.setData({isLogin: app.globalData.isLogin}) | 83 | + self.setData({isLogin: app.globalData.isLogin}); |
84 | + self.getIndex(); | ||
84 | // setTimeout(function () { | 85 | // setTimeout(function () { |
85 | // wx.navigateBack({delta:1}) | 86 | // wx.navigateBack({delta:1}) |
86 | // },200) | 87 | // },200) |
@@ -180,6 +181,8 @@ Page({ | @@ -180,6 +181,8 @@ Page({ | ||
180 | self.setData({ | 181 | self.setData({ |
181 | is_showRelease: true //弹出 去答题弹框 | 182 | is_showRelease: true //弹出 去答题弹框 |
182 | }); | 183 | }); |
184 | + }else if(+self.data.is_write === 1 && wx.getStorageSync('is_canSend') === 2 && wx.getStorageSync('is_answer') === 1){ | ||
185 | + wx.showToast({title:'等级不够,无法使用发布功能',icon:'none'}) | ||
183 | } | 186 | } |
184 | }, | 187 | }, |
185 | //取消发布弹窗 | 188 | //取消发布弹窗 |
@@ -225,6 +228,7 @@ Page({ | @@ -225,6 +228,7 @@ Page({ | ||
225 | }, | 228 | }, |
226 | //获取首页内容 | 229 | //获取首页内容 |
227 | getIndex(res) { | 230 | getIndex(res) { |
231 | + if(app.globalData.isLogin) { | ||
228 | let url = '/portal/Member/index'; | 232 | let url = '/portal/Member/index'; |
229 | let params = { | 233 | let params = { |
230 | // lat: res.latitude, | 234 | // lat: res.latitude, |
@@ -241,6 +245,7 @@ Page({ | @@ -241,6 +245,7 @@ Page({ | ||
241 | }) | 245 | }) |
242 | // console.log(this.data.this_week_test_info); | 246 | // console.log(this.data.this_week_test_info); |
243 | }) | 247 | }) |
248 | + } | ||
244 | }, | 249 | }, |
245 | /** | 250 | /** |
246 | * 生命周期函数--监听页面加载 | 251 | * 生命周期函数--监听页面加载 |
@@ -15,6 +15,21 @@ Page({ | @@ -15,6 +15,21 @@ Page({ | ||
15 | + '&order_detail=' + order_detail | 15 | + '&order_detail=' + order_detail |
16 | }) | 16 | }) |
17 | }, | 17 | }, |
18 | + //活动详情 | ||
19 | + goDetail() { | ||
20 | + const id = +this.data.detail.id; | ||
21 | + const type = +this.data.detail.type; | ||
22 | + console.log('type-id', type,id); | ||
23 | + if(type === 1) { //1是活动,2是拼餐 | ||
24 | + wx.navigateTo({ | ||
25 | + url: '/pages/activity/detail/detail?id=' + id, | ||
26 | + }) | ||
27 | + }else { | ||
28 | + wx.navigateTo({ | ||
29 | + url: '/pages/meal/detail/detail?id=' + id, | ||
30 | + }) | ||
31 | + } | ||
32 | + }, | ||
18 | //订单详情 | 33 | //订单详情 |
19 | getOrderDetail() { | 34 | getOrderDetail() { |
20 | const self = this; | 35 | const self = this; |
@@ -11,9 +11,9 @@ | @@ -11,9 +11,9 @@ | ||
11 | <text>已拍下</text> | 11 | <text>已拍下</text> |
12 | </view> | 12 | </view> |
13 | <view class="state2"> | 13 | <view class="state2"> |
14 | - <view class="circle {{detail.status === 4 ||detail.status === 5 ?'change':''}}"></view> | 14 | + <view class="circle {{detail.status === 4 ||detail.status === 5 || detail.status === 6?'change':''}}"></view> |
15 | <text wx:if="{{detail.status === 5}}">已取消</text> | 15 | <text wx:if="{{detail.status === 5}}">已取消</text> |
16 | - <text wx:if="{{detail.status === 4}}">已拼成</text> | 16 | + <text wx:if="{{detail.status === 4 || detail.status === 6}}">已拼成</text> |
17 | <text wx:if="{{detail.status === 2}}" class="{{detail.status === 2?'change-text':''}}">待拼成</text> | 17 | <text wx:if="{{detail.status === 2}}" class="{{detail.status === 2?'change-text':''}}">待拼成</text> |
18 | </view> | 18 | </view> |
19 | <view class="state3"> | 19 | <view class="state3"> |
@@ -23,7 +23,7 @@ | @@ -23,7 +23,7 @@ | ||
23 | </view> | 23 | </view> |
24 | </view> | 24 | </view> |
25 | 25 | ||
26 | - <view class="order-info"> | 26 | + <view class="order-info" bindtap="goDetail"> |
27 | <view class="top"> | 27 | <view class="top"> |
28 | <!--<image src="../../../images/avatar@2x.png"></image>--> | 28 | <!--<image src="../../../images/avatar@2x.png"></image>--> |
29 | <image src="{{detail.userPic}}"></image> | 29 | <image src="{{detail.userPic}}"></image> |
@@ -14,6 +14,50 @@ Page({ | @@ -14,6 +14,50 @@ Page({ | ||
14 | is_answer: true, | 14 | is_answer: true, |
15 | is_write: 0,//1:已填写,2:未填写 | 15 | is_write: 0,//1:已填写,2:未填写 |
16 | }, | 16 | }, |
17 | + //删除 | ||
18 | + cancel(e) { | ||
19 | + const self = this; | ||
20 | + const id = e.currentTarget.dataset.id; | ||
21 | + let url = '/portal/Order/del'; | ||
22 | + let params = { | ||
23 | + token: wx.getStorageSync('token'), | ||
24 | + orderId: id, | ||
25 | + }; | ||
26 | + let header = { | ||
27 | + "token": wx.getStorageSync('token') | ||
28 | + }; | ||
29 | + app.post(url, params, {}).then((res) => { | ||
30 | + console.log('删除', res); | ||
31 | + if (+res.code === 1) { | ||
32 | + wx.showToast({title:res.message,icon:'none'}); | ||
33 | + self.getOrderList(); | ||
34 | + }else { | ||
35 | + wx.showToast({title:res.message,icon:'none'}) | ||
36 | + } | ||
37 | + }) | ||
38 | + }, | ||
39 | + //完成 | ||
40 | + complete(e) { | ||
41 | + const self = this; | ||
42 | + const id = e.currentTarget.dataset.id; | ||
43 | + let url = '/portal/Order/sure'; | ||
44 | + let params = { | ||
45 | + token: wx.getStorageSync('token'), | ||
46 | + orderId: id, | ||
47 | + }; | ||
48 | + let header = { | ||
49 | + "token": wx.getStorageSync('token') | ||
50 | + }; | ||
51 | + app.post(url, params, {}).then((res) => { | ||
52 | + console.log('完成', res); | ||
53 | + if (+res.code === 1) { | ||
54 | + wx.showToast({title:res.message,icon:'none'}); | ||
55 | + self.getOrderList(); | ||
56 | + }else { | ||
57 | + wx.showToast({title:res.message,icon:'none'}) | ||
58 | + } | ||
59 | + }) | ||
60 | + }, | ||
17 | //是否填写个人信息 | 61 | //是否填写个人信息 |
18 | getIsWrite() { | 62 | getIsWrite() { |
19 | const self = this; | 63 | const self = this; |
@@ -137,6 +181,8 @@ Page({ | @@ -137,6 +181,8 @@ Page({ | ||
137 | self.setData({ | 181 | self.setData({ |
138 | is_showRelease: true //弹出 去答题弹框 | 182 | is_showRelease: true //弹出 去答题弹框 |
139 | }); | 183 | }); |
184 | + }else if(+self.data.is_write === 1 && wx.getStorageSync('is_canSend') === 2 && wx.getStorageSync('is_answer') === 1){ | ||
185 | + wx.showToast({title:'等级不够,无法使用发布功能',icon:'none'}) | ||
140 | } | 186 | } |
141 | }, | 187 | }, |
142 | //取消发布弹窗 | 188 | //取消发布弹窗 |
@@ -18,10 +18,10 @@ | @@ -18,10 +18,10 @@ | ||
18 | <view class="lish-right"> | 18 | <view class="lish-right"> |
19 | <view class="title-box"> | 19 | <view class="title-box"> |
20 | <view class="title">{{item.title}}</view> | 20 | <view class="title">{{item.title}}</view> |
21 | - <text wx:if="{{item.state === 1}}" class="state">待拼成</text> | ||
22 | - <text wx:if="{{item.state === 2}}" class="state">已拼成</text> | ||
23 | - <text wx:if="{{item.state === 3}}" class="state">已取消</text> | ||
24 | - <text wx:if="{{item.state === 4}}" class="state">已完成</text> | 21 | + <text wx:if="{{item.status === 2}}" class="state">待拼成</text> |
22 | + <text wx:if="{{item.status === 4}}" class="state">已拼成</text> | ||
23 | + <text wx:if="{{item.status === 5}}" class="state">已取消</text> | ||
24 | + <text wx:if="{{item.status === 6}}" class="state">已完成</text> | ||
25 | </view> | 25 | </view> |
26 | <view class="time">{{item.time}}</view> | 26 | <view class="time">{{item.time}}</view> |
27 | <view class="name-box"> | 27 | <view class="name-box"> |
@@ -31,8 +31,8 @@ | @@ -31,8 +31,8 @@ | ||
31 | <text>{{item.userName}} 在{{item.addr}}</text> | 31 | <text>{{item.userName}} 在{{item.addr}}</text> |
32 | </view> | 32 | </view> |
33 | <view class="btn"> | 33 | <view class="btn"> |
34 | - <text wx:if="{{item.state === 4 || item.state === 3}}">删除</text> | ||
35 | - <text wx:if="{{item.state === 2}}">完成</text> | 34 | + <text wx:if="{{item.status === 5 || item.status === 6}}" catchtap="cancel" data-id="{{item.id}}">删除</text> |
35 | + <text wx:if="{{item.status === 4}}" catchtap="complete" data-id="{{item.id}}">完成</text> | ||
36 | </view> | 36 | </view> |
37 | </view> | 37 | </view> |
38 | </view> | 38 | </view> |
@@ -98,8 +98,10 @@ | @@ -98,8 +98,10 @@ | ||
98 | display: flex; | 98 | display: flex; |
99 | align-items: center; | 99 | align-items: center; |
100 | justify-content: flex-start; | 100 | justify-content: flex-start; |
101 | + flex:1; | ||
101 | } | 102 | } |
102 | .lish-right .name-box .btn { | 103 | .lish-right .name-box .btn { |
104 | + /* width:28%; */ | ||
103 | color:#E2C8B1; | 105 | color:#E2C8B1; |
104 | font-size: 24rpx; | 106 | font-size: 24rpx; |
105 | } | 107 | } |
@@ -42,6 +42,38 @@ Page({ | @@ -42,6 +42,38 @@ Page({ | ||
42 | is_showUserInfo:false, | 42 | is_showUserInfo:false, |
43 | is_answer: false, | 43 | is_answer: false, |
44 | is_write:2,//1:已填写,2:未填写 | 44 | is_write:2,//1:已填写,2:未填写 |
45 | + cityList:[], | ||
46 | + addr:'', //切换地址 | ||
47 | + | ||
48 | + }, | ||
49 | + //获取城市列表 | ||
50 | + getCityList() { | ||
51 | + const self = this; | ||
52 | + let url = '/portal/Index/cityList'; | ||
53 | + app.post(url, {}, {}).then((res) => { | ||
54 | + console.log('获取城市列表', res); | ||
55 | + if (+res.code === 1) { | ||
56 | + const arr = []; | ||
57 | + res.data.list.forEach((item) => { | ||
58 | + arr.push(item.title) | ||
59 | + }); | ||
60 | + self.setData({ | ||
61 | + city_picker_list: arr, | ||
62 | + cityList:res.data.list, | ||
63 | + }); | ||
64 | + } | ||
65 | + }) | ||
66 | + }, | ||
67 | + //切换城市 | ||
68 | + cityPickerChange(e) { | ||
69 | + this.setData({ | ||
70 | + current_city: e.detail.value, | ||
71 | + is_city_change: true | ||
72 | + }); | ||
73 | + const lat = this.data.cityList[e.detail.value].latng.split(',')[1]; | ||
74 | + const lng = this.data.cityList[e.detail.value].latng.split(',')[0]; | ||
75 | + this.setData({latitude: lat, longitude: lng,addr:this.data.cityList[e.detail.value].title}); | ||
76 | + this.getTypeList(); | ||
45 | }, | 77 | }, |
46 | //是否填写个人信息 | 78 | //是否填写个人信息 |
47 | getIsWrite() { | 79 | getIsWrite() { |
@@ -270,6 +302,8 @@ Page({ | @@ -270,6 +302,8 @@ Page({ | ||
270 | self.setData({ | 302 | self.setData({ |
271 | is_showRelease: true //弹出 去答题弹框 | 303 | is_showRelease: true //弹出 去答题弹框 |
272 | }); | 304 | }); |
305 | + }else if(+self.data.is_write === 1 && wx.getStorageSync('is_canSend') === 2 && wx.getStorageSync('is_answer') === 1){ | ||
306 | + wx.showToast({title:'等级不够,无法使用发布功能',icon:'none'}) | ||
273 | } | 307 | } |
274 | }, | 308 | }, |
275 | //取消发布弹窗 | 309 | //取消发布弹窗 |
@@ -328,7 +362,7 @@ Page({ | @@ -328,7 +362,7 @@ Page({ | ||
328 | let params = { | 362 | let params = { |
329 | lat: self.data.latitude, | 363 | lat: self.data.latitude, |
330 | lng: self.data.longitude, | 364 | lng: self.data.longitude, |
331 | - addr: self.data.city, // 浮点型 必填 - - 用户位置名称 | 365 | + addr: self.data.is_city_change?self.data.addr:self.data.city, // 浮点型 必填 - - 用户位置名称 |
332 | keyword: '', // 浮点型 非必填 - - 搜索关键字 | 366 | keyword: '', // 浮点型 非必填 - - 搜索关键字 |
333 | score: self.data.score, // 浮点型 非必填 - - 排序(1智能排序,2最具人气,3距离最近) | 367 | score: self.data.score, // 浮点型 非必填 - - 排序(1智能排序,2最具人气,3距离最近) |
334 | startTime: self.data.start_time_date,// 浮点型 非必填 - - 筛选开始时间 | 368 | startTime: self.data.start_time_date,// 浮点型 非必填 - - 筛选开始时间 |
@@ -405,6 +439,7 @@ Page({ | @@ -405,6 +439,7 @@ Page({ | ||
405 | const self = this; | 439 | const self = this; |
406 | self.getLocation(); | 440 | self.getLocation(); |
407 | self.getIsWrite(); | 441 | self.getIsWrite(); |
442 | + self.getCityList(); | ||
408 | }, | 443 | }, |
409 | 444 | ||
410 | /** | 445 | /** |
@@ -2,11 +2,13 @@ | @@ -2,11 +2,13 @@ | ||
2 | <view class="fix-box"> | 2 | <view class="fix-box"> |
3 | <view class="head"> | 3 | <view class="head"> |
4 | <view class="position"> | 4 | <view class="position"> |
5 | + <picker class="picker" bindchange="cityPickerChange" value="{{current_city}}" range="{{city_picker_list}}" class="picker"> | ||
5 | <view class="left"> | 6 | <view class="left"> |
6 | <view class="iconfont icon-location"></view> | 7 | <view class="iconfont icon-location"></view> |
7 | - <text>北京</text> | 8 | + <text>{{city_picker_list[current_city] || city}}</text> |
8 | <view class="iconfont icon-arrow-down"></view> | 9 | <view class="iconfont icon-arrow-down"></view> |
9 | </view> | 10 | </view> |
11 | + </picker> | ||
10 | <view class="right" bindtap="search"> | 12 | <view class="right" bindtap="search"> |
11 | <view class="input"></view> | 13 | <view class="input"></view> |
12 | <image src="../../images/search@2x.png"></image> | 14 | <image src="../../images/search@2x.png"></image> |
-
请 注册 或 登录 后发表评论