dev
xiaowen 3 years ago
parent 29923624e0
commit 81d2672f40

@ -1,4 +1,6 @@
import {doStr} from "../../utils/doStr.js"
import {
doStr
} from "../../utils/doStr.js"
const app = getApp();
let iPageIndex = 1 // 当前第几页,0代表第一页
let iPageSize = 10 //每页显示多少数据
@ -14,13 +16,15 @@ Page({
affections: "",
crisis: "",
ssim: "",
uri: "",
dataList: [], //放置返回数据的数组
loadMore: false, //"上拉加载"的变量默认false隐藏
loadAll: false, //“没有数据”的变量默认false隐藏
totalNum: 0,
c1: "",
c2: "",
showMore: false
showMore: false,
showDialog: false
},
onLoad() {
wx.setNavigationBarTitle({
@ -76,6 +80,7 @@ Page({
affections: data._source.affections,
crisis: data._source.crisis,
ssim: data._source.ssim,
uri: data._source.url,
c1: c1,
c2: c2
})
@ -128,8 +133,8 @@ Page({
});
if (res.length < iPageSize) {
this.setData({
loadMore: false, //隐藏加载中。。
loadAll: true //所有数据都加载完了
loadMore: false, //隐藏加载中。。
loadAll: true //所有数据都加载完了
});
}
} else {
@ -142,7 +147,7 @@ Page({
},
showMoreData() {
let sm = !this.data.showMore;
if(sm) {
if (sm) {
this.setData({
content: this.data.c1
})
@ -154,6 +159,16 @@ Page({
this.setData({
showMore: sm
})
},
handlerCopy() {
wx.setClipboardData({
data: this.data.uri,
success: () => {
this.setData({
showDialog: true
})
}
})
}
})

@ -10,7 +10,7 @@
<view class="d-top-cp-d1-s1" style="margin-left: 7px;background: #FFFBF0;color: #FDCD42;" wx:if="{{crisis == 2}}">中级危机</view>
<view class="d-top-cp-d1-s1" style="margin-left: 7px;background: #FFF0F1;color: #FF4852;" wx:if="{{crisis == 3}}">高级危机</view>
</view>
<view class="dtcd1-dd2">
<view class="dtcd1-dd2" bindtap="handlerCopy">
<image class="d-top-cp-d1-m1" src="{{imageUrl}}/copy.png"></image>
<text class="d-top-cp-d1-s2">复制链接</text>
</view>
@ -66,4 +66,33 @@
<view class="loading" hidden="{{!loadAll}}">已加载全部</view>
</scroll-view>
</view>
<van-dialog title="复制成功" use-slot show="{{ showDialog }}">
<view class="vd-outer">
<view class="vd-i-d1">已复制到剪贴板,快去分享吧</view>
<view class="vd-i-d2">
<text>发布时间:</text>
<text style="color: #909497;">{{sourcetime}}</text>
</view>
<view class="vd-i-d2">
<text style="width: 14%">来源:</text>
<text style="width: 86%;color: #909497;">{{source}}</text>
</view>
<view class="vd-i-d2">
<text style="width: 14%">标题:</text>
<text style="width: 86%;color: #909497;">{{title}}</text>
</view>
<view class="vd-i-d2">
<text style="width: 14%">链接:</text>
<text style="width: 86%;color: #909497;">{{uri}}</text>
</view>
<view class="vd-i-d2">
<text style="width: 14%">调性:</text>
<text style="width: 86%;color: #909497;">{{affections == 1 ? '正面' : affections == 2 ? '负面' : '中性'}}</text>
</view>
<view class="vd-i-d2">
<text style="width: 14%">作者:</text>
<text style="width: 86%;color: #909497;">{{user_author}}</text>
</view>
</view>
</van-dialog>
</view>

@ -144,4 +144,23 @@
padding: 10rpx;
text-align: center;
font-size: 12px;
}
.vd-outer {
padding: 16px;
}
.vd-i-d1 {
font-size: 17px;
font-weight: 600;
color: #D0D0D0;
}
.vd-i-d2 {
font-size: 14px;
font-weight: 600;
color: #333333;
margin-top: 7px;
display: flex;
justify-content: flex-start;
}
Loading…
Cancel
Save