提交 c60522e2 authored 作者: 正反's avatar 正反

修复

上级 d531cae8
<template>
<view class="order">
<view class="loading" v-if="state.loading">
<!-- <view class="loading" v-if="state.loading">
<u-loading></u-loading>
<view>
加载中...
</view>
</view>
<view class="main" v-else>
</view> -->
<view class="main" >
<order-card v-if="data.length !== 0" :cardData="data" :btnText="btnText" @show="show" @handleDetails="handleDetails"></order-card>
<u-empty v-if="data.length === 0" text="暂无数据" font-size="32"></u-empty>
</view>
......
......@@ -25,7 +25,7 @@
<text>
{{item.name}}
</text>
<text class="radius" :class="{'show': changeColor,'disaper':item.count==0}" >{{item.count}}</text>
<text class="radius" :class="{'show': changeColor,'disaper':item.count==0}">{{item.count}}</text>
</view>
</view>
</view>
......@@ -44,7 +44,7 @@
</view>
<view v-if="titleCurrent == 1">
<u-tabs active-color="#ff9900" :list="subTabs" :current="subCurrent" @change="subTabsChange"
:offset="offset"></u-tabs>
:offset="offset" duration=0.2 ></u-tabs>
<order :data="orderData"></order>
</view>
<view v-if="titleCurrent == 2">
......@@ -107,7 +107,8 @@
data() {
return {
offset: [5, 0],
changeColor:false,
subIndex: '',
changeColor: false,
btnStyle: {
background: "#7D5AFC",
color: '#FFFFFF'
......@@ -296,17 +297,20 @@
this.titleCurrent = index
if (this.titleCurrent == 1) {
this.clearCount()
this.clearSubCount()
this.subCurrent = 0
let that = this
let list = []
this.orderData = []
loading()
SFView("").then((res) => {
hidden()
if (res.data.code == 0) {
console.log(res)
list = Object.values(res.data.result)
list = list.flat(Infinity)
console.log(list[0].caption)
for (let i = 0, len = list.length; i < len; i++) {
console.log(list[i].caption)
if (list[i].caption === "待预约") {
that.subTabs[0].count += 1
console.log(list[i].caption)
......@@ -333,7 +337,7 @@
}
that.checkPageState()
that.sfview()
} else {
console.log("出现错误", res)
}
......@@ -360,8 +364,8 @@
this.$store.state.loading = true
//查询订单信息
this.sfview()
},
},
showLoginModal() {
this.loginModal = true
},
......@@ -378,7 +382,9 @@
sfview() {
let that = this
loading()
SFView(this.state.state).then((res) => {
hidden()
that.$store.state.loading = false
console.log("查询订单信息结果:", res)
if (res.data.code == 0) {
......@@ -386,15 +392,17 @@
if (Object.values(res.data.result)[0] !== null) {
console.log(Object.values(res.data.result)[0])
that.orderData = Object.values(res.data.result)[0]
that.subTabs[that.subCurrent].count = 0
that.setCount()
if(that.titleCurrent == 2){
that.changeColor=true
}else{
that.changeColor=false
if (that.titleCurrent == 2) {
that.changeColor = true
} else {
that.changeColor = false
}
} else {
console.log(Object.values(res.data.result)[0])
that.orderData = Object.values(res.data.result)[0]
that.subTabs[that.subCurrent].count = 0
that.setCount()
}
} else {
......@@ -409,7 +417,11 @@
if (this.titleCurrent != 1) {
this.clearCount()
let count = this.orderData.length
this.titleTabs[this.titleCurrent].count = count
if (count > 99) {
this.titleTabs[this.titleCurrent].count = '99+'
} else {
this.titleTabs[this.titleCurrent].count = count
}
} else {
if (this.orderData) {
this.clearCount()
......@@ -423,7 +435,12 @@
for (let i in this.titleTabs) {
this.titleTabs[i].count = 0
}
}
},
clearSubCount() {
for (let i in this.subTabs) {
this.subTabs[i].count = 0
}
},
}
}
</script>
......@@ -500,24 +517,32 @@
.radius {
font-size: 20rpx;
text-align: center;
vertical-align: middle;
position: absolute;
top: -20;
right: -20;
display: inline-block;
width: 30rpx;
height: 30rpx;
border: 3rpx none #ff9900;
min-width: 30rpx;
min-height: 30rpx;
border: 1rpx none #ff9900;
background-color: #ff9900;
color: white;
border-radius: 50%;
}
.u-badge.data-v-662d25bf {
background-color: #ff9900 !important;
}
.show {
background-color: #00ff00
}
.disaper{
.disaper {
display: none;
}
.deom-flex {
padding-top: 15rpx;
text-align: center;
......
......@@ -77,14 +77,14 @@
latitude: 23.57,
longitude: 116.88308,
zIndex: 5,
iconPath: '../../static/images/marks.png'
// iconPath: '../../static/images/marks.png'
},
{
id: 2,
latitude: 22.56,
longitude: 116.88308,
zIndex: 5,
iconPath: '../../static/images/marks.png'
// iconPath: '../../static/images/marks.png'
}
],
showPopup: false,
......
......@@ -578,6 +578,7 @@
this.yyShow = true
}
that.orderDetails.Maindata[0].FSFQUOTEDPRICEAMOUNTSF=that.orderDetails.Maindata[0].FSFQUOTEDPRICEAMOUNTSF.toFixed(2)
that.orderDetails.Maindata[0].FAPPOINTMENTDATE=that.dateChangeFormat('YYYY-mm-dd HH:MM:SS',that.orderDetails.Maindata[0].FAPPOINTMENTDATE)
} else {
toast(res.data.message)
console.log("查询订单详情信息失败:", res)
......@@ -815,7 +816,26 @@
}
},
//分割数据的时间
dateChangeFormat(format, date) {
date = new Date(date);
const dataItem = {
'Y+': date.getFullYear().toString(),
'm+': (date.getMonth() + 1).toString(),
'd+': date.getDate().toString(),
'H+': date.getHours().toString(),
'M+': date.getMinutes().toString(),
'S+': date.getSeconds().toString(),
};
Object.keys(dataItem).forEach((item) => {
const ret = new RegExp(`(${item})`).exec(format);
if (ret) {
format = format.replace(ret[1], ret[1].length === 1 ? dataItem[item] : dataItem[item]
.padStart(ret[1].length, '0'));
}
});
return format;
},
bottomBtn() {
switch (this.orderDetails.Maindata[0].caption) {
case '待报价':
......@@ -914,7 +934,7 @@
that.picUrl.splice(i, 0, res.data.result[0].fileurl)
console.log(that.picUrl)
} else {
toast(res.data.message)
// toast(res.data.message)
}
})
}
......
......@@ -422,8 +422,8 @@
.radius {
display: inline-block;
width: 45rpx;
height: 45rpx;
min-width: 45rpx;
min-height: 45rpx;
border: 3rpx none #ff1f02;
background-color: #ff1f02;
color: white;
......
export function loading(){
uni.showLoading({
title:'加载中...'
title:'加载中...',
mask:'true'
})
}
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论