zhanghui 2 lat temu
rodzic
commit
fee3062639
3 zmienionych plików z 101 dodań i 14 usunięć
  1. 12 1
      common/js/service.js
  2. 19 0
      pages/index/index.rpx.css
  3. 70 13
      pages/index/index.vue

+ 12 - 1
common/js/service.js

@@ -38,7 +38,7 @@ export default {
     //就位
     takePlace(param) {
         return request({
-            url: 'business/tech/takePlace',
+            url: '/business/tech/takePlace',
             method: 'POST',
             data:param
         })
@@ -151,4 +151,15 @@ export default {
     },
 
 
+    //保存用户偏好
+    preference(param) {
+        return request({
+            url: '/business/tech/save/preference',
+            method: 'POST',
+            data:param
+
+        })
+    },
+
+
 }

+ 19 - 0
pages/index/index.rpx.css

@@ -412,3 +412,22 @@
     line-height: 160rpx;
     margin-left: 24rpx;
 }
+.reminderView{
+    width: 600rpx;
+    background: #FFFFFF;
+    border-radius: 15rpx;
+    padding: 20rpx 10rpx;
+}
+.reminderTitle{
+    text-align: center;
+    height: 50rpx;
+    line-height: 50rpx;
+}
+.textareaView{
+    height: 280rpx;
+    padding: 10rpx 0;
+}
+.textarea{
+    border: 1px solid #F7F7F7;
+    padding: 10rpx;
+}

+ 70 - 13
pages/index/index.vue

@@ -94,6 +94,9 @@
 						</view>
 					</view>
 				</view>
+				<view>
+					<text>订单编号:{{currService.orderNo}}</text>
+				</view>
 				<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">
@@ -120,7 +123,25 @@
 			</view>
 		</view>
 
-
+		<uni-popup ref="reminderPopup" type="center">
+			<view class="reminderView">
+				<view class="reminderTitle">
+					<text>保存用户喜好</text>
+				</view>
+				<view class="textareaView flex-row justify-center ">
+					<textarea class="textarea" v-model="content" placeholder-style="color:#999999;fontSize:28rpx"
+							  placeholder="请输入用户喜好" />
+				</view>
+				<view class="flex-row justify-around" :style="{'marginTop':'20rpx'}">
+					<view class="cancelButton " @click="closeReminderPopup">
+						<text>取消</text>
+					</view>
+					<view class="confirmButton" @click="preference">
+						<text>确定</text>
+					</view>
+				</view>
+			</view>
+		</uni-popup>
 		<uni-popup ref="addServicePopup" @change="popupChange" type="bottom">
 			<view class="addService">
 				<scroll-view class="scrollY1 " scroll-y>
@@ -208,6 +229,8 @@
 		},
 		data() {
 			return {
+				previousServiceOrderId:'',
+				content:'',
 				selectServiceObjectList:[],
 				selectServiceObjectIndex:-1,
 				servicePersonList:[],
@@ -242,6 +265,10 @@
 			}
 		},
 		methods: {
+			closeReminderPopup(){
+				this.previousServiceOrderId = ''
+				this.$refs.reminderPopup.open()
+			},
 			openSelectServiceObjectPopup(){
 				this.$api.service.getServiceObjectList({
 					orderServiceId:this.currService.orderServiceId,
@@ -320,7 +347,7 @@
 				this.$refs.addServicePopup.close()
 			},
 			addServiceProject(){
-
+				this.previousServiceOrderId = this.currService.orderServiceId
 				this.$api.service.addServiceProject(
 						{
 							orderServiceId:this.currService.orderServiceId,
@@ -328,13 +355,10 @@
 							serviceUserId:this.servicePersonList[this.servicePersonListIndex].personId
 						}
 				).then(res=>{
-					uni.showToast({
-						icon: 'none',
-						duration: 2000,
-						title: '添加成功'
-					});
-					this.currServiceInfo()
 					this.closeAddServicePopup()
+					this.currServiceInfo()
+					this.$refs.reminderPopup.open()
+
 				})
 			},
 
@@ -349,15 +373,37 @@
 				this.$api.service.takePlace({
 					orderServiceId: this.currService.orderServiceId
 				}).then(res => {
+					uni.showToast({
+						icon: 'success',
+						duration: 2000,
+						title: '操作成功'
+					});
+
 					this.currServiceInfo()
 				})
 			},
 
+			preference(){
+				this.$api.service.preference({
+					serviceObjectId:this.previousServiceOrderId,
+					preference:this.content
+				}).then(res=>{
+					this.previousServiceOrderId=''
+					uni.showToast({
+						icon: 'success',
+						duration: 2000,
+						title: '保存成功'
+					});
+				})
+			},
+
 			settle() {
+				this.previousServiceOrderId = this.currService.orderServiceId
 				this.$api.service.settle({
 					orderServiceId: this.currService.orderServiceId
 				}).then(res => {
 					this.currServiceInfo()
+					this.$refs.reminderPopup.open()
 				})
 			},
 			start() {
@@ -384,12 +430,20 @@
 			},
 
 			next() {
-				this.$api.service.next({
-					orderServiceId: this.currService.orderServiceId
-				}).then(res => {
-					this.currServiceInfo()
+				uni.showModal({
+					title:'温馨提示',
+					content:'是否确定下一位',
+					editable:false,
+					success:(e)=>{
+						if (e.confirm){
+							this.$api.service.next({
+								orderServiceId: this.currService.orderServiceId
+							}).then(res => {
+								this.currServiceInfo()
+							})
+						}
+					}
 				})
-
 			},
 
 			currServiceInfo() {
@@ -416,6 +470,9 @@
 					this.userInfo = res.data.data
 					this.getImgUrlByOssId(this.userInfo.avatar)
 					uni.setStorageSync('userInfo', this.userInfo )
+					if (this.userInfo.signIn){
+						this.currServiceInfo()
+					}
 				})
 			},
 			 getImgUrlByOssId(ossId){