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