customer-list.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460
  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>
  20. <view class="search-from-title"> 请选择一个咨询人,将他所有的咨询记录同步到一个机构中去 </view>
  21. </view>
  22. <view class="remarks-content" :style="{ paddingBottom: isIphoneX ? '216rpx' : '168rpx' }">
  23. <view :class="{ 'tui-order-list': scrollTop >= 0 }" class="clearfix">
  24. <!-- 空白页 -->
  25. <view class="empty-container" v-if="isEmpty">
  26. <image class="empty-container-image" :src="StaticUrl + '/icon/icon-remarks-empty@2x.png'"></image>
  27. <text class="error-text">暂无任何数据~</text>
  28. </view>
  29. <template v-else>
  30. <!-- 列表 -->
  31. <view class="tui-remarks-cell tui-mtop" v-for="(list, index) in remarksList" :key="index">
  32. <view class="tui-remarks-name" @click.stop="checkedCoustomer(list,index)">
  33. <view class="tui-remarks-name-le">{{ list.questionMan }}</view>
  34. <view class="tui-remarks-name-ri">
  35. <view
  36. class="checkbox iconfont"
  37. :class="[list.ischecked ? 'icon-yixuanze' : 'icon-weixuanze']"
  38. >
  39. </view>
  40. </view>
  41. </view>
  42. </view>
  43. <!--加载loadding-->
  44. <tui-loadmore :visible="loadding" :index="3" type="black"></tui-loadmore>
  45. <tui-nomore :visible="!pullUpOn" :backgroundColor="'#F7F7F7'" :text="nomoreText"></tui-nomore>
  46. <!--加载loadding-->
  47. </template>
  48. </view>
  49. </view>
  50. <!-- 下一步 -->
  51. <tui-bottom-popup :radius="false" :mask="false" :show="popupShow">
  52. <view class="tui-popup-box clearfix">
  53. <view class="tui-right-flex tui-popup-btn" :style="{ paddingBottom: isIphoneX ? '68rpx' : '34rpx' }">
  54. <view class="tui-flex-1">
  55. <view class="tui-button" @click="handleShowClubpopup">下一步</view>
  56. </view>
  57. </view>
  58. </view>
  59. </tui-bottom-popup>
  60. <!-- 添加记录 -->
  61. <cm-clubpopup
  62. ref="clubpopup"
  63. v-if="isClubpopupShow"
  64. :show="isClubpopupShow"
  65. @handleChoiceaClub="handleChoiceaClubData"
  66. >
  67. </cm-clubpopup>
  68. </view>
  69. </template>
  70. <script>
  71. import cmClubpopup from '@/components/cm-module/cm-seller/cm-clubpopup'
  72. import { mapState, mapMutations } from 'vuex'
  73. const defaultListQuery = {
  74. serviceProviderId: 0,
  75. pageNum: 1,
  76. pageSize: 10
  77. }
  78. export default {
  79. components: {
  80. cmClubpopup
  81. },
  82. data() {
  83. return {
  84. StaticUrl: this.$Static,
  85. isIphoneX: this.$store.state.isIphoneX,
  86. modalButton: [
  87. {
  88. text: '取消',
  89. type: 'gray',
  90. plain: true //是否空心
  91. },
  92. {
  93. text: '确认',
  94. customStyle: {
  95. color: '#fff',
  96. bgColor: 'linear-gradient(90deg, #F28F31 0%, #E15616 100%)'
  97. },
  98. plain: false
  99. }
  100. ],
  101. totalRecord: 0,
  102. popupShow: true,
  103. popupShow1: false,
  104. listQuery: Object.assign({}, defaultListQuery),
  105. remarksList: [],
  106. scrollTop: 0,
  107. isEmpty: false,
  108. loadding: false,
  109. pullUpOn: true,
  110. pullFlag: true,
  111. hasNextPage: false,
  112. navbarHeight: '',
  113. nomoreText: '上拉显示更多',
  114. handleUpdataVisitorId: 0,
  115. modalType: 1,
  116. checkedIndex: 0,
  117. isClubModalShow: false,
  118. isClubpopupShow: false
  119. }
  120. },
  121. onLoad() {},
  122. filters: {
  123. NumFormat: function(value) {
  124. //处理金额
  125. if (!value) return '0.00'
  126. let number = Number(value).toFixed(2)
  127. return number
  128. }
  129. },
  130. computed: {
  131. ...mapState(['hasLogin', 'userInfo'])
  132. },
  133. methods: {
  134. ...mapMutations(['login', 'logout']),
  135. async initGetStotage() {
  136. const userInfo = await this.$api.getStorage()
  137. this.listQuery.serviceProviderId = userInfo.serviceProviderId ? userInfo.serviceProviderId : 0
  138. this.GetProductListInfo()
  139. },
  140. GetProductListInfo() {
  141. this.remarksList = []
  142. this.listQuery.pageNum = 1
  143. this.UserService.getUserClubVisitorList(this.listQuery)
  144. .then(response => {
  145. let data = response.data
  146. if (data.results && data.results.length > 0) {
  147. this.isEmpty = false
  148. this.hasNextPage = data.hasNextPage
  149. this.totalRecord = data.totalRecord
  150. this.remarksList = data.results.map((el,index)=>{
  151. el.ischecked = false
  152. return el
  153. })
  154. this.pullFlag = false
  155. setTimeout(() => {
  156. this.pullFlag = true
  157. }, 500)
  158. if (this.hasNextPage) {
  159. this.pullUpOn = false
  160. this.nomoreText = '上拉显示更多'
  161. } else {
  162. if (this.remarksList.length < 8) {
  163. this.pullUpOn = true
  164. } else {
  165. this.pullUpOn = false
  166. this.loadding = false
  167. this.nomoreText = '已至底部'
  168. }
  169. }
  170. } else {
  171. this.isEmpty = true
  172. }
  173. this.isRequest = true
  174. })
  175. .catch(error => {
  176. this.$util.msg(error.msg, 2000)
  177. })
  178. },
  179. GetOnReachBottomData(index) {
  180. //上拉加载
  181. this.listQuery.pageNum += 1
  182. this.UserService.getUserClubVisitorList(this.listQuery)
  183. .then(response => {
  184. let data = response.data
  185. if (data.results && data.results.length > 0) {
  186. this.hasNextPage = data.hasNextPage
  187. this.remarksList = this.remarksList.concat(data.results)
  188. this.pullFlag = false // 防上拉暴滑
  189. setTimeout(() => {
  190. this.pullFlag = true
  191. }, 500)
  192. if (this.hasNextPage) {
  193. this.pullUpOn = false
  194. this.nomoreText = '上拉显示更多'
  195. } else {
  196. this.pullUpOn = false
  197. this.loadding = false
  198. this.nomoreText = '已至底部'
  199. }
  200. }
  201. })
  202. .catch(error => {
  203. this.$util.msg(error.msg, 2000)
  204. })
  205. },
  206. handleShowClubpopup() {
  207. // 点击操作
  208. this.isClubpopupShow = true
  209. },
  210. handleChoiceaClubData(data){
  211. // 同步机构
  212. console.log('data',data)
  213. this.UserService.getUserRemarksConcactVisit(
  214. {
  215. clubId: data.clubId,
  216. questionManId:this.questionManId
  217. }
  218. )
  219. .then(response => {
  220. this.$util.msg('同步成功', 2000, true, 'success')
  221. setTimeout(() => {
  222. this.$api.redirectTo('/pages/seller/remarks/list')
  223. }, 2000)
  224. })
  225. .catch(error => {
  226. this.$util.msg(error.msg, 2000)
  227. })
  228. },
  229. onShowClose() {
  230. //输入框失去焦点时触发
  231. if (this.listQuery.keyWord != '') {
  232. this.isShowClose = true
  233. } else {
  234. this.isShowClose = false
  235. this.listQuery.pageNum = 1
  236. this.GetProductListInfo()
  237. }
  238. },
  239. delInputText() {
  240. //清除输入框内容
  241. this.listQuery.keyWord = ''
  242. this.isShowClose = false
  243. this.listQuery.pageNum = 1
  244. this.GetProductListInfo()
  245. },
  246. checkedCoustomer(list,idx) {
  247. // 选择机构
  248. this.checkedIndex = idx
  249. this.remarksList.forEach((el, index) => {
  250. if (this.checkedIndex == index) {
  251. el.ischecked = !el.ischecked
  252. this.questionManId = el.questionManId
  253. } else {
  254. el.ischecked = false
  255. }
  256. })
  257. },
  258. },
  259. onPageScroll(e) {
  260. //实时获取到滚动的值
  261. },
  262. onReachBottom() {
  263. if (this.hasNextPage) {
  264. this.loadding = true
  265. this.pullUpOn = true
  266. this.GetOnReachBottomData()
  267. }
  268. },
  269. onPullDownRefresh() {
  270. setTimeout(() => {
  271. this.listQuery.pageNum = 1
  272. uni.stopPullDownRefresh()
  273. }, 200)
  274. },
  275. onShow() {
  276. this.initGetStotage()
  277. }
  278. }
  279. </script>
  280. <style lang="scss">
  281. @import '@/uni.scss';
  282. page {
  283. background: #FFFFFF;
  284. }
  285. .empty-container {
  286. z-index: 99;
  287. }
  288. .club-search {
  289. width: 100%;
  290. height: 192rpx;
  291. background: #ffffff;
  292. box-sizing: border-box;
  293. position: fixed;
  294. top: 0;
  295. left: 0;
  296. z-index: 100;
  297. .search-from-title {
  298. width: 100%;
  299. height: 80rpx;
  300. line-height: 80rpx;
  301. box-sizing: border-box;
  302. padding: 0 24rpx;
  303. font-size: $font-size-26;
  304. float: left;
  305. color: #1890f9;
  306. background-color: #f2f9ff;
  307. font-weight: normal;
  308. }
  309. .club-search-form {
  310. width: 100%;
  311. height: 112rpx;
  312. background: #ffffff;
  313. box-sizing: border-box;
  314. padding: 24rpx;
  315. float: left;
  316. .search-from {
  317. width: 100%;
  318. height: 100%;
  319. background: #f7f7f7;
  320. border-radius: 32rpx;
  321. float: left;
  322. position: relative;
  323. .input {
  324. width: 500rpx;
  325. height: 64rpx;
  326. float: left;
  327. line-height: 64rpx;
  328. color: $text-color;
  329. font-size: $font-size-24;
  330. }
  331. .icon-iconfonticonfontsousuo1 {
  332. width: 64rpx;
  333. height: 64rpx;
  334. line-height: 64rpx;
  335. text-align: center;
  336. display: block;
  337. font-size: $font-size-38;
  338. float: left;
  339. color: #999999;
  340. }
  341. .icon-shanchu1 {
  342. font-size: $font-size-32;
  343. color: #999999;
  344. position: absolute;
  345. width: 64rpx;
  346. height: 64rpx;
  347. line-height: 64rpx;
  348. text-align: center;
  349. top: 0;
  350. right: 0;
  351. z-index: 10;
  352. }
  353. }
  354. }
  355. }
  356. .remarks-content {
  357. width: 100%;
  358. height: auto;
  359. position: relative;
  360. padding: 0;
  361. box-sizing: border-box;
  362. padding: 24rpx;
  363. padding-top: 212rpx;
  364. .empty-container-image {
  365. width: 260rpx;
  366. height: 260rpx;
  367. margin-top: -300rpx;
  368. }
  369. .tui-remarks-cell {
  370. width: 100%;
  371. border-radius: 16rpx;
  372. background: #ffffff;
  373. box-sizing: border-box;
  374. .tui-remarks-name {
  375. width: 100%;
  376. height: 100rpx;
  377. border-bottom: 1px solid #e1e1e1;
  378. .tui-remarks-name-le {
  379. float: left;
  380. line-height: 100rpx;
  381. font-size: $font-size-28;
  382. color: #333333;
  383. text-align: left;
  384. font-weight: bold;
  385. }
  386. .tui-remarks-name-ri {
  387. width: 40rpx;
  388. height: 100%;
  389. float: right;
  390. .checkbox {
  391. width: 40rpx;
  392. line-height: 128rpx;
  393. float: right;
  394. box-sizing: border-box;
  395. text-align: center;
  396. text-decoration: none;
  397. -webkit-tap-highlight-color: transparent;
  398. overflow: hidden;
  399. font-size: $font-size-34;
  400. &.icon-weixuanze {
  401. color: #b2b2b2;
  402. }
  403. &.icon-yixuanze {
  404. color: #e15616;
  405. }
  406. }
  407. }
  408. }
  409. .tui-remarks-button {
  410. width: 100%;
  411. height: 100rpx;
  412. line-height: 100rpx;
  413. box-sizing: border-box;
  414. text-align: center;
  415. font-size: $font-size-30;
  416. float: left;
  417. font-weight: bold;
  418. color: #1890f9;
  419. }
  420. }
  421. }
  422. .tui-popup-box {
  423. position: relative;
  424. box-sizing: border-box;
  425. min-height: 100rpx;
  426. padding: 6rpx 24rpx;
  427. .tui-popup-content {
  428. padding-top: 30rpx;
  429. }
  430. }
  431. .tui-popup-btn {
  432. width: 100%;
  433. height: auto;
  434. float: left;
  435. box-sizing: border-box;
  436. margin-top: 30rpx;
  437. .tui-button {
  438. width: 600rpx;
  439. height: 88rpx;
  440. background: $btn-confirm;
  441. line-height: 88rpx;
  442. text-align: center;
  443. color: #ffffff;
  444. font-size: $font-size-28;
  445. border-radius: 44rpx;
  446. margin: 0 auto;
  447. }
  448. .tui-button-text {
  449. width: 600rpx;
  450. height: 48rpx;
  451. line-height: 48rpx;
  452. text-align: center;
  453. color: #e15616;
  454. font-size: $font-size-26;
  455. margin: 0 auto;
  456. }
  457. }
  458. </style>