report-visitor-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="userReportVisitorRemarks"
  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">{{ report.questionMan }}</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" />
  86. <tui-nomore :visible="!pullUpOn" :backgroundColor="'#F7F7F7'" :text="nomoreText" />
  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. const defaultListQuery = {
  109. manager:0,
  110. keyWord:'',
  111. serviceProviderId: 0,
  112. pageNum: 1,
  113. pageSize: 10
  114. }
  115. export default {
  116. data() {
  117. return {
  118. StaticUrl: this.$Static,
  119. isIphoneX: this.$store.state.isIphoneX,
  120. modalButton: [
  121. {
  122. text: '取消',
  123. type: 'gray',
  124. plain: true //是否空心
  125. },
  126. {
  127. text: '确认',
  128. customStyle: {
  129. color: '#fff',
  130. bgColor: 'linear-gradient(90deg, #F28F31 0%, #FF5B00 100%)'
  131. },
  132. plain: false
  133. }
  134. ],
  135. totalRecord: 0,
  136. listQuery: Object.assign({}, defaultListQuery),
  137. reportList: [],
  138. scrollTop: 0,
  139. isEmpty: false,
  140. loadding: false,
  141. pullUpOn: true,
  142. pullFlag: true,
  143. hasNextPage: false,
  144. navbarHeight: '',
  145. nomoreText: '上拉显示更多',
  146. contentModalText: '', //操作文字提示语句
  147. modal: false,
  148. questionMan: '',
  149. questionManId: '',
  150. handleReportId: 0,
  151. }
  152. },
  153. onLoad(option) {
  154. },
  155. computed: {
  156. ...mapState(['hasLogin', 'userInfo'])
  157. },
  158. methods: {
  159. ...mapMutations(['login', 'logout']),
  160. async initGetlist() {
  161. const userInfo = await this.$api.getStorage()
  162. this.listQuery.serviceProviderId = userInfo.serviceProviderId ? userInfo.serviceProviderId : 0
  163. this.listQuery.manager = userInfo.manager ? userInfo.manager : 0
  164. this.userReportVisitorRemarks()
  165. },
  166. userReportVisitorRemarks() {
  167. this.reportList = []
  168. this.listQuery.pageNum = 1
  169. this.UserService.userReportVisitorRemarks(this.listQuery)
  170. .then(response => {
  171. let data = response.data
  172. if (data.results && data.results.length > 0) {
  173. this.isEmpty = false
  174. this.hasNextPage = data.hasNextPage
  175. this.totalRecord = data.totalRecord
  176. this.reportList = data.results
  177. this.pullFlag = false
  178. setTimeout(() => {
  179. this.pullFlag = true
  180. }, 500)
  181. if (this.hasNextPage) {
  182. this.pullUpOn = false
  183. this.nomoreText = '上拉显示更多'
  184. } else {
  185. if (this.reportList.length < 8) {
  186. this.pullUpOn = true
  187. } else {
  188. this.pullUpOn = false
  189. this.loadding = false
  190. this.nomoreText = '已至底部'
  191. }
  192. }
  193. } else {
  194. this.isEmpty = true
  195. }
  196. this.isRequest = true
  197. })
  198. .catch(error => {
  199. console.log('=======>查询列表异常~')
  200. })
  201. },
  202. GetOnReachBottomData(index) {
  203. //上拉加载
  204. this.listQuery.pageNum += 1
  205. this.UserService.userReportVisitorRemarks(this.listQuery)
  206. .then(response => {
  207. let data = response.data
  208. if (data.results && data.results.length > 0) {
  209. this.hasNextPage = data.hasNextPage
  210. this.reportList = this.reportList.concat(data.results)
  211. this.pullFlag = false // 防上拉暴滑
  212. setTimeout(() => {
  213. this.pullFlag = true
  214. }, 500)
  215. if (this.hasNextPage) {
  216. this.pullUpOn = false
  217. this.nomoreText = '上拉显示更多'
  218. } else {
  219. this.pullUpOn = false
  220. this.loadding = false
  221. this.nomoreText = '已至底部'
  222. }
  223. }
  224. })
  225. .catch(error => {
  226. console.log('=======>查询列表异常~')
  227. })
  228. },
  229. deleteReport(reportId) {
  230. this.handleReportId = reportId
  231. this.modal = true
  232. this.contentModalText = '确定删除该报备吗?'
  233. },
  234. handReportDetails(reportId) {
  235. //跳转报备关联记录
  236. this.$api.navigateTo(`/pages/seller/remarks/relation-visitor-list?reportId=${reportId}`)
  237. },
  238. handSearchConfirmData(data){
  239. //确定筛选
  240. this.listQuery.startAddTime = data.startAddTime
  241. this.listQuery.endAddTime = data.endAddTime
  242. this.listQuery.consult = data.consult
  243. this.listQuery.leaderId = data.leaderId
  244. this.listQuery.groupId = data.groupId
  245. this.listQuery.pinceSensitve = data.pinceSensitve
  246. this.listQuery.satisfied = data.satisfied
  247. this.listQuery.followup = data.followup
  248. console.log('确定筛选',this.listQuery)
  249. this.userReportVisitorRemarks()
  250. },
  251. handleClick(e) {
  252. //取消收藏
  253. if (e.index == 1) {
  254. this.handleDeleteUserLike()
  255. }
  256. this.modal = false
  257. },
  258. handleDeleteUserLike() {
  259. //操作删除资料备注
  260. this.UserService.userClubReportDelete({
  261. reportId: this.handleReportId
  262. })
  263. .then(response => {
  264. this.$util.msg('已删除', 2000, true, 'success')
  265. setTimeout(() => {
  266. this.userReportVisitorRemarks()
  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.listQuery.pageNum = 1
  280. this.userReportVisitorRemarks()
  281. }
  282. },
  283. delInputText() {
  284. //清除输入框内容
  285. this.listQuery.keyWord = ''
  286. this.isShowClose = false
  287. this.listQuery.pageNum = 1
  288. this.userReportVisitorRemarks()
  289. },
  290. hideMobel() {
  291. this.modal = false
  292. },
  293. details(reportId) {
  294. this.$api.navigateTo(`/pages/seller/remarks/report-details?type=2&reportId=${reportId}`)
  295. }
  296. },
  297. onPageScroll(e) {
  298. //实时获取到滚动的值
  299. },
  300. onReachBottom() {
  301. if (this.hasNextPage) {
  302. this.loadding = true
  303. this.pullUpOn = true
  304. this.GetOnReachBottomData()
  305. }
  306. },
  307. onPullDownRefresh() {
  308. setTimeout(() => {
  309. this.listQuery.pageNum = 1
  310. uni.stopPullDownRefresh()
  311. }, 200)
  312. },
  313. onShow() {
  314. this.initGetlist()
  315. }
  316. }
  317. </script>
  318. <style lang="scss">
  319. @import '@/uni.scss';
  320. page {
  321. background: #f7f7f7;
  322. }
  323. .empty-container {
  324. z-index: 99;
  325. }
  326. .club-search {
  327. width: 100%;
  328. height: 112rpx;
  329. background: #ffffff;
  330. box-sizing: border-box;
  331. position: fixed;
  332. top: 0;
  333. left: 0;
  334. z-index: 100;
  335. .club-search-form {
  336. width: 100%;
  337. height: 112rpx;
  338. background: #ffffff;
  339. box-sizing: border-box;
  340. padding: 24rpx;
  341. float: left;
  342. .search-from {
  343. width: 100%;
  344. height: 100%;
  345. background: #f7f7f7;
  346. border-radius: 32rpx;
  347. float: left;
  348. position: relative;
  349. .input {
  350. width: 600rpx;
  351. height: 64rpx;
  352. float: left;
  353. line-height: 64rpx;
  354. color: $text-color;
  355. font-size: $font-size-24;
  356. }
  357. .icon-iconfonticonfontsousuo1 {
  358. width: 64rpx;
  359. height: 64rpx;
  360. line-height: 64rpx;
  361. text-align: center;
  362. display: block;
  363. font-size: $font-size-38;
  364. float: left;
  365. color: #999999;
  366. }
  367. .icon-shanchu1 {
  368. font-size: $font-size-32;
  369. color: #999999;
  370. position: absolute;
  371. width: 64rpx;
  372. height: 64rpx;
  373. line-height: 64rpx;
  374. text-align: center;
  375. top: 0;
  376. right: 0;
  377. z-index: 10;
  378. }
  379. }
  380. }
  381. }
  382. .remarks-content {
  383. width: 100%;
  384. height: auto;
  385. position: relative;
  386. padding: 0;
  387. box-sizing: border-box;
  388. padding: 24rpx;
  389. padding-top: 134rpx;
  390. .empty-container-image {
  391. width: 260rpx;
  392. height: 260rpx;
  393. margin-top: -300rpx;
  394. }
  395. .tui-remarks-cell {
  396. width: 100%;
  397. border-radius: 16rpx;
  398. margin-bottom: 24rpx;
  399. background: #FFFFFF;
  400. box-sizing: border-box;
  401. padding:0 24rpx 24rpx 24rpx;
  402. .tui-remarks-title {
  403. width: 100%;
  404. height: auto;
  405. box-sizing: border-box;
  406. padding: 20rpx 0;
  407. position: relative;
  408. .tui-remarks-title-icon{
  409. width: 128rpx;
  410. height: 128rpx;
  411. position: absolute;
  412. top: 0;
  413. right: 32rpx;
  414. &.reviewed{
  415. background: url(https://static.caimei365.com/app/img/icon/icon-verify1@2x.png);
  416. background-size: cover;
  417. }
  418. &.failed{
  419. background: url(https://static.caimei365.com/app/img/icon/icon-verify2@2x.png);
  420. background-size: cover;
  421. }
  422. &.approved{
  423. background: url(https://static.caimei365.com/app/img/icon/icon-verify3@2x.png);
  424. background-size: cover;
  425. }
  426. }
  427. .tui-remarks-title-top {
  428. width: 100%;
  429. height: 56rpx;
  430. line-height: 56rpx;
  431. .tui-remarks-time {
  432. float: left;
  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. float: left;
  455. margin-right: 10rpx;
  456. margin-top: 10rpx;
  457. font-weight: normal;
  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. border-radius: 6rpx;
  505. line-height: 42rpx;
  506. color: #333333;
  507. text-overflow: ellipsis;
  508. overflow: hidden;
  509. display: -webkit-box;
  510. -webkit-line-clamp: 3;
  511. line-clamp: 3;
  512. -webkit-box-orient: vertical;
  513. font-size: 30rpx;
  514. }
  515. .tui-remarks-goods{
  516. width: 100%;
  517. height: 180rpx;
  518. box-sizing: border-box;
  519. background-color: #F7F7F7;
  520. padding: 26rpx;
  521. border-radius: 6rpx;
  522. .goods-image{
  523. width: 128rpx;
  524. height: 128rpx;
  525. float: left;
  526. image{
  527. width: 128rpx;
  528. height: 128rpx;
  529. display: block;
  530. border-radius: 4rpx;
  531. }
  532. }
  533. .goods-main{
  534. width: 475rpx;
  535. height: 128rpx;
  536. box-sizing: border-box;
  537. padding-left: 24rpx;
  538. float: right;
  539. .name{
  540. width: 100%;
  541. height: 48rpx;
  542. box-sizing: border-box;
  543. line-height: 48rpx;
  544. color: #333333;
  545. text-overflow: ellipsis;
  546. overflow: hidden;
  547. display: -webkit-box;
  548. -webkit-line-clamp: 1;
  549. line-clamp: 1;
  550. -webkit-box-orient: vertical;
  551. font-size: 26rpx;
  552. }
  553. .shop{
  554. line-height: 36rpx;
  555. color: #999999;
  556. font-size: 26rpx;
  557. text-overflow: ellipsis;
  558. overflow: hidden;
  559. display: -webkit-box;
  560. -webkit-line-clamp: 2;
  561. line-clamp: 2;
  562. -webkit-box-orient: vertical;
  563. font-size: 26rpx;
  564. }
  565. }
  566. }
  567. }
  568. .tui-remarks-button {
  569. width: 100%;
  570. height: 68rpx;
  571. border-top: 1px solid #E1E1E1;
  572. padding-top: 20rpx;
  573. .btn {
  574. width: 50%;
  575. line-height: 48rpx;
  576. box-sizing: border-box;
  577. text-align: center;
  578. font-size: $font-size-34;
  579. float: left;
  580. font-weight: bold;
  581. &.none{
  582. width: 100%;
  583. color: #1890F9;
  584. }
  585. &.edit{
  586. color: #1890F9;
  587. border-right: 1px solid #E1E1E1;
  588. }
  589. &.del{
  590. color: #F94B4B;
  591. }
  592. }
  593. }
  594. }
  595. }
  596. .tui-popup-box {
  597. position: relative;
  598. box-sizing: border-box;
  599. min-height: 100rpx;
  600. padding: 6rpx 24rpx;
  601. .tui-popup-content {
  602. padding-top: 30rpx;
  603. }
  604. }
  605. .tui-popup-btn {
  606. width: 100%;
  607. height: auto;
  608. float: left;
  609. box-sizing: border-box;
  610. margin-top: 30rpx;
  611. .tui-flex-1 {
  612. width: 100%;
  613. height: 84rpx;
  614. display: flex;
  615. .tui-button {
  616. flex: 1;
  617. line-height: 84rpx;
  618. font-size: $font-size-28;
  619. text-align: center;
  620. border-radius: 42rpx;
  621. padding: 0;
  622. margin: 0 15rpx;
  623. box-sizing: border-box;
  624. &.cancel {
  625. background: #ffe6dc;
  626. color: #FF5B00;
  627. }
  628. &.disabled {
  629. background: #e1e1e1;
  630. color: #ffffff;
  631. }
  632. &.confirm {
  633. background: $btn-confirm;
  634. color: #ffffff;
  635. }
  636. }
  637. .tui-button-text{
  638. width: 600rpx;
  639. height: 48rpx;
  640. line-height: 48rpx;
  641. text-align: center;
  642. color: #FF5B00;
  643. font-size: $font-size-26;
  644. margin: 0 auto;
  645. margin-top: 15rpx;
  646. }
  647. }
  648. }
  649. </style>