zhanghui 2 роки тому
батько
коміт
0776f65147

+ 10 - 1
common/js/api.js

@@ -122,7 +122,7 @@ export default {
         })
     },
 
-    // get请求 通过会员编号获取老系统充值记录
+    // get请求 查询门店的服务项目
     category(data) {
         return request({
             url: '/business/wechat/sp/category/' + data.storeId,
@@ -681,6 +681,15 @@ export default {
         })
     },
 
+    // get请求 根据门店、排班日期查询可用时段
+    getServicePersonTime(data) {
+        return request({
+            url: '/business/wechat/scheduling/person/time',
+            method: 'GET',
+            data: data
+        })
+    },
+
     // get请求 查询可领取的优惠劵列表
     getUserDiscountsList(data) {
         return request({

+ 318 - 0
components/pay/pay.vue

@@ -0,0 +1,318 @@
+<template>
+	<!--支付组件-->
+	<view>
+		<uni-popup ref="popup" type="bottom" :catchtouchmove="true">
+			<view class=" payView">
+				<view class="flex-row justify-between">
+					<text class="payType">请选择支付方式</text>
+					<image class="x" src="/static/common/ox.png" @click="closePayPopup"></image>
+				</view>
+				<view class="payTitle">
+					<text>选择微信支付或余额支付</text>
+				</view>
+
+				<view class=" payItemView">
+					<view v-if="blPay" class="payItem  flex-row justify-between" @click="payItem(1)">
+						<view class="flex-row">
+							<u-icon name="/static/me/u701.png" color="#38db38" size="36"></u-icon>
+							<view class="payName flex-col justify-center">
+								<text>余额支付</text>
+								<text class="balance">可以余额¥{{ userInfo.balance || 0 }}</text>
+							</view>
+						</view>
+						<view class="flex-col justify-center">
+							<u-icon v-if="curServiceTab === 1" name="checkmark-circle-fill" color="#38db38"
+									size="25"></u-icon>
+							<u-icon v-else name="/static/order/ud9.png" color="green" size="25"></u-icon>
+						</view>
+					</view>
+
+					<view v-if="wxPay" class="payItem  flex-row justify-between" @click="payItem(2)">
+						<view class="flex-row">
+							<u-icon name="weixin-circle-fill" color="#38db38" size="36"></u-icon>
+							<view class="payName flex-col justify-center">
+								<text class="payName">微信支付</text>
+							</view>
+						</view>
+						<view class="flex-col justify-center">
+							<u-icon v-if="curServiceTab === 2" name="checkmark-circle-fill" color="#38db38"
+									size="25"></u-icon>
+							<u-icon v-else name="/static/order/ud9.png" color="green" size="25"></u-icon>
+						</view>
+					</view>
+				</view>
+
+
+
+				<view class="commitBtn" @click="payment">
+					<text>确定</text>
+				</view>
+			</view>
+		</uni-popup>
+
+		<uni-popup ref="passwordPopup">
+			<view class="passwordView flex-col">
+				<view class="h-pay-title flex-row justify-center">
+					<text>请输入交易密码</text>
+				</view>
+				<view class="h-tab-bar flex-row justify-center">
+					<u-code-input v-model="password" mode="box" dot></u-code-input>
+				</view>
+				<view class="flex-row justify-center">
+					<view class="h-operate-btn flex-row justify-center" @click="balancePay">
+						<text>确定</text>
+					</view>
+				</view>
+			</view>
+		</uni-popup>
+
+	</view>
+</template>
+
+<script>
+	export default {
+		name: "myPay",
+		props: {
+			needPassword: {
+				type: Boolean,
+				default () {
+					return false
+				}
+			},
+			wxPay: {
+				type: Boolean,
+				default () {
+					return true
+				}
+			},
+			blPay: {
+				type: Boolean,
+				default () {
+					return true
+				}
+			}
+		},
+		data() {
+			return {
+				curServiceTab: 2,
+				userInfo: {},
+				password: ''
+			};
+		},
+		methods: {
+			closePayPopup() {
+				this.$refs.popup.close()
+			},
+			openPopup() {
+				this.userInfo = uni.getStorageSync('userInfo')
+				this.$refs.popup.open()
+			},
+			payItem(num) {
+				if (this.userInfo.balance * 1 < this.price * 1) {
+					return
+				}
+				this.curServiceTab = num
+			},
+
+			payment() {
+				this.$refs.popup.close()
+				if (this.curServiceTab === 1) {
+					if (this.needPassword) {
+						this.$refs.passwordPopup.open()
+					} else {
+						this.balancePay()
+					}
+				} else {
+
+					this.wechatPay()
+
+				}
+
+
+			},
+
+			//微信支付
+			wechatPay() {
+				// 发起微信支付
+				this.$api.wechatPay({
+					orderNo: this.subOrderNo
+				}).then((res) => {
+					var param = res.data.data;
+					uni.requestPayment({
+						appId: param.appid,
+						timeStamp: param.timestamp + "",
+						nonceStr: param.noncestr,
+						package: "prepay_id=" + param.prepayid,
+						signType: "RSA",
+						paySign: param.sign,
+						success: res => {
+							uni.showToast({
+								title: '支付成功!'
+							});
+							setTimeout(res => {
+								uni.switchTab({
+									url: '/pages/order/index'
+								})
+							}, 1000)
+						},
+						fail: res => {
+							console.log(res)
+							uni.showModal({
+								content: '支付失败',
+								showCancel: false
+							});
+
+							setTimeout(res => {
+								uni.switchTab({
+									url: '/pages/order/index'
+								})
+							}, 1000)
+
+						}
+					});
+				}).catch(() => {
+					uni.showToast({
+						title: "操作失败"
+					})
+				});
+			},
+			//余额支付
+			balancePay() {
+				if (this.password.length < 6 && this.needPassword) {
+					uni.showToast({
+						title: "交易密码不能小于6位"
+					})
+					return;
+				}
+				this.$refs.passwordPopup.close()
+
+				this.$api.balancePay({
+					orderNo: this.subOrderNo,
+					password: this.password
+				}).then((res) => {
+					uni.showToast({
+						title: '支付成功!'
+					});
+
+					setTimeout(res => {
+						uni.switchTab({
+							url: '/pages/order/index'
+						})
+					}, 1000)
+
+
+					this.getUserInfo()
+				}).catch((res) => {
+					console.log(res)
+					let msg = res.data.msg || '操作失败';
+					uni.showToast({
+						title: msg,
+						icon: 'error'
+					})
+				});
+
+			},
+
+			getUserInfo() {
+				this.$api.getUserInfo().then(res => {
+					console.log('++++++++++++获取用户信息++++++++++++++++++', res)
+					uni.setStorageSync('userInfo', res.data.data)
+					this.userInfo = res.data.data
+				})
+
+			},
+
+		}
+	}
+</script>
+
+<style lang="scss" scoped>
+	.payView {
+		height: 638rpx;
+		background: #FFFFFF;
+		box-shadow: 0rpx -4rpx 8rpx 0rpx rgba(0, 0, 0, 0.03);
+		border-radius: 24rpx 24rpx 0rpx 0rpx;
+		padding: 24rpx 32rpx;
+	}
+
+	.payType {
+		font-size: 32rpx;
+		font-weight: bord;
+		color: #111111;
+		line-height: 48rpx;
+	}
+
+	.x {
+		width: 35rpx;
+		height: 35rpx;
+		border-radius: 18rpx;
+	}
+
+	.payTitle {
+		font-size: 24rpx;
+		font-family: PingFangSC-Regular, PingFang SC;
+		font-weight: 400;
+		color: #666666;
+		line-height: 40rpx;
+		margin-top: 8rpx;
+	}
+	.payItemView{
+		height: 345rpx;
+	}
+
+	.payItem {
+		background: #FAFAFA;
+		border-radius: 20rpx;
+		padding: 34rpx 32rpx;
+		margin-top: 32rpx;
+	}
+
+	.payName {
+		margin-left: 24rpx;
+	}
+
+	.balance {
+		font-size: 24rpx;
+		font-family: PingFangSC-Regular, PingFang SC;
+		font-weight: 400;
+		color: #999999;
+		line-height: 40rpx;
+	}
+
+	.commitBtn {
+		width: 686rpx;
+		height: 108rpx;
+		background: #FFE05C;
+		border-radius: 60rpx;
+		margin-top: 32rpx;
+
+		font-size: 32rpx;
+		font-family: PingFangSC-Medium, PingFang SC;
+		font-weight: bold;
+		color: #111111;
+		line-height: 108rpx;
+		text-align: center;
+	}
+
+	.passwordView {
+		background: #FFFFFF;
+		width: 686rpx;
+		height: 400rpx;
+		border-radius: 20rpx;
+		padding: 34rpx 0;
+	}
+
+	.h-tab-bar {
+		margin-top: 80rpx;
+	}
+
+	.h-operate-btn {
+		width: 550rpx;
+		height: 80rpx;
+		border-radius: 40rpx;
+		background: #FFE05C;
+		line-height: 80rpx;
+		text-align: center;
+		margin-top: 80rpx;
+	}
+</style>

+ 2 - 2
components/scroll-notice/ScrollNotice.vue

@@ -82,8 +82,8 @@
 	width: 8%;
 }
 .notice-icon image{
-	height: 16px;
-	width: 16px;
+	height: 32rpx;
+	width: 32rpx;
 }
 .notice-swiper-wrap{
 	width: 90%;

+ 2 - 4
main.js

@@ -3,16 +3,14 @@ import App from './App'
 import Vue from 'vue'
 import './uni.promisify.adaptor'
 import api from './common/js/api'
+import env from './common/js/env'
 // 通用方法
 // import commonUtils from "./common/js/commonUtils.js"
 
 console.log(`process`, process.envenv)
 
 import uView from "uview-ui";
-// const baseUrl = 'https://jje.admin.xinyuekj.com.cn';
-const baseUrl = 'https://jje.admin.xinyuekj.com.cn/test-api/';
-// const baseUrl = 'http://192.168.1.150:8080';
-// const baseUrl = 'http://192.168.1.2:8080';
+const baseUrl = env.baseUrl;
 Vue.use(uView);
 Vue.config.productionTip = false
 Vue.prototype.$baseUrl = baseUrl;

+ 291 - 0
orderPages/bookService/components/chooseServiceTeacher.vue

@@ -0,0 +1,291 @@
+<template>
+	<view>
+		<uni-popup ref="chooseServiceTeacherPopup" :catchtouchmove="true" type="bottom">
+			<view class="chooseServiceTeacherView">
+				<view class="chooseServiceTeacherTitle">
+					<text>选择服务人员</text>
+				</view>
+
+				<scroll-view class="scrollY" scroll-y>
+					<view class="serviceTeacherView" v-for="(item,index) in workPersonList"  @click="selectworkPerson(index)">
+						<view v-if="item.personId === -1" class="serviceTeacher  flex-col justify-center" :class="{selectBack: index == selectIndex}">
+							<view class="flex-row">
+								<text class="teacherName">{{item.personName}} </text>
+								<u-icon name="rmb-circle" color="#666666"></u-icon>
+								<text class="teacherMsg">预约费用:{{item.fee}}</text>
+							</view>
+
+						</view>
+
+						<view v-else class="serviceTeacher1 flex-row" :class="{selectBack: index == selectIndex}">
+							<image class="teacherImg" src="/static/order/nvren.png"></image>
+							<view class="flex-col justify-around teacherR ">
+								<view class="flex-row">
+									<text class="teacherName1">{{item.personName}}</text>
+									<text class="teacherTag">造型总监</text>
+								</view>
+								<view>
+									<text class="teacherMsg1">优质服务,从我做起</text>
+								</view>
+								<view class="flex-row ">
+									<view :style="{'marginTop':'7rpx'}">
+										<u-icon name="rmb-circle" color="#666666"></u-icon>
+									</view>
+									<text class="teacherMsg">预约费用:</text>
+									<text class="teacherMsg" :style="{'color':'#ED569F'}">{{item.fee}}</text>
+								</view>
+							</view>
+						</view>
+						<view class="serobV" v-if="index == selectIndex">
+							<image class="serobVicon" src="/static/order/ud20.png"></image>
+						</view>
+					</view>
+
+
+
+				</scroll-view>
+
+				<view class="flex-row justify-between chooseServiceTeacherButton">
+					<view class="chooseServiceTeacherButtonL" @click="closePopup">
+						<text>取消</text>
+					</view>
+					<view class="chooseServiceTeacherButtonR" @click="submit">
+						<text>确定</text>
+					</view>
+				</view>
+			</view>
+
+		</uni-popup>
+
+	</view>
+</template>
+
+<script>
+	export default {
+		name: 'chooseServiceTeacher',
+		props: {
+			storeId: {
+				type: String,
+				default () {
+					return ''
+				}
+			},
+			date: {
+				type: String,
+				default () {
+					return ''
+				}
+			}
+		},
+		data() {
+			return {
+				selectIndex:0,
+				workPersonList: []
+			}
+		},
+		methods: {
+
+			submit(){
+				this.$emit("getWorkPerson",this.workPersonList[this.selectIndex])
+				this.closePopup()
+			},
+
+			closePopup() {
+				this.$refs.chooseServiceTeacherPopup.close()
+			},
+
+			selectworkPerson(e){
+				this.selectIndex = e
+			},
+
+			openPopup() {
+				this.$refs.chooseServiceTeacherPopup.open()
+				this.getServicePerson()
+
+			},
+
+
+
+			// 查询服务工作人员列表
+			getServicePerson() {
+				this.$api.getServicePerson({
+					date: this.date,
+					storeId: this.storeId,
+				}).then((res) => {
+					console.log(res)
+					this.workPersonList = res.data.data;
+					this.getImgUrlByOssId(res.data.data)
+				})
+			},
+			// 获取图片
+			getImgUrlByOssId(data) {
+				for (let i = 0; i < data.length; i++) {
+					if (data[i].facePhoto) {
+						this.$api.getImage(data[i].facePhoto).then(res => {
+							data[i].imgUrl = res.data.data[0].url.replace(/^http:/, "https:")
+							this.$set(this.workPersonList, i, data[i])
+						});
+					}
+				}
+			},
+
+
+
+		}
+	}
+</script>
+
+<style scoped lang="scss">
+	.chooseServiceTeacherView {
+		width: 750rpx;
+		height: 850rpx;
+		background: #FFFFFF;
+		border-radius: 24rpx 24rpx 0rpx 0rpx;
+	}
+
+	.chooseServiceTeacherTitle {
+		font-size: 32rpx;
+		font-weight: bold;
+		color: #333333;
+		line-height: 44rpx;
+		margin-left: 34rpx;
+		padding-top: 26rpx;
+	}
+
+	.scrollY {
+		width: 686rpx;
+		height: 604rpx;
+		margin-left: 32rpx;
+		margin-top: 32rpx;
+	}
+
+
+	.serviceTeacherView {
+		position: relative;
+	}
+
+	.serviceTeacher {
+		width: 678rpx;
+		height: 92rpx;
+		background: #FAFAFA;
+		border-radius: 8rpx;
+		border: 4rpx solid #FAFAFA;
+		position: relative;
+	}
+
+	.teacherName {
+		padding-right: 26rpx;
+		font-size: 32rpx;
+		font-weight: bold;
+		color: #111111;
+		margin-left: 24rpx;
+	}
+
+	.teacherName1 {
+		font-size: 32rpx;
+		font-weight: bold;
+		color: #111111;
+	}
+
+	.teacherTag {
+		padding: 6rpx 24rpx;
+		background: #FFF6CE;
+		border-radius: 8rpx;
+		border: 2rpx solid #FFE05C;
+		font-size: 20rpx;
+		font-weight: 400;
+		color: #333333;
+		line-height: 32rpx;
+		margin-left: 16rpx;
+	}
+
+	.teacherMsg {
+		font-size: 24rpx;
+		font-family: PingFangSC, PingFang SC;
+		font-weight: 400;
+		color: #999999;
+		margin-left: 8rpx;
+		margin-top: 5rpx;
+	}
+
+	.teacherR {
+		width: 400rpx;
+		height: 180rpx;
+		margin-top: 24rpx;
+		margin-left: 24rpx;
+	}
+
+	.teacherMsg1 {
+		font-size: 24rpx;
+		font-family: PingFangSC, PingFang SC;
+		font-weight: 400;
+		color: #999999;
+		line-height: 40rpx;
+	}
+
+	.teacherImg {
+		width: 180rpx;
+		height: 180rpx;
+		border-radius: 8rpx;
+		margin-top: 22rpx;
+		margin-left: 22rpx;
+	}
+
+	.serviceTeacher1 {
+		width: 678rpx;
+		height: 222rpx;
+		background: #FAFAFA;
+		border-radius: 16rpx;
+		border: 4rpx solid #FAFAFA;
+		margin-top: 24rpx;
+	}
+
+	.chooseServiceTeacherButton {
+		width: 686rpx;
+		height: 80rpx;
+		margin-left: 32rpx;
+		margin-top: 32rpx;
+	}
+
+	.chooseServiceTeacherButtonL {
+		width: 332rpx;
+		height: 80rpx;
+		background: #F5F5F5;
+		border-radius: 54rpx;
+		text-align: center;
+		line-height: 80rpx;
+		font-size: 28rpx;
+		font-weight: 400;
+		color: #666666;
+	}
+
+	.chooseServiceTeacherButtonR {
+		width: 332rpx;
+		height: 80rpx;
+		background: #FFE05C;
+		border-radius: 54rpx;
+		text-align: center;
+		line-height: 80rpx;
+		font-size: 28rpx;
+		font-weight: 400;
+		color: #333333;
+	}
+
+	.serobV {
+		width: 32rpx;
+		height: 32rpx;
+		position: absolute;
+		top: 0;
+		right: 0;
+	}
+
+	.serobVicon {
+		width: 32rpx;
+		height: 32rpx;
+	}
+
+	.selectBack {
+		background: rgba(255, 224, 92, 0.1);
+		border: 4rpx solid #FFE05C;
+	}
+</style>

+ 194 - 0
orderPages/bookService/components/chooseServiceTime.vue

@@ -0,0 +1,194 @@
+<template>
+	<view>
+		<uni-popup ref="chooseServiceTimePopup" :catchtouchmove="true" type="bottom">
+
+			<view class="chooseServiceTimeView">
+				<view class="chooseServiceTimeTitle">
+					<text>选择服务时段</text>
+				</view>
+
+				<scroll-view class="scrollY" scroll-y>
+
+					<u-grid :border="false" col="5">
+						<u-grid-item v-for="(item,index) in periodDateList" :key="index" @click="selectPeriod(index)">
+							<view class="flex-col justify-center timeItem" :class="{selectBack: index == selectIndex}">
+								<view class="flex-row justify-center">
+									<text class="time">{{item.label}}</text>
+								</view>
+								<view class="flex-row justify-center">
+									<text class="price">¥{{item.price}}</text>
+								</view>
+							</view>
+						</u-grid-item>
+					</u-grid>
+
+				</scroll-view>
+
+				<view class="flex-row justify-between chooseServiceTeacherButton">
+					<view class="chooseServiceTeacherButtonL" @click="closePopup">
+						<text>取消</text>
+					</view>
+					<view class="chooseServiceTeacherButtonR" @click="submit">
+						<text>确定</text>
+					</view>
+				</view>
+			</view>
+		</uni-popup>
+	</view>
+</template>
+
+<script>
+	export default {
+		name: 'chooseServiceTime',
+		props: {
+			personId: {
+				type: String,
+				default () {
+					return ''
+				}
+			},
+			date: {
+				type: String,
+				default () {
+					return ''
+				}
+			}
+		},
+		data() {
+			return {
+				selectIndex:0,
+				periodDateList: []
+			}
+		},
+		methods: {
+			submit(){
+				this.$emit("getPeriodDate",this.periodDateList[this.selectIndex])
+				this.closePopup()
+			},
+
+
+			closePopup() {
+				this.$refs.chooseServiceTimePopup.close()
+			},
+
+			selectPeriod(e){
+				this.selectIndex = e
+			},
+
+			openPopup() {
+				this.$refs.chooseServiceTimePopup.open()
+				this.getServiceTime()
+			},
+
+			//获取门店排班时段
+			getServiceTime(storeId, date) {
+				this.$api.getServicePersonTime({
+					personId: this.personId,
+					date: this.date
+				}).then(res => {
+					this.periodDateList = res.data.data
+					// if (this.periodTimeList.length === 0) {
+					// 	uni.$u.toast('暂无排班时段')
+					// }
+				})
+			},
+
+
+		}
+	}
+</script>
+
+<style scoped lang="scss">
+	.chooseServiceTimeView {
+		width: 750rpx;
+		height: 850rpx;
+		background: #FFFFFF;
+		border-radius: 24rpx 24rpx 0rpx 0rpx;
+	}
+
+	.chooseServiceTimeTitle {
+		font-size: 32rpx;
+		font-weight: bold;
+		color: #333333;
+		line-height: 44rpx;
+		margin-left: 34rpx;
+		padding-top: 26rpx;
+	}
+
+	.scrollY {
+		width: 730rpx;
+		height: 604rpx;
+		margin-top: 8rpx;
+		margin-left: 10rpx;
+	}
+
+	.timeItem {
+		width: 124rpx;
+		height: 124rpx;
+		background: #FAFAFA;
+		border-radius: 16rpx;
+		margin-top: 16rpx;
+	}
+
+
+	.time {
+		font-size: 24rpx;
+		color: #333333;
+		line-height: 40rpx;
+	}
+
+	.price {
+		font-size: 24rpx;
+		color: #ED569F;
+		line-height: 40rpx;
+	}
+
+	.chooseServiceTeacherButton {
+		width: 686rpx;
+		height: 80rpx;
+		margin-left: 32rpx;
+		margin-top: 32rpx;
+	}
+
+	.chooseServiceTeacherButtonL {
+		width: 332rpx;
+		height: 80rpx;
+		background: #F5F5F5;
+		border-radius: 54rpx;
+		text-align: center;
+		line-height: 80rpx;
+		font-size: 28rpx;
+		font-weight: 400;
+		color: #666666;
+	}
+
+	.chooseServiceTeacherButtonR {
+		width: 332rpx;
+		height: 80rpx;
+		background: #FFE05C;
+		border-radius: 54rpx;
+		text-align: center;
+		line-height: 80rpx;
+		font-size: 28rpx;
+		font-weight: 400;
+		color: #333333;
+	}
+
+	.serobV {
+		width: 32rpx;
+		height: 32rpx;
+		position: absolute;
+		top: 0;
+		right: 0;
+	}
+
+	.serobVicon {
+		width: 32rpx;
+		height: 32rpx;
+	}
+
+	.selectBack {
+		background: rgba(255, 224, 92, 0.1);
+		border: 4rpx solid #FFE05C;
+	}
+</style>

+ 101 - 84
orderPages/bookService/index.rpx.scss

@@ -3,9 +3,76 @@
 }
 .group{
   background: #FFFFFF;
-  padding: 32rpx 32rpx;
+  padding: 24rpx 32rpx;
+}
+.serob{
+  font-size: 32rpx;
+  font-weight: bold;
+  color: #333333;
+}
+.serobItems{
+  margin-top: 32rpx;
+  height: 206rpx;
+}
+.scrollX{
+  height: 206rpx;
+  white-space: nowrap;
+  min-width: 150rpx;
+  max-width: 506rpx;
+
+}
+.serobItem{
+  width: 150rpx;
+  height: 206rpx;
+  text-align: center;
+  margin-left: 28rpx;
+  position: relative;
+
+}
+.serobItem:first-child {
+  margin-left: 0rpx;
+}
+.serobImgView{
+  width: 146rpx;
+  height: 146rpx;
+  overflow: hidden;
+ }
+.serobImg{
+  width: 146rpx;
+  height: 146rpx;
+  border-radius: 75rpx;
+
+}
+.addSerobImg{
+  width: 146rpx;
+  height: 146rpx;
+  border-radius: 75rpx;
+  margin-left: 28rpx;
+  border: 2rpx dashed #DDDDDD;
+  font-size: 120rpx;
+  text-align: center;
+  line-height: 130rpx;
 }
 
+.serobName{
+  height: 40rpx;
+  font-size: 24rpx;
+  font-weight: 400;
+  color: #666666;
+  line-height: 40rpx;
+  margin-top: 16rpx;
+}
+.serobV{
+  width: 32rpx;
+  height: 32rpx;
+  position: absolute;
+  top: 0;
+  right: 0;
+}
+.serobVicon{
+  width: 32rpx;
+  height: 32rpx;
+}
 .group2{
   background: #FFFFFF;
   padding: 0 32rpx;
@@ -15,25 +82,34 @@
   z-index: 5;
 }
 
-.groupItem1{
-  height: 220rpx;
-  border-bottom: 1px solid #EEEEEE;
-}
+
 
 .groupItem{
-  height: 154rpx;
+  height: 92rpx;
   border-bottom: 1px solid #EEEEEE;
 }
 .groupItemKey{
   font-size: 28rpx;
+  width: 200rpx;
   font-weight: bold;
   color: #333333;
+  line-height: 92rpx;
 }
 .groupItemContent{
   font-size: 28rpx;
+  line-height: 92rpx;
   font-weight: 400;
+  width: 486rpx;
   color: #999999;
 }
+.hintView{
+  width: 686rpx;
+  height: 104rpx;
+  background: #FFF7EA;
+  border-radius: 16rpx;
+  border: 2rpx solid #FFFFFF;
+  margin: 24rpx 32rpx;
+}
 .hint{
   width: 24rpx;
   height: 24rpx;
@@ -42,14 +118,29 @@
   background:   #FFAF36;
   color: #FFFFFF;
   font-size: 18rpx;
-  margin-top: 3rpx;
+  margin-left: 10rpx;
 }
 .hintCentent{
   font-size: 24rpx;
   font-weight: 400;
   color: #FFAF36;
-  line-height: 28rpx;
-  margin-left: 10rpx;
+  line-height: 40rpx;
+  margin-left: 16rpx;
+  margin-top: 12rpx;
+}
+
+.selectSerobImg{
+  width: 80rpx;
+  height: 80rpx;
+  border-radius: 40rpx;
+  margin-bottom: 40rpx;
+}
+.selectSerobName{
+  font-size: 24rpx;
+  font-weight: 400;
+  color: #666666;
+  line-height: 80rpx;
+  margin-left: 16rpx;
 }
 .textareaView{
   height: 280rpx;
@@ -109,83 +200,9 @@
 .marginTop{
   margin-top: 24rpx;
 }
-.payView{
-  height: 638rpx;
-  background: #FFFFFF;
-  box-shadow: 0rpx -4rpx 8rpx 0rpx rgba(0,0,0,0.03);
-  border-radius: 24rpx 24rpx 0rpx 0rpx;
-  padding: 24rpx 32rpx;
-}
-.payType{
-  font-size: 32rpx;
-  font-family: PingFangSC-Medium, PingFang SC;
-  font-weight: bord;
-  color: #111111;
-  line-height: 48rpx;
-}
-.x{
-  width: 35rpx;
-  height: 35rpx;
-  border-radius: 18rpx;
-}
-.payTitle{
-  font-size: 24rpx;
-  font-family: PingFangSC-Regular, PingFang SC;
-  font-weight: 400;
-  color: #666666;
-  line-height: 40rpx;
-  margin-top: 8rpx;
-}
-.payItem{
-  background: #FAFAFA;
-  border-radius: 20rpx;
-  padding: 34rpx 32rpx;
-  margin-top: 32rpx;
-}
-.payName{
-  margin-left: 24rpx;
-}
-.balance{
-  font-size: 24rpx;
-  font-family: PingFangSC-Regular, PingFang SC;
-  font-weight: 400;
-  color: #999999;
-  line-height: 40rpx;
-}
-.commitBtn{
-  width: 686rpx;
-  height: 108rpx;
-  background: #FFE05C;
-  border-radius: 60rpx;
-  margin-top: 32rpx;
 
-  font-size: 32rpx;
-  font-family: PingFangSC-Medium, PingFang SC;
-  font-weight: bold;
-  color: #111111;
-  line-height: 108rpx;
-  text-align: center;
-}
-.passwordView{
-    background: #FFFFFF;
-  width: 686rpx;
-  height: 400rpx;
-  border-radius: 20rpx;
-  padding: 34rpx 0;
-}
 
-.h-tab-bar{
-  margin-top: 80rpx;
-}
-.h-operate-btn{
-  width: 550rpx;
-  height: 80rpx;
-  border-radius: 40rpx;
-  background: #FFE05C;
-  line-height: 80rpx;
-  text-align: center;
-  margin-top: 80rpx;
-}
+
 .text_5{
   font-size: 24rpx;
   color: red;

+ 384 - 556
orderPages/bookService/index.vue

@@ -1,563 +1,391 @@
 <template>
-  <view class="page">
-    <view class="flex-col group">
-      <view class="flex-col justify-around groupItem1">
-        <view class="groupItemKey">
-          <text>请选择服务对象</text>
-        </view>
-        <view class="flex-row justify-between groupItemContent" @click="getServiceObject">
-          <text>{{ serviceObject.nickName || '请选择对象' }}</text>
-          <u-icon name="arrow-right" color="#666" size="18"></u-icon>
-        </view>
-        <text class="text_5">娇宝,此排队提交后只针对一个服务对象,服务对象指接受娇骄儿理发服务的儿童</text>
-      </view>
-      <view class="flex-col justify-around groupItem">
-        <view class="groupItemKey">
-          <text>请选择服务类型</text>
-        </view>
-        <picker @change="bindPickerChange" mode='selector' range-key="typeName" :value="storeServiceIndex"
-                :range="storeServiceList">
-          <view class="flex-row justify-between groupItemContent">
-            <text>{{ storeServiceList[storeServiceIndex].typeName || '请选择服务类别' }}</text>
-            <u-icon name="arrow-right" color="#666" size="18"></u-icon>
-          </view>
-        </picker>
-      </view>
-    </view>
-
-
-    <view class="flex-col group marginTop">
-
-      <view class="flex-row ">
-        <view class="hint">
-          <text>!</text>
-        </view>
-        <view class="hintCentent">
-          <text>娇宝,提前10分钟到哟,一人一号过号需要重新取号排队!等你哟</text>
-        </view>
-      </view>
-
-      <view class="flex-col justify-around groupItem">
-        <view class="groupItemKey">
-          <text>服务日期</text>
-        </view>
-        <picker @change="bindPickerChange1" mode='selector' range-key="label" :value="periodDateIndex"
-                :range="periodDateList">
-          <view class="flex-row justify-between groupItemContent">
-            <text>{{ periodDateList[periodDateIndex].label || '请选择服务日期' }}</text>
-            <u-icon name="arrow-right" color="#666" size="18"></u-icon>
-          </view>
-        </picker>
-      </view>
-
-      <view class="flex-col justify-around groupItem">
-
-        <view class="groupItemKey">
-          <text>服务时段</text>
-        </view>
-        <picker @change="bindPickerChange2" mode='selector' range-key="label" :value="periodTimeIndex"
-                :range="periodTimeList">
-          <view class="flex-row justify-between groupItemContent">
-            <text>{{ periodTimeList[periodTimeIndex].label || '服务时段' }}</text>
-            <u-icon name="arrow-right" color="#666" size="18"></u-icon>
-          </view>
-        </picker>
-      </view>
-
-      <view class="flex-col justify-around groupItem">
-        <view class="groupItemKey">
-          <text>服务人员</text>
-        </view>
-        <view class="flex-row justify-between groupItemContent" @click="chooseServiceTeacher">
-          <text>{{ serviceTeacher.personName || '请选择服务人员' }}</text>
-          <u-icon name="arrow-right" color="#666" size="18"></u-icon>
-        </view>
-      </view>
-
-
-    </view>
-    <view class="flex-col group marginTop">
-      <view class="groupItemKey">
-        <text>服务定制</text>
-      </view>
-      <view class="textareaView">
-        <textarea v-model="remark" placeholder-style="color:#999999;fontSize:28rpx" placeholder="如有其它特殊需求,请在此输入您的需求"/>
-      </view>
-    </view>
-
-    <view :style="{'height':'236rpx'}"></view>
-
-    <view class="flex-col  group2 ">
-      <view class="btnTitle flex-row">
-        <u-icon v-if="selectIcon" name="checkmark-circle-fill" color="#FFE52C" size="18" @click="selectChange"></u-icon>
-        <u-icon v-else name="/static/order/ud9.png" color="#FFE52C" size="18" @click="selectChange"></u-icon>
-        <text :style="{'margin-left':'10rpx'}">请阅读并同意</text>
-        <text :style="{'color':'red'}" @click="goTermsOfService">《预约需知》</text>
-      </view>
-<!--      <view class="btnTitle">-->
-<!--        <text>提交订单之前需支付预约服务费用</text>-->
-<!--      </view>-->
-      <view class="btn flex-row justify-between">
-        <view>
-          <text class="title">待支付</text>
-          <text class="num">¥{{ price }}</text>
-        </view>
-        <view class="btnRight" @click="commitOrder">
-          <text>提交</text>
-        </view>
-      </view>
-    </view>
-
-    <uni-popup ref="passwordPopup">
-      <view class="passwordView flex-col">
-        <view class="h-pay-title flex-row justify-center">
-          <text>请输入交易密码</text>
-        </view>
-        <view class="h-tab-bar flex-row justify-center">
-          <u-code-input v-model="password" mode="box" dot></u-code-input>
-        </view>
-        <view class="flex-row justify-center">
-          <view class="h-operate-btn flex-row justify-center" @click="balancePay">
-            <text>确定</text>
-          </view>
-        </view>
-      </view>
-    </uni-popup>
-
-    <uni-popup ref="popup" type="bottom">
-
-      <view class=" payView">
-        <view class="flex-row justify-between">
-          <text class="payType">请选择支付方式</text>
-          <image class="x" src="/static/common/ox.png" @click="closePayPopup"></image>
-        </view>
-        <view class="payTitle">
-          <text>选择微信支付或余额支付</text>
-        </view>
-
-
-        <view class="payItem flex-row justify-between" @click="payItem(1)">
-          <view class="flex-row">
-            <u-icon name="/static/me/u701.png" color="#38db38" size="36"></u-icon>
-            <view class="payName flex-col justify-center">
-              <text>余额支付</text>
-              <text class="balance">可以余额¥{{ userInfo.balance || 0 }}</text>
-            </view>
-          </view>
-
-          <view class="flex-col justify-center">
-            <view v-if="curServiceTab === 1">
-              <u-icon name="checkmark-circle-fill" color="#38db38" size="25"></u-icon>
-            </view>
-            <view v-else>
-              <u-icon name="/static/order/ud9.png" color="green" size="25"></u-icon>
-            </view>
-          </view>
-
-        </view>
-
-        <view class="payItem flex-row justify-between" @click="payItem(2)">
-          <view class="flex-row">
-            <u-icon name="weixin-circle-fill" color="#38db38" size="36"></u-icon>
-            <view class="payName flex-col justify-center">
-              <text>微信支付</text>
-            </view>
-          </view>
-          <view class="flex-col justify-center">
-            <view v-if="curServiceTab === 2">
-              <u-icon name="checkmark-circle-fill" color="#38db38" size="25"></u-icon>
-            </view>
-            <view v-else>
-              <u-icon name="/static/order/ud9.png" color="green" size="25"></u-icon>
-            </view>
-          </view>
-        </view>
-
-        <view class="commitBtn" @click="commonGeneralOrder">
-          <text>确定</text>
-        </view>
-
-      </view>
-
-    </uni-popup>
-
-  </view>
+	<view class="page">
+
+		<view class="flex-col group">
+			<view class="serob"><text>服务对象</text></view>
+			<view class="serobItems flex-row">
+				<scroll-view class="scrollX" scroll-x>
+					<view class="flex-row">
+						<view class="serobItem flex-col" v-for="(item,index) in serviceObjectList" :key="index">
+							<view class="serobImgView" @click="selectServiceObject(item)">
+								<image class="serobImg" :src="item.facePhotoUrl || '/static/logo.png'"
+									mode="aspectFill"></image>
+							</view>
+							<text class="serobName">{{item.nickName || '未填写'}}</text>
+							<view class="serobV" v-if="item.select === true">
+								<image class="serobVicon" src="/static/order/ud20.png"></image>
+							</view>
+						</view>
+					</view>
+				</scroll-view>
+				<view class="addSerobImg" @click="addServiceObject">
+					<text>+</text>
+				</view>
+			</view>
+		</view>
+
+		<view class="flex-row hintView">
+			<view class="flex-col justify-center">
+				<view class="hint">
+					<text>!</text>
+				</view>
+			</view>
+			<view class="hintCentent">
+				<text>娇宝,提前10分钟到哟,一人一号过号需要重新取号排队!等你哟</text>
+			</view>
+
+		</view>
+
+		<view class="flex-col group marginTop" v-for="(item, index) in orderParam.childService">
+			<view class="flex-row">
+				<image class="selectSerobImg" :src="item.facePhotoUrl || '/static/logo.png'"></image>
+				<text class="selectSerobName">{{item.nickName || '未填写'}}</text>
+			</view>
+
+			<view class="flex-row  groupItem ">
+				<view class="groupItemKey ">
+					<text>服务日期</text>
+				</view>
+				<view class="flex-row justify-between groupItemContent ">
+					<text>{{ item.periodDate || '请选择服务日期' }}</text>
+				</view>
+			</view>
+
+			<view class="flex-row  groupItem">
+				<view class="groupItemKey">
+					<text>服务人员</text>
+				</view>
+				<view class="flex-row justify-between groupItemContent" @click="chooseServiceTeacher(index)">
+					<text>{{ item.personName || '请选择服务人员' }}</text>
+					<u-icon name="arrow-right" color="#666" size="18"></u-icon>
+				</view>
+			</view>
+
+			<view class="flex-row  groupItem">
+				<view class="groupItemKey">
+					<text>服务时段</text>
+				</view>
+				<view class="flex-row justify-between groupItemContent" @click="chooseServiceTime(index)">
+					<text>{{ item.serviceStartTime || '服务时段' }}</text>
+					<u-icon name="arrow-right" color="#666" size="18"></u-icon>
+				</view>
+			</view>
+		</view>
+
+
+		<view class="flex-col group marginTop">
+			<view class="groupItemKey">
+				<text>服务定制</text>
+			</view>
+			<view class="textareaView">
+				<textarea v-model="orderParam.remark" placeholder-style="color:#999999;fontSize:28rpx"
+					placeholder="如有其它特殊需求,请在此输入您的需求" />
+			</view>
+		</view>
+
+		<view :style="{'height':'236rpx'}"></view>
+
+		<view class="flex-col  group2 ">
+			<view class="btnTitle flex-row">
+				<u-icon v-if="selectIcon" name="checkmark-circle-fill" color="#FFE52C" size="18"
+					@click="selectChange"></u-icon>
+				<u-icon v-else name="/static/order/ud9.png" color="#FFE52C" size="18" @click="selectChange"></u-icon>
+				<text :style="{'margin-left':'10rpx'}">请阅读并同意</text>
+				<text :style="{'color':'red'}" @click="goTermsOfService">《预约需知》</text>
+			</view>
+			<view class="btn flex-row justify-between">
+				<view>
+					<text class="title">待支付</text>
+					<text class="num">¥{{ price }}</text>
+				</view>
+				<view class="btnRight" @click="commitOrder">
+					<text>提交</text>
+				</view>
+			</view>
+		</view>
+		<chooseServiceTeacher ref="chooseServiceTeacher" :storeId="store.storeId" :date="date" @getWorkPerson="getWorkPerson"></chooseServiceTeacher>
+		<chooseServiceTime ref="chooseServiceTime" :personId="personId" :date="date" @getPeriodDate="getPeriodDate"></chooseServiceTime>
+		<myPay ref="myPay" :blPay="false"></myPay>
+	</view>
 </template>
 
 <script>
-
-export default {
-
-  data() {
-    return {
-      password: '',
-      remark: '',
-      userInfo: {},
-      curServiceTab: 1,
-      //服务门店
-      store: {},
-      //服务对象
-      serviceObject: {},
-      //服务技师
-      serviceTeacher: {},
-      //服务类型
-      storeServiceList: [],
-      storeServiceIndex: 0,
-      //服务时间
-      periodDateList: [],
-      periodDateIndex: 0,
-      //服务时段
-      periodTimeList: [],
-      periodTimeIndex: 0,
-      //预约费用
-      price: '0',
-      //订单编号
-      orderNo: '',
-      subOrderNo: '',
-      selectIcon:true
-    }
-  },
-  onLoad() {
-    // this.listServiceObject()
-    this.store = uni.getStorageSync('storeInfo')
-    this.userInfo = uni.getStorageSync('userInfo')
-    // this.storeAllServiceList()
-    this.category()
-    // this.selectDate()
-  },
-
-  onShow() {
-    // 服务对象
-    uni.$off()
-    uni.$on('selectedServiceObject', this.selectedServiceObject);
-    uni.$on('selectedServiceTeacher', this.selectedServiceTeacher);
-
-  },
-
-  methods: {
-
-    goTermsOfService(){
-      uni.navigateTo({
-          url:'/myPages/TermsOfService/index?name='+'预约需知'+'&type=' + 5
-      })
-    },
-
-    selectChange(){
-        this.selectIcon = !this.selectIcon
-    },
-
-    payItem(num) {
-      if (this.userInfo.balance*1 < this.price*1) {
-        return
-      }
-      this.curServiceTab = num
-    },
-
-    //提交订单
-    commitOrder() {
-
-      if(!this.selectIcon){
-        uni.$u.toast('请阅读并同意《预约需知》')
-        return;
-      }
-
-      if (!this.serviceObject) {
-        uni.$u.toast('请选择服务对象')
-        return
-      }
-
-      if (!this.serviceTeacher.personId) {
-        uni.$u.toast('请选择服务人员')
-        return
-      }
-      if (this.price*1 > 0) {
-        this.$refs.popup.open()
-        if (this.userInfo.balance*1 < this.price*1) {
-          this.curServiceTab = 2
-        }
-      } else {
-        this.commonGeneralOrder()
-      }
-
-    },
-
-    closePayPopup() {
-      this.$refs.popup.close()
-    },
-
-    wechatPay() {
-      let that = this;
-      // 发起微信支付
-      this.$api.wechatPay({
-        orderNo: this.subOrderNo
-      }).then((res) => {
-        var param = res.data.data;
-        uni.requestPayment({
-          appId: param.appid,
-          timeStamp: param.timestamp + "",
-          nonceStr: param.noncestr,
-          package: "prepay_id=" + param.prepayid,
-          signType: "RSA",
-          paySign: param.sign,
-          success: res => {
-            uni.showToast({
-              title: '支付成功!'
-            });
-            setTimeout(res => {
-              uni.switchTab({
-                url: '/pages/order/index'
-              })
-            }, 1000)
-          },
-          fail: res => {
-            console.log(res)
-            uni.showModal({
-              content: '支付失败',
-              showCancel: false
-            });
-
-            setTimeout(res => {
-              uni.switchTab({
-                url: '/pages/order/index'
-              })
-            }, 1000)
-
-          }
-        });
-      }).catch(() => {
-        uni.showToast({
-          title: "操作失败"
-        })
-      });
-    },
-
-    //余额支付
-    balancePay() {
-
-      let that = this;
-      // if(this.password.length< 6 ){
-      //     uni.showToast({
-      //         title: "交易密码不能小于6位"
-      //     })
-      //     return ;
-      // }
-      // this.$refs.passwordPopup.close()
-
-      this.$api.balancePay({
-        orderNo: this.subOrderNo,
-        password: ''
-      }).then((res) => {
-        that.$refs.popup.close()
-        uni.showToast({
-          title: '支付成功!'
-        });
-
-        setTimeout(res => {
-          uni.switchTab({
-            url: '/pages/order/index'
-          })
-        }, 1000)
-
-
-        this.getUserInfo()
-      }).catch((res) => {
-        console.log(res)
-        that.$refs.popup.close()
-        let msg = res.data.msg || '操作失败';
-        uni.showToast({
-          title: msg,
-          icon: 'error'
-        })
-
-        // setTimeout(res=>{
-        //     uni.switchTab({
-        //         url:'/pages/order/index'
-        //     })
-        // },1000)
-      });
-
-    },
-
-    getUserInfo() {
-      this.$api.getUserInfo().then(res => {
-        console.log('++++++++++++获取用户信息++++++++++++++++++', res)
-        uni.setStorageSync('userInfo', res.data.data)
-        this.userInfo = res.data.data
-      })
-
-    },
-
-    commonGeneralOrder() {
-      if(this.requestStatus){
-        return;
-      }
-      this.requestStatus=true
-      this.$refs.popup.close()
-      this.requestStatus=false
-      this.$api.commonGeneralOrder({
-        orderType: 1,
-        serviceObjectId: this.serviceObject.id,
-        serviceAttribute: 2,
-        serviceStoreId: this.store.storeId,
-        serviceTypeId: this.storeServiceList[this.storeServiceIndex].id,
-        serviceDate: this.periodDateList[this.periodDateIndex].label,
-        serviceUserId: this.serviceTeacher.personId,
-        serviceStartTime: this.periodTimeList[this.periodTimeIndex].label,
-        timeRangeId: this.serviceTeacher.crewPeriodId,
-        remark: this.remark
-      }).then(res => {
-        this.orderNo = res.data.data.orderNo
-        this.subOrderNo = res.data.data.subOrderNo
-        if (res.data.data.subOrderNo === null) {
-          uni.switchTab({
-            url: '/pages/order/index'
-          })
-        } else {
-          if (this.curServiceTab === 1) {
-            //开启余额支付密码框
-            // this.$refs.passwordPopup.open()
-
-            this.balancePay()
-
-          }
-          if (this.curServiceTab === 2) {
-            //调微信支付
-            this.wechatPay()
-          }
-        }
-
-      })
-    },
-
-
-    //获取预约费用
-    getAppointmentPrice() {
-      this.$api.getAppointmentPrice({
-        storeId: this.store.storeId,
-        date: this.periodDateList[this.periodDateIndex].label,
-        timeRangeId: this.serviceTeacher.crewPeriodId,
-        servicePersonId: this.serviceTeacher.personId,
-        serviceProjectId: this.storeServiceList[this.storeServiceIndex].id
-      }).then(res => {
-        this.price = res.data.data.price
-      })
-    },
-
-    //选择服务人员
-    chooseServiceTeacher() {
-
-      if (this.periodDateList.length <= 0 || this.periodTimeList.length <= 0) {
-        uni.$u.toast('请选择服务时间')
-      }
-      console.log("a->", this.periodTimeIndex)
-      console.log("b->", this.periodTimeList)
-      uni.navigateTo({
-        url: '/orderPages/serviceTeacher/index?organization=' + this.store.storeId
-                + '&schedulingDate=' + this.periodDateList[this.periodDateIndex].label
-                + '&time=' + this.periodTimeList[this.periodTimeIndex].value
-                + '&serviceTypeId=' + this.storeServiceList[this.storeServiceIndex].id
-      })
-    },
-
-    //获取排班日期
-    selectDate() {
-      console.log(this.store)
-      this.$api.selectDate({
-        organization: this.store.storeId
-      }).then(res => {
-        this.periodDateList = res.data.data
-        // this.selectPeriodByDate(res.data.data[0].label)
-        this.getServiceTime(res.data.data[0].label);
-      })
-    },
-
-    //获取门店排班时段
-    // selectPeriodByDate(date){
-    //     this.$api.selectPeriodByDate({
-    //         organization:this.store.storeId,
-    //         schedulingDate:date
-    //     }).then(res =>{
-    //         this.periodTimeList = res.data.data
-    //         if (this.periodTimeList.length===0){
-    //             uni.$u.toast('暂无排班时段')
-    //         }
-    //     })
-    // },
-
-    //获取门店排班时段
-    getServiceTime(date) {
-      this.$api.getServiceTime({
-        storeId: this.store.storeId,
-        date: date,
-        serviceTypeId:this.storeServiceList[this.storeServiceIndex].id
-      }).then(res => {
-        this.periodTimeList = res.data.data
-        if (this.periodTimeList.length === 0) {
-          uni.$u.toast('暂无排班时段')
-        }
-      })
-    },
-
-    // 查询服务对像信息列表
-    listServiceObject() {
-      this.$api.listServiceObject({}).then((res) => {
-        this.serviceObject = res.data.data[0]
-      }).catch((err) => {
-        uni.showToast({
-          title: "操作失败"
-        })
-      });
-    },
-
-    getServiceObject() {
-      uni.navigateTo({
-        url: '/orderPages/serviceObject/index'
-      })
-    },
-    selectedServiceObject(e) {
-      this.serviceObject = e
-    },
-
-    selectedServiceTeacher(e) {
-      this.serviceTeacher = e
-      this.getAppointmentPrice()
-    },
-
-    //服务类别发生改变
-    bindPickerChange(e) {
-      this.serviceTeacher = {}
-      this.storeServiceIndex = e.detail.value
-      console.log(e)
-      this.selectDate()
-    },
-    //服务日期发生改变
-    bindPickerChange1(e) {
-      this.periodDateIndex = e.detail.value
-      this.getServiceTime(this.periodDateList[e.detail.value].label)
-      this.serviceTeacher = {};
-      console.log(e)
-    },
-
-    //服务时段发生改变
-    bindPickerChange2(e) {
-      this.periodTimeIndex = e.detail.value
-      this.serviceTeacher = {}
-      console.log(e)
-    },
-
-    category() {
-      this.$api.category({storeId: this.store.storeId}).then(res => {
-        this.storeServiceList = res.data.data
-        this.selectDate()
-      })
-
-    },
-
-  }
-}
+	import chooseServiceTeacher from './components/chooseServiceTeacher';
+	import chooseServiceTime from './components/chooseServiceTime';
+	import myPay from '../../components/pay/pay';
+	export default {
+		components: {
+			chooseServiceTeacher,
+			chooseServiceTime,
+			myPay
+		},
+		data() {
+			return {
+				requestStatus:false,
+				personId:'',
+				date:'',
+				serviceObjectList: [],
+				userInfo: {},
+				//服务门店
+				store: {},
+				//默认服务技师
+				serviceTeacher: {},
+				//默认服务时间
+				periodDate: [],
+				//默认服务时段
+				periodTime: [],
+				//预约费用
+				price: '0',
+				//订单编号
+				orderNo: '',
+				subOrderNo: '',
+				selectIcon: true,
+				orderParam:{
+					orderType: 1,
+					serviceAttribute: 2,
+					serviceStoreId: '',
+					remark: '',
+					childService:[
+							{
+								periodDate:'',//回显需要,不做参数
+						serviceObjectId: '',
+						facePhotoUrl:'', //回显需要,不做参数
+						nickName:'', //回显需要,不做参数
+						serviceUserId: '',
+						personName:'',//回显需要,不做参数
+					    fee:'',//回显需要,不做参数
+						serviceStartTime: '',
+						timeRangeId: ''
+					}
+					]
+				}
+			}
+		},
+		onLoad() {
+			this.store = uni.getStorageSync('storeInfo')
+			this.userInfo = uni.getStorageSync('userInfo')
+			this.orderParam.serviceStoreId = this.store.storeId
+			this.selectDate()
+		},
+		onShow() {
+			// 服务对象
+			this.listServiceObject()
+		},
+		mounted(){
+
+
+
+
+		},
+		methods: {
+			//获取排班日期
+			selectDate() {
+				console.log(this.store)
+				this.$api.selectDate({
+					organization: this.store.storeId
+				}).then(res => {
+					this.periodDate = res.data.data[0]
+					this.date=this.periodDate.label
+
+					if (this.orderParam.childService.length === 1) {
+						this.orderParam.childService[0].periodDate = this.periodDate.label
+					}
+
+					if (res.data.data[0]){
+						this.getServicePerson(res.data.data[0].label);
+					}
+				})
+			},
+
+			// 查询服务工作人员列表
+			getServicePerson(date) {
+				this.$api.getServicePerson({
+					storeld:this.store.storeId,
+					date:date
+				}).then((res) => {
+					this.serviceTeacher = res.data.data[0];
+					this.personId =this.serviceTeacher.id
+
+					if (this.orderParam.childService.length === 1) {
+						this.orderParam.childService[0].serviceUserId = res.data.data[0].personId
+						this.orderParam.childService[0].personName = res.data.data[0].personName
+						this.orderParam.childService[0].fee = res.data.data[0].fee
+						this.price =  res.data.data[0].fee * 1
+					}
+					if (res.data.data[0]){
+						this.getServiceTime(date,res.data.data[0].personId)
+					}
+				})
+			},
+
+			//获取门店排班时段
+			getServiceTime(date,personId) {
+				this.$api.getServicePersonTime({
+					personId: personId === -1 ? '' : personId,
+					date: date,
+				}).then(res => {
+					this.periodTime = res.data.data[0]
+					if (this.orderParam.childService.length === 1) {
+						this.orderParam.childService[0].serviceStartTime = res.data.data[0].label
+						this.orderParam.childService[0].timeRangeId = res.data.data[0].id
+					}
+				})
+			},
+
+			selectServiceObject(item) {
+				console.log(item)
+				if (item.select) {
+					this.orderParam.childService = this.orderParam.childService.filter(selectServiceObject =>
+						selectServiceObject.serviceObjectId !== item.id)
+				} else {
+					let childService ={
+						periodDate: this.periodDate.label,
+						serviceObjectId: item.id,
+						facePhotoUrl:item.facePhotoUrl, //回显需要,不做参数
+						nickName:item.nickName, //回显需要,不做参数
+						serviceUserId: this.serviceTeacher.personId ,
+						personName:this.serviceTeacher.personName ,//回显需要,不做参数
+						fee:this.serviceTeacher.fee ,//回显需要,不做参数
+						serviceStartTime: this.periodTime.label ,
+						timeRangeId: this.periodTime.id
+					}
+					this.orderParam.childService.push(childService)
+					for (let childService of this.orderParam.childService) {
+						this.price = 0
+						this.price =  this.price * 1 + childService.fee * 1
+					}
+				}
+				item.select = !item.select
+			},
+
+			// 查询服务对接信息列表
+			listServiceObject() {
+				this.$api.listServiceObject(this.reqParm).then((res) => {
+					console.log(res)
+					this.serviceObjectList = res.data.data
+					this.getImgUrlByBannerOssId(this.serviceObjectList);
+
+					if (this.orderParam.childService.length === 1) {
+						let selectServiceObject = this.serviceObjectList[0]
+						this.orderParam.childService[0].serviceObjectId = selectServiceObject.id,
+						this.orderParam.childService[0].nickName = selectServiceObject.nickName,
+						this.serviceObjectList[0].select = true
+					} else {
+						for (let selectServiceObject of this.orderParam.childService) {
+							for (let serviceObject of this.serviceObjectList) {
+								if (selectServiceObject.id === serviceObject.id) {
+									serviceObject.select = true
+								}
+							}
+						}
+					}
+
+
+				})
+			},
+			// 获取图片
+			getImgUrlByBannerOssId(items) {
+				for (let i = 0; i < items.length; i++) {
+					if (items[i].facePhoto) {
+						this.$api.getImgUrlByOssId({
+							ossId: items[i].facePhoto
+						}).then(res => {
+							items[i].facePhotoUrl = res.data.data[0].url.replace(/^http:/, "https:")
+							this.$set(this.serviceObjectList, i, items[i])
+							if (i === 0){
+								this.orderParam.childService[0].facePhotoUrl =res.data.data[0].url.replace(/^http:/, "https:")
+							}
+						})
+					}
+				}
+			},
+
+
+			addServiceObject() {
+				uni.navigateTo({
+					url: '/myPages/ServiceObjectManagement/index'
+				})
+			},
+
+
+			//选择服务人员
+			chooseServiceTeacher(index) {
+				this.selectIndex = index
+				this.$refs.chooseServiceTeacher.openPopup()
+			},
+
+			//选择服务人员
+			getWorkPerson(e) {
+				this.orderParam.childService[this.selectIndex].serviceUserId = e.personId
+				this.orderParam.childService[this.selectIndex].personName = e.personName
+				this.orderParam.childService[this.selectIndex].fee = e.fee
+
+				for (let childService of this.orderParam.childService) {
+					this.price = 0
+					this.price =  this.price * 1 + childService.fee * 1
+				}
+
+			},
+
+			//选择服务时段
+			chooseServiceTime(index) {
+				this.selectIndex = index
+				this.$refs.chooseServiceTime.openPopup()
+			},
+			//选择服务时段
+			getPeriodDate(e) {
+				this.orderParam.childService[this.selectIndex].serviceStartTime = e.label
+				this.orderParam.childService[this.selectIndex].timeRangeId = e.id
+			},
+
+			selectChange() {
+				this.selectIcon = !this.selectIcon
+			},
+
+
+			goTermsOfService() {
+				uni.navigateTo({
+					url: '/myPages/TermsOfService/index?name=' + '预约需知' + '&type=' + 5
+				})
+			},
+
+
+
+
+			//提交订单
+			commitOrder() {
+				if(!this.selectIcon){
+				  uni.$u.toast('请阅读并同意《预约需知》')
+				  return;
+				}
+
+				if (this.orderParam.childService.length === 0) {
+				  uni.$u.toast('请选择服务对象')
+				  return;
+				}
+				if(this.requestStatus){
+					return;
+				}
+				this.requestStatus=true
+
+				this.$api.commonGeneralOrder(this.orderParam).then(res=>{
+					console.log('++++++++++++++++++订单提交+++++++++++',res)
+					this.orderNo = res.data.data.orderNo
+					this.subOrderNo = res.data.data.subOrderNo
+					this.$refs.myPay.openPopup()
+					this.requestStatus=false
+				}).catch(err =>{
+					this.requestStatus=false
+				})
+
+			},
+
+
+
+
+		}
+	}
 </script>
-
 <style scoped lang="scss">
-@import '/common/css/common.css';
-@import './index.rpx.scss';
+	@import './index.rpx.scss';
 </style>

BIN
static/order/nvren.png


BIN
static/order/ud20.png


+ 1 - 0
uni.scss

@@ -76,3 +76,4 @@ $uni-color-paragraph: #3F536E; // 文章段落颜色
 $uni-font-size-paragraph:15px;
 
 @import 'uview-ui/theme.scss';
+@import '/common/css/common.css';