Files
LSM_OIL_SITE/pages/station-info/station-info.vue

179 lines
3.6 KiB
Vue
Raw Normal View History

<template>
2020-09-10 11:59:40 +08:00
<view class="page-content bg-white">
2020-10-14 11:40:08 +08:00
<cu-custom class="bg-main-oil" :isBack="true" bgColor="bg-main-oil">
<block slot="backText">返回</block>
2020-10-14 11:40:08 +08:00
<block slot="content">油站信息</block>
</cu-custom>
2020-09-10 11:59:40 +08:00
<view class="main-money bg-white margin margin-bottom-0 radius">
<view class="cu-card case no-card ">
2020-09-01 10:17:18 +08:00
<view class="cu-item bg-white shadow">
<view class="image">
2020-09-01 10:17:18 +08:00
<image :src="mainURL+'default-station-bg.png'" mode="widthFix"></image>
</view>
2020-09-10 11:59:40 +08:00
<view class="cu-list bg-white position-re move-top">
2020-09-01 10:17:18 +08:00
<view class="cu-item bg-white padding-sm ">
<view class="text-bold color-333 text-xl">
{{site.oilSiteName}}
</view>
<view class="color-999">
{{site.address}}
</view>
2020-09-10 11:59:40 +08:00
<view class="color-333 padding-top-sm padding-bottom-sm text-sm ">
2020-09-01 10:17:18 +08:00
联系方式<text v-if="site.linkMan">{{site.linkMan}}</text>
<text v-else>暂无</text>
2020-09-10 11:59:40 +08:00
<text v-if="site.phone" @tap="makeCall(site.phone)">{{site.phone}}</text>
2020-09-01 10:17:18 +08:00
<text v-else>暂无</text>
</view>
2020-09-10 11:59:40 +08:00
<view class=" position-call text-xxl" @tap="makeCall(site.phone)">
<text class="cuIcon-phone text-red"></text>
</view>
</view>
2020-09-10 11:59:40 +08:00
</view>
</view>
</view>
</view>
2020-09-10 11:59:40 +08:00
<view class="padding-bottom ">
2020-09-01 10:17:18 +08:00
<OilMenuItem :oilItem="item" v-for="(item,index) in oilList" :key="index" />
</view>
2020-10-14 11:40:08 +08:00
<!-- <view class="margin padding">
<view class="">
<button class="bg-main-oil" @tap="loginOut">
退出登录
</button>
</view>
</view> -->
</view>
</template>
<script>
import cloudSiteApi from '@/api/cloud-site.js'
import OilMenuItem from '@/components/oil-menu-item.vue'
export default {
components: {
OilMenuItem
},
data() {
return {
2020-09-01 10:17:18 +08:00
mainURL: this.global.mainURL,
title: 'Hello',
site: {},
cuIconList: [{
cuIcon: 'location',
color: 'red',
badge: 120,
name: '加油信息'
},
{
cuIcon: 'form',
color: 'orange',
badge: 0,
name: '加油订单'
},
{
cuIcon: 'new',
color: 'yellow',
badge: 0,
name: '经营分析'
},
{
cuIcon: 'scan',
color: 'olive',
badge: 0,
name: '扫码加油'
},
{
cuIcon: 'qr_code',
color: 'cyan',
badge: 0,
name: '油站二维码'
},
{
cuIcon: 'expressman',
color: 'red',
badge: 0,
name: '员工管理'
},
],
oilList: []
}
},
onLoad() {
this.getSiteInfo()
2020-09-04 09:20:45 +08:00
uni.showShareMenu()
},
methods: {
2020-10-14 11:40:08 +08:00
loginOut() {
uni.clearStorage()
uni.reLaunch({
url: '/pages/login/boforeLogin/boforeLogin'
})
},
getSiteInfo() {
cloudSiteApi.getSiteDetail().then(res => {
if (res.code === 20000) {
this.site = res.data.site
this.oilList = res.data.oil
uni.setStorage({
2020-09-01 10:17:18 +08:00
key: 'oilSiteName',
data: res.data.site.oilSiteName
})
}
})
2020-09-10 11:59:40 +08:00
},
makeCall(phone) {
if (phone) {
uni.makePhoneCall({
phoneNumber: phone
})
} else {
uni.showToast({
title: '暂无油站联系方式',
2020-10-14 11:40:08 +08:00
icon: 'none'
2020-09-10 11:59:40 +08:00
});
}
}
}
};
</script>
2020-09-01 10:17:18 +08:00
<style scopeds>
2020-10-14 11:40:08 +08:00
.cu-card.case.no-card .image {
margin: 0;
}
.bg-view {
height: 300rpx;
min-width: 100%;
position: absolute;
}
2020-09-01 10:17:18 +08:00
.position-re {}
image {
vertical-align: bottom;
2020-09-10 11:59:40 +08:00
background-color: rgba(113, 11, 233, 0.5)
}
.image {
border-radius: initial;
vertical-align: bottom;
background-color: rgba(11, 11, 251, 0.7)
}
.move-top {
margin-top: -2px;
}
.position-call {
position: absolute;
right: 30upx;
bottom: 30upx;
2020-09-01 10:17:18 +08:00
}
</style>