record-list.vue 17 KB

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