bluetooth.vue 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723
  1. <template>
  2. <view>
  3. <page-head :title="title"></page-head>
  4. <view class="uni-padding-wrap uni-common-mt">
  5. <view>
  6. 本蓝牙协议只支持低功耗蓝牙协议ble。如果想连接非ble蓝牙设备,请在社区搜索 Native.js 蓝牙。
  7. </view>
  8. <view class="uni-btn-v">
  9. <button type="primary" :disabled="disabled[0]" @click="openBluetoothAdapter">
  10. 初始化蓝牙模块
  11. </button>
  12. <view v-if="!adapterState.available">
  13. {{ '蓝牙适配器不可用,请初始化蓝牙模块' }}
  14. </view>
  15. <button
  16. type="primary"
  17. :loading="searchLoad"
  18. :disabled="disabled[1]"
  19. @click="startBluetoothDevicesDiscovery"
  20. >
  21. 开始搜索蓝牙设备
  22. </button>
  23. <button
  24. type="primary"
  25. :disabled="disabled[2]"
  26. @click="stopBluetoothDevicesDiscovery(false)"
  27. >
  28. 停止搜索蓝牙设备
  29. </button>
  30. <button
  31. type="primary"
  32. :loading="newDeviceLoad"
  33. :disabled="disabled[3]"
  34. @click="queryDevices"
  35. >
  36. 选择设备
  37. </button>
  38. <view v-if="equipment.length > 0">
  39. {{
  40. (connected ? '已连接设备' : '已选择设备') +
  41. ' : ' +
  42. equipment[0].name +
  43. ' (' +
  44. equipment[0].deviceId +
  45. ')'
  46. }}
  47. </view>
  48. <button type="primary" :disabled="disabled[4]" @click="createBLEConnection">
  49. 连接蓝牙设备
  50. </button>
  51. <button type="primary" :disabled="disabled[5]" @click="getBLEDeviceServices">
  52. 选择设备服务
  53. </button>
  54. <view v-if="servicesData.length > 0">已选服务uuid:{{ servicesData[0].uuid }}</view>
  55. <button type="primary" :disabled="disabled[6]" @click="getBLEDeviceCharacteristics">
  56. 获取服务的特征值
  57. </button>
  58. <view v-if="characteristicsData.length > 0">
  59. <view class="uni-list_name">uuid:{{ characteristicsData[0].uuid }}</view>
  60. <view class="uni-list_item">
  61. 是否支持 read 操作:{{ characteristicsData[0].properties.read }}
  62. </view>
  63. <view class="uni-list_item">
  64. 是否支持 write 操作:{{ characteristicsData[0].properties.write }}
  65. </view>
  66. <view class="uni-list_item">
  67. 是否支持 notify 操作:{{ characteristicsData[0].properties.notify }}
  68. </view>
  69. <view class="uni-list_item">
  70. 是否支持 indicate 操作:{{ characteristicsData[0].properties.indicate }}
  71. </view>
  72. </view>
  73. <!-- <button type="primary" :disabled="disabled[7]" @click="readBLECharacteristicValue">
  74. 读取特征值数据
  75. </button>
  76. <view v-if="valueChangeData.serviceId">
  77. <view class="list-name">
  78. 特征值最新的值:{{ valueChangeData.value || '还没有最新值' }}
  79. </view>
  80. </view> -->
  81. <!-- <button type="primary" :disabled="disabled[8]" @click="w">写入特征值数据</button> -->
  82. <button type="primary" :disabled="disabled[9]" @click="closeBLEConnection">
  83. 断开蓝牙设备
  84. </button>
  85. <button type="primary" :disabled="disabled[10]" @click="closeBluetoothAdapter">
  86. 关闭蓝牙模块
  87. </button>
  88. </view>
  89. </view>
  90. <!-- 遮罩 -->
  91. <view v-if="maskShow" class="uni-mask" @touchmove.stop.prevent="moveHandle" @click="maskclose">
  92. <scroll-view class="uni-scroll_box" scroll-y @touchmove.stop.prevent="moveHandle" @click.stop="moveHandle">
  93. <view class="uni-title">
  94. 已经发现{{ list.length }}{{ showMaskType === 'device' ? '台设备' : '个服务' }}:
  95. </view>
  96. <view
  97. class="uni-list-box"
  98. v-for="(item, index) in list"
  99. :key="index"
  100. @click="tapQuery(item)"
  101. >
  102. <view v-if="showMaskType === 'device'">
  103. <view class="uni-list_name">{{ item.name || item.localName }}</view>
  104. <view class="uni-list_item">信号强度:{{ item.RSSI }}dBm</view>
  105. <view class="uni-list_item">UUID:{{ item.deviceId }}</view>
  106. <!-- <view class="list-item" v-if="showMaskType === 'device'">
  107. Service数量:{{ item.advertisServiceUUIDs.length }}
  108. </view> -->
  109. </view>
  110. <view v-if="showMaskType === 'service'">
  111. <view class="uni-list_item" style="line-height:2.2;">
  112. UUID: {{ item.uuid }}
  113. <text v-if="showMaskType === 'service'">
  114. {{ item.isPrimary ? '(主服务)' : '' }}
  115. </text>
  116. </view>
  117. </view>
  118. <view v-if="showMaskType === 'characteristics'">
  119. <view class="uni-list_name">uuid:{{ item.uuid }}</view>
  120. <view class="uni-list_item">是否支持 read 操作:{{ item.properties.read }}</view>
  121. <view class="uni-list_item">
  122. 是否支持 write 操作:{{ item.properties.write }}
  123. </view>
  124. <view class="uni-list_item">
  125. 是否支持 notify 操作:{{ item.properties.notify }}
  126. </view>
  127. <view class="uni-list_item">
  128. 是否支持 indicate 操作:{{ item.properties.indicate }}
  129. </view>
  130. </view>
  131. </view>
  132. </scroll-view>
  133. </view>
  134. </view>
  135. </template>
  136. <script>
  137. export default {
  138. data() {
  139. return {
  140. title: 'bluetooth',
  141. disabled: [false, true, true, true, true, true, true, true, true, true, true],
  142. newDeviceLoad: false,
  143. searchLoad: false,
  144. maskShow: false,
  145. equipment: [],
  146. adapterState: {
  147. discovering: false,
  148. available: false
  149. },
  150. connected: false,
  151. showMaskType: 'device',
  152. servicesData: [],
  153. characteristicsData: [],
  154. valueChangeData: {},
  155. isStop:true ,
  156. list: []
  157. };
  158. },
  159. onLoad() {
  160. this.onBLEConnectionStateChange();
  161. },
  162. methods: {
  163. moveHandle() {},
  164. /**
  165. * 关闭遮罩
  166. */
  167. maskclose(){
  168. this.maskShow = false;
  169. },
  170. /**
  171. * 选择设备
  172. */
  173. queryDevices() {
  174. // this.newDeviceLoad = true;
  175. this.showMaskType = 'device';
  176. this.maskShow = true;
  177. },
  178. tapQuery(item) {
  179. if (this.showMaskType === 'device') {
  180. this.$set(this.disabled, 4, false);
  181. if (this.equipment.length > 0) {
  182. this.equipment[0] = item;
  183. } else {
  184. this.equipment.push(item);
  185. }
  186. this.newDeviceLoad = false;
  187. }
  188. if (this.showMaskType === 'service') {
  189. this.$set(this.disabled, 6, false);
  190. if (this.servicesData.length > 0) {
  191. this.servicesData[0] = item;
  192. } else {
  193. this.servicesData.push(item);
  194. }
  195. }
  196. if (this.showMaskType === 'characteristics') {
  197. this.$set(this.disabled, 7, false);
  198. if (this.characteristicsData.length > 0) {
  199. this.characteristicsData[0] = item;
  200. } else {
  201. this.characteristicsData.push(item);
  202. }
  203. }
  204. this.maskShow = false;
  205. },
  206. /**
  207. * 初始化蓝牙设备
  208. */
  209. openBluetoothAdapter() {
  210. uni.openBluetoothAdapter({
  211. success: e => {
  212. console.log('初始化蓝牙成功:' + e.errMsg);
  213. console.log(JSON.stringify(e));
  214. this.isStop = false ;
  215. this.$set(this.disabled, 0, true);
  216. this.$set(this.disabled, 1, false);
  217. this.$set(this.disabled, 10, false);
  218. this.getBluetoothAdapterState();
  219. },
  220. fail: e => {
  221. console.log(e)
  222. console.log('初始化蓝牙失败,错误码:' + (e.errCode || e.errMsg));
  223. if (e.errCode !== 0) {
  224. initTypes(e.errCode,e.errMsg);
  225. }
  226. }
  227. });
  228. },
  229. /**
  230. * 开始搜索蓝牙设备
  231. */
  232. startBluetoothDevicesDiscovery() {
  233. uni.startBluetoothDevicesDiscovery({
  234. success: e => {
  235. console.log('开始搜索蓝牙设备:' + e.errMsg);
  236. this.searchLoad = true;
  237. this.$set(this.disabled, 1, true);
  238. this.$set(this.disabled, 2, false);
  239. this.$set(this.disabled, 3, false);
  240. this.onBluetoothDeviceFound();
  241. },
  242. fail: e => {
  243. console.log('搜索蓝牙设备失败,错误码:' + e.errCode);
  244. if (e.errCode !== 0) {
  245. initTypes(e.errCode);
  246. }
  247. }
  248. });
  249. },
  250. /**
  251. * 停止搜索蓝牙设备
  252. */
  253. stopBluetoothDevicesDiscovery(types) {
  254. uni.stopBluetoothDevicesDiscovery({
  255. success: e => {
  256. console.log('停止搜索蓝牙设备:' + e.errMsg);
  257. if (types) {
  258. this.$set(this.disabled, 1, true);
  259. } else {
  260. this.$set(this.disabled, 1, false);
  261. }
  262. this.$set(this.disabled, 2, true);
  263. // this.$set(this.disabled, 3, true);
  264. this.searchLoad = false;
  265. },
  266. fail: e => {
  267. console.log('停止搜索蓝牙设备失败,错误码:' + e.errCode);
  268. if (e.errCode !== 0) {
  269. initTypes(e.errCode);
  270. }
  271. }
  272. });
  273. },
  274. /**
  275. * 发现外围设备
  276. */
  277. onBluetoothDeviceFound() {
  278. uni.onBluetoothDeviceFound(devices => {
  279. console.log('开始监听寻找到新设备的事件');
  280. // this.$set(this.disabled, 3, false);
  281. this.getBluetoothDevices();
  282. });
  283. },
  284. /**
  285. * 获取在蓝牙模块生效期间所有已发现的蓝牙设备。包括已经和本机处于连接状态的设备。
  286. */
  287. getBluetoothDevices() {
  288. uni.getBluetoothDevices({
  289. success: res => {
  290. this.newDeviceLoad = false;
  291. console.log('获取蓝牙设备成功:' + res.errMsg);
  292. // console.log(JSON.stringify(res))
  293. this.list = res.devices;
  294. },
  295. fail: e => {
  296. console.log('获取蓝牙设备错误,错误码:' + e.errCode);
  297. if (e.errCode !== 0) {
  298. initTypes(e.errCode);
  299. }
  300. }
  301. });
  302. },
  303. /**
  304. * 获取本机蓝牙适配器状态
  305. */
  306. getBluetoothAdapterState() {
  307. console.log('--->');
  308. uni.getBluetoothAdapterState({
  309. success: res => {
  310. console.log(JSON.stringify(res));
  311. this.adapterState = res;
  312. },
  313. fail: e => {
  314. console.log('获取本机蓝牙适配器状态失败,错误码:' + e.errCode);
  315. if (e.errCode !== 0) {
  316. initTypes(e.errCode);
  317. }
  318. }
  319. });
  320. },
  321. /**
  322. * 连接低功耗蓝牙
  323. */
  324. createBLEConnection() {
  325. let deviceId = this.equipment[0].deviceId;
  326. uni.showToast({
  327. title: '连接蓝牙...',
  328. icon: 'loading',
  329. duration: 99999
  330. });
  331. uni.createBLEConnection({
  332. // 这里的 deviceId 需要已经通过 createBLEConnection 与对应设备建立链接
  333. deviceId,
  334. success: res => {
  335. console.log(res);
  336. console.log('连接蓝牙成功:' + res.errMsg);
  337. // 连接设备后断开搜索 并且不能搜索设备
  338. this.stopBluetoothDevicesDiscovery(true);
  339. uni.hideToast();
  340. uni.showToast({
  341. title: '连接成功',
  342. icon: 'success',
  343. duration: 2000
  344. });
  345. this.$set(this.disabled, 3, true);
  346. this.$set(this.disabled, 4, true);
  347. this.$set(this.disabled, 5, false);
  348. this.$set(this.disabled, 9, false);
  349. this.connected = true;
  350. },
  351. fail: e => {
  352. console.log('连接低功耗蓝牙失败,错误码:' + e.errCode);
  353. if (e.errCode !== 0) {
  354. initTypes(e.errCode);
  355. }
  356. }
  357. });
  358. },
  359. /**
  360. * 断开与低功耗蓝牙设备的连接
  361. */
  362. closeBLEConnection() {
  363. let deviceId = this.equipment[0].deviceId;
  364. uni.closeBLEConnection({
  365. deviceId,
  366. success: res => {
  367. console.log(res);
  368. console.log('断开低功耗蓝牙成功:' + res.errMsg);
  369. this.$set(this.disabled, 1, false);
  370. this.$set(this.disabled, 3, true);
  371. this.$set(this.disabled, 4, true);
  372. this.$set(this.disabled, 5, true);
  373. this.$set(this.disabled, 6, true);
  374. this.$set(this.disabled, 7, true);
  375. this.$set(this.disabled, 8, true);
  376. this.$set(this.disabled, 9, true);
  377. this.equipment = [];
  378. this.servicesData = [];
  379. this.characteristicsData = [];
  380. },
  381. fail: e => {
  382. console.log('断开低功耗蓝牙成功,错误码:' + e.errCode);
  383. if (e.errCode !== 0) {
  384. initTypes(e.errCode);
  385. }
  386. }
  387. });
  388. },
  389. /**
  390. * 获取所有服务
  391. */
  392. getBLEDeviceServices() {
  393. let deviceId = this.equipment[0].deviceId;
  394. console.log('获取所有服务的 uuid:' + deviceId);
  395. uni.getBLEDeviceServices({
  396. // 这里的 deviceId 需要已经通过 createBLEConnection 与对应设备建立链接
  397. deviceId,
  398. success: res => {
  399. console.log(JSON.stringify(res.services));
  400. console.log('获取设备服务成功:' + res.errMsg);
  401. this.$set(this.disabled, 7, true);
  402. this.$set(this.disabled, 8, true);
  403. this.showMaskType = 'service';
  404. this.list = res.services;
  405. this.characteristicsData = [];
  406. if (this.list.length <= 0) {
  407. toast('获取服务失败,请重试!');
  408. return;
  409. }
  410. this.maskShow = true;
  411. },
  412. fail: e => {
  413. console.log('获取设备服务失败,错误码:' + e.errCode);
  414. if (e.errCode !== 0) {
  415. initTypes(e.errCode);
  416. }
  417. }
  418. });
  419. },
  420. /**
  421. * 获取某个服务下的所有特征值
  422. */
  423. getBLEDeviceCharacteristics() {
  424. let deviceId = this.equipment[0].deviceId;
  425. let serviceId = this.servicesData[0].uuid;
  426. console.log(deviceId);
  427. console.log(serviceId);
  428. uni.getBLEDeviceCharacteristics({
  429. // 这里的 deviceId 需要已经通过 createBLEConnection 与对应设备建立链接
  430. deviceId,
  431. // 这里的 serviceId 需要在 getBLEDeviceServices 接口中获取
  432. serviceId,
  433. success: res => {
  434. console.log(JSON.stringify(res));
  435. console.log('获取特征值成功:' + res.errMsg);
  436. this.$set(this.disabled, 7, true);
  437. this.valueChangeData = {};
  438. this.showMaskType = 'characteristics';
  439. this.list = res.characteristics;
  440. if (this.list.length <= 0) {
  441. toast('获取特征值失败,请重试!');
  442. return;
  443. }
  444. this.maskShow = true;
  445. },
  446. fail: e => {
  447. console.log('获取特征值失败,错误码:' + e.errCode);
  448. if (e.errCode !== 0) {
  449. initTypes(e.errCode);
  450. }
  451. }
  452. });
  453. },
  454. /**
  455. * 监听低功耗蓝牙连接状态的改变事件。包括开发者主动连接或断开连接,设备丢失,连接异常断开等等
  456. */
  457. onBLEConnectionStateChange() {
  458. uni.onBLEConnectionStateChange(res => {
  459. // 该方法回调中可以用于处理连接意外断开等异常情况
  460. console.log(`蓝牙连接状态 -------------------------->`);
  461. console.log(JSON.stringify(res));
  462. if (!res.connected) {
  463. if(this.isStop) return ;
  464. console.log('断开低功耗蓝牙成功:');
  465. this.$set(this.disabled, 1, false);
  466. this.$set(this.disabled, 3, true);
  467. this.$set(this.disabled, 4, true);
  468. this.$set(this.disabled, 5, true);
  469. this.$set(this.disabled, 6, true);
  470. this.$set(this.disabled, 7, true);
  471. this.$set(this.disabled, 8, true);
  472. this.$set(this.disabled, 9, true);
  473. this.searchLoad = false;
  474. this.equipment = [];
  475. this.servicesData = [];
  476. this.characteristicsData = [];
  477. this.valueChangeData = {};
  478. toast('已经断开当前蓝牙连接');
  479. }
  480. });
  481. },
  482. /**
  483. * 读取低功耗蓝牙设备的特征值的二进制数据值。注意:必须设备的特征值支持 read 才可以成功调用
  484. */
  485. readBLECharacteristicValue() {
  486. let deviceId = this.equipment[0].deviceId;
  487. let serviceId = this.servicesData[0].uuid;
  488. let characteristicId = this.characteristicsData[0].uuid;
  489. console.log(deviceId);
  490. console.log(serviceId);
  491. console.log(characteristicId);
  492. uni.readBLECharacteristicValue({
  493. // 这里的 deviceId 需要已经通过 createBLEConnection 与对应设备建立链接
  494. deviceId,
  495. // 这里的 serviceId 需要在 getBLEDeviceServices 接口中获取
  496. serviceId,
  497. // 这里的 characteristicId 需要在 getBLEDeviceCharacteristics 接口中获取
  498. characteristicId,
  499. success: res => {
  500. console.log('读取设备数据值成功');
  501. console.log(JSON.stringify(res));
  502. this.notifyBLECharacteristicValueChange();
  503. },
  504. fail(e) {
  505. console.log('读取设备数据值失败,错误码:' + e.errCode);
  506. if (e.errCode !== 0) {
  507. initTypes(e.errCode);
  508. }
  509. }
  510. });
  511. this.onBLECharacteristicValueChange();
  512. },
  513. /**
  514. * 监听低功耗蓝牙设备的特征值变化事件。必须先启用 notifyBLECharacteristicValueChange 接口才能接收到设备推送的 notification。
  515. */
  516. onBLECharacteristicValueChange() {
  517. // 必须在这里的回调才能获取
  518. uni.onBLECharacteristicValueChange(characteristic => {
  519. console.log('监听低功耗蓝牙设备的特征值变化事件成功');
  520. console.log(JSON.stringify(characteristic));
  521. this.valueChangeData = characteristic;
  522. });
  523. },
  524. /**
  525. * 订阅操作成功后需要设备主动更新特征值的 value,才会触发 uni.onBLECharacteristicValueChange 回调。
  526. */
  527. notifyBLECharacteristicValueChange() {
  528. let deviceId = this.equipment[0].deviceId;
  529. let serviceId = this.servicesData[0].uuid;
  530. let characteristicId = this.characteristicsData[0].uuid;
  531. let notify = this.characteristicsData[0].properties.notify;
  532. console.log(deviceId);
  533. console.log(serviceId);
  534. console.log(characteristicId);
  535. console.log(notify);
  536. uni.notifyBLECharacteristicValueChange({
  537. state: true, // 启用 notify 功能
  538. // 这里的 deviceId 需要已经通过 createBLEConnection 与对应设备建立链接
  539. deviceId,
  540. // 这里的 serviceId 需要在 getBLEDeviceServices 接口中获取
  541. serviceId,
  542. // 这里的 characteristicId 需要在 getBLEDeviceCharacteristics 接口中获取
  543. characteristicId,
  544. success(res) {
  545. console.log('notifyBLECharacteristicValueChange success:' + res.errMsg);
  546. console.log(JSON.stringify(res));
  547. }
  548. });
  549. },
  550. /**
  551. * 断开蓝牙模块
  552. */
  553. closeBluetoothAdapter(OBJECT) {
  554. uni.closeBluetoothAdapter({
  555. success: res => {
  556. console.log('断开蓝牙模块成功');
  557. this.isStop = true ;
  558. this.$set(this.disabled, 0, false);
  559. this.$set(this.disabled, 1, true);
  560. this.$set(this.disabled, 2, true);
  561. this.$set(this.disabled, 3, true);
  562. this.$set(this.disabled, 4, true);
  563. this.$set(this.disabled, 5, true);
  564. this.$set(this.disabled, 6, true);
  565. this.$set(this.disabled, 7, true);
  566. this.$set(this.disabled, 8, true);
  567. this.$set(this.disabled, 9, true);
  568. this.$set(this.disabled, 10, true);
  569. this.equipment = [];
  570. this.servicesData = [];
  571. this.characteristicsData = [];
  572. this.valueChangeData = {};
  573. this.adapterState = [];
  574. this.searchLoad =false;
  575. toast('断开蓝牙模块');
  576. }
  577. });
  578. }
  579. }
  580. };
  581. /**
  582. * 判断初始化蓝牙状态
  583. */
  584. function initTypes(code, errMsg) {
  585. switch (code) {
  586. case 10000:
  587. toast('未初始化蓝牙适配器');
  588. break;
  589. case 10001:
  590. toast('未检测到蓝牙,请打开蓝牙重试!');
  591. break;
  592. case 10002:
  593. toast('没有找到指定设备');
  594. break;
  595. case 10003:
  596. toast('连接失败');
  597. break;
  598. case 10004:
  599. toast('没有找到指定服务');
  600. break;
  601. case 10005:
  602. toast('没有找到指定特征值');
  603. break;
  604. case 10006:
  605. toast('当前连接已断开');
  606. break;
  607. case 10007:
  608. toast('当前特征值不支持此操作');
  609. break;
  610. case 10008:
  611. toast('其余所有系统上报的异常');
  612. break;
  613. case 10009:
  614. toast('Android 系统特有,系统版本低于 4.3 不支持 BLE');
  615. break;
  616. default:
  617. toast(errMsg);
  618. }
  619. }
  620. /**
  621. * 弹出框封装
  622. */
  623. function toast(content, showCancel = false) {
  624. uni.showModal({
  625. title: '提示',
  626. content,
  627. showCancel
  628. });
  629. }
  630. </script>
  631. <style>
  632. .uni-title {
  633. /* width: 100%; */
  634. /* height: 80rpx; */
  635. text-align: center;
  636. }
  637. .uni-mask {
  638. position: fixed;
  639. top: 0;
  640. left: 0;
  641. bottom: 0;
  642. display: flex;
  643. align-items: center;
  644. width: 100%;
  645. background: rgba(0, 0, 0, 0.6);
  646. padding: 0 30rpx;
  647. box-sizing: border-box;
  648. }
  649. .uni-scroll_box {
  650. height: 70%;
  651. background: #fff;
  652. border-radius: 20rpx;
  653. }
  654. .uni-list-box {
  655. margin: 0 20rpx;
  656. padding: 15rpx 0;
  657. border-bottom: 1px #f5f5f5 solid;
  658. box-sizing: border-box;
  659. }
  660. .uni-list:last-child {
  661. border: none;
  662. }
  663. .uni-list_name {
  664. font-size: 30rpx;
  665. color: #333;
  666. }
  667. .uni-list_item {
  668. font-size: 24rpx;
  669. color: #555;
  670. line-height: 1.5;
  671. }
  672. .uni-success_box {
  673. position: absolute;
  674. left: 0;
  675. bottom: 0;
  676. min-height: 100rpx;
  677. width: 100%;
  678. background: #fff;
  679. box-sizing: border-box;
  680. border-top: 1px #eee solid;
  681. }
  682. .uni-success_sub {
  683. /* width: 100%%; */
  684. height: 100rpx;
  685. display: flex;
  686. justify-content: space-between;
  687. align-items: center;
  688. padding: 0 30rpx;
  689. }
  690. .uni-close_button {
  691. padding: 0 20rpx;
  692. height: 60rpx;
  693. line-height: 60rpx;
  694. background: #ce3c39;
  695. color: #ffffff;
  696. border-radius: 10rpx;
  697. }
  698. .uni-success_content {
  699. height: 600rpx;
  700. margin: 30rpx;
  701. margin-top: 0;
  702. border: 1px #eee solid;
  703. padding: 30rpx;
  704. }
  705. .uni-content_list {
  706. padding-bottom: 10rpx;
  707. border-bottom: 1px #f5f5f5 solid;
  708. }
  709. .uni-tips {
  710. text-align: center;
  711. font-size: 24rpx;
  712. color: #666;
  713. }
  714. </style>