Commit ae8d53ccf18de4dc4be29ae01ededa7bee00fb6a

Authored by wangfan
1 parent 9fe73063

manager-invitation

@@ -9,20 +9,33 @@ Page({ @@ -9,20 +9,33 @@ Page({
9 * 页面的初始数据 9 * 页面的初始数据
10 */ 10 */
11 data: { 11 data: {
12 - pickerValue:[0,0,0], 12 + pickerValue:[-1,0,0],
13 pickerData:[[],[],[]], 13 pickerData:[[],[],[]],
  14 + hasSubmit:false,
  15 + form:{
  16 + name:'',
  17 + room:'',
  18 + addr:'',
  19 + sid:'',
  20 + time:'',
  21 + image:'',
  22 + },
  23 + tpl:{},
14 }, 24 },
15 25
16 /** 26 /**
17 * 生命周期函数--监听页面加载 27 * 生命周期函数--监听页面加载
18 */ 28 */
19 pickerData:[], 29 pickerData:[],
  30 + tpl:{},
20 onLoad: function (options) { 31 onLoad: function (options) {
  32 + this.tpl=TP.tpls(options.tplid);
21 this.pickerData=TP.pickerData(); 33 this.pickerData=TP.pickerData();
22 let pd=TP.pickerData(); 34 let pd=TP.pickerData();
23 pd[2]=pd[2][this.data.pickerValue[1]]; 35 pd[2]=pd[2][this.data.pickerValue[1]];
24 this.setData({ 36 this.setData({
25 pickerData:pd, 37 pickerData:pd,
  38 + tpl:this.tpl,
26 }) 39 })
27 }, 40 },
28 41
@@ -67,4 +80,47 @@ Page({ @@ -67,4 +80,47 @@ Page({
67 onReachBottom: function () { 80 onReachBottom: function () {
68 81
69 }, 82 },
  83 + bindMultiPickerColumnChange(e){
  84 + console.log(e);
  85 + if(e.detail.column==1){
  86 + this.setData({
  87 + [`pickerValue[1]`]:e.detail.value,
  88 + [`pickerData[2]`]:this.pickerData[2][e.detail.value],
  89 + })
  90 + }
  91 + },
  92 + bindMultiPickerChange(e){
  93 + this.setData({
  94 + pickerValue:e.detail.value
  95 + })
  96 + this.checkHasSubmit()
  97 + },
  98 + checkHasSubmit(){
  99 + let form=this.data.form
  100 + if(
  101 + form.name
  102 + && this.data.pickerValue[0]>-1
  103 + && form.room
  104 + && form.addr
  105 + && (!this.tpl.hasImage || (this.tpl.hasImage && form.image))//带图模板
  106 + ){
  107 + this.setData({
  108 + hasSubmit:true
  109 + })
  110 + }else{
  111 + this.setData({
  112 + hasSubmit:false
  113 + })
  114 + }
  115 + },
  116 + input(e){
  117 + let key=util.attr(e,'key');
  118 + let val=util.val(e).trim();
  119 + let form=this.data.form;
  120 + form[key]=val;
  121 + this.setData({
  122 + form:form,
  123 + })
  124 + this.checkHasSubmit()
  125 + }
70 }) 126 })
@@ -4,31 +4,12 @@ @@ -4,31 +4,12 @@
4 <view class="base block"> 4 <view class="base block">
5 <view class="item Medium">预订信息</view> 5 <view class="item Medium">预订信息</view>
6 <view class="item flex-ll"> 6 <view class="item flex-ll">
7 - <input value="" bindinput="input" placeholder="请输入店铺名称"/> 7 + <input value="{{form.name}}" bindinput="input"
  8 + data-key="name"
  9 + placeholder="请输入店铺名称" placeholder-class="placeholder-class"/>
8 <view class="quick">快速选择</view> 10 <view class="quick">快速选择</view>
9 </view> 11 </view>
10 <view class="item flex-ll"> 12 <view class="item flex-ll">
11 - <!--  
12 - <input value="" bindinput="input" placeholder="请输入预订时间"/>  
13 - -->  
14 - <!--  
15 - <picker-view  
16 - indicator-style="height: 50px;"  
17 - style="width: 100%; height: 300px;"  
18 - value="{{pickerValue}}"  
19 - bindchange="bindChange"  
20 - >  
21 - <picker-view-column>  
22 - <view wx:for="{{pickerData.date}}" wx:key="pickerData.date.key" style="line-height: 50px">{{item}}</view>  
23 - </picker-view-column>  
24 - <picker-view-column>  
25 - <view wx:for="{{pickerData.space}}" wx:key="pickerData.space.key" style="line-height: 50px">{{item}}</view>  
26 - </picker-view-column>  
27 - <picker-view-column>  
28 - <view wx:for="{{pickerData.time[pickerValue[1]]}}" wx:key="pickerData.time.key" style="line-height: 50px">{{item}}</view>  
29 - </picker-view-column>  
30 - </picker-view>  
31 - -->  
32 <picker 13 <picker
33 mode="multiSelector" 14 mode="multiSelector"
34 bindchange="bindMultiPickerChange" 15 bindchange="bindMultiPickerChange"
@@ -37,24 +18,31 @@ @@ -37,24 +18,31 @@
37 range="{{pickerData}}" 18 range="{{pickerData}}"
38 > 19 >
39 <view class="picker"> 20 <view class="picker">
40 - 当前选择:{{multiArray[0][multiIndex[0]]}},{{multiArray[1][multiIndex[1]]}},{{multiArray[2][multiIndex[2]]}} 21 + <block wx:if="{{pickerValue[0]>-1}}">
  22 + {{pickerData[0][pickerValue[0]]}} {{pickerData[1][pickerValue[1]]}} {{pickerData[2][pickerValue[2]]}}
  23 + </block>
  24 + <text class="placeholder-class" wx:else="">请输入预订时间</text>
41 </view> 25 </view>
42 </picker> 26 </picker>
43 </view> 27 </view>
44 <view class="item flex-ll"> 28 <view class="item flex-ll">
45 - <input value="" bindinput="input" placeholder="请输入包间名称"/> 29 + <input value="{{form.room}}" bindinput="input"
  30 + data-key="room"
  31 + placeholder="请输入包间名称" placeholder-class="placeholder-class"/>
46 </view> 32 </view>
47 <view class="item flex-ll"> 33 <view class="item flex-ll">
48 - <input value="" bindinput="input" placeholder="请输入店铺地址"/> 34 + <input value="{{form.addr}}" bindinput="input"
  35 + data-key="addr"
  36 + placeholder="请输入店铺地址" placeholder-class="placeholder-class"/>
49 </view> 37 </view>
50 </view> 38 </view>
51 - <view class="upload block flex-vc"> 39 + <view class="upload block flex-vc" wx:if="{{tpl.hasImage}}">
52 <view class="image"> 40 <view class="image">
53 <image src="http://qn.colorcun.com/manager-invitation/wx/upload2.jpg" mode="aspectFill"></image> 41 <image src="http://qn.colorcun.com/manager-invitation/wx/upload2.jpg" mode="aspectFill"></image>
54 </view> 42 </view>
55 <view class="text">(此处照片为邀请函展示照片)</view> 43 <view class="text">(此处照片为邀请函展示照片)</view>
56 </view> 44 </view>
57 <formids bindclick="submit" style="width: 100%;"> 45 <formids bindclick="submit" style="width: 100%;">
58 - <view class="submit">确定</view> 46 + <view class="submit {{hasSubmit?'submit-active':''}}">确定</view>
59 </formids> 47 </formids>
60 </view> 48 </view>
@@ -59,6 +59,9 @@ page{ @@ -59,6 +59,9 @@ page{
59 border-radius: 10rpx; 59 border-radius: 10rpx;
60 color: #FEFEFE; 60 color: #FEFEFE;
61 } 61 }
  62 +.submit-active{
  63 + background-color: #199095;
  64 +}
62 .quick{ 65 .quick{
63 height: 50rpx; 66 height: 50rpx;
64 line-height: 50rpx; 67 line-height: 50rpx;
@@ -68,4 +71,7 @@ page{ @@ -68,4 +71,7 @@ page{
68 color: #FEFEFE; 71 color: #FEFEFE;
69 text-align: center; 72 text-align: center;
70 min-width: 140rpx; 73 min-width: 140rpx;
71 -}  
  74 +}
  75 +.placeholder-class{
  76 + color: #999999;
  77 +}
@@ -10,7 +10,7 @@ Page({ @@ -10,7 +10,7 @@ Page({
10 */ 10 */
11 data: { 11 data: {
12 height: 667, 12 height: 667,
13 - current: 1, 13 + current: 0,
14 tpls: TP.tpls(), 14 tpls: TP.tpls(),
15 seller:{ 15 seller:{
16 name:'一键订示例餐厅', 16 name:'一键订示例餐厅',
@@ -30,6 +30,7 @@ @@ -30,6 +30,7 @@
30 <view class="flex-vc shangwu"> 30 <view class="flex-vc shangwu">
31 <view class="invit-logo"> 31 <view class="invit-logo">
32 <image src="http://qn.colorcun.com/custom/lite-yd-cook/image/detail_owner_invitation-1-1.png"></image> 32 <image src="http://qn.colorcun.com/custom/lite-yd-cook/image/detail_owner_invitation-1-1.png"></image>
  33 + <view class="quick-editor">修改内容</view>
33 </view> 34 </view>
34 <view class="seller flex-vc"> 35 <view class="seller flex-vc">
35 <view class="title">餐厅</view> 36 <view class="title">餐厅</view>
@@ -44,6 +45,9 @@ @@ -44,6 +45,9 @@
44 {{addr}}第三方斯蒂芬 45 {{addr}}第三方斯蒂芬
45 </view> 46 </view>
46 </view> 47 </view>
  48 + <userinfo-share class="button-none flex-vc" binduserinfo="setUserInfoSuccess">
  49 + <view class="buts-share"></view>
  50 + </userinfo-share>
47 </view> 51 </view>
48 </template> 52 </template>
49 53
@@ -54,6 +58,7 @@ @@ -54,6 +58,7 @@
54 <view class="flex-vc wenxin"> 58 <view class="flex-vc wenxin">
55 <view class="invit-logo"> 59 <view class="invit-logo">
56 <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> 60 <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>
  61 + <view class="quick-editor">修改内容</view>
57 </view> 62 </view>
58 <view class="wenxin-mask"> 63 <view class="wenxin-mask">
59 <view class="wenxin-mask-bg"></view> 64 <view class="wenxin-mask-bg"></view>
@@ -69,5 +74,8 @@ @@ -69,5 +74,8 @@
69 {{addr}} 74 {{addr}}
70 </view> 75 </view>
71 </view> 76 </view>
  77 + <userinfo-share class="button-none flex-vc" binduserinfo="setUserInfoSuccess">
  78 + <view class="buts-share"></view>
  79 + </userinfo-share>
72 </view> 80 </view>
73 </template> 81 </template>
@@ -37,6 +37,7 @@ image{ @@ -37,6 +37,7 @@ image{
37 .invit-logo{ 37 .invit-logo{
38 width: 400rpx; 38 width: 400rpx;
39 height: 170rpx; 39 height: 170rpx;
  40 + position: relative;
40 } 41 }
41 .seller{ 42 .seller{
42 margin-top: 80rpx; 43 margin-top: 80rpx;
@@ -55,6 +56,9 @@ image{ @@ -55,6 +56,9 @@ image{
55 text-align: center; 56 text-align: center;
56 align-items:flex-start; 57 align-items:flex-start;
57 } 58 }
  59 +.seller .content:last-child{
  60 + margin-bottom: 0;
  61 +}
58 .seller .addr{ 62 .seller .addr{
59 width: 80%; 63 width: 80%;
60 } 64 }
@@ -77,11 +81,10 @@ image{ @@ -77,11 +81,10 @@ image{
77 background-color: #ECD9B7; 81 background-color: #ECD9B7;
78 width: 100%; 82 width: 100%;
79 } 83 }
80 -.shangwu{  
81 - 84 +.shangwu .seller{
  85 + margin-bottom: 152rpx;
82 } 86 }
83 -.wenxin{  
84 - 87 +.wenxin {
85 } 88 }
86 89
87 .wenxin-top{ 90 .wenxin-top{
@@ -160,4 +163,37 @@ image{ @@ -160,4 +163,37 @@ image{
160 } 163 }
161 .wenxin .seller .content.addr{ 164 .wenxin .seller .content.addr{
162 width: 100%; 165 width: 100%;
  166 +}
  167 +.quick-editor{
  168 + background-color: #ECD9B7;
  169 + width: 120rpx;
  170 + height: 40rpx;
  171 + line-height: 40rpx;
  172 + color: #353535;
  173 + font-size: 24rpx;
  174 + position: absolute;
  175 + top:50rpx;
  176 + right:-150rpx;
  177 + text-align: center;
  178 +}
  179 +
  180 +.buts-share{
  181 + width: 560rpx;
  182 + height: 86rpx;
  183 + margin: 0 auto;
  184 + background-image: url("http://qn.colorcun.com/custom/lite-yd-cook/image/detail_owner_invitation-5.png");
  185 + background-size: 100%;
  186 + background-repeat: no-repeat;
  187 + background-position: center center;
  188 + animation-name: butAnimation;
  189 + animation-duration: 0.7s;
  190 + animation-iteration-count:9999;
  191 +}
  192 +@keyframes butAnimation
  193 +{
  194 + 50% {background-size:90%;}
  195 +}
  196 +@-webkit-keyframes butAnimation
  197 +{
  198 + 50% {background-size:90%;}
163 } 199 }
@@ -365,10 +365,10 @@ @@ -365,10 +365,10 @@
365 "scene": null 365 "scene": null
366 }, 366 },
367 { 367 {
368 - "id": -1, 368 + "id": 44,
369 "name": "pages/manager-invitation/editor", 369 "name": "pages/manager-invitation/editor",
370 "pathName": "pages/manager-invitation/editor", 370 "pathName": "pages/manager-invitation/editor",
371 - "query": "tplid=1", 371 + "query": "tplid=2",
372 "scene": null 372 "scene": null
373 } 373 }
374 ] 374 ]
@@ -4,11 +4,13 @@ let tpls=[ @@ -4,11 +4,13 @@ let tpls=[
4 id: 1, 4 id: 1,
5 code: 1, 5 code: 1,
6 name: '商务', 6 name: '商务',
  7 + hasImage:false,
7 }, 8 },
8 { 9 {
9 id: 2, 10 id: 2,
10 code: 2, 11 code: 2,
11 name: '温馨', 12 name: '温馨',
  13 + hasImage:true,
12 }, 14 },
13 ]; 15 ];
14 module.exports ={ 16 module.exports ={