Commit cda7ac62ecd953a261e739a57b48966ff47c60de
1 parent
a8beae02
1、优选库——优选,折扣专区列表添加“库存紧张”标识
2、优选库——优选,品质优选页面视频做成伪视频,App内直接推给App播放
Showing
7 changed files
with
154 additions
and
35 deletions
src/components/goodsItem_8/goodsItem_8.less
| @@ -54,6 +54,9 @@ | @@ -54,6 +54,9 @@ | ||
| 54 | & + .sub-title { | 54 | & + .sub-title { |
| 55 | margin-top: 10px; | 55 | margin-top: 10px; |
| 56 | } | 56 | } |
| 57 | + & + .icon-stock-is-tight-box { | ||
| 58 | + margin-top: 8px; | ||
| 59 | + } | ||
| 57 | } | 60 | } |
| 58 | .sub-title { | 61 | .sub-title { |
| 59 | color: #9B9B9B; | 62 | color: #9B9B9B; |
| @@ -62,6 +65,18 @@ | @@ -62,6 +65,18 @@ | ||
| 62 | white-space: nowrap; | 65 | white-space: nowrap; |
| 63 | text-overflow: ellipsis; | 66 | text-overflow: ellipsis; |
| 64 | overflow: hidden; | 67 | overflow: hidden; |
| 68 | + & + .icon-stock-is-tight-box { | ||
| 69 | + margin-top: 8px; | ||
| 70 | + } | ||
| 71 | + } | ||
| 72 | + .icon-stock-is-tight-box { | ||
| 73 | + width: 108px; | ||
| 74 | + height: 34px; | ||
| 75 | + .icon-stock-is-tight-img { | ||
| 76 | + display: block; | ||
| 77 | + width: 108px; | ||
| 78 | + height: 34px; | ||
| 79 | + } | ||
| 65 | } | 80 | } |
| 66 | } | 81 | } |
| 67 | .bottom-box { | 82 | .bottom-box { |
src/components/goodsItem_8/goodsItem_8.vue
| @@ -12,6 +12,9 @@ | @@ -12,6 +12,9 @@ | ||
| 12 | <div class="title">{{item.title}}</div> | 12 | <div class="title">{{item.title}}</div> |
| 13 | <div class="sub-title" v-if="sty == '2'">已售出 {{item.num}} 件</div> | 13 | <div class="sub-title" v-if="sty == '2'">已售出 {{item.num}} 件</div> |
| 14 | <div class="sub-title" v-else>{{item.ads}}</div> | 14 | <div class="sub-title" v-else>{{item.ads}}</div> |
| 15 | + <div class="icon-stock-is-tight-box" v-if="sty == '1' && item.gift_num <= 10 && item.num == '1' && item.stock != '0'"> | ||
| 16 | + <img src="static/img/icon_stock_is_tight.png" class="icon-stock-is-tight-img" /> | ||
| 17 | + </div> | ||
| 15 | </div> | 18 | </div> |
| 16 | <div class="bottom-box"> | 19 | <div class="bottom-box"> |
| 17 | <div class="price-box"> | 20 | <div class="price-box"> |
src/pages/discountList/discountList.vue
| @@ -241,19 +241,8 @@ | @@ -241,19 +241,8 @@ | ||
| 241 | } | 241 | } |
| 242 | } else { | 242 | } else { |
| 243 | 243 | ||
| 244 | - this.$nextTick(() => { | ||
| 245 | - | ||
| 246 | - // 唤起App | ||
| 247 | - if (typeof this.$parent.callAppModal === 'function' && typeof this.$refs.callApp === 'object') { | ||
| 248 | - | ||
| 249 | - // 设置唤起参数 | ||
| 250 | - let options = { | ||
| 251 | - success: this.$refs.callApp.callApp | ||
| 252 | - } | ||
| 253 | - | ||
| 254 | - this.$parent.callAppModal(options); | ||
| 255 | - } | ||
| 256 | - }); | 244 | + // App外,唤起App |
| 245 | + this.openApp(); | ||
| 257 | } | 246 | } |
| 258 | }, | 247 | }, |
| 259 | 248 | ||
| @@ -268,6 +257,27 @@ | @@ -268,6 +257,27 @@ | ||
| 268 | }, | 257 | }, |
| 269 | 258 | ||
| 270 | /** | 259 | /** |
| 260 | + * 唤起App封装 | ||
| 261 | + */ | ||
| 262 | + openApp() { | ||
| 263 | + | ||
| 264 | + this.$nextTick(() => { | ||
| 265 | + | ||
| 266 | + // 唤起App | ||
| 267 | + if (typeof this.$parent.callAppModal === 'function' && typeof this.$refs.callApp === 'object') { | ||
| 268 | + | ||
| 269 | + // 设置唤起参数 | ||
| 270 | + let options = { | ||
| 271 | + success: this.$refs.callApp.callApp | ||
| 272 | + } | ||
| 273 | + | ||
| 274 | + // 唤起App | ||
| 275 | + this.$parent.callAppModal(options); | ||
| 276 | + } | ||
| 277 | + }); | ||
| 278 | + }, | ||
| 279 | + | ||
| 280 | + /** | ||
| 271 | * 分享 | 281 | * 分享 |
| 272 | */ | 282 | */ |
| 273 | toShare() { | 283 | toShare() { |
src/pages/hotSaleList/hotSaleList.vue
| @@ -192,20 +192,30 @@ | @@ -192,20 +192,30 @@ | ||
| 192 | } | 192 | } |
| 193 | } else { | 193 | } else { |
| 194 | 194 | ||
| 195 | - this.$nextTick(() => { | 195 | + // App外,唤起App |
| 196 | + this.openApp(); | ||
| 197 | + } | ||
| 198 | + }, | ||
| 196 | 199 | ||
| 197 | - // 唤起App | ||
| 198 | - if (typeof this.$parent.callAppModal === 'function' && typeof this.$refs.callApp === 'object') { | 200 | + /** |
| 201 | + * 唤起App封装 | ||
| 202 | + */ | ||
| 203 | + openApp() { | ||
| 199 | 204 | ||
| 200 | - // 设置唤起参数 | ||
| 201 | - let options = { | ||
| 202 | - success: this.$refs.callApp.callApp | ||
| 203 | - } | 205 | + this.$nextTick(() => { |
| 206 | + | ||
| 207 | + // 唤起App | ||
| 208 | + if (typeof this.$parent.callAppModal === 'function' && typeof this.$refs.callApp === 'object') { | ||
| 204 | 209 | ||
| 205 | - this.$parent.callAppModal(options); | 210 | + // 设置唤起参数 |
| 211 | + let options = { | ||
| 212 | + success: this.$refs.callApp.callApp | ||
| 206 | } | 213 | } |
| 207 | - }); | ||
| 208 | - } | 214 | + |
| 215 | + // 唤起App | ||
| 216 | + this.$parent.callAppModal(options); | ||
| 217 | + } | ||
| 218 | + }); | ||
| 209 | }, | 219 | }, |
| 210 | 220 | ||
| 211 | /** | 221 | /** |
src/pages/optimizationList/optimizationList.less
| @@ -51,6 +51,39 @@ | @@ -51,6 +51,39 @@ | ||
| 51 | height: auto; | 51 | height: auto; |
| 52 | } | 52 | } |
| 53 | } | 53 | } |
| 54 | + .video-fictitious-box { | ||
| 55 | + position: relative; | ||
| 56 | + margin: 0 auto; | ||
| 57 | + width: 90%; | ||
| 58 | + height: auto; | ||
| 59 | + border-radius: 24px; | ||
| 60 | + overflow: hidden; | ||
| 61 | + .poster-box { | ||
| 62 | + width: 100%; | ||
| 63 | + height: 354px; | ||
| 64 | + .poster-img { | ||
| 65 | + display: block; | ||
| 66 | + width: 100%; | ||
| 67 | + height: 354px; | ||
| 68 | + } | ||
| 69 | + } | ||
| 70 | + .play-button-box { | ||
| 71 | + position: absolute; | ||
| 72 | + top: 0; | ||
| 73 | + left: 0; | ||
| 74 | + z-index: 1; | ||
| 75 | + display: flex; | ||
| 76 | + justify-content: center; | ||
| 77 | + align-items: center; | ||
| 78 | + width: 100%; | ||
| 79 | + height: 100%; | ||
| 80 | + .play-button-img { | ||
| 81 | + display: block; | ||
| 82 | + width: 100px; | ||
| 83 | + height: 100px; | ||
| 84 | + } | ||
| 85 | + } | ||
| 86 | + } | ||
| 54 | .list-box { | 87 | .list-box { |
| 55 | margin: 0 auto; | 88 | margin: 0 auto; |
| 56 | width: 90%; | 89 | width: 90%; |
src/pages/optimizationList/optimizationList.vue
| @@ -27,10 +27,20 @@ | @@ -27,10 +27,20 @@ | ||
| 27 | <div class="content-box"> | 27 | <div class="content-box"> |
| 28 | 28 | ||
| 29 | <!-- 视频区块 --> | 29 | <!-- 视频区块 --> |
| 30 | - <div class="video-box" v-if="item.video"> | 30 | + <!-- <div class="video-box" v-if="item.video"> |
| 31 | <video class="video" controls :poster="item.video_img + SIGN.BIG"> | 31 | <video class="video" controls :poster="item.video_img + SIGN.BIG"> |
| 32 | <source :src="item.video" type="video/mp4" /> | 32 | <source :src="item.video" type="video/mp4" /> |
| 33 | </video> | 33 | </video> |
| 34 | + </div> --> | ||
| 35 | + | ||
| 36 | + <!-- 伪视频播放区域 --> | ||
| 37 | + <div class="video-fictitious-box" v-if="item.video" @click="playNow(item.video)"> | ||
| 38 | + <div class="poster-box"> | ||
| 39 | + <img :src="item.video_img + SIGN.BIG" class="poster-img" /> | ||
| 40 | + </div> | ||
| 41 | + <div class="play-button-box"> | ||
| 42 | + <img src="static/img/play_dark.png" class="play-button-img" /> | ||
| 43 | + </div> | ||
| 34 | </div> | 44 | </div> |
| 35 | 45 | ||
| 36 | <!-- 列表区块 --> | 46 | <!-- 列表区块 --> |
| @@ -153,6 +163,35 @@ | @@ -153,6 +163,35 @@ | ||
| 153 | }, | 163 | }, |
| 154 | 164 | ||
| 155 | /** | 165 | /** |
| 166 | + * 播放视频 | ||
| 167 | + * @param {String} videoUrl [数据对象] | ||
| 168 | + */ | ||
| 169 | + playNow(videoUrl) { | ||
| 170 | + | ||
| 171 | + // 判断App内 | ||
| 172 | + if (this.isCNLive.value) { | ||
| 173 | + | ||
| 174 | + // 判断通用跳转函数是否存在 | ||
| 175 | + if (typeof this.$parent.gotoDetail === 'function') { | ||
| 176 | + | ||
| 177 | + // 设置跳转参数 | ||
| 178 | + let params = { | ||
| 179 | + type: '22', | ||
| 180 | + to: videoUrl, | ||
| 181 | + shop_type: '' | ||
| 182 | + }; | ||
| 183 | + | ||
| 184 | + // 通用跳转 | ||
| 185 | + this.$parent.gotoDetail(params); | ||
| 186 | + } | ||
| 187 | + } else { | ||
| 188 | + | ||
| 189 | + // App外,唤起App | ||
| 190 | + this.openApp(); | ||
| 191 | + } | ||
| 192 | + }, | ||
| 193 | + | ||
| 194 | + /** | ||
| 156 | * 跳转商品详情 | 195 | * 跳转商品详情 |
| 157 | * @param {Object} item [数据对象] | 196 | * @param {Object} item [数据对象] |
| 158 | */ | 197 | */ |
| @@ -169,21 +208,30 @@ | @@ -169,21 +208,30 @@ | ||
| 169 | } | 208 | } |
| 170 | } else { | 209 | } else { |
| 171 | 210 | ||
| 172 | - this.$nextTick(() => { | 211 | + // App外,唤起App |
| 212 | + this.openApp(); | ||
| 213 | + } | ||
| 214 | + }, | ||
| 173 | 215 | ||
| 174 | - // 唤起App | ||
| 175 | - if (typeof this.$parent.callAppModal === 'function' && typeof this.$refs.callApp === 'object') { | 216 | + /** |
| 217 | + * 唤起App封装 | ||
| 218 | + */ | ||
| 219 | + openApp() { | ||
| 176 | 220 | ||
| 177 | - // 设置唤起参数 | ||
| 178 | - let options = { | ||
| 179 | - success: this.$refs.callApp.callApp | ||
| 180 | - } | 221 | + this.$nextTick(() => { |
| 222 | + | ||
| 223 | + // 唤起App | ||
| 224 | + if (typeof this.$parent.callAppModal === 'function' && typeof this.$refs.callApp === 'object') { | ||
| 181 | 225 | ||
| 182 | - // 唤起App | ||
| 183 | - this.$parent.callAppModal(options); | 226 | + // 设置唤起参数 |
| 227 | + let options = { | ||
| 228 | + success: this.$refs.callApp.callApp | ||
| 184 | } | 229 | } |
| 185 | - }); | ||
| 186 | - } | 230 | + |
| 231 | + // 唤起App | ||
| 232 | + this.$parent.callAppModal(options); | ||
| 233 | + } | ||
| 234 | + }); | ||
| 187 | }, | 235 | }, |
| 188 | 236 | ||
| 189 | /** | 237 | /** |
static/img/icon_stock_is_tight.png
0 → 100644
3.25 KB