首页 > 小程序教程 > 微信小程序微商商城个人中心页面样式模板制作设计下载

微信小程序微商商城个人中心页面样式模板制作设计下载

上一篇 下一篇
制作好以后效果图如下:
一、wxml页面代码如下:
<view class="userinfo">
	<!--<image class="userinfo-avatar" src="{{userInfo.avatarUrl}}" background-size="cover" bindtap="chooseImage"></image>
	<text class="userinfo-nickname">{{userInfo.nickName}}</text>-->
	<image src="../../../images/user.jpg"></image>
</view>
<view class="order-area">
	<view bindtap="navigateToOrder" class="order" data-status="0">
		<image src="../../../images/icon_order.png" />
		<text>待付款</text>
	</view>
	<view bindtap="navigateToOrder" class="order" data-status="1">
		<image src="../../../images/icon_order.png" />
		<text>待发货</text>
	</view>
	<view bindtap="navigateToOrder" class="order" data-status="2">
		<image src="../../../images/icon_order.png" />
		<text>已发货</text>
	</view>
	<view bindtap="navigateToOrder" class="order" data-status="3">
		<image src="../../../images/icon_order.png" />
		<text>已完成</text>
	</view>
</view>
<view bindtap="navigateToAddress" class="tableviewcell">
	<image src="../../../images/icon_address.png" />
	<text>收货地址</text>
</view>
<view bindtap="navigateToShare" class="tableviewcell">
	<image src="../../../images/icon_share.png" />
	<text>扫码分享</text>
</view>
<view bindtap="navigateToDonate" class="tableviewcell">
	<image src="../../../images/icon_donate.png" />
	<text>支付</text>
</view>
<view bindtap="navigateToAboutus" class="tableviewcell">
	<image src="../../../images/icon_aboutus.png" />
	<text>关于我们</text>
</view>
<button bindtap="logout" type="warn" class="logout">退出</button>
 
二、wxss样式文件代码如下:
page {
	background: #eee;
}

/*user info*/
.userinfo {
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 250rpx;
  background: white;
}

.userinfo-avatar {
  width: 128rpx;
  height: 128rpx;
  margin: 20rpx;
  border-radius: 50%;
}

.userinfo-nickname {
  color: #333;
}

/*menu list*/
.tableviewcell {
	padding: 20rpx 40rpx;
	border-bottom: 1rpx solid #ddd;
	color: #666;
	background: white;
	display: flex;
	align-items: center;
}

/*icon*/
.tableviewcell image {
	width: 60rpx;
	height: 60rpx;
}

/*text*/
.tableviewcell text {
	font-size: 16px;
	margin-left: 10px;
}

/*button*/
.logout {
	margin: 30rpx;
}

/*order*/
.order-area {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  background: white;
  margin: 20rpx 0;
  padding: 20rpx 0;
}

.order {
	width: 33.3%;
	text-align: center;
}

.order image {
	width: 90rpx;
	height: 90rpx;
}

.order text{
	display: block;
	font-size: 30rpx;
	color: #333;
}
三、js页面代码如下:
const AV = require('../../../utils/av-weapp.js')
var app = getApp()
Page({
	navigateToAddress: function () {
		wx.navigateTo({
			url: '../../address/list/list'
		});
	},
	navigateToOrder: function (e) {
		var status = e.currentTarget.dataset.status
		wx.navigateTo({
			url: '../../order/list/list?status=' + status
		});
	},
	logout: function () {
		if (AV.User.current()) {
			AV.User.logOut();
			wx.showToast({
				'title': '退出成功'
			});
		} else {
			wx.showToast({
				'title': '请先登录'
			});
		}
	},
	onShow: function () {
		var that = this;
		// 获得当前登录用户
		const user = AV.User.current();
		// 调用小程序 API,得到用户信息
		wx.getUserInfo({
			success: ({userInfo}) => {
				// 更新当前用户的信息,昵称头像等
                user.set(userInfo).save().then(user => {
			    	// 成功,此时可在控制台中看到更新后的用户信息
					that.setData({
						userInfo: userInfo
					});
			    }).catch(console.error);
			}
		});
	},
	chooseImage: function () {
		var that = this;
		wx.chooseImage({
			count: 1, // 默认9
			sizeType: ['original', 'compressed'], // 可以指定是原图还是压缩图,默认二者都有
			sourceType: ['album', 'camera'], // 可以指定来源是相册还是相机,默认二者都有
			success: function (res) {
				// 返回选定照片的本地文件路径列表,tempFilePath可以作为img标签的src属性显示图片
				var tempFilePath = res.tempFilePaths[0];
				new AV.File('file-name', {
					blob: {
						uri: tempFilePath,
					},
				}).save().then(
				// file => console.log(file.url())
					function(file) {
						// 上传成功后,将所上传的头像设置更新到页面<image>中
						var userInfo = that.data.userInfo;
						userInfo.avatarUrl = file.url();
						that.setData({
							userInfo, userInfo
						});
					}
				).catch(console.error);
			}
		})
	},
	navigateToAboutus: function () {
		wx.navigateTo({
			url: '/pages/member/aboutus/aboutus'
		});
	},
	navigateToDonate: function () {
		wx.navigateTo({
			url: '/pages/member/donate/donate'
		});
	},
	navigateToShare: function () {
		wx.navigateTo({
			url: '/pages/member/share/share'
		});
	}
})

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

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