Commit 50fa1c529bcc12c4ad5aae06035080c9c8c80f46

Authored by wangfan
1 parent b76bd748

manager-invitation

@@ -34,7 +34,8 @@ @@ -34,7 +34,8 @@
34 "pages/me/follow", 34 "pages/me/follow",
35 "pages/manager-invitation/index", 35 "pages/manager-invitation/index",
36 "pages/manager-invitation/review", 36 "pages/manager-invitation/review",
37 - "pages/manager-invitation/editor" 37 + "pages/manager-invitation/editor",
  38 + "pages/manager-invitation/display"
38 ], 39 ],
39 "subpackages": [ 40 "subpackages": [
40 { 41 {
  1 +// pages/manager-invitation/review.js
  2 +import util from '../../utils/util';
  3 +import App from '../../utils/api';
  4 +import TP from '../../utils/tpls';
  5 +const {regeneratorRuntime} = global
  6 +Page({
  7 +
  8 + /**
  9 + * 页面的初始数据
  10 + */
  11 + data: {
  12 + height: 667,
  13 + current: 0,
  14 + tpls: [],
  15 + seller:{
  16 + name:'一键订示例餐厅',
  17 + room:'天香阁',
  18 + date:util.unixtoTime(new Date()/1000,'YYYY/MM/DD 星期WW HH:II'),
  19 + addr:'粤江西路啤酒文化创意艺术区B09'
  20 + },
  21 + options:{tplid:1},
  22 + },
  23 +
  24 + /**
  25 + * 生命周期函数--监听页面加载
  26 + */
  27 + onLoad: function (options) {
  28 + let openid=getApp().openid;
  29 + if(options.fromid==openid && options.hasSellerShare==1){//商家分享自己点跳到商家预览页
  30 + wx.redirectTo({
  31 + url:util.http_build_query({rid:options.rid,tplid:options.tplid},'./review')
  32 + })
  33 + }
  34 + App.Invitation.SetInvitationRel({
  35 + id:options.rid,
  36 + initiator:options.fromid,
  37 + inviting:openid,
  38 + })
  39 + let param={
  40 + options:options,
  41 + }
  42 + if(options.rid){
  43 + param.tpls=[TP.tpls(options.tplid)]
  44 + }
  45 + this.setData(param)
  46 + this.initData(options);
  47 + },
  48 + initData(options){
  49 + App.Invitation.Detail({id:options.rid}).then(res=>{
  50 + this.setData({
  51 + seller:{
  52 + name:res.data.seller_name,
  53 + room:res.data.room_name,
  54 + date:util.unixtoTime(res.data.arrival_time,this.data.tpls[this.data.current].timeStr),
  55 + addr:res.data.seller_address,
  56 + image:res.data.image_url,
  57 + }
  58 + })
  59 + })
  60 + },
  61 + /**
  62 + * 生命周期函数--监听页面初次渲染完成
  63 + */
  64 + onReady: function () {
  65 +
  66 + },
  67 +
  68 + /**
  69 + * 生命周期函数--监听页面显示
  70 + */
  71 + onShow: function () {
  72 + //导航栏自适应
  73 + let systemInfo = wx.getSystemInfoSync();
  74 + let reg = /ios/i;
  75 + let pt = 20;//导航状态栏上内边距
  76 + let h = 44;//导航状态栏高度
  77 + if (reg.test(systemInfo.system)) {
  78 + pt = systemInfo.statusBarHeight;
  79 + h = 44;
  80 + } else {
  81 + pt = systemInfo.statusBarHeight;
  82 + h = 48;
  83 + }
  84 + this.setData({
  85 + statusBarHeight: pt,
  86 + titleBarHeight: h,
  87 + height: systemInfo.windowHeight
  88 + })
  89 + },
  90 +
  91 + /**
  92 + * 生命周期函数--监听页面隐藏
  93 + */
  94 + onHide: function () {
  95 +
  96 + },
  97 +
  98 + /**
  99 + * 生命周期函数--监听页面卸载
  100 + */
  101 + onUnload: function () {
  102 +
  103 + },
  104 +
  105 + /**
  106 + * 页面相关事件处理函数--监听用户下拉动作
  107 + */
  108 + onPullDownRefresh: function () {
  109 +
  110 + },
  111 +
  112 + /**
  113 + * 页面上拉触底事件的处理函数
  114 + */
  115 + onReachBottom: function () {
  116 +
  117 + },
  118 +
  119 + /**
  120 + * 用户点击右上角分享
  121 + */
  122 + onShareAppMessage: function () {
  123 + let path=util.http_build_query({
  124 + ...this.data.options,
  125 + fromid:openid,
  126 + hasSellerShare:'',
  127 + },'/pages/manager-invitation/display')
  128 + return {
  129 + title: '点击查看详情,发邀请函',
  130 + path: path,
  131 + imageUrl:'http://qn.colorcun.com/custom/lite-yd-cook/image/share-anpai2.jpg',
  132 + }
  133 + },
  134 +})
  1 +{
  2 + "navigationBarBackgroundColor": "#ffffff",
  3 + "navigationBarTextStyle": "white",
  4 + "navigationBarTitleText":"订座详情",
  5 + "usingComponents": {
  6 + "userinfo": "/components/userinfo/userinfo",
  7 + "nav":"/components/nav/nav",
  8 + "formids":"/components/formids/formids",
  9 + "userinfo-share": "/components/userinfo/share"
  10 + }
  11 +}
  1 +<!--pages/manager-invitation/review.wxml-->
  2 +<view class="pages bg-{{options.tplid}} flex-vc" style="height:{{height}}px;">
  3 + <template is="tpl-{{options.tplid}}" data="{{...seller,options}}"></template>
  4 +</view>
  5 +<!--//商务-->
  6 +<template name="tpl-1">
  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>
  11 + <view class="seller flex-vc">
  12 + <view class="title">餐厅</view>
  13 + <view class="content name">{{name}}</view>
  14 + <view class="title">包间</view>
  15 + <view class="content">{{room}}</view>
  16 + <view class="title">时间</view>
  17 + <view class="content">{{date}}</view>
  18 + <view class="title">店铺地址</view>
  19 + <view class="content flex-cc addr">
  20 + <image src="http://qn.colorcun.com/manager-invitation/wx/address.png" class="invit-addr"></image>
  21 + {{addr}}
  22 + </view>
  23 + </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>
  27 + </view>
  28 +</template>
  29 +
  30 +<!--//温馨-->
  31 +<template name="tpl-2">
  32 + <view class="wenxin-top"></view>
  33 + <view class="wenxin-bottom"></view>
  34 + <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>
  38 + <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>
  40 + <view class="wenxin-mask-img"></view>
  41 + </view>
  42 + <view class="wenxin-baitou"></view>
  43 + <view class="wenxin-line"></view>
  44 + <view class="seller flex-vc">
  45 + <view class="content">{{date}}</view>
  46 + <view class="content">{{name}}{{room}}</view>
  47 + <view class="content flex-cc addr">
  48 + <image src="http://qn.colorcun.com/manager-invitation/wx/address.png" class="invit-addr"></image>
  49 + {{addr}}
  50 + </view>
  51 + </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 + </view>
  56 +</template>
  1 +/* pages/manager-invitation/review.wxss */
  2 +.pages{
  3 + font-size: 200rpx;
  4 + background-size: 100%;
  5 + font-size: 34rpx;
  6 +}
  7 +.tabs{
  8 +}
  9 +.tabs .item{
  10 + font-size: 32rpx;
  11 + color:#999999;
  12 + margin-left: 20rpx;
  13 + padding: 0 10rpx;
  14 + height: 66rpx;
  15 + line-height: 66rpx;
  16 +}
  17 +.tabs .item.active{
  18 + font-size: 36rpx;
  19 + font-weight: bold;
  20 + color: #E9D9B7;
  21 + border-bottom: 2rpx solid #E9D9B7;
  22 +}
  23 +.bg-1{
  24 + background-image: url("http://qn.colorcun.com/custom/lite-yd/image/invit-bg.png");
  25 + background-color: #353334;
  26 + color:#fefefe;
  27 +}
  28 +.bg-2{
  29 + background-image: url("http://qn.colorcun.com/manager-invitation/wx/%E5%BA%95%E9%83%A8.png");
  30 + background-color: #F4AFB2;
  31 +}
  32 +image{
  33 + width: 100%;
  34 + height: 100%;
  35 +}
  36 +
  37 +.invit-logo{
  38 + width: 400rpx;
  39 + height: 170rpx;
  40 + position: relative;
  41 +}
  42 +.seller{
  43 + margin-top: 80rpx;
  44 +}
  45 +.seller .title{
  46 + font-size: 28rpx;
  47 + color:#999999;
  48 + margin-bottom: 18rpx;
  49 + height: 40rpx;
  50 + line-height: 40rpx;
  51 +}
  52 +.seller .content{
  53 + margin-bottom: 40rpx;
  54 + font-size: 36rpx;
  55 + line-height: 50rpx;
  56 + text-align: center;
  57 + align-items:flex-start;
  58 +}
  59 +.seller .content:last-child{
  60 + margin-bottom: 0;
  61 +}
  62 +.seller .addr{
  63 + width: 80%;
  64 +}
  65 +.seller .invit-addr{
  66 + width: 22rpx;
  67 + height: 28rpx;
  68 + margin-right: 10rpx;
  69 + margin-top: 10rpx;
  70 + min-width: 22rpx;
  71 +}
  72 +
  73 +.editor{
  74 + position: fixed;
  75 + bottom: 0;
  76 + height:98rpx;
  77 + left: 0;
  78 + line-height: 98rpx;
  79 + font-size: 30rpx;
  80 + color: #353535;
  81 + background-color: #ECD9B7;
  82 + width: 100%;
  83 +}
  84 +.shangwu .seller{
  85 + margin-bottom: 152rpx;
  86 +}
  87 +.wenxin {
  88 + margin-top: 60rpx;
  89 +}
  90 +
  91 +.wenxin-top{
  92 + position: fixed;
  93 + top:0;
  94 + left:0;
  95 + width:100%;
  96 + height: 80rpx;
  97 + background-image: url("http://qn.colorcun.com/manager-invitation/wx/%E9%A1%B6%E9%83%A8%E8%8A%B1%E8%BE%B9.png");
  98 + background-size: 100%;
  99 +}
  100 +.wenxin-bottom{
  101 + position: fixed;
  102 + bottom:0;
  103 + left:0;
  104 + width:100%;
  105 + height: 64rpx;
  106 + 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%;
  108 +}
  109 +.wenxin .invit-logo{
  110 + width: 340rpx;
  111 + height: 184rpx;
  112 +}
  113 +.wenxin-mask{
  114 + margin-top: 10rpx;
  115 + width: 568rpx;
  116 + height: 560rpx;
  117 + position: relative;
  118 +}
  119 +.wenxin-mask-bg{
  120 + margin: 60rpx auto;
  121 + width: 468rpx;
  122 + height: 468rpx;
  123 + border-radius: 50%;
  124 + overflow: hidden;
  125 + background-image: url("http://qn.colorcun.com/manager-invitation/wx/hunshazhao3.jpg");
  126 + background-size: cover;
  127 +}
  128 +.wenxin-mask-img{
  129 + position: absolute;
  130 + left: 0;
  131 + top:0;
  132 + background-image: url("http://qn.colorcun.com/manager-invitation/wx/%E8%8A%B1%E7%8E%AF%E7%A9%BA.png");
  133 + width: 100%;
  134 + height: 560rpx;
  135 + background-size: 100%;
  136 +}
  137 +.wenxin-baitou{
  138 + margin-top: 20rpx;
  139 + width: 404rpx;
  140 + height: 42rpx;
  141 + background-size: 100%;
  142 + background-image: url("http://qn.colorcun.com/manager-invitation/wx/%E6%B0%B8%E7%BB%93%E5%90%8C%E5%BF%83-%E7%99%BD%E5%A4%B4%E5%81%95%E8%80%81.png");
  143 +}
  144 +.wenxin-line{
  145 + margin-top: 30rpx;
  146 + width: 600rpx;
  147 + height: 14rpx;
  148 + background-size: 100%;
  149 + background-image: url("http://qn.colorcun.com/manager-invitation/wx/%E5%88%86%E5%89%B2%E5%B0%96%E5%A4%B4.png");
  150 +}
  151 +.wenxin .seller{
  152 + margin-top: 30rpx;
  153 + color:#fefefe;
  154 +}
  155 +.wenxin .seller .title{
  156 + display: none;
  157 +}
  158 +.wenxin .seller .content{
  159 + margin-bottom: 20rpx;
  160 + font-size: 36rpx;
  161 + line-height: 50rpx;
  162 + text-align: center;
  163 + align-items:flex-start;
  164 +}
  165 +.wenxin .seller .content.addr{
  166 + width: 100%;
  167 +}
  168 +.quick-editor{
  169 + background-color: #ECD9B7;
  170 + width: 120rpx;
  171 + height: 40rpx;
  172 + line-height: 40rpx;
  173 + color: #353535;
  174 + font-size: 24rpx;
  175 + position: absolute;
  176 + top:50rpx;
  177 + right:-150rpx;
  178 + text-align: center;
  179 +}
  180 +
  181 +.buts-share{
  182 + width: 560rpx;
  183 + height: 86rpx;
  184 + margin: 0 auto;
  185 + background-image: url("http://qn.colorcun.com/manager-invitation/wx/detail_owner_invitation-5.png");
  186 + background-size: 100%;
  187 + background-repeat: no-repeat;
  188 + background-position: center center;
  189 + animation-name: butAnimation;
  190 + animation-duration: 0.7s;
  191 + animation-iteration-count:9999;
  192 + position: relative;
  193 +}
  194 +@keyframes butAnimation
  195 +{
  196 + 50% {background-size:90%;}
  197 +}
  198 +@-webkit-keyframes butAnimation
  199 +{
  200 + 50% {background-size:90%;}
  201 +}
@@ -135,7 +135,16 @@ Page({ @@ -135,7 +135,16 @@ Page({
135 * 用户点击右上角分享 135 * 用户点击右上角分享
136 */ 136 */
137 onShareAppMessage: function () { 137 onShareAppMessage: function () {
138 - 138 + let path=util.http_build_query({
  139 + ...this.data.options,
  140 + fromid:openid,
  141 + hasSellerShare:1,
  142 + },'/pages/manager-invitation/display')
  143 + return {
  144 + title: '点击查看详情,发邀请函',
  145 + path: path,
  146 + imageUrl:'http://qn.colorcun.com/custom/lite-yd-cook/image/share-anpai2.jpg',
  147 + }
139 }, 148 },
140 swiperChange(e){ 149 swiperChange(e){
141 this.setData({ 150 this.setData({
@@ -31,7 +31,7 @@ @@ -31,7 +31,7 @@
31 "list": [] 31 "list": []
32 }, 32 },
33 "miniprogram": { 33 "miniprogram": {
34 - "current": 43, 34 + "current": 45,
35 "list": [ 35 "list": [
36 { 36 {
37 "id": 0, 37 "id": 0,
@@ -370,6 +370,13 @@ @@ -370,6 +370,13 @@
370 "pathName": "pages/manager-invitation/editor", 370 "pathName": "pages/manager-invitation/editor",
371 "query": "tplid=2", 371 "query": "tplid=2",
372 "scene": null 372 "scene": null
  373 + },
  374 + {
  375 + "id": 45,
  376 + "name": "pages/manager-invitation/display",
  377 + "pathName": "pages/manager-invitation/display",
  378 + "query": "rid=5&tplid=2&fromid=oB-xJ5KJCIasaEdgMRckqoL1cwg8&hasSellerShare=",
  379 + "scene": null
373 } 380 }
374 ] 381 ]
375 } 382 }
@@ -204,6 +204,11 @@ export default { @@ -204,6 +204,11 @@ export default {
204 //邀请函详情 204 //邀请函详情
205 'App.Invitation.Detail':null, 205 'App.Invitation.Detail':null,
206 206
  207 + //客户经理、预定人、受邀人信息建立
  208 + 'App.Invitation.SetInvitationRel':{
  209 + //cachetime: -1,
  210 + },
  211 +
207 //上传图片,只能上传单个图片文件 212 //上传图片,只能上传单个图片文件
208 'App.Examples_Upload.UploadQn':null, 213 'App.Examples_Upload.UploadQn':null,
209 } 214 }