Files
li 5f40e4e1b5 feat: 前端全量更新 - 含所有本次需求
- 移除秒合约页面及UI
- 合约页Tab改为Position Held/Transaction Record
- 存款/提款/转账页增加BTC/ETH
- 资产页重构(用户信息+盈亏+多语言)
- 注册页改版(匹配新设计稿)
- 日文全面翻译+首页菜单多语言
- 代理专属注册链接支持(?code=)
- 10个locale文件同步更新
2026-03-30 20:14:20 +08:00

94 lines
3.3 KiB
JavaScript
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
/**** 此文件说明请看注释 *****/
// 可以用自己项目的请求方法
// 请求配置说明:https://ext.dcloud.net.cn/plugin?id=822
import {
req
} from '@/api/index';
/**** 结束 *****/
const platform = uni.getSystemInfoSync().platform;
export default {
// 发起ajax请求获取服务端版本号
getServerNo: (version, isPrompt = false, callback) => {
let httpData = {
version: version.versionCode,
// 版本名称
versionName: version.versionName,
// setupPage参数说明(判断用户是不是从设置页面点击的更新,如果是设置页面点击的更新,有不要用静默更新了,不然用户点击没反应很奇怪的)
setupPage: isPrompt
};
if (platform == "android") {
httpData.type = 1101;
} else {
httpData.type = 1102;
}
/* 接口入参说明
* version: 应用当前版本号(已自动获取)
* versionName: 应用当前版本名称(已自动获取)
* type:平台(1101是安卓,1102是IOS
*/
/****************以下是示例*******************/
// 可以用自己项目的请求方法(接口自己找后台要,插件不提供)
// console.log(httpData)
req("/publics/version").then(res => {
/* res的数据说明
* | 参数名称 | 一定返回 | 类型 | 描述
* | -------------|--------- | --------- | ------------- |
* | versionCode | y | int | 版本号 |
* | versionName | y | String | 版本名称 |
* | versionInfo | y | String | 版本信息 |
* | updateType | y | String | forcibly = 强制更新, solicit = 弹窗确认更新, silent = 静默更新 |
* | downloadUrl | y | String | 版本下载链接(IOS安装包更新请放跳转store应用商店链接,安卓apk和wgt文件放文件下载链接) |
*/
// console.log('下载链接', res)
if (res.code == 1) {
if (Number(res.data.newversion) > httpData.version) {
let temp = {
versionCode: res.data.newversion,
versionName: res.data.oldversion,
versionInfo: res.data.content,
updateType: 'solicit',
downloadUrl: res.data.downloadurl,
// downloadUrl:'https://dldir1.qq.com/weixin/android/weixin8016android2040.apk',
totalSize: res.data.packagesize
}
if (res.data.enforce == 1) {
temp.updateType = "forcibly";
} else {
temp.updateType = "solicit";
}
callback && callback(temp);
} else if (isPrompt) {
uni.showToast({
title: "You have the newest version",
icon: "none"
});
}
}
// if (res && res.data.downloadurl) {
// // 兼容之前的版本(updateType是新版才有的参数)
// if (res.updateType) {
// callback && callback(res.data);
// } else {
// if (res.data.enforce == 1) {
// res.data.updateType = "forcibly";
// } else {
// res.data.updateType = "solicit";
// }
// callback && callback(res.data);
// }
// } else if (isPrompt) {
// uni.showToast({
// title: "暂无新版本",
// icon: "none"
// });
// }
});
/****************以上是示例*******************/
},
// 弹窗主颜色(不填默认粉色)
appUpdateColor: "#FF5B78",
// 弹窗图标(不填显示默认图标,链接配置示例如: '/static/ic_ar.png'
appUpdateIcon: ''
}