Commit 8281daff authored by chenfenglei's avatar chenfenglei

工具设置,生成短链接,生成二维码

parent f748a398
...@@ -3,9 +3,58 @@ ...@@ -3,9 +3,58 @@
:visible.sync="entranceObj.show" center :visible.sync="entranceObj.show" center
width="80%"> 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> </el-dialog>
</template> </template>
<script> <script>
import {getGoodsListApi,getPeriodsApi,putConfigApi} from "../../../service/api";
export default { export default {
name:"entrance", name:"entrance",
props:[ props:[
...@@ -13,14 +62,88 @@ export default { ...@@ -13,14 +62,88 @@ export default {
], ],
data(){ data(){
return{ return{
goodsList:[],
periodList:[],
activeName: 'first',
searchFrom:{
key:'goods_receive_course ',
desc: '',
value: '',
},
searchFrom2:{
key:'periods_receive_course',
desc: '',
value: '',
},
} }
},
mounted(){
}, },
methods:{ 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> </script>
<style scoped lang="less"> <style scoped lang="less">
</style> </style>
...@@ -2,15 +2,15 @@ ...@@ -2,15 +2,15 @@
<el-dialog :title="linkObj.title" <el-dialog :title="linkObj.title"
:visible.sync="linkObj.show" center :visible.sync="linkObj.show" center
width="800px"> 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 <el-form-item
label="输入链接" label="输入链接"
prop="age" prop="link"
:rules="[ :rules="[
{ required: true, message: '内容不能为空'} { 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-form-item> <el-form-item>
<el-button type="primary" @click="submitForm('form')">获取</el-button> <el-button type="primary" @click="submitForm('form')">获取</el-button>
...@@ -18,13 +18,15 @@ ...@@ -18,13 +18,15 @@
</el-form> </el-form>
<div class="link_content" v-if="content.show"> <div class="link_content" v-if="content.show">
<div class="content"> <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> </div>
<el-button type="primary" >复制链接</el-button> <el-button type="primary" @click="copyUrl(content.text)">复制链接</el-button>
</div> </div>
</el-dialog> </el-dialog>
</template> </template>
<script> <script>
import {getLinkApi} from "../../../service/api";
export default { export default {
name: "getLink", name: "getLink",
props: ["linkObj"], props: ["linkObj"],
...@@ -34,7 +36,7 @@ export default { ...@@ -34,7 +36,7 @@ export default {
link: "" link: ""
}, },
content:{ content:{
show:true, show:false,
text:"" text:""
} }
}; };
...@@ -43,12 +45,38 @@ export default { ...@@ -43,12 +45,38 @@ export default {
submitForm(formName) { submitForm(formName) {
this.$refs[formName].validate(valid => { this.$refs[formName].validate(valid => {
if (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 { } else {
console.log("error submit!!"); console.log("error submit!!");
return false; 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;
}
} }
} }
}; };
......
...@@ -5,12 +5,12 @@ ...@@ -5,12 +5,12 @@
<el-form :model="form" ref="form" label-width="100px" class="demo-ruleForm"> <el-form :model="form" ref="form" label-width="100px" class="demo-ruleForm">
<el-form-item <el-form-item
label="输入链接" label="输入链接"
prop="age" prop="link"
:rules="[ :rules="[
{ required: true, message: '内容不能为空'} { 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-form-item> <el-form-item>
<el-button type="primary" @click="submitForm('form')">获取</el-button> <el-button type="primary" @click="submitForm('form')">获取</el-button>
...@@ -18,13 +18,16 @@ ...@@ -18,13 +18,16 @@
</el-form> </el-form>
<div class="link_content" v-if="content.show"> <div class="link_content" v-if="content.show">
<div class="content"> <div class="content">
<img :src="content.url" id="cavasimg">
</div> </div>
<el-button type="primary" >下载二维码</el-button> <a :href="content.url" download="a.png">
<!-- <el-button type="primary" >下载二维码</el-button> -->
</a>
</div> </div>
</el-dialog> </el-dialog>
</template> </template>
<script> <script>
import {getqrCodeApi} from "../../../service/api";
export default { export default {
name: "getqrCode", name: "getqrCode",
props: ["qrcodeObj"], props: ["qrcodeObj"],
...@@ -34,7 +37,8 @@ export default { ...@@ -34,7 +37,8 @@ export default {
link: "" link: ""
}, },
content:{ content:{
show:true show:false,
url:''
} }
}; };
}, },
...@@ -42,12 +46,23 @@ export default { ...@@ -42,12 +46,23 @@ export default {
submitForm(formName) { submitForm(formName) {
this.$refs[formName].validate(valid => { this.$refs[formName].validate(valid => {
if (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 { } else {
console.log("error submit!!"); console.log("error submit!!");
return false; return false;
} }
}); });
},
},
watch:{
'qrcodeObj.show':function(a){
if(!a){
this.form.link="";
this.content.show=false;
}
} }
} }
}; };
...@@ -56,7 +71,10 @@ export default { ...@@ -56,7 +71,10 @@ export default {
.content{ .content{
width: 300px; width: 300px;
height: 300px; height: 300px;
background: red;
margin: 0 auto; margin: 0 auto;
img{
width: 300px;
height: 300px;
}
} }
</style> </style>
\ No newline at end of file
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
</template> </template>
<script> <script>
import {getNotBuyApi} from "../../service/api"
export default { export default {
name: "notBuyClass", name: "notBuyClass",
...@@ -18,7 +19,12 @@ ...@@ -18,7 +19,12 @@
}, },
methods:{ methods:{
getList(){
let json="";
getNotBuyApi(json).then((res)=>{
console.log(res);
})
},
} }
} }
......
...@@ -586,38 +586,38 @@ export const getDefaultPeriodsApi = function () { ...@@ -586,38 +586,38 @@ export const getDefaultPeriodsApi = function () {
return Vue.prototype.$fetch(getDefaultPeriodsUrl) return Vue.prototype.$fetch(getDefaultPeriodsUrl)
}; };
// 修改二维码管理 // 修改二维码管理
const updateQrCodeUrl = 'api/admin/wechat/qrcode'; const updateQrCodeUrl = '/api/admin/wechat/qrcode';
export const updateQrCodeApi = function (id, json) { export const updateQrCodeApi = function (id, json) {
return Vue.prototype.$put(`${updateQrCodeUrl}/${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) { export const getQrCodeDetailUrlApi = function (id) {
return Vue.prototype.$fetch(`${getQrCodeDetailUrl}/${id}`) return Vue.prototype.$fetch(`${getQrCodeDetailUrl}/${id}`)
}; };
const getAdsListlUrl = 'api/public/ads/list'; const getAdsListlUrl = '/api/public/ads/list';
export const getAdsListApi = function (json) { export const getAdsListApi = function (json) {
return Vue.prototype.$fetch(getAdsListlUrl, json) return Vue.prototype.$fetch(getAdsListlUrl, json)
}; };
const getAdsInnerListUrl = 'api/admin/ads/list'; const getAdsInnerListUrl = '/api/admin/ads/list';
export const getAdsInnerListApi = function (json) { export const getAdsInnerListApi = function (json) {
return Vue.prototype.$fetch(getAdsInnerListUrl, json) return Vue.prototype.$fetch(getAdsInnerListUrl, json)
}; };
// 外部投放修改备注 // 外部投放修改备注
const updateAdsInnerUrl = 'api/admin/ads'; const updateAdsInnerUrl = '/api/admin/ads';
export const updateAdsInnerApi = function (id, json) { export const updateAdsInnerApi = function (id, json) {
return Vue.prototype.$put(`${updateAdsInnerUrl}/${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) { export const getCouponListApi = function (json) {
return Vue.prototype.$fetch(getCouponListUrl, 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) { export const updateQrcodeDescApi = function (id, json) {
return Vue.prototype.$put(`${updateQrcodeDescUrl}/${id}`,json) return Vue.prototype.$put(`${updateQrcodeDescUrl}/${id}`,json)
}; };
...@@ -637,7 +637,7 @@ export const getSyncUserApi = function (json) { ...@@ -637,7 +637,7 @@ export const getSyncUserApi = function (json) {
return Vue.prototype.$fetch(getSyncUserUrl,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) { export const getStatisticsDetailApi = function (json) {
return Vue.prototype.$fetch(getStatisticsDetailUrl,json) return Vue.prototype.$fetch(getStatisticsDetailUrl,json)
}; };
...@@ -690,72 +690,89 @@ export const exportExcelApi = function (url, params) { ...@@ -690,72 +690,89 @@ export const exportExcelApi = function (url, params) {
window.open(url) window.open(url)
}; };
// 来源码列表 // 来源码列表
const getSourceListUrl = 'api/admin/code/rule'; const getSourceListUrl = '/api/admin/code/rule';
export const getSourceListApi = function (json) { export const getSourceListApi = function (json) {
return Vue.prototype.$fetch(getSourceListUrl,json) return Vue.prototype.$fetch(getSourceListUrl,json)
}; };
// 添加来源码 // 添加来源码
const addSourceUrl = 'api/admin/code/rule'; const addSourceUrl = '/api/admin/code/rule';
export const addSourceApi = function (json) { export const addSourceApi = function (json) {
return Vue.prototype.$post(addSourceUrl,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) { export const updateSourceApi = function (id,json) {
return Vue.prototype.$put(`${updateSourceUrl}/${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) { export const delSourceApi = function (id) {
return Vue.prototype.$del(`${delSourceUrl}${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) { export const updateGoodsNumbeApi = function (id,json) {
return Vue.prototype.$put(`${updateGoodsNumberUrl}/${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) { export const getUserDescListApi = function (id,json) {
return Vue.prototype.$fetch(`${getUserDescListUrl}${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) { export const updateUserPrivilegeApi = function (id,json) {
return Vue.prototype.$put(`${updateUserPrivilegeUrl}/${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) { export const updateOrderTeacherApi = function (id,teacherId) {
return Vue.prototype.$put(`${updateOrderTeacherUrl}/${id}/${teacherId}`) return Vue.prototype.$put(`${updateOrderTeacherUrl}/${id}/${teacherId}`)
}; };
// 用户提现 api/admin/bill/pay/to/user // 用户提现 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) { export const payToUserApi = function (json) {
return Vue.prototype.$post(payToUserUrl,json) return Vue.prototype.$post(payToUserUrl,json)
}; };
// 获取班主任业绩总排行 // 获取班主任业绩总排行
const getTeacherRankListUrl = 'api/admin/teacher/performance'; const getTeacherRankListUrl = '/api/admin/teacher/performance';
export const getTeacherRankListApi = function (json) { export const getTeacherRankListApi = function (json) {
return Vue.prototype.$fetch(`${getTeacherRankListUrl}`,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) { export const getTeacherDayRankListApi = function (json) {
return Vue.prototype.$fetch(`${getTeacherDayRankListUrl}`,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) { export const teacherBindUserApi = function (id,json) {
return Vue.prototype.$put(`${teacherBindUserUrl}/${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) { export const getJoinNumApi = function (id) {
return Vue.prototype.$fetch(`${getJoinNumUrl}${id}`) return Vue.prototype.$fetch(`${getJoinNumUrl}${id}`)
}; };
// 未购买列表 // 未购买列表
// const getNotBuyUrl = ''; const getNotBuyUrl = '';
// export const getNotBuyApi = function (id) { export const getNotBuyApi = function (id) {
// return Vue.prototype.$fetch(`${getNotBuyUrl}${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
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment