1.对接团油接口

yj-dev
杨杰 3 years ago
parent 682dac1689
commit b4b58e69b1
  1. 8
      Utils/Api.js
  2. 43
      pages.json
  3. 6
      pages/goods/refuel-details/refuel-details.vue
  4. 93
      pages/goods/refuel/refuel.vue
  5. 36
      pages/tabBar/home/home.vue

@ -131,6 +131,14 @@ export const getUserNormalDiscountList = params => {
export const getStoreList = params => { export const getStoreList = params => {
return POST('GET', `${base}/highMerchantStore/getStoreList`, params).then(res => res.data); return POST('GET', `${base}/highMerchantStore/getStoreList`, params).then(res => res.data);
} }
//查询团油列表
export const getGasStoreList = params => {
return POST('GET', `${base}/highGas/getGasStoreList`, params).then(res => res.data);
}
//查询团油详情
export const getGasDetailByStoreKey = params => {
return POST('GET', `${base}/highGas/getGasDetailByStoreKey`, params).then(res => res.data);
}
/** /**
* H5 获取用户信息 * H5 获取用户信息

@ -1,28 +1,6 @@
{ {
"pages": [ //pageshttps://uniapp.dcloud.io/collocation/pages "pages": [ //pageshttps://uniapp.dcloud.io/collocation/pages
{ {
"path" : "pages/goods/refuel-succes/refuel-succes",
"style" :
{
//
"navigationBarTitleText": "",
"navigationBarBackgroundColor": "#0083f5",
"backgroundColorTop": "#0083f5",
"navigationBarTextStyle": "white",
"enablePullDownRefresh": false
}
},{
"path": "pages/goods/refuel-confirm/refuel-confirm",
"style": {
"navigationBarTitleText": "确认订单",
"navigationBarBackgroundColor": "#0083f5",
"backgroundColorTop": "#0083f5",
"navigationBarTextStyle": "white",
"enablePullDownRefresh": false
}
}, {
"path": "pages/tabBar/home/home", "path": "pages/tabBar/home/home",
"style": { "style": {
"navigationBarTextStyle": "black", "navigationBarTextStyle": "black",
@ -40,6 +18,27 @@
}] }]
} }
} }
}, {
"path": "pages/goods/refuel-succes/refuel-succes",
"style": {
//
"navigationBarTitleText": "",
"navigationBarBackgroundColor": "#0083f5",
"backgroundColorTop": "#0083f5",
"navigationBarTextStyle": "white",
"enablePullDownRefresh": false
}
}, {
"path": "pages/goods/refuel-confirm/refuel-confirm",
"style": {
"navigationBarTitleText": "确认订单",
"navigationBarBackgroundColor": "#0083f5",
"backgroundColorTop": "#0083f5",
"navigationBarTextStyle": "white",
"enablePullDownRefresh": false
}
}, { }, {
"path": "pages/user/order_details/order_details", "path": "pages/user/order_details/order_details",
"style": { "style": {

@ -23,15 +23,15 @@
92# <image mode="widthFix" src="../../../static/img/xiala.png"></image> 92# <image mode="widthFix" src="../../../static/img/xiala.png"></image>
</view> </view>
<view class="margle20 font15 fcoreb5 flleft mart20 borRit"> <view class="margle20 font15 fcoreb5 flleft mart20 borRit">
<view class="fontspec fotct paddleft10">团购价</view> <view class="fontspec fotct ">团购价</view>
<view class="fontwig6 font20"><text class="font14"></text>6.38</view> <view class="fontwig6 font20"><text class="font14"></text>6.38</view>
</view> </view>
<view class="margle20 font15 fcor666 flleft mart20 borRit"> <view class="margle20 font15 fcor666 flleft mart20 borRit">
<view class="fontspec fotct paddleft10">油站价</view> <view class="fontspec fotct ">油站价</view>
<view class="fontwig6 font20"><text class="font14"></text>6.88</view> <view class="fontwig6 font20"><text class="font14"></text>6.88</view>
</view> </view>
<view class="margle20 font15 fcor666 flleft mart20 "> <view class="margle20 font15 fcor666 flleft mart20 ">
<view class="fontspec fotct paddleft10">国标价</view> <view class="fontspec fotct ">国标价</view>
<view class="fontwig6 font20"><text class="font14"></text>6.88</view> <view class="fontwig6 font20"><text class="font14"></text>6.88</view>
</view> </view>
</view> </view>

@ -6,52 +6,14 @@
</view> </view>
<slFilter :independence="true" :color="titleColor" :themeColor="themeColor" :menuList.sync="menuList" <slFilter :independence="true" :color="titleColor" :themeColor="themeColor" :menuList.sync="menuList"
@result="result"></slFilter> @result="result"></slFilter>
<view class="width90 height100p backcorfff border-r mart10" @click="goDetails"> <view class="width90 height100p backcorfff border-r mart10" v-for="(item,index) in refuelList" :key="index" @click="goDetails">
<image mode="widthFix" src="../../../static/img/noorder.png" class="recontleft flleft mart10 border-r"> <image mode="widthFix" :src="item.store_logo" class="recontleft flleft mart10 border-r">
</image> </image>
<view class="recontright"> <view class="recontright">
<view class="text1 width100 font15 fontwig6 paddtop10">贵州花冠中石油燃气加油站</view> <view class="text1 width100 font15 fontwig6 paddtop10">{{item.store_name}}</view>
<view class="width100 mart10 height22"> <view class="width100 mart10 height22">
<view class="width70 flleft text1 font13 fcor999"> <view class="width70 flleft text1 font13 fcor999">
花冠路贵惠大道桐荫26号 {{item.address}}
</view>
<view class="width30 flright font13 fcor666 fotct">
<image mode="widthFix" src="../../../static/img/dh.png" style="width: 10px;"></image>1.9km
</view>
</view>
<view class="font14 width100 fcoreb5 mart5 height22">
<text class="font18 fontwig6">6.40</text><text class="fcor999 margle">油站价6.88</text>
</view>
</view>
</view>
<view class="width90 height100p backcorfff border-r mart10">
<image mode="widthFix" src="../../../static/img/noorder.png" class="recontleft flleft mart10 border-r">
</image>
<view class="recontright">
<view class="text1 width100 font15 fontwig6 paddtop10">贵州花冠中石油燃气加油站</view>
<view class="width100 mart10 height22">
<view class="width70 flleft text1 font13 fcor999">
花冠路贵惠大道桐荫26号
</view>
<view class="width30 flright font13 fcor666 fotct">
<image mode="widthFix" src="../../../static/img/dh.png" style="width: 10px;"></image>1.9km
</view>
</view>
<view class="font14 width100 fcoreb5 mart5 height22">
<text class="font18 fontwig6">6.40</text><text class="fcor999 margle">油站价6.88</text>
</view>
</view>
</view>
<view class="width90 height100p backcorfff border-r mart10">
<image mode="widthFix" src="../../../static/img/noorder.png" class="recontleft flleft mart10 border-r">
</image>
<view class="recontright">
<view class="text1 width100 font15 fontwig6 paddtop10">贵州花冠中石油燃气加油站</view>
<view class="width100 mart10 height22">
<view class="width70 flleft text1 font13 fcor999">
花冠路贵惠大道桐荫26号
</view> </view>
<view class="width30 flright font13 fcor666 fotct"> <view class="width30 flright font13 fcor666 fotct">
<image mode="widthFix" src="../../../static/img/dh.png" style="width: 10px;"></image>1.9km <image mode="widthFix" src="../../../static/img/dh.png" style="width: 10px;"></image>1.9km
@ -67,6 +29,7 @@
</template> </template>
<script> <script>
import {getGasStoreList} from '../../../Utils/Api.js';
import slFilter from '@/components/sl-filter/sl-filter.vue'; import slFilter from '@/components/sl-filter/sl-filter.vue';
import uSearchBar from '../../../components/uni-search-bar/components/uni-search-bar/uni-search-bar.vue'; import uSearchBar from '../../../components/uni-search-bar/components/uni-search-bar/uni-search-bar.vue';
export default { export default {
@ -173,17 +136,55 @@
} }
] ]
} }
] ],
refuelList: [],
pageNum: 1,
pageSize: 10,
isNoMoreData: false,
} }
}, },
onLoad() { onLoad() {
this.getGasStoreList();
}, },
methods: { methods: {
//
getGasStoreList() {
uni.showLoading({
title: '加载中...'
})
if (this.isNoMoreData) {
uni.hideLoading()
return false;
}
let pagenum = this.pageNum;
let params = {
distance: '25',
regionId: '110000',
oilNoName: '92#',
longitude: "116.881602",
latitude: '39.912496',
pageNum: pagenum,
pageSize: this.pageSize
}
getGasStoreList(params).then(res => {
if (res.return_code == '000000') {
uni.hideLoading();
this.isNoMoreData = res.return_data.list.length == this.pageSize ? false : true;
if (res.return_data.total == (this.pageNum * this.pageSize)) {
this.isNoMoreData = true;
}
this.refuelList = this.refuelList.concat(res.return_data.list);
this.pageNum = res.return_data.list.length == this.pageSize ? ++pagenum : pagenum;
} else {
this.refuelList = [];
uni.hideLoading()
}
})
},
// //
goDetails(){ goDetails() {
uni.navigateTo({ uni.navigateTo({
url:'../refuel-details/refuel-details' url: '../refuel-details/refuel-details'
}) })
}, },
result(val) { result(val) {

@ -211,8 +211,9 @@
// //
categoryList: [{ categoryList: [{
id: 1, id: 1,
name: '办公', name: '团油',
img: '/static/img/wxpay.png' img: '/static/img/wxpay.png',
src: '/pages/goods/refuel/refuel'
}, },
{ {
id: 2, id: 2,
@ -228,26 +229,6 @@
id: 4, id: 4,
name: '日用', name: '日用',
img: '/static/img/wxpay.png' img: '/static/img/wxpay.png'
},
{
id: 5,
name: '蔬果',
img: '/static/img/wxpay.png'
},
{
id: 6,
name: '运动',
img: '/static/img/wxpay.png'
},
{
id: 7,
name: '书籍',
img: '/static/img/wxpay.png'
},
{
id: 8,
name: '文具',
img: '/static/img/wxpay.png'
} }
], ],
// //
@ -505,8 +486,15 @@
swiperChange(event) { swiperChange(event) {
this.currentSwiper = event.detail.current; this.currentSwiper = event.detail.current;
}, },
eheckStu(item){ eheckStu(item) {
this.cpStuats = item; this.cpStuats = item;
},
//
toCategory(item) {
uni.navigateTo({
url: item.src
})
} }
} }
}; };
@ -818,7 +806,7 @@
flex-wrap: wrap; flex-wrap: wrap;
.category { .category {
width: 20%; width: 25%;
margin-top: 50upx; margin-top: 50upx;
display: flex; display: flex;
flex-wrap: wrap; flex-wrap: wrap;

Loading…
Cancel
Save