186 lines
3.5 KiB
Vue
186 lines
3.5 KiB
Vue
<template>
|
|
<view class="train">
|
|
<view class="list-item">
|
|
<u-radio-group iconPlacement="right" v-model="radiovalue1" placement="column" @change="groupChange">
|
|
<view class="radio-item" v-for="(item, index) in radiolist1" :key="index">
|
|
<u-radio :customStyle="{margin:'8px'}" :label="item.name" :name="item.name">
|
|
</u-radio>
|
|
</view>
|
|
</u-radio-group>
|
|
</view>
|
|
<view class="fixed">
|
|
<view class="set-button">
|
|
<button @click="trainSubmit" class="button">确认</button>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</template>
|
|
|
|
<script>
|
|
import {
|
|
trainSubmit
|
|
} from '@/api/train.js'
|
|
export default {
|
|
data() {
|
|
return {
|
|
// 基本案列数据
|
|
//职业技能培训意向 1.汽车维修工 2.电工 3.车工 4.化工总控工 5.铣工 6.焊工 7.鉴定评估师
|
|
// 8.工业机器人系统操作员 9.建筑信息模型技术员 10.机动车检测工 11.企业人力资源管理师
|
|
// 12.计算机程序设计员 13.电子商务师 14.营养师 15.风险管理师 16.健康管理师 17.中式面点师
|
|
// 18.消防设施操作员
|
|
radiolist1: [{
|
|
name: '汽车维修工',
|
|
id: 1
|
|
},
|
|
{
|
|
name: '电工',
|
|
id: 2
|
|
},
|
|
{
|
|
name: '车工',
|
|
id: 3
|
|
},
|
|
{
|
|
name: '化工总控工',
|
|
id: 4
|
|
},
|
|
{
|
|
name: '铣工',
|
|
id: 5
|
|
},
|
|
{
|
|
name: '焊工',
|
|
id: 6
|
|
},
|
|
{
|
|
name: '鉴定评估师',
|
|
id: 7
|
|
},
|
|
{
|
|
name: '工业机器人系统操作员',
|
|
id: 8
|
|
},
|
|
{
|
|
name: '建筑信息模型技术员',
|
|
id: 9
|
|
},
|
|
{
|
|
name: '机动车检测工',
|
|
id: 10
|
|
},
|
|
{
|
|
name: '企业人力资源管理师',
|
|
id: 11
|
|
},
|
|
{
|
|
name: '计算机程序设计员',
|
|
id: 12
|
|
},
|
|
{
|
|
name: '电子商务师',
|
|
id: 13
|
|
},
|
|
{
|
|
name: '营养师',
|
|
id: 14
|
|
},
|
|
{
|
|
name: '风险管理师',
|
|
id: 15
|
|
},
|
|
{
|
|
name: '健康管理师',
|
|
id: 16
|
|
},
|
|
{
|
|
name: '中式面点师',
|
|
id: 17
|
|
},
|
|
{
|
|
name: '消防设施操作员',
|
|
id: 18
|
|
}
|
|
|
|
],
|
|
radiovalue1: '',
|
|
train: ''
|
|
};
|
|
},
|
|
methods: {
|
|
groupChange(n) {
|
|
console.log('groupChange', n);
|
|
this.radiolist1.forEach(item => {
|
|
if (item.name == n) {
|
|
this.train = item.id
|
|
}
|
|
})
|
|
console.log(this.train);
|
|
},
|
|
async trainSubmit() {
|
|
var that = this
|
|
if (!this.train) {
|
|
uni.showToast({
|
|
title: '请先选择技能培训意向',
|
|
icon:'none'
|
|
})
|
|
return
|
|
}
|
|
uni.showLoading({
|
|
title: '提交中...'
|
|
})
|
|
try {
|
|
var res = await trainSubmit({
|
|
train: that.train
|
|
})
|
|
if (res.code == 0) {
|
|
uni.showToast({
|
|
title: '提交成功',
|
|
icon: 'none'
|
|
})
|
|
setTimeout(() => {
|
|
uni.navigateBack({
|
|
delta: 1
|
|
})
|
|
}, 500)
|
|
}
|
|
} catch (err) {
|
|
uni.showToast({
|
|
title: err.msg,
|
|
icon: 'none'
|
|
})
|
|
}
|
|
}
|
|
}
|
|
};
|
|
</script>
|
|
<style lang="scss">
|
|
.list-item {
|
|
padding: 20rpx 20rpx 200rpx 20rpx;
|
|
|
|
.radio-item {
|
|
border-bottom: solid 1px #F5F5F5;
|
|
padding: 20rpx;
|
|
}
|
|
}
|
|
|
|
.fixed {
|
|
position: fixed;
|
|
bottom: 0;
|
|
width: 100%;
|
|
background-color: #FFFFFF;
|
|
height: 180rpx;
|
|
box-shadow: 0rpx -4rpx 16rpx 0rpx rgba(0, 0, 0, 0.08);
|
|
|
|
.set-button {
|
|
padding-top: 30rpx;
|
|
width: 80%;
|
|
margin: 0 auto;
|
|
|
|
.button {
|
|
background: linear-gradient(to right, #00B7FF, #006EEF);
|
|
border-radius: 20rpx;
|
|
color: #FFFFFF;
|
|
}
|
|
}
|
|
}
|
|
</style> |