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