...
|
...
|
@@ -4,11 +4,11 @@ |
|
|
<view class=""
|
|
|
style="position: fixed;top: 0;left: 0;height:176rpx;width: 100%;z-index: 99999;overflow: hidden;">
|
|
|
<image :src="IndexImg" mode="" style="width: 100%;"></image>
|
|
|
<view class="" style="font-size:34rpx;color: #fff;position: absolute;top: 108rpx;left: 36rpx;"
|
|
|
<view class="" style="font-size:34rpx;color: #fff;position: absolute;top: 108rpx;left: 36rpx;max-width: 300rpx;overflow: hidden;white-space: nowrap;text-overflow: ellipsis;"
|
|
|
@click="goSelectAddress">
|
|
|
{{addressText}}
|
|
|
<!-- <image src="/static/image/Frame_11@2x.png" mode="" style="width: 24rpx;height: 24rpx;"></image> -->
|
|
|
<view class="arrowWhite">
|
|
|
<view class="arrowWhite" style="position: fixed;top:62px;left: 320rpx;">
|
|
|
|
|
|
</view>
|
|
|
</view>
|
...
|
...
|
@@ -71,7 +71,7 @@ |
|
|
</view>
|
|
|
<view class="topRight" style="display: flex;align-items: center;" @click="allClassify">
|
|
|
<view class="mainText">
|
|
|
全部分类
|
|
|
全部
|
|
|
</view>
|
|
|
<view class="arrow">
|
|
|
<image src="/static/image/gengduo_icon_3@2x.png" mode=""></image>
|
...
|
...
|
@@ -321,107 +321,12 @@ |
|
|
if (uni.getStorageSync('token')) {
|
|
|
this.token = true
|
|
|
}
|
|
|
if(uni.getStorageSync('fristEnter')){
|
|
|
this.getLocations()
|
|
|
uni.setStorageSync('fristEnter',false)
|
|
|
}
|
|
|
},
|
|
|
onShow: function() {
|
|
|
if (uni.getStorageSync('changeAddessShow') == undefined) {
|
|
|
uni.setStorageSync('changeAddessShow', true)
|
|
|
}
|
|
|
if (uni.getStorageSync('changeAddessShow')) {
|
|
|
wx.getSetting({
|
|
|
success: (res) => {
|
|
|
if (res.authSetting['scope.userLocation']) {
|
|
|
let that = this
|
|
|
uni.getLocation({
|
|
|
type: 'wgs84',
|
|
|
altitude: true,
|
|
|
success(r) {
|
|
|
that.nowlocationLat=r.latitude
|
|
|
that.nowlocationLot=r.longitude
|
|
|
// wx.setStorageSync('nowLat', r.latitude)
|
|
|
// wx.setStorageSync('nowLot', r.longitude)
|
|
|
uni.request({
|
|
|
url: 'https://apis.map.qq.com/ws/geocoder/v1',
|
|
|
data: {
|
|
|
key: 'Y4PBZ-MBQ3Q-XSV5A-GWLXE-HXV4E-JNB3P',
|
|
|
location: (r.latitude + "," + r.longitude)
|
|
|
},
|
|
|
success: res => {
|
|
|
wx.setStorageSync('nowlocationCity', res.data.result.address_component
|
|
|
.city)
|
|
|
that.nowlocationAddress= res.data
|
|
|
.result.address_component
|
|
|
.district + res.data.result
|
|
|
.address_component
|
|
|
.street
|
|
|
// wx.setStorageSync('nowAddres', res.data
|
|
|
// .result.address_component
|
|
|
// .district + res.data.result
|
|
|
// .address_component
|
|
|
// .street)
|
|
|
wx.setStorageSync('nowAddres', res.data
|
|
|
.result.address_component
|
|
|
.district + res.data.result
|
|
|
.address_component
|
|
|
.street)
|
|
|
if (uni.getStorageSync("City") == "") {
|
|
|
that.addressText = res.data.result
|
|
|
.address_component.city
|
|
|
} else {
|
|
|
that.addressText = uni.getStorageSync(
|
|
|
"City")
|
|
|
}
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
fail(err) {}
|
|
|
})
|
|
|
if (uni.getStorageSync('selectCity')) {
|
|
|
if (uni.getStorageSync('nowlocationCity').substring(0, 2) !== uni
|
|
|
.getStorageSync('selectCity').substring(0,
|
|
|
2)) {
|
|
|
wx.showModal({
|
|
|
title: '切换城市',
|
|
|
content: '是否切换到当前位置',
|
|
|
confirmColor: '#f16765',
|
|
|
success: res => {
|
|
|
if (res.confirm) {
|
|
|
uni.setStorageSync('lat', that.nowlocationLat)
|
|
|
uni.setStorageSync('lot', that.nowlocationLot)
|
|
|
uni.setStorageSync('nowAddres', that.nowlocationAddress)
|
|
|
// this.getLocations()
|
|
|
}
|
|
|
uni.setStorageSync('changeAddessShow', false)
|
|
|
}
|
|
|
|
|
|
})
|
|
|
}
|
|
|
} else {
|
|
|
if (uni.getStorageSync('nowlocationCity').substring(0, 2) !== uni
|
|
|
.getStorageSync('locationCity').substring(0,
|
|
|
2)) {
|
|
|
wx.showModal({
|
|
|
title: '切换城市',
|
|
|
content: '是否切换到当前位置',
|
|
|
confirmColor: '#f16765',
|
|
|
success: res => {
|
|
|
if (res.confirm) {
|
|
|
uni.setStorageSync('lat', that.nowlocationLat)
|
|
|
uni.setStorageSync('lot', that.nowlocationLot)
|
|
|
uni.setStorageSync('nowAddres',that.nowlocationAddress)
|
|
|
// this.getLocations()
|
|
|
}
|
|
|
uni.setStorageSync('changeAddessShow', false)
|
|
|
}
|
|
|
|
|
|
})
|
|
|
}
|
|
|
}
|
|
|
|
|
|
}
|
|
|
}
|
|
|
})
|
|
|
}
|
|
|
|
|
|
let that = this
|
|
|
if (uni.getStorageSync("City") == "") {
|
|
|
this.getLocations();
|
...
|
...
|
@@ -441,15 +346,15 @@ |
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
nowlocationLat:'', //每次进入维度
|
|
|
nowlocationLot:'', //每次进入经度
|
|
|
nowlocationAddress:'', //每次进入详细位置
|
|
|
nowlocationLat: '', //每次进入维度
|
|
|
nowlocationLot: '', //每次进入经度
|
|
|
nowlocationAddress: '', //每次进入详细位置
|
|
|
firstTime: 0, //判断第几次进入该页面
|
|
|
token: false,
|
|
|
pageNums: 1,
|
|
|
pageNum: 1,
|
|
|
addressText: '',
|
|
|
IndexImg: 'https://s3.ax1x.com/2021/01/11/s8PyTK.png',
|
|
|
IndexImg: 'http://muying.qiniu.broing.cn/uploads/20210318/eb27dcddc8365463de7a42e151995854.png',
|
|
|
longitude: '',
|
|
|
latitude: '',
|
|
|
address: '', //定位
|
...
|
...
|
@@ -459,11 +364,10 @@ |
|
|
duration: 1500,
|
|
|
indicatorDots: true,
|
|
|
boardImg: '', //广告
|
|
|
IndexImg: 'https://s3.ax1x.com/2021/01/11/s8PyTK.png',
|
|
|
address: '', //定位
|
|
|
inputValue: '',
|
|
|
//积分活动
|
|
|
activeShow:true, //积分活动是否显示
|
|
|
activeShow: true, //积分活动是否显示
|
|
|
listTypecont: [],
|
|
|
scrollTop: 0,
|
|
|
tabList: ['闲置物品', '发现需要'],
|
...
|
...
|
@@ -522,13 +426,13 @@ |
|
|
getLocations() {
|
|
|
let that = this
|
|
|
uni.getLocation({
|
|
|
type: 'wgs84',
|
|
|
type: 'gcj02',
|
|
|
altitude: true,
|
|
|
success(r) {
|
|
|
uni.setStorageSync('lat', r.latitude)
|
|
|
uni.setStorageSync('lot', r.longitude)
|
|
|
// wx.setStorageSync('nowLat', r.latitude)
|
|
|
// wx.setStorageSync('nowLot', r.longitude)
|
|
|
wx.setStorageSync('nowLat', r.latitude)
|
|
|
wx.setStorageSync('nowLot', r.longitude)
|
|
|
uni.request({
|
|
|
url: 'https://apis.map.qq.com/ws/geocoder/v1',
|
|
|
data: {
|
...
|
...
|
@@ -536,23 +440,18 @@ |
|
|
location: (r.latitude + "," + r.longitude)
|
|
|
},
|
|
|
success: res => {
|
|
|
console.log(res,'index')
|
|
|
wx.setStorageSync('locationCity', res.data.result.address_component
|
|
|
.city)
|
|
|
wx.setStorageSync('nowlocationCity',res.data.result.address_component
|
|
|
wx.setStorageSync('nowlocationCity', res.data.result.address_component
|
|
|
.city)
|
|
|
wx.setStorageSync('City', res.data.result.address_component.district +
|
|
|
res.data.result.address_component.street)
|
|
|
wx.setStorageSync('nowAddres', res.data.result.address_component
|
|
|
.district + res.data.result.address_component
|
|
|
.street)
|
|
|
|
|
|
// if (that.addressText == '') {
|
|
|
wx.setStorageSync('City', res.data.result.formatted_addresses.recommend)
|
|
|
wx.setStorageSync('nowAddres', res.data.result.formatted_addresses.recommend)
|
|
|
if (uni.getStorageSync("City") == "") {
|
|
|
that.addressText = res.data.result.address_component.city
|
|
|
} else {
|
|
|
that.addressText = uni.getStorageSync("City")
|
|
|
}
|
|
|
// }
|
|
|
}
|
|
|
})
|
|
|
},
|
...
|
...
|
@@ -571,7 +470,6 @@ |
|
|
this.getLocations()
|
|
|
},
|
|
|
fail(err) {
|
|
|
console.log(err)
|
|
|
wx.showModal({
|
|
|
title: '是否授权当前位置',
|
|
|
content: '需要获取您的地理位置,请确认授权',
|
...
|
...
|
@@ -712,8 +610,8 @@ |
|
|
list.forEach((item, index) => {
|
|
|
this.array.push(item.long + "km")
|
|
|
this.arrayList.push(item)
|
|
|
this.goodsXz(); //闲置物品
|
|
|
})
|
|
|
this.goodsXz(); //闲置物品
|
|
|
let lists = this.arrayList
|
|
|
lists.forEach((item, index) => {
|
|
|
if (index == 0 && item.long !== '全部') {
|
...
|
...
|
@@ -781,7 +679,7 @@ |
|
|
request.get("/api/index/xianZhi", {
|
|
|
lat2: uni.getStorageSync('lat'),
|
|
|
lng2: uni.getStorageSync('lot'),
|
|
|
id: that.arrayList[that.index].id,
|
|
|
id: that.index ? that.arrayList[that.index].id : '',
|
|
|
sort_id: that.index1 ? that.ClassifyList[that.index1].id : '',
|
|
|
page: that.pageNum,
|
|
|
rows: 10
|
...
|
...
|
@@ -844,10 +742,10 @@ |
|
|
},
|
|
|
bindPickerChange: function(e) {
|
|
|
this.index = e.target.value
|
|
|
this.goodsList = []
|
|
|
if (this.tabIndex == 0) {
|
|
|
this.pageNum = 1
|
|
|
this.goodsXz()
|
|
|
|
|
|
} else {
|
|
|
this.pageNum = 1
|
|
|
this.goodsXy()
|
...
|
...
|
@@ -856,6 +754,7 @@ |
|
|
},
|
|
|
bindPickerChange1: function(e) {
|
|
|
let _that = this
|
|
|
this.goodsList = []
|
|
|
_that.index1 = e.target.value
|
|
|
if (_that.tabIndex == 0) {
|
|
|
this.pageNum = 1
|
...
|
...
|
@@ -912,7 +811,7 @@ |
|
|
},
|
|
|
//分享
|
|
|
onShareAppMessage: function(e) {
|
|
|
let title = '最火社区闲置二手信息平台'
|
|
|
let title = '来到社区淘 闲置就近卖'
|
|
|
return {
|
|
|
title: title,
|
|
|
path: ''
|
...
|
...
|
@@ -920,7 +819,7 @@ |
|
|
},
|
|
|
onShareTimeline() {
|
|
|
return {
|
|
|
title: '最火社区闲置二手信息平台',
|
|
|
title: '来到社区淘 闲置就近卖',
|
|
|
query: {},
|
|
|
imageUrl: '',
|
|
|
}
|
...
|
...
|
|