|
|
@@ -0,0 +1,243 @@
|
|
|
1
|
+<template>
|
|
|
2
|
+ <view class="about-mall-page">
|
|
|
3
|
+ <view v-if="pageLoading" class="about-mall-state">
|
|
|
4
|
+ <u-loading-icon mode="circle" />
|
|
|
5
|
+ </view>
|
|
|
6
|
+
|
|
|
7
|
+ <view v-else-if="pageError" class="about-mall-state">
|
|
|
8
|
+ <u-empty mode="page" :text="pageError" icon-size="80" />
|
|
|
9
|
+ <u-button type="primary" text="重试" size="small" custom-style="margin-top:24rpx" @click="loadConfig" />
|
|
|
10
|
+ </view>
|
|
|
11
|
+
|
|
|
12
|
+ <scroll-view v-else class="about-mall-scroll" scroll-y>
|
|
|
13
|
+ <view class="about-hero">
|
|
|
14
|
+ <image class="about-hero__logo" src="/static/logo.png" mode="aspectFit" />
|
|
|
15
|
+ <text class="about-hero__name">巴青农资商城</text>
|
|
|
16
|
+ <text class="about-hero__desc">专注农资供应,服务广大农户与经销商</text>
|
|
|
17
|
+ </view>
|
|
|
18
|
+
|
|
|
19
|
+ <view class="about-card">
|
|
|
20
|
+ <text class="about-card__title">商城信息</text>
|
|
|
21
|
+ <view class="about-row">
|
|
|
22
|
+ <text class="about-row__label">货币符号</text>
|
|
|
23
|
+ <text class="about-row__val">{{ about.currencySymbol }}</text>
|
|
|
24
|
+ </view>
|
|
|
25
|
+ <view class="about-row">
|
|
|
26
|
+ <text class="about-row__label">商品销量展示</text>
|
|
|
27
|
+ <text class="about-row__val">{{ about.showSales ? '展示' : '不展示' }}</text>
|
|
|
28
|
+ </view>
|
|
|
29
|
+ </view>
|
|
|
30
|
+
|
|
|
31
|
+ <view v-if="about.hasFiling" class="about-card">
|
|
|
32
|
+ <text class="about-card__title">备案信息</text>
|
|
|
33
|
+ <view
|
|
|
34
|
+ v-for="item in about.filings"
|
|
|
35
|
+ :key="item.key"
|
|
|
36
|
+ class="about-filing"
|
|
|
37
|
+ @click="onFilingClick(item)"
|
|
|
38
|
+ >
|
|
|
39
|
+ <text class="about-filing__label">{{ item.label }}</text>
|
|
|
40
|
+ <view class="about-filing__link">
|
|
|
41
|
+ <text class="about-filing__no">{{ item.no }}</text>
|
|
|
42
|
+ <u-icon name="arrow-right" color="#2e7d32" size="14" />
|
|
|
43
|
+ </view>
|
|
|
44
|
+ </view>
|
|
|
45
|
+ <text class="about-card__tip">点击备案号可在浏览器查看主管机关公示页</text>
|
|
|
46
|
+ </view>
|
|
|
47
|
+
|
|
|
48
|
+ <view v-else class="about-card about-card--empty">
|
|
|
49
|
+ <text class="about-card__title">备案信息</text>
|
|
|
50
|
+ <text class="about-empty-text">暂无备案信息</text>
|
|
|
51
|
+ </view>
|
|
|
52
|
+
|
|
|
53
|
+ <view class="about-footer">
|
|
|
54
|
+ <text class="about-footer__text">© 巴青农资商城</text>
|
|
|
55
|
+ </view>
|
|
|
56
|
+ </scroll-view>
|
|
|
57
|
+ </view>
|
|
|
58
|
+</template>
|
|
|
59
|
+
|
|
|
60
|
+<script setup>
|
|
|
61
|
+import { ref, reactive } from 'vue'
|
|
|
62
|
+import { onShow } from '@dcloudio/uni-app'
|
|
|
63
|
+import { getMallConfig } from '@/api/mallConfig'
|
|
|
64
|
+import { mapMallAboutPage, openExternalLink } from '@/utils/mallConfigDisplay'
|
|
|
65
|
+
|
|
|
66
|
+const pageLoading = ref(true)
|
|
|
67
|
+const pageError = ref('')
|
|
|
68
|
+const about = reactive({
|
|
|
69
|
+ currencySymbol: '¥',
|
|
|
70
|
+ showSales: true,
|
|
|
71
|
+ filings: [],
|
|
|
72
|
+ hasFiling: false
|
|
|
73
|
+})
|
|
|
74
|
+
|
|
|
75
|
+async function loadConfig() {
|
|
|
76
|
+ pageLoading.value = true
|
|
|
77
|
+ pageError.value = ''
|
|
|
78
|
+ try {
|
|
|
79
|
+ const res = await getMallConfig()
|
|
|
80
|
+ const mapped = mapMallAboutPage(res.data)
|
|
|
81
|
+ about.currencySymbol = mapped.currencySymbol
|
|
|
82
|
+ about.showSales = mapped.showSales
|
|
|
83
|
+ about.filings = mapped.filings
|
|
|
84
|
+ about.hasFiling = mapped.hasFiling
|
|
|
85
|
+ } catch (e) {
|
|
|
86
|
+ pageError.value = (e && e.message) || '加载失败'
|
|
|
87
|
+ } finally {
|
|
|
88
|
+ pageLoading.value = false
|
|
|
89
|
+ }
|
|
|
90
|
+}
|
|
|
91
|
+
|
|
|
92
|
+function onFilingClick(item) {
|
|
|
93
|
+ if (!item || !item.link) return
|
|
|
94
|
+ openExternalLink(item.link)
|
|
|
95
|
+}
|
|
|
96
|
+
|
|
|
97
|
+onShow(() => {
|
|
|
98
|
+ loadConfig()
|
|
|
99
|
+})
|
|
|
100
|
+</script>
|
|
|
101
|
+
|
|
|
102
|
+<style lang="scss" scoped>
|
|
|
103
|
+.about-mall-page {
|
|
|
104
|
+ min-height: 100vh;
|
|
|
105
|
+ background: #f5f6f8;
|
|
|
106
|
+}
|
|
|
107
|
+
|
|
|
108
|
+.about-mall-state {
|
|
|
109
|
+ display: flex;
|
|
|
110
|
+ flex-direction: column;
|
|
|
111
|
+ align-items: center;
|
|
|
112
|
+ justify-content: center;
|
|
|
113
|
+ min-height: 60vh;
|
|
|
114
|
+ padding: 48rpx;
|
|
|
115
|
+}
|
|
|
116
|
+
|
|
|
117
|
+.about-mall-scroll {
|
|
|
118
|
+ height: 100vh;
|
|
|
119
|
+ box-sizing: border-box;
|
|
|
120
|
+}
|
|
|
121
|
+
|
|
|
122
|
+.about-hero {
|
|
|
123
|
+ display: flex;
|
|
|
124
|
+ flex-direction: column;
|
|
|
125
|
+ align-items: center;
|
|
|
126
|
+ padding: 64rpx 32rpx 40rpx;
|
|
|
127
|
+ background: linear-gradient(145deg, #3d9b6e 0%, #22c55e 55%, #86efac 100%);
|
|
|
128
|
+}
|
|
|
129
|
+
|
|
|
130
|
+.about-hero__logo {
|
|
|
131
|
+ width: 120rpx;
|
|
|
132
|
+ height: 120rpx;
|
|
|
133
|
+ border-radius: 24rpx;
|
|
|
134
|
+ background: rgba(255, 255, 255, 0.9);
|
|
|
135
|
+}
|
|
|
136
|
+
|
|
|
137
|
+.about-hero__name {
|
|
|
138
|
+ margin-top: 24rpx;
|
|
|
139
|
+ font-size: 36rpx;
|
|
|
140
|
+ font-weight: 600;
|
|
|
141
|
+ color: #fff;
|
|
|
142
|
+}
|
|
|
143
|
+
|
|
|
144
|
+.about-hero__desc {
|
|
|
145
|
+ margin-top: 12rpx;
|
|
|
146
|
+ font-size: 26rpx;
|
|
|
147
|
+ color: rgba(255, 255, 255, 0.9);
|
|
|
148
|
+ text-align: center;
|
|
|
149
|
+}
|
|
|
150
|
+
|
|
|
151
|
+.about-card {
|
|
|
152
|
+ margin: 24rpx 24rpx 0;
|
|
|
153
|
+ padding: 28rpx 28rpx 20rpx;
|
|
|
154
|
+ background: #fff;
|
|
|
155
|
+ border-radius: 16rpx;
|
|
|
156
|
+}
|
|
|
157
|
+
|
|
|
158
|
+.about-card--empty {
|
|
|
159
|
+ padding-bottom: 28rpx;
|
|
|
160
|
+}
|
|
|
161
|
+
|
|
|
162
|
+.about-card__title {
|
|
|
163
|
+ display: block;
|
|
|
164
|
+ margin-bottom: 20rpx;
|
|
|
165
|
+ font-size: 30rpx;
|
|
|
166
|
+ font-weight: 600;
|
|
|
167
|
+ color: #333;
|
|
|
168
|
+}
|
|
|
169
|
+
|
|
|
170
|
+.about-card__tip {
|
|
|
171
|
+ display: block;
|
|
|
172
|
+ margin-top: 16rpx;
|
|
|
173
|
+ font-size: 22rpx;
|
|
|
174
|
+ color: #999;
|
|
|
175
|
+ line-height: 1.5;
|
|
|
176
|
+}
|
|
|
177
|
+
|
|
|
178
|
+.about-row {
|
|
|
179
|
+ display: flex;
|
|
|
180
|
+ align-items: center;
|
|
|
181
|
+ justify-content: space-between;
|
|
|
182
|
+ padding: 20rpx 0;
|
|
|
183
|
+ border-bottom: 1rpx solid #f0f0f0;
|
|
|
184
|
+}
|
|
|
185
|
+
|
|
|
186
|
+.about-row:last-child {
|
|
|
187
|
+ border-bottom: none;
|
|
|
188
|
+}
|
|
|
189
|
+
|
|
|
190
|
+.about-row__label {
|
|
|
191
|
+ font-size: 28rpx;
|
|
|
192
|
+ color: #666;
|
|
|
193
|
+}
|
|
|
194
|
+
|
|
|
195
|
+.about-row__val {
|
|
|
196
|
+ font-size: 28rpx;
|
|
|
197
|
+ color: #333;
|
|
|
198
|
+}
|
|
|
199
|
+
|
|
|
200
|
+.about-filing {
|
|
|
201
|
+ padding: 20rpx 0;
|
|
|
202
|
+ border-bottom: 1rpx solid #f0f0f0;
|
|
|
203
|
+}
|
|
|
204
|
+
|
|
|
205
|
+.about-filing:last-of-type {
|
|
|
206
|
+ border-bottom: none;
|
|
|
207
|
+}
|
|
|
208
|
+
|
|
|
209
|
+.about-filing__label {
|
|
|
210
|
+ display: block;
|
|
|
211
|
+ font-size: 26rpx;
|
|
|
212
|
+ color: #999;
|
|
|
213
|
+ margin-bottom: 8rpx;
|
|
|
214
|
+}
|
|
|
215
|
+
|
|
|
216
|
+.about-filing__link {
|
|
|
217
|
+ display: flex;
|
|
|
218
|
+ align-items: center;
|
|
|
219
|
+ justify-content: space-between;
|
|
|
220
|
+}
|
|
|
221
|
+
|
|
|
222
|
+.about-filing__no {
|
|
|
223
|
+ flex: 1;
|
|
|
224
|
+ font-size: 28rpx;
|
|
|
225
|
+ color: #2e7d32;
|
|
|
226
|
+ word-break: break-all;
|
|
|
227
|
+}
|
|
|
228
|
+
|
|
|
229
|
+.about-empty-text {
|
|
|
230
|
+ font-size: 28rpx;
|
|
|
231
|
+ color: #999;
|
|
|
232
|
+}
|
|
|
233
|
+
|
|
|
234
|
+.about-footer {
|
|
|
235
|
+ padding: 48rpx 32rpx 64rpx;
|
|
|
236
|
+ text-align: center;
|
|
|
237
|
+}
|
|
|
238
|
+
|
|
|
239
|
+.about-footer__text {
|
|
|
240
|
+ font-size: 24rpx;
|
|
|
241
|
+ color: #bbb;
|
|
|
242
|
+}
|
|
|
243
|
+</style>
|