Showing
5 changed files
with
40 additions
and
19 deletions
| @@ -25,9 +25,10 @@ Page({ | @@ -25,9 +25,10 @@ Page({ | ||
| 25 | /** | 25 | /** |
| 26 | * 生命周期函数--监听页面加载 | 26 | * 生命周期函数--监听页面加载 |
| 27 | */ | 27 | */ |
| 28 | - onLoad: function (options) { | ||
| 29 | - let openid=getApp().openid; | ||
| 30 | - if(options.fromid==openid && options.hasSellerShare==1){//商家分享自己点跳到商家预览页 | 28 | + openid:'', |
| 29 | + onLoad: async function (options) { | ||
| 30 | + this.openid=await getApp().openid; | ||
| 31 | + if(options.fromid==this.openid && options.hasSellerShare==1){//商家分享自己点跳到商家预览页 | ||
| 31 | wx.redirectTo({ | 32 | wx.redirectTo({ |
| 32 | url:util.http_build_query({rid:options.rid,tplid:options.tplid},'./review') | 33 | url:util.http_build_query({rid:options.rid,tplid:options.tplid},'./review') |
| 33 | }) | 34 | }) |
| @@ -36,7 +37,7 @@ Page({ | @@ -36,7 +37,7 @@ Page({ | ||
| 36 | App.Invitation.SetInvitationRel({ | 37 | App.Invitation.SetInvitationRel({ |
| 37 | id:options.rid, | 38 | id:options.rid, |
| 38 | initiator:options.fromid, | 39 | initiator:options.fromid, |
| 39 | - inviting:openid, | 40 | + inviting:this.openid, |
| 40 | }) | 41 | }) |
| 41 | let param={ | 42 | let param={ |
| 42 | options:options, | 43 | options:options, |
| @@ -46,15 +47,15 @@ Page({ | @@ -46,15 +47,15 @@ Page({ | ||
| 46 | param.tpls=[TP.tpls(options.tplid)] | 47 | param.tpls=[TP.tpls(options.tplid)] |
| 47 | } | 48 | } |
| 48 | this.setData(param) | 49 | this.setData(param) |
| 49 | - this.initData(options,openid); | 50 | + this.initData(options); |
| 50 | }, | 51 | }, |
| 51 | - initData(options,openid){ | 52 | + initData(options){ |
| 52 | App.Invitation.Detail({id:options.rid}).then(res=>{ | 53 | App.Invitation.Detail({id:options.rid}).then(res=>{ |
| 53 | let hasOwner=false; | 54 | let hasOwner=false; |
| 54 | let hasCanSuccess=false; | 55 | let hasCanSuccess=false; |
| 55 | if(res.data.customers && res.data.customers.length>0){ | 56 | if(res.data.customers && res.data.customers.length>0){ |
| 56 | res.data.customers.forEach((u,i)=>{ | 57 | res.data.customers.forEach((u,i)=>{ |
| 57 | - if(u.openid==openid){ | 58 | + if(u.openid==this.openid){ |
| 58 | if(i==0){hasOwner=true;} | 59 | if(i==0){hasOwner=true;} |
| 59 | hasCanSuccess=true; | 60 | hasCanSuccess=true; |
| 60 | } | 61 | } |
| @@ -142,14 +143,14 @@ Page({ | @@ -142,14 +143,14 @@ Page({ | ||
| 142 | onShareAppMessage: function () { | 143 | onShareAppMessage: function () { |
| 143 | let path=util.http_build_query({ | 144 | let path=util.http_build_query({ |
| 144 | ...this.data.options, | 145 | ...this.data.options, |
| 145 | - fromid:getApp().openid, | 146 | + fromid:this.openid, |
| 146 | hasSellerShare:'', | 147 | hasSellerShare:'', |
| 147 | },'/pages/manager-invitation/display') | 148 | },'/pages/manager-invitation/display') |
| 148 | return { | 149 | return { |
| 149 | title: '你收到一个邀请函,点击查看', | 150 | title: '你收到一个邀请函,点击查看', |
| 150 | path: path, | 151 | path: path, |
| 151 | - //imageUrl:'http://qn.colorcun.com/custom/lite-yd-cook/image/share-anpai2.jpg', | ||
| 152 | - imageUrl:util.cgi('App.Reserve.MakePic&rid='+this.data.options.rid), | 152 | + imageUrl:this.data.tpls[this.data.current].shareImage, |
| 153 | + //imageUrl:util.cgi('App.Reserve.MakePic&rid='+this.data.options.rid), | ||
| 153 | } | 154 | } |
| 154 | }, | 155 | }, |
| 155 | setUserInfoSuccess(){ | 156 | setUserInfoSuccess(){ |
| @@ -158,10 +159,9 @@ Page({ | @@ -158,10 +159,9 @@ Page({ | ||
| 158 | confirmed(){ | 159 | confirmed(){ |
| 159 | if(!this.data.seller.hasCanSuccess){ | 160 | if(!this.data.seller.hasCanSuccess){ |
| 160 | let userInfo=util.cache('userInfo'); | 161 | let userInfo=util.cache('userInfo'); |
| 161 | - let openid=getApp().openid | ||
| 162 | if(userInfo){ | 162 | if(userInfo){ |
| 163 | userInfo=JSON.stringify({ | 163 | userInfo=JSON.stringify({ |
| 164 | - openid: openid, | 164 | + openid: this.openid, |
| 165 | avatar: userInfo.avatarUrl, | 165 | avatar: userInfo.avatarUrl, |
| 166 | nickname: userInfo.nickName, | 166 | nickname: userInfo.nickName, |
| 167 | gender: userInfo.gender | 167 | gender: userInfo.gender |
| @@ -169,7 +169,7 @@ Page({ | @@ -169,7 +169,7 @@ Page({ | ||
| 169 | } | 169 | } |
| 170 | App.Invitation.SetInvitationConfirm({ | 170 | App.Invitation.SetInvitationConfirm({ |
| 171 | lid:this.data.options.rid, | 171 | lid:this.data.options.rid, |
| 172 | - openid:openid, | 172 | + openid:this.openid, |
| 173 | is_agree:1, | 173 | is_agree:1, |
| 174 | userinfo:userInfo | 174 | userinfo:userInfo |
| 175 | }).then(res=>{ | 175 | }).then(res=>{ |
| @@ -80,6 +80,8 @@ Page({ | @@ -80,6 +80,8 @@ Page({ | ||
| 80 | sid:sel.id, | 80 | sid:sel.id, |
| 81 | name:sel.name, | 81 | name:sel.name, |
| 82 | addr:sel.address, | 82 | addr:sel.address, |
| 83 | + latitude:sel.lat, | ||
| 84 | + longitude:sel.long, | ||
| 83 | } | 85 | } |
| 84 | }) | 86 | }) |
| 85 | } | 87 | } |
| @@ -147,6 +149,15 @@ Page({ | @@ -147,6 +149,15 @@ Page({ | ||
| 147 | checkHasSubmit(){ | 149 | checkHasSubmit(){ |
| 148 | let form=this.data.form; | 150 | let form=this.data.form; |
| 149 | let flag=false; | 151 | let flag=false; |
| 152 | + console.log( | ||
| 153 | + form.name | ||
| 154 | + , (this.data.pickerValue[0]>-1 || form.time>0) | ||
| 155 | + , form.room | ||
| 156 | + , form.addr | ||
| 157 | + , form.latitude>0 | ||
| 158 | + , (!this.tpl.hasImage || (this.tpl.hasImage && form.image)) | ||
| 159 | + | ||
| 160 | + ) | ||
| 150 | if( | 161 | if( |
| 151 | form.name | 162 | form.name |
| 152 | && (this.data.pickerValue[0]>-1 || form.time>0) | 163 | && (this.data.pickerValue[0]>-1 || form.time>0) |
| @@ -192,7 +203,13 @@ Page({ | @@ -192,7 +203,13 @@ Page({ | ||
| 192 | }, | 203 | }, |
| 193 | submit(){ | 204 | submit(){ |
| 194 | if(!this.checkHasSubmit()){ | 205 | if(!this.checkHasSubmit()){ |
| 195 | - return util.toast('请等待图片上传完成','none') | 206 | + let msg='请完善邀请函信息'; |
| 207 | + if(this.data.form.latitude<1){ | ||
| 208 | + msg='请标注店铺位置' | ||
| 209 | + }else if(!this.data.form.image){ | ||
| 210 | + msg='请等待图片上传完成' | ||
| 211 | + } | ||
| 212 | + return util.toast(msg,'none') | ||
| 196 | } | 213 | } |
| 197 | let opt=this.data.options | 214 | let opt=this.data.options |
| 198 | let param={ | 215 | let param={ |
| @@ -144,13 +144,13 @@ Page({ | @@ -144,13 +144,13 @@ Page({ | ||
| 144 | return { | 144 | return { |
| 145 | title: '一键订,客户经理专用的拓客工具', | 145 | title: '一键订,客户经理专用的拓客工具', |
| 146 | path: '/pages/manager-invitation/index', | 146 | path: '/pages/manager-invitation/index', |
| 147 | - imageUrl:'http://qn.colorcun.com/custom/lite-yd-cook/image/share-anpai2.jpg', | 147 | + imageUrl:this.data.tpls[this.data.current].shareFirstImage, |
| 148 | } | 148 | } |
| 149 | } | 149 | } |
| 150 | return { | 150 | return { |
| 151 | title: '点击查看详情,发邀请函', | 151 | title: '点击查看详情,发邀请函', |
| 152 | path: path, | 152 | path: path, |
| 153 | - imageUrl:'http://qn.colorcun.com/custom/lite-yd-cook/image/share-anpai2.jpg', | 153 | + imageUrl:this.data.tpls[this.data.current].shareFirstImage, |
| 154 | } | 154 | } |
| 155 | }, | 155 | }, |
| 156 | swiperChange(e){ | 156 | swiperChange(e){ |
| @@ -31,7 +31,7 @@ | @@ -31,7 +31,7 @@ | ||
| 31 | "list": [] | 31 | "list": [] |
| 32 | }, | 32 | }, |
| 33 | "miniprogram": { | 33 | "miniprogram": { |
| 34 | - "current": 43, | 34 | + "current": 44, |
| 35 | "list": [ | 35 | "list": [ |
| 36 | { | 36 | { |
| 37 | "id": 0, | 37 | "id": 0, |
| @@ -361,14 +361,14 @@ | @@ -361,14 +361,14 @@ | ||
| 361 | "id": 43, | 361 | "id": 43, |
| 362 | "name": "pages/manager-invitation/review", | 362 | "name": "pages/manager-invitation/review", |
| 363 | "pathName": "pages/manager-invitation/review", | 363 | "pathName": "pages/manager-invitation/review", |
| 364 | - "query": "rid=5&tplid=1", | 364 | + "query": "", |
| 365 | "scene": null | 365 | "scene": null |
| 366 | }, | 366 | }, |
| 367 | { | 367 | { |
| 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&rid=", | 371 | + "query": "tplid=1&rid=", |
| 372 | "scene": null | 372 | "scene": null |
| 373 | }, | 373 | }, |
| 374 | { | 374 | { |
| @@ -6,6 +6,8 @@ let tpls=[ | @@ -6,6 +6,8 @@ let tpls=[ | ||
| 6 | name: '商务', | 6 | name: '商务', |
| 7 | hasImage:false, | 7 | hasImage:false, |
| 8 | timeStr:'YYYY/MM/DD 星期WW HH:II', | 8 | timeStr:'YYYY/MM/DD 星期WW HH:II', |
| 9 | + shareFirstImage:'http://qn.colorcun.com/custom/lite-yd-cook/image/share-anpai2.jpg', | ||
| 10 | + shareImage:'http://qn.colorcun.com/custom/lite-yd-cook/imageshare-qing.jpg', | ||
| 9 | }, | 11 | }, |
| 10 | { | 12 | { |
| 11 | id: 2, | 13 | id: 2, |
| @@ -13,6 +15,8 @@ let tpls=[ | @@ -13,6 +15,8 @@ let tpls=[ | ||
| 13 | name: '温馨', | 15 | name: '温馨', |
| 14 | hasImage:true, | 16 | hasImage:true, |
| 15 | timeStr:'YYYY年MM月DD日HH时II分', | 17 | timeStr:'YYYY年MM月DD日HH时II分', |
| 18 | + shareFirstImage:'http://qn.colorcun.com/manager-invitation/wx/share-wx-1.jpg', | ||
| 19 | + shareImage:'http://qn.colorcun.com/manager-invitation/wx/share-wx.jpg', | ||
| 16 | }, | 20 | }, |
| 17 | ]; | 21 | ]; |
| 18 | module.exports ={ | 22 | module.exports ={ |
-
Please register or login to post a comment