|
@@ -1,33 +1,45 @@
|
|
<template>
|
|
<template>
|
|
- <div>
|
|
|
|
- <el-skeleton style="width: 240px" :loading="true" animated v-if="item.skeleton">
|
|
|
|
- <template slot="template">
|
|
|
|
- <el-skeleton-item
|
|
|
|
- variant="image"
|
|
|
|
- style="width: 200px; height: 280px;"
|
|
|
|
- />
|
|
|
|
- <div style="padding: 12px;width: 200px;">
|
|
|
|
- <el-skeleton-item variant="h3" style="width: 100%; height: 22px" />
|
|
|
|
- <el-skeleton-item variant="text" style="margin: 4px 0 12px 0; height: 16px; width:50%;" />
|
|
|
|
- <el-skeleton-item variant="text" style="height: 21px; width:70%;" v-if="!type||type!='bookShelf'" />
|
|
|
|
- </div>
|
|
|
|
- </template>
|
|
|
|
- </el-skeleton>
|
|
|
|
- <div class="BookCard" @click="handleLink" v-else>
|
|
|
|
- <!-- <div
|
|
|
|
|
|
+ <div>
|
|
|
|
+ <el-skeleton
|
|
|
|
+ style="width: 240px"
|
|
|
|
+ :loading="true"
|
|
|
|
+ animated
|
|
|
|
+ v-if="item.skeleton"
|
|
|
|
+ >
|
|
|
|
+ <template slot="template">
|
|
|
|
+ <el-skeleton-item variant="image" style="width: 200px; height: 280px" />
|
|
|
|
+ <div style="padding: 12px; width: 200px">
|
|
|
|
+ <el-skeleton-item variant="h3" style="width: 100%; height: 22px" />
|
|
|
|
+ <el-skeleton-item
|
|
|
|
+ variant="text"
|
|
|
|
+ style="margin: 4px 0 12px 0; height: 16px; width: 50%"
|
|
|
|
+ />
|
|
|
|
+ <el-skeleton-item
|
|
|
|
+ variant="text"
|
|
|
|
+ style="height: 21px; width: 70%"
|
|
|
|
+ v-if="!type || type != 'bookShelf'"
|
|
|
|
+ />
|
|
|
|
+ </div>
|
|
|
|
+ </template>
|
|
|
|
+ </el-skeleton>
|
|
|
|
+ <div class="BookCard" @click="handleLink" v-else>
|
|
|
|
+ <!-- <div
|
|
class="image"
|
|
class="image"
|
|
:style="{height:height?height:'280px'}"
|
|
:style="{height:height?height:'280px'}"
|
|
></div> -->
|
|
></div> -->
|
|
- <span class="isNew" v-if="item.is_new&&item.is_new==='true'">NEW</span>
|
|
|
|
- <span class="isReservation">订阅</span>
|
|
|
|
- <el-image
|
|
|
|
- class="image"
|
|
|
|
- :src="require('../../assets/cover-order-jingdu.png')"
|
|
|
|
- :fit="'cover'">
|
|
|
|
- </el-image>
|
|
|
|
- <div class="bottom">
|
|
|
|
- <p class="name">精读课堂·{{item.study_phase_name}}</p>
|
|
|
|
- <!-- <template>
|
|
|
|
|
|
+ <span class="isNew" v-if="item.is_new && item.is_new === 'true'"
|
|
|
|
+ >NEW</span
|
|
|
|
+ >
|
|
|
|
+ <span class="isReservation">订阅</span>
|
|
|
|
+ <el-image
|
|
|
|
+ class="image"
|
|
|
|
+ :src="require('../../assets/cover-order-jingdu.png')"
|
|
|
|
+ :fit="'cover'"
|
|
|
|
+ >
|
|
|
|
+ </el-image>
|
|
|
|
+ <div class="bottom">
|
|
|
|
+ <p class="name">精读课堂·{{ item.study_phase_name }}</p>
|
|
|
|
+ <!-- <template>
|
|
<el-rate
|
|
<el-rate
|
|
v-model="item.score"
|
|
v-model="item.score"
|
|
disabled
|
|
disabled
|
|
@@ -37,105 +49,123 @@
|
|
>
|
|
>
|
|
</el-rate>
|
|
</el-rate>
|
|
</template> -->
|
|
</template> -->
|
|
- <p class="author">有效期:{{item.end_date||'暂无'}}</p>
|
|
|
|
- <template v-if="!type||type!='bookShelf'">
|
|
|
|
- <p class="price">
|
|
|
|
- <span class="OPPOSans">¥{{item.hasOwnProperty('price_discount')?item.price_discount:item.price|cutMoneyFiter}}</span>
|
|
|
|
- <s v-if="item.hasOwnProperty('price_discount')&&item.price_discount!==item.price">¥{{item.price|cutMoneyFiter}}</s>
|
|
|
|
- </p>
|
|
|
|
- </template>
|
|
|
|
- </div>
|
|
|
|
- </div>
|
|
|
|
|
|
+ <p class="author">有效期:{{ item.end_date || "暂无" }}</p>
|
|
|
|
+ <template v-if="!type || type != 'bookShelf'">
|
|
|
|
+ <p class="price">
|
|
|
|
+ <span class="OPPOSans"
|
|
|
|
+ >¥{{
|
|
|
|
+ item.hasOwnProperty("price_discount")
|
|
|
|
+ ? item.price_discount
|
|
|
|
+ : item.price | cutMoneyFiter
|
|
|
|
+ }}</span
|
|
|
|
+ >
|
|
|
|
+ <s
|
|
|
|
+ v-if="
|
|
|
|
+ item.hasOwnProperty('price_discount') &&
|
|
|
|
+ item.price_discount !== item.price
|
|
|
|
+ "
|
|
|
|
+ >¥{{ item.price | cutMoneyFiter }}</s
|
|
|
|
+ >
|
|
|
|
+ </p>
|
|
|
|
+ </template>
|
|
|
|
+ </div>
|
|
</div>
|
|
</div>
|
|
|
|
+ </div>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script>
|
|
<script>
|
|
//这里可以导入其它文件(比如:组件,工具js,第三方插件js,json文件,图片文件等等)
|
|
//这里可以导入其它文件(比如:组件,工具js,第三方插件js,json文件,图片文件等等)
|
|
//例如:import 《组件名称》from ‘《组件路径》';
|
|
//例如:import 《组件名称》from ‘《组件路径》';
|
|
-import { cutMoneyFiter } from '@/utils/defined';
|
|
|
|
|
|
+import { cutMoneyFiter } from "@/utils/defined";
|
|
import { getLogin } from "@/api/ajax";
|
|
import { getLogin } from "@/api/ajax";
|
|
export default {
|
|
export default {
|
|
name: "BookCard",
|
|
name: "BookCard",
|
|
//import引入的组件需要注入到对象中才能使用
|
|
//import引入的组件需要注入到对象中才能使用
|
|
components: {},
|
|
components: {},
|
|
- props: ["item", "height","type","LoginNavIndex","userBg","headerBorder","headerBg","previousPage","isBuy"],
|
|
|
|
- filters:{
|
|
|
|
- cutMoneyFiter
|
|
|
|
|
|
+ props: [
|
|
|
|
+ "item",
|
|
|
|
+ "height",
|
|
|
|
+ "type",
|
|
|
|
+ "LoginNavIndex",
|
|
|
|
+ "userBg",
|
|
|
|
+ "headerBorder",
|
|
|
|
+ "headerBg",
|
|
|
|
+ "previousPage",
|
|
|
|
+ "isBuy",
|
|
|
|
+ ],
|
|
|
|
+ filters: {
|
|
|
|
+ cutMoneyFiter,
|
|
},
|
|
},
|
|
data() {
|
|
data() {
|
|
//这里存放数据
|
|
//这里存放数据
|
|
return {
|
|
return {
|
|
- goodsTypeList:{
|
|
|
|
- 0:{
|
|
|
|
- type: 'LB'
|
|
|
|
|
|
+ goodsTypeList: {
|
|
|
|
+ 0: {
|
|
|
|
+ type: "LB",
|
|
},
|
|
},
|
|
- 2:{
|
|
|
|
- type: 'baozhi'
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
|
|
+ 2: {
|
|
|
|
+ type: "baozhi",
|
|
|
|
+ },
|
|
|
|
+ },
|
|
|
|
+ };
|
|
},
|
|
},
|
|
//计算属性 类似于data概念
|
|
//计算属性 类似于data概念
|
|
computed: {
|
|
computed: {
|
|
score() {
|
|
score() {
|
|
- return this.item.score.toFixed(1)
|
|
|
|
- }
|
|
|
|
|
|
+ return this.item.score.toFixed(1);
|
|
|
|
+ },
|
|
},
|
|
},
|
|
//监控data中数据变化
|
|
//监控data中数据变化
|
|
watch: {},
|
|
watch: {},
|
|
//方法集合
|
|
//方法集合
|
|
methods: {
|
|
methods: {
|
|
- async handleLink(){
|
|
|
|
- let url = this.LoginNavIndex +'&&&1&&&2&&&3&&&' + this.previousPage
|
|
|
|
- if(this.LoginNavIndex===1){
|
|
|
|
- let MethodName = "/ShopServer/Client/BookshelfQuery/SetMyValidPeriodIsLooked_IRead";
|
|
|
|
- let data = {
|
|
|
|
- study_phase: this.item.study_phase,
|
|
|
|
- end_date: this.item.end_date
|
|
|
|
- }
|
|
|
|
- await getLogin(MethodName, data)
|
|
|
|
- .then((res) => {
|
|
|
|
- if(res.status===1){
|
|
|
|
-
|
|
|
|
- }
|
|
|
|
- })
|
|
|
|
- .catch(() => {
|
|
|
|
-
|
|
|
|
- });
|
|
|
|
- }
|
|
|
|
- this.$router.push({
|
|
|
|
- path: "/bookStore/all",
|
|
|
|
- query: {
|
|
|
|
- name: encodeURIComponent('我的订阅'),
|
|
|
|
- type: 'jingdu',
|
|
|
|
- from: this.item.study_phase
|
|
|
|
|
|
+ async handleLink() {
|
|
|
|
+ let url = this.LoginNavIndex + "&&&1&&&2&&&3&&&" + this.previousPage;
|
|
|
|
+ if (this.LoginNavIndex === 1) {
|
|
|
|
+ let MethodName =
|
|
|
|
+ "/ShopServer/Client/BookshelfQuery/SetMyValidPeriodIsLooked_IRead";
|
|
|
|
+ let data = {
|
|
|
|
+ study_phase: this.item.study_phase,
|
|
|
|
+ end_date: this.item.end_date,
|
|
|
|
+ };
|
|
|
|
+ await getLogin(MethodName, data)
|
|
|
|
+ .then((res) => {
|
|
|
|
+ if (res.status === 1) {
|
|
}
|
|
}
|
|
- });
|
|
|
|
- }
|
|
|
|
|
|
+ })
|
|
|
|
+ .catch(() => {});
|
|
|
|
+ }
|
|
|
|
+ this.$router.push({
|
|
|
|
+ path: "/bookStore/all",
|
|
|
|
+ query: {
|
|
|
|
+ name: encodeURIComponent("我的订阅"),
|
|
|
|
+ type: "jingdu",
|
|
|
|
+ from: this.item.study_phase,
|
|
|
|
+ },
|
|
|
|
+ });
|
|
|
|
+ },
|
|
},
|
|
},
|
|
//生命周期 - 创建完成(可以访问当前this实例)
|
|
//生命周期 - 创建完成(可以访问当前this实例)
|
|
created() {
|
|
created() {
|
|
// let data = this.changeData(this.dataContext)
|
|
// let data = this.changeData(this.dataContext)
|
|
},
|
|
},
|
|
//生命周期 - 挂载完成(可以访问DOM元素)
|
|
//生命周期 - 挂载完成(可以访问DOM元素)
|
|
- mounted() {
|
|
|
|
-
|
|
|
|
- },
|
|
|
|
|
|
+ mounted() {},
|
|
//生命周期-创建之前
|
|
//生命周期-创建之前
|
|
- beforeCreated() { },
|
|
|
|
|
|
+ beforeCreated() {},
|
|
//生命周期-挂载之前
|
|
//生命周期-挂载之前
|
|
- beforeMount() { },
|
|
|
|
|
|
+ beforeMount() {},
|
|
//生命周期-更新之前
|
|
//生命周期-更新之前
|
|
- beforUpdate() { },
|
|
|
|
|
|
+ beforUpdate() {},
|
|
//生命周期-更新之后
|
|
//生命周期-更新之后
|
|
- updated() { },
|
|
|
|
|
|
+ updated() {},
|
|
//生命周期-销毁之前
|
|
//生命周期-销毁之前
|
|
- beforeDestory() { },
|
|
|
|
|
|
+ beforeDestory() {},
|
|
//生命周期-销毁完成
|
|
//生命周期-销毁完成
|
|
- destoryed() { },
|
|
|
|
|
|
+ destoryed() {},
|
|
//如果页面有keep-alive缓存功能,这个函数会触发
|
|
//如果页面有keep-alive缓存功能,这个函数会触发
|
|
- activated() { }
|
|
|
|
-}
|
|
|
|
|
|
+ activated() {},
|
|
|
|
+};
|
|
</script>
|
|
</script>
|
|
<style lang="scss" scoped>
|
|
<style lang="scss" scoped>
|
|
/* @import url(); 引入css类 */
|
|
/* @import url(); 引入css类 */
|
|
@@ -160,7 +190,7 @@ export default {
|
|
font-weight: 400;
|
|
font-weight: 400;
|
|
font-size: 14px;
|
|
font-size: 14px;
|
|
line-height: 22px;
|
|
line-height: 22px;
|
|
- color: #2F3742;
|
|
|
|
|
|
+ color: #2f3742;
|
|
white-space: nowrap;
|
|
white-space: nowrap;
|
|
overflow: hidden;
|
|
overflow: hidden;
|
|
text-overflow: ellipsis;
|
|
text-overflow: ellipsis;
|
|
@@ -170,7 +200,7 @@ export default {
|
|
font-weight: 400;
|
|
font-weight: 400;
|
|
font-size: 12px;
|
|
font-size: 12px;
|
|
line-height: 20px;
|
|
line-height: 20px;
|
|
- color: #929CA8;
|
|
|
|
|
|
+ color: #929ca8;
|
|
}
|
|
}
|
|
.price {
|
|
.price {
|
|
margin-top: 12px;
|
|
margin-top: 12px;
|
|
@@ -180,16 +210,16 @@ export default {
|
|
font-weight: 700;
|
|
font-weight: 700;
|
|
font-size: 14px;
|
|
font-size: 14px;
|
|
line-height: 22px;
|
|
line-height: 22px;
|
|
- color: #EC5E41;
|
|
|
|
|
|
+ color: #ec5e41;
|
|
}
|
|
}
|
|
:nth-child(2) {
|
|
:nth-child(2) {
|
|
font-weight: 400;
|
|
font-weight: 400;
|
|
font-size: 12px;
|
|
font-size: 12px;
|
|
line-height: 20px;
|
|
line-height: 20px;
|
|
text-decoration-line: line-through;
|
|
text-decoration-line: line-through;
|
|
- color: #929CA8;
|
|
|
|
|
|
+ color: #929ca8;
|
|
margin-left: 8px;
|
|
margin-left: 8px;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
-</style>
|
|
|
|
|
|
+</style>
|