zhanghui 2 роки тому
батько
коміт
7b283d67d6
2 змінених файлів з 94 додано та 28 видалено
  1. 35 8
      pages/index/index.rpx.css
  2. 59 20
      pages/index/index.vue

+ 35 - 8
pages/index/index.rpx.css

@@ -40,13 +40,17 @@
 }
 
 .biaoqian {
+	/*width: 100rpx;*/
 	background: #FFF6CE;
 	border-radius: 8rpx;
 	border: 2rpx solid #FFE05C;
-	padding: 6rpx 18rpx;
-	font-size: 20rpx;
+	padding: 2rpx 10rpx;
+	font-size: 18rpx;
 	font-weight: 400;
 	color: #333333;
+	margin-left: 20rpx;
+	margin-top: 4rpx;
+	display: block;
 }
 
 .tuni-right {
@@ -156,13 +160,15 @@
 }
 
 .servicename {
-	height: 52rpx;
-	font-size: 36rpx;
+	/*width: 100rpx;*/
+	/*height: 52rpx;*/
+	font-size: 24rpx;
 	font-weight: 600;
 	color: #333333;
-	padding: 0 20rpx;
-	line-height: 64rpx;
-	margin-bottom: 20rpx;
+	margin-left: 20rpx;
+	/*padding: 0 20rpx;*/
+	/*line-height: 64rpx;*/
+	/*margin-bottom: 20rpx;*/
 }
 
 .tag {
@@ -488,4 +494,25 @@
 .textarea {
 	border: 1px solid #F7F7F7;
 	padding: 10rpx;
-}
+}
+
+.orderMsg{
+ padding-left: 32rpx;
+}
+.key{
+	height: 44rpx;
+	font-size: 28rpx;
+	font-family: PingFangSC, PingFang SC;
+	font-weight: 400;
+	color: #999999;
+	line-height: 44rpx;
+	margin-left: 16rpx;
+}
+.value{
+	height: 44rpx;
+	font-size: 28rpx;
+	font-family: PingFangSC, PingFang SC;
+	font-weight: 400;
+	color: #333333;
+	line-height: 44rpx;
+}

+ 59 - 20
pages/index/index.vue

@@ -41,10 +41,10 @@
 		</view>
 
 		<view class="flex-row justify-around buttons">
-			<view class="buttonItem" @click="call" v-if="currService && currService.callState == '2'">
-				<text>叫号</text>
-			</view>
-			<view class="buttonItem" @click="next" v-else>
+<!--			<view class="buttonItem" @click="call" v-if="currService && currService.callState == '2'">-->
+<!--				<text>叫号</text>-->
+<!--			</view>-->
+			<view class="buttonItem" @click="next">
 				<text>下一位</text>
 			</view>
 			<view class="buttonItem" @click="takePlace">
@@ -64,7 +64,7 @@
 					<image class="serviceProfile" :src="currService.avatar || '/static/ud4.png'"></image>
 					<view class="flex-col justify-end serviceInfo-rigth ">
 						<view class="flex-row justify-between ">
-							<view class="flex-row">
+							<view class="flex-col">
 								<view class="flex-col justify-center ">
 									<text class="servicename">{{currService.serviceObjectName}}</text>
 								</view>
@@ -94,10 +94,24 @@
 						</view>
 					</view>
 				</view>
-				<view>
-					<text>订单编号:{{currService.orderNo}}</text>
+				<view class="flex-col orderMsg">
+					<view class="flex-row">
+						<u-icon name="/static/index/quhao.png" size="20"></u-icon>
+						<text class="key">排号:</text>
+						<text class="value">{{currService.planNumber}}</text>
+					</view>
+					<view class="flex-row">
+						<u-icon name="/static/index/orderNo1.png" size="20"></u-icon>
+						<text class="key">订单编号:</text>
+						<text class="value">{{currService.orderNo}}</text>
+					</view>
+					<view class="flex-row">
+						<u-icon name="/static/index/jiandao.png" size="20"></u-icon>
+						<text class="key">服务项目:</text>
+						<text class="value">{{currService.serviceProject}}</text>
+					</view>
 				</view>
-				<view class="flex-row justify-center ">
+				<view class="flex-row justify-center">
 					<view class="imgs">
 						<view class="mmImgView" :class="{floatRight: (index+1) % 2==0,marginTop:index>1}" v-for="(i,index) in 0" :key="index">
 							<image class="mmImg" mode="widthFix" src="/static/mn1.webp"></image>
@@ -106,7 +120,7 @@
 
 				</view>
 
-				<view class="flex-row justify-center">
+				<view class="flex-row justify-center" v-if="showLike">
 					<view class="like">
 						<text>{{currService.preference || '暂无'}}</text>
 					</view>
@@ -124,7 +138,7 @@
 		</view>
 
 		<uni-popup ref="reminderPopup" type="center">
-			<view class="reminderView">
+			<view class="reminderView ">
 				<view class="reminderTitle">
 					<text>保存用户喜好</text>
 				</view>
@@ -136,7 +150,7 @@
 					<view class="cancelButton " @click="closeReminderPopup">
 						<text>取消</text>
 					</view>
-					<view class="confirmButton" @click="preference">
+					<view class="confirmButton " @click="preference">
 						<text>确定</text>
 					</view>
 				</view>
@@ -203,7 +217,7 @@
 						<view class="flex-col objectName ">
 							<text>{{item.nickName}}</text>
 						</view>
-						<image v-if="servicePersonListIndex === index" class="vImage" src="/static/index/xuanzhong.png"></image>
+						<image v-if="selectServiceObjectIndex === index" class="vImage" src="/static/index/xuanzhong.png"></image>
 					</view>
 				</scroll-view>
 
@@ -229,6 +243,7 @@
 		},
 		data() {
 			return {
+				showLike:false,
 				previousServiceOrderId:'',
 				content:'',
 				selectServiceObjectList:[],
@@ -242,7 +257,7 @@
 				readerHeight: '',
 				readerWidth: '',
 				userInfo: {},
-				storeId: '',
+				storeId: '1710635498257108993',
 				storeName: '',
 				currService: null,
 				qqMap:new QQMapWX({key: 'ZIABZ-543WB-747UM-JL5Y7-NDS4E-HWB4M',vm: this})
@@ -254,9 +269,10 @@
 			this.sysHeight = sysInfo.windowHeight - (sysInfo.windowWidth / 750) * 400 + 'px'
 			this.readerHeight = sysInfo.windowHeight + 'px'
 			this.readerWidth = sysInfo.windowWidth + 'px'
-			this.storeId = uni.getStorageSync('storeId')
+			// this.storeId = uni.getStorageSync('storeId')
 			this.storeName = uni.getStorageSync('storeName')
 			this.getUserInfo()
+			this.currServiceInfo()
 		},
 		onShow() {
 			this.userInfo = uni.getStorageSync('userInfo')
@@ -267,7 +283,7 @@
 		methods: {
 			closeReminderPopup(){
 				this.previousServiceOrderId = ''
-				this.$refs.reminderPopup.open()
+				this.$refs.reminderPopup.close()
 			},
 			openSelectServiceObjectPopup(){
 				this.$api.service.getServiceObjectList({
@@ -347,7 +363,7 @@
 				this.$refs.addServicePopup.close()
 			},
 			addServiceProject(){
-				this.previousServiceOrderId = this.currService.orderServiceId
+				this.previousServiceOrderId = this.currService.serviceObjectId
 				this.$api.service.addServiceProject(
 						{
 							orderServiceId:this.currService.orderServiceId,
@@ -370,6 +386,7 @@
 
 
 			takePlace() {
+				this.showLike = true
 				this.$api.service.takePlace({
 					orderServiceId: this.currService.orderServiceId
 				}).then(res => {
@@ -378,12 +395,23 @@
 						duration: 2000,
 						title: '操作成功'
 					});
-
-					this.currServiceInfo()
+					this.$api.service.currServiceInfo({
+						storeId: this.storeId
+					}).then(res => {
+						console.log(res.data.data)
+						this.currService = res.data.data
+						this.currService.avatar=this.currService.avatar.replace(/^http:/, "https:")
+						let serviceFee = 0
+						res.data.data.childList.forEach(item=>{
+							serviceFee += item.serviceFee *1
+						})
+						this.currService.serviceFee = serviceFee.toFixed(2)
+					})
 				})
 			},
 
 			preference(){
+				this.$refs.reminderPopup.close()
 				this.$api.service.preference({
 					serviceObjectId:this.previousServiceOrderId,
 					preference:this.content
@@ -398,7 +426,7 @@
 			},
 
 			settle() {
-				this.previousServiceOrderId = this.currService.orderServiceId
+				this.previousServiceOrderId = this.currService.serviceObjectId
 				this.$api.service.settle({
 					orderServiceId: this.currService.orderServiceId
 				}).then(res => {
@@ -430,14 +458,25 @@
 			},
 
 			next() {
+				if (!this.storeId){
+					uni.showToast({
+						icon: 'error',
+						duration: 2000,
+						title: '请先扫码签到'
+					});
+					return
+				}
+				this.showLike = false
 				uni.showModal({
 					title:'温馨提示',
 					content:'是否确定下一位',
 					editable:false,
 					success:(e)=>{
 						if (e.confirm){
+							console.log(e.confirm)
 							this.$api.service.next({
-								orderServiceId: this.currService.orderServiceId
+								orderServiceId: this.currService ? this.currService.orderServiceId : null,
+								storeId:this.storeId
 							}).then(res => {
 								this.currServiceInfo()
 							})