9 Commits

Author SHA1 Message Date
xiaozhiyong
6150eb2b67 更新 2023-07-24 10:16:59 +08:00
xiaozhiyong
1da4c2de7a 更新 2023-07-04 16:54:48 +08:00
xiaozhiyong
7be8276544 格式化 2023-07-04 16:54:24 +08:00
ea5b71c1ae Merge pull request 'g7加油逻辑' (#5) from lc into master
Reviewed-on: #5
2023-04-07 08:46:47 +00:00
骆超
c995d7d373 g7加油逻辑 2023-04-07 16:45:31 +08:00
fb2f8fcd64 Merge pull request 'g7加油逻辑' (#4) from lc into master
Reviewed-on: #4
2023-04-06 07:08:07 +00:00
骆超
4b1602af42 g7加油逻辑 2023-04-06 15:07:13 +08:00
c916caf705 Merge pull request 'g7加油逻辑' (#3) from ccaolc into master
Reviewed-on: #3
2023-04-03 08:30:06 +00:00
骆超
1ac4d50569 g7加油逻辑 2023-04-03 16:28:17 +08:00
7 changed files with 317 additions and 210 deletions

View File

@@ -1,11 +1,11 @@
import request from '@/utils/request'
const service_name = "cloud-site-service"
const group_name = "tbOilOrder"
const service_name = "oil-site"
const group_name = "g7"
export default {
// G7订单支付状态
getPayStatus(id) {
return request({
url: `/${service_name}/${group_name}/get/${id} `,
url: `/${service_name}/${group_name}/getOrderStatus/${id} `,
method: 'get',
})
}

View File

@@ -52,6 +52,14 @@ export default{
data: data
})
},
// G7下单接口
G7Pay(data) {
return request({
url: `/${service_name}/g7/qrCodePay`,
method: 'post',
data: data
})
},
// 则一下单接口
zeyiPay(data) {
return request({

View File

@@ -30,9 +30,9 @@
<view class="margin text-center">
<button class="cu-btn round bg-main-oil lg text-lg" open-type="getPhoneNumber"
@getphonenumber="decryptPhoneNumber">
<text class="cuIcon-weixin padding-right-xs"> </text>
<!-- <text class="cuIcon-weixin padding-right-xs"> </text> -->
<text>
微信用户一键登录
手机号快捷登录
</text>
</button>
<!-- <button class="cu-btn round btnSize" open-type="getPhoneNumber"

View File

@@ -120,6 +120,8 @@
if (res.indexOf('fykc') != -1 ){
url = '/pages/stationDetail/ZYSite?type=fykc'
console.log('这里是测试福佑' ,res.substring(0,7))
}else if (tag == "SP") {
url = '/pages/stationDetail/ZYSite?type=G7'
} else if (tag == "XM" || tag == "HT" || tag == "G7") {
url = '/pages/stationDetail/stationDetail?type=G7'
} else if (res.indexOf('ZEYI') != -1 ){

View File

@@ -21,18 +21,21 @@
<text>请勿离开当前页面,等待支付完成</text>
</view>
<view class="payStatue_p" v-if="payState == 2">
<button style="width: 500upx;margin-bottom: 40upx;" v-if="payState == 2" class="round large cu-btn bg-main-oil" @tap="singleCheck(orderId)">手动刷新</button>
<button style="width: 500upx;margin-bottom: 40upx;" v-if="payState == 2"
class="round large cu-btn bg-main-oil" @tap="singleCheck(orderId)">手动刷新</button>
</view>
</view>
<view class="margin-bottom-sm" @tap="copyId(orderInfos.customerId,'司机编号')">
司机编号
<text class="fr">{{orderInfos.customerId}}<text :class="orderInfos.customerId?'cuIcon-copy':''" class="flex-sub padding-left-sm text-right text-lg text-red">
<text class="fr">{{orderInfos.customerId}}<text :class="orderInfos.customerId?'cuIcon-copy':''"
class="flex-sub padding-left-sm text-right text-lg text-red">
</text></text>
</view>
<view class="margin-bottom-sm">
加油司机
<view class="fr">
<text>{{ orderInfos.customerName ? orderInfos.customerName : '丰油用户' }}</text> <text class="padding-left-sm">{{orderInfos.plateNumber|plateFilter}}
<text>{{ orderInfos.customerName ? orderInfos.customerName : '丰油用户' }}</text> <text
class="padding-left-sm">{{orderInfos.plateNumber|plateFilter}}
</text>
</view>
@@ -95,7 +98,8 @@
<view class="radius bg-white margin margin-bottom-0 padding">
<view class="margin-bottom-sm" @tap="copyId(orderInfos.orderSerialNumber,'订单号')">
订单号
<text class=" fr">{{orderInfos.orderSerialNumber}}<text class="flex-sub padding-left-sm text-right cuIcon-copy text-lg text-red">
<text class=" fr">{{orderInfos.orderSerialNumber}}<text
class="flex-sub padding-left-sm text-right cuIcon-copy text-lg text-red">
</text></text>
</view>
<view class="margin-bottom-sm">
@@ -134,9 +138,12 @@
<!-- <button v-show="formQr" @tap="scanQr" class="bg-main-oil margin-bottom">
<text class="cuIcon-scan padding-right-xs"></text>
继续加油</button> -->
<button v-if="payState == 1" class="round large cu-btn bg-main-oil btn-oils" @tap="toDetails(orderId)">前往订单</button>
<button v-if="payState == 2" class="round large cu-btn bg-main-oil btn-oils" @tap="getScanning()">重新扫码下</button>
<button v-if="payState != 0" class="round large cu-btn bg-main-oil btn-oils" @tap="gotoHome()">返回首页</button>
<button v-if="payState == 1" class="round large cu-btn bg-main-oil btn-oils"
@tap="toDetails(orderId)">前往订</button>
<button v-if="payState == 2" class="round large cu-btn bg-main-oil btn-oils"
@tap="getScanning()">重新扫码下单</button>
<button v-if="payState != 0" class="round large cu-btn bg-main-oil btn-oils"
@tap="gotoHome()">返回首页</button>
<!-- <button class="bg-red light margin-bottom" @tap="backHome">
<text class="cuIcon-home padding-right-xs"></text>
返回首页</button> -->
@@ -214,7 +221,8 @@
orderInfos: {}
}
},
filters:{numberFormat(value) {
filters: {
numberFormat(value) {
if (value != 'xxx.x') {
console.log('old:', value)
let realAmount = value.toFixed(2)
@@ -251,15 +259,13 @@
getScanning() { //支付取消 或失败 前往重新下单
uni.redirectTo({
url: '/pages/stationDetail/stationDetail',
fail: (err) => {
}
fail: (err) => {}
})
},
gotoHome() { // 返回首页
uni.reLaunch({
url: '/pages/index/index',
fail: (err) => {
}
fail: (err) => {}
})
},
singleCheck(ids) { //单独调用check 订单状态
@@ -267,7 +273,7 @@
oilFinanceApi.checkOrderState(ids).then((res) => {
console.log(res)
if (res.code == 20000) {
_that.displayMoney =res.data.payRealAmount
_that.displayMoney = res.data.sitePriceAmount
_that.orderInfos = res.data
console.log(_that.orderInfos)
_that.payState = res.data.orderStatus
@@ -372,6 +378,7 @@
page {
background-color: #efefef;
}
.page-content {
background-color: #f1f2f7;
min-height: 100%;
@@ -429,6 +436,7 @@
display: block;
border-radius: 0 0 0 100upx;
}
.payStatue_text {
font-size: 36rpx;
color: #737373;
@@ -437,6 +445,7 @@
text-align: center;
margin-top: 6rpx;
}
.payStatue_p {
font-size: 26rpx;
color: #888888;
@@ -445,6 +454,7 @@
margin-bottom: 30rpx;
margin-top: 20rpx;
}
.btn-oils {
width: 100%;
border-radius: 14rpx;
@@ -453,14 +463,17 @@
/* padding: 14rpx; */
height: 80rpx;
}
.showimgs {
width: 130rpx;
height: 130rpx;
}
.boxsings_main_top {
position: relative;
margin-top: 90rpx;
}
.showIcons {
background-color: #fff;
background-size: cover;

View File

@@ -403,7 +403,7 @@
// this.type = 'fykc' //根据option.type 进行本地赋值
// }
if (this.qrCode) {
if (this.qrCode.substr(0, 2) == 'HT' || this.qrCode.substr(0, 2) == 'G7') {
if (this.qrCode.substr(0, 2) == 'HT' || this.qrCode.substr(0, 2) == 'G7'|| this.type === 'G7') {
this.isG7 = true
console.log('G7加油站')
}
@@ -650,6 +650,10 @@
this.SfOrder()
return
}
if (this.type === 'G7') {
this.G7Order()
return
}
if (this.type == 'fykc') {
this.FyOrder()
return
@@ -851,6 +855,87 @@
url: '/pages/stationDetail/OrderStatus?item=' + item
})
},
// g7
G7Order() {
const g7OrderInfo = {
qr_code: uni.getStorageSync('qrCode'), //类型String 必有字段 二维码 qrcode
station_id: this.siteData.siteId, //类型String 必有字段 油站id siteId
oilPriceId: this.insertResult.priceId, //类型String 必有字段 油价id priceId
driver_phone: this.siteData.customerPhone, //类型String 必有字段 油价id priceId
companyId: this.siteData.companyId, //类型String 必有字段 企业id companyId
customerId: this.siteData.customerId, //类型String 必有字段 司机id customerId
truck_no: this.carNumber,
gun_money: this.insertResult.vol, //类型String 必有字段 备注:加油升数
gun_number: this.insertResult.bar, //类型String 必有字段 备注:加油升数
deduction_mode: 1,
}
console.log("加油信息===================",this.insertResult)
console.log(g7OrderInfo)
if (!g7OrderInfo.qr_code) {
uni.showToast({
title: 'qr_code为空',
icon: 'none'
});
this.shake=null
return false
}
if (!g7OrderInfo.station_id) {
uni.showToast({
title: '请选择油站id',
icon: 'none'
});
this.shake=null
return false
}
if (!g7OrderInfo.companyId) {
uni.showToast({
title: '请选择企业id',
icon: 'none'
});
this.shake=null
return false
}
if (!g7OrderInfo.customerId) {
uni.showToast({
title: '请选择司机id',
icon: 'none'
});
this.shake=null
return false
}
if (!g7OrderInfo.gun_money) {
uni.showToast({
title: '请输入加油金额',
icon: 'none'
});
this.shake=null
return false
}
oliSiteApi.G7Pay(g7OrderInfo).then(res => {
if (res.code === 20000) {
uni.showToast({
title: '下单成功!'
});
uni.setStorageSync('orderSource', 'mpxoil')
console.log("是否是g7================",this.isG7)
if (!this.isG7) {
setTimeout(() => {
this.toDetails(res.data.orderId)
}, 400)
} else {
this.beforePay = false
setTimeout(() => {
this.orderId = res.data.orderId
console.log("queryTimer",this.orderId)
this.queryTimer()
console.log("getPayStatus",this.orderId)
this.getPayStatus(this.orderId)
}, 400)
}
this.shake=null
}
})
},
//日日顺
RrsOrder() {
const data6 = {
@@ -970,8 +1055,6 @@
companyId: this.siteData.companyId, //类型String 必有字段 备注企业id
oilsBar: this.insertResult.bar,
oilsCode: this.insertResult.oilProductCode,
version: 1,
xoilAmountGun: this.insertResult.vol,
orderMethod: "SITE_SCAN", //类型String 必有字段 备注:订单产生方式
suppleMark: 0,
orderType: "REAL_ORDER", //类型String 必有字段 备注:订单类型 ( REAL_ORDER真实订单 VIRTUAL_ORDER虚拟订单)
@@ -1225,11 +1308,12 @@
}
if (res.data.payState == 1) {
clearInterval(this.timer)
this.toDetails(res.data.payOrderId)
this.toDetails(id)
}
}
})
},
toDetails(id) {
uni.setStorageSync('orderId', id)
console.log('id', id)

View File

@@ -7,7 +7,7 @@ import utils from '@/utils/encode'
//42 洛超 /29 孙志华 /40 阿浩
// 测试日日顺时需要连阿浩
const testUrl = 'http://192.168.54:38080'
const testUrl = 'http://192.168.0.26:38080'
// const productionUrl = 'https://www.51xingka.net/oilApp' // 生产,加密 old
// const productionUrl = 'https://www.xingoil.com/adminapi' // 生产,加密 new
// const productionUrl = 'https://www.xingoil.com/adminapi' // 生产,加密 new