123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313 |
- <template>
- <view class="content">
- <view class="navbar">
- <view v-for="(item, index) in navlist" :key="index" class="nav-item"
- :class="{ current: tabCurrentIndex === index }" @click="tabClick(index)">{{ item.title }}</view>
- </view>
- <swiper :current="tabCurrentIndex" :style="{ height: height }" class="swiper-box" duration="300" disable-touch>
- <swiper-item class="tab-content" v-for="(tabItem, tabIndex) in navlist" :key="tabIndex">
- <scroll-view scroll-y="true" class="list-scroll-content" @scrolltolower="loadData" :style="{ height: height }">
- <!-- 空白页 -->
- <u-empty text="暂无数据" mode="list" v-if="tabItem.loaded && tabItem.list.length == 0"></u-empty>
- <!-- 订单列表 -->
- <view class="dd-wrap" v-for="item in tabItem.list" :key="item">
- <view class="dd-id-status">
- <view class="dd-stata">
- 待服务
- </view>
- <view class="dd-id">
- ddddadfasfdasdf-adfas
- </view>
- <view class="dd-status">
- 已预约
- </view>
- </view>
- <view class="dd-info" style="margin-top: 20rpx;">
- 客服名称<text>小圆</text>
- </view>
- <view class="dd-info">
- 下单时间<text>2022-11-03 9:30~10:30</text>
- </view>
- <view class="dd-info">
- 预约时间<text class="chs" style="color:#FF5600;">2022-11-03 9:30~10:30</text>
- </view>
- <view class="dd-btm">
- <view class="btm-price">
- 订单金额: <text>¥2400</text>
- </view>
- <view class="btm-btn btm-btn-lx">
- 联系客户
- </view>
- <view class="btm-btn btm-btn-sm">
- 扫码完成
- </view>
- </view>
- <!-- <view class="add-dd">
- <image src="../../static/img/add-dd.png" mode=""></image>
- <view class="">
- 添加项目
- </view>
- </view> -->
- </view>
- <u-loadmore :status="tabItem.loadingType" />
- </scroll-view>
- </swiper-item>
- </swiper>
- </view>
- </template>
- <script>
- export default {
- data() {
- return {
- height: '',
- tabCurrentIndex: 0,
- navlist: [{
- status: 0,
- title: '全部',
- list: 10,
- page: 1,
- limit: 10,
- loaded: false,
- loadingType: 'loadmore'
- },
- {
- status: 1,
- title: '待服务',
- list: [],
- page: 1,
- limit: 10,
- loaded: false,
- loadingType: 'loadmore'
- },
- {
- status: 2,
- title: '已完成',
- list: [],
- page: 1,
- limit: 10,
- loaded: false,
- loadingType: 'loadmore'
- }
- ]
- }
- },
- onLoad(opt) {
- },
- onShow() {
- },
- onReachBottom() {
- },
- onReady() {
- var _this = this;
- uni.getSystemInfo({
- success: resu => {
- const query = uni.createSelectorQuery();
- query.select('.swiper-box').boundingClientRect();
- query.exec(function(res) {
- _this.height = resu.windowHeight - res[0].top + 'px';
- console.log('打印页面的剩余高度', _this.height);
- });
- },
- fail: res => {}
- });
- },
- methods: {
- //顶部tab点击
- tabClick(index) {
- this.tabCurrentIndex = index;
- // this.loadData('tab')
- },
- // 获取数据
- loadData(type) {
- let that = this
- let index = that.tabCurrentIndex
- let item = that.navlist[index]
- if (type == 'reload') {
- item.loaded = false
- item.loadingType = 'more'
- item.page = 1
- item.list = []
- }
- if (type == 'tab' && item.loaded) {
- return
- }
- if (item.loadingType == 'loading' || item.loadingType == 'noMore') {
- return
- }
- item.loadingType = 'loading'
- },
- }
- }
- </script>
- <style lang="scss">
- .navbar {
- display: flex;
- height: 88rpx;
- padding: 0 5px;
- background: #fff;
- box-shadow: 0 1px 5px rgba(0, 0, 0, 0.06);
- position: relative;
- z-index: 10;
- .nav-item {
- flex: 1;
- display: flex;
- justify-content: center;
- align-items: center;
- height: 100%;
- font-size: 15px;
- color: #999999;
- position: relative;
- &.current {
- color: #000;
- &:after {
- content: '';
- position: absolute;
- left: 50%;
- bottom: 0;
- transform: translateX(-50%);
- width: 44px;
- height: 0;
- border-bottom: 2px solid #4076d6;
- }
- }
- }
- }
- .dd-wrap {
- margin: auto;
- width: 713rpx;
- height: 314rpx;
- border-radius: 20rpx;
- background-color: #fff;
- padding-top: 35rpx;
- position: relative;
- margin-bottom: 27rpx;
- .dd-id-status {
- height: 40rpx;
- display: flex;
- align-items: center;
- width: 100%;
- font-size: 24rpx;
- padding: 0 23rpx 0 43rpx;
- .dd-stata {
- flex-shrink: 0;
- width: 123rpx;
- height: 39rpx;
- background: #FF5600;
- border-radius: 5rpx;
- text-align: center;
- line-height: 39rpx;
- font-weight: 400;
- color: #FFFFFF;
- }
- .dd-id {
- margin-left: 15rpx;
- flex-grow: 1;
- color: #1e395a;
- }
- .dd-status {
- flex-shrink: 0;
- font-weight: 400;
- color: #FCA930;
- }
- }
- .dd-info {
- font-size: 28rpx;
- font-weight: 500;
- color: #A0A0A0;
- padding-left: 42rpx;
- text {
- padding-left: 32rpx;
- font-size: 26rpx;
- font-weight: 500;
- color: #173456;
- }
- }
- .dd-btm {
- position: absolute;
- bottom: 0;
- height: 90rpx;
- width: 713rpx;
- background: linear-gradient(to right, #fbf5eb, #ffffff);
- border-radius: 0 0 20rpx 20rpx;
- display: flex;
- justify-content: space-between;
- align-items: center;
- padding: 0 20rpx 0 42rpx;
- .btm-price {
- font-size: 26rpx;
- color: #56687f;
- flex-grow: 1;
- text {
- color: #ff1e00;
- }
- }
- .btm-btn {
- width: 126rpx;
- height: 48rpx;
- line-height: 48rpx;
- background: #ebccae;
- border-radius: 10rpx;
- font-size: 24rpx;
- font-weight: 400;
- text-align: center;
- }
- .btm-btn-sm {
-
- background: #4D74CF;
- margin-left: 10rpx;
- color: #fff;
- }
- .btm-btn-lx {
- background-color: #fff;
- border: 1px solid #65676A;
- color: #56585C;
- }
- }
- .add-dd {
- position: absolute;
- bottom: 90rpx;
- right: 20rpx;
- width: 110rpx;
- height: 100rpx;
- font-size: 24rpx;
- font-weight: 500;
- color: #FF5600;
- text-align: center;
- image {
- display: block;
- margin: auto;
- width: 36rpx;
- height: 45rpx;
- }
- }
- }
- </style>
|