diff --git a/common/js/dateUtil.js b/common/js/dateUtil.js
new file mode 100644
index 0000000..78ffaf2
--- /dev/null
+++ b/common/js/dateUtil.js
@@ -0,0 +1,35 @@
+export default {
+ dateCache: null,
+ countDownDiffCache: null,
+ countDownDiff(dateStr) {
+ if (dateStr == this.dateCache) {
+ return this.countDownDiffCache;
+ }
+ let dayTimes = 24*60*60*1000;
+ let hourTimes = 60*60*1000;
+ let minTimes = 60*1000;
+ let secondsTimes = 1000;
+ let dateTimesDiff = new Date(dateStr).getTime() - new Date().getTime();
+ let day = Math.floor(dateTimesDiff / dayTimes);
+ let leftOver = dateTimesDiff % dayTimes;
+ let hour = Math.floor(leftOver / hourTimes);
+ leftOver = leftOver % hourTimes;
+ let min = Math.floor(leftOver / minTimes);
+ leftOver = leftOver % minTimes;
+ let seconds = Math.floor(leftOver / secondsTimes);
+ leftOver = leftOver % secondsTimes;
+ this.dateCache = dateStr;
+ this.countDownDiffCache = {
+ day: day,
+ hour: hour,
+ min: min,
+ seconds: seconds
+ }
+ return this.countDownDiffCache;
+ },
+ addHours(dateStr, hourAmount) {
+ let date = new Date(dateStr);
+ date.setHours(date.getHours() + hourAmount);
+ return date;
+ }
+}
\ No newline at end of file
diff --git a/common/js/request.js b/common/js/request.js
index e3bd523..c6f3af0 100644
--- a/common/js/request.js
+++ b/common/js/request.js
@@ -1,6 +1,7 @@
import globalData from '@/common/js/globalData.js';
-export default {
+export default {
+ address: 'https://www.opsoul.com',
// 异步接口拦截
addInterceptor() {
uni.addInterceptor('request', {
@@ -11,7 +12,7 @@ export default {
})
// request 触发前拼接 url
args.url = 'https://www.opsoul.com' + args.url;
- // args.url = 'http://120.79.136.57' + args.url;
+ // args.url = 'http://192.168.2.20:80' + args.url;
// args.url = 'http://127.0.0.1:80' + args.url;
if (args.data && Object.prototype && Object.prototype.toString.call(args.data) === '[object Object]') {
args.data.deptId = globalData.deptId;
@@ -386,17 +387,28 @@ export default {
return res[1].data;
},
async uploadFile(filePath) {
- let res = await uni.uploadFile({
- url: this.address + '/tool/qiniu/upload',
- filePath: filePath,
- name: 'uploadFile'
- })
- let resStr = res[1].data;
- let resObj = {};
- if (resStr != null && resStr.length > 0) {
- resObj = JSON.parse(resStr);
- }
- return resObj;
+ let res = await uni.uploadFile({
+ url: this.address + '/tool/qiniu/upload',
+ filePath: filePath,
+ name: 'uploadFile'
+ })
+ let resStr = res[1].data;
+ let resObj = null;
+ if (resStr != null && resStr.length > 0) {
+ try {
+ resObj = JSON.parse(resStr);
+ } catch(e) {
+ console.log(e)
+ }
+ }
+ if (!resObj || resObj.code !== 0) {
+ uni.showToast({
+ icon: 'error',
+ title: '上传失败'
+ })
+ return '';
+ }
+ return resObj.url;
},
// async qryOrderGoodsPage(params = {}) {
// let res = await uni.request({
@@ -562,5 +574,41 @@ export default {
}
})
return res[1].data;
- }
+ },
+ async getDetailListByMasterId(params = {}) {
+ let res = await uni.request({
+ url: '/order/master/app/getDetailListByMasterId',
+ method: 'POST',
+ data: params.orderMasterId
+ })
+ return res[1].data;
+ },
+ async getAfterList() {
+ let res = await uni.request({
+ url: '/order/master/after/list',
+ method: 'POST',
+ data: {}
+ })
+ return res[1].data;
+ },
+ async addAfterServiceRecord(params = {}) {
+ let res = await uni.request({
+ url: '/worker/record/add',
+ method: 'POST',
+ data: params,
+ header: {
+ pageNum: params.pageNum,
+ pageSize: params.pageSize
+ }
+ })
+ return res[1].data;
+ },
+ async getOrderAfterServiceRecords(params = {}) {
+ let res = await uni.request({
+ url: '/worker/record/app/list',
+ method: 'POST',
+ data: params
+ })
+ return res[1].data;
+ },
}
diff --git a/main.js b/main.js
index bc1cfa9..6a618eb 100644
--- a/main.js
+++ b/main.js
@@ -7,6 +7,7 @@ import Data from './common/js/data.js';
import globalFun from './common/js/glogalFun.js';
import validate from './common/js/validate.js';
import request from './common/js/request.js';
+import dateUtil from './common/js/dateUtil.js';
import globalData from './common/js/globalData.js';
import vertifyLogin from '@/components/vertify/vertify-login.vue';
import vertifyPhone from '@/components/vertify/vertify-phone.vue';
@@ -30,7 +31,8 @@ Vue.prototype.$api = {
Vue.prototype.$globalFun = globalFun;
Vue.prototype.$validate = validate;
Vue.prototype.$request = request;
-Vue.prototype.$globalData = globalData;
+Vue.prototype.$globalData = globalData;
+Vue.prototype.$dateUtil = dateUtil;
Vue.config.productionTip = false
diff --git a/pages/index/my-home.vue b/pages/index/my-home.vue
index d2d74bd..6e19f30 100644
--- a/pages/index/my-home.vue
+++ b/pages/index/my-home.vue
@@ -123,6 +123,14 @@
待确认
+
+
+ {{myInfo.serOrderNum.afterServ}}
+
+
+ 售后中
+
+
{{myInfo.serOrderNum.wait2Forward}}
@@ -307,6 +315,9 @@
}, {
type: 4,
name: '待确认'
+ }, {
+ // type: 4,
+ name: '售后中'
}, {
type: 5,
name: '已完成'
diff --git a/pages/my/components/modal/apply-after-service.vue b/pages/my/components/modal/apply-after-service.vue
new file mode 100644
index 0000000..7c9ebdd
--- /dev/null
+++ b/pages/my/components/modal/apply-after-service.vue
@@ -0,0 +1,205 @@
+
+
+
+
+ {{afterServiceType === 1 ? '退单退款' : '发起售后'}}
+
+
+
+
+
+
+ 选择子单:
+
+
+
+
+ 申请原因:
+
+
+
+
+ 退款金额:
+
+
+
+ 具体原因:
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 取消
+ 确认
+
+
+
+
+
+
+
+
diff --git a/pages/my/my-order.vue b/pages/my/my-order.vue
index 9a67397..9465a1c 100644
--- a/pages/my/my-order.vue
+++ b/pages/my/my-order.vue
@@ -73,12 +73,7 @@
-
-
+
@@ -110,18 +105,21 @@
-
+
+