feat: 平台兼容性调整

This commit is contained in:
admin 2024-09-14 16:08:23 +08:00
parent 35735c1d80
commit fc1a36ef3b
10 changed files with 309 additions and 263 deletions

View File

@ -3,7 +3,23 @@ import { onLaunch, onShow, onHide } from "@dcloudio/uni-app";
onLaunch(() => {
//tabBar
// uni.hideTabBar();
// #ifdef MP-ALIPAY
my.hideTabBar({
animation: false, // alipay 1.95.0
success: (res) => {
//
console.log("TabBar has been hidden", res);
},
fail: (err) => {
//
console.error("Failed to hide TabBar", err);
},
});
// #endif
// #ifndef MP-ALIPAY
uni.hideTabBar();
// #endif
});
onShow(() => {
console.log("App Show");

View File

@ -74,8 +74,7 @@ const handleClick = (item: tabBar) => {
};
onLaunch(() => {
//tabBar
uni.hideTabBar();
});
</script>

View File

@ -86,7 +86,8 @@
"lazyCodeLoading" : "requiredComponents"
},
"mp-alipay" : {
"usingComponents" : true
"usingComponents" : true,
"styleIsolation":"apply-shared"
},
"mp-baidu" : {
"usingComponents" : true

View File

@ -113,11 +113,11 @@
"list": [
{
"pagePath": "pagesHome/index",
"text": "工作台"
"text": ""
},
{
"pagePath": "pagesHome/profile",
"text": "我的"
"text": ""
}
]
},

View File

@ -2,87 +2,92 @@
<!-- 轮播图 -->
<CustomSwiper :list="bannerList"> </CustomSwiper>
<!-- 入口 -->
<uni-card
class="entry-card"
:shadow="'0rpx 0rpx 10rpx 0rpx rgba(5,68,37,0.12)'"
:padding="'20px 10px'"
:border="false"
>
<view class="item">
<view
v-for="(item, index) in entryItemList"
:key="index"
@click="handleClick(item)"
class="item"
>
<view>
<view class="text">{{ item.name }}</view>
<view class="desc">{{ item.desc }}</view>
<image :src="`${url}/static/img/battery/${item.path}`"></image>
</view>
</view>
</view>
</uni-card>
<!-- 介绍 -->
<uni-card
class="avatar-card"
:shadow="'0rpx 0rpx 10rpx 0rpx rgba(5,68,37,0.12)'"
:padding="'20px 10px'"
:border="false"
>
<view class="title">回收流程</view>
<view class="flow">
<text class="text">在线登记</text>
<image :src="`${url}/static/img/battery/arrow.png`"></image>
<text class="text">免费上门</text>
<image :src="`${url}/static/img/battery/arrow.png`"></image>
<text class="text">结算打款</text>
<image :src="`${url}/static/img/battery/arrow.png`"></image>
<text class="text">订单完成</text>
</view>
<up-gap height="10" bgColor="#F8F8F8"></up-gap>
<view class="title mt-20">回收物品</view>
<uni-grid :column="2" :showBorder="false" :square="false">
<uni-grid-item
class="item"
v-for="(item, index) in serviceItemList"
:key="index"
>
<uni-card
:shadow="'0rpx 0rpx 10rpx 0rpx rgba(5,68,37,0.12)'"
:padding="'0px'"
:margin="'5px'"
:border="false"
<view class="entry-card">
<uni-card
:shadow="'0rpx 0rpx 10rpx 0rpx rgba(5,68,37,0.12)'"
:padding="'20px 10px'"
:border="false"
>
<view class="item">
<view
v-for="(item, index) in entryItemList"
:key="index"
@click="handleClick(item)"
class="item"
>
<view style="background-color: #e8edff">
<image
mode="aspectFill"
:src="`${url}/static/img/vehicle/${item.path}`"
></image>
<view>
<view class="text">{{ item.name }}</view>
<view class="desc">{{ item.desc }}</view>
<image :src="`${url}/static/img/battery/${item.path}`"></image>
</view>
<view class="text-box">
<text class="text">{{ item.name }}</text>
</view>
</uni-card>
</uni-grid-item>
</uni-grid>
<!-- 常见问题 -->
<view class="title mt-20 mb-20">常见问题</view>
<view class="commonQ">
<view v-for="(item, index) in questionList" :key="index">
<view class="question">{{ item.q }}</view>
<view class="answer">
<view v-html="item.a"></view>
</view>
</view>
</view>
</uni-card>
</view>
<view class="other">
<view>其他问题请咨询客服电话</view>
<view><text @click="callNumber('15150231777')" class="active">15150231777&nbsp;&nbsp;欢迎咨询</text></view>
</view>
</uni-card>
<!-- 介绍 -->
<view class="avatar-card">
<uni-card
:shadow="'0rpx 0rpx 10rpx 0rpx rgba(5,68,37,0.12)'"
:padding="'20px 10px'"
:border="false"
>
<view class="title">回收流程</view>
<view class="flow">
<text class="text">在线登记</text>
<image :src="`${url}/static/img/battery/arrow.png`"></image>
<text class="text">免费上门</text>
<image :src="`${url}/static/img/battery/arrow.png`"></image>
<text class="text">结算打款</text>
<image :src="`${url}/static/img/battery/arrow.png`"></image>
<text class="text">订单完成</text>
</view>
<up-gap height="10" bgColor="#F8F8F8"></up-gap>
<view class="title mt-20">回收物品</view>
<uni-grid :column="2" :showBorder="false" :square="false">
<uni-grid-item v-for="(item, index) in serviceItemList" :key="index">
<view class="item">
<uni-card
:shadow="'0rpx 0rpx 10rpx 0rpx rgba(5,68,37,0.12)'"
:padding="'0px'"
:margin="'5px'"
:border="false"
>
<view style="background-color: #e8edff">
<image
mode="aspectFill"
:src="`${url}/static/img/vehicle/${item.path}`"
></image>
</view>
<view class="text-box">
<text class="text">{{ item.name }}</text>
</view>
</uni-card>
</view>
</uni-grid-item>
</uni-grid>
<!-- 常见问题 -->
<view class="title mt-20 mb-20">常见问题</view>
<view class="commonQ">
<view v-for="(item, index) in questionList" :key="index">
<view class="question">{{ item.q }}</view>
<view class="answer">
<view v-html="item.a"></view>
</view>
</view>
</view>
<view class="other">
<view>其他问题请咨询客服电话</view>
<view
><text @click="callNumber('15150231777')" class="active"
>15150231777&nbsp;&nbsp;欢迎咨询</text
></view
>
</view>
</uni-card>
</view>
</template>
<script setup lang="ts">
@ -181,7 +186,7 @@ const handleClick = (item: any) => {
});
};
const callNumber = (number) => {
const callNumber = (number:any) => {
//
if (
uni.getSystemInfoSync().platform === "android" ||

View File

@ -3,63 +3,64 @@
<!-- 轮播图 -->
<CustomSwiper> </CustomSwiper>
<!-- 入口 -->
<uni-card
class="entry-card"
:shadow="'0rpx 0rpx 10rpx 0rpx rgba(5,68,37,0.12)'"
:padding="'20px 10px'"
:border="false"
>
<uni-grid :column="3" :showBorder="false" :square="false">
<uni-grid-item
class="item"
v-for="(item, index) in entryItemList"
:key="index"
>
<view @click="handleClick(item)">
<view>
<image :src="`${url}/static/img/${item.path}`"></image>
<view class="entry-card">
<uni-card
:shadow="'0rpx 0rpx 10rpx 0rpx rgba(5,68,37,0.12)'"
:padding="'20px 10px'"
:border="false"
>
<uni-grid :column="3" :showBorder="false" :square="false">
<uni-grid-item v-for="(item, index) in entryItemList" :key="index">
<view class="item">
<view @click="handleClick(item)">
<view>
<image :src="`${url}/static/img/${item.path}`"></image>
</view>
<view>
<text class="text">{{ item.name }}</text>
</view>
</view>
</view>
<view>
<text class="text">{{ item.name }}</text>
</view>
</view>
</uni-grid-item>
</uni-grid>
</uni-card>
</uni-grid-item>
</uni-grid>
</uni-card>
</view>
<!-- 介绍 -->
<uni-card
class="avatar-card"
:shadow="'0rpx 0rpx 10rpx 0rpx rgba(5,68,37,0.12)'"
:padding="'10px 10px'"
:border="false"
>
<view class="title">爱梵达</view>
<image
:src="`/static/avatar/1.jpg`"
:mode="'widthFix'"
style="width: 100%"
/>
<image
:src="`/static/avatar/2.jpg`"
:mode="'widthFix'"
style="width: 100%"
/>
<image
:src="`/static/avatar/3.jpg`"
:mode="'widthFix'"
style="width: 100%"
/>
<image
:src="`/static/avatar/4.jpg`"
:mode="'widthFix'"
style="width: 100%"
/>
<image
:src="`/static/avatar/5.jpg`"
:mode="'widthFix'"
style="width: 100%"
/>
</uni-card>
<view class="avatar-card">
<uni-card
:shadow="'0rpx 0rpx 10rpx 0rpx rgba(5,68,37,0.12)'"
:padding="'10px 10px'"
:border="false"
>
<view class="title">爱梵达</view>
<image
:src="`/static/avatar/1.jpg`"
:mode="'widthFix'"
style="width: 100%"
/>
<image
:src="`/static/avatar/2.jpg`"
:mode="'widthFix'"
style="width: 100%"
/>
<image
:src="`/static/avatar/3.jpg`"
:mode="'widthFix'"
style="width: 100%"
/>
<image
:src="`/static/avatar/4.jpg`"
:mode="'widthFix'"
style="width: 100%"
/>
<image
:src="`/static/avatar/5.jpg`"
:mode="'widthFix'"
style="width: 100%"
/>
</uni-card>
</view>
</Layout>
</template>
@ -136,7 +137,7 @@ const handleClick = (item: any) => {
padding: 0px !important;
}
image + image {
margin-top: -12rpx;
margin-top: -14rpx;
}
}
</style>

View File

@ -95,6 +95,24 @@ const openDoc = (item: string) => {
});
};
//tabBar
// #ifdef MP-ALIPAY
my.hideTabBar({
animation: false, // alipay 1.95.0
success: (res) => {
//
console.log("TabBar has been hidden", res);
},
fail: (err) => {
//
console.error("Failed to hide TabBar", err);
},
});
// #endif
// #ifndef MP-ALIPAY
uni.hideTabBar();
// #endif
</script>
<style lang="scss" scoped>

View File

@ -2,64 +2,68 @@
<!-- 轮播图 -->
<CustomSwiper :list="bannerList"> </CustomSwiper>
<!-- 介绍 -->
<uni-card
class="avatar-card"
:shadow="'0rpx 0rpx 10rpx 0rpx rgba(5,68,37,0.12)'"
:padding="'20px 10px'"
:border="false"
>
<view class="title">优质货场</view>
<view class="freight">
<view v-for="(item, index) in list" :key="index">
<view>
<image
mode="aspectFill"
:src="`${url}/static/img/steel/${item.path}`"
></image>
</view>
<view class="text">
<view>主营业务{{ item.business }}</view>
<view>货场名称{{ item.name }}</view>
<view>货场地址{{ item.address }}</view>
<view
>联系电话{{item.owner}} &nbsp;&nbsp;<text @click="callNumber(item.phone)" class="active">{{ item.phone }} &nbsp;&nbsp;欢迎询价</text></view
>
</view>
</view>
</view>
<view style="margin: 60rpx 0rpx 30rpx 0rpx">
<up-gap height="10" bgColor="#F8F8F8"></up-gap>
</view>
<view class="title">合作案例</view>
<view class="mt-30 mb-30">
<uni-grid :column="2" :showBorder="false" :square="false">
<uni-grid-item
class="item"
v-for="(item, index) in serviceItemList"
:key="index"
>
<view class="avatar-card">
<uni-card
:shadow="'0rpx 0rpx 10rpx 0rpx rgba(5,68,37,0.12)'"
:padding="'20px 10px'"
:border="false"
>
<view class="title">优质货场</view>
<view class="freight">
<view v-for="(item, index) in list" :key="index">
<view>
<image
mode="aspectFill"
:src="`${url}/static/img/steel/${item.path}`"
></image>
</view>
</uni-grid-item>
<view class="mt-30 mb-30" style="width: 60%">
<view
><u-button type="primary" shape="circle" @click="handleJoin"
>加入爱梵达</u-button
></view
>
<view class="text">
<view>主营业务{{ item.business }}</view>
<view>货场名称{{ item.name }}</view>
<view>货场地址{{ item.address }}</view>
<view
>联系电话{{ item.owner }} &nbsp;&nbsp;<text
@click="callNumber(item.phone)"
class="active"
>{{ item.phone }} &nbsp;&nbsp;欢迎询价</text
></view
>
</view>
</view>
<view class="mt-30 mb-30">爱梵达智能过磅系统提升您的经营效率</view>
</uni-grid>
</view>
</uni-card>
</view>
<view style="margin: 60rpx 0rpx 30rpx 0rpx">
<up-gap height="10" bgColor="#F8F8F8"></up-gap>
</view>
<view class="title">合作案例</view>
<view class="mt-30 mb-30">
<uni-grid :column="2" :showBorder="false" :square="false">
<uni-grid-item
class="item"
v-for="(item, index) in serviceItemList"
:key="index"
>
<view>
<image
mode="aspectFill"
:src="`${url}/static/img/steel/${item.path}`"
></image>
</view>
</uni-grid-item>
<view class="mt-30 mb-30" style="width: 60%">
<view
><u-button type="primary" shape="circle" @click="handleJoin"
>加入爱梵达</u-button
></view
>
</view>
<view class="mt-30 mb-30">爱梵达智能过磅系统提升您的经营效率</view>
</uni-grid>
</view>
</uni-card>
</view>
</template>
<script setup lang="ts">
@ -79,7 +83,7 @@ const list = ref([
"长期回收废钢(轻一、轻二、轻三、重废、钢板料等)、废纸、泡沫、塑料等,量大价优,欢迎来电咨询。",
name: "在生万有-中悦犇站",
address: "上海市奉贤区川南奉公路8598号",
owner: '刘先生',
owner: "刘先生",
phone: "13651779998",
},
{
@ -88,7 +92,7 @@ const list = ref([
"长期回收重废、中废、轻废、小废、岩棉板、花盒等,量大价优,欢迎来电咨询。",
name: "上海宽钢公司",
address: "上海市宝山区兰岗路2号门",
owner: '李女士',
owner: "李女士",
phone: "13601647155",
},
]);
@ -122,13 +126,14 @@ const handleJoin = () => {
});
};
const callNumber = (number) => {
const callNumber = (number:any) => {
//
if (
uni.getSystemInfoSync().platform === "android" ||
uni.getSystemInfoSync().platform === "ios"
) {
// 使
// my.makePhoneCall({ number: '1111111' });
uni.makePhoneCall({
phoneNumber: number, //
success: function () {

View File

@ -2,76 +2,82 @@
<!-- 轮播图 -->
<CustomSwiper :list="bannerList"> </CustomSwiper>
<!-- 入口 -->
<uni-card
class="entry-card"
:shadow="'0rpx 0rpx 10rpx 0rpx rgba(5,68,37,0.12)'"
:padding="'20px 10px'"
:border="false"
>
<uni-grid :column="4" :showBorder="false" :square="false">
<uni-grid-item
class="item"
v-for="(item, index) in entryItemList"
:key="index"
>
<view @click="handleClick(item)">
<view>
<image :src="`${url}/static/img/vehicle/${item.path}`"></image>
<view class="entry-card">
<uni-card
:shadow="'0rpx 0rpx 10rpx 0rpx rgba(5,68,37,0.12)'"
:padding="'20px 10px'"
:border="false"
>
<uni-grid :column="4" :showBorder="false" :square="false">
<uni-grid-item v-for="(item, index) in entryItemList" :key="index">
<view class="item">
<view @click="handleClick(item)">
<view>
<image :src="`${url}/static/img/vehicle/${item.path}`"></image>
</view>
<view>
<text class="text">{{ item.name }}</text>
</view>
</view>
</view>
<view>
<text class="text">{{ item.name }}</text>
</view>
</view>
</uni-grid-item>
</uni-grid>
</uni-card>
</uni-grid-item>
</uni-grid>
</uni-card>
</view>
<!-- 介绍 -->
<uni-card
class="avatar-card"
:shadow="'0rpx 0rpx 10rpx 0rpx rgba(5,68,37,0.12)'"
:padding="'20px 10px'"
:border="false"
>
<view class="title">服务项目</view>
<uni-grid :column="2" :showBorder="false" :square="false">
<uni-grid-item
class="item"
v-for="(item, index) in serviceItemList"
:key="index"
>
<uni-card
:shadow="'0rpx 0rpx 10rpx 0rpx rgba(5,68,37,0.12)'"
:padding="'0px'"
:margin="'5px'"
:border="false"
<view class="avatar-card">
<uni-card
:shadow="'0rpx 0rpx 10rpx 0rpx rgba(5,68,37,0.12)'"
:padding="'20px 10px'"
:border="false"
>
<view class="title">服务项目</view>
<uni-grid :column="2" :showBorder="false" :square="false">
<uni-grid-item
class="item"
v-for="(item, index) in serviceItemList"
:key="index"
>
<view style="background-color: #e8edff">
<image
mode="aspectFill"
:src="`${url}/static/img/vehicle/${item.path}`"
></image>
<view class="item">
<uni-card
:shadow="'0rpx 0rpx 10rpx 0rpx rgba(5,68,37,0.12)'"
:padding="'0px'"
:margin="'5px'"
:border="false"
>
<view style="background-color: #e8edff">
<image
mode="aspectFill"
:src="`${url}/static/img/vehicle/${item.path}`"
></image>
</view>
<view class="text-box">
<text class="text">{{ item.name }}</text>
</view>
</uni-card>
</view>
<view class="text-box">
<text class="text">{{ item.name }}</text>
</view>
</uni-card>
</uni-grid-item>
</uni-grid>
</uni-grid-item>
</uni-grid>
<!-- 常见问题 -->
<view class="title mt-20 mb-20">常见问题</view>
<view class="commonQ">
<view v-for="(item, index) in questionList" :key="index">
<view class="question">{{ item.q }}</view>
<view class="answer">{{ item.a }}</view>
<!-- 常见问题 -->
<view class="title mt-20 mb-20">常见问题</view>
<view class="commonQ">
<view v-for="(item, index) in questionList" :key="index">
<view class="question">{{ item.q }}</view>
<view class="answer">{{ item.a }}</view>
</view>
</view>
</view>
<view class="other">
<view>其他问题请咨询客服电话</view>
<view><text @click="callNumber('15150231777')" class="active">15150231777 &nbsp;&nbsp;欢迎咨询</text></view>
</view>
</uni-card>
<view class="other">
<view>其他问题请咨询客服电话</view>
<view
><text @click="callNumber('15150231777')" class="active"
>15150231777 &nbsp;&nbsp;欢迎咨询</text
></view
>
</view>
</uni-card>
</view>
</template>
<script setup lang="ts">
@ -177,7 +183,7 @@ const handleClick = (item: any) => {
});
};
const callNumber = (number) => {
const callNumber = (number: any) => {
//
if (
uni.getSystemInfoSync().platform === "android" ||

View File

@ -98,9 +98,4 @@ body {
.active {
color: $u-primary;
}
}
// #ifdef H5
.bottom {
padding-bottom: 30rpx !important;
}
// #endif
}