|
|
@ -7,7 +7,7 @@ |
|
|
|
<view class="width100 text1 font18 fontwig6 fcor333">{{storeList.gasName}}</view> |
|
|
|
<view class="width100 text1 font18 fontwig6 fcor333">{{storeList.gasName}}</view> |
|
|
|
<view class="width100 font14 fcor666 mart5">{{storeList.gasAddress}}</view> |
|
|
|
<view class="width100 font14 fcor666 mart5">{{storeList.gasAddress}}</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<view class="flright reimg fotct width20"> |
|
|
|
<view class="flright reimg fotct width20" @click="seeloaction"> |
|
|
|
<image mode="widthFix" src="../../../static/img/dhl.png"></image> |
|
|
|
<image mode="widthFix" src="../../../static/img/dhl.png"></image> |
|
|
|
<view class="fcor089">{{storeList.distance}}km</view> |
|
|
|
<view class="fcor089">{{storeList.distance}}km</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
@ -65,15 +65,16 @@ |
|
|
|
<view class="width90 mart15 font16 fcor666">加油金额</view> |
|
|
|
<view class="width90 mart15 font16 fcor666">加油金额</view> |
|
|
|
<view class="width90 height40 mart10" style="border: 1px solid #f2f2f2;"> |
|
|
|
<view class="width90 height40 mart10" style="border: 1px solid #f2f2f2;"> |
|
|
|
<view class="width8 flleft">¥</view> |
|
|
|
<view class="width8 flleft">¥</view> |
|
|
|
<input type="number" class="font16 width70 flleft height40" placeholder="请输入金额" v-model="inputPhone" /> |
|
|
|
<input type="number" class="font16 width60 flleft height40" placeholder="请输入金额" v-model="inputMoney" |
|
|
|
<view class="width20 height40 flright font14 fcor999 fotct" |
|
|
|
@blur="Listeningfocus" maxlength="5" /> |
|
|
|
|
|
|
|
<view class="width30 height40 flright font14 fcor999 fotct" |
|
|
|
style="border-left: 1px solid #f2f2f2;line-height: 40px;"> |
|
|
|
style="border-left: 1px solid #f2f2f2;line-height: 40px;"> |
|
|
|
约0.01L |
|
|
|
约{{litre}}L |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<view class="list width90"> |
|
|
|
<view class="list width90"> |
|
|
|
<view class="box" v-for="(amount,index) in amountList" :key="index" @click="select(amount)" |
|
|
|
<view class="box" v-for="(amount,index) in amountList" :key="index" @click="select(amount)" |
|
|
|
:class="{'on':amount.id == inputAmount}"> |
|
|
|
:class="{'on':amount.price == inputMoney}"> |
|
|
|
<view class="heTitle fcor333" :class="{'fcor089':amount.id == inputAmount}">{{amount.price}}元</view> |
|
|
|
<view class="heTitle fcor333" :class="{'fcor089':amount.id == inputAmount}">{{amount.price}}元</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
@ -81,9 +82,19 @@ |
|
|
|
<!-- 底部按钮 --> |
|
|
|
<!-- 底部按钮 --> |
|
|
|
<view class="footer"> |
|
|
|
<view class="footer"> |
|
|
|
<view class="width50 flleft fcor666 padleft15 font15"> |
|
|
|
<view class="width50 flleft fcor666 padleft15 font15"> |
|
|
|
合计: ¥<text class="font24">0.00</text> |
|
|
|
合计: ¥<text class="font24">{{totalPrice}}</text> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<button class="reBtn flright">去支付</button> |
|
|
|
|
|
|
|
|
|
|
|
<!-- #ifdef MP --> |
|
|
|
|
|
|
|
<button class="reBtn flright" open-type="getPhoneNumber" v-if="user.phone == null" |
|
|
|
|
|
|
|
@getphonenumber="getPhoneNumber">去支付</button> |
|
|
|
|
|
|
|
<button class="reBtn flright" v-else @click="toPay">去支付</button> |
|
|
|
|
|
|
|
<!-- #endif --> |
|
|
|
|
|
|
|
<!-- #ifdef H5 --> |
|
|
|
|
|
|
|
<button class="reBtn flright" v-if="user.phone == null" @click="jumpH5Bding">去支付</button> |
|
|
|
|
|
|
|
<button class="reBtn flright" v-else @click="toPay">去支付</button> |
|
|
|
|
|
|
|
<!-- #endif --> |
|
|
|
|
|
|
|
|
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<!-- 底部弹窗 --> |
|
|
|
<!-- 底部弹窗 --> |
|
|
|
<wybPopup ref="popup" type="bottom" height="600" width="500" radius="6" :showCloseIcon="true"> |
|
|
|
<wybPopup ref="popup" type="bottom" height="600" width="500" radius="6" :showCloseIcon="true"> |
|
|
@ -110,7 +121,8 @@ |
|
|
|
|
|
|
|
|
|
|
|
<script> |
|
|
|
<script> |
|
|
|
import { |
|
|
|
import { |
|
|
|
getGasDetailByStoreKey |
|
|
|
getGasDetailByStoreKey, |
|
|
|
|
|
|
|
addOrder |
|
|
|
} from '../../../Utils/Api.js'; |
|
|
|
} from '../../../Utils/Api.js'; |
|
|
|
import wybPopup from '../../../components/wyb-popup/wyb-popup.vue'; |
|
|
|
import wybPopup from '../../../components/wyb-popup/wyb-popup.vue'; |
|
|
|
let app = getApp(); |
|
|
|
let app = getApp(); |
|
|
@ -122,6 +134,7 @@ |
|
|
|
return { |
|
|
|
return { |
|
|
|
detailList: [], |
|
|
|
detailList: [], |
|
|
|
gunnumber: [], |
|
|
|
gunnumber: [], |
|
|
|
|
|
|
|
user: '', |
|
|
|
amountList: [{ |
|
|
|
amountList: [{ |
|
|
|
id: '1', |
|
|
|
id: '1', |
|
|
|
price: '200' |
|
|
|
price: '200' |
|
|
@ -147,18 +160,36 @@ |
|
|
|
priceOfficial: '', |
|
|
|
priceOfficial: '', |
|
|
|
priceGun: '', |
|
|
|
priceGun: '', |
|
|
|
gunNo: '', |
|
|
|
gunNo: '', |
|
|
|
typeId: '' |
|
|
|
typeId: '', |
|
|
|
|
|
|
|
counId: '', |
|
|
|
|
|
|
|
inputMoney: '', |
|
|
|
|
|
|
|
gasOilNo: '', |
|
|
|
|
|
|
|
litre: '', |
|
|
|
|
|
|
|
totalPrice: '0.00' |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
onLoad(options) { |
|
|
|
onLoad(options) { |
|
|
|
this.store_key = options.id; |
|
|
|
this.store_key = options.id; |
|
|
|
|
|
|
|
this.counId = options.desId; |
|
|
|
this.getGasDetailByStoreKey(); |
|
|
|
this.getGasDetailByStoreKey(); |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
onShow() { |
|
|
|
|
|
|
|
this.user = app.globalData.userInfo; |
|
|
|
|
|
|
|
}, |
|
|
|
methods: { |
|
|
|
methods: { |
|
|
|
|
|
|
|
//前往导航 |
|
|
|
|
|
|
|
seeloaction() { |
|
|
|
|
|
|
|
uni.openLocation({ |
|
|
|
|
|
|
|
latitude: Number(this.storeList.gasAddressLatitude), //目的地的定位 |
|
|
|
|
|
|
|
longitude: Number(this.storeList.gasAddressLongitude), //目的地的定位 |
|
|
|
|
|
|
|
name: this.storeList.gasName, |
|
|
|
|
|
|
|
address: this.storeList.gasAddress |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
}, |
|
|
|
//显示弹出 |
|
|
|
//显示弹出 |
|
|
|
showPopup(item) { |
|
|
|
showPopup(item) { |
|
|
|
this.$refs.popup.show(); |
|
|
|
|
|
|
|
this.typeId = item; |
|
|
|
this.typeId = item; |
|
|
|
|
|
|
|
this.$refs.popup.show(); |
|
|
|
}, |
|
|
|
}, |
|
|
|
//查询详情 |
|
|
|
//查询详情 |
|
|
|
getGasDetailByStoreKey() { |
|
|
|
getGasDetailByStoreKey() { |
|
|
@ -182,7 +213,8 @@ |
|
|
|
this.gunnumber = res.return_data.gasGunList; |
|
|
|
this.gunnumber = res.return_data.gasGunList; |
|
|
|
for (var i = 0; i < res.return_data.gasGunList.length; i++) { |
|
|
|
for (var i = 0; i < res.return_data.gasGunList.length; i++) { |
|
|
|
if (this.oilNo == res.return_data.gasGunList[i].oilNoName) { |
|
|
|
if (this.oilNo == res.return_data.gasGunList[i].oilNoName) { |
|
|
|
this.gunNo = res.return_data.gasGunList[i].gunNo |
|
|
|
this.gunNo = res.return_data.gasGunList[i].gunNo; |
|
|
|
|
|
|
|
this.gasOilNo = res.return_data.gasGunList[i].oilNo; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -193,6 +225,7 @@ |
|
|
|
//选择油号 |
|
|
|
//选择油号 |
|
|
|
changeValue(item) { |
|
|
|
changeValue(item) { |
|
|
|
this.oilNo = item.oilNoName; |
|
|
|
this.oilNo = item.oilNoName; |
|
|
|
|
|
|
|
this.gasOilNo = item.oilNo; |
|
|
|
this.priceVip = item.priceVip; |
|
|
|
this.priceVip = item.priceVip; |
|
|
|
this.priceOfficial = item.priceOfficial; |
|
|
|
this.priceOfficial = item.priceOfficial; |
|
|
|
this.priceGun = item.priceGun; |
|
|
|
this.priceGun = item.priceGun; |
|
|
@ -204,7 +237,80 @@ |
|
|
|
this.$refs.popup.hide(); |
|
|
|
this.$refs.popup.hide(); |
|
|
|
}, |
|
|
|
}, |
|
|
|
select(amount) { |
|
|
|
select(amount) { |
|
|
|
this.inputAmount = amount.id; |
|
|
|
this.inputMoney = amount.price; |
|
|
|
|
|
|
|
this.litre = parseFloat(amount.price / this.priceGun).toFixed(2); |
|
|
|
|
|
|
|
this.totalPrice = parseFloat(amount.price / this.priceGun * this.priceVip).toFixed(2); |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
// 微信获取手机号 |
|
|
|
|
|
|
|
getPhoneNumber(PhoneNumber) { |
|
|
|
|
|
|
|
let params = { |
|
|
|
|
|
|
|
openId: app.globalData.openId, |
|
|
|
|
|
|
|
iv: PhoneNumber.detail.iv, |
|
|
|
|
|
|
|
encryptedData: PhoneNumber.detail.encryptedData |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
GetPhoneNumber(params).then(res => { |
|
|
|
|
|
|
|
if (res.return_code == '000000') { |
|
|
|
|
|
|
|
app.globalData.userInfo = res.return_data |
|
|
|
|
|
|
|
.object |
|
|
|
|
|
|
|
.highUser; |
|
|
|
|
|
|
|
uni.setStorage({ |
|
|
|
|
|
|
|
key: "user", |
|
|
|
|
|
|
|
data: res.return_data |
|
|
|
|
|
|
|
.object |
|
|
|
|
|
|
|
.highUser |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
let that = this; |
|
|
|
|
|
|
|
that.toPay(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
// H5获取手机号 |
|
|
|
|
|
|
|
jumpH5Bding() { |
|
|
|
|
|
|
|
uni.navigateTo({ |
|
|
|
|
|
|
|
url: '/pages/login/register?id=2' |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
//失去焦点算价格和油升 |
|
|
|
|
|
|
|
Listeningfocus() { |
|
|
|
|
|
|
|
this.litre = parseFloat(this.inputMoney / this.priceGun).toFixed(2); |
|
|
|
|
|
|
|
this.totalPrice = parseFloat(this.inputMoney / this.priceGun * this.priceVip).toFixed(2); |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
toPay() { |
|
|
|
|
|
|
|
if (this.inputMoney == '' || this.inputMoney < 1) { |
|
|
|
|
|
|
|
uni.showToast({ |
|
|
|
|
|
|
|
title: '请输入正确金额', |
|
|
|
|
|
|
|
icon: "none" |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
return false; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
uni.showLoading({ |
|
|
|
|
|
|
|
title: '提交订单中...' |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
let goods = { |
|
|
|
|
|
|
|
"highChildOrderList": [{ |
|
|
|
|
|
|
|
"goodsType": 3, |
|
|
|
|
|
|
|
"goodsId": this.counId, |
|
|
|
|
|
|
|
"saleCount": 1, |
|
|
|
|
|
|
|
"goodsPrice": this.inputMoney, |
|
|
|
|
|
|
|
"gasGunNo": this.gunNo, |
|
|
|
|
|
|
|
"gasOilNo": this.gasOilNo |
|
|
|
|
|
|
|
}] |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
addOrder(goods).then(res => { |
|
|
|
|
|
|
|
uni.hideLoading(); |
|
|
|
|
|
|
|
if (res.return_code == '000000') { |
|
|
|
|
|
|
|
uni.redirectTo({ |
|
|
|
|
|
|
|
url: '/pages/goods/refuel-confirm/refuel-confirm?payprice=' + res.return_data.payPrice + '&orderId=' + res.return_data.id + '&couponId=' + this.counId+'&adres='+this.storeList.gasAddress |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
uni.showToast({ |
|
|
|
|
|
|
|
title: res.return_msg, |
|
|
|
|
|
|
|
icon: 'none', |
|
|
|
|
|
|
|
duration: 2000 |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
}, |
|
|
|
}, |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|