feat:优化
This commit is contained in:
@@ -1,9 +1,13 @@
|
||||
<template>
|
||||
<view class="order_warp">
|
||||
<view class="order_header">
|
||||
<up-image src="/static/common/left.png" width="20" height="20" bgColor="#f1f6ff00" @click="jumpLeft"></up-image>
|
||||
<up-search shape="round" bgColor="#FFFFFFFF" :showAction="false" @blur="onBlur" @search="searchFun"
|
||||
v-model="search"></up-search>
|
||||
<view class="order_warp" :style="mpWarpStyle">
|
||||
<view class="order_header" :style="mpHeaderStyle">
|
||||
<view class="back_btn" @click="jumpLeft">
|
||||
<up-image src="/static/common/left.png" width="20" height="20" bgColor="#f1f6ff00"></up-image>
|
||||
</view>
|
||||
<view class="search_box">
|
||||
<up-search shape="round" bgColor="#FFFFFFFF" :showAction="false" @blur="onBlur" @search="searchFun"
|
||||
v-model="search"></up-search>
|
||||
</view>
|
||||
</view>
|
||||
<view class="order_type_title">
|
||||
<view :class="form.type === item.id
|
||||
@@ -95,7 +99,7 @@
|
||||
<view>共{{ item.buyNum }}件,合计¥{{ item.sumAmount }}</view>
|
||||
</view> -->
|
||||
<view class="collect_msg" v-if="item.buyDeductionValue">共{{ item.buyNum }}件,合计数字积分{{ item.buyDeductionValue
|
||||
}}
|
||||
}}
|
||||
+¥{{ item.sumAmount }}</view>
|
||||
<view class="collect_msg" v-if="!item.buyDeductionValue">运费:¥{{ item.postage }},商品总价:¥{{ item.sumAmount }}
|
||||
</view>
|
||||
@@ -392,10 +396,15 @@ export default {
|
||||
activeIndex: 0,
|
||||
aftterSalesProduct: {}, //售后商品信息
|
||||
deleteShow: false,
|
||||
deleteInfo: {}
|
||||
deleteInfo: {},
|
||||
mpWarpStyle: {},
|
||||
mpHeaderStyle: {}
|
||||
};
|
||||
},
|
||||
onLoad(options) {
|
||||
// #ifdef MP-WEIXIN || MP
|
||||
this.initMPHeader();
|
||||
// #endif
|
||||
const type = options.type;
|
||||
this.form.type = type ? parseInt(type, 10) : MINE_ORDER_TYPE.UNPAID;
|
||||
this.$nextTick(() => {
|
||||
@@ -411,6 +420,34 @@ export default {
|
||||
this.userinfo();
|
||||
},
|
||||
methods: {
|
||||
initMPHeader() {
|
||||
// #ifdef MP-WEIXIN || MP
|
||||
try {
|
||||
const menuButton = uni.getMenuButtonBoundingClientRect();
|
||||
const systemInfo = uni.getSystemInfoSync();
|
||||
|
||||
if (menuButton && menuButton.top && menuButton.top > 0) {
|
||||
const menuButtonHeight = menuButton.height || 32;
|
||||
const menuButtonTop = menuButton.top;
|
||||
const menuButtonLeft = menuButton.left;
|
||||
const windowWidth = systemInfo.windowWidth;
|
||||
|
||||
this.mpWarpStyle = {
|
||||
paddingTop: `${menuButtonTop}px`
|
||||
};
|
||||
|
||||
this.mpHeaderStyle = {
|
||||
height: `${menuButtonHeight}px`,
|
||||
paddingRight: `${windowWidth - menuButtonLeft + 10}px`,
|
||||
display: 'flex',
|
||||
alignItems: 'center'
|
||||
};
|
||||
}
|
||||
} catch (e) {
|
||||
console.error("initMPHeader error:", e);
|
||||
}
|
||||
// #endif
|
||||
},
|
||||
dayjs,
|
||||
getValue,
|
||||
formatDate1,
|
||||
@@ -654,10 +691,6 @@ export default {
|
||||
} catch (error) {
|
||||
console.error("加载数据失败:", error);
|
||||
} finally {
|
||||
console.log(
|
||||
"this.orderList1111",
|
||||
JSON.parse(JSON.stringify(this.orderList))
|
||||
);
|
||||
this.$forceUpdate();
|
||||
this.loading = false; // 设置加载状态为false
|
||||
}
|
||||
@@ -969,13 +1002,35 @@ export default {
|
||||
height: calc(100vh - env(safe-area-inset-bottom) - 130rpx);
|
||||
background-color: $app-bj;
|
||||
padding: 100rpx 30rpx 30rpx;
|
||||
/* #ifdef MP-WEIXIN */
|
||||
padding-top: 20rpx;
|
||||
/* #endif */
|
||||
overflow-y: hidden;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.order_header {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
width: 100%;
|
||||
box-sizing: border-box;
|
||||
|
||||
.back_btn {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
height: 100%;
|
||||
margin-right: 20rpx;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.search_box {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
height: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
.order_type_title {
|
||||
|
||||
Reference in New Issue
Block a user