Commit 9dbd4328cb45e008689a294f92115f61162b2971

Authored by wangfan
1 parent 5f31feed

manager-invitation

@@ -19,6 +19,8 @@ Page({ @@ -19,6 +19,8 @@ Page({
19 sid:'', 19 sid:'',
20 time:'', 20 time:'',
21 image:'', 21 image:'',
  22 + latitude:'',
  23 + longitude:'',
22 }, 24 },
23 defImage:'http://qn.colorcun.com/manager-invitation/wx/upload2.jpg', 25 defImage:'http://qn.colorcun.com/manager-invitation/wx/upload2.jpg',
24 tpl:{}, 26 tpl:{},
@@ -54,6 +56,8 @@ Page({ @@ -54,6 +56,8 @@ Page({
54 sid:res.data.sid, 56 sid:res.data.sid,
55 time:res.data.arrival_time, 57 time:res.data.arrival_time,
56 image:res.data.image_url, 58 image:res.data.image_url,
  59 + latitude:res.data.lat,
  60 + longitude:res.data.long,
57 }, 61 },
58 timeStr:util.unixtoTime(res.data.arrival_time,'MM-DD 星期WW HH:II') 62 timeStr:util.unixtoTime(res.data.arrival_time,'MM-DD 星期WW HH:II')
59 }) 63 })
@@ -146,6 +150,7 @@ Page({ @@ -146,6 +150,7 @@ Page({
146 && (this.data.pickerValue[0]>-1 || form.time>0) 150 && (this.data.pickerValue[0]>-1 || form.time>0)
147 && form.room 151 && form.room
148 && form.addr 152 && form.addr
  153 + && form.latitude>0
149 && (!this.tpl.hasImage || (this.tpl.hasImage && form.image))//带图模板 154 && (!this.tpl.hasImage || (this.tpl.hasImage && form.image))//带图模板
150 ){ 155 ){
151 flag=true; 156 flag=true;
@@ -157,6 +162,9 @@ Page({ @@ -157,6 +162,9 @@ Page({
157 }, 162 },
158 input(e){ 163 input(e){
159 let key=util.attr(e,'key'); 164 let key=util.attr(e,'key');
  165 + if(key=='addr' && !(this.data.form.latitude>0)){
  166 + return this.onChangeAddress()
  167 + }
160 let val=util.val(e).trim(); 168 let val=util.val(e).trim();
161 let form=this.data.form; 169 let form=this.data.form;
162 form[key]=val; 170 form[key]=val;
@@ -189,6 +197,8 @@ Page({ @@ -189,6 +197,8 @@ Page({
189 seller_address:this.data.form.addr, 197 seller_address:this.data.form.addr,
190 room_name:this.data.form.room, 198 room_name:this.data.form.room,
191 arrival_time:this.getTimeStr(), 199 arrival_time:this.getTimeStr(),
  200 + lat:this.data.form.latitude,
  201 + long:this.data.form.longitude,
192 } 202 }
193 if(opt.rid){ 203 if(opt.rid){
194 param.id=opt.rid 204 param.id=opt.rid
@@ -240,4 +250,20 @@ Page({ @@ -240,4 +250,20 @@ Page({
240 }, 250 },
241 }) 251 })
242 }, 252 },
  253 + onChangeAddress(){
  254 + wx.chooseLocation({
  255 + success: (res)=> {
  256 + console.log(res);
  257 + this.setData({
  258 + [`form.latitude`]:res.latitude,
  259 + [`form.longitude`]:res.longitude,
  260 + [`form.addr`]:res.name,
  261 + })
  262 + this.checkHasSubmit()
  263 + },
  264 + fail: function (err) {
  265 + console.log(err)
  266 + }
  267 + });
  268 + },
243 }) 269 })
@@ -32,9 +32,13 @@ @@ -32,9 +32,13 @@
32 placeholder="请输入包间名称" placeholder-class="placeholder-class"/> 32 placeholder="请输入包间名称" placeholder-class="placeholder-class"/>
33 </view> 33 </view>
34 <view class="item flex-ll"> 34 <view class="item flex-ll">
35 - <input value="{{form.addr}}" bindinput="input" 35 + <input value="{{form.addr}}"
  36 + bindinput="input" bindfocus="input"
36 data-key="addr" 37 data-key="addr"
37 placeholder="请输入店铺地址" placeholder-class="placeholder-class"/> 38 placeholder="请输入店铺地址" placeholder-class="placeholder-class"/>
  39 + <view class="caddr flex-rr" bindtap="onChangeAddress">
  40 + <image src="http://qn.colorcun.com/manager-invitation/wx/caddr.png" style="width: 28rpx; height: 36rpx;"></image>
  41 + </view>
38 </view> 42 </view>
39 </view> 43 </view>
40 <view class="upload block flex-vc" wx:if="{{tpl.hasImage}}"> 44 <view class="upload block flex-vc" wx:if="{{tpl.hasImage}}">
@@ -75,3 +75,9 @@ page{ @@ -75,3 +75,9 @@ page{
75 .placeholder-class{ 75 .placeholder-class{
76 color: #999999; 76 color: #999999;
77 } 77 }
  78 +.caddr{
  79 + width: 140rpx;
  80 + min-width: 140rpx;
  81 + height: 140rpx;
  82 + line-height: 140rpx;
  83 +}
@@ -31,7 +31,7 @@ @@ -31,7 +31,7 @@
31 "list": [] 31 "list": []
32 }, 32 },
33 "miniprogram": { 33 "miniprogram": {
34 - "current": 45, 34 + "current": 44,
35 "list": [ 35 "list": [
36 { 36 {
37 "id": 0, 37 "id": 0,
@@ -368,14 +368,14 @@ @@ -368,14 +368,14 @@
368 "id": 44, 368 "id": 44,
369 "name": "pages/manager-invitation/editor", 369 "name": "pages/manager-invitation/editor",
370 "pathName": "pages/manager-invitation/editor", 370 "pathName": "pages/manager-invitation/editor",
371 - "query": "tplid=2", 371 + "query": "tplid=2&rid=5",
372 "scene": null 372 "scene": null
373 }, 373 },
374 { 374 {
375 "id": 45, 375 "id": 45,
376 "name": "pages/manager-invitation/display", 376 "name": "pages/manager-invitation/display",
377 "pathName": "pages/manager-invitation/display", 377 "pathName": "pages/manager-invitation/display",
378 - "query": "rid=5&tplid=1&fromid=oB-xJ5KJCIasaEdgMRckqoL1cwg8&hasSellerShare=", 378 + "query": "rid=5&tplid=2&fromid=oB-xJ5KJCIasaEdgMRckqoL1cwg8&hasSellerShare=",
379 "scene": null 379 "scene": null
380 } 380 }
381 ] 381 ]