Commit 4a880c9b71f7f046a7eae1131fdb96cfa9bb49df

Authored by iceling
1 parent 8743432a

历史服务,我的门店,美容师,美容师预约数据填充

pages/user/my_service/appment_main.js
1 var e = getApp(), 1 var e = getApp(),
2 a = e.globalData.setting, 2 a = e.globalData.setting,
3 os = a, 3 os = a,
4 - t = e.request; 4 + t = e.request,
  5 + d = e.globalData;
5 Page({ 6 Page({
6 7
7 /** 8 /**
@@ -13,9 +14,14 @@ Page({ @@ -13,9 +14,14 @@ Page({
13 beautician: 0, //是否显示美容师列表 14 beautician: 0, //是否显示美容师列表
14 beautician_name: null, //选中的美容师名称 15 beautician_name: null, //选中的美容师名称
15 placeholder: "填写备注", //备注为空的placeholder 16 placeholder: "填写备注", //备注为空的placeholder
16 - store_list: null, //门店列表  
17 - store_name: null, //选择的服务门店 17 + store_list: [], //门店列表
  18 + beautician_list: [], //美容师列表
  19 + store_name: "", //选择的服务门店
18 fir_pick_index: 0, //选择的门店下标 20 fir_pick_index: 0, //选择的门店下标
  21 + curpage: 1, //当前分页数
  22 + pageSize: 5, //页大小
  23 + total: 0,
  24 + ismore: 0, //是否加载完毕
19 }, 25 },
20 onclickstore: function() { 26 onclickstore: function() {
21 var th = this; 27 var th = this;
@@ -32,37 +38,6 @@ Page({ @@ -32,37 +38,6 @@ Page({
32 }) 38 })
33 } 39 }
34 }, 40 },
35 - query_bea: function(e) {  
36 - var th = this;  
37 - //获取选择美容师字段是不是为null,是的话就提示用户先选择门店  
38 - if (true) {  
39 - var beautician = th.data.beautician;  
40 - var beaname = e.currentTarget.dataset.beaname;  
41 - if (beautician) {  
42 - // 判断是否选择美容师没有的话就把美容师列表收起来  
43 - if (beaname != undefined) {  
44 - th.setData({  
45 - beautician: 0,  
46 - beautician_name: beaname,  
47 - placeholder: "填写备注"  
48 - })  
49 - } else {  
50 - th.setData({  
51 - beautician: 0,  
52 - placeholder: "填写备注"  
53 - })  
54 - }  
55 - } else {  
56 - th.setData({  
57 - beautician: 1,  
58 - placeholder: ""  
59 - })  
60 - }  
61 -  
62 - } else {  
63 - getApp().my_warnning("请先选择服务门店", 0, th);  
64 - }  
65 - },  
66 goto: function(e) { 41 goto: function(e) {
67 var th = this; 42 var th = this;
68 if (th.data.beautician_name != null) { 43 if (th.data.beautician_name != null) {
@@ -90,12 +65,95 @@ Page({ @@ -90,12 +65,95 @@ Page({
90 choice_store: function() { 65 choice_store: function() {
91 var th = this; 66 var th = this;
92 var index = th.data.fir_pick_index; 67 var index = th.data.fir_pick_index;
93 - var pickup_name = th.data.store_list[index].pickup_name; 68 + var pickup_name = th.data.store_list[index].StorageName;
94 th.setData({ 69 th.setData({
95 store: 0, 70 store: 0,
96 store_name: pickup_name 71 store_name: pickup_name
97 }) 72 })
98 }, 73 },
  74 + onReachBottom: function() {
  75 + var th = this;
  76 + if (this.data.total <= th.data.pageSize) return;
  77 + if (this.data.ismore) return;
  78 +
  79 + wx.showLoading({
  80 + title: '加载中...',
  81 + })
  82 + th.query_store();
  83 + },
  84 + //分页查询门店信息
  85 + query_store: function() {
  86 + var th = this;
  87 + var itemid = "8f503b2e-f35f-4210-ba42-df4345526b93";
  88 + var url = "/api/weshop/marketing/reservation/storage/page";
  89 + getApp().request.promiseGet(url, {
  90 + data: {
  91 + storeId: a.stoid,
  92 + userId: d.user_id,
  93 + itemId: itemid,
  94 + page: th.data.curpage,
  95 + pageSize: th.data.pageSize
  96 + }
  97 + }).then(res => {
  98 + if (res.data.code == 0) {
  99 + wx.hideLoading();
  100 + th.data.curpage++;
  101 + var arr1 = th.data.store_list;
  102 + var arr2 = res.data.data.pageData;
  103 + var arr3 = [...arr1, ...arr2];
  104 + var ismore = 0;
  105 + if (arr3.length == res.data.data.total) ismore = 1
  106 + th.setData({
  107 + store_list: arr3,
  108 + total: res.data.data.total,
  109 + ismore: ismore,
  110 + is_service_read: 1,
  111 + }), wx.stopPullDownRefresh(); //停止下拉刷新
  112 + }
  113 + })
  114 + },
  115 + //查询
  116 + query_beautician: function() {
  117 + var th = this;
  118 + if (th.data.store_name == "") {
  119 + getApp().my_warnning("请先选择服务门店", 0, th);
  120 + } else {
  121 + if (th.data.beautician == 0) {
  122 + th.setData({
  123 + beautician: 1
  124 + })
  125 + } else {
  126 + th.setData({
  127 + beautician: 0
  128 + })
  129 + }
  130 + var itemid = "8f503b2e-f35f-4210-ba42-df4345526b93";
  131 + var storageId = "FD8EC44A-6474-4BA1-A17C-A87306690E59";
  132 + var url = "/api/weshop/marketing/reservation/staff/page";
  133 + getApp().request.promiseGet(url, {
  134 + data: {
  135 + storeId: a.stoid,
  136 + userId: d.user_id,
  137 + itemId: itemid,
  138 + storageId: storageId
  139 + }
  140 + }).then(res => {
  141 + if (res.data.code == 0) {
  142 + th.setData({
  143 + beautician_list: res.data.data.pageData
  144 + }) //停止下拉刷新
  145 + }
  146 + })
  147 + }
  148 + },
  149 + choice_beautician: function(e) {
  150 + var th = this;
  151 + var bea_name = e.currentTarget.dataset.beaname;
  152 + th.setData({
  153 + beautician_name:bea_name
  154 + })
  155 +
  156 + },
99 /** 157 /**
100 * 生命周期函数--监听页面加载 158 * 生命周期函数--监听页面加载
101 */ 159 */
@@ -108,15 +166,6 @@ Page({ @@ -108,15 +166,6 @@ Page({
108 */ 166 */
109 onShow: function() { 167 onShow: function() {
110 var th = this; 168 var th = this;
111 - wx.request({  
112 - url: 'http://localhost:8022/api/weshop/yy_fuwu_sto',  
113 - success: function(e) {  
114 - if (e.data.code == 0) {  
115 - th.setData({  
116 - store_list: e.data.data.pageData  
117 - })  
118 - }  
119 - }  
120 - }) 169 + th.query_store();
121 } 170 }
122 }) 171 })
123 \ No newline at end of file 172 \ No newline at end of file
pages/user/my_service/appment_main.wxml
@@ -12,7 +12,7 @@ @@ -12,7 +12,7 @@
12 12
13 <!-- 选择门店 --> 13 <!-- 选择门店 -->
14 <view class="flex-vertical-between fs26 select" bindtap="onclickstore"> 14 <view class="flex-vertical-between fs26 select" bindtap="onclickstore">
15 - <view class="color value ellipsis-1">{{store_name==null?'选择服务门店':store_name}}</view> 15 + <view class="color value ellipsis-1">{{store_name==""?'选择服务门店':store_name}}</view>
16 <view class="angle">∟</view> 16 <view class="angle">∟</view>
17 </view> 17 </view>
18 </view> 18 </view>
@@ -27,15 +27,15 @@ @@ -27,15 +27,15 @@
27 27
28 <!-- 选择门店 --> 28 <!-- 选择门店 -->
29 <view class="rel fs26"> 29 <view class="rel fs26">
30 - <view class="flex-vertical-between Cosmetology" bindtap="query_bea"> 30 + <view class="flex-vertical-between Cosmetology" bindtap="query_beautician">
31 <view class="color value ellipsis-1">{{beautician_name==null?'选择美容师':beautician_name}}</view> 31 <view class="color value ellipsis-1">{{beautician_name==null?'选择美容师':beautician_name}}</view>
32 <view class="angle">∟</view> 32 <view class="angle">∟</view>
33 </view> 33 </view>
34 <!-- 美容师下拉列表 --> 34 <!-- 美容师下拉列表 -->
35 <view class="beauticians abs" wx:if="{{beautician}}"> 35 <view class="beauticians abs" wx:if="{{beautician}}">
36 <!-- 到时候要做判断如果是index==循环的最后一个则把下边线去掉:(beaclone去掉的css) --> 36 <!-- 到时候要做判断如果是index==循环的最后一个则把下边线去掉:(beaclone去掉的css) -->
37 - <view class="beautician flex-vertical fs26" wx:for="11" bindtap="query_bea" data-beaname="钱巧玲">  
38 - <view>钱巧玲</view> 37 + <view class="beautician flex-vertical fs26" wx:for="{{beautician_list}}" bindtap="choice_beautician" data-beaname="{{item.StaffName}}">
  38 + <view>{{item.StaffName}}</view>
39 </view> 39 </view>
40 <view> 40 <view>
41 </view> 41 </view>
@@ -69,7 +69,7 @@ @@ -69,7 +69,7 @@
69 </view> 69 </view>
70 <view class="flex fs26"> 70 <view class="flex fs26">
71 <block wx:if="{{store==0 && beautician==0}}"> 71 <block wx:if="{{store==0 && beautician==0}}">
72 - <textarea class="textarea" disabled="{{store || beautician}}" placeholder="{{placeholder}}" placeholder-class="fs26 color" value=""> 72 + <textarea class="textarea" disabled="{{store || beautician}}" placeholder="填写备注" placeholder-class="fs26 color" value="">
73 </textarea> 73 </textarea>
74 </block> 74 </block>
75 <block wx:else> 75 <block wx:else>
@@ -124,14 +124,18 @@ @@ -124,14 +124,18 @@
124 </block> 124 </block>
125 <view class="store_name_dis"> 125 <view class="store_name_dis">
126 <view class="name_dis flex-vertical-between"> 126 <view class="name_dis flex-vertical-between">
127 - <view class="store_name fs28 ellipsis-1">{{item.pickup_name}}</view> 127 + <view class="store_name fs28 ellipsis-1">{{item.StorageName}}</view>
128 <view class="store_dis flex fs22"> 128 <view class="store_dis flex fs22">
129 <view class="ellipsis-1">距您: 728m</view> 129 <view class="ellipsis-1">距您: 728m</view>
130 </view> 130 </view>
131 </view> 131 </view>
132 - <view class="store_address fs24 ellipsis-2">地址:{{item.fulladdress}}</view> 132 + <view class="store_address fs24 ellipsis-2">地址:{{item.Address}}</view>
133 </view> 133 </view>
134 </view> 134 </view>
  135 + <!-- 通过搜索的时候没有找到的提示语 -->
  136 + <view wx:if="{{false}}" class="flex-center fs28 notstore">
  137 + <view>没有找到这个门店</view>
  138 + </view>
135 </view> 139 </view>
136 <!-- sub --> 140 <!-- sub -->
137 <view class="flex-center fs32" bindtap="choice_store"> 141 <view class="flex-center fs32" bindtap="choice_store">
pages/user/my_service/appment_main.wxss
@@ -28,6 +28,7 @@ @@ -28,6 +28,7 @@
28 .Fram { 28 .Fram {
29 padding: 0rpx 60rpx; 29 padding: 0rpx 60rpx;
30 margin-top: 60rpx; 30 margin-top: 60rpx;
  31 + background-color: rgb(255, 255, 255);
31 } 32 }
32 33
33 .subSuccess { 34 .subSuccess {
@@ -258,4 +259,8 @@ @@ -258,4 +259,8 @@
258 } 259 }
259 .value{ 260 .value{
260 max-width: 300rpx; 261 max-width: 300rpx;
  262 +}
  263 +.notstore{
  264 + margin-top: 30rpx;
  265 + color: rgb(159, 159, 159);
261 } 266 }
262 \ No newline at end of file 267 \ No newline at end of file
pages/user/my_service/beauty_deta.wxml
@@ -35,28 +35,26 @@ @@ -35,28 +35,26 @@
35 35
36 <!-- 选择时间 --> 36 <!-- 选择时间 -->
37 <view class="Times"> 37 <view class="Times">
38 - <view class="flex-center" wx:for="111110000000" style="display:inline-block;">  
39 - 38 +
  39 + <view class="flex-center" wx:for="1111100000" style="display:inline-block;">
  40 +
40 <view class="Time flex-center {{index==0?'chTime':'nochTime'}}"> 41 <view class="Time flex-center {{index==0?'chTime':'nochTime'}}">
41 - <view> 42 + <view>
42 <view class="fs26">09:00</view> 43 <view class="fs26">09:00</view>
43 <block wx:if="{{flase}}"> 44 <block wx:if="{{flase}}">
44 - <view class="fs24">约满</view> 45 + <view class="fs24">约满</view>
45 </block> 46 </block>
  47 + </view>
46 </view> 48 </view>
47 </view> 49 </view>
  50 + <view class="choice flex-center fs32">
  51 + <view>确定选择</view>
48 </view> 52 </view>
49 - </view>  
50 53
51 - <view class="choice flex-center fs32">  
52 - <view>确定选择</view>  
53 </view> 54 </view>
54 55
55 </view> 56 </view>
56 57
57 -  
58 -  
59 -  
60 </view> 58 </view>
61 59
62 </view> 60 </view>
63 \ No newline at end of file 61 \ No newline at end of file
pages/user/my_service/beauty_deta.wxss
@@ -54,17 +54,15 @@ @@ -54,17 +54,15 @@
54 } 54 }
55 55
56 .choice { 56 .choice {
57 - width: 704rpx;  
58 height: 70rpx; 57 height: 70rpx;
59 background-color: rgb(214, 1, 33); 58 background-color: rgb(214, 1, 33);
60 color: rgb(255, 255, 255); 59 color: rgb(255, 255, 255);
  60 + margin-top: 30rpx;
61 } 61 }
62 62
63 .scroll-h { 63 .scroll-h {
64 white-space: nowrap; 64 white-space: nowrap;
65 width: 704rpx; 65 width: 704rpx;
66 - /* width: 100%; */  
67 - margin-bottom: 25rpx;  
68 overflow: visible; 66 overflow: visible;
69 height: 125rpx; 67 height: 125rpx;
70 color: transparent; 68 color: transparent;
@@ -110,12 +108,12 @@ @@ -110,12 +108,12 @@
110 .Times { 108 .Times {
111 background-color: rgb(238, 243, 247); 109 background-color: rgb(238, 243, 247);
112 margin-bottom: 30rpx; 110 margin-bottom: 30rpx;
113 - width: 704rpx; 111 + padding:34rpx 27rpx;
114 } 112 }
115 113
116 .Time { 114 .Time {
117 border: 2rpx solid rgb(238, 238, 238); 115 border: 2rpx solid rgb(238, 238, 238);
118 - width: 172rpx; 116 + width: 160rpx;
119 height: 70rpx; 117 height: 70rpx;
120 background-color: rgb(255, 255, 255); 118 background-color: rgb(255, 255, 255);
121 text-align: center; 119 text-align: center;
pages/user/my_service/cosmetology_list.wxml
@@ -34,20 +34,20 @@ @@ -34,20 +34,20 @@
34 </view> 34 </view>
35 35
36 <!-- 预约状态 --> 36 <!-- 预约状态 -->
37 - <block wx:if="{{0}}"> 37 + <block wx:if="{{item.type}}">
38 <navigator class="flex-center gofu go" url="/pages/user/my_service/beauty_deta"> 38 <navigator class="flex-center gofu go" url="/pages/user/my_service/beauty_deta">
39 <view class="fs24">预约</view> 39 <view class="fs24">预约</view>
40 </navigator> 40 </navigator>
41 </block> 41 </block>
42 <block wx:else> 42 <block wx:else>
43 - <view class="flex-center gofu gofull"> 43 + <navigator class="flex-center gofu gofull" url="/pages/user/my_service/beauty_deta">
44 <view class="fs24">已约满</view> 44 <view class="fs24">已约满</view>
45 - </view> 45 + </navigator>
46 </block> 46 </block>
47 </view> 47 </view>
48 <view class="fs26 information"> 48 <view class="fs26 information">
49 <block wx:if="{{true}}"> 49 <block wx:if="{{true}}">
50 - <view class="ellipsis-3">在职业培训、职业技能鉴定与企业用人要求之间建立一个有效实用的联系,经研究 决定,以《职业技能鉴定国家题库操作技能考试手册》的方式,向全社会公布国家题库 操作技能考核试题库的全部内容。 50 + <view class="ellipsis-3">{{item.remark1}}
51 </view> 51 </view>
52 </block> 52 </block>
53 <block wx:else> 53 <block wx:else>
@@ -65,7 +65,7 @@ @@ -65,7 +65,7 @@
65 </view> 65 </view>
66 </view> 66 </view>
67 <!-- 无美容师 --> 67 <!-- 无美容师 -->
68 -<view class="empty_order" wx:if="{{false}}"> 68 +<view class="empty_order" wx:if="{{cosmetology_list.length<1 && is_cosmetology_read}}">
69 <view class="flex-level"> 69 <view class="flex-level">
70 <image src="{{iurl}}miniapp/images/yyservice/no_beauty.png"></image> 70 <image src="{{iurl}}miniapp/images/yyservice/no_beauty.png"></image>
71 </view> 71 </view>
pages/user/my_service/hist_service.js
1 var e = getApp(), 1 var e = getApp(),
2 a = e.globalData.setting, 2 a = e.globalData.setting,
3 os = a, 3 os = a,
4 - t = e.request; 4 + t = e.request,
  5 + d = e.globalData;
5 Page({ 6 Page({
6 7
7 /** 8 /**
@@ -22,6 +23,12 @@ Page({ @@ -22,6 +23,12 @@ Page({
22 limitStartTime: "1917-05-06 12:32:44", 23 limitStartTime: "1917-05-06 12:32:44",
23 limitEndTime: "2055-05-06 12:32:44" 24 limitEndTime: "2055-05-06 12:32:44"
24 }, 25 },
  26 + hist_List: [], //服务项目列表
  27 + is_service_read: 0,
  28 + curpage: 1, //当前分页数
  29 + pageSize: 10, //页大小
  30 + total: 0,
  31 + ismore: 0, //是否加载完毕
25 }, 32 },
26 pickerShow: function() { 33 pickerShow: function() {
27 this.setData({ 34 this.setData({
@@ -68,37 +75,65 @@ Page({ @@ -68,37 +75,65 @@ Page({
68 * 生命周期函数--监听页面显示 75 * 生命周期函数--监听页面显示
69 */ 76 */
70 onShow: function() { 77 onShow: function() {
71 -  
72 - },  
73 -  
74 - /**  
75 - * 生命周期函数--监听页面隐藏  
76 - */  
77 - onHide: function() {  
78 -  
79 - },  
80 -  
81 - /**  
82 - * 生命周期函数--监听页面卸载  
83 - */  
84 - onUnload: function() {  
85 -  
86 - },  
87 -  
88 - /**  
89 - * 页面相关事件处理函数--监听用户下拉动作  
90 - */  
91 - onPullDownRefresh: function() {  
92 - 78 + var th = this;
  79 + th.query_hist();
93 }, 80 },
94 81
95 /** 82 /**
96 * 页面上拉触底事件的处理函数 83 * 页面上拉触底事件的处理函数
97 */ 84 */
98 onReachBottom: function() { 85 onReachBottom: function() {
  86 + var th = this;
  87 + if (th.data.total <= th.data.pageSize) return;
  88 + if (th.data.ismore) return;
99 89
  90 + wx.showLoading({
  91 + title: '加载中...',
  92 + })
  93 + th.query_service();
  94 + },
  95 + query_hist: function() {
  96 + var th = this;
  97 + var url = "http://localhost:8022/api/weshop/yy_fuwu_lishi";
  98 + wx.request({
  99 + url: url,
  100 + success: function(res) {
  101 + if (res.data.code == 0) {
  102 + th.setData({
  103 + hist_List: res.data.data.pageData,
  104 + total: res.data.data.total
  105 + })
  106 + }
  107 + }
  108 + })
  109 +
  110 + // var th = this;
  111 + // var url = "/api/weshop/marketing/reservation/sm/page";
  112 + // getApp().request.promiseGet(url, {
  113 + // data: {
  114 + // storeId: a.stoid,
  115 + // userId: d.user_id,
  116 + // page: th.data.curpage,
  117 + // pageSize: th.data.pageSize
  118 + // }
  119 + // }).then(res => {
  120 + // if (res.data.code == 0) {
  121 + // wx.hideLoading();
  122 + // th.data.curpage++;
  123 + // var arr1 = th.data.service_List;
  124 + // var arr2 = res.data.data.pageData;
  125 + // var arr3 = [...arr1, ...arr2];
  126 + // var ismore = 0;
  127 + // if (arr3.length == res.data.data.total) ismore = 1
  128 + // th.setData({
  129 + // service_List: arr3,
  130 + // total: res.data.data.total,
  131 + // ismore: ismore,
  132 + // is_service_read: 1,
  133 + // }), wx.stopPullDownRefresh(); //停止下拉刷新
  134 + // }
  135 + // })
100 }, 136 },
101 -  
102 /** 137 /**
103 * 用户点击右上角分享 138 * 用户点击右上角分享
104 */ 139 */
pages/user/my_service/hist_service.wxml
@@ -3,7 +3,7 @@ @@ -3,7 +3,7 @@
3 <view class="exption flex-vertical-between fs28"> 3 <view class="exption flex-vertical-between fs28">
4 <view class="flex"> 4 <view class="flex">
5 共使用 5 共使用
6 - <view class="count">36</view> 6 + <view class="count">{{total}}</view>
7 次服务 7 次服务
8 </view> 8 </view>
9 <view class="flex"> 9 <view class="flex">
@@ -22,24 +22,35 @@ @@ -22,24 +22,35 @@
22 <!-- 总的服务列表 --> 22 <!-- 总的服务列表 -->
23 <view> 23 <view>
24 <!-- 单个 --> 24 <!-- 单个 -->
25 - <view class="item flex-vertical-between" wx:for="11111"> 25 + <view class="item flex-vertical-between" wx:for="{{hist_List}}">
26 <!-- left --> 26 <!-- left -->
27 <view> 27 <view>
28 <view class="flex fs28"> 28 <view class="flex fs28">
29 - <view class="itemName ellipsis-1">头部按摩</view> 29 + <view class="itemName ellipsis-1">{{item.xm}}</view>
30 <view>(美容师:</view> 30 <view>(美容师:</view>
31 - <view class="itemUsna ellipsis-1">花木兰</view> 31 + <view class="itemUsna ellipsis-1">{{item.name}}</view>
32 ) 32 )
33 </view> 33 </view>
34 - <view class="fs24">2019-07-02 23:25:45</view> 34 + <view class="fs24">{{item.type_a}}</view>
35 </view> 35 </view>
36 <!-- right --> 36 <!-- right -->
37 - <view class="serState fs32">已服务</view> 37 + <view class="serState fs32">
  38 + <view wx:if="{{item.type==1}}">未服务</view>
  39 + <view wx:if="{{item.type==2}}">已服务</view>
  40 + <view wx:if="{{item.type==3}}">已过期</view>
  41 + </view>
  42 + </view>
  43 + <!-- 没有数据 -->
  44 + <!-- 加载完毕并且数据大于=页大小 -->
  45 + <view class="After_all flex-center" wx:if="{{ismore && hist_List.length>=pageSize}}">
  46 + <view class="Line"></view>
  47 + <view class="end fs26 xc-black">到底了</view>
  48 + <view class="Line"></view>
38 </view> 49 </view>
39 </view> 50 </view>
40 </view> 51 </view>
41 <!-- 无历史服务 --> 52 <!-- 无历史服务 -->
42 -<view class="empty_order" wx:if="{{true}}"> 53 +<view class="empty_order" wx:if="{{hist_List.length<1 && is_service_read}}">
43 <view class="flex-level"> 54 <view class="flex-level">
44 <image src="{{iurl}}miniapp/images/yyservice/no_history.png"></image> 55 <image src="{{iurl}}miniapp/images/yyservice/no_history.png"></image>
45 </view> 56 </view>
pages/user/my_service/hist_service.wxss
@@ -95,3 +95,16 @@ page { @@ -95,3 +95,16 @@ page {
95 background-color: rgb(255, 72, 72); 95 background-color: rgb(255, 72, 72);
96 border-radius: 40rpx; 96 border-radius: 40rpx;
97 } 97 }
  98 +
  99 +.After_all {
  100 + height: 80rpx;
  101 +}
  102 +
  103 +.After_all .Line {
  104 + border-top: 3rpx solid rgb(0, 0, 0);
  105 + width: 130rpx;
  106 +}
  107 +
  108 +.After_all .end {
  109 + margin: 0rpx 15rpx;
  110 +}
pages/user/my_service/i_service.wxml
@@ -63,7 +63,7 @@ @@ -63,7 +63,7 @@
63 </view> 63 </view>
64 </view> 64 </view>
65 <!-- 无服务项目 --> 65 <!-- 无服务项目 -->
66 -<view wx:if="{{service_List.length<0 && is_service_read}}"> 66 +<view wx:if="{{service_List.length<1 && is_service_read}}">
67 <!-- 遮住 --> 67 <!-- 遮住 -->
68 <view class="cover"></view> 68 <view class="cover"></view>
69 <!-- 无历史服务 --> 69 <!-- 无历史服务 -->
pages/user/my_service/tment_order_list.js
@@ -23,6 +23,12 @@ Page({ @@ -23,6 +23,12 @@ Page({
23 name: "已过期", 23 name: "已过期",
24 id: 3 24 id: 3
25 }], 25 }],
  26 + tm_order_list: [], //我的预约订单列表
  27 + is_service_read: 0,
  28 + curpage: 1, //当前分页数
  29 + pageSize: 10, //页大小
  30 + total: 0,
  31 + ismore: 0, //是否加载完毕
26 }, 32 },
27 33
28 /** 34 /**
@@ -34,16 +40,45 @@ Page({ @@ -34,16 +40,45 @@ Page({
34 changeTab: function(e) { 40 changeTab: function(e) {
35 var th = this; 41 var th = this;
36 var id = e.currentTarget.dataset.id; 42 var id = e.currentTarget.dataset.id;
  43 + var activeCategoryId = th.data.activeCategoryId;
  44 + if (id != activeCategoryId) {
  45 + th.setData({
  46 + activeCategoryId: id
  47 + })
  48 + } else {
  49 + return false;
  50 + }
  51 + },
  52 + query_orderList: function() {
  53 + var th = this;
  54 + var url = "http://localhost:8022/api/weshop/yy_order_list";
  55 + wx.request({
  56 + url: url,
  57 + success: function(res) {
  58 + if (res.data.code == 0) {
  59 + th.setData({
  60 + tm_order_list: res.data.data.pageData
  61 + })
  62 + }
  63 + }
  64 + })
  65 + },
  66 + //删除预约记录
  67 + deleteOrderData: function(e) {
  68 + var th = this;
  69 + var index = e.currentTarget.dataset.order_id;
  70 + var arr = th.data.tm_order_list;
  71 + arr.splice(index, 1);
37 th.setData({ 72 th.setData({
38 - activeCategoryId: id 73 + tm_order_list: arr
39 }) 74 })
40 }, 75 },
41 -  
42 /** 76 /**
43 * 生命周期函数--监听页面显示 77 * 生命周期函数--监听页面显示
44 */ 78 */
45 onShow: function() { 79 onShow: function() {
46 - 80 + var th = this;
  81 + th.query_orderList();
47 }, 82 },
48 83
49 /** 84 /**
pages/user/my_service/tment_order_list.wxml
@@ -7,67 +7,71 @@ @@ -7,67 +7,71 @@
7 </view> 7 </view>
8 <view wx:if="{{true}}"> 8 <view wx:if="{{true}}">
9 <!-- 预约项目 --> 9 <!-- 预约项目 -->
10 - <view wx:for="1111"> 10 + <view wx:for="{{tm_order_list}}">
11 <!-- 商品编号和状态 --> 11 <!-- 商品编号和状态 -->
12 <view class="Commodity_number flex-vertical-between fs24 padding"> 12 <view class="Commodity_number flex-vertical-between fs24 padding">
13 <!--商品编号 --> 13 <!--商品编号 -->
14 - <text class="order_number ellipsis-1" selectable='true'>订单编号:MDDER2019061454879342468</text> 14 + <text class="order_number ellipsis-1" selectable='true'>订单编号:{{item.order_sn}}</text>
15 <!-- 商品评价状态 --> 15 <!-- 商品评价状态 -->
16 <view class="flex-center xc-wc"> 16 <view class="flex-center xc-wc">
17 <!-- 订单状态 --> 17 <!-- 订单状态 -->
18 - <view>已过期</view> 18 + <view wx:if="{{item.is_prom==1}}">未服务</view>
  19 + <view wx:if="{{item.is_prom==2}}">已服务</view>
  20 + <view wx:if="{{item.is_prom==3}}">已过期</view>
19 <view class="flex-center"> 21 <view class="flex-center">
20 <view class="lin"></view> 22 <view class="lin"></view>
21 - <image src="{{iurl}}miniapp/images/trash.png" bindtap="deleteOrderData" data-order_id="{{item.order_id}}"></image> 23 + <image src="{{iurl}}miniapp/images/trash.png" bindtap="deleteOrderData" data-order_id="{{index}}"></image>
22 </view> 24 </view>
23 </view> 25 </view>
24 </view> 26 </view>
25 27
26 <!-- 项目属性 --> 28 <!-- 项目属性 -->
27 - <navigator class="items padding flex-vertical" url=""> 29 + <navigator class="items padding flex-vertical" url="/pages/user/my_service/tment_details">
28 30
29 <view class="flex-center fs26"> 31 <view class="flex-center fs26">
30 <view class="itemimage"> 32 <view class="itemimage">
31 - <image class="itemimage" src="http://img4.imgtn.bdimg.com/it/u=3313840944,708309586&fm=26&gp=0.jpg"></image> 33 + <image class="itemimage" src="{{item.img}}"></image>
32 </view> 34 </view>
33 <!-- 项目内容 --> 35 <!-- 项目内容 -->
34 <view class="details"> 36 <view class="details">
35 <view class="item flex-vertical"> 37 <view class="item flex-vertical">
36 <view class="itemname">预约门店:</view> 38 <view class="itemname">预约门店:</view>
37 - <view class="itemvalue ellipsis-1">王者峡谷中路店</view> 39 + <view class="itemvalue ellipsis-1">{{item.store}}</view>
38 </view> 40 </view>
39 <view class="item flex-vertical"> 41 <view class="item flex-vertical">
40 <view class="itemname">预约项目:</view> 42 <view class="itemname">预约项目:</view>
41 - <view class="itemvalue ellipsis-1">头部按摩</view> 43 + <view class="itemvalue ellipsis-1">{{item.goods_name}}</view>
42 </view> 44 </view>
43 <view class="item flex-vertical"> 45 <view class="item flex-vertical">
44 <view class="itemname">美容师:</view> 46 <view class="itemname">美容师:</view>
45 - <view class="itemvalue ellipsis-1">花木兰</view> 47 + <view class="itemvalue ellipsis-1">{{item.meirongshi}}</view>
46 </view> 48 </view>
47 <view class="item flex-vertical"> 49 <view class="item flex-vertical">
48 <view class="itemname">预约时间:</view> 50 <view class="itemname">预约时间:</view>
49 - <view>2018-08-16 14:00</view> 51 + <view>{{item.time}}</view>
50 </view> 52 </view>
51 - <view class="item flex-vertical" wx:if="{{true}}"> 53 + <view class="item flex-vertical" wx:if="{{item.endtime==undefined?false:true}}">
52 <view class="itemname">服务时间:</view> 54 <view class="itemname">服务时间:</view>
53 - <view>2018-08-16 10:00</view> 55 + <view>{{item.endtime}}</view>
54 </view> 56 </view>
55 </view> 57 </view>
56 58
57 </view> 59 </view>
58 </navigator> 60 </navigator>
59 <view class="Unim flex-right-vertical fs26 padding"> 61 <view class="Unim flex-right-vertical fs26 padding">
60 -  
61 - <navigator class="Unimportance flex-level">取消预约</navigator>  
62 - <navigator wx:if="{{false}}" class="Unimportance flex-level">查看详情</navigator>  
63 -  
64 - <navigator class="important Unimportance flex-level">更改时间</navigator>  
65 - <navigator wx:if="{{false}}" class="important Unimportance flex-level">发表评价</navigator>  
66 - <navigator wx:if="{{false}}" class="important Unimportance flex-level">重新预约</navigator> 62 + <block wx:if="{{item.order_status==1}}">
  63 + <navigator url="/pages/user/my_service/tment_details" class="Unimportance flex-level">取消预约</navigator>
  64 + </block>
  65 + <block wx:else>
  66 + <navigator url="/pages/user/my_service/tment_details" class="Unimportance flex-level">查看详情</navigator>
  67 + </block>
  68 + <navigator class="important Unimportance flex-level" url="/pages/user/my_service/tment_details">更改时间</navigator>
  69 + <navigator url="/pages/user/my_service/tment_eval" wx:if="{{false}}" class="important Unimportance flex-level">发表评价</navigator>
  70 + <navigator url="/pages/user/my_service/appment_main" wx:if="{{false}}" class="important Unimportance flex-level">重新预约</navigator>
67 71
68 </view> 72 </view>
69 </view> 73 </view>
70 - <view class="exactly flex-center fs26"> 74 + <view class="exactly flex-center fs26" wx:if="{{ismore && service_List.length>=pageSize}}">
71 <view class="line"></view> 75 <view class="line"></view>
72 <view class="exactly_text">到底了</view> 76 <view class="exactly_text">到底了</view>
73 <view class="line"></view> 77 <view class="line"></view>
@@ -76,7 +80,7 @@ @@ -76,7 +80,7 @@
76 </view> 80 </view>
77 81
78 <!-- 无预约订单 --> 82 <!-- 无预约订单 -->
79 -<view class="empty_order" wx:if="{{true}}"> 83 +<view class="empty_order" wx:if="{{tm_order_list.length<1 && is_service_read}}">
80 <view class="flex-level"> 84 <view class="flex-level">
81 <image src="{{iurl}}miniapp/images/order/empty_order.png"></image> 85 <image src="{{iurl}}miniapp/images/order/empty_order.png"></image>
82 </view> 86 </view>
pages/user/my_service/tment_order_list.wxss
@@ -46,7 +46,7 @@ page { @@ -46,7 +46,7 @@ page {
46 } 46 }
47 47
48 .order_number { 48 .order_number {
49 - width: 500rpx; 49 + max-width: 500rpx;
50 } 50 }
51 51
52 .items { 52 .items {