From 7fa4faa6f8c16e095b8d45bce21c85e19ca6bbd7 Mon Sep 17 00:00:00 2001 From: From-wh Date: Mon, 19 Jun 2023 12:23:35 +0800 Subject: [PATCH 1/3] =?UTF-8?q?feat:=20oss=20=E8=A7=86=E9=A2=91=E4=BA=91?= =?UTF-8?q?=E5=AD=98=E5=82=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- template/admin/src/api/product.js | 7 ++++--- template/admin/src/api/upload.js | 12 +++++++++++ .../src/components/uploadVideo/index.vue | 6 +++++- .../src/components/uploadVideo2/index.vue | 6 +++++- .../src/pages/marketing/recharge/index.vue | 6 +++++- .../src/pages/product/productAdd/index.vue | 13 ++++++++---- .../src/pages/system/group/visualization.vue | 6 +++++- template/admin/src/utils/videoCloud.js | 20 +++++++++++++++++-- 8 files changed, 63 insertions(+), 13 deletions(-) diff --git a/template/admin/src/api/product.js b/template/admin/src/api/product.js index 0da77b490..63a39f839 100644 --- a/template/admin/src/api/product.js +++ b/template/admin/src/api/product.js @@ -344,12 +344,13 @@ export function productGetTemplateApi() { } /** - * @description 商品 -- 获取运费模板 + * @description 获取上传参数 */ -export function productGetTempKeysApi() { +export function productGetTempKeysApi(data) { return request({ url: `product/product/get_temp_keys`, method: 'get', + params: data, }); } @@ -393,7 +394,7 @@ export function productUserLabel() { }); } /** - * @description 商品添加编辑-- 用户标签 + * @description 上传类型 */ export function uploadType() { return request({ diff --git a/template/admin/src/api/upload.js b/template/admin/src/api/upload.js index a2351b18d..0e5a342a2 100644 --- a/template/admin/src/api/upload.js +++ b/template/admin/src/api/upload.js @@ -22,3 +22,15 @@ export function upload(data, config) { data, }); } +/** + * @description 云存储 url 上传 + * @param {Object} param data {Object} 传值参数 + */ +export function ossUpload(url, data) { + return request({ + url, + method: 'post', + file: true, + data, + }); +} diff --git a/template/admin/src/components/uploadVideo/index.vue b/template/admin/src/components/uploadVideo/index.vue index 006edd524..ea632ebde 100644 --- a/template/admin/src/components/uploadVideo/index.vue +++ b/template/admin/src/components/uploadVideo/index.vue @@ -136,7 +136,11 @@ export default { if (evfile.target.files[0].type !== 'video/mp4') { return that.$Message.error('只能上传mp4文件'); } - productGetTempKeysApi().then((res) => { + let types = { + key: evfile.target.files[0].name, + contentType: evfile.target.files[0].type, + }; + productGetTempKeysApi(types).then((res) => { that.$videoCloud .videoUpload({ type: res.data.type, diff --git a/template/admin/src/components/uploadVideo2/index.vue b/template/admin/src/components/uploadVideo2/index.vue index a67c8cff1..513b34219 100644 --- a/template/admin/src/components/uploadVideo2/index.vue +++ b/template/admin/src/components/uploadVideo2/index.vue @@ -135,7 +135,11 @@ export default { if (evfile.target.files[0].type !== 'video/mp4') { return that.$Message.error('只能上传mp4文件'); } - productGetTempKeysApi().then((res) => { + let types = { + key: evfile.target.files[0].name, + contentType: evfile.target.files[0].type, + }; + productGetTempKeysApi(types).then((res) => { that.$videoCloud .videoUpload({ type: res.data.type, diff --git a/template/admin/src/pages/marketing/recharge/index.vue b/template/admin/src/pages/marketing/recharge/index.vue index b6bb198cf..d635487ee 100644 --- a/template/admin/src/pages/marketing/recharge/index.vue +++ b/template/admin/src/pages/marketing/recharge/index.vue @@ -285,7 +285,11 @@ export default { if (suffix.indexOf('.mp4') === -1) { return that.$Message.error('只能上传MP4文件'); } - productGetTempKeysApi() + let types = { + key: evfile.target.files[0].name, + contentType: evfile.target.files[0].type, + }; + productGetTempKeysApi(types) .then((res) => { that.$videoCloud .videoUpload({ diff --git a/template/admin/src/pages/product/productAdd/index.vue b/template/admin/src/pages/product/productAdd/index.vue index 06b2cef9c..ca1a4a881 100644 --- a/template/admin/src/pages/product/productAdd/index.vue +++ b/template/admin/src/pages/product/productAdd/index.vue @@ -824,14 +824,14 @@ placeholder="请输入一级返佣" :min="0" :max="9999999" - class="columnsBox perW30" + class="columnsBox perW20" v-model="manyBrokerage" > 二级返佣: @@ -840,7 +840,7 @@ placeholder="请输入会员价" :min="0" :max="99999999" - class="columnsBox perW30" + class="columnsBox perW20" v-model="manyVipPrice" > @@ -2317,7 +2317,12 @@ export default { if (suffix.indexOf('.mp4') === -1) { return that.$Message.error('只能上传MP4文件'); } - productGetTempKeysApi() + console.log(evfile.target.files[0]); + let types = { + key: evfile.target.files[0].name, + contentType: evfile.target.files[0].type, + }; + productGetTempKeysApi(types) .then((res) => { that.$videoCloud .videoUpload({ diff --git a/template/admin/src/pages/system/group/visualization.vue b/template/admin/src/pages/system/group/visualization.vue index 09a1c6612..29665cccf 100644 --- a/template/admin/src/pages/system/group/visualization.vue +++ b/template/admin/src/pages/system/group/visualization.vue @@ -675,7 +675,11 @@ export default { if (suffix.indexOf('.mp4') === -1) { return that.$Message.error('只能上传MP4文件'); } - productGetTempKeysApi() + let types = { + key: evfile.target.files[0].name, + contentType: evfile.target.files[0].type, + }; + productGetTempKeysApi(types) .then((res) => { that.$videoCloud .videoUpload({ diff --git a/template/admin/src/utils/videoCloud.js b/template/admin/src/utils/videoCloud.js index 5ea08f392..c152052eb 100644 --- a/template/admin/src/utils/videoCloud.js +++ b/template/admin/src/utils/videoCloud.js @@ -11,7 +11,7 @@ import * as qiniu from 'qiniu-js'; import Cos from 'cos-js-sdk-v5'; import axios from 'axios'; -import { upload } from '@/api/upload'; +import { upload, ossUpload } from '@/api/upload'; const sign = (method, publicKey, privateKey, md5, contentType, date, bucketName, fileName) => { const CryptoJS = require('crypto-js'); // 这里使用了crypto-js加密算法库,安装方法会在后面说明 @@ -38,7 +38,7 @@ export default { result = this.us3Http(config.evfile, config.res, config.uploading); break; case 'JDOSS': - result = this.uploadMp4ToLocal(config.evfile, config.res, config.uploading); + result = this.jdHttp(config.evfile, config.res, config.uploading); break; case 'CTOSS': result = this.obsHttp(config.evfile, config.res, config.uploading); @@ -325,6 +325,22 @@ export default { }); }); }, + // 京东云上传 + jdHttp(evfile, r, videoIng) { + const fileObject = evfile.target.files[0]; // 获取的文件对象 + const formData = new FormData(); + formData.append('file', fileObject); + return new Promise((resolve, reject) => { + ossUpload(r.data.upload_url, formData) + .then((res) => { + console.log(res); + }) + .catch((err) => { + videoIng(true, 100); + resolve(r.data); + }); + }); + }, // 本地上传 uploadMp4ToLocal(evfile, res, videoIng) { const fileObject = evfile.target.files[0]; // 获取的文件对象 From 2fa86e3b539bf2affbec41c1a1d06927774a31ca Mon Sep 17 00:00:00 2001 From: From-wh Date: Mon, 19 Jun 2023 14:59:09 +0800 Subject: [PATCH 2/3] =?UTF-8?q?feat:=20=E5=94=AE=E5=90=8E=E4=BF=A1?= =?UTF-8?q?=E6=81=AF=E5=B1=95=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../order/orderList/components/tableList.vue | 2 +- .../order/orderList/handle/orderDetails.vue | 15 ++++++++++ .../order/orderList/handle/orderSend.vue | 30 ++++++++++++------- .../admin/src/pages/order/refund/index.vue | 14 ++++----- 4 files changed, 42 insertions(+), 19 deletions(-) diff --git a/template/admin/src/pages/order/orderList/components/tableList.vue b/template/admin/src/pages/order/orderList/components/tableList.vue index 0bdd191e4..fb2da383a 100644 --- a/template/admin/src/pages/order/orderList/components/tableList.vue +++ b/template/admin/src/pages/order/orderList/components/tableList.vue @@ -653,11 +653,11 @@ export default { // 发送货 sendOrder(row) { this.$refs.send.total_num = row.total_num; + this.virtual_type = row.virtual_type; this.$refs.send.modals = true; this.orderId = row.id; this.status = row._status; this.pay_type = row.pay_type; - this.virtual_type = row.virtual_type; this.$refs.send.getList(); this.$refs.send.getDeliveryList(); this.$nextTick((e) => { diff --git a/template/admin/src/pages/order/orderList/handle/orderDetails.vue b/template/admin/src/pages/order/orderList/handle/orderDetails.vue index 29cbda58d..ecfeb5ccf 100644 --- a/template/admin/src/pages/order/orderList/handle/orderDetails.vue +++ b/template/admin/src/pages/order/orderList/handle/orderDetails.vue @@ -235,6 +235,21 @@ {{ orderDatalist.orderInfo.mark }} +
+ +
售后信息
+ + 备注:{{ orderDatalist.orderInfo.refund_reason }} + + + +
+
+ +
+
+
diff --git a/template/admin/src/pages/order/orderList/handle/orderSend.vue b/template/admin/src/pages/order/orderList/handle/orderSend.vue index 2eb526724..cfcd26a50 100644 --- a/template/admin/src/pages/order/orderList/handle/orderSend.vue +++ b/template/admin/src/pages/order/orderList/handle/orderSend.vue @@ -157,10 +157,11 @@ - - - + + {{ sendPrice }} + 立即计算 +
@@ -197,11 +198,6 @@ export default { pay_type: String, virtual_type: Number, }, - watch: { - orderId(val) { - if (this.virtual_type == 3) this.formItem.type = '3'; - }, - }, data() { return { orderStatus: 0, @@ -291,6 +287,7 @@ export default { ], selectData: [], serviceTypeList: [], + sendPrice: 0, }; }, watch: { @@ -298,6 +295,9 @@ export default { if (newVal) { } }, + virtual_type(val) { + if (this.virtual_type == 3) this.formItem.type = '3'; + }, }, mounted() { this.kuaidiComsList(1); @@ -322,9 +322,14 @@ export default { cart_num: v.num || v.surplus_num, }); }); - orderPrice(data).then((res) => { - console.log(res); - }); + orderPrice(data) + .then((res) => { + console.log(res); + this.sendPrice = res.data.price; + }) + .catch((err) => { + this.$Message.error(err.msg); + }); }, selectOne(data) { this.selectData = data; @@ -343,6 +348,9 @@ export default { this.manyFormValidate.push(res.data[key]); }); }); + } else { + this.formItem.cart_ids = []; + this.selectData = []; } }, changeRadio(o) { diff --git a/template/admin/src/pages/order/refund/index.vue b/template/admin/src/pages/order/refund/index.vue index 66c4dc34e..917882d3e 100644 --- a/template/admin/src/pages/order/refund/index.vue +++ b/template/admin/src/pages/order/refund/index.vue @@ -568,13 +568,13 @@ export default { getDataInfoNew(id) .then(async (res) => { this.orderDatalist = res.data; - if (this.orderDatalist.orderInfo.refund_img.length) { - try { - this.orderDatalist.orderInfo.refund_img = JSON.parse(this.orderDatalist.orderInfo.refund_img); - } catch (e) { - this.orderDatalist.orderInfo.refund_img = []; - } - } + // if (this.orderDatalist.orderInfo.refund_img.length) { + // try { + // this.orderDatalist.orderInfo.refund_img = this.orderDatalist.orderInfo.refund_img; + // } catch (e) { + // this.orderDatalist.orderInfo.refund_img = []; + // } + // } this.$nextTick((e) => { this.$refs.detailss.modals = true; }); From 8d76fc1ac5cc1f5a60a10b1f7b332bbafd03823c Mon Sep 17 00:00:00 2001 From: From-wh Date: Mon, 19 Jun 2023 14:59:28 +0800 Subject: [PATCH 3/3] =?UTF-8?q?improve:=20=E5=AE=A2=E6=9C=8D=E5=8F=91?= =?UTF-8?q?=E8=B4=A7=E7=B1=BB=E5=9E=8B=E5=88=A4=E6=96=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/pages/kefu/pc/components/delivery.vue | 15 ++++++++++++++- .../src/pages/kefu/pc/components/rightMenu.vue | 5 ++++- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/template/admin/src/pages/kefu/pc/components/delivery.vue b/template/admin/src/pages/kefu/pc/components/delivery.vue index 584ef6b64..234bcc9b2 100644 --- a/template/admin/src/pages/kefu/pc/components/delivery.vue +++ b/template/admin/src/pages/kefu/pc/components/delivery.vue @@ -3,7 +3,9 @@
- {{ item.title }} + 发货 + 送货 + 虚拟 - +