Commit 6fa3b93d authored by 王's avatar

二维码管理

parent ae11e34d
...@@ -12,14 +12,14 @@ module.exports = { ...@@ -12,14 +12,14 @@ module.exports = {
//本地代理设置 //本地代理设置
proxyTable: { proxyTable: {
'/api': { '/api': {
target: 'http://local.base-api.sing.com', // 接口的域名 // target: 'http://local.base-api.sing.com', // 接口的域名
// target: 'https://wechat-test.changchangenglish.com/', target: 'https://wechat-test.changchangenglish.com/',
changeOrigin: true, // 如果接口跨域,需要进行这个参数配置 changeOrigin: true, // 如果接口跨域,需要进行这个参数配置
} }
}, },
// Various Dev Server settings // Various Dev Server settings
host: '10.1.21.181', // can be overwritten by process.env.HOST host: 'localhost', // can be overwritten by process.env.HOST
port: 8080, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined port: 8080, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined
autoOpenBrowser: false, autoOpenBrowser: false,
errorOverlay: true, errorOverlay: true,
......
This diff is collapsed.
This diff is collapsed.
...@@ -80,15 +80,35 @@ ...@@ -80,15 +80,35 @@
</a> </a>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column
fixed="right"
label="操作"
width="150">
<template slot-scope="scope">
<el-button
@click.native.prevent="editRow(scope.$index, list)"
type="text"
size="small"
v-if="!$store.state.readonly">
编辑
</el-button>
<el-button
@click.native.prevent="detail(scope.$index, list)"
type="text"
size="small">
查看详情
</el-button>
</template>
</el-table-column>
</el-table> </el-table>
<page :nowPage="nowPage" :total="total" :limit="limit" @pageChange="onPageChange"/> <page :nowPage="nowPage" :total="total" :limit="limit" @pageChange="onPageChange"/>
<dialog-div :newObj="newObj" @initPage="initPage"></dialog-div> <dialog-div v-if="newObj.show" :newObj="newObj" @initPage="initPage" @changeShow="changeShow"></dialog-div>
</div> </div>
</template> </template>
<script> <script>
import dialogDiv from './dialog' import dialogDiv from './dialog'
import {getQrCodeListApi} from "../../service/api"; import {getQrCodeListApi,getQrCodeDetailUrlApi} from "../../service/api";
import {QRCODETYPE,QRSTATUS,QRTYPE} from "../../util/wordbook"; import {QRCODETYPE,QRSTATUS,QRTYPE} from "../../util/wordbook";
import page from '../framework/page' import page from '../framework/page'
export default { export default {
...@@ -171,17 +191,85 @@ ...@@ -171,17 +191,85 @@
}, },
initPage(){ initPage(){
let json = { let json = {
title:this.searchFrom.title,
type:this.searchFrom.type,
code_type:this.searchFrom.code_type,
status:this.searchFrom.status,
limit: this.limit, limit: this.limit,
page: this.nowPage page: this.nowPage
}; };
if(this.searchFrom.title){
json.title = this.searchFrom.title
}
if(this.searchFrom.type){
json.type = this.searchFrom.type
}
if(this.searchFrom.code_type){
json.code_type = this.searchFrom.code_type
}
if(this.searchFrom.status){
json.status = this.searchFrom.status
}
getQrCodeListApi(json).then(res=>{ getQrCodeListApi(json).then(res=>{
this.list = res.list; this.list = res ? res.list : [];
this.total = res.total this.total = res ? res.total : 0;
})
},
newQrcode(){
this.newObj = {
show: true,
title:null,
type:2,
invite_code:null,
status:0,
end_at:null
}
},
editRow(index, list){
let _obj = list[index]
getQrCodeDetailUrlApi(_obj.id).then(res=> {
this.newObj = {
title: res.title,
type: res.type,
invite_code: res.invite_code ? res.invite_code.split('-')[2] : '',
status: res.status,
end_at: res.end_at,
id: _obj.id
}
if(res.auto_reply){
this.newObj.list = JSON.parse(res.auto_reply)
}
this.newObj.editFlag = true;
this.newObj.show = true;
});
},
detail(index, list){
let _obj = list[index]
getQrCodeDetailUrlApi(_obj.id).then(res=> {
this.newObj = {
title: res.title,
type: res.type,
invite_code: res.invite_code ? res.invite_code.split('-')[2] : '',
status: res.status,
end_at: res.end_at,
id: _obj.id
}
if(res.auto_reply){
this.newObj.list = JSON.parse(res.auto_reply)
}
this.newObj.readFlag = true;
this.newObj.show = true;
});
},
changeShow(val){
this.newObj = {
show: false,
title:null,
type:2,
invite_code:null,
status:0,
end_at:null
}
},
getQrCodeDetail(id){
getQrCodeDetailUrlApi(id).then(res=> {
}) })
} }
} }
......
...@@ -574,3 +574,13 @@ const getDefaultPeriodsUrl = '/api/admin/periods/default'; ...@@ -574,3 +574,13 @@ const getDefaultPeriodsUrl = '/api/admin/periods/default';
export const getDefaultPeriodsApi = function () { export const getDefaultPeriodsApi = function () {
return Vue.prototype.$fetch(getDefaultPeriodsUrl) return Vue.prototype.$fetch(getDefaultPeriodsUrl)
}; };
// 修改二维码管理
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';
export const getQrCodeDetailUrlApi = function (id) {
return Vue.prototype.$fetch(`${getQrCodeDetailUrl}/${id}`)
};
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