发货方式优化及消息功能优化
This commit is contained in:
@@ -8,6 +8,8 @@ Page({
|
||||
data: {
|
||||
demandId: 0,
|
||||
remark: '',
|
||||
// 交付链接(Git仓库/网盘等持久获取方式),选填
|
||||
deliverLinks: '',
|
||||
// 开发完成凭证截图(软件成品展示图等)
|
||||
imageFiles: [],
|
||||
imageMax: 9,
|
||||
@@ -43,6 +45,19 @@ Page({
|
||||
this.setData({ remark: e.detail.value });
|
||||
},
|
||||
|
||||
// 交付链接变更
|
||||
onDeliverLinksChange(e) {
|
||||
this.setData({ deliverLinks: e.detail.value });
|
||||
},
|
||||
|
||||
// 交付链接(单个):只取第一行,避免粘贴时带入多余内容
|
||||
getDeliverLinks() {
|
||||
const link = String(this.data.deliverLinks || '')
|
||||
.split(/[\r\n]+/)[0]
|
||||
.trim();
|
||||
return link ? [link] : [];
|
||||
},
|
||||
|
||||
// 凭证截图选择成功
|
||||
// 注意:t-upload 绑定了 files,success 事件返回的是完整文件列表(含已选的旧文件),
|
||||
// 必须整体覆盖,不能往 imageFiles 里追加,否则已选图片会重复
|
||||
@@ -209,7 +224,7 @@ Page({
|
||||
}
|
||||
},
|
||||
|
||||
// 表单验证
|
||||
// 表单验证:源码一般在沟通群交付,平台仅凭证截图必填,附件与链接选填
|
||||
validateForm() {
|
||||
const { imageFiles, attachFiles } = this.data;
|
||||
if (!imageFiles.length) {
|
||||
@@ -219,9 +234,17 @@ Page({
|
||||
});
|
||||
return false;
|
||||
}
|
||||
if (!attachFiles.length) {
|
||||
const links = this.getDeliverLinks();
|
||||
if (links.length > 1) {
|
||||
wx.showToast({
|
||||
title: '请上传源码或软件附件',
|
||||
title: '只能填写1个交付链接',
|
||||
icon: 'none'
|
||||
});
|
||||
return false;
|
||||
}
|
||||
if (links.some(item => !/^https?:\/\//i.test(item))) {
|
||||
wx.showToast({
|
||||
title: '交付链接需以 http:// 或 https:// 开头',
|
||||
icon: 'none'
|
||||
});
|
||||
return false;
|
||||
@@ -251,6 +274,7 @@ Page({
|
||||
opType: 'deliverGoods',
|
||||
images: imageFiles.map(file => file.fullUrl || file.url),
|
||||
files: attachFiles.map(file => file.fullUrl || file.url),
|
||||
links: this.getDeliverLinks(),
|
||||
remark
|
||||
};
|
||||
demandOperate(params).then(
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
"usingComponents": {
|
||||
"t-upload": "tdesign-miniprogram/upload/upload",
|
||||
"t-tag": "tdesign-miniprogram/tag/tag",
|
||||
"t-textarea": "tdesign-miniprogram/textarea/textarea"
|
||||
"t-textarea": "tdesign-miniprogram/textarea/textarea",
|
||||
"t-input": "tdesign-miniprogram/input/input"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,14 +20,23 @@
|
||||
/>
|
||||
</view>
|
||||
|
||||
<!-- 沟通群交付引导 -->
|
||||
<view class="form-card form-card--tip">
|
||||
<view class="form-card__head">
|
||||
<text class="form-card__title">源码交付方式</text>
|
||||
</view>
|
||||
<view class="form-card__desc">
|
||||
建议在<text class="tip-strong">企业微信沟通群</text>中直接发送源码文件,或使用网盘地址。下方的附件与链接为选填补充。
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 交付附件 -->
|
||||
<view class="form-card">
|
||||
<view class="form-card__head">
|
||||
<text class="form-card__title">交付附件(源码或软件成品)</text>
|
||||
<text class="form-card__require">*</text>
|
||||
<text class="form-card__extra">{{attachFiles.length}}/{{attachMax}}</text>
|
||||
<text class="form-card__extra">选填 {{attachFiles.length}}/{{attachMax}}</text>
|
||||
</view>
|
||||
<view class="form-card__desc">上传源码或软件成品文件,客户确认收货后可下载,从聊天记录选择文件</view>
|
||||
<view class="form-card__desc">小体积源码或软件成品可直接上传,大文件请在沟通群交付;从聊天记录选择文件</view>
|
||||
<view class="attach-list" wx:if="{{attachFiles.length}}">
|
||||
<t-tag
|
||||
wx:for="{{attachFiles}}"
|
||||
@@ -53,6 +62,21 @@
|
||||
/>
|
||||
</view>
|
||||
|
||||
<!-- 交付链接 -->
|
||||
<view class="form-card">
|
||||
<view class="form-card__head">
|
||||
<text class="form-card__title">交付链接</text>
|
||||
<text class="form-card__extra">选填</text>
|
||||
</view>
|
||||
<view class="form-card__desc">填写一个网盘下载地址</view>
|
||||
<t-input
|
||||
placeholder="https://pan.xxx.com/s/xxx"
|
||||
value="{{deliverLinks}}"
|
||||
bindchange="onDeliverLinksChange"
|
||||
maxlength="300"
|
||||
/>
|
||||
</view>
|
||||
|
||||
<!-- 发货备注 -->
|
||||
<view class="form-card">
|
||||
<view class="form-card__head">
|
||||
@@ -74,7 +98,7 @@
|
||||
<!-- 底部提交栏 -->
|
||||
<view class="wx-pay-cover">
|
||||
<view class="wx-pay">
|
||||
<view class="submit-btn {{(imageFiles.length && attachFiles.length) ? '' : 'btn-gray'}}" bindtap="onSubmit">
|
||||
<view class="submit-btn {{imageFiles.length ? '' : 'btn-gray'}}" bindtap="onSubmit">
|
||||
确认发货
|
||||
</view>
|
||||
</view>
|
||||
|
||||
@@ -47,6 +47,20 @@
|
||||
color: var(--text-tertiary);
|
||||
}
|
||||
|
||||
/* 交付方式提示卡片 */
|
||||
.form-card--tip {
|
||||
background: var(--brand-color-light, #fff3e8);
|
||||
}
|
||||
|
||||
.form-card--tip .form-card__desc {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
.tip-strong {
|
||||
color: var(--brand-color, #ff5f15);
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
/* ================= 附件标签 ================= */
|
||||
.attach-list {
|
||||
display: flex;
|
||||
|
||||
Reference in New Issue
Block a user