addressAdd.vue 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807
  1. <template>
  2. <view>
  3. <view class="add-address">
  4. <view class="add-form">
  5. <view class="form-item">
  6. <view class="label">联系人</view>
  7. <view class="content">
  8. <input class="input" @input="bindinputName" placeholder="姓名" :value="address.name" auto-focus />
  9. </view>
  10. </view>
  11. <view class="form-item">
  12. <view class="label">电 话</view>
  13. <view class="content">
  14. <input class="input" @input="bindinputMobile" :value="address.tel" type="number" placeholder="手机号码" maxlength="11" />
  15. </view>
  16. </view>
  17. <!-- bindtap="chooseRegion" -->
  18. <view class="form-item" @tap="goMap">
  19. <view class="label">服务地址</view>
  20. <view class="content">
  21. <view style="flex: 1;">
  22. <view class="address-name" v-if="address.addressName" style="height: 36rpx;line-height: 36rpx;font-weight: bold;">
  23. {{address.addressName}}
  24. </view>
  25. <input class="input input1" :value="address.province + address.city + address.county+address.address" :disabled="true" placeholder="请选择服务地址" placeholder-class="custom-placeholder"/>
  26. </view>
  27. <image src="/static/images/arrow.png" style="width: 12rpx; height: 20rpx; margin-right: 10rpx;margin-top: 10rpx;"></image>
  28. </view>
  29. </view>
  30. <view class="form-item">
  31. <view class="label">门牌号</view>
  32. <view class="content">
  33. <input class="input" @input="bindinputAddress" :value="address.detail" placeholder="例:9号楼1505室" />
  34. </view>
  35. </view>
  36. </view>
  37. <view class="form-default">
  38. <view style="display: flex; flex-direction: column">
  39. <text class="title">设为默认地址</text>
  40. <text class="des">提醒:每次下单会默认推荐使用该地址</text>
  41. </view>
  42. <switch style="margin-right: 10rpx" :checked="address.isDefault == 1" @change="bindIsDefault" />
  43. </view>
  44. <view class="form-item" v-if="address.id > 0">
  45. <button style="background: #d77958; color: white" :data-address-id="address.id" @tap="deleteAddress">删除地址</button>
  46. </view>
  47. <view class="btns">
  48. <view class="save" @tap="saveAddress">保存</view>
  49. <view class="cannel" @tap="cancelAddress">取消</view>
  50. </view>
  51. <view class="region-select" v-if="openSelectRegion">
  52. <view class="hd">
  53. <view class="region-selected">
  54. <view
  55. :class="'item ' + (item.code == 0 ? 'disabled' : '') + ' ' + (regionType - 1 === index ? 'selected' : '')"
  56. @tap="selectRegionType"
  57. :data-region-type-index="index"
  58. v-for="(item, index) in selectRegionList"
  59. :key="index"
  60. >
  61. {{ item.name }}
  62. </view>
  63. </view>
  64. <view :class="'done ' + (selectRegionDone ? '' : 'disabled')" style="color: #d77958;" @tap="doneSelectRegion">确定</view>
  65. </view>
  66. <view class="bd">
  67. <scroll-view scroll-y class="region-list">
  68. <view :class="'item ' + (item.selected ? 'selected' : '')" @tap="selectRegion" :data-region-index="index" v-for="(item, index) in regionList" :key="index">
  69. {{ item.name }}
  70. </view>
  71. </scroll-view>
  72. </view>
  73. </view>
  74. </view>
  75. <view class="bg-mask" @tap="cancelSelectRegion" v-if="openSelectRegion"></view>
  76. </view>
  77. </template>
  78. <script>
  79. var util = require('../../../utils/util.js');
  80. var api = require('../../../config/api.js');
  81. var check = require('../../../utils/check.js');
  82. var area = require('../../../utils/area.js');
  83. var map = require('../../../utils/map.js');
  84. const chooseLocation = requirePlugin('chooseLocation');
  85. var app = getApp();
  86. import {Dialog} from "@vant/weapp/lib/dialog/index.js"
  87. export default {
  88. data() {
  89. return {
  90. address: {
  91. id: 0,
  92. areaCode: 0,
  93. address: '',
  94. name: '',
  95. tel: '',
  96. isDefault: 0,
  97. province: '',
  98. city: '',
  99. county: '',
  100. lat: '',
  101. lng: '',
  102. addressDetail: '',
  103. detail: '',
  104. addressName: ''
  105. },
  106. addressId: 0,
  107. openSelectRegion: false,
  108. selectRegionList: [
  109. {
  110. code: 0,
  111. name: '省份'
  112. },
  113. {
  114. code: 0,
  115. name: '城市'
  116. },
  117. {
  118. code: 0,
  119. name: '区县'
  120. }
  121. ],
  122. regionType: 1,
  123. regionList: [],
  124. selectRegionDone: false,
  125. selectAddress: '',
  126. showDeleteDialog:false,
  127. addressIId:0
  128. };
  129. },
  130. onLoad: function (options) {
  131. // 页面初始化 options为页面跳转所带来的参数
  132. //console.log(options)
  133. if (options.id && options.id != 0) {
  134. this.setData({
  135. addressId: options.id
  136. });
  137. this.getAddressDetail();
  138. }
  139. //初始化area
  140. //area.init();
  141. },
  142. onShow: function () {
  143. let that = this;
  144. if (app.globalData.mapSelectFinish) {
  145. let poi = app.globalData.mapSelectPoi;
  146. let location = poi.location;
  147. let address = that.address;
  148. address.lng = location.split(',')[0];
  149. address.lat = location.split(',')[1];
  150. address.addressName = poi.name;
  151. address.address = poi.address;
  152. address.areaCode = poi.areaCode;
  153. address.province = poi.province;
  154. address.city = poi.city;
  155. address.county = poi.county;
  156. console.log("address",address);
  157. if (!address.city) {
  158. that.getAreaCode(address.lat, address.lng)
  159. .then((res) => {
  160. address.areaCode = res.areaCode;
  161. address.province = res.province;
  162. address.city = res.city;
  163. address.county = res.county;
  164. that.setData({
  165. address: address,
  166. selectAddress: poi.address
  167. });
  168. })
  169. .catch(() => {
  170. uni.showToast({
  171. title: '获取地区码失败',
  172. icon: 'none',
  173. duration: 3000
  174. });
  175. });
  176. } else {
  177. that.setData({
  178. address: address,
  179. selectAddress: poi.address
  180. });
  181. }
  182. } else {
  183. //这里分2种情况 1,有城市 标识选中原有地址进来 保持不变
  184. //2,新增地址 初始化进入此页面时 需要调用getlocation2
  185. if (that.addressId) {
  186. return;
  187. } //从已有地址进入
  188. // map.getLocation2().then(() => {
  189. // that.getAreaCode(app.globalData.lat, app.globalData.lng)
  190. // .then((res) => {
  191. // res.isDefault = that.address.isDefault;
  192. // // console.log('globalData',app.globalData.lat,app.globalData.lng)
  193. // // console.log('areaCode',res)
  194. // that.setData({
  195. // address: res,
  196. // selectAddress: res
  197. // });
  198. // })
  199. // .catch((err) => {
  200. // uni.showToast({
  201. // title: '获取地区码失败',
  202. // icon: 'none',
  203. // duration: 3000
  204. // });
  205. // });
  206. // });
  207. }
  208. },
  209. onHide: function () {
  210. // 页面隐藏
  211. },
  212. onUnload: function () {
  213. // 页面关闭
  214. chooseLocation.setLocation(null);
  215. },
  216. methods: {
  217. bindinputMobile(event) {
  218. let address = this.address;
  219. address.tel = event.detail.value;
  220. this.setData({
  221. address: address
  222. });
  223. },
  224. bindinputName(event) {
  225. let address = this.address;
  226. address.name = event.detail.value;
  227. this.setData({
  228. address: address
  229. });
  230. },
  231. bindinputAddress(event) {
  232. let address = this.address;
  233. address.detail = event.detail.value.replace(/[,,]/g, '');
  234. this.setData({
  235. address: address
  236. });
  237. },
  238. bindIsDefault() {
  239. let address = this.address;
  240. address.isDefault = !address.isDefault;
  241. this.setData({
  242. address: address
  243. });
  244. },
  245. getAddressDetail() {
  246. let that = this;
  247. util.request(api.AddressDetail, {
  248. id: that.addressId
  249. }).then(function (res) {
  250. if (res.errno === 0) {
  251. if (res.data) {
  252. that.setData({
  253. address: res.data
  254. });
  255. let addressDetailList = res.data.addressDetail.split(',');
  256. let address = that.address;
  257. address.address = addressDetailList[0];
  258. address.detail = addressDetailList.length > 1 ? addressDetailList[1] : '';
  259. that.setData({
  260. address: address
  261. });
  262. }
  263. }
  264. });
  265. },
  266. setRegionDoneStatus() {
  267. let that = this;
  268. let doneStatus = that.selectRegionList.every((item) => {
  269. return item.code != 0;
  270. });
  271. that.setData({
  272. selectRegionDone: doneStatus
  273. });
  274. },
  275. cancelAddress() {
  276. uni.navigateBack();
  277. },
  278. saveAddress() {
  279. console.log(this.address);
  280. let address = this.address;
  281. if (address.name == '') {
  282. util.showErrorToast('请输入姓名');
  283. return false;
  284. }
  285. if (address.tel == '') {
  286. util.showErrorToast('请输入手机号码');
  287. return false;
  288. }
  289. if (address.areaCode == 0) {
  290. util.showErrorToast('请输入省市区');
  291. return false;
  292. }
  293. if (address.address == '') {
  294. util.showErrorToast('请选择地址');
  295. return false;
  296. }
  297. if (!check.isValidPhone(address.tel)) {
  298. util.showErrorToast('手机号不正确');
  299. return false;
  300. }
  301. let that = this;
  302. let addressString = address.detail == '' ? address.address : address.address + ',' + address.detail;
  303. util.request(
  304. api.AddressSave,
  305. {
  306. shopId: app.globalData.shopId ? app.globalData.shopId : '',
  307. id: address.id,
  308. name: address.name,
  309. tel: address.tel,
  310. province: address.province,
  311. city: address.city,
  312. county: address.county,
  313. areaCode: address.areaCode,
  314. addressDetail: addressString,
  315. addressName: address.addressName,
  316. isDefault: address.isDefault,
  317. lat: Number(address.lat).toFixed(5),
  318. lng: Number(address.lng).toFixed(5)
  319. },
  320. 'POST'
  321. ).then(function (res) {
  322. if (res.errno === 0) {
  323. //返回之前,先取出上一页对象,并设置addressId
  324. var pages = getCurrentPages();
  325. var prevPage = pages[pages.length - 2];
  326. console.log(prevPage);
  327. if (prevPage.route == 'pages/index/index') {
  328. var city = address.city.indexOf('市') < 0 ? address.province : address.city;
  329. var addresInfo = {
  330. city: city,
  331. lng: res.data.lng,
  332. lat: res.data.lat,
  333. shopId: res.data.shopId,
  334. address: res.data.addressDetail
  335. };
  336. uni.setStorageSync('addressInfo', address);
  337. } else if (prevPage.route == 'pages/ucenter/serviceDetail/serviceDetail') {
  338. uni.setStorageSync('addressInfo', addresInfo);
  339. } else if (prevPage.route == 'pages/checkout/checkout') {
  340. prevPage.setData({
  341. addressId: res.data.id
  342. });
  343. try {
  344. uni.setStorageSync('addressId', res.data);
  345. } catch (e) {
  346. console.log('CatchClause', e);
  347. }
  348. console.log('set address');
  349. }
  350. uni.navigateBack();
  351. } else {
  352. uni.showModal({
  353. title: '提醒',
  354. confirmColor:"#d77958",
  355. showCancel: false,
  356. content: res.errmsg
  357. });
  358. }
  359. });
  360. },
  361. deleteAddress(event) {
  362. console.log(event.target);
  363. let that = this;
  364. uni.showModal({
  365. title: '',
  366. content: '确定要删除地址?',
  367. confirmColor: '#d77958',
  368. success: function (res) {
  369. if (res.confirm) {
  370. let addressId = event.target.dataset.addressId;
  371. util.request(
  372. api.AddressDelete,
  373. {
  374. id: addressId
  375. },
  376. 'POST'
  377. ).then(function (res) {
  378. if (res.errno === 0) {
  379. uni.navigateBack({
  380. delta: 1,
  381. success: function () {}
  382. });
  383. }
  384. });
  385. console.log('用户点击确定');
  386. }
  387. }
  388. });
  389. return false;
  390. this.setData({
  391. // showDeleteDialog:true,
  392. addressIId:event.target.dataset.addressId
  393. });
  394. },
  395. cancelDelete(){
  396. this.setData({
  397. showDeleteDialog:false
  398. });
  399. },
  400. confirmDelete(){
  401. util.request(
  402. api.AddressDelete,
  403. {
  404. id: this.addressIId
  405. },
  406. 'POST'
  407. ).then(function (res) {
  408. if (res.errno === 0) {
  409. uni.navigateBack({
  410. delta: 1,
  411. success: function () {}
  412. });
  413. console.log("shanchuchenggong");
  414. }
  415. });
  416. },
  417. goMapOld() {
  418. // const key = "JA2BZ-XGOEU-UNZVD-46G64-S6MYJ-6BBF4";
  419. //使用在腾讯位置服务申请的key
  420. const key = '6TRBZ-XXC6F-BWWJB-N75ME-BQNOF-YKFQY';
  421. const referer = '鲸致生活LifePlus'; //调用插件的app的名称
  422. const category = '小区,生活服务,娱乐休闲';
  423. if (this.address.lat) {
  424. const location = JSON.stringify({
  425. latitude: Number(this.address.lat),
  426. longitude: Number(this.address.lng)
  427. });
  428. uni.navigateTo({
  429. url: 'plugin://chooseLocation/index?key=' + key + '&referer=' + referer + '&category=' + category + '&location=' + location
  430. });
  431. } else {
  432. uni.navigateTo({
  433. url: 'plugin://chooseLocation/index?key=' + key + '&referer=' + referer + '&category=' + category
  434. });
  435. }
  436. },
  437. goMap() {
  438. app.globalData.mapSelectFinish = false;
  439. if (this.address.lng && this.address.lat) {
  440. let city = this.address.city == '市辖区' ? this.address.province : this.address.city;
  441. uni.navigateTo({
  442. url: '/pages/map/mapContent/mapContent?lng=' + this.address.lng + '&lat=' + this.address.lat + '&addressname=' + this.address.address + '&city=' + city
  443. });
  444. } else {
  445. uni.navigateTo({
  446. url: '/pages/map/mapContent/mapContent'
  447. });
  448. }
  449. },
  450. getAreaCodeOld() {
  451. let param = {
  452. location: this.address.lng + ',' + this.address.lat,
  453. extensions: 'all',
  454. key: api.gdKey,
  455. radius: 3000
  456. };
  457. uni.request({
  458. url: api.gdUrl,
  459. data: param,
  460. method: 'GET',
  461. header: {
  462. 'Content-Type': 'application/json'
  463. },
  464. success: (res) => {
  465. console.log(res);
  466. if (res.data.infocode == '10000') {
  467. if (res.data.info == 'OK') {
  468. // let ad_info = res.data.result.ad_info;
  469. // let areaCode = res.data.result.ad_info.adcode;
  470. // this.setData({
  471. // ['address.areaCode']: areaCode,
  472. // ['address.province']: ad_info.province,
  473. // ['address.city']: ad_info.city,
  474. // ['address.county']: ad_info.district,
  475. // });
  476. let regeocode = res.data.regeocode.addressComponent;
  477. let cityName = regeocode.city == null || regeocode.city.length == 0 ? regeocode.province : regeocode.city;
  478. let district = regeocode.district == null || regeocode.district.length == 0 ? '' : regeocode.district;
  479. this.setData({
  480. ['address.areaCode']: regeocode.adcode,
  481. ['address.province']: regeocode.province,
  482. ['address.city']: cityName,
  483. ['address.county']: district
  484. });
  485. } else {
  486. uni.showToast({
  487. title: '获取地区码失败',
  488. icon: 'none',
  489. duration: 3000
  490. });
  491. }
  492. } else {
  493. uni.showToast({
  494. title: '获取地区码失败',
  495. icon: 'none',
  496. duration: 3000
  497. });
  498. }
  499. },
  500. fail: function (err) {
  501. reject(err);
  502. }
  503. });
  504. },
  505. getAreaCode(lat, lng) {
  506. return new Promise(function (resolve, reject) {
  507. let param = {
  508. location: lng + ',' + lat,
  509. extensions: 'all',
  510. key: api.gdKey,
  511. radius: 3000
  512. };
  513. uni.request({
  514. url: api.gdUrl,
  515. data: param,
  516. method: 'GET',
  517. header: {
  518. 'Content-Type': 'application/json'
  519. },
  520. success: (res) => {
  521. console.log(res);
  522. if (res.data.infocode == '10000') {
  523. if (res.data.info == 'OK') {
  524. // console.info(res.data)
  525. let regeocode = res.data.regeocode.addressComponent;
  526. let cityName = regeocode.city == null || regeocode.city.length == 0 ? regeocode.province : regeocode.city;
  527. let district = regeocode.district == null || regeocode.district.length == 0 ? '' : regeocode.district;
  528. let address = {
  529. lat: lat,
  530. lng: lng,
  531. areaCode: regeocode.adcode,
  532. province: regeocode.province,
  533. city: cityName,
  534. county: district,
  535. address: res.data.regeocode.formatted_address,
  536. addressName: regeocode.township //纯粹做显示
  537. };
  538. console.log(address);
  539. resolve(address);
  540. } else {
  541. reject(false);
  542. }
  543. } else {
  544. reject(false);
  545. }
  546. },
  547. fail: function (err) {
  548. reject(false);
  549. }
  550. });
  551. });
  552. },
  553. selectRegionType() {
  554. console.log('占位:函数 selectRegionType 未声明');
  555. },
  556. doneSelectRegion() {
  557. console.log('占位:函数 doneSelectRegion 未声明');
  558. },
  559. selectRegion() {
  560. console.log('占位:函数 selectRegion 未声明');
  561. },
  562. cancelSelectRegion() {
  563. console.log('占位:函数 cancelSelectRegion 未声明');
  564. }
  565. }
  566. };
  567. </script>
  568. <style>
  569. page {
  570. height: 100%;
  571. background: #f4f4f4;
  572. }
  573. .add-address .add-form {
  574. background: #fff;
  575. width: 100%;
  576. height: auto;
  577. overflow: hidden;
  578. }
  579. .add-address .form-item {
  580. height: 116rpx;
  581. padding-left: 31.25rpx;
  582. display: flex;
  583. align-items: center;
  584. padding-right: 31.25rpx;
  585. }
  586. .add-address .input {
  587. flex: 1;
  588. height: 44rpx;
  589. line-height: 44rpx;
  590. overflow: hidden;
  591. margin-top: 10rpx;
  592. }
  593. .add-address .input1 {
  594. color: #999999;
  595. }
  596. .custom-placeholder {
  597. font-size: 28rpx;
  598. color: #d77958;
  599. letter-spacing: 2rpx;
  600. font-weight: 500;
  601. }
  602. .add-address .label {
  603. font-size: 32rpx;
  604. font-weight: bold;
  605. margin-right: 50rpx;
  606. width: 170rpx;
  607. text-align: center;
  608. }
  609. .add-address .content {
  610. border-bottom: 1px solid #d9d9d9;
  611. height: 116rpx;
  612. line-height: 116rpx;
  613. align-content: center;
  614. width: 100%;
  615. display: flex;
  616. align-items: center;
  617. }
  618. .add-address .form-default {
  619. border-bottom: 1px solid #d9d9d9;
  620. height: 136rpx;
  621. background: #fff;
  622. padding-top: 28rpx;
  623. font-size: 28rpx;
  624. padding-left: 31.25rpx;
  625. margin-top: 30rpx;
  626. display: flex;
  627. justify-content: space-between;
  628. }
  629. .add-address .form-default .title {
  630. font-size: 32rpx;
  631. font-weight: bold;
  632. }
  633. .add-address .form-default .des {
  634. color: #b2b2b2;
  635. line-height: 46rpx;
  636. height: 40rpx;
  637. }
  638. .add-address .form-default .van-checkbox .van-icon {
  639. color: #fff;
  640. }
  641. .add-address .btns {
  642. position: fixed;
  643. bottom: 0rpx;
  644. left: 0;
  645. overflow: hidden;
  646. width: 100%;
  647. margin-bottom: 25rpx;
  648. }
  649. .add-address .cannel,
  650. .add-address .save {
  651. width: 650rpx;
  652. height: 81rpx;
  653. text-align: center;
  654. line-height: 81rpx;
  655. font-size: 36rpx;
  656. color: #fff;
  657. border: none;
  658. border-radius: 60rpx;
  659. margin-left: 50rpx;
  660. }
  661. .add-address .cannel {
  662. margin-top: 20rpx;
  663. background: #EAD2C1;
  664. color: #999;
  665. }
  666. .add-address .save {
  667. background: #d77958;
  668. }
  669. .region-select {
  670. width: 100%;
  671. height: 600rpx;
  672. background: #fff;
  673. position: fixed;
  674. z-index: 10;
  675. left: 0;
  676. bottom: 0;
  677. }
  678. .region-select .hd {
  679. height: 108rpx;
  680. width: 100%;
  681. border-bottom: 1px solid #f4f4f4;
  682. padding: 46rpx 30rpx 0 30rpx;
  683. }
  684. .region-select .region-selected {
  685. float: left;
  686. height: 60rpx;
  687. display: flex;
  688. }
  689. .region-select .region-selected .item {
  690. max-width: 140rpx;
  691. margin-right: 30rpx;
  692. text-align: left;
  693. line-height: 60rpx;
  694. height: 100%;
  695. color: #333;
  696. font-size: 28rpx;
  697. overflow: hidden;
  698. text-overflow: ellipsis;
  699. white-space: nowrap;
  700. }
  701. .region-select .region-selected .item.disabled {
  702. color: #999;
  703. }
  704. .region-select .region-selected .item.selected {
  705. color: #b4282d;
  706. }
  707. .region-select .done {
  708. float: right;
  709. height: 60rpx;
  710. width: 60rpx;
  711. border: none;
  712. background: #fff;
  713. line-height: 60rpx;
  714. text-align: center;
  715. color: #333;
  716. font-size: 28rpx;
  717. }
  718. .region-select .done.disabled {
  719. color: #999;
  720. }
  721. .region-select .bd {
  722. height: 492rpx;
  723. width: 100%;
  724. padding: 0 30rpx;
  725. }
  726. .region-select .region-list {
  727. height: 492rpx;
  728. }
  729. .region-select .region-list .item {
  730. width: 100%;
  731. height: 104rpx;
  732. line-height: 104rpx;
  733. text-align: left;
  734. color: #333;
  735. font-size: 28rpx;
  736. }
  737. .region-select .region-list .item.selected {
  738. color: #b4282d;
  739. }
  740. .bg-mask {
  741. height: 100%;
  742. width: 100%;
  743. background: rgba(0, 0, 0, 0.4);
  744. position: fixed;
  745. top: 0;
  746. left: 0;
  747. z-index: 8;
  748. }
  749. </style>