stayClub-list.vue 10 KB

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