阿里云主机折上折
  • 微信号
Current Site:Index > The membership system and points mall of the mini program

The membership system and points mall of the mini program

Author:Chuan Chen 阅读数:27411人阅读 分类: 微信小程序

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:

  1. Points Earning Rules:
const pointRules = {
  dailyLogin: 10,        // Daily login
  completeProfile: 50,   // Complete profile
  firstPurchase: 100,    // First purchase reward
  reviewProduct: 20      // Product review
};
  1. Product Redemption System:
  • Physical products: Requires integration with logistics systems
  • Virtual products: Instant delivery of redemption codes
  • Coupons: Directly deposited into user accounts
  1. 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:

  1. 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
}
  1. Task System Construction:
  • Newbie tasks: Complete profile, first purchase
  • Daily tasks: Daily login, share products
  • Challenge tasks: Weekly spending of ¥500 or more
  1. 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:

  1. Key Metric Tracking:
// Example of member behavior tracking
wx.reportAnalytics('member_action', {
  action_type: 'point_exchange',
  item_id: 'coupon_50off',
  point_cost: 500
});
  1. Core Conversion Funnel:
  • Member registration → First purchase → Repeat purchase
  • Points view → Product browsing → Redemption completion
  1. 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:

  1. Concurrency Control:
// Using cloud functions to ensure atomic points operations
cloud.callFunction({
  name: 'updateUserPoints',
  data: {
    userId: 'xxx',
    deltaPoints: 100,
    operation: 'add'
  }
});
  1. Caching Strategy:
# Redis storage for user's daily points earning status
SET user:12345:daily_points 150 EX 86400
  1. 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:

  1. 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
            }
          }
        });
      }
    }
  });
}
  1. Visualization of Expiring Points:
<view class="progress-container">
  <progress 
    percent="{{expiredPercent}}" 
    stroke-width="6"
    activeColor="#FF4949"
  />
  <text>{{expiringSoon}} points expiring soon</text>
</view>
  1. 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

Front End Chuan

Front End Chuan, Chen Chuan's Code Teahouse 🍵, specializing in exorcising all kinds of stubborn bugs 💻. Daily serving baldness-warning-level development insights 🛠️, with a bonus of one-liners that'll make you laugh for ten years 🐟. Occasionally drops pixel-perfect romance brewed in a coffee cup ☕.