apply.vue 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  1. <template>
  2. <view>
  3. <view style="padding:5rpx 20rpx 45rpx 20rpx;">
  4. <view class="desc">
  5. <hsInput label="用户编号" v-model="form.userCode" :disabled="true" />
  6. </view>
  7. <view class="desc">
  8. <hsInput label="领取人" v-model="form.userName" :disabled="true" />
  9. </view>
  10. <view class="desc">
  11. <hsDictSelect label="地点" dictKey="welfare_apply_addr" v-model="form.address" :disabled="isDisabled" />
  12. </view>
  13. </view>
  14. <u-gap height="70" bgColor="#ffffff"></u-gap>
  15. <view class="bottim_view">
  16. <view>
  17. <u-row>
  18. <u-col span="11">
  19. <u-button :disabled="isDisabled" class="btnDoPay" shape="circle" @click="submit" color="rgb(55,186,189)" text="报名">
  20. </u-button>
  21. </u-col>
  22. </u-row>
  23. </view>
  24. </view>
  25. </view>
  26. </template>
  27. <script>
  28. import hsDictSelect from "../components/dictSelect.vue"
  29. import hsInput from "../components/input.vue"
  30. export default {
  31. components: {
  32. hsDictSelect,
  33. hsInput
  34. },
  35. data() {
  36. return {
  37. isDisabled: false,
  38. defaultDept: '',
  39. form: {
  40. userCode: null,
  41. userName: null,
  42. address: null,
  43. id: uni.getStorageSync("applyInfo").id,
  44. source: uni.getStorageSync("applyInfo").source
  45. }
  46. }
  47. },
  48. onLoad() {
  49. this.getApplyData()
  50. this.form.userCode = uni.getStorageSync("userInfo").userName
  51. this.form.userName = uni.getStorageSync("userInfo").nickName
  52. },
  53. methods: {
  54. async submit() {
  55. const {
  56. data: res
  57. } = await this.$httpRequest({
  58. url: '/app/sumbitWelfare',
  59. method: 'post',
  60. data: this.form,
  61. urlType: this.$getUrlType()
  62. });
  63. if (res.code === 200) {
  64. this.$showModal("报名成功")
  65. } else {
  66. this.$showModal(res.msg)
  67. }
  68. },
  69. getApplyData() {
  70. this.$httpRequest({
  71. url: '/app/getApplyData?id=' + uni.getStorageSync("applyInfo").id,
  72. method: 'get',
  73. urlType: this.$getUrlType()
  74. }).then(res => {
  75. res = res.data
  76. if (res.code === 200) {
  77. if (res.data.nowStatus === '2') {
  78. this.form.address = res.data.address
  79. this.isDisabled = true
  80. this.$showModal("您已完成报名")
  81. }
  82. } else {
  83. }
  84. });
  85. }
  86. }
  87. }
  88. </script>
  89. <style lang="scss" scoped>
  90. .desc {
  91. padding: 10rpx 5rpx;
  92. color: #818181;
  93. font-size: 20rpx;
  94. }
  95. .pickerView {
  96. // align-items: flex-end;
  97. padding: 10rpx 20rpx;
  98. border: 1rpx #eeeeee solid;
  99. }
  100. .pickerText {
  101. font-size: 26rpx;
  102. color: #b1b1b1;
  103. }
  104. .bottim_view {
  105. padding: 5px 20px 30px;
  106. position: fixed;
  107. left: 0px;
  108. bottom: 0px;
  109. width: 100%;
  110. height: 40px;
  111. background-color: #ffffff;
  112. }
  113. </style>