lilishop-uniapp/pages/mine/set/editionIntro.vue

161 lines
4.0 KiB
Vue
Raw Normal View History

2021-05-13 11:03:32 +08:00
<template>
2021-05-14 17:31:40 +08:00
<view class="edition-intro">
<image :src="config.logo" class="logo" />
<h1> {{config.name}}</h1>
<view class='version'>
<!-- #ifdef APP-PLUS -->
Version {{localVersion.version}}
<!-- #endif -->
2021-05-14 17:31:40 +08:00
</view>
<!-- {{localVersion}} -->
<u-cell-group class="cell" :border="false">
<!-- #ifdef APP-PLUS -->
<u-cell-item v-if="IosWhether" @click="checkStar" title="去评分"></u-cell-item>
<u-cell-item title="功能介绍" @click="navigateTo('/pages/mine/set/versionFunctionList')"></u-cell-item>
<u-cell-item title="检查更新" @click="checkUpdate"></u-cell-item>
<!-- #endif -->
<u-cell-item title="证照信息" @click="navigateTo('/pages/mine/help/tips?type=message')"></u-cell-item>
<u-cell-item title="服务协议" @click="navigateTo('/pages/mine/help/tips?type=user')"></u-cell-item>
<u-cell-item title="隐私协议" @click="navigateTo('/pages/mine/help/tips?type=privacy')"></u-cell-item>
<u-cell-item title="关于我们" :border-bottom="false" @click="navigateTo('/pages/mine/help/tips?type=about')"></u-cell-item>
</u-cell-group>
<view class="intro">
<view>{{config.customerServiceMobile ? `客服热线:${config.customerServiceMobile}` : ``}}</view>
<view style="margin:20rpx 0 0 0;">{{config.customerServiceEmail ? `客服邮箱:${config.customerServiceEmail}` : ``}}</view>
<view>
<view style="margin:20rpx 0; color:#003a8c;" @click="navigateTo('/pages/mine/help/tips?type=user')">{{config.name}}</view>
2022-08-10 18:28:06 +08:00
<view>CopyRight ©{{config.name}} </view>
2021-05-14 17:31:40 +08:00
</view>
</view>
</view>
2021-05-13 11:03:32 +08:00
</template>
<script>
import APPUpdate from "@/plugins/APPUpdate";
import config from "@/config/config";
import { getAppVersion } from "@/api/message.js";
2021-05-14 17:31:40 +08:00
export default {
data() {
return {
config,
IosWhether: false, //是否是ios
2021-05-14 17:31:40 +08:00
editionHistory: [], //版本历史
versionData: {}, //版本信息
localVersion: "", //当前版本信息
2021-05-14 17:31:40 +08:00
params: {
pageNumber: 1,
pageSize: 5,
},
};
},
onLoad() {
// #ifdef APP-PLUS
const platform = uni.getSystemInfoSync().platform;
/**
* 获取是否是安卓
*/
if (platform === "android") {
2021-05-14 17:31:40 +08:00
this.params.type = 0;
} else {
this.IosWhether = true;
2021-05-14 17:31:40 +08:00
this.params.type = 1;
}
this.getVersion(platform);
plus.runtime.getProperty(plus.runtime.appid, (inf) => {
this.localVersion = {
versionCode: inf.version.replace(/\./g, ""),
version: inf.version,
};
});
// #endif
2021-05-14 17:31:40 +08:00
},
2021-05-14 17:31:40 +08:00
methods: {
async getVersion(platform) {
let type;
platform == "android" ? (type = "ANDROID") : (type = "IOS");
let res = await getAppVersion(type);
if (res.data.success) {
this.versionData = res.data.result;
}
},
navigateTo(url) {
uni.navigateTo({
url,
});
},
/**
* ios点击评分
*/
checkStar() {
plus.runtime.launchApplication({
action: `itms-apps://itunes.apple.com/app/${config.iosAppId}?action=write-review`,
2021-05-14 17:31:40 +08:00
});
},
/**
* 检查更新
*/
checkUpdate() {
if (
this.versionData.version.replace(/\./g, "") <
this.localVersion.versionCode
) {
APPUpdate();
} else {
uni.showToast({
title: "当前版本已是最新版",
duration: 2000,
icon: "none",
});
}
},
2021-05-14 17:31:40 +08:00
},
};
2021-05-13 11:03:32 +08:00
</script>
2021-05-14 17:31:40 +08:00
<style lang="scss" scoped>
page {
background: #fff !important;
}
.cell {
width: 90%;
margin: 0 auto;
}
2021-05-14 17:31:40 +08:00
.edition-intro {
min-height: 100vh;
background: #fff;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
> h1 {
margin: 20rpx 0 20rpx 0;
letter-spacing: 2rpx;
2021-05-14 17:31:40 +08:00
}
> .version {
font-size: 30rpx;
margin-bottom: 100rpx;
2021-05-14 17:31:40 +08:00
}
2021-05-13 11:03:32 +08:00
}
.intro {
margin-top: 100rpx;
font-size: 24rpx;
letter-spacing: 2rpx;
}
.logo {
width: 200rpx;
height: 200rpx;
}
2021-05-13 11:03:32 +08:00
</style>