|
@@ -1,25 +1,25 @@
|
1
|
1
|
<template>
|
2
|
2
|
<div class="details">
|
3
|
3
|
<div class="head">
|
4
|
|
- <img :src="datas.caseCoverImg" width="100%" />
|
|
4
|
+ <img :src="cover.coverImg" width="100%" />
|
5
|
5
|
</div>
|
6
|
6
|
|
7
|
7
|
<div class="contanier st">
|
8
|
|
- <h1 style>{{datas.caseTitle}}</h1>
|
|
8
|
+ <h1 style>{{current.caseTitle}}</h1>
|
9
|
9
|
|
10
|
10
|
<p style>
|
11
|
11
|
客户:
|
12
|
|
- <img :src="datas.caseLogoImg" alt />
|
13
|
|
- 所属行业:{{datas.caseIndustry}}
|
|
12
|
+ <img :src="current.caseLogoImg" alt />
|
|
13
|
+ 所属行业:{{current.caseIndustry}}
|
14
|
14
|
</p>
|
15
|
15
|
|
16
|
|
- <div class="border-top" v-html="datas.content"></div>
|
|
16
|
+ <div class="border-top" v-html="current.content"></div>
|
17
|
17
|
|
18
|
18
|
<div class="row" style="margin:0">
|
19
|
19
|
<div class="col-xs-6 col-md-6" style="padding 0;">
|
20
|
20
|
<div class="pull-left">
|
21
|
21
|
<span role="button" class="iconfont icon-zan"></span>
|
22
|
|
- <span>赞 | 234</span>
|
|
22
|
+ <span>赞 | {{current.likeNum}}</span>
|
23
|
23
|
</div>
|
24
|
24
|
</div>
|
25
|
25
|
<div class="col-xs-6 col-md-6" style="padding 0;">
|
|
@@ -35,16 +35,24 @@
|
35
|
35
|
</div>
|
36
|
36
|
</div>
|
37
|
37
|
</div>
|
38
|
|
- <div class="contanier center-block next-prev" style>
|
|
38
|
+ <div class="contanier center-block next-prev">
|
39
|
39
|
<div class="row case-2">
|
40
|
40
|
<div class="col-xs-4 col-md-4 case-3">
|
41
|
|
- <button type="button" class="btn1 btn-link pull-left case-3 button-hover prev-page">上一个案例</button>
|
|
41
|
+ <div class="btn1 btn-link pull-left case-3 button-hover prev-page" v-if="brothers.length">
|
|
42
|
+ <router-link :to="{name: 'details', query: { id: brothers[0].id }}">
|
|
43
|
+ 上一个案例
|
|
44
|
+ </router-link>
|
|
45
|
+ </div>
|
42
|
46
|
</div>
|
43
|
47
|
<div class="col-xs-4 col-md-4 case-3">
|
44
|
|
- <button type="button" class="btn btn-default button-hover">返回</button>
|
|
48
|
+ <button type="button" class="btn btn-default button-hover" @click="() => $router.go(-1)">返回</button>
|
45
|
49
|
</div>
|
46
|
50
|
<div class="col-xs-4 col-md-4 case-3">
|
47
|
|
- <button type="button" class="btn1 btn-link pull-right case-3 button-hover next-page">下一个案例</button>
|
|
51
|
+ <div class="btn1 btn-link pull-right case-3 button-hover next-page" v-if="brothers.length > 1">
|
|
52
|
+ <router-link :to="{name: 'details', query: { id: brothers[1].id }}">
|
|
53
|
+ 下一个案例
|
|
54
|
+ </router-link>
|
|
55
|
+ </div>
|
48
|
56
|
</div>
|
49
|
57
|
</div>
|
50
|
58
|
</div>
|
|
@@ -53,14 +61,14 @@
|
53
|
61
|
<h2>更多好案例</h2>
|
54
|
62
|
|
55
|
63
|
<div class="row home-case" style="padding:0;width: 100%;">
|
56
|
|
- <div class="col-xs-6 col-md-3 home-case" style="margin:0" v-for="(item,index) in 4" :key="index">
|
57
|
|
- <a href="/details">
|
58
|
|
- <div class="st4" style="{background: `url(${../assets/image/home/Case2.jpg})`}">
|
|
64
|
+ <div class="col-xs-6 col-md-3 home-case" style="margin:0" v-for="(item,index) in recommends" :key="index">
|
|
65
|
+ <router-link :to="{name: 'details', query: { id: item.id }}">
|
|
66
|
+ <div class="st4" :style="{background: `url(${item.caseCoverImg})`}">
|
59
|
67
|
<div class="casetitle">
|
60
|
68
|
<p>{{item.caseTitle}}</p>
|
61
|
69
|
</div>
|
62
|
70
|
</div>
|
63
|
|
- </a>
|
|
71
|
+ </router-link>
|
64
|
72
|
</div>
|
65
|
73
|
</div>
|
66
|
74
|
</div>
|
|
@@ -68,59 +76,50 @@
|
68
|
76
|
</template>
|
69
|
77
|
|
70
|
78
|
<script>
|
71
|
|
-
|
72
|
|
-
|
73
|
|
-export default {
|
74
|
|
-
|
75
|
|
-}
|
76
|
|
-</script>
|
77
|
|
-
|
78
|
|
-
|
79
|
|
-<script scoped>
|
80
|
79
|
// @ is an alias to /src
|
81
|
80
|
import request from '../../utils/request'
|
82
|
81
|
import apis from '../config/api';
|
83
|
82
|
|
84
|
83
|
export default {
|
85
|
|
- name: 'details',
|
|
84
|
+ name: 'CaseDetails',
|
86
|
85
|
|
87
|
86
|
data () {
|
88
|
87
|
return {
|
89
|
|
- datas: {},
|
90
|
|
- morecase: [],
|
|
88
|
+ detail: {},
|
91
|
89
|
}
|
92
|
90
|
},
|
|
91
|
+ computed: {
|
|
92
|
+ cover() {
|
|
93
|
+ return this.detail.cover || {}
|
|
94
|
+ },
|
|
95
|
+ current() {
|
|
96
|
+ return this.detail.current || {}
|
|
97
|
+ },
|
|
98
|
+ brothers() {
|
|
99
|
+ return this.detail.brothers || []
|
|
100
|
+ },
|
|
101
|
+ recommends() {
|
|
102
|
+ return (this.detail.recommends || []).slice(0, 4)
|
|
103
|
+ },
|
|
104
|
+ },
|
93
|
105
|
components: {
|
94
|
106
|
|
95
|
107
|
},
|
96
|
108
|
created () {
|
97
|
109
|
this.getDetail()
|
98
|
110
|
},
|
|
111
|
+ beforeRouteUpdate () {
|
|
112
|
+ // this.getDetail()
|
|
113
|
+ },
|
99
|
114
|
methods: {
|
100
|
115
|
getDetail () {
|
101
|
116
|
const id = this.$route.query.id;
|
102
|
|
- const type = this.$route.query.type;
|
103
|
|
- const taCaseTypeId = this.$route.query.taCaseTypeId;
|
104
|
|
- request({
|
105
|
|
- ...apis.case.list,
|
106
|
|
- urlData: { type: type },
|
107
|
|
- params: { pageNum: 1, pageSize: 1, id: id },
|
108
|
|
- query: {}
|
109
|
|
- }).then(con => {
|
110
|
|
- console.log(con, "124")
|
111
|
|
- this.datas = con.records[0];
|
112
|
|
- // window.console.log(this.caselist, "543");
|
113
|
|
- })
|
114
|
117
|
|
115
|
118
|
request({
|
116
|
|
- ...apis.case.list,
|
117
|
|
- urlData: { type: type },
|
118
|
|
- params: { pageNum: 1, pageSize: 4, }
|
119
|
|
- }).then(con => {
|
120
|
|
- console.log(con, "456")
|
121
|
|
- console.log(taCaseTypeId, "456")
|
122
|
|
- // this.morecase = con.records[0];
|
123
|
|
- // window.console.log(this.caselist, "543");
|
|
119
|
+ ...apis.case.get,
|
|
120
|
+ urlData: { id },
|
|
121
|
+ }).then(res => {
|
|
122
|
+ this.detail = res || {}
|
124
|
123
|
})
|
125
|
124
|
}
|
126
|
125
|
|