list.vue 16 KB

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