list.vue 15 KB

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