<template>
|
<u-popup :show="value" mode="left" @open="handleOpen" @close="handleClose" closeOnClickOverlay
|
customStyle="background-color: #FAFAFA;">
|
<scroll-view scroll-y class="setting-scroll">
|
<view class="setting-page">
|
<u-cell-group :border="false" :customStyle="cellGroupStyle">
|
<u-cell title="发现好友" url="/pages/componentsB/tag/tag" :border="false">
|
<u-icon slot="icon" :size="btnSize" name="search"></u-icon>
|
</u-cell>
|
</u-cell-group>
|
|
<u-cell-group :border="false" :customStyle="cellGroupStyle">
|
<u-cell title="创作者中心" url="/pages/componentsB/tag/tag" :border="false">
|
<u-icon slot="icon" :size="btnSize" name="search"></u-icon>
|
</u-cell>
|
</u-cell-group>
|
<u-cell-group :border="false" :customStyle="cellGroupStyle">
|
<u-cell title="我的草稿" url="/pages/componentsB/tag/tag" :border="false">
|
<u-icon slot="icon" :size="btnSize" name="search"></u-icon>
|
</u-cell>
|
<u-cell title="我的评论" url="/pages/componentsB/tag/tag" :border="false">
|
<u-icon slot="icon" :size="btnSize" name="search"></u-icon>
|
</u-cell>
|
<u-cell title="浏览记录" url="/pages/componentsB/tag/tag" :border="false">
|
<u-icon slot="icon" :size="btnSize" name="search"></u-icon>
|
</u-cell>
|
</u-cell-group>
|
<u-cell-group :border="false" :customStyle="cellGroupStyle">
|
<u-cell title="订单" url="/pages/componentsB/tag/tag" :border="false">
|
<u-icon slot="icon" :size="btnSize" name="search"></u-icon>
|
</u-cell>
|
<u-cell title="购物车" url="/pages/componentsB/tag/tag" :border="false">
|
<u-icon slot="icon" :size="btnSize" name="search"></u-icon>
|
</u-cell>
|
<u-cell title="钱包" url="/pages/componentsB/tag/tag" :border="false">
|
<u-icon slot="icon" :size="btnSize" name="search"></u-icon>
|
</u-cell>
|
<u-cell title="小程序" url="/pages/componentsB/tag/tag" :border="false">
|
<u-icon slot="icon" :size="btnSize" name="search"></u-icon>
|
</u-cell>
|
<u-cell title="社区公约" url="/pages/componentsB/tag/tag" :border="false">
|
<u-icon slot="icon" :size="btnSize" name="search"></u-icon>
|
</u-cell>
|
</u-cell-group>
|
<u-cell-group :border="false" :customStyle="cellGroupStyle">
|
<u-cell title="小程序" url="/pages/componentsB/tag/tag" :border="false">
|
<u-icon slot="icon" :size="btnSize" name="search"></u-icon>
|
</u-cell>
|
|
</u-cell-group>
|
<u-cell-group :border="false" :customStyle="cellGroupStyle">
|
<u-cell title="社区公约" url="/pages/componentsB/tag/tag" :border="false">
|
<u-icon slot="icon" :size="btnSize" name="search"></u-icon>
|
</u-cell>
|
</u-cell-group>
|
</view>
|
</scroll-view>
|
<view class="opeartor-view">
|
<u-grid :border="false" @click="click">
|
<u-grid-item v-for="(baseListItem, baseListIndex) in baseList" :key="baseListIndex"
|
@click="handleGridClick(baseListItem, baseListIndex)">
|
<u-icon :customStyle="{ paddingTop: 20 + 'rpx' }" :name="baseListItem.name" :size="30"></u-icon>
|
<text class="grid-text">{{ baseListItem.title }}</text>
|
</u-grid-item>
|
</u-grid>
|
</view>
|
</u-popup>
|
</template>
|
|
<script>
|
export default {
|
name: "SettingPopup",
|
props: {
|
value: Boolean
|
},
|
data() {
|
return {
|
cellGroupStyle: 'background-color: #ffffff; margin-bottom: 20rpx; border-radius: 16rpx;',
|
btnSize: 50,
|
baseList: [{
|
name: 'scan',
|
title: '扫一扫'
|
},
|
{
|
name: 'kefu-ermai',
|
title: '帮助与客服'
|
},
|
{
|
name: 'setting',
|
title: '设置'
|
},
|
]
|
};
|
},
|
watch: {
|
value(newVal) {
|
if (!newVal) {
|
|
}
|
}
|
},
|
computed: {
|
|
},
|
methods: {
|
handleGridClick(item, index) {
|
console.log('点击了:', item, '索引为:', index);
|
|
// 举例:根据 title 跳转
|
if (item.title === '订单') {
|
uni.navigateTo({
|
url: '/pages/order/index'
|
});
|
} else if (item.title === '购物车') {
|
uni.navigateTo({
|
url: '/pages/cart/index'
|
});
|
} else {
|
// 通用跳转
|
uni.navigateTo({
|
url: item.url || '/pages/default/index'
|
});
|
}
|
},
|
handleOpen() { },
|
handleClose() {
|
this.$emit("input", false);
|
},
|
}
|
};
|
</script>
|
|
<style lang="scss" scoped>
|
.setting-page {
|
width: 400rpx;
|
padding: 20rpx;
|
box-sizing: border-box;
|
overflow-y: auto;
|
height: calc(100vh - 200rpx);
|
}
|
|
.cell-group {
|
margin-bottom: 20rpx;
|
background-color: #FFFFFF;
|
}
|
|
.opeartor-view {
|
position: absolute;
|
bottom: 0;
|
left: 0;
|
width: 100%;
|
padding: 10rpx;
|
box-shadow: 0 -4rpx 20rpx rgba(0, 0, 0, 0.05);
|
z-index: 10;
|
box-sizing: border-box;
|
height: 200rpx;
|
|
.grid-text {
|
font-size: 26rpx;
|
color: #909399;
|
padding: 10rpx 0 20rpx 0rpx;
|
/* #ifndef APP-PLUS */
|
box-sizing: border-box;
|
/* #endif */
|
}
|
}
|
</style>
|