123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384 |
- <template>
- <view class="container club clearfix">
- <view class="club-search clearfix">
- <view class="search-from name">
- <text class="iconfont icon-iconfonticonfontsousuo1"></text>
- <input
- class="input"
- type="text"
- confirm-type="search"
- v-model="listQuery.name"
- @input="onShowClose"
- @confirm="GetSellerClubList()"
- placeholder="机构名称/联系人"
- maxlength="12"
- />
- <text class="iconfont icon-shanchu2" v-if="isShowClose" @click="delInputText()"></text>
- </view>
- <view class="search-btn">
- <button class="search-btn" type="default" @click.stop="searchClubList">搜索</button>
- </view>
- </view>
- <view class="club-main">
- <view v-if="isEmpty" class="empty-container">
- <image
- class="club-empty-image"
- src="https://img.caimei365.com/group1/M00/03/71/Cmis2F3wna6AY2ZjAABpmnBICH4247.png"
- mode="aspectFit"
- ></image>
- <view class="txt">暂无机构数据</view>
- </view>
- <view v-else class="club-list">
- <view class="list" v-for="(club, index) in clubList" :key="index">
- <view class="club-list-top">
- <view class="list-left">
- <view class="list-head">
- <image :src="staticUrl + 'icon_default_club@3x.png'" mode=""></image>
- </view>
- </view>
- <view class="list-item">
- <view class="list-title">
- <text class="list-name"> {{ club.name }} </text>
- </view>
- <view class="list-ntel">
- <text class="list-link">{{ club.linkMan ? club.linkMan : '' }}</text>
- <text class="list-texl">{{ club.contractMobile ? club.contractMobile : '' }}</text>
- </view>
- </view>
- </view>
- <view class="club-list-bot">
- <view class="btn btn1" @click.stop="handleClickOper(2, club)">查看历史订单</view>
- <view class="btn btn2" @click.stop="handleClickOper(1, club)">立即下单</view>
- </view>
- </view>
- <!--加载loadding-->
- <tui-loadmore :visible="loadding" :index="3" type="black"></tui-loadmore>
- <tui-nomore :visible="!pullUpOn" :backgroundColor="'#ffffff'" :text="nomoreText"></tui-nomore>
- <!--加载loadding-->
- </view>
- </view>
- </view>
- </template>
- <script>
- const defaultListQuery = {
- userIdentity: '',
- name: '',
- pageNum: 1,
- pageSize: 10,
- spId: 0,
- status: 66,
- type: 1,
- groupServiceId: 0
- }
- export default {
- data() {
- return {
- staticUrl: this.global.staticUrl,
- isShowClose: false,
- isEmpty: false,
- nomoreText: '上拉显示更多',
- hasNextPage: false,
- loadding: false,
- pullUpOn: true,
- pullFlag: true,
- scrollHeight: '',
- currPage: '', //当前页面
- prevPage: '', //上一个页面
- clubList: [],
- listQuery: Object.assign({}, defaultListQuery),
- }
- },
- onLoad() {},
- methods: {
- async initGetStotage() {
- // 初始化
- const user = await this.$api.getStorage()
- this.listQuery.spId = user.serviceProviderId
- this.GetSellerClubList()
- },
- searchClubList() {
- // 搜索
- this.GetSellerClubList()
- },
- async GetSellerClubList() {
- try{
- this.listQuery.pageNum = 1
- const res = await this.SellerService.sellerClubList(this.listQuery)
- const data = res.data
- if (data.list && data.list.length > 0) {
- this.isEmpty = false
- this.hasNextPage = data.hasNextPage
- this.clubList = data.list
- this.pullFlag = false
- setTimeout(() => {
- this.pullFlag = true
- }, 500)
- if (this.hasNextPage) {
- this.pullUpOn = false
- this.nomoreText = '上拉显示更多'
- } else {
- this.pullUpOn = true
- this.loadding = false
- this.nomoreText = '已至底部'
- }
- } else {
- this.isEmpty = true
- }
- }catch(error){
- this.$util.msg(error.msg, 2000)
- }
-
- },
- async getOnReachBottomData() {
- try{
- this.listQuery.pageNum += 1
- const res = await this.SellerService.sellerClubList(this.listQuery)
- const data = res.data
- if (data.list && data.list.length > 0) {
- this.hasNextPage = data.hasNextPage
- this.clubList = this.clubList.concat(data.list)
- this.pullFlag = false // 防上拉暴滑
- setTimeout(() => {
- this.pullFlag = true
- }, 500)
- if (this.hasNextPage) {
- this.pullUpOn = false
- this.nomoreText = '上拉显示更多'
- } else {
- this.pullUpOn = false
- this.loadding = false
- this.nomoreText = '已至底部'
- }
- }
- }catch(error){
- console.log(error)
- }
- },
- onShowClose() {
- //输入框失去焦点时触发
- if (this.listQuery.name != '') {
- this.isShowClose = true
- } else {
- this.isShowClose = false
- }
- },
- delInputText() {
- //清除输入框内容
- this.listQuery.name = ''
- this.isShowClose = false
- },
- handleClickOper(type, club) {
- const pathMap = {
- 1: '/pages/seller/goods/list',
- 2: '/pages/seller/order/order-club-list?listType=0',
- 3: '/pages/seller/cart/buyagain',
- 4: '/pages/seller/order/create-recharge-order',
- 5: '/pages/seller/order/order-club-list?listType=0',
- 6: '/pages/seller/cart/coupon'
- }
- this.$api.setStorage('orderUserInfo', club)
- this.$api.navigateTo(pathMap[type])
- },
- },
- onReachBottom() {
- if (this.hasNextPage) {
- this.loadding = true
- this.pullUpOn = true
- this.getOnReachBottomData()
- }
- },
- onShow() {
- this.initGetStotage()
- }
- }
- </script>
- <style lang="scss">
- page {
- height: auto;
- }
- page,
- .container {
- /* padding-bottom: 120upx; */
- background: #f7f7f7;
- }
- .container {
- position: relative;
- }
- .club-search {
- height: 64rpx;
- width: 702rpx;
- padding: 24rpx;
- background: #ffffff;
- display: flex;
- align-items: center;
- position: fixed;
- top: 0;
- left: 0;
- z-index: 999;
- .search-from {
- width: 582rpx;
- height: 64rpx;
- background: #f7f7f7;
- border-radius: 32rpx;
- float: left;
- position: relative;
- .icon-iconfonticonfontsousuo1 {
- width: 64rpx;
- height: 64rpx;
- line-height: 64rpx;
- text-align: center;
- display: block;
- font-size: $font-size-38;
- float: left;
- color: #999999;
- }
- .icon-shanchu2 {
- font-size: $font-size-32;
- color: #999999;
- position: absolute;
- width: 64rpx;
- height: 64rpx;
- line-height: 64rpx;
- text-align: center;
- top: 0;
- right: 0;
- z-index: 10;
- }
- .input {
- width: 500rpx;
- height: 64rpx;
- float: left;
- line-height: 64rpx;
- color: $text-color;
- font-size: $font-size-24;
- }
- }
- .search-btn {
- width: 120rpx;
- line-height: 64rpx;
- text-align: center;
- font-size: $font-size-28;
- color: $color-system;
- float: left;
- background: #ffffff;
- }
- }
- .club-main {
- padding-top: 122rpx;
- .club-list{
- width: 100%;
- height: auto;
- box-sizing: border-box;
- padding: 0 24rpx;
- }
- .list {
- align-items: center;
- width: 100%;
- height: auto;
- padding: 24rpx;
- background: #ffffff;
- position: relative;
- box-sizing: border-box;
- margin: 12rpx 0;
- float: left;
- border-radius: 16rpx;
- .club-list-top {
- width: 100%;
- height: 140rpx;
- float: left;
- display: flex;
- align-items: center;
- margin-bottom: 24rpx;
- .list-left {
- height: 140rpx;
- flex: 2;
- margin-right: 10rpx;
- .list-head {
- width: 140rpx;
- height: 140rpx;
- border-radius: 8rpx;
- image {
- width: 140rpx;
- height: 140rpx;
- border-radius: 8rpx;
- }
- }
- }
- .list-item {
- height: 140rpx;
- flex: 8;
- display: flex;
- flex-direction: column;
- box-sizing: border-box;
- padding-left: 24rpx;
- .list-title {
- flex: 2;
- line-height: 80rpx;
- width: 100%;
- font-size: $font-size-30;
- color: $text-color;
- flex-direction: row;
- justify-content: flex-start;
- .list-name {
- min-width: 100rpx;
- display: block;
- float: left;
- text-align: left;
- -o-text-overflow: ellipsis;
- text-overflow: ellipsis;
- display: -webkit-box;
- word-break: break-all;
- -webkit-box-orient: vertical;
- -webkit-line-clamp: 1;
- overflow: hidden;
- font-weight: bold;
- }
- }
- .list-ntel {
- width: 100%;
- height: 50rpx;
- float: left;
- line-height: 50rpx;
- text-align: left;
- font-size: $font-size-26;
- color: #666666;
- .list-link {
- display: inline-block;
- float: left;
- margin-right: 40rpx;
- }
- .list-texl {
- display: inline-block;
- float: left;
- }
- }
- }
- }
- .club-list-bot {
- width: 100%;
- height: auto;
- border-top: 1px solid #e1e1e1;
- padding-top: 24rpx;
- float: left;
- .btn {
- width: 50%;
- line-height: 48rpx;
- box-sizing: border-box;
- text-align: center;
- font-size: $font-size-28;
- float: left;
- font-weight: bold;
- &.btn1 {
- color: #666666;
- border-right: 1px solid #e1e1e1;
- }
- &.btn2 {
- color: #F3B574;
- }
- }
- }
- }
- }
- </style>
|