index.vue 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138
  1. <template>
  2. <view class="content">
  3. <view class="one">
  4. <scroll-view scroll-y="true" class="scroll-view">
  5. <view class="list-scroll-view">
  6. <view class="one_1"></view>
  7. <uni-segmented-control :current="current" :values="list" @clickItem="onClickItem" styleType="text"
  8. activeColor="#dd524d"></uni-segmented-control>
  9. <view class="one_2">
  10. <view v-show="current === 0">
  11. <match></match>
  12. </view>
  13. <view v-show="current === 1">
  14. <activity></activity>
  15. </view>
  16. <view v-show="current === 2">
  17. <activity></activity>
  18. </view>
  19. </view>
  20. </view>
  21. </scroll-view>
  22. </view>
  23. <view class="two">
  24. <view class="left">
  25. <view class="left_1">
  26. <uni-icons @tap="toClose" custom-prefix="iconfont" type="icon-caogao04" size="20"
  27. color="#696969"></uni-icons>
  28. <text>保存草稿</text>
  29. </view>
  30. <view class="left_1">
  31. <uni-icons @tap="toClose" custom-prefix="iconfont" type="icon-icon_cz" size="20"
  32. color="#696969"></uni-icons>
  33. <text>复用</text>
  34. </view>
  35. </view>
  36. <view class="right">
  37. <button type="warn" size="mini" form-type="submit">完成</button>
  38. </view>
  39. </view>
  40. </view>
  41. </template>
  42. <script setup lang="ts">
  43. import { getCurrentInstance, ref } from 'vue';
  44. //该依赖已内置不需要单独安装
  45. import { onLoad } from "@dcloudio/uni-app";
  46. import activity from './components/activity.vue';
  47. import match from './components/match.vue';
  48. // 请求接口
  49. const $api = getCurrentInstance()?.appContext.config.globalProperties.$api;
  50. // 基本信息
  51. const config = ref({});
  52. // 详情信息id
  53. const id = ref('');
  54. const list = ref(['友谊赛', '训练', '活动']);
  55. const current = ref(0);
  56. onLoad(async (options) => {
  57. // 球队id
  58. id.value = options && options.id
  59. await searchConfig();
  60. await search();
  61. })
  62. // config信息
  63. const searchConfig = async () => {
  64. config.value = uni.getStorageSync('config');
  65. };
  66. // 查询
  67. const search = async () => {
  68. if (id.value) { }
  69. };
  70. // 点击分页器
  71. const onClickItem = (e) => {
  72. if (current.value !== e.currentIndex) current.value = e.currentIndex
  73. };
  74. </script>
  75. <style lang="scss" scoped>
  76. .content {
  77. display: flex;
  78. flex-direction: column;
  79. width: 100vw;
  80. height: 100vh;
  81. .one {
  82. position: relative;
  83. flex-grow: 1;
  84. .one_1 {
  85. height: 20vw;
  86. background-color: var(--f12Color);
  87. }
  88. }
  89. .two {
  90. display: flex;
  91. justify-content: space-between;
  92. align-items: center;
  93. padding: 2vw;
  94. .left {
  95. display: flex;
  96. .left_1 {
  97. display: flex;
  98. flex-direction: column;
  99. align-items: center;
  100. padding: 0 2vw;
  101. font-size: var(--font14Size);
  102. color: var(--f69Color);
  103. text {
  104. margin: 2px 0 0 0;
  105. }
  106. }
  107. }
  108. .right {
  109. button {
  110. width: 60vw;
  111. font-size: var(--font16Size);
  112. }
  113. }
  114. }
  115. }
  116. .scroll-view {
  117. position: absolute;
  118. top: 0;
  119. left: 0;
  120. right: 0;
  121. bottom: 0;
  122. .list-scroll-view {
  123. display: flex;
  124. flex-direction: column;
  125. }
  126. }
  127. </style>