contentList.vue 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255
  1. <template>
  2. <view>
  3. <view class="top-fixed">
  4. <view class="search-box ddflex">
  5. <view class="search-input ddflex fflex">
  6. <image src="/static/images/ssico.png"></image>
  7. <input @confirm="searchFn" confirm-type="search" @input="searchFn" v-model="searchVal" class="fflex"
  8. placeholder="请输入内容名称" />
  9. </view>
  10. <view class="filter ddflex">
  11. <view class="fflex">
  12. <picker mode="selector" :range="rangeList" range-key="label" v-model="rangeIndex" @change="rangeChange">
  13. <view class="filter-item fflex ddflex f-active" style="text-align: right;justify-content: flex-end;">
  14. <text style="max-width: 150rpx;" class="tover">{{rangeList[rangeIndex].label}}</text>
  15. <image class="filter-item-icon" src="../../static/images/down.png"></image>
  16. </view>
  17. </picker>
  18. </view>
  19. </view>
  20. </view>
  21. </view>
  22. <view style="height: 130rpx;"></view>
  23. <!-- 订单列表 -->
  24. <view style="position: relative;overflow: hidden;" v-if="dataList.length>0">
  25. <!-- <view class="act-list" v-if="dataList && dataList.length > 0">
  26. <view class="li" v-for="(item, index) in dataList" :key="index" @click="toActivity(item)">
  27. <view class="imgbox"><image :src="item.pic" mode="aspectFill"></image></view>
  28. <view class="infos fflex">
  29. <view class="act-tit tovers">{{ item.title }}</view>
  30. <view class="stas ddflex">
  31. <view class="fflex">
  32. <view class="tag-box tovers">{{ item.brief }}</view>
  33. <view class="area" v-if="item.time || item.enlistTime">
  34. <view >报名截止时间:{{ item.enlistTime }}</view>
  35. <view >活动结束时间:{{ item.time }}</view>
  36. <view v-if="item.state>0 && item.state!=6">活动状态:{{item.stateName}}</view>
  37. <view style="font-size: 26rpx;color: red;font-weight: 400;" v-else-if="item.state==6">审核失败 {{item.refuse}}</view>
  38. </view>
  39. </view>
  40. <view class="act-btn" v-if="item.state==0" @click.stop="review(item,index)">审核</view>
  41. </view>
  42. </view>
  43. </view>
  44. </view> -->
  45. <view class="rec" v-if="dataList.length>0">
  46. <view class="li" v-for="(item,index) in dataList" :key="index">
  47. <navigator @click="toActivity(item)" hover-class="none" class="dflex">
  48. <view class="flex">
  49. <view class="rec-tit tovers3">{{item.title}}</view>
  50. <view class="dflex">
  51. <view class="rec-time">{{item.createDate}}</view>
  52. </view>
  53. </view>
  54. <image :src="item.pic" mode="aspectFill" class="rec-img"></image>
  55. </navigator>
  56. <view class="ddflex" style="justify-content: flex-end;">
  57. <view class="review-btn" v-if="item.status==0" @click.stop="review(item,index)">审核</view>
  58. <view style="font-size: 26rpx;color: red;font-weight: 400;" v-else-if="item.status==1">审核失败 {{item.refuse}}</view>
  59. </view>
  60. </view>
  61. </view>
  62. </view>
  63. <view v-else class="nodata">
  64. <image src="../../card/static/images/empty.png" mode="widthFix"></image>
  65. <view>暂无数据</view>
  66. </view>
  67. <view class="ceng" v-show="showPop" @click="showPop=false" @touchmove.stop.prevent="moveHandle">
  68. </view>
  69. <view :style="showPop?'bottom:0;':'bottom:-100%;'"
  70. class="pop">
  71. <view class="pop-scroll">
  72. <view class="pop-title ddflex">审核内容 <view class="tover" style="max-width: 300rpx;margin-left: 20rpx;">{{clickItem.title}}</view></view>
  73. <view class="pop-textarea">
  74. <textarea v-model="tempData" placeholder="如审核不通过请填写不通过原因"></textarea>
  75. </view>
  76. <view style="font-size: 24rpx;color: #999;padding:0 30rpx 30rpx;">注:通过审核可直接点击通过,不通过审核请填写原因</view>
  77. </view>
  78. <view class="ddflex">
  79. <view class="pop-item fflex" style="background-color: red;color: #fff;" @click="unpass">不通过</view>
  80. <view class="pop-item fflex" style="background-color: var(--main);color: #fff;" @click="pass">通过</view>
  81. </view>
  82. </view>
  83. </view>
  84. </template>
  85. <script>
  86. const app = getApp();
  87. const req = require("../../utils/request.js");
  88. const util = require('../../utils/util.js');
  89. export default {
  90. components: {
  91. },
  92. props: {},
  93. data() {
  94. return {
  95. statusBarHeight:0,
  96. page: 1,
  97. limit: 10,
  98. isLoad: true,
  99. searchVal: '',
  100. dataList: [],
  101. isReference:false,
  102. clickItem:{},
  103. clickIndex:-1,
  104. showPop:false,
  105. tempData:'',
  106. rangeIndex:1,
  107. rangeList:[{
  108. label:'全部',
  109. value:-1
  110. },{
  111. label:'待审核',
  112. value:0
  113. },{
  114. label:'审核失败',
  115. value:1
  116. },{
  117. label:'审核成功',
  118. value:200
  119. }]
  120. }
  121. },
  122. onLoad(options) {
  123. this.getDataList()
  124. },
  125. onShow() {
  126. if(this.isReference){
  127. this.isReference = false
  128. this.page=1;
  129. this.isLoad = true
  130. this.getDataList()
  131. }
  132. },
  133. onReachBottom() {
  134. this.page++;
  135. this.getDataList();
  136. },
  137. methods: {
  138. jumpUrl(url) {
  139. uni.navigateTo({
  140. url: url
  141. })
  142. },
  143. toActivity(item){
  144. uni.navigateTo({
  145. url: '/topic/content/content?id=' + item.id
  146. });
  147. },
  148. // 分页查询
  149. getDataList() {
  150. if (!this.isLoad) return false;
  151. this.isLoad = false;
  152. let queryParams = {
  153. page: this.page,
  154. limit: this.limit
  155. }
  156. if (this.searchVal) {
  157. queryParams.title = this.searchVal
  158. }
  159. queryParams.status = this.rangeList[this.rangeIndex].value
  160. if(queryParams.status==-1) delete queryParams.status
  161. req.getRequest('/api/content/interfaceYzl/page', queryParams, data => {
  162. data = data.list
  163. if (data != null && data.length == this.limit) {
  164. this.isLoad = true;
  165. }
  166. if (this.page == 1) {
  167. this.dataList = [];
  168. }
  169. if (this.page > 0) {
  170. data = this.dataList.concat(data);
  171. }
  172. this.dataList = data;
  173. console.log('列表数据>>>', this.dataList);
  174. })
  175. },
  176. // 搜索
  177. searchFn() {
  178. this.page = 1;
  179. this.isLoad = true;
  180. this.getDataList();
  181. },
  182. monthDayDiff(date) {
  183. return util.monthDayDiff(date)
  184. },
  185. review(item,index){
  186. this.clickItem = item
  187. this.clickIndex = index
  188. this.tempData = item.refuse?item.refuse:''
  189. this.showPop = true
  190. },
  191. pass(){
  192. uni.showModal({
  193. title:'提示',
  194. content:"是否确定通过该内容审核",
  195. success: (res) => {
  196. if(res.confirm){
  197. req.postRequest('/api/content/interfaceYzl/audit',{id:this.clickItem.id,status:200},data=>{
  198. req.msg("内容已通过审核")
  199. this.dataList[this.clickIndex].status = 200
  200. this.clickIndex = -1
  201. this.clickItem = {}
  202. this.tempData = ''
  203. this.showPop = false
  204. })
  205. }
  206. }
  207. })
  208. },
  209. unpass(){
  210. if(!this.tempData){
  211. return req.msg("请填写内容不通过原因")
  212. }
  213. uni.showModal({
  214. title:'提示',
  215. content:"是否确定不通过该内容审核",
  216. success: (res) => {
  217. if(res.confirm){
  218. req.postRequest('/api/content/interfaceYzl/audit',{id:this.clickItem.id,status:1,refuse:this.tempData},data=>{
  219. req.msg("内容未通过审核")
  220. this.dataList[this.clickIndex].status = 1
  221. this.dataList[this.clickIndex].refuse = this.tempData
  222. this.clickIndex = -1
  223. this.clickItem = {}
  224. this.tempData = ''
  225. this.showPop = false
  226. })
  227. }
  228. }
  229. })
  230. },
  231. rangeChange(e){
  232. this.rangeIndex = e.detail.value
  233. this.page = 1;
  234. this.isLoad = true;
  235. this.getDataList();
  236. }
  237. }
  238. }
  239. </script>
  240. <style>
  241. @import "./contentList.css";
  242. </style>