切换导航条
此项目
正在载入...
登录
miniprogram
/
match-west-road
·
提交
转到一个项目
GitLab
转到群组
项目
活动
文件
提交
管道
0
构建
0
图表
里程碑
问题
0
合并请求
0
成员
标记
维基
派生
网络
创建新的问题
下载为
邮件补丁
差异文件
浏览文件
作者
wumengyu
6 years ago
提交
697f95471740dd4ab08d7241072696c8df9a6f9a
1 个父辈
b102c18e
去掉发布定位,改为手动输入地址(非必填),添加城市下拉列表
隐藏空白字符变更
内嵌
并排对比
正在显示
8 个修改的文件
包含
132 行增加
和
78 行删除
pages/activity/activity.js
pages/activity/activity.wxml
pages/activity/detail/detail.js
pages/activity/detail/detail.wxml
pages/meal/detail/detail.js
pages/meal/detail/detail.wxml
pages/meal/meal.js
pages/meal/meal.wxml
pages/activity/activity.js
查看文件 @
697f954
...
...
@@ -18,6 +18,7 @@ Page({
date
:
''
,
time
:
''
,
address
:
''
,
address1
:
''
,
address_position
:
''
,
over_time
:
''
,
is_showRelease_modal
:
false
,
...
...
@@ -65,30 +66,34 @@ Page({
inputAddress
(
e
)
{
this
.
setData
({
address
:
e
.
detail
.
value
})
},
//获取地址
choosePosition
()
{
//选择当前地址,经纬度
const
self
=
this
;
wx
.
chooseLocation
({
success
(
res
)
{
// console.log(res);
self
.
setData
({
address_position
:
res
.
address
!==
''
?
res
.
address
:
res
.
name
,
latng
:
res
.
latitude
+
','
+
res
.
longitude
})
},
})
//打开地图导航
// wx.getLocation({ //获取当前经纬度
// type: 'wgs84', //返回可以用于wx.openLocation的经纬度,官方提示bug: iOS 6.3.30 type 参数不生效,只会返回 wgs84 类型的坐标信息
// success: function (res) {
// console.log('获取当前经纬度', res);
// wx.openLocation({//使用微信内置地图查看位置。
// latitude: res.latitude,//要去的纬度-地址
// longitude: res.longitude,//要去的经度-地址
// name: "",
// address: ""
// })
// }
// })
//输入地址
inputAddr
(
e
)
{
this
.
setData
({
address1
:
e
.
detail
.
value
})
},
//获取地址
// choosePosition() {
// //选择当前地址,经纬度
// const self = this;
// wx.chooseLocation({
// success(res) {
// // console.log(res);
// self.setData({address_position: res.address !== ''?res.address:res.name,latng:res.latitude + ',' + res.longitude})
// },
// })
// //打开地图导航
// // wx.getLocation({ //获取当前经纬度
// // type: 'wgs84', //返回可以用于wx.openLocation的经纬度,官方提示bug: iOS 6.3.30 type 参数不生效,只会返回 wgs84 类型的坐标信息
// // success: function (res) {
// // console.log('获取当前经纬度', res);
// // wx.openLocation({//使用微信内置地图查看位置。
// // latitude: res.latitude,//要去的纬度-地址
// // longitude: res.longitude,//要去的经度-地址
// // name: "",
// // address: ""
// // })
// // }
// // })
// },
//输入截止时间
inputOverTime
(
e
)
{
this
.
setData
({
over_time
:
e
.
detail
.
value
});
...
...
@@ -109,20 +114,28 @@ Page({
// }
// console.log(this.data.over_time.indexOf('.') !== -1);
},
//获取分类
//获取分类
、城市
getType
()
{
let
url
=
'/portal/Send/select'
;
const
list
=
[];
const
list1
=
[];
app
.
post
(
url
,
{},
{}).
then
((
res
)
=>
{
// console.log('获取分类', res);
res
.
data
.
active
.
forEach
((
item
)
=>
{
list
.
push
(
item
.
name
)
});
this
.
setData
({
type_picker_list
:
list
,
type_list
:
res
.
data
.
active
})
res
.
data
.
addr
.
forEach
((
item
)
=>
{
list1
.
push
(
item
.
title
)
});
this
.
setData
({
type_picker_list
:
list
,
type_list
:
res
.
data
.
active
,
city_picker_list
:
list1
,
city_list
:
res
.
data
.
addr
})
})
},
//确定发布
confirmRelease
(
e
)
{
// else if(this.data.address_position === '') {
// wx.showToast({title:'请定位地址',icon:'none'})
// }
// console.log('e', e,e.detail.formId,'最高人数',this.data.max_num);
if
(
this
.
data
.
title
===
''
)
{
wx
.
showToast
({
title
:
'请填写标题'
,
icon
:
'none'
})
...
...
@@ -136,14 +149,14 @@ Page({
wx
.
showToast
({
title
:
'请填写最高人数'
,
icon
:
'none'
})
}
else
if
(
this
.
data
.
current_type
===
undefined
)
{
wx
.
showToast
({
title
:
'请选择类别'
,
icon
:
'none'
})
}
else
if
(
this
.
data
.
current_city
===
undefined
)
{
wx
.
showToast
({
title
:
'请选择城市'
,
icon
:
'none'
})
}
else
if
(
this
.
data
.
date
===
''
)
{
wx
.
showToast
({
title
:
'请选择日期'
,
icon
:
'none'
})
}
else
if
(
this
.
data
.
time
===
''
)
{
wx
.
showToast
({
title
:
'请选择时间'
,
icon
:
'none'
})
}
else
if
(
this
.
data
.
address
===
''
)
{
wx
.
showToast
({
title
:
'请填写地点'
,
icon
:
'none'
})
}
else
if
(
this
.
data
.
address_position
===
''
)
{
wx
.
showToast
({
title
:
'请定位地址'
,
icon
:
'none'
})
}
else
if
(
this
.
data
.
over_time
===
''
)
{
wx
.
showToast
({
title
:
'请填写截止时间'
,
icon
:
'none'
})
}
else
{
...
...
@@ -170,9 +183,11 @@ Page({
time
:
this
.
data
.
date
+
' '
+
this
.
data
.
time
,
addr
:
this
.
data
.
address
,
address
:
this
.
data
.
address_position
,
latng
:
this
.
data
.
latng
,
latng
:
''
,
over_time
:
this
.
data
.
over_time
,
// 报名截止时间
formId
:
e
.
detail
.
formId
,
choose_addr
:
this
.
data
.
city_list
[
this
.
data
.
current_city
].
title
,
choose_addr_id
:
this
.
data
.
city_list
[
this
.
data
.
current_city
].
id
,
};
app
.
post
(
url
,
params
,
{}).
then
((
res
)
=>
{
console
.
log
(
'确定发布'
,
res
);
...
...
@@ -298,6 +313,10 @@ Page({
bindTypeChange
(
e
)
{
this
.
setData
({
current_type
:
+
e
.
detail
.
value
})
},
//选择城市
bindCityChange
(
e
)
{
this
.
setData
({
current_city
:
+
e
.
detail
.
value
})
},
//选择时间
bindTimeChange
(
e
)
{
this
.
setData
({
time
:
e
.
detail
.
value
,
hour
:
e
.
detail
.
value
.
split
(
':'
)[
0
],
minute
:
e
.
detail
.
value
.
split
(
':'
)[
1
]})
...
...
pages/activity/activity.wxml
查看文件 @
697f954
...
...
@@ -47,6 +47,15 @@
</picker>
<text class="iconfont icon-xiangxia min-icon"></text>
</view>
<view class="min-num">
<text class="title type-title">城市</text>
<picker bindchange="bindCityChange" value="{{current_city}}" range="{{city_picker_list}}" class="picker">
<view class="input">
<text class="variety-text">{{city_picker_list[current_city]}}</text>
</view>
</picker>
<text class="iconfont icon-xiangxia min-icon"></text>
</view>
<view class="time-box">
<text class="time-title">时间</text>
<picker mode='date' bindchange="bindDateChange" value='{{date}}' start="{{start_date}}"
...
...
@@ -84,11 +93,11 @@
<text class="address-title">地点</text>
<input type="text" bindinput="inputAddress" class="input"/>
</view>
<view class="address-box"
bindtap="choosePosition"
>
<view class="address-box">
<text class="address-title">地址</text>
<text class="input">{{address_position}}</text>
<!--<input type="text" bindinput="inputPosition" value="" class="input"/>-->
<text class="iconfont icon-location"></text>
<input type="text" value="" class="input" bindinput="inputAddr"/>
<!--<text class="input">{{address_position}}</text>-->
<!--<text class="iconfont icon-location"></text>-->
</view>
<view class="time-limit">
<text class="limit-title">活动前</text>
...
...
pages/activity/detail/detail.js
查看文件 @
697f954
...
...
@@ -236,7 +236,7 @@ Page({
"token"
:
wx
.
getStorageSync
(
'token'
)
};
app
.
post
(
url
,
params
,
{}).
then
((
res
)
=>
{
//
console.log('获取详情', res, app.initTime(res.data.active.surplus));
console
.
log
(
'获取详情'
,
res
,
app
.
initTime
(
res
.
data
.
active
.
surplus
));
if
(
+
res
.
code
===
1
)
{
self
.
setData
({
detail
:
res
.
data
.
active
,
...
...
pages/activity/detail/detail.wxml
查看文件 @
697f954
...
...
@@ -98,9 +98,10 @@
<text>类别:{{detail.selectName}}</text>
<text>时间:{{end_time}}</text>
<text>地点:{{detail.name}}</text>
<view class="position" bindtap="getNavigate">
<!--<view class="position" bindtap="getNavigate">-->
<view class="position" wx:if="{{detail.address !== ''}}">
<text class="address">地址:{{detail.address}}</text>
<
text class="iconfont icon-location"></text
>
<
!--<text class="iconfont icon-location"></text>--
>
</view>
</view>
...
...
pages/meal/detail/detail.js
查看文件 @
697f954
...
...
@@ -235,7 +235,7 @@ Page({
"token"
:
wx
.
getStorageSync
(
'token'
)
};
app
.
post
(
url
,
params
,
{}).
then
((
res
)
=>
{
//
console.log('获取详情', res);
console
.
log
(
'获取详情'
,
res
);
if
(
+
res
.
code
===
1
)
{
self
.
setData
({
detail
:
res
.
data
.
active
,
...
...
pages/meal/detail/detail.wxml
查看文件 @
697f954
...
...
@@ -86,9 +86,6 @@
</view>
<view class="area-content">
<text>{{detail.content}}</text>
<!--云峰山风景区坐落于密云水库北不老屯镇,燕落村北三公里,处于-->
<!--密云区东西两大风景区之间,东靠密云古北口 ──司马台长城──-->
<!--雾灵山风景区。-->
</view>
</view>
...
...
@@ -96,13 +93,12 @@
<view class="detail-box">
<text>时间:{{end_time}}</text>
<text>餐厅:{{detail.name}}</text><!--餐厅-->
<view class="position" bindtap="getNavigate">
<text class="address">地址:{{detail.address}}</text><!--地址:-->
<!--侨福芳草地B2 OPERA BOMBANA-->
<text class="iconfont icon-location"></text>
<!--<view class="position" bindtap="getNavigate">-->
<view class="position" wx:if="{{detail.address !== ''}}">
<text class="address">地址:{{detail.address}}</text>
<!--<text class="iconfont icon-location"></text>-->
</view>
<text>菜系:{{detail.selectName}}</text>
<!--意大利菜-->
</view>
<!--已加入人员-->
...
...
pages/meal/meal.js
查看文件 @
697f954
...
...
@@ -9,6 +9,7 @@ Page({
images
:
[],
images_params
:[],
type_picker_list
:[],
city_picker_list
:[],
start_date
:
app
.
nowDate
(),
start_time
:
''
,
title
:
''
,
...
...
@@ -18,6 +19,7 @@ Page({
date
:
''
,
time
:
''
,
address
:
''
,
address1
:
''
,
address_position
:
''
,
over_time
:
''
,
is_showRelease_modal
:
false
,
...
...
@@ -58,48 +60,60 @@ Page({
this
.
setData
({
max_num
:
''
});
}
},
//输入
地点
//输入
餐厅
inputAddress
(
e
)
{
this
.
setData
({
address
:
e
.
detail
.
value
})
},
//获取地址
choosePosition
()
{
//选择当前地址,经纬度
const
self
=
this
;
wx
.
chooseLocation
({
success
(
res
)
{
console
.
log
(
res
);
self
.
setData
({
address_position
:
res
.
address
!==
''
?
res
.
address
:
res
.
name
,
latng
:
res
.
latitude
+
','
+
res
.
longitude
})
},
})
//打开地图导航
// wx.getLocation({ //获取当前经纬度
// type: 'wgs84', //返回可以用于wx.openLocation的经纬度,官方提示bug: iOS 6.3.30 type 参数不生效,只会返回 wgs84 类型的坐标信息
// success: function (res) {
// console.log('获取当前经纬度', res);
// wx.openLocation({//使用微信内置地图查看位置。
// latitude: res.latitude,//要去的纬度-地址
// longitude: res.longitude,//要去的经度-地址
// name: "",
// address: ""
// })
// }
// })
//输入地址
inputAddr
(
e
)
{
this
.
setData
({
address1
:
e
.
detail
.
value
})
},
//获取地址
// choosePosition() {
// //选择当前地址,经纬度
// const self = this;
// wx.chooseLocation({
// success(res) {
// console.log(res);
// self.setData({address_position: res.address !== ''?res.address:res.name,latng:res.latitude + ',' + res.longitude})
// },
// })
// //打开地图导航
// // wx.getLocation({ //获取当前经纬度
// // type: 'wgs84', //返回可以用于wx.openLocation的经纬度,官方提示bug: iOS 6.3.30 type 参数不生效,只会返回 wgs84 类型的坐标信息
// // success: function (res) {
// // console.log('获取当前经纬度', res);
// // wx.openLocation({//使用微信内置地图查看位置。
// // latitude: res.latitude,//要去的纬度-地址
// // longitude: res.longitude,//要去的经度-地址
// // name: "",
// // address: ""
// // })
// // }
// // })
// },
//获取分类
//获取分类、城市
getType
()
{
let
url
=
'/portal/Send/select'
;
const
list
=
[];
const
list1
=
[];
app
.
post
(
url
,
{},
{}).
then
((
res
)
=>
{
//
console.log('获取分类', res);
console
.
log
(
'获取分类'
,
res
);
res
.
data
.
meals
.
forEach
((
item
)
=>
{
list
.
push
(
item
.
name
)
});
this
.
setData
({
type_picker_list
:
list
,
type_list
:
res
.
data
.
meals
})
res
.
data
.
addr
.
forEach
((
item
)
=>
{
list1
.
push
(
item
.
title
)
});
this
.
setData
({
type_picker_list
:
list
,
type_list
:
res
.
data
.
meals
,
city_picker_list
:
list1
,
city_list
:
res
.
data
.
addr
})
})
},
//确定发布
confirmRelease
(
e
)
{
// else if(this.data.address_position === '') {
// wx.showToast({title:'请定位地址',icon:'none'})
// }
if
(
this
.
data
.
title
===
''
)
{
wx
.
showToast
({
title
:
'请填写标题'
,
icon
:
'none'
})
}
else
if
(
this
.
data
.
content
===
''
)
{
...
...
@@ -112,14 +126,14 @@ Page({
wx
.
showToast
({
title
:
'请填写最高人数'
,
icon
:
'none'
})
}
else
if
(
this
.
data
.
current_type
===
undefined
)
{
wx
.
showToast
({
title
:
'请选择类别'
,
icon
:
'none'
})
}
else
if
(
this
.
data
.
current_city
===
undefined
)
{
wx
.
showToast
({
title
:
'请选择城市'
,
icon
:
'none'
})
}
else
if
(
this
.
data
.
date
===
''
)
{
wx
.
showToast
({
title
:
'请选择日期'
,
icon
:
'none'
})
}
else
if
(
this
.
data
.
time
===
''
)
{
wx
.
showToast
({
title
:
'请选择时间'
,
icon
:
'none'
})
}
else
if
(
this
.
data
.
address
===
''
)
{
wx
.
showToast
({
title
:
'请填写餐厅'
,
icon
:
'none'
})
}
else
if
(
this
.
data
.
address_position
===
''
)
{
wx
.
showToast
({
title
:
'请定位地址'
,
icon
:
'none'
})
}
else
if
(
this
.
data
.
over_time
===
''
)
{
wx
.
showToast
({
title
:
'请填写截止时间'
,
icon
:
'none'
})
}
else
{
...
...
@@ -147,9 +161,11 @@ Page({
time
:
this
.
data
.
date
+
' '
+
this
.
data
.
time
,
name
:
this
.
data
.
address
,
address
:
this
.
data
.
address_position
,
latng
:
this
.
data
.
latng
,
latng
:
''
,
over_time
:
this
.
data
.
over_time
,
// 报名截止时间
formId
:
e
.
detail
.
formId
,
choose_addr
:
this
.
data
.
city_list
[
this
.
data
.
current_city
].
title
,
choose_addr_id
:
this
.
data
.
city_list
[
this
.
data
.
current_city
].
id
,
};
var
list
=
[];
app
.
post
(
url
,
params
,
{}).
then
((
res
)
=>
{
...
...
@@ -271,6 +287,10 @@ Page({
bindTypeChange
(
e
)
{
this
.
setData
({
current_type
:
+
e
.
detail
.
value
})
},
//选择城市
bindCityChange
(
e
)
{
this
.
setData
({
current_city
:
+
e
.
detail
.
value
})
},
//选择时间
bindTimeChange
(
e
)
{
this
.
setData
({
time
:
e
.
detail
.
value
,
hour
:
e
.
detail
.
value
.
split
(
':'
)[
0
],
minute
:
e
.
detail
.
value
.
split
(
':'
)[
1
]})
...
...
pages/meal/meal.wxml
查看文件 @
697f954
...
...
@@ -48,7 +48,7 @@
<!--</view>-->
<view class="min-num">
<text class="title type-title">类别</text>
<picker bindchange="bindTypeChange" value="{{current_
sex
}}" range="{{type_picker_list}}" class="picker">
<picker bindchange="bindTypeChange" value="{{current_
type
}}" range="{{type_picker_list}}" class="picker">
<view class="input">
<text class="variety-text">{{type_picker_list[current_type]}}</text>
<!--<text class="variety-text" wx:else>{{pet_info.sex===2?'MM':'GG'}}</text>-->
...
...
@@ -57,6 +57,15 @@
</picker>
<text class="iconfont icon-xiangxia min-icon"></text>
</view>
<view class="min-num">
<text class="title type-title">城市</text>
<picker bindchange="bindCityChange" value="{{current_city}}" range="{{city_picker_list}}" class="picker">
<view class="input">
<text class="variety-text">{{city_picker_list[current_city]}}</text>
</view>
</picker>
<text class="iconfont icon-xiangxia min-icon"></text>
</view>
<view class="time-box">
<text class="time-title">时间</text>
<picker mode='date' bindchange="bindDateChange" value='{{date}}' end='2021-12-31' start="{{start_date}}">
...
...
@@ -93,11 +102,11 @@
<text class="address-title">餐厅</text>
<input type="text" bindinput="inputAddress" class="input"/>
</view>
<view class="address-box"
bindtap="choosePosition"
>
<view class="address-box">
<text class="address-title">地址</text>
<!--<input type="text" bindtap="choosePosition" value="" class="input"/>-->
<text class="input">{{address_position}}</text>
<text class="iconfont icon-location"></text>
<input type="text" value="" class="input" bindinput="inputAddr"/>
<!--<text class="input">{{address_position}}</text>-->
<!--<text class="iconfont icon-location"></text>-->
</view>
<view class="time-limit">
<text class="limit-title">开餐前</text>
...
...
请
注册
或
登录
后发表评论