info.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475
  1. <template>
  2. <view class="content">
  3. <view class="one">
  4. <view class="left" @tap="toEdit(info)">
  5. <view class="left_1">
  6. <image class="image" mode="aspectFill" :src="info.logo||'/static/qiudui.png'">
  7. </image>
  8. </view>
  9. <view class="right_1">
  10. <view class="name">{{info.name||'暂无名称'}}</view>
  11. <view class="ranking">{{info.ranking||'暂无排名'}}</view>
  12. </view>
  13. </view>
  14. <view class="right">
  15. <button type="warn" size="mini" @tap="toSave">
  16. <uni-icons type="plusempty" size="12" color="#ffffff"></uni-icons>
  17. <text>创建</text>
  18. </button>
  19. </view>
  20. </view>
  21. <view class="position">
  22. <view class="two">
  23. <view class="two_1">
  24. 创建活动,还可以微信、短信通知队员报名
  25. </view>
  26. <view class="two_2">
  27. <button type="warn" size="mini" @tap="toSave">创建</button>
  28. </view>
  29. <view class="two_3" @tap="toInfo({route: '/pagesHome/activity/index'})">
  30. <uni-icons type="list" size="18"></uni-icons>
  31. <text>查看全部活动</text>
  32. </view>
  33. </view>
  34. <view class="thr">
  35. <view class="thr_1">
  36. <view class="list" v-for="(item, index) in menuList" :key="index" @tap="toInfo(item)">
  37. <uni-icons custom-prefix="iconfont" :type="item.icon" size="25" :color="item.color"></uni-icons>
  38. <view class="name">{{item.name}}</view>
  39. </view>
  40. </view>
  41. <view class="thr_2">
  42. <view class="fraction">
  43. <view class="top">{{info.score||0}}</view>
  44. <view class="bottom">总比赛</view>
  45. </view>
  46. <view class="circle">
  47. <circle :pro="16/100" :border_back_color="'#f1f1f1'" :border_color="'#FF0000'" content="16">
  48. </circle>
  49. <text>胜</text>
  50. </view>
  51. <view class="circle">
  52. <circle :pro="5/100" :border_back_color="'#f1f1f1'" :border_color="'#35BD7B'" content="5">
  53. </circle>
  54. <text>平</text>
  55. </view>
  56. <view class="circle">
  57. <circle :pro="17/100" :border_back_color="'#f1f1f1'" :border_color="'#FFA500'" content="17">
  58. </circle>
  59. <text>负</text>
  60. </view>
  61. <uni-icons type="forward" size="25" color="#858585"></uni-icons>
  62. </view>
  63. </view>
  64. <view class="four">
  65. <view class="four_1">
  66. <view class="left">
  67. 球队历程
  68. </view>
  69. <view class="right" @tap="toInfo({route: '/pagesHome/team/album'})">
  70. <uni-icons custom-prefix="iconfont" type="icon-xiangce" size="20" color="#333333"></uni-icons>
  71. <view class="name">去相册</view>
  72. </view>
  73. </view>
  74. <view class="four_2">
  75. <view class="list" v-for="(item, index) in list" :key="index" @tap="toActivity(item)">
  76. <view class="list_1">
  77. <view class="date">{{item.date||'暂无日期'}}</view>
  78. <view class="status"
  79. :class="[item.status=='0'?'status0':item.status=='1'?'status1':'status2']">
  80. {{item.status_name||'暂无状态'}}
  81. </view>
  82. </view>
  83. <view class="list_2">
  84. <view class="name">{{item.name||'暂无活动名称'}}</view>
  85. <view class="score">
  86. <view class="red">
  87. <view class="red_name">{{item.red_name||'暂无红方名称'}}</view>
  88. <view class="red_image">
  89. <image class="image" mode="aspectFill" :src="item.red_logo||config.logoUrl">
  90. </image>
  91. </view>
  92. <view class="red_score">{{item.red_score||0}}</view>
  93. </view>
  94. <view class="center">:</view>
  95. <view class="blue">
  96. <view class="blue_score">{{item.blue_score||0}}</view>
  97. <view class="blue_image">
  98. <image class="image" mode="aspectFill" :src="item.blue_logo||config.logoUrl">
  99. </image>
  100. </view>
  101. <view class="blue_name">{{item.blue_name||'暂无蓝方名称'}}</view>
  102. </view>
  103. </view>
  104. </view>
  105. </view>
  106. </view>
  107. </view>
  108. </view>
  109. </view>
  110. </template>
  111. <script setup lang="ts">
  112. import { getCurrentInstance, ref } from 'vue';
  113. import circle from './components/circle.vue';
  114. //该依赖已内置不需要单独安装
  115. import { onLoad } from "@dcloudio/uni-app";
  116. // 请求接口
  117. const $api = getCurrentInstance()?.appContext.config.globalProperties.$api;
  118. interface PropsItem {
  119. id ?: number,
  120. name ?: string,
  121. date ?: string,
  122. red_name ?: string,
  123. red_score ?: number,
  124. red_logo ?: string,
  125. blue_name ?: string,
  126. blue_score ?: number,
  127. blue_logo ?: string,
  128. status ?: string,
  129. status_name ?: string,
  130. };
  131. // 列表
  132. const list = ref<PropsItem[]>([{ id: 1, name: '测试球队' }, { id: 1, name: '肝帝集团队' }]);
  133. // 分页
  134. const skip = ref(0);
  135. const limit = ref(6);
  136. const page = ref(0);
  137. const total = ref(0);
  138. // 详情
  139. const info = ref({ id: 1, name: '测试球队', score: '39' });
  140. // 详情信息id
  141. const id = ref('');
  142. // 基本信息
  143. const config = ref({ logoUrl: '' });
  144. onLoad(async (options) => {
  145. id.value = options && options.id
  146. await searchConfig();
  147. await search();
  148. })
  149. // config信息
  150. const searchConfig = async () => {
  151. config.value = uni.getStorageSync('config');
  152. };
  153. // 查询
  154. const search = async () => {
  155. if (id.value) { }
  156. };
  157. // 标签列表
  158. const menuList = ref([
  159. { name: '队员', icon: 'icon-a-14-chengyuanguanli', color: '#333333', route: '/pagesHome/team/person', },
  160. { name: '相册', icon: 'icon-xiangce', color: '#333333', route: '/pagesHome/team/album', },
  161. { name: '账本', icon: 'icon-zhangben', color: '#333333', route: '/pagesHome/team/book', },
  162. { name: '战术板', icon: 'icon-cricket-pitch', color: '#333333', route: '/pagesHome/team/board', },
  163. ]);
  164. // 修改
  165. const toEdit = (item : any) => {
  166. uni.navigateTo({
  167. url: `/pagesHome/team/index?id=${item._id || item.id}`,
  168. })
  169. };
  170. // 菜单详情
  171. const toInfo = (item : any) => {
  172. uni.navigateTo({
  173. url: `${item.route}?id=${id.value}`,
  174. })
  175. };
  176. // 活动详情
  177. const toActivity = (item : any) => {
  178. uni.navigateTo({
  179. url: `/pagesHome/activity/info?id=${item._id || item.id}&name=${item.name}`,
  180. })
  181. };
  182. // 创建
  183. const toSave = () => { };
  184. </script>
  185. <style lang="scss" scoped>
  186. .content {
  187. display: flex;
  188. flex-direction: column;
  189. width: 100vw;
  190. height: 100vh;
  191. background-color: var(--footColor);
  192. .one {
  193. display: flex;
  194. justify-content: space-between;
  195. height: 40vw;
  196. padding: 8vw 3vw 0 3vw;
  197. background-color: var(--f12Color);
  198. .left {
  199. display: flex;
  200. .left_1 {
  201. padding: 0 2vw;
  202. .image {
  203. width: 18vw;
  204. height: 18vw;
  205. border-radius: 1vw;
  206. background-color: var(--mainColor);
  207. }
  208. }
  209. .right_1 {
  210. color: var(--mainColor);
  211. .name {
  212. font-size: var(--font18Size);
  213. font-weight: bold;
  214. }
  215. .ranking {
  216. margin: 4vw 0 0 0;
  217. font-size: var(--font16Size);
  218. }
  219. }
  220. }
  221. .right {
  222. margin: 4vw 0 0 0;
  223. text {
  224. font-size: var(--font14Size);
  225. }
  226. }
  227. }
  228. .position {
  229. position: absolute;
  230. top: 35vw;
  231. .two {
  232. width: 94vw;
  233. margin: 0 3vw;
  234. padding: 5vw 0 0 0;
  235. border-radius: 1vw;
  236. text-align: center;
  237. background-color: var(--mainColor);
  238. .two_1 {
  239. font-size: var(--font16Size);
  240. color: var(--f99Color);
  241. padding: 2vw 0;
  242. }
  243. .two_2 {
  244. padding: 4vw 0;
  245. button {
  246. padding: 0 10vw;
  247. font-size: var(--font16Size);
  248. }
  249. }
  250. .two_3 {
  251. display: flex;
  252. align-items: center;
  253. justify-content: center;
  254. padding: 5vw 0;
  255. font-size: var(--font14Size);
  256. border-top: 1px solid var(--footColor);
  257. text {
  258. padding: 0 2vw;
  259. }
  260. }
  261. }
  262. .thr {
  263. width: 94vw;
  264. margin: 3vw;
  265. padding: 2vw 0;
  266. border-radius: 1vw;
  267. background-color: var(--mainColor);
  268. .thr_1 {
  269. display: flex;
  270. justify-content: space-around;
  271. padding: 1vw 0 4vw 0;
  272. border-bottom: 1px solid var(--footColor);
  273. .list {
  274. display: flex;
  275. flex-direction: column;
  276. align-items: center;
  277. .name {
  278. margin: 1vw 0 0 0;
  279. color: var(--f33Color);
  280. font-size: var(--font14Size);
  281. }
  282. }
  283. }
  284. .thr_2 {
  285. display: flex;
  286. justify-content: space-between;
  287. align-items: center;
  288. padding: 4vw 2vw;
  289. .fraction {
  290. display: flex;
  291. flex-direction: column;
  292. align-items: center;
  293. .top {
  294. font-size: var(--font20Size);
  295. font-weight: bold;
  296. }
  297. .bottom {
  298. color: var(--f99Color);
  299. font-size: var(--font14Size);
  300. }
  301. }
  302. .circle {
  303. display: flex;
  304. align-items: center;
  305. color: var(--f99Color);
  306. font-size: var(--font14Size);
  307. text {
  308. padding: 0 1vw;
  309. }
  310. }
  311. }
  312. }
  313. .four {
  314. width: 94vw;
  315. margin: 3vw;
  316. padding: 2vw 0;
  317. border-radius: 1vw;
  318. background-color: var(--mainColor);
  319. .four_1 {
  320. display: flex;
  321. justify-content: space-between;
  322. padding: 2vw;
  323. border-bottom: 1px solid var(--footColor);
  324. .left {
  325. font-size: var(--font18Size);
  326. font-weight: bold;
  327. }
  328. .right {
  329. display: flex;
  330. .name {
  331. padding: 0 1vw;
  332. }
  333. }
  334. }
  335. .four_2 {
  336. .list {
  337. .list_1 {
  338. display: flex;
  339. align-items: center;
  340. padding: 4vw 2vw 2vw 2vw;
  341. .date {
  342. font-size: var(--font16Size);
  343. font-weight: bold;
  344. }
  345. .status {
  346. font-size: var(--font12Size);
  347. margin: 0 1vw;
  348. padding: 1px 5px;
  349. }
  350. .status0 {
  351. color: var(--mainColor);
  352. background-color: var(--fF0Color);
  353. }
  354. .status1 {
  355. color: var(--mainColor);
  356. background-color: var(--fFFColor);
  357. }
  358. .status2 {
  359. color: var(--f99Color);
  360. background-color: var(--f9Color);
  361. }
  362. }
  363. .list_2 {
  364. border: 1px solid var(--f5Color);
  365. padding: 2vw;
  366. border-radius: 2px;
  367. .name {
  368. font-size: var(--font16Size);
  369. font-weight: bold;
  370. margin: 2vw;
  371. }
  372. .score {
  373. display: flex;
  374. align-items: center;
  375. justify-content: center;
  376. font-size: var(--font14Size);
  377. background-color: var(--f9Color);
  378. border-radius: 5vw;
  379. padding: 1vw 0;
  380. .red {
  381. display: flex;
  382. align-items: center;
  383. margin: 0 1vw 0 0;
  384. .red_image {
  385. margin: 0 1vw;
  386. .image {
  387. width: 8vw;
  388. height: 8vw;
  389. border-radius: 8vw;
  390. }
  391. }
  392. .red_score {
  393. font-size: var(--font16Size);
  394. color: var(--fF0Color);
  395. }
  396. }
  397. .center {
  398. font-size: var(--font16Size);
  399. color: var(--fF0Color);
  400. }
  401. .blue {
  402. display: flex;
  403. align-items: center;
  404. margin: 0 0 0 1vw;
  405. .blue_image {
  406. margin: 0 1vw;
  407. .image {
  408. width: 8vw;
  409. height: 8vw;
  410. border-radius: 8vw;
  411. }
  412. }
  413. .blue_score {
  414. font-size: var(--font16Size);
  415. color: var(--fF0Color);
  416. }
  417. }
  418. }
  419. }
  420. }
  421. }
  422. }
  423. }
  424. }
  425. </style>