diff --git a/nsgk_entry/app.js b/nsgk_entry/app.js index 0412373..ee73cc5 100644 --- a/nsgk_entry/app.js +++ b/nsgk_entry/app.js @@ -13,7 +13,7 @@ App({ // UTIL.getCOdeFromWX({ // complate: (code) => { // console.log('app:微信code,' + code); - // //获取openId + // // //获取openId // that.getOpenIdFromFW(code); // } // }); @@ -35,7 +35,8 @@ App({ // 系统用户登录信息(用户id、token) userInfo: { memberId: '', - token: '' + token: '', + toastTimeout:null }, //微信用户登陆信息(昵称、头像、省、城市) wxUserInfo: { @@ -79,8 +80,7 @@ App({ } } }) - } - , + }, /** * 初始化globalData */ @@ -134,4 +134,25 @@ App({ }) } }, + showToast(msg, selfClass = '') { + clearTimeout(this.globalData.toastTimeout); + const page = getCurrentPages(); + const currPage = page[page.length - 1]; + currPage.setData({ + toastData: { + showFlag: true, + toastMsg: msg, + selfClass, + }, + }); + + this.globalData.toastTimeout = setTimeout(() => { + currPage.setData({ + toastData: { + showFlag: false, + selfClass: '', + }, + }); + }, 200000); + }, }) diff --git a/nsgk_entry/app.wxss b/nsgk_entry/app.wxss index 515b00d..8653c53 100644 --- a/nsgk_entry/app.wxss +++ b/nsgk_entry/app.wxss @@ -1,5 +1,6 @@ /**app.wxss**/ @import '/style/main.wxss'; +@import "./templates/global/global.wxss"; @import "/style/iconfont.wxss"; Page { font-size: 28rpx; diff --git a/nsgk_entry/env/env.js b/nsgk_entry/env/env.js index 500f86e..99f9ba7 100644 --- a/nsgk_entry/env/env.js +++ b/nsgk_entry/env/env.js @@ -1,18 +1,17 @@ module.exports = { - LOCAL: { - URL_PREFIX: 'http://110.11.11.11:8080/earth-api', + URL_PREFIX: 'http://116.255.223.226:8081/nsgk_test', }, DEV: { - URL_PREFIX: 'http://110.11.11.11:8080/earth-api', + URL_PREFIX: 'http://116.255.223.226:8081/nsgk_test', }, TEST: { - URL_PREFIX: 'http://110.11.11.11:8080/earth-api', + URL_PREFIX: 'http://116.255.223.226:8081/nsgk_test', }, PRE: { - URL_PREFIX: 'http://110.11.11.11:8080/earth-api', + URL_PREFIX: 'http://116.255.223.226:8081/nsgk_test', }, PROD: { - URL_PREFIX: 'https://110.11.11.11:8080/earth-api', + URL_PREFIX: 'http://116.255.223.226:8081/nsgk_test', } } \ No newline at end of file diff --git a/nsgk_entry/pages/index/index.wxss b/nsgk_entry/pages/index/index.wxss index abba93b..a5d2d8d 100644 --- a/nsgk_entry/pages/index/index.wxss +++ b/nsgk_entry/pages/index/index.wxss @@ -1,6 +1,4 @@ -.container{ - -} + .singleLinHidenEllipsis{ color: black; text-align: center; diff --git a/nsgk_entry/pages/logs/logs.js b/nsgk_entry/pages/logs/logs.js index 8d58b39..07800be 100644 --- a/nsgk_entry/pages/logs/logs.js +++ b/nsgk_entry/pages/logs/logs.js @@ -1,11 +1,66 @@ -// logs.js -const util = require('../../utils/util.js') - +// pages/logs/logs.js Page({ + + /** + * 页面的初始数据 + */ data: { - logs: [] + + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad: function (options) { + + }, + + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady: function () { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow: function () { + + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide: function () { + }, - onLoad() { - + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload: function () { + + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh: function () { + + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom: function () { + + }, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage: function () { + } -}) +}) \ No newline at end of file diff --git a/nsgk_entry/pages/logs/logs.json b/nsgk_entry/pages/logs/logs.json deleted file mode 100644 index 3ee76c1..0000000 --- a/nsgk_entry/pages/logs/logs.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "navigationBarTitleText": "查看启动日志", - "usingComponents": {} -} \ No newline at end of file diff --git a/nsgk_entry/pages/logs/logs.wxml b/nsgk_entry/pages/logs/logs.wxml index 7273c5e..c49f50c 100644 --- a/nsgk_entry/pages/logs/logs.wxml +++ b/nsgk_entry/pages/logs/logs.wxml @@ -1,8 +1,2 @@ - - - - - \ No newline at end of file + +pages/logs/logs.wxml diff --git a/nsgk_entry/pages/logs/logs.wxss b/nsgk_entry/pages/logs/logs.wxss deleted file mode 100644 index 5d0f224..0000000 --- a/nsgk_entry/pages/logs/logs.wxss +++ /dev/null @@ -1 +0,0 @@ -@import '/template/normalTextPrompt/normalTextPrompt.wxss'; \ No newline at end of file diff --git a/nsgk_entry/pages/show/show.wxss b/nsgk_entry/pages/show/show.wxss index e92232d..e044363 100644 --- a/nsgk_entry/pages/show/show.wxss +++ b/nsgk_entry/pages/show/show.wxss @@ -1,5 +1,5 @@ -@import '/template/bottomUserSQ/bottomUserSQ.wxss'; +@import '/templates/bottomUserSQ/bottomUserSQ.wxss'; .scroll_page { height: 100vh; diff --git a/nsgk_entry/pages/user/login/login.js b/nsgk_entry/pages/user/login/login.js index 32cf8d6..3fcd41f 100644 --- a/nsgk_entry/pages/user/login/login.js +++ b/nsgk_entry/pages/user/login/login.js @@ -1,5 +1,6 @@ // pages/index/index.js import * as UTIL from '../../../utils/util.js'; +const APP = getApp(); Page({ /** @@ -65,5 +66,45 @@ Page({ */ onShareAppMessage: function () { + }, + + getPhoneNumber: function(e) { + let that = this; + let { + detail + } = e; + console.log(detail) + if (!detail.encryptedData) { + APP.showToast("未获取到手机号码,注册失败!"); + return; + } + + + //     if (res.detail.userInfo) { + //       //用户按了允许授权按钮 + //       var that = this; + //       // 获取到用户的信息了,打印到控制台上看下 + //       console.log("用户的信息如下:"); + //       console.log(res.detail); + //       //授权成功后,通过改变 isHide 的值,让实现页面显示出来,把授权页面隐藏起来 + //       that.setData({ + //         isHide: false + //       }); + //     } else { + //       //用户按了拒绝按钮 + //       wx.showModal({ + //         title: '警告', + //         content: '您点击了拒绝授权,将无法进入小程序,请授权之后再进入!!!', + //         showCancel: false, + //         confirmText: '返回授权', + //         success: function(res) { + //           // 用户没有授权成功,不需要改变 isHide 的值 + //           if (res.confirm) { + //             console.log('用户点击了“返回授权”'); + //           } + //         } + //       }); + //     } } + }) \ No newline at end of file diff --git a/nsgk_entry/pages/user/login/login.wxml b/nsgk_entry/pages/user/login/login.wxml index 9001f64..8869e6d 100644 --- a/nsgk_entry/pages/user/login/login.wxml +++ b/nsgk_entry/pages/user/login/login.wxml @@ -1,10 +1,13 @@ - - + + + + + 农村事项审批与记账 - 报账简单,操作便捷 + 报账简单,操作便捷 - \ No newline at end of file + diff --git a/nsgk_entry/pages/user/login/login.wxss b/nsgk_entry/pages/user/login/login.wxss index 0a76434..249a488 100644 --- a/nsgk_entry/pages/user/login/login.wxss +++ b/nsgk_entry/pages/user/login/login.wxss @@ -40,6 +40,7 @@ font-size: 2.21vh; color: #2c7339; box-shadow: 8rpx 6rpx 20rpx rgba(0,0,0,.3); + padding: 0; } .container .quick-login .authorization{ diff --git a/nsgk_entry/template/normalTextPrompt/normalTextPrompt.wxml b/nsgk_entry/template/normalTextPrompt/normalTextPrompt.wxml deleted file mode 100644 index 43dd174..0000000 --- a/nsgk_entry/template/normalTextPrompt/normalTextPrompt.wxml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - \ No newline at end of file diff --git a/nsgk_entry/template/normalTextPrompt/normalTextPrompt.wxss b/nsgk_entry/template/normalTextPrompt/normalTextPrompt.wxss deleted file mode 100644 index c2cb700..0000000 --- a/nsgk_entry/template/normalTextPrompt/normalTextPrompt.wxss +++ /dev/null @@ -1,44 +0,0 @@ -/** - * 提示层 - 没有更多了 - */ - - .noMore { - width: 100%; - font-size: 24rpx; - color: #CCC; - text-align: center; - padding: 20rpx 0; - padding-bottom:calc(20rpx + constant(safe-area-inset-bottom)); - padding-bottom:calc(20rpx + env(safe-area-inset-bottom)); -} -/** - * 提示层 - 暂无数据 - */ - - .error-page-tpl { - position: fixed; - left: 0; - top: 35%; - width: 100%; - transform: translate(0, -50%); - display: flex; - flex-flow: column; - justify-content: center; - align-items: center; - z-index: 2; -} - -.error-page-tpl image { - width: 400rpx; - height: 400rpx; -} - -.error-page-tpl .error-tpl-msg { - margin-top: -30rpx; - font-size: 24rpx; - color: #999; - word-wrap: break-word; - word-break: normal; - width: 100%; - text-align: center; -} \ No newline at end of file diff --git a/nsgk_entry/template/bottomUserSQ/bottomUserSQ.wxml b/nsgk_entry/templates/bottomUserSQ/bottomUserSQ.wxml similarity index 100% rename from nsgk_entry/template/bottomUserSQ/bottomUserSQ.wxml rename to nsgk_entry/templates/bottomUserSQ/bottomUserSQ.wxml diff --git a/nsgk_entry/template/bottomUserSQ/bottomUserSQ.wxss b/nsgk_entry/templates/bottomUserSQ/bottomUserSQ.wxss similarity index 100% rename from nsgk_entry/template/bottomUserSQ/bottomUserSQ.wxss rename to nsgk_entry/templates/bottomUserSQ/bottomUserSQ.wxss diff --git a/nsgk_entry/templates/global/global.js b/nsgk_entry/templates/global/global.js new file mode 100644 index 0000000..3db8765 --- /dev/null +++ b/nsgk_entry/templates/global/global.js @@ -0,0 +1,18 @@ + +function modalResult(event) { + const { result } = event.currentTarget.dataset; + const page = getCurrentPages(); + const currPage = page[page.length - 1]; + + currPage.setData({ + modalData: { + showFlag: false, + } + }); + + return result === '1'; +} + +export { + modalResult, +} \ No newline at end of file diff --git a/nsgk_entry/templates/global/global.wxml b/nsgk_entry/templates/global/global.wxml new file mode 100644 index 0000000..ab673b7 --- /dev/null +++ b/nsgk_entry/templates/global/global.wxml @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/nsgk_entry/templates/global/global.wxss b/nsgk_entry/templates/global/global.wxss new file mode 100644 index 0000000..ea7436e --- /dev/null +++ b/nsgk_entry/templates/global/global.wxss @@ -0,0 +1,167 @@ + + /** + * 提示层 - 没有更多了 + */ + + .noMore { + width: 100%; + font-size: 24rpx; + color: #CCC; + text-align: center; + padding: 20rpx 0; + padding-bottom: env(safe-area-inset-bottom); + } + + + /** + * 提示层 - 暂无数据 + */ + + .error-page-tpl { + position: fixed; + left: 0; + top: 35%; + width: 100%; + transform: translate(0, -50%); + display: flex; + flex-flow: column; + justify-content: center; + align-items: center; + z-index: 2; + } + + .error-page-tpl image { + width: 400rpx; + height: 400rpx; + } + + .error-page-tpl .error-tpl-msg { + margin-top: -30rpx; + font-size: 24rpx; + color: #999; + word-wrap: break-word; + word-break: normal; + width: 100%; + text-align: center; + } + .error-page-tpl .zb-back-live{ + display: block; + /* width: 192rpx; */ + height: 64rpx; + margin: 30rpx auto 0; + line-height: 64rpx; + text-align: center; + font-size: 30rpx; + color: var(--blueLight); + background: #fff; + border-radius: 32rpx; + border: 1rpx solid #7AA6CC; + padding: 0 32rpx; + } + + /** + * 全局 toast 提示层样式 + */ + + .toast-container { + position: fixed; + left: 0; + bottom: 20%; + width: 100%; + transform: translate(0, -50%); + transform: translate3d(0, -50%, 10000rpx); + z-index: 99999; + text-align: center; + overflow: hidden; + } + + .toast-container text { + display: inline-block; + padding: 20rpx; + font-size: 28rpx; + line-height: 1.2; + color: #FFF; + background: rgba(0, 0, 0, 0.8); + border-radius: 12rpx; + } + + .modal-container { + position: fixed; + left: 0; + top: 0; + right: 0; + bottom: 0; + background: rgba(0, 0, 0, 0.5); + display: flex; + flex-flow: column; + justify-content: center; + align-items: center; + z-index: 9999; + transform: translateZ(100rpx); + } + + .modal-container .modal-msg-container { + width: 540rpx; + background: #FFF; + border-radius: 20rpx; + } + + .modal-container .modal-msg-container .modal-msg { + padding: 60rpx 20rpx; + line-height: 40rpx; + font-size: 32rpx; + color: #444; + text-align: center; + } + + .modal-container .modal-msg-container .modal-btn-container { + border-top: 2rpx solid #ededed; + width: 100%; + height: 96rpx; + font-size: 32rpx; + color: #444; + display: flex; + justify-content: center; + align-items: center; + overflow: hidden; + } + + .modal-container .modal-msg-container .modal-btn-container view { + flex: 1; + text-align: center; + line-height: 0; + padding: 48rpx; + } + + .modal-container .modal-msg-container .modal-btn-container .confirm-btn { + color: #FF4752; + } + + .modal-container .modal-msg-container .modal-btn-container .cancel-btn { + border-right: 2rpx solid #ededed; + } + + #global-loading { + z-index: 9999999; + position: fixed; + top: 0%; + left: 0%; + width: 100%; + height: 100%; + background-color: rgba(255, 255, 255, 0.5); + } + + #global-loading.hide-mask { + background: transparent; + } + + #global-loading image { + position: absolute; + top: 50%; + left: 50%; + width: 180rpx; + height: 180rpx; + -webkit-transform: translate(-90rpx, -90rpx); + transform: translate(-90rpx, -90rpx); + z-index: 99999999; + } \ No newline at end of file diff --git a/nsgk_entry/utils/API.js b/nsgk_entry/utils/API.js index 63fd80e..3bcee59 100644 --- a/nsgk_entry/utils/API.js +++ b/nsgk_entry/utils/API.js @@ -6,13 +6,12 @@ let { URL_PREFIX, } = EVN_CONFIG[DISTRIBUTE_ENVIROMENT]; //用户登录页面,接口检测用户token失效,需跳转重新登录 -const USER_LOGIN_PAGE_PATH='/pages/user/wxLogin/wxLogin'; +const USER_LOGIN_PAGE_PATH='/pages/user/login/login'; //接口成功 const SUCCESS_CODE = '000000'; //微信登陆失效 const INVALID_USER_TOKEN_CODE = '001007'; -/* 渠道来源 渠道ID:[ios-217;安卓-218;M版-219;小程序-220;线下-221] */ -const CHANNERL_220 = 220; + /****************接口提示信息start ****************/ const MSG_FAIL_HTTP = '获取数据失败 fail'; @@ -31,15 +30,13 @@ const URL_LOCATION_SHOPQUERYBYLOCATION = `${URL_PREFIX}/location/shopquerybyloca /* 根据版块信息获取推荐数据 */ const URL_ZB_RECOMMEND_LIST = `${URL_PREFIX}/recommend/list`; //获取openId -const URL_GET_OPENID=`https://110.11.11.11:8080/wx/getXcxOpenId`; +const URL_GET_OPENID=`${URL_PREFIX}/wechat/codeLogin`; /****************接口地址end****************/ - export { USER_LOGIN_PAGE_PATH, SUCCESS_CODE, INVALID_USER_TOKEN_CODE, - CHANNERL_220, MSG_FAIL_HTTP, MSG_ERROR_HTTP, MSG_FALSE_HTTP, diff --git a/nsgk_entry/utils/util.js b/nsgk_entry/utils/util.js index cb9e1c2..f60a70f 100644 --- a/nsgk_entry/utils/util.js +++ b/nsgk_entry/utils/util.js @@ -115,8 +115,6 @@ function httpRequest(url, data, { Object.assign(finalData, data); finalData.memberId = getApp().globalData.userInfo.memberId; finalData.token = getApp().globalData.userInfo.token; - //渠道:小程序 - finalData.channel = API.CHANNERL_220; wx.request({ url, data: finalData, @@ -262,12 +260,12 @@ function getCOdeFromWX({ complate }) { showLoadingHaveMask('正在检测账号..'); wx.login({ success: function (data) { + console.log(data) complate(data.code); }, fail: function (err) { hideLoadingHaveMask(); showModalNoneCancel("温馨提示", "登陆失败,建议请重新打开小程序") - } }) }