瀏覽代碼

完成搜索 账单明细等

sslyg 3 年之前
父節點
當前提交
ade4ff1bd3

+ 10 - 2
App.vue

@@ -18,7 +18,7 @@
 					url: '/pages/index/index'
 				});
 			}
-			uni.$on("login_succeeded", () => {
+			uni.$on(["login_succeeded","logout"], () => {
 				if (this.$store.state.user.group_id === 2) {
 					let iconIndex = 2
 					// #ifdef H5
@@ -49,7 +49,7 @@
 					})
 					uni.setTabBarItem({
 						index: 1,
-						text: '待付款'
+						text: '待收货'
 					})
 				}
 			});
@@ -180,6 +180,14 @@
 	uni-button:after {
 		border: none;
 	}
+	@font-face {
+		font-family:"Roboto";
+		src: url(static/Roboto-Regular.ttf);		
+	}
+	@font-face {
+		font-family:"Roboto-Bold";
+		src: url(static/Roboto-Bold.ttf);		
+	}
 
 	/*每个页面公共css */
 	::-webkit-scrollbar {

+ 2 - 2
components/sanshui-modal/index.vue

@@ -94,8 +94,8 @@
 		box-sizing: border-box;
 		opacity: 0;
 		position: fixed;
-		top: 44px;
-		bottom: 50px;
+		top: 0;
+		bottom: 0;
 		left: 0;
 		width: 100%;
 		pointer-events: none;

+ 42 - 39
components/sanshui-payment-password/index.vue

@@ -13,7 +13,7 @@
 							<view class="pwd-text" v-for="(item,index) in _digits" :key="index" :data-index="index" :class="{active:(activeInput == index)}">{{payPassWord[index]}}</view>
 						</view>
 					</swiper-item>
-					<!-- 设置新安全密码 -->
+					<!-- 设置新支付密码 -->
 					<block v-if="_mode === 2 || _mode === 5">
 						<swiper-item @touchmove.prevent.stop>
 							<view class="dk-title">{{_titleObj.title}}</view>
@@ -23,7 +23,7 @@
 							</view>
 						</swiper-item>
 					</block>
-					<!-- 修改安全密码 -->
+					<!-- 修改支付密码 -->
 					<block v-else-if="_mode === 3">
 						<swiper-item @touchmove.prevent.stop>
 							<view class="dk-title">{{_titleObj.twoTitle}}</view>
@@ -42,11 +42,11 @@
 					</block>
 				</swiper>
 				<block v-if="_mode !== 1 && _mode !== 4">
-					<view class="pwd-tips">安全密码为6位数字,用于提现、设置密保、添加银行卡等操作,可保障资金安全</view>
+					<view class="pwd-tips">支付密码为6位数字,用于提现、设置密保、添加银行卡等操作,可保障资金安全</view>
 					<view class="pwd-tips pwd-tips-errot">{{msgText}}</view>
 				</block>
 				<view class="pwd-forget">
-					<text v-if="_forget && _mode === 1" @click="forgetPwd">忘记安全密码</text>
+					<text v-if="_forget && _mode === 1" @click="forgetPwd">忘记支付密码</text>
 				</view>
 				<view class="digital-keyboard" :class="{'digital-keyboard-show' : dkFlag || _mode === 1 || _mode === 4}">
 					<view class="dk-down" v-if="_mode !== 1 && _mode !== 4">
@@ -79,10 +79,10 @@
 			return {
 				activeInput: 0,//当前输入的下标
 				digitalList: ['1', '2', '3', '4', '5', '6', '7', '8', '9', '', '0', '-1'],//键盘
-				paymentPwd: '',//安全密码内容
-				dkFlag: true,//安全密码键盘的显示与隐藏
+				paymentPwd: '',//支付密码内容
+				dkFlag: true,//支付密码键盘的显示与隐藏
 				current: 0,
-				paymentPwds: [],//上一次安全密码内容,历史安全密码,
+				paymentPwds: [],//上一次支付密码内容,历史支付密码,
 				msgText: '',
 				u50: uni.upx2px(50)
 			};
@@ -102,11 +102,11 @@
 			},
 			/*
 			*	可选值说明(这一个顺序最好不要改,跟当前步骤步进行有关系,自动提交要用到mode跟current的判断  是否要自动提交)
-			*	1 安全密码校验(用于校验安全)
-			*	2 设置安全密码(2步  输入=》确认输入)
-			*	3 修改安全密码(3步 原安全密码=》输入=》确认输入)
+			*	1 支付密码校验(用于校验安全)
+			*	2 设置支付密码(2步  输入=》确认输入)
+			*	3 修改支付密码(3步 原支付密码=》输入=》确认输入)
 			*	4 找回登录密码(同mode = 1一样,就怕后端校验接口不一样而额外添加的一个mode)
-			*	5 重置安全密码
+			*	5 重置支付密码
 			*/
 			mode: {
 				type: [Number, String],
@@ -147,30 +147,30 @@
 			_titleObj () {
 				let arr = [
 					{
-						title: '输入安全密码',
-						subTitle: '请输入安全密码'
+						title: '输入支付密码',
+						subTitle: '请输入支付密码'
 					},
 					{
-						title: '设置安全密码',
-						subTitle: '请设置安全密码',
-						twoSubTitle: '请再次输入安全密码以确认'
+						title: '设置支付密码',
+						subTitle: '请设置支付密码',
+						twoSubTitle: '请再次输入支付密码以确认'
 					},
 					{
-						title: '修改安全密码',
-						twoTitle: '设置安全密码',
-						threeTitle: '设置安全密码',
-						subTitle: '请输入安全密码 以验证身份',
-						twoSubTitle: '请设置新的安全密码',
-						threeSubTitle: '请再次输入安全密码以确认',
+						title: '修改支付密码',
+						twoTitle: '设置支付密码',
+						threeTitle: '设置支付密码',
+						subTitle: '请输入支付密码 以验证身份',
+						twoSubTitle: '请设置新的支付密码',
+						threeSubTitle: '请再次输入支付密码以确认',
 					},
 					{
-						title: '输入安全密码',
-						subTitle: '请输入安全密码'
+						title: '输入支付密码',
+						subTitle: '请输入支付密码'
 					},
 					{
-						title: '重置安全密码',
-						subTitle: '请输入安全密码',
-						twoSubTitle: '请再次输入安全密码以确认'
+						title: '重置支付密码',
+						subTitle: '请输入支付密码',
+						twoSubTitle: '请再次输入支付密码以确认'
 					}
 				]
 				return arr[this._mode-1];
@@ -233,6 +233,9 @@
 			},
 			forgetPwd () {
 				console.log('这里是忘记密码跳转逻辑');
+				uni.navigateTo({
+					url:"/pages/user/safe-pass"
+				})
 			},
 			cancel () {
 				this.$emit('cancel');
@@ -240,11 +243,11 @@
 			close () {
 				let tips = '';
 				if(this._mode === 2){
-					tips = '您是否要放弃设置安全密码';
+					tips = '您是否要放弃设置支付密码';
 				}else if(this._mode === 5){
-					tips = '您是否要放弃重置安全密码';
+					tips = '您是否要放弃重置支付密码';
 				}else{
-					tips = '您是否要放弃修改安全密码';
+					tips = '您是否要放弃修改支付密码';
 				}
 				uni.showModal({
 					title: '关闭提示',
@@ -261,16 +264,16 @@
 			submit (clickFlag){//clickFlag主动点击
 				if(this.trigger !== 'auto' && !clickFlag) return;
 				if(this.paymentPwd.length !== this._digits){
-					this.showError('请输入' + this._digits + '位安全密码');
+					this.showError('请输入' + this._digits + '位支付密码');
 				}else{
 					this.showError('');
 					if(this._mode === 5 || this._mode === 4 || this.current >= (this._mode - 1)){
 						if(this._mode === 5 && this.current === 0){//下一步,再次输入
 							return this.changeSwiper(1);
 						}
-						if(this.current > 0){//需要校验2次安全密码的是否相等
+						if(this.current > 0){//需要校验2次支付密码的是否相等
 							if(this.paymentPwd !== this.paymentPwds[this.current - 1]){
-								this.showError('两次安全密码输入不一致');
+								this.showError('两次支付密码输入不一致');
 								setTimeout(() => {
 									this.paymentPwd = '';
 									this.paymentPwds[this.current] = '';
@@ -279,7 +282,7 @@
 								return ;
 							}
 							this.showError('');
-							if(this._mode === 2){//设置安全密码
+							if(this._mode === 2){//设置支付密码
 								uni.showLoading({
 									title: '正在设置密码'
 								});
@@ -298,7 +301,7 @@
 										this.modalFun('hide');
 									}
 								}, 1000)
-							}else{//修改安全密码
+							}else{//修改支付密码
 								uni.showLoading({
 									title: '正在重置密码'
 								});
@@ -307,7 +310,7 @@
 									uni.hideLoading();
 									let response = {//模拟返回
 										code: 1,
-										msg: '重置新安全密码成功'
+										msg: '重置新支付密码成功'
 									}
 									if(response.code === 1){
 										this.$emit('submit', {
@@ -322,7 +325,7 @@
 						}
 						this.checkSafePwd('check');
 					}else{
-						if(this._mode === 3 && this.current === 0){//校验安全密码正确性
+						if(this._mode === 3 && this.current === 0){//校验支付密码正确性
 							this.checkSafePwd('verify');
 							return ;
 						}
@@ -332,7 +335,7 @@
 			},
 			checkSafePwd(type) {
 				uni.showLoading({
-					title: '校验安全密码中'
+					title: '校验支付密码中'
 				});
 				setTimeout(() => {//模拟请求,把这个换成ajax请求哈,或者emit出去 外面去请求,但是建议都集成在这边 省的写一堆重置代码
 					uni.hideLoading();
@@ -342,7 +345,7 @@
 					}
 					if(response.code === 1){
 						if(type === 'check'){
-							this.$emit('submit', {//设置或者重置新安全密码
+							this.$emit('submit', {//设置或者重置新支付密码
 								type: 'check',
 								value: this.paymentPwd
 							});

+ 1 - 1
http.js

@@ -1,6 +1,6 @@
 import store from './store'
 
-const baseUrl =  process.env.NODE_ENV === 'development' ? "http://sxzg.ngrok.ssly.site":"http://sxzg.ngrok.ssly.site";
+const baseUrl =  process.env.NODE_ENV === 'development' ? "http://192.168.1.200:8000":"http://sxzg.dev.ssly.live:8000";
 const baseApiUrl = baseUrl + "/api";
 
 function initPramas() {

+ 85 - 51
pages.json

@@ -11,7 +11,7 @@
 					"titleNView": {
 						// "backgroundImage": "./static/images/search.png",
 						"searchInput": {
-							"backgroundColor": "rgba(255,255,255,1)",							
+							"backgroundColor": "rgba(255,255,255,1)",
 							"borderRadius": "16px", //输入框圆角
 							"placeholder": "粘贴宝贝标题",
 							"disabled": true //disable时点击输入框不置焦,可以跳到新页面搜索
@@ -43,7 +43,7 @@
 			"path": "pages/order/back-order",
 			"style": {
 				"navigationBarTitleText": "待发货",
-				"enablePullDownRefresh": false
+				"enablePullDownRefresh": true
 			}
 
 		}, {
@@ -226,57 +226,91 @@
 				"enablePullDownRefresh": false
 			}
 
+		}, {
+			"path": "pages/order/cashier",
+			"style": {
+				"navigationBarTitleText": "收银台",
+				"enablePullDownRefresh": false
+			}
+
+		}, {
+			"path": "pages/user/withdraw",
+			"style": {
+				"navigationBarTitleText": "提现",
+				"enablePullDownRefresh": false
+			}
+
+		}, {
+			"path": "pages/user/bind-alipay",
+			"style": {
+				"navigationBarTitleText": "绑定支付宝",
+				"enablePullDownRefresh": false
+			}
+
+		}, {
+			"path": "pages/user/nickname",
+			"style": {
+				"navigationBarTitleText": "修改昵称",
+				"enablePullDownRefresh": false
+			}
+
+		}, {
+			"path": "pages/user/collection",
+			"style": {
+				"navigationBarTitleText": "我的收藏",
+				"enablePullDownRefresh": true
+			}
+
+		}, {
+			"path": "pages/user/safe-pass",
+			"style": {
+				"navigationBarTitleText": "设置",
+				"enablePullDownRefresh": false
+			}
+
+		}, {
+			"path": "pages/user/reset-pass",
+			"style": {
+				"navigationBarTitleText": "设置",
+				"enablePullDownRefresh": false
+			}
+
+		}, {
+			"path": "pages/user/money-log",
+			"style": {
+				"navigationBarTitleText": "账单明细",
+				"enablePullDownRefresh": false
+			}
+
+		}, {
+			"path": "pages/home/search",
+			"style": {
+				"navigationBarTitleText": "",
+				"enablePullDownRefresh": false,
+				"app-plus": {
+					"titleNView": {
+						// "backgroundImage": "./static/images/search.png",
+						"searchInput": {
+							"backgroundColor": "rgba(255,255,255,1)",
+							"borderRadius": "16px", //输入框圆角
+							"placeholder": "粘贴宝贝标题",
+							"disabled": false //disable时点击输入框不置焦,可以跳到新页面搜索
+						},
+						"buttons": [{
+							"text": "搜索",							
+							"width": "auto",
+							"fontSize": "14px"
+						}]
+					}
+				}
+			}
+
 		}
 	    ,{
-            "path" : "pages/order/cashier",
-            "style" :                                                                                    
-            {
-                "navigationBarTitleText": "收银台",
-                "enablePullDownRefresh": false
-            }
-            
-        }
-        ,{
-            "path" : "pages/user/withdraw",
-            "style" :                                                                                    
-            {
-                "navigationBarTitleText": "提现",
-                "enablePullDownRefresh": false
-            }
-            
-        }
-        ,{
-            "path" : "pages/user/bind-alipay",
-            "style" :                                                                                    
-            {
-                "navigationBarTitleText": "绑定支付宝",
-                "enablePullDownRefresh": false
-            }
-            
-        }
-        ,{
-            "path" : "pages/user/nickname",
-            "style" :                                                                                    
-            {
-                "navigationBarTitleText": "修改昵称",
-                "enablePullDownRefresh": false
-            }
-            
-        }
-        ,{
-            "path" : "pages/user/collection",
-            "style" :                                                                                    
-            {
-                "navigationBarTitleText": "我的收藏",
-                "enablePullDownRefresh": false
-            }
-            
-        }
-        ,{
-            "path" : "pages/user/safe-pass",
+            "path" : "pages/user/agent",
             "style" :                                                                                    
             {
-                "navigationBarTitleText": "设置安全密码",
+                "navigationBarTitleText": "代理会员中心",
                 "enablePullDownRefresh": false
             }
             
@@ -294,8 +328,8 @@
 		"selectedColor": "#ff5d5b",
 		"borderStyle": "black",
 		"backgroundColor": "#ffffff",
-		"height":"44px",
-		"iconWidth":"20px",
+		"height": "44px",
+		"iconWidth": "20px",
 		"midButton": {
 			"iconPath": "static/images/camera.png",
 			"iconWidth": "36px",

+ 5 - 0
pages/home/home.vue

@@ -100,6 +100,11 @@
 		// 	});
 
 		},
+		onNavigationBarSearchInputClicked() {
+			uni.navigateTo({
+				url:"/pages/home/search"
+			})
+		},
 		onShow() {},
 		onPageScroll(e) {
 			const query = uni.createSelectorQuery();

+ 154 - 0
pages/home/search.vue

@@ -0,0 +1,154 @@
+<template>
+	<view id="body">
+		<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>
+				<text style="margin-left: 10upx;">历史搜索</text>
+				<uni-icons type="trash" style="margin-left: auto;margin-right: 10upx;" @tap="removeHistory"></uni-icons>
+			</view>
+			<view class="content">
+				<view class="item" v-for="vlaue in history" @tap="fastSearch(vlaue)">
+					{{vlaue}}
+				</view>
+			</view>
+		</view>
+		<view class="list">
+			<template v-for="product in products">
+				<product-item type="list" :id="product.id" :image="product.images|imagesFilter" :title="product.name"
+					:org-price="product.org_price" :price="product.price"></product-item>
+			</template>
+		</view>
+	</view>
+</template>
+
+<script>
+	export default {
+		data() {
+			return {
+				products: [],
+				page: 1,
+				pageLoading: false,
+				search: "",
+				history: []
+			}
+		},
+		onPageScroll(e) {
+			const query = uni.createSelectorQuery();
+			query.select("#body").boundingClientRect(data => {
+				if (e.scrollTop > data.height - uni.getSystemInfoSync().windowHeight * 2) {
+					this.getProductList();
+				}
+			}).exec();
+
+		},
+		onLoad() {
+			this.history = uni.getStorageSync("history") || []
+		},
+		onNavigationBarSearchInputChanged(e) {
+			this.search = e.text;
+		},
+		onNavigationBarSearchInputConfirmed(e) {
+			this.page = 1
+			this.products = []
+			this.getProductList()
+		},
+		onNavigationBarButtonTap(e) {
+			if (e.index === 0) {
+				this.page = 1
+				this.products = []
+				this.getProductList()
+			}
+		},
+		methods: {
+			getProductList() {
+				if (!this.pageLoading) {
+					console.log("加载下一页");
+					this.pageLoading = true;
+					this.$http.get({
+						url: "/product/lists",
+						data: {
+							limit: 10,
+							page: this.page,
+							search: this.search
+						},
+						success: (res) => {
+							this.products = [...this.products, ...res.data.data.rows]
+							this.page++;
+							this.pageLoading = false;
+						}
+					})
+
+					if (!this.history.includes(this.search) && this.search !== '') {
+						console.log(this.history)
+						this.history.push(this.search)
+						uni.setStorageSync("history", this.history)
+					}
+				}
+			},
+			fastSearch(vlaue) {
+				this.search = vlaue
+				this.page = 1
+				this.products = []
+				this.getProductList()
+				
+				// #ifdef APP-PLUS			
+				const currentWebview = this.$scope.$getAppWebview();
+				currentWebview.setTitleNViewSearchInputText(this.search);
+				// #endif
+
+			},
+			removeHistory() {
+				uni.removeStorageSync("history")
+				this.history = []
+			}
+		}
+	}
+</script>
+
+<style lang="scss" scoped>
+	.list {
+		display: flex;
+		justify-content: space-between;
+		flex-wrap: wrap;
+		padding: 18upx;
+	}
+
+	.list .product-item {
+		margin-bottom: 18upx;
+	}
+
+	.history {
+		margin: 20upx;
+		padding: 10upx;
+		background: white;
+		border-radius: 10upx;
+
+		.header {
+			display: flex;
+			font-size: 28upx;
+			align-items: center;
+			padding-bottom: 10upx;
+			border-bottom: 2upx solid #EEEEEE;
+		}
+
+		.content {
+			min-height: 160upx;
+			display: flex;
+			justify-content: start;
+			flex-wrap: wrap;
+
+			.item {
+
+				font-size: 28upx;
+				margin: 10upx;
+				padding: 0upx 20upx;
+				color: #999999;
+				border: 2upx solid #999999;
+				height: 40upx;
+				border-radius: 40upx;
+
+			}
+		}
+	}
+</style>

+ 35 - 20
pages/order/back-order.vue

@@ -57,18 +57,21 @@
 			if (this.$store.state.user.group_id === 2) {
 				this.orderStatus = 'wait_deliver'
 				uni.setNavigationBarTitle({
-					title: "我的待发货"
+					title: "待发货"
 				})
 			}
 			if (this.$store.state.user.group_id === 3) {
-				this.orderStatus = 'wait_pay'
+				this.orderStatus = 'wait_sign'
 				uni.setNavigationBarTitle({
-					title: "我的待付款"
+					title: "待收货"
 				})
 
 			}
 
-			this.getOrdersData();
+			this.refresh();
+		},
+		onTabItemTap(e) {
+			uni.$emit("refresh_userinfo");
 		},
 		onPageScroll(e) {
 			const query = uni.createSelectorQuery();
@@ -77,7 +80,9 @@
 					this.getOrdersData();
 				}
 			}).exec();
-
+		},
+		onPullDownRefresh() {
+			this.refresh();
 		},
 		methods: {
 			openDetails(id) {
@@ -91,22 +96,32 @@
 				})
 			},
 			getOrdersData() {
-				this.$http.get({
-					url: "/order/lists",
-					data: {
-						status: this.orderStatus,
-						limit: 10,
-						page: this.page
-					},
-					success: (res) => {
-						this.orders = [...this.orders, ...res.data.data.rows.map((item) => {
-							item.products_json = JSON.parse(item.products_snapshot)
-							return item;
-						})]
-						this.page++;
-						this.pageLoading = false;
-					}
+				return new Promise((resolve, reject) => {
+					this.$http.get({
+						url: "/order/lists",
+						data: {
+							status: this.orderStatus,
+							limit: 10,
+							page: this.page
+						},
+						success: (res) => {
+							this.orders = [...this.orders, ...res.data.data.rows.map((item) => {
+								item.products_json = JSON.parse(item.products_snapshot)
+								return item;
+							})]
+							this.page++;
+							this.pageLoading = false;
+						}
+					})
 				})
+			},
+			refresh() {
+				this.page = 1;
+				this.products = [];
+				this.getOrdersData()
+					.then(uni.stopPullDownRefresh())
+					.catch(uni.stopPullDownRefresh());
+
 			}
 		}
 	}

+ 5 - 5
pages/order/cashier.vue

@@ -1,9 +1,9 @@
 <template>
 	<view style="overflow: hidden;">
 		<payment-pasword ref="paymentPassword" mode="1" @submit="balancePay"></payment-pasword>
-		<timer-tips :createtime="orders[0].createtime"></timer-tips>
+		<timer-tips v-if="orders.length" :createtime="orders[0].createtime"></timer-tips>
 		<view class="order-list">
-			<view class="order-item" v-for="order in orders">
+			<view v-for="(order,index) in orders" :key="index" class="order-item">
 				<view class="order-head">
 					<view class="factory-name">{{order.seller.nickname?order.seller.nickname:'省心直供(该厂家暂未设置昵称)'}}</view>
 				</view>
@@ -46,7 +46,7 @@
 				</view>
 				<view class="item" :class="{'active':pay_method==='balance'}" @tap="pay_method='balance'">
 					<image class="image" src="../../static/logo.png" mode="scaleToFill"
-						style="width: 50upx;height: 50upx;"></image>使用余额
+						style="width: 50upx;height: 50upx;"></image>使用余额({{$store.state.user.money}})
 				</view>
 			</view>
 			<view class="" style="margin-top: 40upx;">
@@ -63,7 +63,7 @@
 			return {
 				pay_method: "alipay",
 				pay_provider: "alipay",
-				orders: [{}],
+				orders: [],
 				order_no: ""
 			}
 		},
@@ -99,7 +99,7 @@
 			},
 			balancePay(e) {
 				console.log(e)
-				this.$http.get({
+				this.$http.post({
 					url: '/order/balancePay',
 					data: {
 						'order_no': this.order_no,

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

@@ -66,9 +66,6 @@
 		onPullDownRefresh() {
 			this.refresh();
 		},
-		onShow() {
-			this.refresh();
-		},
 		methods: {
 			getProductData() {
 				return new Promise((resolve, reject) => {

+ 62 - 0
pages/user/agent.vue

@@ -0,0 +1,62 @@
+<template>
+	<view>
+		<view class="card">
+			<view style="font-size: 28upx;font-weight: 600;">
+				亲爱的,您目前还不是代理会员哦
+			</view>
+			<view style="font-size:90upx;text-align: center;border-bottom: 4upx solid #502109;font-weight: 500;height: 130upx;">
+				代理会员
+			</view>
+			<view class="" style="font-size: 20upx;margin: 10upx 0;">
+				<view>获得代理会员的方式如下:</view>
+				<view>
+					使用账号的邀请码邀请5位新用户注册即可获得代理会员资格。
+				</view>
+			</view>
+		</view>
+		<view class="" style="font-size: 20upx;margin: 20upx;">
+			提示:邀请5位新用户升级为代理会员的时间为1个月,完成5位新用户后开始算时间满一个月后恢复到普通会员按照5个新用户一个节点满5个新用户就增加一个月的代理会员的资格上不封顶
+		</view>
+
+		<view style="background: white;padding: 20upx;font-weight: 600;font-size: 28upx;">
+			<view class="" style="font-size: 30upx;">
+				代理会员独享特权
+			</view>
+			<view class="" style="margin-top: 40upx;">
+				1.邀请网店店主注册成交一笔返佣0.5元,上不封顶
+			</view>
+			<view class="" style="margin-top: 40upx;">
+				2.邀请直供厂家注册成交一笔返佣0.2元,上不封顶 </view>
+			<view class="" style="margin-top: 40upx;">
+				3.邀请任意一个新用户注册奖励佣金50元一人(必须是注册后有正常使用的新用户才会奖励) </view>
+			<view class="" style="margin-top: 40upx;margin-bottom: 20upx;">
+				4.佣金次月25号结算到账户内 </view>
+		</view>
+		<view class="" style="text-align: center;font-size: 24upx;margin-top: 20upx;color: #999999;">
+			本服务解释权在法律范围内归省心直供APP所有
+		</view>
+	</view>
+</template>
+
+<script>
+	export default {
+		data() {
+			return {
+
+			}
+		},
+		methods: {
+
+		}
+	}
+</script>
+
+<style lang="scss" scoped>
+.card{
+	background: linear-gradient(-45deg,#d2b887,#eedab7,#d2b887);
+	margin: 20upx;
+	border-radius: 130upx 0 130upx 0;
+	padding: 20upx 80upx;
+	color: #502109;
+}
+</style>

+ 3 - 0
pages/user/bind-alipay.vue

@@ -84,6 +84,9 @@
 						}
 					})
 				}
+			},
+			submit(){
+				
 			}
 		}
 	}

+ 131 - 11
pages/user/collection.vue

@@ -6,39 +6,50 @@
 			</view>
 			<view style="position: relative;">
 				<view class="sub-title">全部宝贝</view>
-				<view class="release">
-					管理
+				<view class="release" @tap="edit=!edit">
+					{{edit?'取消':'管理'}}
 				</view>
 			</view>
 		</view>
-		<view v-if="products.length===0"
+		<view v-if="collections.length===0"
 			style="margin: 20upx auto;text-align: center; font-size: 28upx;color: #999999;">
 			暂未收藏任何商品
 		</view>
 		<view class="product-list">
-			<view class="product-item" v-for="product in products" @tap="goToEdit(product.id)">
+			<view class="product-item" v-for="collection in collections" @tap="openDetails(collection.product.id)">
+				<view v-if="edit" class="select">
+					<checkbox class="checkbox" :checked="collection.checked"
+						@tap="collection.checked=!collection.checked" />
+				</view>
+
 				<view class="product-image">
-					<image class="image" :src="product.images|imagesFilter" mode="scaleToFill"></image>
+					<image class="image" :src="collection.product.images|imagesFilter" mode="scaleToFill"></image>
 				</view>
 				<view>
 					<view class="row row-1">
-						<text class="title"><text class="sxzg-icon">省心直供</text>{{product.name}}</text>
+						<text class="title"><text class="sxzg-icon">省心直供</text>{{collection.product.name}}</text>
 					</view>
 					<view class="row row-2">
-						<text class="org-price">¥{{product.org_price}}</text>
+						<text class="org-price">¥{{collection.product.org_price}}</text>
 					</view>
 					<view class="row row-3">
 						<text class="sxj-icon">省心价</text>
-						<text class="price">¥{{product.price}}</text>
+						<text class="price">¥{{collection.product.price}}</text>
 					</view>
 					<view class="row row-4">
-						<text>发布日期:</text>
-						<text class="time">{{product.createtime|datetimeFilter}}</text>
+						<text>日期:</text>
+						<text class="time">{{collection.createtime|datetimeFilter}}</text>
 					</view>
 				</view>
 
 			</view>
 		</view>
+
+		<view v-if="edit" class="footer">
+			<view class="btn-wrapper">
+				<button class="btn del-btn" type="default" @tap="del">删除已勾选的商品</button>
+			</view>
+		</view>
 	</view>
 </template>
 
@@ -48,7 +59,8 @@
 			return {
 				page: 1,
 				pageLoading: false,
-				products: []
+				collections: [],
+				edit: false
 			}
 		},
 		onLoad() {
@@ -70,7 +82,66 @@
 			this.refresh();
 		},
 		methods: {
+			refresh() {
+				this.page = 1;
+				this.collections = [];
+				this.getCollectionsData()
+					.then(uni.stopPullDownRefresh())
+					.catch(uni.stopPullDownRefresh());
+				
+			},
+			getCollectionsData() {
+				return new Promise((resolve, reject) => {
 
+					this.$http.get({
+						url: "/collection/lists",
+						data: {
+							limit: 10,
+							page: this.page
+						},
+						success: (res) => {
+							this.collections = [
+								...this.collections,
+								...res.data.data.rows
+							]
+						}
+					})
+				})
+			},
+			openDetails(id) {
+				if (this.edit) {
+					return;
+				}
+				uni.navigateTo({
+					url: "/pages/product/product-details?id=" + id
+				})
+			},
+			del() {
+				let checked = this.collections.filter((cur) => {
+					console.log(cur)
+					return cur.checked
+				}).map((cur) => {
+					return cur.product_id
+				})
+				this.$http.post({
+					url: "/collection/del",
+					data: {
+						product_id: checked.join(",")
+					},
+					success: (res) => {
+						uni.showToast({
+							icon: "none",
+							title: "删除成功",
+							success: () => {
+								this.collections = this.collections.filter((cur) => {
+									return !checked.includes(cur.product_id)
+								})
+								this.edit = false;
+							}
+						})
+					}
+				})
+			}
 		}
 	}
 </script>
@@ -115,6 +186,29 @@
 			margin: 20upx;
 			padding: 20upx;
 
+			.select {
+				align-self: center;
+				position: relative;
+				margin-top: -4upx;
+				margin-right: 14upx;
+
+				.checkbox {
+					transform: scale(0.7);
+
+					/deep/ .uni-checkbox-input {
+						border: 2upx solid #CCCCCC;
+
+						&.uni-checkbox-input-checked {
+							color: $primary-color !important;
+						}
+					}
+
+					/deep/ .uni-checkbox-input:hover {
+						border: 2upx solid #CCCCCC;
+					}
+				}
+			}
+
 			.product-image {
 				width: 180upx;
 				height: 180upx;
@@ -192,4 +286,30 @@
 			color: #999999;
 		}
 	}
+
+	.footer {
+		display: flex;
+		position: fixed;
+		height: 100upx;
+		background: $primary-color;
+		bottom: 0;
+		width: 100%;
+		box-shadow: 0 0 10upx #999999;
+		align-items: center;
+
+		.btn-wrapper {
+			flex: 1;
+			margin: 0 20upx;
+		}
+
+		.del-btn {
+			background: $primary-color;
+			padding: 15upx 60upx;
+			color: white;
+			line-height: normal;
+			font-size: 32upx;
+			border-radius: 50upx;
+
+		}
+	}
 </style>

+ 201 - 0
pages/user/money-log.vue

@@ -0,0 +1,201 @@
+<template>
+	<view>
+		<view class="nav">
+			<view class="nav-item" :class="{'active':activeIndex===0}" @tap="activeIndex=0">今天</view>
+			<view class="nav-item" :class="{'active':activeIndex===1}" @tap="activeIndex=1">本周</view>
+			<view class="nav-item" :class="{'active':activeIndex===2}" @tap="activeIndex=2">本月</view>
+			<view class="nav-item" :class="{'active':activeIndex===3}" @tap="popupVisible=true">更早</view>
+		</view>
+
+		<view class="list">
+			<view class="list-item">
+				<view class="l">
+					<image class="image" src="" mode=""></image>
+				</view>
+				<view class="c">
+					<view class="title">
+						购买商品
+					</view>
+					<view class="time">2021-02-20 20:10:11</view>
+				</view>
+				<view class="r">
+					498.00
+				</view>
+			</view>
+		</view>
+
+		<view class="popup" v-if="popupVisible" @touchmove.stop.prevent>
+			<view class="popup-wrapper">
+				<view class="close" @tap="popupVisible=false">
+					<uni-icons type="closeempty" size="30"></uni-icons>
+				</view>
+				<view class="row row-label">
+					<label class="label" for="">时间范围</label>
+				</view>
+				<view class="row">
+					<picker mode="date">
+						<input class="input" type="text" value="" placeholder="开始时间" />
+					</picker>
+					<view>至</view>
+					<picker mode="date">
+						<input class="input" type="text" value="" placeholder="结束时间" />
+					</picker>
+				</view>
+				<view class="row row-label">
+					<label class="label" for="">金额范围</label>
+				</view>
+				<view class="row">
+					<view>
+						<input class="input" type="digit" value="" placeholder="最小金额" />
+					</view>
+					<view>至</view>
+					<view>
+						<input class="input" type="digit" value="" placeholder="最大金额" />
+					</view>
+				</view>
+
+				<view class="row row-btn">
+					<button class="btn filter-btn" type="default" @tap="filter">立即筛选</button>
+				</view>
+			</view>
+		</view>
+	</view>
+</template>
+
+<script>
+	export default {
+		data() {
+			return {
+				popupVisible: false,
+				activeIndex: 0
+			}
+		},
+		methods: {
+			filter() {
+				this.activeIndex = 3
+			}
+		}
+	}
+</script>
+
+<style lang="scss" scoped>
+	.nav {
+		display: flex;
+		justify-content: space-around;
+
+		align-items: center;
+		background: white;
+		font-size: 30upx;
+
+		.nav-item {
+			line-height: 60upx;
+			border-top: 4upx solid white;
+			border-bottom: 4upx solid white;
+
+			&.active {
+				border-bottom: 4upx solid $primary-color;
+			}
+		}
+	}
+
+	.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;
+				}
+			}
+
+			.c {
+				margin-left: 20upx;
+
+				.title {
+					font-size: 32upx;
+					font-weight: bold;
+					color: #333333;
+				}
+
+				.time {
+					font-size: 28upx;
+					margin-top: 24upx;
+					color: #999999;
+				}
+			}
+
+			.r {
+				margin-left: auto;
+				font-size: 36upx;
+			}
+		}
+	}
+
+	.popup {
+		position: fixed;
+		top: 0;
+		left: 0;
+		bottom: 0;
+		width: 750upx;
+		background: rgba(0, 0, 0, 0.6);
+		overflow: hidden;
+
+		.popup-wrapper {
+			.close {
+				position: absolute;
+				right: 5upx;
+				top: 0;
+				transform: scale(0.6);
+			}
+
+			background: white;
+			position: absolute;
+			bottom: 0;
+			width: 750upx;
+			min-height: 300upx;
+			border-radius: 20upx 20upx 0 0;
+			padding-top: 20upx;
+		}
+
+		.row {
+			display: flex;
+			justify-content: space-around;
+
+			.input {
+				text-align: center;
+				border-bottom: 2upx solid #EEEEEE;
+				padding: 10upx;
+				font-size: 28upx;
+			}
+		}
+
+		.row-label {
+			justify-content: start;
+			margin: 20upx;
+			font-size: 30upx;
+		}
+
+		.row-btn {
+			margin: 40upx 20upx;
+
+			.btn {
+				line-height: 80upx;
+				background: $primary-color;
+				border-radius: 40upx;
+				color: white;
+				font-size: 32upx;
+				font-weight: bold;
+				width: 80%;
+			}
+		}
+	}
+</style>

+ 200 - 0
pages/user/reset-pass.vue

@@ -0,0 +1,200 @@
+<template>
+	<view class="body">
+		<view class="header-bg">
+
+		</view>
+		<view class="header">
+			<view class="title">
+				修改密码
+			</view>
+		</view>
+
+		<view class="main">
+			<view class="input-item inline-form">
+				<label class="label" for="">手机号码</label>
+				<input class="input" type="text" placeholder="" v-model="form.mobile" disabled="true">
+
+			</view>
+			<view class="input-item inline-form">
+				<label class="label" for="">验证码</label>
+				<input class="input" type="text" placeholder="请输入验证码" v-model="form.captcha">
+				<button class="send-vcode" @tap="sendSms()"
+					:disabled="!sendable">{{sendable?'获取验证码':countdown+'秒'}}</button>
+			</view>
+			<view class="input-item inline-form">
+				<label class="label" for="">新密码</label>
+				<input class="input" type="password" placeholder="请输入新密码" maxlength="32" v-model="form.newpassword">
+			</view>
+			<view class="input-item inline-form">
+				<label class="label" for="">确认密码</label>
+				<input class="input" type="password" placeholder="请输入新密码" maxlength="32" v-model="form.comfirmpass">
+			</view>
+		</view>
+		<view style="margin: 10upx 40upx;font-size: 26upx;color: red;">*新密码的长度为6-32位</view>
+		<view class="submit-btn-wrapper">
+			<button class="btn submit-btn" type="default" @tap="submit">确认修改</button>
+		</view>
+	</view>
+</template>
+
+<script>
+	let timeInterval = null;
+	const time = 120;
+
+	export default {
+		data() {
+			return {
+				sendable: true,
+				countdown: time,
+				form: {
+					type: "mobile",
+					mobile: "",
+					captcha: "",
+					newpassword: "",
+					comfirmpass: ""
+				}
+			}
+		},
+		onLoad() {
+			this.form.mobile = this.$store.state.user.mobile
+		},
+		methods: {
+			sendSms() {
+				if (this.sendable && this.$verified.mobile(this.form.mobile)) {
+					this.sendable = false;
+
+					this.$http.get({
+						url: '/sms/send',
+						data: {
+							mobile: this.form.mobile,
+							event: "resetpwd"
+						},
+						success: (res) => {
+							uni.showToast({
+								title: res.data.msg,
+								icon: "none"
+							})
+							timeInterval = setInterval(() => {
+								if (this.countdown-- === 0) {
+									clearInterval(timeInterval)
+									this.countdown = time;
+									this.sendable = true;
+								}
+							}, 1000)
+						},
+						fail: () => {
+							this.sendable = true;
+						}
+					})
+				}
+			},
+			submit() {
+				if (this.form.newsafepass !== this.form.comfirmpass) {
+					uni.showToast({
+						icon: "none",
+						title: "两次输入的密码不一致"
+					})
+					return
+				}
+				if (this.$verified.safepass(this.form.newsafepass) && this.$verified.required(this.form.captcha,
+					"请输入验证码")) {
+					this.$http.post({
+						url: "/user/resetpwd",
+						data: this.form,
+						success: (res) => {
+							uni.showToast({
+								title: "密码修改成功",
+								icon: "none",
+								success() {
+									setTimeout(uni.navigateBack(), 1000)
+								}
+							})
+						}
+					})
+				}
+			}
+		}
+	}
+</script>
+
+<style lang="scss" scoped>
+	.body {
+		position: relative;
+		overflow: hidden;
+	}
+
+	.header-bg {
+		background: $primary-color;
+		height: 100upx;
+		position: absolute;
+		top: 0;
+		width: 100%;
+	}
+
+	.header {
+		margin: 20upx;
+		background: white;
+		text-align: center;
+		border-radius: 20upx;
+		position: relative;
+		z-index: 1;
+
+		.title {
+			height: 100upx;
+			font-size: 32upx;
+			line-height: 100upx;
+			// font-weight: bold;
+		}
+	}
+
+	.main {
+		margin: 20upx;
+		background: white;
+		border-radius: 10upx;
+	}
+
+	.input-item.inline-form {
+		display: flex;
+		align-items: center;
+		height: 80upx;
+		font-size: 28upx;
+		padding: 0 20upx;
+		position: relative;
+		color: #999999;
+
+		.label {
+			width: 160upx;
+			// flex: 1 1 160upx;
+
+		}
+
+		.input {
+			flex-grow: 1;
+			font-size: 28upx;
+		}
+	}
+
+	.send-vcode {
+		background: $primary-color;
+		color: white;
+		font-size: 24upx;
+		position: absolute;
+		padding: 5upx 0;
+		width: 160upx;
+		line-height: normal;
+		right: 0upx;
+		top: 20upx;
+	}
+
+	.submit-btn-wrapper {
+		margin-top: 80upx;
+
+		.submit-btn {
+			font-size: 30upx;
+			line-height: 60upx;
+			width: 250upx;
+			background: $primary-color;
+			color: white;
+		}
+	}
+</style>

+ 37 - 8
pages/user/safe-pass.vue

@@ -5,7 +5,7 @@
 		</view>
 		<view class="header">
 			<view class="title">
-				设置安全密码
+				设置支付密码
 			</view>
 		</view>
 
@@ -17,22 +17,22 @@
 			</view>
 			<view class="input-item inline-form">
 				<label class="label" for="">验证码</label>
-				<input class="input" type="text" placeholder="请输入验证码">
+				<input class="input" type="text" placeholder="请输入验证码" v-model="form.captcha">
 				<button class="send-vcode" @tap="sendSms()"
 					:disabled="!sendable">{{sendable?'获取验证码':countdown+'秒'}}</button>
 			</view>
 			<view class="input-item inline-form">
 				<label class="label" for="">新密码</label>
-				<input class="input" type="password" placeholder="请输入新密码" maxlength="6">
+				<input class="input" type="password" placeholder="请输入新密码" maxlength="6" v-model="form.newsafepass">
 			</view>
 			<view class="input-item inline-form">
 				<label class="label" for="">确认密码</label>
-				<input class="input" type="password" placeholder="请输入新密码" maxlength="6">
+				<input class="input" type="password" placeholder="请输入新密码" maxlength="6" v-model="form.comfirmpass">
 			</view>
 		</view>
-		<view style="margin: 10upx 40upx;font-size: 26upx;color: red;">*安全密码必须为6位数字</view>
+		<view style="margin: 10upx 40upx;font-size: 26upx;color: red;">*支付密码必须为6位数字</view>
 		<view class="submit-btn-wrapper">
-			<button class="btn submit-btn" type="default">确认修改</button>
+			<button class="btn submit-btn" type="default" @tap="submit">确认修改</button>
 		</view>
 	</view>
 </template>
@@ -47,7 +47,11 @@
 				sendable: true,
 				countdown: time,
 				form: {
-					mobile: ""
+					type: "mobile",
+					mobile: "",
+					captcha: "",
+					newsafepass: "",
+					comfirmpass: ""
 				}
 			}
 		},
@@ -63,7 +67,7 @@
 						url: '/sms/send',
 						data: {
 							mobile: this.form.mobile,
-							event: "bind-alipay"
+							event: "resetsafepwd"
 						},
 						success: (res) => {
 							uni.showToast({
@@ -83,6 +87,31 @@
 						}
 					})
 				}
+			},
+			submit() {
+				if (this.form.newsafepass !== this.form.comfirmpass) {
+					uni.showToast({
+						icon: "none",
+						title: "两次输入的密码不一致"
+					})
+					return
+				}
+				if (this.$verified.safepass(this.form.newsafepass) && this.$verified.required(this.form.captcha,
+					"请输入验证码")) {
+					this.$http.post({
+						url: "/user/resetsafepwd",
+						data: this.form,
+						success: (res) => {
+							uni.showToast({
+								title: "支付密码修改成功",
+								icon: "none",
+								success() {
+									setTimeout(uni.navigateBack(), 1000)
+								}
+							})
+						}
+					})
+				}
 			}
 		}
 	}

+ 16 - 8
pages/user/setting.vue

@@ -38,16 +38,18 @@
 			</view>
 			<view class="line"></view>
 			<view class="row">
-				<view class="label">修改密码</view>
-				<view class="option"></view>
+				<navigator url="/pages/user/reset-pass" hover-class="none">
+					<view class="label">修改密码</view>
+					<view class="option"></view>
+				</navigator>
 			</view>
 		</view>
 		<view class="block b4">
 			<view class="row">
-				<view class="label">安全密码</view>
+				<view class="label">支付密码</view>
 				<view class="option">
 					<navigator url="/pages/user/safe-pass" hover-class="none">
-						未设置
+						{{$store.state.user.is_set_safe_pass?'已设置':'未设置'}}
 					</navigator>
 				</view>
 			</view>
@@ -89,14 +91,20 @@
 		},
 		methods: {
 			logout() {
+				this.$store.dispatch("user/logout")
+				uni.$emit("logout")
 				uni.navigateBack({
 					delta: 999,
-					animationType: 'none'
+					animationType: 'none',
 				})
-				uni.navigateTo({
-					url: '/pages/user/login'
+				uni.switchTab({
+					url: "/pages/home/home",
+					success() {
+						uni.navigateTo({
+							url: '/pages/user/login'
+						})
+					}
 				})
-				this.$store.dispatch("user/logout")
 			},
 			formatSize() {
 				let that = this;

+ 24 - 14
pages/user/user-center.vue

@@ -5,7 +5,8 @@
 				<image class="image" src="../../static/images/login/logo.png" mode="scaleToFill"></image>
 			</view>
 			<view>
-				<view class="nickname">{{nickname}}</view>
+				<view v-if="token" class="nickname">{{nickname}}</view>
+				<view v-else class="nickname">您还未登录</view>
 				<view>
 					<text v-show="user_type===3" class="wddz">网店店主</text>
 					<text v-show="user_type===2" class="zgcj">直供厂家</text>
@@ -38,16 +39,23 @@
 					<!-- <view class="col"><button class="btn jiaona-btn">立即缴纳</button></view> -->
 				</view>
 			</view>
-			<view class="vip-center">
-				<view class="text">代理会员中心<text class="sub">(特权独享)</text></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>
+				</view>
+			</navigator>
 
 			<view class="menu">
 				<view class="menu-item">
-					<view class="icon">
-						<image class="image" src="../../static/images/menu/b8.png" mode="scaleToFill"></image>
-					</view>
-					<view class="name">账单明细</view>
+					<navigator url="/pages/user/money-log" open-type="navigate" hover-class="none">
+
+						<view class="icon">
+							<image class="image" src="../../static/images/menu/b8.png" mode="scaleToFill"></image>
+						</view>
+						<view class="name">账单明细</view>
+					</navigator>
+
 				</view>
 				<view class="menu-item">
 					<navigator url="/pages/order/order" open-type="navigate" hover-class="none">
@@ -137,12 +145,11 @@
 		computed: mapState({
 			nickname: state => state.user.nickname,
 			user_type: state => state.user.group_id,
-			invite_code: (state) => {
-				return 'H' + ('00000000' + state.user.id).slice(-6);
-			}
+			invite_code: state => state.user.invite_code,
+			token: state => state.user.token,
 		}),
-		onShow() {
-			uni.$emit("refresh_userinfo")
+		onTabItemTap(e) {
+			uni.$emit("refresh_userinfo");
 		},
 		onNavigationBarButtonTap(e) {
 			// console.log(e)
@@ -272,7 +279,9 @@
 			background: white;
 			border-radius: 20upx;
 			padding: 20upx;
-			font-family: sans-serif;
+
+			font-family: "Roboto", sans-serif;
+
 			.row {
 				color: #333;
 				display: flex;
@@ -282,6 +291,7 @@
 				.warning {
 					color: $primary-color;
 					font-weight: bold;
+					font-family: "Roboto-Bold", sans-serif;
 				}
 
 				.tips {

二進制
static/Roboto-Bold.ttf


二進制
static/Roboto-Regular.ttf


二進制
static/images/clock.png


+ 4 - 2
store/modules/user.js

@@ -1,9 +1,11 @@
 const defaults = {
-	id:0,
+	id: 0,
 	nickname: "未设置昵称",
 	group_id: 3,
 	token: "",
-	money: "0.00"
+	money: "0.00",
+	invite_code: "-----",
+	mobile: ""
 }
 const state = JSON.parse(JSON.stringify(defaults));
 

+ 1 - 1
uni_modules/robin-editor/components/robin-editor/robin-editor.vue

@@ -105,7 +105,7 @@
 		        v-show="!showPreview"
 		        id="editor"
 		        class="ql-container"
-		        placeholder="开始输入..."
+		        placeholder=""
 		        showImgSize
 		        showImgToolbar
 		        showImgResize

+ 1 - 1
verified.js

@@ -11,7 +11,7 @@ export default {
 	password(str) {
 		return /^[0-9a-z<>?:"|{},./;'/[]]{6,20}$/i.test(str) || tips("密码必须为6至20位数字与字母的组合")
 	},
-	password(str) {
+	safepass(str) {
 		return /^\d{6}$/i.test(str) || tips("安全密码必须由6位数字组成")
 	}
 }