123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454 |
- <template>
- <view class="content">
- <!-- <view class="search-wrap">
- <view class="search flex">
- <image src="../../static/icon/search.png" mode=""></image>
- <input type="text" placeholder="请输入关键词搜索" confirm-type="search" @confirm="search" v-model="keys"/>
- </view>
- </view> -->
- <!-- <view class="navbar">
- <view v-for="(item, index) in navList" :key="index" class="nav-item" :class="{ current: current === index }" @click="changeCurrent(index)">{{ item.tit }}</view>
- </view> -->
- <view style="height: 20rpx;">
- </view>
- <swiper :current="current" class="swiper-box" :style="{'height': height}" @change="chanageC" disable-touch>
- <swiper-item v-for="item in navList" >
- <scroll-view scroll-y="true" :style="{'height': height}">
- <empty v-if="item.loaded === true && item.list.length === 0"></empty>
- <view class="order-item" v-for="items in item.list" @click="lookMore(items)">
- <view class="item-top flex">
- <view class="order-type">
- 预约订单
- </view>
- <view class="order-id">
- 订单编号:{{items.order_id}}
- </view>
- <view class="order-status">
- {{items.agent_status == 0?'待服务':(items.agent_status == 1?'进行中':'已完成')}}
- </view>
- </view>
- <view class="item-user flex">
- <image src="../../static/icon/where.png" mode="" class="where"></image>
- <view class="">
- <view class="">
- {{items.user_address}}
- </view>
- <view class="phone">
- {{items.real_name}} <text @click="makeCall(items.user_phone)">{{items.user_phone }}</text>
- </view>
- </view>
- </view>
- <view class="item-user flex">
- <image src="../../static/icon/time.png" mode="" class="where"></image>
- <view class="">
- <view class="">
- {{items.subscribe_day}} {{items.subscribe_time}}
- </view>
- </view>
- </view>
- <view class="goods-box-single" v-for="(goodsItem, goodsIndex) in items._info" :key="goodsIndex">
- <image class="goods-img" :src="goodsItem.cart_info.productInfo.image" mode="scaleToFill"></image>
- <view class="right">
- <view class="flex-start">
- <text class="title clamp2">{{ goodsItem.cart_info.productInfo.store_name }}</text>
- <!-- <text class="price">{{ goodsItem.cart_info.productInfo.price }}</text> -->
- </view>
- <view class="row flex">
- <!-- <text class="row_title">{{ goodsItem.productInfo.attrInfo ? goodsItem.productInfo.attrInfo.suk : '' }}</text> -->
- <text class="attr-box">服务类型:{{ goodsItem.cart_info.productInfo.is_housekeeping == 1? '家政':(goodsItem.cart_info.productInfo.is_maintenance == 1?'维修': '普通商品') }}</text>
- </view>
- </view>
- </view>
- <view class="item-btm flex">
- <view class="">
- 下单时间:{{items.add_time}}
- </view>
- <view class="u-btn" @click.stop="cancelSubscribe(items.order_id)" v-if="items.agent_status == 1">
- 上传评价
- </view>
- <view class="u-btn" @click.stop="pass(items)" v-if="items.agent_status == 0">
- 订单确认
- </view>
- <view class="u-btn" @click.stop="lookimg(items)" v-if="items.agent_status == 2 || items.agent_status == 3">
- 查看评价
- </view>
- </view>
- </view>
- <uni-load-more :status="item.loadingType" v-if="!(item.loaded === true && item.list.length === 0)"></uni-load-more>
- </scroll-view>
- </swiper-item>
- </swiper>
- </view>
- </template>
- <script>
- import uniLoadMore from '@/components/uni-load-more/uni-load-more.vue';
- import empty from '@/components/empty';
- import { subscribeList,cancelSubscribe,agentOrder,agentOrderAuth} from '@/api/user.js'
- export default {
- components: {
- empty,
- uniLoadMore
- },
- data() {
- return {
- keys: '',
- height: '',
- current: 0,
- navList: [
- {
- tit: '全部',
- status: -2,
- list: [],
- loadingType: 'more',
- loaded: true,
- page: 1,
- limit: 10
- },
- {
- tit: '待确认',
- status: 0,
- list: [],
- loadingType: 'more',
- loaded: true,
- page: 1,
- limit: 10
- },
- {
- tit: '待上传',
- status: 1,
- list: [],
- loadingType: 'more',
- loaded: false,
- page: 1,
- limit: 10
- },
- {
- tit: '已上传',
- status: 2,
- list: [],
- loadingType: 'more',
- loaded: false,
- page: 1,
- limit: 10
- },
- {
- tit: '已完成',
- status:3,
- list: [],
- loadingType: 'more',
- loaded: false,
- page: 1,
- limit: 10
- }
- ]
- }
- },
- onLoad() {
-
- },
- onShow() {
- this.getOrderList('re')
- },
- onReachBottom() {
-
- },
- onReady(res) {
- var that = this;
- uni.getSystemInfo({
- success: resu => {
- const query = uni.createSelectorQuery();
- query.select('.swiper-box').boundingClientRect();
- query.exec(function(res) {
- that.height = resu.windowHeight - res[0].top + 'px';
- });
- },
- fail: res => {}
- });
- },
- methods: {
- makeCall(phone) {
- console.log(phone);
- if(phone) {
- uni.makePhoneCall({
- phoneNumber:phone + ''
- })
- }
-
- },
- lookMore(item) {
- console.log(item);
- uni.navigateTo({
- url:'/pages/order/orderDetails?id=' + item.id
- })
- },
- lookimg(item) {
- let arr = item.auth_up_file.split(',')
- uni.previewImage({
- current: 0,
- loop: false,
- urls: arr,
- indicator: 'default'
- });
- },
- search() {
- this.getOrderList('re')
- },
- chanageC(e) {
- this.current = e.detail.current;
- this.getOrderList('tab')
- },
- changeCurrent(index) {
- if(index == this.current) return;
- this.current = index;
- },
- pass(item) {
- // agentOrderAuth({
- // id,
- // status: 0
- // }).then(res => {
- // uni.showToast({
- // title: '确认成功',
- // duration: 2000
- // });
- // })
- uni.navigateTo({
- url: '/pages/order/sh?id=' + item.order_id + '&day=' + item.subscribe_day + '&time=' + item.subscribe_time + '&type=' + item.type
- })
- },
- cancelSubscribe(id) {
- uni.navigateTo({
- url: '/pages/order/upPj?id=' + id
- })
- },
- getOrderList(type) {
- let that = this;
- let item = that.navList[that.current];
- if(type == 'tab' && item.loaded) return;
- if(type == 're') {
- item.loadingType = 'more'
- item.loaded = false
- item.page = 1
- item.list = []
- }
- if(item.loadingType == 'loading' || item.loadingType == 'noMore') return;
- item.loadingType = 'loading'
- agentOrder({
- page:item.page,
- limit:item.limit,
- agent_status: item.status,
- key: this.keys
- }).then(res => {
- let arr = res.data.data
- item.list = item.list.concat(arr)
- if(arr.length == item.limit) {
- item.loadingType = 'more'
- }else {
- item.loadingType = 'noMore'
- }
- item.loaded = true
- })
-
- }
- }
- }
- </script>
- <style lang="scss" scoped>
- .navbar {
- display: flex;
- height: 40px;
- 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: $font-color-dark;
- position: relative;
-
- &.current {
- color: #000;
- font-weight: bold;
-
- &:after {
- content: '';
- position: absolute;
- left: 50%;
- bottom: 0;
- transform: translateX(-50%);
- width: 44px;
- height: 0;
- border-bottom: 2px solid $base-color;
- }
- }
- }
- }
- .swiper-box {
- }
- .order-item {
- padding:0 20rpx;
- background-color: #fff;
- width: 700rpx;
- margin: 0 auto 20rpx;
- border-radius: 20rpx;
- &:last-of-type {
- margin-bottom: 0;
- }
- .item-top {
- height: 92rpx;
- border-bottom: #f5f5f5 3rpx solid;
- font-weight: 500;
- .order-type {
- // padding: 10;
- padding: 8rpx 10rpx;
-
- background: #ffeae5;
- border-radius: 0rpx 10rpx 0rpx 10rpx;
- font-size: 20rpx;
- color: #FF4E00;
- }
- .order-id {
- flex-grow: 1;
- font-size: 22rpx;
- color: #A3A8BB;
- padding-left: 10rpx;
- }
- .order-status {
- font-size: 26rpx;
- color: #FF4E00;
- }
- }
- .item-yg {
- width: 660rpx;
- background: #F5F5F5;
- font-size: 24rpx;
- color: #666666;
- padding: 20rpx 0 20rpx 20rpx;
- margin-bottom: 24rpx;
- text {
- font-weight: bold;
- color: #333333;
- }
- }
- .item-btm {
- height: 92rpx;
- font-size: 24rpx;
- color: #A3A8BB;
- border-top: #f5f5f5 3rpx solid;
- }
- .item-user {
- justify-content: flex-start;
- align-items: flex-start;
- font-weight: bold;
- font-size: 26rpx;
- color: #000000;
- margin: 30rpx 0;
- .where {
- width: 24rpx;
- height: 28rpx;
- margin-right: 23rpx;
- }
- .time {
- width: 24rpx;
- height: 24rpx;
-
- }
- image {
- flex-shrink: 0;
- margin-top:5rpx;
- }
- .phone {
- padding-top: 15rpx;
- font-size: 23rpx;
- color: #666666;
- }
- }
- }
- .search-wrap {
- background-color: #ffffff;
- padding: 20rpx 0;
- .search {
- width: 702rpx;
- height: 64rpx;
- background: #F1F1F1;
- border-radius: 32rpx;
- margin: auto;
- padding: 0 30rpx;
- image {
- width: 31rpx;
- height: 32rpx;
- flex-shrink: 0;
- }
- input {
- height: 100%;
- flex-grow: 1;
- padding-left: 18rpx;
- }
- }
- }
- .u-btn {
- width: 144rpx;
- line-height: 55rpx;
- border-radius: 28rpx;
- border: 1px solid #FF4C4C;
- font-size: 26rpx;
- color: #FF4C4C;
- text-align: center;
- }
- /* 单条商品 */
- .goods-box-single {
- display: flex;
- padding: 20rpx 0;
- .goods-img {
- display: block;
- width: 120rpx;
- height: 120rpx;
- }
- .right {
- flex: 1;
- display: flex;
- flex-direction: column;
- padding: 0 30rpx 0 24rpx;
- overflow: hidden;
- .row{
- margin-top: 10rpx;
- }
- .row_title{
- padding:5rpx 10rpx;
- background-color: #dddddd;
- border-radius: 10rpx;
- font-size: 22rpx;
- color: #ffffff;
- }
- .title {
- font-size: $font-base + 2rpx;
- color: $font-color-dark;
- line-height: 1;
- width: 80%;
- }
- .attr-box {
- display: flex;
- justify-content: flex-end;
- font-size: $font-sm + 2rpx;
- color: $font-color-light;
- }
- .price {
- display: inline;
- font-size: $font-base + 2rpx;
- color: $font-color-dark;
- &:before {
- content: '¥';
- font-size: $font-sm;
-
- }
- }
- }
- }
- </style>
|