Sfoglia il codice sorgente

Merge branch 'master' of http://git.cc-lotus.info/pointToNetwork/point-app

zs 2 anni fa
parent
commit
1b67c7efdb

+ 2 - 2
components/mobile-frame/index.vue

@@ -43,10 +43,10 @@
 					},
 					{
 						name: '分类',
-						route: 'pagesHome/market/type',
+						route: 'pages/week/index',
 						normal: require('@/static/type.png'),
 						active: require('@/static/type_1.png'),
-						type: '1'
+						type: '0'
 					},
 					{
 						name: '购物车',

+ 1 - 1
pages.json

@@ -33,7 +33,7 @@
 		{
 			"path": "pages/week/index",
 			"style": {
-				"navigationBarTitleText": "周边"
+				"navigationBarTitleText": "分类"
 			}
 		},
 		{

+ 183 - 2
pages/week/index.vue

@@ -1,6 +1,40 @@
 <template>
 	<mobile-frame :frameStyle="frameStyle" @toPath="toPath">
-		周边
+		<view class="main">
+			<view class="one">
+				<input type="text" placeholder="搜索商品" @tap="toCommon('pagesHome/market/search')" placeholder-class="placss">
+			</view>
+			<view class="two">
+				<view class="two_1">
+					<scroll-view scroll-y="true" class="scroll-view">
+						<view class="list-scroll-view">
+							<view class="list" :class="[active==index?'listActive':'']" v-for="(item,index) in typeList" :key="index" @tap="toChange(index,item)">
+								<text>{{item.label}}</text>
+							</view>
+						</view>
+					</scroll-view>
+				</view>
+				<view class="two_2">
+					<scroll-view scroll-y="true" class="scroll-view">
+						<view class="list-scroll-view">
+							<view class="list" v-for="(item,index) in list" :key="index" @tap="toCommon('pagesHome/market/search')">
+								<view class="title">
+									{{item.label}}
+								</view>
+								<view class="market">
+									<view class="marketList" v-for="(tag,indexs) in item.children" :key="indexs">
+										<image class="image" :src="tag.file&&tag.file.length>0?tag.file[0].url:''" mode=""></image>
+										<view class="name">
+											{{tag.label}}
+										</view>
+									</view>
+								</view>
+							</view>
+						</view>
+					</scroll-view>
+				</view>
+			</view>
+		</view>
 	</mobile-frame>
 </template>
 
@@ -11,10 +45,51 @@
 				frameStyle: {
 					useBar: true
 				},
+				active: '0',
+				typeList: [],
+				list: []
 			};
 		},
-		onShow: function() {},
+		onShow: function() {
+			const that = this;
+			that.searchOther();
+		},
 		methods: {
+			async searchOther() {
+				const that = this;
+				let res;
+				res = await that.$api(`/goodsTags`, 'GET', {
+					status: '0'
+				})
+				if (res.errcode == '0') {
+					that.$set(that, `typeList`, res.data);
+					if (res.total > 0) that.searchRight(res.data[0]);
+				}
+			},
+			toChange(index, e) {
+				const that = this;
+				that.$set(that, `active`, index);
+				that.searchRight(e);
+			},
+			// 查询左侧信息
+			async searchRight(e) {
+				const that = this;
+				let info = {};
+				if (e.id) info.pid = e.id;
+				const res = await that.$api(`/goodsTags/tree`, 'GET', {
+					...info
+				})
+				if (res.errcode == '0' && res.data.length > 0) {
+					that.$set(that, `list`, res.data[0].children)
+				}
+			},
+			// 公共跳转
+			toCommon(e) {
+				uni.navigateTo({
+					url: `/${e}`
+				})
+			},
+			// 菜单跳转
 			toPath(e) {
 				if (e && e.route && e.type == '0') {
 					uni.redirectTo({
@@ -31,5 +106,111 @@
 </script>
 
 <style lang="scss">
+	.main {
+		display: flex;
+		flex-direction: column;
+		width: 100vw;
+		height: 91vh;
+
+		.one {
+			padding: 2vw;
+			border: 1px solid var(--f1Color);
+
+			input {
+				background-color: var(--fFB1Color);
+				border-radius: 30px;
+				padding: 2vw;
+				color: var(--fffColor);
+				font-size: var(--font15Size);
+			}
+
+			.placss {
+				color: var(--fffColor);
+			}
+		}
+
+		.two {
+			height: 83vh;
+			display: flex;
+			flex-direction: row;
+
+			.two_1 {
+				position: relative;
+				width: 25vw;
+				background-color: #fafafa;
+				display: flex;
+				flex-direction: column;
+
+				.list {
+					text-align: center;
+					padding: 2.5vw 0;
+					border-bottom: 1px solid var(--f1Color);
+
+					text {
+						font-size: var(--font14Size);
+					}
+				}
+
+				.listActive {
+					background-color: var(--fffColor);
+				}
+			}
+
+			.two_2 {
+				padding: 2vw;
+				flex-grow: 1;
+				position: relative;
+				display: flex;
+				flex-direction: column;
+
+				.list {
+					margin: 0 0 2vw 0;
+					padding: 2vw;
+
+					.title {
+						font-size: var(--font16Size);
+						margin: 0 0 2vw 0;
+					}
+
+					.market {
+						display: flex;
+						flex-direction: row;
+						flex-wrap: wrap;
+
+						.marketList {
+							text-align: center;
+							margin: 0 2vw 2vw 0;
+							width: 22vw;
+
+							.image {
+								width: 100%;
+								height: 15vw;
+							}
+
+							.name {
+								font-size: var(--font14Size);
+							}
+						}
 
+						.marketList:nth-child(3n) {
+							margin: 0 0 2vw 0;
+						}
+					}
+				}
+			}
+		}
+	}
+
+	.scroll-view {
+		position: absolute;
+		top: 0;
+		left: 0;
+		right: 0;
+		bottom: 0;
+
+		.list-scroll-view {
+			display: flex;
+			flex-direction: column;
+		}
+	}
 </style>

+ 2 - 2
pagesMy/account/bindEmail.vue

@@ -4,7 +4,7 @@
 			<view class="one">
 				<uni-forms ref="form" :modelValue="form" :rules="rules" label-width="auto">
 					<uni-forms-item label="电子邮箱" name="email">
-						<uni-easyinput type="number" v-model="form.email" placeholder="请输入电子邮箱" />
+						<uni-easyinput type="text" v-model="form.email" placeholder="请输入电子邮箱" />
 					</uni-forms-item>
 					<uni-forms-item label="邮箱验证码" name="code">
 						<view class="yzm">
@@ -12,7 +12,7 @@
 								<uni-easyinput type="text" v-model="form.code" placeholder="请输入您的邮箱验证码" />
 							</view>
 							<view class="r">
-								<button type="default" size="mini" @tap="sendCount">{{time_count==0?'发送验证码':time_count}}</button>
+								<button type="default" size="mini" @tap="sendCount">{{time_count==0?'验证码':time_count}}</button>
 							</view>
 						</view>
 					</uni-forms-item>

+ 1 - 1
pagesMy/account/bindPhone.vue

@@ -12,7 +12,7 @@
 								<uni-easyinput type="text" v-model="form.code" placeholder="请输入您的手机验证码" />
 							</view>
 							<view class="r">
-								<button type="default" size="mini" @tap="sendCount">{{time_count==0?'发送验证码':time_count}}</button>
+								<button type="default" size="mini" @tap="sendCount">{{time_count==0?'验证码':time_count}}</button>
 							</view>
 						</view>
 					</uni-forms-item>

+ 11 - 7
pagesMy/account/index.vue

@@ -12,7 +12,7 @@
 			</view>
 			<view class="one" @click="toCommon('/pagesMy/account/bindPhone')">
 				<view class="other">
-					<view class="title">{{phone.name}} <text>已绑定{{phone.phone}}</text> </view>
+					<view class="title">{{phone.name}} <text>{{phone.phone?phone.phone:'未绑定'}}</text> </view>
 					<view class="titles">{{phone.content}}</view>
 				</view>
 				<view class="btn">
@@ -21,7 +21,7 @@
 			</view>
 			<view class="one" @click="toCommon('/pagesMy/account/bindEmail')">
 				<view class="other">
-					<view class="title">{{email.name}}</view>
+					<view class="title">{{email.name}}<text>{{email.email?email.email:'未绑定'}}</text></view>
 					<view class="titles">{{email.content}}</view>
 				</view>
 				<view class="btn">
@@ -59,7 +59,8 @@
 				},
 				email: {
 					name: '绑定邮箱',
-					content: '未绑定邮箱,请及时绑定'
+					content: '未绑定邮箱,请及时绑定',
+					email: ''
 				},
 				info: {
 					name: '修改个人信息',
@@ -82,15 +83,18 @@
 						if (user) {
 							const arr = await that.$api(`/user/${user.id}`, 'GET');
 							if (arr.errcode == '0') {
-								if (arr.data && arr.data.phone) {
-									var phone = arr.data.phone.replace(/(\d{3})\d{4}(\d{4})/, '$1****$2');
+								let data=arr.data;
+								if (data && data.phone) {
+									var phone = data.phone.replace(/(\d{3})\d{4}(\d{4})/, '$1****$2');
 									that.$set(that.phone, `phone`, phone)
 								}
+								if (data && data.email) {
+									that.$set(that.email, `email`, arr.data.email)
+								}
 							} else {
 								uni.showToast({
 									title: arr.errmsg,
-									icon: 'error',
-									duration: 2000
+									icon: 'none',
 								});
 							}
 						}