pull/13/head
caolc 1 year ago
parent b375bb826d
commit 826ca7416f
  1. 133
      Activity/pages/index/index.vue
  2. 7
      api/oil-site.js
  3. 16
      pages.json
  4. 27
      pages/tabbar/home/home.vue
  5. 2
      utils/request.js

@ -0,0 +1,133 @@
<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.activityDetail}}</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: '',
clientBelong:'BAICHUAN',
...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.getBCSitesByActivity(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: 30rpx;
}
.Activity_body {
width: 100vw;
height: 100vh;
overflow: hidden;
}
</style>

@ -38,6 +38,13 @@ export default {
data: data data: data
}) })
}, },
getBCSitesByActivity(data) {
return request({
url: `/${service_name}/${group_name}/getBCSitesByActivity`,
method: 'post',
data: data
})
},
getSiteDetails(data) { getSiteDetails(data) {
return request({ return request({
url: `/${service_name}/${group_name}/getSiteDetails`, url: `/${service_name}/${group_name}/getSiteDetails`,

@ -120,6 +120,22 @@
} }
] ]
}, },
{
"root": "Activity",
"pages": [{
"path" : "pages/index/index",
"style" :
{
"navigationBarTitleText": "油站活动",
"enablePullDownRefresh": false,
"navigationStyle": "default",
"navigationBarBackgroundColor": "#fe0505",
"navigationBarTextStyle": "white"
}
}
]
},
{ {
"root": "Financial", "root": "Financial",
"pages": [{ "pages": [{

@ -65,6 +65,7 @@
中交风控 中交风控
</text> </text>
</view> </view>
</view> </view>
</view> </view>
</view> </view>
@ -151,12 +152,12 @@
<view class="my-bg padding"> <view class="my-bg padding">
<view class=""> <view class="">
<swiper autoplay interval='5000' style="width: 100%;height: 204rpx;" class="swiper" circular> <swiper autoplay interval='5000' style="width: 100%;height: 204rpx;" class="swiper" circular>
<!-- <swiper-item @click="swiperClick(item,index)" v-for="(item,index) in swiperArray"> <swiper-item @click="swiperClick(item,index)" v-for="(item,index) in swiperArray">
<image :src="item.src" style="width: 100%;" mode="widthFix"></image> <image :src="item.src" style="width: 100%;" mode="widthFix"></image>
</swiper-item> -->
<swiper-item>
<ad unit-id="adunit-fae65289bc72095d" ad-intervals="30"></ad>
</swiper-item> </swiper-item>
<!-- <swiper-item>
<ad unit-id="adunit-fae65289bc72095d" ad-intervals="30"></ad>
</swiper-item> -->
</swiper> </swiper>
<!-- <image :src="starUrl+'banner.png'" style="width: 100%;" mode="widthFix"></image> --> <!-- <image :src="starUrl+'banner.png'" style="width: 100%;" mode="widthFix"></image> -->
</view> </view>
@ -204,9 +205,13 @@
// src:this.global.starUrl+'banner.png', // src:this.global.starUrl+'banner.png',
// link:'' // link:''
// }, // },
// {
// src: 'https://xoil-public.oss-cn-beijing.aliyuncs.com/WMP-IMG/banner-2dwk.png',
// link: 'https://tengxun.hkzj168.com/?ChannelId=20220831152210221048473'
// },
{ {
src: 'https://xoil-public.oss-cn-beijing.aliyuncs.com/WMP-IMG/banner-2dwk.png', src:'https://xoil-public.oss-cn-beijing.aliyuncs.com/baichuan_MP/banner_baichuan.png',
link: 'https://tengxun.hkzj168.com/?ChannelId=20220831152210221048473' JumpPage:'/Activity/pages/index/index'
}, },
], ],
listHeight: 160, listHeight: 160,
@ -354,6 +359,7 @@
}, },
methods: { methods: {
toActivity(){},
toManagement() { toManagement() {
const user = uni.getStorageSync('user'); const user = uni.getStorageSync('user');
if (user) { if (user) {
@ -378,10 +384,15 @@
} }
}, },
swiperClick(item, index) { swiperClick(item, index) {
if (!item?.link) return // if (!item?.link) return
// uni.navigateTo({
// url: '/pages/tabbar/home/link?url=' + encodeURIComponent(JSON.stringify(item.link))
// })
if(item?.JumpPage){
uni.navigateTo({ uni.navigateTo({
url: '/pages/tabbar/home/link?url=' + encodeURIComponent(JSON.stringify(item.link)) url: item.JumpPage
}) })
}
}, },
goToPage(url) { goToPage(url) {
if (!url) return; if (!url) return;

@ -4,7 +4,7 @@ import utils from '@/utils/encode'
// const env = process.env.NODE_ENV // const env = process.env.NODE_ENV
const env = 'production'/* */ const env = 'production'/* */
// const env = 'test' // const env = 'test'
const testUrl = 'http://192.168.0.45:38080' const testUrl = 'http://192.168.0.254:38080'
// const productUrl = 'http://121.196.213.68/adminapi' //预生产 // const productUrl = 'http://121.196.213.68/adminapi' //预生产
const productUrl = 'https://www.xingoil.com/adminapi' // 生产,加密 new const productUrl = 'https://www.xingoil.com/adminapi' // 生产,加密 new

Loading…
Cancel
Save