Эх сурвалжийг харах

mapGetters 改为 mapState

John-Hong 2 жил өмнө
parent
commit
9b7b2fe045
29 өөрчлөгдсөн 73 нэмэгдсэн , 68 устгасан
  1. 4 3
      src/App.vue
  2. 2 2
      src/components/authorize/authorize.vue
  3. 2 2
      src/components/info/blue-perfectinfo.vue
  4. 2 2
      src/components/label-tip/index.vue
  5. 2 2
      src/components/simple-address/simple-address.vue
  6. 2 2
      src/components/uni-popup/uni-popup-dialog.vue
  7. 2 2
      src/pages/login/login.vue
  8. 17 12
      src/pages/parkingFee/parkingFee.vue
  9. 2 2
      src/pages/parkingFee/parkingFeeCoupon.vue
  10. 2 2
      src/pages/parkingFee/parkingFeeDetail.vue
  11. 2 2
      src/pages/parkingFee/parkingFeeDetailSuccess.vue
  12. 2 2
      src/pages/parkingFee/parkingFeeDiscounts.vue
  13. 2 2
      src/pages/parkingFee/parkingFeeHint/parkingFeeHint.vue
  14. 2 2
      src/pages/parkingFee/parkingFeeList.vue
  15. 2 2
      src/pages/parkingFee/parkingFeePaperCoupon.vue
  16. 2 2
      src/pages/parkingFee/parkingFeePayment.vue
  17. 2 2
      src/pages/parkingFee/parkingFeeSuccess.vue
  18. 2 2
      src/pages/parkingFee/parkingReceipt/parkingApplication.vue
  19. 2 2
      src/pages/parkingFee/parkingReceipt/parkingChangeHeader.vue
  20. 2 2
      src/pages/parkingFee/parkingReceipt/parkingChooseHeader.vue
  21. 2 2
      src/pages/parkingFee/parkingReceipt/parkingInvoice.vue
  22. 2 2
      src/pages/parkingFee/parkingReceipt/parkingInvoiceApply.vue
  23. 2 2
      src/pages/parkingFee/parkingReceipt/parkingInvoiceImage.vue
  24. 2 2
      src/pages/parkingFee/parkingReceipt/parkingReceipt.vue
  25. 2 2
      src/pages/parkingFee/vehicleAddOrEdit.vue
  26. 2 2
      src/pages/parkingFee/vehicleManagement.vue
  27. 2 2
      src/pages/pointsMall/pointsMall.vue
  28. 2 2
      src/pages/pointsMall/pointsSuccess.vue
  29. 0 1
      src/utils/uniHooks.js

+ 4 - 3
src/App.vue

@@ -15,7 +15,7 @@ import Stomp from '@/lib/stompjs/index';
 import { Encrypt, Decrypt } from '@/utils/crypto';
 import CacheTool from '@/utils/cache-tool';
 import uni from '@/utils/uniHooks';
-import { mapGetters } from 'vuex';
+import { mapState } from 'vuex';
 import { initWxJsSdkConfig } from '@/utils/login.js';
 import { getUrlParams, getPlatform } from '@/utils/index.js';
 // import qs from 'qs';
@@ -42,7 +42,7 @@ export default {
     disabledBtn() {
       return this.numArr.findIndex((val) => !val) !== -1;
     },
-    ...mapGetters({
+    ...mapState({
       groupId: (state) => state.groupId,
       openid: (state) => state.openid,
       mallId: (state) => state.mallId,
@@ -62,7 +62,7 @@ export default {
       const platform = getPlatform();
       this.$store.commit('SET_GROUP_ID', query.groupId);
       this.$store.commit('SET_MALL_ID', query.mallid);
-      console.log(65, kipAccessToken);
+      // console.log(65, kipAccessToken);
       // TODO true 需要取消
       if (platform === 'micromessenger' && !kipAccessToken) {
         // 如果用户没有登录的话,我们需要让用户完成授权拿到 openid
@@ -87,6 +87,7 @@ export default {
           });
         return;
       }
+      this.isInit = true;
       // 如果用已经登录
       if (platform === 'micromessenger' && kipAccessToken) {
         this.$router.replace({

+ 2 - 2
src/components/authorize/authorize.vue

@@ -266,7 +266,7 @@
  const app = {}
 	var self;
 	import uniPop from '@/components/uni-popup/uni-popup.vue'
-	import { mapGetters } from "vuex";
+	import { mapState } from "vuex";
   import uni from '@/utils/uniHooks'
   import {
 		getLogoByBrand,
@@ -335,7 +335,7 @@
 			// self.isComfirHz = uni.getStorageSync('comfirHangzhou');
 		},
 		computed: {
-			...mapGetters({
+			...mapState({
 				custTypeId: state => state.custTypeId
 			}),
 			getLogo () {

+ 2 - 2
src/components/info/blue-perfectinfo.vue

@@ -61,7 +61,7 @@
 	// const app = getApp()
  const app = {}
 	import simpleAddress from '@/components/simple-address/simple-address.vue';
-  import { mapGetters } from 'vuex'
+  import { mapState } from 'vuex'
 	import MemberCacheTool from '@/utils/member-cache-tool.js'
 	import {
 		kipGetUserDetail,
@@ -86,7 +86,7 @@
 			}
 		},
         computed: {
-            ...mapGetters({
+            ...mapState({
                 custTypeId: state => state.custTypeId
             }),
             startDate() {

+ 2 - 2
src/components/label-tip/index.vue

@@ -10,7 +10,7 @@
 </template>
 
 <script>
-import { mapGetters } from 'vuex'
+import { mapState } from 'vuex'
 import sellOut from '@/pages/pointsMall/static/images/sellOut.png'
 import toSell from '@/pages/pointsMall/static/images/toSell.png'
 export default {
@@ -31,7 +31,7 @@ export default {
 			 }
     },
     computed: {
-			...mapGetters({
+			...mapState({
 				custTypeId: state => state.custTypeId
 			}),
 			imgUrl() { // 通过条件来改变遮罩图

+ 2 - 2
src/components/simple-address/simple-address.vue

@@ -81,7 +81,7 @@
 import provinceData from './city-data/province.js';
 import cityData from './city-data/city.js';
 import areaData from './city-data/area.js';
-import { mapGetters } from "vuex";
+import { mapState } from "vuex";
 export default {
 	name: 'simpleAddress',
 	props: {
@@ -180,7 +180,7 @@ export default {
 		}
 	},
 	computed: {
-		...mapGetters({
+		...mapState({
 			custTypeId: state => state.custTypeId
 		})
 	},

+ 2 - 2
src/components/uni-popup/uni-popup-dialog.vue

@@ -65,7 +65,7 @@
  * @event {Function} confirm 点击确认按钮触发
  * @event {Function} close 点击取消按钮触发
  */
-import { mapGetters } from 'vuex';
+import { mapState } from 'vuex';
 export default {
   name: 'uniPopupDialog',
   props: {
@@ -135,7 +135,7 @@ export default {
     },
   },
   computed: {
-    ...mapGetters({
+    ...mapState({
       custTypeId: (state) => state.custTypeId,
     }),
   },

+ 2 - 2
src/pages/login/login.vue

@@ -153,7 +153,7 @@ import {
   crmSaveMemberSource,
 } from '@/utils/api-crm-member.js';
 // var app = getApp()
-import { mapGetters } from 'vuex';
+import { mapState } from 'vuex';
 import { getUTMSource } from '@/utils/utils.js';
 import CacheTool from '@/utils/cache-tool.js';
 
@@ -187,7 +187,7 @@ export default {
     uni.setStorageSync('previousUrl', '/pages/wxLogin/login.vue');
   },
   computed: {
-    ...mapGetters({
+    ...mapState({
       custTypeId: (state) => state.custTypeId,
       mallid: (state) => state.mallId,
       groupId: (state) => state.groupId,

+ 17 - 12
src/pages/parkingFee/parkingFee.vue

@@ -207,7 +207,7 @@
 // import authorize from '../../components/authorize/authorize.vue';
 import plateNumber from '../../components/plate-number/plateNumber.vue';
 import { REG_SOURCE } from '@/constants';
-import { mapGetters } from 'vuex';
+import { mapState } from 'vuex';
 import MemberCacheTool from '../../utils/member-cache-tool.js';
 import { Decrypt, Encrypt } from '@/utils/crypto.js';
 // import ws from '@/utils/websocket';
@@ -256,14 +256,14 @@ export default {
     disabledBtn() {
       return this.numArr.findIndex((val) => !val) !== -1;
     },
-    ...mapGetters([
-      'groupId',
-      'openid',
-      'mallId',
-      'kipUserId',
-      'userInfo',
-      'member',
-    ]),
+    ...mapState({
+      groupId: (state) => state.groupId,
+      openid: (state) => state.openid,
+      mallId: (state) => state.mallId,
+      kipUserId: (state) => state.kipUserId,
+      userInfo: (state) => state.userInfo,
+      member: (state) => state.member,
+    }),
     /* groupId: (state) => state.groupId,
       openid: (state) => state.openid,
       mallId: (state) => state.mallId,
@@ -283,6 +283,7 @@ export default {
         title: '临时停车',
       });
     }, 300);
+    console.log(286, this.openid);
     // this.getParkInfo();
     if (this.openid) {
       // this.openId = this.openid;
@@ -376,8 +377,10 @@ export default {
       });
       const openid = uni.getStorageSync('openid') || this.openId;
       let params = {
-        mallid: '8a84853b7c91ac5b017c961a9b2a030d',
-        groupId: '8a84853b7c91ac5b017c962dab55030e',
+        // mallid: '8a84853b7c91ac5b017c961a9b2a030d',
+        // groupId: '8a84853b7c91ac5b017c962dab55030e',
+        mallid: this.mallId,
+        groupId: this.groupId,
         openid: openid,
         // vipcode: app.globalData.member.vipcode
       };
@@ -511,6 +514,8 @@ export default {
       uni.showLoading({
         title: '加载中',
       });
+      console.log(514, this.userInfo);
+      return;
       const params = {
         carno,
         mallid: this.mallId,
@@ -543,7 +548,7 @@ export default {
         // url: 'http://172.21.90.87:8083/xcrm-api/api/1.0/park/checkCarIsInParkAndCarFee',
         data: params,
         method: 'POST',
-        header: JSON.parse(uni.getStorageSync('handleUser')),
+        header: uni.getStorageSync('handleUser'),
         timeout: 10000,
       })
         .then((res) => {

+ 2 - 2
src/pages/parkingFee/parkingFeeCoupon.vue

@@ -43,7 +43,7 @@
 </template>
 
 <script>
-import { mapGetters } from 'vuex'
+import { mapState } from 'vuex'
 export default {
   onLoad() {
     // 纸质优惠券
@@ -166,7 +166,7 @@ export default {
       }
       return total;
     },
-    ...mapGetters({
+    ...mapState({
       custTypeId: state => state.custTypeId
     })
   },

+ 2 - 2
src/pages/parkingFee/parkingFeeDetail.vue

@@ -262,7 +262,7 @@
 // const app = getApp()
 const app = {};
 import moment from 'moment';
-import { mapGetters } from 'vuex';
+import { mapState } from 'vuex';
 import MemberCacheTool from '@/utils/member-cache-tool.js';
 import log from '@/utils/log.js';
 import { compare } from '@/utils/location.js';
@@ -438,7 +438,7 @@ export default {
         member: this.member,
       };
     },
-    ...mapGetters({
+    ...mapState({
       custTypeId: (state) => state.custTypeId,
       // paramsScene: (state) => state.paramsScene,
       mallid: (state) => state.mallId,

+ 2 - 2
src/pages/parkingFee/parkingFeeDetailSuccess.vue

@@ -122,7 +122,7 @@
  const app = {};
 import moment from "moment";
 // import {detail as mockDetail, detailError as mockDetailSuccess} from './list'
-import { mapGetters } from 'vuex'
+import { mapState } from 'vuex'
 import uni from '@/utils/uniHooks'
 export default {
   data() {
@@ -158,7 +158,7 @@ export default {
       }
       return `${minutes}分钟`;
     },
-    ...mapGetters({
+    ...mapState({
       // custTypeId: (state) => state.custTypeId,
       // paramsScene: (state) => state.paramsScene,
       // mallid: (state) => state.mallId,

+ 2 - 2
src/pages/parkingFee/parkingFeeDiscounts.vue

@@ -47,7 +47,7 @@
 </template>
 
 <script>
-import { mapGetters } from 'vuex';
+import { mapState } from 'vuex';
 import uniNumberBox from '@/components/uni-number-box/uni-number-box.vue';
 import uni from '@/utils/uniHooks';
 // const app = getApp()
@@ -299,7 +299,7 @@ export default {
       }
       return total;
     },
-    ...mapGetters({
+    ...mapState({
       custTypeId: state => state.custTypeId,
       groupId: state => state.groupId,
     })

+ 2 - 2
src/pages/parkingFee/parkingFeeHint/parkingFeeHint.vue

@@ -24,7 +24,7 @@
 </template>
 
 <script>
-import { mapGetters } from 'vuex';
+import { mapState } from 'vuex';
 // const app = getApp()
 const app = {};
 export default {
@@ -39,7 +39,7 @@ export default {
     };
   },
   computed: {
-    ...mapGetters({
+    ...mapState({
       custTypeId: (state) => state.custTypeId,
     }),
   },

+ 2 - 2
src/pages/parkingFee/parkingFeeList.vue

@@ -65,7 +65,7 @@ let canloading = true;
 let pageNum = 1;
 import moment from 'moment';
 // import authorize from '@/components/authorize/authorize.vue';
-import { mapGetters } from 'vuex';
+import { mapState } from 'vuex';
 // import {data as mockData} from './list'
 
 export default {
@@ -78,7 +78,7 @@ export default {
     };
   },
   computed: {
-    ...mapGetters({
+    ...mapState({
       mallId: (state) => state.mallId,
       openId: (state) => state.openid,
       member: (state) => state.member,

+ 2 - 2
src/pages/parkingFee/parkingFeePaperCoupon.vue

@@ -41,7 +41,7 @@
 import uni from '@/utils/uniHooks'
 // const app = getApp()
 const app = {};
-import { mapGetters } from 'vuex';
+import { mapState } from 'vuex';
 import fuiToast from "@/components/fui-toast/fui-toast.vue";
 
 export default {
@@ -102,7 +102,7 @@ export default {
     }
   },
   computed: {
-    ...mapGetters({
+    ...mapState({
       custTypeId: state => state.custTypeId
     }),
     // 实际支付金额

+ 2 - 2
src/pages/parkingFee/parkingFeePayment.vue

@@ -12,7 +12,7 @@
 </template>
 
 <script>
-import { mapGetters } from 'vuex'
+import { mapState } from 'vuex'
 export default {
   created() {
     const params = this.$route.query;
@@ -28,7 +28,7 @@ export default {
     }
   },
   computed: {
-    ...mapGetters({
+    ...mapState({
       custTypeId: state => state.custTypeId
     })
   },

+ 2 - 2
src/pages/parkingFee/parkingFeeSuccess.vue

@@ -11,7 +11,7 @@
 
 <script>
 	import payIcon from './static/images/hint.png';
-	import { mapGetters } from 'vuex';
+	import { mapState } from 'vuex';
 	export default {
 		onLoad(params) {
 			const parkInfo = JSON.parse(uni.getStorageSync('parkinfo'));
@@ -29,7 +29,7 @@
 			}
 		},
 		computed: {
-			...mapGetters({
+			...mapState({
 				custTypeId: state => state.custTypeId
 			}),
 			icon() {

+ 2 - 2
src/pages/parkingFee/parkingReceipt/parkingApplication.vue

@@ -136,7 +136,7 @@
 // const app = getApp()
 const app = {}
 import arrowIcon from '../static/images/arrows.png'
-import { mapGetters } from 'vuex'
+import { mapState } from 'vuex'
 import MemberCacheTool from '@/utils/member-cache-tool.js'
 import uni from '@/utils/uniHooks'
 export default {
@@ -219,7 +219,7 @@ export default {
     }
   },
   computed: {
-    ...mapGetters({
+    ...mapState({
       custTypeId: (state) => state.custTypeId,
       groupId: (state) => state.groupId,
       openid: (state) => state.openid,

+ 2 - 2
src/pages/parkingFee/parkingReceipt/parkingChangeHeader.vue

@@ -125,7 +125,7 @@
 <script>
 // const app = getApp()
 const app = {}
-import { mapGetters } from 'vuex'
+import { mapState } from 'vuex'
 import MemberCacheTool from '@/utils/member-cache-tool.js'
 import uni from '@/utils/uniHooks'
 
@@ -166,7 +166,7 @@ export default {
     isCompany: function () {
       return this.condition.invoiceTitleType == 0
     },
-    ...mapGetters({
+    ...mapState({
       custTypeId: ( state ) => state.custTypeId,
       member: ( state ) => state.member,
       openid: ( state ) => state.openid,// |String|是|openid

+ 2 - 2
src/pages/parkingFee/parkingReceipt/parkingChooseHeader.vue

@@ -81,7 +81,7 @@
 import editwIcon from '../static/images/edit.png'
 import delwIcon from '../static/images/delete.png'
 import noDataIcon from '../static/images/nodataicon.png'
-import { mapGetters } from 'vuex'
+import { mapState } from 'vuex'
 
 export default {
   data() {
@@ -121,7 +121,7 @@ export default {
     prePage.$vm.pageOptions = options
   },
   computed: {
-    ...mapGetters({
+    ...mapState({
       custTypeId: (state) => state.custTypeId,
     }),
   },

+ 2 - 2
src/pages/parkingFee/parkingReceipt/parkingInvoice.vue

@@ -66,7 +66,7 @@
 const app = {};
 import downloadBtnIcon from '../static/images/download.png';
 import arrowIcon from '../static/images/arrows.png';
-import { mapGetters } from 'vuex';
+import { mapState } from 'vuex';
 import uni from '@/utils/uniHooks'
 export default {
   data() {
@@ -95,7 +95,7 @@ export default {
     this.getInvoicedDetail(this.id);
   },
   computed: {
-    ...mapGetters({
+    ...mapState({
       custTypeId: (state) => state.custTypeId,
     }),
   },

+ 2 - 2
src/pages/parkingFee/parkingReceipt/parkingInvoiceApply.vue

@@ -17,7 +17,7 @@
 // const app = getApp()
 const app = {};
 import hintIcon from '../static/images/hint.png';
-import { mapGetters } from 'vuex'
+import { mapState } from 'vuex'
 
 export default {
   data() {
@@ -35,7 +35,7 @@ export default {
     this.getInvoicedDetail(this.id);
   },
   computed: {
-    ...mapGetters({
+    ...mapState({
       custTypeId: state => state.custTypeId
     }),
     icon() {

+ 2 - 2
src/pages/parkingFee/parkingReceipt/parkingInvoiceImage.vue

@@ -37,7 +37,7 @@
 // const app = getApp()
  const app = {}
 import downloadBtnIcon from '../static/images/download.png'
-import { mapGetters } from 'vuex'
+import { mapState } from 'vuex'
 import uni from '@/utils/uniHooks'
 export default {
   data() {
@@ -78,7 +78,7 @@ export default {
     }
   },
   computed: {
-    ...mapGetters({
+    ...mapState({
       custTypeId: (state) => state.custTypeId,
     }),
   },

+ 2 - 2
src/pages/parkingFee/parkingReceipt/parkingReceipt.vue

@@ -96,7 +96,7 @@ const app = {}
 import moment from 'moment'
 import arrowIcon from '../static/images/arrows.png'
 import noData from '@/static/images/parkingReceipt-noData.png'
-import { mapGetters } from 'vuex'
+import { mapState } from 'vuex'
 // import authorize from '@/components/authorize/authorize.vue'
 import MemberCacheTool from '@/utils/member-cache-tool.js'
 import { REG_SOURCE } from '@/constants.js'
@@ -134,7 +134,7 @@ export default {
     height() {
       return this.list.length ? 'auto' : '100%'
     },
-    ...mapGetters({
+    ...mapState({
       custTypeId: (state) => state.custTypeId,
       mallId: (state) => state.mallId,
       openId: (state) => state.openid,

+ 2 - 2
src/pages/parkingFee/vehicleAddOrEdit.vue

@@ -154,7 +154,7 @@ import {
   kipAddMemberVehicles,
   kipModifyMemberVehicles,
 } from '@/utils/api-kip.js';
-import { mapGetters } from 'vuex';
+import { mapState } from 'vuex';
 
 export default {
   components: {
@@ -192,7 +192,7 @@ export default {
       console.log(190, this.numArr, this.numArr.findIndex((val) => !val));
       return this.numArr.findIndex((val) => !val) !== -1;
     },
-    ...mapGetters({
+    ...mapState({
       custTypeId: (state) => state.custTypeId, // custTypeId: 0 默认版本,1 上海静安 2 上海浦东
     }),
   },

+ 2 - 2
src/pages/parkingFee/vehicleManagement.vue

@@ -127,7 +127,7 @@ import {
   kipDeleteMemberVehicles,
 } from '@/utils/api-kip.js';
 import { LICENSE_PLATE_TYPE_ARR } from '@/constants.js';
-import { mapGetters } from 'vuex';
+import { mapState } from 'vuex';
 // import authorize from '@/components/authorize/authorize.vue';
 import { isCruMarketByKey } from '@/utils/location-util.js';
 import MemberCacheTool from '@/utils/member-cache-tool.js';
@@ -141,7 +141,7 @@ export default {
     // authorize,
   },
   computed: {
-    ...mapGetters({
+    ...mapState({
       custTypeId: (state) => state.custTypeId,
       member: (state) => state.member,
       groupId: (state) => state.groupId,

+ 2 - 2
src/pages/pointsMall/pointsMall.vue

@@ -610,7 +610,7 @@ import toSell from '@/static/images/pointsMail/toSell.png'
 import noTickets from './static/images/noTickets.png'
 const noProductImg = `/20210908/d83c7ae2db704b7c986534c12b8b134e.png`
 import labelTip from '@/components/label-tip/index'
-import { mapGetters } from 'vuex'
+import { mapState } from 'vuex'
 import { REG_SOURCE } from '@/constants.js'
 export default {
   data() {
@@ -683,7 +683,7 @@ export default {
   },
   computed: {
     // custTypeId: 0 默认版本,1 上海静安 2 上海浦东
-    ...mapGetters({
+    ...mapState({
       custTypeId: (state) => state.custTypeId,
     }),
   },

+ 2 - 2
src/pages/pointsMall/pointsSuccess.vue

@@ -43,7 +43,7 @@
     import pointSuccess from '../parkingFee/static/images/hint.png';
     import pointSuccessBlue from '@/static/images/loggedOff/icon-success-blue.png';
     import pointSuccessGreen from '@/static/images/loggedOff/icon-success-green.png';
-	import { mapGetters } from 'vuex'
+	import { mapState } from 'vuex'
     export default {
         name: 'points-success',
         data() {
@@ -58,7 +58,7 @@
             }
         },
 		computed: {
-			...mapGetters({
+			...mapState({
 				custTypeId: state => state.custTypeId
 			}),
             successImgUrl() {

+ 0 - 1
src/utils/uniHooks.js

@@ -6,7 +6,6 @@ import { Toast } from 'vant'
 
 function getStorageSync(key) {
   const value = window.localStorage.getItem(key);
-  console.log(99999999, value);
   if (value && value.indexOf('"') === 0) {
     return JSON.parse(value)
   }