Commit d2fff1687cce6e21ff12fe52b23c54c5bb0ac8d4

Authored by iceling
1 parent 169b46f7

预约订单列表的二维码,预约详情数据填充判断,选择预约时间

pages/user/my_service/beauty_deta.js
@@ -15,6 +15,8 @@ Page({ @@ -15,6 +15,8 @@ Page({
15 name: "", //美容师姓名 15 name: "", //美容师姓名
16 comment: "", //美容师评价 16 comment: "", //美容师评价
17 head_img: "", //美容师头像 17 head_img: "", //美容师头像
  18 + time: ["08:00", "09:00", "10:00", "11:00", "12:00", "13:00", "14:00", "15:00", "16:00", "17:00", "18:00", "19:00", "20:00", "21:00", "22:00"],
  19 + time_index: 0, //选择预约时间下标
18 }, 20 },
19 21
20 /** 22 /**
@@ -32,7 +34,7 @@ Page({ @@ -32,7 +34,7 @@ Page({
32 th.query_date(); 34 th.query_date();
33 }, 35 },
34 //图片失败,默认图片 36 //图片失败,默认图片
35 - bind_bnerr1: function (e) { 37 + bind_bnerr1: function(e) {
36 var _errImg = e.target.dataset.errorimg; 38 var _errImg = e.target.dataset.errorimg;
37 var _Img = e.target.dataset.img; 39 var _Img = e.target.dataset.img;
38 if (_Img != undefined) { 40 if (_Img != undefined) {
@@ -68,6 +70,24 @@ Page({ @@ -68,6 +70,24 @@ Page({
68 } 70 }
69 }) 71 })
70 }, 72 },
  73 + //返回上个页面
  74 + navigateBack:function(){
  75 + wx.navigateBack({ changed: true });//返回上一页
  76 + },
  77 + //选择时间
  78 + Selection_time: function(e) {
  79 + var th = this;
  80 + var index = e.currentTarget.dataset.index;
  81 + var time_index = th.data.time_index;
  82 + if (index == time_index) {
  83 + return;
  84 + } else {
  85 + th.setData({
  86 + time_index: time_index
  87 + })
  88 + }
  89 + },
  90 +
71 query_date: function() { 91 query_date: function() {
72 var th = this; 92 var th = this;
73 var url = "/api/weshop/marketing/reservation/staff/time/list"; 93 var url = "/api/weshop/marketing/reservation/staff/time/list";
@@ -82,8 +102,20 @@ Page({ @@ -82,8 +102,20 @@ Page({
82 }).then(res => { 102 }).then(res => {
83 if (res.data.code == 0) { 103 if (res.data.code == 0) {
84 var data = res.data.data; 104 var data = res.data.data;
  105 + var time = th.data.time; //固定时间
  106 + var time_list = [];
  107 + for (var i = 0; i < time.length; i++) {
  108 + for (var ii = ii; ii < data.length; ii++) {
  109 + if (time[i] == data[ii]) {
  110 + time_list[i] = data[ii];
  111 + break;
  112 + } else {
  113 + time_list[i] = "";
  114 + }
  115 + }
  116 + }
85 th.setData({ 117 th.setData({
86 - time_list: data 118 + time_list: time_list
87 }) 119 })
88 } else { 120 } else {
89 getApp().my_warnning(res.data.msg, 0, th); 121 getApp().my_warnning(res.data.msg, 0, th);
pages/user/my_service/beauty_deta.wxml
@@ -10,7 +10,7 @@ @@ -10,7 +10,7 @@
10 10
11 <view class="introduce fs26"> 11 <view class="introduce fs26">
12 <block wx:if="{{comment!=''}}"> 12 <block wx:if="{{comment!=''}}">
13 - {{comment}} 13 + {{comment}}
14 </block> 14 </block>
15 <block wx:else> 15 <block wx:else>
16 暂无介绍 16 暂无介绍
@@ -36,18 +36,27 @@ @@ -36,18 +36,27 @@
36 <!-- 选择时间 --> 36 <!-- 选择时间 -->
37 <view class="Times"> 37 <view class="Times">
38 38
39 - <view class="flex-center" wx:for="{{time_list}}" style="display:inline-block;">  
40 -  
41 - <view class="Time flex-center {{index==0?'chTime':'nochTime'}}">  
42 - <view>  
43 - <view class="fs26">{{item.GroupHour}}</view>  
44 - <block wx:if="{{flase}}">  
45 - <view class="fs24">约满</view>  
46 - </block> 39 + <view class="flex-center" wx:for="{{time}}" style="display:inline-block;">
  40 + <block wx:if="{{true}}">
  41 + <!-- {{item==time_list[index]}} -->
  42 + <view class="Time flex-center {{time_index==index?'chTime':''}}" bindtap="Selection_time" data-index="{{index}}">
  43 + <view>
  44 + <view class="fs26">{{item}}</view>
  45 + <block wx:if="{{flase}}">
  46 + <view class="fs24">约满</view>
  47 + </block>
  48 + </view>
47 </view> 49 </view>
48 - </view> 50 + </block>
  51 + <block wx:else>
  52 + <view class="Time flex-center nochTime">
  53 + <view>
  54 + <view class="fs26">{{item}}</view>
  55 + </view>
  56 + </view>
  57 + </block>
49 </view> 58 </view>
50 - <view class="choice flex-center fs32"> 59 + <view class="choice flex-center fs32" bindtap="navigateBack">
51 <view>确定选择</view> 60 <view>确定选择</view>
52 </view> 61 </view>
53 62
pages/user/my_service/tment_details.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 /**
@@ -9,13 +10,25 @@ Page({ @@ -9,13 +10,25 @@ Page({
9 */ 10 */
10 data: { 11 data: {
11 iurl: a.imghost, 12 iurl: a.imghost,
  13 + tment_details: [], //预约详情
12 }, 14 },
13 15
14 /** 16 /**
15 * 生命周期函数--监听页面加载 17 * 生命周期函数--监听页面加载
16 */ 18 */
17 onLoad: function(options) { 19 onLoad: function(options) {
18 - 20 + var th = this;
  21 + var url = "http://localhost:8022/api/weshop/yy_fuwu_meirsxiangq";
  22 + wx.request({
  23 + url: url,
  24 + success: function(res) {
  25 + if (res.data.code == 0) {
  26 + th.setData({
  27 + tment_details:res.data.data
  28 + })
  29 + }
  30 + }
  31 + })
19 }, 32 },
20 /** 33 /**
21 * 生命周期函数--监听页面显示 34 * 生命周期函数--监听页面显示
pages/user/my_service/tment_details.json
1 { 1 {
2 - "navigationBarTitleText": "预约详情" 2 + "navigationBarTitleText": "预约详情",
  3 + "usingComponents": {
  4 + "warn": "/components/long_warn/long_warn"
  5 + }
3 } 6 }
4 \ No newline at end of file 7 \ No newline at end of file
pages/user/my_service/tment_details.wxml
@@ -4,29 +4,30 @@ @@ -4,29 +4,30 @@
4 <!-- 状态栏 --> 4 <!-- 状态栏 -->
5 <view class="statusBar fs32 flex-vertical-between lf"> 5 <view class="statusBar fs32 flex-vertical-between lf">
6 <view>预约状态:</view> 6 <view>预约状态:</view>
7 - <view>未服务</view>  
8 - <view wx:if="{{false}}">已服务</view>  
9 - <view wx:if="{{false}}">已过期</view> 7 + <view wx:if="{{tment_details.state==1}}">未服务</view>
  8 + <view wx:if="{{tment_details.state==2}}">已服务</view>
  9 + <view wx:if="{{tment_details.state==3}}">已过期</view>
  10 + <view wx:if="{{tment_details.state==4}}">已取消</view>
10 </view> 11 </view>
11 <view class="fs30"> 12 <view class="fs30">
12 <view class="items lf"> 13 <view class="items lf">
13 <!-- 预约门店 --> 14 <!-- 预约门店 -->
14 <view class="flex-vertical bmt"> 15 <view class="flex-vertical bmt">
15 <view class="name">预约门店:</view> 16 <view class="name">预约门店:</view>
16 - <view class="ellipsis-1 value">王者峡谷中路店</view> 17 + <view class="ellipsis-1 value">{{tment_details.store_name}}</view>
17 </view> 18 </view>
18 19
19 <!-- 预约项目 --> 20 <!-- 预约项目 -->
20 <view class="flex-vertical bmt"> 21 <view class="flex-vertical bmt">
21 <view class="name">预约项目:</view> 22 <view class="name">预约项目:</view>
22 - <view class="ellipsis-1 value">王者峡谷中路店</view> 23 + <view class="ellipsis-1 value">{{tment_details.item}}</view>
23 </view> 24 </view>
24 25
25 <!-- 预约时间 --> 26 <!-- 预约时间 -->
26 <view class="flex-vertical bmt"> 27 <view class="flex-vertical bmt">
27 <view class="name">预约时间:</view> 28 <view class="name">预约时间:</view>
28 - <view class="date">2018-08-16</view>  
29 - <view>10:00</view> 29 + <view class="date">{{tment_details.time}}</view>
  30 + <view>{{tment_details.time_interval}}</view>
30 </view> 31 </view>
31 </view> 32 </view>
32 <view class="bt"> 33 <view class="bt">
@@ -38,7 +39,7 @@ @@ -38,7 +39,7 @@
38 <view>容</view> 39 <view>容</view>
39 <view>师:</view> 40 <view>师:</view>
40 </view> 41 </view>
41 - <view class="ellipsis-1 value">王者峡谷中路店</view> 42 + <view class="ellipsis-1 value">{{tment_details.Beautician}}</view>
42 </view> 43 </view>
43 <!-- 预约人及联系方式 --> 44 <!-- 预约人及联系方式 -->
44 <!-- 姓名 --> 45 <!-- 姓名 -->
@@ -48,7 +49,7 @@ @@ -48,7 +49,7 @@
48 <view>约</view> 49 <view>约</view>
49 <view>人:</view> 50 <view>人:</view>
50 </view> 51 </view>
51 - <view class="ellipsis-1 value">钱巧玲</view> 52 + <view class="ellipsis-1 value">{{tment_details.name}}</view>
52 </view> 53 </view>
53 <!-- 号码 --> 54 <!-- 号码 -->
54 <view class="flex-vertical"> 55 <view class="flex-vertical">
@@ -57,7 +58,7 @@ @@ -57,7 +58,7 @@
57 <view>机</view> 58 <view>机</view>
58 <view>人:</view> 59 <view>人:</view>
59 </view> 60 </view>
60 - <view>18065336494</view> 61 + <view>{{tment_details.phone}}</view>
61 </view> 62 </view>
62 </view> 63 </view>
63 </view> 64 </view>
@@ -82,16 +83,16 @@ @@ -82,16 +83,16 @@
82 <view class="subs flex-vertical-between fs32"> 83 <view class="subs flex-vertical-between fs32">
83 84
84 <view class="sub lb flex-center"> 85 <view class="sub lb flex-center">
85 - <view>取消预约</view>  
86 - <view wx:if="{{false}}">删除订单</view>  
87 - <view wx:if="{{false}}">更改时间</view> 86 + <view wx:if="{{tment_details.state==1}}">取消预约</view>
  87 + <view wx:if="{{tment_details.state==2 || tment_details.state==3}}">删除订单</view>
88 </view> 88 </view>
89 89
90 <view class="sub rb flex-center"> 90 <view class="sub rb flex-center">
91 - <view>更改时间</view>  
92 - <view wx:if="{{false}}">重新预约</view>  
93 - <view wx:if="{{false}}">发表评价</view> 91 + <navigator wx:if="{{tment_details.state==1}}" url="/pages/user/my_service/beauty_deta">更改时间</navigator>
  92 + <navigator wx:if="{{tment_details.state==2}}" url="/pages/user/my_service/tment_eval">发表评价</navigator>
  93 + <navigator wx:if="{{tment_details.state==3}}" url="/pages/user/my_service/appment_main">重新预约</navigator>
94 </view> 94 </view>
95 95
96 </view> 96 </view>
97 -</view>  
98 \ No newline at end of file 97 \ No newline at end of file
  98 +</view>
  99 +<warn id="warn"></warn>
99 \ No newline at end of file 100 \ No newline at end of file
pages/user/my_service/tment_order_list.js
@@ -49,6 +49,18 @@ Page({ @@ -49,6 +49,18 @@ Page({
49 return false; 49 return false;
50 } 50 }
51 }, 51 },
  52 + //显示核销码
  53 + code_show: function (e) {
  54 + var th = this;
  55 + //--获取成功的时候--
  56 + var no = e.currentTarget.dataset.order_sn;
  57 + var qc_com = th.selectComponent("#qc_com"); //组件的id
  58 + var obj = {
  59 + val: no,
  60 + content: "请将二维码展示给核销员,使用更快捷"
  61 + };
  62 + qc_com.open(obj)
  63 + },
52 query_orderList: function() { 64 query_orderList: function() {
53 var th = this; 65 var th = this;
54 var url = "http://localhost:8022/api/weshop/yy_order_list"; 66 var url = "http://localhost:8022/api/weshop/yy_order_list";
pages/user/my_service/tment_order_list.json
1 { 1 {
2 - "navigationBarTitleText": "我的预约" 2 + "navigationBarTitleText": "我的预约",
  3 + "usingComponents": {
  4 + "qr_code": "/components/qr_code/qr_code"
  5 + }
3 } 6 }
4 \ No newline at end of file 7 \ No newline at end of file
pages/user/my_service/tment_order_list.wxml
@@ -9,19 +9,15 @@ @@ -9,19 +9,15 @@
9 <!-- 预约项目 --> 9 <!-- 预约项目 -->
10 <view wx:for="{{tm_order_list}}"> 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 fs26 padding">
13 <!--商品编号 --> 13 <!--商品编号 -->
14 <text class="order_number ellipsis-1" selectable='true'>订单编号:{{item.order_sn}}</text> 14 <text class="order_number ellipsis-1" selectable='true'>订单编号:{{item.order_sn}}</text>
15 - <!-- 商品评价状态 -->  
16 - <view class="flex-center xc-wc">  
17 - <!-- 订单状态 --> 15 + <!-- 订单状态 -->
  16 + <view class="flex-center state">
18 <view wx:if="{{item.is_prom==1}}">未服务</view> 17 <view wx:if="{{item.is_prom==1}}">未服务</view>
19 <view wx:if="{{item.is_prom==2}}">已服务</view> 18 <view wx:if="{{item.is_prom==2}}">已服务</view>
20 <view wx:if="{{item.is_prom==3}}">已过期</view> 19 <view wx:if="{{item.is_prom==3}}">已过期</view>
21 - <view class="flex-center">  
22 - <view class="lin"></view>  
23 - <image src="{{iurl}}miniapp/images/trash.png" bindtap="deleteOrderData" data-order_id="{{index}}"></image>  
24 - </view> 20 + <view wx:if="{{item.is_prom==4}}">已取消</view>
25 </view> 21 </view>
26 </view> 22 </view>
27 23
@@ -59,15 +55,16 @@ @@ -59,15 +55,16 @@
59 </view> 55 </view>
60 </navigator> 56 </navigator>
61 <view class="Unim flex-right-vertical fs26 padding"> 57 <view class="Unim flex-right-vertical fs26 padding">
62 - <block wx:if="{{item.order_status==1}}"> 58 + <image wx:if="{{item.is_prom==1}}" src="{{iurl}}miniapp/images/order/code.png" class="code" bindtap="code_show" data-order_sn="{{item.order_sn}}"></image>
  59 + <block wx:if="{{item.is_prom==1}}">
63 <navigator url="/pages/user/my_service/tment_details" class="Unimportance flex-level">取消预约</navigator> 60 <navigator url="/pages/user/my_service/tment_details" class="Unimportance flex-level">取消预约</navigator>
64 </block> 61 </block>
65 <block wx:else> 62 <block wx:else>
66 - <navigator url="/pages/user/my_service/tment_details" class="Unimportance flex-level">查看详情</navigator> 63 + <navigator wx:if="{{item.is_prom==2 || item.is_prom==3}}" url="/pages/user/my_service/tment_details" class="Unimportance flex-level">查看详情</navigator>
67 </block> 64 </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> 65 + <navigator wx:if="{{item.is_prom==1}}" class="important Unimportance flex-level" url="/pages/user/my_service/beauty_deta">更改时间</navigator>
  66 + <navigator wx:if="{{item.is_prom==2}}" url="/pages/user/my_service/tment_eval" class="important Unimportance flex-level">发表评价</navigator>
  67 + <navigator wx:if="{{item.is_prom==3}}" url="/pages/user/my_service/appment_main" class="important Unimportance flex-level">重新预约</navigator>
71 68
72 </view> 69 </view>
73 </view> 70 </view>
@@ -90,4 +87,6 @@ @@ -90,4 +87,6 @@
90 <view class="flex-center fs28 white">立即预约</view> 87 <view class="flex-center fs28 white">立即预约</view>
91 </navigator> 88 </navigator>
92 </view> 89 </view>
93 -</view>  
94 \ No newline at end of file 90 \ No newline at end of file
  91 +</view>
  92 +<!-- 弹出框扫描 -->
  93 +<qr_code id="qc_com"></qr_code>
95 \ No newline at end of file 94 \ No newline at end of file
pages/user/my_service/tment_order_list.wxss
@@ -46,15 +46,20 @@ page { @@ -46,15 +46,20 @@ page {
46 } 46 }
47 47
48 .order_number { 48 .order_number {
49 - max-width: 500rpx; 49 + max-width: 550rpx;
  50 +}
  51 +.state{
  52 + color: rgb(216,63,82);
50 } 53 }
51 -  
52 .items { 54 .items {
53 border-top: 4rpx solid rgb(245, 245, 245); 55 border-top: 4rpx solid rgb(245, 245, 245);
54 border-bottom: 4rpx solid rgb(245, 245, 245); 56 border-bottom: 4rpx solid rgb(245, 245, 245);
55 height: 260rpx; 57 height: 260rpx;
56 } 58 }
57 - 59 +.code{
  60 + width: 55rpx;
  61 + height: 55rpx;
  62 +}
58 .itemimage { 63 .itemimage {
59 width: 190rpx; 64 width: 190rpx;
60 height: 190rpx; 65 height: 190rpx;