1.修改团油计算价格

2.新增价格详情
yj-dev
杨杰 3 years ago
parent 4c43b91787
commit 93833a064f
  1. 10
      Utils/Api.js
  2. 36
      Utils/Request.js
  3. 68
      pages/goods/refuel-confirm/refuel-confirm.vue
  4. 75
      pages/goods/refuel-details/refuel-details.vue
  5. 2
      pages/login/register.vue
  6. 36
      pages/tabBar/home/home.vue
  7. 69
      pages/tabBar/user/user.vue
  8. BIN
      static/img/exit.png

@ -43,7 +43,11 @@ export const loginByPhone = params => {
//微信登录 //微信登录
export const WXlogin = params => { export const WXlogin = params => {
return POST('GET', `${base}/wechat/login`, params).then(res => res.data); 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获取用户的信息 //通过openid获取用户的信息
export const OpenidGetUser = (openId, params) => { export const OpenidGetUser = (openId, params) => {
return POST('GET', `${base}/User/openid/${openId}`, params).then(res => res.data); return POST('GET', `${base}/User/openid/${openId}`, params).then(res => res.data);
@ -189,6 +193,10 @@ export const getDictionaryByCodeTypeOl = params => {
export const oilPriceCompute = params => { export const oilPriceCompute = params => {
return POST('GET', `${base}/highGas/oilPriceCompute`, params).then(res => res.data); 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 => { export const getDictionaryByCodeType = params => {
return POST('GET', `${base}/common/getDictionaryByCodeType`, params).then(res => res.data); return POST('GET', `${base}/common/getDictionaryByCodeType`, params).then(res => res.data);

@ -24,26 +24,36 @@ function request(method, url, data) {
uni.setStorage({ uni.setStorage({
key: "token", key: "token",
data: '' data: ''
}) })
// #ifdef H5
uni.showToast({
title: '当前登录信息失效,请前往登录',
icon: 'none',
duration: 2000,
success() {
setTimeout(() => {
uni.navigateTo({
url: '/pages/login/register'
})
}, 1500);
}
})
// #endif
// #ifdef MP
uni.showToast({ uni.showToast({
title: '登录信息过期,请重新授权', title: '登录信息过期,请重新授权',
icon: 'none', icon: 'none',
duration: 2000, duration: 2000,
success() { success() {
setTimeout(() => { setTimeout(() => {
// #ifdef H5 uni.navigateTo({
uni.navigateTo({ url: '/pages/userLogin/userLogin'
url:'/pages/login/register' })
}) }, 1500);
// #endif
// #ifdef MP
uni.navigateTo({
url: '/pages/userLogin/userLogin'
})
// #endif
}, 800);
} }
}) })
// #endif
} }
}, },
fail(err) { fail(err) {

@ -6,7 +6,7 @@
<view class="conCont paddtop15"> <view class="conCont paddtop15">
<view class="font20 fontwig6 fcor333 text1 paddtright10">{{orderList.goodsName}}</view> <view class="font20 fontwig6 fcor333 text1 paddtright10">{{orderList.goodsName}}</view>
<view class="font14 fcor999 text2 paddtop5 paddtright10">{{refulAdress}}</view> <view class="font14 fcor999 text2 paddtop5 paddtright10">{{refulAdress}}</view>
<view class="font20 fontwig6 fcoreb5 paddtop5">{{orderList.ext1}} <view class="font20 fontwig6 fcoreb5 paddtop5">{{orderList.gasPricePreferences}}
<text class="margle10 slogan font14">{{orderList.gasPriceGun}}</text> <text class="margle10 slogan font14">{{orderList.gasPriceGun}}</text>
</view> </view>
</view> </view>
@ -28,10 +28,64 @@
加油金额 加油金额
</view> </view>
<view class="flright width40 fotct"> <view class="flright width40 fotct">
{{orderList.totalPrice}} ¥{{orderList.totalPrice}}
</view>
</view>
<!-- 新增 -->
<view class="line1"></view>
<view class="heightl60 paddleft10 fcor666 font16 width100 backcorfff">
<view class="flleft width50">
加油升数
</view>
<view class="flright width40 fotct">
{{orderList.gasOilLiters}}L
</view>
</view>
<view class="line1"></view>
<view class="heightl60 paddleft10 fcor666 font16 width100 backcorfff">
<view class="flleft width50">
平台折扣
</view>
<view class="flright width40 fotct">
{{orderList.gasDiscount}}
</view>
</view>
<view class="line1"></view>
<view class="heightl60 paddleft10 fcor666 font16 width100 backcorfff">
<view class="flleft width50">
每升优惠
</view>
<view class="flright width40 fotct">
¥{{orderList.gasLitersPreferences}}
</view>
</view>
<view class="line1"></view>
<view class="heightl60 paddleft10 fcor666 font16 width100 backcorfff">
<view class="flleft width50">
加油补贴()
</view>
<view class="flright width40 fotct">
¥{{orderList.gasOilSubsidy}}
</view>
</view>
<view class="line1"></view>
<view class="heightl60 paddleft10 fcor666 font16 width100 backcorfff">
<view class="flleft width50">
优惠价格
</view>
<view class="flright width40 fotct">
¥{{orderList.gasPricePreferences}}
</view>
</view>
<view class="line1"></view>
<view class="heightl60 paddleft10 fcor666 font16 width100 backcorfff">
<view class="flleft width50">
本次优惠
</view>
<view class="flright width40 fotct">
¥{{deductionPrice}}
</view> </view>
</view> </view>
<!-- // --> <!-- // -->
<view class="mart10 heightl60 paddleft10 fcor333 fontwig6 font18 width100 backcorfff">支付方式</view> <view class="mart10 heightl60 paddleft10 fcor333 fontwig6 font18 width100 backcorfff">支付方式</view>
<view class="line1"></view> <view class="line1"></view>
@ -113,7 +167,7 @@
getHuiLianTongCardBalance, getHuiLianTongCardBalance,
hltUnionCardPay, hltUnionCardPay,
orderToGoldPay, orderToGoldPay,
findUser, findUser,
oilCardPay oilCardPay
} from '../../../Utils/Api.js'; } from '../../../Utils/Api.js';
import ssPaymentPassword from '../../../components/sanshui-payment-password/index.vue'; import ssPaymentPassword from '../../../components/sanshui-payment-password/index.vue';
@ -136,7 +190,8 @@
oilPirce: 0, // oilPirce: 0, //
user: '', user: '',
paytype: '', paytype: '',
PaymentPassword: '', PaymentPassword: '',
deductionPrice:'0'//
} }
}, },
onLoad(e) { onLoad(e) {
@ -320,7 +375,8 @@
getOrderById(params).then(res => { getOrderById(params).then(res => {
uni.hideLoading(); uni.hideLoading();
if (res.return_code == '000000') { 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;
} }
}) })
}, },

@ -66,12 +66,33 @@
<view class="width90 height40 mart10" style="border: 1px solid #f2f2f2;"> <view class="width90 height40 mart10" style="border: 1px solid #f2f2f2;">
<view class="width8 flleft"></view> <view class="width8 flleft"></view>
<input type="digit" class="font16 width60 flleft height40" placeholder="输入金额(保留2位小数)" v-model="inputMoney" <input type="digit" class="font16 width60 flleft height40" placeholder="输入金额(保留2位小数)" v-model="inputMoney"
@blur="Listeningfocus" /> @input="Listeningfocus" />
<view class="width30 height40 flright font14 fcor999 fotct" <view class="width30 height40 flright font14 fcor999 fotct"
style="border-left: 1px solid #f2f2f2;line-height: 40px;"> style="border-left: 1px solid #f2f2f2;line-height: 40px;">
{{litre}}L {{oilLiters}}L
</view> </view>
</view> </view>
<!-- 详情描述-->
<view class="line10 mart15"></view>
<view class="width90 height40 mart10">
<view class="flleft width50 font15 fcor666">加油升数:<text class="fcoreb5 margle">
{{oilLiters}}L</text></view>
<view class="flright width50 font15 fcor666">平台折扣:<text class="fcoreb5 margle">
{{discount}}</text></view>
</view>
<view class="width90 height40">
<view class="flleft width50 font15 fcor666">优惠价格:<text class="fcoreb5 margle">
¥{{pricePreferences}}</text></view>
<view class="flright width50 font15 fcor666">加油补贴:<text class="fcoreb5 margle">
¥{{oilSubsidy}}</text></view>
</view>
<view class="width90 height40">
<view class="flleft width50 font15 fcor666">每升优惠:<text class="fcoreb5 margle">
¥{{litersPreferences}}</text></view>
<view class="flright width50 font15 fcor666">本次优惠:<text class="fcoreb5 margle">
¥{{totalPreferences}}</text></view>
</view>
<view class="line10 mart15"></view>
<!-- <view class="list width90"> <!-- <view class="list width90">
<view class="box" v-for="(amount,index) in amountList" :key="index" @click="select(amount)" <view class="box" v-for="(amount,index) in amountList" :key="index" @click="select(amount)"
:class="{'on':amount.price == inputMoney}"> :class="{'on':amount.price == inputMoney}">
@ -94,7 +115,6 @@
<button class="reBtn flright" v-if="user.phone == null" @click="jumpH5Bding">去支付</button> <button class="reBtn flright" v-if="user.phone == null" @click="jumpH5Bding">去支付</button>
<button class="reBtn flright" v-else @click="postionIng">去支付</button> <button class="reBtn flright" v-else @click="postionIng">去支付</button>
<!-- #endif --> <!-- #endif -->
</view> </view>
<!-- 底部弹窗 --> <!-- 底部弹窗 -->
<wybPopup ref="popup" type="bottom" height="600" width="500" radius="6" :showCloseIcon="true"> <wybPopup ref="popup" type="bottom" height="600" width="500" radius="6" :showCloseIcon="true">
@ -125,7 +145,7 @@
getGasDetailByStoreKey, getGasDetailByStoreKey,
addOrder, addOrder,
getDictionaryByCodeTypeOl, getDictionaryByCodeTypeOl,
oilPriceCompute oilPriceDiscountCompute
} from '../../../Utils/Api.js'; } from '../../../Utils/Api.js';
import wybPopup from '../../../components/wyb-popup/wyb-popup.vue'; import wybPopup from '../../../components/wyb-popup/wyb-popup.vue';
let app = getApp(); let app = getApp();
@ -179,7 +199,14 @@
oilType: '', oilType: '',
distance: 9999, // distance: 9999, //
xzMoney: '300', // xzMoney: '300', //
isTyAgent: false // isTyAgent: false, //
oilLiters: '0', //
discount: '0', //
oilSubsidy: '0', //
litersPreferences: '0', //
pricePreferences: '0', //
totalPreferences: '0', //
} }
}, },
onLoad(options) { onLoad(options) {
@ -292,9 +319,9 @@
this.gasOilNo = item.oilNo; this.gasOilNo = item.oilNo;
this.priceVip = item.priceVip; this.priceVip = item.priceVip;
this.priceOfficial = item.priceOfficial; this.priceOfficial = item.priceOfficial;
this.priceGun = item.priceGun; this.priceGun = item.priceGun;
this.totalPrice = '0.00'; this.totalPrice = '0.00';
this.discountPrice = '0.00'; this.discountPrice = '0.00';
this.inputMoney = ''; this.inputMoney = '';
this.$refs.popup.hide(); this.$refs.popup.hide();
}, },
@ -332,7 +359,13 @@
this.totalPrice = '0.00'; this.totalPrice = '0.00';
this.discountPrice = '0.00'; this.discountPrice = '0.00';
this.litre = ''; 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; 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); // var arr1 = parseFloat(this.inputMoney / this.priceOfficial * this.priceVip).toFixed(4);
// this.totalPrice = this.numFilter(arr1); // this.totalPrice = this.numFilter(arr1);
this.oilPriceCompute(); this.oilPriceDiscountCompute();
// //
// this.litre = parseFloat(this.inputMoney / this.priceGun).toFixed(2); // this.litre = parseFloat(this.inputMoney / this.priceGun).toFixed(2);
// this.totalPrice = parseFloat(this.inputMoney / this.priceGun * this.priceVip).toFixed(2); // this.totalPrice = parseFloat(this.inputMoney / this.priceGun * this.priceVip).toFixed(2);
@ -369,21 +402,35 @@
// } // }
}, },
// //
oilPriceCompute() { oilPriceDiscountCompute() {
let datas = { let datas = {
"price": this.inputMoney, "price": this.inputMoney,
"goodsId": this.counId, "goodsId": this.counId,
"oilNo": this.gasOilNo, "oilNo": this.gasOilNo,
"isTyAgent": this.isTyAgent "isTyAgent": this.isTyAgent
} }
oilPriceCompute(datas).then(res => { oilPriceDiscountCompute(datas).then(res => {
if (res.return_code == '000000') { 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) { if (this.priceVip != this.priceOfficial) {
// let gbprice = parseFloat(this.litre * this.priceOfficial).toFixed(2); // let gbprice = parseFloat(this.litre * this.priceOfficial).toFixed(2);
// this.discountPrice = parseFloat(gbprice - this.totalPrice).toFixed(2); // this.discountPrice = parseFloat(gbprice - this.totalPrice).toFixed(2);
this.discountPrice = parseFloat(this.inputMoney - 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';
} }
}) })
}, },

@ -15,7 +15,7 @@
<view class="code"> <view class="code">
<input placeholder="请输入验证码" v-model="code" placeholder-style="color: #676767;" /> <input placeholder="请输入验证码" v-model="code" placeholder-style="color: #676767;" />
</view> </view>
<view class="btn mart50" @tap="doReg">立即注册</view> <view class="btn mart50" @tap="doReg">立即登录/注册</view>
</view> </view>
</view> </view>

@ -381,15 +381,17 @@
that.city = res.data.result.address_component.province; that.city = res.data.result.address_component.province;
app.globalData.cityName = res.data.result.address_component app.globalData.cityName = res.data.result.address_component
.province; .province;
app.globalData.cityId = res.data.result.ad_info.adcode; app.globalData.cityId = res.data.result.ad_info.adcode;
// app.globalData.cityId = '500100';
that.getCouponListArea();
that.getCouponListgold();
uni.hideLoading(); uni.hideLoading();
that.getCmsContent(); if (res.data.result.ad_info.adcode) {
that.getCmsAactibity(); that.getCouponListArea();
that.getCmsContentcmshome(); that.getCouponListgold();
that.getCmsContentcmsContent(); that.getCmsContent();
that.getCmsAactibity();
that.getCmsContentcmshome();
that.getCmsContentcmsContent();
}
}, },
fail(err) { fail(err) {
uni.hideLoading() uni.hideLoading()
@ -466,19 +468,21 @@
// vm.getCouponListArea(); // vm.getCouponListArea();
// vm.getCouponListgold(); // vm.getCouponListgold();
// uni.hideLoading() // uni.hideLoading()
uni.hideLoading(); uni.hideLoading();
that.city = res.result.address_component.city; that.city = res.result.address_component.city;
app.globalData.cityName = res.result.address_component app.globalData.cityName = res.result.address_component
.city; .city;
app.globalData.cityId = res.result.ad_info.adcode; app.globalData.cityId = res.result.ad_info.adcode;
// app.globalData.cityId = '500100'; if (res.result.ad_info.adcode) {
that.getCouponListArea(); // app.globalData.cityId = '500100';
that.getCouponListgold(); that.getCouponListArea();
that.getCmsContent(); that.getCouponListgold();
that.getCmsAactibity(); that.getCmsContent();
that.getCmsContentcmshome(); that.getCmsAactibity();
that.getCmsContentcmsContent(); that.getCmsContentcmshome();
that.getCmsContentcmsContent();
}
}) })
.catch(err => { .catch(err => {
uni.hideLoading() uni.hideLoading()

@ -138,7 +138,8 @@
<script> <script>
import { import {
loginByPhone, loginByPhone,
findUser findUser,
loginOut
} from "../../../Utils/Api.js"; } from "../../../Utils/Api.js";
// import authorize from '../../../components/Authorize'; // import authorize from '../../../components/Authorize';
import uniBadge from "../../../components/uni-badge/components/uni-badge/uni-badge.vue"; import uniBadge from "../../../components/uni-badge/components/uni-badge/uni-badge.vue";
@ -286,7 +287,7 @@
if (app.globalData.userInfo) { if (app.globalData.userInfo) {
this.findUser(); this.findUser();
} }
// #ifdef MP
if (!app.globalData.userInfo.isSetPayPwd) { if (!app.globalData.userInfo.isSetPayPwd) {
this.czList = [{ this.czList = [{
url: '../../../subPages/cardsList/cardsList', url: '../../../subPages/cardsList/cardsList',
@ -297,7 +298,7 @@
url: '../../login/updatePas/updatePas', url: '../../login/updatePas/updatePas',
text: '设置密码', text: '设置密码',
img: '../../../static/img/pas.png' img: '../../../static/img/pas.png'
}, }
] ]
return; return;
} }
@ -311,8 +312,45 @@
url: '../../login/updatePas/resetPas', url: '../../login/updatePas/resetPas',
text: '修改密码', text: '修改密码',
img: '../../../static/img/pas.png' img: '../../../static/img/pas.png'
}
]
// #endif
// #ifdef H5
if (!app.globalData.userInfo.isSetPayPwd) {
this.czList = [{
url: '../../../subPages/cardsList/cardsList',
text: '卡包',
img: '../../../static/img/ghkpay.png'
},
{
url: '../../login/updatePas/updatePas',
text: '设置密码',
img: '../../../static/img/pas.png'
}, {
url: '',
text: '退出登录',
img: '../../../static/img/exit.png'
},
]
return;
}
this.czList = [{
url: '../../../subPages/cardsList/cardsList',
text: '卡包',
img: '../../../static/img/ghkpay.png'
}, },
{
url: '../../login/updatePas/resetPas',
text: '修改密码',
img: '../../../static/img/pas.png'
},
{
url: '',
text: '退出登录',
img: '../../../static/img/exit.png'
}
] ]
// #endif
}, },
methods: { methods: {
findUser() { findUser() {
@ -452,6 +490,31 @@
}) })
} }
// #endif // #endif
if (item == '退出登录') {
uni.showModal({
title: '退出登录',
content: '是否退出当前账号',
success: function(res) {
if (res.confirm) {
loginOut().then(res => {
if (res.return_code == '000000') {
app.globalData.userInfo = '';
app.globalData.token = '';
uni.setStorage({
key: "user",
data: ''
})
uni.setStorage({
key: "token",
data: ''
})
location.reload();
}
});
}
}
})
}
} }
} }
} }

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Loading…
Cancel
Save