gdpao #137

Merged
gyh merged 1 commits from gyh into master 2020-08-09 03:33:26 +00:00
12 changed files with 385 additions and 20 deletions
Showing only changes of commit fe8af80983 - Show all commits

View File

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

View File

@ -1,5 +1,5 @@
<template> <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> <image class="head" :src="item.article_pic" v-if="item.type == 1" ></image>
<view class="header_fist" v-else> <view class="header_fist" v-else>
<view class="backes"></view> <view class="backes"></view>
@ -245,10 +245,16 @@ export default {
} }
}) })
}, },
toDetailsPage(id) { toDetailsPage(id,type) {
uni.navigateTo({ if (type) {
url: '/pageB/photo/index?id=' + id 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"> <view class="notice_view">
<image :src="item.picture" mode="aspectFill" ></image> <image :src="item.picture" mode="aspectFill" ></image>
<view class="text_view u-line-2">{{ item.content }}</view> <view class="text_view u-line-2">{{ item.content }}</view>
<view class="notice_list"> <view class="notice_list" @click="gotoInfo(index)">
<text>查看详情</text> <text>查看详情</text>
<u-icon name="arrow-right" color="#666"></u-icon> <u-icon name="arrow-right" color="#666"></u-icon>
</view> </view>
@ -87,7 +87,15 @@
} }
}, },
methods: { methods: {
gotoInfo(index) {
console.log(index);
this.$u.route({
url: "/pageD/notice/info",
params: {
index: index
},
})
}
} }
} }
</script> </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> <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" /> <u-loadmore v-else :status="status" icon-type="iconType" margin-top="50" margin-bottom="50" :load-text="loadText" />
</scroll-view> </scroll-view>
<view class="editing" @click="openKeyInput"> <view class="editing" @touchend.prevent="openKeyInput">
<input type="text" value="" :placeholder="edit_text" disabled="disabled" /> <input type="text" value="" :placeholder="edit_text" disabled="disabled" />
<text>发送</text> <text>发送</text>
</view> </view>
@ -66,7 +66,7 @@
<!-- 评论box --> <!-- 评论box -->
<u-popup v-model="is_edit" mode="bottom" border-radius="10" height="100rpx"> <u-popup v-model="is_edit" mode="bottom" border-radius="10" height="100rpx">
<view class="edit-box"> <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> <text @click="sendComment">发送</text>
</view> </view>
</u-popup> </u-popup>
@ -437,10 +437,10 @@ export default {
onBackPress() { onBackPress() {
if (this.cart_type) { if (this.cart_type) {
this.cart_type = !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) { } else if (this.is_edit) {
this.is_edit = !this.is_edit; this.is_edit = !this.is_edit;
} else if (this.is_comment) {
this.is_comment = !this.is_comment;
} else { } else {
return false; return false;
} }
@ -495,9 +495,11 @@ export default {
}, },
// //
openKeyInput(data,index) { openKeyInput(data,index) {
console.log(data); // console.log(data);
this.is_edit = true; this.is_edit = true;
this.is_focus = true; setTimeout(() => {
this.is_focus = true;
}, 200)
this.comment_id = index; this.comment_id = index;
if (data.id) { if (data.id) {
this.edit_text_other = "回复@" + data.member_nickname; this.edit_text_other = "回复@" + data.member_nickname;
@ -520,6 +522,7 @@ export default {
}).then(res => { }).then(res => {
// console.log(res.data.data); // console.log(res.data.data);
if (res.errCode == 0) { if (res.errCode == 0) {
this.send_value = "";
this.comment_num = res.data.num; this.comment_num = res.data.num;
// console.log(this.comment_num); // console.log(this.comment_num);
this.is_edit = false; 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> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
page {
background-color: #ECECEC;
}
uni-page-body{ uni-page-body{
height: 100%; height: 100%;
} }
#actives{ #actives{
background: #ECECEC;
height: 100%; height: 100%;
.time { .time {
padding: 30rpx 0; 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(){ informationList(){
this.$u.api.informationList({}).then((res)=>{ this.$u.api.informationList({}).then((res)=>{
this.list = res.data; if (res.errCode == 0) {
this.list = res.data;
}
}) })
} }
}, },

View File

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

View File

@ -145,6 +145,8 @@
image: item.adv_code, image: item.adv_code,
adv_link: item.adv_link, adv_link: item.adv_link,
adv_id: item.adv_id, adv_id: item.adv_id,
info_id: item.info_id,
url_type: item.url_type,
}) })
}) })
this.list = temp; this.list = temp;
@ -181,9 +183,33 @@
}) })
}, },
clickImage(index) { 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() { onreachBottom() {
this.$refs.recommendGoods.loadMore(); this.$refs.recommendGoods.loadMore();

BIN
static/videoPlay.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB