From f2ae1310a9ab1f79b1297c0618171d0ddba41de4 Mon Sep 17 00:00:00 2001 From: gongfuxiang Date: Sun, 15 Oct 2023 00:21:51 +0800 Subject: [PATCH] =?UTF-8?q?=E9=85=8D=E9=80=81=E7=AB=AF=E6=94=AF=E6=8C=81?= =?UTF-8?q?=E4=B8=8A=E4=BC=A0=E5=AE=8C=E6=88=90=E5=9B=BE=E7=89=87=EF=BC=8C?= =?UTF-8?q?=E5=85=B6=E4=BB=96=E4=B8=8A=E4=BC=A0=E5=9B=BE=E7=89=87=E7=BB=84?= =?UTF-8?q?=E5=BB=BA=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- App.vue | 8 +- common/css/business.css | 2 +- common/css/page.css | 18 +- pages/plugins/delivery/order/order.vue | 230 +++++++++++++++--- .../extraction-apply/extraction-apply.vue | 18 +- .../recommend-form/recommend-form.vue | 20 +- .../user-order-comments.vue | 6 +- pages/user-order-detail/user-order-detail.vue | 8 +- .../user-orderaftersale-detail.vue | 18 +- 9 files changed, 237 insertions(+), 91 deletions(-) diff --git a/App.vue b/App.vue index c682d5f3..da0a5358 100644 --- a/App.vue +++ b/App.vue @@ -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/', // 静态资源地址(如系统根目录不在public目录下面请在静态地址后面加public目录、如:https://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', // 基础信息 diff --git a/common/css/business.css b/common/css/business.css index 30459acf..9563e90e 100644 --- a/common/css/business.css +++ b/common/css/business.css @@ -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; diff --git a/common/css/page.css b/common/css/page.css index c17ca255..3bdd3315 100644 --- a/common/css/page.css +++ b/common/css/page.css @@ -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; -} - /** * 箭头符号 */ diff --git a/pages/plugins/delivery/order/order.vue b/pages/plugins/delivery/order/order.vue index d2b0436f..0de5bb74 100644 --- a/pages/plugins/delivery/order/order.vue +++ b/pages/plugins/delivery/order/order.vue @@ -75,7 +75,7 @@ - + @@ -131,8 +131,44 @@ + + + + + + + + + +
+ + + 描述 + + + + + + 上传照片*最多上传{{form_delivery_success_images_max_count}}张 + + + + x + + + + + + + + + + +
+
+
- + @@ -140,16 +176,16 @@ -
+ - 异常原因 + 异常原因* - + - - + + @@ -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, @@ -454,21 +501,140 @@ var name = ads.alias || ads.name || ""; 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) { @@ -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'; } } // 订单数据、先匹配实际点击的订单 diff --git a/pages/plugins/distribution/extraction-apply/extraction-apply.vue b/pages/plugins/distribution/extraction-apply/extraction-apply.vue index bfac0925..e65fd56c 100644 --- a/pages/plugins/distribution/extraction-apply/extraction-apply.vue +++ b/pages/plugins/distribution/extraction-apply/extraction-apply.vue @@ -4,16 +4,14 @@ logo图片选传,建议300x300px - - - - - x - - - - - + + + + x + + + + diff --git a/pages/plugins/distribution/recommend-form/recommend-form.vue b/pages/plugins/distribution/recommend-form/recommend-form.vue index 6f8157c6..bd4df5c7 100644 --- a/pages/plugins/distribution/recommend-form/recommend-form.vue +++ b/pages/plugins/distribution/recommend-form/recommend-form.vue @@ -5,16 +5,14 @@ 图标建议100*100px - - - - - x - - - - - + + + + x + + + + @@ -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: '全部分类' }); diff --git a/pages/user-order-comments/user-order-comments.vue b/pages/user-order-comments/user-order-comments.vue index 982b86be..70f4a074 100644 --- a/pages/user-order-comments/user-order-comments.vue +++ b/pages/user-order-comments/user-order-comments.vue @@ -17,16 +17,16 @@ - - + + x + - diff --git a/pages/user-order-detail/user-order-detail.vue b/pages/user-order-detail/user-order-detail.vue index 8f2dda29..8db3e058 100644 --- a/pages/user-order-detail/user-order-detail.vue +++ b/pages/user-order-detail/user-order-detail.vue @@ -83,9 +83,9 @@ 订单信息 - - {{ item.name }} - {{ item.value }} + + {{ item.name }} + {{ item.value }} @@ -94,7 +94,7 @@ 扩展数据 - + {{ item.name }} {{ item.tips }} diff --git a/pages/user-orderaftersale-detail/user-orderaftersale-detail.vue b/pages/user-orderaftersale-detail/user-orderaftersale-detail.vue index 3e777394..889ebe7b 100644 --- a/pages/user-orderaftersale-detail/user-orderaftersale-detail.vue +++ b/pages/user-orderaftersale-detail/user-orderaftersale-detail.vue @@ -170,16 +170,14 @@ 上传凭证最多上传3张图片 - - - - - x - - - - - + + + + x + + + +