Commit 09eede4c by 张立顺

fix bug

1 parent 1e71c138
...@@ -16,7 +16,7 @@ const generateRoutList = routerList => { ...@@ -16,7 +16,7 @@ const generateRoutList = routerList => {
isTab: __wxConfig.tabBar.list.some(({ pagePath }) => item.url.includes(pagePath.replace('.html', ''))) isTab: __wxConfig.tabBar.list.some(({ pagePath }) => item.url.includes(pagePath.replace('.html', '')))
} }
})) }))
} catch (err) {} } catch (err) { }
return _routerList return _routerList
} }
class Router { class Router {
...@@ -55,6 +55,7 @@ class Router { ...@@ -55,6 +55,7 @@ class Router {
thisPage.showLoading = util.showLoading thisPage.showLoading = util.showLoading
thisPage.hideLoading = util.hideLoading thisPage.hideLoading = util.hideLoading
// 用来处理兼容iphoneX的底部的横条 // 用来处理兼容iphoneX的底部的横条
console.log(util.isFullSucreen(), 'util.isFullSucreen()');
thisPage.setData({ thisPage.setData({
isFullSucreen: util.isFullSucreen() isFullSucreen: util.isFullSucreen()
}) })
...@@ -148,7 +149,7 @@ class Router { ...@@ -148,7 +149,7 @@ class Router {
*/ */
go(route, events) { go(route, events) {
// console.log(route); // console.log(route);
if(route.startsWith('/')) return wx.navigateTo({ if (route.startsWith('/')) return wx.navigateTo({
url: route, url: route,
success(res) { success(res) {
if (events) res.eventChannel.emit('getData', events) if (events) res.eventChannel.emit('getData', events)
......
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
</gl-cell> </gl-cell>
</view> </view>
<view class="deliveryUserId" wx:if="{{pointsMultiRole=='Y'}}"> <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 }}"> <block wx:if="{{ orderObj.merchantName && orderObj.deliveryEmployeeName }}">
<view class="between"> <view class="between">
<view class="start text-hide">{{orderObj.merchantName}}</view> <view class="start text-hide">{{orderObj.merchantName}}</view>
...@@ -377,7 +377,7 @@ ...@@ -377,7 +377,7 @@
</view> </view>
</gl-cell> </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)"> <gl-cell border label="支付方式" valueAlign="right" labelStyle="margin-top:-40px" wx:if="{{ isErrorOrder }}" cellHeight="{{ false }}" labelWidth="var(--fontSize152)">
<view class="payType-box error-box"> <view class="payType-box error-box">
......
...@@ -24,11 +24,11 @@ const noScroll = () => {} ...@@ -24,11 +24,11 @@ const noScroll = () => {}
/**设置粘贴板内容 */ /**设置粘贴板内容 */
const setCopyData = (data, callBack) => { const setCopyData = (data, callBack) => {
console.log(data, 'setCopyData'); console.log(data, 'setCopyData')
wx.setClipboardData({ wx.setClipboardData({
data: data, data: data,
success(res) { success(res) {
console.log(res, 'setCopyData'); console.log(res, 'setCopyData')
if (callBack && typeof callBack === 'function') callBack(res) if (callBack && typeof callBack === 'function') callBack(res)
} }
}) })
...@@ -67,8 +67,7 @@ const showToast = val => { ...@@ -67,8 +67,7 @@ const showToast = val => {
let obj = {} let obj = {}
if (val && typeof val === 'string') { if (val && typeof val === 'string') {
obj.title = val obj.title = val
obj.icon = 'none', ;(obj.icon = 'none'), (obj.duration = 3000)
obj.duration = 3000
} else { } else {
obj = val obj = val
} }
...@@ -112,7 +111,8 @@ export function handleCopy(url) { ...@@ -112,7 +111,8 @@ export function handleCopy(url) {
// var qr = wxqrcode.createQrCodeImg(url) // var qr = wxqrcode.createQrCodeImg(url)
const base64src = function (base64data) { const base64src = function (base64data) {
return new Promise((resolve, reject) => { 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')) if (!format) reject(new Error('ERROR_BASE64SRC_PARSE'))
const filePath = `${wx.env.USER_DATA_PATH}/tmp_base64src.${format}` const filePath = `${wx.env.USER_DATA_PATH}/tmp_base64src.${format}`
const buffer = wx.base64ToArrayBuffer(bodyData) const buffer = wx.base64ToArrayBuffer(bodyData)
...@@ -160,7 +160,9 @@ export function handleCopy(url) { ...@@ -160,7 +160,9 @@ export function handleCopy(url) {
* isComponents是否在组件 * isComponents是否在组件
*/ */
const getViewInfo = (name, callBack, 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 query
.select(name) .select(name)
.boundingClientRect(res => { .boundingClientRect(res => {
...@@ -175,13 +177,8 @@ const getDeviceSize = () => { ...@@ -175,13 +177,8 @@ const getDeviceSize = () => {
wx.getSystemInfo({ wx.getSystemInfo({
success: function (res) { success: function (res) {
// console.log(res) // console.log(res)
const { const { screenHeight, safeArea } = res
screenHeight, const { bottom } = safeArea
safeArea
} = res
const {
bottom
} = safeArea
const bottomLift = screenHeight - bottom const bottomLift = screenHeight - bottom
resolve({ resolve({
bottomLift bottomLift
...@@ -197,24 +194,19 @@ const isFullSucreen = isComponents => { ...@@ -197,24 +194,19 @@ const isFullSucreen = isComponents => {
const routerList = wx.$router.getRouterList() const routerList = wx.$router.getRouterList()
const router = routerList.find(item => item.url === `/${thisPage.route}`) const router = routerList.find(item => item.url === `/${thisPage.route}`)
let val = false let val = false
wx.getWindowInfo({ wx.getSystemInfo({
success(res) { success(res) {
let { let { statusBarHeight, screenHeight, windowHeight, safeArea } = res
statusBarHeight,
screenHeight,
windowHeight,
safeArea
} = res
// console.log(statusBarHeight, screenHeight, windowHeight, safeArea) // console.log(statusBarHeight, screenHeight, windowHeight, safeArea)
// const { screenHeight, safeArea } = res // const { screenHeight, safeArea } = res
const { const { bottom } = safeArea
bottom
} = safeArea
// console.log(bottom) // console.log(bottom)
// console.log(router.isTab, 'router.isTab') // console.log(router.isTab, 'router.isTab')
// windowHeight 属性会在自定义导航栏时跟screenHeight 一样导致无法区分是否是iphoneX的机型 // windowHeight 属性会在自定义导航栏时跟screenHeight 一样导致无法区分是否是iphoneX的机型
// 用safeArea可以处理 // 用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 // val = router.isTab ? screenHeight - windowHeight - statusBarHeight - 32 > 72 : screenHeight - windowHeight > 72
// if (isComponents) val = screenHeight - windowHeight > 72 // if (isComponents) val = screenHeight - windowHeight > 72
if (isComponents) val = screenHeight - bottom > 0 if (isComponents) val = screenHeight - bottom > 0
...@@ -271,4 +263,4 @@ const wxApi = { ...@@ -271,4 +263,4 @@ const wxApi = {
handleCopy handleCopy
} }
export default wxApi
\ No newline at end of file \ 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!