|
@@ -29,7 +29,12 @@
|
|
<div class="plan-value">{{ item.power }}%</div>
|
|
<div class="plan-value">{{ item.power }}%</div>
|
|
</div>
|
|
</div>
|
|
<div class="plan-col-btn">
|
|
<div class="plan-col-btn">
|
|
- <button class="plan-btn" @click="toPayment(item)">立即参与</button>
|
|
|
|
|
|
+ <button
|
|
|
|
+ class="plan-btn"
|
|
|
|
+ :class="{ 'disabled': !canClick(item) }"
|
|
|
|
+ @click="canClick(item) && toPayment(item)"
|
|
|
|
+ :disabled="!canClick(item)"
|
|
|
|
+ >立即参与</button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
@@ -37,16 +42,57 @@
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script>
|
|
<script>
|
|
-import {getMiner} from '@/api/home.js'
|
|
|
|
|
|
+import {getMiner,getUserInfo,joinRetirement} from '@/api/home.js'
|
|
export default {
|
|
export default {
|
|
name: 'Mall',
|
|
name: 'Mall',
|
|
data() {
|
|
data() {
|
|
return {
|
|
return {
|
|
plans: [
|
|
plans: [
|
|
- ]
|
|
|
|
|
|
+ {
|
|
|
|
+ "id": 1,
|
|
|
|
+ "type": 1,
|
|
|
|
+ "title": "初级退休补贴金",
|
|
|
|
+ "money": "30000",
|
|
|
|
+ "rent_cycle": 1825,
|
|
|
|
+ "computing_power": "3000",
|
|
|
|
+ "power": "10",
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ "id": 2,
|
|
|
|
+ "type": 2,
|
|
|
|
+ "title": "一级退休补贴金",
|
|
|
|
+ "money": "60000",
|
|
|
|
+ "rent_cycle": 1825,
|
|
|
|
+ "computing_power": "6000",
|
|
|
|
+ "power": "10",
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ "id": 3,
|
|
|
|
+ "type": 3,
|
|
|
|
+ "title": "二级退休补贴金",
|
|
|
|
+ "money": "100000",
|
|
|
|
+ "rent_cycle": 1825,
|
|
|
|
+ "computing_power": "10000",
|
|
|
|
+ "power": "10",
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ "id": 4,
|
|
|
|
+ "type": 4,
|
|
|
|
+ "title": "三级退休补贴金",
|
|
|
|
+ "money": "200000",
|
|
|
|
+ "rent_cycle": 1825,
|
|
|
|
+ "computing_power": "20000",
|
|
|
|
+ "power": "10",
|
|
|
|
+ }
|
|
|
|
+ ],
|
|
|
|
+ userInfo:{}
|
|
}
|
|
}
|
|
},
|
|
},
|
|
methods:{
|
|
methods:{
|
|
|
|
+ async getUserInfo() {
|
|
|
|
+ const res = await getUserInfo();
|
|
|
|
+ this.userInfo = res.data;
|
|
|
|
+ },
|
|
getPlans(){
|
|
getPlans(){
|
|
let data = {
|
|
let data = {
|
|
page:'',
|
|
page:'',
|
|
@@ -60,11 +106,33 @@ export default {
|
|
})
|
|
})
|
|
},
|
|
},
|
|
toPayment(item){
|
|
toPayment(item){
|
|
- this.$router.push({path:'/Payment',query:{item:item}});
|
|
|
|
- }
|
|
|
|
|
|
+ // this.$router.push({path:'/Payment',query:{item:item}});
|
|
|
|
+ const formData = new FormData();
|
|
|
|
+ formData.append('type',item.type);
|
|
|
|
+ joinRetirement(formData).then(res=>{
|
|
|
|
+ console.log(res,'2222222222');
|
|
|
|
+
|
|
|
|
+ })
|
|
|
|
+ },
|
|
|
|
+ canClick(item) {
|
|
|
|
+ const { chuji, yiji, erji, sanji } = this.userInfo;
|
|
|
|
+ switch(item.id) {
|
|
|
|
+ case 1:
|
|
|
|
+ return chuji === 0;
|
|
|
|
+ case 2:
|
|
|
|
+ return yiji === 0;
|
|
|
|
+ case 3:
|
|
|
|
+ return erji === 0;
|
|
|
|
+ case 4:
|
|
|
|
+ return sanji === 0;
|
|
|
|
+ default:
|
|
|
|
+ return false;
|
|
|
|
+ }
|
|
|
|
+ },
|
|
},
|
|
},
|
|
mounted() {
|
|
mounted() {
|
|
- this.getPlans()
|
|
|
|
|
|
+ this.getUserInfo()
|
|
|
|
+ // this.getPlans()
|
|
},
|
|
},
|
|
}
|
|
}
|
|
</script>
|
|
</script>
|
|
@@ -162,4 +230,8 @@ export default {
|
|
.plan-btn:hover {
|
|
.plan-btn:hover {
|
|
background: #a00028;
|
|
background: #a00028;
|
|
}
|
|
}
|
|
|
|
+.plan-btn.disabled {
|
|
|
|
+ background: #cccccc;
|
|
|
|
+ cursor: not-allowed;
|
|
|
|
+}
|
|
</style>
|
|
</style>
|