排序,splice会改变数组长度,for循环不好使,splice不会改变数组长度,但是第二个参数要求是下标--
var temparrarr1 = []
var temparrarr2 = []
temparrarr1 = this.recOrderInfo.filter(function (item) {
return item.youxianji.match(/加急/)
})
temparrarr2 = this.recOrderInfo.filter(function (item) {
return !item.youxianji.match(/加急/)
})
this.recOrderInfo = temparrarr2.concat(temparrarr1)
==================================
statuscolor (dinganzhuangtai) {
if(dinganzhuangtai == "等待设计")
{
return "z-green"
}
else if(dinganzhuangtai == "正在设计"){
return "z-blue"
}
else if(dinganzhuangtai == "已出初稿"){
return "z-red"
}
},
==================================
this.timer = setInterval(function(){
for (let i =0; i < sumContainerdesignOrderSSS.recOrderInfo.length; i++) {
let a = sumContainerdesignOrderSSS.recOrderInfo[i]
let b = Math.round(new Date() / 1000)//目前时间
let seconds = Number(a.jiezhishijian) - Number(b)//总秒数
let day = parseInt( seconds / 86400 );
let hour = parseInt( seconds % 86400 / 3600 )
let minute = parseInt( seconds % 86400 % 3600 / 60 )
let mydaojishi = `${day}天${hour}小时${minute}分钟`
Vue.set(sumContainerdesignOrderSSS.recOrderInfo[i],"daojishi",mydaojishi)
}
}, 5000 );
//倒计时//倒计时//倒计时//倒计时//倒计时
},
beforeDestroy() {
if(this.timer)
{ //如果定时器还在运行 或者直接关闭,不用判断
clearInterval(this.timer); //关闭
}
}
=================================
totalfee:function ()
{
var tempfee = 0;
for (var i = this.recOrderInfo.length - 1; i >= 0; i--)
{ tempfee
var tempfee = Number(tempfee) + Number(this.recOrderInfo[i].jine)
}
return tempfee
}
事先声明为整数,数字,否则为NAN,let出了括号不能用
number
======================================================
type="number" oninput="if(value.length>11) value=value.slice(0,11)"
this.timer = setInterval(function(){
$.ajax({
url:"<?php echo U('home/Order/pullDesignerOrder');?>",
type:"post",
data:{
requestInfo:{
info:"give me order"
}
},
dataType:"json",
success:function(res){
if(res.errno==0){
document.getElementById("texttexttext").click();
var audio =document.querySelector('#audio');
audio.play();
}
else if(res.errno==1){
console.log(res.errmsg);
}else{
console.log(res.errmsg);
}
},
error:function(){
alert("请求失败");
}
})
}, 60000 );
===============================
tp3 会先 show column
过滤不存在的查询字段
所以看到查询字段不出现,多半是字段不存在
<script type="x-template" id="dddaaasss">
<div>
<Button type="primary" @click="modal1 = true">Display dialog box</Button>
<Modal
v-model="modal1"
title="Common Modal dialog box title"
@on-ok="ok"
@on-cancel="cancel">
<p>Content of dialog</p>
<p>Content of dialog</p>
<p>Content of dialog</p>
</Modal>
</div>
</script>
写js的html模板但是又不会被解析的办法
“推荐第四种写法,x-template”
<if condition="$Think.session.userInfo.usertype eq 1 ">style="display:none;"</if>
tp3.2的条件渲染 v-if v-else
displaynone 和 visibility 要直接加在tr上,外面包的div不起作用
linux严格区分文件大小写,windows不是
tp3 api tp5 api
统计数组内出现的次数
splice
split
replace
search
``
v-model
================
$begindate = date("Y-m-d H:i:s",mktime(0, 0 , 0,date("m"),1,date("Y")));
$enddate = date("Y-m-d H:i:s",mktime(23,59,59,date("m"),date("t"),date("Y")));