record-list.vue 16 KB

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