Commit 5f31feedecc81c26fcdccb6a88ed243926efaa3e

Authored by wangfan
1 parent 50fa1c52

manager-invitation

@@ -19,6 +19,7 @@ Page({ @@ -19,6 +19,7 @@ Page({
19 addr:'粤江西路啤酒文化创意艺术区B09' 19 addr:'粤江西路啤酒文化创意艺术区B09'
20 }, 20 },
21 options:{tplid:1}, 21 options:{tplid:1},
  22 + hasOwner:true,//是否为发起人
22 }, 23 },
23 24
24 /** 25 /**
@@ -30,6 +31,7 @@ Page({ @@ -30,6 +31,7 @@ Page({
30 wx.redirectTo({ 31 wx.redirectTo({
31 url:util.http_build_query({rid:options.rid,tplid:options.tplid},'./review') 32 url:util.http_build_query({rid:options.rid,tplid:options.tplid},'./review')
32 }) 33 })
  34 + return;
33 } 35 }
34 App.Invitation.SetInvitationRel({ 36 App.Invitation.SetInvitationRel({
35 id:options.rid, 37 id:options.rid,
@@ -38,24 +40,40 @@ Page({ @@ -38,24 +40,40 @@ Page({
38 }) 40 })
39 let param={ 41 let param={
40 options:options, 42 options:options,
  43 + hasOwner:options.hasSellerShare==1,//是否为发起人
41 } 44 }
42 if(options.rid){ 45 if(options.rid){
43 param.tpls=[TP.tpls(options.tplid)] 46 param.tpls=[TP.tpls(options.tplid)]
44 } 47 }
45 this.setData(param) 48 this.setData(param)
46 - this.initData(options); 49 + this.initData(options,openid);
47 }, 50 },
48 - initData(options){ 51 + initData(options,openid){
49 App.Invitation.Detail({id:options.rid}).then(res=>{ 52 App.Invitation.Detail({id:options.rid}).then(res=>{
50 - this.setData({ 53 + let hasOwner=false;
  54 + let hasCanSuccess=false;
  55 + if(res.data.customers && res.data.customers.length>0){
  56 + res.data.customers.forEach((u,i)=>{
  57 + if(u.openid==openid){
  58 + if(i==0){hasOwner=true;}
  59 + hasCanSuccess=true;
  60 + }
  61 + })
  62 + }
  63 + let obj={
51 seller:{ 64 seller:{
52 name:res.data.seller_name, 65 name:res.data.seller_name,
53 room:res.data.room_name, 66 room:res.data.room_name,
54 date:util.unixtoTime(res.data.arrival_time,this.data.tpls[this.data.current].timeStr), 67 date:util.unixtoTime(res.data.arrival_time,this.data.tpls[this.data.current].timeStr),
55 addr:res.data.seller_address, 68 addr:res.data.seller_address,
56 image:res.data.image_url, 69 image:res.data.image_url,
  70 + hasCanSuccess:hasCanSuccess,
57 } 71 }
58 - }) 72 + }
  73 + if(hasOwner){
  74 + obj.hasOwner=true
  75 + }
  76 + this.setData(obj)
59 }) 77 })
60 }, 78 },
61 /** 79 /**
@@ -122,13 +140,44 @@ Page({ @@ -122,13 +140,44 @@ Page({
122 onShareAppMessage: function () { 140 onShareAppMessage: function () {
123 let path=util.http_build_query({ 141 let path=util.http_build_query({
124 ...this.data.options, 142 ...this.data.options,
125 - fromid:openid, 143 + fromid:getApp().openid,
126 hasSellerShare:'', 144 hasSellerShare:'',
127 },'/pages/manager-invitation/display') 145 },'/pages/manager-invitation/display')
128 return { 146 return {
129 - title: '点击查看详情,发邀请函', 147 + title: '你收到一个邀请函,点击查看',
130 path: path, 148 path: path,
131 - imageUrl:'http://qn.colorcun.com/custom/lite-yd-cook/image/share-anpai2.jpg', 149 + //imageUrl:'http://qn.colorcun.com/custom/lite-yd-cook/image/share-anpai2.jpg',
  150 + imageUrl:util.cgi('App.Reserve.MakePic&rid='+this.data.options.rid),
  151 + }
  152 + },
  153 + setUserInfoSuccess(){
  154 + util.toast('授权成功,可以继续转发','none');
  155 + },
  156 + confirmed(){
  157 + if(!this.data.seller.hasCanSuccess){
  158 + let userInfo=util.cache('userInfo');
  159 + let openid=getApp().openid
  160 + if(userInfo){
  161 + userInfo=JSON.stringify({
  162 + openid: openid,
  163 + avatar: userInfo.avatarUrl,
  164 + nickname: userInfo.nickName,
  165 + gender: userInfo.gender
  166 + })
  167 + }
  168 + App.Invitation.SetInvitationConfirm({
  169 + lid:this.data.options.rid,
  170 + openid:openid,
  171 + is_agree:1,
  172 + userinfo:userInfo
  173 + }).then(res=>{
  174 + this.setData({
  175 + [`seller.hasCanSuccess`]:true
  176 + })
  177 + util.toast('赴约成功','none')
  178 + })
  179 + }else{
  180 + util.toast('赴约成功','none')
132 } 181 }
133 }, 182 },
134 }) 183 })
1 <!--pages/manager-invitation/review.wxml--> 1 <!--pages/manager-invitation/review.wxml-->
2 <view class="pages bg-{{options.tplid}} flex-vc" style="height:{{height}}px;"> 2 <view class="pages bg-{{options.tplid}} flex-vc" style="height:{{height}}px;">
3 - <template is="tpl-{{options.tplid}}" data="{{...seller,options}}"></template> 3 + <template is="tpl-{{options.tplid}}" data="{{...seller,options,hasOwner}}"></template>
4 </view> 4 </view>
5 <!--//商务--> 5 <!--//商务-->
6 <template name="tpl-1"> 6 <template name="tpl-1">
7 <view class="flex-vc shangwu"> 7 <view class="flex-vc shangwu">
8 - <view class="invit-logo">  
9 - <image src="http://qn.colorcun.com/custom/lite-yd-cook/image/detail_owner_invitation-1-1.png"></image>  
10 - </view> 8 + <view class="invit-logo {{hasOwner?'owner':'customer'}}"></view>
11 <view class="seller flex-vc"> 9 <view class="seller flex-vc">
12 <view class="title">餐厅</view> 10 <view class="title">餐厅</view>
13 <view class="content name">{{name}}</view> 11 <view class="content name">{{name}}</view>
@@ -21,9 +19,16 @@ @@ -21,9 +19,16 @@
21 {{addr}} 19 {{addr}}
22 </view> 20 </view>
23 </view> 21 </view>
24 - <userinfo-share class="button-none flex-vc" binduserinfo="setUserInfoSuccess" wx:if="{{options.rid}}" catchtap="catchtap">  
25 - <view class="buts-share"></view>  
26 - </userinfo-share> 22 + <block wx:if="{{hasOwner}}">
  23 + <userinfo-share class="button-none flex-vc" binduserinfo="setUserInfoSuccess" wx:if="{{options.rid}}" catchtap="catchtap">
  24 + <view class="buts-share"></view>
  25 + </userinfo-share>
  26 + </block>
  27 + <block wx:else="">
  28 + <userinfo class="button-none flex-vc" binduserinfo="confirmed" wx:if="{{options.rid}}" catchtap="catchtap">
  29 + <view class="buts-share customer"></view>
  30 + </userinfo>
  31 + </block>
27 </view> 32 </view>
28 </template> 33 </template>
29 34
@@ -32,9 +37,7 @@ @@ -32,9 +37,7 @@
32 <view class="wenxin-top"></view> 37 <view class="wenxin-top"></view>
33 <view class="wenxin-bottom"></view> 38 <view class="wenxin-bottom"></view>
34 <view class="flex-vc wenxin"> 39 <view class="flex-vc wenxin">
35 - <view class="invit-logo">  
36 - <image src="http://qn.colorcun.com/manager-invitation/wx/%E6%B8%A9%E9%A6%A8-%E9%A2%84%E8%AE%A2%E5%AE%89%E6%8E%92.png"></image>  
37 - </view> 40 + <view class="invit-logo {{hasOwner?'owner':'customer'}}"></view>
38 <view class="wenxin-mask"> 41 <view class="wenxin-mask">
39 <view class="wenxin-mask-bg" style="background-image: url({{image||'http://qn.colorcun.com/manager-invitation/wx/hunshazhao3.jpg'}})"></view> 42 <view class="wenxin-mask-bg" style="background-image: url({{image||'http://qn.colorcun.com/manager-invitation/wx/hunshazhao3.jpg'}})"></view>
40 <view class="wenxin-mask-img"></view> 43 <view class="wenxin-mask-img"></view>
@@ -49,8 +52,15 @@ @@ -49,8 +52,15 @@
49 {{addr}} 52 {{addr}}
50 </view> 53 </view>
51 </view> 54 </view>
52 - <userinfo-share class="button-none flex-vc" binduserinfo="setUserInfoSuccess" wx:if="{{options.rid}}" catchtap="catchtap">  
53 - <view class="buts-share"></view>  
54 - </userinfo-share> 55 + <block wx:if="{{hasOwner}}">
  56 + <userinfo-share class="button-none flex-vc" binduserinfo="setUserInfoSuccess" wx:if="{{options.rid}}" catchtap="catchtap">
  57 + <view class="buts-share"></view>
  58 + </userinfo-share>
  59 + </block>
  60 + <block wx:else="">
  61 + <userinfo class="button-none flex-vc" binduserinfo="confirmed" wx:if="{{options.rid}}" catchtap="catchtap">
  62 + <view class="buts-share customer"></view>
  63 + </userinfo>
  64 + </block>
55 </view> 65 </view>
56 </template> 66 </template>
@@ -38,6 +38,8 @@ image{ @@ -38,6 +38,8 @@ image{
38 width: 400rpx; 38 width: 400rpx;
39 height: 170rpx; 39 height: 170rpx;
40 position: relative; 40 position: relative;
  41 + background-size: 100%;
  42 + background-repeat: no-repeat;
41 } 43 }
42 .seller{ 44 .seller{
43 margin-top: 80rpx; 45 margin-top: 80rpx;
@@ -84,6 +86,17 @@ image{ @@ -84,6 +86,17 @@ image{
84 .shangwu .seller{ 86 .shangwu .seller{
85 margin-bottom: 152rpx; 87 margin-bottom: 152rpx;
86 } 88 }
  89 +.shangwu .invit-logo.owner{
  90 + width: 404rpx;
  91 + height: 158rpx;
  92 + background-image: url("http://qn.colorcun.com/custom/lite-yd-cook/image/detail_owner_invitation-1-1.png");
  93 +}
  94 +.shangwu .invit-logo.customer{
  95 + width: 352rpx;
  96 + height: 164rpx;
  97 + background-image: url("http://qn.colorcun.com/custom/lite-yd/image/invit-logo.png");
  98 +}
  99 +
87 .wenxin { 100 .wenxin {
88 margin-top: 60rpx; 101 margin-top: 60rpx;
89 } 102 }
@@ -106,9 +119,15 @@ image{ @@ -106,9 +119,15 @@ image{
106 background-image: url("http://qn.colorcun.com/manager-invitation/wx/%E8%8A%B1%E8%BE%B9-%E5%BA%95%E9%83%A8.png"); 119 background-image: url("http://qn.colorcun.com/manager-invitation/wx/%E8%8A%B1%E8%BE%B9-%E5%BA%95%E9%83%A8.png");
107 background-size: 100%; 120 background-size: 100%;
108 } 121 }
109 -.wenxin .invit-logo{ 122 +.wenxin .invit-logo.owner{
110 width: 340rpx; 123 width: 340rpx;
111 height: 184rpx; 124 height: 184rpx;
  125 + background-image: url("http://qn.colorcun.com/manager-invitation/wx/%E6%B8%A9%E9%A6%A8-%E9%A2%84%E8%AE%A2%E5%AE%89%E6%8E%92.png");
  126 +}
  127 +.wenxin .invit-logo.customer{
  128 + width: 344rpx;
  129 + height: 198rpx;
  130 + background-image: url("http://qn.colorcun.com/manager-invitation/wx/%E9%82%80%E8%AF%B7%E5%87%BD.png");
112 } 131 }
113 .wenxin-mask{ 132 .wenxin-mask{
114 margin-top: 10rpx; 133 margin-top: 10rpx;
@@ -198,4 +217,7 @@ image{ @@ -198,4 +217,7 @@ image{
198 @-webkit-keyframes butAnimation 217 @-webkit-keyframes butAnimation
199 { 218 {
200 50% {background-size:90%;} 219 50% {background-size:90%;}
  220 +}
  221 +.buts-share.customer{
  222 + background-image: url("http://qn.colorcun.com/manager-invitation/wx/%E7%A1%AE%E8%AE%A4%E6%94%B6%E5%88%B0.png");
201 } 223 }
@@ -375,7 +375,7 @@ @@ -375,7 +375,7 @@
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=2&fromid=oB-xJ5KJCIasaEdgMRckqoL1cwg8&hasSellerShare=", 378 + "query": "rid=5&tplid=1&fromid=oB-xJ5KJCIasaEdgMRckqoL1cwg8&hasSellerShare=",
379 "scene": null 379 "scene": null
380 } 380 }
381 ] 381 ]
@@ -209,6 +209,9 @@ export default { @@ -209,6 +209,9 @@ export default {
209 //cachetime: -1, 209 //cachetime: -1,
210 }, 210 },
211 211
  212 + //受邀人同意参加,修改关系状态
  213 + 'App.Invitation.SetInvitationConfirm':null,
  214 +
212 //上传图片,只能上传单个图片文件 215 //上传图片,只能上传单个图片文件
213 'App.Examples_Upload.UploadQn':null, 216 'App.Examples_Upload.UploadQn':null,
214 } 217 }