小说小程序前端代码仓库(小程序)
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.

228 lines
5.1 KiB

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