Commit 09eede4c by 张立顺

fix bug

1 parent 1e71c138
......@@ -16,7 +16,7 @@ const generateRoutList = routerList => {
isTab: __wxConfig.tabBar.list.some(({ pagePath }) => item.url.includes(pagePath.replace('.html', '')))
}
}))
} catch (err) {}
} catch (err) { }
return _routerList
}
class Router {
......@@ -55,6 +55,7 @@ class Router {
thisPage.showLoading = util.showLoading
thisPage.hideLoading = util.hideLoading
// 用来处理兼容iphoneX的底部的横条
console.log(util.isFullSucreen(), 'util.isFullSucreen()');
thisPage.setData({
isFullSucreen: util.isFullSucreen()
})
......@@ -148,7 +149,7 @@ class Router {
*/
go(route, events) {
// console.log(route);
if(route.startsWith('/')) return wx.navigateTo({
if (route.startsWith('/')) return wx.navigateTo({
url: route,
success(res) {
if (events) res.eventChannel.emit('getData', events)
......
......@@ -17,7 +17,7 @@
</gl-cell>
</view>
<view class="deliveryUserId" wx:if="{{pointsMultiRole=='Y'}}">
<gl-cell border valueAlign="right" label="交付专员" requiredAfter labelWidth="var(--fontSize140)" required haveArrow bindclick="showPopup" data-show-name="selesDeliveryBox" placeholder="点击选择" >
<gl-cell border valueAlign="right" label="交付专员" requiredAfter labelWidth="var(--fontSize140)" required haveArrow bindclick="showPopup" data-show-name="selesDeliveryBox" placeholder="点击选择">
<block wx:if="{{ orderObj.merchantName && orderObj.deliveryEmployeeName }}">
<view class="between">
<view class="start text-hide">{{orderObj.merchantName}}</view>
......@@ -377,7 +377,7 @@
</view>
</gl-cell>
<!-- 补录正常一单不显示 -->
<gl-cell border wx:if="{{switchVlaue == 2 || (switchVlaue == 1&&outTradeArr.length!=1) }}" valueAlign="right" label="支付方式" labelWidth="var(--fontSize140)" requiredAfter required value="嘀加收款" disabled />
<gl-cell border wx:if="{{switchVlaue == 2 || (switchVlaue == 1&&outTradeArr.length>1) }}" valueAlign="right" label="支付方式" labelWidth="var(--fontSize140)" requiredAfter required value="嘀加收款" disabled />
<!-- 错误订单补录 -->
<gl-cell border label="支付方式" valueAlign="right" labelStyle="margin-top:-40px" wx:if="{{ isErrorOrder }}" cellHeight="{{ false }}" labelWidth="var(--fontSize152)">
<view class="payType-box error-box">
......
......@@ -24,11 +24,11 @@ const noScroll = () => {}
/**设置粘贴板内容 */
const setCopyData = (data, callBack) => {
console.log(data, 'setCopyData');
console.log(data, 'setCopyData')
wx.setClipboardData({
data: data,
success(res) {
console.log(res, 'setCopyData');
console.log(res, 'setCopyData')
if (callBack && typeof callBack === 'function') callBack(res)
}
})
......@@ -67,8 +67,7 @@ const showToast = val => {
let obj = {}
if (val && typeof val === 'string') {
obj.title = val
obj.icon = 'none',
obj.duration = 3000
;(obj.icon = 'none'), (obj.duration = 3000)
} else {
obj = val
}
......@@ -112,7 +111,8 @@ export function handleCopy(url) {
// var qr = wxqrcode.createQrCodeImg(url)
const base64src = function (base64data) {
return new Promise((resolve, reject) => {
const [a, format, bodyData] = /data:image\/(\w+);base64,(.*)/.exec(base64data) || []
const [a, format, bodyData] =
/data:image\/(\w+);base64,(.*)/.exec(base64data) || []
if (!format) reject(new Error('ERROR_BASE64SRC_PARSE'))
const filePath = `${wx.env.USER_DATA_PATH}/tmp_base64src.${format}`
const buffer = wx.base64ToArrayBuffer(bodyData)
......@@ -160,7 +160,9 @@ export function handleCopy(url) {
* isComponents是否在组件
*/
const getViewInfo = (name, callBack, isComponents) => {
const query = !isComponents ? wx.createSelectorQuery() : wx.createSelectorQuery().in(isComponents)
const query = !isComponents
? wx.createSelectorQuery()
: wx.createSelectorQuery().in(isComponents)
query
.select(name)
.boundingClientRect(res => {
......@@ -175,13 +177,8 @@ const getDeviceSize = () => {
wx.getSystemInfo({
success: function (res) {
// console.log(res)
const {
screenHeight,
safeArea
} = res
const {
bottom
} = safeArea
const { screenHeight, safeArea } = res
const { bottom } = safeArea
const bottomLift = screenHeight - bottom
resolve({
bottomLift
......@@ -197,24 +194,19 @@ const isFullSucreen = isComponents => {
const routerList = wx.$router.getRouterList()
const router = routerList.find(item => item.url === `/${thisPage.route}`)
let val = false
wx.getWindowInfo({
wx.getSystemInfo({
success(res) {
let {
statusBarHeight,
screenHeight,
windowHeight,
safeArea
} = res
let { statusBarHeight, screenHeight, windowHeight, safeArea } = res
// console.log(statusBarHeight, screenHeight, windowHeight, safeArea)
// const { screenHeight, safeArea } = res
const {
bottom
} = safeArea
const { bottom } = safeArea
// console.log(bottom)
// console.log(router.isTab, 'router.isTab')
// windowHeight 属性会在自定义导航栏时跟screenHeight 一样导致无法区分是否是iphoneX的机型
// 用safeArea可以处理
val = router.isTab ? screenHeight - windowHeight - statusBarHeight - 32 > 72 : screenHeight - bottom > 0
val = router.isTab
? screenHeight - windowHeight - statusBarHeight - 32 > 72
: screenHeight - bottom > 0
// val = router.isTab ? screenHeight - windowHeight - statusBarHeight - 32 > 72 : screenHeight - windowHeight > 72
// if (isComponents) val = screenHeight - windowHeight > 72
if (isComponents) val = screenHeight - bottom > 0
......@@ -271,4 +263,4 @@ const wxApi = {
handleCopy
}
export default wxApi
\ No newline at end of file
export default wxApi
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!