Welcom to 评论 - lizhenqiu blog!
#666
#667
<style>.parent { text-align:center; margin:0 auto; width:200px; height:200px; background:red; } .children { positiona;absolute; margin-top:75px; width:50px; height:50px; background: black; display:inline-block;/*使其父元素text-align生效*/ }</style><div class="parent"> <div class="children"></div> </div>
<style> img{ -webkit-filter: grayscale(100%); -moz-filter: grayscale(100%); -ms-filter: grayscale(100%); -o-filter: grayscale(100%); filter: grayscale(100%); filter: gray;} img:hover{-webkit-filter: grayscale(0); -moz-filter: grayscale(0); -ms-filter: grayscale(0); -o-filter: grayscale(0); filter: grayscale(0); filter: gray(0); } </style> <img src="VCG21gic16069628.jpg">
#668
#669
#670
<a href = "javascript:alert(22);">点我</a>
href="javascript:;"
view-source:URL
nofollow有两种用法: 1.用于meta元标签:<meta name="robots" content="nofollow" />,告诉爬虫该页面上所有链接都无需追踪。 2.用于a标签:<a href="login.aspx" rel="nofollow">登录</a>,告诉爬虫该页面无需追踪。
#671
<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title></title> <style> #box div{ width: 80px; display: inline-block; background-color: gray; } #box div span{ display: block; line-height: 30px; color: pink; background-color:black; margin-right: 2px; text-align: center; } </style> </head> <body> <div id="box"> <!--<div> <span> 1 X 1 = 1 </span> <span> 1 X 2 = 2 </span> <span> 1 X 3 = 3 </span> <span> 1 X 4 = 4 </span> <span> 1 X 5 = 5 </span> <span> 1 X 6 = 6 </span> <span> 1 X 7 = 7 </span> <span> 1 X 8 = 8 </span> <span> 1 X 9 = 9 </span> <span> 1 X 10 = 10 </span> </div> <div> <span> 2 X 2 = 4 </span> <span> 2 X 3 = 6 </span> <span> 2 X 4 = 8 </span> <span> 2 X 5 = 10 </span> <span> 2 X 6 = 12 </span> <span> 2 X 7 = 14 </span> <span> 2 X 8 = 16</span> <span> 2 X 9 = 18 </span> <span> 2 X 10 = 20 </span> </div> ......--> </div> <script> var box = document.getElementById('box') var str = '' //i是列数j是乘号后面的数,是第几列,成号后面的数就是几开始 for( var i = 1; i < 10; i ++){ str += '<div>' //console.log(str) for( var j = i; j < 10; j ++){ var n = i + 'X' + j + '=' + i*j str += '<span>' + n + '</span>' } str += '</div>' } box.innerHTML = str </script> </body> </html>
<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title></title> <style > #box div{ color: deeppink; } #box div span{ padding: 5px; line-height: 20px; width: 70px; display: inline-block; border:1px solid peru; background-color: goldenrod; } </style> </head> <body> <div id="box"> <!--<div> <span> 1 X 1 = 1 </span> <span> 1 X 2 = 2 </span> <span> 1 X 3 = 3 </span> <span> 1 X 4 = 4 </span> <span> 1 X 5 = 5 </span> <span> 1 X 6 = 6 </span> <span> 1 X 7 = 7 </span> <span> 1 X 8 = 8 </span> <span> 1 X 9 = 9 </span> <span> 1 X 10 = 10 </span> </div> <div> <span> 2 X 2 = 4 </span> <span> 2 X 3 = 6 </span> <span> 2 X 4 = 8 </span> <span> 2 X 5 = 10 </span> <span> 2 X 6 = 12 </span> <span> 2 X 7 = 14 </span> <span> 2 X 8 = 16</span> <span> 2 X 9 = 18 </span> <span> 2 X 10 = 20 </span> </div> ......--> </div> <script> var box = document.getElementById('box') var str = '' //i为行,j为列 for( var i = 1; i < 10; i ++){ str += '<div>' //console.log(str) for( var j = 1; j <= i ; j ++ ){ var n = j + 'X' + i + '=' + j*i str += '<span>' + n + '</span>' } str += '</div>' } box.innerHTML = str </script> </body> </html>
<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title></title> <style> div{ width: 80px; height: 30px; background: #ADFF2F; text-align: center; line-height: 30px; font-size: 20px; color: #FF0000; position: absolute; } </style> </head> <body> </body> <script> var stt=[one,two,three,four]; num =0; document.onclick = function(){ stt[num](); num++; num%=stt.length; }; //第一种 function one(){ var str =''; for(var i=1;i<10;i++){ for(var j=i;j<10;j++){ str +='<div style="left:'+(i-1)*90+'px;top:'+(j-1)*40+'px;">'+i+'X'+j+'='+i*j+'</div>'; } } document.body.innerHTML = str; } //第二种 ////////好别扭 function two(){ var str =''; for(var i=9;i>0;i--){ for(var j=i;j>0;j--){ str +='<div style="left:'+(9-i)*90+'px;top:'+(i-j)*40+'px;">'+i+'X'+j+'='+i*j+'</div>'; } } document.body.innerHTML = str; } //第三种 function three(){ var str =''; for(var i=1;i<10;i++){ for(var j=i;j<10;j++){ str +='<div style="left:'+(9-i)*90+'px;top:'+(j-1)*40+'px;">'+i+'X'+j+'='+i*j+'</div>'; } } document.body.innerHTML = str; } //第四种 function four(){ var str=''; for(var i=1;i<10;i++){ for(var j=9;j>i-1;j--){ str +='<div style="left:'+(i-1)*90+'px;top:'+(9-j)*40+'px;">'+i+'X'+j+'='+i*j+'</div>'; } } document.body.innerHTML = str; } /* 因为i<10是一个判断条件,则一直加的话最后数字只能到9 因为j>i-1也是一个判断,而j最大值也是9 所以到最后就会出现9 X 9 */ </script> </html>
#672
#673
Options +FollowSymlinks RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^(.*)$ index.php/$1 [QSA,PT,L]
#674
<!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>垂直居中Demo</title> <style> #container{ height:300px; background:#d6d6d6; display: -webkit-box; display: -moz-box; display: -ms-flexbox; display: -webkit-flex; display: flex; justify-content:center; align-items: center; } #center{ width:100px; height:100px; background-color:#666; color:#fff; font-weight:bold; font-size:18px; display:flex; /*这个写在这只是为了#center这几个字的垂直居中*/ justify-content:center; align-items: center; } </style> </head> <body> <div id='container'> <div id = 'center'>#center</div> </div> </body> </html>
#675
<style> .prm { width:300px; height:300px; background:green; display:table-cell; text-align:center; vertical-align:middle; } </style> <div class="pr" style="display:none"> <p class="c">单行居中 单行居中</p> </div> <div class="prm"> <p class="c"> 多行垂直居中 多行垂直居中 多行垂直居中 多行垂直居中 多行垂直居中 多行垂直居中 多行垂直居中 多行垂直居中 多行垂直居中 多行垂直居中 多行垂直居中 多行垂直居中 多行垂直居中 多行垂直居中 多行垂直居中 多行垂直居中 多行垂直居中 多行垂直居中 多行垂直居中 多行垂直居中 多行垂直居中 多行垂直居中 多行垂直居中 多行垂直居中 多行垂直居中 多行垂直居中 多行垂直居中 </p> </div>
#676
Windows Registry Editor Version 5.00 [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols] [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\Multi-Protocol Unified Hello] [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\Multi-Protocol Unified Hello\Client] "Enabled"=dword:00000000 "DisabledByDefault"=dword:00000001 [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\Multi-Protocol Unified Hello\Server] "Enabled"=dword:00000000 "DisabledByDefault"=dword:00000001 [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\PCT 1.0] [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\PCT 1.0\Client] "Enabled"=dword:00000000 "DisabledByDefault"=dword:00000001 [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\PCT 1.0\Server] "Enabled"=dword:00000000 "DisabledByDefault"=dword:00000001 [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\SSL 2.0] [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\SSL 2.0\Client] "DisabledByDefault"=dword:00000001 "Enabled"=dword:00000000 [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\SSL 2.0\Server] "Enabled"=dword:00000000 "DisabledByDefault"=dword:00000001 [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\SSL 3.0] [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\SSL 3.0\Client] "Enabled"=dword:00000000 "DisabledByDefault"=dword:00000001 [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\SSL 3.0\Server] "Enabled"=dword:00000000 "DisabledByDefault"=dword:00000001 [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.0] [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.0\Client] "Enabled"=dword:00000001 "DisabledByDefault"=dword:00000000 [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.0\Server] "Enabled"=dword:00000001 "DisabledByDefault"=dword:00000000 [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.1] [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.1\Client] "DisabledByDefault"=dword:00000000 "Enabled"=dword:00000001 [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.1\Server] "DisabledByDefault"=dword:00000000 "Enabled"=dword:00000001 [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.2] [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.2\Client] "DisabledByDefault"=dword:00000000 "Enabled"=dword:00000001 [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.2\Server] "Enabled"=dword:00000001 "DisabledByDefault"=dword:00000000
#677
var App = getApp(); // pages/about/about.js Page({ /** * 页面的初始数据 */ data: { "content": '广西南宁共振广告有限公司,2008年成立于南宁,是一家以“品牌咨询+品牌设计+品牌策划+品牌落地”于一体的品牌服务平台,通过360°全景式纵深品牌打造,从品牌标识设计、VI设计、空间设计、包装、海报等多维度构建完善的品牌价值链,致力于以实战服务中国企业,以品牌推动中国成长。公司创立至今,已是当之无愧的品牌实战专家,客户涵盖国内外地产、金融、IT、汽车、服装时尚、奢侈品、能源、机械、快速消费品等各行业著名的企业,深受客户信赖。我们坚持以实力深耕市场,力求达成艺术与商业之间、客户与市场之间、虚拟与现实之间的价值共生,将企业打造成为一个能为客户提供综合化', "content2": '更换内容21321', "content3": '2222222222222更换内容21321', radioCheckVal: 0, all: [{ one: "公司介绍", two: '../../images/ab2.gif', two1: '../../images/ab5.gif' }, { one: "公司理念", two: '../../images/ab3.gif', two1: '../../images/ab4.gif' }, { one: "核心优势", two: '../../images/ab4.gif', two1: '../../images/ab3.gif' }, { one: "公司使命", two: '../../images/ab5.gif', two1: '../../images/ab2.gif' }], oall:{ } }, /** * 生命周期函数--监听页面加载 */ onLoad: function (options) { App.editTabBar(this); this.setData({ "oall": this.data.all })//保存初始图片数据 2018.01.05 }, /** * 生命周期函数--监听页面初次渲染完成 */ onReady: function () { }, /** * 生命周期函数--监听页面显示 */ onShow: function () { }, /** * 生命周期函数--监听页面隐藏 */ onHide: function () { }, /** * 生命周期函数--监听页面卸载 */ onUnload: function () { }, /** * 页面相关事件处理函数--监听用户下拉动作 */ onPullDownRefresh: function () { }, /** * 页面上拉触底事件的处理函数 */ onReachBottom: function () { }, /** * 用户点击右上角分享 */ onShareAppMessage: function () { }, //更换内容 getnewcontent:function(n){ var cc = (n.currentTarget.dataset.c); var ncc ='content'+cc; // var adata =''; var id = n.currentTarget.dataset.id; //打印可以看到,此处已获取到了包含id、title、和content的对象 var that = this; //var two = all[id].two = all[id].two1; this.setData({ "all":this.data.oall },function(){ that.data.all[id].two = that.data.all[id].two1; //console.log(that.data.all); var all = that.data.all; that.setData({ "content": that.data[ncc], "all": all, "id": id }) }); } })
<!-------------banner 开始--------------> <image style='width:100%;' src='../../images/ab0.png' mode="widthFix" ></image> <!-------------banner 结束--------------> <view class="about" style="background:url('https://hhh.liangtianmei.com/images/bjjj.png');"> <!-------------标题 开始--------------> <view class='title'> <view class='zuo'> <view class='xian'></view> <view class='yuan'>●</view> </view> <view class='wz'> <text class='yw'>ABOUT SU\n</text> <text class='zw'>关于我们\n</text> </view> <view class='you'> <view class='yuan'>●</view> <view class='xian'></view> </view> </view> <!-------------标题 结束--------------> <!-------------导航 开始--------------> <view class='nav'> <view class='meiyi'> <block wx:for="{{all}}"> <view class="dg" bindtap="getnewcontent" data-id="{{index}}" data-c='{{index+1}}' style="{{index == id?' border:1rpx solid red':'border:1rpx solid gainsboro;'}}"> <image src="{{item.two}}" mode="widthFix" data-index="{{index}}"></image> <text>{{item.one}}</text> </view> </block> <!-- <view class='dg' bindtap="getnewcontent" data-c='2'> <image src='../../images/ab2.gif' mode="widthFix"></image>\r\n <text>公司介绍</text> </view> <view class='dg' bindtap="getnewcontent" data-c='3'> <image src='../../images/ab3.gif' mode="widthFix"></image>\r\n <text>公司理念</text> </view> <view class='dg'> <image src='../../images/ab4.gif' mode="widthFix"></image>\r\n <text>核心优势</text> </view> <view class='dg'> <image src='../../images/ab5.gif' mode="widthFix"></image>\r\n <text>公司使命</text> </view>--> </view> </view> <!-------------导航 结束--------------> <!-------------图文 开始--------------> <view class='nr'> <image src='../../images/ab1.png' mode="widthFix"></image> <text>{{content}}</text> </view> <!-------------图文 结束--------------> </view> <import src="../template/tabBar.wxml" /> <template is="tabBar" data="{{tabBar: tabBar}}" />
getnewcontent:function(n){ var cc = (n.currentTarget.dataset.c); var ncc ='content'+cc; var id = n.currentTarget.dataset.id; this.setData({ "content": this.data[ncc], id:id }) } <block wx:for="{{all}}"> <view class='dg' data-id="{{index}}" bindtap="getnewcontent" data-c='{{index+1}}'> <block wx:if="{{index==id}}"> <image src='{{item.two1}}' mode="widthFix"></image>\r\n </飙泪ock> <block wx:else> <image src='{{item.two}}' mode="widthFix"></image>\r\n </飙泪ock> <text>{{item.one}}</text> <iew> </飙泪ock>
#678
https://www.random.org/integers/?num=1&min=100000&max=999999&col=1&base=10&format=plain&rnd=new
#679
<template name="tabBar"> <view class="flex-h flex-hsb tab-bar" style="color: {{tabBar.color}}; background: {{tarBar.backgroundColor}}; {{tabBar.position=='top'? 'top: 0' : 'bottom: 0'}}; {{tabBar.borderStyle? (tabBar.position=='top'? 'border-bottom: solid 1px '+tabBar.borderStyle + ';' : 'border-top: solid 1px '+tabBar.borderStyle + ';') : ''}}"> <block wx:for="{{tabBar.list}}" wx:key="pagePath"> <navigator url="{{item.pagePath}}" open-type="redirect" class="menu-item" style="{{item.active? 'color: '+(item.selectedColor? item.selectedColor : tabBar.selectedColor) : ''}}"> <image src="{{item.selectedIconPath}}" wx:if="{{item.active}}"></image> <image src="{{item.iconPath}}" wx:if="{{!item.active}}"></image> <text style="color:{{item.selectedColor}}" wx:if="{{item.active}}">{{item.text}}</text> <text style="color:{{item.color}}" wx:if="{{!item.active}}">{{item.text}}</text> </navigator> </block> </view> </template>
#680
// pages/about/about.js Page({ /** * 页面的初始数据 */ data: { "content": '广西南宁共振广告有限公司,2008年成立于南宁,是一家以“品牌咨询+品牌设计+品牌策划+品牌落地”于一体的品牌服务平台,通过360°全景式纵深品牌打造,从品牌标识设计、VI设计、空间设计、包装、海报等多维度构建完善的品牌价值链,致力于以实战服务中国企业,以品牌推动中国成长。公司创立至今,已是当之无愧的品牌实战专家,客户涵盖国内外地产、金融、IT、汽车、服装时尚、奢侈品、能源、机械、快速消费品等各行业著名的企业,深受客户信赖。我们坚持以实力深耕市场,力求达成艺术与商业之间、客户与市场之间、虚拟与现实之间的价值共生,将企业打造成为一个能为客户提供综合化', "content2": '更换内容21321', "content3": '2222222222222更换内容21321' }, /** * 生命周期函数--监听页面加载 */ onLoad: function (options) { }, /** * 生命周期函数--监听页面初次渲染完成 */ onReady: function () { }, /** * 生命周期函数--监听页面显示 */ onShow: function () { }, /** * 生命周期函数--监听页面隐藏 */ onHide: function () { }, /** * 生命周期函数--监听页面卸载 */ onUnload: function () { }, /** * 页面相关事件处理函数--监听用户下拉动作 */ onPullDownRefresh: function () { }, /** * 页面上拉触底事件的处理函数 */ onReachBottom: function () { }, /** * 用户点击右上角分享 */ onShareAppMessage: function () { }, //更换内容 getnewcontent:function(n){ var cc = (n.currentTarget.dataset.c); var ncc ='content'+cc; console.log(ncc); this.setData({ "content": this.data[ncc], }) } })
<!-------------banner 开始--------------> <image style='width:100%;' src='../../images/ab0.png' mode="widthFix" ></image> <!-------------banner 结束--------------> <view class="about" style="background:url('https://hhh.liangtianmei.com/images/bjjj.png');"> <!-------------标题 开始--------------> <view class='title'> <view class='zuo'> <view class='xian'></view> <view class='yuan'>●</view> </view> <view class='wz'> <text class='yw'>ABOUT SU\n</text> <text class='zw'>关于我们\n</text> </view> <view class='you'> <view class='yuan'>●</view> <view class='xian'></view> </view> </view> <!-------------标题 结束--------------> <!-------------导航 开始--------------> <view class='nav'> <view class='meiyi'> <view class='dg' bindtap="getnewcontent" data-c='2'> <image src='../../images/ab2.gif' mode="widthFix"></image>\r\n <text>公司介绍</text> </view> <view class='dg'> <image src='../../images/ab3.gif' mode="widthFix"></image>\r\n <text>公司理念</text> </view> <view class='dg'> <image src='../../images/ab4.gif' mode="widthFix"></image>\r\n <text>核心优势</text> </view> <view class='dg'> <image src='../../images/ab5.gif' mode="widthFix"></image>\r\n <text>公司使命</text> </view> </view> </view> <!-------------导航 结束--------------> <!-------------图文 开始--------------> <view class='nr'> <image src='../../images/ab1.png' mode="widthFix"></image> <text>{{content}}</text> </view> <!-------------图文 结束--------------> </view>
alert(json.lastMonth[dep]);
#681
var app = getApp() //构造令牌 // 在需要使用的js文件中,导入js //var util = require('../../utils/util.js'); //构造令牌 使用服务器时间戳 var utilMd5 = require('../../utils/md5.js'); var util = require('../../utils/util.js'); var ttken = 'JLI5vvqq0KRnzfla';//密钥 var ttime = parseInt(Date.parse(new Date()) / 1000);//时间 秒 //var ttime = util.ntime(); var ntoken = ttken + ttime; var token = utilMd5.hexMD5(ntoken); //console.log(token); //end Page({ /** * 页面的初始数据 */ data: { token:0, tokenid: 0 }, onLoad: function () { //console.log('token: ' + token); var params = { 'name': 'json', 'age': 26 }; //util.makeusertoken() //初始化 验证码 util.updatenew('https://hhh.*****.com/index.php/Home/Wxapp/code/token/' + token, token,this); //获取验证码图片 var tokenid = wx.getStorageSync('tokenid'); //util.updatenew('https://hhh.*****.com/index.php/Home/Wxapp/getcode/token/' + token + '/tokenid/' + tokenid+'/'); this.setData({ token: token, tokenid:tokenid }) }, changing:function(){ util.updatenew('https://hhh.*****.com/index.php/Home/Wxapp/code/token/' + token, token, this); var tokenid = wx.getStorageSync('tokenid'); this.setData({ token: token, tokenid: tokenid }) } }) //ajax(method, url, data, success)
1.生成令牌 <image style="height:40px;width:100px;margin-top:10px;" bindtap="changing" id="codeyzmm" src="https://hhh.*****.com/index.php/Home/Wxapp/getcode/token/{{token}}/tokenid/{{tokenid}}/" ></image>
const formatTime = date => { const year = date.getFullYear() const month = date.getMonth() + 1 const day = date.getDate() const hour = date.getHours() const minute = date.getMinutes() const second = date.getSeconds() return [year, month, day].map(formatNumber).join('/') + ' ' + [hour, minute, second].map(formatNumber).join(':') } const formatNumber = n => { n = n.toString() return n[1] ? n : '0' + n } //服务器时间戳 function ntime(utilMd5, that,url){ wx.request({ url: 'https://hhh.*****.com/ntime.php',//请修改为你服务器 data: { }, header: { 'content-type': 'application/json' }, success: function (res) { //return res; var ttken = 'JLI5vvqq0KRnzfla';//密钥 //var ttime = parseInt(Date.parse(new Date()) / 1000);//时间 秒 var ttime =res.data;//util.ntime(); var ntoken = ttken + ttime; var token = utilMd5.hexMD5(ntoken); //console.log(ntoken); //return token; // var url = 'https://hhh.*****.com/index.php/Home/Product/index'; updatenew(url, token, that); } }) } //更新数据 function updatenew(url, token, that) { wx.request({ url: url,//'https://hhh.*****.com/index.php/Home/Product/index', //仅为示例,并非真实的接口地址 /*data: { token: token },*/ method: 'GET', header: { 'content-type': 'application/json' // 默认值 }, success: function (res) { // alert(res.data) // res.data.content = app.convertHtmlToText(res.content) /*that.setData({ textdata: res.data }); console.log (res.data)*/ // that.setData(res.data) /*that.setData({ all: res.data//第一个data为固定用法,第二个data是json中的data })*/ //console.log(token); //res.data.jzzz = 1; if (res.data.tokenid){ //保存token id wx.setStorageSync('tokenid', res.data.tokenid); } if (that){ that.setData(res.data) //that.setData({ //jzzz:1, //jzzzs:'', //codeimgurl: res.data.codeimgurl, //all: res.data //res // imageUrl: "../images/sp_07.png"//触发事件时的图片 //}) } } }) } //构造令牌 // 在需要使用的js文件中,导入js //var util = require('../../utils/util.js'); /*var ttken ='JLI5vvqq0KRnzfla';//密钥 var ttime = parseInt(Date.parse(new Date())/1000);//时间 秒 //var ttime = util.ntime(); var ntoken=ttken+ttime; var token = utilMd5.hexMD5(ntoken); console.log(token);*/ //end //随机字符窜 function randomString(len) { len = len || 32; var $chars = 'ABCDEFGHJKMNPQRSTWXYZabcdefhioOLl,9gq,Vv,Uu,I1jkmnprstwxyz/*~!@#¥%……&*()+=-2345678'; /****默认去掉了容易混淆的字符oOLl,9gq,Vv,Uu,I1****/ var maxPos = $chars.length; var pwd = ''; for (var i = 0; i < len; i++) { pwd += $chars.charAt(Math.floor(Math.random() * maxPos)); } return pwd; } //document.write(randomString(32)); /*伪身份凭证*/ function makeusertoken(){ //console.log(randomString(9)) var ro = randomString(9); //存储随机字符1 wx.setStorageSync('ros', ro); //var code = ro.charCodeAt(); //var nro = wx.getStorageSync('ros') //console.log(strToBinary(ro)); //console.log(binaryToStr('1000010 1000010 111000 1101011 1001101 1000000 110001 1101100 1111001')); } //将字符串转换成二进制形式,中间用空格隔开 function strToBinary(str) { var result = []; var list = str.split(""); for (var i = 0; i < list.length; i++) { if (i != 0) { result.push(" "); } var item = list[i]; var binaryStr = item.charCodeAt().toString(2); result.push(binaryStr); } return result.join(""); } //将二进制字符串转换成Unicode字符串 function binaryToStr(str) { var result = []; var list = str.split(" "); for (var i = 0; i < list.length; i++) { var item = list[i]; var asciiCode = parseInt(item, 2); var charValue = String.fromCharCode(asciiCode); result.push(charValue); } return result.join(""); } /*end*/ //获取访问者的openid /*end*/ module.exports = { formatTime: formatTime, ntime: ntime, updatenew: updatenew, makeusertoken: makeusertoken }
wx.navigateTo({ url: 'test?id=1'//实际路径要写全 })
//test.js Page({ onLoad: function(option){ console.log(option.id) } })
#682
<view class="{{isFold ?'flod':'extend' }}" bindtap="flodFn"> 我是一个很长的文字 </view> .flod{ //折叠样式 } .extend{ //展开样式 } flodFn:function(){ this.setData({ isFold: !this.isFold }); }
<view bindtap="flodFn"> <view wx:if="{{isFold}}" > 我是一个很长的文字 </view> <view wx:else> 我是一个很长的文字 </view> </view> flodFn:function(){ this.setData({ isFold: !this.isFold }); }
$("button").click(function(){ $("p").toggle(); });
#683
#684
$the_host = $_SERVER['HTTP_HOST']; //取得当前域名 $the_url = isset($_SERVER['REQUEST_URI']) ? $_SERVER['REQUEST_URI'] : ''; //判断地址后面部分 //$the_url = strtolower($the_url);//将英文字母转成小写 if($the_url=="/index.php"){ //判断是不是首页 $the_url="";//如果是首页,赋值为空 } if($the_host !== 'www.lizhenqiu.com'){ //如果域名不是带www的网址那么进行下面的301跳转 header('HTTP/1.1 301 Moved Permanently');//发出301头部 header('Location:http://www.lizhenqiu.com'.$the_url);//跳转到带www的网址 //header后的PHP代码还会被执行 .确保重定向后,后续代码不会被执行 exit; }
确定要清除编辑框内容吗?
该删除操作将不可恢复。
删除 取消
激活Windows
转到"设置"以激活Windows。
#666
#667
A>B 表示选择A元素的所有子B元素。
与A B的区别在于,A B选择所有后代元素,而A>B只选择一代。
另外:没有<的用法。
A+B表示HTML中紧随A的B元素。
nth-child是个伪类的用法,如p:nth-child(2)就表示在p的父元素中选择位居第二位的p,这个可能不太好理解,自己试一试就知道了。
<style>.parent { text-align:center; margin:0 auto; width:200px; height:200px; background:red; } .children { positiona;absolute; margin-top:75px; width:50px; height:50px; background: black; display:inline-block;/*使其父元素text-align生效*/ }</style><div class="parent"> <div class="children"></div> </div>图片黑白css 使用CSS将图片转换成黑白(灰色、置灰) CSS3 Filter 去色
<style> img{ -webkit-filter: grayscale(100%); -moz-filter: grayscale(100%); -ms-filter: grayscale(100%); -o-filter: grayscale(100%); filter: grayscale(100%); filter: gray;} img:hover{-webkit-filter: grayscale(0); -moz-filter: grayscale(0); -ms-filter: grayscale(0); -o-filter: grayscale(0); filter: grayscale(0); filter: gray(0); } </style> <img src="VCG21gic16069628.jpg">#668
#669
#670
a链接href执行js代码
<a href = "javascript:alert(22);">点我</a>去掉a链接点击
href="javascript:;"或者去掉href属性
view-source:URLnofollow有两种用法: 1.用于meta元标签:<meta name="robots" content="nofollow" />,告诉爬虫该页面上所有链接都无需追踪。 2.用于a标签:<a href="login.aspx" rel="nofollow">登录</a>,告诉爬虫该页面无需追踪。#671
<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title></title> <style> #box div{ width: 80px; display: inline-block; background-color: gray; } #box div span{ display: block; line-height: 30px; color: pink; background-color:black; margin-right: 2px; text-align: center; } </style> </head> <body> <div id="box"> <!--<div> <span> 1 X 1 = 1 </span> <span> 1 X 2 = 2 </span> <span> 1 X 3 = 3 </span> <span> 1 X 4 = 4 </span> <span> 1 X 5 = 5 </span> <span> 1 X 6 = 6 </span> <span> 1 X 7 = 7 </span> <span> 1 X 8 = 8 </span> <span> 1 X 9 = 9 </span> <span> 1 X 10 = 10 </span> </div> <div> <span> 2 X 2 = 4 </span> <span> 2 X 3 = 6 </span> <span> 2 X 4 = 8 </span> <span> 2 X 5 = 10 </span> <span> 2 X 6 = 12 </span> <span> 2 X 7 = 14 </span> <span> 2 X 8 = 16</span> <span> 2 X 9 = 18 </span> <span> 2 X 10 = 20 </span> </div> ......--> </div> <script> var box = document.getElementById('box') var str = '' //i是列数j是乘号后面的数,是第几列,成号后面的数就是几开始 for( var i = 1; i < 10; i ++){ str += '<div>' //console.log(str) for( var j = i; j < 10; j ++){ var n = i + 'X' + j + '=' + i*j str += '<span>' + n + '</span>' } str += '</div>' } box.innerHTML = str </script> </body> </html><!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title></title> <style > #box div{ color: deeppink; } #box div span{ padding: 5px; line-height: 20px; width: 70px; display: inline-block; border:1px solid peru; background-color: goldenrod; } </style> </head> <body> <div id="box"> <!--<div> <span> 1 X 1 = 1 </span> <span> 1 X 2 = 2 </span> <span> 1 X 3 = 3 </span> <span> 1 X 4 = 4 </span> <span> 1 X 5 = 5 </span> <span> 1 X 6 = 6 </span> <span> 1 X 7 = 7 </span> <span> 1 X 8 = 8 </span> <span> 1 X 9 = 9 </span> <span> 1 X 10 = 10 </span> </div> <div> <span> 2 X 2 = 4 </span> <span> 2 X 3 = 6 </span> <span> 2 X 4 = 8 </span> <span> 2 X 5 = 10 </span> <span> 2 X 6 = 12 </span> <span> 2 X 7 = 14 </span> <span> 2 X 8 = 16</span> <span> 2 X 9 = 18 </span> <span> 2 X 10 = 20 </span> </div> ......--> </div> <script> var box = document.getElementById('box') var str = '' //i为行,j为列 for( var i = 1; i < 10; i ++){ str += '<div>' //console.log(str) for( var j = 1; j <= i ; j ++ ){ var n = j + 'X' + i + '=' + j*i str += '<span>' + n + '</span>' } str += '</div>' } box.innerHTML = str </script> </body> </html>九九乘法表(点击出现4种)
<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title></title> <style> div{ width: 80px; height: 30px; background: #ADFF2F; text-align: center; line-height: 30px; font-size: 20px; color: #FF0000; position: absolute; } </style> </head> <body> </body> <script> var stt=[one,two,three,four]; num =0; document.onclick = function(){ stt[num](); num++; num%=stt.length; }; //第一种 function one(){ var str =''; for(var i=1;i<10;i++){ for(var j=i;j<10;j++){ str +='<div style="left:'+(i-1)*90+'px;top:'+(j-1)*40+'px;">'+i+'X'+j+'='+i*j+'</div>'; } } document.body.innerHTML = str; } //第二种 ////////好别扭 function two(){ var str =''; for(var i=9;i>0;i--){ for(var j=i;j>0;j--){ str +='<div style="left:'+(9-i)*90+'px;top:'+(i-j)*40+'px;">'+i+'X'+j+'='+i*j+'</div>'; } } document.body.innerHTML = str; } //第三种 function three(){ var str =''; for(var i=1;i<10;i++){ for(var j=i;j<10;j++){ str +='<div style="left:'+(9-i)*90+'px;top:'+(j-1)*40+'px;">'+i+'X'+j+'='+i*j+'</div>'; } } document.body.innerHTML = str; } //第四种 function four(){ var str=''; for(var i=1;i<10;i++){ for(var j=9;j>i-1;j--){ str +='<div style="left:'+(i-1)*90+'px;top:'+(9-j)*40+'px;">'+i+'X'+j+'='+i*j+'</div>'; } } document.body.innerHTML = str; } /* 因为i<10是一个判断条件,则一直加的话最后数字只能到9 因为j>i-1也是一个判断,而j最大值也是9 所以到最后就会出现9 X 9 */ </script> </html>#672
#673
选择.htaccess
Options +FollowSymlinks RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^(.*)$ index.php/$1 [QSA,PT,L]#674
<!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>垂直居中Demo</title> <style> #container{ height:300px; background:#d6d6d6; display: -webkit-box; display: -moz-box; display: -ms-flexbox; display: -webkit-flex; display: flex; justify-content:center; align-items: center; } #center{ width:100px; height:100px; background-color:#666; color:#fff; font-weight:bold; font-size:18px; display:flex; /*这个写在这只是为了#center这几个字的垂直居中*/ justify-content:center; align-items: center; } </style> </head> <body> <div id='container'> <div id = 'center'>#center</div> </div> </body> </html>#675
<style> .prm { width:300px; height:300px; background:green; display:table-cell; text-align:center; vertical-align:middle; } </style> <div class="pr" style="display:none"> <p class="c">单行居中 单行居中</p> </div> <div class="prm"> <p class="c"> 多行垂直居中 多行垂直居中 多行垂直居中 多行垂直居中 多行垂直居中 多行垂直居中 多行垂直居中 多行垂直居中 多行垂直居中 多行垂直居中 多行垂直居中 多行垂直居中 多行垂直居中 多行垂直居中 多行垂直居中 多行垂直居中 多行垂直居中 多行垂直居中 多行垂直居中 多行垂直居中 多行垂直居中 多行垂直居中 多行垂直居中 多行垂直居中 多行垂直居中 多行垂直居中 多行垂直居中 </p> </div>#676
Windows Registry Editor Version 5.00 [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols] [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\Multi-Protocol Unified Hello] [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\Multi-Protocol Unified Hello\Client] "Enabled"=dword:00000000 "DisabledByDefault"=dword:00000001 [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\Multi-Protocol Unified Hello\Server] "Enabled"=dword:00000000 "DisabledByDefault"=dword:00000001 [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\PCT 1.0] [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\PCT 1.0\Client] "Enabled"=dword:00000000 "DisabledByDefault"=dword:00000001 [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\PCT 1.0\Server] "Enabled"=dword:00000000 "DisabledByDefault"=dword:00000001 [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\SSL 2.0] [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\SSL 2.0\Client] "DisabledByDefault"=dword:00000001 "Enabled"=dword:00000000 [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\SSL 2.0\Server] "Enabled"=dword:00000000 "DisabledByDefault"=dword:00000001 [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\SSL 3.0] [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\SSL 3.0\Client] "Enabled"=dword:00000000 "DisabledByDefault"=dword:00000001 [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\SSL 3.0\Server] "Enabled"=dword:00000000 "DisabledByDefault"=dword:00000001 [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.0] [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.0\Client] "Enabled"=dword:00000001 "DisabledByDefault"=dword:00000000 [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.0\Server] "Enabled"=dword:00000001 "DisabledByDefault"=dword:00000000 [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.1] [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.1\Client] "DisabledByDefault"=dword:00000000 "Enabled"=dword:00000001 [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.1\Server] "DisabledByDefault"=dword:00000000 "Enabled"=dword:00000001 [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.2] [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.2\Client] "DisabledByDefault"=dword:00000000 "Enabled"=dword:00000001 [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.2\Server] "Enabled"=dword:00000001 "DisabledByDefault"=dword:00000000双击执行,重启服务器 TLS1.2.reg
#677
var App = getApp(); // pages/about/about.js Page({ /** * 页面的初始数据 */ data: { "content": '广西南宁共振广告有限公司,2008年成立于南宁,是一家以“品牌咨询+品牌设计+品牌策划+品牌落地”于一体的品牌服务平台,通过360°全景式纵深品牌打造,从品牌标识设计、VI设计、空间设计、包装、海报等多维度构建完善的品牌价值链,致力于以实战服务中国企业,以品牌推动中国成长。公司创立至今,已是当之无愧的品牌实战专家,客户涵盖国内外地产、金融、IT、汽车、服装时尚、奢侈品、能源、机械、快速消费品等各行业著名的企业,深受客户信赖。我们坚持以实力深耕市场,力求达成艺术与商业之间、客户与市场之间、虚拟与现实之间的价值共生,将企业打造成为一个能为客户提供综合化', "content2": '更换内容21321', "content3": '2222222222222更换内容21321', radioCheckVal: 0, all: [{ one: "公司介绍", two: '../../images/ab2.gif', two1: '../../images/ab5.gif' }, { one: "公司理念", two: '../../images/ab3.gif', two1: '../../images/ab4.gif' }, { one: "核心优势", two: '../../images/ab4.gif', two1: '../../images/ab3.gif' }, { one: "公司使命", two: '../../images/ab5.gif', two1: '../../images/ab2.gif' }], oall:{ } }, /** * 生命周期函数--监听页面加载 */ onLoad: function (options) { App.editTabBar(this); this.setData({ "oall": this.data.all })//保存初始图片数据 2018.01.05 }, /** * 生命周期函数--监听页面初次渲染完成 */ onReady: function () { }, /** * 生命周期函数--监听页面显示 */ onShow: function () { }, /** * 生命周期函数--监听页面隐藏 */ onHide: function () { }, /** * 生命周期函数--监听页面卸载 */ onUnload: function () { }, /** * 页面相关事件处理函数--监听用户下拉动作 */ onPullDownRefresh: function () { }, /** * 页面上拉触底事件的处理函数 */ onReachBottom: function () { }, /** * 用户点击右上角分享 */ onShareAppMessage: function () { }, //更换内容 getnewcontent:function(n){ var cc = (n.currentTarget.dataset.c); var ncc ='content'+cc; // var adata =''; var id = n.currentTarget.dataset.id; //打印可以看到,此处已获取到了包含id、title、和content的对象 var that = this; //var two = all[id].two = all[id].two1; this.setData({ "all":this.data.oall },function(){ that.data.all[id].two = that.data.all[id].two1; //console.log(that.data.all); var all = that.data.all; that.setData({ "content": that.data[ncc], "all": all, "id": id }) }); } })<!-------------banner 开始--------------> <image style='width:100%;' src='../../images/ab0.png' mode="widthFix" ></image> <!-------------banner 结束--------------> <view class="about" style="background:url('https://hhh.liangtianmei.com/images/bjjj.png');"> <!-------------标题 开始--------------> <view class='title'> <view class='zuo'> <view class='xian'></view> <view class='yuan'>●</view> </view> <view class='wz'> <text class='yw'>ABOUT SU\n</text> <text class='zw'>关于我们\n</text> </view> <view class='you'> <view class='yuan'>●</view> <view class='xian'></view> </view> </view> <!-------------标题 结束--------------> <!-------------导航 开始--------------> <view class='nav'> <view class='meiyi'> <block wx:for="{{all}}"> <view class="dg" bindtap="getnewcontent" data-id="{{index}}" data-c='{{index+1}}' style="{{index == id?' border:1rpx solid red':'border:1rpx solid gainsboro;'}}"> <image src="{{item.two}}" mode="widthFix" data-index="{{index}}"></image> <text>{{item.one}}</text> </view> </block> <!-- <view class='dg' bindtap="getnewcontent" data-c='2'> <image src='../../images/ab2.gif' mode="widthFix"></image>\r\n <text>公司介绍</text> </view> <view class='dg' bindtap="getnewcontent" data-c='3'> <image src='../../images/ab3.gif' mode="widthFix"></image>\r\n <text>公司理念</text> </view> <view class='dg'> <image src='../../images/ab4.gif' mode="widthFix"></image>\r\n <text>核心优势</text> </view> <view class='dg'> <image src='../../images/ab5.gif' mode="widthFix"></image>\r\n <text>公司使命</text> </view>--> </view> </view> <!-------------导航 结束--------------> <!-------------图文 开始--------------> <view class='nr'> <image src='../../images/ab1.png' mode="widthFix"></image> <text>{{content}}</text> </view> <!-------------图文 结束--------------> </view> <import src="../template/tabBar.wxml" /> <template is="tabBar" data="{{tabBar: tabBar}}" />微信模板文件wxml循坏遍历怎么json键名变量??
getnewcontent:function(n){ var cc = (n.currentTarget.dataset.c); var ncc ='content'+cc; var id = n.currentTarget.dataset.id; this.setData({ "content": this.data[ncc], id:id }) } <block wx:for="{{all}}"> <view class='dg' data-id="{{index}}" bindtap="getnewcontent" data-c='{{index+1}}'> <block wx:if="{{index==id}}"> <image src='{{item.two1}}' mode="widthFix"></image>\r\n </飙泪ock> <block wx:else> <image src='{{item.two}}' mode="widthFix"></image>\r\n </飙泪ock> <text>{{item.one}}</text> <iew> </飙泪ock>#678
https://www.random.org/integers/?num=1&min=100000&max=999999&col=1&base=10&format=plain&rnd=new#679
<template name="tabBar"> <view class="flex-h flex-hsb tab-bar" style="color: {{tabBar.color}}; background: {{tarBar.backgroundColor}}; {{tabBar.position=='top'? 'top: 0' : 'bottom: 0'}}; {{tabBar.borderStyle? (tabBar.position=='top'? 'border-bottom: solid 1px '+tabBar.borderStyle + ';' : 'border-top: solid 1px '+tabBar.borderStyle + ';') : ''}}"> <block wx:for="{{tabBar.list}}" wx:key="pagePath"> <navigator url="{{item.pagePath}}" open-type="redirect" class="menu-item" style="{{item.active? 'color: '+(item.selectedColor? item.selectedColor : tabBar.selectedColor) : ''}}"> <image src="{{item.selectedIconPath}}" wx:if="{{item.active}}"></image> <image src="{{item.iconPath}}" wx:if="{{!item.active}}"></image> <text style="color:{{item.selectedColor}}" wx:if="{{item.active}}">{{item.text}}</text> <text style="color:{{item.color}}" wx:if="{{!item.active}}">{{item.text}}</text> </navigator> </block> </view> </template>#680
// pages/about/about.js Page({ /** * 页面的初始数据 */ data: { "content": '广西南宁共振广告有限公司,2008年成立于南宁,是一家以“品牌咨询+品牌设计+品牌策划+品牌落地”于一体的品牌服务平台,通过360°全景式纵深品牌打造,从品牌标识设计、VI设计、空间设计、包装、海报等多维度构建完善的品牌价值链,致力于以实战服务中国企业,以品牌推动中国成长。公司创立至今,已是当之无愧的品牌实战专家,客户涵盖国内外地产、金融、IT、汽车、服装时尚、奢侈品、能源、机械、快速消费品等各行业著名的企业,深受客户信赖。我们坚持以实力深耕市场,力求达成艺术与商业之间、客户与市场之间、虚拟与现实之间的价值共生,将企业打造成为一个能为客户提供综合化', "content2": '更换内容21321', "content3": '2222222222222更换内容21321' }, /** * 生命周期函数--监听页面加载 */ onLoad: function (options) { }, /** * 生命周期函数--监听页面初次渲染完成 */ onReady: function () { }, /** * 生命周期函数--监听页面显示 */ onShow: function () { }, /** * 生命周期函数--监听页面隐藏 */ onHide: function () { }, /** * 生命周期函数--监听页面卸载 */ onUnload: function () { }, /** * 页面相关事件处理函数--监听用户下拉动作 */ onPullDownRefresh: function () { }, /** * 页面上拉触底事件的处理函数 */ onReachBottom: function () { }, /** * 用户点击右上角分享 */ onShareAppMessage: function () { }, //更换内容 getnewcontent:function(n){ var cc = (n.currentTarget.dataset.c); var ncc ='content'+cc; console.log(ncc); this.setData({ "content": this.data[ncc], }) } })<!-------------banner 开始--------------> <image style='width:100%;' src='../../images/ab0.png' mode="widthFix" ></image> <!-------------banner 结束--------------> <view class="about" style="background:url('https://hhh.liangtianmei.com/images/bjjj.png');"> <!-------------标题 开始--------------> <view class='title'> <view class='zuo'> <view class='xian'></view> <view class='yuan'>●</view> </view> <view class='wz'> <text class='yw'>ABOUT SU\n</text> <text class='zw'>关于我们\n</text> </view> <view class='you'> <view class='yuan'>●</view> <view class='xian'></view> </view> </view> <!-------------标题 结束--------------> <!-------------导航 开始--------------> <view class='nav'> <view class='meiyi'> <view class='dg' bindtap="getnewcontent" data-c='2'> <image src='../../images/ab2.gif' mode="widthFix"></image>\r\n <text>公司介绍</text> </view> <view class='dg'> <image src='../../images/ab3.gif' mode="widthFix"></image>\r\n <text>公司理念</text> </view> <view class='dg'> <image src='../../images/ab4.gif' mode="widthFix"></image>\r\n <text>核心优势</text> </view> <view class='dg'> <image src='../../images/ab5.gif' mode="widthFix"></image>\r\n <text>公司使命</text> </view> </view> </view> <!-------------导航 结束--------------> <!-------------图文 开始--------------> <view class='nr'> <image src='../../images/ab1.png' mode="widthFix"></image> <text>{{content}}</text> </view> <!-------------图文 结束--------------> </view>alert(json.lastMonth[dep]);使用中括号的方式就可以用变量key值
js json键名变量
js变量名变量
#681
var app = getApp() //构造令牌 // 在需要使用的js文件中,导入js //var util = require('../../utils/util.js'); //构造令牌 使用服务器时间戳 var utilMd5 = require('../../utils/md5.js'); var util = require('../../utils/util.js'); var ttken = 'JLI5vvqq0KRnzfla';//密钥 var ttime = parseInt(Date.parse(new Date()) / 1000);//时间 秒 //var ttime = util.ntime(); var ntoken = ttken + ttime; var token = utilMd5.hexMD5(ntoken); //console.log(token); //end Page({ /** * 页面的初始数据 */ data: { token:0, tokenid: 0 }, onLoad: function () { //console.log('token: ' + token); var params = { 'name': 'json', 'age': 26 }; //util.makeusertoken() //初始化 验证码 util.updatenew('https://hhh.*****.com/index.php/Home/Wxapp/code/token/' + token, token,this); //获取验证码图片 var tokenid = wx.getStorageSync('tokenid'); //util.updatenew('https://hhh.*****.com/index.php/Home/Wxapp/getcode/token/' + token + '/tokenid/' + tokenid+'/'); this.setData({ token: token, tokenid:tokenid }) }, changing:function(){ util.updatenew('https://hhh.*****.com/index.php/Home/Wxapp/code/token/' + token, token, this); var tokenid = wx.getStorageSync('tokenid'); this.setData({ token: token, tokenid: tokenid }) } }) //ajax(method, url, data, success)1.生成令牌 <image style="height:40px;width:100px;margin-top:10px;" bindtap="changing" id="codeyzmm" src="https://hhh.*****.com/index.php/Home/Wxapp/getcode/token/{{token}}/tokenid/{{tokenid}}/" ></image>const formatTime = date => { const year = date.getFullYear() const month = date.getMonth() + 1 const day = date.getDate() const hour = date.getHours() const minute = date.getMinutes() const second = date.getSeconds() return [year, month, day].map(formatNumber).join('/') + ' ' + [hour, minute, second].map(formatNumber).join(':') } const formatNumber = n => { n = n.toString() return n[1] ? n : '0' + n } //服务器时间戳 function ntime(utilMd5, that,url){ wx.request({ url: 'https://hhh.*****.com/ntime.php',//请修改为你服务器 data: { }, header: { 'content-type': 'application/json' }, success: function (res) { //return res; var ttken = 'JLI5vvqq0KRnzfla';//密钥 //var ttime = parseInt(Date.parse(new Date()) / 1000);//时间 秒 var ttime =res.data;//util.ntime(); var ntoken = ttken + ttime; var token = utilMd5.hexMD5(ntoken); //console.log(ntoken); //return token; // var url = 'https://hhh.*****.com/index.php/Home/Product/index'; updatenew(url, token, that); } }) } //更新数据 function updatenew(url, token, that) { wx.request({ url: url,//'https://hhh.*****.com/index.php/Home/Product/index', //仅为示例,并非真实的接口地址 /*data: { token: token },*/ method: 'GET', header: { 'content-type': 'application/json' // 默认值 }, success: function (res) { // alert(res.data) // res.data.content = app.convertHtmlToText(res.content) /*that.setData({ textdata: res.data }); console.log (res.data)*/ // that.setData(res.data) /*that.setData({ all: res.data//第一个data为固定用法,第二个data是json中的data })*/ //console.log(token); //res.data.jzzz = 1; if (res.data.tokenid){ //保存token id wx.setStorageSync('tokenid', res.data.tokenid); } if (that){ that.setData(res.data) //that.setData({ //jzzz:1, //jzzzs:'', //codeimgurl: res.data.codeimgurl, //all: res.data //res // imageUrl: "../images/sp_07.png"//触发事件时的图片 //}) } } }) } //构造令牌 // 在需要使用的js文件中,导入js //var util = require('../../utils/util.js'); /*var ttken ='JLI5vvqq0KRnzfla';//密钥 var ttime = parseInt(Date.parse(new Date())/1000);//时间 秒 //var ttime = util.ntime(); var ntoken=ttken+ttime; var token = utilMd5.hexMD5(ntoken); console.log(token);*/ //end //随机字符窜 function randomString(len) { len = len || 32; var $chars = 'ABCDEFGHJKMNPQRSTWXYZabcdefhioOLl,9gq,Vv,Uu,I1jkmnprstwxyz/*~!@#¥%……&*()+=-2345678'; /****默认去掉了容易混淆的字符oOLl,9gq,Vv,Uu,I1****/ var maxPos = $chars.length; var pwd = ''; for (var i = 0; i < len; i++) { pwd += $chars.charAt(Math.floor(Math.random() * maxPos)); } return pwd; } //document.write(randomString(32)); /*伪身份凭证*/ function makeusertoken(){ //console.log(randomString(9)) var ro = randomString(9); //存储随机字符1 wx.setStorageSync('ros', ro); //var code = ro.charCodeAt(); //var nro = wx.getStorageSync('ros') //console.log(strToBinary(ro)); //console.log(binaryToStr('1000010 1000010 111000 1101011 1001101 1000000 110001 1101100 1111001')); } //将字符串转换成二进制形式,中间用空格隔开 function strToBinary(str) { var result = []; var list = str.split(""); for (var i = 0; i < list.length; i++) { if (i != 0) { result.push(" "); } var item = list[i]; var binaryStr = item.charCodeAt().toString(2); result.push(binaryStr); } return result.join(""); } //将二进制字符串转换成Unicode字符串 function binaryToStr(str) { var result = []; var list = str.split(" "); for (var i = 0; i < list.length; i++) { var item = list[i]; var asciiCode = parseInt(item, 2); var charValue = String.fromCharCode(asciiCode); result.push(charValue); } return result.join(""); } /*end*/ //获取访问者的openid /*end*/ module.exports = { formatTime: formatTime, ntime: ntime, updatenew: updatenew, makeusertoken: makeusertoken }wx.navigateTo({ url: 'test?id=1'//实际路径要写全 })//test.js Page({ onLoad: function(option){ console.log(option.id) } })参数与路径之间使用?分隔,参数键与参数值用=相连,不同参数用&分隔;
test?id=1 中id为参数键,1 为参数值
在目的页面中onLoad()方法中option对象即为参数对象,可以通过参数键来取出参数值
#682
1.css方案
<view class="{{isFold ?'flod':'extend' }}" bindtap="flodFn"> 我是一个很长的文字 </view> .flod{ //折叠样式 } .extend{ //展开样式 } flodFn:function(){ this.setData({ isFold: !this.isFold }); }2.动态渲染方案
<view bindtap="flodFn"> <view wx:if="{{isFold}}" > 我是一个很长的文字 </view> <view wx:else> 我是一个很长的文字 </view> </view> flodFn:function(){ this.setData({ isFold: !this.isFold }); }显示被隐藏的元素,并隐藏已显示的元素
$("button").click(function(){ $("p").toggle(); });#683
#684
$the_host = $_SERVER['HTTP_HOST']; //取得当前域名 $the_url = isset($_SERVER['REQUEST_URI']) ? $_SERVER['REQUEST_URI'] : ''; //判断地址后面部分 //$the_url = strtolower($the_url);//将英文字母转成小写 if($the_url=="/index.php"){ //判断是不是首页 $the_url="";//如果是首页,赋值为空 } if($the_host !== 'www.lizhenqiu.com'){ //如果域名不是带www的网址那么进行下面的301跳转 header('HTTP/1.1 301 Moved Permanently');//发出301头部 header('Location:http://www.lizhenqiu.com'.$the_url);//跳转到带www的网址 //header后的PHP代码还会被执行 .确保重定向后,后续代码不会被执行 exit; }