diff --git a/examples/image-template/README.md b/examples/image-template/README.md index 287b85e150ed51dfbac9c6ed95637045c37b63eb..0a8e156768e98d9618327c38e38bc9b4af95ff50 100644 --- a/examples/image-template/README.md +++ b/examples/image-template/README.md @@ -1,4 +1,21 @@ # UNI-APP 图片模板 +

+ + +

+ ## 运行方式 -将项目拖入[HbuildX](http://www.dcloud.io/hbuilderx.html),直接运行即可 + +将项目拖入[HBuilderX](http://www.dcloud.io/hbuilderx.html),直接运行即可 + +## 使用须知 + +1. 页面样式主要在common/common.css +2. 数据在页面的methods->getData里获取,替换里面的链接及参数即可 +3. 接口返回的字段根据已固定,若替换接口也要替换相应的字段名,页面才能正常渲染 +3. 页面的分享需配置自己的appid等信息 + + + + diff --git a/examples/image-template/common/common.css b/examples/image-template/common/common.css index 4e6d2fdb4635ad7568b425d1df117f5cb8651452..fde05371af856fd5308fd521cccd7d2b6d975ab2 100644 --- a/examples/image-template/common/common.css +++ b/examples/image-template/common/common.css @@ -373,6 +373,7 @@ button.register { } .detail-btn-view view { + opacity: 0.75; height: 80px; border-radius: 80px; width: 80px; diff --git a/examples/image-template/pages.json b/examples/image-template/pages.json index ca7be5e9eb8c6ffe912511cba4b69f18be566270..444df18f491bc631ea694bc3557db850e00e9a99 100644 --- a/examples/image-template/pages.json +++ b/examples/image-template/pages.json @@ -1,5 +1,5 @@ { - "pages": [{ + "pages": [{//pages数组中第一项表示应用启动页,参考:https://uniapp.dcloud.io/collocation/pages "path": "pages/new/new", "style": { "navigationBarTitleText": "最新", @@ -17,6 +17,7 @@ "navigationBarTitleText": "详情", "navigationBarBackgroundColor": "#000000", "app-plus":{ + "bounce":"none", "titleNView":{ "buttons":[{ "fontSrc":"/static/icon.ttf", diff --git a/examples/image-template/pages/detail/detail.vue b/examples/image-template/pages/detail/detail.vue index d53c5475f735cc370b3b9c294e3d149082cd1bc6..bff6b00e0ec62c68cceaddfd30ed55ca373ea2b4 100644 --- a/examples/image-template/pages/detail/detail.vue +++ b/examples/image-template/pages/detail/detail.vue @@ -25,7 +25,8 @@ screenHeight: 0, imgLength: 0, providerList: [], - data: [] + data: [], + detailDec:"" } }, onLoad(e) { @@ -36,6 +37,7 @@ // #endif this.screenHeight = uni.getSystemInfoSync().windowHeight; console.log(e.data); + this.detailDec = e.data; let data = JSON.parse(e.data); this.imgLength = data.img_num; this.data.push(data.img_src); @@ -78,6 +80,13 @@ } }); }, + onShareAppMessage() { + return { + title: "欢迎使用uni-app看图模板", + path: '/pages/detail/detail?data=' + this.detailDec, + imageUrl:this.data[this.index] + } + }, onNavigationBarButtonTap(e) { if (this.providerList.length === 0) { uni.showModal({ @@ -217,7 +226,7 @@ success: (res) => { if (res.data.code !== 0) { uni.showModal({ - content: "请求失败,请重试!", + content: "请求失败,失败原因:" + res.data.msg, showCancel: false }) return; diff --git a/examples/image-template/pages/hot/hot.vue b/examples/image-template/pages/hot/hot.vue index b7e8cdfbe05ef71822c607b191a00b1dd9f8d506..bd2a0d354debcf617e8ddc28d96c9f2ba17f86ef 100644 --- a/examples/image-template/pages/hot/hot.vue +++ b/examples/image-template/pages/hot/hot.vue @@ -76,7 +76,7 @@ methods: { getData() { uni.request({ - url: 'http://uniapp.dcloud.io/tuku/posts.php?page=' + (this.refreshing ? 1 : this.fetchPageNum) + '&per_page=10', + url: 'https://uniapp.dcloud.io/tuku/posts.php?page=' + (this.refreshing ? 1 : this.fetchPageNum) + '&per_page=10', success: (ret) => { if (ret.statusCode !== 200) { console.log("请求失败:", ret) diff --git a/examples/image-template/pages/new/new.vue b/examples/image-template/pages/new/new.vue index 694d83838271fce39ad67efb01511f5f9a2a397e..02d45f1f01c1305ddd0a6b917aaa55db8720abad 100644 --- a/examples/image-template/pages/new/new.vue +++ b/examples/image-template/pages/new/new.vue @@ -75,7 +75,7 @@ methods: { getData() { uni.request({ - url: 'http://uniapp.dcloud.io/tuku/posts.php?page=' + (this.refreshing ? 1 : this.fetchPageNum) + '&per_page=5', + url: 'https://uniapp.dcloud.io/tuku/posts.php?page=' + (this.refreshing ? 1 : this.fetchPageNum) + '&per_page=5', success: (ret) => { console.log("data",ret); if (ret.statusCode !== 200) {