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
提交
9813a822
提交
9813a822
编写于
10月 31, 2020
作者:
guangjun.yang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
代码整理
上级
d80f67c2
变更
4
展开全部
隐藏空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
0 行增加
和
3053 行删除
+0
-3053
goods-detail copy 1022.vue
src/views/goods-detail copy 1022.vue
+0
-729
goods-detail copy 1131.vue
src/views/goods-detail copy 1131.vue
+0
-1092
goods-detail copy.vue
src/views/goods-detail copy.vue
+0
-1132
goods-detail.vue
src/views/goods-detail.vue
+0
-100
未找到文件。
src/views/goods-detail copy 1022.vue
已删除
100644 → 0
浏览文件 @
d80f67c2
此差异已折叠。
点击以展开。
src/views/goods-detail copy 1131.vue
已删除
100644 → 0
浏览文件 @
d80f67c2
此差异已折叠。
点击以展开。
src/views/goods-detail copy.vue
已删除
100644 → 0
浏览文件 @
d80f67c2
此差异已折叠。
点击以展开。
src/views/goods-detail.vue
浏览文件 @
9813a822
...
...
@@ -179,14 +179,6 @@ export default {
},
deep
:
true
},
// // 监听当前商品信息
// goodsInfo4Coupon: {
// handler(goodsInfo) {
// this.setSelectCouponList(this.selectCouponList);
// },
// deep: true
// }
},
created
()
{
...
...
@@ -197,7 +189,6 @@ export default {
this
.
projectId
=
this
.
$route
.
query
.
projectId
;
this
.
goodsId
=
this
.
$route
.
query
.
goodsId
||
74
;
this
.
courseUrl
=
this
.
$route
.
query
.
courseUrl
||
""
;
//
// this.couponIdFromGoodsList = this.$route.query.couponId || ""; //
this
.
shareUrl
=
getWebPageUrl
(
`profexam/#/goods-detail?goodsId=
${
this
.
goodsId
}
`
);
...
...
@@ -234,7 +225,6 @@ export default {
mounted
()
{
this
.
getTabW
();
console
.
log
(
"this.isWeb ... isWechat - 1"
,
this
.
isWeb
,
isWechat
);
// 数量加减
this
.
curtGoodsNum
=
this
.
goodsNum
;
this
.
countTotalPrice
=
debounce
(
this
.
getTotalPrice
,
300
);
...
...
@@ -314,21 +304,15 @@ export default {
firstCanCouponIndex
=
0
,
item
=
{},
count
=
0
;
// couponList.sort( (a, b) => {
// return b.discountAmount - a.discountAmount;
// });
for
(
let
i
=
0
;
i
<
couponList
.
length
;
i
++
)
{
item
=
couponList
[
i
];
// couponList.forEach(item => {
// 要根据商品价格及券适用类型来计算
// item.disabled = !this.isCanSelect(item, goodsPrice);
item
.
disabled
=
!
item
.
enableFlag
;
if
(
!
item
.
disabled
)
{
count
++
;
}
// 是否已经选择
item
.
isChecked
=
!!
item
.
checkFlag
;
// console.log('firstCanCoupon, item.disabled', firstCanCoupon, item.disabled);
if
(
!
firstCanCoupon
&&
item
.
isChecked
)
{
firstCanCoupon
=
item
;
firstCanCouponIndex
=
i
;
...
...
@@ -337,92 +321,11 @@ export default {
}
this
.
setCurrentCoupon
(
JSON
.
parse
(
JSON
.
stringify
(
firstCanCoupon
))
||
{});
// this.setSelectCouponList(newList.concat(sortArray));
this
.
setSelectCouponList
(
newList
);
this
.
goodsInfo4Coupon
.
count
=
count
;
this
.
setGoodsInfo4Coupon
(
this
.
goodsInfo4Coupon
);
},
// 处理数据,并且先排序,再将不可用的放在最后
handlerCouponListOld
(
couponList
,
goodsPrice
)
{
if
(
!
couponList
.
length
)
return
[];
let
newList
=
[],
obj
=
{},
firstCanCoupon
=
null
,
firstCanCouponIndex
=
0
,
item
=
{},
count
=
0
;
// couponList.sort( (a, b) => {
// return b.discountAmount - a.discountAmount;
// });
for
(
let
i
=
0
;
i
<
couponList
.
length
;
i
++
)
{
item
=
couponList
[
i
];
// couponList.forEach(item => {
// 要根据商品价格及券适用类型来计算
item
.
disabled
=
!
this
.
isCanSelect
(
item
,
goodsPrice
);
if
(
!
item
.
disabled
)
{
count
++
;
}
// 是否已经选择
item
.
isChecked
=
false
;
// console.log('firstCanCoupon, item.disabled', firstCanCoupon, item.disabled);
if
(
!
firstCanCoupon
&&
!
item
.
disabled
)
{
console
.
log
(
'!firstCanCoupon'
);
item
.
isChecked
=
true
;
firstCanCoupon
=
item
;
firstCanCouponIndex
=
i
;
}
newList
.
push
(
item
);
}
// 如果是从商品列表选择过来的,则要选中这个优惠券
// 如果优惠券不可用
// if(isFromGoodsList) {
// let cCoupon = couponList.find( item => {
// return item.couponId == this.couponId;
// });
// if(cCoupon.isChecked) {
// firstCanCoupon = cCoupon;
// } else {
// firstCanCoupon = {};
// couponList[firstCanCouponIndex].isChecked = false;
// }
// }
// 商品详情接口已经选择了一张, 则使用默认的
if
(
this
.
defaultCouponId
)
{
console
.
log
(
'in this.defaultCouponId'
,
this
.
defaultCouponId
);
let
cCoupon
=
couponList
.
find
(
item
=>
{
return
item
.
couponId
==
this
.
defaultCouponId
;
});
if
(
cCoupon
&&
cCoupon
.
isChecked
)
{
firstCanCoupon
=
cCoupon
;
}
else
{
firstCanCoupon
=
{};
couponList
[
firstCanCouponIndex
].
isChecked
=
false
;
}
}
// 将不可用的放在最后
let
sortArray
=
[],
c
=
{};
for
(
let
i
=
0
;
i
<
newList
.
length
;
i
++
)
{
c
=
newList
[
i
];
if
(
c
.
disabled
)
{
sortArray
.
push
(
c
);
newList
.
splice
(
i
,
1
);
i
--
;
}
}
this
.
setCurrentCoupon
(
JSON
.
parse
(
JSON
.
stringify
(
firstCanCoupon
))
||
{});
this
.
setSelectCouponList
(
newList
.
concat
(
sortArray
));
this
.
goodsInfo4Coupon
.
count
=
count
;
this
.
setGoodsInfo4Coupon
(
this
.
goodsInfo4Coupon
);
return
newList
;
},
// 判断是否可用
isCanSelect
(
coupon
,
goodsPrice
)
{
console
.
log
(
...
...
@@ -546,9 +449,6 @@ export default {
);
}
}
// if (goods.couponDTO) {
// goods.couponAmountText = (goods.couponDTO.discountAmount / 100).toFixed(2);
// }
if
(
goods
.
goodsDescWhere
)
{
tabs
.
push
({
name
:
"使用范围"
,
detail
:
goods
.
goodsDescWhere
});
}
...
...
写
预览
Markdown
格式
0%
请重试
or
附加一个文件
附加文件
取消
您添加了
0
人
到此讨论。请谨慎行事。
先完成此消息的编辑!
取消
想要评论请
注册
或
登录