作者 刘晓艳

修改匿名显示弹窗

... ... @@ -92,14 +92,6 @@ App({
title: '提示',
content: res.data.msg,
showCancel: false,
success: function (res) {
if (res.confirm) {
wx.removeStorageSync('token');
wx.navigateTo({
url: '/pages/start/start',
})
}
}
})
reject(res.data)
}
... ...
/* 自定义tabbar */
.null_box{
width: 100%;
height: 120rpx;
}
/* 发布弹窗 */
.mianmask_box {
... ...
... ... @@ -23,13 +23,13 @@ Page({
"XX-Token": wx.getStorageSync('token')
}
app.post(url, params, header).then((res) => {
console.log(res)
const list = res.map((item, index) => {
return { ...item, showlabel_box: false, more: JSON.parse(item.more) }
});
var contentImg = JSON.parse(res[0].more)
that.setData({
listdetail: res[0],
listdetail: list[0],
contentImg: contentImg,
paiseuser: res[0].paise_user,
})
... ...
... ... @@ -211,7 +211,7 @@ Page({
let header = {
"XX-Token": wx.getStorageSync('token')
};
app.post(url).then((res) => {
app.post(url,{},header).then((res) => {
// console.log('获取为你推荐',res);
self.setData({
recommendList: res,
... ...
... ... @@ -89,6 +89,7 @@
}
swiper {
height: 200rpx;
margin-top: 20rpx;
}
.slide-image {
width: 100%;
... ...
... ... @@ -5,11 +5,13 @@ Page({
* 页面的初始数据
*/
data: {
current: 0,
current: -1,
currentIndex: true,
tabcurrent: 3,
portal_post: [], //全部文章
portal_two: [], //全部分类
maskstate: false,
currentSort: 0,
sort: [{
id: 0,
name: '默认排序'
... ... @@ -18,6 +20,74 @@ Page({
name: '热度排序'
}]
},
//全部tab
wishAllInfo(e) {
this.setData({
currentIndex: true,
current: -1
})
this.wishIndex()
},
//心愿首页接口调取
wishIndex() {
let url = '/home/wish/index'
let params = {}
let header = {
"XX-Token": wx.getStorageSync('token')
}
app.post(url, params, header).then((res) => {
console.log(res)
const list = res.portal_post.map((item, index) => {
return {
...item,
showlabel_box: false,
more: JSON.parse(item.more)
}
});
this.setData({
portal_post: list,
portal_two: res.portal_two,
})
// console.log(this.data.portal_post)
})
},
//导航点击
chargeTab(e) {
var ids = wx.setStorageSync('id',e.currentTarget.dataset.id)
var id=wx.getStorageSync('id')
var index = e.currentTarget.dataset.index;
this.setData({
currentIndex: false
});
this.setData({
current: index
});
if (!this.data.currentIndex) {
this.classifyInfo(id)
}
},
//获取分类信息
classifyInfo(id) {
let url = '/home/wish/posts'
let params = {
id
}
let header = {
"XX-Token": wx.getStorageSync('token')
}
app.post(url, params, header).then((res) => {
this.setData({
portal_post: res
})
})
},
//点击蒙层关闭
closeMask() {
let that = this;
... ... @@ -26,6 +96,7 @@ Page({
is_showSort: false
})
},
//开启或关闭排序列表
setdown() {
let that = this;
... ... @@ -35,15 +106,25 @@ Page({
showrent_mask: false
})
},
//(热度排序)
chooseSort(e) {
const current = e.currentTarget.dataset.index;
const index = e.currentTarget.dataset.index;
this.setData({
currentSort: current,
currentSort: index,
is_showSort: false,
// down: !this.data.down,
});
this.wishIndex()
var current = this.data.current
var currentIndex = this.data.currentIndex
var id = wx.getStorageSync('id')
console.log(id)
if (currentIndex) {
this.wishIndex()
} else {
this.classifyInfo(id)
}
},
//进入搜索
... ... @@ -69,6 +150,7 @@ Page({
//个人信息弹框
showModal(e) {
var index = e.currentTarget.dataset.index
var portal_post = this.data.portal_post
portal_post[index].maskstate = !portal_post[index].maskstate
... ... @@ -76,6 +158,7 @@ Page({
portal_post: portal_post
})
},
//复制微信号
clickCopy(e) {
var wxn = e.currentTarget.dataset.wxn
... ... @@ -86,12 +169,14 @@ Page({
}
})
},
//进入主页
enterHomePage() {
wx.navigateTo({
url: '/pages/my/myindex/myindex'
})
},
//举报
report(e) {
var to_user_id = e.currentTarget.dataset.to_user_id
... ... @@ -111,28 +196,7 @@ Page({
});
})
},
//心愿首页接口调取
wishIndex() {
let url = '/home/wish/index'
let params = {}
let header = {
"XX-Token": wx.getStorageSync('token')
}
app.post(url, params, header).then((res) => {
console.log(res)
const list = res.portal_post.map((item, index) => {
return { ...item,
showlabel_box: false,
more: JSON.parse(item.more)
}
});
this.setData({
portal_post: list,
portal_two: res.portal_two,
})
console.log(this.data.portal_post)
})
},
//收藏,取消收藏
collectInfo(e) {
var id = e.currentTarget.dataset.id
... ... @@ -175,8 +239,8 @@ Page({
this.wishIndex()
})
}
},
//评论
review(e) {
var post_id = e.currentTarget.dataset.id
... ... @@ -205,42 +269,6 @@ Page({
})
},
//弹窗
show() {
this.setData({
showlabel_box: true
})
},
//导航点击
chargeTab(e) {
var id = e.currentTarget.dataset.id
var index = e.currentTarget.dataset.index;
var current = this.data.current;
if (current == index) {
return false
} else {
this.setData({
current: index
})
}
this.classifyInfo(id)
},
//获取分类信息
classifyInfo(id) {
let url = '/home/wish/posts'
let params = {
id
}
let header = {
"XX-Token": wx.getStorageSync('token')
}
app.post(url, params, header).then((res) => {
console.log(res)
})
},
//底部服务导航
service(e) {
console.log(e)
... ... @@ -258,7 +286,6 @@ Page({
}
},
//底部咨询导航点击事件
consult(e) {
var tindex = e.currentTarget.dataset.tindex
... ... @@ -293,23 +320,29 @@ Page({
//发布服务跳转
releaseService() {
wx.navigateTo({
url: '/pages/service/release/release',
})
wx.navigateTo({
url: '/pages/service/release/release',
})
},
//发布资讯跳转
releaseMessage() {
wx.showToast({title:'该功能正在开发中',icon: 'none'})
// wx.navigateTo({
// url: '/pages/service/release/release',
// })
wx.showToast({
title: '该功能正在开发中',
icon: 'none'
})
// wx.navigateTo({
// url: '/pages/service/release/release',
// })
},
//发布心愿跳转
releaseWish() {
wx.showToast({title:'该功能正在开发中',icon: 'none'})
// wx.navigateTo({
// url: '/pages/wish/release/release',
// })
wx.showToast({
title: '该功能正在开发中',
icon: 'none'
})
// wx.navigateTo({
// url: '/pages/wish/release/release',
// })
},
//底部导航心愿点击事件
... ...
... ... @@ -10,11 +10,14 @@
<input placeholder='请输入要搜索的服务' placeholder-class='font-size'></input>
</view> -->
</view>
<!-- 排序按钮 -->
<view class='iconfont icon-paixu-jiang' wx:if='{{currentSort === 0}}' bindtap='setdown'></view>
<view class='iconfont icon-paixu-sheng' wx:else bindtap='setdown'></view>
</view>
<!-- 顶部导航 -->
<scroll-view class='tab_box' scroll-x>
<view class="tab_item {{currentIndex?'active':''}}" data-aindex='{{index}}' bindtap='wishAllInfo'>全部</view>
<view class="tab_item {{current==index?'active':''}}" data-index='{{index}}' wx:for='{{portal_two}}' wx:key='' data-id='{{item.id}}' bindtap='chargeTab'>{{item.name}}</view>
</scroll-view>
<!-- 顶部导航 -->
... ... @@ -33,6 +36,7 @@
<view class="rent_item {{currentSort===index?'active':''}}" wx:for="{{sort}}" wx:key="index" catchtap='chooseSort' data-index="{{index}}">{{item.name}}</view>
</view>
</view>
<!-- 内容项 -->
<view class='content_box'>
<view class='content_item' wx:for='{{portal_post}}' wx:key=''>
... ... @@ -40,44 +44,42 @@
<view class='head_portrait' bindtap='showModal' data-index="{{index}}">
<image src='{{item.avatar}}'></image>
</view>
<view class='label_box' wx:if='{{item.maskstate11}}'>
<view class='triangle'></view>
<view class='wx_numb'>
<text>微信号:{{item.wxn}}</text>
</view>
<view class="copy">
<block wx:if="{{item.anonymity!=0}}">
<view class='label_box' wx:if='{{item.maskstate}}'>
<view class='triangle'></view>
<view class='wx_num'>
<text>微信号:{{item.wxn}}</text>
</view>
<view class='line'>|</view>
<view class='label-text' catchtap="clickCopy" data-wxn='{{item.wxn}}'>复制</view>
<view class='label' catchtap="clickCopy" data-wxn='{{item.wxn}}'>复制</view>
<view class='line'>|</view>
<view class='label-text' catchtap="enterHomePage">
<view class='label' catchtap="enterHomePage">
<text class='iconfont icon-jubao0201'></text>
<text>进入主页</text>
</view>
<view class='line'>|</view>
<view class='label-text' bindtap='report' data-to_user_id='{{item.user_id}}' data-post_id='{{item.id}}'>
<view class='label' bindtap='report' data-to_user_id='{{item.user_id}}' data-post_id='{{item.id}}'>
<text class='iconfont icon-jubao0201'></text>
<text>举报</text>
</view>
</view>
</view>
<view class='label_box2' wx:if='{{item.maskstate}}'>
<view class='triangle'></view>
<view class='wx_num'>
<text>微信号:{{item.wxn}}</text>
</view>
<view class='line'>|</view>
<view class='label' catchtap="clickCopy" data-wxn='{{item.wxn}}'>复制</view>
<view class='line'>|</view>
<view class='label' catchtap="enterHomePage">
<text class='iconfont icon-zhuye'></text>
<text>进入主页</text>
</view>
<view class='line'>|</view>
<view class='label' bindtap='report' data-to_user_id='{{item.user_id}}' data-post_id='{{item.id}}'>
<text class='iconfont icon-jubao0201'></text>
<text>举报</text>
</block>
<block wx:else>
<view class='label_box2' wx:if='{{item.maskstate}}'>
<view class='triangle'></view>
<view class='wx_num'>
<text>微信号:{{item.wxn}}</text>
</view>
<view class='line'>|</view>
<view class='label' catchtap="clickCopy" data-wxn='{{item.wxn}}'>复制</view>
<view class='line'>|</view>
<view class='label' bindtap='report' data-to_user_id='{{item.user_id}}' data-post_id='{{item.id}}'>
<text class='iconfont icon-jubao0201'></text>
<text>举报</text>
</view>
</view>
</view>
</block>
</view>
<view class='item_list'>
<view class='list_head_box'>
... ... @@ -158,7 +160,7 @@
<template is="tabBar" data='{{tabcurrent}}' />
<!--发布愿望弹框开始-->
<view class='mianmask_box' wx:if='{{releasepopup}}'>
<view class='mainpopup_box' >
<view class='mainpopup_box'>
<view class='mianpopup_symble'>
<view class='mianpopup_item' bindtap='releaseService'>
<view class='iconfont icon-zonghe popup_zonghe'></view>
... ...
... ... @@ -33,15 +33,6 @@
border-bottom: 0;
}
.wx_numb {
width: 39%;
}
.wx_numb text{
overflow:hidden;
text-overflow:ellipsis;
white-space:nowrap;
display: block;
}
page {
background: #fafafa;
... ... @@ -218,10 +209,11 @@ page {
}
.label_box2 {
width: 630rpx;
width: 450rpx;
}
.wx_num {
width: 35%;
margin-right: 18rpx;
}
... ... @@ -252,6 +244,25 @@ page {
left: 22rpx;
}
.label_box {
justify-content: space-between;
}
.label-text {
padding: 10rpx 8rpx;
/*line-height: 60rpx;*/
background: RGBA(116, 118, 125, 0.3);
border-radius: 10rpx;
}
.wx_numb {
width: 39%;
}
.wx_numb text{
overflow:hidden;
text-overflow:ellipsis;
white-space:nowrap;
display: block;
}
.item_list {
width: 85%;
}
... ...