feat: 前端全量更新 - 含所有本次需求
- 移除秒合约页面及UI - 合约页Tab改为Position Held/Transaction Record - 存款/提款/转账页增加BTC/ETH - 资产页重构(用户信息+盈亏+多语言) - 注册页改版(匹配新设计稿) - 日文全面翻译+首页菜单多语言 - 代理专属注册链接支持(?code=) - 10个locale文件同步更新
This commit is contained in:
@@ -0,0 +1,49 @@
|
||||
|
||||
/**
|
||||
* 设置粘贴板数据
|
||||
* @param {String} text 要设置的字符串
|
||||
* 如果未设置参数,则清空数据
|
||||
*/
|
||||
function setClipboardText(text){
|
||||
try{
|
||||
var os = plus.os.name;
|
||||
text = text||'';
|
||||
if('iOS' == os){
|
||||
// var UIPasteboard = plus.ios.importClass('UIPasteboard');
|
||||
// var pasteboard = UIPasteboard.generalPasteboard();
|
||||
// pasteboard.setValueforPasteboardType(text, 'public.utf8-plain-text');
|
||||
var pasteboard = plus.ios.invoke('UIPasteboard', 'generalPasteboard');
|
||||
plus.ios.invoke(pasteboard, 'setValue:forPasteboardType:', text, 'public.utf8-plain-text');
|
||||
}else{
|
||||
var main = plus.android.runtimeMainActivity();
|
||||
// var Context = plus.android.importClass('android.content.Context');
|
||||
// var clip = main.getSystemService(Context.CLIPBOARD_SERVICE);
|
||||
var clip = main.getSystemService('clipboard');
|
||||
plus.android.invoke(clip, 'setText', text);
|
||||
}
|
||||
}catch(e){
|
||||
console.error('error @setClipboardText!!');
|
||||
}
|
||||
}
|
||||
|
||||
function getClipboardText(){
|
||||
try{
|
||||
var os = plus.os.name;
|
||||
if('iOS' == os){
|
||||
var pasteboard = plus.ios.invoke('UIPasteboard', 'generalPasteboard');
|
||||
return plus.ios.invoke(pasteboard, 'valueForPasteboardType:', 'public.utf8-plain-text')
|
||||
}else{
|
||||
var main = plus.android.runtimeMainActivity();
|
||||
var clip = main.getSystemService('clipboard');
|
||||
return plus.android.invoke(clip, 'getText');
|
||||
}
|
||||
}catch(e){
|
||||
console.error('error @getClipboardText!!');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
module.exports = {
|
||||
setText: setClipboardText,
|
||||
getText: getClipboardText
|
||||
}
|
||||
Reference in New Issue
Block a user