Commit 00c2b641 by 莫晓莉

申请服务

parent 7c72d7a3
......@@ -24,3 +24,8 @@ export const getUserByToken = (data) => {
export const getProjectTypeList = (data) => {
return request('getProjectTypeList', data)
}
//申请服务
export const applyProject = (data) => {
return request('applyProject', data)
}
......@@ -5,37 +5,35 @@
<!-- <view class="set-info-title">小程序名称设置</view> -->
<view class="flex-a-c set-info-item">
<view class="item-name">
<text>姓名</text>
<text style="color:red;">*</text>
<text>申请人</text>
<!-- <text style="color:red;">*</text> -->
<!-- <image class="remind-icon" mode="aspectFit" style="" src=""></image> -->
</view>
<view class="flex1">
<input name="nickName" value="" class="item-iput"
placeholder="请输入姓名"></input>
<input style="" disabled='true' name="nickName" :value="user.name" class="item-iput" placeholder="请输入姓名"></input>
</view>
</view>
<view class="flex-a-c set-info-item">
<!-- <view class="flex-a-c set-info-item">
<view class="item-name">
<text>地址</text>
<text style="color:red;">*</text>
<!-- <image class="remind-icon" mode="aspectFit" style="" src=""></image> -->
<image class="remind-icon" mode="aspectFit" style="" src=""></image>
</view>
<view class="flex1">
<input name="nickName" value="" class="item-iput"
placeholder="请输入居住地址"></input>
</view>
<input name="nickName" value="" class="item-iput" placeholder="请输入居住地址"></input>
</view>
</view> -->
<view class="flex-a-c set-info-item">
<view class="item-name">
<text>伤残等级</text>
<text>伤残类别</text>
<text style="color:red;">*</text>
<!-- <image class="remind-icon" mode="aspectFit" style="" src=""></image> -->
</view>
<view class="flex1">
<picker @change="bindPickerChange" :value="index" :range="arrayHurt" range-key="name">
<!-- <input disabled="true" v-model="timeList.time9"/> -->
<picker @change="hurtTypeChange" :value="disableCategoryIndex" :range="disableCategory" range-key="name">
<view class="flex-a-c" style="justify-content:flex-end;">
<view class="picker-content" style=''>{{arrayHurt[index].name}}</view>
<view class="picker-content" style=''>{{disableCategoryIndex>-1?disableCategory[disableCategoryIndex].name:'点击选择'}}</view>
<view class="trangle"></view>
</view>
</picker>
......@@ -43,19 +41,20 @@
</view>
<view class="flex-a-c set-info-item">
<view class="item-name">
<text>伤残类别</text>
<text>伤残等级</text>
<text style="color:red;">*</text>
<!-- <image class="remind-icon" mode="aspectFit" style="" src=""></image> -->
</view>
<view class="flex1">
<picker bindchange="cat1Change" value="" range="" range-key="name">
<picker @change="hurtLevelChange" :value="disableLevelIndex" :range="disableLevel" range-key="name">
<view class="flex-a-c" style="justify-content:flex-end;">
<view class="picker-content" style=''>意外</view>
<view class="picker-content" style=''>{{disableLevelIndex>-1?disableLevel[disableLevelIndex].name:'点击选择'}}</view>
<view class="trangle"></view>
</view>
</picker>
</view>
</view>
<view class="flex-a-c set-info-item">
<view class="item-name">
<text>项目类型</text>
......@@ -69,9 +68,10 @@
<view class="trangle"></view>
</view>
</picker> -->
<picker bindchange="cat1Change" @change="cat1Change" :value="index" :range="projectTypeList" name="category">
<!-- <picker @change="hurtLevelChange" :value="index" :range="arrayHurt" range-key="name"> -->
<picker @change="proChange" :value="projectTypeIndex" :range="projectTypeList" range-key="projectName">
<view class="flex-a-c" style="justify-content:flex-end;">
<view class="picker-content" style=''>公益服务</view>
<view class="picker-content" style=''>{{projectTypeIndex>-1?projectTypeList[projectTypeIndex].projectName:'点击选择'}}</view>
<view class="trangle"></view>
</view>
</picker>
......@@ -207,7 +207,7 @@
</view>
</view> -->
<button style="background-color: #CA0000;" class="save-btn">确定</button>
<button @click="applyProject" style="background-color: #CA0000;" class="save-btn">确定</button>
</view>
</view>
......@@ -215,32 +215,143 @@
<script>
import {
applyProject,
getProjectTypeList
} from "@/api/login"
export default {
data() {
return {
arrayHurt: [{name:'一级'},{name: '二级'}, {name:'三级'}, {name:'四级'}],
index: 0,
projectTypeList:[],//项目类型
user:{},//用户信息
applyForm:{},
disableLevel: [
{
id:1,
name: '一级'
}, {
id:2,
name: '二级'
}, {
id:3,
name: '三级'
}, {
id:4,
name: '四级'
},, {
id:5,
name: '五级'
},, {
id:6,
name: '六级'
},{
id:7,
name: '七级'
}
],
disableCategoryIndex: -1,
disableLevelIndex: -1,
projectTypeIndex: -1,
projectTypeList: [], //项目类型
disableCategory: [
{
id:1,
name: '视力障碍'
}, {
id:2,
name: '听力障碍'
}, {
id:3,
name: '言语障碍'
}, {
id:4,
name: '肢体障碍'
},, {
id:5,
name: '智力障碍'
},, {
id:6,
name: '精神障碍'
},, {
id:7,
name: '多种障碍'
}
],
}
},
onLoad() {
var user=uni.getStorageSync('user');
this.user=user;
// userId
},
onShow() {
this.getProjectTypeList();
},
methods: {
bindPickerChange: function(e) {
console.log('picker发送选择改变,携带值为:' + e.detail.value)
this.index = e.detail.value
},
getProjectTypeList(){
// bindPickerChange: function(e) {
// console.log('picker发送选择改变,携带值为:' + e.detail.value)
// this.index = e.detail.value
// },
getProjectTypeList() {
getProjectTypeList().then(res => {
if (res.code == 200) {
this.projectTypeList=res.data.data;
console.log(projectTypeList);
this.projectTypeList = res.data.data;
}
})
},
//伤残类别
hurtTypeChange(e) {
this.disableCategoryIndex = e.detail.value;
this.applyForm.disableCategory=this.disableCategory[this.disableCategoryIndex].id;
},
//伤残等级
hurtLevelChange(e) {
this.disableLevelIndex = e.detail.value;
this.applyForm.disableLevel=this.disableLevel[this.disableLevelIndex].id;
},
//项目类型
proChange(e) {
this.projectTypeIndex = e.detail.value;
this.applyForm.disableUserProjectTypeId=this.projectTypeList[this.projectTypeIndex].unProjectTypeId;
},
//申请服务
applyProject() {
if (this.disableCategoryIndex==-1) {
uni.showToast({
icon: 'none',
title: '请选择伤残类别'
});
return;
}
if (this.disableLevelIndex==-1) {
uni.showToast({
icon: 'none',
title: '请选择伤残等级'
});
return;
}
if (this.projectTypeIndex==-1) {
uni.showToast({
icon: 'none',
title: '请选择项目类型'
});
return;
}
applyProject(this.applyForm).then(res => {
if (res.code == 200) {
uni.showToast({
icon: 'success',
title: '申请成功 !',
success: () => {
uni.switchTab({
url: '../user/user',
})
}
})
}
})
},
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment