更新
This commit is contained in:
49
src/subPackages/site/details/components/illustrate.vue
Normal file
49
src/subPackages/site/details/components/illustrate.vue
Normal file
@@ -0,0 +1,49 @@
|
||||
<template>
|
||||
<view class="illustrate">
|
||||
<view class="title">
|
||||
服务费说明
|
||||
<uni-icons type="closeempty" size="20" @click="close" />
|
||||
</view>
|
||||
<view class="text"
|
||||
>服务费为本笔订单优惠金额{{
|
||||
discountInfo.feeRatio * 100 + "%"
|
||||
}},最高不超过7元</view
|
||||
>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
props: {
|
||||
discountInfo: Object,
|
||||
},
|
||||
methods: {
|
||||
close() {
|
||||
this.$emit("close");
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.illustrate {
|
||||
min-height: 30vh;
|
||||
> .title {
|
||||
position: relative;
|
||||
padding: 30rpx 0;
|
||||
text-align: center;
|
||||
> uni-icons {
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
right: 30rpx;
|
||||
transform: translateY(-50%);
|
||||
}
|
||||
}
|
||||
> .text {
|
||||
padding: 0 20rpx;
|
||||
text-align: center;
|
||||
font-size: 28rpx;
|
||||
color: #999;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
63
src/subPackages/site/details/components/info.vue
Normal file
63
src/subPackages/site/details/components/info.vue
Normal file
@@ -0,0 +1,63 @@
|
||||
<template>
|
||||
<view class="info">
|
||||
<view class="title">
|
||||
油站详情
|
||||
<uni-icons type="closeempty" size="20" @click="close" />
|
||||
</view>
|
||||
<view class="block">
|
||||
<view>油站开票</view>
|
||||
<view
|
||||
>发票需油站当天开具,请务必现场咨询油站,过期可能无法回溯发票。</view
|
||||
>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
props: {
|
||||
discountInfo: Object,
|
||||
},
|
||||
methods: {
|
||||
close() {
|
||||
this.$emit("close");
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.info {
|
||||
min-height: 30vh;
|
||||
> .title {
|
||||
position: relative;
|
||||
padding: 30rpx 0;
|
||||
text-align: center;
|
||||
> uni-icons {
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
right: 30rpx;
|
||||
transform: translateY(-50%);
|
||||
}
|
||||
}
|
||||
> .block {
|
||||
margin: 20rpx auto 0;
|
||||
width: 700rpx;
|
||||
padding: 30rpx;
|
||||
background: #fff;
|
||||
border-radius: 15rpx;
|
||||
> view {
|
||||
&:nth-of-type(1) {
|
||||
font-size: 33rpx;
|
||||
font-weight: 550;
|
||||
color: #333;
|
||||
}
|
||||
&:nth-of-type(2) {
|
||||
margin-top: 20rpx;
|
||||
font-size: 24rpx;
|
||||
line-height: 38rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -5,13 +5,16 @@
|
||||
<view class="info">
|
||||
<view>
|
||||
<view>{{ siteInfo.siteName }}</view>
|
||||
<view style="opacity: 0">
|
||||
<view @click="$refs.popupInfo.open('bottom')">
|
||||
<text>详情</text>
|
||||
<uni-icons type="right" size="12"></uni-icons>
|
||||
</view>
|
||||
</view>
|
||||
<view>{{ siteInfo.address }}</view>
|
||||
<view>距您{{ siteInfo.juli | distanceFilter }}km</view>
|
||||
<view>
|
||||
<view>油站开票</view>
|
||||
</view>
|
||||
<view class="nav" @click="openMap">
|
||||
<image src="../static/details/nav.png" mode="" />
|
||||
<view>导航</view>
|
||||
@@ -73,7 +76,9 @@
|
||||
>
|
||||
</view>
|
||||
<view class="item">
|
||||
<text @click="serviceIllustrate" class="special">服务费</text>
|
||||
<text class="special" @click="$refs.popupIllustrate.open('bottom')">
|
||||
服务费
|
||||
</text>
|
||||
<text>+¥{{ discountInfo.serviceCharge || "0.00" }}</text>
|
||||
</view>
|
||||
</view>
|
||||
@@ -97,27 +102,25 @@
|
||||
<view class="right" @click="createCOrder">去支付</view>
|
||||
</view>
|
||||
|
||||
<uni-popup
|
||||
ref="popupInfo"
|
||||
background-color="#f6f6f6"
|
||||
borderRadius="20rpx 20rpx 0 0"
|
||||
@touchmove.stop.prevent
|
||||
>
|
||||
<info @close="$refs.popupInfo.close()" />
|
||||
</uni-popup>
|
||||
|
||||
<uni-popup
|
||||
ref="popupIllustrate"
|
||||
background-color="#fff"
|
||||
borderRadius="20rpx 20rpx 0 0"
|
||||
@touchmove.stop.prevent
|
||||
>
|
||||
<view class="illustrate">
|
||||
<view class="title">
|
||||
服务费说明
|
||||
<uni-icons
|
||||
type="closeempty"
|
||||
size="20"
|
||||
@click="$refs.popupIllustrate.close()"
|
||||
/>
|
||||
</view>
|
||||
<view class="text"
|
||||
>服务费为本笔订单优惠金额{{
|
||||
discountInfo.feeRatio * 100 + "%"
|
||||
}},最高不超过7元</view
|
||||
>
|
||||
</view>
|
||||
<illustrate
|
||||
:discountInfo="discountInfo"
|
||||
@close="$refs.popupIllustrate.close()"
|
||||
/>
|
||||
</uni-popup>
|
||||
|
||||
<uni-popup
|
||||
@@ -138,10 +141,15 @@
|
||||
|
||||
<script>
|
||||
import serve from "api/site/details.js";
|
||||
|
||||
import info from "./components/info.vue";
|
||||
import options from "./components/options.vue";
|
||||
import illustrate from "./components/illustrate.vue";
|
||||
export default {
|
||||
components: {
|
||||
info,
|
||||
options,
|
||||
illustrate,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
@@ -201,9 +209,6 @@ export default {
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
serviceIllustrate() {
|
||||
this.$refs.popupIllustrate.open("bottom");
|
||||
},
|
||||
async createCOrder() {
|
||||
let isHas = this.hasLocationAuthHandle(() => {
|
||||
this.getById(this.siteInfo);
|
||||
@@ -228,7 +233,7 @@ export default {
|
||||
this.wxPay(res.data);
|
||||
});
|
||||
},
|
||||
// 定位权限是否开启检测
|
||||
// 检测定位权限是否开启
|
||||
hasLocationAuthHandle(callback = () => {}) {
|
||||
const appInstance = getApp();
|
||||
let { hasLocationAuth } = appInstance.globalData;
|
||||
@@ -253,7 +258,7 @@ export default {
|
||||
}
|
||||
return true;
|
||||
},
|
||||
// 距离检测
|
||||
// 检测距离
|
||||
async beyondDistance() {
|
||||
let { juli, siteName, siteId, id } = this.siteInfo;
|
||||
if (juli > 10000) {
|
||||
@@ -450,26 +455,26 @@ export default {
|
||||
font-weight: 500;
|
||||
}
|
||||
}
|
||||
.illustrate {
|
||||
min-height: 30vh;
|
||||
> .title {
|
||||
position: relative;
|
||||
padding: 30rpx 0;
|
||||
text-align: center;
|
||||
> uni-icons {
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
right: 30rpx;
|
||||
transform: translateY(-50%);
|
||||
}
|
||||
}
|
||||
> .text {
|
||||
padding: 0 20rpx;
|
||||
text-align: center;
|
||||
font-size: 28rpx;
|
||||
color: #999;
|
||||
}
|
||||
}
|
||||
// .illustrate {
|
||||
// min-height: 30vh;
|
||||
// > .title {
|
||||
// position: relative;
|
||||
// padding: 30rpx 0;
|
||||
// text-align: center;
|
||||
// > uni-icons {
|
||||
// position: absolute;
|
||||
// top: 50%;
|
||||
// right: 30rpx;
|
||||
// transform: translateY(-50%);
|
||||
// }
|
||||
// }
|
||||
// > .text {
|
||||
// padding: 0 20rpx;
|
||||
// text-align: center;
|
||||
// font-size: 28rpx;
|
||||
// color: #999;
|
||||
// }
|
||||
// }
|
||||
.container {
|
||||
min-height: 100vh;
|
||||
background: #f6f6f6;
|
||||
@@ -493,6 +498,7 @@ export default {
|
||||
color: #333;
|
||||
}
|
||||
&:nth-of-type(2) {
|
||||
color: #999;
|
||||
font-size: 24rpx;
|
||||
}
|
||||
}
|
||||
@@ -507,6 +513,17 @@ export default {
|
||||
font-size: 25rpx;
|
||||
color: #999;
|
||||
}
|
||||
&:nth-of-type(4) {
|
||||
margin-top: 10rpx;
|
||||
> view {
|
||||
display: inline-block;
|
||||
padding: 3rpx 10rpx;
|
||||
font-size: 18rpx;
|
||||
color: #33333390;
|
||||
border: 1rpx solid #999;
|
||||
border-radius: 6rpx;
|
||||
}
|
||||
}
|
||||
&.nav {
|
||||
position: absolute;
|
||||
bottom: 20rpx;
|
||||
|
||||
@@ -29,20 +29,20 @@
|
||||
@click="jumpDetails(item)"
|
||||
>
|
||||
<view class="left">
|
||||
<view
|
||||
>¥<text>{{ item.sitePrice || 0 }}</text
|
||||
>/L</view
|
||||
>
|
||||
<view>
|
||||
¥
|
||||
<text>{{ item.sitePrice || 0 }}</text>
|
||||
/L
|
||||
</view>
|
||||
<view>油站价¥{{ item.oilSitePrice }}/L</view>
|
||||
</view>
|
||||
<view class="right">
|
||||
<view>{{ item.siteName }}</view>
|
||||
<view>{{ item.address }}</view>
|
||||
<view style="opacity: 1"
|
||||
>加100升约省{{
|
||||
item.oilSitePrice | conserveFilter(item.sitePrice)
|
||||
}}</view
|
||||
>
|
||||
<view style="opacity: 1">
|
||||
加100升约省
|
||||
{{ item.oilSitePrice | conserveFilter(item.sitePrice) }}
|
||||
</view>
|
||||
<view @click.stop="openMap(item)">
|
||||
<image src="/static/index/home/nav.png" mode="" />
|
||||
{{ item.juli | distanceFilter }}km
|
||||
|
||||
@@ -15,25 +15,35 @@ const instance = axios.create({
|
||||
timeout: 10000,
|
||||
});
|
||||
|
||||
let token = "";
|
||||
let unionId = "";
|
||||
let openId = "";
|
||||
|
||||
instance.interceptors.request.use(
|
||||
(config) => {
|
||||
if (!config.HIDELODING) {
|
||||
if (!config.hideLoading) {
|
||||
uni.showLoading({
|
||||
title: "加载中...",
|
||||
});
|
||||
}
|
||||
|
||||
const token = uni.getStorageSync("Authorization");
|
||||
const unionId = uni.getStorageSync("unionid");
|
||||
const openId = uni.getStorageSync("openid");
|
||||
if (!token) {
|
||||
token = uni.getStorageSync("Authorization") || " ";
|
||||
}
|
||||
if (!unionId) {
|
||||
unionId = uni.getStorageSync("unionid") || " ";
|
||||
}
|
||||
if (!openId) {
|
||||
openId = uni.getStorageSync("openid") || " ";
|
||||
}
|
||||
|
||||
config.headers["imei"] = unionId;
|
||||
config.headers["openId"] = openId;
|
||||
config.headers["Authorization"] = token;
|
||||
config.headers["dataSources"] = "MP";
|
||||
config.headers["loginSystem"] = "MINI_APP";
|
||||
config.headers["loginDevice"] = "LOGIN_MP_WECHAT";
|
||||
config.headers["accountSources"] = "LOGIN_MP_WECHAT";
|
||||
config.headers["Authorization"] = token;
|
||||
|
||||
if (env === "production") {
|
||||
const JSESSIONID = utils.uuid();
|
||||
|
||||
Reference in New Issue
Block a user