diff --git a/apis/request.js b/apis/request.js index 779a4c6..0849b32 100644 --- a/apis/request.js +++ b/apis/request.js @@ -13,13 +13,13 @@ const request = options => { } const header = Object.assign({}, config.headers, { // token: uni.getStorageSync('token') - token: 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJ1c2VyIiwiaWF0IjoxNjU0MTYzMjI2LCJleHAiOjE2NTQyMDY0MjYsImFjY291bnRJZCI6IjQ1MiJ9.oqupeDUjOWMKjdj7p7TclcfnPbsZfqwra5QKxo2YqvU' + token: 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJ1c2VyIiwiaWF0IjoxNjU0NDg1NjgzLCJleHAiOjE2NTQ1Mjg4ODMsImFjY291bnRJZCI6IjQ1MiJ9.rsgoTtE1l0ooK7TBTQjC8Xd1nKGYTfoQrM8BDZqODGU' }) return new Promise((resolve, reject)=>{ const { url } = options uni.request({ header, - url: ((url.includes('weChatAppletCallback') || url.includes('userBinding')) ? 'http://192.168.31.137:9000/' : config.baseURL) + url, + url: ((url.includes('weChatAppletCallback') || url.includes('userBinding')) ? 'http://192.168.31.151:9000/' : config.baseURL) + url, method: options.method || 'GET', // 请求类型,默认为GET data: options.data || {}, // 请求参数,默认空对象 success: ({ data }) => { diff --git a/pages.json b/pages.json index 4fca702..f14e044 100644 --- a/pages.json +++ b/pages.json @@ -1,11 +1,13 @@ { "pages": [ - { - "path": "pages/index/index", - "style": { - "navigationBarTitleText": "首页" - } - }, + { + "path" : "pages/main/main", + "style" : + { + "navigationBarTitleText": "", + "enablePullDownRefresh": false + } + }, { "path" : "pages/login/login", "style" : @@ -158,15 +160,6 @@ "enablePullDownRefresh": false } } - ,{ - "path" : "pages/main/main", - "style" : - { - "navigationBarTitleText": "", - "enablePullDownRefresh": false - } - - } ], "condition": { //模式配置,仅开发期间生效 "current": 0, //当前激活的模式(list 的索引项) @@ -192,7 +185,7 @@ "height": "100px", "spacing": "10px", "list": [{ - "pagePath": "pages/index/index", + "pagePath": "pages/main/main", "iconPath": "static/image/tab1.png", "selectedIconPath": "static/image/tab1-1.png", "text": "首页" diff --git a/pages/index/index.vue b/pages/index/index.vue deleted file mode 100644 index cb08d2e..0000000 --- a/pages/index/index.vue +++ /dev/null @@ -1,96 +0,0 @@ - - - - - diff --git a/pages/invite/invite.vue b/pages/invite/invite.vue index cf01cde..1e0f9ec 100644 --- a/pages/invite/invite.vue +++ b/pages/invite/invite.vue @@ -3,7 +3,7 @@ Annie 邀请你加入 - + 或然科技城市合伙人计划 加入并自动为你创建一个团队群组 diff --git a/pages/login/login.vue b/pages/login/login.vue index 49ac5f7..ef999b1 100644 --- a/pages/login/login.vue +++ b/pages/login/login.vue @@ -53,7 +53,7 @@ // 检查登录状态 checkLogin() { if (uni.getStorageSync('token')) { - this.$util.to('../main/main') + this.toIndex() } else { this.isLogin = false this.getPhone = false @@ -78,8 +78,9 @@ this.openId = e.openid this.unionid = e.unionid uni.setStorageSync('sessionKey', e.session_key) + // 如果没有绑定手机号,则显示绑定按钮,引导用户绑定,否则,直接跳到首页 if (data.state === 'login') { - this.$util.to('../main/main') + this.toIndex() uni.setStorageSync('token', data.token) } else { this.isLogin = true @@ -106,17 +107,23 @@ const accountInfo = uni.getAccountInfoSync() // 获取小程序appid const pc = new WXBizDataCrypt(accountInfo.miniProgram.appId , this.sessionKey) const data = pc.decryptData(encryptedData , iv) + // 绑定手机号 userBinding({ openId: this.openId, phone: data.phoneNumber, unionid: this.unionid }).then(({ token }) => { uni.setStorageSync('token', token) - this.$util.to('../main/main') + this.toIndex() }).catch(e => {}) }, toAgreement(id) { this.$util.to('../detail/detail?id=' + id) + }, + toIndex() { + uni.reLaunch({ + url: '../main/main' + }) } } } diff --git a/pages/main/main.vue b/pages/main/main.vue index 5f2028b..bcc65fd 100644 --- a/pages/main/main.vue +++ b/pages/main/main.vue @@ -23,6 +23,73 @@ 产品 + + + + + + 销售进展 + + + + 本月 + + + + + + + 本月新增客户 + 152 + + + 我的客户 + 23 + + + + + 本月新增产品试用 + 152 + + + 试用客户 + 23 + + + + + + + + + + + 年度业绩看板 + + + + + + + 12W + 成交总额 + + + 0.9W + 收益金额 + + + 8.3w + 已到账 + + + 1.4w + 未到账 + + + + @@ -84,7 +151,7 @@ display: flex; justify-content: space-around; align-items: center; - margin-top: 10rpx; + margin: 10rpx 0 30rpx; text-align: center; .icon { width: 78rpx; @@ -94,4 +161,83 @@ color: #333; } } +.panel { + margin: 20rpx 10rpx; + background-color: #fff; + border-radius: 20rpx; + overflow: hidden; + .title { + display: flex; + justify-content: space-between; + align-items: center; + padding: 17rpx 20rpx; + background: linear-gradient(90deg, #E5EFFF 0%, #FFFFFF 100%); + } + .left { + display: flex; + align-items: center; + font-size: 30rpx; + color: #333; + } + .right { + display: flex; + align-items: center; + font-size: 28rpx; + color: #333; + text { + margin: 0 15rpx 0 8rpx; + } + } + .icon { + width: 36rpx; + margin-right: 10rpx; + } + .date { + width: 26rpx; + } + .arrow { + width: 16rpx; + } + .data { + padding: 33rpx 36rpx; + } + .line { + display: flex; + } + .first { + .item:first-child { + width: 65%; + } + .name { + margin-bottom: 14rpx; + font-size: 24rpx; + color: #999; + } + .val { + font-size: 30rpx; + color: #333; + } + .line:first-child { + margin-bottom: 32rpx; + } + } + .second { + padding: 38rpx 36rpx; + .line { + justify-content: space-between; + } + .item { + text-align: center; + } + .val { + margin-bottom: 10rpx; + font-size: 30rpx; + color: #333; + } + .name { + font-size: 24rpx; + color: #999; + } + } +} diff --git a/pages/ordered/ordered.vue b/pages/ordered/ordered.vue index 1c5428a..61a4a49 100644 --- a/pages/ordered/ordered.vue +++ b/pages/ordered/ordered.vue @@ -13,9 +13,9 @@