Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
提交反馈
为 GitLab 提交贡献
登录
切换导航
P
pica-annual-summary
项目
项目
详情
动态
版本
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
收起侧边栏
Close sidebar
动态
分支图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
com.pica.cloud.education.frontend
pica-annual-summary
提交
0a705d4d
提交
0a705d4d
编写于
10月 29, 2020
作者:
guangjun.yang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
状态等
商品新接口等
上级
058de8ea
变更
4
隐藏空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
59 行增加
和
45 行删除
+59
-45
component-list.vue
src/components/coupon/component-list.vue
+13
-13
component-select-list.vue
src/components/coupon/component-select-list.vue
+0
-19
coupon-list.vue
src/views/coupon/coupon-list.vue
+13
-1
goods-detail.vue
src/views/goods-detail.vue
+33
-12
未找到文件。
src/components/coupon/component-list.vue
浏览文件 @
0a705d4d
...
@@ -3,24 +3,24 @@
...
@@ -3,24 +3,24 @@
<li
class=
"list"
v-for=
"(item, index) in dataList"
:key=
"index"
>
<li
class=
"list"
v-for=
"(item, index) in dataList"
:key=
"index"
>
<section
class=
"item"
>
<section
class=
"item"
>
<div
class=
"left"
>
<div
class=
"left"
>
<p
class=
"name"
:class=
"
{'status': !item.
showStatus
}">
{{
item
.
couponName
}}
</p>
<p
class=
"name"
:class=
"
{'status': !item.
disabled
}">
{{
item
.
couponName
}}
</p>
<div
class=
"other"
>
<div
class=
"other"
>
<p
v-if=
"item.validTimeType == 2"
class=
"time-end"
:class=
"
{'status': !item.
showStatus
}">
<p
v-if=
"item.validTimeType == 2"
class=
"time-end"
:class=
"
{'status': !item.
disabled
}">
<span
v-if=
"item.couponStatus == 1"
>
距离到期仅剩
<span
class=
"coupon-pc"
>
{{
item
.
valid
TimeSpan
}}
</span>
天
</span>
<span
v-if=
"item.couponStatus == 1"
>
距离到期仅剩
<span
class=
"coupon-pc"
>
{{
item
.
valid
LeftDays
}}
</span>
天
</span>
<span
v-else
>
领取后
{{
item
.
validTimeSpan
}}
天内有效
</span>
<span
v-else
>
领取后
{{
item
.
validTimeSpan
}}
天内有效
</span>
</p>
</p>
<p
v-else
class=
"time-end"
:class=
"
{'status': !item.
showStatus
}">
{{
parseTime
(
item
.
startTime
)
}}
至
{{
parseTime
(
item
.
expireTime
)
}}
</p>
<p
v-else
class=
"time-end"
:class=
"
{'status': !item.
disabled
}">
{{
parseTime
(
item
.
startTime
)
}}
至
{{
parseTime
(
item
.
expireTime
)
}}
</p>
<p
v-show=
"!item.isAll"
class=
"rules"
>
<p
v-show=
"!item.isAll"
class=
"rules"
>
<span
:class=
"
{'status': !item.
showStatus
}" @click="toggleRules(item)">使用规则
</span>
<span
:class=
"
{'status': !item.
disabled
}" @click="toggleRules(item)">使用规则
</span>
<img
v-if=
"item.showRules"
src=
"../../images/coupon/arrow-down.png"
alt=
""
>
<img
v-if=
"item.showRules"
src=
"../../images/coupon/arrow-down.png"
alt=
""
>
<img
v-else
src=
"../../images/coupon/arrow-up.png"
alt=
""
>
<img
v-else
src=
"../../images/coupon/arrow-up.png"
alt=
""
>
</p>
</p>
<article
v-show=
"!item.
showStatus
"
class=
"status-wrapper"
>
<article
v-show=
"!item.
disabled
"
class=
"status-wrapper"
>
<img
v-if=
"item.isAll && item.couponStatus == 3"
src=
"../../images/coupon/status-lw.png"
alt=
""
>
<img
v-if=
"item.isAll && item.couponStatus == 3"
src=
"../../images/coupon/status-lw.png"
alt=
""
>
<img
v-if=
"item.isAll && (item.couponStatus ==
4 || item.couponStatus ==
5 || item.couponStatus == 6)"
src=
"../../images/coupon/status-sx.png"
alt=
""
>
<img
v-if=
"item.isAll && (item.couponStatus == 5 || item.couponStatus == 6)"
src=
"../../images/coupon/status-sx.png"
alt=
""
>
<img
v-if=
"!item.isAll && item.couponStatus == 6"
src=
"../../images/coupon/status-sy.png"
alt=
""
>
<img
v-if=
"!item.isAll && item.couponStatus == 6"
src=
"../../images/coupon/status-sy.png"
alt=
""
>
<img
v-if=
"!item.isAll && (item.couponStatus == 3 || item.couponStatus ==
4 || item.couponStatus ==
5)"
src=
"../../images/coupon/status-gq.png"
alt=
""
>
<img
v-if=
"!item.isAll && (item.couponStatus == 3 || item.couponStatus == 5)"
src=
"../../images/coupon/status-gq.png"
alt=
""
>
<!--
<img
v-else-if=
"item.couponStatus == 4"
src=
"../../images/coupon/status-gq.png"
alt=
""
>
<!--
<img
v-else-if=
"item.couponStatus == 4"
src=
"../../images/coupon/status-gq.png"
alt=
""
>
<img
v-else-if=
"item.couponStatus == 5"
src=
"../../images/coupon/status-gq.png"
alt=
""
>
<img
v-else-if=
"item.couponStatus == 5"
src=
"../../images/coupon/status-gq.png"
alt=
""
>
...
@@ -28,13 +28,13 @@
...
@@ -28,13 +28,13 @@
</article>
</article>
</div>
</div>
</div>
</div>
<div
class=
"right"
:class=
"
{'around': !item.
showStatus
}">
<div
class=
"right"
:class=
"
{'around': !item.
disabled
}">
<div
class=
"top"
>
<div
class=
"top"
>
<p
class=
"coupon-pc"
><span
class=
"symbol"
>
¥
</span><span
class=
"price"
:class=
"
{'opacity': !item.
showStatus
}">
{{
yuan
(
item
.
discountAmount
)
}}
</span></p>
<p
class=
"coupon-pc"
><span
class=
"symbol"
>
¥
</span><span
class=
"price"
:class=
"
{'opacity': !item.
disabled
}">
{{
yuan
(
item
.
discountAmount
)
}}
</span></p>
<p
class=
"desc"
:class=
"
{'opacity': !item.
showStatus
}">满
{{
yuan
(
item
.
requiredTotalFee
)
}}
元可用
</p>
<p
class=
"desc"
:class=
"
{'opacity': !item.
disabled
}">满
{{
yuan
(
item
.
requiredTotalFee
)
}}
元可用
</p>
</div>
</div>
<span
v-show=
"item.
showStatus
"
class=
"btn coupon-pc"
@
click=
"revieveOrUse(item)"
>
{{
getBtnText
(
item
)
}}
</span>
<span
v-show=
"item.
disabled && item.couponStatus != 4
"
class=
"btn coupon-pc"
@
click=
"revieveOrUse(item)"
>
{{
getBtnText
(
item
)
}}
</span>
<
!--
<span
v-show=
"item.showStatus && !showBtn"
class=
"btn-no"
>
未开始
</span>
--
>
<
span
v-show=
"item.disabled && item.couponStatus == 4"
class=
"btn-no"
>
未开始
</span
>
</div>
</div>
</section>
</section>
<section
v-show=
"item.showRules"
class=
"rule-list"
>
<section
v-show=
"item.showRules"
class=
"rule-list"
>
...
...
src/components/coupon/component-select-list.vue
浏览文件 @
0a705d4d
...
@@ -72,18 +72,6 @@ export default {
...
@@ -72,18 +72,6 @@ export default {
type
:
Boolean
,
type
:
Boolean
,
default
:
true
default
:
true
},
},
// currentCoupon: {
// type: Object,
// default: () => {
// return {};
// }
// }
// goodsInfo4Coupon: {
// type: Object,
// default: () => {
// return {};
// }
// }
},
},
data
()
{
data
()
{
...
@@ -95,7 +83,6 @@ export default {
...
@@ -95,7 +83,6 @@ export default {
//
//
watch
:
{
watch
:
{
isShowCoupon
:
{
isShowCoupon
:
{
// 处理是否可用
handler
(
newVal
)
{
handler
(
newVal
)
{
// 如果打开了选择弹框,则重新选中已经选中的项目
// 如果打开了选择弹框,则重新选中已经选中的项目
if
(
newVal
)
{
if
(
newVal
)
{
...
@@ -103,12 +90,6 @@ export default {
...
@@ -103,12 +90,6 @@ export default {
}
}
}
}
},
},
// 监听当前商品信息,如果价格改变,则要重新计算选择列表是否可用
// goodsInfo4Coupon: {
// handler(goodsInfo) {},
// deep: true
// }
},
},
computed
:
{
computed
:
{
...
...
src/views/coupon/coupon-list.vue
浏览文件 @
0a705d4d
...
@@ -152,7 +152,7 @@ export default {
...
@@ -152,7 +152,7 @@ export default {
// 是否显示对应的规则
// 是否显示对应的规则
item
.
showRules
=
false
;
item
.
showRules
=
false
;
// 是否可用
// 是否可用
item
.
showStatus
=
item
.
couponStatus
==
0
||
item
.
couponStatus
==
1
;
item
.
disabled
=
item
.
couponStatus
==
0
||
item
.
couponStatus
==
1
||
item
.
couponStatus
==
4
;
newList
.
push
(
item
);
newList
.
push
(
item
);
});
});
console
.
log
(
newList
);
console
.
log
(
newList
);
...
@@ -180,6 +180,18 @@ export default {
...
@@ -180,6 +180,18 @@ export default {
// 区分是否是我的优惠券
// 区分是否是我的优惠券
searchCoupons
()
{
searchCoupons
()
{
this
.
wechatShare
(
{
link
:
this
.
shareUrl
,
title
:
"优惠券中心"
,
friendtitle
:
"优惠券中心"
,
desc
:
"优惠券中心"
,
imgUrl
:
"https://file.yunqueyi.com/logo.png"
},
()
=>
{
console
.
log
(
"share success..."
);
}
);
if
(
this
.
fromPage
)
{
if
(
this
.
fromPage
)
{
this
.
getMyCoupons
();
this
.
getMyCoupons
();
}
else
{
}
else
{
...
...
src/views/goods-detail.vue
浏览文件 @
0a705d4d
...
@@ -14,8 +14,8 @@
...
@@ -14,8 +14,8 @@
<p
class=
"title"
>
{{
goods
.
goodsName
}}
</p>
<p
class=
"title"
>
{{
goods
.
goodsName
}}
</p>
<div
class=
"price"
>
<div
class=
"price"
>
<div
class=
"money"
>
<div
class=
"money"
>
<span
class=
"yuan"
>
¥
{{
goods
.
salePrice
.
yuan
}}
</span>
<span
class=
"yuan"
>
¥
{{
goods
.
salePrice
New
.
yuan
}}
</span>
<span
class=
"fen"
>
.
{{
goods
.
salePrice
.
fen
}}
</span>
<span
class=
"fen"
>
.
{{
goods
.
salePrice
New
.
fen
}}
</span>
<span
v-if=
"goods.hasDiscount"
class=
"del"
>
原价: ¥
{{
goods
.
costPriceText
}}
</span>
<span
v-if=
"goods.hasDiscount"
class=
"del"
>
原价: ¥
{{
goods
.
costPriceText
}}
</span>
</div>
</div>
<div
class=
"bought"
>
{{
goods
.
saledNum
}}
购买
</div>
<div
class=
"bought"
>
{{
goods
.
saledNum
}}
购买
</div>
...
@@ -131,6 +131,7 @@ export default {
...
@@ -131,6 +131,7 @@ export default {
token
:
""
,
token
:
""
,
isWeb
:
window
.
__isWeb
,
isWeb
:
window
.
__isWeb
,
goods
:
{
goods
:
{
salePriceNew
:
{},
salePrice
:
{}
salePrice
:
{}
},
// 商品信息
},
// 商品信息
totalPrice
:
{},
// 底部价格
totalPrice
:
{},
// 底部价格
...
@@ -145,6 +146,7 @@ export default {
...
@@ -145,6 +146,7 @@ export default {
isShowCoupon
:
false
,
//是否展示激活弹框,
isShowCoupon
:
false
,
//是否展示激活弹框,
courseUrl
:
""
,
courseUrl
:
""
,
defaultCouponId
:
""
,
defaultCouponId
:
""
,
needSortAndSelect
:
true
,
};
};
},
},
computed
:
{
computed
:
{
...
@@ -351,6 +353,7 @@ export default {
...
@@ -351,6 +353,7 @@ export default {
// 商品详情接口已经选择了一张, 则使用默认的
// 商品详情接口已经选择了一张, 则使用默认的
if
(
this
.
defaultCouponId
)
{
if
(
this
.
defaultCouponId
)
{
console
.
log
(
'in this.defaultCouponId'
,
this
.
defaultCouponId
);
let
cCoupon
=
couponList
.
find
(
item
=>
{
let
cCoupon
=
couponList
.
find
(
item
=>
{
return
item
.
couponId
==
this
.
defaultCouponId
;
return
item
.
couponId
==
this
.
defaultCouponId
;
});
});
...
@@ -454,7 +457,9 @@ export default {
...
@@ -454,7 +457,9 @@ export default {
this
.
setCurrentCoupon
(
currentCoupon
);
this
.
setCurrentCoupon
(
currentCoupon
);
this
.
getCPText
();
this
.
getCPText
();
this
.
isShowCoupon
=
false
;
this
.
isShowCoupon
=
false
;
this
.
needSortAndSelect
=
false
;
// 要重新调用计算价格接口
// 要重新调用计算价格接口
this
.
countTotalPrice
();
// this.getTotalPrice(currentCoupon);
// this.getTotalPrice(currentCoupon);
},
},
...
@@ -474,17 +479,18 @@ export default {
...
@@ -474,17 +479,18 @@ export default {
if
(
res
.
code
==
"000000"
)
{
if
(
res
.
code
==
"000000"
)
{
const
goods
=
res
.
data
;
const
goods
=
res
.
data
;
const
tabs
=
[];
const
tabs
=
[];
let
price
=
let
price
New
=
goods
.
preferentialPrice
||
goods
.
costPrice
;
goods
.
couponPrice
||
goods
.
preferentialPrice
||
goods
.
costPrice
;
let
price
=
goods
.
couponPrice
||
goods
.
preferentialPrice
||
goods
.
costPrice
;
this
.
goods
=
goods
;
this
.
goods
=
goods
;
this
.
defaultCouponId
=
goods
.
couponId
;
this
.
defaultCouponId
=
(
goods
.
couponDTO
&&
goods
.
couponDTO
.
couponId
)
||
''
;
// 获取到商品后,再获取优惠券
// 获取到商品后,再获取优惠券
this
.
getCanUseCoupons
({
this
.
getCanUseCoupons
({
goodsType
:
goods
.
goodsType
,
goodsType
:
goods
.
goodsType
,
cardType
:
goods
.
cardType
,
cardType
:
goods
.
cardType
,
price
:
price
,
price
:
price
New
,
count
:
0
count
:
0
});
});
goods
.
salePriceNew
=
this
.
formatPrice
(
priceNew
);
goods
.
salePrice
=
this
.
formatPrice
(
price
);
goods
.
salePrice
=
this
.
formatPrice
(
price
);
goods
.
costPriceText
=
(
goods
.
costPrice
/
100
).
toFixed
(
2
);
goods
.
costPriceText
=
(
goods
.
costPrice
/
100
).
toFixed
(
2
);
goods
.
hasDiscount
=
!!
(
goods
.
couponPrice
||
goods
.
preferentialPrice
);
goods
.
hasDiscount
=
!!
(
goods
.
couponPrice
||
goods
.
preferentialPrice
);
...
@@ -551,10 +557,10 @@ export default {
...
@@ -551,10 +557,10 @@ export default {
// TODO,要多传优惠券id参数
// TODO,要多传优惠券id参数
getTotalPrice
(
coupon
)
{
getTotalPrice
(
coupon
)
{
console
.
log
(
'coupon'
,
coupon
);
console
.
log
(
'coupon'
,
coupon
);
// const couponId = this.currentCoupon.couponId || 0;
const
num
=
this
.
curtGoodsNum
;
const
num
=
this
.
curtGoodsNum
;
// this.GET(`trade/goods/getPrice/${this.goodsId}/${num}/${couponId}`, {}).then(res => {
// this.GET(`trade/goods/getPrice/${this.goodsId}/${num}/${couponId}`, {}).then(res => {
this
.
GET
(
`trade/goods/getPrice/
${
this
.
goodsId
}
/
${
num
}
`
,
{}).
then
(
res
=>
{
const
couponId
=
this
.
currentCoupon
.
couponId
||
-
1
;
this
.
GET
(
`trade/goods/getPrice/
${
this
.
goodsId
}
/
${
num
}
/
${
couponId
}
`
,
{}).
then
(
res
=>
{
if
(
res
.
code
==
"000000"
)
{
if
(
res
.
code
==
"000000"
)
{
const
{
const
{
couponPrice
,
couponPrice
,
...
@@ -570,10 +576,13 @@ export default {
...
@@ -570,10 +576,13 @@ export default {
costPriceText
:
(
costPrice
/
100
).
toFixed
(
2
),
costPriceText
:
(
costPrice
/
100
).
toFixed
(
2
),
savePrice
:
savePrice
?
(
savePrice
/
100
).
toFixed
(
2
)
:
0
savePrice
:
savePrice
?
(
savePrice
/
100
).
toFixed
(
2
)
:
0
};
};
this
.
goodsInfo4Coupon
.
price
=
price
;
this
.
goodsInfo4Coupon
.
price
=
pr
eferentialPrice
||
costPr
ice
;
this
.
setGoodsInfo4Coupon
(
this
.
goodsInfo4Coupon
);
this
.
setGoodsInfo4Coupon
(
this
.
goodsInfo4Coupon
);
this
.
handlerCouponList
(
this
.
selectCouponList
,
price
);
this
.
goodsNum
=
num
;
this
.
goodsNum
=
num
;
if
(
this
.
needSortAndSelect
)
{
this
.
handlerCouponList
(
this
.
selectCouponList
,
preferentialPrice
||
costPrice
);
}
this
.
needSortAndSelect
=
true
;
}
else
if
(
res
.
code
===
"200006"
)
{
}
else
if
(
res
.
code
===
"200006"
)
{
this
.
$store
.
dispatch
(
"logout"
);
this
.
$store
.
dispatch
(
"logout"
);
}
}
...
@@ -702,9 +711,15 @@ export default {
...
@@ -702,9 +711,15 @@ export default {
if
(
!
id
||
isSale
!==
1
)
{
if
(
!
id
||
isSale
!==
1
)
{
return
;
return
;
}
}
// 重新使用优惠券
let
couponId
=
this
.
currentCoupon
&&
this
.
currentCoupon
.
couponId
||
0
;
// if(!couponId) {
// couponId = couponDTO ? couponDTO.couponId : 0;
// }
const
orderData
=
{
const
orderData
=
{
couponId
:
couponId
,
// couponId: couponDTO ? couponDTO.couponId : 0,
// couponId: couponDTO ? couponDTO.couponId : 0,
couponId
:
couponDTO
?
couponDTO
.
couponId
:
0
,
goodsId
:
id
,
goodsId
:
id
,
goodsQuantity
:
this
.
goodsNum
,
goodsQuantity
:
this
.
goodsNum
,
orderSource
:
3
,
orderSource
:
3
,
...
@@ -713,7 +728,8 @@ export default {
...
@@ -713,7 +728,8 @@ export default {
};
};
console
.
log
(
"orderData..."
,
orderData
);
console
.
log
(
"orderData..."
,
orderData
);
this
.
showLoading
=
true
;
this
.
showLoading
=
true
;
this
.
POST
(
"trade/center/order/createV2"
,
orderData
)
// this.POST("trade/center/order/createV2", orderData)
this
.
POST
(
"trade/center/order/createV4"
,
orderData
)
.
then
(
res
=>
{
.
then
(
res
=>
{
if
(
res
.
code
==
"000000"
)
{
if
(
res
.
code
==
"000000"
)
{
const
orderId
=
res
.
data
.
orderId
;
const
orderId
=
res
.
data
.
orderId
;
...
@@ -756,6 +772,7 @@ export default {
...
@@ -756,6 +772,7 @@ export default {
});
});
});
});
},
},
// 微信内支付
// 微信内支付
goWxPayInner
(
orderId
)
{
goWxPayInner
(
orderId
)
{
const
data
=
{
const
data
=
{
...
@@ -799,6 +816,7 @@ export default {
...
@@ -799,6 +816,7 @@ export default {
this
.
showLoading
=
false
;
this
.
showLoading
=
false
;
});
});
},
},
// 站外微信支付
// 站外微信支付
goWxPayOut
(
orderId
)
{
goWxPayOut
(
orderId
)
{
const
data
=
{
const
data
=
{
...
@@ -825,6 +843,8 @@ export default {
...
@@ -825,6 +843,8 @@ export default {
this
.
showLoading
=
false
;
this
.
showLoading
=
false
;
});
});
},
},
// 设置微信重定向URL
getRedirectUrl
(
orderId
)
{
getRedirectUrl
(
orderId
)
{
let
path
=
`profexam/#/prezult?orderId=
${
orderId
}
`
;
let
path
=
`profexam/#/prezult?orderId=
${
orderId
}
`
;
if
(
this
.
projectId
)
{
if
(
this
.
projectId
)
{
...
@@ -832,6 +852,7 @@ export default {
...
@@ -832,6 +852,7 @@ export default {
}
}
return
getWebPageUrl
(
path
);
return
getWebPageUrl
(
path
);
},
},
// 绑定项目和订单的关系(idType=1)
// 绑定项目和订单的关系(idType=1)
createRelation
(
projectId
,
orderId
)
{
createRelation
(
projectId
,
orderId
)
{
this
.
POST
(
`cme/projectCard/correlation/1/
${
projectId
}
/
${
orderId
}
`
,
{
this
.
POST
(
`cme/projectCard/correlation/1/
${
projectId
}
/
${
orderId
}
`
,
{
...
...
写
预览
Markdown
格式
0%
请重试
or
附加一个文件
附加文件
取消
您添加了
0
人
到此讨论。请谨慎行事。
先完成此消息的编辑!
取消
想要评论请
注册
或
登录