lhl 4 éve
szülő
commit
dc49076d5f

+ 15 - 62
pages.json

@@ -36,8 +36,6 @@
 			"path": "pages/product/product",
 			"style": {
 				"navigationBarTitleText": "详情展示",
-				"navigationBarBackgroundColor": "#FFFFFF",
-				"navigationBarTextStyle": "black",
 				"app-plus": {
 					"titleNView": {
 						"type": "transparent"
@@ -45,39 +43,6 @@
 				}
 			}
 		},
-		{
-			"path": "pages/product/search",
-			"style": {
-				"enablePullDownRefresh": true,
-				// #ifdef APP-PLUS
-				"navigationStyle": "custom",
-				// #endif
-				// #ifndef MP || APP-PLUS
-				"app-plus": {
-					"titleNView": {
-						"searchInput": {
-							"backgroundColor": "rgba(231, 231, 231,.7)",
-							"borderRadius": "16px",
-							"placeholder": "请输入关键字",
-							"disabled": false,
-							"placeholderColor": "#606266",
-							"align": "left"
-						},
-						"buttons": [{
-							"text": "搜索",
-							"fontSize": "14",
-							"color": "#303133",
-							"background": "rgba(0,0,0,0)",
-							"width": "40px"
-						}]
-					}
-				},
-				// #endif
-				"navigationBarTitleText": "搜索",
-				"navigationBarBackgroundColor": "#FFFFFF",
-				"navigationBarTextStyle": "black"
-			}
-		},
 		{
 			"path": "pages/cart/cart",
 			"style": {
@@ -107,19 +72,6 @@
 				}
 			}
 		},
-		{
-			"path": "pages/user/balance",
-			"style": {
-				"navigationBarTextStyle": "black",
-				"navigationBarBackgroundColor": "transparent",
-				"app-plus": {
-					"titleNView": {
-						"type": "float",
-						"titleText": "我的钱包"
-					}
-				}
-			}
-		},
 		{
 			"path": "pages/user/integral",
 			"style": {
@@ -167,7 +119,14 @@
 		{
 			"path": "pages/user/jiedian",
 			"style": {
-				"navigationBarTitleText": "我的接点"
+				"navigationBarTextStyle": "black",
+				"navigationBarBackgroundColor": "transparent",
+				"app-plus": {
+					"titleNView": {
+						"type": "float",
+						"titleText": "我的接点"
+					}
+				}
 			}
 		},
 		{
@@ -234,8 +193,6 @@
 			"path": "pages/order/orderDetail",
 			"style": {
 				"navigationBarTitleText": "订单详情",
-				"navigationBarBackgroundColor": "#FFFFFF",
-				"navigationBarTextStyle": "black",
 				"app-plus": {
 					"bounce": "none"
 				}
@@ -256,25 +213,19 @@
 		{
 			"path": "pages/order/createOrder",
 			"style": {
-				"navigationBarTitleText": "创建订单",
-				"navigationBarBackgroundColor": "#FFFFFF",
-				"navigationBarTextStyle": "black"
+				"navigationBarTitleText": "创建订单"
 			}
 		},
 		{
 			"path": "pages/set/address",
 			"style": {
-				"navigationBarTitleText": "收货地址",
-				"navigationBarBackgroundColor": "#FFFFFF",
-				"navigationBarTextStyle": "black"
+				"navigationBarTitleText": "收货地址"
 			}
 		},
 		{
 			"path": "pages/set/addressManage",
 			"style": {
-				"navigationBarTitleText": "",
-				"navigationBarBackgroundColor": "#FFFFFF",
-				"navigationBarTextStyle": "black"
+				"navigationBarTitleText": ""
 			}
 		},
 		{
@@ -310,10 +261,12 @@
 		{
 			"path": "pages/money/wallet",
 			"style": {
-				"navigationBarTitleText": "我的钱包",
+				"navigationBarTextStyle": "black",
+				"navigationBarBackgroundColor": "transparent",
 				"app-plus": {
 					"titleNView": {
-						"type": "transparent"
+						"type": "float",
+						"titleText": "我的钱包"
 					}
 				}
 			}

+ 3 - 3
pages/money/wallet.vue

@@ -2,7 +2,7 @@
 	<view class="content">
 		<view class="content-money">
 			<view class="money-box">
-				<image src="../../static/img/qbbg.png" mode=""></image>
+				<image src="../../static/img/img33.png" mode=""></image>
 				<view class="money"><text class="money-icon">¥</text>{{ userInfo.now_money | getMoneyStyle }}</view>
 			</view>
 		</view>
@@ -258,12 +258,12 @@ page {
 		// margin: auto 0;
 		font-size: 56rpx;
 		font-weight: bold;
-		color: #FF4C4C;
+		color: #3F7C1F;
 		position: relative;
 		.money-icon {
 			font-size: 38rpx;
 			font-weight: bold;
-			color: #FF4C4C;
+			color: #3F7C1F;
 		}
 	}
 }

+ 0 - 261
pages/user/balance.vue

@@ -1,261 +0,0 @@
-<template>
-	<view class="container">
-		<!-- 头部 -->
-		<view class="header">
-			<image src="../../static/img/img33.png" mode="scaleToFill"></image>
-			<!-- 钱 -->
-			<view class="money">
-				<view class="fuhao">¥</view>
-				<view class="counts">3852</view>
-			</view>
-		</view>
-		<!-- 收入和支出 -->
-		<view class="navbar">
-			<view class="nav-item" v-for="(item, index) in navList" :key="index"
-				:class="{ current: tabCurrentIndex === index }" @click="tabClick(index)">{{ item.text }}</view>
-
-		</view>
-		<swiper class="swiper-box" :current="tabCurrentIndex" duration="300" @change="changeTab"
-			>
-			<swiper-item class="tab-content" v-for="(tabItem, tabIndex) in navList" :key="tabIndex">
-				<!-- 空白页 -->
-				<!-- <empty v-if="tabItem.loaded === true && tabItem.orderList.length === 0"></empty> -->
-				<!-- 推广奖励 -->
-				<scroll-view class="scorll" scroll-y="true" >
-					<view class="cost">
-						<view class="award" v-for="item in 10">
-							<view class="award-left">
-								<view class="text">充值到账</view>
-								<view class="time">2021-8-26 09:30</view>
-							</view>
-							<view class="award-right">+200</view>
-						</view>
-					</view>
-				</scroll-view>
-
-			</swiper-item>
-		</swiper>
-		<view class="btm">
-			<view class="btn" @click="nav('/pages/user/withdraw')">立即提现</view>
-		</view>
-	</view>
-</template>
-
-<script>
-	export default {
-		data() {
-			return {
-				height: '',
-				tabCurrentIndex: 0,
-				navList: [{
-						state: 1,
-						text: '收入',
-						loadingType: 'more',
-						orderList: [],
-						page: 1, //当前页数
-						limit: 10 //每次信息条数
-					},
-					{
-						state: 2,
-						text: '支出',
-						loadingType: 'more',
-						orderList: [],
-						page: 1, //当前页数
-						limit: 10 //每次信息条数
-					}
-				],
-				list: [],
-				money: ''
-			}
-		},
-		methods: {
-			nav (url) {
-				uni.navigateTo({
-					url
-				})
-			},
-			// back(){
-			// 	uni.navigateBack({
-			// 		delta:1
-			// 	})
-			// },
-			// handclick () {
-			// 	console.log(123)
-			// },
-			//swiper 切换
-			changeTab(e) {
-				this.tabCurrentIndex = e.target.current;
-				this.loadData('tabChange')
-			},
-			//顶部tab点击
-			tabClick(index) {
-				this.tabCurrentIndex = index;
-			}
-		}
-	}
-</script>
-
-<style lang="scss">
-	.container {
-		width: 750rpx;
-		height: 1334rpx;
-		background-color: #f1f1f1;
-
-		.header {
-			position: relative;
-			image {
-				width: 750rpx;
-				height: 400rpx;
-			}
-		}
-		
-			.text {
-				width: 112rpx;
-				height: 27rpx;
-				font-size: 28rpx;
-				font-family: PingFang SC;
-				font-weight: bold;
-				color: #FF0000;
-				padding-top: 8rpx;
-				margin-left: 18rpx;
-			}
-
-		.money {
-			top: 0;
-			display: flex;
-			justify-content: center;
-			align-items: center;
-			position: absolute;
-			padding-left: 246rpx;
-			padding-top: 200rpx;
-
-			.fuhao {
-				font-size: 45rpx;
-				font-family: PingFang SC;
-				font-weight: bold;
-				color: #3F7C1F;
-				padding-top: 25rpx;
-			}
-
-			.counts {
-				font-size: 70rpx;
-				font-family: PingFang SC;
-				font-weight: bold;
-				color: #3F7C1F;
-			}
-		}
-
-		.swiper-box {
-			height: calc(100% - 700rpx);
-			background-color: #FFFFFF;
-		}
-		.scorll {
-			height: 100%;
-		}
-		.navbar {
-			display: flex;
-			height: 100rpx;
-			padding: 0 5rpx;
-			background: #fff;
-			box-shadow: 0 1rpx 5rpx rgba(0, 0, 0, 0.06);
-			position: relative;
-			z-index: 10;
-			margin-top: 25rpx;
-
-			.nav-item {
-				flex: 1;
-				display: flex;
-				justify-content: center;
-				align-items: center;
-				height: 100%;
-				font-size: 15px;
-				color: #999999;
-				position: relative;
-
-				&.current {
-					color: #333333;
-
-					&:after {
-						content: '';
-						position: absolute;
-						left: 50%;
-						bottom: 0;
-						transform: translateX(-50%);
-						width: 44px;
-						height: 0;
-						border-bottom: 2px solid #3F7C1F;
-					}
-				}
-			}
-		}
-
-		.cost {
-			width: 750rpx;
-			height: auto;
-			background-color: #fff;
-
-			.award {
-				width: 701rpx;
-				height: 132rpx;
-				border-bottom: 1px solid #F0F4F8;
-				margin-left: 25rpx;
-				display: flex;
-				justify-content: space-between;
-				align-items: center;
-
-				.award-left {
-					width: 221rpx;
-					height: 40rpx;
-					margin-left: 30rpx;
-					margin-bottom: 35rpx;
-
-					.text {
-						width: 182rpx;
-						height: 30rpx;
-						font-size: 30rpx;
-						font-family: PingFang SC;
-						font-weight: bold;
-						color: #666666;
-						margin-bottom: 16rpx;
-					}
-
-					.time {
-						width: 221rpx;
-						height: 20rpx;
-						font-size: 26rpx;
-						font-family: PingFang SC;
-						font-weight: 500;
-						color: #AEAEAE;
-					}
-				}
-
-				.award-right {
-					width: 82rpx;
-					height: 27rpx;
-					font-size: 36rpx;
-					font-family: PingFang SC;
-					font-weight: bold;
-					color: #FF0000;
-					margin-right: 30rpx;
-				}
-			}
-		}
-		.btm {
-			background-color: #fff;
-			height: 190rpx;
-			padding-top: 40rpx;
-			display: flex;
-			justify-content: center;
-			.btn {
-				display: flex;
-				justify-content: center;
-				align-items: center;
-				width: 674rpx;
-				height: 88rpx;
-				background: linear-gradient(-35deg, #F8DD4F, #FBEB77);
-				border-radius: 44rpx;
-			}
-		}
-	}
-</style>
-	

+ 3 - 1
pages/user/jiedian.vue

@@ -1,5 +1,7 @@
 <template>
 	<view class="content">
+		<!-- 头部 -->
+		
 		<view class="container">
 			<view class="jiedianbackground">
 				<image src="../../static/image/jiedian.png" mode=""></image>
@@ -106,7 +108,7 @@
 				b: 2,
 				c: 3,
 				people: 255,
-				//'12345678901'.replace(/(\d{3})\d{4}(\d{4})/, '$1****$2');
+				manList:''
 			}
 		},
 		methods: {}

+ 200 - 13
pages/user/user.vue

@@ -8,10 +8,10 @@
 			<view class="infor">
 				<!-- 用户信息 -->
 				<view class="infor-left">
-					<image src="../../static/error/missing-face.png" mode=""></image>
+					<image :src=" userInfo.avatar || '../../static/error/missing-face.png' "></image>
 					<view class="info-box">
-						<view class="username">李丹丹</view>
-						<view class="phone">13911111111</view>
+						<view class="username">{{ userInfo.nickname || '游客' }}</view>
+						<view class="phone">{{userInfo.phone}}</view>
 					</view>
 				</view>
 				<!-- 设置 -->
@@ -28,19 +28,19 @@
 				</view>
 				<!-- 订单栏 -->
 				<view class="order-section">
-					<view class="order-item" @click="nav('/pages/order/')">
+					<view class="order-item" @click="nav('/pages/order/order?state=1')">
 						<image src="../../static/img/img19.png" mode="scaleToFill"></image>
 						<view class="text">待付款</view>
 					</view>
-					<view class="order-item" @click="nav('/pages/order/')">
+					<view class="order-item" @click="nav('/pages/order/order?state=2')">
 						<image src="../../static/img/img20.png" mode="scaleToFill"></image>
 						<view class="text">待发货</view>
 					</view>
-					<view class="order-item" @click="nav('/pages/order/')">
+					<view class="order-item" @click="nav('/pages/order/order?state=3')">
 						<image src="../../static/img/img21.png" mode="scaleToFill"></image>
 						<view class="text">待收货</view>
 					</view>
-					<view class="order-item" @click="nav('/pages/order/')">
+					<view class="order-item" @click="nav('/pages/order/order?state=4')">
 						<image src="../../static/img/img22.png" mode="scaleToFill"></image>
 						<view class="text">已完成</view>
 					</view>
@@ -51,7 +51,7 @@
 		<view class="item-box">
 			<!-- 我的余额 -->
 			<view class="order-section">
-				<view class="order-item" @click="nav('/pages/user/balance')">
+				<view class="order-item" @click="nav('/pages/money/wallet')">
 					<image src="../../static/img/img26.png" mode="scaleToFill"></image>
 					<view class="text">我的余额</view>
 				</view>
@@ -70,7 +70,7 @@
 			</view>
 			<!-- 底部列表 -->
 			<view class="btm">
-				<view class="ul-btm">
+				<view class="ul-btm" @click="nav('/pages/user/jiedian')">
 					<image src="../../static/img/img27.png" mode="scaleToFill"></image>
 					<view class="text">我的接点</view>
 					<image class="jiantou" src="../../static/img/img32.png" mode="scaleToFill"></image>
@@ -80,36 +80,136 @@
 					<view class="text">邀请海报</view>
 					<image class="jiantou" src="../../static/img/img32.png" mode="scaleToFill"></image>
 				</view>
-				<view class="ul-btm">
+				<view class="ul-btm" >
 					<image src="../../static/img/img29.png" mode="scaleToFill"></image>
 					<view class="text">会员注册</view>
 					<image class="jiantou" src="../../static/img/img32.png" mode="scaleToFill"></image>
 				</view>
-				<view class="ul-btm">
+				<view class="ul-btm" @click="nav('/pages/set/address')">
 					<image src="../../static/img/img30.png" mode="scaleToFill"></image>
 					<view class="text">收货地址</view>
 					<image class="jiantou" src="../../static/img/img32.png" mode="scaleToFill"></image>
 				</view>
-				<view class="ul-btm">
+				<view class="ul-btm" @click="open()">
 					<image src="../../static/img/img31.png" mode="scaleToFill"></image>
 					<view class="text">联系客服</view>
 					<image class="jiantou" src="../../static/img/img32.png" mode="scaleToFill"></image>
 				</view>
 			</view>
 		</view>
+		<uni-popup ref="popup" type="center">
+			<view class="popup-box">
+				<view class="img"><image src="../../static/img/img009.png" mode=""></image></view>
+				<view class="mian">
+					<view class="delivery">
+						<view class="title">已经为您定制专属客服</view>
+						<image src="../../static/img/img010.png" mode=""></image>
+					</view>
+					<view class="nocancel">客服VX:{{ text }}</view>
+					<view class="comfirm-box">
+						<view class="cancel" @click="cancel">取消</view>
+						<view class="comfirm" @click="comfirm(text)">复制微信</view>
+					</view>
+				</view>
+			</view>
+		</uni-popup>
 	</view>
 </template>
 
 <script>
+	import { orderData, getUserInfo,service } from '@/api/user.js';
+	import uniPopup from '@/components/uni-popup/uni-popup.vue';
+	import uniCopy from '@/utils/uni-copy.js';
+	import { mapState, mapMutations } from 'vuex';
 	export default {
+		components: {
+			uniPopup
+		},
 		data() {
-			return {}
+			return {
+				text:'123465'
+			}
+		},
+		onShow() {
+			//判断是否已经登录
+			if (this.hasLogin) {
+				this.loadBaseData();
+			} else {
+				uni.showModal({
+					title: '登录',
+					content: '您未登录,是否马上登陆?',
+					success: e => {
+						if (e.confirm) {
+							interceptor();
+						}
+					},
+					fail: e => {
+						console.log(e);
+					}
+				});
+			}
+		},
+		computed: {
+			...mapState('user', ['userInfo', 'orderInfo', 'hasLogin'])
 		},
 		methods: {
+			...mapMutations('user', ['setUserInfo', 'setOrderInfo']),
+			loadBaseData() {
+				getUserInfo({})
+					.then(({ data }) => {
+						console.log(data)
+						this.setUserInfo(data);
+						// 获取用户数据完毕后在获取订单数据防止多次跳转到登录页
+						orderData({})
+							.then(({ data }) => {
+								this.setOrderInfo(data);
+							})
+							.catch(e => {
+								this.setOrderInfo({
+									complete_count: 0, //完成
+									received_count: 0, //待收货
+									unshipped_count: 0, //待发货
+									order_count: 0, //订单总数
+									unpaid_count: 0 //待付款
+								});
+							});
+					})
+					.catch(e => {
+						console.log(e);
+					});
+			},
 			nav(url) {
+				console.log(url)
 				uni.navigateTo({
 					url
 				})
+			},
+			open(){
+				console.log('点击出现弹窗');
+				this.$refs.popup.open();
+			},
+			// 客服弹窗 - 复制微信
+			comfirm(value) {
+				
+				let content = value; //需要复制的内容
+				console.log('复制的内容:', content);
+				// content = typeof content === 'string' ? content : content.toString(); // 复制内容,必须字符串,数字需要转换为字符串
+				const result = uniCopy({content,success});
+				if (result === false) {
+					uni.showToast({
+						title: '不支持'
+					});
+				} else {
+					uni.showToast({
+						title: '复制成功',
+						icon: 'none'
+					});
+				}
+				this.$refs.popup.close();
+			},
+			// 客服弹窗 - 取消
+			cancel() {
+				this.$refs.popup.close();
 			}
 		}
 	}
@@ -320,4 +420,91 @@
 			}
 		}
 	}
+	.popup-box {
+		width: 522rpx;
+		height: 605rpx;
+		background-color: #ffffff;
+		border-radius: 20rpx;
+		position: relative;
+		.img {
+			position: relative;
+			top: -56rpx;
+			left: 0;
+			width: 522rpx;
+			height: 132rpx;
+			display: flex;
+			justify-content: center;
+			image {
+				border-radius: 20rpx 20rpx 0 0;
+				width: 450rpx;
+				height: 132rpx;
+			}
+		}
+	
+		.mian {
+			margin-top: -44rpx;
+			display: flex;
+			flex-direction: column;
+			align-items: center;
+			// padding: 32rpx 32rpx;
+			background-color: #ffffff;
+			border-radius: 0 0 20rpx 20rpx;
+			text-align: center;
+	
+			.delivery {
+				font-size: 40rpx;
+				color: #333333;
+				display: flex;
+				align-items: center;
+				flex-direction: column;
+				.title {
+				}
+				image {
+					margin-top: 48rpx;
+					width: 172rpx;
+					height: 160rpx;
+				}
+			}
+	
+			.nocancel {
+				font-size: 32rpx;
+				color: #333333;
+				margin-top: 14rpx;
+			}
+	
+			.comfirm-box {
+				margin-top: 52rpx;
+				display: flex;
+				// margin-bottom: 32rpx;
+	
+				// justify-content: space-around;
+				.cancel {
+					display: flex;
+					align-items: center;
+					justify-content: center;
+					width: 197rpx;
+					height: 74rpx;
+					border: 1px solid #dcc786;
+					border-radius: 38rpx;
+	
+					font-size: 32rpx;
+					color: #605128;
+				}
+	
+				.comfirm {
+					margin-left: 32rpx;
+					display: flex;
+					align-items: center;
+					justify-content: center;
+					width: 197rpx;
+					height: 74rpx;
+					background: linear-gradient(-90deg, #d1ba77 0%, #f7e8ad 100%);
+					border-radius: 38px;
+					font-size: 32rpx;
+					color: #605128;
+				}
+			}
+		}
+	}
+	
 </style>

BIN
static/image/sanchaji.png


BIN
static/img/img009.png


BIN
static/img/img010.png


BIN
static/img/jiedian.png


BIN
static/img/qbbg.png


+ 35 - 36
store/index.js

@@ -1,36 +1,35 @@
-import Vue from 'vue'
-import Vuex from 'vuex'
-import user from './model/user'
-Vue.use(Vuex)
-
-const store = new Vuex.Store({
-	namespaced: true,
-	state: {
-		// baseURL:"http://yrh.liuniu946.com",//'http://eb.shuibo.net',//请求地址配置 
-		baseURL:'http://po.frp.liuniu946.com',//请求地址配置 
-		urlFile:'/index',//项目部署所在文件夹
-		userInfo: {}, //登录信息
-		loginInterceptor:false,//是否打开强制登录
-		// #ifdef H5 || MP-WEIXIN
-		weichatInfo:{},//保存微信注册信息
-		weichatObj:'',//微信对象
-		// #endif
-	},
-	mutations: {
-		//保存微信信息
-		setWeiChatInfo(state, provider) {
-			state.weichatInfo = provider;
-			
-		},
-		//保存微信对象
-		setWeiChatObj(state, provider) {
-			state.weichatObj = provider;
-		}
-	},
-	modules:{
-		user
-	},
-	actions: {}
-})
-
-export default store
+import Vue from 'vue'
+import Vuex from 'vuex'
+import user from './model/user'
+Vue.use(Vuex)
+
+const store = new Vuex.Store({
+	namespaced: true,
+	state: {
+		// baseURL:"http://yrh.liuniu946.com",//'http://eb.shuibo.net',//请求地址配置 
+		baseURL:'http://po.frp.liuniu946.com',//请求地址配置 
+		urlFile:'/index',//项目部署所在文件夹
+		userInfo: {}, //登录信息
+		loginInterceptor:false,//是否打开强制登录
+		// #ifdef H5 || MP-WEIXIN
+		weichatInfo:{},//保存微信注册信息
+		weichatObj:'',//微信对象
+		// #endif
+	},
+	mutations: {
+		//保存微信信息
+		setWeiChatInfo(state, provider) {
+			state.weichatInfo = provider;
+		},
+		//保存微信对象
+		setWeiChatObj(state, provider) {
+			state.weichatObj = provider;
+		}
+	},
+	modules:{
+		user
+	},
+	actions: {}
+})
+
+export default store

+ 1 - 0
utils/uni-copy.js

@@ -1,4 +1,5 @@
 export default function uniCopy({content,success,error}) {
+	console.log(content,"123456")
 	if(!content) return error('复制的内容不能为空 !')
 	content = typeof content === 'string' ? content : content.toString() // 复制内容,必须字符串,数字需要转换为字符串
 	/**