Commit a2bd203f148a89ea95036a0f335febf2cb8e1201

Authored by wangfan
1 parent 8a27fa1d

seller-Invitation

@@ -3,6 +3,7 @@ @@ -3,6 +3,7 @@
3 "pages/customer/index", 3 "pages/customer/index",
4 "pages/book/b_index", 4 "pages/book/b_index",
5 "pages/book/b_detail", 5 "pages/book/b_detail",
  6 + "pages/book/b_invitation",
6 "pages/book/b_desk", 7 "pages/book/b_desk",
7 "pages/customer/detail_owner", 8 "pages/customer/detail_owner",
8 "pages/customer/detail_owner_part", 9 "pages/customer/detail_owner_part",
@@ -24,6 +24,12 @@ Component({ @@ -24,6 +24,12 @@ Component({
24 url:util.http_build_query(obj,'b_detail') 24 url:util.http_build_query(obj,'b_detail')
25 }) 25 })
26 }, 26 },
  27 + invitation:function(e){
  28 + var obj=this.data.vitem;
  29 + wx.navigateTo({
  30 + url:util.http_build_query(obj,'b_invitation')
  31 + })
  32 + },
27 changeitem:function () { 33 changeitem:function () {
28 let item=this.data.item; 34 let item=this.data.item;
29 item.table_ids=item.tid.split(','); 35 item.table_ids=item.tid.split(',');
1 -<formids bindtap="detail">  
2 - <view class="book-list-tds flex-lr font30r black-font reserve-status-{{vitem.status}}">  
3 - <view class="book-list-td flex-vc"> 1 +<view class="book-list-tds flex-lr font30r black-font reserve-status-{{vitem.status}}">
  2 + <formids bindtap="detail" class="book-list-td flex-vc">
  3 + <view class="flex-vc">
4 <view class="Medium" style="font-size: 30rpx; width: 100%;text-align: left;max-height:40px;overflow:hidden;">{{vitem.name}}</view> 4 <view class="Medium" style="font-size: 30rpx; width: 100%;text-align: left;max-height:40px;overflow:hidden;">{{vitem.name}}</view>
5 <view class="Medium" style="font-size: 28rpx;width: 100%;text-align: left" wx:if="{{vitem.table_ids.length>1}}">等{{vitem.table_ids.length}}桌</view> 5 <view class="Medium" style="font-size: 28rpx;width: 100%;text-align: left" wx:if="{{vitem.table_ids.length>1}}">等{{vitem.table_ids.length}}桌</view>
6 </view> 6 </view>
7 - <view class="book-list-td flex-vc" data-phone="{{vitem.phone}}"> 7 + </formids>
  8 + <formids bindtap="detail" class="book-list-td flex-vc">
  9 + <view class="flex-vc" data-phone="{{vitem.phone}}">
8 <view class="Medium">{{vitem.rname_mask}}</view> 10 <view class="Medium">{{vitem.rname_mask}}</view>
9 <view class="Medium" style="margin-top:10rpx;">{{vitem.phone_mask||''}}</view> 11 <view class="Medium" style="margin-top:10rpx;">{{vitem.phone_mask||''}}</view>
10 </view> 12 </view>
11 - <view class="book-list-td flex-vc">{{vitem.order_time}}</view>  
12 - <view class="book-list-td flex-rr green-font"> 13 + </formids>
  14 + <formids bindtap="detail" class="book-list-td flex-vc">
  15 + <view class="flex-vc">{{vitem.order_time}}</view>
  16 + </formids>
  17 + <formids bindtap="{{vitem.status==1?'invitation':'detail'}}" class="book-list-td flex-vc">
  18 + <view class="flex-rr green-font">
13 <view> 19 <view>
14 <view>{{vitem.status==1?'通知客户':vitem.status_str}}</view> 20 <view>{{vitem.status==1?'通知客户':vitem.status_str}}</view>
15 </view> 21 </view>
16 </view> 22 </view>
17 - </view>  
18 -</formids>  
  23 + </formids>
  24 +</view>
@@ -456,7 +456,7 @@ Page({ @@ -456,7 +456,7 @@ Page({
456 this.checkedTables={}; 456 this.checkedTables={};
457 App.Reserve.Detail({rid: _id, openid: ''}, 'clear') 457 App.Reserve.Detail({rid: _id, openid: ''}, 'clear')
458 wx.navigateTo({ 458 wx.navigateTo({
459 - url: 'b_detail?id=' + _id, 459 + url: 'b_invitation?id=' + _id,
460 }); 460 });
461 } else { 461 } else {
462 util.toast(res.msg, 'none') 462 util.toast(res.msg, 'none')
  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: TP.tpls(),
  15 + seller:{
  16 + name:'一键订示例餐厅',
  17 + room:'天香阁',
  18 + date:util.unixtoTime(new Date()/1000,'YYYY/MM/DD 星期WW HH:II'),
  19 + addr:'粤江西路啤酒文化创意艺术区B09',
  20 + hasOwner:true,
  21 + },
  22 + options:{},
  23 + },
  24 +
  25 + /**
  26 + * 生命周期函数--监听页面加载
  27 + */
  28 + onLoad: function (options) {
  29 + let param={
  30 + options:options,
  31 + }
  32 + if(options.rid){
  33 + param.tpls=[TP.tpls(options.tplid)]
  34 + }
  35 + this.setData(param)
  36 + this.initData(options);
  37 + },
  38 + initData(options){
  39 + if(options.rid){
  40 + App.Invitation.Detail({id:options.rid}).then(res=>{
  41 + this.setData({
  42 + seller:{
  43 + name:res.data.seller_name,
  44 + room:res.data.room_name,
  45 + date:util.unixtoTime(res.data.arrival_time,this.data.tpls[this.data.current].timeStr),
  46 + addr:res.data.seller_address,
  47 + image:res.data.image_url,
  48 + hasOwner:true,
  49 + }
  50 + })
  51 + })
  52 + }else{
  53 + App.Invitation.GetSellerList({
  54 + openid:getApp().openid
  55 + }).then(res=>{
  56 + if(res.data.length>0){
  57 + let defi=0;
  58 + for(let i=0;i<res.data.length;i++){
  59 + if(res.data[i].is_default==1){
  60 + defi=i;
  61 + break;
  62 + }
  63 + }
  64 + let sel=res.data[defi];
  65 + this.setData({
  66 + seller:{
  67 + name:sel.name,
  68 + room:'',
  69 + date:util.unixtoTime(new Date()/1000,this.data.tpls[this.data.current].timeStr),
  70 + addr:sel.address,
  71 + hasOwner:true,
  72 + }
  73 + })
  74 + }
  75 + })
  76 + }
  77 + },
  78 + /**
  79 + * 生命周期函数--监听页面初次渲染完成
  80 + */
  81 + onReady: function () {
  82 +
  83 + },
  84 +
  85 + /**
  86 + * 生命周期函数--监听页面显示
  87 + */
  88 + onShow: function () {
  89 + //导航栏自适应
  90 + let systemInfo = wx.getSystemInfoSync();
  91 + let reg = /ios/i;
  92 + let pt = 20;//导航状态栏上内边距
  93 + let h = 44;//导航状态栏高度
  94 + if (reg.test(systemInfo.system)) {
  95 + pt = systemInfo.statusBarHeight;
  96 + h = 44;
  97 + } else {
  98 + pt = systemInfo.statusBarHeight;
  99 + h = 48;
  100 + }
  101 + this.setData({
  102 + statusBarHeight: pt,
  103 + titleBarHeight: h,
  104 + height: systemInfo.windowHeight
  105 + })
  106 + },
  107 +
  108 + /**
  109 + * 生命周期函数--监听页面隐藏
  110 + */
  111 + onHide: function () {
  112 +
  113 + },
  114 +
  115 + /**
  116 + * 生命周期函数--监听页面卸载
  117 + */
  118 + onUnload: function () {
  119 +
  120 + },
  121 +
  122 + /**
  123 + * 页面相关事件处理函数--监听用户下拉动作
  124 + */
  125 + onPullDownRefresh: function () {
  126 +
  127 + },
  128 +
  129 + /**
  130 + * 页面上拉触底事件的处理函数
  131 + */
  132 + onReachBottom: function () {
  133 +
  134 + },
  135 +
  136 + /**
  137 + * 用户点击右上角分享
  138 + */
  139 + onShareAppMessage: function () {
  140 + let path=util.http_build_query({
  141 + ...this.data.options,
  142 + fromid:getApp().openid,
  143 + hasSellerShare:1,
  144 + },'/pages/manager-invitation/display')
  145 + if(!this.data.options.rid){
  146 + return {
  147 + title: '一键订,客户经理专用的拓客工具',
  148 + path: '/pages/manager-invitation/index',
  149 + imageUrl:this.data.tpls[this.data.current].shareFirstImage,
  150 + }
  151 + }
  152 + return {
  153 + title: '点击查看详情,发邀请函',
  154 + path: path,
  155 + imageUrl:this.data.tpls[this.data.current].shareFirstImage,
  156 + }
  157 + },
  158 + swiperChange(e){
  159 + let current=e.detail.current
  160 + this.setData({
  161 + current:current,
  162 + [`seller.date`]:util.unixtoTime(new Date()/1000,this.data.tpls[current].timeStr)
  163 + })
  164 + },
  165 + switchTabs(e){
  166 + let current=util.attr(e,'current')
  167 + this.setData({
  168 + current:current,
  169 + [`seller.date`]:util.unixtoTime(new Date()/1000,this.data.tpls[current].timeStr)
  170 + })
  171 + },
  172 + goEditor(){
  173 + let param={
  174 + ...this.data.options,
  175 + tplid:this.data.tpls[this.data.current].id,
  176 + }
  177 + wx.navigateTo({
  178 + url:util.http_build_query(param,'./editor')
  179 + })
  180 + },
  181 +})
  1 +{
  2 + "backgroundTextStyle":"light",
  3 + "navigationBarBackgroundColor": "#fff",
  4 + "navigationBarTextStyle":"white",
  5 + "usingComponents": {
  6 + "nav":"/components/nav/nav",
  7 + "formids":"/components/formids/formids"
  8 + }
  9 +}
  1 +<import src="../tpl/invitation"></import>
  2 +<swiper
  3 + indicator-dots="{{false}}"
  4 + autoplay="{{false}}"
  5 + duration="{{500}}"
  6 + bindchange="swiperChange"
  7 + current="{{current}}"
  8 + style="height:{{height}}px;"
  9 +>
  10 + <block wx:for="{{tpls}}" wx:key="tpls.key">
  11 + <swiper-item>
  12 + <view class="pages bg-{{item.id}} flex-vc" style="height:{{height}}px;width:100%;">
  13 + <template is="tpl-{{item.id}}" data="{{seller,options}}"></template>
  14 + </view>
  15 + </swiper-item>
  16 + </block>
  17 +</swiper>
  18 +<view wx:if="{{!options.rid}}"
  19 + class="flex-vc"
  20 + style="position:fixed;top:{{statusBarHeight}}px;left:0;height: {{titleBarHeight}}px; line-height: {{titleBarHeight}}px;">
  21 + <view class="tabs flex-ll">
  22 + <block wx:for="{{tpls}}" wx:key="tpls.key">
  23 + <view class="item {{index==current?'active':''}}" bindtap="switchTabs" data-current="{{index}}">{{item.name}}</view>
  24 + </block>
  25 + </view>
  26 +</view>
  27 +<nav wx:else="" backgroundColor="rgba(0,0,0,0)" style="position: fixed;"></nav>
  28 +
  29 +<!--//商务-->
  30 +<template name="tpl-1">
  31 + <view class="flex-vc shangwu" bindtap="{{options.rid?'goEditor':''}}">
  32 + <template is="tpl-shangwu" data="{{...seller,options}}"></template>
  33 + </view>
  34 +</template>
  35 +
  36 +<!--//温馨-->
  37 +<template name="tpl-2">
  38 + <template is="tpl-wenxin" data="{{...seller,options}}"></template>
  39 +</template>
  1 +@import "../manager-invitation/tpls.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 +image{
  24 + width: 100%;
  25 + height: 100%;
  26 +}
  1 +<!--//商务-->
  2 +<template name="tpl-shangwu">
  3 + <view class="invit-logo">
  4 + <image src="http://qn.colorcun.com/manager-invitation/wx2/%E9%A2%84%E8%AE%A2%E5%AE%89%E6%8E%92.png"></image>
  5 + <view class="quick-editor" wx:if="{{options.rid}}">修改内容</view>
  6 + </view>
  7 + <view class="shangwu-line"></view>
  8 + <view class="seller flex-vc">
  9 + <view class="title flex-cc">
  10 + <view class="title-left"></view>
  11 + 餐厅
  12 + <view class="title-right"></view>
  13 + </view>
  14 + <view class="content name">{{name}}</view>
  15 + <view class="title flex-cc">
  16 + <view class="title-left"></view>
  17 + 包间
  18 + <view class="title-right"></view>
  19 + </view>
  20 + <view class="content">{{room}}</view>
  21 + <view class="title flex-cc">
  22 + <view class="title-left"></view>
  23 + 时间
  24 + <view class="title-right"></view>
  25 + </view>
  26 + <view class="content">{{date}}</view>
  27 + <view class="title flex-cc">
  28 + <view class="title-addr"></view>
  29 + 地址导航
  30 + <view class="title-more"></view>
  31 + </view>
  32 + <view class="content flex-cc addr">
  33 + {{addr}}
  34 + </view>
  35 + </view>
  36 +</template>
  37 +
  38 +<!--//温馨-->
  39 +<template name="tpl-wenxin">
  40 + <view class="wenxin-top"></view>
  41 + <view class="wenxin-bottom"></view>
  42 + <view class="flex-vc wenxin" bindtap="{{options.rid?'goEditor':''}}">
  43 + <view class="invit-logo">
  44 + <image src="http://qn.colorcun.com/manager-invitation/wx2/%E9%A2%84%E8%AE%A2%E5%AE%89%E6%8E%92-%E6%B8%A9%E9%A6%A8.png"></image>
  45 + <view class="quick-editor" wx:if="{{options.rid}}">修改内容</view>
  46 + </view>
  47 + <view class="wenxin-mask">
  48 + <view class="wenxin-mask-bg" style="background-image: url({{image||'http://qn.colorcun.com/manager-invitation/wx/hunshazhao3.jpg'}})"></view>
  49 + <view class="wenxin-mask-img"></view>
  50 + </view>
  51 + <view class="wenxin-line"></view>
  52 + <view class="seller flex-vc">
  53 + <view class="content">{{date}}</view>
  54 + <view class="content">{{name}}</view>
  55 + <view class="content">{{room}}</view>
  56 + <view class="content flex-cc addr">
  57 + <image src="http://qn.colorcun.com/manager-invitation/wx/address.png" class="invit-addr"></image>
  58 + {{addr}}
  59 + </view>
  60 + </view>
  61 + </view>
  62 +</template>
@@ -31,7 +31,7 @@ @@ -31,7 +31,7 @@
31 "list": [] 31 "list": []
32 }, 32 },
33 "miniprogram": { 33 "miniprogram": {
34 - "current": 45, 34 + "current": 49,
35 "list": [ 35 "list": [
36 { 36 {
37 "id": 0, 37 "id": 0,
@@ -399,6 +399,13 @@ @@ -399,6 +399,13 @@
399 "pathName": "pages/manager-invitation/setting/history", 399 "pathName": "pages/manager-invitation/setting/history",
400 "query": "", 400 "query": "",
401 "scene": null 401 "scene": null
  402 + },
  403 + {
  404 + "id": 49,
  405 + "name": "pages/book/b_invitation",
  406 + "pathName": "pages/book/b_invitation",
  407 + "query": "id=7243",
  408 + "scene": null
402 } 409 }
403 ] 410 ]
404 } 411 }