index.ux 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. <import name="x-book" src="../../components/book/book.ux"></import>
  2. <template>
  3. <div class="detail-wrap">
  4. <div class="book-wrap">
  5. <x-book multi="{{true}}" width="{{180}}" prevent="{{true}}">
  6. <div class="book-info">
  7. <text class="name">一念阑珊,致辞中生</text>
  8. <div class="category">
  9. <text>豪门虐情</text>
  10. <text class="status">已完结</text>
  11. </div>
  12. <text class="words">字数:123124</text>
  13. <div class="user-operator">
  14. <text class="add" @click="addShelf">加入书架</text>
  15. <text class="read" @click="toRead">立即阅读</text>
  16. </div>
  17. </div>
  18. </x-book>
  19. <stack class="book-intro">
  20. <text class="short-info__text">{{substrInfoText()}}</text>
  21. <text class="toggle" @click="toggleTextStatus">{{showLongText ? '收起' : '展开'}}</text>
  22. </stack>
  23. </div>
  24. <text class="lastest-chapter" @click="toRead(book.lastest_id)">最新章节:第307章 大结局大结局大结局大结局大结局大结局大结局</text>
  25. <div class="box-wrap short-chapter__list">
  26. <div class="small-title">
  27. <div class="wrap-left">
  28. <!-- <text class="border-left"></text> -->
  29. <text class="title">目录</text>
  30. <text class="total">共307章</text>
  31. </div>
  32. <text class="wrap-right">2018-06-19 10:22:22</text>
  33. </div>
  34. <div class="chapter-list">
  35. <block for="cid in chapters">
  36. <text class="chapter-item" @click="toRead(cid)">第{{$idx + 1}}章</text>
  37. </block>
  38. </div>
  39. <text class="more-chapters" @click="toBookCatalog">更多目录 &gt;</text>
  40. </div>
  41. <div class="box-wrap similar-list__wrap">
  42. <div class="small-title">
  43. <div class="wrap-left">
  44. <!-- <text class="border-left"></text> -->
  45. <text class="title">同款推荐</text>
  46. </div>
  47. </div>
  48. <div class="similar-wrap">
  49. <block for="similar">
  50. <x-book similar="{{true}}"></x-book>
  51. </block>
  52. </div>
  53. </div>
  54. </div>
  55. </template>
  56. <script>
  57. import router from '@system.router';
  58. export default {
  59. private: {
  60. showLongText: false,
  61. book: {},
  62. info: "“boss,夫人说想去商场购物。”  某男笑,“去把商场买下来。”  “boss,有记者非议夫人。”  某男怒,“去告诉他,余阑珊是我顾念琛的妻子。”  “boss,夫人说晚上要和秦家公子聚餐。”  某男拍案,“反了。”  “老婆,你是我的独家私宠,谁准许你和别的男人去幽会的。”  自此之后,她身边有多少桃花,他就拧掉多少。  余阑珊终于忍无可忍了,愤怒道:“顾念琛,你太过分了。”  某男邪魅一笑,“老婆,这点就算过分?我还有更过分的。” ",
  63. chapters: [1, 2, 3, 4, 54, 6, 6, 1, 2, 3],
  64. similar: [1, 2, 3]
  65. },
  66. substrInfoText() {
  67. return this.showLongText ? this.info : this.info.slice(0, 110);
  68. },
  69. toggleTextStatus() {
  70. this.showLongText = !this.showLongText;
  71. this.substrInfoText();
  72. },
  73. addShelf() { },
  74. toRead(cid) {
  75. let chapter_id = this.book.cid;
  76. if (cid) chapter_id = cid;
  77. router.push({
  78. uri: "/views/Reader",
  79. params: {
  80. bid: this.book.bid,
  81. cid: chapter_id
  82. }
  83. })
  84. },
  85. toBookCatalog() {
  86. router.push({
  87. uri: "/views/Catalog",
  88. params: {
  89. bid: this.book.bid
  90. }
  91. })
  92. }
  93. }
  94. </script>
  95. <style lang="less">
  96. @import "../../assets/less/detail.less";
  97. </style>