Commit 9dbd4328cb45e008689a294f92115f61162b2971

Authored by wangfan
1 parent 5f31feed

manager-invitation

... ... @@ -19,6 +19,8 @@ Page({
sid:'',
time:'',
image:'',
latitude:'',
longitude:'',
},
defImage:'http://qn.colorcun.com/manager-invitation/wx/upload2.jpg',
tpl:{},
... ... @@ -54,6 +56,8 @@ Page({
sid:res.data.sid,
time:res.data.arrival_time,
image:res.data.image_url,
latitude:res.data.lat,
longitude:res.data.long,
},
timeStr:util.unixtoTime(res.data.arrival_time,'MM-DD 星期WW HH:II')
})
... ... @@ -146,6 +150,7 @@ Page({
&& (this.data.pickerValue[0]>-1 || form.time>0)
&& form.room
&& form.addr
&& form.latitude>0
&& (!this.tpl.hasImage || (this.tpl.hasImage && form.image))//带图模板
){
flag=true;
... ... @@ -157,6 +162,9 @@ Page({
},
input(e){
let key=util.attr(e,'key');
if(key=='addr' && !(this.data.form.latitude>0)){
return this.onChangeAddress()
}
let val=util.val(e).trim();
let form=this.data.form;
form[key]=val;
... ... @@ -189,6 +197,8 @@ Page({
seller_address:this.data.form.addr,
room_name:this.data.form.room,
arrival_time:this.getTimeStr(),
lat:this.data.form.latitude,
long:this.data.form.longitude,
}
if(opt.rid){
param.id=opt.rid
... ... @@ -240,4 +250,20 @@ Page({
},
})
},
onChangeAddress(){
wx.chooseLocation({
success: (res)=> {
console.log(res);
this.setData({
[`form.latitude`]:res.latitude,
[`form.longitude`]:res.longitude,
[`form.addr`]:res.name,
})
this.checkHasSubmit()
},
fail: function (err) {
console.log(err)
}
});
},
})
\ No newline at end of file
... ...
... ... @@ -32,9 +32,13 @@
placeholder="请输入包间名称" placeholder-class="placeholder-class"/>
</view>
<view class="item flex-ll">
<input value="{{form.addr}}" bindinput="input"
<input value="{{form.addr}}"
bindinput="input" bindfocus="input"
data-key="addr"
placeholder="请输入店铺地址" placeholder-class="placeholder-class"/>
<view class="caddr flex-rr" bindtap="onChangeAddress">
<image src="http://qn.colorcun.com/manager-invitation/wx/caddr.png" style="width: 28rpx; height: 36rpx;"></image>
</view>
</view>
</view>
<view class="upload block flex-vc" wx:if="{{tpl.hasImage}}">
... ...
... ... @@ -75,3 +75,9 @@ page{
.placeholder-class{
color: #999999;
}
.caddr{
width: 140rpx;
min-width: 140rpx;
height: 140rpx;
line-height: 140rpx;
}
... ...
... ... @@ -31,7 +31,7 @@
"list": []
},
"miniprogram": {
"current": 45,
"current": 44,
"list": [
{
"id": 0,
... ... @@ -368,14 +368,14 @@
"id": 44,
"name": "pages/manager-invitation/editor",
"pathName": "pages/manager-invitation/editor",
"query": "tplid=2",
"query": "tplid=2&rid=5",
"scene": null
},
{
"id": 45,
"name": "pages/manager-invitation/display",
"pathName": "pages/manager-invitation/display",
"query": "rid=5&tplid=1&fromid=oB-xJ5KJCIasaEdgMRckqoL1cwg8&hasSellerShare=",
"query": "rid=5&tplid=2&fromid=oB-xJ5KJCIasaEdgMRckqoL1cwg8&hasSellerShare=",
"scene": null
}
]
... ...