report-list.vue 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657
  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.serviceProviderId === 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"></tui-loadmore>
  89. <tui-nomore :visible="!pullUpOn" :backgroundColor="'#F7F7F7'" :text="nomoreText"></tui-nomore>
  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-module/cm-seller/cm-refereepopup'
  112. import cmClubmodal from '@/components/cm-module/cm-seller/cm-clubmodal'
  113. import cmScreenDrawer from '@/components/cm-module/cm-seller/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%, #E15616 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.userClubReportReportRemarks()
  177. },
  178. userClubReportReportRemarks() {
  179. this.reportList = []
  180. this.listQuery.pageNum = 1
  181. this.UserService.userClubReportReportRemarks(this.listQuery)
  182. .then(response => {
  183. let data = response.data
  184. if (data.results && data.results.length > 0) {
  185. this.isEmpty = false
  186. this.hasNextPage = data.hasNextPage
  187. this.totalRecord = data.totalRecord
  188. this.reportList = data.results
  189. this.pullFlag = false
  190. setTimeout(() => {
  191. this.pullFlag = true
  192. }, 500)
  193. if (this.hasNextPage) {
  194. this.pullUpOn = false
  195. this.nomoreText = '上拉显示更多'
  196. } else {
  197. if (this.reportList.length < 8) {
  198. this.pullUpOn = true
  199. } else {
  200. this.pullUpOn = false
  201. this.loadding = false
  202. this.nomoreText = '已至底部'
  203. }
  204. }
  205. } else {
  206. this.isEmpty = true
  207. }
  208. this.isRequest = true
  209. })
  210. .catch(error => {
  211. console.log('=======>查询列表异常~')
  212. })
  213. },
  214. GetOnReachBottomData(index) {
  215. //上拉加载
  216. this.listQuery.pageNum += 1
  217. this.UserService.userClubReportReportRemarks(this.listQuery)
  218. .then(response => {
  219. let data = response.data
  220. if (data.results && data.results.length > 0) {
  221. this.hasNextPage = data.hasNextPage
  222. this.reportList = this.reportList.concat(data.results)
  223. this.pullFlag = false // 防上拉暴滑
  224. setTimeout(() => {
  225. this.pullFlag = true
  226. }, 500)
  227. if (this.hasNextPage) {
  228. this.pullUpOn = false
  229. this.nomoreText = '上拉显示更多'
  230. } else {
  231. this.pullUpOn = false
  232. this.loadding = false
  233. this.nomoreText = '已至底部'
  234. }
  235. }
  236. })
  237. .catch(error => {
  238. console.log('=======>查询列表异常~')
  239. })
  240. },
  241. deleteReport(reportId) {
  242. this.handleReportId = reportId
  243. this.modal = true
  244. this.contentModalText = '确定删除该报备吗?'
  245. },
  246. handReportDetails(reportId) {
  247. //跳转报备详情
  248. this.$api.navigateTo(`/pages/seller/remarks/relation-consult-list?reportId=${reportId}`)
  249. },
  250. handleClick(e) {
  251. //操作
  252. if (e.index == 1) {
  253. this.handleDelete()
  254. }
  255. this.modal = false
  256. },
  257. handleDelete() {
  258. //操作删除资料备注
  259. this.UserService.userClubReportDelete({
  260. reportId: this.handleReportId
  261. })
  262. .then(response => {
  263. this.$util.msg('已删除', 2000, true, 'success')
  264. setTimeout(() => {
  265. this.userClubReportReportRemarks()
  266. }, 2000)
  267. })
  268. .catch(error => {
  269. this.$util.msg(error.msg, 2000)
  270. })
  271. },
  272. onShowClose() {
  273. //输入框失去焦点时触发
  274. if (this.listQuery.keyWord != '') {
  275. this.isShowClose = true
  276. } else {
  277. this.isShowClose = false
  278. this.userClubReportReportRemarks()
  279. }
  280. },
  281. delInputText() {
  282. //清除输入框内容
  283. this.listQuery.keyWord = ''
  284. this.isShowClose = false
  285. this.listQuery.pageNum = 1
  286. this.userClubReportReportRemarks()
  287. },
  288. hideMobel() {
  289. this.modal = false
  290. },
  291. details(reportId) {
  292. this.$api.navigateTo(`/pages/seller/remarks/report-details?type=1&reportId=${reportId}`)
  293. }
  294. },
  295. onPageScroll(e) {
  296. //实时获取到滚动的值
  297. },
  298. onReachBottom() {
  299. if (this.hasNextPage) {
  300. this.loadding = true
  301. this.pullUpOn = true
  302. this.GetOnReachBottomData()
  303. }
  304. },
  305. onPullDownRefresh() {
  306. setTimeout(() => {
  307. this.listQuery.pageNum = 1
  308. uni.stopPullDownRefresh()
  309. }, 200)
  310. },
  311. onShow() {
  312. this.init()
  313. }
  314. }
  315. </script>
  316. <style lang="scss">
  317. @import '@/uni.scss';
  318. page {
  319. background: #f7f7f7;
  320. }
  321. .empty-container {
  322. z-index: 99;
  323. }
  324. .club-search {
  325. width: 100%;
  326. height: 112rpx;
  327. background: #ffffff;
  328. box-sizing: border-box;
  329. position: fixed;
  330. top: 0;
  331. left: 0;
  332. z-index: 100;
  333. .club-search-form {
  334. width: 100%;
  335. height: 112rpx;
  336. background: #ffffff;
  337. box-sizing: border-box;
  338. padding: 24rpx;
  339. float: left;
  340. .search-from {
  341. width: 100%;
  342. height: 100%;
  343. background: #f7f7f7;
  344. border-radius: 32rpx;
  345. float: left;
  346. position: relative;
  347. .input {
  348. width: 600rpx;
  349. height: 64rpx;
  350. float: left;
  351. line-height: 64rpx;
  352. color: $text-color;
  353. font-size: $font-size-24;
  354. }
  355. .icon-iconfonticonfontsousuo1 {
  356. width: 64rpx;
  357. height: 64rpx;
  358. line-height: 64rpx;
  359. text-align: center;
  360. display: block;
  361. font-size: $font-size-38;
  362. float: left;
  363. color: #999999;
  364. }
  365. .icon-shanchu1 {
  366. font-size: $font-size-32;
  367. color: #999999;
  368. position: absolute;
  369. width: 64rpx;
  370. height: 64rpx;
  371. line-height: 64rpx;
  372. text-align: center;
  373. top: 0;
  374. right: 0;
  375. z-index: 10;
  376. }
  377. }
  378. }
  379. }
  380. .remarks-content {
  381. width: 100%;
  382. height: auto;
  383. position: relative;
  384. padding: 0;
  385. box-sizing: border-box;
  386. padding: 24rpx;
  387. padding-top: 134rpx;
  388. .empty-container-image {
  389. width: 260rpx;
  390. height: 260rpx;
  391. margin-top: -300rpx;
  392. }
  393. .tui-remarks-cell {
  394. width: 100%;
  395. border-radius: 16rpx;
  396. margin-bottom: 24rpx;
  397. background: #FFFFFF;
  398. box-sizing: border-box;
  399. padding:0 24rpx 24rpx 24rpx;
  400. .tui-remarks-title {
  401. width: 100%;
  402. height: auto;
  403. box-sizing: border-box;
  404. padding: 20rpx 0;
  405. position: relative;
  406. .tui-remarks-title-icon{
  407. width: 128rpx;
  408. height: 128rpx;
  409. position: absolute;
  410. top: 0;
  411. right: 32rpx;
  412. &.reviewed{
  413. background: url(https://static.caimei365.com/app/img/icon/icon-verify1@2x.png);
  414. background-size: cover;
  415. }
  416. &.failed{
  417. background: url(https://static.caimei365.com/app/img/icon/icon-verify2@2x.png);
  418. background-size: cover;
  419. }
  420. &.approved{
  421. background: url(https://static.caimei365.com/app/img/icon/icon-verify3@2x.png);
  422. background-size: cover;
  423. }
  424. }
  425. .tui-remarks-title-top {
  426. width: 100%;
  427. height: 56rpx;
  428. line-height: 56rpx;
  429. .tui-remarks-time {
  430. float: left;
  431. position: relative;
  432. &.tt {
  433. width: 70%;
  434. font-size: $font-size-32;
  435. color: #333333;
  436. text-align: left;
  437. text-overflow: ellipsis;
  438. overflow: hidden;
  439. display: -webkit-box;
  440. -webkit-line-clamp: 1;
  441. line-clamp: 1;
  442. -webkit-box-orient: vertical;
  443. font-weight: bold;
  444. .tags{
  445. display: inline-block;
  446. padding: 0 10rpx;
  447. border-radius: 8rpx;
  448. line-height: 36rpx;
  449. font-size: 22rpx;
  450. background-color: #f94b4b;
  451. color: #ffffff;
  452. text-align: center;
  453. font-weight: normal;
  454. position: absolute;
  455. left: 0;
  456. top: 10rpx;
  457. }
  458. }
  459. }
  460. }
  461. .tui-remarks-title-bot {
  462. width: 100%;
  463. height: auto;
  464. .tui-remarks-text-view{
  465. width: 100%;
  466. height: 48rpx;
  467. .tui-remarks-text {
  468. width: 50%;
  469. height: 48rpx;
  470. line-height: 48rpx;
  471. box-sizing: border-box;
  472. text-align: left;
  473. font-size: $font-size-26;
  474. color: #999999;
  475. float: left;
  476. text-overflow: ellipsis;
  477. overflow: hidden;
  478. display: -webkit-box;
  479. -webkit-line-clamp: 1;
  480. line-clamp: 1;
  481. -webkit-box-orient: vertical;
  482. &.a{
  483. width: 100%;
  484. }
  485. &.y {
  486. text-align: right;
  487. }
  488. }
  489. }
  490. }
  491. }
  492. .tui-remarks-content {
  493. width: 100%;
  494. height: auto;
  495. box-sizing: border-box;
  496. padding-bottom: 32rpx;
  497. .tui-remarks-text{
  498. width: 100%;
  499. height: 180rpx;
  500. box-sizing: border-box;
  501. background-color: #F7F7F7;
  502. padding: 26rpx;
  503. .text{
  504. width: 100%;
  505. height: 100%;
  506. box-sizing: border-box;
  507. line-height: 42rpx;
  508. color: #333333;
  509. text-overflow: ellipsis;
  510. overflow: hidden;
  511. display: -webkit-box;
  512. -webkit-line-clamp: 3;
  513. line-clamp: 3;
  514. -webkit-box-orient: vertical;
  515. font-size: 30rpx;
  516. }
  517. }
  518. .tui-remarks-goods{
  519. width: 100%;
  520. height: 180rpx;
  521. box-sizing: border-box;
  522. background-color: #F7F7F7;
  523. padding: 26rpx;
  524. border-radius: 6rpx;
  525. .goods-image{
  526. width: 128rpx;
  527. height: 128rpx;
  528. float: left;
  529. image{
  530. width: 128rpx;
  531. height: 128rpx;
  532. display: block;
  533. border-radius: 4rpx;
  534. }
  535. }
  536. .goods-main{
  537. width: 475rpx;
  538. height: 128rpx;
  539. box-sizing: border-box;
  540. padding-left: 24rpx;
  541. float: right;
  542. .name{
  543. width: 100%;
  544. height: 48rpx;
  545. box-sizing: border-box;
  546. line-height: 48rpx;
  547. color: #333333;
  548. text-overflow: ellipsis;
  549. overflow: hidden;
  550. display: -webkit-box;
  551. -webkit-line-clamp: 1;
  552. line-clamp: 1;
  553. -webkit-box-orient: vertical;
  554. font-size: 26rpx;
  555. }
  556. .shop{
  557. line-height: 36rpx;
  558. color: #999999;
  559. font-size: 26rpx;
  560. text-overflow: ellipsis;
  561. overflow: hidden;
  562. display: -webkit-box;
  563. -webkit-line-clamp: 2;
  564. line-clamp: 2;
  565. -webkit-box-orient: vertical;
  566. font-size: 26rpx;
  567. }
  568. }
  569. }
  570. }
  571. .tui-remarks-button {
  572. width: 100%;
  573. height: 68rpx;
  574. border-top: 1px solid #E1E1E1;
  575. padding-top: 20rpx;
  576. .btn {
  577. width: 50%;
  578. line-height: 48rpx;
  579. box-sizing: border-box;
  580. text-align: center;
  581. font-size: $font-size-34;
  582. float: left;
  583. font-weight: bold;
  584. &.none{
  585. width: 100%;
  586. color: #1890F9;
  587. }
  588. &.edit{
  589. color: #1890F9;
  590. border-right: 1px solid #E1E1E1;
  591. }
  592. &.del{
  593. color: #F94B4B;
  594. }
  595. }
  596. }
  597. }
  598. }
  599. .tui-popup-box {
  600. position: relative;
  601. box-sizing: border-box;
  602. min-height: 100rpx;
  603. padding: 6rpx 24rpx;
  604. .tui-popup-content {
  605. padding-top: 30rpx;
  606. }
  607. }
  608. .tui-popup-btn {
  609. width: 100%;
  610. height: auto;
  611. float: left;
  612. box-sizing: border-box;
  613. margin-top: 30rpx;
  614. .tui-flex-1 {
  615. width: 100%;
  616. height: 84rpx;
  617. display: flex;
  618. .tui-button {
  619. flex: 1;
  620. line-height: 84rpx;
  621. font-size: $font-size-28;
  622. text-align: center;
  623. border-radius: 42rpx;
  624. padding: 0;
  625. margin: 0 15rpx;
  626. box-sizing: border-box;
  627. &.cancel {
  628. background: #ffe6dc;
  629. color: #e15616;
  630. }
  631. &.disabled {
  632. background: #e1e1e1;
  633. color: #ffffff;
  634. }
  635. &.confirm {
  636. background: $btn-confirm;
  637. color: #ffffff;
  638. }
  639. }
  640. .tui-button-text{
  641. width: 600rpx;
  642. height: 48rpx;
  643. line-height: 48rpx;
  644. text-align: center;
  645. color: #E15616;
  646. font-size: $font-size-26;
  647. margin: 0 auto;
  648. margin-top: 15rpx;
  649. }
  650. }
  651. }
  652. </style>