Commit 8f0027a0d7c16c42ee115f7741ec6a14341598b2

Authored by wangfan
1 parent 07d61a1f

activity

@@ -220,7 +220,7 @@ image{ @@ -220,7 +220,7 @@ image{
220 font-size: inherit; 220 font-size: inherit;
221 text-align: center; 221 text-align: center;
222 text-decoration: none; 222 text-decoration: none;
223 - line-height: inherit; 223 + line-height: 100%;
224 -webkit-tap-highlight-color: transparent; 224 -webkit-tap-highlight-color: transparent;
225 color: inherit; 225 color: inherit;
226 width:100%; 226 width:100%;
@@ -3,62 +3,79 @@ import util from '../../utils/util'; @@ -3,62 +3,79 @@ import util from '../../utils/util';
3 import App from '../../utils/api'; 3 import App from '../../utils/api';
4 4
5 Component({ 5 Component({
6 - /**  
7 - * 组件的属性列表  
8 - */  
9 - properties: {  
10 - // talkImage: {  
11 - // type: String, // 类型(必填),目前接受的类型包括:String, Number, Boolean, Object, Array, null(表示任意类型)  
12 - // value: '/pages/image/menu-fixed-taomei.png'  
13 - // },  
14 - },  
15 -  
16 - /**  
17 - * 组件的初始数据  
18 - */  
19 - data: {  
20 -  
21 - },  
22 - attached(){ 6 + /**
  7 + * 组件的属性列表
  8 + */
  9 + properties: {
  10 + // talkImage: {
  11 + // type: String, // 类型(必填),目前接受的类型包括:String, Number, Boolean, Object, Array, null(表示任意类型)
  12 + // value: '/pages/image/menu-fixed-taomei.png'
  13 + // },
  14 + },
23 15
24 - },  
25 - ready () { 16 + /**
  17 + * 组件的初始数据
  18 + */
  19 + data: {
  20 + userinfo: null,
  21 + },
  22 + attached(){
  23 + wx.getStorage({
  24 + key: 'userInfo',
  25 + success: (e) => {
  26 + this.setData({
  27 + userinfo: e.data
  28 + })
  29 + }
  30 + })
  31 + },
  32 + ready () {
26 33
27 - },  
28 - detached(){ 34 + },
  35 + detached(){
29 36
30 - },  
31 - /**  
32 - * 组件的方法列表  
33 - */  
34 - methods: {  
35 - getUserInfoSuccess(e){  
36 - if(e.type="getuserinfo"){  
37 - if(e.detail.errMsg=='getUserInfo:ok'){  
38 - var userInfo = e.detail.userInfo //avatarUrl nickName gender;  
39 - console.log('xxxxx',userInfo)  
40 - util.cache('userInfo',userInfo);  
41 - App.Reserve.AddUser({  
42 - openid: getApp().openid,  
43 - avatar: userInfo.avatarUrl,  
44 - nickname: userInfo.nickName,  
45 - gender: userInfo.gender  
46 - })  
47 - this.triggerEvent("userinfo",userInfo);  
48 - }else if(e.detail.errMsg=='getUserInfo:fail auth deny'){  
49 - wx.showModal({  
50 - title:'授权提示',  
51 - content:'您点击了拒绝授权,将无法正常显示个人信息,点击确定重新获取授权',  
52 - confirmColor:'#199095',  
53 - cancelColor:'#999',  
54 - success:function(res){  
55 - if(res.confirm){  
56 - util.setting();  
57 - }  
58 - }  
59 - })  
60 - } 37 + },
  38 + /**
  39 + * 组件的方法列表
  40 + */
  41 + methods: {
  42 + getUserInfoSuccess(e){
  43 + if (e.type = "getuserinfo") {
  44 + if (e.detail.errMsg == 'getUserInfo:ok') {
  45 + var userInfo = e.detail.userInfo //avatarUrl nickName gender;
  46 + console.log('xxxxx', userInfo)
  47 + util.cache('userInfo', userInfo);
  48 + App.Reserve.AddUser({
  49 + openid: getApp().openid,
  50 + avatar: userInfo.avatarUrl,
  51 + nickname: userInfo.nickName,
  52 + gender: userInfo.gender
  53 + })
  54 + this.triggerEvent("userinfo", userInfo);
  55 + } else if (e.detail.errMsg == 'getUserInfo:fail auth deny') {
  56 + wx.showModal({
  57 + title: '授权提示',
  58 + content: '您点击了拒绝授权,将无法正常显示个人信息,点击确定重新获取授权',
  59 + confirmColor: '#199095',
  60 + cancelColor: '#999',
  61 + success: function (res) {
  62 + if (res.confirm) {
  63 + util.setting();
  64 + }
61 } 65 }
  66 + })
62 } 67 }
  68 + }
  69 + },
  70 + setUserInfoSuccess(e){
  71 + var userInfo = this.data.userinfo
  72 + App.Reserve.AddUser({
  73 + openid: getApp().openid,
  74 + avatar: userInfo.avatarUrl,
  75 + nickname: userInfo.nickName,
  76 + gender: userInfo.gender
  77 + })
  78 + this.triggerEvent("userinfo", userInfo);
63 } 79 }
  80 + }
64 }) 81 })
1 { 1 {
2 "component": true, 2 "component": true,
3 - "usingComponents": {} 3 + "usingComponents": {
  4 + "formids": "/components/formids/formids"
  5 + }
4 } 6 }
1 -<button bindgetuserinfo="getUserInfoSuccess" open-type="getUserInfo" class="button-none" catchtap="catchtap">  
2 - <slot></slot>  
3 -</button>  
  1 +<block wx:if="{{!userinfo}}">
  2 + <button bindgetuserinfo="getUserInfoSuccess" open-type="getUserInfo" class="button-none" catchtap="catchtap">
  3 + <slot></slot>
  4 + </button>
  5 +</block>
  6 +<block wx:else="">
  7 + <formids bindclick="setUserInfoSuccess" catchtap="catchtap">
  8 + <slot></slot>
  9 + </formids>
  10 +</block>
@@ -46,10 +46,10 @@ module.exports ={ @@ -46,10 +46,10 @@ module.exports ={
46 } 46 }
47 return str; 47 return str;
48 }, 48 },
49 - async getTplMsg(bookInfo,tplcode='SMS_163050401'){ 49 + async getTplMsg(bookInfo,tplcode='SMS_163050401',sc=null){
50 let smsData = {} 50 let smsData = {}
51 let txa=['早上','中午','晚上'] 51 let txa=['早上','中午','晚上']
52 - let tx=await bcm.getTimeSpaceIndexData(bookInfo.rdate); 52 + let tx=await bcm.getTimeSpaceIndexData(bookInfo.rdate,sc);
53 switch (tplcode) { 53 switch (tplcode) {
54 //尊敬的贵宾,您好!(4月6日)(中午)的用餐,为您安排在(好又多复兴路店)(202)房间,(王丽娜)期待您的光临,预祝就餐愉快! 54 //尊敬的贵宾,您好!(4月6日)(中午)的用餐,为您安排在(好又多复兴路店)(202)房间,(王丽娜)期待您的光临,预祝就餐愉快!
55 case 'SMS_162733710': 55 case 'SMS_162733710':
@@ -120,7 +120,7 @@ Page({ @@ -120,7 +120,7 @@ Page({
120 } 120 }
121 }) 121 })
122 App.Reserve.SellerInfo({seller_id:res.data.seller.id}).then(async sc=>{ 122 App.Reserve.SellerInfo({seller_id:res.data.seller.id}).then(async sc=>{
123 - this.msgTpl=await ST.getTplMsg(res.data,sc.data.setting.template_code) 123 + this.msgTpl=await ST.getTplMsg(res.data,sc.data.setting.template_code,sc.data)
124 console.log('this.msgTpl',this.msgTpl); 124 console.log('this.msgTpl',this.msgTpl);
125 }) 125 })
126 }) 126 })
@@ -21,12 +21,12 @@ @@ -21,12 +21,12 @@
21 <formids bindclick="sendmsg" class="sendmsg"> 21 <formids bindclick="sendmsg" class="sendmsg">
22 短信通知 22 短信通知
23 </formids> 23 </formids>
24 - <formids bindclick="cookbook" class="diancan" wx:if="{{detail.seller.is_open_order==1}}"> 24 + <userinfo binduserinfo="cookbook" class="diancan" wx:if="{{detail.seller.is_open_order==1}}">
25 <view class="buts-text flex-cc"> 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> 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 提前点餐 27 提前点餐
28 </view> 28 </view>
29 - </formids> 29 + </userinfo>
30 <block wx:if="{{detail.seller.is_open_wine==1}}"> 30 <block wx:if="{{detail.seller.is_open_wine==1}}">
31 <view class="vline" ></view> 31 <view class="vline" ></view>
32 <formids bindclick="toast" class="jiushui"> 32 <formids bindclick="toast" class="jiushui">
@@ -4,6 +4,7 @@ @@ -4,6 +4,7 @@
4 "navigationBarTitleText":"一键订", 4 "navigationBarTitleText":"一键订",
5 "usingComponents": { 5 "usingComponents": {
6 "formids":"/components/formids/formids", 6 "formids":"/components/formids/formids",
  7 + "userinfo":"/components/userinfo/userinfo",
7 "stat":"/components/stat/stat", 8 "stat":"/components/stat/stat",
8 "as":"/components/actionSheet/index", 9 "as":"/components/actionSheet/index",
9 "nav":"/components/nav/nav", 10 "nav":"/components/nav/nav",
@@ -114,11 +114,11 @@ @@ -114,11 +114,11 @@
114 <image src="http://qn.colorcun.com/custom/lite-online/image/%E9%A6%96%E9%A1%B5.png"></image> 114 <image src="http://qn.colorcun.com/custom/lite-online/image/%E9%A6%96%E9%A1%B5.png"></image>
115 <view class="text">首页</view> 115 <view class="text">首页</view>
116 </formids> 116 </formids>
117 - <formids class="follow flex-vc" bindclick="follow"> 117 + <userinfo class="follow flex-vc" binduserinfo="follow">
118 <image src="http://qn.colorcun.com/custom/lite-online/image/%E6%94%B6%E8%97%8F.png" wx:if="{{!IsCollectionSeller}}"></image> 118 <image src="http://qn.colorcun.com/custom/lite-online/image/%E6%94%B6%E8%97%8F.png" wx:if="{{!IsCollectionSeller}}"></image>
119 <image src="http://qn.colorcun.com/custom/lite-online/image/%E5%B7%B2%E6%94%B6%E8%97%8F.png" wx:else=""></image> 119 <image src="http://qn.colorcun.com/custom/lite-online/image/%E5%B7%B2%E6%94%B6%E8%97%8F.png" wx:else=""></image>
120 <view class="text">收藏</view> 120 <view class="text">收藏</view>
121 - </formids> 121 + </userinfo>
122 </view> 122 </view>
123 <view class="reserve"> 123 <view class="reserve">
124 <formids class="flex-vc" bindclick="reserve"> 124 <formids class="flex-vc" bindclick="reserve">
@@ -150,7 +150,7 @@ module.exports ={ @@ -150,7 +150,7 @@ module.exports ={
150 if(d<day1 && d>day0){ 150 if(d<day1 && d>day0){
151 isDay=true; 151 isDay=true;
152 } 152 }
153 - let times=await this.getDayTimeSpace(); 153 + let times=await this.getDayTimeSpace(sc);
154 let nd=util.unixtoTime(d,'HH:II') 154 let nd=util.unixtoTime(d,'HH:II')
155 let obj={ 155 let obj={
156 timeIndex:0, 156 timeIndex:0,