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'
...@@ -266,7 +266,8 @@ ...@@ -266,7 +266,8 @@
display: flex; display: flex;
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;
...@@ -286,7 +287,8 @@ ...@@ -286,7 +287,8 @@
} }
} }
.right-view { .right-view {
text-align: center;
width: 100rpx; width: 100rpx;
height: 40rpx; height: 40rpx;
background-color: #F4F5F7; background-color: #F4F5F7;
...@@ -360,7 +362,8 @@ ...@@ -360,7 +362,8 @@
display: flex; display: flex;
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
} }
}, },
{ {
...@@ -201,13 +203,13 @@ ...@@ -201,13 +203,13 @@
"navigationStyle": "custom"// 隐藏系统导航栏 "navigationStyle": "custom"// 隐藏系统导航栏
} }
} }
], ],
"globalStyle": { "globalStyle": {
"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,82 +270,70 @@ ...@@ -294,82 +270,70 @@
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.content { .banner-image {
height: 100vh; width: 730rpx;
background-color: #f4f5f7; height: 280rpx;
padding: 0rpx 30rpx 0 30rpx; margin-left: -14rpx;
overflow-y: auto; }
.title-view { .msg-view {
.msg-title {
color: #333333; color: #333333;
font-size: 32rpx;
font-weight: bold; font-weight: bold;
font-size: 40rpx; padding: 1rpx 0rpx 30rpx 0rpx;
} }
.banner-image { .msg-list-view {
width: 730rpx; border-radius: 12rpx;
height: 280rpx; background-color: #ffffff;
margin-left: -14rpx; padding: 12rpx 30rpx;
height: 252rpx;
} }
.msg-view { .msg-content {
.msg-title { color: #333333;
color: #333333; font-size: 26rpx;
font-size: 32rpx;
font-weight: bold;
padding: 1rpx 0rpx 30rpx 0rpx;
}
.msg-list-view {
border-radius: 12rpx;
background-color: #ffffff;
padding: 12rpx 30rpx;
height: 252rpx;
}
.msg-content { .msg-content-view {
color: #333333; display: flex;
font-size: 26rpx; align-items: center;
justify-content: space-between;
margin-top: 20rpx;
margin-bottom: 20rpx;
.msg-content-view { .left-view {
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: space-between;
margin-top: 20rpx;
margin-bottom: 20rpx;
.left-view {
display: flex;
align-items: center;
.msg-icon { .msg-icon {
width: 80rpx; width: 80rpx;
height: 36rpx; height: 36rpx;
margin-right: 20rpx; margin-right: 20rpx;
}
.msg-text {
text-overflow: ellipsis;
overflow: hidden;
white-space: nowrap;
width: 448rpx;
}
} }
.right-icon { .msg-text {
width: 14rpx; text-overflow: ellipsis;
height: 24rpx; overflow: hidden;
white-space: nowrap;
width: 448rpx;
} }
} }
.line-view { .right-icon {
height: 2rpx; width: 14rpx;
background-color: #f4f5f7; height: 24rpx;
} }
} }
.line-view {
height: 2rpx;
background-color: #f4f5f7;
}
} }
} }
.logo { .logo {
height: 200 rpx; height: 200 rpx;
width: 100%; width: 100%;
...@@ -452,7 +416,7 @@ ...@@ -452,7 +416,7 @@
font-size: 28rpx; font-size: 28rpx;
padding: 30rpx; padding: 30rpx;
background-color: #ffffff; background-color: #ffffff;
border-radius: 12rpx; border-radius: 12rpx;
min-height: 460rpx; min-height: 460rpx;
.no-order-image { .no-order-image {
......
<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" </view>
bg-color="white" <view class="search-btn">
inactive-color="#666" <u-icon name="search" color="#666" size="32"></u-icon>
button-color="#2272FF" <text class="search-btn-text">搜订单</text>
border-radius="36" </view>
@change="sectionChange" </view>
></u-subsection> <view class="u-tabs-box" v-show="curNow == 0">
</view> <u-tabs-swiper activeColor="#2272FF" bg-color="none" inactive-color="#999" bar-height="4" bar-width="44"
<view class="search-btn"> :offset="[-1,10]" ref="tabs" :list="list" count="total" :current="current" @change="change"
<u-icon name="search" color="#666" size="32"></u-icon> :is-scroll="false" swiperWidth="750"></u-tabs-swiper>
<text class="search-btn-text">搜订单</text> </view>
</view> <swiper class="swiper-box" :current="swiperCurrent" @transition="transition"
</view> @animationfinish="animationfinish">
<view class="u-tabs-box" v-show="showSview"> <swiper-item class="swiper-item" v-for="(res, ind) in orderLists" :key="ind">
<u-tabs-swiper <scroll-view scroll-y style="height: 100%;width: 100%;" @scrolltolower="reachBottom"
activeColor="#2272FF" refresher-enabled @refresherrefresh="refresherrefresh">
bg-color="none" <view class="page-box">
inactive-color="#999" <view v-for="(item, index) in res" :key="item.orderId">
bar-height="4" bar-width="44" <OrderCell :orderData="item" :orderType="orderType" :location="dataValue"
:offset="[-1,10]" @click="handleClick(item)" @action="handleAction(item)"> </OrderCell>
ref="tabs" </view>
:list="list" <u-loadmore :status="loadStatus[0]" bgColor="#f2f2f2"></u-loadmore>
:current="current" </view>
@change="change" </scroll-view>
:is-scroll="false" </swiper-item>
swiperWidth="750" </swiper>
></u-tabs-swiper>
</view> </view>
<swiper v-show="showSview" class="swiper-box" :current="swiperCurrent" @transition="transition" @animationfinish="animationfinish"> </TabBarPage>
<swiper-item class="swiper-item"> </template>
<scroll-view scroll-y style="height: 100%;width: 100%;" @scrolltolower="reachBottom">
<view class="page-box"> <script>
<view class="order" v-for="(res, index) in orderList" :key="res.id"> import TabBarPage from "@/components/tabBarList/index.vue"
<view class="top"> import OrderCell from "@/components/order/index.vue";
<view class="left"> export default {
<view class="tag">{{ res.orderServiceType }}</view> components: {
<view class="store">{{ res.categoryName }}</view> TabBarPage,
<view >{{ res.orderNumber }}</view> OrderCell
</view> },
<view class="right">{{ res.orderBusinessTypeText }}</view> data() {
</view> return {
<view class="content"> showSview: true,
<view class="title u-line-2"> curNow: 0,
<text>{{res.contactName }}</text> <text style="margin-left: 8rpx;">{{ res.contactPhone }}</text> timestamp: 1000,
</view> //waitAccept、waitAppointment、waitCheckIn、waitFinish、exception、finish
</view> indexStatus: {
<view class="address u-line-2"> 0: 'waitAccept',
<view class="left"> 1: 'waitAppointment',
<view ><u-icon name="map" size="32"></u-icon> 2: 'waitCheckIn',
<text style="margin-left: 8rpx;">{{res.contactAddress }}</text></view> 3: 'waitFinish',
</view> 4: 'exception',
<view class="right">{{getDistance(res.contactAddressLatitud,res.contactAddressLongitud)}}km</view> 5: 'finish'
</view> },
<u-divider margin-top="16" half-width="630" border-color="#F4F5F7" :use-slot="false"> orderLists: [
</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)"> dataList: [],
<text>去预约</text> list: [{
</view> name: '待预约',
</view> total: 0,
</view> pageNumber: 0,
<u-loadmore :status="loadStatus[0]" bgColor="#f2f2f2"></u-loadmore> pageSize: 10
</view> },
</scroll-view> {
</swiper-item> name: '待签到',
total: 0,
<swiper-item class="swiper-item"> pageNumber: 0,
<scroll-view scroll-y style="height: 100%;width: 100%;" @scrolltolower="reachBottom"> pageSize: 10
<view class="page-box"> },
<view class="order" v-for="(res, index) in orderList" :key="res.id"> {
<view class="top"> name: '待完工',
<view class="left"> total: 0,
<view class="tag">{{ res.orderServiceType }}</view> pageNumber: 0,
<view class="store">{{ res.categoryName }}</view> pageSize: 10
<view >{{ res.orderNumber }}</view> },
</view> {
<view class="right">{{ res.orderBusinessTypeText }}</view> name: '待审核',
</view> total: 0,
<view class="content"> pageNumber: 0,
<view class="title u-line-2"> pageSize: 10
<text>{{res.contactName }}</text> <text style="margin-left: 8rpx;">{{ res.contactPhone }}</text> },
</view> {
</view> name: '异常单',
<view class="address u-line-2"> total: 0,
<view class="left"> pageNumber: 0,
<view ><u-icon name="map" size="32"></u-icon> pageSize: 10
<text style="margin-left: 8rpx;">{{res.contactAddress }}</text></view> }
</view> ],
<view class="right">{{getDistance(res.contactAddressLatitud,res.contactAddressLongitud)}}km</view> current: 0,
</view> swiperCurrent: 0,
tabsHeight: 0,
<u-divider margin-top="16" half-width="630" border-color="#F4F5F7" :use-slot="false"> dx: 0,
</u-divider> loadStatus: ['loading', 'loading', 'loading', 'loading', 'loading', 'loading'],
dataValue: [],
<view class="bottom"> total: 0
<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)" > onLoad() {
</u-count-down> this.getLocation();
</view> this.getOrderCount();
<view class="right-btn" @click="viewOderItem(index)"> this.getOrderList(0);
<text>去签到</text> },
</view> computed: {
</view> subList() {
</view> return ['待受理', '已完工']
<u-loadmore :status="loadStatus[0]" bgColor="#f2f2f2"></u-loadmore> },
</view> // 0:待接单 1:'去预约', 2:'去签到', 3:'去完工', 4:'审核中', 5:'去处理', 6'已完工'
</scroll-view> orderType() {
</swiper-item> return this.currentIndex + 1
<swiper-item class="swiper-item"> },
<scroll-view scroll-y style="height: 100%;width: 100%;" v-if="orderList.length === 0"> currentIndex() {
<view class="page-box"> return this.curNow == 0 ? this.swiperCurrent : 5
<view> }
<view class="centre"> },
<image src="https://cdn.uviewui.com/uview/template/taobao-order.png" mode=""></image> methods: {
<view class="explain"> sectionChange(index) {
您还没有相关的订单 if (index === 1) {
<view class="tips">可以去看看有那些想买的</view> this.showSview = false
</view> // 加载已完工的数据
<view class="btn">随便逛逛</view> this.getOrderList(5)
</view> } else {
</view> this.showSview = true
</view> // 加载已完工的数据
</scroll-view> this.getOrderList(0)
<scroll-view scroll-y style="height: 100%;width: 100%;" @scrolltolower="reachBottom" v-else> }
<view class="page-box"> this.curNow = index;
<view class="order" v-for="(res, index) in orderList" :key="res.id"> },
<view class="top"> timeChange(currentOverTime, index) {
<view class="left"> let self = this
<view class="tag">{{ res.orderServiceType }}</view> var nowTime = new Date(); // 当前时间
<view class="store">{{ res.categoryName }}</view> if (nowTime.getTime() > currentOverTime * 1000) {
<view >{{ res.orderNumber }}</view> self.$refs['uCountDown' + index][0].seconds += 2
</view> }
<view class="right">{{ res.orderBusinessTypeText }}</view> },
</view> timestampDiff(currentOverTime) {
<view class="content"> var nowTime = new Date(); // 当前时间
<view class="title u-line-2"> if (nowTime.getTime() > currentOverTime * 1000) {
<text>{{res.contactName }}</text> <text style="margin-left: 8rpx;">{{ res.contactPhone }}</text> var diff = nowTime.getTime() - (currentOverTime * 1000);
</view> } else {
</view> var diff = (currentOverTime * 1000) - nowTime.getTime();
<view class="address u-line-2"> }
<view class="left"> return diff;
<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> getLocation() {
let self = this
<u-divider margin-top="16" half-width="630" border-color="#F4F5F7" :use-slot="false"> const dataValue = this.dataValue || []
</u-divider> const waterInfo = this.waterInfo
uni.getLocation({
<view class="bottom"> type: 'gcj02',
<view class="left"> success: function(res) {
<view class="tag">{{res.currentOverTime * 1000 > new Date().getTime()?'剩':'超'}}</view> dataValue.push(res.longitude)
<u-count-down :timestamp="timestampDiff(res.currentOverTime)" font-size="44" color="#FF930D" :ref="'uCountDown' + index" @change="timeChange(res.currentOverTime,index)" > dataValue.push(res.latitude)
</u-count-down> self.dataValue = dataValue
</view> },
<view class="right-btn" @click="viewOderItem(index)"> fail(err) {
<text>去完工</text>
</view> }
</view> });
</view> },
<u-loadmore :status="loadStatus[0]" bgColor="#f2f2f2"></u-loadmore>
</view> reachBottom() {
</scroll-view> // 此tab为空数据
</swiper-item> if (this.current != 2) {
<swiper-item class="swiper-item"> this.loadStatus.splice(this.current, 1, 'loading');
<scroll-view scroll-y style="height: 100%;width: 100%;" @scrolltolower="reachBottom"> setTimeout(() => {
<view class="page-box"> this.getOrderList(this.current);
<view class="order" v-for="(res, index) in orderList" :key="res.id"> }, 1200);
<view class="top"> }
<view class="left"> },
<view class="tag">{{ res.orderServiceType }}</view> // 页面数据
<view class="store">{{ res.categoryName }}</view> getOrderList(index) {
<view >{{ res.orderNumber }}</view> // 状态处理
</view> console.log("chage:", this.indexStatus[index])
<view class="right">{{ res.orderBusinessTypeText }}</view> this.list[index].pageNumber += 1
</view> var param = {
<view class="content"> pageNumber: this.list[index].pageNumber,
<view class="title u-line-2"> pageSize: this.list[index].pageSize,
<text>{{res.contactName }}</text> <text style="margin-left: 8rpx;">{{ res.contactPhone }}</text> keyword: '',
</view> type: this.indexStatus[index]
</view> }
<view class="address u-line-2"> var self = this;
<view class="left"> self.$u.api.listOrder(param).then((res) => {
<view ><u-icon name="map" size="32"></u-icon> if (res.code == 200) {
<text style="margin-left: 8rpx;">{{res.contactAddress }}</text></view> console.log("getOrderList", res.data)
</view> /*↓↓↓↓↓↓↓↓↓↓测试数据↓↓↓↓↓↓↓↓↓↓*/
<view class="right">{{getDistance(res.contactAddressLatitud,res.contactAddressLongitud)}}km</view> var res = {
</view> data: {
total: 100,
<u-divider margin-top="16" half-width="630" border-color="#F4F5F7" :use-slot="false"> orderType: this.currentIndex,
</u-divider> list: [{
orderServiceType: '安装', // 服务类型:安装、维修
<view class="bottom"> categoryName: '充电桩', // 品类:充电桩
<view class="left"> orderBusinessTypeText: '分配单', // 业务类型:分配单、订单池
<view class="tag">{{res.currentOverTime * 1000 > new Date().getTime()?'剩':'超'}}</view> orderNumber: 'OR2021041809827', // 工单编号
<u-count-down :timestamp="timestampDiff(res.currentOverTime)" font-size="44" color="#FF930D" :ref="'uCountDown' + index" @change="timeChange(res.currentOverTime,index)" > contactName: '郭小清', // 客户信息
</u-count-down> contactPhone: '13631612077', // 联系方式
</view> contactAddress: '湾街道荔枝花园D座125号', // 详细地址
<view class="right-btn" @click="viewOderItem(index)"> contactAddressLatitud: '116.3896', // 联系人地址经度
<text>审核中</text> contactAddressLongitud: '39.91917', // 联系人地址纬度
</view> orderStatus: 0, // 工单状态
</view> appointmentDatetime: '', // 预约时间
</view> currentWillOverTime: 10000, // 剩余时间
<u-loadmore :status="loadStatus[0]" bgColor="#f2f2f2"></u-loadmore> currentOverTime: 0, // 超过时间
</view> auditDatetime: '2021.04.19 12:45:09', // 审核时间
</scroll-view> submissionTime: '2021.04.19 16:24:48', // 提交时间
</swiper-item> auditResults: {}, // 审核结果
<swiper-item class="swiper-item"> orderBusinessType: 'R', // 业务类型 R 为抢单
<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> // 后台需要返回order_type,防止数据返回延迟期间点击了其他的tab
<view >{{ res.orderNumber }}</view> if (res.data) {
</view> self.orderLists[res.data.orderType].push(...res.data.list)
<view class="right">{{ res.orderBusinessTypeText }}</view> self.list[res.data.orderType].total = res.data.total;
</view> self.loadStatus[res.data.orderType] = res.data.total > self.orderLists[res.data
<view class="content"> .orderType].length ? 'loading' : 'nomore'
<view class="title u-line-2"> }
<text>{{res.contactName }}</text> <text style="margin-left: 8rpx;">{{ res.contactPhone }}</text> } else {
</view> console.log(res.message, "获取订单数量失败!");
</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> refresherrefresh() {
</view> this.list[this.currentIndex].pageNumber = 0
<view class="right">{{getDistance(res.contactAddressLatitud,res.contactAddressLongitud)}}km</view> this.orderLists[this.currentIndex] = []
</view> this.getOrderList()
},
<u-divider margin-top="16" half-width="630" border-color="#F4F5F7" :use-slot="false">
</u-divider> // 获取订单数量
getOrderCount() {
<view class="bottom"> var self = this; // 加载订单列表
<view class="left"> self.$u.api.listOrderCount().then((res) => {
<view class="tag">{{res.currentOverTime * 1000 > new Date().getTime()?'剩':'超'}}</view> if (res.code == 200) {
<u-count-down :timestamp="timestampDiff(res.currentOverTime)" font-size="44" color="#FF930D" :ref="'uCountDown' + index" @change="timeChange(res.currentOverTime,index)" > console.log("===", res.data)
</u-count-down> if (res.data) {
</view> self.list.forEach(item => {
<view class="right-btn" @click="viewOderItem(index)"> if (item.name === '待预约') {
<text>去处理</text> item.count = res.data.toAppointmentCount
</view> } else if (item.name === '待签到') {
</view> item.count = res.data.toCheckinCount
</view> } else if (item.name === '待完工') {
<u-loadmore :status="loadStatus[0]" bgColor="#f2f2f2"></u-loadmore> item.count = res.data.toFinishCount
</view> } else if (item.name === '待审核') {
</scroll-view> item.count = res.data.reviewingCount
</swiper-item> } else if (item.name === '异常单') {
</swiper> item.count = res.data.exceptionCount
}
<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"> } else {
<view class="page-box"> console.log(res.message, "获取订单数量失败!");
<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> totalPrice(item) {
<view >{{ res.orderNumber }}</view> let price = 0;
</view> item.map(val => {
<view class="right">{{ res.orderBusinessTypeText }}</view> price += parseFloat(val.price);
</view> });
<view class="content"> return price.toFixed(2);
<view class="title u-line-2"> },
<text>{{res.contactName }}</text> <text style="margin-left: 8rpx;">{{ res.contactPhone }}</text> // 总件数
</view> totalNum(item) {
</view> let num = 0;
<view class="address u-line-2"> item.map(val => {
<view class="left"> num += val.number;
<view > });
<u-icon name="map" size="32"></u-icon> return num;
<text style="margin-left: 8rpx;">{{res.contactAddress }}</text> },
<text style="margin-left: 200rpx; font-size:large;" @click="viewOderItem(index)" > > </text> // tab栏切换
</view> change(index) {
</view> this.swiperCurrent = index;
</view> this.getOrderList(index);
},
<u-divider margin-top="16" half-width="630" border-color="#F4F5F7" :use-slot="false"> transition({
</u-divider> detail: {
dx
<view class="bottom"> }
<view class="left"> }) {
<text>审核时间 :</text><text>{{res.auditDatetime}}</text> this.$refs.tabs.setDx(dx);
</view> },
<view > animationfinish({
<text>已完工</text> detail: {
</view> current
</view> }
</view> }) {
<!-- <u-loadmore :status="loadStatus[0]" bgColor="#f2f2f2"></u-loadmore> --> this.$refs.tabs.setFinishCurrent(current);
</view> this.swiperCurrent = current;
</scroll-view> this.current = current;
</swiper-item> },
</swiper> viewOderItem(orderId) { // 跳转工单详情页面
</view> uni.navigateTo({
</view> url: 'pages/order/detail?id=' + orderId
</template> })
},
<script> handleClick(item) {
export default { console.log('click cell')
data() { this.viewOderItem(item.orderId)
return { },
showSview : true, handleAction(item) {
curNow : 0, console.log('click button')
timestamp:1000, this.viewOderItem(item.orderId)
//waitAccept、waitAppointment、waitCheckIn、waitFinish、exception、finish }
indexStatus:{0:'waitAccept',1:'waitAppointment',2:'waitCheckIn',3:'waitFinish',4:'exception',5:'finish'}, }
orderList: [], };
dataList: [ </script>
{
id: 1, <style>
store: '夏日流星限定贩卖', /* #ifndef H5 */
deal: '交易成功', page {
goodsList: [ height: 100%;
{ background-color: #f2f2f2;
goodsUrl: '//img13.360buyimg.com/n7/jfs/t1/103005/7/17719/314825/5e8c19faEb7eed50d/5b81ae4b2f7f3bb7.jpg', }
title: '【冬日限定】现货 原创jk制服女2020冬装新款小清新宽松软糯毛衣外套女开衫短款百搭日系甜美风',
type: '灰色;M', /* #endif */
deliveryTime: '付款后30天内发货', </style>
price: '348.58',
number: 2 <style lang="scss" scoped>
} .u-tabs-box {
] margin-bottom: 30rpx;
}, }
{
id: 2, .order {
store: '江南皮革厂', // width: 710rpx;
deal: '交易失败', // background-color: #ffffff;
goodsList: [ // margin: 20rpx auto;
{ // border-radius: 20rpx;
goodsUrl: '//img14.360buyimg.com/n7/jfs/t1/60319/15/6105/406802/5d43f68aE9f00db8c/0affb7ac46c345e2.jpg', // box-sizing: border-box;
title: '【冬日限定】现货 原创jk制服女2020冬装新款小清新宽松软糯毛衣外套女开衫短款百搭日系甜美风', // padding: 20rpx;
type: '粉色;M', // font-size: 28rpx;
deliveryTime: '付款后7天内发货',
price: '128.05', .top {
number: 1 display: flex;
} justify-content: space-between;
] align-items: center;
},
{ .left {
id: 3, display: flex;
store: '三星旗舰店', align-items: center;
deal: '交易失败',
goodsList: [ .tag {
{ text-align: center;
goodsUrl: '//img11.360buyimg.com/n7/jfs/t1/94448/29/2734/524808/5dd4cc16E990dfb6b/59c256f85a8c3757.jpg', width: 84rpx;
title: '三星(SAMSUNG)京品家电 UA65RUF70AJXXZ 65英寸4K超高清 HDR 京东微联 智能语音 教育资源液晶电视机', height: 40rpx;
type: '4K,广色域', background: linear-gradient(270deg, #47ABFF 0%, #2272FF 100%);
deliveryTime: '保质5年', border-radius: 8rpx;
price: '1998', font-size: 22rpx;
number: 3 font-weight: 500;
} color: #FFFFFF;
] line-height: 40rpx;
}, }
{
id: 4, .store {
store: '三星旗舰店', margin: 0 10rpx;
deal: '交易失败', font-size: 36rpx;
goodsList: [ font-weight: bold;
{ color: #333333;
goodsUrl: '//img10.360buyimg.com/n7/jfs/t22300/31/1505958241/171936/9e201a89/5b2b12ffNe6dbb594.jpg!q90.jpg', line-height: 36px;
title: '法国进口红酒 拉菲(LAFITE)传奇波尔多干红葡萄酒750ml*6整箱装', }
type: '4K,广色域', }
deliveryTime: '珍藏10年好酒',
price: '1543', .right {
number: 3 height: 40rpx;
} background: #F4F5F7;
] border-radius: 22rpx;
}, padding: 8rpx 16rpx 8rpx 16rpx;
{ font-size: 22rpx;
id: 5, line-height: 24rpx;
store: '三星旗舰店', font-weight: 400;
deal: '交易成功', color: #333333;
goodsList: [ }
{ }
goodsUrl: '//img12.360buyimg.com/n7/jfs/t1/52408/35/3554/78293/5d12e9cfEfd118ba1/ba5995e62cbd747f.jpg!q90.jpg',
title: '企业微信 中控人脸指纹识别考勤机刷脸机 无线签到异地多店打卡机WX108', .item {
type: '识别效率高', display: flex;
deliveryTime: '使用方便', flex-direction: column;
price: '451', margin: 20rpx 0 0;
number: 9
} .content {
] .title {
} font-size: 26rpx;
], font-weight: 400;
list: [ color: #333333;
{ line-height: 52rpx;
name: '待预约', }
count: 3 }
},
{ .address {
name: '待签到', display: flex;
count: 2 justify-content: space-between;
}, align-items: center;
{ font-size: 24rpx;
name: '待完工', font-weight: 400;
count: 2 color: #333333;
}, line-height: 52rpx;
{
name: '待审核', .left {}
count: 10
}, .right {}
{ }
name: '异常单', }
count: 2
} .total {
], margin-top: 20rpx;
current: 0, text-align: right;
swiperCurrent: 0, font-size: 24rpx;
tabsHeight: 0,
dx: 0, .total-price {
loadStatus: ['loadmore', 'loadmore', 'loadmore', 'loadmore'], font-size: 32rpx;
dataValue:[], }
total:0 }
};
}, .bottom {
onLoad() { display: flex;
this.getLocation(); margin-top: 30rpx;
this.getOrderCount(); padding: 0 10rpx;
this.getOrderList(0); justify-content: space-between;
}, align-items: center;
computed: {
// 价格小数 .left {
priceDecimal() { display: flex;
return val => { align-items: center;
if (val !== parseInt(val)) return val.slice(-2); justify-content: space-between;
else return '00';
}; .tag {
}, text-align: center;
// 价格整数 width: 54rpx;
priceInt() { height: 54rpx;
return val => { background: #FF930D;
if (val !== parseInt(val)) return val.split('.')[0]; font-size: 26rpx;
else return val; font-weight: 500;
}; color: #FFFFFF;
} line-height: 54rpx;
}, border-radius: 50%;
methods: { margin-right: 20rpx;
sectionChange(index){ }
if(index === 1){ }
this.showSview = false
// 加载已完工的数据 .right-btn {
this.getOrderList(5) text-align: center;
}else { width: 200rpx;
this.showSview = true height: 80rpx;
// 加载已完工的数据 background: #2272FF;
this.getOrderList(0) border-radius: 40rpx;
} font-size: 32rpx;
this.curNow = index; font-weight: 600;
}, color: #FFFFFF;
timeChange(currentOverTime,index){ line-height: 80rpx;
let self = this font-family: PingFangSC-Semibold, PingFang SC;
var nowTime = new Date(); // 当前时间 }
if(nowTime.getTime() > currentOverTime*1000){ }
self.$refs['uCountDown'+index][0].seconds += 2 }
}
}, .centre {
timestampDiff(currentOverTime){ text-align: center;
var nowTime = new Date(); // 当前时间 margin: 200rpx auto;
if(nowTime.getTime() > currentOverTime*1000){ font-size: 32rpx;
var diff = nowTime.getTime() - (currentOverTime*1000);
}else{ image {
var diff = (currentOverTime*1000) - nowTime.getTime(); width: 164rpx;
} height: 164rpx;
return diff; border-radius: 50%;
}, margin-bottom: 20rpx;
/** }
* 获取当前位置的经纬度
*/ .tips {
getLocation() { font-size: 24rpx;
let self = this color: #999999;
const dataValue = this.dataValue || [] margin-top: 20rpx;
const waterInfo = this.waterInfo }
uni.getLocation({
type: 'gcj02', .btn {
success: function(res) { margin: 80rpx auto;
dataValue.push(res.longitude) width: 200rpx;
dataValue.push(res.latitude) border-radius: 32rpx;
self.dataValue = dataValue line-height: 64rpx;
}, color: #ffffff;
fail(err) { font-size: 26rpx;
background: linear-gradient(270deg, rgba(249, 116, 90, 1) 0%, rgba(255, 158, 1, 1) 100%);
} }
}); }
},
getDistance(Latitud, Longitud){ .wrap {
return this.distance(Latitud,Longitud,this.dataValue[0],this.dataValue[1]) display: flex;
}, flex-direction: column;
/** height: calc(100vh - var(--window-top));
* echo distance(116.3896,39.91917,116.3940,39.91726); width: 100%;
* 计算两点之间直线距离 }
* @param float $lon1 经度
* @param float $lat1 维度 .swiper-box {
* @param float $lon2 经度 flex: 1;
* @param float $lat2 维度 }
* @return float 浮点数
*/ .swiper-item {
distance(la1, lo1, la2, lo2) { height: 100%;
var La1 = la1 * Math.PI / 180.0; }
var La2 = la2 * Math.PI / 180.0;
var La3 = La1 - La2; .tools-box {
var Lb3 = lo1 * Math.PI / 180.0 - lo2 * Math.PI / 180.0; display: flex;
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))); flex-direction: row;
s = s * 6378.137;//地球半径 justify-content: space-between;
s = Math.round(s * 10000) / 10000; padding: 20rpx 0rpx 18rpx 0rpx;
// console.log("计算结果",s,'KM');
return s?s.toFixed(2):0; .search-sub {
}, height: 72rpx;
reachBottom() { width: 320rpx;
// 此tab为空数据 }
if (this.current != 2) {
this.loadStatus.splice(this.current, 1, 'loading'); .search-btn {
setTimeout(() => { height: 72rpx;
this.getOrderList(this.current); width: 220rpx;
}, 1200); background-color: #ffffff;
} border-radius: 36rpx;
}, color: #666666;
// 页面数据 display: flex;
getOrderList(index) { flex-direction: row;
// 状态处理 justify-content: space-around;
console.log("chage:",this.indexStatus[index]) align-items: center;
var page=0
var pageSize=10 .search-btn-text {
var param = {pageNumber:page,pageSize:pageSize,keyword:'',type:this.indexStatus[index]} line-height: 36rpx;
var self = this; font-weight: 400;
self.$u.api.listOrder(param).then((res) => { font-size: 26rpx;
if (res.code == 200) { }
console.log("getOrderList",res.data) }
if (res.data) { }
self.orderList = res.data.list;
// //测试使用 .order-taps {
// self.orderList.forEach((item,index)=>{ height: 80rpx;
// if(index === 1){ padding: 8rpx 30rpx 20rpx 30rpx;
// item.currentOverTime -= 10 display: flex;
// } flex-direction: row;
// }) justify-content: space-between;
self.total =res.data.total; align-items: center;
}
} else { .order-taps-item {
console.log(res.message, "获取订单数量失败!"); font-size: 28rpx;
} font-weight: 400;
}); color: #999999;
line-height: 20px;
},
// 获取订单数量 .taps-count {
getOrderCount() { position: absolute;
var self = this; // 加载订单列表 font-size: 16rpx;
self.$u.api.listOrderCount().then((res) => { font-weight: 400;
if (res.code == 200) { line-height: 16rpx;
console.log("===",res.data) width: 36rpx;
if (res.data) { height: 24rpx;
self.list.forEach(item=>{ background: #FFFFFF;
if(item.name==='待预约'){ border-radius: 16rpx;
item.count=res.data.toAppointmentCount border: 2rpx solid #FA5A49;
}else if(item.name==='待签到'){ text-align: center;
item.count=res.data.toCheckinCount color: #FA5A49;
}else if(item.name==='待完工'){ }
item.count=res.data.toFinishCount }
}else if(item.name==='待审核'){ }
item.count=res.data.reviewingCount
}else if(item.name==='异常单'){
item.count=res.data.exceptionCount
}
})
}
} else {
console.log(res.message, "获取订单数量失败!");
}
});
},
// 总价
totalPrice(item) {
let price = 0;
item.map(val => {
price += parseFloat(val.price);
});
return price.toFixed(2);
},
// 总件数
totalNum(item) {
let num = 0;
item.map(val => {
num += val.number;
});
return num;
},
// tab栏切换
change(index) {
this.swiperCurrent = index;
this.getOrderList(index);
},
transition({ detail: { dx } }) {
this.$refs.tabs.setDx(dx);
},
animationfinish({ detail: { current } }) {
this.$refs.tabs.setFinishCurrent(current);
this.swiperCurrent = current;
this.current = current;
},viewOderItem(index) { // 跳转工单详情页面
let order = this.orderList[index]
console.log("order",order)
uni.navigateTo({
url: 'pages/order/detail?id='+order.orderId
})
}
}
};
</script>
<style>
/* #ifndef H5 */
page {
height: 100%;
background-color: #f2f2f2;
}
/* #endif */
</style>
<style lang="scss" scoped>
.order {
width: 710rpx;
background-color: #ffffff;
margin: 20rpx auto;
border-radius: 20rpx;
box-sizing: border-box;
padding: 20rpx;
font-size: 28rpx;
.top {
display: flex;
justify-content: space-between;
align-items: center;
.left {
display: flex;
align-items: center;
.tag {
text-align: center;
width: 84rpx;
height: 40rpx;
background: linear-gradient(270deg, #47ABFF 0%, #2272FF 100%);
border-radius: 8rpx;
font-size: 22rpx;
font-weight: 500;
color: #FFFFFF;
line-height: 40rpx;
}
.store {
margin: 0 10rpx;
font-size: 36rpx;
font-weight: bold;
color: #333333;
line-height: 36px;
}
}
.right {
height: 40rpx;
background: #F4F5F7;
border-radius: 22rpx;
padding: 8rpx 16rpx 8rpx 16rpx;
font-size: 22rpx;
line-height: 24rpx;
font-weight: 400;
color: #333333;
}
}
.item {
display: flex;
flex-direction: column;
margin: 20rpx 0 0;
.content {
.title {
font-size: 26rpx;
font-weight: 400;
color: #333333;
line-height: 52rpx;
}
}
.address {
display: flex;
justify-content: space-between;
align-items: center;
font-size: 24rpx;
font-weight: 400;
color: #333333;
line-height: 52rpx;
.left {
}
.right {
}
}
}
.total {
margin-top: 20rpx;
text-align: right;
font-size: 24rpx;
.total-price {
font-size: 32rpx;
}
}
.bottom {
display: flex;
margin-top: 30rpx;
padding: 0 10rpx;
justify-content: space-between;
align-items: center;
.left {
display: flex;
align-items: center;
justify-content: space-between;
.tag {
text-align: center;
width: 54rpx;
height: 54rpx;
background: #FF930D;
font-size: 26rpx;
font-weight: 500;
color: #FFFFFF;
line-height: 54rpx;
border-radius: 50%;
margin-right: 20rpx;
}
}
.right-btn {
text-align: center;
width: 200rpx;
height: 80rpx;
background: #2272FF;
border-radius: 40rpx;
font-size: 32rpx;
font-weight: 600;
color: #FFFFFF;
line-height: 80rpx;
font-family: PingFangSC-Semibold, PingFang SC;
}
}
}
.centre {
text-align: center;
margin: 200rpx auto;
font-size: 32rpx;
image {
width: 164rpx;
height: 164rpx;
border-radius: 50%;
margin-bottom: 20rpx;
}
.tips {
font-size: 24rpx;
color: #999999;
margin-top: 20rpx;
}
.btn {
margin: 80rpx auto;
width: 200rpx;
border-radius: 32rpx;
line-height: 64rpx;
color: #ffffff;
font-size: 26rpx;
background: linear-gradient(270deg, rgba(249, 116, 90, 1) 0%, rgba(255, 158, 1, 1) 100%);
}
}
.wrap {
display: flex;
flex-direction: column;
height: calc(100vh - var(--window-top));
width: 100%;
}
.swiper-box {
flex: 1;
}
.swiper-item {
height: 100%;
}
.tools-box {
display: flex;
flex-direction: row;
justify-content: space-between;
padding: 20rpx 30rpx 18rpx 34rpx;
.search-sub {
height: 72rpx;
width: 320rpx;
}
.search-btn {
height: 72rpx;
width: 220rpx;
background-color: #ffffff;
border-radius: 36rpx;
color: #666666;
display: flex;
flex-direction: row;
justify-content: space-around;
align-items: center;
.search-btn-text {
line-height: 36rpx;
font-weight: 400;
font-size: 26rpx;
}
}
}
.order-taps {
height: 80rpx;
padding: 8rpx 30rpx 20rpx 30rpx;
display: flex;
flex-direction: row;
justify-content: space-between;
align-items: center;
.order-taps-item {
font-size: 28rpx;
font-weight: 400;
color: #999999;
line-height: 20px;
.taps-count {
position: absolute;
font-size: 16rpx;
font-weight: 400;
line-height: 16rpx;
width: 36rpx;
height: 24rpx;
background: #FFFFFF;
border-radius: 16rpx;
border: 2rpx solid #FA5A49;
text-align: center;
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