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.

operation-upload.vue 6.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305
  1. <!-- 设备激活2-上传图片 -->
  2. <template>
  3. <view class="main" :style="{minHeight: height+'px'}">
  4. <view class="item-row">
  5. <view class="item-left">
  6. <view class="title">车身照</view>
  7. <view class="desc">汽车的45度车身照片</view>
  8. <view class="flag"><text>拍摄示例</text> </view>
  9. </view>
  10. <view class="item-right">
  11. <image :src="state.headstockImg ?state.headstockImg: defHeadstockImg"
  12. :data-url="state.headstockImg ?state.headstockImg: defHeadstockImg">
  13. </image>
  14. </view>
  15. </view>
  16. <view class="hint" style="margin-top: 40rpx;">
  17. <image :src="`${$imgUrl}common/icon-hint.png`" class="icon"></image>
  18. <view>请打开手机蓝牙后再进行下一步操作。</view>
  19. </view>
  20. <view class="hint">
  21. <image :src="`${$imgUrl}common/icon-hint.png`" class="icon"></image>
  22. <view>运营和服务规则中:车载单元(OBU),安装在车辆内部(风挡玻璃或仪表台上)。</view>
  23. </view>
  24. <view class="open-tips">
  25. <view class="tip-title">开启蓝牙</view>
  26. <view class="item-tips">
  27. <view class="item-title">方式一</view>
  28. <view class="item">
  29. <view class="point"></view>打开手机的【设置】菜单。
  30. </view>
  31. <view class="item">
  32. <view class="point"></view>在【设置】菜单中,找到【蓝牙】选项。
  33. </view>
  34. <view class="item">
  35. <view class="point"></view>点击【蓝牙】选项,然后打开蓝牙开关。
  36. </view>
  37. </view>
  38. <view class="item-tips">
  39. <view class="item-title">方式二</view>
  40. <view class="item">
  41. <view class="point"></view>下拉打开通知栏。
  42. </view>
  43. <view class="item">
  44. <view class="point"></view>然后打开蓝牙开关。
  45. </view>
  46. </view>
  47. </view>
  48. <view class="action">
  49. <button type="default" class="ui-btn" @click="gotoNextStep">
  50. 下一步
  51. </button>
  52. </view>
  53. </view>
  54. </template>
  55. <script setup>
  56. import {
  57. reactive
  58. } from "vue";
  59. import {
  60. msg,
  61. navTo,
  62. uploadFile
  63. } from '@/utils/utils';
  64. import {
  65. fileURL
  66. } from "@/datas/fileURL.js";
  67. import {
  68. getItem
  69. } from "@/utils/storage";
  70. const imgURL = `${fileURL}image/`;
  71. import {
  72. requestNew
  73. } from "@/utils/network/request.js";
  74. import {
  75. activeImgUpload,orderDetailQuery
  76. } from "@/utils/network/api.js";
  77. import {
  78. onLoad
  79. } from '@dcloudio/uni-app'
  80. const height = uni.getSystemInfoSync().windowHeight
  81. const defHeadstockImg = imgURL + "issuance/chetou.png";
  82. const state = reactive({
  83. headstockImg: null, //车头照
  84. id: null,
  85. orderId: null,
  86. openId: null,
  87. transfer: 0,
  88. isAfter: ''
  89. });
  90. onLoad((option) => {
  91. //读取传入 存储的数据orderInfo
  92. let orderData = getItem("orderInfo");
  93. state.orderId = orderData.orderId;
  94. state.openId = getItem("openId");
  95. state.transfer = option.transfer
  96. state.isAfter = option.isAfter
  97. console.log(state);
  98. if(option.transfer == '1' || !state.transfer) {
  99. getOrderDetails(orderData.orderId)
  100. }else{
  101. let vehicleData = getItem("currentActivateData");
  102. console.log("我的车辆信息:",vehicleData)
  103. state.headstockImg = vehicleData.vehBodyUrl
  104. }
  105. })
  106. //获取订单详情
  107. const getOrderDetails = (orderId) => {
  108. console.log('======获取订单信息======')
  109. const options = {
  110. type: 2,
  111. data: {
  112. orderNo:orderId
  113. },
  114. method: "POST",
  115. showLoading: false,
  116. };
  117. state.disabled = false
  118. requestNew(orderDetailQuery, options).then((res) => {
  119. console.log("orderInfo", res);
  120. state.headstockImg='https://qtzl.etcjz.cn/'+res['vehBodyUrl']
  121. });
  122. };
  123. //下一步
  124. const gotoNextStep = () => {
  125. uni.openBluetoothAdapter()
  126. /* 判断是否打开蓝牙 */
  127. uni.getBluetoothAdapterState({
  128. success(res) {
  129. //如果res.avaliable==false 说明没打开蓝牙 反之则打开
  130. if (res.available == false) {
  131. uni.showToast({
  132. title: '请打开手机蓝牙',
  133. icon: "error",
  134. duration: 2000
  135. })
  136. return
  137. } else {
  138. navTo(`/pages/bluetooth/bluetooth?routeType=1&transfer=${state.transfer}&isAfter=${state.isAfter}`)
  139. }
  140. }
  141. })
  142. }
  143. </script>
  144. <style>
  145. page {
  146. background: #F3F3F3;
  147. }
  148. </style>
  149. <style lang="scss" scoped>
  150. .main {
  151. background: #E9EDF0;
  152. padding-bottom:160rpx;
  153. position: relative;
  154. box-sizing: border-box;
  155. .action {
  156. position: absolute;
  157. bottom: 0rpx;
  158. left: 0;
  159. height: 128rpx;
  160. background-color: #fff;
  161. border-radius: 30rpx 30rpx 0 0;
  162. width: 100vw;
  163. display: flex;
  164. align-items: center;
  165. justify-content: center;
  166. flex-direction: column;
  167. }
  168. .item-row {
  169. width: 690rpx;
  170. height: 240rpx;
  171. margin: 30rpx auto 0;
  172. display: flex;
  173. justify-content: space-between;
  174. background: white;
  175. padding: 30rpx;
  176. border-radius: 20rpx;
  177. box-sizing: border-box;
  178. .item-left {
  179. .title {
  180. margin-top: 24rpx;
  181. font-size: 32rpx;
  182. color: #111;
  183. font-weight: bold;
  184. }
  185. .desc {
  186. font-size: 24rpx;
  187. color: #999;
  188. margin-top: 6rpx;
  189. }
  190. .flag {
  191. width: 100rpx;
  192. height: 30rpx;
  193. line-height: 30rpx;
  194. margin-top: 20rpx;
  195. border-radius: 5rpx;
  196. text-align: center;
  197. font-size: 20rpx;
  198. border: 1rpx solid #CCB375;
  199. font-family: SourceHanSansSC, SourceHanSansSC;
  200. color: #CCB375;
  201. }
  202. }
  203. .item-right {
  204. width: 288rpx;
  205. height: 174rpx;
  206. position: relative;
  207. image {
  208. position: relative;
  209. z-index: 10;
  210. width: 100%;
  211. height: 174rpx;
  212. }
  213. }
  214. .empty-node {
  215. position: absolute;
  216. z-index: 0;
  217. width: 100%;
  218. height: 100%;
  219. }
  220. }
  221. .hint {
  222. display: flex;
  223. flex-direction: row;
  224. justify-content: center;
  225. font-size: 28rpx;
  226. color: #545454;
  227. padding: 0px 30rpx;
  228. margin-top: 20rpx;
  229. align-items: center;
  230. .icon {
  231. width: 30rpx;
  232. height: 30rpx;
  233. margin-right: 10rpx;
  234. }
  235. view {
  236. width: calc(100% - 36rpx);
  237. }
  238. }
  239. .btn {
  240. margin: 60rpx 40rpx;
  241. }
  242. }
  243. .open-tips {
  244. width: 94%;
  245. margin: 20rpx auto;
  246. font-size: 30rpx;
  247. .tip-title {
  248. font-family: MicrosoftYaHei;
  249. font-size: 32rpx;
  250. color: #111111;
  251. line-height: 35px;
  252. }
  253. }
  254. .item-tips {
  255. margin-top: 10rpx;
  256. overflow: hidden;
  257. .item-title {
  258. font-family: MicrosoftYaHei;
  259. font-size: 28rpx;
  260. color: #111111;
  261. line-height: 35rpx;
  262. }
  263. .item {
  264. font-family: MicrosoftYaHei;
  265. font-size: 28rpx;
  266. color: #999999;
  267. line-height: 48rpx;
  268. display: flex;
  269. align-items: center;
  270. margin-top: 10rpx;
  271. .point {
  272. flex-shrink: 0;
  273. width: 10rpx;
  274. height: 10rpx;
  275. background: #A0A0A0;
  276. margin-right: 16rpx;
  277. border-radius: 50%;
  278. }
  279. }
  280. }
  281. </style>