关于我们增加版本更新

master
gongfuxiang 2024-06-12 14:51:46 +08:00
parent cac5f25dfe
commit 5df36782df
2 changed files with 79 additions and 23 deletions

View File

@ -7,7 +7,7 @@
<view class="padding-top-xs padding-left-xl padding-right-xl padding-bottom-xl">
<view class="text-size-xl fw-b tc pa name">{{update_data.name}}</view>
<view class="text-size tc pa version">v{{update_data.version_new}}</view>
<scroll-view :scroll-y="true" class="content">
<scroll-view :scroll-y="true" class="content tl">
<block v-for="(item, index) in update_data.content" :key="index">
<view class="margin-bottom-sm text-size-xs">{{item}}</view>
</block>
@ -21,16 +21,28 @@
</view>
<!-- 评分 -->
<view v-if="is_star_status && (star_url || null) != null" class="star-container pf left-0 top-0 wh-auto ht-auto tc">
<view v-if="is_star_status && (star_url || null) != null && (star_alert_images || null) != null" class="star-container pf left-0 top-0 wh-auto ht-auto tc">
<view class="star-content">
<image :src="star_alert_images" mode="widthFix" class="star-alert-images wh-auto" @tap="star_event"></image>
<image :src="star_alert_images" mode="widthFix" class="star-alert-images wh-auto" @tap="to_star_event"></image>
</view>
<view class="padding-sm margin-top-xl">
<view class="dis-inline-block" data-value="close" @tap="star_event">
<view class="dis-inline-block" @tap="close_star_event">
<iconfont name="icon-close-o" size="30rpx" color="#ccc"></iconfont>
</view>
</view>
</view>
</view>
<!-- 关于我们中使用 -->
<!-- #ifdef APP -->
<view v-if="propType == 'about'" class="margin-top">
<text class="cr-grey-9">{{app_version_info}}</text>
<block v-if="is_loading">
<text v-if="(update_data || null) == null" class="cr-grey-c margin-left-lg text-size-xs"></text>
<text v-else class="cr-blue margin-left-lg text-size-xs cp" @tap="update_event">(v{{update_data.version_new}})</text>
<text v-if="(star_url || null) != null && (star_alert_images || null) != null" class="cr-blue margin-left-lg text-size-xs cp" @tap="star_event"></text>
</block>
</view>
<!-- #endif -->
</view>
</template>
<script>
@ -41,6 +53,9 @@
theme_view: app.globalData.get_theme_value_view(),
update_tips_cache_key: app.globalData.data.cache_app_update_tips_interval_time_key,
star_tips_cache_key: app.globalData.data.cache_app_star_tips_interval_time_key,
app_version_info: app.globalData.data.app_version_info,
is_loading: false,
update_data: null,
//
is_update_status: false,
update_tips_interval_time: 0,
@ -54,7 +69,12 @@
};
},
components: {},
props: {},
props: {
propType: {
type: String,
default: ''
}
},
//
created: function () {
this.init();
@ -62,7 +82,8 @@
methods: {
//
init(is_init = 0) {
init(is_init = 0) {
// #ifdef APP
uni.request({
url: app.globalData.get_request_url('index', 'version', 'appadmin'),
method: 'POST',
@ -72,6 +93,7 @@
if(res.data.code == 0) {
var data = res.data.data;
var upd_data = {
is_loading: true,
update_data: data.update_data || null,
//
update_alert_bg_images: data.update_alert_bg_images || null,
@ -112,6 +134,12 @@
upd_data.is_star_status = false;
}
//
if(this.propType == 'about') {
upd_data.is_update_status = false;
upd_data.is_star_status = false;
}
this.setData(upd_data);
}
},
@ -121,7 +149,8 @@
this.get_data(1);
}
}
});
});
// #endif
},
//
@ -130,26 +159,43 @@
is_update_status: false
});
uni.setStorageSync(this.update_tips_cache_key, Date.parse(new Date()) / 1000);
},
//
update_event(e) {
this.setData({
is_update_status: true
});
},
//
//
to_update_event(e) {
plus.runtime.openURL(this.update_data.update_url);
},
//
//
star_event(e) {
this.setData({
is_star_status: true
});
},
//
to_star_event(e) {
//
this.close_star_event();
//
plus.runtime.openURL(this.star_url);
},
//
close_star_event(e) {
this.setData({
is_star_status: false
});
//
uni.setStorageSync(this.star_tips_cache_key, (Date.parse(new Date()) / 1000)+this.star_tips_interval_time);
//
var value = e.currentTarget.dataset.value || null;
if(value == null) {
plus.runtime.openURL(this.star_url);
}
}
}
};

View File

@ -3,12 +3,15 @@
<view class="padding-main tc">
<view class="bg-white border-radius-main padding-main">
<view class="padding-vertical-xxl">
<!-- logo -->
<image class="logo circle br-f5 padding-sm dis-block auto margin-top-xl" :src="logo" mode="aspectFill"></image>
<!-- 名称 -->
<view class="margin-top-sm text-size">{{title}}</view>
<!-- #ifdef APP -->
<view class="margin-top-sm cr-grey-9">{{app_version_info}}</view>
<!-- #endif -->
<view class="margin-top-xxl cr-base text-size-sm">{{describe}}</view>
<!-- app管理 -->
<component-app-admin ref="app_admin" propType="about"></component-app-admin>
<!-- 简介 -->
<view class="margin-top-xxxxl cr-base text-size-sm">{{describe}}</view>
<!-- 协议 -->
<view class="margin-top-xxxxl padding-vertical-xxxxl">
<text class="cp cr-blue margin-right" data-value="userregister" @tap="agreement_event">{{ $t('login.login.2v11we') }}</text>
<text class="cp cr-blue margin-left" data-value="userprivacy" @tap="agreement_event">{{ $t('login.login.myno2x') }}</text>
@ -21,6 +24,7 @@
</template>
<script>
const app = getApp();
import componentAppAdmin from '@/components/app-admin/app-admin';
export default {
data() {
return {
@ -28,12 +32,13 @@
logo: app.globalData.get_application_logo_square(),
title: app.globalData.get_application_title(),
describe: app.globalData.get_application_describe(),
app_version_info: app.globalData.data.app_version_info,
year: (new Date()).getFullYear(),
};
},
components: {},
components: {
componentAppAdmin
},
onLoad(params) {
//
app.globalData.page_event_onload_handle(params);
@ -42,6 +47,11 @@
onShow() {
//
app.globalData.page_event_onshow_handle();
// app
if ((this.$refs.app_admin || null) != null) {
this.$refs.app_admin.init();
}
},
methods: {