report-list.vue 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658
  1. <template>
  2. <view class="container product clearfix">
  3. <view class="club-search clearfix">
  4. <view class="club-search-form">
  5. <view class="search-from name">
  6. <text class="iconfont icon-iconfonticonfontsousuo1"></text>
  7. <input
  8. class="input"
  9. type="text"
  10. confirm-type="search"
  11. v-model="listQuery.keyWord"
  12. @input="onShowClose"
  13. @confirm="userClubReportReportRemarks"
  14. placeholder="搜索商品名称 / 报备关键词"
  15. maxlength="16"
  16. />
  17. <text class="iconfont icon-shanchu1" v-if="isShowClose" @click="delInputText()"></text>
  18. </view>
  19. </view>
  20. </view>
  21. <view class="remarks-content" :style="{ paddingBottom: isIphoneX ? '220rpx' : '148rpx' }">
  22. <view :class="{ 'tui-order-list': scrollTop >= 0 }" class="clearfix">
  23. <!-- 空白页 -->
  24. <view class="empty-container" v-if="isEmpty">
  25. <image class="empty-container-image" :src="StaticUrl + '/icon/icon-remarks-empty@2x.png'"></image>
  26. <text class="error-text">暂无任何记录~</text>
  27. </view>
  28. <template v-else>
  29. <!-- 列表 -->
  30. <view
  31. class="tui-remarks-cell tui-mtop clearfix"
  32. v-for="(report, index) in reportList"
  33. :key="index"
  34. @click.stop="details(report.reportId)"
  35. >
  36. <view class="tui-remarks-title">
  37. <view class="tui-remarks-title-top">
  38. <view class="tui-remarks-time tt" :style="{ paddingLeft: report.newDeal === 1 ? '90rpx' : '0rpx' }">
  39. <text class="tags" v-if="report.newDeal === 1">新分配</text>
  40. {{ report.clubName }}
  41. </view>
  42. </view>
  43. <view class="tui-remarks-title-bot">
  44. <view class="tui-remarks-text-view">
  45. <view class="tui-remarks-text h"></text>报备人:{{ report.reportName }}</view>
  46. <view class="tui-remarks-text y">
  47. {{ report.addTime }}
  48. </view>
  49. </view>
  50. </view>
  51. <view class="tui-remarks-title-icon" :class="{
  52. reviewed: report.status == 1,
  53. approved: report.status == 2,
  54. failed: report.status == 3
  55. }">
  56. </view>
  57. </view>
  58. <view class="tui-remarks-content">
  59. <view class="tui-remarks-text" v-if="!report.productId">
  60. <view class="text">
  61. {{ report.reportText }}
  62. </view>
  63. </view>
  64. <view class="tui-remarks-goods" v-else>
  65. <view class="goods-image">
  66. <image
  67. :src="report.mainImage"
  68. mode=""
  69. ></image>
  70. </view>
  71. <view class="goods-main">
  72. <view class="name">
  73. {{ report.productName }}
  74. </view>
  75. <view class="shop">{{ report.reportText }}</view>
  76. </view>
  77. </view>
  78. </view>
  79. <view class="tui-remarks-button" v-if="report.createServiceProviderId === listQuery.serviceProviderId" >
  80. <view class="btn edit" @click.stop="handReportDetails(report.reportId)">查看关联咨询记录</view>
  81. <view class="btn del" @click.stop="deleteReport(report.reportId)"> 删除</view>
  82. </view>
  83. <view class="tui-remarks-button" v-else>
  84. <view class="btn none" @click.stop="handReportDetails(report.reportId)">查看关联咨询记录</view>
  85. </view>
  86. </view>
  87. <!--加载loadding-->
  88. <tui-loadmore :visible="loadding" :index="3" type="black" />
  89. <tui-nomore :visible="!pullUpOn" :backgroundColor="'#F7F7F7'" :text="nomoreText" />
  90. <!--加载loadding-->
  91. </template>
  92. </view>
  93. </view>
  94. <!-- 弹窗提示 -->
  95. <tui-modal
  96. :show="modal"
  97. @click="handleClick"
  98. @cancel="hideMobel"
  99. :content="contentModalText"
  100. :button="modalButton"
  101. color="#333"
  102. :size="32"
  103. shape="circle"
  104. :maskClosable="false"
  105. >
  106. </tui-modal>
  107. </view>
  108. </template>
  109. <script>
  110. import { mapState, mapMutations } from 'vuex'
  111. import cmRefereepopup from '../components/cm-refereepopup'
  112. import cmClubmodal from '../components/cm-clubmodal'
  113. import cmScreenDrawer from '../components/cm-screen-drawer'
  114. const defaultListQuery = {
  115. keyWord:'',
  116. manager:0,
  117. serviceProviderId: 0,
  118. pageNum: 1,
  119. pageSize: 10
  120. }
  121. export default {
  122. components: {
  123. cmRefereepopup,
  124. cmClubmodal,
  125. cmScreenDrawer
  126. },
  127. data() {
  128. return {
  129. StaticUrl: this.$Static,
  130. isIphoneX: this.$store.state.isIphoneX,
  131. modalButton: [
  132. {
  133. text: '取消',
  134. type: 'gray',
  135. plain: true //是否空心
  136. },
  137. {
  138. text: '确认',
  139. customStyle: {
  140. color: '#fff',
  141. bgColor: 'linear-gradient(90deg, #F28F31 0%, #FF5B00 100%)'
  142. },
  143. plain: false
  144. }
  145. ],
  146. totalRecord: 0,
  147. popupShow: true,
  148. popupShow1: false,
  149. listQuery: Object.assign({}, defaultListQuery),
  150. reportList: [],
  151. scrollTop: 0,
  152. isEmpty: false,
  153. loadding: false,
  154. pullUpOn: true,
  155. pullFlag: true,
  156. hasNextPage: false,
  157. navbarHeight: '',
  158. nomoreText: '上拉显示更多',
  159. contentModalText: '', //操作文字提示语句
  160. modal: false,
  161. questionMan: '',
  162. questionManId: '',
  163. handleReportId: 0,
  164. }
  165. },
  166. onLoad(option) {
  167. },
  168. computed: {
  169. ...mapState(['hasLogin', 'userInfo'])
  170. },
  171. methods: {
  172. ...mapMutations(['login', 'logout']),
  173. async init() {
  174. const userInfo = await this.$api.getStorage()
  175. this.listQuery.serviceProviderId = userInfo.serviceProviderId ? userInfo.serviceProviderId : 0
  176. this.listQuery.manager = userInfo.manager ? userInfo.manager : 0
  177. this.userClubReportReportRemarks()
  178. },
  179. userClubReportReportRemarks() {
  180. this.reportList = []
  181. this.listQuery.pageNum = 1
  182. this.UserService.userClubReportReportRemarks(this.listQuery)
  183. .then(response => {
  184. let data = response.data
  185. if (data.results && data.results.length > 0) {
  186. this.isEmpty = false
  187. this.hasNextPage = data.hasNextPage
  188. this.totalRecord = data.totalRecord
  189. this.reportList = data.results
  190. this.pullFlag = false
  191. setTimeout(() => {
  192. this.pullFlag = true
  193. }, 500)
  194. if (this.hasNextPage) {
  195. this.pullUpOn = false
  196. this.nomoreText = '上拉显示更多'
  197. } else {
  198. if (this.reportList.length < 8) {
  199. this.pullUpOn = true
  200. } else {
  201. this.pullUpOn = false
  202. this.loadding = false
  203. this.nomoreText = '已至底部'
  204. }
  205. }
  206. } else {
  207. this.isEmpty = true
  208. }
  209. this.isRequest = true
  210. })
  211. .catch(error => {
  212. console.log('=======>查询列表异常~')
  213. })
  214. },
  215. GetOnReachBottomData(index) {
  216. //上拉加载
  217. this.listQuery.pageNum += 1
  218. this.UserService.userClubReportReportRemarks(this.listQuery)
  219. .then(response => {
  220. let data = response.data
  221. if (data.results && data.results.length > 0) {
  222. this.hasNextPage = data.hasNextPage
  223. this.reportList = this.reportList.concat(data.results)
  224. this.pullFlag = false // 防上拉暴滑
  225. setTimeout(() => {
  226. this.pullFlag = true
  227. }, 500)
  228. if (this.hasNextPage) {
  229. this.pullUpOn = false
  230. this.nomoreText = '上拉显示更多'
  231. } else {
  232. this.pullUpOn = false
  233. this.loadding = false
  234. this.nomoreText = '已至底部'
  235. }
  236. }
  237. })
  238. .catch(error => {
  239. console.log('=======>查询列表异常~')
  240. })
  241. },
  242. deleteReport(reportId) {
  243. this.handleReportId = reportId
  244. this.modal = true
  245. this.contentModalText = '确定删除该报备吗?'
  246. },
  247. handReportDetails(reportId) {
  248. //跳转报备详情
  249. this.$api.navigateTo(`/pages/seller/remarks/relation-consult-list?reportId=${reportId}`)
  250. },
  251. handleClick(e) {
  252. //操作
  253. if (e.index == 1) {
  254. this.handleDelete()
  255. }
  256. this.modal = false
  257. },
  258. handleDelete() {
  259. //操作删除资料备注
  260. this.UserService.userClubReportDelete({
  261. reportId: this.handleReportId
  262. })
  263. .then(response => {
  264. this.$util.msg('已删除', 2000, true, 'success')
  265. setTimeout(() => {
  266. this.userClubReportReportRemarks()
  267. }, 2000)
  268. })
  269. .catch(error => {
  270. this.$util.msg(error.msg, 2000)
  271. })
  272. },
  273. onShowClose() {
  274. //输入框失去焦点时触发
  275. if (this.listQuery.keyWord != '') {
  276. this.isShowClose = true
  277. } else {
  278. this.isShowClose = false
  279. this.userClubReportReportRemarks()
  280. }
  281. },
  282. delInputText() {
  283. //清除输入框内容
  284. this.listQuery.keyWord = ''
  285. this.isShowClose = false
  286. this.listQuery.pageNum = 1
  287. this.userClubReportReportRemarks()
  288. },
  289. hideMobel() {
  290. this.modal = false
  291. },
  292. details(reportId) {
  293. this.$api.navigateTo(`/pages/seller/remarks/report-details?type=1&reportId=${reportId}`)
  294. }
  295. },
  296. onPageScroll(e) {
  297. //实时获取到滚动的值
  298. },
  299. onReachBottom() {
  300. if (this.hasNextPage) {
  301. this.loadding = true
  302. this.pullUpOn = true
  303. this.GetOnReachBottomData()
  304. }
  305. },
  306. onPullDownRefresh() {
  307. setTimeout(() => {
  308. this.listQuery.pageNum = 1
  309. uni.stopPullDownRefresh()
  310. }, 200)
  311. },
  312. onShow() {
  313. this.init()
  314. }
  315. }
  316. </script>
  317. <style lang="scss">
  318. @import '@/uni.scss';
  319. page {
  320. background: #f7f7f7;
  321. }
  322. .empty-container {
  323. z-index: 99;
  324. }
  325. .club-search {
  326. width: 100%;
  327. height: 112rpx;
  328. background: #ffffff;
  329. box-sizing: border-box;
  330. position: fixed;
  331. top: 0;
  332. left: 0;
  333. z-index: 100;
  334. .club-search-form {
  335. width: 100%;
  336. height: 112rpx;
  337. background: #ffffff;
  338. box-sizing: border-box;
  339. padding: 24rpx;
  340. float: left;
  341. .search-from {
  342. width: 100%;
  343. height: 100%;
  344. background: #f7f7f7;
  345. border-radius: 32rpx;
  346. float: left;
  347. position: relative;
  348. .input {
  349. width: 600rpx;
  350. height: 64rpx;
  351. float: left;
  352. line-height: 64rpx;
  353. color: $text-color;
  354. font-size: $font-size-24;
  355. }
  356. .icon-iconfonticonfontsousuo1 {
  357. width: 64rpx;
  358. height: 64rpx;
  359. line-height: 64rpx;
  360. text-align: center;
  361. display: block;
  362. font-size: $font-size-38;
  363. float: left;
  364. color: #999999;
  365. }
  366. .icon-shanchu1 {
  367. font-size: $font-size-32;
  368. color: #999999;
  369. position: absolute;
  370. width: 64rpx;
  371. height: 64rpx;
  372. line-height: 64rpx;
  373. text-align: center;
  374. top: 0;
  375. right: 0;
  376. z-index: 10;
  377. }
  378. }
  379. }
  380. }
  381. .remarks-content {
  382. width: 100%;
  383. height: auto;
  384. position: relative;
  385. padding: 0;
  386. box-sizing: border-box;
  387. padding: 24rpx;
  388. padding-top: 134rpx;
  389. .empty-container-image {
  390. width: 260rpx;
  391. height: 260rpx;
  392. margin-top: -300rpx;
  393. }
  394. .tui-remarks-cell {
  395. width: 100%;
  396. border-radius: 16rpx;
  397. margin-bottom: 24rpx;
  398. background: #FFFFFF;
  399. box-sizing: border-box;
  400. padding:0 24rpx 24rpx 24rpx;
  401. .tui-remarks-title {
  402. width: 100%;
  403. height: auto;
  404. box-sizing: border-box;
  405. padding: 20rpx 0;
  406. position: relative;
  407. .tui-remarks-title-icon{
  408. width: 128rpx;
  409. height: 128rpx;
  410. position: absolute;
  411. top: 0;
  412. right: 32rpx;
  413. &.reviewed{
  414. background: url(https://static.caimei365.com/app/img/icon/icon-verify1@2x.png);
  415. background-size: cover;
  416. }
  417. &.failed{
  418. background: url(https://static.caimei365.com/app/img/icon/icon-verify2@2x.png);
  419. background-size: cover;
  420. }
  421. &.approved{
  422. background: url(https://static.caimei365.com/app/img/icon/icon-verify3@2x.png);
  423. background-size: cover;
  424. }
  425. }
  426. .tui-remarks-title-top {
  427. width: 100%;
  428. height: 56rpx;
  429. line-height: 56rpx;
  430. .tui-remarks-time {
  431. float: left;
  432. position: relative;
  433. &.tt {
  434. width: 70%;
  435. font-size: $font-size-32;
  436. color: #333333;
  437. text-align: left;
  438. text-overflow: ellipsis;
  439. overflow: hidden;
  440. display: -webkit-box;
  441. -webkit-line-clamp: 1;
  442. line-clamp: 1;
  443. -webkit-box-orient: vertical;
  444. font-weight: bold;
  445. .tags{
  446. display: inline-block;
  447. padding: 0 10rpx;
  448. border-radius: 8rpx;
  449. line-height: 36rpx;
  450. font-size: 22rpx;
  451. background-color: #f94b4b;
  452. color: #ffffff;
  453. text-align: center;
  454. font-weight: normal;
  455. position: absolute;
  456. left: 0;
  457. top: 10rpx;
  458. }
  459. }
  460. }
  461. }
  462. .tui-remarks-title-bot {
  463. width: 100%;
  464. height: auto;
  465. .tui-remarks-text-view{
  466. width: 100%;
  467. height: 48rpx;
  468. .tui-remarks-text {
  469. width: 50%;
  470. height: 48rpx;
  471. line-height: 48rpx;
  472. box-sizing: border-box;
  473. text-align: left;
  474. font-size: $font-size-26;
  475. color: #999999;
  476. float: left;
  477. text-overflow: ellipsis;
  478. overflow: hidden;
  479. display: -webkit-box;
  480. -webkit-line-clamp: 1;
  481. line-clamp: 1;
  482. -webkit-box-orient: vertical;
  483. &.a{
  484. width: 100%;
  485. }
  486. &.y {
  487. text-align: right;
  488. }
  489. }
  490. }
  491. }
  492. }
  493. .tui-remarks-content {
  494. width: 100%;
  495. height: auto;
  496. box-sizing: border-box;
  497. padding-bottom: 32rpx;
  498. .tui-remarks-text{
  499. width: 100%;
  500. height: 180rpx;
  501. box-sizing: border-box;
  502. background-color: #F7F7F7;
  503. padding: 26rpx;
  504. .text{
  505. width: 100%;
  506. height: 100%;
  507. box-sizing: border-box;
  508. line-height: 42rpx;
  509. color: #333333;
  510. text-overflow: ellipsis;
  511. overflow: hidden;
  512. display: -webkit-box;
  513. -webkit-line-clamp: 3;
  514. line-clamp: 3;
  515. -webkit-box-orient: vertical;
  516. font-size: 30rpx;
  517. }
  518. }
  519. .tui-remarks-goods{
  520. width: 100%;
  521. height: 180rpx;
  522. box-sizing: border-box;
  523. background-color: #F7F7F7;
  524. padding: 26rpx;
  525. border-radius: 6rpx;
  526. .goods-image{
  527. width: 128rpx;
  528. height: 128rpx;
  529. float: left;
  530. image{
  531. width: 128rpx;
  532. height: 128rpx;
  533. display: block;
  534. border-radius: 4rpx;
  535. }
  536. }
  537. .goods-main{
  538. width: 475rpx;
  539. height: 128rpx;
  540. box-sizing: border-box;
  541. padding-left: 24rpx;
  542. float: right;
  543. .name{
  544. width: 100%;
  545. height: 48rpx;
  546. box-sizing: border-box;
  547. line-height: 48rpx;
  548. color: #333333;
  549. text-overflow: ellipsis;
  550. overflow: hidden;
  551. display: -webkit-box;
  552. -webkit-line-clamp: 1;
  553. line-clamp: 1;
  554. -webkit-box-orient: vertical;
  555. font-size: 26rpx;
  556. }
  557. .shop{
  558. line-height: 36rpx;
  559. color: #999999;
  560. font-size: 26rpx;
  561. text-overflow: ellipsis;
  562. overflow: hidden;
  563. display: -webkit-box;
  564. -webkit-line-clamp: 2;
  565. line-clamp: 2;
  566. -webkit-box-orient: vertical;
  567. font-size: 26rpx;
  568. }
  569. }
  570. }
  571. }
  572. .tui-remarks-button {
  573. width: 100%;
  574. height: 68rpx;
  575. border-top: 1px solid #E1E1E1;
  576. padding-top: 20rpx;
  577. .btn {
  578. width: 50%;
  579. line-height: 48rpx;
  580. box-sizing: border-box;
  581. text-align: center;
  582. font-size: $font-size-34;
  583. float: left;
  584. font-weight: bold;
  585. &.none{
  586. width: 100%;
  587. color: #1890F9;
  588. }
  589. &.edit{
  590. color: #1890F9;
  591. border-right: 1px solid #E1E1E1;
  592. }
  593. &.del{
  594. color: #F94B4B;
  595. }
  596. }
  597. }
  598. }
  599. }
  600. .tui-popup-box {
  601. position: relative;
  602. box-sizing: border-box;
  603. min-height: 100rpx;
  604. padding: 6rpx 24rpx;
  605. .tui-popup-content {
  606. padding-top: 30rpx;
  607. }
  608. }
  609. .tui-popup-btn {
  610. width: 100%;
  611. height: auto;
  612. float: left;
  613. box-sizing: border-box;
  614. margin-top: 30rpx;
  615. .tui-flex-1 {
  616. width: 100%;
  617. height: 84rpx;
  618. display: flex;
  619. .tui-button {
  620. flex: 1;
  621. line-height: 84rpx;
  622. font-size: $font-size-28;
  623. text-align: center;
  624. border-radius: 42rpx;
  625. padding: 0;
  626. margin: 0 15rpx;
  627. box-sizing: border-box;
  628. &.cancel {
  629. background: #ffe6dc;
  630. color: #FF5B00;
  631. }
  632. &.disabled {
  633. background: #e1e1e1;
  634. color: #ffffff;
  635. }
  636. &.confirm {
  637. background: $btn-confirm;
  638. color: #ffffff;
  639. }
  640. }
  641. .tui-button-text{
  642. width: 600rpx;
  643. height: 48rpx;
  644. line-height: 48rpx;
  645. text-align: center;
  646. color: #FF5B00;
  647. font-size: $font-size-26;
  648. margin: 0 auto;
  649. margin-top: 15rpx;
  650. }
  651. }
  652. }
  653. </style>