donate.vue 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212
  1. <template>
  2. <view class="donate-wrapper">
  3. <view class="top-select flex">
  4. <view class="">选择地区</view>
  5. <picker @change="bindAreaChange" :range="areas">
  6. <view class="area select" :class="{'action': area }">{{ area || '点击选择地区' }}</view>
  7. </picker>
  8. <picker @change="bindStatusChange" :range="statuss">
  9. <view class="status select" :class="{'action': status }">{{ status }}</view>
  10. </picker>
  11. </view>
  12. <view class="item-wrapper">
  13. <view class="item flex" v-for="item in ceshiList" :key="item.id">
  14. <view class="item-left">
  15. <image src="" mode=""></image>
  16. </view>
  17. <view class="item-right">
  18. <view class="item-title clamp">{{item.title}}</view>
  19. <view class="item-content clamp2">{{item.content}}</view>
  20. <view class="item-status">捐赠进度<text>{{item.jindu}}%</text></view>
  21. <view class="item-btn" :class="{'btn-active': item.status === 0}" @click="join(item.id)">{{item.status===0?'我要捐赠':'已结束'}}</view>
  22. </view>
  23. </view>
  24. </view>
  25. </view>
  26. </template>
  27. <script>
  28. export default {
  29. data() {
  30. return {
  31. areas: ['沙市区红十字会','荆州区红十字会','石首区红十字会','洪湖区红十字会','松滋区红十字会','监利区红十字会','公安县红十字会','江陵县红十字会'],
  32. area: '',
  33. statuss: ['全部','进行中','已结束'],
  34. status: '全部',
  35. ceshiList: [
  36. {
  37. id: '1',
  38. title: '夏天里的清凉夏天里的清凉夏天里的清凉夏天里的清凉夏天里的清凉',
  39. content: '荆州市阳光孤儿院成立于2021年,荆州市红 十字会向社会募集各种空调荆州市阳光孤儿院成立于2021年,荆州市红 十字会向社会募集各种空调',
  40. status: 0,
  41. jindu: 99
  42. },
  43. {
  44. id: '2',
  45. title: '夏天里的清凉',
  46. content: '荆州市阳光孤儿院成立于2021年,荆州市红 十字会向社会募集各种空调荆州市阳光孤儿院成立于2021年,荆州市红 十字会向社会募集各种空调',
  47. status: 1,
  48. jindu: 100
  49. },
  50. {
  51. id: '3',
  52. title: '夏天里的清凉',
  53. content: '荆州市阳光孤儿院成立于2021年,荆州市红 十字会向社会募集各种空调荆州市阳光孤儿院成立于2021年,荆州市红 十字会向社会募集各种空调',
  54. status: 0,
  55. jindu: 20
  56. },
  57. ]
  58. }
  59. },
  60. methods: {
  61. bindAreaChange(e) {
  62. console.log(e.target)
  63. this.area = this.areas[e.target.value]
  64. },
  65. bindStatusChange(e) {
  66. console.log(e.target)
  67. this.status = this.statuss[e.target.value]
  68. },
  69. join(id) {
  70. console.log(id)
  71. uni.navigateTo({
  72. url: '/pages/donate/donateDetail?id=' +id
  73. })
  74. console.log('dddddddddd')
  75. }
  76. }
  77. }
  78. </script>
  79. <style lang="scss" scoped>
  80. .donate-wrapper {
  81. padding-top: 25rpx;
  82. }
  83. .top-select {
  84. font-size: 30rpx;
  85. font-family: PingFang SC;
  86. font-weight: 500;
  87. color: #333333;
  88. height: 63rpx;
  89. line-height: 63rpx;
  90. padding: 0 20rpx 0 19rpx;
  91. margin-bottom: 20rpx;
  92. .select {
  93. padding-left: 40rpx;
  94. background: #FFFFFF;
  95. border-radius: 5rpx;
  96. font-size: 26rpx;
  97. font-family: PingFang SC;
  98. font-weight: 500;
  99. color: #999999;
  100. line-height: 63rpx;
  101. position: relative;
  102. &::after {
  103. content: '';
  104. width: 0;
  105. height: 0;
  106. border-left: 10rpx solid transparent;
  107. border-right: 10rpx solid transparent;
  108. border-top: 10rpx solid #808080;
  109. position: absolute;
  110. right: 30rpx;
  111. bottom: 26rpx;
  112. }
  113. }
  114. .area {
  115. width: 355rpx;
  116. height: 63rpx;
  117. margin: 0 10rpx 0 24rpx;
  118. }
  119. .status {
  120. width: 204rpx;
  121. height: 63rpx;
  122. }
  123. .action {
  124. color: #000;
  125. }
  126. }
  127. .item-wrapper {
  128. padding: 0 20rpx;
  129. .item {
  130. width: 710rpx;
  131. height: 280rpx;
  132. background: #FFFFFF;
  133. box-shadow: 0px 0px 20rpx 0rpx rgba(50, 50, 52, 0.06);
  134. border-radius: 8rpx;
  135. padding:40rpx 20rpx;
  136. margin-bottom: 20rpx;
  137. .item-left {
  138. width: 190rpx;
  139. height: 200rpx;
  140. border-radius: 10rpx;
  141. image {
  142. width: 190rpx;
  143. height: 200rpx;
  144. border-radius: 10rpx;
  145. }
  146. }
  147. .item-right {
  148. padding-left: 22rpx;
  149. position: relative;
  150. .item-title {
  151. width: 316rpx;
  152. font-size: 30rpx;
  153. font-family: PingFang SC;
  154. font-weight: 500;
  155. color: #333333;
  156. overflow: hidden;
  157. text-overflow: ellipsis;
  158. white-space: nowrap;
  159. display: block;
  160. line-height: 1;
  161. padding-bottom: 14rpx;
  162. }
  163. .item-content {
  164. width: 416rpx;
  165. font-size: 22rpx;
  166. font-family: PingFang SC;
  167. font-weight: 400;
  168. color: #999999;
  169. line-height: 1.5;
  170. }
  171. .item-status {
  172. font-size: 24rpx;
  173. font-family: PingFang SC;
  174. font-weight: 500;
  175. color: #666666;
  176. line-height: 1.5;
  177. position: absolute;
  178. left: 22rpx;
  179. bottom: 0;
  180. text {
  181. color: #E80000;
  182. font-weight: bold;
  183. }
  184. }
  185. .item-btn {
  186. width: 160rpx;
  187. height: 60rpx;
  188. background: #F2F2F2;
  189. border-radius: 30px;
  190. font-size: 28rpx;
  191. font-family: PingFang SC;
  192. font-weight: 500;
  193. color: #999999;
  194. line-height: 60rpx;
  195. text-align: center;
  196. position: absolute;
  197. right: -42rpx;
  198. bottom: -9rpx;
  199. }
  200. .btn-active {
  201. background: #FA7E67;
  202. color: #fff;
  203. box-shadow: 0px 2px 20px 0px rgba(250, 126, 103, 0.5);
  204. }
  205. }
  206. }
  207. }
  208. </style>