index.vue 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297
  1. <template>
  2. <view class="container" :style="{paddingTop: navbarHeight + 'rpx'}">
  3. <!-- 顶部渐变背景 -->
  4. <view class="top-gradient"></view>
  5. <!-- 自定义导航栏 -->
  6. <view class="custom-navbar" :style="{paddingTop: statusBarHeight + 'px'}">
  7. <view class="navbar-content">
  8. <view class="navbar-back" @click="handleBack">
  9. <view class="iconfont icon-right back-icon"></view>
  10. </view>
  11. <text class="navbar-title">关于我们</text>
  12. <view class="navbar-placeholder"></view>
  13. </view>
  14. </view>
  15. <!-- 应用信息区域 -->
  16. <view class="app-info-section">
  17. <!-- 应用图标 -->
  18. <view class="app-icon-wrapper">
  19. <view class="app-icon-placeholder">
  20. <!-- 这里可以替换为实际的图标 -->
  21. </view>
  22. </view>
  23. <!-- 应用名称 -->
  24. <view class="app-name">{{ appName }}</view>
  25. <!-- 版本信息框 -->
  26. <view class="version-box">
  27. <text class="version-label">当前版本</text>
  28. <text class="version-number">{{ version }}</text>
  29. </view>
  30. </view>
  31. <!-- 法律协议区域 -->
  32. <view class="legal-section">
  33. <view class="legal-links">
  34. <text class="legal-link" @click="handleUserAgreement">《用户协议》</text>
  35. <text class="legal-separator">与</text>
  36. <text class="legal-link" @click="handlePrivacyPolicy">《隐私协议》</text>
  37. </view>
  38. </view>
  39. <!-- 版权信息 -->
  40. <view class="copyright-section">
  41. <view class="copyright-text">{{ copyright }}</view>
  42. <view class="icp-text">{{ icpNumber }}</view>
  43. </view>
  44. </view>
  45. </template>
  46. <script>
  47. export default {
  48. data() {
  49. return {
  50. statusBarHeight: 0,
  51. appName: '占位软件名',
  52. version: '1.0',
  53. copyright: '爱丽恩严(大连)商务科技有限公司版权所有',
  54. icpNumber: '辽ICP备2023008619号-4A'
  55. }
  56. },
  57. onLoad() {
  58. // 获取状态栏高度
  59. const systemInfo = uni.getSystemInfoSync()
  60. this.statusBarHeight = systemInfo.statusBarHeight || 0
  61. // 从配置中获取应用信息
  62. const app = getApp()
  63. if (app && app.globalData && app.globalData.config && app.globalData.config.appInfo) {
  64. const appInfo = app.globalData.config.appInfo
  65. if (appInfo.name) {
  66. this.appName = appInfo.name
  67. }
  68. if (appInfo.version) {
  69. this.version = appInfo.version
  70. }
  71. }
  72. },
  73. computed: {
  74. navbarHeight() {
  75. // 状态栏高度(px转rpx) + 导航栏高度(88rpx) + 间距(20rpx)
  76. return (this.statusBarHeight * 2) + 88 + 20
  77. }
  78. },
  79. methods: {
  80. handleBack() {
  81. uni.navigateBack()
  82. },
  83. handleUserAgreement() {
  84. // 跳转到用户协议页面
  85. const app = getApp()
  86. if (app && app.globalData && app.globalData.config && app.globalData.config.appInfo) {
  87. const agreements = app.globalData.config.appInfo.agreements
  88. if (agreements && agreements.length > 1) {
  89. const agreement = agreements[1] // 用户协议通常是第二个
  90. this.$tab.navigateTo(`/pages/common/webview/index?title=${encodeURIComponent(agreement.title)}&url=${encodeURIComponent(agreement.url)}`)
  91. }
  92. }
  93. },
  94. handlePrivacyPolicy() {
  95. // 跳转到隐私协议页面
  96. const app = getApp()
  97. if (app && app.globalData && app.globalData.config && app.globalData.config.appInfo) {
  98. const agreements = app.globalData.config.appInfo.agreements
  99. if (agreements && agreements.length > 0) {
  100. const agreement = agreements[0] // 隐私协议通常是第一个
  101. this.$tab.navigateTo(`/pages/common/webview/index?title=${encodeURIComponent(agreement.title)}&url=${encodeURIComponent(agreement.url)}`)
  102. }
  103. }
  104. }
  105. }
  106. }
  107. </script>
  108. <style lang="scss" scoped>
  109. page {
  110. background-color: #ffffff;
  111. }
  112. .container {
  113. min-height: 100vh;
  114. padding: 0 30rpx 20rpx 30rpx;
  115. background-color: #ffffff;
  116. position: relative;
  117. // 顶部渐变背景
  118. .top-gradient {
  119. position: fixed;
  120. top: 0;
  121. left: 0;
  122. right: 0;
  123. height: 800rpx;
  124. background: linear-gradient(180deg, rgba(59, 130, 246, 0.1) 0%, rgba(147, 197, 253, 0.05) 50%, transparent 100%);
  125. z-index: 0;
  126. pointer-events: none;
  127. }
  128. // 自定义导航栏
  129. .custom-navbar {
  130. position: fixed;
  131. top: 0;
  132. left: 0;
  133. right: 0;
  134. z-index: 999;
  135. background-color: transparent;
  136. pointer-events: none;
  137. .navbar-content {
  138. display: flex;
  139. align-items: center;
  140. justify-content: center;
  141. height: 88rpx;
  142. pointer-events: auto;
  143. position: relative;
  144. .navbar-back {
  145. position: absolute;
  146. left: 30rpx;
  147. width: 60rpx;
  148. height: 60rpx;
  149. display: flex;
  150. align-items: center;
  151. justify-content: center;
  152. .back-icon {
  153. font-size: 36rpx;
  154. color: #000000;
  155. transform: rotate(180deg);
  156. }
  157. }
  158. .navbar-title {
  159. font-size: 36rpx;
  160. font-weight: 500;
  161. color: #000000;
  162. }
  163. .navbar-placeholder {
  164. position: absolute;
  165. right: 30rpx;
  166. width: 60rpx;
  167. height: 60rpx;
  168. }
  169. }
  170. }
  171. }
  172. // 应用信息区域
  173. .app-info-section {
  174. display: flex;
  175. flex-direction: column;
  176. align-items: center;
  177. padding-top: 80rpx;
  178. padding-bottom: 60rpx;
  179. .app-icon-wrapper {
  180. margin-bottom: 40rpx;
  181. .app-icon-placeholder {
  182. width: 160rpx;
  183. height: 160rpx;
  184. border-radius: 32rpx;
  185. background-color: #007AFF;
  186. // 如果需要显示实际图标,可以这样:
  187. // background-image: url('/static/logo.png');
  188. // background-size: cover;
  189. // background-position: center;
  190. }
  191. }
  192. .app-name {
  193. font-size: 36rpx;
  194. font-weight: 500;
  195. color: #000000;
  196. margin-bottom: 60rpx;
  197. }
  198. .version-box {
  199. width: 100%;
  200. background-color: #ffffff;
  201. border-radius: 16rpx;
  202. padding: 32rpx 30rpx;
  203. display: flex;
  204. align-items: center;
  205. justify-content: space-between;
  206. box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.04);
  207. border: 1rpx solid #f0f0f0;
  208. .version-label {
  209. font-size: 32rpx;
  210. color: #000000;
  211. font-weight: 400;
  212. }
  213. .version-number {
  214. font-size: 32rpx;
  215. color: #999999;
  216. font-weight: 400;
  217. }
  218. }
  219. }
  220. // 法律协议区域
  221. .legal-section {
  222. padding: 40rpx 0;
  223. display: flex;
  224. justify-content: center;
  225. .legal-links {
  226. display: flex;
  227. align-items: center;
  228. flex-wrap: wrap;
  229. justify-content: center;
  230. .legal-link {
  231. font-size: 28rpx;
  232. color: #007AFF;
  233. text-decoration: none;
  234. }
  235. .legal-separator {
  236. font-size: 28rpx;
  237. color: #666666;
  238. margin: 0 10rpx;
  239. }
  240. }
  241. }
  242. // 版权信息
  243. .copyright-section {
  244. position: fixed;
  245. bottom: 100rpx;
  246. left: 0;
  247. right: 0;
  248. display: flex;
  249. flex-direction: column;
  250. align-items: center;
  251. padding: 0 30rpx;
  252. .copyright-text {
  253. font-size: 24rpx;
  254. color: #999999;
  255. line-height: 1.6;
  256. text-align: center;
  257. margin-bottom: 20rpx;
  258. }
  259. .icp-text {
  260. font-size: 24rpx;
  261. color: #999999;
  262. line-height: 1.6;
  263. text-align: center;
  264. }
  265. }
  266. </style>