fly před 4 dny
rodič
revize
8535a868e5
3 změnil soubory, kde provedl 102 přidání a 12 odebrání
  1. 2 2
      package-lock.json
  2. 12 9
      src/views/Profile.vue
  3. 88 1
      src/views/register.vue

+ 2 - 2
package-lock.json

@@ -1,11 +1,11 @@
 {
-  "name": "test",
+  "name": "红旗资本",
   "version": "0.1.0",
   "lockfileVersion": 3,
   "requires": true,
   "packages": {
     "": {
-      "name": "test",
+      "name": "红旗资本",
       "version": "0.1.0",
       "dependencies": {
         "axios": "^0.19.2",

+ 12 - 9
src/views/Profile.vue

@@ -78,7 +78,7 @@
           </div>
           <div class="profit-amount">¥{{ userInfo.dayred }}</div>
         </div>
-        <div class="profit-left">
+        <!-- <div class="profit-left">
           <div class="profit-header">
             <span class="item_label">医疗补贴</span>
             <button class="profit-btn button-click-effect" @click="handleMedicalWithdraw">提现</button>
@@ -91,7 +91,7 @@
             <button class="profit-btn button-click-effect" @click="handleOriginalSharesWithdraw">提现</button>
           </div>
           <div class="profit-amount">¥{{ userInfo.guquan }}</div>
-        </div>
+        </div> -->
       </div>
     </div>
 
@@ -121,18 +121,18 @@
           <img src="@/assets/225.png" alt="资金明细" />
           <span>资金明细</span>
         </div>
-        <div class="function-item button-click-effect" @click="$router.push('/asset-center')">
+       <!-- <div class="function-item button-click-effect" @click="$router.push('/asset-center')">
           <img src="@/assets/226.png" alt="股权管理" />
           <span>股权管理</span>
-        </div>
+        </div> -->
         <div class="function-item button-click-effect" @click="$router.push('/retirement-subsidy')">
           <img src="@/assets/227.png" alt="退休补贴" />
           <span>退休补贴</span>
         </div>
-        <div class="function-item button-click-effect" @click="$router.push('/order-management')">
+        <!-- <div class="function-item button-click-effect" @click="$router.push('/order-management')">
           <img src="@/assets/228.png" alt="订单管理" />
           <span>订单管理</span>
-        </div>
+        </div> -->
         <!-- <div class="function-item button-click-effect" @click="$router.push('/lever-list')">
           <span>礼品<br/>福利</span>
         </div>
@@ -245,15 +245,18 @@ export default {
     },
     // 红旗资产提现
     handleRedFlagWithdraw() {
-      this.$router.push('/mention?type=1');
+      // this.$router.push('/mention?type=1');
+      this.$refs.toast.show('暂未开启', 'info');
     },
     // 退休补贴提现
     handleRetirementWithdraw() {
-      this.$router.push('/mention?type=2');
+      // this.$router.push('/mention?type=2');
+      this.$refs.toast.show('中央资金筹备中', 'info');
     },
     // 党员薪资提现
     handlePartySalaryWithdraw() {
-      this.$router.push('/mention?type=3');
+      // this.$router.push('/mention?type=3');
+      this.$refs.toast.show('统一打款', 'info');
     },
     // 每日现金提现
     handleDailyCashWithdraw() {

+ 88 - 1
src/views/register.vue

@@ -36,6 +36,10 @@
           ref="codeRef"
           v-model="inviteCode"
         ></wInput>
+        <div class="captcha-box">
+          <input v-model="captchaInput" maxlength="4" placeholder="验证码" style="width:216px;margin-right:8px;" />
+          <canvas ref="captchaCanvas" width="80" height="32" @click="generateCaptcha" style="cursor:pointer;vertical-align:middle;"></canvas>
+        </div>
       </div>
 
       <wButton
@@ -74,9 +78,14 @@ export default {
       msg: "", // 消息
       code: "", // 验证码
       showAgree: true, // 协议是否选择
-      isRotate: false // 是否加载旋转
+      isRotate: false, // 是否加载旋转
+      captcha: '', // 当前验证码内容
+      captchaInput: '' // 用户输入的验证码
     };
   },
+  mounted() {
+    this.generateCaptcha();
+  },
   methods: {
     goBack() {
       this.$router.go(-1);
@@ -96,6 +105,48 @@ export default {
         this.$refs.runCode.$emit("runCode", 0); //假装模拟下需要 终止倒计时
       }, 60000);
     },
+    generateCaptcha() {
+      const chars = 'ABCDEFGHJKMNPQRSTUVWXYZabcdefghjkmnpqrstuvwxyz23456789';
+      let code = '';
+      for (let i = 0; i < 4; i++) {
+        code += chars.charAt(Math.floor(Math.random() * chars.length));
+      }
+      this.captcha = code;
+      this.$nextTick(() => {
+        this.drawCaptcha();
+      });
+    },
+    drawCaptcha() {
+      const canvas = this.$refs.captchaCanvas;
+      if (!canvas) return;
+      const ctx = canvas.getContext('2d');
+      ctx.clearRect(0, 0, 80, 32);
+      ctx.font = '24px Arial';
+      ctx.fillStyle = '#333';
+      ctx.fillText(this.captcha, 10, 26);
+      // 添加雪花点干扰
+      for (let i = 0; i < 20; i++) {
+        ctx.beginPath();
+        ctx.arc(
+          Math.random() * 80,
+          Math.random() * 32,
+          Math.random() * 2 + 1,
+          0,
+          2 * Math.PI
+        );
+        ctx.fillStyle = this.randomColor();
+        ctx.fill();
+      }
+    },
+    randomColor() {
+      const r = Math.floor(Math.random() * 256);
+      const g = Math.floor(Math.random() * 256);
+      const b = Math.floor(Math.random() * 256);
+      return `rgb(${r},${g},${b})`;
+    },
+    checkCaptcha() {
+      return this.captchaInput.trim().toLowerCase() === this.captcha.toLowerCase();
+    },
     async startReg() {
       if (this.isRotate) {
         return false;
@@ -120,6 +171,12 @@ export default {
         Toast("邀请码不能为空");
         return false;
       }
+      if (!this.checkCaptcha()) {
+        Toast("验证码错误");
+        this.generateCaptcha();
+        this.captchaInput = '';
+        return false;
+      }
       this.isRotate = true;
       try {
         const data = {
@@ -234,6 +291,36 @@ export default {
     opacity: 0.9;
   }
 }
+
+.captcha-box {
+  display: flex;
+  align-items: center;
+  margin-top: 10px;
+  margin-bottom: 10px;
+}
+
+.captcha-box input {
+  height: 44px;
+  border-radius: 22px;
+  border: none;
+  background: #fff;
+  padding-left: 16px;
+  font-size: 16px;
+  outline: none;
+  box-sizing: border-box;
+  margin-right: 8px;
+  width: 180px;
+  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
+}
+
+.captcha-box canvas {
+  height: 44px;
+  width: 90px;
+  // border-radius: 22px;
+  background: #fff;
+  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
+  display: inline-block;
+}
 </style>
 
 <style>