Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

select-car.vue 4.5KB

il y a 2 ans
il y a 2 ans
il y a 2 ans
il y a 2 ans
il y a 2 ans
il y a 1 an
il y a 1 an
il y a 1 an
il y a 1 an
il y a 2 ans
il y a 1 an
il y a 1 an
il y a 2 ans
il y a 1 an
il y a 2 ans
il y a 1 an
il y a 2 ans
il y a 2 ans
il y a 1 an
il y a 2 ans
il y a 2 ans
il y a 2 ans
il y a 2 ans
il y a 2 ans
il y a 2 ans
il y a 2 ans
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228
  1. <template>
  2. <view class="selectCar-box">
  3. <view v-if="state.list.length>0" @click="choose(i,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">
  10. </view>
  11. </view>
  12. </view>
  13. <view v-else class="flex">
  14. 暂无车辆订单信息
  15. </view>
  16. </view>
  17. </template>
  18. <script lang="ts" setup>
  19. import {
  20. reactive,
  21. ref
  22. } from "vue"
  23. import {
  24. navTo, msg
  25. } from "@/utils/utils"
  26. import {
  27. onLoad,
  28. onShow
  29. } from "@dcloudio/uni-app";
  30. import {
  31. orderList,
  32. workOrderList,
  33. userInfoQuery,
  34. searchVehicleInfo
  35. } from "@/utils/network/api.js";
  36. import {
  37. request
  38. } from "@/utils/network/request.js";
  39. import {
  40. getItem,
  41. StorageKeys,
  42. setItem
  43. } from "@/utils/storage";
  44. import {
  45. stringToJson
  46. } from "@/utils/network/encryption";
  47. const state = reactive({
  48. list: [],
  49. businessType: "",
  50. customerId: "",
  51. vehiclePlate: "",
  52. vehiclePlateColor: ""
  53. });
  54. onLoad(() => {
  55. state.businessType = getItem('key')['DASP_PUSH_TYPE'][0]['code']
  56. quanCheckActionTrue().then((item : any) => {
  57. state.list = item.data
  58. console.log(item)
  59. })
  60. });
  61. const searchVehicleInfoQuery = (vehicleId) => {
  62. const options = {
  63. type: 2,
  64. data: {
  65. vehicleId: vehicleId
  66. },
  67. method: "POST",
  68. showLoading: true,
  69. };
  70. return new Promise(async (resolve, reject) => {
  71. const res = await request(searchVehicleInfo, options);
  72. const data = stringToJson(res.bizContent);
  73. resolve(data);
  74. }).catch((error) => {
  75. reject(error);
  76. });
  77. }
  78. const quanCheckActionTrue = () => {
  79. let source = ""
  80. // #ifdef MP-ALIPAY
  81. source = "ALI"
  82. // #endif
  83. // #ifdef MP-WEIXIN
  84. source = "WECHAT"
  85. // #endif
  86. var data = {
  87. opId: getItem(StorageKeys.OpenId),
  88. source: source,
  89. tabIndex: '0',
  90. orderStep: '11',
  91. isValueCard: '',
  92. orderStatus: "1",
  93. isAfter: true,
  94. };
  95. const options = {
  96. type: 2,
  97. data: data,
  98. method: "POST",
  99. showLoading: true,
  100. };
  101. return new Promise(async (resolve, reject) => {
  102. const res = await request(orderList, options);
  103. const data = stringToJson(res.bizContent);
  104. resolve(data);
  105. }).catch((error) => {
  106. reject(error);
  107. });
  108. }
  109. const flag = ref('0')
  110. const choose = (i, item) => {
  111. let id = item.id
  112. searchVehicleInfoQuery(item.vehicleId).then((item : any) => {
  113. console.log("====", item.vehicles[0])
  114. state.customerId = item.vehicles[0]['customerId']
  115. state.vehiclePlate = item.vehicles[0]['vehiclePlate']
  116. state.vehiclePlateColor = item.vehicles[0]['vehiclePlateColor']
  117. isWorkOrder().then((item : any) => {
  118. console.log("查询是否有工单", item)
  119. if (item.data) {
  120. if (item.data[0]['status'] == '0') {
  121. navTo(`/subpackage/after-sale/equipment-upgrade/upgrade-confirm?id=${id}&workId=${item.data[0]['id']}`)
  122. }
  123. } else {
  124. msg('暂无工单')
  125. }
  126. })
  127. })
  128. }
  129. const isWorkOrder = () => {
  130. var data = {
  131. vehiclePlate: state.vehiclePlate,
  132. vehiclePlateColor: state.vehiclePlateColor,
  133. customerId: state.customerId,
  134. };
  135. const options = {
  136. type: 2,
  137. data: data,
  138. method: "POST",
  139. showLoading: true,
  140. };
  141. return new Promise(async (resolve, reject) => {
  142. const res = await request(workOrderList, options);
  143. const data = stringToJson(res.bizContent);
  144. resolve(data);
  145. }).catch((error) => {
  146. reject(error);
  147. });
  148. }
  149. </script>
  150. <style>
  151. page {
  152. width: 100%;
  153. height: 100%;
  154. background-color: #EEF7F7;
  155. }
  156. </style>
  157. <style lang="scss" scoped>
  158. .flex {
  159. display: flex;
  160. justify-content: center;
  161. }
  162. .selectCar-box {
  163. // width: 100%;
  164. height: 100%;
  165. padding: 30rpx;
  166. .item {
  167. padding: 20rpx;
  168. display: flex;
  169. justify-content: space-between;
  170. align-items: center;
  171. height: 130rpx;
  172. background: #FFFFFF;
  173. box-shadow: 0rpx 2rpx 6rpx 0rpx rgba(223, 223, 223, 0.8);
  174. border-radius: 20rpx;
  175. margin-bottom: 30rpx;
  176. .iten-left {
  177. display: flex;
  178. align-items: center;
  179. image {
  180. width: 150rpx;
  181. height: 90rpx;
  182. }
  183. text {
  184. margin-left: 20rpx;
  185. font-size: 32rpx;
  186. font-family: Noto Sans S Chinese;
  187. font-weight: 400;
  188. color: #333333;
  189. }
  190. }
  191. .choose-item {
  192. width: 44rpx;
  193. height: 44rpx;
  194. background: #FFFFFF;
  195. border: 2rpx solid #00B38B;
  196. border-radius: 50%;
  197. margin-right: 20rpx;
  198. display: flex;
  199. justify-content: center;
  200. align-items: center;
  201. box-sizing: content-box;
  202. }
  203. .active {
  204. width: 34rpx;
  205. height: 34rpx;
  206. background: #00B38B;
  207. border-radius: 50%;
  208. }
  209. }
  210. }
  211. </style>