{"id":494,"date":"2023-02-25T14:13:36","date_gmt":"2023-02-25T06:13:36","guid":{"rendered":"https:\/\/www.appblog.cn\/?p=494"},"modified":"2023-04-29T20:50:06","modified_gmt":"2023-04-29T12:50:06","slug":"react-native-learning-viewpagerandroid-as-guide-page","status":"publish","type":"post","link":"https:\/\/www.appblog.cn\/index.php\/2023\/02\/25\/react-native-learning-viewpagerandroid-as-guide-page\/","title":{"rendered":"React Native\u5b66\u4e60\u4e4bViewPagerAndroid\u505a\u5f15\u5bfc\u9875"},"content":{"rendered":"<p>\u5b9e\u6218\uff1a\u4f7f\u7528<code>ViewPagerAndroid<\/code>\u5b9e\u73b0\u5f15\u5bfc\u9875<\/p>\n<p>\u6d89\u53ca\u7684\u77e5\u8bc6\u70b9\uff1a<\/p>\n<ul>\n<li>\u7ec4\u4ef6\u5982\u4f55\u8054\u52a8<\/li>\n<li>\u7b26\u5408ES6\u7684\u6807\u51c6\u5199\u6cd5<\/li>\n<li>\u7ec4\u4ef6\u7684\u5c01\u88c5\uff0c\u975e\u5e38\u7075\u6d3b<\/li>\n<li>Navigator\u8def\u7531\u7684\u7528\u6cd5<\/li>\n<\/ul>\n<p><!-- more --><\/p>\n<h3>index.android.js<\/h3>\n<pre><code class=\"language-javascript\">\/**\n * Sample React Native App\n * https:\/\/github.com\/facebook\/react-native\n *\/\n\nimport React, { Component } from &#039;react&#039;;\nimport {\n    AppRegistry,\n    StyleSheet,\n    Text,\n    Image,\n    TouchableOpacity,\n    ViewPagerAndroid,\n    Navigator,\n    View\n} from &#039;react-native&#039;;\n\nimport LikeCount from &#039;.\/LikeCount.js&#039;;  \/\/\u5bfc\u5165\u201c\u559c\u6b22\u6570\u201d\u7ec4\u4ef6\nimport Button from &#039;.\/Button.js&#039;;  \/\/\u5bfc\u5165\u201c\u81ea\u5b9a\u4e49\u7684\u6309\u94ae\u201d\u7ec4\u4ef6\nimport HomeUI from &#039;.\/HomeUI.js&#039;;  \/\/\u5bfc\u5165\u201c\u9996\u9875\u201d\u7ec4\u4ef6\n\nconst PAGES = 5;\n\nconst BGCOLOR = [&#039;#fdc08e&#039;, &#039;#fff6b9&#039;, &#039;#99d1b7&#039;, &#039;#dde5fe&#039;, &#039;#f79273&#039;];\n\nconst IMAGE_URIS = [\n  &#039;http:\/\/apod.nasa.gov\/apod\/image\/1410\/20141008tleBaldridge001h990.jpg&#039;,\n  &#039;http:\/\/apod.nasa.gov\/apod\/image\/1409\/volcanicpillar_vetter_960.jpg&#039;,\n  &#039;http:\/\/apod.nasa.gov\/apod\/image\/1409\/m27_snyder_960.jpg&#039;,\n  &#039;http:\/\/apod.nasa.gov\/apod\/image\/1409\/PupAmulti_rot0.jpg&#039;,\n  &#039;https:\/\/www.baidu.com\/img\/bd_logo1.png&#039;,\n];\n\n\/\/\u8fdb\u5ea6\u6761\u7ec4\u4ef6\nclass ProgressBar extends Component {\n    constructor(props) {\n        super(props);\n    }\n\n    render() {\n        \/\/\u5f53\u524d\u4f4d\u7f6e+\u504f\u79fb\u91cf\n        var fractionalPosition = (this.props.progress.position + this.props.progress.offset);\n        var progressBarSize = (fractionalPosition \/ (PAGES - 1)) * this.props.size;\n        return(\n            \/\/\u8fdb\u5ea6\u6761\u4f7f\u75282\u4e2aView\u5b9e\u73b0\uff0c\u901a\u8fc7\u5bbd\u5ea6\u8868\u793a\u8fdb\u5ea6\n            \/\/progressBarSize\u5f53\u524d\u7684\u8fdb\u5ea6\n            \/\/this.props.size\u8fdb\u5ea6\u6761\u7684\u603b\u957f\u5ea6\n            &lt;View style={[styles.progressBarContainer, {width: this.props.size}]}&gt;\n                &lt;View style={[styles.progressBar, {width: progressBarSize}]}\/&gt;\n            &lt;\/View&gt;\n        );\n    }\n}\n\nclass WelcomeUI extends Component {\n    \/\/\u6b22\u8fce\u9875\u9762\uff0c\u4f7f\u7528Viewpager\u5b9e\u73b0\n\n    \/\/null is not an object \u89e3\u51b3\u529e\u6cd5\uff1a\u521d\u59cb\u5316\u7684\u65f6\u5019\u8981\u7528constructor \u800c\u4e0d\u662fgetInitialState\n    \/\/\u5f53\u524d\u4f7f\u7528 ES6 \u4f5c\u4e3a\u6807\u51c6\u7f16\u7a0b\u89c4\u8303\n\n    \/\/React Native \u7ec4\u4ef6\u4e2d\u5fc5\u987b\u4f7f\u7528\u6784\u9020\u51fd\u6570\u521d\u59cb\u5316 state\n\n    \/\/\u7528\u6784\u9020\u51fd\u6570\u6765\u66ff\u4ee3\u4e4b\u524d\u7684 Initial\u5b9e\u4f8b\u5316\n    constructor(props) {\n        super(props);\n        this.state = {\n            page: 0,\n            animationsAreEnabled: true, \/\/\u52a8\u753b\u662f\u5426\u5f00\u542f\n            progress: {\n                position: 0,\n                offset: 0,\n            },\n        };\n    }\n\n    \/\/See React on ES6+\n    onPageSelected = (e)=&gt;{\n        \/\/\u8fd9\u4e2a\u56de\u8c03\u4f1a\u5728\u9875\u9762\u5207\u6362\u5b8c\u6210\u540e\uff08\u5f53\u7528\u6237\u5728\u9875\u9762\u95f4\u6ed1\u52a8\uff09\u8c03\u7528\n        \/\/\u56de\u8c03\u53c2\u6570\u4e2d\u7684event.nativeEvent\u5bf9\u8c61\n        this.setState({page: e.nativeEvent.position});\n    }\n\n    onPageScroll = (e)=&gt;{\n        \/\/\u5f53\u5728\u9875\u95f4\u5207\u6362\u65f6\uff08\u4e0d\u8bba\u662f\u7531\u4e8e\u52a8\u753b\u8fd8\u662f\u7531\u4e8e\u7528\u6237\u5728\u9875\u95f4\u6ed1\u52a8\/\u62d6\u62fd\uff09\u6267\u884c\u3002\n        \/\/\u56de\u8c03\u53c2\u6570\u4e2d\u7684event.nativeEvent\u5bf9\u8c61\u4f1a\u5305\u542b\u5982\u4e0b\u6570\u636e\uff1a\n        \/\/position: \u4ece\u5de6\u6570\u8d77\u7b2c\u4e00\u4e2a\u5f53\u524d\u53ef\u89c1\u7684\u9875\u9762\u7684\u4e0b\u6807\n        \/\/offset: \u4e00\u4e2a\u5728[0,1)\uff08\u5927\u4e8e\u7b49\u4e8e0\uff0c\u5c0f\u4e8e1\uff09\u4e4b\u95f4\u7684\u8303\u56f4\uff0c\u4ee3\u8868\u5f53\u524d\u9875\u9762\u5207\u6362\u7684\u72b6\u6001\u3002\u503cx\u8868\u793a\u73b0\u5728&quot;position&quot;\u6240\u8868\u793a\u7684\u9875\u6709(1 - x)\u7684\u90e8\u5206\u53ef\u89c1\uff0c\u800c\u4e0b\u4e00\u9875\u6709x\u7684\u90e8\u5206\u53ef\u89c1\u3002\n        this.setState({progress:e.nativeEvent});\n    }\n\n    move(delta) {\n        var page = this.state.page + delta;\n        this.go(page);\n    }\n\n    go(page) {\n        if(this.state.animationsAreEnabled) {\n            this.viewPager.setPage(page);\n        } else {\n            this.viewPager.setPageWithoutAnimation(page);\n        }\n        \/\/\u5237\u65b0\n        this.setState({page});\n    }\n\n    onClick = ()=&gt;{\n        \/\/alert(&#039;\u70b9\u51fb&#039;);\n        const { navigator } = this.props;\n        \/\/\u4e3a\u4ec0\u4e48\u8fd9\u91cc\u53ef\u4ee5\u53d6\u5f97 props.navigator?\u8bf7\u770b\u4e0a\u6587:\n        \/\/&lt;Component {...route.params} navigator={navigator} \/&gt;\n        \/\/\u8fd9\u91cc\u4f20\u9012\u4e86navigator\u4f5c\u4e3aprops\n        if(navigator) {\n            navigator.push({\n                name: &#039;HomeUI&#039;,\n                component: HomeUI,\n           })\n        }\n    }\n\n    render() {\n        const thunbsUp = &#039;\\uD83D\\uDC4D&#039;;\n        var pages=[];\n        for(var i=0; i&lt;PAGES; i++) {\n            var pageStyle = {\n                backgroundColor: BGCOLOR[i % BGCOLOR.length],\n                alignItems: &#039;center&#039;,\n                padding: 20,\n            };\n            if (i &lt; PAGES-1) {\n                \/\/\u524d\u9762\u51e0\u4e2aViewpage\n                \/\/collapsable: \u5982\u679c\u4e00\u4e2aView\u53ea\u7528\u4e8e\u5e03\u5c40\u5b83\u7684\u5b50\u7ec4\u4ef6\uff0c\u5219\u5b83\u53ef\u80fd\u4f1a\u4e3a\u4e86\u4f18\u5316\u800c\u4ece\u539f\u751f\u5e03\u5c40\u6811\u4e2d\u79fb\u9664\u3002\n                \/\/\u628a\u6b64\u5c5e\u6027\u8bbe\u4e3afalse\u53ef\u4ee5\u7981\u7528\u8fd9\u4e2a\u4f18\u5316\uff0c\u4ee5\u786e\u4fdd\u5bf9\u5e94\u89c6\u56fe\u5728\u539f\u751f\u7ed3\u6784\u4e2d\u5b58\u5728\u3002\n                pages.push(\n                    &lt;View key={i} style={pageStyle} collapsable={false}&gt;\n                        &lt;Image\n                            style={styles.image}\n                            source={{uri: IMAGE_URIS[i % BGCOLOR.length]}}\n                            \/&gt;\n                        &lt;LikeCount \/&gt;\n                    &lt;\/View&gt;\n                );\n            } else {\n                \/\/\u6700\u540e\u4e00\u4e2aviewpage \u52a0\u4e86\u4e00\u4e2a\u6309\u94ae\n                pages.push(\n                    &lt;View key={i} style={pageStyle} collapsable={false}&gt;\n                        &lt;Image\n                            style={styles.image}\n                            source={{uri: IMAGE_URIS[i % BGCOLOR.length]}}\n                            \/&gt;\n                        &lt;LikeCount \/&gt;\n                        &lt;TouchableOpacity onPress={this.onClick} style={styles.startupButton}&gt;\n                            &lt;Text style={styles.likesText}&gt; {thunbsUp + &#039;\u542f\u52a8\u9996\u9875&#039;} &lt;\/Text&gt;\n                        &lt;\/TouchableOpacity&gt;\n                    &lt;\/View&gt;\n                );\n            }\n        }\n\n        var { page, animationsAreEnabled } = this.state;\n        \/\/\u7b49\u6548\u4e8e\n        \/\/var page = this.state.page;\n        \/\/var animationsAreEnabled = this.state.animationsAreEnabled;\n\n        return (\n            &lt;View style={styles.container}&gt;\n                &lt;ViewPagerAndroid\n                    style={styles.viewPager}\n                    initialPage={0}\n                    onPageScroll={this.onPageScroll}\n                    onPageSelected={this.onPageSelected}\n                    ref={viewPager =&gt; { this.viewPager = viewPager; }}\n                    &gt;\n                    {pages}\n                &lt;\/ViewPagerAndroid&gt;\n\n                &lt;View style={styles.buttons}&gt;\n                    { animationsAreEnabled ?\n                    &lt;Button\n                        text=&quot;Turn off animations&quot;\n                        enabled={true}\n                        onPress={() =&gt; this.setState({animationsAreEnabled: false})}\n                        \/&gt; :\n                    &lt;Button\n                        text=&quot;Turn animations back on&quot;\n                        enabled={true}\n                        onPress={() =&gt; this.setState({animationsAreEnabled: true})}\n                        \/&gt;\n                    }\n                &lt;\/View&gt;\n\n                &lt;View style={styles.buttons}&gt;\n                    &lt;Button text=&quot;Start&quot; enabled={page &gt; 0} onPress={() =&gt; this.go(0)}\/&gt;\n                    &lt;Button text=&quot;Prev&quot; enabled={page &gt; 0} onPress={() =&gt; this.move(-1)}\/&gt;\n\n                    &lt;Text style={styles.buttonText}&gt;\u9875\uff1a{page + 1} \/ {PAGES}&lt;\/Text&gt;\n                    &lt;ProgressBar size={100} progress={this.state.progress}\/&gt;\n\n                    &lt;Button text=&quot;Next&quot; enabled={page &lt; PAGES - 1} onPress={() =&gt; this.move(1)}\/&gt;\n                    &lt;Button text=&quot;Last&quot; enabled={page &lt; PAGES - 1} onPress={() =&gt; this.go(PAGES - 1)}\/&gt;\n                 &lt;\/View&gt;\n            &lt;\/View&gt;\n        );\n    }\n}\n\nclass RNAPP extends Component {\n    render() {\n        let defaultName=&#039;WelcomeUI&#039;;\n        let defaultComponent=WelcomeUI;\n        return (\n            &lt;Navigator\n                initialRoute={{ name: defaultName, component: defaultComponent }}\n                \/\/\u914d\u7f6e\u573a\u666f\n                configureScene={\n                    (route) =&gt; {\n                        \/\/\u9875\u9762\u4e4b\u95f4\u8df3\u8f6c\u7684\u52a8\u753b\uff0c\u5177\u4f53\u503c\u53ef\u4ee5\u67e5\u770b\u6e90\u4ee3\u7801: node_modules\/react-native\/Libraries\/CustomComponents\/Navigator\/NavigatorSceneConfigs.js\n                        return Navigator.SceneConfigs.FloatFromRight;\n                    }\n                }\n                renderScene={\n                    (route, navigator) =&gt; {\n                        let Component = route.component;\n                        return &lt;Component {...route.params} navigator={navigator} \/&gt;\n                    }\n                }\n            \/&gt;\n        );\n    }\n}\n\nconst styles = StyleSheet.create({\n    buttons: {\n        flexDirection: &#039;row&#039;,\n        height: 30,\n        backgroundColor: &#039;black&#039;,\n        alignItems: &#039;center&#039;,\n        justifyContent: &#039;space-between&#039;,\n    },\n    container: {\n        flex: 1,\n        backgroundColor: &#039;white&#039;,\n    },\n    image: {\n        width: 300,\n        height: 200,\n        padding: 20,\n    },\n    startupButton:{\n        backgroundColor: &#039;rgba(0, 0, 0, 0.1)&#039;,\n        borderColor: &#039;#333333&#039;,\n        borderWidth: 1,\n        borderRadius: 5,\n        margin: 8,\n        padding: 8,\n    },\n    progressBarContainer: {\n        height: 10,\n        margin: 10,\n        borderColor: &#039;#eeeeee&#039;,\n        borderWidth: 2,\n    },\n    progressBar: {\n        alignSelf: &#039;flex-start&#039;,\n        flex: 1,\n        backgroundColor: &#039;#ff0000&#039;,\n    },\n    viewPager: {\n        flex: 1,\n    },\n    buttonText: {\n        color: &#039;white&#039;,\n    },\n});\n\nAppRegistry.registerComponent(&#039;RNAPP&#039;, () =&gt; RNAPP);<\/code><\/pre>\n<h3>LikeCount.js<\/h3>\n<pre><code class=\"language-javascript\">\/**\n * Sample React Native App\n * https:\/\/github.com\/facebook\/react-native\n *\/\n\nimport React, { Component } from &#039;react&#039;;\nimport {\n    AppRegistry,\n    StyleSheet,\n    Text,\n    TouchableOpacity,\n    View\n} from &#039;react-native&#039;;\n\n\/\/\u70b9\u8d5e\u6570\u7ec4\u4ef6\uff0cES6\u8bed\u6cd5\nexport default class LikeCount extends Component {\n    constructor(props){\n        super(props);\n            this.state={\n            likes:0,\n        };\n    }\n\n    onClick = ()=&gt;{\n        this.setState({likes: this.state.likes + 1});\n    }\n\n    render() {\n        \/\/\u70b9\u8d5e\u7684\u5c0f\u56fe\u6807\uff0cemoji\u8868\u60c5\uff0c\u4f7f\u7528unicode\u7f16\u7801\n        const thunbsUp=&#039;\\uD83D\\uDC4D&#039;;\n        return (\n            &lt;View style={styles.likeContainer}&gt;\n                &lt;TouchableOpacity onPress={this.onClick} style={styles.likeButton}&gt;\n                    &lt;Text style={styles.likesText}&gt;{thunbsUp+&#039;Like&#039;}&lt;\/Text&gt;\n                &lt;\/TouchableOpacity&gt;\n                &lt;Text style={styles.likesText}&gt;{this.state.likes+&#039;\u4e2a\u559c\u6b22\u6570&#039;}&lt;\/Text&gt;\n            &lt;\/View&gt;\n        );\n    }\n}\n\nconst styles = StyleSheet.create({\n    likeButton: {\n        backgroundColor: &#039;rgba(0, 0, 0, 0.1)&#039;,\n        borderColor: &#039;#333333&#039;,\n        borderWidth: 1,\n        borderRadius: 5,\n        flex: 1,\n        margin: 8,\n        padding: 8,\n    },\n    likeContainer: {\n        flexDirection: &#039;row&#039;,\n    },\n    likesText: {\n        flex: 1,\n        fontSize: 18,\n        alignSelf: &#039;center&#039;,\n    },\n});<\/code><\/pre>\n<h3>Button.js<\/h3>\n<pre><code class=\"language-javascript\">\/**\n * Sample React Native App\n * https:\/\/github.com\/facebook\/react-native\n *\/\n\nimport React, { Component } from &#039;react&#039;;\nimport {\n    AppRegistry,\n    StyleSheet,\n    Text,\n    TouchableWithoutFeedback,\n    View\n} from &#039;react-native&#039;;\n\n\/\/\u5f00\u59cb \u524d\u8fdb \u540e\u9000 \u6700\u540e \u5f00\u542f\/\u5173\u95ed\u52a8\u753b 5\u4e2a\u6309\u94ae\u7684\u901a\u7528\u5199\u6cd5\nexport default class Button extends Component {\n    constructor(props) {\n        super(props);\n    }\n\n    _handlePress = ()=&gt;{\n        if (this.props.enabled &amp;&amp; this.props.onPress) {\n            \/\/\u6309\u94ae\u53ef\u7528\uff0c\u6ca1\u6709\u53d8\u7070\uff0c\u5219\u542f\u7528\u6309\u94ae\u7684onPress()\u65b9\u6cd5\n            this.props.onPress();\n        }\n    }\n\n    render() {\n        \/\/\u8fd9\u4e2aView\u67092\u4e2a\u6837\u5f0f\uff0c\u7b2c\u4e8c\u4e2a\u6837\u5f0f\u662f\u7528\u6765\u8986\u76d6\u7684\uff08\u52a0\u4e86\u80cc\u666f\u989c\u8272\u548c\u900f\u660e\u5ea6\uff09\n        return(\n            &lt;TouchableWithoutFeedback onPress={this._handlePress}&gt;\n                &lt;View style={[styles.button, this.props.enabled ? {} : styles.buttonDisabled]}&gt;\n                    &lt;Text style={styles.buttonText}&gt;{this.props.text}&lt;\/Text&gt;\n                &lt;\/View&gt;\n            &lt;\/TouchableWithoutFeedback&gt;\n        );\n    }\n}\n\nconst styles = StyleSheet.create({\n    button: {\n        flex: 1,\n        width: 0,\n        margin: 5,\n        borderColor: &#039;gray&#039;,\n        borderWidth: 1,\n        backgroundColor: &#039;gray&#039;,\n    },\n    buttonDisabled: {\n        backgroundColor: &#039;black&#039;,\n        opacity: 0.5,\n    },\n    buttonText: {\n        color: &#039;white&#039;,\n    },\n});<\/code><\/pre>\n<h3>Button.js<\/h3>\n<pre><code class=\"language-javascript\">\/**\n * Sample React Native App\n * https:\/\/github.com\/facebook\/react-native\n *\/\n\nimport React, { Component } from &#039;react&#039;;\nimport {\n    AppRegistry,\n    StyleSheet,\n    Text,\n    View\n} from &#039;react-native&#039;;\n\nexport default class HomeUI extends Component {\n    goBack() {\n        const { navigator } = this.props;\n        if(navigator) {\n            \/\/\u5f88\u719f\u6089\u5427\uff0c\u5165\u6808\u51fa\u6808~ \u628a\u5f53\u524d\u7684\u9875\u9762pop\u6389\uff0c\u5373\u53ef\u8fd4\u56de\u4e0a\u4e00\u4e2a\u9875\u9762\n            navigator.pop();\n        }\n    }\n\n    render() {\n        return (\n            &lt;View style={styles.container}&gt;\n                &lt;Text style={styles.welcome} onPress={this.goBack.bind(this)}&gt;\n                    Welcome to React Native!{&#039;\\n&#039;}\n                &lt;\/Text&gt;\n                &lt;Text style={styles.instructions}&gt;\n                    To get started, edit index.android.js\n                &lt;\/Text&gt;\n                &lt;Text style={styles.instructions}&gt;\n                    Double tap R on your keyboard to reload,{&#039;\\n&#039;}\n                    Shake or press menu button for dev menu{&#039;\\n&#039;}\n                    Powered by rnapp.cc\n                &lt;\/Text&gt;\n            &lt;\/View&gt;\n        );\n    }\n}\n\nconst styles = StyleSheet.create({\n    container: {\n        flex: 1,\n        justifyContent: &#039;center&#039;,\n        alignItems: &#039;center&#039;,\n        backgroundColor: &#039;#F5FCFF&#039;,\n    },\n    welcome: {\n        fontSize: 20,\n        textAlign: &#039;center&#039;,\n        margin: 10,\n    },\n    instructions: {\n        textAlign: &#039;center&#039;,\n        color: &#039;#333333&#039;,\n        marginBottom: 5,\n    },\n});<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\u5b9e\u6218\uff1a\u4f7f\u7528ViewPagerAndroid\u5b9e\u73b0\u5f15\u5bfc\u9875 \u6d89\u53ca\u7684\u77e5\u8bc6\u70b9\uff1a \u7ec4\u4ef6\u5982\u4f55\u8054\u52a8 \u7b26\u5408ES6\u7684\u6807\u51c6\u5199\u6cd5 \u7ec4\u4ef6 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[163],"tags":[],"class_list":["post-494","post","type-post","status-publish","format-standard","hentry","category-react-native"],"_links":{"self":[{"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/posts\/494","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/comments?post=494"}],"version-history":[{"count":0,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/posts\/494\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/media?parent=494"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/categories?post=494"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/tags?post=494"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}