猫妈狗爸伴宠师小程序前端代码
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

96 lines
1.8 KiB

3 months ago
2 months ago
3 months ago
3 months ago
  1. <template>
  2. <view class="my-level">
  3. <view class="my-level-need">
  4. <cardTitle :cardTitle="cardName"></cardTitle>
  5. <view :class="['my-level-content','mt20', baseList.length == 1 ? 'flex-rowc' : 'flex-b']">
  6. <view :class="i == 1 ? '' : 'flex-colc'" v-for="(item,i) in baseList" :key="i">
  7. <view class="color-999 size-28">{{item.title}}</view>
  8. <view class="mt20 size-28">{{item.num}}</view>
  9. </view>
  10. </view>
  11. </view>
  12. </view>
  13. <view >
  14. <up-swiper :list="list3" previousMargin="30" nextMargin="30" circular :autoplay="false" radius="10" height="300rpx"
  15. @change="swiperChange"></up-swiper>
  16. </view>
  17. </template>
  18. <script setup>
  19. import cardTitle from '../../components/cardTitle.vue'
  20. import {
  21. ref,
  22. reactive
  23. } from "vue"
  24. const props = defineProps({
  25. dataInfo : {
  26. default : () => {
  27. return {}
  28. }
  29. }
  30. })
  31. const cardName = ref("距离下一等级要求")
  32. const baseList = ref([
  33. {
  34. title: '仍需至少注册',
  35. num: "20人"
  36. },
  37. ]);
  38. const list3 = reactive([
  39. '/static/images/levelImage/1.jpeg',
  40. '/static/images/levelImage/2.jpg',
  41. ]);
  42. const swiperChange = (index) => {
  43. switch (index.current) {
  44. case 0:
  45. baseList.value = [{
  46. title: '仍需至少注册',
  47. num: "20人"
  48. }]
  49. break;
  50. case 1:
  51. baseList.value = [{
  52. title: '仍需至少注册',
  53. num: "20人"
  54. },
  55. {
  56. title: '或',
  57. num: " "
  58. },
  59. {
  60. title: '仍需至少下单',
  61. num: "5人"
  62. }
  63. ]
  64. break;
  65. case 2:
  66. break;
  67. case 3:
  68. break;
  69. case 4:
  70. break;
  71. }
  72. }
  73. </script>
  74. <style scoped lang="scss">
  75. @import "../index.scss";
  76. // .comp-card{
  77. // &-head{
  78. // .line{
  79. // width: 11rpx;
  80. // height: 38rpx;
  81. // background-color: #FFBF60;
  82. // border-radius: 6rpx;
  83. // }
  84. // .title{
  85. // font-weight: bold;
  86. // }
  87. // }
  88. // }
  89. </style>