index.vue 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194
  1. <template>
  2. <view class="content">
  3. <view class="one">
  4. <view class="one_1">
  5. <image class="image" mode="aspectFill" :src="teamInfo.logo||'/static/qiudui.png'">
  6. </image>
  7. <text>邀您加入球队</text>
  8. </view>
  9. <view class="one_2">
  10. <image class="image" mode="aspectFill" :src="teamInfo.logo||'/static/qiudui.png'">
  11. </image>
  12. <view class="name">{{teamInfo.name||'暂无名称'}}</view>
  13. </view>
  14. <view class="one_3">
  15. 加入我的球队,打造百年荣耀
  16. </view>
  17. <view class="one_4">
  18. <view class="list" v-for="(item, index) in teamList" :key="index">
  19. <view class="num">{{item.num}}</view>
  20. <view class="name">{{item.name||"暂无"}}</view>
  21. </view>
  22. </view>
  23. </view>
  24. <view class="two">用足球比赛管理球队,队长更轻松</view>
  25. <view class="thr">
  26. <view class="list" v-for="(item, index) in list" :key="index">
  27. <view class="title">. {{item.title}}</view>
  28. </view>
  29. </view>
  30. <view class="four" @tap="toAdd">
  31. <text>立即入队</text>
  32. </view>
  33. </view>
  34. </template>
  35. <script setup lang="ts">
  36. import { getCurrentInstance, ref } from 'vue';
  37. //该依赖已内置不需要单独安装
  38. import { onLoad } from "@dcloudio/uni-app";
  39. // 请求接口
  40. const $api = getCurrentInstance()?.appContext.config.globalProperties.$api;
  41. // 基本信息
  42. const config = ref({ logoUrl: '' });
  43. // 详情信息id
  44. const id = ref('');
  45. // 球队信息
  46. const teamInfo = ref({});
  47. // 介绍
  48. const list = ref([{ title: '球队活动通知 无缝对接微信群助手' }, { title: '球队数据记录 考勤/胜负/进球,记录运动回忆' }, { title: '队费明细管理 缴费收费实时提醒' }, { title: '团队共享相册 高清视频相册共享管理' }]);
  49. const teamList = ref([{ name: '入驻', num: '3年' }, { name: '|' }, { name: '活动', num: '21次' }, { name: '|' }, { name: '队员', num: '6人' }]);
  50. onLoad(async (options) => {
  51. id.value = options && options.id
  52. await searchConfig();
  53. await search();
  54. })
  55. // config信息
  56. const searchConfig = async () => {
  57. config.value = uni.getStorageSync('config');
  58. };
  59. // 查询
  60. const search = async () => {
  61. if (id.value) {
  62. const res = await $api(`team/${id.value}`, 'GET', {});
  63. if (res.code === 200) {
  64. if (res.data) teamInfo.value = res.data
  65. } else {
  66. uni.showToast({
  67. title: res.msg || '',
  68. icon: 'error',
  69. });
  70. }
  71. }
  72. };
  73. // 立即加入
  74. const toAdd = async () => {
  75. console.log('立即加入');
  76. };
  77. </script>
  78. <style lang="scss" scoped>
  79. .content {
  80. display: flex;
  81. flex-direction: column;
  82. align-items: center;
  83. width: 100vw;
  84. height: 100vh;
  85. background-color: #0bb78f;
  86. .one {
  87. width: 80vw;
  88. height: 60vw;
  89. margin: 4vw 0;
  90. padding: 4vw 2vw;
  91. border-radius: 2px;
  92. background-color: var(--mainColor);
  93. .one_1 {
  94. display: flex;
  95. justify-content: flex-start;
  96. align-items: center;
  97. font-size: var(--font14Size);
  98. color: var(--f85Color);
  99. margin: 2vw;
  100. .image {
  101. width: 10vw;
  102. height: 10vw;
  103. border-radius: 10vw;
  104. }
  105. text {
  106. padding: 0 2vw;
  107. }
  108. }
  109. .one_2 {
  110. display: flex;
  111. flex-direction: column;
  112. align-items: center;
  113. margin: 2vw 0;
  114. font-size: var(--font14Size);
  115. .image {
  116. width: 15vw;
  117. height: 15vw;
  118. border-radius: 2px;
  119. }
  120. .name {
  121. margin: 2vw 0 0 0;
  122. }
  123. }
  124. .one_3 {
  125. text-align: center;
  126. font-weight: bold;
  127. font-size: var(--font18Size);
  128. font-family: "Times New Roman", Times, serif;
  129. margin: 2vw 0;
  130. }
  131. .one_4 {
  132. display: flex;
  133. justify-content: space-evenly;
  134. margin: 2vw 0;
  135. .list {
  136. display: flex;
  137. flex-direction: column;
  138. align-items: center;
  139. justify-content: center;
  140. .num {
  141. font-weight: bold;
  142. font-size: var(--font18Size);
  143. color: #0bb78f;
  144. }
  145. .name {
  146. font-size: var(--font12Size);
  147. color: var(--f85Color);
  148. }
  149. }
  150. }
  151. }
  152. .two {
  153. font-weight: bold;
  154. font-size: var(--font18Size);
  155. }
  156. .thr {
  157. margin: 2vw 0;
  158. font-style: italic;
  159. font-size: var(--font14Size);
  160. .list {
  161. padding: 2vw;
  162. color: var(--mainColor);
  163. }
  164. }
  165. .four {
  166. margin: 2vw 0 0 0;
  167. font-style: italic;
  168. color: #0bb78f;
  169. text {
  170. border-radius: 2px;
  171. padding: 2vw 32vw;
  172. background-color: var(--mainColor);
  173. }
  174. }
  175. }
  176. </style>