123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366 |
- <template>
- <view class="order">
- <view class="bars">
- <view style="display: flex;">
- <view :class="orderType == ''?'bar-select':'bar'" @click="changeType('')">
- 全部
- <image v-if="orderType==''" :src="require('../../../static/sel.png')" alt="">
- </view>
- </view>
- <view style="display: flex;">
- <view :class="orderType == '2'?'bar-select':'bar'" @click="changeType('2')">
- 待服务
- <image v-if="orderType=='2'" :src="require('../../../static/sel.png')" alt="">
- </view>
- <span v-if="orderNum>0">{{orderNum}}</span>
- </view>
- <view style="display: flex;">
- <view :class="orderType == '4'?'bar-select':'bar'" @click="changeType('4')">
- 已取消
- <image v-if="orderType=='4'" :src="require('../../../static/sel.png')" alt="">
- </view>
- </view>
- <view style="display: flex;">
- <view :class="orderType == '3'?'bar-select':'bar'" @click="changeType('3')">
- 已完成
- <image v-if="orderType=='3'" :src="require('../../../static/sel.png')" alt="">
- </view>
- </view>
- </view>
- <view style="height: 80rpx;"></view>
- <view class="body" v-for="(item, index) in orderList" :key="index" @click="toPath(item)">
- <view class="header">
- <view class="orderId">
- 订单编号:{{item.orderNumber}}
- </view>
- <view class="orderType" :style="item.status==1 || item.status==2?'color: #005BFF;':'color: #666666;'">
- {{item.status==1?'待支付':item.status==2?'待服务':item.status==3?'已完成':item.status==4?'已取消':'进行中'}}
- <image :src="require('../../../static/choose.png')" alt="">
- </view>
- </view>
- <view class="carView">
- <image :src="baseImagePath+item.carLogo" alt="">
- <view class="carBody">
- <view class="carTitle">
- <image :src="require('../../../static/car.png')" alt="">
- <span>{{item.carNumber}}</span>
- <view class="border"></view>
- <span>{{item.carMadelLevel}}</span>
- <view class="border"></view>
- <span>{{item.carWashType}}</span>
- </view>
- <view class="content">
- {{item.carTypeName}}
- </view>
- </view>
- </view>
- <view class="shop">
- <image :src="require('../../../static/shop.png')" alt="">
- <view style="padding-left: 16rpx;">
- 门店:{{item.shopName}}
- </view>
- </view>
- <view class="times" :style="item.orderType==2?'border-bottom: 1px solid #EEEEEE;':''">
- <image :src="require('../../../static/time.png')" alt="">
- <view style="padding-left: 16rpx;">
- 时间:{{item.time}}
- </view>
- </view>
- <view v-if="item.status==3 && item.isEvaluate == 2">
- <view class="buttomBtn" @click.stop="toEvaluation(item.id)">
- 评价
- </view>
- </view>
- </view>
- </view>
- </template>
- <script>
- import {
- carwashOrderList
- } from "@/api/carWash.js"
- const app = getApp();
- export default {
- components: {},
- data: function() {
- return {
- requestStatus: false,
- baseImagePath: this.baseImagePath,
- orderNum: null,
- orderType: "",
- orderList: [],
- pageNo: 1,
- pageSize: 20,
- }
- },
- onReachBottom() {
- let that = this
- that.pageNo++
- this.getPage()
- },
- onLoad(e) {
- app.globalData.requestToken = e.token;
- uni.setStorageSync('token', e.token)
- },
- onShow() {
- this.pageNo = 1
- this.getPage(1)
- },
- onBackPress(options) {
- console.log('11111');
- // 这里可以自定义返回逻辑,比如下面跳转其他页面
- // #ifdef APP-PLUS
- if (plus.os.name.toLowerCase() === 'android') {
- plus.runtime.quit();
- } else {
- plus.runtime.quit();
- }
- // #endif
- // return true 表示禁止默认返回
- return true;
- },
- methods: {
- changeType(val) {
- this.orderType = val;
- this.pageNo = 1;
- this.getPage(1);
- },
- getPage(val) {
- let data = {
- status: this.orderType,
- pageNo: this.pageNo,
- pageSize: this.pageSize
- }
- let that = this;
- carwashOrderList(data).then((res) => {
- console.log(res);
- that.orderNum = res.data.beServiceNum;
- if (val == 1) {
- that.orderList = [];
- }
- that.orderList = that.orderList.concat(res.data.carWashOrderListVO.rows)
- })
- },
- toPath(item) {
- console.log('订单详情', item);
- this.$yrouter.push({
- path: "/pages/preCarWash/washOrder/orderDetail/index?data=" + encodeURIComponent(JSON
- .stringify(item))
- });
- },
- toEvaluation(id) {
- if (this.requestStatus) {
- // 利用 return 终止函数继续运行
- return false;
- console.log(1);
- }
- this.$yrouter.push({
- path: "/pages/preCarWash/washOrder/serviceEvaluation/index?type=3&detailId=" + id
- });
- console.log('按钮点击函数执行');
- // 执行函数
- this.requestStatus = true;
- setTimeout(() => {
- // 模拟执行完毕
- // 改变 requestStatus
- this.requestStatus = false;
- }, 1000);
- }
- }
- }
- </script>
- <style lang="less">
- page {
- background: #F5F5F5;
- }
- .order {
- .bars {
- width: 100%;
- height: 80rpx;
- background: #FFFFFF;
- box-shadow: 0px 1px 0px 0px rgba(55, 55, 55, 0.1);
- display: flex;
- justify-content: space-around;
- align-items: center;
- position: fixed;
- top: 0;
- z-index: 999;
- .bar {
- display: flex;
- flex-direction: column;
- align-items: center;
- font-size: 28rpx;
- font-family: PingFang SC;
- font-weight: 500;
- color: #666666;
- background-color: #FFFFFF;
- }
- span {
- font-size: 22rpx;
- font-family: PingFang SC;
- font-weight: 500;
- color: #005BFF;
- padding-left: 12rpx;
- }
- }
- .bar-select {
- display: flex;
- flex-direction: column;
- align-items: center;
- font-size: 28rpx;
- font-family: PingFang SC;
- font-weight: bold;
- color: #333333;
- image {
- width: 34rpx;
- height: 11rpx;
- }
- }
- .body {
- background: #FFFFFF;
- border-radius: 10rpx;
- margin: 20rpx;
- padding: 30rpx;
- .header {
- display: flex;
- justify-content: space-between;
- border-bottom: 1rpx solid #EEEEEE;
- padding-bottom: 30rpx;
- .orderId {
- font-size: 26rpx;
- font-family: PingFang SC;
- font-weight: 500;
- color: #999999;
- line-height: 34rpx;
- }
- .orderType {
- display: flex;
- align-items: center;
- font-size: 26rpx;
- font-family: PingFang SC;
- font-weight: 500;
- line-height: 34rpx;
- image {
- padding-left: 8rpx;
- width: 11rpx;
- height: 18rpx;
- }
- }
- }
- .carView {
- display: flex;
- image {
- width: 120rpx;
- height: 120rpx;
- background: #FFFFFF;
- border: 2rpx solid #F4F4F4;
- border-radius: 8rpx;
- margin-top: 32rpx;
- }
- .carBody {
- padding: 32rpx;
- .carTitle {
- display: flex;
- image {
- width: 33rpx;
- height: 27rpx;
- margin-top: 0rpx;
- }
- .border {
- width: 1px;
- height: 20rpx;
- background: #DBDBDB;
- }
- span {
- font-size: 30rpx;
- font-family: PingFang SC;
- font-weight: bold;
- color: #333333;
- line-height: 31rpx;
- padding: 0 15rpx 0 15rpx;
- white-space: nowrap;
- }
- }
- .content {
- font-size: 26rpx;
- font-family: PingFang SC;
- font-weight: 500;
- color: #666666;
- line-height: 34rpx;
- padding: 20rpx 60rpx 20rpx 0;
- }
- }
- }
- .shop {
- display: flex;
- align-items: center;
- font-size: 26rpx;
- font-family: PingFang SC;
- font-weight: 500;
- color: #333333;
- line-height: 34rpx;
- image {
- width: 30rpx;
- height: 26rpx;
- }
- }
- .times {
- display: flex;
- align-items: center;
- font-size: 26rpx;
- font-family: PingFang SC;
- font-weight: 500;
- color: #333333;
- line-height: 34rpx;
- margin-top: 31rpx;
- padding-bottom: 30rpx;
- image {
- width: 30rpx;
- height: 26rpx;
- }
- }
- .buttomBtn {
- width: 148rpx;
- height: 56rpx;
- background: #FFFFFF;
- border: 1px solid #003EFF;
- border-radius: 28rpx;
- font-size: 26rpx;
- font-family: PingFang SC;
- font-weight: 500;
- color: #0051FF;
- line-height: 56rpx;
- text-align: center;
- margin: 26rpx 31rpx 0 74%;
- }
- }
- }
- </style>
|