apply.vue 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130
  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"
  20. color="rgb(55,186,189)" text="报名">
  21. </u-button>
  22. </u-col>
  23. </u-row>
  24. </view>
  25. </view>
  26. </view>
  27. </template>
  28. <script>
  29. import hsDictSelect from "../components/dictSelect.vue"
  30. import hsInput from "../components/input.vue"
  31. export default {
  32. components: {
  33. hsDictSelect,
  34. hsInput
  35. },
  36. data() {
  37. return {
  38. isDisabled: false,
  39. defaultDept: '',
  40. form: {
  41. userCode: null,
  42. userName: null,
  43. address: null,
  44. id: uni.getStorageSync("applyInfo").id,
  45. source: uni.getStorageSync("applyInfo").source
  46. }
  47. }
  48. },
  49. onLoad() {
  50. this.getApplyData()
  51. this.form.userCode = uni.getStorageSync("userInfo").userName
  52. this.form.userName = uni.getStorageSync("userInfo").nickName
  53. },
  54. methods: {
  55. async submit() {
  56. if (!this.form.address) {
  57. this.$showModal("请选择一个地点")
  58. return
  59. }
  60. this.isDisabled = true
  61. const {
  62. data: res
  63. } = await this.$httpRequest({
  64. url: '/app/sumbitWelfare',
  65. method: 'post',
  66. data: this.form,
  67. urlType: this.$getUrlType()
  68. });
  69. if (res.code === 200) {
  70. uni.showModal({
  71. title: "报名成功",
  72. icon: "OK",
  73. showCancel: false,
  74. success() {
  75. uni.navigateBack()
  76. }
  77. })
  78. } else {
  79. this.isDisabled = false
  80. this.$showModal(res.msg)
  81. }
  82. },
  83. getApplyData() {
  84. this.$httpRequest({
  85. url: '/app/getApplyData?id=' + uni.getStorageSync("applyInfo").id,
  86. method: 'get',
  87. urlType: this.$getUrlType()
  88. }).then(res => {
  89. res = res.data
  90. if (res.code === 200) {
  91. if (res.data.nowStatus === '2') {
  92. this.form.address = res.data.address
  93. this.$showModal("您已完成报名")
  94. }
  95. }
  96. })
  97. }
  98. }
  99. }
  100. </script>
  101. <style lang="scss" scoped>
  102. .desc {
  103. padding: 10rpx 5rpx;
  104. color: #818181;
  105. font-size: 20rpx;
  106. }
  107. .pickerView {
  108. // align-items: flex-end;
  109. padding: 10rpx 20rpx;
  110. border: 1rpx #eeeeee solid;
  111. }
  112. .pickerText {
  113. font-size: 26rpx;
  114. color: #b1b1b1;
  115. }
  116. .bottim_view {
  117. padding: 5px 20px 30px;
  118. position: fixed;
  119. left: 0px;
  120. bottom: 0px;
  121. width: 100%;
  122. height: 40px;
  123. background-color: #ffffff;
  124. }
  125. </style>