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

select-car.vue 3.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152
  1. <template>
  2. <view class="selectCar-box">
  3. <view v-if="state.list.length > 0" @click="choose(item)" class="item" v-for="(item, i) in state.list" :key="i">
  4. <view class="iten-left">
  5. <image :src="`${$imgUrl}che.png`" mode="aspectFill"></image>
  6. <text>{{ item.vehiclePlate }}</text>
  7. </view>
  8. <view class="choose-item">
  9. <view class="active" v-if="flag == i"> </view>
  10. </view>
  11. </view>
  12. <view v-else class="flex"> 暂无车辆订单信息 </view>
  13. </view>
  14. </template>
  15. <script lang="ts" setup>
  16. import { reactive, ref } from "vue";
  17. import { navTo } from "@/utils/utils";
  18. import { onLoad } from "@dcloudio/uni-app";
  19. import { orderList } from "@/utils/network/api.js";
  20. import { request } from "@/utils/network/request.js";
  21. import { msg } from "@/utils/utils";
  22. import { getItem, StorageKeys } from "@/utils/storage";
  23. import { stringToJson } from "@/utils/network/encryption";
  24. const state = reactive({
  25. list: [],
  26. starts: false
  27. });
  28. onLoad(() => {
  29. quanCheckActionTrue().then((item : any) => {
  30. state.list = item.data;
  31. console.log(item);
  32. });
  33. });
  34. const quanCheckActionTrue = () => {
  35. let source = ""
  36. // #ifdef MP-ALIPAY
  37. source = "ALI"
  38. // #endif
  39. // #ifdef MP-WEIXIN
  40. source = "WECHAT"
  41. // #endif
  42. var data = {
  43. opId: getItem(StorageKeys.OpenId),
  44. source: source,
  45. tabIndex: "0",
  46. isValueCard: "",
  47. };
  48. const options = {
  49. type: 2,
  50. data: data,
  51. method: "POST",
  52. showLoading: true,
  53. };
  54. return new Promise(async (resolve, reject) => {
  55. const res = await request(orderList, options);
  56. const data = stringToJson(res.bizContent);
  57. resolve(data);
  58. }).catch((error) => {
  59. reject(error);
  60. });
  61. };
  62. const flag = ref("0");
  63. const choose = (item) => {
  64. console.log("item", item);
  65. // #ifdef MP-ALIPAY
  66. uni.navigateTo({
  67. url: `/subpackage/orders/sign-up-ali?orderId=${item.orderId}&&channelSing=1&&vehiclePlate=${item.vehiclePlate}`,
  68. });
  69. // #endif
  70. // #ifdef MP-WEIXIN
  71. uni.navigateTo({
  72. url: `/subpackage/orders/sign-up?orderId=${item.orderId}&&channelSing=1&&vehiclePlate=${item.vehiclePlate}`,
  73. });
  74. // #endif
  75. };
  76. </script>
  77. <style>
  78. page {
  79. width: 100%;
  80. height: 100%;
  81. background-color: #eef7f7;
  82. }
  83. </style>
  84. <style lang="scss" scoped>
  85. .flex {
  86. display: flex;
  87. justify-content: center;
  88. }
  89. .selectCar-box {
  90. // width: 100%;
  91. height: 100%;
  92. padding: 30rpx;
  93. .item {
  94. padding: 20rpx;
  95. display: flex;
  96. justify-content: space-between;
  97. align-items: center;
  98. height: 130rpx;
  99. background: #ffffff;
  100. box-shadow: 0rpx 2rpx 6rpx 0rpx rgba(223, 223, 223, 0.8);
  101. border-radius: 20rpx;
  102. margin-bottom: 30rpx;
  103. .iten-left {
  104. display: flex;
  105. align-items: center;
  106. image {
  107. width: 150rpx;
  108. height: 90rpx;
  109. }
  110. text {
  111. margin-left: 20rpx;
  112. font-size: 32rpx;
  113. font-family: Noto Sans S Chinese;
  114. font-weight: 400;
  115. color: #333333;
  116. }
  117. }
  118. .choose-item {
  119. width: 44rpx;
  120. height: 44rpx;
  121. background: #ffffff;
  122. border: 2rpx solid #00b38b;
  123. border-radius: 50%;
  124. margin-right: 20rpx;
  125. display: flex;
  126. justify-content: center;
  127. align-items: center;
  128. box-sizing: content-box;
  129. }
  130. .active {
  131. width: 34rpx;
  132. height: 34rpx;
  133. background: #00b38b;
  134. border-radius: 50%;
  135. }
  136. }
  137. }
  138. </style>