Merge pull request 'gdpaoup' (#145) from gyh into master

Reviewed-on: http://git.luyuan.tk/luyuan/deming/pulls/145
This commit is contained in:
gyh 2020-08-10 19:08:19 +08:00
commit 52bce327cc
4 changed files with 245 additions and 39 deletions

View File

@ -174,7 +174,6 @@
.backes{ .backes{
position: absolute; position: absolute;
top: 0; top: 0;
background: rgba(0,0,0,0.6);
width: 100%; width: 100%;
height: 100%; height: 100%;
color: #fff; color: #fff;
@ -233,6 +232,7 @@ export default {
} }
}) })
}, },
//
articleAddShield() { articleAddShield() {
this.$u.api.articleAddShield({ this.$u.api.articleAddShield({
article_id: this.item.article_id, article_id: this.item.article_id,

View File

@ -46,8 +46,8 @@
/* #ifndef APP-PLUS-NVUE */ /* #ifndef APP-PLUS-NVUE */
display: flex; display: flex;
/* #endif */ /* #endif */
position: relative;
align-items: center; align-items: center;
padding-bottom: 20rpx;
} }
.avatar { .avatar {
@ -60,6 +60,7 @@
} }
.follow { .follow {
z-index: 100;
position: absolute; position: absolute;
top: 90rpx; top: 90rpx;
left: 40rpx; left: 40rpx;
@ -67,7 +68,7 @@
height: 36rpx; height: 36rpx;
text-align: center; text-align: center;
line-height: 36rpx; line-height: 36rpx;
font-size: 36rpx; font-size: 34rpx;
border-radius: 50%; border-radius: 50%;
color: #fff; color: #fff;
background-color: #FF780F; background-color: #FF780F;
@ -148,7 +149,7 @@
this.is_follow = !this.is_follow; this.is_follow = !this.is_follow;
console.log(this.is_follow); console.log(this.is_follow);
uni.showToast({ uni.showToast({
title: res.data.data.message, title: res.data.message,
icon: "none" icon: "none"
}) })
} }

View File

@ -1,7 +1,7 @@
<template> <template>
<view> <view>
<video id="videoId" :style="videoSize" :src="src" autoplay="true" :show-fullscreen-btn="false" @play="playing" @timeupdate="timeupdate" <video id="videoId" :style="videoSize" :src="src" autoplay="true" :show-fullscreen-btn="false" @play="playing"
:show-play-btn="false" controls="false" @click="stoping" :enable-progress-gesture="false"></video> @timeupdate="timeupdate" :show-play-btn="false" controls="false" @click="stoping" :enable-progress-gesture="false"></video>
<cover-image class="close" @click="goBack" src="../../static/close.png"> <cover-image class="close" @click="goBack" src="../../static/close.png">
</cover-image> </cover-image>
<cover-image class="pause" @click="stoping" src="../../static/videoPlay.png" v-if="!is_play"> <cover-image class="pause" @click="stoping" src="../../static/videoPlay.png" v-if="!is_play">
@ -29,13 +29,47 @@
</block> </block>
</view> </view>
</cover-view> </cover-view>
<cover-view class="content-box" v-if="is_comment">
<view class="content-title">
<text class="tips">评论</text>
<text class="close-down" @click="closeComment">×</text>
</view>
<scroller class="comment-list">
<view class="" v-for="(item,index) in commentList" :key="index">
<view class="comment-list-box">
<view class="comment-list-header">
<image class="avatar" :src="item.member_avatar" mode=""></image>
<view>
<text class="comment-title">{{ item.member_nickname }}</text>
<text class="comment-time">{{ item.create_time }}</text>
</view>
</view>
<text class="reply">回复</text>
</view>
<view class="content-main">
<text class="content-style">{{ item.content }}</text>
</view>
</view>
<view class="send-box">
<input class="send-val" type="text" value="" />
<text class="btn-send">发送</text>
</view>
<loading class="loading" @loading="onloading" :display="loadinging ? 'show' : 'hide'">
<loading-indicator class="indicator"></loading-indicator>
<text class="indicator-text">努力加载中</text>
</loading>
</scroller>
</cover-view>
<list class="cart-box">
<cell></cell>
</list>
</view> </view>
</template> </template>
<script> <script>
import userinfo from "../components/userinfo/index" // 点赞组件 import userinfo from "../components/userinfo/index" // 点赞组件
export default { export default {
components:{ components: {
userinfo userinfo
}, },
data() { data() {
@ -46,13 +80,17 @@
cart_type: false, // 显示购物车 cart_type: false, // 显示购物车
is_comment: false, // 显示评论 is_comment: false, // 显示评论
comment_num: 0, // 评论数 comment_num: 0, // 评论数
page: 0,
commentList: [], // 评论列表
src: "", src: "",
is_play: true, is_play: true,
time_count: 0, time_count: 0,
linear: null, linear: null,
loadinging: false,
}; };
}, },
onLoad(option) { onLoad(option) {
this.article_id = option.id;
this.getVideoInfo(option.id); this.getVideoInfo(option.id);
this.getInfo(); this.getInfo();
}, },
@ -69,7 +107,7 @@
article_id: article_id article_id: article_id
}, },
header: { header: {
Authorization: 'Bearer' + ' ' + uni.getStorageSync('token') Authorization: 'Bearer' + ' ' + uni.getStorageSync('token')
}, },
success: (res) => { success: (res) => {
this.list = res.data.data.info; this.list = res.data.data.info;
@ -78,7 +116,7 @@
let arr = []; let arr = [];
item.forEach(data => { item.forEach(data => {
let str = escape(data.name); let str = escape(data.name);
if(str.indexOf('%u')){ if (str.indexOf('%u')) {
// console.log(data.name); // console.log(data.name);
arr.push(Math.floor(data.name.length / 2)); arr.push(Math.floor(data.name.length / 2));
} else { } else {
@ -89,6 +127,23 @@
} }
}) })
}, },
// 获取评论
getComment() {
uni.request({
url: "https://dmmall.sdbairui.com/api/article/articleCommentList",
method: "POST",
data: {
article_id: this.article_id,
page: this.page,
},
success: (res) => {
if (res.data.errCode == 0) {
console.log(res.data);
this.commentList = res.data.data;
}
}
})
},
// 获取手机信息 // 获取手机信息
getInfo() { getInfo() {
uni.getSystemInfo({ uni.getSystemInfo({
@ -103,8 +158,7 @@
// 播放 // 播放
playing(e) { playing(e) {
// console.log(e); // console.log(e);
if (e.type == "play") { if (e.type == "play") {}
}
}, },
// 暂停 // 暂停
stoping() { stoping() {
@ -119,12 +173,34 @@
timeupdate(e) { timeupdate(e) {
this.time_count = parseInt(e.detail.duration) - parseInt(e.detail.currentTime); this.time_count = parseInt(e.detail.duration) - parseInt(e.detail.currentTime);
if (e.detail.duration == e.detail.currentTime) { if (e.detail.duration == e.detail.currentTime) {
this.is_play = false; this.is_play = false;
} }
// let num = parseInt((e.detail.currentTime/e.detail.duration)*100); // let num = parseInt((e.detail.currentTime/e.detail.duration)*100);
// this.linear = num + "%"; // this.linear = num + "%";
// console.log(this.time_count); // console.log(this.time_count);
}, },
// 打开弹窗
openPopup(data) {
console.log(data);
this.cart_type = data.cart;
this.is_comment = data.comment;
if (this.is_comment) {
this.page = 0;
this.getComment();
}
},
// 关闭评论
closeComment() {
this.is_comment = false;
},
// 下拉加载
onloading(e) {
console.log(e);
this.loadinging = true;
setTimeout(() => {
this.loadinging = false;
}, 2000)
},
goBack() { goBack() {
uni.navigateBack({ uni.navigateBack({
delta: 1 delta: 1
@ -180,6 +256,109 @@
background-color: rgba(255, 255, 255, .6); background-color: rgba(255, 255, 255, .6);
} }
.content-box {
z-index: 99;
position: fixed;
bottom: 0;
left: 0;
width: 750rpx;
height: 700rpx;
margin-bottom: 88rpx;
background-color: #fff;
}
.content-title {
justify-content: space-between;
flex-direction: row;
align-items: center;
height: 88rpx;
padding: 0 20rpx;
background-color: #ECECEC;
}
.comment-list {
margin-bottom: 50rpx;
}
.comment-list-box {
padding: 30rpx;
flex-direction: row;
align-items: center;
justify-content: space-between;
}
.content-main {
flex-direction: row;
padding-left: 100rpx;
}
.content-style {
width: 600rpx;
font-size: 26rpx;
color: #333;
lines: 2;
}
.comment-list-header {
flex-direction: row;
}
.avatar {
width: 60rpx;
height: 60rpx;
margin-right: 20rpx;
border-radius: 50%;
}
.comment-title {
font-size: 26rpx;
color: #333;
}
.comment-time,
.reply {
font-size: 22rpx;
color: #999;
}
.tips {
font-size: 30rpx;
font-weight: 500;
color: #333;
}
.send-box {
z-index: 10000;
position: fixed;
bottom: 0;
left: 0;
flex-direction: row;
align-items: center;
justify-content: space-between;
width: 750rpx;
height: 88rpx;
padding: 10rpx 30rpx;
border-top-width: 1rpx;
border-color: #ececec;
background-color: #fff;
}
.send-val {
width: 600rpx;
height: 88rpx;
font-size: 36rpx;
}
.btn-send {
font-size: 30rpx;
color: #303133;
}
.close-down {
font-size: 50rpx;
text-align: center;
color: #333;
}
.image-play { .image-play {
width: 22rpx; width: 22rpx;
height: 20rpx; height: 20rpx;
@ -235,4 +414,23 @@
border-radius: 10rpx; border-radius: 10rpx;
background-color: rgba(255, 255, 255, .6); background-color: rgba(255, 255, 255, .6);
} }
.loading {
width: 750rpx;
flex-direction: row;
align-items: center;
justify-content: center;
}
.indicator-text {
font-size: 20rpx;
text-align: center;
color: #999;
}
.indicator {
width: 30rpx;
height: 30rpx;
color: #999;
}
</style> </style>

View File

@ -14,7 +14,7 @@
inactive-color="#333" :active-item-style="{ inactive-color="#333" :active-item-style="{
'color':'#333' 'color':'#333'
}" :bold="false" }" :bold="false"
@change="dianji"></u-tabs> @change="dianji($event)"></u-tabs>
</view> </view>
<view class="sosuo"></view> <view class="sosuo"></view>
</view> </view>
@ -120,6 +120,7 @@
.tabs { .tabs {
width: 334rpx; width: 334rpx;
// pointer-events: none;
/deep/ .u-tab-item { /deep/ .u-tab-item {
font-weight: bold; font-weight: bold;
@ -130,6 +131,7 @@
.card { .card {
height: 100%; height: 100%;
width: 100%; width: 100%;
// pointer-events: none;
.box { .box {
width: 100%; width: 100%;
@ -342,7 +344,6 @@
this.$u.api.attentionMember({ this.$u.api.attentionMember({
member_id: member_id member_id: member_id
}).then((res) => { }).then((res) => {
console.log(res);
this.follow_page = 0; this.follow_page = 0;
this.getRecommendList(); // this.getRecommendList(); //
this.getFollowList(); // this.getFollowList(); //
@ -357,28 +358,31 @@
}, },
// //
dianji(a) { dianji(a) {
// console.log(a); // console.log(a);
if (typeof a == "object") { if (a.type == "change") {
this.num = a.detail.current this.num = a.detail.current
} else { } else {
this.num = a this.num = a;
} }
// console.log(this.num);
// //
if (this.num == 0) { if (a.type == "change") { //
this.page = 0; if (this.num == 0) {
this.status = "loadmore"; this.page = 0;
this.getArticlelist(); this.status = "loadmore";
this.getSwiper(); this.getArticlelist();
} else if (this.num == 1) { this.getSwiper();
this.getZhiBoSwiper(); // } else if (this.num == 1) {
this.tabLiveList(); this.getZhiBoSwiper(); //
} else if (this.num == 2) { this.tabLiveList();
this.follow_page = 0; } else if (this.num == 2) {
this.status = "loadmore"; this.follow_page = 0;
if (this.hasLogin) { this.fansList = [];
this.getFollowList(); // if (this.hasLogin) {
this.getFollowList(); //
}
this.getRecommendList(); //
} }
this.getRecommendList(); //
} }
}, },
// //
@ -430,11 +434,14 @@
}).then(res => { }).then(res => {
this.status_1 = "loading"; this.status_1 = "loading";
if (res.errCode == 0) { if (res.errCode == 0) {
if (this.fansList.length < 4) {
this.status_1 = "nomore";
}
// uni.stopPullDownRefresh(); // uni.stopPullDownRefresh();
// console.log('37647744ghj', res) // console.log('37647744ghj', res)
if (this.follow_page == 0) { if (this.follow_page == 0) {
this.fansList = res.data.list; this.fansList = res.data.list;
this.status_1 = "loadmore"; // this.status_1 = "loadmore";
} else if (res.data.list.length == 0 && this.follow_page > 0) { } else if (res.data.list.length == 0 && this.follow_page > 0) {
this.status_1 = "nomore"; this.status_1 = "nomore";
} else { } else {