cmy 2 vuotta sitten
vanhempi
commit
ef3713490d

+ 1 - 1
manifest.json

@@ -1,5 +1,5 @@
 {
-    "name" : "绿津",
+    "name" : "租电",
     "appid" : "__UNI__F0EBD91",
     "description" : "",
     "versionName" : "1.0.19",

+ 9 - 6
pages.json

@@ -8,10 +8,6 @@
 					"titleNView": false
 				},
 				// #endif
-				// #ifdef MP
-				"navigationBarBackgroundColor": "#ff629f",
-				"navigationBarTextStyle":"white",
-				// #endif
 				"navigationBarTitleText": "母婴界严选"
 			}
 		},
@@ -21,6 +17,13 @@
 				"navigationBarTitleText": "邀好友赚佣金"
 			}
 		},
+		{
+			"path": "pages/mall/mall",
+			"style": {
+				"navigationStyle": "custom",
+				"navigationBarTitleText": "商城"
+			}
+		},
 		{
 			"path": "pages/user/user",
 			"style": {
@@ -264,7 +267,7 @@
 	},
 	"tabBar": {
 		"color": "#666666",
-		"selectedColor": "#F65486",
+		"selectedColor": "#6DD6B8",
 		"borderStyle": "black",
 		"backgroundColor": "#ffffff",
 		"list": [{
@@ -274,7 +277,7 @@
 				"text": "首页"
 			},
 			{
-				"pagePath": "pages/cart/cart",
+				"pagePath": "pages/mall/mall",
 				"iconPath": "static/tabBar/tab-cart.png",
 				"selectedIconPath": "static/tabBar/tab-cart-current.png",
 				"text": "商城"

+ 301 - 2
pages/mall/mall.vue

@@ -1,8 +1,307 @@
 <template>
+	<view class="indexBox">
+		<swiper class="top-swiper" autoplay="true" duration="400" interval="5000" @change="swiperChange">
+			<swiper-item v-for="item in imagelist" class="carousel-item" @click="navTo(item.url)">
+				<image class="imageitem" :src="item.img" />
+			</swiper-item>
+		</swiper>
+		<view class="hot-list-box">
+			<view class="list-box">
+				<view class="list" v-for="(item,index) in navList.orderList" @click="navTo('/pages/user/model/model?mtype=' + item.id)">
+					<view class="list-image-box">
+						<image class="list-image" :src="item.img" mode="widthFix"></image>
+					</view>
+					<view class="list-content">
+						
+					<view class="list-title clamp">
+						{{item.title}}
+					</view>
+					<view class="list-money flex flex-start">
+						<view class="money">
+							¥{{item.price}}
+						</view>
+					</view>
+					</view>
+				</view>
+			</view>
+		</view>
+		<uni-load-more :status="navList.loadingType"></uni-load-more>
+	</view>
 </template>
 
 <script>
+	import {
+		mapState,
+		mapMutations
+	} from 'vuex';
+	import {
+		share
+	} from '@/api/wx';
+	// import {
+	// 	getBannerList,
+	// 	getShowTemplateList
+	// } from '@/api/model.js';
+	export default {
+		data() {
+			return {
+				//轮播图
+				imagelist: [],
+				// 推荐商品
+				navList: {
+					state: 1,
+					text: '通知',
+					loadingType: 'more',
+					orderList: [],
+					page: 1, //当前页数
+					limit: 10, //每次信息条数
+					count: 0, //总消息条数
+				},
+				// 热门商品
+				rmList: []
+			};
+		},
+		computed: {
+			...mapState('user', [ 'userInfo']),
+		},
+		onLoad: function(option) {
+			// #ifndef MP
+			if (option.spread) {
+				// 存储其他邀请人
+				uni.setStorageSync('spread', option.spread);
+			}
+			// #endif
+			// #ifdef MP
+			if (option.scene) {
+				// 存储小程序邀请人
+				uni.setStorage({
+					key: 'spread_code',
+					data: option.scene
+				});
+			}
+			// #endif
+			// 加载分享信息
+			this.share()
+		},
+		onShow() {
+			// this.loadIndexs();
+		},
+		onReady() {},
+		// 滚动到底部
+		onReachBottom() {
+			// this.getShowTemplateList();
+		},
+		// #ifdef MP
+		onShareAppMessage(options) {
+			// 设置菜单中的转发按钮触发转发事件时的转发内容
+			let pages = getCurrentPages(); //获取加载的页面
+			let currentPage = pages[pages.length - 1]; //获取当前页面的对象
+			let url = currentPage.route; //当前页面url
+			let item = currentPage.options; //如果要获取url中所带的参数可以查看options
+			let shareObj = {
+				title: "母婴界严选", // 默认是小程序的名称(可以写slogan等)
+				path: url, // 默认是当前页面,必须是以‘/’开头的完整路径
+				imageUrl: this.shareData.img,
+				desc: this.shareData.synopsis,
+				success: function(res) {
+					// 转发成功之后的回调
+					if (res.errMsg == 'shareAppMessage:ok') {}
+				},
+				fail: function() {
+					// 转发失败之后的回调
+					if (res.errMsg == 'shareAppMessage:fail cancel') {
+						// 用户取消转发
+					} else if (res.errMsg == 'shareAppMessage:fail') {
+						// 转发失败,其中 detail message 为详细失败信息
+					}
+				}
+			};
+			// 判断是否可以邀请
+			if (this.userInfo.uid) {
+				shareObj.path += '&spread=' + this.userInfo.uid;
+			}
+			return shareObj;
+		},
+		// #endif
+		methods: {
+			share() {
+				// console.log('加载分享');
+				const that = this;
+				// 请求获取默认数据
+				share({}).then(({
+					data
+				}) => {
+					// console.log('分享回调', data);
+					that.shareData = data.data
+				});
+			},
+
+			// 首页初始化
+			loadIndexs() {
+				const that = this;
+				// 轮播图
+				getBannerList().then(
+					(res) => {
+						that.imagelist = res.data.list
+						console.log(res);
+					}
+				).catch(
+					(res) => {
+						console.log(res);
+					}
+				)
+				// 获取热门
+				getShowTemplateList({
+					is_hot: 1,
+					pageSize: 3
+				}).then(
+					(res) => {
+						that.rmList = res.data.list
+						console.log(res);
+					}
+				).catch(
+					(res) => {
+						console.log(res);
+					}
+				)
+				that.getShowTemplateList();
+			},
+			// 获取模板列表
+			getShowTemplateList(source) {
+				//这里是将订单挂载到tab列表下
+				let navItem = this.navList;
+				let state = navItem.state;
+				if (source === 'tabChange' && navItem.loaded === true) {
+					//tab切换只有第一次需要加载数据
+					return;
+				}
+				if (navItem.loadingType === 'loading') {
+					//防止重复加载
+					return;
+				}
+				if (navItem.loadingType === 'noMore') {
+					//防止重复加载
+					return;
+				}
+				// 修改当前对象状态为加载中
+				navItem.loadingType = 'loading';
+				getShowTemplateList({
+						is_recommend: 1,
+						page: navItem.page,
+						pageSize: navItem.limit
+					})
+					.then(({
+						data
+					}) => {
+						let arr = data.list.map(e => {
+							return e;
+						});
+						navItem.orderList = navItem.orderList.concat(arr);
+						navItem.page++;
+						if (navItem.limit == arr.length) {
+							//判断是否还有数据, 有改为 more, 没有改为noMore
+							navItem.loadingType = 'more';
+							return;
+						} else {
+							//判断是否还有数据, 有改为 more, 没有改为noMore
+							navItem.loadingType = 'noMore';
+						}
+						uni.hideLoading();
+						this.$set(navItem, 'loaded', true);
+					})
+					.catch(e => {
+						console.log(e);
+					});
+
+			},
+			navTo(url) {
+				if (url) {
+					if (url.indexOf('http') > -1) {
+						// #ifdef H5
+						window.location.href = url
+						// #endif
+						// #ifdef APP
+						plus.runtime.openURL(url)
+						// #endif
+					} else {
+						uni.navigateTo({
+							url: url
+						})
+					}
+				}
+			}
+		},
+	};
 </script>
 
-<style>
-</style>
+<style lang="scss">
+	page,
+	.indexBox {
+		height: auto;
+		min-height: 100%;
+	}
+
+	.indexBox {
+		padding-bottom: 50rpx;
+	}
+
+	.top-swiper {
+		margin: auto;
+		width: 750rpx;
+		height: 273rpx;
+		padding: 0 $page-row-spacing;
+		background: linear-gradient(to bottom, #ff629f, rgba(255, 255, 255, 1) 80%, rgba(255, 255, 255, 1));
+
+		.carousel-item {
+			border-radius: 20rpx;
+
+			.imageitem {
+				// margin: auto;
+				width: 690rpx;
+				height: 273rpx;
+			}
+		}
+	}
+
+	.hot-list-box {
+		padding: $page-row-spacing;
+		background-color: #FFFFFF;
+		padding-bottom: 0;
+		.list-box {
+			display: flex;
+			flex-wrap: wrap;
+			justify-content: space-between;
+			align-items: flex-start;
+			padding-top: 30rpx;
+			padding-bottom: 20rpx;
+
+			.list {
+				box-shadow: 0px 0px 20rpx 0px rgba(50,50,52,0.06);
+				border-radius: 15rpx;
+				.list-image-box {
+					width: 330rpx;
+					height: 420rpx;
+					overflow: hidden;
+
+					.list-image {
+						width: 100%;
+					}
+				}
+				.list-content{
+					padding: 20rpx;
+					line-height: 1;
+					.list-title {
+						color: $font-color-dark;
+						font-size: $font-base;
+						margin-bottom: 20rpx;
+					}
+					.list-money {
+						.money {
+							font: $font-lg;
+							color: #FF3342;
+						}
+					}
+				}
+			}
+		}
+	}
+</style>

+ 171 - 200
pages/user/user.vue

@@ -2,92 +2,75 @@
 	<view class="container">
 		<scroll-view class="content-box" scroll-y="true">
 			<view class="user-section">
-				<view class="user-info-box ">
-					<view class="detail flex">
-						<view class="portrait-box" @click="navTo('/pages/set/userinfo')">
-							<image class="portrait" :src="user.avatar || '/static/error/missing-face.png'"></image>
+				<view class="avatar" @click="navTo('/pages/set/userinfo')">
+					<image class="image" :src="user.avatar|| urlFile+`/static/error/missing-face.png`" mode="scaleToFill"></image>
+				</view>
+				<view class="flex-center phone" >
+					<template v-if="user.phone">
+					{{((''+user.phone).split('').splice(3,4,'****')).join('')}}
+					</template>
+				</view>
+				<view class="tj-sction">
+					<view class="tj-item" @click="navTo('/pages/user_home/award/award')">
+						<text class="num">{{ user.brokerage_price || '0.00' }}</text>
+						<text>我的佣金</text>
+					</view>
+					<!-- <view class="tj-item" @click="navTo('/pages/user/award/award')">
+						<text class="num">{{ user.brokerage_price || '0.00' }}</text>
+						<text>我的推广</text>
+					</view> -->
+					<view class="tj-item" @click="navTo('/pages/user_home/money/wallet')">
+						<text class="num">{{user.now_money || '0.00' }}</text>
+						<text>我的余额</text>
+					</view>
+				</view>
+			</view>
+			
+			<view class="cover-container">
+				
+				<view class="item-box">
+					<view class="box-title flex">
+						<view class="title"><text>我的订单</text></view>
+						<view class="link flex" @click="navTo('/pages/order/order?state=0')" hover-class="common-hover">
+							<text class="margin-r-10">全部</text>
+							<image class="img" src="../../static/icon/next1.png" mode="widthFix"></image>
 						</view>
-						<view class="info-box">
-							<view class="username flex-start">
-								<text class="clamp padding-r-20">
-									{{ user.nickname || '游客' }}
-								</text>
-
-								<view class="tipLevel flex-shrink-false">
+					</view>
+					<view class="order-section">
+						<view class="order-item" @click="navTo('/pages/order/order?state=0')" hover-class="common-hover"
+							:hover-stay-time="50">
+							<view class=" icon position-relative">
+								<image class="icon-img" src="../../static/icon/userorder1.png" mode="aspectFit">
+								</image>
+								<view class="corner" v-if="user.unpaid_count > 0">
+									<text>{{ user.unpaid_count }}</text>
 								</view>
 							</view>
-							<view class="flex-start flex">
-								<view class="authentication"
-									@click="navTo('/pages/user/realName/realNameAuthentication')" v-if="!user.mobile">
+							<text>待付款</text>
+						</view>
+						<view class="order-item" @click="navTo('/pages/order/order?state=2')" hover-class="common-hover"
+							:hover-stay-time="50">
+							<view class="icon position-relative">
+								<image class="icon-img" src="../../static/icon/userorder2.png" mode="aspectFit">
+								</image>
+								<view class="corner" v-if="user.received_count > 0">
+									<text>{{ user.received_count }}</text>
 								</view>
-								<view class="authentication" v-else>{{user.mobile}}</view>
 							</view>
+							<text>待核销</text>
 						</view>
-						<view class="righ-tbox flex">
-							<!-- <image class="right-tip" src="../../static/icon/tiptop.png" mode="scaleToFill"></image> -->
-							<block v-if="!user.work_type_title">
-								普通用户
-							</block>
-							<block v-else>
-								{{user.work_type_title}}
-							</block>
+						<view class="order-item" @click="navTo('/pages/order/order?state=3')" hover-class="common-hover"
+							:hover-stay-time="50">
+							<view class=" icon position-relative">
+								<image class="icon-img" src="../../static/icon/userorder3.png" mode="aspectFit">
+								</image>
+							</view>
+							<text>已完成</text>
 						</view>
 					</view>
 				</view>
-			</view>
-			<view class="nav-model flex" @click="navcard">
-				<view class="right-card">
-					<view class="title">
-						我的名片
-					</view>
-					<view class="tip" v-if="user.info_audit_status==-2">
-						认证成功即可获得母婴师名片
-					</view>
-					<view class="tip" v-else-if="user.info_audit_status==1">
-						认证成功点击查看您的母婴师名片
-					</view>
-					<view class="tip" v-else-if="user.info_audit_status==0&&user.work_type_id<=0">
-						名片资料审核中请等待审核完毕
-					</view>
-					<view class="tip" v-else-if="user.info_audit_status==0&&user.work_type_id>0">
-						修改名片资料中请等待审核完毕
-					</view>
-				</view>
-				<image class="next" src="../../static/icon/next2.png" mode="scaleToFill"></image>
-			</view>
-			<view class="nav-model-rz flex" v-if="user.work_type_id>0&&user.type_audit_status!=1" @click="user.type_audit_status==0||navTo('/pages/user/model/shoprz')">
-				<view class="tiptext" v-if="user.type_audit_status==-2">
-					您未完成平台认证,请立即认证>>
-				</view>
-				<view class="tiptext" v-else-if="user.type_audit_status==-1">
-					您平台认证失败,请重新认证>>
-				</view>
-				<view class="tiptext" v-else-if="user.type_audit_status==-3">
-					您平台认证已失效,请重新认证>>
-				</view>
-				<view class="tiptext" v-else-if="user.type_audit_status==0">
-					您已提交认证信息请等待认证结束
-				</view>
-				<view class="rztext" v-if="user.type_audit_status==-2">
-					立即认证
-				</view>
-				<view class="rztext" v-else-if='user.type_audit_status==-3||user.type_audit_status==-1'>
-					重新认证
-				</view>
-			</view>
-			<view class="cover-container">
 				<view class="listBox">
 					<view class="list">
-						<!-- <view class="flex listItem" @click="navTo('/pages/user/myCart/myCart')">
-							<view class="flex titleBox">
-								<image class="listIconImg" src="../../static/icon/mymoney.png" mode="widthFix"></image>
-								<text class="title">我的钱包</text>
-							</view>
-							<view class="right flex">
-								<text></text>
-								<image class="img" src="../../static/icon/next1.png" mode="widthFix"></image>
-							</view>
-						</view> -->
 						<view class="flex listItem" @click="navTo('/pages/user/model/mymodellist')">
 							<view class="flex titleBox">
 								<image class="listIconImg" src="../../static/icon/userreal.png" mode="widthFix"></image>
@@ -98,18 +81,16 @@
 								<image class="img" src="../../static/icon/next1.png" mode="widthFix"></image>
 							</view>
 						</view>
-						<!-- #ifdef MP -->
 						<button hover-class="none" class="flex listItem" open-type='contact'>
 							<view class="flex titleBox">
 								<image class="listIconImg" src="../../static/icon/userkf.png" mode="widthFix"></image>
-								<text class="title">客服中心</text>
+								<text class="title">客服</text>
 							</view>
 							<view class="right flex">
 								<text></text>
 								<image class="img" src="../../static/icon/next1.png" mode="widthFix"></image>
 							</view>
 						</button>
-						<!-- #endif -->
 						<view class="flex listItem" @click="navTo('/pages/user/shareQrCode')">
 							<view class="flex titleBox">
 								<image class="listIconImg" src="../../static/icon/usergg.png" mode="widthFix"></image>
@@ -161,6 +142,7 @@
 				user: {
 					avatar: '', //头像
 					nickname: '', //昵称
+					phone:''
 				},
 				shareData: {}
 			};
@@ -260,6 +242,19 @@
 	};
 </script>
 <style lang="scss">
+	%section {
+		display: flex;
+		justify-content: space-around;
+		align-content: center;
+		border-radius: 10rpx;
+	}
+	%flex-center {
+		display: flex;
+		flex-direction: column;
+		justify-content: center;
+		align-items: center;
+	}
+	
 	page {
 		height: 100%;
 	}
@@ -305,6 +300,10 @@
 	.container {
 		height: 100%;
 		background-color: $page-color-base;
+		background-image: url('../../static/image/userbg.png') ;
+		background-repeat: no-repeat;
+		background-size: 100% auto;
+		padding-top: 100rpx;
 	}
 
 	.content-box {
@@ -312,140 +311,112 @@
 	}
 
 	.user-section {
-		padding: 15rpx 30rpx 0;
-		position: relative;
-		background: url('https://api.myjie.cn/resource/appimage/userbg.png');
-		background-size: 100% 100%;
-		padding-top: 100rpx;
-		height: 350rpx;
-	}
-
-	.user-info-box {
-		height: 180rpx;
-		color: white;
-		display: flex;
-		align-items: center;
-		justify-content: space-between;
-		position: relative;
-		z-index: 1;
-
-		.detail {
+		background-color: #FFF;
+		border-radius: 20rpx;
+		margin: 0 $page-row-spacing;
+		padding: 20rpx 0;
+		padding-top: 50rpx;
+		.avatar{
+			width: 130rpx;
 			height: 130rpx;
-			flex-grow: 1;
+			margin: 0 auto;
+			border-radius: 100rpx;
 			overflow: hidden;
-
-			.portrait-box {
+			margin-bottom: 30rpx;
+			.image{
+				width:100%;
 				height: 100%;
-
-				.portrait {
-					width: 130rpx;
-					height: 100%;
-					border: 5rpx solid #fff;
-					border-radius: 50%;
-				}
-			}
-
-			.info-box {
-				margin-left: 20rpx;
-				line-height: 1.5;
-				flex-grow: 1;
-				overflow: hidden;
-
-				.tipLevel {
-					height: 36rpx;
-					margin-right: 20rpx;
-				}
-
-				.username {
-					font-size: 34rpx;
-					color: #FFF;
-					font-weight: bold;
-					height: 100%;
-				}
-
-				.authentication {
-					font-size: 24rpx;
-					color: #FFF;
-					float: left;
-				}
-			}
-
-			.righ-tbox {
-				padding: 10rpx 20rpx;
-				border-radius: 12rpx;
-				font-size: 25rpx;
-				line-height: 1;
-				color: $base-color;
-				background-color: #FFF;
-
-				.right-tip {
-					width: 25rpx;
-					height: 33rpx;
-					margin-right: 10rpx;
-				}
 			}
 		}
-	}
-	.nav-model-rz{
-		background-color:#FFD7E3 ;
-		border-radius: 20rpx;
-		margin: 0 auto;
-		padding: 30rpx;
-		padding-bottom: 15rpx;
-		padding-top: 50rpx;
-		line-height: 1;
-		width: 690rpx;
-		margin-top: -38rpx;
-		.tiptext{
-			color:#F65486 ;
-			font-size: 26rpx;
-			font-weight: bold;
-		}
-		.rztext{
-			color: #FFF;
-			background-color: #F65486;
-			border-radius: 100rpx;
-			padding: 15rpx 20rpx;
-			font-size: 22rpx;
+		.phone{
+			height:1rem;
+			margin-bottom: 50rpx;
 		}
 	}
 
-	.nav-model {
-		background: url('https://api.myjie.cn/resource/appimage/uservip.png');
-		background-size: 100% 100%;
-		color: #FFF;
-		border-radius: 20rpx;
-		width: 690rpx;
-		height: 157rpx;
-		margin: 0 auto;
-		margin-top: -80rpx;
-		font-weight: bold;
-		z-index: 1;
+	.cover-container {
+		padding: 0 30rpx;
 		position: relative;
-
-		.next {
-			width: 26rpx;
-			height: 28rpx;
-			margin-right: 40rpx;
+		padding-bottom: 20rpx;
+	}
+	.tj-sction {
+		@extend %section;
+	
+		.tj-item {
+			@extend %flex-center;
+			flex-direction: column;
+			height: 100rpx;
+			font-size: $font-sm;
+			color: $font-color-light;
 		}
-
-		.right-card {
-			padding-left: 170rpx;
+	
+		.num {
+			font-size: $font-base;
+			color: $font-color-dark;
+			margin-bottom: 8rpx;
+			font-weight: bold;
 		}
-
-		.title {
-			font-size: 35rpx;
+	}
+	.item-box {
+		border-radius: 20rpx;
+		background-color: white;
+		margin-top: 20rpx;
+	
+		.box-title {
+			line-height: 1;
+			padding: 30rpx 40rpx;
+	
+			.title {
+				font-size: $font-lg;
+				font-weight: bold;
+			}
+	
+			.link {
+				font-size: $font-base - 2rpx;
+				color: $font-color-light;
+				.img{
+					width: 26rpx;
+				}
+			}
 		}
-
-		.tip {
-			font-size: 26rpx;
+	
+		.order-section {
+			@extend %section;
+			padding: 28rpx 0;
+			padding-top: 0;
+	
+			.order-item {
+				@extend %flex-center;
+				width: 120rpx;
+				height: 120rpx;
+				border-radius: 10rpx;
+				font-size: $font-sm;
+				color: $font-color-dark;
+			}
+	
+			.iconfont {
+				font-size: 48rpx;
+				margin-bottom: 18rpx;
+				color: #fa436a;
+			}
+	
+			.icon-shouhoutuikuan {
+				font-size: 44rpx;
+			}
+	
+			.icon {
+				height: 50rpx;
+				width: 48rpx;
+				margin-bottom: 18rpx;
+				background-size: 100%;
+				background-repeat: no-repeat;
+				background-position: center;
+	
+				.icon-img {
+					width: 100%;
+					height: 100%;
+				}
+			}
 		}
-
-	}
-
-	.cover-container {
-		padding: 0 30rpx;
-		position: relative;
-		padding-bottom: 20rpx;
 	}
 </style>

BIN
static/icon/userorder1.png


BIN
static/icon/userorder2.png


BIN
static/icon/userorder3.png


BIN
static/image/userbg.png