Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
confucius
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
罗超
confucius
Commits
17fc05c2
Commit
17fc05c2
authored
Mar 08, 2021
by
罗超
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
http://gitlab.oytour.com/luochao/confucius
parents
827549d4
077ab81b
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
644 additions
and
24 deletions
+644
-24
index.js
src/api/course/index.js
+36
-0
default.png
src/assets/images/default.png
+0
-0
course-form.vue
src/components/course/course-form.vue
+7
-6
courseprice-form.vue
src/components/course/courseprice-form.vue
+243
-0
course.vue
src/pages/course/course.vue
+26
-17
courseList.vue
src/pages/sale/courseList.vue
+326
-0
routes.js
src/router/routes.js
+6
-1
No files found.
src/api/course/index.js
View file @
17fc05c2
...
...
@@ -235,3 +235,39 @@ export function queryCourseJobPageList(data) {
data
})
}
/**
* 获取课程优惠类型列表
*/
export
function
queryCoursePreferentialType
()
{
return
request
({
url
:
"/Course/GetCoursePreferentialType"
,
method
:
'post'
,
})
}
/**
* 获取课程优惠列表
*/
export
function
queryCoursePreferentialList
(
data
)
{
return
request
({
url
:
"/Course/GetCoursePreferentialList"
,
method
:
'post'
,
data
})
}
/**
* 新增修改课程优惠
*/
export
function
saveCoursePreferential
(
data
)
{
return
request
({
url
:
"/Course/SetBeatchCoursePreferential"
,
method
:
'post'
,
data
})
}
\ No newline at end of file
src/assets/images/default.png
0 → 100644
View file @
17fc05c2
4.93 KB
src/components/course/course-form.vue
View file @
17fc05c2
...
...
@@ -26,12 +26,12 @@
<q-input
v-model=
"objOption.CourseFeature"
filled
type=
"textarea"
placeholder=
"课程特色"
/>
</div>
</div>
<div
class=
"text-caption q-mb-lg q-px-md text-grey-6"
>
<div
class=
"text-caption q-mb-lg q-px-md text-grey-6"
v-if=
"isShowPrice==1"
>
价格设置
<q-toggle
style=
"float:right;"
size=
"md"
left-label
label=
"阶梯定价"
color=
"primary"
:false-value=
"0"
:true-value=
"1"
v-model=
"objOption.IsOpenStepPrice"
/>
</div>
<div
class=
"row wrap"
>
<div
class=
"row wrap"
v-if=
"isShowPrice==1"
>
<div
class=
"col-6"
>
<q-input
filled
stack-label
maxlength=
"8"
:dense=
"false"
v-model=
"objOption.OriginalPrice"
ref=
"OriginalPrice"
class=
"col-6 q-pr-lg q-pb-lg"
label=
"原价"
...
...
@@ -43,13 +43,13 @@
:rules=
"[val => !!val || '请填写卖价']"
/>
</div>
</div>
<div
class=
"row wrap"
style=
"margin:20px 0;"
>
<div
class=
"row wrap"
style=
"margin:20px 0;"
v-if=
"isShowPrice==1"
>
<div
class=
"col-6"
>
<q-btn
v-if=
"objOption.IsOpenStepPrice==1"
size=
"10px"
@
click=
"addStepPrice()"
round
color=
"primary"
icon=
"iconfont icon-img_haha"
/>
</div>
</div>
<template
v-if=
"objOption.IsOpenStepPrice==1"
>
<template
v-if=
"objOption.IsOpenStepPrice==1
&& isShowPrice==1
"
>
<div
class=
"row wrap"
v-for=
"(item,index) in ladderPriceList"
:key=
"index"
>
<div
class=
"col-6"
>
<q-input
filled
stack-label
maxlength=
"3"
v-model=
"item.PersionNum"
...
...
@@ -65,11 +65,11 @@
</div>
</div>
</
template
>
<div
class=
"text-caption q-mb-lg q-px-md text-grey-6"
>
可续费课程
<div
class=
"text-caption q-mb-lg q-px-md text-grey-6"
v-if=
"isShowPrice==1"
>
可续费课程
<q-toggle
style=
"float:right;"
size=
"md"
left-label
label=
"可续费课程"
color=
"primary"
:false-value=
"0"
:true-value=
"1"
v-model=
"objOption.IsRenew"
/>
</div>
<div
class=
"row wrap"
v-if=
"objOption.IsRenew==1"
>
<div
class=
"row wrap"
v-if=
"objOption.IsRenew==1
&&isShowPrice==1
"
>
<div
class=
"col-6"
>
<q-input
filled
stack-label
maxlength=
"8"
:dense=
"false"
v-model=
"objOption.RenewOgPrice"
ref=
"RenewOgPrice"
class=
"col-6 q-pr-lg q-pb-lg"
label=
"续费原价"
@
keyup
.
native=
"checkPrice(objOption,'RenewOgPrice')"
...
...
@@ -163,6 +163,7 @@
SaleplatList
:
[],
//销售端口
choosePlat
:
[],
//选择的平台
chooseTeacher
:
[],
//选择老师
isShowPrice
:
0
,
//是否显示价格【hk2021-03-05新增】
}
},
created
()
{
...
...
src/components/course/courseprice-form.vue
0 → 100644
View file @
17fc05c2
<
template
>
<q-dialog
v-model=
"persistent"
persistent
content-class=
"bg-grey-1"
transition-show=
"scale"
transition-hide=
"scale"
>
<q-card
style=
"width: 800px;max-width:900px;"
>
<q-card-section>
<div
class=
"text-h6"
>
设置课程价格
</div>
</q-card-section>
<q-card-section
class=
"q-pt-none scroll"
style=
"max-height: 70vh"
>
<div
class=
"text-caption q-mb-lg q-px-md text-grey-6"
>
基础价格设置
</div>
<div
class=
"row wrap"
>
<div
class=
"col-6"
>
<q-input
filled
stack-label
maxlength=
"8"
:dense=
"false"
v-model=
"priceObj.courseObj.OriginalPrice"
ref=
"OriginalPrice"
class=
"col-6 q-pr-lg q-pb-lg"
label=
"基础收费"
@
keyup
.
native=
"checkPrice(priceObj.courseObj,'OriginalPrice')"
:rules=
"[val => !!val || '请填写基础收费']"
/>
</div>
<div
class=
"col-6"
>
<q-input
filled
stack-label
maxlength=
"8"
:dense=
"false"
v-model=
"priceObj.courseObj.SellPrice"
ref=
"SellPrice"
class=
"col-6 q-pr-lg q-pb-lg"
label=
"卖价"
@
keyup
.
native=
"checkPrice(priceObj.courseObj,'SellPrice')"
:rules=
"[val => !!val || '请填写卖价']"
/>
</div>
</div>
</q-card-section>
<q-card-section
class=
"q-pt-none scroll"
style=
"max-height: 70vh"
>
<div
class=
"text-caption q-mb-lg q-px-md text-grey-6"
>
优惠设置
</div>
<table
class=
"col-12"
>
<thead>
<tr
style=
"height:60px;"
>
<td
colspan=
"5"
style=
"text-align:right;"
>
<q-btn
color=
"accent"
size=
"sm"
icon=
"add"
label=
"新增优惠"
@
click=
"addPrice()"
/>
</td>
</tr>
<tr>
<td
style=
"width:280px"
>
优惠类型
</td>
<td
style=
"width:180px"
>
优惠条件
</td>
<td
style=
"width:120px"
>
同行返佣
</td>
<td
style=
"width:120px"
>
销售返佣
</td>
<td
style=
"width:100px"
>
操作
</td>
</tr>
</thead>
<tbody
v-for=
"(item,index) in priceObj.priceList"
>
<tr>
<td>
<q-select
filled
stack-label
option-value=
"Id"
option-label=
"Name"
v-model=
"item.PriceDiscountType"
ref=
"PriceDiscountType_Id"
:options=
"priceTypeList"
label=
"优惠类型"
:dense=
"false"
class=
"col-6 q-pr-lg q-pb-lg"
emit-value
map-options
/>
</td>
<td>
<!--买送-->
<template
v-if=
"item.PriceDiscountType==1"
>
<q-input
filled
stack-label
maxlength=
"3"
:dense=
"false"
v-model=
"item.BuyNum"
ref=
"BuyNum"
class=
"col-6 q-pr-lg q-pb-lg"
label=
"买"
@
keyup
.
native=
"checkPrice(item,'BuyNum')"
style=
"width:80px;display:inline-block;"
suffix=
""
/>
<q-input
filled
stack-label
maxlength=
"3"
:dense=
"false"
v-model=
"item.SendNum"
ref=
"SendNum"
class=
"col-6 q-pr-lg q-pb-lg"
label=
"送"
@
keyup
.
native=
"checkPrice(item,'SendNum')"
style=
"width:80px;display:inline-block;"
suffix=
""
>
</q-input>
</
template
>
<!--刷卡分期-->
<
template
v-else-if=
"item.PriceDiscountType==5"
>
</
template
>
<
template
v-else
>
<q-input
filled
stack-label
maxlength=
"4"
:dense=
"false"
v-model=
"item.PriceMoney"
ref=
"PriceMoney"
class=
"q-pr-lg q-pb-lg"
label=
"优惠"
@
keyup
.
native=
"checkPrice(item,'PriceMoney')"
style=
"width:100px"
suffix=
"%"
/>
</
template
>
</td>
<td>
<q-input
filled
stack-label
maxlength=
"4"
:dense=
"false"
v-model=
"item.B2BCommissionMoney"
ref=
"B2BCommissionMoney"
class=
"q-pr-lg q-pb-lg"
label=
"同行返佣"
@
keyup
.
native=
"checkPrice(item,'B2BCommissionMoney')"
style=
"width:100px"
suffix=
"%"
/>
</td>
<td>
<q-input
filled
stack-label
maxlength=
"4"
:dense=
"false"
v-model=
"item.SaleCommissionMoney"
ref=
"SaleCommissionMoney"
class=
"q-pr-lg q-pb-lg"
label=
"销售返佣"
@
keyup
.
native=
"checkPrice(item,'SaleCommissionMoney')"
style=
"width:100px"
suffix=
"%"
/>
</td>
<td>
<q-btn
flat
size=
"xs"
icon=
"iconfont icon-shanchu"
title=
"删除"
color=
"negative"
style=
"font-weight:400"
class=
"q-mr-xs"
label=
""
@
click=
"delPrice(index)"
/>
</td>
</tr>
</tbody>
</table>
</q-card-section>
<q-separator
/>
<q-card-actions
align=
"right"
class=
"bg-white"
>
<q-btn
label=
"取消"
flat
color=
"grey-10"
style=
"font-weight:400 !important"
@
click=
"closeCourseForm"
/>
<q-btn
label=
"立即提交"
color=
"accent q-px-md"
style=
"font-weight:400 !important"
:loading=
"saveCourseLoading"
@
click=
"saveCourse"
/>
</q-card-actions>
</q-card>
</q-dialog>
</template>
<
script
>
import
{
saveCoursePreferential
,
queryCoursePreferentialList
,
queryCourseInfo
,
queryCoursePreferentialType
,
}
from
'../../api/course/index'
export
default
{
components
:
{},
props
:
{
saveObj
:
{
type
:
Object
,
default
:
null
}
},
data
()
{
return
{
persistent
:
true
,
optionTitle
:
""
,
saveCourseLoading
:
false
,
//价格对象
priceObj
:
{
courseObj
:
{
CourseId
:
0
,
//课程编号
OriginalPrice
:
0
,
//原价
SellPrice
:
0
,
//售价
},
priceList
:
[],
//价格列表
},
priceTypeList
:
[],
//优惠类型列表
}
},
created
()
{
this
.
getTypeList
();
},
mounted
()
{
this
.
initObj
()
},
methods
:
{
//获取优惠类型列表
getTypeList
()
{
queryCoursePreferentialType
().
then
(
res
=>
{
this
.
priceTypeList
=
res
.
Data
;
})
},
//新增价格
addPrice
()
{
var
currentObj
=
{
Id
:
0
,
//主键编号
CourseId
:
0
,
//课程编号
PreferentialTerms
:
""
,
//优惠条件
SaleCommissionType
:
0
,
//销售返佣类型(0-百分比,1-固定金额)
SaleCommissionMoney
:
0
,
//销售返佣
B2BCommissionType
:
0
,
//同行返佣类型(0-百分比,1-固定金额)
B2BCommissionMoney
:
0
,
//同行返佣
PriceDiscountType
:
0
,
//课程价格优惠类型(见枚举)
BuyNum
:
0
,
//购买人数
SendNum
:
0
,
//赠送人数
PriceType
:
0
,
//优惠价格类型(0-百分比,1-固定金额)
PriceMoney
:
0
,
//优惠金额
};
this
.
priceObj
.
priceList
.
push
(
currentObj
);
},
//删除价格
delPrice
(
index
)
{
this
.
priceObj
.
priceList
.
splice
(
index
,
1
);
},
//初始化表单
initObj
()
{
if
(
this
.
saveObj
&&
this
.
saveObj
.
CourseId
>
0
)
{
queryCourseInfo
({
CourseId
:
this
.
saveObj
.
CourseId
}).
then
(
res
=>
{
this
.
priceObj
.
courseObj
.
CourseId
=
res
.
Data
.
CourseId
;
this
.
priceObj
.
courseObj
.
OriginalPrice
=
res
.
Data
.
OriginalPrice
;
this
.
priceObj
.
courseObj
.
SellPrice
=
res
.
Data
.
SellPrice
;
})
queryCoursePreferentialList
({
CourseId
:
this
.
saveObj
.
CourseId
}).
then
(
res
=>
{
if
(
res
.
Code
==
1
&&
res
.
Data
)
{
this
.
priceObj
.
priceList
=
res
.
Data
;
}
})
this
.
optionTitle
=
"修改课程优惠信息"
}
else
{
this
.
optionTitle
=
"新增课程优惠信息"
this
.
priceObj
.
courseObj
.
CourseId
=
0
;
this
.
priceObj
.
courseObj
.
OriginalPrice
=
0
;
this
.
priceObj
.
courseObj
.
SellPrice
=
0
;
}
},
//关闭弹窗
closeCourseForm
()
{
this
.
$emit
(
'close'
)
this
.
persistent
=
false
},
//保存菜单
saveCourse
()
{
this
.
saveCourseLoading
=
true
;
if
(
this
.
priceObj
.
priceList
&&
this
.
priceObj
.
priceList
.
length
>
0
)
{
this
.
priceObj
.
priceList
.
forEach
(
item
=>
{
if
(
item
.
BuyNum
==
''
)
{
item
.
BuyNum
=
0
;
}
if
(
item
.
SendNum
==
''
)
{
item
.
SendNum
=
0
;
}
if
(
item
.
PriceMoney
==
''
)
{
item
.
PriceMoney
=
0
;
}
if
(
item
.
B2BCommissionMoney
==
''
)
{
item
.
B2BCommissionMoney
=
0
;
}
if
(
item
.
SaleCommissionMoney
==
''
)
{
item
.
SaleCommissionMoney
=
0
;
}
})
}
saveCoursePreferential
(
this
.
priceObj
).
then
(
res
=>
{
this
.
saveCourseLoading
=
false
this
.
$q
.
notify
({
icon
:
'iconfont icon-chenggong'
,
color
:
'accent'
,
timeout
:
2000
,
message
:
'数据保存成功!'
,
position
:
'top'
})
this
.
$emit
(
"success"
)
this
.
closeSaveForm
()
}).
catch
(()
=>
{
this
.
saveCourseLoading
=
false
});
}
},
}
</
script
>
src/pages/course/course.vue
View file @
17fc05c2
...
...
@@ -23,7 +23,7 @@
<div
class=
"col-2 q-table__title"
>
课程信息
</div>
<q-space
/>
<div
class=
"page-option"
>
<q-btn
color=
"accent"
size=
"sm"
class=
"q-mr-md"
icon=
"add"
label=
"新增课程"
@
click=
"EditCourse(null)"
/>
<q-btn
color=
"accent"
size=
"sm"
class=
"q-mr-md"
icon=
"add"
label=
"新增课程"
@
click=
"EditCourse(null
,1
)"
/>
</div>
</
template
>
<
template
v-slot:body-cell-CoverImg=
"props"
>
...
...
@@ -35,7 +35,7 @@
</
template
>
<
template
v-slot:body-cell-CourseIntro=
"props"
>
<q-td
:props=
"props"
>
<span
v-html=
"props.value"
></span>
<span
v-html=
"props.value"
></span>
</q-td>
</
template
>
<
template
v-slot:body-cell-Status=
"props"
>
...
...
@@ -50,7 +50,9 @@
<
template
v-slot:body-cell-optioned=
"props"
>
<q-td
:props=
"props"
>
<q-btn
flat
size=
"xs"
icon=
"edit"
color=
"accent"
style=
"font-weight:400"
label=
"编辑"
@
click=
"EditCourse(props.row)"
/>
@
click=
"EditCourse(props.row,1)"
/>
<q-btn
flat
size=
"xs"
icon=
"edit"
color=
"accent"
style=
"font-weight:400"
label=
"价格设置"
@
click=
"EditCourse(props.row,2)"
v-if=
"isShowPriceEditBtn==1"
/>
<q-btn
flat
size=
"xs"
icon=
"edit"
color=
"accent"
style=
"font-weight:400;display:none;"
label=
"详情"
@
click=
"goMycourse(props.row)"
/>
</q-td>
...
...
@@ -59,6 +61,9 @@
<course-form
v-if=
"isShowCourseForm"
:save-obj=
"courseObjOption"
@
close=
"closeMenuSaveForm"
@
success=
"refreshPage"
>
</course-form>
<courseprice-form
v-if=
"isShowCoursePriceForm"
:save-obj=
"courseObjOption"
@
close=
"closeMenuSaveForm"
@
success=
"refreshPage"
>
</courseprice-form>
</div>
</div>
</template>
...
...
@@ -68,6 +73,7 @@
queryCourseCategoryTree
,
}
from
'../../api/course/index'
import
courseForm
from
'../../components/course/course-form'
import
coursepriceForm
from
'../../components/course/courseprice-form'
import
selectTree
from
'../../components/common/select-tree'
export
default
{
meta
:
{
...
...
@@ -75,7 +81,8 @@
},
components
:
{
courseForm
,
selectTree
selectTree
,
coursepriceForm
},
data
()
{
return
{
...
...
@@ -93,19 +100,13 @@
align
:
'left'
,
field
:
row
=>
row
.
CourseName
},
// {
// name: 'CateName',
// label: '所属分类',
// field: 'CateName',
// align: 'left'
// },
{
name
:
'CoverImg'
,
label
:
'课程封面'
,
field
:
'CoverImg'
,
align
:
'left'
},
{
name
:
'CreateByName'
,
label
:
'创建人'
,
...
...
@@ -157,8 +158,10 @@
TreeCategoryList
:
[],
returnString
:
[],
//默认值
pageCount
:
0
,
isShowCourseForm
:
false
,
courseObjOption
:
null
,
isShowCourseForm
:
false
,
//是否显示课程表单
isShowCoursePriceForm
:
false
,
//是否显示课程价格表单
courseObjOption
:
null
,
//课程对象
isShowPriceEditBtn
:
1
,
//是否显示价格设置
}
},
mounted
()
{
...
...
@@ -214,20 +217,26 @@
//刷新页面
refreshPage
()
{
this
.
isShowCourseForm
=
false
;
this
.
isShowCoursePriceForm
=
false
;
this
.
getcourselist
();
},
//新增修改
菜单
EditCourse
(
obj
)
{
//新增修改
课程及价格
EditCourse
(
obj
,
type
)
{
if
(
obj
)
{
this
.
courseObjOption
=
obj
}
else
{
this
.
courseObjOption
=
null
}
this
.
isShowCourseForm
=
true
if
(
type
==
1
)
{
this
.
isShowCourseForm
=
true
;
}
else
{
this
.
isShowCoursePriceForm
=
true
;
}
},
//关闭弹窗
closeMenuSaveForm
()
{
this
.
isShowCourseForm
=
false
this
.
isShowCourseForm
=
false
;
this
.
isShowCoursePriceForm
=
false
;
},
//跳转至我的课程
goMycourse
(
obj
)
{
...
...
src/pages/sale/courseList.vue
0 → 100644
View file @
17fc05c2
This diff is collapsed.
Click to expand it.
src/router/routes.js
View file @
17fc05c2
...
...
@@ -146,7 +146,7 @@ const routes = [{
{
path
:
"/course/lessonPreparation"
,
//教师备课
component
:
()
=>
import
(
"pages/course/lessonPreparation.vue"
)
import
(
"pages/course/lessonPreparation.vue"
)
},
{
path
:
"/course/prepareclassDetails"
,
//教师备课 备课详情
...
...
@@ -421,6 +421,11 @@ const routes = [{
component
:
()
=>
import
(
"pages/sale/japaneseTrain.vue"
)
},
{
path
:
"/sale/courseList"
,
//销售 课程预览
component
:
()
=>
import
(
"pages/sale/courseList.vue"
)
},
{
path
:
"/sale/myOrder"
,
//销售 我的订单
component
:
()
=>
...
...
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