Commit 5f31feedecc81c26fcdccb6a88ed243926efaa3e

Authored by wangfan
1 parent 50fa1c52

manager-invitation

... ... @@ -19,6 +19,7 @@ Page({
addr:'粤江西路啤酒文化创意艺术区B09'
},
options:{tplid:1},
hasOwner:true,//是否为发起人
},
/**
... ... @@ -30,6 +31,7 @@ Page({
wx.redirectTo({
url:util.http_build_query({rid:options.rid,tplid:options.tplid},'./review')
})
return;
}
App.Invitation.SetInvitationRel({
id:options.rid,
... ... @@ -38,24 +40,40 @@ Page({
})
let param={
options:options,
hasOwner:options.hasSellerShare==1,//是否为发起人
}
if(options.rid){
param.tpls=[TP.tpls(options.tplid)]
}
this.setData(param)
this.initData(options);
this.initData(options,openid);
},
initData(options){
initData(options,openid){
App.Invitation.Detail({id:options.rid}).then(res=>{
this.setData({
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(i==0){hasOwner=true;}
hasCanSuccess=true;
}
})
}
let obj={
seller:{
name:res.data.seller_name,
room:res.data.room_name,
date:util.unixtoTime(res.data.arrival_time,this.data.tpls[this.data.current].timeStr),
addr:res.data.seller_address,
image:res.data.image_url,
hasCanSuccess:hasCanSuccess,
}
})
}
if(hasOwner){
obj.hasOwner=true
}
this.setData(obj)
})
},
/**
... ... @@ -122,13 +140,44 @@ Page({
onShareAppMessage: function () {
let path=util.http_build_query({
...this.data.options,
fromid:openid,
fromid:getApp().openid,
hasSellerShare:'',
},'/pages/manager-invitation/display')
return {
title: '点击查看详情,发邀请函',
title: '你收到一个邀请函,点击查看',
path: path,
imageUrl:'http://qn.colorcun.com/custom/lite-yd-cook/image/share-anpai2.jpg',
//imageUrl:'http://qn.colorcun.com/custom/lite-yd-cook/image/share-anpai2.jpg',
imageUrl:util.cgi('App.Reserve.MakePic&rid='+this.data.options.rid),
}
},
setUserInfoSuccess(){
util.toast('授权成功,可以继续转发','none');
},
confirmed(){
if(!this.data.seller.hasCanSuccess){
let userInfo=util.cache('userInfo');
let openid=getApp().openid
if(userInfo){
userInfo=JSON.stringify({
openid: openid,
avatar: userInfo.avatarUrl,
nickname: userInfo.nickName,
gender: userInfo.gender
})
}
App.Invitation.SetInvitationConfirm({
lid:this.data.options.rid,
openid:openid,
is_agree:1,
userinfo:userInfo
}).then(res=>{
this.setData({
[`seller.hasCanSuccess`]:true
})
util.toast('赴约成功','none')
})
}else{
util.toast('赴约成功','none')
}
},
})
\ No newline at end of file
... ...
<!--pages/manager-invitation/review.wxml-->
<view class="pages bg-{{options.tplid}} flex-vc" style="height:{{height}}px;">
<template is="tpl-{{options.tplid}}" data="{{...seller,options}}"></template>
<template is="tpl-{{options.tplid}}" data="{{...seller,options,hasOwner}}"></template>
</view>
<!--//商务-->
<template name="tpl-1">
<view class="flex-vc shangwu">
<view class="invit-logo">
<image src="http://qn.colorcun.com/custom/lite-yd-cook/image/detail_owner_invitation-1-1.png"></image>
</view>
<view class="invit-logo {{hasOwner?'owner':'customer'}}"></view>
<view class="seller flex-vc">
<view class="title">餐厅</view>
<view class="content name">{{name}}</view>
... ... @@ -21,9 +19,16 @@
{{addr}}
</view>
</view>
<userinfo-share class="button-none flex-vc" binduserinfo="setUserInfoSuccess" wx:if="{{options.rid}}" catchtap="catchtap">
<view class="buts-share"></view>
</userinfo-share>
<block wx:if="{{hasOwner}}">
<userinfo-share class="button-none flex-vc" binduserinfo="setUserInfoSuccess" wx:if="{{options.rid}}" catchtap="catchtap">
<view class="buts-share"></view>
</userinfo-share>
</block>
<block wx:else="">
<userinfo class="button-none flex-vc" binduserinfo="confirmed" wx:if="{{options.rid}}" catchtap="catchtap">
<view class="buts-share customer"></view>
</userinfo>
</block>
</view>
</template>
... ... @@ -32,9 +37,7 @@
<view class="wenxin-top"></view>
<view class="wenxin-bottom"></view>
<view class="flex-vc wenxin">
<view class="invit-logo">
<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>
</view>
<view class="invit-logo {{hasOwner?'owner':'customer'}}"></view>
<view class="wenxin-mask">
<view class="wenxin-mask-bg" style="background-image: url({{image||'http://qn.colorcun.com/manager-invitation/wx/hunshazhao3.jpg'}})"></view>
<view class="wenxin-mask-img"></view>
... ... @@ -49,8 +52,15 @@
{{addr}}
</view>
</view>
<userinfo-share class="button-none flex-vc" binduserinfo="setUserInfoSuccess" wx:if="{{options.rid}}" catchtap="catchtap">
<view class="buts-share"></view>
</userinfo-share>
<block wx:if="{{hasOwner}}">
<userinfo-share class="button-none flex-vc" binduserinfo="setUserInfoSuccess" wx:if="{{options.rid}}" catchtap="catchtap">
<view class="buts-share"></view>
</userinfo-share>
</block>
<block wx:else="">
<userinfo class="button-none flex-vc" binduserinfo="confirmed" wx:if="{{options.rid}}" catchtap="catchtap">
<view class="buts-share customer"></view>
</userinfo>
</block>
</view>
</template>
... ...
... ... @@ -38,6 +38,8 @@ image{
width: 400rpx;
height: 170rpx;
position: relative;
background-size: 100%;
background-repeat: no-repeat;
}
.seller{
margin-top: 80rpx;
... ... @@ -84,6 +86,17 @@ image{
.shangwu .seller{
margin-bottom: 152rpx;
}
.shangwu .invit-logo.owner{
width: 404rpx;
height: 158rpx;
background-image: url("http://qn.colorcun.com/custom/lite-yd-cook/image/detail_owner_invitation-1-1.png");
}
.shangwu .invit-logo.customer{
width: 352rpx;
height: 164rpx;
background-image: url("http://qn.colorcun.com/custom/lite-yd/image/invit-logo.png");
}
.wenxin {
margin-top: 60rpx;
}
... ... @@ -106,9 +119,15 @@ image{
background-image: url("http://qn.colorcun.com/manager-invitation/wx/%E8%8A%B1%E8%BE%B9-%E5%BA%95%E9%83%A8.png");
background-size: 100%;
}
.wenxin .invit-logo{
.wenxin .invit-logo.owner{
width: 340rpx;
height: 184rpx;
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");
}
.wenxin .invit-logo.customer{
width: 344rpx;
height: 198rpx;
background-image: url("http://qn.colorcun.com/manager-invitation/wx/%E9%82%80%E8%AF%B7%E5%87%BD.png");
}
.wenxin-mask{
margin-top: 10rpx;
... ... @@ -198,4 +217,7 @@ image{
@-webkit-keyframes butAnimation
{
50% {background-size:90%;}
}
.buts-share.customer{
background-image: url("http://qn.colorcun.com/manager-invitation/wx/%E7%A1%AE%E8%AE%A4%E6%94%B6%E5%88%B0.png");
}
\ No newline at end of file
... ...
... ... @@ -375,7 +375,7 @@
"id": 45,
"name": "pages/manager-invitation/display",
"pathName": "pages/manager-invitation/display",
"query": "rid=5&tplid=2&fromid=oB-xJ5KJCIasaEdgMRckqoL1cwg8&hasSellerShare=",
"query": "rid=5&tplid=1&fromid=oB-xJ5KJCIasaEdgMRckqoL1cwg8&hasSellerShare=",
"scene": null
}
]
... ...
... ... @@ -209,6 +209,9 @@ export default {
//cachetime: -1,
},
//受邀人同意参加,修改关系状态
'App.Invitation.SetInvitationConfirm':null,
//上传图片,只能上传单个图片文件
'App.Examples_Upload.UploadQn':null,
}
\ No newline at end of file
... ...