Files
ClassContent/历届学生/逯帅帅/项目开发/上课项目/屁桃儿/js/page/mechanism_info.js
2024-09-27 02:06:13 +08:00

38 lines
967 B
JavaScript
Raw 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.

class MechanismList {
constructor() {
this.mechanList()
// console.log(window.top.document.URL)
}
async mechanList () {
var res = await mechInfoService.mechanismList({
page:0,
id:`${urlId}`
});
console.log(res)
$(".jg_list ul").append(item(res.data))
$(".action").append(`
<i class="iconfont icon-back1"></ihre>
<span>${unit_title}</span>
`)
}
}
var url = document.location.toString();//获取url地址
var urlParmStr = url.slice(url.indexOf('?')+1);//获取问号后所有的字符串
var arr = urlParmStr.split('&');//通过&符号将字符串分割转成数组
var urlId = arr[0].split("=")[1];//获取数组中第一个参数
var unit_title=arr[1].split("=")[1];//第二个参数
unit_title=decodeURI(unit_title);//转码将解码方式unscape换为decodeURI,将中文参数获取
console.log(unit_title)
new MechanismList();