切换导航条
此项目
正在载入...
登录
倪静楠
/
muying
·
提交
转到一个项目
GitLab
转到仪表盘
项目
活动
文件
提交
管道
0
构建
0
图表
里程碑
问题
0
合并请求
0
成员
标记
维基
派生
网络
创建新的问题
下载为
邮件补丁
差异文件
浏览文件
作者
倪静楠
4 years ago
提交
04d7943c5c9200f7772a359fccb67f84d85e7d1b
1 个父辈
ac1affed
2/25
隐藏空白字符变更
内嵌
并排对比
正在显示
9 个修改的文件
包含
429 行增加
和
200 行删除
myPackage/pages/me/me.vue
pages/activity/activity.vue
pages/index/chat.vue
pages/index/good-details.vue
pages/index/index.vue
pages/index/map.vue
pages/index/select-location.vue
pages/index/user-page.vue
pages/message/message.vue
myPackage/pages/me/me.vue
查看文件 @
04d7943
...
...
@@ -77,46 +77,48 @@
</view>
</view>
<view class="meBot">
<view class="meBotontt">
<view class="meBotontt"
@click="onIssue"
>
<view class="meBotontPic">
<image src="../../../static/image/fabu_icon_3@2x.png" style="width: 32rpx;height: 32rpx;margin-right: 14rpx;" mode=""></image>
<image src="../../../static/image/fabu_icon_3@2x.png" style="width: 32rpx;height: 32rpx;margin-right: 14rpx;"
mode=""></image>
</view>
<view class="meBotontText"
@click="onIssue"
>
<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 class="meBotontt">
<view class="meBotontt"
@click="onGroup"
>
<view class="meBotontPic">
<image src="../../../static/image/wodepintuan_icon_1@2x.png" style="width: 32rpx;height: 32rpx;margin-right: 14rpx;"
mode=""></image>
</view>
<view class="meBotontText"
@click="onGroup"
>
<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 class="meBotontt">
<view class="meBotontt"
@click="onYaoQing"
>
<view class="meBotontPic">
<image src="../../../static/image/yaoqingyouli_icon_1@2x.png" style="width: 32rpx;height: 32rpx;margin-right: 14rpx;"
mode=""></image>
</view>
<view class="meBotontText"
@click="onYaoQing"
>
<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 class="meBotontt kefuBorder">
<view class="meBotontt kefuBorder"
@click="onKeFu"
>
<view class="meBotontPic">
<image src="../../../static/image/kefu_icon_1@2x.png" style="width: 32rpx;height: 32rpx;margin-right: 14rpx;" mode=""></image>
<image src="../../../static/image/kefu_icon_1@2x.png" style="width: 32rpx;height: 32rpx;margin-right: 14rpx;"
mode=""></image>
</view>
<view class="meBotontText "
@click="onKeFu"
>
<view class="meBotontText " >
<text class="meBotText">客服</text>
</view>
<view class="meBotontImg">
...
...
@@ -156,10 +158,13 @@
<text class="botTextFa">发布</text>
</view>
</li>
<li @click="goMessage">
<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">
{{messageNum>99?'99+':messageNum}}
</view>
</li>
<li @click="goMe">
<image src="../../../static/image/wode_icon_7@2x.png" style="width: 48rpx;height: 44rpx;" mode=""></image>
...
...
@@ -174,7 +179,7 @@
export default {
data() {
return {
token:false,
token:
false,
userData: '',
show: false,
sum: 966,
...
...
@@ -183,32 +188,34 @@
guanzhu: 0,
shoucang: 0,
phoneNumber: '',
messageNum: 0, //留言个数
}
},
onShow() {
if (uni.getStorageSync('token')) {
this.token = true
setTimeout(()
=>
{
setTimeout(()
=>
{
this.getUserInfo()
this.fenSums()
this.guanzhus()
this.shoucangs()
this.jifens()
},500)
this.messageNums()
}, 500)
}
},
created() {
if (uni.getStorageSync('token')) {
this.token = true
setTimeout(()
=>
{
setTimeout(()
=>
{
this.getUserInfo()
this.fenSums()
this.guanzhus()
this.shoucangs()
this.jifens()
},500)
},
500)
}
},
methods: {
//
...
...
@@ -290,7 +297,7 @@
} else {
this.login()
}
},
//粉丝
GoFens() {
...
...
@@ -317,11 +324,11 @@
},
//收藏
shoucangs() {
request.get('/api/personal/collectSum', {}).then(res => {
this.shoucang = res.data
}).catch(err => {
request.get('/api/personal/collectSum', {}).then(res => {
this.shoucang = res.data
}).catch(err => {
})
})
},
//关注
guanzhus() {
...
...
@@ -337,7 +344,7 @@
this.jf = res.data
}).catch(err => {
})
})
},
//粉丝数量
fenSums() {
...
...
@@ -346,13 +353,14 @@
console.log(this.fensi, 'data')
}).catch(err => {
})
})
},
onUserInfo() {
if (this.token) {
uni.navigateTo({
url: '/myPackage/pages/me/personal'
})} else {
uni.navigateTo({
url: '/myPackage/pages/me/personal'
})
} else {
this.login()
}
},
...
...
@@ -360,19 +368,21 @@
//邀请有礼
onYaoQing() {
if (this.token) {
uni.navigateTo({
url: '/myPackage/pages/me/invite'
})} else {
uni.navigateTo({
url: '/myPackage/pages/me/invite'
})
} else {
this.login()
}
},
//客服
onKeFu() {
if (this.token) {
this.kefu()
uni.makePhoneCall({
phoneNumber: this.phoneNumber
})} else {
this.kefu()
uni.makePhoneCall({
phoneNumber: this.phoneNumber
})
} else {
this.login()
}
},
...
...
@@ -430,6 +440,14 @@
uni.navigateTo({
url: '/myPackage/pages/me/member'
});
},
//留言个数
messageNums() {
request.get('/api/mation/unreadNumber', {}).then(res => {
this.messageNum = res.data.number
}).catch(err => {
})
}
}
}
...
...
@@ -487,4 +505,20 @@
font-size: 18rpx;
color: #FF834D;
}
.num {
position: absolute;
background: red;
height: 30rpx;
font-size: 22rpx;
line-height: 30rpx;
text-align: center;
border-radius: 16rpx;
color: #fff;
top: 6rpx;
right: 30rpx;
min-width: 18rpx;
max-width: 60rpx;
padding: 0 6rpx;
}
</style>
...
...
pages/activity/activity.vue
查看文件 @
04d7943
...
...
@@ -83,10 +83,12 @@
<text class="botTextFa">发布</text>
</view>
</li>
<li @click="goMessage">
<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">
{{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>
...
...
@@ -108,7 +110,8 @@
location: '',
jifen: '',
list: [],
touchBottom:false //触底提示
touchBottom:false ,//触底提示
messageNum:0,
}
},
onReachBottom: function() {
...
...
@@ -129,6 +132,7 @@
},
onShow() {
this.myNum()
this.messageNums()
},
methods: {
login(){
...
...
@@ -224,6 +228,14 @@
uni.reLaunch({
url: '/myPackage/pages/me/me'
});
},
//留言个数
messageNums(){
request.get('/api/mation/unreadNumber',{}).then(res=>{
this.messageNum=res.data.number
}).catch(err=>{
})
}
}
}
...
...
@@ -281,4 +293,19 @@
color: #879099;
font-size: 18rpx;
}
.num {
position: absolute;
background: red;
height: 30rpx;
font-size: 22rpx;
line-height: 30rpx;
text-align: center;
border-radius: 16rpx;
color: #fff;
top: 6rpx;
right: 30rpx;
min-width: 18rpx;
max-width: 60rpx;
padding: 0 6rpx;
}
</style>
...
...
pages/index/chat.vue
查看文件 @
04d7943
...
...
@@ -14,16 +14,19 @@
<view class="rightBox" @click="yimai(goodDatas.goods_id)" v-if="yimaiBtn">
已买
</view>
<view class="rightBox1"
v-if="!yimaiBtn">
<view class="rightBox1" v-if="!yimaiBtn">
已买
</view>
</view>
<view :class="Number(index)==2?'margin1':'margin0'">
<view class="" v-if="index==1">
<view class="" v-for="(item,index) in list" :key="index" :class="item.type==1?'leftItem':'rightItem'">
<image :src="item.avatar1" mode="" class="headImg" v-if="item.type==1"></image>
<image :src="item.avatar1" mode="" class="headImg" v-if="item.type==0"></image>
<view :class="item.type==1?'leftContent':'rightContent'" style="position: relative;">
<view class="" v-for="(item,index) in list" :key="index" :class="item.type==1&&item.datetime?'leftItem1':item.type==1&&!item.datetime?'leftItem':item.type==0&&item.datetime?'rightItem1':item.type==0&&!item.datetime?'rightItem':''">
<view class="dateTime" v-if="item.datetime!==undefined">
{{item.datetime}}
</view>
<image :src="item.avatar1" mode="" :class="item.datetime?'headImg1':'headImg'" v-if="item.type==1"></image>
<image :src="item.avatar1" mode="" :class="item.datetime?'headImg1':'headImg'" v-if="item.type==0"></image>
<view :class="item.type==1&&item.datetime?'leftContent1':item.type==1&&!item.datetime?'leftContent':item.type==0&&item.datetime?'rightContent1':'rightContent'" style="position: relative;">
{{item.content}}
<view class="" style="width: 20rpx;height: 20rpx;background-color: #fff;transform: rotate(45deg);position: absolute;top: 36rpx;left: -10rpx;"
v-if="item.type==1">
...
...
@@ -39,6 +42,9 @@
</view>
<view class="" v-if="index==2">
<view class="" v-for="(item,index) in list" :key="index" :class="item.type==0?'leftItem':'rightItem'">
<view class="dateTime" v-if="item.datetime!==undefined">
{{item.datetime}}
</view>
<image :src="item.avatar1" mode="" class="headImg" v-if="item.type==0"></image>
<image :src="item.avatar1" mode="" class="headImg" v-if="item.type==1"></image>
<view :class="item.type==0?'leftContent':'rightContent'" style="position: relative;">
...
...
@@ -58,7 +64,7 @@
</view>
<view :class="!picList?'inputBox':'inputBox inputBoxHeight'">
<textarea type="text" value="inputText" v-model="inputText" @input="bindInput" placeholder="请输入最新消息" cursor-spacing='40'/>
<textarea type="text" value="inputText" v-model="inputText" @input="bindInput" placeholder="请输入最新消息" cursor-spacing='40'
/>
<!-- <view class="addIcon" @click.stop="addPic" v-if="inputText==''">
+
</view> -->
...
...
@@ -296,6 +302,12 @@
height: 88rpx;
border-radius: 50%;
}
.headImg1 {
width: 88rpx;
height: 88rpx;
border-radius: 50%;
margin-top: 72rpx;
}
.sendBtn{
padding: 6rpx 10rpx;
font-size: 24rpx;
...
...
@@ -305,24 +317,22 @@
margin-left: 20rpx;
}
.sendBtn1{
padding: 6rpx 10rpx;
font-size: 24rpx;
border: 2rpx solid #d7d7d8;
color: #d7d7d8;
border-radius: 10rpx;
margin-left: 20rpx;
}
/* 左边 */
.leftItem {
display: flex;
padding: 0 24rpx;
box-sizing: border-box;
margin-bottom: 20rpx;
margin-bottom: 40rpx;
position: relative;
}
.leftItem1 {
display: flex;
padding: 0 24rpx;
box-sizing: border-box;
margin-bottom: 40rpx;
position: relative;
margin-top: 70rpx;
}
.leftContent {
background-color: #fff;
padding: 26rpx 20rpx;
...
...
@@ -331,14 +341,32 @@
max-width: 560rpx;
border-radius: 16rpx;
}
.leftContent1 {
background-color: #fff;
padding: 26rpx 20rpx;
box-sizing: border-box;
margin-left: 20rpx;
max-width: 560rpx;
border-radius: 16rpx;
margin-top: 72rpx;
}
/* 右边 */
.rightItem {
display: flex;
padding: 0 24rpx;
box-sizing: border-box;
margin-bottom: 20rpx;
margin-bottom: 40rpx;
flex-direction: row-reverse;
position:relative;
}
.rightItem1 {
display: flex;
padding: 0 24rpx;
box-sizing: border-box;
margin-bottom: 40rpx;
flex-direction: row-reverse;
position:relative;
margin-top: 70rpx;
}
.rightContent {
...
...
@@ -350,6 +378,16 @@
color: #fff;
border-radius: 16rpx;
}
.rightContent1 {
background-color: #FF834D;
padding: 20rpx;
box-sizing: border-box;
margin-right: 20rpx;
max-width: 560rpx;
color: #fff;
border-radius: 16rpx;
margin-top: 72rpx;
}
.inputBox {
width: 100%;
...
...
@@ -394,4 +432,15 @@
line-height: 40rpx;
margin-left: 20rpx;
}
.dateTime{
position: absolute;
top:-44rpx;
left: 44%;
opacity: 1;
background: #cccccc;
border-radius: 16px;
padding: 0 30rpx;
font-size: 20rpx;
color: #fff;
}
</style>
...
...
pages/index/good-details.vue
查看文件 @
04d7943
...
...
@@ -128,9 +128,9 @@
<view class="maskAddress">
{{item.address}}
</view>
<view class="maskAddress">
<
!-- <
view class="maskAddress">
{{item.dis}}km
</view>
</view>
-->
</view>
</view>
</view>
...
...
pages/index/index.vue
查看文件 @
04d7943
...
...
@@ -7,7 +7,7 @@
{{addressText}}
<!-- <image src="/static/image/Frame_11@2x.png" mode="" style="width: 24rpx;height: 24rpx;"></image> -->
<view class="arrowWhite">
</view>
</view>
</view>
...
...
@@ -37,16 +37,14 @@
</view>
</view>
<view class="swiperBox">
<swiper class="swiper" :indicator-dots="indicatorDots"
:duration="duration"
:circular="true" autoplay="true">
<swiper class="swiper" :indicator-dots="indicatorDots" :duration="duration" :circular="true" autoplay="true">
<swiper-item v-for="(item,index) in swiperList" :key="index" @click="goGood(item.id_status)">
<image :src="item.image" mode="" class="swiper"></image>
</swiper-item>
</swiper>
</view>
<view class="classifyBox">
<view class="classifyPic" v-for="(item,index) in ClassifyList" :key="index" @click="goClass(index,item.id)" v-if="index<3">
<view class="classifyPic" v-for="(item,index) in ClassifyList
1
" :key="index" @click="goClass(index,item.id)" v-if="index<3">
<image :src="item.image" mode=""></image>
<text class="classifyText">{{item.name}}</text>
</view>
...
...
@@ -55,7 +53,7 @@
<text class="classifyText">分类</text>
</view>
</view>
<view style="margin: 0 30rpx 0 34rpx;">
<view style="margin: 0 30rpx 0 34rpx;"
v-if="listTypecont.length>0"
>
<view class="pintuanBox">
<view class="pintuanTop">
<view class="topLeft" style="display: flex;align-items: center;">
...
...
@@ -106,7 +104,7 @@
</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="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>
...
...
@@ -174,12 +172,12 @@
</view>
<view class="addressMask">
<image src="/static/image/dingwei_icon_1@2x.png" mode=""></image>
<view class="maskAddress" style="max-width:
1
04rpx;white-space: nowrap;overflow: hidden;text-overflow: ellipsis;">
<view class="maskAddress" style="max-width:
2
04rpx;white-space: nowrap;overflow: hidden;text-overflow: ellipsis;">
{{item.address}}
</view>
<view class="maskAddress">
<
!-- <
view class="maskAddress">
{{item.distance}}km
</view>
</view>
-->
</view>
</view>
</view>
...
...
@@ -219,12 +217,12 @@
</view>
<view class="addressMask">
<image src="/static/image/dingwei_icon_1@2x.png" mode=""></image>
<view class="maskAddress" style="max-width:
1
04rpx;white-space: nowrap;overflow: hidden;text-overflow: ellipsis;">
<view class="maskAddress" style="max-width:
2
04rpx;white-space: nowrap;overflow: hidden;text-overflow: ellipsis;">
{{item.address}}
</view>
<view class="maskAddress">
<
!-- <
view class="maskAddress">
{{item.distance.toFixed(2)}}km
</view>
</view>
-->
</view>
</view>
</view>
...
...
@@ -263,16 +261,19 @@
<text class="botTextFa">发布</text>
</view>
</li>
<li @click="goMessage">
<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" >
{{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>
...
...
@@ -282,45 +283,46 @@
import request from '../../utils/request.js'
export default {
onLoad: function(options) {
uni.setStorageSync('pid',options.userId)
if(options.address){
this.addressText=options.address
uni.setStorageSync('aaa',11)
uni.setStorageSync('City',options.address)
uni.setStorageSync('lat',options.lat)
uni.setStorageSync('lot',options.lot)
}else{
uni.setStorageSync('pid', options.userId)
if (options.address) {
this.addressText = options.address
uni.setStorageSync('aaa', 11)
uni.setStorageSync('City', options.address)
uni.setStorageSync('lat', options.lat)
uni.setStorageSync('lot', options.lot)
} else {
}
if(uni.getStorageSync('token')){
this.token=true
if (uni.getStorageSync('token')) {
this.token = true
}
setTimeout(()=>{
this.swiper();
this.classifyData(); //分类
this.jfavtivity(); //拼团
this.board() //广告
this.jvliSelect(); //距离选择
this.classifylistss(); //分类选择
this.goodsXy(); //发现需要
this.goodsXz(); //闲置物品
},500)
},
onShow: function(){
onShow: function()
{
let that = this
if
(uni.getStorageSync("City") == "")
{
if
(uni.getStorageSync("City") == "")
{
this.getLocations();
}
else
{
}
else
{
that.addressText = uni.getStorageSync("City")
}
setTimeout(() => {
this.swiper();
this.classifyData(); //分类
this.jfavtivity(); //拼团
this.board() //广告
this.jvliSelect(); //距离选择
this.classifylistss(); //分类选择
this.goodsXy(); //发现需要
this.goodsXz(); //闲置物品
this.messageNums()//留言个数
}, 500)
},
data() {
return {
token:false,
pageNums:1,
pageNum:1,
token: false,
pageNums: 1,
pageNum: 1,
addressText: '',
IndexImg: 'https://s3.ax1x.com/2021/01/11/s8PyTK.png',
longitude: '',
...
...
@@ -328,56 +330,67 @@
address: '', //定位
noAddress: false,
swiperList: [], //轮播图
autoplay:true,
duration:1500,
indicatorDots:true,
autoplay: true,
duration: 1500,
indicatorDots: true,
boardImg: '', //广告
IndexImg: 'https://s3.ax1x.com/2021/01/11/s8PyTK.png',
address: '', //定位
inputValue: '',
inputValue: '',
//拼团
listTypecont: [],
scrollTop: 0,
tabList: ['闲置物品', '发现需要'],
tabIndex: 0,
//距离
arrayList:[],
arrayList:
[],
array: [],
index: 0,
//分类
ClassifyList1: [],
ClassifyList: [],
classArray: [],
index1: 0,
//商品
goodsList: [],
goodsList1: [],
show: false
show: false,
messageNum:0 //消息个数
}
},
created() {
},
onReachBottom() {
if (this.tabIndex == 0) {
this.pageNum = this.pageNum + 1
this.goodsXz()
} else {
this.pageNum = this.pageNum + 1
this.goodsXy()
}
},
methods: {
login(){
login()
{
uni.navigateTo({
url:"/pages/index/login"
url:
"/pages/index/login"
})
},
//签到
signIn() {
if
(this.token)
{
if
(this.token)
{
request.get('/api/number/signIn', {}).then(res => {
uni.showToast({
title: res.msg,
icon: 'none'
})
}).catch(err => {
})
}
else
{
}
else
{
this.login()
}
},
getLocations() {
...
...
@@ -396,10 +409,10 @@
},
success: res => {
wx.setStorageSync('City', res.data.result.address_component.city)
if(that.addressText==''){
if(uni.getStorageSync("City") == ""){
that.addressText = res.data.result.address_component.city
}else{
if (that.addressText == '') {
if (uni.getStorageSync("City") == "") {
that.addressText = res.data.result.address_component.city
} else {
that.addressText = uni.getStorageSync("City")
}
}
...
...
@@ -413,10 +426,10 @@
},
//藏宝图
cangbao() {
if
(this.token)
{
if
(this.token)
{
var t = this;
let lat = uni.getStorageSync('lat')
if (!lat
) {
if (!lat) {
uni.authorize({
scope: 'scope.userLocation',
success(res) {
...
...
@@ -447,16 +460,16 @@
url: '/pages/index/map'
})
}
}
else
{
}
else
{
this.login()
}
},
goSelectAddress() {
if
(this.token)
{
if
(this.token)
{
var t = this;
let lat = uni.getStorageSync('lat')
if (!lat
) {
if (!lat) {
uni.authorize({
scope: 'scope.userLocation',
success(res) {
...
...
@@ -487,10 +500,10 @@
url: '/pages/index/select-location'
})
}
}
else
{
}
else
{
this.login()
}
},
//轮播图
...
...
@@ -504,7 +517,7 @@
},
goGood(status) {
uni.navigateTo({
url: '/pages/index/integral-good?status='
+
status
url: '/pages/index/integral-good?status='
+
status
})
},
//积分活动
...
...
@@ -545,6 +558,7 @@
list.forEach((item, index) => {
this.classArray.push(item.name)
})
this.classArray.unshift('全部')
}).catch(ex => {
});
...
...
@@ -555,9 +569,9 @@
.then(res => {
let list = res.data.info
list.forEach((item, index) => {
this.array.push(item.long
+
"km")
this.array.push(item.long
+
"km")
this.arrayList.push(item)
})
}).catch(ex => {
...
...
@@ -571,7 +585,15 @@
},
classifyData() {
request.get('/api/index/inFen', {}).then(res => {
// this.ClassifyList1=res.data.info
this.ClassifyList = res.data.info
this.ClassifyList.unshift({
id: '',
name: '全部'
})
let list = this.ClassifyList
list.shift()
this.ClassifyList1 = list
}).catch(err => {
})
...
...
@@ -579,13 +601,13 @@
//闲置商品
goGoodDetailXz(ids) {
uni.navigateTo({
url: "/pages/index/good-details?goos_id=" + ids
+
'&index=1'
url: "/pages/index/good-details?goos_id=" + ids
+
'&index=1'
})
},
//发现需要
goGoodDetailFx(ids) {
uni.navigateTo({
url: "/pages/index/good-details?id=" + ids
+
'&index=2'
url: "/pages/index/good-details?id=" + ids
+
'&index=2'
})
},
//全部分类
...
...
@@ -595,36 +617,38 @@
})
},
// 闲置物品
goodsXz() {
let that=this;
goodsXz() {
let that = this;
request.get("/api/index/xianZhi", {
lat2: uni.getStorageSync('lat'),
lng2: uni.getStorageSync('lot'),
id:this.index?that.arrayList[that.index].id:"",
sort_id:that.index1?that.ClassifyList[that.index1].id:'',
id: this.index ? that.arrayList[that.index].id : "",
sort_id: that.index1 ? that.ClassifyList[that.index1].id : '',
page: that.pageNum,
rows: 10
})
.then(res => {
this.goodsList = res.data.data
let list = that.pageNum == 1 ? res.data.data : that.goodsList.concat(res.data.data)
this.goodsList = list
}).catch(ex => {
});
},
//发现需要
goodsXy() {
let that=this
request.get("/api/index/faXian",{
let that = this
request.get("/api/index/faXian", {
lat2: uni.getStorageSync('lat'),
lng2: uni.getStorageSync('lot'),
page: that.pageNums,
rows: 10,
id:this.index?that.arrayList[that.index].id:"",
sort_id:that.index1?that.ClassifyList[that.index1].id:'',
id: this.index ? that.arrayList[that.index].id : "",
sort_id: that.index1 ? that.ClassifyList[that.index1].id : '',
// id:that.arrayList[that.index].id?that.arrayList[that.index].id:'',
// sort_id:that.classifylist[that.index1].id?that.classifylist[that.index1].id:'',
})
.then(res => {
let list = that.pageNum == 1 ? res.data.data : that.goodsList1.concat(res.data.data)
that.goodsList1 = res.data.data
}).catch(ex => {
...
...
@@ -651,30 +675,31 @@
//tab
changeTab(Inv) {
let that
=
this
let that
=
this
that.tabIndex = Inv;
if(that.tabIndex==0){
if (that.tabIndex == 0) {
this.pageNum = 1
that.goodsXz()
}else{
} else {
this.pageNum = 1
that.goodsXy()
}
},
bindPickerChange: function(e) {
this.index = e.target.value
if
(this.tabIndex==0)
{
if
(this.tabIndex == 0)
{
this.goodsXz()
}
else
{
}
else
{
this.goodsXy()
}
},
bindPickerChange1: function(e) {
let _that
=
this
let _that
=
this
_that.index1 = e.target.value
if
(_that.tabIndex==0)
{
if
(_that.tabIndex == 0)
{
_that.goodsXz()
}else{
console.log('发现')
} else {
_that.goodsXy()
}
},
...
...
@@ -692,24 +717,24 @@
},
//发布
goFa() {
if
(this.token)
{
if
(this.token)
{
this.show = true
}
else
{
}
else
{
this.login()
}
},
//消息
goMessage() {
uni.reLaunch({
url: '/pages/message/message'
});
},
//我的
goMe() {
uni.reLaunch({
url:'/myPackage/pages/me/me'
url:
'/myPackage/pages/me/me'
});
},
onClose() {
...
...
@@ -725,6 +750,14 @@
// fail() {}
// })
// }
//留言个数
messageNums(){
request.get('/api/mation/unreadNumber',{}).then(res=>{
this.messageNum=res.data.number
}).catch(err=>{
})
}
}
}
</script>
...
...
@@ -756,6 +789,7 @@
bottom: 0;
width: 100%;
display: flex;
z-index: 99;
}
ul li {
...
...
@@ -783,4 +817,20 @@
width: 88rpx;
height: 88rpx;
}
.num {
position: absolute;
background: red;
height: 30rpx;
font-size: 22rpx;
line-height: 30rpx;
text-align: center;
border-radius: 16rpx;
color: #fff;
top: 6rpx;
right: 30rpx;
min-width: 18rpx;
max-width: 60rpx;
padding: 0 6rpx;
}
</style>
...
...
pages/index/map.vue
查看文件 @
04d7943
...
...
@@ -4,10 +4,11 @@
<view>
<scroll-view class="scroll-view_H" scroll-x="true" @scroll="scroll" scroll-left="120">
<view class="" v-for="(item,index) in list" :key="index" style="display: inline-block;margin-right: 108rpx;">
<view :class="index==indexs?'active':''" @click="selectClassify(item
.id
,index)">
<view :class="index==indexs?'active':''" @click="selectClassify(item,index)">
{{item.name}}
</view>
<view class="secondBox" v-if="show&&!!secondList">
<!-- <view class="secondBox" v-if="show&&!!secondList"> -->
<view class="secondBox" v-if="secondList.length>0">
<view :class="secondIndex==indexs?'secondItem activeSecond':'secondItem'" v-for="(items,indexs) in secondList"
:key="indexs" @click="selectSecond(indexs,items.id)">
{{items.name}}
...
...
@@ -77,42 +78,73 @@
},
methods: {
selectClassify(ids, index) {
this.secondList=[]
let that = this;
this.indexs = index
this.secndClassify(ids)
if (this.secondList.length !== 0) {
if(this.indexs!==0){
this.show = true;
this.secondIndex = 0;
}else{
this.show = false;
if(index==0){
request.get('/api/index/cang', {
sort2_id:''
}).then(res => {
console.log(1111)
console.log(res)
that.goodListLength = res.data.length
let tempData = res.data;
that.goodList = res.data;
that.covers = [];
for (let obj of tempData) {
let tempInfo = JSON.parse(JSON.stringify(that.obj));
tempInfo.id = Number(obj.goods_id);
tempInfo.callout.content = obj.goods_name;
tempInfo.latitude = obj.lat;
tempInfo.longitude = obj.lng;
tempInfo.longitude = obj.lng;
tempInfo.iconPath = obj.good_image;
console.log(obj.good_image,'imahe')
that.covers=tempInfo
}
}).catch(err => {
})
}else{
this.secndClassify(ids)
if (this.secondList.length !== 0) {
if(this.indexs!==0){
this.show = true;
this.secondIndex = 0;
}else{
this.show = false;
}
} else {
this.show = !this.show;
}
} else {
this.show = !this.show;
this.$forceUpdate()
}
this.$forceUpdate()
},
//一级分类
firstClassify() {
request.get('/api/index/fen', {}).then(res => {
this.list = res.data.info
this.list.unshift({id:-1,name:'全部'})
this.secndClassify(this.list[0].id)
}).catch(err => {
})
request.get('/api/index/fen', {}).then(res => {
this.list = res.data.info
this.list.unshift({id:'',name:'全部'})
this.secndClassify(this.list[0].id)
}).catch(err => {
})
},
//二级分类
secndClassify(ids) {
request.get('/api/push/fenLei', {
id: ids
}).then(res => {
this.secondList = res.data.info
this.secondId=this.secondList[0].id
this.goodData()
}).catch(err => {
})
request.get('/api/push/fenLei', {
id: ids.id
}).then(res => {
this.secondList = res.data.info
this.secondId=this.secondList[0].id
this.goodData()
}).catch(err => {
})
},
selectSecond(index, id) {
this.secondIndex = index;
...
...
pages/index/select-location.vue
查看文件 @
04d7943
...
...
@@ -45,11 +45,11 @@
}
},
onShow() {
this.getAdress()
this.getAdress()
},
data() {
return {
list:
[],
//历史位置
list:
[],
//历史位置
qqmapsdk: '',
value: '',
currentAddress: '',
...
...
@@ -62,10 +62,19 @@
methods: {
//获取历史位置
getAdress() {
request.get('/api/index/addressList',{}).then(res=>{
this.list=res.data.info
}).catch(err=>{
request.get('/api/index/addressList', {}).then(res => {
let lists = res.data.info
let ary = []
let list2 = []
lists.forEach((item, index) => {
if (ary.indexOf(item.lat2) == -1) {
ary.push(item.lat2)
list2.push(item)
}
})
this.list=list2
}).catch(err => {
})
},
selectCity() {
...
...
pages/index/user-page.vue
查看文件 @
04d7943
...
...
@@ -118,9 +118,9 @@
<view class="maskAddress" style="max-width: 104rpx;white-space: nowrap;overflow: hidden;text-overflow: ellipsis;">
{{item.address}}
</view>
<view class="maskAddress">
<
!-- <
view class="maskAddress">
{{item.dis}}km
</view>
</view>
-->
</view>
</view>
...
...
@@ -157,9 +157,9 @@
<view class="maskAddress" style="max-width: 104rpx;white-space: nowrap;overflow: hidden;text-overflow: ellipsis;">
{{item.address}}
</view>
<view class="maskAddress">
<
!-- <
view class="maskAddress">
{{item.dis}}km
</view>
</view>
-->
</view>
</view>
...
...
pages/message/message.vue
查看文件 @
04d7943
...
...
@@ -25,7 +25,7 @@
<view class="mesBavRow" v-for="(item,index) in AnList" :key="index" @click="messageDetail(item.type,item.user_id)">
<view class="mesBavRowImg" style="position: relative;">
<image :src="item.user.avatar" style="width: 80rpx;height: 80rpx;border-radius: 50%;" mode=""></image>
<view class="redCircle">
<view class="redCircle"
v-if="item.is_read==0"
>
</view>
</view>
...
...
@@ -34,7 +34,7 @@
<text class="mesBavRowName">{{item.user.nickname}}</text>
<text class="mesBavRowTime">{{item.news.createtime}}</text>
</view>
<view style="width: 530rpx;overflow: hidden;white-space: nowrap;">
<view style="width: 530rpx;overflow: hidden;white-space: nowrap;
max-height: 40rpx;
">
<text class="mesBavRowTitleTe">{{item.news.content}}</text>
</view>
</view>
...
...
@@ -105,9 +105,12 @@
<text class="botTextFa">发布</text>
</view>
</li>
<li @click="goMessage">
<li @click="goMessage"
style="position: relative;"
>
<image src="../../static/image/xioaxi_icon_1@2x.png" style="width: 48rpx;height: 44rpx;" mode=""></image>
<text class="botTextXX">消息</text>
<view class="num">
{{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>
...
...
@@ -122,6 +125,7 @@
export default {
onShow() {
this.myData()
this.messageNums()//留言个数
},
data() {
return {
...
...
@@ -130,7 +134,8 @@
AnList: [],
index: 0,
show: false,
pageNum:1
pageNum:1,
messageNum:0 //消息个数
}
},
onReachBottom: function () {
...
...
@@ -289,6 +294,14 @@
uni.navigateTo({
url: '/pages/message/systematic?id='+id
});
},
//留言个数
messageNums(){
request.get('/api/mation/unreadNumber',{}).then(res=>{
this.messageNum=res.data.number
}).catch(err=>{
})
}
}
}
...
...
@@ -357,4 +370,19 @@
top: 22rpx;
z-index: 99;
}
.num {
position: absolute;
background: red;
height: 30rpx;
font-size: 22rpx;
line-height: 30rpx;
text-align: center;
border-radius: 16rpx;
color: #fff;
top: 6rpx;
right: 30rpx;
min-width: 18rpx;
max-width: 60rpx;
padding: 0 6rpx;
}
</style>
...
...
请
注册
或
登录
后发表评论