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
4feb349d
Commit
4feb349d
authored
Sep 21, 2020
by
home
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
zxh
parent
a7ada1e8
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
135 additions
and
30 deletions
+135
-30
pages/addEditEleProduct/addEditEleProduct.vue
pages/addEditEleProduct/addEditEleProduct.vue
+126
-24
pages/eleProduct/eleProduct.vue
pages/eleProduct/eleProduct.vue
+8
-5
pages/index/index.vue
pages/index/index.vue
+1
-1
No files found.
pages/addEditEleProduct/addEditEleProduct.vue
View file @
4feb349d
...
@@ -17,6 +17,24 @@
...
@@ -17,6 +17,24 @@
<input
class=
"input flex1"
type=
"text"
v-model=
"form.price"
value=
""
placeholder-class=
"plclass"
placeholder=
"请填写产品价格"
/>
<input
class=
"input flex1"
type=
"text"
v-model=
"form.price"
value=
""
placeholder-class=
"plclass"
placeholder=
"请填写产品价格"
/>
</view>
</view>
</view>
<view
v-if=
"isShow"
>
<view
class=
"noecellbox"
>
<view
class=
"title"
>
秒杀价格
</view>
<view
class=
"inputbox flex"
>
<input
class=
"input flex1"
type=
"text"
v-model=
"form.activity_price"
value=
""
placeholder-class=
"plclass"
placeholder=
"请填写产品价格"
/>
</view>
</view>
<view
class=
"noecellbox"
>
<view
class=
"title"
>
秒杀库存
</view>
<view
class=
"inputbox flex"
>
<input
class=
"input flex1"
type=
"text"
v-model=
"form.store_count"
value=
""
placeholder-class=
"plclass"
placeholder=
"请填写产品价格"
/>
</view>
</view>
</view>
</view>
<view
class=
"briefIntroduction"
>
<view
class=
"briefIntroduction"
>
...
@@ -79,8 +97,40 @@
...
@@ -79,8 +97,40 @@
</view>
</view>
<view
class=
"titles"
>
{{
item
.
name
}}
</view>
<view
class=
"titles"
>
{{
item
.
name
}}
</view>
</label>
</label>
</view>
</view>
<view
v-if=
"activity_type==1"
>
<label
class=
"lableitem flex ali-c"
v-for=
"item of listissetkill"
:key=
"index"
>
<view>
<checkbox
color=
"#FF6900"
:value=
"item.value"
:checked=
"item.checked"
/>
</view>
<view
class=
"titles"
>
{{
item
.
name
}}
</view>
</label>
</view>
</checkbox-group>
</checkbox-group>
</view>
<view
class=
"checkboxs"
v-if=
"isshowsetkilltime"
>
<view
class=
"title"
>
选择秒杀时段:
</view>
<!-- scroll-view 与 picker-view 达成效果一致-->
<!--
<scroll-view
scroll-y=
"true"
>
<view
class=
"chindlost ali-c flex flex-wrap"
style=
"height: 200upx;margin-top: 40upx;"
>
<radio-group
@
change=
"radioChange"
>
<label
class=
"lableitem flex ali-c"
v-for=
"(item,index) in seckilltimelist"
:key=
"index"
>
<view>
<radio
:value=
"item.activity_id+''"
/>
</view>
<view
class=
"titles"
>
{{
item
.
title
}}
</view>
</label>
</radio-group>
</view>
</scroll-view>
-->
<picker-view
indicator-style=
"height: 50px;"
style=
"width: 100%; height: 200px;"
@
change=
"pickerChange"
>
<picker-view-column>
<view
v-for=
"(item,index) in seckilltimelist"
:key=
"index"
style=
"line-height: 50px; text-align: center;"
>
{{
item
.
title
}}
</view>
</picker-view-column>
</picker-view>
</view>
</view>
<view
class=
"submitbtn active"
@
tap=
"getForm"
>
提交
</view>
<view
class=
"submitbtn active"
@
tap=
"getForm"
>
提交
</view>
...
@@ -92,7 +142,8 @@
...
@@ -92,7 +142,8 @@
// https://ext.dcloud.net.cn/plugin?id=652#QS-textarea 参照文档
// https://ext.dcloud.net.cn/plugin?id=652#QS-textarea 参照文档
import
QSApp
from
'
@/components/QS-inputs-split/js/app.js
'
;
import
QSApp
from
'
@/components/QS-inputs-split/js/app.js
'
;
import
{
addEditEleProduct
,
typeManager
,
eleProductInfo
}
from
"
@/utils/api/api.js
"
;
import
{
addEditEleProduct
,
typeManager
,
eleProductInfo
}
from
"
@/utils/api/api.js
"
;
import
robbyImageUpload
from
'
@/components/plan-image-upload/up_img
'
;
//上传资质图片组件
import
robbyImageUpload
from
'
@/components/plan-image-upload/up_img
'
;
//上传资质图片组件
import
{
getActivityList
}
from
'
@/utils/api/merchant.js
'
;
export
default
{
export
default
{
components
:{
components
:{
robbyImageUpload
robbyImageUpload
...
@@ -117,9 +168,14 @@
...
@@ -117,9 +168,14 @@
is_new
:
""
,
//是否新产品
is_new
:
""
,
//是否新产品
is_hot
:
""
,
//是否热卖产品
is_hot
:
""
,
//是否热卖产品
action
:
"
add
"
,
// 方式(添加:add,修改:edit)
action
:
"
add
"
,
// 方式(添加:add,修改:edit)
price
:
""
,
//价格
price
:
""
,
//价格
activity_price
:
""
,
//秒杀价
},
store_count
:
""
,
// 秒杀库存
is_seckill
:
"
0
"
,
//0 1 是否秒杀产品
activity_id
:
'
0
'
,
//秒杀activity_id
activity_list
:
'
49,
'
,
//秒杀列表
},
isShow
:
false
,
chindformList
:[],
chindformList
:[],
//上传图片相关的
//上传图片相关的
c_pics
:
[],
c_pics
:
[],
...
@@ -131,9 +187,16 @@
...
@@ -131,9 +187,16 @@
defaultinfo
:{},
//修改的时候的默认初始数据
defaultinfo
:{},
//修改的时候的默认初始数据
listchind
:[
listchind
:[
{
name
:
"
是否新产品
"
,
value
:
"
is_new
"
,
checked
:
false
},
{
name
:
"
是否新产品
"
,
value
:
"
is_new
"
,
checked
:
false
},
{
name
:
"
是否热卖产品
"
,
value
:
"
is_hot
"
,
checked
:
false
},
{
name
:
"
是否热卖产品
"
,
value
:
"
is_hot
"
,
checked
:
false
},
{
name
:
"
是否是秒杀产品
"
,
value
:
"
is_seckill
"
,
checked
:
false
},
],
],
isshowsetkilltime
:
false
,
//是否显示秒杀时间
listissetkill
:[{
name
:
"
是否秒杀产品
"
,
value
:
"
is_seckill
"
,
checked
:
false
}],
activity_type
:
0
,
//判断是否可以秒杀
seckilltimelist
:[],
//秒杀时段列表
selchildList
:[],
selchildList
:[],
cate_name
:
""
,
cate_name
:
""
,
index
:
0
,
index
:
0
,
...
@@ -150,7 +213,8 @@
...
@@ -150,7 +213,8 @@
},
},
onLoad
(
opdata
)
{
onLoad
(
opdata
)
{
this
.
c_formData
.
user_token
=
this
.
$store
.
state
.
token
;
this
.
c_formData
.
user_token
=
this
.
$store
.
state
.
token
;
this
.
activity_type
=
opdata
.
activity_type
,
this
.
isShow
=
this
.
activity_type
==
1
?
true
:
false
if
(
opdata
.
id
!=
undefined
){
if
(
opdata
.
id
!=
undefined
){
this
.
product_id
=
opdata
.
id
;
this
.
product_id
=
opdata
.
id
;
...
@@ -162,7 +226,6 @@
...
@@ -162,7 +226,6 @@
title
:
"
添加外卖产品
"
title
:
"
添加外卖产品
"
})
})
}
}
this
.
typeManagerfun
();
this
.
typeManagerfun
();
},
},
methods
:
{
methods
:
{
...
@@ -190,22 +253,36 @@
...
@@ -190,22 +253,36 @@
},
},
//标记选中属性列表
//标记选中属性列表
checkboxChange
(
e
){
checkboxChange
(
e
){
console
.
log
(
e
);
console
.
log
(
e
);
this
.
selchildList
=
e
.
detail
.
value
;
this
.
selchildList
=
e
.
detail
.
value
;
this
.
isshowsetkilltime
=
e
.
detail
.
value
.
indexOf
(
'
is_seckill
'
)
==-
1
?
false
:
true
;
if
(
e
.
detail
.
value
.
indexOf
(
'
is_seckill
'
)
!=-
1
){
this
.
getActivityListfun
();
}
this
.
selchildList
=
e
.
detail
.
value
;
},
},
//修改的时候赋初始值
//修改的时候赋初始值
async
eleProductInfofun
(){
async
eleProductInfofun
(){
let
res
=
await
eleProductInfo
({
let
res
=
await
eleProductInfo
({
product_id
:
this
.
product_id
,
product_id
:
this
.
product_id
,
});
});
if
(
res
.
code
==
0
){
if
(
res
.
code
==
0
){
console
.
log
(
res
);
this
.
defaultinfo
=
res
.
data
;
this
.
defaultinfo
=
res
.
data
;
this
.
form
.
product_name
=
res
.
data
.
product_name
;
//名称
this
.
form
.
product_name
=
res
.
data
.
product_name
;
//名称
this
.
form
.
desc
=
res
.
data
.
desc
;
//描述
this
.
form
.
desc
=
res
.
data
.
desc
;
//描述
this
.
form
.
lunch_box_fee
=
res
.
data
.
lunch_box_fee
/
100
;
//餐盒费
this
.
form
.
lunch_box_fee
=
res
.
data
.
lunch_box_fee
/
100
;
//餐盒费
this
.
form
.
price
=
res
.
data
.
price
/
100
;
//价格
this
.
form
.
price
=
res
.
data
.
price
;
//价格
this
.
form
.
photo
=
res
.
data
.
photo
;
//图片
this
.
form
.
photo
=
res
.
data
.
photo
;
//图片
this
.
form
.
activity_price
=
res
.
data
.
activity_price
//秒杀价
this
.
form
.
store_count
=
res
.
data
.
store_count
//秒杀库存
this
.
form
.
cate_id
=
res
.
data
.
cate_id
;
//分类id
this
.
form
.
cate_id
=
res
.
data
.
cate_id
;
//分类id
//下拉分类 初始值
//下拉分类 初始值
this
.
chindformList
.
forEach
((
item
,
index
)
=>
{
this
.
chindformList
.
forEach
((
item
,
index
)
=>
{
...
@@ -227,7 +304,8 @@
...
@@ -227,7 +304,8 @@
this
.
listchind
[
1
].
checked
=
true
;
this
.
listchind
[
1
].
checked
=
true
;
}
else
{
}
else
{
this
.
listchind
[
1
].
checked
=
false
;
this
.
listchind
[
1
].
checked
=
false
;
}
}
//处理上传的图片默认值
//处理上传的图片默认值
// res.data.photo
// res.data.photo
...
@@ -254,7 +332,12 @@
...
@@ -254,7 +332,12 @@
price
:
this
.
form
.
price
,
//价格
price
:
this
.
form
.
price
,
//价格
cate_id
:
this
.
form
.
cate_id
,
cate_id
:
this
.
form
.
cate_id
,
// photo:"",
// photo:"",
//product_id
//product_id
activity_price
:
this
.
form
.
activity_price
,
//秒杀价
store_count
:
this
.
form
.
store_count
,
//秒杀库存
activity_id
:
this
.
form
.
activity_id
,
activity_list
:
this
.
form
.
activity_list
,
};
};
if
(
this
.
selchildList
.
includes
(
"
is_new
"
)){
if
(
this
.
selchildList
.
includes
(
"
is_new
"
)){
...
@@ -269,13 +352,12 @@
...
@@ -269,13 +352,12 @@
can
.
is_hot
=
0
;
can
.
is_hot
=
0
;
}
}
if
(
this
.
selchildList
.
includes
(
"
is_hot
"
)){
// if(this.selchildList.includes("is_
")){
can
.
is_seckill
=
1
;
// can.is_hot
= 1;
}
else
{
//
}else{
can
.
is_seckill
=
0
;
// can.is_hot
= 0;
}
// }
if
(
this
.
c_pics
.
length
!=
0
){
if
(
this
.
c_pics
.
length
!=
0
){
can
.
photo
=
this
.
c_pics
[
0
].
data
;
//上传的图片
can
.
photo
=
this
.
c_pics
[
0
].
data
;
//上传的图片
...
@@ -289,9 +371,11 @@
...
@@ -289,9 +371,11 @@
console
.
info
(
can
,
"
can
"
);
console
.
info
(
can
,
"
can
"
);
//return false;
//return false;
//添加修改外卖产品
//添加修改外卖产品
addEditEleProduct
(
can
).
then
((
res1
)
=>
{
addEditEleProduct
(
can
).
then
((
res1
)
=>
{
console
.
log
(
res1
)
if
(
res1
.
code
==
0
){
if
(
res1
.
code
==
0
){
this
.
$api
.
msg
(
res1
.
msg
);
this
.
$api
.
msg
(
res1
.
msg
);
setTimeout
(()
=>
{
setTimeout
(()
=>
{
...
@@ -303,6 +387,24 @@
...
@@ -303,6 +387,24 @@
this
.
$api
.
msg
(
res1
.
msg
);
this
.
$api
.
msg
(
res1
.
msg
);
}
}
})
})
},
pickerChange
(
e
){
console
.
log
(
e
)
// console.log(this.seckilltimelist[e.detail.value[0]].activity_id)
this
.
form
.
activity_id
=
this
.
seckilltimelist
[
e
.
detail
.
value
[
0
]].
activity_id
;
},
// 秒杀列表
async
getActivityListfun
(){
let
res
=
await
getActivityList
({
// audit:1,
})
if
(
res
.
code
==
0
){
console
.
log
(
res
,
3333
)
this
.
seckilltimelist
=
res
.
data
.
head
}
},
},
//获取外卖分类列表 用于下拉选择
//获取外卖分类列表 用于下拉选择
async
typeManagerfun
(){
async
typeManagerfun
(){
...
...
pages/eleProduct/eleProduct.vue
View file @
4feb349d
...
@@ -36,7 +36,8 @@
...
@@ -36,7 +36,8 @@
<view
class=
"btns btnboxxj"
@
tap=
"Selectiondata(item)"
v-if=
"tabactive==1 && isselect==1"
>
加入活动
</view>
<view
class=
"btns btnboxxj"
@
tap=
"Selectiondata(item)"
v-if=
"tabactive==1 && isselect==1"
>
加入活动
</view>
<view
class=
"btns btnboxxj"
@
tap=
"sold_outfun(item.id,1,index)"
v-else-if=
"tabactive==1"
>
下 架
</view>
<view
class=
"btns btnboxxj"
@
tap=
"sold_outfun(item.id,1,index)"
v-else-if=
"tabactive==1"
>
下 架
</view>
<view
class=
"btns btnboxxj"
@
tap=
"sold_outfun(item.id,0,index)"
v-show=
"tabactive==2"
>
上 架
</view>
<view
class=
"btns btnboxxj"
@
tap=
"sold_outfun(item.id,0,index)"
v-show=
"tabactive==2"
>
上 架
</view>
<view
class=
"btns btnboxxj"
@
click=
"setSpecs(item.product_id)"
>
规格
</view>
<view
class=
"btns btnboxxj"
@
click=
"setSpecs(item.product_id)"
>
规格
</view>
<view
class=
"btns btnboxdel"
@
tap=
"tochanges(item,index)"
>
修 改
</view>
<view
class=
"btns btnboxdel"
@
tap=
"tochanges(item,index)"
>
修 改
</view>
</view>
</view>
</view>
</view>
...
@@ -96,11 +97,12 @@
...
@@ -96,11 +97,12 @@
idArr
:[
"
16535
"
,
"
7350
"
,
"
6164
"
],
//全选 选中的id
idArr
:[
"
16535
"
,
"
7350
"
,
"
6164
"
],
//全选 选中的id
isselect
:
2
,
//1 是抽奖选择商品状态 2是默认的
isselect
:
2
,
//1 是抽奖选择商品状态 2是默认的
sendindex
:
0
,
//修改数据插入索引
sendindex
:
0
,
//修改数据插入索引
activity_type
:
0
};
};
},
},
onLoad
(
opdata
){
onLoad
(
opdata
){
this
.
activity_type
=
opdata
.
activity_type
if
(
opdata
.
isselect
==
1
){
if
(
opdata
.
isselect
==
1
){
this
.
isselect
=
1
;
this
.
isselect
=
1
;
...
@@ -109,7 +111,8 @@
...
@@ -109,7 +111,8 @@
this
.
isselect
=
2
;
this
.
isselect
=
2
;
}
}
},
},
onShow
()
{
onShow
()
{
this
.
goods_list
=
[];
this
.
goods_list
=
[];
this
.
page
=
0
;
this
.
page
=
0
;
...
@@ -141,7 +144,7 @@
...
@@ -141,7 +144,7 @@
//修改外卖产品
//修改外卖产品
tochanges
(
data
,
index
){
tochanges
(
data
,
index
){
uni
.
navigateTo
({
uni
.
navigateTo
({
url
:
`/pages/addEditEleProduct/addEditEleProduct?id=
${
data
.
product_id
}
`
,
url
:
`/pages/addEditEleProduct/addEditEleProduct?id=
${
data
.
product_id
}
&activity_type=
${
this
.
activity_type
}
`
,
})
})
},
},
//删除外卖产品
//删除外卖产品
...
...
pages/index/index.vue
View file @
4feb349d
...
@@ -72,7 +72,7 @@
...
@@ -72,7 +72,7 @@
</view>
</view>
<view
class=
"jiu_max "
v-if=
"shop_type == 'ele'"
>
<view
class=
"jiu_max "
v-if=
"shop_type == 'ele'"
>
<navigator
url=
"/pages/eleProduct/eleProduct
"
>
<navigator
:url=
"'/pages/eleProduct/eleProduct?activity_type='+ activity_type
"
>
<view
class=
"jiu_min"
>
<view
class=
"jiu_min"
>
<view><image
class=
"img"
src=
"/static/icon/20.png"
mode=
""
></image></view>
<view><image
class=
"img"
src=
"/static/icon/20.png"
mode=
""
></image></view>
<view>
外卖产品
</view>
<view>
外卖产品
</view>
...
...
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