1263428893@qq.com 6 months ago
parent
commit
57f70614ab
8 changed files with 191 additions and 88 deletions
  1. +2
    -2
      common/config.js
  2. +1
    -2
      pages.json
  3. +13
    -42
      pages/home/index.vue
  4. +30
    -15
      pages/login/index.vue
  5. +34
    -1
      pages/user/index.vue
  6. +99
    -18
      pages_subpack/detail/index.vue
  7. +3
    -3
      pages_subpack/house/index.vue
  8. +9
    -5
      util/request/responseInterceptors.js

+ 2
- 2
common/config.js View File

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

+ 1
- 2
pages.json View File

@ -176,8 +176,7 @@
"globalStyle": {
"navigationBarTextStyle": "white",
"navigationBarTitleText": "租房",
"navigationBarBackgroundColor": "#1EC77A",
"backgroundColor": "#1EC77A"
"navigationBarBackgroundColor": "#1EC77A"
},
"tabBar": {
"color": "#666666",


+ 13
- 42
pages/home/index.vue View File

@ -1,6 +1,6 @@
<template>
<view>
<view class="se-px-40 se-py-20">
<view class="se-px-40 se-py-20" style="background-color: #1EC77A;">
<view class="se-bgc-white se-br-50 se-c-black se-px-20 se-py-5 se-flex se-flex-h-sb se-fs-26">
<view class="se-b-r se-pl-10 se-pr-20 se-flex se-flex-h se-h-40 se-lh-40 " @click="handleAreaChange()">
<text class="se-pr-20 nobreak">{{city?city:'未知'}}</text>
@ -11,10 +11,13 @@
</view>
</view>
</view>
<view class="backdrop se-mb-20">
<image class="se-w-vw-100 se-h-400" src="@/static/image/banner.png" mode=""></image>
<!-- backdrop -->
<view class=" se-mb-20">
<uv-swiper height="300rpx" :list="bannerList"></uv-swiper>
<!-- <image class="se-w-vw-100 se-h-400" src="@/static/image/banner.png" mode=""></image> -->
</view>
<view class="se-grid se-bgc-white se-py-30 se-mt-300">
<!-- se-mt-300 -->
<view class="se-grid se-bgc-white se-py-30">
<!-- <navigator url="/pages_subpack/category/index" v-for="(item, index) in nav" :key="index" class="se-flex-v-c se-mb-20">
<image class="se-a-100 se-br-20" :src="item.img" mode=""></image>
<text class="se-w-150 se-h-60 se-lh-30 se-c-black se-fs-22 se-ta-c se-mt-10 se-toe-2">{{item.name}}</text>
@ -90,40 +93,8 @@
city:"",
keyword:"",
lineBg: lineBg,
nav:[
// {
// img:"../../static/image/nav1.png",
// name:""
// },
// {
// img:"../../static/image/nav2.png",
// name:""
// },
// {
// img:"../../static/image/nav3.png",
// name:""
// },
// {
// img:"../../static/image/nav4.png",
// name:""
// },
// {
// img:"../../static/image/nav5.png",
// name:""
// },
// {
// img:"../../static/image/nav6.png",
// name:""
// },
// {
// img:"../../static/image/nav7.png",
// name:""
// },
// {
// img:"../../static/image/nav8.png",
// name:""
// }
],
bannerList:["https://tennis-oss.xzaiyp.top/2024-12-08/9704d4a0-e8d8-40fc-a2b6-28b928013a60.png"],
nav:[],
noticeObj:{},
houseTypeList:[],
classId:null,
@ -134,7 +105,7 @@
},
onShareAppMessage() {
let share = {
title:"首页分享",
title:this.$utils.getkeyContent('logo_name').keyContent,
path:"/pages/home/index?userId="+uni.getStorageSync('userInfo').id,
success:(res) => {
console.info(res)
@ -197,9 +168,9 @@
latitude: res.latitude,
longitude: res.longitude
},
success: function(res) {
that.city = res.result.ad_info.city
console.log('逆地理编码结果:', res);
success: function(response) {
that.city = response.result.ad_info.city
console.log('逆地理编码结果:', response);
},
fail: function(error) {
console.error('逆地理编码失败:', error);


+ 30
- 15
pages/login/index.vue View File

@ -23,15 +23,14 @@
<input type="nickname" placeholder="请输入昵称" v-model="nameUser"
@blur="bindblur" class="se-h-80 se-lh-80 se-w-320 se-fs-24 se-ta-r" placeholder-class="se-fs-24 se-ta-r" />
</view>
<view class=" se-b-b se-flex se-h-140 se-lh-140 se-flex-h-sb">
<!-- <view class=" se-b-b se-flex se-h-140 se-lh-140 se-flex-h-sb">
<text>手机号</text>
<button v-if="phone" class="default-btn se-h-100 se-p-0 se-m-0" open-type="getPhoneNumber" @getphonenumber="onPhonenumber">{{phone}}</button>
<button v-else class="se-w-140 se-h-60 se-lh-60 se-fs-20 se-bgc-green se-c-white se-py-0 se-br-30 se-px-20 se-m-0" open-type="getPhoneNumber" @getphonenumber="onPhonenumber">
获取手机号
</button>
<!-- <input type="nickname" placeholder="请输入昵称" v-model="phone"
@blur="bindblur" class="se-h-80 se-lh-80 se-w-320 se-fs-24 se-ta-r" placeholder-class="se-fs-24 se-ta-r" /> -->
</view>
</view> -->
</view>
<view class="se-mx-40">
<view @click="onUpdateInfo" class="se-br-40 se-flex-h-c se-h-80 se-lh-80 se-ta-c se-fs-32 se-c-white se-bgc-green">
@ -49,7 +48,16 @@
return {
nameUser:"",
imagUrl:"",
phone:""
phone:"",
back:0
}
},
onLoad(options) {
if(options.back==1){
this.imagUrl = uni.getStorageSync('userInfo').headImage
this.nameUser = uni.getStorageSync('userInfo').nickName
this.phone = uni.getStorageSync('userInfo').phone
this.back = options.back
}
},
methods: {
@ -88,20 +96,27 @@
nickName:that.nameUser,
// phone:that.phone
}
// if(that.imagUrl&&that.nameUser&&that.phone){
// &&that.phone
if(that.imagUrl&&that.nameUser){
UpdateInfo(params).then((response) => {
uni.switchTab({
url:"/pages/home/index"
})
if(this.back==1){
uni.navigateBack({
delta:1
})
}else{
uni.switchTab({
url:"/pages/home/index"
})
}
}).catch((error) =>{
})
// }else{
// return uni.showToast({
// icon:"none",
// title:""
// })
// }
}else{
return uni.showToast({
icon:"none",
title:"头像和昵称不能为空!"
})
}
}


+ 34
- 1
pages/user/index.vue View File

@ -2,7 +2,7 @@
<view class="u-page">
<view class="se-pt-30 se-pb-60 se-px-40 se-bgc-green se-c-white se-pos">
<view class="se-flex">
<image :src="user.headImage" class="se-br-p-50 se-bgc-f9 se-w-120 se-h-120" mode=""></image>
<image @click="onHead" :src="user.headImage" class="se-br-p-50 se-bgc-f9 se-w-120 se-h-120" mode=""></image>
<view class="se-ml-20 se-flex se-flex-v-sa se-flex-ai-fs">
<view class="se-flex">
<text class="se-fw-6 se-fs-30">{{user.nickName?user.nickName:'暂无昵称'}}</text>
@ -91,6 +91,14 @@
<uv-icon name="arrow-right"></uv-icon>
</view>
</view>
<view class="se-py-30 se-px-20 se-flex se-flex-h-sb se-b-t" @click="onLogOut">
<view class="se-flex se-flex-ai-c">
<text class="se-fs-24 se-fw-5">退出登录</text>
</view>
<view class="se-flex se-flex-ai-c">
<uv-icon name="arrow-right"></uv-icon>
</view>
</view>
</view>
</view>
</template>
@ -110,6 +118,11 @@
this.onInfo()
},
methods: {
onHead(){
uni.navigateTo({
url:"/pages/login/index?back="+1
})
},
onInfo(){
let that = this
that.user = uni.getStorageSync('userInfo')
@ -140,6 +153,26 @@
url:"/pages_subpack/broker-account/index"
})
},
onLogOut(){
uni.showModal({
title:"温馨提示",
content:"确定退出当前登录",
cancelText:"取消",
confirmText:"确定",
success:(res)=> {
console.info(res)
if(res.confirm==true){
uni.removeStorageSync("userInfo")
uni.removeStorageSync("token")
uni.removeStorageSync("sessionKey")
uni.navigateTo({
url:"/pages/auth/index"
})
}
}
})
},
onCustomerService(){
let that = this
let obj = that.$utils.getkeyContent('phone')


+ 99
- 18
pages_subpack/detail/index.vue View File

@ -13,9 +13,12 @@
</view>
</view>
<view class="se-pr-30 se-flex se-flex-v-c">
<!-- <uv-icon name="photo"></uv-icon> -->
<button class="se-w-140 se-h-60 se-lh-60 se-fs-22 se-bgc-green se-c-white se-py-0 se-br-30 se-px-20 se-m-0" open-type="share">分享</button>
<!-- <text class="se-c-black se-fs-20">分享</text> -->
<button style="justify-content: center;" class="se-w-140 se-flex se-flex-ai-c se-h-60 se-lh-60 se-fs-22 se-bgc-green se-c-white se-py-0 se-br-30 se-px-20 se-m-0" open-type="share">
<uv-icon name="share" color="#fff"></uv-icon>
<text class="se-fs-20 se-pl-5">分享</text>
</button>
</view>
</view>
<view class="se-mt-30 se-bgc-white se-py-30 se-flex se-flex-h-fs">
@ -55,20 +58,24 @@
<text class="se-c-black se-fw-6">{{detail.address}}</text>
</view>
</view>
<!-- <view class="se-flex bgc-active-lg se-py-20 se-br-10">
<view class="se-flex bgc-active-lg se-py-20 se-br-10">
<view class="se-w-p-85 se-pl-30">
<view class=" se-c-black se-fw-6 se-fs-24">
具体地址{{detail.address}}
具体地址{{address}}
</view>
<view class="se-fs-22 se-py-5">
<!-- <view class="se-fs-22 se-py-5">
距离你1.4km 骑行9分钟 步行18分钟
</view>
</view> -->
</view>
<view class="se-w-p-15 se-pr-30 se-flex se-flex-v-c">
<uv-icon name="photo"></uv-icon>
<button class="default-btn se-w-p-15 se-pr-30 se-flex se-flex-v-c" open-type="getUserInfo" @click="openMap">
<uv-icon name="map-fill"></uv-icon>
<text class="se-c-black se-fs-20 se-mt-10">导航</text>
</view>
</view> -->
</button>
<!-- <view class="se-w-p-15 se-pr-30 se-flex se-flex-v-c" @click="onDaoHang">
<uv-icon name="map-fill"></uv-icon>
<text class="se-c-black se-fs-20 se-mt-10">导航</text>
</view> -->
</view>
<view class="se-flex se-fs-24">
<view class="se-flex-2 se-py-20">
<text class="se-c-66 se-mr-20">房屋周边</text>
@ -194,8 +201,7 @@
</view>
</view>
<view class="se-flex se-mt-20">
<image class="se-w-320 se-h-180 se-br-5" :src="detail.homeTf" mode=""></image>
<image class="se-w-320 se-h-180 se-br-5 se-ml-10" :src="detail.image" mode=""></image>
<image @click="previewImage(detail.homeImages, items)" v-for="(items,indexs) in detail.homeImages" :key="indexs" class="se-w-320 se-h-180 se-br-5 se-mr-10" :src="items" mode=""></image>
</view>
</view>
<view class="se-mt-30 se-p-40 se-bgc-white">
@ -266,13 +272,14 @@
<script>
import { houseDetail,saveComment,commentPageList } from "@/common/api.js"
import QQMapWX from "@/util/qqmap-wx-jssdk.min.js"
export default{
data(){
return{
show:false,
content:"",
id:null,
address:"",
detail:{},
list:[],
@ -298,13 +305,30 @@
if(options.userId){
uni.setStorageSync('userId',options.userId)
}
this.getLocation()
this.onHouseDetail()
this.onCommentPageList()
},
onShareTimeline(){
let share = {
title:this.detail.title,
path:"/pages_subpack/detail/index?id="+this.id+"&userId="+uni.getStorageSync('userInfo').id,
imageUrl:this.list[0].url,
success:(res) => {
console.info(res)
},
fail:(err)=>{
console.info(err)
}
}
console.info(share)
return share
},
onShareAppMessage() {
let share = {
title:"首页分享",
title:this.detail.title,
path:"/pages_subpack/detail/index?id="+this.id+"&userId="+uni.getStorageSync('userInfo').id,
imageUrl:this.list[0].url,
success:(res) => {
console.info(res)
},
@ -316,6 +340,47 @@
return share
},
methods:{
openMap() {
var that = this;
uni.openLocation({
longitude: parseFloat(that.detail.longitude),
latitude: parseFloat(that.detail.latitude),
scale: 18,
name: that.detail.title,
address: that.detail.address,
success: function () {
console.log('success');
}
})
},
getLocation(){
const that = this;
wx.getLocation({
type: 'wgs84',
success: function (res) {
console.log('当前位置的经度:' + res.longitude);
console.log('当前位置的纬度:' + res.latitude);
const qqmapsdk = new QQMapWX({
key: 'TT7BZ-Z3LW4-KOAUB-KWHOA-SBJJ6-Y5B6R' //
});
qqmapsdk.reverseGeocoder({
location: {
latitude: res.latitude,
longitude: res.longitude
},
success: function(response) {
that.address = response.result.address
console.log('逆地理编码结果:', response);
},
fail: function(error) {
console.error('逆地理编码失败:', error);
}
});
}
})
},
previewImage(urls, current) {
uni.previewImage({
urls: urls, // HTTP
@ -394,13 +459,29 @@
houseDetail({houseId:that.id}).then(response=>{
let items = response.result
console.info('response',response.result)
if(items.homeMp4){
that.list.push({
url: items.homeMp4,
type: 'video'
})
}
if(items.image){
console.info('items.image.split()',items.image.split(','))
items.image.split(',').forEach(items=>{
items.image.split(',').forEach(item=>{
that.list.push({
url: items
url: item,
type: 'image'
})
})
}
if(items.homeImage){
items.homeImages=[]
items.homeImage.split(',').forEach(item=>{
items.homeImages.push(item)
})
}else{
items.homeImages=[]
}
@ -415,7 +496,7 @@
<style>
.default-btn{
background-color: #fff;
background-color: transparent;
}
.default-btn::after{
content: "";


+ 3
- 3
pages_subpack/house/index.vue View File

@ -148,7 +148,7 @@
</uv-form-item>
<uv-form-item label="视频" labelWidth="250" prop="isMp4List" labelPosition="top">
<uv-upload customStyle="margin-top:20rpx;" accept="media" :fileList="form.mp4List" @afterRead="aftermp4Read" @delete="deletemp4Pic" name="1"
multiple :maxCount="10"></uv-upload>
multiple :maxCount="1"></uv-upload>
</uv-form-item>
<uv-form-item label="备注" prop="remark" labelPosition="top">
<uv-input v-model="form.remark" type="text" placeholder="请输入备注" customStyle="border-radius: 5px;margin-top:5px;background-color: #f5f5f5;padding:5px 10px;"></uv-input>
@ -864,8 +864,8 @@
latitude:that.form.latitude,
longitude:that.form.longitude
}
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}
// 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=>{
console.info('response',response)
uni.showToast({


+ 9
- 5
util/request/responseInterceptors.js View File

@ -5,13 +5,17 @@
export const responseInterceptors = (vm) => {
uni.$uv.http.interceptors.response.use((response) => { /* 对响应成功做点什么 可使用async await 做异步操作*/
const data = response.data
if (data.code == 200 || data.code == 905) {
return Promise.resolve(data);
// }else if(data.code === 500){
// uni.navigateTo({
// url:"/pages/auth/index"
// })
// return;
}else if(data.code === 500 && (data.message == '操作失败,token非法无效!' || data.message == '操作失败,用户不存在!')){
uni.removeStorageSync('token')
uni.removeStorageSync('userInfo')
uni.removeStorageSync('sessionKey')
uni.navigateTo({
url:"/pages/auth/index"
})
return;
}else{
uni.$uv.toast(data.message)
return Promise.reject(data)


Loading…
Cancel
Save