简客-记忆

抽象的才是永恒的

0%

主要代码

在场景中开启碰撞检测

1
2
3
var manager = cc.director.getCollisionManager();//获取碰撞检测系统
manager.enabled = true;//默认碰撞检测系统是禁用的,需要手动开启碰撞检测系统
manager.enabledDebugDraw = true;//开启后可在debug中显示碰撞区域

飞剑中的碰撞监听函数onCollisionEnter

1
2
3
4
5
6
onCollisionEnter(other:any , self:any) {
if(other.node.name.indexOf('guaiwu') > -1){
other.node.emit('guaiwu__attackby__feijian',{feijian_gj:this.feijian_gj},this); // 触发被飞剑攻击事件(加分事件在里面)
other.node.emit('guaiwu_buffby_feijian',{},this) // 触发被飞剑添加了buff事件
}
}

主要界面设置

项目>>项目设置>>分组管理 中设置可以碰撞的组gongji test

ss

主要涉及的cocos函数

1、onCollisionEnter

碰撞监听事件

2、this.node.emit

节点通知事件

3、this.node.on

节点监听事件

主要代码

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
start_move_feijian(){
console.log('mFeiJian move')
// 将cocos 的一些基本操作练习一遍
this.mFeiJian.position = new cc.Vec3(0,0,0);

this.mFeiJian.getComponent("feijian").is_flying = true


// // 画贝塞尔曲线
this.point1 = cc.v2(this.mZhunXin.position.x*3,600)
this.point2 = cc.v2(this.mZhunXin.position.x*2,2100)
let endPoint = cc.v2(this.mZhunXin.position.x,750)
let ddd = this.mFeiJian.runAction(

cc.sequence(
cc.spawn(cc.rotateBy(1, 360), cc.bezierTo(1, [this.point1, this.point2, endPoint]) ),
cc.moveTo(1,this.mZhunXin.position.x,0),
// 执行完成动作后回调
cc.callFunc(this.isGameOver,this)
)
);

}

主要涉及的cocos函数

1、cc.Vec3

position的坐标在最新版本中都用cc.Vec3

2、cc.v2

二维坐标

3、this.node.runAction

运行动作

4、cc.sequence

按顺序执行动作

5、cc.spawn

多个动作同时间进行

6、cc.rotateBy

翻转

7.cc.moveTo

移动

8、cc.bezierTo

按贝塞尔曲线轨迹运行

9、cc.callFunc

回调函数

主要代码

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28

@property(cc.Node)
mZhunXinHengTiao: cc.Node = null;

@property(cc.Node)
mZhunXin: cc.Node = null;


@property(cc.Integer)
time_speed:Number = 1; // 时间流逝倍率
@property(cc.Integer)
cycle_time:Number = 5; // 一个周期所用时间

max_x:Number = 0; // 最大偏移
total_move_time:Number = 0; // 总移动时间
per_move_time:Number = 0; // 每帧移动时间


start () {
this.max_x = this.mZhunXinHengTiao.width/2
this.total_move_time = 0
}
update (dt) {
let PI = 3.14159
this.per_move_time = dt*Number(this.time_speed) // 每帧移动时间
this.total_move_time = Number(this.total_move_time) + Number(this.per_move_time) // 总移动时间
this.mZhunXin.x = Number(this.max_x)*Math.sin(2*PI*(Number(this.total_move_time)/Number(this.cycle_time))) // 准心的偏移量
}

主要涉及的cocos函数

1、Math.sin

正弦余弦

2、update(dt)

dt代表的每帧所用时间

主要代码

1
2
3
4
5
6
7
8
this.node.on(cc.Node.EventType.TOUCH_START, this.onTouchStart, this);
this.node.on(cc.Node.EventType.TOUCH_MOVE, this.onTouchMove , this);
this.node.on(cc.Node.EventType.TOUCH_CANCEL, this.onTouchEnd, this);
this.node.on(cc.Node.EventType.TOUCH_END, this.onTouchEnd, this);
        // this.mEnableTouch = true;
        console.log("mEnableTouch on");
}

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
     
    onTouchMove (event) {
var touches = event.getTouches();
var touchLoc = touches[0].getLocation();
// this.mHookMoveToPos = this.node.parent.convertToNodeSpaceAR(touchLoc);
// console.log('touchLoc : ', touchLoc);

let toX:Number = touchLoc.x - Number(this.preX)
var toY:Number = touchLoc.y - Number(this.preY)
this.preX = touchLoc.x
this.preY = touchLoc.y
console.log('touchLoc.x',touchLoc.x)
console.log('preX',this.preX)
console.log('touchLoc.y',touchLoc.y)
console.log('preY',this.preY)
if( toX > 0 ) {
console.log(" > 0")
this.mPan.angle +=2
}
if( toX < 0 ) {
console.log(" < 0")
this.mPan.angle -=2
}

    }

主要涉及的cocos函数

1、event.getTouches()

获取触碰点

2、cc.Node.EventType.TOUCH_MOVE

事件类型

graph LR

    交易管理 --> 订单管理
    订单管理 --> 全部
    订单管理 --> 待支付
    订单管理 --> 待发货
    订单管理 --> 待收货
    订单管理 --> 待评论
    订单管理 --> 已完成
    订单管理 --> 已取消


    交易管理 --> 评论管理
    评论管理 --> 好评
    评论管理 --> 中评
    评论管理 --> 差评



    交易管理 --> 退款管理
    退款管理 --> 申请退款
    退款管理 --> 等待买家退货
    退款管理 --> 买家已退货
    退款管理 --> 已拒绝
    退款管理 --> 平台介入
    退款管理 --> 退款完成
    退款管理 --> 退款已关闭
graph LR

   物流管理 --> 发货
   发货 --> 全部1
   发货 --> 待发货
   发货 --> 发货中订单

   物流管理 --> 运费模板
   运费模板--> 全部2
   运费模板--> 正常
   运费模板--> 隐藏
graph LR

    宝贝管理 --> 发布宝贝
    宝贝管理 --> 出售中的宝贝
    宝贝管理 --> 仓库中的宝贝
graph LR

    店铺管理 --> 图片空间
    店铺管理 --> 店铺装修
    店铺管理 --> 类目管理
    店铺管理 --> 品牌管理
    店铺管理 --> 店铺资料
    店铺管理 --> 店铺配置

graph LR
    商品管理 --> 商品列表
    商品管理 --> 类目管理
    商品管理 --> 类目属性
    商品管理 --> 商家类目属性
    商品管理 --> 品牌管理


    订单监管 --> 订单列表
    订单监管 --> 订单列表
    订单监管 --> 订单列表
graph LR

   物流管理 --> 发货
   发货 --> 全部1
   发货 --> 待发货
   发货 --> 发货中订单

   物流管理 --> 运费模板
   运费模板--> 全部2
   运费模板--> 正常
   运费模板--> 隐藏
graph LR

    宝贝管理 --> 发布宝贝
    宝贝管理 --> 出售中的宝贝
    宝贝管理 --> 仓库中的宝贝
graph LR

    店铺管理 --> 图片空间
    店铺管理 --> 店铺装修
    店铺管理 --> 类目管理
    店铺管理 --> 品牌管理
    店铺管理 --> 店铺资料
    店铺管理 --> 店铺配置

背景

在入IT行业时,自己就像做一个类似的备注工具,当时的想法是给自己备注一些教程用了。
那时是自己建一个站点,将教程或者好文章扒到自己网站下面,然后,对其进行备注修改等。比较费时,且效果不理想。

diigo介绍

diigo是一个可以在网页上做笔记的浏览器插件,也就是说直接在网页上使得某一行高亮,或者添加注释,并且关闭后重新打开笔记不会消失!!diigo可以收藏网页、在网页上做笔记,用浏览器打开pdf,还可以在pdf上做笔记,做好的笔记也可以分享给他人。但是有个缺点就是需要翻墙。。我觉得这个插件的适合人群是一些需要翻阅国外文档的程序员。

安装使用

到应用商店下载

1
https://chrome.google.com/webstore/detail/diigo-web-collector-captu/pnhplgjpclknigjpccbcnmicgcieojbh?hl=zh-CN

效果

20180914172811191

参考

https://blog.csdn.net/Olivia_Vang/article/details/92987859

安装插件

1
npm install hexo-filter-mermaid-diagrams

修改配置文件

在hexo的_config.yml文件(根目录的并非主题的)中,添加以下内容:

1
2
3
4
5
6
7
# mermaid chart
mermaid: ## mermaid url https://github.com/knsv/mermaid
enable: true # default true
version: "7.1.2" # default v7.1.2
options: # find more api options from https://github.com/knsv/mermaid/blob/master/src/mermaidAPI.js
#startOnload: true // default true

js文件修改

themes/next/layout/_partials/footer.swig

以下是在next的footer.swig添加的内容。其他格式参考github: hexo-filter-mermaid-diagrams

1
2
3
4
5
6
7
8
{% if theme.mermaid.enable %}
<script src='https://unpkg.com/mermaid@{{ theme.mermaid.version }}/dist/mermaid.min.js'></script>
<script>
if (window.mermaid) {
mermaid.initialize({{ JSON.stringify(theme.mermaid.options) }});
}
</script>
{% endif %}

效果

1
2
3
4
5
6
7
` ` `mermaid
graph TD;
A-->B;
A-->C;
B-->D;
C-->D;
` ` `
graph TD;
    A-->B;
    A-->C;
    B-->D;
    C-->D;

结构图

graph LR

商城配置 --> 商城信息
商城配置 --> 会员配置
商城配置 --> 分享配置
商城配置 --> 积分配置
商城配置 --> 提现配置
商城配置 --> 订单配置
商城配置 --> 第三方服务
graph LR
店铺装修 --> 模板管理
店铺装修 --> 设计师模板
店铺装修 --> 自定义页面
graph LR
订单中心 --> 订单管理
订单中心 --> 售后/退货
graph LR
商品管理 --> 商品分类-是否需要商家类目
商品管理 --> 宝贝管理
商品管理 --> 服务标签
商品管理 --> 商品评价
graph LR
活动中心 --> 营销活动
活动中心 --> 拼团列表
graph LR
应用 --> 积分商城
应用 --> 小程序直播
graph LR
配送设置 --> 发货模板
配送设置 --> 快递公司
graph LR
微信管理 --> 粉丝管理
微信管理 --> 菜单管理
微信管理 --> 自动回复
微信管理 --> 素材管理
graph LR
消息通知 --> 消息配置
graph LR
 其他 --> 用户提现
 其他 --> 意见反馈
 其他 --> 优惠券
graph LR
门店管理 --> 门店列表
graph LR
 用户管理 --> 用户列表
 用户管理 --> 用户分组
graph LR
 资料管理 --> 富文本
 资料管理 --> 页面链接
 资料管理 --> 省市区数据
 资料管理 --> 常用问题
 资料管理 --> 虚拟用户

商户中心

todo
todo2