Merge pull request 'gdpao' (#137) from gyh into master

Reviewed-on: http://git.luyuan.tk/luyuan/deming/pulls/137
This commit is contained in:
gyh 2020-08-09 11:33:25 +08:00
commit 097f7e3cba
12 changed files with 385 additions and 20 deletions

View File

@ -69,7 +69,7 @@ const install = (Vue, vm) => {
return false;
} else if (res.errCode == 1) {
console.log(res.message);
return res;
return res.data;
} else {
// 如果返回false则会调用Promise的reject回调
// 并将进入this.$u.post(url).then().catch(res=>{})的catch回调中res为服务端的返回值

View File

@ -1,5 +1,5 @@
<template>
<view class="video-item" v-if="item" @click="toDetailsPage(item.article_id)">
<view class="video-item" v-if="item" @click="toDetailsPage(item.article_id,item.video_path)">
<image class="head" :src="item.article_pic" v-if="item.type == 1" ></image>
<view class="header_fist" v-else>
<view class="backes"></view>
@ -245,10 +245,16 @@ export default {
}
})
},
toDetailsPage(id) {
uni.navigateTo({
url: '/pageB/photo/index?id=' + id
});
toDetailsPage(id,type) {
if (type) {
uni.navigateTo({
url: '/pageB/video/video?id=' + id
});
} else {
uni.navigateTo({
url: '/pageB/photo/index?id=' + id
});
}
},
},
}

View File

@ -5,7 +5,7 @@
<view class="notice_view">
<image :src="item.picture" mode="aspectFill" ></image>
<view class="text_view u-line-2">{{ item.content }}</view>
<view class="notice_list">
<view class="notice_list" @click="gotoInfo(index)">
<text>查看详情</text>
<u-icon name="arrow-right" color="#666"></u-icon>
</view>
@ -87,7 +87,15 @@
}
},
methods: {
gotoInfo(index) {
console.log(index);
this.$u.route({
url: "/pageD/notice/info",
params: {
index: index
},
})
}
}
}
</script>

View File

@ -0,0 +1,22 @@
<template>
<view>
</view>
</template>
<script>
export default {
data() {
return {
}
},
methods: {
}
}
</script>
<style>
</style>

View File

@ -58,7 +58,7 @@
<view class="no-data" v-if="!commentList.length">还没有评论快来评论吧</view>
<u-loadmore v-else :status="status" icon-type="iconType" margin-top="50" margin-bottom="50" :load-text="loadText" />
</scroll-view>
<view class="editing" @click="openKeyInput">
<view class="editing" @touchend.prevent="openKeyInput">
<input type="text" value="" :placeholder="edit_text" disabled="disabled" />
<text>发送</text>
</view>
@ -66,7 +66,7 @@
<!-- 评论box -->
<u-popup v-model="is_edit" mode="bottom" border-radius="10" height="100rpx">
<view class="edit-box">
<input type="text" :placeholder="edit_text_other" :focus="is_focus" @focus="focus" v-model="send_value" autofocus>
<input type="text" :focus="is_focus" :placeholder="edit_text_other" @focus="focus" v-model="send_value">
<text @click="sendComment">发送</text>
</view>
</u-popup>
@ -437,10 +437,10 @@ export default {
onBackPress() {
if (this.cart_type) {
this.cart_type = !this.cart_type;
} else if (this.is_comment) {
this.is_comment = !this.is_comment;
} else if (this.is_edit) {
this.is_edit = !this.is_edit;
} else if (this.is_comment) {
this.is_comment = !this.is_comment;
} else {
return false;
}
@ -495,9 +495,11 @@ export default {
},
//
openKeyInput(data,index) {
console.log(data);
// console.log(data);
this.is_edit = true;
this.is_focus = true;
setTimeout(() => {
this.is_focus = true;
}, 200)
this.comment_id = index;
if (data.id) {
this.edit_text_other = "回复@" + data.member_nickname;
@ -520,6 +522,7 @@ export default {
}).then(res => {
// console.log(res.data.data);
if (res.errCode == 0) {
this.send_value = "";
this.comment_num = res.data.num;
// console.log(this.comment_num);
this.is_edit = false;

207
pageB/video/video.nvue Normal file
View File

@ -0,0 +1,207 @@
<template>
<view>
<video id="videoId" :style="videoSize" :src="src" autoplay="true" :loop="true" :show-fullscreen-btn="false" @play="playing"
: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>
<cover-view class="" src="../../static/videoPlay.png">
</cover-view>
<cover-view class="info-box">
<view class="video-info-box">
<image class="image-play" src="../../static/videoPlay.png" mode=""></image>
<text class="video-slip">视频</text>
<text class="time">{{ time_count }}s</text>
</view>
<view>
<text class="name">@{{ list.member_nickname }}</text>
</view>
<view>
<text class="title">{{ list.article_title }}</text>
</view>
<view>
<text class="centent">{{ list.article_content }}</text>
</view>
<view class="label-box">
<block v-for="(item,index) in list.label" :key="index">
<text class="label" :style="{ width: item.name.length * 40 + 'rpx' }">{{ item.name }}</text>
</block>
</view>
</cover-view>
</view>
</template>
<script>
export default {
data() {
return {
videoSize: {},
list: {},
src: "",
is_play: true,
timer: null,
alltime: 7,
time_count: 7,
};
},
onLoad(option) {
this.getVideoInfo(option.id);
this.getInfo();
this.aaa();
},
onReady() {
this.videoBox = uni.createVideoContext("videoId", this);
},
methods: {
// 获取信息
getVideoInfo(article_id) {
uni.request({
url: "https://dmmall.sdbairui.com/api/article/articleInfo",
method: "POST",
data: {
article_id: article_id
},
success: (res) => {
this.list = res.data.data.info;
this.src = res.data.data.info.video_path;
}
})
},
// 获取手机信息
getInfo() {
uni.getSystemInfo({
success: (res) => {
this.videoSize = {
width: "750rpx",
height: res.screenHeight + "px"
}
}
})
},
// 播放
playing(e) {
console.log(e);
if (e.type == "play") {
this.alltime = 7;
this.time_count = 7;
this.aaa();
}
},
// 暂停
stoping() {
this.is_play = !this.is_play;
if (this.is_play) {
this.videoBox.play();
this.aaa();
} else {
this.videoBox.pause();
clearInterval(this.timer);
this.temp_time = this.time_count;
console.log(this.temp_time);
}
},
// 倒计时
aaa() {
this.timer = setInterval(() => {
if (this.time_count > 0 && this.time_count <= this.alltime) {
this.time_count--;
} else {
clearInterval(this.timer);
this.timer = null;
}
}, 1000);
},
goBack() {
uni.navigateBack({
delta: 1
})
}
}
}
</script>
<style>
/* 关闭 */
.close {
position: fixed;
top: 80rpx;
right: 60rpx;
width: 30rpx;
height: 30rpx;
}
/* 底部信息 */
.info-box {
position: fixed;
bottom: 0;
left: 0;
padding: 30rpx;
}
.video-info-box {
flex-direction: row;
align-items: center;
width: 160rpx;
height: 40rpx;
padding: 4rpx 10rpx;
margin-bottom: 20rpx;
color: #666666;
border-radius: 10rpx;
background-color: rgba(255, 255, 255, .6);
}
.image-play {
width: 22rpx;
height: 20rpx;
margin-right: 10rpx;
}
.video-slip {
color: #666;
font-size: 24rpx;
margin-right: 20rpx;
}
.time {
color: #666;
font-size: 24rpx;
}
.name {
color: #fff;
font-size: 36rpx;
margin-bottom: 20rpx;
}
.title {
color: #fff;
font-size: 26rpx;
margin-bottom: 20rpx;
}
.centent {
width: 500rpx;
color: #fff;
font-size: 28rpx;
margin-bottom: 20rpx;
lines: 2;
text-overflow: ellipsis;
}
.label-box {
flex-direction: row;
}
.label {
lines: 3;
width: 100rpx;
height: 40rpx;
padding: 4rpx 10rpx;
margin-right: 10rpx;
margin-bottom: 10rpx;
font-size: 26rpx;
text-align: center;
color: #666666;
border-radius: 10rpx;
background-color: rgba(255, 255, 255, .6);
}
</style>

View File

@ -48,11 +48,13 @@
</script>
<style lang="scss" scoped>
page {
background-color: #ECECEC;
}
uni-page-body{
height: 100%;
}
#actives{
background: #ECECEC;
height: 100%;
.time {
padding: 30rpx 0;

70
pageD/notice/info.vue Normal file
View File

@ -0,0 +1,70 @@
<template>
<view>
<image :src="list.picture" class="picture" mode=""></image>
<view class="box">
<view class="info">
<text class="title u-line-2">{{ list.title }}</text>
<u-divider class="time">{{ list.addtime }}</u-divider>
<!-- <text class="time"></text> -->
</view>
<view class="content">{{ list.content }}</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
index: 0,
list: [],
};
},
onLoad(option) {
// console.log(option);
this.index = option.index;
//
this.informationList();
},
methods: {
informationList(){
this.$u.api.informationList({}).then((res)=>{
if (res.errCode == 0) {
this.list = res.data[this.index];
console.log(this.list);
}
})
}
}
}
</script>
<style lang="scss">
page {
}
.picture {
width: 100%;
}
.box {
width: 100%;
padding: 20rpx;
.info {
.title {
font-size: 38rpx;
color: rgba(0,0,0,.84);
line-height: 1.2;
}
.time {
padding: 40rpx 0;
}
}
.content {
padding: 0 6rpx;
font-size: 34rpx;
color: rgba(0,0,0,.6);
line-height: 1.4;
letter-spacing: 1rpx;
text-indent: 2rem;
}
}
</style>

View File

@ -21,7 +21,9 @@
},
informationList(){
this.$u.api.informationList({}).then((res)=>{
this.list = res.data;
if (res.errCode == 0) {
this.list = res.data;
}
})
}
},

View File

@ -102,6 +102,12 @@
}
}
},
{
"path" : "video/video",
"style" : {
"navigationStyle":"custom"
}
},
{
"path": "sdetails/index",
"style": {
@ -493,7 +499,16 @@
}
}
}
}
},
{
"path" : "notice/info",
"style" : {
"navigationBarTitleText":"公告详情",
"titleNView": {
"backgroundColor": "#FFFFFF"
}
}
}
]
},
{
@ -1062,7 +1077,11 @@
}
}
}
],
,{
"path" : "pageB/components/nuserinfo/nuserinfo",
"style" : {}
}
],
"tabBar": {
"color": "#999999",
"selectedColor": "#FF780F",

View File

@ -145,6 +145,8 @@
image: item.adv_code,
adv_link: item.adv_link,
adv_id: item.adv_id,
info_id: item.info_id,
url_type: item.url_type,
})
})
this.list = temp;
@ -181,9 +183,33 @@
})
},
clickImage(index) {
console.log(index);
console.log(this.list[index]);
// console.log(this.list[index]);
let item = this.list[index];
this.activityLink({
type: item.url_type,
id: item.info_id,
});
},
activityLink({
type,
id
}) {
console.log(type,id);
if (type == 0) return false;
// type 1 , 2
const url = type == 1 ? 'pageB/sdetails/index' : 'pageC/merchant/index';
let params = {
id: id
};
// type: 1 // 1 2 3 4
if (type == 1) Object.assign(params, {
type: 1
});
this.$u.route({
url: url,
params: params
})
},
//
onreachBottom() {
this.$refs.recommendGoods.loadMore();

BIN
static/videoPlay.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB