小说小程序前端代码仓库(小程序)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

261 lines
4.9 KiB

  1. <template>
  2. <view class="subscription-info-container">
  3. <navbar title="订阅信息" leftClick @leftClick="$utils.navigateBack" />
  4. <view class="content-area">
  5. <view class="card">
  6. <view class="section-title">订阅章节</view>
  7. <view class="row row-split">
  8. <template v-if="!showBatch">
  9. <text class="label">章节名称</text>
  10. <view class="row-content">
  11. <text class="value">第1章 2004</text>
  12. <text class="batch-link" @click="showBatch = true">批量订阅</text>
  13. </view>
  14. </template>
  15. <template v-else>
  16. <view class="batch-row">
  17. <view class="batch-left">
  18. <text class="star">*</text>
  19. <text class="batch-title">批量订阅</text>
  20. </view>
  21. </view>
  22. <view class="batch-input-row">
  23. <input class="batch-input" v-model="batchCount" placeholder="请输入订阅数"
  24. placeholder-class="batch-placeholder" />
  25. <text class="batch-action" @click="batchSubscribeAction">订阅本章</text>
  26. </view>
  27. <view class="batch-divider"></view>
  28. </template>
  29. </view>
  30. <view class="row row-split">
  31. <text class="label">章节信息</text>
  32. <view class="row-content">
  33. <text class="value">本次订阅消耗10 豆豆</text>
  34. </view>
  35. </view>
  36. <view class="row">
  37. <text class="label">支付方式</text>
  38. <view class="row-content">
  39. <text class="value">账户余额0 豆豆</text>
  40. </view>
  41. </view>
  42. </view>
  43. <view class="card order-info">
  44. <view class="section-title">订单信息</view>
  45. <view class="row">
  46. <text class="label">内容</text>
  47. </view>
  48. <view class="row">
  49. <text class="price"><span class="total-label">合计</span><span class="total-amount">0.10
  50. </span></text>
  51. </view>
  52. </view>
  53. <view class="tips">
  54. 请仔细检查并确认相关信息因用户个人疏忽导致的充值错误章节用户自行承担一旦完成充值概不退换
  55. </view>
  56. </view>
  57. <button class="pay-btn" @click="payAndSubscribe">支付并订阅</button>
  58. </view>
  59. </template>
  60. <script>
  61. export default {
  62. data() {
  63. return {
  64. showBatch: false,
  65. batchCount: ''
  66. }
  67. },
  68. methods: {
  69. batchSubscribe() {
  70. uni.showToast({
  71. title: '批量订阅功能开发中',
  72. icon: 'none'
  73. })
  74. },
  75. batchSubscribeAction() {
  76. // Implementation of batchSubscribeAction method
  77. },
  78. payAndSubscribe() {
  79. uni.showToast({
  80. title: '支付成功,已订阅',
  81. icon: 'success'
  82. })
  83. // 可在此处添加支付逻辑
  84. }
  85. }
  86. }
  87. </script>
  88. <style scoped>
  89. .subscription-info-container {
  90. background: #f8f8f8;
  91. height: 100vh;
  92. overflow: hidden;
  93. position: relative;
  94. }
  95. .content-area {
  96. padding-bottom: 180rpx;
  97. }
  98. body {
  99. overflow: hidden;
  100. }
  101. .card {
  102. background: #fff;
  103. border-radius: 24rpx;
  104. margin: 32rpx 24rpx 0 24rpx;
  105. padding: 32rpx 24rpx;
  106. box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.03);
  107. }
  108. .section-title {
  109. font-size: 32rpx;
  110. font-weight: bold;
  111. color: #222;
  112. margin-bottom: 24rpx;
  113. }
  114. .row {
  115. display: flex;
  116. flex-direction: column;
  117. padding: 10rpx 0;
  118. margin-top: 10rpx;
  119. }
  120. .row-split {
  121. border-bottom: 1px solid #f0f0f0;
  122. }
  123. .label {
  124. color: #888;
  125. font-size: 26rpx;
  126. margin-bottom: 4rpx;
  127. margin-top: 20rpx;
  128. }
  129. .row-content {
  130. display: flex;
  131. flex-direction: row;
  132. align-items: center;
  133. justify-content: space-between;
  134. }
  135. .value {
  136. color: #222;
  137. font-size: 26rpx;
  138. }
  139. .batch-link {
  140. color: #3478f6;
  141. font-size: 24rpx;
  142. margin-left: 24rpx;
  143. }
  144. .order-info {
  145. margin-top: 32rpx;
  146. }
  147. .order-row {
  148. flex-direction: row;
  149. align-items: center;
  150. justify-content: space-between;
  151. padding: 10rpx 0;
  152. }
  153. .price {
  154. font-size: 28rpx;
  155. margin-left: 0;
  156. }
  157. .total-label {
  158. color: #222;
  159. }
  160. .total-amount {
  161. color: #ff6600;
  162. }
  163. .tips {
  164. color: #bbb;
  165. font-size: 22rpx;
  166. margin: 32rpx 24rpx 0 24rpx;
  167. line-height: 1.6;
  168. }
  169. .pay-btn {
  170. position: fixed;
  171. left: 24rpx;
  172. right: 24rpx;
  173. bottom: 90rpx;
  174. background: #0a297e;
  175. color: #fff;
  176. font-size: 32rpx;
  177. border-radius: 40rpx;
  178. height: 88rpx;
  179. line-height: 88rpx;
  180. text-align: center;
  181. font-weight: bold;
  182. z-index: 100;
  183. }
  184. .batch-row {
  185. display: flex;
  186. align-items: center;
  187. justify-content: space-between;
  188. margin-bottom: 0;
  189. }
  190. .batch-left {
  191. display: flex;
  192. align-items: center;
  193. }
  194. .star {
  195. color: #f5222d;
  196. margin-right: 6rpx;
  197. font-size: 26rpx;
  198. }
  199. .batch-title {
  200. font-size: 26rpx;
  201. color: #222;
  202. font-weight: 500;
  203. }
  204. .batch-action {
  205. color: #3478f6;
  206. font-size: 24rpx;
  207. margin-left: 24rpx;
  208. }
  209. .batch-input-row {
  210. display: flex;
  211. align-items: center;
  212. margin-top: 4rpx;
  213. }
  214. .batch-input {
  215. flex: 1;
  216. border: none;
  217. font-size: 24rpx;
  218. color: #bbb;
  219. background: transparent;
  220. outline: none;
  221. padding: 0;
  222. height: 40rpx;
  223. }
  224. .batch-placeholder {
  225. color: #bbb;
  226. font-size: 24rpx;
  227. }
  228. .batch-divider {
  229. height: 2rpx;
  230. background: #f0f0f0;
  231. width: 100%;
  232. margin-top: 4rpx;
  233. }
  234. </style>