|
|
<template>
|
|
|
<view class="container">
|
|
|
<image :src="IndexImg" style="width: 100%;" mode=""></image>
|
|
|
<view class="" style="position: fixed;top: 0;left: 0;height:176rpx;width: 100%;z-index: 99999;overflow: hidden;">
|
|
|
<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;" @click="goSelectAddress">
|
|
|
<view class="" style="font-size:34rpx;color: #fff;position: absolute;top: 108rpx;left: 36rpx;"
|
|
|
@click="goSelectAddress">
|
|
|
{{addressText}}
|
|
|
<!-- <image src="/static/image/Frame_11@2x.png" mode="" style="width: 24rpx;height: 24rpx;"></image> -->
|
|
|
<view class="arrowWhite">
|
...
|
...
|
@@ -24,7 +26,8 @@ |
|
|
</view>
|
|
|
<view class="inputCon">
|
|
|
<image src="../../static/image/search.png" mode=""></image>
|
|
|
<input class="uni-input" placeholder="搜索" @focus='focus' v-model="inputValue" @input="bindInput" />
|
|
|
<input class="uni-input" placeholder="搜索" @focus='focus' v-model="inputValue"
|
|
|
@input="bindInput" />
|
|
|
</view>
|
|
|
<view class="mapBox" @click="cangbao">
|
|
|
<view class="picBox">
|
...
|
...
|
@@ -37,23 +40,25 @@ |
|
|
</view>
|
|
|
</view>
|
|
|
<view class="swiperBox">
|
|
|
<swiper class="swiper" :indicator-dots="indicatorDots" :duration="duration" :circular="true" autoplay="true">
|
|
|
<swiper class="swiper" :indicator-dots="indicatorDots" :duration="duration" :circular="true"
|
|
|
autoplay="true">
|
|
|
<swiper-item v-for="(item,index) in swiperList" :key="index" @click="goGood(item.id_status)">
|
|
|
<image :src="item.image" mode="" class="swiper"></image>
|
|
|
</swiper-item>
|
|
|
</swiper>
|
|
|
</view>
|
|
|
<view class="classifyBox">
|
|
|
<view class="classifyPic" v-for="(item,index) in ClassifyList1" :key="index" @click="goClass(index,item.id)" v-if="index<3">
|
|
|
<view class="classifyPic" v-for="(item,index) in ClassifyList1" :key="index"
|
|
|
@click="goClass(index,item.id)" v-if="index<3">
|
|
|
<image :src="item.image" mode=""></image>
|
|
|
<text class="classifyText">{{item.name}}</text>
|
|
|
</view>
|
|
|
<view class="classifyPic" @click="goClass(4,'')">
|
|
|
<view class="classifyPic" @click="goClass(4,'')" v-if="ClassifyList1.length>0">
|
|
|
<image src="../../static/image/fenlei_icon_1@2x.png" mode=""></image>
|
|
|
<text class="classifyText">分类</text>
|
|
|
</view>
|
|
|
</view>
|
|
|
<view style="margin: 0 30rpx 0 34rpx;" v-if="listTypecont.length>0">
|
|
|
<view style="margin: 0 30rpx 0 34rpx;" v-if="listTypecont.length>0&&activeShow">
|
|
|
<view class="pintuanBox">
|
|
|
<view class="pintuanTop">
|
|
|
<view class="topLeft" style="display: flex;align-items: center;">
|
...
|
...
|
@@ -75,7 +80,8 @@ |
|
|
</view>
|
|
|
<view class="pintuanBottom">
|
|
|
<scroll-view class="scrool-more" scroll-x="true" scroll-with-animation="true">
|
|
|
<view class="scrollItem" v-for="(item,index) in listTypecont" :key="index" v-if="index<=4" @click="goDetail(item.id)">
|
|
|
<view class="scrollItem" v-for="(item,index) in listTypecont" :key="index" v-if="index<=4"
|
|
|
@click="goDetail(item.id)">
|
|
|
<image :src="item.img" mode="" class="scrollPic" mode="scaleToFill"></image>
|
|
|
<text class="label-name">{{item.title }}</text>
|
|
|
</view>
|
...
|
...
|
@@ -90,7 +96,8 @@ |
|
|
<view class="tabBox" style="margin: 0 30rpx;padding-bottom: 100rpx;">
|
|
|
<view class="inv-h-w">
|
|
|
<block v-for="(item,index) in tabList" :key="index">
|
|
|
<view :class="['inv-h',tabIndex== index?'inv-h-se':'']" @click="changeTab(index)">{{item}}</view>
|
|
|
<view :class="['inv-h',tabIndex== index?'inv-h-se':'']" @click="changeTab(index)">{{item}}
|
|
|
</view>
|
|
|
</block>
|
|
|
</view>
|
|
|
<view class="locationBtn" v-if="noAddress" @click="startLocations">
|
...
|
...
|
@@ -106,14 +113,16 @@ |
|
|
<picker @change="bindPickerChange" :value="index" :range="array" class="picker">
|
|
|
<view class="uni-input pickerIner">{{array[index]}}</view>
|
|
|
<view class="image" style="position: absolute;top: 0;left: 150rpx;">
|
|
|
<image src="/static/image/fenlei_icon_3@2x.png" mode="" style="width: 28rpx;height: 28rpx;"></image>
|
|
|
<image src="/static/image/fenlei_icon_3@2x.png" mode=""
|
|
|
style="width: 28rpx;height: 28rpx;"></image>
|
|
|
</view>
|
|
|
</picker>
|
|
|
<view class="picker">
|
|
|
|
|
|
</view>
|
|
|
<view class="image">
|
|
|
<image src="/static/image/fenlei_icon_3@2x.png" mode="" style="width: 28rpx;height: 28rpx;"></image>
|
|
|
<image src="/static/image/fenlei_icon_3@2x.png" mode=""
|
|
|
style="width: 28rpx;height: 28rpx;"></image>
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
...
|
...
|
@@ -125,24 +134,29 @@ |
|
|
<picker @change="bindPickerChange1" :value="index1" :range="classArray" class="picker">
|
|
|
<view class="uni-input pickerIner">{{classArray[index1]}}</view>
|
|
|
<view class="image" style="position: absolute;top: 0;left: 146rpx;">
|
|
|
<image src="/static/image/fenlei_icon_3@2x.png" mode="" style="width: 28rpx;height: 28rpx;"></image>
|
|
|
<image src="/static/image/fenlei_icon_3@2x.png" mode=""
|
|
|
style="width: 28rpx;height: 28rpx;"></image>
|
|
|
</view>
|
|
|
</picker>
|
|
|
<view class="">
|
|
|
|
|
|
</view>
|
|
|
<view class="image">
|
|
|
<image src="/static/image/fenlei_icon_3@2x.png" mode="" style="width: 28rpx;height: 28rpx;"></image>
|
|
|
<image src="/static/image/fenlei_icon_3@2x.png" mode=""
|
|
|
style="width: 28rpx;height: 28rpx;"></image>
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
<view class="" v-if="tabIndex==0&&goodsList.length==0" style="padding: 50rpx;text-align: center;color: #969799;">
|
|
|
<view class="" v-if="tabIndex==0&&goodsList.length==0"
|
|
|
style="padding: 50rpx;text-align: center;color: #969799;">
|
|
|
暂无符合要求的商品
|
|
|
</view>
|
|
|
<view class="" v-if="tabIndex == 0" style="display: flex; justify-content: space-between;flex-wrap: wrap;margin-top: 44rpx;">
|
|
|
<view class="goodsBox" v-for="(item,index) in goodsList" :key="index" style="width: 330rpx; background: #fff; margin-bottom: 24rpx;padding-bottom: 18rpx;position: relative;border-radius: 16rpx 16rpx 0 0;"
|
|
|
@click="goGoodDetailXz(item.goods_id)">
|
|
|
<view class="" v-if="tabIndex == 0"
|
|
|
style="display: flex; justify-content: space-between;flex-wrap: wrap;margin-top: 44rpx;">
|
|
|
<view class="goodsBox" v-for="(item,index) in goodsList" :key="index"
|
|
|
style="width: 330rpx; background: #fff; margin-bottom: 24rpx;padding-bottom: 18rpx;position: relative;border-radius: 16rpx 16rpx 0 0;"
|
|
|
@click="goGoodDetailXz(item.goods_id)">
|
|
|
<view class="goodsPic">
|
|
|
<image :src="item.images[0]" class="goodImg" mode="aspectFill"></image>
|
|
|
</view>
|
...
|
...
|
@@ -163,7 +177,8 @@ |
|
|
</view>
|
|
|
</view>
|
|
|
<view class="userRight" style="display: flex;align-items: center;">
|
|
|
<image src="/static/image/zuanshi_icon_1@2x.png" mode="" style="width:20rpx;height: 17rpx;margin-right: 12rpx;"></image>
|
|
|
<image src="/static/image/zuanshi_icon_1@2x.png" mode=""
|
|
|
style="width:20rpx;height: 17rpx;margin-right: 12rpx;"></image>
|
|
|
<view class="" style="font-size:18rpx;color: #fff;padding-bottom: 6rpx;">
|
|
|
{{item.user.grade_status==0?'L0':item.user.grade_status==1?'L1':item.user.grade_status==2?'L2':item.user.grade_status==3?'L3':item.user.grade_status==4?'L4':'L5'}}
|
|
|
</view>
|
...
|
...
|
@@ -172,7 +187,8 @@ |
|
|
</view>
|
|
|
<view class="addressMask">
|
|
|
<image src="/static/image/dingwei_icon_1@2x.png" mode=""></image>
|
|
|
<view class="maskAddress" style="max-width: 192rpx;white-space: nowrap;overflow: hidden;text-overflow: ellipsis;">
|
|
|
<view class="maskAddress"
|
|
|
style="max-width: 192rpx;white-space: nowrap;overflow: hidden;text-overflow: ellipsis;">
|
|
|
{{item.address}}
|
|
|
</view>
|
|
|
<view class="maskAddress">
|
...
|
...
|
@@ -181,12 +197,15 @@ |
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
<view class="" v-if="tabIndex==1&&goodsList1.length==0" style="padding: 50rpx;text-align: center;color: #969799;">
|
|
|
<view class="" v-if="tabIndex==1&&goodsList1.length==0"
|
|
|
style="padding: 50rpx;text-align: center;color: #969799;">
|
|
|
暂无符合要求的商品
|
|
|
</view>
|
|
|
<view class="" v-if="tabIndex == 1" style="display: flex; justify-content: space-between;flex-wrap: wrap;margin-top: 44rpx;">
|
|
|
<view class="goodsBox" v-for="(item,index) in goodsList1" :key="index" style="width: 330rpx; background: #fff; margin-bottom: 24rpx;padding-bottom: 18rpx;position: relative;border-radius: 16rpx 16rpx 0 0;"
|
|
|
@click="goGoodDetailFx(item.id)">
|
|
|
<view class="" v-if="tabIndex == 1"
|
|
|
style="display: flex; justify-content: space-between;flex-wrap: wrap;margin-top: 44rpx;">
|
|
|
<view class="goodsBox" v-for="(item,index) in goodsList1" :key="index"
|
|
|
style="width: 330rpx; background: #fff; margin-bottom: 24rpx;padding-bottom: 18rpx;position: relative;border-radius: 16rpx 16rpx 0 0;"
|
|
|
@click="goGoodDetailFx(item.id)">
|
|
|
<view class="goodsPic">
|
|
|
<image :src="item.images[0]" mode="" class="goodImg" mode="aspectFit"></image>
|
|
|
</view>
|
...
|
...
|
@@ -208,7 +227,8 @@ |
|
|
|
|
|
</view>
|
|
|
<view class="userRight" style="display: flex;align-items: center;">
|
|
|
<image src="/static/image/zuanshi_icon_1@2x.png" mode="" style="width:20rpx;height: 17rpx;margin-right: 12rpx;"></image>
|
|
|
<image src="/static/image/zuanshi_icon_1@2x.png" mode=""
|
|
|
style="width:20rpx;height: 17rpx;margin-right: 12rpx;"></image>
|
|
|
<view class="" style="font-size:18rpx;color: #fff;padding-bottom: 6rpx;">
|
|
|
{{item.user.grade_status==0?'L0':item.user.grade_status==1?'L1':item.grade_status==2?'L2':item.grade_status==3?'L3':item.grade_status==4?'L4':'L5'}}
|
|
|
</view>
|
...
|
...
|
@@ -217,7 +237,8 @@ |
|
|
</view>
|
|
|
<view class="addressMask">
|
|
|
<image src="/static/image/dingwei_icon_1@2x.png" mode=""></image>
|
|
|
<view class="maskAddress" style="max-width: 192rpx;white-space: nowrap;overflow: hidden;text-overflow: ellipsis;">
|
|
|
<view class="maskAddress"
|
|
|
style="max-width: 192rpx;white-space: nowrap;overflow: hidden;text-overflow: ellipsis;">
|
|
|
{{item.address}}
|
|
|
</view>
|
|
|
<view class="maskAddress">
|
...
|
...
|
@@ -231,14 +252,17 @@ |
|
|
</view>
|
|
|
</view>
|
|
|
<view class="meFa">
|
|
|
<van-popup :show="show" position="bottom" custom-style="height: 322rpx;border-top-left-radius: 50rpx;border-top-right-radius: 50rpx;"
|
|
|
@close="onClose">
|
|
|
<van-popup :show="show" position="bottom"
|
|
|
custom-style="height: 322rpx;border-top-left-radius: 50rpx;border-top-right-radius: 50rpx;"
|
|
|
@close="onClose">
|
|
|
<view class="meFaShow">
|
|
|
<view class="OnBuyProject" @click="OnBuyProject">
|
|
|
<image src="../../static/image/maixianzhi_icon@2x.png" style="width: 180rpx;height: 180rpx;" mode=""></image>
|
|
|
<image src="../../static/image/maixianzhi_icon@2x.png" style="width: 180rpx;height: 180rpx;"
|
|
|
mode=""></image>
|
|
|
</view>
|
|
|
<view class="OnMaiProject" @click="OnMaiProject">
|
|
|
<image src="../../static/image/faxuqiu_icon_1@2x.png" style="width: 180rpx;height: 180rpx;" mode=""></image>
|
|
|
<image src="../../static/image/faxuqiu_icon_1@2x.png" style="width: 180rpx;height: 180rpx;"
|
|
|
mode=""></image>
|
|
|
</view>
|
|
|
</view>
|
|
|
<view class="onFaClose" @click="onClose">
|
...
|
...
|
@@ -248,21 +272,25 @@ |
|
|
</view>
|
|
|
<ul class="bottom">
|
|
|
<li @click="goIndex">
|
|
|
<image src="../../static/image/xianzhi_icon_1@2x.png" style="width: 48rpx;height: 44rpx;" mode=""></image>
|
|
|
<image src="../../static/image/xianzhi_icon_1@2x.png" style="width: 48rpx;height: 44rpx;" mode="">
|
|
|
</image>
|
|
|
<text class="botTextXZ">闲置</text>
|
|
|
</li>
|
|
|
<li @click="goActuvity">
|
|
|
<image src="../../static/image/huodong_icon_5@2x.png" style="width: 48rpx;height: 44rpx;" mode=""></image>
|
|
|
<image src="../../static/image/huodong_icon_5@2x.png" style="width: 48rpx;height: 44rpx;" mode="">
|
|
|
</image>
|
|
|
<text class="botText">活动</text>
|
|
|
</li>
|
|
|
<li @click="goFa">
|
|
|
<view class="fabu">
|
|
|
<image src="../../static/image/fabu_icon_1@2x.png" style="width: 88rpx;height: 88rpx;" mode=""></image>
|
|
|
<image src="../../static/image/fabu_icon_1@2x.png" style="width: 88rpx;height: 88rpx;" mode="">
|
|
|
</image>
|
|
|
<text class="botTextFa">发布</text>
|
|
|
</view>
|
|
|
</li>
|
|
|
<li @click="goMessage" style="position: relative;">
|
|
|
<image src="../../static/image/xiaoxi_icon_5@2x.png" style="width: 48rpx;height: 44rpx;" mode=""></image>
|
|
|
<image src="../../static/image/xiaoxi_icon_5@2x.png" style="width: 48rpx;height: 44rpx;" mode="">
|
|
|
</image>
|
|
|
<text class="botText">消息</text>
|
|
|
<view class="num" v-if="messageNum!==0">
|
|
|
{{messageNum>99?'99+':messageNum}}
|
...
|
...
|
@@ -286,20 +314,114 @@ |
|
|
uni.setStorageSync('pid', options.userId)
|
|
|
if (options.address) {
|
|
|
this.addressText = options.address
|
|
|
uni.setStorageSync('aaa', 11)
|
|
|
uni.setStorageSync('City', options.address)
|
|
|
uni.setStorageSync('lat', options.lat)
|
|
|
uni.setStorageSync('lot', options.lot)
|
|
|
} else {
|
|
|
|
|
|
}
|
|
|
|
|
|
} else {}
|
|
|
if (uni.getStorageSync('token')) {
|
|
|
this.token = true
|
|
|
}
|
|
|
|
|
|
},
|
|
|
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();
|
...
|
...
|
@@ -314,12 +436,15 @@ |
|
|
this.jvliSelect(); //距离选择
|
|
|
this.classifylistss(); //分类选择
|
|
|
this.goodsXy(); //发现需要
|
|
|
|
|
|
this.messageNums() //留言个数
|
|
|
}, 500)
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
nowlocationLat:'', //每次进入维度
|
|
|
nowlocationLot:'', //每次进入经度
|
|
|
nowlocationAddress:'', //每次进入详细位置
|
|
|
firstTime: 0, //判断第几次进入该页面
|
|
|
token: false,
|
|
|
pageNums: 1,
|
|
|
pageNum: 1,
|
...
|
...
|
@@ -337,7 +462,8 @@ |
|
|
IndexImg: 'https://s3.ax1x.com/2021/01/11/s8PyTK.png',
|
|
|
address: '', //定位
|
|
|
inputValue: '',
|
|
|
//拼团
|
|
|
//积分活动
|
|
|
activeShow:true, //积分活动是否显示
|
|
|
listTypecont: [],
|
|
|
scrollTop: 0,
|
|
|
tabList: ['闲置物品', '发现需要'],
|
...
|
...
|
@@ -401,27 +527,32 @@ |
|
|
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: {
|
|
|
// key: '6XOBZ-DMOEI-3DOGU-5LVWI-RDNWS-HHBUU',
|
|
|
key: 'Y4PBZ-MBQ3Q-XSV5A-GWLXE-HXV4E-JNB3P',
|
|
|
location: (r.latitude + "," + r.longitude)
|
|
|
},
|
|
|
success: res => {
|
|
|
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
|
|
|
wx.setStorageSync('locationCity', res.data.result.address_component
|
|
|
.city)
|
|
|
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 == '') {
|
|
|
if (uni.getStorageSync("City") == "") {
|
|
|
that.addressText = res.data.result.address_component.city
|
|
|
} else {
|
|
|
that.addressText = uni.getStorageSync("City")
|
|
|
}
|
|
|
// if (that.addressText == '') {
|
|
|
if (uni.getStorageSync("City") == "") {
|
|
|
that.addressText = res.data.result.address_component.city
|
|
|
} else {
|
|
|
that.addressText = uni.getStorageSync("City")
|
|
|
}
|
|
|
// }
|
|
|
}
|
|
|
})
|
|
|
},
|
...
|
...
|
@@ -449,7 +580,8 @@ |
|
|
if (res.confirm) {
|
|
|
wx.openSetting({
|
|
|
success: data => {
|
|
|
if (data.authSetting["scope.userLocation"]) {
|
|
|
if (data.authSetting[
|
|
|
"scope.userLocation"]) {
|
|
|
this.getLocations()
|
|
|
}
|
|
|
}
|
...
|
...
|
@@ -488,7 +620,8 @@ |
|
|
if (res.confirm) {
|
|
|
wx.openSetting({
|
|
|
success: data => {
|
|
|
if (data.authSetting["scope.userLocation"]) {
|
|
|
if (data.authSetting[
|
|
|
"scope.userLocation"]) {
|
|
|
this.getLocations()
|
|
|
}
|
|
|
}
|
...
|
...
|
@@ -561,11 +694,12 @@ |
|
|
list.forEach((item, index) => {
|
|
|
this.classArray.push(item.name)
|
|
|
})
|
|
|
this.classArray.unshift('全部')
|
|
|
// this.ClassifyList.unshift({
|
|
|
// id: '',
|
|
|
// name: '全部'
|
|
|
// })
|
|
|
let lists = this.classArray
|
|
|
lists.forEach((item, index) => {
|
|
|
if (index == 0 && item !== '全部') {
|
|
|
this.classArray.unshift('全部')
|
|
|
}
|
|
|
})
|
|
|
}).catch(ex => {
|
|
|
|
|
|
});
|
...
|
...
|
@@ -580,6 +714,17 @@ |
|
|
this.arrayList.push(item)
|
|
|
this.goodsXz(); //闲置物品
|
|
|
})
|
|
|
let lists = this.arrayList
|
|
|
lists.forEach((item, index) => {
|
|
|
if (index == 0 && item.long !== '全部') {
|
|
|
this.arrayList.unshift({
|
|
|
id: '',
|
|
|
long: '全部'
|
|
|
})
|
|
|
this.array.unshift('全部')
|
|
|
}
|
|
|
})
|
|
|
|
|
|
}).catch(ex => {
|
|
|
|
|
|
});
|
...
|
...
|
@@ -599,8 +744,8 @@ |
|
|
name: '全部'
|
|
|
})
|
|
|
let list = this.ClassifyList
|
|
|
list.forEach((item,index)=>{
|
|
|
if(item.name!=='全部'){
|
|
|
list.forEach((item, index) => {
|
|
|
if (item.name !== '全部') {
|
|
|
this.ClassifyList1.push(item)
|
|
|
}
|
|
|
})
|
...
|
...
|
@@ -613,13 +758,15 @@ |
|
|
//闲置商品
|
|
|
goGoodDetailXz(ids) {
|
|
|
uni.navigateTo({
|
|
|
url: "/pages/index/good-details?goos_id=" + ids + '&index=1'
|
|
|
url: "/pages/index/good-details?goos_id=" + ids + '&index=1' + '&lat=' + uni.getStorageSync(
|
|
|
'lat') + '&lot=' + uni.getStorageSync('lot')
|
|
|
})
|
|
|
},
|
|
|
//发现需要
|
|
|
goGoodDetailFx(ids) {
|
|
|
uni.navigateTo({
|
|
|
url: "/pages/index/good-details?id=" + ids + '&index=2'
|
|
|
url: "/pages/index/good-details?id=" + ids + '&index=2' + '&lat=' + uni.getStorageSync('lat') +
|
|
|
'&lot=' + uni.getStorageSync('lot')
|
|
|
})
|
|
|
},
|
|
|
//全部分类
|
...
|
...
|
@@ -755,16 +902,6 @@ |
|
|
onClose() {
|
|
|
this.show = false
|
|
|
},
|
|
|
// getAuthorizeInfo(a = "scope.userLocation") {
|
|
|
// var _this = this;
|
|
|
// uni.authorize({
|
|
|
// scope: a,
|
|
|
// success() {
|
|
|
// _this.getocations() //定位;
|
|
|
// },
|
|
|
// fail() {}
|
|
|
// })
|
|
|
// }
|
|
|
//留言个数
|
|
|
messageNums() {
|
|
|
request.get('/api/mation/unreadNumber', {}).then(res => {
|
...
|
...
|
@@ -772,7 +909,22 @@ |
|
|
}).catch(err => {
|
|
|
|
|
|
})
|
|
|
}
|
|
|
},
|
|
|
//分享
|
|
|
onShareAppMessage: function(e) {
|
|
|
let title = '最火社区闲置二手信息平台'
|
|
|
return {
|
|
|
title: title,
|
|
|
path: ''
|
|
|
}
|
|
|
},
|
|
|
onShareTimeline() {
|
|
|
return {
|
|
|
title: '最火社区闲置二手信息平台',
|
|
|
query: {},
|
|
|
imageUrl: '',
|
|
|
}
|
|
|
},
|
|
|
}
|
|
|
}
|
|
|
</script>
|
...
|
...
|
|