diff --git a/colorui/main.css b/colorui/main.css
index 6b5081a..e463a14 100644
--- a/colorui/main.css
+++ b/colorui/main.css
@@ -843,9 +843,10 @@ button.cuIcon.lg {
position: absolute;
top: -10upx;
left: -10upx;
- font-size: 20upx;
- padding: 10upx;
+ font-size: 28upx;
+ padding: 22upx;
height: 40upx;
+ font-weight: 200;
color: #ffffff;
}
diff --git a/common/api.js b/common/api.js
index 34b0861..7dbd03c 100644
--- a/common/api.js
+++ b/common/api.js
@@ -17,6 +17,18 @@ export const API_ORDER_DETAILS = '/api/order/detail';
//确认订单详情
export const API_COFIRMORDER_DETAILS = '/api/order/confirm';
+//订单退款申请落地页
+export const API_APPLY_DETAILS = '/api/refund/view';
+
+//订单退款详情
+export const API_APPLYPAGE_DETAILS = '/api/refund/detail';
+
+//提交订单退款申请
+export const API_SUBMIT_APPLY = '/api/refund/apply';
+
+//退款申请图片上传
+export const API_UPPLOAD_APPLY = '/api/refund/uploadImg'
+
/* 商品详情相关 */
export const API_GOODS_DETAIL = '/api/goods/detail'; // 商品详情
export const API_COLLECT_DEAL = '/api/collect/deal'; // 商品收藏
diff --git a/common/uploadFile.js b/common/uploadFile.js
new file mode 100644
index 0000000..92949c8
--- /dev/null
+++ b/common/uploadFile.js
@@ -0,0 +1,74 @@
+/*
+ *上传文件
+ *@param - filePath :图片的本地资源路径
+ *@param - dir:表示要传到哪个目录下
+ *@param - successc:成功回调
+ *@param - failc:失败回调
+ */
+const uploadFile = function (filePath, successc, failc) {
+ if (!filePath || filePath.length < 9) {
+ wx.showModal({
+ title: '图片错误',
+ content: '请重试',
+ showCancel: false,
+ })
+ return;
+ }
+
+ // 上传的服务器地址
+ let url = this.API.DEVURL;
+ if (this.API.DEV == 'prod') {
+ url = this.API.PRODURL;
+ }
+ const url_a = this.API.API_UPPLOAD_APPLY;
+
+ // 上传图片的目录
+ var nowTime = formatTime(new Date());
+ const dir = 'wxmini/images/' + nowTime + '/';
+
+ // 获取上传的文件类型 fileType
+ let fileTypeIndex = filePath.lastIndexOf('.');
+ let fileType = filePath.substring(fileTypeIndex);
+
+ uni.uploadFile({
+ url: url + url_a,//开发者服务器 url
+ filePath: filePath,//要上传文件资源的路径
+ name: 'image',
+ formData: {
+ token: uni.getStorageSync('userinfo').token
+ },
+
+ success: function (res) {
+ console.log('上传文件...', res)
+ if (res.statusCode != 200 || !res.data) {
+ failc(new Error('上传错误:' + JSON.stringify(res)))
+ return;
+ }
+ let res_data = JSON.parse(res.data);
+ successc && successc(res_data.data);
+ },
+ fail: function (err) {
+ failc(err);
+ },
+ })
+}
+
+// 获取当前日期(年-月-日),并不足十位补零
+function formatTime(date) {
+ const year = date.getFullYear()
+ const month = date.getMonth() + 1
+ const day = date.getDate()
+ const hour = date.getHours()
+ const minute = date.getMinutes()
+ const second = date.getSeconds()
+ return [year, month, day].map(formatNumber).join('-')
+ // + ' ' + [hour, minute, second].map(formatNumber).join(':')
+}
+const formatNumber = n => {
+ n = n.toString()
+ return n[1] ? n : '0' + n
+}
+
+module.exports = {
+ uploadFile
+};
\ No newline at end of file
diff --git a/components/me-tabs/me-tabs.vue b/components/me-tabs/me-tabs.vue
index 14c344e..ff528aa 100644
--- a/components/me-tabs/me-tabs.vue
+++ b/components/me-tabs/me-tabs.vue
@@ -175,7 +175,6 @@
color: black;
background-color: white;
border-radius: 10px;
- margin: 2px 0;
height: 27px!important;
line-height: 27px!important;
}
@@ -185,7 +184,7 @@
// 平分的方式显示item
.tabs-flex {
display: flex;
-
+ align-items: center;
.tab-item {
flex: 1;
background-color: #FE9903;
diff --git a/main.js b/main.js
index 89a4a70..4f07de6 100644
--- a/main.js
+++ b/main.js
@@ -3,6 +3,7 @@ import App from './App'
import mixin from '@/common/mixin.js';
import * as API from '@/common/api.js';
import * as $shared from '@/common/shared.js';
+import { uploadFile } from '@/common/uploadFile.js'
Vue.config.productionTip = false
@@ -14,6 +15,8 @@ Vue.prototype.API = API;
// 全局共享方法
Vue.prototype.$shared = $shared;
+Vue.prototype.uploadFile = uploadFile
+
// 引入全局uView
import uView from 'uview-ui'
Vue.use(uView);
diff --git a/pages/order/apply-details.vue b/pages/order/apply-details.vue
index a08931b..4b55fc1 100644
--- a/pages/order/apply-details.vue
+++ b/pages/order/apply-details.vue
@@ -6,19 +6,19 @@
-
+
- 网红辣椒棒 魔鬼辣椒挑战全网第一辣 网红优惠季
+ {{orderDetails.order.goods.name}}
- 数量 x1
+ 数量 x {{orderDetails.order.number}}
- 19.90
+ {{orderDetails.order.selling_price}}
-
+
@@ -32,19 +32,19 @@
订单金额
- 19.90
+ {{orderDetails.order.amount}}
扣费率
- 30%
+ {{orderDetails.refund_rate}}%
扣费金额
- 3.90
+ {{orderDetails.refund_rate_amount}}
@@ -56,14 +56,14 @@
可退金额
- 16.00
+ {{orderDetails.refund_amount}}
订单编号
- 67432428794847982374
- 复制
+ {{orderDetails.order_sn}}
+ 复制
@@ -74,7 +74,7 @@
@@ -83,19 +83,13 @@
退款说明
-
-
-
-
-
-
-
-
+
+
@@ -114,46 +108,41 @@
hostImg: '',
// 已上传服务器的图片名称
serverImg:'',
+ orderId:1,
+ orderDetails: {},
+ checkArea: '',
+ images: []
}
},
computed: {
},
onLoad(e) {
- setTimeout(()=>{
- this.skeletonLoading = false
- },1000)
+ this.orderId = e.orderid
+ if(this.orderId) {
+ this.getOrderDetails()
+ }
},
methods: {
- // 选择图片
- ChooseImage(e) {
- uni.chooseImage({
- count: 1,
- success: e => {
- this.hostImg = e.tempFilePaths[0];
+ getOrderDetails() {
+ this.$http(this.API.API_APPLYPAGE_DETAILS, {order_id: this.orderId}).then(res => {
+ if(res.code == 0) {
+ this.orderDetails = res.data.refund
+ this.checkArea = res.data.agreement.tips
+ this.images = res.data.refund.images
+ this.skeletonLoading = false
}
+
+ }).catch(err => {
+
});
},
-
// 预览图片
showImg() {
uni.previewImage({
urls: ['../../static/tu.png']
});
},
-
- // 删除图片
- DelImg() {
- uni.showModal({
- title: '提示',
- content: '即将取消上传这张图片,请确认?',
- success: e => {
- if (!e.confirm) return;
- this.hostImg = '';
- this.serverImg = '';
- }
- });
- },
// 点击复制
copy(text) {
uni.setClipboardData({
diff --git a/pages/order/apply-refund.vue b/pages/order/apply-refund.vue
index f4f4f25..f9782bc 100644
--- a/pages/order/apply-refund.vue
+++ b/pages/order/apply-refund.vue
@@ -6,16 +6,16 @@
-
+
- 网红辣椒棒 魔鬼辣椒挑战全网第一辣 网红优惠季
+ {{applyDetails.order.goods.name}}
- 数量 x1
+ 数量 x{{applyDetails.order.number}}
- 19.90
+ {{applyDetails.order.selling_price}}
@@ -30,19 +30,19 @@
订单金额
- 19.90
+ {{applyDetails.order.amount}}
扣费率
- 30%
+ {{applyDetails.order.refund_rate}}%
扣费金额
- 3.90
+ {{applyDetails.order.refund_rate_amount}}
@@ -55,19 +55,19 @@
可退金额
- 16.00
+ {{applyDetails.order.refund_amount}}
订单编号
- 67432428794847982374
- 复制
+ {{applyDetails.order.order_sn}}
+ 复制
退款说明
-
+
@@ -76,7 +76,7 @@
@@ -87,17 +87,28 @@
+
+
+
+
+
+
+
+
+
+
+
-