|
|
<template>
|
|
|
<view class="container">
|
|
|
<!-- 操作演示start -->
|
|
|
<view class="demoBox" v-if="demo">
|
|
|
<view class="">
|
|
|
<image src="http://muying.qiniu.broing.cn/uploads/20210621/a374e24f9e49e985dd0d6bdb09ee77c8.png" mode=""
|
|
|
class="img" mode="widthFix" v-if="imgIndex==1"></image>
|
|
|
<image src="http://muying.qiniu.broing.cn/uploads/20210621/65d339232a2b077c22d057dd84defbec.png" mode=""
|
|
|
class="img" mode="widthFix" v-if="imgIndex==2"></image>
|
|
|
<image src="http://muying.qiniu.broing.cn/uploads/20210621/e988294593944ee314cd6a59976907c9.png" mode=""
|
|
|
class="img" mode="widthFix" v-if="imgIndex==3"></image>
|
|
|
<image src="http://muying.qiniu.broing.cn/uploads/20210621/ea6192f56861b55304eeefae6cb80db6.png" mode=""
|
|
|
class="img" mode="widthFix" v-if="imgIndex==4"></image>
|
|
|
<image src="http://muying.qiniu.broing.cn/uploads/20210621/bafe2810d884fbfd13592c0c50b311ac.png" mode=""
|
|
|
class="img" mode="widthFix" v-if="imgIndex==5"></image>
|
|
|
<image src="http://muying.qiniu.broing.cn/uploads/20210621/3c5365b28ce34d8a40844bd50cd3bfb9.png" mode=""
|
|
|
class="img" mode="widthFix" v-if="imgIndex==6"></image>
|
|
|
<image src="http://muying.qiniu.broing.cn/uploads/20210621/856869f0413ceb5931a53015dbe3dc1f.png" mode=""
|
|
|
class="img" mode="widthFix" v-if="imgIndex==7"></image>
|
|
|
<image src="http://muying.qiniu.broing.cn/uploads/20210621/9aa43baab9b429d6aaaf0a35ef933403.png" mode=""
|
|
|
class="img" mode="widthFix" v-if="imgIndex==8"></image>
|
|
|
<image src="http://muying.qiniu.broing.cn/uploads/20210621/6273b6d62cc0704c72336fbe610b2d80.png" mode=""
|
|
|
class="img" mode="widthFix" v-if="imgIndex==9"></image>
|
|
|
</view>
|
|
|
<view class="btnBox">
|
|
|
<view class="" @click="compile" v-if="imgIndex==9">
|
|
|
完成
|
|
|
</view>
|
|
|
<view class="" @click="bottomClick" v-else>
|
|
|
下一步
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
<!-- 操作演示end -->
|
|
|
<view class="" v-if="!demo">
|
|
|
<image :src="IndexImg" style="width: 100%;display: none;" mode=""></image>
|
|
|
<view class=""
|
|
|
style="position: fixed;top: 0;left: 0;height:176rpx;width: 100%;z-index: 99999;overflow: hidden;background-color: #fff;">
|
...
|
...
|
@@ -8,10 +41,6 @@ |
|
|
style="font-size:34rpx;color: #FF824D;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" style="position: fixed;top:62px;left: 320rpx;">
|
|
|
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
<view class="all">
|
...
|
...
|
@@ -33,7 +62,8 @@ |
|
|
</view>
|
|
|
<view class="mapBox" @click="cangbao">
|
|
|
<view class="picBox">
|
|
|
<image src="/static/image/cangbaotu_ico.png" mode="" style="width: 36rpx;height: 36rpx;">
|
|
|
<image src="/static/image/cangbaotu_ico.png" mode=""
|
|
|
style="width: 36rpx;height: 36rpx;">
|
|
|
</image>
|
|
|
</view>
|
|
|
<view class="mapText">
|
...
|
...
|
@@ -84,8 +114,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>
|
...
|
...
|
@@ -137,7 +167,8 @@ |
|
|
分类
|
|
|
</view>
|
|
|
<view class="picker" style="position: relative;">
|
|
|
<picker @change="bindPickerChange1" :value="index1" :range="classArray" class="picker">
|
|
|
<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=""
|
...
|
...
|
@@ -165,13 +196,13 @@ |
|
|
@click="goGoodDetailXz(item.goods_id,item.title,item.ad_id)">
|
|
|
<!-- <view class="" v-if="item.goods_id!=undefined||item.title!=undefined"> -->
|
|
|
<view class="goodsPic">
|
|
|
<image :src="item.images[0]||item.title_image" class="goodImg" mode="aspectFill">
|
|
|
<image :src="item.images[0]||item.title_image" class="goodImg" mode="widthFix">
|
|
|
</image>
|
|
|
</view>
|
|
|
<view class="goodsDel">
|
|
|
{{item.goods_name?item.goods_name:item.title}}
|
|
|
</view>
|
|
|
<view class="goodsPrice" v-if="item.price">
|
|
|
<view :class="item.price?'goodsPrice':'goodsPrices'">
|
|
|
<text style="font-size: 24rpx;margin-right: -6rpx;">¥</text>
|
|
|
{{item.price||''}}
|
|
|
</view>
|
...
|
...
|
@@ -188,7 +219,7 @@ |
|
|
<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'}}
|
|
|
{{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':item.user.grade_status==5?'L5':'广告'}}
|
|
|
</view>
|
|
|
|
|
|
</view>
|
...
|
...
|
@@ -212,15 +243,17 @@ |
|
|
</view>
|
|
|
<view class="" v-if="tabIndex == 1"
|
|
|
style="display: flex; justify-content: space-between;flex-wrap: wrap;margin-top: 44rpx;">
|
|
|
<view :class="item.id!=undefined||item.title!=undefined?'goodsBox':'goodsBox1'" v-for="(item,index) in goodsList1" :key="index"
|
|
|
<view :class="item.id!=undefined||item.title!=undefined?'goodsBox':'goodsBox1'"
|
|
|
v-for="(item,index) in goodsList1" :key="index"
|
|
|
@click="goGoodDetailFx(item.id,item.title,item.ad_id)">
|
|
|
<view class="goodsPic">
|
|
|
<image :src="item.images[0]||item.title_image" mode="" class="goodImg"></image>
|
|
|
<image :src="item.images[0]||item.title_image" mode="" class="goodImg"
|
|
|
mode="widthFix"></image>
|
|
|
</view>
|
|
|
<view class="goodsDel">
|
|
|
{{item.need_name||item.title}}
|
|
|
</view>
|
|
|
<view class="goodsPrice" v-if="item.price">
|
|
|
<view :class="item.price?'goodsPrice':'goodsPrices'">
|
|
|
<text style="font-size: 24rpx;margin-right: -6rpx;">¥</text>
|
|
|
{{item.price||''}}
|
|
|
</view>
|
...
|
...
|
@@ -305,17 +338,23 @@ |
|
|
</view>
|
|
|
</li>
|
|
|
<li @click="goMe">
|
|
|
<image src="../../static/image/wode_icon_5@2x.png" style="width: 48rpx;height: 44rpx;" mode=""></image>
|
|
|
<image src="../../static/image/wode_icon_5@2x.png" style="width: 48rpx;height: 44rpx;" mode="">
|
|
|
</image>
|
|
|
<text class="botText">我的</text>
|
|
|
</li>
|
|
|
</ul>
|
|
|
</view>
|
|
|
</view>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
import request from '../../utils/request.js'
|
|
|
export default {
|
|
|
onLoad: function(options) {
|
|
|
if (uni.getStorageSync('newUser') != 2) {
|
|
|
this.demo = true
|
|
|
uni.setStorageSync('newUser', 2)
|
|
|
}
|
|
|
uni.setStorageSync('pid', options.userId)
|
|
|
if (options.address) {
|
|
|
this.addressText = options.address
|
...
|
...
|
@@ -326,7 +365,7 @@ |
|
|
if (uni.getStorageSync('token')) {
|
|
|
this.token = true
|
|
|
}
|
|
|
if (uni.getStorageSync('fristEnter')) {
|
|
|
if (uni.getStorageSync('fristEnter') && !this.demo) {
|
|
|
this.getLocations()
|
|
|
this.jfavtivity()
|
|
|
this.goodsXz()
|
...
|
...
|
@@ -334,31 +373,41 @@ |
|
|
}
|
|
|
setTimeout(() => {
|
|
|
this.goodsXz()(); //发现需要
|
|
|
|
|
|
}, 500)
|
|
|
},
|
|
|
onShow: function() {
|
|
|
if (uni.getStorageSync('newUser') != 2) {
|
|
|
this.demo = true
|
|
|
uni.setStorageSync('newUser', 2)
|
|
|
}
|
|
|
// this.appLoginWx()
|
|
|
this.swiper();
|
|
|
this.getBoardList() //广告列表
|
|
|
let that = this
|
|
|
|
|
|
setTimeout(() => {
|
|
|
if (!this.demo) {
|
|
|
if (uni.getStorageSync("City") == "") {
|
|
|
this.getLocations();
|
|
|
} else {
|
|
|
that.addressText = uni.getStorageSync("City")
|
|
|
this.addressText = uni.getStorageSync("City")
|
|
|
}
|
|
|
setTimeout(() => {
|
|
|
this.swiper();
|
|
|
// setTimeout(() => {
|
|
|
this.classifyData(); //分类
|
|
|
this.jfavtivity(); //拼团
|
|
|
this.board() //广告
|
|
|
this.jvliSelect(); //距离选择
|
|
|
this.classifylistss(); //分类选择
|
|
|
this.messageNums() //留言个数
|
|
|
|
|
|
// }, 500)
|
|
|
}
|
|
|
}, 500)
|
|
|
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
demo:false, //操作演示
|
|
|
imgIndex: 1, //演示图片index
|
|
|
nowlocationLat: '', //每次进入维度
|
|
|
nowlocationLot: '', //每次进入经度
|
|
|
nowlocationAddress: '', //每次进入详细位置
|
...
|
...
|
@@ -399,6 +448,7 @@ |
|
|
goodsList1: [],
|
|
|
show: false,
|
|
|
messageNum: 0, //消息个数
|
|
|
boardIndex: 0, //广告index
|
|
|
boardList: [], //广告列表
|
|
|
logo: '../../static/image/logo.jpg'
|
|
|
}
|
...
|
...
|
@@ -409,7 +459,8 @@ |
|
|
//分享
|
|
|
onShareAppMessage: function(e) {
|
|
|
let title = '近邻交易,闲置不再闲置'
|
|
|
let imgUrl = "/static/image/shareImg.png"
|
|
|
// let imgUrl = "http://muying.qiniu.broing.cn/img_share@2x.png!share"
|
|
|
let imgUrl = "http://muying.qiniu.broing.cn/img_share@2x.png"
|
|
|
return {
|
|
|
title: title,
|
|
|
path: '/pages/index/index?userId=' + uni.getStorageSync('userInfo').id,
|
...
|
...
|
@@ -437,6 +488,63 @@ |
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
appLoginWx() {
|
|
|
let that = this
|
|
|
uni.getProvider({
|
|
|
service: 'oauth',
|
|
|
success: function(res) {
|
|
|
if (~res.provider.indexOf('weixin')) {
|
|
|
uni.login({
|
|
|
provider: 'weixin',
|
|
|
success: function(loginRes) {
|
|
|
uni.setStorageSync('code', loginRes.code)
|
|
|
that.checkUser()
|
|
|
},
|
|
|
fail: () => {
|
|
|
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
}
|
|
|
});
|
|
|
},
|
|
|
//判断新老用户
|
|
|
checkUser() {
|
|
|
request.post('/api/common/checkUser', {
|
|
|
code: uni.getStorageSync('code')
|
|
|
}).then(res => {
|
|
|
console.log(res, 'res')
|
|
|
if (res.data.is_set == 1) {
|
|
|
this.demo = false
|
|
|
this.compile()
|
|
|
} else {
|
|
|
this.demo = true
|
|
|
}
|
|
|
}).catch(err => {})
|
|
|
},
|
|
|
//操作演示
|
|
|
bottomClick() {
|
|
|
this.imgIndex += 1
|
|
|
},
|
|
|
compile() {
|
|
|
let that = this
|
|
|
uni.setStorageSync('newUser', 2)
|
|
|
that.demo = false
|
|
|
if (uni.getStorageSync("City") == "" && !that.demo) {
|
|
|
that.getLocations();
|
|
|
} else {
|
|
|
that.addressText = uni.getStorageSync("City")
|
|
|
}
|
|
|
setTimeout(() => {
|
|
|
that.swiper();
|
|
|
that.classifyData(); //分类
|
|
|
that.jfavtivity(); //拼团
|
|
|
that.board() //广告
|
|
|
that.jvliSelect(); //距离选择
|
|
|
that.classifylistss(); //分类选择
|
|
|
that.messageNums() //留言个数
|
|
|
}, 500)
|
|
|
},
|
|
|
login() {
|
|
|
uni.redirectTo({
|
|
|
url: "/pages/index/login"
|
...
|
...
|
@@ -596,6 +704,10 @@ |
|
|
uni.navigateTo({
|
|
|
url: '/pages/index/public-page?id=' + dataId
|
|
|
})
|
|
|
} else if (status == 1) {
|
|
|
uni.redirectTo({
|
|
|
url: '/pages/activity/activity'
|
|
|
})
|
|
|
}
|
|
|
|
|
|
},
|
...
|
...
|
@@ -633,6 +745,7 @@ |
|
|
classifylistss() {
|
|
|
request.get("/api/index/fen", {})
|
|
|
.then(res => {
|
|
|
this.classArray = []
|
|
|
let list = res.data.info
|
|
|
list.forEach((item, index) => {
|
|
|
this.classArray.push(item.name)
|
...
|
...
|
@@ -702,15 +815,16 @@ |
|
|
})
|
|
|
},
|
|
|
//闲置商品
|
|
|
goGoodDetailXz(ids,title,boardId) {
|
|
|
if(title){
|
|
|
goGoodDetailXz(ids, title, boardId) {
|
|
|
if (title) {
|
|
|
uni.navigateTo({
|
|
|
url:'/pages/index/board-detail?id='+boardId
|
|
|
url: '/pages/index/board-detail?id=' + boardId
|
|
|
})
|
|
|
|
|
|
}else{
|
|
|
} else {
|
|
|
uni.navigateTo({
|
|
|
url: "/pages/index/good-details?goos_id=" + ids + '&index=1' + '&lat=' + uni.getStorageSync(
|
|
|
url: "/pages/index/good-details?goos_id=" + ids + '&index=1' + '&lat=' + uni
|
|
|
.getStorageSync(
|
|
|
'lat') + '&lot=' + uni.getStorageSync('lot') + '&userId=' + uni.getStorageSync(
|
|
|
'userInfo').id
|
|
|
})
|
...
|
...
|
@@ -718,14 +832,15 @@ |
|
|
|
|
|
},
|
|
|
//发现需要
|
|
|
goGoodDetailFx(ids,title,boardId) {
|
|
|
if(title){
|
|
|
goGoodDetailFx(ids, title, boardId) {
|
|
|
if (title) {
|
|
|
uni.navigateTo({
|
|
|
url:'/pages/index/board-detail?id='+boardId
|
|
|
url: '/pages/index/board-detail?id=' + boardId
|
|
|
})
|
|
|
}else{
|
|
|
} else {
|
|
|
uni.navigateTo({
|
|
|
url: "/pages/index/good-details?id=" + ids + '&index=2' + '&lat=' + uni.getStorageSync('lat') +
|
|
|
url: "/pages/index/good-details?id=" + ids + '&index=2' + '&lat=' + uni.getStorageSync(
|
|
|
'lat') +
|
|
|
'&lot=' + uni.getStorageSync('lot') + '&userId=' + uni.getStorageSync('userInfo').id
|
|
|
})
|
|
|
}
|
...
|
...
|
@@ -741,10 +856,10 @@ |
|
|
getBoardList() {
|
|
|
let that = this
|
|
|
request.post('/api/index/adList', {
|
|
|
// lat2: uni.getStorageSync('lat'),
|
|
|
// lng2: uni.getStorageSync('lot')
|
|
|
lat2: '39.15935',
|
|
|
lng2: '117.23785'
|
|
|
lat2: uni.getStorageSync('lat'),
|
|
|
lng2: uni.getStorageSync('lot')
|
|
|
// lat2: '39.15935',
|
|
|
// lng2: '117.23785'
|
|
|
}).then(res => {
|
|
|
this.boardList = res.data
|
|
|
}).catch(err => {
|
...
|
...
|
@@ -760,7 +875,7 @@ |
|
|
id: that.index ? that.arrayList[that.index].id : '',
|
|
|
sort_id: that.index1 ? that.ClassifyList[that.index1].id : '',
|
|
|
page: that.pageNum,
|
|
|
rows: 7
|
|
|
rows: 6
|
|
|
})
|
|
|
.then(res => {
|
|
|
// res.data.data.forEach((item,index)=>{
|
...
|
...
|
@@ -776,13 +891,15 @@ |
|
|
// }
|
|
|
// }
|
|
|
// })
|
|
|
if (res.data.data.length == 7) {
|
|
|
if (that.boardList.length > 0) {
|
|
|
res.data.data.push(that.boardList[that.pageNum - 1])
|
|
|
if (res.data.data.length == 6) {
|
|
|
res.data.data.push(that.boardList[that.boardIndex])
|
|
|
that.boardIndex += 1
|
|
|
if (that.boardIndex >= that.boardList.length) {
|
|
|
that.boardIndex = 0
|
|
|
}
|
|
|
} else {
|
|
|
let list = that.boardList.splice(0, that.pageNum - 1)
|
|
|
res.data.data.concat(list)
|
|
|
// let list = that.boardList.splice(0, that.pageNum - 1)
|
|
|
// res.data.data.concat(list)
|
|
|
}
|
|
|
let list = that.pageNum == 1 ? res.data.data : that.goodsList.concat(res.data.data)
|
|
|
this.goodsList = list
|
...
|
...
|
@@ -797,18 +914,22 @@ |
|
|
lat2: uni.getStorageSync('lat'),
|
|
|
lng2: uni.getStorageSync('lot'),
|
|
|
page: that.pageNums,
|
|
|
rows: 7,
|
|
|
rows: 6,
|
|
|
id: this.index ? that.arrayList[that.index].id : "",
|
|
|
sort_id: that.index1 ? that.ClassifyList[that.index1].id : '',
|
|
|
})
|
|
|
.then(res => {
|
|
|
if (res.data.data.length == 7) {
|
|
|
if (res.data.data.length == 6) {
|
|
|
if (that.boardList.length > 0) {
|
|
|
res.data.data.push(that.boardList[that.pageNums - 1])
|
|
|
res.data.data.push(that.boardList[that.boardIndex])
|
|
|
that.boardIndex += 1
|
|
|
if (that.boardIndex >= that.boardList.length) {
|
|
|
that.boardIndex = 0
|
|
|
}
|
|
|
}
|
|
|
} else {
|
|
|
var lists = that.boardList.splice(0, that.pageNums - 1)
|
|
|
res.data.data.concat(lists)
|
|
|
// var lists = that.boardList.splice(0, that.pageNums - 1)
|
|
|
// res.data.data.concat(lists)
|
|
|
}
|
|
|
console.log(res.data.data, 'goodlist')
|
|
|
let list = that.pageNums == 1 ? res.data.data : that.goodsList1.concat(res.data.data)
|
...
|
...
|
@@ -819,12 +940,14 @@ |
|
|
},
|
|
|
//跳转发布需求
|
|
|
OnMaiProject() {
|
|
|
this.show = false
|
|
|
uni.navigateTo({
|
|
|
url: '/pages/issue/publish'
|
|
|
});
|
|
|
},
|
|
|
//跳转卖闲置
|
|
|
OnBuyProject() {
|
|
|
this.show = false
|
|
|
uni.navigateTo({
|
|
|
url: '/pages/issue/betray'
|
|
|
});
|
...
|
...
|
@@ -1000,4 +1123,32 @@ |
|
|
max-width: 60rpx;
|
|
|
padding: 0 6rpx;
|
|
|
}
|
|
|
|
|
|
/* 演示 */
|
|
|
.demoBox {
|
|
|
width: 100%;
|
|
|
height: 100%;
|
|
|
/* overflow: hidden; */
|
|
|
/* display: flex;
|
|
|
align-items: flex-end;
|
|
|
margin-bottom: -40rpx; */
|
|
|
}
|
|
|
|
|
|
.img {
|
|
|
width: 750rpx;
|
|
|
display: block;
|
|
|
/* height:1624rpx; */
|
|
|
}
|
|
|
|
|
|
.btnBox {
|
|
|
position: absolute;
|
|
|
top: 50%;
|
|
|
left: 42%;
|
|
|
z-index: 5;
|
|
|
color: #fff;
|
|
|
padding: 10rpx 48rpx;
|
|
|
box-sizing: border-box;
|
|
|
border: 2rpx solid #fff;
|
|
|
border-radius: 48rpx;
|
|
|
}
|
|
|
</style> |
...
|
...
|
|