Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
lumastoreapp
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
xieyishang
lumastoreapp
Commits
680b44a7
Commit
680b44a7
authored
Dec 18, 2023
by
xieyishang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
~~
parent
59085910
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
313 additions
and
310 deletions
+313
-310
manifest.json
manifest.json
+2
-2
pages/CardSend/CardSend.vue
pages/CardSend/CardSend.vue
+311
-308
No files found.
manifest.json
View file @
680b44a7
...
...
@@ -2,8 +2,8 @@
"name"
:
"鹿马商家助手"
,
"appid"
:
"__UNI__1EA80F1"
,
//这个是
web
的
"description"
:
"商家"
,
"versionName"
:
"1.19
7
"
,
"versionCode"
:
119
7
,
"versionName"
:
"1.19
9
"
,
"versionCode"
:
119
9
,
"transformPx"
:
false
,
"compatible"
:
{
"ignoreVersion"
:
true
//
true
表示忽略版本检查提示框,HBuilderX
1.9
.
0
及以上版本支持
...
...
pages/CardSend/CardSend.vue
View file @
680b44a7
...
...
@@ -3,10 +3,10 @@
<!-- 卡券 -->
<view
class=
"CardSend yicode"
>
<view
class=
"cardhead flex ali-c "
>
<view
class=
"tabitems flex1"
:class=
"
{active:tabactive==1}" @tap="taggleTab(1)"
>
<view
class=
"tabitems flex1"
:class=
"
{active:tabactive==1}" @tap="taggleTab(1)">
<view
class=
"titles"
>
卡券发放
</view>
</view>
<view
class=
"tabitems flex1 "
:class=
"
{active:tabactive==2}" @tap="taggleTab(2)"
>
<view
class=
"tabitems flex1 "
:class=
"
{active:tabactive==2}" @tap="taggleTab(2)">
<view
class=
"titles "
>
已发卡券
</view>
</view>
</view>
...
...
@@ -21,27 +21,32 @@
<view
class=
"inputitem flex"
>
<view
class=
"names"
>
优惠券名称
</view>
<input
type=
"text"
placeholder=
"请填写优惠券名称"
v-model=
"parameter.coupon_name"
class=
"inputs"
placeholder-class=
"plclass"
>
<input
type=
"text"
placeholder=
"请填写优惠券名称"
v-model=
"parameter.coupon_name"
class=
"inputs"
placeholder-class=
"plclass"
>
</view>
<view
class=
"inputitem flex"
>
<view
class=
"names"
>
优惠金额
</view>
<input
type=
"number"
placeholder=
"请填写优惠金额"
v-model=
"parameter.money"
class=
"inputs"
placeholder-class=
"plclass"
>
<input
type=
"number"
placeholder=
"请填写优惠金额"
v-model=
"parameter.money"
class=
"inputs"
placeholder-class=
"plclass"
>
</view>
<view
class=
"inputitem flex"
>
<view
class=
"names"
>
每人最大领取数
</view>
<input
type=
"number"
placeholder=
"请填写领取数 "
v-model=
"parameter.max_fetch"
class=
"inputs"
placeholder-class=
"plclass"
>
<input
type=
"number"
placeholder=
"请填写领取数 "
v-model=
"parameter.max_fetch"
class=
"inputs"
placeholder-class=
"plclass"
>
</view>
<view
class=
"inputitem flex"
>
<view
class=
"names"
>
满多少元可以使用
</view>
<input
type=
"number"
placeholder=
"请填写满多少元可以使用"
v-model=
"parameter.at_least"
class=
"inputs"
placeholder-class=
"plclass"
>
<input
type=
"number"
placeholder=
"请填写满多少元可以使用"
v-model=
"parameter.at_least"
class=
"inputs"
placeholder-class=
"plclass"
>
</view>
<view
class=
"inputitem flex"
>
<view
class=
"names"
>
发放数量
</view>
<input
type=
"number"
placeholder=
"请填写发放的数量"
v-model=
"parameter.count"
class=
"inputs"
placeholder-class=
"plclass"
>
<input
type=
"number"
placeholder=
"请填写发放的数量"
v-model=
"parameter.count"
class=
"inputs"
placeholder-class=
"plclass"
>
</view>
</view>
<!-- 第一块结束 -->
...
...
@@ -52,7 +57,7 @@
<view
class=
"title"
>
发放范围
</view>
<view
class=
"chilidlist flex"
>
<radio-group
class=
"flex ali-c jus-b chilidlistbox"
@
change=
"radioChange"
>
<label
class=
"flex ali-c"
>
<label
class=
"flex ali-c"
>
<view>
<radio
color=
"#FF6900"
value=
"1"
:checked=
"parameter.give_type==1"
/>
</view>
...
...
@@ -77,7 +82,7 @@
<view
class=
"title"
@
tap=
"togglePopup"
>
参与商品
</view>
<view
class=
"chilidlist flex"
>
<radio-group
class=
"flex ali-c chilidlistbox"
@
change=
"radioChange1"
>
<label
class=
"flex ali-c mr_130"
>
<label
class=
"flex ali-c mr_130"
>
<view>
<radio
color=
"#FF6900"
value=
"1"
:checked=
"parameter.range_type==1"
/>
</view>
...
...
@@ -113,20 +118,25 @@
<view
class=
"timeboxs flex ali-c"
>
<view
class=
"title"
>
发放时间
</view>
<view
class=
"inputbox"
@
tap=
"showtime(1)"
>
<input
type=
"text"
class=
"inputs"
value=
""
v-model=
"parameter.start_time"
disabled=
"disabled"
placeholder=
"投放时间"
placeholder-class=
"plclass"
/>
<image
class=
"jiantouicon"
v-show=
"parameter.start_time==''"
src=
"/static/news/xiamassfd.png"
mode=
""
></image>
<input
type=
"text"
class=
"inputs"
value=
""
v-model=
"parameter.start_time"
disabled=
"disabled"
placeholder=
"投放时间"
placeholder-class=
"plclass"
/>
<image
class=
"jiantouicon"
v-show=
"parameter.start_time==''"
src=
"/static/news/xiamassfd.png"
mode=
""
></image>
</view>
<view
style=
"margin-left: 10;"
>
-
</view>
<view
class=
"inputbox"
style=
"margin-left: 0;"
@
tap=
"showtime(2)"
>
<input
type=
"text"
class=
"inputs"
value=
""
v-model=
"parameter.end_time"
disabled=
"disabled"
placeholder=
"到期时间"
placeholder-class=
"plclass"
/>
<image
class=
"jiantouicon"
v-show=
"parameter.start_time==''"
src=
"/static/news/xiamassfd.png"
mode=
""
></image>
<input
type=
"text"
class=
"inputs"
value=
""
v-model=
"parameter.end_time"
disabled=
"disabled"
placeholder=
"到期时间"
placeholder-class=
"plclass"
/>
<image
class=
"jiantouicon"
v-show=
"parameter.start_time==''"
src=
"/static/news/xiamassfd.png"
mode=
""
></image>
</view>
</view>
<view
class=
"submitbtns flexc"
v-show=
"!parameter.id"
:class=
"
{active:istruesub}" @tap="coupons" >确定发放
</view>
<view
class=
"submitbtns flexc"
v-show=
"parameter.id"
:class=
"
{active:istruesub}" @tap="coupons" >编辑提交
</view>
<view
class=
"submitbtns flexc"
v-show=
"parameter.id"
:class=
"
{active:istruesub}" @tap="colesedit" >取消编辑
</view>
<view
class=
"submitbtns flexc"
v-show=
"!parameter.id"
:class=
"
{active:istruesub}" @tap="coupons">确定发放
</view>
<view
class=
"submitbtns flexc"
v-show=
"parameter.id"
:class=
"
{active:istruesub}" @tap="coupons">编辑提交
</view>
<view
class=
"submitbtns flexc"
v-show=
"parameter.id"
:class=
"
{active:istruesub}" @tap="colesedit">取消编辑
</view>
</view>
...
...
@@ -141,8 +151,10 @@
<view
class=
"status"
>
当前状态:
{{
item
.
status
==
0
?
'
投放中
'
:
'
未投放
'
}}
</view>
</view>
<view
class=
"kaiguan flex ali-c"
>
<view
class=
"kai kgitem flexc"
@
tap=
"switch_couponsFun(item,2,index)"
:class=
"
{active:item.status==0}">开启
</view>
<view
class=
"kai kgitem flexc"
@
tap=
"switch_couponsFun(item,0,index)"
:class=
"
{active:item.status==2}">关闭
</view>
<view
class=
"kai kgitem flexc"
@
tap=
"switch_couponsFun(item,2,index)"
:class=
"
{active:item.status==0}">开启
</view>
<view
class=
"kai kgitem flexc"
@
tap=
"switch_couponsFun(item,0,index)"
:class=
"
{active:item.status==2}">关闭
</view>
</view>
</view>
<view
class=
"quaninfos"
>
...
...
@@ -167,10 +179,10 @@
</view>
<view
class=
"cardright flexc"
>
<view>
<text
class=
"bj pr-10"
@
tap=
"detailsFun(item)"
>
编辑
</text>
<text
class=
"bj pr-10"
style=
"color:#2196F3;"
@
tap=
"detailsFun(item)"
>
编辑
</text>
<view
class=
"text"
>
优惠
</view>
<view
class=
"prcie mb-20"
>
{{
item
.
money
}}
元
</view>
<text
class=
"bj pr-10"
@
tap=
"deleteFun(item)"
>
删除
</text>
<text
class=
"bj pr-10"
style=
"color:#2196F3;"
@
tap=
"deleteFun(item)"
>
删除
</text>
</view>
</view>
...
...
@@ -197,21 +209,25 @@
<!-- scroll scroll-left="120" -->
<!-- @scroll="" -->
<scroll-view
class=
"scroll-view_H"
style=
"height: 50vh;"
scroll-y=
"true"
>
<scroll-view
class=
"scroll-view_H"
style=
"height: 50vh;"
scroll-y=
"true"
>
<view
class=
"chindlist "
>
<radio-group
class=
"flex ali-c flex-wrap chilidlistbox"
@
change=
"radioChange2"
v-model=
"parameter.goods_id"
>
<!-- v-model="parameter.goods_id" -->
<checkbox-group
class=
"flex ali-c flex-wrap chilidlistbox"
@
change=
"radioChange2"
>
<label
class=
"flex ali-c jus-b itemlable"
v-for=
"(item,index) in shoplist"
:key=
"index"
>
<view
class=
"itemname"
>
{{
item
.
product_name
}}
</view>
<view
class=
"checkbox"
>
<radio
color=
"#FF6900"
@
change=
"radioChange2"
:value=
"item.product_id"
:checked=
"item.checked"
/>
<!--
<radio
color=
"#FF6900"
@
change=
"radioChange2"
:value=
"item.product_id"
:checked=
"item.checked"
/>
-->
<!-- :value="item.product_id" :checked="item.checked" -->
<!-- @change="radioChange2" -->
<checkbox
color=
"#FF6900"
:value=
"item.product_id"
:checked=
"item.checked"
/>
</view>
</label>
</
radio
-group>
<view
class=
"xiayiye title"
@
tap=
"nextPage"
v-if=
"xianshi"
>
下一页>>>
</view>
<view
class=
"xiayiye title"
@
tap=
"nextPage"
v-else
>
没有更多了~
</view>
</
checkbox
-group>
<view
class=
"xiayiye title"
@
tap=
"nextPage"
v-if=
"xianshi"
>
下一页>>>
</view>
<view
class=
"xiayiye title"
@
tap=
"nextPage"
v-else
>
没有更多了~
</view>
</view>
</scroll-view>
<view
class=
"submitbtns active"
@
tap=
"showshare=false"
>
确定
</view>
<view
class=
"submitbtns active"
@
tap=
"showshare=false"
>
确定
</view>
<!-- 提交确认 -->
</view>
</uni-popup>
...
...
@@ -220,17 +236,8 @@
<!-- 时间弹窗 -->
<w-picker
mode=
"range"
startYear=
"2019"
endYear=
"2025"
:defaultVal=
"defaultVal"
:current=
"true"
@
confirm=
"onConfirm"
:selectList=
"[]"
themeColor=
"#ff6900"
ref=
"picker"
></w-picker>
<w-picker
mode=
"range"
startYear=
"2019"
endYear=
"2025"
:defaultVal=
"defaultVal"
:current=
"true"
@
confirm=
"onConfirm"
:selectList=
"[]"
themeColor=
"#ff6900"
ref=
"picker"
></w-picker>
...
...
@@ -241,108 +248,105 @@
<
script
>
import
uniPopup
from
'
@/components/uni-popup/uni-popup.vue
'
import
wPicker
from
"
@/components/w-picker/w-picker.vue
"
;
//时间弹窗
import
{
couponList
,
closedCoupons
,
couponGoods
,
addEditCoupons
,
couponsDetails
,
deleteCoupons
}
from
"
@/utils/api/coupon.js
"
import
wPicker
from
"
@/components/w-picker/w-picker.vue
"
;
//时间弹窗
import
{
couponList
,
closedCoupons
,
couponGoods
,
addEditCoupons
,
couponsDetails
,
deleteCoupons
}
from
"
@/utils/api/coupon.js
"
import
empty
from
"
@/components/empty/empty.vue
"
export
default
{
components
:{
components
:
{
uniPopup
,
wPicker
,
empty
,
},
data
()
{
return
{
keywords
:
''
,
xianshi
:
true
,
istruesub
:
true
,
tabactive
:
1
,
showshare
:
false
,
//弹窗
type
:
"
bottom
"
,
keywords
:
''
,
xianshi
:
true
,
istruesub
:
true
,
tabactive
:
1
,
showshare
:
false
,
//弹窗
type
:
"
bottom
"
,
shoplist
:
[],
//自己店铺的商品列表
shoplist
:
[],
//自己店铺的商品列表
//表单提交的参数
parameter
:{
at_least
:
""
,
//满多少可以用
count
:
""
,
//发放数量
coupon_name
:
""
,
//优惠券名称
end_time
:
""
,
//结束时间
start_time
:
""
,
//开始时间
give_type
:
"
1
"
,
//发放范围 1本地 2本地区 3全网
goods_id
:
[],
//可用商品 "1810", "5905", "5910"
max_fetch
:
""
,
//每人最大可以使用
money
:
""
,
//金额
range_type
:
"
1
"
,
//参与的商品 1全部 0部分
action
:
"
add
"
,
//编辑必传 方式(添加add,修改edit)
parameter
:
{
at_least
:
""
,
//满多少可以用
count
:
""
,
//发放数量
coupon_name
:
""
,
//优惠券名称
end_time
:
""
,
//结束时间
start_time
:
""
,
//开始时间
give_type
:
"
1
"
,
//发放范围 1本地 2本地区 3全网
goods_id
:
[],
//可用商品 "1810", "5905", "5910"
max_fetch
:
""
,
//每人最大可以使用
money
:
""
,
//金额
range_type
:
"
1
"
,
//参与的商品 1全部 0部分
action
:
"
add
"
,
//编辑必传 方式(添加add,修改edit)
},
parameter1
:{
at_least
:
"
10
"
,
//满多少可以用
count
:
"
100
"
,
//发放数量
coupon_name
:
"
测试优惠券
"
,
//优惠券名称
end_time
:
"
2019-12-03
"
,
//结束时间
start_time
:
"
2019-12-03
"
,
//开始时间
give_type
:
"
1
"
,
//发放范围 1本地 2本地区 3全网
goods_id
:
[],
//可用商品 "1810", "5905", "5910"
max_fetch
:
"
2
"
,
//每人最大可以使用
money
:
"
9.9
"
,
//金额
range_type
:
"
1
"
,
//参与的商品 1全部 0部分
},
//时间弹窗
defaultVal
:[],
selectList
:[],
timetype
:
1
,
cardlist
:
[],
//已发的卡券
isallshow
:
false
,
page
:
0
,
pages
:
0
,
defaultVal
:
[],
selectList
:
[],
timetype
:
1
,
cardlist
:
[],
//已发的卡券
isallshow
:
false
,
page
:
0
,
pages
:
0
,
};
},
onLoad
(){
onLoad
()
{
//获取商品列表
this
.
shop_goodsFun
();
},
//滚动到最底部
onReachBottom
(){
onReachBottom
()
{
if
(
!
this
.
isallshow
&&
this
.
tabactive
==
2
)
{
if
(
!
this
.
isallshow
&&
this
.
tabactive
==
2
)
{
this
.
shop_couponFun
();
}
},
methods
:{
methods
:
{
// 搜索
onKeyInput
:
function
(
event
)
{
this
.
keywords
=
event
.
target
.
value
this
.
pages
=
0
;
this
.
shoplist
=
[];
this
.
shoplist
=
[];
this
.
shop_goodsFun
();
},
nextPage
:
function
()
{
nextPage
:
function
()
{
this
.
pages
++
;
this
.
shop_goodsFun
();
},
//取消编辑
colesedit
(){
this
.
parameter
=
{
at_least
:
""
,
//满多少可以用
count
:
""
,
//发放数量
coupon_name
:
""
,
//优惠券名称
end_time
:
""
,
//结束时间
start_time
:
""
,
//开始时间
give_type
:
"
1
"
,
//发放范围 1本地 2本地区 3全网
goods_id
:
[],
//可用商品 "1810", "5905", "5910"
max_fetch
:
""
,
//每人最大可以使用
money
:
""
,
//金额
range_type
:
"
1
"
,
//参与的商品 1全部 0部分
colesedit
()
{
this
.
parameter
=
{
at_least
:
""
,
//满多少可以用
count
:
""
,
//发放数量
coupon_name
:
""
,
//优惠券名称
end_time
:
""
,
//结束时间
start_time
:
""
,
//开始时间
give_type
:
"
1
"
,
//发放范围 1本地 2本地区 3全网
goods_id
:
[],
//可用商品 "1810", "5905", "5910"
max_fetch
:
""
,
//每人最大可以使用
money
:
""
,
//金额
range_type
:
"
1
"
,
//参与的商品 1全部 0部分
//id:"", //优惠劵id 编辑必传
action
:
"
add
"
,
//编辑必传 方式(添加add,修改edit)
action
:
"
add
"
,
//编辑必传 方式(添加add,修改edit)
}
let
list
=
this
.
shoplist
list
.
map
((
item
,
index
)
=>
{
list
.
map
((
item
,
index
)
=>
{
item
.
checked
=
false
;
return
item
;
...
...
@@ -352,23 +356,23 @@
//接口start
//获取商城商品
async
shop_goodsFun
(
keywords
){
async
shop_goodsFun
(
keywords
)
{
let
res
=
await
couponGoods
({
page
:
this
.
pages
,
keywords
:
this
.
keywords
page
:
this
.
pages
,
keywords
:
this
.
keywords
});
let
list
=
res
.
data
;
list
.
map
((
item
,
index
)
=>
{
if
(
item
.
goods_id
)
{
list
.
map
((
item
,
index
)
=>
{
if
(
item
.
goods_id
)
{
item
.
product_id
=
item
.
goods_id
.
toString
();
item
.
product_name
=
item
.
title
;
}
else
if
(
item
.
room_id
)
{
}
else
if
(
item
.
room_id
)
{
item
.
product_id
=
item
.
room_id
.
toString
();
item
.
product_name
=
item
.
title
;
}
else
if
(
item
.
product_id
)
{
}
else
if
(
item
.
product_id
)
{
item
.
product_id
=
item
.
product_id
.
toString
();
}
...
...
@@ -376,11 +380,11 @@
return
item
;
})
// this.shoplist = list;
if
(
res
.
code
==
0
)
{
if
(
list
.
length
!=
0
)
{
this
.
shoplist
=
[...
this
.
shoplist
,
...
list
];
if
(
res
.
code
==
0
)
{
if
(
list
.
length
!=
0
)
{
this
.
shoplist
=
[...
this
.
shoplist
,
...
list
];
this
.
xianshi
=
true
;
}
else
{
}
else
{
// this.$api.msg("没有更多了~");
this
.
isallshow
=
true
;
this
.
xianshi
=
false
;
...
...
@@ -388,73 +392,76 @@
}
}
else
{
this
.
parameter
.
range_type
=
1
;
}
else
{
this
.
parameter
.
range_type
=
1
;
this
.
$api
.
msg
(
res
.
msg
);
}
},
//coupons 商户发放卡券 提交发放卡券的方法 submit
async
coupons
(){
let
can
=
this
.
parameter
;
// can.goods_id = can.goods_id.join(";");
async
coupons
()
{
let
{
parameter
}
=
this
;
let
can
=
{...
parameter
};
can
.
goods_id
=
can
.
goods_id
.
join
(
"
,
"
);
let
res
=
await
addEditCoupons
(
can
);
if
(
res
.
code
==
0
)
{
if
(
res
.
code
==
0
)
{
this
.
$api
.
msg
(
res
.
msg
);
setTimeout
(()
=>
{
this
.
chongzhi
();
//重置
setTimeout
(()
=>
{
this
.
chongzhi
();
//重置
this
.
tabactive
=
2
;
},
1000
)
}
else
{
},
1000
)
}
else
{
this
.
$api
.
msg
(
res
.
msg
);
}
},
//已发卡券
async
shop_couponFun
(){
async
shop_couponFun
()
{
this
.
page
++
;
let
res
=
await
couponList
({
page
:
this
.
page
,
page
:
this
.
page
,
});
if
(
res
.
code
==
0
)
{
if
(
res
.
code
==
0
)
{
if
(
res
.
data
.
length
!=
0
)
{
this
.
cardlist
=
[...
this
.
cardlist
,...
res
.
data
];
}
else
{
if
(
res
.
data
.
length
!=
0
)
{
this
.
cardlist
=
[...
this
.
cardlist
,
...
res
.
data
];
}
else
{
this
.
$api
.
msg
(
"
没有更多了~
"
);
this
.
isallshow
=
true
;
}
}
else
{
}
else
{
this
.
$api
.
msg
(
res
.
msg
);
}
},
//卡券单个的开关
async
switch_couponsFun
(
item
,
valse
,
index
)
{
async
switch_couponsFun
(
item
,
valse
,
index
)
{
let
res
=
await
closedCoupons
({
id
:
item
.
id
,
status
:
item
.
status
==
0
?
2
:
0
,
//开启(0),关闭 2 //valse,//valse,//
id
:
item
.
id
,
status
:
item
.
status
==
0
?
2
:
0
,
//开启(0),关闭 2 //valse,//valse,//
});
if
(
res
.
code
==
0
)
{
if
(
res
.
code
==
0
)
{
this
.
$api
.
msg
(
res
.
msg
);
this
.
cardlist
[
index
].
status
=
item
.
status
==
0
?
2
:
0
;
}
else
{
this
.
cardlist
[
index
].
status
=
item
.
status
==
0
?
2
:
0
;
}
else
{
this
.
$api
.
msg
(
res
.
msg
);
}
},
//删除
async
deleteFun
(
item
){
async
deleteFun
(
item
)
{
let
res
=
await
deleteCoupons
({
id
:
item
.
id
id
:
item
.
id
});
this
.
$api
.
msg
(
res
.
msg
);
if
(
res
.
code
==
1
)
{
if
(
res
.
code
==
1
)
{
//已发卡券
this
.
page
=
0
;
this
.
cardlist
=
[];
...
...
@@ -465,39 +472,36 @@
},
//优惠券详情 编辑使用
async
detailsFun
(
item
){
async
detailsFun
(
item
)
{
let
res
=
await
couponsDetails
({
id
:
item
.
id
id
:
item
.
id
});
if
(
item
)
{
if
(
item
)
{
//this.shoplist = res.data.coupons_goods;
let
parameter
=
{
at_least
:
item
.
at_least
,
count
:
item
.
count
,
coupon_name
:
item
.
coupon_name
,
end_time
:
item
.
end_time
,
start_time
:
item
.
start_time
,
give_type
:
item
.
give_type
,
goods_id
:
item
.
goods_id
,
max_fetch
:
item
.
max_fetch
,
money
:
item
.
money
,
range_type
:
item
.
range_type
,
id
:
item
.
id
,
action
:
"
edit
"
,
at_least
:
item
.
at_least
,
count
:
item
.
count
,
coupon_name
:
item
.
coupon_name
,
end_time
:
item
.
end_time
,
start_time
:
item
.
start_time
,
give_type
:
item
.
give_type
,
goods_id
:
item
.
goods_id
,
max_fetch
:
item
.
max_fetch
,
money
:
item
.
money
,
range_type
:
item
.
range_type
,
id
:
item
.
id
,
action
:
"
edit
"
,
}
// let iddata = [];
this
.
shoplist
=
this
.
shoplist
.
map
((
item1
,
index
)
=>
{
//参与的商品默认选中的
// if(){
// }
if
(
res
.
data
.
goods_ids
.
indexOf
(
item1
.
product_id
)
!=-
1
){
this
.
shoplist
=
this
.
shoplist
.
map
((
item1
,
index
)
=>
{
//参与的商品默认选中的
console
.
info
(
"
res.data.goods_ids
"
,
res
.
data
.
goods_ids
,
item1
.
product_id
);
if
(
res
.
data
.
goods_ids
.
indexOf
(
String
(
item1
.
product_id
))
!=
-
1
||
res
.
data
.
goods_ids
.
indexOf
(
parseInt
(
item1
.
product_id
))
!=
-
1
)
{
console
.
info
(
"
checked true
"
);
item1
.
checked
=
true
;
}
else
{
}
else
{
item1
.
checked
=
false
;
}
return
item1
...
...
@@ -509,53 +513,51 @@
this
.
tabactive
=
1
;
}
else
{
}
else
{
this
.
$api
.
msg
(
res
.
msg
);
}
},
//接口end
chongzhi
(){
chongzhi
()
{
this
.
parameter
=
{
at_least
:
""
,
//满多少可以用
count
:
""
,
//发放数量
coupon_name
:
""
,
//优惠券名称
end_time
:
""
,
//结束时间
start_time
:
""
,
//开始时间
give_type
:
"
1
"
,
//发放范围 1本地 2本地区 3全网
goods_id
:
[],
//可用商品
max_fetch
:
""
,
//每人最大可以使用
money
:
""
,
//金额
range_type
:
"
1
"
,
//参与的商品 1全部 0部分
action
:
'
add
'
at_least
:
""
,
//满多少可以用
count
:
""
,
//发放数量
coupon_name
:
""
,
//优惠券名称
end_time
:
""
,
//结束时间
start_time
:
""
,
//开始时间
give_type
:
"
1
"
,
//发放范围 1本地 2本地区 3全网
goods_id
:
[],
//可用商品
max_fetch
:
""
,
//每人最大可以使用
money
:
""
,
//金额
range_type
:
"
1
"
,
//参与的商品 1全部 0部分
action
:
'
add
'
};
},
taggleTab
(
inde
){
taggleTab
(
inde
)
{
this
.
tabactive
=
inde
;
},
//发放范围
radioChange
(
e
){
radioChange
(
e
)
{
this
.
parameter
.
give_type
=
e
.
detail
.
value
;
},
//参与的商品
radioChange1
(
e
){
radioChange1
(
e
)
{
this
.
parameter
.
range_type
=
e
.
detail
.
value
;
},
radioChange2
(
e
){
//选择产品的单选
//选择产品的 多选
radioChange2
(
e
)
{
console
.
info
(
"
e
"
,
e
);
this
.
parameter
.
goods_id
=
e
.
detail
.
value
;
this
.
shoplist
=
this
.
shoplist
.
map
((
item1
,
index
)
=>
{
//参与的商品默认选中的
if
(
this
.
parameter
.
goods_id
.
indexOf
(
item1
.
product_id
)
!=-
1
)
{
this
.
shoplist
=
this
.
shoplist
.
map
((
item1
,
index
)
=>
{
//参与的商品默认选中的
if
(
this
.
parameter
.
goods_id
.
indexOf
(
String
(
item1
.
product_id
))
!=
-
1
||
this
.
parameter
.
goods_id
.
indexOf
(
parseInt
(
item1
.
product_id
))
!=
-
1
)
{
item1
.
checked
=
true
;
}
else
{
}
else
{
item1
.
checked
=
false
;
}
return
item1
})
},
//弹窗里面的方法
togglePopup
(
type
,
open
)
{
...
...
@@ -571,28 +573,29 @@
}
},
//时间组件事件
onConfirm
(
e
){
onConfirm
(
e
)
{
// this.parameter.start_time = e.checkArr[0]+"年"+e.checkArr[1]+"月"+e.checkArr[2]+"日";
// this.parameter.end_time = e.checkArr[3]+"年"+e.checkArr[4]+"月"+e.checkArr[5]+"日";
this
.
parameter
.
start_time
=
e
.
checkArr
[
0
]
+
"
-
"
+
e
.
checkArr
[
1
]
+
"
-
"
+
e
.
checkArr
[
2
];
this
.
parameter
.
end_time
=
e
.
checkArr
[
3
]
+
"
-
"
+
e
.
checkArr
[
4
]
+
"
-
"
+
e
.
checkArr
[
5
];
this
.
parameter
.
start_time
=
e
.
checkArr
[
0
]
+
"
-
"
+
e
.
checkArr
[
1
]
+
"
-
"
+
e
.
checkArr
[
2
];
this
.
parameter
.
end_time
=
e
.
checkArr
[
3
]
+
"
-
"
+
e
.
checkArr
[
4
]
+
"
-
"
+
e
.
checkArr
[
5
];
},
showtime
(){
//显示时间选中
showtime
()
{
this
.
$refs
.
picker
.
show
()
},
hiddetime
(){
//隐藏时间选中
hiddetime
()
{
this
.
$refs
.
picker
.
hide
()
},
//显示商品列表
showmodles
(){
showmodles
()
{
this
.
showshare
=
true
;
}
},
watch
:{
tabactive
(
e
){
if
(
e
==
2
)
{
watch
:
{
tabactive
(
e
)
{
if
(
e
==
2
)
{
//已发卡券
this
.
page
=
0
;
this
.
cardlist
=
[];
...
...
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