123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323 |
- <script>
- var jpushModule = uni.requireNativePlugin("JG-JPush")
- export default {
- globalData: {
- baseUrl: '',
- token: '',
- changeOrg:'',
- version: '', // 当前版本号
- buildType: 'uat', // 打包环境对应类型,pro 生产 uat 预发布 dev 本地开发
- envTips: '', // 环境文字提示
- theme: 'default', // 主题,default
- isIphoneXup: false //是否iphonex以及以上的版本
- },
- mounted() {
- // 非V3模式
- if (this.$scope) {
- this.$scope.globalData.token = this.$store.state.vuex_token;
- this.$scope.globalData.changeOrg = this.$store.state.vuex_changeOrg;
- } else {
- // V3模式
- getApp({ allowDefault: true }).globalData.token = this.$store.state.vuex_token;
- getApp({ allowDefault: true }).globalData.changeOrg = this.$store.state.vuex_changeOrg;
- }
- this.$config('init');
- },
- onLaunch: function() {
- console.log('App launch')
- // // 极光推送
- // if(uni.getSystemInfoSync().platform == "ios"){
- // // 请求定位权限
- // let locationServicesEnabled = jpushModule.locationServicesEnabled()
- // let locationAuthorizationStatus = jpushModule.getLocationAuthorizationStatus()
- // console.log('locationAuthorizationStatus',locationAuthorizationStatus)
- // if (locationServicesEnabled == true && locationAuthorizationStatus < 3) {
- // jpushModule.requestLocationAuthorization((result)=>{
- // console.log('定位权限',result.status)
- // })
- // }
- // jpushModule.requestNotificationAuthorization((result)=>{
- // let status = result.status
- // if (status < 2) {
- // uni.showToast({
- // icon: 'none',
- // title: '您还没有打开通知权限',
- // duration: 3000
- // })
- // }
- // })
- // }
- // // 初始化
- // jpushModule.initJPushService();
- // jpushModule.setLoggerEnable(true);
- // jpushModule.addConnectEventListener(result=>{
- // let connectEnable = result.connectEnable
- // uni.$emit('connectStatusChange',connectEnable)
- // });
-
- // jpushModule.addNotificationListener(result=>{
- // let notificationEventType = result.notificationEventType
- // let messageID = result.messageID
- // let title = result.title
- // let content = result.content
- // let extras = result.extras
-
- // uni.showToast({
- // icon: 'none',
- // title: JSON.stringify(result),
- // duration: 3000
- // })
- // });
-
- // jpushModule.addCustomMessageListener(result=>{
- // let type = result.type
- // let messageType = result.messageType
- // let content = result.content
- // uni.showToast({
- // icon: 'none',
- // title: JSON.stringify(result),
- // duration: 3000
- // })
- // })
-
- // jpushModule.addLocalNotificationListener(result=>{
- // let messageID = result.messageID
- // let title = result.title
- // let content = result.content
- // let extras = result.extras
- // uni.showToast({
- // icon: 'none',
- // title: JSON.stringify(result),
- // duration: 3000
- // })
- // })
-
- // jpushModule.addGeofenceListener(result=>{
- // let code = result.code
- // let type = result.type
- // let geofenceId = result.geofenceId
- // let userInfo = result.userInfo
- // uni.showToast({
- // icon: 'none',
- // title: '触发地理围栏',
- // duration: 3000
- // })
- // })
-
- // jpushModule.setIsAllowedInMessagePop(true)
- // jpushModule.pullInMessage(result=>{
- // let code = result.code
- // console.log(code)
- // })
-
- // jpushModule.addInMessageListener(result=>{
- // let eventType = result.eventType
- // let messageType = result.messageType
- // let content = result.content
- // console.log('inMessageListener',eventType,messageType,content)
-
- // uni.showToast({
- // icon: 'none',
- // title: JSON.stringify(result),
- // duration: 3000
- // })
- // })
- },
- onShow: function() {
- console.log('App Show')
- },
- onHide: function() {
- console.log('App Hide')
- },
- }
- </script>
- <style lang="scss">
- @import "./static/iconfont/iconfont.css";
- @import "uview-ui/index.scss";
- /*每个页面公共css */
- page {
- width: 100%;
- min-height: 100%;
- display: flex;
- background-color: #F8F8F8;
- }
- /* 登录页是否记住密码多选框样式 */
- uni-checkbox.login-form-checkbox .uni-checkbox-input{
- width: 24upx !important;
- height: 24upx !important;
- }
- .status_bar {
- height: var(--status-bar-height);
- width: 100%;
- }
- .isIPXup{
- padding-bottom: 64rpx !important;
- }
- /* form表单样式 */
- .form-box{
- background-color: #fff;
- padding: 0 30rpx;
- }
- .form-input {
- font-size: 28rpx;
- color: #333;
- text-align: right;
- width: 95%;
- box-sizing: border-box;
- height: 60rpx;
- line-height: 60rpx;
- &.textarea{
- height: 240rpx;
- padding: 24rpx 0;
- text-align: left;
- }
- }
-
- .form-input-placeholder {
- font-size: 28rpx;
- color: #999;
- }
- .form-textarea{
- height: 240rpx;
- padding: 24rpx 0;
- text-align: left;
- }
- .form-number-input{
- margin: 0 auto;
- }
- .u-required{
- position: relative;
- }
- .u-required:before{
- content: '*';
- position: absolute;
- left: -8px;
- top: 10upx;
- font-size: 14px;
- color: #fa3534;
- height: 9px;
- line-height: 1;
- }
- /* 元素宽度 百分比 */
- .uni-col-1{
- box-sizing: border-box;
- width: 10%;
- }
- .uni-col-2{
- box-sizing: border-box;
- width: 20%;
- }
- .uni-col-3{
- box-sizing: border-box;
- width: 30%;
- }
- .uni-col-4{
- box-sizing: border-box;
- width: 40%;
- }
- .uni-col-5{
- box-sizing: border-box;
- width: 50%;
- }
- .uni-col-6{
- box-sizing: border-box;
- width: 60%;
- }
- .uni-col-7{
- box-sizing: border-box;
- width: 70%;
- }
- .uni-col-8{
- box-sizing: border-box;
- width: 80%;
- }
- .uni-col-9{
- box-sizing: border-box;
- width: 90%;
- }
- .uni-col-10{
- box-sizing: border-box;
- width: 100%;
- }
-
- /* felx布局 */
- .flex{
- display: -webkit-flex; /* Chrome 21+, Safari 6.1+, iOS Safari 7+, Opera 15/16 */
- display: -moz-flex; /* Firefox 18+ */
- display: -ms-flexbox; /* IE 10 */
- display: flex; /* Chrome 29+, Firefox 22+, IE 11+, Opera 12.1/17/18, Android 4.4+ */
- }
- /*伸缩流方向*/
- .flex_column{
- -webkit-box-orient: vertical;
- -ms-flex-direction: column;
- -webkit-flex-direction: column;
- flex-direction: column;
- }
- /*主轴对齐*/
- .justify_center{
- -webkit-box-pack: center;
- -ms-flex-pack: center;
- -webkit-justify-content: center;
- justify-content: center;
- }
- .justify_end{
- -webkit-box-pack: end;
- -ms-flex-pack: end;
- -webkit-justify-content: flex-end;
- justify-content: flex-end;
- }
- .justify_between{
- -webkit-box-pack: justify;
- -ms-flex-pack: justify;
- -webkit-justify-content: space-between;
- justify-content: space-between;
- }
- /*侧轴对齐*/
- .align_start{
- -webkit-box-align: start;
- -ms-flex-align: start;
- -webkit-align-items: flex-start;
- align-items: flex-start;
- }
- .align_end{
- -webkit-box-align: end;
- -ms-flex-align: end;
- -webkit-align-items: flex-end;
- align-items: flex-end;
- }
- .align_center{
- -webkit-box-align: center;
- -ms-flex-align: center;
- -webkit-align-items: center;
- align-items: center;
- }
- .align_baseline{
- -webkit-box-align: baseline;
- -ms-flex-align: baseline;
- -webkit-align-items: baseline;
- align-items: baseline;
- }
- /*伸缩性*/
- .flex_auto{
- -webkit-box-flex: 1;
- -ms-flex: auto;
- -webkit-flex: auto;
- flex: auto;
- }
- .flex_1{
- -webkit-box-flex: 1;
- -ms-flex: 1;
- -webkit-flex: 1;
- flex: 1;
- }
- // ios15原生input的type=search时会默认自带搜索图标。
- // 在全局的公共样式隐藏ios自带搜索图标即可
- [type="search"]::-webkit-search-decoration {
- display: none;
- }
- uni-toast {
- z-index: 1000000;
- }
- </style>
|