未验证 提交 bf64eefb 编写于 作者: 折腾笔记 提交者: GitHub

Merge pull request #3 from dcloudio/master

更新其他示例
# UNI-APP 图片模板
<p align="center">
<img src="http://img-cdn-qiniu.dcloud.net.cn/uniapp/template/new.png" width="200"/>
<img src="http://img-cdn-qiniu.dcloud.net.cn/uniapp/template/hot.png" width="200"/>
</p>
## 运行方式
将项目拖入[HbuildX](http://www.dcloud.io/hbuilderx.html),直接运行即可
将项目拖入[HBuilderX](http://www.dcloud.io/hbuilderx.html),直接运行即可
## 使用须知
1. 页面样式主要在common/common.css
2. 数据在页面的methods->getData里获取,替换里面的链接及参数即可
3. 接口返回的字段根据已固定,若替换接口也要替换相应的字段名,页面才能正常渲染
3. 页面的分享需配置自己的appid等信息
......@@ -373,6 +373,7 @@ button.register {
}
.detail-btn-view view {
opacity: 0.75;
height: 80px;
border-radius: 80px;
width: 80px;
......
{
"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",
......
......@@ -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;
......
......@@ -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)
......
......@@ -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) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册