正在显示
15 个修改的文件
包含
202 行增加
和
82 行删除
@@ -10,9 +10,9 @@ App({ | @@ -10,9 +10,9 @@ App({ | ||
10 | // console.log('授权过到首页'); | 10 | // console.log('授权过到首页'); |
11 | // self.globalData.isLogin = true; | 11 | // self.globalData.isLogin = true; |
12 | // wx.setStorageSync('isLogin', true) | 12 | // wx.setStorageSync('isLogin', true) |
13 | - // // wx.redirectTo({ | ||
14 | - // // url: '/pages/index/index', //跳转到首页 | ||
15 | - // // }); | 13 | + // wx.redirectTo({ |
14 | + // url: '/pages/index/index', //跳转到首页 | ||
15 | + // }); | ||
16 | // } else { | 16 | // } else { |
17 | // console.log('授权失效到授权页'); | 17 | // console.log('授权失效到授权页'); |
18 | // self.globalData.isLogin = false; | 18 | // self.globalData.isLogin = false; |
@@ -32,6 +32,17 @@ App({ | @@ -32,6 +32,17 @@ App({ | ||
32 | 32 | ||
33 | 33 | ||
34 | // 获取用户信息 | 34 | // 获取用户信息 |
35 | + this.getUserInfo() | ||
36 | + }, | ||
37 | + getUserInfo() { | ||
38 | + const self = this; | ||
39 | + wx.getUserInfo({ | ||
40 | + success: function (user) { | ||
41 | + // console.log('获取用户信息', user);// gender:性别 0:未知、1:男、2:女 | ||
42 | + // console.log('user.userInfo',user.userInfo); | ||
43 | + self.globalData.userInfo = user.userInfo; | ||
44 | + } | ||
45 | + }); | ||
35 | }, | 46 | }, |
36 | getLogin() { | 47 | getLogin() { |
37 | const self = this; | 48 | const self = this; |
@@ -57,7 +68,9 @@ App({ | @@ -57,7 +68,9 @@ App({ | ||
57 | }, {}).then((ret) => { | 68 | }, {}).then((ret) => { |
58 | // console.log('获取token', ret); | 69 | // console.log('获取token', ret); |
59 | wx.setStorageSync('token', ret.data.token); | 70 | wx.setStorageSync('token', ret.data.token); |
71 | + // console.log('user.userInfo',user.userInfo); | ||
60 | self.globalData.userInfo = user.userInfo; | 72 | self.globalData.userInfo = user.userInfo; |
73 | + | ||
61 | resolve(ret.data); | 74 | resolve(ret.data); |
62 | // setTimeout(function () { | 75 | // setTimeout(function () { |
63 | // wx.navigateBack({delta: 1}) | 76 | // wx.navigateBack({delta: 1}) |
@@ -22,6 +22,7 @@ Page({ | @@ -22,6 +22,7 @@ Page({ | ||
22 | address_position:'', | 22 | address_position:'', |
23 | over_time:'', | 23 | over_time:'', |
24 | is_showRelease_modal:false, | 24 | is_showRelease_modal:false, |
25 | + is_select:false | ||
25 | }, | 26 | }, |
26 | //查看我的发布 | 27 | //查看我的发布 |
27 | goMyRelease() { | 28 | goMyRelease() { |
@@ -62,6 +63,41 @@ Page({ | @@ -62,6 +63,41 @@ Page({ | ||
62 | this.setData({max_num:''}); | 63 | this.setData({max_num:''}); |
63 | } | 64 | } |
64 | }, | 65 | }, |
66 | + //输入搜索内容 | ||
67 | + inputKey(e){ | ||
68 | + this.setData({search_text:e.detail.value}) | ||
69 | + }, | ||
70 | + //点击搜索 | ||
71 | + search() { | ||
72 | + let self = this; | ||
73 | + let url = '/portal/Send/select'; | ||
74 | + let header = { | ||
75 | + "XX-Token": wx.getStorageSync('token') | ||
76 | + }; | ||
77 | + let params = { | ||
78 | + // token: wx.getStorageSync('token'), | ||
79 | + keyword:self.data.search_text, | ||
80 | + }; | ||
81 | + self.setData({is_select:false}); | ||
82 | + app.post(url, params, header).then((res) => { | ||
83 | + console.log('搜索结果', res); | ||
84 | + // wx.hideLoading(); | ||
85 | + if(+res.code === 1) { | ||
86 | + self.setData({search_text:'',}); | ||
87 | + if(res.data.addr.length === 0) { | ||
88 | + wx.showToast({title:'暂无此地区',icon:'none'}) | ||
89 | + }else { | ||
90 | + self.setData({ | ||
91 | + // city_picker_list: arr, | ||
92 | + // cityList:res.data, | ||
93 | + city:res.data.addr[0].title, | ||
94 | + city_id:res.data.addr[0].id, | ||
95 | + }); | ||
96 | + } | ||
97 | + } | ||
98 | + | ||
99 | + }) | ||
100 | + }, | ||
65 | //输入地点 | 101 | //输入地点 |
66 | inputAddress(e) { | 102 | inputAddress(e) { |
67 | this.setData({address:e.detail.value}) | 103 | this.setData({address:e.detail.value}) |
@@ -133,6 +169,10 @@ Page({ | @@ -133,6 +169,10 @@ Page({ | ||
133 | }, | 169 | }, |
134 | //确定发布 | 170 | //确定发布 |
135 | confirmRelease(e) { | 171 | confirmRelease(e) { |
172 | + var current_city = this.data.current_city; | ||
173 | + var city_list = this.data.city_list; | ||
174 | + var city = this.data.city; | ||
175 | + var is_select = this.data.is_select;//是否是通过下拉框选择城市 | ||
136 | // else if(this.data.address_position === '') { | 176 | // else if(this.data.address_position === '') { |
137 | // wx.showToast({title:'请定位地址',icon:'none'}) | 177 | // wx.showToast({title:'请定位地址',icon:'none'}) |
138 | // } | 178 | // } |
@@ -149,8 +189,8 @@ Page({ | @@ -149,8 +189,8 @@ Page({ | ||
149 | wx.showToast({title:'请填写最高人数',icon:'none'}) | 189 | wx.showToast({title:'请填写最高人数',icon:'none'}) |
150 | }else if(this.data.current_type === undefined) { | 190 | }else if(this.data.current_type === undefined) { |
151 | wx.showToast({title:'请选择类别',icon:'none'}) | 191 | wx.showToast({title:'请选择类别',icon:'none'}) |
152 | - }else if(this.data.current_city === undefined) { | ||
153 | - wx.showToast({title:'请选择城市',icon:'none'}) | 192 | + }else if(current_city === undefined && city === undefined) { |
193 | + wx.showToast({title:'请选择地区',icon:'none'}) | ||
154 | }else if(this.data.date === '') { | 194 | }else if(this.data.date === '') { |
155 | wx.showToast({title:'请选择日期',icon:'none'}) | 195 | wx.showToast({title:'请选择日期',icon:'none'}) |
156 | }else if(this.data.time === '') { | 196 | }else if(this.data.time === '') { |
@@ -182,12 +222,13 @@ Page({ | @@ -182,12 +222,13 @@ Page({ | ||
182 | select_id: this.data.type_id,//类别 | 222 | select_id: this.data.type_id,//类别 |
183 | time: this.data.date + ' ' + this.data.time, | 223 | time: this.data.date + ' ' + this.data.time, |
184 | addr: this.data.address, | 224 | addr: this.data.address, |
185 | - address: this.data.address_position, | 225 | + // address: this.data.address_position, |
226 | + address: this.data.address1, | ||
186 | latng: '', | 227 | latng: '', |
187 | over_time:this.data.over_time,// 报名截止时间 | 228 | over_time:this.data.over_time,// 报名截止时间 |
188 | formId: e.detail.formId, | 229 | formId: e.detail.formId, |
189 | - choose_addr: this.data.city_list[this.data.current_city].title, | ||
190 | - choose_addr_id:this.data.city_list[this.data.current_city].id, | 230 | + choose_addr: is_select?city_list[current_city].title:city, |
231 | + choose_addr_id:is_select?city_list[current_city].id:this.data.city_id, | ||
191 | }; | 232 | }; |
192 | app.post(url, params, {}).then((res) => { | 233 | app.post(url, params, {}).then((res) => { |
193 | // console.log('确定发布', res); | 234 | // console.log('确定发布', res); |
@@ -315,7 +356,8 @@ Page({ | @@ -315,7 +356,8 @@ Page({ | ||
315 | }, | 356 | }, |
316 | //选择城市 | 357 | //选择城市 |
317 | bindCityChange(e) { | 358 | bindCityChange(e) { |
318 | - this.setData({current_city: +e.detail.value}) | 359 | + this.setData({current_city: +e.detail.value,is_select:true}) |
360 | + | ||
319 | }, | 361 | }, |
320 | //选择时间 | 362 | //选择时间 |
321 | bindTimeChange(e) { | 363 | bindTimeChange(e) { |
@@ -24,6 +24,17 @@ | @@ -24,6 +24,17 @@ | ||
24 | 24 | ||
25 | <view class="set-box"> | 25 | <view class="set-box"> |
26 | <view class="min-num num-box"> | 26 | <view class="min-num num-box"> |
27 | + <text class="title type-title">地区</text> | ||
28 | + <picker bindchange="bindCityChange" value="{{current_city}}" range="{{city_picker_list}}" class="picker"> | ||
29 | + <view class="input"> | ||
30 | + <text class="variety-text">{{is_select?city_picker_list[current_city]:city}}</text> | ||
31 | + </view> | ||
32 | + </picker> | ||
33 | + <text class="iconfont icon-xiangxia min-icon"></text> | ||
34 | + <input type="text" bindinput="inputKey" class="input search-box" bindconfirm="search"/> | ||
35 | + <text bindtap="search">搜索</text><text class="tips">* 可搜索地区</text> | ||
36 | + </view> | ||
37 | + <view class="min-num num-box"> | ||
27 | <text class="title">最低人数</text> | 38 | <text class="title">最低人数</text> |
28 | <input type="number" bindinput="inputMinNum" class="input"/> | 39 | <input type="number" bindinput="inputMinNum" class="input"/> |
29 | <text class="iconfont icon-xiangxia min-icon icon-min"></text> | 40 | <text class="iconfont icon-xiangxia min-icon icon-min"></text> |
@@ -47,15 +58,6 @@ | @@ -47,15 +58,6 @@ | ||
47 | </picker> | 58 | </picker> |
48 | <text class="iconfont icon-xiangxia min-icon"></text> | 59 | <text class="iconfont icon-xiangxia min-icon"></text> |
49 | </view> | 60 | </view> |
50 | - <view class="min-num"> | ||
51 | - <text class="title type-title">城市</text> | ||
52 | - <picker bindchange="bindCityChange" value="{{current_city}}" range="{{city_picker_list}}" class="picker"> | ||
53 | - <view class="input"> | ||
54 | - <text class="variety-text">{{city_picker_list[current_city]}}</text> | ||
55 | - </view> | ||
56 | - </picker> | ||
57 | - <text class="iconfont icon-xiangxia min-icon"></text> | ||
58 | - </view> | ||
59 | <view class="time-box"> | 61 | <view class="time-box"> |
60 | <text class="time-title">时间</text> | 62 | <text class="time-title">时间</text> |
61 | <picker mode='date' bindchange="bindDateChange" value='{{date}}' start="{{start_date}}" | 63 | <picker mode='date' bindchange="bindDateChange" value='{{date}}' start="{{start_date}}" |
@@ -93,12 +95,14 @@ | @@ -93,12 +95,14 @@ | ||
93 | <text class="address-title">地点</text> | 95 | <text class="address-title">地点</text> |
94 | <input type="text" bindinput="inputAddress" class="input"/> | 96 | <input type="text" bindinput="inputAddress" class="input"/> |
95 | </view> | 97 | </view> |
96 | - <view class="address-box"> | ||
97 | - <text class="address-title">地址</text> | ||
98 | - <input type="text" value="" class="input" bindinput="inputAddr"/> | 98 | + <!--<view class="address-box">--> |
99 | + <!--手动填地址--> | ||
100 | + <!--<text class="address-title">地址</text>--> | ||
101 | + <!--<input type="text" value="" class="input" bindinput="inputAddr"/>--> | ||
102 | + <!--打开地图选地址--> | ||
99 | <!--<text class="input">{{address_position}}</text>--> | 103 | <!--<text class="input">{{address_position}}</text>--> |
100 | <!--<text class="iconfont icon-location"></text>--> | 104 | <!--<text class="iconfont icon-location"></text>--> |
101 | - </view> | 105 | + <!--</view>--> |
102 | <view class="time-limit"> | 106 | <view class="time-limit"> |
103 | <text class="limit-title">活动前</text> | 107 | <text class="limit-title">活动前</text> |
104 | <input type="number" bindinput="inputOverTime" value="{{over_time}}"/> | 108 | <input type="number" bindinput="inputOverTime" value="{{over_time}}"/> |
@@ -116,7 +116,7 @@ | @@ -116,7 +116,7 @@ | ||
116 | .min-num .min-icon { | 116 | .min-num .min-icon { |
117 | font-size: 24rpx; | 117 | font-size: 24rpx; |
118 | position: absolute; | 118 | position: absolute; |
119 | - right:86rpx; | 119 | + left:245rpx; |
120 | top:50%; | 120 | top:50%; |
121 | transform: translate(0,-50%); | 121 | transform: translate(0,-50%); |
122 | } | 122 | } |
@@ -133,6 +133,10 @@ | @@ -133,6 +133,10 @@ | ||
133 | color: #999999; | 133 | color: #999999; |
134 | margin-left: 10rpx; | 134 | margin-left: 10rpx; |
135 | } | 135 | } |
136 | +.search-box { | ||
137 | + margin-left: 18rpx; | ||
138 | + margin-right: 18rpx; | ||
139 | +} | ||
136 | .time-box, .address-box { | 140 | .time-box, .address-box { |
137 | display: flex; | 141 | display: flex; |
138 | align-items: center; | 142 | align-items: center; |
@@ -95,14 +95,15 @@ | @@ -95,14 +95,15 @@ | ||
95 | 95 | ||
96 | <!--详细时间--> | 96 | <!--详细时间--> |
97 | <view class="detail-box"> | 97 | <view class="detail-box"> |
98 | + <text>地区:{{detail.choose_addr}}</text> | ||
98 | <text>类别:{{detail.selectName}}</text> | 99 | <text>类别:{{detail.selectName}}</text> |
99 | <text>时间:{{end_time}}</text> | 100 | <text>时间:{{end_time}}</text> |
100 | <text>地点:{{detail.name}}</text> | 101 | <text>地点:{{detail.name}}</text> |
101 | <!--<view class="position" bindtap="getNavigate">--> | 102 | <!--<view class="position" bindtap="getNavigate">--> |
102 | - <view class="position" wx:if="{{detail.address !== ''}}"> | ||
103 | - <text class="address">地址:{{detail.address}}</text> | 103 | + <!--<view class="position" wx:if="{{detail.address !== ''}}">--> |
104 | + <!--<text class="address">地址:{{detail.address}}</text>--> | ||
104 | <!--<text class="iconfont icon-location"></text>--> | 105 | <!--<text class="iconfont icon-location"></text>--> |
105 | - </view> | 106 | + <!--</view>--> |
106 | </view> | 107 | </view> |
107 | 108 | ||
108 | <!--已加入人员--> | 109 | <!--已加入人员--> |
@@ -41,7 +41,7 @@ Page({ | @@ -41,7 +41,7 @@ Page({ | ||
41 | const arr = []; | 41 | const arr = []; |
42 | res.data.forEach((item)=> { | 42 | res.data.forEach((item)=> { |
43 | arr.push(item.title) | 43 | arr.push(item.title) |
44 | - }) | 44 | + }); |
45 | self.setData({ | 45 | self.setData({ |
46 | city_picker_list: arr, | 46 | city_picker_list: arr, |
47 | cityList:res.data, | 47 | cityList:res.data, |
@@ -5,8 +5,8 @@ | @@ -5,8 +5,8 @@ | ||
5 | <view class="tab_item {{current==1?'active':''}}" data-current='{{1}}' bindtap='chargeTab'>境外/港澳台</view> | 5 | <view class="tab_item {{current==1?'active':''}}" data-current='{{1}}' bindtap='chargeTab'>境外/港澳台</view> |
6 | </view> | 6 | </view> |
7 | <view class="right" wx:if="{{current===1}}"> | 7 | <view class="right" wx:if="{{current===1}}"> |
8 | - <input class="input" type="text" placeholder="搜索国家" bindinput="inputKey" bindfocus="inputFocus" value="{{searchValue}}" bindconfirm="startSearch" /> | ||
9 | - <text class="search-btn">搜索</text> | 8 | + <input class="input" type="text" placeholder="搜索地区" bindinput="inputKey" bindfocus="inputFocus" value="{{searchValue}}" bindconfirm="startSearch" /> |
9 | + <text class="search-btn" bindtap="startSearch">搜索</text> | ||
10 | <!--<image src="../../../images/search@2x.png" class="search-icon" bindtap="startSearch"></image>--> | 10 | <!--<image src="../../../images/search@2x.png" class="search-icon" bindtap="startSearch"></image>--> |
11 | <!--<view class="iconfont icon-arrow-down"></view>--> | 11 | <!--<view class="iconfont icon-arrow-down"></view>--> |
12 | </view> | 12 | </view> |
@@ -235,7 +235,7 @@ Page({ | @@ -235,7 +235,7 @@ Page({ | ||
235 | "token": wx.getStorageSync('token') | 235 | "token": wx.getStorageSync('token') |
236 | }; | 236 | }; |
237 | app.post(url, params, {}).then((res) => { | 237 | app.post(url, params, {}).then((res) => { |
238 | - // console.log('获取详情', res); | 238 | + console.log('获取详情', res); |
239 | if (+res.code === 1) { | 239 | if (+res.code === 1) { |
240 | self.setData({ | 240 | self.setData({ |
241 | detail: res.data.active, | 241 | detail: res.data.active, |
@@ -91,13 +91,14 @@ | @@ -91,13 +91,14 @@ | ||
91 | 91 | ||
92 | <!--详细时间--> | 92 | <!--详细时间--> |
93 | <view class="detail-box"> | 93 | <view class="detail-box"> |
94 | + <text>地区:{{detail.choose_addr}}</text> | ||
94 | <text>时间:{{end_time}}</text> | 95 | <text>时间:{{end_time}}</text> |
95 | <text>餐厅:{{detail.name}}</text><!--餐厅--> | 96 | <text>餐厅:{{detail.name}}</text><!--餐厅--> |
96 | <!--<view class="position" bindtap="getNavigate">--> | 97 | <!--<view class="position" bindtap="getNavigate">--> |
97 | - <view class="position" wx:if="{{detail.address !== ''}}"> | ||
98 | - <text class="address">地址:{{detail.address}}</text> | 98 | + <!--<view class="position" wx:if="{{detail.address !== ''}}">--> |
99 | + <!--<text class="address">地址:{{detail.address}}</text>--> | ||
99 | <!--<text class="iconfont icon-location"></text>--> | 100 | <!--<text class="iconfont icon-location"></text>--> |
100 | - </view> | 101 | + <!--</view>--> |
101 | <text>菜系:{{detail.selectName}}</text> | 102 | <text>菜系:{{detail.selectName}}</text> |
102 | </view> | 103 | </view> |
103 | 104 |
@@ -23,6 +23,7 @@ Page({ | @@ -23,6 +23,7 @@ Page({ | ||
23 | address_position:'', | 23 | address_position:'', |
24 | over_time:'', | 24 | over_time:'', |
25 | is_showRelease_modal:false, | 25 | is_showRelease_modal:false, |
26 | + is_select:false, | ||
26 | }, | 27 | }, |
27 | //查看我的发布 | 28 | //查看我的发布 |
28 | goMyRelease() { | 29 | goMyRelease() { |
@@ -68,6 +69,39 @@ Page({ | @@ -68,6 +69,39 @@ Page({ | ||
68 | inputAddr(e) { | 69 | inputAddr(e) { |
69 | this.setData({address1:e.detail.value}) | 70 | this.setData({address1:e.detail.value}) |
70 | }, | 71 | }, |
72 | + //输入搜索内容 | ||
73 | + inputKey(e){ | ||
74 | + this.setData({search_text:e.detail.value}) | ||
75 | + }, | ||
76 | + //点击搜索 | ||
77 | + search() { | ||
78 | + let self = this; | ||
79 | + let url = '/portal/Send/select'; | ||
80 | + let header = { | ||
81 | + "XX-Token": wx.getStorageSync('token') | ||
82 | + }; | ||
83 | + let params = { | ||
84 | + // token: wx.getStorageSync('token'), | ||
85 | + keyword:self.data.search_text, | ||
86 | + }; | ||
87 | + self.setData({is_select:false}); | ||
88 | + app.post(url, params, header).then((res) => { | ||
89 | + console.log('搜索结果', res); | ||
90 | + // wx.hideLoading(); | ||
91 | + if(+res.code === 1) { | ||
92 | + self.setData({search_text:'',}); | ||
93 | + if(res.data.addr.length === 0) { | ||
94 | + wx.showToast({title:'暂无此地区',icon:'none'}); | ||
95 | + }else { | ||
96 | + self.setData({ | ||
97 | + city:res.data.addr[0].title, | ||
98 | + city_id:res.data.addr[0].id, | ||
99 | + }); | ||
100 | + } | ||
101 | + } | ||
102 | + | ||
103 | + }) | ||
104 | + }, | ||
71 | //获取地址 | 105 | //获取地址 |
72 | // choosePosition() { | 106 | // choosePosition() { |
73 | // //选择当前地址,经纬度 | 107 | // //选择当前地址,经纬度 |
@@ -111,7 +145,11 @@ Page({ | @@ -111,7 +145,11 @@ Page({ | ||
111 | }, | 145 | }, |
112 | //确定发布 | 146 | //确定发布 |
113 | confirmRelease(e) { | 147 | confirmRelease(e) { |
114 | - // else if(this.data.address_position === '') { | 148 | + var current_city = this.data.current_city; |
149 | + var city_list = this.data.city_list; | ||
150 | + var city = this.data.city; | ||
151 | + var is_select = this.data.is_select;//是否是通过下拉框选择城市 | ||
152 | + // else if(this.data.address_position === '') { | ||
115 | // wx.showToast({title:'请定位地址',icon:'none'}) | 153 | // wx.showToast({title:'请定位地址',icon:'none'}) |
116 | // } | 154 | // } |
117 | if(this.data.title === '') { | 155 | if(this.data.title === '') { |
@@ -126,8 +164,8 @@ Page({ | @@ -126,8 +164,8 @@ Page({ | ||
126 | wx.showToast({title:'请填写最高人数',icon:'none'}) | 164 | wx.showToast({title:'请填写最高人数',icon:'none'}) |
127 | }else if(this.data.current_type === undefined) { | 165 | }else if(this.data.current_type === undefined) { |
128 | wx.showToast({title:'请选择类别',icon:'none'}) | 166 | wx.showToast({title:'请选择类别',icon:'none'}) |
129 | - }else if(this.data.current_city === undefined) { | ||
130 | - wx.showToast({title:'请选择城市',icon:'none'}) | 167 | + }else if(current_city === undefined && city === undefined) { |
168 | + wx.showToast({title:'请选择地区',icon:'none'}) | ||
131 | }else if(this.data.date === '') { | 169 | }else if(this.data.date === '') { |
132 | wx.showToast({title:'请选择日期',icon:'none'}) | 170 | wx.showToast({title:'请选择日期',icon:'none'}) |
133 | }else if(this.data.time === '') { | 171 | }else if(this.data.time === '') { |
@@ -159,13 +197,14 @@ Page({ | @@ -159,13 +197,14 @@ Page({ | ||
159 | max_number:this.data.max_num, | 197 | max_number:this.data.max_num, |
160 | select_id: this.data.type_id,//类别 | 198 | select_id: this.data.type_id,//类别 |
161 | time: this.data.date + ' ' + this.data.time, | 199 | time: this.data.date + ' ' + this.data.time, |
162 | - name: this.data.address, | ||
163 | - address: this.data.address_position, | 200 | + name: this.data.address,//餐厅 |
201 | + // address: this.data.address_position, | ||
202 | + address: this.data.address1, | ||
164 | latng: '', | 203 | latng: '', |
165 | over_time:this.data.over_time,// 报名截止时间 | 204 | over_time:this.data.over_time,// 报名截止时间 |
166 | formId: e.detail.formId, | 205 | formId: e.detail.formId, |
167 | - choose_addr: this.data.city_list[this.data.current_city].title, | ||
168 | - choose_addr_id:this.data.city_list[this.data.current_city].id, | 206 | + choose_addr: is_select?city_list[current_city].title:city, |
207 | + choose_addr_id:is_select?city_list[current_city].id:this.data.city_id, | ||
169 | }; | 208 | }; |
170 | var list = []; | 209 | var list = []; |
171 | app.post(url, params, {}).then((res) => { | 210 | app.post(url, params, {}).then((res) => { |
@@ -289,7 +328,7 @@ Page({ | @@ -289,7 +328,7 @@ Page({ | ||
289 | }, | 328 | }, |
290 | //选择城市 | 329 | //选择城市 |
291 | bindCityChange(e) { | 330 | bindCityChange(e) { |
292 | - this.setData({current_city: +e.detail.value}) | 331 | + this.setData({current_city: +e.detail.value,is_select:true}); |
293 | }, | 332 | }, |
294 | //选择时间 | 333 | //选择时间 |
295 | bindTimeChange(e) { | 334 | bindTimeChange(e) { |
@@ -30,6 +30,17 @@ | @@ -30,6 +30,17 @@ | ||
30 | <!--<text class="tips">注:最低拼单人数</text>--> | 30 | <!--<text class="tips">注:最低拼单人数</text>--> |
31 | <!--</view>--> | 31 | <!--</view>--> |
32 | <view class="min-num num-box"> | 32 | <view class="min-num num-box"> |
33 | + <text class="title type-title">地区</text> | ||
34 | + <picker bindchange="bindCityChange" value="{{current_city}}" range="{{city_picker_list}}" class="picker"> | ||
35 | + <view class="input"> | ||
36 | + <text class="variety-text">{{is_select?city_picker_list[current_city]:city}}</text> | ||
37 | + </view> | ||
38 | + </picker> | ||
39 | + <text class="iconfont icon-xiangxia min-icon"></text> | ||
40 | + <input type="text" bindinput="inputKey" class="input search-box" bindconfirm="search" value="{{search_text}}"/> | ||
41 | + <text bindtap="search">搜索</text><text class="tips">* 可搜索地区</text> | ||
42 | + </view> | ||
43 | + <view class="min-num num-box"> | ||
33 | <text class="title">最低人数</text> | 44 | <text class="title">最低人数</text> |
34 | <input type="number" bindinput="inputMinNum" class="input"/> | 45 | <input type="number" bindinput="inputMinNum" class="input"/> |
35 | <text class="iconfont icon-xiangxia min-icon icon-min"></text> | 46 | <text class="iconfont icon-xiangxia min-icon icon-min"></text> |
@@ -57,15 +68,6 @@ | @@ -57,15 +68,6 @@ | ||
57 | </picker> | 68 | </picker> |
58 | <text class="iconfont icon-xiangxia min-icon"></text> | 69 | <text class="iconfont icon-xiangxia min-icon"></text> |
59 | </view> | 70 | </view> |
60 | - <view class="min-num"> | ||
61 | - <text class="title type-title">城市</text> | ||
62 | - <picker bindchange="bindCityChange" value="{{current_city}}" range="{{city_picker_list}}" class="picker"> | ||
63 | - <view class="input"> | ||
64 | - <text class="variety-text">{{city_picker_list[current_city]}}</text> | ||
65 | - </view> | ||
66 | - </picker> | ||
67 | - <text class="iconfont icon-xiangxia min-icon"></text> | ||
68 | - </view> | ||
69 | <view class="time-box"> | 71 | <view class="time-box"> |
70 | <text class="time-title">时间</text> | 72 | <text class="time-title">时间</text> |
71 | <picker mode='date' bindchange="bindDateChange" value='{{date}}' end='2021-12-31' start="{{start_date}}"> | 73 | <picker mode='date' bindchange="bindDateChange" value='{{date}}' end='2021-12-31' start="{{start_date}}"> |
@@ -102,12 +104,14 @@ | @@ -102,12 +104,14 @@ | ||
102 | <text class="address-title">餐厅</text> | 104 | <text class="address-title">餐厅</text> |
103 | <input type="text" bindinput="inputAddress" class="input"/> | 105 | <input type="text" bindinput="inputAddress" class="input"/> |
104 | </view> | 106 | </view> |
105 | - <view class="address-box"> | ||
106 | - <text class="address-title">地址</text> | ||
107 | - <input type="text" value="" class="input" bindinput="inputAddr"/> | ||
108 | - <!--<text class="input">{{address_position}}</text>--> | 107 | + <!--<view class="address-box">--> |
108 | + <!--手动填地址--> | ||
109 | + <!--<text class="address-title">地址</text>--> | ||
110 | + <!--<input type="text" value="" class="input" bindinput="inputAddr"/>--> | ||
111 | + <!--打开地图选地址--> | ||
112 | + <!--<text class="input">{{address_position}}</text>--> | ||
109 | <!--<text class="iconfont icon-location"></text>--> | 113 | <!--<text class="iconfont icon-location"></text>--> |
110 | - </view> | 114 | + <!--</view>--> |
111 | <view class="time-limit"> | 115 | <view class="time-limit"> |
112 | <text class="limit-title">开餐前</text> | 116 | <text class="limit-title">开餐前</text> |
113 | <input type="number" bindinput="inputOverTime" value="{{over_time}}"/> | 117 | <input type="number" bindinput="inputOverTime" value="{{over_time}}"/> |
@@ -32,25 +32,28 @@ Page({ | @@ -32,25 +32,28 @@ Page({ | ||
32 | inputPhone(e) { | 32 | inputPhone(e) { |
33 | this.setData({ | 33 | this.setData({ |
34 | phone_number: e.detail.value, | 34 | phone_number: e.detail.value, |
35 | - is_choose_phone:true | 35 | + // is_choose_phone:true, |
36 | }); | 36 | }); |
37 | - if(this.data.phone_number.length>=11) { | ||
38 | - if(!(/^1[0-9]{10}$/.test(this.data.phone_number))){ | ||
39 | - wx.showToast({title:'手机号格式错误',icon:'none'}); | ||
40 | - this.setData({is_wrong_phone:true,phone_number_params:''}); | ||
41 | - // console.log('params', this.data.phone_number_params); | ||
42 | - }else { | ||
43 | - this.setData({ | ||
44 | - phone_number_params: this.data.phone_number, | ||
45 | - 'user.tel':this.data.phone_number, | ||
46 | - is_wrong_phone:false, | ||
47 | - }); | ||
48 | - // console.log('params', this.data.phone_number_params); | ||
49 | - } | ||
50 | - } | 37 | + console.log('phone_number', this.data.phone_number); |
38 | + // if(this.data.phone_number.length>=11) { | ||
39 | + // if(!(/^1[0-9]{10}$/.test(this.data.phone_number))){ | ||
40 | + // wx.showToast({title:'手机号格式错误',icon:'none'}); | ||
41 | + // this.setData({is_wrong_phone:true,phone_number_params:''}); | ||
42 | + // // console.log('params', this.data.phone_number_params); | ||
43 | + // }else { | ||
44 | + // this.setData({ | ||
45 | + // phone_number_params: this.data.phone_number, | ||
46 | + // 'user.tel':this.data.phone_number, | ||
47 | + // is_wrong_phone:false, | ||
48 | + // }); | ||
49 | + // // console.log('params', this.data.phone_number_params); | ||
50 | + // } | ||
51 | + // } | ||
51 | if(e.detail.value === '') { | 52 | if(e.detail.value === '') { |
52 | // console.log('手机号为空',this.data.is_wrong_phone,this.data.phone_number_params,this.data.is_choose_phone); | 53 | // console.log('手机号为空',this.data.is_wrong_phone,this.data.phone_number_params,this.data.is_choose_phone); |
53 | this.setData({is_change:false});//按钮置灰 | 54 | this.setData({is_change:false});//按钮置灰 |
55 | + }else { | ||
56 | + this.setData({is_change:true}); | ||
54 | } | 57 | } |
55 | if((this.data.is_choose_phone&&this.data.phone_number_params !== '') && | 58 | if((this.data.is_choose_phone&&this.data.phone_number_params !== '') && |
56 | this.data.user.country !== null && | 59 | this.data.user.country !== null && |
@@ -64,11 +67,11 @@ Page({ | @@ -64,11 +67,11 @@ Page({ | ||
64 | //失去焦点 | 67 | //失去焦点 |
65 | blur() { | 68 | blur() { |
66 | // if(this.data.phone_number.length>=11) { | 69 | // if(this.data.phone_number.length>=11) { |
67 | - if(!(/^1[0-9]{10}$/.test(this.data.phone_number))){ | ||
68 | - wx.showToast({title:'手机号格式错误',icon:'none'}); | ||
69 | - this.setData({is_wrong_phone:true,phone_number_params:''}); | ||
70 | - // console.log('params', this.data.phone_number_params); | ||
71 | - } | 70 | + // if(!(/^1[0-9]{10}$/.test(this.data.phone_number))){ |
71 | + // wx.showToast({title:'手机号格式错误',icon:'none'}); | ||
72 | + // this.setData({is_wrong_phone:true,phone_number_params:''}); | ||
73 | + // // console.log('params', this.data.phone_number_params); | ||
74 | + // } | ||
72 | // } | 75 | // } |
73 | }, | 76 | }, |
74 | //自动获取手机号 | 77 | //自动获取手机号 |
@@ -187,6 +190,10 @@ Page({ | @@ -187,6 +190,10 @@ Page({ | ||
187 | }, | 190 | }, |
188 | //保存 | 191 | //保存 |
189 | submit() { | 192 | submit() { |
193 | + console.log('phone_number',this.data.phone_number); | ||
194 | + // else if(this.data.is_wrong_phone){ | ||
195 | + // wx.showToast({title:'手机号格式错误',icon:'none'}) | ||
196 | + // } | ||
190 | // console.log('this.data.phone_number.length', this.data.phone_number.length,this.data.is_sex_change); | 197 | // console.log('this.data.phone_number.length', this.data.phone_number.length,this.data.is_sex_change); |
191 | if(this.data.userInfo.gender == '未知' && this.data.is_sex_change === undefined) { | 198 | if(this.data.userInfo.gender == '未知' && this.data.is_sex_change === undefined) { |
192 | wx.showToast({title:'请选择性别',icon:'none'}) | 199 | wx.showToast({title:'请选择性别',icon:'none'}) |
@@ -196,14 +203,16 @@ Page({ | @@ -196,14 +203,16 @@ Page({ | ||
196 | wx.showToast({title:'请填写城市',icon:'none'}) | 203 | wx.showToast({title:'请填写城市',icon:'none'}) |
197 | }else if (this.data.user.tel === null && this.data.phone_number === '') { | 204 | }else if (this.data.user.tel === null && this.data.phone_number === '') { |
198 | wx.showToast({title:'请获取手机号',icon:'none'}) | 205 | wx.showToast({title:'请获取手机号',icon:'none'}) |
199 | - }else if(this.data.is_wrong_phone){ | ||
200 | - wx.showToast({title:'手机号格式错误',icon:'none'}) | ||
201 | }else if(this.data.wx_num === '' && this.data.user.wx === null) { | 206 | }else if(this.data.wx_num === '' && this.data.user.wx === null) { |
202 | wx.showToast({title:'请填写微信号',icon:'none'}) | 207 | wx.showToast({title:'请填写微信号',icon:'none'}) |
203 | }else if(this.data.introduce === '' && this.data.user.introduce === null) { | 208 | }else if(this.data.introduce === '' && this.data.user.introduce === null) { |
204 | wx.showToast({title:'请填写简介',icon:'none'}) | 209 | wx.showToast({title:'请填写简介',icon:'none'}) |
205 | }else { | 210 | }else { |
206 | - const choose_sex = this.data.is_sex_change&&this.data.sexList[this.data.current_sex] === '男'?1:2; | 211 | + var choose_sex = null; |
212 | + if(this.data.is_sex_change&&this.data.sexList[this.data.current_sex] === '男') { | ||
213 | + choose_sex = 1 | ||
214 | + } | ||
215 | + // console.log('choose_sex', choose_sex); | ||
207 | let url = '/portal/Member/detail'; | 216 | let url = '/portal/Member/detail'; |
208 | let sex = this.data.userInfo.gender; | 217 | let sex = this.data.userInfo.gender; |
209 | let params = { | 218 | let params = { |
@@ -212,7 +221,7 @@ Page({ | @@ -212,7 +221,7 @@ Page({ | ||
212 | country:this.data.is_choose_country?this.data.country:this.data.user.country, | 221 | country:this.data.is_choose_country?this.data.country:this.data.user.country, |
213 | city:this.data.is_choose_city?this.data.city:this.data.user.city, | 222 | city:this.data.is_choose_city?this.data.city:this.data.user.city, |
214 | // tel:(this.data.is_choose_phone&&this.data.phone_number !== '')?this.data.phone_number:this.data.user.tel, | 223 | // tel:(this.data.is_choose_phone&&this.data.phone_number !== '')?this.data.phone_number:this.data.user.tel, |
215 | - tel:this.data.user.tel, | 224 | + tel:this.data.user.tel === null?this.data.phone_number:this.data.phone_number!==''?this.data.phone_number:this.data.user.tel, |
216 | wx: this.data.is_choose_wx?this.data.wx_num:this.data.user.wx, | 225 | wx: this.data.is_choose_wx?this.data.wx_num:this.data.user.wx, |
217 | introduce:this.data.is_choose_introduce?this.data.introduce:this.data.user.introduce | 226 | introduce:this.data.is_choose_introduce?this.data.introduce:this.data.user.introduce |
218 | }; | 227 | }; |
@@ -259,6 +268,7 @@ Page({ | @@ -259,6 +268,7 @@ Page({ | ||
259 | * 生命周期函数--监听页面加载 | 268 | * 生命周期函数--监听页面加载 |
260 | */ | 269 | */ |
261 | onLoad: function (options) { | 270 | onLoad: function (options) { |
271 | + console.log(app.globalData.userInfo); | ||
262 | this.setData({userInfo:app.globalData.userInfo}); | 272 | this.setData({userInfo:app.globalData.userInfo}); |
263 | if(this.data.userInfo.tel !== null) { | 273 | if(this.data.userInfo.tel !== null) { |
264 | this.setData({is_wrong_phone:false}) | 274 | this.setData({is_wrong_phone:false}) |
@@ -29,7 +29,8 @@ | @@ -29,7 +29,8 @@ | ||
29 | <view class="title">手机号:</view> | 29 | <view class="title">手机号:</view> |
30 | <view class="phone-box"> | 30 | <view class="phone-box"> |
31 | <!--<text>{{user.tel!==null?user.tel:''}}</text>--> | 31 | <!--<text>{{user.tel!==null?user.tel:''}}</text>--> |
32 | - <input type="number" bindinput="inputPhone" bindblur="blur" value="{{user.tel!==null?user.tel:is_choose_phone&&!is_wrong_phone?phone_number:''}}"/> | 32 | + <!--value="{{user.tel!==null?user.tel:is_choose_phone&&!is_wrong_phone?phone_number:''}}"--> |
33 | + <input type="number" bindinput="inputPhone" bindblur="blur" value="{{user.tel}}"/> | ||
33 | <button open-type="getPhoneNumber" bindgetphonenumber="getPhoneNumber" class="phone-btn">自动填写</button> | 34 | <button open-type="getPhoneNumber" bindgetphonenumber="getPhoneNumber" class="phone-btn">自动填写</button> |
34 | </view> | 35 | </view> |
35 | </view> | 36 | </view> |
@@ -6,7 +6,8 @@ | @@ -6,7 +6,8 @@ | ||
6 | <!-- // (0全部,2待拼成,3人数不足未拼成,4已拼成,5已取消,6已完成,7已评价,8已拼成(活动未结束),9删除--> | 6 | <!-- // (0全部,2待拼成,3人数不足未拼成,4已拼成,5已取消,6已完成,7已评价,8已拼成(活动未结束),9删除--> |
7 | <view class="state1"> | 7 | <view class="state1"> |
8 | <view class="circle change"></view> | 8 | <view class="circle change"></view> |
9 | - <text>已拍下</text> | 9 | + <text wx:if="{{order_detail.sonType === 1}}">已发布</text> |
10 | + <text wx:if="{{order_detail.sonType === 2}}">已加入</text> | ||
10 | </view> | 11 | </view> |
11 | <view class="state2"> | 12 | <view class="state2"> |
12 | <!--{{detail.status === 4 ||detail.status === 5 || detail.status === 6||detail.status === 8?'change':''}}--> | 13 | <!--{{detail.status === 4 ||detail.status === 5 || detail.status === 6||detail.status === 8?'change':''}}--> |
-
请 注册 或 登录 后发表评论