Browse Source

增加一些功能

sslyg 2 years ago
parent
commit
7330537818

+ 1 - 0
App.vue

@@ -186,6 +186,7 @@
 <style>
 	page {
 		background: #F8F8F8;
+		padding-bottom: var(–safe-area-inset-bottom);
 	}
 
 	uni-button:after {

+ 4 - 1
main.js

@@ -38,8 +38,11 @@ Vue.filter('priceFilter', (price) => {
 	return Number(price).toFixed(2);
 })
 
-Vue.filter('datetimeFilter', (value) => {
+Vue.filter('datetimeFilter', (value,format) => {
 	var datetimeFormat = 'YYYY-MM-DD HH:mm:ss'
+	if(format){
+		datetimeFormat = format
+	}
 	if (isNaN(value)) {
 		return value ? Moment(value).format(datetimeFormat) : '';
 	} else {

+ 4 - 3
manifest.json

@@ -24,6 +24,7 @@
         "distribute" : {
             /* android打包配置 */
             "android" : {
+                "packagename" : "io.ssly.outsource.sxzg",
                 "permissions" : [
                     "<uses-feature android:name=\"android.hardware.camera\"/>",
                     "<uses-feature android:name=\"android.hardware.camera.autofocus\"/>",
@@ -61,9 +62,9 @@
             "splashscreen" : {
                 "androidStyle" : "default",
                 "android" : {
-                    "hdpi" : "static/splash/640960.png",
-                    "xhdpi" : "static/splash/7201242.png",
-                    "xxhdpi" : "static/splash/10801882.png"
+                    "hdpi" : "static/splash/sp.9.png",
+                    "xhdpi" : "static/splash/sp.9.png",
+                    "xxhdpi" : "static/splash/sp.9.png"
                 }
             },
             "icons" : {

+ 28 - 1
pages.json

@@ -327,7 +327,34 @@
 			}
 
 		}
-	],
+	    ,{
+            "path" : "pages/user/user-profit",
+            "style" :                                                                                    
+            {
+                "navigationBarTitleText": "收益",
+                "enablePullDownRefresh": false
+            }
+            
+        }
+        ,{
+            "path" : "pages/user/invitation-list",
+            "style" :                                                                                    
+            {
+                "navigationBarTitleText": "粉丝",
+                "enablePullDownRefresh": false
+            }
+            
+        }
+        ,{
+            "path" : "pages/user/invite",
+            "style" :                                                                                    
+            {
+                "navigationBarTitleText": "邀请",
+                "enablePullDownRefresh": false
+            }
+            
+        }
+    ],
 	"globalStyle": {
 		"navigationBarTextStyle": "white",
 		"navigationBarTitleText": "省心直供",

+ 17 - 3
pages/home/search.vue

@@ -1,6 +1,6 @@
 <template>
 	<view id="body">
-		<view class="history" v-if="products.length===0&&search===''">
+		<view class="history" v-if="products.length===0 && search===''">
 			<view class="header">
 				<image src="../../static/images/clock.png" mode="scaleToFill"
 					style="width: 30upx;height: 30upx;margin-left: 10upx;"></image>
@@ -19,6 +19,7 @@
 					:org-price="product.org_price" :price="product.price"></product-item>
 			</template>
 		</view>
+		<view class="nomore" v-if="nomore">没搜到任何相关商品</view>
 	</view>
 </template>
 
@@ -30,7 +31,8 @@
 				page: 1,
 				pageLoading: false,
 				search: "",
-				history: []
+				history: [],
+				nomore: false
 			}
 		},
 		onPageScroll(e) {
@@ -76,6 +78,11 @@
 							this.products = [...this.products, ...res.data.data.rows]
 							this.page++;
 							this.pageLoading = false;
+							if (this.products.length === 0) {
+								this.nomore = true;
+							} else {
+								this.nomore = false;
+							}
 						}
 					})
 
@@ -91,10 +98,12 @@
 				this.page = 1
 				this.products = []
 				this.getProductList()
-				
+
 				// #ifdef APP-PLUS			
 				const currentWebview = this.$scope.$getAppWebview();
 				currentWebview.setTitleNViewSearchInputText(this.search);
+				currentWebview.setTitleNViewSearchInputFocus(true)
+				currentWebview.setTitleNViewSearchInputFocus(false)
 				// #endif
 
 			},
@@ -151,4 +160,9 @@
 			}
 		}
 	}
+
+	.nomore {
+		text-align: center;
+		font-size: 28upx;
+	}
 </style>

+ 4 - 0
pages/product/my-product.vue

@@ -191,6 +191,10 @@
 			display: flex;
 			justify-content: space-between;
 		}
+		.row-3 {
+			display: flex;
+			align-items: center;
+		}
 
 		.org-price {
 			font-size: 26rpx;

+ 8 - 3
pages/product/product-details.vue

@@ -113,9 +113,13 @@
 						选择数量
 					</view>
 					<view class="counter">
-						<view class="sub" @tap="num>1?num--:0">-</view>
+						<view class="sub" @tap="num>1?num--:0">
+							<image style="width: 42upx;height: 42upx;" src="../../static/minus.png" mode="scaleToFill"></image>
+						</view>
 						<input class="num" type="text" v-model="num" />
-						<view class="plus" @tap="num++">+</view>
+						<view class="plus" @tap="num++">
+							<image style="width: 42upx;height: 42upx;" src="../../static/add.png" mode="scaleToFill"></image>
+						</view>
 					</view>
 				</view>
 				<view class="row row-5 total-price">
@@ -532,7 +536,8 @@
 				font-weight: 0;
 				width: 42upx;
 				text-align: center;
-
+				display: flex;
+				align-items: center;
 				&:active {
 					background: rgba(0, 0, 0, .1);
 				}

+ 8 - 3
pages/shopping-cart/shopping-cart.vue

@@ -46,9 +46,13 @@
 						</view>
 					</view>
 					<view class="counter">
-						<view class="sub" @tap="subnum(product.id,product.num,product.spec_index)">-</view>
+						<view class="sub" @tap="subnum(product.id,product.num,product.spec_index)">
+							<image style="width: 42upx;height: 42upx;" src="../../static/minus.png" mode="scaleToFill"></image>
+						</view>
 						<input class="num" type="text" v-model="product.num" />
-						<view class="plus" @tap="plusnum(product.id,product.num,product.spec_index)">+</view>
+						<view class="plus" @tap="plusnum(product.id,product.num,product.spec_index)">
+							<image style="width: 42upx;height: 42upx;" src="../../static/add.png" mode="scaleToFill"></image>
+						</view>
 					</view>
 				</view>
 			</view>
@@ -322,7 +326,8 @@
 					font-weight: 0;
 					width: 42upx;
 					text-align: center;
-
+					display: flex;
+					align-items: center;
 					&:active {
 						background: rgba(0, 0, 0, .1);
 					}

+ 8 - 1
pages/user/collection.vue

@@ -255,6 +255,7 @@
 		.row-2 {
 			display: flex;
 			justify-content: space-between;
+			margin-top: 4upx;
 		}
 
 		.org-price {
@@ -278,12 +279,18 @@
 		.price {
 			font-size: 26rpx;
 			color: $primary-color;
-			font-weight: bold;
+			font-weight: bold;			
+		}
+		.row-3 {
+			display: flex;
+			align-items: center;
+			margin-top: 4upx;
 		}
 
 		.row-4 {
 			font-size: 24upx;
 			color: #999999;
+			margin-top: 4upx;
 		}
 	}
 

+ 175 - 0
pages/user/invitation-list.vue

@@ -0,0 +1,175 @@
+<template>
+	<view class="invitation-list">
+		<view class="header-bg"></view>
+
+		<view class="header">
+			<view class="title">
+				粉丝
+			</view>
+		</view>
+		<view class="list">
+			<template v-for="item in subordinates">
+			<view class="list-item">
+				<view class="l">
+					<image class="image" src="/static/img/logo.08771339.png" mode="scaleToFill"></image>
+				</view>
+				<view class="c">
+					<view class="nickname">
+						昵称:{{item.nickname}}
+					</view>
+					<view>
+							<text v-show="item.group_id===3" class="wddz">网店店主</text>
+							<text v-show="item.group_id===2" class="zgcj">直供厂家</text>
+						</view>
+					
+					<view class="phone" style="height: 10upx;">
+						
+					</view>
+					<view class="time">加入时间:2021-02-20 20:10:11</view>
+				</view>
+			</view>
+			</template>
+		</view>
+	</view>
+</template>
+
+<script>
+	export default {
+		data() {
+			return {
+				subordinates: [],
+				page: 1,
+				pageLoading: false
+			}
+		},
+		onLoad() {
+			this.getSubordinates();
+		},
+		onPageScroll(e) {
+			const query = uni.createSelectorQuery();
+			query.select("#order").boundingClientRect(data => {
+				if (e.scrollTop > data.height - uni.getSystemInfoSync().windowHeight * 2 &&
+					(this.page - 1) * 10 < this.subordinates.length) {
+					this.getSubordinates();
+				}
+			}).exec();
+
+		},
+
+		methods: {
+			getSubordinates() {
+				if (!this.pageLoading) {
+					console.log("加载下一页");
+					this.pageLoading = true;
+					this.$http.get({
+						url: "/user/subordinates",
+						data: {							
+							limit: 10,
+							page: this.page
+						},
+						success: (res) => {
+							this.subordinates = [...this.subordinates, ...res.data.data.rows]							
+							this.page++;
+							this.pageLoading = false;
+						}
+					})
+
+				}
+			},
+
+		}
+	}
+</script>
+
+<style lang="scss" scoped>
+	.invitation-list {
+		position: relative;
+		overflow: hidden;
+	}
+
+	.header-bg {
+		background: $primary-color;
+		height: 100upx;
+		position: absolute;
+		top: 0;
+		width: 100%;
+		z-index: 1;
+	}
+
+	.header {
+		margin: 20upx;
+		background: white;
+		text-align: center;
+		border-radius: 20upx;
+		position: relative;
+		z-index: 2;
+
+		.title {
+			height: 100upx;
+			font-size: 32upx;
+			line-height: 100upx;
+			// font-weight: bold;
+		}
+
+	}
+
+	.list {
+		.list-item {
+			padding: 20upx;
+			margin: 20upx;
+			background: white;
+			display: flex;
+			// font-family: "Roboto";
+			border-radius: 10upx;
+
+			.l {
+				height: 100upx;
+
+				.image {
+					background: #E0E0E0;
+					width: 100upx;
+					height: 100upx;
+					border-radius: 50upx;
+				}
+			}
+
+			.c {
+				margin-left: 20upx;
+
+				.nickname,
+				.phone {
+					font-size: 24upx;
+					color: #666666;
+				}
+
+				.time {
+					font-size: 24upx;
+					color: #999999;
+				}
+			}
+
+			.r {
+				margin-left: auto;
+				font-size: 36upx;
+			}
+		}
+	}
+	.wddz,
+	.zgcj {
+		font-size: 24upx;
+		color: rgb(255, 93, 91);
+		border: 2upx solid rgb(255, 93, 91);
+		border-radius: 20upx;
+		width: 140upx;
+		height: 36upx;
+		line-height: 36upx;
+		text-align: center;
+		// text-indent: 20upx;
+		display: inline-block;
+		padding: 0;
+		background: url(../../static/images/do.png) no-repeat;
+		background-size: 21upx 21upx;
+		background-position: 10upx;
+	}
+	
+</style>

+ 105 - 0
pages/user/invite.vue

@@ -0,0 +1,105 @@
+<template>
+	<view class="invite">
+		<view class="header-bg"></view>
+
+		<view class="header">
+			<view class="title">
+				邀请
+			</view>
+		</view>
+		<view class="content">
+			<view class="tips">分享专属海报邀请5位好友注册升级为代理会员,关系自动绑定</view>
+			<view class="poster-wrap">
+				<image class="poster" src="" mode=""></image>
+			</view>
+			<view class="button">
+				<button class="share-btn" type="default">分享专属海报</button>
+			</view>
+		</view>
+	</view>
+</template>
+
+<script>
+	export default {
+		data() {
+			return {
+
+			}
+		},
+		methods: {
+
+		}
+	}
+</script>
+
+<style lang="scss" scoped>
+	.invite {
+		position: relative;
+		overflow: hidden;
+	}
+
+	.header-bg {
+		background: $primary-color;
+		height: 100upx;
+		position: absolute;
+		top: 0;
+		width: 100%;
+		z-index: 1;
+	}
+
+	.header {
+		margin: 20upx;
+		background: white;
+		text-align: center;
+		border-radius: 20upx;
+		position: relative;
+		z-index: 2;
+
+		.title {
+			height: 100upx;
+			font-size: 32upx;
+			line-height: 100upx;
+			// font-weight: bold;
+		}
+
+	}
+
+	.content {
+		background: white;
+		margin: 20upx;
+		border-radius: 10upx;
+		overflow: hidden;
+
+		.tips {
+			margin: 20upx;
+			font-size: 24upx;
+			color: #999999;
+			text-align: center;
+		}
+		
+		.poster-wrap{
+			text-align: center;
+		}
+		.poster{
+			background: #EEEEEE;
+			width: 450upx;
+			height: 700upx;
+		}
+		
+		.button{
+			text-align: center;
+			margin: 40upx 0;
+		}
+		
+		.share-btn {
+			background-color: $primary-color;
+			color: white;
+			font-size: 32upx;
+			padding: 10upx 20upx;
+			border-radius: 10upx;
+			line-height: normal;
+			display: inline-block;
+			margin-top: 20upx;
+		}
+	}
+</style>

+ 89 - 9
pages/user/user-center.vue

@@ -15,13 +15,13 @@
 			<view class="invite">
 				<view class="invite-code">邀请码:{{invite_code}}</view>
 				<view class="invite-progress">
-					<view class="item active"></view>
-					<view class="item active"></view>
-					<view class="item active"></view>
-					<view class="item"></view>
-					<view class="item"></view>
+					<template v-for="index in 5">
+						<view v-if="index <= invite_num" class="item active"></view>
+						<view v-else class="item"></view>
+					</template>
 				</view>
-				<view class="invite-notes">再邀请3人获得代理会员</view>
+				<view class="invite-notes">再邀请{{5 - invite_num}}人获得一个月代理会员</view>
+				<view v-if="vip_expire && Date.parse(vip_expire.replace('-','/')) > new Date()" class="invite-notes">会员到期时间:{{vip_expire | datetimeFilter('YYYY-MM-DD')}}</view>
 			</view>
 		</view>
 		<view class="body">
@@ -32,14 +32,64 @@
 				</view>
 				<view v-if="user_type===2" class="row">
 					<view class="col">保证金(元):<text>0.00</text><text class="tips">(保证金2000元)</text></view>
-					<view class="col"><button class="btn jiaona-btn"  @tap="goToDeposit">立即缴纳</button></view>
+					<view class="col"><button class="btn jiaona-btn" @tap="goToDeposit">立即缴纳</button></view>
 				</view>
 				<view v-if="user_type===3" class="row">
 					<view class="col">不可提现金额:<text>0</text></view>
 					<!-- <view class="col"><button class="btn jiaona-btn">立即缴纳</button></view> -->
 				</view>
+				<view class="row statistics">
+					<view class="item">
+						<view class="num">{{total_settled_profit}}</view>
+						<view>累计收益(元)</view>
+					</view>
+					<view class="item">
+						<view class="num">0</view>
+						<view>本月到账</view>
+					</view>
+					<view class="item">
+						<view class="num">{{fans_num}}</view>
+						<view>我的粉丝</view>
+					</view>
+				</view>
+			</view>
+			<view class="menu agent-menu">
+				<view class="menu-item">
+					<navigator url="/pages/user/user-profit" open-type="navigate" hover-class="none">
+						<view class="icon">
+							<image class="image" src="../../static/images/user/icon25.png" mode=""></image>
+						</view>
+						<view class="name">收益</view>
+					</navigator>
+				</view>
+				<view class="menu-item">
+					<navigator url="/" open-type="navigate" hover-class="none">
+						<view class="icon">
+							<image class="image" src="../../static/images/user/icon26.png" mode=""></image>
+						</view>
+						<view class="name">订单</view>
+					</navigator>
+				</view>
+				<view class="menu-item">
+					<navigator url="/pages/user/invitation-list" open-type="navigate" hover-class="none">
+						<view class="icon">
+							<image class="image" src="../../static/images/user/icon27.png" mode=""></image>
+						</view>
+						<view class="name">粉丝</view>
+					</navigator>
+				</view>
+				<view class="menu-item">
+					<navigator url="/pages/user/invite" open-type="navigate" hover-class="none">
+
+						<view class="icon">
+							<image class="image" src="../../static/images/user/icon28.png" mode=""></image>
+						</view>
+						<view class="name">邀请</view>
+					</navigator>
+
+				</view>
 			</view>
-			
+
 			<navigator url="/pages/user/agent" open-type="navigate" hover-class="none">
 				<view class="vip-center">
 					<view class="text">代理会员中心<text class="sub">(特权独享)</text></view>
@@ -146,7 +196,11 @@
 			nickname: state => state.user.nickname,
 			user_type: state => state.user.group_id,
 			invite_code: state => state.user.invite_code,
+			invite_num: state => state.user.invite_num,
 			token: state => state.user.token,
+			vip_expire: state => state.user.vip_expire,
+			fans_num: state => state.user.fans_num,
+			total_settled_profit: state => state.user.total_settled_profit
 		}),
 		onTabItemTap(e) {
 			uni.$emit("refresh_userinfo");
@@ -174,7 +228,7 @@
 					url: "/pages/user/withdraw"
 				})
 			},
-			goToDeposit(){
+			goToDeposit() {
 				uni.navigateTo({
 					url: '/pages/order/deposit'
 				});
@@ -374,4 +428,30 @@
 			height: 60upx;
 		}
 	}
+
+	.statistics {
+		border-top: 2upx #EEEEEE solid;
+		padding-top: 20upx;
+		text-align: center;
+		font-size: 28upx;
+
+		.item {
+			flex: 1;
+		}
+
+		.num {
+			color: #ff5454;
+			font-weight: bold;
+		}
+	}
+	.agent-menu{
+		padding: 15upx 0;
+		.menu-item{
+			flex: 1;
+			text-align: center;
+			.name{
+				margin-top: 0;
+			}
+		}
+	}
 </style>

+ 257 - 0
pages/user/user-profit.vue

@@ -0,0 +1,257 @@
+<template>
+	<view class="user-profit">
+		<view class="header-bg"></view>
+
+		<view class="header">
+			<view class="title">
+				收益明细
+			</view>
+
+			<view class="content">
+				<view class="row">
+					<view class="col">
+						账户余额:<text class="money">¥{{profitInfo.money}}</text>
+					</view>
+					<view class="col">
+						累计结算收益:<text class="money">¥{{profitInfo.total_settled_profit}}</text>
+					</view>
+				</view>
+				<view>
+					<button class="btn tixian-btn">立即提现</button>
+				</view>
+			</view>
+		</view>
+		<view class="block shouru">
+			<view class="item">
+				<view class="r1">结算收入</view>
+				<view class="r2">¥{{profitInfo.last_month_settled_profit}}</view>
+				<view class="r3">上月佣金</view>
+			</view>
+			<view class="item">
+				<view class="r1">预估收入</view>
+				<view class="r2">¥{{profitInfo.this_month_estimate_profit}}</view>
+				<view class="r3">本月佣金</view>
+			</view>
+			<view class="item">
+				<view class="r1">预估收入</view>
+				<view class="r2">¥{{profitInfo.last_month_estimate_profit}}</view>
+				<view class="r3">上月佣金</view>
+			</view>
+		</view>
+		<view class="block jrsj">
+			<view class="title">
+				今日数据
+			</view>
+			<view class="content">
+				<view class="item">
+					<view class="r1">付款笔数</view>
+					<view class="r2">{{profitInfo.today_order_count}}</view>
+				</view>
+				<view class="item">
+					<view class="r1">赚</view>
+					<view class="r2">¥{{profitInfo.today_order_profit}}</view>
+				</view>
+				<view class="item">
+					<view class="r1">分享赚</view>
+					<view class="r2">¥{{profitInfo.today_invite_profit}}</view>
+				</view>
+			</view>
+		</view>
+		<view class="block zrsj">
+			<view class="title">
+				昨日数据
+			</view>
+			<view class="content">
+				<view class="item">
+					<view class="r1">付款笔数</view>
+					<view class="r2">{{profitInfo.yestoday_order_count}}</view>
+				</view>
+				<view class="item">
+					<view class="r1">赚</view>
+					<view class="r2">¥{{profitInfo.yestoday_order_profit}}</view>
+				</view>
+				<view class="item">
+					<view class="r1">分享赚</view>
+					<view class="r2">¥{{profitInfo.yestoday_invite_profit}}</view>
+				</view>
+			</view>
+		</view>
+	</view>
+</template>
+
+<script>
+	export default {
+		data() {
+			return {
+				profitInfo: {
+					money: '0.00',
+					total_settled_profit: '0.00',
+					this_month_estimate_profit: '0.00',
+					last_month_estimate_profit: '0.00',
+					last_month_settled_profit: '0.00',
+					today_order_count: 0,
+					today_order_profit: '0.00',
+					today_invite_profit: '0.00',
+					yestoday_order_count: 0,
+					yestoday_order_profit: '0.00',
+					yestoday_invite_profit: '0.00'
+				}
+			}
+		},
+		onShow() {
+			this.$http.get({
+				url: "/commission/statistics",
+				success: (res) => {
+					this.profitInfo = res.data.data
+				}
+			})
+		},
+		methods: {
+
+		}
+	}
+</script>
+
+<style lang="scss" scoped>
+	.user-profit {
+		position: relative;
+		overflow: hidden;
+	}
+
+	.header-bg {
+		background: $primary-color;
+		height: 100upx;
+		position: absolute;
+		top: 0;
+		width: 100%;
+		z-index: 1;
+	}
+
+	.header {
+		margin: 20upx;
+		background: white;
+		text-align: center;
+		border-radius: 20upx;
+		position: relative;
+		z-index: 2;
+
+		.title {
+			height: 100upx;
+			font-size: 32upx;
+			line-height: 100upx;
+			// font-weight: bold;
+		}
+
+		.content {
+			text-align: left;
+			font-size: 28upx;
+			padding: 20upx;
+			padding-top: 0;
+			color: #999999;
+		}
+	}
+
+	.row {
+		display: flex;
+
+		.col {
+			flex: 1;
+		}
+	}
+
+
+	.btn.tixian-btn {
+		background-color: $primary-color;
+		color: white;
+		font-size: 26upx;
+		padding: 5upx 20upx;
+		border-radius: 40upx;
+		line-height: normal;
+		display: inline-block;
+		margin-top: 20upx;
+	}
+
+	.block {
+		background: white;
+		padding: 20upx;
+		margin: 20upx;
+		border-radius: 10upx;
+		color: #999999;
+	}
+
+	.shouru {
+		display: flex;
+
+		.item {
+			flex: 1;
+			text-align: center;
+
+			.r1 {
+				font-size: 28upx;
+			}
+
+			.r2 {
+				line-height: 100upx;
+				color: #FF5D5B;
+			}
+
+			.r3 {
+				font-size: 24upx;
+			}
+		}
+	}
+
+	.jrsj {
+		.title {
+			font-size: 28upx;
+			border-bottom: 2upx solid #EEEEEE;
+			padding-bottom: 10upx;
+		}
+
+		.content {
+			display: flex;
+			margin-top: 20upx;
+		}
+
+		.item {
+			flex: 1;
+			text-align: center;
+
+			.r1 {
+				font-size: 28upx;
+			}
+
+			.r2 {
+				line-height: 100upx;
+				color: #FF5D5B;
+			}
+		}
+	}
+
+	.zrsj {
+		.title {
+			font-size: 28upx;
+			border-bottom: 2upx solid #EEEEEE;
+			padding-bottom: 10upx;
+		}
+
+		.content {
+			display: flex;
+			margin-top: 20upx;
+		}
+
+		.item {
+			flex: 1;
+			text-align: center;
+
+			.r1 {
+				font-size: 28upx;
+			}
+
+			.r2 {
+				line-height: 100upx;
+				color: #FF5D5B;
+			}
+		}
+	}
+</style>

BIN
static/add-bold.png


BIN
static/add.png


BIN
static/images/user/icon25.png


BIN
static/images/user/icon26.png


BIN
static/images/user/icon27.png


BIN
static/images/user/icon28.png


BIN
static/minus-bold.png


BIN
static/minus.png


BIN
static/splash/sp.9.png


+ 3 - 0
store/modules/user.js

@@ -8,6 +8,9 @@ const defaults = {
 	mobile: "",
 	alipay: "",
 	alipay_name: "",
+	invite_num: 0,
+	fans_num: 0,
+	total_settled_profit: 0,
 }
 const state = JSON.parse(JSON.stringify(defaults));