Commit 3333d172 by zhangxw

自测修改

1 parent ad2e2d42
...@@ -2,9 +2,9 @@ ...@@ -2,9 +2,9 @@
<scroll-view class=" scroll" scroll-x enable-flex scroll-with-animation scroll-into-view="{{to}}"> <scroll-view class=" scroll" scroll-x enable-flex scroll-with-animation scroll-into-view="{{to}}">
<block wx:for="{{tabList}}" wx:key="index"> <block wx:for="{{tabList}}" wx:key="index">
<view class="tab-item {{tabIndex==index?'active':''}}" bindtap="change" data-index="{{index}}" id="to-{{index}}"> <view class="tab-item {{tabIndex==index?'active':''}}" bindtap="change" data-index="{{index}}" id="to-{{index}}">
<text id="tab-{{index}}" class="text-item"> <view id="tab-{{index}}" class="text-item">
<text class="tab-item-text">{{item.text || item }}</text><text wx:if="{{item.count >= 0}}" style="font-size: var(--fontSize20);">{{item.count > 99 ? '99+' : item.count}}</text> <view class="tab-item-text">{{item.text || item }}</view><view wx:if="{{item.count >= 0}}" style="font-size: var(--fontSize20);">{{item.count > 99 ? '99+' : item.count}}</view>
</text> </view>
</view> </view>
</block> </block>
<!-- <view class="active-doc" style="{{activeStyle}}" /> --> <!-- <view class="active-doc" style="{{activeStyle}}" /> -->
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
<block wx:for="{{tabList}}" wx:key="index"> <block wx:for="{{tabList}}" wx:key="index">
<!-- style="color:{{tabIndex==index?'#347BFF':''}};" --> <!-- style="color:{{tabIndex==index?'#347BFF':''}};" -->
<view class="tab-item {{tabIndex==index?'active':''}}" bindtap="change" data-index="{{index}}"> <view class="tab-item {{tabIndex==index?'active':''}}" bindtap="change" data-index="{{index}}">
<text id="tab-{{index}}" class="text-item"><text class="tab-item-text">{{item.text || item }}</text><text wx:if="{{item.count >= 0}}" style="font-size: var(--fontSize20);">{{item.count > 99 ? '99+' : item.count}}</text></text> <view id="tab-{{index}}" class="text-item"><view class="tab-item-text">{{item.text || item }}</view><view wx:if="{{item.count >= 0}}" style="font-size: var(--fontSize20);">{{item.count > 99 ? '99+' : item.count}}</view></view>
</view> </view>
</block> </block>
<view class="active-doc" style="{{activeStyle}}" /> <view class="active-doc" style="{{activeStyle}}" />
......
...@@ -41,6 +41,13 @@ ...@@ -41,6 +41,13 @@
text-align: center; text-align: center;
} }
.tab-item .text-item {
height: 38rpx;
display: flex;
align-items: center;
justify-content: center;
}
.scroll .tab-item { .scroll .tab-item {
width: fit-content; width: fit-content;
min-width: var(--fontSize144); min-width: var(--fontSize144);
...@@ -52,6 +59,10 @@ ...@@ -52,6 +59,10 @@
padding: 0 var(--fontSize10); padding: 0 var(--fontSize10);
} }
.scroll .tab-item .text-item {
margin-top: 20rpx;
}
.scroll .active::after { .scroll .active::after {
position: absolute; position: absolute;
bottom: 1rpx; bottom: 1rpx;
......
...@@ -62,7 +62,7 @@ Component({ ...@@ -62,7 +62,7 @@ Component({
return return
} }
wx.chooseMedia({ wx.chooseImage({
count: count, count: count,
mediaType: ['image'], mediaType: ['image'],
success(res) { success(res) {
...@@ -84,13 +84,7 @@ Component({ ...@@ -84,13 +84,7 @@ Component({
}) })
try { try {
for (const item of tempFiles) { for (const item of tempFiles) {
const val = item.tempFilePath const val = item.path
// 兼容企微将内容保存至相册
if (sysInfo.environment) {
wx.saveImageToPhotosAlbum({
filePath: val,
})
}
const imgType = val.split('.')[1] const imgType = val.split('.')[1]
const type = imgType === 'unknown' ? 'jpg' : imgType const type = imgType === 'unknown' ? 'jpg' : imgType
const _res = await new Promise((resolve, reject) => { const _res = await new Promise((resolve, reject) => {
......
<!--packageUsedCar/pages/evaluationForm/components/ButtonModule/ButtonModule.wxml--> <!--packageUsedCar/pages/evaluationForm/components/ButtonModule/ButtonModule.wxml-->
<view class="button-module flex"> <view class="button-module flex">
<view wx:if="{{status == 20 && subStatus == 1}}" class="common-btn ml-24" catch:tap="handleClick" data-type="contract">撤回合同</view>
<view class="common-btn" catch:tap="handleClick" data-type="details">详情</view> <view class="common-btn" catch:tap="handleClick" data-type="details">详情</view>
<view wx:if="{{!subStatus && status != 100 && status != '-1'}}" class="common-btn ml-24" catch:tap="handleClick" data-type="edit">编辑</view> <view wx:if="{{!subStatus && status != 100 && status != '-1'}}" class="common-btn ml-24" catch:tap="handleClick" data-type="edit">编辑</view>
<view wx:if="{{status == 20 && !subStatus}}" class="common-btn ml-24" catch:tap="handleClick" data-type="requote" data-setTrack="evaluate_requote">重新报价</view> <view wx:if="{{status == 20 && !subStatus}}" class="common-btn ml-24" catch:tap="handleClick" data-type="requote" data-setTrack="evaluate_requote">重新报价</view>
<view wx:if="{{status == 20 && !subStatus}}" class="common-btn blue-btn ml-24" catch:tap="handleClick" data-type="sign" data-setTrack="evaluate_sign">客户签约</view> <view wx:if="{{status == 20 && !subStatus}}" class="common-btn blue-btn ml-24" catch:tap="handleClick" data-type="sign" data-setTrack="evaluate_sign">客户签约</view>
<view wx:if="{{status == 20 && subStatus == 1}}" class="common-btn ml-24" catch:tap="handleClick" data-type="contract">撤回合同</view>
<view wx:if="{{subStatus == 1}}" class="common-btn gray-btn ml-24" catch:tap="handleClick" data-type="signing">签约中</view> <view wx:if="{{subStatus == 1}}" class="common-btn gray-btn ml-24" catch:tap="handleClick" data-type="signing">签约中</view>
<view wx:if="{{subStatus == 2 || subStatus == 3}}" class="common-btn gray-btn ml-24" catch:tap="handleClick" data-type="paying" >支付中</view> <view wx:if="{{subStatus == 2 || subStatus == 3}}" class="common-btn gray-btn ml-24" catch:tap="handleClick" data-type="paying" >支付中</view>
<view wx:if="{{status == 30 && !subStatus}}" class="common-btn ml-24" catch:tap="handleClick" data-type="cancelSign" data-setTrack="evaluate_cancel_sign">取消签约</view> <view wx:if="{{status == 30 && !subStatus}}" class="common-btn ml-24" catch:tap="handleClick" data-type="cancelSign" data-setTrack="evaluate_cancel_sign">取消签约</view>
......
...@@ -65,7 +65,11 @@ Component({ ...@@ -65,7 +65,11 @@ Component({
name: '尾款支付中', name: '尾款支付中',
type: 'primary' type: 'primary'
} }
} },
// vehicleCategoryMap: {
// 1: '置换车',
// 2: '报废车'
// }
}, },
/** /**
......
...@@ -19,6 +19,7 @@ ...@@ -19,6 +19,7 @@
<view class="car-number mr-4 mb-4">{{ carInfo.registrationDateStr }}</view> <view class="car-number mr-4 mb-4">{{ carInfo.registrationDateStr }}</view>
<view class="car-number mr-4 mb-4">{{ carInfo.mileageStr }}</view> <view class="car-number mr-4 mb-4">{{ carInfo.mileageStr }}</view>
<view class="car-number">{{ carInfo.transferCountStr }}</view> <view class="car-number">{{ carInfo.transferCountStr }}</view>
<!-- <view class="car-number">{{ vehicleCategoryMap[1] }}</view> -->
</view> </view>
<view> <view>
<view class="flex align-center"> <view class="flex align-center">
......
...@@ -110,7 +110,8 @@ Page({ ...@@ -110,7 +110,8 @@ Page({
], ],
query: null, query: null,
uploadFieldsWithImages: [], uploadFieldsWithImages: [],
confirmCarFieldsWithImages: [] confirmCarFieldsWithImages: [],
videoFormObj: {}
}, },
navbarReady(e) { navbarReady(e) {
...@@ -220,12 +221,125 @@ Page({ ...@@ -220,12 +221,125 @@ Page({
}) })
}, },
handleImageUpload(e) { uploadImages(e) {
let { field, type } = e.currentTarget.dataset let { field, type } = e.currentTarget.dataset
let _this = this let _this = this
let count = field.maxCount - field?.uploadImages.length let count = field.maxCount - field?.uploadImages.length
const index = _this.data[type]?.findIndex(val => val.key == field.key ) const index = _this.data[type]?.findIndex(val => val.key == field.key )
// let sysInfo = wx.getSystemInfoSync() _this.closeChangeUploadType()
wx.chooseImage({
count: count,
success(res) {
for (const file of res.tempFiles) {
if (file.size > 10 * 1024 * 1024) {
return wx.showToast({
title: '图片上传最大10MB',
icon: 'none'
})
}
}
const upload = async (tempFiles) => {
wx.showLoading({
title: '上传中',
mask: true
})
try {
for (const item of tempFiles) {
const val = item.path
const imgType = val.split('.')[1]
const upType = imgType === 'unknown' ? 'jpg' : imgType
const _res = await new Promise((resolve, reject) => {
wx.getFileSystemManager().readFile({
filePath: val, // 选择图片返回的相对路径
encoding: 'base64', // 编码格式
success: resolve,
fail: reject
})
})
const img = await api.uploadImg({
file: `${upType}@${_res.data}`
})
const { code, data, message } = img
if (code == 0) {
_this.data[type][index].uploadImages?.push({url: data, isVideo: false})
_this.setData({
[`${type}`]: _this.data[type],
[`formData.${field.key}`]: _this.data[type][index].uploadImages?.map(val => { return val.url })?.join(',')
})
} else {
wx.$util.showToast(message)
}
}
} catch (error) {
wx.$util.showToast("上传失败,请重试")
} finally {
wx.hideLoading()
}
}
upload(res?.tempFiles)
}
})
},
uploadVideos(e) {
let { field, type } = e.currentTarget.dataset
let _this = this
const index = _this.data[type]?.findIndex(val => val.key == field.key )
_this.closeChangeUploadType()
wx.chooseVideo({
maxDuration: 60,
success(res) {
if (res.size > 100 * 1024 * 1024) {
return wx.showToast({
title: '视频上传最大100MB',
icon: 'none'
})
}
const upload = async (tempFiles) => {
wx.showLoading({
title: '上传中',
mask: true
})
try {
for (const item of tempFiles) {
const val = item.tempFilePath
const imgType = val.split('.')[1]
const upType = imgType === 'unknown' ? 'jpg' : imgType
const _res = await new Promise((resolve, reject) => {
wx.getFileSystemManager().readFile({
filePath: val, // 选择图片返回的相对路径
encoding: 'base64', // 编码格式
success: resolve,
fail: reject
})
})
const img = await api.uploadFileWithCover({
file: `${upType}@${_res.data}`
})
const { code, data, message } = img
if (code == 0) {
_this.data[type][index].uploadImages?.push({url: data.videoUrl, isVideo: true, coverUrl: data.coverUrl})
_this.setData({
[`${type}`]: _this.data[type],
[`formData.${field.key}`]: data.videoUrl
})
} else {
wx.$util.showToast(message)
}
}
} catch (error) {
wx.$util.showToast("上传失败,请重试")
} finally {
wx.hideLoading()
}
}
upload([res])
}
})
},
uploadMedia(field, count, index, type) {
let _this = this
wx.chooseMedia({ wx.chooseMedia({
count: count, count: count,
mediaType: field.video ? ['image', 'video'] : ['image'], mediaType: field.video ? ['image', 'video'] : ['image'],
...@@ -253,7 +367,7 @@ Page({ ...@@ -253,7 +367,7 @@ Page({
} }
} }
} }
const uploadImages = async (tempFiles) => { const upload = async (tempFiles) => {
wx.showLoading({ wx.showLoading({
title: '上传中', title: '上传中',
mask: true mask: true
...@@ -261,18 +375,6 @@ Page({ ...@@ -261,18 +375,6 @@ Page({
try { try {
for (const item of tempFiles) { for (const item of tempFiles) {
const val = item.tempFilePath const val = item.tempFilePath
// 兼容企微将内容保存至相册
// if (sysInfo.environment) {
// if (fileType == 'video') {
// wx.saveVideoToPhotosAlbum({
// filePath: val
// })
// } else {
// wx.saveImageToPhotosAlbum({
// filePath: val,
// })
// }
// }
const imgType = val.split('.')[1] const imgType = val.split('.')[1]
const uploadType = imgType === 'unknown' ? 'jpg' : imgType const uploadType = imgType === 'unknown' ? 'jpg' : imgType
const _res = await new Promise((resolve, reject) => { const _res = await new Promise((resolve, reject) => {
...@@ -308,21 +410,73 @@ Page({ ...@@ -308,21 +410,73 @@ Page({
wx.hideLoading() wx.hideLoading()
} }
} }
uploadImages(res?.tempFiles) upload(res?.tempFiles)
} }
}) })
}, },
handleImageUpload(e) {
let { field, type } = e.currentTarget.dataset
let _this = this
let count = field.maxCount - field?.uploadImages.length
const index = _this.data[type]?.findIndex(val => val.key == field.key )
let sysInfo = wx.getSystemInfoSync()
if (sysInfo.environment) { // 企微打开
if (field.video) {
const obj = _this.data[type]?.find(val => val.key == field.key)
_this.setData({showUploadType: true, videoFormObj: obj})
} else {
_this.uploadImages({currentTarget: {dataset: {field: field, type: type}}})
}
} else {
_this.uploadMedia(field, count, index, type)
}
},
// 关闭选择上传类型弹窗
closeChangeUploadType() {
this.setData({showUploadType: false})
},
previewMedia(e) { previewMedia(e) {
let { media, index } = e.currentTarget.dataset let { media, index } = e.currentTarget.dataset
media?.forEach(val => { media?.forEach(val => {
val.type = val.isVideo ? 'video': 'image', val.type = val.isVideo ? 'video': 'image',
val.poster = val.isVideo ? val.coverUrl : '' val.poster = val.isVideo ? val.coverUrl : ''
}) })
let sysInfo = wx.getSystemInfoSync()
const hasVideo = media?.some(item => item.isVideo)
if (sysInfo.environment) { // 企微打开
if (hasVideo) {
this.setData({
videoPreviewShow: true,
previewVideoUrl: media[0]?.url,
previewVideoPoster: media[0]?.poster
})
} else {
wx.previewImage({
urls: media?.map(val => { return val.url }),
current: index || 0
})
wx.previewMedia({ wx.previewMedia({
sources: media, sources: media,
current: index || 0 current: index || 0
}) })
}
} else {
wx.previewMedia({
sources: media,
current: index || 0
})
}
},
closeVideoPreview() {
this.setData({
videoPreviewShow: false,
previewVideoUrl: '',
previewVideoPoster: ''
})
}, },
deleteImage(e) { deleteImage(e) {
......
{ {
"usingComponents": { "usingComponents": {
"van-popup": "@vant/weapp/popup/index", "van-popup": "@vant/weapp/popup/index",
"van-datetime-picker": "@vant/weapp/datetime-picker/index" "van-datetime-picker": "@vant/weapp/datetime-picker/index",
"van-overlay": "@vant/weapp/overlay/index",
"van-icon": "@vant/weapp/icon/index"
}, },
"navigationStyle": "custom" "navigationStyle": "custom"
} }
\ No newline at end of file \ No newline at end of file
...@@ -320,3 +320,37 @@ page { ...@@ -320,3 +320,37 @@ page {
} }
} }
} }
.file-type-popup {
.popup-content{
display: flex;
flex-flow: column;
align-items: center;
justify-content: center;
.title{
margin-top: var(--fontSize24);
font-size: var(--fontSize24);
color: #9B9B9E;
}
.popup-item{
font-size: var(--fontSize32);
color: #222222;
font-weight: 500;
width: 100%;
height: var(--fontSize112);
text-align: center;
line-height: var(--fontSize112);
border-bottom: var(--fontSize1) solid #EBEDF0;
}
}
}
.wrapper {
width: 100%;
height: 100%;
position: relative;
.close-box {
position: absolute;
left: 0;
z-index: 1;
padding-left: 20rpx;
}
}
\ No newline at end of file \ No newline at end of file
...@@ -178,3 +178,26 @@ ...@@ -178,3 +178,26 @@
</view> </view>
</view> </view>
</view> </view>
<!-- 选择上传类型 -->
<van-popup
class="file-type-popup"
show="{{showUploadType}}"
position="bottom"
bind:close="closeChangeUploadType"
round
>
<view class="popup-content">
<view class="title">请选择</view>
<view class="popup-item" bindtap="uploadImages" data-field="{{videoFormObj}}" data-type="uploadFieldsWithImages">上传图片</view>
<view class="popup-item" bindtap="uploadVideos" data-field="{{videoFormObj}}" data-type="uploadFieldsWithImages">上传视频</view>
</view>
</van-popup>
<!-- 企微端预览视频 -->
<page-container show="{{videoPreviewShow}}" bind:afterleave="closeVideoPreview">
<van-overlay show="{{ videoPreviewShow }}" bind:click="onClickHide" z-index="99999">
<view class="wrapper" wx:if="{{videoPreviewShow}}">
<view class="close-box" catch:tap="closeVideoPreview" style="top: calc({{navBarHeight}}px - 60rpx);"><van-icon name="arrow-left" color="#FFFFFF" size="24"></van-icon></view>
<video style="width: 100%;height: 100%;" autoplay src="{{previewVideoUrl}}" poster="{{previewVideoPoster}}" />
</view>
</van-overlay>
</page-container>
\ No newline at end of file \ No newline at end of file
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
<view class="search-box"> <view class="search-box">
<view class="search-input" style="width:{{ staffUuid?'100%':'' }}"> <view class="search-input" style="width:{{ staffUuid?'100%':'' }}">
<image src="/images/search.png" class="search-icon" /> <image src="/images/search.png" class="search-icon" />
<input type="text" placeholder="客户姓名/车牌号/订单编号/手机号" class="input" confirm-type="search" value="{{ keyWord }}" placeholder-class="input-placeholder" bindinput="searchInput" bindconfirm="searchConfirm" /> <input type="text" placeholder="客户姓名/车牌号/工单编号/手机号" class="input" confirm-type="search" value="{{ keyWord }}" placeholder-class="input-placeholder" bindinput="searchInput" bindconfirm="searchConfirm" />
<block wx:if="{{ keyWord }}"> <block wx:if="{{ keyWord }}">
<view bindtap="handleReset" class="clearBtn"> <view bindtap="handleReset" class="clearBtn">
<image src="/images/clear.png" class="search-clear" /> <image src="/images/clear.png" class="search-clear" />
......
...@@ -122,17 +122,17 @@ Page({ ...@@ -122,17 +122,17 @@ Page({
payerIdCardFrontUrl: '', payerIdCardFrontUrl: '',
payerIdCardBackUrl: '', payerIdCardBackUrl: '',
payerBankCardUrl: '', payerBankCardUrl: '',
motorBook: '1', motorBook: '0',
motorRegistrationCertificate: '1', motorRegistrationCertificate: '0',
idCarFrontBack: '', idCarFrontBack: '',
purchaseReceipt: '0', purchaseReceipt: '0',
purchaseInvoice: '0', purchaseInvoice: '0',
trafficScreenshot: '1', trafficScreenshot: '0',
carKey: '1', carKey: '0',
carKeyCount: '', carKeyCount: '',
trafficInsurance: '1', trafficInsurance: '0',
insuranceCard: '0', insuranceCard: '0',
transferPhoto: '1', transferPhoto: '0',
other: '0', other: '0',
otherText: '', otherText: '',
handoverTime: '', handoverTime: '',
...@@ -229,7 +229,8 @@ Page({ ...@@ -229,7 +229,8 @@ Page({
], ],
query: null, query: null,
show: false, show: false,
value1: dayjs().format('YYYY-MM-DD HH:mm:ss') value1: dayjs().format('YYYY-MM-DD HH:mm:ss'),
sysInfo: {}
}, },
/** /**
...@@ -240,7 +241,8 @@ Page({ ...@@ -240,7 +241,8 @@ Page({
query: options, query: options,
'formData.evalPrice': options.evalPrice, 'formData.evalPrice': options.evalPrice,
'formData.handoverTime': dayjs().format('YYYY-MM-DD HH:mm:00'), 'formData.handoverTime': dayjs().format('YYYY-MM-DD HH:mm:00'),
currentDate: new Date().getTime() currentDate: new Date().getTime(),
sysInfo: wx.getSystemInfoSync()
}, () => { }, () => {
this.getEvalOrderSimpleDetail() this.getEvalOrderSimpleDetail()
}) })
...@@ -626,12 +628,119 @@ Page({ ...@@ -626,12 +628,119 @@ Page({
wx.showToast({ title: "定位失败,请检查权限", icon: "none" }) wx.showToast({ title: "定位失败,请检查权限", icon: "none" })
} }
}, },
// 兼容企微端仅上传图片
// 上传图片 uploadImages(e) {
handleImageUpload(e) {
let _this = this
let { field } = e.currentTarget.dataset let { field } = e.currentTarget.dataset
// let sysInfo = wx.getSystemInfoSync() let _this = this
_this.closeChangeUploadType()
wx.chooseImage({
count: 1,
success(res) {
for (const file of res.tempFiles) {
if (file.size > 10 * 1024 * 1024) {
return wx.showToast({
title: '图片上传最大10MB',
icon: 'none'
})
}
}
const upload = async (tempFiles) => {
wx.showLoading({
title: '上传中',
mask: true
})
try {
for (const item of tempFiles) {
const val = item.path
const imgType = val.split('.')[1]
const type = imgType === 'unknown' ? 'jpg' : imgType
const _res = await new Promise((resolve, reject) => {
wx.getFileSystemManager().readFile({
filePath: val, // 选择图片返回的相对路径
encoding: 'base64', // 编码格式
success: resolve,
fail: reject
})
})
const img = await api.uploadImg({
file: `${type}@${_res.data}`
})
const { code, data, message } = img
if (code == 0) {
_this.setData({
[`formData.${field}`]: data
})
} else {
wx.$util.showToast(message)
}
}
} catch (error) {
wx.$util.showToast("上传失败,请重试")
} finally {
wx.hideLoading()
}
}
upload(res?.tempFiles)
}
})
},
// 兼容企微上传视频
uploadVideos() {
let _this = this
_this.closeChangeUploadType()
wx.chooseVideo({
maxDuration: 60,
success(res) {
if (res.size > 100 * 1024 * 1024) {
return wx.showToast({
title: '视频上传最大100MB',
icon: 'none'
})
}
const upload = async (tempFiles) => {
wx.showLoading({
title: '上传中',
mask: true
})
try {
for (const item of tempFiles) {
const val = item.tempFilePath
const imgType = val.split('.')[1]
const type = imgType === 'unknown' ? 'mp4' : imgType
const _res = await new Promise((resolve, reject) => {
wx.getFileSystemManager().readFile({
filePath: val, // 选择图片返回的相对路径
encoding: 'base64', // 编码格式
success: resolve,
fail: reject
})
})
const img = await api.uploadFileWithCover({
file: `${type}@${_res.data}`
})
const { code, data, message } = img
if (code == 0) {
_this.setData({
'formData.thirdPartyTransactionVoucher': data.videoUrl,
thirdPartyTransactionType: 'video',
thirdPartyTransactionCoverUrl: data?.coverUrl
})
} else {
wx.$util.showToast(message)
}
}
} catch (error) {
wx.$util.showToast("上传失败,请重试")
} finally {
wx.hideLoading()
}
}
upload([res])
}
})
},
uploadMedia(field) {
let _this = this
wx.chooseMedia({ wx.chooseMedia({
count: 1, count: 1,
mediaType: field == 'thirdPartyTransactionVoucher' ? ['image', 'video'] : ['image'], mediaType: field == 'thirdPartyTransactionVoucher' ? ['image', 'video'] : ['image'],
...@@ -659,7 +768,7 @@ Page({ ...@@ -659,7 +768,7 @@ Page({
} }
} }
} }
const uploadImages = async (tempFiles) => { const upload = async (tempFiles) => {
wx.showLoading({ wx.showLoading({
title: '上传中', title: '上传中',
mask: true mask: true
...@@ -667,18 +776,6 @@ Page({ ...@@ -667,18 +776,6 @@ Page({
try { try {
for (const item of tempFiles) { for (const item of tempFiles) {
const val = item.tempFilePath const val = item.tempFilePath
// 兼容企微将内容保存至相册
// if (sysInfo.environment) {
// if (fileType == 'video') {
// wx.saveVideoToPhotosAlbum({
// filePath: val
// })
// } else {
// wx.saveImageToPhotosAlbum({
// filePath: val,
// })
// }
// }
const imgType = val.split('.')[1] const imgType = val.split('.')[1]
const type = imgType === 'unknown' ? 'jpg' : imgType const type = imgType === 'unknown' ? 'jpg' : imgType
const _res = await new Promise((resolve, reject) => { const _res = await new Promise((resolve, reject) => {
...@@ -718,10 +815,32 @@ Page({ ...@@ -718,10 +815,32 @@ Page({
wx.hideLoading() wx.hideLoading()
} }
} }
uploadImages(res?.tempFiles) upload(res?.tempFiles)
} }
}) })
}, },
// 关闭选择上传类型弹窗
closeChangeUploadType() {
this.setData({showUploadType: false})
},
// 上传图片
handleImageUpload(e) {
let _this = this
let { field } = e.currentTarget.dataset
let { sysInfo } = _this.data
if (sysInfo.environment) { // 企微打开
if (field == 'thirdPartyTransactionVoucher') { // 选择图片或视频
_this.setData({
showUploadType: true
})
} else {
_this.uploadImages({currentTarget: {dataset: {field: field}}})
}
} else {
_this.uploadMedia(field)
}
},
// 删除图片 // 删除图片
removeMedia(e) { removeMedia(e) {
let { field } = e.currentTarget.dataset let { field } = e.currentTarget.dataset
...@@ -752,15 +871,28 @@ Page({ ...@@ -752,15 +871,28 @@ Page({
// 预览三方/委托交易凭证视频 // 预览三方/委托交易凭证视频
previewMedia(e) { previewMedia(e) {
let { media, coverurl } = e.currentTarget.dataset let { media, coverurl } = e.currentTarget.dataset
let { sysInfo } = this.data
let obj = { let obj = {
url: media, url: media,
type: 'video', type: 'video',
poster: coverurl poster: coverurl
} }
if (sysInfo.environment) { // 企微预览视频
this.setData({
videoPreviewShow: true,
previewVideoUrl: media,
previewVideoPoster: coverurl
})
} else {
wx.previewMedia({ wx.previewMedia({
sources: [obj], sources: [obj],
current: 0 current: 0
}) })
}
},
closeVideoPreview() {
this.setData({videoPreviewShow: false})
}, },
checkChange(e) { checkChange(e) {
...@@ -774,6 +906,9 @@ Page({ ...@@ -774,6 +906,9 @@ Page({
checkboxList?.forEach(val => { checkboxList?.forEach(val => {
if (val.key == target.key && !val.disabled) { if (val.key == target.key && !val.disabled) {
val.checked = !target.checked val.checked = !target.checked
this.setData({
[`formData.${target.key}`]: val.checked ? '1' : '0'
})
} }
}) })
this.setData({ this.setData({
......
{ {
"usingComponents": { "usingComponents": {
"van-popup": "@vant/weapp/popup/index", "van-popup": "@vant/weapp/popup/index",
"van-datetime-picker": "@vant/weapp/datetime-picker/index" "van-datetime-picker": "@vant/weapp/datetime-picker/index",
"van-overlay": "@vant/weapp/overlay/index",
"van-icon": "@vant/weapp/icon/index"
}, },
"navigationStyle": "custom" "navigationStyle": "custom"
} }
\ No newline at end of file \ No newline at end of file
...@@ -317,6 +317,7 @@ page { ...@@ -317,6 +317,7 @@ page {
} }
} }
.confirm-box { .confirm-box {
margin: 0 -20rpx;
height: 100%; height: 100%;
overflow: auto; overflow: auto;
scrollbar-width: none; scrollbar-width: none;
...@@ -327,11 +328,11 @@ page { ...@@ -327,11 +328,11 @@ page {
height: 0 !important; height: 0 !important;
} }
.tips { .tips {
margin: 0 -20rpx;
background: #fef5ea; background: #fef5ea;
color: #FF9D0A; color: #FF9D0A;
font-size: 28rpx; font-size: 28rpx;
padding: 16rpx 32rpx; padding: 16rpx 32rpx;
box-sizing: border-box;
.tips-icon { .tips-icon {
width: 32rpx; width: 32rpx;
height: 32rpx; height: 32rpx;
...@@ -340,6 +341,7 @@ page { ...@@ -340,6 +341,7 @@ page {
} }
} }
.box-class1 { .box-class1 {
margin: 0 20rpx;
background: #ffffff; background: #ffffff;
border-radius: 16rpx; border-radius: 16rpx;
margin-top: 20rpx; margin-top: 20rpx;
...@@ -455,3 +457,37 @@ page { ...@@ -455,3 +457,37 @@ page {
.justify-between { .justify-between {
justify-content: space-between; justify-content: space-between;
} }
.file-type-popup {
.popup-content{
display: flex;
flex-flow: column;
align-items: center;
justify-content: center;
.title{
margin-top: var(--fontSize24);
font-size: var(--fontSize24);
color: #9B9B9E;
}
.popup-item{
font-size: var(--fontSize32);
color: #222222;
font-weight: 500;
width: 100%;
height: var(--fontSize112);
text-align: center;
line-height: var(--fontSize112);
border-bottom: var(--fontSize1) solid #EBEDF0;
}
}
}
.wrapper {
width: 100%;
height: 100%;
position: relative;
.close-box {
position: absolute;
left: 0;
z-index: 1;
padding-left: 20rpx;
}
}
\ No newline at end of file \ No newline at end of file
...@@ -467,4 +467,27 @@ ...@@ -467,4 +467,27 @@
bind:confirm="bindDateChange" bind:confirm="bindDateChange"
/> />
</van-popup> </van-popup>
<!-- 选择上传类型 -->
<van-popup
class="file-type-popup"
show="{{showUploadType}}"
position="bottom"
bind:close="closeChangeUploadType"
round
>
<view class="popup-content">
<view class="title">请选择</view>
<view class="popup-item" bindtap="uploadImages" data-field="thirdPartyTransactionVoucher">上传图片</view>
<view class="popup-item" bindtap="uploadVideos">上传视频</view>
</view>
</van-popup>
</view> </view>
<!-- 企微端预览视频 -->
<page-container show="{{videoPreviewShow}}" bind:afterleave="closeVideoPreview">
<van-overlay show="{{ videoPreviewShow }}" bind:click="onClickHide" z-index="99999">
<view class="wrapper" wx:if="{{videoPreviewShow}}">
<view class="close-box" catch:tap="closeVideoPreview" style="top: calc({{navBarHeight}}px - 60rpx);"><van-icon name="arrow-left" color="#FFFFFF" size="24"></van-icon></view>
<video style="width: 100%;height: 100%;" autoplay src="{{previewVideoUrl}}" poster="{{previewVideoPoster}}" />
</view>
</van-overlay>
</page-container>
...@@ -79,8 +79,8 @@ Page({ ...@@ -79,8 +79,8 @@ Page({
}, },
back() { back() {
let { reportObj, isDateWithin7Days } = this.data let { reportObj, isDateWithin7Days, isFilled } = this.data
if (!reportObj?.id && isDateWithin7Days) { if (!isFilled && isDateWithin7Days) {
wx.showModal({ wx.showModal({
title: '重要提示', title: '重要提示',
content: '内容尚未提交,是否退出编辑', content: '内容尚未提交,是否退出编辑',
...@@ -260,8 +260,8 @@ Page({ ...@@ -260,8 +260,8 @@ Page({
* 点击了上一周,选择周数字减一,然后直接调用工具类中一个方法获取到数据 * 点击了上一周,选择周数字减一,然后直接调用工具类中一个方法获取到数据
*/ */
lastWeek: function (e) { lastWeek: function (e) {
let { reportObj, isDateWithin7Days } = this.data let { isDateWithin7Days, isFilled } = this.data
if (!reportObj?.id && isDateWithin7Days) { if (!isFilled && isDateWithin7Days) {
wx.showModal({ wx.showModal({
title: '重要提示', title: '重要提示',
content: '内容尚未提交,是否退出编辑', content: '内容尚未提交,是否退出编辑',
...@@ -298,8 +298,8 @@ Page({ ...@@ -298,8 +298,8 @@ Page({
* 点击了下一周,选择周数字加一,然后直接调用工具类中一个方法获取到数据 * 点击了下一周,选择周数字加一,然后直接调用工具类中一个方法获取到数据
*/ */
nextWeek: function (e) { nextWeek: function (e) {
let { reportObj, isDateWithin7Days } = this.data let { reportObj, isDateWithin7Days, isFilled } = this.data
if (!reportObj?.id && isDateWithin7Days) { if (!isFilled && isDateWithin7Days) {
wx.showModal({ wx.showModal({
title: '重要提示', title: '重要提示',
content: '内容尚未提交,是否退出编辑', content: '内容尚未提交,是否退出编辑',
...@@ -338,8 +338,8 @@ Page({ ...@@ -338,8 +338,8 @@ Page({
* 选中了某一日,改变selectDay为选中日 * 选中了某一日,改变selectDay为选中日
*/ */
dayClick(e) { dayClick(e) {
let { timeBean, reportObj, isDateWithin7Days } = this.data let { timeBean, reportObj, isDateWithin7Days, isFilled } = this.data
if (!reportObj?.id && isDateWithin7Days) { if (!isFilled && isDateWithin7Days) {
wx.showModal({ wx.showModal({
title: '重要提示', title: '重要提示',
content: '内容尚未提交,是否退出编辑', content: '内容尚未提交,是否退出编辑',
......
...@@ -59,6 +59,7 @@ class Request { ...@@ -59,6 +59,7 @@ class Request {
header, header,
dataType: 'json', dataType: 'json',
responseType: 'text', responseType: 'text',
timeout: noSignAttr?.includes('file') ? 120 * 1000 : 60 * 1000,
success(response) { success(response) {
/**业务代码 */ /**业务代码 */
let { let {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!