111
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

132 lines
3.6 KiB

1 year ago
<template>
<view class="Activity_body">
<scroll-view @refresherrefresh='refresherrefresh' :refresher-enabled='true'
:refresher-triggered='refresherTriggered' style="height: 100%;" scroll-y="true"
@scrolltolower='scrolltolower'>
<view v-for="(item,index) in siteList" :key="item.id">
<site-item @tap="toDetail(item)" :site-item="item" class="cu-list menu-avatar cu-item" />
<view class="activityContent">{{item.activityContent}}</view>
</view>
</scroll-view>
</view>
</template>
<script>
import oilSiteApi from '@/api/oil-site.js'
export default {
data() {
return {
refresherTriggered: false,
page: {
currentPage: 1,
pageSize: 10,
params: { //类型:Object 必有字段 备注:// 筛选对象
// sort: "juli", //类型:String 必有字段 备注:// 智能排序 ( price:价格最低 juli:距离最近 ) 默认距离排序
siteName: '',
...uni.getStorageSync('location'),
// ...this.filterData
// siteBrand: this.siteName ? '' : this.filterDatas
siteBrand: '', // 备注:// 石油品牌 ( 1-中国石油 2-中国石化 3-壳牌 4-民营 5-中海油 6-京博 7-中化石油 8-其他 )
// channelCode: this.siteName ? '' : this.filterDatas
channelCode: '', // 备注:// 渠道编码 ( OIL:星油 WJY:万金油 LV:老吕(找油网) TY:团油 YDJY:一点加油(壳牌))
// oilProductCode: this.siteName ? '' : this.filterDatas
oilProductCode: '', // 备注:// 油号选择 ( 0# 92# 92#)
siteLevel: '',
sort: 'juli',
provinceCode: '',
cityCode: '',
areaCode: '',
distance: ''
}
},
siteList: []
}
},
created() {
this.init()
},
methods: {
toDetail(item){
let itemS = JSON.stringify(item)
if (uni.getStorageSync('user')) {
if (item.channelCode === 'TY') {
uni.setStorageSync('OtherSiteInfo', item)
uni.navigateTo({
url: `/BagStation/pages/stationDetail/stationDetail?channerCode=${item.channelCode}`,
fail: (err) => {
// console.log(err)
},
success: () => {
// console.log('err')
}
})
return
}
uni.navigateTo({
url: `/BagStation/pages/stationDetail/stationDetail?item=${itemS}`,
fail: (err) => {
// console.log(err)
},
success: () => {
// console.log('err')
}
})
} else {
uni.showModal({
title: '请您登录',
content: "登录星油加油才可以加油 |˛˙꒳˙)♡",
confirmText: '去登陆',
success: (res) => {
if (res.confirm) {
uni.reLaunch({
url: '../../../BagAuth/pages/login/login'
})
}
}
})
}
},
refresherrefresh() {
this.page.currentPage =1;
this.refresherTriggered = true;
this.getSiteList()
},
init(){
this.getSiteList();
},
getSiteList() {
let location = uni.getStorageSync('location');
oilSiteApi.getBSitesByActivity(this.page).then(res => {
if(this.page.currentPage>1){
this.siteList = this.siteList.concat(res.data.list)
}else{
this.siteList = res.data.list
}
}).finally(()=>{
this.refresherTriggered = false;
})
},
scrolltolower() {
this.page.currentPage += 1;
this.getSiteList()
},
}
}
</script>
<style scoped lang="scss">
.activityContent{
background: #ff670026;
border-radius: 10rpx;
margin: 10rpx 30rpx;
box-sizing: border-box;
padding: 20rpx 30rpx;
color: #FF6700;
font-size: 22rpx;
}
.Activity_body {
width: 100vw;
height: 100vh;
overflow: hidden;
}
</style>