同步版本
This commit is contained in:
@@ -11,18 +11,18 @@
|
||||
</view>
|
||||
<view class="inputs">
|
||||
<label>企业类型</label>
|
||||
<picker @change="changePicker" data-type="type">
|
||||
<picker v-if="type.length > 0" :range="type" :value="typeIndex" range-key="name" @change="changePicker" data-type="type">
|
||||
<view class="picker-text nowrap">
|
||||
选择企业类型
|
||||
{{type[typeIndex].name}}
|
||||
<uni-icons class="picker-icon" type="arrowdown"></uni-icons>
|
||||
</view>
|
||||
</picker>
|
||||
</view>
|
||||
<view class="inputs">
|
||||
<label>企业行业</label>
|
||||
<picker @change="changePicker" data-type="industry">
|
||||
<picker v-if="industry.length > 0" :range="industry" :value="industryIndex" range-key="title" @change="changePicker" data-type="industry">
|
||||
<view class="picker-text nowrap">
|
||||
选择企业行业
|
||||
{{industry[industryIndex].title}}
|
||||
<uni-icons class="picker-icon" type="arrowdown"></uni-icons>
|
||||
</view>
|
||||
</picker>
|
||||
@@ -35,6 +35,7 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { createConfig, inits } from '@/apis/interfaces/company'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
@@ -45,18 +46,34 @@
|
||||
industryIndex: 0
|
||||
};
|
||||
},
|
||||
created(){
|
||||
createConfig().then(res=>{
|
||||
this.type = res.type
|
||||
this.industry = res.industries
|
||||
})
|
||||
},
|
||||
methods:{
|
||||
// 提交信息
|
||||
next(){
|
||||
console.log(this.name)
|
||||
console.log('提交信息')
|
||||
this.$Router.push({name: 'Prompt'})
|
||||
inits({
|
||||
name : this.name,
|
||||
type : this.type[this.typeIndex].id,
|
||||
industry_id : this.industry[this.industryIndex].industry_id
|
||||
}).then(res => {
|
||||
this.$Router.push({name: 'Prompt'})
|
||||
}).catch(err => {
|
||||
uni.showToast({
|
||||
title: err.message,
|
||||
icon : 'none'
|
||||
})
|
||||
})
|
||||
},
|
||||
|
||||
//选择器
|
||||
changePicker(e){
|
||||
let changeType = e.target.dataset.type,
|
||||
changeVlae = e.target.dataset.value
|
||||
changeVlae = e.detail.value
|
||||
|
||||
switch(changeType){
|
||||
case 'type':
|
||||
this.typeIndex = changeVlae
|
||||
|
||||
Reference in New Issue
Block a user