From 071ff52a07177596d7c236dc47bb57d68c44bc57 Mon Sep 17 00:00:00 2001
From: 935090232@qq.com <ak473600000>
Date: Fri, 15 Jan 2021 23:30:05 +0800
Subject: [PATCH] 1
---
pages/yuyue/order.wxml | 32 ++-
pages/yuyue/choseService.wxml | 41 +++-
pages/yuyue/choseService.wxss | 9
pages/yuyue/order.js | 64 ++++---
pages/yuyue/khyuyue.wxml | 2
pages/yuyue/showYyInfo.wxml | 69 ++++++++
app.json | 5
pages/yuyue/showYyInfo.wxss | 46 +++++
app.js | 4
utils/util.js | 2
pages/yuyue/choseService.js | 47 ++---
pages/yuyue/yyInfo.js | 7
pages/yuyue/showYyInfo.js | 121 +++++++++++++++
pages/yuyue/yyInfo.wxml | 4
pages/yuyue/khyuyue.js | 1
project.config.json | 6
pages/yuyue/showYyInfo.json | 3
17 files changed, 355 insertions(+), 108 deletions(-)
diff --git a/app.js b/app.js
index b83ba5e..c201d3e 100644
--- a/app.js
+++ b/app.js
@@ -6,11 +6,11 @@
// baseUrl: "https://xcxhive2.jyymatrix.cc",
//测试环境
- baseUrl : "https://testhive.jyymatrix.cc",
+ // baseUrl : "https://testhive.jyymatrix.cc",
//本地环境
- // baseUrl : "http://localhost:8080",
+ baseUrl : "http://localhost:8080",
//登录后获得的token
loginToken: "",
diff --git a/app.json b/app.json
index 855ca29..7f59503 100644
--- a/app.json
+++ b/app.json
@@ -3,7 +3,6 @@
"pages/index/index",
"pages/service/service",
"pages/groupbuy/groupDetails",
-
"pages/customerCenter/customerCenter",
"pages/yuyue/khyuyue",
"pages/yuyue/choseShop",
@@ -48,8 +47,8 @@
"pages/miaosha/msDetails",
"pages/index-back/index",
"pages/miaosha/msOrder",
- "pages/yuyue/shopOrder"
-
+ "pages/yuyue/shopOrder",
+ "pages/yuyue/showYyInfo"
],
"window": {
"backgroundTextStyle": "light",
diff --git a/pages/yuyue/choseService.js b/pages/yuyue/choseService.js
index f8827c5..0021fdf 100644
--- a/pages/yuyue/choseService.js
+++ b/pages/yuyue/choseService.js
@@ -9,7 +9,8 @@
*/
data: {
cates: [{ attrName: "全部", attrCode:""}],
- serviceList:[],
+ composeProj:[],
+ proj:[],
cateIndex:0,
offset: 0,
limit:10,
@@ -34,34 +35,24 @@
onLoad: function (options) {
var _this=this;
//加载分类
- util.request({
- api: api.productAttribute.getByCode + app.shopInfo.id+"/service",
- callback:function(data){
- var cates = _this.data.cates.concat(data.rows);
- _this.setData({
- cates: cates
- });
- _this.loadService();
- }
- });
+ _this.loadService();
},
loadService:function(){
var _this = this;
- var categoryId = _this.data.cates[_this.data.cateIndex].attrId;
- var serviceList = _this.data.serviceList;
-
+ var userInfo= getApp().userInfo;
+ var phoneNumber=userInfo.phoneNumber;
util.request({
- api: api.goods.searchGoods,
- data: { categoryId: categoryId, isService: 1, offset: _this.data.offset,limit:_this.data.limit},
- callback:function(data){
- for (var i = 0; i < data.rows.length; i++) {
- serviceList.push(data.rows[i])
- }
+ api:'/wxapi/yuyue/getUserPro/'+phoneNumber,
+
+ callback:function(data){
+ var composeProj=data.mapInfo.proj.composeProj;
+ var proj=data.mapInfo.proj.proj;
_this.setData({
- serviceList: serviceList,
+ composeProj: composeProj,
+ proj:proj
});
}
});
@@ -69,20 +60,14 @@
// 上拉加载
onReachBottom: function () {
- var _this = this;
- var offset = _this.data.offset;
- var limit = _this.data.limit;
- _this.setData({
- offset: offset + limit
- });
- this.loadService();
+
},
chooseService:function(e){
- var index=e.currentTarget.dataset.index;
- var service =this.data.serviceList[index];
- wx.setStorageSync('chooseService', service);
+ var item=e.currentTarget.dataset.pro;
+
+ wx.setStorageSync('chooseService', item);
wx.navigateBack({
delta: 1,
});
diff --git a/pages/yuyue/choseService.wxml b/pages/yuyue/choseService.wxml
index 77c80c6..98d3f4d 100644
--- a/pages/yuyue/choseService.wxml
+++ b/pages/yuyue/choseService.wxml
@@ -1,34 +1,47 @@
-<scroll-view class="top" scroll-x>
-
-
+<!--
<block wx:for="{{cates}}" wx:key >
<view class="cate-item active" wx:if="{{index==cateIndex}}" >{{item.attrName}}</view>
<view class="cate-item " wx:if="{{index!=cateIndex}}" bindtap="chooseCate" data-index="{{index}}" >{{item.attrName}}</view>
</block>
-
-</scroll-view>
+-->
<scroll-view scroll-y >
-
- <view class="service-wrap" wx:for="{{serviceList}}" wx:key bindtap="chooseService"
- data-index="{{index}}" >
+ <block >
+ <view class="cate-item " >已购套餐/项目</view>
+</block>
+<view wx:for="{{composeProj}}" wx:for-item="tc" >
+ <view class="service-wrap" wx:for="{{tc.proj}}" wx:key bindtap="chooseService"
+ data-pro="{{item}}" >
<view class="inner-wrap">
<view class="content-wrap" >
- <image mode="aspectFit" src="{{item.imgMobile}}"></image>
<view class="m-info" >
- <view class="title">{{item.title}}</view>
- <!-- <view class="price">¥{{item.price}}</view> -->
+ <view class="title">{{item.name}}</view>
</view>
<view class="s-info">
- <text class="s-time">约{{item.serviceTime}}分钟</text>
+ <text class="s-time">约{{item.timeLength}}分钟</text>
<text class="iconfont iconright"></text>
</view>
</view>
</view>
- </view>
+</view>
+</view>
+<view class="service-wrap" wx:for="{{proj}}" wx:key bindtap="chooseService"
+ data-pro="{{item}}" >
+ <view class="inner-wrap">
+ <view class="content-wrap" >
+ <view class="m-info" >
+ <view class="title">{{item.name}}</view>
+ </view>
+ <view class="s-info">
+ <text class="s-time">约{{item.timeLength}}分钟</text>
+ <text class="iconfont iconright"></text>
+ </view>
+ </view>
+ </view>
+</view>
-
+
</scroll-view>
\ No newline at end of file
diff --git a/pages/yuyue/choseService.wxss b/pages/yuyue/choseService.wxss
index 059608a..2150775 100644
--- a/pages/yuyue/choseService.wxss
+++ b/pages/yuyue/choseService.wxss
@@ -10,14 +10,14 @@
}
.cate-item{
- height: 30px;
+ height:40px;
overflow: hidden;
padding: 5px 10px;
color: #999;
- display: inline-block;
line-height: 40px;
+text-align: center;
font-size: 14px;
-
+background: #f7f7f7;
}
.service-wrap{
@@ -26,9 +26,6 @@
border-radius: 5px;
background: #fff;
overflow:hidden;
-}
-.service-wrap:first-of-type{
- margin-top:50px;
}
diff --git a/pages/yuyue/khyuyue.js b/pages/yuyue/khyuyue.js
index 3d569ac..8feea3d 100644
--- a/pages/yuyue/khyuyue.js
+++ b/pages/yuyue/khyuyue.js
@@ -344,7 +344,6 @@
if (!this.data.unneededMasseuse) {
serviceOrder['staffInfo'] = this.data.masseuse;
}
- debugger
wx.setStorageSync("serviceOrder", serviceOrder);
wx.navigateTo({
diff --git a/pages/yuyue/khyuyue.wxml b/pages/yuyue/khyuyue.wxml
index d4affcd..c8afdef 100644
--- a/pages/yuyue/khyuyue.wxml
+++ b/pages/yuyue/khyuyue.wxml
@@ -37,7 +37,7 @@
<view class="itemBox" wx:if="{{isLogin && hasChooseService}}" bindtap="chooseService" >
<view class="iconfont iconxiangmu ic fl"></view>
- <text class="shop fl">{{service.title}} </text>
+ <text class="shop fl">{{service.name}} </text>
<view class="iconfont iconright fr"></view>
<!--<text class="info fr">¥{{service.price}}</text>-->
</view>
diff --git a/pages/yuyue/order.js b/pages/yuyue/order.js
index e4c57ac..55a2942 100644
--- a/pages/yuyue/order.js
+++ b/pages/yuyue/order.js
@@ -5,8 +5,8 @@
data: {
currentIndex: 0,
orderList: [],
- limit: 8,
- offset: 0,
+ pageSize: 8,
+ pageNum: 1,
refresh: false,
orderShow: false,
// hiddenData:true
@@ -52,7 +52,7 @@
this.setData({
currentIndex: index,
- offset: 0
+ pageNum: 0
})
this.getOrderInfo(index);
},
@@ -61,15 +61,15 @@
getOrderInfo: function(index) {
var _this = this;
- var limit = _this.data.limit;
- var offset = _this.data.offset;
- var status=index=="0"?"":index;
+ var pageSize = _this.data.pageSize;
+ var pageNum = _this.data.pageNum;
+ var status=this.data.currentIndex;
util.request({
api: api.yuyue.getServiceOrderList,
data: {
- "limit": limit,
- "status": status,
- "offset": offset
+ "pageSize": pageSize,
+ "vipStatus": status,
+ "pageNum": pageNum
},
callback: function(data) {
console.log("订单信息")
@@ -81,10 +81,12 @@
if (orderList.length == 0) {
_this.setData({
orderShow: true,
+ noMore:true
})
} else {
_this.setData({
- orderShow: false
+ orderShow: false,
+ noMore:false
})
}
}
@@ -108,14 +110,13 @@
if (sm.confirm) {
util.request({
- api: api.yuyue.cancelOrderById,
+ api: api.yuyue.cancelOrderById+"/"+id,
data: { id: id},
callback: function (data) {
wx.showToast({
title: '取消成功',
success: function () {
- debugger
- _this.getOrderInfo(0);
+ _this.getOrderInfo(index);
}
})
}
@@ -157,7 +158,7 @@
var _this = this;
var id = e.currentTarget.dataset.id;
wx.navigateTo({
- url: '/pages/yuyue/yyInfo?model=2&id=' + id,
+ url: '/pages/yuyue/showYyInfo?id=' + id,
})
},
@@ -165,29 +166,36 @@
onReachBottom: function() {
var _this = this;
- var limit = _this.data.limit;
- var offset = _this.data.offset + limit;
+ var pageSize = _this.data.pageSize;
+ var pageNum = _this.data.pageNum + 1;
var orderList = _this.data.orderList;
- var index = _this.data.currentIndex;
- var status = index == "0" ? "" : index;
+ var status = _this.data.currentIndex;
_this.setData({
- offset: offset
+ pageNum: pageNum
});
util.request({
api: api.yuyue.getServiceOrderList,
data: {
- "limit": limit,
- "status": status,
- "offset": offset
+ "pageSize": pageSize,
+ "vipStatus": status,
+ "pageNum": pageNum
},
callback: function(data) {
- for (var i = 0; i < data.rows.length; i++) {
- orderList.push(data.rows[i]);
- }
- _this.setData({
- orderList: orderList
- });
+ if(data.rows.length>0){
+ for (var i = 0; i < data.rows.length; i++) {
+ orderList.push(data.rows[i]);
+ }
+ _this.setData({
+ orderList: orderList
+ });
+ }else{
+ _this.setData({
+ noMore:true
+ })
+ }
+
+
}
});
diff --git a/pages/yuyue/order.wxml b/pages/yuyue/order.wxml
index 52cab3b..e01539b 100644
--- a/pages/yuyue/order.wxml
+++ b/pages/yuyue/order.wxml
@@ -2,33 +2,38 @@
<view class='tabs_box'>
- <view class="tabs_item {{currentIndex==0?'selected':''}}" bindtap='onTabsItemEvent' data-index="">
+ <view class="tabs_item {{currentIndex==0?'selected':''}}" bindtap='onTabsItemEvent' data-index="0">
全部
</view>
<view class="tabs_item {{currentIndex==1?'selected':''}}" bindtap='onTabsItemEvent' data-index="1">
- 待服务
+ 待确认
</view>
<view class="tabs_item {{currentIndex==2?'selected':''}}" bindtap='onTabsItemEvent' data-index="2">
- 已完成
+ 进行中
</view>
<view class="tabs_item {{currentIndex==3?'selected':''}}" bindtap='onTabsItemEvent' data-index="3">
+ 待评价
+ </view>
+ <view class="tabs_item {{currentIndex==4?'selected':''}}" bindtap='onTabsItemEvent' data-index="4">
+ 已评价
+ </view>
+ <view class="tabs_item {{currentIndex==5?'selected':''}}" bindtap='onTabsItemEvent' data-index="5">
已取消
</view>
-
</view>
<view class="order-container" wx:if="{{!orderShow}}">
<view class="order-list radius" wx:for="{{orderList}}" wx:key="ids" data-id="{{item.id}}" bindtap='intoDetail'>
<view class='order-top'>
- <text class='grey'>订单编号:{{item.orderNo}}</text>
- <text class='explain'>{{item.dicMap.status}}</text>
+ <text class='grey'>订单编号:{{item.serviceNo}}</text>
+ <text class='explain'>{{item.shopName}}</text>
</view>
<view class='order-middle'>
- <image src='{{item.shopProduct.imgMobile}}' class='order-image' mode="aspectFit"></image>
+ <image src='{{proj.imgMobile}}' class='order-image' mode="aspectFit"></image>
<view class='order-info'>
- <view class='name'>{{item.shopProduct.title}}</view>
- <view class='grey norms'>{{item.shopInfo.shopName}} </view>
+ <view wx:for="{{item.projs}}" wx:for-item="proj" class='name'>{{proj.projName}}</view>
+
<view class="goods-group">
<!-- <view class='price'>¥{{item.shopProduct.price}}</view>-->
</view>
@@ -37,12 +42,19 @@
<view class='order-bottom'>
- <text class='cancel-order' wx:if="{{item.status == 1}}" data-index="{{index}}" data-id="{{item.id}}" capture-catch:touchstart='cancelOrder'>取消订单</text>
+ <text class='cancel-order' wx:if="{{item.status == 9}}" data-index="{{index}}" data-id="{{item.id}}" capture-catch:touchstart='cancelOrder'>取消订单</text>
</view>
</view>
</view>
+ <!-- 没有更多数据 -->
+ <view class='text-center pd-10' wx:if="{{noMore}}">
+ <view>
+ <text class="color_gray font-12">没有更多了~</text>
+ </view>
+ </view>
+
</view>
diff --git a/pages/yuyue/showYyInfo.js b/pages/yuyue/showYyInfo.js
new file mode 100644
index 0000000..04e1020
--- /dev/null
+++ b/pages/yuyue/showYyInfo.js
@@ -0,0 +1,121 @@
+const app = getApp()
+var util = require('../../utils/util.js');
+var api = require('../../utils/service-api.js');
+
+Page({
+
+ /**
+ * 页面的初始数据
+ */
+ data: {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面加载
+ */
+ onLoad: function(options) {
+ console.log(options);
+ var _this = this;
+ //查看已有订单
+ util.request({
+ api: api.yuyue.getServiceOrderById + options.id,
+ callback: function(data) {
+
+ _this.setData({
+ serviceOrder: data.mapInfo.detail,
+ shopInfo:data.mapInfo.shopInfo
+ })
+ }
+ });
+ },
+
+ cancel: function() {
+ console.log("cancel");
+ var _this = this;
+ wx.showModal({
+ title: '提示',
+ content: '确定要取消吗?',
+ success: function(sm) {
+ if (sm.confirm) {
+ var id = _this.data.serviceOrder.id;
+ util.request({
+ api: api.yuyue.cancelOrderById,
+ data: { id: id },
+ callback: function(data) {
+ wx.showToast({
+ title: '取消成功',
+ success: function() {
+ wx.navigateBack({});
+ }
+ })
+ }
+ });
+ }
+ }
+ })
+
+ },
+
+
+ backKhyuyue: function() {
+
+ wx.navigateBack({
+
+ })
+
+ },
+
+
+
+
+
+ /**
+ * 生命周期函数--监听页面初次渲染完成
+ */
+ onReady: function() {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面显示
+ */
+ onShow: function() {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面隐藏
+ */
+ onHide: function() {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面卸载
+ */
+ onUnload: function() {
+
+ },
+
+ /**
+ * 页面相关事件处理函数--监听用户下拉动作
+ */
+ onPullDownRefresh: function() {
+
+ },
+
+ /**
+ * 页面上拉触底事件的处理函数
+ */
+ onReachBottom: function() {
+
+ },
+
+ /**
+ * 用户点击右上角分享
+ */
+ onShareAppMessage: function() {
+
+ }
+})
\ No newline at end of file
diff --git a/pages/yuyue/showYyInfo.json b/pages/yuyue/showYyInfo.json
new file mode 100644
index 0000000..8835af0
--- /dev/null
+++ b/pages/yuyue/showYyInfo.json
@@ -0,0 +1,3 @@
+{
+ "usingComponents": {}
+}
\ No newline at end of file
diff --git a/pages/yuyue/showYyInfo.wxml b/pages/yuyue/showYyInfo.wxml
new file mode 100644
index 0000000..f23f5fe
--- /dev/null
+++ b/pages/yuyue/showYyInfo.wxml
@@ -0,0 +1,69 @@
+<scroll-view scroll-y>
+
+<view class="itemWrap" wx:if="{{model!=0}}">
+ <view class="lable">
+ <text class="iconfont icondianpu"></text>
+ <text >订单状态</text>
+ </view>
+ <view class="info">{{serviceOrder.status}}</view>
+ <view class="info-s">订单编号:{{serviceOrder.serviceNo}}</view>
+ </view>
+
+
+ <view class="itemWrap">
+ <view class="lable">
+ <text class="iconfont icondianpu"></text>
+ <text >门店地址</text>
+ </view>
+ <view class="info">{{shopInfo.shopName}}</view>
+ <view class="info-s">{{shopInfo.shopAddr}}</view>
+ </view>
+
+ <view class="itemWrap">
+ <view class="lable">
+ <text class="iconfont icondianpu"></text>
+ <text >预约到店时间</text>
+ </view>
+ <view class="info">{{serviceOrder.yyTime}}</view>
+ <view class="info-s">服务时长约{{serviceOrder.totalTime}}分钟</view>
+ </view>
+
+<view class="itemWrap">
+ <view class="lable">
+ <text class="iconfont icondianpu"></text>
+ <text >服务和技师</text>
+ </view>
+ <view wx:for="{{serviceOrder.items}}" >
+ <view class="info">{{item.name}}</view>
+ <view class="info-s">{{item.beautyName}}</view>
+ </view>
+ </view>
+<form bindsubmit="submitYuyue" >
+
+<view class="itemWrap" wx:if="{{model==0}}">
+ <view class="lable">
+ <text class="iconfont icondianpu"></text>
+ <text >到店人</text>
+ </view>
+ <view class="forms" >
+ <input placeholder="请输入到店人名称" value="{{serviceOrder.vipName}}"name="vipName" ></input>
+ <input placeholder="请输入联系电话" value="{{serviceOrder.phone}}" name="tel" ></input>
+ <input placeholder="备注" value="{{serviceOrder.remark}}" name="remark" ></input>
+ </view>
+ </view>
+
+
+
+
+
+
+<view bindtap="backKhyuyue" class=" bgbtn " >
+ 返回
+</view>
+
+</form>
+
+
+
+
+</scroll-view>
\ No newline at end of file
diff --git a/pages/yuyue/showYyInfo.wxss b/pages/yuyue/showYyInfo.wxss
new file mode 100644
index 0000000..dc35481
--- /dev/null
+++ b/pages/yuyue/showYyInfo.wxss
@@ -0,0 +1,46 @@
+.itemWrap{
+ width: 90%;
+ margin: 20px auto;
+ overflow: hidden;
+}
+.iconfont{
+ margin-right:5px;
+}
+
+.lable{
+ color: #aeaeae;
+ font-size: 14px;
+
+
+}
+.info{
+ font-size: 16px;
+ margin: 15px 0px 5px 10px;
+
+}
+
+.info-s{
+ font-size: 12px;
+ margin-left: 10px;
+}
+
+.forms{
+ background: #fff;
+ border-radius: 5px;
+ height: 400rpx;
+ width: 100%;
+ margin-top: 20px;
+ padding: 15px
+}
+.forms input{
+ display: block;
+ width: 90%;
+ float: left;
+ height: 50px;
+ font-size:14px;
+ border-bottom: 1px solid #efefef;
+}
+
+.forms input:nth-child(3){
+ border-bottom:none;
+}
\ No newline at end of file
diff --git a/pages/yuyue/yyInfo.js b/pages/yuyue/yyInfo.js
index cdd7de6..fc70eee 100644
--- a/pages/yuyue/yyInfo.js
+++ b/pages/yuyue/yyInfo.js
@@ -143,16 +143,11 @@
api: api.yuyue.createServiceOrder,
data: orderInfo,
callback: function (data) {
- var id = data.rows[0].id;
wx.redirectTo({
- url: '/pages/yuyue/yySuccess?id=' + id,
+ url: '/pages/yuyue/order',
})
}
});
-
-
-
-
},
diff --git a/pages/yuyue/yyInfo.wxml b/pages/yuyue/yyInfo.wxml
index f399473..cf4685a 100644
--- a/pages/yuyue/yyInfo.wxml
+++ b/pages/yuyue/yyInfo.wxml
@@ -25,7 +25,7 @@
<text >预约到店时间</text>
</view>
<view class="info">{{serviceOrder.time}}</view>
- <view class="info-s">服务时长约{{serviceOrder.shopProduct.serviceTime}}分钟</view>
+ <view class="info-s">服务时长约{{serviceOrder.shopProduct.timeLength}}分钟</view>
</view>
<view class="itemWrap">
@@ -33,7 +33,7 @@
<text class="iconfont icondianpu"></text>
<text >服务和技师</text>
</view>
- <view class="info">{{serviceOrder.shopProduct.title}}
+ <view class="info">{{serviceOrder.shopProduct.name}}
<!-- <text class="price fr">¥{{serviceOrder.shopProduct.price}}</text> -->
</view>
<view class="info-s">{{serviceOrder.staffInfo.staffName}}</view>
diff --git a/project.config.json b/project.config.json
index ec6fc68..8bef61b 100644
--- a/project.config.json
+++ b/project.config.json
@@ -21,8 +21,9 @@
"checkSiteMap": true,
"uploadWithSourceMap": true,
"compileHotReLoad": false,
- "useMultiFrameRuntime": false,
+ "useMultiFrameRuntime": true,
"useApiHook": true,
+ "useApiHostProcess": false,
"babelSetting": {
"ignore": [],
"disablePlugins": [],
@@ -32,10 +33,9 @@
"useIsolateContext": true,
"useCompilerModule": true,
"userConfirmedUseCompilerModuleSwitch": false,
+ "userConfirmedBundleSwitch": false,
"packNpmManually": false,
"packNpmRelationList": [],
- "enableEngineNative": false,
- "userConfirmedBundleSwitch": false,
"minifyWXSS": true
},
"compileType": "miniprogram",
diff --git a/utils/util.js b/utils/util.js
index 6fc81a6..5c503c6 100644
--- a/utils/util.js
+++ b/utils/util.js
@@ -2,7 +2,7 @@
* 通用js
*/
-var debugHost='www.baidu.com';
+var debugHost='testhive.jyymatrix.cc';
// api地址,请求参数,回调函数,是否遮罩
function request(params) {
--
Gitblit v1.9.1