知识付费微信小程序
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.

294 lines
5.4 KiB

1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
11 months ago
11 months ago
11 months ago
11 months ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
11 months ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
11 months ago
1 year ago
1 year ago
1 year ago
  1. <template>
  2. <view class="index">
  3. <view class="top">
  4. <view class="content">
  5. <image class="content-img" :src="shopInfo.image" />
  6. <view class="content-left">
  7. <u-row style="margin: 10rpx;">
  8. <u-col>{{ shopInfo.title }}</u-col>
  9. </u-row>
  10. <u-row justify="space-between" style="margin: 20rpx; font-size: 12px;">
  11. <u-col span="6">
  12. 级别:初级
  13. </u-col>
  14. <u-col span="6">
  15. {{ shopInfo.num }}人学习
  16. </u-col>
  17. </u-row>
  18. <u-row justify="space-between" style="margin: 10rpx; font-size: 16px;">
  19. <u-col span="4">
  20. <view style="color: #ff7800;font-size: 45rpx;">
  21. {{ shopInfo.price }}
  22. </view>
  23. </u-col>
  24. <u-col span="4" style="text-decoration:line-through">
  25. <view class="icon">
  26. <u-number-box style="margin: 0 auto;" v-model="registerForm.num" :min="1">
  27. <view slot="minus" class="minus">
  28. <u-icon name="minus" size="12" color="#fff"></u-icon>
  29. </view>
  30. <template v-slot:input>
  31. <text style="width: 50px;text-align: center;" class="input">
  32. {{ registerForm.num }}
  33. </text>
  34. </template>
  35. <view slot="plus" class="plus">
  36. <u-icon name="plus" color="#FFFFFF" size="12"></u-icon>
  37. </view>
  38. </u-number-box>
  39. </view>
  40. </u-col>
  41. </u-row>
  42. </view>
  43. </view>
  44. </view>
  45. <view class="cell">
  46. <view class="cell-box">
  47. <view>
  48. 无法查看资源内容请购买!
  49. </view>
  50. </view>
  51. </view>
  52. <view class="book">
  53. <view class="book-text">
  54. <view style="padding-top: 20rpx;font-size: 14px;">资源介绍</view>
  55. <uv-parse :content="shopInfo.content"></uv-parse>
  56. </view>
  57. </view>
  58. <view class="bottom-flex">
  59. <view class="icon">
  60. <u-icon name="server-man" size="40rpx"></u-icon>
  61. 客服
  62. </view>
  63. <view class="button">
  64. <view class="button-right">
  65. <view @click="createPayOrder">
  66. 立即购买 ({{ shopInfo.price * registerForm.num }})
  67. </view>
  68. </view>
  69. </view>
  70. </view>
  71. </view>
  72. </template>
  73. <script>
  74. // wxf173d7bec0f1bbe0
  75. export default {
  76. data() {
  77. return {
  78. registerForm: {
  79. num: 1
  80. },
  81. shopInfo: {}, //商品信息
  82. }
  83. },
  84. onLoad() {
  85. this.getShopInfo()
  86. },
  87. methods: {
  88. //获取商品信息
  89. getShopInfo() {
  90. this.$api('getPayShopOne', res => {
  91. this.shopInfo = res.result
  92. })
  93. },
  94. //创建订单、支付
  95. createPayOrder() {
  96. // if (this.$refs.login.checkLogin()) {
  97. // return
  98. // }
  99. this.registerForm.shopId = this.shopInfo.id
  100. this.$api('createPayOrder', this.registerForm, res => {
  101. console.log(res);
  102. })
  103. }
  104. }
  105. }
  106. </script>
  107. <style scoped lang="scss">
  108. .index {
  109. background-color: #ccc;
  110. .bottom-flex {
  111. position: fixed;
  112. left: 0;
  113. bottom: 0;
  114. width: 100%;
  115. display: flex;
  116. height: 100rpx;
  117. padding: 10rpx 0;
  118. background-color: #fff;
  119. justify-content: space-between;
  120. box-sizing: border-box;
  121. padding: 0rpx 20rpx;
  122. .icon {
  123. font-size: 26rpx;
  124. display: flex;
  125. flex-direction: column;
  126. justify-content: center;
  127. align-items: center;
  128. }
  129. }
  130. }
  131. .top {
  132. padding-top: var(--status-bar-height);
  133. position: relative;
  134. height: 230rpx;
  135. background-color: #000;
  136. }
  137. .content {
  138. position: absolute;
  139. top: 20rpx;
  140. width: 100%;
  141. height: 250rpx;
  142. }
  143. .content-img {
  144. position: absolute;
  145. top: 20rpx;
  146. left: 20rpx;
  147. width: 220rpx;
  148. height: 160rpx;
  149. border-radius: 10rpx;
  150. }
  151. .content-left {
  152. position: absolute;
  153. color: #fff;
  154. font-size: 14px;
  155. left: 35%;
  156. top: 20rpx;
  157. line-height: 50rpx;
  158. }
  159. .cell {
  160. display: flex;
  161. justify-content: center;
  162. align-items: center;
  163. height: 140rpx;
  164. background-color: #fff;
  165. width: 100%;
  166. }
  167. .cell-box {
  168. display: flex;
  169. width: 90%;
  170. background-color: rgb(253, 194, 4);
  171. height: 70rpx;
  172. border-radius: 10rpx;
  173. font-size: 12px;
  174. justify-content: center;
  175. align-items: center;
  176. }
  177. /deep/ .book {
  178. margin-top: 20rpx;
  179. min-height: 600rpx;
  180. background-color: #fff;
  181. img {
  182. width: 100% !important;
  183. }
  184. }
  185. /deep/ .book-text {
  186. width: 94%;
  187. margin-left: 3%;
  188. min-height: 700rpx;
  189. font-size: 13px;
  190. line-height: 40rpx;
  191. padding-bottom: 100rpx;
  192. img {
  193. width: 100% !important;
  194. }
  195. }
  196. .book-img {
  197. padding-top: 20rpx;
  198. width: 100%;
  199. height: 300rpx;
  200. }
  201. .button {
  202. position: relative;
  203. display: flex;
  204. top: 10rpx;
  205. width: 350rpx;
  206. height: 80%;
  207. font-size: 12px;
  208. }
  209. .button-left {
  210. display: flex;
  211. justify-content: center;
  212. align-items: center;
  213. flex: 1;
  214. height: 100%;
  215. background-color: rgb(253, 194, 5);
  216. // border-top-left-radius: 50rpx;
  217. // border-bottom-left-radius: 50rpx;
  218. }
  219. .button-right {
  220. display: flex;
  221. justify-content: center;
  222. align-items: center;
  223. flex: 1;
  224. height: 100%;
  225. background-color: rgb(51, 51, 51);
  226. // border-top-right-radius: 50rpx;
  227. // border-bottom-right-radius: 50rpx;
  228. border-radius: 50rpx;
  229. color: #fff;
  230. }
  231. // 步进器
  232. .minus {
  233. width: 22px;
  234. height: 22px;
  235. border-width: 1px;
  236. border-color: white;
  237. border-style: solid;
  238. border-top-left-radius: 100px;
  239. border-top-right-radius: 100px;
  240. border-bottom-left-radius: 100px;
  241. border-bottom-right-radius: 100px;
  242. @include flex;
  243. justify-content: center;
  244. align-items: center;
  245. }
  246. .input {
  247. padding: 0 10px;
  248. margin: 0 10rpx;
  249. }
  250. .plus {
  251. width: 22px;
  252. height: 22px;
  253. background-color: rgb(253, 194, 5);
  254. border-radius: 50%;
  255. /* #ifndef APP-NVUE */
  256. display: flex;
  257. /* #endif */
  258. justify-content: center;
  259. align-items: center;
  260. }
  261. </style>