作者 倪静楠

3/19

... ... @@ -2,6 +2,7 @@
export default {
onLaunch: function() {
console.log('App Launch');
uni.setStorageSync('fristEnter',true)
},
onShow: function() {
console.log('App Show');
... ...
... ... @@ -29,8 +29,8 @@
.berAddresxz {
margin: 0 4rpx 0 12rpx;
color: #22272B;
font-size: 28rpx;
max-width: 280rpx;
font-size: 32rpx;
max-width: 330rpx;
display: -webkit-box;
word-break: break-all;
text-overflow: ellipsis;
... ...
... ... @@ -12,7 +12,6 @@
}
.wantBox {
margin-top: 16rpx;
font-size: 24rpx;
color: #969799;
}
... ...
... ... @@ -348,6 +348,7 @@
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
font-weight: 600;
}
.goodsPrice {
... ...
... ... @@ -111,6 +111,7 @@
.mesOneTitle {
color: #22272B;
font-size: 28rpx;
font-weight: 800;
margin: 36rpx 0 32rpx 32rpx;
}
... ... @@ -142,6 +143,8 @@
border-bottom: 2rpx solid #EBEDF0;
max-height: 154rpx;
overflow: hidden;
color: #879099;
font-size: 24rpx;
}
.mesTreRow {
... ...
... ... @@ -28,8 +28,8 @@
.berAddresxz {
margin: 0 4rpx 0 12rpx;
color: #22272B;
font-size: 28rpx;
max-width: 280rpx;
font-size: 32rpx;
max-width: 330rpx;
display: -webkit-box;
word-break: break-all;
text-overflow: ellipsis;
... ...
<template>
<view class="" style="background-color: #f7f8fa; width: 100%;padding-bottom: 424rpx;" v-if="goodsData.num">
<view class="">
<view class="" style="height: 568rpx;">
<swiper class="swiper" :indicator-dots="indicatorDots" :autoplay="autoplay" :interval="interval" :duration="duration"
:circular="true">
:circular="true" style="height: 100%;">
<swiper-item v-for="(item,index) in swiperList" :key="index">
<image :src="item" mode="" class="swiper" style="height: 100%;" ></image>
<view class="swiperLength">
... ... @@ -32,8 +32,8 @@
<rich-text :nodes="content"></rich-text>
<!-- <image src="https://s3.ax1x.com/2021/01/11/s8Psw6.png" mode=""></image> -->
</view>
<view class="btnBj">
<view class="" style="height: 242rpx;background: #ffffff;margin-top: 16rpx;border-bottom: 16rpx solid #f7f8fa;">
<view class="btnBj" style="height: 540rpx;">
<view class="" style="height:332rpx;background: #ffffff;margin-top: 16rpx;border-bottom: 16rpx solid #f7f8fa;">
<view class="" style="margin: 24rpx 0 32rpx 32rpx;">
<text>我的报名信息</text>
</view>
... ... @@ -45,10 +45,15 @@
<text class="cluNavText">联系方式</text>
<text class="sterNavText">{{userData.phone}}</text>
</view>
<view class="" style="padding:14rpx 32rpx;">
<text class="cluNavText">报名地址</text>
<text class="sterNavText">{{userData.address}}</text>
</view>
</view>
<view class="" style="height: 152rpx;background: #ffffff; display: flex;flex-direction: column;">
<view class="" style="margin: 14rpx 32rpx;">
<text class="cluNavText">订单编号</text>
<text class="cluNavText">订单编号</text>s
<text class="sterNavText">{{userData.order_no}}</text>
</view>
<view class="" style="margin: 14rpx 32rpx;">
... ...
... ... @@ -248,7 +248,7 @@
goUSER(){
let id=uni.getStorageSync('userInfo').id
uni.navigateTo({
url:'/pages/index/user-page?id='+id
url:'/pages/index/user-page?id='+id+'&lat='+uni.getStorageSync('lat')+'&lot='+uni.getStorageSync('lot')
})
},
//
... ...
... ... @@ -89,7 +89,7 @@
},
//分享
onShareAppMessage: function(e) {
let title = '最火社区闲置二手信息平台'
let title = '快来社区淘转闲置兑奖吧!'
return {
title: title,
path: "/pages/activity/exchange-detail?id=" + this.id
... ... @@ -97,7 +97,7 @@
},
onShareTimeline() {
return {
title: '最火社区闲置二手信息平台',
title: '快来社区淘转闲置兑奖吧!',
query: {},
imageUrl: '',
}
... ...
... ... @@ -124,7 +124,7 @@
},
//分享
onShareAppMessage: function(e) {
let title = '最火社区闲置二手信息平台'
let title = '快来社区淘转闲置兑奖吧!'
return {
title: title,
path: "/pages/activity/pintu-detail?id=" + this.id+'&lat='+this.lat+'&lot='+this.lot
... ... @@ -132,7 +132,7 @@
},
onShareTimeline() {
return {
title: '最火社区闲置二手信息平台',
title: '快来社区淘转闲置兑奖吧!',
query: {},
imageUrl: '',
}
... ...
... ... @@ -18,7 +18,7 @@
已买
</view> -->
</view>
<scroll-view scroll-y="true" id="chatList" :scroll-top='scrollTop' @scrolltolower="lower()"
<scroll-view scroll-y="true" id="chatList" :scroll-top='scrollTop'
:style="{height:scrollH+'rpx'}">
<view :class="Number(index)==2?'margin1':'margin0'">
<view class="" v-if="index==1">
... ... @@ -121,9 +121,9 @@
},
onShow() {
//默认最底部
setTimeout(() => {
this.scrollTop = 9999
}, 1000)
// setTimeout(() => {
// this.scrollTop = 9999
// }, 3000)
},
computed: {
scrollH: function() {
... ... @@ -193,6 +193,9 @@
}).then(res => {
let list = this.pageNum == 1 ? res.data.info : this.list.concat(res.data.info)
this.list = list
setTimeout(() => {
this.scrollTop = 9999
}, 400)
}).catch(err => {
})
... ... @@ -217,6 +220,9 @@
}).then(res => {
let list = this.pageNum == 1 ? res.data.info : this.list.concat(res.data.info)
this.list = list
setTimeout(() => {
this.scrollTop = 9999
}, 400)
}).catch(err => {
})
... ...
... ... @@ -66,6 +66,9 @@
{{detailData.num2}}人想要
<text style="margin-left: 46rpx;">{{detailData.num}}次浏览</text>
</view>
<view class="wantBox">
发布时间:{{detailData.createtime}}
</view>
</view>
</view>
<view class="messagesBox">
... ... @@ -267,7 +270,6 @@
uniPopupDialog
},
onLoad(options) {
console.log(options, 'options')
this.id = options.id
this.goods_id = options.goos_id
if (options.id === "undefined" || !options.id) {
... ... @@ -334,7 +336,7 @@
//分享
onShareAppMessage: function(e) {
let that = this
let title = '最火社区闲置二手信息平台'
let title = '来到社区淘 闲置就近卖'
return {
title: title,
path: '/pages/index/good-details?userId=' + uni.getStorageSync('userInfo').id + '&goos_id=' + that
... ... @@ -344,15 +346,15 @@
},
onShareTimeline() {
let that = this
var query = {
goos_id: this.goods_id,
lat: this.lat2,
lot: this.lng2
};
query = JSON.stringify(query.data);
// var query = {
// goos_id: this.goods_id,
// lat: this.lat2,
// lot: this.lng2
// };
// query = JSON.stringify(query.data);
return {
title: '最火社区闲置二手信息平台',
query: query,
title: '来到社区淘 闲置就近卖',
query: {},
imageUrl: '',
}
},
... ... @@ -467,7 +469,7 @@
//用户主页
goUserPage() {
uni.navigateTo({
url: '/pages/index/user-page?id=' + this.detailData.user.id
url: '/pages/index/user-page?id=' + this.detailData.user.id+'&lat='+this.lat+'&lot='+this.lot
})
},
//一级分类
... ... @@ -792,9 +794,8 @@
.detailsRightBox {
flex: 1;
padding: 32rpx;
padding: 32rpx 0 0 32rpx;
box-sizing: border-box;
padding-right: 0;
}
.userNameBoxs {
... ... @@ -857,11 +858,12 @@
.goodDetailTitle {
padding: 30rpx 0;
font-size: 32rpx;
font-size: 40rpx;
color: #323233;
font-weight: 600;
padding-bottom: 16rpx;
padding-left: 10rpx;
font-weight: bolder;
}
.goodDetailPrice {
... ... @@ -886,7 +888,6 @@
display: flex;
flex-wrap: wrap;
padding-top: 16rpx;
padding-left: 10rpx;
}
.goodPicList image {
... ...
... ... @@ -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: '',
}
... ...
... ... @@ -14,17 +14,16 @@
登录
<button class="sys_btn" open-type="getUserInfo" lang="zh_CN" @getuserinfo="appLoginWx"></button>
</view>
<view class="btn1" v-if="!checked" @click="login">
<view class="btn1" v-else @click="login">
登录
</view>
<view class="uni-padding-wrap">
<view style="text-align: center;font-size: 24rpx;">
<label class="radio" @change="radioChange"
style="display: flex;align-items: center;justify-content: center;">
<radio value="r1" :checked="checked" @click="radioChange" color="#FF834D" />
<text @click="radioText">我已阅读并同意</text><text style="color:#FF834D;" @click.stop="goUserDeal">《用户服务协议》</text>
</label>
</view>
<view class="hintBox" @click="radioText" style="text-align: center;">
<image src="/static/image/select.png" mode="" style="width: 36rpx;height: 36rpx;margin-right: 14rpx;" v-if="checked"> </image>
<image src="/static/image/unselect.png" mode="" style="width: 36rpx;height: 36rpx;margin-right: 14rpx;" v-else></image>
<text>我已阅读并同意</text><text style="color:#FF834D;" @click.stop="goUserDeal">《用户服务协议》</text>
</view>
<view class="">
<image src="" mode=""></image>
</view>
</view>
</template>
... ... @@ -34,15 +33,12 @@
export default {
data() {
return {
checked: false
checked: ''
}
},
methods: {
radioChange(e) {
this.checked = !this.checked
},
radioText(){
radioText() {
this.checked = !this.checked
},
//用户协议
... ... @@ -118,7 +114,9 @@
<style>
@import url("/common/uni.css");
.button-hover{
background-color: #ff834d !important;
}
.Login {
min-height: 100vh;
background-color: #fff;
... ... @@ -158,7 +156,7 @@
button {
width: 426rpx;
height: 84rpx;
height: 80rpx;
position: absolute;
top: 0;
left: 0;
... ... @@ -166,10 +164,6 @@
border-radius: 48rpx;
}
radio {
transform: scale(0.6);
}
.uni-padding-wrap {
margin-top: 40rpx;
}
... ... @@ -183,4 +177,12 @@
color: #969799;
font-size: 26rpx;
}
.hintBox {
font-size: 26rpx;
display: flex;
align-items: center;
justify-content: center;
margin-top: 24rpx;
}
</style>
... ...
... ... @@ -62,7 +62,7 @@
<!-- <input style="width: 100%;" type="text" value="" placeholder="输入您的留言" v-model="inputValue" @input="keyInput" /> -->
<!-- <textarea type="text" placeholder="请输入您的留言" auto-height :value="inputValue"
@input="keyInput" cursor-spacing="20" ></textarea> -->
<textarea style="max-height: 3em" placeholder="请输入您的留言" :value="inputValue" @input="keyInput" cursor-spacing="10" />
<textarea style="max-height: 3em" :placeholder="placeText" :value="inputValue" @input="keyInput" cursor-spacing="10" />
</view>
<view class="InputBoxText">
<text class="sendBtn" @click="send">发送</text>
... ... @@ -77,12 +77,17 @@
onLoad(options) {
this.id = options.id
this.listData()
},
onShow() {
},
data() {
return {
id: '',
inputValue: '',
postData: {}
postData: {},
placeText:'',
}
},
methods: {
... ... @@ -113,6 +118,8 @@
id: this.id
}).then(res => {
this.postData = res.data.info[0]
let that=this
this.placeText='回复:'+that.postData.nickname
}).catch(err => {
})
... ...
... ... @@ -7,15 +7,19 @@
<input type="text" @input="keywordTyping" @blur="keywordTitle" placeholder="请输入地址" placeholder-class="placeholder-class" />
</view>
<view class="header">当前位置</view>
<view class="current">
<view class="current" style="display: flex;justify-content: space-between;">
<!-- <text @click="geoTapped">{{address}}</text>
<image @click="reloadCurrent" src="../../images/geo.png" /> -->
<view class="" @click="getNowAdd" style="color: #007AFF;">
<view class="" @click="getNowAdd" style="color: #007AFF;max-width: 500rpx;overflow: hidden;white-space: nowrap;text-overflow: ellipsis;">
{{nowAddres}}
</view>
<view class="" @click="getlocation" style="display: flex;align-items: center;font-size: 24rpx;color: #ff8861;">
<image src="../../static/image/Frame_11@2x.png" mode="" style="width: 28rpx;height: 28rpx;margin-right: 6rpx;"></image>
重新定位
</view>
</view>
<view class="header">历史位置</view>
<view class="current">
<view class="current" style="">
<!-- <text @click="geoTapped">{{address}}</text>
<image @click="reloadCurrent" src="../../images/geo.png" /> -->
<view class="" v-for="(item,index) in list" :key="index" @click="addressTapped(item.address,item.lat2,item.lng2)">
... ... @@ -73,11 +77,41 @@
methods: {
//使用当前位置
getNowAdd(){
uni.removeStorageSync('getNowAdd')
uni.redirectTo({
url: '/pages/index/index?address=' +this.nowAddres + '&lat=' + this.lat + '&lot=' + this.lot
})
},
//重新定位
getlocation(){
let that = this
uni.getLocation({
type: 'gcj02',
altitude: true,
success(r) {
uni.setStorageSync('nowLat', r.latitude)
uni.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 => {
console.log(res,'res')
that.nowAddres= res.data.result.formatted_addresses.recommend
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")
}
}
})
},
fail(err) {}
})
},
//获取历史位置
getAdress() {
request.get('/api/index/addressList', {}).then(res => {
... ... @@ -121,8 +155,8 @@
},
addressTapped: function(title, lat, lot,city) {
console.log(lat,lot)
uni.setStorageSync('selectCity',city)
uni.setStorageSync('selectCity',title)
// uni.setStorageSync('selectlat',lat)
// uni.setStorageSync('selectlot',lot)
// var title = e.currentTarget.dataset.title;
// 取出点中的地址,然后使用WxNotification回传给首页
// WxNotificationCenter.postNotificationName("addressSelectedNotification", title);
... ...
... ... @@ -176,6 +176,11 @@
export default {
onLoad(options) {
this.id = options.id
if(options.lat){
this.lat2=options.lat,
this.lot2=options.lot
}
this.basicInfo()
this.allPing()
this.buy()
... ... @@ -192,12 +197,36 @@
tabIndex: 0,
goodsList: [],
buyList: [],
lat2:'',
lot2:'',
}
},
created() {
},
//分享
onShareAppMessage: function(e) {
let title = '来到社区淘 闲置就近卖'
return {
title: title,
path: "/pages/index/user-page?id="+this.id
}
},
onShareTimeline() {
var query = {
id: this.id,
lat: this.lat2,
lot: this.lng2
};
query = JSON.stringify(query.data);
return {
title: '来到社区淘 闲置就近卖',
query: query,
imageUrl: '',
}
},
methods: {
goBack() {
uni.navigateBack({
... ... @@ -246,8 +275,8 @@
rows: 10,
pages: this.pageNum,
user_id: this.id,
lat2: uni.getStorageSync('lat'),
lng2: uni.getStorageSync('lot')
lat2: uni.getStorageSync('lat')?uni.getStorageSync('lat'):this.lat2,
lng2: uni.getStorageSync('lot')?uni.getStorageSync('lot'):this.lot2
}).then(res => {
this.goodsList = res.data.info.data
}).catch(err => {
... ... @@ -260,8 +289,8 @@
rows: 10,
pages: this.pageNum,
user_id: this.id,
lat2: uni.getStorageSync('lat'),
lng2: uni.getStorageSync('lot')
lat2: uni.getStorageSync('lat')?uni.getStorageSync('lat'):this.lat2,
lng2: uni.getStorageSync('lot')? uni.getStorageSync('lot'):this.lot2,
}).then(res => {
this.buyList = res.data.info.data
}).catch(err => {
... ... @@ -271,13 +300,27 @@
//商品详情
goGoodDetail(id) {
if(this.tabIndex==1){
uni.navigateTo({
url: '/pages/index/good-details?id=' + id+'&lat='+uni.getStorageSync('lat')+'&lot='+uni.getStorageSync('lot')
})
if(uni.getStorageSync('lat')){
uni.navigateTo({
url: '/pages/index/good-details?id=' + id+'&lat='+uni.getStorageSync('lat')+'&lot='+uni.getStorageSync('lot')
})
}else{
uni.navigateTo({
url: '/pages/index/good-details?id=' + id+'&lat='+this.lat2+'&lot='+this.lot2
})
}
}else{
uni.navigateTo({
url: '/pages/index/good-details?goos_id=' + id+'&lat='+uni.getStorageSync('lat')+'&lot='+uni.getStorageSync('lot')
})
if(uni.getStorageSync('lat')){
uni.navigateTo({
url: '/pages/index/good-details?goos_id=' + id+'&lat='+uni.getStorageSync('lat')+'&lot='+uni.getStorageSync('lot')
})
}else{
uni.navigateTo({
url: '/pages/index/good-details?goos_id=' + id+'&lat='+this.lat2+'&lot='+this.lot2
})
}
}
// uni.navigateTo({
// url: '/pages/index/good-details?goos_id=' + id
... ...
... ... @@ -123,6 +123,9 @@
tempFilePaths: [] //多张上传
}
},
onShow() {
this.getlocation()
},
created() {
if (uni.getStorageSync('token')) {
this.token = true
... ... @@ -164,7 +167,6 @@
that.urlImg.push(uploadList.save_path)
}
});
// })
})
}
... ... @@ -270,6 +272,33 @@
}
});
},
getlocation(){
let that = this
uni.getLocation({
type: 'gcj02',
altitude: true,
success(r) {
console.log(r)
// uni.setStorageSync('nowLat', r.latitude)
// uni.setStorageSync('nowLot', r.longitude)
that.latitude=r.latitude
that.longitude=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 => {
console.log(res,'res')
that.SelectAddress= res.data.result.formatted_addresses.recommend
// }
}
})
},
fail(err) {}
})
},
//发布需求
publish() {
if (this.btn) {
... ... @@ -348,26 +377,26 @@
})
} else {
request.get('/api/push/xianZhi', {
lat: this.latitude,
lng: this.longitude,
address: this.address,
goods_name: this.inputVlaue,
images: this.urlImg.toString(),
content: this.areaValue,
price: this.peiceValue,
sort_id: this.arrayId[this.arrayIndex],
sort2_id: this.arrayId2[this.arrayIndex2],
damage_id: this.degreeId[this.degreeArrayIndex],
lat: that.latitude,
lng: that.longitude,
address: that.address,
goods_name: that.inputVlaue,
images: that.urlImg.toString(),
content: that.areaValue,
price: that.peiceValue,
sort_id: that.arrayId[that.arrayIndex],
sort2_id: that.arrayId2[that.arrayIndex2],
damage_id: that.degreeId[that.degreeArrayIndex],
is_notify: ''
}).then(res => {
if (res.code == 1) {
// this.btn=false
that.btn=false
uni.showToast({
title: res.msg,
duration: 2000,
icon: 'none'
})
this.btn = false
that.btn = false
setTimeout(() => {
uni.navigateTo({
url: '/pages/index/index'
... ...
... ... @@ -74,7 +74,6 @@
</van-popup>
</view>
</van-cell-group>
</view>
</view>
<view class="BtnBackup">
... ... @@ -119,6 +118,9 @@
tempFilePaths: [] //多张上传
}
},
onShow() {
this.getlocation()
},
created() {
if (uni.getStorageSync('token')) {
... ... @@ -265,6 +267,30 @@
},
});
},
getlocation(){
let that = this
uni.getLocation({
type: 'gcj02',
altitude: true,
success(r) {
// uni.setStorageSync('nowLat', r.latitude)
// uni.setStorageSync('nowLot', r.longitude)
that.latitude=r.latitude
that.longitude=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 => {
that.SelectAddress=res.data.result.formatted_addresses.recommend
}
})
},
fail(err) {}
})
},
//发布需求
publish() {
if (this.btn) {
... ...