list.vue 9.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366
  1. <template>
  2. <view class="container club clearfix" :style="{paddingBottom:isIphoneX?'140rpx':'98rpx'}">
  3. <view class="club-top clearfix">
  4. <view class="club-search">
  5. <view class="search-wrap">
  6. <view class="search-from name">
  7. <input class="input" type="text" v-model="linkman" placeholder="请输入姓名" maxlength="6"/>
  8. </view>
  9. <view class="search-from search">
  10. <button class="search-btn" type="default" @click.stop="searchOpertor">搜索</button>
  11. </view>
  12. </view>
  13. </view>
  14. </view>
  15. <view class="club-main">
  16. <view v-if="isEmpty" class="empty-container">
  17. <view class="txt">暂无运营人员</view>
  18. </view>
  19. <view v-else class="club-list">
  20. <scroll-view scroll-y="true" >
  21. <view class="list" v-for="(item, index) in clubList" :key="index" @click.stop="showclubModel(item)">
  22. <view class="list-left">
  23. <view class="list-head"><image :src="item.headimgurl ? item.headimgurl : '../../../static/temp/logo@3x.png'" mode=""></image></view>
  24. <view class="list-tel">
  25. <text class="txt">{{item.linkName}}</text>
  26. <text class="txt">{{item.mobile}}</text>
  27. </view>
  28. </view>
  29. <view class="list-opea">
  30. <view class="opea-type">
  31. <view class="opea-type-cell" v-if="item.effectiveFlag != null">
  32. <text class="iconfont icon-iconfontweixin" :style="{color: iconStautsColor(item.status)}"></text>
  33. <text :style="{color: rexpStautsColor(item.effectiveFlag)}">{{ rexpStautsText(item.effectiveFlag) }}</text>
  34. </view>
  35. <view class="opea-type-cell none" v-else>
  36. <text>- -</text>
  37. </view>
  38. </view>
  39. <view class="opea-del">
  40. <view class="opea-type-cell" @click.stop="deleteclub(item.id)">
  41. <text class="iconfont icon-shanchu"></text>
  42. <text>删除</text>
  43. </view>
  44. </view>
  45. </view>
  46. </view>
  47. <!--加载loadding-->
  48. <tui-loadmore :visible="loadding" :index="3" type="black"></tui-loadmore>
  49. <tui-nomore :visible="!pullUpOn" bgcolor="#F7F7F7" :text='nomoreText'></tui-nomore>
  50. <!--加载loadding-->
  51. </scroll-view>
  52. </view>
  53. </view>
  54. <view class="tabBar" :style="{height:isIphoneX?'140rpx':'98rpx'}">
  55. <view class="tabBar_list" :style="{paddingBottom:isIphoneX?'40rpx':''}">
  56. <view class="tabBar_item" v-for="(item,index) in tabBarList"
  57. :key="index"
  58. :class="{ 'current' : tabCurrentIndex === index}"
  59. @click="tabClick(index)" >
  60. <text class="iconfont" :class="item.icon"></text>
  61. <view class="tabBar_name">{{item.name}}</view>
  62. </view>
  63. </view>
  64. </view>
  65. </view>
  66. </template>
  67. <script>
  68. import authorize from '@/common/config/authorize.js'
  69. import tuiLoadmore from "@/components/tui-components/loadmore/loadmore"
  70. import tuiNomore from "@/components/tui-components/nomore/nomore"
  71. import { queryclubList, deleteclub , updateCode } from "@/api/operator.js"
  72. export default {
  73. components:{
  74. tuiLoadmore,
  75. tuiNomore,
  76. },
  77. data() {
  78. return {
  79. clubID:'',
  80. clubName:'',
  81. clubImage:'',
  82. linkman:'',
  83. clubMobile:'',
  84. isEmpty:false,
  85. nomoreText: '上拉显示更多',
  86. userID:'',
  87. pageNum:1,
  88. pageSize:10,
  89. hasNextPage:false,
  90. loadding: false,
  91. pullUpOn: true,
  92. pullFlag: true,
  93. allowDataStatus:true,
  94. wrapperHeight:'100%',
  95. scrollHeight:'',
  96. deleteAddressId:'',
  97. currPage:'',//当前页面
  98. prevPage:'',//上一个页面
  99. tabBarList:[
  100. {name:'待审核',icon:'icon-lishidingdan'},
  101. {name:'审核未通过',icon:'icon-shenhebutongguo'},
  102. {name:'已上线',icon:'icon-shenhetongguo'}
  103. ],
  104. tabCurrentIndex:0,
  105. clubList:[],
  106. isIphoneX:this.$store.state.isIphoneX,
  107. show_index:0,//控制显示那个组件
  108. }
  109. },
  110. onLoad(){
  111. this.setScrollHeight();
  112. },
  113. methods: {
  114. setScrollHeight() {
  115. // 窗口高度 - 底部距离
  116. setTimeout(()=> {
  117. const query = wx.createSelectorQuery().in(this);
  118. query.selectAll('.add-btn').boundingClientRect();
  119. query.exec(res => {
  120. if(res[0][0]){
  121. let winHeight = this.$api.getWindowHeight(),
  122. eleTop = res[0][0].top - 1;
  123. this.scrollHeight = eleTop;
  124. }
  125. })
  126. }, 500)
  127. },
  128. searchOpertor(){
  129. this.pageNum=1
  130. this.initclubList()
  131. },
  132. initclubList(){
  133. let params = {clubID:this.clubID,pageNum:1,pageSize:this.pageSize,linkName:this.linkman,mobile:this.clubMobile}
  134. queryclubList(params).then(response =>{
  135. let responseData = response.data
  136. if(responseData.results&&responseData.results.length > 0){
  137. this.isEmpty = false
  138. this.hasNextPage = response.data.hasNextPage
  139. this.clubList =responseData.results
  140. this.pullFlag = false;
  141. setTimeout(()=>{this.pullFlag = true;},500)
  142. if(this.hasNextPage){
  143. this.pullUpOn = false
  144. this.nomoreText = '上拉显示更多'
  145. }else{
  146. this.pullUpOn = true
  147. this.loadding = false
  148. this.nomoreText = '已至底部'
  149. }
  150. }else{
  151. this.isEmpty = true
  152. }
  153. }).catch(response =>{
  154. this.$util.msg(response.msg,2000)
  155. })
  156. },
  157. getOnReachBottomData(){
  158. this.pageNum+=1
  159. let params = {pageNum:this.pageNum,pageSize:this.pageSize,linkName:this.linkman,mobile:this.clubMobile}
  160. queryclubList(params).then(response =>{
  161. let responseData = response.data
  162. if(responseData.results&&responseData.results.length > 0){
  163. this.hasNextPage = response.data.hasNextPage
  164. this.clubList = this.clubList.concat(responseData.results)
  165. this.pullFlag = false;// 防上拉暴滑
  166. setTimeout(()=>{this.pullFlag = true;},500)
  167. if(this.hasNextPage){
  168. this.pullUpOn = false
  169. this.nomoreText = '上拉显示更多'
  170. }else{
  171. this.pullUpOn = false
  172. this.loadding = false
  173. this.nomoreText = '已至底部'
  174. }
  175. }
  176. }).catch(response =>{
  177. this.$util.msg(response.msg,2000)
  178. })
  179. },
  180. rexpStautsColor(status) {
  181. let textColor = ''
  182. switch (status) {
  183. case '1':
  184. textColor = '#55BB00'
  185. break
  186. case '2':
  187. textColor = '#0056BB'
  188. break
  189. case '3':
  190. textColor = '#BB0000'
  191. break
  192. }
  193. return textColor
  194. },
  195. iconStautsColor(status) {
  196. let textColor = ''
  197. if(status == '2'){
  198. textColor = '#09BB07'
  199. }else{
  200. textColor = '#DDDDDD'
  201. }
  202. return textColor
  203. },
  204. tabClick(index) {//商品详情&&供应商信息tab切换
  205. this.tabCurrentIndex = index;
  206. console.log(this.tabCurrentIndex)
  207. },
  208. },
  209. onReachBottom() {
  210. if(this.hasNextPage){
  211. this.loadding = true
  212. this.pullUpOn = true
  213. this.getOnReachBottomData()
  214. }
  215. },
  216. onShow() {
  217. this.$api.getCommonStorage('clubInfo').then(response =>{
  218. console.log(response)
  219. this.clubID = response.clubID
  220. this.clubName = response.name
  221. this.clubImage = response.image
  222. this.pageNum = 1;
  223. this.initclubList();
  224. })
  225. }
  226. }
  227. </script>
  228. <style lang='scss'>
  229. page {
  230. height: auto;
  231. }
  232. page,.container{
  233. /* padding-bottom: 120upx; */
  234. background: #F7F7F7;
  235. border-top: 1px solid #EBEBEB;
  236. }
  237. .container{
  238. position: relative;
  239. }
  240. .list{
  241. display: flex;
  242. align-items: center;
  243. width: 702rpx;
  244. height: 92rpx;
  245. padding: 24rpx;
  246. background: #FFFFFF;
  247. position: relative;
  248. border-bottom: 1px solid #EBEBEB;
  249. .list-left{
  250. display: flex;
  251. flex: 4;
  252. .list-head{
  253. width: 92rpx;
  254. height: 92rpx;
  255. border-radius: 14rpx;
  256. image{
  257. width: 92rpx;
  258. height: 92rpx;
  259. border-radius: 14rpx;
  260. }
  261. }
  262. .list-tel{
  263. margin-left: 18rpx;
  264. .txt{
  265. display: flex;
  266. flex: 1;
  267. font-size: $font-size-28;
  268. color: $text-color;
  269. line-height: 46rpx;
  270. }
  271. }
  272. }
  273. .list-opea{
  274. flex:6;
  275. .opea-type{
  276. flex-direction: column;
  277. align-items: center;
  278. margin-left: 20rpx;
  279. float: left;
  280. .opea-type-cell{
  281. width: 186rpx;
  282. height: 64rpx;
  283. padding:0 16rpx;
  284. border-radius: 10rpx;
  285. border: 1px solid #DDDDDD;
  286. line-height: 64rpx;
  287. font-size: $font-size-24;
  288. .icon-iconfontweixin{
  289. margin-right: 8rpx;
  290. font-size: $font-size-32;
  291. }
  292. &.none{
  293. text-align: center;
  294. }
  295. }
  296. }
  297. .opea-del{
  298. float: right;
  299. flex-direction: column;
  300. align-items: center;
  301. .opea-type-cell{
  302. width: 86rpx;
  303. height: 64rpx;
  304. padding:0 24rpx;
  305. border-radius: 10rpx;
  306. border: 1px solid #DDDDDD;
  307. line-height: 64rpx;
  308. font-size: $font-size-24;
  309. color: #FF0000;
  310. .icon-shanchu{
  311. font-size: $font-size-32;
  312. margin-right: 6rpx;
  313. }
  314. }
  315. }
  316. }
  317. }
  318. .tabBar{
  319. width:100%;
  320. height: 98rpx;
  321. background: #fff;
  322. border-top:1px solid #E5E5E5;
  323. position: fixed;
  324. bottom:0px;
  325. left:0px;
  326. right:0px;
  327. display: flex;
  328. align-items: center;
  329. justify-content: center;
  330. .tabBar_list{
  331. width:86%;
  332. display: flex;
  333. justify-content: space-between;
  334. .tabBar_item{
  335. width:120rpx;
  336. display: flex;
  337. justify-content: center;
  338. align-items: center;
  339. flex-direction: column;
  340. font-size: 20rpx;
  341. color: #999999;
  342. &.current{
  343. color: #166CE1;
  344. .iconfont{
  345. color:#166CE1;
  346. }
  347. }
  348. .iconfont{
  349. width:48rpx;
  350. height: 48rpx;
  351. display: block;
  352. margin-bottom:2rpx;
  353. text-align: center;
  354. font-size: 46rpx;
  355. color: #999999;
  356. }
  357. }
  358. }
  359. }
  360. .nav_active{
  361. color: $color-system;
  362. }
  363. </style>