hookehuyr

新增不可用商品页面相关显示

1 <!-- 1 <!--
2 * @Date: 2024-09-29 14:26:41 2 * @Date: 2024-09-29 14:26:41
3 * @LastEditors: hookehuyr hookehuyr@gmail.com 3 * @LastEditors: hookehuyr hookehuyr@gmail.com
4 - * @LastEditTime: 2024-10-25 18:01:01 4 + * @LastEditTime: 2024-10-28 11:44:26
5 * @FilePath: /hager/src/views/product/detail.vue 5 * @FilePath: /hager/src/views/product/detail.vue
6 * @Description: 文件描述 6 * @Description: 文件描述
7 --> 7 -->
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
17 </el-breadcrumb> 17 </el-breadcrumb>
18 </div> 18 </div>
19 </hager-box> 19 </hager-box>
20 - <hager-box class="box-n"> 20 + <hager-box v-if="is_enable" class="box-n">
21 <el-row v-if="!is_xs" :gutter="10" style="margin-bottom: 3rem;"> 21 <el-row v-if="!is_xs" :gutter="10" style="margin-bottom: 3rem;">
22 <el-col :span="8"> 22 <el-col :span="8">
23 <hager-carousel :images="info_images"></hager-carousel> 23 <hager-carousel :images="info_images"></hager-carousel>
...@@ -39,7 +39,7 @@ ...@@ -39,7 +39,7 @@
39 </div> 39 </div>
40 </div> 40 </div>
41 </hager-box> 41 </hager-box>
42 - <hager-box class="box-2n"> 42 + <hager-box v-if="is_enable" class="box-2n">
43 <hager-h1 title="产品优势" sub="Product Advantages"></hager-h1> 43 <hager-h1 title="产品优势" sub="Product Advantages"></hager-h1>
44 <div :class="['product-advantage', is_xs ? 'xs' : '']"> 44 <div :class="['product-advantage', is_xs ? 'xs' : '']">
45 <div :class="['item', is_xs ? 'xs' : '']" v-for="(item, index) in product_advantages" :key="index"> 45 <div :class="['item', is_xs ? 'xs' : '']" v-for="(item, index) in product_advantages" :key="index">
...@@ -49,7 +49,7 @@ ...@@ -49,7 +49,7 @@
49 </div> 49 </div>
50 </div> 50 </div>
51 </hager-box> 51 </hager-box>
52 - <hager-box class="box-n"> 52 + <hager-box v-if="is_enable" class="box-n">
53 <hager-h1 title="产品资料" sub="Product Information"></hager-h1> 53 <hager-h1 title="产品资料" sub="Product Information"></hager-h1>
54 <div class="product-info"> 54 <div class="product-info">
55 <div class="info-control"> 55 <div class="info-control">
...@@ -121,6 +121,15 @@ ...@@ -121,6 +121,15 @@
121 </div> 121 </div>
122 </div> 122 </div>
123 </hager-box> 123 </hager-box>
124 + <hager-box v-if="!is_enable" class="no-product">
125 + <div class="product-img-wrapper">
126 + <img :class="['product-img', is_xs ? 'xs' : '']" style="" src="https://cdn.ipadbiz.cn/hager/img/product/%E7%BB%84%20130@2x.png">
127 + </div>
128 + <div class="product-text-wrapper">
129 + <div :class="['product-text-zh', is_xs ? 'xs' : '']">更多内容,敬请期待!</div>
130 + <div :class="['product-text-en', is_xs ? 'xs' : '']">Please look forward to more content!</div>
131 + </div>
132 + </hager-box>
124 </div> 133 </div>
125 </template> 134 </template>
126 135
...@@ -171,6 +180,7 @@ export default { ...@@ -171,6 +180,7 @@ export default {
171 product_advantages: [], 180 product_advantages: [],
172 checked_items: [], 181 checked_items: [],
173 is_login: false, 182 is_login: false,
183 + is_enable: true, // 产品是否有效
174 } 184 }
175 }, 185 },
176 computed: { 186 computed: {
...@@ -203,6 +213,8 @@ export default { ...@@ -203,6 +213,8 @@ export default {
203 const { code, data } = await getProductInfoAPI( { id: this.$route.query.id }); 213 const { code, data } = await getProductInfoAPI( { id: this.$route.query.id });
204 if (code) { 214 if (code) {
205 this.info = data; 215 this.info = data;
216 + // 产品是否可用
217 + this.is_enable = data.product_status === 'publish' ? true : false;
206 if (this.info.file?.img) { 218 if (this.info.file?.img) {
207 this.info_images = this.info.file.img.map(item => item.value); 219 this.info_images = this.info.file.img.map(item => item.value);
208 } 220 }
...@@ -514,5 +526,45 @@ export default { ...@@ -514,5 +526,45 @@ export default {
514 margin-bottom: 1rem; 526 margin-bottom: 1rem;
515 border: 1px solid #ebebeb; 527 border: 1px solid #ebebeb;
516 } 528 }
529 +
530 + .no-product {
531 + .product-img-wrapper {
532 + display: flex;
533 + align-items: center;
534 + justify-content: center;
535 + margin: 2rem 0;
536 + .product-img {
537 + height: 25vw;
538 + width: auto;
539 + &.xs {
540 + height: 12rem;
541 + }
542 + }
543 + }
544 + .product-text-wrapper {
545 + display: flex;
546 + align-items: center;
547 + justify-content: center;
548 + flex-direction: column;
549 + margin: 2rem 0;
550 + .product-text-zh {
551 + font-size: 1.3rem;
552 + font-weight: bold;
553 + margin-bottom: 0.5rem;
554 + color: @secondary-color;
555 + &.xs {
556 + font-size: 1.05rem;
557 + }
558 + }
559 + .product-text-en {
560 + font-size: 1.15rem;
561 + font-weight: bold;
562 + color: @primary-color;
563 + &.xs {
564 + font-size: 0.95rem;
565 + }
566 + }
567 + }
568 + }
517 } 569 }
518 </style> 570 </style>
......
1 <!-- 1 <!--
2 * @Date: 2024-09-27 16:53:09 2 * @Date: 2024-09-27 16:53:09
3 * @LastEditors: hookehuyr hookehuyr@gmail.com 3 * @LastEditors: hookehuyr hookehuyr@gmail.com
4 - * @LastEditTime: 2024-10-25 16:32:22 4 + * @LastEditTime: 2024-10-28 11:43:10
5 * @FilePath: /hager/src/views/product/index.vue 5 * @FilePath: /hager/src/views/product/index.vue
6 * @Description: 文件描述 6 * @Description: 文件描述
7 --> 7 -->
...@@ -33,7 +33,7 @@ ...@@ -33,7 +33,7 @@
33 <div class="product-list"> 33 <div class="product-list">
34 <div class="product-item" v-for="(item, index) in product_list" :key="index"> 34 <div class="product-item" v-for="(item, index) in product_list" :key="index">
35 <div class="product-item-img"> 35 <div class="product-item-img">
36 - <img style="width: 100%; height: auto;" :src="item.cover"> 36 + <img style="width: 100%; height: auto;" :src="item.product_status === 'publish' ? item.cover : 'https://cdn.ipadbiz.cn/hager/img/product/%E7%BB%84%20130@2x.png'">
37 </div> 37 </div>
38 <p @click="goToDetail(item)" class="product-item-title">{{ item.product_name }}</p> 38 <p @click="goToDetail(item)" class="product-item-title">{{ item.product_name }}</p>
39 </div> 39 </div>
...@@ -44,7 +44,7 @@ ...@@ -44,7 +44,7 @@
44 <div v-else class="product-list"> 44 <div v-else class="product-list">
45 <div class="product-item xs" v-for="(item, index) in product_list" :key="index"> 45 <div class="product-item xs" v-for="(item, index) in product_list" :key="index">
46 <div @click="goToDetail(item)" class="product-item-img xs"> 46 <div @click="goToDetail(item)" class="product-item-img xs">
47 - <img style="width: 100%; height: auto;" :src="item.cover"> 47 + <img style="width: 100%; height: auto;" :src="item.product_status === 'publish' ? item.cover : 'https://cdn.ipadbiz.cn/hager/img/product/%E7%BB%84%20130@2x.png'">
48 </div> 48 </div>
49 <p @click="goToDetail(item)" class="product-item-title">{{ item.product_name }}</p> 49 <p @click="goToDetail(item)" class="product-item-title">{{ item.product_name }}</p>
50 </div> 50 </div>
......
...@@ -160,6 +160,12 @@ export default { ...@@ -160,6 +160,12 @@ export default {
160 this.count_solution = data.count_solution; 160 this.count_solution = data.count_solution;
161 // 161 //
162 this.product_list = data.product; 162 this.product_list = data.product;
163 + // 新增不可用状态的图片
164 + this.product_list.forEach(item => {
165 + if (item.product_status === 'apply') {
166 + item.cover = 'https://cdn.ipadbiz.cn/hager/img/product/%E7%BB%84%20130@2x.png'
167 + }
168 + })
163 this.solution_list = data.solution; 169 this.solution_list = data.solution;
164 } 170 }
165 }, 171 },
......