优化我的钱包背景图,添加倒计时结束调用的接口,发布和参与添加formid,添加城市切换
正在显示
37 个修改的文件
包含
901 行增加
和
597 行删除
@@ -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"> | ||
4 | - <view class="input-box"> | ||
5 | - <input type="text" placeholder="标题" bindinput="inputTitle" maxlength="15" placeholder-class="placeholder"/> | ||
6 | - <textarea maxlength="-1" type="text" placeholder="发布描述..." bindinput="inputContent" | ||
7 | - placeholder-class="placeholder"></textarea> | ||
8 | - </view> | 2 | +<form bindsubmit="confirmRelease" bindreset="formReset" report-submit="true"> |
3 | + <view class="content"> | ||
4 | + <view class="input-box"> | ||
5 | + <input type="text" placeholder="标题" bindinput="inputTitle" maxlength="15" placeholder-class="placeholder"/> | ||
6 | + <textarea maxlength="-1" type="text" placeholder="发布描述..." bindinput="inputContent" | ||
7 | + placeholder-class="placeholder"></textarea> | ||
8 | + </view> | ||
9 | 9 | ||
10 | - <view class='upload_box'> | ||
11 | - <block wx:for="{{images}}" wx:for-item="image" wx:key="index"> | ||
12 | - <view class='upload_img'> | ||
13 | - <view class='icon_box' catchtap="deleteImg" data-index="{{index}}"> | ||
14 | - <view class='iconfont icon-shanchu1'></view> | 10 | + <view class='upload_box'> |
11 | + <block wx:for="{{images}}" wx:for-item="image" wx:key="index"> | ||
12 | + <view class='upload_img'> | ||
13 | + <view class='icon_box' catchtap="deleteImg" data-index="{{index}}"> | ||
14 | + <view class='iconfont icon-shanchu1'></view> | ||
15 | + </view> | ||
16 | + <image src='{{image}}' data-index="{{index}}" mode="aspectFill" bindtap="previewImg"></image> | ||
15 | </view> | 17 | </view> |
16 | - <image src='{{image}}' data-index="{{index}}" mode="aspectFill" bindtap="previewImg"></image> | 18 | + </block> |
19 | + <view class='upload_img' bindtap="choose"> | ||
20 | + <view class='iconfont icon-jia'></view> | ||
21 | + <text>添加照片</text> | ||
17 | </view> | 22 | </view> |
18 | - </block> | ||
19 | - <view class='upload_img' bindtap="choose"> | ||
20 | - <view class='iconfont icon-jia'></view> | ||
21 | - <text>添加照片</text> | ||
22 | </view> | 23 | </view> |
23 | - </view> | ||
24 | 24 | ||
25 | - <view class="set-box"> | ||
26 | - <view class="min-num"> | ||
27 | - <text class="title">最低人数</text> | ||
28 | - <input type="number" bindinput="inputMinNum" class="input"/> | ||
29 | - <text class="iconfont icon-xiangxia min-icon"></text> | ||
30 | - </view> | ||
31 | - <view class="min-num"> | ||
32 | - <text class="title">最高人数</text> | ||
33 | - <input type="number" bindinput="inputMaxNum" class="input"/> | ||
34 | - <text class="iconfont icon-xiangxia min-icon"></text> | ||
35 | - </view> | ||
36 | - <view class="min-num"> | ||
37 | - <text class="title type-title">类别</text> | ||
38 | - <picker bindchange="bindTypeChange" value="{{current_type}}" range="{{type_picker_list}}" class="picker"> | ||
39 | - <view class="input"> | ||
40 | - <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 | - <!-- <view class="iconfont icon-arrow-down"></view> --> | ||
43 | - </view> | ||
44 | - </picker> | ||
45 | - <text class="iconfont icon-xiangxia min-icon"></text> | ||
46 | - </view> | ||
47 | - <view class="time-box"> | ||
48 | - <text class="time-title">时间</text> | ||
49 | - <picker mode='date' bindchange="bindDateChange" value='{{date}}' start="{{start_time}}" end='2060-01-01'> | ||
50 | - <view class='select'> | ||
51 | - <view class="picker">{{month}} | ||
52 | - <text class="iconfont icon-xiangxia min-icon"></text> | ||
53 | - </view> | ||
54 | - <text class="margin">月</text> | ||
55 | - <view class="picker">{{day}} | ||
56 | - <text class="iconfont icon-xiangxia min-icon"></text> | 25 | + <view class="set-box"> |
26 | + <view class="min-num"> | ||
27 | + <text class="title">最低人数</text> | ||
28 | + <input type="number" bindinput="inputMinNum" class="input"/> | ||
29 | + <text class="iconfont icon-xiangxia min-icon"></text> | ||
30 | + </view> | ||
31 | + <view class="min-num"> | ||
32 | + <text class="title">最高人数</text> | ||
33 | + <input type="number" bindinput="inputMaxNum" class="input"/> | ||
34 | + <text class="iconfont icon-xiangxia min-icon"></text> | ||
35 | + </view> | ||
36 | + <view class="min-num"> | ||
37 | + <text class="title type-title">类别</text> | ||
38 | + <picker bindchange="bindTypeChange" value="{{current_type}}" range="{{type_picker_list}}" | ||
39 | + class="picker"> | ||
40 | + <view class="input"> | ||
41 | + <text class="variety-text">{{type_picker_list[current_type]}}</text> | ||
42 | + <!--<text class="variety-text" wx:else>{{pet_info.sex===2?'MM':'GG'}}</text>--> | ||
43 | + <!-- <view class="iconfont icon-arrow-down"></view> --> | ||
57 | </view> | 44 | </view> |
58 | - <text class="margin">日</text> | ||
59 | - <!--<view class='select_right' style='color:rgba(51,51,51,1)'>{{date}}</view>--> | ||
60 | - </view> | ||
61 | - </picker> | ||
62 | - <picker mode="time" | ||
63 | - value="{{time}}" | ||
64 | - start="09:01" | ||
65 | - end="21:01" | ||
66 | - bindchange="bindTimeChange"> | ||
67 | - <view class='select'> | ||
68 | - <view class="picker">{{hour}} | ||
69 | - <text class="iconfont icon-xiangxia min-icon"></text> | 45 | + </picker> |
46 | + <text class="iconfont icon-xiangxia min-icon"></text> | ||
47 | + </view> | ||
48 | + <view class="time-box"> | ||
49 | + <text class="time-title">时间</text> | ||
50 | + <picker mode='date' bindchange="bindDateChange" value='{{date}}' start="{{start_time}}" | ||
51 | + end='2060-01-01'> | ||
52 | + <view class='select'> | ||
53 | + <view class="picker">{{month}} | ||
54 | + <text class="iconfont icon-xiangxia min-icon"></text> | ||
55 | + </view> | ||
56 | + <text class="margin">月</text> | ||
57 | + <view class="picker">{{day}} | ||
58 | + <text class="iconfont icon-xiangxia min-icon"></text> | ||
59 | + </view> | ||
60 | + <text class="margin">日</text> | ||
61 | + <!--<view class='select_right' style='color:rgba(51,51,51,1)'>{{date}}</view>--> | ||
70 | </view> | 62 | </view> |
71 | - <text class="margin">时</text> | ||
72 | - <view class="picker">{{minute}} | ||
73 | - <text class="iconfont icon-xiangxia min-icon"></text> | 63 | + </picker> |
64 | + <picker mode="time" | ||
65 | + value="{{time}}" | ||
66 | + start="00:00" | ||
67 | + end="24:00" | ||
68 | + bindchange="bindTimeChange"> | ||
69 | + <view class='select'> | ||
70 | + <view class="picker">{{hour}} | ||
71 | + <text class="iconfont icon-xiangxia min-icon"></text> | ||
72 | + </view> | ||
73 | + <text class="margin">时</text> | ||
74 | + <view class="picker">{{minute}} | ||
75 | + <text class="iconfont icon-xiangxia min-icon"></text> | ||
76 | + </view> | ||
77 | + <text class="margin">分</text> | ||
74 | </view> | 78 | </view> |
75 | - <text class="margin">分</text> | ||
76 | - </view> | ||
77 | - </picker> | ||
78 | - </view> | ||
79 | - <view class="address-box"> | ||
80 | - <text class="address-title">地点</text> | ||
81 | - <input type="text" bindinput="inputAddress" class="input"/> | ||
82 | - </view> | ||
83 | - <view class="address-box" bindtap="choosePosition"> | ||
84 | - <text class="address-title">地址</text> | ||
85 | - <text class="input">{{address_position}}</text> | ||
86 | - <!--<input type="text" bindinput="inputPosition" value="" class="input"/>--> | ||
87 | - <text class="iconfont icon-location"></text> | ||
88 | - </view> | ||
89 | - <view class="time-limit"> | ||
90 | - <text>时限 活动开始前</text> | ||
91 | - <input type="number" bindinput="inputOverTime" value=""/> | ||
92 | - <text>小时 停止拼单</text> | 79 | + </picker> |
80 | + </view> | ||
81 | + <view class="address-box"> | ||
82 | + <text class="address-title">地点</text> | ||
83 | + <input type="text" bindinput="inputAddress" class="input"/> | ||
84 | + </view> | ||
85 | + <view class="address-box" bindtap="choosePosition"> | ||
86 | + <text class="address-title">地址</text> | ||
87 | + <text class="input">{{address_position}}</text> | ||
88 | + <!--<input type="text" bindinput="inputPosition" value="" class="input"/>--> | ||
89 | + <text class="iconfont icon-location"></text> | ||
90 | + </view> | ||
91 | + <view class="time-limit"> | ||
92 | + <text>时限 活动开始前</text> | ||
93 | + <input type="number" bindinput="inputOverTime" value=""/> | ||
94 | + <text>小时 停止拼单</text> | ||
95 | + </view> | ||
93 | </view> | 96 | </view> |
94 | - </view> | ||
95 | 97 | ||
96 | - <!--<button class="complete" form-type="submit">--> | ||
97 | - <view class="complete" bindtap="confirmRelease"> | ||
98 | - <view class="btn">确定发布</view> | 98 | + <button class="complete" form-type="submit"> |
99 | + <!--<view class="complete" bindtap="confirmRelease">--> | ||
100 | + <view class="btn">确定发布</view> | ||
101 | + <!--</view>--> | ||
102 | + </button> | ||
103 | + </view> | ||
104 | + <!--发布成功弹框--> | ||
105 | + <view class="modal" wx:if="{{is_showRelease_modal}}" catchtouchmove="disableScroll"> | ||
106 | + <image class="sorry-img" src="../../images/success@2x.png"></image> | ||
107 | + <view class="title">恭喜您发布成功</view> | ||
108 | + <view class="view-btn" catchtap="goMyRelease">查看我的发布</view> | ||
109 | + <view class="complete-btn" catchtap="goBack">完成</view> | ||
99 | </view> | 110 | </view> |
100 | - <!--</button>--> | ||
101 | -</view> | ||
102 | -<!--发布成功弹框--> | ||
103 | -<view class="modal" wx:if="{{is_showRelease_modal}}" catchtouchmove="disableScroll"> | ||
104 | - <image class="sorry-img" src="../../images/success@2x.png"></image> | ||
105 | - <view class="title">恭喜您发布成功</view> | ||
106 | - <view class="view-btn" catchtap="goMyRelease">查看我的发布</view> | ||
107 | - <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>--> | 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"> | ||
3 | - <!--swiper--> | ||
4 | - <view class="head"> | ||
5 | - <view class="position {{hidden_top?'hidden-active':'visible-active'}}"> | ||
6 | - <view class="left"> | ||
7 | - <!--<image src="../../../images/avatar@2x.png" class="user-avatar"></image>--> | ||
8 | - <image src="{{detail.userPic}}" class="user-avatar"></image> | ||
9 | - <text>{{detail.userName}}</text> | ||
10 | - </view> | ||
11 | - <view class="right"> | ||
12 | - <view class="collect" bindtap="collect"> | ||
13 | - <view class="iconfont icon-shoucang" wx:if="{{!is_collect}}"></view> | ||
14 | - <view class="iconfont icon-shoucang2" wx:if="{{is_collect}}"></view> | ||
15 | - <text>收藏</text> | 2 | +<form bindsubmit="confirmJoin" bindreset="formReset" report-submit="true"> |
3 | + <view class="content"> | ||
4 | + <!--swiper--> | ||
5 | + <view class="head"> | ||
6 | + <view class="position {{hidden_top?'hidden-active':'visible-active'}}"> | ||
7 | + <view class="left"> | ||
8 | + <!--<image src="../../../images/avatar@2x.png" class="user-avatar"></image>--> | ||
9 | + <image src="{{detail.userPic}}" class="user-avatar"></image> | ||
10 | + <text>{{detail.userName}}</text> | ||
16 | </view> | 11 | </view> |
17 | - <!--<!–未收藏–>--> | ||
18 | - <!--<view class='collect_box' catchtap='sethits_yes' data-index='{{index}}' wx:if='{{items.is_hits==0}}'>--> | 12 | + <view class="right"> |
13 | + <view class="collect" bindtap="collect"> | ||
14 | + <view class="iconfont icon-shoucang" wx:if="{{!is_collect}}"></view> | ||
15 | + <view class="iconfont icon-shoucang2" wx:if="{{is_collect}}"></view> | ||
16 | + <text>收藏</text> | ||
17 | + </view> | ||
18 | + <!--<!–未收藏–>--> | ||
19 | + <!--<view class='collect_box' catchtap='sethits_yes' data-index='{{index}}' wx:if='{{items.is_hits==0}}'>--> | ||
19 | <!--<text class='iconfont icon-shoucang1 '></text>--> | 20 | <!--<text class='iconfont icon-shoucang1 '></text>--> |
20 | <!--<text class="collect_word">收藏</text>--> | 21 | <!--<text class="collect_word">收藏</text>--> |
21 | - <!--</view>--> | ||
22 | - <!--<!–已收藏–>--> | ||
23 | - <!--<view class='collect_box active' catchtap='sethits_no' data-index='{{index}}' wx:else>--> | 22 | + <!--</view>--> |
23 | + <!--<!–已收藏–>--> | ||
24 | + <!--<view class='collect_box active' catchtap='sethits_no' data-index='{{index}}' wx:else>--> | ||
24 | <!--<text class='iconfont icon-shoucang0 star2'></text>--> | 25 | <!--<text class='iconfont icon-shoucang0 star2'></text>--> |
25 | <!--<text class="collect_word">收藏</text>--> | 26 | <!--<text class="collect_word">收藏</text>--> |
26 | - <!--</view>--> | ||
27 | - <button class="share" open-type="share"> | ||
28 | - <view class="iconfont icon-fenxiang2"></view> | ||
29 | - <text>分享</text> | ||
30 | - </button> | 27 | + <!--</view>--> |
28 | + <button class="share" open-type="share"> | ||
29 | + <view class="iconfont icon-fenxiang2"></view> | ||
30 | + <text>分享</text> | ||
31 | + </button> | ||
32 | + </view> | ||
33 | + </view> | ||
34 | + <swiper indicator-dots="{{false}}" current="{{current}}" bindchange="swiperChange" | ||
35 | + autoplay="{{true}}" interval="3000" duration="1000"> | ||
36 | + <block wx:for="{{detail.banner}}" wx:key="index"> | ||
37 | + <navigator url="{{item}}" hover-class="navigator-hover"> | ||
38 | + <swiper-item> | ||
39 | + <image src="{{item}}" class="slide-image"/> | ||
40 | + <!--<image src="http://pk86rwhci.bkt.clouddn.com/banner.png" class="slide-image"></image>--> | ||
41 | + </swiper-item> | ||
42 | + </navigator> | ||
43 | + </block> | ||
44 | + </swiper> | ||
45 | + <view class="dots"> | ||
46 | + <block wx:for="{{detail.banner}}" wx:key="index" wx:for-index="idx"> | ||
47 | + <view class="dot{{idx == current_swiper ? ' active' : ''}}"></view> | ||
48 | + </block> | ||
31 | </view> | 49 | </view> |
32 | </view> | 50 | </view> |
33 | - <swiper indicator-dots="{{false}}" current="{{current}}" bindchange="swiperChange" | ||
34 | - autoplay="{{true}}" interval="3000" duration="1000"> | ||
35 | - <block wx:for="{{detail.banner}}" wx:key="index"> | ||
36 | - <navigator url="{{item}}" hover-class="navigator-hover"> | ||
37 | - <swiper-item> | ||
38 | - <image src="{{item}}" class="slide-image"/> | ||
39 | - <!--<image src="http://pk86rwhci.bkt.clouddn.com/banner.png" class="slide-image"></image>--> | ||
40 | - </swiper-item> | ||
41 | - </navigator> | ||
42 | - </block> | ||
43 | - </swiper> | ||
44 | - <view class="dots"> | ||
45 | - <block wx:for="{{detail.banner}}" wx:key="index" wx:for-index="idx"> | ||
46 | - <view class="dot{{idx == current_swiper ? ' active' : ''}}"></view> | ||
47 | - </block> | ||
48 | - </view> | ||
49 | - </view> | ||
50 | - | ||
51 | - <!--地点--> | ||
52 | - <view class="area-box"> | ||
53 | - <view class="title-box"> | ||
54 | - <view class="title">{{detail.title}}</view> | ||
55 | - <view class="over-time"> | ||
56 | - <text class=''>{{detail.time[0].hou}}:{{detail.time[0].min}}:{{detail.time[0].sec}}</text> | ||
57 | - 后停止拼餐</view> | ||
58 | - <!--<view>--> | ||
59 | - <!--<text class=''>{{detail.time[0].hou}}</text>--> | ||
60 | - <!--<text>:</text>--> | ||
61 | - <!--<text class=''>{{detail.time[0].min}}</text>--> | ||
62 | - <!--<text>:</text>--> | ||
63 | - <!--<text class=' '>{{detail.time[0].sec}}</text>--> | ||
64 | - <!--</view>--> | ||
65 | - </view> | ||
66 | - <view class="area-content"> | ||
67 | - <text>{{detail.content}}</text> | ||
68 | - </view> | ||
69 | - </view> | ||
70 | 51 | ||
71 | - <!--详细时间--> | ||
72 | - <view class="detail-box"> | ||
73 | - <text>时间:{{end_time}}</text> | ||
74 | - <text>餐厅:{{detail.addr}}</text> | ||
75 | - <view class="position" bindtap="getNavigate"> | ||
76 | - <text class="address">地址:{{detail.address}}</text> | ||
77 | - <text class="iconfont icon-location"></text> | 52 | + <!--地点--> |
53 | + <view class="area-box"> | ||
54 | + <view class="title-box"> | ||
55 | + <view class="title">{{detail.title}}</view> | ||
56 | + <view class="over-time"> | ||
57 | + <text class=''>{{detail.time[0].hou}}:{{detail.time[0].min}}:{{detail.time[0].sec}}</text> | ||
58 | + 后停止拼餐 | ||
59 | + </view> | ||
60 | + <!--<view>--> | ||
61 | + <!--<text class=''>{{detail.time[0].hou}}</text>--> | ||
62 | + <!--<text>:</text>--> | ||
63 | + <!--<text class=''>{{detail.time[0].min}}</text>--> | ||
64 | + <!--<text>:</text>--> | ||
65 | + <!--<text class=' '>{{detail.time[0].sec}}</text>--> | ||
66 | + <!--</view>--> | ||
67 | + </view> | ||
68 | + <view class="area-content"> | ||
69 | + <text>{{detail.content}}</text> | ||
70 | + </view> | ||
78 | </view> | 71 | </view> |
79 | - <text>类别:{{detail.selectName}}</text> | ||
80 | - </view> | ||
81 | 72 | ||
82 | - <!--已加入人员--> | ||
83 | - <view class="join-num">已加入人员</view> | ||
84 | - <view class="people-list" wx:if="{{join_people.length>0}}"> | ||
85 | - <view class="people" wx:for="{{join_people}}" wx:key="index"> | ||
86 | - <view class="bg"><image src="{{item.pic}}" class="people-img"></image></view> | ||
87 | - <view class="name">{{item.name}}</view> | 73 | + <!--详细时间--> |
74 | + <view class="detail-box"> | ||
75 | + <text>时间:{{end_time}}</text> | ||
76 | + <text>餐厅:{{detail.addr}}</text> | ||
77 | + <view class="position" bindtap="getNavigate"> | ||
78 | + <text class="address">地址:{{detail.address}}</text> | ||
79 | + <text class="iconfont icon-location"></text> | ||
80 | + </view> | ||
81 | + <text>类别:{{detail.selectName}}</text> | ||
88 | </view> | 82 | </view> |
89 | - </view> | ||
90 | 83 | ||
91 | - <!--留言板 问一问--> | ||
92 | - <view class="comment-box"> | ||
93 | - <view class="title-box"> | ||
94 | - <text class="comment-num">留言板 ({{count}})</text> | ||
95 | - <view class="ask-btn" bindtap="ask"> | ||
96 | - <text class="iconfont icon-bianji"></text> | ||
97 | - <text>问一问</text> | 84 | + <!--已加入人员--> |
85 | + <view class="join-num">已加入人员</view> | ||
86 | + <view class="people-list" wx:if="{{join_people.length>0}}"> | ||
87 | + <view class="people" wx:for="{{join_people}}" wx:key="index"> | ||
88 | + <view class="bg"> | ||
89 | + <image src="{{item.pic}}" class="people-img"></image> | ||
90 | + </view> | ||
91 | + <view class="name">{{item.name}}</view> | ||
98 | </view> | 92 | </view> |
99 | </view> | 93 | </view> |
100 | 94 | ||
101 | - <!--评论--> | ||
102 | - <view class="comment-list-box"> | ||
103 | - <view class="comment-item" wx:for="{{commentList}}" wx:key="index" wx:for-item="comment"> | ||
104 | - <view class="top-content"> | ||
105 | - <view class="top-left"> | ||
106 | - <!--<image src="../../../images/avatar@2x.png" class="release-img"></image>--> | ||
107 | - <image src="{{comment.userPic}}" class="release-img"></image> | ||
108 | - <text>{{comment.userName}} {{comment.create_time}}</text> | ||
109 | - </view> | ||
110 | - <view class="top-right" bindtap="clickZan" data-id="{{comment.id}}" data-index="{{index}}"> | ||
111 | - <text>{{comment.prefect}}</text> | ||
112 | - <text class="iconfont icon-zan" wx:if="{{!comment.is_prefect}}"></text> | ||
113 | - <text class="iconfont icon-z-likeFill" wx:if="{{comment.is_prefect}}"></text> | ||
114 | - </view> | 95 | + <!--留言板 问一问--> |
96 | + <view class="comment-box"> | ||
97 | + <view class="title-box"> | ||
98 | + <text class="comment-num">留言板 ({{count}})</text> | ||
99 | + <view class="ask-btn" bindtap="ask"> | ||
100 | + <text class="iconfont icon-bianji"></text> | ||
101 | + <text>问一问</text> | ||
115 | </view> | 102 | </view> |
116 | - <view class="comment-detail"> | ||
117 | - <view class="user-release"> | ||
118 | - <view class="release-comment">{{comment.content}}</view> | ||
119 | - <text class="reply-btn" bindtap="reply" data-id="{{comment.id}}">回复</text> | 103 | + </view> |
104 | + | ||
105 | + <!--评论--> | ||
106 | + <view class="comment-list-box"> | ||
107 | + <view class="comment-item" wx:for="{{commentList}}" wx:key="index" wx:for-item="comment"> | ||
108 | + <view class="top-content"> | ||
109 | + <view class="top-left"> | ||
110 | + <!--<image src="../../../images/avatar@2x.png" class="release-img"></image>--> | ||
111 | + <image src="{{comment.userPic}}" class="release-img"></image> | ||
112 | + <text>{{comment.userName}} {{comment.create_time}}</text> | ||
113 | + </view> | ||
114 | + <view class="top-right" bindtap="clickZan" data-id="{{comment.id}}" data-index="{{index}}"> | ||
115 | + <text>{{comment.prefect}}</text> | ||
116 | + <text class="iconfont icon-zan" wx:if="{{!comment.is_prefect}}"></text> | ||
117 | + <text class="iconfont icon-z-likeFill" wx:if="{{comment.is_prefect}}"></text> | ||
118 | + </view> | ||
120 | </view> | 119 | </view> |
121 | - <view class="user-reply" wx:if="{{comment.son.length>0}}"> | ||
122 | - <view class='triangle'></view> | ||
123 | - <block wx:for="{{comment.son}}" wx:key="index"> | ||
124 | - <!--<view class="comment">--> | ||
125 | - <!--<text class="reply-name">蚂蚁: </text>--> | ||
126 | - <!--<text>{{item.content}}第一次拼餐,心里还是比较兴奋的,但是又担心拼友会比较无聊,但是没想到拼友和餐厅都非常好!</text>--> | ||
127 | - <!--</view>--> | ||
128 | - <view class="reply"> | ||
129 | - <text class="reply-name">{{detail.userName}}</text> | ||
130 | - <text>回复</text> | ||
131 | - <text class="reply-name">{{comment.userName}}:</text> | ||
132 | - <text>{{item.content}}</text> | ||
133 | - </view> | ||
134 | - </block> | 120 | + <view class="comment-detail"> |
121 | + <view class="user-release"> | ||
122 | + <view class="release-comment">{{comment.content}}</view> | ||
123 | + <text class="reply-btn" bindtap="reply" data-id="{{comment.id}}">回复</text> | ||
124 | + </view> | ||
125 | + <view class="user-reply" wx:if="{{comment.son.length>0}}"> | ||
126 | + <view class='triangle'></view> | ||
127 | + <block wx:for="{{comment.son}}" wx:key="index"> | ||
128 | + <!--<view class="comment">--> | ||
129 | + <!--<text class="reply-name">蚂蚁: </text>--> | ||
130 | + <!--<text>{{item.content}}第一次拼餐,心里还是比较兴奋的,但是又担心拼友会比较无聊,但是没想到拼友和餐厅都非常好!</text>--> | ||
131 | + <!--</view>--> | ||
132 | + <view class="reply"> | ||
133 | + <text class="reply-name">{{detail.userName}}</text> | ||
134 | + <text>回复</text> | ||
135 | + <text class="reply-name">{{comment.userName}}:</text> | ||
136 | + <text>{{item.content}}</text> | ||
137 | + </view> | ||
138 | + </block> | ||
139 | + </view> | ||
135 | </view> | 140 | </view> |
136 | </view> | 141 | </view> |
137 | </view> | 142 | </view> |
138 | </view> | 143 | </view> |
139 | - </view> | ||
140 | 144 | ||
141 | - <!--底部btn--> | ||
142 | - <view class="bottom-btn"> | ||
143 | - <view class="add-btn"> | ||
144 | - <view class="input_box"> | ||
145 | - <view class="iconfont icon-jian {{num==1?'disable':''}}" bindtap='minusCount'></view> | ||
146 | - <view class='item_cart_num'>{{num}}</view> | ||
147 | - <view class='iconfont icon-jia1' bindtap='addCount'></view> | 145 | + <!--底部btn--> |
146 | + <view class="bottom-btn"> | ||
147 | + <view class="add-btn"> | ||
148 | + <view class="input_box"> | ||
149 | + <view class="iconfont icon-jian {{num==1?'disable':''}}" bindtap='minusCount'></view> | ||
150 | + <view class='item_cart_num'>{{num}}</view> | ||
151 | + <view class='iconfont icon-jia1' bindtap='addCount'></view> | ||
152 | + </view> | ||
148 | </view> | 153 | </view> |
149 | - </view> | ||
150 | - <view class="confirm-join-btn"> | ||
151 | - <text>确认拼活动</text> | 154 | + <button class="confirm-join-btn" form-type="submit"> |
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 | - <view class="left"> | ||
7 | - <view class="iconfont icon-location"></view> | ||
8 | - <text>{{china_city}}</text> | ||
9 | - <view class="iconfont icon-arrow-down"></view> | ||
10 | - </view> | 6 | + <picker class="picker" bindchange="cityPickerChange" value="{{current_city}}" range="{{city_picker_list}}" class="picker"> |
7 | + <view class="left"> | ||
8 | + <view class="iconfont icon-location"></view> | ||
9 | + <text>{{city_picker_list[current_city] || china_city}}</text> | ||
10 | + <view class="iconfont icon-arrow-down"></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() { | ||
25 | - wx.navigateTo({ | ||
26 | - url: '/pages/activity/detail/detail', | ||
27 | - }) | 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是拼餐 | ||
29 | + wx.navigateTo({ | ||
30 | + url: '/pages/activity/detail/detail?id=' + id, | ||
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"> | ||
3 | - <!--swiper--> | ||
4 | - <view class="head"> | ||
5 | - <view class="position {{hidden_top?'hidden-active':'visible-active'}}"> | ||
6 | - <view class="left"> | ||
7 | - <!--<image src="../../../images/avatar@2x.png" class="user-avatar"></image>--> | ||
8 | - <image src="{{detail.userPic}}" class="user-avatar"></image> | ||
9 | - <text>{{detail.userName}}</text> | ||
10 | - </view> | ||
11 | - <view class="right"> | ||
12 | - <view class="collect" bindtap="collect"> | ||
13 | - <view class="iconfont icon-shoucang" wx:if="{{!is_collect}}"></view> | ||
14 | - <view class="iconfont icon-shoucang2" wx:if="{{is_collect}}"></view> | ||
15 | - <text>收藏</text> | 2 | +<form bindsubmit="confirmJoin" bindreset="formReset" report-submit="true"> |
3 | + <view class="content"> | ||
4 | + <!--swiper--> | ||
5 | + <view class="head"> | ||
6 | + <view class="position {{hidden_top?'hidden-active':'visible-active'}}"> | ||
7 | + <view class="left"> | ||
8 | + <!--<image src="../../../images/avatar@2x.png" class="user-avatar"></image>--> | ||
9 | + <image src="{{detail.userPic}}" class="user-avatar"></image> | ||
10 | + <text>{{detail.userName}}</text> | ||
11 | + </view> | ||
12 | + <view class="right"> | ||
13 | + <view class="collect" bindtap="collect"> | ||
14 | + <view class="iconfont icon-shoucang" wx:if="{{!is_collect}}"></view> | ||
15 | + <view class="iconfont icon-shoucang2" wx:if="{{is_collect}}"></view> | ||
16 | + <text>收藏</text> | ||
17 | + </view> | ||
18 | + <!--<!–未收藏–>--> | ||
19 | + <!--<view class='collect_box' catchtap='sethits_yes' data-index='{{index}}' wx:if='{{items.is_hits==0}}'>--> | ||
20 | + <!--<text class='iconfont icon-shoucang1 '></text>--> | ||
21 | + <!--<text class="collect_word">收藏</text>--> | ||
22 | + <!--</view>--> | ||
23 | + <!--<!–已收藏–>--> | ||
24 | + <!--<view class='collect_box active' catchtap='sethits_no' data-index='{{index}}' wx:else>--> | ||
25 | + <!--<text class='iconfont icon-shoucang0 star2'></text>--> | ||
26 | + <!--<text class="collect_word">收藏</text>--> | ||
27 | + <!--</view>--> | ||
28 | + <button class="share" open-type="share"> | ||
29 | + <view class="iconfont icon-fenxiang2"></view> | ||
30 | + <text>分享</text> | ||
31 | + </button> | ||
16 | </view> | 32 | </view> |
17 | - <!--<!–未收藏–>--> | ||
18 | - <!--<view class='collect_box' catchtap='sethits_yes' data-index='{{index}}' wx:if='{{items.is_hits==0}}'>--> | ||
19 | - <!--<text class='iconfont icon-shoucang1 '></text>--> | ||
20 | - <!--<text class="collect_word">收藏</text>--> | ||
21 | - <!--</view>--> | ||
22 | - <!--<!–已收藏–>--> | ||
23 | - <!--<view class='collect_box active' catchtap='sethits_no' data-index='{{index}}' wx:else>--> | ||
24 | - <!--<text class='iconfont icon-shoucang0 star2'></text>--> | ||
25 | - <!--<text class="collect_word">收藏</text>--> | ||
26 | - <!--</view>--> | ||
27 | - <button class="share" open-type="share"> | ||
28 | - <view class="iconfont icon-fenxiang2"></view> | ||
29 | - <text>分享</text> | ||
30 | - </button> | 33 | + </view> |
34 | + <swiper indicator-dots="{{false}}" current="{{current}}" bindchange="swiperChange" | ||
35 | + autoplay="{{true}}" interval="3000" duration="1000"> | ||
36 | + <block wx:for="{{detail.banner}}" wx:key="index"> | ||
37 | + <navigator url="{{item}}" hover-class="navigator-hover"> | ||
38 | + <swiper-item> | ||
39 | + <image src="{{item}}" class="slide-image"/> | ||
40 | + <!--<image src="http://pk86rwhci.bkt.clouddn.com/banner.png" class="slide-image"></image>--> | ||
41 | + </swiper-item> | ||
42 | + </navigator> | ||
43 | + </block> | ||
44 | + </swiper> | ||
45 | + <view class="dots"> | ||
46 | + <block wx:for="{{detail.banner}}" wx:key="index" wx:for-index="idx"> | ||
47 | + <view class="dot{{idx == current_swiper ? ' active' : ''}}"></view> | ||
48 | + </block> | ||
31 | </view> | 49 | </view> |
32 | </view> | 50 | </view> |
33 | - <swiper indicator-dots="{{false}}" current="{{current}}" bindchange="swiperChange" | ||
34 | - autoplay="{{true}}" interval="3000" duration="1000"> | ||
35 | - <block wx:for="{{detail.banner}}" wx:key="index"> | ||
36 | - <navigator url="{{item}}" hover-class="navigator-hover"> | ||
37 | - <swiper-item> | ||
38 | - <image src="{{item}}" class="slide-image"/> | ||
39 | - <!--<image src="http://pk86rwhci.bkt.clouddn.com/banner.png" class="slide-image"></image>--> | ||
40 | - </swiper-item> | ||
41 | - </navigator> | ||
42 | - </block> | ||
43 | - </swiper> | ||
44 | - <view class="dots"> | ||
45 | - <block wx:for="{{detail.banner}}" wx:key="index" wx:for-index="idx"> | ||
46 | - <view class="dot{{idx == current_swiper ? ' active' : ''}}"></view> | ||
47 | - </block> | ||
48 | - </view> | ||
49 | - </view> | ||
50 | - | ||
51 | - <!--地点--> | ||
52 | - <view class="area-box"> | ||
53 | - <view class="title-box"> | ||
54 | - <view class="title">{{detail.title}}</view> | ||
55 | - <view class="over-time"> | ||
56 | - <text class=''>{{detail.time[0].hou}}:{{detail.time[0].min}}:{{detail.time[0].sec}}</text> | ||
57 | - 后停止拼餐</view> | ||
58 | - <!--<view>--> | ||
59 | - <!--<text class=''>{{detail.time[0].hou}}</text>--> | ||
60 | - <!--<text>:</text>--> | ||
61 | - <!--<text class=''>{{detail.time[0].min}}</text>--> | ||
62 | - <!--<text>:</text>--> | ||
63 | - <!--<text class=' '>{{detail.time[0].sec}}</text>--> | ||
64 | - <!--</view>--> | ||
65 | - </view> | ||
66 | - <view class="area-content"> | ||
67 | - <text>{{detail.content}}</text> | ||
68 | - <!--云峰山风景区坐落于密云水库北不老屯镇,燕落村北三公里,处于--> | ||
69 | - <!--密云区东西两大风景区之间,东靠密云古北口 ──司马台长城──--> | ||
70 | - <!--雾灵山风景区。--> | ||
71 | - </view> | ||
72 | - </view> | ||
73 | 51 | ||
74 | - <!--详细时间--> | ||
75 | - <view class="detail-box"> | ||
76 | - <text>时间:{{end_time}}</text> | ||
77 | - <text>餐厅:{{detail.addr}}</text><!--餐厅--> | ||
78 | - <view class="position" bindtap="getNavigate"> | ||
79 | - <text class="address">地址:{{detail.address}}</text><!--地址:--> | ||
80 | - <!--侨福芳草地B2 OPERA BOMBANA--> | ||
81 | - <text class="iconfont icon-location"></text> | 52 | + <!--地点--> |
53 | + <view class="area-box"> | ||
54 | + <view class="title-box"> | ||
55 | + <view class="title">{{detail.title}}</view> | ||
56 | + <view class="over-time"> | ||
57 | + <text class=''>{{detail.time[0].hou}}:{{detail.time[0].min}}:{{detail.time[0].sec}}</text> | ||
58 | + 后停止拼餐 | ||
59 | + </view> | ||
60 | + <!--<view>--> | ||
61 | + <!--<text class=''>{{detail.time[0].hou}}</text>--> | ||
62 | + <!--<text>:</text>--> | ||
63 | + <!--<text class=''>{{detail.time[0].min}}</text>--> | ||
64 | + <!--<text>:</text>--> | ||
65 | + <!--<text class=' '>{{detail.time[0].sec}}</text>--> | ||
66 | + <!--</view>--> | ||
67 | + </view> | ||
68 | + <view class="area-content"> | ||
69 | + <text>{{detail.content}}</text> | ||
70 | + <!--云峰山风景区坐落于密云水库北不老屯镇,燕落村北三公里,处于--> | ||
71 | + <!--密云区东西两大风景区之间,东靠密云古北口 ──司马台长城──--> | ||
72 | + <!--雾灵山风景区。--> | ||
73 | + </view> | ||
82 | </view> | 74 | </view> |
83 | - <text>菜系:{{detail.selectName}}</text> | ||
84 | - <!--意大利菜--> | ||
85 | - </view> | ||
86 | 75 | ||
87 | - <!--已加入人员--> | ||
88 | - <view class="join-num">已加入人员</view> | ||
89 | - <view class="people-list" wx:if="{{join_people.length>0}}"> | ||
90 | - <view class="people" wx:for="{{join_people}}" wx:key="index"> | ||
91 | - <view class="bg"><image src="{{item.pic}}" class="people-img"></image></view> | ||
92 | - <view class="name">{{item.name}}</view> | 76 | + <!--详细时间--> |
77 | + <view class="detail-box"> | ||
78 | + <text>时间:{{end_time}}</text> | ||
79 | + <text>餐厅:{{detail.addr}}</text><!--餐厅--> | ||
80 | + <view class="position" bindtap="getNavigate"> | ||
81 | + <text class="address">地址:{{detail.address}}</text><!--地址:--> | ||
82 | + <!--侨福芳草地B2 OPERA BOMBANA--> | ||
83 | + <text class="iconfont icon-location"></text> | ||
84 | + </view> | ||
85 | + <text>菜系:{{detail.selectName}}</text> | ||
86 | + <!--意大利菜--> | ||
93 | </view> | 87 | </view> |
94 | - </view> | ||
95 | 88 | ||
96 | - <!--留言板 问一问--> | ||
97 | - <view class="comment-box"> | ||
98 | - <view class="title-box"> | ||
99 | - <text class="comment-num">留言板 ({{count}})</text> | ||
100 | - <view class="ask-btn" bindtap="ask"> | ||
101 | - <text class="iconfont icon-bianji"></text> | ||
102 | - <text>问一问</text> | ||
103 | - <!--<input type="text" class="ask-input" bindinput="ask" focus="{{focus}}"/>--> | 89 | + <!--已加入人员--> |
90 | + <view class="join-num">已加入人员</view> | ||
91 | + <view class="people-list" wx:if="{{join_people.length>0}}"> | ||
92 | + <view class="people" wx:for="{{join_people}}" wx:key="index"> | ||
93 | + <view class="bg"> | ||
94 | + <image src="{{item.pic}}" class="people-img"></image> | ||
95 | + </view> | ||
96 | + <view class="name">{{item.name}}</view> | ||
104 | </view> | 97 | </view> |
105 | </view> | 98 | </view> |
106 | 99 | ||
107 | - <!--评论--> | ||
108 | - <view class="comment-list-box"> | ||
109 | - <view class="comment-item" wx:for="{{commentList}}" wx:key="index" wx:for-item="comment"> | ||
110 | - <view class="top-content"> | ||
111 | - <view class="top-left"> | ||
112 | - <!--<image src="../../../images/avatar@2x.png" class="release-img"></image>--> | ||
113 | - <image src="{{comment.userPic}}" class="release-img"></image> | ||
114 | - <text>{{comment.userName}} {{comment.create_time}}</text> | ||
115 | - </view> | ||
116 | - <view class="top-right" bindtap="clickZan" data-id="{{comment.id}}" data-index="{{index}}"> | ||
117 | - <text>{{comment.prefect}}</text> | ||
118 | - <text class="iconfont icon-zan" wx:if="{{!comment.is_prefect}}"></text> | ||
119 | - <text class="iconfont icon-z-likeFill" wx:if="{{comment.is_prefect}}"></text> | ||
120 | - </view> | 100 | + <!--留言板 问一问--> |
101 | + <view class="comment-box"> | ||
102 | + <view class="title-box"> | ||
103 | + <text class="comment-num">留言板 ({{count}})</text> | ||
104 | + <view class="ask-btn" bindtap="ask"> | ||
105 | + <text class="iconfont icon-bianji"></text> | ||
106 | + <text>问一问</text> | ||
107 | + <!--<input type="text" class="ask-input" bindinput="ask" focus="{{focus}}"/>--> | ||
121 | </view> | 108 | </view> |
122 | - <view class="comment-detail"> | ||
123 | - <view class="user-release"> | ||
124 | - <view class="release-comment">{{comment.content}}</view> | ||
125 | - <text class="reply-btn" bindtap="reply" data-id="{{comment.id}}">回复</text> | 109 | + </view> |
110 | + | ||
111 | + <!--评论--> | ||
112 | + <view class="comment-list-box"> | ||
113 | + <view class="comment-item" wx:for="{{commentList}}" wx:key="index" wx:for-item="comment"> | ||
114 | + <view class="top-content"> | ||
115 | + <view class="top-left"> | ||
116 | + <!--<image src="../../../images/avatar@2x.png" class="release-img"></image>--> | ||
117 | + <image src="{{comment.userPic}}" class="release-img"></image> | ||
118 | + <text>{{comment.userName}} {{comment.create_time}}</text> | ||
119 | + </view> | ||
120 | + <view class="top-right" bindtap="clickZan" data-id="{{comment.id}}" data-index="{{index}}"> | ||
121 | + <text>{{comment.prefect}}</text> | ||
122 | + <text class="iconfont icon-zan" wx:if="{{!comment.is_prefect}}"></text> | ||
123 | + <text class="iconfont icon-z-likeFill" wx:if="{{comment.is_prefect}}"></text> | ||
124 | + </view> | ||
126 | </view> | 125 | </view> |
127 | - <view class="user-reply" wx:if="{{comment.son.length>0}}"> | ||
128 | - <view class='triangle'></view> | ||
129 | - <block wx:for="{{comment.son}}" wx:key="index"> | ||
130 | - <!--<view class="comment">--> | 126 | + <view class="comment-detail"> |
127 | + <view class="user-release"> | ||
128 | + <view class="release-comment">{{comment.content}}</view> | ||
129 | + <text class="reply-btn" bindtap="reply" data-id="{{comment.id}}">回复</text> | ||
130 | + </view> | ||
131 | + <view class="user-reply" wx:if="{{comment.son.length>0}}"> | ||
132 | + <view class='triangle'></view> | ||
133 | + <block wx:for="{{comment.son}}" wx:key="index"> | ||
134 | + <!--<view class="comment">--> | ||
131 | <!--<text class="reply-name">蚂蚁: </text>--> | 135 | <!--<text class="reply-name">蚂蚁: </text>--> |
132 | <!--<text>{{item.content}}第一次拼餐,心里还是比较兴奋的,但是又担心拼友会比较无聊,但是没想到拼友和餐厅都非常好!</text>--> | 136 | <!--<text>{{item.content}}第一次拼餐,心里还是比较兴奋的,但是又担心拼友会比较无聊,但是没想到拼友和餐厅都非常好!</text>--> |
133 | - <!--</view>--> | ||
134 | - <view class="reply"> | ||
135 | - <text class="reply-name">{{detail.userName}}</text> | ||
136 | - <text>回复</text> | ||
137 | - <text class="reply-name">{{comment.userName}}:</text> | ||
138 | - <text>{{item.content}}</text> | ||
139 | - </view> | ||
140 | - </block> | 137 | + <!--</view>--> |
138 | + <view class="reply"> | ||
139 | + <text class="reply-name">{{detail.userName}}</text> | ||
140 | + <text>回复</text> | ||
141 | + <text class="reply-name">{{comment.userName}}:</text> | ||
142 | + <text>{{item.content}}</text> | ||
143 | + </view> | ||
144 | + </block> | ||
145 | + </view> | ||
141 | </view> | 146 | </view> |
142 | </view> | 147 | </view> |
143 | </view> | 148 | </view> |
144 | </view> | 149 | </view> |
145 | - </view> | ||
146 | 150 | ||
147 | - <!--底部btn--> | ||
148 | - <view class="bottom-btn"> | ||
149 | - <view class="add-btn"> | ||
150 | - <view class="input_box"> | ||
151 | - <view class="iconfont icon-jian {{num==1?'disable':''}}" bindtap='minusCount'></view> | ||
152 | - <view class='item_cart_num'>{{num}}</view> | ||
153 | - <view class='iconfont icon-jia1' bindtap='addCount'></view> | 151 | + <!--底部btn--> |
152 | + <view class="bottom-btn"> | ||
153 | + <view class="add-btn"> | ||
154 | + <view class="input_box"> | ||
155 | + <view class="iconfont icon-jian {{num==1?'disable':''}}" bindtap='minusCount'></view> | ||
156 | + <view class='item_cart_num'>{{num}}</view> | ||
157 | + <view class='iconfont icon-jia1' bindtap='addCount'></view> | ||
158 | + </view> | ||
154 | </view> | 159 | </view> |
155 | - </view> | ||
156 | - <view class="confirm-join-btn" bindtap="confirmJoin"> | ||
157 | - <text>确认拼餐</text> | 160 | + <button class="confirm-join-btn" form-type="submit"> |
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 | - /** | ||
5 | - * 页面的初始数据 | ||
6 | - */ | ||
7 | - data: { | ||
8 | - | ||
9 | - }, | ||
10 | - | ||
11 | - /** | ||
12 | - * 生命周期函数--监听页面加载 | ||
13 | - */ | ||
14 | - onLoad: function (options) { | ||
15 | - | ||
16 | - }, | ||
17 | - | ||
18 | - /** | ||
19 | - * 生命周期函数--监听页面初次渲染完成 | ||
20 | - */ | ||
21 | - onReady: function () { | ||
22 | - | ||
23 | - }, | ||
24 | - | ||
25 | - /** | ||
26 | - * 生命周期函数--监听页面显示 | ||
27 | - */ | ||
28 | - onShow: function () { | ||
29 | - | ||
30 | - }, | ||
31 | - | ||
32 | - /** | ||
33 | - * 生命周期函数--监听页面隐藏 | ||
34 | - */ | ||
35 | - onHide: function () { | ||
36 | - | ||
37 | - }, | ||
38 | - | ||
39 | - /** | ||
40 | - * 生命周期函数--监听页面卸载 | ||
41 | - */ | ||
42 | - onUnload: function () { | ||
43 | - | ||
44 | - }, | ||
45 | - | ||
46 | - /** | ||
47 | - * 页面相关事件处理函数--监听用户下拉动作 | ||
48 | - */ | ||
49 | - onPullDownRefresh: function () { | ||
50 | - | ||
51 | - }, | ||
52 | - | ||
53 | - /** | ||
54 | - * 页面上拉触底事件的处理函数 | ||
55 | - */ | ||
56 | - onReachBottom: function () { | ||
57 | - | ||
58 | - }, | ||
59 | - | ||
60 | - /** | ||
61 | - * 用户点击右上角分享 | ||
62 | - */ | ||
63 | - onShareAppMessage: function () { | ||
64 | - | ||
65 | - } | 6 | + /** |
7 | + * 页面的初始数据 | ||
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 | + }); | ||
27 | + }, | ||
28 | + /** | ||
29 | + * 生命周期函数--监听页面加载 | ||
30 | + */ | ||
31 | + onLoad: function (options) { | ||
32 | + | ||
33 | + }, | ||
34 | + | ||
35 | + /** | ||
36 | + * 生命周期函数--监听页面初次渲染完成 | ||
37 | + */ | ||
38 | + onReady: function () { | ||
39 | + | ||
40 | + }, | ||
41 | + | ||
42 | + /** | ||
43 | + * 生命周期函数--监听页面显示 | ||
44 | + */ | ||
45 | + onShow: function () { | ||
46 | + this.getAbout() | ||
47 | + }, | ||
48 | + | ||
49 | + /** | ||
50 | + * 生命周期函数--监听页面隐藏 | ||
51 | + */ | ||
52 | + onHide: function () { | ||
53 | + | ||
54 | + }, | ||
55 | + | ||
56 | + /** | ||
57 | + * 生命周期函数--监听页面卸载 | ||
58 | + */ | ||
59 | + onUnload: function () { | ||
60 | + | ||
61 | + }, | ||
62 | + | ||
63 | + /** | ||
64 | + * 页面相关事件处理函数--监听用户下拉动作 | ||
65 | + */ | ||
66 | + onPullDownRefresh: function () { | ||
67 | + | ||
68 | + }, | ||
69 | + | ||
70 | + /** | ||
71 | + * 页面上拉触底事件的处理函数 | ||
72 | + */ | ||
73 | + onReachBottom: function () { | ||
74 | + | ||
75 | + }, | ||
76 | + | ||
77 | + /** | ||
78 | + * 用户点击右上角分享 | ||
79 | + */ | ||
80 | + onShareAppMessage: function () { | ||
81 | + | ||
82 | + } | ||
66 | }) | 83 | }) |
@@ -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> | ||
28 | - <view class="people-name">{{item.name}}</view> | ||
29 | - <view class="people-phone">手机号: {{item.num}}</view> | ||
30 | - </view> | 27 | + <scroll-view class="scroll" scroll-y> |
28 | + <view wx:for="{{join}}" wx:key="index" class="list"> | ||
29 | + <image src="{{item.pic}}"></image> | ||
30 | + <view class="people-name">{{item.name}}</view> | ||
31 | + <view class="people-phone">手机号: {{item.tel}}</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; |
@@ -120,7 +121,7 @@ | @@ -120,7 +121,7 @@ | ||
120 | .bg { | 121 | .bg { |
121 | background-color: #fff; | 122 | background-color: #fff; |
122 | border-radius: 10rpx; | 123 | border-radius: 10rpx; |
123 | - padding: 28rpx 40rpx 20rpx 40rpx; | 124 | + padding: 28rpx 40rpx 20rpx 40rpx; |
124 | } | 125 | } |
125 | .detail .code { | 126 | .detail .code { |
126 | width: 100%; | 127 | width: 100%; |
@@ -143,4 +144,12 @@ | @@ -143,4 +144,12 @@ | ||
143 | width: 100%; | 144 | width: 100%; |
144 | height: 10rpx; | 145 | height: 10rpx; |
145 | border-bottom: 16rpx dotted #fff; | 146 | border-bottom: 16rpx dotted #fff; |
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; | ||
146 | } | 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"> | ||
6 | - <view class="area"> | ||
7 | - <text>{{item.area}}</text> | ||
8 | - <text>{{item.user}}</text> | ||
9 | - </view> | ||
10 | - <view class="time"> | ||
11 | - <text>{{item.date}}</text> | ||
12 | - <text>{{item.time}}</text> | ||
13 | - </view> | ||
14 | - <view class="address"> | ||
15 | - <text>{{item.address}}</text> | ||
16 | - <text>1人</text> | 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':''}}"> | ||
10 | + <view class="area"> | ||
11 | + <text class="addr">{{item.addr}}</text> | ||
12 | + <text>{{item.userName}}</text> | ||
13 | + </view> | ||
14 | + <view class="time"> | ||
15 | + <text>时间:{{item.time}}</text> | ||
16 | + </view> | ||
17 | + <view class="address"> | ||
18 | + <text class="addr">地址:{{item.address}}</text> | ||
19 | + <text>{{item.number}}人</text> | ||
20 | + </view> | ||
17 | </view> | 21 | </view> |
22 | + <view class="code"></view> | ||
23 | + <view class="name">{{item.type === 1?'活动票':'饭票'}}</view> | ||
18 | </view> | 24 | </view> |
19 | - <view class="code"></view> | ||
20 | - <view class="name">{{item.type}}</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; |
@@ -67,4 +86,14 @@ | @@ -67,4 +86,14 @@ | ||
67 | text-align: center; | 86 | text-align: center; |
68 | color:#ffffff; | 87 | color:#ffffff; |
69 | font-weight: bold; | 88 | font-weight: bold; |
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; | ||
70 | } | 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,22 +228,24 @@ Page({ | @@ -225,22 +228,24 @@ Page({ | ||
225 | }, | 228 | }, |
226 | //获取首页内容 | 229 | //获取首页内容 |
227 | getIndex(res) { | 230 | getIndex(res) { |
228 | - let url = '/portal/Member/index'; | ||
229 | - let params = { | ||
230 | - // lat: res.latitude, | ||
231 | - // lng: res.longitude, | ||
232 | - token: wx.getStorageSync('token'), | ||
233 | - }; | ||
234 | - let header = { | ||
235 | - "XX-token": wx.getStorageSync('token') | ||
236 | - }; | ||
237 | - app.post(url, params, {}).then((res) => { | ||
238 | - console.log('获取首页', res); | ||
239 | - this.setData({ | ||
240 | - user:res.data.member | 231 | + if(app.globalData.isLogin) { |
232 | + let url = '/portal/Member/index'; | ||
233 | + let params = { | ||
234 | + // lat: res.latitude, | ||
235 | + // lng: res.longitude, | ||
236 | + token: wx.getStorageSync('token'), | ||
237 | + }; | ||
238 | + let header = { | ||
239 | + "XX-token": wx.getStorageSync('token') | ||
240 | + }; | ||
241 | + app.post(url, params, {}).then((res) => { | ||
242 | + console.log('获取首页', res); | ||
243 | + this.setData({ | ||
244 | + user:res.data.member | ||
245 | + }) | ||
246 | + // console.log(this.data.this_week_test_info); | ||
241 | }) | 247 | }) |
242 | - // console.log(this.data.this_week_test_info); | ||
243 | - }) | 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 | - <view class="left"> | ||
6 | - <view class="iconfont icon-location"></view> | ||
7 | - <text>北京</text> | ||
8 | - <view class="iconfont icon-arrow-down"></view> | ||
9 | - </view> | 5 | + <picker class="picker" bindchange="cityPickerChange" value="{{current_city}}" range="{{city_picker_list}}" class="picker"> |
6 | + <view class="left"> | ||
7 | + <view class="iconfont icon-location"></view> | ||
8 | + <text>{{city_picker_list[current_city] || city}}</text> | ||
9 | + <view class="iconfont icon-arrow-down"></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> |
-
请 注册 或 登录 后发表评论