WIN-2CJ8FMUT9OF\Administrator 2 ay önce
ebeveyn
işleme
255b407a54

+ 6 - 0
api/valuation.js

@@ -0,0 +1,6 @@
+import {request} from '@/service/ajax'
+
+const newsUrl = '/api/client/'
+// 评估
+export const predictProperty = (data) => request(newsUrl + 'predict', 'post', { ...data },false)
+

+ 19 - 17
components/en-from/en-input/en-input.vue

@@ -2,7 +2,7 @@
 	<view class="wh-box">
 		<view class="row p-tb30" style="line-height: 30rpx;height: 30rpx;" :class="{'bor-bottom-1':is_border}">
 			<view class="wh-text size-28" :class="{'wh-text-long':isLong}">{{label}}<text></text></view>
-			<view class="row-c flex">
+			<view class="row-c flex" @click="inputBut">
 				<input class="wh-input sys-size-28 text-color-12 m-l40" placeholder-class="sys-size-28 text-color-999"
 					:maxlength="maxlength" :type="type" :focus="focus"
 					:placeholder="is_select ? '请选择' : placeholder?placeholder:`请输入${label}`" :disabled="disabled"
@@ -67,7 +67,7 @@
 			return {
 				inputValue: '',
 				showShake: false,
-        isLong:false
+				isLong: false
 			};
 		},
 		watch: {
@@ -83,20 +83,20 @@
 		},
 		mounted() {
 			this.inputValue = this.value
-      this.setLabelWidth()
+			this.setLabelWidth()
 		},
 		methods: {
 			nameInput(e) {
 				if (this.type === 'nickname') {
 					this.inputValue = e.detail.value
 				}
-
 			},
-      setLabelWidth(){
-        this.isLong=this.label.length>4
-      },
-			onSubmit() {
-
+			setLabelWidth() {
+				this.isLong = this.label.length > 4
+			},
+			onSubmit() {},
+			inputBut() {
+				this.$emit('inputBut')
 			}
 		}
 	}
@@ -119,7 +119,7 @@
 	}
 
 	.wh-text {
-		width: 110rpx;
+		width: 120rpx;
 		text-align: justify;
 		text-align-last: justify;
 		vertical-align: top;
@@ -135,10 +135,12 @@
 		display: inline-block;
 		overflow: hidden;
 	}
-  .wh-text-long {
-    width: 170rpx;
-  }
-  .wh-text-long:after{
-    width: 170rpx;
-  }
-</style>
+
+	.wh-text-long {
+		width: 170rpx;
+	}
+
+	.wh-text-long:after {
+		width: 170rpx;
+	}
+</style>

+ 1 - 1
components/en-from/en-select/en-select.vue

@@ -1,6 +1,6 @@
 <template>
 	<view class="box">
-		<view class="input-box" @click="showPickerObj">
+		<view class="input-box flex-shrink0" @click="showPickerObj">
 			<view class="input-box-left size-28" :style="{'letter-spacing':labelWidth}">
 				{{ label }}
 			</view>

+ 110 - 96
manifest.json

@@ -1,97 +1,111 @@
 {
-    "name" : "万汇融通云",
-    "appid" : "__UNI__E819C2B",
-    "description" : "",
-    "versionName" : "1.0.13",
-    "versionCode" : 101,
-    "transformPx" : false,
-    /* 5+App特有相关 */
-    "app-plus" : {
-        "usingComponents" : true,
-        "nvueStyleCompiler" : "万汇融通云",
-        "compilerVersion" : 3,
-        "splashscreen" : {
-            "alwaysShowBeforeRender" : true,
-            "waiting" : true,
-            "autoclose" : true,
-            "delay" : 0
-        },
-        /* 模块配置 */
-        "modules" : {},
-        /* 应用发布信息 */
-        "distribute" : {
-            /* 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.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.FLASHLIGHT\"/>",
-                    "<uses-feature android:name=\"android.hardware.camera\"/>",
-                    "<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>"
-                ]
-            },
-            /* ios打包配置 */
-            "ios" : {},
-            /* SDK配置 */
-            "sdkConfigs" : {},
-            "plugins" : {
-                "mp-weixin" : {
-                    "version" : "2.5.0"
-                }
-            }
-        }
-    },
-    /* 快应用特有相关 */
-    "quickapp" : {},
-    /* 小程序特有相关 */
-    "mp-weixin" : {
-        "appid" : "wx26b6136cd5860186",
-        "optimization" : {
-            "subPackages" : true
-        },
-        "setting" : {
-            "urlCheck" : false,
-            "minified" : true
-        },
-        "usingComponents" : true,
-        "version" : "2.5.0"
-    },
-    "mp-alipay" : {
-        "usingComponents" : true
-    },
-    "mp-baidu" : {
-        "usingComponents" : true
-    },
-    "mp-toutiao" : {
-        "usingComponents" : true
-    },
-    "uniStatistics" : {
-        "enable" : false
-    },
-    "vueVersion" : "2",
-    "h5" : {
-        "devServer" : {
-            "https" : false,
-            "proxy" : {
-                "/api" : {
-                    "target" : "https://test-api.wealfavor.cn/",
-                    "changeOrigin" : true,
-                    "secure" : false,
-                    "pathRewrite" : {
-                        "^/api" : "api"
-                    }
-                }
-            }
-        }
-    }
-}
+	"name": "万汇融通云",
+	"appid": "__UNI__E819C2B",
+	"description": "",
+	"versionName": "1.0.13",
+	"versionCode": 101,
+	"transformPx": false,
+	/* 5+App特有相关 */
+	"app-plus": {
+		"usingComponents": true,
+		"nvueStyleCompiler": "万汇融通云",
+		"compilerVersion": 3,
+		"splashscreen": {
+			"alwaysShowBeforeRender": true,
+			"waiting": true,
+			"autoclose": true,
+			"delay": 0
+		},
+		/* 模块配置 */
+		"modules": {},
+		/* 应用发布信息 */
+		"distribute": {
+			/* 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.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.FLASHLIGHT\"/>",
+					"<uses-feature android:name=\"android.hardware.camera\"/>",
+					"<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>"
+				]
+			},
+			/* ios打包配置 */
+			"ios": {},
+			/* SDK配置 */
+			"sdkConfigs": {
+				"maps": {
+					"amap": {
+						"name": "",
+						"appkey_ios": "",
+						"appkey_android": ""
+					}
+				}
+			},
+			"plugins": {
+				"mp-weixin": {
+					"version": "2.5.0"
+				}
+			}
+		}
+	},
+	/* 快应用特有相关 */
+	"quickapp": {},
+	/* 小程序特有相关 */
+	"mp-weixin": {
+		"appid": "wx26b6136cd5860186",
+		"optimization": {
+			"subPackages": true
+		},
+		"setting": {
+			"urlCheck": false,
+			"minified": true
+		},
+		"usingComponents": true,
+		"permission": {
+			"scope.userLocation": {
+				"desc": "你的位置信息将用于小程序位置接口的效果展示" // 这里会展示在授权弹窗上
+			}
+		},
+		"requiredPrivateInfos": ["getLocation","chooseLocation"],
+		"version": "2.5.0"
+	},
+	"mp-alipay": {
+		"usingComponents": true
+	},
+	"mp-baidu": {
+		"usingComponents": true
+	},
+	"mp-toutiao": {
+		"usingComponents": true
+	},
+	"uniStatistics": {
+		"enable": false
+	},
+	"vueVersion": "2",
+	"h5": {
+		"devServer": {
+			"https": false,
+			"proxy": {
+				"/api": {
+					"target": "https://test-api.wealfavor.cn/",
+					"changeOrigin": true,
+					"secure": false,
+					"pathRewrite": {
+						"^/api": "api"
+					}
+				}
+			}
+		}
+	}
+}

+ 5 - 5
pages.json

@@ -255,11 +255,11 @@
   "condition": {
     "current": 0,
     "list": [
-      // {
-      //   "name": "转换工具",
-      //   "path": "/pages/loan/loan",
-      //   "query": ""
-      // },
+      {
+        "name": "转换工具",
+        "path": "/pages/task/task",
+        "query": ""
+      }
       // {
       //   "name": "审核",
       //   "path": "/pages/login/await-audit",

+ 430 - 243
pages/task/task.vue

@@ -1,250 +1,437 @@
 <template>
-  <view class="total-page page-box task-bg">
-    <Nav title="法案查询" :genre="1" :toBack="true" is_fixed></Nav>
-    <view class="page-env-160">
-      <!-- 身份认证start -->
-      <view class="m-t20 m-lr30 text-color-12">
-
-        <view class="sys-background-fff r-20 p-lr30 p-t30">
-
-            <en-select v-model="propertyData.modelType" :local-data="typeOption" label="评估模型" placeholder="请选择评估模型"></en-select>
-            <en-input v-model="propertyData.address" label="评估地址" placeholder="请输入评估地址"></en-input>
-            <en-input v-model="propertyData.complexName" :label="'小区名称'" disabled="disabled" placeholder="请输入小区名称"> </en-input>
-            <en-input  :value="propertyData.lng+','+propertyData.lat"  disabled="disabled" label="评估坐标" placeholder="地址经纬度"></en-input>
-            <en-input v-model="propertyData.area" :label="'建筑面积'" placeholder="请输入建筑面积"> </en-input>
-            <en-select v-model="propertyData.district" :local-data="districtOption" :label="'所属区域'" placeholder="请选择所属区域"> </en-select>
-          </view>
-
-        </view>
-
-        <view class="sys-background-fff r-20 m-t20 p-lr30" v-if="propertyData.modelType===1">
-          <en-select v-model="propertyData.houseType" :local-data="houseTypeOption" label="房屋类型" placeholder="请选择房屋类型"></en-select>
-        </view>
-      <view class="sys-background-fff r-20 m-t20 p-lr30" v-if="propertyData.modelType===2">
-        <EnRadio v-model="propertyData.is_rent" label="是否出租" :list="statusOption"> </EnRadio>
-        <EnRadio v-model="propertyData.is_morgaged" label="是否抵押" :list="statusOption"> </EnRadio>
-        <EnRadio v-model="propertyData.is_occupied" label="是否占用" :list="statusOption"> </EnRadio>
-        <EnRadio v-model="propertyData.is_seizured" label="是否查封" :list="statusOption"> </EnRadio>
-      </view>
-      <view class="sys-background-fff r-20 m-t20 p-lr30" v-if="propertyData.modelType===3">
-        <en-select v-model="propertyData.level_id" :local-data="levelOption" :label="'土地等级'" placeholder="请选择土地等级"> </en-select>
-        <en-select v-model="propertyData.transfer_method" :local-data="transferMethodOption" :label="'出让方式'" placeholder="请选择出让方式"> </en-select>
-        <en-select v-model="propertyData.land_use" :local-data="landUseOption" :label="'土地用途'" placeholder="请选择土地用途"> </en-select>
-        <en-select v-model="propertyData.land_source" :local-data="landSourceOption" :label="'土地来源'" placeholder="请选择土地来源"> </en-select>
-        <en-input v-model="propertyData.age_limit" :label="'出让年限'" placeholder="请输入出让年限"> </en-input>
-        <en-input v-model="propertyData.investment" :label="'投资强度'" placeholder="请输入投资强度"> </en-input>
-        <en-input v-model="propertyData.plot_mix" :label="'最小容积'" placeholder="请输入最小容积率"> </en-input>
-        <en-input v-model="propertyData.plot_max" :label="'最大容积'" placeholder="请输入最大容积率"> </en-input>
-        <en-input v-model="propertyData.greening_mix" :label="'最小绿化'" placeholder="请输入最小绿化面积"> </en-input>
-        <en-input v-model="propertyData.greening_max" :label="'最大绿化'" placeholder="请输入最大绿化面积"> </en-input>
-        <en-input v-model="propertyData.height_mix" :label="'最小高度'" placeholder="请输入最小建筑高度"> </en-input>
-        <en-input v-model="propertyData.height_max" :label="'最大高度'" placeholder="请输入最大建筑高度"> </en-input>
-      </view>
-
-
-    </view>
-    <EnButton :text="'评估'" @onSubmit="onSubmit"></EnButton>
-    <uni-popup ref="consentObj">
-      <view class="iPhone-padding agreement-data sys-background-fff">
-
-      </view>
-
-    </uni-popup>
-  </view>
+	<view class="total-page page-box task-bg">
+		<Nav title="法案查询" :genre="1" :toBack="true" is_fixed></Nav>
+		<view class="page-env-160">
+			<!-- 身份认证start -->
+			<view class="m-t20 m-lr30 text-color-12">
+				<view class="sys-background-fff r-20 p-lr30 p-t30">
+					<en-select v-model="propertyData.modelType" :local-data="typeOption" label="评估模型"
+						placeholder="请选择评估模型"></en-select>
+					<en-input v-model="propertyData.address" label="评估地址" disabled="disabled" placeholder="请输入评估地址"
+						@inputBut="inputBut"></en-input>
+					<en-input v-model="propertyData.complexName" :label="'小区名称'" disabled="disabled"
+						placeholder="请输入小区名称"> </en-input>
+					<en-input :value="propertyData.lng+','+propertyData.lat" disabled="disabled" label="评估坐标"
+						placeholder="地址经纬度"></en-input>
+					<en-input v-model="propertyData.area" :label="'建筑面积'" placeholder="请输入建筑面积"> </en-input>
+					<en-select v-model="propertyData.district" :local-data="districtOption" :label="'所属区域'"
+						placeholder="请选择所属区域"> </en-select>
+				</view>
+			</view>
+			<view class="sys-background-fff r-20 m-t20 p-lr30" v-if="propertyData.modelType===1">
+				<en-select v-model="propertyData.houseType" :local-data="houseTypeOption" label="房屋类型"
+					placeholder="请选择房屋类型"></en-select>
+			</view>
+			<view class="sys-background-fff r-20 m-t20 p-lr30" v-if="propertyData.modelType===2">
+				<EnRadio v-model="propertyData.is_rent" label="是否出租" :list="statusOption"> </EnRadio>
+				<EnRadio v-model="propertyData.is_morgaged" label="是否抵押" :list="statusOption"> </EnRadio>
+				<EnRadio v-model="propertyData.is_occupied" label="是否占用" :list="statusOption"> </EnRadio>
+				<EnRadio v-model="propertyData.is_seizured" label="是否查封" :list="statusOption"> </EnRadio>
+			</view>
+			<view class="sys-background-fff r-20 m-t20 p-lr30" v-if="propertyData.modelType===3">
+				<en-select v-model="propertyData.level_id" :local-data="levelOption" :label="'土地等级'"
+					placeholder="请选择土地等级"> </en-select>
+				<en-select v-model="propertyData.transfer_method" :local-data="transferMethodOption" :label="'出让方式'"
+					placeholder="请选择出让方式"> </en-select>
+				<en-select v-model="propertyData.land_use" :local-data="landUseOption" :label="'土地用途'"
+					placeholder="请选择土地用途"> </en-select>
+				<en-select v-model="propertyData.land_source" :local-data="landSourceOption" :label="'土地来源'"
+					placeholder="请选择土地来源"> </en-select>
+				<en-input v-model="propertyData.age_limit" :label="'出让年限'" placeholder="请输入出让年限"> </en-input>
+				<en-input v-model="propertyData.investment" :label="'投资强度'" placeholder="请输入投资强度"> </en-input>
+				<en-input v-model="propertyData.plot_mix" :label="'最小容积'" placeholder="请输入最小容积率"> </en-input>
+				<en-input v-model="propertyData.plot_max" :label="'最大容积'" placeholder="请输入最大容积率"> </en-input>
+				<en-input v-model="propertyData.greening_mix" :label="'最小绿化'" placeholder="请输入最小绿化面积"> </en-input>
+				<en-input v-model="propertyData.greening_max" :label="'最大绿化'" placeholder="请输入最大绿化面积"> </en-input>
+				<en-input v-model="propertyData.height_mix" :label="'最小高度'" placeholder="请输入最小建筑高度"> </en-input>
+				<en-input v-model="propertyData.height_max" :label="'最大高度'" placeholder="请输入最大建筑高度"> </en-input>
+			</view>
+		</view>
+		<EnButton :text="'评估'" @onSubmit="onSubmit"></EnButton>
+		<uni-popup ref="consentObj">
+			<view class="iPhone-padding agreement-data sys-background-fff">
+			</view>
+		</uni-popup>
+	</view>
 </template>
 
 <script>
-
-import EnUpload from "@/components/en-from/en-upload/en-upload.vue";
-import EnSelect from "@/components/en-from/en-select/en-select.vue";
-import EnRadio from "@/components/en-from/en-radio/en-radio.vue";
-import EnInput from "@/components/en-from/en-input/en-input.vue";
-import AddIdentity from "@/page_task/identity_upload/add-identity.vue";
-
-
-export default {
-  components: {
-    AddIdentity,
-    EnInput,
-    EnSelect,
-    EnRadio,
-    EnUpload,
-  },
-  data() {
-    return {
-      typeOption:[{id:1,name:'住宅模型'},{id:2,name:'公建模型'},{id:3,name:'土地模型'},{id:4,name:'工业模型'}],
-      statusOption:[{id:1,name:'是'},{id:0,name:'否'}],
-      houseTypeOption:[],
-      levelOption:[],
-      transferMethodOption:[],
-      landUseOption:[],
-      landSourceOption:[],
-      districtOption:[{id:1,name:'甘井子区'},{id:2,name:'中山区'},{id:3,name:'西岗区'},{id:4,name:'沙河口区'},{id:5,name:'旅顺口区'},{id:6,name:'金州区'},{id:7,name:'瓦房店市'},{id:8,name:'庄河市'},{id:9,name:'普兰店区'}],
-      propertyData:{
-        level_id:1,
-        transfer_method:1,
-        land_use:1,
-        land_source:1,
-        investment:0,
-        plot_mix:0,
-        plot_max:0,
-        height_mix:0,
-        height_max:0,
-        greening_mix:0,
-        greening_max:0,
-        age_limit:0,
-        floor_area:0,
-        lat:0,
-        lng:0,
-        is_sold:0,
-        is_rent:0,
-        is_morgaged:0,
-        is_occupied:0,
-        is_seizured:0,
-        address:'',
-        modelType:'',
-        area:'',
-        district:'',
-        houseType:'',
-        complexName:'',
-      },
-      propertyRes:{
-        unit_price:'',
-        predict_msg:'',
-      }
-    };
-  },
-  onLoad(options) {
-
-  },
-  onShow() {
-
-  },
-  watch: {
-
-  },
-  mounted() {
-  },
-  methods: {
-    setLocation(res){
-      console.log("收到监听",res)
-      this.propertyData.address=res.address
-      this.propertyData.lat=res.lat
-      this.propertyData.lng=res.lng
-      this.propertyData.complexName=res.complexName
-      this.districtOption.forEach(item=>{
-        if(res.districtName===item.name){
-          this.propertyData.district=item.id
-        }
-      })
-    },
-    getValuationOption(){
-      if(this.propertyData.houseType===""){
-        this.propertyData.houseType=0
-      }
-      getValuationOption({"modelType":this.propertyData.modelType}).then(res=>{
-        if(res.code===0){
-          if(this.propertyData.modelType===1){
-            this.houseTypeOption=res.data.houseTypeOption
-          }else if(this.propertyData.modelType===3){
-            this.levelOption=res.data.levelOption
-            this.transferMethodOption=res.data.transferMethodOption
-            this.landUseOption=res.data.landUseOption
-            this.landSourceOption=res.data.landSourceOption
-            this.propertyData.land_source=this.landSourceOption[0].id
-          }
-        }
-      })
-    },
-    predictProperty(){
-      console.log('aaaaaaaaaaaaaaaaaaa')
-      predictProperty(this.propertyData).then(res=>{
-        if(res.code===0){
-          this.propertyRes=res.data
-        }else {
-          tools.error(res.msg)
-        }
-      })
-    },
-    async getMessage() {
-
-    },
-
-
-    getMemberInfo() {
-
-    },
-
-    getVerifiedCode() {
-
-    },
-    onSubmit() {
-
-    }
-  },
-}
+	import EnUpload from "@/components/en-from/en-upload/en-upload.vue";
+	import EnSelect from "@/components/en-from/en-select/en-select.vue";
+	import EnRadio from "@/components/en-from/en-radio/en-radio.vue";
+	import EnInput from "@/components/en-from/en-input/en-input.vue";
+	import {
+		predictProperty
+	} from "@/api/valuation.js"
+	export default {
+		components: {
+			EnInput,
+			EnSelect,
+			EnRadio,
+			EnUpload,
+		},
+		data() {
+			return {
+				typeOption: [{
+					value: 1,
+					text: '住宅模型'
+				}, {
+					value: 2,
+					text: '公建模型'
+				}, {
+					value: 3,
+					text: '土地模型'
+				}, {
+					value: 4,
+					text: '工业模型'
+				}],
+				statusOption: [{
+					value: 1,
+					text: '是'
+				}, {
+					value: 0,
+					text: '否'
+				}],
+				houseTypeOption: [],
+				levelOption: [],
+				transferMethodOption: [],
+				landUseOption: [],
+				landSourceOption: [],
+				districtOption: [{
+					value: 1,
+					text: '甘井子区'
+				}, {
+					value: 2,
+					text: '中山区'
+				}, {
+					value: 3,
+					text: '西岗区'
+				}, {
+					value: 4,
+					text: '沙河口区'
+				}, {
+					value: 5,
+					text: '旅顺口区'
+				}, {
+					value: 6,
+					text: '金州区'
+				}, {
+					value: 7,
+					text: '瓦房店市'
+				}, {
+					value: 8,
+					text: '庄河市'
+				}, {
+					value: 9,
+					text: '普兰店区'
+				}],
+				propertyData: {
+					level_id: 1,
+					transfer_method: 1,
+					land_use: 1,
+					land_source: 1,
+					investment: 0,
+					plot_mix: 0,
+					plot_max: 0,
+					height_mix: 0,
+					height_max: 0,
+					greening_mix: 0,
+					greening_max: 0,
+					age_limit: 0,
+					floor_area: 0,
+					lat: 0,
+					lng: 0,
+					is_sold: 0,
+					is_rent: 0,
+					is_morgaged: 0,
+					is_occupied: 0,
+					is_seizured: 0,
+					address: '',
+					modelType: '',
+					area: '',
+					district: '',
+					houseType: '',
+					complexName: '',
+				},
+				propertyRes: {
+					unit_price: '',
+					predict_msg: '',
+				},
+				location: {
+					lat: 0,
+					lng: 0,
+					address: '',
+					districtName: '',
+					complexName: ''
+				},
+			};
+		},
+		onLoad(options) {},
+		onShow() {},
+		watch: {},
+		mounted() {},
+		methods: {
+			async inputBut() {
+				let that = this;
+				try {
+					// 先检查权限
+					const authSetting = await this.checkLocationAuth();
+					if (!authSetting) {
+						await this.showAuthorizeGuide();
+						return;
+					}
+					// 选择位置
+					const res = await this.chooseLocation();
+					console.log('位置名称:' + res.name);
+					console.log('详细地址:' + res.address);
+					console.log('纬度:' + res.latitude);
+					console.log('经度:' + res.longitude);
+					// 更新数据
+					that.propertyData.lng = res.longitude;
+					that.propertyData.lat = res.latitude;
+					that.propertyData.address = res.address;
+					that.propertyData.complexName = res.name || '';
+					// 根据地址信息设置区域
+					this.setDistrictByAddress(res.address);
+
+				} catch (err) {
+					console.log('获取位置失败:', err);
+					if (err.errMsg && (err.errMsg.includes('auth deny') || err.errMsg.includes('fail cancel'))) {
+						uni.showToast({
+							title: '需要位置权限才能选择地址',
+							icon: 'none'
+						});
+					}
+				}
+			},
+			// 检查位置权限
+			checkLocationAuth() {
+				return new Promise((resolve) => {
+					uni.getSetting({
+						success: (res) => {
+							const authSetting = res.authSetting;
+							resolve(authSetting['scope.userLocation'] || false);
+						},
+						fail: () => {
+							resolve(false);
+						}
+					});
+				});
+			},
+			// 选择位置
+			chooseLocation() {
+				return new Promise((resolve, reject) => {
+					uni.chooseLocation({
+						success: resolve,
+						fail: reject
+					});
+				});
+			},
+			showAuthorizeGuide() {
+				return new Promise((resolve, reject) => {
+					uni.showModal({
+						title: '位置权限未开启',
+						content: '需要您授权位置信息才能提供此服务,请到设置中开启权限',
+						confirmText: '去设置',
+						success: (modalRes) => {
+							if (modalRes.confirm) {
+								// 打开小程序设置页面
+								uni.openSetting({
+									success: (openRes) => {
+										if (openRes.authSetting['scope.userLocation']) {
+											uni.showToast({
+												title: '授权成功',
+												icon: 'success'
+											});
+											resolve();
+										} else {
+											uni.showToast({
+												title: '授权失败',
+												icon: 'none'
+											});
+											reject();
+										}
+									}
+								});
+							} else {
+								reject();
+							}
+						}
+					});
+				});
+			},
+			// 根据地址设置区域
+			setDistrictByAddress(address) {
+				if (!address) return;
+				const districtText = this.extractDistrictFromAddress(address);
+				if (districtText) {
+					const district = this.districtOption.find(item =>
+						districtText.includes(item.text) || item.text.includes(districtText)
+					);
+					if (district) {
+						this.propertyData.district = district.value;
+					}
+				}
+			},
+			// 从地址中提取区域信息
+			extractDistrictFromAddress(address) {
+				if (!address) return '';
+				// 简单的区域提取逻辑,可以根据实际需求调整
+				for (let district of this.districtOption) {
+					if (address.includes(district.text)) {
+						return district.text;
+					}
+				}
+				return '';
+			},
+			setLocation(res) {
+				console.log("收到监听", res)
+				this.propertyData.address = res.address
+				this.propertyData.lat = res.lat
+				this.propertyData.lng = res.lng
+				this.propertyData.complexName = res.complexName
+				this.setDistrictByAddress(res.address);
+				// this.districtOption.forEach(item => {
+				// 	if (res.districtName === item.text) {
+				// 		this.propertyData.district = item.value
+				// 	}
+				// })
+			},
+			getValuationOption() {
+				if (this.propertyData.houseType === "") {
+					this.propertyData.houseType = 0
+				}
+				getValuationOption({
+					"modelType": this.propertyData.modelType
+				}).then(res => {
+					if (res.code === 0) {
+						if (this.propertyData.modelType === 1) {
+							this.houseTypeOption = res.data.houseTypeOption
+						} else if (this.propertyData.modelType === 3) {
+							this.levelOption = res.data.levelOption
+							this.transferMethodOption = res.data.transferMethodOption
+							this.landUseOption = res.data.landUseOption
+							this.landSourceOption = res.data.landSourceOption
+							this.propertyData.land_source = this.landSourceOption[0].id
+						}
+					}
+				})
+			},
+			onSubmit() {
+				console.log('提交评估数据', this.propertyData)
+				predictProperty(this.propertyData).then(res => {
+					if (res.code === 0) {
+						console.log(res, 'res');
+						this.propertyRes = res.data
+					} else {
+						tools.error(res.msg)
+					}
+				})
+			},
+			setMapMarker(lng, lat, status) {
+				if (this.marker === undefined) {
+					this.marker = new AMap.Marker({
+						position: new AMap.LngLat(lng, lat),
+						offset: new AMap.Pixel(-10, -10),
+						icon: "//vdata.amap.com/icons/b18/1/2.png", //添加 icon 图标 URL
+						title: "标记位",
+					});
+					this.map.add(this.marker);
+				} else {
+					this.marker.setPosition(new AMap.LngLat(lng, lat));
+				}
+				if (status) {
+					this.location.lat = lat
+					this.location.lng = lng
+					AMap.plugin("AMap.Geocoder", () => {
+						let geocoder = new AMap.Geocoder({
+							city: "大连市", // city 指定进行编码查询的城市,支持传入城市名、adcode 和 citycode
+							extensions: "all"
+						});
+						let lnglat = [this.location.lng, this.location.lat];
+						geocoder.getAddress(lnglat, (status, result) => {
+							if (status === "complete" && result.info === "OK") {
+								// result为对应的地理位置详细信息
+								console.log(result.regeocode)
+								if (result.regeocode.formattedAddress !== undefined && result.regeocode
+									.formattedAddress !== "") {
+									this.location.address = result.regeocode.formattedAddress;
+									this.location.districtName = result.regeocode.addressComponent
+										.district;
+									if (result.regeocode.pois !== undefined && result.regeocode.pois
+										.length > 0) {
+										this.location.complexName = result.regeocode.pois[0].name
+									}
+								}
+							}
+						});
+					});
+				}
+			},
+		},
+	}
 </script>
 
 <style lang="scss" scoped>
-.input-item:last-child {
-  margin-top: 30rpx;
-}
-
-.input-send {
-  display: flex;
-  justify-content: flex-start;
-  align-items: center;
-  border-bottom: 1px solid #E5E5E5;
-
-  .login-input {
-    width: calc(100% - 150rpx);
-  }
-
-  .login-send {
-    width: 100rpx;
-    text-align: center;
-    margin-left: 20rpx;
-    border: 1rpx solid #0FB160;
-    border-radius: 50rpx;
-  }
-}
-
-.left-w {
-  width: 210rpx;
-  min-width: 210rpx;
-  color: #333333;
-}
-
-.iconfont {
-  font-size: 36rpx;
-  color: #333333;
-}
-
-.class-c-6C6F93 {
-  color: #0FB160;
-}
-
-.agreement-data {
-  border-radius: 30rpx 30rpx 0 0;
-
-  .data-title {
-    width: 100%;
-    border-radius: 30rpx 30rpx 0 0;
-  }
-
-  .data-content {
-    padding: 20rpx 40rpx;
-
-    .content-box {
-      height: 600rpx;
-    }
-  }
-
-  .data-but {
-    height: 96rpx;
-    line-height: 96rpx;
-    text-align: center;
-    margin: 0 75rpx;
-  }
-}
-</style>
+	.input-item:last-child {
+		margin-top: 30rpx;
+	}
+
+	.input-send {
+		display: flex;
+		justify-content: flex-start;
+		align-items: center;
+		border-bottom: 1px solid #E5E5E5;
+
+		.login-input {
+			width: calc(100% - 150rpx);
+		}
+
+		.login-send {
+			width: 100rpx;
+			text-align: center;
+			margin-left: 20rpx;
+			border: 1rpx solid #0FB160;
+			border-radius: 50rpx;
+		}
+	}
+
+	.left-w {
+		width: 210rpx;
+		min-width: 210rpx;
+		color: #333333;
+	}
+
+	.iconfont {
+		font-size: 36rpx;
+		color: #333333;
+	}
+
+	.class-c-6C6F93 {
+		color: #0FB160;
+	}
+
+	.agreement-data {
+		border-radius: 30rpx 30rpx 0 0;
+
+		.data-title {
+			width: 100%;
+			border-radius: 30rpx 30rpx 0 0;
+		}
+
+		.data-content {
+			padding: 20rpx 40rpx;
+
+			.content-box {
+				height: 600rpx;
+			}
+		}
+
+		.data-but {
+			height: 96rpx;
+			line-height: 96rpx;
+			text-align: center;
+			margin: 0 75rpx;
+		}
+	}
+</style>

+ 129 - 129
service/ajax.js

@@ -1,74 +1,74 @@
 import tools from "@/service/tools";
-let BASE_URL =''
+let BASE_URL = ''
 //#ifndef H5
-// BASE_URL = process.uniEnv.baseUrl;
+BASE_URL = process.uniEnv.baseUrl;
 //#endif
 
 
 /**
  * post请求封装
  */
-export const request = (url, method, data, show = false,isGo=false) => {
-  let token=uni.getStorageSync('token')
-  // data.token = token;
-  // data.m_id = uni.getStorageSync('m_id')
-  // if(isGo){
-  //   BASE_URL = process.uniEnv.goUrl;
-  // }else {
-  //   BASE_URL = process.uniEnv.baseUrl;
-  // }
+export const request = (url, method, data, show = false, isGo = false) => {
+	let token = uni.getStorageSync('token')
+	// data.token = token;
+	// data.m_id = uni.getStorageSync('m_id')
+	// if(isGo){
+	//   BASE_URL = process.uniEnv.goUrl;
+	// }else {
+	//   BASE_URL = process.uniEnv.baseUrl;
+	// }
 
-  if (show) {
-    tools.showLoading();
-  }
-  if (data === undefined) {
-    data = {};
-  }
-  if(url==='/api/task/add'){
-    console.log(data)
-  }
-  return new Promise((resolve, reject) => {
-    // 封装主体:网络请求
-    console.log(url)
-    uni.request({
-      url:BASE_URL+  url,
-      data: data,
-      method: method || 'post',
-      header: {
-        'content-type': 'application/json',
-        'hversion': '1.0',
-        'Authorization': token
-      },
-      success: (res) => {
-        if (res.statusCode === 200) {
-          // console.log('应答信息-----------------------')
-          // console.log(res.data); // 控制台显示数据信息
-          tools.hideLoading();
-          if (res.data.code * 1 === 401) {
-            // uni.clearStorageSync()
-            // uni.reLaunch({
-            //   url: '/pages/login/index'
-            // });
-          } else {
-            resolve(res.data)
-          }
-        }else if(res.statusCode === 401){
-          uni.clearStorageSync()
-          uni.reLaunch({
-            url: '/pages/login/index'
-          });
-        } else{
-          tools.error('网络错误!!')
-        }
-      },
-      fail: (err) => {
-        tools.error('网络错误!!')
-        // 返回错误消息
-        reject(err)
-        tools.hideLoading();
-      }
-    })
-  })
+	if (show) {
+		tools.showLoading();
+	}
+	if (data === undefined) {
+		data = {};
+	}
+	if (url === '/api/task/add') {
+		console.log(data)
+	}
+	return new Promise((resolve, reject) => {
+		// 封装主体:网络请求
+		console.log(url)
+		uni.request({
+			url: BASE_URL + url,
+			data: data,
+			method: method || 'post',
+			header: {
+				'content-type': 'application/json',
+				'hversion': '1.0',
+				'Authorization': token
+			},
+			success: (res) => {
+				if (res.statusCode === 200) {
+					// console.log('应答信息-----------------------')
+					// console.log(res.data); // 控制台显示数据信息
+					tools.hideLoading();
+					if (res.data.code * 1 === 401) {
+						// uni.clearStorageSync()
+						// uni.reLaunch({
+						//   url: '/pages/login/index'
+						// });
+					} else {
+						resolve(res.data)
+					}
+				} else if (res.statusCode === 401) {
+					uni.clearStorageSync()
+					uni.reLaunch({
+						url: '/pages/login/index'
+					});
+				} else {
+					tools.error('网络错误!!')
+				}
+			},
+			fail: (err) => {
+				tools.error('网络错误!!')
+				// 返回错误消息
+				reject(err)
+				tools.hideLoading();
+			}
+		})
+	})
 }
 
 /**
@@ -76,76 +76,76 @@ export const request = (url, method, data, show = false,isGo=false) => {
  */
 
 export const uploadImage = (filePath, imageName, data) => {
-  tools.showLoading();
-  return new Promise((resolve, reject) => {
-    uni.uploadFile({
-      url: BASE_URL + '/api/common/upload',
-      // header: {
-      // 	'Authorization': JSON.parse(uni.getStorageSync('userInfo')).token
-      // },
-      filePath: filePath,
-      name: imageName,
-      formData: data,
-      success: (res) => {
-        tools.hideLoading();
-        resolve(res)
-      },
-      fail(err) {
-        tools.hideLoading();
-        reject(err)
-      }
-    });
-  })
+	tools.showLoading();
+	return new Promise((resolve, reject) => {
+		uni.uploadFile({
+			url: BASE_URL + '/api/common/upload',
+			// header: {
+			// 	'Authorization': JSON.parse(uni.getStorageSync('userInfo')).token
+			// },
+			filePath: filePath,
+			name: imageName,
+			formData: data,
+			success: (res) => {
+				tools.hideLoading();
+				resolve(res)
+			},
+			fail(err) {
+				tools.hideLoading();
+				reject(err)
+			}
+		});
+	})
 }
 
 
 export const uploadFile = (url, file) => {
-  tools.showLoading();
-  let token = uni.getStorageSync('token') || '';
-  // data.app_version = plus.runtime.version;
-  // console.log('请求地址-----------------------')
-  // console.log(BASE_URL + url)
-  // console.log('请求参数-----------------------')
-  // console.log(data)
-  console.log(file)
-  return new Promise((resolve, reject) => {
-    // 封装主体:网络请求
-    console.log(BASE_URL + url)
-    uni.uploadFile({
-      url: BASE_URL + url, //仅为示例,非真实的接口地址
-      filePath: file,
-      name: 'file',
-      header: {
-        'content-type': 'application/json',
-        'apikey': '01ABA77B8BA6F26243D85B5A50FFB88624951C7B3A4078B3F9971983E667D5B8',
-        'hversion': '1.0',
-        'Authorization': token
-      },
-      success: (res) => {
-        tools.hideLoading();
-        if (res.statusCode === 200) {
-          // console.log('应答信息-----------------------')
-          res.data = JSON.parse(res.data)
-          // console.log(res.data); // 控制台显示数据信息
-          if (res.data.code * 1 === 401) {
-            uni.reLaunch({
-              url: '/pages/login/login'
-            });
-          } else {
-            resolve(res.data)
-          }
-        } else {
-          tools.error('网络错误!!')
-        }
-      },
-      fail: (err) => {
-        tools.error('网络错误!!')
-        // 返回错误消息
-        reject(err)
-        tools.hideLoading();
-      }
-    });
+	tools.showLoading();
+	let token = uni.getStorageSync('token') || '';
+	// data.app_version = plus.runtime.version;
+	// console.log('请求地址-----------------------')
+	// console.log(BASE_URL + url)
+	// console.log('请求参数-----------------------')
+	// console.log(data)
+	console.log(file)
+	return new Promise((resolve, reject) => {
+		// 封装主体:网络请求
+		console.log(BASE_URL + url)
+		uni.uploadFile({
+			url: BASE_URL + url, //仅为示例,非真实的接口地址
+			filePath: file,
+			name: 'file',
+			header: {
+				'content-type': 'application/json',
+				'apikey': '01ABA77B8BA6F26243D85B5A50FFB88624951C7B3A4078B3F9971983E667D5B8',
+				'hversion': '1.0',
+				'Authorization': token
+			},
+			success: (res) => {
+				tools.hideLoading();
+				if (res.statusCode === 200) {
+					// console.log('应答信息-----------------------')
+					res.data = JSON.parse(res.data)
+					// console.log(res.data); // 控制台显示数据信息
+					if (res.data.code * 1 === 401) {
+						uni.reLaunch({
+							url: '/pages/login/login'
+						});
+					} else {
+						resolve(res.data)
+					}
+				} else {
+					tools.error('网络错误!!')
+				}
+			},
+			fail: (err) => {
+				tools.error('网络错误!!')
+				// 返回错误消息
+				reject(err)
+				tools.hideLoading();
+			}
+		});
 
-  })
+	})
 
-}
+}