This commit is contained in:
zmj 2023-11-16 18:51:55 +08:00
parent a2d3d2e156
commit 7d6b6db4d9
4 changed files with 346 additions and 213 deletions

View File

@ -2,7 +2,7 @@ let httpApiThree;
let httpApi; // 总域名 let httpApi; // 总域名
let httpApiTwo; // 物流系统域名 let httpApiTwo; // 物流系统域名
const env = 'dev'; // 开发 const env = 'local'; // 开发
// const env = 'prod'; // 生产 // const env = 'prod'; // 生产
// const env = 'prew'; // 预上线 // const env = 'prew'; // 预上线
// const env = 'local'; // 本地 // const env = 'local'; // 本地
@ -19,9 +19,10 @@ switch (env) {
httpApiTwo = 'https://preview-logistics.lihaink.cn' //预上线 httpApiTwo = 'https://preview-logistics.lihaink.cn' //预上线
break; break;
case 'local': case 'local':
httpApi = 'http://192.168.1.12:8001' //预上线
httpApiThree = 'http://192.168.1.12:8001' //预上线 httpApi = 'http://192.168.1.20:8000' //预上线
httpApiTwo = 'http://192.168.1.12:8001' //预上线 httpApiThree = 'http://192.168.1.20:8000' //预上线
httpApiTwo = 'http://192.168.1.20:8000' //预上线
break; break;
default: default:
httpApi = 'https://ceshi-worker-task.lihaink.cn' //测试 httpApi = 'https://ceshi-worker-task.lihaink.cn' //测试

View File

@ -12,6 +12,7 @@
:latitude="markers[0].latitude" :enable-scroll="true" :longitude="markers[0].longitude"> :latitude="markers[0].latitude" :enable-scroll="true" :longitude="markers[0].longitude">
<cover-image class="map_btn" @tap="test" src="../../static/img/logistics/DH.png"> <cover-image class="map_btn" @tap="test" src="../../static/img/logistics/DH.png">
</cover-image> </cover-image>
<cover-view v-if="showToast" class="cover"></cover-view>
</map> </map>
<view class="map_address"> <view class="map_address">
<view style="display: flex;"> <view style="display: flex;">
@ -47,14 +48,10 @@
订单备注:&nbsp;&nbsp;{{goodsDetil.logistics.mark}} 订单备注:&nbsp;&nbsp;{{goodsDetil.logistics.mark}}
</view> </view>
</view> </view>
<view class="mark"> <view class="mark">
请详细核对订单信息 请详细核对订单信息
</view> </view>
</view> </view>
<view class="order_info" style="background-color: #47BE62;"> <view class="order_info" style="background-color: #47BE62;">
<view class="top"> <view class="top">
<view> <view>
@ -65,7 +62,6 @@
通知时间:&nbsp;&nbsp;{{goodsDetil.logistics.create_time}} 通知时间:&nbsp;&nbsp;{{goodsDetil.logistics.create_time}}
</view> </view>
<view class="pro_list"> <view class="pro_list">
<view class="goods"> <view class="goods">
<text> <text>
商品信息 商品信息
@ -73,7 +69,7 @@
<view class="goods-tit" style="align-items: center;" <view class="goods-tit" style="align-items: center;"
v-for="(item,index) in goodsDetil.product" :key="index"> v-for="(item,index) in goodsDetil.product" :key="index">
<u--image style="flex: 2;" radius='10' :showLoading="true" :src="item.goods_pic" <u--image style="flex: 2;" radius='10' :showLoading="true" :src="item.goods_pic"
width="100rpx" height="100rpx" @click="click"></u--image> width="100rpx" height="100rpx"></u--image>
<text style="flex: 6;">{{item.goods_name}}</text> <text style="flex: 6;">{{item.goods_name}}</text>
<!-- <text style="flex: 1;">X{{item.product_num}}{{item.goods_unit}}</text> --> <!-- <text style="flex: 1;">X{{item.product_num}}{{item.goods_unit}}</text> -->
@ -102,7 +98,16 @@
</view> </view>
</view> </view>
</view> </view>
<!-- 弹窗 -->
<u-overlay :show="showToast" @click="showToast = false">
<view class="warp">
<view class="rect">
<view class="cont">
骑手送货完成
</view>
</view>
</view>
</u-overlay>
</view> </view>
</template> </template>
@ -120,6 +125,7 @@
export default { export default {
data() { data() {
return { return {
showToast: false,
is_captain: 0, is_captain: 0,
mapClass: 'custom-map', mapClass: 'custom-map',
showLoading: true, showLoading: true,
@ -262,14 +268,7 @@
} }
}) })
}, },
showToast() {
this.$refs.uToast.show({
type: 'success',
title: '成功主题(带图标)',
message: "操作成功",
iconUrl: 'https://cdn.uviewui.com/uview/demo/toast/success.png'
})
},
mapFun() { mapFun() {
uni.openLocation({ uni.openLocation({
latitude: Number(this.goodsDetil.logistics.shop_lat), latitude: Number(this.goodsDetil.logistics.shop_lat),
@ -279,14 +278,7 @@
scale: 15, scale: 15,
}); });
}, },
showToast() {
this.$refs.uToast.show({
type: 'success',
title: '成功主题(带图标)',
message: "操作成功",
iconUrl: 'https://cdn.uviewui.com/uview/demo/toast/success.png'
})
},
getDriverLine() { getDriverLine() {
const that = this; const that = this;
const key = "997c9a3d88154fa78f4d28bebc1dd84f"; const key = "997c9a3d88154fa78f4d28bebc1dd84f";
@ -351,8 +343,9 @@
order_id: this.goodsDetil.logistics.order_id, order_id: this.goodsDetil.logistics.order_id,
order_sn: sn order_sn: sn
}).then((res, err) => { }).then((res, err) => {
this.showToast() this.showToast = true
setTimeout(() => { setTimeout(() => {
this.showToast = false
uni.navigateBack() uni.navigateBack()
}, 1000) }, 1000)
}).catch(err => { }).catch(err => {
@ -481,4 +474,30 @@
transform: translateX(-50%); transform: translateX(-50%);
} }
.rect {
width: 455.61rpx;
height: 210.28rpx;
background-color: white;
border-radius: 21.03rpx 21.03rpx 21.03rpx 21.03rpx;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
.cont {
color: #0022C7;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
font-size: 35.05rpx;
}
}
.cover {
width: 100vw;
height: 100vh;
background-color: rgba(0, 0, 0, .5);
}
</style> </style>

View File

@ -23,17 +23,23 @@
</u-steps-item> </u-steps-item>
</u-steps> </u-steps>
</view> </view>
<view class="card" v-if="task.approve_status==3">
<view class="title" style="color: #FF7C32;">驳回提示</view>
<u-line style="margin: 14rpx 0;"></u-line>
<view class="text" style="color: #FF7C32;">{{task.deny_notes}}</view>
<!-- <button v-if="other.is_commit==1" class="btn" @click="toUpdate">去修改</button> -->
</view>
<view class="card"> <view class="card">
<view class="title">附件上传</view> <view class="title">附件上传</view>
<u-line style="margin: 14rpx 0;"></u-line> <u-line style="margin: 14rpx 0;"></u-line>
<view class="" style="display: flex;align-items: center;"> <view class="" style="display: flex;align-items: center;">
<text style="margin-right: 10rpx;">金额:</text> <text style="margin-right: 10rpx;">金额:</text>
<view class="" style="width: 500rpx;"> <view class="" style="width: 500rpx;">
<u--input style="border: 1px solid #CCCCCC;" :readonly='isDisabled' placeholder="请输入金额" <u--input style="border: 1px solid #CCCCCC;" :readonly='isDisabled && task.approve_status!=3'
type='number' border="surround" v-model="amount"></u--input> placeholder="请输入金额" type='number' border="surround" v-model="amount"></u--input>
</view> </view>
</view> </view>
<view class="" :class="{hide:file}"> <view class="" :class="{hide:file}" v-if="!isDisabled || task.approve_status==3">
<view class="" :class="{hide:progress!=0}"> <view class="" :class="{hide:progress!=0}">
<lsjUpload ref="lsjUpload" childId="upload1" :size="10" :option="fileOption" height="200rpx" <lsjUpload ref="lsjUpload" childId="upload1" :size="10" :option="fileOption" height="200rpx"
style="margin-top: 28rpx;" :debug="false" :formats="'png,jpg,jpeg,pdf,webp'" :multiple="false" style="margin-top: 28rpx;" :debug="false" :formats="'png,jpg,jpeg,pdf,webp'" :multiple="false"
@ -48,7 +54,7 @@
</view> </view>
<view class="file" v-if='file'> <view class="file" v-if='file'>
<view class=""> <view class="">
<image :src="local_src" style="width: 150rpx;height: 150rpx;margin-right: 12rpx;" <image :src="local_src||file" style="width: 150rpx;height: 150rpx;margin-right: 12rpx;"
v-if="file_type=='image'"> v-if="file_type=='image'">
</image> </image>
<image src="@/static/img/contract/pdf.png" style="width: 150rpx;height: 150rpx;margin-right: 12rpx;" <image src="@/static/img/contract/pdf.png" style="width: 150rpx;height: 150rpx;margin-right: 12rpx;"
@ -63,7 +69,7 @@
<view class="" style="color: blue;margin-right: 10rpx;" @click="navToContract"> <view class="" style="color: blue;margin-right: 10rpx;" @click="navToContract">
查看 查看
</view> </view>
<view class="" style="color: red;" @click="delFn" v-if="!isDisabled"> <view class="" style="color: red;" @click="delFn" v-if="!isDisabled ||task.approve_status==3">
删除 删除
</view> </view>
</view> </view>
@ -88,6 +94,7 @@
@click="navTo(`/subpkg/topUp/topUp?task_id=${task_id}`)"></mybtn> @click="navTo(`/subpkg/topUp/topUp?task_id=${task_id}`)"></mybtn>
<mybtn v-else :text="task.status==3?'已完成任务':'任务已关闭'" :my_btn_disabled="true"></mybtn> --> <mybtn v-else :text="task.status==3?'已完成任务':'任务已关闭'" :my_btn_disabled="true"></mybtn> -->
<mybtn v-if="!isDisabled" text="提交" @click="submitFn"></mybtn> <mybtn v-if="!isDisabled" text="提交" @click="submitFn"></mybtn>
<mybtn v-else-if="task.approve_status==3" text="已驳回,请重新提交" @click="submitFn"></mybtn>
<mybtn v-else-if='task.status==3' text="已完成任务" :my_btn_disabled="true"></mybtn> <mybtn v-else-if='task.status==3' text="已完成任务" :my_btn_disabled="true"></mybtn>
<mybtn v-else-if="isDisabled" text="任务已经提交" :my_btn_disabled="true"></mybtn> <mybtn v-else-if="isDisabled" text="任务已经提交" :my_btn_disabled="true"></mybtn>
</view> </view>
@ -159,6 +166,7 @@
amount: this.amount, amount: this.amount,
file_type: this.file_type file_type: this.file_type
} }
let res = await commit_service_group_taskAPI({ let res = await commit_service_group_taskAPI({
...data ...data
}) })
@ -168,7 +176,7 @@
}, 1000) }, 1000)
}, },
delFn() { delFn() {
this.clear() if (this.task.approve_status != 3) this.clear()
this.file = "" this.file = ""
this.file_type = "pdf" this.file_type = "pdf"
this.progress = 0 this.progress = 0

View File

@ -1,208 +1,313 @@
<template> <template>
<view class="task_page"> <view style="padding-top: 28rpx;padding-bottom: 160rpx;">
<!-- {{taskInfo}} -->
<u-skeleton v-if="skeleton" :class="{'loading': skeleton}" :animate="true" title rows="3" rows-width="92%"
rowsHeight="56">
</u-skeleton>
<block v-else>
<view class="card"> <view class="card">
<view class="c_title">{{`任务名称: ${taskInfo.title||''}`}}</view> <view class="title">任务名称: {{task.title}}</view>
<view>{{taskInfo.content||''}}</view> <u-line style="margin: 14rpx 0;"></u-line>
</view> <!-- <view class="text">阶段类型: 单次</view> -->
<view class="card" v-if="extend_info&&extend_info.target"> <view class="text" style="color: #FF7C32;" v-if="task.extend&&task.extend.shareholder">入股金额:
<view class="c_title">目标数量: {{extend_info.target}}</view> {{task.extend.shareholder.money}}
</view>
<view class="card" v-if="extend_info&&extend_info.store_name">
<view class="c_title">指定商品: </view>
<view class="store">
<view class="store_name" v-for="(item, index) in extend_info.store_name" :key="index"
@click="copyName(item)">
{{item}}
</view> </view>
</view> </view>
<!-- <view class="card">
<view class="title">任务描述</view>
<u-line style="margin: 14rpx 0;"></u-line>
<view class="text">{{task.content||'暂无任务描述'}}</view>
</view> -->
<view class="card">
<view class="title">事件记录</view>
<u-line style="margin: 14rpx 0;"></u-line>
<u-steps v-if="task.extend&&task.extend.shareholder" :current="-1" direction="column" activeColor="#0122c7"
dot inactiveColor="#0122c7">
<u-steps-item v-for="(item, index) in task.extend.shareholder.user_list" :title="item.time"
:desc="item.info">
</u-steps-item>
</u-steps>
</view> </view>
<view class="card"> <view class="card">
<view class="c_title">判定条件:</view> <view class="title">附件上传</view>
<view style="white-space: pre-line;">{{remark}}</view> <u-line style="margin: 14rpx 0;"></u-line>
<view class="" style="display: flex;align-items: center;">
<text style="margin-right: 10rpx;">金额:</text>
<view class="" style="width: 500rpx;">
<u--input style="border: 1px solid #CCCCCC;" :readonly='isDisabled' placeholder="请输入金额"
type='number' border="surround" v-model="amount"></u--input>
</view> </view>
</block> </view>
<view class="" :class="{hide:file}" v-if="!isDisabled">
<view class="" :class="{hide:progress!=0}">
<lsjUpload ref="lsjUpload" childId="upload1" :size="10" :option="fileOption" height="200rpx"
style="margin-top: 28rpx;" :debug="false" :formats="'png,jpg,jpeg,pdf,webp'" :multiple="false"
:count="1" :instantly="false" @change="changeFile" @uploadEnd="onuploadEnd"
@progress="onprogress">
<view class="change-file">上传凭证</view>
</lsjUpload>
</view>
<view style="margin-top: 20rpx;" v-if="progress>0">
<u-loading-icon :text=" '正在上传中'+ progress+'%'" textSize="18"></u-loading-icon>
</view>
</view>
<view class="file" v-if='file'>
<view class="">
<image :src="local_src||file" style="width: 150rpx;height: 150rpx;margin-right: 12rpx;"
v-if="file_type=='image'">
</image>
<image src="@/static/img/contract/pdf.png" style="width: 150rpx;height: 150rpx;margin-right: 12rpx;"
v-else>
</image>
</view>
<view class="r-cont">
<view class="">
{{fileTit}}
</view>
<view class="" style="display: flex;">
<view class="" style="color: blue;margin-right: 10rpx;" @click="navToContract">
查看
</view>
<view class="" style="color: red;" @click="delFn" v-if="!isDisabled">
删除
</view>
</view>
</view>
</view>
<!-- <button @click='uplodeFileFn'>点击上传附件</button> -->
<!-- <image class="contract_img" src="@/static/img/contract/pdf.png"></image> -->
<!-- <view class="text">
<view class="name">{{item.contract_type_name||'合同'}}</view>
<view>
<text>{{item.update_time}}</text>
</view>
</view> -->
<!-- <view class="text" style="color: #FF7C32;">入股的金额将在次日凌晨更新到"股金管理"请于次日打开"股金管理"页面查看详情</view> -->
</view>
<!-- <mybtn v-if="task.status!=3 && task.status!=5" text="前往支付页面"
@click="navTo(`/subpkg/topUp/topUp?task_id=${task_id}`)"></mybtn>
<mybtn v-else :text="task.status==3?'已完成任务':'任务已关闭'" :my_btn_disabled="true"></mybtn> -->
<mybtn v-if="!isDisabled" text="提交" @click="submitFn"></mybtn>
<mybtn v-else-if='task.status==3' text="已完成任务" :my_btn_disabled="true"></mybtn>
<mybtn v-else-if="isDisabled" text="任务已经提交" :my_btn_disabled="true"></mybtn>
</view> </view>
</template> </template>
<script> <script>
import {
taskShareholder,
commit_service_group_taskAPI
} from "@/api/task.js"
import lsjUpload from '@/uni_modules/lsj-upload/components/lsj-upload/lsj-upload.vue'
import {
FILE_URL,
IMG_URL
} from '@/api/file.js'
import { import {
Toast Toast
} from "../../libs/uniApi"; } from "../../libs/uniApi";
import {
townTaskDetails
} from "@/api/task.js"
import {
dictDataListsTypeValue
} from "@/api/oaPbulic.js"
export default { export default {
components: {
lsjUpload
},
data() { data() {
return { return {
taskInfo: { progress: 0,
id: '', imgTypeList: ["png", "jpg", "jpeg", "webp"],
title: '', isDisabled: false,
content: '', amount: "",
extend: {} fileOption: {},
}, task: {},
extend_info: null, task_id: -1,
remark: '', file: "",
skeleton: true, local_src: "",
type_value: 'town_task_type', // fileTit: "",
} file_type: "pdf",
};
}, },
onLoad(options) { onLoad(options) {
options.task_id ? this.taskInfo.id = options.task_id : null; this.task_id = options.task_id;
options.type_value ? this.type_value = options.type_value : null; this.loadTask();
this.initTask(); uni.$on('upBuyShare', this.loadTask);
this.fileOption = {
url: FILE_URL,
name: 'file',
header: {
token: this.$store.state.app.token
}
}
}, },
onShow() {},
methods: { methods: {
async initTask() { navToContract() {
this.skeleton = true; let fileSrc = this.file
let res = await townTaskDetails({ if (this.file_type == 'image') {
id: this.taskInfo.id uni.previewImage({
urls: [fileSrc]
})
} else {
uni.navigateTo({
url: `/subpkg/pdfView/pdfView?url=${fileSrc}`
})
}
},
async submitFn() {
if (!this.amount) return Toast("请输入金额")
if (Number(this.amount) < Number(this.task.extend.shareholder.money)) return Toast("未达到目标入股金额,无法提交")
let data = {
id: this.task_id,
annex: this.file,
amount: this.amount,
file_type: this.file_type
}
let res = await commit_service_group_taskAPI({
...data
})
Toast("操作成功!")
setTimeout(() => {
uni.navigateBack()
}, 1000)
},
delFn() {
this.clear()
this.file = ""
this.file_type = "pdf"
this.progress = 0
},
clear() {
this.$refs.lsjUpload.clear();
},
/**
* 某文件上传结束回调(成功失败都回调)
* @param {Object} item 当前上传完成的文件
*/
onuploadEnd(item) {
let res = JSON.parse(item.responseText)
this.file = res.data.uri
this.fileTit = res.data.name
this.$forceUpdate();
},
/**
* 上传进度回调
* 如果网页上md文档没有渲染出事件名称onprogre请复制代码的小伙伴自行添加上哈没有哪个事件是只(item)
* @param {Object} item 当前正在上传的文件
*/
onprogress(item) {
this.progress = item.progress
},
/**
* 文件选择回调
* @param {Object} files 已选择的所有文件Map集合
*/
async changeFile(files) {
let type = [...files.values()][0]?.name || null
if (!type) return
let isImage = null
this.imgTypeList.forEach(item => {
if (type.includes(item)) {
isImage = true
this.file_type = 'image'
}
})
this.local_src = [...files.values()][0].path
if (isImage) {
this.$refs.lsjUpload.setData("url", IMG_URL)
} else {
this.$refs.lsjUpload.setData("url", FILE_URL)
}
this.$refs.lsjUpload.upload()
//
this.files = files;
//
this.$forceUpdate();
},
async loadTask() {
let res = await taskShareholder({
id: this.task_id
}); });
if (res.data?.template_info?.extend) { this.task = res.data;
if (res.data?.template_info?.extend?.goods_id && typeof res.data?.template_info?.extend if (this.task.extend.is_commit == 1) {
?.goods_id !== 'object') { this.file = this.task.extend.annex
res.data.template_info.extend.goods_id = res.data?.template_info?.extend?.goods_id.split(','); this.file_type = this.task.extend.file_type
res.data.template_info.extend.store_name = res.data?.template_info?.extend?.store_name.split( this.amount = this.task.extend.amount || 0
';') || []; this.fileTit = "附件"
} this.isDisabled = true
this.extend_info = res.data?.template_info?.extend;
}
this.taskInfo = res.data;
let dict = await dictDataListsTypeValue({
type_value: this.type_value
// type_value: 'town_task_type_master'
})
dict.data.forEach((item) => {
if (item.id == this.taskInfo.type) {
this.remark = item.remark;
}
})
this.skeleton = false;
},
copyName(str = "", type = "商品名称") {
if (str) uni.setClipboardData({
data: str + "",
success: (e) => {
Toast(type + '已复制')
},
fail: (e) => {
Toast('复制失败')
}
})
} }
}, },
navTo(url) {
if (url) {
uni.showLoading({
title: '加载中',
mask: true
});
uni.navigateTo({
url: url,
success() {
uni.hideLoading()
}
})
} else Toast('暂未开放')
},
}
} }
</script> </script>
<style lang="scss"> <style lang="scss">
.task_page {
padding-top: 30rpx;
.card { .card {
margin: 0 auto; margin: 0 auto;
margin-bottom: 28rpx; margin-bottom: 28rpx;
width: 694rpx; width: 694rpx;
background-color: #fff; background: #FFFFFF;
border-radius: 26rpx; border-radius: 14rpx;
padding: 28rpx; padding: 28rpx;
.c_title { .title {
font-size: 32rpx; font-size: 32rpx;
font-weight: bold; font-weight: bold;
color: #333333; color: #333333;
margin-bottom: 20rpx;
} }
.file { .text {
display: flex; line-height: 50rpx;
justify-content: left; }
flex-wrap: wrap; }
&_item { .contract_img {
flex-shrink: 0; width: 102rpx;
width: 200rpx; height: 102rpx;
height: 200rpx; background: #F5F5F5;
border-radius: 14rpx 14rpx 14rpx 14rpx;
margin-right: 21rpx;
}
.change-file {
margin: 0 auto; margin: 0 auto;
margin-bottom: 16rpx; width: 500rpx;
border: 2px solid #ccc;
border-radius: 10rpx;
overflow: hidden;
position: relative;
.image {
width: 100%;
height: 100%;
}
.del {
position: absolute;
height: 40rpx;
width: 40rpx;
top: 10rpx;
right: 10rpx;
}
}
&_btn {
flex-shrink: 0;
width: 200rpx;
height: 200rpx; height: 200rpx;
margin: 0 auto; border: 2px dashed #ccc;
margin-bottom: 16rpx; border-radius: 14rpx;
border: 2px solid #ccc; color: #999;
font-size: 32rpx;
display: flex; display: flex;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
flex-direction: column;
border-radius: 10rpx;
image {
width: 100rpx;
height: 100rpx;
}
} }
&_empty { .file {
flex-shrink: 0; margin-top: 30rpx;
width: 200rpx;
height: 200rpx;
margin: 0 auto;
margin-bottom: 16rpx;
border: 2px solid transparent;
}
}
.store {
display: flex; display: flex;
flex-wrap: wrap; // justify-content: space-between;
font-size: 26rpx;
color: #0122c7;
margin-top: -10rpx;
&_name { .r-cont {
flex-shrink: 0; display: flex;
padding: 8rpx; justify-content: space-around;
border: 5rpx solid #0122c7; flex-direction: column;
border-radius: 10rpx;
background-color: rgba(#0122c7, 0.1);
margin-right: 10rpx;
margin-top: 10rpx;
}
} }
} }
.loading { .hide {
padding: 28rpx; height: 0;
} overflow: hidden;
} }
</style> </style>