页面修改
This commit is contained in:
parent
f5543a12a6
commit
41d647bbc2
@ -45,6 +45,7 @@ export const upLoadImage = (data) => {
|
||||
|
||||
export const VIDEO_URL = HTTP_REQUEST_URL_THREE + '/api/upload/video'
|
||||
export const FILE_URL = HTTP_REQUEST_URL_THREE + '/api/upload/file'
|
||||
export const IMG_URL = HTTP_REQUEST_URL_THREE + '/api/upload/image'
|
||||
// im文件上传
|
||||
// export const VIDEO_URL_IM = HTTP_REQUEST_URL_THREE + '/api/upload/video'
|
||||
export const FILE_URL_IM = HTTP_REQUEST_URL_THREE + '/common/im/sendFileMsg'
|
@ -10,10 +10,11 @@
|
||||
<map :class="mapClass" id="map" @markertap='mapFun' :enable-zoom="true" :polyline="polyline"
|
||||
:markers='markers' :scale="scale" style="width:100%;height: 70%;background-color: red;"
|
||||
: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>
|
||||
<cover-view class="cover" v-if="showToast">
|
||||
</cover-view>
|
||||
<cover-image v-else class="map_btn" @tap="test" src="../../static/img/logistics/DH.png">
|
||||
</cover-image>
|
||||
|
||||
</map>
|
||||
|
||||
<view class="map_address">
|
||||
@ -76,7 +77,7 @@
|
||||
<view class="goods-tit" style="align-items: center;"
|
||||
v-for="(item,index) in goodsDetil.product" :key="index">
|
||||
<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: 1;">X{{item.product_num}}{{item.goods_unit}}</text> -->
|
||||
|
@ -37,15 +37,18 @@
|
||||
|
||||
<view class="" v-if="!file">
|
||||
<lsjUpload ref="lsjUpload" childId="upload1" :size="10" :option="fileOption" height="200rpx"
|
||||
style="margin-top: 28rpx;" :debug="false" :formats="'pdf'" :multiple="false" :count="1"
|
||||
:instantly="true" @change="changeFile" @uploadEnd="onuploadEnd">
|
||||
<view class="change-file">请选择PDF类型的发票</view>
|
||||
style="margin-top: 28rpx;" :debug="false" :formats="'png,jpg,jpeg,pdf,webp'" :multiple="false"
|
||||
:count="1" :instantly="false" @change="changeFile" @uploadEnd="onuploadEnd">
|
||||
<view class="change-file">上传凭证</view>
|
||||
</lsjUpload>
|
||||
</view>
|
||||
<view class="file" v-else>
|
||||
<view class="">
|
||||
<image src="@/static/img/contract/pdf.png"
|
||||
style="width: 150rpx;height: 150rpx;margin-right: 12rpx;">
|
||||
<image :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">
|
||||
@ -75,8 +78,8 @@
|
||||
@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>
|
||||
<mybtn v-else :text="task.status==3?'已完成任务':'任务已关闭'" :my_btn_disabled="true"></mybtn>
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
@ -86,17 +89,22 @@
|
||||
} from "@/api/task.js"
|
||||
import lsjUpload from '@/uni_modules/lsj-upload/components/lsj-upload/lsj-upload.vue'
|
||||
import {
|
||||
FILE_URL
|
||||
FILE_URL,
|
||||
IMG_URL
|
||||
} from '@/api/file.js'
|
||||
import {
|
||||
Toast
|
||||
} from "../../libs/uniApi";
|
||||
import {
|
||||
nextTick
|
||||
} from "vue";
|
||||
export default {
|
||||
components: {
|
||||
lsjUpload
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
imgTypeList: ["png", "jpg", "jpeg", "webp"],
|
||||
isDisabled: false,
|
||||
amount: "",
|
||||
fileOption: {},
|
||||
@ -104,6 +112,7 @@
|
||||
task_id: -1,
|
||||
file: "",
|
||||
fileTit: "",
|
||||
file_type: "pdf",
|
||||
};
|
||||
},
|
||||
onLoad(options) {
|
||||
@ -121,19 +130,31 @@
|
||||
methods: {
|
||||
navToContract() {
|
||||
let fileSrc = this.file
|
||||
uni.navigateTo({
|
||||
url: `/subpkg/pdfView/pdfView?url=${fileSrc}`
|
||||
})
|
||||
|
||||
if (this.file_type == 'image') {
|
||||
uni.previewImage({
|
||||
urls: [fileSrc]
|
||||
})
|
||||
} else {
|
||||
uni.navigateTo({
|
||||
url: `/subpkg/pdfView/pdfView?url=${fileSrc}`
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
|
||||
},
|
||||
async submitFn() {
|
||||
if (!this.amount) return Toast("请输入金额")
|
||||
if (this.amount < this.task.extend.shareholder.money) return Toast("未达到目标入股金额,无法提交")
|
||||
if (Number(this.amount) < Number(this.task.extend.shareholder.money)) return Toast("未达到目标入股金额,无法提交")
|
||||
let res = await commit_service_group_taskAPI({
|
||||
id: this.task_id,
|
||||
annex: this.file,
|
||||
amount: this.amount
|
||||
amount: this.amount,
|
||||
file_type: this.file_type
|
||||
})
|
||||
Toast("操作成功!")
|
||||
return
|
||||
setTimeout(() => {
|
||||
uni.navigateBack()
|
||||
}, 1000)
|
||||
@ -164,11 +185,23 @@
|
||||
* 文件选择回调
|
||||
* @param {Object} files 已选择的所有文件Map集合
|
||||
*/
|
||||
changeFile(files) {
|
||||
async changeFile(files) {
|
||||
let type = [...files.values()][0].name
|
||||
let isImage = null
|
||||
this.imgTypeList.forEach(item => {
|
||||
if (type.includes(item)) {
|
||||
isImage = true
|
||||
this.file_type = 'image'
|
||||
}
|
||||
})
|
||||
|
||||
if (isImage) {
|
||||
this.$refs.lsjUpload.setData("url", IMG_URL)
|
||||
}
|
||||
this.$refs.lsjUpload.upload()
|
||||
// 更新选择的文件
|
||||
this.files = files;
|
||||
// 强制更新视图
|
||||
console.log('当前选择的文件列表:', JSON.stringify([...files.values()]));
|
||||
this.$forceUpdate();
|
||||
},
|
||||
/**
|
||||
@ -192,9 +225,8 @@
|
||||
});
|
||||
this.task = res.data;
|
||||
if (this.task.extend.is_commit == 1) {
|
||||
|
||||
|
||||
this.file = this.task.extend.annex
|
||||
this.file_type = this.task.extend.file_type
|
||||
this.amount = this.task.extend.amount || 0
|
||||
this.fileTit = "附件"
|
||||
this.isDisabled = true
|
||||
|
Loading…
x
Reference in New Issue
Block a user