@@ -4,7 +4,8 @@ export const APIOptimize = { | |||||
getCampList, // 获取训练营列表 | getCampList, // 获取训练营列表 | ||||
getTrainingCampDetail, //获取训练营-详情-简介+内容 | getTrainingCampDetail, //获取训练营-详情-简介+内容 | ||||
getTrainingCampDetailComment, //获取训练营-详情-评论 | getTrainingCampDetailComment, //获取训练营-详情-评论 | ||||
comment //评论课程 | |||||
comment, //评论课程 | |||||
getBanner //轮播图 | |||||
}; | }; | ||||
export default APIOptimize; | export default APIOptimize; | ||||
@@ -25,11 +26,11 @@ function getTrainingCampDetail(data) { | |||||
}); | }); | ||||
} | } | ||||
// 获取训练营-详情-评论 | // 获取训练营-详情-评论 | ||||
function getTrainingCampDetailComment(params) { | |||||
function getTrainingCampDetailComment(data) { | |||||
return request({ | return request({ | ||||
url: `/api/HealthyCMS/GetTrainingCampDetailComment`, | url: `/api/HealthyCMS/GetTrainingCampDetailComment`, | ||||
method: 'post', | method: 'post', | ||||
data: params | |||||
params: data | |||||
}); | }); | ||||
} | } | ||||
@@ -41,3 +42,12 @@ function comment(params) { | |||||
data: params | data: params | ||||
}); | }); | ||||
} | } | ||||
// 轮播图 | |||||
function getBanner(data) { | |||||
return request({ | |||||
url: `/api/HealthyCMS/GetBanner`, | |||||
method: 'post', | |||||
params: data | |||||
}); | |||||
} |
@@ -284,17 +284,17 @@ export default { | |||||
}; | }; | ||||
}, | }, | ||||
created() { | created() { | ||||
this.getAuth(); | |||||
this.emoName = this.psyList[this.emotionActive].name; | this.emoName = this.psyList[this.emotionActive].name; | ||||
this.initEchartText(); | this.initEchartText(); | ||||
/* this.getPsychologiclData('', '2023-11-21', '2023-12-21'); */ | /* this.getPsychologiclData('', '2023-11-21', '2023-12-21'); */ | ||||
}, | }, | ||||
mounted() { | |||||
this.initData(); | |||||
this.getPsychologiclData(); | |||||
async mounted() { | |||||
const isExistToken = await this.getAuth(); | |||||
if (isExistToken) { | |||||
this.initData(); | |||||
this.getPsychologiclData(); | |||||
} | |||||
}, | }, | ||||
watch: { | watch: { | ||||
active(val) { | active(val) { | ||||
@@ -59,7 +59,7 @@ | |||||
<div class="send"> | <div class="send"> | ||||
<div class="left"> | <div class="left"> | ||||
<van-cell-group> | <van-cell-group> | ||||
<van-field v-model="chat" placeholder="说点什么" /> | |||||
<van-field v-model="chat" placeholder="说点什么" maxlength="50" /> | |||||
</van-cell-group> | </van-cell-group> | ||||
</div> | </div> | ||||
<div class="right" @click="onSend"> | <div class="right" @click="onSend"> | ||||
@@ -71,6 +71,8 @@ | |||||
<script> | <script> | ||||
import NavBar from '@/components/NavBar'; | import NavBar from '@/components/NavBar'; | ||||
import { isNull } from '@/services/utils-service'; | |||||
import APIOptimize from '@/api/optimize'; | |||||
export default { | export default { | ||||
components: { | components: { | ||||
NavBar, | NavBar, | ||||
@@ -217,6 +219,12 @@ export default { | |||||
this.chat = item.name; | this.chat = item.name; | ||||
}, | }, | ||||
onSend() { | onSend() { | ||||
if (isNull(this.chat)) { | |||||
return this.$toast.fail({ | |||||
message: '评论不能为空' | |||||
}) | |||||
} | |||||
this.onComment(); | |||||
/* let message = { | /* let message = { | ||||
time: '2024-02-24', | time: '2024-02-24', | ||||
text: this.chat, | text: this.chat, | ||||
@@ -226,6 +234,41 @@ export default { | |||||
}; | }; | ||||
this.chatList.push(message); */ | this.chatList.push(message); */ | ||||
// TODO,调取接口 | // TODO,调取接口 | ||||
}, | |||||
// 发送评论 | |||||
onComment() { | |||||
this.$toast.loading(); | |||||
let reqBody = { | |||||
lessonId: Number(this.$route.query.lessonId), | |||||
content: this.chat, | |||||
shortcutCode: "" | |||||
}; | |||||
APIOptimize.comment(reqBody).then(res => { | |||||
console.log("评论详情", res); | |||||
const data = res.data; | |||||
if (data.stateCode === 1) { | |||||
this.$toast.success({ | |||||
message: '评论成功' | |||||
}); | |||||
setTimeout(() => { | |||||
this.$router.push({ | |||||
name: 'trainingcamp', | |||||
}); | |||||
}) | |||||
} else { | |||||
this.$dialog.confirm({ | |||||
message: `${data.message}`, | |||||
showCancelButton: false | |||||
}) | |||||
} | |||||
}).catch((e) => { | |||||
this.$dialog.confirm({ | |||||
message: `${e.message}` | |||||
}) | |||||
}).finally(() => { | |||||
/* this.$toast.clear() */ | |||||
}) | |||||
} | } | ||||
}, | }, | ||||
} | } | ||||
@@ -4,9 +4,8 @@ | |||||
<!-- 专家介绍 --> | <!-- 专家介绍 --> | ||||
<div class="expert-box"> | <div class="expert-box"> | ||||
<van-swipe indicator-color="white"> | <van-swipe indicator-color="white"> | ||||
<van-swipe-item v-for="(item, index) in expertImages" :key="index" @click="goExperts(item.id)"> | |||||
<img v-lazy="item.image" /> | |||||
<!-- <p>了解详情</p> --> | |||||
<van-swipe-item v-for="(item, index) in expertImages" :key="index"> | |||||
<img v-lazy="item.cover" /> | |||||
</van-swipe-item> | </van-swipe-item> | ||||
</van-swipe> | </van-swipe> | ||||
</div> | </div> | ||||
@@ -128,7 +127,6 @@ | |||||
<script> | <script> | ||||
import Vue from 'vue'; | import Vue from 'vue'; | ||||
import TabBar from '@/components/TabBar'; | import TabBar from '@/components/TabBar'; | ||||
import expertImage from '@/assets/optimize/images/3_08.png'; | |||||
import { Swipe, SwipeItem, Lazyload } from 'vant'; | import { Swipe, SwipeItem, Lazyload } from 'vant'; | ||||
import APIOptimize from '@/api/optimize'; | import APIOptimize from '@/api/optimize'; | ||||
Vue.use(Lazyload); | Vue.use(Lazyload); | ||||
@@ -145,14 +143,7 @@ export default { | |||||
data() { | data() { | ||||
return { | return { | ||||
expertImages: [ | expertImages: [ | ||||
{ | |||||
id: 1, | |||||
image: expertImage | |||||
}, | |||||
{ | |||||
id: 2, | |||||
image: expertImage | |||||
} | |||||
], | ], | ||||
campList: [] | campList: [] | ||||
}; | }; | ||||
@@ -160,6 +151,7 @@ export default { | |||||
created() { }, | created() { }, | ||||
mounted() { | mounted() { | ||||
this.$nextTick(() => { | this.$nextTick(() => { | ||||
this.getBanner(); | |||||
this.getCampList(); | this.getCampList(); | ||||
}) | }) | ||||
}, | }, | ||||
@@ -189,6 +181,14 @@ export default { | |||||
id: item.id | id: item.id | ||||
} | } | ||||
}); | }); | ||||
}, | |||||
getBanner() { | |||||
APIOptimize.getBanner().then(res => { | |||||
console.log("轮播图", res); | |||||
let data = res.data.data; | |||||
this.expertImages = data; | |||||
console.log("this.expertImages", this.expertImages); | |||||
}) | |||||
} | } | ||||
} | } | ||||
}; | }; | ||||
@@ -337,15 +337,15 @@ | |||||
} | } | ||||
span { | span { | ||||
color: $com_light_green; | |||||
font-size: 28px; | |||||
color: #179B3B; | |||||
font-size: 32px; | |||||
margin-left: 10px; | margin-left: 10px; | ||||
} | } | ||||
} | } | ||||
.price-strike { | .price-strike { | ||||
font-size: 54px; | |||||
color: #179b3b; | |||||
font-size: 58px; | |||||
color: #98c530; | |||||
font-weight: bold; | font-weight: bold; | ||||
position: relative; | position: relative; | ||||
@@ -62,10 +62,16 @@ | |||||
.customer { | .customer { | ||||
height: 100%; | height: 100%; | ||||
padding: 0 20px; | |||||
padding-right: 20px; | |||||
@include center(); | @include center(); | ||||
font-size: 28px; | font-size: 28px; | ||||
color: #000; | color: #000; | ||||
img { | |||||
height: 78px; | |||||
width: 53px; | |||||
object-fit: contain; | |||||
} | |||||
} | } | ||||
.price { | .price { | ||||
@@ -27,7 +27,7 @@ | |||||
</div> | </div> | ||||
<div class="bottom"> | <div class="bottom"> | ||||
<div class="customer"> | <div class="customer"> | ||||
<p>客服</p> | |||||
<img :src="customerImg" /> | |||||
</div> | </div> | ||||
<div class="price"> | <div class="price"> | ||||
<div class="left"> | <div class="left"> | ||||
@@ -59,12 +59,12 @@ | |||||
<div class="top"> | <div class="top"> | ||||
<img src="@/assets/optimize/icons/3_55.png" alt="" /> | <img src="@/assets/optimize/icons/3_55.png" alt="" /> | ||||
<div> | <div> | ||||
<p>{{ item.nickName }}</p> | |||||
<p>{{ item.nickName || '匿名' }}</p> | |||||
<span>{{ item.createdAt }} {{ item.address }}</span> | <span>{{ item.createdAt }} {{ item.address }}</span> | ||||
</div> | </div> | ||||
</div> | </div> | ||||
<p>{{ item.content }}</p> | <p>{{ item.content }}</p> | ||||
<span>{{ item.videoName }}</span> | |||||
<span>{{ item.title }}</span> | |||||
</div> | </div> | ||||
</div> | </div> | ||||
</div> | </div> | ||||
@@ -95,6 +95,7 @@ export default { | |||||
return { | return { | ||||
active: 'brief', | active: 'brief', | ||||
campList: [], | campList: [], | ||||
customerImg: require('@/assets/optimize/images/3_88.png'), | |||||
info: { | info: { | ||||
videoList: [ | videoList: [ | ||||
/* { | /* { | ||||
@@ -184,7 +185,14 @@ export default { | |||||
}) | }) | ||||
}, | }, | ||||
getTrainingCampDetailComment() { | getTrainingCampDetailComment() { | ||||
let reqParams = { | |||||
courseId: Number(this.$store.getters.campId) | |||||
}; | |||||
APIOptimize.getTrainingCampDetailComment(reqParams).then(res => { | |||||
let data = res.data.data; | |||||
console.log("data", data); | |||||
this.info.evaluate = data; | |||||
}) | |||||
}, | }, | ||||
// 返回 | // 返回 | ||||
onNavBack() { | onNavBack() { | ||||