{"id":30040,"date":"2024-11-25T14:24:27","date_gmt":"2024-11-25T06:24:27","guid":{"rendered":"https:\/\/fwq.ai\/blog\/30040\/"},"modified":"2024-11-25T14:24:27","modified_gmt":"2024-11-25T06:24:27","slug":"%e5%b0%8f%e7%a8%8b%e5%ba%8f%e5%bc%80%e5%8f%91%e4%b9%8b%e7%83%ad%e9%97%a8%e7%94%b5%e5%bd%b1","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/30040\/","title":{"rendered":"\u5c0f\u7a0b\u5e8f\u5f00\u53d1\u4e4b\u70ed\u95e8\u7535\u5f71"},"content":{"rendered":"<p>\u5728\u8fd9\u7bc7\u5fae\u4fe1\u5c0f\u7a0b\u5e8f\u5f00\u53d1\u6559\u7a0b\u4e2d\uff0c\u6211\u4eec\u5c06\u4ecb\u7ecd\u5982\u4f55\u4f7f\u7528\u5fae\u4fe1\u5c0f\u7a0b\u5e8f\u5f00\u53d1\u70ed\u95e8\u7535\u5f71\u53ca\u9884\u89c8\u529f\u80fd\u3002<\/p>\n<p>\u672c\u6587\u4e3b\u8981\u5206\u4e3a\u4e24\u4e2a\u90e8\u5206\uff0c\u5c0f\u7a0b\u5e8f\u4e3b\u4f53\u90e8\u5206\u53ca\u7535\u5f71\u4e3b\u9875\u548c\u8be6\u60c5\u9875\u9875\u9762\u90e8\u5206<\/p>\n<h2>\u4e00\u3001\u5c0f\u7a0b\u5e8f\u4e3b\u4f53\u90e8\u5206<\/h2>\n<p>\u4e00\u4e2a\u5c0f\u7a0b\u5e8f\u4e3b\u4f53\u90e8\u5206\u7531\u4e09\u4e2a\u6587\u4ef6\u7ec4\u6210\uff0c\u5fc5\u987b\u653e\u5728\u9879\u76ee\u7684\u6839\u76ee\u5f55\uff0c\u5982\u4e0b\uff1a<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/000\/001\/505\/c2287526a792b52539ac723beb27193d-0.png\" class=\"aligncenter\" title=\"\u5c0f\u7a0b\u5e8f\u5f00\u53d1\u4e4b\u70ed\u95e8\u7535\u5f71\u63d2\u56fe\" alt=\"\u5c0f\u7a0b\u5e8f\u5f00\u53d1\u4e4b\u70ed\u95e8\u7535\u5f71\u63d2\u56fe\" \/><\/p>\n<p>1. \u5c0f\u7a0b\u5e8f\u903b\u8f91<\/p>\n<pre>App({\r\n  onLaunch: function() { \r\n    \/\/ Do something initial when launch.  },\r\n  onShow: function() {      \/\/ Do something when show.  },\r\n  onHide: function() {      \/\/ Do something when hide.  },\r\n  globalData: 'I am global data'})<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>2. \u5c0f\u7a0b\u5e8f\u516c\u5171\u8bbe\u7f6e<\/p>\n<p>\u4e3b\u8981\u6ce8\u518c\u4e24\u4e2a\u9875\u9762\uff0c\u70ed\u95e8\u7535\u5f71\u7684\u4e3b\u9875\u53ca\u8be6\u60c5\u9875<\/p>\n<pre>{\r\n  \"pages\":[\r\n    \"pages\/index\/index\",\r\n    \"pages\/details\/details\"\r\n  ],\r\n  \"window\":{\r\n    \"backgroundTextStyle\":\"light\",\r\n    \"navigationBarBackgroundColor\": \"#FF4D64\",\r\n    \"navigationBarTitleText\": \"\u70ed\u95e8\u7535\u5f71\",\r\n    \"backgroundColor\":\"#FFF\",\r\n    \"navigationBarTextStyle\":\"white\"\r\n  }\r\n}<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<h2>\u4e8c\u3001\u7535\u5f71\u9875\u9762\u90e8\u5206<\/h2>\n<p>\u5c0f\u7a0b\u5e8f\u9875\u9762\u4e3b\u8981\u7531\u4ee5\u4e0b\u6587\u4ef6\u7ec4\u6210\u3002<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/000\/001\/505\/c2287526a792b52539ac723beb27193d-1.png\" class=\"aligncenter\" title=\"\u5c0f\u7a0b\u5e8f\u5f00\u53d1\u4e4b\u70ed\u95e8\u7535\u5f71\u63d2\u56fe1\" alt=\"\u5c0f\u7a0b\u5e8f\u5f00\u53d1\u4e4b\u70ed\u95e8\u7535\u5f71\u63d2\u56fe1\" \/><\/p>\n<p>\u672c\u9879\u76ee\u7a0b\u5e8f\u5206\u4e3a\u4e24\u4e2a\u9875\u9762\uff1a\u4e3b\u9875\u53ca\u8be6\u60c5\u9875\u3002<\/p>\n<h3>\u4e3b\u9875\u90e8\u5206<\/h3>\n<p>\u4e3b\u9875\u6548\u679c\u56fe\u5982\u4e0b<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/000\/001\/505\/5c2f3e9183b9e9dd127b8dbccd608a0f-2.png\" class=\"aligncenter\" title=\"\u5c0f\u7a0b\u5e8f\u5f00\u53d1\u4e4b\u70ed\u95e8\u7535\u5f71\u63d2\u56fe2\" alt=\"\u5c0f\u7a0b\u5e8f\u5f00\u53d1\u4e4b\u70ed\u95e8\u7535\u5f71\u63d2\u56fe2\" \/><\/p>\n<p>1. \u9875\u9762\u7ed3\u6784<\/p>\n<p>\u5176\u9875\u9762\u7ed3\u6784\u4ee3\u7801\u5982\u4e0b<\/p>\n<pre>&lt;loading hidden=\"{{loading}}\"&gt;\r\n  \u52a0\u8f7d\u4e2d...&lt;\/loading&gt;&lt;scroll-view class=\"container img-content\" style=\"height: {{windowHeight}}px; width: {{windowWidth}}px; \" scroll-y=\"true\" bindscrolltoupper=\"pullDownRefresh\" bindscrolltolower=\"pullUpLoad\" lower-threshold=\"800\"&gt;\r\n    &lt;navigator class=\"list flex-box\" wx:for=\"{{films}}\" url=\"..\/details\/details?title=navigate&amp;id={{item.id}}&amp;titles={{item.nm}}\"&gt;\r\n        &lt;view class=\"list-img\"&gt;&lt;image class=\"img\" src=\"{{item.img}}\"&gt;&lt;\/image&gt;&lt;image class=\"list-play\" src=\"..\/..\/images\/i-play.png\"&gt;&lt;\/image&gt;&lt;\/view&gt;\r\n        &lt;view class=\"list-main flex-btn\"&gt;\r\n            &lt;view class=\"list-title list-brief\"&gt;\r\n                &lt;text&gt;{{item.nm}}&lt;\/text&gt;\r\n                &lt;test class=\"i-imax\" wx:if=\"{{item.imax &amp;&amp; item['3d']}}\" src=\"..\/..\/tests\/i-imax.png\"&gt;3Dimax&lt;\/test&gt;\r\n                &lt;test class=\"i-imax\" wx:elif=\"{{item['3d']}}\" src=\"..\/..\/images\/i-play.png\"&gt;3d&lt;\/test&gt;\r\n                &lt;test class=\"i-imax\" wx:elif=\"{{item['imax']}}\" src=\"..\/..\/tests\/i-star.png\"&gt;imax&lt;\/test&gt;\r\n                &lt;test class=\"i-imax\" wx:else=\"{{item['imax']}}\" src=\"..\/..\/images\/i-stars.png\"&gt;2d&lt;\/test&gt;\r\n            &lt;\/view&gt;\r\n            &lt;view class=\"list-size\" wx:if=\"{{!item.preSale}}\"&gt;&lt;view class=\"star\"&gt;&lt;view style=\"width: {{item.sc * 10}}%\" class=\"stars\"&gt;&lt;\/view&gt;&lt;\/view&gt;{{item.sc}}&lt;\/view&gt;\r\n            &lt;view class=\"list-brief\" wx:if=\"{{item.preSale}}\"&gt;&lt;text class=\"wish\"&gt;{{item.wish}}\u4eba\u60f3\u770b&lt;\/text&gt;{{item.showInfo}}&lt;\/view&gt;\r\n            &lt;view class=\"list-brief\"&gt;{{item.scm}}&lt;\/view&gt;\r\n            &lt;view class=\"list-brief\"&gt;{{item.dir}} {{item.star}}&lt;\/view&gt;\r\n            &lt;view class=\"list-sale\"&gt;&lt;text wx:if=\"{{!item.preSale}}\" class=\"sales\"&gt;\u8d2d\u7968&lt;\/text&gt;&lt;text wx:if=\"{{item.preSale}}\" class=\"pre-sale\"&gt;\u9884\u552e&lt;\/text&gt;&lt;\/view&gt;\r\n        &lt;\/view&gt;\r\n    &lt;\/navigator&gt;&lt;\/scroll-view&gt;<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p><span style=\"line-height: 1.5\">2. \u6837\u5f0f\u8868<\/span><\/p>\n<p>\u6837\u5f0f\u4ee3\u7801\u5982\u4e0b\u6240\u793a<\/p>\n<pre>\/**index.wxss**\/.flex-box{\r\n    display: flex;\r\n}.flex-btn{\r\n    flex: 1;\r\n}.list{\r\n    border-bottom: 1rpx solid #e5e5e5;\r\n    padding: 30rpx;\r\n}.list-img{\r\n    width: 130rpx;\r\n    height: 180rpx;\r\n    margin-right: 20rpx;\r\n    position: relative;\r\n}.list-img .img{\r\n    width: 130rpx;\r\n    height: 180rpx;\r\n}.list-play{\r\n    position: absolute;\r\n    left: 45rpx;\r\n    top: 70rpx;\r\n    width: 40rpx;\r\n    height: 40rpx;\r\n}.list-title{\r\n    height: 52rpx;\r\n}.list-title text{\r\n    font-size: 18px;\r\n    line-height: 52rpx;\r\n    color: #000;\r\n}.i-imax{\r\n    width: 52rpx;\r\n    height: 28rpx;\r\n    margin-left: 10rpx;\r\n}.list-size{\r\n    height: 40rpx;\r\n    font-size: 14px;\r\n    color: #8a869e;\r\n}.list-size .star{\r\n    width: 100rpx;\r\n    height: 20rpx;\r\n    background: url(..\/..\/images\/i-star.png) no-repeat;\r\n    background-size: 100rpx;\r\n    display: inline-block;\r\n    margin-right: 10rpx;\r\n}.stars{\r\n    width: 100rpx;\r\n    height: 20rpx;\r\n    background: url(..\/..\/images\/i-stars.png) no-repeat;\r\n    background-size: 100rpx;\r\n    float: left;\r\n    margin-right: 10rpx;\r\n}.list-brief{\r\n    font-size: 12px;\r\n    line-height: 48rpx;\r\n    color: #666;\r\n    overflow: hidden;\r\n    text-overflow: ellipsis;\r\n    white-space: nowrap;\r\n    width: 400rpx;\r\n}.list-brief .wish{\r\n    color: #108ee9;\r\n    border-right: 1rpx solid #666;\r\n    padding-right: 10rpx;\r\n    margin-right: 10rpx;\r\n}.list-main{\r\n    position: relative;\r\n}.list-sale{\r\n    position: absolute;\r\n    right: 10rpx;\r\n    top: 70rpx;\r\n}.list-sale text{\r\n    padding: 10rpx 18rpx;\r\n    border: 1rpx solid #37b7ff;\r\n    font-size: 14px;\r\n    color: #37b7ff;\r\n    border-radius: 6rpx;\r\n}.list-sale .pre-sale{\r\n    border: 1rpx solid #fea54c;\r\n    color: #fea54c;\r\n}<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p><span style=\"line-height: 1.5\">3\u3001 \u9875\u9762\u903b\u8f91\u5904\u7406<\/span><\/p>\n<pre>\/\/index.jsPage({\r\n  data: {\r\n    films: [],\r\n    limit: 6,\r\n    loading: false,\r\n    windowHeight: 0,\r\n    windowWidth: 0\r\n  },\r\n  onLoad: function () {    this.setData({\r\n      loading: false\r\n    })\r\n  },\r\n  onShow: function(){    var that = this\r\n    wx.request({\r\n      url: 'http:\/\/m.maoyan.com\/movie\/list.json', \/\/\u4ec5\u4e3a\u793a\u4f8b\uff0c\u5e76\u975e\u771f\u5b9e\u7684\u63a5\u53e3\u5730\u5740      data: {\r\n        offset: 0,\r\n        type: 'hot',\r\n        limit: that.data.limit\r\n      },\r\n      header: {          'Content-Type': 'application\/json'\r\n      },\r\n      success: function(res) {\r\n        console.log(res.data)\r\n        that.setData({\r\n          films: res.data.data.movies,\r\n          loading: true\r\n        })\r\n      }\r\n    })\r\n    wx.getSystemInfo({\r\n      success: (res) =&gt; {\r\n        that.setData({\r\n          windowHeight: res.windowHeight,\r\n          windowWidth: res.windowWidth\r\n        })\r\n      }\r\n    })\r\n  },\r\n  pullDownRefresh: function(e) {    this.onLoad()\r\n  },\r\n  pullUpLoad: function(e) {    var limit = this.data.limit + 6\r\n    console.log(limit)    this.setData({\r\n      limit: limit\r\n    })    this.onShow()\r\n  }\r\n})<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>\u8fd9\u91cc\u4f7f\u7528\u662f\u7684\u732b\u773c\u7535\u5f71\u7684<\/p>\n<p>\u5176\u63a5\u53e3\u4e3a&nbsp;<\/p>\n<pre>m.maoyan.com\/movie\/list.json<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p><span style=\"line-height: 1.5\">\u8fd4\u56de\u6570\u636e\u5982\u4e0b\u6240\u793a\uff1a<\/span><\/p>\n<pre>{    \"control\":{        \"expires\":1800\r\n    },    \"status\":0,    \"data\":{        \"hasNext\":true,        \"movies\":[\r\n            {                \"showInfo\":\"\u4eca\u592964\u5bb6\u5f71\u9662\u653e\u66201083\u573a\",                \"cnms\":0,                \"sn\":0,                \"late\":false,                \"img\":\"http:\/\/p0.meituan.net\/165.220\/movie\/fbe5f97c016c9f4520109dc70f458d4d83363.jpg\",                \"sc\":9.1,                \"ver\":\"2D\/3D\/IMAX 3D\/\u4e2d\u56fd\u5de8\u5e55\",                \"rt\":\"\u672c\u5468\u4e94\u4e0a\u6620\",                \"dur\":136,                \"nm\":\"\u94f6\u6cb3\u62a4\u536b\u961f2\",                \"showDate\":\"\",                \"src\":\"\",                \"vd\":\"\",                \"dir\":\"\u8a79\u59c6\u65af\u00b7\u53e4\u6069\",                \"star\":\"\u514b\u91cc\u65af\u00b7\u5e15\u62c9\u7279,\u4f50\u4f0a\u00b7\u7d22\u5c14\u8fbe\u5a1c,\u6234\u592b\u00b7\u5df4\u8482\u65af\u5854\",                \"cat\":\"\u52a8\u4f5c,\u5192\u9669,\u79d1\u5e7b\",                \"wish\":154543,                \"3d\":true,                \"pn\":188,                \"scm\":\"\u661f\u7235\u8eab\u4e16\u8ff7\uff0c\u7ec8\u4e8e\u89c1\u7239\u5730\",                \"preSale\":0,                \"imax\":true,                \"snum\":41866,                \"time\":\"\",                \"id\":248683\r\n            },\r\n            {                \"showInfo\":\"\u4eca\u592962\u5bb6\u5f71\u9662\u653e\u6620335\u573a\",                \"cnms\":0,                \"sn\":0,                \"late\":false,                \"img\":\"http:\/\/p0.meituan.net\/165.220\/movie\/aeb864fa21d578d845b9cefc056e40cb2874891.jpg\",                \"sc\":9.8,                \"ver\":\"2D\",                \"rt\":\"\u672c\u5468\u4e94\u4e0a\u6620\",                \"dur\":140,                \"nm\":\"\u6454\u8de4\u5427\uff01\u7238\u7238\",                \"showDate\":\"\",                \"src\":\"\",                \"vd\":\"\",                \"dir\":\"\u5c3c\u7279\u4ec0\u00b7\u63d0\u74e6\u745e\",                \"star\":\"\u963f\u7c73\u5c14\u00b7\u6c57,\u8428\u5361\u8bd7\u00b7\u6cf0\u74e6,\u6cd5\u7f07\u739b\u00b7\u8428\u90a3\u00b7\u7eb1\u5361\",                \"cat\":\"\u559c\u5267,\u52a8\u4f5c,\u5bb6\u5ead\",                \"wish\":27412,                \"3d\":false,                \"pn\":54,                \"scm\":\"\u4e3a\u5706\u6454\u8de4\u68a6\uff0c\u5973\u513f\u4e0d\u5fc3\u75bc\",                \"preSale\":0,                \"imax\":false,                \"snum\":19166,                \"time\":\"\",                \"id\":588362\r\n            },\r\n            {                \"showInfo\":\"\u4eca\u592963\u5bb6\u5f71\u9662\u653e\u6620256\u573a\",                \"cnms\":0,                \"sn\":0,                \"late\":false,                \"img\":\"http:\/\/p1.meituan.net\/165.220\/movie\/cc50791238502ae1fa08df764c5f5c97223987.jpg\",                \"sc\":9.1,                \"ver\":\"2D\/\u4e2d\u56fd\u5de8\u5e55\",                \"rt\":\"2017-04-28\u4e0a\u6620\",                \"dur\":120,                \"nm\":\"\u62c6\u5f39\u00b7\u4e13\u5bb6\",                \"showDate\":\"\",                \"src\":\"\",                \"vd\":\"\",                \"dir\":\"\u90b1\u793c\u6d9b\",                \"star\":\"\u5218\u5fb7\u534e,\u59dc\u6b66,\u5b8b\u4f73\",                \"cat\":\"\u52a8\u4f5c,\u60ac\u7591,\u72af\u7f6a\",                \"wish\":49007,                \"3d\":false,                \"pn\":167,                \"scm\":\"\u7206\u70b8\u88ad\u51fb\u6848\uff0c\u62c6\u5f39\u53cd\u6050\u96be\",                \"preSale\":0,                \"imax\":false,                \"snum\":95491,                \"time\":\"\",                \"id\":346103\r\n            },\r\n            {                \"showInfo\":\"\u4eca\u592948\u5bb6\u5f71\u9662\u653e\u6620156\u573a\",                \"cnms\":0,                \"sn\":0,                \"late\":false,                \"img\":\"http:\/\/p1.meituan.net\/165.220\/movie\/af297f59e363ce96290dfea22f6fea0c153020.jpg\",                \"sc\":9.4,                \"ver\":\"2D\/3D\/IMAX 3D\/\u4e2d\u56fd\u5de8\u5e55\/\u5168\u666f\u58f0\",                \"rt\":\"2017-04-14\u4e0a\u6620\",                \"dur\":136,                \"nm\":\"\u901f\u5ea6\u4e0e\u6fc0\u60c58\",                \"showDate\":\"\",                \"src\":\"\",                \"vd\":\"\",                \"dir\":\"F\u00b7\u52a0\u91cc\u00b7\u683c\u96f7\",                \"star\":\"\u8303\u00b7\u8fea\u585e\u5c14,\u6770\u68ee\u00b7\u65af\u5766\u68ee,\u9053\u6069\u00b7\u5f3a\u68ee\",                \"cat\":\"\u52a8\u4f5c,\u60ca\u609a,\u72af\u7f6a\",                \"wish\":320713,                \"3d\":true,                \"pn\":226,                \"scm\":\"\u8f66\u738b\u8981\u9ed1\u5316\uff0c\u5bb6\u65cf\u88ab\u51fb\u57ae\",                \"preSale\":0,                \"imax\":true,                \"snum\":899592,                \"time\":\"\",                \"id\":248700\r\n            },\r\n            {                \"showInfo\":\"\u4eca\u592946\u5bb6\u5f71\u9662\u653e\u6620133\u573a\",                \"cnms\":0,                \"sn\":0,                \"late\":false,                \"img\":\"http:\/\/p1.meituan.net\/165.220\/movie\/ea0131b3e9e40f226c7c2664f6185a3792752.jpg\",                \"sc\":8.9,                \"ver\":\"2D\",                \"rt\":\"2017-04-27\u4e0a\u6620\",                \"dur\":107,                \"nm\":\"\u559c\u6b22\u00b7\u4f60\",                \"showDate\":\"\",                \"src\":\"\",                \"vd\":\"\",                \"dir\":\"\u8bb8\u5b8f\u5b87\",                \"star\":\"\u91d1\u57ce\u6b66,\u5468\u51ac\u96e8,\u5b59\u827a\u6d32\",                \"cat\":\"\u559c\u5267,\u7231\u60c5\",                \"wish\":30224,                \"3d\":false,                \"pn\":216,                \"scm\":\"\u7f8e\u98df\u5609\u5e74\u534e\uff0c\u7231\u60c5\u751c\u6389\u7259\",                \"preSale\":0,                \"imax\":false,                \"snum\":68306,                \"time\":\"\",                \"id\":672175\r\n            }\r\n        ]\r\n    }\r\n}<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<h3>\u8be6\u60c5\u9875\u90e8\u5206<\/h3>\n<p>1. \u9875\u9762\u7ed3\u6784<\/p>\n<p>\u9875\u9762\u7ed3\u6784\u7528\u4e00\u4e2a\u663e\u793a\u7535\u5f71\u7684\u5e38\u7528\u4fe1\u606f\uff0c\u4ee5\u53ca\u4e00\u4e2a\u9884\u89c8\u7684\u529f\u80fd\u3002<\/p>\n<p>\u5176\u9875\u9762\u7ed3\u6784\u4ee3\u7801\u5982\u4e0b<\/p>\n<pre>&lt;loading hidden=\"{{loading}}\"&gt;\r\n  \u52a0\u8f7d\u4e2d...&lt;\/loading&gt;&lt;view class=\"detail flex-box\" url=\"\"&gt;\r\n    &lt;view class=\"detail-img\"&gt;&lt;image class=\"img\" src=\"{{films.MovieDetailModel.img}}\"&gt;&lt;\/image&gt;&lt;image bindtap=\"vShow\" class=\"detail-play\" src=\"..\/..\/images\/i-play.png\"&gt;&lt;\/image&gt;&lt;\/view&gt;\r\n    &lt;view class=\"detail-main flex-btn\"&gt;\r\n        &lt;view class=\"detail-title detail-brief\"&gt;\r\n            &lt;text&gt;{{films.MovieDetailModel.nm}}&lt;\/text&gt;\r\n            &lt;image class=\"i-imax\" wx:if=\"{{films.MovieDetailModel.imax}}\" src=\"..\/..\/images\/i-imax.png\"&gt;&lt;\/image&gt;\r\n            &lt;image class=\"i-imax\" wx:if=\"{{films.MovieDetailModel.preSale}}\" src=\"..\/..\/images\/i-imax.png\"&gt;&lt;\/image&gt;\r\n        &lt;\/view&gt;\r\n        &lt;view class=\"detail-brief\"&gt;{{films.MovieDetailModel.scm}}&lt;\/view&gt;\r\n        &lt;view class=\"detail-brief\"&gt;{{films.MovieDetailModel.cat}}&lt;\/view&gt;\r\n        &lt;view class=\"detail-brief\"&gt;{{films.MovieDetailModel.src}} \/ {{films.MovieDetailModel.dur}}\u5206\u949f&lt;\/view&gt;\r\n        &lt;view class=\"detail-brief\"&gt;{{films.MovieDetailModel.rt}}&lt;\/view&gt;\r\n        &lt;view class=\"detail-brief\" wx:if=\"{{films.MovieDetailModel.preSale}}\"&gt;&lt;text class=\"wish\"&gt;{{films.MovieDetailModel.wish}}\u4eba\u60f3\u770b&lt;\/text&gt;{{films.MovieDetailModel.showInfo}}&lt;\/view&gt;\r\n        &lt;view class=\"detail-size\" wx:if=\"{{!films.MovieDetailModel.preSale}}\"&gt;&lt;view class=\"star\"&gt;&lt;view style=\"width: {{films.MovieDetailModel.sc * 10}}%\" class=\"stars\"&gt;&lt;\/view&gt;&lt;\/view&gt;{{films.MovieDetailModel.sc}}&lt;\/view&gt;\r\n    &lt;\/view&gt;\r\n    &lt;image class=\"bg\" src=\"https:\/\/gw.alicdn.com\/tps\/i4\/TB1pa7pJFXXXXX6XFXXwwg20FXX-640-448.png\"&gt;&lt;\/image&gt;&lt;video class=\"{{video}}\" autoplay=\"false\" bindended=\"vHid\" src=\"{{films.MovieDetailModel.vd}}\" controls&gt;&lt;\/video&gt;&lt;\/view&gt;&lt;scroll-view class=\"details-dra\"&gt;&lt;view&gt;{{details}}&lt;\/view&gt;&lt;\/scroll-view&gt;&lt;button type=\"primary\" size=\"{{primarySize}}\" plain=\"{{plain}}\" disabled=\"{{disabled}}\" bindtap=\"pay\"&gt;\u7acb\u5373\u8d2d\u7968 &lt;\/button&gt;<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p><span style=\"line-height: 1.5\">2. \u6837\u5f0f\u8868<\/span><\/p>\n<p>\u6837\u5f0f\u4ee3\u7801\u5982\u4e0b\u6240\u793a<\/p>\n<pre>\/**index.wxss**\/.flex-box{\r\n    display: flex;\r\n}.flex-btn{\r\n    flex: 1;\r\n}.detail{\r\n    border-bottom: 1rpx solid #e5e5e5;\r\n    padding: 30rpx 30rpx 0 30rpx;\r\n    overflow: hidden;\r\n    position: relative;\r\n}.video-hide{\r\n    display: none;\r\n}.video-show{\r\n    display: block;\r\n    position: absolute;\r\n    width: 750rpx;\r\n    height: 406rpx;\r\n    top: 0;\r\n    left: 0;\r\n}.bg{\r\n    position: absolute;\r\n    left: 0;\r\n    top: 0;\r\n    width: 750rpx;\r\n    height: 1048rpx;\r\n    z-index: -1;\r\n}.detail-img{\r\n    width: 236rpx;\r\n    height: 376rpx;\r\n    margin-right: 20rpx;\r\n    position: relative;\r\n}.detail-img .img{\r\n    width: 236rpx;\r\n    height: 376rpx;\r\n}.detail-play{\r\n    position: absolute;\r\n    left: 70rpx;\r\n    top: 130rpx;\r\n    width: 80rpx;\r\n    height: 80rpx;\r\n}.detail-title{\r\n    height: 70rpx;\r\n}.detail-title text{\r\n    font-size: 18px;\r\n    line-height: 70rpx;\r\n    color: #FFF;\r\n}.i-imax{\r\n    width: 52rpx;\r\n    height: 28rpx;\r\n    margin-left: 10rpx;\r\n}.detail-size{\r\n    height: 40rpx;\r\n    font-size: 14px;\r\n    color: #FFF;\r\n}.detail-size .star{\r\n    width: 100rpx;\r\n    height: 20rpx;\r\n    background: url(..\/..\/images\/i-star.png) no-repeat;\r\n    background-size: 100rpx;\r\n    display: inline-block;\r\n    margin-right: 10rpx;\r\n}.stars{\r\n    width: 100rpx;\r\n    height: 20rpx;\r\n    background: url(..\/..\/images\/i-stars.png) no-repeat;\r\n    background-size: 100rpx;\r\n    float: left;\r\n    margin-right: 10rpx;\r\n}.detail-brief{\r\n    font-size: 14px;\r\n    line-height: 50rpx;\r\n    color: #FFF;\r\n    overflow: hidden;\r\n    text-overflow: ellipsis;\r\n    white-space: nowrap;\r\n    width: 400rpx;\r\n}.detail-brief .wish{\r\n    color: #FFF;\r\n    border-right: 1rpx solid #666;\r\n    padding-right: 10rpx;\r\n    margin-right: 10rpx;\r\n}.detail-main{\r\n    position: relative;\r\n}.detail-sale{\r\n    position: absolute;\r\n    right: 10rpx;\r\n    top: 70rpx;\r\n}.detail-sale text{\r\n    padding: 10rpx 18rpx;\r\n    border: 1rpx solid #37b7ff;\r\n    font-size: 14px;\r\n    color: #37b7ff;\r\n    border-radius: 6rpx;\r\n}.detail-sale .pre-sale{\r\n    border: 1rpx solid #fea54c;\r\n    color: #fea54c;\r\n}.details-dra view{\r\n    margin: 23rpx;\r\n    color: #333;\r\n    font-size: 14px;\r\n    line-height: 20px;\r\n}<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p><span style=\"line-height: 1.5\">3\u3001 \u9875\u9762\u903b\u8f91\u5904\u7406<\/span><\/p>\n<pre>\/\/index.jsPage({\r\n  data: {\r\n    films: [],\r\n    loading: false,\r\n    title: '\u6b63\u5728\u70ed\u6620',\r\n    video: 'video-hide',\r\n    datails: '',\r\n    windowWidth: 0\r\n  },\r\n  onLoad: function (options) {    var id = 'http:\/\/m.maoyan.com\/movie\/' + options.id + '.json'    this.setData({\r\n      title: options.titles\r\n    })    var that = this\r\n    wx.request({\r\n      url: id, \/\/\u4ec5\u4e3a\u793a\u4f8b\uff0c\u5e76\u975e\u771f\u5b9e\u7684\u63a5\u53e3\u5730\u5740      data: {\r\n      },\r\n      header: {          'Content-Type': 'application\/json'\r\n      },\r\n      success: function(res) {\r\n        console.log(res.data)\r\n        that.setData({\r\n          films: res.data.data,\r\n          loading: true\r\n        })        var pages = that.data.films.MovieDetailModel.dra\r\n        pages = pages.replace(\/&lt;.*?&gt;\/ig,\"\")\r\n        that.setData({\r\n          details: pages\r\n        })\r\n        console.log(pages)\r\n      }\r\n    })\r\n  },\r\n  onReady: function(){    var that = this\r\n    wx.setNavigationBarTitle({\r\n      title: that.data.title\r\n    })\r\n    wx.getSystemInfo({\r\n      success: (res) =&gt; {\r\n        that.setData({\r\n          windowHeight: res.windowHeight,\r\n          windowWidth: res.windowWidth\r\n        })\r\n      }\r\n    })\r\n  },\r\n  pay: function(){\r\n    console.log('pay');\r\n    wx.requestPayment({       'timeStamp': '',       'nonceStr': '',       'package': '',       'signType': 'MD5',       'paySign': '',       'success':function(res){\r\n          console.log('success');\r\n       },       'fail':function(res){\r\n          console.log('fail');\r\n       }\r\n    })\r\n  },\r\n  vShow: function(){    this.setData({\r\n      video: 'video-show'\r\n    })\r\n  },\r\n  vHid: function(){    this.setData({\r\n      video: 'video-hide'\r\n    })\r\n  }\r\n})<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p><span style=\"line-height: 1.5\">\u8fd9\u91cc\u4f7f\u7528\u662f\u7684\u732b\u773c\u7535\u5f71\u8be6\u60c5\u7684api<\/span><\/p>\n<p>\u5176\u63a5\u53e3\u4e3a&nbsp;<\/p>\n<pre>m.maoyan.com\/movie\/248683.json<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p><span style=\"line-height: 1.5\">\u5176\u4e2d<\/span><span style=\"line-height: 1.5\">248683\u4e3a\u7535\u5f71ID<\/span><\/p>\n<p>\u8fd4\u56de\u6570\u636e\u5982\u4e0b\u6240\u793a\uff1a<\/p>\n<pre>{    \"control\":{        \"expires\":3600\r\n    },    \"status\":0,    \"data\":{        \"MovieDetailModel\":{            \"cat\":\"\u52a8\u4f5c,\u5192\u9669,\u79d1\u5e7b\",            \"dealsum\":0,            \"dir\":\"\u8a79\u59c6\u65af\u00b7\u53e4\u6069 \",            \"dra\":\"&lt;p&gt;\u4ee5\u5168\u65b0\u7684\u53d1\u70e7\u97f3\u4e50\u4e3a\u80cc\u666f\uff0c\u94f6\u6cb3\u62a4\u536b\u961f\u5c06\u7ee7\u7eed\u4ed6\u4eec\u7684\u5192\u9669\uff0c\u5e76\u89e3\u5f00\u201c\u661f\u7235\u201d\u5f7c\u5f97\u00b7\u594e\u5c14\uff08\u514b\u91cc\u65af\u00b7\u5e15\u62c9\u7279 \u9970\uff09\u8eab\u4e16\u4e4b\u8c1c\uff0c\u540c\u65f6\u62a4\u536b\u961f\u6210\u5458\u4eec\u5fc5\u987b\u5171\u540c\u4f5c\u6218\uff0c\u5b88\u62a4\u5f7c\u6b64\uff0c\u4fdd\u536b\u62a4\u536b\u961f\u8fd9\u4e2a\u5927\u5bb6\u5ead\u3002&lt;\/p&gt;\",            \"dur\":136,            \"id\":248683,            \"imax\":true,            \"img\":\"http:\/\/p0.meituan.net\/165.220\/movie\/fbe5f97c016c9f4520109dc70f458d4d83363.jpg\",            \"isShowing\":true,            \"late\":false,            \"mk\":0,            \"nm\":\"\u94f6\u6cb3\u62a4\u536b\u961f2\",            \"photos\":[                \"http:\/\/p0.meituan.net\/w.h\/mmdb\/8c0f7925dc5eac7725b31ebe3d43bfcb4096.jpeg\",                \"http:\/\/p1.meituan.net\/w.h\/mmdb\/91cfef170d8d6a8fc12eab5a20b590f36144.jpeg\",                \"http:\/\/p1.meituan.net\/w.h\/mmdb\/c49ddd3bcd2bfae834149de5ae937cc66144.jpeg\",                \"http:\/\/p0.meituan.net\/w.h\/mmdb\/f013e2d55285caab02873ec5a1947c796144.jpeg\",                \"http:\/\/p0.meituan.net\/w.h\/mmdb\/a16addab2c993eed9ec39a344df59c856144.jpeg\",                \"http:\/\/p1.meituan.net\/w.h\/mmdb\/62a5468f1062d0a5770e950946e72c4f6144.jpeg\",                \"http:\/\/p0.meituan.net\/w.h\/mmdb\/4f34d56d9b319bf4c502a043d682ee276144.jpeg\",                \"http:\/\/p0.meituan.net\/w.h\/mmdb\/5705531218da628cff533c316d22b6be8192.jpeg\",                \"http:\/\/p1.meituan.net\/w.h\/mmdb\/e67687ad91308b720e8fbba82dab11bf8192.jpeg\",                \"http:\/\/p0.meituan.net\/w.h\/mmdb\/27b52dba6932a94f7a06dd4bc645c1818192.jpeg\",                \"http:\/\/p1.meituan.net\/w.h\/mmdb\/cf43bd1f446b2871b06aad952e4e21156144.jpeg\",                \"http:\/\/p1.meituan.net\/w.h\/mmdb\/5132bc175e4d0655949fd4c11f3e606c6144.jpeg\",                \"http:\/\/p0.meituan.net\/w.h\/mmdb\/db3a390c46806873cb896f7a8185e9ac10240.jpeg\",                \"http:\/\/p0.meituan.net\/w.h\/mmdb\/a6d2b54c3b4677adbfa4b5144f8967b16144.jpeg\",                \"http:\/\/p0.meituan.net\/w.h\/mmdb\/d2951058ecb7d99562baf2cea24521d76144.jpeg\",                \"http:\/\/p1.meituan.net\/w.h\/mmdb\/700a0e47b8377f3b97a063543503987c8192.jpeg\",                \"http:\/\/p0.meituan.net\/w.h\/mmdb\/3480a419b83b4cce2e5348eeac99c60a10240.jpeg\",                \"http:\/\/p1.meituan.net\/w.h\/mmdb\/5314fd2fb5aee9f4b9ae2973189bb0b44096.jpeg\",                \"http:\/\/p0.meituan.net\/w.h\/mmdb\/a191b5903f8472a1f453a62c20ce21ff4096.jpeg\",                \"http:\/\/p0.meituan.net\/w.h\/mmdb\/ed4bb3e125ba3be4f3fb854706d0734d16384.png\"\r\n            ],            \"pn\":188,            \"preSale\":0,            \"rt\":\"\u672c\u5468\u4e94\u4e0a\u6620\",            \"sc\":9.1,            \"scm\":\"\u661f\u7235\u8eab\u4e16\u8ff7\uff0c\u7ec8\u4e8e\u89c1\u7239\u5730\",            \"showSnum\":true,            \"snum\":45359,            \"src\":\"\u7f8e\u56fd\",            \"star\":\"\u514b\u91cc\u65af\u00b7\u5e15\u62c9\u7279 \u4f50\u4f0a\u00b7\u7d22\u5c14\u8fbe\u5a1c \u6234\u592b\u00b7\u5df4\u8482\u65af\u5854 \u8303\u00b7\u8fea\u585e\u5c14 \u5e03\u83b1\u5fb7\u5229\u00b7\u5e93\u73c0 \u8fc8\u514b\u5c14\u00b7\u9c81\u514b \u51ef\u4f26\u00b7\u5409\u5170 \u5e9e\u00b7\u514b\u83b1\u95e8\u6377\u592b \u897f\u5c14\u7ef4\u65af\u7279\u00b7\u53f2\u6cf0\u9f99 \u5e93\u5c14\u7279\u00b7\u62c9\u585e\u5c14 \u4f0a\u4e3d\u838e\u767d\u00b7\u5fb7\u6bd4\u9f50 \u514b\u91cc\u65af\u00b7\u6c99\u5229\u6587 \u8096\u6069\u00b7\u5188 \u6c64\u7c73\u00b7\u5f17\u62c9\u7eb3\u6839 \u52b3\u62c9\u00b7\u54c8\u5fb7\u514b \u827e\u4f26\u00b7\u53f2\u74e6\u5179 \u6c49\u5a1c\u00b7\u6208\u7279\u65af\u66fc \u5e0c\u5c14\u63d0\u00b7\u4f2f\u6069 \u672c\u00b7\u5e03\u52b3\u5fb7 \u4e9a\u5386\u514b\u65af\u00b7\u514b\u83b1\u56e0 \u5362\u514b\u00b7\u5e93\u514b \u57c3\u6587\u00b7\u743c\u65af \u4e54\u00b7\u5f17\u91cc\u4e9a \u7279\u4f26\u65af\u00b7\u7f57\u65af\u6469\u5c14 \u5409\u7c73\u00b7\u5c24\u56e0 \u53f2\u8482\u82ac\u00b7\u5e03\u83b1\u514b\u54c8\u7279 \u53f2\u63d0\u592b\u00b7\u963f\u5409 \u5e03\u9686\u8fea\u00b7\u5df4\u9c81\u8482 \u7406\u67e5\u00b7\u514b\u91cc\u65af\u5e1d \u7f57\u5e03\u00b7\u8d5e\u6bd4 \u585e\u62c9\u00b7\u62c9\u4e4c Kendra Staub Milynn Sarley \u8d5b\u65af\u00b7\u683c\u6797 \u83ab\u8389\u00b7\u594e\u6069 \u8fc8\u514b\u5c14\u00b7\u7f57\u68ee\u5df4\u59c6 \u7f57\u8fbe\u00b7\u683c\u91cc\u83f2\u65af \u9ea6\u8389\u00b7\u8d5b\u52d2\u65af \u65af\u5766\u00b7\u674e \u5927\u536b\u00b7\u54c8\u585e\u5c14\u970d\u592b Mac Wells Elizabeth Ludlow \u74e6\u8036\u7279\u00b7\u5965\u83b1\u592b \u683c\u96f7\u683c\u00b7\u4ea8\u5229 Damita Jane Howard \u6770\u592b\u00b7\u9ad8\u5e03\u4f26 \u6587\u00b7\u745e\u59c6\u65af \u6768\u7d2b\u743c \u5f17\u83b1\u5fb7\u00b7\u52a0\u52d2 \",            \"vd\":\"http:\/\/maoyan.meituan.net\/movie\/videos\/854x4807011e019c4ef46239c91f6636435051b.mp4\",            \"ver\":\"2D\/3D\/IMAX 3D\/\u4e2d\u56fd\u5de8\u5e55\",            \"vnum\":47,            \"wish\":154543,            \"wishst\":0\r\n        }\r\n    }\r\n}<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<h2>\u4e09\u3001\u7a0b\u5e8f\u6548\u679c\u56fe<\/h2>\n<p><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/000\/001\/505\/5c2f3e9183b9e9dd127b8dbccd608a0f-3.png\" class=\"aligncenter\" title=\"\u5c0f\u7a0b\u5e8f\u5f00\u53d1\u4e4b\u70ed\u95e8\u7535\u5f71\u63d2\u56fe3\" alt=\"\u5c0f\u7a0b\u5e8f\u5f00\u53d1\u4e4b\u70ed\u95e8\u7535\u5f71\u63d2\u56fe3\" \/>&nbsp;<img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/000\/001\/505\/5c2f3e9183b9e9dd127b8dbccd608a0f-4.png\" class=\"aligncenter\" title=\"\u5c0f\u7a0b\u5e8f\u5f00\u53d1\u4e4b\u70ed\u95e8\u7535\u5f71\u63d2\u56fe4\" alt=\"\u5c0f\u7a0b\u5e8f\u5f00\u53d1\u4e4b\u70ed\u95e8\u7535\u5f71\u63d2\u56fe4\" \/>&nbsp;<img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/000\/001\/505\/03ab55c23c9881eadb0180dfa96d1227-5.png\" class=\"aligncenter\" title=\"\u5c0f\u7a0b\u5e8f\u5f00\u53d1\u4e4b\u70ed\u95e8\u7535\u5f71\u63d2\u56fe5\" alt=\"\u5c0f\u7a0b\u5e8f\u5f00\u53d1\u4e4b\u70ed\u95e8\u7535\u5f71\u63d2\u56fe5\" \/><\/p>\n<p>&nbsp;\u3010\u76f8\u5173\u63a8\u8350\u3011<\/p>\n<p>1.<\/p>\n<p>2.<\/p>\n<p>&nbsp;<\/p>\n<p>\u4ee5\u4e0a\u5c31\u662f\u5c0f\u7a0b\u5e8f\u5f00\u53d1\u4e4b\u70ed\u95e8\u7535\u5f71\u7684\u8be6\u7ec6\u5185\u5bb9\uff0c\u66f4\u591a\u8bf7\u5173\u6ce8\u7c73\u4e91\u5176\u5b83\u76f8\u5173\u6587\u7ae0\uff01<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5728\u8fd9\u7bc7\u5fae\u4fe1\u5c0f\u7a0b\u5e8f\u5f00\u53d1\u6559\u7a0b\u4e2d\uff0c\u6211\u4eec\u5c06\u4ecb\u7ecd\u5982\u4f55\u4f7f\u7528\u5fae\u4fe1\u5c0f\u7a0b\u5e8f\u5f00\u53d1\u70ed\u95e8\u7535\u5f71\u53ca\u9884\u89c8\u529f\u80fd\u3002 \u672c\u6587\u4e3b\u8981\u5206\u4e3a\u4e24\u4e2a\u90e8\u5206\uff0c\u5c0f\u7a0b\u5e8f\u4e3b\u4f53\u90e8\u5206\u53ca\u7535\u5f71\u4e3b\u9875\u548c\u8be6\u60c5\u9875\u9875\u9762\u90e8\u5206 \u4e00\u3001\u5c0f\u7a0b\u5e8f\u4e3b\u4f53\u90e8\u5206 \u4e00\u4e2a\u5c0f\u7a0b\u5e8f\u4e3b\u4f53\u90e8\u5206\u7531\u4e09\u4e2a\u6587\u4ef6\u7ec4\u6210\uff0c\u5fc5\u987b\u653e\u5728\u9879\u76ee\u7684\u6839\u76ee\u5f55\uff0c\u5982\u4e0b\uff1a 1. \u5c0f\u7a0b\u5e8f\u903b\u8f91 App({ onLaunch: function() { \/\/ Do something initial when launch. }, onShow: function() { \/\/ Do something when show. }, onHide: function() { \/\/ Do something when hide. }, globalData: &#8216;I am global data&#8217;}) \u767b\u5f55\u540e\u590d\u5236 2. \u5c0f\u7a0b\u5e8f\u516c\u5171\u8bbe\u7f6e \u4e3b\u8981\u6ce8\u518c\u4e24\u4e2a\u9875\u9762\uff0c\u70ed\u95e8\u7535\u5f71\u7684\u4e3b\u9875\u53ca\u8be6\u60c5\u9875 { &#8220;pages&#8221;:[ &#8220;pages\/index\/index&#8221;, &#8220;pages\/details\/details&#8221; ], &#8220;window&#8221;:{ &#8220;backgroundTextStyle&#8221;:&#8221;light&#8221;, &#8220;navigationBarBackgroundColor&#8221;: &#8220;#FF4D64&#8221;, &#8220;navigationBarTitleText&#8221;: &#8220;\u70ed\u95e8\u7535\u5f71&#8221;, [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[19],"tags":[],"class_list":["post-30040","post","type-post","status-publish","format-standard","hentry","category-19"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/30040","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/comments?post=30040"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/30040\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=30040"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=30040"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=30040"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}