shish 11 месяцев назад
Родитель
Сommit
fde9862c18

+ 1 - 1
mallApp/src/pages.json

@@ -18,7 +18,7 @@
             "pages": [
                 { "path": "register", "style": { "navigationBarTitleText": "注册" } },
                 { "path": "password", "style": { "navigationBarTitleText": "修改密码" } },
-                { "path": "address", "style": { "navigationBarTitleText": "地址修改" } },
+                { "path": "address", "style": { "navigationBarTitleText": "修改地址" } },
                 { "path": "edit", "style": { "navigationBarTitleText": "个人信息" } },
                 { "path": "birthday", "style": { "navigationBarTitleText": "生日" } }
             ]

+ 1 - 4
mallApp/src/pages/home/recent.vue

@@ -205,13 +205,10 @@ export default {
       }else{
         this.loginStyle = 0
       }
-
       if(this.pageAction.refresh == 1){
-        this.resetList()
-        this.getMyHdList()
+        this.init()
         this.pageAction.refresh == 0
       }
-
   },
   onPullDownRefresh() {
     this.resetList()

+ 30 - 14
mallApp/src/pages/user/address.vue

@@ -2,10 +2,6 @@
 	<view class="app-content">
 		<form @submit="formSubmit">
 			<view class="module-com input-line-wrap">
-				<tui-list-cell class="line-cell" :hover="false">
-					<view class="tui-title">名称</view>
-					<input v-model="form.name" placeholder-class="phcolor" class="tui-input" name="name" placeholder="请输入名称" maxlength="50" type="text" />
-				</tui-list-cell>
 				<tui-list-cell class="line-cell" :hover="false" :arrow="true" @click="openAddres">
 					<view class="tui-title">城市</view>
 					<view class="tui-input" v-if="form.province || form.city">{{ form.province + '-' + form.city }}</view>
@@ -34,7 +30,7 @@
 		<!-- 省市联动 -->
 		<simple-address ref="simpleAddress" :pickerValueDefault="cityPickerValueDefault" @onConfirm="onCityConfirm"></simple-address>
 		<!-- 选择地区 -->
-		<app-area-sel :show.sync="showRegion" :city="form.city" @change="changeAreaFn" />
+		<app-area-sel :show.sync="showRegion" :city="form.city" @change="changeAreaFn" :isFocus="false" />
 	</view>
 </template>
 <script>
@@ -44,7 +40,7 @@ import AppAreaSel from '@/components/app-area-sel'
 const form = require('@/utils/formValidation.js')
 import {currentInfo,updateInfo} from "@/api/user"
 export default {
-	name: 'modify',
+	name: 'address',
 	components: {
 		TuiListCell,
 		SimpleAddress,
@@ -53,7 +49,6 @@ export default {
 	data() {
 		return {
 			form: {
-				name: '',
 				province: '',
 				city: '',
 				address: '',
@@ -70,8 +65,7 @@ export default {
 			hasMap:0 // 是否具备定位功能 0不具备 1具备
 		}
 	},
-	onLoad(options) {
-		this.hasMap = options.hasMap || 0
+	onLoad() {
 		this.getUserInfo()
 	},
 	methods: {
@@ -89,6 +83,7 @@ export default {
                 })
                 this.region.lat = data.lat
                 this.region.long = data.long
+				this.hasMap = res.data.info.hasMap||0
             })
 		},
 		selectRegion() {
@@ -133,11 +128,6 @@ export default {
 		},
 		formSubmit(e) {
 			let rules = [
-				{
-					name: 'name',
-					rule: ['required'],
-					msg: ['请输入名称']
-				},
 				{
 					name: 'province',
 					rule: ['required'],
@@ -174,6 +164,32 @@ export default {
 .module-com {
 	margin-bottom: 20upx;
 		background-color: #fff;
+	// 参考edit.vue的样式,增加文字和input高度
+	.line-cell {
+		.tui-title {
+			width: 210upx;
+			color: $fontColor2;
+			line-height: 80upx;
+			font-size: 30upx;
+		}
+		.tui-input {
+			width: calc(100% - 210upx);
+			font-size: 30upx;
+			min-height: 80upx;
+			padding: 20upx;
+		}
+		.tui-placeholder {
+			color: #ccc;
+			font-size: 30upx;
+			min-height: 80upx;
+			padding: 20upx;
+			display: flex;
+			align-items: center;
+		}
+		.phcolor {
+			color: #ccc;
+		}
+	}
 	.member-wrap {
 		.member-det {
 			font-size: 24upx;

+ 5 - 171
mallApp/src/pages/user/birthday.vue

@@ -1,188 +1,22 @@
 <template>
-	<div class="app-content">
-		<form @submit="formSubmit">
-			<div class="module-com input-line-wrap">
-				<tui-list-cell class="line-cell" :hover="false">
-					<div class="tui-title">手机号</div>
-					<input v-model="form.mobile" placeholder-class="phcolor" class="tui-input" name="mobile" placeholder="请输入手机号" type="number" />
-				</tui-list-cell>
-				<tui-list-cell class="line-cell code-wrap" :hover="false">
-					<div class="tui-title">验证码</div>
-					<input v-model="form.code" placeholder-class="phcolor" class="tui-input" name="code" placeholder="请输入验证码" type="number" />
-					<div class="tui-code" v-if="isSend">{{ countDown + 's' }}</div>
-					<div class="tui-code" v-else @click="getCode">获取验证码</div>
-				</tui-list-cell>
-				<tui-list-cell class="line-cell" :hover="false">
-					<div class="tui-title">姓名</div>
-					<input v-model="form.realName" placeholder-class="phcolor" class="tui-input" name="realName" placeholder="选填" type="text" />
-				</tui-list-cell>
-				<tui-list-cell class="line-cell" :hover="false">
-					<div class="tui-title">生日</div>
-					<picker mode="date" :value="form.birthday" @change="selTimeFn" class="tui-input">
-						<input v-model="form.birthday" hidden placeholder-class="phcolor" class="tui-input" name="birthday" />
-						<div v-if="form.birthday">{{ form.birthday }}</div>
-						<div class="tui-placeholder" v-else>请选择生日</div>
-					</picker>
-					<!-- <input placeholder-class="phcolor" class="tui-input" name="phone" placeholder="选填" maxlength="50" type="number" /> -->
-				</tui-list-cell>
-				<div class="btn-wrap">
-					<button class="button-com red big" formType="submit">确认</button>
-				</div>
-			</div>
-		</form>
-	</div>
-</template>
+	<view>
 
+	</view>
+</template>
 <script>
-import TuiListCell from '@/components/plugin/list-cell'
-const form = require('@/utils/formValidation.js')
-// api
-import { register } from '@/api/login'
-import { sendSms } from '@/api/common'
 export default {
-	name: 'register',
+	name: 'birthday',
 	components: {
 		TuiListCell
 	},
 	data() {
 		return {
-			form: {
-				mobile: '',
-				code: '',
-				realName: '',
-				birthday: 0
-			},
-			isSend: 0,
-			countDown: 119,
-			timer: null
 		}
 	},
-	onLoad(option) {},
+	onLoad() {},
 	methods: {
-		getCode() {
-			if (!this.form.mobile || !this.$util.checkMobile(this.form.mobile)) {
-				this.$msg('请输入正确的手机号!')
-				return false
-			}
-			this.isSend = 1
-			sendSms({
-				type: 1,
-				mobile: this.form.mobile
-			})
-				.then(res => {
-					this.beginCountDown()
-					this.$msg('发送成功!')
-				})
-				.catch(() => {
-					this.isSend = 0
-					this.$msg('发送失败!')
-				})
-		},
-		selTimeFn(e) {
-			this.form.birthday = e.detail.value
-		},
-		confirmFn() {
-			register(this.form).then(res => {
-				this.$msg('注册成功!')
-				setTimeout(() => {
-					this.$util.pageTo({
-						url: '/pages/callback/index',
-						query: {
-							pageStatus: 6
-						}
-					})
-				})
-			})
-		},
-		// 倒计时
-		beginCountDown() {
-			this.countDown = 119
-			this.timer = setInterval(() => {
-				if (this.countDown === 0) {
-					clearInterval(this.timer)
-					this.isSend = 0
-					return
-				}
-				this.countDown -= 1
-			}, 1000)
-		},
-		// 表单验证
-		formSubmit(e) {
-			// 表单规则
-			let rules = [
-				{
-					name: 'mobile',
-					rule: ['required'],
-					msg: ['请输入手机号']
-				},
-				{
-					name: 'code',
-					rule: ['required'],
-					msg: ['请输入验证码']
-				},
-				{
-					name: 'realName',
-					rule: ['required'],
-					msg: ['请输入名字']
-				},
-				{
-					name: 'birthday',
-					rule: ['required'],
-					msg: ['请选择生日']
-				}
-			]
-			// 进行表单检查
-			let formData = e.detail.value
-			let checkRes = form.validation(formData, rules)
-			// 验证通过!
-			if (!checkRes) {
-				setTimeout(() => {
-					this.confirmFn()
-				})
-			} else {
-				this.$msg(checkRes)
-			}
-		}
 	}
 }
 </script>
-
 <style lang="scss" scoped>
-	// 公共
-	.line-cell {
-		.tui-title {
-			width: 210upx;
-			color: $fontColor2;
-		}
-		.tui-input {
-			width: calc(100% - 210upx);
-			font-size: 28upx;
-		}
-		.tui-placeholder {
-			color: #ccc;
-		}
-		.phcolor {
-			color: #ccc;
-		}
-	}
-	.btn-wrap {
-		width: 90%;
-		margin: 60upx auto;
-		.button-com {
-			width: 100%;
-			margin: 0 auto;
-		}
-	}
-	.code-wrap {
-		.tui-input {
-			width: calc(100% - 410upx);
-			font-size: 28upx;
-		}
-		.tui-code {
-			width: 200upx;
-			text-align: center;
-			border-left: 1upx solid $borderColor;
-			color: $mainColor;
-		}
-	}
 </style>

+ 13 - 3
mallApp/src/pages/user/edit.vue

@@ -28,7 +28,7 @@
 <script>
 import TuiListCell from '@/components/plugin/list-cell'
 const form = require('@/utils/formValidation.js')
-import { currentInfo } from "@/api/user";
+import { currentInfo,updateInfo } from "@/api/user";
 export default {
 	name: 'edit',
 	components: {
@@ -43,7 +43,10 @@ export default {
 		}
 	},
 	onLoad() {
-
+      //返回上一页时刷新
+      let pages = getCurrentPages();
+      let prevPage = pages[ pages.length - 2 ];
+      prevPage.$vm.pageAction = {refresh:1}
 	},
 	methods: {
 		init(){
@@ -81,7 +84,14 @@ export default {
 			}
 		},
 		formSubmit(){
-
+			updateInfo(this.form).then(res=>{
+				if(res.code == 1){
+					this.$msg('已修改')
+					setTimeout(() => {
+						uni.navigateBack({})
+					}, 1000);
+				}
+			})
 		}
 	}
 }