oil-station/gasStation-uni/pagesRefuel/orderDetail/index.vue

1068 lines
33 KiB
Vue
Raw Normal View History

2023-12-01 15:47:01 +08:00
<template>
<!-- 订单详情页 -->
<view class="content">
<view class="container">
<view class="my-header">
<view class="my-icons" @click="goBack"> <uni-icons type="left" size="16"></uni-icons> </view>
<view class="my-text">支付订单</view>
<view class="my-icons"></view>
</view>
<!-- 顶部区域 -->
<view style="background-color: white;width: 94%;margin: 15px auto;">
2023-12-01 16:40:20 +08:00
<view style="font-weight: bold;height: 40px;line-height: 40px;margin-left: 10px;margin-top: 20px;">订单详情
</view>
2023-12-01 15:47:01 +08:00
<view class="desc">
<view>油站名称</view>
2024-01-20 11:48:52 +08:00
<!-- <view>{{store.name}}{{store.description ? "("+store.description+")" : ""}}</view> -->
<view>{{oilOrder.storeName}}{{oilOrder.description ? "("+oilOrder.description+")" : ""}}</view>
2023-12-01 15:47:01 +08:00
</view>
<view class="desc">
<view>油号油枪</view>
2024-01-20 11:48:52 +08:00
<view>{{oilOrder.oilName}}/{{oilOrder.gunName}}</view>
2023-12-01 15:47:01 +08:00
</view>
<view class="desc">
<view>加油金额</view>
2023-12-27 18:44:56 +08:00
<view>{{oilOrder.orderAmount}}</view>
2023-12-01 15:47:01 +08:00
</view>
<view class="desc">
<view>加油数量</view>
2023-12-27 18:44:56 +08:00
<view>{{oilOrder.oilNum}}</view>
2023-12-01 15:47:01 +08:00
</view>
<view class="desc">
<view>油品单价</view>
2023-12-26 18:44:50 +08:00
<view>{{oilPrice}}/L</view>
2023-12-01 15:47:01 +08:00
</view>
2024-06-06 17:07:52 +08:00
<!-- <view class="desc">
2023-12-01 15:47:01 +08:00
<view>加油员工</view>
2024-01-31 17:05:12 +08:00
<view>{{oilOrder.realName || "--"}}</view>
2024-06-06 17:07:52 +08:00
</view> -->
2023-12-01 15:47:01 +08:00
</view>
2023-12-01 16:40:20 +08:00
2024-02-20 11:00:47 +08:00
<view style="background-color: white;width: 94%;margin: 15px auto;" v-if="AppToken">
2024-04-09 09:23:11 +08:00
2024-01-17 14:14:19 +08:00
<view class="desc">
2023-12-04 16:35:09 +08:00
<view style="display: flex;">
2024-01-16 16:10:03 +08:00
储值卡
2024-04-09 09:23:11 +08:00
<span style="display: flex;">(<span
v-if="isUseChildCard">主卡</span>余额{{user.cardBalance}})</span>
2023-12-04 16:35:09 +08:00
</view>
<view style="display: flex;">
2024-01-16 16:10:03 +08:00
<span style="margin-right: 10px;display: flex;">
-{{balanceRedece}}
</span>
2023-12-04 16:35:09 +08:00
</view>
2023-12-01 15:47:01 +08:00
</view>
2024-04-09 09:23:11 +08:00
2024-01-16 16:10:03 +08:00
<view class="desc">
2023-12-01 15:47:01 +08:00
<view style="display: flex;">
2024-01-16 16:10:03 +08:00
囤油卡
<span style="display: flex;">(余额{{refuelBalance}}L)</span>
2023-12-04 16:35:09 +08:00
</view>
<view style="display: flex;">
2024-01-16 16:10:03 +08:00
<span style="margin-right: 10px;display: flex;">
- {{oilCardRedece}}L
<span style="margin-left: 8px;margin-top: 8px;">
<u-checkbox-group>
2024-04-09 09:23:11 +08:00
<u-checkbox v-model="checkOilCard" :checked="checkOilCard" @change="changeOilCard"
:disabled="refuelBalance==0"></u-checkbox>
2024-01-16 16:10:03 +08:00
</u-checkbox-group>
</span>
</span>
2023-12-04 16:35:09 +08:00
</view>
</view>
2024-04-09 09:23:11 +08:00
2024-01-19 18:48:13 +08:00
<view class="desc" v-if="preferentialData.activeFavorableAmount">
2023-12-27 18:44:56 +08:00
<view style="display: flex;">
2023-12-29 15:27:06 +08:00
活动优惠
<!-- <span style="display: flex;">(满减活动)</span> -->
2023-12-27 18:44:56 +08:00
</view>
<view style="display: flex;">
2024-01-16 16:10:03 +08:00
<span style="margin-right: 10px;display: flex;">
-{{fullRedece}}
2024-01-17 17:36:21 +08:00
<!-- <span style="margin-left: 8px;margin-top: 8px;">
2024-01-16 16:10:03 +08:00
<u-checkbox-group>
<u-checkbox v-model="checkFull" :checked="checkFull" @change="changeFull"></u-checkbox>
</u-checkbox-group>
2024-01-17 17:36:21 +08:00
</span> -->
2024-01-16 16:10:03 +08:00
</span>
2023-12-27 18:44:56 +08:00
</view>
</view>
2024-04-09 09:23:11 +08:00
2024-01-19 18:48:13 +08:00
<view class="desc" v-if="preferentialData.cardFavorableAmount">
2023-12-27 18:44:56 +08:00
<view style="display: flex;">
优惠券优惠
2024-01-20 18:11:29 +08:00
<!-- <span style="display: flex;">(优惠券)</span> -->
2023-12-27 18:44:56 +08:00
</view>
<view style="display: flex;">
2024-01-16 16:10:03 +08:00
<span style="margin-right: 10px;display: flex;">
-{{couponRedece}}
</span>
2023-12-27 18:44:56 +08:00
</view>
2024-01-16 16:10:03 +08:00
</view>
2024-04-09 09:23:11 +08:00
2024-01-24 14:35:00 +08:00
<view class="desc" v-if="gradeRedece>0">
2023-12-04 16:35:09 +08:00
<view style="display: flex;">
2023-12-26 18:44:50 +08:00
会员等级优惠
2024-01-04 18:44:52 +08:00
<!-- <span style="display: flex;">({{userGrade.name}})</span> -->
2023-12-04 16:35:09 +08:00
</view>
<view style="display: flex;">
2024-01-16 16:10:03 +08:00
<span style="margin-right: 10px;display: flex;">
-{{gradeRedece}}
</span>
2023-12-04 16:35:09 +08:00
</view>
</view>
2024-01-19 18:48:13 +08:00
<!-- <view class="desc" v-if="!isFullPreferential && !isGradePreferential && !isOilStorageCard && !isStoreValueCard">无优惠</view> -->
2024-04-09 09:23:11 +08:00
<view style="margin: 10px 20px 0;color: red;font-size: 12px;"
v-if="fullRedece>0 || gradeRedece>0 || couponRedece>0">已为您计算出最大优惠</view>
2023-12-08 15:48:54 +08:00
<view style="margin: 10px 20px 0;color: red;font-size: 12px;">囤油卡不参与任何优惠活动</view>
2023-12-01 15:47:01 +08:00
</view>
2023-12-01 16:40:20 +08:00
2023-12-26 18:44:50 +08:00
<view style="background-color: white;width: 94%;margin: 15px auto;height: 100px;">
2023-12-01 16:40:20 +08:00
<view style="font-weight: bold;height: 40px;line-height: 40px;margin-left: 10px;margin-top: 20px;">支付方式
</view>
2023-12-29 15:27:06 +08:00
<!-- #ifdef MP-WEIXIN -->
2023-12-18 18:44:02 +08:00
<view class="scc">
<image src="@/static/imgs/wechat.png" class="imgIcon"></image>
<span style="width: 70%;margin-top: 5px;">微信支付</span>
<radio value="r1" checked="true" />
2023-12-01 15:47:01 +08:00
</view>
2023-12-29 15:27:06 +08:00
<!-- #endif -->
<!-- #ifdef MP-ALIPAY -->
<view class="scc">
<image src="@/static/imgs/alipay.png" class="imgIcon"></image>
<span style="width: 70%;margin-top: 5px;">支付宝支付</span>
<radio value="r1" checked="true" />
</view>
<!-- #endif -->
2023-12-01 15:47:01 +08:00
</view>
<!-- 支付信息 -->
<view class="bar">
<view style="margin-left: 20px;">
<view>
2023-12-04 16:35:09 +08:00
<span style="font-size: 22px;font-weight: bold;">{{payAmount}}</span>
2023-12-01 15:47:01 +08:00
</view>
<view style="color: red;font-size: 12px;">应付金额</view>
</view>
2023-12-06 18:36:10 +08:00
<view @click="payment"
2023-12-01 16:40:20 +08:00
style="margin-right: 20px;width: 30%;border-radius:30px;background-color: #1879ff;height: 40px;line-height: 40px;text-align: center;color: white">
2023-12-01 15:47:01 +08:00
确认支付
</view>
</view>
</view>
</view>
</template>
<script>
import request from '../../utils/request'
export default {
data() {
return {
2023-12-27 18:44:56 +08:00
// 小程序类型 微信 WECHAT 支付宝 ALIPAY
2023-12-29 15:27:06 +08:00
appltType: uni.getStorageSync("appltType"),
2024-02-20 11:00:47 +08:00
// 判断是否有登录token
AppToken: uni.getStorageSync("App-Token"),
// 是否登录
2024-04-09 09:23:11 +08:00
ifLogin: false,
gradeDis: "",
2023-12-01 15:47:01 +08:00
title: '',
2023-12-08 15:48:54 +08:00
value: true,
2023-12-01 16:40:20 +08:00
orderNo: "",
2023-12-01 15:47:01 +08:00
// 油品订单信息
2023-12-01 16:40:20 +08:00
oilOrder: {},
2023-12-01 15:47:01 +08:00
// 员工列表信息
staff: {},
// 店铺信息
2023-12-01 16:40:20 +08:00
store: {},
oilPrice: 0,
2023-12-01 15:47:01 +08:00
// 油品名称
2023-12-01 16:40:20 +08:00
oilName: "",
2024-04-09 09:23:11 +08:00
oilNameId: "",
2023-12-04 16:35:09 +08:00
// 油品类型
2024-04-09 09:23:11 +08:00
oilType: "",
2023-12-29 15:27:06 +08:00
// 油品id
2024-04-09 09:23:11 +08:00
oilId: "",
2023-12-04 16:35:09 +08:00
// 用户信息
2024-04-09 09:23:11 +08:00
user: {
cardBalance: 0,
2023-12-04 16:35:09 +08:00
},
2023-12-26 18:44:50 +08:00
// 储值卡升数
2024-04-09 09:23:11 +08:00
refuelBalance: 0,
2023-12-04 16:35:09 +08:00
// 会员等级信息
2024-04-09 09:23:11 +08:00
userGrade: {},
balanceRedece: 0,
oilCardRedece: 0,
gradeRedece: 0,
fullRedece: 0,
couponRedece: 0,
2023-12-27 18:44:56 +08:00
// 消费储值卡后的金额(未扣除优惠金额前的金额)
2024-04-09 09:23:11 +08:00
deductAmount: 0,
2023-12-04 16:35:09 +08:00
// 囤油卡信息
2024-04-09 09:23:11 +08:00
refuelMoney: [],
refuelMoneyAfter: [],
2023-12-04 16:35:09 +08:00
// 会员等级优惠信息
2024-04-09 09:23:11 +08:00
gradeDiscount: [],
2023-12-04 16:35:09 +08:00
// 优惠券优惠信息
2024-04-09 09:23:11 +08:00
couponDiscount: [],
2023-12-04 16:35:09 +08:00
// 满减优惠信息
2024-04-09 09:23:11 +08:00
fullReduceDiscount: [],
2023-12-26 18:44:50 +08:00
// 支付金额
2024-04-09 09:23:11 +08:00
payAmount: 0,
2023-12-26 18:44:50 +08:00
// 调起支付所需的数据
2024-04-09 09:23:11 +08:00
orderInfo: {},
2023-12-04 16:35:09 +08:00
// 是否使用囤油卡
2024-04-09 09:23:11 +08:00
isOilStorageCard: false,
2023-12-26 18:44:50 +08:00
// 是否使用储值卡
2024-04-09 09:23:11 +08:00
isStoreValueCard: false,
2023-12-27 18:44:56 +08:00
// 是否存在可使用的等级优惠
2024-04-09 09:23:11 +08:00
isGradePreferential: false,
2024-01-04 18:44:52 +08:00
// 是否存在可使用的满减或折扣优惠
2024-04-09 09:23:11 +08:00
isFullPreferential: false,
2024-01-16 16:10:03 +08:00
// 是否存在可使用的优惠券
2024-04-09 09:23:11 +08:00
isCoupons: false,
transferDTO: {
type: 0,
amount: 0,
oilId: "",
mtUserLevel: "",
storeId: uni.getStorageSync("storeId")
2024-01-04 18:44:52 +08:00
},
2024-04-09 09:23:11 +08:00
fixingLevel: {},
isUseChildCard: false,
cardsList: [],
2024-01-16 16:10:03 +08:00
query: {
storeId: uni.getStorageSync("storeId"),
couponType: '',
useStatus: 0,
pageNo: 1,
pageSize: 10
2024-04-09 09:23:11 +08:00
},
checkBalance: false,
checkOilCard: false,
checkFull: false,
checkCoupon: false,
checkGrade: false,
preferentialData: {
2024-01-19 18:48:13 +08:00
activeFavorableAmount: "",
activeId: "",
activeInfo: "",
cardFavorableAmount: "",
cardFavorableId: "",
cardFavorableInfo: "",
memberFavorableAmount: "",
type: "",
},
2024-04-29 17:57:39 +08:00
levelAmount: 0,
activeAmount: 0,
2024-01-24 14:35:00 +08:00
// 是否为固定等级会员
2024-04-09 09:23:11 +08:00
isFixingLevel: false,
2023-12-01 15:47:01 +08:00
}
},
onLoad(e) {
2023-12-29 16:50:44 +08:00
this.orderNo = e.orderNo
2024-01-27 09:05:50 +08:00
// this.orderNo = "2345202401261502301206e6"
2023-12-01 15:47:01 +08:00
},
onShow() {
this.getOilOrder();
},
components: {
},
methods: {
2024-01-16 16:10:03 +08:00
// 选择囤油卡
2024-04-09 09:23:11 +08:00
changeOilCard(val) {
2024-01-19 18:48:13 +08:00
this.checkOilCard = val
2024-04-09 09:23:11 +08:00
if (val) {
2024-01-19 18:48:13 +08:00
this.chooseRefuelMoney()
2024-01-20 11:48:52 +08:00
this.fullRedece = 0;
this.gradeRedece = 0;
this.couponRedece = 0;
this.preferentialData = {
activeFavorableAmount: "",
activeId: "",
activeInfo: "",
cardFavorableAmount: "",
cardFavorableId: "",
cardFavorableInfo: "",
memberFavorableAmount: "",
type: "",
};
2024-04-09 09:23:11 +08:00
} else {
2024-01-19 18:48:13 +08:00
this.oilCardRedece = 0
2024-04-09 09:23:11 +08:00
if (!this.isFixingLevel) {
2024-01-24 14:35:00 +08:00
this.getPaymentPreferential(this.user.gradeId)
}
2024-01-16 16:10:03 +08:00
}
},
2024-04-09 09:23:11 +08:00
2023-12-06 18:36:10 +08:00
// 支付接口
2024-04-09 09:23:11 +08:00
payment() {
if (this.isUseChildCard) {
if (this.balanceRedece > 0) {
2024-01-25 13:19:17 +08:00
this.isUseChildCard = true
2024-04-09 09:23:11 +08:00
} else {
2024-01-25 13:19:17 +08:00
this.isUseChildCard = false
}
}
2023-12-06 18:36:10 +08:00
let map = {
2024-04-09 09:23:11 +08:00
orderNo: this.orderNo,
payAmount: this.payAmount,
2023-12-08 15:48:54 +08:00
// payAmount : "0.01",
2024-04-09 09:23:11 +08:00
discountAmount: (this.fullRedece * 100 + this.gradeRedece * 100 + this.couponRedece * 100) / 100,
oilCardAmount: JSON.stringify(this.refuelMoneyAfter),
oilCardLiters: this.oilCardRedece,
balanceAmount: this.balanceRedece,
isOilStorageCard: this.isOilStorageCard,
tankId: uni.getStorageSync("tankId"),
2023-12-29 16:50:44 +08:00
// tankId : 6,
2024-04-09 09:23:11 +08:00
isUseChildCard: this.isUseChildCard,
activeId: this.preferentialData.activeId,
cardFavorableId: this.preferentialData.cardFavorableId,
recordId: this.preferentialData.recordId,
type: this.preferentialData.type,
balanceAmountSale: this.balanceRedece,
oilCardAmountSale: this.oilCardRedece,
2024-04-29 17:57:39 +08:00
ifLogin: this.ifLogin,
levelAmount: this.levelAmount,
2024-06-07 15:10:38 +08:00
activeAmount: this.activeAmount,
sn
2023-12-06 18:36:10 +08:00
};
let _this = this;
2023-12-05 17:18:27 +08:00
request({
2024-04-09 09:23:11 +08:00
url: "business/oilOrder/appletPay",
method: 'post',
data: map,
2023-12-05 17:18:27 +08:00
}).then(res => {
2023-12-20 16:04:56 +08:00
let payProvider = "wxpay"
2024-04-09 09:23:11 +08:00
if (_this.appltType == "WECHAT") {
2023-12-27 18:44:56 +08:00
payProvider = "wxpay"
2024-04-09 09:23:11 +08:00
} else {
2023-12-27 18:44:56 +08:00
payProvider = "alipay"
}
2024-04-09 09:23:11 +08:00
if (res.data.error) {
2024-01-13 18:01:23 +08:00
request({
url: "/business/allOrderInfo/orderStatus",
method: 'post',
2024-04-09 09:23:11 +08:00
data: {
"orderNo": _this.orderNo,
"status": "payFail"
},
}).then((ress) => {})
2024-01-13 18:01:23 +08:00
uni.showToast({
2024-04-09 09:23:11 +08:00
title: res.data.error,
icon: "none"
2024-01-13 18:01:23 +08:00
})
2024-01-24 14:35:00 +08:00
// _this.goBack()
2024-01-13 18:01:23 +08:00
return;
}
2024-04-09 09:23:11 +08:00
if (res.data.code == "error") {
2024-03-02 16:41:18 +08:00
request({
url: "/business/allOrderInfo/orderStatus",
method: 'post',
2024-04-09 09:23:11 +08:00
data: {
"orderNo": _this.orderNo,
"status": "payFail"
},
}).then((ress) => {})
2024-03-02 16:41:18 +08:00
uni.showToast({
2024-03-06 13:39:10 +08:00
// title:res.data.msg,
2024-04-09 09:23:11 +08:00
title: "支付失败,请联系商家",
icon: "none"
2024-03-02 16:41:18 +08:00
})
// _this.goBack()
return;
}
2024-04-09 09:23:11 +08:00
if (res.data.success == "ok") {
2024-01-29 18:18:30 +08:00
// _this.preferentialData.storeId = _this.oilOrder.storeId
// _this.preferentialData.orderAmount = _this.oilOrder.orderAmount
// _this.preferentialData.oilId = _this.oilOrder.oils
// _this.preferentialData.mtUserLevel = _this.user.gradeId
// request({
// url: "business/marketingActivity/cardFavorableRecord/updateCardAndActiveById",
// method: 'post',
// data: _this.preferentialData,
// }).then((res)=>{})
2024-02-18 18:09:52 +08:00
// uni.reLaunch({
// url: '/pagesRefuel/orderSuccess/index'
// })
2024-06-05 15:19:29 +08:00
uni.redirectTo({
2024-04-09 09:23:11 +08:00
url: '/pagesRefuel/orderSuccess/index?orderNo=' + _this.orderNo,
2024-01-04 18:44:52 +08:00
})
return;
}
2024-04-09 09:23:11 +08:00
if (res.data.resultMsg == "商户订单号重复") {
2024-01-18 18:15:24 +08:00
uni.showToast({
2024-04-09 09:23:11 +08:00
title: "商户订单号重复,请重新选择订单信息进行支付!",
icon: "none"
2024-01-18 18:15:24 +08:00
})
}
2024-04-09 09:23:11 +08:00
if (res.data.data.reservedPayInfo) {
2023-12-25 18:10:00 +08:00
_this.orderInfo = JSON.parse(res.data.data.reservedPayInfo);
uni.requestPayment({
// 微信支付provider: 'wxpay' 支付宝支付 'alipay'
provider: payProvider,
// 时间戳
timeStamp: _this.orderInfo.timeStamp,
// 随机字符串
nonceStr: _this.orderInfo.nonceStr,
// 固定值
package: _this.orderInfo.package,
// 解密方式
signType: 'MD5',
// 支付签名
paySign: _this.orderInfo.paySign,
2024-04-09 09:23:11 +08:00
success: function(res) {
2023-12-27 18:44:56 +08:00
console.log('success');
2024-01-19 18:48:13 +08:00
// 支付成功后调用修改使用后的优惠券情况
2024-01-29 18:18:30 +08:00
// _this.preferentialData.storeId = _this.oilOrder.storeId
// _this.preferentialData.orderAmount = _this.oilOrder.orderAmount
// _this.preferentialData.oilId = _this.oilOrder.oils
// _this.preferentialData.mtUserLevel = _this.user.gradeId
// request({
// url: "business/marketingActivity/cardFavorableRecord/updateCardAndActiveById",
// method: 'post',
// data: _this.preferentialData,
// }).then((res)=>{
// console.log(res);
// })
2024-02-18 18:09:52 +08:00
// uni.reLaunch({
2024-06-05 15:19:29 +08:00
2024-02-18 18:09:52 +08:00
// })
2024-04-09 09:23:11 +08:00
2024-06-05 15:19:29 +08:00
uni.redirectTo({
2024-04-09 09:23:11 +08:00
url: '/pagesRefuel/orderSuccess/index?orderNo=' + _this
.orderNo,
2023-12-20 16:04:56 +08:00
})
2023-12-25 18:10:00 +08:00
},
2024-04-09 09:23:11 +08:00
fail: function(err) {
2023-12-25 18:10:00 +08:00
request({
url: "/business/allOrderInfo/orderStatus",
method: 'post',
2024-04-09 09:23:11 +08:00
data: {
"orderNo": res.data.data.orderNo,
"status": "payFail"
},
}).then((res) => {
2023-12-25 18:10:00 +08:00
uni.showToast({
2024-04-09 09:23:11 +08:00
title: "支付失败!",
icon: "error"
2023-12-25 18:10:00 +08:00
})
})
2024-04-09 09:23:11 +08:00
console.log('fail:', err);
2023-12-25 18:10:00 +08:00
}
});
2024-01-18 18:15:24 +08:00
}
2024-04-09 09:23:11 +08:00
if (_this.appltType == "ALIPAY") {
my.tradePay({
tradeNO: res.data.data.reservedTransactionId
}, function(resp) {
if (resp.resultCode == '9000') {
2023-12-26 18:44:50 +08:00
console.log("支付成功")
2024-01-19 18:48:13 +08:00
// 支付成功后调用修改使用后的优惠券情况
2024-01-29 18:18:30 +08:00
// _this.preferentialData.storeId = _this.oilOrder.storeId
// _this.preferentialData.orderAmount = _this.oilOrder.orderAmount
// _this.preferentialData.oilId = _this.oilOrder.oils
// _this.preferentialData.mtUserLevel = _this.user.gradeId
// request({
// url: "business/marketingActivity/cardFavorableRecord/updateCardAndActiveById",
// method: 'post',
// data: _this.preferentialData,
// }).then((res)=>{})
2024-02-18 18:09:52 +08:00
// uni.reLaunch({
// url: '/pagesRefuel/orderSuccess/index'
// })
2024-04-09 09:23:11 +08:00
2024-06-05 15:19:29 +08:00
uni.redirectTo({
2024-04-09 09:23:11 +08:00
url: '/pagesRefuel/orderSuccess/index?orderNo=' + _this
.orderNo,
2023-12-29 15:27:06 +08:00
})
2024-04-09 09:23:11 +08:00
} else {
2023-12-26 18:44:50 +08:00
request({
url: "/business/allOrderInfo/orderStatus",
method: 'post',
2024-04-09 09:23:11 +08:00
data: {
"orderNo": res.data.data.orderNo,
"status": "payFail"
},
}).then((res) => {
2023-12-26 18:44:50 +08:00
uni.showToast({
2024-04-09 09:23:11 +08:00
title: "支付失败!",
icon: "error"
2023-12-25 18:10:00 +08:00
})
2023-12-26 18:44:50 +08:00
})
2024-04-09 09:23:11 +08:00
console.log('支付失败,' + resp.resultCode);
2023-12-04 16:35:09 +08:00
}
2023-12-26 18:44:50 +08:00
});
2023-12-04 16:35:09 +08:00
}
2023-12-26 18:44:50 +08:00
})
2023-12-04 16:35:09 +08:00
},
2024-04-09 09:23:11 +08:00
2023-12-26 18:44:50 +08:00
// 查看是否有可使用的囤油卡
2024-04-09 09:23:11 +08:00
chooseRefuelMoney() {
2024-01-16 16:10:03 +08:00
console.log("oilCard");
2023-12-26 18:44:50 +08:00
let falg = false;
2024-04-09 09:23:11 +08:00
for (let i = 0; i < this.refuelMoney.length; i++) {
if (this.refuelMoney[i].oilType == this.oilNameId) {
if (this.refuelMoney[i].refuelMoney > 0) {
2024-01-16 16:10:03 +08:00
falg = true
}
2024-01-11 13:55:20 +08:00
this.refuelBalance = this.refuelMoney[i].refuelMoney
2024-04-09 09:23:11 +08:00
if (this.refuelMoney[i].refuelMoney > 0) {
2024-01-11 13:55:20 +08:00
this.isOilStorageCard = true
}
2024-04-09 09:23:11 +08:00
if (this.refuelMoney[i].refuelMoney >= this.oilOrder.oilNum) {
2023-12-26 18:44:50 +08:00
this.oilCardRedece = this.oilOrder.oilNum
2024-01-11 13:55:20 +08:00
this.refuelMoneyAfter[i].refuelMoney = this.refuelMoney[i].refuelMoney - this.oilOrder.oilNum
2024-02-28 18:02:53 +08:00
this.payAmount = 0
this.checkOilCard = true
2024-04-09 09:23:11 +08:00
} else {
2024-01-11 13:55:20 +08:00
this.oilCardRedece = this.refuelMoney[i].refuelMoney
this.refuelMoneyAfter[i].refuelMoney = 0
2024-01-16 16:10:03 +08:00
if (falg) {
2024-01-19 18:48:13 +08:00
this.checkOilCard = true
2024-01-16 16:10:03 +08:00
this.chooseCardBalance(1)
}
2023-12-26 18:44:50 +08:00
}
2023-12-04 16:35:09 +08:00
}
2024-01-11 13:55:20 +08:00
}
2023-12-26 18:44:50 +08:00
if (falg == false) {
2024-01-27 09:05:50 +08:00
// this.chooseCardBalance(0)
2024-01-16 16:10:03 +08:00
// this.chooseGrade(this.user.id,this.user.gradeId)
2023-12-04 16:35:09 +08:00
}
2024-04-09 09:23:11 +08:00
if (this.oilCardRedece == 0) {
if (!this.isFixingLevel) {
2024-03-15 13:45:56 +08:00
this.chooseCardBalance(0)
2024-01-24 14:35:00 +08:00
this.getPaymentPreferential(this.user.gradeId)
2024-04-09 09:23:11 +08:00
} else {
2024-01-27 09:05:50 +08:00
this.chooseCardBalance(0)
2024-01-24 14:35:00 +08:00
}
2024-01-20 11:48:52 +08:00
}
2024-01-20 18:11:29 +08:00
},
// 查看是否有可使用的储值卡金额
2024-04-09 09:23:11 +08:00
chooseCardBalance(val) {
2024-01-16 16:10:03 +08:00
console.log("balance");
2024-04-09 09:23:11 +08:00
if (this.user.cardBalance > 0) {
2023-12-26 18:44:50 +08:00
this.isStoreValueCard = true;
if (val == 0) {
// 没有使用囤油卡
2024-04-09 09:23:11 +08:00
if (this.user.cardBalance >= (this.oilOrder.orderAmount - this.fullRedece - this.couponRedece -
this.gradeRedece)) {
this.balanceRedece = (this.oilOrder.orderAmount - this.fullRedece - this.couponRedece - this
.gradeRedece).toFixed(2)
2023-12-26 18:44:50 +08:00
} else {
this.balanceRedece = this.user.cardBalance
2024-04-09 09:23:11 +08:00
this.deductAmount = (this.oilOrder.orderAmount - this.fullRedece - this.couponRedece - this
.gradeRedece - this.balanceRedece).toFixed(2)
this.payAmount = (this.oilOrder.orderAmount - this.fullRedece - this.couponRedece - this
.gradeRedece - this.balanceRedece).toFixed(2)
console.log(this.oilOrder.orderAmount, this.fullRedece, this.couponRedece, this.gradeRedece,
this.balanceRedece, 111);
2023-12-04 16:35:09 +08:00
}
2024-04-09 09:23:11 +08:00
} else {
2023-12-26 18:44:50 +08:00
// 使用囤油卡
// 扣除囤油卡金额后需要支付的金额
2024-01-11 13:55:20 +08:00
let residueAmount = 0
2024-04-09 09:23:11 +08:00
if (this.oilCardRedece > 0) {
2024-01-11 13:55:20 +08:00
residueAmount = ((this.oilOrder.oilNum - this.oilCardRedece) * this.oilPrice).toFixed(2)
2024-04-09 09:23:11 +08:00
} else {
2024-01-11 13:55:20 +08:00
residueAmount = this.oilOrder.orderAmount
}
2024-04-09 09:23:11 +08:00
if (this.user.cardBalance >= residueAmount) {
2023-12-26 18:44:50 +08:00
this.balanceRedece = residueAmount
} else {
this.balanceRedece = this.user.cardBalance
2024-04-09 09:23:11 +08:00
this.payAmount = ((residueAmount * 100).toFixed(0) - (this.balanceRedece * 100).toFixed(0)) /
100
2023-12-04 16:35:09 +08:00
}
2023-12-26 18:44:50 +08:00
}
2024-04-09 09:23:11 +08:00
} else {
this.deductAmount = (this.oilOrder.orderAmount - this.fullRedece - this.couponRedece - this
.gradeRedece).toFixed(2)
this.payAmount = (this.oilOrder.orderAmount - this.fullRedece - this.couponRedece - this.gradeRedece)
.toFixed(2)
console.log(this.oilOrder.orderAmount, this.fullRedece, this.couponRedece, this.gradeRedece, this
.balanceRedece, 222);
2023-12-26 18:44:50 +08:00
}
2023-12-04 16:35:09 +08:00
},
2023-12-26 18:44:50 +08:00
// 查看是否有可使用的会员等级优惠
2024-04-09 09:23:11 +08:00
chooseGrade(userId, gradeId) {
2024-01-16 16:10:03 +08:00
console.log("userGrade");
2023-12-26 18:44:50 +08:00
let that = this;
2024-03-15 13:45:56 +08:00
that.isFixingLevel = false
2023-12-04 16:35:09 +08:00
request({
2024-01-04 18:44:52 +08:00
url: "business/userManager/userGrade/isUse",
method: 'post',
2024-04-09 09:23:11 +08:00
data: {
userId: userId,
gradeId: gradeId,
storeId: that.oilOrder.storeId
}
2023-12-26 18:44:50 +08:00
}).then((res) => {
2024-04-09 09:23:11 +08:00
if (res.data) {
if (res.data.fixingLevel) {
if (res.data.fixingLevel.discountType == "自定义优惠") {
if (that.oilType == "汽油") {
2024-01-04 18:44:52 +08:00
// 将数组按照金额从小到大排序
2024-04-09 09:23:11 +08:00
let gasolineRule = JSON.parse(res.data.fixingLevel.gasolineRule).sort((a, b) =>
a.gasolineRule1 - b.gasolineRule1);
if (res.data.fixingLevel.gasolineDiscount == "满减优惠") {
if (gasolineRule.length > 1) {
for (let i = 1; i < gasolineRule.length; i++) {
if (that.oilOrder.orderAmount >= gasolineRule[gasolineRule.length -
1].gasolineRule1) {
that.gradeRedece = gasolineRule[gasolineRule.length - 1]
.gasolineRule2
2024-01-04 18:44:52 +08:00
that.isGradePreferential = true
break;
}
2024-04-09 09:23:11 +08:00
if (that.oilOrder.orderAmount >= gasolineRule[i - 1]
.gasolineRule1 && that.oilOrder.orderAmount < gasolineRule[i]
.gasolineRule1) {
2024-01-04 18:44:52 +08:00
that.gradeRedece = gasolineRule[i - 1].gasolineRule2
that.isGradePreferential = true
}
}
2024-04-09 09:23:11 +08:00
} else {
if (that.oilOrder.orderAmount >= gasolineRule[gasolineRule.length - 1]
.gasolineRule1) {
that.gradeRedece = gasolineRule[gasolineRule.length - 1]
.gasolineRule2
2023-12-27 18:44:56 +08:00
that.isGradePreferential = true
}
2023-12-26 18:44:50 +08:00
}
}
2024-04-09 09:23:11 +08:00
if (res.data.fixingLevel.gasolineDiscount == "每升优惠") {
if (gasolineRule.length > 1) {
for (let i = 1; i < gasolineRule.length; i++) {
if (that.oilOrder.orderAmount >= gasolineRule[gasolineRule.length -
1].gasolineRule1) {
2024-01-04 18:44:52 +08:00
// 计算升数 和 优惠金额
2024-04-09 09:23:11 +08:00
that.gradeRedece = (that.oilOrder.orderAmount / that.oilPrice *
gasolineRule[gasolineRule.length - 1].gasolineRule3)
.toFixed(2)
2024-01-04 18:44:52 +08:00
that.isGradePreferential = true
break;
}
2024-04-09 09:23:11 +08:00
if (that.oilOrder.orderAmount >= gasolineRule[i - 1]
.gasolineRule1 && that.oilOrder.orderAmount < gasolineRule[i]
.gasolineRule1) {
that.gradeRedece = (that.oilOrder.orderAmount / that.oilPrice *
gasolineRule[i - 1].gasolineRule3).toFixed(2)
2024-01-04 18:44:52 +08:00
that.isGradePreferential = true
}
}
2024-04-09 09:23:11 +08:00
} else {
if (that.oilOrder.orderAmount >= gasolineRule[gasolineRule.length - 1]
.gasolineRule1) {
that.gradeRedece = (that.oilOrder.orderAmount / that.oilPrice *
gasolineRule[gasolineRule.length - 1].gasolineRule3)
.toFixed(2)
2023-12-27 18:44:56 +08:00
that.isGradePreferential = true
}
}
}
2023-12-04 16:35:09 +08:00
}
2024-04-09 09:23:11 +08:00
if (that.oilType == "柴油") {
2024-01-04 18:44:52 +08:00
// 将数组按照金额从小到大排序
2024-04-09 09:23:11 +08:00
let dieselRule = JSON.parse(res.data.fixingLevel.dieselRule).sort((a, b) => a
.dieselRule1 - b.dieselRule1);
if (res.data.fixingLevel.dieselDiscount == "满减优惠") {
if (dieselRule.length > 1) {
for (let i = 1; i < dieselRule.length; i++) {
if (that.oilOrder.orderAmount >= dieselRule[dieselRule.length - 1]
.dieselRule1) {
that.gradeRedece = dieselRule[dieselRule.length - 1]
.dieselRule2
2024-01-04 18:44:52 +08:00
that.isGradePreferential = true
break;
}
2024-04-09 09:23:11 +08:00
if (that.oilOrder.orderAmount >= dieselRule[i - 1].dieselRule1 &&
that.oilOrder.orderAmount < dieselRule[i].dieselRule1) {
2024-01-04 18:44:52 +08:00
that.gradeRedece = dieselRule[i - 1].dieselRule2
that.isGradePreferential = true
}
}
2024-04-09 09:23:11 +08:00
} else {
if (that.oilOrder.orderAmount >= dieselRule[dieselRule.length - 1]
.dieselRule1) {
that.gradeRedece = dieselRule[dieselRule.length - 1].dieselRule2
2023-12-27 18:44:56 +08:00
that.isGradePreferential = true
}
}
}
2024-04-09 09:23:11 +08:00
if (res.data.fixingLevel.dieselDiscount == "每升优惠") {
if (dieselRule.length > 1) {
for (let i = 1; i < dieselRule.length; i++) {
if (that.oilOrder.orderAmount >= dieselRule[dieselRule.length - 1]
.dieselRule1) {
2024-01-04 18:44:52 +08:00
// 计算升数 和 优惠金额
2024-04-09 09:23:11 +08:00
that.gradeRedece = (that.oilOrder.orderAmount / that.oilPrice *
dieselRule[dieselRule.length - 1].dieselRule3).toFixed(
2)
2024-01-04 18:44:52 +08:00
that.isGradePreferential = true
break;
}
2024-04-09 09:23:11 +08:00
if (that.oilOrder.orderAmount >= dieselRule[i - 1].dieselRule1 &&
that.oilOrder.orderAmount < dieselRule[i].dieselRule1) {
that.gradeRedece = (that.oilOrder.orderAmount / that.oilPrice *
dieselRule[i - 1].dieselRule3).toFixed(2)
2024-01-04 18:44:52 +08:00
that.isGradePreferential = true
}
}
2024-04-09 09:23:11 +08:00
} else {
if (that.oilOrder.orderAmount >= dieselRule[dieselRule.length - 1]
.dieselRule1) {
that.gradeRedece = (that.oilOrder.orderAmount / that.oilPrice *
dieselRule[dieselRule.length - 1].dieselRule3).toFixed(2)
2023-12-27 18:44:56 +08:00
that.isGradePreferential = true
}
}
}
}
2024-04-09 09:23:11 +08:00
if (that.oilType == "天然气") {
2024-01-04 18:44:52 +08:00
// 将数组按照金额从小到大排序
2024-04-09 09:23:11 +08:00
let naturalGasRule = JSON.parse(res.data.fixingLevel.naturalGasRule).sort((a,
b) => a.naturalGasRule1 - b.naturalGasRule1);
if (res.data.fixingLevel.naturalGasDiscount == "满减优惠") {
if (naturalGasRule.length > 1) {
for (let i = 1; i < naturalGasRule.length; i++) {
if (that.oilOrder.orderAmount >= naturalGasRule[naturalGasRule
.length - 1].naturalGasRule1) {
that.gradeRedece = naturalGasRule[naturalGasRule.length - 1]
.naturalGasRule2
2024-01-04 18:44:52 +08:00
that.isGradePreferential = true
break;
}
2024-04-09 09:23:11 +08:00
if (that.oilOrder.orderAmount >= naturalGasRule[i - 1]
.naturalGasRule1 && that.oilOrder.orderAmount < naturalGasRule[
i].naturalGasRule1) {
2024-01-04 18:44:52 +08:00
that.gradeRedece = naturalGasRule[i - 1].naturalGasRule2
that.isGradePreferential = true
}
}
2024-04-09 09:23:11 +08:00
} else {
if (that.oilOrder.orderAmount >= naturalGasRule[naturalGasRule.length -
1].naturalGasRule1) {
that.gradeRedece = naturalGasRule[naturalGasRule.length - 1]
.naturalGasRule2
2023-12-27 18:44:56 +08:00
that.isGradePreferential = true
}
}
}
2024-04-09 09:23:11 +08:00
if (res.data.fixingLevel.naturalGasDiscount == "每升优惠") {
if (naturalGasRule.length > 1) {
for (let i = 1; i < naturalGasRule.length; i++) {
if (that.oilOrder.orderAmount >= naturalGasRule[naturalGasRule
.length - 1].naturalGasRule1) {
2024-01-04 18:44:52 +08:00
// 计算升数 和 优惠金额
2024-04-09 09:23:11 +08:00
that.gradeRedece = (that.oilOrder.orderAmount / that.oilPrice *
naturalGasRule[naturalGasRule.length - 1]
.naturalGasRule3).toFixed(2)
2024-01-04 18:44:52 +08:00
that.isGradePreferential = true
break;
}
2024-04-09 09:23:11 +08:00
if (that.oilOrder.orderAmount >= naturalGasRule[i - 1]
.naturalGasRule1 && that.oilOrder.orderAmount < naturalGasRule[
i].naturalGasRule1) {
that.gradeRedece = (that.oilOrder.orderAmount / that.oilPrice *
naturalGasRule[i - 1].naturalGasRule3).toFixed(2)
2024-01-04 18:44:52 +08:00
that.isGradePreferential = true
}
}
2024-04-09 09:23:11 +08:00
} else {
if (that.oilOrder.orderAmount >= naturalGasRule[naturalGasRule.length -
1].naturalGasRule1) {
that.gradeRedece = (that.oilOrder.orderAmount / that.oilPrice *
naturalGasRule[naturalGasRule.length - 1].naturalGasRule3)
.toFixed(2)
2023-12-27 18:44:56 +08:00
that.isGradePreferential = true
}
2024-01-04 18:44:52 +08:00
}
}
}
}
2024-01-24 14:35:00 +08:00
that.isFixingLevel = true
// if (res.data.fixingLevel.storeValue=="no" && that.balanceRedece>0){
// that.gradeRedece = 0
// }
2023-12-04 16:35:09 +08:00
}
2024-04-09 09:23:11 +08:00
2023-12-04 16:35:09 +08:00
}
})
},
2023-12-29 15:27:06 +08:00
// 查看是否有可使用的优惠活动
2024-04-09 09:23:11 +08:00
chooseFullOrCoupon() {
2024-01-16 16:10:03 +08:00
console.log("full");
2023-12-29 15:27:06 +08:00
this.transferDTO.amount = this.deductAmount
this.transferDTO.mtUserLevel = this.userGrade.id
this.transferDTO.oilId = this.oilId
let _this = this;
request({
url: "business/marketingActivity/activeExchange/test",
method: 'post',
2024-04-09 09:23:11 +08:00
data: _this.transferDTO,
2023-12-29 15:27:06 +08:00
}).then((res) => {
2024-04-09 09:23:11 +08:00
if (res.data.amount > 0) {
2023-12-29 15:27:06 +08:00
_this.payAmount = res.data.amount - _this.gradeRedece
_this.fullRedece = res.data.favorableAmount
2024-01-04 18:44:52 +08:00
_this.isFullPreferential = true
2023-12-29 15:27:06 +08:00
}
})
},
2024-01-16 16:10:03 +08:00
// 查看是否有可使用的优惠券
2024-04-09 09:23:11 +08:00
chooseCoupons() {
2024-01-16 16:10:03 +08:00
console.log("coupons");
request({
url: 'business/marketingActivity/cardFavorable/applet',
method: 'get',
params: this.query
}).then(res => {
if (res.data.records) {
console.log(res.data.records);
this.cardsList = res.data.records
2024-04-09 09:23:11 +08:00
if (this.cardsList.length > 0) {
2024-01-16 16:10:03 +08:00
this.couponRedece = this.cardsList[0].couponAmount
}
}
})
},
2024-04-09 09:23:11 +08:00
2023-12-27 18:44:56 +08:00
// 计算用户应付金额
2024-04-09 09:23:11 +08:00
countPayMent() {
2024-01-16 16:10:03 +08:00
this.payAmount = this.deductAmount;
2024-01-20 11:48:52 +08:00
// console.log("111",this.deductAmount, this.gradeRedece, this.fullRedece, this.couponRedece);
2023-12-27 18:44:56 +08:00
},
2024-04-09 09:23:11 +08:00
2024-01-10 11:06:41 +08:00
// 根据店铺id查询用户信息
2024-04-09 09:23:11 +08:00
async getUser(id) {
2023-12-04 16:35:09 +08:00
let _this = this;
request({
2024-01-10 11:06:41 +08:00
url: "business/userManager/user/storeUser",
method: 'post',
2024-04-09 09:23:11 +08:00
data: {
storeId: _this.oilOrder.storeId,
userId: id
}
2023-12-04 16:35:09 +08:00
}).then((res) => {
2024-04-09 09:23:11 +08:00
if (res.data.isUseChild == 'yes') {
2024-01-10 11:06:41 +08:00
_this.isUseChildCard = true
2024-04-09 09:23:11 +08:00
} else {
2024-01-10 11:06:41 +08:00
_this.isUseChildCard = false
}
_this.user = res.data.userVo;
_this.user = res.data.userVo;
2024-04-09 09:23:11 +08:00
_this.chooseGrade(_this.user.id, _this.user.gradeId);
if (res.data.userVo.refuelMoney && res.data.userVo.refuelMoney != 'null') {
2024-01-10 11:06:41 +08:00
_this.refuelMoney = JSON.parse(res.data.userVo.refuelMoney)
2024-01-11 13:55:20 +08:00
_this.refuelMoneyAfter = JSON.parse(res.data.userVo.refuelMoney)
2023-12-26 18:44:50 +08:00
_this.chooseRefuelMoney()
2024-04-09 09:23:11 +08:00
} else {
if (!this.isFixingLevel) {
2024-03-15 13:45:56 +08:00
_this.chooseCardBalance(0)
2024-04-09 09:23:11 +08:00
console.log(this.balanceRedece, 154);
2024-01-24 14:35:00 +08:00
_this.getPaymentPreferential(this.user.gradeId)
2024-04-09 09:23:11 +08:00
} else {
2024-01-27 09:05:50 +08:00
_this.chooseCardBalance(0)
2024-01-24 14:35:00 +08:00
}
2023-12-06 18:36:10 +08:00
}
2024-01-24 14:35:00 +08:00
console.log("afterGrade");
2024-01-18 18:15:24 +08:00
// _this.chooseGrade(res.data.userVo.id,res.data.userVo.gradeId)
2023-12-04 16:35:09 +08:00
})
},
2024-04-09 09:23:11 +08:00
getPaymentPreferential(gradeId) {
2024-01-19 18:48:13 +08:00
let type = 0;
2024-04-09 09:23:11 +08:00
if (this.balanceRedece == 0) {
type = 2
} else {
2024-01-19 18:48:13 +08:00
type = 0
}
let map = {
//支付类型 0储值卡 1囤油卡
type: type,
//支付金额
amount: this.oilOrder.orderAmount,
//可用油品Id
oilId: this.oilOrder.oils,
//店铺id
storeId: this.oilOrder.storeId,
//会员等级
mtUserLevel: gradeId,
//用户id
userId: this.oilOrder.userId,
}
request({
url: "business/marketingActivity/activeExchange/getPaymentActive",
method: 'get',
2024-04-09 09:23:11 +08:00
params: map,
2024-01-19 18:48:13 +08:00
}).then((res) => {
this.preferentialData = res.data
2024-04-09 09:23:11 +08:00
if (res.data.memberFavorableAmount) {
2024-01-19 18:48:13 +08:00
this.gradeRedece = res.data.memberFavorableAmount
2024-04-29 17:57:39 +08:00
this.levelAmount = res.data.memberFavorableAmount
2024-01-19 18:48:13 +08:00
}
2024-04-09 09:23:11 +08:00
if (res.data.cardFavorableAmount) {
2024-01-19 18:48:13 +08:00
this.couponRedece = res.data.cardFavorableAmount
}
2024-04-09 09:23:11 +08:00
if (res.data.activeFavorableAmount) {
2024-01-19 18:48:13 +08:00
this.fullRedece = res.data.activeFavorableAmount
2024-04-29 17:57:39 +08:00
this.activeAmount = res.data.activeFavorableAmount
2024-01-19 18:48:13 +08:00
}
2024-04-09 09:23:11 +08:00
console.log(this.gradeRedece, this.couponRedece, this.fullRedece, res.data
.memberFavorableAmount, "2231");
2024-01-20 18:11:29 +08:00
this.chooseCardBalance(0)
// this.payAmount = (this.payAmount - this.fullRedece - this.couponRedece - this.gradeRedece).toFixed(2)
2024-01-19 18:48:13 +08:00
})
},
2023-12-01 15:47:01 +08:00
// 获取油品订单
2023-12-01 16:40:20 +08:00
getOilOrder() {
2023-12-01 15:47:01 +08:00
let _this = this;
request({
2024-01-20 11:48:52 +08:00
// url: "business/oilOrder/orderNo",
url: "business/oilOrder/oilOrderNo",
2023-12-01 15:47:01 +08:00
method: 'post',
2023-12-01 16:40:20 +08:00
data: {
orderNo: _this.orderNo
},
}).then((res) => {
2024-04-09 09:23:11 +08:00
if (res.data) {
2024-01-20 11:48:52 +08:00
// console.log(res);
2023-12-29 15:27:06 +08:00
_this.oilOrder = res.data
2024-01-20 11:48:52 +08:00
// _this.getStaffList(res.data.staffId)
// _this.getStore(res.data.storeId)
2023-12-29 15:27:06 +08:00
_this.getOilNumber(res.data.storeId)
2024-01-17 14:14:19 +08:00
// _this.chooseCoupons()
2024-02-20 11:00:47 +08:00
// 判断是否登录
if (_this.AppToken) {
_this.getUser(res.data.userId)
_this.ifLogin = true
2024-04-09 09:23:11 +08:00
} else {
2024-02-20 11:00:47 +08:00
_this.ifLogin = false
_this.payAmount = _this.oilOrder.orderAmount
}
2023-12-29 15:27:06 +08:00
}
2023-12-01 15:47:01 +08:00
})
},
// 获取门店信息
2023-12-01 16:40:20 +08:00
getStore(id) {
2023-12-01 15:47:01 +08:00
let _this = this;
request({
url: "business/storeInformation/store/queryStoreById",
method: 'post',
2023-12-01 16:40:20 +08:00
data: {
"storeId": id
},
}).then((res) => {
2023-12-01 15:47:01 +08:00
_this.store = res.data;
})
},
// 根据员工id获取员工信息
2023-12-01 16:40:20 +08:00
getStaffList(staffId) {
2023-12-01 15:47:01 +08:00
let _this = this;
request({
url: "business/member/staff/" + staffId,
method: 'get',
2023-12-01 16:40:20 +08:00
}).then((res) => {
2023-12-01 15:47:01 +08:00
_this.staff = res.data
})
},
// 获取当前店铺油号信息
2023-12-01 16:40:20 +08:00
getOilNumber(storeId) {
2023-12-01 15:47:01 +08:00
let _this = this;
request({
url: "business/petrolStationManagement/oilNumber/getOilNumberName/" + storeId,
method: 'get',
2023-12-01 16:40:20 +08:00
}).then((res) => {
2023-12-01 15:47:01 +08:00
res.data.forEach(item => {
2023-12-01 16:40:20 +08:00
if (item.oilName == _this.oilOrder.oils) {
2024-01-24 14:35:00 +08:00
_this.oilPrice = item.oilPrice;
2023-12-01 15:47:01 +08:00
_this.oilName = item.oilNames;
2024-01-11 13:55:20 +08:00
_this.oilNameId = item.oilName;
2023-12-04 16:35:09 +08:00
_this.oilType = item.oilType;
2023-12-29 15:27:06 +08:00
_this.oilId = item.oilId;
2023-12-01 15:47:01 +08:00
}
})
})
},
2023-12-26 18:44:50 +08:00
// 返回
2023-12-01 15:47:01 +08:00
goBack() {
uni.navigateBack()
}
}
}
</script>
<style scoped lang="scss">
2024-04-09 09:23:11 +08:00
.scc {
2023-12-18 18:44:02 +08:00
display: flex;
justify-content: space-around;
margin-top: 10px;
height: 40px;
font-size: 18px;
line-height: 40px;
}
2024-04-09 09:23:11 +08:00
.imgIcon {
2023-12-18 18:44:02 +08:00
width: 30px;
height: 30px;
border-radius: 50%;
margin-top: 10px;
}
2024-04-09 09:23:11 +08:00
2023-12-01 16:40:20 +08:00
.desc {
2023-12-01 15:47:01 +08:00
height: 35px;
line-height: 35px;
margin-left: 20px;
margin-right: 20px;
display: flex;
justify-content: space-between;
font-size: 15px;
color: rgba(0, 0, 0, 0.65);
}
2023-12-01 16:40:20 +08:00
2023-12-01 15:47:01 +08:00
.bar {
width: 100%;
height: 70px;
background-color: white;
position: fixed;
bottom: 0px;
display: flex;
align-items: center;
justify-content: space-between;
}
2023-12-01 16:40:20 +08:00
2023-12-01 15:47:01 +08:00
.content {
background: #f4f5f6;
}
.container {
width: 100%;
height: 100vh;
box-sizing: border-box;
padding-top: 88px;
}
.my-header {
width: 100%;
height: 88px;
background: #ffffff;
display: flex;
align-items: center;
justify-content: space-between;
color: #000;
box-sizing: border-box;
padding: 0px 15px;
padding-top: 40px;
.my-icons {
width: 20px;
}
position: fixed;
top: 0px;
}
2024-06-07 15:10:38 +08:00
</style>