選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

operation-upload.vue 5.1KB

11ヶ月前
1年前
1年前
1年前
1年前
1年前
1年前
1年前
1年前
1年前
1年前
1年前
1年前
1年前
1年前
1年前
1年前
1年前
1年前
1年前
1年前
1年前
1年前
1年前
1年前
1年前
1年前
1年前
1年前
1年前
1年前
1年前
1年前
1年前
1年前
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238
  1. <!-- 设备激活2-上传图片 -->
  2. <template>
  3. <view class="main" :style="{height: 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" @click="chooseImage(1)">
  11. <view class="empty-node"></view>
  12. <image :src="state.headstockImg ?state.headstockImg: defHeadstockImg"
  13. :data-url="state.headstockImg ?state.headstockImg: defHeadstockImg"></image>
  14. </view>
  15. </view>
  16. <view class="item-row">
  17. <view class="item-left">
  18. <view class="title">安装照</view>
  19. <view class="desc">上传安装照片</view>
  20. <view class="flag"><text>拍摄示例</text> </view>
  21. </view>
  22. <view class="item-right" @click="chooseImage(2)">
  23. <view class="empty-node"></view>
  24. <image :src="state.installImg ?state.installImg: defInstallImg"></image>
  25. </view>
  26. </view>
  27. <view class="hint">
  28. <image :src="`${$imgUrl}common/icon-hint.png`" class="icon"></image>
  29. <view>请打开手机蓝牙后再进行下一步操作。</view>
  30. </view>
  31. <view class="btn">
  32. <submit-button @submit="gotoNextStep" title="下一步"></submit-button>
  33. </view>
  34. </view>
  35. </template>
  36. <script lang="ts" setup>
  37. import { reactive } from "vue";
  38. import { msg, navTo } from '@/utils/utils';
  39. import { fileURL } from "@/datas/fileURL.js";
  40. const imgURL = `${fileURL}image/`;
  41. const height = uni.getSystemInfoSync().windowHeight
  42. const defHeadstockImg = imgURL + "bluetooth/device-active-img1.png";
  43. const defInstallImg = imgURL + "bluetooth/device-active-img2.png";
  44. const state = reactive({
  45. headstockImg: null, //车头照
  46. installImg: null //安装照
  47. });
  48. //选择图片
  49. const chooseImage = (type : number) => {
  50. uni.chooseImage({
  51. count: 1,
  52. sizeType: ['original', 'compressed'], //可以指定是原图还是压缩图,默认二者都有
  53. success: function (res) {
  54. console.log(res.tempFilePaths);
  55. if (type === 1) {//车头照
  56. state.headstockImg = res.tempFilePaths[0];
  57. } else {//安装照
  58. state.installImg = res.tempFilePaths[0];
  59. }
  60. }
  61. });
  62. }
  63. //下一步
  64. const gotoNextStep = () => {
  65. if (!state.headstockImg || !state.installImg) {
  66. msg('请按照要求上传图片!');
  67. return;
  68. }
  69. uni.openBluetoothAdapter()
  70. /* 判断是否打开蓝牙 */
  71. uni.getBluetoothAdapterState({
  72. success(res) {
  73. //如果res.avaliable==false 说明没打开蓝牙 反之则打开
  74. if (res.available == false) {
  75. uni.showToast({
  76. title: '请打开手机蓝牙',
  77. icon: "error",
  78. duration: 2000
  79. })
  80. return
  81. } else {
  82. navTo('/pages/bluetooth/bluetooth?routeType=1')
  83. }
  84. }
  85. })
  86. }
  87. </script>
  88. <style>
  89. page {
  90. background: #F3F3F3;
  91. }
  92. </style>
  93. <style lang="scss" scoped>
  94. .main {
  95. overflow: hidden;
  96. .item-row {
  97. width: calc(100% - 60rpx);
  98. margin-left: 30rpx;
  99. display: flex;
  100. justify-content: space-between;
  101. margin-top: 30rpx;
  102. background: white;
  103. padding: 30rpx;
  104. border-radius: 20rpx;
  105. box-shadow: 0rpx 4rpx 13rpx 3rpx rgba(223, 223, 223, 0.8);
  106. .item-left {
  107. .title {
  108. font-size: 34rpx;
  109. color: #333;
  110. font-weight: bold;
  111. }
  112. .desc {
  113. font-size: 24rpx;
  114. color: #999;
  115. margin: 10rpx 0;
  116. }
  117. .flag {
  118. width: 110rpx;
  119. height: 45rpx;
  120. line-height: 42rpx;
  121. color: #0A8F8A;
  122. margin-top: 16rpx;
  123. border-radius: 6rpx;
  124. text-align: center;
  125. font-size: 20rpx;
  126. background: #D9F8F1;
  127. }
  128. }
  129. .item-right {
  130. width: 295rpx;
  131. height: 188rpx;
  132. position: relative;
  133. image {
  134. position: relative;
  135. z-index: 10;
  136. width: 100%;
  137. height: 188rpx;
  138. }
  139. &::before {
  140. content: '';
  141. position: absolute;
  142. width: 22rpx;
  143. height: 22rpx;
  144. border: 4rpx solid #21BEB1;
  145. border-bottom: none;
  146. border-right: none;
  147. z-index: 0;
  148. left: -4rpx;
  149. top: -4rpx;
  150. }
  151. &::after {
  152. content: '';
  153. position: absolute;
  154. width: 22rpx;
  155. height: 22rpx;
  156. border: 4rpx solid #21BEB1;
  157. border-top: none;
  158. border-right: none;
  159. z-index: 0;
  160. left: -4rpx;
  161. bottom: -4rpx;
  162. }
  163. }
  164. .empty-node {
  165. position: absolute;
  166. z-index: 0;
  167. width: 100%;
  168. height: 100%;
  169. &::before {
  170. content: '';
  171. position: absolute;
  172. width: 22rpx;
  173. height: 22rpx;
  174. border: 4rpx solid #21BEB1;
  175. border-left: none;
  176. border-bottom: none;
  177. z-index: 0;
  178. right: -4rpx;
  179. top: -4rpx;
  180. }
  181. &::after {
  182. content: '';
  183. position: absolute;
  184. width: 22rpx;
  185. height: 22rpx;
  186. border: 4rpx solid #21BEB1;
  187. border-top: none;
  188. border-left: none;
  189. z-index: 0;
  190. right: -4rpx;
  191. bottom: -4rpx;
  192. }
  193. }
  194. }
  195. .hint {
  196. display: flex;
  197. flex-direction: row;
  198. justify-content: center;
  199. font-size: 26rpx;
  200. color: #666666;
  201. padding: 0px 30rpx;
  202. margin-top: 60rpx;
  203. .icon {
  204. width: 36rpx;
  205. height: 36rpx;
  206. margin-right: 10rpx;
  207. }
  208. view {
  209. width: calc(100% - 36rpx);
  210. }
  211. }
  212. .btn {
  213. margin: 60rpx 40rpx;
  214. }
  215. }
  216. </style>