update
This commit is contained in:
parent
57905b080e
commit
416ac2644d
@ -1,4 +0,0 @@
|
|||||||
宽度 1366
|
|
||||||
高度 768 (暂定十倍)
|
|
||||||
|
|
||||||
header-banner -> 44px
|
|
@ -45,12 +45,14 @@
|
|||||||
`export FLASK_APP=yiban.py`
|
`export FLASK_APP=yiban.py`
|
||||||
`export FLASK_APP=qrcodeLi.py`
|
`export FLASK_APP=qrcodeLi.py`
|
||||||
`export FLASK_APP=coc.py`
|
`export FLASK_APP=coc.py`
|
||||||
|
`export FLASK_APP=app.py`
|
||||||
|
|
||||||
`export FLASK_ENV=development`
|
`export FLASK_ENV=development`
|
||||||
|
|
||||||
启动
|
启动
|
||||||
|
|
||||||
`flask run --host=127.0.0.1 -p 5003`
|
`flask run --host=127.0.0.1 -p 5003`
|
||||||
|
`flask run --host=0.0.0.0 -p 5000`
|
||||||
|
|
||||||
在虚拟环境下安装gunicorn
|
在虚拟环境下安装gunicorn
|
||||||
|
|
||||||
|
@ -1,18 +1,110 @@
|
|||||||
# flutter 学习笔记
|
# flutter 学习笔记
|
||||||
|
|
||||||
# 组件的使用
|
# 组件的使用
|
||||||
* Text
|
* Text文字组件
|
||||||
|
* `textAlign: TextAlign.start,` // 文本对齐方式
|
||||||
|
* `textDirection: TextDirection.ltr` // 文本方向
|
||||||
|
* `maxLines:1` // 最大行数
|
||||||
|
* `textScaleFactor: 1.5,` // 文字缩放
|
||||||
|
* `overflow: TextOverflow.ellipsis,` // 超出处理
|
||||||
|
* `style:`
|
||||||
|
* TextStyle组件
|
||||||
|
```dart
|
||||||
|
TextStyle(
|
||||||
|
color: Colors.blue,
|
||||||
|
fontSize: 18.0,
|
||||||
|
height: 1.2,
|
||||||
|
fontFamily: "Courier",
|
||||||
|
background: new Paint()..color=Colors.yellow,
|
||||||
|
decoration:TextDecoration.underline,
|
||||||
|
decorationStyle: TextDecorationStyle.dashed
|
||||||
|
),
|
||||||
|
```
|
||||||
|
* 文本接合,多个textSpan对文本进行修饰,然后拼合在一起
|
||||||
```dart
|
```dart
|
||||||
Text(
|
Text.rich(TextSpan(
|
||||||
'flutter demo',
|
children: [
|
||||||
// 文本对齐方式
|
TextSpan(
|
||||||
textAlign: TextAlign.start,
|
text: "https://flutterchina.club",
|
||||||
// 文本方向 还有rtl
|
style: TextStyle(
|
||||||
textDirection: TextDirection.ltr
|
color: Colors.blue
|
||||||
),
|
),
|
||||||
|
recognizer: _tapRecognizer
|
||||||
|
),
|
||||||
|
...
|
||||||
|
]
|
||||||
|
))
|
||||||
```
|
```
|
||||||
|
* 字体设置[链接]('https://book.flutterchina.club/chapter3/text.html')
|
||||||
|
* 按钮
|
||||||
|
* `RaisedButton` // 悬浮按钮
|
||||||
|
* `FlatButton` // 扁平按钮
|
||||||
|
* `OutlineButton` // 默认有边框
|
||||||
|
* `IconButton` // 可点击的icon
|
||||||
|
* `icon: Icon(Icons.thumb_up),`
|
||||||
|
* 前三个都可以加`.icon`然后属性变成`icon`和`label`
|
||||||
|
* 自定义
|
||||||
|
```dart
|
||||||
|
const FlatButton({
|
||||||
|
...
|
||||||
|
@required this.onPressed, //按钮点击回调
|
||||||
|
this.textColor, //按钮文字颜色
|
||||||
|
this.disabledTextColor, //按钮禁用时的文字颜色
|
||||||
|
this.color, //按钮背景颜色
|
||||||
|
this.disabledColor,//按钮禁用时的背景颜色
|
||||||
|
this.highlightColor, //按钮按下时的背景颜色
|
||||||
|
this.splashColor, //点击时,水波动画中水波的颜色
|
||||||
|
this.colorBrightness,//按钮主题,默认是浅色主题
|
||||||
|
this.padding, //按钮的填充
|
||||||
|
this.shape, //外形
|
||||||
|
@required this.child, //按钮的内容
|
||||||
|
})
|
||||||
|
```
|
||||||
|
* 图片
|
||||||
|
* pubspec.yaml配置
|
||||||
|
```yaml
|
||||||
|
assets:
|
||||||
|
- images/avatar.png
|
||||||
|
```
|
||||||
|
* 加载图片
|
||||||
|
```dart
|
||||||
|
Image(
|
||||||
|
image: AssetImage("images/avatar.png"),
|
||||||
|
width: 100.0
|
||||||
|
);
|
||||||
|
Image.asset("images/avatar.png",
|
||||||
|
width: 100.0,
|
||||||
|
)
|
||||||
|
Image(
|
||||||
|
image: NetworkImage(
|
||||||
|
"https://avatars2.githubusercontent.com/u/20411648?s=460&v=4"),
|
||||||
|
width: 100.0,
|
||||||
|
)
|
||||||
|
Image.network(
|
||||||
|
"https://avatars2.githubusercontent.com/u/20411648?s=460&v=4",
|
||||||
|
width: 100.0,
|
||||||
|
)
|
||||||
|
const Image({
|
||||||
|
...
|
||||||
|
this.width, //图片的宽
|
||||||
|
this.height, //图片高度
|
||||||
|
this.color, //图片的混合色值
|
||||||
|
this.colorBlendMode, //混合模式
|
||||||
|
this.fit,//缩放模式
|
||||||
|
this.alignment = Alignment.center, //对齐方式
|
||||||
|
this.repeat = ImageRepeat.noRepeat, //重复方式
|
||||||
|
...
|
||||||
|
})
|
||||||
|
```
|
||||||
|
* ICON
|
||||||
|
* `Icon(Icons.accessible,color: Colors.green,),`
|
||||||
|
* 使用自定义字体图标[链接]('https://book.flutterchina.club/chapter3/img_and_icon.html')
|
||||||
|
* Switch开关组件
|
||||||
|
* `value: true`
|
||||||
|
* `onChanged`
|
||||||
|
* Checkbox多选组件
|
||||||
|
* `value: true`
|
||||||
|
* `onChanged`
|
||||||
* Stack层叠组件
|
* Stack层叠组件
|
||||||
* 定位相对于父元素
|
* 定位相对于父元素
|
||||||
* `alignment: Alignment.center` // 总体控制
|
* `alignment: Alignment.center` // 总体控制
|
||||||
@ -24,7 +116,7 @@
|
|||||||
* `child: ` // 需要定位的子组件
|
* `child: ` // 需要定位的子组件
|
||||||
* Positioned组件
|
* Positioned组件
|
||||||
* `left, bottom, top, right` // int 默认为0
|
* `left, bottom, top, right` // int 默认为0
|
||||||
* `child: ` // 需要定位的子组件
|
* `child: ` // 需要定位的子组件image
|
||||||
* AspectRatio组件
|
* AspectRatio组件
|
||||||
* 默认横向占满父组件
|
* 默认横向占满父组件
|
||||||
* 可以用来控制图片
|
* 可以用来控制图片
|
||||||
@ -217,4 +309,28 @@
|
|||||||
- assets/my_icon.png
|
- assets/my_icon.png
|
||||||
- assets/background.png
|
- assets/background.png
|
||||||
```
|
```
|
||||||
assets指定应包含在应用程序中的文件, 每个asset都通过相对于pubspec.yaml文件所在的文件系统路径来标识自身的路径。asset的声明顺序是无关紧要的,asset的实际目录可以是任意文件夹(在本示例中是assets文件夹)
|
assets指定应包含在应用程序中的文件, 每个asset都通过相对于pubspec.yaml文件所在的文件系统路径来标识自身的路径。asset的声明顺序是无关紧要的,asset的实际目录可以是任意文件夹(在本示例中是assets文件夹)
|
||||||
|
* 在Widget树中获取State对象
|
||||||
|
* 方法一
|
||||||
|
```dart
|
||||||
|
// 直接通过of静态方法来获取ScaffoldState
|
||||||
|
ScaffoldState _state=Scaffold.of(context);
|
||||||
|
_state.showSnackBar(
|
||||||
|
SnackBar(
|
||||||
|
content: Text("我是SnackBar"),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
```
|
||||||
|
* 方法二
|
||||||
|
```dart
|
||||||
|
//定义一个globalKey, 由于GlobalKey要保持全局唯一性,我们使用静态变量存储
|
||||||
|
static GlobalKey<ScaffoldState> _globalKey= GlobalKey();
|
||||||
|
...
|
||||||
|
Scaffold(
|
||||||
|
key: _globalKey , //设置key
|
||||||
|
...
|
||||||
|
)
|
||||||
|
_globalKey.currentState.openDrawer()
|
||||||
|
```
|
||||||
|
GlobalKey是Flutter提供的一种在整个APP中引用element的机制。如果一个widget设置了GlobalKey,那么我们便可以通过globalKey.currentWidget获得该widget对象、globalKey.currentElement来获得widget对应的element对象,如果当前widget是StatefulWidget,则可以通过globalKey.currentState来获得该widget对应的state对象。
|
||||||
|
*
|
@ -1,110 +0,0 @@
|
|||||||
// function add() {
|
|
||||||
// // 第一次执行时,定义一个数组专门用来存储所有的参数
|
|
||||||
// var _args = Array.prototype.slice.call(arguments);
|
|
||||||
|
|
||||||
// // 在内部声明一个函数,利用闭包的特性保存_args并收集所有的参数值
|
|
||||||
// var _adder = function() {
|
|
||||||
// _args.push(...arguments);
|
|
||||||
// return _adder;
|
|
||||||
// };
|
|
||||||
|
|
||||||
// // 利用toString隐式转换的特性,当最后执行时隐式转换,并计算最终的值返回
|
|
||||||
// _adder.toString = function () {
|
|
||||||
// return _args.reduce(function (a, b) {
|
|
||||||
// return a + b;
|
|
||||||
// });
|
|
||||||
// }
|
|
||||||
// return _adder;
|
|
||||||
// }
|
|
||||||
|
|
||||||
// add(1)(2)(3) // 6
|
|
||||||
// add(1, 2, 3)(4) // 10
|
|
||||||
// add(1)(2)(3)(4)(5) // 15
|
|
||||||
// add(2, 6)(1)
|
|
||||||
|
|
||||||
// function f() {
|
|
||||||
// return 1
|
|
||||||
// }
|
|
||||||
|
|
||||||
// var obj = {
|
|
||||||
// c: true
|
|
||||||
// }
|
|
||||||
// var arr = []
|
|
||||||
// var obj1 = {
|
|
||||||
// a: 2,
|
|
||||||
// b: obj,
|
|
||||||
// c: arr,
|
|
||||||
// d:f,
|
|
||||||
// e:function () {
|
|
||||||
// return 1
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// console.log(obj1)
|
|
||||||
// var test = JSON.parse(JSON.stringify(obj1))
|
|
||||||
// console.log(test)
|
|
||||||
// var test1 = Object.assign({}, obj1)
|
|
||||||
// console.log(test1)
|
|
||||||
// obj = {
|
|
||||||
// c: false
|
|
||||||
// }
|
|
||||||
// arr = ['w']
|
|
||||||
// obj1.b = []
|
|
||||||
// console.log(obj)
|
|
||||||
// console.log(obj1)
|
|
||||||
// console.log(test)
|
|
||||||
// console.log(test1)
|
|
||||||
|
|
||||||
// var obj = {
|
|
||||||
// // set a(val) {
|
|
||||||
// // this._a_ = val * 2
|
|
||||||
// // },
|
|
||||||
// // get a() {
|
|
||||||
// // return this._a_
|
|
||||||
// // },
|
|
||||||
|
|
||||||
// }
|
|
||||||
// Object.defineProperty(
|
|
||||||
// obj,
|
|
||||||
// 'a',
|
|
||||||
// {
|
|
||||||
// set: function(val) {
|
|
||||||
// this._a_ = val * 2
|
|
||||||
// },
|
|
||||||
// get: function() {
|
|
||||||
// return this._a_
|
|
||||||
// },
|
|
||||||
|
|
||||||
// writable: false,
|
|
||||||
// enumerable: true
|
|
||||||
// }
|
|
||||||
// )
|
|
||||||
// obj.a = 2
|
|
||||||
// console.log(obj)
|
|
||||||
// console.log(obj.a)
|
|
||||||
|
|
||||||
// function Foo(who) {
|
|
||||||
// this.me = who
|
|
||||||
// }
|
|
||||||
// Foo.prototype.indetify = function() {
|
|
||||||
// return "I am" + this.me
|
|
||||||
// }
|
|
||||||
// function Bar(who) {
|
|
||||||
// Foo.call(this, who)
|
|
||||||
// }
|
|
||||||
// Bar.prototype = Object.create(Foo.prototype)
|
|
||||||
// Bar.prototype.speak = function() {
|
|
||||||
// alert('Hello,'+ this.indetify() + '.')
|
|
||||||
// }
|
|
||||||
// var b1 = new Bar('b1')
|
|
||||||
// var b2 = new Bar('b2')
|
|
||||||
// b1.speak()
|
|
||||||
// b2.speak()
|
|
||||||
|
|
||||||
// var a = [1,2,3]
|
|
||||||
// var b = [1,2,3]
|
|
||||||
// var c = "1,2,3"
|
|
||||||
// console.log(a == b)
|
|
||||||
// console.log(a == c)
|
|
||||||
// console.log(b == c)
|
|
||||||
|
|
||||||
|
|
@ -15,4 +15,27 @@
|
|||||||
|
|
||||||
* `https://github.com/mikaelbr/node-notifier`
|
* `https://github.com/mikaelbr/node-notifier`
|
||||||
|
|
||||||
* `https://www.jianshu.com/p/077c9d5928f1`
|
* `https://www.jianshu.com/p/077c9d5928f1`
|
||||||
|
|
||||||
|
# Pass By
|
||||||
|
* 千百度
|
||||||
|
* 仍然存在因为易班导致的用户流失问题
|
||||||
|
* 仍然没实现最初想的短信通知的功能
|
||||||
|
* 创建商品时有逻辑问题
|
||||||
|
* 需要和coc进行登录端的结合以及授权
|
||||||
|
* coc
|
||||||
|
* 未能实现成绩查询
|
||||||
|
* 需要将登录单独抽离成一个接口
|
||||||
|
* 学习了JavaScript
|
||||||
|
* 还剩半本没看
|
||||||
|
* 学习了flutter
|
||||||
|
* 还剩一些高级操作没学
|
||||||
|
* 学习了typeScript
|
||||||
|
* 对于vue的结合还需深入学习
|
||||||
|
* qrcode
|
||||||
|
* 可以考虑二维码的生成,放在文件夹里由百度进行加速,防止接口失效
|
||||||
|
* 可以做一个生成二维码的接口,但是做好防盗链
|
||||||
|
|
||||||
|
# Future
|
||||||
|
* codeBook
|
||||||
|
* 上边的问题一项一项解决,顺序是coc,qrcode,千百度
|
19
Miscellaneous/typescript.md
Normal file
19
Miscellaneous/typescript.md
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
# typeScript 学习笔记
|
||||||
|
|
||||||
|
* 基础类型
|
||||||
|
* any 声明为 any 的变量可以赋予任意类型的值。
|
||||||
|
* number 双精度 64 位浮点值。它可以用来表示整数和分数。
|
||||||
|
* string 一个字符系列
|
||||||
|
* boolean true false
|
||||||
|
* 数组
|
||||||
|
* `let arr: number[] = [1, 2];`
|
||||||
|
* `let arr: Array<number> = [1, 2];`
|
||||||
|
* 元组 用来表示已知元素数量和类型的数组,各元素的类型不必相同,对应位置的类型需要相同
|
||||||
|
* `let x: [string, number]; x = ['Runoob', 1];`
|
||||||
|
* enum 枚举类型用于定义数值集合。
|
||||||
|
* `enum Color {Red, Green, Blue}; let c: Color = Color.Blue; console.log(c); // 输出 2`
|
||||||
|
* void 标识方法返回值的类型,表示此方法没有返回值
|
||||||
|
* null
|
||||||
|
* undefined
|
||||||
|
* never
|
||||||
|
* 可以用 | 来支持多种类型 let x: number | null | undefined;
|
@ -1,21 +0,0 @@
|
|||||||
# 冰箱物品整理
|
|
||||||
* 一层
|
|
||||||
* 肉皮
|
|
||||||
* 饺子
|
|
||||||
* 豆角
|
|
||||||
* 一块冻干30%的肉
|
|
||||||
* 一小块黄油
|
|
||||||
* 二层
|
|
||||||
* 一堆豆角
|
|
||||||
* 蛋挞皮
|
|
||||||
* 玉米粒
|
|
||||||
* 两穗玉米
|
|
||||||
* 一袋山菜
|
|
||||||
* 冻豆腐
|
|
||||||
* 三层
|
|
||||||
* 四袋鱼
|
|
||||||
* 三穗玉米
|
|
||||||
* 未知液体
|
|
||||||
* 三袋山菜
|
|
||||||
* 玻璃叶饼
|
|
||||||
* 花卷馒头
|
|
Loading…
x
Reference in New Issue
Block a user