report-list.vue 15 KB

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