Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
提交反馈
为 GitLab 提交贡献
登录
切换导航
P
pica-professional-exam
项目
项目
详情
动态
版本
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
收起侧边栏
Close sidebar
动态
分支图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
com.pica.cloud.education.frontend
pica-professional-exam
提交
cf87bd7a
提交
cf87bd7a
编写于
11月 05, 2020
作者:
guangjun.yang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
去掉alert日志
上级
ff85213f
变更
1
隐藏空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
84 行增加
和
84 行删除
+84
-84
goods-detail.vue
src/views/goods-detail.vue
+84
-84
未找到文件。
src/views/goods-detail.vue
浏览文件 @
cf87bd7a
...
...
@@ -116,7 +116,7 @@
needSubContent
:isShowDialog=
"isShowCantBuyTips"
@
handlerAction=
"isShowCantBuyTips=false"
></ShowCantBuyTips>
></ShowCantBuyTips>
</div>
</
template
>
...
...
@@ -186,7 +186,7 @@ export default {
shareTitleInfo
:
""
,
isShowShare
:
true
,
isShowCantBuyTips
:
false
,
couponToken
:
""
,
couponToken
:
""
};
},
computed
:
{
...
...
@@ -229,8 +229,8 @@ export default {
this
.
projectId
=
this
.
$route
.
query
.
projectId
;
this
.
goodsId
=
this
.
$route
.
query
.
goodsId
;
this
.
courseUrl
=
this
.
$route
.
query
.
courseUrl
||
""
;
//
this
.
couponToken
=
this
.
$route
.
query
.
couponToken
||
""
alert
(
this
.
couponToken
);
this
.
couponToken
=
this
.
$route
.
query
.
couponToken
||
""
;
console
.
log
(
'this.couponToken'
,
this
.
couponToken
);
this
.
shareUrl
=
getWebPageUrl
(
`profexam/#/goods-detail?goodsId=
${
this
.
goodsId
}
`
);
...
...
@@ -280,7 +280,8 @@ export default {
if
(
this
.
isWeb
)
{
let
{
token
,
info
}
=
this
.
$store
.
state
.
user
;
token
=
token
||
this
.
couponToken
||
token
||
this
.
couponToken
||
localStorage
.
getItem
(
"couponToken"
)
||
getCookie
(
"couponToken"
);
this
.
token
=
token
;
...
...
@@ -293,8 +294,8 @@ export default {
if
(
token
&&
!
info
.
id
)
{
// this.commonCheckToken(() => {
// this.$store.dispatch('setToken', this.token);
this
.
$store
.
dispatch
(
"getUserInfo"
);
// this.$store.dispatch('setToken', this.token);
this
.
$store
.
dispatch
(
"getUserInfo"
);
// });
// return;
}
...
...
@@ -475,84 +476,83 @@ export default {
return
;
}
// this.commonCheckToken(() => {
this
.
GET
(
`trade/goods/goodInfoV3/
${
this
.
goodsId
}
`
,
{}).
then
(
res
=>
{
if
(
res
.
code
==
"000000"
)
{
const
goods
=
res
.
data
;
const
tabs
=
[];
let
priceNew
=
goods
.
preferentialPrice
||
goods
.
costPrice
;
let
price
=
goods
.
couponPrice
||
goods
.
preferentialPrice
||
goods
.
costPrice
;
this
.
goods
=
goods
;
this
.
defaultCouponId
=
(
goods
.
couponDTO
&&
goods
.
couponDTO
.
couponId
)
||
""
;
// 获取到商品后,再获取优惠券
this
.
getCanUseCoupons
({
goodsType
:
goods
.
goodsType
,
cardType
:
goods
.
cardType
,
price
:
priceNew
,
count
:
0
});
goods
.
salePriceNew
=
this
.
formatPrice
(
priceNew
);
goods
.
salePrice
=
this
.
formatPrice
(
price
);
goods
.
costPriceText
=
(
goods
.
costPrice
/
100
).
toFixed
(
2
);
goods
.
hasDiscount
=
!!
goods
.
preferentialPrice
;
// goods.hasDiscount = !!(goods.couponPrice || goods.preferentialPrice);
let
savePrice
=
0
;
if
(
goods
.
couponPrice
)
{
if
(
goods
.
preferentialPrice
)
{
savePrice
=
(
(
goods
.
preferentialPrice
-
goods
.
couponPrice
)
/
100
).
toFixed
(
2
);
}
else
{
savePrice
=
(
(
goods
.
costPrice
-
goods
.
couponPrice
)
/
100
).
toFixed
(
2
);
}
}
if
(
goods
.
goodsDescWhere
)
{
tabs
.
push
({
name
:
"使用范围"
,
detail
:
goods
.
goodsDescWhere
});
}
if
(
goods
.
goodsDescHow
)
{
tabs
.
push
({
name
:
"如何使用"
,
detail
:
goods
.
goodsDescHow
});
}
if
(
goods
.
goodsDescQaq
)
{
tabs
.
push
({
name
:
"常见问题"
,
detail
:
goods
.
goodsDescQaq
});
this
.
GET
(
`trade/goods/goodInfoV3/
${
this
.
goodsId
}
`
,
{}).
then
(
res
=>
{
if
(
res
.
code
==
"000000"
)
{
const
goods
=
res
.
data
;
const
tabs
=
[];
let
priceNew
=
goods
.
preferentialPrice
||
goods
.
costPrice
;
let
price
=
goods
.
couponPrice
||
goods
.
preferentialPrice
||
goods
.
costPrice
;
this
.
goods
=
goods
;
this
.
defaultCouponId
=
(
goods
.
couponDTO
&&
goods
.
couponDTO
.
couponId
)
||
""
;
// 获取到商品后,再获取优惠券
this
.
getCanUseCoupons
({
goodsType
:
goods
.
goodsType
,
cardType
:
goods
.
cardType
,
price
:
priceNew
,
count
:
0
});
goods
.
salePriceNew
=
this
.
formatPrice
(
priceNew
);
goods
.
salePrice
=
this
.
formatPrice
(
price
);
goods
.
costPriceText
=
(
goods
.
costPrice
/
100
).
toFixed
(
2
);
goods
.
hasDiscount
=
!!
goods
.
preferentialPrice
;
// goods.hasDiscount = !!(goods.couponPrice || goods.preferentialPrice);
let
savePrice
=
0
;
if
(
goods
.
couponPrice
)
{
if
(
goods
.
preferentialPrice
)
{
savePrice
=
(
(
goods
.
preferentialPrice
-
goods
.
couponPrice
)
/
100
).
toFixed
(
2
);
}
else
{
savePrice
=
((
goods
.
costPrice
-
goods
.
couponPrice
)
/
100
).
toFixed
(
2
);
}
this
.
totalPrice
=
{
...
goods
.
salePrice
,
preferentialPrice
:
goods
.
preferentialPrice
,
costPrice
:
goods
.
costPrice
,
costPriceText
:
goods
.
costPriceText
,
savePrice
};
this
.
swiperList
=
(
res
.
data
&&
res
.
data
.
imgList
)
||
[];
this
.
tabs
=
tabs
;
this
.
getTabW
();
let
sharePrice
=
goods
.
preferentialPrice
||
goods
.
costPrice
;
let
shareTitleInfo
=
"¥"
+
(
sharePrice
/
100
).
toFixed
(
2
);
shareTitleInfo
+=
"
\n
"
+
(
goods
.
shareContent
||
""
);
let
shareUrl
=
getWebPageUrl
(
`profexam/#/goods-detail?goodsId=
${
this
.
goods
.
id
}
`
);
this
.
shareTitleInfo
=
shareTitleInfo
;
this
.
wechatShare
(
{
link
:
shareUrl
,
title
:
goods
.
goodsName
,
friendtitle
:
goods
.
goodsName
,
desc
:
shareTitleInfo
,
imgUrl
:
"https://file.yunqueyi.com/logo.png"
},
()
=>
{
console
.
log
(
"share success..."
);
}
);
}
else
{
this
.
$toast
(
res
.
message
);
}
});
if
(
goods
.
goodsDescWhere
)
{
tabs
.
push
({
name
:
"使用范围"
,
detail
:
goods
.
goodsDescWhere
});
}
if
(
goods
.
goodsDescHow
)
{
tabs
.
push
({
name
:
"如何使用"
,
detail
:
goods
.
goodsDescHow
});
}
if
(
goods
.
goodsDescQaq
)
{
tabs
.
push
({
name
:
"常见问题"
,
detail
:
goods
.
goodsDescQaq
});
}
this
.
totalPrice
=
{
...
goods
.
salePrice
,
preferentialPrice
:
goods
.
preferentialPrice
,
costPrice
:
goods
.
costPrice
,
costPriceText
:
goods
.
costPriceText
,
savePrice
};
this
.
swiperList
=
(
res
.
data
&&
res
.
data
.
imgList
)
||
[];
this
.
tabs
=
tabs
;
this
.
getTabW
();
let
sharePrice
=
goods
.
preferentialPrice
||
goods
.
costPrice
;
let
shareTitleInfo
=
"¥"
+
(
sharePrice
/
100
).
toFixed
(
2
);
shareTitleInfo
+=
"
\n
"
+
(
goods
.
shareContent
||
""
);
let
shareUrl
=
getWebPageUrl
(
`profexam/#/goods-detail?goodsId=
${
this
.
goods
.
id
}
`
);
this
.
shareTitleInfo
=
shareTitleInfo
;
this
.
wechatShare
(
{
link
:
shareUrl
,
title
:
goods
.
goodsName
,
friendtitle
:
goods
.
goodsName
,
desc
:
shareTitleInfo
,
imgUrl
:
"https://file.yunqueyi.com/logo.png"
},
()
=>
{
console
.
log
(
"share success..."
);
}
);
}
else
{
this
.
$toast
(
res
.
message
);
}
});
// });
},
...
...
@@ -676,7 +676,7 @@ export default {
preCreateOrder
()
{
this
.
commonCheckToken
(()
=>
{
const
{
goodsType
,
cardType
}
=
this
.
goods
;
console
.
log
(
'goodsType, cardType'
,
goodsType
,
cardType
);
console
.
log
(
"goodsType, cardType"
,
goodsType
,
cardType
);
// 只有一类卡才做相应判断
if
(
goodsType
==
2
&&
cardType
==
1
)
{
this
.
GET
(
...
...
写
预览
Markdown
格式
0%
请重试
or
附加一个文件
附加文件
取消
您添加了
0
人
到此讨论。请谨慎行事。
先完成此消息的编辑!
取消
想要评论请
注册
或
登录