营销推广

dev_202304
yujialong 2 years ago
parent 361c837391
commit 261356b04d
  1. 4
      src/setting.js
  2. 1
      src/views/order/AddOrder.vue
  3. 8
      src/views/shop/addProduct/index.vue
  4. 296
      src/views/shop/list/market/index.vue

@ -12,7 +12,7 @@ if (isDev) {
host = 'http://121.37.12.51/'
// host = 'https://huorantech.cn/'
// host = 'http://192.168.31.151:9000/'// 榕
// host = 'http://192.168.31.117:9000/'// 赓
host = 'http://192.168.31.116:9000/'// 赓
} else if (isPro) {
jumpPath = 'https://www.huorantech.cn/judgmentPoint/'
}
@ -45,7 +45,7 @@ const Setting = {
isDev,
isPro,
// 是否使用动态路由
dynamicRoute: true,
dynamicRoute: false,
/**
* @description 默认密码
*/

@ -1213,6 +1213,7 @@ export default {
},
data() {
return {
// authority: 01234
deliverShow: ['pageTypes', 'dataPageTypes', 'modelPageTypes', 'practiceCourseTypes', 'expToolTypes'],
pageTypes: false,
dataPageTypes: false,

@ -130,7 +130,7 @@
:before-remove="beforeRemove"
:limit="1"
:on-exceed="handleExceed"
:action="this.api.fileupload"
:action="api.fileupload"
:headers="headers"
name="file"
>
@ -156,7 +156,7 @@
:before-remove="beforeRemove"
:limit="1"
:on-exceed="handleExceed"
:action="this.api.fileupload"
:action="api.fileupload"
:headers="headers"
name="file"
>
@ -181,7 +181,7 @@
:before-remove="beforeRemove"
:limit="1"
:on-exceed="handleExceed"
:action="this.api.fileupload"
:action="api.fileupload"
:headers="headers"
name="file"
>
@ -227,7 +227,7 @@
:before-upload="fileBeforeUpload"
:on-remove="handleRemove"
:on-success="uploadSuccessFile"
:action="this.api.fileUploadNakadai"
:action="api.fileUploadNakadai"
:file-list="form.fileList"
:headers="headers"
>

@ -1,76 +1,52 @@
<template>
<!-- 产品管理 -->
<!-- 营销推广管理 -->
<div style="padding-top: 24px">
<div class="tool">
<ul class="filter" style="align-items: flex-start">
<li>
<label>学科类</label>
<el-select v-model="form.visibleRange" clearable placeholder="请选择可见范围" @change="getData">
<el-option v-for="(item,index) in regions" :key="index" :label="item.name" :value="item.id"></el-option>
</el-select>
</li>
<li>
<label>专业</label>
<el-select v-model="form.categoryId" clearable placeholder="请选择课程分类" @change="getData">
<el-option label="不限" value=""></el-option>
<el-option label="暂无分类" value="0"></el-option>
<el-option v-for="(item,index) in classificationList" :key="index" :label="item.classificationName" :value="item.id"></el-option>
</el-select>
</li>
<li>
<label>产品分类</label>
<el-select v-model="form.courseType" clearable placeholder="请选择课程类型" @change="getData">
<el-option v-for="(item,index) in types" :key="index" :label="item.name" :value="item.id"></el-option>
</el-select>
</li>
<li>
<label>搜索</label>
<el-input placeholder="请输入" suffix-icon="el-icon-search" v-model="keyword" clearable size="small"></el-input>
</li>
</ul>
<div>
<el-button v-auth="'平台自建:新增'" type="primary" round @click="addCourse">新增</el-button>
<el-button v-auth="'平台自建:批量删除'" type="primary" round @click="delAllData">批量删除</el-button>
</div>
</div>
<el-table :data="list" class="table" ref="table" stripe header-align="center" @selection-change="handleSelectionChange" row-key="id">
<el-table-column type="selection" width="80" align="center" :reserve-selection="true"></el-table-column>
<el-table-column type="index" width="100" label="序号" align="center">
<template slot-scope="scope">
{{ scope.$index + (page - 1) * pageSize + 1 }}
</template>
<el-table :data="list" class="table" ref="table" stripe header-align="center" row-key="id">
<el-table-column type="index" width="100" label="序号" align="center"></el-table-column>
<el-table-column prop="courseName" label="图片" min-width="150" align="center">
<template slot-scope="scope">
<el-upload
class="avatar-uploader"
accept=".jpg,.png,.jpeg"
:on-success="res => uploadSuccess(res, scope.row)"
:limit="1"
:action="api.fileupload"
:headers="headers"
:show-file-list="false"
name="file"
>
<img v-if="scope.row.pic" :src="scope.row.pic" class="avatar">
<div class="uploader-default" v-else>
<i class="el-icon-plus"></i>
<p>上传图片</p>
</div>
</el-upload>
</template>
</el-table-column>
<el-table-column prop="courseName" label="产品名称" min-width="150" align="center"></el-table-column>
<el-table-column prop="courseName" label="厂商" min-width="150" align="center"></el-table-column>
<el-table-column prop="courseName" label="产品类型" min-width="150" align="center"></el-table-column>
<el-table-column prop="courseName" label="关联产品" min-width="150" align="center"></el-table-column>
<el-table-column prop="courseName" label="状态" min-width="150" align="center"></el-table-column>
<el-table-column prop="courseName" label="订单量" min-width="150" align="center"></el-table-column>
<el-table-column prop="courseName" label="最近编辑人" min-width="150" align="center"></el-table-column>
<el-table-column prop="courseName" label="精选" min-width="150" align="center"></el-table-column>
<el-table-column label="上架/下架" align="center">
<el-table-column prop="courseName" label="标题" min-width="150" align="center">
<template slot-scope="scope">
<el-input v-model="scope.row.title" placeholder="请输入标题" maxlength="100"></el-input>
</template>
</el-table-column>
<el-table-column prop="courseName" label="链接" min-width="150" align="center">
<template slot-scope="scope">
<el-input v-model="scope.row.title" placeholder="请输入链接" maxlength="100"></el-input>
</template>
</el-table-column>
<el-table-column label="操作" align="center" width="250">
<template slot-scope="scope">
<el-switch
v-model="scope.row.isShelves"
:active-value="1"
:inactive-value="0"
@change="changeSwitch($event, scope.row)"
@change="switchOff($event, scope.row)"
v-auth="'/curriculum:上下架'">
</el-switch>
</template>
</el-table-column>
<el-table-column label="操作" align="center" width="250">
<template slot-scope="scope">
<el-button v-auth="'平台自建:编辑信息'" type="text" @click="editCourse(scope.row)">编辑</el-button>
<el-button class="m-l-10" v-auth="'平台自建:编辑信息'" type="text" @click="editCourse(scope.row)">编辑</el-button>
<el-button v-auth="'平台自建:删除'" type="text" @click="handleDelete(scope.row)">删除</el-button>
</template>
</el-table-column>
</el-table>
<div class="pagination">
<el-pagination background layout="total, prev, pager, next" :total="total" @current-change="handleCurrentChange" :current-page="page">
</el-pagination>
</div>
</div>
</template>
@ -80,71 +56,16 @@ import Setting from '@/setting'
export default {
data() {
return {
timer: null,
regionName: ['本校内', '全平台可见', '指定院校区域'],
regions: [
{
id: '',
name: '不限'
},
{
id: 1,
name: '全平台'
},
{
id: 2,
name: '指定院校区域'
}
],
types: [
{
id: '',
name: '不限'
},
{
id: 1,
name: '付费'
},
{
id: 0,
name: '免费'
}
],
form: {
visibleRange: '',
categoryId: '',
courseType: ''
headers: {
token: sessionStorage.getItem("token")
},
keyword: "",
classificationId: "",
list: [],
multipleSelection: [],
classificationList: [],
page: +this.$route.query.page || 1, //
pageSize: 10,
total: 0
list: [{}],
};
},
watch: {
keyword: function(val) {
clearTimeout(this.searchTimer);
this.searchTimer = setTimeout(() => {
this.initData();
}, 500);
}
},
mounted() {
this.getClassification();
this.getData();
this.$once('hook:beforeDestroy', function() {
clearInterval(this.timer)
})
},
methods: {
//:
//
// 使
//1.
getList() {
this.$post(this.api.listTheoreticalCourse, {
pageNum: this.page,
@ -163,41 +84,24 @@ export default {
}).catch(res => {
});
},
// redis
getRedis() {
this.$post(this.api.getRedisCache).then(({ data }) => {
data && this.getList()
}).catch(res => {})
},
getData() {
this.getList()
if (!Setting.isDev) {
clearInterval(this.timer)
this.timer = setInterval(this.getRedis, 1000)
}
},
initData() {
this.page = 1;
this.getData();
handleExceed() { //
this.$message.warning("当前限制选择 1 个文件,如需更换,请删除上一个文件再重新选择!");
},
getClassification() {
this.$post(this.api.listClassification, {
pageNum: 1,
pageSize: 1000,
platformSource: Setting.platformSource
}).then(({ page }) => {
this.classificationList = page.records
}).catch(res => {})
uploadSuccess(res, row) { //
row.pic = res.data.filesResult.fileUrl;
},
changeType(type) {
this.classificationId = type;
this.initData();
uploadError(err, file, fileList) { //
this.$message({
message: "上传出错,请重试!",
type: "error",
center: true
});
},
preview(row) {
this.$router.push(`/previewTheoreticalCourse?id=${row.id}`);
beforeRemove(file, fileList) { //
return this.$confirm(`确定移除 ${file.name}`);
},
config(row) {
this.$router.push(`/setTheoreticalCourse?id=${row.id}`);
handleRemove(file, fileList) { //
// this.form.coverUrl = ''
},
addCourse() {
this.$router.push("/addTheoreticalCourse");
@ -219,36 +123,6 @@ export default {
.catch(() => {
});
},
handleSelectionChange(val) {
this.multipleSelection = val;
},
delAllData() {
const list = this.multipleSelection
if (list.length != "") {
this.$confirm(`确定要删除吗?`, "提示", {
type: "warning"
})
.then(() => {
const data = []
list.map(e => {
data.push('ids=' + e.id)
})
this.$post(`${this.api.delTheoreticalCourse}?${data.join('&')}`).then(res => {
this.$refs.table.clearSelection();
util.successMsg("删除成功");
this.initData();
}).catch(res => {
});
}).catch(() => {
});
} else {
util.errorMsg("请先选择数据 !");
}
},
handleCurrentChange(val) {
this.page = val;
this.getData();
},
switchOff(val, row) {
this.$post(this.api.disabledTheoreticalCourse, {
courseId: row.id,
@ -263,10 +137,66 @@ export default {
</script>
<style lang="scss" scoped>
/deep/ .tool {
.filter {
.el-input {
min-width: 215px;
.m-l-10 {
margin-left: 10px;
}
$avatar-width: 104px;
/deep/ .avatar-uploader {
.el-upload {
position: relative;
width: $avatar-width;
height: $avatar-width;
border: 1px dashed #d9d9d9;
border-radius: 2px;
cursor: pointer;
overflow: hidden;
&:hover {
border-color: #409EFF;
}
.uploader-default {
display: flex;
flex-direction: column;
justify-content: center;
width: $avatar-width !important;
height: $avatar-width;
text-align: center;
background: rgba(0, 0, 0, 0.04);
i {
font-size: 20px;
font-weight: bold;
color: #8c939d;
}
p {
margin-top: 10px;
font-size: 14px;
color: rgba(0, 0, 0, 0.65);
line-height: 1;
}
}
.avatar {
width: $avatar-width;
height: $avatar-width;
display: block;
}
}
.el-upload__tip {
margin-top: 0;
p {
font-size: 14px;
color: rgba(0, 0, 0, 0.45);
line-height: 1;
&:first-child {
margin-bottom: 5px;
}
}
}
}

Loading…
Cancel
Save