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.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300
  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. getOrderDetails(orderData.id)
  99. })
  100. //获取订单详情
  101. const getOrderDetails = (id) => {
  102. console.log('======获取订单信息======')
  103. const options = {
  104. type: 2,
  105. data: {
  106. id
  107. },
  108. method: "POST",
  109. showLoading: false,
  110. };
  111. state.disabled = false
  112. requestNew(orderDetailQuery, options).then((res) => {
  113. console.log("orderInfo", res.data);
  114. state.headstockImg=res.data['orderInfoExt']['vehBodyUrl']
  115. });
  116. };
  117. //下一步
  118. const gotoNextStep = () => {
  119. uni.openBluetoothAdapter()
  120. /* 判断是否打开蓝牙 */
  121. uni.getBluetoothAdapterState({
  122. success(res) {
  123. //如果res.avaliable==false 说明没打开蓝牙 反之则打开
  124. if (res.available == false) {
  125. uni.showToast({
  126. title: '请打开手机蓝牙',
  127. icon: "error",
  128. duration: 2000
  129. })
  130. return
  131. } else {
  132. navTo(`/pages/bluetooth/bluetooth?routeType=1&transfer=${state.transfer}&isAfter=${state.isAfter}`)
  133. }
  134. }
  135. })
  136. }
  137. </script>
  138. <style>
  139. page {
  140. background: #F3F3F3;
  141. }
  142. </style>
  143. <style lang="scss" scoped>
  144. .main {
  145. background: #E9EDF0;
  146. padding-bottom:160rpx;
  147. position: relative;
  148. box-sizing: border-box;
  149. .action {
  150. position: absolute;
  151. bottom: 0rpx;
  152. left: 0;
  153. height: 128rpx;
  154. background-color: #fff;
  155. border-radius: 30rpx 30rpx 0 0;
  156. width: 100vw;
  157. display: flex;
  158. align-items: center;
  159. justify-content: center;
  160. flex-direction: column;
  161. }
  162. .item-row {
  163. width: 690rpx;
  164. height: 240rpx;
  165. margin: 30rpx auto 0;
  166. display: flex;
  167. justify-content: space-between;
  168. background: white;
  169. padding: 30rpx;
  170. border-radius: 20rpx;
  171. box-sizing: border-box;
  172. .item-left {
  173. .title {
  174. margin-top: 24rpx;
  175. font-size: 32rpx;
  176. color: #111;
  177. font-weight: bold;
  178. }
  179. .desc {
  180. font-size: 24rpx;
  181. color: #999;
  182. margin-top: 6rpx;
  183. }
  184. .flag {
  185. width: 100rpx;
  186. height: 30rpx;
  187. line-height: 30rpx;
  188. margin-top: 20rpx;
  189. border-radius: 5rpx;
  190. text-align: center;
  191. font-size: 20rpx;
  192. border: 1rpx solid #CCB375;
  193. font-family: SourceHanSansSC, SourceHanSansSC;
  194. color: #CCB375;
  195. }
  196. }
  197. .item-right {
  198. width: 288rpx;
  199. height: 174rpx;
  200. position: relative;
  201. image {
  202. position: relative;
  203. z-index: 10;
  204. width: 100%;
  205. height: 174rpx;
  206. }
  207. }
  208. .empty-node {
  209. position: absolute;
  210. z-index: 0;
  211. width: 100%;
  212. height: 100%;
  213. }
  214. }
  215. .hint {
  216. display: flex;
  217. flex-direction: row;
  218. justify-content: center;
  219. font-size: 28rpx;
  220. color: #545454;
  221. padding: 0px 30rpx;
  222. margin-top: 20rpx;
  223. align-items: center;
  224. .icon {
  225. width: 30rpx;
  226. height: 30rpx;
  227. margin-right: 10rpx;
  228. }
  229. view {
  230. width: calc(100% - 36rpx);
  231. }
  232. }
  233. .btn {
  234. margin: 60rpx 40rpx;
  235. }
  236. }
  237. .open-tips {
  238. width: 94%;
  239. margin: 20rpx auto;
  240. font-size: 30rpx;
  241. .tip-title {
  242. font-family: MicrosoftYaHei;
  243. font-size: 32rpx;
  244. color: #111111;
  245. line-height: 35px;
  246. }
  247. }
  248. .item-tips {
  249. margin-top: 10rpx;
  250. overflow: hidden;
  251. .item-title {
  252. font-family: MicrosoftYaHei;
  253. font-size: 28rpx;
  254. color: #111111;
  255. line-height: 35rpx;
  256. }
  257. .item {
  258. font-family: MicrosoftYaHei;
  259. font-size: 28rpx;
  260. color: #999999;
  261. line-height: 48rpx;
  262. display: flex;
  263. align-items: center;
  264. margin-top: 10rpx;
  265. .point {
  266. flex-shrink: 0;
  267. width: 10rpx;
  268. height: 10rpx;
  269. background: #A0A0A0;
  270. margin-right: 16rpx;
  271. border-radius: 50%;
  272. }
  273. }
  274. }
  275. </style>