作者 lihongjuan

1

... ... @@ -85,4 +85,7 @@ export default {
<style scoped>
@import "../../../style/activity.css";
.container{
padding-bottom: 1.2rem;
}
</style>
... ...
... ... @@ -3,24 +3,112 @@
<div class="changeitem flextwo">
<div class="changeitemleft">头像</div>
<div class="changeitemright flexone">
<img src="../../../assets/touxiang.png" alt class="headimg" />
<!-- <img :src="avatar" alt class="headimg" /> -->
<van-uploader
v-model="fileList"
multiple="false"
:after-read="afterRead"
:max-count="1"
/>
<img src="../../../assets/grayrow.png" alt class="yourow" />
</div>
</div>
<div class="changeitem flextwo">
<div class="changeitemleft">头像</div>
<div class="changeitemleft">欧阳娜娜</div>
<div class="changeitemleft">姓名</div>
<div class="changeitemleft">
<input type="text" v-model="username" placeholder="请输入姓名" />
</div>
</div>
<div class="kaishilu" @click="save">保存</div>
</div>
</template>
<script>
import Vue from 'vue';
import { Toast, Uploader } from "vant";
import "vant/lib/index.css";
Vue.use(Toast);
Vue.use(Uploader);
export default {
data() {
return {
username: "",
avatar: "",
fileList:[],
chuanimage:''
};
},
created() {
this.username = this.$route.query.username;
this.avatar = this.$route.query.avatar;
console.log(this.avatar)
let obj={
url:this.avatar
}
this.fileList.push(obj)
},
methods: {
// 上传图片
afterRead(file) {
let that = this;
console.log(file);
console.log(file.length);
var formdata = new FormData();
formdata.append("file", file.file);
var url = "/api/common/upload";
let param = {
id: 1
};
}
that.$uploadFile
.post(url, formdata)
.then(function(res) {
console.log(res);
that.cardzheng = false;
let url = "http://tangyuanji.t.brotop.cn" + res.data.url;
that.avatar=url
that.chuanimage=res.data.url
})
.catch(err => {
console.log(err);
});
},
save() {
let that = this;
var url = "/api/user/profile";
let param = {
avatar: that.chuanimage,
nickname: that.username
};
console.log(param)
that.$axios
.post(url, param)
.then(function(res) {
console.log(res);
Toast("保存成功");
that.$router.go(-1);
})
.catch(function(err) {
console.log(err);
});
}
}
};
</script>
<style scoped>
@import "../../../style/usercenter.css";
.changeitemleft input {
text-align: right;
}
</style>
\ No newline at end of file
... ...
... ... @@ -11,13 +11,66 @@
</div>
<div class="suciabot">
<div class="sucaibtn">加入我们</div>
<div class="sucaibtn" @click="joinus">加入我们</div>
</div>
</div>
</template>
<script>
import { Toast } from 'vant';
export default {
data(){
return{
cpmpany:''
}
},
created(){
this.aboutus()
},
methods:{
aboutus(){
let that = this;
var url = "/api/common/company";
let param = {
};
that.$axios
.post(url, param)
.then(function (res) {
console.log(res);
that.cpmpany=res.data.company
})
.catch(function (err) {
console.log(err);
});
},
joinus(){
this.$router.push({
path: "/applayjoin",
// query: { testId: item.test_student_id }
});
// let that = this;
// var url = "/api/common/contact";
// let param = {
// };
// that.$axios
// .post(url, param)
// .then(function (res) {
// console.log(res);
// Toast("加入成功")
// that.$router.go(-1)
// })
// .catch(function (err) {
// console.log(err);
// });
}
}
}
</script>
... ...
... ... @@ -5,23 +5,129 @@
class="coursenavleft"
:class="selnav == 0 ? 'selactive' : ''"
:data-id="0"
@click="selectnav"
@click="selecttab"
>帖子</div>
<div
class="coursenavleft"
:class="selnav == 1 ? 'selactive' : ''"
:data-id="1"
@click="selectnav"
@click="selecttab"
>课程</div>
<div
class="coursenavleft"
:class="selnav == 2 ? 'selactive' : ''"
:data-id="2"
@click="selectnav"
@click="selecttab"
>活动</div>
</div>
<!-- 帖子 -->
<div>
<van-list
v-model="loading"
:finished="finished"
finished-text="没有更多了"
@load="onLoad"
>
<div class="societyitem" v-for="(item, index) in sortlist" :key="index">
<div class="societytop flextwo">
<div class="societyleft flexone">
<div class="personimg">
<img :src="item.user.avatar" alt />
</div>
<div class="personright">
<div class="personname">{{ item.user.nickname }}</div>
<div class="persondate">{{ item.createtime }}</div>
</div>
</div>
<div class="dingimg" v-if="item.is_top == 1">
<img src="../../../assets/ding.png" alt />
</div>
</div>
<div class="societytext">{{ item.description }}</div>
<div class="societyimg flexone" v-if="item.images_arr.length != 0">
<div
class="societyimgitem"
v-for="(item, indexk) in item.images_arr"
:key="indexk"
@click="previewimg(index, indexk)"
>
<img :src="item" alt />
</div>
</div>
<div class="jianzhengtui flexone">
<div
class="jianzheng flexone"
v-for="(item, index) in item.tags"
:key="index"
>
<div class="jianzhengleft" :style="{ background: item.color }">
#
</div>
<div class="jianzhengright" :style="{ color: item.color }">
{{ item.name }}
</div>
</div>
</div>
<!-- 点赞 -->
<div class="dainzan flexone">
<div class="flexone dianitem" @click="zanclick(index, item)">
<img
src="../../../assets/diankong.png"
alt
class="dianzanimg"
v-if="item.is_good == 0"
/>
<img
src="../../../assets/zan.png"
alt
class="dianzanimg"
v-else
/>
<span class="number">{{ item.good_count }}</span>
</div>
<div class="flexone dianitem" @click="collect(index, item)">
<img
src="../../../assets/starkong.png"
alt
class="dianzanimg"
v-if="item.is_favorite == 0"
/>
<img
src="../../../assets/star.png"
alt
class="dianzanimg"
v-else
/>
<span class="number">{{ item.favorite_count }}</span>
</div>
<div class="flexone dianitem" @click="copytext">
<img src="../../../assets/edit.png" alt class="dianzanimg" />
<!-- <span class="number">复制文本</span> -->
<span
class="number"
v-clipboard:copy="item.description"
v-clipboard:success="onCopy"
>复制</span
>
<!-- v-clipboard:error="onError" -->
</div>
<div class="flexone dianitem" @click="save(item)">
<img src="../../../assets/download.png" alt class="dianzanimg" />
<span class="number">一键保存</span>
</div>
</div>
</div>
</van-list>
<!-- 课程 -->
</div>
<!-- 课程 -->
<div class="coursebox" v-if="selnav ==1">
<div class="courseboxitem">
<div class="coursenameimg">
... ... @@ -80,17 +186,228 @@
</template>
<script>
import Vue from "vue";
import { List, Toast, ImagePreview } from "vant";
Vue.use(ImagePreview);
Vue.use(List);
export default {
data() {
return {
selnav: 0
selnav: 0,
sortlist:[],
loading: false,
finished: false,
page: 1,
this_page: "",
total_page: "",
}
},
created(){
this.getmycourse()
},
methods: {
selectnav(e) {
selecttab(e) {
this.selnav = e.currentTarget.dataset.id;
},
save(item) {
this.images = item.images_arr;
if (this.images.length == 0) {
this.nophoto = true;
} else {
this.index = 0;
this.show = true;
}
},
previewimg(index, indexk) {
console.log(index, indexk);
this.index = indexk;
this.images = this.sortlist[index].images_arr;
this.show = true;
this.startPosition = indexk;
},
nophotoup() {
this.nophoto = false;
},
// 图片预览
onChange(index) {
this.index = index;
},
onCopy(e) {
Toast("复制成功");
},
onLoad() {
let that = this;
console.log(888);
// if (that.page = 1) {
// that.loading = false
// that.finished = false
// }
// 异步更新数据
// setTimeout 仅做示例,真实场景中一般为 ajax 请求
setTimeout(() => {
// for (let i = 0; i < 10; i++) {
// this.list.push(this.list.length + 1);
// }
let newpage = that.page;
newpage++;
that.page = newpage;
that.getsocidtylist();
// 加载状态结束
that.loading = false;
// 数据全部加载完成
if (that.total_page == that.this_page) {
that.finished = true;
}
}, 1000);
},
// 收藏
collect(index, item) {
let that = this;
var url = "/api/user/favorite";
let param = {
type: 3,
favorite_id: item.id
};
that.$axios
.post(url, param)
.then(function(res) {
console.log(res);
if (item.is_favorite == 0) {
item.is_favorite = 1;
that.sortlist[index].is_favorite = 1;
that.sortlist[index].favorite_count =
that.sortlist[index].favorite_count + 1;
Toast("收藏成功");
} else if (item.is_favorite == 1) {
item.is_favorite = 1;
Toast("取消收藏成功");
that.sortlist[index].is_favorite = 0;
that.sortlist[index].favorite_count =
that.sortlist[index].favorite_count - 1;
}
that.sortlist = that.sortlist;
that.$forceUpdate();
})
.catch(function(err) {
console.log(err);
});
},
zanclick(index, item) {
let that = this;
console.log(item.id);
var url = "/api/user/good";
let param = {
type: 1,
good_id: item.id
};
that.$axios
.post(url, param)
.then(function(res) {
console.log(res);
if (item.is_good == 0) {
item.is_good = 1;
that.sortlist[index].is_good = 1;
that.sortlist[index].good_count =
that.sortlist[index].good_count + 1;
Toast("点赞成功");
} else if (item.is_good == 1) {
item.is_good = 1;
Toast("取消点赞成功");
that.sortlist[index].is_good = 0;
that.sortlist[index].good_count =
that.sortlist[index].good_count - 1;
}
that.sortlist = that.sortlist;
that.$forceUpdate();
})
.catch(function(err) {
console.log(err);
});
},
// 复制文本
copytext() {},
selectnav(id, index) {
let that = this;
this.selnav = index;
this.sort_id = id;
that.page = 1;
that.sortlist = [];
that.getsocidtylist();
},
publish() {
this.$router.push({
path: "/publish"
// query: { testId: item.test_student_id }
});
},
// 获取社区列表
getsocidtylist() {
let that = this;
var url = "/api/user/my_favorite_social";
let param = {
page: that.page
};
that.$axios
.post(url, param)
.then(function(res) {
console.log(res);
that.sortlist = that.sortlist.concat(res.data.list);
that.this_page = res.data.this_page;
that.total_page = res.data.total_page;
})
.catch(function(err) {
console.log(err);
});
},
// 获取我的课程
getmycourse(){
let that = this;
var url = "/api/user/my_favorite_lesson";
let param = {
page: that.page
};
that.$axios
.post(url, param)
.then(function(res) {
console.log(res);
})
.catch(function(err) {
console.log(err);
});
},
// 获取我的活动
getmyactivity(){
let that = this;
var url = "/api/user/my_favorite_activity";
let param = {
page: that.page
};
that.$axios
.post(url, param)
.then(function(res) {
console.log(res);
})
.catch(function(err) {
console.log(err);
});
}
}
}
</script>
... ...
... ... @@ -36,7 +36,7 @@
</div>
</div>
<div class="zhibocontent">
<div class="intro flexone">直播简介</div>
<div class="flexone zhibojianjie">直播简介</div>
<div class="zhibotextbox">
<textarea name id cols="30" rows="10" placeholder="预设内容"></textarea>
</div>
... ... @@ -90,7 +90,8 @@
</div>
<!-- 开始录制 -->
<div class="kaishilu">开始录制</div>
<div class="kaishilu" v-if="selcourse==2">开始录制</div>
<div class="kaishilu" v-else>开启</div>
</div>
</template>
... ... @@ -131,6 +132,7 @@ export default {
var minute = e.getMinutes()
console.log(hour)
this.zhibodate = false
this.zhibodte=year+''
},
showdate() {
this.zhibodate = true
... ...
... ... @@ -4,9 +4,9 @@
<div class="usertophead flextwo" @click="changeziliao">
<div class="usertopheadleft flexone">
<div class="userimg">
<img src="../../../assets/touxiang.png" alt />
<img :src="avatar" alt />
</div>
<div class="username">欧阳娜娜</div>
<div class="username">{{username==''?'暂无昵称':username}}</div>
</div>
<img src="../../../assets/grayrow.png" alt class="yourow" />
</div>
... ... @@ -80,10 +80,36 @@ export default {
},
data() {
return {
selnav: 3
selnav: 3,
username:'',
avatar:''
};
},
created(){
this.getuserinfo()
},
methods: {
getuserinfo(){
let that = this;
var url = "/api/user/index";
let param = {
};
that.$axios
.post(url, param)
.then(function (res) {
console.log(res);
that.username=res.data.nickname,
that.avatar=res.data.avatar
})
.catch(function (error) {
console.log(error);
});
},
selcourse(e) {
console.log(37344);
console.log(e);
... ... @@ -91,9 +117,10 @@ export default {
},
// 修改资料
changeziliao() {
let that=this;
this.$router.push({
path: "/changeziliao",
// query: { testId: item.test_student_id }
query: { username: that.username,avatar:that.avatar }
});
},
jump(id) {
... ... @@ -117,7 +144,10 @@ export default {
// 上面跳转
join(id) {
if (id == 1) {
this.$router.push({
path: "/publish"
// query: { testId: item.test_student_id }
});
} else if (id == 2) {
this.$router.push({
path: "/joinus",
... ...
... ... @@ -6,8 +6,11 @@ import router from "./router";
import Vant from "vant";
import "vant/lib/index.css";
import {Toast } from 'vant';
Vue.use(Toast);
Vue.use(Vant);
Vue.config.productionTip = false;
import axios from "./utils/common.js";
... ...
... ... @@ -64,6 +64,7 @@
font-size: 0.28rem;
}
.persondate {
color: #b5bfba;
font-size: 0.24rem;
... ...
... ... @@ -7,6 +7,10 @@
.userimg {
width: 1.52rem;
height: 1.52rem;
border-radius: 50%;
}
.userimg img{
border-radius: 50%;
}
.username {
... ... @@ -14,7 +18,10 @@
font-size: 0.36rem;
margin-left: 0.32rem;
}
.zhibojianjie{
color: #02170b;
font-size: 0.28rem;
}
.usertophead {
padding-bottom: 0.32rem;
border-bottom: 1px solid #eee;
... ... @@ -557,7 +564,7 @@
.activitybox {
margin-bottom: 0.5rem;
margin-top: 1.2rem;
/* margin-top: 1.2rem; */
}
.sucaicourse {
... ... @@ -1464,4 +1471,241 @@
.jianzhong {
padding: 0 0.32rem;
box-sizing: border-box;
}
/* 社区盒子 */
.societyitem {
width: 6.86rem;
background: #ffffff;
border-radius: 0.08rem;
box-shadow: 0 0.26rem 0.44rem 0 rgba(49, 144, 49, 0.08);
padding: 0.24rem 0.26rem;
box-sizing: border-box;
margin: 0.32rem auto 0;
}
.societytop {
position: relative;
}
.personimg {
width: 0.8rem;
height: 0.8rem;
font-size: 0;
border-radius: 50%;
}
.personimg img {
border-radius: 50%;
}
.personname {
color: #02170b;
font-size: 0.28rem;
}
.persondate {
color: #b5bfba;
font-size: 0.24rem;
margin-top: 0.1rem;
}
.dingimg {
width: 0.4rem;
height: 0.6rem;
font-size: 0;
position: absolute;
top: -0.24rem;
right: 0;
}
.personright {
margin-left: 0.16rem;
}
.societytext {
color: #344039;
font-size: 0.32rem;
margin-top: 0.18rem;
}
.societyimg {
flex-wrap: wrap;
margin-top: 0.24rem;
}
.societyimgitem {
width: 2.02rem;
height: 2.02rem;
font-size: 0;
margin-right: 0.09rem;
margin-bottom: 0.16rem;
}
.jianzheng {
width: 1.56rem;
height: 0.44rem;
border-radius: 0.08rem;
font-size: 0.16rem;
line-height: 0.44rem;
margin-top: 0.32rem;
margin-right: 0.2rem;
}
.jianzhengtui {
flex-wrap: wrap;
}
.jianzhengleft {
width: 0.36rem;
height: 0.44rem;
background: #5d9a5c;
color: #fff;
text-align: center;
border-radius: 0.08rem 0 0 0.08rem;
}
.jianzhengright {
width: 1.2rem;
height: 0.44rem;
background: #e6ebe6;
text-align: center;
color: #5d9a5c;
border-radius: 0 0.08rem 0.08rem 0;
}
.dianzanimg {
width: 0.32rem;
height: 0.32rem;
font-size: 0;
}
.number {
color: #7b7b7b;
font-size: 0.2rem;
margin-left: 0.18rem;
margin-top: 0.1rem;
}
.dianitem {
margin-right: 0.38rem;
}
.dainzan {
margin-top: 0.26rem;
}
.gantanimg {
width: 2.4rem;
height: 2.4rem;
background: rgba(50, 50, 51, 0.7);
border-radius: 0.08rem;
position: absolute;
left: 50%;
top: 50%;
text-align: center;
transform: translateX(-50%);
}
.ganimg {
width: 0.72rem;
height: 0.72rem;
margin-top: 0.58rem;
}
.gantantext {
color: #fff;
font-size: 0.28rem;
text-align: center;
margin-top: 0.16rem;
}
.addimg {
width: 0.88rem;
height: 0.88rem;
font-size: 0;
position: absolute;
right: 0.32rem;
bottom: 1.32rem;
}
/* 发布 */
.publishitem {
padding: 0.26rem 0;
box-sizing: border-box;
border-bottom: 1px solid #eee;
}
.publeft {
color: rgba(50, 50, 51, 1);
font-size: 0.28rem;
}
.pubpicker {
position: absolute;
bottom: 0;
left: 0;
width: 100%;
z-index: 99;
}
.kindname {
color: #999999;
font-size: 0.28rem;
/* margin-left: 0.32rem; */
}
.enterkind {
width: 100%;
height: 5rem;
padding: 0.18rem 0;
color: #999999;
font-size: 0.28rem;
box-sizing: border-box;
}
.enterkind textarea {
width: 100%;
border: none;
outline: none;
}
.pubimg {
width: 1.78rem;
height: 1.78rem;
font-size: 0;
}
.pubsuccess {
width: 6.22rem;
height: 2.72rem;
background: #ffffff;
border-radius: 0.08rem 0.08rem 0 0;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
.pubsuccessname {
color: #323233;
font-size: 0.28rem;
text-align: center;
padding: 0.68rem 0.48rem 0.68rem;
box-sizing: border-box;
border-bottom: 1px solid #eee;
}
.pubsure {
height: 0.96rem;
text-align: center;
line-height: 0.96rem;
color: #4f874f;
text-align: center;
font-size: 0.28rem;
}
\ No newline at end of file
... ...