neardetail.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629
  1. <template>
  2. <view class="center">
  3. <view class="store-info flex">
  4. <view class="store-top flex">
  5. <image class="simage" :src="info.logo" mode=""></image>
  6. <view class="stop-main">
  7. <view class="stop-title">{{ info.name }}</view>
  8. </view>
  9. </view>
  10. <view class="">
  11. </view>
  12. </view>
  13. <view class="store-item" v-if="info.mobile">
  14. <view class="store-font">预约电话:{{ info.mobile }}</view>
  15. </view>
  16. <view class="store-main" v-if="images != null">
  17. <view class="smain-title">店内照片</view>
  18. <scroll-view class="scroll-box flex" @scroll="scroll" scroll-x="true" :scroll-with-animation="true"
  19. scroll-left="10px">
  20. <view class="scroll-item" v-for="(item, index) in images" :key="index">
  21. <image class="scroll-image" :src="'https://shop.xianghuaqi.net.cn/'+item" mode="heightFix">
  22. </image>
  23. </view>
  24. </scroll-view>
  25. </view>
  26. <!-- <jyf-parser class="main" :html="art.content"></jyf-parser> -->
  27. <view class="" style="height: 100rpx;"></view>
  28. <view class="btn-box" v-if="info.mobile">
  29. <view class="btn-left" @click="tocall()">拨打电话</view>
  30. <!-- #ifdef H5 -->
  31. <view class="btn-right" @click="toGaodeMap()">导航到店</view>
  32. <!-- #endif -->
  33. <!-- #ifdef MP -->
  34. <view class="btn-right" @click="dh()">导航到店</view>
  35. <!-- #endif -->
  36. <!-- #ifdef APP-PLUS -->
  37. <view class="btn-right" @click="gomapApp(info.latitude, info.longitude, info.name)">导航到店</view>
  38. <!-- #endif -->
  39. </view>
  40. <view class="btn-box dhdd flex" v-if="!info.mobile">
  41. <!-- #ifdef H5 -->
  42. <view class="btn-right" @click="toGaodeMap()">导航到店</view>
  43. <!-- #endif -->
  44. <!-- #ifdef MP -->
  45. <view class="btn-right" @click="dh()">导航到店</view>
  46. <!-- #endif -->
  47. <!-- #ifdef APP-PLUS -->
  48. <view class="btn-right" @click="gomapApp(info.latitude, info.longitude, info.name)">导航到店</view>
  49. <!-- #endif -->
  50. </view>
  51. </view>
  52. </template>
  53. <script>
  54. import {
  55. getShopInfo
  56. } from '@/api/shop.js'
  57. export default {
  58. data() {
  59. return {
  60. id: '',
  61. info: {},
  62. images: [],
  63. };
  64. },
  65. onLoad(option) {
  66. let obj = this;
  67. this.id = option.id;
  68. this.getStoreDetail();
  69. },
  70. onShow() {},
  71. methods: {
  72. // 获取门店详情
  73. getStoreDetail() {
  74. let obj = this;
  75. console.log('进入');
  76. getShopInfo({
  77. shop_id: obj.id
  78. }).then(res => {
  79. obj.info = res.data
  80. obj.images = res.data.images.split(',')
  81. console.log(obj.images, '123456');
  82. });
  83. },
  84. scroll(e) {
  85. console.log(e, '123456');
  86. },
  87. tocall() {
  88. let num = this.info.mobile;
  89. console.log(num);
  90. uni.makePhoneCall({
  91. phoneNumber: num //仅为示例
  92. });
  93. },
  94. // 调用高德
  95. toGaodeMap() {
  96. let obj = this;
  97. window.location.href =
  98. `https://uri.amap.com/marker?position=${obj.info.longitude},${obj.info.latitude}&name=${obj.info.name}`;
  99. },
  100. // 导航
  101. dh() {
  102. let obj = this;
  103. wx.openLocation({
  104. latitude: obj.info.latitude * 1,
  105. longitude: obj.info.longitude * 1,
  106. name: obj.info.name,
  107. address: obj.info.detailed_address
  108. });
  109. },
  110. gomapApp(latitude, longitude, name) {
  111. let url = '';
  112. if (plus.os.name == 'Android') {
  113. //判断是安卓端
  114. plus.nativeUI.actionSheet({
  115. //选择菜单
  116. title: '选择地图应用',
  117. cancel: '取消',
  118. buttons: [{
  119. title: '腾讯地图'
  120. }, {
  121. title: '百度地图'
  122. }, {
  123. title: '高德地图'
  124. }]
  125. },
  126. function(e) {
  127. switch (e.index) {
  128. //下面是拼接url,不同系统以及不同地图都有不同的拼接字段
  129. case 1:
  130. //注意referer=xxx的xxx替换成你在腾讯地图开发平台申请的key
  131. url = `qqmap://map/geocoder?coord=${latitude},${longitude}&referer=xxx`;
  132. break;
  133. case 2:
  134. url =
  135. `baidumap://map/marker?location=${latitude},${longitude}&title=${name}&coord_type=gcj02&src=andr.baidu.openAPIdemo`;
  136. break;
  137. case 3:
  138. url =
  139. `androidamap://viewMap?sourceApplication=appname&poiname=${name}&lat=${latitude}&lon=${longitude}&dev=0`;
  140. break;
  141. default:
  142. break;
  143. }
  144. if (url != '') {
  145. url = encodeURI(url);
  146. //plus.runtime.openURL(url,function(e){})调起手机APP应用
  147. plus.runtime.openURL(url, function(e) {
  148. plus.nativeUI.alert('本机未安装指定的地图应用');
  149. });
  150. }
  151. }
  152. );
  153. } else {
  154. // iOS上获取本机是否安装了百度高德地图,需要在manifest里配置
  155. // 在manifest.json文件app-plus->distribute->apple->urlschemewhitelist节点下添加
  156. //(如urlschemewhitelist:["iosamap","baidumap"])
  157. plus.nativeUI.actionSheet({
  158. title: '选择地图应用',
  159. cancel: '取消',
  160. buttons: [{
  161. title: '腾讯地图'
  162. }, {
  163. title: '百度地图'
  164. }, {
  165. title: '高德地图'
  166. }]
  167. },
  168. function(e) {
  169. switch (e.index) {
  170. case 1:
  171. url = `qqmap://map/geocoder?coord=${latitude},${longitude}&referer=xxx`;
  172. break;
  173. case 2:
  174. url =
  175. `baidumap://map/marker?location=${latitude},${longitude}&title=${name}&content=${name}&src=ios.baidu.openAPIdemo&coord_type=gcj02`;
  176. break;
  177. case 3:
  178. url =
  179. `iosamap://viewMap?sourceApplication=applicationName&poiname=${name}&lat=${latitude}&lon=${longitude}&dev=0`;
  180. break;
  181. default:
  182. break;
  183. }
  184. if (url != '') {
  185. url = encodeURI(url);
  186. plus.runtime.openURL(url, function(e) {
  187. plus.nativeUI.alert('本机未安装指定的地图应用');
  188. });
  189. }
  190. }
  191. );
  192. }
  193. }
  194. }
  195. };
  196. </script>
  197. <style lang="less">
  198. .center,
  199. page {
  200. background: #f8f8f8;
  201. height: 100%;
  202. }
  203. .dhdd {
  204. view {
  205. margin: 0 auto;
  206. }
  207. }
  208. .store-info {
  209. background: #ffffff;
  210. .store-top {
  211. padding: 40rpx 20rpx;
  212. justify-content: flex-start;
  213. .simage {
  214. width: 130rpx;
  215. height: 130rpx;
  216. background: #f44939;
  217. }
  218. .stop-main {
  219. height: 130rpx;
  220. padding: 6rpx 0;
  221. margin-left: 20rpx;
  222. display: flex;
  223. flex-direction: column;
  224. justify-content: space-between;
  225. align-items: flex-start;
  226. .stop-title {
  227. font-size: 36rpx;
  228. font-family: PingFang SC;
  229. font-weight: 500;
  230. color: #000000;
  231. }
  232. .stop-address {
  233. display: flex;
  234. justify-content: flex-end;
  235. align-items: center;
  236. .mrt-image {
  237. width: 20rpx;
  238. height: 28rpx;
  239. }
  240. .mrt-font {
  241. margin-left: 8rpx;
  242. font-size: 22rpx;
  243. font-family: PingFang SC;
  244. font-weight: 500;
  245. color: #666666;
  246. }
  247. }
  248. }
  249. }
  250. }
  251. .store-item {
  252. background: #ffffff;
  253. display: flex;
  254. justify-content: flex-start;
  255. align-items: center;
  256. padding: 30rpx 30rpx 30rpx 44rpx;
  257. .store-image1 {
  258. width: 36rpx;
  259. height: 36rpx;
  260. }
  261. .store-image2 {
  262. margin: 0 1rpx;
  263. width: 34rpx;
  264. height: 34rpx;
  265. }
  266. .store-image3 {
  267. margin: 0 7rpx;
  268. width: 22rpx;
  269. height: 28rpx;
  270. }
  271. .store-font {
  272. margin-left: 22rpx;
  273. font-size: 26rpx;
  274. font-family: PingFang SC;
  275. font-weight: 500;
  276. color: #2d2d2d;
  277. }
  278. }
  279. .store-main {
  280. margin-top: 16rpx;
  281. background: #ffffff;
  282. padding: 30rpx 42rpx 40rpx;
  283. .smain-title {
  284. font-size: 30rpx;
  285. font-family: PingFang SC;
  286. font-weight: 500;
  287. color: #464646;
  288. }
  289. }
  290. .scroll-box {
  291. white-space: nowrap;
  292. margin-top: 30rpx;
  293. height: 240rpx;
  294. .scroll-item:first-child {
  295. margin-left: 0;
  296. }
  297. .scroll-item {
  298. margin-left: 20rpx;
  299. display: inline-block;
  300. height: 240rpx;
  301. // width: 240rpx;
  302. }
  303. .scroll-image {
  304. height: 240rpx;
  305. // width: 240rpx;
  306. }
  307. }
  308. .btn-box {
  309. display: flex;
  310. justify-content: space-between;
  311. position: fixed;
  312. bottom: 0rpx;
  313. left: 0;
  314. right: 0;
  315. width: 750rpx;
  316. background: rgba(255, 255, 255, 0.6);
  317. box-shadow: 0rpx 0rpx 20rpx 0px rgba(50, 50, 52, 0.06);
  318. padding: 22rpx 68rpx;
  319. .btn-left {
  320. width: 280rpx;
  321. height: 80rpx;
  322. background: linear-gradient(180deg, #ffa30b, #ffd158);
  323. box-shadow: 0px 3rpx 13rpx 3rpx rgba(255, 164, 13, 0.48);
  324. border-radius: 40rpx;
  325. text-align: center;
  326. line-height: 80rpx;
  327. font-size: 32rpx;
  328. font-family: PingFang SC;
  329. font-weight: 500;
  330. color: #ffffff;
  331. }
  332. .btn-right {
  333. width: 280rpx;
  334. height: 80rpx;
  335. background: linear-gradient(180deg, #ff6223, #ffab60);
  336. box-shadow: 0px 3rpx 13rpx 3rpx rgba(255, 164, 13, 0.48);
  337. border-radius: 40rpx;
  338. text-align: center;
  339. line-height: 80rpx;
  340. font-size: 32rpx;
  341. font-family: PingFang SC;
  342. font-weight: 500;
  343. color: #ffffff;
  344. }
  345. }
  346. .popup_row {
  347. width: 100%;
  348. height: 500rpx;
  349. background-color: #ffffff;
  350. border-radius: 20rpx;
  351. display: flex;
  352. justify-content: center;
  353. align-items: center;
  354. .rows {
  355. width: 100%;
  356. padding: 0 24rpx;
  357. .rows-item {
  358. height: 80rpx;
  359. line-height: 80rpx;
  360. text-align: center;
  361. width: 100%;
  362. font-size: 32rpx;
  363. color: #303133;
  364. // border-bottom: 1rpx solid #f0f0f0;
  365. }
  366. // .row-1 {
  367. // margin: auto;
  368. // .first_aid {
  369. // width: 300rpx;
  370. // height: 300rpx;
  371. // }
  372. // }
  373. // .row-2 {
  374. // font-size: 38rpx;
  375. // margin-top: 20rpx;
  376. // }
  377. }
  378. }
  379. .shop-dhq {
  380. width: 702rpx;
  381. height: 171rpx;
  382. box-shadow: 0px 0px 20rpx 0px rgba(50, 50, 52, 0.15);
  383. margin: auto;
  384. border-radius: 20rpx;
  385. background-color: #fff;
  386. padding: 0 48rpx 0 26rpx;
  387. margin-bottom: 20rpx;
  388. .dhq-left {
  389. .dhq-name {
  390. overflow: hidden;
  391. width: 28%;
  392. font-size: 28rpx;
  393. font-weight: bold;
  394. color: #333333;
  395. }
  396. .dhq-price {
  397. padding-top: 20rpx;
  398. .j-price {
  399. font-size: 38rpx;
  400. font-weight: bold;
  401. color: #ff4c4c;
  402. &::before {
  403. content: '¥';
  404. font-size: 24rpx;
  405. color: #ff4c4c;
  406. }
  407. }
  408. .j-zk {
  409. margin: 10rpx;
  410. display: inline-block;
  411. margin-left: 10rpx;
  412. line-height: 32rpx;
  413. height: 32rpx;
  414. border: 1px solid #ff4c4c;
  415. border-radius: 5rpx;
  416. font-size: 22rpx;
  417. font-weight: 500;
  418. color: #ff4c4c;
  419. padding: 0 8rpx;
  420. }
  421. }
  422. }
  423. .dhq-right {
  424. .right-btn {
  425. width: 105rpx;
  426. line-height: 56rpx;
  427. background: linear-gradient(143.2747deg, #ff6a00, #ee0979);
  428. border: 1rpx solid #ff4c4c;
  429. border-radius: 27rpx;
  430. text-align: center;
  431. color: #fff;
  432. font-size: 28rpx;
  433. font-weight: bold;
  434. }
  435. }
  436. }
  437. .jx-box-content {
  438. display: flex;
  439. .content-left {
  440. margin: 20rpx 15rpx;
  441. width: 236rpx;
  442. height: 236rpx;
  443. background: #e2e2e2;
  444. border-radius: 10rpx;
  445. image {
  446. width: 100%;
  447. height: 100%;
  448. }
  449. }
  450. .content-right {
  451. display: flex;
  452. flex-direction: column;
  453. justify-content: space-around;
  454. .shop-name {
  455. width: 382rpx;
  456. font-size: 32rpx;
  457. font-weight: bold;
  458. color: #333333;
  459. overflow: hidden;
  460. text-overflow: ellipsis;
  461. display: -webkit-box;
  462. -webkit-box-orient: vertical;
  463. -webkit-line-clamp: 2;
  464. }
  465. .shop-content {
  466. width: 455rpx;
  467. display: flex;
  468. justify-content: space-between;
  469. .shop-content-left {
  470. display: flex;
  471. flex-direction: column;
  472. .price-box {
  473. display: flex;
  474. align-items: center;
  475. .yuan-price {
  476. font-size: 26rpx;
  477. font-weight: 500;
  478. text-decoration: line-through;
  479. color: #999999;
  480. }
  481. image {
  482. margin: 0 10rpx;
  483. width: 16rpx;
  484. height: 18rpx;
  485. }
  486. .j-price {
  487. font-size: 24rpx;
  488. font-weight: bold;
  489. color: #b59467;
  490. }
  491. }
  492. .price-x {
  493. font-size: 36rpx;
  494. font-weight: bold;
  495. color: #ff4c4c;
  496. }
  497. }
  498. .shop-content-right {
  499. margin-top: 20rpx;
  500. align-items: center;
  501. text-align: center;
  502. width: 137rpx;
  503. height: 52rpx;
  504. font-size: 26rpx;
  505. font-weight: 500;
  506. color: #fff;
  507. background: #f75022;
  508. border-radius: 26rpx;
  509. line-height: 52rpx;
  510. }
  511. }
  512. }
  513. }
  514. .popup-box {
  515. width: 500rpx;
  516. background: #ffffff;
  517. border-radius: 20rpx;
  518. padding: 50rpx 0 20rpx;
  519. .title {
  520. text-align: center;
  521. font-size: 32rpx;
  522. font-weight: 500;
  523. }
  524. .input {
  525. background: #e8e8e8;
  526. width: 300rpx;
  527. margin: 50rpx auto 0;
  528. padding: 10rpx;
  529. }
  530. .nocancel {
  531. margin-top: 20rpx;
  532. text-align: center;
  533. font-size: 28rpx;
  534. font-weight: 500;
  535. }
  536. .comfirm-box {
  537. margin-top: 80rpx;
  538. display: flex;
  539. width: 100%;
  540. align-items: center;
  541. .cancel {
  542. width: 50%;
  543. text-align: center;
  544. font-size: 28rpx;
  545. font-weight: 500;
  546. }
  547. .comfirm {
  548. width: 50%;
  549. text-align: center;
  550. font-size: 28rpx;
  551. font-weight: 500;
  552. color: #fe4a4a;
  553. }
  554. }
  555. }
  556. .main {
  557. padding: 10rpx;
  558. display: flex;
  559. flex-direction: column;
  560. }
  561. /deep/ .main {
  562. .rich-img {
  563. width: 100% !important;
  564. height: auto;
  565. }
  566. }
  567. </style>