#685
展开↯#686
作者:广西南宁市
<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>Run code
Cut to clipboard
文章:CSS3实现垂直居中 发表时间:2018-01-06, 17:12:58
#687
作者:广西南宁市
微信小程序TLS版本必须大于等于1.2
双击执行,重启服务器 TLS1.2.reg
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:00000000Run code
Cut to clipboard
双击执行,重启服务器 TLS1.2.reg
文章:免费ssl证书:网站域名使用 https (nginx) 访问配置参考 发表时间:2018-01-06, 11:23:22
#688
作者:广西南宁市
点击切换
#,广西南宁市,2018-01-05,12:22:56, #,广西南宁市,2018-01-05,12:23:51,
微信模板文件wxml循坏遍历怎么json键名变量?? #,广西南宁市,2018-01-05,14:15:21, #,广西南宁市,2018-01-05,17:57:00,@2 , 小程序函数传参
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
})
});
}
})Run code
Cut to clipboard
<!-------------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}}" />Run code
Cut to clipboard
微信模板文件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>Run code
Cut to clipboard
文章:微信小程序开发笔记 发表时间:2018-01-05, 12:22:42
#689
作者:广西南宁市
随机数接口API
https://www.random.org/integers/?num=1&min=100000&max=999999&col=1&base=10&format=plain&rnd=newRun code
Cut to clipboard
文章:程序员编程常用网页工具集[游戏] 发表时间:2018-01-05, 09:37:38
#690
作者:广西南宁市
<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>Run code
Cut to clipboard
文章:微信小程序自定义选项卡tabBar模板底部顶部导航 发表时间:2018-01-04, 17:19:37
#691
作者:广西南宁市
// 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],
})
}
})Run code
Cut to clipboard
<!-------------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>Run code
Cut to clipboard
alert(json.lastMonth[dep]);Run code
Cut to clipboard
使用中括号的方式就可以用变量key值
js json键名变量
js变量名变量
文章:微信小程序自定义选项卡tabBar模板底部顶部导航 发表时间:2018-01-04, 17:06:21
#692
作者:广西南宁市
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)Run code
Cut to clipboard
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>Run code
Cut to clipboard
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
}
Run code
Cut to clipboard
wx.navigateTo({
url: 'test?id=1'//实际路径要写全
})Run code
Cut to clipboard
//test.js
Page({
onLoad: function(option){
console.log(option.id)
}
})Run code
Cut to clipboard
参数与路径之间使用?分隔,参数键与参数值用=相连,不同参数用&分隔;
test?id=1 中id为参数键,1 为参数值
在目的页面中onLoad()方法中option对象即为参数对象,可以通过参数键来取出参数值
文章:微信小程序开发笔记 发表时间:2018-01-02, 17:10:08
#693
作者:广西南宁市
小程序不支持DOM和BOM操作,所有逻辑都需要通过数据驱动
1.css方案
2.动态渲染方案
显示被隐藏的元素,并隐藏已显示的元素
1.css方案
<view class="{{isFold ?'flod':'extend' }}" bindtap="flodFn">
我是一个很长的文字
</view>
.flod{
//折叠样式
}
.extend{
//展开样式
}
flodFn:function(){
this.setData({
isFold: !this.isFold
});
}Run code
Cut to clipboard
2.动态渲染方案
<view bindtap="flodFn">
<view wx:if="{{isFold}}" >
我是一个很长的文字
</view>
<view wx:else>
我是一个很长的文字
</view>
</view>
flodFn:function(){
this.setData({
isFold: !this.isFold
});
}Run code
Cut to clipboard
显示被隐藏的元素,并隐藏已显示的元素
$("button").click(function(){
$("p").toggle();
});Run code
Cut to clipboard
文章:微信小程序自定义选项卡tabBar模板底部顶部导航 发表时间:2018-01-04, 16:36:18
#694
作者:广西南宁市
任何事物之所以存在,不平等就是基础, #,广西南宁市,2018-01-03,17:23:41, 成功的革命从来就不是穷人自己搞的,都是有产阶级分赃不均挑拨出来的。 #,广西南宁市,2018-01-03,17:24:12, 穷人之所以穷,原因在于他们懒于改变自己,乐于享受他们的懒惰带给他们的短暂舒适感。社会的变革只和优秀的人有关系 #,广西南宁市,2018-01-03,17:25:06, 大部分人都是有口饭吃就愿意老实本分,就怕那几个自愿上山的疯家伙 #,广西南宁市,2018-01-03,17:25:15, 所以要重申儒家,用家庭绑住年轻人,因为历史告诉我们,学生才是真的什么都不怕
文章:在新旧年交替的时候给自己励志 发表时间:2018-01-03, 17:23:30
#695
作者:广西南宁市
$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;
}Run code
Cut to clipboard
文章:301重定向PHP代码 PHP的301自动跳转代码 发表时间:2018-01-03, 14:54:09
#696
作者:广西南宁市
Sogou搜狗等浏览器点击有cursor: pointer;鼠标手型之后点击其他元素如果没有设置css鼠标样式,则默认箭头形状bug
文章:@意见反馈/技术支持/伊网/安企网 发表时间:2018-01-02, 18:40:50
#697
作者:广西南宁市
Yourphp后台多语言选择更新生成文章URL混篡错误网址url问题bug修复


/GZphp/Lib/Action/Admin/Run code
Cut to clipboard
public function doUpdateurl()
{
//echo getlang();exit;
$llllggg=1;
if(getlang()=='en') $llllggg=3;
$where=' lang= '.$llllggg;
//修复后台多语言
$this->assign ( 'waitSecond', 0);
$moduleid = intval($_GET['moduleid']);
extract($_GET,EXTR_SKIP);
if($moduleid<=0 && $catids[0] <= 0){
if($this->module && !$_SESSION['moduleids']){
foreach($this->module as $moduleid=>$r){
$tablename=C('DB_PREFIX').$this->module[$moduleid]['name'];
$db=D('');
$db = DB::getInstance();
$tables = $db->getTables();
$Fields=$db->getFields($tablename);
foreach ( $Fields as $key =>$r){
if($key=='url') $_SESSION['moduleids'][] = $moduleid;
}
}
}
$doid = $doid ? intval($doid) : 0;
if(!isset($_SESSION['moduleids'][$doid])){
unset($_SESSION['moduleids']);
$forward = U("Createhtml/updateurl");
$this->assign ( 'jumpUrl', $forward);
$this->success(L('create_update_success'));
}else{
$moduleid = $_SESSION['moduleids'][$doid];
$module=$this->module[$moduleid]['name'];
$dao = M($module);
$p = max(intval($p), 1);
$start = $pagesize*($p-1);
if(!isset($count)){
$count = $dao->where($where)->count();
}
$pages = ceil($count/$pagesize);
if($count){
$list = $dao->field('id,catid,url')->where($where)->limit($start . ',' . $pagesize)->select();
foreach($list as $r) {
if($r['islink']) continue;
$url = geturl($this->categorys[$r['catid']],$r,$this->Urlrule);
unset($r['catid']);
$r['url'] = $url['0'];
if($url) $dao->save($r);
}
}
if($pages > $p) {
$p++;
$creatednum = $start + count($list);
$percent = round($creatednum/$count, 2)*100;
$urlarray=array(
'doid' => $doid,
'dosubmit' => 1,
'count' => $count,
'pages' => $pages,
'p' => $p,
'pagesize' => $pagesize,
);
$message = L('updating').$this->module[$moduleid]['title'].L('create_update_count').$count.L('create_update_num').$creatednum.L('items').$percent.L('items1');
$forward = U("Createhtml/".ACTION_NAME,$urlarray);
$this->assign ( 'jumpUrl', $forward);
$this->success($message);
} else {
$doid++;
$urlarray=array(
'doid' => $doid,
'dosubmit' => 1,
'p' => 1,
'pagesize' => $pagesize,
);
$message = L('start_updating').$this->module[$moduleid]['title']." ...";
$forward = U("Createhtml/".ACTION_NAME,$urlarray);
$this->assign ( 'jumpUrl', $forward);
$this->success($message);
}
}
}elseif($moduleid){
$module=$this->module[$moduleid]['name'];
$dao = M($module);
$p = max(intval($p), 1);
$start = $pagesize*($p-1);
if(is_array($catids) && $catids[0] > 0){
$cids = implode(',',$catids);
$where = $where." catid IN($cids) ";
$_SESSION['catids'] = $catids;
}
if(!$catids && $_SESSION['catids'] && $_SESSION['catids'][0] > 0){
$catids = implode(',',$_SESSION['catids']);;
$where = $where." catid IN($catids) ";
}
if(!isset($count)){
$count = $dao->where($where)->count();
}
$pages = ceil($count/$pagesize);
if($count){
$list = $dao->field('id,catid,url')->where($where)->limit($start . ',' . $pagesize)->select();
foreach($list as $r) {
if($r['islink']) continue;
$url = geturl($this->categorys[$r['catid']],$r,$this->Urlrule);
unset($r['catid']);
$r['url'] = $url['0'];
if($url) $dao->save($r);
}
}
if($pages > $p) {
$p++;
$creatednum = $start + count($list);
$percent = round($creatednum/$count, 2)*100;
$urlarray=array(
'moduleid' => $moduleid,
'dosubmit' => 1,
'count' => $count,
'pages' => $pages,
'p' => $p,
'pagesize' => $pagesize,
);
$message = L('create_update_count').$count.L('create_update_num').$creatednum.L('items').$percent.L('items1');
$forward = U("Createhtml/updateurl",$urlarray);
$this->assign ( 'jumpUrl', $forward);
$this->success($message);
} else {
unset($_SESSION['catids']);
$forward = U("Createhtml/updateurl");
$this->assign ( 'jumpUrl', $forward);
$this->success(L('create_update_success'));
}
}else{
//按照栏目更新url
extract($_GET,EXTR_SKIP);
$doid = $doid ? intval($doid) : 0;
if(empty($_SESSION['catids']) && $catids){
if($catids[0] == 0) {
foreach($this->categorys as $id=>$cat) {
if($cat['child'] || $cat['type']!=0 || $cat['module']=='Page') continue;
$catids[] = $id;
}
}
$_SESSION['catids'] = $catids;
}else{
$catids =$_SESSION['catids'];
}
if(!isset($catids[$doid])){
unset($_SESSION['catids']);
$forward = U("Createhtml/updateurl");
$this->assign ( 'jumpUrl', $forward);
$this->success(L('create_update_success'));
}elseif($catids[$doid]<=0){
$forward = U("Createhtml/updateurl");
$this->assign ( 'jumpUrl', $forward);
$this->success(L('create_update_success'));
}else{
$id = $catids[$doid];
$module=$this->categorys[$id]['module'];
$dao = M($module);
$where = $where."catid=$id";
$p = max(intval($p), 1);
$start = $pagesize*($p-1);
if(!isset($count)){
$count = $dao->where($where)->count();
}
$pages = ceil($count/$pagesize);
if($count){
$list = $dao->field('id,catid,url')->where($where)->limit($start . ',' . $pagesize)->select();
foreach($list as $r) {
if($r['islink']) continue;
$url = geturl($this->categorys[$r['catid']],$r,$this->Urlrule);
unset($r['catid']);
$r['url'] = $url['0'];
if($url) $dao->save($r);
}
}
if($pages > $p) {
$p++;
$creatednum = $start + count($list);
$percent = round($creatednum/$count, 2)*100;
$urlarray=array(
'doid' => $doid,
'dosubmit' => 1,
'count' => $count,
'pages' => $pages,
'p' => $p,
'pagesize' => $pagesize,
);
$message = L('updating').$this->categorys[$id]['catname'].L('create_update_count').$count.L('create_update_num').$creatednum.L('items').$percent.L('items1');
$forward = U("Createhtml/".ACTION_NAME,$urlarray);
$this->assign ( 'jumpUrl', $forward);
$this->success($message);
} else {
$doid++;
$urlarray=array(
'doid' => $doid,
'dosubmit' => 1,
'p' => 1,
'pagesize' => $pagesize,
);
$message = L('start_updating').$this->categorys[$id]['catname']." ...";
$forward = U("Createhtml/".ACTION_NAME,$urlarray);
$this->assign ( 'jumpUrl', $forward);
$this->success($message);
}
}
}
}Run code
Cut to clipboard
/GZphp/Common/Run code
Cut to clipboard
function geturl($cat,$data='',$Urlrule=''){
//$Urlrule =F('Urlrule');
$id=$data['id'];
$URL_MODEL =C('URL_M');
if(APP_LANG)$lang = getlang();
$parentdir = $cat['parentdir'];
$catdir = $cat['catdir'];
if(!$catdir){
return false; //修复后台多语言
}
$year = date('Y',$data['createtime']);
$month = date('m',$data['createtime']);
$day = date('d',$data['createtime']);
$module = $cat['module'];
$moduleid =$cat['moduleid'];
$catid=$cat['id'];
if($cat['ishtml']){
if($cat['urlruleid'] && $Urlrule){
$showurlrule = $Urlrule[$cat['urlruleid']]['showurlrule'];
$listurlrule = $Urlrule[$cat['urlruleid']]['listurlrule'];
}else{
echo 'This cat has not urlruleid or no Urlrule.';exit;
}
}else{
if($URL_MODEL==0){
$langurl = $lang ? '&l='.LANG_NAME : '';
if($id){
$url[] = U("Home/$cat[module]/show?id=$id".$langurl);
$url[] = U("Home/$cat[module]/show?id=".$id.$langurl.'&'.C('VAR_PAGE').'={$page}');
}else{
$url[] = U("Home/$cat[module]/index?id=$cat[id]".$langurl);
$url[] = U("Home/$cat[module]/index?id=$cat[id]$langurl&".C('VAR_PAGE').'={$page}');
}
$urls = str_replace('g=Admin&','',$url);
$urls = str_replace('g=Home&','',$url);
}else{
$urlrule = explode(':::',C('URL_URLRULE'));
$showurlrule = $urlrule[0];
$listurlrule = $urlrule[1];
}
}
if(empty($urls)){
$index = $URL_MODEL==1 ? __ROOT__.'/index.php/' : __ROOT__.'/';
$langurl = $lang ? $lang.'/' : '';
if($id){
$urls = str_replace(array('{$parentdir}','{$module}','{$moduleid}','{$catdir}','{$year}','{$month}','{$day}','{$catid}','{$id}'),array($parentdir,$module,$moduleid,$catdir,$year,$month,$day,$catid,$id),$showurlrule);
}else{
$urls = str_replace(array('{$parentdir}','{$module}','{$moduleid}','{$catdir}','{$year}','{$month}','{$day}','{$catid}','{$id}'),array($parentdir,$module,$moduleid,$catdir,$year,$month,$day,$catid,$id),$listurlrule);
}
$urls = explode('|',$urls);
$urls[0]=$index.$langurl.$urls[0];
$urls[1]=$index.$langurl.$urls[1];
}
return $urls;
}Run code
Cut to clipboard
文章:Yourphp,thinkphp修改分页代码 发表时间:2018-01-02, 17:59:55
#698
作者:广西南宁市
西数ssl https访问不了要设置 服务器 安全狗

#,广西南宁市,2017-12-29,12:07:14, 
#,广西南宁市,2017-12-29,12:07:54,
检测端口是否开启
#,广西南宁市,2017-12-29,12:10:04,
另一个程序正在使用此文件,进程无法访问。 (异常来自 HRESULT:0x80070020)

[SVN] VisualSVN Server Manager 443端口
得到占用443端口的进程ID,发现是VisualSVNServer.exe占用了它。
修改VisualSVN Server Manager的端口方法如下:
(1)打开VisualSVN Server Manager
(2)点击根节点“VisualSVN Server Manager (Local)”
(3)右键-Properties
(4)Network选项卡,Server Port选为8443

#,广西南宁市,2017-12-29,12:11:22,
证书系统创建的CSR,包含:证书私钥文件214405557430106.key、PFX格式证书文件214405557430106.pfx、PFX格式证书密码文件pfx-password.txt #,广西南宁市,2017-12-29,12:13:12, 西数 自助安装SSL证书教程 #,广西南宁市,2017-12-29,14:43:45,
IIS7/IIS7.5 URL 重写 HTTP 重定向到 HTTPS

进入“URL重写”模块,点击“添加规则”

选择“空白规则”




或


或

配置完成后“应用”到当前站点 #,广西南宁市,2017-12-29,15:05:57, 每个小程序账号仅支持配置最多20个域名;每个域名仅支持绑定最多20个小程序;每个小程序一年内最多支持修改域名50次。
检测端口是否开启
netstat -ano -p tcp | find "443" >nul 2>nul && echo 443端口已开启 || echo 443未开启Run code
Cut to clipboard
另一个程序正在使用此文件,进程无法访问。 (异常来自 HRESULT:0x80070020)
[SVN] VisualSVN Server Manager 443端口
netstat -aon|findstr "443"Run code
Cut to clipboard
得到占用443端口的进程ID,发现是VisualSVNServer.exe占用了它。
修改VisualSVN Server Manager的端口方法如下:
(1)打开VisualSVN Server Manager
(2)点击根节点“VisualSVN Server Manager (Local)”
(3)右键-Properties
(4)Network选项卡,Server Port选为8443
证书系统创建的CSR,包含:证书私钥文件214405557430106.key、PFX格式证书文件214405557430106.pfx、PFX格式证书密码文件pfx-password.txt
IIS7/IIS7.5 URL 重写 HTTP 重定向到 HTTPS
进入“URL重写”模块,点击“添加规则”
选择“空白规则”
名称:HTTP to HTTPS redirect
模式:(.*)Run code
Cut to clipboard
条件输入:{HTTPS}
模式:off 或 ^OFF$Run code
Cut to clipboard
或
重定向URL:https://{HTTP_HOST}/{R:1}
重定向类型:已找到(302) 或 参阅其它(303)Run code
Cut to clipboard
或
配置完成后“应用”到当前站点
文章:免费ssl证书:网站域名使用 https (nginx) 访问配置参考 发表时间:2017-12-29, 12:06:49
#699
作者:广西南宁市
window.webkitURL是用来判断什么的?
URL对象是硬盘(SD卡等)指向文件的一个路径,如果我们做文件上传的时候,想在没有上传服务器端的情况下看到上传图片的效果图的时候就可是以通过
URL对象是硬盘(SD卡等)指向文件的一个路径,如果我们做文件上传的时候,想在没有上传服务器端的情况下看到上传图片的效果图的时候就可是以通过
var url=window.URL.createObjectURL(obj.files[0]);[/url]获得一个http格式的url路径,这个时候就可以设置到<img>中显示了。
window.webkitURL和window.URL是一样的,window.URL标准定义,window.webkitURL是webkit内核的实现(一般手机上就是使用这个),还有火狐等浏览器的实现。 #,广西南宁市,2017-12-29,14:08:38, 多张图片上传jQuery插件Run code
Cut to clipboard
文章:HTML5之图片上传预处理缩略图预览 发表时间:2017-06-06, 17:39:26
#700
作者:广西南宁市
“腾讯的产品、百度的技术、阿里的运营”这种说法,早已深入人心。虽然与其他互联网巨头相比,腾讯似乎是产品的最佳孵化器,尤其是在微信所代表的移动互联网时代,业界对腾讯一直赞誉有加,但在光环之下,腾讯并不是不会犯错。 #,广西南宁市,2017-12-28,17:58:54, 百度做为全球最大的中文搜索引擎,本身有巨大流量和数据资源,“All in AI”和“内容分发”业务是百度现在的产品发展方向。 #,广西南宁市,2017-12-28,17:59:45, 其实挺不喜欢百度的,但是搜索引擎真的强大 #,广西南宁市,2017-12-28,17:59:58, 百度的影响力在持续下降,吴恩达的离开,也能反应出百度的人工智能的未来.我更相信,吴是受办公室政治而不得不离开的. #,广西南宁市,2017-12-28,18:00:22, 百度内部偏家长型集权式管理,各山头做事不够灵活,好处是执行力强,缺点是下边人做事不动脑子。 #,广西南宁市,2017-12-28,18:02:46, 百度的搜索业务也快死了,看看百度上的文章材料,都过时了,新的数据百度抓不到。百度死有两个原因
1李老板热心赚快钱,总想利用流量来带自己的产品,手里有个锤子看什么问题都是钉子,目光不够长远。
2团队管理肯定出了大问题,我是见识过一个固化的团队有多可怕,任何方案都有本事做跑样。 #,广西南宁市,2017-12-28,18:04:46, 其实腾讯微博和新浪微博的定位不一样,当时腾讯微博已经占据了三四线城市的的上亿用户,活跃度和新浪微博也不相上下,但是有了微信,腾讯没必要再去做这样一个产品,看看现在微信和微博的体量和营收能力就清楚了。 #,广西南宁市,2017-12-28,18:05:09, 失败的全是别人的创意,腾讯只是损失些钱 #,广西南宁市,2017-12-28,18:05:23, 关闭聊天室完全是响应政策。聊天室是绝对的YP圣地。
1李老板热心赚快钱,总想利用流量来带自己的产品,手里有个锤子看什么问题都是钉子,目光不够长远。
2团队管理肯定出了大问题,我是见识过一个固化的团队有多可怕,任何方案都有本事做跑样。
文章:BAT巨头"阵亡全家桶" 发表时间:2017-12-28, 17:58:32
#701
作者:广西南宁市
百度阵亡全家桶,相信只多不少。。 #,广西南宁市,2017-12-28,17:57:36, 巨头也有“难养的儿子”,在扩张帝国版图的同时,也会不断折戟。百度如此,腾讯如此,阿里更是如此。“阵亡”的产品成为了巨头成长路上的垫脚石,也记录了巨头发展的轨迹。 #,广西南宁市,2017-12-28,17:58:00, 听说创业公司只要招到腾讯的产品经理就不用愁了?No,梳理一遍腾讯的产品孵化史,你会发现腾讯并不是神:QQ、微信的光环之下,其实也有着众多的失败产品。 #,广西南宁市,2017-12-28,18:00:55, 百度重技术轻产品轻运营 #,广西南宁市,2017-12-28,18:01:18, 在中国,搜索引擎还是百度最好的。大部分人搜索第一时间想到的就是百度。一句有问题,找百度,也是最直接的反应。还有,百度贴吧也是百度成功的一个产品,但贴吧也有一个缺陷,藏污纳垢。贴吧里的乱象真的不少。另外,我有一个疑问:百度的到底主营业务是什么,这些年百度在干什么? #,广西南宁市,2017-12-28,18:03:51, 整理的很不错,基本把百度的个中“糗历史”梳理好了。说起来百度的情况也真是奇葩,无论先出手还是后出手,总是胜少负多(如果不说全盘皆墨的话)。江湖曾流传“腾讯的产品,阿里的运营,百度的技术”,就好像企业的DNA已经书写,再也无法改变一样。然而吊诡的是,多年之后再来回顾,发现那个简单粗暴的企业DNA好像还真有几分宿命论的味道。从这个角度说,搞不好电商,整不了游戏的百度,倒比一直标榜着“大侠”,向往着“隐居”的Jack Ma来的有“武林人士”的风范——因为除了醉心技术,好像也没啥更好的出路了。
文章:BAT巨头"阵亡全家桶" 发表时间:2017-12-28, 17:57:03
#702
作者:广西南宁市
html {
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}Run code
Cut to clipboard
文章:理解box-sizing布局 发表时间:2017-12-27, 17:08:32
#703
作者:广西南宁市
男人被相亲可能真的是穷
女人被相亲一定是品质太次 #,广西南宁市,2017-12-26,16:27:24, 你有100万吗?哦 你还没有30岁啊? 那你多少岁? 20岁? 那你有66.6666666万吗?没有? 原来你和我一样想打一辈子光棍啊…… #,广西南宁市,2017-12-27,15:00:51, “人大了就戴表”
女人被相亲一定是品质太次
文章:2017那些“风暴眼”里的创投者 发表时间:2017-12-26, 16:26:00
<!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>