Commit abf35879086a5f7e26ec19d561618ca72f101ef2

Authored by vking
1 parent 5e765def

邀请函

// components/showModal/showModal.js
import util from '../../../utils/util'
const properties={
cancelText:{type:String,value:''},
cancelColor:{type:String,value:'#000'},
confirmText:{type:String,value:'确认'},
confirmColor:{type:String,value:'#fff'},
header:{type:String,value:'确认信息'},
body:{type:String,value:'确认信息'},
};
Component({
options: {
multipleSlots: true // 在组件定义时的选项中启用多slot支持
},
/**
* 组件的属性列表
*/
properties: properties,
/**
* 组件的初始数据
*/
data: {
hasShow:false,
},
attached(){
let opt={};
Object.keys(properties).forEach((k)=>{
opt[k]=this.data[k]
})
this.setData({
opt:opt
})
},
/**
* 组件的方法列表
*/
methods: {
options(obj){
let opt=this.data.opt;
this.setData({
opt:{
...opt,
...obj
}
})
return this;
},
show(){
console.log(this.data.opt)
this.setData({
hasShow:true,
})
},
tapButton(e){
this.triggerEvent('showModal',{type:util.attr(e,'type')})
this.hide();
},
hide(){
this.setData({
hasShow:false,
})
}
}
})
... ...
{
"component": true,
"usingComponents": {}
}
\ No newline at end of file
... ...
<!--components/showModal/showModal.wxml-->
<view class="mask flex-vc" hidden="{{!hasShow}}">
<view class="showModal">
<view class="header">
{{opt.header}}
</view>
<view class="body">
{{opt.body}}
<slot name="body"></slot>
</view>
<view class="footer flex-cc">
<button class="button-none cancel" plain wx:if="{{opt.cancelText}}"
bindtap="tapButton" data-type="cancel"
style="color:{{opt.cancelColor}};">{{opt.cancelText}}</button>
<button class="button-none confirm bg-brown" plain
bindtap="tapButton" data-type="confirm"
style="color:{{opt.confirmColor}};">{{opt.confirmText}}</button>
</view>
</view>
</view>
... ...
/* components/showModal/showModal.wxss */
@import "../../../app.wxss";
.mask{
position: fixed;
width: 100%;
height: 100%;
background-color: rgba(0,0,0,.5);
top:0;
left: 0;
}
.showModal{
width: 100%;
background-color: #fff;
padding: 60rpx 40rpx 0;
position: fixed;
bottom:0;
height: 460rpx;
box-sizing: border-box;
border-radius: 20rpx 20rpx 0 0;
}
.showModal .header{
height:50rpx;
font-size:36rpx;
font-family:PingFangSC-Semibold,PingFangSC;
font-weight:600;
color:rgba(53,53,53,1);
line-height:50rpx;
}
.showModal .body{
margin-top: 20rpx;
height:80rpx;
font-size:28rpx;
font-family:PingFang-SC-Medium,PingFang-SC;
font-weight:500;
color:rgba(153,153,153,1);
line-height:40rpx;
}
.footer{
height:80rpx;
box-sizing: border-box;
position: fixed;
bottom: 80rpx;
width: calc(100% - 80rpx);
}
.footer .button-none{
background:#C0A369;
border-radius:10rpx;
border-width: 0;
height:80rpx;
font-size:32rpx;
font-family:PingFangSC-Semibold,PingFangSC;
font-weight:600;
color:rgba(255,255,255,1);
line-height:80rpx;
width: 320rpx;
}
.footer .button-none.confirm{
}
.footer .button-none.cancel{
}
\ No newline at end of file
... ...
... ... @@ -223,7 +223,10 @@ Page({
is_agree: 0,
userinfo: userInfo
}).then(res => {
this.getDetail(true);
//this.getDetail(true);
wx.switchTab({
url: '/pages/customer/list?hasRelaTip=1'
})
})
},
shareSetting(){
... ... @@ -238,5 +241,10 @@ Page({
},'/pages/customer/index'),
imageUrl: this.data.tpls[0].shareImage,
}
}
},
gotoHome(){
wx.switchTab({
url: '/pages/reserve/index'
})
},
})
... ...
... ... @@ -11,12 +11,12 @@
</block>
</view>
</view>
<view class="opt-button flex-vc">
<view class="opt-button flex-lr">
<view bindtap="gotoHome" class="dingbaojian flex-vc">
<image src="http://qn.colorcun.com/reserve/images/%E5%BE%AE%E4%BF%A1%E5%9B%BE%E7%89%87_20191114105901.png" class="icon"></image>
<view class="text">订包间</view>
</view>
<view class="opt flex-cc">
<view bindtap="gotoHome" class="dingbaojian flex-vc">
<image src="http://qn.colorcun.com/reserve/images/%E5%BE%AE%E4%BF%A1%E5%9B%BE%E7%89%87_20191114105901.png" class="icon"></image>
<view class="text">订包间</view>
</view>
<formids class="button-none flex-vc" bindclick="lookLocation">
<view class="opt-text flex-cc">
<image class="buts-dh" src="http://qn.colorcun.com/manager-invitation/wx2/%E4%B8%80%E9%94%AE%E5%AF%BC%E8%88%AA.png"></image>
... ...
... ... @@ -20,9 +20,10 @@ Page({
tpls: TP.tpls(),
/**
* 生命周期函数--监听页面加载
* hasRelaTip 从邀请函,接受邀请进入
*/
onLoad: function (options) {
this.options=options
},
/**
... ... @@ -36,6 +37,12 @@ Page({
* 生命周期函数--监听页面显示
*/
onShow: function () {
if(this.options.hasRelaTip){
this.selectComponent("#showModal").show({
})
this.options.hasRelaTip=''
}
this.getListData();
},
... ...
... ... @@ -7,6 +7,7 @@
"userinfo-share": "/components/userinfo/share",
"formids":"/components/formids/formids",
"nav":"/components/nav/nav",
"card":"/components/seller-card/seller-card"
"card":"/components/seller-card/seller-card",
"showModal":"/components/tips/showModal/showModal"
}
}
\ No newline at end of file
... ...
... ... @@ -68,3 +68,6 @@
</block>
</block>
</view>
<showModal id="showModal" header="温馨提示" body="" confirmText="知道了">
<view slot="body"><text class="oneHour">就餐前1小时</text>将通过微信消息提醒您准时就餐,敬请留意。</view>
</showModal>
... ...
... ... @@ -103,5 +103,8 @@
border: 2rpx solid #262628;
text-align: center;
margin-left: 18rpx;
}
.oneHour{
color: #353535;
text-decoration : underline;
}
\ No newline at end of file
... ...
... ... @@ -515,6 +515,13 @@
"pathName": "pages/customer/index",
"query": "seller_id=80&seller_openid=oGefL4qKBWIh5xwyg3LVfkMbDumA&manager_id=763&rid=33354&act=tobook",
"scene": null
},
{
"id": -1,
"name": "pages/customer/list",
"pathName": "pages/customer/list",
"query": "hasRelaTip=1",
"scene": null
}
]
}
... ...