Compare commits
5 Commits
xiaozy1
...
e9f7286b7c
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e9f7286b7c | ||
|
|
ad5f3cc7b1 | ||
|
|
d92d2d2e61 | ||
|
|
1c3e0f9662 | ||
|
|
faa5b1f6ab |
23
App.vue
23
App.vue
@@ -65,10 +65,15 @@
|
||||
}
|
||||
})
|
||||
this.onShareAppMessage()
|
||||
|
||||
this.watchOnline()
|
||||
},
|
||||
|
||||
methods: {
|
||||
watchOnline(){
|
||||
uni.$on('isOnline',(e)=>{
|
||||
this.loginStatus = e
|
||||
})
|
||||
},
|
||||
getFilterData() {
|
||||
oilSiteApi.getCheckInfo().then(res => {
|
||||
if (res.code == 20000) {
|
||||
@@ -184,14 +189,14 @@
|
||||
// 是否token过期或ip更改
|
||||
getAmount() {
|
||||
clearTimeout(loginTimer)
|
||||
accountApi.getTotalOilCardInfo().then(res => {
|
||||
if (res.code == 20000) {
|
||||
this.loginStatus = 'online'
|
||||
} else if (res.code == 42011) {
|
||||
this.loginStatus = 'offline'
|
||||
this.msg = res.msg
|
||||
}
|
||||
})
|
||||
// accountApi.getTotalOilCardInfo().then(res => {
|
||||
// if (res.code == 20000) {
|
||||
// this.loginStatus = 'online'
|
||||
// } else if (res.code == 42011) {
|
||||
// this.loginStatus = 'offline'
|
||||
// this.msg = res.msg
|
||||
// }
|
||||
// })
|
||||
},
|
||||
},
|
||||
|
||||
|
||||
@@ -53,10 +53,10 @@
|
||||
</view>
|
||||
|
||||
<view class="cu-form-group text-sm">
|
||||
<view class="" v-if="showRandom" @tap="accuntSourceSelect">
|
||||
<view class="" v-if="showRandom" >
|
||||
当前为验证码登录
|
||||
</view>
|
||||
<view class="" v-else @tap="accuntSourceSelect">
|
||||
<view class="" v-else >
|
||||
当前为密码登录
|
||||
</view>
|
||||
|
||||
@@ -136,7 +136,7 @@
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
showRandom: true,
|
||||
showRandom: false,
|
||||
animation: '',
|
||||
hasPhone: false,
|
||||
userHandle: false,
|
||||
@@ -181,6 +181,7 @@
|
||||
// this.showRandom = true
|
||||
},
|
||||
ifRegistered() {
|
||||
let that = this
|
||||
if (this.driver.username.length != 11) {
|
||||
uni.showToast({
|
||||
title: '手机码验证不通过',
|
||||
|
||||
@@ -120,7 +120,7 @@
|
||||
</view>
|
||||
<view class="padding-tb-xs text-left">
|
||||
加油司机:
|
||||
<text class=" fr">{{order.customerName}} {{order.customerCode}}</text>
|
||||
<text class=" fr">{{user.name}}</text>
|
||||
</view>
|
||||
<view class="padding-tb-xs text-left" v-if="order.oilCardNature">
|
||||
油卡性质:
|
||||
@@ -187,8 +187,8 @@
|
||||
order: {},
|
||||
tyIntervalCount: 0,
|
||||
tySqRes: {},
|
||||
tyPayMethod: null
|
||||
|
||||
tyPayMethod: null,
|
||||
user: uni.getStorageSync('user'),
|
||||
|
||||
}
|
||||
},
|
||||
@@ -219,19 +219,39 @@
|
||||
// },1000)
|
||||
}
|
||||
},
|
||||
onLoad(option) {
|
||||
this.id = option.id;
|
||||
console.log(option,'optionoptionoptionoption')
|
||||
this.getOrderInfo();
|
||||
uni.showShareMenu();
|
||||
this.getOrderQrCode();
|
||||
let _that = this;
|
||||
|
||||
},
|
||||
onUnload(){
|
||||
if(this.timeinterval)clearInterval(this.timeinterval);
|
||||
},
|
||||
onHide(){
|
||||
console.log('onHide')
|
||||
},
|
||||
methods: {
|
||||
newQrString() {
|
||||
this.getOrderQrCode()
|
||||
},
|
||||
getOrderQrCode(){
|
||||
oilSiteApi.getOrderQrCode(this.order.orderSerialNumber).then( (res)=>{
|
||||
console.log(res)
|
||||
oilSiteApi.getOrderQrCode(this.id).then( (res)=>{
|
||||
this.val = res.data
|
||||
if(res.code == 40000){
|
||||
this.showQr = false
|
||||
}else if(res.code == 20000){
|
||||
this.showQr = true
|
||||
this.val =res.data.codeStr
|
||||
this.val =res.data.codeStr;
|
||||
if(!this.timeinterval){
|
||||
this.timeinterval = setInterval(() => {
|
||||
console.log('进入循环')
|
||||
this.newQrString()
|
||||
}, 1000 * 60 * 3);
|
||||
}
|
||||
}
|
||||
} )
|
||||
},
|
||||
@@ -303,7 +323,7 @@
|
||||
if (res.code == 20000) {
|
||||
this.order = res.data
|
||||
uni.setStorageSync('oilItem', res.data)
|
||||
this.getOrderQrCode()
|
||||
// this.getOrderQrCode()
|
||||
if (res.data.payMethod == 2) {
|
||||
this.tyPayMethod = res.data.payMethod
|
||||
// this.queryOrderStatusSq()
|
||||
@@ -333,6 +353,8 @@
|
||||
duration: 1000
|
||||
})
|
||||
setTimeout(() => {
|
||||
uni.navigateBack();
|
||||
uni.$emit('orderLisetUpdate')
|
||||
this.$emit('refresh')
|
||||
}, 1000)
|
||||
|
||||
@@ -367,16 +389,7 @@
|
||||
}
|
||||
|
||||
},
|
||||
onLoad(option) {
|
||||
this.id = option.id
|
||||
this.getOrderInfo()
|
||||
uni.showShareMenu()
|
||||
let _that = this
|
||||
this.timeinterval = setInterval(() => {
|
||||
console.log('1')
|
||||
_that.newQrString()
|
||||
}, 1000 * 60 * 3);
|
||||
},
|
||||
|
||||
filters: {
|
||||
moneyFormat(value) {
|
||||
if (value != 'xxx.x') {
|
||||
|
||||
@@ -43,7 +43,6 @@
|
||||
{{item.name}}
|
||||
<view class="cu-tag sm round" :class="item.checked?'bg-white text-blues':'bg-blue'" v-if="item.hot">HOT</view>
|
||||
</button>
|
||||
|
||||
</view>
|
||||
<view class="padding-xs" style="width:40% ;" v-if="activeChannelCode!='TY'">
|
||||
<input type="number" @input="onInputBar" v-model="inputBar" class="cu-btn red block" placeholder="其他油枪" value="" />
|
||||
@@ -519,7 +518,8 @@
|
||||
},
|
||||
channelId() {
|
||||
if (this.channelList.length && this.channelList[this.activeCur]) {
|
||||
let channelId = this.channelList[this.activeCur].channelId
|
||||
let channelId = this.channelList[this.activeCur].channelId;
|
||||
console.log( this.channelList,'********')
|
||||
this.getNewSitePrice(channelId)
|
||||
this.activeChannelCode = this.channelList[this.activeCur].channelCode
|
||||
return channelId
|
||||
@@ -586,9 +586,9 @@
|
||||
let number = {
|
||||
payType : 'CUSTOMER_ACTIVE',
|
||||
userType:'0',
|
||||
xoilAmountGun:e ,
|
||||
priceId:this.activeSitePrice,
|
||||
clientBelong: "ZHONGPIN"
|
||||
sitePriceAmount:e ,
|
||||
sitePriceId:this.activeSitePrice,
|
||||
targetApp: "SAAS"
|
||||
}
|
||||
this.xoilAmountGun = e
|
||||
oilSiteApi.getOrderDiscountInfo(number).then( res=>{
|
||||
@@ -635,9 +635,10 @@
|
||||
let number = {
|
||||
payType : 'CUSTOMER_ACTIVE',
|
||||
userType:'0',
|
||||
xoilAmountGun:e.detail.value,
|
||||
priceId:this.activeSitePrice,
|
||||
clientBelong: "ZHONGPIN"
|
||||
sitePriceAmount:e.detail.value,
|
||||
sitePriceId:this.activeSitePrice,
|
||||
clientBelong: "ZHONGPIN",
|
||||
targetApp: "SAAS"
|
||||
}
|
||||
this.xoilAmountGun = e.detail.value
|
||||
oilSiteApi.getOrderDiscountInfo(number).then( res=>{
|
||||
@@ -883,7 +884,7 @@
|
||||
'clientBelong':'ZHONGPIN',
|
||||
"amountGun": this.activeChannelCode == 'TY' ? this.ty.realMoney : '',
|
||||
"shareCompanyQuota": 0, // 共享标识
|
||||
"priceId": this.oilSitePriceDetailsVo[this.radio].priceId, //类型:String 必有字段 备注:油价主键
|
||||
"sitePriceId": this.oilSitePriceDetailsVo[this.radio].priceId, //类型:String 必有字段 备注:油价主键
|
||||
"orderType": "REAL_ORDER", //类型:String 必有字段 备注:订单类型(REAL_ORDER:真实订单 VIRTUAL_ORDER:虚拟订单)
|
||||
"orderSource": "WECHAT_MINIAPPS", //类型:String 必有字段 备注:订单来源(WECHAT_MINIAPPS)
|
||||
"plateNumber": this.plateNumber ? this.plateNumber : this.plateNumberSel, //类型:String 必有字段 备注:车牌号
|
||||
@@ -896,7 +897,12 @@
|
||||
// "deviceImei": "mock", //类型:String 可有字段 备注:设备唯一码
|
||||
// "networkIp": "mock" //类型:String 可有字段 备注:ip地址,
|
||||
'version':1,
|
||||
'xoilAmountGun':this.vol
|
||||
'sitePriceAmount':this.vol,
|
||||
"orderMethod": "SITE_SCAN", // 订单支付方式
|
||||
"targetApp": "SAAS", // 小程序来源
|
||||
// "longitude": "1231.23", // 当前位置经度
|
||||
// "latitude": "1321.23" // 当前位置纬度
|
||||
...uni.getStorageSync('location'),
|
||||
}
|
||||
console.log(orderData,'orderDataorderDataorderDataorderDataorderDataorderDataorderDataorderData');
|
||||
oilOrderApi.createOrder(orderData).then(res => {
|
||||
@@ -908,7 +914,8 @@
|
||||
})
|
||||
}
|
||||
}).finally(msg=>{
|
||||
clearTimeout(this.timer)
|
||||
clearTimeout(this.timer);
|
||||
this.timer = null
|
||||
})
|
||||
},500)
|
||||
}
|
||||
@@ -923,8 +930,8 @@
|
||||
getNewSitePrice(channelId) {
|
||||
this.oilSitePriceDetailsVo = []
|
||||
oilSiteApi.getNewSitePriceZp({
|
||||
channelId:channelId,
|
||||
clientBelong: "ZHONGPIN"
|
||||
siteId:channelId,
|
||||
// clientBelong: "ZHONGPIN"
|
||||
}).then(res => {
|
||||
if (res.code == 20000) {
|
||||
this.plateNumbers = res.data.plateNumbers
|
||||
@@ -968,6 +975,7 @@
|
||||
for (let i = 0, lenI = items.length; i < lenI; ++i) {
|
||||
if (items[i].value == values) {
|
||||
items[i].checked = !items[i].checked;
|
||||
this.oilBar =items[i].checked?items[i].value:''
|
||||
} else {
|
||||
items[i].checked = false
|
||||
}
|
||||
|
||||
@@ -1,24 +1,19 @@
|
||||
<template>
|
||||
<view class="padding-top">
|
||||
<scroll-view scroll-x class=" nav text-center">
|
||||
<view class="cu-item" v-for="(item,index) in channelList" :class="index==TabCur?'text-blues cur':''" :key="item.channelId"
|
||||
@tap="tabSelect" :data-id="index">
|
||||
<image class="site-icon margin-right-sm" :src="imgURL+'site-'+item.channelCode+'.png'" mode="widthFix">
|
||||
</image>
|
||||
{{item.channelCode|channelCodeFamt}}
|
||||
<view class="cu-item" v-for="(item, index) in channelList" :class="index == TabCur ? 'text-blues cur' : ''" :key="item.channelId" @tap="tabSelect" :data-id="index">
|
||||
<image class="site-icon margin-right-sm" :src="imgURL + 'site-' + item.channelCode + '.png'" mode="widthFix"></image>
|
||||
{{ item.channelCode | channelCodeFamt }}
|
||||
<!-- 少了壳牌 -->
|
||||
</view>
|
||||
|
||||
</scroll-view>
|
||||
<view class="cu-list menu padding-left padding-right">
|
||||
<view class="cu-item" v-for="(itemx,index) in oilSitePriceDetailsVos" :key="index" v-if="itemx.sitePrice>0">
|
||||
<text class="cu-tag my-tag line-red text-lg">
|
||||
惠
|
||||
</text>
|
||||
<text class="text-bold text-black text-lg">{{itemx.oilProductCode}}</text>
|
||||
<text class="text-bold text-blues text-lg">¥{{itemx.sitePrice==0?'-.--':itemx.sitePrice}}/L</text>
|
||||
<text class="text-delete">¥{{itemx.oilSitePrice}}/L</text>
|
||||
<text class="text-xs ">预计每100L节省{{(100*(itemx.oilSitePrice - itemx.sitePrice))|moneyFormat}}元</text>
|
||||
<view class="cu-item" v-for="(itemx, index) in oilSitePriceDetailsVos" :key="index" v-if="itemx.sitePrice > 0">
|
||||
<text class="cu-tag my-tag line-red text-lg">惠</text>
|
||||
<text class="text-bold text-black text-lg">{{ itemx.oilProductCode }}</text>
|
||||
<text class="text-bold text-blues text-lg">¥{{ itemx.sitePrice == 0 ? '-.--' : itemx.sitePrice }}/L</text>
|
||||
<text class="text-delete">¥{{ itemx.oilSitePrice }}/L</text>
|
||||
<text class="text-xs ">预计每100L节省{{ (100 * (itemx.oilSitePrice - itemx.sitePrice)) | moneyFormat }}元</text>
|
||||
<!-- <text class="text-gray text-delete">$市场价</text>
|
||||
<text class="text-gray text-sm">
|
||||
预计每100L节省581元
|
||||
@@ -30,7 +25,7 @@
|
||||
<view class="bg-white padding ">
|
||||
<text>油站特色</text>
|
||||
<view class="padding-top-sm">
|
||||
<text class="cu-tag line-yellow margin-right-xs" v-for="(itemy,index) in tagList" :key="index">{{itemy}}</text>
|
||||
<text class="cu-tag line-yellow margin-right-xs" v-for="(itemy, index) in tagList" :key="index">{{ itemy }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@@ -38,103 +33,101 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
props: {
|
||||
channelList: {
|
||||
type: Array,
|
||||
default () {}
|
||||
export default {
|
||||
props: {
|
||||
channelList: {
|
||||
type: Array,
|
||||
default() {}
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
TabCur: 0,
|
||||
imgURL: this.global.imgURL,
|
||||
scrollLeft: 0
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
activeChannelCode() {
|
||||
if (this.channelList.length && this.channelList[this.TabCur]) {
|
||||
let channelCode = this.channelList[this.TabCur].channelCode;
|
||||
let secondChannelCode = '';
|
||||
if (this.channelList[this.TabCur].secondChannelCode) {
|
||||
secondChannelCode = this.channelList[this.TabCur].secondChannelCode;
|
||||
}
|
||||
this.$emit('onChangeChannelCode', channelCode, secondChannelCode);
|
||||
return channelCode;
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
TabCur: 0,
|
||||
imgURL: this.global.imgURL,
|
||||
scrollLeft: 0
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
activeChannelCode() {
|
||||
if (this.channelList.length && this.channelList[this.TabCur]) {
|
||||
let channelCode = this.channelList[this.TabCur].channelCode
|
||||
let secondChannelCode = ''
|
||||
if (this.channelList[this.TabCur].secondChannelCode) {
|
||||
secondChannelCode = this.channelList[this.TabCur].secondChannelCode
|
||||
}
|
||||
this.$emit('onChangeChannelCode', channelCode, secondChannelCode)
|
||||
return channelCode
|
||||
}
|
||||
},
|
||||
tagList() {
|
||||
if (this.channelList.length && this.channelList[this.TabCur].labelTag) {
|
||||
let labelTag = this.channelList[this.TabCur].labelTag
|
||||
let tagList = labelTag ? labelTag.split(',') : []
|
||||
return tagList
|
||||
}
|
||||
},
|
||||
activePay() {
|
||||
if (this.channelList.length && this.channelList[this.TabCur]) {
|
||||
let activePay = this.channelList[this.TabCur].activePay
|
||||
this.$emit('onChangePay', activePay, this.TabCur)
|
||||
}
|
||||
},
|
||||
qrcodePay() {
|
||||
if (this.channelList.length && this.channelList[this.TabCur]) {
|
||||
let qrcodePay = this.channelList[this.TabCur].qrcodePay
|
||||
this.$emit('onChangePayQr', qrcodePay)
|
||||
}
|
||||
},
|
||||
oilSitePriceDetailsVos() {
|
||||
if (this.channelList[this.TabCur]) {
|
||||
return this.channelList[this.TabCur].oilSitePriceDetailsVos
|
||||
}
|
||||
tagList() {
|
||||
if (this.channelList.length && this.channelList[this.TabCur].labelTag) {
|
||||
let labelTag = this.channelList[this.TabCur].labelTag;
|
||||
let tagList = labelTag ? labelTag.split(',') : [];
|
||||
return tagList;
|
||||
}
|
||||
},
|
||||
created() {
|
||||
|
||||
},
|
||||
|
||||
methods: {
|
||||
tabSelect(e) {
|
||||
this.TabCur = e.currentTarget.dataset.id;
|
||||
this.scrollLeft = (e.currentTarget.dataset.id - 1) * 60
|
||||
activePay() {
|
||||
if (this.channelList.length && this.channelList[this.TabCur]) {
|
||||
let activePay = this.channelList[this.TabCur].activePay;
|
||||
this.$emit('onChangePay', activePay, this.TabCur);
|
||||
}
|
||||
},
|
||||
filters: {
|
||||
moneyFormat(value) {
|
||||
if (value != 'xxx.x') {
|
||||
return "¥" + (parseInt(value * 100) / 100).toFixed(2)
|
||||
} else {
|
||||
return value
|
||||
}
|
||||
},
|
||||
channelCodeFamt(value) {
|
||||
if (value) {
|
||||
// 渠道编码 ( XOIL:星油 WJY:万金油 LV:老吕(找油网) TY:团油 YDJY:一点加油(壳牌))
|
||||
switch (value) {
|
||||
case 'XOIL':
|
||||
return '星油'
|
||||
case 'WJY':
|
||||
return '万金油'
|
||||
case 'LV':
|
||||
return '老吕(找油网)'
|
||||
case 'TY':
|
||||
return '团油'
|
||||
case 'YDJY':
|
||||
return '一点加油(壳牌)'
|
||||
}
|
||||
qrcodePay() {
|
||||
if (this.channelList.length && this.channelList[this.TabCur]) {
|
||||
let qrcodePay = this.channelList[this.TabCur].qrcodePay;
|
||||
this.$emit('onChangePayQr', qrcodePay);
|
||||
}
|
||||
},
|
||||
oilSitePriceDetailsVos() {
|
||||
if (this.channelList[this.TabCur]) {
|
||||
return this.channelList[this.TabCur].oilSitePriceDetailsVos;
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {},
|
||||
|
||||
methods: {
|
||||
tabSelect(e) {
|
||||
this.TabCur = e.currentTarget.dataset.id;
|
||||
this.scrollLeft = (e.currentTarget.dataset.id - 1) * 60;
|
||||
}
|
||||
},
|
||||
filters: {
|
||||
moneyFormat(value) {
|
||||
if (value != 'xxx.x') {
|
||||
return '¥' + (parseInt(value * 100) / 100).toFixed(2);
|
||||
} else {
|
||||
return value;
|
||||
}
|
||||
},
|
||||
channelCodeFamt(value) {
|
||||
if (value) {
|
||||
// 渠道编码 ( XOIL:星油 WJY:万金油 LV:老吕(找油网) TY:团油 YDJY:一点加油(壳牌))
|
||||
switch (value) {
|
||||
case 'XOIL':
|
||||
return '星油';
|
||||
case 'WJY':
|
||||
return '万金油';
|
||||
case 'LV':
|
||||
return '老吕(找油网)';
|
||||
case 'TY':
|
||||
return '团油';
|
||||
case 'YDJY':
|
||||
return '一点加油(壳牌)';
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.site-icon {
|
||||
width: 2rem;
|
||||
vertical-align: middle;
|
||||
}
|
||||
.site-icon {
|
||||
width: 2rem;
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
.my-tag {
|
||||
padding: 0 12rpx;
|
||||
}
|
||||
.my-tag {
|
||||
padding: 0 12rpx;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
{{siteInfo.siteName?siteInfo.siteName:'油站名称'}}
|
||||
</view>
|
||||
<view class="font-12 color-999 site-label text-cut">
|
||||
{{siteInfo.address?siteInfo.siteName:'油站地址'}}
|
||||
{{siteInfo.address?siteInfo.address:'暂无地址'}}
|
||||
</view>
|
||||
</view>
|
||||
<view class="action " @tap="openMap">
|
||||
@@ -112,12 +112,13 @@
|
||||
getSiteInfo(id) {
|
||||
let data2 = {
|
||||
...uni.getStorageSync('location'),
|
||||
siteId: id,
|
||||
id: id,
|
||||
clientBelong: "ZHONGPIN"
|
||||
}
|
||||
oilSiteApi.getSiteDetails(data2).then(res => {
|
||||
if (res.code == 20000) {
|
||||
this.siteInfo = res.data
|
||||
this.siteInfo = res.data;
|
||||
this.siteInfo.oilSiteChannelDetailsVos[0].channelId = res.data.id
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
<view class="">
|
||||
<view class="padding-xl text-center">
|
||||
<text class="text-xxl text-bold oil-main-color">
|
||||
{{order.realAmount>0?order.realAmount:'xxx.x'|moneyFormat}}
|
||||
{{order.payRealAmount>0?order.payRealAmount:'xxx.x'}}
|
||||
</text>
|
||||
<view class="text-gray">
|
||||
支付剩余时间 <time-down :is-day="false" :is-hour="false" :tip-text="' '" :day-text="' '" :hour-text="':'"
|
||||
@@ -138,7 +138,7 @@
|
||||
</view>
|
||||
<view class="dashed-top margin-top-xs padding-top-sm">
|
||||
<view class="padding-tb-xs text-left">
|
||||
加油金额:<text class="fr">{{moneyIntercept(order.xoilAmountGun) }}</text>
|
||||
加油金额:<text class="fr">{{moneyIntercept(order.sitePriceAmount) }}</text>
|
||||
<!-- <text
|
||||
class="fr">{{order.oilDiscountAmount>0?order.realAmount+order.oilDiscountAmount:order.realAmount|moneyFormat}}</text> -->
|
||||
</view>
|
||||
@@ -156,17 +156,17 @@
|
||||
<view class="padding-tb-xs text-left">
|
||||
合计:
|
||||
<text class="text-blues text-bold text-lg fr">
|
||||
¥{{order.realAmount>0? moneyIntercept(order.realAmount) :'xxx.x' }}</text>
|
||||
¥{{order.realAmount>0? order.payRealAmount:'xxx.x' }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="padding placeholder-hidden">
|
||||
<button class="cu-btn block lg bg-main-oil" @tap="payOrder">立即支付</button>
|
||||
<button class="cu-btn margin-top block lg " @tap="cancelOrder(order.orderSerialNumber)">取消订单</button>
|
||||
<button class="cu-btn margin-top block lg " @tap="cancelOrder(order.id)">取消订单</button>
|
||||
</view>
|
||||
<view class="padding fixed-bar-bottom">
|
||||
<button class="cu-btn block lg bg-main-oil" @tap="payOrder">立即支付</button>
|
||||
<button class="cu-btn margin-top block lg " @tap="cancelOrder(order.orderSerialNumber)">取消订单</button>
|
||||
<button class="cu-btn margin-top block lg " @tap="cancelOrder(order.id)">取消订单</button>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
@@ -67,7 +67,7 @@
|
||||
</view>
|
||||
<view class="padding-tb-xs text-left">
|
||||
加油员:
|
||||
<text class="fr">{{order.siteUserName}}</text>
|
||||
<text class="fr">{{order.siteUserName||'---'}}</text>
|
||||
</view>
|
||||
<!-- <view class="padding-tb-xs flex text-left">
|
||||
<view class="flex-sub">
|
||||
@@ -80,7 +80,7 @@
|
||||
</view> -->
|
||||
<view class="dashed-top margin-top-xs padding-top-sm">
|
||||
<view class="padding-tb-xs text-left">
|
||||
加油金额:<text class="fr">{{order.xoilAmountGun |moneyFormat}}</text>
|
||||
加油金额:<text class="fr">{{order.payRealAmount }}</text>
|
||||
<!-- <text class="fr">{{order.oilDiscountAmount>0?order.realAmount+order.oilDiscountAmount:order.realAmount|moneyFormat}}</text> -->
|
||||
</view>
|
||||
</view>
|
||||
@@ -95,7 +95,7 @@
|
||||
|
||||
<view class="padding-tb-xs text-left">
|
||||
合计:
|
||||
<text class="text-red text-bold text-lg fr">{{order.realAmount>0?'¥'+order.realAmount:'xxx.x'}}</text>
|
||||
<text class="text-red text-bold text-lg fr">{{order.payRealAmount>0?'¥'+order.payRealAmount:'xxx.x'}}</text>
|
||||
</view>
|
||||
<view class="dashed-top margin-top-xs padding-top-sm">
|
||||
<view class="padding-tb-xs text-left">
|
||||
@@ -105,7 +105,7 @@
|
||||
</view>
|
||||
<view class="padding-tb-xs text-left">
|
||||
加油司机:
|
||||
<text class=" fr">{{user.customerCode}}</text>
|
||||
<text class=" fr">{{user.name}}</text>
|
||||
</view>
|
||||
<view class="padding-tb-xs text-left">
|
||||
油卡性质:
|
||||
@@ -128,6 +128,7 @@
|
||||
<script>
|
||||
import toilApi from '@/api/toil.js'
|
||||
import oilSiteApi from '@/api/oil-site.js'
|
||||
import orderApi from '@/api/oil-order.js'
|
||||
import tkiQrcode from "../components/tki-qrcode/tki-qrcode.vue" //二维码生成器
|
||||
|
||||
import ThirdPartyVoucher from '../components/third-party-voucher/third-party-voucher.vue'
|
||||
@@ -139,6 +140,7 @@
|
||||
data() {
|
||||
const now = new Date()
|
||||
return {
|
||||
statusTimer:null,
|
||||
showtitles:"",
|
||||
hour: now.getHours() < 10 ? '0' + now.getHours() : now.getHours(), //当小时为个为数时在在前加0(例:01),以下同理
|
||||
minutes: now.getMinutes() < 10 ? '0' + now.getMinutes() : now.getMinutes(),
|
||||
@@ -184,7 +186,7 @@
|
||||
this.getOrderQrCode()
|
||||
},
|
||||
getOrderQrCode(){
|
||||
oilSiteApi.getOrderQrCode(this.order.orderSerialNumber).then( (res)=>{
|
||||
oilSiteApi.getOrderQrCode(this.order.id).then( (res)=>{
|
||||
console.log(res)
|
||||
if(res.code == 40000){
|
||||
this.showQr = false
|
||||
@@ -192,7 +194,12 @@
|
||||
}else if(res.code == 20000){
|
||||
this.showQr = true
|
||||
this.showtext =false
|
||||
this.val =res.data.codeStr
|
||||
this.val =res.data.codeStr;
|
||||
if(!this.timeinterval ){
|
||||
this.timeinterval = setInterval(() => {
|
||||
this.newQrString()
|
||||
}, 1000 * 60 * 3);
|
||||
}
|
||||
}
|
||||
} )
|
||||
},
|
||||
@@ -252,7 +259,6 @@
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
// 三方支付结果弹窗结束
|
||||
backToIndex() {
|
||||
this.innerAudioContext.stop()
|
||||
@@ -270,12 +276,26 @@
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
getStatus(order,callBack){
|
||||
this.statusTimer = setInterval(()=>{
|
||||
orderApi.getOrderPayInfo(order.id,'hide').then(res=>{
|
||||
if(res.code==20000){
|
||||
if(Number(res.data.orderStatus)!==0){
|
||||
callBack(res.data.orderStatus);
|
||||
clearInterval(this.statusTimer);
|
||||
this.statusTimer = null;
|
||||
}
|
||||
}
|
||||
})
|
||||
},2000)
|
||||
},
|
||||
},
|
||||
onLoad(option) {
|
||||
console.log(option)
|
||||
console.log('支付进入onload')
|
||||
let oilItem = uni.getStorageSync('oilItem')
|
||||
let oilItem = uni.getStorageSync('oilItem');
|
||||
let order = uni.getStorageSync('orderMade');
|
||||
this.showtitles = oilItem.listTag
|
||||
if(oilItem.listTag == '万金油'){
|
||||
this.audioUrl = 'https://publicxingyou.oss-cn-hangzhou.aliyuncs.com/mp-oil/wanjinyou.mp3'
|
||||
@@ -293,10 +313,10 @@
|
||||
setInterval(() => {
|
||||
this.getTime()
|
||||
},1000) //设置定时器,时时间每隔一秒钟走一次(即每秒)
|
||||
this.timeinterval = setInterval(() => {
|
||||
console.log('1')
|
||||
this.newQrString()
|
||||
}, 1000 * 60 * 3);
|
||||
setTimeout(()=>{
|
||||
this.newQrString()
|
||||
},5000)
|
||||
|
||||
if(option.payMethod == '1' && option.status == 'success'){
|
||||
if(option.status == 'success') {
|
||||
console.log('这里是支付成功')
|
||||
@@ -323,6 +343,23 @@
|
||||
this.queryOrderStatusSq()
|
||||
return
|
||||
}
|
||||
this.getStatus(order,status=>{
|
||||
switch (Number(status)) {
|
||||
case 1:
|
||||
this.textstatus = '支付成功';
|
||||
break;
|
||||
case -1:
|
||||
this.textstatus ='支付失败';
|
||||
break;
|
||||
case 2:
|
||||
this.textstatus = '订单已取消';
|
||||
break;
|
||||
case 3:
|
||||
this.textstatus = '订单已退款';
|
||||
break;
|
||||
}
|
||||
console.log(this.textstatus,status)
|
||||
})
|
||||
},
|
||||
filters: {
|
||||
moneyFormath(value) {
|
||||
@@ -366,7 +403,8 @@
|
||||
},
|
||||
onUnload() {
|
||||
console.log('这里是卸载页面')
|
||||
this.innerAudioContext.stop()
|
||||
this.innerAudioContext.stop();
|
||||
if(this.timeinterval)clearInterval(this.timeinterval);
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
{{siteInfo.address}}
|
||||
</view>
|
||||
<view class="font-12 color-999 site-label text-cut">
|
||||
营业时间 00:00 至 23:59
|
||||
营业时间 00:00 至 23:59
|
||||
</view>
|
||||
</view>
|
||||
<view class="action " @tap="openMap">
|
||||
@@ -88,12 +88,12 @@
|
||||
<text class=" text-black ">加 {{itm.oilsCode}} {{itm.volume}}L 节省 <text class="text-red">
|
||||
¥{{itm.discountAmount}}</text></text>
|
||||
</view>
|
||||
<view class="cu-item no-border" v-if="!siteInfo.oilSiteOrderInfoVos.length">
|
||||
<view class="cu-item no-border" >
|
||||
暂无
|
||||
</view>
|
||||
|
||||
</view>
|
||||
<!-- 底部去支付 -->
|
||||
|
||||
<view class="" v-if="activePay||qrcodePay">
|
||||
<view class="btn bg-white placeholder-hidden">
|
||||
<view class="flex bg-white padding flex-direction">
|
||||
@@ -194,9 +194,9 @@
|
||||
}else{
|
||||
var oilItem = JSON.parse(decodeURIComponent(option.item))
|
||||
}
|
||||
uni.setStorageSync('oilItem',oilItem)
|
||||
this.getSiteInfo(oilItem.siteId)
|
||||
this.siteId = oilItem.siteId
|
||||
uni.setStorageSync('oilItem',oilItem);
|
||||
this.getSiteInfo(oilItem.id)
|
||||
this.siteId = oilItem.id
|
||||
if(oilItem.listTag == '万金油'){
|
||||
this.audioUrl = 'https://publicxingyou.oss-cn-hangzhou.aliyuncs.com/mp-oil/wanjinyou.mp3'
|
||||
}else if(oilItem.listTag == '星油'){
|
||||
@@ -252,13 +252,15 @@
|
||||
console.log('进入获取油站信息')
|
||||
let data2 = {
|
||||
...uni.getStorageSync('location'),
|
||||
siteId: id,
|
||||
clientBelong: "ZHONGPIN"
|
||||
id: id,
|
||||
clientBelong: "ZHONGPIN",
|
||||
"targetApp": "SAAS", // 小程序来源
|
||||
}
|
||||
oilSiteApi.getSiteDetails(data2).then(res => {
|
||||
console.log('进入获取油站信息getSiteDetails',res)
|
||||
if (res.code == 20000) {
|
||||
this.siteInfo = res.data
|
||||
this.siteInfo = res.data;
|
||||
console.log(this.siteInfo,'*****')
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
@@ -20,14 +20,14 @@ export default {
|
||||
},
|
||||
getUserInfo(data) {
|
||||
return request({
|
||||
url: `/${service_name}/${group_name}/getUserSetInfo`,
|
||||
url: `/xkhl-site/mobileOrderApi/getUserSetInfo`,
|
||||
method: 'get',
|
||||
data:data
|
||||
})
|
||||
},
|
||||
logout(authSystem){
|
||||
return request({
|
||||
url: `/${service_name}/${group_name}/logoutAuthSystem/${authSystem}`,
|
||||
url: `/xkhl-identity/unionAuth/logout`,
|
||||
method: 'get'
|
||||
})
|
||||
},
|
||||
|
||||
@@ -1,17 +1,17 @@
|
||||
import request from '@/utils/request'
|
||||
const service_name = "oil-identity"
|
||||
const group_name = "weChatAuthorization"
|
||||
const service_name = "xkhl-identity"
|
||||
const group_name = "unionAuth"
|
||||
export default {
|
||||
loginPwd (data,type) {
|
||||
return request({
|
||||
url: `/${service_name}/${group_name}/loginByPhonePwd${type}`,
|
||||
url: `/xkhl-identity/unionAuth/loginPwd`,
|
||||
method: 'post',
|
||||
data:data
|
||||
})
|
||||
},
|
||||
loginByPhoneNext (data,type) {
|
||||
return request({
|
||||
url: `/${service_name}/${group_name}/loginByPhoneNext${type}`,
|
||||
url: `/xkhl-identity/unionAuth/loginByPhoneNext${type}`,
|
||||
method: 'post',
|
||||
data:data
|
||||
})
|
||||
|
||||
@@ -22,9 +22,12 @@ export default {
|
||||
// 添加开票记录
|
||||
save(data){
|
||||
return request({
|
||||
url: `/${service_name}/${invoic_name}/save`,
|
||||
url: `/xkhl-finance/saasCustomerInvoicRecord/save`,
|
||||
method:'post',
|
||||
data:data
|
||||
data:{
|
||||
...data,
|
||||
"clientBelong":"ZHONGPIN"
|
||||
}
|
||||
})
|
||||
},
|
||||
//根据id查询开票详情
|
||||
@@ -37,7 +40,7 @@ export default {
|
||||
//判断指定订单是否开票
|
||||
checkStatus(orderId){
|
||||
return request({
|
||||
url: `/${service_name}/${invoic_name}/checkStatus`,
|
||||
url: `/xkhl-finance/saasCustomerInvoicRecord/checkStatus`,
|
||||
method:'GET',
|
||||
params:{
|
||||
orderSerialNumber:orderId
|
||||
|
||||
@@ -4,14 +4,14 @@ const group_name = "weChatAuthorization"
|
||||
export default {
|
||||
autoLogin (data,url) {
|
||||
return request({
|
||||
url: `/${service_name}/${group_name}/${url}`,
|
||||
url: `/xkhl-identity/unionAuth/${url}`,
|
||||
method: 'post',
|
||||
data:data
|
||||
})
|
||||
},
|
||||
sendCode (code) {
|
||||
return request({
|
||||
url: `/${service_name}/${group_name}/sendCode`,
|
||||
url: `/xkhl-identity/unionAuth/sendCode`,
|
||||
method: 'post',
|
||||
data:{
|
||||
code:code,
|
||||
@@ -21,7 +21,7 @@ export default {
|
||||
},
|
||||
bindLoginByPhone (data,url) {
|
||||
return request({
|
||||
url: `/${service_name}/${group_name}/${url}`,
|
||||
url: `/xkhl-identity/unionAuth/${url}`,
|
||||
method: 'post',
|
||||
data:{
|
||||
...data,
|
||||
|
||||
@@ -7,7 +7,7 @@ export default {
|
||||
// data = Object.assign(data,{'clientBelong':'ZHONGPIN',});
|
||||
console.log(data,'datadatadata')
|
||||
return request({
|
||||
url: `/${service_name}/${group_name}/createOrder`,
|
||||
url: `/xkhl-site/mobileOrderApi/createCOrder`,
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
@@ -29,20 +29,21 @@ export default {
|
||||
},
|
||||
getOrderInfoByPage(data) {
|
||||
return request({
|
||||
url: `/${service_name}/${group_name}/getOrderInfoByPage`,
|
||||
url: `/xkhl-site/mobileOrderApi/getCInfoByPage`,
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
},
|
||||
getOrderPayInfo(id) {
|
||||
getOrderPayInfo(id,hide) {
|
||||
return request({
|
||||
url: `/${service_name}/${group_name}/getOrderPayInfo/${id}`,
|
||||
method: 'get'
|
||||
url: `/xkhl-site/mobileOrderApi/getOrderPayInfo/${id}`,
|
||||
method: 'get',
|
||||
HIDELODING:hide?true:false
|
||||
})
|
||||
},
|
||||
cancelOrder(id) {
|
||||
return request({
|
||||
url: `/${service_name}/${group_name}/cancelOrder/${id}`,
|
||||
url: `/xkhl-site/mobileOrderApi/cancelCOrder//${id}`,
|
||||
method: 'get'
|
||||
})
|
||||
},
|
||||
@@ -54,7 +55,7 @@ export default {
|
||||
},
|
||||
selOrder(id) {
|
||||
return request({
|
||||
url: `/${service_name}/${group_name}/selOrder/${id}`,
|
||||
url: `/xkhl-site/mobileOrderApi/getCInfo/${id}`,
|
||||
method: 'get'
|
||||
})
|
||||
},
|
||||
|
||||
@@ -5,7 +5,7 @@ const order_name = 'oilSiteOrderInfo'
|
||||
export default {
|
||||
getOrderDiscountInfo(data){
|
||||
return request({
|
||||
url: `/${service_name}/${order_name}/getOrderDiscountInfo`,
|
||||
url: `/xkhl-site/mobileOrderApi/getPayDisInfo`,
|
||||
method:'post',
|
||||
data:data
|
||||
})
|
||||
@@ -32,15 +32,16 @@ export default {
|
||||
})
|
||||
},
|
||||
getSiteLists(data) {
|
||||
data.params.targetApp='SAAS'
|
||||
return request({
|
||||
url: `/${service_name}/${group_name}/findBCSiteInfoByPage`,
|
||||
url: `/xkhl-site/saasSiteInfo/findByGeohash`,
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
},
|
||||
getSiteDetails(data) {
|
||||
return request({
|
||||
url: `/${service_name}/${group_name}/getSiteDetails`,
|
||||
url: `/xkhl-site/saasSiteInfo/getById`,
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
@@ -55,14 +56,14 @@ export default {
|
||||
},
|
||||
getCheckInfo(data) {
|
||||
return request({
|
||||
url: `/${service_name}/${group_name}/getCheckInfo`,
|
||||
url: `/xkhl-site/saasSiteInfo/getCheckInfo`,
|
||||
method: 'get',
|
||||
data: data
|
||||
})
|
||||
},
|
||||
getUserAuthInfo(data) {
|
||||
return request({
|
||||
url: `/${service_name}/${group_name}/getUserAuthInfo`,
|
||||
url: `/xkhl-user/sysCustomerInfo/getUserAuthInfo`,
|
||||
method: 'get',
|
||||
data: data
|
||||
})
|
||||
@@ -70,7 +71,7 @@ export default {
|
||||
// 车辆认证
|
||||
auth(data) {
|
||||
return request({
|
||||
url: `/${service_name}/${group_name}/auth`,
|
||||
url: `/xkhl-site/${group_name}/auth`,
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
@@ -85,9 +86,9 @@ export default {
|
||||
// 中品 下单 -- 获取最新油站价格、司机、加油员相关信息
|
||||
getNewSitePriceZp(data) {
|
||||
return request({
|
||||
url: `/${service_name}/${group_name}/getSitePriceByBelong `,
|
||||
url: `/xkhl-site/saasSiteInfo/getSitePriceByBelong`,
|
||||
method: 'post',
|
||||
data:data
|
||||
data:Object.assign(data,{targetApp: "SAAS"})
|
||||
})
|
||||
},
|
||||
//根据地址获取详细地址信息
|
||||
@@ -148,7 +149,7 @@ export default {
|
||||
// 获取订单核销码
|
||||
getOrderQrCode(id) {
|
||||
return request({
|
||||
url: `/${service_name}/${order_name}/getOrderQrCode/${id} `,
|
||||
url: `/xkhl-site/mobileOrderApi/getOrderQrCode/${id} `,
|
||||
method: 'get'
|
||||
})
|
||||
},
|
||||
|
||||
@@ -5,7 +5,7 @@ export default {
|
||||
// 微信下单 支付
|
||||
aggregatePay(data) {
|
||||
return request({
|
||||
url: `/${service_name}/yiBaoPay/wxPay`,
|
||||
url: `/xkhl-finance/yiBaoPay/wxPay`,
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
|
||||
@@ -9,8 +9,7 @@
|
||||
<text class="oil-main-color fr">{{item.orderStatus|statusConduct}}</text>
|
||||
</view>
|
||||
<view class="cu-list menu-avatar comment">
|
||||
<view class="cu-item padding-top-0" @tap="toDetails(item.orderSerialNumber)">
|
||||
|
||||
<view class="cu-item padding-top-0" @tap="toDetails(item.id)">
|
||||
<!-- <view class="cu-avatar text-xl" :style="'background-image:url('+imgUrl+'orders-wjy.png)'"></view> -->
|
||||
<view class="cu-avatar text-xl round" v-show="item.siteImages!=null"
|
||||
:style="'background-image:url('+item.siteImages+')'"></view>
|
||||
@@ -71,18 +70,18 @@
|
||||
</view>
|
||||
<view class="flex-sub text-right" v-show="item.orderStatus=='0' && !timeout">
|
||||
<button class="cu-btn nowrap sm bg-main-oil"
|
||||
@tap="makePay(item.orderSerialNumber)">立即支付</button>
|
||||
@tap="makePay(item.id)">立即支付</button>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
<view class="radius shadow mini-btn bg-white padding flex-wrap position-ab" v-if="showMiniBtn">
|
||||
<view class="margin-bottom-sm ">
|
||||
<!-- <view class="margin-bottom-sm ">
|
||||
<button class="cu-btn nowrap bg-main-oil" @tap="deleteOrder(item.orderSerialNumber)">删除</button>
|
||||
</view>
|
||||
</view> -->
|
||||
<view class="margin-bottom-sm" v-show="item.orderStatus=='0'">
|
||||
<button class="cu-btn nowrap bg-brown" @tap="cancelOrder(item.orderSerialNumber)">取消</button>
|
||||
<button class="cu-btn nowrap bg-brown" @tap="cancelOrder(item.id)">取消</button>
|
||||
</view>
|
||||
<view class=" ">
|
||||
<button class="cu-btn nowrap " @tap="showMiniBtn=false">收起</button>
|
||||
@@ -213,11 +212,11 @@
|
||||
},
|
||||
statusConduct(value) {
|
||||
// 备注:订单状态 0:待支付, 1:已支付 ,-1:支付失败 ,2:已取消,3:已退款
|
||||
if (value) {
|
||||
if (String(value)) {
|
||||
// switch value
|
||||
// case "0"
|
||||
// return '待支付'
|
||||
switch (value) {
|
||||
switch (String(value)) {
|
||||
case '0':
|
||||
return '待支付'
|
||||
case '1':
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<view class="cu-item cur padding no-mr-border site-item" :style="{height:siteItem.oilProductCodeAndPrices.length>3?'220rpx !important':listHeight?listHeight + 'rpx !important':''}">
|
||||
<view class="cu-item cur padding no-mr-border site-item" >
|
||||
<view class="cu-avatar radius lg "
|
||||
:style="'background-image:url('+(siteItem.siteImages?siteItem.siteImages:defaultLogo)+');'">
|
||||
</view>
|
||||
@@ -9,19 +9,19 @@
|
||||
</view>
|
||||
<view class="listTages">
|
||||
<!-- <view v-if="siteItem.siteLevel" class=" cu-tag round bg-self--dark-yellow yu-tag text-xs">{{siteItem.siteLevel}}级</view> -->
|
||||
<view class="cu-tag round bg-self-yellow yu-tag text-xs" :class="siteItem.channelCode=='XOIL'?'tag-red':''">{{siteItem.listTag|channelCodeFamt}}
|
||||
<view class="cu-tag round bg-self-yellow yu-tag text-xs" :class="siteItem.channelCode=='XOIL'?'tag-red':''">{{siteItem.listTag||'未知'}}
|
||||
</view>
|
||||
<view class="cu-tag round bg-self--dark-yellow yu-tag text-xs" v-show="first">距离最近</view>
|
||||
</view>
|
||||
<view class="">
|
||||
<view class="text-cut color-666 text-sm ">
|
||||
{{siteItem.address}}
|
||||
{{siteItem.address||'暂无地理位置'}}
|
||||
</view>
|
||||
</view>
|
||||
<view class="text-gray flex" style="width: calc(100% + 30%);display: flex;flex-wrap: wrap;">
|
||||
<!-- <view class="text-gray flex" style="width: calc(100% + 30%);display: flex;flex-wrap: wrap;">
|
||||
<view v-if="listHeight" class="youpin" style="" v-for="(item,index) in siteItem.oilProductCodeAndPrices">
|
||||
<view class="text-bold oil-main-color text-xl padding-right-xs">
|
||||
{{item.oilProductCode}}
|
||||
{{item.oilProductCode}}
|
||||
</view>
|
||||
<view class="oil-main-color text-xl text-bold padding-right-xs" style="padding-right: 0;">
|
||||
¥{{item.personalPriceZp|moneyFormat}}
|
||||
@@ -41,18 +41,27 @@
|
||||
<text class="text-delete color-333 text-sm padding-right-xs">
|
||||
¥{{siteItem.oilSitePrice|moneyFormat}}/L
|
||||
</text>
|
||||
<!-- <my-icon iconName="¥.png" class="padding-right-xs icon-rectangle"></my-icon>
|
||||
|
||||
<my-icon iconName="f.png" class="padding-right-xs "></my-icon> -->
|
||||
|
||||
</view>
|
||||
</view>
|
||||
</view> -->
|
||||
<view class="text-gray flex">
|
||||
<view class="text-bold yellow-oil text-xl padding-right-xs">{{ siteItem.oilProductCode }}</view>
|
||||
<view class="oil-main-color text-xl text-bold padding-right-xs">¥{{ siteItem.personalPriceApp | moneyFormat }}</view>
|
||||
<!-- <view class="">
|
||||
<text class="cu-tag oil-tag radius text-xs" v-if="siteItem.personalPriceBase - siteItem.personalPriceApp > 0">
|
||||
省¥{{ (siteItem.personalPriceBase - siteItem.personalPriceApp) | moneyFormat }}
|
||||
</text>
|
||||
</view> -->
|
||||
<!-- <view class="text-cut padding-left-sm text-lg">
|
||||
<text class="text-delete color-333 text-sm padding-right-xs">¥{{ siteItem.personalPriceBase | moneyFormat }}/L</text>
|
||||
</view> -->
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="action">
|
||||
<view class="text-grey text-sm " style="padding-top: 6rpx;">
|
||||
<!-- <my-icon iconName="sy-der-icon.png" class="padding-right-xs text-sm"></my-icon> -->
|
||||
{{siteItem.juli|distanceFilter}}
|
||||
{{ siteItem.juli|distanceFilter}}
|
||||
</view>
|
||||
</view>
|
||||
|
||||
@@ -83,14 +92,12 @@
|
||||
}
|
||||
},
|
||||
created() {
|
||||
console.log(this.siteItem,'-----------------')
|
||||
},
|
||||
methods: {
|
||||
|
||||
},
|
||||
filters: {
|
||||
channelCodeFamt(value) {
|
||||
console.log(value)
|
||||
if (!value) {
|
||||
return '未知'
|
||||
// 渠道编码 ( XOIL:星油 WJY:万金油 LV:老吕(找油网) TY:团油 YDJY:一点加油(壳牌))
|
||||
@@ -113,6 +120,8 @@
|
||||
distanceFilter(value) {
|
||||
if (value) {
|
||||
return value > 1000 ? ((value / 1000).toFixed(2) + 'km') : (value + 'm')
|
||||
}else{
|
||||
return '暂无距离'
|
||||
}
|
||||
},
|
||||
moneyFormat(value) {
|
||||
|
||||
BIN
components/sl-filter.zip
Normal file
BIN
components/sl-filter.zip
Normal file
Binary file not shown.
@@ -32,26 +32,20 @@
|
||||
</text>
|
||||
</view>
|
||||
</view> -->
|
||||
<view class="filter-content-detail" v-show="pickerShow">
|
||||
<view class="filter-content-detail" v-show="pickerShow&&areaCodeList.length">
|
||||
<!-- 省市区选择 -->
|
||||
<view class="region-box" v-if="index==0">
|
||||
<view class="region-box" v-show="index==0">
|
||||
<picker-view disabled :value="region" @change="bindChange" ref="showHide">
|
||||
<picker-view-column>
|
||||
<view class="center" v-for="(item, index) in areaCodeList" :key="index">
|
||||
{{ item.areaName }}
|
||||
<view class="center" v-for="(items, index) in areaCodeList" :key="index">
|
||||
{{ items.areaName }}
|
||||
</view>
|
||||
</picker-view-column>
|
||||
<picker-view-column>
|
||||
<view class="center" v-for="(item, index) in areaCodeList[areaIndex[0]].childList" :key="index">
|
||||
{{ item.areaName }}
|
||||
<view class="center" v-for="(items, index) in areaCodeList[areaIndex[0]].childList" :key="index">
|
||||
{{ items.areaName }}
|
||||
</view>
|
||||
</picker-view-column>
|
||||
<!-- <picker-view-column v-if="areaCodeList[areaIndex[0]]">
|
||||
<view class="center"
|
||||
v-for="(item, index) in areaCodeList[areaIndex[0]].childList[areaIndex[1]].childList" :key="index">
|
||||
{{ item.areaName }}
|
||||
</view>
|
||||
</picker-view-column> -->
|
||||
</picker-view>
|
||||
</view>
|
||||
</view>
|
||||
@@ -72,28 +66,6 @@
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
region:[],
|
||||
selectArr: [],
|
||||
result: {},
|
||||
pickerShow:false,
|
||||
menuIndex: 0,
|
||||
areaIndex:[0, 0],
|
||||
paixu:1,
|
||||
provinceCode:'',
|
||||
oilCode:'',
|
||||
showHide:true,
|
||||
cityCode:'',
|
||||
areaCode:'',
|
||||
selectDetailList: [],
|
||||
independenceObj: {},
|
||||
areaCodeList:[],
|
||||
selectedKey: '',
|
||||
cacheSelectedObj: {},
|
||||
defaultSelectedTitleObj: {}
|
||||
};
|
||||
},
|
||||
props: {
|
||||
themeColor: {
|
||||
type: String,
|
||||
@@ -118,8 +90,39 @@
|
||||
default: false
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
region:[],
|
||||
selectArr: [],
|
||||
result: {},
|
||||
pickerShow:false,
|
||||
menuIndex: 0,
|
||||
areaIndex:[0, 0],
|
||||
paixu:1,
|
||||
provinceCode:'',
|
||||
oilCode:'',
|
||||
showHide:true,
|
||||
cityCode:'',
|
||||
areaCode:'',
|
||||
selectDetailList: [],
|
||||
independenceObj: {},
|
||||
areaCodeList:[],
|
||||
selectedKey: '',
|
||||
cacheSelectedObj: {},
|
||||
defaultSelectedTitleObj: {}
|
||||
};
|
||||
},
|
||||
watch:{
|
||||
// areaCodeList(n){
|
||||
// if(n.length){
|
||||
// this.$forceUpdate()
|
||||
// }
|
||||
// console.log(n,'====')
|
||||
// }
|
||||
},
|
||||
created() {
|
||||
|
||||
this.areaCodeList = uni.getStorageSync('areaCodeList');
|
||||
console.log(this.areaCodeList,'areaCodeList ')
|
||||
console.log('%c 子组件参数↓','font-size:30px;color:red')
|
||||
},
|
||||
mounted() {
|
||||
|
||||
2
main.js
2
main.js
@@ -28,7 +28,7 @@ Vue.component('my-empty',Empty)
|
||||
|
||||
Vue.prototype.moneyIntercept = function(value){
|
||||
if (value != 'xxx.x') {
|
||||
return String(value).split('.')[1]&&String(value).split('.')[1].length>2? Number(`${String(value).split('.')[0]}.${String(value).split('.')[1].substring(0,1)}${ Number(String(value).split('.')[1].substring(1,2)) + 1}`) :Number(value).toFixed(2);
|
||||
return String(value).split('.')[1]&&String(value).split('.')[1].length>2? Number(`${String(value).split('.')[0]}.${String(value).split('.')[1].substring(0,1)}${ Number(String(value).split('.')[1].substring(1,2)) + 1}`):Number(value).toFixed(2);
|
||||
} else {
|
||||
return Number(value).toFixed(2)
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name" : "XiaoXing",
|
||||
"appid" : "__UNI__EA8D131",
|
||||
"appid" : "__UNI__A32B754",
|
||||
"description" : "",
|
||||
"versionName" : "1.0.0",
|
||||
"versionCode" : "100",
|
||||
|
||||
@@ -40,14 +40,14 @@
|
||||
付款码
|
||||
</text>
|
||||
</view>
|
||||
<view class="text-xxl" @tap="toCards">
|
||||
<!-- <view class="text-xxl" @tap="toCards">
|
||||
<view class="cuIcon-vipcard">
|
||||
|
||||
</view>
|
||||
<text class="text-df">
|
||||
加油卡
|
||||
</text>
|
||||
</view>
|
||||
</view> -->
|
||||
<view class="text-xxl" @tap="toOrders">
|
||||
<view class="cuIcon-form">
|
||||
|
||||
@@ -370,11 +370,11 @@
|
||||
});
|
||||
},
|
||||
getAmount() {
|
||||
accountApi.getTotalOilCardInfo().then(res => {
|
||||
if (res.code == 20000) {
|
||||
this.userTotal = res.data
|
||||
}
|
||||
})
|
||||
// accountApi.getTotalOilCardInfo().then(res => {
|
||||
// if (res.code == 20000) {
|
||||
// this.userTotal = res.data
|
||||
// }
|
||||
// })
|
||||
},
|
||||
refreshLocation() {
|
||||
uni.getLocation({
|
||||
@@ -494,6 +494,7 @@
|
||||
pageSize: 10,
|
||||
params: { //类型:Object 必有字段 备注:// 筛选对象
|
||||
clientBelong:'ZHONGPIN',
|
||||
targetApp:'SAAS',
|
||||
sort: "juli", //类型:String 必有字段 备注:// 智能排序 ( price:价格最低 juli:距离最近 ) 默认距离排序
|
||||
// longitude: 117.157817, // 必有字段 备注:// 当前位置经度
|
||||
// latitude: 31.802472, // 必有字段 备注:// 当前位置维度
|
||||
|
||||
@@ -136,11 +136,20 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
onShow() {
|
||||
onShow() {
|
||||
console.log('====');
|
||||
// location.reload()
|
||||
// this.initList()
|
||||
},
|
||||
onLoad() {
|
||||
this.initList()
|
||||
this.initList();
|
||||
let that = this
|
||||
uni.$on('orderLisetUpdate',()=>{
|
||||
that.onRequest()
|
||||
setTimeout(function() {
|
||||
uni.stopPullDownRefresh()
|
||||
}, 1000);
|
||||
})
|
||||
},
|
||||
onPullDownRefresh() {
|
||||
this.onRequest()
|
||||
@@ -241,6 +250,7 @@
|
||||
|
||||
},
|
||||
getOrder(id, page, tip) {
|
||||
console.log('运行')
|
||||
clearTimeout(this.getSiteListTimer);
|
||||
this.getSiteListTimer = setTimeout(()=>{
|
||||
|
||||
|
||||
@@ -12,8 +12,7 @@
|
||||
@blur="InputBlur" v-model="siteName" :adjust-position="false" type="text" placeholder="加油站名称" />
|
||||
</view>
|
||||
<view class="action" @tap="toMap">
|
||||
<image class="icon shadow-blur round icon-gasstation"
|
||||
src="https://www.51xingka.net/LSMOIL/static/img/gas-station.png" mode=""></image>
|
||||
<image class="icon shadow-blur round icon-gasstation" src="https://www.51xingka.net/LSMOIL/static/img/gas-station.png" mode=""></image>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@@ -33,10 +32,10 @@
|
||||
<!-- 筛选开始 -->
|
||||
<scroll-view class="screentop bg-white" style="flex: 1;">
|
||||
<view class="">
|
||||
<sl-filter v-if="isFilterData" reflexTitle ref="slFilter" :productCodeList="productCodeList" :areaCodeList="areaCodeList"
|
||||
<sl-filter v-if="isFilterData&&areaCodeList.length>1" reflexTitle ref="slFilter" :productCodeList="productCodeList" :areaCodeList="areaCodeList"
|
||||
@result="filterRes" :menuList="menuList"></sl-filter>
|
||||
<!-- <sl-filter reflexTitle ref="slFilter" @result="filterRes" :menuList="menuList"></sl-filter> -->
|
||||
</view>
|
||||
</view>
|
||||
<view class="bg-white min-height-50 padding-top" v-if="siteList.length>0">
|
||||
<site-item v-for="(item,index) in siteList" :key="item.id" :site-item="item" :first="index==0"
|
||||
:listHeight="listHeight" class="cu-list menu-avatar cu-item" @tap="toDetail(item)">
|
||||
@@ -256,6 +255,9 @@
|
||||
}
|
||||
},
|
||||
},
|
||||
created() {
|
||||
this.areaCodeList = uni.getStorageSync('areaCodeList');
|
||||
},
|
||||
onLoad() {
|
||||
this.refreshLocation()
|
||||
if (!uni.getStorageSync('filterData')) {
|
||||
@@ -263,7 +265,7 @@
|
||||
} else {
|
||||
this.isFilterData=true
|
||||
}
|
||||
this.getSiteList()
|
||||
this.getSiteList();
|
||||
},
|
||||
|
||||
onPullDownRefresh() {
|
||||
@@ -325,7 +327,7 @@
|
||||
if (res.code == 20000) {
|
||||
uni.setStorageSync('productCodeList', res.data.productCodeList)
|
||||
uni.setStorageSync('areaCodeList', res.data.areaCodeList)
|
||||
this.areaCodeList = uni.getStorageSync('areaCodeList')
|
||||
this.areaCodeList = uni.getStorageSync('areaCodeList');
|
||||
let channelCodes = []
|
||||
res.data.channelCodes.map(item => {
|
||||
channelCodes.push({
|
||||
@@ -380,6 +382,7 @@
|
||||
pageSize: 10,
|
||||
params: { //类型:Object 必有字段 备注:// 筛选对象
|
||||
clientBelong:'ZHONGPIN',
|
||||
targetApp:'SAAS',
|
||||
sort: "juli", //类型:String 必有字段 备注:// 智能排序 ( price:价格最低 juli:距离最近 ) 默认距离排序
|
||||
siteName: this.siteName,
|
||||
...uni.getStorageSync('location'),
|
||||
@@ -394,6 +397,7 @@
|
||||
cityCode: this.filterData.cityCode,
|
||||
areaCode: this.filterData.areaCode,
|
||||
distance: this.filterData.distance,
|
||||
juli:this.filterData.distance,
|
||||
comprehensiveSort: this.filterData.comprehensiveSort ? this.filterData.comprehensiveSort : 1
|
||||
}
|
||||
|
||||
|
||||
@@ -257,11 +257,11 @@
|
||||
})
|
||||
},
|
||||
getAmount() {
|
||||
accountApi.getTotalOilCardInfo().then(res => {
|
||||
if (res.code == 20000) {
|
||||
this.userTotal = res.data
|
||||
}
|
||||
})
|
||||
// accountApi.getTotalOilCardInfo().then(res => {
|
||||
// if (res.code == 20000) {
|
||||
// this.userTotal = res.data
|
||||
// }
|
||||
// })
|
||||
},
|
||||
copy() {
|
||||
uni.setClipboardData({
|
||||
|
||||
@@ -2,13 +2,13 @@ import axios from 'axios'
|
||||
import utils from '@/utils/encode'
|
||||
|
||||
// const env = process.env.NODE_ENV
|
||||
const env = 'production'/* */
|
||||
// const env = 'test'
|
||||
const testUrl = 'http://192.168.0.23:38080'
|
||||
// const env = 'production'/* */
|
||||
const env = 'test'
|
||||
const testUrl = 'http://192.168.0.20:38080'
|
||||
// const productUrl = 'http://121.196.213.68/adminapi' //预生产
|
||||
|
||||
// const productUrl = 'https://www.xingoil.com/adminapi' // 生产,加密 new
|
||||
const productUrl = 'http://uat.xingoil.com/adminapi' // 生产,加密 new
|
||||
const productUrl = 'https://www.xingoil.com/adminapi' // 生产,加密 new
|
||||
// const productUrl = 'http://uat.xingoil.com/adminapi' // 生产,加密 new
|
||||
const service = axios.create({
|
||||
baseURL: env == 'production' ? productUrl : testUrl,
|
||||
// baseURL: testUrl,
|
||||
@@ -19,22 +19,23 @@ var url = ''
|
||||
service.interceptors.request.use(
|
||||
config => {
|
||||
// 拦截请求
|
||||
uni.showLoading({
|
||||
title: '加载中...'
|
||||
})
|
||||
if(!config?.HIDELODING){
|
||||
uni.showLoading({
|
||||
title: '加载中...'
|
||||
})
|
||||
}
|
||||
const token = uni.getStorageSync('Authorization')
|
||||
const unionId = uni.getStorageSync('unionid')
|
||||
console.log(unionId)
|
||||
const openId = uni.getStorageSync('openid')
|
||||
// const accountSources = 'WE_CHAT_PROGRAM'
|
||||
const accountSources = 'LOGIN_MP_WECHAT'
|
||||
// console.log('取出来缓存', token, openid)
|
||||
|
||||
config.headers['openId'] = openId
|
||||
config.headers['Authorization'] = token
|
||||
config.headers['accountSources'] = accountSources
|
||||
config.headers['imei'] = unionId
|
||||
config.headers['dataSources'] = 'MP'
|
||||
config.headers['loginDevice'] = 'LOGIN_MP_WECHAT'
|
||||
config.headers['loginSystem'] = 'OIL_MINI_ZP'
|
||||
|
||||
if (env === 'production') {
|
||||
// 生产环境,加密,不输出任何东西
|
||||
@@ -57,8 +58,7 @@ service.interceptors.request.use(
|
||||
console.log('\n\n-----------------------')
|
||||
console.log('参数', config.url, '参数加密前', config.data)
|
||||
url = config.url
|
||||
}
|
||||
|
||||
}
|
||||
return config
|
||||
},
|
||||
error => {
|
||||
@@ -88,16 +88,15 @@ service.interceptors.response.use(
|
||||
console.log('-------------------------------------------\n\n')
|
||||
}
|
||||
|
||||
uni.hideLoading()
|
||||
if(response.config.url.indexOf('/oil-site/oilSiteOrderInfo/getOrderQrCode') === -1){
|
||||
uni.hideLoading();
|
||||
res.code==42011?uni.$emit('isOnline','offline'):uni.$emit('isOnline','online');
|
||||
if(response.config.url.indexOf('/xkhl-site/mobileOrderApi/getOrderQrCode') === -1){
|
||||
if (res.code != 20000 && res.msg != '令牌为空,不允许操作' && res.msg != '您的ip已经更改,请重新登录' && res.msg != '登录与操作设备不同') {
|
||||
uni.showToast({
|
||||
title: res.msg,
|
||||
icon: "none"
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
return res
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user