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:
133
pro_v3.5.1/view/uniapp_v2/components/homeList/index.vue
Normal file
133
pro_v3.5.1/view/uniapp_v2/components/homeList/index.vue
Normal file
@@ -0,0 +1,133 @@
|
||||
<template>
|
||||
<!-- 顶部下拉导航 -->
|
||||
<view class="dialog_nav dialogIndex"
|
||||
:style="{ top: navH + 'px' }" v-show="currentPage">
|
||||
<view class="dialog_nav_item" :class="item.after"
|
||||
v-for="(item,index) in headerNav" :key="index"
|
||||
@tap="linkPage(item.url)">
|
||||
<text class="iconfont" :class="item.icon"></text>
|
||||
<text class="pl-20">{{item.name}}</text>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
export default {
|
||||
name: "homeIdex",
|
||||
props: {
|
||||
navH: {
|
||||
type: String|Number,
|
||||
default: ""
|
||||
},
|
||||
currentPage: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
openNavList:{
|
||||
type: Array,
|
||||
default: ()=>[]
|
||||
},
|
||||
navList: {
|
||||
type: Array,
|
||||
default: ()=>[]
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
selectNavList:[
|
||||
{name:'首页',icon:'icon-ic_mall',url:'/pages/index/index',after:'dialog_after'},
|
||||
{name:'搜索',icon:'icon-ic_search',url:'/pages/goods/goods_search/index',after:'dialog_after'},
|
||||
{name:'购物车',icon:'icon-ic_ShoppingCart1',url:'/pages/order_addcart/order_addcart',after:'dialog_after'},
|
||||
{name:'我的收藏',icon:'icon-ic_star',url:'/pages/users/user_goods_collection/index',after:'dialog_after'},
|
||||
{name:'个人中心',icon:'icon-a-ic_user1',url:'/pages/user/index'},
|
||||
]
|
||||
};
|
||||
},
|
||||
computed:{
|
||||
headerNav(){
|
||||
if(this.navList.length){
|
||||
return this.navList
|
||||
}else{
|
||||
let arr = [];
|
||||
this.selectNavList.forEach((item,index)=>{
|
||||
if(this.openNavList.includes(index)){
|
||||
arr.push(item);
|
||||
}
|
||||
})
|
||||
return arr
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
linkPage(url){
|
||||
if (['/pages/goods_cate/goods_cate', '/pages/order_addcart/order_addcart', '/pages/user/index', '/pages/index/index']
|
||||
.indexOf(url) == -1) {
|
||||
uni.navigateTo({
|
||||
url: url
|
||||
})
|
||||
} else {
|
||||
uni.switchTab({
|
||||
url: url
|
||||
})
|
||||
}
|
||||
}
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.dialog_nav{
|
||||
position: fixed;
|
||||
left: 14rpx;
|
||||
width: 240rpx;
|
||||
background: #FFFFFF;
|
||||
box-shadow: 0px 0px 16rpx rgba(0, 0, 0, 0.08);
|
||||
z-index: 310;
|
||||
border-radius: 14rpx;
|
||||
&::before{
|
||||
content: '';
|
||||
width: 0;
|
||||
height: 0;
|
||||
position: absolute;
|
||||
left: -26rpx;
|
||||
right: 0;
|
||||
margin:auto;
|
||||
top:-9px;
|
||||
border-bottom: 10px solid #FFFFFF;
|
||||
border-left: 10px solid transparent; /*transparent 表示透明*/
|
||||
border-right: 10px solid transparent;
|
||||
}
|
||||
&.dialogIndex{
|
||||
left: 14rpx;
|
||||
&::before{
|
||||
left: 0rpx !important;
|
||||
}
|
||||
}
|
||||
}
|
||||
.dialog_nav_item{
|
||||
width: 100%;
|
||||
height: 84rpx;
|
||||
line-height: 84rpx;
|
||||
padding: 0 20rpx 0;
|
||||
box-sizing: border-box;
|
||||
border-bottom: #eee;
|
||||
font-size: 28rpx;
|
||||
color: #333;
|
||||
position: relative;
|
||||
display: flex;
|
||||
.iconfont{
|
||||
font-size: 32rpx;
|
||||
margin-right: 26rpx;
|
||||
}
|
||||
}
|
||||
.dialog_after{
|
||||
::after{
|
||||
content: '';
|
||||
position: absolute;
|
||||
width:90px;
|
||||
height: 1px;
|
||||
background-color: #EEEEEE;
|
||||
bottom: 0;
|
||||
right: 0;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user