Showing
39 changed files
with
692 additions
and
131 deletions
| @@ -11,6 +11,7 @@ | @@ -11,6 +11,7 @@ | ||
| 11 | "pages/customer/remind", | 11 | "pages/customer/remind", |
| 12 | "pages/reserve/index", | 12 | "pages/reserve/index", |
| 13 | "pages/me/index", | 13 | "pages/me/index", |
| 14 | + "pages/me/concat", | ||
| 14 | "pages/me/setting", | 15 | "pages/me/setting", |
| 15 | "pages/me/list", | 16 | "pages/me/list", |
| 16 | "pages/reserve/search", | 17 | "pages/reserve/search", |
| 1 | import util from '../../../utils/util'; | 1 | import util from '../../../utils/util'; |
| 2 | -import App from '../../../utils/api'; | ||
| 3 | Component({ | 2 | Component({ |
| 4 | properties:{ | 3 | properties:{ |
| 5 | - seller:Object, | ||
| 6 | - //选中日期 | ||
| 7 | date:{ | 4 | date:{ |
| 8 | type:String, | 5 | type:String, |
| 9 | value:util.unixtoTime(new Date()/1000,'YYYY-MM-DD'), | 6 | value:util.unixtoTime(new Date()/1000,'YYYY-MM-DD'), |
| 10 | }, | 7 | }, |
| 11 | - hidecalendar:{ | ||
| 12 | - type:Boolean, | ||
| 13 | - value:true | 8 | + marklist:{ |
| 9 | + type:Array, | ||
| 10 | + value:[] | ||
| 14 | } | 11 | } |
| 15 | }, | 12 | }, |
| 16 | data: { | 13 | data: { |
| 17 | showprev:false | 14 | showprev:false |
| 18 | }, | 15 | }, |
| 19 | observers: { | 16 | observers: { |
| 20 | - 'seller,date': function(seller,newdate) { | ||
| 21 | - if(seller && newdate!=''){ | ||
| 22 | - let showYearMonth=this.getshowmonth(); | 17 | + 'date': function(newdate,newmarklist) { |
| 18 | + let showYearMonth=this.getshowmonth(); | ||
| 19 | + let obj={ | ||
| 20 | + ...showYearMonth, | ||
| 21 | + action:'defalut' | ||
| 22 | + } | ||
| 23 | + if(newdate!=''){ | ||
| 23 | if(this.data.showYearMonth){ //周历点击 | 24 | if(this.data.showYearMonth){ //周历点击 |
| 24 | if(showYearMonth.showyear==this.data.showYearMonth.showyear && showYearMonth.showmonth==this.data.showYearMonth.showmonth){ | 25 | if(showYearMonth.showyear==this.data.showYearMonth.showyear && showYearMonth.showmonth==this.data.showYearMonth.showmonth){ |
| 25 | this.changedatestyle(newdate); | 26 | this.changedatestyle(newdate); |
| @@ -29,20 +30,27 @@ Component({ | @@ -29,20 +30,27 @@ Component({ | ||
| 29 | showprev:this.isShowPrev(showYearMonth) | 30 | showprev:this.isShowPrev(showYearMonth) |
| 30 | }) | 31 | }) |
| 31 | this.getdayslist(showYearMonth.showyear,showYearMonth.showmonth); | 32 | this.getdayslist(showYearMonth.showyear,showYearMonth.showmonth); |
| 32 | - // this.gethousefulldate(seller); | 33 | + this.triggerEvent('tellmonth',obj); |
| 34 | + | ||
| 33 | } | 35 | } |
| 34 | }else{ | 36 | }else{ |
| 35 | //初始化---默认 | 37 | //初始化---默认 |
| 38 | + console.log('默认') | ||
| 36 | this.setData({ | 39 | this.setData({ |
| 37 | showYearMonth:showYearMonth, | 40 | showYearMonth:showYearMonth, |
| 38 | showprev:this.isShowPrev(showYearMonth) | 41 | showprev:this.isShowPrev(showYearMonth) |
| 39 | }) | 42 | }) |
| 40 | this.getdayslist(showYearMonth.showyear,showYearMonth.showmonth); | 43 | this.getdayslist(showYearMonth.showyear,showYearMonth.showmonth); |
| 41 | - // this.gethousefulldate(seller); | 44 | + this.triggerEvent('tellmonth',obj); |
| 42 | } | 45 | } |
| 43 | 46 | ||
| 44 | } | 47 | } |
| 45 | 48 | ||
| 49 | + }, | ||
| 50 | + 'marklist'(newmarklist){ | ||
| 51 | + if(this.data.daylist){ | ||
| 52 | + this.markdaylist(newmarklist) | ||
| 53 | + } | ||
| 46 | } | 54 | } |
| 47 | }, | 55 | }, |
| 48 | attached(){ | 56 | attached(){ |
| @@ -83,7 +91,7 @@ Component({ | @@ -83,7 +91,7 @@ Component({ | ||
| 83 | }, | 91 | }, |
| 84 | //获取某一天是星期几 | 92 | //获取某一天是星期几 |
| 85 | getdayweek:function(year,month,day){ | 93 | getdayweek:function(year,month,day){ |
| 86 | - var tmpdate=new Date(year,month,day); | 94 | + var tmpdate=new Date(year,month-1,day); |
| 87 | return tmpdate.getDay() | 95 | return tmpdate.getDay() |
| 88 | }, | 96 | }, |
| 89 | //获取当月日期 | 97 | //获取当月日期 |
| @@ -189,12 +197,16 @@ Component({ | @@ -189,12 +197,16 @@ Component({ | ||
| 189 | showyear:showyear, | 197 | showyear:showyear, |
| 190 | showmonth:showmonth | 198 | showmonth:showmonth |
| 191 | } | 199 | } |
| 200 | + let obj={ | ||
| 201 | + ...showYearMonth, | ||
| 202 | + action:'click' | ||
| 203 | + } | ||
| 192 | this.setData({ | 204 | this.setData({ |
| 193 | showYearMonth:showYearMonth, | 205 | showYearMonth:showYearMonth, |
| 194 | showprev:this.isShowPrev(showYearMonth) | 206 | showprev:this.isShowPrev(showYearMonth) |
| 195 | }) | 207 | }) |
| 196 | this.getdayslist(showYearMonth.showyear,showYearMonth.showmonth); | 208 | this.getdayslist(showYearMonth.showyear,showYearMonth.showmonth); |
| 197 | - this.gethousefulldate(this.data.seller); | 209 | + this.triggerEvent('tellmonth',obj); |
| 198 | }, | 210 | }, |
| 199 | //推前月份 | 211 | //推前月份 |
| 200 | nextmonth(){ | 212 | nextmonth(){ |
| @@ -215,33 +227,21 @@ Component({ | @@ -215,33 +227,21 @@ Component({ | ||
| 215 | showprev:this.isShowPrev(showYearMonth) | 227 | showprev:this.isShowPrev(showYearMonth) |
| 216 | }) | 228 | }) |
| 217 | this.getdayslist(showYearMonth.showyear,showYearMonth.showmonth); | 229 | this.getdayslist(showYearMonth.showyear,showYearMonth.showmonth); |
| 218 | - this.gethousefulldate(this.data.seller); | ||
| 219 | - }, | ||
| 220 | - //根据指定年份月份获取当月满房的日期 | ||
| 221 | - gethousefulldate(seller){ | ||
| 222 | - let showYearMonth=this.data.showYearMonth; | ||
| 223 | - let parmdata={ | ||
| 224 | - sid:seller.id, | ||
| 225 | - type:'month', | ||
| 226 | - date:showYearMonth.showyear+'-'+(showYearMonth.showmonth<10 ? '0'+showYearMonth.showmonth : showYearMonth.showmonth) | 230 | + let obj={ |
| 231 | + ...showYearMonth, | ||
| 232 | + action:'click' | ||
| 227 | } | 233 | } |
| 228 | - App.Customer.GetHouseFullDate(parmdata).then((json)=>{ | ||
| 229 | - console.log(json) | ||
| 230 | - if(json.ret==200){ | ||
| 231 | - if(json.data && json.data.length>0){ | ||
| 232 | - this.markFullHouse(json.data); | ||
| 233 | - } | ||
| 234 | - } | ||
| 235 | - }) | 234 | + this.triggerEvent('tellmonth',obj); |
| 236 | }, | 235 | }, |
| 237 | //标记满房 | 236 | //标记满房 |
| 238 | - markFullHouse(fullHouseDate){ | 237 | + markdaylist(marklist){ |
| 238 | + console.log('xxxxxx') | ||
| 239 | let daylist=this.data.daylist; | 239 | let daylist=this.data.daylist; |
| 240 | daylist.forEach((v,i)=>{ | 240 | daylist.forEach((v,i)=>{ |
| 241 | v.list.forEach((r,n)=>{ | 241 | v.list.forEach((r,n)=>{ |
| 242 | - fullHouseDate.forEach((r1,n1)=>{ | ||
| 243 | - if(r1==r.date){ | ||
| 244 | - r.mark='满' | 242 | + marklist.forEach((r1,n1)=>{ |
| 243 | + if(r.date && r1.date==r.date){ | ||
| 244 | + r.mark=r1.mark | ||
| 245 | } | 245 | } |
| 246 | }) | 246 | }) |
| 247 | }) | 247 | }) |
| 1 | -<view class="calendar" hidden="{{hidecalendar}}"> | 1 | +<view class="calendar"> |
| 2 | <view class="calendar-title flex-lr"> | 2 | <view class="calendar-title flex-lr"> |
| 3 | <view class="black-font font30r Semibold calendar-title-date">{{showYearMonth.showyear}}-{{showYearMonth.showmonth<10 ? '0'+showYearMonth.showmonth : showYearMonth.showmonth}}</view> | 3 | <view class="black-font font30r Semibold calendar-title-date">{{showYearMonth.showyear}}-{{showYearMonth.showmonth<10 ? '0'+showYearMonth.showmonth : showYearMonth.showmonth}}</view> |
| 4 | <view class="calendar-title-tab-list flex-rr"> | 4 | <view class="calendar-title-tab-list flex-rr"> |
| 1 | @import "../../../app.wxss"; | 1 | @import "../../../app.wxss"; |
| 2 | .calendar{ | 2 | .calendar{ |
| 3 | width:100%; | 3 | width:100%; |
| 4 | - background: #FFFBF2; | ||
| 5 | - border-top-left-radius:20rpx; | ||
| 6 | - border-top-right-radius:20rpx; | ||
| 7 | - overflow: hidden; | ||
| 8 | padding:30rpx 0; | 4 | padding:30rpx 0; |
| 9 | } | 5 | } |
| 10 | .calendar-title{ | 6 | .calendar-title{ |
| 1 | +import util from '../../../utils/util'; | ||
| 2 | +import App from '../../../utils/api'; | ||
| 3 | +Component({ | ||
| 4 | + properties:{ | ||
| 5 | + seller:Object, | ||
| 6 | + date:{ | ||
| 7 | + type:String, | ||
| 8 | + value:util.unixtoTime(new Date()/1000,'YYYY-MM-DD'), | ||
| 9 | + }, | ||
| 10 | + }, | ||
| 11 | + data:{ | ||
| 12 | + marklist:[] | ||
| 13 | + }, | ||
| 14 | + attached(){ | ||
| 15 | + | ||
| 16 | + }, | ||
| 17 | + observers:{ | ||
| 18 | + 'seller'(newseller){ | ||
| 19 | + if(newseller){ | ||
| 20 | + this.showYearMonth=this.getshowmonth(); | ||
| 21 | + console.log(newseller,this.showYearMonth); | ||
| 22 | + this.gethousefulldate(newseller,this.showYearMonth) | ||
| 23 | + } | ||
| 24 | + } | ||
| 25 | + }, | ||
| 26 | + methods:{ | ||
| 27 | + //获取当前选中日期 | ||
| 28 | + getshowmonth(){ | ||
| 29 | + let datearr=this.data.date.split('-'); | ||
| 30 | + return{ | ||
| 31 | + showyear:Number(datearr[0]), | ||
| 32 | + showmonth:Number(datearr[1]), | ||
| 33 | + } | ||
| 34 | + }, | ||
| 35 | + //切换月份 | ||
| 36 | + getmonth(e){ | ||
| 37 | + console.log('tellmonth',e) | ||
| 38 | + this.showYearMonth=e.detail; | ||
| 39 | + if(e.detail.action='click'){ | ||
| 40 | + this.gethousefulldate(this.data.seller,this.showYearMonth) | ||
| 41 | + } | ||
| 42 | + }, | ||
| 43 | + //根据指定年份月份获取当月满房的日期 | ||
| 44 | + gethousefulldate(seller,showYearMonth){ | ||
| 45 | + let parmdata={ | ||
| 46 | + sid:seller.id, | ||
| 47 | + type:'month', | ||
| 48 | + date:showYearMonth.showyear+'-'+(showYearMonth.showmonth<10 ? '0'+showYearMonth.showmonth : showYearMonth.showmonth) | ||
| 49 | + } | ||
| 50 | + App.Customer.GetHouseFullDate(parmdata).then((json)=>{ | ||
| 51 | + console.log(json) | ||
| 52 | + if(json.ret==200){ | ||
| 53 | + if(json.data && json.data.length>0){ | ||
| 54 | + let marklist=[]; | ||
| 55 | + json.data.forEach((v,i)=>{ | ||
| 56 | + marklist.push({ | ||
| 57 | + date:v, | ||
| 58 | + mark:'满' | ||
| 59 | + }) | ||
| 60 | + }) | ||
| 61 | + marklist=[{ | ||
| 62 | + date:'2019-08-20', | ||
| 63 | + mark:'满' | ||
| 64 | + }] | ||
| 65 | + this.setData({ | ||
| 66 | + marklist:marklist | ||
| 67 | + }) | ||
| 68 | + } | ||
| 69 | + | ||
| 70 | + } | ||
| 71 | + }) | ||
| 72 | + }, | ||
| 73 | + tellselectdate(e){ | ||
| 74 | + this.triggerEvent('tellselectdate',e.detail); | ||
| 75 | + } | ||
| 76 | + } | ||
| 77 | +}) |
| 1 | +<calendar date="{{date}}" marklist="{{marklist}}" bind:tellselectdate="tellselectdate" bind:tellmonth="getmonth"></calendar> |
| 1 | +@import "../../../app.wxss"; |
| 1 | +import App from '../../../utils/api'; | ||
| 2 | +import util from '../../../utils/util'; | ||
| 1 | Component({ | 3 | Component({ |
| 2 | - | 4 | + properties:{ |
| 5 | + seller:Object, | ||
| 6 | + date:{ | ||
| 7 | + type:String, | ||
| 8 | + value:util.unixtoTime(new Date()/1000,'YYYY-MM-DD') | ||
| 9 | + }, | ||
| 10 | + section:String, | ||
| 11 | + seletroom:{ | ||
| 12 | + type:Array, | ||
| 13 | + value:[] | ||
| 14 | + } | ||
| 15 | + }, | ||
| 16 | + data:{ | ||
| 17 | + roomlist:[ | ||
| 18 | + { | ||
| 19 | + id:1, | ||
| 20 | + name:'6人间', | ||
| 21 | + mostpnum:8, | ||
| 22 | + lastmoney:3000, | ||
| 23 | + isfull:0, | ||
| 24 | + selectnum:2, | ||
| 25 | + }, | ||
| 26 | + { | ||
| 27 | + id:2, | ||
| 28 | + name:'8人间', | ||
| 29 | + mostpnum:8, | ||
| 30 | + lastmoney:3000, | ||
| 31 | + isfull:1, | ||
| 32 | + selectnum:0, | ||
| 33 | + }, | ||
| 34 | + { | ||
| 35 | + id:3, | ||
| 36 | + name:'10人间', | ||
| 37 | + mostpnum:8, | ||
| 38 | + lastmoney:3000, | ||
| 39 | + isfull:0, | ||
| 40 | + selectnum:0, | ||
| 41 | + }, | ||
| 42 | + { | ||
| 43 | + id:4, | ||
| 44 | + name:'16人间', | ||
| 45 | + mostpnum:8, | ||
| 46 | + lastmoney:3000, | ||
| 47 | + isfull:0, | ||
| 48 | + selectnum:0, | ||
| 49 | + } | ||
| 50 | + ] | ||
| 51 | + }, | ||
| 52 | + methods:{ | ||
| 53 | + getroomtype(){ | ||
| 54 | + | ||
| 55 | + }, | ||
| 56 | + selectroom(e){ | ||
| 57 | + let _target=e.currentTarget.dataset; | ||
| 58 | + console.log(typeof _target.selectnum) | ||
| 59 | + let setkey='roomlist['+_target.index+'].selectnum'; | ||
| 60 | + this.setData({ | ||
| 61 | + [setkey]:_target.selectnum+1 | ||
| 62 | + }) | ||
| 63 | + this.triggerEvent('selectroom',this.data.roomlist[_target.index]) | ||
| 64 | + }, | ||
| 65 | + cancelroom(id){ | ||
| 66 | + let roomlist=this.data.roomlist; | ||
| 67 | + roomlist.forEach((v,i)=>{ | ||
| 68 | + if(v.id==id){ | ||
| 69 | + let setkey='roomlist['+i+'].selectnum'; | ||
| 70 | + this.setData({ | ||
| 71 | + [setkey]:v.selectnum-1, | ||
| 72 | + }) | ||
| 73 | + } | ||
| 74 | + }) | ||
| 75 | + }, | ||
| 76 | + } | ||
| 3 | }) | 77 | }) |
| 1 | +<view class="room-list flex-rs"> | ||
| 2 | + <block wx:for="{{roomlist}}" wx:key="{{index}}"> | ||
| 3 | + <view class="room-item black-font {{item.isfull==1 ? 'border-gray bg-gray' : 'border-yellow bg-yellow'}} flex-vl" style="justify-content:center;" data-id="{{item.id}}" data-index="{{index}}" data-selectnum="{{item.selectnum}}" catchtap="{{item.isfull==1 ? '' : 'selectroom'}}"> | ||
| 4 | + <view class="font30r font-bold">{{item.name}}</view> | ||
| 5 | + <view class="font24r font-bold room-more">最多可坐8人</view> | ||
| 6 | + <view class="font20r font-bold room-consume">最低消费300元</view> | ||
| 7 | + <block wx:if="{{item.isfull==1}}"> | ||
| 8 | + <view class="room-full black-font font24r">订满</view> | ||
| 9 | + </block> | ||
| 10 | + <block wx:if="{{item.selectnum>0}}"> | ||
| 11 | + <view class="room-select white-font font24r flex-cc">已选{{item.selectnum}}</view> | ||
| 12 | + </block> | ||
| 13 | + </view> | ||
| 14 | + </block> | ||
| 15 | +</view> |
| 1 | +@import "../../../app.wxss"; | ||
| 2 | +.room-list{ | ||
| 3 | + width:100%; | ||
| 4 | + padding-left:30rpx; | ||
| 5 | + box-sizing: border-box; | ||
| 6 | +} | ||
| 7 | +.room-item{ | ||
| 8 | + width:330rpx; | ||
| 9 | + height:140rpx; | ||
| 10 | + padding:0 30rpx; | ||
| 11 | + box-sizing: border-box; | ||
| 12 | + border-radius:10rpx; | ||
| 13 | + margin-bottom: 20rpx; | ||
| 14 | + margin-right: 30rpx; | ||
| 15 | + position: relative; | ||
| 16 | + overflow: hidden; | ||
| 17 | +} | ||
| 18 | +.border-yellow{ | ||
| 19 | + border:2rpx solid #C3A56C; | ||
| 20 | +} | ||
| 21 | +.bg-yellow{ | ||
| 22 | + background: #FFF5EB; | ||
| 23 | +} | ||
| 24 | +.border-gray{ | ||
| 25 | + border:2rpx solid #E0E0E0; | ||
| 26 | +} | ||
| 27 | +.bg-gray{ | ||
| 28 | + background: #F5F5F5; | ||
| 29 | +} | ||
| 30 | +.room-more{ | ||
| 31 | + margin-top: 10rpx; | ||
| 32 | +} | ||
| 33 | +.room-consume{ | ||
| 34 | + margin-top:6rpx; | ||
| 35 | + color:#C3A66B; | ||
| 36 | +} | ||
| 37 | +.room-full{ | ||
| 38 | + width:148rpx; | ||
| 39 | + height:148rpx; | ||
| 40 | + border-radius:50%; | ||
| 41 | + position: absolute; | ||
| 42 | + right:-74rpx; | ||
| 43 | + bottom:-74rpx; | ||
| 44 | + background: #E0E0E0; | ||
| 45 | + padding:34rpx 20rpx; | ||
| 46 | + box-sizing: border-box; | ||
| 47 | +} | ||
| 48 | +.room-select{ | ||
| 49 | + min-width:92rpx; | ||
| 50 | + height:40rpx; | ||
| 51 | + position: absolute; | ||
| 52 | + right:0; | ||
| 53 | + top:0; | ||
| 54 | + background: #C6A96E; | ||
| 55 | + border-bottom-left-radius: 10rpx; | ||
| 56 | + padding:0 4rpx; | ||
| 57 | + box-sizing: border-box; | ||
| 58 | +} |
| @@ -8,12 +8,33 @@ Component({ | @@ -8,12 +8,33 @@ Component({ | ||
| 8 | value:util.unixtoTime(new Date()/1000,'YYYY-MM-DD') | 8 | value:util.unixtoTime(new Date()/1000,'YYYY-MM-DD') |
| 9 | }, | 9 | }, |
| 10 | section:String, | 10 | section:String, |
| 11 | - seletroom:{ | ||
| 12 | - type:Array, | ||
| 13 | - value:[] | ||
| 14 | - } | ||
| 15 | }, | 11 | }, |
| 16 | data:{ | 12 | data:{ |
| 17 | - | 13 | + seletroomlist:[] |
| 14 | + }, | ||
| 15 | + attached(){ | ||
| 16 | + this.room=this.selectComponent('#room'); | ||
| 17 | + console.log('xxxxx',this.data.seller); | ||
| 18 | + }, | ||
| 19 | + methods:{ | ||
| 20 | + selectroom(e){ | ||
| 21 | + console.log(e) | ||
| 22 | + let _target=e.detail; | ||
| 23 | + let seletroomlist=this.data.seletroomlist; | ||
| 24 | + seletroomlist.push(_target); | ||
| 25 | + this.setData({ | ||
| 26 | + seletroomlist:this.data.seletroomlist | ||
| 27 | + }) | ||
| 28 | + this.triggerEvent('changeroom',{selectroom:this.data.seletroomlist}) | ||
| 29 | + }, | ||
| 30 | + cancelroom(e){ | ||
| 31 | + let _target=e.currentTarget.dataset; | ||
| 32 | + this.data.seletroomlist.splice(_target.index,1); | ||
| 33 | + this.setData({ | ||
| 34 | + seletroomlist:this.data.seletroomlist | ||
| 35 | + }) | ||
| 36 | + this.room.cancelroom(_target.id); | ||
| 37 | + this.triggerEvent('changeroom',{selectroom:this.data.seletroomlist}); | ||
| 38 | + } | ||
| 18 | } | 39 | } |
| 19 | }) | 40 | }) |
| 1 | -<view>ddddddddd</view> | ||
| 1 | +<view class="select-rooms flex-rs"> | ||
| 2 | + <view class="select-rooms-title black-font font-bold font30r">已选包间</view> | ||
| 3 | + <block wx:for="{{seletroomlist}}" wx:key="{{index}}"> | ||
| 4 | + <view class="select-rooms-item flex-vc" data-index="{{index}}" data-id="{{item.id}}" catchtap="cancelroom"> | ||
| 5 | + <view class="white-font font-bold font30r">{{item.name}}</view> | ||
| 6 | + <view class="select-rooms-close flex-cc"> | ||
| 7 | + <image src="../../../pages/image/close.jpg" class="close-icon"></image> | ||
| 8 | + </view> | ||
| 9 | + </view> | ||
| 10 | + </block> | ||
| 11 | +</view> | ||
| 12 | +<room bindselectroom="selectroom" id="room"></room> |
| 1 | +@import "../../../app.wxss"; | ||
| 2 | +.select-rooms{ | ||
| 3 | + width:100%; | ||
| 4 | + padding:70rpx 0 0 30rpx; | ||
| 5 | + box-sizing: border-box; | ||
| 6 | +} | ||
| 7 | +.select-rooms-title{ | ||
| 8 | + margin-right:30rpx; | ||
| 9 | + height:70rpx; | ||
| 10 | + margin-bottom:20rpx; | ||
| 11 | +} | ||
| 12 | +.select-rooms-item{ | ||
| 13 | + width:150rpx; | ||
| 14 | + height:70rpx; | ||
| 15 | + margin-right:30rpx; | ||
| 16 | + background: -webkit-linear-gradient(top, #F2D190, #C0A369); /* Safari 5.1 - 6.0 */ | ||
| 17 | + background: -o-linear-gradient(-45deg, #F2D190, #C0A369); /* Opera 11.1 - 12.0 */ | ||
| 18 | + background: -moz-linear-gradient(top, #F2D190, #C0A369); /* Firefox 3.6 - 15 */ | ||
| 19 | + background: linear-gradient(to bottom, #F2D190, #C0A369); | ||
| 20 | + border-radius:10rpx; | ||
| 21 | + position: relative; | ||
| 22 | + margin-bottom:20rpx; | ||
| 23 | +} | ||
| 24 | +.select-rooms-close{ | ||
| 25 | + width:36rpx; | ||
| 26 | + height:36rpx; | ||
| 27 | + background: #C1C0C0; | ||
| 28 | + border-radius:50%; | ||
| 29 | + position: absolute; | ||
| 30 | + right:-18rpx; | ||
| 31 | + top:-18rpx; | ||
| 32 | +} | ||
| 33 | +.close-icon{ | ||
| 34 | + width:14rpx; | ||
| 35 | + height:14rpx; | ||
| 36 | +} |
| @@ -52,7 +52,7 @@ Component({ | @@ -52,7 +52,7 @@ Component({ | ||
| 52 | //选中时间时间戳 | 52 | //选中时间时间戳 |
| 53 | let selectedtime=Number(util.timetouUnix(this.data.date,'-')); | 53 | let selectedtime=Number(util.timetouUnix(this.data.date,'-')); |
| 54 | //选中日期星期几 | 54 | //选中日期星期几 |
| 55 | - let selectedweek=new Date(selectedtime*1000).getDay(); | 55 | + let selectedweek=new Date(this.data.date).getDay(); |
| 56 | //今天日期 | 56 | //今天日期 |
| 57 | let today=util.unixtoTime(new Date()/1000,'YYYY-MM-DD'); | 57 | let today=util.unixtoTime(new Date()/1000,'YYYY-MM-DD'); |
| 58 | console.log('selectedweek',selectedweek) | 58 | console.log('selectedweek',selectedweek) |
| @@ -23,4 +23,6 @@ | @@ -23,4 +23,6 @@ | ||
| 23 | </view> | 23 | </view> |
| 24 | 24 | ||
| 25 | <view class="calendar-mask" hidden="{{hidecalendar}}" catchtap="closecalendar"></view> | 25 | <view class="calendar-mask" hidden="{{hidecalendar}}" catchtap="closecalendar"></view> |
| 26 | -<calendar seller="{{seller}}" date="{{date}}" hidecalendar="{{hidecalendar}}" bind:tellselectdate="tellselectdate"></calendar> | ||
| 26 | +<view class="calendar-cover" hidden="{{hidecalendar}}"> | ||
| 27 | + <online-calendar seller="{{seller}}" date="{{date}}" hidecalendar="{{hidecalendar}}" bindtellselectdate="tellselectdate"></online-calendar> | ||
| 28 | +</view> |
| @@ -51,4 +51,15 @@ | @@ -51,4 +51,15 @@ | ||
| 51 | bottom:0; | 51 | bottom:0; |
| 52 | z-index:10; | 52 | z-index:10; |
| 53 | background:rgba(21,20,20,.5); | 53 | background:rgba(21,20,20,.5); |
| 54 | +} | ||
| 55 | +.calendar-cover{ | ||
| 56 | + position: fixed; | ||
| 57 | + left:0; | ||
| 58 | + right:0; | ||
| 59 | + bottom:0; | ||
| 60 | + background: #FFFBF2; | ||
| 61 | + border-top-left-radius:20rpx; | ||
| 62 | + border-top-right-radius:20rpx; | ||
| 63 | + overflow: hidden; | ||
| 64 | + z-index:11; | ||
| 54 | } | 65 | } |
pages/image/close.jpg
0 → 100644
300 Bytes
pages/image/concat.jpg
0 → 100644
3.73 KB
pages/me/concat.js
0 → 100644
| 1 | +import util from '../../utils/util'; | ||
| 2 | +import App from '../../utils/api'; | ||
| 3 | +Page({ | ||
| 4 | + data:{ | ||
| 5 | + | ||
| 6 | + }, | ||
| 7 | + onLoad(opt){ | ||
| 8 | + console.log(opt) | ||
| 9 | + this.action=opt.action ? opt.action : null | ||
| 10 | + }, | ||
| 11 | + onShow(){ | ||
| 12 | + this.getlist(); | ||
| 13 | + }, | ||
| 14 | + getlist(){ | ||
| 15 | + App.Customer.GetCustomerInfo().then((json)=>{ | ||
| 16 | + console.log(json) | ||
| 17 | + if(json.ret==200){ | ||
| 18 | + this.setData({ | ||
| 19 | + concatlist:json.data | ||
| 20 | + }) | ||
| 21 | + } | ||
| 22 | + }) | ||
| 23 | + }, | ||
| 24 | + edit(e){ | ||
| 25 | + console.log(e) | ||
| 26 | + let index=e.currentTarget.dataset.index; | ||
| 27 | + if(this.action){ | ||
| 28 | + let pages = getCurrentPages(); | ||
| 29 | + pages[pages.length-2].setData({ | ||
| 30 | + user:this.data.concatlist[index] | ||
| 31 | + }) | ||
| 32 | + wx.navigateBack() | ||
| 33 | + }else{ | ||
| 34 | + let path='setting'; | ||
| 35 | + let i=0; | ||
| 36 | + for(let key in this.data.concatlist[index]){ | ||
| 37 | + if(i==0){ | ||
| 38 | + path+='?' | ||
| 39 | + }else{ | ||
| 40 | + path+='&' | ||
| 41 | + } | ||
| 42 | + i++; | ||
| 43 | + path+=key+'='+this.data.concatlist[index][key] | ||
| 44 | + } | ||
| 45 | + wx.navigateTo({ | ||
| 46 | + url:path | ||
| 47 | + }) | ||
| 48 | + } | ||
| 49 | + }, | ||
| 50 | + add(){ | ||
| 51 | + wx.navigateTo({ | ||
| 52 | + url:'setting' | ||
| 53 | + }) | ||
| 54 | + } | ||
| 55 | +}) |
pages/me/concat.json
0 → 100644
pages/me/concat.wxml
0 → 100644
| 1 | +<nav hasHome>常用联系人</nav> | ||
| 2 | +<view class="concat-list"> | ||
| 3 | + <block wx:for="{{concatlist}}" wx:key="{{index}}"> | ||
| 4 | + <view class="flex-lr item font30r black-font" data-index="{{index}}" catchtap="edit"> | ||
| 5 | + <view class="font-bold">{{item.name}}</view> | ||
| 6 | + <view>{{item.phone}}</view> | ||
| 7 | + </view> | ||
| 8 | + </block> | ||
| 9 | +</view> | ||
| 10 | + | ||
| 11 | +<view class="white-font font32r add-button flex-cc" catchtap="add">新建联系人</view> |
pages/me/concat.wxss
0 → 100644
| 1 | +.concat-list{ | ||
| 2 | + width:100%; | ||
| 3 | + padding:0 40rpx; | ||
| 4 | + box-sizing: border-box; | ||
| 5 | +} | ||
| 6 | +.item{ | ||
| 7 | + width:100%; | ||
| 8 | + height:140rpx; | ||
| 9 | + border-bottom: 2rpx solid #F1F0F4; | ||
| 10 | + box-sizing: border-box; | ||
| 11 | +} | ||
| 12 | +.add-button{ | ||
| 13 | + width:680rpx; | ||
| 14 | + height:80rpx; | ||
| 15 | + position: fixed; | ||
| 16 | + left:0; | ||
| 17 | + right:0; | ||
| 18 | + bottom:80rpx; | ||
| 19 | + margin:0 auto; | ||
| 20 | + background: #242320; | ||
| 21 | +} |
| @@ -23,14 +23,22 @@ | @@ -23,14 +23,22 @@ | ||
| 23 | </view> | 23 | </view> |
| 24 | </view> | 24 | </view> |
| 25 | </formids> | 25 | </formids> |
| 26 | - <formids url="/pages/me/setting"> | 26 | + <!-- <formids url="/pages/me/setting"> |
| 27 | <view class="item flex-lr"> | 27 | <view class="item flex-lr"> |
| 28 | <view class="left">常用信息</view> | 28 | <view class="left">常用信息</view> |
| 29 | <view class="right"> | 29 | <view class="right"> |
| 30 | <image src="http://qn.colorcun.com/custom/lite-yd/image/click.png"></image> | 30 | <image src="http://qn.colorcun.com/custom/lite-yd/image/click.png"></image> |
| 31 | </view> | 31 | </view> |
| 32 | </view> | 32 | </view> |
| 33 | - </formids> | 33 | + </formids> --> |
| 34 | + <formids url="/pages/me/concat"> | ||
| 35 | + <view class="item flex-lr"> | ||
| 36 | + <view class="left">常用联系人</view> | ||
| 37 | + <view class="right"> | ||
| 38 | + <image src="http://qn.colorcun.com/custom/lite-yd/image/click.png"></image> | ||
| 39 | + </view> | ||
| 40 | + </view> | ||
| 41 | + </formids> | ||
| 34 | <formids bindclick="gotoSellerBook" wx:if="{{hasSellerBook}}"> | 42 | <formids bindclick="gotoSellerBook" wx:if="{{hasSellerBook}}"> |
| 35 | <view class="item flex-lr"> | 43 | <view class="item flex-lr"> |
| 36 | <view class="left">切换到商户模式</view> | 44 | <view class="left">切换到商户模式</view> |
| @@ -7,7 +7,8 @@ const _u = { | @@ -7,7 +7,8 @@ const _u = { | ||
| 7 | name: '', | 7 | name: '', |
| 8 | sex: 1, | 8 | sex: 1, |
| 9 | phone: '', | 9 | phone: '', |
| 10 | - remark: '', | 10 | + is_default:0, |
| 11 | + remark:'' | ||
| 11 | } | 12 | } |
| 12 | Page({ | 13 | Page({ |
| 13 | 14 | ||
| @@ -22,14 +23,13 @@ Page({ | @@ -22,14 +23,13 @@ Page({ | ||
| 22 | * 生命周期函数--监听页面加载 | 23 | * 生命周期函数--监听页面加载 |
| 23 | */ | 24 | */ |
| 24 | onLoad: function (options) { | 25 | onLoad: function (options) { |
| 25 | - App.Customer.GetCustomerInfo().then(res=>{ | ||
| 26 | - if(res.data){ | ||
| 27 | - this.user = res.data | ||
| 28 | - this.setData({ | ||
| 29 | - user: res.data, | ||
| 30 | - }) | ||
| 31 | - } | ||
| 32 | - }) | 26 | + console.log(options) |
| 27 | + if(options && options.id){ | ||
| 28 | + this.setData({ | ||
| 29 | + user:options | ||
| 30 | + }) | ||
| 31 | + } | ||
| 32 | + this.user=this.data.user; | ||
| 33 | }, | 33 | }, |
| 34 | 34 | ||
| 35 | /** | 35 | /** |
| @@ -61,6 +61,7 @@ Page({ | @@ -61,6 +61,7 @@ Page({ | ||
| 61 | }, | 61 | }, |
| 62 | 62 | ||
| 63 | saved() { | 63 | saved() { |
| 64 | + console.log(this.user.name) | ||
| 64 | if(!this.user.name){ | 65 | if(!this.user.name){ |
| 65 | return util.toast('请填写预定人','none') | 66 | return util.toast('请填写预定人','none') |
| 66 | } | 67 | } |
| @@ -72,18 +73,37 @@ Page({ | @@ -72,18 +73,37 @@ Page({ | ||
| 72 | }) | 73 | }) |
| 73 | }, | 74 | }, |
| 74 | changeInput(e) { | 75 | changeInput(e) { |
| 76 | + console.log(e) | ||
| 75 | let key = util.attr(e, 'key'); | 77 | let key = util.attr(e, 'key'); |
| 76 | let val = '' | 78 | let val = '' |
| 77 | - if (key == 'sex') { | 79 | + if (key == 'sex' || key == 'is_default') { |
| 78 | val = util.attr(e, 'val'); | 80 | val = util.attr(e, 'val'); |
| 81 | + console.log(val) | ||
| 79 | } else { | 82 | } else { |
| 80 | val = util.val(e); | 83 | val = util.val(e); |
| 81 | } | 84 | } |
| 82 | this.user[key] = val; | 85 | this.user[key] = val; |
| 83 | - if (key == 'sex') { | 86 | + if (key == 'sex' || key == 'is_default') { |
| 84 | this.setData({ | 87 | this.setData({ |
| 85 | user: this.user | 88 | user: this.user |
| 86 | }) | 89 | }) |
| 87 | } | 90 | } |
| 88 | }, | 91 | }, |
| 92 | + getphone(e){ | ||
| 93 | + console.log('getphone',e); | ||
| 94 | + if(e.detail.ret!=200){ | ||
| 95 | + return util.toast('获取失败,请重新获取','none'); | ||
| 96 | + } | ||
| 97 | + this.user.phone=e.detail.phone | ||
| 98 | + this.setData({ | ||
| 99 | + user: this.user | ||
| 100 | + }) | ||
| 101 | + }, | ||
| 102 | + deletuser(){ | ||
| 103 | + App.Customer.DelCustomerInfo({phone:this.user.phone}).then((json)=>{ | ||
| 104 | + App.Customer.GetCustomerInfo({},'clear') | ||
| 105 | + wx.navigateBack() | ||
| 106 | + console.log(json) | ||
| 107 | + }) | ||
| 108 | + } | ||
| 89 | }) | 109 | }) |
| @@ -4,6 +4,7 @@ | @@ -4,6 +4,7 @@ | ||
| 4 | "navigationBarTitleText":"我的", | 4 | "navigationBarTitleText":"我的", |
| 5 | "usingComponents": { | 5 | "usingComponents": { |
| 6 | "nav":"/components/nav/nav", | 6 | "nav":"/components/nav/nav", |
| 7 | - "formids":"/components/formids/formids" | 7 | + "formids":"/components/formids/formids", |
| 8 | + "phone":"/components/userinfo/getphone" | ||
| 8 | } | 9 | } |
| 9 | } | 10 | } |
| 1 | <!--pages/me/setting.wxml--> | 1 | <!--pages/me/setting.wxml--> |
| 2 | <nav hasHome>常用信息</nav> | 2 | <nav hasHome>常用信息</nav> |
| 3 | <view class="page"> | 3 | <view class="page"> |
| 4 | - <view class="tip">在这里维护你的常用预订信息</view> | 4 | + <!-- <view class="tip">在这里维护你的常用预订信息</view> --> |
| 5 | <view class="card"> | 5 | <view class="card"> |
| 6 | <view class="item flex-lr"> | 6 | <view class="item flex-lr"> |
| 7 | - <view class="item-label">预 订 人</view> | ||
| 8 | - <view class="Medium flex-rr"> | ||
| 9 | - <input class="name input" placeholder="请输入姓名" | 7 | + <view class="Medium flex-ll"> |
| 8 | + <view class="item-label">姓名</view> | ||
| 9 | + <input class="name input" placeholder="请填写用餐人姓名" | ||
| 10 | bindinput="changeInput" | 10 | bindinput="changeInput" |
| 11 | data-key="name" | 11 | data-key="name" |
| 12 | value="{{user.name}}" | 12 | value="{{user.name}}" |
| 13 | placeholder-class="input-pl" maxlength="10"/> | 13 | placeholder-class="input-pl" maxlength="10"/> |
| 14 | - <view class="flex-rr switch"> | ||
| 15 | - <view | ||
| 16 | - bindtap="changeInput" | ||
| 17 | - data-key="sex" | ||
| 18 | - data-val="1" | ||
| 19 | - class="switch-item {{user.sex==1?'checked':''}}">先生</view> | ||
| 20 | - <view | ||
| 21 | - bindtap="changeInput" | ||
| 22 | - data-key="sex" | ||
| 23 | - data-val="2" | ||
| 24 | - class="switch-item {{user.sex==2?'checked':''}}">女士</view> | ||
| 25 | - <view | ||
| 26 | - bindtap="changeInput" | ||
| 27 | - data-key="sex" | ||
| 28 | - data-val="3" | ||
| 29 | - class="switch-item {{user.sex==3?'checked':''}}">公司</view> | ||
| 30 | - </view> | ||
| 31 | </view> | 14 | </view> |
| 15 | + <view class="flex-rr switch"> | ||
| 16 | + <view | ||
| 17 | + bindtap="changeInput" | ||
| 18 | + data-key="sex" | ||
| 19 | + data-val="1" | ||
| 20 | + class="switch-item {{user.sex==1?'checked':''}}">先生</view> | ||
| 21 | + <view | ||
| 22 | + bindtap="changeInput" | ||
| 23 | + data-key="sex" | ||
| 24 | + data-val="2" | ||
| 25 | + class="switch-item {{user.sex==2?'checked':''}}">女士</view> | ||
| 26 | + <view | ||
| 27 | + bindtap="changeInput" | ||
| 28 | + data-key="sex" | ||
| 29 | + data-val="3" | ||
| 30 | + class="switch-item {{user.sex==3?'checked':''}}">公司</view> | ||
| 31 | + </view> | ||
| 32 | </view> | 32 | </view> |
| 33 | <view class="item flex-lr"> | 33 | <view class="item flex-lr"> |
| 34 | - <view class="item-label">手机号码</view> | ||
| 35 | - <view class="Medium"> | ||
| 36 | - <input class="phone input" placeholder="请输入手机号码" | 34 | + <view class="Medium flex-ll"> |
| 35 | + <view class="item-label">手机</view> | ||
| 36 | + <input class="phone input" placeholder="请填写联系方式" | ||
| 37 | bindinput="changeInput" | 37 | bindinput="changeInput" |
| 38 | data-key="phone" | 38 | data-key="phone" |
| 39 | type="number" | 39 | type="number" |
| 40 | value="{{user.phone}}" | 40 | value="{{user.phone}}" |
| 41 | placeholder-class="input-pl" maxlength="20"/> | 41 | placeholder-class="input-pl" maxlength="20"/> |
| 42 | </view> | 42 | </view> |
| 43 | + <view class="flex-rr"> | ||
| 44 | + <!-- 一键获取 --> | ||
| 45 | + <phone bindgetphone="getphone"> | ||
| 46 | + <view class="smooth white-font get-phone flex-vc" style="font-size:28rpx;">一键获取</view> | ||
| 47 | + </phone> | ||
| 48 | + </view> | ||
| 43 | </view> | 49 | </view> |
| 44 | - <view class="item flex-lr"> | 50 | + <view class="flex-vl userinfo-setting"> |
| 51 | + <view class="flex-lr" style="margin-bottom:30rpx;"> | ||
| 52 | + <view class="font30r font-bold">设置默认联系人</view> | ||
| 53 | + <switch color="#C0A369" checked="{{user.is_default==1 ? true : false}}" | ||
| 54 | + data-key="is_default" data-val="{{user.is_default==1 ? 0 : 1}}" bindchange="changeInput"/> | ||
| 55 | + </view> | ||
| 56 | + <view class="gray-font font28r" style="line-height:1.5;">提醒:每次下单时商家会记录默认联系人作为订单联系 人,在预订过程中,如有需要,商家将联系订单联系人</view> | ||
| 57 | + </view> | ||
| 58 | + <block wx:if="{{user.id}}"> | ||
| 59 | + <view class="item flex-lr"> | ||
| 60 | + <view class="font30r font-bold">删除联系人</view> | ||
| 61 | + <switch color="#C0A369" bindchange="deletuser"/> | ||
| 62 | + </view> | ||
| 63 | + </block> | ||
| 64 | + <!-- <view class="item flex-lr"> | ||
| 45 | <view class="item-label">备注信息</view> | 65 | <view class="item-label">备注信息</view> |
| 46 | <view class="Medium"> | 66 | <view class="Medium"> |
| 47 | <input class="cusdem input" placeholder="请填写预订需求" | 67 | <input class="cusdem input" placeholder="请填写预订需求" |
| @@ -50,9 +70,11 @@ | @@ -50,9 +70,11 @@ | ||
| 50 | value="{{user.remark}}" | 70 | value="{{user.remark}}" |
| 51 | placeholder-class="input-pl" maxlength="20"/> | 71 | placeholder-class="input-pl" maxlength="20"/> |
| 52 | </view> | 72 | </view> |
| 53 | - </view> | 73 | + </view> --> |
| 54 | </view> | 74 | </view> |
| 55 | - <formids bindclick="saved"> | ||
| 56 | - <view class="share-but">保存</view> | ||
| 57 | - </formids> | 75 | + <view class="save-button"> |
| 76 | + <formids bindclick="saved"> | ||
| 77 | + <view class="share-but">保存</view> | ||
| 78 | + </formids> | ||
| 79 | + </view> | ||
| 58 | </view> | 80 | </view> |
| 1 | /* pages/me/setting.wxss */ | 1 | /* pages/me/setting.wxss */ |
| 2 | .page{ | 2 | .page{ |
| 3 | - width: 90%; | ||
| 4 | - margin: 0 5%; | 3 | + width: 100%; |
| 5 | color:#353535; | 4 | color:#353535; |
| 6 | } | 5 | } |
| 7 | .tip{ | 6 | .tip{ |
| @@ -10,18 +9,20 @@ | @@ -10,18 +9,20 @@ | ||
| 10 | margin-bottom: 38rpx; | 9 | margin-bottom: 38rpx; |
| 11 | } | 10 | } |
| 12 | .card{ | 11 | .card{ |
| 13 | - box-shadow: 2rpx 2rpx 14rpx 6rpx RGBA(231, 228, 228, 0.5); | ||
| 14 | - font-size: 30rpx; | ||
| 15 | - padding: 0 40rpx; | ||
| 16 | - border-radius: 10rpx; | 12 | + width:100%; |
| 13 | + padding:0 30rpx; | ||
| 14 | + box-sizing: border-box; | ||
| 17 | } | 15 | } |
| 18 | .item{ | 16 | .item{ |
| 19 | height: 124rpx; | 17 | height: 124rpx; |
| 20 | line-height: 124rpx; | 18 | line-height: 124rpx; |
| 19 | + border-bottom: 2rpx solid #F5F5F5; | ||
| 20 | + padding-top: 20rpx; | ||
| 21 | } | 21 | } |
| 22 | .item-label{ | 22 | .item-label{ |
| 23 | width: 120rpx; | 23 | width: 120rpx; |
| 24 | min-width: 120rpx; | 24 | min-width: 120rpx; |
| 25 | + font-weight:bold; | ||
| 25 | } | 26 | } |
| 26 | .item view:last-child{ | 27 | .item view:last-child{ |
| 27 | font-size: 34rpx; | 28 | font-size: 34rpx; |
| @@ -30,30 +31,54 @@ | @@ -30,30 +31,54 @@ | ||
| 30 | width: 252rpx; | 31 | width: 252rpx; |
| 31 | height: 50rpx; | 32 | height: 50rpx; |
| 32 | line-height: 50rpx; | 33 | line-height: 50rpx; |
| 33 | - border: 2rpx solid #262628; | 34 | + border: 2rpx solid #C0A369; |
| 34 | margin-left: 16rpx; | 35 | margin-left: 16rpx; |
| 35 | font-size: 28rpx; | 36 | font-size: 28rpx; |
| 37 | + border-right:0; | ||
| 36 | } | 38 | } |
| 37 | input.input{ | 39 | input.input{ |
| 38 | - text-align: right !important; | ||
| 39 | width: 100%; | 40 | width: 100%; |
| 40 | } | 41 | } |
| 42 | +.input-pl{ | ||
| 43 | + font-size: 28rpx; | ||
| 44 | + color:#999; | ||
| 45 | +} | ||
| 41 | .switch .switch-item{ | 46 | .switch .switch-item{ |
| 42 | width: 84rpx; | 47 | width: 84rpx; |
| 43 | height: 50rpx; | 48 | height: 50rpx; |
| 44 | line-height: 50rpx; | 49 | line-height: 50rpx; |
| 45 | text-align: center; | 50 | text-align: center; |
| 51 | + color: #C0A369; | ||
| 52 | + border-right: 2rpx solid #C0A369; | ||
| 46 | } | 53 | } |
| 47 | .switch .checked{ | 54 | .switch .checked{ |
| 48 | - background-color:#262628; | ||
| 49 | - color: #FEFEFE; | 55 | + background-color:#C0A369; |
| 56 | + color: #FEFEFE; | ||
| 57 | +} | ||
| 58 | +.save-button{ | ||
| 59 | + width:680rpx; | ||
| 60 | + height:80rpx; | ||
| 61 | + position: fixed; | ||
| 62 | + left:0; | ||
| 63 | + right:0; | ||
| 64 | + bottom:80rpx; | ||
| 65 | + margin:0 auto; | ||
| 50 | } | 66 | } |
| 51 | .share-but{ | 67 | .share-but{ |
| 52 | color:#FEFEFE; | 68 | color:#FEFEFE; |
| 53 | background: #262628; | 69 | background: #262628; |
| 54 | - width: 100%; | 70 | + width: 680rpx; |
| 55 | line-height: 80rpx; | 71 | line-height: 80rpx; |
| 56 | font-size: 34rpx; | 72 | font-size: 34rpx; |
| 57 | text-align: center; | 73 | text-align: center; |
| 58 | - margin-top: 300rpx; | 74 | +} |
| 75 | +.get-phone{ | ||
| 76 | + width:160rpx; | ||
| 77 | + height:50rpx; | ||
| 78 | + line-height: 50rpx; | ||
| 79 | + background: #C0A369; | ||
| 80 | +} | ||
| 81 | +.userinfo-setting{ | ||
| 82 | + padding: 60rpx 0 30rpx 0; | ||
| 83 | + border-bottom: 2rpx solid #F5F5F5; | ||
| 59 | } | 84 | } |
| @@ -276,12 +276,29 @@ Page({ | @@ -276,12 +276,29 @@ Page({ | ||
| 276 | //时段改变 | 276 | //时段改变 |
| 277 | selectsection(e){ | 277 | selectsection(e){ |
| 278 | console.log(e); | 278 | console.log(e); |
| 279 | - this.setData({ | ||
| 280 | - reserveSection:e.detail.section | ||
| 281 | - }) | 279 | + let t=setTimeout(()=>{ |
| 280 | + this.setData({ | ||
| 281 | + reserveSection:e.detail.section, | ||
| 282 | + }) | ||
| 283 | + clearTimeout(t); | ||
| 284 | + },0) | ||
| 285 | + | ||
| 282 | this.reserve.section=e.detail.section; | 286 | this.reserve.section=e.detail.section; |
| 283 | this.reserve.time=e.detail.time; | 287 | this.reserve.time=e.detail.time; |
| 284 | }, | 288 | }, |
| 289 | + //包间类型改变 | ||
| 290 | + selectroom(e){ | ||
| 291 | + console.log(e) | ||
| 292 | + this.reserve.selectroom=e.detail.selectroom; | ||
| 293 | + }, | ||
| 294 | + complete(){ | ||
| 295 | + this.reserve.sid=this.options.id | ||
| 296 | + this.reserve.ddate=util.timetouUnix(this.reserve.date+' '+this.reserve.time+':00'); | ||
| 297 | + this.reserve.selectroom=JSON.stringify(this.reserve.selectroom); | ||
| 298 | + wx.navigateTo({ | ||
| 299 | + url:util.http_build_query(this.reserve,'./submit') | ||
| 300 | + }) | ||
| 301 | + }, | ||
| 285 | selecttime(e){//时间改变 | 302 | selecttime(e){//时间改变 |
| 286 | console.log(e); | 303 | console.log(e); |
| 287 | if(!e.detail.time){//满房 | 304 | if(!e.detail.time){//满房 |
| @@ -316,6 +333,7 @@ Page({ | @@ -316,6 +333,7 @@ Page({ | ||
| 316 | reserveDate:e.detail.date, | 333 | reserveDate:e.detail.date, |
| 317 | hasFullHouse:false, | 334 | hasFullHouse:false, |
| 318 | fullHouseMsg:'今日所有包间已订满', | 335 | fullHouseMsg:'今日所有包间已订满', |
| 336 | + reserveSection:e.detail.section | ||
| 319 | }) | 337 | }) |
| 320 | } | 338 | } |
| 321 | }) | 339 | }) |
| @@ -213,9 +213,9 @@ | @@ -213,9 +213,9 @@ | ||
| 213 | <view class="olreserve bg_white"> | 213 | <view class="olreserve bg_white"> |
| 214 | <calendar seller="{{seller}}" bindselectdate="selectdate"></calendar> | 214 | <calendar seller="{{seller}}" bindselectdate="selectdate"></calendar> |
| 215 | <view class="reserve-time Semibold">预订时段</view> | 215 | <view class="reserve-time Semibold">预订时段</view> |
| 216 | - <section seller="{{seller}}" date="{{reserveDate}}" bindselectsection="selectsection"></section> | ||
| 217 | - <select-room seller="{{seller}}" date="{{reserveDate}}" section="{{reserveSection}}"></select-room> | ||
| 218 | - <view class="hasFullHouse Semibold flex-vc" wx:if="{{hasFullHouse}}">{{fullHouseMsg}}</view> | 216 | + <section seller="{{seller}}" date="{{reserveDate}}" bind:selectsection="selectsection"></section> |
| 217 | + <select-room seller="{{seller}}" date="{{reserveDate}}" section="{{reserveSection}}" bindchangeroom="selectroom"></select-room> | ||
| 219 | </view> | 218 | </view> |
| 219 | + <view class="white-font font32r reserve-button flex-cc" catchtap="complete">选好了</view> | ||
| 220 | </view> | 220 | </view> |
| 221 | </layout> | 221 | </layout> |
| @@ -532,3 +532,13 @@ | @@ -532,3 +532,13 @@ | ||
| 532 | background-position: center center; | 532 | background-position: center center; |
| 533 | background-image: url("https://qn.colorcun.com/reserve/images/sphone.png"); | 533 | background-image: url("https://qn.colorcun.com/reserve/images/sphone.png"); |
| 534 | } | 534 | } |
| 535 | +.reserve-button{ | ||
| 536 | + width:680rpx; | ||
| 537 | + height:80rpx; | ||
| 538 | + position: fixed; | ||
| 539 | + left:0; | ||
| 540 | + right:0; | ||
| 541 | + bottom:80rpx; | ||
| 542 | + margin:0 auto; | ||
| 543 | + background: #242320; | ||
| 544 | +} |
| @@ -23,14 +23,20 @@ Page({ | @@ -23,14 +23,20 @@ Page({ | ||
| 23 | */ | 23 | */ |
| 24 | options:null, | 24 | options:null, |
| 25 | onLoad: function (options) { | 25 | onLoad: function (options) { |
| 26 | + console.log(options) | ||
| 26 | this.options=options | 27 | this.options=options |
| 27 | this.GetSellerDetail(); | 28 | this.GetSellerDetail(); |
| 28 | App.Customer.GetCustomerInfo().then(res=>{ | 29 | App.Customer.GetCustomerInfo().then(res=>{ |
| 29 | - if(res.data){ | ||
| 30 | - this.user = res.data | ||
| 31 | - this.setData({ | ||
| 32 | - user: res.data, | ||
| 33 | - }) | 30 | + if(res.data.length>0){ |
| 31 | + res.data.forEach((v,i)=>{ | ||
| 32 | + if(v.is_default==1){ | ||
| 33 | + this.user = v | ||
| 34 | + this.setData({ | ||
| 35 | + user: v, | ||
| 36 | + }) | ||
| 37 | + return; | ||
| 38 | + } | ||
| 39 | + }) | ||
| 34 | } | 40 | } |
| 35 | }) | 41 | }) |
| 36 | }, | 42 | }, |
| @@ -93,6 +99,11 @@ Page({ | @@ -93,6 +99,11 @@ Page({ | ||
| 93 | } | 99 | } |
| 94 | }) | 100 | }) |
| 95 | }, | 101 | }, |
| 102 | + selectconcat(){ | ||
| 103 | + wx.navigateTo({ | ||
| 104 | + url:'/pages/me/concat?action=select' | ||
| 105 | + }) | ||
| 106 | + }, | ||
| 96 | changeInput(e) { | 107 | changeInput(e) { |
| 97 | let key = util.attr(e, 'key'); | 108 | let key = util.attr(e, 'key'); |
| 98 | let val = '' | 109 | let val = '' |
| 1 | <!--pages/reserve/submit.wxml--> | 1 | <!--pages/reserve/submit.wxml--> |
| 2 | <layout> | 2 | <layout> |
| 3 | <nav hasBack>预订详情</nav> | 3 | <nav hasBack>预订详情</nav> |
| 4 | -<view class="pages"> | 4 | +<view class="pages bg_white"> |
| 5 | <card hasShowStatus hasAddress="{{false}}" bindevent="cardEvent" | 5 | <card hasShowStatus hasAddress="{{false}}" bindevent="cardEvent" |
| 6 | hasOnlineReserve | 6 | hasOnlineReserve |
| 7 | seller="{{seller}}" detail="{{detail}}"> | 7 | seller="{{seller}}" detail="{{detail}}"> |
| @@ -14,6 +14,15 @@ | @@ -14,6 +14,15 @@ | ||
| 14 | </view> | 14 | </view> |
| 15 | </card> | 15 | </card> |
| 16 | <view class="userinfo"> | 16 | <view class="userinfo"> |
| 17 | + <view class="userinfo-title flex-lr" catchtap="selectconcat"> | ||
| 18 | + <view class="flex-ll"> | ||
| 19 | + <image src="../image/concat.jpg" class="concat-icon"></image> | ||
| 20 | + <view class="black-font font36r" style="font-size:36rpx;">选择联系人</view> | ||
| 21 | + </view> | ||
| 22 | + <view class="click-cover"> | ||
| 23 | + <image src="../image/click-icon.png"></image> | ||
| 24 | + </view> | ||
| 25 | + </view> | ||
| 17 | <view class="item flex-lr"> | 26 | <view class="item flex-lr"> |
| 18 | <view class="item-label">姓名</view> | 27 | <view class="item-label">姓名</view> |
| 19 | <view class="Medium flex-rr"> | 28 | <view class="Medium flex-rr"> |
| @@ -58,17 +67,17 @@ | @@ -58,17 +67,17 @@ | ||
| 58 | </view> | 67 | </view> |
| 59 | </view> | 68 | </view> |
| 60 | </view> | 69 | </view> |
| 61 | - <view class="item flex-lr"> | ||
| 62 | - <view class="item-label">备注</view> | ||
| 63 | - <view class="Medium"> | ||
| 64 | - <input class="cusdem input" placeholder="您的特殊要求,我们会尽量安排(20字)" | ||
| 65 | - bindinput="changeInput" | ||
| 66 | - data-key="remark" | ||
| 67 | - value="{{user.remark}}" | ||
| 68 | - placeholder-class="input-pl" maxlength="20"/> | ||
| 69 | - </view> | ||
| 70 | - </view> | ||
| 71 | </view> | 70 | </view> |
| 71 | + <view class="item flex-lr"> | ||
| 72 | + <view class="item-label">备注</view> | ||
| 73 | + <view class="Medium"> | ||
| 74 | + <input class="cusdem input" placeholder="您的特殊要求,我们会尽量安排(20字)" | ||
| 75 | + bindinput="changeInput" | ||
| 76 | + data-key="remark" | ||
| 77 | + value="{{user.remark}}" | ||
| 78 | + placeholder-class="input-pl" maxlength="25"/> | ||
| 79 | + </view> | ||
| 80 | + </view> | ||
| 72 | <formids bindclick="saved"> | 81 | <formids bindclick="saved"> |
| 73 | <view class="share-but">提交预订</view> | 82 | <view class="share-but">提交预订</view> |
| 74 | </formids> | 83 | </formids> |
| @@ -20,7 +20,25 @@ | @@ -20,7 +20,25 @@ | ||
| 20 | } | 20 | } |
| 21 | 21 | ||
| 22 | .userinfo{ | 22 | .userinfo{ |
| 23 | + width:690rpx; | ||
| 23 | font-size: 30rpx; | 24 | font-size: 30rpx; |
| 25 | + border-radius:10rpx; | ||
| 26 | + box-shadow: 0 0 16rpx rgba(157,156,156,.5); | ||
| 27 | + margin:20rpx auto 0; | ||
| 28 | + padding:0 30rpx; | ||
| 29 | + box-sizing: border-box; | ||
| 30 | +} | ||
| 31 | +.concat-icon{ | ||
| 32 | + width:56rpx; | ||
| 33 | + height:58rpx; | ||
| 34 | + margin:0 20rpx 0 10rpx; | ||
| 35 | +} | ||
| 36 | +.userinfo-title{ | ||
| 37 | + width:100%; | ||
| 38 | + height:116rpx; | ||
| 39 | + padding:34rpx 0 26rpx 0; | ||
| 40 | + border-bottom: 2rpx solid #F5F5F5; | ||
| 41 | + box-sizing: border-box; | ||
| 24 | } | 42 | } |
| 25 | .item{ | 43 | .item{ |
| 26 | height: 124rpx; | 44 | height: 124rpx; |
| @@ -28,6 +46,13 @@ | @@ -28,6 +46,13 @@ | ||
| 28 | border-bottom: 2rpx solid #F5F5F5; | 46 | border-bottom: 2rpx solid #F5F5F5; |
| 29 | padding-top: 20rpx; | 47 | padding-top: 20rpx; |
| 30 | } | 48 | } |
| 49 | +.click-cover{ | ||
| 50 | + padding:20rpx; | ||
| 51 | +} | ||
| 52 | +.click-cover image{ | ||
| 53 | + width:14rpx; | ||
| 54 | + height:26rpx; | ||
| 55 | +} | ||
| 31 | .item-label{ | 56 | .item-label{ |
| 32 | width: 100rpx; | 57 | width: 100rpx; |
| 33 | min-width: 100rpx; | 58 | min-width: 100rpx; |
| @@ -76,6 +101,7 @@ | @@ -76,6 +101,7 @@ | ||
| 76 | } | 101 | } |
| 77 | .input-pl{ | 102 | .input-pl{ |
| 78 | font-size: 28rpx; | 103 | font-size: 28rpx; |
| 104 | + color:#999; | ||
| 79 | } | 105 | } |
| 80 | .get-phone{ | 106 | .get-phone{ |
| 81 | width:160rpx; | 107 | width:160rpx; |
| @@ -49,7 +49,7 @@ | @@ -49,7 +49,7 @@ | ||
| 49 | "list": [] | 49 | "list": [] |
| 50 | }, | 50 | }, |
| 51 | "miniprogram": { | 51 | "miniprogram": { |
| 52 | - "current": 56, | 52 | + "current": 55, |
| 53 | "list": [ | 53 | "list": [ |
| 54 | { | 54 | { |
| 55 | "id": 0, | 55 | "id": 0, |
| @@ -471,7 +471,7 @@ | @@ -471,7 +471,7 @@ | ||
| 471 | "id": 56, | 471 | "id": 56, |
| 472 | "name": "测试组件", | 472 | "name": "测试组件", |
| 473 | "pathName": "pages/reserve/detail", | 473 | "pathName": "pages/reserve/detail", |
| 474 | - "query": "id=154&activeTab=reserve", | 474 | + "query": "id=154", |
| 475 | "scene": null | 475 | "scene": null |
| 476 | }, | 476 | }, |
| 477 | { | 477 | { |
| @@ -298,5 +298,11 @@ export default { | @@ -298,5 +298,11 @@ export default { | ||
| 298 | 'App.Customer.GetHouseFullDate':null, | 298 | 'App.Customer.GetHouseFullDate':null, |
| 299 | 299 | ||
| 300 | //获取微信用户绑定的手机号 | 300 | //获取微信用户绑定的手机号 |
| 301 | - 'App.Customer.GetCustomerTel':null | 301 | + 'App.Customer.GetCustomerTel':null, |
| 302 | + | ||
| 303 | + //根据openid及联系电话删除对应的数据 将其状态改为0 | ||
| 304 | + 'App.Customer.DelCustomerInfo':{ | ||
| 305 | + openid:'openid' | ||
| 306 | + } | ||
| 307 | + | ||
| 302 | } | 308 | } |
-
Please register or login to post a comment