Merge pull request '1' (#7) from xiaozy_二维码 into master

Reviewed-on: #7
pull/9/head
曹连存 1 year ago
commit 1abc07930f
  1. 122
      Activity/pages/index/index.vue
  2. 7
      api/oil-site.js
  3. 2
      manifest.json
  4. 16
      pages.json
  5. 109
      pages/tabbar/home/home.vue
  6. 6
      utils/request.js

@ -0,0 +1,122 @@
<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: '',
...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: '',
clientBelong:'ZHONGPIN'
}
},
siteList: []
}
},
created() {
this.init()
},
methods: {
toDetail(item){
let itemS = encodeURIComponent(JSON.stringify(item))
// console.log(uni.getStorageSync('user'))
// return
if (uni.getStorageSync('user')) {
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: 30rpx;
}
.Activity_body {
width: 100vw;
height: 100vh;
overflow: hidden;
}
</style>

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

@ -1,6 +1,6 @@
{
"name" : "XiaoXing",
"appid" : "__UNI__EA8D131",
"appid" : "__UNI__113D280",
"description" : "",
"versionName" : "1.0.0",
"versionCode" : "100",

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

@ -15,9 +15,10 @@
</view>
<view class="search-form radius" @tap="InputFocus">
<text class="cuIcon-search"></text>
<input disabled :adjust-position="false" type="text" placeholder="搜索油站名称" confirm-type="search" />
<input disabled :adjust-position="false" type="text" placeholder="搜索油站名称"
confirm-type="search" />
</view>
<!-- <view class="">
<!-- <view class="">
阿三
</view> -->
</view>
@ -108,16 +109,16 @@
</view>
<!-- 广告图片开始 -->
<view class="my-bg padding">
<view class="" >
<!-- <swiper autoplay interval='5000' style="width: 100%;height: 204rpx;" class="swiper" circular >
<view class="">
<swiper autoplay interval='5000' style="width: 100%;height: 204rpx;" class="swiper" circular >
<swiper-item @click="swiperClick(item,index)" v-for="(item,index) in swiperArray">
<image :src="item.src" style="width: 100%;" mode="widthFix"></image>
</swiper-item>
<swiper-item>
<!-- <swiper-item>
<ad unit-id="adunit-fae65289bc72095d" ad-intervals="30"></ad>
</swiper-item>
</swiper> -->
<image :src="starUrl+'banner.png'" style="width: 100%;" mode="widthFix"></image>
</swiper-item> -->
</swiper>
<!-- <image :src="starUrl+'banner.png'" style="width: 100%;" mode="widthFix"></image> -->
</view>
</view>
<!-- 筛选开始 -->
@ -127,8 +128,8 @@
</view> -->
<view class=" ">
<view class="" v-if="siteList.length>0">
<site-item v-for="(item,index) in siteList" :key="item.id" :site-item="item" :first="index==0" :listHeight="listHeight"
class="cu-list menu-avatar cu-item" @tap="toDetail(item)">
<site-item v-for="(item,index) in siteList" :key="item.id" :site-item="item" :first="index==0"
:listHeight="listHeight" class="cu-list menu-avatar cu-item" @tap="toDetail(item)">
</site-item>
</view>
<view class="" v-else>
@ -158,17 +159,21 @@
},
data() {
return {
swiperArray:[
swiperArray: [
// {
// src:this.global.starUrl+'banner.png',
// 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/baichuan_MP/banner_baichuan.png',
JumpPage: '/Activity/pages/index/index'
},
// {
// src: 'https://xoil-public.oss-cn-beijing.aliyuncs.com/WMP-IMG/banner-2dwk.png',
// link: 'https://tengxun.hkzj168.com/?ChannelId=20220831152210221048473'
// },
],
listHeight:160,
listHeight: 160,
siteInfo: {
},
@ -285,13 +290,13 @@
]
};
},
onTabItemTap(res){
this.showThreeSites =false
onTabItemTap(res) {
this.showThreeSites = false
},
onLoad() {
this.reverseGeocoder(this.location)
this.refreshLocation()
// if (!uni.getStorageSync('filterData')) {
// this.getFilterData()
// }
@ -329,38 +334,45 @@
},
methods: {
toManagement(){
toManagement() {
const user = uni.getStorageSync('user');
if(user){
Financial.findHomePageReport({customerId:user.id}).then(res=>{
if(res.data){
if (user) {
Financial.findHomePageReport({
customerId: user.id
}).then(res => {
if (res.data) {
uni.navigateTo({
url:`../../../Financial/pages/estimate/index?data=${encodeURIComponent(JSON.stringify(res.data))}`
url: `../../../Financial/pages/estimate/index?data=${encodeURIComponent(JSON.stringify(res.data))}`
})
}else{
} else {
uni.navigateTo({
url:'../../../Financial/pages/index?guide=1'
url: '../../../Financial/pages/index?guide=1'
})
}
});
}else{
} else {
uni.showToast({
title: '请先登录!',
icon: 'none'
})
}
},
swiperClick(item,index) {
if(!item?.link) return
switch (Number(index)) {
// case 0:
// this.goCall()
// break;
default:
console.log('item.link')
uni.navigateTo({
url: '/pages/tabbar/home/link?url=' + encodeURIComponent(JSON.stringify(item.link))
})
swiperClick(item, index) {
// if (!item?.link) return
// switch (Number(index)) {
// // case 0:
// // this.goCall()
// // break;
// default:
// console.log('item.link')
// uni.navigateTo({
// url: '/pages/tabbar/home/link?url=' + encodeURIComponent(JSON.stringify(item.link))
// })
// }
if(item?.JumpPage){
uni.navigateTo({
url: item.JumpPage
})
}
},
goToPage(url) {
@ -447,10 +459,11 @@
// url: 'plugin://routePlan/index?key=' + this.qqMapKey + '&referer=' + referer +
// '&endPoint=' + endPoint
// })
uni.removeStorageSync("origins")
uni.removeStorageSync("destination")
uni.removeStorageSync("origins")
uni.removeStorageSync("destination")
wx.navigateTo({
url:'../../../BagStation/pages/routePlain/routePlain'})
url: '../../../BagStation/pages/routePlain/routePlain'
})
} else if (index == 8) {
this.goToPage('/BagAuth/pages/agreeMent/OperationGuide')
}
@ -498,9 +511,9 @@
// siteBrand: "", // // ( 1- 2- 3- 4- 5- 6- 7- 8- )
// channelCode: "", // // ( OIL WJY LV TY YDJY)
// oilProductCode: "0#" // // ( 0# 92# 92#)
clientBelong:'ZHONGPIN',
comprehensiveSort:1,
zpDisable:'ENABLE',
clientBelong: 'ZHONGPIN',
comprehensiveSort: 1,
zpDisable: 'ENABLE',
sort: "juli", //String // ( price juli )
...uni.getStorageSync('location'),
...this.filterData,
@ -566,13 +579,13 @@
})
} else {
uni.showModal({
title:'请您登录',
content:"登录小星加油才可以加油 |˛˙꒳˙)♡",
confirmText:'去登陆',
title: '请您登录',
content: "登录小星加油才可以加油 |˛˙꒳˙)♡",
confirmText: '去登陆',
success: (res) => {
if(res.confirm){
if (res.confirm) {
uni.reLaunch({
url:'../../../BagAuth/pages/login/login'
url: '../../../BagAuth/pages/login/login'
})
}
}
@ -789,4 +802,4 @@
.my-icon-sm .text-sm {
line-height: 1rem;
}
</style>
</style>

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

Loading…
Cancel
Save