dashucoding记录2019.6.8
WordPress网站
将解压缩后的文件上传到 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一键安装包链接
小程序注册页面:

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的更多相关文章
- dashucoding记录2019.6.6
div { display:flex; flex-direction:row-reverse; } -webkit-, - ms-或-moz- CSS语法 flex-direction: row|ro ...
- dashucoding记录2019.6.7
购买阿里云ECS主机 购买域名 申请备案 环境配置 安装wordpress 域名解析 在"产品与服务"中选择云服务器ECS 购买完域名之后建议去实名认证 域名购买链接:http:/ ...
- java后端学习记录2019
学习计划 2019年计划 1.学习计算机基础,并加以实践.包括LeetCode刷题.数据库原理(索引和锁.Sql优化等).网络协议(Http.Tcp).操作系统(加深Linux).<Http权威 ...
- HDFS部署测试记录(2019/05)
目录 HDFS部署测试记录 0.HDFS基础知识 1.基本组成结构与文件访问过程 2.NameNode启动时如何维护元数据 3.HDFS文件上传流程 1.系统环境 1.安装大致记录: 2.磁盘分区 3 ...
- git遇到的问题记录2019.05.07
用sourcetree拉取代码,报错如下: error: cannot lock ref 'refs/remotes/origin/my_branch': unable to resolve refe ...
- 记录使用nodejs时,未正确使用import导致的错误
2019/04/08 今天看了es6入门,才发现以前碰到的关于import的错误,是因为使用了import,但nodejs默认不支持导致的. 如果想要使用es6的module功能,需要把整个文件的导入 ...
- 源码安装ROS Melodic Python3 指南 (转) + 安装记录
这篇文章转自 https://blog.csdn.net/id9502/article/details/80410989 csdn真是作大死,我保存这篇博客的时候还不需要花钱就能看,现在居然要v ...
- symfony小练习-表白墙
过上一个博客系统以及对官方示例程序的基本学习,目前对symfony的各个组件有了一定的学习,学校布置了一个表白墙任务,这里就这个任务的完成进行记录 ...........2019.3.20.22.31 ...
- pycharm2019+破解补丁
事先声明,由于本人的pycharm已经装好,故部分图片来自网络,转载请注明地址 这篇博文以前是2018版本 后来换电脑重装时发现失效了 索性装的2019版本 具体步骤可以参考下面的删除线,新的补丁和激 ...
随机推荐
- BUG:WSL 的 ssh server 无法启动
BUG 使用 sudo service ssh start 启动 ssh 服务,提示: * Restarting OpenBSD Secure Shell server sshd Could not ...
- TCP--粘包拆包,netty的解决方式
TCP基于链接的协议,并且保证有序性. 但是,每个包的长度,需要明确,否则会发生粘包现象. 以下示例为一个自定义协议的例子,其中包含了拆包的内容. 所有的类: 协议类: public class Pe ...
- Markdown试试
from os import time print("haha") from os import time print("haha") time.time()! ...
- 使用Dockerfile构建镜像并push到私有仓库
环境:OS X 10.10.5 maven 3.3.9 Docker version 1.12.2 docker-machine version 0.8.2 程序示例为http://www.cnblo ...
- 用.net4中的DynamicObject实现简单AOP
public class DynamicWrapper : DynamicObject { private readonly object source; public DynamicWrapper( ...
- Pytorch 1.0升级到Pytorch 1.1.0
Pytorch 1.0Pytorch 1.0于2018-12-8发布,详见https://github.com/pytorch/pytorch/releases/tag/v1.0.0 主要更新JIT全 ...
- 微信开发者工具 关于no such file or directory
在新建页面中,保存后弹出 “ no such file or directory ” 错误 原因是打开了一个文件,然后在目录树中删除了它,但是这个被删除的页面依旧在打开状态,开发者工具在编译保存时由于 ...
- linux7 上安装mongodb4.2.1操作步骤
MongoDB是一个通用的.基于文档的分布式数据库,它是为现代应用程序开发人员和云时代而构建的.没有数据库能让你更有效率. 1.下载需要的软件包https://www.mongodb.com/down ...
- JAVA 查找某个目录是否存在,如果存在,打印出来
题目:现有如下目录结构,查找结构中是否存在Directory11,如果存在,打印出来 |---test |---|---Directory1 |---|---|---Directory11 |---| ...
- Git与其他VCS的差异
推荐:Git essentials 一共4集视频 对待数据 在对待不同版本数据问题上,分为两派:差异增量.直接快照 增量差异 Git 和其它版本控制系统(包括 Subversion 和近似工具)的主 ...
