Prechádzať zdrojové kódy

fix:页面结构调整

chenzhen2 1 rok pred
rodič
commit
079f93b73e

+ 1 - 0
.eslintrc.js

@@ -21,6 +21,7 @@ module.exports = {
   'rules': {
     // allow paren-less arrow functions
     'arrow-parens': 0,
+    "no-console": "off",
     'vue/require-v-for-key': 'off',
     'vue/eslint-plugin-vue': 'off',
     // allow async-await

+ 15 - 8
project.config.json

@@ -2,11 +2,11 @@
   "description": "项目配置文件",
   "setting": {
     "urlCheck": true,
-    "es6": false,
+    "es6": true,
     "enhance": false,
     "postcss": false,
     "preloadBackgroundData": false,
-    "minified": false,
+    "minified": true,
     "newFeature": false,
     "coverView": true,
     "nodeModules": false,
@@ -19,8 +19,6 @@
     "uploadWithSourceMap": true,
     "compileHotReLoad": false,
     "useMultiFrameRuntime": true,
-    "useApiHook": true,
-    "useApiHostProcess": true,
     "babelSetting": {
       "ignore": [],
       "disablePlugins": [],
@@ -33,12 +31,21 @@
     "userConfirmedBundleSwitch": false,
     "packNpmManually": false,
     "packNpmRelationList": [],
-    "minifyWXSS": true
+    "minifyWXSS": true,
+    "condition": false,
+    "ignoreUploadUnusedFiles": true
   },
   "compileType": "miniprogram",
-  "appid": "wxda2ef261ac3cca32",
-  "projectname": "sagaclound-wepy",
   "miniprogramRoot": "weapp/",
   "srcMiniprogramRoot": "weapp/",
-  "condition": {}
+  "condition": {},
+  "editorSetting": {
+    "tabIndent": "insertSpaces",
+    "tabSize": 2
+  },
+  "packOptions": {
+    "ignore": [],
+    "include": []
+  },
+  "appid": "wxda2ef261ac3cca32"
 }

+ 12 - 0
project.private.config.json

@@ -0,0 +1,12 @@
+{
+  "description": "项目私有配置文件。此文件中的内容将覆盖 project.config.json 中的相同字段。项目的改动优先同步到此文件中。详见文档:https://developers.weixin.qq.com/miniprogram/dev/devtools/projectconfig.html",
+  "setting": {
+    "urlCheck": false,
+    "bigPackageSizeSupport": false,
+    "autoAudits": true,
+    "compileHotReLoad": true,
+    "preloadBackgroundData": false
+  },
+  "libVersion": "3.0.1",
+  "projectname": "sagaclound-wepy"
+}

+ 26 - 12
src/api/user.js

@@ -1,19 +1,33 @@
+import $http from '@/common/request.js';
 function getCompmayUsers() {
-    return $http({
-        url: `/user/companyUsers`,
-        method: 'GET',
-    });
+  return $http({
+    url: `/user/companyUsers`,
+    method: 'GET',
+  });
 }
 
 function getUserInfo(params) {
-    return $http({
-      url: '/user/info',
-      method: 'GET',
-      data: JSON.stringify(params)
-    });
-  }
+  return $http({
+    url: '/user/info',
+    method: 'GET',
+    data: JSON.stringify(params)
+  });
+}
+
+function setWxAuthUserInfo(params) {
+  return $http({
+    url: '/user/wxAuthInfo',
+    method: 'POST',
+    data: JSON.stringify(params)
+  });
+  // return Promise.resolve()
+}
+
+
+
+
 
 export {
-    getCompmayUsers,
-    getUserInfo
+  getCompmayUsers,
+  getUserInfo
 }

+ 3 - 1
src/app.wpy

@@ -44,7 +44,9 @@ wepy.app({
 <config>
 {
     pages: [
-      'pages/index'
+      'pages/index',
+      'pages/home/index',
+      'pages/bindTenant/index'
     ],
     "subpackages":[
      {

Rozdielové dáta súboru neboli zobrazené, pretože súbor je príliš veľký
+ 103 - 0
src/pages/auth/ indexCopy.wpy


+ 55 - 0
src/pages/bindTenant/index.wpy

@@ -0,0 +1,55 @@
+<style lang="less">
+.overflow-wrap {
+  width: 100%;
+  height: 100%;
+  .scroll-view {
+    position: relative;
+    width: 100%;
+    height: 100%;
+    z-index: 2;
+  }
+}
+.avatar-wrapper {
+  width: 80px;
+  height: 80px;
+}
+.avatar {
+  width: 80px;
+  height: 80px;
+}
+</style>
+<template>
+ <div>
+  绑定租户页面
+ </div>
+</template>
+
+<script>
+import wepy from '@wepy/core';
+import eventHub from '@/common/eventHub';
+import { mapState } from '@wepy/x';
+import store from '@/store';
+import testMixin from '@/mixins/test';
+import { setUserInfoByAuth } from '@/service/user';
+
+wepy.page({
+  store,
+  config: {
+    navigationBarTitleText: 'test'
+  },
+  data: {},
+  onLoad() {},
+  onShow() {
+    // this.checkAuthCamra();
+  },
+  methods: {},
+  created() {}
+});
+</script>
+<config>
+{
+  navigationBarTitleText: '公司身份选择',
+  usingComponents: {
+  }
+}
+</config>

+ 3 - 3
src/pages/home/index.wpy

@@ -24,10 +24,10 @@
 
 <script>
 import wepy from '@wepy/core';
-import eventHub from '../common/eventHub';
+import eventHub from '@/common/eventHub';
 import { mapState } from '@wepy/x';
-import store from '../store';
-import testMixin from '../mixins/test';
+import store from '@/store';
+import testMixin from '@/mixins/test';
 
 wepy.page({
   store,

Rozdielové dáta súboru neboli zobrazené, pretože súbor je príliš veľký
+ 73 - 26
src/pages/index.wpy


+ 64 - 1
src/service/user.js

@@ -55,6 +55,69 @@ function checkHasUserInfo() {
     }
 }
 
+function setUserInfoByAuth() {
+    return new Promise((resolve, reject) => {
+      // if (ing) {
+      //   return;
+      // }
+      // ing = true;
+      // let { userInfo = {} } = store.state.user;
+      // // 如果已经保存过了
+      // let nickName = userInfo.nickName;
+      // if (nickName) {
+      //   ing = false;
+      //   resolve();
+      //   return;
+      // }
+      wx.getUserProfile({
+        desc: '用于完善用户信息',
+        success: res => {
+          let detail = res;
+          wx.login({
+            success: loginRes => {
+              // ing = false;
+              // if (loginRes.code) {
+              //   let params = {
+              //     encryptedData: detail.encryptedData,
+              //     iv: detail.iv,
+              //     jsCode: loginRes.code
+              //   };
+              //   setWxAuthUserInfo(params).then(res => {
+              //     let userInfo = JSON.parse(detail.rawData);
+              //     let cachedInfo = wx.getStorageSync('UserInfo');
+              //     userInfo = {
+              //       ...cachedInfo,
+              //       ...userInfo,
+              //       headImgUrl: userInfo.avatarUrl
+              //     };
+              //     delete userInfo.avatarUrl;
+              //     store.commit('setUserInfo', {
+              //       ...userInfo
+              //     });
+              //     wx.setStorageSync('UserInfo', { ...userInfo });
+              //     resolve(res.data);
+              //   });
+              // }
+            },
+            fail: res => {
+              // ing = false;
+              // reject(res);
+            }
+          });
+        },
+        fail: res => {
+          // ing = false;
+          // wx.showToast({
+          //   icon: 'none',
+          //   title: '授权用户公开信息后方可进入下一步操作'
+          // });
+          // reject();
+        }
+      });
+    });
+  }
+
 export {
-    checkHasUserInfo
+    checkHasUserInfo,
+    setUserInfoByAuth
 }

+ 0 - 0
static/.gitignore


Rozdielové dáta súboru neboli zobrazené, pretože súbor je príliš veľký
+ 17 - 0
static/logo.svg


Rozdielové dáta súboru neboli zobrazené, pretože súbor je príliš veľký
+ 22 - 0
static/logo_bg.svg