index.vue 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. <template>
  2. <view class="agreement-list-page">
  3. <nav-bar title="协议列表"></nav-bar>
  4. <view class="list-container">
  5. <view class="agreement-item" v-for="item in agreements" :key="item.id" @click="goToDetail(item)">
  6. <view class="item-info">
  7. <text class="item-title">{{ item.title }}</text>
  8. </view>
  9. <uni-icons type="right" size="14" color="#ccc"></uni-icons>
  10. </view>
  11. </view>
  12. </view>
  13. </template>
  14. <script setup>
  15. // @Author: Antigravity
  16. import { ref } from 'vue'
  17. import navBar from '@/components/nav-bar/index.vue'
  18. // 协议列表,ID 参考 admin web 配置及后端 SysAgreementController
  19. const agreements = ref([
  20. { id: 2, title: '隐私政策' },
  21. { id: 1, title: '用户服务协议' }
  22. ])
  23. const goToDetail = (item) => {
  24. uni.navigateTo({
  25. url: `/pages/my/agreement/detail/index?id=${item.id}&title=${encodeURIComponent(item.title)}`
  26. })
  27. }
  28. </script>
  29. <style lang="scss" scoped>
  30. .agreement-list-page {
  31. min-height: 100vh;
  32. background: #f7f8fa;
  33. }
  34. .list-container {
  35. padding: 24rpx;
  36. }
  37. .agreement-item {
  38. display: flex;
  39. align-items: center;
  40. background: #fff;
  41. border-radius: 20rpx;
  42. padding: 32rpx;
  43. margin-bottom: 20rpx;
  44. box-shadow: 0 4rpx 12rpx rgba(0, 0, 0, 0.03);
  45. }
  46. .item-info {
  47. flex: 1;
  48. }
  49. .item-title {
  50. display: block;
  51. font-size: 30rpx;
  52. color: #333;
  53. font-weight: 500;
  54. }
  55. </style>