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

262 lines
5.0 KiB

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