作者 朱振飞

修改

... ... @@ -21,6 +21,6 @@ padding: 52rpx 0 40rpx;
color: #666;
font-weight: normal;
}
.form{
.from{
margin-right: 30rpx;
}
\ No newline at end of file
... ...
... ... @@ -18,7 +18,8 @@ Page({
currentTab: 0,
page: 1,
list:[],
ifData:!1
ifData:!1,
noMore:!1
},
/**
... ... @@ -72,11 +73,13 @@ Page({
list: e.data.list.concat(res.data),
page: res.current_page,
lastPage: res.last_page,
ifData: !0
ifData: !0,
noMore: res.last_page==res.per_page?!0:!1
})
!e.data.list.concat(res.data).length?e.setData({
ifData:!1
}):''
wx.stopPullDownRefresh();
})
},
bannerDetail(e){
... ... @@ -116,14 +119,24 @@ Page({
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
let t = this;
t.setData({
page:1,
list:[]
})
t.getList(t.data.category_id,1)
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
let t = this;
!t.data.noMore ? (t.setData({
page:t.dat.page+1
}),t.getList(t.data.category_id,t.data.page)) : wx.showToast({
title: '没有更多了',
})
},
/**
... ...
{
"usingComponents": {}
"usingComponents": {},
"enablePullDownRefresh": true
}
\ No newline at end of file
... ...
... ... @@ -20,7 +20,7 @@
</view>
<!-- 新闻 -->
<scroll-view bindscroll="scroll" bindscrolltolower="getMore" class="news_detail_container" hidden='{{!ifData}}' scrollTop="{{scrollTop}}" scrollY="true" style="height:{{windowHeight-200}}px;">
<view class="news_detail_container" hidden='{{!ifData}}' style="height:{{windowHeight-205}}px;">
<view class='news_detail_items'>
<block wx:for='{{list}}' wx:key=''>
<navigator class='news_detail_item' url='/pages/attract/articleDetail/articleDetail?id={{item.id}}' id="{{item.id}}" >
... ... @@ -37,7 +37,7 @@
</navigator>
</block>
</view>
</scroll-view>
</view>
<view class="none-box" hidden="{{ifData}}">
<view>暂无相关信息</view>
... ...
... ... @@ -67,7 +67,7 @@ page{
}
.news_detail_container{
background: #FFF;
margin-top: 195px;
margin-top: 390rpx;
position: relative;
}
.news_detail_items{
... ...
... ... @@ -5,7 +5,10 @@ Page({
* 页面的初始数据
*/
data: {
startComment: false
startComment: false,
comments:[],
noMore:!1,
page:1
},
/**
* 生命周期函数--监听页面加载
... ... @@ -17,6 +20,17 @@ Page({
}),t.d(options.id),t.c()
},
comment(){
console.log(1)
this.setData({
startComment: true
})
},
outFocus(){
this.setData({
startComment: false
})
},
d(id){
let url = '/api/interact/getPostsDetail',params = {
id:id
... ... @@ -30,11 +44,14 @@ Page({
},
c(){
let url = '/api/interact/getPostsCommentList',t = this ,params={
id:t.data.id
id:t.data.id,
page: t.data.page
};
A.post(url,params).then((r)=>{
t.setData({
comments:r.data
comments: t.data.comments.concat(r.data),
total:r.total,
noMore: r.last_page == r.current_page?!0:!1
})
})
},
... ... @@ -44,11 +61,15 @@ Page({
content: t.data.content
}, url ='/api/interact/setPostsComment';
t.data.parent_id?params.parent_id = t.data.parent_id:'';
params.content?A.post(url,params).then((r)=>{
t.c(),t.setData({
params.content?A.post(url,params,false).then((r)=>{
t.setData({
content:'',
parent_id:''
parent_id:'',
comments:[],
page:1,
startComment: false
})
t.c();
}):wx.showToast({
title: '请输入评论',
icon:'none'
... ... @@ -60,9 +81,8 @@ Page({
type: '2'
}, index = e.currentTarget.dataset.indx, t = this, type = e.currentTarget.dataset.type;
A.post(url, params).then((r) => {
console.log(r)
t.data.comments[index].is_like = type == 1 ? 0 : 1
t.data.comments[index].likes = r
t.data.comments[index].is_like = r.is_like
t.data.comments[index].likes = r.likes
t.setData({
comments: t.data.comments
})
... ... @@ -135,14 +155,23 @@ Page({
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
let t = this;
t.setData({
page:1,
comments:[]
}),
t.d(t.data.id),
t.c();
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
let t = this;
!t.data.noMore?(t.setData({
page: t.data.page+1,
}),t.c()):''
},
/**
... ...
... ... @@ -2,5 +2,6 @@
"usingComponents": {},
"navigationBarTitleText": "详情页",
"navigationBarBackgroundColor": "#169BD5",
"navigationBarTextStyle": "white"
"navigationBarTextStyle": "white",
"enablePullDownRefresh": true
}
\ No newline at end of file
... ...
... ... @@ -5,7 +5,6 @@
<view class='item_mid'>
<view class='item_mid_text'>
{{detail.content}}
<span class='color_blue'>全部</span>
</view>
<!-- 图片盒子 -->
<view class='item_mid_box' wx:if="{{detail.images}}">
... ... @@ -37,7 +36,7 @@
<view class='item_right'>
<!-- 图片 -->
<view class='item_right_pic'>
<image src='../../images/chakan@3x.png'></image>
<image src='../../images/chakan@3x.png' mode='widthFix'></image>
</view>
<!-- 数量 -->
<view class='item_right_number'>
... ... @@ -49,7 +48,7 @@
</view>
<!-- 数量 -->
<view class='item_right_number'>
{{detail.comment_count}}
{{total}}
</view>
</view>
... ... @@ -59,7 +58,7 @@
<view class='item_box'>
<!-- 回复内容1 -->
<view class='item item_bottom' wx:for='{{comments}}' wx:key=''>
<view class='item item_bottom bottom_space' wx:for='{{comments}}' wx:key=''>
<view class='item_list'>
<view class='item_list_left'>
<view class='item_list_left_pic'>
... ... @@ -82,11 +81,12 @@
{{item.create_time_text}}
</view>
<view class='time_bottom_left' bindtap='zan' id='{{item.id}}' data-indx = '{{index}}' data-type='{{item.is_like}}'>
<view>{{item.likes}}</view>
<view class='time_bottom_left_pic'>
<image src='/images/zan@3x.png' wx:if="{{item.is_like==0}}"></image>
<image src='/images/thumb-up-button@3x.png' wx:else></image>
<image src='/images/zan@3x.png' wx:if="{{item.is_like==0}}" mode='widthFix'></image>
<image src='/images/thumb-up-button@3x.png' wx:else mode='widthFix'></image>
</view>
<view>{{item.likes}}</view>
</view>
</view>
<!-- 底部评论 -->
... ... @@ -107,7 +107,8 @@
<!-- 底部发表按钮 -->
<view class='bottom_box'>
<view class='bottom_box_input'>
<input placeholder='发表评论...' value='{{content}}' focus='{{startComment}}' bindtap='parentSet' bindinput='subComments' id=''></input>
<input placeholder='发表评论...' value='{{content}}' focus='{{startComment}}' bindinput='subComments' bindblur='outFocus' cursor-spacing='10' class='comments'/>
<!-- <view class='sub_box comments' bindtap='comment' hidden='{{startComment}}'>{{content||"发表评论..."}}</view> -->
</view>
<view class='bottom_box_text' bindtap='s'>
发表
... ...
... ... @@ -23,6 +23,7 @@ page{
}
.item_mid_text{
margin-top: 22rpx;
margin-bottom: 22rpx;
font-size:26rpx;
font-family:PingFang SC;
font-weight:400;
... ... @@ -53,16 +54,20 @@ page{
.item_bottom{
display: flex;
justify-content: space-between;
padding: 34rpx 32rpx;
padding: 34rpx 0;
align-items: center;
}
.bottom_space{
padding: 34rpx;
align-items: stretch
}
.item_left{
display: flex;
}
.item_left_pic{
width:32rpx;
height:32rpx;
width:46rpx;
height:46rpx;
background:rgba(0,0,0,0);
border-radius:50%;
opacity:1;
... ... @@ -73,11 +78,13 @@ page{
height: 100%;
}
.item_name{
font-size:22rpx;
font-family:PingFang SC;
font-size: 28rpx;
font-weight:400;
line-height:32rpx;
max-width: 200rpx;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
color:rgba(204,204,204,1);
margin-left: 16rpx;
opacity:1;
... ... @@ -85,24 +92,23 @@ page{
.item_right{
display: flex;
align-items: center;
white-space: nowrap;
}
.item_right_pic{
width:36rpx;
height:23rpx;
font-size: 28rpx;
/* background:rgba(204,204,204,1); */
opacity:1;
display: flex;
}
.item_right_pic image{
width: 100%;
height: 100%;
}
.item_right_number{
margin-left: 12rpx;
width:24rpx;
height:28rpx;
font-size:20rpx;
font-size:28rpx;
font-family:PingFang SC;
font-weight:400;
line-height:28rpx;
... ... @@ -140,21 +146,23 @@ page{
}
.item_time{
margin-left: 16rpx;
font-size:22rpx;
font-size:28rpx;
font-family:PingFang SC;
font-weight:400;
line-height:32rpx;
color:rgba(204,204,204,1);
opacity:1;
display: flex;
align-items: center;
}
.item_delete{
margin-left: 28rpx;
font-size:22rpx;
font-size:28rpx;
font-family:PingFang SC;
font-weight:400;
line-height:32rpx;
color:rgba(22,155,213,1);
opacity:1;
display: flex;
align-items: center;
}
.item_list{
... ... @@ -207,23 +215,21 @@ page{
margin-top: 6rpx;
}
.time_bottom_left{
font-size:20rpx;
font-size:28rpx;
font-family:PingFang SC;
font-weight:400;
line-height:28rpx;
color:rgba(153,153,153,1);
opacity:1;
display: flex;
align-items: center;
height: 30rpx;
}
.time_bottom_left_pic{
margin-left: 8rpx;
width:22rpx;
height:20rpx;
margin-right: 8rpx;
width:36rpx;
/* background:rgba(153,153,153,1); */
opacity:1;
display: flex;
}
.time_bottom_left_pic image{
width: 100%;
... ... @@ -251,18 +257,25 @@ page{
}
.bottom_box{
width: 750rpx;
height: 120rpx;
/* min-height: 120rpx; */
display: flex;
align-items: center;
justify-content: center;
background: #fff;
position: fixed;
bottom: 0;
border-top: 2rpx solid #ccc;
border-top: 2rpx solid #F5F5F5;
padding: 20rpx 0;
z-index: 10;
}
.comments{
border:1rpx solid #F5F5F5;
font-size: 28rpx;
padding: 15rpx;
max-height: 130rpx;
}
.bottom_box_input{
width: 608rpx;
display: flex;
background:rgba(247,247,247,1);
border:2px solid rgba(238,238,238,1);
... ... @@ -289,4 +302,8 @@ page{
}
.item_box{
margin-top: 16rpx;
padding-bottom: 120rpx;
}
.sub_box{
color: #666;
}
\ No newline at end of file
... ...
let A = getApp();
let A = getApp();
Page({
/**
... ... @@ -43,8 +43,8 @@ Page({
type:'1'
}, index = e.currentTarget.dataset.idx,t=this,type=e.currentTarget.dataset.type;
A.post(url,params).then((r)=>{
t.data.postList[index].is_like = type==1?0:1
t.data.postList[index].likes = r
t.data.postList[index].is_like = r.is_like
t.data.postList[index].likes = r.likes
t.setData({
postList: t.data.postList
})
... ... @@ -82,6 +82,9 @@ Page({
})
},
getzixun() {
wx.showLoading({
title: '加载中',
})
let url = '/api/interact/getQuestionList', d = this, params = {
page: d.data.page
};
... ... @@ -104,9 +107,14 @@ Page({
show: !1
}, 1200)
})
wx.hideLoading()
wx.stopPullDownRefresh()
})
},
postList() {
wx.showLoading({
title: '加载中',
})
let url = '/api/interact/getPostsList', d = this, params = {
page: d.data.page
};
... ... @@ -124,21 +132,10 @@ Page({
}) : (r.data.length < r.per_page ? d.setData({
noMore: !0
}) : "")
wx.hideLoading()
wx.stopPullDownRefresh()
})
},
getMore(){
console.log(1)
let t = this;
t.setData({
page: t.data.page++
})
!t.data.noMore ? (t.data.currentTab == '0' ? t.getzixun():t.postList()):wx.showToast({
title: '没有更多了',
icon:'none'
})
},
askQuestion() {
wx.navigateTo({
... ... @@ -167,12 +164,19 @@ Page({
})
},
navbarTap: function (e) {
wx.pageScrollTo({
scrollTop: 0,
duration: 0,
})
let t = this, idx = e.currentTarget.dataset.idx;
this.setData({
show:!0,
currentTab: idx,
zixunList:[],
postList:[]
postList:[],
page:1
}), idx ? t.postList() : t.getzixun();
},
jump() {
wx.navigateTo({
... ... @@ -199,7 +203,8 @@ Page({
this.setData({
zixunList: [],
postList:[],
page: 1
page: 1,
show:!0
})
this.data.currentTab=='0'?this.getzixun():this.postList()
},
... ... @@ -235,6 +240,14 @@ Page({
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
let t = this;
t.setData({
page: t.data.page++
})
!t.data.noMore ? (t.data.currentTab == '0' ? t.getzixun() : t.postList()) : wx.showToast({
title: '没有更多了',
icon: 'none'
})
},
/**
... ...
... ... @@ -3,7 +3,7 @@
</view>
<scroll-view wx:if='{{auth=="2"}}' class='main_container' style='height:{{winHeight}}px' scroll-y="true" bindscrolltolower='getMore'>
<view wx:if='{{auth=="2"}}' class='main_container' style='height:{{winHeight}}px' >
<view class="none-box" hidden="{{!ifData}}">
<view>暂无相关咨询</view>
</view>
... ... @@ -16,10 +16,10 @@
<view class='mid_item_right'>
<view class='mid_item_right_top'>
{{item.question}}?
<view class='mid_label' hidden='{{item.is_show_state}}'>
<image src='../../images/huifujishi@3x.png' wx:if="{{item.state==1}}"></image>
<image src='../../images/huifuyiban@3x.png' wx:elif='{{item.state==2}}'></image>
<image src='../../images/huifuzhihuan @3x.png' wx:elif='{{item.state==3}}'></image>
<view class='mid_label' hidden='{{!item.is_show_state}}'>
<image src='../../images/huifujishi@3x.png' wx:if="{{item.state=='1'}}"></image>
<image src='../../images/huifuyiban@3x.png' wx:elif='{{item.state=="2"}}'></image>
<image src='../../images/huifuzhihuan @3x.png' wx:elif='{{item.state=="3"}}'></image>
</view>
</view>
<view class='mid_item_right_bottom'>
... ... @@ -82,7 +82,7 @@
{{item.content}}
</view>
<!-- 图片 -->
<view class='mid_pic_box' wx:if='{{item.images}}' bindtap='navdetail' id='{{item.id}}'>
<view class='mid_pic_box' wx:if='{{item.images!=""}}' bindtap='navdetail' id='{{item.id}}'>
<view class='mid_pic_box_item' wx:for="{{item.images}}" wx:key='' wx:for-item='sec'>
<image src='{{sec}}'></image>
</view>
... ... @@ -95,8 +95,8 @@
<view class='mid_item_like_right'>
<!-- 点赞 -->
<view class='mid_like color_blue' bindtap='zan' id='{{item.id}}' data-idx='{{index}}' data-type='{{item.is_like}}'>
<image src='../../images/thumb-up-button@3x.png' wx:if='{{item.is_like==1}}'></image>
<image src='../../images/dainzan@3x.png' wx:else></image>
<image src='../../images/thumb-up-button@3x.png' class='zan' wx:if='{{item.is_like==1}}'></image>
<image src='../../images/dainzan@3x.png' class='zan' wx:else></image>
</view>
<view class='mid_number color_blue'>
{{item.likes}}
... ... @@ -105,7 +105,7 @@
<view class='mid_like' bindtap='navdetail' id='{{item.id}}'>
<image src='../../images/pinglun@3x.png'></image>
</view>
<view class='mid_number'>
<view class='mid_number commentCount'>
{{item.comment_count}}
</view>
</view>
... ... @@ -113,7 +113,7 @@
</view>
</view>
</view>
</scroll-view>
</view>
<!-- 没有权限 -->
... ...
... ... @@ -46,6 +46,7 @@ page{
z-index: 999;
top: 0;
left: 0;
border-bottom: 1px solid #f5f5f5;
}
.top_left{
width: 169rpx;
... ... @@ -63,7 +64,7 @@ page{
}
.mid_item{
padding: 50rpx 0;
padding: 50rpx 0 30rpx;
width: 686rpx;
margin: 0 auto;
display: flex;
... ... @@ -80,6 +81,10 @@ page{
opacity:1;
display: flex;
}
.zan{
position: relative;
top: -4rpx;
}
.mid_item_left image{
width: 100%;
height: 100%;
... ... @@ -225,24 +230,25 @@ page{
opacity:1;
}
.mid_item_text{
font-size:26rpx;
font-family:PingFang SC;
font-weight:400;
/* line-height:36rpx; */
color:rgba(51,51,51,1);
opacity:1;
margin-top: 32rpx;
margin-top: 30rpx;
margin-bottom: 30rpx;
}
.mid_item_like{
margin-top: 34rpx;
width: 686rpx;
display: flex;
justify-content: space-between;
align-items: center;
}
.mid_item_like_left{
font-size:22rpx;
font-size:28rpx;
font-family:PingFang SC;
font-weight:400;
line-height:32rpx;
... ... @@ -258,7 +264,7 @@ page{
height:36rpx;
opacity:1;
display: flex;
margin-left: 50rpx;
margin-left: 20rpx;
}
.mid_like image{
width: 100%;
... ... @@ -266,16 +272,20 @@ page{
}
.mid_number{
margin-left: 10rpx;
font-size:22rpx;
font-family:PingFang SC;
font-weight:400;
line-height:48rpx;
color: #b5b5b5;
opacity:1;
position: relative;
font-size: 30rpx;
width: 60rpx;
}
.commentCount{
font-weight: normal;
}
.color_blue{
color: #169BD5;
font-size: 28rpx;
}
.color_size{
color: #b5b5b5;
... ... @@ -386,7 +396,8 @@ page{
z-index: 10000;
}
.add_notice image{
width: 100%
width: 100%;
background-color: #FFF;
}
.main_container{
margin-top: 50px;
... ...
... ... @@ -36,11 +36,11 @@ Page({
header: true
}; app.post(url,params,false).then((r)=>{
wx.showToast({
title: r == 2 ? "关注成功" : "已取消",
title: r.is_like == 1 ? "关注成功" : "已取消",
icon:'none'
})
this.setData({
'detailInfo.is_like': r==2?1:0
'detailInfo.is_like': r.is_like
})
})
},
... ...
... ... @@ -54,19 +54,18 @@ Page({
},
// 获取矩阵列表
getCompanyList(category_id,park){
let url = '/api/Company/index', b = this;
let url = '/api/Company/index', b = this, companyList = b.data.page > 1 ? b.data.companyList : [];
let params = {
category_id: category_id||'',
park:park||'',
page: b.data.page
}
let companylist = b.data.page == 1 ? []:b.data.companylist;
app.post(url,params).then((res)=>{
b.setData({
companyList: companylist.concat(res.data),
companyList: companyList.concat(res.data),
totalPage: res.total,
currpage: res.current_page,
ifData: companylist.concat(res.data).length>0?!0:!1,
ifData: companyList.concat(res.data).length>0?!0:!1,
noMore: res.last_page>res.current_page?!1:!0
})
wx.stopPullDownRefresh();
... ... @@ -104,11 +103,6 @@ Page({
})
s.getCompanyList(e.currentTarget.dataset.current, s.data.park)
},
scroll(){
},
reload(){
},
/**
* 生命周期函数--监听页面加载
... ... @@ -167,7 +161,7 @@ Page({
* 页面上拉触底事件的处理函数
*/
onReachBottom: function() {
this.getMore();
},
/**
... ...
... ... @@ -15,7 +15,7 @@
</scroll-view>
<view class='iconfont icon-gengduo1' bindtap='changeShow'></view>
</view>
<scroll-view bindscroll="scroll" bindscrolltolower="getMore" class="scroll-content" hidden="{{!ifData}}" scrollTop="{{scrollTop}}" scrollY="true" style="height:{{scrollHeight}}px;">
<view class="scroll-content" hidden="{{!ifData}}"style="height:{{scrollHeight}}px;">
<view class='content_box' wx:if='{{showType}}'>
<navigator class='item_list' wx:for='{{companyList}}' wx:key='' url="/pages/matrix/company/company?id={{item.id}}"
open-type="navigate"
... ... @@ -48,7 +48,7 @@
</view>
</navigator>
</view>
</scroll-view>
</view>
<view class="none-box" hidden="{{ifData}}">
<view>暂无相关企业</view>
... ...
... ... @@ -11,6 +11,7 @@ page {
top: 0;
left: 0;
display: flex;
z-index: 10;
}
.tab_box {
... ...
... ... @@ -8,7 +8,8 @@ Page({
data: {
followList: [],
page: 1,
ifData:!1
ifData:!1,
noMore:!0
},
/**
* 生命周期函数--监听页面加载
... ... @@ -24,24 +25,41 @@ Page({
page: b.data.page
};
a.post(url, params).then((res) => {
console.log(res);
b.setData({
followList: res.data,
ifData: res.data.length>0?true:false,
noMore: res.last_page==res.current_page?!0:!1
})
wx.stopPullDownRefresh()
})
},
getMore(){
this.setData({
page: this.data.page++
})
!this.data.noMore?this.getFollowList():wx.showToast({
title: '没有更多了',
icon:'none'
},
cancleFocus(e){
let t = this, url ='/api/company/setFollow',indx = e.currentTarget.dataset.indx,
params = {
id: e.currentTarget.id
};
wx.showModal({
title: '提示',
content: '是否取消关注该企业?',
success:(r)=>{
if(r.confirm){
a.post(url, params).then(r => {
wx.showToast({
title: '已取消关注',
icon: 'none'
})
t.data.followList.splice(indx, 1);
setTimeout(() => {
t.setData({
followList: t.data.followList
})
}, 1200)
})
}
}
})
},
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
... ... @@ -74,18 +92,24 @@ Page({
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
this.setData({
page: 1,
followList:[]
}),
this.getFollowList()
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
let that = this;
that.setData({
page: that.data.page + 1,
});
that.getFollowList();
this.setData({
page: this.data.page+1
})
!this.data.noMore ? this.getFollowList() : wx.showToast({
title: '没有更多了',
icon: 'none'
})
},
/**
... ...
... ... @@ -2,5 +2,6 @@
"usingComponents": {},
"navigationBarBackgroundColor": "#f7f7f7",
"navigationBarTitleText": "我的关注",
"navigationBarTextStyle": "black"
"navigationBarTextStyle": "black",
"enablePullDownRefresh": true
}
\ No newline at end of file
... ...
<!--pages/my/myAttention/myAttention.wxml-->
<scroll-view class='box' scroll-y='true' hidden='{{!ifData}}' bindscrolltolower='getMore'>
<scroll-view class='box' >
<view class='item_list' wx:for='{{followList}}' wx:key="index">
<image src='{{item.logo_image}}'></image>
<view class='list_right'>
... ... @@ -11,7 +11,7 @@
<text>21:00</text> -->
</view>
</view>
<view class='list_btn'>已关注</view>
<view class='list_btn'bindtap='cancleFocus' id='{{item.id}}' data-indx="{{index}}">取消关注</view>
</view>
</view>
</scroll-view>
... ...
const a = getApp();
Page({
/**
* 页面的初始数据
*/
data: {
commentsList: [],
page: 1,
ifData:!1
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function(options) {
this.getCommentsList();
},
// 获取评论列表
getCommentsList() {
let b = this,
url = '/api/User/getMyCommentList',
params = {
header: true,
page: b.data.page
};
a.post(url, params).then((res) => {
for(let b of res.data){
b.images = b.images.split(',')
}
b.setData({
commentsList: b.data.commentsList.concat(res.data)
})
b.data.commentsList.length > 0 ? b.setData({
ifData: !0
}) : b.setData({
ifData: !1
}), res.data.length < res.per_page ? b.setData({
noMore: !0,
}) : ''
})
},
delCom(e){
let t = this, id = e.currentTarget.id, url ='/api/interact/deleteComment',params={
id: id
/**
* 页面的初始数据
*/
data: {
commentsList: [],
page: 1,
ifData: !1
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function(options) {
this.getCommentsList();
},
// 获取评论列表
getCommentsList() {
let b = this,
url = '/api/User/getMyCommentList',
params = {
header: true,
page: b.data.page
};
a.post(url,params).then(r=>{
wx.showToast({
title: '删除成功',
icon: 'none'
});
t.data.commentsList.splice(index, 1)
let index = e.currentTarget.dataset.indx;
t.setData({
commentsList: t.data.commentsList
})
a.post(url, params).then((res) => {
for (let b of res.data) {
b.images = b.images.split(',')
}
b.setData({
commentsList: b.data.commentsList.concat(res.data)
})
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function() {
let that = this;
if(that.data.noMore){
wx.showToast({
title: '没有更多了',
icon:'none'
})
}else{
that.setData({
page: that.data.page + 1,
});
that.getCommentsList();
b.data.commentsList.length > 0 ? b.setData({
ifData: !0
}) : b.setData({
ifData: !1
}), res.data.length < res.per_page ? b.setData({
noMore: !0,
}) : ''
wx.stopPullDownRefresh()
})
},
navdetail(e) {
wx.navigateTo({
url: '/pages/colleagues_2/colleagues_2?id=' + e.currentTarget.id,
})
},
delCom(e) {
let t = this,
id = e.currentTarget.id,
url = '/api/interact/deleteComment',
indx = e.currentTarget.dataset.indx,
params = {
id: id
};
wx.showModal({
title: '提示',
content: '是否删除该评论?',
success:(res)=>{
if(res.confirm){
a.post(url, params).then(r => {
wx.showToast({
title: '删除成功',
icon: 'none'
});
t.data.commentsList.splice(indx, 1)
t.setData({
commentsList: t.data.commentsList
})
})
}
}
})
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function() {
this.setData({
page:1,
commentsList:[]
}),
this.getCommentsList()
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function() {
let that = this;
if (that.data.noMore) {
wx.showToast({
title: '没有更多了',
icon: 'none'
})
} else {
that.setData({
page: that.data.page + 1,
});
that.getCommentsList();
}
},
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function() {
/**
* 用户点击右上角分享
*/
onShareAppMessage: function() {
}
}
})
\ No newline at end of file
... ...
... ... @@ -2,5 +2,6 @@
"usingComponents": {},
"navigationBarTitleText": "我的评论",
"navigationBarBackgroundColor": "#fff",
"navigationBarTextStyle": "black"
"navigationBarTextStyle": "black",
"enablePullDownRefresh": true
}
\ No newline at end of file
... ...
<!-- 企话吧 -->
<scroll-view scroll-y='true'>
<view>
<view class='mid'>
<!-- 条目 -->
<view class='mid_item' wx:for="{{commentsList}}" wx:key="index">
... ... @@ -20,10 +20,10 @@
</view>
<!-- 文字内容 -->
<view class='mid_item_text'>
新个人所得税法近日备受关注。关于个人所得税,想必大家都十分关心,让我们通过以下问题!
{{item.comment_content}}
</view>
<!-- 文本内容 -->
<view class='mid_item_content'>
<view class='mid_item_content' bindtap='navdetail' id='{{item.object_id}}'>
<!-- 条目 -->
<view class='mid_item content'>
<view class='mid_item_top'>
... ... @@ -35,9 +35,9 @@
<!-- 文字 -->
<view class='mid_item_top_left_text'>
{{item.nickname}}
<view class='icon_tm'>
<!-- <view class='icon_tm'>
<image src='../../images/guangfang@2x.png'></image>
</view>
</view> -->
</view>
</view>
<view class='mid_item_top_right'>
... ... @@ -58,13 +58,31 @@
</view>
<!-- 底部 -->
<view class='mid_item_like'>
<view class='mid_item_like_left' bindtap='delCom' id='{{item.id}}' data-indx = '{{index}}'>
<view class='mid_item_like_left' bindtap='delCom' id='{{item.id}}' data-indx='{{index}}'>
删除
</view>
<view class='mid_item_like_right'>
<!-- 点赞 -->
<view class='mid_like color_blue' bindtap='zan' id='{{item.id}}' data-idx='{{index}}' data-type='{{item.is_like}}'>
<image src='../../images/thumb-up-button@3x.png' class='zan' wx:if='{{item.is_like==1}}'></image>
<image src='../../images/dainzan@3x.png' class='zan' wx:else></image>
</view>
<view class='mid_number color_blue'>
{{item.likes}}
</view>
<!-- 评论 -->
<view class='mid_like' bindtap='navdetail' id='{{item.id}}'>
<image src='../../images/pinglun@3x.png'></image>
</view>
<view class='mid_number commentCount'>
{{item.comment_count}}
</view>
</view>
</view>
</view>
</view>
</scroll-view>
</view>
<view class="none-box" hidden="{{ifData}}">
<view>暂无相关评论</view>
</view>
\ No newline at end of file
... ...
... ... @@ -213,10 +213,10 @@ page{
width: 686rpx;
display: flex;
justify-content: space-between;
align-items: center;
}
.mid_item_like_left{
font-size:22rpx;
font-size:28rpx;
font-family:PingFang SC;
font-weight:400;
line-height:32rpx;
... ... @@ -238,14 +238,18 @@ page{
width: 100%;
height: 100%;
}
.zan{
position: relative;
top: -4rpx;
}
.mid_number{
margin-left: 10rpx;
font-size:22rpx;
font-family:PingFang SC;
font-weight:400;
line-height:48rpx;
color: #b5b5b5;
opacity:1;
font-size: 28rpx;
}
.color_blue{
... ... @@ -307,6 +311,7 @@ page{
.mid_pic_item{
width:218rpx;
height:218rpx;
overflow: hidden;
background:rgba(0,0,0,0);
opacity:1;
display: flex;
... ...
... ... @@ -7,7 +7,8 @@ Page({
data: {
noticeList: [],
page: 1,
ifData:!1
ifData:!1,
noMore:!0
},
/**
... ... @@ -20,11 +21,11 @@ Page({
// 获取点赞列表
getInformList() {
let b = this,
url = '/api/User/getNoticeList',
params = {
header: true,
page: b.data.page
};
url = '/api/User/getNoticeList',
params = {
header: true,
page: b.data.page
};
a.post(url, params).then((res) => {
b.setData({
noticeList: b.data.noticeList.concat(res.data)
... ... @@ -36,17 +37,19 @@ Page({
}), res.data.length < res.per_page ? b.setData({
noMore: !0,
}) : ''
wx.stopPullDownRefresh();
setTimeout(()=>{
let noticeList = b.data.noticeList;
for(let obj of noticeList){
obj.read_switch = 1
}
b.setData({
noticeList: noticeList
})
},2000)
})
},
getMore() {
this.setData({
page: this.data.page++
})
!this.data.noMore ? this.getInformList() : wx.showToast({
title: '没有更多了',
icon: 'none'
})
},
/**
* 生命周期函数--监听页面初次渲染完成
... ... @@ -80,18 +83,24 @@ Page({
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function() {
this.setData({
page: 1,
noticeList:[]
})
this.getInformList();
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function() {
let that = this;
that.setData({
page: that.data.page + 1,
});
that.getInformList();
this.setData({
page: this.data.page + 1
})
!this.data.noMore ? this.getInformList() : wx.showToast({
title: '没有更多了',
icon: 'none'
})
},
/**
... ...
... ... @@ -2,5 +2,6 @@
"usingComponents": {},
"navigationBarTitleText": "发文通知",
"navigationBarBackgroundColor": "#fff",
"navigationBarTextStyle": "black"
"navigationBarTextStyle": "black",
"enablePullDownRefresh": true
}
\ No newline at end of file
... ...
<scroll-view scroll-y='true' style='height:{{winHeight}}px' hidden='{{!ifData}}' bindscrolltolower='getMore'>
<view class='mid'>
<view class='mid_item' wx:for="{{noticeList}}" wx:key="index">
<view class='mid_item_top'>
<view class='mid_item_top_left'>
<!-- 图片 -->
<view class='mid_item_top_left_pic'>
<image src='../../images/03_nav@2x.png'></image>
</view>
<!-- 文字 -->
<view class='mid_item_top_left_text color_blue'>
牧羊人
<view class='mid_icon' wx:if="{{item.read_switch == 0}}">
未读
<!-- <image src='../../images/weidu@2x.png'></image> -->
</view>
<view class='mid_icon color_read' wx:if="{{item.read_switch == 1}}">
已读
<!-- <image src='../../images/weidu@2x.png'></image> -->
</view>
</view>
</view>
<view class='mid_item_top_right '>
15分钟前
</view>
</view>
<!-- 大标题 -->
<view class='mid_item_title'>
{{item.title}}
</view>
<!-- 文字内容 -->
<view class='mid_item_text'>
{{item.content}}
<view scroll-y='true' style='height:{{winHeight}}px' hidden='{{!ifData}}' bindscrolltolower='getMore'>
<view class='mid'>
<view class='mid_item' wx:for="{{noticeList}}" wx:key="index">
<view class='mid_item_top'>
<view class='mid_item_top_left'>
<!-- 图片 -->
<!-- <view class='mid_item_top_left_pic'>
<image src='../../images/03_nav@2x.png'></image>
</view> -->
<!-- 文字 -->
<view class='mid_item_top_left_text color_blue'>
系统消息
<view class='mid_icon' wx:if="{{item.read_switch == 0}}">
未读
<!-- <image src='../../images/weidu@2x.png'></image> -->
</view>
<view class='mid_icon color_read' wx:if="{{item.read_switch == 1}}">
已读
<!-- <image src='../../images/weidu@2x.png'></image> -->
</view>
</view>
</view>
<view class='mid_item_top_right '>
15分钟前
</view>
</view>
<!-- 大标题 -->
<view class='mid_item_title'>
{{item.title}}
</view>
<!-- 文字内容 -->
<view class='mid_item_text'>
{{item.content}}
</view>
</view>
</view>
</scroll-view>
<view class="none-box" hidden="{{ifData}}">
<view>暂无相关发文</view>
</view>
\ No newline at end of file
<view class="none-box" hidden="{{ifData}}">
<view>暂无相关发文</view>
</view>
\ No newline at end of file
... ...
... ... @@ -186,7 +186,7 @@ page{
line-height:42rpx;
color:rgba(51,51,51,1);
opacity:1;
margin-left: 16rpx;
/* margin-left: 16rpx; */
position: relative;
}
.mid_item_top_right{
... ...
... ... @@ -2,94 +2,137 @@
const a = getApp();
Page({
/**
* 页面的初始数据
*/
data: {
likeList: [],
page: 1,
ifData: !1,
noMore:!1
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function(options) {
this.getLikeList();
},
// 获取点赞列表
getLikeList() {
let b = this, url = '/api/User/getMyLikeList', params = {
header: true,
page: b.data.page
};
a.post(url, params).then((res) => {
for(let b of res.data){
b.images = b.images.split(',')
}
b.setData({
likeList: b.data.likeList.concat(res.data),
ifData: res.data.length>0?true:false,
noMore: res.data.length < res.per_page?!0:!1
})
})
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function() {
},
/**
* 页面的初始数据
*/
data: {
likeList: [],
page: 1,
ifData: !1,
noMore: !1
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
this.getLikeList();
},
navdetail(e) {
wx.navigateTo({
url: '/pages/colleagues_2/colleagues_2?id=' + e.currentTarget.id,
})
},
zan(e) {
console.log(e)
let t = this, id = e.currentTarget.id, url = '/api/interact/deletePosts', params = {
id: id
}, index = e.currentTarget.dataset.indx;
a.post(url, params).then((rt) => {
wx.showToast({
title: '删除成功',
icon: 'none',
duration: 1300
})
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function() {
},
})
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function() {
let that = this;
!this.data.noMore ? (that.setData({
page: that.data.page + 1,
}), that.getLikeList()):wx.showToast({
title: '没有更多了',
icon: 'none'
zan(e) {
let url = '/api/interact/setLike', params = {
object_id: e.currentTarget.id,
type: '1'
}, index = e.currentTarget.dataset.indx, t = this, type = e.currentTarget.dataset.type;
a.post(url, params).then((r) => {
wx.showToast({
title: '已取消点赞',
icon:'none'
})
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function() {
}
t.data.likeList.splice(index, 1);
setTimeout(()=>{
t.setData({
likeList: t.data.likeList
})
},1200)
})
},
// 获取点赞列表
getLikeList() {
let b = this, url = '/api/User/getMyLikeList', params = {
header: true,
page: b.data.page
};
a.post(url, params).then((res) => {
for (let b of res.data) {
b.images = b.images.split(',')
}
b.setData({
likeList: b.data.likeList.concat(res.data),
ifData: res.data.length > 0 ? true : false,
noMore: res.data.length < res.per_page ? !0 : !1
})
})
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
this.setData({
page: 1,
likeList: []
}),
this.getLikeList()
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
let that = this;
!this.data.noMore ? (that.setData({
page: that.data.page + 1,
}), that.getLikeList()) : wx.showToast({
title: '没有更多了',
icon: 'none'
})
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
}
})
\ No newline at end of file
... ...
... ... @@ -2,5 +2,6 @@
"usingComponents": {},
"navigationBarTitleText": "我的点赞",
"navigationBarBackgroundColor": "#fff",
"navigationBarTextStyle": "black"
"navigationBarTextStyle": "black",
"enablePullDownRefresh": true
}
\ No newline at end of file
... ...
<!-- 企话吧 -->
<scroll-view class='box_right' hidden='{{!ifData}}'>
<view class='mid'>
<!-- 条目 -->
<view class='mid_item' wx:for="{{likeList}}" wx:key="index">
<view class='mid_item_top'>
<view class='mid_item_top_left'>
<!-- 图片 -->
<view class='mid_item_top_left_pic'>
<image src='{{item.avatar}}'></image>
</view>
<!-- 文字 -->
<view class='mid_item_top_left_text'>
{{item.nickname}}
</view>
<!-- 企话吧 -->
<scroll-view class='box_right' hidden='{{!ifData}}'>
<view class='mid'>
<!-- 条目 -->
<view class='mid_item' wx:for="{{likeList}}" wx:key="index" bindtap='navdetail' id='{{item.object_id}}'>
<view class='mid_item_top' bindtap='navdetail' id='{{item.object_id}}'>
<view class='mid_item_top_left'>
<!-- 图片 -->
<view class='mid_item_top_left_pic'>
<image src='{{item.avatar}}'></image>
</view>
<view class='mid_item_top_right'>
{{item.create_time_text}}
<!-- 文字 -->
<view class='mid_item_top_left_text'>
{{item.nickname}}
</view>
</view>
<!-- 文字内容 -->
<view class='mid_item_text'>{{item.title}}
<view class='mid_item_top_right'>
{{item.create_time_text}}
</view>
<!-- 图片内容 -->
<view class='mid_pic_box'>
<view class='mid_pic_box_p' wx:for="{{item.images}}" wx:key="index">
<image src='{{item}}'></image>
</view>
<!-- <view class='mid_pic_box_p'>
<image src='../../images/weirenzheng@3x.png'></image>
</view> -->
</view>
<!-- 文字内容 -->
<view class='mid_item_text'>{{item.title}}
</view>
<!-- 图片内容 -->
<view class='mid_pic_box' hidden='{{item.images==""}}'>
<view class='mid_pic_box_p' wx:for="{{item.images}}" wx:key="index">
<image src='{{item}}'></image>
</view>
</view>
<!-- 底部 -->
<view class='mid_item_like'>
<view class='mid_item_like_left'>
<!-- 删除 -->
<!-- 底部 -->
<view class='mid_item_like'>
<view class='mid_item_like_left' >
<!-- 删除 -->
</view>
<view class='mid_item_like_right'>
<!-- 点赞 -->
<view class='mid_like color_blue' catchtap='zan' id='{{item.object_id}}' data-idx='{{index}}' >
<image src='../../images/thumb-up-button@3x.png' class='zan' wx:if='{{item.is_like==1}}'></image>
<image src='../../images/dainzan@3x.png' class='zan' wx:else></image>
</view>
<view class='mid_number color_blue' catchtap='zan' id='{{item.object_id}}' data-idx='{{index}}'>
{{item.likes}}
</view>
<!-- 评论 -->
<view class='mid_like' bindtap='navdetail' id='{{item.id}}'>
<image src='../../images/pinglun@3x.png' wx:if="{{item.is_comment==0}}"></image>
<image src='../../images/pinglun_fill@3x.png' wx:else></image>
</view>
<view class='mid_number commentCount'>
{{item.comment_count}}
</view>
<!-- <view class='mid_item_like_right'> -->
<!-- 点赞 -->
<!-- <view class='mid_like color_blue'>
<image src='../../images/thumb-up-button@3x.png'></image>
</view> -->
<!-- 数量 -->
<!-- <view class='mid_number color_blue'>
46
</view> -->
<!-- 点赞 -->
<!-- <view class='mid_like'>
<image src='../../images/pinglun@3x.png'></image>
</view> -->
<!-- 数量 -->
<!-- <view class='mid_number'>
46
</view> -->
<!-- </view> -->
</view>
</view>
</view>
</scroll-view>
</view>
</scroll-view>
<view class="none-box" hidden="{{ifData}}">
<view>暂无相关点赞</view>
</view>
\ No newline at end of file
<view>暂无相关点赞</view>
</view>
\ No newline at end of file
... ...
... ... @@ -237,9 +237,13 @@ page{
width: 100%;
height: 100%;
}
.zan{
position: relative;
top: -4rpx;
}
.mid_number{
margin-left: 10rpx;
font-size:22rpx;
font-size:28rpx;
font-family:PingFang SC;
font-weight:400;
line-height:48rpx;
... ...
... ... @@ -19,7 +19,7 @@
<view class='item_right'>
<!-- 图片 -->
<view class='item_right_pic'>
<image src='../../images/chakan@3x.png'></image>
<image src='../../images/chakan@3x.png' mode='widthFix'></image>
</view>
<!-- 数量 -->
<view class='item_right_number'>
... ... @@ -28,7 +28,7 @@
<!-- 图片 -->
<view class='item_right_pic2'>
<image src='../../images/pinglun@3x.png'></image>
<image src='../../images/pinglun@3x.png' mode='widthFix'></image>
</view>
<!-- 数量 -->
<view class='item_right_number'>
... ...
... ... @@ -12,7 +12,8 @@ page{
flex-flow: column;
background: #fff;
box-sizing: border-box;
padding: 48rpx 32rpx;
padding: 30rpx;
font-size: 28rpx;
border-bottom:2rpx solid #f7f7f7
}
.item_top{
... ... @@ -51,15 +52,13 @@ page{
}
.item_bottom{
margin-top: 18rpx;
margin-top: 22rpx;
display: flex;
justify-content: space-between;
font-size: 28rpx;
}
.item_left{
display: flex;
width:44rpx;
height:32rpx;
font-size:22rpx;
font-family:PingFang SC;
font-weight:400;
line-height:32rpx;
... ... @@ -94,21 +93,18 @@ page{
}
.item_right_pic{
width:36rpx;
height:23rpx;
width:46rpx;
/* background:rgba(204,204,204,1); */
opacity:1;
display: flex;
}
.item_right_pic image{
width: 100%;
height: 100%;
}
.item_right_number{
margin-left: 12rpx;
width:24rpx;
height:28rpx;
font-size:20rpx;
font-family:PingFang SC;
font-weight:400;
line-height:28rpx;
... ... @@ -116,16 +112,14 @@ page{
opacity:1;
}
.item_right_pic2{
margin-left: 40rpx;
width:34rpx;
height:32rpx;
margin-left: 30rpx;
width:42rpx;
/* background:rgba(204,204,204,1); */
opacity:1;
display: flex;
}
.item_right_pic2 image{
width: 100%;
height: 100%;
}
.button{
width:686rpx;
... ...