第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號安全,請及時綁定郵箱和手機(jī)立即綁定

【備戰(zhàn)春招】第1天 破解JavaScript高級玩法 第八講

標(biāo)簽:
JavaScript

课程章节: 被我们忽视的BOM

主讲老师: Cloud

课程内容:

今天学习的内容包括:

非常见DOM的操作

课程收获:

8.1 心得:

history,网页端的方向盘

var vm = new Vue({
	el: "#wrap",
	data: {
		collectList: [],
		user: {}
	},
	created() {
		if (!account.islogin()) {
			window.location.href = "login.html";
		}

		this.user = JSON.parse(account.getUserInfo());
		ajaxPage(1, this.user.id);
	},
	mounted() {

	}
});

function cancelCollect(e) {
	var scenicSpotId = e.ScenicSpotId;
	var userId = vm.user.id;
	var isCancel = confirm("确认取消收藏吗?");
	if (isCancel == true) {
		$.ajax({
			type: "GET",
			url: getHttpUrl() + config.CancelCollection,
			data: {
				scenicSpotId: scenicSpotId,
				userId: userId
			},
			dataType: "json",
			success: function (data) {
				ajaxPage(1, userId);
			}
		});
	}
}


//结合Ajax使用,仅供参考
function ajaxPage(page, userId) {
	var p = page || 1;
	$.ajax({
		type: "GET",
		url: getHttpUrl() + config.GetCollectList,
		data: {
			userId: userId,
			pageNum: p,
			pageSize: 10,
		},
		dataType: "json",
		success: function (data) {
			//数据处理
			if (data.result) {
				vm.collectList = data.data.rows;

				// 调用分页插件
				$("#myPage").sPage({
					page: p,//当前页码
					pageSize: 10,//每页显示多少条数据,默认10条
					total: data.data.records,//数据总条数,后台返回
					backFun: function (page) {
						//点击分页按钮回调函数,返回当前页码
						ajaxPage(page, userId);
					}
				});
			}
		},
		error: function (e) {
			console.log(e);
		}
	});
}
var vm = new Vue({
	el: "#wrap",
	data: {
		cur: 0, //默认选中第一个tab
		couponList: [],
		user: {}
	},
	created() {
		if (!account.islogin()) {
			window.location.href = "login.html";
		}

		this.user = JSON.parse(account.getUserInfo());
		datatime();
		ajaxPage(1, this.cur, this.user.id);
	},
	mounted() {

	}
});

function changeStatus(status) {
	ajaxPage(1, status, vm.user.id);
}

//结合Ajax使用,仅供参考
function ajaxPage(page, status, userId) {
	var p = page || 1;
	$.ajax({
		type: "GET",
		url: getHttpUrl() + config.GetCouponList,
		data: {
			userId: userId,
			status: status,
			pageNum: p,
			pageSize: 8,
		},
		dataType: "json",
		success: function (data) {
			//数据处理
			if (data.result) {
				vm.couponList = data.data.rows;
				vm.cur = status;

				// 调用分页插件
				$("#myPage").sPage({
					page: p,//当前页码
					pageSize: 10,//每页显示多少条数据,默认10条
					total: data.data.records,//数据总条数,后台返回
					backFun: function (page) {
						//点击分页按钮回调函数,返回当前页码
						ajaxPage(page, status, openId);
					}
				});
			}
		},
		error: function (e) {
			console.log(e);
		}
	});
}

//时间函数
function datatime() {
	Date.prototype.format = function (format) {
		var o = {
			"M+": this.getMonth() + 1, //month
			"d+": this.getDate(), //day
			"h+": this.getHours(), //hour
			"m+": this.getMinutes(), //minute
			"s+": this.getSeconds(), //second
			"q+": Math.floor((this.getMonth() + 3) / 3), //quarter
			"S": this.getMilliseconds() //millisecond
		}

		if (/(y+)/.test(format)) {
			format = format.replace(RegExp.$1, (this.getFullYear() + "").substr(4 - RegExp.$1.length));
		}

		for (var k in o) {
			if (new RegExp("(" + k + ")").test(format)) {
				format = format.replace(RegExp.$1, RegExp.$1.length == 1 ? o[k] : ("00" + o[k]).substr(("" + o[k]).length));
			}
		}
		return format;
	}
}
var vm = new Vue({
	el: "#wrap",
	data: {
		cur: 0, //默认选中第一个tab
		orderList: [],
		user: {}
	},
	created() {
		if(!account.islogin())
		{
			window.location.href = getWebUrl() + "/html/login.html";
		}

		this.user=JSON.parse(account.getUserInfo());
		ajaxPage(1, this.cur, this.user.id);
	},
	mounted() {

	},
	methods: {
		GotoDetail: function (id) {
			var _id = CryptoJS.AES.encrypt(id, "id");
			var url = "../html/orderDetail.html?id=" + _id;
			window.open(url, '_blank');
		}
	}
});

function changeStatus(status) {
	ajaxPage(1, status, vm.user.id);
}


//结合Ajax使用,仅供参考
function ajaxPage(page, status, userId) {
	var p = page || 1;
	$.ajax({
		type: "GET",
		url: getHttpUrl() + config.GetOrderList,
		data: {
			userId: userId,
			status: status,
			pageNum: p,
			pageSize: 10,
		},
		dataType: "json",
		success: function (data) {
			//数据处理
			if (data.result) {
				vm.orderList = data.data.rows;
				vm.cur = status;

				// 调用分页插件
				$("#myPage").sPage({
					page: p,//当前页码
					pageSize: 10,//每页显示多少条数据,默认10条
					total: data.data.records,//数据总条数,后台返回
					backFun: function (page) {
						//点击分页按钮回调函数,返回当前页码
						ajaxPage(page, status, userId);
					}
				});
			}
		},
		error: function (e) {
			console.log(e);
		}
	});
}

图片描述

點(diǎn)擊查看更多內(nèi)容
1人點(diǎn)贊

若覺得本文不錯,就分享一下吧!

評論

作者其他優(yōu)質(zhì)文章

正在加載中
感謝您的支持,我會繼續(xù)努力的~
掃碼打賞,你說多少就多少
贊賞金額會直接到老師賬戶
支付方式
打開微信掃一掃,即可進(jìn)行掃碼打賞哦
今天注冊有機(jī)會得

100積分直接送

付費(fèi)專欄免費(fèi)學(xué)

大額優(yōu)惠券免費(fèi)領(lǐng)

立即參與 放棄機(jī)會
微信客服

購課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動學(xué)習(xí)伙伴

公眾號

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號

舉報

0/150
提交
取消