idonate.vue 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178
  1. <template>
  2. <view class="idonate">
  3. <view class="one" v-show="limit === 1">
  4. <view class="item">
  5. 捐赠个体<text>*</text>
  6. <radio-group @change="typeChange" class="check-box">
  7. <label v-for="(item, index) in items" :key="item.value">
  8. <radio :value="item.iid" :checked="index === type" color="#f3392c" style="transform:scale(0.7)" />
  9. <text>{{ item.value }}</text>
  10. </label>
  11. </radio-group>
  12. </view>
  13. <view class="item">
  14. 捐赠单位<text>*</text>
  15. <input type="text" :value="unit" placeholder="请填写捐赠单位"/>
  16. </view>
  17. <view class="item">
  18. 单位联系人 <text>*</text>
  19. <input type="text" :value="people" placeholder="请填写捐赠方联系人"/>
  20. </view>
  21. <view class="item">
  22. 单位电话 <text>*</text>
  23. <input type="text" :value="people" placeholder="请填写单位联系方式"/>
  24. </view>
  25. </view>
  26. <view class="tow" v-show="limit === 2">
  27. </view>
  28. <view class="jg">
  29. </view>
  30. <view class="btn">
  31. <view class="next" v-show="limit === 1" @click="nextLimit()">
  32. 下一页
  33. </view>
  34. <view class="prev" v-show="limit === 2" @click="prevLimit()">
  35. 上一步
  36. </view>
  37. <view class="sub" v-show="limit === 2">
  38. 提交
  39. </view>
  40. </view>
  41. </view>
  42. </template>
  43. <script>
  44. export default {
  45. data() {
  46. return {
  47. items: [
  48. {
  49. value: '企业(团体)',
  50. iid: '0'
  51. },
  52. {
  53. value: '个人',
  54. iid: '1'
  55. }
  56. ],
  57. limit: 1,
  58. type: 0,//捐赠个体 1位个人 0为团体(企业)
  59. unit: '',//捐赠单位
  60. people: '',//捐赠方联系人或姓名
  61. phone: '',//单位电话或联系电话
  62. }
  63. },
  64. onLoad(ops) {
  65. if(ops) {
  66. this.type = ops.type*1
  67. console.log(this.type)
  68. }
  69. },
  70. methods: {
  71. nextLimit() {
  72. this.limit = 2
  73. },
  74. prevLimit() {
  75. this.limit = 1
  76. },
  77. typeChange(evt) {
  78. console.log(evt)
  79. this.type = evt.detail.value.
  80. }
  81. }
  82. }
  83. </script>
  84. <style lang="scss" scoped>
  85. .idonate {
  86. padding: 0 30rpx;
  87. margin-top: 20rpx;
  88. background-color: #fff;
  89. }
  90. .btn {
  91. height: 196rpx;
  92. width: 100%;
  93. text-align: center;
  94. display: flex;
  95. justify-content: center;
  96. line-height: 75rpx;
  97. .next {
  98. width: 478rpx;
  99. height: 75rpx;
  100. // margin: 0 auto;
  101. background: #FA7E67;
  102. border-radius: 35rpx;
  103. color: #fff;
  104. font-size: 32rpx;
  105. font-family: PingFang SC;
  106. font-weight: 500;
  107. color: #FFFFFF;
  108. }
  109. .prev {
  110. width: 264rpx;
  111. height: 75rpx;
  112. border: 1px solid #FA7E67;
  113. border-radius: 35rpx;
  114. font-size: 32rpx;
  115. font-family: PingFang SC;
  116. font-weight: 500;
  117. color: #FA7E67;
  118. margin-right: 60rpx;
  119. line-height: 70rpx;
  120. }
  121. .sub {
  122. width: 264rpx;
  123. height: 75rpx;
  124. background: #FA7E67;
  125. border-radius: 35rpx;
  126. font-size: 32rpx;
  127. font-family: PingFang SC;
  128. font-weight: 500;
  129. color: #FFFFFF;
  130. line-height: 70rpx;
  131. }
  132. }
  133. // .check-protocol uni-checkbox .uni-checkbox-input{
  134. // width: 25rpx;
  135. // height: 25rpx;
  136. // border-radius: 0;
  137. // border: 1rpx solid #C1C1C1;
  138. // }
  139. // /* 选中后的 背景样式 */
  140. // .check-protocol uni-checkbox .uni-checkbox-input.uni-checkbox-input-checked{
  141. // position: relative;
  142. // border: 1rpx solid #C1C1C1;
  143. // width: 25rpx;
  144. // height: 25rpx;
  145. // }
  146. // /* 选中后的*/
  147. // .check-protocol uni-checkbox .uni-checkbox-input.uni-checkbox-input-checked::before{
  148. // position: absolute;
  149. // left: 50%;
  150. // top: 50%;
  151. // content: '';
  152. // width: 19rpx!important;
  153. // height: 19rpx!important;;
  154. // background-color: #3AAF4A;
  155. // transform: translate(-50%,-50%);
  156. // }
  157. .item {
  158. display: flex;
  159. align-items: center;
  160. height: 102rpx;
  161. border-bottom: 1px #ECECEC solid;
  162. font-size: 30rpx;
  163. font-family: PingFang SC;
  164. font-weight: 500;
  165. color: #222222;
  166. }
  167. .check-box {
  168. display: flex;
  169. display: inline-block;
  170. }
  171. </style>