Showing
6 changed files
with
430 additions
and
335 deletions
pages/book/b_sms_tpls.js
0 → 100644
| 1 | +// pages/book/b_sms.js | ||
| 2 | +import App from '../../utils/api'; | ||
| 3 | +import bcm from '../../utils/bookCommon'; | ||
| 4 | +const {regeneratorRuntime} = global | ||
| 5 | +const tpls = { | ||
| 6 | + SMS_154587043: '${guest},您好!${seller_name}已为您预订${date}的桌位:${region_room_name};地址:${seller_addr},电话:${seller_phone}\n客户经理${cusman},期待您的光临!', | ||
| 7 | + SMS_162733710: '尊敬的贵宾,您好!${reserve_date}的用餐,为您安排在${seller_name_addr_room}房间,${cusman}期待您的光临,预祝就餐愉快!', | ||
| 8 | + SMS_163050401: '尊敬的贵宾,您好!\n ${seller_name}已为您安排${date}的用餐,房间:${region_room_name}; \n地址:${seller_addr}; \n电话:${seller_phone} \n预祝用餐愉快,${cusman}期待您的光临!', | ||
| 9 | +}; | ||
| 10 | + | ||
| 11 | +module.exports ={ | ||
| 12 | + tpls:tpls, | ||
| 13 | + getTableName(tables){ | ||
| 14 | + let bao = [], san = []; | ||
| 15 | + tables.forEach(t => { | ||
| 16 | + if (t.tid == 2) { | ||
| 17 | + bao.push(t.name); | ||
| 18 | + } else { | ||
| 19 | + san.push(t.name); | ||
| 20 | + } | ||
| 21 | + }) | ||
| 22 | + let str = ''; | ||
| 23 | + if (bao.length > 0) { | ||
| 24 | + str = '包厢(' + bao.join('、') + ')'; | ||
| 25 | + } | ||
| 26 | + if (san.length > 0) { | ||
| 27 | + str += san.join('、'); | ||
| 28 | + } | ||
| 29 | + str = str.substr(0, 20); | ||
| 30 | + if (str.indexOf('(') > -1 && str.indexOf(')') < 0) { | ||
| 31 | + str = str.substr(0, 19) + ')'; | ||
| 32 | + } | ||
| 33 | + return str; | ||
| 34 | + }, | ||
| 35 | + getTableNameOne(tables){ | ||
| 36 | + let bao = []; | ||
| 37 | + tables.forEach(t => { | ||
| 38 | + bao.push(t.name); | ||
| 39 | + }) | ||
| 40 | + return bao.join('、'); | ||
| 41 | + }, | ||
| 42 | + getTableNameShort(tables){//短桌位 | ||
| 43 | + let str=tables[0].name; | ||
| 44 | + if(tables.length>1){ | ||
| 45 | + str+='等'+tables.length+'个'; | ||
| 46 | + } | ||
| 47 | + return str; | ||
| 48 | + }, | ||
| 49 | + async getTplMsg(bookInfo,tplcode='SMS_163050401'){ | ||
| 50 | + let smsData = {} | ||
| 51 | + let txa=['早上','中午','晚上'] | ||
| 52 | + let tx=await bcm.getTimeSpaceIndexData(bookInfo.rdate); | ||
| 53 | + switch (tplcode) { | ||
| 54 | + //尊敬的贵宾,您好!(4月6日)(中午)的用餐,为您安排在(好又多复兴路店)(202)房间,(王丽娜)期待您的光临,预祝就餐愉快! | ||
| 55 | + case 'SMS_162733710': | ||
| 56 | + smsData = { | ||
| 57 | + reserve_date: util.unixtoTime(bookInfo.rdate,'MM月DD日') | ||
| 58 | + .replace(/0(\d)/g,function($0,$1){ | ||
| 59 | + return $1; | ||
| 60 | + })+' '+txa[tx.timeIndex], | ||
| 61 | + seller_name_addr_room: this.sc.seller.selleralias+this.getTableNameShort(bookInfo.tables).substr(0, 20), | ||
| 62 | + cusman: (bookInfo.cusman || bookInfo.seller.sellername).substr(0, 20), | ||
| 63 | + } | ||
| 64 | + break; | ||
| 65 | + case 'SMS_163050401': | ||
| 66 | + smsData = { | ||
| 67 | + seller_name: bookInfo.seller.sellername.substr(0, 20), | ||
| 68 | + date: bookInfo.rdateStr.replace('日','日'+txa[tx.timeIndex]), | ||
| 69 | + region_room_name: this.getTableNameOne(bookInfo.tables).substr(0, 20), | ||
| 70 | + seller_addr: (bookInfo.seller.real_address || bookInfo.seller.map_address).substr(0, 20), | ||
| 71 | + seller_phone: bookInfo.seller.phone.substr(0, 20), | ||
| 72 | + cusman: (bookInfo.cusman||'').substr(0, 20), | ||
| 73 | + } | ||
| 74 | + break; | ||
| 75 | + default: | ||
| 76 | + let guest = ''; | ||
| 77 | + if (bookInfo.sex == 3) { | ||
| 78 | + guest = '贵宾' | ||
| 79 | + } else { | ||
| 80 | + guest = bookInfo.rname.substr(0, 1) + (bookInfo.sex == 1 ? '先生' : '女士') | ||
| 81 | + } | ||
| 82 | + smsData = { | ||
| 83 | + guest: guest, | ||
| 84 | + seller_name: bookInfo.seller.sellername.substr(0, 20), | ||
| 85 | + date: bookInfo.rdateStr, | ||
| 86 | + region_room_name: this.getTableName(bookInfo.tables), | ||
| 87 | + reserve_pnum: (bookInfo.pnum || bookInfo.pnum_str) + '人', | ||
| 88 | + seller_addr: (bookInfo.seller.real_address || bookInfo.seller.map_address).substr(0, 20), | ||
| 89 | + seller_phone: bookInfo.seller.phone.substr(0, 20), | ||
| 90 | + cusman: (bookInfo.cusman || bookInfo.seller.sellername).substr(0, 20), | ||
| 91 | + cusman_phone: (bookInfo.cusman_phone || bookInfo.seller.phone).substr(0, 20), | ||
| 92 | + code: bookInfo.code, | ||
| 93 | + } | ||
| 94 | + break; | ||
| 95 | + } | ||
| 96 | + let tpl = this.tpls[tplcode]; | ||
| 97 | + this.smsData = smsData; | ||
| 98 | + tpl = tpl.replace(/\${([^}]+)}/ig, function ($0, $1) { | ||
| 99 | + //console.log($0, $1); | ||
| 100 | + return smsData[$1]; | ||
| 101 | + }) | ||
| 102 | + return tpl | ||
| 103 | + }, | ||
| 104 | +} |
| 1 | // pages/customer/detail_owner.js | 1 | // pages/customer/detail_owner.js |
| 2 | -var mta=require('mta-wechat-analysis') | 2 | +var mta = require('mta-wechat-analysis') |
| 3 | import util from '../../utils/util'; | 3 | import util from '../../utils/util'; |
| 4 | import App from '../../utils/api'; | 4 | import App from '../../utils/api'; |
| 5 | +import TP from '../../utils/tpls'; | ||
| 5 | const {regeneratorRuntime} = global | 6 | const {regeneratorRuntime} = global |
| 7 | +import ST from '../book/b_sms_tpls'; | ||
| 6 | Page({ | 8 | Page({ |
| 7 | 9 | ||
| 8 | - /** | ||
| 9 | - * 页面的初始数据 | ||
| 10 | - */ | ||
| 11 | - data: { | ||
| 12 | - detail:null, | ||
| 13 | - invite_name:'' | ||
| 14 | - }, | ||
| 15 | - id:null, | ||
| 16 | - /** | ||
| 17 | - * 生命周期函数--监听页面加载 | ||
| 18 | - */ | ||
| 19 | - onLoad: function (options) { | ||
| 20 | - this.id=options.id; | ||
| 21 | - let invite_names=wx.getStorageSync('invite_names') ||{}; | ||
| 22 | - let invite_name=invite_names[options.id]; | ||
| 23 | - if(invite_name){ | ||
| 24 | - this.setData({ | ||
| 25 | - invite_name:invite_name | ||
| 26 | - }) | ||
| 27 | - } | ||
| 28 | - mta.Page.init({ | ||
| 29 | - "appID":"500667280", | ||
| 30 | - "eventID":"500667287", | ||
| 31 | - "statPullDownFresh":true, | ||
| 32 | - "statShareApp":true, | ||
| 33 | - "statReachBottom":true, | ||
| 34 | - "lauchOpts":options, //渠道分析 | ||
| 35 | - }); | 10 | + /** |
| 11 | + * 页面的初始数据 | ||
| 12 | + */ | ||
| 13 | + data: { | ||
| 14 | + detail: null, | ||
| 15 | + height: 667, | ||
| 16 | + current: 0, | ||
| 17 | + tpls: [], | ||
| 18 | + seller: { | ||
| 19 | + name: '', | ||
| 20 | + room: '', | ||
| 21 | + date: '', | ||
| 22 | + addr: '' | ||
| 36 | }, | 23 | }, |
| 24 | + options: {tplid: ''}, | ||
| 25 | + hasOwner: true,//是否为发起人 | ||
| 26 | + animation: 'animation', | ||
| 27 | + }, | ||
| 28 | + id: null, | ||
| 29 | + msgTpl:'', | ||
| 30 | + /** | ||
| 31 | + * 生命周期函数--监听页面加载 | ||
| 32 | + */ | ||
| 33 | + onLoad: function (options) { | ||
| 34 | + this.id=options.id | ||
| 35 | + let param={ | ||
| 36 | + options:options, | ||
| 37 | + hasOwner:options.hasSellerShare==1,//是否为发起人 | ||
| 38 | + } | ||
| 39 | + param.tpls=[TP.tpls(options.tplid)] | ||
| 40 | + this.setData(param) | ||
| 41 | + mta.Page.init({ | ||
| 42 | + "appID": "500667280", | ||
| 43 | + "eventID": "500667287", | ||
| 44 | + "statPullDownFresh": true, | ||
| 45 | + "statShareApp": true, | ||
| 46 | + "statReachBottom": true, | ||
| 47 | + "lauchOpts": options, //渠道分析 | ||
| 48 | + }); | ||
| 49 | + }, | ||
| 37 | 50 | ||
| 38 | - /** | ||
| 39 | - * 生命周期函数--监听页面初次渲染完成 | ||
| 40 | - */ | ||
| 41 | - onReady: function () { | 51 | + /** |
| 52 | + * 生命周期函数--监听页面初次渲染完成 | ||
| 53 | + */ | ||
| 54 | + onReady: function () { | ||
| 42 | 55 | ||
| 43 | - }, | 56 | + }, |
| 44 | 57 | ||
| 45 | - /** | ||
| 46 | - * 生命周期函数--监听页面显示 | ||
| 47 | - */ | ||
| 48 | - onShow: function () { | ||
| 49 | - this.getDetail(); | ||
| 50 | - }, | 58 | + /** |
| 59 | + * 生命周期函数--监听页面显示 | ||
| 60 | + */ | ||
| 61 | + onShow: function () { | ||
| 62 | + this.getDetail(); | ||
| 63 | + }, | ||
| 51 | 64 | ||
| 52 | - /** | ||
| 53 | - * 生命周期函数--监听页面隐藏 | ||
| 54 | - */ | ||
| 55 | - onHide: function () { | 65 | + /** |
| 66 | + * 生命周期函数--监听页面隐藏 | ||
| 67 | + */ | ||
| 68 | + onHide: function () { | ||
| 56 | 69 | ||
| 57 | - }, | 70 | + }, |
| 58 | 71 | ||
| 59 | - /** | ||
| 60 | - * 生命周期函数--监听页面卸载 | ||
| 61 | - */ | ||
| 62 | - onUnload: function () { | 72 | + /** |
| 73 | + * 生命周期函数--监听页面卸载 | ||
| 74 | + */ | ||
| 75 | + onUnload: function () { | ||
| 63 | 76 | ||
| 64 | - }, | 77 | + }, |
| 65 | 78 | ||
| 66 | - /** | ||
| 67 | - * 用户点击右上角分享 | ||
| 68 | - */ | ||
| 69 | - onShareAppMessage: function () { | ||
| 70 | - return this.shareSetting(); | ||
| 71 | - }, | ||
| 72 | - getDetail(fouce=false){ | ||
| 73 | - App.Reserve.Detail({ | ||
| 74 | - openid: getApp().openid, | ||
| 75 | - rid: this.id | ||
| 76 | - },fouce).then(res => { | ||
| 77 | - this.setData({ | ||
| 78 | - detail:this.formatDatail(res.data) | ||
| 79 | - }) | ||
| 80 | - }) | ||
| 81 | - }, | ||
| 82 | - formatDatail(detail){ | ||
| 83 | - detail.rdateStr=util.unixtoTime(detail.ddate,'YYYY/MM/DD 星期WW HH:II'); | ||
| 84 | - detail.tableFirst=detail.tables[0].name; | ||
| 85 | - if(detail.tables.length>1){ | ||
| 86 | - detail.tableSubInfo='等'+(detail.tables.length)+'个' | ||
| 87 | - +(detail.tables[0].tid==2?'包间':''); | ||
| 88 | - } | ||
| 89 | - if(detail.sex!=3){ | ||
| 90 | - detail.rnameStr=detail.rname.substr(0,1)+(detail.sex==1?'先生':'女士') | ||
| 91 | - }else{ | ||
| 92 | - detail.rnameStr=detail.rname | ||
| 93 | - } | ||
| 94 | - detail.eatStr='邀请您共进晚餐'; | ||
| 95 | - let hi=util.unixtoTime(detail.ddate,'HHII'); | ||
| 96 | - if(hi<'10:00'){ | ||
| 97 | - detail.eatStr='邀请您共进早餐'; | ||
| 98 | - }else if(hi<'15:00'){ | ||
| 99 | - detail.eatStr='邀请您共进午餐'; | 79 | + /** |
| 80 | + * 用户点击右上角分享 | ||
| 81 | + */ | ||
| 82 | + onShareAppMessage: function () { | ||
| 83 | + return this.shareSetting(); | ||
| 84 | + }, | ||
| 85 | + getDetail(fouce = false){ | ||
| 86 | + App.Reserve.Detail({ | ||
| 87 | + openid: getApp().openid, | ||
| 88 | + rid: this.data.options.id | ||
| 89 | + }, fouce).then(res => { | ||
| 90 | + let tables=[]; | ||
| 91 | + res.data.tables.forEach(t=>{ | ||
| 92 | + tables.push(t.name); | ||
| 93 | + }) | ||
| 94 | + this.setData({ | ||
| 95 | + detail: this.formatDatail(res.data), | ||
| 96 | + seller:{ | ||
| 97 | + name:res.data.seller.sellername, | ||
| 98 | + room:tables.join('、'), | ||
| 99 | + date:util.unixtoTime(res.data.ddate,this.data.tpls[this.data.current].timeStr), | ||
| 100 | + addr:res.data.seller.real_address||res.data.seller.map_address, | ||
| 101 | + image:res.data.image_url, | ||
| 102 | + hasOwner:true, | ||
| 100 | } | 103 | } |
| 104 | + }) | ||
| 105 | + App.Reserve.SellerInfo({seller_id:res.data.seller.id}).then(async sc=>{ | ||
| 106 | + this.msgTpl=await ST.getTplMsg(res.data,sc.data.setting.template_code) | ||
| 107 | + console.log('this.msgTpl',this.msgTpl); | ||
| 108 | + }) | ||
| 109 | + }) | ||
| 110 | + }, | ||
| 111 | + formatDatail(detail){ | ||
| 112 | + detail.rdateStr = util.unixtoTime(detail.ddate, 'YYYY/MM/DD 星期WW HH:II'); | ||
| 113 | + detail.tableFirst = detail.tables[0].name; | ||
| 114 | + if (detail.tables.length > 1) { | ||
| 115 | + detail.tableSubInfo = '等' + (detail.tables.length) + '个' | ||
| 116 | + + (detail.tables[0].tid == 2 ? '包间' : ''); | ||
| 117 | + } | ||
| 118 | + if (detail.sex != 3) { | ||
| 119 | + detail.rnameStr = detail.rname.substr(0, 1) + (detail.sex == 1 ? '先生' : '女士') | ||
| 120 | + } else { | ||
| 121 | + detail.rnameStr = detail.rname | ||
| 122 | + } | ||
| 123 | + detail.eatStr = '邀请您共进晚餐'; | ||
| 124 | + let hi = util.unixtoTime(detail.ddate, 'HHII'); | ||
| 125 | + if (hi < '10:00') { | ||
| 126 | + detail.eatStr = '邀请您共进早餐'; | ||
| 127 | + } else if (hi < '15:00') { | ||
| 128 | + detail.eatStr = '邀请您共进午餐'; | ||
| 129 | + } | ||
| 101 | 130 | ||
| 102 | - // if(!detail.cusman){ | ||
| 103 | - // detail.cusman='vking'; | ||
| 104 | - // detail.cusman_phone='15877556369'; | ||
| 105 | - // detail.cusman_account='wx:vking'; | ||
| 106 | - // } | ||
| 107 | - let ns=new Date()/1000 | ||
| 108 | - detail.hasCancel=detail.status==4 | ||
| 109 | - detail.hasOvered=false | ||
| 110 | - if(!detail.hasCancel){ | ||
| 111 | - detail.hasOvered=ns>detail.ddate || detail.status>=2 | ||
| 112 | - } | ||
| 113 | - return detail; | ||
| 114 | - }, | ||
| 115 | - showManager(){ | ||
| 116 | - if(this.data.detail.cusman_phone || this.data.detail.cusman_account){ | ||
| 117 | - this.selectComponent('#manager').show(); | ||
| 118 | - } | 131 | + // if(!detail.cusman){ |
| 132 | + // detail.cusman='vking'; | ||
| 133 | + // detail.cusman_phone='15877556369'; | ||
| 134 | + // detail.cusman_account='wx:vking'; | ||
| 135 | + // } | ||
| 136 | + let ns = new Date() / 1000 | ||
| 137 | + detail.hasCancel = detail.status == 4 | ||
| 138 | + detail.hasOvered = false | ||
| 139 | + if (!detail.hasCancel) { | ||
| 140 | + detail.hasOvered = ns > detail.ddate || detail.status >= 2 | ||
| 141 | + } | ||
| 142 | + return detail; | ||
| 143 | + }, | ||
| 144 | + showManager(){ | ||
| 145 | + if (this.data.detail.cusman_phone || this.data.detail.cusman_account) { | ||
| 146 | + this.selectComponent('#manager').show(); | ||
| 147 | + } | ||
| 119 | 148 | ||
| 120 | - }, | ||
| 121 | - lookLocation:function(){ | ||
| 122 | - wx.openLocation({ | ||
| 123 | - latitude:Number(this.data.detail.seller.lat), | ||
| 124 | - longitude:Number(this.data.detail.seller.long), | ||
| 125 | - scale:17, | ||
| 126 | - address:this.data.detail.seller.map_address, | ||
| 127 | - success:function (res) { | ||
| 128 | - console.log(res) | ||
| 129 | - } | ||
| 130 | - }) | ||
| 131 | - }, | ||
| 132 | - userinfo(){ | ||
| 133 | - if(!this.data.detail.hasCanSuccess){ | ||
| 134 | - let userInfo=util.cache('userInfo'); | ||
| 135 | - if(userInfo){ | ||
| 136 | - userInfo=JSON.stringify({ | ||
| 137 | - openid: getApp().openid, | ||
| 138 | - avatar: userInfo.avatarUrl, | ||
| 139 | - nickname: userInfo.nickName, | ||
| 140 | - gender: userInfo.gender | ||
| 141 | - }) | ||
| 142 | - } | ||
| 143 | - App.Reserve.SetRelaSuccess({ | ||
| 144 | - rid:this.id, | ||
| 145 | - openid:getApp().openid, | ||
| 146 | - is_agree:1, | ||
| 147 | - userinfo:userInfo | ||
| 148 | - }).then(res=>{ | ||
| 149 | - App.Reserve.Detail({ | ||
| 150 | - openid: getApp().openid, | ||
| 151 | - rid: this.id | ||
| 152 | - },'clear') | ||
| 153 | - wx.navigateTo({ | ||
| 154 | - //id={{detail.id}}&rdate={{detail.rdate}} | ||
| 155 | - url:'remind?id='+this.id+'&rdate='+this.data.detail.rdate, | ||
| 156 | - }); | ||
| 157 | - }) | ||
| 158 | - }else{ | ||
| 159 | - // wx.navigateTo({ | ||
| 160 | - // url:'invite?id='+this.id, | ||
| 161 | - // }); | ||
| 162 | - } | ||
| 163 | - }, | ||
| 164 | - setUserInfoSuccess(){ | ||
| 165 | - util.toast('授权成功,可以继续转发','none'); | ||
| 166 | - }, | ||
| 167 | - toast(){ | ||
| 168 | - util.toast('本区域暂无配送人员','none'); | ||
| 169 | }, | 149 | }, |
| 170 | - reserveCancel(){ | 150 | + lookLocation: function () { |
| 151 | + wx.openLocation({ | ||
| 152 | + latitude: Number(this.data.detail.seller.lat), | ||
| 153 | + longitude: Number(this.data.detail.seller.long), | ||
| 154 | + scale: 17, | ||
| 155 | + address: this.data.detail.seller.map_address, | ||
| 156 | + success: function (res) { | ||
| 157 | + console.log(res) | ||
| 158 | + } | ||
| 159 | + }) | ||
| 160 | + }, | ||
| 161 | + userinfo(){ | ||
| 162 | + if (!this.data.detail.hasCanSuccess) { | ||
| 171 | let userInfo = util.cache('userInfo'); | 163 | let userInfo = util.cache('userInfo'); |
| 172 | if (userInfo) { | 164 | if (userInfo) { |
| 173 | userInfo = JSON.stringify({ | 165 | userInfo = JSON.stringify({ |
| @@ -180,50 +172,101 @@ Page({ | @@ -180,50 +172,101 @@ Page({ | ||
| 180 | App.Reserve.SetRelaSuccess({ | 172 | App.Reserve.SetRelaSuccess({ |
| 181 | rid: this.id, | 173 | rid: this.id, |
| 182 | openid: getApp().openid, | 174 | openid: getApp().openid, |
| 183 | - cancel: 'cancel', | ||
| 184 | - is_agree: 0, | 175 | + is_agree: 1, |
| 185 | userinfo: userInfo | 176 | userinfo: userInfo |
| 186 | }).then(res => { | 177 | }).then(res => { |
| 187 | - this.getDetail(true); | 178 | + App.Reserve.Detail({ |
| 179 | + openid: getApp().openid, | ||
| 180 | + rid: this.id | ||
| 181 | + }, 'clear') | ||
| 182 | + wx.navigateTo({ | ||
| 183 | + //id={{detail.id}}&rdate={{detail.rdate}} | ||
| 184 | + url: 'remind?id=' + this.id + '&rdate=' + this.data.detail.rdate, | ||
| 185 | + }); | ||
| 188 | }) | 186 | }) |
| 189 | - }, | ||
| 190 | - shareSetting(){ | ||
| 191 | - console.log('this.topicVal',this.topicVal) | ||
| 192 | - if(this.topicVal && this.data.detail.openid==getApp().openid){ | ||
| 193 | - App.Reserve.SetTopicFromShare({ | ||
| 194 | - rid:this.id, | ||
| 195 | - topic:this.topicVal | ||
| 196 | - }) | ||
| 197 | - } | ||
| 198 | - let nickname=""; | ||
| 199 | - try{ | ||
| 200 | - nickname=util.cache('userInfo').nickName; | ||
| 201 | - }catch(e){} | ||
| 202 | - return { | ||
| 203 | - //title: (nickname||'')+'给你发了一个邀请,点击查看', | ||
| 204 | - title: '你收到一个邀请函,点击查看', | ||
| 205 | - path: '/pages/customer/index?id='+this.id+'&fromid='+getApp().openid+'&invite_name='+nickname+'&hasInvitation=1', | ||
| 206 | - imageUrl:util.cgi('App.Reserve.MakePic&rid=')+this.id, | ||
| 207 | - } | ||
| 208 | - }, | 187 | + } else { |
| 188 | + // wx.navigateTo({ | ||
| 189 | + // url:'invite?id='+this.id, | ||
| 190 | + // }); | ||
| 191 | + } | ||
| 192 | + }, | ||
| 193 | + setUserInfoSuccess(){ | ||
| 194 | + util.toast('授权成功,可以继续转发', 'none'); | ||
| 195 | + }, | ||
| 196 | + toast(){ | ||
| 197 | + util.toast('本区域暂无配送人员', 'none'); | ||
| 198 | + }, | ||
| 199 | + reserveCancel(){ | ||
| 200 | + let userInfo = util.cache('userInfo'); | ||
| 201 | + if (userInfo) { | ||
| 202 | + userInfo = JSON.stringify({ | ||
| 203 | + openid: getApp().openid, | ||
| 204 | + avatar: userInfo.avatarUrl, | ||
| 205 | + nickname: userInfo.nickName, | ||
| 206 | + gender: userInfo.gender | ||
| 207 | + }) | ||
| 208 | + } | ||
| 209 | + App.Reserve.SetRelaSuccess({ | ||
| 210 | + rid: this.id, | ||
| 211 | + openid: getApp().openid, | ||
| 212 | + cancel: 'cancel', | ||
| 213 | + is_agree: 0, | ||
| 214 | + userinfo: userInfo | ||
| 215 | + }).then(res => { | ||
| 216 | + this.getDetail(true); | ||
| 217 | + }) | ||
| 218 | + }, | ||
| 219 | + shareSetting(){ | ||
| 220 | + console.log('this.topicVal', this.topicVal) | ||
| 221 | + if (this.topicVal && this.data.detail.openid == getApp().openid) { | ||
| 222 | + App.Reserve.SetTopicFromShare({ | ||
| 223 | + rid: this.id, | ||
| 224 | + topic: this.topicVal | ||
| 225 | + }) | ||
| 226 | + } | ||
| 227 | + let nickname = ""; | ||
| 228 | + try { | ||
| 229 | + nickname = util.cache('userInfo').nickName; | ||
| 230 | + } catch (e) { | ||
| 231 | + } | ||
| 232 | + return { | ||
| 233 | + //title: (nickname||'')+'给你发了一个邀请,点击查看', | ||
| 234 | + title: '你收到一个邀请函,点击查看', | ||
| 235 | + path: '/pages/customer/index?id=' + this.id + '&fromid=' + getApp().openid + '&invite_name=' + nickname + '&hasInvitation=1', | ||
| 236 | + imageUrl: util.cgi('App.Reserve.MakePic&rid=') + this.id, | ||
| 237 | + } | ||
| 238 | + }, | ||
| 209 | cookbook(){ | 239 | cookbook(){ |
| 210 | - if(this.data.detail.order && this.data.detail.order.cookbooklist.length>0){ | 240 | + if (this.data.detail.order && this.data.detail.order.cookbooklist.length > 0) { |
| 211 | wx.navigateTo({ | 241 | wx.navigateTo({ |
| 212 | - url:util.http_build_query({rid:this.id,oid:this.data.detail.order.id,identity:1},'/pack-cookbook/pages/success') | 242 | + url: util.http_build_query({ |
| 243 | + rid: this.id, | ||
| 244 | + oid: this.data.detail.order.id, | ||
| 245 | + identity: 1 | ||
| 246 | + }, '/pack-cookbook/pages/success') | ||
| 213 | }); | 247 | }); |
| 214 | - }else{ | 248 | + } else { |
| 215 | App.Advance.CreateOrder({ | 249 | App.Advance.CreateOrder({ |
| 216 | - rid:this.id, | ||
| 217 | - openid:getApp().openid, | ||
| 218 | - }).then(res=>{ | ||
| 219 | - if(res.ret!=200){ | ||
| 220 | - return util.toast(res.msg,'none') | 250 | + rid: this.id, |
| 251 | + openid: getApp().openid, | ||
| 252 | + }).then(res => { | ||
| 253 | + if (res.ret != 200) { | ||
| 254 | + return util.toast(res.msg, 'none') | ||
| 221 | } | 255 | } |
| 222 | wx.navigateTo({ | 256 | wx.navigateTo({ |
| 223 | - url:util.http_build_query({rid:this.id,oid:res.data.id,identity:1,sid:res.data.sellerid},'/pack-cookbook/pages/index') | 257 | + url: util.http_build_query({ |
| 258 | + rid: this.id, | ||
| 259 | + oid: res.data.id, | ||
| 260 | + identity: 1, | ||
| 261 | + sid: res.data.sellerid | ||
| 262 | + }, '/pack-cookbook/pages/index') | ||
| 224 | }); | 263 | }); |
| 225 | }) | 264 | }) |
| 226 | } | 265 | } |
| 227 | - | 266 | + }, |
| 267 | + sendmsg(){ | ||
| 268 | + wx.setClipboardData({ | ||
| 269 | + data: this.msgTpl | ||
| 270 | + }) | ||
| 228 | }, | 271 | }, |
| 229 | }) | 272 | }) |
| 1 | <!--pages/customer/detail_owner.wxml--> | 1 | <!--pages/customer/detail_owner.wxml--> |
| 2 | -<nav hasHome backgroundColor="rgba(0,0,0,0)" color="#ffffff"></nav> | ||
| 3 | -<view class="pages"> | ||
| 4 | - <view class="flex-vc" style="position: relative;"> | ||
| 5 | - <view class="invit-logo"> | ||
| 6 | - <image src="http://qn.colorcun.com/custom/lite-yd-cook/image/detail_owner_invitation-1-1.png"></image> | ||
| 7 | - </view> | ||
| 8 | - <view class="seller flex-vc"> | ||
| 9 | - <view class="title">餐厅</view> | ||
| 10 | - <view class="content name">{{detail.seller.sellername}}</view> | ||
| 11 | - <view class="title">包间</view> | ||
| 12 | - <view class="content">{{detail.tableFirst}}{{detail.tableSubInfo}}</view> | ||
| 13 | - <view class="title">时间</view> | ||
| 14 | - <view class="content">{{detail.rdateStr}}</view> | ||
| 15 | - <view class="title">地址</view> | ||
| 16 | - <view class="content flex-cc" bindtap="lookLocation" style="align-items: flex-start;width:80%;"> | ||
| 17 | - <image src="http://qn.colorcun.com/manager-invitation/wx/address.png" class="invit-addr"></image> | ||
| 18 | - <view class="addr">{{detail.seller.real_address||detail.seller.map_address}}</view> | ||
| 19 | - </view> | ||
| 20 | - </view> | 2 | +<import src="../tpl/invitation"></import> |
| 3 | +<nav backgroundColor="rgba(0,0,0,0)" hasHome style="position: fixed;z-index: 1;"></nav> | ||
| 4 | +<view class="pages bg-{{options.tplid}} flex-vc" style="height:{{height}}px;" wx:if="{{options.tplid}}"> | ||
| 5 | + <template is="tpl-{{options.tplid}}" data="{{seller,options,hasOwner,animation}}"></template> | ||
| 6 | + <view class="opt-view flex-vc"> | ||
| 7 | + <block wx:if="{{!detail.hasOvered && !detail.hasCancel}}"> | ||
| 8 | + <userinfo-share class="button-none flex-vc" binduserinfo="setUserInfoSuccess" catchtap="catchtap"> | ||
| 9 | + <view class="buts-share animation"></view> | ||
| 10 | + </userinfo-share> | ||
| 11 | + </block> | ||
| 12 | + <block wx:elif="{{detail.hasCancel}}"> | ||
| 13 | + <view class="opt-view-tip Medium">订座已取消</view> | ||
| 14 | + </block> | ||
| 15 | + <block wx:else=""> | ||
| 16 | + <view class="opt-view-tip Medium">订座已完成</view> | ||
| 17 | + </block> | ||
| 21 | </view> | 18 | </view> |
| 22 | - <block wx:if="{{!detail.hasOvered && !detail.hasCancel}}"> | ||
| 23 | - <view class="opt-button" wx:if="{{detail.seller.is_open_order==1 || detail.seller.is_open_wine==1}}"> | ||
| 24 | - <view class="opt flex-cc"> | ||
| 25 | - <userinfo class="button-none flex-vc" binduserinfo="toast" wx:if="{{detail.seller.is_open_wine==1}}"> | ||
| 26 | - <image class="buts" src="http://qn.colorcun.com/custom/lite-yd-cook/image/detail_owner_invitation-2.png"></image> | ||
| 27 | - </userinfo> | ||
| 28 | - <formids class="button-none flex-vc" bindclick="cookbook" wx:if="{{detail.seller.is_open_order==1}}"> | ||
| 29 | - <image class="buts" src="http://qn.colorcun.com/custom/lite-yd-cook/image/detail_owner_invitation-3.png"></image> | ||
| 30 | - </formids> | ||
| 31 | - </view> | ||
| 32 | - </view> | ||
| 33 | - </block> | ||
| 34 | </view> | 19 | </view> |
| 35 | -<view class="opt-view flex-vc"> | ||
| 36 | - <block wx:if="{{!detail.hasOvered && !detail.hasCancel}}"> | ||
| 37 | - <view class="opt-view-tip">发邀请函给朋友,获知朋友反馈</view> | ||
| 38 | - <userinfo-share class="button-none flex-vc" binduserinfo="setUserInfoSuccess"> | ||
| 39 | - <view class="buts-share"></view> | ||
| 40 | - </userinfo-share> | ||
| 41 | - </block> | ||
| 42 | - <block wx:elif="{{detail.hasCancel}}"> | ||
| 43 | - <view class="icon"> | ||
| 44 | - <icon type="info" size="47" color="#C9C9C9"/> | ||
| 45 | - </view> | ||
| 46 | - <view class="opt-view-tip Medium">订座已取消</view> | ||
| 47 | - </block> | ||
| 48 | - <block wx:else=""> | ||
| 49 | - <view class="icon"> | ||
| 50 | - <icon type="success" size="47" color="#C8B16D"/> | 20 | +<view class="bottom flex-lr" wx:if="{{!detail.hasOvered && !detail.hasCancel}}"> |
| 21 | + <formids bindclick="sendmsg" class="sendmsg"> | ||
| 22 | + 短信通知 | ||
| 23 | + </formids> | ||
| 24 | + <formids bindclick="cookbook" class="diancan" wx:if="{{detail.seller.is_open_order==1}}"> | ||
| 25 | + <view class="buts-text flex-cc"> | ||
| 26 | + <image src="http://qn.colorcun.com/manager-invitation/wx2/%E6%8F%90%E5%89%8D%E7%82%B9%E9%A4%90.png" class="icon"></image> | ||
| 27 | + 提前点餐 | ||
| 51 | </view> | 28 | </view> |
| 52 | - <view class="opt-view-tip Medium">订座已完成</view> | 29 | + </formids> |
| 30 | + <block wx:if="{{detail.seller.is_open_wine==1}}"> | ||
| 31 | + <view class="vline" ></view> | ||
| 32 | + <formids bindclick="toast" class="jiushui"> | ||
| 33 | + <view class="buts-text flex-cc"> | ||
| 34 | + <image src="http://qn.colorcun.com/manager-invitation/wx2/%E8%87%AA%E5%B8%A6%E9%85%92%E6%B0%B4.png" class="icon"></image> | ||
| 35 | + 自带酒水 | ||
| 36 | + </view> | ||
| 37 | + </formids> | ||
| 53 | </block> | 38 | </block> |
| 54 | </view> | 39 | </view> |
| 40 | +<!--//商务--> | ||
| 41 | +<template name="tpl-1"> | ||
| 42 | + <view class="flex-vc shangwu" bindtap="{{options.rid?'goEditor':''}}"> | ||
| 43 | + <template is="tpl-shangwu" data="{{...seller,options}}"></template> | ||
| 44 | + </view> | ||
| 45 | +</template> | ||
| 46 | + | ||
| 47 | +<!--//温馨--> | ||
| 48 | +<template name="tpl-2"> | ||
| 49 | + <template is="tpl-wenxin" data="{{...seller,options}}"></template> | ||
| 50 | +</template> |
| 1 | /* pages/customer/detail_customer.wxss */ | 1 | /* pages/customer/detail_customer.wxss */ |
| 2 | +@import "../manager-invitation/tpls.wxss"; | ||
| 3 | + | ||
| 2 | .pages{ | 4 | .pages{ |
| 3 | - color:#FFFFFF; | ||
| 4 | - background: url("http://qn.colorcun.com/custom/lite-yd/image/invit-bg.png") #353334; | ||
| 5 | background-size: 100%; | 5 | background-size: 100%; |
| 6 | - overflow-y: auto; | ||
| 7 | - position: fixed; | ||
| 8 | - top:0; | ||
| 9 | - bottom: 0; | ||
| 10 | - left:0; | ||
| 11 | - right:0; | 6 | + font-size: 34rpx; |
| 12 | } | 7 | } |
| 8 | + | ||
| 13 | image{ | 9 | image{ |
| 14 | width: 100%; | 10 | width: 100%; |
| 15 | height: 100%; | 11 | height: 100%; |
| 16 | } | 12 | } |
| 17 | -.invit-logo{ | ||
| 18 | - width: 400rpx; | ||
| 19 | - height: 170rpx; | ||
| 20 | - margin-top: 156rpx; | ||
| 21 | -} | ||
| 22 | -.avatar{ | ||
| 23 | - width: 88rpx; | ||
| 24 | - height: 88rpx; | ||
| 25 | - border-radius: 50%; | ||
| 26 | - margin-top: 50rpx; | ||
| 27 | - margin-bottom: 22rpx; | ||
| 28 | - overflow: hidden; | ||
| 29 | -} | ||
| 30 | -.invit{ | ||
| 31 | - font-size: 26rpx; | ||
| 32 | - color:#FDFCFD; | ||
| 33 | -} | ||
| 34 | -.hr-one{ | ||
| 35 | - margin-top: 50rpx; | ||
| 36 | - margin-bottom: 54rpx; | ||
| 37 | - height: 2rpx; | ||
| 38 | - background-color: #999999; | ||
| 39 | - width: 90%; | ||
| 40 | -} | ||
| 41 | -.seller{ | ||
| 42 | - margin-top: 80rpx; | ||
| 43 | -} | ||
| 44 | -.seller .title{ | ||
| 45 | - font-size: 28rpx; | ||
| 46 | - color:#999999; | ||
| 47 | - margin-bottom: 18rpx; | ||
| 48 | - height: 40rpx; | ||
| 49 | - line-height: 40rpx; | ||
| 50 | -} | ||
| 51 | -.seller .content{ | ||
| 52 | - margin-bottom: 40rpx; | ||
| 53 | - font-size: 36rpx; | ||
| 54 | - line-height: 50rpx; | ||
| 55 | - height: 50rpx; | ||
| 56 | -} | ||
| 57 | -.invit-addr{ | ||
| 58 | - width: 20rpx; | ||
| 59 | - height: 20rpx; | ||
| 60 | - margin-right: 18rpx; | ||
| 61 | -} | ||
| 62 | -.opt-button{ | ||
| 63 | - margin-top: 0rpx; | ||
| 64 | - width: 100%; | 13 | +.buts-share{ |
| 14 | + background-image: url("http://qn.colorcun.com/manager-invitation/wx2/%E5%8F%91%E9%82%80%E8%AF%B7%E5%87%BD.png"); | ||
| 65 | } | 15 | } |
| 66 | - | ||
| 67 | -.opt-view{ | 16 | +.bottom{ |
| 68 | position: fixed; | 17 | position: fixed; |
| 69 | - bottom: 40rpx; | 18 | + bottom: 0; |
| 19 | + height: 90rpx; | ||
| 20 | + line-height: 90rpx; | ||
| 21 | + border-top: 2rpx solid #ECD9B7; | ||
| 22 | + background-color: #ECD9B7; | ||
| 70 | width: 100%; | 23 | width: 100%; |
| 24 | + font-size: 30rpx; | ||
| 71 | } | 25 | } |
| 72 | -.opt{ | ||
| 73 | - width: 90%; | ||
| 74 | - margin: 0 auto; | 26 | +.bottom .sendmsg{ |
| 27 | + background-color: #262628; | ||
| 28 | + color: #ECD9B7; | ||
| 29 | + min-width: 25%; | ||
| 75 | } | 30 | } |
| 76 | - | ||
| 77 | -.opt .buts{ | ||
| 78 | - width: 288rpx; | ||
| 79 | - height: 80rpx; | ||
| 80 | -} | ||
| 81 | -.buts-share{ | ||
| 82 | - width: 560rpx; | ||
| 83 | - height: 86rpx; | ||
| 84 | - margin: 0 auto; | ||
| 85 | - background-image: url("http://qn.colorcun.com/custom/lite-yd-cook/image/detail_owner_invitation-5.png"); | ||
| 86 | - background-size: 100%; | ||
| 87 | - background-repeat: no-repeat; | ||
| 88 | - background-position: center center; | ||
| 89 | - animation-name: butAnimation; | ||
| 90 | - animation-duration: 0.7s; | ||
| 91 | - animation-iteration-count:9999; | ||
| 92 | -} | ||
| 93 | -.opt-view-tip{ | ||
| 94 | - font-size: 26rpx; | ||
| 95 | - color: #999999; | ||
| 96 | - margin-bottom: 20rpx; | ||
| 97 | -} | ||
| 98 | -@keyframes butAnimation | ||
| 99 | -{ | ||
| 100 | - 50% {background-size:90%;} | ||
| 101 | -} | ||
| 102 | -@-webkit-keyframes butAnimation | ||
| 103 | -{ | ||
| 104 | - 50% {background-size:90%;} | 31 | +.bottom .diancan{ |
| 32 | + text-align: center; | ||
| 33 | + color: #794F28; | ||
| 34 | + height: 90rpx; | ||
| 35 | + line-height: 90rpx; | ||
| 36 | + min-width: 33%; | ||
| 37 | + width: 70%; | ||
| 105 | } | 38 | } |
| 106 | -.seller .content .addr{ | ||
| 107 | - font-size: 32rpx; | ||
| 108 | - line-height: 40rpx; | 39 | +.bottom .jiushui{ |
| 109 | text-align: center; | 40 | text-align: center; |
| 41 | + color: #794F28; | ||
| 42 | + height: 90rpx; | ||
| 43 | + line-height: 90rpx; | ||
| 44 | + min-width: 33%; | ||
| 45 | + width: 70%; | ||
| 46 | +} | ||
| 47 | +.bottom .diancan .icon{ | ||
| 48 | + width: 40rpx; | ||
| 49 | + height: 34rpx; | ||
| 50 | + margin-right: 40rpx; | ||
| 51 | +} | ||
| 52 | +.bottom .jiushui .icon{ | ||
| 53 | + width: 32rpx; | ||
| 54 | + height: 38rpx; | ||
| 55 | + margin-right: 40rpx; | ||
| 56 | +} | ||
| 57 | +.buts-text{ | ||
| 58 | + height: 90rpx; | ||
| 59 | + line-height: 90rpx; | ||
| 60 | +} | ||
| 61 | +.vline{ | ||
| 62 | + background-color: #D3BF9C; | ||
| 63 | + width: 6rpx; | ||
| 64 | + height: 66rpx; | ||
| 65 | + min-width: 6rpx; | ||
| 110 | } | 66 | } |
| 111 | -.invit-addr{ | ||
| 112 | - width: 22rpx; | ||
| 113 | - height: 28rpx; | ||
| 114 | - margin-right: 18rpx; | ||
| 115 | - min-width: 22rpx; | ||
| 116 | - margin-top:6rpx ; | 67 | +.opt-view-tip{ |
| 68 | + font-size: 30rpx; | ||
| 69 | + color:#ccc; | ||
| 117 | } | 70 | } |
| @@ -31,7 +31,7 @@ | @@ -31,7 +31,7 @@ | ||
| 31 | "list": [] | 31 | "list": [] |
| 32 | }, | 32 | }, |
| 33 | "miniprogram": { | 33 | "miniprogram": { |
| 34 | - "current": 49, | 34 | + "current": 40, |
| 35 | "list": [ | 35 | "list": [ |
| 36 | { | 36 | { |
| 37 | "id": 0, | 37 | "id": 0, |
| @@ -341,7 +341,7 @@ | @@ -341,7 +341,7 @@ | ||
| 341 | "id": 40, | 341 | "id": 40, |
| 342 | "name": "邀请Ren pages/customer/index ", | 342 | "name": "邀请Ren pages/customer/index ", |
| 343 | "pathName": "pages/customer/detail_owner_invitation", | 343 | "pathName": "pages/customer/detail_owner_invitation", |
| 344 | - "query": "id=6173&fromid=test&hasInvitation=1&hasSellerShare=1", | 344 | + "query": "id=6173&fromid=test&hasInvitation=1&hasSellerShare=1&tplid=1", |
| 345 | "scene": null | 345 | "scene": null |
| 346 | }, | 346 | }, |
| 347 | { | 347 | { |
-
Please register or login to post a comment