This commit is contained in:
caolc
2023-07-05 18:19:02 +08:00
parent e883da3fff
commit cf253870a3
17 changed files with 861 additions and 343 deletions

View File

@@ -132,7 +132,7 @@
</view>
</view>
<!-- 广告图片开始 -->
<!-- <view class=" padding" style=" background-color: #f1f1f1;">
<view class=" padding" style=" background-color: #f1f1f1;">
<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" :key='index'>
@@ -140,7 +140,7 @@
</swiper-item>
</swiper>
</view>
</view> -->
</view>
<!-- 筛选开始 -->
<view class="screentop bg-white " @tap="scrollScreen">
<!-- <view class="">
@@ -163,6 +163,7 @@
</template>
<script>
import SwitchEnterprises from '@/components/SwitchEnterprises.vue'
import msgModels from '../../components/showModels.vue'
import accountApi from '@/api/account.js'
import Financial from '@/api/Financial.js'
@@ -174,7 +175,8 @@
components: {
siteItem,
threeSites,
msgModels
msgModels,
SwitchEnterprises
// slFilter
},
data() {
@@ -184,13 +186,17 @@
// src: 'https://xoil-public.oss-cn-beijing.aliyuncs.com/WMP-IMG/banner-2etc.png',
// // link: 'https://h5.51etr.com/pro/onlineApply/?type=20220831103626200101811'
// },
// {
// src: 'https://xoil-public.oss-cn-beijing.aliyuncs.com/WMP-IMG/banner-2dwk.png',
// link: 'https://tengxun.hkzj168.com/?ChannelId=20220831152210221048473'
// }, Activity
// {
// src:'https://xoil-public.oss-cn-beijing.aliyuncs.com/baichuan_MP/bannerindexs.png',
// JumpPage:'Financial'
// },
{
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/bannerindexs.png',
JumpPage:'Financial'
src:'https://xoil-public.oss-cn-beijing.aliyuncs.com/baichuan_MP/banner_baichuan.png',
JumpPage:'Activity'
},
],
@@ -317,6 +323,11 @@
]
};
},
watch:{
showAuthFrror(n,o){
console.log(n,o,'=================')
}
},
created() {},
onReady() {
let _that = this
@@ -417,7 +428,8 @@
// url:'/BagStation/pages/makeOrder/payResult?status=success'
this.getSiteList();
},
mounted() {},
mounted() {
},
beforeCreate() {},
onReady() {
// this.getSiteList()
@@ -429,6 +441,12 @@
case "Financial":
this.shadoumeiyou(6)
break;
case "Activity":
uni.navigateTo({
url:'/Activity/pages/index/index'
})
console.log('Activity')
break;
}
}else if(item?.link){
switch (Number(index)) {
@@ -547,7 +565,7 @@
true
}
}
})
})
},
goCall() {
uni.makePhoneCall({

View File

@@ -32,15 +32,17 @@
</view>
</view>
</view>
<view class="xu-content margin">
<view style="position: relative;" class="xu-content margin">
<view @click="isSwitchEnterprises=true" class="switch">切换企业</view>
<view class="bg-white self-card person-card radius my-shadow" v-if="isCompany">
<view class="flex solid-bottom padding-xs justify-between company-vip">
<view class="radius padding-xs text-xs">
<view style="display: flex;" class="radius padding-xs text-xs">
<!-- <text class="icon-company cuIcon-crownfill padding-right-xs"></text> -->
<my-icon iconName="wd-qy-hy.png" class="padding-right-xs"></my-icon>
<text class="icon-company text-xs">企业会员</text>
<!-- <my-icon iconName="wd-qy-hy.png" class="padding-right-xs"></my-icon> -->
<text class="icon-company text-xs">{{companyCard.name}}</text>
<view :class="company_tag===1?'company_tag company_tag_SelfOperated':'company_tag company_tag_externalOperated'">{{companyCard.companyNature===1?'自营':'外请'}}</view>
</view>
</view>
<view class="padding-sm margin-bottom" @tap="toCards">
<view class="color-666 text-sm">
@@ -53,11 +55,11 @@
钱包余额
</view>
</view>
<view class="text-center">
<text class="text-sm">您一共有
<text
class="oil-main-color padding-left-xs padding-right-xs">{{cardSum.length}}</text>
class="oil-main-color padding-left-xs padding-right-xs">{{userTotal.oilCardNumber}}</text>
张油卡</text>
</view>
</view>
@@ -110,11 +112,11 @@
</view>
<view class="action">
<!-- <button class="cu-btn oil-main-btn-color" open-type="contact" @contact="onContact"> -->
<!-- <text class="text-grey text-sm">打开会话</text> -->
<!-- <text class="text-grey text-sm">打开会话</text> -->
<!-- </button> -->
<view class="cu-btn oil-main-btn-color" @click="makeCall">
<text class="text-grey text-sm">联系客服</text>
</view>
</view>
</view>
</view>
@@ -126,22 +128,29 @@
</view>
</view>
</view>
<SwitchEnterprises @submit='upadteCompanyCard' @logout='logout' :is-show.sync="isSwitchEnterprises"></SwitchEnterprises>
</view>
</template>
<script>
import oilSiteApi from '@/api/oil-site.js'
import SwitchEnterprises from '@/components/SwitchEnterprises.vue'
import accountApi from '@/api/account.js'
export default {
components: {
SwitchEnterprises
},
props: {
},
data() {
return {
showCard:[],
hideCard:[],
cardSum:[],
companyCard: null,
isSwitchEnterprises: false,
showCard: [],
hideCard: [],
cardSum: [],
yellowURL: this.global.yellowURL,
imgURL: this.global.imgURL,
starUrl: this.global.starUrl,
@@ -152,10 +161,20 @@
};
},
onShow() {
this.getAuthInfo()
this.getAmount()
this.getAmount();
this.upadteCompanyCard()
},
methods: {
logout(){
this.isSwitchEnterprises = false
},
upadteCompanyCard() {
if (uni.getStorageSync('companyCard')) {
this.companyCard = JSON.parse(uni.getStorageSync('companyCard'))
}
},
goToPage(url) {
if (!url) return;
uni.navigateTo({
@@ -185,41 +204,41 @@
}
})
},
onTapUserInfo(){
if(uni.getStorageSync('user')){
onTapUserInfo() {
if (uni.getStorageSync('user')) {
this.routerTo('/BagSetup/setup/setup')
}else{
} else {
uni.reLaunch({
url:'../../../BagAuth/pages/login/login'
url: '../../../BagAuth/pages/login/login'
})
}
},
toCards() {
if(Number(this.userTotal.oilCardNumber)<=0) return
if (Number(this.userTotal.oilCardNumber) <= 0) return
uni.navigateTo({
url: '/BagMoney/pages/oilCards/oilCards'
url: '/BagMoney/pages/oilCards/oilCards'
})
},
async getAmount() {
await accountApi.getTotalOilCardInfo().then(res => {
console.log(1)
async getAmount() {
await accountApi.getTotalOilCardInfo().then(res => {
console.log(1)
if (res.code == 20000) {
this.userTotal = res.data
}
})
await accountApi.getUserAccount().then(res => {
console.log(2)
await accountApi.getUserAccount().then(res => {
console.log(2)
this.showCard = []
res.data.forEach(item=>{
res.data.forEach(item => {
this.showCard.push(item.companyId)
})
})
await accountApi.getSyncDeductions().then(res => {
console.log(3)
await accountApi.getSyncDeductions().then(res => {
console.log(3)
if (res.code == 20000) {
this.cardSum = this.showCard.filter(item=>!res.data.companyIds.includes(item))
this.cardSum = this.showCard.filter(item => !res.data.companyIds.includes(item))
}
})
},
@@ -286,6 +305,46 @@
</script>
<style scoped>
.company_tag_externalOperated {
background: #FDDBDB;
color: #FE0505;
}
.company_tag_SelfOperated {
background: #FDE9DB;
color: #FF6700;
}
.company_tag {
width: 62rpx;
font-size: 22rpx;
height: 30rpx;
border-radius: 10rpx 3rpx 10rpx 3rpx;
opacity: 1;
margin-left: 20rpx;
display: flex;
justify-content: center;
align-items: center;
}
.switch {
width: 143rpx;
font-size: 24rpx;
padding: 15rpx 0;
color: #FFFFFF;
background: linear-gradient(90deg, rgba(255, 110, 11, 0.85) 0%, #FFBA8B 100%);
box-shadow: 0rpx 2rpx 7rpx 2rpx rgba(191, 191, 191, 0.2);
border-radius: 40rpx 0rpx 0rpx 40rpx;
opacity: 1;
position: absolute;
z-index: 1;
right: 0;
top: 50%;
display: flex;
justify-content: center;
align-items: center;
}
.content {
height: 100%;
}
@@ -365,4 +424,4 @@
.cu-avatar {
background-color: transparent !important;
}
</style>
</style>