Browse Source

no message

featrue/v4.5
xpz2018 4 years ago
parent
commit
4f07f31ef2
4 changed files with 28 additions and 5 deletions
  1. 14
      pages/article/detail/index.js
  2. 2
      pages/article/detail/index.json
  3. 8
      pages/article/detail/index.wxml
  4. 9
      pages/article/detail/index.wxss

14
pages/article/detail/index.js

@ -3,6 +3,8 @@ const util = require('../../../utils/util')
const tdsdk = require('../../../libs/tdweapp') const tdsdk = require('../../../libs/tdweapp')
const event = require('../../../utils/event.js') const event = require('../../../utils/event.js')
const app = getApp() const app = getApp()
const tip = '纸通宝免责声明:1、纸通宝所提供的信息及资料除原创外,部分资讯来源于网络等媒体,转载目的在于传递更多信息,并不代表纸通宝赞同其观点和对其真实性负责。如涉及作品内容、版权和其它问题,敬请原作者谅解,并立即通知纸通宝(投诉邮箱:zhitongbao@qniao.cn),我们将在第一时间删除内容!纸通宝拥有对此声明的最终解释权。2、以上所展示信息或资料,仅供参考!任何单位或个人因以上信息进行交易行为而导致财产损失等,纸通宝对此不承担任何法律责任。'
const maxLength = 42
Page({ Page({
data: { data: {
@ -28,7 +30,9 @@ Page({
pageSize: 15 pageSize: 15
}, },
maskHidden: false, maskHidden: false,
visible: false
visible: false,
tipshow: '',
ellipsis: true
}, },
onLoad: function (options) { onLoad: function (options) {
this.data.keyboardHeight = wx.getStorageSync('keyboardHeight') this.data.keyboardHeight = wx.getStorageSync('keyboardHeight')
@ -47,7 +51,7 @@ Page({
this.data.visible = true this.data.visible = true
} }
} }
this.setData({ momentDetail: result.data, visible: this.data.visible })
this.setData({ momentDetail: result.data, visible: this.data.visible, tipshow: tip.substring(0, maxLength - 3) + '...' })
this.fetchCommentList() this.fetchCommentList()
wx.hideLoading() wx.hideLoading()
}).catch(err => { }).catch(err => {
@ -62,6 +66,12 @@ Page({
onImageClick: function(){ onImageClick: function(){
wx.navigateTo({ url: '/pages/ztbvip/index' }) wx.navigateTo({ url: '/pages/ztbvip/index' })
}, },
ellipsisText: function () {
var ellipsis = !this.data.ellipsis;
var tipshow = tip;
tipshow = (tipshow.length > maxLength && ellipsis) ? tipshow.substring(0, maxLength - 3) + '...' : tipshow;
this.setData({ tipshow: tipshow, ellipsis: ellipsis })
},
onRefreshList: function () { onRefreshList: function () {
if (this.data.requesting) { if (this.data.requesting) {
return return

2
pages/article/detail/index.json

@ -4,7 +4,7 @@
"wux-image": "/components/image/index", "wux-image": "/components/image/index",
"sudoku-image": "/components/sudoku-image/index", "sudoku-image": "/components/sudoku-image/index",
"wux-divider": "/components/divider/index", "wux-divider": "/components/divider/index",
"refresh-view": "/components/refresher/index",
"fold-text": "/components/fold-text/index",
"wux-tag": "/components/tag/index", "wux-tag": "/components/tag/index",
"wux-popup": "/components/popup/index" "wux-popup": "/components/popup/index"
} }

8
pages/article/detail/index.wxml

@ -32,12 +32,16 @@
</view> </view>
<view wx:if="{{momentDetail.millPaperId}}" style="padding: 0rpx 32rpx 20rpx 32rpx"> <view wx:if="{{momentDetail.millPaperId}}" style="padding: 0rpx 32rpx 20rpx 32rpx">
<wux-tag bind:click="toMill"> <wux-tag bind:click="toMill">
<text
style="background-color:#ddd;border-radius: 32rpx;text-align: center;width:32rpx;height:32rpx;line-height:32rpx">#</text>
<text style="background-color:#ddd;border-radius: 32rpx;text-align: center;width:32rpx;height:32rpx;line-height:32rpx">#</text>
<text class="text-df" style="margin-left:16rpx">{{momentDetail.millPaperName}}</text> <text class="text-df" style="margin-left:16rpx">{{momentDetail.millPaperName}}</text>
<text class="cuIcon-right text-balck" style="font-size:24rpx;margin-left:32rpx;padding-top:2rpx"></text> <text class="cuIcon-right text-balck" style="font-size:24rpx;margin-left:32rpx;padding-top:2rpx"></text>
</wux-tag> </wux-tag>
</view> </view>
<view class="bg-white" style="padding: 0rpx 30rpx 24rpx 30rpx;">
<text class="pay-hint-content text-gray">{{tipshow}}</text>
<text class="ellipsis_text" bindtap="ellipsisText">{{ellipsis? '展开':'收起'}}</text>
</view>
<view style="height:20rpx;width:750rpx;background-color:#f3f3f3"></view> <view style="height:20rpx;width:750rpx;background-color:#f3f3f3"></view>
<view class="text-bold text-lg" style="padding:36rpx 30rpx 10rpx 30rpx">评论</view> <view class="text-bold text-lg" style="padding:36rpx 30rpx 10rpx 30rpx">评论</view>
<view class="bg-white list-empty" style="height:400rpx" wx:if="{{!commentList.length}}"> <view class="bg-white list-empty" style="height:400rpx" wx:if="{{!commentList.length}}">

9
pages/article/detail/index.wxss

@ -25,6 +25,15 @@
height: 40px; height: 40px;
} }
.pay-hint-content{
text-overflow: ellipsis;
-webkit-box-orient:vertical;
overflow:hidden;
word-wrap: break-word;
word-break: break-all;
white-space: pre-line;
}
.share-btn { .share-btn {
background-color: #fff; background-color: #fff;
padding-left: 0px; padding-left: 0px;

Loading…
Cancel
Save