2 Commits

Author SHA1 Message Date
caolc
8ecd248e26 1 2023-08-30 10:09:29 +08:00
caolc
05622744a9 1 2023-08-30 10:07:17 +08:00
8 changed files with 267 additions and 567 deletions

View File

@@ -75,7 +75,7 @@
// });
},
onHide: function() {
console.log('App Hide')
console.log('App Hide ')
}
}
</script>

View File

@@ -29,12 +29,4 @@ export default {
data: data
})
},
//订单导出
getOrderInfoExport(data) {
return request({
url: `/${service_name}/oilOrderInfoExcel/getOrderInfoExport`,
method: 'POST',
data:data
})
},
}

View File

@@ -1,6 +1,6 @@
{
"name" : "星油云站",
"appid" : "__UNI__EA8D131",
"appid" : "__UNI__F1ED4B9",
"description" : "",
"versionName" : "1.0.0",
"versionCode" : "100",

103
package-lock.json generated
View File

@@ -1,109 +1,8 @@
{
"name": "lsm_oil_site",
"version": "1.0.0",
"lockfileVersion": 2,
"lockfileVersion": 1,
"requires": true,
"packages": {
"": {
"name": "lsm_oil_site",
"version": "1.0.0",
"license": "ISC",
"dependencies": {
"axios": "^0.19.2",
"crypto-js": "4.0.0",
"js-cookie": "2.2.1",
"js-md5": "0.7.3",
"jsencrypt": "^3.0.0-rc.1",
"tki-qrcode": "^0.1.6",
"tsc": "^2.0.3",
"typescript": "^4.3.5",
"uview-ui": "^1.8.4"
}
},
"node_modules/axios": {
"version": "0.19.2",
"resolved": "https://registry.npmjs.org/axios/-/axios-0.19.2.tgz",
"integrity": "sha512-fjgm5MvRHLhx+osE2xoekY70AhARk3a6hkN+3Io1jc00jtquGvxYlKlsFUhmUET0V5te6CcZI7lcv2Ym61mjHA==",
"deprecated": "Critical security vulnerability fixed in v0.21.1. For more information, see https://github.com/axios/axios/pull/3410",
"dependencies": {
"follow-redirects": "1.5.10"
}
},
"node_modules/crypto-js": {
"version": "4.0.0",
"resolved": "https://registry.npm.taobao.org/crypto-js/download/crypto-js-4.0.0.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fcrypto-js%2Fdownload%2Fcrypto-js-4.0.0.tgz",
"integrity": "sha1-KQSrJnep0EKFai6i74DekuSjbcw="
},
"node_modules/debug": {
"version": "3.1.0",
"resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz",
"integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==",
"dependencies": {
"ms": "2.0.0"
}
},
"node_modules/follow-redirects": {
"version": "1.5.10",
"resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.5.10.tgz",
"integrity": "sha512-0V5l4Cizzvqt5D44aTXbFZz+FtyXV1vrDN6qrelxtfYQKW0KO0W2T/hkE8xvGa/540LkZlkaUjO4ailYTFtHVQ==",
"dependencies": {
"debug": "=3.1.0"
},
"engines": {
"node": ">=4.0"
}
},
"node_modules/js-cookie": {
"version": "2.2.1",
"resolved": "https://registry.npm.taobao.org/js-cookie/download/js-cookie-2.2.1.tgz",
"integrity": "sha1-aeEG3F1YBolFYpAqpbrsN0Tpsrg="
},
"node_modules/js-md5": {
"version": "0.7.3",
"resolved": "https://registry.npm.taobao.org/js-md5/download/js-md5-0.7.3.tgz",
"integrity": "sha1-tPL7sLMnRV9ZjWcn447Ccs0Jw/I="
},
"node_modules/jsencrypt": {
"version": "3.0.0-rc.1",
"resolved": "https://registry.npm.taobao.org/jsencrypt/download/jsencrypt-3.0.0-rc.1.tgz",
"integrity": "sha1-DgpHRLpDzFV/tc9i/oZGvOtWGxw="
},
"node_modules/ms": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz",
"integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g="
},
"node_modules/tki-qrcode": {
"version": "0.1.6",
"resolved": "https://registry.npm.taobao.org/tki-qrcode/download/tki-qrcode-0.1.6.tgz",
"integrity": "sha1-cTc9nEs/iUT6pU0+6Ziroz2X3n8="
},
"node_modules/tsc": {
"version": "2.0.3",
"resolved": "https://registry.nlark.com/tsc/download/tsc-2.0.3.tgz",
"integrity": "sha1-A3/leeO9Z6XL2qYEtDxsGZGwS+8=",
"bin": {
"tsc": "bin/tsc"
}
},
"node_modules/typescript": {
"version": "4.3.5",
"resolved": "https://registry.nlark.com/typescript/download/typescript-4.3.5.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.nlark.com%2Ftypescript%2Fdownload%2Ftypescript-4.3.5.tgz",
"integrity": "sha1-TRw3zBbok5c8RaBohrcRMjTxGfQ=",
"bin": {
"tsc": "bin/tsc",
"tsserver": "bin/tsserver"
},
"engines": {
"node": ">=4.2.0"
}
},
"node_modules/uview-ui": {
"version": "1.8.4",
"resolved": "https://registry.npmjs.org/uview-ui/-/uview-ui-1.8.4.tgz",
"integrity": "sha512-Zr+D5dFdNy6CdHQLBEXeGq/w0LkjxzBtsgaaDwLl0P58g67H7fBBDvy6AzWK/k0c7dwPYMBiK7I4Tr9p92+0DA=="
}
},
"dependencies": {
"axios": {
"version": "0.19.2",

View File

@@ -46,13 +46,6 @@
</view>
</scroll-view>
</view> -->
<view v-if="exportShow==true">
<view style="padding: 30upx;"></view>
<view style="position: fixed;width: 750upx;z-index: 5;text-align: right;top:315upx;right: 30upx;">
<button class="cu-btn bg-white" @click="orderExport">订单导出</button>
</view>
</view>
<view class="padding  padding-bottom-0" style="padding-top: 200upx;">
<!-- 0 全部 1 待支付 2 已支付 3退款 -->
<view v-show="TabCur==2" class="order-list">
@@ -100,44 +93,12 @@
</view>
</view>
</view>
<uni-popup ref="popup">
<view class="popup_card">
<view class="popup_card_from">
<view class="popup_card_from_item">
<view class="popup_card_from_item_left_text">邮箱</view>
<input v-model="params.email" class="card_item_input" placeholder="请输入邮箱" />
</view>
<view class="popup_card_from_item">
<view class="popup_card_from_item_left_text">开始时间</view>
<view class="uni-list-cell-db">
<picker mode="date" :value="startDate" @change="startDateChange" class="uni-picker">
<view class="uni-input">{{startDate}}</view>
</picker>
</view>
</view>
<view class="popup_card_from_item">
<view class="popup_card_from_item_left_text">结束时间</view>
<view class="uni-list-cell-db">
<picker mode="date" :value="endDate" @change="endDateChange" :start="endStartDate" :end="endEndDate" class="uni-picker">
<view class="uni-input">{{endDate}}</view>
</picker>
</view>
</view>
</view>
<view class="popup_card_bottom">
<button @click="$refs.popup.close()" class="popup_card_bottom_close">取消</button>
<button @click="report" class="popup_card_bottom_submit">导出</button>
</view>
</view>
</uni-popup>
</view>
</template>
<script>
import cloudSiteApi from '@/api/cloud-site.js'
import oliSiteApi from '@/api/oli-site.js'
import oliFinanceApi from '@/api/oil-finance.js'
import OrderItem from '@/packageOrders/components/order-item.vue'
import UniLoadMore from '@/components/uni-load-more/uni-load-more.vue'
@@ -193,20 +154,7 @@
loadStatus3: 'loading',
isLoadMore4: false,
loadStatus4: 'loading',
},
params: {
siteId: uni.getStorageSync('oilSitePriceId'),
siteName: uni.getStorageSync('oilSitePriceName'),
email:'',
startTime:'',
endTime:''
},
startDate:'',
endDate:'',
endStartDate:'',
endEndDate:'',
exportShow:false
}
}
},
@@ -216,23 +164,6 @@
this.loadList(0, this.pageNumber2, 'created')
this.loadList(1, this.pageNumber3, 'created')
this.loadList(-2, this.pageNumber4, 'created')
let exportList = [
'1689181519096909824',
'1689182438357262336',
'1689183144276463616',
'1689183774927818752',
'1689184331812888576',
'1689185023261741056'
]
var exportFields = exportList.filter((item) => {
return item == uni.getStorageSync('oilSitePriceId');
})
if(exportFields.length>0){
this.exportShow = true
}else{
this.exportShow = false
}
},
onLoad() {
uni.setStorageSync('orderType', 1)
@@ -257,21 +188,25 @@
// console.log(from,'loadMoreOrder时间')
// <!-- 0 全部 1 待支付 2 已支付 3退款 -->
if (this.TabCur === 0) {
console.log('这里是0')
if (this.load.loadStatus3 != 'nomore') { //此处判断,上锁,防止重复请求
this.load.isLoadMore3 = true
this.calcIstate(this.TabCur)
}
} else if (this.TabCur === 1) {
console.log('这里是1')
if (this.load.loadStatus2 != 'nomore') { //此处判断,上锁,防止重复请求
this.load.isLoadMore2 = true
this.calcIstate(this.TabCur)
}
} else if (this.TabCur === 2) {
console.log('这里是2')
if (this.load.loadStatus1 != 'nomore') { //此处判断,上锁,防止重复请求
this.load.isLoadMore1 = true
this.calcIstate(this.TabCur)
}
} else if (this.TabCur === 3) {
console.log('这里是3')
if (this.load.loadStatus4 != 'nomore') { //此处判断,上锁,防止重复请求
this.load.isLoadMore4 = true
this.calcIstate(this.TabCur)
@@ -281,11 +216,15 @@
tabSelect(e) {
this.TabCur = e.currentTarget.dataset.id;
this.scrollLeft = (e.currentTarget.dataset.id - 1) * 60
// console.log('tabSelect时间')
this.loadMoreOrder('tabSelect')
},
pickSource(e) {
console.log(e)
this.indexSource = parseInt( e.detail.value)
console.log(this.indexSource)
this.activeSource = this.sources[this.indexSource]
console.log(this.activeSource )
uni.setStorageSync('orderType', this.indexSource)
this.pageNumber1 = 0
this.pageNumber2 = 0
@@ -326,6 +265,11 @@
}
},
loadList(istate, pageNumber, from) {
// console.log(istate)
// console.log(pageNumber)
// console.log(from)
console.log( this.startTime)
console.log( this.endTime)
let that = this
const data2 = {
istate: istate, //类型Number 必有字段 备注:订单状态 0待支付 1支付成功 查所有传 ''
@@ -333,6 +277,7 @@
// startTime: that.startTime,
// endTime: that.endTime
}
console.log('这里是this.indexSource',this.indexSource)
if (this.indexSource == 0) {
// 网页版
if (data2.istate == -3) {
@@ -340,11 +285,17 @@
} else if (data2.istate == -2) {
data2.istate = 3
}
console.log(data2)
oliSiteApi.getNewItemSiteOrder(data2).then(res => {
console.log(res)
console.log('-----------------------------------------')
// console.log('参数', data2.istate, '页码', data2.pageIndex, '来源', from)
if (res.code === 20000) {
switch (istate) {
case -3:
console.log('获取全部')
console.log(res.data)
console.log(this.allOrder)
this.allOrder = this.allOrder.concat(res.data)
if (res.data.length < 10) { //判断接口返回数据量小于请求数据量,则表示此为最后一页
this.load.isLoadMore1 = true
@@ -355,6 +306,9 @@
}
break
case -2:
console.log('退款')
console.log(res.data)
console.log(this.allOrder)
this.refundOrder = this.refundOrder.concat(res.data)
if (res.data.length < 10) { //判断接口返回数据量小于请求数据量,则表示此为最后一页
@@ -366,6 +320,9 @@
}
break
case 0:
console.log('待支付')
console.log(res.data)
console.log(this.allOrder)
this.payingOrder = this.payingOrder.concat(res.data)
if (res.data.length < 10) { //判断接口返回数据量小于请求数据量,则表示此为最后一页
@@ -377,6 +334,9 @@
}
break
case 1:
console.log('已支付')
console.log(res.data)
console.log(this.allOrder)
this.finishedOrder = this.finishedOrder.concat(res.data)
if (res.data.length < 10) { //判断接口返回数据量小于请求数据量,则表示此为最后一页
this.load.isLoadMore3 = true
@@ -399,10 +359,17 @@
} else if (data2.istate == -2) {
data2.istate = 3
}
console.log(data2)
oliSiteApi.getNewItemSiteOrder(data2).then(res => {
console.log(res)
console.log('+++++++++++++++++++++++++++++++++++++++++')
// console.log(data2.istate, data2.pageIndex)
if (res.code === 20000) {
switch (istate) {
case 1:
console.log('获取全部')
console.log(res.data)
console.log(this.allOrder)
this.allOrder = this.allOrder.concat(res.data)
if (res.data.length < 10) { //判断接口返回数据量小于请求数据量,则表示此为最后一页
@@ -415,6 +382,9 @@
break
case -2:
console.log('退款')
console.log(res.data)
console.log(this.allOrder)
this.refundOrder = this.refundOrder.concat(res.data)
if (res.data.length < 10) { //判断接口返回数据量小于请求数据量,则表示此为最后一页
this.load.isLoadMore4 = true
@@ -425,6 +395,9 @@
}
break
case 0:
console.log('待支付')
console.log(res.data)
console.log(this.allOrder)
this.payingOrder = this.payingOrder.concat(res.data)
if (res.data.length < 10) { //判断接口返回数据量小于请求数据量,则表示此为最后一页
this.load.isLoadMore2 = true
@@ -435,6 +408,9 @@
}
break
case -3:
console.log('全部')
console.log(res.data)
console.log(this.allOrder)
this.finishedOrder = this.finishedOrder.concat(res.data)
if (res.data.length < 10) { //判断接口返回数据量小于请求数据量,则表示此为最后一页
@@ -449,90 +425,6 @@
}
})
}
},
startDateChange:function(e){
this.startDate = e.detail.value
let data=this.startDate
this.endStartDate = data
this.endEndDate = this.getEndDate(Date.parse(data)+ 3600 * 1000 * 24 * 30)
this.params.startTime = this.startDate
},
endDateChange:function(e){
if(this.startDate ==''){
uni.showToast({
title: '请先选择开始时间',
icon: 'none'
});
}else{
this.endDate = e.detail.value
this.params.endTime = this.endDate
}
},
getEndDate(val){
let nowDate = new Date(val)
let year = nowDate.getFullYear();
let month = nowDate.getMonth() + 1 < 10 ? "0" + (nowDate.getMonth() + 1) : nowDate.getMonth() + 1;
let day = nowDate.getDate() < 10 ? "0" + nowDate.getDate() : nowDate.getDate();
return year + "-" + month + "-" + day
},
orderExport(){
this.startDate = ''
this.endDate = ''
this.params.email = ''
this.params.startTime = ''
this.params.endTime = ''
this.$refs.popup.open('center')
},
report() {
if (this.params.email == '') {
uni.showToast({
title: '电子邮箱不能为空',
icon: 'none'
});
return false
} else if (this.params.email != '') {
const emailRegex = /^([0-9A-Za-z\-_\.]+)@([0-9a-z]+\.[a-z]{2,3}(\.[a-z]{2})?)$/g
if (!emailRegex.test(this.params.email)) {
uni.showToast({
title: '电子邮箱格式不准确',
icon: 'none'
});
return false
}
}
if(this.params.startTime==''){
uni.showToast({
title: '请选择开始时间',
icon: 'none'
});
return false
}
if(this.params.endTime==''){
uni.showToast({
title: '请选择结束时间',
icon: 'none'
});
return false
}
uni.showModal({
content: '请确认邮箱 \n'+this.params.email,
success: (res)=> {
if (res.confirm) {
oliFinanceApi.getOrderInfoExport(this.params).then(res => {
if (res.code == 20000) {
uni.showToast({
title: res.msg,
icon: 'none'
});
this.$refs.popup.close();
}
})
}
}
});
}
}
}
@@ -556,73 +448,4 @@
width: 750upx;
z-index: 3;
}
.uni-input{
height: 25rpx;
}
.uni-picker{
height: 25rpx;
}
.uni-list-cell-db{
width: 100%;
height: 30rpx;
}
.popup_card_bottom {
display: flex;
justify-content: center;
margin-top: 68rpx;
}
.popup_card_bottom_submit {
background: #FE0505;
color: #ffffff;
font-size: 25rpx;
width: 240rpx;
}
.popup_card_bottom_close {
background: #FFFFFF;
font-size: 25rpx;
width: 240rpx;
}
.popup_card_from_item_right_text {
font-size: 24rpx;
color: #000000;
max-width: 50%;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
margin-right: 25rpx;
}
.popup_card_from_item_left_text {
width: 150rpx;
font-size: 24rpx;
color: #666666;
}
.popup_card_from_item {
display: flex;
align-items: center;
margin-bottom: 40rpx;
}
.popup_card_title {
text-align: center;
font-weight: 500;
color: #000000;
font-size: 36rpx;
margin-bottom: 80rpx;
}
.popup_card {
width: 681rpx;
height: 528rpx;
background: #FFFFFF;
border-radius: 15px;
padding: 64rpx;
}
</style>

View File

@@ -429,7 +429,6 @@
this.showHeight = '340rpx'
}
uni.setStorageSync('oilSitePriceId',res.data.site.id)
uni.setStorageSync('oilSitePriceName',res.data.site.siteName)
}
})
},

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

@@ -9,62 +9,59 @@
<image src="../../static/img/new_logo.png" class='showimgs' mode=""></image>
</view>
</view>
<view class="radius margin bg-white padding-top padding " style="padding-top: 125rpx;">
<view class="">
<view class="payStatue_text">
<text>{{PayTitle}}</text>
</view>
<view class="number text-xl text-center oil-main-color">{{displayMoney|numberFormat}}</view>
</view>
<view class="payStatue">
<view class="payStatue_p" v-if="payState == 0">
<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>
</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></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>
</view>
<view class="radius margin bg-white padding-top padding " style="padding-top: 125rpx;">
<view class="">
<view class="payStatue_text">
<text>{{PayTitle}}</text>
</view>
<view class="number text-xl text-center oil-main-color">{{displayMoney|numberFormat}}</view>
</view>
<view class="payStatue">
<view class="payStatue_p" v-if="payState == 0">
<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>
</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></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>
</view>
</view>
</view>
<!-- <view class="margin-bottom-sm" @tap="copyId(orderItem.carNo,'司机车牌')">
<!-- <view class="margin-bottom-sm" @tap="copyId(orderItem.carNo,'司机车牌')">
司机车牌
<text class="fr">{{orderItem.carNo?orderItem.carNo:'暂无'}}<text :class="orderItem.carNo?'cuIcon-copy':''" class="flex-sub padding-left-sm text-right text-lg text-red">
</text></text>
</view> -->
<view class="margin-bottom-sm">
油枪油号
<text class="fr">{{orderInfos.oilsBar}}号枪{{orderInfos.oilName||orderInfos.oilsCode}}</text>
</view>
<view class="margin-bottom-sm">
油机单价
<text class="fr">{{orderInfos.sitePrice||orderInfos.price |UnitPriceFormat}} / </text>
</view>
<view class="margin-bottom-sm">
加油升数
<text class="fr">{{orderInfos.volume|numberFormat}} </text>
</view>
<view class="margin-bottom-sm" v-if="orderSource=='mpxoil'">
油机总价
<text class="fr">{{displayMoney|numberFormat}}</text>
</view>
<view class="margin-bottom-sm">
油枪油号
<text class="fr">{{orderInfos.oilsBar}}号枪{{orderInfos.oilName||orderInfos.oilsCode}}</text>
</view>
<view class="margin-bottom-sm">
油机单价
<text class="fr">{{orderInfos.sitePrice||orderInfos.price |UnitPriceFormat}} / </text>
</view>
<view class="margin-bottom-sm">
加油升数
<text class="fr">{{orderInfos.volume|numberFormat}} </text>
</view>
<view class="margin-bottom-sm" v-if="orderSource=='mpxoil'">
油机总价
<text class="fr">{{displayMoney|numberFormat}}</text>
</view>
<!-- <view class="margin-bottom-sm" v-if="orderItem.xoilDiscountAmount">
<!-- <view class="margin-bottom-sm" v-if="orderItem.xoilDiscountAmount">
星卡优惠
<text class="fr">¥ {{(orderItem.xoilDiscountAmount)|numberFormat}}</text>
</view>
@@ -76,84 +73,80 @@
优惠券
<text class="fr">{{orderItem.coupon|couponFormat}}</text>
</view> -->
<!-- <view class="margin-bottom-sm">
<!-- <view class="margin-bottom-sm">
实扣款
<text class="fr oil-main-color">¥ {{orderItem.realamount|numberFormat}}</text>
</view> -->
</view>
<view class="radius bg-white margin padding ">
<view class="flex padding-bottom-sm">
<view class="basis-sm">
加油站名称
</view>
<view class="basis-lg text-right text-cut">{{orderItem.siteName}}</view>
</view>
<view class="flex padding-bottom-sm">
<view class="basis-xs">
地址
<view class="radius bg-white margin padding ">
<view class="flex padding-bottom-sm">
<view class="basis-sm">
加油站名称
</view>
<view class="basis-lg text-right text-cut">{{orderItem.siteName}}</view>
</view>
<view class="flex padding-bottom-sm">
<view class="basis-xs">
地址
</view>
<view class="basis-xl text-right text-cut">{{orderItem.siteAddress}}</view>
</view>
</view>
<view class="basis-xl text-right text-cut">{{orderItem.siteAddress}}</view>
</view>
</view>
<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></text>
</view>
<view class="margin-bottom-sm">
下单时间
<text class="fr">{{orderInfos.createTime}}</text>
</view>
<!-- <view class="margin-bottom-sm">
<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></text>
</view>
<view class="margin-bottom-sm">
下单时间
<text class="fr">{{orderInfos.createTime}}</text>
</view>
<!-- <view class="margin-bottom-sm">
扣款时间
<text class="fr">{{orderItem.paydatetime}}</text>
</view> -->
<!-- <view class="padding-bottom-sm">
<!-- <view class="padding-bottom-sm">
开票状态
<text class="fr" v-if="formQr">未开票</text>
<text class="fr" v-else>{{orderItem.invoiceState|invoiceStateFormat}}</text>
</view> -->
<!-- <view class="margin-bottom-sm" v-if="orderItem.paydatetime">
<!-- <view class="margin-bottom-sm" v-if="orderItem.paydatetime">
支付时间
<text class="fr">{{orderItem.paydatetime}}</text>
</view>-->
</view>
<view class="radius bg-white margin margin-bottom-0 padding" v-if='orderItem.plateNumberImages'>
<view class="flex padding-bottom-sm">
<view class="basis-sm">
车辆照片
</view>
<view class="basis-lg text-right text-cut" @tap="showImg('car')">点击查看</view>
</view>
<view class="flex padding-bottom-sm">
<view class="basis-xs">
油站照片
<view class="radius bg-white margin margin-bottom-0 padding" v-if='orderItem.plateNumberImages'>
<view class="flex padding-bottom-sm">
<view class="basis-sm">
车辆照片
</view>
<view class="basis-lg text-right text-cut" @tap="showImg('car')">点击查看</view>
</view>
<view class="flex padding-bottom-sm">
<view class="basis-xs">
油站照片
</view>
<view class="basis-xl text-right text-cut" @tap="showImg('oli')">点击查看</view>
</view>
</view>
<view class="basis-xl text-right text-cut" @tap="showImg('oli')">点击查看</view>
</view>
</view>
<view class="padding-lg padding-top-40 padding-bottom-xl">
<!-- <button v-show="formQr" @tap="scanQr" class="bg-main-oil margin-bottom">
<view class="padding-lg padding-top-40 padding-bottom-xl">
<!-- <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 class="bg-red light margin-bottom" @tap="backHome">
<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> -->
</view>
<u-popup v-model="show" mode="center" @close="close">
<view style="width: 100%;height: 100%;">
<image :src="showUrl" style=" max-width: 80%;max-height: 80%;" mode=""></image>
</view>
</u-popup>
</view>
<u-popup v-model="show" mode="center" @close="close" >
<view style="width: 100%;height: 100%;">
<image :src="showUrl" style=" max-width: 80%;max-height: 80%;" mode=""></image>
</view>
</u-popup>
<!-- <view class="margin-sm bg-white padding-lg">
<view class="padding-top margin-bottom"></view>
<view class="text-xsl text-center">
@@ -208,98 +201,99 @@
<script>
import oilFinanceApi from '@/api/oil-finance.js'
export default {
data() {
return {
orderItem: uni.getStorageSync('SiteInfo'),
insertResult: {},
orderId: '',
timerF: '',
checkTime: 40,
payState: 0,
PayTitle: '正在支付中',
orderInfos: {}
export default{
data(){
return{
orderItem:uni.getStorageSync('SiteInfo'),
insertResult:{},
orderId:'',
timerF:'',
checkTime:40,
payState:0,
PayTitle:'正在支付中',
orderInfos:{}
}
},
filters: {
numberFormat(value) {
if (value != 'xxx.x') {
console.log('old:', value)
let realAmount = value.toFixed(2)
console.log('new:', realAmount)
return realAmount
} else {
filters:{numberFormat(value) {
if (value != 'xxx.x') {
console.log('old:',value)
let realAmount =value.toFixed(2)
console.log('new:',realAmount)
return realAmount
} else {
return value
}
},
UnitPriceFormat(value){
console.log('++++++++++++++++++++',value)
if(value){
return value
}
},
UnitPriceFormat(value) {
console.log('++++++++++++++++++++', value)
if (value) {
return value
} else {
} else{
return '--'
}
},
},
onLoad(option) {
console.log(option)
let insertResult = JSON.parse(option.item)
let insertResult= JSON.parse(option.item)
this.insertResult = insertResult
console.log(this.insertResult)
this.orderId = insertResult.orderId
let orderId = insertResult.orderId
this.orderId =insertResult.orderId
let orderId=insertResult.orderId
console.log(this.orderId)
this.checkSf(orderId) //进入获取订单信息
this.timerF = setInterval((res) => {
this.checkSf(orderId)//进入获取订单信息
this.timerF = setInterval((res)=>{
this.checkSf(orderId)
}, 5000)
},5000)
},
methods: {
getScanning() { //支付取消 或失败 前往重新下单
methods:{
getScanning(){ //支付取消 或失败 前往重新下单
uni.redirectTo({
url: '/pages/stationDetail/stationDetail',
fail: (err) => {}
fail: (err) => {
}
})
},
gotoHome() { // 返回首页
gotoHome(){ // 返回首页
uni.reLaunch({
url: '/pages/index/index',
fail: (err) => {}
fail: (err) => {
}
})
},
singleCheck(ids) { //单独调用check 订单状态
singleCheck(ids){ //单独调用check 订单状态
let _that = this
oilFinanceApi.checkOrderState(ids).then((res) => {
oilFinanceApi.checkOrderState(ids).then( (res)=>{
console.log(res)
if (res.code == 20000) {
_that.displayMoney = res.data.sitePriceAmount
_that.orderInfos = res.data
if(res.code == 20000){
_that.displayMoney =res.data.payRealAmount
_that.orderInfos = res.data
console.log(_that.orderInfos)
_that.payState = res.data.orderStatus
if (res.data.orderStatus == 0) {
_that.PayTitle = '正在支付中....'
}
if (res.data.orderStatus == 1) {
_that.payState = res.data.orderStatus
if(res.data.orderStatus == 0){
_that.PayTitle = '正在支付中....'
}
if(res.data.orderStatus == 1){
_that.PayTitle = '支付成功'
if (_that.payState != 0 || res.data.orderStatus == 1) {
if(_that.payState != 0 || res.data.orderStatus==1){
console.log('测试手动刷新是否进入清除计时器')
clearInterval(_that.timerF)
}
}
if (res.data.orderStatus == 2) {
if (!res.data.cancelRemak) {
}
if(res.data.orderStatus == 2){
if(!res.data.cancelRemak){
_that.PayTitle = '支付已取消'
} else {
}else{
_that.PayTitle = res.data.cancelRemak
}
if (_that.payState != 0 || res.data.orderStatus == 2) {
}
if(_that.payState != 0 || res.data.orderStatus==2){
console.log('测试手动刷新是否进入清除计时器')
clearInterval(_that.timerF)
}
}
}
})
} )
},
toDetails(id) {
uni.setStorageSync('orderId', id)
@@ -309,20 +303,20 @@
})
},
checkSf(id) { // 轮询 check 顺丰订单状态
checkSf(id){// 轮询 check 顺丰订单状态
let _that = this,
time = _that.checkTime,
ids = id
if (time <= 0) {
if(time<=0){
uni.showToast({
title: '支付已取消'
title:'支付已取消'
})
_that.payState = 0
_that.PayTitle = '三分钟自动取消....'
_that.PayTitle= '三分钟自动取消....'
clearInterval(_that.timerF)
// uni.navigateBack({})
} else {
time--
}else{
time --
_that.singleCheck(ids)
// oilFinanceApi.checkOrderState(ids).then( (res)=>{
// console.log(res)
@@ -375,10 +369,9 @@
</script>
<style scoped>
page {
page{
background-color: #efefef;
}
.page-content {
background-color: #f1f2f7;
min-height: 100%;
@@ -436,8 +429,7 @@
display: block;
border-radius: 0 0 0 100upx;
}
.payStatue_text {
.payStatue_text{
font-size: 36rpx;
color: #737373;
font-weight: bold;
@@ -445,8 +437,7 @@
text-align: center;
margin-top: 6rpx;
}
.payStatue_p {
.payStatue_p{
font-size: 26rpx;
color: #888888;
font-weight: bold;
@@ -454,8 +445,7 @@
margin-bottom: 30rpx;
margin-top: 20rpx;
}
.btn-oils {
.btn-oils{
width: 100%;
border-radius: 14rpx;
margin-top: 30rpx;
@@ -463,18 +453,15 @@
/* padding: 14rpx; */
height: 80rpx;
}
.showimgs {
.showimgs{
width: 130rpx;
height: 130rpx;
}
.boxsings_main_top {
position: relative;
margin-top: 90rpx;
.boxsings_main_top{
position: relative;
margin-top: 90rpx;
}
.showIcons {
.showIcons{
background-color: #fff;
background-size: cover;
position: absolute;