Commit c5bf2f08 authored by Mac's avatar Mac

1

parent a790ae64
<style>
.friendcircle {
width: 100%;
height: 100vh;
background: #FFF;
font-family: aa;
}
.friendcircle .ftBox {
width: 100%;
padding: 0 15px;
margin-top: 20px;
display: flex;
flex-direction: row;
align-items: flex-start;
}
.friendcircle .ftBox-left{
margin-right: 15px;
}
.friendcircle .ftBox-right{
width: 1;
flex: 1;
flex-direction: column;
}
.friendcircle .text{
color: #A68237;
font-size: 12px;
}
.friendcircle .text2{
font-size: 12px;
color: #333333;
}
.friendcircle .r-sj{
font-size: 11px;
color: #B0B0B0;
display: flex;flex-direction: row;
align-items: center;
justify-content: space-between;
position: relative;
}
.friendcircle .r-sj-d{
width: 24px;
height: 17px;
background: #F5F5F5;
border-radius: 3px;
display: flex;flex-direction: row;
align-items: center;justify-content: space-around;padding:0 3px;
}
.friendcircle .dian{
width: 4px;height: 4px;border-radius: 2px;background: #737373;
}
.diancaoz{
width: 110px;
height: 30px;
background: #000000;
border-radius: 4px;
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-around;
position: absolute;
right: 26px;
bottom: -5px;
font-size: 11px;
color: #FFFFFF;
}
.dianrow{
display: flex;flex-direction: row;
align-items: center;
}
.dianrow text{margin-left: 3px;}
.friendcircle .imgmode{
display: flex;
flex-direction: row;
flex-wrap: wrap;
}
.friendcircle .fileimg{
width: 100%;height: 100%;
}
.friendcircle .imgc{
width: 100%;height: 100%;
background: rgba(0, 0, 0, 0.2);
display: flex;
flex-direction: row;
align-items: center;
justify-content: center;
position: absolute;
left: 0;
top:0;
font-size: 30px;
color: #FFFFFF;
}
</style>
<template>
<div class='friendcircle'>
<u-empty v-if="g.length == 0" text="暂无动态" mode="list"></u-empty>
<view v-if="g.length > 0" style="
height: calc(100vh);width: calc(100vw)
overflow: hidden;
">
<scroll-view :scroll-y="true" :enable-back-to-top="true" :enable-flex="true" @scrolltolower="lower" :style="{ height: '100%' }">
<view class="ftBox" v-for="(x, i) in g" :key="i" >
<view class="ftBox-left">
<u-avatar :src="x.crearteEmPhoto" size='80' mode="square"></u-avatar>
</view>
<view class="ftBox-right">
<view class="text" style="font-size: 14px;font-weight: bold;margin-bottom: 5px;">{{x.createEmName}}</view>
<view class="text2" style="font-size: 14px;margin-bottom: 5px;">{{x.content}}</view>
<!-- 图片模式 -->
<view class="imgmode" v-if="x.fileType==1" >
<view v-if="x.files.length==1" style="width: 150px;height:200px;margin-bottom: 6px;" @click="previewImage(0,x.files)">
<image :src="x.files[0]" mode="aspectFill" class="fileimg"></image>
</view>
<view v-if="x.files.length==2 || x.files.length==4" v-for="(item, iq) in x.files" :key="iq"
@click="previewImage(iq,x.files)"
style="width: 240rpx;height:240rpx;margin-bottom: 6px;margin-right: 6px;">
<image :src="item" mode="aspectFill" class="fileimg"></image>
</view>
<view v-if="(x.files.length==3 || x.files.length>4) && iq<9" v-for="(item, iq) in x.files" :key="iq"
@click="previewImage(iq,x.files)"
style="width: 160rpx;height:160rpx;margin-bottom: 6px;margin-right: 6px;position: relative;">
<image :src="item" mode="aspectFill" class="fileimg" ></image>
<view class="imgc" v-if="iq==8 && x.files.length>9">
9+
</view>
</view>
</view>
<view class="imgmode" v-if="x.fileType==2">
<view style="width: 100px;height:120px;margin-bottom: 6px;position: relative;" >
<video id="myVideo" :src="x.files[0]" style="width: 100%;height: 100%;" :controls='false'
:show-center-play-btn='false'></video>
<view style="width: 100%;height: 100%;position: absolute;left: 0;top: 0;display: flex;align-items: center;justify-content: center;"
@click="enlarge(x.files[0])">
<u-icon name="play-circle-o" :size="50" color="#FFF"></u-icon>
</view>
</view>
</view>
<view class="r-sj">
<text>{{x.createTime}}</text>
<view class="r-sj-d" @click="getdian(x,i)">
<view class="dian"></view>
<view class="dian"></view>
</view>
<view class="diancaoz" v-if="x.dianshow==true">
<view class="dianrow" @click="dianzan(x,i)">
<u-icon name="like-o" :size="30" color="#FFF"></u-icon>
<text>
{{x.hasLike==false ?'赞':'取消'}}
</text>
</view>
<view class="dianrow" @click="pinglun(x,i)">
<u-icon name="comment-circle-o" :size="30" color="#FFF"></u-icon>
<text>
评论
</text>
</view>
</view>
</view>
</view>
</view>
<u-loadmore :status="status" :load-text="loadText" :font-size="24" :margin-top="20" :margin-bottom="20" bg-color="#FFF" />
</scroll-view>
</view>
<auth v-if="showAuth" @changeuserinfo="reloadUserinfo" @gbAuth='gbAuth'></auth>
</view>
</div>
</template>
<script>
const innerAudioContext = uni.createInnerAudioContext();
import auth from "../../components/auth/index.vue";
export default {
components: {
auth,
},
data() {
return {
pageTitle: "朋友圈",
showAuth: false,
msg: {
pageIndex: 1,
pageSize: 15,
UserTeacher:0,
CreateBy:'',
UserId:0,
},
mainColor: "",
secondary: '',
pricecolor: '',
page_count: 1,
g: [],
loading: false,
status: "loadmore",
count: 0,
loadText: {
loadmore: "轻轻上拉,加载更多",
loading: "努力加载中",
nomore: "没有更多了",
},
windowWidth: 0,
nowbofo: false,
}
},
created() {
this.contentHeight = this.$utils.calcContentHeight(-40) + "px";
this.mainColor = this.$uiConfig.mainColor;
this.secondary = this.$uiConfig.secondary;
this.pricecolor = this.$uiConfig.pricecolor;
this.windowWidth = this.$utils.SystemInfo().windowWidth;
this.msg.UserId=uni.getStorageSync("mall_UserInfo").UserId ? uni.getStorageSync("mall_UserInfo").UserId :0;
},
mounted() {
let currentPages = getCurrentPages();
let u = "/" + currentPages[currentPages.length - 1].route;
let pages = wx.getStorageSync("basedata") ?
wx.getStorageSync("basedata").bar_title : [];
pages.forEach((x) => {
if (x.value == u) {
this.pageTitle = x.new_name ? x.new_name : x.name;
}
});
uni.setNavigationBarTitle({
title: this.pageTitle,
});
},
onLoad() {
this.u = uni.getStorageSync("mall_UserInfo");
if (!this.u) {
this.u = {
nickName: "未登录",
avatarUrl: ""
};
this.showAuth = true;
} else {
this.init();
}
},
methods: {
init() {
this.loading = true;
this.request2({
url: '/api/AppletSchool/DynamicList',
data: this.msg
},
res => {
if (res.resultCode == 1) {
this.loading = false;
this.count = res.data.count;
res.data.pageData.forEach(x => {
x.nowbofo = false;
x.dianshow = false;
})
this.g = this.g.concat(res.data.pageData);
this.page_count = res.data.pageCount;
if (this.page_count == 1) {
this.status = "nomore";
}
}
}
);
},
enlarge(file) {
// 全屏
uni.navigateTo({
url: '/pages/friendcircle/enlargevideo?file=' + file
})
},
//语音播放
playVoice(x) {
let that = this
if (innerAudioContext.src != x.files[0]) { //如果切换听其他的语音
innerAudioContext.stop();
this.nowbofo = false
}
innerAudioContext.src = x.files[0];
if (this.nowbofo == false) {
innerAudioContext.play()
this.nowbofo = true
} else {
innerAudioContext.pause();
this.nowbofo = false
}
},
getList() {
this.msg.pageIndex = 1;
this.g = [];
this.init();
},
lower(e) {
console.log(2)
if (this.msg.pageIndex < this.page_count) {
this.msg.pageIndex++;
this.status = "loading";
this.init();
} else {
this.status = "nomore";
}
},
reloadUserinfo() {
this.u = uni.getStorageSync("mall_UserInfo");
// this.showAuth=false;
this.init();
},
//关闭登录窗口
gbAuth() {
uni.navigateBack()
},
getdian(x,i){//点击点点
this.g[i].dianshow = !this.g[i].dianshow;
this.$forceUpdate()
},
dianzan(x,i){//点赞
},
pinglun(x,i){//评论
},
//图片预览
previewImage(index, images) {
uni.previewImage({
urls: images,
current: index,
});
},
enlarge(file){
uni.navigateTo({
url: '/pages/friendcircle/enlargevideo?file=' + file
})
}
}
}
</script>
......@@ -134,14 +134,13 @@
<floatbutton :list='list' openIcon='https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/fabupyq.png'
background='#40766E' openText='发布' bottom='80' @click='btnclick'></floatbutton>
<u-empty v-if="g.length == 0" text="暂无动态" mode="list"></u-empty>
<view v-if="g.length > 0" style="
height: calc(100vh-60px);
width: calc(100vw);
<view v-if="g.length > 0" style="
height: calc(100vh - 60px);width: calc(100vw)
overflow: hidden;
margin-top: 60px;
">
<scroll-view :scroll-y="true" :enable-back-to-top="true" :enable-flex="true" @scrolltolower="lower" :style="{ height: '100%' }">
<view class="ftBox" v-for="(x, i) in g" :key="i" @click="goteacher(x)">
<view class="ftBox" v-for="(x, i) in g" :key="i" @click="godetails(x)">
<view class="jiazu" v-if="x.YearTime!=''">{{x.YearTime}}</view>
<view class="interDList">
<view class="interDList-left">
......@@ -183,7 +182,7 @@
<video id="myVideo" :src="x.files[0]" style="width: 70px;height: 70px;" :controls='false'
:show-center-play-btn='false'></video>
<view style="width: 100%;height: 100%;position: absolute;left: 0;top: 0;display: flex;align-items: center;justify-content: center;"
@click="enlarge(x)">
@click="enlarge(x.files[0])">
<u-icon name="play-circle-o" :size="50" color="#FFF"></u-icon>
</view>
</view>
......@@ -231,7 +230,7 @@
showAuth: false,
msg: {
pageIndex: 1,
pageSize: 7,
pageSize: 15,
},
mainColor: "",
secondary: '',
......@@ -271,7 +270,8 @@
nowbofo: false,
}
},
created() {
created() {
this.contentHeight = this.$utils.calcContentHeight(-40) + "px";
this.mainColor = this.$uiConfig.mainColor;
this.secondary = this.$uiConfig.secondary;
......@@ -433,7 +433,12 @@
//关闭登录窗口
gbAuth() {
uni.navigateBack()
},
},
godetails(x){//跳入详情
uni.navigateTo({
url: '/pages/friendcircle/mydetails?ID=' + x.id
})
}
}
}
</script>
<style>
.mydetails{
width: 100%;
height: 100vh;
background: #FFFFFF;
}
.mydetails .box{
width: 100%;
padding: 15px;
}
.mydetails .personal{
width: 100%;
display: flex;
flex-direction: row;
align-items: flex-start;
}
.tximg{
width: 45px;
height: 45px;
border-radius: 4px;
overflow: hidden;margin-right: 8px;
}
</style>
<template>
<view class="mydetails">
<u-empty v-if="loading==true" text="网络出现故障" mode="wifi"></u-empty>
<view class="box">
<view class="personal">
<view class="tximg">
<image :src="detial.crearteEmPhoto" mode="aspectFill" style="width: 100%;height: 100%;border-radius: 4px;"></image>
</view>
</view>
</view>
</view>
</template>
<script>
export default{
data(){
return{
articleId:0,
loading:false,
detial:{}
}
},
onLoad(options) {
if(options && options.ID){
this.articleId = options.ID;
this.init()
}
uni.setNavigationBarTitle({
title: 详情,
});
},
methods:{
init(){
this.loading = true;
this.request2({
url: '/api/AppletEducation/DynamicDetial',
data: {articleId:this.articleId}
},
res => {
this.loading = false;
if (res.resultCode == 1) {
this.detial = res.data.data
}
}
);
}
}
}
</script>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment