3
tj
2025-05-22 14764dd7679369a650ad1d60be62aacc863755a1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
<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 if (item.title === '设置') {
        uni.navigateTo({
          url: '/sub-pages/mine/settings'
        });
      } 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>