3
This commit is contained in:
@@ -24,6 +24,7 @@
|
||||
/* 垂直间距 */
|
||||
/* 透明度 */
|
||||
/* 文章场景相关 */
|
||||
/* 表单控件尺寸(统一配置,避免页面内硬编码) */
|
||||
.about {
|
||||
padding: 24rpx;
|
||||
}
|
||||
|
||||
@@ -182,9 +182,16 @@ const _sfc_main = {
|
||||
if (!value)
|
||||
return "-";
|
||||
const s = String(value);
|
||||
const m = s.match(/^(\d{4}-\d{2}-\d{2})([ T](\d{2}:\d{2}))/);
|
||||
const m = s.match(/^(\d{4}-\d{2}-\d{2})/);
|
||||
if (m)
|
||||
return `${m[1]} ${m[3]}`;
|
||||
return m[1];
|
||||
const d = new Date(s);
|
||||
if (!isNaN(d.getTime())) {
|
||||
const y = d.getFullYear();
|
||||
const mo = String(d.getMonth() + 1).padStart(2, "0");
|
||||
const da = String(d.getDate()).padStart(2, "0");
|
||||
return `${y}-${mo}-${da}`;
|
||||
}
|
||||
return s;
|
||||
},
|
||||
startLogin() {
|
||||
|
||||
@@ -24,6 +24,7 @@
|
||||
/* 垂直间距 */
|
||||
/* 透明度 */
|
||||
/* 文章场景相关 */
|
||||
/* 表单控件尺寸(统一配置,避免页面内硬编码) */
|
||||
.me {
|
||||
padding: 24rpx;
|
||||
}
|
||||
|
||||
@@ -24,6 +24,7 @@
|
||||
/* 垂直间距 */
|
||||
/* 透明度 */
|
||||
/* 文章场景相关 */
|
||||
/* 表单控件尺寸(统一配置,避免页面内硬编码) */
|
||||
.orders {
|
||||
padding: 16rpx 16rpx calc(env(safe-area-inset-bottom) + 16rpx);
|
||||
}
|
||||
|
||||
@@ -24,6 +24,7 @@
|
||||
/* 垂直间距 */
|
||||
/* 透明度 */
|
||||
/* 文章场景相关 */
|
||||
/* 表单控件尺寸(统一配置,避免页面内硬编码) */
|
||||
.security {
|
||||
padding: 24rpx;
|
||||
}
|
||||
|
||||
@@ -8,21 +8,67 @@ const _sfc_main = {
|
||||
isVip: false,
|
||||
expire: "",
|
||||
price: 0,
|
||||
benefits: []
|
||||
benefits: [],
|
||||
normalAdmin: { isNormalAdmin: false, applicationStatus: "none" }
|
||||
};
|
||||
},
|
||||
onShow() {
|
||||
this.loadVip();
|
||||
this.loadNormalAdminStatus();
|
||||
this.composeBenefits();
|
||||
},
|
||||
computed: {
|
||||
expireDisplay() {
|
||||
const s = String(this.expire || "");
|
||||
return s || "11年11月11日";
|
||||
const v = this.expire;
|
||||
if (v === null || v === void 0)
|
||||
return "";
|
||||
if (typeof v === "number") {
|
||||
const d = new Date(v);
|
||||
if (!isNaN(d.getTime())) {
|
||||
const y = d.getFullYear();
|
||||
const m2 = String(d.getMonth() + 1).padStart(2, "0");
|
||||
const dd = String(d.getDate()).padStart(2, "0");
|
||||
return `${y}-${m2}-${dd}`;
|
||||
}
|
||||
return "";
|
||||
}
|
||||
const s = String(v);
|
||||
const m = s.match(/^(\d{4}-\d{2}-\d{2})/);
|
||||
if (m)
|
||||
return m[1];
|
||||
const idx = s.search(/[ T]/);
|
||||
if (idx > 0) {
|
||||
const head = s.slice(0, idx);
|
||||
if (head)
|
||||
return head;
|
||||
}
|
||||
const d2 = new Date(s);
|
||||
if (!isNaN(d2.getTime())) {
|
||||
const y = d2.getFullYear();
|
||||
const m2 = String(d2.getMonth() + 1).padStart(2, "0");
|
||||
const dd2 = String(d2.getDate()).padStart(2, "0");
|
||||
return `${y}-${m2}-${dd2}`;
|
||||
}
|
||||
return s;
|
||||
},
|
||||
priceDisplay() {
|
||||
const n = Number(this.price);
|
||||
return Number.isFinite(n) && n > 0 ? n.toFixed(2) : "0.00";
|
||||
},
|
||||
applyDisabled() {
|
||||
var _a, _b;
|
||||
const s = String(((_a = this.normalAdmin) == null ? void 0 : _a.applicationStatus) || "none");
|
||||
return !!(((_b = this.normalAdmin) == null ? void 0 : _b.isNormalAdmin) || s === "approved" || s === "pending");
|
||||
},
|
||||
applyBtnText() {
|
||||
var _a, _b, _c;
|
||||
if (((_a = this.normalAdmin) == null ? void 0 : _a.isNormalAdmin) || ((_b = this.normalAdmin) == null ? void 0 : _b.applicationStatus) === "approved")
|
||||
return "已通过";
|
||||
if (((_c = this.normalAdmin) == null ? void 0 : _c.applicationStatus) === "pending")
|
||||
return "审核中";
|
||||
if (!this.isVip)
|
||||
return "仅限VIP";
|
||||
return "提交申请";
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
@@ -44,6 +90,17 @@ const _sfc_main = {
|
||||
this.isVip = false;
|
||||
}
|
||||
},
|
||||
async loadNormalAdminStatus() {
|
||||
try {
|
||||
const data = await common_http.get("/api/normal-admin/application/status");
|
||||
this.normalAdmin = {
|
||||
isNormalAdmin: !!(data == null ? void 0 : data.isNormalAdmin),
|
||||
applicationStatus: String((data == null ? void 0 : data.applicationStatus) || "none")
|
||||
};
|
||||
} catch (e) {
|
||||
this.normalAdmin = { isNormalAdmin: false, applicationStatus: "none" };
|
||||
}
|
||||
},
|
||||
async onPay() {
|
||||
try {
|
||||
await common_http.post("/api/vip/pay", {});
|
||||
@@ -52,6 +109,20 @@ const _sfc_main = {
|
||||
} catch (e) {
|
||||
common_vendor.index.showToast({ title: String(e.message || "开通失败"), icon: "none" });
|
||||
}
|
||||
},
|
||||
async onApplyNormalAdmin() {
|
||||
var _a, _b, _c;
|
||||
if (this.applyDisabled) {
|
||||
const msg = ((_a = this.normalAdmin) == null ? void 0 : _a.isNormalAdmin) || ((_b = this.normalAdmin) == null ? void 0 : _b.applicationStatus) === "approved" ? "已通过,无需重复申请" : ((_c = this.normalAdmin) == null ? void 0 : _c.applicationStatus) === "pending" ? "审核中,请耐心等待" : "不可申请";
|
||||
return common_vendor.index.showToast({ title: msg, icon: "none" });
|
||||
}
|
||||
try {
|
||||
await common_http.post("/api/normal-admin/apply", { remark: "从我的-会员发起申请" });
|
||||
common_vendor.index.showToast({ title: "申请已提交", icon: "success" });
|
||||
await this.loadNormalAdminStatus();
|
||||
} catch (e) {
|
||||
common_vendor.index.showToast({ title: String(e.message || "申请失败"), icon: "none" });
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
@@ -79,9 +150,17 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
||||
e: item.key
|
||||
});
|
||||
}),
|
||||
j: !$data.isVip
|
||||
j: $data.isVip
|
||||
}, $data.isVip ? {
|
||||
k: common_vendor.t($options.applyBtnText),
|
||||
l: common_vendor.n({
|
||||
disabled: $options.applyDisabled
|
||||
}),
|
||||
m: common_vendor.o((...args) => $options.onApplyNormalAdmin && $options.onApplyNormalAdmin(...args))
|
||||
} : {}, {
|
||||
n: !$data.isVip
|
||||
}, !$data.isVip ? {
|
||||
k: common_vendor.o((...args) => $options.onPay && $options.onPay(...args))
|
||||
o: common_vendor.o((...args) => $options.onPay && $options.onPay(...args))
|
||||
} : {});
|
||||
}
|
||||
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render]]);
|
||||
|
||||
@@ -1 +1 @@
|
||||
<view class="vip-page"><view class="vip-hero"><image class="hero-icon" src="{{a}}" mode="aspectFit"/><view class="hero-text"><text class="hero-title">{{b}}</text><text class="hero-subtitle">{{c}}</text></view><view class="{{['status-pill', e && 'active']}}"><text>{{d}}</text></view></view><view wx:if="{{f}}" class="vip-summary"><view class="summary-item"><text class="summary-label">会员状态</text><text class="summary-value success">已激活</text></view><view class="summary-item"><text class="summary-label">有效期至</text><text class="summary-value">{{g}}</text></view></view><view wx:else class="vip-summary"><view class="summary-item"><text class="summary-label">当前身份</text><text class="summary-value">普通用户</text></view><view class="summary-item"><text class="summary-label">会员价格</text><text class="summary-value highlight">¥{{h}}/月</text></view></view><view class="benefit-section"><view class="section-header"><text class="section-title">会员特权</text><text class="section-subtitle">聚焦数据留存与专业形象,让经营更有底气</text></view><view class="benefit-grid"><view wx:for="{{i}}" wx:for-item="item" wx:key="e" class="benefit-card"><image wx:if="{{item.a}}" src="{{item.b}}" class="benefit-icon" mode="aspectFit"/><text class="benefit-title">{{item.c}}</text><text class="benefit-desc">{{item.d}}</text></view></view></view><view wx:if="{{j}}" class="purchase-card"><view class="purchase-text"><text class="purchase-title">立即升级 VIP</text><text class="purchase-desc">不限历史数据、专属标识,助您高效管账</text></view><button class="purchase-btn" bindtap="{{k}}"><text>立即开通</text></button></view></view>
|
||||
<view class="vip-page"><view class="vip-hero"><image class="hero-icon" src="{{a}}" mode="aspectFit"/><view class="hero-text"><text class="hero-title">{{b}}</text><text class="hero-subtitle">{{c}}</text></view><view class="{{['status-pill', e && 'active']}}"><text>{{d}}</text></view></view><view wx:if="{{f}}" class="vip-summary"><view class="summary-item"><text class="summary-label">会员状态</text><text class="summary-value success">已激活</text></view><view class="summary-item"><text class="summary-label">有效期至</text><text class="summary-value">{{g}}</text></view></view><view wx:else class="vip-summary"><view class="summary-item"><text class="summary-label">当前身份</text><text class="summary-value">普通用户</text></view><view class="summary-item"><text class="summary-label">会员价格</text><text class="summary-value highlight">¥{{h}}/月</text></view></view><view class="benefit-section"><view class="section-header"><text class="section-title">会员特权</text><text class="section-subtitle">聚焦数据留存与专业形象,让经营更有底气</text></view><view class="benefit-grid"><view wx:for="{{i}}" wx:for-item="item" wx:key="e" class="benefit-card"><image wx:if="{{item.a}}" src="{{item.b}}" class="benefit-icon" mode="aspectFit"/><text class="benefit-title">{{item.c}}</text><text class="benefit-desc">{{item.d}}</text></view></view></view><view wx:if="{{j}}" class="apply-card"><view class="apply-text"><text class="apply-title">申请成为普通管理员</text><text class="apply-desc">在普通管理端参与配件审核</text></view><view role="button" class="{{['apply-btn', l]}}" bindtap="{{m}}"><text>{{k}}</text></view></view><view wx:if="{{n}}" class="purchase-card"><view class="purchase-text"><text class="purchase-title">立即升级 VIP</text><text class="purchase-desc">不限历史数据、专属标识,助您高效管账</text></view><button class="purchase-btn" bindtap="{{o}}"><text>立即开通</text></button></view></view>
|
||||
@@ -24,6 +24,7 @@
|
||||
/* 垂直间距 */
|
||||
/* 透明度 */
|
||||
/* 文章场景相关 */
|
||||
/* 表单控件尺寸(统一配置,避免页面内硬编码) */
|
||||
page {
|
||||
background: linear-gradient(180deg, #f8fbff 0%, #ffffff 60%) !important;
|
||||
}
|
||||
@@ -84,6 +85,11 @@ page {
|
||||
color: #fff;
|
||||
border-color: #4c8dff;
|
||||
}
|
||||
|
||||
/* 指定 hero 内激活态徽标文本为黑色 */
|
||||
.vip-hero .status-pill.active text {
|
||||
color: #000 !important;
|
||||
}
|
||||
.vip-summary {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(2, minmax(0, 1fr));
|
||||
@@ -214,6 +220,58 @@ page {
|
||||
.purchase-btn:active {
|
||||
opacity: 0.88;
|
||||
}
|
||||
.apply-card {
|
||||
margin-top: 0;
|
||||
background: linear-gradient(135deg, rgba(30, 173, 145, 0.14) 0%, rgba(30, 173, 145, 0.06) 100%);
|
||||
border-radius: 28rpx;
|
||||
padding: 30rpx 28rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 24rpx;
|
||||
border: 2rpx solid rgba(30, 173, 145, 0.18);
|
||||
box-shadow: 0 10rpx 24rpx rgba(30, 173, 145, 0.15);
|
||||
}
|
||||
.apply-text {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 10rpx;
|
||||
}
|
||||
.apply-title {
|
||||
font-size: 32rpx;
|
||||
font-weight: 800;
|
||||
color: #1ead91;
|
||||
}
|
||||
.apply-desc {
|
||||
font-size: 24rpx;
|
||||
color: #247a66;
|
||||
line-height: 34rpx;
|
||||
}
|
||||
.apply-btn {
|
||||
flex: 0 0 auto;
|
||||
padding: 20rpx 36rpx;
|
||||
border-radius: 999rpx;
|
||||
border: none;
|
||||
background-color: transparent;
|
||||
background: linear-gradient(135deg, #1ead91 0%, #159b7e 100%);
|
||||
color: #fff;
|
||||
font-size: 28rpx;
|
||||
font-weight: 700;
|
||||
box-shadow: 0 10rpx 22rpx rgba(21, 155, 126, 0.2);
|
||||
}
|
||||
.apply-btn::after {
|
||||
border: none;
|
||||
}
|
||||
.apply-btn:active {
|
||||
opacity: 0.9;
|
||||
}
|
||||
.apply-btn.disabled {
|
||||
opacity: 0.5;
|
||||
background: #c7e8df;
|
||||
color: #fff;
|
||||
box-shadow: none;
|
||||
pointer-events: none;
|
||||
}
|
||||
@media (max-width: 375px) {
|
||||
.vip-summary {
|
||||
grid-template-columns: 1fr;
|
||||
|
||||
Reference in New Issue
Block a user