|
|
<template>
|
|
|
<view :class="shareBj||haibao?'minHeight':''" style="min-height: 100%;background-color: #F7F8FA;padding-top: 32rpx;box-sizing: border-box;">
|
|
|
<view class="goodDetailsBox" v-if="detailData">
|
|
|
<view class="goodDetailsBox" v-if="detailData.user.avatar">
|
|
|
<view class="detailsLeftBox" @click="goUserPage">
|
|
|
<image :src="detailData.user.avatar" mode="aspectFill"></image>
|
|
|
</view>
|
...
|
...
|
@@ -128,9 +128,9 @@ |
|
|
<view class="maskAddress">
|
|
|
{{item.address}}
|
|
|
</view>
|
|
|
<!-- <view class="maskAddress">
|
|
|
{{item.dis}}km
|
|
|
</view> -->
|
|
|
<view class="maskAddress">
|
|
|
{{item.dis.toFixed(1)}}km
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
...
|
...
|
@@ -155,8 +155,8 @@ |
|
|
</view>
|
|
|
</uni-popup>
|
|
|
<view class="btnBox" style="">
|
|
|
<view class="btnItem">
|
|
|
<view class="iconfont icon-fenxiang1" @click="open"></view>
|
|
|
<view class="btnItem" @click="open">
|
|
|
<view class="iconfont icon-fenxiang1"></view>
|
|
|
分享
|
|
|
</view>
|
|
|
<view class="btnItem" @click="collect">
|
...
|
...
|
@@ -215,10 +215,13 @@ |
|
|
onLoad(options) {
|
|
|
this.id = options.id
|
|
|
this.goods_id = options.goos_id
|
|
|
if (options.id != undefined) {
|
|
|
this.needsDetail()
|
|
|
console.log(options,'optionss')
|
|
|
if (options.id==="undefined" || !options.id) {
|
|
|
console.log('111111111111111')
|
|
|
this.goodsDetail()
|
|
|
} else {
|
|
|
this.goodsDetail()
|
|
|
console.log('2222222222222222')
|
|
|
this.needsDetail()
|
|
|
}
|
|
|
},
|
|
|
|
...
|
...
|
@@ -226,7 +229,7 @@ |
|
|
return {
|
|
|
token: false,
|
|
|
pageNum: 1,
|
|
|
id: '',
|
|
|
id: -1,
|
|
|
goods_id: '',
|
|
|
index: '', //tabIndex
|
|
|
classifyId: '', //商品一级分类
|
...
|
...
|
@@ -256,16 +259,17 @@ |
|
|
},
|
|
|
//分享
|
|
|
onShareAppMessage: function(e) {
|
|
|
let title = '快来和我一起体验吧!'
|
|
|
let that =this
|
|
|
let title = '最火社区闲置二手信息平台'
|
|
|
return {
|
|
|
title: title,
|
|
|
path: '/pages/index/index?userId=' + uni.getStorageSync('userInfo').id
|
|
|
path: '/pages/index/good-details?userId=' + uni.getStorageSync('userInfo').id+'&goos_id='+that.goods_id+'&id='+that.id
|
|
|
}
|
|
|
},
|
|
|
onShareTimeline() {
|
|
|
let that = this
|
|
|
return {
|
|
|
title: '快来和我一起体验吧!',
|
|
|
title: '最火社区闲置二手信息平台',
|
|
|
query: 'goods_id=' + that.goos_id + '&id=' + that.id,
|
|
|
imageUrl: 'http://123.png',
|
|
|
}
|
...
|
...
|
@@ -411,8 +415,8 @@ |
|
|
//发布商品详情
|
|
|
goodsDetail() {
|
|
|
request.get('/api/goods/maiDetail', {
|
|
|
lat2: uni.getStorageSync('lat'),
|
|
|
lng2: uni.getStorageSync('lot'),
|
|
|
lat2: uni.getStorageSync('lat')? uni.getStorageSync('lat'):'',
|
|
|
lng2: uni.getStorageSync('lot')? uni.getStorageSync('lot'):'',
|
|
|
goods_id: this.goods_id
|
|
|
}).then(res => {
|
|
|
this.detailData = res.data
|
...
|
...
|
|