Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
I
integral-mall
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
integralMall
integral-mall
Commits
bf1b77e8
Commit
bf1b77e8
authored
Feb 25, 2022
by
crushh
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update: 优化
parent
c1380ab7
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
36 additions
and
21 deletions
+36
-21
detail.vue
src/views/goods/coupon/detail.vue
+36
-21
No files found.
src/views/goods/coupon/detail.vue
View file @
bf1b77e8
...
@@ -1059,6 +1059,11 @@ export default {
...
@@ -1059,6 +1059,11 @@ export default {
this
.
limitTimesNum
=
Math
.
min
.
apply
(
null
,
this
.
limitTimesNumArr
);
this
.
limitTimesNum
=
Math
.
min
.
apply
(
null
,
this
.
limitTimesNumArr
);
this
.
couponCardStock
=
Math
.
min
.
apply
(
null
,
this
.
couponCardStockArr
);
this
.
couponCardStock
=
Math
.
min
.
apply
(
null
,
this
.
couponCardStockArr
);
}
}
const
params
=
{
coupCardId
:
this
.
cardList
.
map
(
item
=>
item
.
coupCardId
).
join
(
','
),
proType
:
1
,
};
this
.
getCardCost
(
params
);
}
}
this
.
couponStatus
=
this
.
cardList
.
some
(
item
=>
{
this
.
couponStatus
=
this
.
cardList
.
some
(
item
=>
{
return
item
.
status
===
0
;
return
item
.
status
===
0
;
...
@@ -1086,7 +1091,7 @@ export default {
...
@@ -1086,7 +1091,7 @@ export default {
this
.
showCardDialog
=
true
;
this
.
showCardDialog
=
true
;
},
},
// 子组件触发方法
// 子组件触发方法
async
selectCard
(
arr
)
{
selectCard
(
arr
)
{
console
.
log
(
arr
);
console
.
log
(
arr
);
if
(
arr
.
length
+
this
.
cardList
.
length
>
15
)
{
if
(
arr
.
length
+
this
.
cardList
.
length
>
15
)
{
this
.
$message
.
error
(
`最多支持添加15张卡券,目前一共选择
${
arr
.
length
+
this
.
cardList
.
length
}
张卡券`
);
this
.
$message
.
error
(
`最多支持添加15张卡券,目前一共选择
${
arr
.
length
+
this
.
cardList
.
length
}
张卡券`
);
...
@@ -1120,32 +1125,39 @@ export default {
...
@@ -1120,32 +1125,39 @@ export default {
coupCardId
:
this
.
cardList
.
map
(
item
=>
item
.
coupCardId
).
join
(
','
),
coupCardId
:
this
.
cardList
.
map
(
item
=>
item
.
coupCardId
).
join
(
','
),
proType
:
1
,
proType
:
1
,
};
};
const
res
=
await
request
.
post
(
'/api-integral-mall/get-integral-mall-CashCost'
,
qs
.
stringify
(
params
));
this
.
getCardCost
(
params
);
if
(
res
.
data
.
errorCode
===
0
)
{
}
if
(
res
.
data
.
result
.
costValue
)
{
},
this
.
costValueArr
=
[];
async
getCardCost
(
params
)
{
const
arr
=
res
.
data
.
result
.
costValue
.
split
(
','
);
const
res
=
await
request
.
post
(
'/api-integral-mall/get-integral-mall-CashCost'
,
qs
.
stringify
(
params
));
arr
.
forEach
(
item
=>
{
if
(
res
.
data
.
errorCode
===
0
)
{
this
.
costValueArr
.
push
(
Number
(
item
));
if
(
res
.
data
.
result
.
costValue
)
{
});
this
.
costValueArr
=
[];
const
sum
=
this
.
costValueArr
.
reduce
(
function
(
prev
,
cur
,
index
,
array
)
{
const
arr
=
res
.
data
.
result
.
costValue
.
split
(
','
);
return
prev
+
cur
;
arr
.
forEach
(
item
=>
{
});
this
.
costValueArr
.
push
(
Number
(
item
));
this
.
costValue
=
sum
;
});
}
const
sum
=
this
.
costValueArr
.
reduce
(
function
(
prev
,
cur
,
index
,
array
)
{
}
else
{
return
prev
+
cur
;
this
.
$message
.
error
(
res
.
data
.
message
);
});
this
.
costValue
=
sum
;
}
}
}
else
{
this
.
$message
.
error
(
res
.
data
.
message
);
}
}
},
},
deleteCard
(
index
)
{
deleteCard
(
index
)
{
this
.
cardList
.
splice
(
index
,
1
);
this
.
cardList
.
splice
(
index
,
1
);
this
.
cardCouponList
.
splice
(
index
,
1
);
this
.
cardCouponList
.
splice
(
index
,
1
);
this
.
costValueArr
.
splice
(
index
,
1
);
this
.
costValueArr
.
splice
(
index
,
1
);
const
sum
=
this
.
costValueArr
.
reduce
(
function
(
prev
,
cur
,
index
,
array
)
{
if
(
this
.
costValueArr
.
length
)
{
return
prev
+
cur
;
const
sum
=
this
.
costValueArr
.
reduce
(
function
(
prev
,
cur
,
index
,
array
)
{
});
return
prev
+
cur
;
this
.
costValue
=
sum
;
});
this
.
costValue
=
sum
;
}
else
{
this
.
costValue
=
0
;
}
if
(
this
.
cardList
.
length
>
0
)
{
if
(
this
.
cardList
.
length
>
0
)
{
this
.
limitTimesNumArr
=
[];
this
.
limitTimesNumArr
=
[];
this
.
couponCardStockArr
=
[];
this
.
couponCardStockArr
=
[];
...
@@ -1286,9 +1298,12 @@ export default {
...
@@ -1286,9 +1298,12 @@ export default {
async
submitForm
(
couponForm
)
{
async
submitForm
(
couponForm
)
{
this
.
couponForm
.
detailDescription
=
this
.
$refs
.
tinymceWrap
.
tinymceHtml
;
this
.
couponForm
.
detailDescription
=
this
.
$refs
.
tinymceWrap
.
tinymceHtml
;
const
proReferIdArr
=
[];
const
proReferIdArr
=
[];
if
(
this
.
cardList
.
length
===
0
)
{
if
(
!
this
.
cardList
.
length
)
{
this
.
$message
.
error
(
'请选择卡券'
);
this
.
$message
.
error
(
'请选择卡券'
);
return
false
;
return
false
;
}
else
if
(
this
.
isCopy
&&
this
.
cardList
.
filter
(
item
=>
item
.
status
!=
1
).
length
)
{
this
.
$message
.
error
(
'选择了无效卡券,无法保存'
);
return
false
;
}
else
{
}
else
{
for
(
const
item
of
this
.
cardList
)
{
for
(
const
item
of
this
.
cardList
)
{
proReferIdArr
.
push
(
item
.
coupCardId
);
proReferIdArr
.
push
(
item
.
coupCardId
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment