1.增加地区页面

2.修改加油列表
yj-dev
杨杰 3 years ago
parent 93098c18dd
commit f6fc4710a0
  1. 46
      components/sl-filter/filter-view.vue
  2. 7
      pages.json
  3. 83
      pages/goods/refuel/refuel.vue
  4. 14
      pages/tabBar/home/home.vue
  5. 64
      pages/user/positioning/positioning.vue

@ -5,8 +5,10 @@
<view class="filter-content" v-for="(item, index) in menuList" :key="index" v-if="menuIndex == index"> <view class="filter-content" v-for="(item, index) in menuList" :key="index" v-if="menuIndex == index">
<view v-if="item.isSort"> <view v-if="item.isSort">
<view class="filter-content-list"> <view class="filter-content-list">
<view v-for="(detailItem,idx) in selectDetailList" :key="idx" :class="detailItem.isSelected?'filter-content-list-item-active':'filter-content-list-item-default'" <view v-for="(detailItem,idx) in selectDetailList" :key="idx"
:style="{'color': detailItem.isSelected?themeColor:'#666666'}" @tap="sortTap(idx,selectDetailList,item.key)"> :class="detailItem.isSelected?'filter-content-list-item-active':'filter-content-list-item-default'"
:style="{'color': detailItem.isSelected?themeColor:'#666666'}"
@tap="sortTap(idx,selectDetailList,item.key)">
<text>{{detailItem.title}}</text> <text>{{detailItem.title}}</text>
</view> </view>
</view> </view>
@ -16,16 +18,20 @@
<text>{{item.detailTitle}}</text> <text>{{item.detailTitle}}</text>
</view> </view>
<view class="filter-content-detail"> <view class="filter-content-detail">
<text v-for="(detailItem,idx) in selectDetailList" :key="idx" class='filter-content-detail-item-default' :style="{'background-color':detailItem.isSelected?themeColor:'#f6f6f6','color':detailItem.isSelected?'#FFFFFF':'#999999'}" <text v-for="(detailItem,idx) in selectDetailList" :key="idx"
class='filter-content-detail-item-default'
:style="{'background-color':detailItem.isSelected?themeColor:'#f6f6f6','color':detailItem.isSelected?'#FFFFFF':'#999999'}"
@tap="itemTap(idx,selectDetailList,item.isMutiple,item.key)"> @tap="itemTap(idx,selectDetailList,item.isMutiple,item.key)">
{{detailItem.title}} {{detailItem.title}}
</text> </text>
</view> </view>
<view class="filter-content-footer"> <view class="filter-content-footer">
<view class="filter-content-footer-item" style="color: #777777; background-color: #FFFFFF;" @tap="resetClick(selectDetailList,item.key)"> <view class="filter-content-footer-item" style="color: #777777; background-color: #FFFFFF;"
@tap="resetClick(selectDetailList,item.key)">
<text>重置</text> <text>重置</text>
</view> </view>
<view class="filter-content-footer-item" :style="{'color': '#FFFFFF', 'background-color': themeColor}" @tap="sureClick"> <view class="filter-content-footer-item"
:style="{'color': '#FFFFFF', 'background-color': themeColor}" @tap="sureClick">
<text>确定</text> <text>确定</text>
</view> </view>
</view> </view>
@ -95,7 +101,8 @@
let obj = {} let obj = {}
for (let i = 0; i < this.menuList.length; i++) { for (let i = 0; i < this.menuList.length; i++) {
let item = this.menuList[i]; let item = this.menuList[i];
if (!this.independence && item.defaultSelectedIndex != null && item.defaultSelectedIndex.toString().length > 0) { // if (!this.independence && item.defaultSelectedIndex != null && item.defaultSelectedIndex.toString()
.length > 0) { //
if (item.isMutiple) { if (item.isMutiple) {
obj[item.key] = []; obj[item.key] = [];
@ -150,12 +157,14 @@
if (Array.isArray(this.menuList[i].defaultSelectedIndex)) { // falsetrue if (Array.isArray(this.menuList[i].defaultSelectedIndex)) { // falsetrue
for (let j = 0; j < this.menuList[i].defaultSelectedIndex.length; j++) { for (let j = 0; j < this.menuList[i].defaultSelectedIndex.length; j++) {
if (this.selectDetailList[this.menuList[i].defaultSelectedIndex[j]].isSelected == false) { if (this.selectDetailList[this.menuList[i].defaultSelectedIndex[j]].isSelected == false) {
this.itemTap(this.menuList[i].defaultSelectedIndex[j], this.selectDetailList, this.menuList[i].isMutiple, this this.itemTap(this.menuList[i].defaultSelectedIndex[j], this.selectDetailList, this
.menuList[i].isMutiple, this
.menuList[i].key) .menuList[i].key)
} }
} }
} else { } else {
this.itemTap(this.menuList[i].defaultSelectedIndex, this.selectDetailList, this.menuList[i].isMutiple, this.menuList[ this.itemTap(this.menuList[i].defaultSelectedIndex, this.selectDetailList, this.menuList[i]
.isMutiple, this.menuList[
i].key) i].key)
} }
@ -164,7 +173,8 @@
// truefalse // truefalse
for (let j = 0; j < unDefaultSelectedIndexArr.length; j++) { for (let j = 0; j < unDefaultSelectedIndexArr.length; j++) {
if (this.selectDetailList[unDefaultSelectedIndexArr[j]].isSelected == true) { if (this.selectDetailList[unDefaultSelectedIndexArr[j]].isSelected == true) {
this.itemTap(unDefaultSelectedIndexArr[j], this.selectDetailList, this.menuList[i].isMutiple, this this.itemTap(unDefaultSelectedIndexArr[j], this.selectDetailList, this.menuList[i]
.isMutiple, this
.menuList[i].key) .menuList[i].key)
} }
} }
@ -405,10 +415,12 @@
.filter-content-detail-item-active { .filter-content-detail-item-active {
background-color: #D1372C; background-color: #D1372C;
color: #FFFFFF; color: #FFFFFF;
padding: 5px 15px; padding: 5px 0px;
border-radius: 20px; border-radius: 5px;
margin-right: 8px; width: 21%;
margin-top: 10px; margin-left: 4%;
text-align: center;
margin-top: 15px;
display: inline-block; display: inline-block;
font-size: 13px; font-size: 13px;
} }
@ -416,10 +428,12 @@
.filter-content-detail-item-default { .filter-content-detail-item-default {
background-color: #FFFFFF; background-color: #FFFFFF;
color: #666666; color: #666666;
padding: 5px 15px; padding: 5px 0px;
border-radius: 5px; border-radius: 5px;
margin-right: 8px; width: 21%;
margin-top: 10px; margin-left: 4%;
text-align: center;
margin-top: 15px;
display: inline-block; display: inline-block;
font-size: 13px; font-size: 13px;
} }

@ -422,8 +422,15 @@
"backgroundColorBottom": "#ffffff" "backgroundColorBottom": "#ffffff"
} }
},{
"path" : "pages/user/positioning/positioning",
"style" :
{
"navigationBarTitleText": "地区选择",
"enablePullDownRefresh": false
} }
}
], ],
"globalStyle": { "globalStyle": {

@ -2,13 +2,27 @@
<view> <view>
<view class="width100 backcorfff"> <view class="width100 backcorfff">
<image mode="widthFix" class=" flleft sear mart15" src="../../../static/img/btjy.png"></image> <image mode="widthFix" class=" flleft sear mart15" src="../../../static/img/btjy.png"></image>
<uSearchBar @confirm="getGasStoreList" v-model="searname" @input="getGasStoreList"></uSearchBar> <uSearchBar @confirm="search" @input="input"></uSearchBar>
</view>
<!-- <slFilter :independence="true" :color="titleColor" :themeColor="themeColor" :menuList.sync="menuList"
@result="result"></slFilter> -->
<view class="width100 height40 backcorfff">
<view class="width90">
<view class="stuMenu flleft fotct" @click="showPopup(1)">50km内<image mode="widthFix" class="stuimg margle"
src="../../../static/img/xiala.png"></image>
</view>
<view class="stuMenu flleft fotct">距离优先<image mode="widthFix" class="stuimg margle"
src="../../../static/img/xiala.png"></image>
</view>
<view class="stuMenu flleft fotct">92#<image mode="widthFix" class="stuimg margle"
src="../../../static/img/xiala.png"></image>
</view>
</view>
</view> </view>
<slFilter :independence="true" :color="titleColor" :themeColor="themeColor" :menuList.sync="menuList"
@result="result"></slFilter>
<view class="width90 height100p backcorfff border-r mart10" v-for="(item,index) in refuelList" :key="index" <view class="width90 height100p backcorfff border-r mart10" v-for="(item,index) in refuelList" :key="index"
@click="goDetails(item.store_key)"> @click="goDetails(item.store_key)">
<image mode="widthFix" :src="item.store_logo" class="recontleft flleft mart10 border-r" style="max-height: 80px;"> <image mode="widthFix" :src="item.store_logo" class="recontleft flleft mart10 border-r"
style="max-height: 80px;">
</image> </image>
<view class="recontright"> <view class="recontright">
<view class="text1 width100 font15 fontwig6 paddtop10">{{item.store_name}}</view> <view class="text1 width100 font15 fontwig6 paddtop10">{{item.store_name}}</view>
@ -21,11 +35,23 @@
</view> </view>
</view> </view>
<view class="font14 width100 fcoreb5 mart5 height22"> <view class="font14 width100 fcoreb5 mart5 height22">
<text class="font18 fontwig6">{{item.price_vip}}</text><text class="fcor999 margle">油站价{{item.price_gun}}</text> <text class="font18 fontwig6">{{item.price_vip}}</text><text
class="fcor999 margle">油站价{{item.price_gun}}</text>
</view> </view>
</view> </view>
</view> </view>
<wybPopup ref="popup" type="top" height="600" width="500" radius="6" :showCloseIcon="true">
<view class="fotct font18 fontwig6 fcor333 mart10 height30">选择油枪</view>
<view class="font15 fcor666 width90 mart10 height22">汽油油枪</view>
<view v-if="typeId == 2">
<view :class="item.gunNo == gunNo?'activeRefuel':'refuel'" v-for="(item,index) in gunnumber"
:key="index" @click="changeValue2(item)">
{{item.gunNo}}
</view>
</view>
</wybPopup>
</view> </view>
</template> </template>
@ -34,12 +60,14 @@
getGasStoreList getGasStoreList
} from '../../../Utils/Api.js'; } from '../../../Utils/Api.js';
import slFilter from '@/components/sl-filter/sl-filter.vue'; import slFilter from '@/components/sl-filter/sl-filter.vue';
import wybPopup from '../../../components/wyb-popup/wyb-popup.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';
let app = getApp(); let app = getApp();
export default { export default {
components: { components: {
slFilter, slFilter,
uSearchBar uSearchBar,
wybPopup
}, },
data() { data() {
return { return {
@ -82,10 +110,7 @@
'detailTitle': '', 'detailTitle': '',
'reflexTitle': true, 'reflexTitle': true,
'defaultSelectedIndex': 0, 'defaultSelectedIndex': 0,
'detailList': [ 'detailList': [{
{
'detatitle': '汽油',
'dataList': [{
'title': '90#', 'title': '90#',
'value': '' 'value': ''
}, { }, {
@ -100,9 +125,7 @@
}, { }, {
'title': '101#', 'title': '101#',
'value': '101#' 'value': '101#'
}] }, ]
},
]
}, },
{ {
'title': '距离', 'title': '距离',
@ -156,7 +179,28 @@
onLoad() { onLoad() {
this.getGasStoreList(); this.getGasStoreList();
}, },
onReachBottom() {
this.getGasStoreList();
},
methods: { methods: {
//
showPopup(item) {
this.$refs.popup.show();
this.typeId = item;
},
search(res) {
uni.showToast({
title: '搜索:' + res.value,
icon: 'none'
})
},
input(res) {
this.searname = res;
this.pageNum = 1;
this.isNoMoreData = false;
this.refuelList = [];
this.getGasStoreList();
},
// //
getGasStoreList() { getGasStoreList() {
uni.showLoading({ uni.showLoading({
@ -211,6 +255,19 @@
background-color: #f6f6f6; background-color: #f6f6f6;
} }
.stuMenu {
width: 33.3%;
height: 30px;
line-height: 30px;
font-size: 14px;
color: #333333;
.stuimg {
width: 10px;
vertical-align: middle;
}
}
.sear { .sear {
margin-left: 10px; margin-left: 10px;
width: 50px; width: 50px;

@ -7,7 +7,7 @@
<view v-if="showHeader" class="header" <view v-if="showHeader" class="header"
:style="{ position: headerPosition,top:headerTop,opacity: afterHeaderOpacity }"> :style="{ position: headerPosition,top:headerTop,opacity: afterHeaderOpacity }">
<!-- 定位城市 --> <!-- 定位城市 -->
<view class="addr"> <view class="addr" @click="goPostion">
<view class="icon location"></view> <view class="icon location"></view>
{{ city }} {{ city }}
</view> </view>
@ -407,6 +407,18 @@
console.log(err); console.log(err);
}); });
}, },
//
toSearch() {
uni.navigateTo({
url: '../../goods/HM-search/HM-search'
})
},
//
goPostion(){
uni.navigateTo({
url:'/pages/user/positioning/positioning'
})
},
// //
toScan() { toScan() {
uni.scanCode({ uni.scanCode({

@ -0,0 +1,64 @@
<template>
<view>
<view class="width100 backcorfff">
<uSearchBar @confirm="search" @input="input"></uSearchBar>
<view class="line1 mart10"></view>
<view class="width90 mart20 font15 fcor333">当前定位</view>
<view class="posacname actives width90 mart20">南充</view>
<view class="width90 mart20 font14 fcor333">其他地区</view>
<view class="posacname mart20 flleft font14" :class="{'actives':posId===item.name}" v-for="(item,index) in posList" @click="change(item)">
{{item.name}}</view>
</view>
</view>
</template>
<script>
import uSearchBar from '../../../components/uni-search-bar/components/uni-search-bar/uni-search-bar.vue';
export default {
components: {
uSearchBar
},
data() {
return {
posList: [{
name: '南充'
},
{
name: '高坪'
},
{
name: '嘉陵'
},
{
name: '南部'
}
],
posId: ''
}
},
methods: {
change(item) {
this.posId = item.name;
}
}
}
</script>
<style lang="less">
.posacname {
background-color: #f5f5f5;
color: #666666;
width: 20%;
height: 30px;
margin-left: 4%;
line-height: 30px;
text-align: center;
border-radius: 5px;
}
.actives{
color: #089bf5;
background-color: #f4faff;
border: 1px solid #089bf5;
}
</style>
Loading…
Cancel
Save