Commit 7a0a0df3 authored by Facius's avatar Facius

订单列表页ui修改

parent f9921081
...@@ -185,7 +185,7 @@ ...@@ -185,7 +185,7 @@
}] }]
}, },
buttonDisabled() { buttonDisabled() {
return this.orderData.orderStatus == 4 || this.orderData.orderStatus == 6 return this.orderType == 4 || this.orderType == 6
}, },
dizhiImage() { dizhiImage() {
return process.uniEnv.qn_base_url + 'shouye-dizhi.png' return process.uniEnv.qn_base_url + 'shouye-dizhi.png'
...@@ -267,6 +267,7 @@ ...@@ -267,6 +267,7 @@
align-items: center; align-items: center;
.tag-view { .tag-view {
text-align: center;
width: 84rpx; width: 84rpx;
height: 40rpx; height: 40rpx;
color: #FFFFFF; color: #FFFFFF;
...@@ -287,6 +288,7 @@ ...@@ -287,6 +288,7 @@
} }
.right-view { .right-view {
text-align: center;
width: 100rpx; width: 100rpx;
height: 40rpx; height: 40rpx;
background-color: #F4F5F7; background-color: #F4F5F7;
...@@ -361,6 +363,7 @@ ...@@ -361,6 +363,7 @@
align-items: center; align-items: center;
.bottom-tag-view { .bottom-tag-view {
text-align: center;
width: 52rpx; width: 52rpx;
height: 52rpx; height: 52rpx;
border-radius: 26rpx; border-radius: 26rpx;
......
<template>
<view class="content">
<u-navbar :is-back="false" :is-fixed="false" :background="{ background: 'transparent' }" :border-bottom="false">
<text class="title-view">{{title}}</text>
</u-navbar>
<slot></slot>
</view>
</template>
<script>
export default {
props: {
title: {
type: String,
default: '充电桩自营平台'
}
},
data() {
return {
}
},
methods: {
}
}
</script>
<style lang="scss" scoped>
.content {
height: 100vh;
background-color: #f4f5f7;
padding: 0rpx 30rpx 0 30rpx;
overflow-y: auto;
.title-view {
color: #333333;
font-weight: bold;
font-size: 40rpx;
}
}
</style>
...@@ -14,7 +14,9 @@ ...@@ -14,7 +14,9 @@
{ {
"path": "pages/order/index", "path": "pages/order/index",
"style": { "style": {
"navigationBarTitleText": "订单" "navigationBarTitleText": "订单",
"navigationStyle": "custom",
"enablePullDownRefresh": true
} }
}, },
{ {
...@@ -207,7 +209,7 @@ ...@@ -207,7 +209,7 @@
"navigationBarTextStyle": "black", "navigationBarTextStyle": "black",
"navigationBarTitleText": "uni-app", "navigationBarTitleText": "uni-app",
"navigationBarBackgroundColor": "#F8F8F8", "navigationBarBackgroundColor": "#F8F8F8",
"backgroundColor": "#F8F8F8" "backgroundColor": "#F4F5F7"
}, },
"tabBar": { "tabBar": {
"color": "#7A7E83", "color": "#7A7E83",
......
<template> <template>
<view class="content"> <TabBarPage title="充电桩自营平台">
<!-- <view style="width: 700rpx; height: 800rpx"> -->
<!-- <view class="title-view">充电桩自营平台</view> -->
<u-navbar :is-back="false" :is-fixed="false" :background="{ background: 'transparent' }" :border-bottom="false">
<text class="title-view">充电桩自营平台</text>
</u-navbar>
<!-- <u-swiper
:height="240"
:list="list"
:indicator-pos="indicatorPos"
:mode="mode"
:interval="3000"
@click="clickSwiper"
>
</u-swiper> -->
<image class="banner-image" :src="bannerImage"></image> <image class="banner-image" :src="bannerImage"></image>
<view class="msg-view"> <view class="msg-view">
...@@ -66,23 +52,24 @@ ...@@ -66,23 +52,24 @@
</view> </view>
<!-- </view> --> <!-- </view> -->
<!-- </scroll-view> --> <!-- </scroll-view> -->
<view class="bottom-view"> <view class="bottom-view" v-if="needSettled || orderList.length <= 0">
<view class="bottom-line-view"></view> <view class="bottom-line-view"></view>
<view class="bottom-text">我也是有底线哒</view> <view class="bottom-text">我也是有底线哒</view>
<view class="bottom-line-view"></view> <view class="bottom-line-view"></view>
</view> </view>
</view> </TabBarPage>
</template> </template>
<script> <script>
import util from "@/utils/util.js"; import util from "@/utils/util.js";
import TabBarPage from "@/components/tabBarList/index.vue"
const app = getApp(); const app = getApp();
import OrderCell from "@/components/order/index.vue"; import OrderCell from "@/components/order/index.vue";
export default { export default {
components: { components: {
OrderCell, OrderCell,
TabBarPage
}, },
data() { data() {
return { return {
...@@ -102,12 +89,13 @@ ...@@ -102,12 +89,13 @@
pageNumber: 0, pageNumber: 0,
pageSize: 10, pageSize: 10,
}, },
bottomLoading: false, bottomLoading: false
}; };
}, },
watch: { watch: {
vuex_token(val) { vuex_token(val, oldVal) {
// 监听token变化,如果更新则重新加载页面数据 // 监听token变化,如果更新则重新加载页面数据
console.log('', val, oldVal)
val && this.initSettleInfo() val && this.initSettleInfo()
} }
}, },
...@@ -142,10 +130,11 @@ ...@@ -142,10 +130,11 @@
// 每次进入页面都刷新入驻状态 // 每次进入页面都刷新入驻状态
if (this.vuex_token) { if (this.vuex_token) {
this.initSettleInfo(); this.initSettleInfo();
} else {
// 初始化订单数据
this.loadOrderList();
} }
// else {
// // 初始化订单数据
// this.loadOrderList();
// }
}, },
onPullDownRefresh() { onPullDownRefresh() {
console.log('------下拉刷新------') console.log('------下拉刷新------')
...@@ -194,6 +183,8 @@ ...@@ -194,6 +183,8 @@
}); });
}, },
loadOrderList() { loadOrderList() {
console.log('-----------准备加载推荐列表-----------')
return
let self = this; let self = this;
// 加载订单列表 // 加载订单列表
self.search.token = self.vuex_token; self.search.token = self.vuex_token;
...@@ -208,21 +199,6 @@ ...@@ -208,21 +199,6 @@
} }
}); });
}, },
onRefresh() {
if (this._freshing) return;
this._freshing = true;
// 获取入驻状态
this.initSettleInfo();
// 获取推荐订单及数量
// ....
setTimeout(() => {
// 数据加载完成更新入驻状态和推荐列表
this.triggered = false;
this._freshing = false;
}, 1000);
},
onRestore() { onRestore() {
this.triggered = "restore"; this.triggered = "restore";
}, },
...@@ -294,18 +270,6 @@ ...@@ -294,18 +270,6 @@
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.content {
height: 100vh;
background-color: #f4f5f7;
padding: 0rpx 30rpx 0 30rpx;
overflow-y: auto;
.title-view {
color: #333333;
font-weight: bold;
font-size: 40rpx;
}
.banner-image { .banner-image {
width: 730rpx; width: 730rpx;
height: 280rpx; height: 280rpx;
...@@ -368,7 +332,7 @@ ...@@ -368,7 +332,7 @@
} }
} }
} }
}
.logo { .logo {
height: 200 rpx; height: 200 rpx;
......
<template> <template>
<view> <TabBarPage title="订单">
<view class="wrap"> <view class="wrap">
<view class="tools-box"> <view class="tools-box">
<view class="search-sub"> <view class="search-sub">
<u-subsection <u-subsection :current="curNow" :list="subList" active-color="white" bg-color="white"
:current="curNow" inactive-color="#666" button-color="#2272FF" border-radius="36" @change="sectionChange">
:list="['待受理', '已完工']" </u-subsection>
active-color="white"
bg-color="white"
inactive-color="#666"
button-color="#2272FF"
border-radius="36"
@change="sectionChange"
></u-subsection>
</view> </view>
<view class="search-btn"> <view class="search-btn">
<u-icon name="search" color="#666" size="32"></u-icon> <u-icon name="search" color="#666" size="32"></u-icon>
<text class="search-btn-text">搜订单</text> <text class="search-btn-text">搜订单</text>
</view> </view>
</view> </view>
<view class="u-tabs-box" v-show="showSview"> <view class="u-tabs-box" v-show="curNow == 0">
<u-tabs-swiper <u-tabs-swiper activeColor="#2272FF" bg-color="none" inactive-color="#999" bar-height="4" bar-width="44"
activeColor="#2272FF" :offset="[-1,10]" ref="tabs" :list="list" count="total" :current="current" @change="change"
bg-color="none" :is-scroll="false" swiperWidth="750"></u-tabs-swiper>
inactive-color="#999"
bar-height="4" bar-width="44"
:offset="[-1,10]"
ref="tabs"
:list="list"
:current="current"
@change="change"
:is-scroll="false"
swiperWidth="750"
></u-tabs-swiper>
</view> </view>
<swiper v-show="showSview" class="swiper-box" :current="swiperCurrent" @transition="transition" @animationfinish="animationfinish"> <swiper class="swiper-box" :current="swiperCurrent" @transition="transition"
<swiper-item class="swiper-item"> @animationfinish="animationfinish">
<scroll-view scroll-y style="height: 100%;width: 100%;" @scrolltolower="reachBottom"> <swiper-item class="swiper-item" v-for="(res, ind) in orderLists" :key="ind">
<scroll-view scroll-y style="height: 100%;width: 100%;" @scrolltolower="reachBottom"
refresher-enabled @refresherrefresh="refresherrefresh">
<view class="page-box"> <view class="page-box">
<view class="order" v-for="(res, index) in orderList" :key="res.id"> <view v-for="(item, index) in res" :key="item.orderId">
<view class="top"> <OrderCell :orderData="item" :orderType="orderType" :location="dataValue"
<view class="left"> @click="handleClick(item)" @action="handleAction(item)"> </OrderCell>
<view class="tag">{{ res.orderServiceType }}</view>
<view class="store">{{ res.categoryName }}</view>
<view >{{ res.orderNumber }}</view>
</view>
<view class="right">{{ res.orderBusinessTypeText }}</view>
</view>
<view class="content">
<view class="title u-line-2">
<text>{{res.contactName }}</text> <text style="margin-left: 8rpx;">{{ res.contactPhone }}</text>
</view>
</view>
<view class="address u-line-2">
<view class="left">
<view ><u-icon name="map" size="32"></u-icon>
<text style="margin-left: 8rpx;">{{res.contactAddress }}</text></view>
</view>
<view class="right">{{getDistance(res.contactAddressLatitud,res.contactAddressLongitud)}}km</view>
</view>
<u-divider margin-top="16" half-width="630" border-color="#F4F5F7" :use-slot="false">
</u-divider>
<view class="bottom">
<view class="left">
<view class="tag">{{res.currentOverTime * 1000 > new Date().getTime()?'剩':'超'}}</view>
<u-count-down :timestamp="timestampDiff(res.currentOverTime)" font-size="44" color="#FF930D" :ref="'uCountDown' + index" @change="timeChange(res.currentOverTime,index)" >
</u-count-down>
</view>
<view class="right-btn" @click="viewOderItem(index)">
<text>去预约</text>
</view>
</view>
</view>
<u-loadmore :status="loadStatus[0]" bgColor="#f2f2f2"></u-loadmore>
</view>
</scroll-view>
</swiper-item>
<swiper-item class="swiper-item">
<scroll-view scroll-y style="height: 100%;width: 100%;" @scrolltolower="reachBottom">
<view class="page-box">
<view class="order" v-for="(res, index) in orderList" :key="res.id">
<view class="top">
<view class="left">
<view class="tag">{{ res.orderServiceType }}</view>
<view class="store">{{ res.categoryName }}</view>
<view >{{ res.orderNumber }}</view>
</view>
<view class="right">{{ res.orderBusinessTypeText }}</view>
</view>
<view class="content">
<view class="title u-line-2">
<text>{{res.contactName }}</text> <text style="margin-left: 8rpx;">{{ res.contactPhone }}</text>
</view>
</view>
<view class="address u-line-2">
<view class="left">
<view ><u-icon name="map" size="32"></u-icon>
<text style="margin-left: 8rpx;">{{res.contactAddress }}</text></view>
</view>
<view class="right">{{getDistance(res.contactAddressLatitud,res.contactAddressLongitud)}}km</view>
</view>
<u-divider margin-top="16" half-width="630" border-color="#F4F5F7" :use-slot="false">
</u-divider>
<view class="bottom">
<view class="left">
<view class="tag">{{res.currentOverTime * 1000 > new Date().getTime()?'剩':'超'}}</view>
<u-count-down :timestamp="timestampDiff(res.currentOverTime)" font-size="44" color="#FF930D" :ref="'uCountDown' + index" @change="timeChange(res.currentOverTime,index)" >
</u-count-down>
</view>
<view class="right-btn" @click="viewOderItem(index)">
<text>去签到</text>
</view>
</view>
</view>
<u-loadmore :status="loadStatus[0]" bgColor="#f2f2f2"></u-loadmore>
</view>
</scroll-view>
</swiper-item>
<swiper-item class="swiper-item">
<scroll-view scroll-y style="height: 100%;width: 100%;" v-if="orderList.length === 0">
<view class="page-box">
<view>
<view class="centre">
<image src="https://cdn.uviewui.com/uview/template/taobao-order.png" mode=""></image>
<view class="explain">
您还没有相关的订单
<view class="tips">可以去看看有那些想买的</view>
</view>
<view class="btn">随便逛逛</view>
</view>
</view>
</view>
</scroll-view>
<scroll-view scroll-y style="height: 100%;width: 100%;" @scrolltolower="reachBottom" v-else>
<view class="page-box">
<view class="order" v-for="(res, index) in orderList" :key="res.id">
<view class="top">
<view class="left">
<view class="tag">{{ res.orderServiceType }}</view>
<view class="store">{{ res.categoryName }}</view>
<view >{{ res.orderNumber }}</view>
</view>
<view class="right">{{ res.orderBusinessTypeText }}</view>
</view>
<view class="content">
<view class="title u-line-2">
<text>{{res.contactName }}</text> <text style="margin-left: 8rpx;">{{ res.contactPhone }}</text>
</view>
</view>
<view class="address u-line-2">
<view class="left">
<view ><u-icon name="map" size="32"></u-icon>
<text style="margin-left: 8rpx;">{{res.contactAddress }}</text></view>
</view>
<view class="right">{{getDistance(res.contactAddressLatitud,res.contactAddressLongitud)}}km</view>
</view>
<u-divider margin-top="16" half-width="630" border-color="#F4F5F7" :use-slot="false">
</u-divider>
<view class="bottom">
<view class="left">
<view class="tag">{{res.currentOverTime * 1000 > new Date().getTime()?'剩':'超'}}</view>
<u-count-down :timestamp="timestampDiff(res.currentOverTime)" font-size="44" color="#FF930D" :ref="'uCountDown' + index" @change="timeChange(res.currentOverTime,index)" >
</u-count-down>
</view>
<view class="right-btn" @click="viewOderItem(index)">
<text>去完工</text>
</view>
</view>
</view>
<u-loadmore :status="loadStatus[0]" bgColor="#f2f2f2"></u-loadmore>
</view>
</scroll-view>
</swiper-item>
<swiper-item class="swiper-item">
<scroll-view scroll-y style="height: 100%;width: 100%;" @scrolltolower="reachBottom">
<view class="page-box">
<view class="order" v-for="(res, index) in orderList" :key="res.id">
<view class="top">
<view class="left">
<view class="tag">{{ res.orderServiceType }}</view>
<view class="store">{{ res.categoryName }}</view>
<view >{{ res.orderNumber }}</view>
</view>
<view class="right">{{ res.orderBusinessTypeText }}</view>
</view>
<view class="content">
<view class="title u-line-2">
<text>{{res.contactName }}</text> <text style="margin-left: 8rpx;">{{ res.contactPhone }}</text>
</view>
</view>
<view class="address u-line-2">
<view class="left">
<view ><u-icon name="map" size="32"></u-icon>
<text style="margin-left: 8rpx;">{{res.contactAddress }}</text></view>
</view>
<view class="right">{{getDistance(res.contactAddressLatitud,res.contactAddressLongitud)}}km</view>
</view>
<u-divider margin-top="16" half-width="630" border-color="#F4F5F7" :use-slot="false">
</u-divider>
<view class="bottom">
<view class="left">
<view class="tag">{{res.currentOverTime * 1000 > new Date().getTime()?'剩':'超'}}</view>
<u-count-down :timestamp="timestampDiff(res.currentOverTime)" font-size="44" color="#FF930D" :ref="'uCountDown' + index" @change="timeChange(res.currentOverTime,index)" >
</u-count-down>
</view>
<view class="right-btn" @click="viewOderItem(index)">
<text>审核中</text>
</view>
</view>
</view>
<u-loadmore :status="loadStatus[0]" bgColor="#f2f2f2"></u-loadmore>
</view>
</scroll-view>
</swiper-item>
<swiper-item class="swiper-item">
<scroll-view scroll-y style="height: 100%;width: 100%;" @scrolltolower="reachBottom">
<view class="page-box">
<view class="order" v-for="(res, index) in orderList" :key="res.id">
<view class="top">
<view class="left">
<view class="tag">{{ res.orderServiceType }}</view>
<view class="store">{{ res.categoryName }}</view>
<view >{{ res.orderNumber }}</view>
</view>
<view class="right">{{ res.orderBusinessTypeText }}</view>
</view>
<view class="content">
<view class="title u-line-2">
<text>{{res.contactName }}</text> <text style="margin-left: 8rpx;">{{ res.contactPhone }}</text>
</view>
</view>
<view class="address u-line-2">
<view class="left">
<view ><u-icon name="map" size="32"></u-icon>
<text style="margin-left: 8rpx;">{{res.contactAddress }}</text></view>
</view>
<view class="right">{{getDistance(res.contactAddressLatitud,res.contactAddressLongitud)}}km</view>
</view>
<u-divider margin-top="16" half-width="630" border-color="#F4F5F7" :use-slot="false">
</u-divider>
<view class="bottom">
<view class="left">
<view class="tag">{{res.currentOverTime * 1000 > new Date().getTime()?'剩':'超'}}</view>
<u-count-down :timestamp="timestampDiff(res.currentOverTime)" font-size="44" color="#FF930D" :ref="'uCountDown' + index" @change="timeChange(res.currentOverTime,index)" >
</u-count-down>
</view>
<view class="right-btn" @click="viewOderItem(index)">
<text>去处理</text>
</view>
</view>
</view> </view>
<u-loadmore :status="loadStatus[0]" bgColor="#f2f2f2"></u-loadmore> <u-loadmore :status="loadStatus[0]" bgColor="#f2f2f2"></u-loadmore>
</view> </view>
...@@ -265,171 +33,79 @@ ...@@ -265,171 +33,79 @@
</swiper-item> </swiper-item>
</swiper> </swiper>
<swiper v-show="!showSview" class="swiper-box" :current="swiperCurrent" @transition="transition" @animationfinish="animationfinish">
<swiper-item class="swiper-item">
<scroll-view scroll-y style="height: 100%;width: 100%;" @scrolltolower="reachBottom">
<view class="page-box">
<view class="order" v-for="(res, index) in orderList" :key="res.id">
<view class="top">
<view class="left">
<view class="tag">{{ res.orderServiceType }}</view>
<view class="store">{{ res.categoryName }}</view>
<view >{{ res.orderNumber }}</view>
</view>
<view class="right">{{ res.orderBusinessTypeText }}</view>
</view>
<view class="content">
<view class="title u-line-2">
<text>{{res.contactName }}</text> <text style="margin-left: 8rpx;">{{ res.contactPhone }}</text>
</view>
</view>
<view class="address u-line-2">
<view class="left">
<view >
<u-icon name="map" size="32"></u-icon>
<text style="margin-left: 8rpx;">{{res.contactAddress }}</text>
<text style="margin-left: 200rpx; font-size:large;" @click="viewOderItem(index)" > > </text>
</view>
</view>
</view>
<u-divider margin-top="16" half-width="630" border-color="#F4F5F7" :use-slot="false">
</u-divider>
<view class="bottom">
<view class="left">
<text>审核时间 :</text><text>{{res.auditDatetime}}</text>
</view>
<view >
<text>已完工</text>
</view>
</view>
</view>
<!-- <u-loadmore :status="loadStatus[0]" bgColor="#f2f2f2"></u-loadmore> -->
</view>
</scroll-view>
</swiper-item>
</swiper>
</view>
</view> </view>
</TabBarPage>
</template> </template>
<script> <script>
export default { import TabBarPage from "@/components/tabBarList/index.vue"
import OrderCell from "@/components/order/index.vue";
export default {
components: {
TabBarPage,
OrderCell
},
data() { data() {
return { return {
showSview : true, showSview: true,
curNow : 0, curNow: 0,
timestamp:1000, timestamp: 1000,
//waitAccept、waitAppointment、waitCheckIn、waitFinish、exception、finish //waitAccept、waitAppointment、waitCheckIn、waitFinish、exception、finish
indexStatus:{0:'waitAccept',1:'waitAppointment',2:'waitCheckIn',3:'waitFinish',4:'exception',5:'finish'}, indexStatus: {
orderList: [], 0: 'waitAccept',
dataList: [ 1: 'waitAppointment',
{ 2: 'waitCheckIn',
id: 1, 3: 'waitFinish',
store: '夏日流星限定贩卖', 4: 'exception',
deal: '交易成功', 5: 'finish'
goodsList: [
{
goodsUrl: '//img13.360buyimg.com/n7/jfs/t1/103005/7/17719/314825/5e8c19faEb7eed50d/5b81ae4b2f7f3bb7.jpg',
title: '【冬日限定】现货 原创jk制服女2020冬装新款小清新宽松软糯毛衣外套女开衫短款百搭日系甜美风',
type: '灰色;M',
deliveryTime: '付款后30天内发货',
price: '348.58',
number: 2
}
]
},
{
id: 2,
store: '江南皮革厂',
deal: '交易失败',
goodsList: [
{
goodsUrl: '//img14.360buyimg.com/n7/jfs/t1/60319/15/6105/406802/5d43f68aE9f00db8c/0affb7ac46c345e2.jpg',
title: '【冬日限定】现货 原创jk制服女2020冬装新款小清新宽松软糯毛衣外套女开衫短款百搭日系甜美风',
type: '粉色;M',
deliveryTime: '付款后7天内发货',
price: '128.05',
number: 1
}
]
},
{
id: 3,
store: '三星旗舰店',
deal: '交易失败',
goodsList: [
{
goodsUrl: '//img11.360buyimg.com/n7/jfs/t1/94448/29/2734/524808/5dd4cc16E990dfb6b/59c256f85a8c3757.jpg',
title: '三星(SAMSUNG)京品家电 UA65RUF70AJXXZ 65英寸4K超高清 HDR 京东微联 智能语音 教育资源液晶电视机',
type: '4K,广色域',
deliveryTime: '保质5年',
price: '1998',
number: 3
}
]
},
{
id: 4,
store: '三星旗舰店',
deal: '交易失败',
goodsList: [
{
goodsUrl: '//img10.360buyimg.com/n7/jfs/t22300/31/1505958241/171936/9e201a89/5b2b12ffNe6dbb594.jpg!q90.jpg',
title: '法国进口红酒 拉菲(LAFITE)传奇波尔多干红葡萄酒750ml*6整箱装',
type: '4K,广色域',
deliveryTime: '珍藏10年好酒',
price: '1543',
number: 3
}
]
}, },
{ orderLists: [
id: 5, [],
store: '三星旗舰店', [],
deal: '交易成功', [],
goodsList: [ [],
{ [],
goodsUrl: '//img12.360buyimg.com/n7/jfs/t1/52408/35/3554/78293/5d12e9cfEfd118ba1/ba5995e62cbd747f.jpg!q90.jpg', []
title: '企业微信 中控人脸指纹识别考勤机刷脸机 无线签到异地多店打卡机WX108',
type: '识别效率高',
deliveryTime: '使用方便',
price: '451',
number: 9
}
]
}
], ],
list: [ dataList: [],
{ list: [{
name: '待预约', name: '待预约',
count: 3 total: 0,
pageNumber: 0,
pageSize: 10
}, },
{ {
name: '待签到', name: '待签到',
count: 2 total: 0,
pageNumber: 0,
pageSize: 10
}, },
{ {
name: '待完工', name: '待完工',
count: 2 total: 0,
pageNumber: 0,
pageSize: 10
}, },
{ {
name: '待审核', name: '待审核',
count: 10 total: 0,
pageNumber: 0,
pageSize: 10
}, },
{ {
name: '异常单', name: '异常单',
count: 2 total: 0,
pageNumber: 0,
pageSize: 10
} }
], ],
current: 0, current: 0,
swiperCurrent: 0, swiperCurrent: 0,
tabsHeight: 0, tabsHeight: 0,
dx: 0, dx: 0,
loadStatus: ['loadmore', 'loadmore', 'loadmore', 'loadmore'], loadStatus: ['loading', 'loading', 'loading', 'loading', 'loading', 'loading'],
dataValue:[], dataValue: [],
total:0 total: 0
}; };
}, },
onLoad() { onLoad() {
...@@ -438,47 +114,43 @@ export default { ...@@ -438,47 +114,43 @@ export default {
this.getOrderList(0); this.getOrderList(0);
}, },
computed: { computed: {
// 价格小数 subList() {
priceDecimal() { return ['待受理', '已完工']
return val => {
if (val !== parseInt(val)) return val.slice(-2);
else return '00';
};
}, },
// 价格整数 // 0:待接单 1:'去预约', 2:'去签到', 3:'去完工', 4:'审核中', 5:'去处理', 6'已完工'
priceInt() { orderType() {
return val => { return this.currentIndex + 1
if (val !== parseInt(val)) return val.split('.')[0]; },
else return val; currentIndex() {
}; return this.curNow == 0 ? this.swiperCurrent : 5
} }
}, },
methods: { methods: {
sectionChange(index){ sectionChange(index) {
if(index === 1){ if (index === 1) {
this.showSview = false this.showSview = false
// 加载已完工的数据 // 加载已完工的数据
this.getOrderList(5) this.getOrderList(5)
}else { } else {
this.showSview = true this.showSview = true
// 加载已完工的数据 // 加载已完工的数据
this.getOrderList(0) this.getOrderList(0)
} }
this.curNow = index; this.curNow = index;
}, },
timeChange(currentOverTime,index){ timeChange(currentOverTime, index) {
let self = this let self = this
var nowTime = new Date(); // 当前时间 var nowTime = new Date(); // 当前时间
if(nowTime.getTime() > currentOverTime*1000){ if (nowTime.getTime() > currentOverTime * 1000) {
self.$refs['uCountDown'+index][0].seconds += 2 self.$refs['uCountDown' + index][0].seconds += 2
} }
}, },
timestampDiff(currentOverTime){ timestampDiff(currentOverTime) {
var nowTime = new Date(); // 当前时间 var nowTime = new Date(); // 当前时间
if(nowTime.getTime() > currentOverTime*1000){ if (nowTime.getTime() > currentOverTime * 1000) {
var diff = nowTime.getTime() - (currentOverTime*1000); var diff = nowTime.getTime() - (currentOverTime * 1000);
}else{ } else {
var diff = (currentOverTime*1000) - nowTime.getTime(); var diff = (currentOverTime * 1000) - nowTime.getTime();
} }
return diff; return diff;
}, },
...@@ -501,29 +173,7 @@ export default { ...@@ -501,29 +173,7 @@ export default {
} }
}); });
}, },
getDistance(Latitud, Longitud){
return this.distance(Latitud,Longitud,this.dataValue[0],this.dataValue[1])
},
/**
* echo distance(116.3896,39.91917,116.3940,39.91726);
* 计算两点之间直线距离
* @param float $lon1 经度
* @param float $lat1 维度
* @param float $lon2 经度
* @param float $lat2 维度
* @return float 浮点数
*/
distance(la1, lo1, la2, lo2) {
var La1 = la1 * Math.PI / 180.0;
var La2 = la2 * Math.PI / 180.0;
var La3 = La1 - La2;
var Lb3 = lo1 * Math.PI / 180.0 - lo2 * Math.PI / 180.0;
var s = 2 * Math.asin(Math.sqrt(Math.pow(Math.sin(La3 / 2), 2),Math.cos(La1) * Math.cos(La2) * Math.pow(Math.sin(Lb3 / 2), 2)));
s = s * 6378.137;//地球半径
s = Math.round(s * 10000) / 10000;
// console.log("计算结果",s,'KM');
return s?s.toFixed(2):0;
},
reachBottom() { reachBottom() {
// 此tab为空数据 // 此tab为空数据
if (this.current != 2) { if (this.current != 2) {
...@@ -536,23 +186,53 @@ export default { ...@@ -536,23 +186,53 @@ export default {
// 页面数据 // 页面数据
getOrderList(index) { getOrderList(index) {
// 状态处理 // 状态处理
console.log("chage:",this.indexStatus[index]) console.log("chage:", this.indexStatus[index])
var page=0 this.list[index].pageNumber += 1
var pageSize=10 var param = {
var param = {pageNumber:page,pageSize:pageSize,keyword:'',type:this.indexStatus[index]} pageNumber: this.list[index].pageNumber,
pageSize: this.list[index].pageSize,
keyword: '',
type: this.indexStatus[index]
}
var self = this; var self = this;
self.$u.api.listOrder(param).then((res) => { self.$u.api.listOrder(param).then((res) => {
if (res.code == 200) { if (res.code == 200) {
console.log("getOrderList",res.data) console.log("getOrderList", res.data)
/*↓↓↓↓↓↓↓↓↓↓测试数据↓↓↓↓↓↓↓↓↓↓*/
var res = {
data: {
total: 100,
orderType: this.currentIndex,
list: [{
orderServiceType: '安装', // 服务类型:安装、维修
categoryName: '充电桩', // 品类:充电桩
orderBusinessTypeText: '分配单', // 业务类型:分配单、订单池
orderNumber: 'OR2021041809827', // 工单编号
contactName: '郭小清', // 客户信息
contactPhone: '13631612077', // 联系方式
contactAddress: '湾街道荔枝花园D座125号', // 详细地址
contactAddressLatitud: '116.3896', // 联系人地址经度
contactAddressLongitud: '39.91917', // 联系人地址纬度
orderStatus: 0, // 工单状态
appointmentDatetime: '', // 预约时间
currentWillOverTime: 10000, // 剩余时间
currentOverTime: 0, // 超过时间
auditDatetime: '2021.04.19 12:45:09', // 审核时间
submissionTime: '2021.04.19 16:24:48', // 提交时间
auditResults: {}, // 审核结果
orderBusinessType: 'R', // 业务类型 R 为抢单
}]
}
}
/*↑↑↑↑↑↑↑↑↑↑测试数据↑↑↑↑↑↑↑↑↑↑↑↑↑*/
// 后台需要返回order_type,防止数据返回延迟期间点击了其他的tab
if (res.data) { if (res.data) {
self.orderList = res.data.list; self.orderLists[res.data.orderType].push(...res.data.list)
// //测试使用 self.list[res.data.orderType].total = res.data.total;
// self.orderList.forEach((item,index)=>{ self.loadStatus[res.data.orderType] = res.data.total > self.orderLists[res.data
// if(index === 1){ .orderType].length ? 'loading' : 'nomore'
// item.currentOverTime -= 10
// }
// })
self.total =res.data.total;
} }
} else { } else {
console.log(res.message, "获取订单数量失败!"); console.log(res.message, "获取订单数量失败!");
...@@ -560,24 +240,30 @@ export default { ...@@ -560,24 +240,30 @@ export default {
}); });
}, },
refresherrefresh() {
this.list[this.currentIndex].pageNumber = 0
this.orderLists[this.currentIndex] = []
this.getOrderList()
},
// 获取订单数量 // 获取订单数量
getOrderCount() { getOrderCount() {
var self = this; // 加载订单列表 var self = this; // 加载订单列表
self.$u.api.listOrderCount().then((res) => { self.$u.api.listOrderCount().then((res) => {
if (res.code == 200) { if (res.code == 200) {
console.log("===",res.data) console.log("===", res.data)
if (res.data) { if (res.data) {
self.list.forEach(item=>{ self.list.forEach(item => {
if(item.name==='待预约'){ if (item.name === '待预约') {
item.count=res.data.toAppointmentCount item.count = res.data.toAppointmentCount
}else if(item.name==='待签到'){ } else if (item.name === '待签到') {
item.count=res.data.toCheckinCount item.count = res.data.toCheckinCount
}else if(item.name==='待完工'){ } else if (item.name === '待完工') {
item.count=res.data.toFinishCount item.count = res.data.toFinishCount
}else if(item.name==='待审核'){ } else if (item.name === '待审核') {
item.count=res.data.reviewingCount item.count = res.data.reviewingCount
}else if(item.name==='异常单'){ } else if (item.name === '异常单') {
item.count=res.data.exceptionCount item.count = res.data.exceptionCount
} }
}) })
} }
...@@ -607,49 +293,72 @@ export default { ...@@ -607,49 +293,72 @@ export default {
this.swiperCurrent = index; this.swiperCurrent = index;
this.getOrderList(index); this.getOrderList(index);
}, },
transition({ detail: { dx } }) { transition({
detail: {
dx
}
}) {
this.$refs.tabs.setDx(dx); this.$refs.tabs.setDx(dx);
}, },
animationfinish({ detail: { current } }) { animationfinish({
detail: {
current
}
}) {
this.$refs.tabs.setFinishCurrent(current); this.$refs.tabs.setFinishCurrent(current);
this.swiperCurrent = current; this.swiperCurrent = current;
this.current = current; this.current = current;
},viewOderItem(index) { // 跳转工单详情页面 },
let order = this.orderList[index] viewOderItem(orderId) { // 跳转工单详情页面
console.log("order",order)
uni.navigateTo({ uni.navigateTo({
url: 'pages/order/detail?id='+order.orderId url: 'pages/order/detail?id=' + orderId
}) })
},
handleClick(item) {
console.log('click cell')
this.viewOderItem(item.orderId)
},
handleAction(item) {
console.log('click button')
this.viewOderItem(item.orderId)
} }
} }
}; };
</script> </script>
<style> <style>
/* #ifndef H5 */ /* #ifndef H5 */
page { page {
height: 100%; height: 100%;
background-color: #f2f2f2; background-color: #f2f2f2;
} }
/* #endif */
/* #endif */
</style> </style>
<style lang="scss" scoped> <style lang="scss" scoped>
.order { .u-tabs-box {
width: 710rpx; margin-bottom: 30rpx;
background-color: #ffffff; }
margin: 20rpx auto;
border-radius: 20rpx; .order {
box-sizing: border-box; // width: 710rpx;
padding: 20rpx; // background-color: #ffffff;
font-size: 28rpx; // margin: 20rpx auto;
// border-radius: 20rpx;
// box-sizing: border-box;
// padding: 20rpx;
// font-size: 28rpx;
.top { .top {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
align-items: center; align-items: center;
.left { .left {
display: flex; display: flex;
align-items: center; align-items: center;
.tag { .tag {
text-align: center; text-align: center;
width: 84rpx; width: 84rpx;
...@@ -661,6 +370,7 @@ page { ...@@ -661,6 +370,7 @@ page {
color: #FFFFFF; color: #FFFFFF;
line-height: 40rpx; line-height: 40rpx;
} }
.store { .store {
margin: 0 10rpx; margin: 0 10rpx;
font-size: 36rpx; font-size: 36rpx;
...@@ -669,6 +379,7 @@ page { ...@@ -669,6 +379,7 @@ page {
line-height: 36px; line-height: 36px;
} }
} }
.right { .right {
height: 40rpx; height: 40rpx;
background: #F4F5F7; background: #F4F5F7;
...@@ -680,10 +391,12 @@ page { ...@@ -680,10 +391,12 @@ page {
color: #333333; color: #333333;
} }
} }
.item { .item {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
margin: 20rpx 0 0; margin: 20rpx 0 0;
.content { .content {
.title { .title {
font-size: 26rpx; font-size: 26rpx;
...@@ -692,6 +405,7 @@ page { ...@@ -692,6 +405,7 @@ page {
line-height: 52rpx; line-height: 52rpx;
} }
} }
.address { .address {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
...@@ -700,32 +414,35 @@ page { ...@@ -700,32 +414,35 @@ page {
font-weight: 400; font-weight: 400;
color: #333333; color: #333333;
line-height: 52rpx; line-height: 52rpx;
.left {
} .left {}
.right {
.right {}
} }
} }
}
.total { .total {
margin-top: 20rpx; margin-top: 20rpx;
text-align: right; text-align: right;
font-size: 24rpx; font-size: 24rpx;
.total-price { .total-price {
font-size: 32rpx; font-size: 32rpx;
} }
} }
.bottom { .bottom {
display: flex; display: flex;
margin-top: 30rpx; margin-top: 30rpx;
padding: 0 10rpx; padding: 0 10rpx;
justify-content: space-between; justify-content: space-between;
align-items: center; align-items: center;
.left { .left {
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: space-between; justify-content: space-between;
.tag { .tag {
text-align: center; text-align: center;
width: 54rpx; width: 54rpx;
...@@ -739,6 +456,7 @@ page { ...@@ -739,6 +456,7 @@ page {
margin-right: 20rpx; margin-right: 20rpx;
} }
} }
.right-btn { .right-btn {
text-align: center; text-align: center;
width: 200rpx; width: 200rpx;
...@@ -752,22 +470,26 @@ page { ...@@ -752,22 +470,26 @@ page {
font-family: PingFangSC-Semibold, PingFang SC; font-family: PingFangSC-Semibold, PingFang SC;
} }
} }
} }
.centre {
.centre {
text-align: center; text-align: center;
margin: 200rpx auto; margin: 200rpx auto;
font-size: 32rpx; font-size: 32rpx;
image { image {
width: 164rpx; width: 164rpx;
height: 164rpx; height: 164rpx;
border-radius: 50%; border-radius: 50%;
margin-bottom: 20rpx; margin-bottom: 20rpx;
} }
.tips { .tips {
font-size: 24rpx; font-size: 24rpx;
color: #999999; color: #999999;
margin-top: 20rpx; margin-top: 20rpx;
} }
.btn { .btn {
margin: 80rpx auto; margin: 80rpx auto;
width: 200rpx; width: 200rpx;
...@@ -777,29 +499,34 @@ page { ...@@ -777,29 +499,34 @@ page {
font-size: 26rpx; font-size: 26rpx;
background: linear-gradient(270deg, rgba(249, 116, 90, 1) 0%, rgba(255, 158, 1, 1) 100%); background: linear-gradient(270deg, rgba(249, 116, 90, 1) 0%, rgba(255, 158, 1, 1) 100%);
} }
} }
.wrap {
.wrap {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
height: calc(100vh - var(--window-top)); height: calc(100vh - var(--window-top));
width: 100%; width: 100%;
} }
.swiper-box {
.swiper-box {
flex: 1; flex: 1;
} }
.swiper-item {
.swiper-item {
height: 100%; height: 100%;
} }
.tools-box {
.tools-box {
display: flex; display: flex;
flex-direction: row; flex-direction: row;
justify-content: space-between; justify-content: space-between;
padding: 20rpx 30rpx 18rpx 34rpx; padding: 20rpx 0rpx 18rpx 0rpx;
.search-sub { .search-sub {
height: 72rpx; height: 72rpx;
width: 320rpx; width: 320rpx;
} }
.search-btn { .search-btn {
height: 72rpx; height: 72rpx;
width: 220rpx; width: 220rpx;
...@@ -817,8 +544,9 @@ page { ...@@ -817,8 +544,9 @@ page {
font-size: 26rpx; font-size: 26rpx;
} }
} }
} }
.order-taps {
.order-taps {
height: 80rpx; height: 80rpx;
padding: 8rpx 30rpx 20rpx 30rpx; padding: 8rpx 30rpx 20rpx 30rpx;
display: flex; display: flex;
...@@ -846,5 +574,5 @@ page { ...@@ -846,5 +574,5 @@ page {
color: #FA5A49; color: #FA5A49;
} }
} }
} }
</style> </style>
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
mode="aspectFill" mode="aspectFill"
v-for="(src, key) in fileItem.placeholderImages" v-for="(src, key) in fileItem.placeholderImages"
:src="fileItem.imgs.length > key ? fileItem.imgs[key] : src" :src="fileItem.imgs.length > key ? fileItem.imgs[key] : src"
:key="src + key" :key="key"
@click="handleClick(fileItem, index, key)" @click="handleClick(fileItem, index, key)"
></image> ></image>
</view> </view>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment