Showing
12 changed files
with
187 additions
and
60 deletions
| 1 | { | 1 | { |
| 2 | "pages": [ | 2 | "pages": [ |
| 3 | + "pages/customer/index", | ||
| 3 | "pages/book/b_index", | 4 | "pages/book/b_index", |
| 4 | "pages/book/b_detail", | 5 | "pages/book/b_detail", |
| 5 | "pages/book/b_add", | 6 | "pages/book/b_add", |
| 6 | "pages/book/b_info", | 7 | "pages/book/b_info", |
| 7 | "pages/book/b_desk", | 8 | "pages/book/b_desk", |
| 8 | - "pages/customer/index", | ||
| 9 | "pages/customer/detail_owner", | 9 | "pages/customer/detail_owner", |
| 10 | "pages/customer/detail_customer", | 10 | "pages/customer/detail_customer", |
| 11 | "pages/customer/list", | 11 | "pages/customer/list", |
| @@ -2,7 +2,7 @@ | @@ -2,7 +2,7 @@ | ||
| 2 | <view class="page"> | 2 | <view class="page"> |
| 3 | <view class="tip">{{detail.rname}} 给你发了一个邀请:</view> | 3 | <view class="tip">{{detail.rname}} 给你发了一个邀请:</view> |
| 4 | <view class="card"> | 4 | <view class="card"> |
| 5 | - <view class="top"> | 5 | + <view class="top" wx:if="{{detail.topic}}"> |
| 6 | <view class="title">{{detail.topic?'#'+detail.topic+'#':''}}</view> | 6 | <view class="title">{{detail.topic?'#'+detail.topic+'#':''}}</view> |
| 7 | </view> | 7 | </view> |
| 8 | <view class="bottom"> | 8 | <view class="bottom"> |
| @@ -35,11 +35,11 @@ | @@ -35,11 +35,11 @@ | ||
| 35 | <view> | 35 | <view> |
| 36 | <block wx:for="{{detail.customers}}" wx:key="detail.customers.key"> | 36 | <block wx:for="{{detail.customers}}" wx:key="detail.customers.key"> |
| 37 | <view class="flex-lr customers"> | 37 | <view class="flex-lr customers"> |
| 38 | - <view class="flex-ll"> | 38 | + <view class="flex-ll userinfo"> |
| 39 | <image src="{{item.headimgurl}}" class="avatar" mode="aspectFill"></image> | 39 | <image src="{{item.headimgurl}}" class="avatar" mode="aspectFill"></image> |
| 40 | <view>{{item.nickname}}</view> | 40 | <view>{{item.nickname}}</view> |
| 41 | </view> | 41 | </view> |
| 42 | - <view>{{item.openid==detail.openid?'发起人':'已接受'}}</view> | 42 | + <view class="userinfo-type">{{item.openid==detail.openid?'发起人':'已接受'}}</view> |
| 43 | </view> | 43 | </view> |
| 44 | </block> | 44 | </block> |
| 45 | </view> | 45 | </view> |
| @@ -35,6 +35,7 @@ | @@ -35,6 +35,7 @@ | ||
| 35 | .seller .addr{ | 35 | .seller .addr{ |
| 36 | font-size: 26rpx; | 36 | font-size: 26rpx; |
| 37 | color:#999999; | 37 | color:#999999; |
| 38 | + margin-top: 8rpx; | ||
| 38 | } | 39 | } |
| 39 | .hr{ | 40 | .hr{ |
| 40 | border-top: 2rpx solid #F1F0F4; | 41 | border-top: 2rpx solid #F1F0F4; |
| @@ -57,7 +58,7 @@ | @@ -57,7 +58,7 @@ | ||
| 57 | position: relative; | 58 | position: relative; |
| 58 | text-align: center; | 59 | text-align: center; |
| 59 | width:50%; | 60 | width:50%; |
| 60 | - margin: 0 auto; | 61 | + margin: 0 auto 40rpx; |
| 61 | font-size: 26rpx; | 62 | font-size: 26rpx; |
| 62 | } | 63 | } |
| 63 | .line-text .text{ | 64 | .line-text .text{ |
| @@ -71,13 +72,23 @@ | @@ -71,13 +72,23 @@ | ||
| 71 | background-color: #fff; | 72 | background-color: #fff; |
| 72 | } | 73 | } |
| 73 | .customers{ | 74 | .customers{ |
| 74 | - | 75 | + margin-bottom: 30rpx; |
| 75 | } | 76 | } |
| 76 | .customers .avatar{ | 77 | .customers .avatar{ |
| 77 | width:80rpx; | 78 | width:80rpx; |
| 78 | height:80rpx; | 79 | height:80rpx; |
| 79 | border-radius: 50%; | 80 | border-radius: 50%; |
| 81 | + margin-right: 20rpx; | ||
| 82 | +} | ||
| 83 | + | ||
| 84 | +.customers .userinfo{ | ||
| 85 | + font-size: 30rpx; | ||
| 80 | } | 86 | } |
| 87 | +.customers .userinfo-type{ | ||
| 88 | + color:#999999; | ||
| 89 | + font-size: 26rpx; | ||
| 90 | +} | ||
| 91 | + | ||
| 81 | .tip{ | 92 | .tip{ |
| 82 | font-size: 26rpx; | 93 | font-size: 26rpx; |
| 83 | color:#666666; | 94 | color:#666666; |
| @@ -91,6 +102,14 @@ | @@ -91,6 +102,14 @@ | ||
| 91 | .card .top{ | 102 | .card .top{ |
| 92 | min-height: 160rpx; | 103 | min-height: 160rpx; |
| 93 | } | 104 | } |
| 105 | +.card .title{ | ||
| 106 | + line-height: 160rpx; | ||
| 107 | + font-size: 44rpx; | ||
| 108 | + font-weight: bold; | ||
| 109 | + color:#AD7644; | ||
| 110 | + width:94%; | ||
| 111 | + margin: 0 auto; | ||
| 112 | +} | ||
| 94 | .card .bottom{ | 113 | .card .bottom{ |
| 95 | background-color: #EAECEE; | 114 | background-color: #EAECEE; |
| 96 | border-radius: 10rpx; | 115 | border-radius: 10rpx; |
| @@ -31,12 +31,13 @@ Page({ | @@ -31,12 +31,13 @@ Page({ | ||
| 31 | return; | 31 | return; |
| 32 | } | 32 | } |
| 33 | let url = 'list'; | 33 | let url = 'list'; |
| 34 | - App.Reserve.SetRelaOpenid({ | ||
| 35 | - rid:opt.id, | ||
| 36 | - openid:opt.openid, | ||
| 37 | - fromid:opt.fromid?opt.fromid:'' | ||
| 38 | - }) | ||
| 39 | if (opt.id > 0) { | 34 | if (opt.id > 0) { |
| 35 | + App.Reserve.SetRelaOpenid({ | ||
| 36 | + rid:opt.id, | ||
| 37 | + openid:opt.openid, | ||
| 38 | + fromid:opt.fromid?opt.fromid:'' | ||
| 39 | + }) | ||
| 40 | + | ||
| 40 | App.Reserve.Detail({ | 41 | App.Reserve.Detail({ |
| 41 | openid: opt.openid, | 42 | openid: opt.openid, |
| 42 | rid: opt.id | 43 | rid: opt.id |
| @@ -56,6 +57,7 @@ Page({ | @@ -56,6 +57,7 @@ Page({ | ||
| 56 | wx.redirectTo({url: url}); | 57 | wx.redirectTo({url: url}); |
| 57 | }) | 58 | }) |
| 58 | } else { | 59 | } else { |
| 60 | + console.log('url',url); | ||
| 59 | wx.redirectTo({url: url}); | 61 | wx.redirectTo({url: url}); |
| 60 | } | 62 | } |
| 61 | 63 |
| @@ -72,10 +72,7 @@ Page({ | @@ -72,10 +72,7 @@ Page({ | ||
| 72 | * 用户点击右上角分享 | 72 | * 用户点击右上角分享 |
| 73 | */ | 73 | */ |
| 74 | onShareAppMessage: function () { | 74 | onShareAppMessage: function () { |
| 75 | - return { | ||
| 76 | - title: this.topicVal, | ||
| 77 | - path: '/pages/customer/index?id='+this.id+'&fromid='+getApp().openid, | ||
| 78 | - } | 75 | + return this.shareSetting(); |
| 79 | }, | 76 | }, |
| 80 | formatDatail(detail){ | 77 | formatDatail(detail){ |
| 81 | detail.rdateStr=util.unixtoTime(detail.rdate,'MM月DD日 WW HH:II'); | 78 | detail.rdateStr=util.unixtoTime(detail.rdate,'MM月DD日 WW HH:II'); |
| @@ -95,26 +92,18 @@ Page({ | @@ -95,26 +92,18 @@ Page({ | ||
| 95 | let val=util.val(e); | 92 | let val=util.val(e); |
| 96 | this.topicVal=val.trim(); | 93 | this.topicVal=val.trim(); |
| 97 | }, | 94 | }, |
| 98 | - userinfo(){ | 95 | + shareSetting(){ |
| 99 | console.log('this.topicVal',this.topicVal) | 96 | console.log('this.topicVal',this.topicVal) |
| 100 | - if (!this.topicVal) { | ||
| 101 | - wx.showToast({ | ||
| 102 | - title: '请填写邀请主题', | ||
| 103 | - icon: "none" | 97 | + if(this.topicVal && this.data.detail.openid==getApp().openid){ |
| 98 | + App.Reserve.SetTopicFromShare({ | ||
| 99 | + rid:this.id, | ||
| 100 | + topic:this.topicVal | ||
| 104 | }) | 101 | }) |
| 105 | - return; | ||
| 106 | } | 102 | } |
| 107 | - if(this.data.detail.openid!=getApp().openid){ | ||
| 108 | - wx.showToast({ | ||
| 109 | - title: '只有发起人才能设置', | ||
| 110 | - icon: "none" | ||
| 111 | - }) | ||
| 112 | - return; | 103 | + return { |
| 104 | + title: this.topicVal, | ||
| 105 | + path: '/pages/customer/index?id='+this.id+'&fromid='+getApp().openid, | ||
| 113 | } | 106 | } |
| 114 | - App.Reserve.SetTopicFromShare({ | ||
| 115 | - rid:this.id, | ||
| 116 | - topic:this.topicVal | ||
| 117 | - }) | ||
| 118 | } | 107 | } |
| 119 | 108 | ||
| 120 | }) | 109 | }) |
| @@ -3,7 +3,7 @@ | @@ -3,7 +3,7 @@ | ||
| 3 | <view class="card"> | 3 | <view class="card"> |
| 4 | <view class="top flex-vc"> | 4 | <view class="top flex-vc"> |
| 5 | <input bindinput="topic" bindconfirm="topic" value="{{detail.topic}}" | 5 | <input bindinput="topic" bindconfirm="topic" value="{{detail.topic}}" |
| 6 | - class="topic" | 6 | + class="topic" maxlength="13" |
| 7 | placeholder="点这里,填写你想说的话" class-placeholder="topic-placeholder"/> | 7 | placeholder="点这里,填写你想说的话" class-placeholder="topic-placeholder"/> |
| 8 | </view> | 8 | </view> |
| 9 | <view class="bottom"> | 9 | <view class="bottom"> |
| 1 | // pages/customer/list.js | 1 | // pages/customer/list.js |
| 2 | +import util from '../../utils/util'; | ||
| 3 | +import App from '../../utils/api'; | ||
| 4 | +const {regeneratorRuntime} = global | ||
| 2 | Page({ | 5 | Page({ |
| 3 | 6 | ||
| 4 | /** | 7 | /** |
| 5 | * 页面的初始数据 | 8 | * 页面的初始数据 |
| 6 | */ | 9 | */ |
| 7 | data: { | 10 | data: { |
| 8 | - | 11 | + tabFlag:0, |
| 12 | + list:[{ | ||
| 13 | + success:[], | ||
| 14 | + padding:[] | ||
| 15 | + },{ | ||
| 16 | + success:[], | ||
| 17 | + padding:[] | ||
| 18 | + }] | ||
| 9 | }, | 19 | }, |
| 10 | 20 | ||
| 11 | /** | 21 | /** |
| @@ -26,7 +36,14 @@ Page({ | @@ -26,7 +36,14 @@ Page({ | ||
| 26 | * 生命周期函数--监听页面显示 | 36 | * 生命周期函数--监听页面显示 |
| 27 | */ | 37 | */ |
| 28 | onShow: function () { | 38 | onShow: function () { |
| 29 | - | 39 | + App.Reserve.GetListFromScheAndRes({ |
| 40 | + flag:this.data.tabFlag, | ||
| 41 | + openid:getApp().openid, | ||
| 42 | + }).then(res => { | ||
| 43 | + let data=this.formatList(res.data); | ||
| 44 | + let list=this.data.list; | ||
| 45 | + list[this.data.tabFlag]=data; | ||
| 46 | + }) | ||
| 30 | }, | 47 | }, |
| 31 | 48 | ||
| 32 | /** | 49 | /** |
| @@ -42,25 +59,23 @@ Page({ | @@ -42,25 +59,23 @@ Page({ | ||
| 42 | onUnload: function () { | 59 | onUnload: function () { |
| 43 | 60 | ||
| 44 | }, | 61 | }, |
| 45 | - | ||
| 46 | - /** | ||
| 47 | - * 页面相关事件处理函数--监听用户下拉动作 | ||
| 48 | - */ | ||
| 49 | - onPullDownRefresh: function () { | ||
| 50 | - | ||
| 51 | - }, | ||
| 52 | - | ||
| 53 | - /** | ||
| 54 | - * 页面上拉触底事件的处理函数 | ||
| 55 | - */ | ||
| 56 | - onReachBottom: function () { | ||
| 57 | - | ||
| 58 | - }, | ||
| 59 | - | ||
| 60 | - /** | ||
| 61 | - * 用户点击右上角分享 | ||
| 62 | - */ | ||
| 63 | - onShareAppMessage: function () { | ||
| 64 | - | ||
| 65 | - } | 62 | + _formatList(list){ |
| 63 | + if(!list) return []; | ||
| 64 | + if(list.length>0){ | ||
| 65 | + list.forEach(row=>{ | ||
| 66 | + row.rdateStr=util.unixtoTime(row.rdate,'MM月DD日 WW HH:II'); | ||
| 67 | + }) | ||
| 68 | + } | ||
| 69 | + return list; | ||
| 70 | + }, | ||
| 71 | + formatList(res){ | ||
| 72 | + res.success=this._formatList(res.success); | ||
| 73 | + res.padding=this._formatList(res.padding); | ||
| 74 | + return res; | ||
| 75 | + }, | ||
| 76 | + switchTab(e){ | ||
| 77 | + this.setData({ | ||
| 78 | + tabFlag:util.attr(e,'index') | ||
| 79 | + }) | ||
| 80 | + } | ||
| 66 | }) | 81 | }) |
| 1 | <!--pages/customer/list.wxml--> | 1 | <!--pages/customer/list.wxml--> |
| 2 | -<text>pages/customer/list.wxml</text> | 2 | +<view class="page"> |
| 3 | + <view class="tabs flex-cc"> | ||
| 4 | + <view class="item {{0==tabFlag?'active':''}}" | ||
| 5 | + bindtap="switchTab" data-index="0">我的日程</view> | ||
| 6 | + <view class="item" style="width: 246rpx;"></view> | ||
| 7 | + <view class="item {{1==tabFlag?'active':''}}" | ||
| 8 | + bindtap="switchTab" data-index="1">我的订座</view> | ||
| 9 | + </view> | ||
| 10 | + <block wx:for="{{list}}" wx:key="list.key" wx:for-item="parts" wx:for-index="tabindex"> | ||
| 11 | + <block wx:if="{{parts.success.length>0 || parts.padding.length>0}}"> | ||
| 12 | + <block wx:for="{{parts}}" wx:key="partskey" wx:for-item="part"> | ||
| 13 | + <view class="list-content" wx:if="{{tabindex==tabFlag}}"> | ||
| 14 | + <view>{{index=='success'?'即将开始':'待处理'}}<text>({{part.length}}条)</text></view> | ||
| 15 | + <block wx:for="{{part}}" wx:key="part.key" wx:for-item="detail"> | ||
| 16 | + <view class="card"> | ||
| 17 | + <view class="top" wx:if="{{detail.topic}}"> | ||
| 18 | + <view class="title">{{detail.topic?'#'+detail.topic+'#':''}}</view> | ||
| 19 | + </view> | ||
| 20 | + <view class="bottom"> | ||
| 21 | + <view class="rdateStr Medium">{{detail.rdateStr}}</view> | ||
| 22 | + <view class="seller flex-lr" bindtap="lookLocation"> | ||
| 23 | + <view class="seller-info"> | ||
| 24 | + <view class="name Medium">{{detail.seller.sellername}}</view> | ||
| 25 | + <view class="addr">{{detail.seller.map_address}}</view> | ||
| 26 | + </view> | ||
| 27 | + <view class="addr-icon"> | ||
| 28 | + <image src="../image/gps-icon.png"></image> | ||
| 29 | + </view> | ||
| 30 | + </view> | ||
| 31 | + </view> | ||
| 32 | + </view> | ||
| 33 | + </block> | ||
| 34 | + </view> | ||
| 35 | + </block> | ||
| 36 | + </block> | ||
| 37 | + <block wx:else> | ||
| 38 | + <view wx:if="{{tabindex==tabFlag}}" class="flex-vc empry"> | ||
| 39 | + <image src="http://qn.colorcun.com/custom/lite/image/empty-order.png"></image> | ||
| 40 | + <view class="Medium">{{0==tabFlag?'暂无日程':'暂无订座'}}</view> | ||
| 41 | + </view> | ||
| 42 | + </block> | ||
| 43 | + </block> | ||
| 44 | +</view> |
| 1 | -/* pages/customer/list.wxss */ | ||
| 1 | +/* pages/customer/list.wxss */ | ||
| 2 | +.page{ | ||
| 3 | + width: 94%; | ||
| 4 | + margin: 0 3%; | ||
| 5 | + color:#353535; | ||
| 6 | +} | ||
| 7 | + | ||
| 8 | +.card{ | ||
| 9 | + border-radius: 10rpx; | ||
| 10 | + box-shadow: 2rpx 2rpx 14rpx 6rpx rgba(231,228,228,.5); | ||
| 11 | +} | ||
| 12 | +.card .top{ | ||
| 13 | + min-height: 160rpx; | ||
| 14 | +} | ||
| 15 | +.card .title{ | ||
| 16 | + line-height: 160rpx; | ||
| 17 | + font-size: 44rpx; | ||
| 18 | + font-weight: bold; | ||
| 19 | + color:#AD7644; | ||
| 20 | + width:94%; | ||
| 21 | + margin: 0 auto; | ||
| 22 | +} | ||
| 23 | +.card .bottom{ | ||
| 24 | + background-color: #EAECEE; | ||
| 25 | + border-radius: 10rpx; | ||
| 26 | + box-shadow: 2rpx 2rpx 14rpx 6rpx rgba(231,228,228,.5); | ||
| 27 | + padding: 36rpx 46rpx 40rpx; | ||
| 28 | +} | ||
| 29 | +.card .bottom .rdateStr{ | ||
| 30 | + font-size: 30rpx; | ||
| 31 | +} | ||
| 32 | + | ||
| 33 | +.tabs{ | ||
| 34 | + margin: 56rpx 0 88rpx; | ||
| 35 | + font-size: 38rpx; | ||
| 36 | + color:#999999; | ||
| 37 | + font-weight: bold; | ||
| 38 | +} | ||
| 39 | +.tabs .item{ | ||
| 40 | + | ||
| 41 | +} | ||
| 42 | +.tabs .active{ | ||
| 43 | + color:#353535; | ||
| 44 | +} | ||
| 45 | +.empry{ | ||
| 46 | + font-size: 34rpx; | ||
| 47 | +} | ||
| 48 | +.empry image{ | ||
| 49 | + width:384rpx; | ||
| 50 | + height: 296rpx; | ||
| 51 | + margin-bottom: 100rpx; | ||
| 52 | + margin-top: 176rpx; | ||
| 53 | +} |
| @@ -81,10 +81,11 @@ | @@ -81,10 +81,11 @@ | ||
| 81 | "query": "id=64" | 81 | "query": "id=64" |
| 82 | }, | 82 | }, |
| 83 | { | 83 | { |
| 84 | - "id": -1, | 84 | + "id": 8, |
| 85 | "name": "邀请进入 pages/customer/index", | 85 | "name": "邀请进入 pages/customer/index", |
| 86 | "pathName": "pages/customer/index", | 86 | "pathName": "pages/customer/index", |
| 87 | - "query": "id=64&fromid=test" | 87 | + "query": "id=64&fromid=test", |
| 88 | + "scene": "1001" | ||
| 88 | } | 89 | } |
| 89 | ] | 90 | ] |
| 90 | } | 91 | } |
-
Please register or login to post a comment