配送端支持上传完成图片,其他上传图片组建优化

master
gongfuxiang 2023-10-15 00:21:51 +08:00
parent 428f08c4db
commit f2ae1310a9
9 changed files with 237 additions and 91 deletions

View File

@ -67,11 +67,11 @@
// tabbar
tabbar_pages: ['/pages/index/index', '/pages/goods-category/goods-category', '/pages/cart/cart', '/pages/user/user'],
//
request_url: 'https://new.shopxo.vip/',
// request_url: 'http://shopxo.com/',
// request_url: 'https://new.shopxo.vip/',
request_url: 'http://shopxo.com/',
// publicpublichttps://d1.shopxo.vip/public/
static_url: 'https://new.shopxo.vip/',
// static_url: 'http://shopxo.com/',
// static_url: 'https://new.shopxo.vip/',
static_url: 'http://shopxo.com/',
// default
system_type: 'default',
//

View File

@ -48,7 +48,7 @@
}
.panel-item .panel-content .item .content {
width: calc(75% - 44rpx);
width: calc(75% - 52rpx);
min-height: 46rpx;
word-wrap: break-word;
word-break: normal;

View File

@ -646,10 +646,7 @@ button:before {
color: #333 !important;
}
.cr-grey {
color: #666 !important;
}
.cr-grey,
.cr-grey-9 {
color: #999 !important;
}
@ -862,23 +859,14 @@ button[disabled].bg-grey {
}
.form-container-upload .form-upload-data image {
width: 150rpx;
height: 150rpx;
width: 140rpx;
height: 140rpx;
padding: 5rpx;
border: 1px solid #eee;
display: block;
border-radius: 10rpx;
}
.form-container-upload .upload-icon {
margin-top: 10rpx;
width: 160rpx;
height: 160rpx;
border: 1px dashed #e9e9e9;
display: block;
border-radius: 10rpx;
}
/**
*
*/

View File

@ -75,7 +75,7 @@
<button v-if="item.status == 1" class="round bg-white br-blue cr-blue" type="default" size="mini" hover-class="none" :data-index="index" @tap="start_delivery_event"></button>
<button v-if="item.status == 4" class="round bg-white br-main cr-main" type="default" size="mini" hover-class="none" :data-index="index" @tap="start_delivery_event"></button>
<block v-if="item.status == 2">
<button class="round bg-white br-green cr-green" type="default" size="mini" hover-class="none" :data-index="index" @tap="success_delivery_event"></button>
<button class="round bg-white br-green cr-green" type="default" size="mini" hover-class="none" :data-index="index" @tap="popup_success_content_event"></button>
<button class="round bg-white br-red cr-red" type="default" size="mini" hover-class="none" :data-index="index" @tap="popup_abnormal_content_event"></button>
</block>
</view>
@ -132,7 +132,43 @@
</block>
</view>
<!-- 异常订单原因填写 -->
<!-- 订单完成弹窗 -->
<component-popup :propShow="popup_success_content_status" propPosition="bottom" @onclose="popup_success_content_close_event">
<view class="padding-horizontal-main padding-top-main bg-white">
<view class="close oh">
<view class="fr" @tap.stop="popup_success_content_close_event">
<uni-icons type="clear" size="46rpx" color="#999"></uni-icons>
</view>
</view>
<form @submit="form_delivery_success_submit_event" class="form-container">
<view class="form-container">
<view class="form-gorup">
<view class="form-gorup-title">描述</view>
<view class="br padding-main radius margin-top">
<textarea placeholder-class="cr-grey" class="cr-base margin-0" placeholder="描述最多200个字符" maxlength="200" :auto-height="true" :value="form_delivery_success_msg_value" @input="form_delivery_success_msg_event"></textarea>
</view>
</view>
<view class="form-gorup form-container-upload oh">
<view class="form-gorup-title">上传照片<text class="form-group-tips-must">*</text><text class="form-group-tips">最多上传{{form_delivery_success_images_max_count}}</text></view>
<view class="form-upload-data oh">
<block v-if="form_delivery_success_images_list.length > 0">
<view v-for="(item, index) in form_delivery_success_images_list" :key="index" class="item fl">
<text class="delete-icon" @tap="upload_delete_event" :data-index="index">x</text>
<image :src="item" @tap="upload_show_event" :data-index="index" mode="aspectFill"></image>
</view>
</block>
<image v-if="(form_delivery_success_images_list || null) == null || form_delivery_success_images_list.length < form_delivery_success_images_max_count" class="item fl upload-icon" :src="common_static_url + 'upload-icon.png'" mode="aspectFill" @tap="file_upload_event"></image>
</view>
</view>
<view class="form-gorup form-gorup-submit bottom-line-exclude">
<button class="bg-main br-main cr-white round text-size" type="default" form-type="submit" hover-class="none">提交完成</button>
</view>
</view>
</form>
</view>
</component-popup>
<!-- 订单异常弹窗 -->
<component-popup :propShow="popup_abnormal_content_status" propPosition="bottom" @onclose="popup_abnormal_content_close_event">
<view class="padding-horizontal-main padding-top-main bg-white">
<view class="close oh">
@ -140,16 +176,16 @@
<uni-icons type="clear" size="46rpx" color="#999"></uni-icons>
</view>
</view>
<form @submit="form_delivery_submit_event" class="form-container">
<form @submit="form_delivery_abnormal_submit_event" class="form-container">
<view class="form-container">
<view class="form-gorup">
<view class="form-gorup-title">异常原因</view>
<view class="form-gorup-title">异常原因<text class="form-group-tips-must">*</text></view>
<view class="br padding-main radius margin-top">
<textarea name="msg" placeholder-class="cr-grey" class="cr-base margin-0" placeholder="异常原因最多200个字符" maxlength="200" :auto-height="true"></textarea>
<textarea placeholder-class="cr-grey" class="cr-base margin-0" placeholder="异常原因最多200个字符" maxlength="200" :auto-height="true" :value="form_delivery_abnormal_msg_value" @input="form_delivery_abnormal_msg_event"></textarea>
</view>
</view>
<view class="form-gorup form-gorup-submit">
<button class="bg-main br-main cr-white round text-size" type="default" form-type="submit" hover-class="none">提交</button>
<view class="form-gorup form-gorup-submit bottom-line-exclude">
<button class="bg-red br-red cr-white round text-size" type="default" form-type="submit" hover-class="none">提交异常</button>
</view>
</view>
</form>
@ -164,10 +200,13 @@
import componentBadge from "../../../../components/badge/badge";
import componentPopup from "../../../../components/popup/popup";
var common_static_url = app.globalData.get_static_url("common");
var plugins_static_url = app.globalData.get_static_url('delivery', true);
export default {
data() {
return {
common_static_url: common_static_url,
plugins_static_url: plugins_static_url,
data_list: [],
data_total: 0,
data_page_total: 0,
@ -183,6 +222,13 @@
search_input_keywords_value: "",
popup_abnormal_content_status: false,
popup_abnormal_data_index: null,
form_delivery_abnormal_msg_value: "",
popup_success_content_status: false,
popup_success_data_index: null,
form_delivery_success_msg_value: "",
form_delivery_success_images_list: [],
form_delivery_success_images_max_count: 30,
editor_path_type: "",
show_type: 0,
scale: 10,
markers: [],
@ -353,12 +399,13 @@
height: 30,
latitude: item.address_data.lat,
longitude: item.address_data.lng,
iconPath: plugins_static_url+'order.png'
iconPath: this.plugins_static_url+'order.png'
});
}
});
}
this.setData({
editor_path_type: data.editor_path_type || "",
nav_type_list: data.nav_type_list || [],
markers: temp_markers,
data_list: temp_data_list,
@ -455,21 +502,140 @@
app.globalData.open_location(ads.lng, ads.lat, name, ads.address_info);
},
//
//
popup_success_content_event(e) {
this.setData({
popup_success_content_status: true,
popup_success_data_index: e.currentTarget.dataset.index,
form_delivery_success_msg_value: "",
form_delivery_success_images_list: []
});
},
//
popup_success_content_close_event(e) {
this.setData({
popup_success_content_status: false,
});
},
//
form_delivery_success_msg_event(e) {
this.setData({
form_delivery_success_msg_value: e.detail.value
});
},
//
upload_show_event(e) {
uni.previewImage({
current: this.form_delivery_success_images_list[e.currentTarget.dataset.index],
urls: this.form_delivery_success_images_list,
});
},
//
upload_delete_event(e) {
var self = this;
uni.showModal({
title: "温馨提示",
content: "删除后不可恢复、继续吗?",
success(res) {
if (res.confirm) {
var list = self.form_delivery_success_images_list;
list.splice(e.currentTarget.dataset.index, 1);
self.setData({
form_delivery_success_images_list: list,
});
}
},
});
},
//
file_upload_event(e) {
var self = this;
uni.chooseImage({
count: this.form_delivery_success_images_max_count,
success(res) {
var success = 0;
var fail = 0;
var length = res.tempFilePaths.length;
var count = 0;
self.upload_one_by_one(res.tempFilePaths, success, fail, count, length);
},
});
},
//
upload_one_by_one(img_paths, success, fail, count, length) {
var self = this;
if (self.form_delivery_success_images_list.length < this.form_delivery_success_images_max_count) {
uni.uploadFile({
url: app.globalData.get_request_url("index", "ueditor"),
filePath: img_paths[count],
name: "upfile",
formData: {
action: "uploadimage",
path_type: self.editor_path_type,
},
success: function (res) {
success++;
if (res.statusCode == 200) {
var data = typeof res.data == "object" ? res.data : JSON.parse(res.data);
if (data.code == 0 && (data.data.url || null) != null) {
var list = self.form_delivery_success_images_list;
list.push(data.data.url);
self.setData({
form_delivery_success_images_list: list,
});
} else {
app.globalData.showToast(data.msg);
}
}
},
fail: function (e) {
fail++;
},
complete: function (e) {
count++;
//
if (count >= length) {
//
//app.showToast('' + success +'', 'success');
} else {
//
self.upload_one_by_one(img_paths, success, fail, count, length);
}
},
});
}
},
//
popup_abnormal_content_event(e) {
this.setData({
popup_abnormal_content_status: true,
popup_abnormal_data_index: e.currentTarget.dataset.index,
form_delivery_abnormal_msg_value: ""
});
},
//
//
popup_abnormal_content_close_event(e) {
this.setData({
popup_abnormal_content_status: false,
});
},
//
form_delivery_abnormal_msg_event(e) {
this.setData({
form_delivery_abnormal_msg_value: e.detail.value
});
},
//
start_delivery_event(e) {
uni.showModal({
@ -490,29 +656,25 @@
});
},
//
success_delivery_event(e) {
uni.showModal({
title: "温馨提示",
content: "确定订单已配送到客户地址?",
confirmText: "确认",
cancelText: "没有",
success: (result) => {
if (result.confirm) {
this.order_status_handle({
index: e.currentTarget.dataset.index,
new_status: 3,
status_name: "已配送",
action: "successdelivery",
});
}
},
//
form_delivery_success_submit_event(e) {
if(this.form_delivery_success_images_list.length == 0) {
app.globalData.showToast('请上传照片');
return false;
}
this.order_status_handle({
index: this.popup_success_data_index,
new_status: 3,
status_name: "已配送",
action: "successdelivery",
msg: this.form_delivery_success_msg_value || '',
images: this.form_delivery_success_images_list
});
},
//
form_delivery_submit_event(e) {
var msg = e.detail.value.msg || null;
//
form_delivery_abnormal_submit_event(e) {
var msg = this.form_delivery_abnormal_msg_value || null;
if (msg == null) {
app.globalData.showToast("请填写原因");
} else {
@ -538,6 +700,7 @@
data: {
id: temp_data[params.index]["id"],
msg: params.msg || "",
images: params.images || ""
},
dataType: "json",
success: (res) => {
@ -557,7 +720,8 @@
this.setData({
data_list: temp_data,
nav_type_list: temp_nav,
popup_abnormal_content_status: false,
popup_success_content_status: false,
popup_abnormal_content_status: false
});
app.globalData.showToast(res.data.msg, "success");
} else {
@ -588,9 +752,9 @@
var temp_markers = this.markers;
for(var i in temp_markers) {
if(temp_markers[i]['id'] == index) {
temp_markers[i]['iconPath'] = plugins_static_url+'order-active.png';
temp_markers[i]['iconPath'] = this.plugins_static_url+'order-active.png';
} else {
temp_markers[i]['iconPath'] = plugins_static_url+'order.png';
temp_markers[i]['iconPath'] = this.plugins_static_url+'order.png';
}
}
//

View File

@ -4,16 +4,14 @@
<view class="padding-main oh">
<view class="form-gorup bg-white form-container-upload oh">
<view class="form-gorup-title">logo图片<text class="form-group-tips">选传建议300x300px</text></view>
<view class="oh">
<view class="form-upload-data fl">
<block v-if="(extraction_data.logo || null) != null">
<view class="item fl">
<text class="delete-icon" @tap="upload_delete_event">x</text>
<image :src="extraction_data.logo" @tap="upload_show_event" mode="aspectFill"></image>
</view>
</block>
</view>
<image class="upload-icon" :src="common_static_url + 'upload-icon.png'" mode="aspectFill" @tap="file_upload_event"></image>
<view class="form-upload-data oh">
<block v-if="(extraction_data.logo || null) != null">
<view class="item fl">
<text class="delete-icon" @tap="upload_delete_event">x</text>
<image :src="extraction_data.logo" @tap="upload_show_event" mode="aspectFill"></image>
</view>
</block>
<image class="item fl upload-icon" :src="common_static_url + 'upload-icon.png'" mode="aspectFill" @tap="file_upload_event"></image>
</view>
</view>

View File

@ -5,16 +5,14 @@
<view class="padding-main oh">
<view class="form-gorup bg-white form-container-upload oh">
<view class="form-gorup-title">图标<text class="form-group-tips">建议100*100px</text></view>
<view class="oh">
<view class="form-upload-data fl">
<block v-if="(recommend_data.icon || null) != null">
<view class="item fl">
<text class="delete-icon" @tap="upload_delete_event">x</text>
<image :src="recommend_data.icon" @tap="upload_show_event" mode="aspectFill"></image>
</view>
</block>
</view>
<image class="upload-icon" :src="common_static_url + 'upload-icon.png'" mode="aspectFill" @tap="file_upload_event"></image>
<view class="form-upload-data oh">
<block v-if="(recommend_data.icon || null) != null">
<view class="item fl">
<text class="delete-icon" @tap="upload_delete_event">x</text>
<image :src="recommend_data.icon" @tap="upload_show_event" mode="aspectFill"></image>
</view>
</block>
<image class="item fl upload-icon" :src="common_static_url + 'upload-icon.png'" mode="aspectFill" @tap="file_upload_event"></image>
</view>
</view>
@ -210,7 +208,7 @@
uni.stopPullDownRefresh();
if (res.data.code == 0) {
var data = res.data.data;
//
//
var goods_category_list = data.goods_category_list || [];
if (goods_category_list.length > 0) {
goods_category_list.unshift({ id: null, name: '全部分类' });

View File

@ -17,16 +17,16 @@
</view>
<view class="margin-top-main br-t">
<textarea @input="form_content_event" :data-index="index" placeholder-class="cr-grey" class="cr-base" placeholder="宝贝满足你的期待吗?说说它的优点和美中不足的地方吧" maxlength="230"></textarea>
<view class="form-container-upload oh">
<view class="form-upload-data fl">
<view class="form-container-upload">
<view class="form-upload-data oh">
<block v-if="(form_images_list[index] || null) != null && form_images_list[index].length > 0">
<view v-for="(iv, ix) in form_images_list[index]" :key="ix" class="item fl">
<text class="delete-icon" @tap="upload_delete_event" :data-index="index" :data-ix="ix">x</text>
<image :src="iv" @tap="upload_show_event" :data-index="index" :data-ix="ix" mode="aspectFill" class="padding-xs dis-block"></image>
</view>
</block>
<image v-if="(form_images_list[index] || null) == null || form_images_list[index].length < 3" class="item fl upload-icon" :src="common_static_url + 'upload-icon.png'" mode="aspectFill" @tap="file_upload_event" :data-index="index"></image>
</view>
<image v-if="(form_images_list[index] || null) == null || form_images_list[index].length < 3" class="upload-icon" :src="common_static_url + 'upload-icon.png'" mode="aspectFill" @tap="file_upload_event" :data-index="index"></image>
</view>
</view>
</view>

View File

@ -83,9 +83,9 @@
<view v-if="detail_list.length > 0" class="panel-item padding-main border-radius-main bg-white spacing-mb">
<view class="br-b padding-bottom-main fw-b text-size">订单信息</view>
<view class="panel-content oh">
<view v-for="(item, index) in detail_list" :key="index" class="item br-b-dashed oh padding-vertical-main flex-row jc-sb align-c">
<view class="title padding-right-main cr-grey">{{ item.name }}</view>
<view class="content br-l padding-left-main flex-1 flex-width">{{ item.value }}</view>
<view v-for="(item, index) in detail_list" :key="index" class="item br-b-dashed oh padding-vertical-main">
<view class="title fl padding-right-main cr-grey">{{ item.name }}</view>
<view class="content fl br-l padding-left-main">{{ item.value }}</view>
</view>
</view>
</view>
@ -94,7 +94,7 @@
<view v-if="extension_data.length > 0" class="panel-item padding-main border-radius-main bg-white spacing-mb">
<view class="br-b padding-bottom-main fw-b text-size">扩展数据</view>
<view class="panel-content oh">
<view v-for="(item, index) in extension_data" :key="index" class="item br-b oh padding-vertical-main">
<view v-for="(item, index) in extension_data" :key="index" class="item br-b-dashed oh padding-vertical-main">
<view class="title fl padding-right-main cr-grey">{{ item.name }}</view>
<view class="content fl br-l padding-left-main">{{ item.tips }}</view>
</view>

View File

@ -170,16 +170,14 @@
<view class="form-gorup form-container-upload oh">
<view class="form-gorup-title">上传凭证<text class="form-group-tips">最多上传3张图片</text></view>
<view class="oh">
<view class="form-upload-data fl">
<block v-if="form_images_list.length > 0">
<view v-for="(item, index) in form_images_list" :key="index" class="item fl">
<text class="delete-icon" @tap="upload_delete_event" :data-index="index">x</text>
<image :src="item" @tap="upload_show_event" :data-index="index" mode="aspectFill"></image>
</view>
</block>
</view>
<image v-if="(form_images_list[index] || null) == null || form_images_list.length < 3" class="upload-icon" :src="common_static_url + 'upload-icon.png'" mode="aspectFill" @tap="file_upload_event"></image>
<view class="form-upload-data oh">
<block v-if="form_images_list.length > 0">
<view v-for="(item, index) in form_images_list" :key="index" class="item fl">
<text class="delete-icon" @tap="upload_delete_event" :data-index="index">x</text>
<image :src="item" @tap="upload_show_event" :data-index="index" mode="aspectFill"></image>
</view>
</block>
<image v-if="(form_images_list || null) == null || form_images_list.length < 3" class="item fl upload-icon" :src="common_static_url + 'upload-icon.png'" mode="aspectFill" @tap="file_upload_event"></image>
</view>
</view>
<view class="form-gorup form-gorup-submit">