Commit 169b46f72213d8d31faa5d49d8112746c1ce771b

Authored by iceling
1 parent 4a880c9b

预约主界面选择门店分页绑定,预约详情调用美容师接口和预约时间接口

pages/user/my_service/appment_main.js
... ... @@ -19,9 +19,14 @@ Page({
19 19 store_name: "", //选择的服务门店
20 20 fir_pick_index: 0, //选择的门店下标
21 21 curpage: 1, //当前分页数
22   - pageSize: 5, //页大小
  22 + pageSize: 8, //页大小
23 23 total: 0,
24 24 ismore: 0, //是否加载完毕
  25 + itemId: "", //项目id
  26 + isScroll: true, //scroll-y是否可以滑动
  27 + key_word: "", //是否按门店文字查询
  28 + is_service_read: 0, //是否调用过门店接口
  29 + is_search: 0, //是否通过key_word调用接口
25 30 },
26 31 onclickstore: function() {
27 32 var th = this;
... ... @@ -84,15 +89,18 @@ Page({
84 89 //分页查询门店信息
85 90 query_store: function() {
86 91 var th = this;
87   - var itemid = "8f503b2e-f35f-4210-ba42-df4345526b93";
  92 + // var itemId = th.data.itemId;
  93 + var itemId = "08AD49D5-BAFD-4B5E-ABBA-B180EB64EED6";
88 94 var url = "/api/weshop/marketing/reservation/storage/page";
  95 + var key_word = th.data.key_word;
89 96 getApp().request.promiseGet(url, {
90 97 data: {
91 98 storeId: a.stoid,
92 99 userId: d.user_id,
93   - itemId: itemid,
  100 + itemId: itemId,
94 101 page: th.data.curpage,
95   - pageSize: th.data.pageSize
  102 + pageSize: th.data.pageSize,
  103 + KeyWord: key_word
96 104 }
97 105 }).then(res => {
98 106 if (res.data.code == 0) {
... ... @@ -127,7 +135,7 @@ Page({
127 135 beautician: 0
128 136 })
129 137 }
130   - var itemid = "8f503b2e-f35f-4210-ba42-df4345526b93";
  138 + var itemid = "08AD49D5-BAFD-4B5E-ABBA-B180EB64EED6";
131 139 var storageId = "FD8EC44A-6474-4BA1-A17C-A87306690E59";
132 140 var url = "/api/weshop/marketing/reservation/staff/page";
133 141 getApp().request.promiseGet(url, {
... ... @@ -150,15 +158,46 @@ Page({
150 158 var th = this;
151 159 var bea_name = e.currentTarget.dataset.beaname;
152 160 th.setData({
153   - beautician_name:bea_name
  161 + beautician_name: bea_name,
  162 + beautician: 0
154 163 })
155   -
  164 +
  165 + },
  166 + //获取搜索门店输入的值
  167 + input_store: function(e) {
  168 + this.setData({
  169 + key_word: e.detail.value
  170 + })
  171 + },
  172 + //搜索门店
  173 + search_store: function() {
  174 + var th = this;
  175 + var key_word = th.data.key_word;
  176 + var store_list = th.data.store_list;
  177 + if (key_word != "") {
  178 + th.setData({
  179 + curpage: 1,
  180 + is_search: 0,
  181 + store_list: []
  182 + })
  183 + th.query_store();
  184 + if (store_list.length < 1) {
  185 + th.setData({
  186 + is_search: 1
  187 + })
  188 + }
  189 + } else {
  190 + getApp().my_warnning("请输入门店名称",0,th);
  191 + }
156 192 },
157 193 /**
158 194 * 生命周期函数--监听页面加载
159 195 */
160 196 onLoad: function(options) {
161   -
  197 + var th = this;
  198 + th.setData({
  199 + itemId: options.itemId
  200 + })
162 201 },
163 202  
164 203 /**
... ...
pages/user/my_service/appment_main.wxml
... ... @@ -108,13 +108,13 @@
108 108 <icon bindtap="onclickstore" color="black" size="22" type="cancel"></icon>
109 109 </view>
110 110 <view class="searchbar flex-vertical-between storeListpadd">
111   - <input class="inputstore fs28" placeholder="输入要搜索的门店" placeholder-class="fs28" maxlength="16" />
112   - <view class="search flex-center">
  111 + <input class="inputstore fs28" placeholder="{{key_word==''?'输入要搜索的门店':key_word}}" placeholder-class="fs28" maxlength="16" bindinput="input_store"/>
  112 + <view class="search flex-center" bindtap="search_store">
113 113 <view class="fs28">搜索</view>
114 114 </view>
115 115 </view>
116 116 <!-- 选择门店 -->
117   - <view class="stores">
  117 + <scroll-view class="stores" scroll-y="{{isScroll}}" enable-back-to-top="true" bindscrolltolower="onReachBottom">
118 118 <view class="store flex-vertical" wx:for="{{store_list}}" bindtap="choose_for_store" data-ind="{{index}}">
119 119 <block wx:if="{{index==fir_pick_index}}">
120 120 <icon class="icon" type="success" color="red" size="20"></icon>
... ... @@ -133,10 +133,15 @@
133 133 </view>
134 134 </view>
135 135 <!-- 通过搜索的时候没有找到的提示语 -->
136   - <view wx:if="{{false}}" class="flex-center fs28 notstore">
137   - <view>没有找到这个门店</view>
  136 + <view wx:if="{{store_list.length<1 && is_search}}" class="flex-center fs28 notstore">
  137 + <view>没有找到{{key_word}}门店</view>
138 138 </view>
139   - </view>
  139 +
  140 + <!-- 数据加载完毕 -->
  141 + <view wx:if="{{ismore && store_list.length>1 && key_word!=''}}" class="flex-center fs28 notstore">
  142 + <view>数据加载完毕</view>
  143 + </view>
  144 + </scroll-view>
140 145 <!-- sub -->
141 146 <view class="flex-center fs32" bindtap="choice_store">
142 147 <view class="determine flex-center">
... ...
pages/user/my_service/appment_main.wxss
... ... @@ -200,7 +200,7 @@
200 200 }
201 201  
202 202 .stores {
203   - height: 468rpx;
  203 + height: 520rpx;
204 204 overflow-y: scroll;
205 205 }
206 206  
... ... @@ -261,6 +261,6 @@
261 261 max-width: 300rpx;
262 262 }
263 263 .notstore{
264   - margin-top: 30rpx;
  264 + height: 80rpx;
265 265 color: rgb(159, 159, 159);
266 266 }
267 267 \ No newline at end of file
... ...
pages/user/my_service/beauty_deta.js
1   -var e = getApp(), a = e.globalData.setting, os = a, t = e.request;
  1 +var e = getApp(),
  2 + a = e.globalData.setting,
  3 + os = a,
  4 + t = e.request,
  5 + d = e.globalData;
2 6 Page({
3 7  
4 8 /**
... ... @@ -6,61 +10,84 @@ Page({
6 10 */
7 11 data: {
8 12 iurl: a.imghost,
  13 + seekTime: "2019-11-18", //当前服务预约选择的时间
  14 + time_list: [], //可预约时间
  15 + name: "", //美容师姓名
  16 + comment: "", //美容师评价
  17 + head_img: "", //美容师头像
9 18 },
10 19  
11 20 /**
12 21 * 生命周期函数--监听页面加载
13 22 */
14   - onLoad: function (options) {
  23 + onLoad: function(options) {
15 24  
16 25 },
17   -
18   - /**
19   - * 生命周期函数--监听页面初次渲染完成
20   - */
21   - onReady: function () {
22   -
23   - },
24   -
25 26 /**
26 27 * 生命周期函数--监听页面显示
27 28 */
28   - onShow: function () {
29   -
30   - },
31   -
32   - /**
33   - * 生命周期函数--监听页面隐藏
34   - */
35   - onHide: function () {
36   -
  29 + onShow: function() {
  30 + var th = this;
  31 + th.query_beatea();
  32 + th.query_date();
37 33 },
38   -
39   - /**
40   - * 生命周期函数--监听页面卸载
41   - */
42   - onUnload: function () {
43   -
  34 + //图片失败,默认图片
  35 + bind_bnerr1: function (e) {
  36 + var _errImg = e.target.dataset.errorimg;
  37 + var _Img = e.target.dataset.img;
  38 + if (_Img != undefined) {
  39 + var _errObj = {};
  40 + _errObj[_errImg] = "/miniapp/images/no_cate_def.png";
  41 + this.setData(_errObj) //注意这里的赋值方式,只是将数据列表中的此项图片路径值替换掉 ;
  42 + }
44 43 },
45   -
46   - /**
47   - * 页面相关事件处理函数--监听用户下拉动作
48   - */
49   - onPullDownRefresh: function () {
50   -
  44 + //获取美容师信息
  45 + query_beatea: function() {
  46 + var th = this;
  47 + var url = "/api/weshop/marketing/reservation/staff/page"; //接口路径
  48 + var itemId = "08AD49D5-BAFD-4B5E-ABBA-B180EB64EED6",
  49 + storageId = "FD8EC44A-6474-4BA1-A17C-A87306690E59";
  50 +
  51 + getApp().request.promiseGet(url, {
  52 + data: {
  53 + itemId: itemId,
  54 + storageId: storageId,
  55 + storeId: 1,
  56 + userId: 5682130
  57 + }
  58 + }).then(res => {
  59 + if (res.data.code == 0) {
  60 + var data = res.data.data.pageData;
  61 + th.setData({
  62 + name: data[0].StaffName,
  63 + comment: data[0].Remark1,
  64 + head_img: data[0].PhotoUrl
  65 + })
  66 + } else {
  67 + getApp().my_warnning(res.data.msg, 0, th);
  68 + }
  69 + })
51 70 },
52   -
53   - /**
54   - * 页面上拉触底事件的处理函数
55   - */
56   - onReachBottom: function () {
57   -
  71 + query_date: function() {
  72 + var th = this;
  73 + var url = "/api/weshop/marketing/reservation/staff/time/list";
  74 + var SeekTime = th.data.seekTime;
  75 + getApp().request.promiseGet(url, {
  76 + data: {
  77 + BeauticianID: "337C11B8-034B-495D-B360-FC2F6CB29394",
  78 + ProjectID: "08AD49D5-BAFD-4B5E-ABBA-B180EB64EED6",
  79 + SeekTime: SeekTime,
  80 + storeId: a.stoid,
  81 + }
  82 + }).then(res => {
  83 + if (res.data.code == 0) {
  84 + var data = res.data.data;
  85 + th.setData({
  86 + time_list: data
  87 + })
  88 + } else {
  89 + getApp().my_warnning(res.data.msg, 0, th);
  90 + }
  91 + })
58 92 },
59   -
60   - /**
61   - * 用户点击右上角分享
62   - */
63   - onShareAppMessage: function () {
64   -
65   - }
66 93 })
67 94 \ No newline at end of file
... ...
pages/user/my_service/beauty_deta.json
1 1 {
2   - "navigationBarTitleText": "美容师详情"
  2 + "navigationBarTitleText": "美容师详情",
  3 + "usingComponents": {
  4 + "warn": "/components/long_warn/long_warn"
  5 + }
3 6 }
4 7 \ No newline at end of file
... ...
pages/user/my_service/beauty_deta.wxml
... ... @@ -5,12 +5,12 @@
5 5 <view class="comments">
6 6 <!-- 个人信息 -->
7 7 <view class="Personal">
8   - <view class="name fs36 ellipsis-1">兰陵王</view>
9   - <image class="head" src="{{iurl}}/miniapp/images/yyservice/Cosm_appo.png"></image>
  8 + <view class="name fs36 ellipsis-1">{{name}}</view>
  9 + <image class="head" src="{{iurl+head_img}}" lazy-load="true" data-errorimg="{{iurl+head_img}}" binderror="bind_bnerr1" data-img="{{iurl+head_img}}"></image>
10 10  
11 11 <view class="introduce fs26">
12   - <block wx:if="{{true}}">
13   - 在职业培训、职业技能鉴定与企业用人要求之间建立一-个有效实用的联系,经研究决定,以《职业技能鉴定国家题库操作技能考试手册》的方式,向全社会公布国家题库扬权技能张甲成试题库的全部内容。
  12 + <block wx:if="{{comment!=''}}">
  13 + {{comment}}
14 14 </block>
15 15 <block wx:else>
16 16 暂无介绍
... ... @@ -36,11 +36,11 @@
36 36 <!-- 选择时间 -->
37 37 <view class="Times">
38 38  
39   - <view class="flex-center" wx:for="1111100000" style="display:inline-block;">
  39 + <view class="flex-center" wx:for="{{time_list}}" style="display:inline-block;">
40 40  
41 41 <view class="Time flex-center {{index==0?'chTime':'nochTime'}}">
42 42 <view>
43   - <view class="fs26">09:00</view>
  43 + <view class="fs26">{{item.GroupHour}}</view>
44 44 <block wx:if="{{flase}}">
45 45 <view class="fs24">约满</view>
46 46 </block>
... ... @@ -57,4 +57,5 @@
57 57  
58 58 </view>
59 59  
60   -</view>
61 60 \ No newline at end of file
  61 +</view>
  62 +<warn id="warn"></warn>
62 63 \ No newline at end of file
... ...
pages/user/my_service/i_service.js
... ... @@ -104,7 +104,7 @@ Page({
104 104 var _Img = e.target.dataset.img;
105 105 if (_Img != undefined) {
106 106 var _errObj = {};
107   - _errObj[_errImg] = "/miniapp/images/no_cate_def.png";
  107 + _errObj[_errImg] = "/miniapp/images/no_cate_def.png";
108 108 this.setData(_errObj) //注意这里的赋值方式,只是将数据列表中的此项图片路径值替换掉 ;
109 109 }
110 110 },
... ...
pages/user/my_service/i_service.wxml
... ... @@ -49,7 +49,7 @@
49 49 <view>立即使用</view>
50 50 </view>
51 51 <!-- 可预约 -->
52   - <navigator class="flex-level appointment" url="/pages/user/my_service/appment_main">
  52 + <navigator class="flex-level appointment" url="/pages/user/my_service/appment_main?itemId={{item.ProjectID}}">
53 53 <view>预约</view>
54 54 </navigator>
55 55 </view>
... ...