<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">var ko_cells_num = 4500 // 全局KO细胞数量 细胞库变更时需更改
function prompt_box(status, title, con, lang){
    // 提示框
    if ($(".subscribe_msg").length === 0){
        let css = "&lt;style&gt;.subscribe_msg{width:100%;height:100%;background:rgba(200,200,200,.5);position:fixed;top:0;z-index:1100;display:block}.subscribe_msg .box{width:390px;margin:200px auto 0;padding:35px;box-sizing:border-box;background:#fff;border-radius:5px;text-align:center;display:flex;flex-direction:column;align-content:center;align-items:center;justify-content:space-around}.subscribe_msg .box .img{width:48px}.subscribe_msg .box h3{font-size:16px;color:#202020;margin:10px 0;font-weight:700}.subscribe_msg .box p{color:#666;margin:10px 0}.subscribe_msg .box button{background:#d01027;color:#fff;padding:6px 20px;border-radius:30px;border:0}&lt;/style&gt;"
        let html = '&lt;div class="subscribe_msg"&gt;&lt;div class="box"&gt;&lt;div class="img"&gt;&lt;/div&gt;&lt;h3&gt;&lt;/h3&gt;&lt;p&gt;&lt;/p&gt;&lt;button onclick=\'$(".subscribe_msg").hide()\'&gt;&lt;/button&gt;&lt;/div&gt;&lt;/div&gt;'
        $("body").append(html)
        $("body").append(css)
    }
    
    // https://www.iconfont.cn/search/index?searchType=icon&amp;q=success
    // https://www.iconfont.cn/search/index?searchType=icon&amp;q=error&amp;page=1&amp;fromCollection=1&amp;fills=&amp;tag=
    imgs = {
        error: '&lt;svg t="1641263116889" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="3304" width="48" height="48"&gt;&lt;path d="M512 1000.727273a488.727273 488.727273 0 1 1 488.727273-488.727273 488.727273 488.727273 0 0 1-488.727273 488.727273z m0-919.272728a430.545455 430.545455 0 1 0 430.545455 430.545455A430.545455 430.545455 0 0 0 512 81.454545z" fill="#666666" p-id="3305" data-spm-anchor-id="a313x.7781069.0.i13" class="selected"&gt;&lt;/path&gt;&lt;path d="M721.454545 750.545455a28.974545 28.974545 0 0 1-20.596363-8.494546L281.6 322.443636a29.090909 29.090909 0 0 1 41.192727-41.192727L742.4 700.858182A29.090909 29.090909 0 0 1 721.454545 750.545455z" fill="#d01027" p-id="3306" data-spm-anchor-id="a313x.7781069.0.i15" class=""&gt;&lt;/path&gt;&lt;path d="M302.545455 750.545455a29.090909 29.090909 0 0 1-20.596364-49.687273l419.258182-419.607273a29.090909 29.090909 0 0 1 41.192727 41.192727L322.792727 742.050909a28.974545 28.974545 0 0 1-20.247272 8.494546z" fill="#d01027" p-id="3307" data-spm-anchor-id="a313x.7781069.0.i12" class=""&gt;&lt;/path&gt;&lt;/svg&gt;',
        success: '&lt;svg t="1641117094105" class="icon" viewBox="0 0 1025 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2160" data-spm-anchor-id="a313x.7781069.0.i0" width="48" height="48"&gt;&lt;path d="M511.679524 1023.15939c-68.658678 0-135.399619-13.564433-198.369591-40.316509-60.752236-25.809077-115.373446-62.712976-162.346233-109.685763-46.971763-46.971763-83.875662-101.592974-109.685763-162.346233-26.751052-62.969971-40.315485-129.710912-40.315485-198.368567s13.564433-135.399619 40.315485-198.369591c25.810101-60.752236 62.714-115.373446 109.685763-162.346233 46.972787-46.971763 101.593997-83.875662 162.346233-109.685763C376.279905 15.28968 443.020846 1.725247 511.679524 1.725247S647.078119 15.28968 710.048091 42.040731c60.752236 25.810101 115.37447 62.714 162.346233 109.685763 46.972787 46.972787 83.876686 101.593997 109.686787 162.346233 26.752076 62.969971 40.316509 129.710912 40.316509 198.369591s-13.564433 135.398595-40.316509 198.368567c-25.810101 60.75326-62.712976 115.37447-109.685763 162.346233-46.971763 46.972787-101.593997 83.876686-162.346233 109.685763C647.079143 1009.594957 580.337178 1023.15939 511.679524 1023.15939zM511.679524 50.871742c-62.018782 0-122.293887 12.247716-179.152287 36.403219-54.923257 23.333323-104.317532 56.709936-146.810821 99.204249s-75.870926 91.888588-99.204249 146.810821c-24.155503 56.8584-36.403219 117.133505-36.403219 179.152287 0 62.017758 12.247716 122.292863 36.403219 179.152287 23.333323 54.923257 56.709936 104.317532 99.204249 146.811845 42.493289 42.493289 91.888588 75.870926 146.810821 99.204249 56.8584 24.155503 117.133505 36.403219 179.152287 36.403219 62.017758 0 122.293887-12.247716 179.153311-36.403219 54.923257-23.333323 104.317532-56.71096 146.810821-99.204249 42.494313-42.494313 75.87195-91.888588 99.205273-146.811845 24.155503-56.8584 36.403219-117.133505 36.403219-179.152287s-12.247716-122.293887-36.404243-179.152287c-23.333323-54.923257-56.71096-104.317532-99.204249-146.810821-42.494313-42.493289-91.888588-75.870926-146.811845-99.204249C633.972387 63.119459 573.697282 50.871742 511.679524 50.871742z" p-id="2161" data-spm-anchor-id="a313x.7781069.0.i2" class="" fill="#999999"&gt;&lt;/path&gt;&lt;path d="M451.780185 689.848881c-6.223175 0-12.452493-2.255619-17.365095-6.794503L253.195578 515.658342c-10.384245-9.592782-11.027245-25.787576-1.434463-36.171821 9.592782-10.386293 25.786552-11.026221 36.171821-1.434463l163.146912 150.703633 289.753404-289.754428c9.997216-9.996192 26.203273-9.996192 36.199466 0 9.996192 9.996192 9.996192 26.203273 0 36.199466L469.883501 682.351993C464.896156 687.339338 458.342266 689.848881 451.780185 689.848881z" p-id="2162" data-spm-anchor-id="a313x.7781069.0.i1" class="" fill="#d01027"&gt;&lt;/path&gt;&lt;/svg&gt;'
    }

    let img = imgs[status]
    let btn = lang === 'zh' ? "确定" : "OK" 
    $(".subscribe_msg .img").html(img)
    $(".subscribe_msg h3").html(title)
    $(".subscribe_msg p").html(con)
    $(".subscribe_msg button").text(btn)
    $(".subscribe_msg").show()
}
//显示提示框，目前三个参数(txt：要显示的文本；time：自动关闭的时间（不设置的话默认1500毫秒）；status：默认0为错误提示，1为正确提示；)
function showTips(txt, time, status) {
    if ($(".tip_msg").length === 0){
        let html = '&lt;div class="tipsBox" style="width:220px;padding:10px;border-radius:4px;-webkit-border-radius: 4px;-moz-border-radius: 4px;color:#fff;box-shadow:0 0 3px #ddd inset;-webkit-box-shadow: 0 0 3px #ddd inset;text-align:center;position:fixed;top:25%;left:50%;z-index:999999;margin-left:-120px;""&gt;&lt;img src="/images/ok.png" style="vertical-align: middle;margin-right:5px;" alt="OK"/&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;'
        $("body").append(html)
    }

	let background = status != 0 &amp;&amp; status != undefined?  "#4AAF33" : "#D84C31"
	$(".tipsBox").css("background-color", background)
	$(".tipsBox span").text(txt)
	$(".tipsBox").show()
	$(".tipsBox").fadeOut(1500)
}

// 根据图片宽度自动设置高度， 手机端屏幕宽度不一样，图片显示不正常
function set_height(selector){
    // 根据背景图片设置元素高度
	let w = selector.offsetWidth;
    if ($(selector).css("background-image") &amp;&amp; w &gt; 0){
        let image = new Image()
        image.src = $(selector).css("background-image").split(", ")[0].slice(5, -2)
		image.onload = function () {
			// if (selector.classList.contains('banner') &amp;&amp; location.host.includes('www')){
			// 	$(selector).css("height", image.height)
			//
			// }else{
			let rate = image.height/image.width
			$(selector).css("height", w*rate)
			// }
		}
    }
}

// 获取观察器实例 
var lazy_load_observer = new IntersectionObserver(
	function(changes) {  // changes是被观察的对象数组
		changes.forEach(function(item, index) {
			if (item.isIntersecting || item.intersectionRatio &gt; 0) {
				//target：被观察的目标元素，是一个 DOM 节点对象
				item.target.src = item.target.dataset.src;
				// 停止观察
				observer.unobserve(item.target)
			}
		});
	}
);

//获取观察器实例 
var add_num_observer = new IntersectionObserver(
	function(changes) {  // changes是被观察的对象数组
		changes.forEach(function(item) {
			if (item.isIntersecting || item.intersectionRatio &gt; 0) {
				//target：被观察的目标元素，是一个 DOM 节点对象
				let i = 0;
				let timer = setInterval(function() {
					if (i &gt;= ko_cells_num) {   // 全局KO细胞数量
						clearInterval(timer);
						i = ko_cells_num
					};
					item.target.innerText = i + "+"
					i += 35;
				}, 10)
			}
		});
	}
);



// 表单全局变量 记录表单验证结果
var from_verify_data = {}
// 表单提交校验
function show_from_tip(el, tip){
	// 显示/隐藏 错误提示
	let position = $(el).attr("pos") || "";
	let tip_el = $(el).siblings(".tip");
	// let hide_text = el.attributes["hide_text"]
	let hide_text = false

	if (tip === undefined || tip === ""){
		$(el).parents(".from_item").removeClass("red_border")
		if (!hide_text){
			tip_el.hide()
		}
	}else{
		$(el).parents(".from_item").addClass("red_border")
		if (!hide_text){
			tip_el.addClass(position)
			tip_el.text(tip)
			tip_el.show()
		}

	}
}

function verify_field(el){
	let tip = ""
	let filed_name = $(el).attr("name");
	let value = $(el).val();
	let required = $(el).attr("required") === "required";
	let namereg = /^[\u4E00-\u9FA5]{2,4}$/;//姓名正则
	let EmailReg = /^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/; //邮件正则
	let PhoneReg = /^[\d\-\+\s]{7,15}$/; //电话正则
	// 区分同一页面多个表单
	let from_name = $(el).parents(".contact_from").parent().attr("class") + $(el).parents(".contact_from").attr("class")

	// 不需要验证
	if (!required){
		show_from_tip(el)
		return true
	}
	
	if (value.trim() === ""){
		tip = "*required!"
	}
	//console.log(filed_name, value,tip, EmailReg.test(value), PhoneReg.test(value))
	
	if (filed_name === "email"){
		if(!EmailReg.test(value)){
			tip = "Oops...Wrong format"
		}
	}
	if (filed_name === "phone"){
		if(!PhoneReg.test(value)){
			tip = "Oops...Wrong format"
		}
	}
	show_from_tip(el, tip)
	// 修改提交按扭
	if (!from_verify_data.hasOwnProperty(from_name)){
		from_verify_data[from_name] = {}
	}

	from_verify_data[from_name][filed_name] = [value, !Boolean(tip)]
	// console.log(from_verify_data)
	
	$(el).parents(".contact_from").find(".from_submit button").addClass("not_allowed")
	if (verify_button(el, from_name)){
		$(el).parents(".contact_from").find(".from_submit button").removeClass("not_allowed")
	}
	
	return !Boolean(tip)
	
}
function verify_button(el, from_name){

	$(el).parents(".contact_from").find("*[required='required']").each(item=&gt;{
		field = $(item).attr("name")
		if (from_verify_data[from_name][field] &amp;&amp; !from_verify_data[from_name][field][1]){
			return false
		}
	})
	return true
}

function subscribe_submit(el){
	// Subscribe 表单提交
	let items = $(el).parents(".contact_from").find("*[required='required']")
	let result = []
	items.map((index, item)=&gt;result.push(verify_field(item)))
	// console.log(items, result)
	if (result.some(i=&gt;!i)){
		return false
	}

	// 提交表单
	send_subscribe_submit(el)
}

function send_subscribe_submit(el){
	let data = {
		email: $(el).parents(".contact_from").find("input[name='email']").val(),
		country: $(el).parents(".contact_from").find("select[name='country']").val(),
		name: $(el).parents(".contact_from").find("input[name='name']").val(),
	}
	$.ajax({
	  url: "/api/product/subscribe",
	  type: 'post',
	  contentType: "application/json;charset=UTF-8",
	  dataType: "json",
	  data: JSON.stringify(data),
	  success: (data) =&gt; {
		  if (data.status == "000000"){
		  	$('#subscribe_model').css('display', 'none')
			prompt_box("success", 'Success', 'Thank you for subscribing us!', "en")
		  }else if (data.status == "002005"){
			showTips('Has been submitted');
		  }else{
		  	showTips('Params error');
		  }
	  },
	  error: err =&gt; console.log(err)
	});
}

function contact_from_submit(el){
	// 表单提交
	// 区分同一页面多个表单
	let items = $(el).parents(".contact_from").find("*[required='required']")
	let result = []
	items.map((index, item)=&gt;result.push(verify_field(item)))
	// console.log(items, result)
	if (result.some(i=&gt;!i)){
		return false
	}

	let contact_form = $(el).parents(".contact_from");
	if ($(contact_form).hasClass("contact_form_new") || $(contact_form).hasClass("sidebar_contact_form")) {
		send_contact_submit(el);
	} else {
		// 提交表单
		send_submit(el);
	}
}

function gtag_report_conversion(url) {
  var callback = function () {
    if (typeof(url) != 'undefined') {
      window.location = url;
    } else {
    	console.log("Test")
	}
  };
  gtag('event', 'conversion', {
      'send_to': 'AW-715701462/7NtLCI_WlpgYENb5otUC',
      'event_callback': callback
  });
  return false;
}

function send_submit(el){
	let site_location = ""
	site_location = site_location || ($(el).parents(".page-l").length &gt; 0 ? "sitebar" : "")
	site_location = site_location || ($(el).parents("#Navright").length &gt; 0 ? "navright" : "")
	site_location = site_location || ($(el).parents(".page-r").length &gt; 0 ? "content" : "")  // 服务页
	site_location = site_location || ($(el).parents(".content_contact_us").length &gt; 0 ? "content" : "") // 活动页
	site_location = site_location || ($(el).parents(".service-con").length &gt; 0 ? "content" : "") // 手机服务页
	site_location = site_location || ($(el).parents(".article-con").length &gt; 0 ? "content" : "") // 手机活动页

	let gRNAs = ""
	$(el).parents(".contact_from").find("input[name='gRNAs']:checked").each((index, el) =&gt; {
		gRNAs += $(el).val() + ","
	})

	let cate1_id = $(el).parents(".contact_from").find("input[name='cate1_id']").val()

	product_type = "3"
	if (cate1_id){
		product_type = "2"
		if (cate1_id == 2){
			product_type = "1"
		}
	}
	
	let data = {
		product_type: product_type,
		site_location: site_location,
		title: $(el).parents(".contact_from").find("select[name='title']").val(),
		country: $(el).parents(".contact_from").find("select[name='country']").val(),
		customer_name: $(el).parents(".contact_from").find("input[name='name']").val(),
		phone: $(el).parents(".contact_from").find("input[name='phone']").val(),
		company: $(el).parents(".contact_from").find("input[name='company']").val(),
		email: $(el).parents(".contact_from").find("input[name='email']").val(),
		whatsapp: $(el).parents(".contact_from").find("input[name='whatsapp']").val(),
		facebook: $(el).parents(".contact_from").find("input[name='facebook']").val(),
		select_time: $(el).parents(".contact_from").find("select[name='select_time']").val(),
		comment: $(el).parents(".contact_from").find("input[name='comment']").val() || $(el).parents(".contact_from").find("textarea[name='comment']").val(),
		source: $(el).parents(".contact_from").find('input:radio[name="source"]:checked').val(),
		url: location.href,

		product_id: $(el).parents(".contact_from").find("input[name='product_id']").val() || 0,
		product_name: $(el).parents(".contact_from").find("input[name='product_name']").val(),
		product_code: $(el).parents(".contact_from").find("input[name='product_code']").val(),
		product_spec: $(el).parents(".contact_from").find("input[name='product_spec']").val(),
		product_price: $(el).parents(".contact_from").find("input[name='product_price']").val(),
		addr: $(el).parents(".contact_from").find("input[name='addr']").val(),
		gRNAs: gRNAs,
	}
	$.ajax({
	  url: "/api/product/record",
	  type: 'post',
	  contentType: "application/json;charset=UTF-8",
	  dataType: "json",
	  data: JSON.stringify(data),
	  success: (data) =&gt; { 
		  if (data.status == "000000"){
			$(el).parents(".contact_from").find("input[type='text']").val("")
			$(el).parents(".contact_from").find("input[type='radio']").attr("checked", false)
			$(el).parents(".contact_from").find("input[type='select']").val("")
			$(el).parents(".contact_from").find("textarea").val("")
			$(el).parents(".contact_from").siblings(".close_btn").click();
			// Google 点击表单转化
			// gtag_report_conversion();
			// prompt_box("success", 'Success', 'Our specialist will contact you within 24 hours. If you could not receive our follow-up emails, please kindly check with your SPAM folder.', "en")
			// window.location.href = "/about/thanks/index.html"
			let a = document.createElement('a');
			a.setAttribute('href', "/about/thanks/index.html");
			document.body.appendChild(a);
			a.click()
			a.remove()

		  }else if (data.status == "002005"){
			showTips('Has been submitted');
		  }else{
		  	showTips('Params error');
		  }
	  },
	  error: err =&gt; console.log(err)
	});
}


function send_contact_submit(el){
	let site_location = ""
	site_location = site_location || ($(el).parents(".page-l").length &gt; 0 ? "sitebar" : "")
	site_location = site_location || ($(el).parents("#Navright").length &gt; 0 ? "navright" : "")
	site_location = site_location || ($(el).parents(".page-r").length &gt; 0 ? "content" : "")  // 服务页
	site_location = site_location || ($(el).parents(".content_contact_us").length &gt; 0 ? "content" : "") // 活动页
	site_location = site_location || ($(el).parents(".service-con").length &gt; 0 ? "content" : "") // 手机服务页
	site_location = site_location || ($(el).parents(".article-con").length &gt; 0 ? "content" : "") // 手机活动页

	let gRNAs = ""
	$(el).parents(".contact_from").find("input[name='gRNAs']:checked").each((index, el) =&gt; {
		gRNAs += $(el).val() + ","
	})

	let cate1_id = $(el).parents(".contact_from").find("input[name='cate1_id']").val()

	product_type = "3"
	if (cate1_id){
		product_type = "2"
		if (cate1_id == 2){
			product_type = "1"
		}
	}
	
	let data = {
		product_type: product_type,
		site_location: site_location,
		title: $(el).parents(".contact_from").find("select[name='title']").val(),
		country: $(el).parents(".contact_from").find("select[name='country']").val(),
		customer_name: $(el).parents(".contact_from").find("input[name='name']").val(),
		phone: $(el).parents(".contact_from").find("input[name='phone']").val(),
		company: $(el).parents(".contact_from").find("input[name='company']").val(),
		email: $(el).parents(".contact_from").find("input[name='email']").val(),
		whatsapp: $(el).parents(".contact_from").find("input[name='whatsapp']").val(),
		facebook: $(el).parents(".contact_from").find("input[name='skype']").val(),
		comment: $(el).parents(".contact_from").find("input[name='comment']").val() || $(el).parents(".contact_from").find("textarea[name='comment']").val(),
		select_time: $(el).parents(".contact_from").find("select[name='plan']").val(),
		source: $(el).parents(".contact_from").find("select[name='source']").val(),
		url: location.href,

		product_id: $(el).parents(".contact_from").find("input[name='product_id']").val() || 0,
		product_name: $(el).parents(".contact_from").find("input[name='product_name']").val(),
		product_code: $(el).parents(".contact_from").find("input[name='product_code']").val(),
		product_spec: $(el).parents(".contact_from").find("input[name='product_spec']").val(),
		product_price: $(el).parents(".contact_from").find("input[name='product_price']").val(),
		addr: $(el).parents(".contact_from").find("input[name='addr']").val(),
		gRNAs: gRNAs,
	}
	$.ajax({
	  url: "/api/product/record",
	  type: 'post',
	  contentType: "application/json;charset=UTF-8",
	  dataType: "json",
	  data: JSON.stringify(data),
	  success: (data) =&gt; { 
		  if (data.status == "000000"){
			$(el).parents(".contact_from").find("input[type='text']").val("")
			$(el).parents(".contact_from").find("input[type='radio']").attr("checked", false)
			$(el).parents(".contact_from").find("input[type='select']").val("")
			$(el).parents(".contact_from").find("textarea").val("")
			$(el).parents(".contact_from").siblings(".close_btn").click();
			// Google 点击表单转化
			// gtag_report_conversion();
			// prompt_box("success", 'Success', 'Our specialist will contact you within 24 hours. If you could not receive our follow-up emails, please kindly check with your SPAM folder.', "en")
			// window.location.href = "/about/thanks/index.html"
			$("#mask_contact").hide();
			// $("#mask_contact_result").show();
			window.location.href = "/about/thanks/index.html"

		  }else if (data.status == "002005"){
			showTips('Has been submitted');
		  }else{
		  	showTips('Params error');
		  }
	  },
	  error: err =&gt; console.log(err)
	});
}

// 200种成功细胞列表更新
function update_cell_lines(el){
	let lang = location.href.includes("ubigene.us") ? "en" : "zh"
	$.ajax({
	  url: "/api/common/cells",
	  type: 'get',
	  contentType: "application/json;charset=UTF-8",
	  dataType: "json",
	  success: (data) =&gt; { 
		  if (data.status == "000000"){
			  let html = ""
			  for (cate of Object.values(data.data)){
				  let url = cate.icon_url;
				  let cate_name = lang === "en" ? cate.cate_name_en : cate.cate_name;
				  if (cate_name === ""){
					  continue
				  }
				  let item = `&lt;div class="inner_100_sorce"&gt;&lt;span class="table1_span"&gt;&lt;img src="${url}"&gt;&amp;nbsp;&amp;nbsp;${cate_name}&lt;/span&gt;&lt;div class="con"&gt;`
				  for (let cell of cate.cell_lines){
					  let name = lang === "en" ? cell.cell_name_en : cell.cell_name;
					  item += `&lt;span&gt;${name}(${cell.cell_line})&lt;/span&gt;`
				  }
				  item += "&lt;/div&gt;&lt;/div&gt;"
				  html += item
			  }
			  $(el).html(html)
		  }
	  },
	  error: err =&gt; console.log(err)
	});
}

function toTop(){
	console.log("aaa")
    var top = document.body.scrollTop || document.documentElement.scrollTop
                scrollBy(0,-top);
}

// 联系我们锚点链接重写
$("a[href='#contact_us']").click(function(event){
	event.preventDefault();
	document.querySelector("#contact_us").scrollIntoView(false);
})


// 通用图片点击放大预览
$("body").on("click", ".g_zoom_img", function(){
	let src = ""
	if (this.tagName === "IMG"){
		src = $(this).attr("src")
	}else{
		src = $(this).find("img").attr("src")
	}
	
	if ($(".g_fixed_zoom_img").length === 0){
		$("body").append(`&lt;div class="g_fixed_zoom_img" onclick="$(this).hide()" style="display: none;"&gt;&lt;div&gt;&lt;img src="" alt=""&gt;&lt;/div&gt;&lt;/div&gt;`)
	}
	
	$(".g_fixed_zoom_img").find("img").attr("src", src)
	$(".g_fixed_zoom_img").show()
})




$(function(){
	// 联系我们文字修改
	$("#Navright .right-duihuakuang&gt;p").html("Back-to-school &lt;br&gt; SALES")
	
	// 多页面KO细胞数量修改
	$(".ko_cells_num").text(ko_cells_num)

	// 图片懒加载 只处理img标签包含data-src属性的
	for (let element of document.querySelectorAll('img[data-src]')){
		lazy_load_observer.observe(element);
	}

	// 菜单和页脚添加细胞数量跑秒
	for (let element of document.querySelectorAll(".cell_line_num")){
		add_num_observer.observe(element);
	}

	// 背景图片自动设置高度
    $(".auto_height").each(function(){
        set_height(this)
    })
	
	
	// 表单添加事件
	$("body").on("change", ".contact_from .from_item input[type='text'],textarea", function(){
		verify_field(this)
	})
	
	// 200种成功细胞列表更新
	let inner_100 = $("#table1 .flixe_body")
	$("#table1").hide()
	if (inner_100.length &gt; 0){
		update_cell_lines(inner_100[0])
	}
	
	// 通用点击展开  元素添加  class='c_fold' data-text='...点击展开'
	$("body").on("click", ".c_fold" ,function(){
		$(this).toggleClass("c_fold_toggle");
		$(this).attr('data-text', ['...More detail', 'close'][$(this).parent().find('.c_fold_toggle').length])
		
	})

	// 导航栏固定
	$(window).scroll(() =&gt;{
		let s = $(window).scrollTop()
		if (s &gt; 100) {
			$('.nav-box-all').css({"position": "fixed", "top": 0})
			$('.nav-two-all').css({"top": '45px'})
		} else {
			$('.nav-box-all').css({"position": "unset", "top": '30%'})
			$('.nav-two-all').css({"top": '130px'})
		}
	})
	
})



// 获取最新活动信息
function get_latest_activity(aid) {
	if (aid == 5483) {
		return;
	}
	let url = "http://192.168.1.196:5000/api/market/tools/get_activity";
	url = "/api/market/tools/get_activity";
	$.ajax(url, {
		method: "GET",
		data: {
			lang: "en",
			aid: aid
		},
		success: function (result) {
			console.log("*-- 请求结果: ", result);
			if (result.status === "000000") {
				handle_activity_data(result.data);
			}
		},
		error: function (error) {
			console.log("*-- error: ", error);
		}
	});
}

function handle_activity_data(activitys) {
	let current = activitys.current;
	let latest = activitys.latest;
	let now = new Date();

	let current_expired = false;
	// 判断当前活动是否已过期
	let current_promotion_time = current.mytime.split("-");
	if (current_promotion_time.length &gt;= 2) {
		current_promotion_time = new Date(current_promotion_time[1]);
		if (current_promotion_time &lt; now) {
			current_expired = true;
		}
	}

	// 当前活动未过期
	if (!current_expired) {
		return;
	}

	// 当前活动已过期，判断当前是否为最新活动
	let current_promotion_id = current.aid;
	let latest_promotion_id = latest.aid;
	if (current_promotion_id == latest_promotion_id) {
		return;
	}

	// 判断最新活动是否已过期
	let latest_expired = false;
	let latest_promotion_time = latest.mytime.split("-");
	if (latest_promotion_time.length &gt;= 2) {
		latest_promotion_time = new Date(latest_promotion_time[1]);
		if (latest_promotion_time &lt; now) {
			latest_expired = true;
		}
	}
	
	let href = latest.href;
	load_expired_model(href, latest_expired ? 'no_latest' : 'has_latest');
}

function load_expired_model(href, has_latest) {
	let model = `
	&lt;div class="pop_up"&gt;
		&lt;div class="title"&gt;This Promotion Has Expired&lt;/div&gt;
		&lt;div class="desc"&gt;
			We regret to inform you that this promotion is no longer available. Feel free to contact us for more information on upcoming events.&lt;br&gt;
			Thank you for your understanding!
		&lt;/div&gt;
		&lt;div class="btns"&gt;
			&lt;div class="${has_latest}"&gt;&lt;a href="${href}" class="confirm"&gt;Explore Current Promotions&lt;/a&gt;&lt;/div&gt;
			&lt;div&gt;&lt;a href="javascript:;" class="close" onclick="expired_model_close(this)"&gt;Close&lt;/a&gt;&lt;/div&gt;
		&lt;/div&gt;
	&lt;/div&gt;`;

	$(".expired_model").append(model);
	$(".expired_model").show();
}

function expired_model_close(el) {
	$(".expired_model").hide();
}


// 侧边栏源井拖拽
$(function () {
	$("#draggable_nav_box").draggable();
});



</pre></body></html>