12
This commit is contained in:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user