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.

select-car.vue 2.9KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160
  1. <template>
  2. <view class="selectCar-box">
  3. <view class="item" v-for="(item,i) in list" :key="i">
  4. <view class="iten-left">
  5. <image :src="`${$imgUrl}che.png`" mode=""></image>
  6. <text>{{item.name}}</text>
  7. </view>
  8. <view class="choose-item" @click="choose(i,item)">
  9. <view class="active" v-if="flag==i">
  10. </view>
  11. </view>
  12. </view>
  13. </view>
  14. </template>
  15. <script lang="ts" setup>
  16. import {
  17. reactive,
  18. ref
  19. } from "vue"
  20. import {
  21. navTo
  22. } from "@/utils/utils"
  23. import {
  24. onLoad,
  25. onShow
  26. } from "@dcloudio/uni-app";
  27. import {
  28. orderList
  29. } from "@/utils/network/api.js";
  30. import {
  31. request
  32. } from "@/utils/network/request.js";
  33. import {
  34. msg
  35. } from "@/utils/utils";
  36. import {
  37. getItem,
  38. StorageKeys,
  39. setItem
  40. } from "@/utils/storage";
  41. import {
  42. stringToJson
  43. } from "@/utils/network/encryption";
  44. onLoad(() => {
  45. quanCheckActionTrue().then(item => {
  46. console.log(item)
  47. })
  48. });
  49. const quanCheckActionTrue = () => {
  50. var data = {
  51. opId: '',
  52. source: 'WECHAT',
  53. tabIndex: '0',
  54. orderStep: '11',
  55. isValueCard: '2'
  56. };
  57. const options = {
  58. type: 2,
  59. data: data,
  60. method: "POST",
  61. showLoading: true,
  62. };
  63. return new Promise(async (resolve, reject) => {
  64. const res = await request(orderList, options);
  65. const data = stringToJson(res.bizContent);
  66. resolve(data);
  67. }).catch((error) => {
  68. reject(error);
  69. });
  70. }
  71. const list = reactive([{
  72. name: "A12345"
  73. },
  74. {
  75. name: "B12345"
  76. },
  77. {
  78. name: "C12345"
  79. },
  80. ])
  81. const flag = ref('0')
  82. const choose = (i, item) => {
  83. flag.value = i
  84. console.log("选择得数据", item);
  85. navTo('/after-sale/card-loss-reporting/cardloss-confirm')
  86. }
  87. </script>
  88. <style>
  89. page {
  90. width: 100%;
  91. height: 100%;
  92. background-color: #EEF7F7;
  93. }
  94. </style>
  95. <style lang="scss" scoped>
  96. .selectCar-box {
  97. // width: 100%;
  98. height: 100%;
  99. padding: 30rpx;
  100. .item {
  101. padding: 20rpx;
  102. display: flex;
  103. justify-content: space-between;
  104. align-items: center;
  105. height: 130rpx;
  106. background: #FFFFFF;
  107. box-shadow: 0rpx 2rpx 6rpx 0rpx rgba(223, 223, 223, 0.8);
  108. border-radius: 20rpx;
  109. margin-bottom: 30rpx;
  110. .iten-left {
  111. display: flex;
  112. align-items: center;
  113. image {
  114. width: 150rpx;
  115. height: 90rpx;
  116. }
  117. text {
  118. margin-left: 20rpx;
  119. font-size: 32rpx;
  120. font-family: Noto Sans S Chinese;
  121. font-weight: 400;
  122. color: #333333;
  123. }
  124. }
  125. .choose-item {
  126. width: 44rpx;
  127. height: 44rpx;
  128. background: #FFFFFF;
  129. border: 2rpx solid #00B38B;
  130. border-radius: 50%;
  131. margin-right: 20rpx;
  132. display: flex;
  133. justify-content: center;
  134. align-items: center;
  135. box-sizing: content-box;
  136. }
  137. .active {
  138. width: 34rpx;
  139. height: 34rpx;
  140. background: #00B38B;
  141. border-radius: 50%;
  142. }
  143. }
  144. }
  145. </style>