diff --git a/app.js b/app.js index 789f546..acb0edc 100644 --- a/app.js +++ b/app.js @@ -18,24 +18,28 @@ // this.httpUrl = 'http://192.168.0.24:9000' this.httpUrl = 'https://api-test.qniao.cn' } - wx.getSystemInfo({ - success: e => { - this.globalData.StatusBar = e.statusBarHeight; - let custom = wx.getMenuButtonBoundingClientRect(); - this.globalData.Custom = custom; - this.globalData.CustomBar = custom.bottom + custom.top - e.statusBarHeight; - let windowHeight = e.windowHeight * (750 / e.windowWidth); - let statusBarHeight = this.globalData.CustomBar * (750 / e.windowWidth); - this.globalData.fragmentHeight = windowHeight - statusBarHeight - this.globalData.isIPhoneX = this.checkIPhoneX(e) - } - }) + }, + // 获取高度 + onShow: function(){ + wx.getSystemInfo({ + success: e => { + this.globalData.StatusBar = e.statusBarHeight; + let custom = wx.getMenuButtonBoundingClientRect(); + this.globalData.Custom = custom; + this.globalData.CustomBar = custom.bottom + custom.top - e.statusBarHeight; + let windowHeight = e.windowHeight * (750 / e.windowWidth); + let statusBarHeight = this.globalData.CustomBar * (750 / e.windowWidth); + this.globalData.fragmentHeight = windowHeight - statusBarHeight + this.globalData.isIPhoneX = this.checkIPhoneX(e) + console.log(e.windowHeight + ',' + e.windowWidth) + } + }) }, //-----------------------------------------checkIPhoneX--------------------------------------------- checkIPhoneX: function (e) { var t = e.model, o = e.platform; - return /iPhone X/.test(t) && "ios" === o + return (/iPhone 11/.test(t) || /iPhone X/.test(t) || /iPhone 12/.test(t)) && 'ios' === o } }) \ No newline at end of file diff --git a/colorui/components/cu-custom.js b/colorui/components/cu-custom.js index 5ad8f52..a59eeab 100644 --- a/colorui/components/cu-custom.js +++ b/colorui/components/cu-custom.js @@ -14,7 +14,7 @@ Component({ bgColor: { type: String, default: '' - }, + }, isCustom: { type: [Boolean, String], default: false @@ -41,7 +41,7 @@ Component({ */ methods: { BackPage() { - if(getCurrentPages().length == 1){ + if (getCurrentPages().length == 1) { this.toHome() } else { wx.navigateBack({ @@ -49,10 +49,17 @@ Component({ }); } }, - toHome(){ + toHome() { wx.reLaunch({ url: '/pages/mall/shops/index', }) } + }, + ready: function () { + this.setData({ + StatusBar: app.globalData.StatusBar, + CustomBar: app.globalData.CustomBar, + Custom: app.globalData.Custom + }) } }) \ No newline at end of file diff --git a/components/password-box/index.js b/components/password-box/index.js deleted file mode 100644 index caf8421..0000000 --- a/components/password-box/index.js +++ /dev/null @@ -1,78 +0,0 @@ -// components/password-box.js -Component({ - /** - * 组件的属性列表 - */ - properties: { - // 输入框的数量 - inputLength: { - type: Number, - value: 6 - }, - // 单个输入框的宽度 - inputWidth: { - type: String, - value: '100rpx' - }, - inputHeight: { - type: String, - value: '100rpx' - }, - // 是否显示输入的值,默认隐藏 - showValue: { - type: Boolean, - value: false - } - }, - - /** - * 组件的初始数据 - */ - data: { - // input是否获取焦点 - inputFocus: false, - // 初始input值为空 - currentValue: '' - }, - - /** - * 组件的方法列表 - */ - methods: { - // 设置当前的值 - _setCurrentValue(e) { - // 在此处判断满6(inputLength)位,把值返回给上级父组件或页面 - let currentValue = e.detail.value - // 改变时,派发一个事件,如果父组件或页面中需要实时获取改变后的值,可以监听这个事件。 - this.triggerEvent('change', e.detail.value) - - this.setData({ - currentValue - }) - if (currentValue.length >= this.data.inputLength) { - this._complate() - } - }, - // 点击伪装的input时,让隐藏的input获得焦点 - _focusInput() { - this.setData({ - inputFocus: true - }) - }, - _complate() { - this.triggerEvent('inputComplate', this.data.currentValue) - }, - // 提供给外部调用的方法,显示/隐藏密码。接收一个参数,可以显性修改展示的状态。 - toggleValue(state) { - this.setData({ - showValue: state != undefined ? state : !this.data.showValue - }) - }, - // 清除input当前的值 - clearCurrentValue() { - this.setData({ - currentValue: '' - }) - } - } -}) \ No newline at end of file diff --git a/components/password-box/index.json b/components/password-box/index.json deleted file mode 100644 index e8cfaaf..0000000 --- a/components/password-box/index.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "component": true, - "usingComponents": {} -} \ No newline at end of file diff --git a/components/password-box/index.wxml b/components/password-box/index.wxml deleted file mode 100644 index 92fc1d9..0000000 --- a/components/password-box/index.wxml +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - - - - - - {{currentValue.length>=index+1?currentValue[index]:''}} - - - - - - \ No newline at end of file diff --git a/components/password-box/index.wxss b/components/password-box/index.wxss deleted file mode 100644 index c89997d..0000000 --- a/components/password-box/index.wxss +++ /dev/null @@ -1,73 +0,0 @@ -/* components/password-box.wxss */ -.password-box .password-wrapper { - display: flex; - justify-content: center; - align-items: center; -} -.password-box .password-item { - position: relative; - display: flex; - justify-content: center; - align-items: center; -} -.password-box .password-item::after { - display: block; - content: ''; - position: absolute; - top: 0; - left: 0; - border-left: 2px solid #999; - border-top: 2px solid #999; - border-bottom: 2px solid #999; - border-spacing: 0; - box-sizing: border-box; - width: 200%; - height: 200%; - border-radius: 0rpx; - transform: scale(0.5); - transform-origin: left top; -} - -.password-box .password-item-last { - position: relative; - display: flex; - justify-content: center; - align-items: center; -} -.password-box .password-item-last::after { - display: block; - content: ''; - position: absolute; - top: 0; - left: 0; - border-left: 2px solid #999; - border-top: 2px solid #999; - border-right: 2px solid #999; - border-bottom: 2px solid #999; - border-spacing: 0; - box-sizing: border-box; - width: 200%; - height: 200%; - border-radius: 0rpx; - transform: scale(0.5); - transform-origin: left top; -} - -.password-box .password-item + .password-item { - margin-left: -1rpx; -} -.password-box .password-wrapper .hidden { - width: 36rpx; - height: 36rpx; - border-radius: 50%; - background: #999; -} -.password-box .password-wrapper .show { - color: #333333; - font-size: 48rpx; -} -.password-box .hidden-input { - width: 0; - height: 0; - min-height: 0; -} \ No newline at end of file diff --git a/pages/mall/shops/index.js b/pages/mall/shops/index.js index 219193b..8a37682 100644 --- a/pages/mall/shops/index.js +++ b/pages/mall/shops/index.js @@ -53,6 +53,23 @@ Page({ this.fetchCheapList() this.fetchTaskList() }, + onReady: function(){ + wx.getSystemInfo({ + success: e => { + app.globalData.StatusBar = e.statusBarHeight; + let custom = wx.getMenuButtonBoundingClientRect(); + app.globalData.Custom = custom; + app.globalData.CustomBar = custom.bottom + custom.top - e.statusBarHeight; + let windowHeight = e.windowHeight * (750 / e.windowWidth); + let statusBarHeight = app.globalData.CustomBar * (750 / e.windowWidth); + app.globalData.fragmentHeight = windowHeight - statusBarHeight + this.setData({ + height: app.globalData.fragmentHeight - 200, + CustomBar: app.globalData.CustomBar + }) + } + }) + }, /** * 生命周期函数--监听页面初次渲染完成 */ diff --git a/project.config.json b/project.config.json index 802b98e..7d6b7a5 100644 --- a/project.config.json +++ b/project.config.json @@ -4,7 +4,7 @@ "ignore": [] }, "setting": { - "urlCheck": false, + "urlCheck": true, "es6": true, "enhance": true, "postcss": true, @@ -22,10 +22,11 @@ "ignore": [], "disablePlugins": [], "outputPath": "" - } + }, + "uglifyFileName": true }, "compileType": "miniprogram", - "libVersion": "2.10.4", + "libVersion": "2.11.0", "appid": "wx9e774103645f5c54", "projectname": "page-mall-mini", "debugOptions": {