scw 2 달 전
부모
커밋
9f45e8b2c8
4개의 변경된 파일199개의 추가작업 그리고 17개의 파일을 삭제
  1. 2 2
      config/request.js
  2. 1 1
      pages/mine/agreement.vue
  3. 4 4
      pages/order/placeAnOrder.vue
  4. 192 10
      pages/tabBar/order.vue

+ 2 - 2
config/request.js

@@ -12,8 +12,8 @@ module.exports = (vm) => {
 	// config.baseURL = 'http://192.168.0.17:8299/api'; /* 根域名 */
     // config.baseURL = 'http://192.168.0.151:8299/api'; /* 根域名 */
     // config.baseURL = 'https://bwshop.caiquanwang.com.cn/prod-api/api'
-	// config.baseURL = 'http://192.168.0.70:8181/api'; //郭
-	config.baseURL = 'https://peihu.songlanyun.com/prod-api/api'
+	config.baseURL = 'http://192.168.0.70:8181/api'; //郭
+	// config.baseURL = 'https://peihu.songlanyun.com/prod-api/api'
     // config.baseURL = 'https://wrj.songlanyun.com/prod-api/api'; /* 根域名 */
     return config
   })

+ 1 - 1
pages/mine/agreement.vue

@@ -40,7 +40,7 @@
 			if (options.type) {
 				this.agreementInfo(options.type);
 				if (options.type == 'user_protocol') {
-					this.title = '用户协议';
+					this.title = '用户隐私协议';
 				} else if (options.type == 'service_protocol') {
 					this.title = '用户服务协议';
 				} else if (options.type == 'privacy_protocol') {

+ 4 - 4
pages/order/placeAnOrder.vue

@@ -81,10 +81,10 @@
 				<u-checkbox size="16" shape="square" labelSize="12" active-color="#4B91D1" label="我已阅读并同意" la
 					labelColor="#999999" name="true" :value="true"></u-checkbox>
 			</u-checkbox-group>
-			<view class="agreement" @click="toPrivacy('service_protocol')">《服务协议》</view>
+			<view class="agreement" @click="toPrivacy('service_protocol')">《用户服务协议》</view>
 		</view>
 		<view class="tips flex-box-cloum">
-			<span>润康优护服务公司为您提供服务</span>
+			<span>润康优护为您提供服务</span>
 		</view>
 
 		<view class="submit-box flex-box-c-b">
@@ -376,7 +376,7 @@
 				let that = this;
 				if (that.checked != 'true') {
 					uni.showToast({
-						title: '请先阅读并同意服务协议',
+						title: '请先阅读并同意用户服务协议',
 						icon: 'none'
 					})
 					return
@@ -395,7 +395,7 @@
 			confirm() {
 				if (!this.readed) {
 					uni.showToast({
-						title: '请先滑动阅读服务协议',
+						title: '请先滑动阅读用户服务协议',
 						icon: 'none'
 					})
 					return

+ 192 - 10
pages/tabBar/order.vue

@@ -58,7 +58,12 @@
 				<u-line color="#f0f0f0"></u-line>
 				<view class="btn-box">
 					<span class="time">{{$utils.mFormatDate(item.expectedTime, 'yyyy-MM-dd HH:mm') || '-'}}</span>
-					<span class="btn" v-if="item.status !=6" @click.stop="cancleOrder(item.id)">取消订单</span>
+					<view class="btn-box-r">
+						<span class="btn btn1" v-if="item.status == 1" @click.stop="cancleOrder(item.id)">取消订单</span>
+						<!--  -->
+						<span class="btn btn2" v-if="item.status == 2 || item.status == 3" @click.stop="contactPerson(item.id)">联系护工</span>
+						<span class="btn btn2" v-if="item.status == 5" @click.stop="goEvaluation(item.id)">去评价</span>
+					</view>
 				</view>
 			</view>
 		</view>
@@ -71,6 +76,23 @@
 			<u-loadmore :status="status" :loading-text="loadingText" :loadmore-text="loadmoreText"
 				:nomore-text="nomoreText" @loadmore="loadmore" dashed line marginTop="20" />
 		</view>
+
+		<u-popup :overlayStyle="{'touch-action':'none'}" closeable mode="bottom" :show="popShow" @close="popClose"
+			@open="open" :round="20">
+			<view class="pop-box">
+				<view class="pop-title">联系护工</view>
+				<view class="pop-content">
+					<view class="pop-item" v-for="item,index in workerList" :key="index"
+						@click="confirmAndCall(item.mobile)">
+						<u-icon name="phone" color="#fff"></u-icon>
+						<span class="txt">{{item.mobile || '-'}}</span>
+					</view>
+				</view>
+				<view class="footer-btn">
+					<span class="btn">取消</span>
+				</view>
+			</view>
+		</u-popup>
 	</view>
 </template>
 
@@ -104,6 +126,15 @@
 				},
 				current: 0,
 				isFirst: true,
+
+				workerList: [{
+					mobile: '13555265325',
+				}, {
+					mobile: '15800215426',
+				}, {
+					mobile: '15074125896',
+				}],
+				popShow: false,
 			}
 		},
 		onLoad(option) {
@@ -162,6 +193,60 @@
 				this.getOrderList("reload")
 				this.getOrderStatus();
 			},
+
+			open() {
+				this.popShow = true;
+			},
+
+			popClose() {
+				this.popShow = false;
+			},
+
+			//拨打电话
+			confirmAndCall(phoneNumber) {
+				// 先验证电话号码
+				if (!this.isValidPhoneNumber(phoneNumber)) {
+					uni.showToast({
+						title: '电话号码格式不正确',
+						icon: 'none'
+					});
+					return;
+				}
+
+				// 显示确认对话框
+				uni.showModal({
+					title: '确认拨打电话',
+					content: `确定要拨打 ${phoneNumber} 吗?`,
+					success: (res) => {
+						if (res.confirm) {
+							// 用户点击确定,执行拨打电话
+							this.makePhoneCall(phoneNumber);
+						}
+					}
+				});
+			},
+
+			isValidPhoneNumber(phoneNumber) {
+				// 简单的电话号码验证
+				return /^1[3-9]\d{9}$/.test(phoneNumber);
+			},
+
+			makePhoneCall(phoneNumber) {
+				uni.makePhoneCall({
+					phoneNumber: phoneNumber,
+					success: () => {
+						console.log('拨打电话成功');
+					},
+					fail: (err) => {
+						console.error('拨打电话失败', err);
+						uni.showToast({
+							title: '拨打电话失败',
+							icon: 'none'
+						});
+					}
+				});
+			},
+
 			changeTab(item) {
 				// console.log("item", item);
 				this.pageNum = 1;
@@ -174,6 +259,7 @@
 				return obj ? obj.value : '-'
 			},
 
+			//取消订单
 			cancleOrder(id) {
 				//确认是否删除
 				uni.showModal({
@@ -198,6 +284,20 @@
 				})
 			},
 
+			//联系护工
+			contactPerson(item) {
+				this.open()
+			},
+
+			//去评价
+			goEvaluation(item) {
+				uni.navigateTo({
+					url: '/pages/order/evaluation?id=' + item.id
+
+				})
+			},
+
+			//获取订单列表
 			getOrderList(reload) {
 				// 验证登录
 				// let token = uni.getStorageSync('apiToken');
@@ -273,6 +373,7 @@
 				})
 			},
 
+			//加载更多
 			loadmore() {
 				// 如果当前页数大于等于总页数,状态修改为没有更多了,不再继续往下执行代码
 				if (this.orderList.length >= this.total) {
@@ -298,6 +399,8 @@
 					uni.stopPullDownRefresh();
 				}, 1000);
 			},
+
+
 		}
 	}
 </script>
@@ -420,18 +523,97 @@
 					color: #6F6F6F;
 				}
 
-				.btn {
-					width: 160rpx;
-					height: 60rpx;
-					line-height: 60rpx;
-					text-align: center;
-					background-color: #4B91D1;
-					color: #fff;
-					border-radius: 30rpx;
-					font-size: 24rpx;
+				.btn-box-r {
+
+					display: flex;
+					align-items: center;
+
+					.btn {
+						width: 160rpx;
+						height: 60rpx;
+						margin-left: 20rpx;
+						line-height: 60rpx;
+						text-align: center;
+						background-color: #4B91D1;
+						color: #fff;
+						border-radius: 30rpx;
+						font-size: 24rpx;
+					}
+
+					.btn1 {
+						background-color: #fff;
+						border: 1rpx solid #4B91D1;
+						color: #4B91D1;
+					}
 				}
+
 			}
 
 		}
+
+
+	}
+
+	.pop-box {
+		.pop-title {
+			font-size: 32rpx;
+
+			font-weight: bold;
+			text-align: center;
+			padding: 20rpx 0;
+
+		}
+
+		.pop-content {
+			display: flex;
+			flex-direction: column;
+			align-items: center;
+			margin-top: 30rpx;
+			font-size: 28rpx;
+			color: #6F6F6F;
+			padding: 0 20rpx;
+
+			&>view {
+				margin-bottom: 20rpx;
+
+				&:last-child {
+					margin-bottom: 0;
+
+				}
+
+			}
+
+			.pop-item {
+				display: flex;
+				align-items: center;
+				justify-content: center;
+				width: 500rpx;
+				padding: 20rpx 0;
+				background-color: #4B91D1;
+				border-radius: 40rpx;
+				color: #fff;
+
+				.txt {
+					font-size: 28rpx;
+				}
+			}
+
+		}
+
+		.footer-btn {
+			display: flex;
+			flex-direction: column;
+			align-items: center;
+			margin-top: 60rpx;
+
+			.btn {
+				width: 500rpx;
+				padding: 20rpx 0;
+				border: 1rpx solid #4B91D1;
+				border-radius: 40rpx;
+				color: #333;
+				text-align: center;
+			}
+		}
 	}
 </style>