parseInt(new date()/1000)
//时间格式化函数,此处仅针对yyyy-MM-dd hh:mm:ss 的格式进行格式化
dateFormat:function(time) {
if(time.length != 13)
{
time = time1000
}
var date=new Date(time);
var year=date.getFullYear();
/ 在日期格式中,月份是从0开始的,因此要加0
* 使用三元表达式在小于10的前面加0,以达到格式统一 如 09:11:05
* */
var month= date.getMonth()+1<10 ? "0"+(date.getMonth()+1) : date.getMonth()+1;
var day=date.getDate()<10 ? "0"+date.getDate() : date.getDate();
var hours=date.getHours()<10 ? "0"+date.getHours() : date.getHours();
var minutes=date.getMinutes()<10 ? "0"+date.getMinutes() : date.getMinutes();
var seconds=date.getSeconds()<10 ? "0"+date.getSeconds() : date.getSeconds();
// 拼接
return year+"-"+month+"-"+day+" "+hours+":"+minutes+":"+seconds;
}
=====================================
$zip =new \ZipArchive;
\ZipArchive::OVERWRITE
模板字符串解析 反引号
//M("order")->getLastSql()
$map = array(
'chanpinleixing' => array('in', $designerInfo['newuserauthchanpin']),
'zhidingshejishi' => ''
);
================================================
$res_userinfo_with_auth = M('User')->where($where)->join('erp_auth_designer ON erp_user.authfk = erp_auth_designer.id')->find();
截取字符串,splice split (session_start(header))
监听回车事件(vue)
<td><input @keyup.enter="login" v-model="password" id="operatorPass" type="password" class="z-w300 input" placeholder="密码" value="" maxlength="16" spellcheck="false" autocomplete="off"></td>
vue ajax 需要保存引用,this的引用已经改变(逻辑错误)
================================
newuserauthchanpin:function(){
let temp = this.olduserauthchanpin.split('---')
temp.splice(0,1)
return temp
}
newzhidingshejishi(item){
return item.zhidingshejishi == ""?"可抢单":item.zhidingshejishi
},
```\
:value="item.dingdanhao"
{{ }} :
==================================
function timestampToTime(timestamp) {
var date = new Date(timestamp * 1000);//时间戳为10位需*1000,时间戳为13位的话不需乘1000
Y = date.getFullYear() + '-';
M = (date.getMonth()+1 < 10 ? '0'+(date.getMonth()+1) : date.getMonth()+1) + '-';
D = date.getDate() + ' ';
h = date.getHours() + ':';
m = date.getMinutes() + ':';
s = date.getSeconds();
return Y+M+D+h+m+s;
}
<Page @on-change="handleChange" prev-text="上一页" next-text="下一页" show-total :total="100" />
</div>
handleChange (page) {
alert(page)
},
通过回调的方式(传值)来获取页码
$sql = "select * from emp limit ".($pageNow - 1)*$pageSize.",$pageSize";
分页注意,向上取整与减一
:total="parseInt(totalpage)"
==========================================================
<td>{{newzhidingshejishi(item)}}</td>
<td>{{newjiandanshijian(item)}}</td>
<td><span :style="item.youxianji=='加急'?'color:red;':''">
其实可以这样写
splice 参数(起始位置,数量)
contat 返回值(新数组)
网友评论