1.修改团油计算价格

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

@ -44,6 +44,10 @@ 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);

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

@ -6,7 +6,7 @@
<view class="conCont paddtop15">
<view class="font20 fontwig6 fcor333 text1 paddtright10">{{orderList.goodsName}}</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>
</view>
</view>
@ -28,10 +28,64 @@
加油金额
</view>
<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 class="mart10 heightl60 paddleft10 fcor333 fontwig6 font18 width100 backcorfff">支付方式</view>
<view class="line1"></view>
@ -137,6 +191,7 @@
user: '',
paytype: '',
PaymentPassword: '',
deductionPrice:'0'//
}
},
onLoad(e) {
@ -321,6 +376,7 @@
uni.hideLoading();
if (res.return_code == '000000') {
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="width8 flleft"></view>
<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"
style="border-left: 1px solid #f2f2f2;line-height: 40px;">
{{litre}}L
{{oilLiters}}L
</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="box" v-for="(amount,index) in amountList" :key="index" @click="select(amount)"
: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-else @click="postionIng">去支付</button>
<!-- #endif -->
</view>
<!-- 底部弹窗 -->
<wybPopup ref="popup" type="bottom" height="600" width="500" radius="6" :showCloseIcon="true">
@ -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) {
@ -333,6 +360,12 @@
this.discountPrice = '0.00';
this.litre = '';
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';
}
})
},

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

@ -382,14 +382,16 @@
app.globalData.cityName = res.data.result.address_component
.province;
app.globalData.cityId = res.data.result.ad_info.adcode;
// app.globalData.cityId = '500100';
uni.hideLoading();
if (res.data.result.ad_info.adcode) {
that.getCouponListArea();
that.getCouponListgold();
uni.hideLoading();
that.getCmsContent();
that.getCmsAactibity();
that.getCmsContentcmshome();
that.getCmsContentcmsContent();
}
},
fail(err) {
uni.hideLoading()
@ -466,12 +468,12 @@
// 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;
if (res.result.ad_info.adcode) {
// app.globalData.cityId = '500100';
that.getCouponListArea();
that.getCouponListgold();
@ -479,6 +481,8 @@
that.getCmsAactibity();
that.getCmsContentcmshome();
that.getCmsContentcmsContent();
}
})
.catch(err => {
uni.hideLoading()

@ -138,7 +138,8 @@
<script>
import {
loginByPhone,
findUser
findUser,
loginOut
} from "../../../Utils/Api.js";
// import authorize from '../../../components/Authorize';
import uniBadge from "../../../components/uni-badge/components/uni-badge/uni-badge.vue";
@ -286,7 +287,7 @@
if (app.globalData.userInfo) {
this.findUser();
}
// #ifdef MP
if (!app.globalData.userInfo.isSetPayPwd) {
this.czList = [{
url: '../../../subPages/cardsList/cardsList',
@ -297,11 +298,42 @@
url: '../../login/updatePas/updatePas',
text: '设置密码',
img: '../../../static/img/pas.png'
},
}
]
return;
}
// '../../user/unionCard/unionCard'
this.czList = [{
url: '../../../subPages/cardsList/cardsList',
text: '卡包',
img: '../../../static/img/ghkpay.png'
},
{
url: '../../login/updatePas/resetPas',
text: '修改密码',
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: '卡包',
@ -312,7 +344,13 @@
text: '修改密码',
img: '../../../static/img/pas.png'
},
{
url: '',
text: '退出登录',
img: '../../../static/img/exit.png'
}
]
// #endif
},
methods: {
findUser() {
@ -452,6 +490,31 @@
})
}
// #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