shenjj@usoftchina.com 7 years ago
parent
commit
30b6c3f951
3 changed files with 13 additions and 11 deletions
  1. 1 1
      nuxt.config.js
  2. 2 5
      pages/mobile/share/purChase/_uuid.vue
  3. 10 5
      plugins/mixin.js

+ 1 - 1
nuxt.config.js

@@ -1,6 +1,6 @@
 const path = require('path')
 const isProdMode = Object.is(process.env.NODE_ENV, 'production')
-const baseUrl = process.env.BASE_URL || (isProdMode ? 'http://192.168.253.60:9090/platform-b2c/' : 'http://192.168.253.121:9090/platform-b2c/')
+const baseUrl = process.env.BASE_URL || (isProdMode ? 'http://192.168.253.60:9090/platform-b2c/' : 'http://10.1.51.87:8080/platform-b2c/')
 const commonUrl = process.env.COMMON_URL || (isProdMode ? 'https://api-inquiry.usoftmall.com/' : 'http://218.17.158.219:24000/')
 
 module.exports = {

+ 2 - 5
pages/mobile/share/purChase/_uuid.vue

@@ -135,9 +135,6 @@ export default {
       return this.$store.state.applyPurchase.purchaseManList.purchaseManDetail
         .data
     },
-    // user() {
-    //   return this.$store.state.option.user
-    // },
     purchaseManListData() {
       return this.$store.state.applyPurchase.purchaseManList.purchaseManList
         .data.content
@@ -191,8 +188,8 @@ export default {
       }
     },
     sendApplyPurchase() {
-      console.log(this)
-      if (this.options.user.logged) {
+      console.log(this.user)
+      if (this.user.logged) {
         this.showsendApplyBox = true
       } else {
         this.showLoginBox = true

+ 10 - 5
plugins/mixin.js

@@ -1,9 +1,14 @@
-/* 目前nuxt 版本并不支持此方法来写入相关的mixin方法 */
+/* 目前nuxt 版本如果不高于 1.0.0 并不支持vuex的方法,因此获取相对于的东西只能通过this.$store.state来获取
+   如果nuxt框架为 1.0.0以上,vuex属性状态这里可以优化
+
+*/
 import Vue from 'vue'
-import { mapState } from 'vuex'
+// import { mapState } from 'vuex'
 
 Vue.mixin({
-  computed: mapState([
-    'asxtest'
-  ])
+  computed: {
+    user() {
+      return this.$store.state.option.user
+    }
+  }
 })