record-list.vue 16 KB

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