scw 1 天之前
父節點
當前提交
a10925e064

+ 133 - 0
App.vue

@@ -52,6 +52,139 @@
 	img[alt]{
 	  max-width: 100%;
 	}
+	
+	.ql-video>video {
+		width: 100% !important;
+		height: 200px !important;
+	}
+	
+	.empty-box{
+		position: relative;
+		width: 582rpx;
+		height: 582rpx;
+		margin: 0 auto;
+		margin-top: 100rpx;
+		.empty-txt{
+			position: absolute;
+			top: 400rpx;
+			left: 50%;
+			transform: translateX(-50%);
+			font-size: 28rpx;
+			color: #999;
+		}
+	}
+	
+	// 隐藏滚动条
+	::-webkit-scrollbar {
+		display: none;
+	}
+	
+	// 富文本展示
+		.ql-editor-box {
+			text-align: justify;
+			font-family: auto !important;
+	
+			::v-deep .ql-indent-1 {
+				margin-left: 96rpx;
+			}
+	
+			::v-deep .ql-indent-2 {
+				margin-left: 192rpx;
+			}
+	
+			::v-deep .ql-indent-3 {
+				margin-left: 288rpx;
+			}
+	
+			::v-deep .ql-indent-4 {
+				margin-left: 384rpx;
+			}
+	
+			::v-deep .ql-indent-5 {
+				margin-left: 480rpx;
+			}
+	
+			::v-deep .ql-indent-6 {
+				margin-left: 576rpx;
+			}
+	
+			::v-deep .ql-indent-7 {
+				margin-left: 672rpx;
+			}
+	
+			::v-deep .ql-indent-8 {
+				margin-left: 768rpx;
+			}
+	
+			::v-deep img {
+				max-width: 100%;
+			}
+	
+			::v-deep .ql-align-center {
+				text-align: center;
+			}
+	
+			::v-deep .ql-align-right {
+				text-align: right;
+			}
+	
+			::v-deep blockquote {
+				display: block;
+				border-left: 8px solid #d0e5f2;
+				padding: 5px 10px;
+				margin: 10px 0;
+				line-height: 1.4;
+				font-size: 100%;
+				background-color: #f1f1f1;
+			}
+	
+			::v-deep .ql-indent-1 {
+				margin-left: 60rpx;
+			}
+	
+			::v-deep .ql-indent-2 {
+				margin-left: 120rpx;
+			}
+	
+			::v-deep .ql-indent-3 {
+				margin-left: 180rpx;
+			}
+	
+			::v-deep .ql-indent-4 {
+				margin-left: 240rpx;
+			}
+	
+			::v-deep .ql-indent-5 {
+				margin-left: 300rpx;
+			}
+	
+			::v-deep .ql-size-huge {
+				font-size: 80rpx;
+				display: inline-block;
+				line-height: 90rpx;
+			}
+	
+			::v-deep .ql-size-large {
+				font-size: 48rpx;
+				display: inline-block;
+				line-height: 50rpx;
+			}
+	
+			::v-deep .ql-size-small {
+				font-size: 24rpx;
+				display: inline-block;
+				line-height: 30rpx;
+			}
+	
+			::v-deep .ql-font-serif {
+				font-family: Georgia, Times New Roman, serif;
+			}
+	
+			::v-deep .ql-font-monospace {
+				font-family: Monaco, Courier New, monospace;
+			}
+		}
+	
 	/*每个页面公共css */
 	view,
 	text {

+ 6 - 0
api/order.js

@@ -49,6 +49,12 @@ export const getDefaultPatient = () => {
   return uni.$u.http.get(`/patient/patient/getDefaulted`)
 }
 
+//取消订单
+export const cancelOrder = (id) => { 
+	return uni.$u.http.post(`/order/order/cancel/${id}`)
+}
+
+
 
 
 

+ 4 - 3
config/request.js

@@ -12,7 +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 = '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
   })
@@ -41,7 +42,7 @@ module.exports = (vm) => {
         } else {
           uni.$u.toast('请登录!');
           setTimeout(() => {
-            uni.reLaunch({
+            uni.navigateTo({
               url: '/pages/login/index',
             });
           }, 1000)
@@ -60,7 +61,7 @@ module.exports = (vm) => {
       }
       if (data.code == 401) {
         setTimeout(() => {
-          uni.reLaunch({
+          uni.navigateTo({
             url: '/pages/login/index',
           });
         }, 500)

+ 2 - 1
pages.json

@@ -6,7 +6,8 @@
 		"path": "pages/tabBar/index",
 		"style": {
 			"navigationBarTitleText": "润护通",
-			"enablePullDownRefresh": true
+			"enablePullDownRefresh": true,
+			"enableShareAppMessage": true // 开启分享
 			
 		}
 	}, {

+ 9 - 4
pages/login/index.vue

@@ -21,7 +21,7 @@
 				<checkbox value="agree" :checked="agree" />
 			</checkbox-group>
 			<text>我已阅读并同意</text>
-			<text class="txt" @click="goAgreement('user_protocol')">《隐私协议》</text>
+			<text class="txt" @click="goAgreement('user_protocol')">《用户隐私协议》</text>
 		</view>
 		<u-popup :show="popupShow" bgColor="transparent" :safeAreaInsetBottom="false" closeOnClickOverlay
 			@close="close">
@@ -207,9 +207,14 @@
 				storage.set('apiToken', token)
 				UserInfo()
 				setTimeout(() => {
-					uni.switchTab({
-						url: '/pages/tabBar/index'
-					})
+					// uni.switchTab({
+					// 	url: '/pages/tabBar/index'
+					// })
+					//跳转订单页面传递参数
+					getApp().globalData.switchTabParams = {
+						reload: 'reload'
+					};
+					uni.navigateBack()
 				}, 300)
 			},
 			checkboxChange(e) {

+ 19 - 115
pages/mine/agreement.vue

@@ -1,20 +1,25 @@
 <template>
-	<view class="agreement">
+	<view class="agreement ">
 		<u-navbar :title="title" leftIconColor="#1a1a1a" titleStyle="color:#1a1a1a" :autoBack="true"
 			placeholder></u-navbar>
-			<!-- <video class="ql-video" src="http://192.168.0.70:8181/path/2025-09-25/动态数据展示114542895.mp4" controls style="width: 100%; height: 200px;"></video> -->
-		<view class="top ql-editor-box" v-html="$utils.richTextImg(agreement)">
-		</view>
+		<!-- <video src="http://192.168.0.70:8181/path/2025-09-25/动态数据展示114542895.mp4" controls
+			style="width:100%;height:200px;"></video> -->
+		<!-- <view class="top ql-editor-box" v-html="$utils.richTextImg(agreement)"></view> -->
+		<u-parse class="top ql-editor-box" :content="$utils.richTextImg(agreement)" ></u-parse> 
 	</view>
 </template>
 
 <script>
+	// import uParse from '@/components/u-parse/u-parse.vue'
 	import {
 		protocolInfo,
 		problemInfo
 	} from '@/api/user.js'
 	var app = getApp()
 	export default {
+		components: {
+		    // uParse
+		  },
 		data() {
 			return {
 				title: "协议",
@@ -37,9 +42,9 @@
 				if (options.type == 'user_protocol') {
 					this.title = '用户协议';
 				} else if (options.type == 'service_protocol') {
-					this.title = '服务协议';
+					this.title = '用户服务协议';
 				} else if (options.type == 'privacy_protocol') {
-					this.title = '隐私协议';
+					this.title = '用户隐私协议';
 				} else if (options.type == 'about_us') {
 					this.title = '关于我们';
 				}
@@ -55,7 +60,7 @@
 					code: type
 				}).then(res => {
 					let data = this.replaceIframeWithVideo(res.data.protocolContent)
-					console.log('data',data);
+					// console.log('data', data);
 					this.agreement = data
 				})
 			},
@@ -63,7 +68,7 @@
 				return html.replace(
 					/<iframe[^>]+?src=(["'])(https?:\/\/[^"']+?\.mp4)\1[^>]*?>\s*<\/iframe>/gi,
 					(match, quote, src) => {
-						return `<video src="${src}" controls style="width: 100px; height: 200px;"></video>`;
+						return `<video class="ql-video" src="${src}" controls style="width:100%;height:200px;"></video>`;
 					}
 				);
 			},
@@ -83,10 +88,13 @@
 		background-color: #fff !important;
 		color: #1a1a1a;
 	}
-
 	.agreement {
 		width: 100%;
 		overflow: hidden;
+		padding: 0 20rpx;
+		box-sizing: border-box;
+		min-height: 100vh;
+		// background-color: #fff;
 	}
 
 	.topsearch {
@@ -96,6 +104,7 @@
 		z-index: 2;
 		box-sizing: border-box;
 		background-color: #fff;
+		
 	}
 
 	.topsbox {
@@ -131,109 +140,4 @@
 		color: #1a1a1a !important;
 	}
 
-	// 富文本展示
-	.ql-editor-box {
-		text-align: justify;
-		font-family: auto !important;
-
-		::v-deep .ql-indent-1 {
-			margin-left: 96rpx;
-		}
-
-		::v-deep .ql-indent-2 {
-			margin-left: 192rpx;
-		}
-
-		::v-deep .ql-indent-3 {
-			margin-left: 288rpx;
-		}
-
-		::v-deep .ql-indent-4 {
-			margin-left: 384rpx;
-		}
-
-		::v-deep .ql-indent-5 {
-			margin-left: 480rpx;
-		}
-
-		::v-deep .ql-indent-6 {
-			margin-left: 576rpx;
-		}
-
-		::v-deep .ql-indent-7 {
-			margin-left: 672rpx;
-		}
-
-		::v-deep .ql-indent-8 {
-			margin-left: 768rpx;
-		}
-
-		::v-deep img {
-			max-width: 100%;
-		}
-
-		::v-deep .ql-align-center {
-			text-align: center;
-		}
-
-		::v-deep .ql-align-right {
-			text-align: right;
-		}
-
-		::v-deep blockquote {
-			display: block;
-			border-left: 8px solid #d0e5f2;
-			padding: 5px 10px;
-			margin: 10px 0;
-			line-height: 1.4;
-			font-size: 100%;
-			background-color: #f1f1f1;
-		}
-
-		::v-deep .ql-indent-1 {
-			margin-left: 60rpx;
-		}
-
-		::v-deep .ql-indent-2 {
-			margin-left: 120rpx;
-		}
-
-		::v-deep .ql-indent-3 {
-			margin-left: 180rpx;
-		}
-
-		::v-deep .ql-indent-4 {
-			margin-left: 240rpx;
-		}
-
-		::v-deep .ql-indent-5 {
-			margin-left: 300rpx;
-		}
-
-		::v-deep .ql-size-huge {
-			font-size: 80rpx;
-			display: inline-block;
-			line-height: 90rpx;
-		}
-
-		::v-deep .ql-size-large {
-			font-size: 48rpx;
-			display: inline-block;
-			line-height: 50rpx;
-		}
-
-		::v-deep .ql-size-small {
-			font-size: 24rpx;
-			display: inline-block;
-			line-height: 30rpx;
-		}
-
-		::v-deep .ql-font-serif {
-			font-family: Georgia, Times New Roman, serif;
-		}
-
-		::v-deep .ql-font-monospace {
-			font-family: Monaco, Courier New, monospace;
-		}
-	}
-</style>
+	</style>

+ 102 - 89
pages/mine/helpCenter.vue

@@ -1,97 +1,110 @@
 <template>
-  <view class="container">
-   <!-- <u-navbar title="帮助中心" leftIconColor="#ffffff" titleStyle="color:#fff" :autoBack="true" placeholder></u-navbar> -->
-    <view class="list">
-      <view class="item" v-for="(v,i) in list" :key="i" @click="goPath('/pages/mine/agreement?helpId='+v.id)">
-        <view class="item_l">{{v.problemTitle}}</view>
-        <view class="item_r"><text class="iconfont icon-jiantou"></text></view>
-      </view>
-      <empty marginTop="50" v-if="(!list||list.length<=0)&&status!='loading'"></empty>
-      <u-loadmore v-else :status="status" />
-    </view>
-  </view>
+	<view class="container">
+		<!-- <u-navbar title="帮助中心" leftIconColor="#ffffff" titleStyle="color:#fff" :autoBack="true" placeholder></u-navbar> -->
+		<view class="list">
+			<view class="item" v-for="(v,i) in list" :key="i" @click="goPath('/pages/mine/agreement?helpId='+v.id)">
+				<view class="item_l">{{v.problemTitle}}</view>
+				<view class="item_r"><text class="iconfont icon-jiantou"></text></view>
+			</view>
+			<!-- <empty marginTop="50" v-if="(!list||list.length<=0)&&status!='loading'"></empty> -->
+			<view class="empty-box" v-if="(!list||list.length<=0)&&status!='loading'">
+				<u-image src="/static/none.png" mode="aspectFill" width="582rpx" height="582rpx"></u-image>
+				<span class="empty-txt">暂无数据!</span>
+				<!-- <u-empty marginTop="100" style="width: 100%;"></u-empty> -->
+			</view>
+			<u-loadmore v-else :status="status" />
+		</view>
+	</view>
 </template>
 
 <script>
-import { problemPage } from "@/api/user.js"
-export default {
-  data () {
-    return {
-      status: 'loadmore',//加载前值为loadmore,加载中为loading,没有数据为nomore
-      params: {
-        pageSize: 20,
-        pageNum: 1,
-        status: 1
-      },
-      list: []
-    }
-  },
-  onPullDownRefresh () {
-    this.params.pageNum = 1;
-    this.getList();
-  },
-  onReachBottom () {
-    if (this.status == "loadmore") {
-      this.params.pageNum++;
-      this.getList()
-    }
-  },
-  onLoad () {
-    this.getList();
-  },
-  methods: {
-    getList () {
-      problemPage(this.params).then(res => {
-        if (this.params.pageNum == 1) {
-          this.list = res.rows
-        } else {
-          this.list.push(...res.rows);
-        }
-        if (this.list.length < res.total) {
-          this.status = 'loadmore';
-        } else {
-          this.status = 'nomore';
-        }
-      }).finally(()=>{
-		  uni.stopPullDownRefresh();
-	  })
-    },
-    goPath (path) {
-      uni.navigateTo({
-        url: path
-      })
-    },
-  },
-}
+	import {
+		problemPage
+	} from "@/api/user.js"
+	export default {
+		data() {
+			return {
+				status: 'loadmore', //加载前值为loadmore,加载中为loading,没有数据为nomore
+				params: {
+					pageSize: 20,
+					pageNum: 1,
+					status: 1
+				},
+				list: []
+			}
+		},
+		onPullDownRefresh() {
+			this.params.pageNum = 1;
+			this.getList();
+		},
+		onReachBottom() {
+			if (this.status == "loadmore") {
+				this.params.pageNum++;
+				this.getList()
+			}
+		},
+		onLoad() {
+			this.getList();
+		},
+		methods: {
+			getList() {
+				problemPage(this.params).then(res => {
+					if (this.params.pageNum == 1) {
+						this.list = res.rows
+					} else {
+						this.list.push(...res.rows);
+					}
+					if (this.list.length < res.total) {
+						this.status = 'loadmore';
+					} else {
+						this.status = 'nomore';
+					}
+				}).finally(() => {
+					uni.stopPullDownRefresh();
+				})
+			},
+			goPath(path) {
+				uni.navigateTo({
+					url: path
+				})
+			},
+		},
+	}
 </script>
 
 <style lang='scss' scoped>
-::v-deep .u-navbar__content,
-::v-deep .u-status-bar {
-  background-color: #c90700 !important;
-}
-.container {
-  background: #ffffff;
-  .list {
-    padding: 15rpx 30rpx;
-    .item {
-      display: flex;
-      justify-content: space-between;
-      align-items: center;
-      padding: 35rpx 0 30rpx;
-      border-bottom: 1rpx solid #e6e6e6;
-      .item_l {
-        font-size: 28rpx;
-        color: #1a1a1a;
-        white-space: nowrap;
-        text-overflow: ellipsis;
-        overflow: hidden;
-        width: calc(100% - 100rpx);
-      }
-      .item_r {
-        color: #a3a3a3;
-      }
-    }
-  }
-}
+	::v-deep .u-navbar__content,
+	::v-deep .u-status-bar {
+		background-color: #c90700 !important;
+	}
+
+	.container {
+		padding-bottom: 50rpx;
+		background: #ffffff;
+
+		.list {
+			padding: 15rpx 30rpx;
+
+			.item {
+				display: flex;
+				justify-content: space-between;
+				align-items: center;
+				padding: 35rpx 0 30rpx;
+				border-bottom: 1rpx solid #e6e6e6;
+
+				.item_l {
+					font-size: 28rpx;
+					color: #1a1a1a;
+					white-space: nowrap;
+					text-overflow: ellipsis;
+					overflow: hidden;
+					width: calc(100% - 100rpx);
+				}
+
+				.item_r {
+					color: #a3a3a3;
+				}
+			}
+		}
+	}
 </style>

+ 33 - 29
pages/mine/patient/form.vue

@@ -4,23 +4,26 @@
 			<u--form labelWidth="80rpx" :model="formData" :rules="rules" ref="uForm">
 				<u-form-item label="姓名" prop="name" borderBottom required>
 					<u--input v-model="formData.name" placeholder-class="input-placeholder" border="none"
-						placeholder="必填,请输入证件上的姓名" :disabled="type == 'view'" maxlength="10" inputAlign="right"></u--input>
+						placeholder="必填,请输入证件上的姓名" :disabled="type == 'view'" maxlength="10"
+						inputAlign="right"></u--input>
 				</u-form-item>
 				<u-form-item label="电话" prop="mobile" borderBottom required>
-					<u--input v-model="formData.mobile" placeholder-class="input-placeholder" border="none" clearable
-						placeholder="必填,请输入手机号码" maxlength="11" :disabled="type == 'view'" inputAlign="right"></u--input>
+					<u--input type="number" v-model="formData.mobile" placeholder-class="input-placeholder"
+						border="none" clearable placeholder="必填,请输入手机号码" maxlength="11" :disabled="type == 'view'"
+						inputAlign="right"></u--input>
 				</u-form-item>
 
-				<u-form-item label="性别" prop="gender" borderBottom  @click="showSex = true">
+				<u-form-item label="性别" prop="gender" borderBottom @click="showSex = true">
 					<u-input :border="none" disabled v-model="formData.genderName" disabledColor="#ffffff"
 						placeholder="请选择" inputAlign="right" />
 					<u-icon slot="right" name="arrow-right" color="#999999"></u-icon>
 				</u-form-item>
-				<u-form-item label="年龄" prop="age" borderBottom >
-					<u--input v-model="formData.age" placeholder-class="input-placeholder" border="none" clearable
-						placeholder="请输入年龄" :disabled="type == 'view'" inputAlign="right"></u--input>
+				<u-form-item label="年龄" prop="age" borderBottom>
+					<u--input type="number" maxlength="3" v-model="formData.age" placeholder-class="input-placeholder"
+						border="none" clearable placeholder="请输入年龄" :disabled="type == 'view'"
+						inputAlign="right"></u--input>
 				</u-form-item>
-				<u-form-item label="关系" prop="relationship" borderBottom  @click="showShip = true">
+				<u-form-item label="关系" prop="relationship" borderBottom @click="showShip = true">
 					<u-input :border="none" disabled v-model="formData.relationshipName" disabledColor="#ffffff"
 						placeholder="请选择" inputAlign="right" />
 					<u-icon slot="right" name="arrow-right" color="#999999"></u-icon>
@@ -97,23 +100,23 @@
 						message: '请输入正确的电话',
 						trigger: 'blur',
 					}],
-					gender: [{
-						required: true,
-						message: '请选择性别',
-						type: 'number',
-						trigger: ['blur', 'change'],
-					}, ],
-					age: [{
-						required: true,
-						message: '请填写年龄,必须为数字',
-						type: 'number',
-						trigger: ['blur', 'change'],
-					}, ],
-					relationship: [{
-						required: true,
-						message: '请填写关系',
-						trigger: ['blur', 'change'],
-					}, ],
+					// gender: [{
+					// 	required: true,
+					// 	message: '请选择性别',
+					// 	type: 'number',
+					// 	trigger: ['blur', 'change'],
+					// }, ],
+					// age: [{
+					// 	required: true,
+					// 	message: '请填写年龄,必须为数字',
+					// 	type: 'number',
+					// 	trigger: ['blur', 'change'],
+					// }, ],
+					// relationship: [{
+					// 	required: true,
+					// 	message: '请填写关系',
+					// 	trigger: ['blur', 'change'],
+					// }, ],
 				},
 				type: 'add',
 				InfoId: '',
@@ -279,10 +282,11 @@
 
 <style scoped lang="scss">
 	.container {
+		padding-bottom: 200rpx;
 		background-color: #fff;
 
 		.form-box {
-			margin: 20rpx;
+			margin: 0 20rpx;
 			padding: 20rpx;
 		}
 
@@ -317,7 +321,7 @@
 			align-items: center;
 			justify-content: space-between;
 			width: 100%;
-			padding: 35rpx 30rpx 50rpx;
+			padding: 50rpx 30rpx;
 			box-sizing: border-box;
 			font-size: 28rpx;
 			background-color: #fff;
@@ -329,8 +333,8 @@
 				.submit-btn {
 					display: block;
 					width: 100%;
-					height: 60rpx;
-					line-height: 60rpx;
+					height: 80rpx;
+					line-height: 80rpx;
 					text-align: center;
 					color: #fff;
 					background-color: #026EB7;

+ 4 - 0
pages/mine/patient/patient.vue

@@ -16,6 +16,10 @@
 				</view>
 			</view>
 		</view>
+		<view class="empty-box" v-if="!patientList.length">
+			<u-image src="/static/none.png" mode="aspectFill" width="582rpx" height="582rpx"></u-image>
+			<span class="empty-txt">暂无数据!</span>
+		</view>
 		<!-- 底部按钮 -->
 		<view class="footer-box">
 			<view class="btn-box">

+ 29 - 23
pages/order/chooseService.vue

@@ -13,26 +13,26 @@
 				<view class="service-content">
 					<!-- 内容限制为两行省略,超过的部分能展开 content-text根据expand 切换active样式-->
 					<span class="content-text" :class="item.expand?'active':''">{{item.serviceDescription}}</span>
-					<!-- content-text超过两行时显示展开 -->
-					<span class="expand" v-if="item.serviceDescription.length>40"
-						@click="expand(index)">{{item.expand?'收起':'展开'}}</span>
+						<!-- content-text超过两行时显示展开 -->
+						<span class="expand" v-if="item.serviceDescription.length>40"
+							@click.stop="expand(index)">{{item.expand?'收起':'展开'}}</span>
+					</view>
 				</view>
 			</view>
+			<view class="empty-box" v-if="serviceList.length == 0">
+				<u-empty marginTop="100" style="width: 100%;"></u-empty>
+			</view>
 		</view>
-		<view class="empty-box" v-if="serviceList.length == 0">
-			<u-empty marginTop="100" style="width: 100%;"></u-empty>
-		</view>
-	</view>
 </template>
 
 <script>
 	import {
 		getServiceList
 	} from '@/api/home.js'
-	
-		import {
-			getServiceUnit,
-		} from '@/api/order.js'
+
+	import {
+		getServiceUnit,
+	} from '@/api/order.js'
 	export default {
 		data() {
 			return {
@@ -47,23 +47,23 @@
 		methods: {
 			getServiceList() {
 				getServiceList().then(res => {
-					if(res.code == 200){
+					if (res.code == 200) {
 						let data = res.data;
 						data.forEach(item => {
 							item.expand = false
 						})
 						this.serviceList = data
 					}
-					
+
 				})
 			},
-			
-			
+
+
 			getUnitTxt(value) {
 				let obj = this.unitList.find(item => item.code == value);;
 				return obj ? obj.value : ''
 			},
-			
+
 			//查询订单状态
 			getServiceUnit() {
 				let that = this;
@@ -71,12 +71,12 @@
 						if (res.code == 200) {
 							this.unitList = res.data.serviceUnit;
 						}
-			
+
 					})
 					.catch((err) => {
 						console.log(err);
 					})
-			
+
 			},
 
 			expand(index) {
@@ -129,24 +129,28 @@
 					align-items: center;
 
 					.title {
-						width: 490rpx;
+						width: 450rpx;
 						font-size: 32rpx;
 						font-weight: bold;
 						color: #1A1A1A;
 					}
-					.price-box{
+
+					.price-box {
 						display: flex;
 						align-items: flex-end;
 						color: #FF0000;
+
 						.price {
 							font-size: 40rpx;
 							line-height: 36rpx;
 						}
-						.unit,.tip{
+
+						.unit,
+						.tip {
 							font-size: 24rpx;
 						}
 					}
-					
+
 				}
 
 				.service-content {
@@ -157,7 +161,7 @@
 					margin-top: 20rpx;
 
 					.content-text {
-						width: 600rpx;
+						width: 570rpx;
 						font-size: 28rpx;
 						color: #666666;
 						overflow: hidden;
@@ -165,6 +169,7 @@
 						display: -webkit-box;
 						-webkit-line-clamp: 2;
 						-webkit-box-orient: vertical;
+						white-space: pre-wrap;
 					}
 
 					.active {
@@ -177,6 +182,7 @@
 
 					.expand {
 						flex: 1;
+						padding: 0 10rpx 10rpx 10rpx;
 						text-align: right;
 						font-size: 28rpx;
 						color: #007AFF;

+ 1 - 1
pages/order/orderDetails.vue

@@ -64,7 +64,7 @@
 			<view class="info-item">
 				<span class="title">下单数量</span>
 				<span
-					class="txt">{{orderInfo.orderNum || '-'}}({{ orderInfo.serviceUnit ? getUnitTxt(orderInfo.serviceUnit) : ''}})</span>
+					class="txt">{{orderInfo.orderNum || '-'}}({{  getUnitTxt(orderInfo.serviceUnit) }})</span>
 			</view>
 			<u-line></u-line>
 			<view class="info-item">

+ 114 - 22
pages/order/placeAnOrder.vue

@@ -49,7 +49,8 @@
 							placeholder="请选择服务开始时间" inputAlign="right" />
 						<u-icon slot="right" name="arrow-right"></u-icon>
 						<u-datetime-picker :show="showTimePicker" v-model="form.expectedTime" mode="datetime"
-							@confirm=selectTime @cancel="showTimePicker = false"></u-datetime-picker>
+							@confirm=selectTime @cancel="showTimePicker = false"
+							:filter="timeFilter"></u-datetime-picker>
 
 					</u-form-item>
 					<u-form-item label="下单数量" prop="orderNum" required>
@@ -61,8 +62,16 @@
 				</view>
 			</u--form>
 
-			<u-action-sheet :show="showDepartment" :actions="actions" title="请选择科室" description="必选项"
-				@close="showDepartment = false" @select="departmentSelect">
+			<u-action-sheet :show="showDepartment" :actions="actions" title="请选择科室" @close="showDepartment = false"
+				@select="departmentSelect">
+				<!-- <view class="search-box">
+				      <u-search 
+				        v-model="searchText" 
+				        placeholder="请输入搜索关键词" 
+				        :show-action="false"
+				        @change="onSearch"
+				      ></u-search>
+				    </view> -->
 			</u-action-sheet>
 
 		</view>
@@ -70,7 +79,7 @@
 		<view class="agreement-box">
 			<u-checkbox-group v-model="checked" @change="checkboxChange">
 				<u-checkbox size="16" shape="square" labelSize="12" active-color="#4B91D1" label="我已阅读并同意" la
-					labelColor="#999999" name="true"></u-checkbox>
+					labelColor="#999999" name="true" :value="true"></u-checkbox>
 			</u-checkbox-group>
 			<view class="agreement" @click="toPrivacy('service_protocol')">《服务协议》</view>
 		</view>
@@ -81,7 +90,7 @@
 		<view class="submit-box flex-box-c-b">
 			<view class="price-box">
 				<span class="txt">金额:</span>
-				<span class="price">¥{{price}}</span>
+				<span class="price">¥{{(price * form.orderNum).toFixed(2)}}</span>
 			</view>
 			<view class="submit-btn" @click="submit">确认下单</view>
 		</view>
@@ -90,7 +99,7 @@
 			@open="open" :round="20">
 			<view class="pop-box">
 				<view class="title-box">
-					服务协议
+					用户服务协议
 				</view>
 				<scroll-view class="scroll-content" scroll-y @scroll="handleScroll">
 					<view v-html="agreementContent"></view>
@@ -135,10 +144,10 @@
 					patientId: '',
 					serviceName: '',
 					serviceId: '',
-					expectedTime: Number(new Date()),
+					expectedTime: null,
 					orderNum: 1
 				},
-				price: '0.00',
+				price: 0,
 				// 表单验证规则
 				rules: {
 					department: [{
@@ -168,7 +177,7 @@
 					}],
 					expectedTimeFormat: [{
 						required: true,
-						message: '请输入期望时间',
+						message: '请选择期望时间',
 						trigger: ['change', 'blur']
 					}],
 					// orderNum: [{
@@ -188,16 +197,46 @@
 				unitName: null,
 				unitList: [],
 
+				isLogin: false,
+
+
 			};
 		},
+		computed: {
+			// price() {
+			// 	let that = this;
+			// 	let price = 0;
+			// 	if (that.form.orderNum && that.unitName) {
+			// 		let unit = that.unitList.find(item => item.name == that.unitName);
+			// 		if (unit) {
+			// 			price = that.form.orderNum * unit.price;
+			// 		}
+			// 	}
+			// 	return price.toFixed(2);
+			// }
+		},
 
 		onLoad(option) {
+
 			let that = this;
+			let user = uni.getStorageSync('apiToken');
+
 			if (option.id) {
-				this.getHospitalInfo(option.id)
+				that.form.hospitalId = option.id;
+				that.getHospitalInfo(option.id)
+			}
+			if (option.scene) {
+				let data = decodeURIComponent(option.scene);
+				//截取t=i&id=13 中id= 后面的值
+				let id = data.split('&')[1].split('=')[1];
+				console.log("id", id);
+				that.form.hospitalId = id;
+				this.getHospitalInfo(id)
 			}
 			this.getServiceUnit();
-			this.getDefaultInfo();
+			if (user) {
+				this.getDefaultInfo();
+			}
 			uni.$on('returnService', function(data) {
 				that.form.serviceName = data.name;
 				that.form.serviceId = data.id;
@@ -210,6 +249,26 @@
 				that.form.patientId = data.id;
 			});
 
+			//处理期待时间,获取当前时间,判断分钟是否小于30,小于30设置我30,大于30设置为00没并且转换成时间戳格式
+			let d = new Date();
+			let hour = d.getHours();
+			let minute = d.getMinutes();
+			if (minute < 30) {
+				minute = '30';
+
+			} else {
+				minute = '00';
+				hour = hour + 1;
+				if (hour > 23) {
+					hour = 0;
+					d.setDate(d.getDate() + 1);
+
+				}
+
+			}
+			let time = d.getFullYear() + '-' + (d.getMonth() + 1) + '-' + d.getDate() + ' ' + hour + ':' + minute;
+			that.form.expectedTime = time;
+			console.log(time);
 		},
 
 
@@ -227,6 +286,21 @@
 		},
 
 		methods: {
+			timeFilter(mode, options) {
+				// console.log(mode);
+				let d = new Date()
+				// console.log(d.getFullYear());
+				if (mode === 'year') {
+					return options.filter((option) => option >= d.getFullYear())
+				}
+				if (mode === 'month') {
+					return options.filter((option) => option >= d.getMonth() + 1)
+				}
+				if (mode === 'minute') {
+					return options.filter((option) => option === '00' || option === '30');
+				}
+				return options;
+			},
 			//获取医院详情
 			getHospitalInfo(id) {
 				let that = this;
@@ -245,8 +319,10 @@
 				getDefaultPatient().then(res => {
 					if (res.code == 200) {
 						let data = res.data;
-						that.form.patient = data.name+ '(' +  data.mobile +')';
-						that.form.patientId = data.id;
+						if (data) {
+							that.form.patient = data.name + '(' + data.mobile + ')';
+							that.form.patientId = data.id;
+						}
 					}
 				})
 			},
@@ -254,14 +330,17 @@
 			//滚动协议
 			handleScroll(e) {
 				//根据。agreement-content 的滚动条的进度,设置百分比
-				let scrollHeight = e.detail.scrollHeight;
-				let scrollTop = e.detail.scrollTop;
-				this.percentage = ((scrollTop / (scrollHeight - 400)) * 100).toFixed(0);
-				if (this.percentage >= 100) {
-					this.readed = true
-				} else {
-					this.readed = false
+				if (this.percentage < 100) {
+					let scrollHeight = e.detail.scrollHeight;
+					let scrollTop = e.detail.scrollTop;
+					this.percentage = ((scrollTop / (scrollHeight - 400)) * 100).toFixed(0);
+					if (this.percentage >= 100) {
+						this.readed = true
+					} else {
+						this.readed = false
+					}
 				}
+
 			},
 			getUnitTxt(value) {
 				let obj = this.unitList.find(item => item.code == value);;
@@ -295,7 +374,7 @@
 			// 提交表单
 			submit() {
 				let that = this;
-				if (!that.checked) {
+				if (that.checked != 'true') {
 					uni.showToast({
 						title: '请先阅读并同意服务协议',
 						icon: 'none'
@@ -309,9 +388,18 @@
 					} else {
 						console.log('表单验证失败');
 					}
+				}).catch((errors) => {
+					console.log('表单验证失败', errors);
 				})
 			},
 			confirm() {
+				if (!this.readed) {
+					uni.showToast({
+						title: '请先滑动阅读服务协议',
+						icon: 'none'
+					})
+					return
+				}
 				addOrder(this.form).then(res => {
 					if (res.code == 200) {
 						uni.showToast({
@@ -335,7 +423,9 @@
 			//选择时间
 			selectTime(e) {
 				this.form.expectedTime = e.value
+				console.log("this.form.expectedTime", this.form.expectedTime);
 				this.form.expectedTimeFormat = this.$utils.mFormatDate(e.value, 'yyyy-MM-dd HH:mm')
+				console.log("this.form.expectedTimeFormat", this.form.expectedTimeFormat);
 				this.showTimePicker = false
 			},
 			//选择科室
@@ -353,11 +443,12 @@
 			//选择同意协议
 			checkboxChange(e) {
 				console.log('当前值为: ' + e)
-				if (e) {
+				if (e == 'true') {
 					this.checked = true
 				} else {
 					this.checked = false
 				}
+				console.log('this.checked: ' + this.checked)
 			},
 
 			//去选择服务
@@ -394,6 +485,7 @@
 			},
 
 			popClose() {
+				this.readed = false;
 				this.percentage = 0;
 				this.popShow = false;
 			},

+ 153 - 56
pages/tabBar/index.vue

@@ -1,33 +1,52 @@
 <template>
 	<view class="container">
-		<view class="banner-box">
-			<u-swiper :list="swiperList" @change="change" @click="toLinkPage" radius="0" height="340rpx"></u-swiper>
-		</view>
-		<view class="hospital-box">
-			<view class="hospital-list">
-				<view class="hospital-item" v-for="item,index in hospitalList" :key="index">
-					<image :src="item.logoUrl" mode="aspectFill" />
-					<view class="hospital-info">
-						<view class="info-top">
-							<view class="hospital-name">{{item.name || '-'}}</view>
-							<view class="hospital-distance">{{item.relativeDistance || 0}}{{item.distanceUnit}}</view>
-						</view>
-						<view class="info-bottom">
-							<view class="info-bottom-l">
-								<span class="hospital-address">
-									<u-icon name="map-fill" color="#999999" size="14"></u-icon>
-									<span class="address">{{item.address || '-'}}</span>
-								</span>
-								<!-- <view class="hospital-area">所在区:{{item.areaName || '-'}}</view> -->
+		<template v-if="swiperList.length == 0">
+			<u-skeleton rows="1" class="skeleton-full" loading :rowsHeight="170" :title="false"></u-skeleton>
+			<view style="margin: 30rpx 0">
+				<u-skeleton rows="2" title loading avatar avatarSize="120" avatarShape="square" :rowsHeight="28"
+					:titleHeight="32"></u-skeleton>
+			</view>
+		</template>
+		<template v-else>
+			<view class="banner-box">
+				<u--image v-if="swiperList.length == 1" :src="swiperList[0]" mode="aspectFill" :fade="true"
+					duration="450" :lazy-load="true" width="100%" height="340rpx"></u--image>
+				<u-swiper v-else :list="swiperList" @change="change" @click="toLinkPage" :autoplay="false" radius="0"
+					height="340rpx"></u-swiper>
+			</view>
+			<view class="hospital-box">
+				<view class="hospital-list">
+					<view class="hospital-item" v-for="item,index in hospitalList" :key="index">
+						<u--image :src="item.logoUrl" mode="aspectFill" :fade="true" duration="450" :lazy-load="true"
+							width="262rpx" height="200rpx"></u--image>
+						<view class="hospital-info">
+							<view class="info-top">
+								<view class="hospital-name">{{item.name || '-'}}</view>
+								<view class="hospital-distance">{{item.relativeDistance || 0}}{{item.distanceUnit}}
+								</view>
+							</view>
+							<view class="info-bottom">
+								<view class="info-bottom-l">
+									<span class="hospital-address">
+										<u-icon name="map-fill" color="#999999" size="14"></u-icon>
+										<span class="address">{{item.address || '-'}}</span>
+									</span>
+									<!-- <view class="hospital-area">所在区:{{item.areaName || '-'}}</view> -->
+								</view>
+							</view>
+							<view class="btn-box">
+								<view class="hospital-btn" @click="toPlaceOrder(item)">去下单</view>
 							</view>
-						</view>
-						<view class="btn-box">
-							<view class="hospital-btn" @click="toPlaceOrder(item)">去下单</view>
 						</view>
 					</view>
 				</view>
+				<view class="footer-box">
+					<image src="/static/icon-home.png" mode="aspectFill"></image>
+					<span class="tip">润康优护为你提供服务</span>
+				</view>
 			</view>
-		</view>
+
+		</template>
 	</view>
 </template>
 
@@ -57,22 +76,40 @@
 				total: 0,
 			};
 		},
-		onLoad() {
+		async onLoad() {
 			//获取当前定位信息
-			uni.getLocation({
-				type: 'gcj02',
-				success: (res) => {
-					console.log('当前位置的经度:' + res.longitude);
-					console.log('当前位置的纬度:' + res.latitude);
-					this.coordinates = res.longitude + ',' + res.latitude;
-					this.getList();
-				}
-			});
+			// uni.getLocation({
+			// 	type: 'gcj02',
+			// 	success: (res) => {
+			// 		console.log('当前位置的经度:' + res.longitude);
+			// 		console.log('当前位置的纬度:' + res.latitude);
+			// 		this.coordinates = res.longitude + ',' + res.latitude;
+			// 		this.getList();
+			// 	}
+			// });
+			this.realoadData();
 		},
 		onShow() {
-			this.getBannerList();
+			 wx.showShareMenu({
+			    withShareTicket: true,
+			    menus: ['shareAppMessage', 'shareTimeline']
+			  });
+
 		},
 		methods: {
+			async realoadData() {
+				let data = await this.$utils.getLocation();
+				if (data) {
+					console.log('当前位置的经度:' + data.long);
+					console.log('当前位置的纬度:' + data.lat);
+					this.coordinates = data.long + ',' + data.lat;
+					this.getList();
+				} else {
+					this.coordinates = undefined;
+					this.getList();
+				}
+				this.getBannerList();
+			},
 			getList() {
 				let that = this;
 				uni.showLoading({
@@ -80,19 +117,16 @@
 					mask: true,
 				});
 				let param = {
-					// pageNo: that.pageNo,
-					// pageSize: that.pageSize,
 					coordinates: that.coordinates
 				};
 				getHospitalList(param).then(res => {
 					let data = res.data;
 					if (data) {
-						this.hospitalList.push(...data); //在列表后面新增新获取的数据
-						// this.total = data.total; //获取数据总页数
-						if (this.hospitalList.length >= this.total) {
-							this.status = 'nomore';
-							return;
-						}
+						this.hospitalList = data; //在列表后面新增新获取的数据
+						// if (this.hospitalList.length >= this.total) {
+						// 	this.status = 'nomore';
+						// 	return;
+						// }
 					} else {
 						that.status = 'nomore';
 					}
@@ -131,9 +165,9 @@
 			//下拉刷新
 			onPullDownRefresh() {
 				this.pageNo = 1;
+				this.swiperList = [];
 				this.hospitalList = [];
-				this.getList();
-				this.getBannerList();
+				this.realoadData();
 				uni.stopPullDownRefresh();
 			},
 			//上拉加载
@@ -145,6 +179,21 @@
 				this.currents = index;
 			},
 
+			/**
+			 * 用户点击右上角分享
+			 */
+			onShareAppMessage: function() {
+				const nickName = '您的好友'
+				const title = '润护通为您提供服务',
+					path = `/pages/tabBar/index`
+					// imageUrl = 'https://www.baidu.com.cn/img/20211108/activity.png'
+				return {
+					title,
+					path
+					// imageUrl
+				};
+			}
+
 
 		}
 	}
@@ -152,6 +201,9 @@
 
 <style lang="scss" scoped>
 	.container {
+		background-color: #fff;
+		min-height: 100vh;
+
 		.banner-box {
 			width: 100%;
 			height: 340rpx;
@@ -160,35 +212,44 @@
 				width: 100%;
 				height: 340rpx !important;
 			}
+
+			.u--image {
+				width: 100%;
+				height: 340rpx !important;
+			}
 		}
 
 		.hospital-box {
+			display: flex;
+			flex-direction: column;
+			min-height: calc(100vh - 340rpx);
 			background-color: #fff;
 
 			.hospital-list {
-				padding: 0 30rpx;
+				padding: 0 30rpx 40rpx;
+				flex: 1;
 
 				.hospital-item {
 					display: flex;
 					align-items: center;
 					justify-content: center;
 					padding: 30rpx 0;
-					margin-bottom: 30rpx;
-					border-bottom: 1rpx solid #E8E8E8;
+					border-bottom: 1rpx solid #f0f0f0;
 
-					&:last-child {
-						border-bottom: none;
-					}
+					// &:last-child {
+					// 	border-bottom: none;
+					// }
 
-					image {
-						width: 262rpx;
-						height: 200rpx;
-						border-radius: 20rpx;
-						margin-right: 17rpx;
-					}
+					// image {
+					// 	width: 262rpx;
+					// 	height: 200rpx;
+					// 	border-radius: 20rpx;
+					// 	margin-right: 17rpx;
+					// }
 
 					.hospital-info {
 						flex: 1;
+						margin-left: 17rpx;
 
 						.info-top {
 							display: flex;
@@ -295,5 +356,41 @@
 				}
 			}
 		}
+
+		.footer-box {
+			display: flex;
+			justify-content: center;
+			align-items: center;
+			// position: fixed;
+			// bottom: 0;
+			// left: 0;
+			width: 100%;
+			padding: 32rpx 0;
+			background-color: #fff;
+
+			image {
+				width: 25rpx;
+				height: 25rpx;
+			}
+
+			.tip {
+				margin-left: 7rpx;
+				color: #B3B3B3;
+				font-size: 26rpx;
+				line-height: 26rpx;
+			}
+		}
+	}
+
+
+	/* 骨架屏容器样式 */
+	.skeleton-full {
+		width: 100%;
+		height: 100%;
+	}
+
+	/* 关键:使用深度选择器修改骨架屏内部样式 */
+	::v-deep .u-skeleton__wrapper__content__rows {
+		width: 100% !important;
 	}
 </style>

+ 5 - 3
pages/tabBar/mine.vue

@@ -9,7 +9,7 @@
 			<view class="user-info-box">
 				<view class="info-box-l">
 					<view class="img-box">
-						<u-avatar :src="userInfo.avatar || ''" size="121rpx" mode="aspectFill"></u-avatar>
+						<u-avatar :src="userInfo.avatar || defaultImg" size="121rpx" mode="aspectFill"></u-avatar>
 					</view>
 					<view class="info-r">
 						<span class="name" v-if="isLogin" @click="toUserInfo">{{userInfo.nickname || '-'}}</span>
@@ -75,6 +75,7 @@
 	export default {
 		data() {
 			return {
+				defaultImg: require('@/static/default-head-photo.png'),
 				// defaultImg: this.getImgSrc('shop/pro.jpg'),
 				// more3: this.getImgSrc('my/more_3.png'),
 				userInfo: {},
@@ -155,7 +156,7 @@
 								title: '退出中'
 							});
 							uni.removeStorageSync('apiToken')
-							uni.removeStorageSync('userInfo')
+							uni.removeStorageSync('USER_INFO')
 							setTimeout(() => {
 								uni.reLaunch({
 									url: '/pages/tabBar/index'
@@ -317,6 +318,7 @@
 							height: 36rpx;
 							line-height: 36rpx;
 							justify-content: center;
+							font-weight: bold;
 							// background-color: #FFF9D9;
 							// color: #B16E55;
 							// border-radius: 50rpx;
@@ -350,7 +352,7 @@
 
 		.func-box {
 			padding: 30rpx 0;
-			box-shadow: 10rpx 5rpx 20rpx #f1f1f1;
+			box-shadow: 0rpx 0rpx 20rpx #f1f1f1;
 			border-radius: 20rpx;
 
 			.func-item {

+ 80 - 31
pages/tabBar/order.vue

@@ -34,7 +34,7 @@
 						<span class="price">¥{{item.totalPrice || '-'}}</span>
 					</view>
 				</view>
-				<u-line></u-line>
+				<u-line color="#f0f0f0"></u-line>
 				<view class="order-b-box">
 					<view class="order-b-box-l">
 						<view class="order-b-item">
@@ -51,18 +51,21 @@
 						</view>
 					</view>
 					<view class="order-b-box-r">
-						<span class="status">{{getStatusTxt(item.status)}}</span>
+						<span class="status"
+							:class="item.status == 6 ? 'cancle' : ''">{{getStatusTxt(item.status)}}</span>
 					</view>
 				</view>
-				<u-line></u-line>
+				<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" @click.stop="cancleOrder">取消订单</span>
+					<span class="btn" v-if="item.status !=6" @click.stop="cancleOrder(item.id)">取消订单</span>
 				</view>
 			</view>
 		</view>
 		<view class="empty-box" v-if="!orderList.length">
-			<u-empty marginTop="100" style="width: 100%;"></u-empty>
+			<u-image src="/static/none.png" mode="aspectFill" width="582rpx" height="582rpx"></u-image>
+			<span class="empty-txt">暂无数据!</span>
+			<!-- <u-empty marginTop="100" style="width: 100%;"></u-empty> -->
 		</view>
 		<view style="width: 100%;padding-bottom: 40rpx;" v-else>
 			<u-loadmore :status="status" :loading-text="loadingText" :loadmore-text="loadmoreText"
@@ -74,7 +77,8 @@
 <script>
 	import {
 		getOrderList,
-		getOrderStatus
+		getOrderStatus,
+		cancelOrder
 	} from "@/api/order.js"
 	export default {
 		data() {
@@ -99,6 +103,7 @@
 					10: ''
 				},
 				current: 0,
+				isFirst: true,
 			}
 		},
 		onLoad(option) {
@@ -123,54 +128,92 @@
 
 				}
 			}
-			
-			this.init();
+			console.log('onLoad');
+
+
 		},
 		onShow() {
-			// 获取全局参数
-			const app = getApp();
-			if (app.globalData.switchTabParams) {
-				const params = app.globalData.switchTabParams;
-				console.log('接收到的参数:', params);
-				if (params.reload) {
-					this.init()
-					// 使用完后可以清除
-					app.globalData.switchTabParams = null;
-					return
+			if (this.isFirst) {
+				this.isFirst = false;
+				this.init();
+			} else {
+				// 获取全局参数
+				const app = getApp();
+				if (app.globalData.switchTabParams) {
+					const params = app.globalData.switchTabParams;
+					console.log('接收到的参数:', params);
+					if (params.reload) {
+						console.log('onShow');
+						this.init()
+						// 使用完后可以清除
+						app.globalData.switchTabParams = null;
+						return
+					} else {
+
+					}
+
 				}
-			
 			}
+
 		},
 		methods: {
 			init() {
+				console.log("初始化");
 				this.getOrderList("reload")
 				this.getOrderStatus();
 			},
 			changeTab(item) {
 				// console.log("item", item);
-				this.orderStatus = item.code
-				this.getOrderList("reload")
+				this.pageNum = 1;
+				this.orderList = [];
+				this.orderStatus = item.code;
+				this.getOrderList("reload");
 			},
 			getStatusTxt(value) {
 				let obj = this.typeList.find(item => item.code == value);;
 				return obj ? obj.value : '-'
 			},
 
+			cancleOrder(id) {
+				//确认是否删除
+				uni.showModal({
+					title: '提示',
+					content: '确定取消订单吗?',
+					success: (res) => {
+						if (res.confirm) {
+							console.log('用户点击确定');
+							cancelOrder(id).then(res => {
+								if (res.code == 200) {
+									uni.showToast({
+										title: '取消成功',
+										icon: 'success'
+									})
+									this.init()
+								}
+							})
+						} else if (res.cancel) {
+							console.log('用户点击取消');
+						}
+					},
+				})
+			},
+
 			getOrderList(reload) {
 				// 验证登录
 				// let token = uni.getStorageSync('apiToken');
 				// if (!token) return
+				let that = this;
 				if (reload) {
-					this.orderList = [];
+					that.pageNum = 1;
+					that.orderList = [];
 				}
-				let that = this;
 				uni.showLoading({
 					title: '加载中',
 					mask: true,
 				});
 				let param = {
-					status: this.orderStatus,
-					serviceName: this.serviceName,
+					status: that.orderStatus,
+					serviceName: that.serviceName,
 					pageNum: that.pageNum,
 					pageSize: that.pageSize,
 				};
@@ -178,10 +221,10 @@
 				getOrderList(param).then(res => {
 						let data = res.rows;
 						if (data) {
-							this.orderList.push(...data); //在列表后面新增新获取的数据
-							this.total = res.total; //获取数据总页数
-							if (this.orderList.length >= this.total) {
-								this.status = 'nomore';
+							that.orderList.push(...data); //在列表后面新增新获取的数据
+							that.total = res.total; //获取数据总页数
+							if (that.orderList.length >= that.total) {
+								that.status = 'nomore';
 								return;
 							}
 						} else {
@@ -204,7 +247,7 @@
 							let data = res.data.orderStatus;
 							data.unshift({
 								value: '全部',
-								code: '',
+								code: undefined,
 							})
 							this.typeList = data;
 						}
@@ -297,7 +340,8 @@
 						margin-top: 15rpx;
 						font-size: 24rpx;
 						color: #6F6F6F;
-						.icon{
+
+						.icon {
 							width: 40rpx;
 							height: 40rpx;
 							margin-left: 10rpx;
@@ -332,6 +376,7 @@
 
 				.order-b-box-l {
 					flex: 1;
+
 					.order-b-item {
 						margin-bottom: 15rpx;
 
@@ -357,6 +402,10 @@
 					text-align: right;
 					font-size: 24rpx;
 					color: #0085FF;
+
+					.cancle {
+						color: #FF0000;
+					}
 				}
 			}
 

二進制
static/banner.png


二進制
static/default-head-photo.png


二進制
static/home_title.png


二進制
static/home_titleCopy.png


二進制
static/icon-home.png


二進制
static/none.png


二進制
static/tabBar1/giftPackageCenter-active.png


二進制
static/tabBar1/giftPackageCenter.png


二進制
static/tabBar1/home-active.png


二進制
static/tabBar1/home.png


二進制
static/tabBar1/mine-active.png


二進制
static/tabBar1/mine.png


二進制
static/tabBar1/order-active.png


二進制
static/tabBar1/order.png


+ 175 - 1
utils/index.js

@@ -78,7 +78,7 @@ export default {
 				return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
 		}
 	},
-	
+
 	//复制
 	copyTxt(text) {
 		uni.setClipboardData({
@@ -258,5 +258,179 @@ export default {
 				re(res.data)
 			}).catch(e => so(e))
 		})
+	},
+
+	// 定位授权
+	async getLocation() {
+		return new Promise((resolve, reject) => {
+			let that = this;
+			// 1、判断手机定位服务【GPS】 是否授权
+			uni.getSystemInfo({
+				success(res) {
+					// console.log("判断手机定位服务是否授权:", res);
+					let locationEnabled = res.locationEnabled; //判断手机定位服务是否开启
+					let locationAuthorized = res.locationAuthorized; //判断定位服务是否允许微信授权
+					// console.log("判断手机定位服务是否开启",locationEnabled);
+					// console.log("判断定位服务是否允许微信授权",locationAuthorized);
+					if (locationEnabled == false || locationAuthorized == false) {
+						//手机定位服务(GPS)未授权
+						uni.showToast({
+							title: '请打开手机GPS',
+							icon: 'none',
+						});
+						resolve(false);
+					} else {
+						//手机定位服务(GPS)已授权
+						// 2、判断微信小程序是否授权位置信息
+						// 微信小程序已授权位置信息
+						uni.authorize({
+							//授权请求窗口
+							scope: 'scope.userLocation', //授权的类型
+							success: async (res) => {
+								resolve(await that.fnGetlocation());
+							},
+							fail: (err) => {
+								err = err['errMsg'];
+								uni.showModal({
+										content: '需要授权位置信息',
+										confirmText: '确认授权',
+									}).then((obj) => {
+										console.log('obj', obj);
+										if (obj.confirm) {
+											uni.openSetting({
+												success: async (set) => {
+													if (set.authSetting[
+															'scope.userLocation'
+														]) {
+														// 授权成功
+														uni.showToast({
+															title: '授权成功',
+															icon: 'none',
+														});
+														resolve(
+															await that.fnGetlocation()
+														);
+													} else {
+														// 未授权
+														uni.showToast({
+															title: '授权失败,请重新授权',
+															icon: 'none',
+														});
+														uni.showModal({
+															title: '授权',
+															content: '获取授权' +
+																'失败,是否前往授权设置?',
+															success: function(result) {
+																if (result.confirm) {
+																	uni.openSetting();
+																}
+															},
+															fail: function() {
+																uni.showToast({
+																	title: '系统错误!',
+																	icon: 'none',
+																});
+															},
+														});
+													}
+												},
+											});
+										} else {
+											resolve(false);
+											// 取消授权
+											uni.showToast({
+												title: '你拒绝了授权,无法获得周边信息',
+												icon: 'none',
+											});
+										}
+									});
+							},
+							// async complete(res) {
+							//   // console.log('授权弹框', res);
+							//   if (res.errMsg == 'authorize:ok') {
+							//     resolve(await fnGetlocation());
+							//   } else {
+							//     uni.showModal({
+							//       title: '授权',
+							//       content: '获取授权失败,是否前往授权设置?',
+							//       success: function (result) {
+							//         if (result.confirm) {
+							//           uni.openSetting();
+							//         }
+							//       },
+							//       fail: function () {
+							//         uni.showToast({
+							//           title: '系统错误!',
+							//           icon: 'none',
+							//         });
+							//       },
+							//     });
+							//   }
+							// },
+						});
+					}
+				},
+			});
+		});
+	},
+	// 定位获取
+	async fnGetlocation() {
+		return new Promise((resolve, reject) => {
+			let that = this;
+			let bindList = {
+				long: '',
+				lat: '',
+				longlat: '',
+				isLocated: false,
+			};
+			uni.getLocation({
+				type: 'wgs84', //默认为 wgs84 返回 gps 坐标
+				geocode: 'true',
+				isHighAccuracy: 'true',
+				accuracy: 'best', // 精度值为20m
+				success: function(res) {
+					let platform = uni.getSystemInfoSync().platform;
+					if (platform == 'ios') {
+						//toFixed() 方法可把 Number 四舍五入为指定小数位数的数字。
+						bindList.long = res.longitude.toFixed(6);
+						bindList.lat = res.latitude.toFixed(6);
+					} else {
+						bindList.long = res.longitude;
+						bindList.lat = res.latitude;
+					}
+					resolve(bindList);
+				},
+				fail(err) {
+					if (
+						err.errMsg ===
+						'getLocation:fail 频繁调用会增加电量损耗,可考虑使用 wx.onLocationChange 监听地理位置变化'
+					) {
+						uni.showToast({
+							title: '请勿频繁定位',
+							icon: 'none',
+						});
+					}
+					if (err.errMsg === 'getLocation:fail auth deny') {
+						// 未授权
+						uni.showToast({
+							title: '无法定位,请重新获取位置信息',
+							icon: 'none',
+						});
+						authDenyCb && authDenyCb();
+						bindList.isLocated = false;
+						resolve(bindList);
+					}
+					if (err.errMsg === 'getLocation:fail:ERROR_NOCELL&WIFI_LOCATIONSWITCHOFF') {
+						uni.showModal({
+							content: '请开启手机定位服务',
+							showCancel: false,
+						});
+					}
+				},
+			});
+		});
 	}
+
+
+
 }