|
...
|
...
|
@@ -25,9 +25,10 @@ Page({ |
|
|
|
/**
|
|
|
|
* 生命周期函数--监听页面加载
|
|
|
|
*/
|
|
|
|
onLoad: function (options) {
|
|
|
|
let openid=getApp().openid;
|
|
|
|
if(options.fromid==openid && options.hasSellerShare==1){//商家分享自己点跳到商家预览页
|
|
|
|
openid:'',
|
|
|
|
onLoad: async function (options) {
|
|
|
|
this.openid=await getApp().openid;
|
|
|
|
if(options.fromid==this.openid && options.hasSellerShare==1){//商家分享自己点跳到商家预览页
|
|
|
|
wx.redirectTo({
|
|
|
|
url:util.http_build_query({rid:options.rid,tplid:options.tplid},'./review')
|
|
|
|
})
|
|
...
|
...
|
@@ -36,7 +37,7 @@ Page({ |
|
|
|
App.Invitation.SetInvitationRel({
|
|
|
|
id:options.rid,
|
|
|
|
initiator:options.fromid,
|
|
|
|
inviting:openid,
|
|
|
|
inviting:this.openid,
|
|
|
|
})
|
|
|
|
let param={
|
|
|
|
options:options,
|
|
...
|
...
|
@@ -46,15 +47,15 @@ Page({ |
|
|
|
param.tpls=[TP.tpls(options.tplid)]
|
|
|
|
}
|
|
|
|
this.setData(param)
|
|
|
|
this.initData(options,openid);
|
|
|
|
this.initData(options);
|
|
|
|
},
|
|
|
|
initData(options,openid){
|
|
|
|
initData(options){
|
|
|
|
App.Invitation.Detail({id:options.rid}).then(res=>{
|
|
|
|
let hasOwner=false;
|
|
|
|
let hasCanSuccess=false;
|
|
|
|
if(res.data.customers && res.data.customers.length>0){
|
|
|
|
res.data.customers.forEach((u,i)=>{
|
|
|
|
if(u.openid==openid){
|
|
|
|
if(u.openid==this.openid){
|
|
|
|
if(i==0){hasOwner=true;}
|
|
|
|
hasCanSuccess=true;
|
|
|
|
}
|
|
...
|
...
|
@@ -142,14 +143,14 @@ Page({ |
|
|
|
onShareAppMessage: function () {
|
|
|
|
let path=util.http_build_query({
|
|
|
|
...this.data.options,
|
|
|
|
fromid:getApp().openid,
|
|
|
|
fromid:this.openid,
|
|
|
|
hasSellerShare:'',
|
|
|
|
},'/pages/manager-invitation/display')
|
|
|
|
return {
|
|
|
|
title: '你收到一个邀请函,点击查看',
|
|
|
|
path: path,
|
|
|
|
//imageUrl:'http://qn.colorcun.com/custom/lite-yd-cook/image/share-anpai2.jpg',
|
|
|
|
imageUrl:util.cgi('App.Reserve.MakePic&rid='+this.data.options.rid),
|
|
|
|
imageUrl:this.data.tpls[this.data.current].shareImage,
|
|
|
|
//imageUrl:util.cgi('App.Reserve.MakePic&rid='+this.data.options.rid),
|
|
|
|
}
|
|
|
|
},
|
|
|
|
setUserInfoSuccess(){
|
|
...
|
...
|
@@ -158,10 +159,9 @@ Page({ |
|
|
|
confirmed(){
|
|
|
|
if(!this.data.seller.hasCanSuccess){
|
|
|
|
let userInfo=util.cache('userInfo');
|
|
|
|
let openid=getApp().openid
|
|
|
|
if(userInfo){
|
|
|
|
userInfo=JSON.stringify({
|
|
|
|
openid: openid,
|
|
|
|
openid: this.openid,
|
|
|
|
avatar: userInfo.avatarUrl,
|
|
|
|
nickname: userInfo.nickName,
|
|
|
|
gender: userInfo.gender
|
|
...
|
...
|
@@ -169,7 +169,7 @@ Page({ |
|
|
|
}
|
|
|
|
App.Invitation.SetInvitationConfirm({
|
|
|
|
lid:this.data.options.rid,
|
|
|
|
openid:openid,
|
|
|
|
openid:this.openid,
|
|
|
|
is_agree:1,
|
|
|
|
userinfo:userInfo
|
|
|
|
}).then(res=>{
|
...
|
...
|
|