第一次 #6

Closed
pnfwtvqce wants to merge 0 commits from master into zhouweikang_branch

@ -1,14 +1,39 @@
{ {
"pages": [ "pages": [
"pages/index/index", "pages/index/index",
"pages/logs/logs" "pages/logs/logs",
"pages/commemorate/commemorate",
"pages/recommend/recommend"
], ],
"window": { "window": {
"backgroundTextStyle": "light", "backgroundTextStyle": "light",
"navigationBarBackgroundColor": "#fff", "navigationBarBackgroundColor": "#ddd",
"navigationBarTitleText": "Weixin", "navigationBarTitleText": "银幕之旅",
"navigationBarTextStyle": "black" "navigationBarTextStyle": "black"
}, },
"tabBar": {
"selectedColor": "#CD5C5C",
"list": [
{
"pagePath": "pages/index/index",
"text": "首页",
"iconPath": "static/tabbar/home.png",
"selectedIconPath": "static/tabbar/home_selected.png"
},
{
"pagePath": "pages/recommend/recommend",
"text": "推荐",
"iconPath": "static/tabbar/recommend.png",
"selectedIconPath": "static/tabbar/recommend_selected.png"
},
{
"pagePath": "pages/commemorate/commemorate",
"text": "纪念",
"iconPath": "static/tabbar/commemorate.png",
"selectedIconPath": "static/tabbar/commemorate_selected.png"
}
]
},
"style": "v2", "style": "v2",
"sitemapLocation": "sitemap.json" "sitemapLocation": "sitemap.json"
} }

@ -0,0 +1,66 @@
// pages/commemorate/commemorate.js
Page({
/**
* 页面的初始数据
*/
data: {
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
}
})

@ -0,0 +1,3 @@
{
"usingComponents": {}
}

@ -0,0 +1 @@
<text>纪念哦</text>

@ -0,0 +1 @@
/* pages/commemorate/commemorate.wxss */

@ -1,48 +1,66 @@
// index.js // index.js
// 获取应用实例
const app = getApp()
Page({ Page({
/**
* 页面的初始数据
*/
data: { data: {
motto: 'Hello World',
userInfo: {},
hasUserInfo: false,
canIUse: wx.canIUse('button.open-type.getUserInfo'),
canIUseGetUserProfile: false,
canIUseOpenData: wx.canIUse('open-data.type.userAvatarUrl') && wx.canIUse('open-data.type.userNickName') // 如需尝试获取用户信息可改为false
},
// 事件处理函数
bindViewTap() {
wx.navigateTo({
url: '../logs/logs'
})
}, },
onLoad() {
if (wx.getUserProfile) { /**
this.setData({ * 生命周期函数--监听页面加载
canIUseGetUserProfile: true */
}) onLoad(options) {
}
}, },
getUserProfile(e) {
// 推荐使用wx.getUserProfile获取用户信息开发者每次通过该接口获取用户个人信息均需用户确认开发者妥善保管用户快速填写的头像昵称避免重复弹窗 /**
wx.getUserProfile({ * 生命周期函数--监听页面初次渲染完成
desc: '展示用户信息', // 声明获取用户个人信息后的用途,后续会展示在弹窗中,请谨慎填写 */
success: (res) => { onReady() {
console.log(res)
this.setData({
userInfo: res.userInfo,
hasUserInfo: true
})
}
})
}, },
getUserInfo(e) {
// 不推荐使用getUserInfo获取用户信息预计自2021年4月13日起getUserInfo将不再弹出弹窗并直接返回匿名的用户个人信息 /**
console.log(e) * 生命周期函数--监听页面显示
this.setData({ */
userInfo: e.detail.userInfo, onShow() {
hasUserInfo: true
}) },
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
} }
}) })

@ -1,23 +1,40 @@
<!--index.wxml--> <!--index.wxml-->
<view class="container"> <text>当季热映🔥</text>
<view class="userinfo"> <view class="menu">
<block wx:if="{{canIUseOpenData}}"> <view class="item">
<view class="userinfo-avatar" bindtap="bindViewTap"> <image src="/static/tabbar/movie.png"></image>
<open-data type="userAvatarUrl"></open-data> <text>阿斌</text>
</view> </view>
<open-data type="userNickName"></open-data> <view class="item">
</block> <image src="/static/tabbar/movie.png"></image>
<block wx:elif="{{!hasUserInfo}}"> <text>阿斌</text>
<button wx:if="{{canIUseGetUserProfile}}" bindtap="getUserProfile"> 获取头像昵称 </button> </view>
<button wx:elif="{{canIUse}}" open-type="getUserInfo" bindgetuserinfo="getUserInfo"> 获取头像昵称 </button> <view class="item">
<view wx:else> 请使用1.4.4及以上版本基础库 </view> <image src="/static/tabbar/movie.png"></image>
</block> <text>阿斌</text>
<block wx:else> </view>
<image bindtap="bindViewTap" class="userinfo-avatar" src="{{userInfo.avatarUrl}}" mode="cover"></image> <view class="item">
<text class="userinfo-nickname">{{userInfo.nickName}}</text> <image src="/static/tabbar/movie.png"></image>
</block> <text>阿斌</text>
</view> </view>
<view class="usermotto"> <view class="item">
<text class="user-motto">{{motto}}</text> <image src="/static/tabbar/movie.png"></image>
<text>阿斌</text>
</view>
<view class="item">
<image src="/static/tabbar/movie.png"></image>
<text>阿斌</text>
</view>
<view class="item">
<image src="/static/tabbar/movie.png"></image>
<text>阿斌</text>
</view>
<view class="item">
<image src="/static/tabbar/movie.png"></image>
<text>阿斌</text>
</view>
<view class="item">
<image src="/static/tabbar/movie.png"></image>
<text>阿斌</text>
</view> </view>
</view> </view>

@ -1,19 +1,25 @@
/**index.wxss**/ /**index.wxss**/
.userinfo { image{
width: 100rpx;
height: 100rpx;
border-radius: 50rpx;
}
/**容器**/
.menu{
height: 2000rpx;
border: 1rpx solid #ddd;
/**flex布局**/
display:flex; display:flex;
/**主轴方向布局行排列row或者列排列column**/
flex-direction: column; flex-direction: column;
/**控制孩子布局flex-start,center,space-around,space-between**/
justify-content: space-around;
/**副轴方向布局**/
align-items: center; align-items: center;
color: #aaa;
}
.userinfo-avatar {
overflow: hidden;
width: 128rpx;
height: 128rpx;
margin: 20rpx;
border-radius: 50%;
} }
.menu .item{
.usermotto { display:flex;
margin-top: 200px; flex-direction: column;
/**控制了文本的**/
align-items: center;
} }

@ -0,0 +1,66 @@
// pages/recommend/recommend.js
Page({
/**
* 页面的初始数据
*/
data: {
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
}
})

@ -0,0 +1,3 @@
{
"usingComponents": {}
}

@ -0,0 +1,39 @@
<text>可能喜欢(๑•̀ㅂ•́)و✧</text>
<view class="menu">
<view class="item">
<image src="/static/tabbar/movie.png"></image>
<text>阿斌</text>
</view>
<view class="item">
<image src="/static/tabbar/movie.png"></image>
<text>阿斌</text>
</view>
<view class="item">
<image src="/static/tabbar/movie.png"></image>
<text>阿斌</text>
</view>
<view class="item">
<image src="/static/tabbar/movie.png"></image>
<text>阿斌</text>
</view>
<view class="item">
<image src="/static/tabbar/movie.png"></image>
<text>阿斌</text>
</view>
<view class="item">
<image src="/static/tabbar/movie.png"></image>
<text>阿斌</text>
</view>
<view class="item">
<image src="/static/tabbar/movie.png"></image>
<text>阿斌</text>
</view>
<view class="item">
<image src="/static/tabbar/movie.png"></image>
<text>阿斌</text>
</view>
<view class="item">
<image src="/static/tabbar/movie.png"></image>
<text>阿斌</text>
</view>
</view>

@ -0,0 +1 @@
/* pages/recommend/recommend.wxss */

@ -37,7 +37,8 @@
"ignore": [], "ignore": [],
"disablePlugins": [], "disablePlugins": [],
"outputPath": "" "outputPath": ""
} },
"condition": false
}, },
"compileType": "miniprogram", "compileType": "miniprogram",
"libVersion": "2.19.4", "libVersion": "2.19.4",

@ -1,6 +1,6 @@
{ {
"description": "项目私有配置文件。此文件中的内容将覆盖 project.config.json 中的相同字段。项目的改动优先同步到此文件中。详见文档https://developers.weixin.qq.com/miniprogram/dev/devtools/projectconfig.html", "description": "项目私有配置文件。此文件中的内容将覆盖 project.config.json 中的相同字段。项目的改动优先同步到此文件中。详见文档https://developers.weixin.qq.com/miniprogram/dev/devtools/projectconfig.html",
"projectname": "%E8%BD%AF%E5%B7%A5", "projectname": "%E9%93%B6%E5%B9%95%E4%B9%8B%E6%97%85",
"setting": { "setting": {
"compileHotReLoad": true "compileHotReLoad": true
} }

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Loading…
Cancel
Save