首页 > 小程序教程 > 微信小程序开发会员中心错题历史题目收藏页面制作与设计教程

微信小程序开发会员中心错题历史题目收藏页面制作与设计教程

上一篇 下一篇
今天给大家带来开发会员中心错题历史题目收藏页面制作与设计教程,制作好以后效果图如下:
一、wxml页面代码如下:
<!--person.wxml-->
<view class="container">
  	<view class="person">
		<view class="person-info">
			<view class="head"><image src="{{userData.AvatarLarge}}" mode="widthFix"></image></view>
			<view class="name">
				<text class="nickname">{{'昵称: ' + userData.Nickname}}</text>
				<text class="username">{{'用户名: ' + userData.Username}}</text>
			</view>
		</view>
		<view class="other-info">
			<navigator class="other-list" wx:for="{{infos}}" wx:key="url" url="{{item.url}}">{{item.content}}</navigator>
			<view class="other-list" bindtap="logOff">退出登录</view>
		</view>
	</view><!-- person -->
</view>
 
二、wxss样式文件代码如下:
/**index.wxss**/
page {
  width: 100%;
  background: #eee;
}

.person{
	width: 100%;
}

.person .person-info{
	height: 100px;
	padding-left: 20px;
	background: #FFF;
	border-top: 1px solid #CCC;
	border-bottom: 1px solid #CCC;
}

.person .person-info view{
	height: 100px;
	float: left;
}

.person .person-info image{
	position: relative;
	top: 50%;
	transform: translateY(-50%);
	max-width: 70px;
	max-height: 70px;
}

.person .person-info text{
	padding-left: 20px;
	display: block;
}

.person .person-info .nickname{
	margin-top: 10px;
	height: 50px;
	line-height: 50px;
	font-size: 20px;
}

.person .person-info .username{
	line-height: 14px;
	padding-left: 20px;
	font-size: 14px;
}

.person .other-info{
	width: 100%;
	margin-top: 20px;
}

.person .other-info .other-list{
	width: 100%;
	height: 45px;
	line-height: 45px;
	text-indent: 20px;
	background: #FFF;
	border-bottom: 1px solid #CCC;
	color: black;
	font-size: 14px;
}

.person .other-info .other-list:first-child{
	border-top: 1px solid #CCC;
}

.person .other-info .other-list:last-child{
	color: orangered
}
三、js页面代码如下:
//person.js
//获取应用实例
var app = getApp();
Page({
  data: {
		userData: {
			Nickname: '微信小程序',
			Username: 'WeApp',
			AvatarLarge: '../../image/head.jpg'
		},
    infos:[
      {
        content: '错题历史',
        url: "../errorlist/errorlist"
      },
      {
        content: '题目收藏',
        url: "../favorite/favorite"
      },
    ]
  },
  logOff: function(e) {
    wx.showModal({
      title:'注意',
      content:'确认退出登录?',
      success:function(res) {
        if (res.confirm) {
          wx.request({
            url: app.url.host + app.url.logOffUrl,
            method: 'GET',
            success: function(data){
            //清除token
              wx.removeStorageSync('Authorization');
              wx.removeStorageSync('User');
              wx.removeStorageSync('SubjectId');
              var toastDelay = 1000;
              wx.showToast({
                title: '退出登录成功',
                duration: toastDelay
              });              
              setTimeout(function(){
                wx.redirectTo({
                  url: '../login/login'
                });
              },toastDelay);            
              
            },
            complete: null
          });
        }
      }
    });
  }
})

模板简介:该模板名称为【微信小程序开发会员中心错题历史题目收藏页面制作与设计教程】,大小是,文档格式为.,推荐使用打开,作品中的图片,文字等数据均可修改,图片请在作品中选中图片替换即可,文字修改直接点击文字修改即可,您也可以新增或修改作品中的内容,该模板来自用户分享,如有侵权行为请联系网站客服处理。欢迎来懒人模板【小程序教程】栏目查找您需要的精美模板。

相关搜索
  • 下载密码 lanrenmb
  • 下载次数 18,605次
  • 使用软件
  • 文件格式
  • 文件大小
  • 上传时间 05-24
  • 作者 网友投稿
  • 肖像权 人物画像及字体仅供参考
栏目分类 更多 >
热门推荐 更多 >
单页式简历模板 自适应 微信公众平台 微信文章 微信模板 响应式 html5 微信图片 微信素材 企业网站
您可能会喜欢的其他模板