This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ### 使用teaset组件NavigationBar | |
| ```javascript | |
| import React from 'react'; | |
| import { withNavigation } from 'react-navigation'; | |
| import {NavigationBar,Toast} from "teaset" | |
| import observablemessagetime from '../../Mobx/messageTime' | |
| import ShopsCartStore from "../../Mobx/ShoppingCartStore" | |
| import observableOrder from '../../Mobx/ConfirmOrderStore' | |
| import {inject, observer} from "mobx-react"; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ### 适配 | |
| ```javascript | |
| /** | |
| * Created by vision on 2018/9/12. | |
| */ | |
| "use strict" | |
| import {Dimensions, StatusBar, Platform, PixelRatio} from 'react-native' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ### 找到目录 | |
| ```javascript | |
| node_modules\react-native\local-cli\server\server.js | |
| const startedCallback = logReporter => { | |
| logReporter.update({ | |
| type: 'initialize_started', | |
| port: args.port, | |
| projectRoots: args.projectRoots, | |
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ### 调用 | |
| ```javascript | |
| import { inject, observer } from 'mobx-react'; | |
| @observer | |
| export default class ShoppingCart extends Component { | |
| constructor(props) { | |
| super(props); | |
| this.state = { | |
| all_checked:false, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ### 插件使用 | |
| ```javascript | |
| yarn add react-native-fs | |
| react-native link react-native-fs | |
| ``` | |
| ### 封装保存图片方法 | |
| ```javascript | |
| /** | |
| * Created by vision on 2018/8/27. | |
| */ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ### promise实现ajax | |
| ```JavaScript | |
| var getJSON = function(url) { | |
| var promise = new Promise(function(resolve, reject){ | |
| var client = new XMLHttpRequest(); | |
| client.open("GET", url); | |
| client.onreadystatechange = handler; | |
| client.responseType = "json"; | |
| client.setRequestHeader("Accept", "application/json"); | |
| client.send(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 使用Android studio生成一个key文件 | |
| ```html | |
| build->Generate Signed APK | |
| key store path选择jks文件保存位置 | |
| Password confirm | |
| Alias 别名 | |
| 别名密码 | |
| Ciountry Code :ch | |
| ``` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ### 递归拷贝 | |
| ```javascript | |
| var clone = function(obj) { | |
| var newObj = obj.constructor === Array ? [] : {}; | |
| for( var key in obj) { | |
| newObj[key] = typeof obj[key] === 'Object' ? clone(obj[key]) : obj[key]; | |
| } | |
| return newObj; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ``` | |
| <!DOCTYPE html> | |
| <html lang="en"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <title>Title</title> | |
| <style> | |
| .fl { | |
| float: left; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 网易云音乐外链、下载方法 | |
| 网上搜索了很多方法,有的需要安装软件,都不好用。 | |
| 今天889网公开一个快捷的方法,并切外链地址长期有效,很简单的方法: | |
| 第一步打开网易云音乐,随便找到一首歌,播放,复制网址的ID, | |
| 例如:杨钰莹的心雨,网址是: | |
| http://music.163.com/#/song?id=317151 | |
| 很明显,ID是317151 | |
| 那么,这首歌的真实地址就是: | |
| http://music.163.com/song/media/outer/url?id=317151.mp3 |