stayClub-list.vue 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404
  1. <template>
  2. <view class="container club 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="searchInputVal"
  10. @input="onShowClose"
  11. @confirm="initclubList()"
  12. placeholder="机构名称/手机号"
  13. maxlength="16"/>
  14. <text class="iconfont icon-shanchu1" v-if="isShowClose" @click="delInputText()"></text>
  15. </view>
  16. <view class="search-btn">
  17. <button class="search-btn" type="default" @click.stop="searchClubList">搜索</button>
  18. </view>
  19. </view>
  20. <view class="club-main">
  21. <view v-if="isEmpty" class="empty-container">
  22. <image class="club-empty-image" src="https://img.caimei365.com/group1/M00/03/71/Cmis2F3wna6AY2ZjAABpmnBICH4247.png" mode="aspectFit"></image>
  23. <view class="txt">暂无机构数据</view>
  24. </view>
  25. <view v-else class="club-list">
  26. <scroll-view scroll-y="true" >
  27. <view class="list" v-for="(item, index) in clubList" :key="index">
  28. <view class="list-logo">
  29. <image :src="item.headpic ? item.headpic : 'https://static.caimei365.com/app/img/icon/icon-club@3x.png'" mode=""></image>
  30. </view>
  31. <view class="list-content">
  32. <view class="list-name">{{item.userIdentity ===2 ? item.name : item.linkMan}}</view>
  33. <view class="list-ntel">
  34. <text class="list-link">{{item.linkMan ? item.linkMan : ''}}</text>
  35. <text class="list-texl">{{item.contractMobile ? item.contractMobile : ''}}</text>
  36. </view>
  37. <view class="list-opera">
  38. <view class="btn yel" @click.stop="shareBindClub(item)">分享登录</view>
  39. <!-- <button class="btn org" @click.stop="checkData(item)">修改资料</button> -->
  40. <view class="btn gre" @click.stop="orderHistory(item)">删除</view>
  41. </view>
  42. </view>
  43. </view>
  44. <!--加载loadding-->
  45. <tui-loadmore :visible="loadding" :index="3" type="black"></tui-loadmore>
  46. <tui-nomore :visible="!pullUpOn" :backgroundColor="'#ffffff'" :text='nomoreText'></tui-nomore>
  47. <!--加载loadding-->
  48. </scroll-view>
  49. </view>
  50. </view>
  51. <!-- 分享弹窗 -->
  52. <shareModel v-if="isShareModal" :orderID="shareClubUseId" @shareConfirm ='onShareAppMessage'></shareModel>
  53. </view>
  54. </template>
  55. <script>
  56. import authorize from '@/common/config/authorize.js'
  57. import tuiLoadmore from "@/components/tui-components/loadmore/loadmore"
  58. import tuiNomore from "@/components/tui-components/nomore/nomore"
  59. import shareModel from '@/components/cm-module/modelAlert/shareModel.vue' //分享弹窗
  60. export default {
  61. components:{
  62. tuiLoadmore,
  63. tuiNomore,
  64. shareModel
  65. },
  66. data() {
  67. return {
  68. serviceProviderId:'',
  69. isShowClose:false,
  70. shareClubUseId:0,
  71. searchInputVal:'',
  72. isEmpty:false,
  73. nomoreText: '上拉显示更多',
  74. pageNum:1,
  75. pageSize:10,
  76. hasNextPage:false,
  77. loadding: false,
  78. pullUpOn: true,
  79. pullFlag: true,
  80. allowDataStatus:true,
  81. wrapperHeight:'100%',
  82. scrollHeight:'',
  83. deleteAddressId:'',
  84. currPage:'',//当前页面
  85. prevPage:'',//上一个页面
  86. tabCurrentIndex:0,
  87. listStatus:1,
  88. clubList:[],
  89. isIphoneX:this.$store.state.isIphoneX,
  90. isShareModal:false,
  91. }
  92. },
  93. onLoad(){
  94. this.setScrollHeight();
  95. },
  96. methods: {
  97. setScrollHeight() {
  98. // 窗口高度 - 底部距离
  99. setTimeout(()=> {
  100. const query = wx.createSelectorQuery().in(this);
  101. query.selectAll('.add-btn').boundingClientRect();
  102. query.exec(res => {
  103. if(res[0][0]){
  104. let winHeight = this.$api.getWindowHeight(),
  105. eleTop = res[0][0].top - 1;
  106. this.scrollHeight = eleTop;
  107. }
  108. })
  109. }, 500)
  110. },
  111. searchClubList(){
  112. this.pageNum=1
  113. this.initclubList()
  114. },
  115. initclubList(){
  116. let params = { searchWord:this.searchInputVal,pageNum:1,pageSize:this.pageSize }
  117. this.SellerService.GetFindAllClubList(params).then(response =>{
  118. let responseData = response.data
  119. if(responseData.results&&responseData.results.length > 0){
  120. this.isEmpty = false
  121. this.hasNextPage = response.data.hasNextPage
  122. this.clubList =responseData.results
  123. this.pullFlag = false;
  124. setTimeout(()=>{this.pullFlag = true;},500)
  125. if(this.hasNextPage){
  126. this.pullUpOn = false
  127. this.nomoreText = '上拉显示更多'
  128. }else{
  129. this.pullUpOn = true
  130. this.loadding = false
  131. this.nomoreText = '已至底部'
  132. }
  133. }else{
  134. this.isEmpty = true
  135. }
  136. }).catch(error =>{
  137. this.$util.msg(error.msg,2000)
  138. })
  139. },
  140. getOnReachBottomData(){
  141. this.pageNum+=1
  142. let params = {searchWord:this.searchInputVal,pageNum:this.pageNum,pageSize:this.pageSize }
  143. this.SellerService.GetFindAllClubList(params).then(response =>{
  144. let responseData = response.data
  145. if(responseData.results&&responseData.results.length > 0){
  146. this.hasNextPage = response.data.hasNextPage
  147. this.clubList = this.clubList.concat(responseData.results)
  148. this.pullFlag = false;// 防上拉暴滑
  149. setTimeout(()=>{this.pullFlag = true;},500)
  150. if(this.hasNextPage){
  151. this.pullUpOn = false
  152. this.nomoreText = '上拉显示更多'
  153. }else{
  154. this.pullUpOn = false
  155. this.loadding = false
  156. this.nomoreText = '已至底部'
  157. }
  158. }
  159. }).catch(error =>{
  160. this.$util.msg(error.msg,2000)
  161. })
  162. },
  163. shareBindClub(item){//分享登录
  164. this.shareClubUseId = item.id
  165. if(item.businessLicense){
  166. this.shareIdentity = 2
  167. }else{
  168. this.shareIdentity = 4
  169. }
  170. this.isShareModal = true
  171. },
  172. onShowClose () {//输入框失去焦点时触发
  173. if(this.searchInputVal != ''){
  174. this.isShowClose = true
  175. }else{
  176. this.isShowClose = false
  177. this.pageNum=1
  178. this.initclubList()
  179. }
  180. },
  181. delInputText(){//清除输入框内容
  182. this.searchInputVal = ''
  183. this.isShowClose = false
  184. this.pageNum=1
  185. this.initclubList()
  186. },
  187. hidePhone(val){
  188. let phone
  189. if(val==null || val==""){
  190. phone = ""
  191. }else{
  192. phone = this.$reg.hidePhone(val)
  193. }
  194. return phone
  195. },
  196. checkData (value){
  197. let data;
  198. if(value == null || value ==""){
  199. data = ''
  200. }else{
  201. data = value
  202. }
  203. return data
  204. },
  205. desensitizationName(val){
  206. let name = this.$reg.desensitizationName(val)
  207. return name
  208. }
  209. },
  210. onShareAppMessage(res){//分享转发
  211. this.isShareModal = false
  212. if (res.from === 'button') {
  213. // 来自页面内转发按钮
  214. }
  215. let path = `pages/login/binding?bindId=${this.shareClubUseId}&Identity=${this.shareIdentity}`
  216. console.log(path)
  217. return {
  218. title: '您已注册采美365网,请点击登录',
  219. path: path,
  220. imageUrl:'https://static.caimei365.com/app/img/icon/icon-addShare@3x.png'
  221. }
  222. },
  223. onReachBottom() {
  224. if(this.hasNextPage){
  225. this.loadding = true
  226. this.pullUpOn = true
  227. this.getOnReachBottomData()
  228. }
  229. },
  230. onShow() {
  231. this.$api.getStorage().then(response =>{
  232. this.serviceProviderId = response.serviceProviderId
  233. this.pageNum = 1;
  234. this.initclubList();
  235. })
  236. }
  237. }
  238. </script>
  239. <style lang='scss'>
  240. page {
  241. height: auto;
  242. }
  243. page,.container{
  244. /* padding-bottom: 120upx; */
  245. background: #F7F7F7;
  246. }
  247. .container{
  248. position: relative;
  249. }
  250. .club-search{
  251. height: 64rpx;
  252. width: 702rpx;
  253. padding: 24rpx;
  254. background: #FFFFFF;
  255. display: flex;
  256. align-items: center;
  257. position: fixed;
  258. top: 0;
  259. left: 0;
  260. z-index: 999;
  261. .search-from{
  262. width: 582rpx;
  263. height: 64rpx;
  264. background: #F7F7F7;
  265. border-radius: 32rpx;
  266. float: left;
  267. position: relative;
  268. .input{
  269. width: 500rpx;
  270. height: 64rpx;
  271. float: left;
  272. line-height: 64rpx;
  273. color: $text-color;
  274. font-size: $font-size-24;
  275. }
  276. .icon-iconfonticonfontsousuo1{
  277. width: 64rpx;
  278. height: 64rpx;
  279. line-height: 64rpx;
  280. text-align: center;
  281. display: block;
  282. font-size: $font-size-38;
  283. float: left;
  284. color: #999999;
  285. }
  286. .icon-shanchu1{
  287. font-size: $font-size-32;
  288. color: #999999;
  289. position: absolute;
  290. width: 64rpx;
  291. height: 64rpx;
  292. line-height: 64rpx;
  293. text-align: center;
  294. top: 0;
  295. right: 0;
  296. z-index: 10;
  297. }
  298. }
  299. .search-btn{
  300. width: 120rpx;
  301. line-height: 64rpx;
  302. text-align: center;
  303. font-size: $font-size-28;
  304. color: $color-system;
  305. float: left;
  306. background: #FFFFFF;
  307. }
  308. }
  309. .club-main{
  310. padding-top: 132rpx;
  311. .list{
  312. width: 100%;
  313. height: 228rpx;
  314. padding: 24rpx;
  315. box-sizing: border-box;
  316. background: #FFFFFF;
  317. position: relative;
  318. border-bottom: 1px solid #EBEBEB;
  319. .list-logo{
  320. width: 180rpx;
  321. height: 180rpx;
  322. float: left;
  323. image{
  324. width: 180rpx;
  325. height: 180rpx;
  326. border-radius: 8rpx;
  327. }
  328. }
  329. .list-content{
  330. width: 498rpx;
  331. height: 180rpx;
  332. float: right;
  333. .list-name{
  334. width: 100%;
  335. height: 50rpx;
  336. float: left;
  337. line-height: 50rpx;
  338. text-align: left;
  339. font-size: $font-size-26;
  340. color: #333333;
  341. }
  342. .list-ntel{
  343. width: 100%;
  344. height: 50rpx;
  345. float: left;
  346. line-height: 50rpx;
  347. text-align: left;
  348. font-size: $font-size-26;
  349. color: #666666;
  350. .list-link{
  351. display: inline-block;
  352. float: left;
  353. margin-right: 40rpx;
  354. }
  355. .list-texl{
  356. display: inline-block;
  357. float: left;
  358. }
  359. }
  360. .list-opera{
  361. width: 100%;
  362. height: 60rpx;
  363. display: flex;
  364. color: #166CE1;
  365. flex-direction: row;
  366. align-items: center;
  367. float: left;
  368. margin-top: 20rpx;
  369. .btn{
  370. width: 160rpx;
  371. height: 60rpx;
  372. line-height: 60rpx;
  373. border-radius: 30rpx;
  374. font-size: $font-size-24;
  375. color: $text-color;
  376. text-align: center;
  377. margin:0 20rpx 0 0;
  378. position: relative;
  379. .opea-badge{
  380. position: absolute;
  381. right: -10rpx;
  382. top: -20rpx;
  383. }
  384. &.org{
  385. border: 1px solid #2769d5;
  386. color: #2769d5;
  387. }
  388. &.gre{
  389. border: 1px solid #e15616;
  390. color: #e15616;
  391. }
  392. &.yel{
  393. border: 1px solid #4ad04c;
  394. color: #4ad04c;
  395. }
  396. }
  397. }
  398. }
  399. }
  400. }
  401. </style>