Просмотр исходного кода

更新页面统一加载方式

lalala 6 лет назад
Родитель
Сommit
898a4a17b0
51 измененных файлов с 105 добавлено и 79 удалено
  1. 1 1
      mobile-code/src/admin/ad/add.vue
  2. 1 1
      mobile-code/src/admin/ad/list.vue
  3. 1 1
      mobile-code/src/admin/ad/sel-goods.vue
  4. 1 1
      mobile-code/src/admin/assets/list.vue
  5. 1 1
      mobile-code/src/admin/coupon/list.vue
  6. 1 1
      mobile-code/src/admin/goodsManage/add.vue
  7. 1 1
      mobile-code/src/admin/goodsManage/category.vue
  8. 2 2
      mobile-code/src/admin/goodsManage/freight.vue
  9. 1 1
      mobile-code/src/admin/goodsManage/goods-name.vue
  10. 1 1
      mobile-code/src/admin/goodsManage/img-store.vue
  11. 11 9
      mobile-code/src/admin/goodsManage/list.vue
  12. 1 1
      mobile-code/src/admin/goodsManage/price-increase.vue
  13. 1 1
      mobile-code/src/admin/home/member.vue
  14. 1 1
      mobile-code/src/admin/home/order.vue
  15. 1 1
      mobile-code/src/admin/home/workbench.vue
  16. 1 1
      mobile-code/src/admin/interest/invite.vue
  17. 1 1
      mobile-code/src/admin/interest/my-invite.vue
  18. 1 1
      mobile-code/src/admin/interest/setting.vue
  19. 1 1
      mobile-code/src/admin/member/detail.vue
  20. 1 1
      mobile-code/src/admin/order/detail.vue
  21. 1 1
      mobile-code/src/admin/order/fill-form.vue
  22. 1 1
      mobile-code/src/admin/order/ship.vue
  23. 1 1
      mobile-code/src/admin/setting/coupon.vue
  24. 1 1
      mobile-code/src/admin/setting/level.vue
  25. 1 1
      mobile-code/src/admin/setting/wx-menu.vue
  26. 1 1
      mobile-code/src/admin/staff/add.vue
  27. 1 1
      mobile-code/src/admin/staff/list.vue
  28. 1 1
      mobile-code/src/admin/staff/sel-member.vue
  29. 2 2
      mobile-code/src/admin/statistics/index.vue
  30. 2 2
      mobile-code/src/components/app-coupon-sel.vue
  31. 3 3
      mobile-code/src/components/plugin/simple-address.vue
  32. 23 7
      mobile-code/src/mixins/globalMixins.js
  33. 1 1
      mobile-code/src/official/apply.vue
  34. 1 1
      mobile-code/src/official/index.vue
  35. 1 1
      mobile-code/src/official/pay.vue
  36. 1 1
      mobile-code/src/pages/callback/index.vue
  37. 1 1
      mobile-code/src/pages/coupon/list.vue
  38. 1 1
      mobile-code/src/pages/goods/detail.vue
  39. 11 9
      mobile-code/src/pages/home/category.vue
  40. 3 0
      mobile-code/src/pages/home/components/goods-list-big.vue
  41. 6 3
      mobile-code/src/pages/home/index.vue
  42. 1 1
      mobile-code/src/pages/home/shop.vue
  43. 1 1
      mobile-code/src/pages/home/user.vue
  44. 1 1
      mobile-code/src/pages/interest/invite.vue
  45. 1 1
      mobile-code/src/pages/interest/level.vue
  46. 1 1
      mobile-code/src/pages/member/detail.vue
  47. 1 1
      mobile-code/src/pages/order/buy.vue
  48. 1 1
      mobile-code/src/pages/order/comment.vue
  49. 1 1
      mobile-code/src/pages/order/detail.vue
  50. 1 1
      mobile-code/src/pages/order/list.vue
  51. 1 1
      mobile-code/src/pages/pay/index.vue

+ 1 - 1
mobile-code/src/admin/ad/add.vue

@@ -129,7 +129,7 @@ export default {
 	},
 	onLoad(option) {
 		this.setPageTitle()
-		this.init()
+		// this.init()
 	},
 	methods: {
 		init() {

+ 1 - 1
mobile-code/src/admin/ad/list.vue

@@ -136,7 +136,7 @@ export default {
 		}
 	},
 	onLoad() {
-		this.init()
+		// this.init()
 	},
 	methods: {
 		async init() {

+ 1 - 1
mobile-code/src/admin/ad/sel-goods.vue

@@ -52,7 +52,7 @@ export default {
 		}
 	},
 	onLoad: function() {
-		this.init()
+		// this.init()
 	},
 	methods: {
 		async init() {

+ 1 - 1
mobile-code/src/admin/assets/list.vue

@@ -58,7 +58,7 @@ export default {
 		}
 	},
 	onLoad: function() {
-		this.init()
+		// this.init()
 	},
 	methods: {
 		async init() {

+ 1 - 1
mobile-code/src/admin/coupon/list.vue

@@ -87,7 +87,7 @@ export default {
 		}
 	},
 	onLoad: function() {
-		this.init()
+		// this.init()
 	},
 	methods: {
 		async init() {

+ 1 - 1
mobile-code/src/admin/goodsManage/add.vue

@@ -125,7 +125,7 @@ export default {
 		...mapGetters({ categoryData: 'getCategory' })
 	},
 	onLoad() {
-		this.init()
+		// this.init()
 	},
 	methods: {
 		init() {

+ 1 - 1
mobile-code/src/admin/goodsManage/category.vue

@@ -168,7 +168,7 @@ export default {
 		}
 	},
 	onLoad() {
-		this.init()
+		// this.init()
 	},
 	methods: {
 		async init() {

+ 2 - 2
mobile-code/src/admin/goodsManage/freight.vue

@@ -36,7 +36,7 @@ export default {
 	},
 	onLoad() {},
 	mounted() {
-		this.init()
+		// this.init()
 	},
 	watch: {
 		userInfo() {
@@ -47,7 +47,7 @@ export default {
 		}
 	},
 	methods: {
-		init() {
+		mInit() {
 			getUser().then(res => {
 				this.form.first = this.userInfo.extend.freightFirst
 				this.form.add = this.userInfo.extend.freightAdd

+ 1 - 1
mobile-code/src/admin/goodsManage/goods-name.vue

@@ -43,7 +43,7 @@ export default {
 		}
 	},
 	onLoad() {
-		this.init()
+		// this.init()
 	},
 	methods: {
 		init() {

+ 1 - 1
mobile-code/src/admin/goodsManage/img-store.vue

@@ -194,7 +194,7 @@ export default {
 		...mapGetters({ categoryData: 'getCategory' })
 	},
 	onLoad() {
-		this.init()
+		// this.init()
 	},
 	methods: {
 		// 获取高度

+ 11 - 9
mobile-code/src/admin/goodsManage/list.vue

@@ -159,17 +159,19 @@ export default {
 		}
 	},
 	onLoad: function() {
-		setTimeout(() => {
-			uni.getSystemInfo({
-				success: res => {
-					this.height = res.windowHeight - 90
-					this.init()
-				}
-			})
-		}, 50)
+		if (this.$util.isLogin()) {
+			setTimeout(() => {
+				uni.getSystemInfo({
+					success: res => {
+						this.height = res.windowHeight - 90
+						this.sInit()
+					}
+				})
+			}, 50)
+		}
 	},
 	methods: {
-		async init() {
+		async sInit() {
 			this._getClass()
 			this._list()
 		},

+ 1 - 1
mobile-code/src/admin/goodsManage/price-increase.vue

@@ -73,7 +73,7 @@ export default {
 		...mapGetters({ festData: 'getFest' })
 	},
 	onLoad() {
-		this.init()
+		// this.init()
 	},
 	methods: {
 		init() {

+ 1 - 1
mobile-code/src/admin/home/member.vue

@@ -76,7 +76,7 @@ export default {
 		}
 	},
 	onLoad(option) {
-		this.init()
+		// this.init()
 	},
 	methods: {
 		init() {

+ 1 - 1
mobile-code/src/admin/home/order.vue

@@ -108,7 +108,7 @@ export default {
 		console.log('5151')
 	},
 	onLoad: function() {
-		this.init()
+		// this.init()
 	},
 	methods: {
 		async init() {

+ 1 - 1
mobile-code/src/admin/home/workbench.vue

@@ -203,7 +203,7 @@ export default {
 	},
 	onLoad(option) {
 		// if (this.$util.getCheckLogin()) return
-		this.init()
+		// this.init()
 	},
 	methods: {
 		init() {

+ 1 - 1
mobile-code/src/admin/interest/invite.vue

@@ -146,7 +146,7 @@ export default {
 		}
 	},
 	onLoad: function() {
-		this.init()
+		// this.init()
 	},
 	methods: {
 		async init() {

+ 1 - 1
mobile-code/src/admin/interest/my-invite.vue

@@ -118,7 +118,7 @@ export default {
 		...mapGetters({ userInfo: 'getUser' })
 	},
 	onLoad() {
-		this.init()
+		// this.init()
 	},
 	methods: {
 		init() {

+ 1 - 1
mobile-code/src/admin/interest/setting.vue

@@ -48,7 +48,7 @@ export default {
 		}
 	},
 	onLoad() {
-		this.init()
+		// this.init()
 	},
 	methods: {
 		init() {

+ 1 - 1
mobile-code/src/admin/member/detail.vue

@@ -267,7 +267,7 @@ export default {
 		...mapGetters({ levelData: 'getLevel' })
 	},
 	onLoad() {
-		this.init()
+		// this.init()
 	},
 	methods: {
 		init() {

+ 1 - 1
mobile-code/src/admin/order/detail.vue

@@ -200,7 +200,7 @@ export default {
 		}
 	},
 	onLoad() {
-		this.init()
+		// this.init()
 	},
 	methods: {
 		init() {

+ 1 - 1
mobile-code/src/admin/order/fill-form.vue

@@ -41,7 +41,7 @@ export default {
 		...mapGetters({ shopUser: 'getShopUser' })
 	},
 	onLoad() {
-		this.init()
+		// this.init()
 	},
 	methods: {
 		init() {

+ 1 - 1
mobile-code/src/admin/order/ship.vue

@@ -108,7 +108,7 @@ export default {
 			title: '加载中...',
 			mask: true
 		})
-		this.init()
+		// this.init()
 	},
 	methods: {
 		init() {

+ 1 - 1
mobile-code/src/admin/setting/coupon.vue

@@ -41,7 +41,7 @@ export default {
 		}
 	},
 	onLoad() {
-		this.init()
+		// this.init()
 	},
 	methods: {
 		init() {

+ 1 - 1
mobile-code/src/admin/setting/level.vue

@@ -70,7 +70,7 @@ export default {
 		}
 	},
 	onLoad() {
-		this.init()
+		// this.init()
 	},
 	methods: {
 		init() {

+ 1 - 1
mobile-code/src/admin/setting/wx-menu.vue

@@ -114,7 +114,7 @@ export default {
 		...mapGetters({ userInfo: 'getUser' })
 	},
 	onLoad() {
-		this.init()
+		// this.init()
 	},
 	methods: {
 		init() {

+ 1 - 1
mobile-code/src/admin/staff/add.vue

@@ -100,7 +100,7 @@ export default {
 		}
 	},
 	onLoad() {
-		this.init()
+		// this.init()
 	},
 	methods: {
 		init() {

+ 1 - 1
mobile-code/src/admin/staff/list.vue

@@ -184,7 +184,7 @@ export default {
 		}
 	},
 	onLoad: function() {
-		this.init()
+		// this.init()
 	},
 	methods: {
 		async init() {

+ 1 - 1
mobile-code/src/admin/staff/sel-member.vue

@@ -36,7 +36,7 @@ export default {
 		}
 	},
 	onLoad: function() {
-		this.init()
+		// this.init()
 	},
 	methods: {
 		async init() {

+ 2 - 2
mobile-code/src/admin/statistics/index.vue

@@ -145,10 +145,10 @@ export default {
 	},
 	onLoad() {},
 	mounted() {
-		this.init()
+		this.mInit()
 	},
 	methods: {
-		init() {
+		mInit() {
 			this._getData()
 		},
 		_getData() {

+ 2 - 2
mobile-code/src/components/app-coupon-sel.vue

@@ -103,7 +103,7 @@ export default {
 		}
 	},
 	mounted() {
-		this.init()
+		// this.init()
 		// getShopUser()
 		// if (this.discountArr.indexOf('member') > -1) {
 		// 	this.selIndex = 1
@@ -111,7 +111,7 @@ export default {
 		// }
 	},
 	methods: {
-		init() {
+		mInit() {
 			this._getUserDiscount()
 		},
 		_getUserDiscount() {

+ 3 - 3
mobile-code/src/components/plugin/simple-address.vue

@@ -118,14 +118,14 @@ export default {
 			}
 		},
 		pickerValueDefault() {
-			this.init()
+			this.sInit()
 		}
 	},
 	created() {
-		this.init()
+		this.sInit()
 	},
 	methods: {
-		init() {
+		sInit() {
 		// 	this.handPickValueDefault() // 对 pickerValueDefault 做兼容处理
 		// 	this.provinceDataList = JSON.parse(JSON.stringify(this.region))
 		// 	this.cityDataList = []

+ 23 - 7
mobile-code/src/mixins/globalMixins.js

@@ -1,5 +1,5 @@
 import { mapGetters } from 'vuex'
-import { pageTo, getCheckLogin } from '@/utils/util.js'
+import { pageTo, getCheckLogin, isLogin } from '@/utils/util.js'
 import { getUser } from '@/utils/auth'
 import constant from '@/constant'
 export default {
@@ -30,13 +30,29 @@ export default {
 		uni.setStorageSync('currentQuery', option)
 		// 登录
 		if (constant.source == 'business' || constant.source == 'mobile') {
-			getCheckLogin().then(res => {
-				if (constant.source == 'business') {
-					if (res) {
-						getUser()
-					}
+			if (isLogin()) {
+				if (this.init) {
+					this.init()
+					// console.log('init', this.init)
 				}
-			})
+			} else {
+				getCheckLogin().then(res => {
+					if (constant.source == 'business') {
+						if (res) {
+							getUser()
+						}
+					}
+				})
+			}
+		}
+		if (constant.source == 'official') {
+			this.init()
+		}
+	},
+	mounted() {
+		if (this.mInit) {
+			this.mInit()
+			// console.log('init', this.mInit)
 		}
 	}
 }

+ 1 - 1
mobile-code/src/official/apply.vue

@@ -104,7 +104,7 @@ export default {
 			getShopUser()
 			return false
 		}
-		this.init()
+		// this.init()
 	},
 	methods: {
 		init() {

+ 1 - 1
mobile-code/src/official/index.vue

@@ -130,7 +130,7 @@ export default {
 		}
 	},
 	onLoad() {
-		this.init()
+		// this.init()
 	},
 	methods: {
 		init() {

+ 1 - 1
mobile-code/src/official/pay.vue

@@ -57,7 +57,7 @@ export default {
 			getShopUser()
 			return false
 		}
-		this.init()
+		// this.init()
 	},
 	methods: {
 		init() {

+ 1 - 1
mobile-code/src/pages/callback/index.vue

@@ -131,7 +131,7 @@ export default {
 		}
 	},
 	onLoad() {
-		this.init()
+		// this.init()
 	},
 	methods: {
 		init() {

+ 1 - 1
mobile-code/src/pages/coupon/list.vue

@@ -103,7 +103,7 @@ export default {
 		}
 	},
 	onLoad: function() {
-		this.init()
+		// this.init()
 	},
 	methods: {
 		async init() {

+ 1 - 1
mobile-code/src/pages/goods/detail.vue

@@ -92,7 +92,7 @@ export default {
 	mounted() {
 		// this.$util.getCheckLogin().then(res => {
 		// 	if (!res) return false
-		this.init()
+		// this.init()
 		// })
 	},
 	computed: {

+ 11 - 9
mobile-code/src/pages/home/category.vue

@@ -55,17 +55,19 @@ export default {
 		}
 	},
 	onLoad: function() {
-		setTimeout(() => {
-			uni.getSystemInfo({
-				success: res => {
-					this.height = res.windowHeight
-					this.init()
-				}
-			})
-		}, 50)
+		if (this.$util.isLogin()) {
+			setTimeout(() => {
+				uni.getSystemInfo({
+					success: res => {
+						this.height = res.windowHeight
+						this.sInit()
+					}
+				})
+			}, 50)
+		}
 	},
 	methods: {
-		async init() {
+		async sInit() {
 			this._getClass().then(res => {
 				this._list()
 			})

+ 3 - 0
mobile-code/src/pages/home/components/goods-list-big.vue

@@ -44,6 +44,9 @@ export default {
 			default: () => {}
 		}
 	},
+	onLoad() {
+		alert('asdfa')
+	},
 	data() {
 		return {
 			constant: this.$constant

+ 6 - 3
mobile-code/src/pages/home/index.vue

@@ -44,9 +44,9 @@ export default {
 		}
 	},
 	onLoad(option) {
-		if (this.$util.isLogin()) {
-			this.init()
-		}
+		// if (this.$util.isLogin()) {
+		// 	this.init()
+		// }
 	},
 	mounted() {
 	},
@@ -57,6 +57,9 @@ export default {
 			})
 			this._detail()
 		},
+		mInit() {
+			console.log('asfdas')
+		},
 		_detail() {
 			getMainIndex().then(res => {
 				this.data = res.data

+ 1 - 1
mobile-code/src/pages/home/shop.vue

@@ -63,7 +63,7 @@ export default {
 		}
 	},
 	onLoad(option) {
-		this.init()
+		// this.init()
 	},
 	methods: {
 		init() {

+ 1 - 1
mobile-code/src/pages/home/user.vue

@@ -144,7 +144,7 @@ export default {
 		...mapGetters({ shopUser: 'getShopUser' })
 	},
 	onLoad(option) {
-		this.init()
+		// this.init()
 	},
 	methods: {
 		init() {

+ 1 - 1
mobile-code/src/pages/interest/invite.vue

@@ -117,7 +117,7 @@ export default {
 		}
 	},
 	onLoad() {
-		this.init()
+		// this.init()
 	},
 	methods: {
 		init() {

+ 1 - 1
mobile-code/src/pages/interest/level.vue

@@ -60,7 +60,7 @@ export default {
 		}
 	},
 	onLoad() {
-		this.init()
+		// this.init()
 	},
 	methods: {
 		init() {

+ 1 - 1
mobile-code/src/pages/member/detail.vue

@@ -267,7 +267,7 @@ export default {
 		...mapGetters({ levelData: 'getLevel' })
 	},
 	onLoad() {
-		this.init()
+		// this.init()
 	},
 	methods: {
 		init() {

+ 1 - 1
mobile-code/src/pages/order/buy.vue

@@ -144,7 +144,7 @@ export default {
 		}
 	},
 	onLoad(option) {
-		this.init()
+		// this.init()
 	},
 	methods: {
 		init() {

+ 1 - 1
mobile-code/src/pages/order/comment.vue

@@ -70,7 +70,7 @@ export default {
 		}
 	},
 	onLoad() {
-		this.init()
+		// this.init()
 	},
 	methods: {
 		init() {

+ 1 - 1
mobile-code/src/pages/order/detail.vue

@@ -158,7 +158,7 @@ export default {
 		}
 	},
 	onLoad() {
-		this.init()
+		// this.init()
 	},
 	methods: {
 		init() {

+ 1 - 1
mobile-code/src/pages/order/list.vue

@@ -90,7 +90,7 @@ export default {
 		}
 	},
 	onLoad: function() {
-		this.init()
+		// this.init()
 	},
 	methods: {
 		async init() {

+ 1 - 1
mobile-code/src/pages/pay/index.vue

@@ -112,7 +112,7 @@ export default {
 		// 	account: 12358,
 		// 	shopId: 15680
 		// }
-		this.init()
+		// this.init()
 	},
 	methods: {
 		init() {