fourth.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493
  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="" @click="navTo('/pages/applyHelp/third?id='+id)">家庭成员情况</view>
  8. <view class="red">详细情况</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="" @click="navTo('/pages/applyHelp/third?id='+id+'&status=2')">家庭成员情况</view>
  14. <view class="red">详细情况</view>
  15. </view>
  16. <view class="item-list">
  17. <view class="list-name">经济状况</view>
  18. </view>
  19. <view class="content_box">
  20. <view class="row b-b">
  21. <text class="tit">本人月收入(元)</text>
  22. <input class="input" type="number" v-model="yue" :disabled="disabled" placeholder="请填写本人月收入(元)" placeholder-class="placeholder" />
  23. </view>
  24. <view class="row b-b">
  25. <text class="tit">家庭年度总收入(元)</text>
  26. <input class="input" type="number" v-model="nian" :disabled="disabled" placeholder="请填写家庭年度总收入(元)" placeholder-class="placeholder" />
  27. </view>
  28. <view class="row b-b">
  29. <text class="tit">家庭年人均收入(元)</text>
  30. <input class="input" type="number" v-model="all" :disabled="disabled" placeholder="请填写家庭年人均收入(元)" placeholder-class="placeholder" />
  31. </view>
  32. </view>
  33. <view class="content_box">
  34. <view class="examine_list">
  35. <view class="examine_name">申请帮扶类型</view>
  36. <view class="textarea-box" @tap="handleTap('picker')" v-if="status == ''">
  37. <input class="input" @focus='outFocus' v-model="hpleType" type="text" placeholder="请选择您的申请帮扶类型" placeholder-class="placeholder" />
  38. </view>
  39. <view class="textarea-box" v-if="status == 2">
  40. <input class="input" @focus='outFocus' v-model="hpleType" type="text" placeholder="请选择您的申请帮扶类型" placeholder-class="placeholder" />
  41. </view>
  42. </view>
  43. </view>
  44. <lb-picker ref="picker"
  45. mode="selector"
  46. :list="list"
  47. @change="handleChange"
  48. @touchmove.prevent
  49. @confirm="handleConfirm"
  50. @cancel="handleCancel">
  51. </lb-picker>
  52. <view class="content_box">
  53. <view class="examine_list">
  54. <view class="examine_name">帮扶说明</view>
  55. <view class="textarea-box">
  56. <textarea class="textarea" :disabled="disabled" v-model="explain" maxlength="-1" placeholder-style="color:#999999" placeholder="如:关爱父母敬老爱幼等"
  57. @blur="bindTextAreaBlur" auto-height />
  58. </view>
  59. </view>
  60. </view>
  61. <view class="content_box">
  62. <view class="examine_list">
  63. <view class="examine_name">帮扶情况描述</view>
  64. <view class="textarea-box">
  65. <textarea class="textarea" :disabled="disabled" v-model="content" maxlength="-1" placeholder-style="color:#999999" placeholder="注:1.为了更加详细了解您的困难情况,请您陈述材料完整详细不少于500字。2.请您附上相关证明材料,如医疗材料:入院病案首页、出入院记录、检查报告、医疗票据选取三种以
  66. 上,其他证明材料。"
  67. @blur="bindTextAreaBlur1" auto-height />
  68. </view>
  69. </view>
  70. </view>
  71. <view class="content_box mar-b">
  72. <view class="examine_list">
  73. <view class="examine_name">上传凭证<text>(请您上传相关证明材料)</text></view>
  74. <view class="examine_img">
  75. <!-- <img-upload :imgArr="imgList" imgCount="6" ref="imgUpload"></img-upload> -->
  76. <view class="add-img-box flex_item" v-if="status == ''">
  77. <view class="add-img-item" v-for="(item, index) in imgList" :key="index">
  78. <image class="add-img" @click.stop="imgInfo(index)" :src="item.url" mode="aspectFill"></image>
  79. <image class="add-img-del" @click.stop="delImg(index)" src="/static/img/delete.png"></image>
  80. </view>
  81. <view v-if='imgCount > 0' class="add-img-item" @click.stop="scImg()">
  82. <image class="add-img" src="/static/img/add.png"></image>
  83. </view>
  84. </view>
  85. <view class="add-img-box flex_item" v-if="status == 2">
  86. <view class="add-img-item" v-for="(item, index) in imgList" :key="index">
  87. <image class="add-img" @click.stop="imgInfo(index)" :src="item.url" mode="aspectFill"></image>
  88. </view>
  89. </view>
  90. </view>
  91. </view>
  92. </view>
  93. <view class="add-btn" v-if="status == ''" @click="confirm">提交</view>
  94. <view class="add-btn" v-if="status == 2" @click="Tosecond">下一步</view>
  95. </view>
  96. </template>
  97. <script>
  98. import uniList from '@/components/uni-list/uni-list.vue';
  99. import uniListItem from '@/components/uni-list-item/uni-list-item.vue';
  100. import LbPicker from '@/components/lb-picker/index.vue';
  101. import { upload,add_four_help } from '@/api/index.js';
  102. import { getList,helpdetail } from '@/api/applyHelp.js';
  103. export default {
  104. components: {
  105. uniList,
  106. uniListItem,
  107. LbPicker,
  108. },
  109. data() {
  110. return {
  111. yue:'',
  112. nian:'',
  113. all:'',
  114. cid:'',
  115. hpleType:'',
  116. explain:'',
  117. content:'',//孝善情况
  118. imgList: [],
  119. cloudimgList: [],
  120. imgCount:9,//最多支持6张上传,可以修改
  121. id:'',
  122. list:[],//筹款类型
  123. status:'',//审核通过
  124. disabled:false,
  125. };
  126. },
  127. onUnload() {
  128. uni.navigateTo({
  129. url: '/pages/applyHelp/cation'
  130. });
  131. },
  132. onLoad(option) {
  133. if(option.id){
  134. this.id = option.id;
  135. this.helpDetail();
  136. }
  137. if(option.status){
  138. this.status = option.status;
  139. this.disabled = true;
  140. }
  141. this.loadData();//筹款类型
  142. },
  143. methods: {
  144. outFocus(e){
  145. console.log(event.target)
  146. event.target.blur()
  147. },
  148. //筹款类型
  149. async loadData() {
  150. let obj = this;
  151. getList({})
  152. .then(({ data }) => {
  153. obj.list = data;
  154. })
  155. .catch(err => {
  156. console.log(err);
  157. });
  158. },
  159. //申请详情
  160. helpDetail(){
  161. let obj = this;
  162. helpdetail({
  163. id:obj.id
  164. }).then(({ data }) => {
  165. let imgArr = data.img_list;
  166. obj.imgList = imgArr.map(item => ({
  167. url:item
  168. }));
  169. console.log(obj.imgList,'imgList')
  170. obj.yue = data.mincome;
  171. obj.nian = data.yincome;
  172. obj.all = data.jincome;
  173. obj.cid = data.cid;
  174. obj.explain = data.explain;
  175. obj.content = data.content;
  176. obj.hpleType = data.cname;
  177. })
  178. .catch(err => {
  179. console.log(err);
  180. });
  181. },
  182. Tosecond(){
  183. uni.navigateTo({
  184. url:'/pages/applyHelp/cation'
  185. })
  186. },
  187. //提交
  188. confirm() {
  189. let obj = this;
  190. if(obj.yue == '' && obj.yue < 0){
  191. this.$api.msg('请填写本人月收入(元)!');
  192. return;
  193. }
  194. if(obj.nian == '' && obj.nian < 0){
  195. this.$api.msg('请填写家庭年度总收入(元)!');
  196. return;
  197. }
  198. if(obj.all == '' && obj.all < 0){
  199. this.$api.msg('请填写家庭年人均收入(元)!');
  200. return;
  201. }
  202. if(obj.cid == ''){
  203. this.$api.msg('请选择筹款类型!');
  204. return;
  205. }
  206. if(obj.explain == ''){
  207. this.$api.msg('请填写求助说明!');
  208. return;
  209. }
  210. if(obj.content == ''){
  211. this.$api.msg('请填写孝善情况!');
  212. return;
  213. }
  214. if (obj.imgList.length < 1) {
  215. uni.showToast({
  216. title: '上传凭证',
  217. icon: 'none'
  218. });
  219. return;
  220. }
  221. for (let i = 0; i < obj.imgList.length; i++) {
  222. obj.cloudimgList.push(obj.imgList[i].url);
  223. }
  224. let arr = obj.cloudimgList.join(';');
  225. console.log(arr,'arr')
  226. add_four_help({
  227. id:obj.id,
  228. mincome:obj.yue,
  229. yincome:obj.nian,
  230. jincome:obj.all,
  231. cid:obj.cid,
  232. explain:obj.explain,
  233. content:obj.content,
  234. img_list:arr,
  235. }).then(function(e) {
  236. obj.$api.msg(e.msg);
  237. setTimeout(function(){
  238. uni.navigateTo({
  239. url:'/pages/applyHelp/cation'
  240. })
  241. }, 2000);
  242. })
  243. .catch(e => {
  244. obj.$api.msg(e.message);
  245. });
  246. },
  247. handleTap(name) {
  248. this.$refs[name].show()
  249. },
  250. handleCancel(item) {
  251. },
  252. handleChange(item) {
  253. },
  254. handleConfirm(item) {
  255. let obj = this;
  256. obj.hpleType = item.item.cate_name;
  257. obj.cid = item.item.id;
  258. },
  259. //多张上传图片
  260. scImg() {
  261. let obj = this;
  262. upload({
  263. file: ''
  264. })
  265. .then(e => {
  266. obj.imgList = [...obj.imgList, ...e];
  267. console.log(obj.imgList,'imgList')
  268. obj.imgCount = 6 - obj.imgList.length;
  269. })
  270. .catch(e => {});
  271. },
  272. //点击图片显示大图
  273. imgInfo(i) {
  274. let tempList = [];
  275. this.imgList.forEach(e => {
  276. tempList.push(e.url);
  277. });
  278. //显示图片
  279. uni.previewImage({
  280. current: i,
  281. loop: false,
  282. urls: tempList,
  283. indicator: 'default'
  284. });
  285. },
  286. //删除图片
  287. delImg(i) {
  288. uni.showModal({
  289. content: '确定删除这张吗',
  290. success: res => {
  291. if (res.confirm) {
  292. this.imgList.splice(i, 1);
  293. this.imgCount++;
  294. } else if (res.cancel) {
  295. }
  296. }
  297. });
  298. },
  299. //文本输入框
  300. bindTextAreaBlur: function (e) {
  301. this.explain = e.detail.value
  302. },
  303. bindTextAreaBlur1: function (e) {
  304. this.content = e.detail.value
  305. },
  306. navTo(url) {
  307. uni.navigateTo({
  308. url
  309. });
  310. }
  311. }
  312. };
  313. </script>
  314. <style lang="scss">
  315. page {
  316. background: $page-color-base;
  317. min-height: 100%;
  318. }
  319. .content{
  320. padding-bottom: 100rpx;
  321. }
  322. .tip{
  323. color: #DE2412;
  324. background-color: #FEE2E3;
  325. font-size: 24rpx;
  326. padding: 25rpx 35rpx;
  327. }
  328. .til-list{
  329. padding: 35rpx 50rpx;
  330. font-size: 28rpx;
  331. color: #666666;
  332. .red{
  333. color: #E62129 !important;
  334. }
  335. }
  336. .item-list{
  337. padding: 25rpx 45rpx;
  338. color:rgba(34,34,34,1);
  339. font-weight:400;
  340. font-size: 35rpx;
  341. .list-name{
  342. }
  343. }
  344. .name{
  345. padding: 0rpx 35rpx;
  346. padding-bottom: 15rpx !important;
  347. font-size: 36rpx;
  348. font-weight:500;
  349. }
  350. .content_box {
  351. background-color: #ffffff;
  352. padding: 0rpx 25rpx;
  353. margin: 25rpx auto;
  354. .examine_list{
  355. width: 100%;
  356. .textarea-box{
  357. width: 100%;
  358. padding-bottom: 35rpx;
  359. padding-left: 25rpx;
  360. .textarea{
  361. width: 100%;
  362. font-size: 28rpx;
  363. min-height: 150rpx;
  364. }
  365. input{
  366. font-size: 28rpx;
  367. }
  368. }
  369. }
  370. }
  371. .mar-b{
  372. margin-bottom: 120rpx;
  373. }
  374. .row {
  375. display: flex;
  376. align-items: center;
  377. // position: relative;
  378. padding: 0 30rpx;
  379. height: 110rpx;
  380. background: #fff;
  381. border-bottom: 1rpx solid #f8f6f6;
  382. .tit {
  383. flex-shrink: 0;
  384. width: 300rpx;
  385. font-size: 30rpx;
  386. color: $font-color-dark;
  387. }
  388. .input {
  389. flex: 1;
  390. font-size: 30rpx;
  391. color: $font-color-dark;
  392. text-align: right;
  393. }
  394. .iconlocation {
  395. font-size: 36rpx;
  396. color: $font-color-light;
  397. }
  398. }
  399. .examine_name {
  400. color: #171717;
  401. font-size: 28rpx;
  402. padding: 25rpx 25rpx;
  403. }
  404. .examine_img {
  405. width: 100%;
  406. text-align: center;
  407. .image{
  408. width: 150rpx;
  409. height: 150rpx;
  410. }
  411. .image1{
  412. min-width: 150rpx;
  413. max-width: 100%;
  414. min-height: 150rpx;
  415. }
  416. }
  417. .add-img-box {
  418. width: 100%;
  419. // flex-direction: row;
  420. flex-wrap: wrap;
  421. margin-top: 50rpx;
  422. }
  423. .add-img-item {
  424. margin-bottom: 25rpx;
  425. width: 33.33%;
  426. position: relative;
  427. .add-img {
  428. padding: 0rpx 10rpx;
  429. width: 100%;
  430. height: 214rpx;
  431. }
  432. }
  433. .add-img-del {
  434. position: absolute;
  435. width: 40rpx;
  436. height: 40rpx;
  437. right: 10rpx;
  438. top: 0;
  439. // bottom: 155rpx;
  440. //background-color: rgba(238, 0, 0, 1);
  441. border-radius: 20rpx;
  442. }
  443. .default-row {
  444. margin-top: 16rpx;
  445. .tit {
  446. flex: 1;
  447. }
  448. switch {
  449. transform: translateX(16rpx) scale(0.9);
  450. }
  451. }
  452. .add-btn{
  453. position: fixed;
  454. bottom: 0rpx;
  455. left: 0rpx;
  456. width: 100%;
  457. height: 100rpx;
  458. font-size: 28rpx;
  459. color: #FFFFFF;
  460. background-color: #FF727E;
  461. line-height: 100rpx;
  462. text-align: center;
  463. }
  464. .img_box {
  465. padding: 35rpx 35rpx;
  466. width: 250rpx;
  467. height: 250rpx;
  468. }
  469. .img_box image {
  470. width: 100%;
  471. height: 100%;
  472. }
  473. .alert-box {
  474. background-color: #ffffff;
  475. }
  476. .b-b:after {
  477. position: relative !important;
  478. }
  479. .check_box {
  480. padding: 25rpx 25rpx;
  481. font-size: 20rpx;
  482. padding-bottom: 150rpx;
  483. text{
  484. color: #6786FB;
  485. }
  486. }
  487. </style>