Bladeren bron

treesharkingr

谢杰标 3 jaren geleden
bovenliggende
commit
1ccf191988
4 gewijzigde bestanden met toevoegingen van 25 en 113 verwijderingen
  1. 1 101
      common/tool.js
  2. 22 11
      pages.json
  3. 1 1
      pages/login/login.vue
  4. 1 0
      store/index.js

+ 1 - 101
common/tool.js

@@ -1,5 +1,4 @@
 import store from "@/store/index.js";
-import { aliyunpolicy } from "@/utils/login";
 import config from "@/common/config";
 export default {
   isGoLogin(isBack = true) {
@@ -19,10 +18,6 @@ export default {
       return false;
     }
   },
-  isLogout() {
-    // uni.removeStorageSync('user_account')
-    // uni.removeStorageSync('token')
-  },
   //提示
   showToast(title, icon = "none", time = 2000) {
     return setTimeout(() => {
@@ -65,101 +60,6 @@ export default {
       url: "/pages/index/index",
     });
   },
-  //压缩图片
-  imageInfos(url) {
-    var self = this;
-    return new Promise((resolve, reject) => {
-      uni.getImageInfo({
-        src: url,
-        success: async (res) => {
-          let canvasWidth = res.width; //图片原始长宽
-          let canvasHeight = res.height;
-          if (canvasWidth > 2000 || canvasHeight > 2000) {
-            uni.compressImage({
-              src: url,
-              quality: 75,
-              width: "35%",
-              height: "35%",
-              success: async (rest) => {
-                const waitUpload = await self.uploadFile(rest.tempFilePath, 0);
-                console.log(waitUpload, "waitUpload");
-                resolve(waitUpload);
-              },
-            });
-          } else if (canvasWidth > 1000 || canvasHeight > 1000) {
-            uni.compressImage({
-              src: url,
-              quality: 75,
-              width: "50%",
-              height: "50%",
-              success: async (rest) => {
-                const waitUpload = await self.uploadFile(rest.tempFilePath, 0);
-                console.log(waitUpload, "waitUpload");
-                resolve(waitUpload);
-              },
-            });
-          } else {
-            const waitUpload = await self.uploadFile(url, 0);
-            console.log(waitUpload, "waitUpload");
-            resolve(waitUpload);
-            // console.log('无需压缩', url);
-            // resolve(url);
-          }
-        },
-      });
-    });
-  },
-  //上传图片
-  uploadFile(options, int) {
-    return new Promise((resolve, reject) => {
-      var self = this;
-      // if (options.indexOf("//tmp") === -1 && options.indexOf("//temp") === -1) {
-      //   resolve(options);
-      //   return;
-      // }
-      var data = {
-        imageStatus: int,
-      };
-      aliyunpolicy(data).then((res) => {
-        var ossToken = res.data.data.resultContent;
-        uni.uploadFile({
-          url: ossToken.host,
-          name: "file",
-          filePath: options,
-          fileType: "image",
-          header: {
-            AuthorizationToken: "WX " + uni.getStorageSync("token"),
-          },
-          formData: {
-            key: ossToken.dir,
-            OSSAccessKeyId: ossToken.accessid,
-            policy: ossToken.policy,
-            Signature: ossToken.signature,
-            // callback: ossToken.callback,
-            success_action_status: 200,
-          },
-          success: (result) => {
-            // if (result.statusCode === 200) {
-            resolve(ossToken.dir);
-            // } else {
-            // 	uni.showToast({
-            // 		title: '上传失败',
-            // 		icon: 'none'
-            // 	});
-            // 	return;
-            // }
-          },
-          fail: (error) => {
-            uni.showToast({
-              title: "上传接口报错",
-              icon: "none",
-            });
-            return;
-          },
-        });
-      });
-    });
-  },
 };
 
 // 监测域名
@@ -187,5 +87,5 @@ export function getQueryString(name) {
 
 export function isWechat() {
   var ua = window.navigator.userAgent.toLowerCase();
-  return ua.match(/micromessenger/i) == "micromessenger"
+  return ua.match(/micromessenger/i) == "micromessenger";
 }

+ 22 - 11
pages.json

@@ -7,31 +7,36 @@
       "style": {
         "navigationBarTitleText": "个人中心",
         "navigationBarTextStyle": "white",
-        "navigationBarBackgroundColor": "#3F8DFD"
+        "navigationBarBackgroundColor": "#3F8DFD",
+        "navigationStyle": "custom"
       }
     },
     {
       "path": "pages/login/login",
       "style": {
-        "navigationBarTitleText": "登录"
+        "navigationBarTitleText": "登录",
+        "navigationStyle": "custom"
       }
     },
     {
       "path": "pages/login/register",
       "style": {
-        "navigationBarTitleText": "注册"
+        "navigationBarTitleText": "注册",
+        "navigationStyle": "custom"
       }
     },
     {
       "path": "pages/login/forget",
       "style": {
-        "navigationBarTitleText": "忘记密码"
+        "navigationBarTitleText": "忘记密码",
+        "navigationStyle": "custom"
       }
     },
     {
       "path": "pages/profile/index",
       "style": {
-        "navigationBarTitleText": "修改资料"
+        "navigationBarTitleText": "修改资料",
+        "navigationStyle": "custom"
       }
     },
     {
@@ -46,35 +51,40 @@
       "path": "pages/actlist/index",
       "style": {
         "navigationBarTitleText": "活动列表",
-        "enablePullDownRefresh": false
+        "enablePullDownRefresh": false,
+        "navigationStyle": "custom"
       }
     },
     {
       "path": "pages/commission/index",
       "style": {
         "navigationBarTitleText": "佣金列表",
-        "enablePullDownRefresh": false
+        "enablePullDownRefresh": false,
+        "navigationStyle": "custom"
       }
     },
     {
       "path": "pages/comdetail/index",
       "style": {
         "navigationBarTitleText": "详情",
-        "enablePullDownRefresh": false
+        "enablePullDownRefresh": false,
+        "navigationStyle": "custom"
       }
     },
     {
       "path": "pages/cashout/index",
       "style": {
         "navigationBarTitleText": "申请提现",
-        "enablePullDownRefresh": false
+        "enablePullDownRefresh": false,
+        "navigationStyle": "custom"
       }
     },
     {
       "path": "pages/cashout/record",
       "style": {
         "navigationBarTitleText": "提现记录",
-        "enablePullDownRefresh": false
+        "enablePullDownRefresh": false,
+        "navigationStyle": "custom"
       }
     },
     {
@@ -82,7 +92,8 @@
       "style": {
         "navigationBarTitleText": "详情",
         "navigationBarTextStyle": "white",
-        "navigationBarBackgroundColor": "#3F8DFD"
+        "navigationBarBackgroundColor": "#3F8DFD",
+        "navigationStyle": "custom"
       }
     },
     {

+ 1 - 1
pages/login/login.vue

@@ -116,7 +116,7 @@ export default {
         tel: "",
         code: "",
         account: "18378140619",
-        pwd: "123456Aa..",
+        pwd: "123456Aa.",
       },
       list: [
         {

+ 1 - 0
store/index.js

@@ -7,6 +7,7 @@ import { getInfo } from "@/utils/login";
 const store = new Vuex.Store({
   state: {
     userInfo: null,
+    allowLoading: true,
   },
   getters: {
     userInfo: (state) => {