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.

breach_contract_pay.vue 4.0KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179
  1. <template>
  2. <view class="content-value">
  3. <view class="t-card">
  4. <view v-for="(item, index) in state.dataArray" @click="confirmPay(item)" class="ul-item" :key="index">
  5. <image style="width: 100%; height: 146rpx;" :src="`${$imgUrl}issuance/equity-bg.png`"
  6. mode='scaleToFill'>
  7. </image>
  8. <view class="item-value">
  9. <view class="money">
  10. <text class='unit'>¥</text>
  11. <text>{{ item.fee * 0.01 }}</text>
  12. </view>
  13. <view class="content">
  14. <view class="title">
  15. {{ item.payName }}
  16. </view>
  17. </view>
  18. <view class="r-btn">
  19. {{ item.payStatusName }}
  20. </view>
  21. </view>
  22. </view>
  23. </view>
  24. </view>
  25. </template>
  26. <script setup lang="ts">
  27. import { reactive, ref, computed } from "vue";
  28. import { onLoad } from "@dcloudio/uni-app";
  29. import { breachContractPaySearch, deviceLogOutStateQuery, afterSalesPayApply, confirmBreachContract } from '@/utils/network/api.js'
  30. import { requestNew } from "@/utils/network/request.js";
  31. import { number } from "echarts";
  32. import { confirm } from '@/utils/utils'
  33. import { logOffOver } from './js/log-off.js'
  34. import { deviceStore } from '@/stores/device.js'
  35. import { getAfterSalesPayQuery, PayQuery, afterSalesPayApplyPro } from '@/datas/afterSalesPay'
  36. const deviceStores = deviceStore()
  37. const state = reactive({
  38. orderNo: '',
  39. vehicleId: '',
  40. dataArray: [],
  41. isConnectDevice: false, // 是否连接设备
  42. deviceLogOutState: {
  43. cancelAgeLimit: 0, // 注销年限
  44. cancelAmount: 0, // 注销违约金 单位:分
  45. isBlack: false, // 是否存在黑名单
  46. isCancel: false, // 是否需要支付违约金
  47. productName: "" // 产品名称
  48. },
  49. flag: true,
  50. isclick: true,
  51. payOK: false
  52. })
  53. onLoad(({orderNo, vehicleId, isConnectDevice}) => {
  54. if (orderNo) {
  55. state.orderNo = orderNo
  56. state.vehicleId = decodeURIComponent(vehicleId)
  57. state.isConnectDevice = isConnectDevice === '1'
  58. getAfterSalesPayQueryHandle()
  59. }
  60. })
  61. const confirmPay = (val) => {
  62. if (state.isclick) {
  63. if (val.payStatus == "SUCCESS") {
  64. return;
  65. }
  66. state.isclick = false
  67. payMethods(val)
  68. }
  69. }
  70. // 支付
  71. const payMethods = (val) => {
  72. afterSalesPayApplyPro(val).then(() => {
  73. state.payOK = true
  74. getAfterSalesPayQueryHandle()
  75. }).catch(() => {
  76. state.isclick = true
  77. })
  78. }
  79. // 支付信息查询
  80. const getAfterSalesPayQueryHandle = () => {
  81. getAfterSalesPayQuery(state.orderNo).then((res: PayQuery) => {
  82. if (res.paymentStatus === 1) {
  83. // uni.navigateTo({
  84. // url: `/subpackage/after-sale/sign-info-change/sign?orderNo=${state.orderNo}`
  85. // })
  86. // uni.showToast({
  87. // title: ''
  88. // })
  89. if (state.isConnectDevice) { // 如果可以连接设备
  90. uni.navigateTo({
  91. url: `/pages/bluetooth/bluetooth?routeType=13&vehicleId=${state.vehicleId}`
  92. })
  93. } else {
  94. logOffOver()
  95. }
  96. }
  97. state.dataArray = res.datas
  98. })
  99. }
  100. const confirmLogOut = () => {
  101. }
  102. </script>
  103. <style lang="scss" scoped>
  104. .content-value{
  105. padding: 32rpx;
  106. }
  107. .ul-item {
  108. display: flex;
  109. align-items: center;
  110. &:nth-child(n+2) {
  111. margin-top: 30rpx;
  112. }
  113. .item-value {
  114. padding: 20rpx;
  115. position: absolute;
  116. display: flex;
  117. align-items: center;
  118. box-sizing: border-box;
  119. height: 146rpx;
  120. left: 50rpx;
  121. right: 50rpx;
  122. .money {
  123. color: #fff;
  124. font-size: 46rpx;
  125. font-family: SourceHanSansCN, SourceHanSansCN;
  126. font-weight: 400;
  127. flex: 1;
  128. .unit {
  129. font-size: 29rpx;
  130. margin-right: 2rpx;
  131. }
  132. }
  133. .content {
  134. margin-left: 60rpx;
  135. flex: 2;
  136. .title {
  137. font-weight: 400;
  138. font-family: SourceHanSansCN, SourceHanSansCN;
  139. font-size: 36rpx;
  140. color: #2C3246;
  141. }
  142. }
  143. .r-btn {
  144. width: 139rpx;
  145. height: 65rpx;
  146. background: radial-gradient(at 0% 0%, #C6B077 0%, #DFCC96 100%);
  147. border-radius: 33rpx;
  148. font-family: SourceHanSansCN, SourceHanSansCN;
  149. font-weight: 400;
  150. font-size: 26rpx;
  151. color: #FFFFFF;
  152. line-height: 65rpx;
  153. text-align: center;
  154. flex: 1;
  155. }
  156. }
  157. .icon-tip {
  158. width: 100rpx;
  159. height: 100rpx;
  160. }
  161. }
  162. </style>