From 93833a064f5297d4965b54c1eacb7ae924978c9d Mon Sep 17 00:00:00 2001
From: Wik-T <812952667@qq.com>
Date: Fri, 13 May 2022 17:54:54 +0800
Subject: [PATCH] =?UTF-8?q?1.=E4=BF=AE=E6=94=B9=E5=9B=A2=E6=B2=B9=E8=AE=A1?=
=?UTF-8?q?=E7=AE=97=E4=BB=B7=E6=A0=BC=202.=E6=96=B0=E5=A2=9E=E4=BB=B7?=
=?UTF-8?q?=E6=A0=BC=E8=AF=A6=E6=83=85?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
Utils/Api.js | 10 ++-
Utils/Request.js | 36 ++++++---
pages/goods/refuel-confirm/refuel-confirm.vue | 68 ++++++++++++++--
pages/goods/refuel-details/refuel-details.vue | 75 ++++++++++++++----
pages/login/register.vue | 2 +-
pages/tabBar/home/home.vue | 36 +++++----
pages/tabBar/user/user.vue | 69 +++++++++++++++-
static/img/exit.png | Bin 0 -> 1447 bytes
8 files changed, 242 insertions(+), 54 deletions(-)
create mode 100644 static/img/exit.png
diff --git a/Utils/Api.js b/Utils/Api.js
index 9a2d370..7d3a91a 100644
--- a/Utils/Api.js
+++ b/Utils/Api.js
@@ -43,7 +43,11 @@ export const loginByPhone = params => {
//微信登录
export const WXlogin = params => {
return POST('GET', `${base}/wechat/login`, params).then(res => res.data);
-};
+};
+//H5 退出登录
+export const loginOut = params => {
+ return POST('GET', `${base}/user/loginOut`, params).then(res => res.data);
+};
//通过openid获取用户的信息
export const OpenidGetUser = (openId, params) => {
return POST('GET', `${base}/User/openid/${openId}`, params).then(res => res.data);
@@ -189,6 +193,10 @@ export const getDictionaryByCodeTypeOl = params => {
export const oilPriceCompute = params => {
return POST('GET', `${base}/highGas/oilPriceCompute`, params).then(res => res.data);
}
+//团油计算新价格
+export const oilPriceDiscountCompute = params => {
+ return POST('GET', `${base}/highGas/oilPriceDiscountCompute`, params).then(res => res.data);
+}
//查询卡数据字典
export const getDictionaryByCodeType = params => {
return POST('GET', `${base}/common/getDictionaryByCodeType`, params).then(res => res.data);
diff --git a/Utils/Request.js b/Utils/Request.js
index fa5dd7f..eae7132 100644
--- a/Utils/Request.js
+++ b/Utils/Request.js
@@ -24,26 +24,36 @@ function request(method, url, data) {
uni.setStorage({
key: "token",
data: ''
- })
+ })
+ // #ifdef H5
+ uni.showToast({
+ title: '当前登录信息失效,请前往登录',
+ icon: 'none',
+ duration: 2000,
+ success() {
+ setTimeout(() => {
+ uni.navigateTo({
+ url: '/pages/login/register'
+ })
+
+ }, 1500);
+ }
+ })
+ // #endif
+ // #ifdef MP
uni.showToast({
title: '登录信息过期,请重新授权',
icon: 'none',
duration: 2000,
success() {
- setTimeout(() => {
- // #ifdef H5
- uni.navigateTo({
- url:'/pages/login/register'
- })
- // #endif
- // #ifdef MP
- uni.navigateTo({
- url: '/pages/userLogin/userLogin'
- })
- // #endif
- }, 800);
+ setTimeout(() => {
+ uni.navigateTo({
+ url: '/pages/userLogin/userLogin'
+ })
+ }, 1500);
}
})
+ // #endif
}
},
fail(err) {
diff --git a/pages/goods/refuel-confirm/refuel-confirm.vue b/pages/goods/refuel-confirm/refuel-confirm.vue
index 5b94238..4835493 100644
--- a/pages/goods/refuel-confirm/refuel-confirm.vue
+++ b/pages/goods/refuel-confirm/refuel-confirm.vue
@@ -6,7 +6,7 @@
{{orderList.goodsName}}
{{refulAdress}}
- ¥{{orderList.ext1}}
+ ¥{{orderList.gasPricePreferences}}
¥{{orderList.gasPriceGun}}
@@ -28,10 +28,64 @@
加油金额
- {{orderList.totalPrice}}
+ ¥{{orderList.totalPrice}}
+
+
+
+
+
+
+ 加油升数
+
+
+ {{orderList.gasOilLiters}}L
+
+
+
+
+
+ 平台折扣
+
+
+ {{orderList.gasDiscount}}折
+
+
+
+
+
+ 每升优惠
+
+
+ ¥{{orderList.gasLitersPreferences}}
+
+
+
+
+
+ 加油补贴(升)
+
+
+ ¥{{orderList.gasOilSubsidy}}
+
+
+
+
+
+ 优惠价格
+
+
+ ¥{{orderList.gasPricePreferences}}
+
+
+
+
+
+ 本次优惠
+
+
+ ¥{{deductionPrice}}
-
支付方式
@@ -113,7 +167,7 @@
getHuiLianTongCardBalance,
hltUnionCardPay,
orderToGoldPay,
- findUser,
+ findUser,
oilCardPay
} from '../../../Utils/Api.js';
import ssPaymentPassword from '../../../components/sanshui-payment-password/index.vue';
@@ -136,7 +190,8 @@
oilPirce: 0, //油卡余额
user: '',
paytype: '',
- PaymentPassword: '',
+ PaymentPassword: '',
+ deductionPrice:'0'//本次优惠金额
}
},
onLoad(e) {
@@ -320,7 +375,8 @@
getOrderById(params).then(res => {
uni.hideLoading();
if (res.return_code == '000000') {
- this.orderList = res.return_data.highChildOrderList[0];
+ this.orderList = res.return_data.highChildOrderList[0];
+ this.deductionPrice = res.return_data.deductionPrice;
}
})
},
diff --git a/pages/goods/refuel-details/refuel-details.vue b/pages/goods/refuel-details/refuel-details.vue
index be36e9d..7b619a9 100644
--- a/pages/goods/refuel-details/refuel-details.vue
+++ b/pages/goods/refuel-details/refuel-details.vue
@@ -66,12 +66,33 @@
¥
+ @input="Listeningfocus" />
- 约{{litre}}L
+ 约{{oilLiters}}L
+
+
+
+ 加油升数:
+ {{oilLiters}}L
+ 平台折扣:
+ {{discount}}折
+
+
+ 优惠价格:
+ ¥{{pricePreferences}}
+ 加油补贴:
+ ¥{{oilSubsidy}}
+
+
+ 每升优惠:
+ ¥{{litersPreferences}}
+ 本次优惠:
+ ¥{{totalPreferences}}
+
+
-
@@ -125,7 +145,7 @@
getGasDetailByStoreKey,
addOrder,
getDictionaryByCodeTypeOl,
- oilPriceCompute
+ oilPriceDiscountCompute
} from '../../../Utils/Api.js';
import wybPopup from '../../../components/wyb-popup/wyb-popup.vue';
let app = getApp();
@@ -179,7 +199,14 @@
oilType: '',
distance: 9999, //距离限制
xzMoney: '300', //金额限制
- isTyAgent: false //是否是代理商
+ isTyAgent: false, //是否是代理商
+ oilLiters: '0', //加油升数
+ discount: '0', //平台折扣
+ oilSubsidy: '0', //加油补贴
+ litersPreferences: '0', //每升优惠
+ pricePreferences: '0', //优惠价格
+ totalPreferences: '0', //本次优惠
+
}
},
onLoad(options) {
@@ -292,9 +319,9 @@
this.gasOilNo = item.oilNo;
this.priceVip = item.priceVip;
this.priceOfficial = item.priceOfficial;
- this.priceGun = item.priceGun;
- this.totalPrice = '0.00';
- this.discountPrice = '0.00';
+ this.priceGun = item.priceGun;
+ this.totalPrice = '0.00';
+ this.discountPrice = '0.00';
this.inputMoney = '';
this.$refs.popup.hide();
},
@@ -332,7 +359,13 @@
this.totalPrice = '0.00';
this.discountPrice = '0.00';
this.litre = '';
- this.inputMoney = '';
+ this.inputMoney = '';
+ this.oilLiters = '0';
+ this.discount = '0';
+ this.oilSubsidy = '0';
+ this.litersPreferences = '0';
+ this.pricePreferences = '0';
+ this.totalPreferences = '0';
return;
}
@@ -356,10 +389,10 @@
}
//原来计算方式
- this.litre = parseFloat(this.inputMoney / this.priceGun).toFixed(2);
+ // this.litre = parseFloat(this.inputMoney / this.priceGun).toFixed(2);
// var arr1 = parseFloat(this.inputMoney / this.priceOfficial * this.priceVip).toFixed(4);
// this.totalPrice = this.numFilter(arr1);
- this.oilPriceCompute();
+ this.oilPriceDiscountCompute();
//目前计算方式
// this.litre = parseFloat(this.inputMoney / this.priceGun).toFixed(2);
// this.totalPrice = parseFloat(this.inputMoney / this.priceGun * this.priceVip).toFixed(2);
@@ -369,21 +402,35 @@
// }
},
//计算价格
- oilPriceCompute() {
+ oilPriceDiscountCompute() {
let datas = {
"price": this.inputMoney,
"goodsId": this.counId,
"oilNo": this.gasOilNo,
"isTyAgent": this.isTyAgent
}
- oilPriceCompute(datas).then(res => {
+ oilPriceDiscountCompute(datas).then(res => {
if (res.return_code == '000000') {
- this.totalPrice = res.return_data;
+ this.totalPrice = res.return_data.payPrice;
+ this.oilLiters = res.return_data.oilLiters;
+ this.discount = res.return_data.discount;
+ this.oilSubsidy = res.return_data.oilSubsidy;
+ this.litersPreferences = res.return_data.litersPreferences;
+ this.pricePreferences = res.return_data.pricePreferences;
+ this.totalPreferences = res.return_data.totalPreferences;
if (this.priceVip != this.priceOfficial) {
// let gbprice = parseFloat(this.litre * this.priceOfficial).toFixed(2);
// this.discountPrice = parseFloat(gbprice - this.totalPrice).toFixed(2);
this.discountPrice = parseFloat(this.inputMoney - this.totalPrice).toFixed(2);
}
+ } else {
+ this.totalPrice = '0';
+ this.oilLiters = '0';
+ this.discount = '0';
+ this.oilSubsidy = '0';
+ this.litersPreferences = '0';
+ this.pricePreferences = '0';
+ this.totalPreferences = '0';
}
})
},
diff --git a/pages/login/register.vue b/pages/login/register.vue
index e3013b5..9d127a8 100644
--- a/pages/login/register.vue
+++ b/pages/login/register.vue
@@ -15,7 +15,7 @@
- 立即注册
+ 立即登录/注册
diff --git a/pages/tabBar/home/home.vue b/pages/tabBar/home/home.vue
index 49b0707..8b9134c 100644
--- a/pages/tabBar/home/home.vue
+++ b/pages/tabBar/home/home.vue
@@ -381,15 +381,17 @@
that.city = res.data.result.address_component.province;
app.globalData.cityName = res.data.result.address_component
.province;
- app.globalData.cityId = res.data.result.ad_info.adcode;
- // app.globalData.cityId = '500100';
- that.getCouponListArea();
- that.getCouponListgold();
+ app.globalData.cityId = res.data.result.ad_info.adcode;
uni.hideLoading();
- that.getCmsContent();
- that.getCmsAactibity();
- that.getCmsContentcmshome();
- that.getCmsContentcmsContent();
+ if (res.data.result.ad_info.adcode) {
+ that.getCouponListArea();
+ that.getCouponListgold();
+ that.getCmsContent();
+ that.getCmsAactibity();
+ that.getCmsContentcmshome();
+ that.getCmsContentcmsContent();
+ }
+
},
fail(err) {
uni.hideLoading()
@@ -466,19 +468,21 @@
// vm.getCouponListArea();
// vm.getCouponListgold();
// uni.hideLoading()
-
uni.hideLoading();
that.city = res.result.address_component.city;
app.globalData.cityName = res.result.address_component
.city;
app.globalData.cityId = res.result.ad_info.adcode;
- // app.globalData.cityId = '500100';
- that.getCouponListArea();
- that.getCouponListgold();
- that.getCmsContent();
- that.getCmsAactibity();
- that.getCmsContentcmshome();
- that.getCmsContentcmsContent();
+ if (res.result.ad_info.adcode) {
+ // app.globalData.cityId = '500100';
+ that.getCouponListArea();
+ that.getCouponListgold();
+ that.getCmsContent();
+ that.getCmsAactibity();
+ that.getCmsContentcmshome();
+ that.getCmsContentcmsContent();
+ }
+
})
.catch(err => {
uni.hideLoading()
diff --git a/pages/tabBar/user/user.vue b/pages/tabBar/user/user.vue
index 962cd03..d60da92 100644
--- a/pages/tabBar/user/user.vue
+++ b/pages/tabBar/user/user.vue
@@ -138,7 +138,8 @@