index.vue 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  1. <template>
  2. <view class="content">
  3. <view class="one">
  4. <view class="one_1">
  5. <uni-segmented-control :current="current" :values="list" @clickItem="onClickItem" styleType="text"
  6. activeColor="#dd524d"></uni-segmented-control>
  7. </view>
  8. <view class="one_2">
  9. <view v-show="current === 0">
  10. <view class="list" v-for="(item, index) in historyList" :key="index">
  11. <view class="left" style = "outline-width:3px;outline-style:groove;"></view>
  12. <view class="right">
  13. <view class="name">{{item.title||'暂无名称'}}</view>
  14. <view class="type textOne">类型:{{item.title||'暂无类型'}} 人均:{{item.per||'0'}}元/人</view>
  15. <view class="type textOne">地址:{{item.address||'暂无地址'}}</view>
  16. </view>
  17. <view class="button">
  18. <text>复用</text>
  19. </view>
  20. </view>
  21. </view>
  22. <view v-show="current === 1">
  23. <view class="list" v-for="(item, index) in draftsList" :key="index">
  24. <view class="left"></view>
  25. <view class="right">
  26. <view class="name">{{item.title||'暂无名称'}}</view>
  27. <view class="type">类型:{{item.title||'暂无类型'}}</view>
  28. <view class="type">地址:{{item.address||'暂无地址'}}</view>
  29. </view>
  30. <view class="button">
  31. <text>复用</text>
  32. </view>
  33. </view>
  34. </view>
  35. </view>
  36. </view>
  37. </view>
  38. </template>
  39. <script setup lang="ts">
  40. import { getCurrentInstance, ref } from 'vue';
  41. //该依赖已内置不需要单独安装
  42. import { onLoad } from "@dcloudio/uni-app";
  43. // 请求接口
  44. const $api = getCurrentInstance()?.appContext.config.globalProperties.$api;
  45. // 详情信息id
  46. const id = ref('');
  47. // 基本信息
  48. const config = ref({ logoUrl: '' });
  49. const list = ref(['历史记录', '草稿箱']);
  50. const current = ref(0);
  51. // 历史记录
  52. const historyList = ref([{ id: 1, title: '友谊赛' }, { id: 1, title: '肝帝联赛' }])
  53. // 草稿箱
  54. const draftsList = ref([{ id: 1, title: '友谊赛' }, { id: 1, title: '友谊赛' }])
  55. onLoad(async (options) => {
  56. id.value = options && options.id
  57. await searchConfig();
  58. await search();
  59. })
  60. // config信息
  61. const searchConfig = async () => {
  62. config.value = uni.getStorageSync('config');
  63. };
  64. // 查询
  65. const search = async () => {
  66. if (id.value) { }
  67. };
  68. // 点击分页器
  69. const onClickItem = (e) => {
  70. if (current.value !== e.currentIndex) current.value = e.currentIndex
  71. };
  72. </script>
  73. <style lang="scss" scoped>
  74. .content {
  75. display: flex;
  76. flex-direction: column;
  77. .one {
  78. .one_2 {
  79. padding: 2vw;
  80. background-color: var(--footColor);
  81. .list {
  82. display: flex;
  83. justify-content: space-between;
  84. align-items: center;
  85. background-color: var(--mainColor);
  86. margin: 4vw 2vw 0 2vw;
  87. padding: 4vw;
  88. border-radius: 2vw;
  89. .left{
  90. }
  91. .right {
  92. width: 50vw;
  93. .name {
  94. font-size: var(--font16Size);
  95. font-weight: bold;
  96. }
  97. .type {
  98. font-size: var(--font14Size);
  99. color: var(--f85Color);
  100. margin: 1vw 0 0 0;
  101. }
  102. }
  103. .button {
  104. text {
  105. font-size: var(--font14Size);
  106. border: 1px solid var(--f12Color);
  107. padding: 1vw 3vw;
  108. border-radius: 5vw;
  109. }
  110. }
  111. }
  112. }
  113. }
  114. }
  115. </style>