love.vue 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. <template>
  2. <view class="center">
  3. <view v-for="(item,index) in list" :key="index" class="box" @click="nav(item.src)">
  4. <image :src="item.image"></image>
  5. <view class="font">{{ item.name }}</view>
  6. </view>
  7. </view>
  8. </template>
  9. <script>
  10. export default {
  11. data() {
  12. return {
  13. list: [
  14. {
  15. image: '/static/images/money.jpg',
  16. name: '爱心捐款',
  17. src: '/pages/applic/contribution'
  18. },
  19. {
  20. image: '/static/images/goods.jpg',
  21. name: '其他捐款捐物渠道',
  22. src: '/pages/applic/other'
  23. }
  24. ]
  25. }
  26. },
  27. methods: {
  28. nav(url) {
  29. uni.navigateTo({
  30. url:url,
  31. })
  32. }
  33. }
  34. }
  35. </script>
  36. <style lang="scss">
  37. page,.center{
  38. height: 100%;
  39. background: #F2F2F2;
  40. }
  41. .box {
  42. width: 90% ;
  43. height: 416rpx;
  44. margin: 26rpx auto;
  45. background: #FEFEFE;
  46. border-radius: 20rpx;
  47. box-shadow: 0 0 10rpx rgba($color: #999, $alpha: 0.9);
  48. image {
  49. border-radius: 20rpx 20rpx 0 0;
  50. width: 100%;
  51. height: 300rpx;
  52. }
  53. .font {
  54. margin-top: 30rpx;
  55. font-size: 34rpx;
  56. font-family: PingFang SC;
  57. font-weight: 500;
  58. color: #0E0E0E;
  59. padding-left: 28rpx;
  60. }
  61. }
  62. </style>