The membership system and points mall of the mini program
Design and Implementation of Membership System
The membership system in WeChat Mini Programs typically consists of three core components: tier classification, growth value calculation, and benefit design. Tier classification can adopt common models like Silver, Gold, and Diamond, while growth values are dynamically calculated based on user behavior:
// Example of growth value calculation
function calculateGrowthValue(userBehavior) {
let growthValue = 0;
if (userBehavior.login) growthValue += 5; // Daily login
if (userBehavior.purchase) growthValue += 10 * userBehavior.orderAmount; // Purchase amount
if (userBehavior.share) growthValue += 8; // Sharing behavior
return growthValue;
}
Membership benefit design should consider:
- Basic benefits: Birthday discounts, dedicated customer service
- Advanced benefits: Priority purchasing, discount coupon packs
- Exclusive benefits: Eligibility to purchase limited-edition products
Core Functional Modules of Points Mall
The Points Mall requires a complete closed-loop system for points earning, spending, and redemption. Key functional modules include:
- Points Earning Rules:
const pointRules = {
dailyLogin: 10, // Daily login
completeProfile: 50, // Complete profile
firstPurchase: 100, // First purchase reward
reviewProduct: 20 // Product review
};
- Product Redemption System:
- Physical products: Requires integration with logistics systems
- Virtual products: Instant delivery of redemption codes
- Coupons: Directly deposited into user accounts
- Expiration Reminder Mechanism:
function checkPointsExpiry(user) {
const expiryThreshold = 30; // Remind 30 days in advance
if (user.pointsExpiryDays <= expiryThreshold) {
sendTemplateMsg({
userId: user.id,
msg: `Your ${user.points} points will expire in ${user.pointsExpiryDays} days`
});
}
}
User Behavior Incentive Strategies
Effective incentive strategies can significantly boost member engagement:
- Consecutive Check-in Design:
// Incremental rewards for consecutive check-ins
function getCheckInReward(consecutiveDays) {
const base = 10;
return base * Math.min(consecutiveDays, 7); // Maximum 7x reward
}
- Task System Construction:
- Newbie tasks: Complete profile, first purchase
- Daily tasks: Daily login, share products
- Challenge tasks: Weekly spending of ¥500 or more
- Points Multiplier Events:
function applyPointMultiplier(points, activity) {
const multipliers = {
'newYear': 2,
'anniversary': 3,
'weeklySpecial': 1.5
};
return points * (multipliers[activity.type] || 1);
}
Data Tracking and Performance Analysis
The membership system requires comprehensive data monitoring:
- Key Metric Tracking:
// Example of member behavior tracking
wx.reportAnalytics('member_action', {
action_type: 'point_exchange',
item_id: 'coupon_50off',
point_cost: 500
});
- Core Conversion Funnel:
- Member registration → First purchase → Repeat purchase
- Points view → Product browsing → Redemption completion
- A/B Testing Implementation:
// Group testing for different benefit plans
const testGroups = {
groupA: { discount: 0.9, freeShipping: false },
groupB: { discount: 0.85, freeShipping: true }
};
Key Technical Implementation Points
Technical considerations during actual development:
- Concurrency Control:
// Using cloud functions to ensure atomic points operations
cloud.callFunction({
name: 'updateUserPoints',
data: {
userId: 'xxx',
deltaPoints: 100,
operation: 'add'
}
});
- Caching Strategy:
# Redis storage for user's daily points earning status
SET user:12345:daily_points 150 EX 86400
- Security Measures:
// API call rate limiting
const rateLimit = require('express-rate-limit');
const limiter = rateLimit({
windowMs: 15 * 60 * 1000, // 15 minutes
max: 50 // 50 requests per IP
});
User Experience Optimization Details
Specific methods to enhance the membership system experience:
- Points Change Notification:
function sendPointNotification(userId, change) {
wx.requestSubscribeMessage({
tmplIds: ['POINT_CHANGE_TMPL'],
success(res) {
if (res['POINT_CHANGE_TMPL'] === 'accept') {
cloud.callFunction({
name: 'sendMsg',
data: {
userId,
templateId: 'POINT_CHANGE_TMPL',
data: {
amount: Math.abs(change.value),
type: change.type > 0 ? 'added' : 'deducted',
balance: change.balance
}
}
});
}
}
});
}
- Visualization of Expiring Points:
<view class="progress-container">
<progress
percent="{{expiredPercent}}"
stroke-width="6"
activeColor="#FF4949"
/>
<text>{{expiringSoon}} points expiring soon</text>
</view>
- Member-Exclusive Interface:
.member-badge {
background: linear-gradient(135deg, #FFD700 0%, #D4AF37 100%);
box-shadow: 0 2px 8px rgba(212, 175, 55, 0.3);
}
本站部分内容来自互联网,一切版权均归源网站或源作者所有。
如果侵犯了你的权益请来信告知我们删除。邮箱:cc@cccx.cn
上一篇:小程序的A/B测试与优化
下一篇:小程序的社群运营与私域流量