| @@ -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); | |||
| }, | |||
| }) | |||
| @@ -1,7 +1,7 @@ | |||
| { | |||
| "pages": [ | |||
| "pages/index/index", | |||
| "pages/user/login/login", | |||
| "pages/index/index", | |||
| "pages/show/show", | |||
| "pages/logs/logs" | |||
| ], | |||
| @@ -1,5 +1,6 @@ | |||
| /**app.wxss**/ | |||
| @import '/style/main.wxss'; | |||
| @import "./templates/global/global.wxss"; | |||
| @import "/style/iconfont.wxss"; | |||
| Page { | |||
| font-size: 28rpx; | |||
| @@ -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', | |||
| } | |||
| } | |||
| @@ -1,6 +1,4 @@ | |||
| .container{ | |||
| } | |||
| .singleLinHidenEllipsis{ | |||
| color: black; | |||
| text-align: center; | |||
| @@ -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 () { | |||
| } | |||
| }) | |||
| }) | |||
| @@ -1,4 +0,0 @@ | |||
| { | |||
| "navigationBarTitleText": "查看启动日志", | |||
| "usingComponents": {} | |||
| } | |||
| @@ -1,8 +1,2 @@ | |||
| <import src="/template/normalTextPrompt/normalTextPrompt.wxml"></import> | |||
| <!--底部提示 已经到底啦--> | |||
| <!-- <view style="background-color:bisque;width: 100vw;height: 100vh;"> | |||
| <image mode="widthFix" src="https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fimgs.design006.com%2F202007%2FDesign006_eDNxzQm7dd.jpg%3Fx-oss-process%3Dstyle%2Fprev_w_750_h_auto&refer=http%3A%2F%2Fimgs.design006.com&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=jpeg?sec=1644113858&t=c0e5ad3d3eb92aec483d26699be6b41b" style="width: 100%;"></image> | |||
| <template is="noMore" ></template> | |||
| </view> --> | |||
| <!--显示 --> | |||
| <template is="empty"></template> | |||
| <!--pages/logs/logs.wxml--> | |||
| <text>pages/logs/logs.wxml</text> | |||
| @@ -1 +0,0 @@ | |||
| @import '/template/normalTextPrompt/normalTextPrompt.wxss'; | |||
| @@ -1,5 +1,5 @@ | |||
| @import '/template/bottomUserSQ/bottomUserSQ.wxss'; | |||
| @import '/templates/bottomUserSQ/bottomUserSQ.wxss'; | |||
| .scroll_page | |||
| { | |||
| height: 100vh; | |||
| @@ -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('用户点击了“返回授权”'); | |||
| // } | |||
| // } | |||
| // }); | |||
| // } | |||
| } | |||
| }) | |||
| @@ -1,10 +1,13 @@ | |||
| <view class="container" style="background: url('../../../image/login/container_bg.jpg') center center no-repeat; background-size: 100% auto;"> | |||
| <view class="header"> | |||
| <import src="/templates/global/global"/> | |||
| <template is="toast" data="{{...toastData}}"></template> | |||
| <view class="container" style="background: url('../../../image/login/container_bg.jpg') center center no-repeat; background-size: 100% auto;"> | |||
| <view class="header" > | |||
| <view class="principal">农村事项审批与记账</view> | |||
| <view class="instructions">报账简单,操作便捷</view> | |||
| <view class="instructions">报账简单,操作便捷</view> | |||
| </view> | |||
| <view class="quick-login" style="bottom:{{isIPhoneX?'8vh':'5vh'}}"> | |||
| <view class="key-login">微信一键登录</view> | |||
| <button class="key-login" type='primary' open-type='getPhoneNumber' bindgetphonenumber="getPhoneNumber">微信一键登录</button > | |||
| <view class="authorization" style="margin-top:{{isIPhoneX?'5vh':'3vh'}}"> | |||
| <label> | |||
| <checkbox value="cb" checked="true" class="changeSize"/> | |||
| @@ -12,4 +15,4 @@ | |||
| </label> | |||
| </view> | |||
| </view> | |||
| </view> | |||
| </view> | |||
| @@ -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{ | |||
| @@ -1,12 +0,0 @@ | |||
| <!-- 提示层 - 没有更多了 --> | |||
| <template name="noMore"> | |||
| <view class="noMore">{{noMoreMes||'已经到底啦~'}}</view> | |||
| </template> | |||
| <!-- 提示层 - 暂无数据 --> | |||
| <template name="empty"> | |||
| <view class="error-page-tpl"> | |||
| <image src="https://shgm.jjyyx.com/m/images/{{errorImageName||'error_img3.png'}}?20190704" mode="aspectFit"></image> | |||
| <text class="error-tpl-msg">{{emptyMsg||'暂无数据'}}</text> | |||
| </view> | |||
| </template> | |||
| @@ -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; | |||
| } | |||
| @@ -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, | |||
| } | |||
| @@ -0,0 +1,57 @@ | |||
| <!-- 提示层 - 没有更多了 --> | |||
| <template name="noMore"> | |||
| <view class="noMore">{{noMoreMes||'已经到底啦~'}}</view> | |||
| </template> | |||
| <!-- 提示层 - 暂无数据 --> | |||
| <template name="empty"> | |||
| <view class="error-page-tpl"> | |||
| <image src="https://shgm.jjyyx.com/m/images/{{errorImageName||'error_img3.png'}}?20190704" mode="aspectFit"></image> | |||
| <text class="error-tpl-msg">{{emptyMsg||'暂无数据'}}</text> | |||
| <block wx:if="{{backBtnState && backBtnState >= 1 && !exitBtn}}"> | |||
| <view class="zb-back-live" bindtap="{{backBtnState >= 1?'allowToBack': ''}}">{{backBtnMsg}}</view> | |||
| </block> | |||
| <block wx:if="{{exitBtn}}"> | |||
| <navigator class="zb-back-live" open-type="exit" target="miniProgram">{{backBtnMsg}}</navigator> | |||
| </block> | |||
| </view> | |||
| </template> | |||
| <!-- 全局 toast 提示层 --> | |||
| <template name="toast"> | |||
| <block wx:if="{{showFlag}}"> | |||
| <view class="toast-container {{selfClass}}"> | |||
| <text>{{toastMsg}}</text> | |||
| </view> | |||
| </block> | |||
| </template> | |||
| <!-- 全局 modal 弹框 --> | |||
| <template name="modal"> | |||
| <block wx:if="{{showFlag}}"> | |||
| <view class="modal-container"> | |||
| <view class="modal-msg-container"> | |||
| <view class="modal-msg">{{content}}</view> | |||
| <view class="modal-btn-container"> | |||
| <block wx:if="{{showCancel}}"> | |||
| <view class="cancel-btn" data-result="0" bindtap="modalCallback">{{cancelText||'取消'}}</view> | |||
| </block> | |||
| <view class="confirm-btn" data-result="1" bindtap="{{myCallBack?myCallBack:'modalCallback'}}">{{confirmText||'确定'}}</view> | |||
| </view> | |||
| </view> | |||
| </view> | |||
| </block> | |||
| </template> | |||
| <!-- 全局 弹窗loading 小图提示--> | |||
| <template name='globalLoading'> | |||
| <block wx:if="{{globalLoading}}"> | |||
| <view id='global-loading' class="{{globalLoading.hideMask ? 'hide-mask' : '' }}"> | |||
| <image src='https://shgm.jjyyx.com/m/images/loadings.gif'></image> | |||
| </view> | |||
| </block> | |||
| </template> | |||
| @@ -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; | |||
| } | |||
| @@ -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, | |||
| @@ -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("温馨提示", "登陆失败,建议请重新打开小程序") | |||
| } | |||
| }) | |||
| } | |||