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.

203 lines
4.1 KiB

5 days ago
  1. <template>
  2. <view class="payWay">
  3. <view class="card">
  4. <view class="name">{{ orderName }}</view>
  5. <view class="price"><text></text> {{ price }}</view>
  6. </view>
  7. <view class="card">
  8. <view class="h1">请选择支付方式</view>
  9. <view class="zfb" @click="changePayWay(2)">
  10. <view class="leftCon">
  11. <view class="icon">
  12. <image src="@/static/images/jiaofei_zfbIphone@2x.png" mode=""></image>
  13. </view>
  14. <view class="text">
  15. 支付宝支付
  16. </view>
  17. </view>
  18. <view class="rightStatusIcon">
  19. <image src="@/static/images/jiaofei_zhifu_selectIphone@2x.png" mode="" v-if="payWay==2">
  20. </image>
  21. <image src="@/static/images/jiaofei_zhifu_unselectIphone@2x.png" mode="" v-else></image>
  22. </view>
  23. </view>
  24. <view class="zfb" @click="changePayWay(1)">
  25. <view class="leftCon">
  26. <view class="icon">
  27. <image src="@/static/images/jiaofei_wxIphone@2x.png" mode=""></image>
  28. </view>
  29. <view class="text">
  30. 微信支付
  31. </view>
  32. </view>
  33. <view class="rightStatusIcon">
  34. <image src="@/static/images/jiaofei_zhifu_selectIphone@2x.png" mode="" v-if="payWay==1">
  35. </image>
  36. <image src="@/static/images/jiaofei_zhifu_unselectIphone@2x.png" mode="" v-else></image>
  37. </view>
  38. </view>
  39. </view>
  40. <view class="footBox">
  41. <view class="btn border" @click="cancelPay" >取消本次支付</view>
  42. <view class="btn" @click="submitPay">确认支付</view>
  43. </view>
  44. </view>
  45. </template>
  46. <script setup>
  47. import { ref } from 'vue'
  48. import { createPrepaidApi, memberVoicePage } from '@/config/api.js'
  49. import carStore from '@/store/modules/car.js'
  50. import {
  51. onLoad,
  52. } from "@dcloudio/uni-app"
  53. let usecarStore = carStore()
  54. const payWay = ref(1)
  55. function cancelPay() {
  56. uni.navigateBack()
  57. }
  58. function changePayWay(val) {
  59. payWay.value = val
  60. }
  61. function submitPay() {
  62. console.log('去支付吧')
  63. }
  64. let memberGradeId = 1
  65. async function createPrepaidApiFn() {
  66. let obj = {
  67. "memberGradeId": memberGradeId,
  68. "payType": 2,
  69. "returnUrl": "",
  70. "source": 1
  71. }
  72. const {data: res} = await createPrepaidApi(obj)
  73. // vipItemData.value = res
  74. console.log(res)
  75. }
  76. createPrepaidApiFn()
  77. let orderName = ref('')
  78. let price = ref(0)
  79. onLoad((option)=>{
  80. if(option.id) memberGradeId = option.id
  81. if(option.name) orderName.value = option.name
  82. if(option.price) orderName.value = option.price
  83. })
  84. </script>
  85. <style lang="scss" scoped>
  86. .payWay {
  87. padding: 0 32rpx;
  88. background: #F6F7FA;
  89. min-height: 100vh;
  90. overflow: hidden;
  91. .h1 {
  92. padding: 20rpx 0 20rpx 10rpx;
  93. font-weight: 700;
  94. }
  95. .card {
  96. border-radius: 20rpx;
  97. background-color: #fff;
  98. padding: 20rpx;
  99. margin: 40rpx 0;
  100. overflow: hidden;
  101. .price {
  102. font-size: 56rpx;
  103. font-weight: 700;
  104. text-align: center;
  105. padding-bottom: 20rpx;
  106. text {
  107. font-size: 30rpx;
  108. margin-right: -10rpx;
  109. }
  110. }
  111. .name {
  112. font-weight: 400;
  113. font-size: 28rpx;
  114. color: #CCCCCC;
  115. padding: 24rpx;
  116. text-align: center;
  117. }
  118. }
  119. .zfb {
  120. background-color: #fff;
  121. border-radius: 16rpx;
  122. padding: 0 16px;
  123. height: 110rpx;
  124. display: flex;
  125. justify-content: space-between;
  126. align-items: center;
  127. margin-bottom: 20rpx;
  128. .leftCon {
  129. display: flex;
  130. align-items: center;
  131. .icon {
  132. width: 48rpx;
  133. height: 48rpx;
  134. image {
  135. display: block;
  136. width: 100%;
  137. height: 100%;
  138. }
  139. }
  140. .text {
  141. font-size: 32rpx;
  142. color: #333;
  143. margin: 0 10rpx 0 20rpx;
  144. }
  145. .recommendIcon {
  146. width: 64rpx;
  147. height: 34rpx;
  148. image {
  149. width: 100%;
  150. height: 100%;
  151. display: block;
  152. }
  153. }
  154. }
  155. .rightStatusIcon {
  156. width: 42rpx;
  157. height: 42rpx;
  158. image {
  159. display: block;
  160. width: 100%;
  161. height: 100%;
  162. }
  163. }
  164. }
  165. }
  166. .footBox {
  167. display: flex;
  168. padding: 32rpx 0;
  169. justify-content: space-between;
  170. .btn {
  171. width: 48%;
  172. height: 98rpx;
  173. background: #2168FC;
  174. border-radius: 16rpx;
  175. color: #fff;
  176. text-align: center;
  177. line-height: 98rpx;
  178. &.border {
  179. background: none;
  180. border: 1px solid #2168FC;
  181. color: #2168FC;
  182. }
  183. }
  184. }
  185. </style>