chubiao преди 1 година
родител
ревизия
de1b145f9a
променени са 5 файла, в които са добавени 318 реда и са изтрити 203 реда
  1. 2 1
      config.js
  2. 31 0
      libs/amap-wx.130.js
  3. 33 16
      manifest.json
  4. 168 184
      pages/lr/add.vue
  5. 84 2
      pages/my/index.vue

+ 2 - 1
config.js

@@ -1,5 +1,6 @@
 const build = {
-	"service" : "https://www.baidu.com"
+	"service" : "https://www.baidu.com",
+	"gaodeKey":"e6b77a8d407630b07f915c0f40eebd15"
 }
 
 

Файловите разлики са ограничени, защото са твърде много
+ 31 - 0
libs/amap-wx.130.js


+ 33 - 16
manifest.json

@@ -23,27 +23,27 @@
             /* android打包配置 */
             "android" : {
                 "permissions" : [
-                    "<uses-permission android:name=\"android.permission.CHANGE_NETWORK_STATE\"/>",
-                    "<uses-permission android:name=\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\"/>",
-                    "<uses-permission android:name=\"android.permission.VIBRATE\"/>",
-                    "<uses-permission android:name=\"android.permission.READ_LOGS\"/>",
-                    "<uses-permission android:name=\"android.permission.ACCESS_WIFI_STATE\"/>",
+                    "<uses-feature android:name=\"android.hardware.camera\"/>",
                     "<uses-feature android:name=\"android.hardware.camera.autofocus\"/>",
-                    "<uses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\"/>",
                     "<uses-permission android:name=\"android.permission.CAMERA\"/>",
-                    "<uses-permission android:name=\"android.permission.GET_ACCOUNTS\"/>",
-                    "<uses-permission android:name=\"android.permission.READ_PHONE_STATE\"/>",
-                    "<uses-permission android:name=\"android.permission.CHANGE_WIFI_STATE\"/>",
-                    "<uses-permission android:name=\"android.permission.WAKE_LOCK\"/>",
+                    "<uses-permission android:name=\"android.permission.CHANGE_NETWORK_STATE\"/>",
                     "<uses-permission android:name=\"android.permission.FLASHLIGHT\"/>",
-                    "<uses-feature android:name=\"android.hardware.camera\"/>",
-                    "<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>"
+                    "<uses-permission android:name=\"android.permission.GET_ACCOUNTS\"/>",
+                    "<uses-permission android:name=\"android.permission.VIBRATE\"/>",
+                    "<uses-permission android:name=\"android.permission.WAKE_LOCK\"/>"
                 ]
             },
             /* ios打包配置 */
             "ios" : {},
             /* SDK配置 */
-            "sdkConfigs" : {}
+            "sdkConfigs" : {
+                "maps" : {
+                    "amap" : {
+                        "appkey_ios" : "",
+                        "appkey_android" : ""
+                    }
+                }
+            }
         }
     },
     /* 快应用特有相关 */
@@ -52,9 +52,21 @@
     "mp-weixin" : {
         "appid" : "wx3698a63d3e6b3652",
         "setting" : {
-            "urlCheck" : false
+            "urlCheck" : false,
+            "es6" : true,
+            "minified" : true,
+            "postcss" : true
         },
-        "usingComponents" : true
+        "usingComponents" : true,
+		"requiredPrivateInfos":[
+			"getLocation",
+			"chooseLocation"
+		],
+        "permission" : {
+            "scope.userLocation" : {
+                "desc" : "获取您的位置信息"
+            }
+        }
     },
     "mp-alipay" : {
         "usingComponents" : true
@@ -68,5 +80,10 @@
     "uniStatistics" : {
         "enable" : false
     },
-    "vueVersion" : "2"
+    "vueVersion" : "2",
+    "h5" : {
+        "sdkConfigs" : {
+            "maps" : {}
+        }
+    }
 }

+ 168 - 184
pages/lr/add.vue

@@ -11,23 +11,50 @@
 				<uni-forms ref="baseForm" :modelValue="baseFormData" :rules="rules">
 					<uni-forms-item label="照片">
 						<uni-file-picker v-model="baseFormData.tx" limit="1" fileMediatype="image" @select="select"
-							@progress="progress" @success="success" @fail="fail">
-
-						</uni-file-picker>
+							@progress="progress" @success="success" @fail="fail" />
 					</uni-forms-item>
-					<uni-forms-item label="姓名" required>
-						<uni-easyinput v-model="baseFormData.khxm" placeholder="请输入客户姓名" />
+					<uni-forms-item label="姓名" required name="khxm">
+						<uni-easyinput v-model="baseFormData.khxm" placeholder="请输入姓名" />
 					</uni-forms-item>
-					<uni-forms-item label="性别" required>
+					<uni-forms-item label="性别" required name="xb">
 						<uni-data-select v-model="baseFormData.xb" placeholder="请选择性别" :localdata="sexData" />
 					</uni-forms-item>
-					<uni-forms-item label="民族" required>
+					<uni-forms-item label="民族" required name="mz">
 						<uni-data-select v-model="baseFormData.mz" placeholder="请选择民族" :localdata="mzData" />
 					</uni-forms-item>
-					<uni-forms-item label="手机号" required>
+					<uni-forms-item label="手机号" required name="sjhm">
 						<uni-easyinput v-model="baseFormData.sjhm" placeholder="请输入手机号" />
 					</uni-forms-item>
-					<button @click="submit('baseForm')">Submit</button>
+					<uni-forms-item label="出生日期">
+						<uni-datetime-picker type="data" v-model="baseFormData.csrq" placeholder="请选择出生日期" />
+					</uni-forms-item>
+					<uni-forms-item label="身高">
+						<uni-easyinput type="number" v-model="baseFormData.sg" placeholder="身高单位:cm" />
+					</uni-forms-item>
+					<uni-forms-item label="体重">
+						<uni-easyinput type="number" v-model="baseFormData.tz" placeholder="体重单位:kg" />
+					</uni-forms-item>
+					<uni-forms-item label="婚姻状况">
+						<uni-data-select v-model="baseFormData.hyzk" placeholder="请选择婚姻状况" :localdata="hyzkData" />
+					</uni-forms-item>
+					<uni-forms-item label="能力状况">
+						<uni-data-select v-model="baseFormData.nlpg" placeholder="请选择能力状况" :localdata="nlzkData" />
+					</uni-forms-item>
+					<uni-forms-item label="居住地址">
+						<uni-easyinput v-model="baseFormData.xjd" placeholder="请输入居住地址" />
+					</uni-forms-item>
+					<uni-forms-item label="定位">
+						<view @click="openChooseLocation">
+							<uni-easyinput v-model="baseFormData.dw" placeholder="请选择定位" disabled/>
+						</view>
+					</uni-forms-item>
+					<uni-forms-item label="监护人">
+						<uni-easyinput v-model="baseFormData.jhr" placeholder="请输入监护人姓名" />
+					</uni-forms-item>
+					<uni-forms-item label="监护人手机号码">
+						<uni-easyinput v-model="baseFormData.jhrsjhm" placeholder="请输入监护人手机号码" />
+					</uni-forms-item>
+					<button type="primary" @click="add('baseForm')">提交</button>
 				</uni-forms>
 
 			</uni-section>
@@ -41,6 +68,9 @@
 </template>
 
 <script>
+	import amapFile from "@/libs/amap-wx.130.js";
+	import config from "../../config.js";
+
 	export default {
 		data() {
 			return {
@@ -55,15 +85,46 @@
 					title: '病史记录'
 				}],
 				rules: {
-					sjhm: {
+					khxm: {
+						rules: [{
+							required: true,
+							errorMessage: '姓名不能为空'
+						}]
+					},
+					xb: {
+						rules: [{
+							required: true,
+							errorMessage: '请选择性别'
+						}]
+					},
+					mz: {
 						rules: [{
-							format: 'number',
-							pattern: '/^(13[0-9]|14[01456879]|15[0-35-9]|16[2567]|17[0-8]|18[0-9]|19[0-35-9])\d{8}$/',
-							errorMessage: '请输入正确的手机号',
+							required: true,
+							errorMessage: '请选择民族'
 						}]
+					},
+					sjhm: {
+						rules: [{
+								required: true,
+								errorMessage: '请输入手机号'
+							},
+							{
+								format: 'number',
+								errorMessage: '请输入正确的手机号',
+							},
+							{
+								pattern: '^(((13[0-9]{1})|(15[0-9]{1})|(18[0-9]{1})|(17[0-9]{1}))+\\d{8})$',
+								errorMessage: '请输入正确的手机号',
+							}
+						]
 					}
 				},
-				baseFormData: [],
+				baseFormData: {
+					khxm: '',
+					lng: '',
+					lat: '',
+					dw: ''
+				},
 				sexData: [{
 						value: 1,
 						text: "男性"
@@ -89,15 +150,73 @@
 						value: "03",
 						text: "回族"
 					},
-				]
+				],
+				hyzkData: [{
+						value: "10",
+						text: "未婚"
+					},
+					{
+						value: "20",
+						text: "已婚"
+					}
+				],
+				nlzkData: [{
+						value: "0",
+						text: "能力完好"
+					},
+					{
+						value: "1",
+						text: "轻度失能"
+					}
+				],
+				myAmapFunT: '',
+				startPoint: {
+					latitude: 43.834931,
+					longitude: 125.289036
+				}
 			}
 
 		},
-		computed: {},
-		onLoad() {},
-		onReady() {},
+		onLoad() {
+			console.log("wwwwwwwwwwww", config.gaodeKey)
+			this.myAmapFunT = new amapFile.AMapWX({
+				key: config.gaodeKey
+			})
+		},
 		methods: {
-			submit(ref) {
+			async openChooseLocation(opt) {
+				let that = this
+				await uni.chooseLocation({
+					latitude: opt?.latitude || that.startPoint.latitude,
+					longitude: opt?.longitude || that.startPoint.longitude,
+					success: function(res) {
+						// console.log(res)
+						// console.log('位置名称:' + res.name);
+						// console.log('详细地址:' + res.address);
+						// console.log('纬度:' + res.latitude);
+						// console.log('经度:' + res.longitude);
+
+						that.baseFormData.dw = res.name
+						that.baseFormData.lng = res.longitude
+						that.baseFormData.lat = res.latitude
+
+
+						if (!res.name) {
+							return uni.showToast({
+								title: '请重新选择位置',
+								icon: 'none'
+							});
+						}
+
+					},
+					fail: function(info) { //失败回调
+						console.log('调取失败')
+						console.log(info)
+					},
+
+				})
+			},
+			add(ref) {
 				this.$refs[ref].validate().then(res => {
 					console.log('success', res);
 					uni.showToast({
@@ -106,113 +225,13 @@
 				}).catch(err => {
 					console.log('err', err);
 				})
-			},
+			}
 		}
 	}
 </script>
 
 
-// <script setup>
-	// 	import {
-	// 		ref,
-	// 		getCurrentInstance,
-	// 		onMounted
-	// 	} from "vue";
 
-	// 	import {onShow, onReady, onLoad} from '@dcloudio/uni-app'
-
-	// 	// 获取当前组件实例
-	// 	const { proxy }  = getCurrentInstance(); 
-	// 	const active = ref(1)
-	// 	const list = ref([{
-	// 		title: '基本信息'
-	// 	}, {
-	// 		title: '健康档案'
-	// 	}, {
-	// 		title: '家庭信息'
-	// 	}, {
-	// 		title: '病史记录'
-	// 	}])
-	// 	// const baseForm = ref(null)
-	// 	const rules = ref({
-	// 		'baseFormData.sjhm': {
-	// 			rules: [{
-	// 				format: 'number',
-	// 				pattern: '/^(13[0-9]|14[01456879]|15[0-35-9]|16[2567]|17[0-8]|18[0-9]|19[0-35-9])\d{8}$/',
-	// 				errorMessage: '请输入正确的手机号',
-	// 			}]
-	// 		}
-	// 	})
-	// 	const baseFormData = ref([])
-	// 	const sexData = ref([{
-	// 			value: 1,
-	// 			text: "男性"
-	// 		},
-	// 		{
-	// 			value: 2,
-	// 			text: "女性"
-	// 		},
-	// 		{
-	// 			value: 9,
-	// 			text: "未说明的性别"
-	// 		},
-	// 	])
-	// 	const mzData = ref([{
-	// 			value: "01",
-	// 			text: "汉族"
-	// 		},
-	// 		{
-	// 			value: "02",
-	// 			text: "蒙古族"
-	// 		},
-	// 		{
-	// 			value: "03",
-	// 			text: "回族"
-	// 		},
-	// 	])
-	// 	onMounted(() => {
-	// 	})
-	// 	onReady(() => {
-
-	// 	})
-	// 	function change() {
-	// 		if (active.value < list.value.length - 1) {
-	// 			active.value += 1
-	// 		} else {
-	// 			active.value = 0
-	// 		}
-	// 	}
-
-	// 	// 照片获取上传状态
-	// 	function select(e) {
-	// 		console.log('选择文件:', e)
-	// 	}
-	// 	// 照片获取上传进度
-	// 	function progress(e) {
-	// 		console.log('上传进度:', e)
-	// 	}
-
-	// 	// 照片上传成功
-	// 	function success(e) {
-	// 		console.log('上传成功')
-	// 	}
-
-	// 	// 照片上传失败
-	// 	function fail(e) {
-	// 		console.log('上传失败:', e)
-	// 	}
-
-	// 	// 表单提交
-	// 	function submit() {
-	// 		console.log('表单数据信息:',baseFormData.value);
-	// 		proxy.$refs.baseForm.validate().then(res => {
-	// 			console.log('表单数据信息:', res);
-	// 		}).catch(err => {
-	// 			console.log('表单错误信息:', err);
-	// 		})
-	// 	}
-	// 
-</script>
 
 <style lang="scss" scoped>
 	.line {
@@ -221,72 +240,37 @@
 		margin-top: 10px;
 	}
 
-	.image {
-		width: 25px;
-		height: 25px;
-	}
-
-	.text {
-		font-size: 14px;
-		margin-top: 5px;
-	}
+	// .map_container {
+	// 	position: absolute;
+	// 	top: 0;
+	// 	bottom: 80px;
+	// 	left: 0;
+	// 	right: 0;
+	// }
 
-	.example-body {
-		/* #ifndef APP-NVUE */
-		// display: block;
-		/* #endif */
-	}
+	// .map {
+	// 	width: 100%;
+	// 	height: 100%;
+	// }
 
-	.grid-dynamic-box {
-		margin-bottom: 15px;
-	}
+	// .map_text {
+	// 	position: absolute;
+	// 	left: 0;
+	// 	right: 0;
+	// 	bottom: 0px;
+	// 	height: 80px;
+	// 	background: #fff;
+	// 	padding: 0 15px;
+	// }
 
-	.grid-item-box {
-		flex: 1;
-		// position: relative;
-		/* #ifndef APP-NVUE */
-		display: flex;
-		/* #endif */
-		flex-direction: column;
-		align-items: center;
-		justify-content: center;
-		padding: 15px 0;
-	}
-
-	.grid-item-box-row {
-		flex: 1;
-		// position: relative;
-		/* #ifndef APP-NVUE */
-		display: flex;
-		/* #endif */
-		flex-direction: row;
-		align-items: center;
-		justify-content: center;
-		padding: 15px 0;
-	}
-
-	.grid-dot {
-		position: absolute;
-		top: 5px;
-		right: 15px;
-	}
-
-	.swiper {
-		height: 420px;
-	}
-
-	/* #ifdef H5 */
-	@media screen and (min-width: 768px) and (max-width: 1425px) {
-		.swiper {
-			height: 630px;
-		}
-	}
-
-	@media screen and (min-width: 1425px) {
-		.swiper {
-			height: 830px;
-		}
-	}
+	// text {
+	// 	margin: 5px 0;
+	// 	display: block;
+	// 	font-size: 12px;
+	// }
 
-	/* #endif */
+	// .h1 {
+	// 	margin: 15px 0;
+	// 	font-size: 15px;
+	// }
 </style>

+ 84 - 2
pages/my/index.vue

@@ -1,5 +1,18 @@
 <template>
-
+	<view>
+		<!-- 	<view class="map_container">
+			<map class="map" ref="map" :longitude="longitude" :latitude="latitude" scale="14" show-location="true"
+				:markers="markers" @click="markertap"></map>
+		</view>
+		<view class="mapText">
+			{{address}}
+		</view> -->
+		<view class="search-box" @click="openChooseLocation">
+	
+				qqqqq1
+		
+		</view>
+	</view>
 
 </template>
 
@@ -9,15 +22,25 @@
 		onReachBottom
 	} from "@dcloudio/uni-app"
 
+	import amapFile from "@/libs/amap-wx.130.js";
+	import config from "../../config.js";
+
 	export default {
 		data() {
 			return {
-
+				myAmapFunT: '',
+				startPoint: {
+					latitude:43.834931,
+					longitude:125.289036
+				}
 			}
 
 		},
 		computed: {},
 		onLoad: function(options) {
+			this.myAmapFunT = new amapFile.AMapWX({
+				key: config.gaodeKey
+			})
 			setTimeout(function() {
 				console.log('start pulldown');
 			}, 1000);
@@ -31,9 +54,68 @@
 			}, 1000);
 		},
 		methods: {
+			openChooseLocation(opt) {
+				let that = this
+				uni.chooseLocation({
+					latitude: opt?.latitude || that.startPoint.latitude,
+					longitude: opt?.longitude || that.startPoint.longitude,
+					success: function(res) {
+						console.log(res)
+						console.log('位置名称:' + res.name);
+						console.log('详细地址:' + res.address);
+						console.log('纬度:' + res.latitude);
+						console.log('经度:' + res.longitude);
+						if (!res.name) {
+							return uni.showToast({
+								title: '请重新选择位置',
+								icon: 'none'
+							});
+						}
+
+					},
+					fail: function(info) { //失败回调
+						console.log('调取失败')
+						console.log(info)
+					},
+
+				})
+			},
 
 		}
 	}
 </script>
 <style scoped>
+	.map_container {
+		position: absolute;
+		top: 20px;
+		bottom: 0;
+		left: 0;
+		right: 0;
+	}
+
+	.map {
+		width: 100%;
+		height: 100%;
+	}
+
+	.mapText {
+		position: absolute;
+		left: 0;
+		right: 0;
+		top: 0px;
+		height: 20px;
+		background: #fff;
+		padding: 0 15px;
+	}
+
+	text {
+		margin: 5px 0;
+		display: block;
+		font-size: 12px;
+	}
+
+	.h1 {
+		margin: 15px 0;
+		font-size: 15px;
+	}
 </style>