page.vue 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. <template>
  2. <view class="page-container" v-if="fetch && fetch.content">
  3. <use-tabbar :tabbar="false"></use-tabbar>
  4. <!-- 标题区域 -->
  5. <view class="page-title">
  6. {{ title }}
  7. </view>
  8. <!-- 内容卡片 -->
  9. <view class="content-card">
  10. <u-parse :content="fetch.content"></u-parse>
  11. </view>
  12. </view>
  13. </template>
  14. <script>
  15. export default {
  16. data() {
  17. return {
  18. fetch: {},
  19. title: '',
  20. };
  21. },
  22. onLoad(options) {
  23. let title = '单页内容';
  24. if (options) {
  25. if (!options.title) {
  26. this.Dever.alert('单页名称不能为空');
  27. return;
  28. }
  29. title = this.title = options.title;
  30. }
  31. uni.setNavigationBarTitle({
  32. title: title
  33. })
  34. this.DeverApi.get(this, 'main.page', { name: this.title });
  35. },
  36. }
  37. </script>
  38. <style lang="scss">
  39. .page-container {
  40. background-color: #f7f8fa;
  41. min-height: 100vh;
  42. padding: 20rpx;
  43. box-sizing: border-box;
  44. }
  45. .page-title {
  46. font-size: 36rpx;
  47. font-weight: bold;
  48. color: #333;
  49. margin-bottom: 30rpx;
  50. text-align: center;
  51. }
  52. .content-card {
  53. background: #fff;
  54. border-radius: 16rpx;
  55. padding: 30rpx;
  56. box-shadow: 0 6rpx 20rpx rgba(0, 0, 0, 0.05);
  57. line-height: 1.8;
  58. font-size: 28rpx;
  59. color: #444;
  60. img {
  61. width: 100%;
  62. border-radius: 12rpx;
  63. margin: 20rpx 0;
  64. }
  65. p {
  66. margin-bottom: 20rpx;
  67. }
  68. }
  69. </style>