Commit 403b3f0911423b55ecba2d2297144b7daf76b92e

Authored by wangfan
2 parents 87a5f596 3b6c8452

Merge remote-tracking branch 'remotes/origin/manager-invitation'

Showing 50 changed files with 2899 additions and 10 deletions
@@ -31,7 +31,16 @@ @@ -31,7 +31,16 @@
31 "pages/book/smsbatch/result", 31 "pages/book/smsbatch/result",
32 "pages/reserve/search", 32 "pages/reserve/search",
33 "pages/reserve/detail", 33 "pages/reserve/detail",
34 - "pages/me/follow" 34 + "pages/me/follow",
  35 + "pages/manager-invitation/index",
  36 + "pages/manager-invitation/review",
  37 + "pages/manager-invitation/editor",
  38 + "pages/manager-invitation/display",
  39 + "pages/manager-invitation/setting/index",
  40 + "pages/manager-invitation/setting/sellers",
  41 + "pages/manager-invitation/setting/seller-editor",
  42 + "pages/manager-invitation/crm/index",
  43 + "pages/manager-invitation/setting/history"
35 ], 44 ],
36 "subpackages": [ 45 "subpackages": [
37 { 46 {
  1 +// components/book/tabBar/tabBar.js
  2 +import util from '../../../utils/util'
  3 +Component({
  4 + /**
  5 + * 组件的属性列表
  6 + */
  7 + properties: {
  8 +
  9 + },
  10 +
  11 + /**
  12 + * 组件的初始数据
  13 + */
  14 + data: {
  15 + pi:0,
  16 + },
  17 + attached(){
  18 + let pages=getCurrentPages();
  19 + let p=pages[pages.length-1];
  20 + let pi=['/pages/manager-invitation/review','/pages/manager-invitation/crm/index','/pages/manager-invitation/setting/index'];
  21 + for(let x in pi){
  22 + console.log('tabBar',pi[x],p);
  23 + if(pi[x].indexOf(p.route)>-1){
  24 + this.setData({
  25 + pi:x
  26 + })
  27 + break;
  28 + }
  29 + }
  30 + },
  31 + /**
  32 + * 组件的方法列表
  33 + */
  34 + methods: {
  35 + redirectTo(e){
  36 + let url=util.attr(e,'url');
  37 + let pages=getCurrentPages();
  38 + let p=pages[pages.length-1];
  39 + if(url.indexOf(p.route)<0){
  40 + wx.redirectTo({
  41 + url:url,
  42 + })
  43 + }
  44 + }
  45 + }
  46 +})
  1 +{
  2 + "component": true,
  3 + "usingComponents": {
  4 + "formids":"/components/formids/formids"
  5 + }
  6 +}
  1 +<!--components/book/tabBar/tabBar.wxml-->
  2 +<view class="tabBar flex-cc">
  3 + <formids class="item flex-vc" bindtap="redirectTo" data-url="/pages/manager-invitation/review">
  4 + <view class="flex-vc {{pi==0?'checked':''}}" >
  5 + <view class="icon reserve"></view>
  6 + <view class="text">通知客户</view>
  7 + </view>
  8 + </formids>
  9 + <!--
  10 + <formids class="item flex-vc" bindtap="redirectTo" data-url="/pages/manager-invitation/crm/index">
  11 + <view class="flex-vc {{pi==1?'checked':''}}">
  12 + <view class="icon book"></view>
  13 + <view class="text">我的客户</view>
  14 + </view>
  15 + </formids>
  16 + -->
  17 + <formids class="item flex-vc" bindtap="redirectTo" data-url="/pages/manager-invitation/setting/index">
  18 + <view class="flex-vc {{pi==2?'checked':''}}">
  19 + <view class="icon setting"></view>
  20 + <view class="text">我的</view>
  21 + </view>
  22 + </formids>
  23 +</view>
  1 +/* components/book/tabBar/tabBar.wxss */
  2 +@import "../../../app.wxss";
  3 +.tabBar{
  4 + height: 98rpx;
  5 + background-color: rgba(0,0,0,.7);
  6 + width:100%;
  7 + position: fixed;
  8 + bottom: 0;
  9 + font-size: 20rpx;
  10 + color:#999999;
  11 + z-index: 9;
  12 +}
  13 +.tabBar-block{
  14 + height: 98rpx;
  15 + width: 100%;
  16 +}
  17 +.tabBar .checked{
  18 + color: #C0A369;
  19 +}
  20 +.tabBar .item{
  21 + width: 50%;
  22 +}
  23 +.tabBar .icon{
  24 + width: 34rpx;
  25 + height: 32rpx;
  26 + margin-bottom: 12rpx;
  27 + background-size: 100% 100%;
  28 +}
  29 +.tabBar .icon image{
  30 + width: 100%;
  31 + height: 100%;
  32 +}
  33 +.tabBar .reserve{
  34 + background-image: url("http://qn.colorcun.com/manager-invitation/wx2/%E9%80%9A%E7%9F%A5%E5%AE%A2%E6%88%B7-%E6%9C%AA%E7%82%B9%E5%87%BB.png");
  35 +}
  36 +.tabBar .checked .reserve{
  37 + background-image: url("http://qn.colorcun.com/manager-invitation/wx2/%E9%80%9A%E7%9F%A5%E5%AE%A2%E6%88%B7-%E7%82%B9%E5%87%BB.png");
  38 +}
  39 +.tabBar .book{
  40 + background-image: url("http://qn.colorcun.com/custom/lite-yd/image/seller-tabs2-book.png");
  41 +}
  42 +.tabBar .checked .book {
  43 + background-image: url("http://qn.colorcun.com/custom/lite-yd/image/seller-tabs2-book-checked.png");
  44 +}
  45 +.tabBar .setting{
  46 + width: 34rpx;
  47 + height: 34rpx;
  48 + background-image: url("http://qn.colorcun.com/manager-invitation/wx2/%E6%88%91%E7%9A%84.png");
  49 +}
  50 +.tabBar .checked .setting {
  51 + background-image: url("http://qn.colorcun.com/manager-invitation/wx2/%E6%88%91%E7%9A%84-%E9%80%89%E4%B8%AD.png");
  52 +}
@@ -4,6 +4,7 @@ @@ -4,6 +4,7 @@
4 position:fixed; 4 position:fixed;
5 width: 100%; 5 width: 100%;
6 z-index: 10; 6 z-index: 10;
  7 + top:0;
7 } 8 }
8 .nav{ 9 .nav{
9 font-size: 30rpx; 10 font-size: 30rpx;
@@ -49,9 +49,19 @@ Page({ @@ -49,9 +49,19 @@ Page({
49 }else{ 49 }else{
50 this.islove=await util.cache('islove') 50 this.islove=await util.cache('islove')
51 } 51 }
52 -  
53 - //获得商户数据  
54 - this.enter_params=await this.SellerForOpenid(opt.openid); 52 + let usi=await App.Invitation.UserIdentity({openid:opt.openid});
  53 + if(usi.data.identity==1){//商户
  54 + //获得商户数据
  55 + //this.enter_params=await this.SellerForOpenid(opt.openid);
  56 + this.enter_params=usi.data.data;
  57 + }else if(usi.data.identity==2){//客户经理
  58 + if(this.islove!='customer'){
  59 + wx.redirectTo({
  60 + url:'/pages/manager-invitation/review'
  61 + })
  62 + return;
  63 + }
  64 + }
55 //console.log('this.enter_params',this.enter_params) 65 //console.log('this.enter_params',this.enter_params)
56 let url = '/pages/customer/list'; 66 let url = '/pages/customer/list';
57 if (opt.id > 0 || opt.sms_code) { 67 if (opt.id > 0 || opt.sms_code) {
  1 +// pages/book/setting/index.js
  2 +import util from '../../../utils/util';
  3 +import App from '../../../utils/api';
  4 +const {regeneratorRuntime} = global
  5 +Page({
  6 + offset: 0,
  7 + limit: 10,
  8 + hasMore: true,
  9 + list:{},
  10 + /**
  11 + * 页面的初始数据
  12 + */
  13 + data: {
  14 + list:[],
  15 + hasMore:true,
  16 + hasSalesman:false,
  17 + },
  18 +
  19 + /**
  20 + * 生命周期函数--监听页面加载
  21 + */
  22 + enter_params: {},
  23 + onLoad: function (options) {
  24 + this.getMembers();
  25 + },
  26 +
  27 + /**
  28 + * 生命周期函数--监听页面初次渲染完成
  29 + */
  30 + onReady: function () {
  31 +
  32 + },
  33 +
  34 + /**
  35 + * 生命周期函数--监听页面显示
  36 + */
  37 + onShow: function () {
  38 +
  39 + },
  40 +
  41 + /**
  42 + * 生命周期函数--监听页面隐藏
  43 + */
  44 + onHide: function () {
  45 +
  46 + },
  47 + /**
  48 + * 页面上拉触底事件的处理函数
  49 + */
  50 + onReachBottom: function () {
  51 + if(this.hasMore){
  52 + this.getMembers(true);
  53 + }
  54 + },
  55 + getMembers(hasReachBottom=false){
  56 + App.Invitation.Members({
  57 + openid:getApp().openid,
  58 + offset: this.offset,
  59 + limit: this.limit,
  60 + }).then(res => {
  61 + let list = this.data.list;
  62 + let dl=res.data.length;
  63 + if (dl > 0) {
  64 + res.data.forEach(r => {
  65 + //r.addtimeStr = util.unixtoTime(r.addtime, 'MM/DD HH:II')
  66 + list.push(r)
  67 + this.list[r.id] = r;
  68 + })
  69 + }
  70 + let obj={list:list};
  71 + if(dl<this.limit && hasReachBottom){
  72 + this.hasMore=false;
  73 + obj.hasMore=false;
  74 + }else{
  75 + this.offset+=this.limit;
  76 + }
  77 + this.setData(obj)
  78 + })
  79 + },
  80 +})
  1 +{
  2 + "backgroundTextStyle":"light",
  3 + "navigationBarBackgroundColor": "#fff",
  4 + "navigationBarTextStyle":"white",
  5 + "usingComponents": {
  6 + "nav":"/components/nav/nav",
  7 + "tabBar":"/components/book/tabBar/tabBar",
  8 + "formids":"/components/formids/formids",
  9 + "tabBar":"/components/manager-invitation/tabBar/tabBar"
  10 + }
  11 +}
  1 +<!--pages/book/setting/index.wxml-->
  2 +<nav id="nav" backgroundColor="#199095" color="#fefefe">我的客户</nav>
  3 +<view class="pages">
  4 + <block wx:if="{{list.length>0}}">
  5 + <view class="row flex-lr" wx:for="{{list}}" wx:key="list.key" >
  6 + <view class="flex-ll">
  7 + <view class="avatar">
  8 + <image src="{{item.headimgurl}}"></image>
  9 + </view>
  10 + <view class="nickname">{{item.nickname||''}}</view>
  11 + </view>
  12 + <view class="flex-rr optmsg" wx:if="{{hasSalesman}}" bindtap="sendSalesmanMsg" data-openid="{{item.openid}}">
  13 + <view>发送消息</view>
  14 + <view class="more"></view>
  15 + </view>
  16 + </view>
  17 + </block>
  18 + <view wx:else="" class="history-is-empty flex-vc Medium">
  19 + <image src="http://qn.colorcun.com/custom/lite-yd/image/history-is-empty.png"></image>
  20 + <view>暂时还没有客户</view>
  21 + </view>
  22 + <view wx:if="{{!hasMore}}" class="row flex-vc">已经到底了</view>
  23 +</view>
  24 +<tabBar></tabBar>
  1 +/* pages/book/setting/index.wxss */
  2 +/*
  3 +http://qn.colorcun.com/custom/lite-yd/image/icon-zk.png
  4 +http://qn.colorcun.com/custom/lite-yd/image/icon-cz.png
  5 +*/
  6 +.pages{
  7 + width: 90%;
  8 + margin: 0 auto 50rpx;
  9 + color: #353535;
  10 + overflow-y: auto;
  11 +}
  12 +.row{
  13 + font-size: 34rpx;
  14 + height: 106rpx;
  15 + border-bottom: 2rpx solid #F1F0F4;
  16 + padding-top: 34rpx;
  17 +}
  18 +.row .right{
  19 + font-size: 30rpx;
  20 + color:#999999;
  21 +}
  22 +.row .more{
  23 + margin-left: 20rpx;
  24 +}
  25 +.row:last-child{
  26 + border-bottom-width: 0;
  27 +}
  28 +
  29 +.history-is-empty{
  30 + margin: 200rpx auto;
  31 + font-size: 34rpx;
  32 +
  33 +}
  34 +.history-is-empty image{
  35 + width: 376rpx;
  36 + height: 310rpx;
  37 + margin-bottom: 122rpx;
  38 +}
  39 +.avatar{
  40 + width: 80rpx;
  41 + height: 80rpx;
  42 + border-radius: 50%;
  43 + overflow: hidden;
  44 +}
  45 +.avatar image{
  46 + width: 100%;
  47 + height: 100%;
  48 +}
  49 +.nickname{
  50 + margin-left: 40rpx;
  51 + font-size: 34rpx;
  52 +}
  53 +.optmsg{
  54 + font-size: 30rpx;
  55 + color:#199095;
  56 +}
  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:'',
  19 + addr:''
  20 + },
  21 + options:{tplid:1},
  22 + hasOwner:true,//是否为发起人
  23 + animation:'animation',
  24 + },
  25 +
  26 + /**
  27 + * 生命周期函数--监听页面加载
  28 + */
  29 + openid:'',
  30 + onLoad: async function (options) {
  31 + this.openid=await getApp().openid;
  32 + if(options.fromid==this.openid && options.hasSellerShare==1){//商家分享自己点跳到商家预览页
  33 + wx.redirectTo({
  34 + url:util.http_build_query({rid:options.rid,tplid:options.tplid},'./review')
  35 + })
  36 + return;
  37 + }
  38 + App.Invitation.SetInvitationRel({
  39 + id:options.rid,
  40 + initiator:options.fromid,
  41 + inviting:this.openid,
  42 + })
  43 + let param={
  44 + options:options,
  45 + hasOwner:options.hasSellerShare==1,//是否为发起人
  46 + }
  47 + if(options.rid){
  48 + param.tpls=[TP.tpls(options.tplid)]
  49 + }
  50 + this.setData(param)
  51 + this.initData(options);
  52 + },
  53 + initData(options){
  54 + App.Invitation.Detail({id:options.rid}).then(res=>{
  55 + let hasOwner=false;
  56 + let hasCanSuccess=false;
  57 + if(res.data.customers && res.data.customers.length>0){
  58 + res.data.customers.forEach((u,i)=>{
  59 + if(u.openid==this.openid){
  60 + if(i==0){hasOwner=true;}
  61 + hasCanSuccess=true;
  62 + }
  63 + })
  64 + }
  65 + let obj={
  66 + seller:{
  67 + name:res.data.seller_name,
  68 + room:res.data.room_name,
  69 + date:util.unixtoTime(res.data.arrival_time,this.data.tpls[this.data.current].timeStr),
  70 + addr:res.data.seller_address,
  71 + image:res.data.image_url,
  72 + hasCanSuccess:hasCanSuccess,
  73 + lat:res.data.lat,
  74 + long:res.data.long,
  75 + }
  76 + }
  77 + obj.hasOwner=hasOwner
  78 + this.setData(obj)
  79 + })
  80 + },
  81 + /**
  82 + * 生命周期函数--监听页面初次渲染完成
  83 + */
  84 + onReady: function () {
  85 +
  86 + },
  87 +
  88 + /**
  89 + * 生命周期函数--监听页面显示
  90 + */
  91 + onShow: function () {
  92 + //导航栏自适应
  93 + let systemInfo = wx.getSystemInfoSync();
  94 + let reg = /ios/i;
  95 + let pt = 20;//导航状态栏上内边距
  96 + let h = 44;//导航状态栏高度
  97 + if (reg.test(systemInfo.system)) {
  98 + pt = systemInfo.statusBarHeight;
  99 + h = 44;
  100 + } else {
  101 + pt = systemInfo.statusBarHeight;
  102 + h = 48;
  103 + }
  104 + this.setData({
  105 + statusBarHeight: pt,
  106 + titleBarHeight: h,
  107 + height: systemInfo.windowHeight
  108 + })
  109 + },
  110 +
  111 + /**
  112 + * 生命周期函数--监听页面隐藏
  113 + */
  114 + onHide: function () {
  115 +
  116 + },
  117 +
  118 + /**
  119 + * 生命周期函数--监听页面卸载
  120 + */
  121 + onUnload: function () {
  122 +
  123 + },
  124 +
  125 + /**
  126 + * 页面相关事件处理函数--监听用户下拉动作
  127 + */
  128 + onPullDownRefresh: function () {
  129 +
  130 + },
  131 +
  132 + /**
  133 + * 页面上拉触底事件的处理函数
  134 + */
  135 + onReachBottom: function () {
  136 +
  137 + },
  138 +
  139 + /**
  140 + * 用户点击右上角分享
  141 + */
  142 + onShareAppMessage: function () {
  143 + this.setData({
  144 + animation:'',
  145 + })
  146 + let path=util.http_build_query({
  147 + ...this.data.options,
  148 + fromid:this.openid,
  149 + hasSellerShare:'',
  150 + },'/pages/manager-invitation/display')
  151 + return {
  152 + title: '你收到一个邀请函,点击查看',
  153 + path: path,
  154 + imageUrl:this.data.tpls[this.data.current].shareImage,
  155 + //imageUrl:util.cgi('App.Reserve.MakePic&rid='+this.data.options.rid),
  156 + }
  157 + },
  158 + setUserInfoSuccess(){
  159 + util.toast('授权成功,可以继续转发','none');
  160 + },
  161 + confirmed(){
  162 + if(!this.data.seller.hasCanSuccess){
  163 + let userInfo=util.cache('userInfo');
  164 + if(userInfo){
  165 + userInfo=JSON.stringify({
  166 + openid: this.openid,
  167 + avatar: userInfo.avatarUrl,
  168 + nickname: userInfo.nickName,
  169 + gender: userInfo.gender
  170 + })
  171 + }
  172 + App.Invitation.SetInvitationConfirm({
  173 + lid:this.data.options.rid,
  174 + openid:this.openid,
  175 + is_agree:1,
  176 + userinfo:userInfo
  177 + }).then(res=>{
  178 + this.setData({
  179 + [`seller.hasCanSuccess`]:true
  180 + })
  181 + util.toast('赴约成功','none')
  182 + })
  183 + }else{
  184 + util.toast('赴约成功','none')
  185 + }
  186 + },
  187 + lookLocation:function(){
  188 + //console.log(this.data.seller.lat,this.data.seller.long,this.data.detail.map_address)
  189 + wx.openLocation({
  190 + latitude:Number(this.data.seller.lat),
  191 + longitude:Number(this.data.seller.long),
  192 + scale:17,
  193 + address:this.data.seller.addr,
  194 + success:function (res) {
  195 + console.log(res)
  196 + }
  197 + })
  198 + },
  199 +})
  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 +<nav backgroundColor="rgba(0,0,0,0)" hasHome style="position: fixed;z-index: 1;"></nav>
  3 +<view class="pages bg-{{options.tplid}} flex-vc" style="height:{{height}}px;">
  4 + <template is="tpl-{{options.tplid}}" data="{{...seller,options,hasOwner,animation}}"></template>
  5 +</view>
  6 +<!--//商务-->
  7 +<template name="tpl-1">
  8 + <view class="flex-vc shangwu">
  9 + <view class="invit-logo {{hasOwner?'owner':'customer'}}"></view>
  10 + <view class="shangwu-line"></view>
  11 + <view class="seller flex-vc">
  12 + <view class="title flex-cc">
  13 + <view class="title-left"></view>
  14 + 餐厅
  15 + <view class="title-right"></view>
  16 + </view>
  17 + <view class="content name">{{name}}</view>
  18 + <view class="title flex-cc">
  19 + <view class="title-left"></view>
  20 + 包间
  21 + <view class="title-right"></view>
  22 + </view>
  23 + <view class="content">{{room}}</view>
  24 + <view class="title flex-cc">
  25 + <view class="title-left"></view>
  26 + 时间
  27 + <view class="title-right"></view>
  28 + </view>
  29 + <view class="content">{{date}}</view>
  30 + <view class="title flex-cc">
  31 + <view class="title-left"></view>
  32 + 地址
  33 + <view class="title-right"></view>
  34 + </view>
  35 + <view class="content flex-cc addr" bindtap="lookLocation">
  36 + <image src="http://qn.colorcun.com/manager-invitation/wx/address.png" class="invit-addr"></image>
  37 + {{addr}}
  38 + </view>
  39 + </view>
  40 + <block wx:if="{{hasOwner}}">
  41 + <userinfo-share class="button-none flex-vc" binduserinfo="setUserInfoSuccess" wx:if="{{options.rid}}" catchtap="catchShare">
  42 + <view class="buts-share {{animation}}"></view>
  43 + </userinfo-share>
  44 + </block>
  45 + <block wx:else="">
  46 + <userinfo class="button-none flex-vc" binduserinfo="confirmed" wx:if="{{options.rid}}" catchtap="catchtap">
  47 + <view class="buts-share animation customer"></view>
  48 + </userinfo>
  49 + </block>
  50 + </view>
  51 +</template>
  52 +
  53 +<!--//温馨-->
  54 +<template name="tpl-2">
  55 + <view class="wenxin-top"></view>
  56 + <view class="wenxin-bottom"></view>
  57 + <view class="flex-vc wenxin">
  58 + <view class="invit-logo {{hasOwner?'owner':'customer'}}"></view>
  59 + <view class="wenxin-mask">
  60 + <view class="wenxin-mask-bg" style="background-image: url({{image||'http://qn.colorcun.com/manager-invitation/wx/hunshazhao3.jpg'}})"></view>
  61 + <view class="wenxin-mask-img"></view>
  62 + </view>
  63 + <view class="wenxin-baitou"></view>
  64 + <view class="wenxin-line"></view>
  65 + <view class="seller flex-vc">
  66 + <view class="content">{{date}}</view>
  67 + <view class="content">{{name}}{{room}}</view>
  68 + <view class="content flex-cc addr" bindtap="lookLocation">
  69 + <image src="http://qn.colorcun.com/manager-invitation/wx/address.png" class="invit-addr"></image>
  70 + {{addr}}
  71 + </view>
  72 + </view>
  73 + <block wx:if="{{hasOwner}}">
  74 + <userinfo-share class="button-none flex-vc" binduserinfo="setUserInfoSuccess" wx:if="{{options.rid}}" catchtap="catchShare">
  75 + <view class="buts-share {{animation}}"></view>
  76 + </userinfo-share>
  77 + </block>
  78 + <block wx:else="">
  79 + <userinfo class="button-none flex-vc" binduserinfo="confirmed" wx:if="{{options.rid}}" catchtap="catchtap">
  80 + <view class="buts-share animation customer"></view>
  81 + </userinfo>
  82 + </block>
  83 + </view>
  84 +</template>
  1 +/* pages/manager-invitation/review.wxss */
  2 +@import "tpls.wxss";
  3 +.pages{
  4 + font-size: 200rpx;
  5 + background-size: 100%;
  6 + font-size: 34rpx;
  7 + position: fixed;
  8 + width: 100%;
  9 +}
  10 +image{
  11 + width: 100%;
  12 + height: 100%;
  13 +}
  14 +
  15 +.buts-share{
  16 + background-image: url("http://qn.colorcun.com/manager-invitation/wx2/%E5%8F%91%E9%82%80%E8%AF%B7%E5%87%BD.png");
  17 +}
  18 +.buts-share.customer{
  19 + background-image: url("http://qn.colorcun.com/manager-invitation/wx/%E7%A1%AE%E8%AE%A4%E6%94%B6%E5%88%B0.png");
  20 +}
  21 +
  22 +.shangwu{
  23 + margin-top: 52rpx;
  24 +}
  25 +.shangwu .seller{
  26 + margin-bottom: 92rpx;
  27 +}
  28 +.shangwu .invit-logo.owner{
  29 + width: 380rpx;
  30 + height: 200rpx;
  31 + background-image: url("http://qn.colorcun.com/manager-invitation/wx2/%E9%A2%84%E8%AE%A2%E5%AE%89%E6%8E%92.png");
  32 +}
  33 +.shangwu .invit-logo.customer{
  34 + width: 352rpx;
  35 + height: 164rpx;
  36 + background-image: url("http://qn.colorcun.com/custom/lite-yd/image/invit-logo.png");
  37 +}
  38 +
  39 +
  40 +.wenxin-mask{
  41 + margin-top: 20rpx;
  42 +}
  43 +.wenxin-baitou{
  44 + margin-top: 20rpx;
  45 +}
  46 +.wenxin .seller{
  47 + margin-bottom: 22rpx;
  48 +}
  49 +.wenxin .invit-logo.owner{
  50 + width: 340rpx;
  51 + height: 184rpx;
  52 + background-image: url("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");
  53 +}
  54 +.wenxin .invit-logo.customer{
  55 + width: 344rpx;
  56 + height: 198rpx;
  57 + background-image: url("http://qn.colorcun.com/manager-invitation/wx/%E9%82%80%E8%AF%B7%E5%87%BD.png");
  58 +}
  1 +// pages/manager-invitation/editor.js
  2 +import util from '../../utils/util';
  3 +import App from '../../utils/api';
  4 +import TP from '../../utils/tpls';
  5 +const {regeneratorRuntime} = global
  6 +import PubSub from '../../utils/PubSub'
  7 +Page({
  8 +
  9 + /**
  10 + * 页面的初始数据
  11 + */
  12 + data: {
  13 + pickerValue:[-1,0,0],
  14 + pickerData:[[],[],[]],
  15 + hasSubmit:false,
  16 + form:{
  17 + name:'',
  18 + room:'',
  19 + addr:'',
  20 + sid:'',
  21 + time:'',
  22 + image:'',
  23 + latitude:'',
  24 + longitude:'',
  25 + },
  26 + defImage:'http://qn.colorcun.com/manager-invitation/wx/upload2.jpg',
  27 + tpl:{},
  28 + timeStr:'',
  29 + },
  30 +
  31 + /**
  32 + * 生命周期函数--监听页面加载
  33 + */
  34 + pickerData:[],
  35 + tpl:{},
  36 + onLoad: function (options) {
  37 + this.tpl=TP.tpls(options.tplid);
  38 + this.pickerData=TP.pickerData();
  39 + let pd=TP.pickerData();
  40 + pd[2]=pd[2][this.data.pickerValue[1]];
  41 + this.initData(options)
  42 + this.setData({
  43 + pickerData:pd,
  44 + tpl:this.tpl,
  45 + options:options,
  46 + })
  47 + PubSub.on(
  48 + 'quick',
  49 + data=>{
  50 + console.log('quick.msg',data)
  51 + this.setData({
  52 + [`form.sid`]:data.id,
  53 + [`form.name`]:data.name,
  54 + [`form.addr`]:data.address,
  55 + [`form.latitude`]:data.lat,
  56 + [`form.longitude`]:data.long,
  57 + })
  58 + this.checkHasSubmit();
  59 + }
  60 + )
  61 + },
  62 + initData(options){
  63 + if(options.rid){
  64 + App.Invitation.Detail({id:options.rid}).then(res=>{
  65 + this.setData({
  66 + form:{
  67 + sid:res.data.seller_name,
  68 + name:res.data.seller_name,
  69 + room:res.data.room_name,
  70 + addr:res.data.seller_address,
  71 + sid:res.data.sid,
  72 + time:res.data.arrival_time,
  73 + image:res.data.image_url,
  74 + latitude:res.data.lat,
  75 + longitude:res.data.long,
  76 + },
  77 + timeStr:util.unixtoTime(res.data.arrival_time,this.data.tpl.timeStr)
  78 + })
  79 + this.checkHasSubmit();
  80 + })
  81 + }else{
  82 + App.Invitation.GetSellerList({
  83 + openid:getApp().openid
  84 + }).then(res=>{
  85 + if(res.data.length>0){
  86 + let defi=0;
  87 + for(let i=0;i<res.data.length;i++){
  88 + if(res.data[i].is_default==1){
  89 + defi=i;
  90 + break;
  91 + }
  92 + }
  93 + let sel=res.data[defi];
  94 + this.setData({
  95 + form:{
  96 + sid:sel.id,
  97 + name:sel.name,
  98 + addr:sel.address,
  99 + latitude:sel.lat,
  100 + longitude:sel.long,
  101 + }
  102 + })
  103 + }
  104 + })
  105 + }
  106 + },
  107 + /**
  108 + * 生命周期函数--监听页面初次渲染完成
  109 + */
  110 + onReady: function () {
  111 +
  112 + },
  113 +
  114 + /**
  115 + * 生命周期函数--监听页面显示
  116 + */
  117 + onShow: function () {
  118 +
  119 + },
  120 +
  121 + /**
  122 + * 生命周期函数--监听页面隐藏
  123 + */
  124 + onHide: function () {
  125 +
  126 + },
  127 +
  128 + /**
  129 + * 生命周期函数--监听页面卸载
  130 + */
  131 + onUnload: function () {
  132 +
  133 + },
  134 +
  135 + /**
  136 + * 页面相关事件处理函数--监听用户下拉动作
  137 + */
  138 + onPullDownRefresh: function () {
  139 +
  140 + },
  141 +
  142 + /**
  143 + * 页面上拉触底事件的处理函数
  144 + */
  145 + onReachBottom: function () {
  146 +
  147 + },
  148 + bindMultiPickerColumnChange(e){
  149 + //console.log(e);
  150 + if(e.detail.column==1){
  151 + this.setData({
  152 + [`pickerValue[1]`]:e.detail.value,
  153 + [`pickerData[2]`]:this.pickerData[2][e.detail.value],
  154 + })
  155 + }
  156 + },
  157 + bindMultiPickerChange(e){
  158 + console.log(e);
  159 + this.setData({
  160 + pickerValue:e.detail.value,
  161 + timeStr:util.unixtoTime(this.getTimeStr(e.detail.value),this.data.tpl.timeStr)
  162 + })
  163 + this.checkHasSubmit()
  164 + },
  165 + checkHasSubmit(){
  166 + let form=this.data.form;
  167 + let flag=false;
  168 + console.log(
  169 + form.name
  170 + , (this.data.pickerValue[0]>-1 || form.time>0)
  171 + , form.room
  172 + , form.addr
  173 + , form.latitude>0
  174 + , (!this.tpl.hasImage || (this.tpl.hasImage && form.image))
  175 +
  176 + )
  177 + if(
  178 + form.name
  179 + && (this.data.pickerValue[0]>-1 || form.time>0)
  180 + && form.room
  181 + && form.addr
  182 + && form.latitude>0
  183 + && (!this.tpl.hasImage || (this.tpl.hasImage && form.image))//带图模板
  184 + ){
  185 + flag=true;
  186 + }
  187 + this.setData({
  188 + hasSubmit:flag
  189 + })
  190 + return flag;
  191 + },
  192 + input(e){
  193 + let key=util.attr(e,'key');
  194 + if(key=='addr' && !(this.data.form.latitude>0)){
  195 + return this.onChangeAddress()
  196 + }
  197 + let val=util.val(e).trim();
  198 + let form=this.data.form;
  199 + form[key]=val;
  200 + this.setData({
  201 + form:form,
  202 + })
  203 + this.checkHasSubmit()
  204 + },
  205 + getTimeStr(pickerValue=''){
  206 + if(pickerValue.length<1){
  207 + pickerValue=this.data.pickerValue;
  208 + }
  209 + if(pickerValue[0]>-1){
  210 + let d=new Date();
  211 + let y=d.getFullYear();
  212 + let md=this.data.pickerData[0][pickerValue[0]].substr(0,5);
  213 + let t=this.data.pickerData[2][pickerValue[2]];
  214 + console.log(y+'-'+md+' '+t+':00')
  215 + return util.timetouUnix(y+'-'+md+' '+t+':00');
  216 + }else{
  217 + return this.data.form.time;
  218 + }
  219 + },
  220 + submit(){
  221 + if(!this.checkHasSubmit()){
  222 + let msg='请完善邀请函信息';
  223 + if(this.data.form.latitude<1){
  224 + msg='请标注店铺位置'
  225 + }else if(!this.data.form.image){
  226 + msg='请上传或等待图片完成'
  227 + }
  228 + return util.toast(msg,'none')
  229 + }
  230 + let opt=this.data.options
  231 + let param={
  232 + openid:getApp().openid,
  233 + template_id:opt.tplid,
  234 + sid:this.data.form.sid,
  235 + sname:this.data.form.name,
  236 + seller_address:this.data.form.addr,
  237 + room_name:this.data.form.room,
  238 + arrival_time:this.getTimeStr(),
  239 + lat:this.data.form.latitude,
  240 + long:this.data.form.longitude,
  241 + }
  242 + if(opt.rid){
  243 + param.id=opt.rid
  244 + }
  245 + if(this.data.form.image){
  246 + param.image_url=this.data.form.image
  247 + }
  248 + App.Invitation.SetInvitationInfo(param).then(res=>{
  249 + wx.redirectTo({
  250 + url:util.http_build_query({
  251 + rid:res.data.id,
  252 + ...this.data.options,
  253 + },'./review')
  254 + })
  255 + })
  256 + },
  257 + chooseImage(){
  258 + wx.chooseImage({
  259 + count:1,
  260 + sizeType:'compressed',
  261 + //sourceType:'album',
  262 + success:res=>{
  263 + const tempFilePaths = res.tempFilePaths[0]
  264 + this.setData({
  265 + defImage:tempFilePaths,
  266 + })
  267 + wx.uploadFile({
  268 + url:util.cgi('App.Examples_Upload.UploadQn'),
  269 + filePath:tempFilePaths,
  270 + name:'file',
  271 + success:upres=>{
  272 + try{
  273 + upres=JSON.parse(upres.data)
  274 + console.log('upres',upres)
  275 + if(upres.ret==200){
  276 + util.toast('图片上传完成','none')
  277 + this.setData({
  278 + [`form.image`]:upres.data,
  279 + })
  280 + this.checkHasSubmit()
  281 + }else{
  282 + util.toast(upres.msg||'上传出错','none')
  283 + }
  284 + }catch (e){
  285 + util.toast('上传出错','none')
  286 + }
  287 + }
  288 + })
  289 + },
  290 + })
  291 + },
  292 + onChangeAddress(){
  293 + wx.chooseLocation({
  294 + success: (res)=> {
  295 + console.log(res);
  296 + this.setData({
  297 + [`form.latitude`]:res.latitude,
  298 + [`form.longitude`]:res.longitude,
  299 + [`form.addr`]:res.name,
  300 + })
  301 + this.checkHasSubmit()
  302 + },
  303 + fail: function (err) {
  304 + console.log(err)
  305 + }
  306 + });
  307 + },
  308 +})
  1 +{
  2 + "navigationBarBackgroundColor": "#ffffff",
  3 + "navigationBarTextStyle": "black",
  4 + "navigationBarTitleText":"订座详情",
  5 + "usingComponents": {
  6 + "userinfo": "/components/userinfo/userinfo",
  7 + "nav":"/components/nav/nav",
  8 + "formids":"/components/formids/formids"
  9 + }
  10 +}
  1 +<!--pages/manager-invitation/editor.wxml-->
  2 +<nav>修改信息</nav>
  3 +<view class="pages">
  4 + <view class="base block">
  5 + <view class="item Medium">预订信息</view>
  6 + <view class="item flex-ll">
  7 + <input value="{{form.name}}" bindinput="input"
  8 + data-key="name"
  9 + placeholder="请输入店铺名称" placeholder-class="placeholder-class"/>
  10 + <formids url="./setting/sellers?hasQuick=1" class="quick">快速选择</formids>
  11 + </view>
  12 + <view class="item flex-ll">
  13 + <picker
  14 + mode="multiSelector"
  15 + bindchange="bindMultiPickerChange"
  16 + bindcolumnchange="bindMultiPickerColumnChange"
  17 + value="{{pickerValue}}"
  18 + range="{{pickerData}}"
  19 + style="width: 100%"
  20 + >
  21 + <view class="picker" style="width: 100%;">
  22 + <!--
  23 + <block wx:if="{{pickerValue[0]>-1}}">
  24 + {{pickerData[0][pickerValue[0]]}} {{pickerData[1][pickerValue[1]]}} {{pickerData[2][pickerValue[2]]}}
  25 + </block>
  26 + -->
  27 + <text wx:if="{{timeStr}}">{{timeStr}}</text>
  28 + <text class="placeholder-class" wx:else="">请输入预订时间</text>
  29 + </view>
  30 + </picker>
  31 + </view>
  32 + <view class="item flex-ll">
  33 + <input value="{{form.room}}" bindinput="input"
  34 + data-key="room"
  35 + placeholder="请输入包间名称" placeholder-class="placeholder-class"/>
  36 + </view>
  37 + <view class="item flex-ll">
  38 + <input value="{{form.addr}}"
  39 + bindinput="input" bindfocus="input"
  40 + data-key="addr"
  41 + placeholder="请输入店铺地址" placeholder-class="placeholder-class"/>
  42 + <view class="caddr flex-rr" bindtap="onChangeAddress">
  43 + <image src="http://qn.colorcun.com/manager-invitation/wx/caddr.png" style="width: 28rpx; height: 36rpx;"></image>
  44 + </view>
  45 + </view>
  46 + </view>
  47 + <view class="upload block flex-vc" wx:if="{{tpl.hasImage}}">
  48 + <view class="image" bindtap="chooseImage">
  49 + <image src="{{form.image||defImage}}" mode="aspectFill"></image>
  50 + </view>
  51 + <view class="text">(此处照片为邀请函展示照片)</view>
  52 + </view>
  53 + <formids bindclick="submit" style="width: 100%;">
  54 + <view class="submit {{hasSubmit?'submit-active':''}}">确定</view>
  55 + </formids>
  56 +</view>
  1 +/* pages/manager-invitation/editor.wxss */
  2 +page{
  3 + background-color: #F5F5F5;
  4 +}
  5 +.pages{
  6 + background-color: #F5F5F5;
  7 + font-size: 34rpx;
  8 + padding-top: 20rpx;
  9 + padding-bottom: 160rpx;
  10 +}
  11 +.block{
  12 + width: 94%;
  13 + margin: 0 auto;
  14 + border-radius: 8rpx;
  15 + background-color: #FEFEFE;
  16 +}
  17 +.base .item{
  18 + height: 140rpx;
  19 + line-height: 140rpx;
  20 + width: 94%;
  21 + margin: 0 auto;
  22 + border-bottom: 2rpx solid #F1F0F4;
  23 +}
  24 +.item input{
  25 + width: 100%;
  26 +}
  27 +.base .item:last-child{
  28 + border-width: 0;
  29 +}
  30 +.upload{
  31 + margin-top: 20rpx;
  32 + height: 310rpx;
  33 +}
  34 +.image{
  35 + width: 220rpx;
  36 + height: 220rpx;
  37 + border: 2rpx #E0E0E0 dashed;
  38 + margin-top: 20rpx;
  39 +}
  40 +.image image{
  41 + width: 100%;
  42 + height: 100%;
  43 +}
  44 +.text{
  45 + margin-top: 20rpx;
  46 + font-size: 28rpx;
  47 + color: #999999;
  48 +}
  49 +.submit{
  50 + position: fixed;
  51 + bottom: 30rpx;
  52 + left: 0;
  53 + right:0;
  54 + margin: 0 auto;
  55 + height: 84rpx;
  56 + line-height: 84rpx;
  57 + width: 90%;
  58 + background-color: #74BBBE;
  59 + border-radius: 10rpx;
  60 + color: #FEFEFE;
  61 +}
  62 +.submit-active{
  63 + background-color: #199095;
  64 +}
  65 +.quick{
  66 + height: 50rpx;
  67 + line-height: 50rpx;
  68 + width: 140rpx;
  69 + background-color: #46A5A9;
  70 + font-size: 28rpx;
  71 + color: #FEFEFE;
  72 + text-align: center;
  73 + min-width: 140rpx;
  74 +}
  75 +.placeholder-class{
  76 + color: #999999;
  77 +}
  78 +.caddr{
  79 + width: 140rpx;
  80 + min-width: 140rpx;
  81 + height: 140rpx;
  82 + line-height: 140rpx;
  83 +}
  1 +// pages/manager-invitation/index.js
  2 +import util from '../../utils/util';
  3 +import App from '../../utils/api';
  4 +const {regeneratorRuntime} = global
  5 +Page({
  6 +
  7 + /**
  8 + * 页面的初始数据
  9 + */
  10 + data: {
  11 + dots: [],
  12 + hasGo:false,
  13 + },
  14 +
  15 + /**
  16 + * 生命周期函数--监听页面加载
  17 + */
  18 + onLoad: function (options) {
  19 + let dots=[];
  20 + for(let i=0;i<15;i++){
  21 + let zf=Math.random()*10>5?1:-1;
  22 + let dot={
  23 + bottom:Math.random()*300*zf,
  24 + zoom:Math.random(),
  25 + }
  26 + dot.left=Math.random()*1000;
  27 + dots.push(dot)
  28 + }
  29 + this.setData({
  30 + dots:dots,
  31 + })
  32 + this.UserIdentity();
  33 + },
  34 +
  35 + /**
  36 + * 生命周期函数--监听页面初次渲染完成
  37 + */
  38 + onReady: function () {
  39 +
  40 + },
  41 +
  42 + /**
  43 + * 生命周期函数--监听页面显示
  44 + */
  45 + onShow: function () {
  46 +
  47 + },
  48 +
  49 + /**
  50 + * 生命周期函数--监听页面隐藏
  51 + */
  52 + onHide: function () {
  53 +
  54 + },
  55 +
  56 + /**
  57 + * 生命周期函数--监听页面卸载
  58 + */
  59 + onUnload: function () {
  60 +
  61 + },
  62 +
  63 + /**
  64 + * 页面相关事件处理函数--监听用户下拉动作
  65 + */
  66 + onPullDownRefresh: function () {
  67 +
  68 + },
  69 +
  70 + /**
  71 + * 页面上拉触底事件的处理函数
  72 + */
  73 + onReachBottom: function () {
  74 +
  75 + },
  76 +
  77 + /**
  78 + * 用户点击右上角分享
  79 + */
  80 + onShareAppMessage: function () {
  81 +
  82 + },
  83 + userinfo(){
  84 + if(!this.data.hasGo){
  85 + return util.toast('数据初始化,请等候','none');
  86 + }
  87 + let us=util.cache('userInfo');
  88 + App.Invitation.AddInvitationUser({
  89 + openid:getApp().openid,
  90 + avatar:us.avatarUrl,
  91 + nickname:us.nickName,
  92 + gender:us.gender,
  93 + }).then(res=>{
  94 + wx.redirectTo({
  95 + url:'./review'
  96 + });
  97 + })
  98 + },
  99 + UserIdentity(){
  100 + let openid=getApp().openid;
  101 + if(!openid){
  102 + return setTimeout(()=>{
  103 + this.UserIdentity();
  104 + },300)
  105 + }
  106 + App.Invitation.UserIdentity({
  107 + openid:openid,
  108 + }).then(res=>{
  109 + this.setData({
  110 + hasGo:true,
  111 + })
  112 + if(res.ret==200){
  113 + if(res.data.identity==1){
  114 + // wx.reLaunch({
  115 + // url:'/pages/customer/index'
  116 + // })
  117 + // return;
  118 + }
  119 + if(res.data.identity==2){
  120 + wx.redirectTo({
  121 + url:'/pages/manager-invitation/review'
  122 + })
  123 + }
  124 + }else{
  125 + util.toast(res.msg)
  126 + }
  127 + })
  128 + },
  129 +})
  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 + }
  10 +}
  1 +<!--pages/manager-invitation/index.wxml-->
  2 +<view class="pages flex-vc">
  3 + <view class="title">欢迎使用一键订</view>
  4 + <view class="steps flex-cc">
  5 + <view class="icon home"></view>
  6 + <view class="dot" wx:for="{{[4,5,6,7,8,9,10]}}" wx:key="key" style="opacity:{{item/10}};" ></view>
  7 + <view class="icon user"></view>
  8 + </view>
  9 + <view class="info">一键订,客户经理专用的拓客工具</view>
  10 + <view class="dot-max" wx:for="{{dots}}" style="bottom: {{item.bottom}}rpx;left: {{item.left}}rpx;zoom: {{item.zoom}};" wx:key="key"></view>
  11 + <userinfo binduserinfo="userinfo" style="width: 100%;">
  12 + <view class="userinfo">立即使用</view>
  13 + </userinfo>
  14 +</view>
  1 +/* pages/manager-invitation/index.wxss */
  2 +page{
  3 + background: linear-gradient(to bottom, #199095, #4BCACF);
  4 +}
  5 +.pages{
  6 + margin-top: 208rpx;
  7 + color:#FFFFFF;
  8 +}
  9 +.title{
  10 + font-size: 44rpx;
  11 + height: 60rpx;
  12 + line-height: 60rpx;
  13 + font-weight: bold;
  14 + letter-spacing:6rpx;
  15 +}
  16 +.steps {
  17 + height: 54rpx;
  18 + margin-top: 200rpx;
  19 + line-height: 54rpx;
  20 +}
  21 +.steps .icon{
  22 + width: 56rpx;
  23 + height: 56rpx;
  24 + background-size: 100%;
  25 +}
  26 +.steps .icon.home{
  27 + margin-right: 40rpx;
  28 + background-image: url("http://qn.colorcun.com/manager-invitation/%E5%95%86%E5%AE%B6.png");
  29 +}
  30 +.steps .icon.user{
  31 + margin-left: 20rpx;
  32 + background-image: url("http://qn.colorcun.com/manager-invitation/%E9%A1%BE%E5%AE%A2.png");
  33 +}
  34 +.steps .dot{
  35 + width: 12rpx;
  36 + height: 12rpx;
  37 + border-radius: 50%;
  38 + background-color: #ffffff;
  39 + margin-right: 24rpx;
  40 +}
  41 +
  42 +.dot-max{
  43 + width: 200rpx;
  44 + height: 200rpx;
  45 + border-radius: 50%;
  46 + background-color: #ffffff;
  47 + opacity:0.1;
  48 + position: fixed;
  49 + animation-name: butAnimation;
  50 + animation-duration: 15s;
  51 + animation-iteration-count:9999;
  52 +}
  53 +.info{
  54 + margin-top: 42rpx;
  55 + height: 40rpx;
  56 + line-height: 40rpx;
  57 + font-size: 28rpx;
  58 +}
  59 +.userinfo{
  60 + color:#000000;
  61 + font-size: 34rpx;
  62 + height: 84rpx;
  63 + line-height: 84rpx;
  64 + border-radius: 42rpx;
  65 + background-color: #fefefe;
  66 + box-shadow: 0 4rpx 8rpx 0 #2B9397;
  67 + width:80%;
  68 + margin: 346rpx auto 0;
  69 +}
  70 +
  71 +@keyframes butAnimation
  72 +{
  73 + 30%{
  74 + transform: translate(-1.5rem);
  75 + }
  76 + 50% {
  77 + transform: scale(1.2,1.2);
  78 + }
  79 + 75%{
  80 + transform: translate(1.5rem,-1.5rem);
  81 + }
  82 +}
  83 +@-webkit-keyframes butAnimation
  84 +{
  85 + 30%{
  86 + transform: translate(-1.5rem);
  87 + }
  88 + 50% {
  89 + transform: scale(1.2,1.2);
  90 + }
  91 + 75%{
  92 + transform: translate(1.5rem,-1.5rem);
  93 + }
  94 +}
  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 + },
  21 + options:{},
  22 + },
  23 +
  24 + /**
  25 + * 生命周期函数--监听页面加载
  26 + */
  27 + onLoad: function (options) {
  28 + let param={
  29 + options:options,
  30 + }
  31 + if(options.rid){
  32 + param.tpls=[TP.tpls(options.tplid)]
  33 + }
  34 + this.setData(param)
  35 + this.initData(options);
  36 + },
  37 + initData(options){
  38 + if(options.rid){
  39 + App.Invitation.Detail({id:options.rid}).then(res=>{
  40 + this.setData({
  41 + seller:{
  42 + name:res.data.seller_name,
  43 + room:res.data.room_name,
  44 + date:util.unixtoTime(res.data.arrival_time,this.data.tpls[this.data.current].timeStr),
  45 + addr:res.data.seller_address,
  46 + image:res.data.image_url,
  47 + }
  48 + })
  49 + })
  50 + }else{
  51 + App.Invitation.GetSellerList({
  52 + openid:getApp().openid
  53 + }).then(res=>{
  54 + if(res.data.length>0){
  55 + let defi=0;
  56 + for(let i=0;i<res.data.length;i++){
  57 + if(res.data[i].is_default==1){
  58 + defi=i;
  59 + break;
  60 + }
  61 + }
  62 + let sel=res.data[defi];
  63 + this.setData({
  64 + seller:{
  65 + name:sel.name,
  66 + room:'',
  67 + date:util.unixtoTime(new Date()/1000,this.data.tpls[this.data.current].timeStr),
  68 + addr:sel.address
  69 + }
  70 + })
  71 + }
  72 + })
  73 + }
  74 + },
  75 + /**
  76 + * 生命周期函数--监听页面初次渲染完成
  77 + */
  78 + onReady: function () {
  79 +
  80 + },
  81 +
  82 + /**
  83 + * 生命周期函数--监听页面显示
  84 + */
  85 + onShow: function () {
  86 + //导航栏自适应
  87 + let systemInfo = wx.getSystemInfoSync();
  88 + let reg = /ios/i;
  89 + let pt = 20;//导航状态栏上内边距
  90 + let h = 44;//导航状态栏高度
  91 + if (reg.test(systemInfo.system)) {
  92 + pt = systemInfo.statusBarHeight;
  93 + h = 44;
  94 + } else {
  95 + pt = systemInfo.statusBarHeight;
  96 + h = 48;
  97 + }
  98 + this.setData({
  99 + statusBarHeight: pt,
  100 + titleBarHeight: h,
  101 + height: systemInfo.windowHeight
  102 + })
  103 + },
  104 +
  105 + /**
  106 + * 生命周期函数--监听页面隐藏
  107 + */
  108 + onHide: function () {
  109 +
  110 + },
  111 +
  112 + /**
  113 + * 生命周期函数--监听页面卸载
  114 + */
  115 + onUnload: function () {
  116 +
  117 + },
  118 +
  119 + /**
  120 + * 页面相关事件处理函数--监听用户下拉动作
  121 + */
  122 + onPullDownRefresh: function () {
  123 +
  124 + },
  125 +
  126 + /**
  127 + * 页面上拉触底事件的处理函数
  128 + */
  129 + onReachBottom: function () {
  130 +
  131 + },
  132 +
  133 + /**
  134 + * 用户点击右上角分享
  135 + */
  136 + onShareAppMessage: function () {
  137 + let path=util.http_build_query({
  138 + ...this.data.options,
  139 + fromid:getApp().openid,
  140 + hasSellerShare:1,
  141 + },'/pages/manager-invitation/display')
  142 + if(!this.data.options.rid){
  143 + return {
  144 + title: '一键订,客户经理专用的拓客工具',
  145 + path: '/pages/manager-invitation/index',
  146 + imageUrl:this.data.tpls[this.data.current].shareFirstImage,
  147 + }
  148 + }
  149 + return {
  150 + title: '点击查看详情,发邀请函',
  151 + path: path,
  152 + imageUrl:this.data.tpls[this.data.current].shareFirstImage,
  153 + }
  154 + },
  155 + swiperChange(e){
  156 + let current=e.detail.current
  157 + this.setData({
  158 + current:current,
  159 + [`seller.date`]:util.unixtoTime(new Date()/1000,this.data.tpls[current].timeStr)
  160 + })
  161 + },
  162 + switchTabs(e){
  163 + let current=util.attr(e,'current')
  164 + this.setData({
  165 + current:current,
  166 + [`seller.date`]:util.unixtoTime(new Date()/1000,this.data.tpls[current].timeStr)
  167 + })
  168 + },
  169 + goEditor(){
  170 + let param={
  171 + ...this.data.options,
  172 + tplid:this.data.tpls[this.data.current].id,
  173 + }
  174 + wx.navigateTo({
  175 + url:util.http_build_query(param,'./editor')
  176 + })
  177 + },
  178 +})
  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 + "tabBar":"/components/manager-invitation/tabBar/tabBar"
  11 + }
  12 +}
  1 +<!--pages/manager-invitation/review.wxml-->
  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 +<template name="tpl-1">
  30 + <view class="flex-vc shangwu" bindtap="{{options.rid?'goEditor':''}}">
  31 + <view class="invit-logo">
  32 + <image src="http://qn.colorcun.com/manager-invitation/wx2/%E9%A2%84%E8%AE%A2%E5%AE%89%E6%8E%92.png"></image>
  33 + <view class="quick-editor" wx:if="{{options.rid}}">修改内容</view>
  34 + </view>
  35 + <view class="shangwu-line"></view>
  36 + <view class="seller flex-vc">
  37 + <view class="title flex-cc">
  38 + <view class="title-left"></view>
  39 + 餐厅
  40 + <view class="title-right"></view>
  41 + </view>
  42 + <view class="content name">{{name}}</view>
  43 + <view class="title flex-cc">
  44 + <view class="title-left"></view>
  45 + 包间
  46 + <view class="title-right"></view>
  47 + </view>
  48 + <view class="content">{{room}}</view>
  49 + <view class="title flex-cc">
  50 + <view class="title-left"></view>
  51 + 时间
  52 + <view class="title-right"></view>
  53 + </view>
  54 + <view class="content">{{date}}</view>
  55 + <view class="title flex-cc">
  56 + <view class="title-left"></view>
  57 + 地址
  58 + <view class="title-right"></view>
  59 + </view>
  60 + <view class="content flex-cc addr">
  61 + <image src="http://qn.colorcun.com/manager-invitation/wx/address.png" class="invit-addr"></image>
  62 + {{addr}}
  63 + </view>
  64 + </view>
  65 + <userinfo-share class="button-none flex-vc" binduserinfo="setUserInfoSuccess" wx:if="{{options.rid}}" catchtap="catchtap">
  66 + <view class="buts-share animation"></view>
  67 + </userinfo-share>
  68 + <view class="editor" bindtap="goEditor" wx:else=""></view>
  69 + </view>
  70 +</template>
  71 +
  72 +<!--//温馨-->
  73 +<template name="tpl-2">
  74 + <view class="wenxin-top"></view>
  75 + <view class="wenxin-bottom"></view>
  76 + <view class="flex-vc wenxin" bindtap="{{options.rid?'goEditor':''}}">
  77 + <view class="invit-logo">
  78 + <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>
  79 + <view class="quick-editor" wx:if="{{options.rid}}">修改内容</view>
  80 + </view>
  81 + <view class="wenxin-mask">
  82 + <view class="wenxin-mask-bg" style="background-image: url({{image||'http://qn.colorcun.com/manager-invitation/wx/hunshazhao3.jpg'}})"></view>
  83 + <view class="wenxin-mask-img"></view>
  84 + </view>
  85 + <view class="wenxin-baitou"></view>
  86 + <view class="wenxin-line"></view>
  87 + <view class="seller flex-vc">
  88 + <view class="content">{{date}}</view>
  89 + <view class="content">{{name}}{{room}}</view>
  90 + <view class="content flex-cc addr">
  91 + <image src="http://qn.colorcun.com/manager-invitation/wx/address.png" class="invit-addr"></image>
  92 + {{addr}}
  93 + </view>
  94 + </view>
  95 + <userinfo-share class="button-none flex-vc" binduserinfo="setUserInfoSuccess" wx:if="{{options.rid}}" catchtap="catchtap">
  96 + <view class="buts-share animation"></view>
  97 + </userinfo-share>
  98 + <view class="editor" bindtap="goEditor" wx:else=""></view>
  99 + </view>
  100 +</template>
  101 +
  102 +<tabBar></tabBar>
  1 +/* pages/manager-invitation/review.wxss */
  2 +@import "tpls.wxss";
  3 +.pages{
  4 + font-size: 200rpx;
  5 + background-size: 100%;
  6 + font-size: 34rpx;
  7 +}
  8 +.tabs{
  9 +}
  10 +.tabs .item{
  11 + font-size: 32rpx;
  12 + color:#999999;
  13 + margin-left: 20rpx;
  14 + padding: 0 10rpx;
  15 + height: 66rpx;
  16 + line-height: 66rpx;
  17 +}
  18 +.tabs .item.active{
  19 + font-size: 36rpx;
  20 + font-weight: bold;
  21 + color: #E9D9B7;
  22 + border-bottom: 2rpx solid #E9D9B7;
  23 +}
  24 +image{
  25 + width: 100%;
  26 + height: 100%;
  27 +}
  1 +// pages/manager-invitation/setting/history.js
  2 +import util from '../../../utils/util';
  3 +import App from '../../../utils/api';
  4 +const {regeneratorRuntime} = global
  5 +Page({
  6 + offset: 0,
  7 + limit: 10,
  8 + hasMore: true,
  9 + /**
  10 + * 页面的初始数据
  11 + */
  12 + data: {
  13 + list:{},
  14 + hasMore:true,
  15 + },
  16 +
  17 + /**
  18 + * 生命周期函数--监听页面加载
  19 + */
  20 + onLoad: function (options) {
  21 + this.getLists();
  22 + },
  23 +
  24 + /**
  25 + * 生命周期函数--监听页面初次渲染完成
  26 + */
  27 + onReady: function () {
  28 +
  29 + },
  30 +
  31 + /**
  32 + * 生命周期函数--监听页面显示
  33 + */
  34 + onShow: function () {
  35 +
  36 + },
  37 +
  38 + /**
  39 + * 生命周期函数--监听页面隐藏
  40 + */
  41 + onHide: function () {
  42 +
  43 + },
  44 +
  45 + /**
  46 + * 生命周期函数--监听页面卸载
  47 + */
  48 + onUnload: function () {
  49 +
  50 + },
  51 +
  52 + /**
  53 + * 页面相关事件处理函数--监听用户下拉动作
  54 + */
  55 + onPullDownRefresh: function () {
  56 +
  57 + },
  58 +
  59 + /**
  60 + * 页面上拉触底事件的处理函数
  61 + */
  62 + onReachBottom: function () {
  63 + if(this.hasMore){
  64 + this.getLists(true);
  65 + }
  66 + },
  67 +
  68 + getLists(hasReachBottom=false){
  69 + App.Invitation.InvitationList({
  70 + openid:getApp().openid,
  71 + offset: this.offset,
  72 + limit: this.limit,
  73 + }).then(res => {
  74 + let list = this.data.list;
  75 + let dl=res.data.length;
  76 + if (dl > 0) {
  77 + res.data.forEach(r => {
  78 + let ctime=util.unixtoTime(r.ctime,'YYYY/MM/DD')
  79 + r.arrival_timeStr = util.unixtoTime(r.arrival_time, 'HH:II')
  80 + list[ctime]=list[ctime]||{'date':ctime,data:[]};
  81 + list[ctime].data.push(r)
  82 + })
  83 + }
  84 + let obj={list:list};
  85 + if(dl<this.limit && hasReachBottom){
  86 + this.hasMore=false;
  87 + obj.hasMore=false;
  88 + }else{
  89 + this.offset+=this.limit;
  90 + }
  91 + this.setData(obj)
  92 + })
  93 + },
  94 +})
  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 +<!--pages/manager-invitation/setting/history.wxml-->
  2 +<nav>通知客户记录</nav>
  3 +<view class="table-header flex-lr">
  4 + <view class="Medium td1 flex-vc" style="align-items: flex-start">客户</view>
  5 + <view class="Medium td2 flex-vc" style="align-items: flex-start">桌号</view>
  6 + <view class="Medium td3">时间</view>
  7 + <view class="Medium td4">操作</view>
  8 +</view>
  9 +<view class="pages">
  10 + <view class="table-body">
  11 + <view class="table-block" wx:for="{{list}}" wx:key="list.key">
  12 + <view class="date">{{item.date}}</view>
  13 + <block wx:for="{{item.data}}" wx:key="item.data.key">
  14 + <formids url="/pages/manager-invitation/review?rid={{item.id}}&tplid={{item.template_id}}">
  15 + <view class="table-tr flex-lr">
  16 + <view class="Medium td1">
  17 + <block wx:if="{{item.nickname}}">
  18 + {{item.nickname}}
  19 + </block>
  20 + <block wx:elif="{{item.in_openid}}">
  21 + 客户已查看
  22 + </block>
  23 + <block wx:else="">
  24 + <text style="color:#F05522;">客户未查看</text>
  25 + </block>
  26 + </view>
  27 + <view class="Medium td2">{{item.room_name}}</view>
  28 + <view class="Medium td3">{{item.arrival_timeStr}}</view>
  29 + <view class="Medium td4">详情</view>
  30 + </view>
  31 + </formids>
  32 + </block>
  33 + </view>
  34 + <view wx:if="{{!hasMore}}" class="hasMore flex-vc">已经到底了</view>
  35 + </view>
  36 +</view>
  1 +/* pages/manager-invitation/setting/history.wxss */
  2 +page{
  3 + background-color: #f5f5f5;
  4 +}
  5 +.table-header{
  6 + width: 100%;
  7 + position: fixed;
  8 + left: 0;
  9 + right: 0;
  10 + background-color: #ffffff;
  11 + height: 120rpx;
  12 + line-height: 120rpx;
  13 + z-index: 10;
  14 + font-size: 34rpx;
  15 +}
  16 +.pages{
  17 + margin-top: 120rpx;
  18 + background-color: #F5F5F5;
  19 +}
  20 +.td1{
  21 + margin-left: 40rpx;
  22 +}
  23 +.td4{
  24 + margin-right: 40rpx;
  25 + min-width: 68rpx;
  26 +}
  27 +.td1,.td2{
  28 + width: 170rpx;
  29 + min-width: 170rpx;
  30 + text-align: left;
  31 + padding-right: 38rpx;
  32 +}
  33 +.td3{
  34 + width: 100%;
  35 + text-align: left;
  36 +}
  37 +.td1,.td2{
  38 + max-height: 80rpx;
  39 + overflow: hidden;
  40 +}
  41 +.date{
  42 + background-color: #F5F5F5;
  43 + height: 60rpx;
  44 + line-height: 60rpx;
  45 + font-size: 26rpx;
  46 + width: 100%;
  47 + text-indent: 40rpx;
  48 +}
  49 +.table-tr{
  50 + background-color: #ffffff;
  51 + font-size: 30rpx;
  52 + height: 160rpx;
  53 + width: 100%;
  54 +}
  55 +.hasMore{
  56 + height: 100rpx;
  57 + line-height: 100rpx;
  58 + font-size: 30rpx;
  59 + color: #aaaaaa;
  60 +}
  61 +.table-body .td4{
  62 + color:#199095;
  63 +}
  1 +// pages/book/setting/index.js
  2 +import util from '../../../utils/util';
  3 +import App from '../../../utils/api';
  4 +const {regeneratorRuntime} = global
  5 +Page({
  6 +
  7 + /**
  8 + * 页面的初始数据
  9 + */
  10 + data: {},
  11 +
  12 + /**
  13 + * 生命周期函数--监听页面加载
  14 + */
  15 +
  16 + onLoad: function (options) {
  17 +
  18 + },
  19 +
  20 + /**
  21 + * 生命周期函数--监听页面初次渲染完成
  22 + */
  23 + onReady: function () {
  24 +
  25 + },
  26 +
  27 + /**
  28 + * 生命周期函数--监听页面显示
  29 + */
  30 + onShow: function () {
  31 +
  32 + },
  33 +
  34 + /**
  35 + * 生命周期函数--监听页面隐藏
  36 + */
  37 + onHide: function () {
  38 +
  39 + },
  40 +})
  1 +{
  2 + "backgroundTextStyle":"light",
  3 + "navigationBarBackgroundColor": "#fff",
  4 + "navigationBarTextStyle":"white",
  5 + "usingComponents": {
  6 + "nav":"/components/nav/nav",
  7 + "formids":"/components/formids/formids",
  8 + "tabBar":"/components/manager-invitation/tabBar/tabBar"
  9 + }
  10 +}
  1 +<!--pages/book/setting/index.wxml-->
  2 +<nav id="nav" backgroundColor="#199095" color="#fefefe">我的</nav>
  3 +<view class="header">
  4 + <view class="info flex-ll">
  5 + <view class="avatar">
  6 + <open-data type="userAvatarUrl"></open-data>
  7 + </view>
  8 + <view class="nick"><open-data type="userNickName"></open-data></view>
  9 + </view>
  10 +</view>
  11 +<view class="page">
  12 + <formids url="/pages/manager-invitation/setting/sellers">
  13 + <view class="row flex-lr">
  14 + <view>我工作的店铺</view>
  15 + <view class="flex-rr">
  16 + <view class="more"></view>
  17 + </view>
  18 + </view>
  19 + </formids>
  20 + <formids url="/pages/manager-invitation/setting/history">
  21 + <view class="row flex-lr" style="padding-top: 34rpx;">
  22 + <view>通知客户记录</view>
  23 + <view class="flex-rr">
  24 + <view class="more"></view>
  25 + </view>
  26 + </view>
  27 + </formids>
  28 + <formids url="/pages/manager-invitation/crm/index">
  29 + <view class="row flex-lr" style="padding-top: 34rpx;">
  30 + <view>我的客户</view>
  31 + <view class="flex-rr">
  32 + <view class="more"></view>
  33 + </view>
  34 + </view>
  35 + </formids>
  36 + <formids url="/pages/customer/index?islove=customer">
  37 + <view class="row flex-lr" style="padding-top: 34rpx;">
  38 + <view>切换到顾客模式</view>
  39 + <view class="flex-rr">
  40 + <view class="more"></view>
  41 + </view>
  42 + </view>
  43 + </formids>
  44 +</view>
  45 +<tabBar></tabBar>
  1 +/* pages/book/setting/index.wxss */
  2 +/*
  3 +http://qn.colorcun.com/custom/lite-yd/image/icon-zk.png
  4 +http://qn.colorcun.com/custom/lite-yd/image/icon-cz.png
  5 +*/
  6 +.header{
  7 + background-color: #199095;
  8 + margin-top: -2rpx;
  9 +}
  10 +.header .info{
  11 + color:#FEFEFE;
  12 + width: 90%;
  13 + padding-top: 60rpx;
  14 + margin: 0 auto;
  15 + padding-bottom: 60rpx;
  16 +}
  17 +.header .info .nick{
  18 + font-size: 40rpx;
  19 + height: 80rpx;
  20 + line-height: 80rpx;
  21 +}
  22 +.avatar{
  23 + width: 80rpx;
  24 + height: 80rpx;
  25 + border-radius: 50%;
  26 + overflow: hidden;
  27 + margin-right: 20rpx;
  28 +}
  29 +.page{
  30 + width: 90%;
  31 + margin: 0 auto;
  32 + color: #353535;
  33 + padding-top: 34rpx;
  34 +}
  35 +.row{
  36 + font-size: 34rpx;
  37 + height: 106rpx;
  38 + border-bottom: 2rpx solid #F1F0F4;
  39 +}
  40 +.row .right{
  41 + font-size: 30rpx;
  42 + color:#999999;
  43 +}
  44 +.row .more{
  45 + margin-left: 20rpx;
  46 +}
  1 +// pages/manager-invitation/editor.js
  2 +import util from '../../../utils/util';
  3 +import App from '../../../utils/api';
  4 +const {regeneratorRuntime} = global
  5 +Page({
  6 +
  7 + /**
  8 + * 页面的初始数据
  9 + */
  10 + data: {
  11 + hasSubmit:false,
  12 + form:{
  13 + id:'',
  14 + name:'',
  15 + address:'',
  16 + lat:'',
  17 + long:'',
  18 + is_default:'',
  19 + },
  20 + },
  21 +
  22 + /**
  23 + * 生命周期函数--监听页面加载
  24 + */
  25 + onLoad: function (options) {
  26 + if(options.seller){
  27 + this.setData({
  28 + form:JSON.parse(options.seller),
  29 + })
  30 + }
  31 +
  32 + },
  33 + /**
  34 + * 生命周期函数--监听页面初次渲染完成
  35 + */
  36 + onReady: function () {
  37 +
  38 + },
  39 +
  40 + /**
  41 + * 生命周期函数--监听页面显示
  42 + */
  43 + onShow: function () {
  44 +
  45 + },
  46 +
  47 + /**
  48 + * 生命周期函数--监听页面隐藏
  49 + */
  50 + onHide: function () {
  51 +
  52 + },
  53 +
  54 + /**
  55 + * 生命周期函数--监听页面卸载
  56 + */
  57 + onUnload: function () {
  58 +
  59 + },
  60 +
  61 + /**
  62 + * 页面相关事件处理函数--监听用户下拉动作
  63 + */
  64 + onPullDownRefresh: function () {
  65 +
  66 + },
  67 +
  68 + /**
  69 + * 页面上拉触底事件的处理函数
  70 + */
  71 + onReachBottom: function () {
  72 +
  73 + },
  74 + checkHasSubmit(){
  75 + let form=this.data.form;
  76 + let flag=false;
  77 + if(
  78 + form.name
  79 + && form.address
  80 + && form.lat>0
  81 + ){
  82 + flag=true;
  83 + }
  84 + this.setData({
  85 + hasSubmit:flag
  86 + })
  87 + return flag;
  88 + },
  89 + input(e){
  90 + console.log(e);
  91 + let key=util.attr(e,'key');
  92 + if(key=='address' && !(this.data.form.lat>0)){
  93 + return this.onChangeAddress()
  94 + }
  95 + let val=util.val(e);
  96 + if(typeof val=='String'){
  97 + val=val.trim();
  98 + }
  99 + let form=this.data.form;
  100 + form[key]=val;
  101 + this.setData({
  102 + form:form,
  103 + })
  104 + this.checkHasSubmit()
  105 + },
  106 + submit(){
  107 + if(!this.checkHasSubmit()){
  108 + let msg='请完善信息';
  109 + if(this.data.form.lat<1){
  110 + msg='请标注店铺位置'
  111 + }
  112 + return util.toast(msg,'none')
  113 + }
  114 + let param={
  115 + openid:getApp().openid,
  116 + sid:this.data.form.id,
  117 + sname:this.data.form.name,
  118 + address:this.data.form.address,
  119 + lat:this.data.form.lat,
  120 + long:this.data.form.long,
  121 + is_default:(this.data.form.is_default==true || this.data.form.is_default==1)?1:0,
  122 + }
  123 + App.Invitation.SetSellerInfo(param).then(res=>{
  124 + wx.navigateBack();
  125 + })
  126 + },
  127 + onChangeAddress(){
  128 + wx.chooseLocation({
  129 + success: (res)=> {
  130 + console.log(res);
  131 + this.setData({
  132 + [`form.lat`]:res.latitude,
  133 + [`form.long`]:res.longitude,
  134 + [`form.address`]:res.name,
  135 + })
  136 + this.checkHasSubmit()
  137 + },
  138 + fail: function (err) {
  139 + console.log(err)
  140 + }
  141 + });
  142 + },
  143 +})
  1 +{
  2 + "navigationBarBackgroundColor": "#ffffff",
  3 + "navigationBarTextStyle": "black",
  4 + "navigationBarTitleText":"订座详情",
  5 + "usingComponents": {
  6 + "userinfo": "/components/userinfo/userinfo",
  7 + "nav":"/components/nav/nav",
  8 + "formids":"/components/formids/formids"
  9 + }
  10 +}
  1 +<!--pages/manager-invitation/editor.wxml-->
  2 +<nav>工作的店铺</nav>
  3 +<view class="pages">
  4 + <view class="base block">
  5 + <view class="item Medium">店铺信息</view>
  6 + <view class="item flex-ll">
  7 + <input value="{{form.name}}" bindinput="input"
  8 + data-key="name"
  9 + placeholder="请输入店铺名称" placeholder-class="placeholder-class"/>
  10 + </view>
  11 + <view class="item flex-ll">
  12 + <input value="{{form.address}}"
  13 + bindinput="input" bindfocus="input"
  14 + data-key="address"
  15 + placeholder="请输入店铺地址" placeholder-class="placeholder-class"/>
  16 + <view class="caddr flex-rr" bindtap="onChangeAddress">
  17 + <image src="http://qn.colorcun.com/manager-invitation/wx/caddr.png" style="width: 28rpx; height: 36rpx;"></image>
  18 + </view>
  19 + </view>
  20 + <view class="item flex-lr">
  21 + 设置为默认地址
  22 + <switch checked="{{form.is_default==1}}" bindchange="input" data-key="is_default" />
  23 + </view>
  24 + </view>
  25 + <formids bindclick="submit" style="width: 100%;">
  26 + <view class="submit {{hasSubmit?'submit-active':''}}">确定</view>
  27 + </formids>
  28 +</view>
  1 +/* pages/manager-invitation/editor.wxss */
  2 +page{
  3 + background-color: #F5F5F5;
  4 +}
  5 +.pages{
  6 + background-color: #F5F5F5;
  7 + font-size: 34rpx;
  8 + padding-top: 20rpx;
  9 + padding-bottom: 160rpx;
  10 +}
  11 +.block{
  12 + width: 94%;
  13 + margin: 0 auto;
  14 + border-radius: 8rpx;
  15 + background-color: #FEFEFE;
  16 +}
  17 +.base .item{
  18 + height: 140rpx;
  19 + line-height: 140rpx;
  20 + width: 94%;
  21 + margin: 0 auto;
  22 + border-bottom: 2rpx solid #F1F0F4;
  23 +}
  24 +.item input{
  25 + width: 100%;
  26 +}
  27 +.base .item:last-child{
  28 + border-width: 0;
  29 +}
  30 +.upload{
  31 + margin-top: 20rpx;
  32 + height: 310rpx;
  33 +}
  34 +.image{
  35 + width: 220rpx;
  36 + height: 220rpx;
  37 + border: 2rpx #E0E0E0 dashed;
  38 + margin-top: 20rpx;
  39 +}
  40 +.image image{
  41 + width: 100%;
  42 + height: 100%;
  43 +}
  44 +.text{
  45 + margin-top: 20rpx;
  46 + font-size: 28rpx;
  47 + color: #999999;
  48 +}
  49 +.submit{
  50 + position: fixed;
  51 + bottom: 30rpx;
  52 + left: 0;
  53 + right:0;
  54 + margin: 0 auto;
  55 + height: 84rpx;
  56 + line-height: 84rpx;
  57 + width: 90%;
  58 + background-color: #74BBBE;
  59 + border-radius: 10rpx;
  60 + color: #FEFEFE;
  61 +}
  62 +.submit-active{
  63 + background-color: #199095;
  64 +}
  65 +.quick{
  66 + height: 50rpx;
  67 + line-height: 50rpx;
  68 + width: 140rpx;
  69 + background-color: #46A5A9;
  70 + font-size: 28rpx;
  71 + color: #FEFEFE;
  72 + text-align: center;
  73 + min-width: 140rpx;
  74 +}
  75 +.placeholder-class{
  76 + color: #999999;
  77 +}
  78 +.caddr{
  79 + width: 140rpx;
  80 + min-width: 140rpx;
  81 + height: 140rpx;
  82 + line-height: 140rpx;
  83 +}
  1 +// pages/manager-invitation/setting/sellers.js
  2 +import util from '../../../utils/util';
  3 +import App from '../../../utils/api';
  4 +const {regeneratorRuntime} = global
  5 +import PubSub from '../../../utils/PubSub'
  6 +Page({
  7 +
  8 + /**
  9 + * 页面的初始数据
  10 + */
  11 + data: {
  12 + sellers:[],
  13 + },
  14 +
  15 + /**
  16 + * 生命周期函数--监听页面加载
  17 + */
  18 + options:{},
  19 + onLoad: function (options) {
  20 + this.options=options
  21 + },
  22 +
  23 + /**
  24 + * 生命周期函数--监听页面初次渲染完成
  25 + */
  26 + onReady: function () {
  27 +
  28 + },
  29 +
  30 + /**
  31 + * 生命周期函数--监听页面显示
  32 + */
  33 + onShow: function () {
  34 + App.Invitation.GetSellerList({openid:getApp().openid}).then(res=>{
  35 + this.setData({
  36 + sellers:res.data,
  37 + })
  38 + })
  39 + },
  40 +
  41 + /**
  42 + * 生命周期函数--监听页面隐藏
  43 + */
  44 + onHide: function () {
  45 +
  46 + },
  47 +
  48 + /**
  49 + * 生命周期函数--监听页面卸载
  50 + */
  51 + onUnload: function () {
  52 +
  53 + },
  54 +
  55 + /**
  56 + * 页面相关事件处理函数--监听用户下拉动作
  57 + */
  58 + onPullDownRefresh: function () {
  59 +
  60 + },
  61 +
  62 + /**
  63 + * 页面上拉触底事件的处理函数
  64 + */
  65 + onReachBottom: function () {
  66 +
  67 + },
  68 + sellerEditor(e){
  69 + let i=util.attr(e,'index');
  70 + let sel=this.data.sellers[i];
  71 + if(this.options.hasQuick){
  72 + PubSub.emit(
  73 + 'quick',
  74 + sel
  75 + )
  76 + wx.navigateBack();
  77 + }else{
  78 + wx.navigateTo({
  79 + url:'/pages/manager-invitation/setting/seller-editor?seller='+JSON.stringify(sel)
  80 + })
  81 + }
  82 + },
  83 +})
  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 +<!--pages/manager-invitation/setting/sellers.wxml-->
  2 +<nav>我工作的店铺</nav>
  3 +<view style="background-color: #F5F5F5;height: 2rpx;width: 100%;"></view>
  4 +<view class="pages" wx:if="{{sellers.length>0}}">
  5 + <block wx:for="{{sellers}}" wx:key="sellers.key">
  6 + <formids bindclick="sellerEditor" data-index="{{index}}">
  7 + <view class="seller {{item.is_default==1?'active':''}}">
  8 + <view class="name">{{item.name}}</view>
  9 + <view class="addr">{{item.address}}</view>
  10 + <view class="default" wx:if="{{item.is_default==1}}">默认</view>
  11 + </view>
  12 + </formids>
  13 + </block>
  14 +</view>
  15 +<view class="pages flex-vc" wx:else="">
  16 + <image src="http://qn.colorcun.com/custom/lite-online/image/follow-empty.png" class="empty-image"></image>
  17 + <view class="empty-text">您还没有添加工作店铺</view>
  18 + <formids url="./seller-editor" style="width: 110%">
  19 + <view class="create-but">立即添加</view>
  20 + </formids>
  21 +</view>
  22 +<formids url="./seller-editor" wx:if="{{sellers.length>0}}">
  23 + <view class="create">
  24 + <view class="create-but">立即添加</view>
  25 + </view>
  26 +</formids>
  1 +/* pages/manager-invitation/setting/sellers.wxss */
  2 +.pages{
  3 + width: 90%;
  4 + margin: 0 auto;
  5 + padding-top: 40rpx;
  6 + padding-bottom: 150rpx;
  7 +}
  8 +.seller{
  9 + margin-bottom: 40rpx;
  10 + border: 2rpx solid #999999;
  11 + border-radius: 10rpx;
  12 + width: 100%;
  13 + height: 200rpx;
  14 + color:#353535;
  15 + position: relative;
  16 +}
  17 +.name{
  18 + font-size: 34rpx;
  19 + width: 90%;
  20 + margin: 30rpx auto 0;
  21 + height: 48rpx;
  22 + line-height: 48rpx;
  23 + text-align: left;
  24 +}
  25 +.addr{
  26 + font-size: 30rpx;
  27 + width: 90%;
  28 + margin: 8rpx auto 0;
  29 + line-height: 40rpx;
  30 + text-align: left;
  31 +}
  32 +
  33 +.seller.active{
  34 + background-color: #199095;
  35 + border: 2rpx solid #199095;
  36 + color:#FEFEFE;
  37 +}
  38 +.default{
  39 + background-color: #F05522;
  40 + color:#fefefe;
  41 + font-size: 28rpx;
  42 + height: 40rpx;
  43 + width: 90rpx;
  44 + position: absolute;
  45 + top: -2rpx;
  46 + right: -2rpx;
  47 + border-radius: 26rpx 10rpx 0 26rpx;
  48 + text-align: center;
  49 + line-height: 40rpx;
  50 +}
  51 +.create{
  52 + position: fixed;
  53 + bottom: 0rpx;
  54 + height: 150rpx;
  55 + line-height: 150rpx;
  56 + background-color: #ffffff;
  57 + width: 100%;
  58 + font-size: 34rpx;
  59 +}
  60 +.create-but{
  61 + height: 84rpx;
  62 + line-height: 84rpx;
  63 + border-radius: 10rpx;
  64 + background-color: #199095;
  65 + color: #fefefe;
  66 + width: 90%;
  67 + margin: 40rpx auto;
  68 + font-size: 34rpx;
  69 + text-align: center;
  70 +}
  71 +.empty-image{
  72 + margin-top: 200rpx;
  73 + width: 382rpx;
  74 + height: 316rpx;
  75 +}
  76 +.empty-text{
  77 + margin-top: 86rpx;
  78 + font-size: 28rpx;
  79 + margin-bottom: 220rpx;
  80 +}
  1 +.bg-1{
  2 + background-image: url("http://qn.colorcun.com/custom/lite-yd/image/invit-bg.png");
  3 + background-color: #353334;
  4 + color:#fefefe;
  5 +}
  6 +.bg-2{
  7 + background-image: url("http://qn.colorcun.com/manager-invitation/wx/%E5%BA%95%E9%83%A8.png");
  8 + background-color: #F4AFB2;
  9 +}
  10 +
  11 +
  12 +.invit-logo{
  13 + width: 380rpx;
  14 + height: 200rpx;
  15 + position: relative;
  16 + background-size: 100%;
  17 +}
  18 +.shangwu-line{
  19 + background-image: url("http://qn.colorcun.com/manager-invitation/wx2/%E5%95%86%E5%8A%A1%E7%BA%BF%E6%9D%A1.png");
  20 + background-size: 100% 100%;
  21 + width: 604rpx;
  22 + height: 30rpx;
  23 + margin-top: 60rpx;
  24 +}
  25 +.seller{
  26 + margin-top: 60rpx;
  27 + width: 100%;
  28 +}
  29 +.seller .title{
  30 + font-size: 28rpx;
  31 + color:#999999;
  32 + margin-bottom: 10rpx;
  33 + height: 40rpx;
  34 + line-height: 40rpx;
  35 +}
  36 +.seller .title-left,.seller .title-right{
  37 + width: 44rpx;
  38 + height: 4rpx;
  39 + background-size: 100%;
  40 +}
  41 +.seller .title-left{
  42 + background-image: url("http://qn.colorcun.com/manager-invitation/wx2/%E8%8A%B1%E7%BA%B9-%E5%B7%A6%E8%BE%B9.png");
  43 + margin-right: 10rpx;
  44 +}
  45 +.seller .title-right{
  46 + margin-left: 10rpx;
  47 + background-image: url("http://qn.colorcun.com/manager-invitation/wx2/%E8%8A%B1%E7%BA%B9-%E5%8F%B3.png");
  48 +}
  49 +.seller .content{
  50 + margin-bottom: 60rpx;
  51 + font-size: 36rpx;
  52 + line-height: 50rpx;
  53 + text-align: center;
  54 + align-items:flex-start;
  55 + width: 90%;
  56 +}
  57 +.seller .content:last-child{
  58 + margin-bottom: 0;
  59 +}
  60 +.seller .addr{
  61 + width: 80%;
  62 +}
  63 +.seller .invit-addr{
  64 + width: 22rpx;
  65 + height: 28rpx;
  66 + margin-right: 10rpx;
  67 + margin-top: 14rpx;
  68 + min-width: 22rpx;
  69 +}
  70 +
  71 +.editor{
  72 + height:80rpx;
  73 + width: 504rpx;
  74 + background-image: url("http://qn.colorcun.com/manager-invitation/wx2/%E4%BF%AE%E6%94%B9%E5%86%85%E5%AE%B92.png");
  75 + background-size: 100%;
  76 +}
  77 +.shangwu{
  78 + width: 100%;
  79 +}
  80 +.shangwu .seller{
  81 + margin-bottom: 54rpx;
  82 +}
  83 +.wenxin {
  84 + margin-top: 20rpx;
  85 + width: 100%;
  86 +}
  87 +
  88 +.wenxin-top{
  89 + position: fixed;
  90 + top:0;
  91 + left:0;
  92 + width:100%;
  93 + height: 80rpx;
  94 + background-image: url("http://qn.colorcun.com/manager-invitation/wx/%E9%A1%B6%E9%83%A8%E8%8A%B1%E8%BE%B9.png");
  95 + background-size: 100%;
  96 +}
  97 +.wenxin-bottom{
  98 + position: fixed;
  99 + bottom:0;
  100 + left:0;
  101 + width:100%;
  102 + height: 64rpx;
  103 + background-image: url("http://qn.colorcun.com/manager-invitation/wx/%E8%8A%B1%E8%BE%B9-%E5%BA%95%E9%83%A8.png");
  104 + background-size: 100%;
  105 +}
  106 +.wenxin .invit-logo{
  107 + width: 350rpx;
  108 + height: 184rpx;
  109 +}
  110 +.wenxin-mask{
  111 + margin-top: 0rpx;
  112 + width: 528rpx;
  113 + height: 520rpx;
  114 + position: relative;
  115 +}
  116 +.wenxin-mask-bg{
  117 + margin: 46rpx auto;
  118 + width: 468rpx;
  119 + height: 468rpx;
  120 + border-radius: 50%;
  121 + overflow: hidden;
  122 + background-image: url("http://qn.colorcun.com/manager-invitation/wx/hunshazhao3.jpg");
  123 + background-size: cover;
  124 +}
  125 +.wenxin-mask-img{
  126 + position: absolute;
  127 + left: 0;
  128 + top:0;
  129 + background-image: url("http://qn.colorcun.com/manager-invitation/wx/%E8%8A%B1%E7%8E%AF%E7%A9%BA.png");
  130 + width: 100%;
  131 + height: 520rpx;
  132 + background-size: 100%;
  133 +}
  134 +.wenxin-baitou{
  135 + margin-top: 10rpx;
  136 + width: 404rpx;
  137 + height: 42rpx;
  138 + background-size: 100%;
  139 + 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");
  140 +}
  141 +.wenxin-line{
  142 + margin-top: 16rpx;
  143 + width: 600rpx;
  144 + height: 30rpx;
  145 + background-size: 100%;
  146 + background-image: url("http://qn.colorcun.com/manager-invitation/wx2/%E6%B8%A9%E9%A6%A8%E7%BA%BF%E6%9D%A1.png");
  147 +}
  148 +.wenxin .seller{
  149 + margin-top: 16rpx;
  150 + color:#fefefe;
  151 +}
  152 +.wenxin .seller .title{
  153 + display: none;
  154 +}
  155 +.wenxin .seller .content{
  156 + margin-bottom: 16rpx;
  157 + font-size: 36rpx;
  158 + line-height: 50rpx;
  159 + text-align: center;
  160 + align-items:flex-start;
  161 +}
  162 +.wenxin .seller .content.addr{
  163 + width: 90%;
  164 +}
  165 +.quick-editor{
  166 + background-color: #ECD9B7;
  167 + width: 120rpx;
  168 + height: 40rpx;
  169 + line-height: 40rpx;
  170 + color: #353535;
  171 + font-size: 24rpx;
  172 + position: absolute;
  173 + top:50rpx;
  174 + right:-150rpx;
  175 + text-align: center;
  176 +}
  177 +
  178 +.buts-share{
  179 + width: 560rpx;
  180 + height: 86rpx;
  181 + margin: 0 auto;
  182 + background-image: url("http://qn.colorcun.com/manager-invitation/wx2/%E9%80%9A%E7%9F%A5%E5%AE%A2%E6%88%B72.png");
  183 + background-size: 100%;
  184 + background-repeat: no-repeat;
  185 + background-position: center center;
  186 + position: relative;
  187 +}
  188 +.animation{
  189 + animation-name: butAnimation;
  190 + animation-duration: 0.7s;
  191 + animation-iteration-count:9999;
  192 +}
  193 +@keyframes butAnimation
  194 +{
  195 + 50% {background-size:90%;}
  196 +}
  197 +@-webkit-keyframes butAnimation
  198 +{
  199 + 50% {background-size:90%;}
  200 +}
@@ -9,16 +9,21 @@ Page({ @@ -9,16 +9,21 @@ Page({
9 */ 9 */
10 data: { 10 data: {
11 hasSellerBook:false, 11 hasSellerBook:false,
  12 + hasManagerInvitation:false,
12 }, 13 },
13 /** 14 /**
14 * 生命周期函数--监听页面加载 15 * 生命周期函数--监听页面加载
15 */ 16 */
16 onLoad: function (options) { 17 onLoad: function (options) {
17 - App.Reserve.SellerForOpenid({openid:getApp().openid}).then(res=>{  
18 - if(res.data && res.data.seller_id) { 18 + App.Invitation.UserIdentity({openid:getApp().openid}).then(res=>{
  19 + if(res.data.identity==1) {//商户
19 this.setData({ 20 this.setData({
20 hasSellerBook: res.data, 21 hasSellerBook: res.data,
21 }) 22 })
  23 + }else if(res.data.identity==2){//客户经理
  24 + this.setData({
  25 + hasManagerInvitation: true,
  26 + })
22 } 27 }
23 }) 28 })
24 }, 29 },
@@ -39,5 +39,13 @@ @@ -39,5 +39,13 @@
39 </view> 39 </view>
40 </view> 40 </view>
41 </formids> 41 </formids>
  42 + <formids url="/pages/manager-invitation/review" wx:if="{{hasManagerInvitation}}">
  43 + <view class="item flex-lr">
  44 + <view class="left">客户经理模式</view>
  45 + <view class="right">
  46 + <image src="http://qn.colorcun.com/custom/lite-yd/image/click.png"></image>
  47 + </view>
  48 + </view>
  49 + </formids>
42 </view> 50 </view>
43 </view> 51 </view>
@@ -31,7 +31,7 @@ @@ -31,7 +31,7 @@
31 "list": [] 31 "list": []
32 }, 32 },
33 "miniprogram": { 33 "miniprogram": {
34 - "current": 25, 34 + "current": 43,
35 "list": [ 35 "list": [
36 { 36 {
37 "id": 0, 37 "id": 0,
@@ -349,6 +349,55 @@ @@ -349,6 +349,55 @@
349 "pathName": "pages/me/follow", 349 "pathName": "pages/me/follow",
350 "query": "", 350 "query": "",
351 "scene": null 351 "scene": null
  352 + },
  353 + {
  354 + "id": -1,
  355 + "name": "pages/manager-invitation/index",
  356 + "pathName": "pages/manager-invitation/index",
  357 + "query": "id=154",
  358 + "scene": null
  359 + },
  360 + {
  361 + "id": 43,
  362 + "name": "pages/manager-invitation/review",
  363 + "pathName": "pages/manager-invitation/review",
  364 + "query": "",
  365 + "scene": null
  366 + },
  367 + {
  368 + "id": 44,
  369 + "name": "pages/manager-invitation/editor",
  370 + "pathName": "pages/manager-invitation/editor",
  371 + "query": "tplid=1&rid=",
  372 + "scene": null
  373 + },
  374 + {
  375 + "id": 45,
  376 + "name": "pages/manager-invitation/display",
  377 + "pathName": "pages/manager-invitation/display",
  378 + "query": "rid=46&tplid=1&fromid=oB-xJ5KJCIasaEdgMRckqoL1cwg8&hasSellerShare=",
  379 + "scene": null
  380 + },
  381 + {
  382 + "id": -1,
  383 + "name": "pages/manager-invitation/setting/index",
  384 + "pathName": "pages/manager-invitation/setting/index",
  385 + "query": "",
  386 + "scene": null
  387 + },
  388 + {
  389 + "id": -1,
  390 + "name": "pages/manager-invitation/setting/sellers",
  391 + "pathName": "pages/manager-invitation/setting/sellers",
  392 + "query": "",
  393 + "scene": null
  394 + },
  395 + {
  396 + "id": -1,
  397 + "name": "pages/manager-invitation/setting/history",
  398 + "pathName": "pages/manager-invitation/setting/history",
  399 + "query": "",
  400 + "scene": null
352 } 401 }
353 ] 402 ]
354 } 403 }
@@ -21,7 +21,7 @@ const server_host=uri_dc.HOST__LINE; @@ -21,7 +21,7 @@ const server_host=uri_dc.HOST__LINE;
21 * @param timeout 接口超时 21 * @param timeout 接口超时
22 * @returns {Promise} 22 * @returns {Promise}
23 */ 23 */
24 -function rpc(host='',act,data={},fouce=false,header={},silence=true,cachetime=0,timeout=api_timeout){ 24 +function rpc(host='',act,data={},fouce=false,header={},silence=true,cachetime=0,timeout=api_timeout,api={}){
25 host=host?host:server_host; 25 host=host?host:server_host;
26 let param=""; 26 let param="";
27 for(let key in data){ 27 for(let key in data){
@@ -69,6 +69,9 @@ function rpc(host='',act,data={},fouce=false,header={},silence=true,cachetime=0, @@ -69,6 +69,9 @@ function rpc(host='',act,data={},fouce=false,header={},silence=true,cachetime=0,
69 sid:enter_params.seller_id, 69 sid:enter_params.seller_id,
70 }) 70 })
71 } 71 }
  72 + if(api.openid){
  73 + data[api.openid]=data[api.openid]||openid;
  74 + }
72 wx.request({ 75 wx.request({
73 url: host+act, 76 url: host+act,
74 method: 'POST', 77 method: 'POST',
@@ -125,7 +128,7 @@ function __api(){ @@ -125,7 +128,7 @@ function __api(){
125 tmpApi[keys[0]][keys[1]][keys[2]]=function(data,fouce=false,header){ 128 tmpApi[keys[0]][keys[1]][keys[2]]=function(data,fouce=false,header){
126 //console.log('api[key].host',api[key].host); 129 //console.log('api[key].host',api[key].host);
127 return rpc(api[key].host,api[key].alias||key,data,fouce,header, 130 return rpc(api[key].host,api[key].alias||key,data,fouce,header,
128 - api[key].silence,api[key].cachetime,api[key].timeout); 131 + api[key].silence,api[key].cachetime,api[key].timeout,api[key]);
129 } 132 }
130 } 133 }
131 for(let xkey in uri_dc){ 134 for(let xkey in uri_dc){
@@ -143,7 +146,7 @@ function __api(){ @@ -143,7 +146,7 @@ function __api(){
143 tmpApi[keys[0]][keys[1]][keys[2]]=function(data,fouce=false,header){ 146 tmpApi[keys[0]][keys[1]][keys[2]]=function(data,fouce=false,header){
144 //console.log('api[key].host',api[key]); 147 //console.log('api[key].host',api[key]);
145 return rpc(api[key].host,api[key].alias||key,data,fouce,header, 148 return rpc(api[key].host,api[key].alias||key,data,fouce,header,
146 - api[key].silence,api[key].cachetime,api[key].timeout); 149 + api[key].silence,api[key].cachetime,api[key].timeout,api[key]);
147 } 150 }
148 } 151 }
149 } 152 }
@@ -178,4 +178,61 @@ export default { @@ -178,4 +178,61 @@ export default {
178 178
179 //顾客收藏的店铺列表 179 //顾客收藏的店铺列表
180 'App.Customer.GetCollectionSellerList':null, 180 'App.Customer.GetCollectionSellerList':null,
  181 +
  182 + /**
  183 + * 邀请函
  184 + */
  185 + //根据订座的openid 获取当前用户身份
  186 + 'App.Invitation.UserIdentity':{
  187 + openid:'openid',
  188 + },
  189 +
  190 + //增加客户经理基本信息
  191 + 'App.Invitation.AddInvitationUser':{
  192 + openid:'openid',
  193 + },
  194 +
  195 + //获取商家列表
  196 + 'App.Invitation.GetSellerList':{
  197 + //cachetime: -1,
  198 + openid:'openid',
  199 + },
  200 +
  201 + //编辑、增加商家信息
  202 + 'App.Invitation.SetSellerInfo':{
  203 + openid:'openid',
  204 + },
  205 +
  206 + //修改、录入邀请函信息,同时生成对应的商家信息
  207 + 'App.Invitation.SetInvitationInfo':{
  208 + silence: false,
  209 + openid:'openid',
  210 + },
  211 +
  212 + //邀请函详情
  213 + 'App.Invitation.Detail':null,
  214 +
  215 + //客户经理、预定人、受邀人信息建立
  216 + 'App.Invitation.SetInvitationRel':{
  217 + //cachetime: -1,
  218 + openid:'inviting',
  219 + },
  220 +
  221 + //受邀人同意参加,修改关系状态
  222 + 'App.Invitation.SetInvitationConfirm':{
  223 + openid:'openid',
  224 + },
  225 +
  226 + //根据客户经理openid 获取当前用户所负责的顾客
  227 + 'App.Invitation.Members':{
  228 + openid:'openid',
  229 + },
  230 +
  231 + //根据客户经理openid 获取当前用户预定列表
  232 + 'App.Invitation.InvitationList':{
  233 + openid:'openid',
  234 + },
  235 +
  236 + //上传图片,只能上传单个图片文件
  237 + 'App.Examples_Upload.UploadQn':null,
181 } 238 }
  1 +import util from './util';
  2 +let tpls=[
  3 + {
  4 + id: 1,
  5 + code: 1,
  6 + name: '商务',
  7 + hasImage:false,
  8 + timeStr:'YYYY/MM/DD 星期WW HH:II',
  9 + shareFirstImage:'http://qn.colorcun.com/manager-invitation/wx2/%E9%A2%84%E5%AE%9A%E5%AE%89%E6%8E%92-%E5%95%86%E5%8A%A1.jpg',
  10 + shareImage:'http://qn.colorcun.com/manager-invitation/wx2/%E9%82%80%E8%AF%B7%E5%87%BD-%E5%95%86%E5%8A%A1.jpg',
  11 + },
  12 + {
  13 + id: 2,
  14 + code: 2,
  15 + name: '温馨',
  16 + hasImage:true,
  17 + timeStr:'YYYY年MM月DD日HH时II分',
  18 + shareFirstImage:'http://qn.colorcun.com/manager-invitation/wx2/%E9%A2%84%E5%AE%9A%E5%AE%89%E6%8E%92-%E6%B8%A9%E9%A6%A8.jpg',
  19 + shareImage:'http://qn.colorcun.com/manager-invitation/wx/share-wx.jpg',
  20 + },
  21 +];
  22 +module.exports ={
  23 + tpls(id=''){
  24 + if(id){
  25 + for(let i=0;i<tpls.length;i++){
  26 + if(tpls[i].id==id){
  27 + return tpls[i]
  28 + }
  29 + }
  30 + }
  31 + return tpls;
  32 + },
  33 + pickerData(){
  34 + let now=new Date()/1000;
  35 + let date=[];
  36 + for(let i=0;i<30;i++){
  37 + let time=now+i*86400;
  38 + date.push(util.unixtoTime(time,'MM-DD 星期WW'))
  39 + }
  40 + let daily={
  41 + '午市':'12:00-15:00',
  42 + '晚市':'18:00-21:00',
  43 + };
  44 + let ti=['午市','晚市'];
  45 + let dts=[[],[]];
  46 + ti.forEach((tx,ii)=>{
  47 + let ts=daily[tx].split('-');
  48 + while (ts[0]<=ts[1]){
  49 + dts[ii].push(ts[0]);
  50 + let _dt=ts[0].split(':');
  51 + if(_dt[1]=='30'){
  52 + _dt[0]=parseInt(_dt[0])+1;
  53 + _dt[1]='00';
  54 + }else{
  55 + _dt[0]=parseInt(_dt[0])+0;
  56 + _dt[1]='30';
  57 + }
  58 + _dt[0]=_dt[0]<10?'0'+_dt[0]:_dt[0];
  59 + ts[0]=_dt.join(':');
  60 + }
  61 + })
  62 + return [date,ti,dts]
  63 + return {
  64 + date:date,
  65 + space:ti,
  66 + time:dts,
  67 + }
  68 + },
  69 +}