Commit 08393ac0 authored by Facius's avatar Facius

improve: 前台-订单挂起/悬浮

parent 055289ff
......@@ -9,14 +9,20 @@
close-icon-color="#FFFFFF"
>
<view class="pop-view">
<view class="head-view"
>最近查看<view class="head-message"
>最近查看或操作过的5条订单</view
></view
>
<view class="loading-view" v-if="!loaded">
<u-loading mode="flower"></u-loading>
</view>
<view v-else>
<view class="content-view" v-else>
<view v-for="item in orderList" :key="item.orderId">
<OrderCell
:orderData="item"
:location="[]"
model="simple"
@click="handleClickCell"
@action="handleClickButton"
>
......@@ -98,8 +104,23 @@ export default {
<style lang="scss" scoped>
.pop-view {
padding: 30rpx;
height: 800rpx;
// padding: 30rpx;
height: 900rpx;
display: flex;
flex-direction: column;
.head-view {
padding: 30rpx 30rpx 24rpx 30rpx;
font-size: 40rpx;
font-weight: bold;
color: #333333;
border-bottom: 2rpx solid #f4f5f7;
.head-message {
font-size: 28rpx;
color: #999999;
font-weight: 400;
margin-top: 10rpx;
}
}
.loading-view {
width: 100%;
height: 100%;
......@@ -108,5 +129,9 @@ export default {
align-items: center;
justify-content: center;
}
.content-view {
height: 100%;
overflow: auto;
}
}
</style>
<template>
<view class="order-view" @click="handleClickCell">
<view class="order-top-view">
<view
:class="['order-view', { simple: isSimple }]"
@click="handleClickCell"
hover-class="u-hover-class"
>
<view v-if="!isSimple" class="order-top-view">
<view class="left-view">
<view :class="['tag-view', { active: active }]">
{{ orderData.orderServiceType }}
......@@ -10,15 +14,27 @@
<view class="right-view">{{ orderData.orderBusinessTypeText }}</view>
</view>
<view class="content-view">
<view class="info-view" v-for="(item, key) in infoTexts" :key="key">
<view class="info-title">
<text>{{ item.name + ':' }}</text>
<view
class="info-view"
v-for="(item, key) in infoTexts"
:key="key"
:style="item.style"
>
<view class="info-left-view">
<view class="info-title">
<text>{{ item.name + ':' }}</text>
</view>
<view class="info-content">
<text @longpress="handleLongpress(key, orderData[key])">{{
orderData[key]
}}</text>
<text v-if="item.content">{{
' / ' + orderData[item.content]
}}</text>
</view>
</view>
<view class="info-content">
<text @longpress="handleLongpress(key, orderData[key])">{{
orderData[key]
}}</text>
<text v-if="item.content">{{ ' / ' + orderData[item.content] }}</text>
<view v-if="item.icon">
<u-icon :name="item.icon"></u-icon>
</view>
</view>
<view class="address-view">
......@@ -35,53 +51,57 @@
</view>
</view>
</view>
<view class="line-view"></view>
<view class="reason-view" v-if="showReason">
<view class="reason-title"><text>未通过原因:</text></view>
<view class="reason-text"
><text v-for="(item, index) in orderData.auditResults" :key="index">{{
item
}}</text></view
>
</view>
<view class="bottom-view">
<view>
<view v-if="showCountTime" class="bottom-left-view">
<view :class="['bottom-tag-view', { timeout: timeout }]"
><text>{{ tagText }}</text></view
>
<u-count-down
:timestamp="timestamp"
font-size="40"
show-days
separator="zh"
:color="timeout ? '#FA5A49' : '#FF930D'"
@change="handleChange"
separator-color="#666666"
ref="order-count-down"
></u-count-down>
</view>
<view v-else-if="showTime">
<text>{{ timeTitle }}</text>
<text>{{ timeText }}</text>
<template v-if="!isSimple">
<view class="reason-view" v-if="showReason">
<view class="reason-title"><text>未通过原因:</text></view>
<view class="reason-text"
><text v-for="(item, index) in orderData.auditResults" :key="index">{{
item
}}</text></view
>
</view>
<view class="bottom-view">
<view>
<view v-if="showCountTime" class="bottom-left-view">
<view :class="['bottom-tag-view', { timeout: timeout }]"
><text>{{ tagText }}</text></view
>
<u-count-down
:timestamp="timestamp"
font-size="40"
show-days
separator="zh"
:color="timeout ? '#FA5A49' : '#FF930D'"
@change="handleChange"
separator-color="#666666"
ref="order-count-down"
></u-count-down>
</view>
<view v-else-if="showTime">
<text>{{ timeTitle }}</text>
<text>{{ timeText }}</text>
</view>
</view>
<u-button
class="right-btn"
@click.stop="handleClick"
:custom-style="buttonStyle"
type="primary"
shape="circle"
>
{{ orderText }}
</u-button>
</view>
<u-button
class="right-btn"
@click.stop="handleClick"
:custom-style="buttonStyle"
type="primary"
shape="circle"
>
{{ orderText }}
</u-button>
</view>
</template>
</view>
</template>
<script>
import uIcon from '../../uview-ui/components/u-icon/u-icon.vue'
import stringMixin from '../createCom/stringMixin'
export default {
components: { uIcon },
props: {
orderData: {
type: Object,
......@@ -125,6 +145,11 @@ export default {
return [116.3896, 39.91917] // 纬度,经度
},
},
// simple: 只显示订单号、联系人/电话、地址,点击cell相当于点击订单列表的按钮; normal: 显示全部信息
model: {
type: String,
default: 'normal',
},
},
data() {
return {
......@@ -137,6 +162,9 @@ export default {
// 按钮文字
return this.typeTexts[this.orderType]
},
isSimple() {
return this.model == 'simple'
},
buttonStyle() {
// 按钮样式
/** orderType
......@@ -176,11 +204,20 @@ export default {
return [4, 5, 6].indexOf(this.orderType) != -1
},
infoTexts() {
return {
orderNumber: { name: '工单编号' },
partnerCompanyName: { name: '合作厂商' },
contactName: { name: '客户信息', content: 'contactPhone' },
}
return this.isSimple
? {
orderNumber: {
name: '工单编号',
style: 'font-weight: 450',
icon: 'arrow-right',
},
contactName: { name: '客户信息', content: 'contactPhone' },
}
: {
orderNumber: { name: '工单编号' },
partnerCompanyName: { name: '合作厂商' },
contactName: { name: '客户信息', content: 'contactPhone' },
}
},
typeTexts() {
return [
......@@ -252,6 +289,7 @@ export default {
},
showDistance() {
return (
!this.isSimple &&
this.orderType == 0 &&
this.location.length >= 2 &&
(this.orderData.contactAddressLatitud ||
......@@ -459,12 +497,18 @@ export default {
<style lang="scss" scoped>
.order-view {
width: 100%;
// width: 100%;
background-color: #ffffff;
border-radius: 12rpx;
padding: 30rpx;
margin-bottom: 20rpx;
.hover-class {
background-color: #dddddd;
}
&.simple {
padding: 0rpx;
margin: 30rpx;
}
.order-top-view {
display: flex;
align-items: center;
......@@ -517,13 +561,18 @@ export default {
margin-top: 18rpx;
margin-bottom: 18rpx;
display: flex;
align-items: flex-start;
.info-title {
flex-shrink: 0;
}
.info-content {
word-break: break-all;
justify-content: space-between;
align-items: center;
.info-left-view {
display: flex;
align-items: flex-start;
.info-title {
flex-shrink: 0;
align-items: center;
}
.info-content {
word-break: break-all;
}
}
}
......
......@@ -7,8 +7,21 @@
@click.stop="handleClick"
type="primary"
>
<u-icon class="apply-icon" :name="iconName"></u-icon>
<text class="apply-text" v-if="showText">{{ text }}</text>
<view class="button-view">
<!-- <image :src="imageUrl" class="image-icon" v-if="isImage"></image>
<u-icon v-else class="apply-icon" :name="icon"></u-icon> -->
<!-- <u-icon class="apply-icon" name="plus"></u-icon> -->
<u-loading mode="flower" :show="loading"></u-loading>
<image
v-if="isImage && !loading"
:src="imageUrl"
class="image-icon"
mode="widthFix"
></image>
<u-icon v-else-if="!loading" class="apply-icon" :name="icon"></u-icon>
<text class="apply-text" v-if="showText">{{ text }}</text>
</view>
</u-button>
</view>
</template>
......@@ -25,7 +38,7 @@ export default {
type: String,
default: '申请备件',
},
iconName: {
icon: {
type: String,
default: 'plus',
},
......@@ -38,6 +51,10 @@ export default {
type: String,
default: 'normal',
},
loading: {
type: Boolean,
default: false,
},
},
computed: {
typeWidth() {
......@@ -46,6 +63,12 @@ export default {
expand: '220rpx',
}
},
imageUrl() {
return process.uniEnv.qn_base_url + this.icon
},
isImage() {
return /\.(png|jpg|gif|jpeg|webp)$/.test(this.icon)
},
clickedHidden() {
return this.clickedType == 'hidden'
},
......@@ -100,12 +123,21 @@ export default {
<style lang="scss" scoped>
.apply-button {
.apply-icon {
font-size: 36rpx;
}
.apply-text {
font-size: 32rpx;
padding-left: 10rpx;
.button-view {
display: flex;
justify-content: flex-end;
align-items: center;
.apply-icon {
font-size: 36rpx;
}
.apply-text {
font-size: 32rpx;
padding-left: 10rpx;
}
.image-icon {
width: 30rpx;
height: 34rpx;
}
}
}
</style>
......@@ -105,6 +105,9 @@
<view class="fixed-button">
<ApplyButton
:type.sync="buttonType"
icon="dingdan-button.png"
text="最近查看"
:loading="!loadedOrder"
clickedType="hidden"
:show.sync="showApplyButton"
@click="visible = true"
......@@ -615,6 +618,6 @@ export default {
.fixed-button {
position: fixed;
right: 10rpx;
bottom: 40rpx;
bottom: 64rpx;
}
</style>
......@@ -91,7 +91,7 @@
pathName: 'order/index',
title: '订单管理',
value: '',
icon: 'qianbao.png',
icon: 'dingdanguanli.png',
imageStyle: 'width:34rpx;height:32rpx'
},{
pathName: 'wallet/index',
......
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