营销推广

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

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

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

@ -1,76 +1,52 @@
<template> <template>
<!-- 产品管理 --> <!-- 营销推广管理 -->
<div style="padding-top: 24px"> <div style="padding-top: 24px">
<div class="tool"> <el-table :data="list" class="table" ref="table" stripe header-align="center" row-key="id">
<ul class="filter" style="align-items: flex-start"> <el-table-column type="index" width="100" label="序号" align="center"></el-table-column>
<li> <el-table-column prop="courseName" label="图片" min-width="150" align="center">
<label>学科类</label> <template slot-scope="scope">
<el-select v-model="form.visibleRange" clearable placeholder="请选择可见范围" @change="getData"> <el-upload
<el-option v-for="(item,index) in regions" :key="index" :label="item.name" :value="item.id"></el-option> class="avatar-uploader"
</el-select> accept=".jpg,.png,.jpeg"
</li> :on-success="res => uploadSuccess(res, scope.row)"
<li> :limit="1"
<label>专业</label> :action="api.fileupload"
<el-select v-model="form.categoryId" clearable placeholder="请选择课程分类" @change="getData"> :headers="headers"
<el-option label="不限" value=""></el-option> :show-file-list="false"
<el-option label="暂无分类" value="0"></el-option> name="file"
<el-option v-for="(item,index) in classificationList" :key="index" :label="item.classificationName" :value="item.id"></el-option> >
</el-select> <img v-if="scope.row.pic" :src="scope.row.pic" class="avatar">
</li> <div class="uploader-default" v-else>
<li> <i class="el-icon-plus"></i>
<label>产品分类</label> <p>上传图片</p>
<el-select v-model="form.courseType" clearable placeholder="请选择课程类型" @change="getData"> </div>
<el-option v-for="(item,index) in types" :key="index" :label="item.name" :value="item.id"></el-option> </el-upload>
</el-select> </template>
</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-column> </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 prop="courseName" label="厂商" min-width="150" align="center"></el-table-column> <template slot-scope="scope">
<el-table-column prop="courseName" label="产品类型" min-width="150" align="center"></el-table-column> <el-input v-model="scope.row.title" placeholder="请输入标题" maxlength="100"></el-input>
<el-table-column prop="courseName" label="关联产品" min-width="150" align="center"></el-table-column> </template>
<el-table-column prop="courseName" label="状态" min-width="150" align="center"></el-table-column> </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 prop="courseName" label="最近编辑人" min-width="150" align="center"></el-table-column> <template slot-scope="scope">
<el-table-column prop="courseName" label="精选" min-width="150" align="center"></el-table-column> <el-input v-model="scope.row.title" placeholder="请输入链接" maxlength="100"></el-input>
<el-table-column label="上架/下架" align="center"> </template>
</el-table-column>
<el-table-column label="操作" align="center" width="250">
<template slot-scope="scope"> <template slot-scope="scope">
<el-switch <el-switch
v-model="scope.row.isShelves" v-model="scope.row.isShelves"
:active-value="1" :active-value="1"
:inactive-value="0" :inactive-value="0"
@change="changeSwitch($event, scope.row)" @change="switchOff($event, scope.row)"
v-auth="'/curriculum:上下架'"> v-auth="'/curriculum:上下架'">
</el-switch> </el-switch>
</template> <el-button class="m-l-10" v-auth="'平台自建:编辑信息'" type="text" @click="editCourse(scope.row)">编辑</el-button>
</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 v-auth="'平台自建:删除'" type="text" @click="handleDelete(scope.row)">删除</el-button> <el-button v-auth="'平台自建:删除'" type="text" @click="handleDelete(scope.row)">删除</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </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> </div>
</template> </template>
@ -80,71 +56,16 @@ import Setting from '@/setting'
export default { export default {
data() { data() {
return { return {
timer: null, headers: {
regionName: ['本校内', '全平台可见', '指定院校区域'], token: sessionStorage.getItem("token")
regions: [
{
id: '',
name: '不限'
},
{
id: 1,
name: '全平台'
},
{
id: 2,
name: '指定院校区域'
}
],
types: [
{
id: '',
name: '不限'
},
{
id: 1,
name: '付费'
},
{
id: 0,
name: '免费'
}
],
form: {
visibleRange: '',
categoryId: '',
courseType: ''
}, },
keyword: "", list: [{}],
classificationId: "",
list: [],
multipleSelection: [],
classificationList: [],
page: +this.$route.query.page || 1, //
pageSize: 10,
total: 0
}; };
}, },
watch: {
keyword: function(val) {
clearTimeout(this.searchTimer);
this.searchTimer = setTimeout(() => {
this.initData();
}, 500);
}
},
mounted() { mounted() {
this.getClassification();
this.getData();
this.$once('hook:beforeDestroy', function() {
clearInterval(this.timer)
})
}, },
methods: { methods: {
//:
//
// 使
//1.
getList() { getList() {
this.$post(this.api.listTheoreticalCourse, { this.$post(this.api.listTheoreticalCourse, {
pageNum: this.page, pageNum: this.page,
@ -163,41 +84,24 @@ export default {
}).catch(res => { }).catch(res => {
}); });
}, },
// redis handleExceed() { //
getRedis() { this.$message.warning("当前限制选择 1 个文件,如需更换,请删除上一个文件再重新选择!");
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() { uploadSuccess(res, row) { //
this.page = 1; row.pic = res.data.filesResult.fileUrl;
this.getData();
}, },
getClassification() { uploadError(err, file, fileList) { //
this.$post(this.api.listClassification, { this.$message({
pageNum: 1, message: "上传出错,请重试!",
pageSize: 1000, type: "error",
platformSource: Setting.platformSource center: true
}).then(({ page }) => { });
this.classificationList = page.records
}).catch(res => {})
},
changeType(type) {
this.classificationId = type;
this.initData();
}, },
preview(row) { beforeRemove(file, fileList) { //
this.$router.push(`/previewTheoreticalCourse?id=${row.id}`); return this.$confirm(`确定移除 ${file.name}`);
}, },
config(row) { handleRemove(file, fileList) { //
this.$router.push(`/setTheoreticalCourse?id=${row.id}`); // this.form.coverUrl = ''
}, },
addCourse() { addCourse() {
this.$router.push("/addTheoreticalCourse"); this.$router.push("/addTheoreticalCourse");
@ -219,36 +123,6 @@ export default {
.catch(() => { .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) { switchOff(val, row) {
this.$post(this.api.disabledTheoreticalCourse, { this.$post(this.api.disabledTheoreticalCourse, {
courseId: row.id, courseId: row.id,
@ -263,10 +137,66 @@ export default {
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
/deep/ .tool { .m-l-10 {
.filter { margin-left: 10px;
.el-input { }
min-width: 215px;
$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