stayClub-list.vue 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426
  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="listQuery.searchName"
  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.contractEmail ? 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.bindMobile ? item.bindMobile : ''}}</text>
  36. </view>
  37. <view class="list-opera">
  38. <!-- <button class="btn org" @click.stop="checkData(item)">修改资料</button> -->
  39. <view class="btn yel" @click.stop="shareBindClub(item)">分享登录</view>
  40. <view class="btn gre" @click.stop="deleteWatingClub(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" :bindId="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. isShowClose:false,
  69. shareClubUseId:0,
  70. listQuery:{
  71. searchName:'',
  72. pageNum:1,
  73. pageSize:10,
  74. userId:0,
  75. },
  76. isEmpty:false,
  77. nomoreText: '上拉显示更多',
  78. hasNextPage:false,
  79. loadding: false,
  80. pullUpOn: true,
  81. pullFlag: true,
  82. allowDataStatus:true,
  83. wrapperHeight:'100%',
  84. scrollHeight:'',
  85. deleteAddressId:'',
  86. currPage:'',//当前页面
  87. prevPage:'',//上一个页面
  88. tabCurrentIndex:0,
  89. listStatus:1,
  90. clubList:[],
  91. isIphoneX:this.$store.state.isIphoneX,
  92. isShareModal:false,
  93. }
  94. },
  95. onLoad(){
  96. this.setScrollHeight();
  97. },
  98. methods: {
  99. setScrollHeight() {
  100. // 窗口高度 - 底部距离
  101. setTimeout(()=> {
  102. const query = wx.createSelectorQuery().in(this);
  103. query.selectAll('.add-btn').boundingClientRect();
  104. query.exec(res => {
  105. if(res[0][0]){
  106. let winHeight = this.$api.getWindowHeight(),
  107. eleTop = res[0][0].top - 1;
  108. this.scrollHeight = eleTop;
  109. }
  110. })
  111. }, 500)
  112. },
  113. searchClubList(){
  114. this.listQuery.pageNum=1
  115. this.initclubList()
  116. },
  117. initclubList(){
  118. this.UserService.SellerUserTemporaryClub(this.listQuery)
  119. .then(response =>{
  120. let responseData = response.data
  121. if(responseData.list&&responseData.list.length > 0){
  122. this.isEmpty = false
  123. this.hasNextPage = response.data.hasNextPage
  124. this.clubList =responseData.list
  125. this.pullFlag = false;
  126. setTimeout(()=>{this.pullFlag = true;},500)
  127. if(this.hasNextPage){
  128. this.pullUpOn = false
  129. this.nomoreText = '上拉显示更多'
  130. }else{
  131. this.pullUpOn = true
  132. this.loadding = false
  133. this.nomoreText = '已至底部'
  134. }
  135. }else{
  136. this.isEmpty = true
  137. }
  138. })
  139. .catch(error =>{
  140. this.$util.msg(error.msg,2000)
  141. })
  142. },
  143. getOnReachBottomData(){
  144. this.listQuery.pageNum+=1
  145. this.UserService.SellerUserTemporaryClub(this.listQuery)
  146. .then(response =>{
  147. let responseData = response.data
  148. if(responseData.list&&responseData.list.length > 0){
  149. this.hasNextPage = response.data.hasNextPage
  150. this.clubList = this.clubList.concat(responseData.list)
  151. this.pullFlag = false;// 防上拉暴滑
  152. setTimeout(()=>{this.pullFlag = true;},500)
  153. if(this.hasNextPage){
  154. this.pullUpOn = false
  155. this.nomoreText = '上拉显示更多'
  156. }else{
  157. this.pullUpOn = false
  158. this.loadding = false
  159. this.nomoreText = '已至底部'
  160. }
  161. }
  162. })
  163. .catch(error =>{
  164. this.$util.msg(error.msg,2000)
  165. })
  166. },
  167. deleteWatingClub(item){
  168. this.$util.modal('提示','确定删除改机构数据吗?删除后需要重新拉机构上线','确定','取消',true,() =>{
  169. this.UserService.SellerDeleteUserTemporaryClub(
  170. {
  171. id:item.id,
  172. }
  173. )
  174. .then(response =>{
  175. this.$util.msg('删除成功',2000,true,'success')
  176. setTimeout(()=>{
  177. this.searchClubList();
  178. },2000)
  179. })
  180. .catch(error =>{
  181. this.$util.msg(error.msg,2000)
  182. })
  183. })
  184. },
  185. shareBindClub(item){//分享登录
  186. this.shareClubUseId = item.id
  187. if(item.contractEmail){
  188. this.shareIdentity = 2
  189. }else{
  190. this.shareIdentity = 4
  191. }
  192. this.isShareModal = true
  193. },
  194. onShowClose () {//输入框失去焦点时触发
  195. if(this.listQuery.searchName != ''){
  196. this.isShowClose = true
  197. }else{
  198. this.isShowClose = false
  199. this.listQuery.pageNum=1
  200. this.initclubList()
  201. }
  202. },
  203. delInputText(){//清除输入框内容
  204. this.listQuery.searchName = ''
  205. this.isShowClose = false
  206. this.listQuery.pageNum=1
  207. this.initclubList()
  208. },
  209. hidePhone(val){
  210. let phone
  211. if(val==null || val==""){
  212. phone = ""
  213. }else{
  214. phone = this.$reg.hidePhone(val)
  215. }
  216. return phone
  217. },
  218. checkData (value){
  219. let data;
  220. if(value == null || value ==""){
  221. data = ''
  222. }else{
  223. data = value
  224. }
  225. return data
  226. },
  227. desensitizationName(val){
  228. let name = this.$reg.desensitizationName(val)
  229. return name
  230. }
  231. },
  232. onShareAppMessage(res){//分享转发
  233. this.isShareModal = false
  234. if (res.from === 'button') {
  235. // 来自页面内转发按钮
  236. }
  237. let path = `pages/login/binding?bindId=${this.shareClubUseId}&Identity=${this.shareIdentity}`
  238. console.log(path)
  239. return {
  240. title: '请确认资料完成注册~',
  241. path: path,
  242. imageUrl:'https://static.caimei365.com/app/img/icon/icon-addShare@3x.png'
  243. }
  244. },
  245. onReachBottom() {
  246. if(this.hasNextPage){
  247. this.loadding = true
  248. this.pullUpOn = true
  249. this.getOnReachBottomData()
  250. }
  251. },
  252. onShow() {
  253. this.$api.getStorage().then(response =>{
  254. this.listQuery.userId = response.userId
  255. this.listQuery.pageNum = 1;
  256. this.initclubList();
  257. })
  258. }
  259. }
  260. </script>
  261. <style lang='scss'>
  262. page {
  263. height: auto;
  264. }
  265. page,.container{
  266. /* padding-bottom: 120upx; */
  267. background: #F7F7F7;
  268. }
  269. .container{
  270. position: relative;
  271. }
  272. .club-search{
  273. height: 64rpx;
  274. width: 702rpx;
  275. padding: 24rpx;
  276. background: #FFFFFF;
  277. display: flex;
  278. align-items: center;
  279. position: fixed;
  280. top: 0;
  281. left: 0;
  282. z-index: 999;
  283. .search-from{
  284. width: 582rpx;
  285. height: 64rpx;
  286. background: #F7F7F7;
  287. border-radius: 32rpx;
  288. float: left;
  289. position: relative;
  290. .input{
  291. width: 500rpx;
  292. height: 64rpx;
  293. float: left;
  294. line-height: 64rpx;
  295. color: $text-color;
  296. font-size: $font-size-24;
  297. }
  298. .icon-iconfonticonfontsousuo1{
  299. width: 64rpx;
  300. height: 64rpx;
  301. line-height: 64rpx;
  302. text-align: center;
  303. display: block;
  304. font-size: $font-size-38;
  305. float: left;
  306. color: #999999;
  307. }
  308. .icon-shanchu1{
  309. font-size: $font-size-32;
  310. color: #999999;
  311. position: absolute;
  312. width: 64rpx;
  313. height: 64rpx;
  314. line-height: 64rpx;
  315. text-align: center;
  316. top: 0;
  317. right: 0;
  318. z-index: 10;
  319. }
  320. }
  321. .search-btn{
  322. width: 120rpx;
  323. line-height: 64rpx;
  324. text-align: center;
  325. font-size: $font-size-28;
  326. color: $color-system;
  327. float: left;
  328. background: #FFFFFF;
  329. }
  330. }
  331. .club-main{
  332. padding-top: 132rpx;
  333. .list{
  334. width: 100%;
  335. height: 228rpx;
  336. padding: 24rpx;
  337. box-sizing: border-box;
  338. background: #FFFFFF;
  339. position: relative;
  340. border-bottom: 1px solid #EBEBEB;
  341. .list-logo{
  342. width: 180rpx;
  343. height: 180rpx;
  344. float: left;
  345. image{
  346. width: 180rpx;
  347. height: 180rpx;
  348. border-radius: 8rpx;
  349. }
  350. }
  351. .list-content{
  352. width: 498rpx;
  353. height: 180rpx;
  354. float: right;
  355. .list-name{
  356. width: 100%;
  357. height: 50rpx;
  358. float: left;
  359. line-height: 50rpx;
  360. text-align: left;
  361. font-size: $font-size-26;
  362. color: #333333;
  363. }
  364. .list-ntel{
  365. width: 100%;
  366. height: 50rpx;
  367. float: left;
  368. line-height: 50rpx;
  369. text-align: left;
  370. font-size: $font-size-26;
  371. color: #666666;
  372. .list-link{
  373. display: inline-block;
  374. float: left;
  375. margin-right: 40rpx;
  376. }
  377. .list-texl{
  378. display: inline-block;
  379. float: left;
  380. }
  381. }
  382. .list-opera{
  383. width: 100%;
  384. height: 60rpx;
  385. display: flex;
  386. color: #166CE1;
  387. flex-direction: row;
  388. align-items: center;
  389. float: left;
  390. margin-top: 20rpx;
  391. .btn{
  392. width: 160rpx;
  393. height: 60rpx;
  394. line-height: 60rpx;
  395. border-radius: 30rpx;
  396. font-size: $font-size-24;
  397. color: $text-color;
  398. text-align: center;
  399. margin:0 20rpx 0 0;
  400. position: relative;
  401. .opea-badge{
  402. position: absolute;
  403. right: -10rpx;
  404. top: -20rpx;
  405. }
  406. &.org{
  407. border: 1px solid #2769d5;
  408. color: #2769d5;
  409. }
  410. &.gre{
  411. border: 1px solid #999999;
  412. color: #999999;
  413. }
  414. &.yel{
  415. border: 1px solid #4ad04c;
  416. color: #4ad04c;
  417. }
  418. }
  419. }
  420. }
  421. }
  422. }
  423. </style>