zs 2 lat temu
rodzic
commit
8aa6242187

+ 3 - 8
common/api.js

@@ -1,7 +1,8 @@
 import config from '../config.js';
 import config from '../config.js';
 const getDomain = (uri, method, type) => {
 const getDomain = (uri, method, type) => {
 	if (type && type == 'file') return config.serverUrl + '/files' + uri;
 	if (type && type == 'file') return config.serverUrl + '/files' + uri;
-	else return config.serverUrl + '/api/live/v1' + uri;
+	if (uri.startsWith('/wechat/api')) return config.serverUrl + uri;
+	else return config.serverUrl + '/point/v1/api' + uri;
 }
 }
 export const requestBase = (uri, method, data, type) => {
 export const requestBase = (uri, method, data, type) => {
 	let baseUrl = getDomain(uri, method, type);
 	let baseUrl = getDomain(uri, method, type);
@@ -11,12 +12,6 @@ export const requestBase = (uri, method, data, type) => {
 			method: method || 'GET',
 			method: method || 'GET',
 			data: data || {},
 			data: data || {},
 			success: (res) => {
 			success: (res) => {
-				if (res.data.errcode != 0) {
-					return uni.showToast({
-						title: res.data.errmsg,
-						icon: 'error'
-					});
-				}
 				resolve(res.data);
 				resolve(res.data);
 			},
 			},
 			fail: (err) => {
 			fail: (err) => {
@@ -24,7 +19,7 @@ export const requestBase = (uri, method, data, type) => {
 					title: '请求接口失败',
 					title: '请求接口失败',
 					icon: 'fail'
 					icon: 'fail'
 				})
 				})
-				reject(err)
+				reject(err.data)
 			}
 			}
 		})
 		})
 	})
 	})

+ 120 - 0
components/upload/index.vue

@@ -0,0 +1,120 @@
+<template>
+	<view class="main">
+		<view class="one">
+			<view class="list" v-for="(item,index) in list" :key="index">
+				<image class="image" :src="item.url" @click="toView(index,item)"></image>
+				<uni-icons class="del" type="close" size="30" color="#ff0000" @click="uplDel(index,item)"></uni-icons>
+			</view>
+			<view class="list" v-if="list&&list.length<count" @tap="uplSuc()">
+				<uni-icons class="add" type="plusempty" size="55" color="#ff0000"></uni-icons>
+			</view>
+		</view>
+	</view>
+</template>
+
+<script>
+	export default {
+		props: {
+			list: {
+				type: Array,
+			},
+			name: {
+				type: String,
+			},
+			count: {
+				type: Number,
+				default: 1
+			}
+		},
+		data() {
+			return {
+
+			};
+		},
+		methods: {
+			uplSuc() {
+				const that = this;
+				let serverUrl = that.$config.serverUrl;
+				uni.chooseImage({
+					count: 1,
+					sizeType: ['original', 'compressed'],
+					sourceType: ['album', 'camera'],
+					success: async function(res) {
+						let tempFile = JSON.parse(JSON.stringify(res.tempFilePaths));
+						const arr = await that.$apifile(`/point/upload`, 'file', tempFile[0], 'file');
+						that.$emit('uplSuc', {
+							data: {
+								name: arr.name,
+								uri: arr.uri,
+								url: serverUrl + arr.uri
+							},
+							name: that.name
+						})
+					}
+				});
+			},
+			// 删除图片
+			uplDel(index, e) {
+				const that = this;
+				that.$emit('uplDel', {
+					data: {
+						file: e,
+						index: index
+					},
+					name: that.name
+				})
+			},
+			// 图片预览
+			toView(index, e) {
+				const that = this;
+				uni.previewImage({
+					current: index,
+					urls: [e.url]
+				})
+			}
+		}
+	}
+</script>
+
+<style lang="scss">
+	.main {
+		padding: 0 2vw;
+
+		.one {
+			display: flex;
+			flex-direction: row;
+			flex-wrap: wrap;
+
+			.list {
+				position: relative;
+				width: 30vw;
+				height: 28vw;
+				text-align: center;
+				margin: 0 3vw 2vw 0;
+				border-radius: 5px;
+				box-shadow: 0 0 2px #858585;
+
+				.image {
+					width: 100%;
+					height: 100%;
+					border-radius: 5px;
+				}
+
+				.add {
+					position: relative;
+					top: 20px;
+				}
+
+				.del {
+					position: absolute;
+					right: 0;
+					top: 0;
+				}
+			}
+
+			.list:nth-child(3n) {
+				margin: 0 0 2vw 0;
+			}
+		}
+	}
+</style>

+ 20 - 10
manifest.json

@@ -18,27 +18,30 @@
         },
         },
         /* 模块配置 */
         /* 模块配置 */
         "modules" : {
         "modules" : {
-            "Geolocation" : {}
+            "Geolocation" : {},
+            "OAuth" : {},
+            "Maps" : {}
         },
         },
         /* 应用发布信息 */
         /* 应用发布信息 */
         "distribute" : {
         "distribute" : {
             /* android打包配置 */
             /* android打包配置 */
             "android" : {
             "android" : {
                 "permissions" : [
                 "permissions" : [
-                    "<uses-permission android:name=\"android.permission.CHANGE_NETWORK_STATE\"/>",
-                    "<uses-permission android:name=\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\"/>",
-                    "<uses-permission android:name=\"android.permission.VIBRATE\"/>",
-                    "<uses-permission android:name=\"android.permission.READ_LOGS\"/>",
-                    "<uses-permission android:name=\"android.permission.ACCESS_WIFI_STATE\"/>",
+                    "<uses-feature android:name=\"android.hardware.camera\"/>",
                     "<uses-feature android:name=\"android.hardware.camera.autofocus\"/>",
                     "<uses-feature android:name=\"android.hardware.camera.autofocus\"/>",
                     "<uses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\"/>",
                     "<uses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\"/>",
+                    "<uses-permission android:name=\"android.permission.ACCESS_WIFI_STATE\"/>",
                     "<uses-permission android:name=\"android.permission.CAMERA\"/>",
                     "<uses-permission android:name=\"android.permission.CAMERA\"/>",
+                    "<uses-permission android:name=\"android.permission.CHANGE_NETWORK_STATE\"/>",
+                    "<uses-permission android:name=\"android.permission.CHANGE_WIFI_STATE\"/>",
+                    "<uses-permission android:name=\"android.permission.FLASHLIGHT\"/>",
                     "<uses-permission android:name=\"android.permission.GET_ACCOUNTS\"/>",
                     "<uses-permission android:name=\"android.permission.GET_ACCOUNTS\"/>",
+                    "<uses-permission android:name=\"android.permission.MODIFY_AUDIO_SETTINGS\"/>",
+                    "<uses-permission android:name=\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\"/>",
+                    "<uses-permission android:name=\"android.permission.READ_LOGS\"/>",
                     "<uses-permission android:name=\"android.permission.READ_PHONE_STATE\"/>",
                     "<uses-permission android:name=\"android.permission.READ_PHONE_STATE\"/>",
-                    "<uses-permission android:name=\"android.permission.CHANGE_WIFI_STATE\"/>",
+                    "<uses-permission android:name=\"android.permission.VIBRATE\"/>",
                     "<uses-permission android:name=\"android.permission.WAKE_LOCK\"/>",
                     "<uses-permission android:name=\"android.permission.WAKE_LOCK\"/>",
-                    "<uses-permission android:name=\"android.permission.FLASHLIGHT\"/>",
-                    "<uses-feature android:name=\"android.hardware.camera\"/>",
                     "<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>"
                     "<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>"
                 ]
                 ]
             },
             },
@@ -53,7 +56,14 @@
                     "system" : {
                     "system" : {
                         "__platform__" : [ "ios", "android" ]
                         "__platform__" : [ "ios", "android" ]
                     }
                     }
-                }
+                },
+                "oauth" : {
+                    "weixin" : {
+                        "appid" : "wx8cdd28824dfcdf19",
+                        "UniversalLinks" : ""
+                    }
+                },
+                "maps" : {}
             },
             },
             "icons" : {
             "icons" : {
                 "android" : {
                 "android" : {

+ 15 - 0
pages.json

@@ -118,6 +118,21 @@
 					"style": {
 					"style": {
 						"navigationBarTitleText": "账号管理"
 						"navigationBarTitleText": "账号管理"
 					}
 					}
+				}, {
+					"path": "account/upPassword",
+					"style": {
+						"navigationBarTitleText": "登录密码"
+					}
+				}, {
+					"path": "account/bindEmail",
+					"style": {
+						"navigationBarTitleText": "绑定邮箱"
+					}
+				}, {
+					"path": "account/upBasic",
+					"style": {
+						"navigationBarTitleText": "个人信息"
+					}
 				}
 				}
 			]
 			]
 		},
 		},

+ 31 - 75
pages/home/index.vue

@@ -1,23 +1,20 @@
 <template>
 <template>
 	<mobile-frame :frameStyle="frameStyle" @toPath="toPath">
 	<mobile-frame :frameStyle="frameStyle" @toPath="toPath">
-		<scroll-view class="scrollView" scroll-with-animation :scroll-into-view="topItem" scroll-y="true"
-			@scroll="handleScroll">
+		<scroll-view class="scrollView" scroll-with-animation :scroll-into-view="topItem" scroll-y="true" @scroll="handleScroll">
 			<view class="main" id="top">
 			<view class="main" id="top">
 				<view class="zero one">
 				<view class="zero one">
-					<input type="text" placeholder="搜索商品" @tap="toCommon('pagesHome/market/search')"
-						placeholder-class="placss">
+					<input type="text" placeholder="搜索商品" @tap="toCommon('pagesHome/market/search')" placeholder-class="placss">
 				</view>
 				</view>
 				<view class="zero two">
 				<view class="zero two">
-					<swiper class="swiper" circular :indicator-dots="true" indicator-color="#ffffff"
-						indicator-active-color="#FB1438" :autoplay="true" :interval="3000" :duration="1000">
+					<swiper class="swiper" circular :indicator-dots="true" indicator-color="#ffffff" indicator-active-color="#FB1438" :autoplay="true" :interval="3000" :duration="1000">
 						<swiper-item class="list" v-for="(item,index) in bannerList" :key="index">
 						<swiper-item class="list" v-for="(item,index) in bannerList" :key="index">
-							<image class="image" :src="item.url" mode=""></image>
+							<image class="image" :src="item.url&&item.url.length>0?item.url[0].url:''" mode=""></image>
 						</swiper-item>
 						</swiper-item>
 					</swiper>
 					</swiper>
 				</view>
 				</view>
 				<view class="zero thr">
 				<view class="zero thr">
-					<view class="list" v-for="(item,index) in btnList" :key="index" @tap="toCommon(item.route)">
-						<image class="image" :src="item.url" mode=""></image>
+					<view class="list" v-for="(item,index) in btnList" :key="index" @tap="toCommon(item.to)">
+						<image class="image" :src="item.url&&item.url.length>0?item.url[0].url:''" mode=""></image>
 						<view class="textOver name">
 						<view class="textOver name">
 							{{item.name}}
 							{{item.name}}
 						</view>
 						</view>
@@ -37,8 +34,7 @@
 					</view>
 					</view>
 				</view>
 				</view>
 				<view class="zero five">
 				<view class="zero five">
-					<view class="list" v-for="(item,index) in marketList" :key="index"
-						@tap="toCommon('pagesHome/order/detail')">
+					<view class="list" v-for="(item,index) in marketList" :key="index" @tap="toCommon('pagesHome/market/detail')">
 						<image class="image" :src="item.url" mode=""></image>
 						<image class="image" :src="item.url" mode=""></image>
 						<view class="name">
 						<view class="name">
 							{{item.name}}
 							{{item.name}}
@@ -69,71 +65,9 @@
 				frameStyle: {
 				frameStyle: {
 					useBar: true
 					useBar: true
 				},
 				},
-				bannerList: [ // 轮播图
-					{
-						url: require('@/static/test.png')
-					},
-					{
-						url: require('@/static/test.png')
-					},
-					{
-						url: require('@/static/test.png')
-					},
-					{
-						url: require('@/static/test.png')
-					},
+				bannerList: [ // 轮播图 
 				],
 				],
 				btnList: [ //功能按钮
 				btnList: [ //功能按钮
-					{
-						name: '商品分类',
-						url: require('@/static/logo.png'),
-						route: 'pagesHome/market/type'
-					},
-					{
-						name: '首农专区',
-						url: require('@/static/logo.png'),
-						route: ''
-					},
-					{
-						name: '地方特产',
-						url: require('@/static/logo.png'),
-						route: ''
-					},
-					{
-						name: '进口食品',
-						url: require('@/static/logo.png'),
-						route: ''
-					},
-					{
-						name: '扶贫专区',
-						url: require('@/static/logo.png'),
-						route: ''
-					},
-					{
-						name: '自提门店',
-						url: require('@/static/logo.png'),
-						route: ''
-					},
-					{
-						name: '点到优选',
-						url: require('@/static/logo.png'),
-						route: ''
-					},
-					{
-						name: '活动专区',
-						url: require('@/static/logo.png'),
-						route: ''
-					},
-					{
-						name: '兑换中心',
-						url: require('@/static/logo.png'),
-						route: ''
-					},
-					{
-						name: '员工中心',
-						url: require('@/static/logo.png'),
-						route: ''
-					},
 				],
 				],
 				recomList: [ //推荐好物
 				recomList: [ //推荐好物
 					{
 					{
@@ -226,8 +160,30 @@
 				topItem: ''
 				topItem: ''
 			};
 			};
 		},
 		},
-		onShow: function() {},
+		onShow: function() {
+			const that = this;
+			that.search();
+		},
 		methods: {
 		methods: {
+			async search() {
+				const that = this;
+				let res;
+				// 轮播图
+				res = await that.$api(`/banner`, 'GET', {
+					is_use: '0'
+				});
+				if (res.errcode == '0') that.$set(that, `bannerList`, res.data);
+				// 首页模块管理
+				res = await that.$api(`/indexModule`, 'GET', {
+					is_use: '0'
+				});
+				if (res.errcode == '0') {
+					let data = res.data.sort(function(a, b) {
+						return a.sort - b.sort
+					});
+					that.$set(that, `btnList`, data);
+				}
+			},
 			// 公共跳转
 			// 公共跳转
 			toCommon(e) {
 			toCommon(e) {
 				uni.navigateTo({
 				uni.navigateTo({

+ 3 - 15
pages/index/index.vue

@@ -31,22 +31,10 @@
 					url: `/${e}`
 					url: `/${e}`
 				});
 				});
 			},
 			},
-			// 监听用户是否登录
 			watchLogin() {
 			watchLogin() {
-				const that = this;
-				uni.getStorage({
-					key: 'token',
-					success: function(res) {
-						// uni.redirectTo({
-						// 	url: `/pagesA/adminHome/index`
-						// })
-					},
-					fail: function(res) {
-						uni.redirectTo({
-							url: `/pages/home/index`
-						})
-					}
-				});
+				uni.redirectTo({
+					url: `/pages/home/index`
+				})
 			},
 			},
 		}
 		}
 	}
 	}

+ 138 - 37
pages/login/index.vue

@@ -1,20 +1,17 @@
 <template>
 <template>
 	<mobile-frame>
 	<mobile-frame>
 		<view class="main">
 		<view class="main">
-			<view class="one">
-				<image class="image" :src="logoUrl">
-				</image>
-			</view>
 			<view class="two">
 			<view class="two">
 				<uni-forms ref="form" :rules="rules" :model="form" label-width="auto">
 				<uni-forms ref="form" :rules="rules" :model="form" label-width="auto">
-					<uni-forms-item label="登录账号" name="code_phone">
-						<uni-easyinput type="text" v-model="form.code_phone" placeholder="请输入登录账号" />
+					<uni-forms-item label="账号" name="phone">
+						<uni-easyinput type="text" v-model="form.phone" placeholder="请输入账号" />
 					</uni-forms-item>
 					</uni-forms-item>
-					<uni-forms-item label="登录密码" name="password">
-						<uni-easyinput type="password" v-model="form.password" placeholder="请输入登录密码" />
+					<uni-forms-item label="密码" name="password">
+						<uni-easyinput type="password" v-model="form.password" placeholder="请输入密码" />
 					</uni-forms-item>
 					</uni-forms-item>
 					<view class="btn">
 					<view class="btn">
-						<button type="default" size="mini" @click="toSubmit('form')">提交登录</button>
+						<button type="default" size="mini" @click="toSubmit('form')">登录</button>
+						<button type="default" size="mini" @click="wxLogin()">微信信任登录</button>
 					</view>
 					</view>
 				</uni-forms>
 				</uni-forms>
 			</view>
 			</view>
@@ -29,21 +26,23 @@
 				logoUrl: this.$config.logoUrl,
 				logoUrl: this.$config.logoUrl,
 				form: {},
 				form: {},
 				rules: {
 				rules: {
-					code_phone: {
+					phone: {
 						rules: [{
 						rules: [{
 								required: true,
 								required: true,
-								errorMessage: '请输入登录账号',
+								errorMessage: '请输入账号',
 							},
 							},
-
+							{
+								minLength: 11,
+								maxLength: 11,
+								errorMessage: '账号长度在{maxLength}个字符',
+							}
 						]
 						]
 					},
 					},
 					password: {
 					password: {
 						rules: [{
 						rules: [{
-								required: true,
-								errorMessage: '请输入登录密码',
-							},
-
-						]
+							required: true,
+							errorMessage: '请输入密码',
+						}, ]
 					},
 					},
 				}
 				}
 			};
 			};
@@ -61,28 +60,142 @@
 			toSubmit(ref) {
 			toSubmit(ref) {
 				const that = this;
 				const that = this;
 				that.$refs[ref].validate().then(async params => {
 				that.$refs[ref].validate().then(async params => {
-					const res = await that.$api(`/admin/login`, 'POST', {
+					const res = await that.$api(`/user/login`, 'POST', {
 						...params
 						...params
 					})
 					})
 					if (res.errcode == '0') {
 					if (res.errcode == '0') {
+						uni.showToast({
+							title: '登录成功',
+							icon: 'success'
+						});
 						uni.setStorage({
 						uni.setStorage({
 							key: 'token',
 							key: 'token',
 							data: res.data,
 							data: res.data,
 							success: function() {
 							success: function() {
-								uni.redirectTo({
-									url: `/pagesA/adminHome/index`
+								uni.navigateBack({
+									delta: 1
 								})
 								})
 							}
 							}
 						});
 						});
+					} else {
+						if (res.errcode == '-5') {
+							// 账号无,注册账号
+							that.createUser(params);
+						} else {
+							uni.showToast({
+								title: res.errmsg,
+								icon: 'none'
+							});
+						}
+					}
+				}).catch(err => {
+					console.log('表单错误信息:', err);
+				})
+			},
+			// 注册账号,去登录
+			async createUser(params) {
+				const that = this;
+				const res = await that.$api(`/user`, 'POST', {
+					...params
+				})
+				if (res.errcode == '0') {
+					that.userLogin(params, '1')
+				} else {
+					uni.showToast({
+						title: res.errmsg,
+					});
+				}
+			},
+			// 注册微信账号,去登录
+			async createwxUser(params) {
+				const that = this;
+				const res = await that.$api(`/user`, 'POST', {
+					...params
+				})
+				if (res.errcode == '0') {
+					that.userLogin(params, '2')
+				} else {
+					uni.showToast({
+						title: res.errmsg,
+					});
+				}
+			},
+			// 账号,微信登录
+			async userLogin(params, type) {
+				const that = this;
+				let res;
+				if (type == '1') {
+					res = await that.$api(`/user/login`, 'POST', {
+						...params
+					})
+				} else if (type == '2') {
+					res = await that.$api(`/user/wxLogin`, 'POST', {
+						openid: params.openid
+					})
+				}
+				if (res.errcode == '0') {
+					uni.showToast({
+						title: '登录成功',
+						icon: 'success'
+					});
+					uni.setStorage({
+						key: 'token',
+						data: res.data,
+						success: function() {
+							uni.navigateBack({
+								delta: 1
+							})
+						}
+					});
+				} else {
+					if (res.errcode == '-5') {
+						// 账号无,注册账号
+						that.createwxUser(params);
 					} else {
 					} else {
 						uni.showToast({
 						uni.showToast({
 							title: res.errmsg,
 							title: res.errmsg,
-							icon: 'error',
-							duration: 2000
+							icon: 'none'
 						});
 						});
 					}
 					}
-				}).catch(err => {
-					console.log('表单错误信息:', err);
+				}
+			},
+			// 微信登录
+			wxLogin() {
+				const that = this;
+				uni.login({
+					provider: 'weixin',
+					success: function(res) {
+						// 获取平台信息
+						uni.getSystemInfo({
+							success: async function(arr) {
+								let platForm = arr.uniPlatform;
+								if (platForm == 'app') { //app平台
+									uni.showToast({
+										title: 'app端暂未开通微信登录',
+										icon: 'none'
+									});
+								} else if (platForm == 'mp-weixin') { //微信平台
+									const aee = await that.$api(`/wechat/api/login/app`, 'GET', {
+										js_code: res.code,
+										config: 'pointApp'
+									})
+									if (aee.errcode == '0') {
+										// 微信登录
+										that.userLogin({
+											openid: aee.data.openid
+										}, '2');
+									} else {
+										uni.showToast({
+											title: res.errmsg,
+										});
+									}
+								}
+							}
+						});
+					},
+					fail: function(err) {
+						console.log(err);
+					}
 				})
 				})
 			},
 			},
 		}
 		}
@@ -91,22 +204,10 @@
 
 
 <style lang="scss">
 <style lang="scss">
 	.main {
 	.main {
-		.one {
-			text-align: center;
-			padding: 8vw 0;
-			margin: 0 0 2vw 0;
-			background-image: linear-gradient(#35BD7B, #75E4B1);
 
 
-			.image {
-				width: 25vw;
-				height: 25vw;
-				border-radius: 50%;
-				box-shadow: 0 0 5px var(--f9Color);
-			}
-		}
 
 
 		.two {
 		.two {
-			padding: 0 2vw;
+			padding: 2vw;
 
 
 			.btn {
 			.btn {
 				text-align: center;
 				text-align: center;

+ 44 - 10
pages/my/index.vue

@@ -7,9 +7,9 @@
 					<view class="name">未登录</view>
 					<view class="name">未登录</view>
 				</view>
 				</view>
 				<view class="one_1" v-else>
 				<view class="one_1" v-else>
-					<image :src="user.icon"></image>
+					<image class="image" :src="user.icon&&user.icon.length>0?user.icon[0].url:''"></image>
 					<view class="name">
 					<view class="name">
-						<text>{{user.name||'暂无'}}</text>
+						<text>{{user.name||'暂无名称'}}</text>
 						<text>普通会员</text>
 						<text>普通会员</text>
 					</view>
 					</view>
 				</view>
 				</view>
@@ -44,8 +44,8 @@
 				<view class="two_1" v-for="(item, index) in menuList" :key="index" @click="toCommon(item.route)">
 				<view class="two_1" v-for="(item, index) in menuList" :key="index" @click="toCommon(item.route)">
 					<view class="title">{{item.title}}</view>
 					<view class="title">{{item.title}}</view>
 					<view class="title">
 					<view class="title">
-						<text v-if="user._id&&item.title=='我的积分'">{{user.integral||0}}分</text>
-						<text v-if="user._id&&item.title=='客服电话'">{{user.phone||'123-345-6780'}}</text>
+						<text v-if="user.id&&item.title=='我的积分'">{{user.integral||0}}分</text>
+						<text v-if="item.title=='客服电话'">{{serviceContaceInfo.phone||''}}</text>
 						<text class="iconfont icon-dayufuhao"></text>
 						<text class="iconfont icon-dayufuhao"></text>
 					</view>
 					</view>
 				</view>
 				</view>
@@ -63,6 +63,8 @@
 				},
 				},
 				// 用户信息
 				// 用户信息
 				user: {},
 				user: {},
+				// 客服信息
+				serviceContaceInfo: {},
 				// 图标菜单
 				// 图标菜单
 				orderList: [{
 				orderList: [{
 						icon: 'icon-daifukuan',
 						icon: 'icon-daifukuan',
@@ -122,8 +124,36 @@
 				],
 				],
 			};
 			};
 		},
 		},
-		onShow: function() {},
+		onShow: async function() {
+			const that = this;
+			// 查询其他信息
+			await that.searchOther();
+			// 监听用户登录
+			await that.watchLogin();
+
+		},
 		methods: {
 		methods: {
+			watchLogin() {
+				const that = this;
+				uni.getStorage({
+					key: 'token',
+					success: async (res) => {
+						let user = that.$jwt(res.data);
+						const arr = await that.$api(`/user/${user.id}`, 'GET');
+						if (arr.errcode == '0') that.$set(that, `user`, arr.data);
+					},
+					fail: (err) => {}
+				})
+			},
+			// 查询其他信息
+			async searchOther() {
+				const that = this;
+				let res;
+				res = await that.$api(`/serviceContace`, 'GET');
+				if (res.errcode == '0' && res.total > 0) {
+					that.$set(that, `serviceContaceInfo`, res.data[0])
+				}
+			},
 			toPath(e) {
 			toPath(e) {
 				if (e && e.route) uni.redirectTo({
 				if (e && e.route) uni.redirectTo({
 					url: `/${e.route}`
 					url: `/${e.route}`
@@ -134,7 +164,9 @@
 				uni.getStorage({
 				uni.getStorage({
 					key: 'token',
 					key: 'token',
 					success: function(res) {
 					success: function(res) {
-						console.log(res);
+						uni.navigateTo({
+							url: `/${e}`
+						})
 					},
 					},
 					fail: function(err) {
 					fail: function(err) {
 						uni.navigateTo({
 						uni.navigateTo({
@@ -142,9 +174,7 @@
 						})
 						})
 					}
 					}
 				});
 				});
-				// uni.navigateTo({
-				// 	url: `/${e}`
-				// })
+
 			},
 			},
 			// 跳转页面
 			// 跳转页面
 			toOrrder(e) {
 			toOrrder(e) {
@@ -167,7 +197,7 @@
 		.one {
 		.one {
 			text-align: center;
 			text-align: center;
 			padding: 4vw 0;
 			padding: 4vw 0;
-			background-color: #FB1438;
+			background-color: var(--fFB1Color);
 			color: var(--mainColor);
 			color: var(--mainColor);
 
 
 			.one_1 {
 			.one_1 {
@@ -189,6 +219,10 @@
 					margin: 2vw 0;
 					margin: 2vw 0;
 					font-size: var(--font18Szie);
 					font-size: var(--font18Szie);
 				}
 				}
+
+				.image {
+					border: 1px solid var(--f1Color);
+				}
 			}
 			}
 
 
 			.one_2 {
 			.one_2 {

+ 145 - 0
pagesMy/account/bindEmail.vue

@@ -0,0 +1,145 @@
+<template>
+	<mobile-frame :frameStyle="frameStyle" @toPath="toPath">
+		<view class="main">
+			<view class="one">
+				<uni-forms ref="form" :modelValue="form" :rules="rules" label-width="auto">
+					<uni-forms-item label="电子邮箱" name="email" class="local">
+						<uni-easyinput type="text" v-model="form.email" placeholder="请输入电子邮箱" />
+						<button class="localicon" type="primary" size="mini">发送验证码</button>
+					</uni-forms-item>
+					<uni-forms-item label="邮箱验证码" name="num">
+						<uni-easyinput type="text" v-model="form.num" placeholder="请输入邮箱验证码" />
+					</uni-forms-item>
+				</uni-forms>
+				<view class="btn">
+					<button type="primary" @click="onSubmit('form')" size="small">立即绑定</button>
+				</view>
+			</view>
+		</view>
+
+	</mobile-frame>
+</template>
+
+<script>
+	export default {
+		data() {
+			return {
+				frameStyle: {
+					useBar: false
+				},
+				form: {},
+				rules: {
+					email: {
+						rules: [{
+							required: true,
+							errorMessage: '请输入邮箱',
+						}]
+					},
+					num: {
+						rules: [{
+							required: true,
+							errorMessage: '请输入邮箱验证码',
+						}]
+					},
+				},
+			};
+		},
+		onLoad: function(e) {
+			console.log(e);
+		},
+		onShow: function() {},
+		methods: {
+			toPath(e) {
+				if (e && e.route) uni.redirectTo({
+					url: `/${e.route}`
+				})
+			},
+			// 提交保存
+			onSubmit() {
+				const that = this;
+				let data = that.form;
+				data = {
+					...data,
+				}
+				console.log(data);
+				// this.$refs.form.validate().then(async (res) => {
+				// let arr;
+				// if (data._id) {
+				// 	arr = await that.$api(``, 'POST', data)
+				// } else {
+				// 	arr = await that.$api(``, 'POST', data)
+				// }
+				// if (arr.errcode == '0') {
+				// 	uni.showToast({
+				// 		title: `维护信息成功`,
+				// 		icon: 'success',
+				// 		duration: 2000
+				// 	});
+				// 	that.back()
+				// } else {
+				// 	uni.showToast({
+				// 		title: arr.errmsg,
+				// 		icon: 'error',
+				// 		duration: 2000
+				// 	})
+				// }
+				// })
+			},
+		}
+	}
+</script>
+
+<style lang="scss">
+	.main {
+		display: flex;
+		flex-direction: column;
+		width: 100vw;
+		height: 100vh;
+
+		.one {
+			padding: 2vw;
+
+			.uni-input {
+				border: #f1f1ff 1px solid;
+				padding: 2vw 2vw;
+				border-radius: 1vw;
+			}
+
+
+			.btn {
+				text-align: center;
+
+				button {
+					margin: 0 2vw 2vw 2vw;
+					background-color: var(--ff0Color);
+					color: var(--fffColor);
+				}
+
+				.name {
+					color: var(--f85Color);
+					font-size: var(--font14Size);
+				}
+			}
+		}
+	}
+
+	.uni-forms-item {
+		margin-bottom: 6vw !important;
+		display: flex;
+		flex-direction: row;
+	}
+
+
+	.uni-forms-item:first-child {
+		.uni-easyinput__content {
+			width: 50vw;
+		}
+	}
+
+
+	.localicon {
+		position: absolute;
+		right: 0;
+		top: 5px;
+	}
+</style>

+ 108 - 2
pagesMy/account/index.vue

@@ -1,6 +1,37 @@
 <template>
 <template>
 	<mobile-frame>
 	<mobile-frame>
-		1
+		<view class="main">
+			<view class="one" @click="toCommon('/pagesMy/account/upPassword')">
+				<view class="other">
+					<view class="title">{{passLogin.name}}</view>
+					<view class="titles">{{passLogin.content}}</view>
+				</view>
+				<view class="btn">
+					<text class="iconfont icon-dayufuhao"></text>
+				</view>
+			</view>
+			<view class="one" @click="toCommon('/pagesMy/account/bindEmail')">
+				<view class="other">
+					<view class="title">{{email.name}}</view>
+					<view class="titles">{{email.content}}</view>
+				</view>
+				<view class="btn">
+					<text class="iconfont icon-dayufuhao"></text>
+				</view>
+			</view>
+			<view class="one" @click="toCommon('/pagesMy/account/upBasic')">
+				<view class="other">
+					<view class="title">{{info.name}}</view>
+					<view class="titles">{{info.content}}</view>
+				</view>
+				<view class="btn">
+					<text class="iconfont icon-dayufuhao"></text>
+				</view>
+			</view>
+			<view class="two">
+				<button type="default" size="mini" @click="toOut()">退出当前登录</button>
+			</view>
+		</view>
 	</mobile-frame>
 	</mobile-frame>
 </template>
 </template>
 
 
@@ -8,16 +39,91 @@
 	export default {
 	export default {
 		data() {
 		data() {
 			return {
 			return {
+				passLogin: {
+					name: '登录密码',
+					content: '建议定期修改密码以保护账号安全'
+				},
+				phone: {
+					name: '绑定手机',
+					content: '如若您已更换手机号,请及时绑定',
+					phone: '137****0000'
+				},
+				email: {
+					name: '绑定邮箱',
+					content: '未绑定邮箱,请及时绑定'
+				},
+				info: {
+					name: '修改个人信息',
+					content: '修改个人信息'
+				},
 
 
 			};
 			};
 		},
 		},
 		onShow: function() {},
 		onShow: function() {},
 		methods: {
 		methods: {
-
+			// 跳转
+			toCommon(route, e) {
+				uni.navigateTo({
+					url: `${route}`
+				})
+			},
+			// 退出登录
+			toOut(e) {
+				try {
+					uni.clearStorage();
+					uni.redirectTo({
+						url: '/pages/index/index'
+					})
+				} catch (e) {}
+			}
 		}
 		}
 	}
 	}
 </script>
 </script>
 
 
 <style lang="scss">
 <style lang="scss">
+	.main {
+		display: flex;
+		flex-direction: column;
+		width: 100vw;
+		height: 100vh;
+
+		.one {
+			border-bottom: 1px var(--fcColor) solid;
+			margin: 1vw 3vw;
+			display: flex;
+			flex-direction: row;
+			padding: 1vw 0;
+
+			.other {
+				flex-grow: 1;
+
+				.title {
+					margin: 2vw 0;
+					font-size: var(--font16Size);
+				}
+
+				.titles {
+					font-size: var(--font14Size);
+					color: var(--f85Color);
+					margin: 2vw 0;
+				}
+			}
 
 
+			.btn {
+				text-align: right;
+				font-size: 20px;
+			}
+		}
+
+		.two {
+			margin: 5vw 3vw;
+			text-align: center;
+
+			button {
+				border-radius: 20px;
+				border: 2px solid var(--ff0Color);
+				color: var(--ff0Color);
+			}
+		}
+	}
 </style>
 </style>

+ 209 - 0
pagesMy/account/upBasic.vue

@@ -0,0 +1,209 @@
+<template>
+	<mobile-frame>
+		<view class="info">
+			<view class="one">
+				<uni-forms ref="form" :modelValue="form" :rules="rules" label-width="auto">
+					<uni-forms-item label="头像" name="icon">
+						<upload :list="icon" name="icon" :count="1" @uplSuc="uplSuc" @uplDel="uplDel"></upload>
+					</uni-forms-item>
+					<uni-forms-item label="用户名" name="name">
+						<uni-easyinput type="text" v-model="form.name" placeholder="请输入用户名" />
+					</uni-forms-item>
+					<uni-forms-item label="手机号" name="phone">
+						<uni-easyinput type="text" v-model="form.phone" placeholder="请输入手机号" />
+					</uni-forms-item>
+					<uni-forms-item label="性别" name="gender">
+						<picker @change="genderChange" name="gender" :value="form.gender" :range="genderList"
+							range-key="label">
+							<view class="uni-input">{{form.zhGender||'请选择性别'}}</view>
+						</picker>
+					</uni-forms-item>
+					<uni-forms-item label="生日" name="birth">
+						<picker mode="date" :value="form.birth" name="birth" :start="startDate" :end="endDate"
+							@change="bindDateChange">
+							<view class="uni-input">{{form.birth||'请选择日期'}}</view>
+						</picker>
+					</uni-forms-item>
+				</uni-forms>
+				<view class="btn">
+					<button type="primary" @click="onSubmit('form')" size="small">提交</button>
+				</view>
+			</view>
+		</view>
+
+	</mobile-frame>
+</template>
+
+<script>
+	import upload from '@/components/upload/index.vue';
+	export default {
+		components: {
+			upload
+		},
+		data() {
+			return {
+				frameStyle: {
+					useBar: false
+				},
+				form: {},
+				rules: {
+					name: {
+						rules: [{
+							required: true,
+							errorMessage: '请输入用户名',
+						}]
+					},
+					phone: {
+						rules: [{
+							required: true,
+							errorMessage: '请输入手机号',
+						}]
+					},
+				},
+				genderList: [{
+						label: '保密',
+						value: '0'
+					},
+					{
+						label: '男',
+						value: '1'
+					},
+					{
+						label: '女',
+						value: '2'
+					},
+				],
+				icon: []
+			};
+		},
+		onLoad: function(e) {
+			const that = this;
+			that.watchLogin();
+		},
+		onShow: function() {},
+		methods: {
+			watchLogin() {
+				const that = this;
+				uni.getStorage({
+					key: 'token',
+					success: async (res) => {
+						let user = that.$jwt(res.data);
+						if (user) {
+							const arr = await that.$api(`/user/${user.id}`, 'GET');
+							if (arr.errcode == '0') {
+								let gender = that.genderList.find(i => i.value == arr.data
+									.gender)
+								if (gender) arr.data.zhGender = gender.label;
+								that.$set(that, `form`, arr.data)
+								that.$set(that, `icon`, arr.data.icon)
+							} else {
+								uni.showToast({
+									title: arr.errmsg,
+									icon: 'error',
+									duration: 2000
+								});
+							}
+						}
+					},
+					fail: (err) => {}
+				})
+			},
+			toPath(e) {
+				if (e && e.route) uni.redirectTo({
+					url: `/${e.route}`
+				})
+			},
+			// 图片上传
+			uplSuc(e) {
+				const that = this;
+				that.$set(that, `${e.name}`, [...that[e.name], e.data]);
+			},
+			// 图片删除
+			uplDel(e) {
+				const that = this;
+				let data = that[e.name];
+				let arr = data.filter((i, index) => index != e.data.index);
+				that.$set(that, `${e.name}`, arr)
+			},
+			// 选择性别
+			genderChange(e) {
+				const that = this;
+				let data = that.genderList[e.detail.value];
+				if (data) {
+					that.$set(that.form, `gender`, data.value);
+					that.$set(that.form, `zhGender`, data.label);
+				}
+			},
+			// 选择日期
+			bindDateChange(e) {
+				const that = this;
+				that.$set(that.form, `birth`, e.detail.value);
+			},
+			// 返回
+			back() {
+				uni.navigateBack({
+					delta: 1
+				})
+			},
+			// 提交保存
+			onSubmit(ref) {
+				const that = this;
+				that.$refs[ref].validate().then(async params => {
+					params.icon = that.icon
+					const arr = await that.$api(`/user/${that.form.id}`, 'POST', params);
+					if (arr.errcode == '0') {
+						uni.showToast({
+							title: `维护信息成功`,
+							icon: 'success',
+						});
+						that.back();
+					} else {
+						uni.showToast({
+							title: arr.errmsg,
+						})
+					}
+				})
+			},
+		}
+	}
+</script>
+
+<style lang="scss">
+	.info {
+		display: flex;
+		flex-direction: column;
+		width: 100vw;
+		height: 100vh;
+
+		.one {
+			padding: 2vw;
+
+			.uni-input {
+				border: #f1f1ff 1px solid;
+				padding: 2vw 2vw;
+				border-radius: 1vw;
+			}
+
+			.btn {
+				text-align: center;
+
+				button {
+					margin: 0 2vw 2vw 2vw;
+					background-color: var(--ff0Color);
+					color: var(--fffColor);
+				}
+
+				.name {
+					color: var(--f85Color);
+					font-size: var(--font14Size);
+				}
+			}
+		}
+	}
+
+	.uni-forms-item {
+		margin-bottom: 6vw !important;
+		display: flex;
+		flex-direction: row;
+	}
+</style>

+ 141 - 0
pagesMy/account/upPassword.vue

@@ -0,0 +1,141 @@
+<template>
+	<mobile-frame :frameStyle="frameStyle" @toPath="toPath">
+		<view class="main">
+			<view class="one">
+				<uni-forms ref="form" :modelValue="form" :rules="rules" label-width="auto">
+					<uni-forms-item label="账号" name="phone">
+						<uni-easyinput type="text" v-model="form.phone" placeholder="请输入账号" disabled />
+					</uni-forms-item>
+					<uni-forms-item label="新密码" name="password">
+						<uni-easyinput type="password" v-model="form.password" placeholder="请输入新密码" />
+					</uni-forms-item>
+					<uni-forms-item label="确认密码" name="is_password">
+						<uni-easyinput type="is_password" v-model="form.is_password" placeholder="请输入确认密码" />
+					</uni-forms-item>
+				</uni-forms>
+				<view class="btn">
+					<button type="primary" @click="onSubmit('form')" size="small">提交</button>
+					<view class="name">提示:为了您的账户安全,建议定期修改密码</view>
+				</view>
+			</view>
+		</view>
+
+	</mobile-frame>
+</template>
+
+<script>
+	export default {
+		data() {
+			return {
+				frameStyle: {
+					useBar: false
+				},
+				form: {},
+				rules: {
+					password: {
+						rules: [{
+							required: true,
+							errorMessage: '请输入新密码',
+						}]
+					},
+				},
+			};
+		},
+		onLoad: function(e) {
+			const that = this;
+			that.watchLogin();
+		},
+		onShow: function() {},
+		methods: {
+			watchLogin() {
+				const that = this;
+				uni.getStorage({
+					key: 'token',
+					success: (res) => {
+						let user = that.$jwt(res.data);
+						if (user) {
+							that.$set(that, `form`, {
+								id: user.id,
+								phone: user.phone
+							})
+						}
+					},
+					fail: (err) => {}
+				})
+			},
+			toPath(e) {
+				if (e && e.route) uni.redirectTo({
+					url: `/${e.route}`
+				})
+			},
+
+			// 提交保存
+			onSubmit(ref) {
+				const that = this;
+				that.$refs[ref].validate().then(async params => {
+					if (params.password == params.is_password) {
+						const arr = await that.$api(`/user/resetPwd/${that.form.id}`, 'POST', params);
+						if (arr.errcode == '0') {
+							uni.showToast({
+								title: `密码修改成功`,
+								icon: 'success',
+							});
+							uni.clearStorage();
+							uni.redirectTo({
+								url: '/pages/login/index'
+							})
+						} else {
+							uni.showToast({
+								title: arr.errmsg,
+							})
+						}
+					} else {
+						uni.showToast({
+							title: `密码不一致`,
+						});
+					}
+				})
+			},
+		}
+	}
+</script>
+
+<style lang="scss">
+	.main {
+		display: flex;
+		flex-direction: column;
+		width: 100vw;
+		height: 100vh;
+
+		.one {
+			padding: 2vw;
+
+			.uni-input {
+				border: #f1f1ff 1px solid;
+				padding: 2vw 2vw;
+				border-radius: 1vw;
+			}
+
+			.btn {
+				text-align: center;
+
+				button {
+					margin: 0 2vw 2vw 2vw;
+					background-color: var(--ff0Color);
+					color: var(--fffColor);
+				}
+
+				.name {
+					color: var(--f85Color);
+					font-size: var(--font14Size);
+				}
+			}
+		}
+	}
+
+	.uni-forms-item {
+		margin-bottom: 6vw !important;
+		display: flex;
+		flex-direction: row;
+	}
+</style>

+ 1 - 0
pagesMy/address/add.vue

@@ -84,6 +84,7 @@
 					url: `/${e.route}`
 					url: `/${e.route}`
 				})
 				})
 			},
 			},
+			
 			// 是否设为默认地址
 			// 是否设为默认地址
 			switchChange(e) {
 			switchChange(e) {
 				const that = this;
 				const that = this;