detail.vue 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153
  1. <template>
  2. <view class="body">
  3. <view class="content uni-column">
  4. <view class="top uni-column">
  5. <view class="topbar uni-row">
  6. <image mode="aspectFit" class="topbar-back" @click="btnBack" src="/static/default/back.png"></image>
  7. <text class="mcName">详情页面</text>
  8. <view class="topbar-right"></view>
  9. </view>
  10. <view class="top-main uni-column">
  11. <text class="top-title">这里是详情页面的标题</text>
  12. <text class="top-desc">这里是详情页面的描述内容,展示详细信息。</text>
  13. </view>
  14. </view>
  15. <view class="main uni-column">
  16. <view class="info-box">
  17. <text class="info-text">欢迎来到详情页!</text>
  18. <text class="info-subtext">这是一个全屏展示的页面。</text>
  19. </view>
  20. <button class="btnStart" @click="btnAction">执行操作</button>
  21. </view>
  22. </view>
  23. </view>
  24. </template>
  25. <script>
  26. import tools from '../../common/tools';
  27. import Bridge from '../../sdk/bridge'; // 使用 SDK Bridge
  28. import {
  29. ossUrl
  30. } from '../../common/api';
  31. export default {
  32. data() {
  33. return {
  34. queryObj: {},
  35. queryString: "",
  36. }
  37. },
  38. onLoad(query) {
  39. this.queryObj = query;
  40. this.queryString = tools.objectToQueryString(this.queryObj);
  41. console.log("Detail Page Loaded", query);
  42. },
  43. methods: {
  44. btnBack() {
  45. // 返回首页或关闭当前 WebView
  46. // Bridge.back(); // 或者使用兼容的 tools.appAction
  47. const url = `action://to_home/`;
  48. Bridge.appAction(url);
  49. },
  50. btnAction() {
  51. uni.showToast({
  52. title: '点击了按钮',
  53. icon: 'none'
  54. });
  55. }
  56. }
  57. }
  58. </script>
  59. <style scoped>
  60. .content {
  61. width: 100vw;
  62. height: 100vh;
  63. background-color: #f5f5f5;
  64. }
  65. .top {
  66. width: 100%;
  67. height: 400rpx;
  68. padding-top: 40px; /* 适配状态栏 */
  69. background: linear-gradient(180deg, #178bff 0%, #004d9b 100%);
  70. color: white;
  71. }
  72. .topbar {
  73. width: 92%;
  74. padding: 0 4%;
  75. height: 88rpx;
  76. align-items: center;
  77. justify-content: space-between;
  78. }
  79. .topbar-back {
  80. width: 40rpx;
  81. height: 40rpx;
  82. }
  83. .mcName {
  84. font-size: 36rpx;
  85. font-weight: bold;
  86. }
  87. .topbar-right {
  88. width: 40rpx;
  89. }
  90. .top-main {
  91. flex: 1;
  92. justify-content: center;
  93. align-items: center;
  94. }
  95. .top-title {
  96. font-size: 48rpx;
  97. font-weight: bold;
  98. margin-bottom: 20rpx;
  99. }
  100. .top-desc {
  101. font-size: 28rpx;
  102. opacity: 0.8;
  103. }
  104. .main {
  105. flex: 1;
  106. width: 92%;
  107. margin: 0 auto;
  108. margin-top: -40rpx; /* 上移覆盖 */
  109. background-color: white;
  110. border-radius: 20rpx 20rpx 0 0;
  111. padding: 40rpx;
  112. box-sizing: border-box;
  113. justify-content: space-between;
  114. }
  115. .info-box {
  116. align-items: center;
  117. }
  118. .info-text {
  119. font-size: 32rpx;
  120. color: #333;
  121. margin-bottom: 20rpx;
  122. }
  123. .info-subtext {
  124. font-size: 26rpx;
  125. color: #666;
  126. }
  127. .btnStart {
  128. width: 100%;
  129. height: 90rpx;
  130. line-height: 90rpx;
  131. background-color: #178bff;
  132. color: white;
  133. border-radius: 45rpx;
  134. font-size: 32rpx;
  135. margin-bottom: 40rpx;
  136. }
  137. </style>