| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519 |
- <style>
- .table-body {
- padding: 20px;
- background-color: #fff;
- }
- .input-item {
- display: inline-block;
- width: 250px;
- margin: 0 0 20px;
- }
- .input-item .el-input__inner {
- border-right: 0;
- }
- .input-item .el-input__inner:hover {
- border: 1px solid #dcdfe6;
- border-right: 0;
- outline: 0;
- }
- .input-item .el-input__inner:focus {
- border: 1px solid #dcdfe6;
- border-right: 0;
- outline: 0;
- }
- .input-item .el-input-group__append {
- background-color: #fff;
- border-left: 0;
- width: 10%;
- padding: 0;
- }
- .input-item .el-input-group__append .el-button {
- padding: 0;
- }
- .input-item .el-input-group__append .el-button {
- margin: 0;
- }
- .table-body .el-button {
- padding: 0 !important;
- border: 0;
- margin: 0 5px;
- }
- .el-table th > .cell {
- color: #333;
- font-weight: bold;
- font-size: 14px;
- }
- .el-table__footer-wrapper, .el-table__header-wrapper {
- border-bottom: 1.4px solid #D6D6D6;
- }
- .label {
- margin-right: 10px;
- }
- .line-clamp {
- text-overflow: -o-ellipsis-lastline;
- overflow: hidden;
- text-overflow: ellipsis;
- display: -webkit-box;
- -webkit-line-clamp: 2;
- line-clamp: 2;
- -webkit-box-orient: vertical;
- }
- /*头像样式 start*/
- .default-avatar{
- width: 50px;
- height: 50px;
- border-radius: 50%;
- }
- .user_img{
- position: relative;
- margin-right: 8px;
- height: 50px;
- width: 50px;
- }
- .el-table_1_column_2 .cell { /*-2 表示在第二行*/
- display: flex;
- }
- /*头像样式 end*/
- </style>
- <div id="app" v-cloak>
- <el-card shadow="never" body-style="background-color: #f3f3f3;padding: 10px 0 0;">
- <div slot="header">
- <div>
- <span>素材审核</span>
- </div>
- </template>
- </div>
- <el-card shadow="never" style="border:0;min-width: 800px;">
- <template>
- <el-tabs v-model="check_status" type="card" @tab-click="change_tab">
- <el-tab-pane label="待审核" name="yes">
- </el-tab-pane>
- <el-tab-pane label="审核不通过" name="no">
- </el-tab-pane>
- </el-tabs>
- </template>
- </el-card>
- <div class="table-body el-input--small">
- <el-form size="small" :inline="true" flex="dir:left cross:center" style="margin-bottom: 12px;">
- <div class="item-box" flex="dir:left cross:center" style="margin-right: 20px">
- <div class="label">会员昵称</div>
- <el-input style="width: 200px" v-model="search.user_name" placeholder="会员昵称"></el-input>
- </div>
- <div class="item-box" flex="dir:left cross:center" style="margin-right: 20px">
- <div class="label">会员手机号码</div>
- <el-input style="width: 200px" v-model="search.mobile" placeholder="会员手机号码"></el-input>
- </div>
- <div class="item-box" flex="dir:left cross:center" style="margin-right: 20px">
- <div class="label">标题</div>
- <el-input style="width: 150px" v-model="search.title" placeholder="标题"></el-input>
- </div>
- <div class="item-box" flex="dir:left cross:center">
- <div class="label">创建时间</div>
- <el-date-picker
- v-model="time"
- type="datetimerange"
- value-format="yyyy-MM-dd HH:mm:ss"
- range-separator="至"
- start-placeholder="开始日期"
- end-placeholder="结束日期">
- </el-date-picker>
- </div>
- <div class="item-box" flex="dir:left cross:center">
- <el-button type="primary" style="padding: 12px 34px !important;" @click="searchs">搜索
- </el-button>
- </div>
- </el-form>
- <el-table v-loading="listLoading" :data="list" stripe style="width: 100%">
- <el-table-column prop="user.id" label="会员ID" align="center"></el-table-column>
- <el-table-column label="会员" width="200">
- <template slot-scope="scope">
- <div class="user_img">
- <el-image class="default-avatar" :src="scope.row.user.avatar_url">
- <div slot="error" class="image-slot">
- <com-image src="/resources/img/common/default-avatar.png"></com-image>
- </div>
- </el-image>
- </div>
- <div>
- <div style="color:#000;">{{scope.row.user.nickname}}</div>
- <div style="font-size: 12px;">{{scope.row.user.mobile}}</div>
- </div>
- </template>
- </el-table-column>
- <el-table-column label="标题" min-width="150" align="center">
- <template slot-scope="scope">
- <com-ellipsis :line="1">{{scope.row.title}}</com-ellipsis>
- </template>
- </el-table-column>
- <el-table-column label="分类" min-width="80" align="center">
- <template slot-scope="scope">
- <p>{{scope.row.cate.name}}</p>
- </template>
- </el-table-column>
- <el-table-column label="关联商品" min-width="200" align="center">
- <template slot-scope="scope">
- <div v-if="scope.row.goods != ''&& scope.row.goods != null">
- <div style="float: left; width:60px">
- <img width='60px' height='60px'
- style="float: left;"
- v-if="scope.row.goods.cover_pic"
- :src="scope.row.goods.cover_pic"
- />
- </div>
- <div style="float: left; width: 50%;margin-left: 10px; text-align: left;">
- <samp class="line-clamp" :title="scope.row.goods.goods_name">{{scope.row.goods.goods_name}}</samp>
- <samp>¥{{scope.row.goods.price}}</samp>
- </div>
- </div>
- <samp v-if="scope.row.goods == ''">--</samp>
- </template>
- </el-table-column>
- <el-table-column prop="scope" width="160" label="创建时间">
- <template slot-scope="scope">
- {{scope.row.created_at|dateTimeFormat('Y-m-d H:i:s')}}
- </template>
- </el-table-column>
- <el-table-column
- label="操作"
- min-width="180"
- align="center">
- <template slot-scope="scope">
- <el-button circle size="mini" type="text" @click="addgsForm(scope.row, scope.$index)">审核
- </el-button>
- </template>
- </el-table-column>
- </el-table>
- <div style="text-align: right;margin: 20px 0;">
- <el-pagination v-if="pagination" :page-size="pagination.pageSize"
- style="display: inline-block;float: right;" background @current-change="pageChange"
- layout="prev, pager, next" :total="pagination.total_count">
- </el-pagination>
- </div>
- </div>
- <!-- 弹框添加中心开始-->
- <el-dialog :title="title" width="30%" :visible.sync="dialogAddgsVisible"
- @close="closeDialogAddgsVisible" :modal-append-to-body="false">
- <el-form :model="addForm" ref="addForm" :rules="addRule" label-width="100px">
- <el-form-item label="标题" prop="title">
- {{addForm.title}}
- </el-form-item>
- <el-form-item label="正文" prop="title">
- {{addForm.main_text}}
- </el-form-item>
- <el-form-item label="素材图片" v-if="addForm.type == 1" prop="img_url">
- <div flex="dif:left">
- <ul v-if="addForm.img_url.length > 0 " style="width: 100%; float: left;padding: 0px;">
- <li v-for="(item,index) in addForm.img_url" :key="index"
- style="width: 30%; float: left;list-style-type: none;">
- <el-button class="button-item" v-on:click="appShare(item)">
- <com-image mode="aspectFill" width="100px" height='100px'
- :src="item"></com-image>
- </el-button>
- </li>
- </ul>
- </div>
- </el-form-item>
- <el-form-item label="素材视频" v-else prop="video_url">
- <a :href="addForm.video_url" title="查看视频" target="view_window">
- <i class="el-icon-video-play" style="position: absolute;left: 27%;font-size: 45px; top:30%;"></i>
- <com-image mode="aspectFill" width='80%' height='80%'
- style="float: left;"
- v-if="addForm.thumb_url"
- :src="addForm.thumb_url"
- ></com-image>
- </a>
- </el-form-item>
- <el-form-item label="关联商品" prop="goods" style="height: 100px" v-if="addForm.goods != ''">
- <div >
- <div style="float: left; width: 80px">
- <img width='60px' height='60px'
- style="float: left;"
- v-if="addForm.goods.cover_pic"
- :src="addForm.goods.cover_pic"
- />
- </div>
- <div style="float: left; width: 50%;margin-left: 10px; line-height: 20px!important;">
- <samp class="line-clamp" :title="addForm.goods.name">{{addForm.goods.name}}</samp><br/>
- <samp>¥{{addForm.goods.price}}</samp>
- </div>
- </div>
- </el-form-item>
- <el-form-item label="审核状态" prop="check_status">
- <el-radio-group v-model="addForm.check_status">
- <el-radio :label="1">通过</el-radio>
- <el-radio :label="2">驳回</el-radio>
- </el-radio-group>
- </el-form-item>
- <el-form-item
- v-if="addForm.check_status == 2" label="驳回原因"
- :rules="addForm.check_status == 2?addRule.remark:[{ required: false}]"
- prop="remark">
- <el-input type="textarea" placeholder="请输入驳回原因" v-model="addForm.remark" :autosize="{ minRows: 2, maxRows: 8}" maxlength="200" show-word-limit>{{addForm.remark}}</el-input>
- </el-form-item>
- </el-form>
- <span slot="footer" class="dialog-footer">
- <el-button @click="dialogAddgsVisible = false">取 消</el-button>
- <el-button type="primary" @click="saveAddForm('addForm')" v-loading="btnLoading">确 定</el-button>
- </span>
- </el-dialog>
- <!-- 弹框添加中心结束-->
- <!-- 自定义 -->
- <el-dialog title="素材图片预览" :visible.sync="app_share.dialog" width="30%">
- <div flex="dir:left main:center" class="app-share">
- <com-image mode="aspectFill" style=" width: 100%; height: 500px;text-align: center;"
- :src="app_share.img" width="100%" height="100%">
- </com-image>
- </div>
- <div slot="footer" class="dialog-footer">
- <el-button @click="app_share.dialog = false" type="primary">关闭</el-button>
- </div>
- </el-dialog>
- </el-card>
- </div>
- <script>
- const app = new Vue({
- el: '#app',
- data() {
- return {
- listLoading: false,
- page: 1,
- pagination:null,
- //本地存时间,请求时不发送
- time: [],
- search: {
- user_id: '',
- mobile: '',
- user_name: '',
- date_start: null,
- date_end: null,
- title:null,
- },
- list: [],
- //弹框配置
- addForm: {
- id: '',//
- describe: '',//素材文案
- download_type: '',//上传类型:1-图文;2-短视频
- img_url: [],//素材图片
- video: {
- video_url: '',
- thumb_url: '',
- },//素材视频链接
- goods: {
- id: '',
- name: '',
- price: '',
- cover_pic: '',
- },//关联商品
- check_status: '',//审核状态:0:未审核 1:审核通过 2:审核不通过
- remark: '',//驳回原因
- },
- addRule: {
- check_status: [
- {required: true, message: '请填选择状态', trigger: 'change'},
- ],
- remark: [
- {required: true, message: '请填驳回原因', trigger: 'change'},
- ],
- },
- title: "",
- check_status:'yes',
- status: 0,
- dialogAddgsVisible: false,
- dataList: [],
- // 对话框显示与否
- dialogVisible: false,
- btnLoading: false,
- app_share: {
- dialog: false,
- img: '',
- }
- };
- },
- methods: {
- searchs() {
- this.page = 1;
- this.getList();
- },
- pageChange(currentPage) {
- let self = this;
- self.page = currentPage;
- self.getList();
- },
- change_tab(tab,event){
- if (tab.name == 'yes') {
- this.status = 0;
- } else {
- this.status = 2;
- }
- this.getList();
- },
- getList() {
- let self = this;
- self.listLoading = true;
- // 检查是否选择了搜索时间
- if (!self.time) {
- self.search.date_start = '';
- self.search.date_end = '';
- } else {
- self.search.date_start = self.time[0];
- self.search.date_end = self.time[1];
- }
- request({
- method: 'post',
- params: {
- r: 'xhs/default/index',
- },
- data: {
- page: self.page,
- user_id: self.search.user_id,
- mobile: self.search.mobile,
- user_name: self.search.user_name,
- check_status:this.status,
- date_start: self.search.date_start,
- date_end: self.search.date_end,
- title: self.search.title,
- },
- }).then(e => {
- self.listLoading = false;
- self.list = e.data.data.list;
- this.pagination = e.data.data.pagination;
- this.pagination.pageSize = e.data.data.page_size;
- this.pagination.total_count = e.data.data.count;
- }).catch(e => {
- console.log(e);
- });
- },
- appShare(url) {
- this.app_share.dialog = true;
- this.app_share.img = url;
- },
- /**
- *点击按钮,弹出框
- * @param
- */
- addgsForm(row, index) {
- console.log(row,'*****');
- this.addForm.id = row.id?row.id:'';
- if(row.check_status == 0) {
- this.addForm.check_status = 1;
- }
- this.addForm.check_remark = row.check_remark;
- this.addForm.title = row.title;
- this.addForm.main_text = row.main_text;
- this.addForm.type = row.source.type;
- //上传类型:1-图文;2-短视频
- if (row.source.type == 1) {
- if(row.source.source){
- this.addForm.img_url = row.source.source;
- }else{
- this.addForm.img_url = [];
- }
- } else {
- this.addForm.video_url = row.source.source;
- this.addForm.thumb_url = row.source.cover;
- }
- console.log(this.addForm);
- //管理商品
- if (row.goods) {
- this.addForm.goods = {
- id: row.goods.id,
- name: row.goods.goods_name,
- price: row.goods.price,
- cover_pic: row.goods.cover_pic,
- };
- }else{
- this.addForm.goods = [];
- }
- this.dialogAddgsVisible = true;
- this.title = "审核"
- },
- /**
- *更新新数据
- * @param
- */
- saveAddForm(formName) {
- this.$refs[formName].validate((valid) => {
- let self = this;
- if (valid) {
- self.btnLoading = true;
- request({
- params: {
- r: 'xhs/default/edit',
- },
- method: 'post',
- data: {
- id: self.addForm.id,
- check_status: self.addForm.check_status,
- type:1,
- check_remark: self.addForm.remark,
- }
- }).then(e => {
- this.btnLoading = false;
- if (e.data.code == 0) {
- this.dialogAddgsVisible = false;
- self.$message.success(e.data.msg);
- self.getList();
- this.addForm.remark = '';
- this.addForm.check_status = '';
- } else {
- self.$message.error(e.data.msg);
- }
- }).catch(e => {
- this.btnLoading = false;
- console.log(e);
- });
- } else {
- console.log('error submit!!');
- return false;
- }
- });
- },
- /**
- *关闭或取消模态框,清空值
- * @param
- */
- closeDialogAddgsVisible() {
- this.addForm.remark = '';
- this.addForm.check_status = '';
- this.addForm.goods = {
- id: '',
- name: '',
- price: '',
- cover_pic: '',
- };
- },
- },
- mounted: function () {
- this.getList();
- }
- });
- </script>
|