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

operation-upload.vue 6.6KB

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