Browse Source

添加地图

master
前端-胡立永 2 months ago
parent
commit
d224f81cf8
7 changed files with 100 additions and 39 deletions
  1. +14
    -2
      .gitignore
  2. +2
    -1
      common/config.js
  3. +5
    -2
      config.js
  4. +10
    -7
      pages.json
  5. +23
    -1
      pages/home/index.vue
  6. +4
    -2
      pages_subpack/category/index.vue
  7. +42
    -24
      pages_subpack/house/index.vue

+ 14
- 2
.gitignore View File

@ -1,2 +1,14 @@
/unpackage
.idea
# 默认忽略的文件
/shelf/
/workspace.xml
# 基于编辑器的 HTTP 客户端请求
/httpRequests/
# Datasource local storage ignored files
/dataSources/
/dataSources.local.xml
.idea
package-lock.json
node_modules/
unpackage/
.hbuilderx
.vite

+ 2
- 1
common/config.js View File

@ -1,5 +1,6 @@
export default {
baseUrl : 'http://127.0.0.1:8000',
// baseUrl: 'https://api.book118.com',
baseUrl:'https://houserent-admin.hhlm1688.com'
// baseUrl:'https://houserent-admin.hhlm1688.com'
// baseUrl:'http://h5.xzaiyp.top'
}

+ 5
- 2
config.js View File

@ -1,15 +1,18 @@
import Vue from 'vue'
import utils from './utils/utils.js'
import uvUI from '@/uni_modules/uv-ui-tools'
console.info(`uvUI`,uvUI)
Vue.use(uvUI);
// 当前环境
const type = 'prod'
const type = 'local'
// 环境配置
const config = {
local : {
baseUrl : 'http://127.0.0.1:8001/employ-api',
},
dev : {
baseUrl : 'http://augcl.natapp1.cc/employ-api',
},


+ 10
- 7
pages.json View File

@ -65,7 +65,8 @@
{
"path": "category/index",
"style": {
"navigationBarTitleText": "分类"
"navigationBarTitleText": "分类",
"enablePullDownRefresh": true
}
},
{
@ -196,12 +197,14 @@
"iconPath": "static/bar/home.png",
"selectedIconPath": "static/bar/home_selected.png",
"text": "首页"
}, {
"pagePath": "pages/discover/index",
"iconPath": "static/bar/find.png",
"selectedIconPath": "static/bar/find_selected.png",
"text": "发现"
}, {
},
// {
// "pagePath": "pages/discover/index",
// "iconPath": "static/bar/find.png",
// "selectedIconPath": "static/bar/find_selected.png",
// "text": "发现"
// },
{
"pagePath": "pages/user/index",
"iconPath": "static/bar/user.png",
"selectedIconPath": "static/bar/user_selected.png",


+ 23
- 1
pages/home/index.vue View File

@ -74,13 +74,19 @@
<uv-empty mode="list" ></uv-empty>
</view>
</view>
<!-- 发布房源 -->
<view class="se-pos-fixed se-pos-rc" style="right: 30rpx;">
<image @click="onNavigator()" class="se-a-150" src="@/static/image/discover.png" mode=""></image>
</view>
<!-- 地址 -->
<citySelect ref="citySelectRef" :zIndex="0" @city-change="handleCityChange"></citySelect>
</view>
</template>
<script>
import { housePageList,houseType,noticeObjApi,getConfig,commonIndexIndexIcon } from "@/common/api.js"
import { housePageList,houseType,noticeObjApi,getConfig,commonIndexIndexIcon, getInfo } from "@/common/api.js"
import citySelect from "@/components/cityselect/index.vue"
const lineBg = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABoAAAANCAYAAAC3mX7tAAAAAXNSR0IArs4c6QAAAbxJREFUOE+lk0FrE1EUhc+ZDOhMigjZdNcWdCPJqNCdlkZw4TKL2mVwkKLQ/gAFRcEu/AEKuumDrEopNEsXSlNoV+2iTYIbBdNdNwGpmRmFyVx5oQk6mYSpvt1799z7zTnvDQPlBAJcRGxZOLXotn7Gz8ftZePaROCZP+IaEh36a04LxFS8mMmgcKFcb54H9Kvi5LtdNIZ6BMf0lVMDMD88UJ7abuP1eUDeWuEZyVcJPZ/oKeclgRcJxRMrG17l4udOGthZbF8ATMb1IvKcXiU/y66xnziM2LQf1O+nAfnq+hYgpSStCeMmdcFXzi6AWyMGrlvZcGmUs54T31QQLIzo37Pd+u0eKFD5osDYHvPlJyLyNopYnbgUtrSuc2pOG4aUSC4nxTWYFXHOfni02wPp5anCO4KP0sSUViOQ91m38VjrByDZLprBt/ZHkAkvMO3oP3QiO9ZM7i7v1MK/QHoj6sblQLrV/4ZpCDMluoff++iBo/6Bdua32m/+NUYdlz2dW+k7GQnqF84eyOqY1xjPcw8Rn+iLTwp6yFFcpP8zhLxHsgjBFRrI9WKO0AbxVURqMOVDttw8GHeTvwFKoZ4cmcUYJAAAAABJRU5ErkJggg==";
import QQMapWX from "@/util/qqmap-wx-jssdk.min.js"
@ -179,6 +185,22 @@
}
})
},
onNavigator(){
let token = uni.getStorageSync('token');
if(!token){
uni.navigateTo({
url:"/pages/auth/index"
})
return ;
}
getInfo({}).then(result=>{
uni.navigateTo({
url:"/pages_subpack/house/index"
})
}).catch(err=>{
})
},
onCommonIndexIndexIcon(){
let that = this
commonIndexIndexIcon({}).then(response=>{


+ 4
- 2
pages_subpack/category/index.vue View File

@ -114,13 +114,13 @@
onHousePageList(){
let that = this
let params={
iconClass:that.id,
commonClass:that.id,//
pageNo:that.pageNo,
pageSize:that.pageSize,
title:that.keyword,
areaId:that.areaId,
priceId:that.priceId,
typeId:that.typeId,
classId:that.typeId,
yearId:that.yearId
}
housePageList(params).then((response) => {
@ -154,6 +154,7 @@
// console.info(event)
let that = this
that.keyword = event
that.pageNo = 1
that.list=[]
that.onHousePageList()
},
@ -161,6 +162,7 @@
console.info('onDropDown',event)
let that = this
that.areaId = null;
that.pageNo = 1
that.priceId = null;
that.typeId = null;
that.yearId = null


+ 42
- 24
pages_subpack/house/index.vue View File

@ -753,31 +753,37 @@
// type: 'wgs84',
success: function (res) {
console.log('当前位置的经度:' + res.longitude);
console.log('当前位置的经度:', res);
console.log('当前位置的纬度:' + res.latitude);
const qqmapsdk = new QQMapWX({
key: 'TT7BZ-Z3LW4-KOAUB-KWHOA-SBJJ6-Y5B6R' //
});
uni.showLoading({
title:"获取中...."
})
qqmapsdk.reverseGeocoder({
location: {
latitude: res.latitude,
longitude: res.longitude
},
success: function(response) {
console.log('逆地理编码结果:', response);
uni.hideLoading()
that.form.longitude = response.result.location.lng
that.form.latitude = response.result.location.lat
that.form.address = response.result.address
},
fail: function(error) {
uni.hideLoading()
console.error('逆地理编码失败:', error);
}
});
that.form.longitude = res.longitude
that.form.latitude = res.latitude
that.form.address = res.address
// const qqmapsdk = new QQMapWX({
// key: 'TT7BZ-Z3LW4-KOAUB-KWHOA-SBJJ6-Y5B6R' //
// });
// uni.showLoading({
// title:"...."
// })
// qqmapsdk.reverseGeocoder({
// location: {
// latitude: res.latitude,
// longitude: res.longitude
// },
// success: function(response) {
// console.log('', response);
// uni.hideLoading()
// that.form.longitude = response.result.location.lng
// that.form.latitude = response.result.location.lat
// that.form.address = response.result.address
// },
// fail: function(error) {
// uni.hideLoading()
// console.error('', error);
// }
// });
}
})
// this.$refs.citySelectRef.open()
@ -815,6 +821,7 @@
// remark:""
let that = this
that.$refs.form.validate().then(res => {
let params={
userId:"",
id:that.form.id,
@ -864,6 +871,17 @@
latitude:that.form.latitude,
longitude:that.form.longitude
}
if(this.$utils.verificationAll(params, {
image : '请上传房屋照片',
homeImage : '产权证照片',
address : '请选择房屋位置',
})){
return
}
// console.info(JSON.stringify(params))
// params = {"userId":"","classId":"1860389382874828802","commonClass":"1860387853019222017","address":"","homeAge":"66666","homeAz":"1","homeBian":"11","homeBjsx":"11","homeCai":"11","homeCat":"11","homeGz":"1","homeHb":"11","homeBz":"aaaa","homeJg":"22","homeJl":"11","homeJt":"22","homeJtzy":"11","homeMi":"22","homeMj":"22","homeMoney":"11","homeNo":"11","homeNum":2,"homePay":"11","homePj":"11","homeSd":"11","homeShjl":"11","homeSw":"11","homeTf":"11","homeTime":"11","homeType":"666666","homeYs":"1","homeYzmj":"11","homeZy":"11","iconName":"","iconTitle":"11","num":"11","price":"6666","timeGo":"11","title":"66666","unit":"11","image":"https://tennis-oss.xzaiyp.top/2024-12-07/950752cc-2a22-4296-a8fa-f3c5718a60a1.png,https://tennis-oss.xzaiyp.top/2024-12-07/803308f0-06e1-482a-836c-2b500c281fdc.png","iconImage":"","homeImage":"https://tennis-oss.xzaiyp.top/2024-12-07/8e7e321d-8bf5-43d9-a9ff-de849d4d60fd.png,https://tennis-oss.xzaiyp.top/2024-12-07/024dbfc1-29ba-4dbe-8554-1d19feff220b.png","homeMp4":"https://tennis-oss.xzaiyp.top/2024-12-07/b9ebc286-b293-4ec0-8e1c-205cd1ea94b5.mp4","latitude":28.689608,"longitude":112.911421}
saveOrUpdateHouse(params).then(response=>{


Loading…
Cancel
Save