Commit ae8d53ccf18de4dc4be29ae01ededa7bee00fb6a

Authored by wangfan
1 parent 9fe73063

manager-invitation

... ... @@ -9,20 +9,33 @@ Page({
* 页面的初始数据
*/
data: {
pickerValue:[0,0,0],
pickerValue:[-1,0,0],
pickerData:[[],[],[]],
hasSubmit:false,
form:{
name:'',
room:'',
addr:'',
sid:'',
time:'',
image:'',
},
tpl:{},
},
/**
* 生命周期函数--监听页面加载
*/
pickerData:[],
tpl:{},
onLoad: function (options) {
this.tpl=TP.tpls(options.tplid);
this.pickerData=TP.pickerData();
let pd=TP.pickerData();
pd[2]=pd[2][this.data.pickerValue[1]];
this.setData({
pickerData:pd,
tpl:this.tpl,
})
},
... ... @@ -67,4 +80,47 @@ Page({
onReachBottom: function () {
},
bindMultiPickerColumnChange(e){
console.log(e);
if(e.detail.column==1){
this.setData({
[`pickerValue[1]`]:e.detail.value,
[`pickerData[2]`]:this.pickerData[2][e.detail.value],
})
}
},
bindMultiPickerChange(e){
this.setData({
pickerValue:e.detail.value
})
this.checkHasSubmit()
},
checkHasSubmit(){
let form=this.data.form
if(
form.name
&& this.data.pickerValue[0]>-1
&& form.room
&& form.addr
&& (!this.tpl.hasImage || (this.tpl.hasImage && form.image))//带图模板
){
this.setData({
hasSubmit:true
})
}else{
this.setData({
hasSubmit:false
})
}
},
input(e){
let key=util.attr(e,'key');
let val=util.val(e).trim();
let form=this.data.form;
form[key]=val;
this.setData({
form:form,
})
this.checkHasSubmit()
}
})
\ No newline at end of file
... ...
... ... @@ -4,31 +4,12 @@
<view class="base block">
<view class="item Medium">预订信息</view>
<view class="item flex-ll">
<input value="" bindinput="input" placeholder="请输入店铺名称"/>
<input value="{{form.name}}" bindinput="input"
data-key="name"
placeholder="请输入店铺名称" placeholder-class="placeholder-class"/>
<view class="quick">快速选择</view>
</view>
<view class="item flex-ll">
<!--
<input value="" bindinput="input" placeholder="请输入预订时间"/>
-->
<!--
<picker-view
indicator-style="height: 50px;"
style="width: 100%; height: 300px;"
value="{{pickerValue}}"
bindchange="bindChange"
>
<picker-view-column>
<view wx:for="{{pickerData.date}}" wx:key="pickerData.date.key" style="line-height: 50px">{{item}}</view>
</picker-view-column>
<picker-view-column>
<view wx:for="{{pickerData.space}}" wx:key="pickerData.space.key" style="line-height: 50px">{{item}}</view>
</picker-view-column>
<picker-view-column>
<view wx:for="{{pickerData.time[pickerValue[1]]}}" wx:key="pickerData.time.key" style="line-height: 50px">{{item}}</view>
</picker-view-column>
</picker-view>
-->
<picker
mode="multiSelector"
bindchange="bindMultiPickerChange"
... ... @@ -37,24 +18,31 @@
range="{{pickerData}}"
>
<view class="picker">
当前选择:{{multiArray[0][multiIndex[0]]}},{{multiArray[1][multiIndex[1]]}},{{multiArray[2][multiIndex[2]]}}
<block wx:if="{{pickerValue[0]>-1}}">
{{pickerData[0][pickerValue[0]]}} {{pickerData[1][pickerValue[1]]}} {{pickerData[2][pickerValue[2]]}}
</block>
<text class="placeholder-class" wx:else="">请输入预订时间</text>
</view>
</picker>
</view>
<view class="item flex-ll">
<input value="" bindinput="input" placeholder="请输入包间名称"/>
<input value="{{form.room}}" bindinput="input"
data-key="room"
placeholder="请输入包间名称" placeholder-class="placeholder-class"/>
</view>
<view class="item flex-ll">
<input value="" bindinput="input" placeholder="请输入店铺地址"/>
<input value="{{form.addr}}" bindinput="input"
data-key="addr"
placeholder="请输入店铺地址" placeholder-class="placeholder-class"/>
</view>
</view>
<view class="upload block flex-vc">
<view class="upload block flex-vc" wx:if="{{tpl.hasImage}}">
<view class="image">
<image src="http://qn.colorcun.com/manager-invitation/wx/upload2.jpg" mode="aspectFill"></image>
</view>
<view class="text">(此处照片为邀请函展示照片)</view>
</view>
<formids bindclick="submit" style="width: 100%;">
<view class="submit">确定</view>
<view class="submit {{hasSubmit?'submit-active':''}}">确定</view>
</formids>
</view>
\ No newline at end of file
... ...
... ... @@ -59,6 +59,9 @@ page{
border-radius: 10rpx;
color: #FEFEFE;
}
.submit-active{
background-color: #199095;
}
.quick{
height: 50rpx;
line-height: 50rpx;
... ... @@ -68,4 +71,7 @@ page{
color: #FEFEFE;
text-align: center;
min-width: 140rpx;
}
\ No newline at end of file
}
.placeholder-class{
color: #999999;
}
... ...
... ... @@ -10,7 +10,7 @@ Page({
*/
data: {
height: 667,
current: 1,
current: 0,
tpls: TP.tpls(),
seller:{
name:'一键订示例餐厅',
... ...
... ... @@ -30,6 +30,7 @@
<view class="flex-vc shangwu">
<view class="invit-logo">
<image src="http://qn.colorcun.com/custom/lite-yd-cook/image/detail_owner_invitation-1-1.png"></image>
<view class="quick-editor">修改内容</view>
</view>
<view class="seller flex-vc">
<view class="title">餐厅</view>
... ... @@ -44,6 +45,9 @@
{{addr}}第三方斯蒂芬
</view>
</view>
<userinfo-share class="button-none flex-vc" binduserinfo="setUserInfoSuccess">
<view class="buts-share"></view>
</userinfo-share>
</view>
</template>
... ... @@ -54,6 +58,7 @@
<view class="flex-vc wenxin">
<view class="invit-logo">
<image src="http://qn.colorcun.com/manager-invitation/wx/%E6%B8%A9%E9%A6%A8-%E9%A2%84%E8%AE%A2%E5%AE%89%E6%8E%92.png"></image>
<view class="quick-editor">修改内容</view>
</view>
<view class="wenxin-mask">
<view class="wenxin-mask-bg"></view>
... ... @@ -69,5 +74,8 @@
{{addr}}
</view>
</view>
<userinfo-share class="button-none flex-vc" binduserinfo="setUserInfoSuccess">
<view class="buts-share"></view>
</userinfo-share>
</view>
</template>
... ...
... ... @@ -37,6 +37,7 @@ image{
.invit-logo{
width: 400rpx;
height: 170rpx;
position: relative;
}
.seller{
margin-top: 80rpx;
... ... @@ -55,6 +56,9 @@ image{
text-align: center;
align-items:flex-start;
}
.seller .content:last-child{
margin-bottom: 0;
}
.seller .addr{
width: 80%;
}
... ... @@ -77,11 +81,10 @@ image{
background-color: #ECD9B7;
width: 100%;
}
.shangwu{
.shangwu .seller{
margin-bottom: 152rpx;
}
.wenxin{
.wenxin {
}
.wenxin-top{
... ... @@ -160,4 +163,37 @@ image{
}
.wenxin .seller .content.addr{
width: 100%;
}
.quick-editor{
background-color: #ECD9B7;
width: 120rpx;
height: 40rpx;
line-height: 40rpx;
color: #353535;
font-size: 24rpx;
position: absolute;
top:50rpx;
right:-150rpx;
text-align: center;
}
.buts-share{
width: 560rpx;
height: 86rpx;
margin: 0 auto;
background-image: url("http://qn.colorcun.com/custom/lite-yd-cook/image/detail_owner_invitation-5.png");
background-size: 100%;
background-repeat: no-repeat;
background-position: center center;
animation-name: butAnimation;
animation-duration: 0.7s;
animation-iteration-count:9999;
}
@keyframes butAnimation
{
50% {background-size:90%;}
}
@-webkit-keyframes butAnimation
{
50% {background-size:90%;}
}
\ No newline at end of file
... ...
... ... @@ -365,10 +365,10 @@
"scene": null
},
{
"id": -1,
"id": 44,
"name": "pages/manager-invitation/editor",
"pathName": "pages/manager-invitation/editor",
"query": "tplid=1",
"query": "tplid=2",
"scene": null
}
]
... ...
... ... @@ -4,11 +4,13 @@ let tpls=[
id: 1,
code: 1,
name: '商务',
hasImage:false,
},
{
id: 2,
code: 2,
name: '温馨',
hasImage:true,
},
];
module.exports ={
... ...