|
|
@ -4,8 +4,6 @@ |
|
|
|
|
|
|
|
<view class="container"> |
|
|
|
|
|
|
|
{{ scene }} |
|
|
|
|
|
|
|
<uni-section title="当前加油站" |
|
|
|
type="line" |
|
|
|
titleFontSize="34rpx"></uni-section> |
|
|
@ -16,7 +14,7 @@ |
|
|
|
{{ gasStation.name }} |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<view class="oil-item" |
|
|
|
<!-- <view class="oil-item" |
|
|
|
style="margin-left: 20rpx;"> |
|
|
|
<view class="oil" |
|
|
|
style="display: flex; |
|
|
@ -26,7 +24,7 @@ |
|
|
|
@click="$refs.popup.open()"> |
|
|
|
选择站点 |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> --> |
|
|
|
</view> |
|
|
|
|
|
|
|
<!-- <view class="tip"> |
|
|
@ -147,25 +145,47 @@ |
|
|
|
} |
|
|
|
}, |
|
|
|
onShow() { |
|
|
|
if(!this.scene && !this.gasStation.id){ |
|
|
|
this.$refs.popup.open() |
|
|
|
}else{ |
|
|
|
this.gasStationList.forEach(n => { |
|
|
|
if(n.id == this.scene){ |
|
|
|
this.$store.commit('setGasStation', n) |
|
|
|
} |
|
|
|
}) |
|
|
|
this.$nextTick(n => { |
|
|
|
this.getRechargePage() |
|
|
|
}) |
|
|
|
} |
|
|
|
this.getGasStationList() |
|
|
|
}, |
|
|
|
onLoad (query) { |
|
|
|
// scene 需要使用 decodeURIComponent 才能获取到生成二维码时传入的 scene |
|
|
|
const scene = decodeURIComponent(query.scene || '') |
|
|
|
const scene = query.shareId |
|
|
|
// const scene = decodeURIComponent(query.scene || '') |
|
|
|
this.scene = scene |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
//获取加油站列表 |
|
|
|
getGasStationList(){ |
|
|
|
this.$api('getGasStationList', { |
|
|
|
pageNo : 1, |
|
|
|
pageSize : 9999999 |
|
|
|
}, res => { |
|
|
|
if(res.code == 200){ |
|
|
|
// state.gasStationList = res.result.records |
|
|
|
this.$store.commit('setGasStationList', res.result.records) |
|
|
|
|
|
|
|
console.log(res.result.records, this.scene); |
|
|
|
|
|
|
|
if(!this.scene && !this.gasStation.id){ |
|
|
|
// this.$refs.popup.open() |
|
|
|
// 默认第一个 |
|
|
|
this.$store.commit('setGasStation', res.result.records[0]) |
|
|
|
}else{ |
|
|
|
res.result.records.forEach(n => { |
|
|
|
if(n.id == this.scene){ |
|
|
|
console.log(n); |
|
|
|
this.$store.commit('setGasStation', n) |
|
|
|
} |
|
|
|
}) |
|
|
|
} |
|
|
|
|
|
|
|
this.$nextTick(n => { |
|
|
|
this.getRechargePage() |
|
|
|
}) |
|
|
|
|
|
|
|
} |
|
|
|
}) |
|
|
|
}, |
|
|
|
|
|
|
|
setGasStation(data){ |
|
|
|
this.$store.commit('setGasStation', data) |
|
|
|