Commit 4c21aff1 by yanju

完成动态的发布

parent c5bd55d2
# ASSETS
**This directory is not required, you can delete it if you don't want to use it.**
This directory contains your un-compiled assets such as LESS, SASS, or JavaScript.
More information about the usage of this directory in [the documentation](https://nuxtjs.org/guide/assets#webpacked).
No preview for this file type
......@@ -6,6 +6,13 @@
"description": "",
"glyphs": [
{
"icon_id": "13653653",
"name": "edit2",
"font_class": "yun-icon--edit2",
"unicode": "e639",
"unicode_decimal": 58937
},
{
"icon_id": "13476732",
"name": "logo_download",
"font_class": "yun-icon--logo_download",
......
......@@ -20,6 +20,9 @@ Created by iconfont
/>
<missing-glyph />
<glyph glyph-name="yun-icon--edit2" unicode="&#58937;" d="M1035.425384-128h-321.338913a35.704324 35.704324 0 0 0 0 71.408647h321.338913a35.704324 35.704324 0 0 0 0-71.408647zM54.377685-128a54.663319 54.663319 0 0 0-38.453557 15.709902 52.878103 52.878103 0 0 0-14.281729 50.807253l54.377685 214.225941a53.556485 53.556485 0 0 0 14.281729 24.993027L750.040725 847.120781a171.773501 171.773501 0 0 0 240.040168 0 165.560948 165.560948 0 0 0 0-236.398326L310.34198-58.733611999999994a54.663319 54.663319 0 0 0-25.278661-14.067504l-217.510739-53.556485a54.948954 54.948954 0 0 0-13.174895-1.642399z m103.542538 240.361506l-28.777685-113.21841 114.967922 28.313529L913.17378 686.451325a59.483403 59.483403 0 0 1 0 84.940586 63.08954 63.08954 0 0 1-86.225942 0z" horiz-adv-x="1071" />
<glyph glyph-name="yun-icon--logo_download" unicode="&#58936;" d="M512.515638-127.99865299999999a511.999326 511.999326 0 0 0-199.410264 983.766285 512.187958 512.187958 0 0 0 398.820528-943.533917A508.765646 508.765646 0 0 0 512.515638-127.99865299999999zM259.911339 329.51316599999996a17.354082 17.354082 0 0 1-16.869031-17.758292v-179.496185a17.946924 17.946924 0 0 1 5.200836-12.853878 16.1684 16.1684 0 0 1 11.587353-4.904414h505.316387a17.327135 17.327135 0 0 1 16.842084 17.758292v179.496185a17.327135 17.327135 0 0 1-16.842084 17.758292h-33.684166a17.327135 17.327135 0 0 1-16.842083-17.758292v-125.601519h-404.209994v125.601519a17.354082 17.354082 0 0 1-16.869031 17.758292z m108.328278 111.103854a10.320829 10.320829 0 0 1-9.943566-7.787779 11.048407 11.048407 0 0 1 2.452208-10.293881l139.452448-151.336222a17.084609 17.084609 0 0 1 12.476615-5.524203 16.1684 16.1684 0 0 1 11.31788 4.634941 3.422311 3.422311 0 0 1 0.485052 0.511999v0.161684l139.53329 151.390117a11.263985 11.263985 0 0 1 1.643787 12.961667 10.024408 10.024408 0 0 1-8.730936 5.389467h-100.001552V635.715711A17.327135 17.327135 0 0 1 540.08276 653.474003h-55.188138a17.327135 17.327135 0 0 1-16.842083-17.758292V440.590073z" horiz-adv-x="1024" />
......
No preview for this file type
img { -webkit-touch-callout: none; }
*:not(input,textarea), *:before:not(input,textarea), *:after:not(input,textarea) {
-webkit-user-select: none;
}
input{
outline:none;
......
......@@ -221,7 +221,7 @@
handleLoading(){
this.loaddingTime = setTimeout(()=>{
this.loading = false;
},2000)
},509)
}
},
......
......@@ -32,11 +32,16 @@ function TouchEvent(el,binding,type) {
let appendDiv = document.createElement('div');
let appendDivTimer = null;
appendDiv.style.cssText='position:fixed;top:0;left:0;z-index:10000;height:100%;width:100%;background:transparent';
document.body.appendChild(appendDiv);
appendDivTimer = setTimeout(()=>{
document.body.removeChild(appendDiv);
clearTimeout(appendDivTimer)
},350)
if(e.target.localName.toLowerCase()==='a'||e.target.localName.toLowerCase()==='video'||e.target.localName.toLowerCase()==='button'||e.target.localName.toLowerCase()==='input'||e.target.localName.toLowerCase()==='textarea'){
}else{
document.body.appendChild(appendDiv);
appendDivTimer = setTimeout(()=>{
document.body.removeChild(appendDiv);
clearTimeout(appendDivTimer)
},350)
}
var disX=e.changedTouches[0]?e.changedTouches[0].pageX-_this.vueTouches.x:0;
var disY=e.changedTouches[0]?e.changedTouches[0].pageY-_this.vueTouches.y:0;
clearTimeout(_this.time);
......
......@@ -7,40 +7,40 @@
:margin-v="[0,'auto']"
:flex-v="['column','flex-start','flex-start']"
:border-v="[1,'solid','#EFEFEF','bottom']"
slot="card">
slot="card"
@tap="changeRoute1(routesObject.answer.detail+questionId)"
>
<yun-div
:flex-v="['row','flex-start','center']"
:font-style="[30,40,500,'#333','left']"
:font-style="[30,48,500,'#333','left']"
:ske-w="704"
:skeH="40"
> <yun-div :no-wrap="true" :extend-style="{maxWidth: commonReturnFlexedLength(596)}">
大家期望咱们的手机版有什么功能哇?
</yun-div>
<yun-div>
<yun-icon
:width-v="30"
:height-v="30"
:border-r="[4]"
:margin-v="[0,8,0,16]"
:padding-v="[8,8.5]"
bg-color-v="#FF7474"
name="hot"
:size="20"
color="#fff">
</yun-icon>
<yun-icon
:width-v="30"
:height-v="30"
:padding-v="[8,8.5]"
:border-r="[4]"
bg-color-v="#00AAE6"
name="top"
:size="20"
color="#fff">
</yun-icon>
>
{{questionTitle}}
<yun-icon
:width-v="30"
:height-v="30"
:border-r="[4]"
:margin-v="[0,8,0,16]"
name="hot"
:size="30"
color="#FF7474"
v-if="viewNumber>20"
>
</yun-icon>
<yun-icon
:width-v="30"
:height-v="30"
:border-r="[4]"
name="top"
:size="30"
color="#00AAE6"
v-if="priority>0">
</yun-icon>
</yun-div>
</yun-div>
<yun-div
:font-style="[20,27,500,'#666','left']"
......@@ -48,10 +48,10 @@
:skeW="500"
:skeH="27"
>
26回答
<span>·</span>
<span style="color:#75D098;">已采纳:</span>
<span>卸载重下就好了</span>
{{replyNumber}}回答
<span >创建于{{createTime}}</span>
<span style="color:#75D098;" v-if="solved">已解决</span>
<!-- <span>卸载重下就好了</span>-->
</yun-div>
</yun-div>
</yun-slider>
......@@ -62,10 +62,107 @@ import commonMixin from "./commonMixin";
export default {
mixins: [commonMixin],
props:{
//cardType: String,
info:{
type:Object,
default: () => ({})
},
isMy:{
type:Boolean,
default:false
}
},
data() {
return{
questionAbstract:'',
questionId:'',
questionTitle:'',
replyNumber:'',
solved:'',
createTime:'',
tags:[],
userNick:'',
viewNumber:'',
showCard:true,
status:0,
praiseNum:0,
priority:0,
}
},
created(){
this.dateGet2Info();
},
methods:{
dateGet2Info(){
let info = this.info;
if(this.info.questionId){
this.questionAbstract = info.questionAbstract;
this.questionId = info.questionId;
this.questionTitle = info.questionTitle;
this.replyNumber = info.replyNumber;
this.solved = info.solved;
this.createTime = this.dateConvert(info.createTime);
this.tags = info.tags;
this.userNick = info.userNick;
this.viewNumber = info.viewNumber;
this.status = info.status;
this.praiseNum = info.praiseNum;
this.priority = info.priority;
}
if(this.info.itemId){
this.questionTitle = info.title;
this.questionAbstract = info.description;
this.questionId = info.itemId;
this.createTime = dateConvert(info.createTime);
this.userNick = info.author;
this.replyNumber = info.extra?info.extra.replyNumber:0;
this.solved = info.extra?info.extra.solved:false;
}
},
showAlert(id){
this.$alert('确认删除?', '', {
confirmButtonText: '确定',
callback: action => {
this.dataDeleteItem(id)
}
});
},
dataDeleteItem(id){
this.$axios.$delete(config.api.delete.Question.delete+id).then((response)=>{
if(response.code===0){
this.showCard=false;
this.$message({
type:'success',
message:'项目删除成功!'
})
}else{
this.$message({
type:'warning',
message:'项目删除失败!'
})
}
})
},
changeRoute(r){
let routeUrl = this.$router.resolve({
path: "/answer/detail/"+r
});
window.open(routeUrl.href,'_blank')
}
}
}
</script>
<style scoped>
<style lang="scss" scoped>
span{
margin-right:10*$length
}
</style>
......@@ -19,13 +19,14 @@
height-v="100%"
>
<user-card
v-if="cardType!=='news'"
:avatar-size="64"
:padding-v="[35,0]"
:show-border="false"
:user-id="userId"
></user-card>
<yun-div
:padding-v="[0,paddingL]"
:padding-v="[cardType==='news'?20:0,paddingL,0]"
:font-style="[42,56,400,'#333','left']"
>
{{cardName}}
......@@ -41,6 +42,7 @@
{{cardTime}}
</yun-div>
<yun-div
v-if="cardType!=='news'"
:font-style="[20,27,400,'#999','center']"
>
<yun-icon name="like1"
......@@ -58,6 +60,12 @@
color="#ccc"></yun-icon>
<span>{{cardView}}</span>
</yun-div>
<yun-div
v-if="cardType==='news'"
:font-style="[20,27,400,'#999','center']"
>
本文编辑:{{cardUser}}
</yun-div>
</yun-div>
<yun-div
:width-v="704"
......@@ -95,7 +103,9 @@
:position-v="[undefined,0,0,0]"
>
<send-box
card-type="blog"
v-if="cardType!=='news'"
:card-type="cardType"
:card-view="cardView"
:praise-num="praiseNum"
:card-id="cardId"
......@@ -172,12 +182,12 @@
this.contentHtml = info.contentHtml;
this.cardIntro = info.blogAbstract;
this.cardId = info.blogId;
this.cardType = 'blog';
this.src = info.cover;
this.cardTags = info.tags;
this.cardTime = this.dateConvert(info.createTime);
this.cardView = info.viewNumber;
this.cardUser = info.userNick;
this.cardType = 2;
this.status = info.status;
this.praiseNum =info.praiseNum;
this.priority = this.$route.query.type==='all'?info.priority:info.categoryPriority;
......@@ -186,20 +196,24 @@
}
if(this.info.projectId){
this.cardName = info.projectName;
this.cardIntro = info.projectDescription;
this.originLink = info.originLink;
this.userId = info.userId;
this.commentNumber = info.commentNumber;
this.contentHtml = info.contentHtml;
this.cardIntro = info.blogAbstract;
this.cardId = info.projectId;
this.cardType = 'project';
this.src = info.cover;
this.cardView = info.viewNumber;
this.cardTags = info.tags;
this.cardTime = this.dateConvert(info.createTime);
this.cardUser = info.author;
this.cardType = 1;
this.status = info.status;
this.praiseNum =info.praiseNum;
this.priority = info.priority||info.categoryPriority;
this.detailPath = this.routesObject.project.detail+info.projectId;
this.praised = this.routesObject.project.praised;
this.praised = info.praised;
}
......@@ -209,12 +223,31 @@
this.cardId = info.contentId;
this.cardView = info.viewNumber;
this.src = info.cover;
this.cardType = 'news';
this.cardTime = this.dateConvert(info.createTime);
this.cardUser = info.author;
this.cardType = 3;
this.contentHtml = info.content;
this.detailPath = this.routesObject.news.detail+info.contentId;
}
if(this.info.questionId){
this.cardName = info.questionTitle;
this.cardIntro = info.questionAbstract;
this.cardId = info.questionId;
this.cardView = info.viewNumber;
this.userId = info.userId;
this.cardType = 'answer';
this.commentNumber = info.replyNumber;
this.contentHtml = info.contentHtml;
this.src = info.cover;
this.cardTags = info.tags;
this.cardTime = this.dateConvert(info.createTime);
this.cardUser = info.userNick;
this.praiseNum =info.praiseNum;
this.priority = info.priority||info.categoryPriority;
this.detailPath = this.routesObject.answer.detail+info.questionId;
this.praised = info.praised;
}
},
}
}
......
......@@ -6,6 +6,7 @@
:flex-v="['row','space-between','flex-start']"
>
<yun-img
:load-by-scroll="false"
:width-v="70"
:height-v="70"
:ske-h="70"
......@@ -48,8 +49,8 @@
<yun-div
:font-style="[20,32,400,'#999','left']"
>
<span v-if="totalRecords" @click="showCommentInput=!showCommentInput">回复({{totalRecords}})</span>
<span v-if="!totalRecords" @click="showCommentInput=!showCommentInput">回复</span>
<span v-if="totalRecords" v-tap="tapCommentInput">回复({{totalRecords}})</span>
<span v-if="!totalRecords" v-tap="tapCommentInput">回复</span>
<span v-tap="dataDeleteComment" v-if="this.info.userId ===$store.state.userProfile.userId">删除</span>
</yun-div>
</yun-div>
......@@ -58,7 +59,7 @@
<yun-div
:flex-v="['row','space-between','center']"
:margin-v="[10,0,0]"
:margin-v="[20,0,0]"
v-if="showCommentInput"
>
......@@ -188,6 +189,11 @@
},
methods:{
tapCommentInput(){
this.showCommentInput=!this.showCommentInput
},
dataPostComment1(){
if(!this.$store.state.auth.token){
this.$message({
......
......@@ -10,6 +10,7 @@
:flex-v="['row','space-between','flex-start']"
>
<yun-img
:load-by-scroll="false"
:width-v="70"
:height-v="70"
:ske-h="70"
......@@ -51,8 +52,8 @@
<yun-div
:font-style="[20,32,400,'#999','right']"
>
<span v-if="totalRecords" @click="showCommentInput=!showCommentInput">回复({{totalRecords}})</span>
<span v-if="!totalRecords" @click="showCommentInput=!showCommentInput">回复</span>
<span v-if="totalRecords" v-tap="tapCommentInput">回复({{totalRecords}})</span>
<span v-if="!totalRecords" v-tap="tapCommentInput">回复</span>
<span v-tap="dataDeleteComment" v-if="this.info.userId ===$store.state.userProfile.userId">删除</span>
</yun-div>
</yun-div>
......@@ -60,7 +61,7 @@
<yun-div
:flex-v="['row','space-between','center']"
:margin-v="[10,0,0]"
:margin-v="[20,0,0]"
v-if="showCommentInput"
>
......@@ -182,6 +183,10 @@
methods:{
tapCommentInput(){
this.showCommentInput=!this.showCommentInput
},
dataPostComment2(){
if(!this.$store.state.auth.token){
this.$message({
......
......@@ -10,6 +10,8 @@
:flex-v="['row','space-between','flex-start']"
>
<yun-img
:load-by-scroll="false"
:width-v="70"
:height-v="70"
:ske-h="70"
......
......@@ -182,6 +182,8 @@
},
dataGetComment(){
console.log(this.type);
if(!this.id){
return false
}
......
......@@ -73,7 +73,7 @@
:margin-v="[0,0,0,60]"
:height-v="60"
:flex-v="['column','flex-space','center']"
v-tap="()=>changeRoute1(routesObject.blog.comment+cardId)"
@tap="changeRoute1(commentRoute+cardId)"
>
<yun-div
:font-style="[20,30,400,'#999','center']"
......@@ -144,6 +144,7 @@
praiseNum1:0,
cardView1:0,
commentNumber1:0,
commentRoute:'',
}
},
props:{
......@@ -185,21 +186,39 @@
commentNumber(val){
this.commentNumber1 = val;
},
cardType(val){
this.handleCardType(val);
}
},
created() {
console.log(this.praiseNum,this.cardView,this.commentNumber)
this.praised1 = this.praised;
this.praised1 = this.praised;
this.praiseNum1 = this.praiseNum||0;
this.cardView1 = this.cardView||0;
this.commentNumber1 = this.commentNumber||0;
this.handleCardType(this.cardType)
if(process.browser){
window.addEventListener('click',this.listenClick)
}
},
methods:{
handleCardType(val){
if(val==='blog'){
this.commentRoute = this.routesObject.blog.comment
}
if(val==='answer'){
this.commentRoute = this.routesObject.answer.comment
}
if(val==='project'){
this.commentRoute = this.routesObject.project.comment
}
if(val==='dynamic'){
this.commentRoute = this.routesObject.dynamic.comment
}
},
listenClick(e){
if(this.$refs.commentCard){
if(!this.$refs.commentCard.contains(e.target)){
......
......@@ -18,7 +18,7 @@
:ske-h="80"
:ske-w="80"
:border-r="[40]"
:src="src"
:src="userAvatar"
></yun-img>
<yun-div
......@@ -37,7 +37,7 @@
:ske-w="120"
:font-style="[30,40,400,'#333','left']"
>
{{name}}
{{userNick}}
</yun-div>
<yun-div
......@@ -50,22 +50,25 @@
<yun-div
:font-style="[28,37,400,'#AAA','left']"
:show-ske="false"
v-if="false"
v-if="followedAuthor&&$store.state.userProfile.userId!==userId"
>
<yun-icon name="right" color="#AAA" :size="28"></yun-icon>
已关注
</yun-div>
<!-- 未关注状态-->
<yun-div
v-if="!followedAuthor"
:flex-v="['row','center','center']"
@tap="dataPostFollowUser"
>
<yun-div
:font-style="[28,37,400,'#75D098','left']"
:show-ske="false"
v-if="!followLoading"
>
+
</yun-div>
<yun-indicator :height-v="28" color="#75D098" :size="28" v-if="false"></yun-indicator>
<yun-indicator :height-v="28" color="#75D098" :size="28" v-if="followLoading"></yun-indicator>
<yun-div
:font-style="[28,37,400,'#75D098','left']"
:show-ske="false"
......@@ -101,7 +104,7 @@
:padding-v="[28,0,0]"
class="content-word"
>
内容文本部分内容文本部分内容文本部分内容文本部分内容文本部分内容文本部分内容文本部分
<p class="content-word" v-html="content"></p>
</yun-div>
<!-- 内容图片部分-->
......@@ -113,7 +116,7 @@
v-for="(value,index) in imgArr2"
:key="value+index"
v-if="false"
@click="clickToOpenBanner(index)"
@tap="clickToOpenBanner(index)"
>
<yun-img
:width-v="404"
......@@ -133,7 +136,7 @@
:key="value+index"
v-if="false"
@click="clickToOpenBanner(index)"
@tap="clickToOpenBanner(index)"
>
<yun-img
:width-v="404"
......@@ -154,7 +157,7 @@
>
<yun-div
@click="clickToOpenBanner(index)"
@tap="clickToOpenBanner(index)"
:width-v="164"
:height-v="164"
:ske-h="164"
......@@ -196,7 +199,7 @@
:margin-v="[0,(index+1)%3===0?0:16,16,0]"
:flex-v="['row','center','center']"
@click.native="clickToOpenBanner(index)"
@tap="clickToOpenBanner(index)"
>
<yun-img
width-v="auto"
......@@ -389,7 +392,7 @@
}
},
created(){
// this.dateGet2Info();
this.dateGet2Info();
// this.dataGetPraiseList();
if(process.browser){
document.addEventListener('click',(e)=>{
......@@ -589,6 +592,7 @@
<style lang="scss">
.content-word{
word-break: break-all;
a{
color:$primaryColor;
}
......
......@@ -24,13 +24,11 @@
v-for="(item, index) in navList"
:flex-v="['column','flex-start','center']"
:key="item.id"
:font-style="[28,36,400,'#999','left']"
:show-ske="false"
@tap="changeRoute1(path?path+'?type='+item.id:item.path)"
>
<nuxt-link
style="color: #999;"
:to="path ? {path: path, query: {type: item.id}} : {path: item.path}"
>
{{item.label}}
</nuxt-link>
<yun-div
:width-v="16"
:height-v="4"
......@@ -89,7 +87,7 @@
<script>
import commonMixin from "./commonMixin";
import {isRealNum} from '../../action/utils'
export default {
mixins: [commonMixin],
......@@ -133,10 +131,18 @@ export default {
},
methods: {
handleLabelRoute(id) {
this.actived = id
if(!isNaN(Number(id))){
console.log(1)
this.actived = Number(id)
}else{
console.log(2)
this.actived = id
}
},
handlePathRoute(path) {
this.actived = path
this.actived = path
},
handleSort() {
this.showSort = !this.showSort
......
......@@ -7,7 +7,9 @@
position:'fixed',
maxWidth:'750px',
boxSizing:'border-box',
zIndex:headerZIndex
zIndex:headerZIndex,
boxShadow:`0 ${1*heightRate}px 0 rgba(0,0,0,.1)`,
}"
:width-v="750"
:position-v="[0,0,undefined,0]"
......@@ -27,6 +29,7 @@
:ske-w="153"
:ske-h="52"
:show-ske="false"
v-tap="()=>navTapToChangeRoute1('/')"
:src="BCLogo">
</yun-img>
<!--search-->
......@@ -48,10 +51,10 @@
:border-v="[1,'solid',commonReturnPrimaryColor(0.2)]"
>
<yun-icon name="user"
v-tap="()=>changeRoute1(routesObject.login)"
v-tap="()=>navTapToChangeRoute1(routesObject.login)"
:size="28" v-if="!$store.state.userProfile.userId"></yun-icon>
<yun-img
v-tap="()=>changeRoute1(routesObject.personalCenter.index)"
v-tap="()=>navTapToChangeRoute1(routesObject.personalCenter.index)"
:height-v="56"
:width-v="56"
:src="$store.state.userProfile.avatar"
......
......@@ -27,31 +27,27 @@
</span>
<yun-icon
v-if="cardView>=20"
:width-v="30"
:height-v="30"
:border-r="[4]"
:margin-v="[0,8,0,16]"
:padding-v="[8,8.5]"
bg-color-v="#FF7474"
name="hot"
:size="20"
color="#fff"></yun-icon>
<yun-icon
v-if="priority>0">
:width-v="30"
:height-v="30"
:padding-v="[8,8.5]"
:border-r="[4]"
bg-color-v="#00AAE6"
name="top"
:size="20"
color="#fff">
</yun-icon>
<yun-icon
:width-v="30"
:height-v="30"
:border-r="[4]"
:margin-v="[0,8,0,16]"
name="hot"
:size="30"
color="#FF7474"
v-if="cardView>20"
>
</yun-icon>
<yun-icon
:width-v="30"
:height-v="30"
:border-r="[4]"
name="top"
:size="30"
color="#00AAE6"
v-if="priority>0">
</yun-icon>
</yun-div>
<yun-div
......
<template>
<yun-slider>
<yun-div
v-if="cardId"
:width-v="704"
:margin-v="[0,'auto']"
:padding-v="[40,0]"
:padding-v="[40,paddingL]"
bg-color-v="#fff"
:flex-v="['row','flex-start','flex-start']"
:border-v="[1,'solid','#EFEFEF','bottom']"
slot="card"
>
<yun-div :ske-h="100" :width-v="100" :flex-v="['row', 'space-between','flex-start']" :flex-wrap="true">
<yun-div :width-v="48" :height-v="48" bg-color-v="#B4DDDE" v-if="imgSrc === ''" :border-r="[4]"></yun-div>
<yun-div :width-v="48" :height-v="48" bg-color-v="#E0BDBD" v-if="imgSrc === ''" :border-r="[4]"></yun-div>
<yun-div :width-v="48" :height-v="48" bg-color-v="#9FBBC9" v-if="imgSrc === ''" :margin-v="[4,0,0,0]" :border-r="[4]"></yun-div>
<yun-div :width-v="48" :height-v="48" bg-color-v="#A6E2B6" v-if="imgSrc === ''" :margin-v="[4,0,0,0]" :border-r="[4]"></yun-div>
<yun-img :src="imgSrc" v-if="imgSrc !== ''" :width-v="100" :height-v="100" :border-r="[8]" :ske-w="100" :ske-h="100"></yun-img>
<yun-div :width-v="48" :height-v="48" bg-color-v="#B4DDDE" v-if="!topicIcon" :border-r="[4]"></yun-div>
<yun-div :width-v="48" :height-v="48" bg-color-v="#E0BDBD" v-if="!topicIcon" :border-r="[4]"></yun-div>
<yun-div :width-v="48" :height-v="48" bg-color-v="#9FBBC9" v-if="!topicIcon" :margin-v="[4,0,0,0]" :border-r="[4]"></yun-div>
<yun-div :width-v="48" :height-v="48" bg-color-v="#A6E2B6" v-if="!topicIcon" :margin-v="[4,0,0,0]" :border-r="[4]"></yun-div>
<yun-img :src="topicIcon" v-if="topicIcon" :width-v="100" :height-v="100" :border-r="[8]" :ske-w="100" :ske-h="100"></yun-img>
</yun-div>
<yun-div :margin-v="[0,0,0,16]">
<yun-div :ske-w="588" :width-v="588" :font-style="[36,48,500,'#333','left']" :flex-v="['row','space-between','center']">
<span># 设计 #</span>
<span @click="handelFocus" :style="{fontSize:commonReturnFlexedLength(28),flexShrink: 0}">{{focus ? '取消关注' : '+关注'}}</span>
<span># {{cardName}} #</span>
<yun-div
v-if="!followedTopic&&!from&&userId!==$store.state.userProfile.userId"
@tap="dataPostFollowTopic"
:ske-w="150"
:font-style="[24,48,500,'#55B946','left']"
:flex-v="['row','center','center']"
:show-ske="false"
:no-flex-shrink="true"
:class="{active: focus}">
<span v-if="!loading">+</span>
<yun-indicator v-if="loading" :width-v="32" :height-v="32" color="#55B946"></yun-indicator>
关注
</yun-div>
<yun-div
v-if="!followedTopic&&!from&&userId===$store.state.userProfile.userId"
:show-ske="false"
:font-style="[24,48,500,'#9FBBC9','left']"
:no-flex-shrink="true"
>
我的话题
</yun-div>
<yun-div
v-if="followedTopic||from"
@tap="dataDeleteFollowTopic"
:ske-w="150"
:show-ske="false"
:no-flex-shrink="true"
:font-style="[24,48,500,'#999','left']"
:flex-v="['row','center','center']"
:class="{active: focus}">
<yun-icon v-if="!loading" name="right"></yun-icon>
<yun-indicator v-if="loading" :width-v="32" :height-v="32" color="#999"></yun-indicator>
已关注
</yun-div>
</yun-div>
<yun-div :font-style="[20,27,500,'#999','left']" :margin-v="[15,0,0,0]">56万讨论·1.5亿阅读</yun-div>
<yun-div :font-style="[20,27,500,'#999','left']" :margin-v="[15,0,0,0]">{{cardIntro}}{{cardNum1}}讨论</yun-div>
</yun-div>
</yun-div>
</yun-slider>
</template>
<script>
import commonMixin from "./commonMixin";
import config from "../../action/config";
export default {
mixins: [commonMixin],
data() {
return {
imgSrc: '',
focus: false
props:{
activeRouteFunc:{
type:Boolean,
default:true
},
info:{
type:Object,
default:()=>({})
},
from:{
type:String,
default:''
}
},
computed:{
showFollowedTopic(){
return !!(this.followedTopic || this.from==='notice');
}
},
data(){
return{
isPhoto: true,
src: 'http://i1.sinaimg.cn/ent/d/2008-06-04/U105P28T3D2048907F326DT20080604225106.jpg',
focus: '+关注',
fontColor: '#55B946',
cardName:'',
cardIntro:'',
cardId:'',
cardTags:[],
cardTime:'',
cardNum1:'',
userId:'',
topicIcon:'',
loading : false,
followedTopic:false
}
},
created(){
this.dateGet2Info();
},
methods:{
dateGet2Info(){
let info = this.info;
if(this.info.topicId){
this.cardName = info.topicName;
this.cardIntro = info.topicDescrption;
this.cardId = info.topicId;
this.userId = info.userId;
this.src = info.cover;
this.topicIcon = info.topicIcon;
this.cardTags = info.tags;
this.cardTime = this.dateConvert(info.createTime);
this.cardNum1 = info.referenceCount;
this.followedTopic = info.followedTopic;
}
if(this.info.itemId){
this.cardName = info.title;
this.cardIntro = info.description;
this.cardId = info.itemId;
this.src = info.cover;
this.cardNum1 =info.extra? info.extra.referenceCount:'';
this.cardTime = dateConvert(info.createTime);
}
},
dataPostFollowTopic(){
this.loading = true;
this.$axios.$post(config.api.post.Topic.follow+this.cardId+'/follower').then((response)=>{
if(response.code===0){
this.$message({
type:'success',
message:'关注成功'
})
this.followedTopic = true;
}else{
this.$message({
type:'info',
message:'请在登陆后操作'
})
}
this.loading = false;
})
},
dataDeleteFollowTopic(){
this.loading = true;
this.$axios.$delete(config.api.post.Topic.follow+this.cardId+'/follower').then((response)=>{
this.loading = false;
if(response.code===0){
this.$message({
type:'success',
message:'取消关注成功'
})
if(this.from==='notice'){
this.cardId = ''
}
this.followedTopic = false;
}else{
this.$message({
type:'info',
message:'请在登陆后操作'
})
}
})
}
},
methods: {
handelFocus() {
this.focus = !this.focus
watch:{
info(val){
this.dateGet2Info();
}
}
}
......
......@@ -23,27 +23,34 @@
:ske-h="102"
:ske-w="102"
:border-r="[50,50,50,50]"
src=""
:src="userAvatar"
></yun-img>
<yun-div
:style="{marginLeft: commonReturnFlexedLength(25)}"
:height-v="102"
:flex-v="['column','space-between','flex-start']"
>
<yun-div :font-style="[36,36]" :ske-w="150" :ske-h="50">激动啊</yun-div>
<yun-div :font-style="[24,36,400,'#999999']" :width-v="400" :no-wrap="true" :ske-h="40">设计设计的力量设计的力量的力量设计的力量</yun-div>
<yun-div :font-style="[36,36]" :ske-w="150" :ske-h="50">{{nickName}}</yun-div>
<yun-div :font-style="[24,36,400,'#999999']" :width-v="400" :no-wrap="true" :ske-h="40">{{signature}}</yun-div>
</yun-div>
</yun-div>
<yun-div
:height-v="102"
:font-style="[24,36,400,'#999999','left']"
:flex-v="['row','flex-start','center']"
:show-ske="false"
>
账号资料
<yun-icon
:style="{marginLeft:commonReturnFlexedLength(15)}"
name="left_arrow"
></yun-icon>
<yun-div
@tap="changeRoute1(userId1===$store.state.userProfile.userId?routesObject.personalCenter.index:routesObject.homePage+userId1+'/blog')"
>账号资料</yun-div>
<yun-div>
<yun-icon
:style="{marginLeft:commonReturnFlexedLength(15)}"
:size="20"
name="left_arrow"
></yun-icon>
</yun-div>
</yun-div>
</yun-div>
<yun-div
......@@ -52,6 +59,8 @@
>
<yun-div
:flex-v="['column','space-between','center']"
@tap="changeRoute1(userId1===$store.state.userProfile.userId?routesObject.personalCenter.person:routesObject.homePage+userId1+'/following')"
>
<yun-div
:ske-h="60"
......@@ -61,10 +70,12 @@
</yun-div>
<yun-div
:font-style="[36,60,500,'black','center']"
>1223</yun-div>
>{{statistics.followedNum}}</yun-div>
</yun-div>
<yun-div
:flex-v="['column','space-between','center']"
@tap="changeRoute1(userId1===$store.state.userProfile.userId?routesObject.personalCenter.person:routesObject.homePage+userId1+'/blog')"
>
<yun-div
:ske-h="60"
......@@ -74,20 +85,23 @@
</yun-div>
<yun-div
:font-style="[36,60,500,'black','center']"
>123</yun-div>
>{{statistics.visitedNum}}</yun-div>
</yun-div>
<yun-div
:flex-v="['column','space-between','center']"
@tap="changeRoute1(userId1===$store.state.userProfile.userId?routesObject.personalCenter.person:routesObject.homePage+userId1+'/fans')"
>
<yun-div
:ske-h="60"
:font-style="[24,36,400,'#999999','center']"
>
粉丝
</yun-div>
<yun-div
:font-style="[36,60,500,'black','center']"
>153</yun-div>
>{{statistics.fansNum}}</yun-div>
</yun-div>
</yun-div>
......@@ -95,14 +109,173 @@
</template>
<script>
import commonMixin from "./commonMixin";
import config from "../../action/config";
export default {
mixins:[commonMixin],
name: "userCardBig"
name: "userCardBig",
data() {
return {
userAvatar:'',
userId1:"",
nickName:'',
gender:0,
signature:'',
projectNum:6,
blogNum:6,
answerNum:6,
popularity:6,
follow:7,
fans:7,
statistics:{},
followLoading:false,
followedUser:false,
}
},
props:{
avatarSize:{
default:90,
type:Number,
},
showBorder:{
default:true,
type:Boolean,
},
paddingV:{
default:()=>([40,0]),
type:Array,
},
userId:{
type:String,
default:'',
},
from:{
type:String,
default:'',
},
info:{
type:Object,
default:()=>({})
},
},
created(){
if(this.info.nickName||this.info.userNick){
this.dataGet2UserInfo();
}else {
this.dataGetUserInfo();
}
},
watch:{
userId(){
if(this.info.nickName||this.info.userNick){
this.dataGet2UserInfo();
}else {
this.dataGetUserInfo();
}
},
},
methods:{
dataGetUserInfo(){
this.followLoading=true;
if(this.userId){
this.$axios.$get(config.api.get.User.otherInfo+this.userId+'/baseinfo').then((response) => {
if(response.code===0){
let data = response.data;
this.userId1 = this.userId;
this.nickName=data.nickName;
this.gender= data.gender;
this.signature = data.signature;
this.userAvatar = data.userAvatar;
this.statistics = data.statistics || {};
this.followLoading=false;
this.followedUser = data.followedUser;
}
})
}
},
dataGet2UserInfo(){
let data = this.info;
this.nickName=data.nickName||data.userNick;
this.userId1 = data.userId;
this.gender= data.gender;
this.signature = data.signature;
this.userAvatar = data.userAvatar;
this.statistics = data.statistics || {};
this.followLoading=false;
this.followedUser = data.followedUser;
},
dataPostToFollow(){
if(!this.$store.state.userProfile.userId){
this.$message({
type:'info',
message:'请在登陆后操作'
})
return false;
}
this.followLoading=true;
this.$axios.$post(config.api.post.User.follow+this.userId1+'/follower').then((response)=>{
if(response.code===0){
this.$message({
type:'success',
message:response.msg
})
this.followedUser = true;
}else{
this.$message({
type:'info',
message:response.msg
})
}
this.followLoading=false;
})
},
dataPostToCancelFollow(){
if(!this.$store.state.userProfile.userId){
this.$message({
type:'info',
message:'请在登陆后操作'
})
return false;
}
this.followLoading=true;
this.$axios.$delete(config.api.delete.User.unfollow+this.userId1+'/follower').then((response)=>{
if(response.code===0){
this.$message({
type:'success',
message:response.msg
})
this.followedUser = false;
}else{
this.$message({
type:'info',
message:response.msg
})
}
this.followLoading=false;
})
},
},
}
</script>
......
<template>
<yun-div
:width-v="704"
:padding-v="paddingV"
:padding-v="[paddingL]"
bg-color-v="#fff"
:margin-v="[0,'auto']"
:flex-v="['row','space-between','center']"
:border-v="[showBorder?1:0,'solid','#EFEFEF','bottom']"
>
<yun-img v-tap="()=>changeRoute1(routesObject.homePage+userId+'/blog')"
<yun-img v-tap="()=>changeRoute1(routesObject.homePage+userId1+'/blog')"
:src="userAvatar" :ske-w="avatarSize" :ske-h="avatarSize" :width-v="avatarSize" :height-v="avatarSize" :border-r="['50%']"></yun-img>
<yun-div :width-v="588" :flex-v="['row','space-between','center']">
<yun-div :flex-v="['column','flex-start','flex-start']">
<yun-div
@tap="changeRoute1(routesObject.homePage+userId+'/blog')"
@tap="changeRoute1(routesObject.homePage+userId1+'/blog')"
:ske-w="100" :font-style="[28,37,500,'#333','left']">{{nickName}}</yun-div>
<yun-div :ske-w="200" :font-style="[20,27,500,'#999','left']" :margin-v="[15,0,0,0]">人气{{statistics.visitedNum}}·粉丝{{statistics.fansNum}}</yun-div>
</yun-div>
......@@ -21,9 +21,7 @@
@tap="dataPostToFollow"
:ske-w="150"
:font-style="[24,90,500,'#55B946','left']"
:flex-v="['row','center','center']"
:class="{active: focus}">
:flex-v="['row','center','center']">
<span v-if="!followLoading">+</span>
<yun-indicator v-if="followLoading" :width-v="32" :height-v="32" color="#55B946"></yun-indicator>
关注
......@@ -33,8 +31,7 @@
@tap="dataPostToCancelFollow"
:ske-w="150"
:font-style="[24,90,500,'#999','left']"
:flex-v="['row','center','center']"
:class="{active: focus}">
:flex-v="['row','center','center']">
<yun-icon v-if="!followLoading" name="right"></yun-icon>
<yun-indicator v-if="followLoading" :width-v="32" :height-v="32" color="#999"></yun-indicator>
已关注
......@@ -51,10 +48,6 @@ export default {
mixins: [commonMixin],
data() {
return {
focus: false,
isLogin: false,
//
userAvatar:'',
userId1:"",
nickName:'',
......@@ -99,11 +92,10 @@ export default {
type:Object,
default:()=>({})
},
nickName1:String
},
created(){
if(this.info.nickName){
if(this.info.nickName||this.info.userNick){
this.dataGet2UserInfo();
}else {
this.dataGetUserInfo();
......@@ -111,21 +103,14 @@ export default {
},
watch:{
userId(){
if(this.nickName1){
if(this.info.nickName||this.info.userNick){
this.dataGet2UserInfo();
}else {
this.dataGetUserInfo();
}
},
nickName1(){
this.dataGet2UserInfo();
}
},
methods:{
handelFocus() {
this.focus = !this.focus
},
dataGetUserInfo(){
this.followLoading=true;
if(this.userId){
......@@ -147,7 +132,7 @@ export default {
},
dataGet2UserInfo(){
let data = this.info;
this.nickName=data.nickName;
this.nickName=data.nickName||data.userNick;
this.userId1 = data.userId;
this.gender= data.gender;
this.signature = data.signature;
......@@ -219,27 +204,7 @@ export default {
})
},
dataGet2Path(path){
if(!this.userId1){
return ''
}else if(this.userId1===this.$store.state.userProfile.userId){
if(path==='following'||path==='fans'){
return '/personal-center/person/'+path;
}else{
return '/personal-center/home/'+path;
}
}else{
return '/u/'+this.userId1+'/'+path
}
}
},
}
</script>
<style lang="scss" scoped>
.active {
color: #999 !important;
}
</style>
<template>
<comment-con></comment-con>
<comment-con :id="id" type="question"></comment-con>
</template>
......@@ -8,6 +8,20 @@
export default {
components:{
CommentCon
},
data(){
return {
id:'',
}
},
created() {
this.getArticleId();
},
methods:{
getArticleId(){
this.id = this.$route.params.id;
},
}
}
......
<template>
<article-card></article-card>
<article-card :info="detail"></article-card>
</template>
<script>
import ArticleCard from "../../../components/moblie/articleCard";
import config from "../../../action/config";
export default {
data(){
return{
detail:{},
}
},
components:{
ArticleCard
},
created() {
this.dataGetArticle()
},
methods:{
dataGetArticle(){
let id = this.$route.params.id;
this.$axios.$get(config.api.get.Question.detail+id).then((response)=>{
this.detail = response.data;
})
}
}
}
......
......@@ -21,7 +21,6 @@
methods:{
getArticleId(){
this.id = this.$route.params.id;
console.log(this.$route.params.id)
},
}
}
......
<template>
<yun-div
>
<nav-bar :path="path" :nav-list="navList"></nav-bar>
<dynamic-card></dynamic-card>
<dynamic-card></dynamic-card>
<dynamic-card></dynamic-card>
<dynamic-card></dynamic-card>
<dynamic-card></dynamic-card>
<nav-bar :path="path" :nav-list="navList" :sort="false">
<template>
<yun-div
:extend-style="{
boxShadow: '-28px -0px 40px -22px rgba(0,0,0,.2) inset',
position:'relative',overflow: 'visible'}"
@tap="changeRoute1(routesObject.dynamic.release)"
>
<yun-icon name="edit2" color="#000" :size="30"></yun-icon>
</yun-div>
</template>
</nav-bar>
<dynamic-card
v-for="(val,index) in postList"
:key="val.postId"
:info="val"
></dynamic-card>
<scroll-loading ref="pagination" :pages="pages" v-on:changePage="changePage"></scroll-loading>
</yun-div>
</template>
<script>
import NavBar from "../../components/moblie/nav";
import DynamicCard from "../../components/moblie/dynamicCard";
import ScrollLoading from '../../components/moblie/scrollLoading';
import config from "../../action/config";
import commonMixin from "../../components/moblie/commonMixin";
export default {
components: {DynamicCard, NavBar},
mixins:[commonMixin],
components: {DynamicCard, NavBar,ScrollLoading},
data() {
return {
path: '/answer',
path: '/dynamic',
navList: [
{
label: '全部动态',
id: 'all'
label: '最新',
id: 'new'
},
{
label: '推荐',
id: 'recommends'
},
{
label: '关注',
id: 'following'
},
{
label: '我的',
id: 'my'
},
{
label: '文字',
id: 'word'
},
{
label: '我的关注',
id: 'all'
label: '视频',
id: 'video'
},
]
{
label: '图片',
id: 'picture'
}
],
postList:[],
pages:1,
}
},
created() {
if (this.$route.query.type) {
return
}else{
this.$router.replace({
path: '/dynamic',
query: {
type: 'new'
}
})
}
this.$router.replace({
path: '/dynamic',
query: {
type: 'all'
},
watch:{
$route(val){
if (val.query.type) {
}else{
this.$router.replace({
path: '/dynamic',
query: {
type: 'new'
}
})
}
this.restartPagination();
}
},
methods:{
restartPagination(){
if(process.browser){
this.projectList = [];
this.pages = 1 ;
this.$refs.pagination.setCurrentPage(1)
}
},
handleResponse(currentPage,response){
if(currentPage===1){
this.postList=response.data.dataList;
this.pages = response.data.totalPage;
}else{
response.data.dataList.map((val,index)=>{
this.postList.push(val)
});
this.pages = response.data.totalPage;
}
},
dataGetPostList(currentPage){
let params={
page:currentPage,
size:12
};
if(this.$route.query.type&&this.$route.query.type==='new' ){ //最新
this.$axios.$get(config.api.get.Post.list,{params:params}).then((response)=>{
this.handleResponse(currentPage,response)
})
}
if(this.$route.query.type&&this.$route.query.type==='recommends' ){ //推荐
this.$axios.$get(config.api.get.Post.recommends,{params:params}).then((response)=>{
this.handleResponse(currentPage,response)
})
}
if(this.$route.query.type&&this.$route.query.type==='following' ){ //关注
this.$axios.$get(config.api.get.Post.following,{params:params}).then((response)=>{
this.handleResponse(currentPage,response)
})
}
if(this.$route.query.type&&this.$route.query.type==='my' ){ //我的
this.$axios.$get(config.api.get.Post.myList,{params:params}).then((response)=>{
this.handleResponse(currentPage,response)
})
}
if(this.$route.query.type&&this.$route.query.type==='word' ){ //文字
params.type = 0;
this.$axios.$get(config.api.get.Post.list,{params:params}).then((response)=>{
this.handleResponse(currentPage,response)
})
}
if(this.$route.query.type&&this.$route.query.type==='video' ){ //视频
params.type = 1;
this.$axios.$get(config.api.get.Post.list,{params:params}).then((response)=>{
this.handleResponse(currentPage,response)
})
}
if(this.$route.query.type&&this.$route.query.type==='picture' ){ //图片
params.type = 2;
this.$axios.$get(config.api.get.Post.list,{params:params}).then((response)=>{
this.handleResponse(currentPage,response)
})
}
})
},
changePage(currentPage){
//返回页数 请求新的数据
this.dataGetPostList(currentPage)
},
}
}
</script>
......
......@@ -3,31 +3,31 @@
height-v="auto"
slot="card"
>
<banner></banner>
<banner :linkArr="linkArr" :imgArr="imgArr" ></banner>
<container-card
title="项目推荐"
>
<project-card v-for="val in 5" ></project-card>
<project-card v-for="val in projectList" :key="val.projectId" :info="val" ></project-card>
</container-card>
<container-card
title="最新资讯"
>
<project-card v-for="val in 5" ></project-card>
<project-card v-for="val in newsList" :key="val.contentId" :info="val" ></project-card>
</container-card>
<container-card
title="社区精英"
>
<user-card-x v-for="val in 5"></user-card-x>
<user-card-x v-for="val in elitesList" :key="val.userId" :info="val"></user-card-x>
</container-card>
<container-card
title="精选博文"
>
<project-card v-for="val in 5"></project-card>
<project-card v-for="val in blogList" :key="val.blogId" :info="val" ></project-card>
</container-card>
<container-card
title="推荐问答"
>
<answer-card v-for="val in 5"></answer-card>
<answer-card v-for="val in answerList" :key="val.questionId" :info="val"></answer-card>
</container-card>
</yun-div>
......@@ -36,52 +36,108 @@
<script>
import YunButton from '../components/common/button/src/main';
import projectCard from '../components/moblie/projectCard';
import {getLineHeight} from "../action/utils/get-lineheight";
import banner from '../components/moblie/banner';
import containerCard from '../components/moblie/containerCard';
import answerCard from '../components/moblie/answerCard';
import userCardX from '../components/moblie/userCardX'
import config from "../action/config";
export default {
components: {
projectCard,YunButton,banner,containerCard,answerCard,userCardX
},
mounted() {
},
methods:{
getLineHeight(e){
console.log(e);
data(){
return{
imgArr:[],
linkArr: [],
projectList:[],
blogList:[],
newsList:[],
elitesList:[],
answerList:[],
}
},
}
</script>
<style>
.container {
margin: 0 auto;
min-height: 100vh;
font-size: 1px;
}
created() {
this.dataGetHotProjectList();
this.dataGetHotBlogList();
this.dataGetBanner();
this.dataGetNews();
this.dataGetHotBloggersList();
this.dataGetHotAnswerList();
},
methods:{
.title {
font-family: 'Quicksand', 'Source Sans Pro', -apple-system, BlinkMacSystemFont,
'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
display: block;
font-weight: 300;
font-size: 100rem;
color: #35495e;
letter-spacing: 1px;
}
dataGetHotProjectList(){
let params={
page:1,
size:12
};
this.$axios.$get(config.api.get.Project.hotList, {params:params})
.then((response)=>{
this.projectList = response.data.dataList;
})
},
dataGetHotBlogList(){
let params={
page:1,
size:12
};
this.$axios.$get(config.api.get.Blog.hotList, {params:params})
.then((response)=>{
this.blogList = response.data.dataList;
})
},
async dataGetBanner(){ //内容类型-0:幻灯,1:普通文章,3:广告
let dataList = await this.$axios.$get(config.api.get.Content.list + '/12/contents',
{
params: {
page: 1,
size: 5,
type: 0
}
})
dataList.data.dataList.map((val,index)=>{
this.imgArr.push(
val.pic1
);
this.linkArr.push(
val.link
)
})
.subtitle {
font-weight: 300;
font-size: 42px;
color: #526488;
word-spacing: 5px;
padding-bottom: 15px;
}
},
async dataGetNews(){ //内容类型-0:幻灯,1:普通文章,3:广告
let dataList = await this.$axios.$get(config.api.get.Content.list + '/13/contents',
{
params: {
page: 1,
size: 5,
type: 0
}
})
this.newsList = dataList.data.dataList
.links {
padding-top: 15px;
},
dataGetHotBloggersList() {
let params={
page: 1,
size: 12
};
this.$axios.$get(config.api.get.User.elites,{params:params})
.then((response)=>{
this.elitesList = response.data.dataList;
});
},
dataGetHotAnswerList() {
let params={
page: 1,
size: 10
};
this.$axios.$get(config.api.get.Question.hotList,{params:params})
.then((response)=>{
this.answerList = response.data.dataList;
});
},
},
}
</style>
</script>
<template>
<article-card></article-card>
<article-card :info="detail"></article-card>
</template>
<script>
import ArticleCard from "../../../components/moblie/articleCard";
import config from "../../../action/config";
export default {
data(){
return{
detail:{},
}
},
components:{
ArticleCard
},
created() {
this.dataGetArticle()
},
methods:{
dataGetArticle(){
let id = this.$route.params.id;
this.$axios.$get(config.api.get.Content.detail+id).then((response)=>{
this.detail = response.data;
})
}
}
}
......
......@@ -21,15 +21,15 @@ export default {
navList: [
{
label: '新闻速递',
id: '13'
id: 13
},
{
label: '行业资讯',
id: '14'
id: 14
},
{
label: '软件更新',
id: '17'
id: 17
}
],
newsList:[],
......@@ -38,19 +38,31 @@ export default {
},
watch: {
$route(val){
if (this.$route.query.type) {
}else{
this.$router.replace({
path: '/news',
query: {
type: '13'
}
})
}
this.restartPagination();
},
},
created() {
if (this.$route.query.type) {
return
}else{
this.$router.replace({
path: '/news',
query: {
type: '13'
}
})
}
this.$router.replace({
path: '/news',
query: {
type: '13'
}
})
},
methods: {
restartPagination(){
......
......@@ -100,7 +100,6 @@
getDataUserInfo(){
this.$axios.$get(config.api.get.User.myInfo).then((response) => {
console.log(response);
if(response.code===0){
let data = response.data;
this.nickName=data.nickName;
......
......@@ -62,6 +62,7 @@
:margin-v="[15,0,15,0]"
:ske-w="120"
:font-style="[30,30,400,'#75D098','center']"
@tap="handleLogout"
>
安全退出
</yun-div>
......@@ -73,9 +74,36 @@
<script>
import userCardBig from '../../components/moblie/userCardBig'
import dataCard from '../../components/moblie/dataCard'
import config from "../../action/config";
const Cookie = process.client ? require('js-cookie') : null
export default {
components:{
userCardBig,dataCard
},
methods:{
handleLogout() {
this.$messageBox.confirm({
title:'提示',
content:'确认注销登录?',
confirmText: '确定',
onConfirm: action => {
this.$axios.$get(config.api.get.User.logout).then((response)=>{
if(response.code === 0 ){
// 删除cookie
Cookie.remove(config.default_data.KEY_COOKIE_TOKEN)
// 移除登录信息
this.$store.commit('auth/logout')
// 移除用户信息
this.$store.commit('userProfile/removeUser')
this.routeToHome();
}
})
}
});
},
}
}
......
<template>
<comment-con></comment-con>
<comment-con :id="id" type="project"></comment-con>
</template>
......@@ -8,6 +8,20 @@
export default {
components:{
CommentCon
},
data(){
return {
id:'',
}
},
created() {
this.getArticleId();
},
methods:{
getArticleId(){
this.id = this.$route.params.id;
},
}
}
......
<template>
<article-card></article-card>
<article-card :info="detail"></article-card>
</template>
<script>
import ArticleCard from "../../../components/moblie/articleCard";
import config from "../../../action/config";
export default {
data(){
return{
detail:{},
}
},
components:{
ArticleCard
},
created() {
this.dataGetArticle()
},
methods:{
dataGetArticle(){
let id = this.$route.params.id;
this.$axios.$get(config.api.get.Project.detail+id).then((response)=>{
this.detail = response.data;
})
}
}
}
......
......@@ -43,8 +43,16 @@ export default {
$route(val){
if(val.query.type==='hot'){
this.navList = this.navList2
}else{
}if(this.$route.query.type){
this.navList = this.navList1
}else{
this.navList = this.navList1;
this.$router.replace({
path: '/project',
query: {
type: 'all'
}
});
}
this.restartPagination();
......
<template>
<yun-div>
<Nav :path="path" :nav-list="navList"></Nav>
<topic-card></topic-card>
<topic-card></topic-card>
<topic-card></topic-card>
<topic-card></topic-card>
<topic-card></topic-card>
<topic-card></topic-card>
<topic-card></topic-card>
<topic-card :from="fromType" v-for="(val,index) in topicList" :key="val.topicId" :info="val"></topic-card>
<scroll-loading ref="pagination" :pages="pages" v-on:changePage="changePage"></scroll-loading>
</yun-div>
</template>
<script>
import Nav from "../../components/moblie/nav";
import TopicCard from "../../components/moblie/topicCard";
import ScrollLoading from '../../components/moblie/scrollLoading';
import config from "../../action/config";
export default {
components: {TopicCard, Nav},
components: {TopicCard, Nav,ScrollLoading},
data() {
return {
path: '/topic',
navList: [
{
label: '全部话题',
id: 'all'
label: '最新',
id: 'new'
},
{
label: '我的话题',
id: '10'
label: '热门',
id: 'hot'
},
]
{
label: '关注',
id: 'following'
}
],
topicList:[],
pages:1,
fromType:''
}
},
watch:{
$route(val){
if (this.$route.query.type) {
}else{
this.$router.replace({
path: '/topic',
query: {
type: 'new'
}
})
}
this.restartPagination();
},
},
created() {
if (this.$route.query.type) {
return
}else{
this.$router.replace({
path: '/topic',
query: {
type: 'new'
}
})
}
this.$router.replace({
path: '/topic',
query: {
type: 'all'
},
methods:{
restartPagination(){
this.fromType = '';
if(process.browser){
this.projectList = [];
this.pages = 1 ;
this.$refs.pagination.setCurrentPage(1)
}
},
handleResponse(currentPage,response){
if(currentPage===1){
this.topicList=response.data.dataList;
this.pages = response.data.totalPage;
}else{
response.data.dataList.map((val,index)=>{
this.topicList.push(val)
});
this.pages = response.data.totalPage;
}
},
dataGetTopicList(currentPage){
let params={
page:currentPage,
size:12
};
if(this.$route.query.type&&this.$route.query.type==='new' ){
this.$axios.$get(config.api.get.Topic.list,{params:params}).then((response)=>{
this.handleResponse(currentPage,response)
})
}
else if(this.$route.query.type&&this.$route.query.type==='hot' ){
this.$axios.$get(config.api.get.Topic.hotList, {params:params})
.then((response)=>{
this.handleResponse(currentPage,response)
})
}
else if(this.$route.query.type&&this.$route.query.type==='following' ){
this.fromType = 'notice';
this.$axios.$get(config.api.get.Topic.myfollowedList, {params:params})
.then((response)=>{
console.log(response)
this.handleResponse(currentPage,{data:{dataList:response.data.records,pages:response.data.pages}})
})
}
})
},
changePage(currentPage){
//返回页数 请求新的数据
this.dataGetTopicList(currentPage)
},
}
}
</script>
......
<template>
<yun-div>
<yun-div :margin-v="[0,0,20]">
<user-card-big></user-card-big>
<user-card-big :info="userInfo"></user-card-big>
</yun-div>
<Nav :show-right="false" :nav-list="navList"></Nav>
......@@ -63,7 +63,7 @@ export default {
async asyncData({$axios, params}) {
//获取他人的资料
let infoResponse = await $axios.$get(config.api.get.User.otherInfo + params.id + '/baseinfo');
return { ...infoResponse.data }
return { ...infoResponse.data,userInfo:infoResponse.data }
},
data() {
return {
......@@ -157,7 +157,6 @@ export default {
size: 10
}
}).then((response) => {
console.log(response);
this.handleResponse(currentPage,response)
})
},
......@@ -174,7 +173,6 @@ export default {
size:10
}
}).then((response)=>{
console.log(response);
this.handleResponse(currentPage,response)
})
......@@ -192,7 +190,6 @@ export default {
size:10
}
}).then((response)=>{
console.log(response);
this.handleResponse(currentPage,response)
})
......@@ -209,7 +206,6 @@ export default {
size: 10
}
}).then((response) => {
console.log(response);
this.handleResponse(currentPage,response)
})
......@@ -227,7 +223,6 @@ export default {
size: 10
}
}).then((response) => {
console.log(response);
this.handleResponse(currentPage,response)
})
},
......@@ -239,7 +234,6 @@ export default {
size:10
}
}).then((response)=>{
console.log(response);
this.handleResponse(currentPage,response)
})
},
......@@ -255,7 +249,6 @@ export default {
}
}).then((response)=>{
if(response.code===0){
console.log(response);
this.handleResponse(currentPage,response)
}
})
......@@ -272,7 +265,6 @@ export default {
}
}).then((response)=>{
if(response.code===0){
console.log(response);
this.handleResponse(currentPage,response)
}
})
......
......@@ -9,6 +9,7 @@
:width-v="153"
:ske-w="153"
:ske-h="36"
v-tap="()=>changeRoute1('/')"
:src="Logo">
</yun-img>
<yun-div :font-style="[28,37,500,'#333','left']" v-tap="toRegister">注册</yun-div>
......@@ -172,9 +173,15 @@ export default {
opacity: 0.2,
isPassword: true,
timing: '发送验证码',
inputKey: 'passwordLogin'
inputKey: 'passwordLogin',
from:'/'
}
},
beforeRouteEnter(to, from, next) {
next(vm => {
vm.from = from.fullPath
});
},
computed: {
isClick: function () {
if (this.account !== '' && (this.password !== '' || this.VerificationCode !== '')) {
......
......@@ -9,6 +9,7 @@
:width-v="153"
:ske-w="153"
:ske-h="36"
v-tap="()=>changeRoute1('/')"
:src="Logo">
</yun-img>
<yun-div :font-style="[28,37,500,'#333','left']" v-tap="toLogin">登录</yun-div>
......
......@@ -9,6 +9,7 @@
:width-v="153"
:ske-w="153"
:ske-h="36"
v-tap="()=>changeRoute1('/')"
:src="Logo">
</yun-img>
<yun-div :font-style="[28,37,500,'#333','left']" v-tap="toRegister">注册</yun-div>
......
......@@ -20,7 +20,7 @@ Vue.prototype.$message = Toast
Vue.prototype.$messageBox = YunDialog
Vue.use(YunAdaptableCon)
// Vue.use(vConsole)
Vue.use(vConsole)
Vue.use(AutoTextarea)
Vue.use(Indicator)
Vue.use(YunDialog)
......
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