var Coupon = new Vue({ el: "#quan", data: { duihuanList: [], duihuanListTrans: [], nicknames: [], time: [], couponId: 0, quan: [] }, created: function() { this.fetchChangeProduct() //,this.getCouponRecommond() }, mounted: function() { /* new Swiper(".swiper-container", { direction: "horizontal", paginationClickable: !0, pagination: { el: ".swiper-pagination" } }); */ var n = 1.5 * document.documentElement.clientHeight; $("#briefInfo").css("height", n), $("#expandMore").click(function() { $("#briefInfo").css({ height: "auto", overflow: "none" }), $("#expandMore").toggle() }), Util.backToTopInit("0.2rem", "1.76rem", "商品详情页:点击:回到顶部") }, methods: { getCouponRecommond: function() { var n = this; n.couponId = $("#shopId").val(), axios.get("json/more.json?couponId=" + n.couponId).then(function(t) { t.data && (n.quan = t.data.coupon_list || [], setTimeout(function() { Util.getChannel() }, 0)) }). catch (function(t) { n.loading = 0, alert("网络错误,请稍后再试") }) }, fetchChangeProduct: function() { //this.getChangeProduct() }, getChangeProduct: function() { var n = this; axios.get("json/user.json?item_id=" + $("#itemId").val()).then(function(t) { for (var e = t.data.data.apply_list ? t.data.data.apply_list : [], a = 0; a < e.length; a++) { var o, i = t.data.timestamp - e[a].dateline, u = new Date(1e3 * i).format("ss"); o = u <= 0 ? "刚刚" : u < 60 ? u + "秒前" : u < 120 ? "1分钟前" : u < 180 ? "2分钟前" : u < 300 ? "3分钟前" : u < 600 ? "5分钟前" : "10分钟前", n.duihuanList.push({ taobao_nickname: e[a].taobao_nickname, time: o }) } var c = 0; 0 != e.length && setTimeout(function() { c = setInterval(function() { n.duihuanListTrans = [], n.duihuanListTrans.push(n.duihuanList[0]), n.duihuanList.splice(0, 1), 0 === n.duihuanList.length && clearInterval(c) }, 2e3) }, 1e3) }). catch (function(n) { console.log(n) }) } } });