您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

breach_contract_pay.vue 4.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185
  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, onShow } 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. onShow(() => {
  62. if (state.payOK) {
  63. getAfterSalesPayQueryHandle()
  64. }
  65. })
  66. const confirmPay = (val) => {
  67. if (state.isclick) {
  68. if (val.payStatus == "SUCCESS") {
  69. return;
  70. }
  71. state.isclick = false
  72. payMethods(val)
  73. }
  74. }
  75. // 支付
  76. const payMethods = (val) => {
  77. afterSalesPayApplyPro(val).then(() => {
  78. state.payOK = true
  79. getAfterSalesPayQueryHandle()
  80. }).catch(() => {
  81. state.isclick = true
  82. })
  83. }
  84. // 支付信息查询
  85. const getAfterSalesPayQueryHandle = () => {
  86. getAfterSalesPayQuery(state.orderNo).then((res: PayQuery) => {
  87. state.dataArray = res.datas
  88. if (res.paymentStatus === 1) {
  89. // uni.navigateTo({
  90. // url: `/subpackage/after-sale/sign-info-change/sign?orderNo=${state.orderNo}`
  91. // })
  92. // uni.showToast({
  93. // title: ''
  94. // })
  95. if (state.isConnectDevice) { // 如果可以连接设备
  96. uni.navigateTo({
  97. url: `/pages/bluetooth/bluetooth?routeType=13&vehicleId=${state.vehicleId}`
  98. })
  99. } else {
  100. logOffOver()
  101. }
  102. }
  103. })
  104. }
  105. const confirmLogOut = () => {
  106. }
  107. </script>
  108. <style lang="scss" scoped>
  109. .content-value{
  110. padding: 32rpx;
  111. }
  112. .ul-item {
  113. display: flex;
  114. align-items: center;
  115. &:nth-child(n+2) {
  116. margin-top: 30rpx;
  117. }
  118. .item-value {
  119. padding: 20rpx;
  120. position: absolute;
  121. display: flex;
  122. align-items: center;
  123. box-sizing: border-box;
  124. height: 146rpx;
  125. left: 50rpx;
  126. right: 50rpx;
  127. .money {
  128. color: #fff;
  129. font-size: 46rpx;
  130. font-family: SourceHanSansCN, SourceHanSansCN;
  131. font-weight: 400;
  132. flex: 1;
  133. .unit {
  134. font-size: 29rpx;
  135. margin-right: 2rpx;
  136. }
  137. }
  138. .content {
  139. margin-left: 60rpx;
  140. flex: 2;
  141. .title {
  142. font-weight: 400;
  143. font-family: SourceHanSansCN, SourceHanSansCN;
  144. font-size: 36rpx;
  145. color: #2C3246;
  146. }
  147. }
  148. .r-btn {
  149. width: 139rpx;
  150. height: 65rpx;
  151. background: radial-gradient(at 0% 0%, #C6B077 0%, #DFCC96 100%);
  152. border-radius: 33rpx;
  153. font-family: SourceHanSansCN, SourceHanSansCN;
  154. font-weight: 400;
  155. font-size: 26rpx;
  156. color: #FFFFFF;
  157. line-height: 65rpx;
  158. text-align: center;
  159. flex: 1;
  160. }
  161. }
  162. .icon-tip {
  163. width: 100rpx;
  164. height: 100rpx;
  165. }
  166. }
  167. </style>