WordPress网站

网址: https://cn.wordpress.org/

阿里云市场

https://market.aliyun.com/products/53616009?spm=a2c4e.11153940.blogcont160877.13.5e1f6ce7n0PL2Z&tag=WordPress&jianzhanSoft=%E5%8D%9A%E5%AE%A2

将解压缩后的文件上传到 Linux 实例中的 alidata/www/phpwind 目录下

云服务器 ECS 实例搭建 WordPres

选购云服务器ECS

选择点击“从镜像市场选择”

1、购买阿里云ECS主机

2、购买域名

3、申请备案

4、环境配置

5、安装wordpress

6、域名解析

必须先将域名备案,才能通过域名访问阿里云的服务器

首先打开网址:http://www.aliyun.com/

阿里的云翼计划

网址:https://promotion.aliyun.com/ntms/act/campus2018.html

注册域名

免费云解析:https://help.aliyun.com/document_detail/29716.html?spm=a2c4g.11186623.6.552.67257cd2w3N5EL

一台阿里云服务器

二个域名

安装nginx,mysql,php

获取lnmp一键安装包链接

lnpm官网链接

小程序注册页面:

Page({
data: {
text: '获取验证码', //按钮文字
currentTime: 61, //倒计时
disabled: false, //按钮是否禁用
phone: '', //获取到的手机栏中的值
VerificationCode: '',
Code: '',
NewChanges: '',
NewChangesAgain: '',
success: false,
state: '0',
url: ''
},
/**
* 获取验证码
*/
return_home: function (e) {
wx.navigateTo({
url: '/pages/register/register',
}) },
handleInputPhone: function (e) {
this.setData({
phone: e.detail.value
})
},
handleVerificationCode: function (e) {
console.log(e);
this.setData({
Code: e.detail.value
})
},
handleNewChanges: function (e) {
console.log(e);
this.setData({
NewChanges: e.detail.value
})
},
handleNewChangesAgain: function (e) {
console.log(e);
this.setData({
NewChangesAgain: e.detail.value
}) },
doGetCode: function () {
var that = this;
that.setData({
disabled: true, //只要点击了按钮就让按钮禁用 (避免正常情况下多次触发定时器事件)
color: '#ccc',
}) var phone = that.data.phone;
var currentTime = that.data.currentTime //把手机号跟倒计时值变例成js值
var warn = null; //warn为当手机号为空或格式不正确时提示用户的文字,默认为空
wx.request({
url: 'http://192.168.41.40:8002/isExist', //后端判断是否已被注册, 已被注册返回1 ,未被注册返回0
method: "GET",
header: {
'content-type': 'application/x-www-form-urlencoded'
},
success: function (res) {
that.setData({
state: res.data
})
if (phone == '') {
warn = "号码不能为空";
} else if (phone.trim().length != 11 || !/^1[3|4|5|6|7|8|9]\d{9}$/.test(phone)) {
warn = "手机号格式不正确";
} //手机号已被注册提示信息
else if (that.data.state == 1) { //判断是否被注册
warn = "手机号已被注册"; }
else {
wx.request({
url: 'http:///sendCode', //填写发送验证码接口
method: "POST",
data: {
coachid: that.data.phone
},
header: {
'content-type': 'application/x-www-form-urlencoded'
},
success: function (res) {
console.log(res.data)
that.setData({
VerificationCode: res.data.verifycode
}) //当手机号正确的时候提示用户短信验证码已经发送
wx.showToast({
title: '短信验证码已发送',
icon: 'none',
duration: 2000
});
//设置一分钟的倒计时
var interval = setInterval(function () {
currentTime--; //每执行一次让倒计时秒数减一
that.setData({
text: currentTime + 's', //按钮文字变成倒计时对应秒数 }) if (currentTime <= 0) {
clearInterval(interval)
that.setData({
text: '重新发送',
currentTime: 61,
disabled: false,
color: '#33FF99'
})
}
}, 100);
}
})
}; if (warn != null) {
wx.showModal({
title: '提示',
content: warn
})
that.setData({
disabled: false,
color: '#33FF99'
})
return;
}
} }) },
submit: function (e) {
var that = this
if (this.data.Code == '') {
wx.showToast({
title: '请输入验证码',
image: '/images/error.png',
duration: 2000
})
return
} else if (this.data.Code != this.data.VerificationCode) {
wx.showToast({
title: '验证码错误',
image: '/images/error.png',
duration: 2000
})
return
}
else if (this.data.NewChanges == '') {
wx.showToast({
title: '请输入密码',
image: '/images/error.png',
duration: 2000
})
return
} else if (this.data.NewChangesAgain != this.data.NewChanges) {
wx.showToast({
title: '两次密码不一致',
image: '/images/error.png',
duration: 2000
})
return
} else {
var that = this
var phone = that.data.phone;
wx.request({
url: 'http:///register',
method: "POST",
data: {
coachid: phone,
coachpassword: that.data.NewChanges
},
header: {
"content-type": "application/x-www-form-urlencoded"
},
success: function (res) {
wx.showToast({
title: '提交成功~',
icon: 'loading',
duration: 2000
})
console.log(res.data)
that.setData({
success: true,
url: res.data
})
}
})
}
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () { }
})

Page({
data: {
phone: '',
password: '',
success: false,
text: '' }, // 获取输入账号
phoneInput: function (e) {
this.setData({
phone: e.detail.value
})
}, // 获取输入密码
passwordInput: function (e) {
this.setData({
password: e.detail.value
})
}, // 登录
login: function () {
var that = this; var warn = null;
if (that.data.phone.length == 0) {
wx.showToast({
title: '用户名不能为空',
icon: 'loading',
duration: 1000
})
} else if (that.data.password.length == 0) {
wx.showToast({
title: '密码不能为空',
icon: 'loading',
duration: 1000
})
}else { wx.request({
url: 'http:///login',
method: "POST",
data: {
cardNo: that.data.phone,
password: that.data.password
},
header: {
'content-type': 'application/x-www-form-urlencoded'
},
success: function (res) {
if (res.data.state == 1) { //判断是否能正常登录
warn = "卡号密码不匹配";
wx.showModal({
title: '提示',
content: warn
})
return;
} else {
that.setData({
success: true,
text: res.data.url
})
}
} }) }
},
// 注册
register: function () {
wx.navigateTo({
url: '/pages/register/register',
})
} })

转发功能

open-type="share"`

小程序分享或转发有两种方式

onShareAppMessage: function (ops) {
if (ops.from === 'button') {
// 来自页面内转发按钮
console.log(ops.target)
}
return {
title: 'xx小程序',
path: 'pages/index/index',
success: function (res) {
// 转发成功
console.log("转发成功:" + JSON.stringify(res));
},
fail: function (res) {
// 转发失败
console.log("转发失败:" + JSON.stringify(res));
}
} }

如何通过经纬度查询到用户的当前位置成了一个问题

申请腾讯地图密钥(key),申请地址:申请密钥

wx.getLocation({
type: 'wgs84',
success: function (res) {
//console.log("获取当前经纬度:" + JSON.stringify(res));
//发送请求通过经纬度反查地址信息
var getAddressUrl = "https://apis.map.qq.com/ws/geocoder/v1/?location=" + res.latitude + "," + res.longitude + "&key=你的key值&get_poi=1";
common.Request(getAddressUrl, "get", "", function (ops) {
//console.log(JSON.stringify(ops));
})
}
})

请点赞!因为你的鼓励是我写作的最大动力!

吹逼交流群:711613774

dashucoding记录2019.6.8的更多相关文章

  1. dashucoding记录2019.6.6

    div { display:flex; flex-direction:row-reverse; } -webkit-, - ms-或-moz- CSS语法 flex-direction: row|ro ...

  2. dashucoding记录2019.6.7

    购买阿里云ECS主机 购买域名 申请备案 环境配置 安装wordpress 域名解析 在"产品与服务"中选择云服务器ECS 购买完域名之后建议去实名认证 域名购买链接:http:/ ...

  3. java后端学习记录2019

    学习计划 2019年计划 1.学习计算机基础,并加以实践.包括LeetCode刷题.数据库原理(索引和锁.Sql优化等).网络协议(Http.Tcp).操作系统(加深Linux).<Http权威 ...

  4. HDFS部署测试记录(2019/05)

    目录 HDFS部署测试记录 0.HDFS基础知识 1.基本组成结构与文件访问过程 2.NameNode启动时如何维护元数据 3.HDFS文件上传流程 1.系统环境 1.安装大致记录: 2.磁盘分区 3 ...

  5. git遇到的问题记录2019.05.07

    用sourcetree拉取代码,报错如下: error: cannot lock ref 'refs/remotes/origin/my_branch': unable to resolve refe ...

  6. 记录使用nodejs时,未正确使用import导致的错误

    2019/04/08 今天看了es6入门,才发现以前碰到的关于import的错误,是因为使用了import,但nodejs默认不支持导致的. 如果想要使用es6的module功能,需要把整个文件的导入 ...

  7. 源码安装ROS Melodic Python3 指南 (转) + 安装记录

    这篇文章转自   https://blog.csdn.net/id9502/article/details/80410989  csdn真是作大死,我保存这篇博客的时候还不需要花钱就能看,现在居然要v ...

  8. symfony小练习-表白墙

    过上一个博客系统以及对官方示例程序的基本学习,目前对symfony的各个组件有了一定的学习,学校布置了一个表白墙任务,这里就这个任务的完成进行记录 ...........2019.3.20.22.31 ...

  9. pycharm2019+破解补丁

    事先声明,由于本人的pycharm已经装好,故部分图片来自网络,转载请注明地址 这篇博文以前是2018版本 后来换电脑重装时发现失效了 索性装的2019版本 具体步骤可以参考下面的删除线,新的补丁和激 ...

随机推荐

  1. netty--buffer分配策略

    AdaptiveRecvByteBufAllocator 动态分配buffer大小的类. 如果前一次读取完全填满了分配的缓冲区,它将逐渐增加预期的可读字节数.(增加的方式:初始化类的时候,会预先设置好 ...

  2. WCF header 域

    [OperationContract] [WebInvoke(UriTemplate = "poststr1")] public string poststr1(csinfo cs ...

  3. MySQL LAST_INSERT_ID()用法

    last_insert_id()函数是适用于id为自动生成的表 下面是插入表数据时last_insert_id()函数的两种用法: 表结构: 此表使用last_insert_id()函数的字段为par ...

  4. css 层叠 比较特殊性

    css 层叠: 多个相同的css声明(属性),应用到同一个元素上.当一个标签声明冲突时,浏览器会自动出发层叠机制 1:比较优先级 2:比较特殊性 3:比较源次序 依次经过上面的1,2,3的比较后,最终 ...

  5. 使用js解决response.sendRedirect("...")重定向URL之后出现跨域问题

    背景: 本系统与门户系统单点登录时候,需要重定向到门户系统的登录页面,可是如果长时间没有操作的话,session会话失效,就需要跳转到登录页面. 所以在使用 response.sendRedirect ...

  6. Flask之Local、LocalStack和LocalProxy

    在我们使用Flask以及Werkzeug框架的过程中,经常会遇到如下三个概念:Local.LocalStack和LocalProxy.尤其在学习Flask的Request Context和App Co ...

  7. C++——同名隐藏 和 赋值兼容规则

    同名隐藏 一旦子类定义了与父类同名的方法,则父类里面该名字的所有方法都被隐藏了.必须显示指定是父类的方法才可以 #include<iostream> using namespace std ...

  8. Python中type()详解:动态创建类

    众所周知: type()函数可以查看变量的类型: 先看一个简单的列子来看一下type查看变量类型 class Animal(): pass a=Animal() print(type(a)) prin ...

  9. 【OF框架】缓存Session/Cookies/Cache代码调用api,切换缓存到Redis

    准备 缓存服务在应用开发中最常用的功能,特别是Session和Cookies,Cache部分业务开发过程会使用到. 在负载均衡环境下,缓存服务需要存储到服务器. 缓存默认实现在内存在,可以通过配置切换 ...

  10. Scala配置环境变量windows

    scala下载官网网址:http://www.scala-lang.org/download/ 1.下载scala-2.10.4.msi 2.点击安装scala,默认安装路径 3.配置环境变量   ( ...