feat(uniapp_v2): 二开功能迁移与小程序主包优化
- 从 uniapp 迁移 HJF 页面、API、组件及用户/订单相关改动 - queue、assets 使用独立分包以降低主包体积 - 修复首页单根节点与支付结果页 v-if 链 - 关闭 HjfDemoPanel 全局注册;uniNoticeBar 注释 $getAppWebview 避免 __webviewId__ 报错 - 配置域名与 manifest 应用名称;cache/store 防御性处理 Made-with: Cursor
This commit is contained in:
138
pro_v3.5.1/view/uniapp_v2/components/NavBar.vue
Normal file
138
pro_v3.5.1/view/uniapp_v2/components/NavBar.vue
Normal file
@@ -0,0 +1,138 @@
|
||||
<template>
|
||||
<view class="navbar">
|
||||
<view class="content" :style="{ background: isScrolling ? '#fff' : bagColor,'padding-top': sysHeight + 'px' }">
|
||||
<view class="flex-center h-80 px-20">
|
||||
<view class="w-40 h-40 flex-center">
|
||||
<view
|
||||
v-show="showBack"
|
||||
@click="back"
|
||||
class="iconfont icon-ic_leftarrow"
|
||||
:style="{ color: `${iconColor}`, fontSize: `${iconSize}`, fontWeight: `${iconWeight}` }"
|
||||
></view>
|
||||
</view>
|
||||
<view class="flex-1 text-center"
|
||||
:style="{ color: `${textColor}`, fontSize: `${textSize}`, fontWeight: `${textWeight}` }"
|
||||
v-if="!custom">{{ titleText }}</view>
|
||||
<view class="flex-1" v-else>
|
||||
<slot></slot>
|
||||
</view>
|
||||
<view class="w-40 h-40 flex-center">
|
||||
<view v-show="showRight" class="right-icon"></view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view :style="{'padding-top': sysHeight + 'px'}" v-if="showEmpty">
|
||||
<view class="h-80"></view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
let sysHeight = uni.getWindowInfo().statusBarHeight;
|
||||
export default {
|
||||
name: 'navbar',
|
||||
props: {
|
||||
custom:{
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
fixed: {
|
||||
type: Boolean,
|
||||
default: true
|
||||
},
|
||||
showEmpty:{
|
||||
type: Boolean,
|
||||
default: true
|
||||
},
|
||||
// 滚动至下部
|
||||
isScrolling: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
// 是否显示返回icon
|
||||
showBack: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
// Title
|
||||
titleText: {
|
||||
type: String,
|
||||
default: ''
|
||||
},
|
||||
// icon 颜色
|
||||
iconColor: {
|
||||
type: String,
|
||||
default: '#000000'
|
||||
},
|
||||
// icon 字号
|
||||
iconSize: {
|
||||
type: String,
|
||||
default: '40rpx'
|
||||
},
|
||||
// icon 字重
|
||||
iconWeight: {
|
||||
type: String,
|
||||
default: 'bold'
|
||||
},
|
||||
// Title 颜色
|
||||
textColor: {
|
||||
type: String,
|
||||
default: '#333'
|
||||
},
|
||||
// Title 字号
|
||||
textSize: {
|
||||
type: String,
|
||||
default: '34rpx'
|
||||
},
|
||||
// Title 字重
|
||||
textWeight: {
|
||||
type: String,
|
||||
default: '500'
|
||||
},
|
||||
// 背景色
|
||||
bagColor: {
|
||||
type: String,
|
||||
default: 'transparent'
|
||||
},
|
||||
showRight:{
|
||||
type: Boolean,
|
||||
default: false
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
sysHeight:sysHeight,
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
back() {
|
||||
let pages = getCurrentPages(); // 获取当前打开过的页面路由数,
|
||||
if (pages.length > 1) {
|
||||
uni.navigateBack()
|
||||
} else {
|
||||
uni.switchTab({
|
||||
url: '/pages/index/index'
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.navbar {
|
||||
position: relative;
|
||||
color: #333;
|
||||
.content {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
right: 0;
|
||||
left: 0;
|
||||
z-index: 998;
|
||||
background-color: var(--view-theme);
|
||||
font-weight: 500;
|
||||
font-size: 34rpx;
|
||||
color: #ffffff;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user