You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

438 lines
14 KiB

5 years ago
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
<title>项目詳情</title>
<link rel="stylesheet" href="../../../lib/css/mui.min.css">
<link rel="stylesheet" type="text/css" href="../../../lib/css/basic.css" />
<link rel="stylesheet" href="../../css/project_white_paper.css">
<script src="../../../lib/js/mui.min.js"></script>
<script src="../../../lib/js/cropper.js"></script>
<script src="../../../lib/js/vue.js"></script>
<script src="../../../lib/js/app.js"></script>
<script src="../../js/base/rem-layout.js"></script>
<script type="text/javascript" src="../../js/my/my_ajax.js"></script>
</head>
<body>
<div id="white-paper">
<header class="mui-bar mui-bar-nav app-header app-header-darkly">
<a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
<h1 class="mui-title">{{langue.title}}</h1>
</header>
<div class="mui-content selected">
<ul class="mui-table-view txt-media">
<!--<li class="mui-table-view-cell mui-media">
<a href="javascript:;">
<img class="mui-media-object mui-pull-left" src="../../img/yanhuo_logo.jpg" />
<div class="mui-media-body">
<span class="product-title">
焰火网
</span>
<div class="product-txt">
焰火网是一个全球科sadsadsadsadsadsddsadsdsd技创新数字货币融资 交易平台
</div>
<div class="product-situation">
<span class="price">区块链技术</span>
<span class="weight"><img src="../../img/thumb-active.png"/>10</span>
</div>
</div>
</a>
</li>-->
<li class="mui-table-view-cell mui-media">
<a href="javascript:;">
<img class="mui-media-object mui-pull-left" :src='base_file_url + currentInfo.coinUrl' />
<div class="mui-media-body">
<span class="product-title">
{{currentInfo.currencyName}}
</span>
<div class="product-txt">
{{currentInfo.descr}}
</div>
<div class="product-situation">
<span class="price">{{currentInfo.classifyName}}</span>
<span class="weight" @click="thumb(currentInfo.id,currentInfo.star)" :id="currentInfo.id"><img :src="changThumb(currentInfo.star)"/>{{currentInfo.starNum}}</span>
</div>
</div>
</a>
</li>
</ul>
<div class="note">
{{langue.note}}
</div>
<!--服务主页,项目报告-->
<div class="market-bottom">
<div id="market-bottom-item" class="mui-slider-indicator mui-segmented-control mui-segmented-control-inverted market-bottom-item">
<a class="mui-control-item mui-active" href="#item1">{{langue.Service_homepage}}</a>
<a class="mui-control-item" href="#item2">{{langue.Project_Report}}</a>
</div>
<div id="item1" class="mui-control-content mui-active">
<div class="introduction">
<h3><span id="currencyFullName">{{langue.basic_information}}</span>(<span id="currencyName">{{project_Info.currencyName}}</span>)</h3>
<div class="introduction-item">
<ul>
<li class="introduction-item-list">
<span class="introduction-item-list-txt">{{langue.time}}:</span>
<span id="issueTime" class="introduction-item-list-num"> {{project_Info.issueTime}}</span>
</li>
<li class="introduction-item-list">
<span class="introduction-item-list-txt">{{langue.num}}:</span>
<span id="totalSupply" class="introduction-item-list-num">{{project_Info.totalSupply}}</span>
</li>
<li class="introduction-item-list">
<span class="introduction-item-list-txt">{{langue.circulation}}:</span>
<span id="totalCirculation" class="introduction-item-list-num">{{project_Info.totalCirculation}}</span>
</li>
<li class="introduction-item-list">
<span class="introduction-item-list-txt">{{langue.price}}:</span>
<span id="icoAmount" class="introduction-item-list-num">{{project_Info.icoAmount}}</span>
</li>
<li class="introduction-item-list">
<span class="introduction-item-list-txt">{{langue.Official_website}}:</span>
<span id="officialWebsite" class="introduction-item-list-num">{{project_Info.uccn}}</span>
</li>
<li class="introduction-item-list">
<span class="introduction-item-list-txt">{{langue.paper}}: </span>
<span id="whitePaper" class="introduction-item-list-num">{{project_Info.whitePaper}}</span>
</li>
</ul>
</div>
</div>
<div class="descr">
<h3>{{langue.Project_Introduction}}</h3>
<p id="descr">{{project_Info.presentation}}</p>
</div>
</div>
<div id="item2" class="mui-control-content report">
<div class="report-list">
<h3>{{langue.basic_information}}</h3>
<ul class="item-ul" id="item-ul1">
<li class="item-list mui-active" data-unit=''>{{langue.all}}</li>
<li class="item-list" data-unit='WEEK'>{{langue.weekly}}</li>
<li class="item-list" data-unit='MONTH'>{{langue.month}}</li>
<li class="item-list" data-unit='SPECIAL'>{{langue.special}}</li>
<li class="item-list" data-unit='FINANCIAL'>{{langue.Financial}}</li>
</ul>
<h3>时间范围</h3>
<ul class="item-ul" id="item-ul2">
<li class="item-list mui-active" data-time=''>{{langue.all}}</li>
<li class="item-list" data-time='7'>{{langue.seven}}</li>
<li class="item-list" data-time='30'>{{langue.thirty}}</li>
</ul>
</div>
<div class="report-info">
<h3>{{langue.special}}</h3>
<div class="report-content" v-for="(item,index) in project_List">
<span class="report-title">{{item.title}}</span>
<span class="report-time">{{item.createTime}}</span>
<span class="report-download" :data-download='item.fileUrl'>{{langue.download}}</span>
</div>
</div>
</div>
</div>
</div>
</div>
</body>
</html>
<script>
// 国际化
var langues = {
zh_CN: {
title: "项目详情",
time: "发行时间",
num: "发行总量",
circulation: "流通总量",
price: "众筹价格",
paper: "白皮书",
Official_website: "官网",
note: "*当前页面暂时内容为项目方自行填写,焰火不对此内容真实性负责",
Service_homepage:"服务主页",
Project_Report:"项目报告",
basic_information:"基本资料",
Project_Introduction:"项目介绍",
all:"全部",
weekly:"项目周报",
month:"项目月报",
special:"专题报告",
Financial:"财务报告",
seven:"7天",
thirty:"项目三十天",
download:"下载",
download_success:"下载成功",
download_failed:"下载失败",
network_err:'网络异常'
},
zh_HK: {
title: "項目詳情",
time: "發行時間",
num: "發行總量",
circulation: "流通總量",
price: "衆籌價格",
paper: "白皮書",
Official_website: "官網",
note: "*當前頁面暫時為項目方自行填寫,焰火不對此内容真實性負責",
Service_homepage:"服務主頁",
Project_Report:"項目報告",
basic_information:"基本資料",
Project_Introduction:"項目介紹",
all:"全部",
weekly:"項目周報",
month:"項目月報",
special:"專題報告",
Financial:"財務報告",
seven:"7天",
thirty:"項目三十天",
download:"下載",
download_success:"下載成功",
download_failed:"下載失敗",
network_err:'網絡異常'
},
en_US: {
title: "Project info",
time: "Publish time",
num: "Total issuance",
circulation: "Total circulation",
price: "Crowdfunding price",
paper: "White paper",
Official_website: "Official website",
note: "*The current content of the current page is filled out by the project party, and the fireworks are not responsible for the authenticity of the content.",
Service_homepage:"Service homepage",
Project_Report:"Project Report",
basic_information:"Basic information",
Project_Introduction:"Project introduction",
all:"All",
weekly:"Weekly",
month:"Month",
special:"Special",
Financial:"Financial",
seven:"7 days",
thirty:"30 days",
download:"Download",
download_success:"Download success",
download_failed:"Download failed",
network_err:'network err'
}
};
//2、页面上所有需要国际化的文字,包括提示,都通过Vue去引用,例子:
var langueKey = app.getLanguageLocalStorage(); //获取国际化语种
var langue = langues[langueKey]; // 获取国际化语种数据
//3、每个页面都需要加上以下的方法:
window.addEventListener('switchLangueData', function(e) {
//dataInfo为Vue对象的名称
dataInfo.langue = langues[e.detail];
});
var dataInfo = new Vue({
el: "#white-paper",
data: {
langue: langue,
project_Info: [], //基本资料内容
project_List: [], //项目报告
currentInfo: [], //主体内容
projectID: '', //项目id
unitTime: '', //时间类型
unitType: '', //项目类型
userLocalStorage: app.getUserLocalStorage(),
base_file_url: app.paperUrl //基础路
},
methods: {
//改变点赞图片
changThumb: function(star) {
if(star == '1') {
return '../../img/thumb.png'
} else {
return '../../img/thumb-active.png'
}
},
//点赞点击事件
thumb: function(_id, star) {
console.log(star)
if(star == '0') {
this.currentInfo.star = '1';
}
if(!this.loginType) {
app.openWin("../wallet_login.html", "mine/html/wallet_login.html");
} else {
this.projectID = _id;
getThumb();
}
},
},
computed: {
loginType: function() {
if(JSON.stringify(this.userLocalStorage) != '{}') {
return true;
} else {
return false;
}
},
}
})
</script>
<script type="text/javascript">
mui.plusReady(function() {
var slef = plus.webview.currentWebview();
var obj = slef.changeObj;
dataInfo.currentInfo = obj;
dataInfo.projectID = obj.id;
console.log("222" + JSON.stringify(dataInfo.currentInfo));
console.log("222" + dataInfo.projectID);
getProjec_info();
getProjec_list();
//获取地址
mui(".mui-content").on("tap", ".report-download", function() {
var domanUrl = this.getAttribute("data-download"); //为存放文件目录地址
openFile(domanUrl);
})
//文件下载及打开第三方软件预览
function openFile(domanUrl) {
//把反斜杆变为斜杆
strurl = domanUrl.replace("\\\\", "\/\/");
strurl = strurl.replace("\\", "\/");
strurl = strurl.replace("\\", "\/");
plus.nativeUI.showWaiting();
var downloader = plus.downloader.createDownload(strurl, {}, function(d, status) {
// 下载完成
if(status == 200) {
plus.nativeUI.closeWaiting();
mui.toast(dataInfo.langue.download_success + d.filename);
//打开文件
plus.runtime.openFile(d.filename, {}, function(err) {
console.log(err);
if(err.code == 1) {
mui.toast("请下载相关软件");
}
});
} else {
plus.nativeUI.closeWaiting();
mui.toast(dataInfo.langue.download_failed);
}
});
downloader.start();
setTimeout(function() {
plus.nativeUI.closeWaiting();
mui.toast(dataInfo.langue.download_failed);
}, 20000)
}
mui.init({
beforeback: function() {    
var list = plus.webview.currentWebview().opener();    
mui.fire(list, 'refresh');
return true;
}
});
})
</script>
<script>
// 基本资料点击事件
mui("#item-ul1").on("tap", ".item-list", function() {
mui("#item-ul1 .item-list").each(function(index, item) {
item.classList.remove("mui-active");
});
var unitType = this.getAttribute("data-unit");
dataInfo.unitType = unitType;
this.classList.add('mui-active');
getProjec_list();
});
// 时间范围点击事件
mui("#item-ul2").on("tap", ".item-list", function() {
mui("#item-ul2 .item-list").each(function(index, item) {
item.classList.remove("mui-active");
});
var unitTime = this.getAttribute("data-time");
dataInfo.unitTime = unitTime;
console.log("222" + dataInfo.unitTime);
getProjec_list();
this.classList.add('mui-active');
});
//查询基本资料
function getProjec_info() {
mui.ajax(myAjaxJs.PROJECT_INFO.getUrl, {
headers: {
"locale": app.getLanguageLocalStorage() // 语种头部
},
type: myAjaxJs.PROJECT_INFO.getType, //HTTP请求类型
data: {
id: dataInfo.projectID
},
dataType: 'json', //服务器返回json格式数据
timeout: 10000, //超时时间设置为10秒;
success: function(data) {
if(data.code == 200) {
//渲染数据
console.log(JSON.stringify(data))
dataInfo.project_Info = data.data;
} else {
mui.toast(data.msg);
}
}
})
}
//查询專題報告
function getProjec_list() {
plus.nativeUI.showWaiting();
mui.ajax(myAjaxJs.PROJECT_LIST.getUrl, {
headers: {
"locale": app.getLanguageLocalStorage() // 语种头部
},
type: myAjaxJs.PROJECT_LIST.getType, //HTTP请求类型
data: {
projectId: dataInfo.projectID,
reportType: dataInfo.unitType,
dateType: dataInfo.unitTime
},
dataType: 'json', //服务器返回json格式数据
timeout: 10000, //超时时间设置为10秒;
success: function(data) {
if(data.code == 200) {
plus.nativeUI.closeWaiting();
//渲染数据
console.log(JSON.stringify(data))
dataInfo.project_List = data.data.rows;
} else {
plus.nativeUI.closeWaiting();
mui.toast(data.msg);
}
},
error: function(xhr, type, errorThrown) {
plus.nativeUI.closeWaiting();
mui.toast(dataInfo.langue.network_err);
}
})
}
//点赞查询内容
function getThumb() {
mui.ajax(myAjaxJs.AJAX_WHITE_PAPER_THUMB.getUrl, {
headers: {
"locale": app.getLanguageLocalStorage() // 语种头部
},
type: myAjaxJs.AJAX_WHITE_PAPER_THUMB.getType, //HTTP请求类型
data: {
projectId: dataInfo.projectID,
userId: dataInfo.userLocalStorage.id
},
dataType: 'json', //服务器返回json格式数据
timeout: 10000, //超时时间设置为10秒;
success: function(data) {
if(data.code == 200) {
//渲染数据
dataInfo.currentInfo.starNum++
} else {
mui.toast(data.msg);
}
}
})
}
</script>