This commit is contained in:
weipengfei 2023-09-13 16:45:07 +08:00
commit 33205f116c
5 changed files with 1105 additions and 1032 deletions

View File

@ -371,7 +371,7 @@
}
this.doneGood()
this.showPop = false
this.showMore()
// this.showMore()
},
//
@ -380,8 +380,15 @@
take_code: this.take_code,
logistics_id: this.goodsInfo.id
}).then(res => {
console.log(res)
this.$emit('showTost')
this.$emit('getlist')
}).catch(err => {
console.log(err.msg)
uni.showToast({
title: err.msg,
icon: "none"
})
})
},

View File

@ -1,50 +1,117 @@
<template>
<view class="c_task_item" @click="clickTask">
<view class="personnel_list">
<view class="cards">
<view class="cards_head">
<text style="font-size: 32rpx">任务名称: {{datas.title}}</text>
<text style="font-size: 32rpx">任务名称: {{ datas.title }}</text>
<text>点击查看</text>
</view>
<view class="cards_content">
<view class="right" style="width: 100%;">
<view class="" style="display: flex;">
<view class="right" style="width: 100%">
<view class="" style="display: flex">
<view>任务状态 :</view>
<view class="text" style="color: #ff7c32;">
<text v-if="datas.status==3" style="color: #488F00;">已完成</text>
<text v-else-if="datas.status==5" style="color: #ccc;">已关闭</text>
<block v-else-if="(datas.type==31||datas.type==32||datas.type==33||datas.type==34||datas.type==35)">
<block v-if="datas.extend&&datas.extend.informationg">
{{(datas.extend.informationg.update?datas.extend.informationg.update:0)+'/'+(datas.extend.informationg.count?datas.extend.informationg.count:0)}}
<view class="text" style="color: #ff7c32">
<text v-if="datas.status == 3" style="color: #488f00"
>已完成</text
>
<text v-else-if="datas.status == 5" style="color: #ccc"
>已关闭</text
>
<block
v-else-if="
datas.type == 31 ||
datas.type == 32 ||
datas.type == 33 ||
datas.type == 34 ||
datas.type == 35
"
>
<block v-if="datas.extend && datas.extend.informationg">
{{
(datas.extend.informationg.update
? datas.extend.informationg.update
: 0) +
"/" +
(datas.extend.informationg.count
? datas.extend.informationg.count
: 0)
}}
</block>
<block
v-else-if="datas.extend&&datas.extend.transaction&&datas.extend.transaction.arr">
{{total_price+'元/'+(datas.extend.transaction.arr.day_money?datas.extend.transaction.arr.day_money:0)+'元'}}
<!-- <text style="color: #488F00;margin-left: 26rpx;">{{(datas.extend.transaction.arr.transaction_pool?datas.extend.transaction.arr.transaction_pool:0)+'元'}}</text> -->
v-else-if="
datas.extend &&
datas.extend.transaction &&
datas.extend.transaction.arr
"
>
{{
(datas.extend.transaction.arr.transaction_pool
? datas.extend.transaction.arr.transaction_pool
: 0) +
"元/" +
(datas.extend.transaction.arr.day_money
? datas.extend.transaction.arr.day_money
: 0) +
"元"
}}
<!-- <text style="color: #488F00;margin-left: 26rpx;">{{(datas.extend.transaction.arr.transaction_pool?datas.extend.transaction.arr.transaction_pool:1)+'元'}}</text> -->
</block>
<block v-else-if="datas.extend&&datas.extend.update">
<text v-if="datas.extend.update.transfer&&datas.extend.update.transfer.lnglat[0]||datas.status==3" style="color: #488f00;">抵达终点</text>
<text v-else-if="datas.extend.update.terminus&&datas.extend.update.terminus.lnglat[0]">抵达中转点</text>
<block v-else-if="datas.extend && datas.extend.update">
<text
v-if="
(datas.extend.update.transfer &&
datas.extend.update.transfer.lnglat[0]) ||
datas.status == 3
"
style="color: #488f00"
>抵达终点</text
>
<text
v-else-if="
datas.extend.update.terminus &&
datas.extend.update.terminus.lnglat[0]
"
>抵达中转点</text
>
<text v-else>进行中</text>
</block>
<block v-else>进行中</block>
</block>
</view>
</view>
<view style="display: flex;justify-content: space-between;align-items: center;">
<view
style="
display: flex;
justify-content: space-between;
align-items: center;
"
>
<view>
<text>完成时间 :</text>
<text>{{datas.end_time}}</text>
<text>{{ datas.end_time }}</text>
</view>
<text v-if="datas.status==2||datas.status==1" style="background-color: #ff7c32;"
class="status">进行中</text>
<text v-if="datas.status==3" style="background-color: #488F00;" class="status">已完成</text>
<text v-if="datas.status==5" style="background-color: #ccc;" class="status">已关闭</text>
<text
v-if="datas.status == 2 || datas.status == 1"
style="background-color: #ff7c32"
class="status"
>进行中</text
>
<text
v-if="datas.status == 3"
style="background-color: #488f00"
class="status"
>已完成</text
>
<text
v-if="datas.status == 5"
style="background-color: #ccc"
class="status"
>已关闭</text
>
</view>
<view class="">
<text>任务金额 :</text>
<text> {{datas.money+'元'||'0.00'}} </text>
<text> {{ datas.money + "元" || "0.00" }} </text>
</view>
</view>
</view>
@ -98,83 +165,82 @@
</view>
</view>
-->
</view>
</template>
<script>
import {
import {
Toast
} from '../../libs/uniApi';
export default {
} from '../../libs/uniApi';
export default {
name: "task",
props: {
datas: {
type: Object,
default: function() {
default: function () {
return {}
}
}
},
data() {
data () {
return {
};
},
created() {
try{
created () {
try {
}catch(e){
} catch (e) {
//TODO handle the exception
}
},
computed:{
total_price(){
return this.datas?.extend?.transaction?.arr?.transaction_pool?this.datas.extend.transaction.arr.total_price += +this.datas.extend.transaction.arr.transaction_pool: this.datas.extend.transaction.arr.total_price
computed: {
total_price () {
return this.datas?.extend?.transaction?.arr?.transaction_pool ? this.datas.extend.transaction.arr.total_price += +this.datas.extend.transaction.arr.transaction_pool : this.datas.extend.transaction.arr.total_price
}
},
methods: {
navTo(url) {
if(url){
navTo (url) {
if (url) {
uni.showLoading({
title: '加载中',
mask: true
});
uni.navigateTo({
url: url,
success() {
success () {
uni.hideLoading()
}
})
}else Toast('暂未开放')
} else Toast('暂未开放')
},
clickTask() {
clickTask () {
// console.log('', this.$props.datas);
// if ((this.$props.datas.type != 31) && this.$props.datas.status !== 2 && this.$props.datas.status !== 1) {
// return this.$props.datas.status == 3 ? Toast('!') : Toast('!');
// }
if (this.$props.datas.type == 31) {
// this.navTo('/subpkg/fileTask/fileTask?id=' + JSON.stringify(this.$props.datas?.extend?.informationg?.arr))
if(this.$store.state.app.userInfo.admin_id)this.navTo(`/subpkg/captain/captain?task_id=${this.$props.datas?.id}`);
if (this.$store.state.app.userInfo.admin_id) this.navTo(`/subpkg/captain/captain?task_id=${this.$props.datas?.id}`);
else this.navTo(`/subpkg/archives/archives?task_id=${this.$props.datas?.id}`);
} else if (this.$props.datas.type == 32) {
// this.navTo('/subpkg/fileTask/fileTask?id=' + JSON.stringify(this.$props.datas?.extend?.informationg?.arr))
this.navTo(`/subpkg/property/vehicle?task_id=${this.$props.datas?.id}`)
} else if(this.$props.datas.type == 33){
} else if (this.$props.datas.type == 33) {
this.navTo(`/subpkg/blockTransaction/blockTransaction?task_id=${this.$props.datas?.id}`)
}else if(this.$props.datas.type == 34){
} else if (this.$props.datas.type == 34) {
this.navTo(`/subpkg/otherTask/otherTask?task_id=${this.$props.datas?.id}`)
}else if(this.$props.datas.type == 35){
} else if (this.$props.datas.type == 35) {
this.navTo(`/subpkg/buyShare/buyShare?task_id=${this.$props.datas?.id}`)
}
else this.navTo('');
}
}
}
}
</script>
<style lang="scss">
.c_task_item {
.c_task_item {
margin: 0 auto;
// margin-bottom: 28rpx;
width: 694rpx;
@ -198,7 +264,7 @@
display: flex;
justify-content: space-between;
padding: 28rpx;
border-bottom: 1rpx solid #F5F5F5FF;
border-bottom: 1rpx solid #f5f5f5ff;
.left {
display: flex;
@ -246,7 +312,7 @@
.right {
font-size: 32rpx;
font-weight: 400;
color: #3274F9;
color: #3274f9;
line-height: 39rpx;
.price {
@ -256,14 +322,12 @@
}
}
}
}
}
.personnel_list {
.personnel_list {
// padding: 28rpx 0;
padding-bottom: 28rpx;
.cards {
margin: 0 auto;
// margin-bottom: 28rpx;
@ -314,7 +378,6 @@
justify-content: space-between;
view {
text:nth-child(2) {
margin-left: 20rpx;
}
@ -326,7 +389,6 @@
text-align: center;
padding: 10rpx 30rpx;
border-radius: 30rpx;
}
}
}
@ -340,5 +402,5 @@
transform: translate(-50%, -50%);
}
}
}
}
</style>

View File

@ -6,7 +6,7 @@ let httpApiTwo; // 物流系统域名
const env = 'prod'; // 生产
// const env = 'prew'; // 预上线
switch(env){
switch (env) {
case 'prod':
httpApi = 'https://worker-task.lihaink.cn' //正式
httpApiTwo = 'https://logistics.lihaink.cn' //正式环境

View File

@ -558,7 +558,7 @@
"path": "property/index",
"style": {
"navigationBarTitleText": "资产管理",
"enablePullDownRefresh": false,
"enablePullDownRefresh": true,
"navigationBarBackgroundColor": "#0122C7",
"navigationBarTextStyle": "white"
}

View File

@ -1,22 +1,24 @@
<template>
<view class="">
<view class="card">
<!-- <view class="item">
<view class="price">{{c_money(card.total_price)}}</view>
</view> -->
<view class="item">
<view class="item" v-if="card.is_show == true">
<view>交易金额剩余池</view>
<view class="price">{{c_money(card.transaction_pool)}}</view>
<!-- <view class="price" v-if="company.deposit">{{cCount(company.deposit)}}</view>
<view class="price" v-else>0.00</view> -->
<view class="price">{{ c_money(card.transaction_pool) }}</view>
</view>
<view class="item">
<view>目标完成金额</view>
<!-- <view class="price" v-if="company.company_money">{{cCount(company.company_money)}}</view>
<view class="price" v-else>0.00</view> -->
<view class="price">{{c_money(card.day_money)}}</view>
<view class="price">{{ c_money(card.day_money) }}</view>
</view>
<!-- <view class="item">
<view>交易金额剩余池</view>
<view class="price">{{c_money(card.transaction_pool)}}</view>
</view> -->
</view>
<!-- <view class="nav">
<view class="title">账单流水</view>
<view class="right">
@ -26,7 +28,6 @@
</view>
</view> -->
<view class="list">
<!-- <view class="item" v-for="(item, index) in 10" :key="index">
<view class="top">
@ -50,31 +51,34 @@
</view>
</view> -->
<view class="item" v-for="(item, index) in list" :key="item.id">
<view class="top">
账单日期{{item.create_time}}
</view>
<view class="top"> 账单日期{{ item.create_time }} </view>
<view class="t_bottom">
<view class="order">订单编号{{item.order_sn}}</view>
<view class="price">交易额: {{item.total_price}}</view>
<view class="order">订单编号{{ item.order_sn }}</view>
<view class="price">交易额: {{ item.total_price }}</view>
</view>
</view>
<u-loadmore :status="loadConfig.status" :loading-text="loadConfig.loadingText"
:loadmore-text="loadConfig.loadmoreText" :nomore-text="loadConfig.nomoreText" />
<u-loadmore
:status="loadConfig.status"
:loading-text="loadConfig.loadingText"
:loadmore-text="loadConfig.loadmoreText"
:nomore-text="loadConfig.nomoreText"
/>
</view>
</view>
</template>
<script>
import { Toast } from '../../libs/uniApi'
import { taskOrderDetail } from "@/api/task.js"
export default {
data() {
import { Toast } from '../../libs/uniApi'
import { taskOrderDetail } from "@/api/task.js"
export default {
data () {
return {
card: {
total_price: "0.00",
status: 1,
day_money: "0.00",
transaction_pool: "0.00"
transaction_pool: "0.00",
is_show: true
},
list: [],
task_id: '',
@ -89,28 +93,28 @@
},
}
},
onLoad(options) {
onLoad (options) {
options.task_id ? this.task_id = options.task_id : null;
this.initLoad();
},
onShow() {},
onReachBottom() {
onShow () { },
onReachBottom () {
this.loadList();
},
methods: {
navTo(url) {
navTo (url) {
url ?
uni.navigateTo({
url: url,
}) : Toast('暂未开放')
},
async initLoad() {
async initLoad () {
this.loadConfig.page = 1;
this.loadConfig.status = "loadmore";
this.list = [];
await this.loadList();
},
async loadList() {
async loadList () {
try {
let that = this;
if (this.loadConfig.status == "nomore") return;
@ -128,8 +132,8 @@
this.loadConfig.page++;
}
let extend = res.data?.extend;
Object.keys(this.card).forEach((key)=>{
if(extend?.transaction?.arr[key]!=null&&extend?.transaction?.arr[key]!=undefined)this.card[key] = extend?.transaction?.arr[key];
Object.keys(this.card).forEach((key) => {
if (extend?.transaction?.arr[key] != null && extend?.transaction?.arr[key] != undefined) this.card[key] = extend?.transaction?.arr[key];
})
this.card.transaction_pool += this.card.total_price;
this.list = [...this.list, ...res.data?.list]
@ -137,27 +141,27 @@
this.loadConfig.status = "nomore"
}
},
c_money(str){
try{
if(!isNaN(str)){
c_money (str) {
try {
if (!isNaN(str)) {
typeof str != 'string' ? str = str.toFixed(2) : str = parseFloat(str).toFixed(2);
}else str = '0.00'
}catch(e){
} else str = '0.00'
} catch (e) {
str = '0.00'
}
return '¥'+str;
return '¥' + str;
}
},
onPullDownRefresh() {
this.initLoad().then(()=>{
onPullDownRefresh () {
this.initLoad().then(() => {
uni.stopPullDownRefresh()
})
}
}
}
</script>
<style lang="scss">
.card {
.card {
margin: 28rpx auto;
width: 694rpx;
height: 158rpx;
@ -187,9 +191,9 @@
font-weight: 500;
}
}
}
}
.nav {
.nav {
margin: 28rpx;
display: flex;
justify-content: space-between;
@ -224,15 +228,15 @@
color: #0122c7;
}
}
}
}
.list {
.list {
.item {
margin: 0 auto;
margin-bottom: 28rpx;
width: 694rpx;
// height: 238rpx;
background: #FFFFFF;
background: #ffffff;
border-radius: 14rpx 14rpx 14rpx 14rpx;
opacity: 1;
padding: 28rpx;
@ -246,12 +250,12 @@
&:before {
display: inline-block;
content: '交易明细';
content: "交易明细";
width: 137rpx;
height: 49rpx;
line-height: 49rpx;
text-align: center;
background: #FF7C32;
background: #ff7c32;
border-radius: 26rpx 26rpx 26rpx 26rpx;
color: #fff;
margin-right: 28rpx;
@ -288,7 +292,7 @@
align-items: center;
font-size: 32rpx;
font-weight: 500;
color: #F02828;
color: #f02828;
}
}
@ -302,10 +306,10 @@
flex-wrap: wrap;
.price {
color: #FF7C32;
color: #ff7c32;
flex-shrink: 0;
}
}
}
}
}
</style>