Commit 8f0027a0d7c16c42ee115f7741ec6a14341598b2

Authored by wangfan
1 parent 07d61a1f

activity

... ... @@ -220,7 +220,7 @@ image{
font-size: inherit;
text-align: center;
text-decoration: none;
line-height: inherit;
line-height: 100%;
-webkit-tap-highlight-color: transparent;
color: inherit;
width:100%;
... ...
... ... @@ -3,62 +3,79 @@ import util from '../../utils/util';
import App from '../../utils/api';
Component({
/**
* 组件的属性列表
*/
properties: {
// talkImage: {
// type: String, // 类型(必填),目前接受的类型包括:String, Number, Boolean, Object, Array, null(表示任意类型)
// value: '/pages/image/menu-fixed-taomei.png'
// },
},
/**
* 组件的初始数据
*/
data: {
},
attached(){
/**
* 组件的属性列表
*/
properties: {
// talkImage: {
// type: String, // 类型(必填),目前接受的类型包括:String, Number, Boolean, Object, Array, null(表示任意类型)
// value: '/pages/image/menu-fixed-taomei.png'
// },
},
},
ready () {
/**
* 组件的初始数据
*/
data: {
userinfo: null,
},
attached(){
wx.getStorage({
key: 'userInfo',
success: (e) => {
this.setData({
userinfo: e.data
})
}
})
},
ready () {
},
detached(){
},
detached(){
},
/**
* 组件的方法列表
*/
methods: {
getUserInfoSuccess(e){
if(e.type="getuserinfo"){
if(e.detail.errMsg=='getUserInfo:ok'){
var userInfo = e.detail.userInfo //avatarUrl nickName gender;
console.log('xxxxx',userInfo)
util.cache('userInfo',userInfo);
App.Reserve.AddUser({
openid: getApp().openid,
avatar: userInfo.avatarUrl,
nickname: userInfo.nickName,
gender: userInfo.gender
})
this.triggerEvent("userinfo",userInfo);
}else if(e.detail.errMsg=='getUserInfo:fail auth deny'){
wx.showModal({
title:'授权提示',
content:'您点击了拒绝授权,将无法正常显示个人信息,点击确定重新获取授权',
confirmColor:'#199095',
cancelColor:'#999',
success:function(res){
if(res.confirm){
util.setting();
}
}
})
}
},
/**
* 组件的方法列表
*/
methods: {
getUserInfoSuccess(e){
if (e.type = "getuserinfo") {
if (e.detail.errMsg == 'getUserInfo:ok') {
var userInfo = e.detail.userInfo //avatarUrl nickName gender;
console.log('xxxxx', userInfo)
util.cache('userInfo', userInfo);
App.Reserve.AddUser({
openid: getApp().openid,
avatar: userInfo.avatarUrl,
nickname: userInfo.nickName,
gender: userInfo.gender
})
this.triggerEvent("userinfo", userInfo);
} else if (e.detail.errMsg == 'getUserInfo:fail auth deny') {
wx.showModal({
title: '授权提示',
content: '您点击了拒绝授权,将无法正常显示个人信息,点击确定重新获取授权',
confirmColor: '#199095',
cancelColor: '#999',
success: function (res) {
if (res.confirm) {
util.setting();
}
}
})
}
}
},
setUserInfoSuccess(e){
var userInfo = this.data.userinfo
App.Reserve.AddUser({
openid: getApp().openid,
avatar: userInfo.avatarUrl,
nickname: userInfo.nickName,
gender: userInfo.gender
})
this.triggerEvent("userinfo", userInfo);
}
}
})
... ...
{
"component": true,
"usingComponents": {}
"usingComponents": {
"formids": "/components/formids/formids"
}
}
\ No newline at end of file
... ...
<button bindgetuserinfo="getUserInfoSuccess" open-type="getUserInfo" class="button-none" catchtap="catchtap">
<slot></slot>
</button>
\ No newline at end of file
<block wx:if="{{!userinfo}}">
<button bindgetuserinfo="getUserInfoSuccess" open-type="getUserInfo" class="button-none" catchtap="catchtap">
<slot></slot>
</button>
</block>
<block wx:else="">
<formids bindclick="setUserInfoSuccess" catchtap="catchtap">
<slot></slot>
</formids>
</block>
\ No newline at end of file
... ...
... ... @@ -46,10 +46,10 @@ module.exports ={
}
return str;
},
async getTplMsg(bookInfo,tplcode='SMS_163050401'){
async getTplMsg(bookInfo,tplcode='SMS_163050401',sc=null){
let smsData = {}
let txa=['早上','中午','晚上']
let tx=await bcm.getTimeSpaceIndexData(bookInfo.rdate);
let tx=await bcm.getTimeSpaceIndexData(bookInfo.rdate,sc);
switch (tplcode) {
//尊敬的贵宾,您好!(4月6日)(中午)的用餐,为您安排在(好又多复兴路店)(202)房间,(王丽娜)期待您的光临,预祝就餐愉快!
case 'SMS_162733710':
... ...
... ... @@ -120,7 +120,7 @@ Page({
}
})
App.Reserve.SellerInfo({seller_id:res.data.seller.id}).then(async sc=>{
this.msgTpl=await ST.getTplMsg(res.data,sc.data.setting.template_code)
this.msgTpl=await ST.getTplMsg(res.data,sc.data.setting.template_code,sc.data)
console.log('this.msgTpl',this.msgTpl);
})
})
... ...
... ... @@ -21,12 +21,12 @@
<formids bindclick="sendmsg" class="sendmsg">
短信通知
</formids>
<formids bindclick="cookbook" class="diancan" wx:if="{{detail.seller.is_open_order==1}}">
<userinfo binduserinfo="cookbook" class="diancan" wx:if="{{detail.seller.is_open_order==1}}">
<view class="buts-text flex-cc">
<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>
提前点餐
</view>
</formids>
</userinfo>
<block wx:if="{{detail.seller.is_open_wine==1}}">
<view class="vline" ></view>
<formids bindclick="toast" class="jiushui">
... ...
... ... @@ -4,6 +4,7 @@
"navigationBarTitleText":"一键订",
"usingComponents": {
"formids":"/components/formids/formids",
"userinfo":"/components/userinfo/userinfo",
"stat":"/components/stat/stat",
"as":"/components/actionSheet/index",
"nav":"/components/nav/nav",
... ...
... ... @@ -114,11 +114,11 @@
<image src="http://qn.colorcun.com/custom/lite-online/image/%E9%A6%96%E9%A1%B5.png"></image>
<view class="text">首页</view>
</formids>
<formids class="follow flex-vc" bindclick="follow">
<userinfo class="follow flex-vc" binduserinfo="follow">
<image src="http://qn.colorcun.com/custom/lite-online/image/%E6%94%B6%E8%97%8F.png" wx:if="{{!IsCollectionSeller}}"></image>
<image src="http://qn.colorcun.com/custom/lite-online/image/%E5%B7%B2%E6%94%B6%E8%97%8F.png" wx:else=""></image>
<view class="text">收藏</view>
</formids>
</userinfo>
</view>
<view class="reserve">
<formids class="flex-vc" bindclick="reserve">
... ...
... ... @@ -150,7 +150,7 @@ module.exports ={
if(d<day1 && d>day0){
isDay=true;
}
let times=await this.getDayTimeSpace();
let times=await this.getDayTimeSpace(sc);
let nd=util.unixtoTime(d,'HH:II')
let obj={
timeIndex:0,
... ...