Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
C
center-shop-show-pc
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
EzijingWeb
center-shop-show-pc
Commits
d7b541cd
提交
d7b541cd
authored
6月 07, 2021
作者:
王鹏飞
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
bug fixes
上级
3f3d5628
隐藏空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
35 行增加
和
8 行删除
+35
-8
shop.vue
src/pages/shop.vue
+35
-8
没有找到文件。
src/pages/shop.vue
浏览文件 @
d7b541cd
...
...
@@ -4,9 +4,18 @@
<div
class=
"shop-content__left"
>
<div
class=
"left-con__top"
>
<div
class=
"swiper-box"
>
<img
class=
"banner"
:src=
"swiperBanner"
/>
<div
class=
"banner"
>
<video
:src=
"commodityData.main_chart_oss"
controls
v-if=
"isVideo"
></video>
<img
:src=
"swiperBanner"
v-else
/>
</div>
<div
class=
"swiper-tab__btn"
>
<swiper
ref=
"mySwiper"
:options=
"swiperOptions"
>
<swiper-slide
v-if=
"commodityData.main_chart_oss"
>
<img
:src=
"`$
{commodityData.main_chart_oss}?x-oss-process=video/snapshot,t_10,f_jpg,w_0,h_0,m_fast`"
@click="tabSwiperVideo"
/>
</swiper-slide>
<template
v-for=
"(item, index) in swiperBtnItem"
>
<swiper-slide
:key=
"index"
><img
:src=
"item"
@
click=
"tabSwiper(item)"
/></swiper-slide>
</
template
>
...
...
@@ -31,7 +40,9 @@
<div
class=
"name"
>
运费
</div>
<div
class=
"val"
>
无需配送
</div>
</div>
<div
class=
"buy-btn"
@
click=
"dialogVisible = true"
>
{{ commodityData.buy_button_text || '立即购买' }}
</div>
<div
class=
"buy-btn"
@
click=
"dialogVisible = true"
v-if=
"commodityData.status === '2'"
>
{{ buttonText }}
</div>
<div
class=
"buy-mode"
>
<div
class=
"name"
>
支付方式:
</div>
<div
class=
"li"
>
...
...
@@ -99,7 +110,8 @@ export default {
el
:
'.swiper-scrollbar'
,
hide
:
true
}
}
},
isVideo
:
false
}
},
computed
:
{
...
...
@@ -114,6 +126,9 @@ export default {
},
buyPreviewUrl
()
{
return
`
${
webConf
.
others
.
h5PreviewUrl
}
/buy?shop_id=
${
this
.
shopId
}
&spu_id=
${
this
.
goodsId
}
`
},
buttonText
()
{
return
this
.
commodityData
.
buy_button_text
||
'立即购买'
}
},
mounted
()
{
...
...
@@ -129,14 +144,20 @@ export default {
this
.
hotCommodity
=
res
.
data
return
}
this
.
commodityData
=
res
.
data
[
0
]
this
.
swiperBtnItem
=
JSON
.
parse
(
res
.
data
[
0
].
chart_oss
).
map
(
item
=>
item
.
url
)
const
[
goods
]
=
res
.
data
this
.
commodityData
=
goods
this
.
swiperBtnItem
=
JSON
.
parse
(
goods
.
chart_oss
).
map
(
item
=>
item
.
url
)
this
.
swiperBanner
=
this
.
swiperBtnItem
[
0
]
goods
.
main_chart_oss
&&
this
.
tabSwiperVideo
()
}
})
},
tabSwiper
(
src
)
{
this
.
isVideo
=
false
this
.
swiperBanner
=
src
},
tabSwiperVideo
()
{
this
.
isVideo
=
true
}
}
}
...
...
@@ -156,11 +177,17 @@ export default {
.swiper-box
{
width
:
420px
;
.banner
{
width
:
100%
;
height
:
420px
;
display
:
block
;
object-fit
:
contain
;
border
:
1px
solid
#f2f2f2
;
img
{
width
:
100%
;
height
:
100%
;
object-fit
:
contain
;
}
video
{
width
:
100%
;
height
:
100%
;
}
}
.swiper-tab__btn
{
margin-top
:
20px
;
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论