Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
A
admin-base
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
new-sing
admin-base
Commits
8281daff
Commit
8281daff
authored
Dec 18, 2018
by
chenfenglei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
工具设置,生成短链接,生成二维码
parent
f748a398
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
234 additions
and
42 deletions
+234
-42
entrance.vue
src/components/framework/other/entrance.vue
+125
-2
getLink.vue
src/components/framework/other/getLink.vue
+35
-7
getqrCode.vue
src/components/framework/other/getqrCode.vue
+25
-7
index.vue
src/components/notBuyClass/index.vue
+7
-1
api.js
src/service/api.js
+42
-25
No files found.
src/components/framework/other/entrance.vue
View file @
8281daff
...
...
@@ -3,9 +3,58 @@
:visible
.
sync=
"entranceObj.show"
center
width=
"80%"
>
<el-tabs
v-model=
"activeName"
type=
"card"
@
tab-click=
"handleClick"
style=
"line-height:1"
>
<el-tab-pane
label=
"商品名称"
name=
"first"
>
<el-form
ref=
"searchFrom"
:model=
"searchFrom"
label-width=
"90px"
inline
>
<el-form-item
label=
"描述"
>
<el-input
v-model=
"searchFrom.desc"
></el-input>
</el-form-item>
<el-form-item
label=
"商品ID"
>
<el-select
v-model=
"searchFrom.value"
placeholder=
"请选择"
clearable
>
<el-option
v-for=
"(data,index) in goodsList"
:key=
"index"
:label=
"data.course_title"
:value=
"data.id"
>
</el-option>
</el-select>
</el-form-item>
<el-form-item>
<div
class=
"search-btn-block"
>
<el-button
type=
"primary"
plain
@
click=
"getUser(searchFrom)"
>
配置
</el-button>
</div>
</el-form-item>
</el-form>
</el-tab-pane>
<el-tab-pane
label=
"期数名称"
name=
"second"
>
<el-form
label-width=
"90px"
inline
:model=
"searchFrom2"
>
<el-form-item
label=
"描述"
>
<el-input
v-model=
"searchFrom2.desc"
></el-input>
</el-form-item>
<el-form-item
label=
"期数ID"
>
<el-select
v-model=
"searchFrom2.value"
placeholder=
"请选择"
clearable
>
<el-option
v-for=
"(data,index) in periodList"
:key=
"index"
:label=
"data.title"
:value=
"data.id"
>
</el-option>
</el-select>
</el-form-item>
<el-form-item>
<div
class=
"search-btn-block"
>
<el-button
type=
"primary"
plain
@
click=
"getUser(searchFrom2)"
>
配置
</el-button>
</div>
</el-form-item>
</el-form>
</el-tab-pane>
</el-tabs>
</el-dialog>
</
template
>
<
script
>
import
{
getGoodsListApi
,
getPeriodsApi
,
putConfigApi
}
from
"../../../service/api"
;
export
default
{
name
:
"entrance"
,
props
:[
...
...
@@ -13,14 +62,88 @@ export default {
],
data
(){
return
{
goodsList
:[],
periodList
:[],
activeName
:
'first'
,
searchFrom
:{
key
:
'goods_receive_course '
,
desc
:
''
,
value
:
''
,
},
searchFrom2
:{
key
:
'periods_receive_course'
,
desc
:
''
,
value
:
''
,
},
}
},
mounted
(){
},
methods
:{
handleClick
(
tab
)
{
let
_name
=
tab
.
name
if
(
_name
===
'first'
)
{
}
else
{
this
.
getPeriodsList
();
}
},
getPeriodsList
(){
let
json1
=
{
limit
:
2000
,
page
:
1
}
getPeriodsApi
(
json1
).
then
(
res
=>
{
this
.
periodList
=
res
.
list
;
});
},
getGoodsList
(){
let
json
=
{
limit
:
2000
,
page
:
1
}
getGoodsListApi
(
json
).
then
(
res
=>
{
this
.
goodsList
=
res
.
list
;
})
},
getUser
(
data
){
if
(
data
.
value
!=
""
&&
data
.
desc
!=
""
){
this
.
$confirm
(
'此操作将设置系统指定配置为商品?'
,
'提示'
,
{
confirmButtonText
:
'确定'
,
cancelButtonText
:
'取消'
,
type
:
'warning'
}).
then
(()
=>
{
putConfigApi
(
data
).
then
(
res
=>
{
this
.
$message
({
type
:
'success'
,
message
:
'设置成功!'
});
});
});
}
else
{
this
.
$message
({
type
:
"error"
,
message
:
"请设置选择项!"
});
}
}
},
watch
:{
'entranceObj.show'
:
function
(
a
){
if
(
a
){
this
.
getGoodsList
();
}
else
{
this
.
searchFrom2
.
value
=
""
;
this
.
searchFrom2
.
desc
=
""
;
this
.
searchFrom
.
value
=
""
;
this
.
searchFrom
.
desc
=
""
;
}
}
}
}
</
script
>
<
style
scoped
lang=
"less"
>
</
style
>
src/components/framework/other/getLink.vue
View file @
8281daff
...
...
@@ -2,15 +2,15 @@
<el-dialog
:title=
"linkObj.title"
:visible
.
sync=
"linkObj.show"
center
width=
"800px"
>
<el-form
:model=
"form"
ref=
"form"
label-width=
"100px"
class=
"demo-ruleForm"
>
<el-form
:model=
"form"
ref=
"form"
label-width=
"100px"
>
<el-form-item
label=
"输入链接"
prop=
"
age
"
prop=
"
link
"
:rules=
"[
{ required: true, message: '内容不能为空'}
]"
>
<el-input
type=
"link"
v-model
.
number
=
"form.link"
autocomplete=
"off"
></el-input>
<el-input
v-model
=
"form.link"
autocomplete=
"off"
></el-input>
</el-form-item>
<el-form-item>
<el-button
type=
"primary"
@
click=
"submitForm('form')"
>
获取
</el-button>
...
...
@@ -18,13 +18,15 @@
</el-form>
<div
class=
"link_content"
v-if=
"content.show"
>
<div
class=
"content"
>
<el-input
v-model=
"content.text"
disabled
></el-input>
<el-input
v-model=
"content.text"
readonly=
"readonly"
id=
"text"
></el-input>
<textarea
id=
"input"
style=
"opacity:0;z-index=-10;position:absolute;top:0;left:0;"
></textarea>
</div>
<el-button
type=
"primary"
>
复制链接
</el-button>
<el-button
type=
"primary"
@
click=
"copyUrl(content.text)"
>
复制链接
</el-button>
</div>
</el-dialog>
</
template
>
<
script
>
import
{
getLinkApi
}
from
"../../../service/api"
;
export
default
{
name
:
"getLink"
,
props
:
[
"linkObj"
],
...
...
@@ -34,7 +36,7 @@ export default {
link
:
""
},
content
:{
show
:
tru
e
,
show
:
fals
e
,
text
:
""
}
};
...
...
@@ -43,12 +45,38 @@ export default {
submitForm
(
formName
)
{
this
.
$refs
[
formName
].
validate
(
valid
=>
{
if
(
valid
)
{
alert
(
"submit!"
);
let
json
=
{}
json
.
url
=
this
.
form
.
link
;
getLinkApi
(
json
).
then
((
res
)
=>
{
this
.
content
.
show
=
true
;
this
.
content
.
text
=
res
.
url
;
})
}
else
{
console
.
log
(
"error submit!!"
);
return
false
;
}
});
},
copyUrl
(
data
){
let
url
=
data
;
let
oInput
=
document
.
createElement
(
'input'
);
oInput
.
value
=
url
;
document
.
body
.
appendChild
(
oInput
);
oInput
.
select
();
// 选择对象
document
.
execCommand
(
"Copy"
);
// 执行浏览器复制命令
this
.
$message
({
message
:
'已成功复制到剪切板'
,
type
:
'success'
});
oInput
.
remove
()
},
},
watch
:{
'linkObj.show'
:
function
(
a
){
if
(
!
a
){
this
.
form
.
link
=
""
;
this
.
content
.
show
=
false
;
}
}
}
};
...
...
src/components/framework/other/getqrCode.vue
View file @
8281daff
...
...
@@ -5,12 +5,12 @@
<el-form
:model=
"form"
ref=
"form"
label-width=
"100px"
class=
"demo-ruleForm"
>
<el-form-item
label=
"输入链接"
prop=
"
age
"
prop=
"
link
"
:rules=
"[
{ required: true, message: '内容不能为空'}
]"
>
<el-input
type=
"link"
v-model
.
number
=
"form.link"
autocomplete=
"off"
></el-input>
<el-input
v-model
=
"form.link"
autocomplete=
"off"
></el-input>
</el-form-item>
<el-form-item>
<el-button
type=
"primary"
@
click=
"submitForm('form')"
>
获取
</el-button>
...
...
@@ -18,13 +18,16 @@
</el-form>
<div
class=
"link_content"
v-if=
"content.show"
>
<div
class=
"content"
>
<img
:src=
"content.url"
id=
"cavasimg"
>
</div>
<el-button
type=
"primary"
>
下载二维码
</el-button>
<a
:href=
"content.url"
download=
"a.png"
>
<!--
<el-button
type=
"primary"
>
下载二维码
</el-button>
-->
</a>
</div>
</el-dialog>
</
template
>
<
script
>
import
{
getqrCodeApi
}
from
"../../../service/api"
;
export
default
{
name
:
"getqrCode"
,
props
:
[
"qrcodeObj"
],
...
...
@@ -34,7 +37,8 @@ export default {
link
:
""
},
content
:{
show
:
true
show
:
false
,
url
:
''
}
};
},
...
...
@@ -42,12 +46,23 @@ export default {
submitForm
(
formName
)
{
this
.
$refs
[
formName
].
validate
(
valid
=>
{
if
(
valid
)
{
alert
(
"submit!"
);
let
json
=
{}
json
.
url
=
this
.
form
.
link
;
this
.
content
.
show
=
true
;
this
.
content
.
url
=
`https://admin_test.changchangenglish.com/api/public/qrcode?str=
${
json
.
url
}
`
}
else
{
console
.
log
(
"error submit!!"
);
return
false
;
}
});
},
},
watch
:{
'qrcodeObj.show'
:
function
(
a
){
if
(
!
a
){
this
.
form
.
link
=
""
;
this
.
content
.
show
=
false
;
}
}
}
};
...
...
@@ -56,7 +71,10 @@ export default {
.content{
width: 300px;
height: 300px;
background: red;
margin: 0 auto;
img{
width: 300px;
height: 300px;
}
}
</
style
>
\ No newline at end of file
src/components/notBuyClass/index.vue
View file @
8281daff
...
...
@@ -5,6 +5,7 @@
</
template
>
<
script
>
import
{
getNotBuyApi
}
from
"../../service/api"
export
default
{
name
:
"notBuyClass"
,
...
...
@@ -18,7 +19,12 @@
},
methods
:{
getList
(){
let
json
=
""
;
getNotBuyApi
(
json
).
then
((
res
)
=>
{
console
.
log
(
res
);
})
},
}
}
...
...
src/service/api.js
View file @
8281daff
...
...
@@ -586,38 +586,38 @@ export const getDefaultPeriodsApi = function () {
return
Vue
.
prototype
.
$fetch
(
getDefaultPeriodsUrl
)
};
// 修改二维码管理
const
updateQrCodeUrl
=
'api/admin/wechat/qrcode'
;
const
updateQrCodeUrl
=
'
/
api/admin/wechat/qrcode'
;
export
const
updateQrCodeApi
=
function
(
id
,
json
)
{
return
Vue
.
prototype
.
$put
(
`
${
updateQrCodeUrl
}
/
${
id
}
`
,
json
)
};
// 获取二维码列表详情
const
getQrCodeDetailUrl
=
'api/admin/wechat/qrcode'
;
const
getQrCodeDetailUrl
=
'
/
api/admin/wechat/qrcode'
;
export
const
getQrCodeDetailUrlApi
=
function
(
id
)
{
return
Vue
.
prototype
.
$fetch
(
`
${
getQrCodeDetailUrl
}
/
${
id
}
`
)
};
const
getAdsListlUrl
=
'api/public/ads/list'
;
const
getAdsListlUrl
=
'
/
api/public/ads/list'
;
export
const
getAdsListApi
=
function
(
json
)
{
return
Vue
.
prototype
.
$fetch
(
getAdsListlUrl
,
json
)
};
const
getAdsInnerListUrl
=
'api/admin/ads/list'
;
const
getAdsInnerListUrl
=
'
/
api/admin/ads/list'
;
export
const
getAdsInnerListApi
=
function
(
json
)
{
return
Vue
.
prototype
.
$fetch
(
getAdsInnerListUrl
,
json
)
};
// 外部投放修改备注
const
updateAdsInnerUrl
=
'api/admin/ads'
;
const
updateAdsInnerUrl
=
'
/
api/admin/ads'
;
export
const
updateAdsInnerApi
=
function
(
id
,
json
)
{
return
Vue
.
prototype
.
$put
(
`
${
updateAdsInnerUrl
}
/
${
id
}
`
,
json
)
};
// 订单使用红包列表
const
getCouponListUrl
=
'api/admin/order/coupon'
;
const
getCouponListUrl
=
'
/
api/admin/order/coupon'
;
export
const
getCouponListApi
=
function
(
json
)
{
return
Vue
.
prototype
.
$fetch
(
getCouponListUrl
,
json
)
};
// 更新二维码备注
const
updateQrcodeDescUrl
=
'api/admin/wechat/qrcode/desc'
;
const
updateQrcodeDescUrl
=
'
/
api/admin/wechat/qrcode/desc'
;
export
const
updateQrcodeDescApi
=
function
(
id
,
json
)
{
return
Vue
.
prototype
.
$put
(
`
${
updateQrcodeDescUrl
}
/
${
id
}
`
,
json
)
};
...
...
@@ -637,7 +637,7 @@ export const getSyncUserApi = function (json) {
return
Vue
.
prototype
.
$fetch
(
getSyncUserUrl
,
json
)
};
// 获取关注统计详情
const
getStatisticsDetailUrl
=
'api/admin/open/subscribe/statistics/detail'
;
const
getStatisticsDetailUrl
=
'
/
api/admin/open/subscribe/statistics/detail'
;
export
const
getStatisticsDetailApi
=
function
(
json
)
{
return
Vue
.
prototype
.
$fetch
(
getStatisticsDetailUrl
,
json
)
};
...
...
@@ -690,72 +690,89 @@ export const exportExcelApi = function (url, params) {
window
.
open
(
url
)
};
// 来源码列表
const
getSourceListUrl
=
'api/admin/code/rule'
;
const
getSourceListUrl
=
'
/
api/admin/code/rule'
;
export
const
getSourceListApi
=
function
(
json
)
{
return
Vue
.
prototype
.
$fetch
(
getSourceListUrl
,
json
)
};
// 添加来源码
const
addSourceUrl
=
'api/admin/code/rule'
;
const
addSourceUrl
=
'
/
api/admin/code/rule'
;
export
const
addSourceApi
=
function
(
json
)
{
return
Vue
.
prototype
.
$post
(
addSourceUrl
,
json
)
};
// 修改来源码
const
updateSourceUrl
=
'api/admin/code/rule'
;
const
updateSourceUrl
=
'
/
api/admin/code/rule'
;
export
const
updateSourceApi
=
function
(
id
,
json
)
{
return
Vue
.
prototype
.
$put
(
`
${
updateSourceUrl
}
/
${
id
}
`
,
json
)
};
// 删除来源码
const
delSourceUrl
=
`api/admin/code/rule/`
;
const
delSourceUrl
=
`
/
api/admin/code/rule/`
;
export
const
delSourceApi
=
function
(
id
)
{
return
Vue
.
prototype
.
$del
(
`
${
delSourceUrl
}${
id
}
`
)
};
// 修改商品购买数量
const
updateGoodsNumberUrl
=
'api/admin/goods/buy/nums'
;
const
updateGoodsNumberUrl
=
'
/
api/admin/goods/buy/nums'
;
export
const
updateGoodsNumbeApi
=
function
(
id
,
json
)
{
return
Vue
.
prototype
.
$put
(
`
${
updateGoodsNumberUrl
}
/
${
id
}
`
,
json
)
};
// 获取班级用户备注列表
const
getUserDescListUrl
=
'api/admin/class/user/desc/'
;
const
getUserDescListUrl
=
'
/
api/admin/class/user/desc/'
;
export
const
getUserDescListApi
=
function
(
id
,
json
)
{
return
Vue
.
prototype
.
$fetch
(
`
${
getUserDescListUrl
}${
id
}
`
,
json
)
};
// 更改用户看课权限,添加老师,意向等级
const
updateUserPrivilegeUrl
=
'api/admin/class/user'
;
const
updateUserPrivilegeUrl
=
'
/
api/admin/class/user'
;
export
const
updateUserPrivilegeApi
=
function
(
id
,
json
)
{
return
Vue
.
prototype
.
$put
(
`
${
updateUserPrivilegeUrl
}
/
${
id
}
`
,
json
)
};
// 修改订单推广人信息
const
updateOrderTeacherUrl
=
'api/admin/order/invite'
;
const
updateOrderTeacherUrl
=
'
/
api/admin/order/invite'
;
export
const
updateOrderTeacherApi
=
function
(
id
,
teacherId
)
{
return
Vue
.
prototype
.
$put
(
`
${
updateOrderTeacherUrl
}
/
${
id
}
/
${
teacherId
}
`
)
};
// 用户提现 api/admin/bill/pay/to/user
const
payToUserUrl
=
'api/admin/bill/pay/to/user'
;
const
payToUserUrl
=
'
/
api/admin/bill/pay/to/user'
;
export
const
payToUserApi
=
function
(
json
)
{
return
Vue
.
prototype
.
$post
(
payToUserUrl
,
json
)
};
// 获取班主任业绩总排行
const
getTeacherRankListUrl
=
'api/admin/teacher/performance'
;
const
getTeacherRankListUrl
=
'
/
api/admin/teacher/performance'
;
export
const
getTeacherRankListApi
=
function
(
json
)
{
return
Vue
.
prototype
.
$fetch
(
`
${
getTeacherRankListUrl
}
`
,
json
)
};
// 班主任业绩排行按天
const
getTeacherDayRankListUrl
=
'api/admin/teacher/performance/day'
;
const
getTeacherDayRankListUrl
=
'
/
api/admin/teacher/performance/day'
;
export
const
getTeacherDayRankListApi
=
function
(
json
)
{
return
Vue
.
prototype
.
$fetch
(
`
${
getTeacherDayRankListUrl
}
`
,
json
)
};
// 老师绑定用户
const
teacherBindUserUrl
=
'api/admin/teacher/bind'
;
const
teacherBindUserUrl
=
'
/
api/admin/teacher/bind'
;
export
const
teacherBindUserApi
=
function
(
id
,
json
)
{
return
Vue
.
prototype
.
$put
(
`
${
teacherBindUserUrl
}
/
${
id
}
`
,
json
)
};
// 获取老师加用户数,用户老师数
const
getJoinNumUrl
=
'api/admin/class/teacher/group/num/'
;
const
getJoinNumUrl
=
'
/
api/admin/class/teacher/group/num/'
;
export
const
getJoinNumApi
=
function
(
id
)
{
return
Vue
.
prototype
.
$fetch
(
`
${
getJoinNumUrl
}${
id
}
`
)
};
// 未购买列表
// const getNotBuyUrl = '';
// export const getNotBuyApi = function (id) {
// return Vue.prototype.$fetch(`${getNotBuyUrl}${id}`)
// };
const
getNotBuyUrl
=
''
;
export
const
getNotBuyApi
=
function
(
id
)
{
return
Vue
.
prototype
.
$fetch
(
`
${
getNotBuyUrl
}${
id
}
`
)
};
//获取短网址
const
getLinkUrl
=
`/api/public/short/url`
;
export
const
getLinkApi
=
function
(
json
)
{
return
Vue
.
prototype
.
$fetch
(
`
${
getLinkUrl
}
`
,
json
)
};
//获取二维码
const
getqrCodeUrl
=
`
${
_baseUrl
}
api/public/qrcode`
;
export
const
getqrCodeApi
=
function
(
json
)
{
return
Vue
.
prototype
.
$fetch
(
`
${
getqrCodeUrl
}
`
,
json
)
};
//设置系统指定配置
const
putConfigUrl
=
`/api/admin/tools/config`
;
export
const
putConfigApi
=
function
(
json
)
{
console
.
log
(
json
)
return
Vue
.
prototype
.
$put
(
`
${
putConfigUrl
}
`
,
json
)
};
\ No newline at end of file
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