third.vue 7.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355
  1. <template>
  2. <view class="content">
  3. <!-- <view class="tip">孝心缝帮扶:仅限服装行业从业者申请哦~</view> -->
  4. <view class="flex til-list" v-if="status == ''">
  5. <view class="" @click="navTo('/pages/applyHelp/index?id='+id)">基本信息</view>
  6. <view class="" @click="navTo('/pages/applyHelp/second?id='+id)">信息选择</view>
  7. <view class="red">家庭成员情况</view>
  8. <view class="" @click="navTo('/pages/applyHelp/fourth?id='+id)">详细情况</view>
  9. </view>
  10. <view class="flex til-list" v-if="status == 2">
  11. <view class="" @click="navTo('/pages/applyHelp/index?id='+id+'&status=2')">基本信息</view>
  12. <view class="" @click="navTo('/pages/applyHelp/second?id='+id+'&status=2')">信息选择</view>
  13. <view class="red">家庭成员情况</view>
  14. <view class="" @click="navTo('/pages/applyHelp/fourth?id='+id+'&status=2')">详细情况</view>
  15. </view>
  16. <view v-for="(ls,index) in datalist" :key="">
  17. <view class="flex item-list">
  18. <view class="list-name">家庭成员({{index+1}})</view>
  19. <view class="add-tip" @click="addlist(index)" v-if="ls.id == current && status == ''">新增</view>
  20. </view>
  21. <view class="content_box">
  22. <view class="row b-b">
  23. <text class="tit">姓名</text>
  24. <input class="input" type="text" v-model="ls.name" :disabled="disabled" placeholder="请填写您的姓名" placeholder-class="placeholder" />
  25. </view>
  26. <view class="row b-b">
  27. <text class="tit">与本人关系</text>
  28. <input class="input" type="text" v-model="ls.relationship" :disabled="disabled" placeholder="请填写与本人关系" placeholder-class="placeholder" />
  29. </view>
  30. <view class="row b-b">
  31. <text class="tit">身份证号</text>
  32. <input class="input" type="text" v-model="ls.card" :disabled="disabled" placeholder="请填写身份证号" placeholder-class="placeholder" />
  33. </view>
  34. <view class="row b-b">
  35. <text class="tit">工作单位或就读学校</text>
  36. <input class="input" type="text" v-model="ls.school" :disabled="disabled" placeholder="请填写工作单位或就读学校" placeholder-class="placeholder" />
  37. </view>
  38. <view class="row b-b">
  39. <text class="tit">健康状况</text>
  40. <input class="input" type="text" v-model="ls.health" :disabled="disabled" placeholder="请填写健康状况" placeholder-class="placeholder" />
  41. </view>
  42. <view class="row b-b">
  43. <text class="tit">月收入(元)</text>
  44. <input class="input" type="number" v-model="ls.money" :disabled="disabled" placeholder="请填写月收入(元)" placeholder-class="placeholder" />
  45. </view>
  46. </view>
  47. </view>
  48. <view class="add-btn" v-if="status == ''" @click="confirm">下一步</view>
  49. <view class="add-btn" v-if="status == 2" @click="Tosecond">下一步</view>
  50. </view>
  51. </template>
  52. <script>
  53. import uniList from '@/components/uni-list/uni-list.vue';
  54. import uniListItem from '@/components/uni-list-item/uni-list-item.vue';
  55. import LbPicker from '@/components/lb-picker/index.vue'
  56. import { upload,add_three_help } from '@/api/index.js';
  57. import { getList,helpdetail } from '@/api/applyHelp.js';
  58. export default {
  59. components: {
  60. uniList,
  61. uniListItem,
  62. LbPicker
  63. },
  64. data() {
  65. return {
  66. datalist:[{
  67. id:1,
  68. name:"",
  69. relationship:'',
  70. card:'',
  71. school:'',
  72. health:'',
  73. money:"",
  74. }],
  75. current:1,
  76. submit:0,
  77. type:1,//1代表申请表,2代表申请详情
  78. status:'',//审核通过
  79. disabled:false,
  80. };
  81. },
  82. onLoad(option) {
  83. if(option.id){
  84. this.id = option.id;
  85. this.helpDetail();
  86. }
  87. if(option.status){
  88. this.status = option.status;
  89. this.disabled = true;
  90. }
  91. },
  92. onUnload() {
  93. uni.navigateTo({
  94. url: '/pages/applyHelp/cation'
  95. });
  96. },
  97. methods: {
  98. addlist(){
  99. if(this.current > 6){
  100. this.$api.msg('家庭只能添加7位!');
  101. return;
  102. }
  103. let v = Object();
  104. this.current++;
  105. v['id'] = this.current;
  106. v['name'] = '';
  107. v['relationship'] = '';
  108. v['card'] = '';
  109. v['school'] = '';
  110. v['health'] = '';
  111. v['money'] = '';
  112. this.datalist.push(v);
  113. console.log(this.current)
  114. console.log(this.datalist)
  115. },
  116. // outFocus(e){
  117. // console.log(event.target)
  118. // event.target.blur()
  119. // },
  120. // //筹款类型
  121. // async loadData() {
  122. // let obj = this;
  123. // getList({})
  124. // .then(({ data }) => {
  125. // obj.list = data;
  126. // })
  127. // .catch(err => {
  128. // console.log(err);
  129. // });
  130. // },
  131. Tosecond(){
  132. uni.navigateTo({
  133. url:'/pages/applyHelp/fourth?id='+this.id+'&status=2'
  134. })
  135. },
  136. //申请详情
  137. helpDetail(){
  138. let obj = this;
  139. helpdetail({
  140. id:obj.id
  141. }).then(({ data }) => {
  142. console.log(data.member_list)
  143. if(data.member_list == null){
  144. obj.type =1;
  145. }else{
  146. obj.type =2;
  147. obj.datalist = data.member_list
  148. }
  149. console.log(obj.type )
  150. })
  151. .catch(err => {
  152. console.log(err);
  153. });
  154. },
  155. //提交
  156. confirm() {
  157. let obj = this;
  158. let data = [];
  159. for(let i in obj.datalist ){
  160. if(obj.datalist[i].name !='' && obj.datalist[i].relationship !='' && obj.datalist[i].card !='' && obj.datalist[i].school!='' && obj.datalist[i].health !='' && obj.datalist[i].money!=''){
  161. obj.submit =1;
  162. console.log(obj.datalist[i])
  163. data.push(obj.datalist[i]);
  164. }
  165. }
  166. if(obj.submit==0)
  167. {
  168. obj.$api.msg('请填写至少一位完整的家庭成员信息!');
  169. return;
  170. }
  171. add_three_help({
  172. id:obj.id,
  173. data:data
  174. }).then(function(e) {
  175. obj.$api.msg(e.msg);
  176. setTimeout(function(){
  177. uni.navigateTo({
  178. url:'/pages/applyHelp/fourth?id='+obj.id
  179. })
  180. }, 2000);
  181. })
  182. .catch(e => {
  183. obj.$api.msg(e.message);
  184. });
  185. },
  186. navTo(url) {
  187. uni.navigateTo({
  188. url
  189. });
  190. }
  191. }
  192. };
  193. </script>
  194. <style lang="scss">
  195. page {
  196. background: $page-color-base;
  197. min-height: 100%;
  198. }
  199. .content{
  200. padding-bottom: 100rpx;
  201. }
  202. .tip{
  203. color: #DE2412;
  204. background-color: #FEE2E3;
  205. font-size: 24rpx;
  206. padding: 25rpx 35rpx;
  207. }
  208. .til-list{
  209. padding: 35rpx 50rpx;
  210. font-size: 28rpx;
  211. color: #666666;
  212. .red{
  213. color: #E62129 !important;
  214. }
  215. }
  216. .name{
  217. padding: 0rpx 35rpx;
  218. padding-bottom: 15rpx !important;
  219. font-size: 36rpx;
  220. font-weight:500;
  221. }
  222. .content_box {
  223. background-color: #ffffff;
  224. padding: 0rpx 25rpx;
  225. margin: 25rpx auto;
  226. }
  227. .item-list{
  228. padding: 25rpx 45rpx;
  229. color:rgba(34,34,34,1);
  230. font-weight:400;
  231. font-size: 35rpx;
  232. .list-name{
  233. }
  234. .add-tip{
  235. color: #E62129 !important;
  236. }
  237. }
  238. .row {
  239. display: flex;
  240. align-items: center;
  241. // position: relative;
  242. padding: 0 30rpx;
  243. height: 110rpx;
  244. background: #fff;
  245. border-bottom: 1rpx solid #f8f6f6;
  246. .tit {
  247. flex-shrink: 0;
  248. width: 280rpx;
  249. font-size: 30rpx;
  250. color: $font-color-dark;
  251. }
  252. .input {
  253. flex: 1;
  254. font-size: 30rpx;
  255. color: $font-color-dark;
  256. text-align: right;
  257. }
  258. .iconlocation {
  259. font-size: 36rpx;
  260. color: $font-color-light;
  261. }
  262. }
  263. .examine_name {
  264. color: #171717;
  265. font-size: 28rpx;
  266. padding: 25rpx 25rpx;
  267. }
  268. .examine_img {
  269. width: 100%;
  270. text-align: center;
  271. .image{
  272. width: 150rpx;
  273. height: 150rpx;
  274. }
  275. .image1{
  276. min-width: 150rpx;
  277. max-width: 100%;
  278. min-height: 150rpx;
  279. }
  280. }
  281. .add-img-box {
  282. width: 100%;
  283. flex-direction: row;
  284. flex-wrap: wrap;
  285. margin-top: 50rpx;
  286. }
  287. .add-img-item {
  288. margin-bottom: 25rpx;
  289. width: 100%;
  290. .add-img {
  291. min-width: 150rpx;
  292. max-width: 100%;
  293. height: 400rpx;
  294. }
  295. }
  296. .add-img-del {
  297. position: absolute;
  298. width: 40rpx;
  299. height: 40rpx;
  300. right: 60rpx;
  301. // bottom: 155rpx;
  302. //background-color: rgba(238, 0, 0, 1);
  303. border-radius: 20rpx;
  304. }
  305. .default-row {
  306. margin-top: 16rpx;
  307. .tit {
  308. flex: 1;
  309. }
  310. switch {
  311. transform: translateX(16rpx) scale(0.9);
  312. }
  313. }
  314. .add-btn{
  315. position: fixed;
  316. bottom: 0rpx;
  317. left: 0rpx;
  318. width: 100%;
  319. height: 100rpx;
  320. font-size: 28rpx;
  321. color: #FFFFFF;
  322. background-color: #FF727E;
  323. line-height: 100rpx;
  324. text-align: center;
  325. }
  326. .img_box {
  327. padding: 35rpx 35rpx;
  328. width: 250rpx;
  329. height: 250rpx;
  330. }
  331. .img_box image {
  332. width: 100%;
  333. height: 100%;
  334. }
  335. .alert-box {
  336. background-color: #ffffff;
  337. }
  338. .b-b:after {
  339. position: relative !important;
  340. }
  341. .check_box {
  342. padding: 25rpx 25rpx;
  343. font-size: 20rpx;
  344. padding-bottom: 150rpx;
  345. text{
  346. color: #6786FB;
  347. }
  348. }
  349. </style>