星油云站更新
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
<view>
|
||||
<view class="content text-left padding">
|
||||
<view class="strong padding-bottom-xs color-333 ">
|
||||
{{oilSite.oilSiteName}}
|
||||
{{oilSite.siteName}}
|
||||
</view>
|
||||
<view class="font-12 color-999">
|
||||
<text class=" text-cut">{{oilSite.address}}</text>
|
||||
@@ -14,16 +14,16 @@
|
||||
</view>
|
||||
<view class="grid col-5 justify-start">
|
||||
<view class="padding-xs" v-for="(item,index) in oilList" :key="index">
|
||||
<button class="cu-btn" @tap="oilNameSel(item)" :class="[selected.oilName===item.oilName?'bg-main-oil':'line-gray']">{{item.oilName}}</button>
|
||||
<button class="cu-btn" @tap="oilNameSel(item)" :class="[selected.otherOilsName===item.otherOilsName?'bg-main-oil':'line-gray']">{{item.otherOilsName}}</button>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="padding-top-xs padding-left padding-right">
|
||||
<text class="strong padding-right font-16">
|
||||
{{selected.oilName}}
|
||||
{{selected.otherOilsName}}
|
||||
</text>
|
||||
<text class="padding-right">星油价格:<text class="oil-main-color text-bold">¥{{selected.xkPrice?selected.xkPrice:selected.lvPrice|numberFilter}}/L</text></text>
|
||||
<text class="s-rich">市场价:¥{{selected.standardPrice|numberFilter}}/L</text>
|
||||
<text class="padding-right">星油价格:<text class="oil-main-color text-bold">¥{{selected.sitePrice|numberFilter}}/L</text></text>
|
||||
<text class="s-rich">市场价:¥{{selected.marketPrice|numberFilter}}/L</text>
|
||||
</view>
|
||||
<view class="padding-left padding-right">
|
||||
<view class="padding-bottom-sm">
|
||||
@@ -56,6 +56,7 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import OliSiteApi from '@/api/oli-site.js'
|
||||
export default {
|
||||
props: {
|
||||
oilList: {
|
||||
@@ -67,6 +68,7 @@
|
||||
return {
|
||||
active: 0,
|
||||
vol: '',
|
||||
userInfo:uni.getStorageSync('loginUser'),
|
||||
oliNameList: [1, 2, 9, 10],
|
||||
ColorList: [1, 2, 9, 10],
|
||||
gunId: 0,
|
||||
@@ -112,7 +114,7 @@
|
||||
},
|
||||
oilNameSel(item) {
|
||||
this.selected = item
|
||||
|
||||
console.log(item)
|
||||
},
|
||||
initForm() {
|
||||
if (this.oilList[0]) {
|
||||
@@ -120,20 +122,36 @@
|
||||
}
|
||||
},
|
||||
onConfirm() {
|
||||
const data5 = {
|
||||
...this.selected,
|
||||
vol: this.vol,
|
||||
oilPrice: this.selected.xkPrice ? this.selected.xkPrice : this.selected.lvPrice,
|
||||
gunId: this.gunId + 1,
|
||||
realPay: this.money.realPay
|
||||
// const data5 = {
|
||||
// ...this.selected,
|
||||
// volume: this.vol,
|
||||
// oilPrice: this.selected.sitePrice,
|
||||
// gunId: this.gunId + 1,
|
||||
// price: this.money.realPay
|
||||
// }
|
||||
console.log(this.oilSite)
|
||||
const datas = {
|
||||
channelId: this.oilSite.siteCode,
|
||||
siteName:this.oilSite.siteName,
|
||||
staffId: this.userInfo.id,
|
||||
refuelDetail: {
|
||||
oilsBarNum: this.gunId + 1,
|
||||
oilProductCode:this.selected.oilProductCode,
|
||||
otherOilsName: this.selected.otherOilsName,
|
||||
price:this.money.realPay,
|
||||
volume:this.vol
|
||||
}
|
||||
}
|
||||
this.$emit('confirmVol', data5)
|
||||
console.log(datas)
|
||||
this.$emit('confirmVol', datas)
|
||||
},
|
||||
calcMoney(e) {
|
||||
this.price = this.selected.xkPrice ? this.selected.xkPrice : this.selected.lvPrice
|
||||
this.money.total = this.vol * this.selected.standardPrice
|
||||
this.money.discount = this.vol * (this.selected.standardPrice - this.price)
|
||||
this.money.realPay = (this.money.total - this.money.discount).toFixed(2)
|
||||
this.price = this.selected.sitePrice
|
||||
console.log(this.price)
|
||||
this.money.total = this.vol * this.selected.marketPrice
|
||||
console.log(this.money.total)
|
||||
this.money.discount = this.vol * (this.selected.marketPrice - this.price)
|
||||
this.money.realPay = this.vol * this.selected.sitePrice
|
||||
}
|
||||
},
|
||||
filters: {
|
||||
|
||||
@@ -40,10 +40,10 @@
|
||||
</view>
|
||||
|
||||
<view class="text-right flex-sub oil-main-color">
|
||||
<text v-if="!showData.realPay">
|
||||
<text v-if="!showData.price">
|
||||
未指定
|
||||
</text>
|
||||
<text v-else>¥{{showData.realPay}}</text>
|
||||
<text v-else>¥{{showData.price}}</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="flex padding-left padding-right">
|
||||
@@ -58,10 +58,10 @@
|
||||
|
||||
|
||||
<text class="text-right flex-sub">
|
||||
<text v-if="!showData.vol">
|
||||
<text v-if="!showData.volume">
|
||||
未指定
|
||||
</text>
|
||||
<text v-else>{{showData.vol}}L</text>
|
||||
<text v-else>{{showData.volume}}L</text>
|
||||
</text>
|
||||
</view>
|
||||
</view>
|
||||
@@ -92,6 +92,7 @@
|
||||
import OrderOilForm from '@/packageQr/components/OrderOil.vue'
|
||||
// 引入二维码库
|
||||
import cloudSiteApi from '@/api/cloud-site.js'
|
||||
import OliSiteApi from '@/api/oli-site.js'
|
||||
import tkiQrcode from "@/packageQr/components/tki-qrcode/tki-qrcode.vue" //二维码生成器
|
||||
|
||||
export default {
|
||||
@@ -121,14 +122,16 @@
|
||||
showData: {
|
||||
vol: '',
|
||||
realPay: ''
|
||||
}
|
||||
|
||||
},
|
||||
channelId : uni.getStorageSync('channelId'),
|
||||
siteInfo : {},
|
||||
userInfo : uni.getStorageSync('loginUser'),
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
this.oilSiteName = uni.getStorageSync('oilSiteName')
|
||||
this.getDefaultQr()
|
||||
this.getSiteInfo()
|
||||
this.oilSiteName = uni.getStorageSync('oilSiteName')
|
||||
|
||||
// this.getDesignatedQr/()
|
||||
console.log('oilDate', this.oilDate)
|
||||
},
|
||||
@@ -143,22 +146,26 @@
|
||||
}
|
||||
},
|
||||
getSiteInfo() {
|
||||
cloudSiteApi.getSiteDetail().then(res => {
|
||||
console.log('...', res)
|
||||
OliSiteApi.getSiteDetail(this.channelId).then(res => {
|
||||
console.log('这里是获取油站信息处', res)
|
||||
if (res.code === 20000) {
|
||||
this.site = res.data.site
|
||||
this.siteInfo = res.data.site
|
||||
this.oilList = res.data.oil
|
||||
uni.setStorage({
|
||||
key: 'oilSite',
|
||||
data: res.data.site
|
||||
})
|
||||
uni.setStorageSync('oilSite',res.data.site)
|
||||
this.getDefaultQr()
|
||||
}
|
||||
})
|
||||
},
|
||||
getDefaultQr() {
|
||||
cloudSiteApi.getSiteQrCode().then(res => {
|
||||
let data = {
|
||||
channelId:this.channelId,
|
||||
siteName:this.siteInfo.siteName,
|
||||
staffId:this.userInfo.id
|
||||
}
|
||||
OliSiteApi.getOilSiteCollectQrCode(data).then(res => {
|
||||
console.log( '这里是返回二维码的地方',res)
|
||||
if (res.code === 20000) {
|
||||
this.val = res.data
|
||||
this.val = res.data.codeStr
|
||||
}
|
||||
})
|
||||
},
|
||||
@@ -167,10 +174,12 @@
|
||||
...this.oilDate,
|
||||
...data
|
||||
}
|
||||
this.showData = data
|
||||
cloudSiteApi.getDesignatedSiteQrCode(data6).then(res => {
|
||||
console.log(data)
|
||||
this.showData = data.refuelDetail
|
||||
OliSiteApi.getOilSiteCollectQrCode(data6).then(res => {
|
||||
if (res.code === 20000) {
|
||||
this.val = res.data
|
||||
console.log(res)
|
||||
this.val = res.data.codeStr
|
||||
this.hideModal()
|
||||
}
|
||||
})
|
||||
|
||||
BIN
packageQr/static/img/new_logo.png
Normal file
BIN
packageQr/static/img/new_logo.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 10 KiB |
Reference in New Issue
Block a user