customer-list.vue 11 KB

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