Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
E
ElectricitySheep
Project
Project
Details
Activity
Releases
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
黄媛媛
ElectricitySheep
Commits
ad855a9c
Commit
ad855a9c
authored
Dec 25, 2020
by
Mac
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
6c849fbc
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
903 additions
and
78 deletions
+903
-78
choicels.vue
src/components/common/choicels.vue
+131
-0
addLecturer.vue
src/components/education/addLecturer.vue
+15
-0
lecturermanage.vue
src/components/education/lecturermanage.vue
+1
-1
educationteacher.vue
src/components/sallCenter/plugin/educationteacher.vue
+643
-0
startupPage.vue
src/components/sallCenter/startupPage.vue
+81
-69
templateEdit.vue
src/components/sallCenter/templateEdit.vue
+32
-8
No files found.
src/components/common/choicels.vue
0 → 100644
View file @
ad855a9c
<
template
>
<div>
<el-input
size=
"mini"
v-model=
"msg.Name"
placeholder=
"根据名称搜索"
:clearable=
"true"
@
clear=
"msg.pageIndex=1,getList()"
@
keyup
.
enter
.
native=
"msg.pageIndex=1,getList()"
>
<el-button
slot=
"append"
@
click=
"msg.pageIndex=1,getList()"
>
搜索
</el-button>
</el-input>
<el-table
ref=
"multipleTable"
:data=
"dataList"
tooltip-effect=
"dark"
height=
"450"
style=
"width: 100%"
@
selection-change=
"handleSelectionChange"
>
<template
v-if=
"isSingle"
>
<el-table-column
width=
"50px"
label=
""
>
<template
slot-scope=
"scope"
>
<el-radio
v-model=
"scope.row.IsChecked"
@
change
.
native=
"getTemplateRow(scope.$index,scope.row)"
>
</el-radio>
</
template
>
</el-table-column>
</template>
<
template
v-else
>
<el-table-column
type=
"selection"
width=
"50px"
>
</el-table-column>
</
template
>
<el-table-column
label=
"编号"
width=
"80px"
>
<
template
slot-scope=
"scope"
>
{{
scope
.
row
.
ID
}}
</
template
>
</el-table-column>
<el-table-column
prop=
"Name"
label=
"信息"
>
<
template
slot-scope=
"scope"
>
<div
class=
"app-image"
:style=
"
{backgroundImage:'url(' + scope.row.TeacherLogo + ')',backgroundSize:'cover'}">
</div>
<div
flex=
"dir:left cross:center"
>
{{
scope
.
row
.
Name
}}
</div>
</
template
>
</el-table-column>
<el-table-column
prop=
"Major"
label=
"专业"
>
</el-table-column>
</el-table>
<el-pagination
style=
"text-align:center"
background
@
current-change=
"handleCurrentChange"
:page-size=
"msg.pageSize"
layout=
"prev, pager, next"
:total=
"total"
>
</el-pagination>
</div>
</template>
<
script
>
export
default
{
props
:
[
'ckGoods'
,
"isSingle"
,
"IsGetSpec"
],
data
()
{
return
{
dataList
:
[],
msg
:
{
pageIndex
:
1
,
pageSize
:
15
,
Name
:
''
,
ID
:
0
,
Telephone
:
''
,
TeacherStatus
:
1
},
total
:
0
,
selectRow
:
[],
};
},
created
()
{
if
(
this
.
IsGetSpec
)
{
this
.
msg
.
IsGetSpec
=
this
.
IsGetSpec
;
}
},
methods
:
{
//获取所有菜单
getList
()
{
this
.
apipost
(
"/api/Education/GetTeacherPageList"
,
this
.
msg
,
res
=>
{
if
(
res
.
data
.
resultCode
==
1
)
{
this
.
total
=
res
.
data
.
data
.
count
;
var
tempArray
=
res
.
data
.
data
.
pageData
;
if
(
tempArray
&&
tempArray
.
length
>
0
)
{
tempArray
.
forEach
(
item
=>
{
item
.
IsChecked
=
false
;
});
}
this
.
dataList
=
JSON
.
parse
(
JSON
.
stringify
(
tempArray
));
}
else
{
this
.
Error
(
res
.
data
.
message
);
}
})
},
handleSelectionChange
(
val
)
{
this
.
selectRow
=
JSON
.
parse
(
JSON
.
stringify
(
val
));
},
getTemplateRow
(
index
,
row
)
{
this
.
selectRow
=
[];
if
(
this
.
dataList
&&
this
.
dataList
.
length
>
0
)
{
this
.
dataList
.
forEach
(
item
=>
{
if
(
item
.
ID
!=
row
.
ID
)
{
item
.
IsChecked
=
false
;
}
})
}
this
.
selectRow
.
push
(
JSON
.
parse
(
JSON
.
stringify
(
row
)));
},
handleCurrentChange
(
val
)
{
this
.
msg
.
pageIndex
=
val
;
this
.
getList
();
},
//父组件调用方法
getChoicedGoods
()
{
return
this
.
selectRow
;
},
//清空多选方法
toggleSelection
(
rows
)
{
if
(
rows
)
{
rows
.
forEach
(
row
=>
{
this
.
$refs
.
multipleTable
.
toggleRowSelection
(
row
);
});
}
else
{
this
.
$refs
.
multipleTable
.
clearSelection
();
}
},
},
mounted
()
{
this
.
getList
();
}
};
</
script
>
<
style
>
.app-image
{
background-position
:
center
center
;
width
:
50px
;
height
:
50px
;
border-radius
:
0%
;
float
:
left
;
margin-right
:
8px
;
}
</
style
>
src/components/education/addLecturer.vue
View file @
ad855a9c
...
...
@@ -28,6 +28,14 @@
<el-form-item
label=
"工作年限"
prop=
"WorkYears"
class=
"is-required"
size=
"small"
>
<el-input
v-model=
"addMsg.WorkYears"
@
keyup
.
native=
"checkInteger(addMsg,'WorkYears')"
placeholder=
"请输入工作年限"
/>
</el-form-item>
<el-form-item
label=
"讲师国籍"
prop=
"Nationality"
class=
"is-required"
size=
"small"
>
<el-input
v-model=
"addMsg.Nationality"
/>
</el-form-item>
<el-form-item
label=
"是否外国人"
size=
"small"
>
<el-switch
v-model=
"addMsg.IsForeigners"
active-color=
"#409EFF"
:active-value=
"1"
:inactive-value=
"0"
>
</el-switch>
</el-form-item>
<el-form-item
label=
"上架状态"
size=
"small"
>
<el-switch
v-model=
"addMsg.TeacherStatus"
active-color=
"#409EFF"
:active-value=
"1"
:inactive-value=
"2"
>
...
...
@@ -92,6 +100,8 @@
WorkYears
:
''
,
TeacherStatus
:
2
,
LableNameList
:
''
,
IsForeigners
:
0
,
//是否外国人0-否,1-是
Nationality
:
''
,
//老师国籍
},
dynamicTags
:
[],
inputVisible
:
false
,
...
...
@@ -124,6 +134,11 @@
message
:
'请输入讲师专业'
,
trigger
:
'blur'
}],
Nationality
:
[{
required
:
true
,
message
:
'请输入讲师国籍'
,
trigger
:
'blur'
}],
WorkYears
:
[{
required
:
true
,
message
:
'请输入讲师年限'
,
...
...
src/components/education/lecturermanage.vue
View file @
ad855a9c
...
...
@@ -145,7 +145,7 @@
Name
:
''
,
ID
:
''
,
Telephone
:
''
,
TeacherStatus
:
-
1
},
changeState
:
false
,
dateList
:[],
...
...
src/components/sallCenter/plugin/educationteacher.vue
0 → 100644
View file @
ad855a9c
<
style
>
/*-----------------设置部分--------------*/
.diy-goods
.diy-component-edit
.diy-goods-label
{
width
:
85px
;
}
.diy-goods
.diy-component-edit
.cat-item
{
border
:
1px
solid
#e2e2e2
;
margin-bottom
:
5px
;
padding
:
15px
;
max-width
:
400px
;
}
.diy-goods
.diy-component-edit
.goods-list
{
flex-wrap
:
wrap
;
}
.diy-goods
.diy-component-edit
.goods-item
,
.diy-goods
.diy-component-edit
.goods-add
{
width
:
50px
;
height
:
50px
;
position
:
relative
;
margin-right
:
15px
;
margin-bottom
:
15px
;
}
.diy-goods
.diy-component-edit
.goods-add
.el-button
{
width
:
100%
;
height
:
100%
;
border-radius
:
0
;
padding
:
0
;
}
.diy-goods
.diy-component-edit
.goods-pic
{
width
:
100%
;
height
:
100%
;
background-size
:
cover
;
background-position
:
center
;
}
.diy-goods
.diy-component-edit
.goods-delete
{
position
:
absolute
;
left
:
calc
(
100%
-
10px
);
top
:
-10px
;
width
:
20px
;
height
:
20px
;
line-height
:
20px
;
padding
:
0
0
;
visibility
:
hidden
;
z-index
:
1
;
}
.diy-goods
.diy-component-edit
.goods-item
:hover
.goods-delete
{
visibility
:
visible
;
}
.diy-goods
.diy-component-edit
.cat-item-options
{
position
:
relative
;
}
.diy-goods
.diy-component-edit
.cat-item-options
.el-button
{
height
:
25px
;
line-height
:
25px
;
width
:
25px
;
padding
:
0
;
text-align
:
center
;
border
:
none
;
border-radius
:
0
;
position
:
absolute
;
margin-left
:
0
;
top
:
-16px
;
right
:
-40px
;
}
/*-----------------预览部分--------------*/
.diy-goods
.diy-component-preview
.cat-list-left
{
width
:
160px
;
}
.diy-goods
.diy-component-preview
.cat-item
{
height
:
104px
;
padding
:
0
10px
;
text-align
:
center
;
max-width
:
100%
;
white-space
:
nowrap
;
}
.diy-goods
.diy-component-preview
.cat-list-left
.cat-name
{
overflow
:
hidden
;
text-overflow
:
ellipsis
;
}
.diy-goods
.diy-component-preview
.cat-item.active
{
color
:
#ff4544
;
}
.diy-goods
.diy-component-preview
.cat-list-top
.cat-item
{
margin
:
0
20px
;
}
.diy-goods
.diy-component-preview
.cat-list-top
{
overflow-x
:
auto
;
}
.diy-goods
.diy-component-preview
.cat-list-top.cat-style-1
.cat-item
{
border-bottom
:
4px
solid
transparent
;
}
.diy-goods
.diy-component-preview
.cat-list-top.cat-style-2
.cat-name
{
background
:
#ff4544
;
color
:
#fff
;
border-radius
:
100px
;
padding
:
0
18px
;
}
.diy-goods
.diy-component-preview
.cat-list-top
.cat-item.active
{
border-bottom-color
:
#ff4544
;
}
.diy-goods
.diy-component-preview
.cat-list-left
.cat-item
{
border-left
:
2px
solid
transparent
;
}
.diy-goods
.diy-component-preview
.cat-list-left
.cat-item.active
{
border-left-color
:
#ff4544
;
}
.diy-goods
.diy-component-preview
.goods-list
{
padding
:
11px
;
}
.diy-goods
.diy-component-preview
.goods-item
{
padding
:
11px
;
}
.diy-goods
.diy-component-preview
.goods-pic
{
background-size
:
cover
;
background-position
:
center
;
width
:
99.8%
;
height
:
700px
;
background-color
:
#f6f6f6
;
background-repeat
:
no-repeat
;
position
:
relative
;
border-radius
:
10px
10px
0
0
;
}
.diy-goods
.diy-component-preview
.goods-pic-3-2
{
height
:
471px
;
}
.diy-goods
.diy-component-preview
.goods-name
{
white-space
:
nowrap
;
overflow
:
hidden
;
text-overflow
:
ellipsis
;
margin-bottom
:
10px
;
}
.diy-goods
.diy-component-preview
.goods-name-static
{
height
:
94px
;
}
.diy-goods
.diy-component-preview
.goods-price
{
white-space
:
nowrap
;
overflow
:
hidden
;
text-overflow
:
ellipsis
;
color
:
#ff4544
;
line-height
:
48px
;
}
.diy-goods
.diy-component-preview
.goods-list-style--1
.goods-item
,
.diy-goods
.diy-component-preview
.goods-list-style-1
.goods-item
{
width
:
100%
;
}
.diy-goods
.diy-component-preview
.goods-list-style-2
.goods-item
{
width
:
50%
;
}
.diy-goods
.diy-component-preview
.goods-list-style-3
.goods-item
{
width
:
33.333333%
;
}
.diy-goods
.diy-component-preview
.goods-list-style-0
.goods-item
{
width
:
249px
;
}
.diy-goods
.diy-component-preview
.goods-list-style--1
.goods-pic
{
width
:
200px
;
height
:
200px
;
border-radius
:
10px
0
0
10px
;
}
.diy-goods
.diy-component-preview
.goods-list-style-2
.goods-pic
{
height
:
342px
;
border-radius
:
10px
10px
0
0
;
}
.diy-goods
.diy-component-preview
.goods-list-style-0
.goods-pic
,
.diy-goods
.diy-component-preview
.goods-list-style-3
.goods-pic
{
height
:
200px
;
border-radius
:
10px
10px
0
0
;
}
.diy-goods
.diy-component-preview
.goods-pic-fill-0
{
background-size
:
contain
;
}
.diy-goods
.diy-component-preview
.buy-btn
{
border-color
:
#ff4544
;
color
:
#ff4544
;
padding
:
0
20px
;
height
:
48px
;
line-height
:
50px
;
font-size
:
24px
;
}
.diy-goods
.diy-component-preview
.buy-btn.el-button--primary
{
background-color
:
#ff4544
;
color
:
#fff
;
}
.diy-goods
.diy-component-preview
.goods-tag
{
position
:
absolute
;
top
:
0
;
left
:
0
;
width
:
64px
;
height
:
64px
;
z-index
:
1
;
background-size
:
100%
100%
;
background-position
:
center
;
background-repeat
:
no-repeat
;
}
.diy-goods
hr
{
border
:
none
;
height
:
1px
;
background-color
:
#e2e2e2
;
}
.diy-goods
.diy-component-preview
.goods-item
.buy-btn.is-round
{
border-radius
:
24px
;
}
.diy-goods
.goods-item.goods-cat-list
{
border-top
:
1px
solid
#e2e2e2
;
}
.diy-goods
.goods-item.goods-cat-list
:first-of-type
{
border-top
:
0
;
}
.diy-goods
.cat-list
{
max-height
:
500px
;
overflow
:
auto
;
}
.goodsDialog
.el-dialog__body
{
padding
:
10px
20px
;
}
</
style
>
<
template
>
<div
:class=
"
{'active':lsData.isCked}">
<div
class=
"diy-component-options"
v-if=
"lsData.isCked"
>
<el-button
type=
"primary"
icon=
"el-icon-delete"
style=
"left: -25px; top: 0px;"
@
click=
"delPlugin()"
></el-button>
<el-button
type=
"primary"
icon=
"el-icon-document-copy"
style=
"left: -25px; top: 30px;"
></el-button>
<el-button
type=
"primary"
icon=
"el-icon-arrow-up"
v-if=
"index>0"
@
click=
"resetSord(0)"
style=
"right: -25px; top: 0;"
></el-button>
<el-button
type=
"primary"
icon=
"el-icon-arrow-down"
v-if=
"index!=dataLeng-1"
@
click=
"resetSord(1)"
style=
"right: -25px; top: 30px;"
></el-button>
</div>
<div
class=
"diy-goods"
>
<div
class=
"diy-component-preview"
:style=
"
{'backgroundColor':data.backgroundColor,'borderRadius':data.SearchFilletPX+'px'}">
<div
:flex=
"cMainFlex"
:style=
"
{marginLeft:data.PaddingLeft+'px',
marginRight:data.PaddingRight+'px',marginTop:data.PaddingTop+'px',
marginBottom:data.PaddingBottom+'px'}">
<div
class=
"goods-list"
:class=
"'goods-list-style-'+data.listStyle"
>
<div
v-for=
"(cat,catIndex) in cCatList"
:key=
"catIndex"
>
<div
:style=
"cGoodsListStyle"
flex
>
<div
v-for=
"(goods,goodsIndex) in cCatGoodsList(cat, catIndex)"
class=
"goods-item"
:key=
"goodsIndex"
:class=
"data.catPosition==='left'?'goods-cat-list':''"
>
<div
style=
"display: inline-block;"
:style=
"cGoodsItemWidth"
>
<div
:style=
"cGoodsItemStyle"
:flex=
"cGoodsItemFlex"
style=
"position: relative;border:1px solid rgb(226, 226, 226)"
>
<div
class=
"goods-pic"
:class=
"'goods-pic-'+data.goodsCoverProportion+' goods-pic-fill-'+data.fill"
:style=
"'background-image: url('+getIconLink(goods.picUrl)+')'"
>
</div>
<div
:style=
"cGoodsItemInfoStyle"
>
<div
class=
"goods-name"
:class=
"data.listStyle===-1?'goods-name-static':''"
>
<template>
{{
goods
.
name
}}
</
template
>
</div>
<div
flex=
"box:last"
>
<div
class=
"goods-price"
>
<!-- <template>¥{{goods.price}}</template> -->
</div>
<div>
<
template
v-if=
"cShowBuyBtn"
>
<template
v-if=
"data.buyBtn==='cart'"
>
<i
style=
"font-size: 48px;color: #ff4544;"
class=
"el-icon-shopping-cart-1"
></i>
</
template
>
<
template
v-if=
"data.buyBtn==='add'"
>
<i
style=
"font-size: 48px;color: #ff4544;"
class=
"el-icon-circle-plus-outline"
></i>
</
template
>
<
template
v-if=
"data.buyBtn==='text'"
>
<div
:style=
"cButtonStyle"
style=
"font-size: 24px;border: 1px solid;color: #ffffff;"
>
{{
data
.
buyBtnText
}}
</div>
</
template
>
</template>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div
class=
"diy-component-edit"
v-if=
"lsData.isCked"
>
<el-form
label-width=
'150px'
@
submit
.
native
.
prevent
>
<
template
>
<!--
<el-form-item
label=
"老师添加"
>
-->
<!--
<el-radio
v-model=
"data.addGoodsType"
:label=
"0"
>
自定义
</el-radio>
-->
<!--
</el-form-item>
-->
<el-form-item
v-show=
"data.addGoodsType == 0"
label=
"老师列表"
>
<draggable
v-model=
"data.list"
class=
"goods-list"
style=
"display:flex;"
>
<div
class=
"goods-item"
v-for=
"(goods,goodsIndex) in data.list"
:key=
"goodsIndex"
>
<el-tooltip
effect=
"dark"
content=
"移除老师"
placement=
"top"
>
<el-button
@
click=
"deleteGoods(goodsIndex,null)"
circle
class=
"goods-delete"
type=
"danger"
icon=
"el-icon-close"
></el-button>
</el-tooltip>
<div
class=
"goods-pic"
:style=
"'background-image:url('+getIconLink(goods.picUrl)+')'"
></div>
</div>
</draggable>
<div
class=
"goods-add"
>
<el-button
size=
"small"
@
click=
"showGoodsDialog(null)"
icon=
"el-icon-plus"
></el-button>
</div>
</el-form-item>
</
template
>
<hr>
<el-form-item
label=
"列表样式"
>
<!-- <el-radio v-model="data.listStyle" :label="-1">列表模式</el-radio>-->
<el-radio
v-model=
"data.listStyle"
:label=
"0"
>
左右滑动
</el-radio>
<!-- <el-radio v-model="data.listStyle" :label="1">一行一个</el-radio>-->
</el-form-item>
<el-form-item
label=
"背景颜色"
>
<div
class=
"input-color"
flex=
"dir:left cross:center"
>
<el-color-picker
size=
"small"
v-model=
"data.backgroundColor"
></el-color-picker>
<el-input
size=
"small"
style=
"width: 80px;margin-right: 25px;"
v-model=
"data.backgroundColor"
></el-input>
</div>
</el-form-item>
<el-form-item
label=
"上边距"
>
<el-input
type=
"number"
size=
"small"
:min=
"0"
v-model=
"data.PaddingTop"
>
<
template
slot=
"append"
>
px
</
template
>
</el-input>
</el-form-item>
<el-form-item
label=
"下边距"
>
<el-input
type=
"number"
size=
"small"
:min=
"0"
v-model=
"data.PaddingBottom"
>
<
template
slot=
"append"
>
px
</
template
>
</el-input>
</el-form-item>
<el-form-item
label=
"左边距"
>
<el-input
type=
"number"
size=
"small"
:min=
"0"
v-model=
"data.PaddingLeft"
>
<
template
slot=
"append"
>
px
</
template
>
</el-input>
</el-form-item>
<el-form-item
label=
"右边距"
>
<el-input
type=
"number"
size=
"small"
:min=
"0"
v-model=
"data.PaddingRight"
>
<
template
slot=
"append"
>
px
</
template
>
</el-input>
</el-form-item>
<el-form-item
label=
"圆角"
>
<el-input
type=
"number"
size=
"small"
:min=
"0"
v-model=
"data.SearchFilletPX"
>
<
template
slot=
"append"
>
px
</
template
>
</el-input>
</el-form-item>
</el-form>
</div>
</div>
<!-- 选择图片文件 -->
<el-dialog
title=
"选择文件"
:visible
.
sync=
"choicImg"
width=
"1240px"
>
<ChooseImg
@
SelectId=
"SelectId"
></ChooseImg>
</el-dialog>
<!-- 选择商品 -->
<el-dialog
title=
"选择老师"
:visible
.
sync=
"isShowGoods"
width=
"800px"
>
<choicels
ref=
"choiceGood"
></choicels>
<span
slot=
"footer"
class=
"dialog-footer"
>
<el-button
size=
"small"
@
click=
"isShowGoods=false"
>
取 消
</el-button>
<el-button
size=
"small"
type=
"danger"
@
click=
"getGoodsChoice()"
>
确 定
</el-button>
</span>
</el-dialog>
</div>
</template>
<
script
>
import
draggable
from
"vuedraggable"
import
ChooseImg
from
"@/components/global/ChooseImg.vue"
;
import
choicels
from
"../../common/choicels.vue"
;
export
default
{
props
:
[
"lsData"
,
"index"
,
"dataLeng"
],
components
:
{
draggable
,
ChooseImg
,
choicels
},
data
()
{
return
{
//可以选择的商品数
ckGoods
:
0
,
data
:
this
.
lsData
.
data
,
position
:
'center center'
,
repeat
:
'no-repeat'
,
choicImg
:
false
,
isShowGoods
:
false
,
//添加的下标
comIndex
:
-
1
,
};
},
created
()
{
},
methods
:
{
//向父组件传值 并调用排序
resetSord
(
IsUp
)
{
this
.
$emit
(
'getSord'
,
this
.
index
,
IsUp
);
},
//点击触发父组件删除
delPlugin
()
{
this
.
$emit
(
'comDelPlugin'
,
this
.
index
);
},
cCatGoodsList
(
cat
,
catIndex
)
{
const
goodsList
=
cat
.
goodsList
;
let
newList
=
[];
if
(
catIndex
>
0
)
{
newList
=
[];
}
else
{
if
(
goodsList
&&
goodsList
.
length
)
{
newList
=
goodsList
;
}
else
{
const
defaultGoodsItem
=
{
id
:
0
,
name
:
'老师名称'
,
picUrl
:
''
,
price
:
'100.00'
,
};
newList
=
new
Array
(
cat
.
goodsNum
).
fill
(
defaultGoodsItem
);
}
}
return
newList
;
},
goodsTagChange
(
e
)
{
this
.
data
.
goodsTagPicUrl
=
e
;
this
.
data
.
customizeGoodsTag
=
false
;
},
customizeGoodsTagChange
(
e
)
{
this
.
data
.
goodsTagPicUrl
=
''
;
this
.
data
.
customizeGoodsTag
=
true
;
},
deleteCat
(
index
)
{
this
.
data
.
catList
.
splice
(
index
,
1
);
},
showGoodsDialog
(
catIndex
)
{
if
(
catIndex
!==
null
)
{
this
.
comIndex
=
catIndex
}
else
{
this
.
comIndex
=
null
;
}
this
.
isShowGoods
=
true
;
},
deleteGoods
(
goodsIndex
,
catIndex
)
{
if
(
catIndex
!==
null
)
{
}
else
{
this
.
data
.
list
.
splice
(
goodsIndex
,
1
);
}
},
listStyleChange
(
listStyle
)
{
if
(
listStyle
===
-
1
&&
this
.
data
.
textStyle
===
2
)
{
this
.
data
.
textStyle
=
1
;
}
if
(
this
.
data
.
textStyle
===
2
&&
this
.
data
.
buyBtn
===
'text'
)
{
this
.
data
.
buyBtn
=
'cart'
;
}
},
//选择图片
SelectId
(
msg
)
{
this
.
choicImg
=
false
;
},
//选择商品
getGoodsChoice
()
{
var
ckedArr
=
this
.
$refs
.
choiceGood
.
getChoicedGoods
();
var
myArray
=
[];
if
(
ckedArr
&&
ckedArr
.
length
>
0
)
{
ckedArr
.
forEach
(
element
=>
{
myArray
.
push
({
id
:
element
.
ID
,
name
:
element
.
Name
,
picUrl
:
element
.
TeacherLogo
,
nationality
:
element
.
Nationality
,
isForeigners
:
element
.
IsForeigners
,
lableName
:
element
.
LableName
,
});
});
}
if
(
this
.
comIndex
!==
null
)
{
}
else
{
this
.
data
.
list
=
this
.
data
.
list
.
concat
(
myArray
);
}
this
.
isShowGoods
=
false
;
this
.
$refs
.
choiceGood
.
toggleSelection
();
},
//取消选择商品
quxiaoGoods
()
{
this
.
isShowGoods
=
false
;
this
.
$refs
.
choiceGood
.
toggleSelection
();
}
},
computed
:
{
cMainFlex
()
{
if
(
this
.
data
.
catPosition
===
'left'
)
{
return
'dir:left box:first'
;
}
if
(
this
.
data
.
catPosition
===
'top'
)
{
return
'dir:top'
;
}
},
cCatFlex
()
{
if
(
this
.
data
.
catPosition
===
'left'
)
{
return
'dir:top'
;
}
if
(
this
.
data
.
catPosition
===
'top'
)
{
return
'dir:left'
;
}
},
cCatList
()
{
if
(
this
.
data
.
showCat
)
{
if
(
this
.
data
.
catList
&&
this
.
data
.
catList
.
length
)
{
return
this
.
data
.
catList
;
}
else
{
const
defaultCatItem
=
{
id
:
0
,
name
:
'分类名称'
,
menuName
:
'分类名称'
,
goodsList
:
[],
goodsNum
:
3
,
};
return
[
defaultCatItem
,
defaultCatItem
];
}
}
else
{
return
[{
id
:
null
,
name
:
null
,
menuName
:
null
,
goodsList
:
this
.
data
.
list
,
}];
}
},
cCatStyle
()
{},
cGoodsListStyle
()
{
if
(
this
.
data
.
listStyle
===
0
)
{
return
'flex-wrap: nowrap;overflow-x:auto;'
;
}
else
{
return
'flex-wrap: wrap;'
;
}
},
cGoodsItemFlex
()
{
if
(
this
.
data
.
listStyle
===
-
1
)
{
return
'dir:left box:first cross:center'
;
}
return
'dir:top'
;
},
cGoodsItemStyle
()
{
let
style
;
if
(
this
.
data
.
goodsStyle
!=
3
)
{
if
(
this
.
data
.
listStyle
===
-
1
)
{
style
=
'border: 1px solid #e2e2e2;border-radius:10px;background:#fff;'
}
else
{
style
=
'border: 1px solid #e2e2e2;border-radius:10px;background:#fff;'
}
}
else
{
return
style
}
if
(
this
.
data
.
goodsStyle
===
2
)
{
return
style
}
else
if
(
this
.
data
.
goodsStyle
===
1
)
{
if
(
this
.
data
.
listStyle
===
-
1
)
{
return
'border-radius:10px;background:#fff;'
}
else
{
return
'border-radius:10px;background:#fff;'
}
}
else
{
return
'background:#fff;'
;
}
},
cShowBuyBtn
()
{
if
(
!
this
.
data
.
showBuyBtn
)
{
return
false
;
}
if
(
this
.
data
.
textStyle
===
2
||
this
.
data
.
listStyle
===
0
)
{
return
false
;
}
return
true
;
},
cGoodsItemInfoStyle
()
{
let
style
=
''
;
if
(
this
.
data
.
textStyle
===
2
)
{
style
+=
`text-align: center;`
;
}
if
(
this
.
data
.
listStyle
===
-
1
)
{
style
+=
`height: 200px;padding: 20px 24px 20px 32px;`
;
}
else
{
style
+=
`padding:24px 24px;`
;
}
return
style
;
},
cGoodsItemWidth
()
{
if
(
this
.
data
.
listStyle
===
0
)
{
return
'width: 200px;'
;
}
return
'width: 100%;'
;
},
cButtonStyle
()
{
let
style
=
`background:
${
this
.
data
.
buttonColor
}
;border-color:
${
this
.
data
.
buttonColor
}
;height:48px;line-height:46px;padding:0 20px;`
;
if
(
this
.
data
.
buyBtnStyle
===
3
||
this
.
data
.
buyBtnStyle
===
4
)
{
style
+=
`border-radius:999px;`
;
}
if
(
this
.
data
.
buyBtnStyle
===
2
||
this
.
data
.
buyBtnStyle
===
4
)
{
style
+=
`background:#fff;color:
${
this
.
data
.
buttonColor
}
`
;
}
return
style
;
},
},
mounted
()
{
}
};
</
script
>
src/components/sallCenter/startupPage.vue
View file @
ad855a9c
...
...
@@ -8,8 +8,8 @@
<div
style=
"display:flex;"
flex=
"box:first"
>
<div
class=
"Auth_outside"
>
<div
flex=
"dir:left main:center cross:center"
class=
"inside"
>
<img
v-if=
"addMsg.
AuthUrl!=''"
class=
"authPic"
:src=
"getIconLink(addMsg.Auth
Url)"
alt=
""
>
<img
v-else
class=
"authPic"
:src=
"getIconLink(addMsg.
Auth
Url)"
alt=
""
/>
<img
v-if=
"addMsg.
PicUrl!=''"
class=
"authPic"
:src=
"getIconLink(addMsg.Pic
Url)"
alt=
""
>
<img
v-else
class=
"authPic"
:src=
"getIconLink(addMsg.
Pic
Url)"
alt=
""
/>
</div>
</div>
<div
class=
"Auth_right"
>
...
...
@@ -17,26 +17,35 @@
<div
slot=
"header"
>
设置
</div>
<el-form
label-width=
"100px"
>
<el-form-item
label=
"是否开启"
>
<el-switch
v-model=
"addMsg.IsOpenAuth"
:active-value=
"1"
:inactive-value=
"0"
></el-switch>
<el-switch
v-model=
"addMsg.IsShow"
:active-value=
"1"
:inactive-value=
"0"
></el-switch>
</el-form-item>
<el-form-item
label=
"是否开启"
>
<el-input
placeholder=
"请输入内容"
v-model=
"addMsg.Seconds"
size=
"small"
type=
"number"
:min=
"0"
style=
"max-width:600px"
>
<template
slot=
"append"
>
秒
</
template
>
</el-input>
</el-form-item>
<el-form-item
label=
"商品视频"
>
<el-input
v-model=
"addMsg.MusicUrl"
size=
"small"
placeholder=
"请输入内容"
style=
"max-width:600px"
>
<el-button
@
click=
"changevideo = true"
slot=
"append"
>
添加视频
</el-button>
</el-input>
</el-form-item>
<el-form-item
label=
"上传图片"
>
<el-tooltip
class=
"item"
effect=
"dark"
content=
"推荐尺寸650*700"
placement=
"bottom"
>
<el-button
size=
"mini"
@
click=
"choicImg=true"
>
选择文件
</el-button>
</el-tooltip>
<div
class=
"Auth_imgList"
flex=
"main:center cross:center"
v-if=
"addMsg.AuthUrl!=''"
>
<img
:src=
"getIconLink(addMsg.AuthUrl)"
alt=
""
>
<el-button
type=
"danger"
v-if=
"addMsg.AuthUrl!=''"
class=
"image-delete"
size=
"mini"
icon=
"el-icon-close"
@
click
.
stop=
"addMsg.AuthUrl=''"
circle
></el-button>
<el-upload
class=
"avatar-uploader"
action=
""
accept=
"image/jpeg,image/gif,image/png,image/bmp"
:show-file-list=
"false"
:http-request=
"UploadImage"
:before-upload=
"beforeAvatarUpload"
>
<div
class=
"app-upload"
flex=
"main:center cross:center"
style=
"width: 100px; height: 40px;"
>
<el-button
size=
"mini"
>
选择文件
</el-button>
</div>
<div
class=
"Auth_imgList"
flex=
"main:center cross:center"
v-if=
"addMsg.PicUrl!=''"
>
<img
:src=
"getIconLink(addMsg.PicUrl)"
alt=
""
>
<el-button
type=
"danger"
v-if=
"addMsg.PicUrl!=''"
class=
"image-delete"
size=
"mini"
icon=
"el-icon-close"
@
click
.
stop=
"addMsg.PicUrl=''"
circle
></el-button>
</div>
</el-upload>
</el-form-item>
<!--
<el-form-item
label=
"热区"
>
-->
<!--
<choiceAreaAuth
ref=
"choiceAreaAuth"
:multiple=
"true"
:max=
"2"
:pic-url=
"getIconLink(addMsg.AuthUrl)"
--
>
<!-- mode='auth' :hotspotArray="addMsg.AuthDataList" width="650px" height="700px"-->
<!-- @confirm="selectHotspot" >-->
<!--
<el-button
size=
"mini"
>
划分热区
</el-button>
-->
<!--
</choiceAreaAuth>
-->
<!--
<div>
注:需要划分两个热区:一个是登录按钮热区,一个是暂不登录按钮热区
</div>
-->
<!--
</el-form-item>
-->
</el-form>
</el-card>
<el-button
type=
"primary"
style=
"margin-top:20px;padding:9px 25px"
size=
"small"
@
click=
"saveMsg"
>
保存
...
...
@@ -49,11 +58,16 @@
<el-dialog
title=
"选择文件"
:visible
.
sync=
"choicImg"
width=
"1240px"
>
<ChooseImg
@
SelectId=
"SelectId"
></ChooseImg>
</el-dialog>
<!-- 选择视频 -->
<el-dialog
title=
"选择文件"
:visible
.
sync=
"changevideo"
width=
"1240px"
>
<Choosevideo
@
Selectvideo=
"Selectvideo"
></Choosevideo>
</el-dialog>
</div>
</template>
<
script
>
import
ChooseImg
from
"@/components/global/ChooseImg.vue"
;
import
choiceAreaAuth
from
"../common/choiceAreaAuth.vue"
;
import
Choosevideo
from
"@/components/global/Choosevideo.vue"
;
export
default
{
data
()
{
return
{
...
...
@@ -64,12 +78,16 @@
pageSize
:
15
,
Name
:
""
,
},
changevideo
:
false
,
addMsg
:
{
MallBaseId
:
0
,
IsOpenAuth
:
0
,
//是否开启
AuthUrl
:
this
.
domainManager
().
ImageUrl
+
'/Static/auth-default.png'
,
//图片
AuthDataList
:
[
]
//热区
ID
:
0
,
MusicUrl
:
''
,
//音乐地址
Seconds
:
0
,
IsShow
:
0
,
//是否开启
PicUrl
:
this
.
domainManager
().
ImageUrl
+
'/Static/auth-default.png'
,
//图片
},
imgshow
:
true
,
};
},
created
()
{
...
...
@@ -77,61 +95,34 @@
},
components
:
{
ChooseImg
,
choiceAreaAuth
Choosevideo
},
methods
:
{
GetData
()
{
this
.
addMsg
.
MallBaseId
=
this
.
getLocalStorage
().
MallBaseId
;
this
.
apipost
(
"/api/Tenant/GetMiniPrograme"
,
{
MallBaseId
:
this
.
addMsg
.
MallBaseId
,
this
.
apipost
(
"/api/Education/GetEducationStartUpModel"
,
{
},
res
=>
{
if
(
res
.
data
.
resultCode
==
1
)
{
this
.
addMsg
.
IsOpenAuth
=
res
.
data
.
data
.
IsOpenAuth
;
if
(
res
.
data
.
data
.
AuthUrl
)
{
this
.
addMsg
.
AuthUrl
=
res
.
data
.
data
.
AuthUrl
;
this
.
addMsg
.
IsShow
=
res
.
data
.
data
.
IsShow
;
this
.
addMsg
.
ID
=
res
.
data
.
data
.
ID
;
this
.
addMsg
.
Seconds
=
res
.
data
.
data
.
Seconds
;
if
(
res
.
data
.
data
.
PicUrl
)
{
this
.
addMsg
.
PicUrl
=
res
.
data
.
data
.
PicUrl
;
}
if
(
res
.
data
.
data
.
AuthDataList
&&
res
.
data
.
data
.
AuthDataList
.
length
>
0
)
{
this
.
addMsg
.
AuthDataList
=
res
.
data
.
data
.
AuthDataList
;
}
else
{
this
.
GetDefaultSpot
();
if
(
res
.
data
.
data
.
MusicUrl
)
{
this
.
addMsg
.
MusicUrl
=
res
.
data
.
data
.
MusicUrl
;
}
}
else
{
this
.
Info
(
res
.
data
.
message
);
}
})
},
//热区设置默认值
GetDefaultSpot
()
{
var
objCancel
=
{
width
:
224
,
height
:
80
,
left
:
84
,
top
:
566
,
defaultX
:
84
,
defaultY
:
566
,
link
:
""
,
open_type
:
"cancel"
,
IsChecked
:
false
,
};
this
.
addMsg
.
AuthDataList
.
push
(
objCancel
);
var
objLogin
=
{
width
:
224
,
height
:
80
,
left
:
340
,
top
:
566
,
defaultX
:
340
,
defaultY
:
566
,
link
:
""
,
open_type
:
"login"
,
IsChecked
:
false
,
};
this
.
addMsg
.
AuthDataList
.
push
(
objLogin
);
},
//保存
saveMsg
()
{
this
.
apipost
(
"/api/Tenant/SetMiniProgramMallAuth"
,
this
.
addMsg
,
res
=>
{
if
(
this
.
addMsg
.
Seconds
==
''
){
this
.
addMsg
.
Seconds
=
0
}
this
.
apipost
(
"/api/Education/AddOrUpdateEducationStartUp "
,
this
.
addMsg
,
res
=>
{
if
(
res
.
data
.
resultCode
==
1
)
{
this
.
GetData
();
this
.
Success
(
res
.
data
.
message
);
...
...
@@ -142,14 +133,35 @@
},
//选择图片
SelectId
(
msg
)
{
this
.
addMsg
.
Auth
Url
=
this
.
getIconLink
(
msg
.
url
);
this
.
addMsg
.
Pic
Url
=
this
.
getIconLink
(
msg
.
url
);
this
.
choicImg
=
false
;
},
// 热区选择(edit)
selectHotspot
(
list
)
{
this
.
addMsg
.
AuthDataList
=
list
;
this
.
$refs
.
choiceAreaAuth
.
clearAll
()
;
Selectvideo
(
val
)
{
this
.
addMsg
.
MusicUrl
=
val
.
Path
;
this
.
changevideo
=
false
;
},
UploadImage
(
file
)
{
if
(
this
.
imgshow
==
true
){
this
.
UploadFileToTencent
(
this
.
FileType
().
GoodsImg
,
file
.
file
,
res
=>
{
if
(
res
.
resultCode
==
1
)
{
if
(
res
.
FileUrl
){
this
.
addMsg
.
PicUrl
=
res
.
FileUrl
;
}
}
})
}
},
beforeAvatarUpload
(
file
){
if
(
file
.
size
/
1024
>
170
){
this
.
Error
(
'图片大于170KB'
);
this
.
imgshow
=
false
}
else
{
this
.
imgshow
=
true
}
}
},
mounted
()
{
this
.
GetData
();
...
...
src/components/sallCenter/templateEdit.vue
View file @
ad855a9c
...
...
@@ -294,6 +294,8 @@
:index=
"index"
:dataLeng=
"dataList.length"
></reservestore>
<storeGoods
v-if=
"item.Id=='storeGoods'"
:storeData=
"item"
@
getSord=
"getSord"
@
comDelPlugin=
"comDelPlugin"
:index=
"index"
:dataLeng=
"dataList.length"
></storeGoods>
<educationteacher
v-if=
"item.Id=='educationteacher'"
:lsData=
"item"
@
getSord=
"getSord"
@
comDelPlugin=
"comDelPlugin"
:index=
"index"
:dataLeng=
"dataList.length"
></educationteacher>
</div>
</div>
</div>
...
...
@@ -404,6 +406,7 @@
import
sidao
from
"../sallCenter/plugin/sidao.vue"
import
education
from
"../sallCenter/plugin/education"
import
educationArticle
from
"../sallCenter/plugin/educationArticle"
import
educationteacher
from
"../sallCenter/plugin/educationteacher"
import
educationCustom
from
"../sallCenter/plugin/educationCustom"
import
reservestore
from
"../sallCenter/plugin/reservestore"
import
storeGoods
from
"../sallCenter/plugin/storeGoods"
...
...
@@ -482,7 +485,8 @@
educationArticle
,
educationCustom
,
reservestore
,
storeGoods
storeGoods
,
educationteacher
},
methods
:
{
//选择图片
...
...
@@ -1427,6 +1431,26 @@
}
this
.
dataList
.
push
(
storeGoodObj
);
break
;
//老师
case
'educationteacher'
:
let
lsObj
=
{
Id
:
'educationteacher'
,
isCked
:
false
,
data
:{
addGoodsType
:
0
,
//商品添加方式【0-自定义,1-最新】
listStyle
:
0
,
//列表样式[-1-列表模式,0-左右滑动,1-一行一个]
backgroundColor
:
'#fff'
,
//背景颜色
SearchFilletPX
:
0
,
//圆角
PaddingTop
:
0
,
//上边距
PaddingBottom
:
0
,
//下边距
PaddingLeft
:
0
,
//左边距
PaddingRight
:
0
,
//右边距
list
:
[],
//商品列表
}
}
this
.
dataList
.
push
(
lsObj
);
break
;
}
},
//给子组件调用 重新排序上移下移
...
...
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