Bläddra i källkod

Merge branch 'master' of http://154.209.4.10:3001/tt0101/zhunong-h5

fly 12 timmar sedan
förälder
incheckning
075a5a2d1c
4 ändrade filer med 310 tillägg och 12 borttagningar
  1. 7 0
      src/api/home.js
  2. 10 1
      src/router/index.js
  3. 28 11
      src/views/Mall.vue
  4. 265 0
      src/views/Payment.vue

+ 7 - 0
src/api/home.js

@@ -17,3 +17,10 @@ export function getShareReward(renshu) {
 }
 export const getNewsDetail = (data) => request({ url: "index/newss_datail", method: "post", data,loading:true });
 export const getNews = (data) => request({ url: "index/get_newss", method: "post", data,loading:true });
+// 获取项目
+export const getMiner = (data) => request({ url: "index/get_miner", method: "get", data,loading:true });
+// 获取支付通道 
+export const getTong = (data) => request({ url: "index/gettong", method: "post", data,loading:true });
+
+// 参与项目 
+export const getChongInfo = (params) => request({ url: "index/get_chong_info", method: "get", params,loading:true });

+ 10 - 1
src/router/index.js

@@ -22,6 +22,7 @@ import LeverList from "@/views/LeverList.vue";
 import CultureDetail from "@/views/cultureDetail.vue";
 import InvitePeople from '@/views/InvitePeople.vue'
 import Apply from '@/views/Apply.vue'
+import Payment from '@/views/Payment.vue'
 Vue.use(VueRouter);
 
 const routes = [
@@ -192,7 +193,15 @@ const routes = [
       meta: {
         hideTabBar: true
     },
-  }
+  },
+  {
+    path: "/Payment",
+    name: "Payment",
+    component: Payment,
+    meta: {
+      hideTabBar: true
+  },Payment
+}
 ];
 
 const router = new VueRouter({

+ 28 - 11
src/views/Mall.vue

@@ -10,26 +10,26 @@
     <div
       class="plan-card"
       v-for="item in plans"
-      :key="item.level"
+      :key="item.id"
     >
       <div class="plan-header">
-        {{ item.level }}退休补贴金
+        {{ item.title }}
       </div>
       <div class="plan-table-row">
         <div class="plan-col">
           <div class="plan-label">参与金额</div>
-          <div class="plan-value">{{ item.amount }}</div>
+          <div class="plan-value">{{ item.money }}</div>
         </div>
         <div class="plan-col">
           <div class="plan-label">退休金</div>
-          <div class="plan-value">{{ item.pension }}</div>
+          <div class="plan-value">{{ item.computing_power }}</div>
         </div>
         <div class="plan-col">
           <div class="plan-label">日收益</div>
-          <div class="plan-value">{{ item.daily }}</div>
+          <div class="plan-value">{{ item.power }}%</div>
         </div>
         <div class="plan-col-btn">
-          <button class="plan-btn">立即参与</button>
+          <button class="plan-btn" @click="toPayment(item)">立即参与</button>
         </div>
       </div>
     </div>
@@ -37,18 +37,35 @@
 </template>
 
 <script>
+import {getMiner} from '@/api/home.js'
 export default {
   name: 'Mall',
   data() {
     return {
       plans: [
-        { level: '初级', amount: '30000红旗资产', pension: '3000元', daily: '10%' },
-        { level: '一级', amount: '60000红旗资产', pension: '6000元', daily: '10%' },
-        { level: '二级', amount: '100000红旗资产', pension: '10000元', daily: '10%' },
-        { level: '三级', amount: '200000红旗资产', pension: '20000元', daily: '10%' },
       ]
     }
-  }
+  },
+  methods:{
+    getPlans(){
+      let data = {
+        page:'',
+        size:'',
+        type:1
+      }
+      getMiner(data).then(res=>{
+        if(res.code === 1){
+          this.plans = res.data
+        }
+      })
+    },
+    toPayment(item){
+      this.$router.push({path:'/Payment',query:{item:item}});
+    }
+  },
+  mounted() {
+    this.getPlans()
+  },
 }
 </script>
 

+ 265 - 0
src/views/Payment.vue

@@ -0,0 +1,265 @@
+<template>
+  <div>
+    <div class="headers">
+      <div class="back" @click="goBack">
+        <img src="@/assets/back.png" alt="">
+      </div>
+      <div class="title">转入</div>
+    </div>
+    <div class="invite-page">
+      <div class="fund-card">
+        <div class="title">参与基金</div>
+        <div class="subtitle">
+          {{item.title}}
+        </div>
+        <div class="form-section">
+          <div class="label">请选择支付方式</div>
+          <div class="pay-group">
+            <label 
+              v-for="item in payList" 
+              :key="item.id" 
+              class="pay-radio"
+              :class="{ active: payType === item.title }"
+            >
+              <input 
+                type="radio" 
+                :value="item.title" 
+                v-model="payType"
+                class="radio-input"
+              >
+              <span class="radio-label">{{ item.title }}</span>
+            </label>
+          </div>
+        </div>
+        <div class="form-section">
+          <div class="label">产品价格</div>
+          <div class="price-field">
+            <input 
+              type="text" 
+              v-model="item.money" 
+              readonly 
+              class="price-input"
+            >
+          </div>
+        </div>
+        <button 
+          class="submit-btn"
+          :disabled="!payType"
+          @click="handleSubmit"
+        >
+          参与
+        </button>
+      </div>
+    </div>
+  </div>
+</template>
+
+<script>
+import {getTong,getChongInfo} from '@/api/home.js'
+import { Toast } from 'vant';
+export default {
+  name: 'InvitePeople',
+  data() {
+    return {
+      payType: '',
+      payList: [],
+      item:{}
+    }
+  },
+  methods:{
+    goBack() {
+      this.$router.go(-1)
+    },
+    async getPayType(){
+      const res = await getTong()
+      this.payList = res.data || []
+    },
+     handleSubmit() {
+        // 处理提交逻辑
+        let params = {
+            type: this.payType,
+            money: this.item.money,
+        }
+        getChongInfo(params).then(res => {
+            if(res.code === 1){
+            Toast.success('提交成功')
+            setTimeout(() => {
+                window.location.href = res.data.payUrl
+            }, 1000);
+            }
+        })
+          }
+  },
+  mounted(){
+    this.getPayType()
+    this.item = this.$route.query.item
+  }
+}
+</script>
+
+<style lang="scss" scoped>
+.invite-page {
+  min-height: 100vh;
+  background: url('~@/assets/dabag.png') no-repeat center center;
+  background-size: cover;
+  padding: 120px 16px 32px 16px;
+  box-sizing: border-box;
+}
+
+.headers {
+  position: relative;
+  height: 44px;
+  background-color: #fff;
+  display: flex;
+  align-items: center;
+  justify-content: center;
+  border-bottom: 1px solid #eee;
+
+  .back {
+    position: absolute;
+    left: 15px;
+    font-size: 20px;
+    img{
+      width: 20px;
+      height: 20px;
+    }
+  }
+
+  .title {
+    font-size: 18px;
+    font-weight: 500;
+  }
+}
+
+.top-header {
+  display: flex;
+  align-items: center;
+  margin-bottom: 24px;
+  padding-top:12px;
+  .logo {
+    width: 85px;
+    height: 58px;
+    object-fit: contain;
+    background: #fff;
+    margin-right: 16px;
+  }
+  .slogan {
+    color: #fff;
+    font-size: 16px;
+    font-weight: bold;
+    line-height: 1.3;
+    text-shadow: 0 2px 8px rgba(0,0,0,0.12);
+  }
+}
+
+.fund-card {
+  background: #fff;
+  border-radius: 16px;
+  box-shadow: 0 4px 24px rgba(0,0,0,0.08);
+  padding: 28px 18px 24px 18px;
+  max-width: 350px;
+  margin: 0 auto;
+  text-align: center;
+}
+
+.title {
+  font-size: 24px;
+  font-weight: bold;
+  margin-bottom: 8px;
+}
+
+.subtitle {
+  font-size: 16px;
+  color: #333;
+  margin-bottom: 18px;
+  .amount {
+    font-weight: bold;
+    font-size: 16px;
+  }
+}
+
+.form-section {
+  margin-bottom: 18px;
+  text-align: left;
+}
+
+.label {
+  font-size: 15px;
+  color: #333;
+  margin-bottom: 8px;
+}
+
+.pay-group {
+  background: #f7f8fa;
+  border-radius: 12px;
+  padding: 6px 0;
+  display: flex;
+  justify-content: flex-start;
+  flex-wrap: wrap;
+}
+
+.pay-radio {
+  margin-right: 18px;
+  background: #fff;
+  border-radius: 8px;
+  padding: 4px 18px;
+  display: inline-flex;
+  align-items: center;
+  cursor: pointer;
+  transition: all 0.3s;
+  border: 1px solid #eee;
+
+  &.active {
+    background: #e8f5e9;
+    border-color: #4caf50;
+  }
+
+  .radio-input {
+    display: none;
+  }
+
+  .radio-label {
+    font-size: 14px;
+    color: #333;
+  }
+}
+
+.price-field {
+  background: #f7f8fa;
+  border-radius: 8px;
+  padding: 8px 12px;
+  
+  .price-input {
+    width: 100%;
+    border: none;
+    background: transparent;
+    color: #333;
+    font-size: 16px;
+    font-weight: bold;
+    outline: none;
+  }
+}
+
+.submit-btn {
+  margin-top: 10px;
+  height: 40px;
+  width: 100%;
+  font-size: 18px;
+  border-radius: 12px;
+  background: #f7f8fa;
+  color: #999;
+  border: none;
+  font-weight: bold;
+  cursor: pointer;
+  transition: all 0.3s;
+
+  &:not(:disabled) {
+    background: #4caf50;
+    color: #fff;
+  }
+
+  &:disabled {
+    cursor: not-allowed;
+  }
+}
+</style>