风险测评小程序前端代码仓库
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
6.0 KiB

  1. <template>
  2. <view class="page__view">
  3. <navbar title="支付" leftClick @leftClick="$utils.navigateBack" />
  4. <view class="flex flex-column info">
  5. <view>实付金额</view>
  6. <view class="flex price">
  7. <view>¥</view>
  8. <!-- todo: fetch -->
  9. <view class="highlight">24.00</view>
  10. </view>
  11. <view class="flex flex-column contact">
  12. <view>联系客服获取抵扣码</view>
  13. <image class="qr" :src="configList.customer_service_qrcode" :show-menu-by-longpress="true" mode="widthFix"></image>
  14. </view>
  15. </view>
  16. <view class="form">
  17. <uv-form
  18. ref="form"
  19. :model="form"
  20. :rules="rules"
  21. errorType="toast"
  22. >
  23. <view class="form-item">
  24. <uv-form-item prop="payment" :customStyle="formItemStyle">
  25. <view class="form-item-label">选择支付方式</view>
  26. <view class="form-item-content">
  27. <uv-radio-group
  28. v-model="selectedId"
  29. placement="column"
  30. shape="circle"
  31. size="30rpx"
  32. iconSize="30rpx"
  33. activeColor="#014FA2"
  34. >
  35. <view class="payment">
  36. <view class="flex payment-content">
  37. <view class="flex payment-content-info">
  38. <image class="icon" src="@/pages_order/static/report/icon-wx.png" mode="widthFix"></image>
  39. <view>微信支付</view>
  40. </view>
  41. <view>
  42. <!-- todo: check value -->
  43. <uv-radio :name="1"></uv-radio>
  44. </view>
  45. </view>
  46. </view>
  47. <view class="payment">
  48. <view class="flex payment-content">
  49. <view class="flex payment-content-info">
  50. <image class="icon" src="@/pages_order/static/report/icon-coupon.png" mode="widthFix"></image>
  51. <view>兑换码抵扣支付</view>
  52. </view>
  53. <view>
  54. <!-- todo: check value -->
  55. <uv-radio :name="0"></uv-radio>
  56. </view>
  57. </view>
  58. </view>
  59. </uv-radio-group>
  60. </view>
  61. </uv-form-item>
  62. </view>
  63. <view class="form-item is-child">
  64. <uv-form-item prop="code" :customStyle="formItemStyle">
  65. <view class="flex row">
  66. <view class="form-item-label">兑换码</view>
  67. <view class="form-item-content">
  68. <input
  69. v-model="form.code"
  70. placeholder="请输入兑换码"
  71. placeholderStyle="color: #999999; font-size: 30rpx; font-weight: 400;"
  72. />
  73. </view>
  74. </view>
  75. </uv-form-item>
  76. </view>
  77. </uv-form>
  78. </view>
  79. <view class="bottom">
  80. <button class="btn" @click="onPay">立即支付</button>
  81. </view>
  82. <codeErrorPopup ref="codeErrorPopup"></codeErrorPopup>
  83. </view>
  84. </template>
  85. <script>
  86. import codeErrorPopup from './codeErrorPopup.vue'
  87. export default {
  88. components: {
  89. codeErrorPopup,
  90. },
  91. data() {
  92. return {
  93. batchNo: null,
  94. form: {
  95. payment: null,
  96. code: null,
  97. },
  98. rules: {
  99. 'payment': {
  100. type: 'string',
  101. required: false,
  102. message: '请选择支付方式',
  103. },
  104. 'code': {
  105. type: 'string',
  106. required: true,
  107. message: '请输入兑换码',
  108. },
  109. },
  110. formItemStyle: { padding: 0 },
  111. }
  112. },
  113. onLoad(arg) {
  114. const { batchNo } = arg
  115. this.batchNo = batchNo
  116. },
  117. methods: {
  118. onPay() {
  119. // todo
  120. // todo: check code is error
  121. // if error
  122. // this.$refs.codeErrorPopup.open()
  123. uni.redirectTo({
  124. url: `/pages_order/report/userInfo?batchNo=${this.batchNo}`
  125. })
  126. },
  127. },
  128. }
  129. </script>
  130. <style scoped lang="scss">
  131. .info {
  132. width: 100%;
  133. padding: 96rpx 62rpx 51rpx 62rpx;
  134. box-sizing: border-box;
  135. font-size: 28rpx;
  136. line-height: 50rpx;
  137. color: #000000;
  138. .price {
  139. margin-top: 23rpx;
  140. align-items: baseline;
  141. column-gap: 13rpx;
  142. font-size: 51rpx;
  143. line-height: 72rpx;
  144. color: #000000;
  145. .highlight {
  146. font-size: 78rpx;
  147. line-height: 110rpx;
  148. }
  149. }
  150. .contact {
  151. margin-top: 52rpx;
  152. row-gap: 40rpx;
  153. width: 100%;
  154. padding: 30rpx 0 26rpx 0;
  155. box-sizing: border-box;
  156. border: 1rpx dashed #014FA2;
  157. .qr {
  158. width: 157rpx;
  159. height: auto;
  160. }
  161. }
  162. }
  163. .form {
  164. &-item {
  165. &-label {
  166. padding: 0 38rpx;
  167. font-size: 28rpx;
  168. line-height: 50rpx;
  169. color: #000000;
  170. }
  171. &-content {
  172. }
  173. }
  174. }
  175. .payment {
  176. &:first-child {
  177. margin-top: 24rpx;
  178. }
  179. & + & {
  180. border-top: 20rpx solid #F7F7F7;
  181. }
  182. &-content {
  183. justify-content: space-between;
  184. padding: 32rpx 60rpx 32rpx 50rpx;
  185. &-info {
  186. column-gap: 15rpx;
  187. font-size: 30rpx;
  188. color: #000000;
  189. .icon {
  190. width: 58rpx;
  191. height: auto;
  192. }
  193. }
  194. }
  195. }
  196. .form-item.is-child {
  197. padding: 22rpx 60rpx 0 123rpx;
  198. .form-item-label,
  199. .form-item-content {
  200. padding: 0;
  201. }
  202. .form-item-label {
  203. padding-right: 16rpx;
  204. font-size: 30rpx;
  205. }
  206. .form-item-content {
  207. flex: 1;
  208. padding: 11rpx;
  209. background: #F7F7F7;
  210. }
  211. }
  212. .bottom {
  213. position: fixed;
  214. left: 0;
  215. bottom: 0;
  216. width: 100%;
  217. padding: 35rpx 56rpx;
  218. padding-bottom: calc(env(safe-area-inset-bottom) + 35rpx);
  219. background: #FFFFFF;
  220. box-sizing: border-box;
  221. .btn {
  222. width: 100%;
  223. padding: 29rpx 0;
  224. font-size: 30rpx;
  225. line-height: 1.5;
  226. color: #FFFFFF;
  227. background: #014FA2;
  228. border-radius: 50rpx;
  229. }
  230. }
  231. </style>