Explorar o código

Merge branch 'feature_20260509_release环境下window.location.origin跳转方式问题' into uat(dev)

# Conflicts:
#	src/views/deviceWithin/abnormalVisit.vue
zhujindu hai 1 día
pai
achega
b28806685a

+ 3 - 0
src/main.js

@@ -85,6 +85,9 @@ if (isProd) {
   Vue.use(vConsole);
 }
 
+const locationOrigin = process.env.NODE_ENV === 'development' ? '/releaseMobile' : '/mobile';
+Vue.prototype.locationOrigin = locationOrigin;
+
 Vue.use(directive);
 
 new Vue({

+ 2 - 2
src/views/clew/clewent.vue

@@ -568,7 +568,7 @@ export default {
               this.$toast.success('转发成功');
               this.show = false;
               if (this.$route.query.token != undefined) {
-                window.location.replace(window.location.origin + '/mobile/clew');
+                window.location.replace(window.location.origin + this.locationOrigin + '/clew');
               } else {
                 store.dispatch('setRefreshClewPage', true);
                 // 返回上一页不会刷新页面
@@ -779,7 +779,7 @@ export default {
           this.toastLoading().clear();
           if (res.code == 200) {
             if (this.$route.query.token != undefined) {
-              window.location.replace(window.location.origin + '/mobile/clew');
+              window.location.replace(window.location.origin + this.locationOrigin + '/clew');
             } else {
               store.dispatch('setRefreshClewPage', true);
               // 返回上一页不会刷新页面

+ 3 - 3
src/views/clew/complaintDetail/index.vue

@@ -309,7 +309,7 @@ export default {
                 showCancelButton: false,
               })
               .then(() => {
-                window.location.replace(window.location.origin + '/mobile/clew');
+                window.location.replace(window.location.origin + this.locationOrigin + '/clew');
               });
           }
         } else {
@@ -343,7 +343,7 @@ export default {
           this.toastLoading().clear();
           if (res.code == 200) {
             if (this.$route.query.token != undefined) {
-              window.location.replace(window.location.origin + '/mobile/clew');
+              window.location.replace(window.location.origin + this.locationOrigin + '/clew');
             } else {
               store.dispatch('setRefreshClewPage', true);
               // 返回上一页不会刷新页面
@@ -490,7 +490,7 @@ export default {
               this.$toast.success('转发成功');
               this.show = false;
               if (this.$route.query.token != undefined) {
-                window.location.replace(window.location.origin + '/mobile/clew');
+                window.location.replace(window.location.origin + this.locationOrigin + '/clew');
               } else {
                 store.dispatch('setRefreshClewPage', true);
                 // 返回上一页不会刷新页面

+ 68 - 41
src/views/deviceOutside/oderSuccess.vue

@@ -1,72 +1,99 @@
 <template>
   <div>
-    <van-nav-bar class="navBar" title="下单成功"   />
-    <div style="    background-color: rgb(74, 202, 109);
-    color: #fff;
-    width: 132px;
-    height: 132px;
-    border-radius: 106px;
-    text-align: center;
-    line-height: 190px;    margin: 38% auto 80px;">
-      <van-icon name="success"  size="80"/>
+    <van-nav-bar class="navBar" title="下单成功" />
+    <div
+      style="
+        background-color: rgb(74, 202, 109);
+        color: #fff;
+        width: 132px;
+        height: 132px;
+        border-radius: 106px;
+        text-align: center;
+        line-height: 190px;
+        margin: 38% auto 80px;
+      ">
+      <van-icon name="success" size="80" />
     </div>
     <van-row gutter="20" style="text-align: center">
-      <van-col span="12"><van-button icon="home" style="width: 120px" size="small" round  type="primary" @click="goback">去首页</van-button>
+      <van-col span="12"
+        ><van-button
+          icon="home"
+          style="width: 120px"
+          size="small"
+          round
+          type="primary"
+          @click="goback"
+          >去首页</van-button
+        >
       </van-col>
-      <van-col span="12"><van-button icon="guide-o"  style="width: 120px" size="small" round  type="info" @click="visite">继续拜访</van-button></van-col>
+      <van-col span="12"
+        ><van-button
+          icon="guide-o"
+          style="width: 120px"
+          size="small"
+          round
+          type="info"
+          @click="visite"
+          >继续拜访</van-button
+        ></van-col
+      >
     </van-row>
   </div>
 </template>
 
 <script>
-import {addstoreRegister, addVisitsPosition, checkVisit, mobileReposition} from "@/api";
-import axios from "axios";
-import home from "@/assets/Icon/home.png";
-import {getVisitsParams} from "@/api/inventory";
+import { addstoreRegister, addVisitsPosition, checkVisit, mobileReposition } from '@/api';
+import axios from 'axios';
+import home from '@/assets/Icon/home.png';
+import { getVisitsParams } from '@/api/inventory';
 export default {
-  name: "success",
-  data(){
-    return{
-      fromValue:{},
-      home:home,
-    }
+  name: 'success',
+  data() {
+    return {
+      fromValue: {},
+      home: home,
+    };
   },
   created() {
-    this.addstoreRegister()
+    this.addstoreRegister();
   },
   watch: {
     $route(to, from) {
-      if (to.path == "/success") {
-        this.addstoreRegister()
+      if (to.path == '/success') {
+        this.addstoreRegister();
       }
-    }
+    },
   },
   methods: {
     addstoreRegister() {
-      getVisitsParams({storeCode: this.$route.query.storeCode}).then(res => {
-        this.fromValue = res.data
-      })
+      getVisitsParams({ storeCode: this.$route.query.storeCode }).then((res) => {
+        this.fromValue = res.data;
+      });
     },
     goback() {
-      window.location.replace(window.location.origin + "/mobile/")
+      window.location.replace(window.location.origin + this.locationOrigin + '/');
     },
     visite() {
       if (this.fromValue != undefined) {
         if (this.fromValue.url != undefined) {
-          window.location.replace(window.location.origin + "/mobile" + this.fromValue.url)
+          window.location.replace(
+            window.location.origin + this.locationOrigin + this.fromValue.url,
+          );
         } else {
-          this.$dialog.alert({
-            message: "拜访地址有误,请联系管理员!",
-          }).then(() => {
-          });
+          this.$dialog
+            .alert({
+              message: '拜访地址有误,请联系管理员!',
+            })
+            .then(() => {});
         }
       } else {
-        this.$dialog.alert({
-          message: "拜访地址有误,请联系管理员!",
-        }).then(() => {
-        });
+        this.$dialog
+          .alert({
+            message: '拜访地址有误,请联系管理员!',
+          })
+          .then(() => {});
       }
-    }
-  }
-}
+    },
+  },
+};
 </script>

+ 6 - 4
src/views/deviceOutside/outabnormalVisit.vue

@@ -155,7 +155,9 @@ export default {
                   message: '拜访中任务结束成功!',
                 })
                 .then(() => {
-                  window.location.replace(window.location.origin + '/mobile/outsidelist/index');
+                  window.location.replace(
+                    window.location.origin + this.locationOrigin + '/outsidelist/index',
+                  );
                 });
             } else {
               this.$toast(res.msg);
@@ -166,7 +168,7 @@ export default {
     formatter(value) {
       return value.replace(
         /[\uD83C|\uD83D|\uD83E][\uDC00-\uDFFF][\u200D|\uFE0F]|[\uD83C|\uD83D|\uD83E][\uDC00-\uDFFF]|[0-9|*|#]\uFE0F\u20E3|[0-9|#]\u20E3|[\u203C-\u3299]\uFE0F\u200D|[\u203C-\u3299]\uFE0F|[\u2122-\u2B55]|\u303D|[\A9|\AE]\u3030|\uA9|\uAE|\u3030/gi,
-        ''
+        '',
       );
     },
     getPhotoTypeList() {
@@ -263,7 +265,7 @@ export default {
               that.$toast(res.msg);
             }
           });
-        }
+        },
       );
     },
     endVisitsFn() {
@@ -300,7 +302,7 @@ export default {
                 //   window.location.replace(window.location.origin + "/mobile/topStore?info=y")
                 // }else{
                 window.location.replace(
-                  window.location.origin + '/mobile/outsidelist/index?info=y'
+                  window.location.origin + this.locationOrigin + '/outsidelist/index?info=y',
                 );
                 // }
               });

+ 2 - 2
src/views/deviceOutside/suishenbangOutstoreVisit.vue

@@ -679,7 +679,7 @@ export default {
     onClickLeft() {
       localStorage.setItem('getRequestFlage', 'true');
       if (this.$route.query.urltype == 1) {
-        window.location.replace(window.location.origin + '/mobile/home');
+        window.location.replace(window.location.origin + this.locationOrigin + '/home');
       } else {
         this.$router.go(-1);
       }
@@ -752,7 +752,7 @@ export default {
             //   window.location.replace(window.location.origin + '/mobile/topStore?info=y');
             // } else {
             if (this.$route.query.urltype == 1) {
-              window.location.replace(window.location.origin + '/mobile/home');
+              window.location.replace(window.location.origin + this.locationOrigin + '/home');
             } else {
               this.onClickLeft();
               // window.location.replace(

+ 8 - 4
src/views/deviceWithin/abnormalVisit.vue

@@ -164,7 +164,9 @@ export default {
                   message: '拜访中任务结束成功!',
                 })
                 .then(() => {
-                  window.location.replace(window.location.origin + '/mobile/deviceWithin/index');
+                  window.location.replace(
+                    window.location.origin + this.locationOrigin + '/deviceWithin/index',
+                  );
                 });
             } else {
               this.$toast(res.msg);
@@ -175,7 +177,7 @@ export default {
     formatter(value) {
       return value.replace(
         /[\uD83C|\uD83D|\uD83E][\uDC00-\uDFFF][\u200D|\uFE0F]|[\uD83C|\uD83D|\uD83E][\uDC00-\uDFFF]|[0-9|*|#]\uFE0F\u20E3|[0-9|#]\u20E3|[\u203C-\u3299]\uFE0F\u200D|[\u203C-\u3299]\uFE0F|[\u2122-\u2B55]|\u303D|[\A9|\AE]\u3030|\uA9|\uAE|\u3030/gi,
-        ''
+        '',
       );
     },
     getVisitsDetailFn() {
@@ -271,7 +273,7 @@ export default {
               this.$toast(res.msg);
             }
           });
-        }
+        },
       );
     },
     endVisitsFn() {
@@ -311,7 +313,9 @@ export default {
               })
               .then(() => {
                 if (insert) {
-                  window.location.replace(window.location.origin + '/mobile/deviceWithin/index');
+                  window.location.replace(
+                    window.location.origin + this.locationOrigin + '/deviceWithin/index',
+                  );
                 } else {
                   this.$router.go(-1);
                 }

+ 9 - 5
src/views/deviceWithin/storeVisit.vue

@@ -356,7 +356,9 @@ export default {
                   message: '拜访中任务结束成功!',
                 })
                 .then(() => {
-                  window.location.replace(window.location.origin + '/mobile/deviceWithin/index');
+                  window.location.replace(
+                    window.location.origin + this.locationOrigin + '/deviceWithin/index',
+                  );
                 });
             } else {
               this.$toast(res.msg);
@@ -847,7 +849,7 @@ export default {
     onClickLeft() {
       localStorage.setItem('getRequestFlage', 'true');
       if (this.$route.query.urltype == 2) {
-        window.location.replace(window.location.origin + '/mobile/home');
+        window.location.replace(window.location.origin + this.locationOrigin + '/home');
       } else {
         this.$router.go(-1);
       }
@@ -914,7 +916,7 @@ export default {
             if (res.code == 200) {
               this.editDwellTimes();
               if (this.$route.query.urltype == 2) {
-                window.location.replace(window.location.origin + '/mobile/home');
+                window.location.replace(window.location.origin + this.locationOrigin + '/home');
               } else {
                 this.$router.go(-1);
                 // window.location.replace(window.location.origin + '/mobile/deviceWithin/index');
@@ -941,9 +943,11 @@ export default {
             loading1.clear();
             if (res.code == 200) {
               if (this.$route.query.urltype == 2) {
-                window.location.replace(window.location.origin + '/mobile/home');
+                window.location.replace(window.location.origin + this.locationOrigin + '/home');
               } else {
-                window.location.replace(window.location.origin + '/mobile/historAllVisit');
+                window.location.replace(
+                  window.location.origin + this.locationOrigin + '/historAllVisit',
+                );
               }
             } else {
               this.$toast({

+ 2 - 1
src/views/storeManagement/storeAdd.vue

@@ -1991,7 +1991,8 @@ export default {
                       localStorage.setItem('chainNameR', res.data.sfaStore.storeName);
                       window.location.replace(
                         window.location.origin +
-                          '/mobile/suishenbangOutstoreVisit?PointSum=0&visitModel=1&tabVal=1&hisTime=null&pageType=out&visitId=null&rdId=null&storeId=' +
+                          this.locationOrigin +
+                          '/suishenbangOutstoreVisit?PointSum=0&visitModel=1&tabVal=1&hisTime=null&pageType=out&visitId=null&rdId=null&storeId=' +
                           res.data.sfaStore.storeId +
                           '&lat=' +
                           this.fromValue.lat +

+ 12 - 9
src/views/storeManagement/success.vue

@@ -90,7 +90,7 @@ export default {
       });
     },
     goback() {
-      window.location.replace(window.location.origin + '/mobile/My/index');
+      window.location.replace(window.location.origin + this.locationOrigin + '/My/index');
     },
     // 返回订单详情也
     gobackStoreDetail() {
@@ -100,7 +100,7 @@ export default {
       localStorage.setItem('successStoreId', this.fromValue.storeId);
       // 跳转到列表在跳到详情页在跳编辑页
       window.location.replace(
-        window.location.origin + '/mobile/storemanagementlist?source=successPage'
+        window.location.origin + this.locationOrigin + '/storemanagementlist?source=successPage',
       );
     },
     visite() {
@@ -204,7 +204,7 @@ export default {
                                     location.lat,
                                     location.lon,
                                     location.lat,
-                                    location.lon
+                                    location.lon,
                                   )
                                   .toFixed(2);
                                 that.$dialog
@@ -215,7 +215,8 @@ export default {
                                   .then(() => {
                                     window.location.replace(
                                       window.location.origin +
-                                        '/mobile/suishenbangOutstoreVisit?PointSum=' +
+                                        this.locationOrigin +
+                                        '/suishenbangOutstoreVisit?PointSum=' +
                                         PointSumval +
                                         '&visitModel=1&tabVal=1&hisTime=null&pageType=out&visitId=null&rdId=null&storeId=' +
                                         that.fromValue.storeId +
@@ -240,7 +241,7 @@ export default {
                                         '&marklat=' +
                                         res.latitude +
                                         '&marklon=' +
-                                        res.longitude
+                                        res.longitude,
                                     );
                                   });
                                 localStorage.setItem('startTime', new Date());
@@ -266,7 +267,8 @@ export default {
                           .then(() => {
                             window.location.replace(
                               window.location.origin +
-                                '/mobile/suishenbangOutstoreVisit?PointSum=' +
+                                this.locationOrigin +
+                                '/suishenbangOutstoreVisit?PointSum=' +
                                 PointSumval +
                                 '&visitModel=1&tabVal=1&hisTime=null&pageType=out&visitId=null&rdId=null&storeId=' +
                                 that.fromValue.storeId +
@@ -291,14 +293,15 @@ export default {
                                 '&marklat=' +
                                 res.latitude +
                                 '&marklon=' +
-                                res.longitude
+                                res.longitude,
                             );
                           })
                           .catch(() => {});
                       } else {
                         window.location.replace(
                           window.location.origin +
-                            '/mobile/suishenbangOutstoreVisit?PointSum=0&visitModel=1&tabVal=1&hisTime=null&pageType=out&visitId=null&rdId=null&storeId=' +
+                            this.locationOrigin +
+                            '/suishenbangOutstoreVisit?PointSum=0&visitModel=1&tabVal=1&hisTime=null&pageType=out&visitId=null&rdId=null&storeId=' +
                             that.fromValue.storeId +
                             '&lat=' +
                             that.fromValue.lat +
@@ -321,7 +324,7 @@ export default {
                             '&marklat=' +
                             res.latitude +
                             '&marklon=' +
-                            res.longitude
+                            res.longitude,
                         );
                       }
                       localStorage.setItem('startTime', new Date());

+ 3 - 3
src/views/week/assignAwait/JZfollowUp.vue

@@ -181,7 +181,7 @@ export default {
                 showCancelButton: false,
               })
               .then(() => {
-                window.location.replace(window.location.origin + '/mobile/clew');
+                window.location.replace(window.location.origin + this.locationOrigin + '/clew');
               });
           }
         } else {
@@ -226,7 +226,7 @@ export default {
             this.toastLoading().clear();
             if (res.code == 200) {
               this.$toast(res.msg);
-              window.location.replace(window.location.origin + '/mobile/clew');
+              window.location.replace(window.location.origin + this.locationOrigin + '/clew');
             } else {
               this.$toast(res.msg);
             }
@@ -260,7 +260,7 @@ export default {
           this.toastLoading().clear();
           if (res.code == 200) {
             if (this.$route.query.token != undefined) {
-              window.location.replace(window.location.origin + '/mobile/clew');
+              window.location.replace(window.location.origin + this.locationOrigin + '/clew');
             } else {
               store.dispatch('setRefreshClewPage', true);
               // 返回上一页不会刷新页面

+ 6 - 4
src/views/week/assignAwait/assignPage.vue

@@ -157,7 +157,7 @@ export default {
               let userList = res.data.userList;
               if (this.assignTypeValue != '大型装企') {
                 let userListFilter = userList.filter(
-                  (item) => item.nickName.indexOf(this.infoData.companyName) != -1
+                  (item) => item.nickName.indexOf(this.infoData.companyName) != -1,
                 );
                 this.assignUserData = userListFilter || [];
               } else {
@@ -205,7 +205,7 @@ export default {
             let userList = res.data.userList;
             if (this.assignTypeValue != '大型装企') {
               let userListFilter = userList.filter(
-                (item) => item.nickName.indexOf(this.infoData.companyName) != -1
+                (item) => item.nickName.indexOf(this.infoData.companyName) != -1,
               );
               this.assignUserData = userListFilter || [];
             } else {
@@ -251,7 +251,9 @@ export default {
                 showCancelButton: false,
               })
               .then(() => {
-                window.location.replace(window.location.origin + '/mobile/assignAwait');
+                window.location.replace(
+                  window.location.origin + this.locationOrigin + '/assignAwait',
+                );
               });
           }
           this.getDictOptionFun();
@@ -270,7 +272,7 @@ export default {
         this.toastLoading().clear();
         if (res.code == 200) {
           this.$toast(res.msg);
-          window.location.replace(window.location.origin + '/mobile/assignAwait');
+          window.location.replace(window.location.origin + this.locationOrigin + '/assignAwait');
         } else {
           this.$toast(res.msg);
         }

+ 5 - 3
src/views/week/daily.vue

@@ -323,7 +323,7 @@ export default {
                 message: '日报已提交或过期',
               })
               .then(() => {
-                window.location.replace(window.location.origin + '/mobile/home');
+                window.location.replace(window.location.origin + this.locationOrigin + '/home');
               });
           } else {
             this.homePageIndicatorList = res.data.homePageIndicatorList;
@@ -524,7 +524,7 @@ export default {
               })
               .catch(() => {
                 if (this.$route.query.reportId != undefined) {
-                  window.location.replace(window.location.origin + '/mobile/home');
+                  window.location.replace(window.location.origin + this.locationOrigin + '/home');
                 } else {
                   this.onClickLeft();
                 }
@@ -537,7 +537,9 @@ export default {
               })
               .then(() => {
                 if (this.$route.query.reportId != undefined) {
-                  window.location.replace(window.location.origin + '/mobile/myHistoricalDaily');
+                  window.location.replace(
+                    window.location.origin + this.locationOrigin + '/myHistoricalDaily',
+                  );
                 } else {
                   this.onClickLeft();
                 }

+ 7 - 3
src/views/week/dailyApproval.vue

@@ -279,7 +279,9 @@ export default {
               message: '提交成功',
             })
             .then(() => {
-              window.location.replace(window.location.origin + '/mobile/dailyApprovalList');
+              window.location.replace(
+                window.location.origin + this.locationOrigin + '/dailyApprovalList',
+              );
             });
         } else {
           this.$toast.fail(res.msg);
@@ -318,7 +320,9 @@ export default {
               message: '提交成功',
             })
             .then(() => {
-              window.location.replace(window.location.origin + '/mobile/dailyApprovalList');
+              window.location.replace(
+                window.location.origin + this.locationOrigin + '/dailyApprovalList',
+              );
             });
         } else {
           this.$toast.fail(res.msg);
@@ -354,7 +358,7 @@ export default {
                 message: '日报已审批',
               })
               .then(() => {
-                window.location.replace(window.location.origin + '/mobile/home');
+                window.location.replace(window.location.origin + this.locationOrigin + '/home');
               });
           } else {
             this.reportTargetAll = res.data.reportTargetAll;

+ 4 - 2
src/views/week/doubleWeekly.vue

@@ -243,7 +243,7 @@ export default {
                 message: '半月报已提交或过期',
               })
               .then(() => {
-                window.location.replace(window.location.origin + '/mobile/home');
+                window.location.replace(window.location.origin + this.locationOrigin + '/home');
               });
           } else {
             this.homePageIndicatorList = res.data.homePageIndicatorList || null;
@@ -536,7 +536,9 @@ export default {
             })
             .then(() => {
               if (this.$route.query.reportId != undefined) {
-                window.location.replace(window.location.origin + '/mobile/myHistoricalDaily');
+                window.location.replace(
+                  window.location.origin + this.locationOrigin + '/myHistoricalDaily',
+                );
               } else {
                 this.onClickLeft();
                 // window.location.replace(window.location.origin + '/mobile/home');

+ 7 - 3
src/views/week/doubleWeeklyApproval.vue

@@ -242,7 +242,9 @@ export default {
               message: '提交成功',
             })
             .then(() => {
-              window.location.replace(window.location.origin + '/mobile/dailyApprovalList');
+              window.location.replace(
+                window.location.origin + this.locationOrigin + '/dailyApprovalList',
+              );
             });
         } else {
           this.$toast.fail(res.msg);
@@ -280,7 +282,9 @@ export default {
               message: '提交成功',
             })
             .then(() => {
-              window.location.replace(window.location.origin + '/mobile/dailyApprovalList');
+              window.location.replace(
+                window.location.origin + this.locationOrigin + '/dailyApprovalList',
+              );
             });
         } else {
           this.$toast.fail(res.msg);
@@ -303,7 +307,7 @@ export default {
                 message: '半月报已审批',
               })
               .then(() => {
-                window.location.replace(window.location.origin + '/mobile/home');
+                window.location.replace(window.location.origin + this.locationOrigin + '/home');
               });
           } else {
             this.homePageIndicatorList = res.data.homePageIndicatorList;

+ 4 - 2
src/views/week/weekly.vue

@@ -282,7 +282,7 @@ export default {
                 message: '周报已提交或过期',
               })
               .then(() => {
-                window.location.replace(window.location.origin + '/mobile/home');
+                window.location.replace(window.location.origin + this.locationOrigin + '/home');
               });
           } else {
             this.reportTarget = res.data;
@@ -560,7 +560,9 @@ export default {
             })
             .then(() => {
               if (this.$route.query.reportId != undefined) {
-                window.location.replace(window.location.origin + '/mobile/myHistoricalDaily');
+                window.location.replace(
+                  window.location.origin + this.locationOrigin + '/myHistoricalDaily',
+                );
               } else {
                 this.onClickLeft();
                 // window.location.replace(window.location.origin + '/mobile/home');

+ 7 - 3
src/views/week/weeklyApproval.vue

@@ -288,7 +288,9 @@ export default {
               message: '提交成功',
             })
             .then(() => {
-              window.location.replace(window.location.origin + '/mobile/dailyApprovalList');
+              window.location.replace(
+                window.location.origin + this.locationOrigin + '/dailyApprovalList',
+              );
             });
         } else {
           this.$toast.fail(res.msg);
@@ -326,7 +328,9 @@ export default {
               message: '保存成功',
             })
             .then(() => {
-              window.location.replace(window.location.origin + '/mobile/dailyApprovalList');
+              window.location.replace(
+                window.location.origin + this.locationOrigin + '/dailyApprovalList',
+              );
             });
         } else {
           this.$toast.fail(res.msg);
@@ -365,7 +369,7 @@ export default {
                 message: '周报已提交或过期',
               })
               .then(() => {
-                window.location.replace(window.location.origin + '/mobile/home');
+                window.location.replace(window.location.origin + this.locationOrigin + '/home');
               });
           } else {
             this.reportTargetAll = res.data.reportTargetAll;