|
@@ -1,11 +1,14 @@
|
|
<template>
|
|
<template>
|
|
- <div></div>
|
|
|
|
|
|
+ <div>
|
|
|
|
+ <loading :visible="isLoading" :doLoading="doLoading"></loading>
|
|
|
|
+ </div>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script>
|
|
<script>
|
|
const projectName = require('$root/config/project');
|
|
const projectName = require('$root/config/project');
|
|
import * as API_WeiXin from '$project/apis/weixin'
|
|
import * as API_WeiXin from '$project/apis/weixin'
|
|
import * as API_User from '$project/apis/user'
|
|
import * as API_User from '$project/apis/user'
|
|
|
|
+ import Loading from '$project/components/Loading.vue'
|
|
import {
|
|
import {
|
|
getUrlParam,
|
|
getUrlParam,
|
|
getWeixinRedirectURI,
|
|
getWeixinRedirectURI,
|
|
@@ -19,7 +22,9 @@
|
|
import * as Dictionaries from '$project/utils/dictionaries'
|
|
import * as Dictionaries from '$project/utils/dictionaries'
|
|
export default {
|
|
export default {
|
|
name: 'Common',
|
|
name: 'Common',
|
|
- components: {},
|
|
|
|
|
|
+ components: {
|
|
|
|
+ Loading,
|
|
|
|
+ },
|
|
props: {
|
|
props: {
|
|
//是否获取openid
|
|
//是否获取openid
|
|
checkOpenId: {
|
|
checkOpenId: {
|
|
@@ -36,9 +41,15 @@
|
|
require: false,
|
|
require: false,
|
|
default: true,
|
|
default: true,
|
|
},
|
|
},
|
|
|
|
+ doLoading: {
|
|
|
|
+ require: false,
|
|
|
|
+ default: false,
|
|
|
|
+ },
|
|
},
|
|
},
|
|
data() {
|
|
data() {
|
|
- return {}
|
|
|
|
|
|
+ return {
|
|
|
|
+ isLoading: false,
|
|
|
|
+ }
|
|
},
|
|
},
|
|
created() {
|
|
created() {
|
|
//公共组件的执行方法放在created中执行,父组件的create放在motuned中执行
|
|
//公共组件的执行方法放在created中执行,父组件的create放在motuned中执行
|
|
@@ -102,8 +113,13 @@
|
|
},
|
|
},
|
|
//获取用户详情
|
|
//获取用户详情
|
|
getUserInfoByOpenId() {
|
|
getUserInfoByOpenId() {
|
|
|
|
+ this.isLoading = true;
|
|
|
|
+
|
|
var type = type || '';
|
|
var type = type || '';
|
|
API_WeiXin.getDataByOpenId(this.openId).then(response => {
|
|
API_WeiXin.getDataByOpenId(this.openId).then(response => {
|
|
|
|
+
|
|
|
|
+ this.isLoading = false;
|
|
|
|
+
|
|
//console.log(response)
|
|
//console.log(response)
|
|
|
|
|
|
var token = response ? response.token : '';
|
|
var token = response ? response.token : '';
|
|
@@ -135,9 +151,11 @@
|
|
},
|
|
},
|
|
//获取所有功能列表
|
|
//获取所有功能列表
|
|
getAllFunList() {
|
|
getAllFunList() {
|
|
|
|
+ this.isLoading = true;
|
|
API_User.getAllFunList().then(response => {
|
|
API_User.getAllFunList().then(response => {
|
|
- console.log('response');
|
|
|
|
- console.log(response);
|
|
|
|
|
|
+
|
|
|
|
+ this.isLoading = false;
|
|
|
|
+
|
|
if (response && response.allIcon) {
|
|
if (response && response.allIcon) {
|
|
var allIcon = response.allIcon;
|
|
var allIcon = response.allIcon;
|
|
this.set_fun_list(allIcon);
|
|
this.set_fun_list(allIcon);
|