123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629 |
- <template>
- <view class="center">
- <view class="store-info flex">
- <view class="store-top flex">
- <image class="simage" :src="info.logo" mode=""></image>
- <view class="stop-main">
- <view class="stop-title">{{ info.name }}</view>
- </view>
- </view>
- <view class="">
- </view>
- </view>
- <view class="store-item" v-if="info.mobile">
- <view class="store-font">预约电话:{{ info.mobile }}</view>
- </view>
- <view class="store-main" v-if="images != null">
- <view class="smain-title">店内照片</view>
- <scroll-view class="scroll-box flex" @scroll="scroll" scroll-x="true" :scroll-with-animation="true"
- scroll-left="10px">
- <view class="scroll-item" v-for="(item, index) in images" :key="index">
- <image class="scroll-image" :src="'https://shop.xianghuaqi.net.cn/'+item" mode="heightFix">
- </image>
- </view>
- </scroll-view>
- </view>
- <!-- <jyf-parser class="main" :html="art.content"></jyf-parser> -->
- <view class="" style="height: 100rpx;"></view>
- <view class="btn-box" v-if="info.mobile">
- <view class="btn-left" @click="tocall()">拨打电话</view>
- <!-- #ifdef H5 -->
- <view class="btn-right" @click="toGaodeMap()">导航到店</view>
- <!-- #endif -->
- <!-- #ifdef MP -->
- <view class="btn-right" @click="dh()">导航到店</view>
- <!-- #endif -->
- <!-- #ifdef APP-PLUS -->
- <view class="btn-right" @click="gomapApp(info.latitude, info.longitude, info.name)">导航到店</view>
- <!-- #endif -->
- </view>
- <view class="btn-box dhdd flex" v-if="!info.mobile">
- <!-- #ifdef H5 -->
- <view class="btn-right" @click="toGaodeMap()">导航到店</view>
- <!-- #endif -->
- <!-- #ifdef MP -->
- <view class="btn-right" @click="dh()">导航到店</view>
- <!-- #endif -->
- <!-- #ifdef APP-PLUS -->
- <view class="btn-right" @click="gomapApp(info.latitude, info.longitude, info.name)">导航到店</view>
- <!-- #endif -->
- </view>
- </view>
- </template>
- <script>
- import {
- getShopInfo
- } from '@/api/shop.js'
- export default {
- data() {
- return {
- id: '',
- info: {},
- images: [],
- };
- },
- onLoad(option) {
- let obj = this;
- this.id = option.id;
- this.getStoreDetail();
- },
- onShow() {},
- methods: {
- // 获取门店详情
- getStoreDetail() {
- let obj = this;
- console.log('进入');
- getShopInfo({
- shop_id: obj.id
- }).then(res => {
- obj.info = res.data
- obj.images = res.data.images.split(',')
- console.log(obj.images, '123456');
- });
- },
- scroll(e) {
- console.log(e, '123456');
- },
- tocall() {
- let num = this.info.mobile;
- console.log(num);
- uni.makePhoneCall({
- phoneNumber: num //仅为示例
- });
- },
- // 调用高德
- toGaodeMap() {
- let obj = this;
- window.location.href =
- `https://uri.amap.com/marker?position=${obj.info.longitude},${obj.info.latitude}&name=${obj.info.name}`;
- },
- // 导航
- dh() {
- let obj = this;
- wx.openLocation({
- latitude: obj.info.latitude * 1,
- longitude: obj.info.longitude * 1,
- name: obj.info.name,
- address: obj.info.detailed_address
- });
- },
- gomapApp(latitude, longitude, name) {
- let url = '';
- if (plus.os.name == 'Android') {
- //判断是安卓端
- plus.nativeUI.actionSheet({
- //选择菜单
- title: '选择地图应用',
- cancel: '取消',
- buttons: [{
- title: '腾讯地图'
- }, {
- title: '百度地图'
- }, {
- title: '高德地图'
- }]
- },
- function(e) {
- switch (e.index) {
- //下面是拼接url,不同系统以及不同地图都有不同的拼接字段
- case 1:
- //注意referer=xxx的xxx替换成你在腾讯地图开发平台申请的key
- url = `qqmap://map/geocoder?coord=${latitude},${longitude}&referer=xxx`;
- break;
- case 2:
- url =
- `baidumap://map/marker?location=${latitude},${longitude}&title=${name}&coord_type=gcj02&src=andr.baidu.openAPIdemo`;
- break;
- case 3:
- url =
- `androidamap://viewMap?sourceApplication=appname&poiname=${name}&lat=${latitude}&lon=${longitude}&dev=0`;
- break;
- default:
- break;
- }
- if (url != '') {
- url = encodeURI(url);
- //plus.runtime.openURL(url,function(e){})调起手机APP应用
- plus.runtime.openURL(url, function(e) {
- plus.nativeUI.alert('本机未安装指定的地图应用');
- });
- }
- }
- );
- } else {
- // iOS上获取本机是否安装了百度高德地图,需要在manifest里配置
- // 在manifest.json文件app-plus->distribute->apple->urlschemewhitelist节点下添加
- //(如urlschemewhitelist:["iosamap","baidumap"])
- plus.nativeUI.actionSheet({
- title: '选择地图应用',
- cancel: '取消',
- buttons: [{
- title: '腾讯地图'
- }, {
- title: '百度地图'
- }, {
- title: '高德地图'
- }]
- },
- function(e) {
- switch (e.index) {
- case 1:
- url = `qqmap://map/geocoder?coord=${latitude},${longitude}&referer=xxx`;
- break;
- case 2:
- url =
- `baidumap://map/marker?location=${latitude},${longitude}&title=${name}&content=${name}&src=ios.baidu.openAPIdemo&coord_type=gcj02`;
- break;
- case 3:
- url =
- `iosamap://viewMap?sourceApplication=applicationName&poiname=${name}&lat=${latitude}&lon=${longitude}&dev=0`;
- break;
- default:
- break;
- }
- if (url != '') {
- url = encodeURI(url);
- plus.runtime.openURL(url, function(e) {
- plus.nativeUI.alert('本机未安装指定的地图应用');
- });
- }
- }
- );
- }
- }
- }
- };
- </script>
- <style lang="less">
- .center,
- page {
- background: #f8f8f8;
- height: 100%;
- }
- .dhdd {
- view {
- margin: 0 auto;
- }
- }
- .store-info {
- background: #ffffff;
- .store-top {
- padding: 40rpx 20rpx;
- justify-content: flex-start;
- .simage {
- width: 130rpx;
- height: 130rpx;
- background: #f44939;
- }
- .stop-main {
- height: 130rpx;
- padding: 6rpx 0;
- margin-left: 20rpx;
- display: flex;
- flex-direction: column;
- justify-content: space-between;
- align-items: flex-start;
- .stop-title {
- font-size: 36rpx;
- font-family: PingFang SC;
- font-weight: 500;
- color: #000000;
- }
- .stop-address {
- display: flex;
- justify-content: flex-end;
- align-items: center;
- .mrt-image {
- width: 20rpx;
- height: 28rpx;
- }
- .mrt-font {
- margin-left: 8rpx;
- font-size: 22rpx;
- font-family: PingFang SC;
- font-weight: 500;
- color: #666666;
- }
- }
- }
- }
- }
- .store-item {
- background: #ffffff;
- display: flex;
- justify-content: flex-start;
- align-items: center;
- padding: 30rpx 30rpx 30rpx 44rpx;
- .store-image1 {
- width: 36rpx;
- height: 36rpx;
- }
- .store-image2 {
- margin: 0 1rpx;
- width: 34rpx;
- height: 34rpx;
- }
- .store-image3 {
- margin: 0 7rpx;
- width: 22rpx;
- height: 28rpx;
- }
- .store-font {
- margin-left: 22rpx;
- font-size: 26rpx;
- font-family: PingFang SC;
- font-weight: 500;
- color: #2d2d2d;
- }
- }
- .store-main {
- margin-top: 16rpx;
- background: #ffffff;
- padding: 30rpx 42rpx 40rpx;
- .smain-title {
- font-size: 30rpx;
- font-family: PingFang SC;
- font-weight: 500;
- color: #464646;
- }
- }
- .scroll-box {
- white-space: nowrap;
- margin-top: 30rpx;
- height: 240rpx;
- .scroll-item:first-child {
- margin-left: 0;
- }
- .scroll-item {
- margin-left: 20rpx;
- display: inline-block;
- height: 240rpx;
- // width: 240rpx;
- }
- .scroll-image {
- height: 240rpx;
- // width: 240rpx;
- }
- }
- .btn-box {
- display: flex;
- justify-content: space-between;
- position: fixed;
- bottom: 0rpx;
- left: 0;
- right: 0;
- width: 750rpx;
- background: rgba(255, 255, 255, 0.6);
- box-shadow: 0rpx 0rpx 20rpx 0px rgba(50, 50, 52, 0.06);
- padding: 22rpx 68rpx;
- .btn-left {
- width: 280rpx;
- height: 80rpx;
- background: linear-gradient(180deg, #ffa30b, #ffd158);
- box-shadow: 0px 3rpx 13rpx 3rpx rgba(255, 164, 13, 0.48);
- border-radius: 40rpx;
- text-align: center;
- line-height: 80rpx;
- font-size: 32rpx;
- font-family: PingFang SC;
- font-weight: 500;
- color: #ffffff;
- }
- .btn-right {
- width: 280rpx;
- height: 80rpx;
- background: linear-gradient(180deg, #ff6223, #ffab60);
- box-shadow: 0px 3rpx 13rpx 3rpx rgba(255, 164, 13, 0.48);
- border-radius: 40rpx;
- text-align: center;
- line-height: 80rpx;
- font-size: 32rpx;
- font-family: PingFang SC;
- font-weight: 500;
- color: #ffffff;
- }
- }
- .popup_row {
- width: 100%;
- height: 500rpx;
- background-color: #ffffff;
- border-radius: 20rpx;
- display: flex;
- justify-content: center;
- align-items: center;
- .rows {
- width: 100%;
- padding: 0 24rpx;
- .rows-item {
- height: 80rpx;
- line-height: 80rpx;
- text-align: center;
- width: 100%;
- font-size: 32rpx;
- color: #303133;
- // border-bottom: 1rpx solid #f0f0f0;
- }
- // .row-1 {
- // margin: auto;
- // .first_aid {
- // width: 300rpx;
- // height: 300rpx;
- // }
- // }
- // .row-2 {
- // font-size: 38rpx;
- // margin-top: 20rpx;
- // }
- }
- }
- .shop-dhq {
- width: 702rpx;
- height: 171rpx;
- box-shadow: 0px 0px 20rpx 0px rgba(50, 50, 52, 0.15);
- margin: auto;
- border-radius: 20rpx;
- background-color: #fff;
- padding: 0 48rpx 0 26rpx;
- margin-bottom: 20rpx;
- .dhq-left {
- .dhq-name {
- overflow: hidden;
- width: 28%;
- font-size: 28rpx;
- font-weight: bold;
- color: #333333;
- }
- .dhq-price {
- padding-top: 20rpx;
- .j-price {
- font-size: 38rpx;
- font-weight: bold;
- color: #ff4c4c;
- &::before {
- content: '¥';
- font-size: 24rpx;
- color: #ff4c4c;
- }
- }
- .j-zk {
- margin: 10rpx;
- display: inline-block;
- margin-left: 10rpx;
- line-height: 32rpx;
- height: 32rpx;
- border: 1px solid #ff4c4c;
- border-radius: 5rpx;
- font-size: 22rpx;
- font-weight: 500;
- color: #ff4c4c;
- padding: 0 8rpx;
- }
- }
- }
- .dhq-right {
- .right-btn {
- width: 105rpx;
- line-height: 56rpx;
- background: linear-gradient(143.2747deg, #ff6a00, #ee0979);
- border: 1rpx solid #ff4c4c;
- border-radius: 27rpx;
- text-align: center;
- color: #fff;
- font-size: 28rpx;
- font-weight: bold;
- }
- }
- }
- .jx-box-content {
- display: flex;
- .content-left {
- margin: 20rpx 15rpx;
- width: 236rpx;
- height: 236rpx;
- background: #e2e2e2;
- border-radius: 10rpx;
- image {
- width: 100%;
- height: 100%;
- }
- }
- .content-right {
- display: flex;
- flex-direction: column;
- justify-content: space-around;
- .shop-name {
- width: 382rpx;
- font-size: 32rpx;
- font-weight: bold;
- color: #333333;
- overflow: hidden;
- text-overflow: ellipsis;
- display: -webkit-box;
- -webkit-box-orient: vertical;
- -webkit-line-clamp: 2;
- }
- .shop-content {
- width: 455rpx;
- display: flex;
- justify-content: space-between;
- .shop-content-left {
- display: flex;
- flex-direction: column;
- .price-box {
- display: flex;
- align-items: center;
- .yuan-price {
- font-size: 26rpx;
- font-weight: 500;
- text-decoration: line-through;
- color: #999999;
- }
- image {
- margin: 0 10rpx;
- width: 16rpx;
- height: 18rpx;
- }
- .j-price {
- font-size: 24rpx;
- font-weight: bold;
- color: #b59467;
- }
- }
- .price-x {
- font-size: 36rpx;
- font-weight: bold;
- color: #ff4c4c;
- }
- }
- .shop-content-right {
- margin-top: 20rpx;
- align-items: center;
- text-align: center;
- width: 137rpx;
- height: 52rpx;
- font-size: 26rpx;
- font-weight: 500;
- color: #fff;
- background: #f75022;
- border-radius: 26rpx;
- line-height: 52rpx;
- }
- }
- }
- }
- .popup-box {
- width: 500rpx;
- background: #ffffff;
- border-radius: 20rpx;
- padding: 50rpx 0 20rpx;
- .title {
- text-align: center;
- font-size: 32rpx;
- font-weight: 500;
- }
- .input {
- background: #e8e8e8;
- width: 300rpx;
- margin: 50rpx auto 0;
- padding: 10rpx;
- }
- .nocancel {
- margin-top: 20rpx;
- text-align: center;
- font-size: 28rpx;
- font-weight: 500;
- }
- .comfirm-box {
- margin-top: 80rpx;
- display: flex;
- width: 100%;
- align-items: center;
- .cancel {
- width: 50%;
- text-align: center;
- font-size: 28rpx;
- font-weight: 500;
- }
- .comfirm {
- width: 50%;
- text-align: center;
- font-size: 28rpx;
- font-weight: 500;
- color: #fe4a4a;
- }
- }
- }
- .main {
- padding: 10rpx;
- display: flex;
- flex-direction: column;
- }
- /deep/ .main {
- .rich-img {
- width: 100% !important;
- height: auto;
- }
- }
- </style>
|