report-visitor-list.vue 18 KB

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