list.vue 15 KB

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