Browse Source

no message

zhaoxiaohai 2 years ago
parent
commit
2bc19e4e5c
7 changed files with 18 additions and 77 deletions
  1. 5 10
      app.json
  2. 0 27
      pages/home/index.js
  3. 0 5
      pages/home/index.json
  4. 0 15
      pages/home/index.scss
  5. 0 14
      pages/home/index.wxml
  6. 7 0
      project.private.config.json
  7. 6 6
      utils/Http.js

+ 5 - 10
app.json

@@ -3,7 +3,6 @@
     "pages/login/phone",
     "pages/login/selectSite",
     "pages/login/retrievePassword",
-    "pages/home/index",
     "pages/base/index",
     "pages/tabbar/home/index",
     "pages/tabbar/mine/index",
@@ -30,7 +29,9 @@
         "shipment/detail",
         "target/index",
         "target/person",
-        "account/index"
+        "account/index",
+        "activity/index",
+        "activity/detail"
       ]
     },
     {
@@ -40,18 +41,12 @@
         "agent/index",
         "address/index",
         "finance/index",
-        "contract/index"
+        "contract/index",
+        "activity/index"
       ]
     }
   ],
   "preloadRule": {
-    "pages/home/index": {
-      "packages": [
-        "packageA",
-        "select"
-      ],
-      "network": "all"
-    },
     "pages/tabbar/home/index": {
       "packages": [
         "packageA",

+ 0 - 27
pages/home/index.js

@@ -1,27 +0,0 @@
-import {
-    hexMD5
-} from "../../utils/md5";
-const _Http = getApp().globalData.http;
-Page({
-    data: {
-        username: "000101",
-        password: "123456789",
-    },
-    onLoad(options) {
-
-    },
-    login() {
-        _Http.login({
-            "accountno": this.data.username,
-            "password": hexMD5(this.data.password),
-            "systemclient": "wechatsaletool"
-        }).then(res => {
-            console.log("登录", res)
-            wx.showToast({
-                title: res.msg == '成功' ? '登录成功' : res.msg,
-                icon: "none"
-            });
-            wx.setStorageSync('userMsg', res.account_list[0])
-        })
-    },
-})

+ 0 - 5
pages/home/index.json

@@ -1,5 +0,0 @@
-{
-    "usingComponents": {
-        "van-field": "@vant/weapp/field/index"
-    }
-}

+ 0 - 15
pages/home/index.scss

@@ -1,15 +0,0 @@
-.fun {
-    display: flex;
-    flex-wrap: wrap;
-    box-sizing: border-box;
-    padding: 20rpx 30rpx;
-
-    navigator {
-        width: 25%;
-        height: 80rpx;
-        line-height: 80rpx;
-        box-sizing: border-box;
-        border: 1px solid #ddd;
-        text-align: center;
-    }
-}

+ 0 - 14
pages/home/index.wxml

@@ -1,14 +0,0 @@
-<van-cell-group>
-    <van-field model:value="{{ username }}" required clearable label="账号" icon="question-o" placeholder="请输入账号" bind:click-icon="onClickIcon" />
-    <van-field model:value="{{ password }}" required clearable label="账号" icon="question-o" placeholder="请输入密码" bind:click-icon="onClickIcon" />
-</van-cell-group>
-<view style="text-align: right;margin-top: 20rpx; padding-right: 30rpx;">
-    <van-button type="primary" disabled='{{!password&&!username}}' bind:click='login'>登录</van-button>
-</view>
-
-<view class="fun">
-    <navigator url="/pages/base/index">列表模板</navigator>
-    <navigator url="/packageA/market/index">商城</navigator>
-    <navigator url="/packageA/orderForm/index">销售订单</navigator>
-    <navigator url="/packageA/shipment/index">出货</navigator>
-</view>

+ 7 - 0
project.private.config.json

@@ -57,6 +57,13 @@
           "query": "",
           "launchMode": "default",
           "scene": null
+        },
+        {
+          "name": "促销活动",
+          "pathName": "packageA/activity/index",
+          "query": "",
+          "launchMode": "default",
+          "scene": null
         }
       ]
     }

+ 6 - 6
utils/Http.js

@@ -8,15 +8,15 @@ class HTTP {
         header = {
             'content-type': 'application/json'
         },
-        loading = '加载中...'
+        showLoading = '加载中...'
     }) {
         return new Promise((resolve, reject) => {
-            this._request(url, resolve, reject, data, method, header, loading);
+            this._request(url, resolve, reject, data, method, header, showLoading);
         })
     }
-    _request(url, resolve, reject, data, method, header, loading) {
-        if (loading) wx.showLoading({
-            title: loading,
+    _request(url, resolve, reject, data, method, header, showLoading) {
+        if (showLoading) wx.showLoading({
+            title: showLoading,
             mask: true
         })
         wx.request({
@@ -32,7 +32,7 @@ class HTTP {
                 reject(err);
             },
             complete: (res) => {
-                if (loading) wx.hideLoading()
+                if (showLoading) wx.hideLoading()
                 if (res.errMsg != 'request:ok') {
                     wx.showToast({
                         title: '网络异常,请重新进入',