index.vue 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  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. { id: 4, title: '商家托运协议' },
  23. { id: 5, title: '宠物洗护服务规范' } // 根据需求预留 ID:5
  24. ])
  25. const goToDetail = (item) => {
  26. uni.navigateTo({
  27. url: `/pages/my/agreement/detail/index?id=${item.id}&title=${encodeURIComponent(item.title)}`
  28. })
  29. }
  30. </script>
  31. <style lang="scss" scoped>
  32. .agreement-list-page {
  33. min-height: 100vh;
  34. background: #f7f8fa;
  35. }
  36. .list-container {
  37. padding: 24rpx;
  38. }
  39. .agreement-item {
  40. display: flex;
  41. align-items: center;
  42. background: #fff;
  43. border-radius: 20rpx;
  44. padding: 32rpx;
  45. margin-bottom: 20rpx;
  46. box-shadow: 0 4rpx 12rpx rgba(0, 0, 0, 0.03);
  47. }
  48. .item-info {
  49. flex: 1;
  50. }
  51. .item-title {
  52. display: block;
  53. font-size: 30rpx;
  54. color: #333;
  55. font-weight: 500;
  56. }
  57. </style>