gengx
This commit is contained in:
@@ -137,7 +137,6 @@ export default {
|
||||
data(){
|
||||
return{
|
||||
// 月刊标号海报:
|
||||
MonPage:'3',
|
||||
currentImg:'',
|
||||
// 项目总数
|
||||
ProjectNum:0,
|
||||
@@ -154,24 +153,24 @@ export default {
|
||||
// 初始化渲染页面
|
||||
mounted(){
|
||||
// 绘制最新月刊
|
||||
this.addTextEvent();
|
||||
// // 填充画布:
|
||||
this.$nextTick(() => {
|
||||
this.drawPage();
|
||||
});
|
||||
// this.addTextEvent();
|
||||
// // // 填充画布:
|
||||
// this.$nextTick(() => {
|
||||
// this.drawPage();
|
||||
// });
|
||||
this.getMonely();
|
||||
this.getProjectNum();
|
||||
this.getLabel();
|
||||
},
|
||||
methods: {
|
||||
drawPage(){
|
||||
var that = this;
|
||||
var fac = document.getElementsByClassName("3");
|
||||
fac.style.backgroundImage = that.currentImg;
|
||||
},
|
||||
// drawPage(){
|
||||
// var that = this;
|
||||
// var fac = document.getElementsByClassName("3");
|
||||
// fac.style.backgroundImage = that.currentImg;
|
||||
// },
|
||||
test(index){
|
||||
var that = this;
|
||||
console.log(index);
|
||||
// var that = this;
|
||||
// console.log(index);
|
||||
},
|
||||
goBack() {
|
||||
window.history.go(-1);
|
||||
@@ -267,34 +266,34 @@ export default {
|
||||
});
|
||||
}
|
||||
},
|
||||
backtoHome(){
|
||||
let pathInfo = this.$router.resolve({
|
||||
path: '/Home',
|
||||
query:{
|
||||
}
|
||||
})
|
||||
window.open(pathInfo.href, '_self');
|
||||
},
|
||||
addTextEvent() {
|
||||
var _this = this
|
||||
let canvas = document.createElement("canvas");
|
||||
canvas.width = 600;
|
||||
canvas.height = 400;
|
||||
let myImage = new Image();
|
||||
myImage.src = "../../assets/images/最新月刊.png"; // 需要添加文字的图片
|
||||
myImage.crossOrigin = "Anonymous";
|
||||
let context = canvas.getContext("2d");
|
||||
myImage.onload = function () {
|
||||
context.drawImage(myImage, 0, 0, canvas.width, canvas.height);
|
||||
context.font = "20px Courier New";
|
||||
context.fillStyle = 'red'
|
||||
// context.textAlign = 'end' //文字右对齐
|
||||
context.fillText("我是写入的文字", 250, 350); // 文字的内容和位置
|
||||
let base64 = canvas.toDataURL("image/png"); // "image/png" 这里注意一下
|
||||
console.log(_this.currentImg);
|
||||
_this.currentImg = base64
|
||||
}
|
||||
}
|
||||
// backtoHome(){
|
||||
// let pathInfo = this.$router.resolve({
|
||||
// path: '/Home',
|
||||
// query:{
|
||||
// }
|
||||
// })
|
||||
// window.open(pathInfo.href, '_self');
|
||||
// },
|
||||
// addTextEvent() {
|
||||
// var _this = this
|
||||
// let canvas = document.createElement("canvas");
|
||||
// canvas.width = 600;
|
||||
// canvas.height = 400;
|
||||
// let myImage = new Image();
|
||||
// myImage.src = "../../assets/images/最新月刊.png"; // 需要添加文字的图片
|
||||
// myImage.crossOrigin = "Anonymous";
|
||||
// let context = canvas.getContext("2d");
|
||||
// myImage.onload = function () {
|
||||
// context.drawImage(myImage, 0, 0, canvas.width, canvas.height);
|
||||
// context.font = "20px Courier New";
|
||||
// context.fillStyle = 'red'
|
||||
// // context.textAlign = 'end' //文字右对齐
|
||||
// context.fillText("我是写入的文字", 250, 350); // 文字的内容和位置
|
||||
// let base64 = canvas.toDataURL("image/png"); // "image/png" 这里注意一下
|
||||
// console.log(_this.currentImg);
|
||||
// _this.currentImg = base64
|
||||
// }
|
||||
// }
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
@@ -166,27 +166,8 @@ export default {
|
||||
}
|
||||
}, 10);
|
||||
|
||||
// const that = this
|
||||
// let timer = setInterval(() => {
|
||||
// let ispeed = Math.floor(-that.scrollTop / 5)
|
||||
// document.documentElement.scrollTop = document.body.scrollTop = that.scrollTop + ispeed
|
||||
// if (that.scrollTop === 0) {
|
||||
// clearInterval(timer)
|
||||
// }
|
||||
// }, 16)
|
||||
},
|
||||
// // 为了计算距离顶部的高度,当高度大于60显示回顶部图标,小于60则隐藏
|
||||
// scrollToTop () {
|
||||
// const that = this
|
||||
// let scrollTop = window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop
|
||||
// that.scrollTop = scrollTop
|
||||
// if (that.scrollTop > 60) {
|
||||
// that.btnFlag = true
|
||||
// } else {
|
||||
// that.btnFlag = false
|
||||
// }
|
||||
// },
|
||||
//滚动
|
||||
|
||||
// 点击切换锚点:
|
||||
goAnchor(id) {
|
||||
var anchor = document.getElementById(id);
|
||||
@@ -233,11 +214,6 @@ export default {
|
||||
initPage(){
|
||||
this.MonthlyId = this.$route.query.MonethlyId;
|
||||
this.selectMonly = this.MonthlyId;
|
||||
// if(parseInt(this.selectMonly) == parseInt(1) || parseInt(this.MonethlyId) == parseInt(1)){
|
||||
// this.$refs.LastBtn.style.display = "none"
|
||||
// }else if(parseInt(this.selectMonly) == this.Monely || parseInt(this.MonethlyId) == this.Monely){
|
||||
// this.$refs.NextBtn.style.display = "none"
|
||||
// }
|
||||
},
|
||||
// test(){
|
||||
// console.log(this.MonType);
|
||||
@@ -272,8 +248,9 @@ export default {
|
||||
that.MonTypePro=[];
|
||||
Object.keys(that.MonList).forEach(key=>{
|
||||
that.MonTypePro.push(that.MonList[key]);
|
||||
that.MonType.push(key);
|
||||
})
|
||||
// console.log(that.MonTypePro);
|
||||
console.log(that.MonTypePro);
|
||||
})
|
||||
},
|
||||
// 月刊详情页面跳转
|
||||
|
Reference in New Issue
Block a user