作者 倪静楠

6/24

... ... @@ -38,10 +38,12 @@
},
onShow: function() {
console.log('App Show');
},
onHide: function() {
console.log('App Hide', ' 退出’');
uni.setStorageSync('changeAddessShow', true)
},
};
</script>
... ...
... ... @@ -349,6 +349,9 @@
align-items: center;
justify-content: center;
border-radius: 16rpx 16rpx 0rpx 0rpx;
display: flex;
align-items: center;
justify-content: center;
}
.goodsPic image {
... ... @@ -376,7 +379,14 @@
box-sizing: border-box;
font-weight: 600;
}
.goodsPrices {
margin-top: 18rpx;
font-size: 32rpx;
color: #fff !important;
padding: 0 18rpx;
box-sizing: border-box;
font-weight: 600;
}
.userInfo {
margin-top: 18rpx;
display: flex;
... ...
... ... @@ -129,7 +129,7 @@
.meBot {
width: 686rpx;
height: 438rpx;
/* height: 438rpx; */
background-color: #FFFFFF;
/* margin-bottom:20rpx; */
/* margin: 0 32rpx; */
... ...
... ... @@ -51,6 +51,7 @@
})
},
cancelAttend(id) {
let that=this
uni.showModal({
title: '提示',
content: '确定不再关注?',
... ... @@ -59,7 +60,7 @@
request.get('/api/follow/addGuan', {
guan_id: id
}).then(res => {
this.listData()
that.listData()
}).catch(err => {})
}
}
... ...
... ... @@ -11,7 +11,7 @@
<view class="issueBottom" v-if="index == 0">
<view class="issueBottomNav" v-for="(item,index) in dataList" :key="index" @click="GoGoodDetail(item.goods.goods_id)">
<view class="issueBottomImg">
<image :src="item.goods.images[0]" style="width: 200rpx;height: 200rpx;border-radius: 16rpx;" mode=""></image>
<image :src="item.goods.images[0]" style="width: 200rpx;height: 200rpx;border-radius: 16rpx;" mode="aspectFill"></image>
</view>
<view class="issueBottomRight">
<view class="issueBottomRightText">
... ... @@ -32,9 +32,9 @@
</view>
</view>
<view class="issueBottom" v-if="index == 1">
<view class="issueBottomNav" v-for="(item,index) in dataList" :key="index" @click="GoGoodDetail(item.need.id)">
<view class="issueBottomNav" v-for="(item,index) in dataList" :key="index" @click="GoGoodDetailss(item.need.id)">
<view class="issueBottomImg">
<image :src="item.need.images[0]" style="width: 200rpx;height: 200rpx;border-radius: 16rpx;" mode=""></image>
<image :src="item.need.images[0]" style="width: 200rpx;height: 200rpx;border-radius: 16rpx;" mode="aspectFill"></image>
</view>
<view class="issueBottomRight">
<view class="issueBottomRightText">
... ... @@ -150,13 +150,16 @@
request.get('/api/collect/delNeed', {
need_id: id
}).then(res => {
that.dataList=that.dataList.splice(index,1)
that.need()
if(res.code==1){
uni.showToast({
title:'删除成功'
})
that.need()
}
}).catch(err => {
})
that.dataList=that.dataList.splice(index,1)
that.need()
}
}
... ...
... ... @@ -12,7 +12,7 @@
<view class="issueBottomNav" v-for="(item,index) in dataList" :key="index"
@click="goGoodsDetail(item.goods_id)">
<view class="issueBottomImg">
<image :src="item.images[0]" style="width: 200rpx;height: 200rpx;border-radius: 16rpx;" mode="">
<image :src="item.images[0]" style="width: 200rpx;height: 200rpx;border-radius: 16rpx;" mode="aspectFill">
</image>
</view>
<view class="issueBottomRight">
... ... @@ -36,7 +36,7 @@
<view class="issueBottom" v-if="index == 1">
<view class="issueBottomNav" v-for="(item,index) in dataList1" :key="index" @click="goNeedsDetail(item.id)">
<view class="issueBottomImg">
<image :src="item.images[0]" style="width: 200rpx;height: 200rpx;border-radius: 16rpx;" mode="">
<image :src="item.images[0]" style="width: 200rpx;height: 200rpx;border-radius: 16rpx;" mode="aspectFill">
</image>
</view>
<view class="issueBottomRight">
... ... @@ -144,7 +144,6 @@
goods_id: id
}).then(res => {
if (res.code == 1) {
that.dataList.splice(index, 1)
that.listData()
}
}).catch(err => {
... ... @@ -165,7 +164,6 @@
request.get('/api/personal/delNeed', {
id: id
}).then(res => {
that.dataList.splice(index, 1)
that.listData1()
}).catch(err => {
... ...
... ... @@ -131,7 +131,7 @@
</view>
<view class="meBotontt" @click="userDeal">
<view class="meBotontPic">
<image src="../../../static/image/kefu_icon_1@2x.png"
<image src="../../../static/image/Document@2x.png"
style="width: 32rpx;height: 32rpx;margin-right: 14rpx;" mode=""></image>
</view>
<view class="meBotontText ">
... ... @@ -155,19 +155,6 @@
mode=""></image>
</view>
</view>
<view class="meBotontt kefuBorder" @click="onSetWechat">
<view class="meBotontPic">
<image src="../../../static/image/kefu_icon_1@2x.png"
style="width: 32rpx;height: 32rpx;margin-right: 14rpx;" mode=""></image>
</view>
<view class="meBotontText ">
<text class="meBotText">设置微信号</text>
</view>
<view class="meBotontImg">
<image src="../../../static/image/gengduo_icon_5@2x.png" style="width: 32rpx;height: 32rpx;"
mode=""></image>
</view>
</view>
</view>
</view>
<view class="meFa">
... ... @@ -410,16 +397,6 @@
})
},
//设置微信号
onSetWechat() {
if (this.token) {
uni.navigateTo({
url: '/myPackage/pages/me/set-wechat'
})
} else {
this.login()
}
},
//积分
jifens() {
request.get('/api/personal/jifen', {}).then(res => {
... ...
<template>
<view class="perCon">
<view class="perTop" @click="uploadImg">
<view class="perTop" @click="uploadImg">
<view class="petTopText">
<text class="petTx">头像</text>
</view>
<view class="petTopImg">
<image :src="userData.avatar" v-if="fileList.length==0"></image>
<image :src="fileList[fileList.length-1]" mode="" v-if="fileList.length!==0" style="border-radius: 50%;"></image>
<image :src="fileList[fileList.length-1]" mode="" v-if="fileList.length!==0"
style="border-radius: 50%;"></image>
</view>
<view class="petTopPic">
<image src="../../static/image/gengduo_icon_5@2x.png"></image>
</view>
</view>
<view class="perTop" @click="onUserName">
<view class="perTop" @click="onUserName">
<view class="petTopText">
<text class="petTx">昵称</text>
</view>
... ... @@ -24,7 +25,7 @@
<image src="../../static/image/gengduo_icon_5@2x.png"></image>
</view>
</view>
<view class="perTop" @click="onUserInfo">
<view class="perTop" @click="onUserInfo">
<view class="petTopText">
<text class="petTx">简介</text>
</view>
... ... @@ -36,15 +37,25 @@
<image src="../../static/image/gengduo_icon_5@2x.png"></image>
</view>
</view>
<view class="perTop" @click="onUserPhone">
<view class="perTop" @click="onUserPhone">
<view class="petTopText">
<text class="petTx">手机号</text>
</view>
<view class="petTopImg">
<text class="petTopUserName" v-if="inputPhone==null">{{userData.mobile}}</text>
<text class="petTopUserName" v-if="inputPhone!=null">{{inputPhone}}</text>
<!-- <text class="petTopUserName" >{{inputInfo}}</text> -->
<!-- <text class="petTopUserName" v-if="inputPhone!=null">{{mobile}}</text> -->
</view>
<view class="petTopPic">
<image src="../../static/image/gengduo_icon_5@2x.png"></image>
</view>
</view>
<view class="perTop" @click="onUserWechat">
<view class="petTopText">
<text class="petTx">微信号</text>
</view>
<view class="petTopImg">
<text class="petTopUserName" v-if="inputWechat==null">{{userData.wechat_id}}</text>
<text class="petTopUserName" v-if="inputWechat!=null">{{inputWechat}}</text>
</view>
<view class="petTopPic">
<image src="../../static/image/gengduo_icon_5@2x.png"></image>
... ... @@ -69,7 +80,8 @@
<text class="setName">设置昵称</text>
</view>
<view class="HiddenInput">
<input class="InputName" type="text" value="" placeholder="请输入" v-model="inputName" @input="bindInput"/>
<input class="InputName" type="text" value="" placeholder="请输入" v-model="inputName"
@input="bindInput" />
</view>
<view class="HiddenOkQu">
<view class="HiddenCancel" @click="onCancel ">
... ... @@ -87,7 +99,8 @@
<text class="setName">设置简介</text>
</view>
<view class="HiddenInput">
<input class="InputName" type="text" value="inputInfo" placeholder="请输入" v-model="inputInfo" @input="bindInputinfo"/>
<input class="InputName" type="text" value="inputInfo" placeholder="请输入" v-model="inputInfo"
@input="bindInputinfo" />
</view>
<view class="HiddenOkQu">
<view class="HiddenCancel" @click="onCancel ">
... ... @@ -105,7 +118,8 @@
<text class="setName">设置手机号</text>
</view>
<view class="HiddenInput">
<input class="InputName" type="text" value="" placeholder="请输入" v-model="inputPhone" @input="bindInputPhone"/>
<input class="InputName" type="text" value="" placeholder="请输入" v-model="inputPhone"
@input="bindInputPhone" />
</view>
<view class="HiddenOkQu">
<view class="HiddenCancel" @click="onCancel">
... ... @@ -117,11 +131,30 @@
</view>
</view>
</view>
<view class="saveBtn" @click="confirm">
<view class="saveText">
保存
</view>
</view>
<view class="zhezhao" v-if="isShowWechat">
<view class="Hidden">
<view class="HiddenText">
<text class="setName">设置微信号</text>
</view>
<view class="HiddenInput">
<input class="InputName" type="text" value="" placeholder="请输入" v-model="inputWechat"
@input="bindInputWechat" />
</view>
<view class="HiddenOkQu">
<view class="HiddenCancel" @click="onCancel">
<text class="cancel">取消</text>
</view>
<view class="HiddenSave" @click="onSave">
<text class="save">保存</text>
</view>
</view>
</view>
</view>
<view class="saveBtn" @click="confirm">
<view class="saveText">
保存
</view>
</view>
</view>
</template>
... ... @@ -132,15 +165,17 @@
data() {
return {
isShow: false,
isShowInfo:false,
isShowPhone:false,
userData:'',
inputName:null,
inputInfo:null,
inputPhone:null,
fileList:[],
urlImg:[],
ajxtrue:false, //手机号
isShowInfo: false,
isShowPhone: false,
isShowWechat: false,
userData: '',
inputName: null,
inputInfo: null,
inputPhone: null,
inputWechat: null,
fileList: [],
urlImg: [],
ajxtrue: false, //手机号
}
},
created() {
... ... @@ -148,79 +183,87 @@
},
methods: {
//个人资料
userInfo(){
request.get('/api/personal/chaKan',{
user_id:uni.getStorageSync('userInfo').id
}).then(res=>{
this.userData=res.data.info[0]
this.inputName=res.data.info[0].nickname
this.inputInfo=res.data.info[0].content
this.inputPhone=res.data.info[0].mobile
}).catch(err=>{
userInfo() {
request.get('/api/personal/chaKan', {
user_id: uni.getStorageSync('userInfo').id
}).then(res => {
this.userData = res.data.info[0]
this.inputName = res.data.info[0].nickname
this.inputInfo = res.data.info[0].content
this.inputPhone = res.data.info[0].mobile
this.inputWechat=res.data.info[0].wechat_id
console.log(res, 'res个人资料')
}).catch(err => {
})
},
//点击头像
uploadImg(){
let that =this
uploadImg() {
let that = this
uni.chooseImage({
success: (chooseImageRes) => {
const tempFilePaths = chooseImageRes.tempFilePaths;
const uploadTask = uni.uploadFile({
url: 'https://ketao.shequtaoapp.com/api/common/upload',
filePath: tempFilePaths[0],
name: 'file',
formData: {
'user': 'test'
},
header: {
'token': uni.getStorageSync('token') || ''
},
success: (uploadFileRes) => {
let uploadList =JSON.parse(uploadFileRes.data).data
that.fileList.push(uploadList.url)
that.urlImg.push(uploadList.save_path)
}
});
}
});
success: (chooseImageRes) => {
const tempFilePaths = chooseImageRes.tempFilePaths;
const uploadTask = uni.uploadFile({
url: 'https://ketao.shequtaoapp.com/api/common/upload',
filePath: tempFilePaths[0],
name: 'file',
formData: {
'user': 'test'
},
header: {
'token': uni.getStorageSync('token') || ''
},
success: (uploadFileRes) => {
let uploadList = JSON.parse(uploadFileRes.data).data
that.fileList.push(uploadList.url)
that.urlImg.push(uploadList.save_path)
}
});
}
});
},
//点击昵称
onUserName() {
this.isShow = true
},
onUserPhone(){
this.isShowPhone=true
onUserPhone() {
this.isShowPhone = true
},
bindInput(e){
bindInput(e) {
console.log(e)
this.inputName=e.detail.value
this.inputName = e.detail.value
},
bindInputPhone(e) {
this.inputPhone = e.detail.value
},
bindInputPhone(e){
this.inputPhone=e.detail.value
bindInputWechat(e){
this.inputWechat=e.detail.value
},
//手机号
onUserPhone(){
this.isShowPhone=true
onUserPhone() {
this.isShowPhone = true
},
//微信号
onUserWechat() {
this.isShowWechat = true
},
//点击简介
onUserInfo() {
this.isShowInfo= true
this.isShowInfo = true
},
bindInputinfo(e){
this.inputInfo=e.detail.value
bindInputinfo(e) {
this.inputInfo = e.detail.value
},
//点击取消
onCancel() {
this.isShow = false
this.isShowInfo=false
this.isShowPhone=false
this.isShowInfo = false
this.isShowPhone = false
this.inputWechat=this.userData.wechat_id
this.inputPhone=this.userData.mobile
},
//点击保存
onSave() {
this.isShow = false
this.isShowInfo=false
this.isShowPhone=false
this.confirm()
},
//点击会员
... ... @@ -248,39 +291,50 @@
// // console.log('验证成功', that.ajxtrue)
// }
// },
confirm(){
if(this.inputName==''){
confirm() {
if (this.inputName == '') {
uni.showToast({
title:'请输入昵称',
icon:'none'
title: '请输入昵称',
icon: 'none'
})
}else if(this.inputPhone.length>11){
} else if (this.inputPhone.length > 11 || this.inputPhone == '') {
uni.showToast({
title:'请输入正确的手机号',
icon:'none'
title: '请输入正确的手机号',
icon: 'none'
})
} else if(this.inputWechat==''){
uni.showToast({
title: '请输入正确的微信号',
icon: 'none'
})
}
else {
request.get('/api/personal/xiuGai',{
avatar:this.urlImg[this.urlImg.length-1]?(this.urlImg[this.urlImg.length-1]).toString():'',
nickname:this.inputName,
content:this.inputInfo,
mobile:this.inputPhone
}).then(res=>{
request.get('/api/personal/xiuGai', {
avatar: this.urlImg[this.urlImg.length - 1] ? (this.urlImg[this.urlImg.length - 1])
.toString() : '',
nickname: this.inputName,
content: this.inputInfo,
mobile: this.inputPhone,
wechat_id:this.inputWechat
}).then(res => {
this.isShow = false
this.isShowInfo = false
this.isShowPhone = false
this.isShowWechat=false
uni.showToast({
title:'更新成功'
title: '更新成功'
})
setTimeout(()=>{
setTimeout(() => {
uni.navigateBack({
delta:1
delta: 1
})
},1500)
}).catch(err=>{
}, 1500)
}).catch(err => {
})
}
}
}
}
... ... @@ -289,20 +343,22 @@
<style>
@import url("/common/personal.css");
@import url("/common/uni.css");
.saveBtn{
.saveBtn {
position: fixed;
bottom: 0;
left: 0;
padding: 32rpx;
box-sizing: border-box;
}
.saveText{
.saveText {
width: 686rpx;
height: 88rpx;
line-height: 88rpx;
text-align: center;
font-size: 28rpx;
background-color:#FF814A;
background-color: #FF814A;
color: #fff;
border-radius: 54rpx;
}
... ...
... ... @@ -58,6 +58,13 @@
"navigationBarTitleText": "搜索",
"enablePullDownRefresh": false
}
}, {
"path": "pages/index/demo",
"style": {
"navigationStyle": "custom",
"navigationBarTitleText": "",
"enablePullDownRefresh": false
}
},
{
"path": "pages/index/board-detail",
... ... @@ -65,7 +72,7 @@
"navigationBarTitleText": "详情",
"enablePullDownRefresh": false
}
},{
}, {
"path": "pages/index/public-page",
"style": {
"navigationBarTitleText": "科欧社区淘",
... ...
... ... @@ -91,7 +91,7 @@
//分享
onShareAppMessage: function(e) {
let title = '近邻交易,闲置不再闲置'
let imgUrls="../../static/image/shareImg.png"
let imgUrls="http://muying.qiniu.broing.cn/img_share@2x.png"
return {
title: title,
path: "/pages/activity/exchange-detail?id=" + this.id + '&userId=' + uni.getStorageSync('userInfo').id,
... ...
... ... @@ -32,7 +32,10 @@
<rich-text :nodes="content"></rich-text>
</view>
<view class="btnBj">
<view class="btn" @click="immediately">
<view class="btn" @click="immediately" v-if="goodsData.is_expire==0">
立即报名
</view>
<view class="btn btn1" @click="noTime" v-else>
立即报名
</view>
</view>
... ... @@ -89,6 +92,13 @@
}
},
//不能报名
noTime(){
uni.showToast({
title:'该活动无法报名!',
icon:'none'
})
},
//活动详情
detail() {
request.get('/api/active/activeList', {
... ... @@ -245,4 +255,7 @@
font-size: 32rpx;
color: #fff;
}
.btn1 {
background: #d5d5d5;
}
</style>
... ...
... ... @@ -150,9 +150,10 @@
this.listData(this.id)
} else {}
}).catch(errr => {
}).catch(err => {
console.log(err,'err')
uni.showToast({
title: '发布者不能给自己留言',
title: err,
icon: 'none'
})
})
... ...
... ... @@ -2,7 +2,8 @@
<view class="content" @click="concelPIC">
<view class="topcontent" v-if="Number(index)==2&&goodDatas.goods_name!=null">
<view class="leftBox">
<image :src="goodDatas.images" mode="" style="width:104rpx;height: 104rpx;border-radius: 8rpx;"></image>
<image :src="goodDatas.images" mode="" style="width:104rpx;height: 104rpx;border-radius: 8rpx;"
mode="aspectFill"></image>
<view class="" style="margin-left: 20rpx;font-size: 28rpx;">
{{goodDatas.goods_name}}
<view class="" style="font-size: 28rpx;color:#EE0A24;">
... ... @@ -34,7 +35,7 @@
:class="item.type==1&&item.datetime?'leftContent1':item.type==1&&!item.datetime?'leftContent':item.type==0&&item.datetime?'rightContent1':'rightContent'"
style="position: relative;">
<view class="" v-if="item.flag==0">
{{item.content}}
<text selectable="true">{{item.content}}</text>
</view>
<view class="" v-else>
<image :src="item.content" class="chatImage" @click="previewImg(item.content)"
... ... @@ -43,12 +44,10 @@
<!-- <view class=""
style="width: 20rpx;height: 20rpx;background-color: #fff;transform: rotate(45deg);position: absolute;top: 36rpx;left: -10rpx;z-index: -1;"
v-if="item.type==1">
</view>
<view class=""
style="width: 20rpx;height: 20rpx;background-color: #FF834D;transform: rotate(45deg);position: absolute;top: 36rpx;right: -10rpx;z-index: -1;"
v-if="item.type==0">
</view> -->
</view>
... ... @@ -66,7 +65,9 @@
@click="goUser(item.user_id)"></image>
<view :class="item.type==0?'leftContent':'rightContent'" style="position: relative;">
<view class="" v-if="item.flag==0">
{{item.content}}
<text selectable="true">
{{item.content}}
</text>
</view>
<view class="" v-else>
<image :src="item.content" class="chatImage" @click="previewImg(item.content)"
... ... @@ -219,7 +220,7 @@
title: '发送成功',
icon: 'none'
})
this.inputText = res.data.wechat_id
this.inputText = '您可以添加我的微信,微信号:' + res.data.wechat_id
this.send()
} else {
uni.showToast({
... ...
... ... @@ -3,7 +3,8 @@
<view class="">
<scroll-view scroll-x="true" class="scroll">
<view class="scrollItems">
<view :class="indexs==index?'active Item':'Item'" v-for="(item,index) in list" :key="index" @click="selectItem(item.id,index)">
<view :class="indexs==index?'active Item':'Item'" v-for="(item,index) in list" :key="index"
@click="selectItem(item.id,index)">
{{item.name}}
</view>
</view>
... ... @@ -14,52 +15,56 @@
<view>距离</view>
<image src="../../static/image/paixu_icon@2x.png" mode=""></image>
</view>
<view class="tabBox" @click="jlsort">
<view class="tabBox" @click="jlsort">
<view>价格</view>
<image src="../../static/image/paixu_icon@2x.png" mode=""></image>
</view>
</view>
<view class="" v-show="tabIndex == 0" style="display: flex; justify-content: space-between;flex-wrap: wrap;padding: 32rpx;">
<view class="goodsBox" v-for="(item,index) in goodsList" :key="index" style="width: 330rpx; background: #fff; margin-bottom: 24rpx;position: relative;padding-bottom:20rpx;"
@click="goDetail(item.goods_id)">
<view class="" v-show="tabIndex == 0"
style="display: flex; justify-content: space-between;flex-wrap: wrap;padding: 32rpx;">
<view class="goodsBox" v-for="(item,index) in goodsList" :key="index"
style="width: 330rpx; background: #fff; margin-bottom: 24rpx;position: relative;padding-bottom:20rpx;"
@click="goDetail(item.goods_id,item.title,item.ad_id)">
<view class="goodsPic">
<image :src="item.images[0]" mode="" class="goodImg"></image>
<image :src="item.images[0]||item.title_image" mode="" class="goodImg"></image>
</view>
<view class="goodsDel">
{{item.goods_name}}
{{item.goods_name?item.goods_name:item.title}}
</view>
<view class="goodsPrice">
<view :class="item.price?'goodsPrice':'goodsPrices'">
<text style="font-size: 24rpx;margin-right: -6rpx;">¥</text>
{{item.price}}
</view>
<view class="userInfo">
<view class="userLeft">
<view class="userHead">
<image :src="item.user.avatar" mode="" class="userHead"></image>
<image :src="item.user.avatar||logo" mode="" class="userHead"></image>
</view>
<view class="userName">
{{item.user.nickname}}
{{item.user.nickname||'科欧社区淘'}}
</view>
</view>
<view class="userRight">
<image src="/static/image/zuanshi_icon_1@2x.png" mode="" style="width: 20rpx;height: 20rpx;margin-right: 10rpx;"></image>
{{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'}}
<image src="/static/image/zuanshi_icon_1@2x.png" mode=""
style="width: 20rpx;height: 20rpx;margin-right: 10rpx;"></image>
{{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>
<view class="addressMask">
<image src="/static/image/dingwei_icon_1@2x.png" mode=""></image>
<view class="maskAddress" style="max-width: 104rpx;white-space: nowrap;overflow: hidden;text-overflow: ellipsis;">
{{item.address}}
<view class="maskAddress"
style="max-width: 104rpx;white-space: nowrap;overflow: hidden;text-overflow: ellipsis;">
{{item.address||''}}
</view>
<view class="maskAddress">
<view class="maskAddress" v-if="item!=null">
{{item.dis}}km
</view>
</view>
</view>
</view>
<view class="" style="text-align: center;margin-top: 100rpx;color: grey;" v-if="goodsList.length==0">
暂无更多数据
</view>
<view class="" style="text-align: center;margin-top: 100rpx;color: grey;" v-if="goodsList.length==0">
暂无更多数据
</view>
</view>
</template>
... ... @@ -69,34 +74,52 @@
export default {
onLoad(options) {
this.classifyId = options.classifyId
this.indexs=options.index
this.id=options.id
this.indexs = options.index
this.id = options.id
this.classifList()
this.classifyChange('', 1)
this.getBoardList()
},
data() {
return {
classifyId: '', //分类id
id: '', //二级分类
indexs:'',
indexs: '',
priceTypes: 1,
jlTypes: 1,
list: [],
active: 1,
goodsList: []
goodsList: [],
boardIndex: 0, //广告index
boardList: [], //广告列表
logo: '../../static/image/logo.jpg'
}
},
created() {
},
created() {},
methods: {
//广告
//广告列表
getBoardList() {
let that = this
request.post('/api/index/adList', {
lat2: uni.getStorageSync('lat'),
lng2: uni.getStorageSync('lot')
// lat2: '39.15935',
// lng2: '117.23785'
}).then(res => {
this.boardList = res.data
}).catch(err => {
})
},
jlsort() {
let jlType = Number(this.jlTypes) == 1 ? '2' : '1'
this.jlTypes=jlType
this.jlTypes = jlType
this.classifyChange(jlType, '')
},
priceSort() {
let priceType = Number(this.priceTypes) == 1 ? '2' : '1'
this.priceTypes=priceType
this.priceTypes = priceType
this.classifyChange('', priceType)
},
//分类
... ... @@ -110,6 +133,9 @@
})
},
classifyChange(jvType, priceType) {
uni.showLoading({
title:'加载中'
})
request.get('/api/push/erLei', {
lat2: uni.getStorageSync('lat'),
lng2: uni.getStorageSync('lot'),
... ... @@ -117,31 +143,68 @@
p: jvType,
q: priceType
}).then(res => {
if(res.code==1){
uni.hideLoading()
}
this.goodsList = res.data.info
this.goodsList.forEach((item, index) => {
if ((index + 1) % 7 == 0) {
if (this.boardIndex == this.boardList.length) {
this.boardIndex = 0
}
this.goodsList.splice(index - 1, 0, this.boardList[this.boardIndex])
this.boardIndex += 1
}
})
}).catch(err => {
})
},
selectItem(id,index) {
selectItem(id, index) {
this.id = id
this.indexs=index
this.jlTypes=''
this.indexs = index
this.jlTypes = ''
request.get('/api/push/erLei', {
lat2: uni.getStorageSync('lat'),
lng2: uni.getStorageSync('lot'),
sort2_id:id,
sort2_id: id,
p: this.priceTypes,
q: this.jlTypes
}).then(res => {
this.goodsList = res.data.info
// if ((index + 1) % 6) {
// console.log(index + 1, 'index+1')
// if (this.boardIndex == this.boardList.length) {
// this.boardIndex = 0
// }
// this.goodsList.splice(index + 1, 0, this.boardList[this.boardIndex])
// this.boardIndex += 1
// }
var typeData = [];
for (var i = 0, len = this.goodsList.length; i < len; i += 6) {
typeData.push(types.slice(i, i + 3));
}
typeData.forEach(item => {
item.push('66')
});
types = [].concat.apply([], typeData);
console.log(typeData, 'types')
}).catch(err => {
})
},
goDetail(id){
uni.navigateTo({
url:'/pages/index/good-details?goos_id='+id+'&lat='+uni.getStorageSync('lat')+'&lot='+uni.getStorageSync('lot')
})
goDetail(id, title, boardId) {
if (title) {
uni.navigateTo({
url: '/pages/index/board-detail?id=' + boardId
})
} else {
uni.navigateTo({
url: '/pages/index/good-details?goos_id=' + id + '&lat=' + uni.getStorageSync('lat') +
'&lot=' + uni.getStorageSync('lot')
})
}
}
}
}
... ... @@ -151,9 +214,11 @@
@import url("/common/uni.css");
@import url("/common/index.css");
@import url("/common/classify-detail.css");
.active{
color:#FF9D66;
}
.active {
color: #FF9D66;
}
.scroll {
padding: 24rpx 32rpx;
font-size: 28rpx;
... ... @@ -171,4 +236,8 @@
/* padding: 24rpx 32rpx; */
min-width: 150rpx;
}
.goodsPrices {
color: #fff !important;
}
</style>
... ...
<template>
<view class="content">
<view class="imgBox">
<image src="http://muying.qiniu.broing.cn/uploads/20210621/3c5365b28ce34d8a40844bd50cd3bfb9.png" mode=""
class="img" mode="widthFix" v-if="index==1"></image>
<image src="http://muying.qiniu.broing.cn/uploads/20210621/ea6192f56861b55304eeefae6cb80db6.png" mode=""
class="img" mode="widthFix" v-if="index==2"></image>
<image src="http://muying.qiniu.broing.cn/uploads/20210621/65d339232a2b077c22d057dd84defbec.png" mode=""
class="img" mode="widthFix" v-if="index==3"></image>
<image src="http://muying.qiniu.broing.cn/uploads/20210621/a374e24f9e49e985dd0d6bdb09ee77c8.png" mode=""
class="img" mode="widthFix" v-if="index==4"></image>
<image src="http://muying.qiniu.broing.cn/uploads/20210621/bafe2810d884fbfd13592c0c50b311ac.png" mode=""
class="img" mode="widthFix" v-if="index==5"></image>
<image src="http://muying.qiniu.broing.cn/uploads/20210621/e988294593944ee314cd6a59976907c9.png" mode=""
class="img" mode="widthFix" v-if="index==6"></image>
<image src="http://muying.qiniu.broing.cn/uploads/20210621/856869f0413ceb5931a53015dbe3dc1f.png" mode=""
class="img" mode="widthFix" v-if="index==7"></image>
<image src="http://muying.qiniu.broing.cn/uploads/20210621/9aa43baab9b429d6aaaf0a35ef933403.png" mode=""
class="img" mode="widthFix" v-if="index==8"></image>
<image src="http://muying.qiniu.broing.cn/uploads/20210621/6273b6d62cc0704c72336fbe610b2d80.png" mode=""
class="img" mode="widthFix" v-if="index==9"></image>
</view>
<view class="btnBox">
<view class="" @click="compile" v-if="index==9">
完成
</view>
<view class="" @click="bottomClick" v-else>
下一步
</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
index: 1
}
},
methods: {
bottomClick() {
this.index += 1
},
compile() {
// uni.redirectTo({
// url:''
// })
}
}
}
</script>
<style>
.imgBox {
/* width: 100%;
height: 100%; */
}
.img {
width: 750rpx;
/* height:1624rpx; */
}
.btnBox {
position: fixed;
top: 50%;
left: 42%;
z-index: 5;
color: #fff;
padding: 10rpx 48rpx;
box-sizing: border-box;
border: 2rpx solid #fff;
border-radius: 48rpx;
/* width: 200rpx; */
}
</style>
... ...
... ... @@ -221,7 +221,10 @@
<view class="iconfont icon-jubao1"></view>
举报
</view>
<view class="messageBtn" @click="messageClick">
<!-- <view class="messageBtn" @click="messageClick">
留言
</view> -->
<view class="messageBtn" @click="mainMessage">
留言
</view>
<view class="wantBtn messageBtn" @click="myWant">
... ... @@ -366,8 +369,9 @@
onShareAppMessage: function(e) {
let that = this
// let title = '来到社区淘 闲置就近卖'
let name=that.detailData.goods_name==undefined?that.detailData.need_name:that.detailData.goods_name
let title = '¥' + that.detailData.price + '|' +name
let name = that.detailData.goods_name == undefined ? that.detailData.need_name : that.detailData.goods_name
let title = '¥' + that.detailData.price + '|' + name
// let imgUrl = that.detailData.images[0]
let imgUrl = that.detailData.images[0] + '!share'
return {
title: title,
... ... @@ -615,8 +619,9 @@
},
//私信
myWant() {
if (this.token) {
if (this.mobile == '') {
let that = this
if (that.token) {
if (that.mobile == '') {
uni.showModal({
title: '提示',
content: '请绑定手机号用于接收卖家/买家短信消息提醒',
... ... @@ -626,77 +631,67 @@
url: '/myPackage/pages/me/personal'
})
} else if (res.cancel) {
if (this.id == undefined || this.goods_id !== undefined) {
if (that.id == undefined || that.goods_id !== undefined) {
request.get('/api/goods/want', {
goods_id: this.goods_id
goods_id: that.goods_id
}).then(res => {
}).catch(err => {
})
uni.navigateTo({
url: '/pages/index/chat?goods_id=' + this.goods_id +
url: '/pages/index/chat?goods_id=' + that.goods_id +
'&index=2'
})
} else {
request.get('/api/goods/needChat', {
id: this.id
id: that.id
}).then(res => {
uni.showToast({
title: '创建订单',
icon: 'none'
})
uni.navigateTo({
url: '/pages/index/chat?goods_id=' + this.id +
url: '/pages/index/chat?goods_id=' + that.id +
'&index=2'
})
}).catch(err => {
})
}
console.log('私信')
}
}
})
} else {
if (that.id == undefined || that.goods_id !== undefined) {
request.get('/api/goods/want', {
goods_id: that.goods_id
}).then(res => {
}).catch(err => {
})
uni.navigateTo({
url: '/pages/index/chat?goods_id=' + that.goods_id +
'&index=2'
})
} else {
request.get('/api/goods/needChat', {
id: that.id
}).then(res => {
uni.showToast({
title: '创建订单',
icon: 'none'
})
uni.navigateTo({
url: '/pages/index/chat?goods_id=' + that.id +
'&index=2'
})
}).catch(err => {
})
}
}
// if (this.wechat == null) {
// uni.showToast({
// title: '请先设置微信号',
// icon: 'none'
// })
// setTimeout(() => {
// uni.navigateTo({
// url: '/myPackage/pages/me/set-wechat'
// })
// }, 1000)
// } else {
// if (this.id == undefined || this.goods_id !== undefined) {
// request.get('/api/goods/want', {
// goods_id: this.goods_id
// }).then(res => {
// }).catch(err => {
// })
// uni.navigateTo({
// url: '/pages/index/chat?goods_id=' + this.goods_id + '&index=2'
// })
// } else {
// request.get('/api/goods/needChat', {
// id: this.id
// }).then(res => {
// uni.showToast({
// title: '创建订单',
// icon: 'none'
// })
// uni.navigateTo({
// url: '/pages/index/chat?goods_id=' + this.id + '&index=2'
// })
// }).catch(err => {
// })
// }
// }
} else {
this.login()
}
... ... @@ -704,21 +699,44 @@
},
//留言
mainMessage() {
if (this.token) {
if (this.id) {
uni.navigateTo({
url: "/pages/index/all-message?id=" + this.id
let that = this
if (that.token) {
if (that.mobile == '') {
uni.showModal({
title: '提示',
content: '请绑定手机号用于接收卖家/买家短信消息提醒',
success: function(res) {
if (res.confirm) {
uni.navigateTo({
url: '/myPackage/pages/me/personal'
})
} else if (res.cancel) {
if (that.id) {
uni.navigateTo({
url: "/pages/index/all-message?id=" + that.id
})
} else {
uni.navigateTo({
url: "/pages/index/all-message?id=" + that.goods_id
})
}
}
}
})
} else {
uni.navigateTo({
url: "/pages/index/all-message?id=" + this.goods_id
})
if (that.id) {
uni.navigateTo({
url: "/pages/index/all-message?id=" + that.id
})
} else {
uni.navigateTo({
url: "/pages/index/all-message?id=" + that.goods_id
})
}
}
} else {
this.login()
that.login()
}
},
messageClick() {
if (this.token) {
... ... @@ -736,7 +754,7 @@
// console.log(this.id == 'undefined' ? this.goods_id + 'goods' : this.id + 'id', '参数')
request.get('/api/msg/allMsg', {
// goods_id: this.id== || this.goods_id
goods_id: this.id == undefined||this.id == 'undefined' ? this.goods_id : this.id
goods_id: this.id == undefined || this.id == 'undefined' ? this.goods_id : this.id
}).then(res => {
console.log(res.data.info, 'ressss')
this.messageList = res.data.info
... ... @@ -774,7 +792,8 @@
//收藏
collect() {
if (this.token) {
if (this.id == undefined) {
if (this.id == undefined || this.id == 'undefined') {
console.log(this.goods_id, '收藏id')
request.get('/api/collect/addGoods', {
goods_id: this.goods_id
}).then(res => {
... ... @@ -790,6 +809,7 @@
})
} else {
console.log(this.id, '收藏id')
request.get('/api/collect/addNeed', {
need_id: this.id
}).then(res => {
... ...
<template>
<view class="container">
<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;">
<image :src="IndexImg" mode="" style="width: 100%;display: none;"></image>
<view class=""
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;">
<!-- 操作演示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>
<view class="all">
<view class="topBOX">
<view class="searchBox">
<view class="mapBox" @click="signIn">
<view class="picBox">
<image src="/static/image/qiandao_ico.png" mode=""></image>
</view>
<view class="mapText">
签到
<!-- 操作演示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;">
<image :src="IndexImg" mode="" style="width: 100%;display: none;"></image>
<view class=""
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}}
</view>
</view>
<view class="all">
<view class="topBOX">
<view class="searchBox">
<view class="mapBox" @click="signIn">
<view class="picBox">
<image src="/static/image/qiandao_ico.png" mode=""></image>
</view>
<view class="mapText">
签到
</view>
</view>
</view>
<view class="inputCon">
<!-- <image src="../../static/image/search.png" mode=""></image>
<view class="inputCon">
<!-- <image src="../../static/image/search.png" mode=""></image>
<input class="uni-input" placeholder="搜索" @focus='focus' v-model="inputValue"
@input="bindInput" /> -->
<image src="/static/image/inputImg.png" mode="" class="inputImg" @click="goSearch"></image>
</view>
<view class="mapBox" @click="cangbao">
<view class="picBox">
<image src="/static/image/cangbaotu_ico.png" mode="" style="width: 36rpx;height: 36rpx;">
</image>
<image src="/static/image/inputImg.png" mode="" class="inputImg" @click="goSearch"></image>
</view>
<view class="mapText">
藏宝图
<view class="mapBox" @click="cangbao">
<view class="picBox">
<image src="/static/image/cangbaotu_ico.png" mode=""
style="width: 36rpx;height: 36rpx;">
</image>
</view>
<view class="mapText">
藏宝图
</view>
</view>
</view>
</view>
</view>
<view class="swiperBox">
<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,item.data_id)">
<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">
<image :src="item.image" mode=""></image>
<text class="classifyText">{{item.name}}</text>
<view class="swiperBox">
<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,item.data_id)">
<image :src="item.image" mode="" class="swiper"></image>
</swiper-item>
</swiper>
</view>
<view class="classifyPic" @click="goClass(4,ClassifyList1[0].id)" v-if="ClassifyList1.length>0">
<image src="../../static/image/fenlei_icon_1@2x.png" mode=""></image>
<text class="classifyText">分类</text>
<view class="classifyBox">
<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,ClassifyList1[0].id)" v-if="ClassifyList1.length>0">
<image src="../../static/image/fenlei_icon_1@2x.png" mode=""></image>
<text class="classifyText">分类</text>
</view>
</view>
</view>
<view style="margin: 0 30rpx 0 34rpx;" v-if="listTypecont.length>0&&activeStatus==1">
<view class="pintuanBox">
<view class="pintuanTop">
<view class="topLeft" style="display: flex;align-items: center;">
<view class="pinIcon">
<image src="/static/image/pintuan_icon@2x.png" mode="aspectFill"></image>
<view style="margin: 0 30rpx 0 34rpx;" v-if="listTypecont.length>0&&activeStatus==1">
<view class="pintuanBox">
<view class="pintuanTop">
<view class="topLeft" style="display: flex;align-items: center;">
<view class="pinIcon">
<image src="/static/image/pintuan_icon@2x.png" mode="aspectFill"></image>
</view>
<view class="pinText">
积分活动
</view>
</view>
<view class="pinText">
积分活动
<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>
</view>
</view>
</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>
</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)">
<image :src="item.img" mode="" class="scrollPic" mode="scaleToFill"></image>
<text class="label-name">{{item.title }}</text>
</view>
</scroll-view>
</view>
</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)">
<image :src="item.img" mode="" class="scrollPic" mode="scaleToFill"></image>
<text class="label-name">{{item.title }}</text>
</view>
</scroll-view>
</view>
</view>
</view>
<!-- 广告 -->
<view class="imgBox">
<ad unit-id="adunit-4a228d17f674b0ee"></ad>
<!-- <image :src="boardImg" mode=""></image> -->
</view>
<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>
</block>
</view>
<view class="locationBtn" v-if="noAddress" @click="startLocations">
开启定位
<!-- 广告 -->
<view class="imgBox">
<ad unit-id="adunit-4a228d17f674b0ee"></ad>
<!-- <image :src="boardImg" mode=""></image> -->
</view>
<view class="" v-if="!noAddress">
<view class="selectBox" style="display: flex;margin-top: 45rpx;">
<view class="classify" style="display: flex;margin-right:50rpx;align-items: center;">
<view class="jvliText">
距离
<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="picker" style="position: relative;">
<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;">
</block>
</view>
<view class="locationBtn" v-if="noAddress" @click="startLocations">
开启定位
</view>
<view class="" v-if="!noAddress">
<view class="selectBox" style="display: flex;margin-top: 45rpx;">
<view class="classify" style="display: flex;margin-right:50rpx;align-items: center;">
<view class="jvliText">
距离
</view>
<view class="picker" style="position: relative;">
<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>
</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>
</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>
</view>
</view>
</view>
<view class="classify" style="display: flex;align-items: center;">
<view class="jvliText">
分类
</view>
<view class="picker" style="position: relative;">
<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;">
<view class="classify" style="display: flex;align-items: center;">
<view class="jvliText">
分类
</view>
<view class="picker" style="position: relative;">
<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>
</view>
</picker>
<view class="">
</view>
<view class="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>
</view>
</view>
</view>
</view>
<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="item.goods_id!=undefined||item.title!=undefined?'goodsBox':'goodsBox1'"
v-for="(item,index) in goodsList" :key="index" style=""
@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>
</view>
<view class="goodsDel">
{{item.goods_name?item.goods_name:item.title}}
</view>
<view class="goodsPrice" v-if="item.price">
<text style="font-size: 24rpx;margin-right: -6rpx;">¥</text>
{{item.price||''}}
</view>
<view class="userInfo">
<view class="userLeft">
<view class="userHead">
<image :src="item.user.avatar||logo" class="userHead"></image>
<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="item.goods_id!=undefined||item.title!=undefined?'goodsBox':'goodsBox1'"
v-for="(item,index) in goodsList" :key="index" style=""
@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="widthFix">
</image>
</view>
<view class="goodsDel">
{{item.goods_name?item.goods_name:item.title}}
</view>
<view :class="item.price?'goodsPrice':'goodsPrices'">
<text style="font-size: 24rpx;margin-right: -6rpx;">¥</text>
{{item.price||''}}
</view>
<view class="userInfo">
<view class="userLeft">
<view class="userHead">
<image :src="item.user.avatar||logo" class="userHead"></image>
</view>
<view class="userName">
{{item.user.nickname||'科欧社区淘'}}
</view>
</view>
<view class="userName">
{{item.user.nickname||'科欧社区淘'}}
<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>
<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':item.user.grade_status==5?'L5':'广告'}}
</view>
</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>
<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 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;">
{{item.address||''}}
</view>
<view class="maskAddress" v-if="item!=null">
{{item.distance.toFixed(1)}}km
</view>
</view>
<!-- </view> -->
</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;">
{{item.address||''}}
</view>
<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="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"
mode="widthFix"></image>
</view>
<view class="maskAddress" v-if="item!=null">
{{item.distance.toFixed(1)}}km
<view class="goodsDel">
{{item.need_name||item.title}}
</view>
</view>
<!-- </view> -->
</view>
</view>
<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="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>
</view>
<view class="goodsDel">
{{item.need_name||item.title}}
</view>
<view class="goodsPrice" v-if="item.price">
<text style="font-size: 24rpx;margin-right: -6rpx;">¥</text>
{{item.price||''}}
</view>
<view class="userInfo">
<view class="userLeft">
<view class="userHead">
<image :src="item.user.avatar||logo" mode="" class="userHead"></image>
</view>
<view class="userName">
{{item.user.nickname||'科欧社区淘'}}
</view>
<view :class="item.price?'goodsPrice':'goodsPrices'">
<text style="font-size: 24rpx;margin-right: -6rpx;">¥</text>
{{item.price||''}}
</view>
<view class="userRight" style="display: flex;align-items: center;"
v-if="item.grade_status">
<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 class="userInfo">
<view class="userLeft">
<view class="userHead">
<image :src="item.user.avatar||logo" mode="" class="userHead"></image>
</view>
<view class="userName">
{{item.user.nickname||'科欧社区淘'}}
</view>
</view>
<view class="userRight" style="display: flex;align-items: center;"
v-if="item.grade_status">
<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>
</view>
</view>
</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;">
{{item.address||''}}
</view>
<view class="maskAddress" v-if="item!=null">
{{item.distance.toFixed(1)}}km
<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;">
{{item.address||''}}
</view>
<view class="maskAddress" v-if="item!=null">
{{item.distance.toFixed(1)}}km
</view>
</view>
</view>
</view>
</view>
</view>
</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">
<view class="meFaShow">
<view class="OnBuyProject" @click="OnBuyProject">
<image src="../../static/image/maixianzhi_icon@2x.png" style="width: 180rpx;height: 180rpx;"
mode=""></image>
<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">
<view class="meFaShow">
<view class="OnBuyProject" @click="OnBuyProject">
<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>
</view>
</view>
<view class="OnMaiProject" @click="OnMaiProject">
<image src="../../static/image/faxuqiu_icon_1@2x.png" style="width: 180rpx;height: 180rpx;"
mode=""></image>
<view class="onFaClose" @click="onClose">
<text class="onClose">取消</text>
</view>
</view>
<view class="onFaClose" @click="onClose">
<text class="onClose">取消</text>
</view>
</van-popup>
</view>
<ul class="bottom">
<li @click="goIndex">
<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>
<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="">
</van-popup>
</view>
<ul class="bottom">
<li @click="goIndex">
<image src="../../static/image/xianzhi_icon_1@2x.png" style="width: 48rpx;height: 44rpx;" 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>
<text class="botText">消息</text>
<view class="num" v-if="messageNum!==0">
{{messageNum>99?'99+':messageNum}}
</view>
</li>
<li @click="goMe">
<image src="../../static/image/wode_icon_5@2x.png" style="width: 48rpx;height: 44rpx;" mode=""></image>
<text class="botText">我的</text>
</li>
</ul>
<text class="botTextXZ">闲置</text>
</li>
<li @click="goActuvity">
<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>
<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>
<text class="botText">消息</text>
<view class="num" v-if="messageNum!==0">
{{messageNum>99?'99+':messageNum}}
</view>
</li>
<li @click="goMe">
<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>
... ... @@ -316,6 +351,10 @@
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
if (uni.getStorageSync("City") == "") {
this.getLocations();
} else {
that.addressText = uni.getStorageSync("City")
}
setTimeout(() => {
this.swiper();
this.classifyData(); //分类
this.jfavtivity(); //拼团
this.board() //广告
this.jvliSelect(); //距离选择
this.classifylistss(); //分类选择
this.messageNums() //留言个数
setTimeout(() => {
if (!this.demo) {
if (uni.getStorageSync("City") == "") {
this.getLocations();
} else {
this.addressText = uni.getStorageSync("City")
}
// 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,34 +815,36 @@
})
},
//闲置商品
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(
'lat') + '&lot=' + uni.getStorageSync('lot') + '&userId=' + uni.getStorageSync(
'userInfo').id
url: "/pages/index/good-details?goos_id=" + ids + '&index=1' + '&lat=' + uni
.getStorageSync(
'lat') + '&lot=' + uni.getStorageSync('lot') + '&userId=' + uni.getStorageSync(
'userInfo').id
})
}
},
//发现需要
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
})
}
},
//全部分类
allClassify() {
... ... @@ -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'
});
... ... @@ -924,7 +1047,7 @@
})
},
}
}
</script>
... ... @@ -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>
... ...
<template>
<view class="container" style="padding: 0;">
<view class="inputBox">
<input class="uni-input" @input="onKeyInput" placeholder="请输入搜索内容" style="padding: 0 32rpx;" v-model="inputValue" />
<input class="uni-input" @input="onKeyInput" placeholder="请输入搜索内容" style="padding: 0 32rpx;"
v-model="inputValue" />
<text class='searchText' @click="search" style="margin-top: 10rpx;">搜索</text>
</view>
<view class="tabBox" style="margin-top: 26rpx;padding: 0 32rpx;">
... ... @@ -29,47 +30,51 @@
</view>
</view>
</view> -->
<view class="" style="display: flex; justify-content: space-between;flex-wrap: wrap;margin-top: 26rpx;">
<view class="goodsBox " v-for="(item,index) in goodsList" :key="index" @click="goDetail(item.goods_id)">
<view class="" style="display: flex; justify-content: space-between;flex-wrap: wrap;margin-top: 26rpx;">
<view class="goodsBox " v-for="(item,index) in goodsList" :key="index"
@click="goDetail(item.goods_id,item.title,item.ad_id)">
<view class="goodsPic">
<image :src="item.images[0]" mode="" class="goodImg"></image>
<image :src="item.images[0]||item.title_image" mode="" class="goodImg"></image>
</view>
<view class="goodsDel">
{{item.goods_name}}
{{item.goods_name?item.goods_name:item.title}}
</view>
<view class="goodsPrice">
<view :class="item.price?'goodsPrice':'goodsPrices'">
<text style="font-size: 24rpx;margin-right: -6rpx;">¥</text>
{{item.price}}
</view>
<view class="userInfo">
<view class="userLeft">
<view class="userHead">
<image :src="item.avatar" mode="" class="userHead"></image>
<image :src="item.avatar||logo" mode="" class="userHead"></image>
</view>
<view class="userName">
{{item.nickname}}
{{item.nickname||'科欧社区淘'}}
</view>
</view>
<view class="userRight">
<image src="/static/image/zuanshi_icon_1@2x.png" mode="" style="width:20rpx;height: 17rpx;margin-right: 12rpx;"></image>
{{item.grade_status==0?'L0':item.grade_status==1?'L1':item.grade_status==2?'L2':item.grade_status==3?'L3':item.grade_status==4?'L4':'L5'}}
<image src="/static/image/zuanshi_icon_1@2x.png" mode=""
style="width:20rpx;height: 17rpx;margin-right: 12rpx;"></image>
{{item.grade_status==0?'L0':item.grade_status==1?'L1':item.grade_status==2?'L2':item.grade_status==3?'L3':item.grade_status==4?'L4':item.grade_status==5?'L5':'广告'}}
</view>
</view>
<view class="addressMask">
<image src="/static/image/dingwei_icon_1@2x.png" mode=""></image>
<view class="maskAddress" style="max-width: 104rpx;white-space: nowrap;overflow: hidden;text-overflow: ellipsis;">
<view class="maskAddress"
style="max-width: 104rpx;white-space: nowrap;overflow: hidden;text-overflow: ellipsis;"
v-if="item.address">
{{item.address}}
</view>
<view class="maskAddress">
{{item.dis}}km
<view class="maskAddress" v-if="item!=null">
{{item.dis==undefined?item.distance.toFixed(2):item.dis.toFixed(2)}}km
</view>
</view>
</view>
</view>
</view>
<view class="" v-if="goodsList.length==0" style="text-align: center;margin-top: 100rpx;color:grey;">
暂无更多搜索结果
</view>
<view class="" v-if="goodsList.length==0" style="text-align: center;margin-top: 100rpx;color:grey;">
暂无更多搜索结果
</view>
</view>
</template>
... ... @@ -77,35 +82,53 @@
import request from "../../utils/request.js"
export default {
onLoad(options) {
this.inputValue = options.kw;
this.searchResult();
this.inputValue = options.kw
this.getBoardList()
this.searchResult()
},
data(){
return{
pageNum:1,
inputValue:'',
data() {
return {
pageNum: 1,
inputValue: '',
//距离
// array: [],
// index: 0,
q:1,
q: 1,
//分类
classifyId:[],
classId:'',
classifyId: [],
classId: '',
classArray: [],
index1: '',
goodsList: []
goodsList: [],
boardIndex: 0, //广告index
boardList: [], //广告列表
logo: '../../static/image/logo.jpg'
}
},
onReachBottom: function() {
this.pageNum = this.pageNum + 1
this.searchResult
this.searchResult()
},
methods: {
//广告列表
getBoardList() {
let that = this
request.post('/api/index/adList', {
lat2: uni.getStorageSync('lat'),
lng2: uni.getStorageSync('lot')
// lat2: '39.15935',
// lng2: '117.23785'
}).then(res => {
this.boardList = res.data
}).catch(err => {
})
},
//分类选择
classifylist() {
request.get('/api/index/fen', {})
.then(res => {
this.classifyId=res.data.info
this.classifyId = res.data.info
let list = res.data.info
list.forEach((item, index) => {
this.classArray.push(item.name)
... ... @@ -115,13 +138,13 @@
});
},
//距离选择
jlSort(){
this.q=Number(this.q)==1?'2':'1',
this.searchResult()
jlSort() {
this.q = Number(this.q) == 1 ? '2' : '1',
this.searchResult()
},
bindPickerChange1: function(e) {
this.index1 = e.target.value
this.classId=this.classifyId[this.index1].id
this.classId = this.classifyId[this.index1].id
this.searchResult()
},
onKeyInput(e) {
... ... @@ -132,30 +155,51 @@
// uni.navigateTo({
// url: '/pages/index/search-result?kw=' + this.inputValue
// })
this.boardIndex = 0
this.searchResult()
},
//搜索结果
searchResult() {
request.post('/api/index/Search', {
page:this.pageNum,
rows:10,
kw: this.inputValue,
lat2: this.latitude,
lng2: this.longitude,
q:this.q,
sort_id:this.classId
}).then(res => {
let list = this.pageNum == 1 ? res.data.info: this.list.concat(res.data.info);
this.goodsList=list
console.log(res.data)
}).catch(err => {
if (this.inputValue == '') {
uni.showToast({
title: '请输入搜索内容',
icon: 'none'
})
} else {
request.post('/api/index/Search', {
page: this.pageNum,
rows: 6,
kw: this.inputValue,
lat2: this.latitude,
lng2: this.longitude,
q: this.q,
sort_id: this.classId
}).then(res => {
if (res.data.info.length == 6) {
res.data.info.push(this.boardList[this.boardIndex])
this.boardIndex += 1
if (this.boardIndex >= this.boardList.length) {
this.boardIndex = 0
}
}
let list = this.pageNum == 1 ? res.data.info : this.goodsList.concat(res.data.info);
this.goodsList = list
}).catch(err => {
})
})
}
},
goDetail(id){
uni.navigateTo({
url:'/pages/index/good-details?goos_id='+id
})
goDetail(id, title, boardId) {
if (title) {
uni.navigateTo({
url: '/pages/index/board-detail?id=' + boardId
})
} else {
uni.navigateTo({
url: '/pages/index/good-details?goos_id=' + id
})
}
}
},
created() {
... ... @@ -179,4 +223,8 @@
border-radius: 16rpx 16rpx 0 0;
position: relative;
}
.goodsPrices {
color: #fff !important;
}
</style>
... ...
... ... @@ -15,10 +15,9 @@
</view>
<view class="searchList">
<view class="searchItem" v-for="(item,index) in list" :key="index">
<view class="result" @click="pitchItem(item.kw)">
<view class="result" @click="pitchItem(item.kw)" v-if="index<=15">
{{item.kw}}
</view>
</view>
</view>
</view>
... ... @@ -44,7 +43,7 @@
//历史搜索
history() {
request.get('/api/index/liShi', {}).then(res => {
this.list = res.data.info
this.list = res.data.info.reverse()
}).catch(err => {
})
... ...
... ... @@ -225,7 +225,7 @@
//分享
onShareAppMessage: function(e) {
let title = '近邻交易,闲置不再闲置'
let imgUrls="../../static/image/shareImg.png"+'!share'
let imgUrls="http://muying.qiniu.broing.cn/img_share@2x.png"
return {
title: title,
path: "/pages/index/user-page?id=" + this.id + '&userId=' + uni.getStorageSync('userInfo').id,
... ...
... ... @@ -344,6 +344,11 @@
title: '请输入商品描述',
icon: 'none'
})
} else if (that.urlImg.length == 0) {
uni.showToast({
title: '请上传商品图片',
icon: 'none'
})
} else if (that.latitude == '') {
uni.showToast({
title: '请进行位置选择',
... ...
... ... @@ -359,7 +359,7 @@
title: '请选择新旧程度',
icon: 'none'
})
} else if (that.wechat == nul) {
} else if (this.wechat == null) {
uni.showToast({
title: '请先设置微信号',
icon: 'none'
... ...
... ... @@ -85,7 +85,7 @@
</view>
<view class="mesNavRight">
<image :src="item.goods.images[0]"
style="width: 130rpx;height: 130rpx;border-radius: 16rpx;" mode=""></image>
style="width: 130rpx;height: 130rpx;border-radius: 16rpx;" mode="aspectFill"></image>
</view>
</view>
... ...