yuantianjiao 6 gadus atpakaļ
vecāks
revīzija
8ec8dcf0ee

+ 5
- 2
src/components/myCard/myCard.vue Parādīt failu

@@ -1,6 +1,6 @@
1 1
 <template>
2 2
   <div class="card-content flex-l" :class="{invalid: data.invalid || isgrey}">
3
-    <div class="card-top flex-h">
3
+    <div class="card-top flex-h" @click="detail">
4 4
       <div>
5 5
         <img :src="logo" class="logo">
6 6
         <span>¥ <span> {{data.price}} </span> 元</span>
@@ -12,7 +12,7 @@
12 12
         <span>{{data.startDate}}-{{data.endDate}}</span>
13 13
       </div>
14 14
     </div>
15
-    <div class="card-main flex-h">
15
+    <div class="card-main flex-h" @click="detail">
16 16
       <img :src="line">
17 17
       <div class="flex-h">
18 18
         <span>总数量</span>
@@ -73,6 +73,9 @@ export default {
73 73
           this.$emit('share', this.data)
74 74
         }
75 75
       }
76
+    },
77
+    detail () {
78
+      this.$emit('detail', this.data)
76 79
     }
77 80
   }
78 81
 }

+ 5
- 2
src/pages/sales/cardAndCouponNum/index.vue Parādīt failu

@@ -1,5 +1,5 @@
1 1
 <template>
2
-  <div class="mainPage flex-v" v-if="data">
2
+  <div class="mainPage flex-v" v-if="showPage">
3 3
     <div class="top flex-h">
4 4
       <span>¥<em>{{parseInt(data.Price)}}</em>元</span>
5 5
       <div class="flex-item">
@@ -72,7 +72,8 @@ export default {
72 72
   name: '',
73 73
   data () {
74 74
     return {
75
-      data: {}
75
+      data: {},
76
+      showPage: false
76 77
     }
77 78
   },
78 79
   created () {
@@ -81,6 +82,7 @@ export default {
81 82
         this.getSales({ type: 'sales' }).then(() => {
82 83
           this.data = this.cardAndCoupon
83 84
           this.data.CustomerCard = this.data.CustomerCard || []
85
+          this.showPage = true
84 86
         })
85 87
       })
86 88
     } else {
@@ -88,6 +90,7 @@ export default {
88 90
         this.getSales({ type: 'sales' }).then(() => {
89 91
           this.data = this.cardAndCoupon
90 92
           this.data.CustomerCard = this.data.CustomerCoupon || []
93
+          this.showPage = true
91 94
         })
92 95
       })
93 96
     }

+ 1
- 1
src/pages/sales/customerSearch/index.vue Parādīt failu

@@ -1,7 +1,7 @@
1 1
 <template>
2 2
   <div class="mainPage flex-v">
3 3
     <div class="top">
4
-      <topCaseInfo :data="topCaseInfoData" :userName="userInfo.customer !== undefined ? userInfo.customer.RealName : ''"></topCaseInfo>
4
+      <topCaseInfo :data="topCaseInfoData" :userName="userInfo.customer.RealName ? userInfo.customer.RealName : userInfo.customer.CustomerName"></topCaseInfo>
5 5
     </div>
6 6
     <div class="content flex-item">
7 7
       <div>

+ 1
- 1
src/pages/sales/getRecord/index.vue Parādīt failu

@@ -1,7 +1,7 @@
1 1
 <template>
2 2
   <div class="mainPage flex-v">
3 3
     <div class="top">
4
-      <topCaseInfo :data="topCaseInfoData" :userName="userInfo.customer !== undefined ? userInfo.customer.RealName : ''" @selectCase="showSelect = true"></topCaseInfo>
4
+      <topCaseInfo :data="topCaseInfoData" :userName="userInfo.customer.RealName ? userInfo.customer.RealName : userInfo.customer.CustomerName" @selectCase="showSelect = true"></topCaseInfo>
5 5
     </div>
6 6
     <div class="info">
7 7
       <span><em>姓名:</em>{{user.name}}</span>

+ 1
- 1
src/pages/sales/login/index.vue Parādīt failu

@@ -8,7 +8,7 @@
8 8
 
9 9
           <div class="mobile">
10 10
             <i class="iconfont icon-dianhua"></i>
11
-            <input type="number" maxlength="11" placeholder="手机号" v-model="postData.phone">
11
+            <input type="tel" maxlength="11" placeholder="手机号" v-model="postData.phone">
12 12
           </div>
13 13
 
14 14
           <div class="sms" style="margin-top:.2rem;">

+ 3
- 3
src/pages/sales/salesGiveOutDetail/index.vue Parādīt failu

@@ -1,7 +1,7 @@
1 1
 <template>
2 2
   <div class="mainPage flex-v">
3 3
     <div class="top">
4
-      <topCaseInfo :data="topCaseInfoData" :userName="userInfo.customer !== undefined ? userInfo.customer.RealName : ''" @selectCase="showVanPicker"></topCaseInfo>
4
+      <topCaseInfo :data="topCaseInfoData" :userName="userInfo.customer.RealName ? userInfo.customer.RealName : userInfo.customer.CustomerName" @selectCase="showVanPicker"></topCaseInfo>
5 5
     </div>
6 6
     <div class="flex-item flex-v body" v-if="data.allCard">
7 7
       <span>销售姓名:<em>{{data.RealName}}</em></span>
@@ -37,7 +37,7 @@
37 37
             </li>
38 38
             <li :hidden="activeIndex === 0">
39 39
               <ul class="list">
40
-                <router-link tag="li" class="flex-h" v-for="(item,index) in data.allCard" :key="index" :to="{name: 'cardAndCouponNum', query: { id: item.CardId || item.CouponId, type:item.CardId ? 'card' : 'coupon' }}">
40
+                <li class="flex-h" v-for="(item,index) in data.allCard" :key="index" >
41 41
                   <div class="flex-item">
42 42
                     <div>
43 43
                       <span>{{item.CustomerCardName || item.CustomerCouponName}}</span>
@@ -49,7 +49,7 @@
49 49
                     </div>
50 50
                   </div>
51 51
                   <span>{{toolClass.dateFormat(item.ReceiveDate, 'yyyy/MM/dd hh:mm')}}</span>
52
-                </router-link>
52
+                </li>
53 53
               </ul>
54 54
             </li>
55 55
           </ul>

+ 1
- 1
src/pages/sales/salesRecord/index.vue Parādīt failu

@@ -1,7 +1,7 @@
1 1
 <template>
2 2
   <div class="mainPage flex-v">
3 3
     <div class="top">
4
-      <topCaseInfo :data="topCaseInfoData" :userName="userInfo.customer !== undefined ? userInfo.customer.RealName : ''" @selectCase="showVanPicker"></topCaseInfo>
4
+      <topCaseInfo :data="topCaseInfoData" :userName="userInfo.customer.RealName ? userInfo.customer.RealName : userInfo.customer.CustomerName" @selectCase="showVanPicker"></topCaseInfo>
5 5
     </div>
6 6
     <div class="flex-item body">
7 7
       <div>

+ 1
- 1
src/pages/user/bindMobile/bindMobile.vue Parādīt failu

@@ -7,7 +7,7 @@
7 7
 
8 8
         <div class="mobile">
9 9
           <i class="iconfont icon-dianhua"></i>
10
-          <input type="number" maxlength="11" placeholder="手机号" v-model="postData.phone">
10
+          <input type="tel" maxlength="11" placeholder="手机号" v-model="postData.phone">
11 11
         </div>
12 12
 
13 13
         <div class="recommend">

+ 8
- 8
src/pages/user/card/index.vue Parādīt failu

@@ -122,16 +122,16 @@ export default {
122 122
     this.getCardList().then((res) => {
123 123
       if (res) {
124 124
         for (var n = 0; n < res.length; n++) {
125
-          let useType
125
+          let useType = '已使用'
126 126
           let nowDate = new Date().valueOf()
127 127
           let endDate = new Date(res[n].EndDate).valueOf()
128
-          if (res[n].Status === 2) {
129
-            useType = '已使用'
130
-          } else if (res[n].Status === 1 && nowDate > endDate) {
131
-            useType = '已失效'
132
-          } else {
133
-            useType = '未使用'
134
-          }
128
+          // if (res[n].Status === 2) {
129
+          //   useType = '已使用'
130
+          // } else if (res[n].Status === 1 && nowDate > endDate) {
131
+          //   useType = '已失效'
132
+          // } else {
133
+          //   useType = '未使用'
134
+          // }
135 135
           this.data[0].list.push({
136 136
             title: res[n].CustomerCardName,
137 137
             desc: res[n].Share.CardUseRule,

+ 1
- 1
src/pages/user/cardDetail/index.vue Parādīt failu

@@ -14,7 +14,7 @@
14 14
       </div>
15 15
       <div class="rule">
16 16
         <div>使用规则</div>
17
-        <pre style="white-space: pre;">{{info.Share.CardUseInstruction}}</pre>
17
+        <pre style="white-space: pre-wrap;word-wrap: break-word;">{{info.Share.CardUseInstruction}}</pre>
18 18
       </div>
19 19
       <div class="line">
20 20
         <img :src="Artboard" alt="" width="100%">

+ 1
- 1
src/pages/user/coupons/index.vue Parādīt failu

@@ -60,7 +60,7 @@ export default {
60 60
           }
61 61
           this.list.push({
62 62
             title: res[n].Coupon.CouponName,
63
-            desc: res[n].Coupon.Share.UseInstruction,
63
+            desc: res[n].Coupon.Share.CouponShareInfo,
64 64
             time: this.toolClass.dateFormat(res[n].EndDate),
65 65
             useType: useType,
66 66
             tag: res[n].Coupon.CouponType === 'course' ? '课程' : '商品',

+ 1
- 1
src/pages/user/couponsDetail/index.vue Parādīt failu

@@ -13,7 +13,7 @@
13 13
       </div>
14 14
       <div class="rule">
15 15
         <div>使用规则</div>
16
-        <pre style="white-space: pre;">{{info.Share.UseInstruction}}</pre>
16
+        <pre style="white-space: pre-wrap;word-wrap: break-word;">{{info.Share.UseInstruction}}</pre>
17 17
         <!-- <div>1. 此卡不可兑换现金,不可与其他优惠活动同时使用。 </div>
18 18
         <div>2. 此卡不可多人使用,一人记一次。 </div>
19 19
         <div>3. 非会员可凭此卡享受对应课程。 </div>

+ 1
- 1
src/pages/user/fiveA/index.vue Parādīt failu

@@ -125,7 +125,7 @@ export default {
125 125
       if (item.ForwardType === 'url') {
126 126
         window.location.href = item.ForwardUrl
127 127
       } else if (item.ForwardType === 'course') {
128
-        this.$router.push({ name: '', query: { id: item.ForwardResourceId } }) // 此处去课程详情
128
+        this.$router.push({ name: 'majorProjectsDetail', query: { id: item.ForwardResourceId } }) // 此处去课程详情
129 129
       } else {
130 130
         window.location.href = item.InfoUrl
131 131
       }

+ 13
- 6
src/pages/user/lessonOrder/index.vue Parādīt failu

@@ -2,9 +2,9 @@
2 2
   <div class="mainPage">
3 3
     <scroll ref='scroll' :isloading='isloading' class='wrapper' :data='courseOrderList.list' :pullUpLoad='pullUpLoadObj' :startY='parseInt(startY)' @pullingUp='getList'>
4 4
       <div class="box">
5
-        <div class="order-card flex-h" v-for="(item,index) in courseOrderList.list" :key='index' :class="{'opacity' : item.IsDone === 1}" @click="toDetail(item)">
5
+        <div class="order-card flex-h" v-for="(item,index) in courseOrderList.list" :key='index' :class="{'opacity' : item.IsDone === 1 || (item.IsDone === 0 && now > time(item.EndDate)) }" @click="toDetail(item)">
6 6
           <div class="card-pic">
7
-            <div :class="{'gray-location' : item.status === 1}"><span>{{returnLocationName(item.LocationId)}}</span></div>
7
+            <div :class="{'gray-location' : item.IsDone === 1 || (item.IsDone === 0 && now > time(item.EndDate)) }"><span>{{returnLocationName(item.LocationId)}}</span></div>
8 8
             <img :src="item.CourseImg" class="cover" width="100%" height="100%" alt="">
9 9
           </div>
10 10
           <div class="card-msg">
@@ -16,7 +16,9 @@
16 16
           </div>
17 17
           <div class="card-price">
18 18
             <div class="price" style="white-space: nowrap;">¥ {{item.Price}}</div>
19
-            <div class="type" :class="{'un-use' : item.IsDone === 0}">{{item.IsDone === 0 ? '未使用' : '已使用'}}</div>
19
+            <div class="type un-use" v-if="item.IsDone === 0 && now < time(item.EndDate)">未使用</div>
20
+            <div class="type" v-if="item.IsDone === 1">已使用</div>
21
+            <div class="type" v-if="item.IsDone === 0 && now > time(item.EndDate)">已失效</div>
20 22
           </div>
21 23
         </div>
22 24
         <noMore v-if="noData"></noMore>
@@ -43,7 +45,8 @@ export default {
43 45
       page: 1,
44 46
       isloading: true,
45 47
       hasMore: true,
46
-      list: []
48
+      list: [],
49
+      now: ''
47 50
     }
48 51
   },
49 52
   components: {
@@ -51,12 +54,13 @@ export default {
51 54
     noMore
52 55
   },
53 56
   created () {
57
+    this.now = Date.now()
54 58
     var _that = this
55 59
     this.getCourseLocationList().then((res) => {
56 60
       // console.log(JSON.stringify(res))
57 61
       this.getCourseOrderList({ page: this.page }).then((res) => {
58 62
         // console.log(JSON.stringify(res))
59
-        if(res.list === null){
63
+        if (res.list === null) {
60 64
           this.noData = true
61 65
         }
62 66
       })
@@ -111,7 +115,10 @@ export default {
111 115
       }
112 116
     },
113 117
     toDetail (item) {
114
-      this.$router.push({ name: 'lessonDetail', query: {id: item.CustomerCourseId} })
118
+      this.$router.push({ name: 'lessonDetail', query: { id: item.CustomerCourseId } })
119
+    },
120
+    time (time) {
121
+      return new Date(time).getTime()
115 122
     }
116 123
   }
117 124
 }

+ 21
- 3
src/pages/user/mainPage/coffeeIndex/index.vue Parādīt failu

@@ -1,7 +1,7 @@
1 1
 <template>
2 2
   <div class="mainPage flex-v">
3 3
     <div class="top">
4
-      <topCaseInfo :data="topCaseInfoData" :userName="userInfo.customer !== undefined ? userInfo.customer.RealName : ''" @selectCase="showVanPicker"></topCaseInfo>
4
+      <topCaseInfo :data="topCaseInfoData" :userName="userInfo.customer.RealName ? userInfo.customer.RealName : userInfo.customer.Name" @selectCase="showVanPicker"></topCaseInfo>
5 5
     </div>
6 6
     <nav class="flex-h" v-if="userInfo.customer.MapUser !== ''">
7 7
       <a class="flex-item" v-for="(item,index) in cutNavList" :key="index" v-if="userInfo.customer.UserTypeId !== 'manager' || item.id !== '4'" :class="{'active': navActive === index}" @click="cutNav(index)">{{item.value}}</a>
@@ -59,7 +59,7 @@
59 59
                   </div>
60 60
                   <a @click="toSalesHistory" v-if="userInfo.customer.UserTypeId == 'manager'">销售记录</a>
61 61
                 </div>
62
-                <myCard v-for="(item,index) in data[1].list" :ismanager="userInfo.customer.UserTypeId == 'manager'" :isgrey="checkCanDo()" :key="index" :data='item' @share='shareCard'></myCard>
62
+                <myCard v-for="(item,index) in data[1].list" :ismanager="userInfo.customer.UserTypeId == 'manager'" :isgrey="checkCanDo()" :key="index" :data='item' @share='shareCard' @detail='toCardNumDetail'></myCard>
63 63
                 <noMore v-if="data[1].hasPic"></noMore>
64 64
               </div>
65 65
             </li>
@@ -74,7 +74,7 @@
74 74
                   </div>
75 75
                   <a @click="toSalesHistory" v-if="userInfo.customer.UserTypeId == 'manager'">销售记录</a>
76 76
                 </div>
77
-                <myCard v-for="(item,index) in data[2].list" :ismanager="userInfo.customer.UserTypeId == 'manager'" :isgrey="checkCanDo()" :key="index" :data='item' @share='shareCoupon'></myCard>
77
+                <myCard v-for="(item,index) in data[2].list" :ismanager="userInfo.customer.UserTypeId == 'manager'" :isgrey="checkCanDo()" :key="index" :data='item' @share='shareCoupon' @detail='toCouponNumDetail'></myCard>
78 78
                 <noMore v-if="data[2].hasPic"></noMore>
79 79
               </div>
80 80
             </li>
@@ -371,6 +371,20 @@ export default {
371 371
       const _that = this
372 372
       return this.forbidList.filter(x => x.UserId === _that.userInfo.customer.MapUser && x.ForbidType === 'coupon').length > 0
373 373
     },
374
+    checkCanOrder () {
375
+      const _that = this
376
+      return this.forbidList.filter(x => x.UserId === _that.userInfo.customer.MapUser && x.ForbidType === 'goods').length > 0
377
+    },
378
+    toCardNumDetail (item) {
379
+      if (this.userInfo.customer.UserTypeId === 'manager') {
380
+        window.location.href = `${this.getUrl('cardAndCouponNum')}?id=${item.CardId}&type=card`
381
+      }
382
+    },
383
+    toCouponNumDetail (item) {
384
+      if (this.userInfo.customer.UserTypeId === 'manager') {
385
+        window.location.href = `${this.getUrl('cardAndCouponNum')}?id=${item.CardId}&type=coupon`
386
+      }
387
+    },
374 388
     returnInvalid (item, type) {
375 389
       for (var n = 0; n < this.forbidList.length; n++) {
376 390
         if (this.forbidList[n].UserId === this.userInfo.customer.CustomerId && this.forbidList[n].ForbidType === type) {
@@ -524,6 +538,10 @@ export default {
524 538
     toOrders (subItem, item) {
525 539
       const _that = this
526 540
       this.getCaseConf({ caseid: subItem.CaseId }).then(res => {
541
+        if (this.checkCanOrder()){
542
+          _that.$toast('您的点单功能已被关闭!')
543
+          return
544
+        }
527 545
         if (res.Status === 1) {
528 546
           this.$router.push({ name: 'placeOrder', query: { tableid: encodeURI(subItem.TableId), tableno: encodeURI(subItem.TableNo), caseid: encodeURI(subItem.CaseId), casename: encodeURI(_that.topCaseInfoData.caseName), areaid: encodeURI(subItem.AreaId), areaname: encodeURI(item.AreaName) } })
529 547
         } else {

+ 1
- 1
src/pages/user/mainPage/userCenter/index.vue Parādīt failu

@@ -110,7 +110,7 @@ export default {
110 110
       this.$router.push({ name: 'orderList' })
111 111
     },
112 112
     toBodyCheck () {
113
-      window.location.href = `${window.location.origin}/c-v2/bodyCheck.html#/`
113
+      window.location.href = `${window.location.origin}/bodyCheck.html#/`
114 114
     },
115 115
     toLuckdraw () {
116 116
       // ^参数约定为97

+ 1
- 1
src/pages/user/majorProjectsDetail/index.vue Parādīt failu

@@ -133,7 +133,7 @@ export default {
133 133
       this.courseDetail.CourseImgs = this.courseDetail.CourseImgs || []
134 134
       this.topImage = this.courseDetail.CourseImgs.length > 0 ? this.courseDetail.CourseImgs[0].ImgUrl : ""
135 135
       if (this.courseDetail.CourseImgs.length > 0) {
136
-        this.detailImage = this.courseDetail.CourseImgs.slice(1)
136
+        this.detailImage = this.courseDetail.CourseImgs
137 137
       }
138 138
       console.log(this.detailImage)
139 139
       this.courseTimeList = arr.sort(function (a, b) { return new Date(a.BeginDate).getTime() > new Date(b.BeginDate).getTime() ? 1 : -1 })

+ 6
- 1
src/pages/user/placeOrder/index.vue Parādīt failu

@@ -266,7 +266,6 @@ export default {
266 266
     },
267 267
     reback () { // 返回桌位选择
268 268
       this.$dialog.confirm({
269
-        title: '提示',
270 269
         message: '返回页面将清空当前选择的商品,确定要返回吗?'
271 270
       }).then(() => {
272 271
         // this.$router.push({ name: 'coffeeIndex' })
@@ -385,3 +384,9 @@ export default {
385 384
 <style lang="scss" scoped>
386 385
 @import 'page.scss';
387 386
 </style>
387
+
388
+<style>
389
+.van-dialog__message {
390
+  text-align: center;
391
+}
392
+</style>

+ 3
- 2
src/pages/user/placeOrderDetail/index.vue Parādīt failu

@@ -130,8 +130,9 @@ export default {
130 130
       // console.log(JSON.stringify(res))
131 131
       var id = JSON.parse(this.$route.query.info)[0].id, arr = [], nowDate = Date.now()
132 132
       for (var n = 0; n < res.length; n++) {
133
+        res[n].Coupon.Targets = res[n].Coupon.Targets || []
133 134
         if (res[n].Coupon.CouponType === 'goods' && res[n].Status === 1) {
134
-          if (res[n].Coupon.IsAll) {
135
+          if (res[n].Coupon.IsAll && nowDate >= new Date(res[n].StartDate).getTime() && nowDate < new Date(res[n].EndDate).getTime()) {
135 136
             this.couponList.push({
136 137
               title: res[n].Coupon.CouponName,
137 138
               desc: res[n].Coupon.Share.UseInstruction,
@@ -241,7 +242,7 @@ export default {
241 242
         // })
242 243
       })
243 244
     },
244
-    
245
+
245 246
     popBack () {
246 247
       this.showSuccessPopup = false
247 248
       window.history.go(-2)

+ 3
- 2
src/pages/user/placeOrderForCourse/index.vue Parādīt failu

@@ -29,7 +29,7 @@
29 29
                   </div>
30 30
                 </div>
31 31
                 <!-- <span v-if="courseTimeList.length">{{returnCourseTime(courseTimeList[0].BeginDate,courseTimeList[0].EndDate)}}</span> -->
32
-                <span v-if="courseTimeList.length">{{toolClass.dateFormat(courseTimeList[0].BeginDate,'yyyy-MM-dd') + ' ~ ' + toolClass.dateFormat(courseTimeList[0].EndDate, 'yyyy-MM-dd')}}</span>
32
+                <span v-if="courseTimeList.length">{{toolClass.dateFormat(courseDetail.BeginDate,'yyyy-MM-dd') + ' ~ ' + toolClass.dateFormat(courseDetail.EndDate, 'yyyy-MM-dd')}}</span>
33 33
               </li>
34 34
               <li class="flex-h">
35 35
                 <div class="flex-item">
@@ -169,8 +169,9 @@ export default {
169 169
         var id = this.$route.query.id, arr = [], nowDate = Date.now()
170 170
         for (var n = 0; n < res.length; n++) {
171 171
           // console.log(res[n])
172
+          res[n].Coupon.Targets = res[n].Coupon.Targets || []
172 173
           if (res[n].Coupon.CouponType === 'course' && res[n].Status === 1) {
173
-            if (res[n].Coupon.IsAll && res[n].CaseId === caseid) {
174
+            if (res[n].Coupon.IsAll && res[n].CaseId === caseid && nowDate > new Date(res[n].StartDate).getTime() && nowDate < new Date(res[n].EndDate).getTime()) {
174 175
               this.couponList.push({
175 176
                 title: res[n].Coupon.CouponName,
176 177
                 desc: res[n].Coupon.Share.UseInstruction,

+ 18
- 7
src/util/ajax.js Parādīt failu

@@ -29,16 +29,16 @@ const Axios = axios.create({
29 29
 
30 30
 Axios.interceptors.request.use((config) => {
31 31
   config.headers.authorization = token()
32
+  // config.urlData = { ...config.urlData,  }
32 33
   // 处理请求data,若为get请求,拼到url后面,若为post请求,直接添加到body中
33
-  config.urlData = { ...config.urlData, org: 'MQ' }
34
+  let urlData = qs.stringify(config.urlData)
34 35
   let queryData = qs.stringify(config.queryData)
35
-  // 判断是通过斜杠传参还是通过query传参
36
+  // 判断是通过斜杠传参
36 37
   if (config.url.indexOf(':') > -1) {
37 38
     if (typeof config.urlData === 'object') {
38
-      config.url = Object.keys(config.urlData).reduce((url, k) => { // 此方法对每个元素进行处理
39
-        const re = new RegExp(`:${k}(?!w)`, 'i')
40
-        return url.replace(re, config.urlData[k])
41
-      }, config.url)
39
+      config.url = replaceURLParams(config.url, config.urlData)
40
+    } else {
41
+      config.url = config.url.slice(0, config.url.indexOf(':')) + urlData
42 42
     }
43 43
   }
44 44
   if (queryData) {
@@ -47,7 +47,9 @@ Axios.interceptors.request.use((config) => {
47 47
   let fm = new FormData()
48 48
   for (let k in config.data) {
49 49
     if (Array.isArray(config.data[k])) {
50
-      fm.append(k, ...config.data[k].map(v => `${k}=${encodeURIComponent(v)}`))
50
+      config.data[k].forEach((v) => {
51
+        fm.append(k, v)
52
+      })
51 53
     } else {
52 54
       fm.append(k, config.data[k])
53 55
     }
@@ -98,3 +100,12 @@ const ajax = (...args) => {
98 100
 }
99 101
 
100 102
 export default ajax
103
+
104
+export function replaceURLParams (url, params) {
105
+  const args = { ...(params || {}), org: 'MQ' }
106
+
107
+  return Object.keys(args).reduce((acc, k) => { // 此方法对每个元素进行处理
108
+    const re = new RegExp(`:${k}(?!w)`, 'i')
109
+    return acc.replace(re, args[k])
110
+  }, url)
111
+}