matchList.vue 8.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287
  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="register-box" v-for="item,index in dataList" :key="index" @click="jumpUrl('/card/index/index?cardId='+item.id)">
  26. <view class="register-title ddflex fflex">
  27. <image class="register-title-icon" :src="item.avatar?item.avatar:'/static/images/userimg.png'" mode="aspectFill"></image>
  28. <view class="flex" style="min-width: 0;">
  29. <view class="ddflex">
  30. <view class="card-name fflex tover">{{item.realName?item.realName:''}}</view>
  31. <view style="font-size: 26rpx;color: var(--main);font-weight: 400;" v-if="item.auditState==1">审核成功</view>
  32. <view class="review-btn" v-else-if="item.auditState==0" @click.stop="review(item,index)">审核</view>
  33. <view style="font-size: 26rpx;color: red;font-weight: 400;" v-else-if="item.auditState==2">审核失败 {{item.auditFailReason}}</view>
  34. </view>
  35. <view class="ddflex" style="margin-top: 4rpx;">
  36. <view class="card-tag">{{ item.jobName }}</view>
  37. <view class="card-tag">入司{{item.inDate?monthDayDiff(item.inDate):'1年'}}</view>
  38. </view>
  39. <view class="card-area ddflex">
  40. <image src="/card/static/images/area.png"></image>
  41. <view class="flex tover">{{item.address}}</view>
  42. </view>
  43. </view>
  44. </view>
  45. <view class="ddflex" style="margin-top: 41rpx;">
  46. <view class="flex">
  47. <view class="card-data">{{item.cntCust?item.cntCust:0}}</view>
  48. <view class="card-label">服务客户</view>
  49. </view>
  50. <view class="card-line"></view>
  51. <view class="flex">
  52. <view class="card-data">{{item.cntCntr?item.cntCntr:0}}</view>
  53. <view class="card-label">保单件数</view>
  54. </view>
  55. <view class="card-line"></view>
  56. <view class="flex">
  57. <view class="card-data">{{item.thumbs?item.thumbs:0}}</view>
  58. <view class="card-label">用户点赞</view>
  59. </view>
  60. </view>
  61. </view> -->
  62. <view class="act-list" v-if="dataList && dataList.length > 0">
  63. <view class="li" v-for="(item, index) in dataList" :key="index" @click="toActivity(item)">
  64. <view class="imgbox"><image :src="item.pic" mode="aspectFill"></image></view>
  65. <view class="infos fflex">
  66. <view class="act-tit tovers">{{ item.title }}</view>
  67. <view class="stas ddflex">
  68. <view class="fflex">
  69. <view class="tag-box tovers">{{ item.brief }}</view>
  70. <view class="area" v-if="item.time || item.enlistTime">
  71. <view >报名截止时间:{{ item.enlistTime }}</view>
  72. <view >活动结束时间:{{ item.time }}</view>
  73. <view v-if="item.state>0 && item.state!=6">活动状态:{{item.stateName}}</view>
  74. <view style="font-size: 26rpx;color: red;font-weight: 400;" v-else-if="item.state==6">审核失败 {{item.refuse}}</view>
  75. </view>
  76. </view>
  77. <!-- 0待审核 6 审核失败 -->
  78. <view class="act-btn" v-if="item.state==0" @click.stop="review(item,index)">审核</view>
  79. </view>
  80. </view>
  81. </view>
  82. </view>
  83. </view>
  84. <view v-else class="nodata">
  85. <image src="../../card/static/images/empty.png" mode="widthFix"></image>
  86. <view>暂无数据</view>
  87. </view>
  88. <view class="ceng" v-show="showPop" @click="showPop=false" @touchmove.stop.prevent="moveHandle">
  89. </view>
  90. <view :style="showPop?'bottom:0;':'bottom:-100%;'"
  91. class="pop">
  92. <view class="pop-scroll">
  93. <view class="pop-title ddflex">审核活动 <view class="tover" style="max-width: 300rpx;margin-left: 20rpx;">{{clickItem.title}}</view></view>
  94. <view class="pop-textarea">
  95. <textarea v-model="tempData" placeholder="如审核不通过请填写不通过原因"></textarea>
  96. </view>
  97. <view style="font-size: 24rpx;color: #999;padding:0 30rpx 30rpx;">注:通过审核可直接点击通过,不通过审核请填写原因</view>
  98. </view>
  99. <view class="ddflex">
  100. <view class="pop-item fflex" style="background-color: red;color: #fff;" @click="unpass">不通过</view>
  101. <view class="pop-item fflex" style="background-color: var(--main);color: #fff;" @click="pass">通过</view>
  102. </view>
  103. </view>
  104. </view>
  105. </template>
  106. <script>
  107. const app = getApp();
  108. const req = require("../../utils/request.js");
  109. const util = require('../../utils/util.js');
  110. export default {
  111. components: {
  112. },
  113. props: {},
  114. data() {
  115. return {
  116. statusBarHeight:0,
  117. page: 1,
  118. limit: 10,
  119. isLoad: true,
  120. searchVal: '',
  121. dataList: [],
  122. isReference:false,
  123. clickItem:{},
  124. clickIndex:-1,
  125. showPop:false,
  126. tempData:'',
  127. rangeIndex:1,
  128. rangeList:[{
  129. label:'全部',
  130. value:-1
  131. },{
  132. label:'待审核',
  133. value:0
  134. },{
  135. label:'审核失败',
  136. value:6
  137. },{
  138. label:'报名中',
  139. value:2
  140. },{
  141. label:'报名结束',
  142. value:3
  143. },{
  144. label:'活动中',
  145. value:4
  146. },{
  147. label:'活动结束',
  148. value:5
  149. }]
  150. }
  151. },
  152. onLoad(options) {
  153. this.getDataList()
  154. },
  155. onShow() {
  156. if(this.isReference){
  157. this.isReference = false
  158. this.page=1;
  159. this.isLoad = true
  160. this.getDataList()
  161. }
  162. },
  163. onReachBottom() {
  164. this.page++;
  165. this.getDataList();
  166. },
  167. methods: {
  168. jumpUrl(url) {
  169. uni.navigateTo({
  170. url: url
  171. })
  172. },
  173. toActivity(item){
  174. uni.navigateTo({
  175. url: '/match/activityDetail/activityDetail?id=' + item.id
  176. });
  177. },
  178. // 分页查询
  179. getDataList() {
  180. if (!this.isLoad) return false;
  181. this.isLoad = false;
  182. let queryParams = {
  183. page: this.page,
  184. limit: this.limit
  185. }
  186. if (this.searchVal) {
  187. queryParams.title = this.searchVal
  188. }
  189. queryParams.state = this.rangeList[this.rangeIndex].value
  190. if(queryParams.state==-1) delete queryParams.state
  191. req.getRequest('/api/match/yzlPage', queryParams, data => {
  192. data = data.list
  193. if (data != null && data.length == this.limit) {
  194. this.isLoad = true;
  195. }
  196. if (this.page == 1) {
  197. this.dataList = [];
  198. }
  199. if (this.page > 0) {
  200. data = this.dataList.concat(data);
  201. }
  202. this.dataList = data;
  203. console.log('列表数据>>>', this.dataList);
  204. })
  205. },
  206. // 搜索
  207. searchFn() {
  208. this.page = 1;
  209. this.isLoad = true;
  210. this.getDataList();
  211. },
  212. monthDayDiff(date) {
  213. return util.monthDayDiff(date)
  214. },
  215. review(item,index){
  216. this.clickItem = item
  217. this.clickIndex = index
  218. this.tempData = item.refuse?item.refuse:''
  219. this.showPop = true
  220. },
  221. pass(){
  222. uni.showModal({
  223. title:'提示',
  224. content:"是否确定通过该活动审核",
  225. success: (res) => {
  226. if(res.confirm){
  227. req.postRequest('/api/match/examine',{id:this.clickItem.id,state:1},data=>{
  228. req.msg("活动已通过审核")
  229. this.dataList[this.clickIndex].state = 2
  230. this.dataList[this.clickIndex].stateName = '报名中'
  231. this.clickIndex = -1
  232. this.clickItem = {}
  233. this.tempData = ''
  234. this.showPop = false
  235. })
  236. }
  237. }
  238. })
  239. },
  240. unpass(){
  241. if(!this.tempData){
  242. return req.msg("请填写活动不通过原因")
  243. }
  244. uni.showModal({
  245. title:'提示',
  246. content:"是否确定不通过该活动审核",
  247. success: (res) => {
  248. if(res.confirm){
  249. req.postRequest('/api/match/examine',{id:this.clickItem.id,state:6,refuse:this.tempData},data=>{
  250. req.msg("活动未通过审核")
  251. this.dataList[this.clickIndex].state = 6
  252. this.dataList[this.clickIndex].stateName = '审核失败'
  253. this.dataList[this.clickIndex].refuse = this.tempData
  254. this.clickIndex = -1
  255. this.clickItem = {}
  256. this.tempData = ''
  257. this.showPop = false
  258. })
  259. }
  260. }
  261. })
  262. },
  263. rangeChange(e){
  264. this.rangeIndex = e.detail.value
  265. this.page = 1;
  266. this.isLoad = true;
  267. this.getDataList();
  268. }
  269. }
  270. }
  271. </script>
  272. <style>
  273. @import "./matchList.css";
  274. </style>