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
5 changed files with 212 additions and 326 deletions

View File

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

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

@@ -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

@@ -7,64 +7,61 @@
<view class="text-center margin-top icon-container boxsings_main_top">
<view class="cu-avatar xl round text-sl headImg showIcons">
<image src="../../static/img/new_logo.png" class='showimgs' mode=""></image>
</view>
</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>
<!-- <view class="margin-bottom-sm" @tap="copyId(orderItem.carNo,'司机车牌')">
<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 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" v-if="orderItem.xoilDiscountAmount">
<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">
星卡优惠
<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,121 +201,122 @@
<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
console.log(this.orderId)
this.checkSf(orderId) //进入获取订单信息
this.timerF = setInterval((res) => {
this.orderId =insertResult.orderId
let orderId=insertResult.orderId
console.log(this.orderId)
this.checkSf(orderId)//进入获取订单信息
this.timerF = setInterval((res)=>{
this.checkSf(orderId)
}, 5000)
},
methods: {
getScanning() { //支付取消 或失败 前往重新下单
},5000)
},
methods:{
getScanning(){ //支付取消 或失败 前往重新下单
uni.redirectTo({
url: '/pages/stationDetail/stationDetail',
fail: (err) => {}
})
fail: (err) => {
}
})
},
gotoHome() { // 返回首页
gotoHome(){ // 返回首页
uni.reLaunch({
url: '/pages/index/index',
fail: (err) => {}
})
},
singleCheck(ids) { //单独调用check 订单状态
let _that = this
oilFinanceApi.checkOrderState(ids).then((res) => {
console.log(res)
if (res.code == 20000) {
_that.displayMoney = res.data.sitePriceAmount
_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.PayTitle = '支付成功'
if (_that.payState != 0 || res.data.orderStatus == 1) {
console.log('测试手动刷新是否进入清除计时器')
clearInterval(_that.timerF)
}
}
if (res.data.orderStatus == 2) {
if (!res.data.cancelRemak) {
_that.PayTitle = '支付已取消'
} else {
_that.PayTitle = res.data.cancelRemak
}
if (_that.payState != 0 || res.data.orderStatus == 2) {
console.log('测试手动刷新是否进入清除计时器')
clearInterval(_that.timerF)
}
}
fail: (err) => {
}
})
},
singleCheck(ids){ //单独调用check 订单状态
let _that = this
oilFinanceApi.checkOrderState(ids).then( (res)=>{
console.log(res)
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.PayTitle = '支付成功'
if(_that.payState != 0 || res.data.orderStatus==1){
console.log('测试手动刷新是否进入清除计时器')
clearInterval(_that.timerF)
}
}
if(res.data.orderStatus == 2){
if(!res.data.cancelRemak){
_that.PayTitle = '支付已取消'
}else{
_that.PayTitle = res.data.cancelRemak
}
if(_that.payState != 0 || res.data.orderStatus==2){
console.log('测试手动刷新是否进入清除计时器')
clearInterval(_that.timerF)
}
}
}
} )
},
toDetails(id) {
uni.setStorageSync('orderId', id)
console.log('id', id)
uni.redirectTo({
url: '/packageOrders/pages/orderList/OrderDetail/OrderDetail'
})
},
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)
@@ -342,7 +336,7 @@
// console.log('this.payState+++',this.payState)
// console.log('res.data.orderStatuse+++',res.data.orderStatus)
// }
// // if(res.data.orderStatus == 1){
// // clearInterval(this.timerF )
// // this.payState = 1
@@ -368,67 +362,66 @@
// // }
// } )
_that.checkTime = time
}
}
},
},
},
}
</script>
<style scoped>
page {
page{
background-color: #efefef;
}
.page-content {
background-color: #f1f2f7;
min-height: 100%;
position: relative;
}
.navigation {
position: absolute;
right: 16px;
top: 10px;
}
.icon-self {
width: 1rem;
height: 1rem;
}
.oil-price {
position: relative;
}
.oil-price radio {
position: absolute;
left: 0rem;
top: 10px;
}
.qr-icon {
font-size: 2rem;
}
.pay-desc {
line-height: 2rem;
}
.bottom-pay {
min-height: 100rpx;
width: 750upx;
}
.pay-bar {
width: 750upx;
position: absolute;
bottom: 0;
}
.money-container {
position: relative;
}
.money-position {
position: absolute;
top: 0;
@@ -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,27 +445,23 @@
margin-bottom: 30rpx;
margin-top: 20rpx;
}
.btn-oils {
.btn-oils{
width: 100%;
border-radius: 14rpx;
margin-top: 30rpx;
font-size: 32rpx;
/* padding: 14rpx; */
height: 80rpx;
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;