| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004 |
- <?php
- use common\helpers\ComponentHelper;
- ComponentHelper::loadComponentView('com-share-pop');
- ?>
- <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;
- }
- .el-table__body-wrapper .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;
- }
- .default-goods{
- max-width: 50px;
- max-height: 50px;
- }
- .flex-x-between {
- display: -webkit-box;
- display: -webkit-flex;
- display: flex;
- -webkit-box-pack: space-between;
- -webkit-justify-content: space-between;
- -ms-flex-pack: space-between;
- justify-content: space-between;
- }
- .cont-title {
- font-size: 15px;
- padding-top: 20px;
- padding-bottom: 10px;
- font-weight: 700;
- }
- .cont-num {
- font-size: 14px;
- font-weight: 700;
- padding-bottom: 10px;
- }
- .center {
- text-align: center;
- }
- .el-dialog__header .el-dialog__title{
- font-size: 18px;
- }
- .el-dialog__wrapper .el-dialog__body{
- padding: 3px 20px;
- }
- /*头像样式 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*/
- .comment-top{
- margin-bottom: 15px;
- font-size: 13px;
- }
- .comment-top .notes-img{
- width: 100px;
- height: 80px;
- margin-right: 15px;
- background: #F6F6F6;
- }
- .comment-top-title{
- font-size: 16px;
- font-weight: 600;
- flex: 1;
- }
- .comment-center-infos{
- height: 300px;
- overflow-y: auto;
- }
- .add-comment,.comment-center-info{
- margin-bottom: 10px;
- }
- .comment-center-info{
- margin-right: 5px;
- }
- .a-comment{
- margin-bottom: 4px;
- }
- .comment-user-info{
- font-size: 13px;
- line-height: 23px;
- }
- .comment-text{
- margin-left: 58px;
- margin-top: 6px;
- }
- .comment-reply{
- background: #F2F2F2;
- padding: 10px;
- }
- .reply-list{
- margin-left: 50px;
- }
- .reply-pull{
- text-align: center;
- }
- .reply-pull span:hover{
- cursor: pointer;
- }
- .serach-inpug{
- margin-right: 20px
- }
-
- </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>-->
- <!-- <el-select v-model="link_note_type" @change='newNote' class="select" size="small">
- <el-option :key="0" label="发布内容" :value="0"></el-option>
- <el-option :key="1" label="发布图文" :value="1"></el-option>
- <el-option :key="2" label="发布视频" :value="2"></el-option>
- <el-option :key="3" label="发布广告" :value="3"></el-option>
- </el-select> -->
- <!-- split-button type="primary" trigger="click" -->
- <el-dropdown size="medium" type="primary" @command="newNote">
- <el-button size="medium" type="primary">发布内容<i class="el-icon-arrow-down el-icon--right"></i></el-button>
- <!-- <span class="el-dropdown-link">
-
- </span> -->
- <el-dropdown-menu slot="dropdown">
- <el-dropdown-item command="1">发布图文</el-dropdown-item>
- <el-dropdown-item command="2">发布视频</el-dropdown-item>
- <el-dropdown-item command="3">发布广告</el-dropdown-item>
- </el-dropdown-menu>
- </el-dropdown>
- </div>
- </template>
- </div>
- <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 serach-inpug" flex="dir:left cross:center">
- <div class="label">标题名称</div>
- <el-input style="width: 150px" v-model="search.title" placeholder="请输入文章标题"></el-input>
- </div>
- <div class="item-box serach-inpug" flex="dir:left cross:center">
- <div class="label">发布类型</div>
- <el-select v-model="search.note_type" @change='searchs' class="select" size="small">
- <el-option :key="0" label="全部" :value="0"></el-option>
- <el-option :key="1" label="图文" :value="1"></el-option>
- <el-option :key="2" label="视频" :value="2"></el-option>
- <el-option :key="3" label="广告" :value="3"></el-option>
- </el-select>
- </div>
- <div class="item-box serach-inpug" flex="dir:left cross:center">
- <div class="label">状态</div>
- <el-select v-model="search.is_release" @change='searchs' class="select" size="small">
- <el-option :key="-1" label="全部" :value="-1"></el-option>
- <el-option :key="1" label="已发布" :value="1"></el-option>
- <el-option :key="0" label="未发布" :value="0"></el-option>
- </el-select>
- </div>
- <!-- <div class="item-box serach-inpug" flex="dir:left cross:center">-->
- <div class="label">分类</div>
- <el-select size="small" v-model="search.cate_id" @change='searchs' class="select">
- <el-option key="all" label="全部" value=""></el-option>
- <el-option :key="index" :label="item.name" :value="item.id"
- v-for="(item, index) in cate_list"></el-option>
- </el-select>
- <!-- </div>-->
- <div class="item-box serach-inpug" flex="dir:left cross:center">
- <el-button type="primary" size="small" @click="searchs">搜索</el-button>
- </div>
- </el-form>
- <el-table v-loading="listLoading" :data="list" stripe style="width: 100%">
- <el-table-column label="标题" min-width="80" align="center">
- <template slot-scope="scope">
- <p>{{scope.row.title}}</p>
- </template>
- </el-table-column>
- <el-table-column label="发布者" width="180" >
- <template slot-scope="scope">
- <div class="user_img" v-if="scope.row.user_id>0">
- <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 class="user_img" v-else>
- <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;" v-if="scope.row.user_id>0">{{scope.row.user.nickname}}</div>
- <div style="color:#000;" v-else>平台</div>
- <div style="font-size: 13px;" v-if="scope.row.user_id>0">{{scope.row.user.mobile}}</div>
- </div>
- </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="80" align="center">
- <template slot-scope="scope">
- <p>{{scope.row.note_type_name}}</p>
- </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="80" align="center">-->
- <el-table-column label="浏览次数" min-width="80" align="center">
- <template slot-scope="scope">
- <p> {{scope.row.views_num}} </p>
- </template>
- </el-table-column>
- <!-- <el-table-column label="平均浏览时长" min-width="80" align="center">-->
- <!-- <template slot-scope="scope">-->
- <!-- <p>{{scope.row.average_time}}</p>-->
- <!-- </template>-->
- <!-- </el-table-column>-->
- <el-table-column label="点赞数" min-width="80" align="center">
- <template slot-scope="scope">
- <p>{{scope.row.likes_num}}</p>
- </template>
- </el-table-column>
- <el-table-column label="状态" min-width="80" align="center">
- <template slot-scope="scope">
- <div>
- <div style="color:#000;" v-if="scope.row.is_release==1">已发布</div>
- <div style="color:#000;" v-else>未发布</div>
- </div>
- </template>
- </el-table-column>
- <el-table-column
- label="操作"
- min-width="180"
- align="center">
- <template slot-scope="scope">
- <el-button v-if="scope.row.note_type != 3" circle size="mini" type="text" @click="openCommentPop(scope.$index)">
- 评论
- </el-button>
- <el-button circle size="mini" type="text" @click="detail(scope.row)">
- 数据
- </el-button>
- <el-button circle size="mini" type="text" @click="edit(scope.row)">
- 编辑
- </el-button>
- <!-- <el-button circle size="mini" type="text" @click="openSharePop(scope.row)">
- 推广
- </el-button> -->
- <com-share-pop :url="shareUrl">
- <template slot="share-button" slot-scope="data" v-if="scope.row.note_type == 1 || scope.row.note_type == 2">
- <el-button circle size="mini" type="text" @click="openSharePop(scope.row,data.show)">
- 推广
- </el-button>
- </template>
- </com-share-pop>
- <el-button v-if="scope.row.is_top == 0" circle size="mini" type="text" @click="toUpdate(scope.row,1,'top')">
- 置顶
- </el-button>
- <el-button v-if="scope.row.is_top == 1" circle size="mini" type="text" @click="toUpdate(scope.row,0,'top')">
- 取消置顶
- </el-button>
- <el-button v-if="scope.row.is_release == 0" circle size="mini" type="text" @click="toUpdate(scope.row,1,'release')">
- 发布
- </el-button>
- <el-button v-if="scope.row.is_release == 1" circle size="mini" type="text" @click="toUpdate(scope.row,0,'release')">
- 取消发布
- </el-button>
- <el-button circle size="mini" type="text" @click="handle('delete',scope.row)">
- 删除
- </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-card>
- <!-- “数据”弹窗 -->
- <el-dialog title="数据" :visible.sync="dialogFormVisible">
- <!-- <el-dialog title="数据详情" :visible.sync="dialogFormVisible" >-->
- <div class="flex-x-between">
- <div>文章标题:{{data_list.title}}</div>
- <div style="color: #999;" v-if="data_list.created_at">
- 发布时间:{{data_list.created_at | dateTimeFormat("Y-m-d H:i:s")}}
- </div>
- </div>
- <!-- <div class="dialog-cont">-->
- <!-- <div class="cont-title">基本信息</div>-->
- <!-- <el-row :gutter="20" style="padding: 0px 10px;">-->
- <!-- <dl>正文:<span style="margin-left: 20px;">{{data_list.main_text}}</span></dl>-->
- <!-- </el-row>-->
- <!-- <el-row :gutter="20" style="padding: 0px 10px;">-->
- <!-- <div style="float: left" v-if="data_list && data_list.source.type == 1">图片:</div>-->
- <!-- <div style="float: left" v-else>视频:</div>-->
- <!-- <div style="float: left;margin-left: 20px;">-->
- <!-- <div v-if="data_list && data_list.source.type == 1" class="demo-image__preview">-->
- <!-- <el-image v-for="item in data_list.source.source" style="width: 80px; height: 80px;margin-left: 10px;" :src="item" :preview-src-list="data_list.source.source"> </el-image>-->
- <!-- </div>-->
- <!-- <div v-else>-->
- <!-- <video ref="videoPlayer" controls :src="data_list.source.source" :poster="data_list.source.source" controlslist="nodownload" style="width: 50%; height: 50%; object-fit: fill">-->
- <!-- </video>-->
- <!-- </div>-->
- <!-- </div>-->
- <!---->
- <!-- </el-row>-->
- <!-- </div>-->
- <div class="dialog-cont" :data="data_list">
- <!-- <div class="cont-title">互动数据</div>-->
- <el-row :gutter="20" style="padding: 10px 0">
- <el-col :span="6">
- <div class="cont-num center">{{data_list.views_num}}</div>
- <div class="center">浏览次数</div>
- </el-col>
- <!-- <el-col :span="6">-->
- <!-- <div class="cont-num center">{{data_list.views_people_num}}</div>-->
- <!-- <div class="center">浏览人数</div>-->
- <!-- </el-col>-->
- <el-col :span="6">
- <div class="cont-num center">{{data_list.share_num}}</div>
- <div class="center">分享次数</div>
- </el-col>
- <!-- <el-col :span="6">-->
- <!-- <div class="cont-num center">{{data_list.share_visit_num}}</div>-->
- <!-- <div class="center">分享访问次数</div>-->
- <!-- </el-col>-->
- <el-col :span="6">
- <div class="cont-num center">{{data_list.pay_people_num}}</div>
- <div class="center">付费观看数</div>
- </el-col>
- <el-col :span="6">
- <div class="cont-num center">{{data_list.pay_amount}}</div>
- <div class="center">付费金额总计</div>
- </el-col>
- <el-col :span="6">
- <div class="cont-num center">{{data_list.pay_score_amount}}</div>
- <div class="center">付费积分总计</div>
- </el-col>
- </el-row>
- </div>
- <div class="dialog-cont">
- <div class="cont-title">引导购买商品</div>
- <el-table :data = "goods_data" height="250" style="width: 100%" :header-cell-style="{'text-align':'center'}" :cell-style="{'text-align':'center'}">
- <el-table-column label="商品" 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;">
- <com-ellipsis :line="1" :title="scope.row.goods.goods_name">{{scope.row.goods.goods_name}}</com-ellipsis>
- <p style="color: red;">¥{{scope.row.goods.price}}</p>
- </div>
- </div>
- <samp v-else>--</samp>
- </template>
- </el-table-column>
- <el-table-column prop="view_number" label="引导进商详页人数" width="180">
- <template slot-scope="scope">
- <span :title="scope.row.view_number" class="">{{scope.row.goods_views_count}}</span>
- </template>
- </el-table-column>
- <el-table-column prop="bought_number" label="引导付款人数">
- <template slot-scope="scope">
- <span :title="scope.row.bought_number" class="">{{scope.row.order_people_num}}</span>
- </template>
- </el-table-column>
- <el-table-column prop="amount" label="引导付款金额">
- <template slot-scope="scope">
- <span :title="scope.row.amount" class="">{{scope.row.order_amount}}</span>
- </template>
- </el-table-column>
- </el-table>
- </div>
- </el-dialog>
- <el-dialog :visible.sync="commentPop" width="45%">
- <div class="comment-top" v-if="selIndex != -1" flex>
- <el-image class="notes-img" fit="contain" :src="list[selIndex].cover_img"></el-image>
- <div flex="dir:top">
- <div class="comment-top-title">
- {{list[selIndex].title}}
- </div>
- <div>
- 发布时间:{{list[selIndex].created_at|dateTimeFormat('Y-m-d H:i:s')}}
- </div>
- </div>
- </div>
- <div style="margin-bottom: 15px" flex="cross:center">
- <div style="flex: 1;">共{{commentCount}}条评论</div>
- <div flex style="flex-shrink: 0;">
- <el-input v-model="commentSearch" size="medium" placeholder="请输入会员名称/手机号" @change="searchComment" ></el-input>
- <el-button style="margin-left: 10px;" size="medium" type="primary" v-loading="dataLoading == 'search'" @click="searchComment">搜索</el-button>
- </div>
- </div>
- <div class="comment-center" v-loading="dataLoading == 'commentList'">
- <div class="add-comment" flex>
- <el-input v-model="commentContent" :placeholder="replyId?'请输入要回复内容':'请输入评价内容'"></el-input>
- <el-button style="margin-left: 10px;" type="primary" v-loading="dataLoading == 'add'" @click="addComment">{{replyId?'回复':'发布'}}</el-button>
- </div>
- <div class="comment-center-infos">
- <div class="comment-center-info" v-for="(item,index) in commentList" :key="index">
- <div class="a-comment">
- <div class="comment-user-info" flex>
- <div class="user_img">
- <el-image class="default-avatar" fit="contain" :src="item.user?item.user.avatar_url : item.user">
- <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;">{{item.user?item.user.nickname:'后台'}}</div>
- <div>{{item.user?item.user.mobile:''}}</div>
- </div>
- </div>
- <div class="comment-text">
- {{item.content}}
- </div>
- <div flex="cross:center">
- <div style="flex: 1;color: #B5B5B5;">
- {{item.created_at|dateTimeFormat('Y-m-d H:i:s')}}
- </div>
- <div>
- <el-button type="text" icon="el-icon-chat-line-square" v-loading="dataLoading == 'reply' + item.id" @click="getReply(item.id)">{{item.id == replyId?'取消回复':item.reply?item.reply.count:'回复'}}</el-button>
- <el-button type="text" icon="el-icon-upload2" @click="commentTopOrDel(item.id)">{{item.is_top?'取消置顶':'置顶'}}</el-button>
- <el-button type="text" icon="el-icon-delete" @click="commentTopOrDel(item.id,0)">删除</el-button>
- </div>
- </div>
- </div>
- <div class="comment-reply" v-if="item.replyList && item.replyList.length && replyId == item.id">
- <div class="reply-list" v-for="(replyItem,replyIndex) in item.replyList" :key="replyIndex" v-show="replyAllBoo?true:replyIndex == 0">
- <div class="comment-user-info" flex>
- <div class="user_img">
- <el-image class="default-avatar" fit="contain" :src="replyItem.user?replyItem.user.avatar_url:replyItem.user">
- <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;">{{replyItem.user?replyItem.user.nickname:'后台'}}</div>
- <div>{{replyItem.user?replyItem.user.mobile:''}}</div>
- </div>
- </div>
- <div class="comment-text">
- {{replyItem.content}}
- </div>
- <div flex="cross:center">
- <div style="flex: 1;color: #B5B5B5;">
- {{replyItem.created_at|dateTimeFormat('Y-m-d H:i:s')}}
- </div>
- <div>
- <el-button type="text" icon="el-icon-chat-line-square" @click="commentTopOrDel(replyItem.id,0)">删除</el-button>
- </div>
- </div>
- </div>
- <div class="reply-pull" v-if="item.replyList.length > 1">
- <span v-if="!replyAllBoo" @click="replyAllBoo = true">
- 展开全部{{replyCount}}条回复
- <i class="el-icon-arrow-down"></i>
- </span>
- <span v-else @click="replyAllBoo = false">
- 收起
- <i class="el-icon-arrow-up"></i>
- </span>
- </div>
- </div>
- </div>
- </div>
- </div>
- <div slot="footer">
- <el-pagination background layout="prev, pager, next" :page-count="dataPageCount" :current-page="dataPage" @current-change="commentPage"></el-pagination>
- </div>
- </el-dialog>
- </div>
- <script>
- const app = new Vue({
- el: '#app',
- data() {
- return {
- link_note_type:0,
- listLoading: false,
- page: 1,
- pageCount: 0,
- pageUrl: '',
- shareUrl: '',
- cate_list:{},
- //基础数据
- editBasisData: {
- materialTypeList: [],
- },
- //本地存时间,请求时不发送
- time: [],
- search: {
- keyword: '',
- user_id: '',
- title: '',
- user_name: '',
- check_status: '1',
- date_start: null,
- date_end: null,
- note_type: 0,
- is_release: -1,
- cate_id: '',
- },
- note_type:'',
- list: [],
- //弹框配置
- addForm: {
- id: '',
- name: '',
- },
- title: "",
- dialogFormVisible: false, //数据弹窗
- data_list: {
- source:{"type":1,"source": ['1','2']},
- },//数据
- goods_data:[],//详细数据
- dialogAddgsVisible: false,
- // 对话框显示与否
- dialogVisible: false,
- dataloading: false,
- pagination:null,
- // 评论弹窗
- commentPop: false,
- commentSearch: '',
- commentList: [],
- commentCount: 0,
- selIndex: -1, //选中的下标
- commentContent: '',
- replyId: 0,
- replyAllBoo: false,
- replyCount: 0,
- dataLoading: '',
- dataPage: 1,
- dataPageCount: 1,
- testUrl: 'https://shuzixiangdao.oss-cn-guangzhou.aliyuncs.com/images/2022/01/19/image_1642556873_dxm5RnCj.png',
- };
- },
- methods: {
- newNote(command){
- this.link_note_type = command;
- if (this.link_note_type > 0) {
- navigateTo({
- r: 'operating-note/notes/edit',
- link_note_type: this.link_note_type
- })
- }
- console.log()
- // if (id) {
- // navigateTo({
- // r: 'operating-note/notes/edit',
- // type:23
- // })
- // } else {
- // navigateTo({
- // r: 'material/default/edit',
- // });
- // }
- },
- searchs() {
- this.page = 1;
- this.getList();
- },
- pageChange(currentPage) {
- let self = this;
- self.page = currentPage;
- self.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: 'operating-note/notes/index',
- },
- data: {
- page: self.page,
- // keyword: self.search.keyword,
- // user_id: self.search.user_id,
- // mobile: self.search.mobile,
- // user_name: self.search.user_name,
- // check_status: self.search.check_status,
- // date_start: self.search.date_start,
- // date_end: self.search.date_end,
- title: self.search.title,
- note_type: self.search.note_type,
- is_release: self.search.is_release,
- cate_id: self.search.cate_id,
- },
- }).then(e => {
- self.listLoading = false;
- e.data.data.list.forEach(v => {
- v.cover_img = isJSON(v.cover_img)?JSON.parse(v.cover_img):v.cover_img;
- })
- self.list = e.data.data.list;
- this.pagination = e.data.data.pagination;
- this.pagination.pageSize = e.data.data.page_size;
- this.cate_list = e.data.data.cate;
- this.pagination.total_count = e.data.data.count;
- this.pageUrl = e.data.data.domain;
- }).catch(e => {
- console.log(e);
- });
- },
- detail(data) {
- console.log(data);
- this.data_list = [];
- this.goods_data = [];
- this.dialogFormVisible = true;
- this.data_list = data;
- this.goods_data.push(data);
- },
- edit(data){
- navigateTo({
- r: 'operating-note/notes/edit',
- link_note_type: data.note_type,
- id:data.id
- })
- console.log(data)
- },
- toUpdate(data,now_state,type){
- if(type == 'top'){
- data.is_top = now_state;
- }
- if(type == 'release'){
- data.is_release = now_state;
- }
- console.log(now_state)
- console.log(data);
- request({
- params: {
- r: 'operating-note/notes/edit',
- },
- method: 'post',
- data:data,
- }).then(e => {
- self.listLoading = false;
- if (e.data.code === 0) {
- self.$message.success(e.data.msg);
- } else {
- self.$message.error(e.data.msg);
- }
- self.getList();
- }).catch(e => {
- console.log(e);
- });
- },
- handle(type,data = null){
- switch (type) {
- case 'delete':// 删除
- this.$confirm('删除该条数据后不可以恢复, 是否继续?', '警告', {type: 'warning'}).then(() => {this.send({id: data.id,status:-1,type:'1'});})
- break;
- case 'enable':
- var status = 0;
- if(data.status=='0') status = 1;
- this.send({id: data.id,status: status,type:'1'});
- break;
- }
- },
- send(data){
- let self = this;
- self.listLoading = true;
- request({
- params: {
- r: 'operating-note/notes/edit',
- },
- method: 'post',
- data:data,
- }).then(e => {
- self.listLoading = false;
- if (e.data.code === 0) {
- self.$message.success(e.data.msg);
- } else {
- self.$message.error(e.data.msg);
- }
- self.getList();
- }).catch(e => {
- console.log(e);
- });
- },
- /**
- *关闭或取消模态框,清空值
- * @param
- */
- closeDialogAddgsVisible() {
- this.$refs.addForm.resetFields();//element封装的方法,清空模态框的值
- this.title = "" //初始化title的值
- this.addForm = {//初始化addForm中的值
- title: "",
- }
- },
- // 评论
- openCommentPop(index){
- this.selIndex = index;
- this.commentPop = true;
- this.commentSearch = '';
- this.commentContent = '';
- this.replyId = 0;
- this.dataPage = 1;
- this.dataPageCount = 1;
- this.replyAllBoo = false;
- this.getCommentList();
- },
- getCommentList(){
- let that = this;
- this.dataLoading = 'commentList'
- request({
- method: 'post',
- params: {
- r: 'operating-note/notes/search-comment',
- },
- data: {
- note_content_id: this.list[this.selIndex].id,
- keyword: this.commentSearch,
- page: this.dataPage,
- },
- }).then(res => {
- if(res.data.code == 0){
- let resData = res.data.data;
- that.commentCount = resData.count;
- that.commentList = resData.list;
- that.dataPage = resData.page;
- that.dataPageCount = resData.page_count;
- }
- }).catch(e => {
- console.log(e);
- }).finally(v => {
- this.dataLoading = '';
- });
- },
- addComment(){
- if(!this.commentContent.trim().length){
- this.$message({
- message: this.replyId?'请输入你要回复的内容':'请输入你要评论的内容',
- type: 'warning',
- });
- return
- }
- this.dataLoading = 'add';
- let that = this;
- request({
- method: 'post',
- params: {
- r: 'operating-note/notes/admin-reply',
- },
- data: {
- note_content_id: this.list[this.selIndex].id,
- content: this.commentContent,
- reply_id: this.replyId,
- },
- }).then(res => {
- if(res.data.code == 0){
- that.$message({
- message: this.replyId?'回复成功':'评论成功',
- type: 'success',
- });
- if(that.replyId){
- let index = that.commentList.findIndex(v => v.id == that.replyId);
- if(!that.commentList[index].reply){
- that.$set(that.commentList[index],'reply',{
- count: 1
- });
- } else {
- that.commentList[index].reply.count++;
- }
- that.getReply(that.replyId,'refresh')
- } else {
- that.getCommentList();
- }
- } else {
- that.$message({
- message: res.data.data.msg,
- type: 'warning',
- });
- }
- }).catch(e => {
- console.log(e);
- }).finally(e => {
- that.dataLoading = '';
- that.commentContent = '';
- })
- },
- searchComment(){
- this.commentDataReset();
- this.getCommentList();
- },
- getReply(id,type){
- if(type != 'refresh' && this.replyId == id){
- this.replyId = 0;
- return;
- }
- let that = this;
- let index = that.commentList.findIndex(v => v.id == id);
- this.replyId = id;
- if(type != 'refresh'){
- this.replyAllBoo = false;
- }
-
- if(type != 'refresh' && that.commentList[index].replyList){
- return;
- }
- this.dataLoading = 'reply' + id;
- request({
- method: 'get',
- params: {
- r: 'operating-note/notes/get-reply',
- note_content_id: this.list[this.selIndex].id,
- reply_id: this.replyId,
- },
- }).then(res => {
- let resData = res.data.data;
- if(res.data.code == 0){
- if(index != -1){
- that.commentList[index]
- that.$set(that.commentList[index],'replyList',resData.list);
- }
- this.replyCount = resData.count;
- }
- }).catch(err => {
- console.log(err);
- }).finally(e => {
- that.dataLoading = '';
- })
- },
- openSharePop(row,fun){
- this.shareUrl = row.share_url_base + row.id;
- setTimeout(() => {
- fun();
- },300)
- },
- commentPage(page){
- this.dataPage = page;
- this.getCommentList();
- },
- commentTopOrDel(commentId,type = 1){
- let that = this;
- request({
- method: 'post',
- params: {
- r: 'operating-note/notes/comment-edit',
- },
- data: {
- note_comment_id: commentId,
- type
- }
- }).then(res => {
- if(res.data.code == 0){
- let resData = res.data.data;
- that.commentDataReset();
- that.getCommentList();
- that.$message({
- message: type == 1?'置顶成功':'删除成功',
- type: 'success',
- });
- } else{
- that.$message({
- message: res.data.data.msg,
- type: 'warning',
- });
- }
- })
- },
- commentDataReset(){
- this.replyId = 0;
- this.dataPage = 1;
- this.dataPageCount = 1;
- this.replyAllBoo = false;
- }
- },
- mounted: function () {
- this.getList();
- }
- });
- </script>
|