Commit 19f0fdf9 authored by wangwei's avatar wangwei

编写

parent 418cd47c
<template>
<el-dialog :title="userObj.title" :visible.sync="userObj.show">
<el-dialog :title="userObj.title" :visible.sync="userObj.show" :modal="false" :fullscreen="true">
<div>
<el-form label-width="90px" inline>
<el-form-item style="float: right">
<el-button type="success" @click="addShow = true">+添加用户</el-button>
</el-form-item>
</el-form>
<el-table
:data="userTable"
style="width: 100%">
<el-table-column label="头像">
<template slot-scope="scope">
<img :src="scope.row.avatar" style="width: 50px;height: 50px;border-radius: 50px">
</template>
</el-table-column>
<el-table-column
prop="user_id"
label="用户ID">
</el-table-column>
<el-table-column
prop="nickname"
label="用户名">
</el-table-column>
<el-table-column
label="看课权限">
<template slot-scope="scope">
{{ scope.row.is_view_course | isOrNot}}
</template>
</el-table-column>
<el-table-column label="操作">
<template slot-scope="scope">
<el-button type="warning" size="mini" @click="changeUser(scope.row)">更改看课权限</el-button>
<el-button type="danger" size="mini" @click="onDel(scope.row)">删除</el-button>
</template>
</el-table-column>
</el-table>
</div>
<el-dialog :modal="false" :visible.sync="addShow">
<el-form label-width="90px">
<el-form-item label="用户id">
<el-input v-model="addId"></el-input>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="addShow = false">取 消</el-button>
<el-button type="primary" @click="onAdd">确 定</el-button>
</span>
</el-dialog>
</el-dialog>
</template>
<script>
import {addClassUesrApi,getClassUserApi,changeUserApi,delClassUserApi} from "../../service/api";
import {ISORNOT} from "../../util/wordbook";
export default {
name: "userList",
props:[
'userObj'
],
data(){
return {
userTable:[],
addId:'',
addShow:false
}
},
filters:{
isOrNot(value){
return ISORNOT[value]
}
},
methods:{
initPage(){
getClassUserApi(this.userObj.classId).then(res=>{
this.userTable = res.list
})
},
changeUser(data){
this.$confirm('此操作将修改成员看课权限?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
changeUserApi(data.id,{is_view_course:data.is_view_course === 0 ? 1 : 0}).then(res=>{
this.$message({
type: 'success',
message: '修改成功!'
});
});
this.initPage()
});
},
onDel(data){
this.$confirm('此操作将删除该成员?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
delClassUserApi(data.id).then(res=>{
this.$message({
type: 'success',
message: '删除成功!'
});
});
this.initPage()
});
},
onAdd(){
addClassUesrApi(this.userObj.classId,this.addId).then(res=>{
this.$message({
type: 'success',
message: '添加成功!'
});
this.initPage()
})
}
},
watch:{
'userObj'(){
this.initPage()
}
}
}
</script>
......
......@@ -148,7 +148,9 @@
this.selectedBoxList.forEach(i=>{this.form.item_category_ids.push(i.id)});
this.selectedLessonList.forEach(i=>{this.form.text_category_ids.push(i.id)});
this.form.text_category_ids = this.form.text_category_ids.toString();
if(this.imageList[0]){
this.form.cover = this.imageList[0].name;
}
this.form.item_category_ids = this.form.item_category_ids.toString();
switch(this.dialogObj.type){
case 1:
......@@ -184,8 +186,10 @@
},
initDialog(){
getBoxTypeListApi().then(res=>{
if(res){
this.boxList = res;
this.showBoxList = JSON.parse(JSON.stringify(res))
}
});
getCategoryApi().then(res=>{
this.lessonList = res;
......
<template>
<div>
订单列表
</div>
</template>
......
<template>
</template>
<script>
export default {
name: "index"
}
</script>
<style scoped>
</style>
<template>
</template>
<script>
export default {
name: "index"
}
</script>
<style scoped>
</style>
......@@ -2,7 +2,6 @@ import Vue from 'vue'
import store from "@/store"
import Router from 'vue-router'
import Cookie from '../util/cookie'
import index from '@/components/framework'
import main from '@/components/main'
import login from '@/components/login'
......@@ -28,6 +27,8 @@ import autoReply from '@/components/weChat/autoReply'
import weChatResource from '@/components/weChat/weChatResource'
import banner from '@/components/system/banner'
import noLesson from '@/components/noLesson'
import putForward from '@/components/putForward'
import refund from '@/components/refund'
Vue.use(Router);
......@@ -55,6 +56,14 @@ const router =new Router({
path: '/help',
name:'help',
component: help
},{
path: '/putForward',
name:'putForward',
component: putForward
},{
path: '/refund',
name:'refund',
component: refund
},{
path: '/noLesson',
name:'noLesson',
......
......@@ -413,7 +413,55 @@ export const getClassUserApi = function (id) {
return Vue.prototype.$fetch(`${getClassUserUrl}${id}`)
};
// 添加班级用户
const addClassUserUrl = `${_baseUrl}`
const addClassUserUrl = `${_baseUrl}api/admin/class/user/add/`;
export const addClassUesrApi = function (classId, userId) {
return Vue.prototype.$post(`${addClassUserUrl}${classId}/${userId}`)
};
// 更改看课权限
const changeUserUrl = `${_baseUrl}api/admin/class/user/`;
export const changeUserApi = function (id,json) {
return Vue.prototype.$put(`${changeUserUrl}${id}`,json)
};
// 移除班级用户
const delClassUserUrl = `${_baseUrl}api/admin/class/user/`;
export const delClassUserApi = function (id) {
return Vue.prototype.$del(`${delClassUserUrl}${id}`)
};
// 获取订单列表
const getOrderListUrl = `${_baseUrl}api/admin/order/list`;
export const getOrderListApi = function () {
return Vue.prototype.$fetch(getOrderListUrl)
};
// 修改订单备注
const editOrderDescUrl = `${_baseUrl}api/admin/order/desc/`;
export const editOrderDescApi = function (orderId, type) {
return Vue.prototype.$put(`${editOrderDescUrl}${orderId}/${type}`)
};
// 给用户退款
const refundUrl = `${_baseUrl}api/admin/bill/refund/`;
export const refundApi = function (id) {
return Vue.prototype.$post(`${refundUrl}${id}`)
} ;
// 修改订单收货地址
const editAddressUrl = `${_baseUrl}api/admin/order/address/`;
export const editAddressApi = function (id) {
return Vue.prototype.$put(`${editAddressUrl}/${id}`)
};
// 提现审核
const withdrawUrl = `${_baseUrl}/api/admin/order/withdraw/`;
export const withdrawApi = function (json) {
return Vue.prototype.$post(`${withdrawUrl}`,json)
};
// 退款列表
const getRefundListUrl = `${_baseUrl}api/admin/order/refund/list`;
export const getRefundListApi = function (json) {
return Vue.prototype.$fetch(`${getRefundListUrl}`,json)
};
// 提现列表
const getWithdrawListUrl = `${_baseUrl}api/admin/order/withdraw/list`;
export const getWithdrawListApi = function (json) {
return Vue.prototype.$fetch(`${getWithdrawListUrl}`,json)
};
......@@ -77,6 +77,14 @@ export default [
value:'订单列表',
routerName:'order',
path:'/order'
},{
value:'退款列表',
routerName:'refund',
path:'/refund'
},{
value:'提现列表',
routerName:'putForward',
path:'/putForward'
},
{
value:'发货管理',
......
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