123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392 |
- <template>
- <view class="content">
- <view class="top hflex acenter jbetween">
- <view class="top_item" :class="active1 == 1 ? 'active1':''" @click="changeType(1)">我是船老板</view>
- <view class="top_item" :class="active1 == 2 ? 'active1':''" @click="changeType(2)">我是维修工</view>
- </view>
- <view class="order">
- <view class="tabs hflex acenter jbetween">
- <block v-for="(item,index) in tabs" :key="index">
- <view class="tabs_item" :class="active == index + 1? 'active': ''" @click="changeTabs(index + 1)">{{item.text}}</view>
- </block>
- </view>
- <view class="box_list" v-if="active1 == 1 && pageList.length > 0">
- <block v-for="(item,index) in pageList" :key="index">
- <view class="box_item">
- <view class="box_top hflex acenter jbetween" @click="toDetail(item.order_no)">
- <view class="order_no">订单号:{{item.order_no}}</view>
- <view class="type" v-if="item.status == 1">未报价</view>
- <view class="type1" v-if="item.status == 2">已报价</view>
- <view class="type1" v-if="item.status == 3">已匹配</view>
- </view>
- <view class="box">
- <view class="text_style1" >
- <span class="urgent1" v-if="item.quick == '2'">快修</span>
- <span class="urgent" v-else>普修</span>
- {{item.describe}}
- </view>
- <view class="box_cell text_style2">维修时间:{{item.start_time}}~{{item.end_time}}</view>
- <view class="box_cell text_style2">维修地点:{{item.address}}</view>
- </view>
- <view class="bottom1 hflex jend">
- <view class="btn1" v-if="item.status !== 3" @click="deleteId(item.id)">删除</view>
- <view class="btn1" v-if="item.status !== 3" @click="toEdit(item)">编辑</view>
- <view class="btn1" @click="toDetail(item.id,active1)">查看详情</view>
- </view>
- </view>
- </block>
- <!-- <my-order @toDetail="toDetail" :active1="active" :list="pageList" order_type="5" @toEdit="toEdit"></my-order> -->
- </view>
- <block v-if="active1 == 1 && pageList.length == 0">
- <view class="vflex acenter jcenter" style="height: 80vh;">
- <image src="@/static/images/no_list.png" mode="widthFix" style="width: 350rpx;"></image>
- <view class="text">暂时没有数据^^</view>
- </view>
- </block>
- <view class="box_list" v-if="active1 == 2 && pageList.length > 0">
- <block v-for="(item,index) in pageList" :key="index">
- <view class="box_item">
- <view class="box_top hflex acenter jbetween" @click="toDetail(item.repair.order_no)">
- <view class="order_no">订单号:{{item.repair.order_no}}</view>
- <view class="type" v-if="active == 1">未报价</view>
- <view class="type1" v-if="active == 2">已报价</view>
- <view class="type1" v-if="active == 3">已匹配</view>
- </view>
- <view class="box">
- <view class="text_style1" >
- <span class="urgent1" v-if="item.repair.quick == '2'">快修</span>
- <span class="urgent" v-else>普修</span>
- {{item.repair.describe}}
- </view>
- <view class="box_cell text_style2">维修时间:{{item.repair.start_time}}~{{item.repair.end_time}}</view>
- <view class="box_cell text_style2">维修地点:{{item.repair.address}}</view>
- </view>
- <view class="bottom1 hflex jend">
- <view class="btn1" @click="toDetail2(item.id,active1)">查看详情</view>
- </view>
- </view>
- </block>
- <!-- <my-order @toDetail="toDetail" :active1="active" :list="pageList" order_type="5" @toEdit="toEdit"></my-order> -->
- </view>
- <block v-if="active1 == 2 && pageList.length == 0">
- <view class="vflex acenter jcenter" style="height: 80vh;">
- <image src="@/static/images/no_list.png" mode="widthFix" style="width: 350rpx;"></image>
- <view class="text">暂时没有数据^^</view>
- </view>
- </block>
- <view class="add vflex acenter jcenter" v-show="active1 == 1" @click="toPublish">
- <u-icon name="plus" color='#fff' size="16"></u-icon>
- <view class="add_text">发布维修单</view>
- </view>
- </view>
- </view>
-
- </template>
- <script>
- import $api from '@/static/js/api.js'
- var that = ''
- export default {
- data() {
- return {
- tabs: [
- {
- id: 1,
- text: '未报价'
- },
- {
- id: 2,
- text: '已报价'
- },
- {
- id: 3,
- text: '已匹配'
- }
- ],
- active: 1,
- active1: 1,
- pageList: [
- ],
- page: 1,
- total: 1
- }
- },
- onLoad() {
- that = this
- },
- onShow() {
- that.getList()
- },
- methods: {
- getList() {
- $api.req({
- url: '/data/api.auth.Center/repair',
- method: 'POST',
- data: {
- type: that.active1,
- status: that.active,
- page: that.page
- }
- }, function(res) {
- if(res.code == 1) {
- if(that.page > 1) {
- that.pageList = that.pageList.concat(res.data.data)
- } else {
- that.pageList = res.data.data
- }
- that.total = res.data.total
- }
- })
- },
- // 切换tabs
- changeTabs(id) {
- that.active = id
- that.page = 1
- that.pageList = []
- that.getList()
- },
- // 切换身份
- changeType(id) {
- that.active1 = id
- that.active = 1
- that.page = 1
- that.pageList = []
- that.getList()
- },
- toDetail(e,type) {
- console.log(e);
- $api.jump('/page_shop/pages/order/repairDetail?id=' + e + '&type=' + that.active1)
- },
- toDetail2(e,type) {
- $api.jump('/page_shop/pages/order/repairDetail2?id=' + e + '&type=' + that.active1)
- },
- toPublish() {
- $api.jump('/page_index/pages/repair/repairOrder')
- },
- toEdit(e) {
- $api.jump('/page_index/pages/repair/repairOrder?data=' + JSON.stringify(e))
- },
- deleteId(id) {
- $api.req({
- url: '/data/api.auth.Center/repairdel',
- method: 'POST',
- data: {
- id: id
- }
- }, function(res) {
- if(res.code == 1) {
- $api.info(res.info)
- that.getList()
- }
- })
- },
- onReachBottom() {
- if (Number(that.page) * 15 >= Number(that.total)) {
- $api.info("没有更多了")
- } else {
- that.page++
- that.getList()
- }
-
- }
- },
- }
- </script>
- <style lang="scss" scoped>
- .content {
- background: #f4f4f4;
- .top {
- width: 650rpx;
- height: 80rpx;
- margin: 20rpx auto;
- background-color: #fff;
- border-radius: 40rpx;
- .top_item {
- width: 50%;
- height: 68rpx;
- text-align: center;
- font-size: 30rpx;
- color: #222;
- line-height: 68rpx;
- }
- .active1 {
- width: 320rpx;
- height: 68rpx;
- border-radius: 34rpx;
- background-color: #506dff;
- color: #fff;
- }
- }
- .order {
- width: 100%;
- background-color: linear-gradient(180deg, #fff 0%, rgba(255,255,255,0) 100%);
- border-radius: 40rpx 40rpx 0 0;
- padding: 0 0 40rpx;
- }
- .tabs {
- width: 100%;
- // background-color: linear-gradient(180deg, #fff 0%, rgba(255,255,255,0) 100%);
- box-sizing: border-box;
- padding: 20rpx 56rpx;
- .tabs_item {
- font-size: 32rpx;
- color: #242424;
- }
- .active {
- color: #222;
- position: relative;
- }
- .active::after {
- content: "";
- position: absolute;
- width: 48rpx;
- height: 8rpx;
- background-color: #506dff;
- border-radius: 4rpx;
- bottom: -14rpx;
- left: 24rpx;
- }
-
- }
- .box_list {
-
- padding: 0 30rpx;
-
- .box_item {
- margin: 20rpx 0 0;
- width: 100%;
- box-sizing: border-box;
- padding: 26rpx 20rpx;
- margin-top: 20rpx;
- border-radius: 20rpx;
- background-color: #fff;
- }
- .box_top {
- padding-bottom: 24rpx;
- width: 100%;
- .order_no {
- font-size: 24rpx;
- color: #444;
- }
- .type {
- width: 96rpx;
- height: 40rpx;
- background-color: #fff4e8;
- border-radius: 4rpx;
- font-size: 22rpx;
- color: #fba94e;
- text-align: center;
- line-height: 40rpx;
- }
- .type1 {
- width: 96rpx;
- height: 40rpx;
- background-color: #e7ebf7;
- border-radius: 4rpx;
- font-size: 22rpx;
- color: #506dff;
- text-align: center;
- line-height: 40rpx;
- }
- }
- .box {
- width: 100%;
- padding-top: 14rpx;
- border-top: 1rpx solid #f4f4f4;
- .text_style1 {
- font-size: 28rpx;
- color: #222;
- line-height: 40rpx;
- display: inline-block;
- text-overflow: ellipsis;
- overflow: hidden;
- display: -webkit-box;
- -webkit-box-orient: vertical;
- box-orient: vertical;
- line-clamp: 2;
- -webkit-line-clamp: 2;
- }
- .urgent1 {
- width: 72rpx;
- height: 32rpx;
- background-color: #ff762C;
- border-radius: 4rpx;
- color: #fff;
- font-size: 24rpx;
- text-align: center;
- line-height: 32rpx;
- display: inline-block;
- margin-right: 8rpx;
- }
- .urgent {
- width: 72rpx;
- height: 32rpx;
- background-color: #5571ff;
- border-radius: 4rpx;
- color: #fff;
- font-size: 24rpx;
- text-align: center;
- line-height: 32rpx;
- display: inline-block;
- margin-right: 8rpx;
- }
- .box_norm {
- width: auto;
- background-color: #f4f4f4;
- border-radius: 8rpx;
- box-sizing: border-box;
- padding: 6rpx 20rpx;
- margin: 16rpx 0 24rpx;
- }
- .box_cell {
- margin: 16rpx 0 24rpx;
- }
- .text_style2 {
- font-size: 24rpx;
- color: #888;
- padding-right: 20rpx;
- }
- .text {
- width: 100%;
- padding-bottom: 20rpx;
- font-size: 26rpx;
- color: #888;
- line-height: 36rpx;
- }
- }
- .bottom1 {
- width: 100%;
- padding-top: 20rpx;
- border-top: 1rpx solid #f4f4f4;
- }
- .btn1 {
- width: 152rpx;
- height: 52rpx;
- // background-color: #eaf4ff;
- border-radius: 28rpx;
- border: 1rpx solid #e5e5e5;
- font-size: 26rpx;
- color: #2f2f2f;
- text-align: center;
- line-height: 52rpx;
- margin-left: 24rpx;
- }
- }
- .add {
- width: 96rpx;
- height: 96rpx;
- border-radius: 50%;
- background: linear-gradient(180deg, #88A6FF 0%, #506DFF 100%);
- position: fixed;
- right: 30rpx;
- bottom: 166rpx;
- .add_text {
- font-size: 14rpx;
- font-weight: 400;
- color: #FFFFFF;
- line-height: 18rpx;
- }
- }
- }
- </style>
|