Explorar el Código

修改我的页面

zs hace 1 año
padre
commit
1144255cd3

+ 3 - 3
config.js

@@ -15,17 +15,17 @@ export default {
 	system: system,
 	share: {},
 	menuList: [{
-			icon: "icon-fabu",
+			icon: "icon-yonghuxinxi",
 			title: "基本信息",
 			route: "pagesMy/basic/index",
 		},
 		{
-			icon: "icon-youhuijuan",
+			icon: "icon-qunzu",
 			title: "群组信息",
 			route: "pagesMy/group/index",
 		},
 		{
-			icon: "icon-7yijianfankui",
+			icon: "icon-Detailsoftheproblem",
 			title: "答复记录",
 			route: "pagesMy/answer/index",
 		}

+ 1 - 5
pages.json

@@ -30,11 +30,7 @@
 		{
 			"path": "pages/my/index",
 			"style": {
-				"navigationBarTitleText": "个人中心",
-				"navigationStyle": "custom",
-				"app-plus": {
-					"titleNView": false //禁用原生导航栏  
-				}
+				"navigationBarTitleText": "个人中心"
 			}
 		}
 	],

+ 20 - 6
pages/my/index.vue

@@ -4,7 +4,10 @@
 			<view class="one_1">
 				<image class="image" :src="user.logo&&user.logo.length>0?user.logo[0].url:'../../static/doctor.jpg'"
 					mode=""></image>
-				<text>{{user.name||'微信用户'}}</text>
+				<view class="right">
+					<text class="name">{{user.name||'微信用户'}}</text>
+					<text class="phone">电话:{{user.phone||'暂无'}}</text>
+				</view>
 			</view>
 		</view>
 		<view class="two">
@@ -98,7 +101,6 @@
 				padding: 15vw 5vw;
 				display: flex;
 				align-items: center;
-				font-size: var(--font18Size);
 
 				.image {
 					width: 15vw;
@@ -106,6 +108,21 @@
 					border-radius: 2vw;
 					margin: 0 2vw;
 				}
+
+				.right {
+					display: flex;
+					flex-direction: column;
+
+					.name {
+						font-size: var(--font18Size);
+					}
+
+					.phone {
+						margin: 1vw 0 0 0;
+						font-size: var(--font14Size);
+						color: var(--f99Color);
+					}
+				}
 			}
 		}
 
@@ -126,7 +143,6 @@
 				.left {
 					display: flex;
 					align-items: center;
-					font-size: var(--font12Size);
 
 					.icon {
 						padding: 0 1vw 0 0;
@@ -139,13 +155,11 @@
 
 					.title {
 						display: inline-block;
-						font-size: var(--font12Size);
+						font-size: var(--font14Size);
 					}
 				}
 
 				.right {
-					display: flex;
-					align-items: center;
 					font-size: var(--font12Size);
 					color: var(--f99Color);
 				}

+ 197 - 4
pagesMy/answer/index.vue

@@ -1,22 +1,215 @@
 <template>
 	<view class="main">
-		答复记录
+		<view class="one">
+			<input type="text" v-model="searchInfo.title" @input="toInput" placeholder="搜索标题">
+		</view>
+		<view class="two">
+			<scroll-view scroll-y="true" class="scroll-view" @scrolltolower="toPage" @scroll="toScroll">
+				<view class="list-scroll-view">
+					<view class="list" v-for="(item, index) in list" :key="index" @tap="toInfo(item)">
+						1111
+					</view>
+					<view class="is_bottom" v-if="is_bottom">
+						<text>{{config.bottom_title||'到底了!'}}</text>
+					</view>
+				</view>
+			</scroll-view>
+		</view>
 	</view>
 </template>
 
 <script>
 	export default {
 		data() {
-			return {}
+			return {
+				config: {},
+				user: {},
+				list: [],
+				total: 0,
+				skip: 0,
+				limit: 6,
+				page: 0,
+				// 数据是否触底
+				is_bottom: false,
+				scrollTop: 0,
+			}
+		},
+		onLoad: async function(e) {
+			const that = this;
+			that.searchToken();
+			that.searchConfig();
+		},
+		onShow: async function() {
+			const that = this;
+			// that.clearPage();
+			// await that.search();
+		},
+		onPullDownRefresh: async function() {
+			const that = this;
+			// that.clearPage();
+			// await that.search();
+			uni.stopPullDownRefresh();
 		},
 		methods: {
-
+			searchToken() {
+				const that = this;
+				try {
+					const res = uni.getStorageSync('token');
+					if (res) that.$set(that, `user`, res);
+				} catch (e) {
+					uni.showToast({
+						title: err.errmsg,
+						icon: 'error',
+						duration: 2000
+					});
+				}
+			},
+			searchConfig() {
+				const that = this;
+				try {
+					const res = uni.getStorageSync('config');
+					if (res) that.$set(that, `config`, res);
+				} catch (e) {
+					uni.showToast({
+						title: err.errmsg,
+						icon: 'error',
+						duration: 2000
+					});
+				}
+			},
+			async search() {
+				const that = this;
+				let info = {
+					skip: that.skip,
+					limit: that.limit,
+					is_use: '0'
+				}
+				const res = await that.$api(`/article`, 'GET', {
+					...info,
+					...that.searchInfo
+				})
+				if (res.errcode == '0') {
+					let list = [...that.list, ...res.data];
+					that.$set(that, `list`, list)
+					that.$set(that, `total`, res.total)
+				} else {
+					uni.showToast({
+						title: res.errmsg,
+					});
+				}
+			},
+			// 输入框
+			toInput(e) {
+				const that = this;
+				if (that.searchInfo.title) that.$set(that.searchInfo, `title`, e.detail.value)
+				else that.$set(that, `searchInfo`, {})
+				that.clearPage();
+				that.search();
+			},
+			// 查看详情
+			toInfo(item) {
+				uni.navigateTo({
+					url: `/pagesScience/science/index?id=${item.id||item._id}`
+				})
+			},
+			// 分页
+			toPage(e) {
+				const that = this;
+				let list = that.list;
+				let limit = that.limit;
+				if (that.total > list.length) {
+					uni.showLoading({
+						title: '加载中',
+						mask: true
+					})
+					let page = that.page + 1;
+					that.$set(that, `page`, page)
+					let skip = page * limit;
+					that.$set(that, `skip`, skip)
+					that.search();
+					uni.hideLoading();
+				} else that.$set(that, `is_bottom`, true)
+			},
+			toScroll(e) {
+				const that = this;
+				let up = that.scrollTop;
+				that.$set(that, `scrollTop`, e.detail.scrollTop);
+				let num = Math.sign(up - e.detail.scrollTop);
+				if (num == 1) that.$set(that, `is_bottom`, false);
+			},
+			// 清空列表
+			clearPage() {
+				const that = this;
+				that.$set(that, `list`, [])
+				that.$set(that, `skip`, 0)
+				that.$set(that, `limit`, 6)
+				that.$set(that, `page`, 0)
+			}
 		}
 	}
 </script>
 
 <style lang="scss" scoped>
 	.main {
-		padding: 2vw;
+		display: flex;
+		flex-direction: column;
+		width: 100vw;
+		height: 100vh;
+	
+		.one {
+			display: flex;
+			justify-content: center;
+			align-items: center;
+			padding: 2vw;
+	
+			input {
+				width: 100%;
+				padding: 2vw;
+				background-color: var(--f1Color);
+				font-size: var(--font14Size);
+				border-radius: 5px;
+			}
+		}
+	
+		.two {
+			position: relative;
+			flex-grow: 1;
+			background-color: var(--f9Color);
+			margin: 2vw 0 0 0;
+	
+			.list {
+				display: flex;
+				background-color: var(--mainColor);
+				border: 1px solid var(--f5Color);
+				padding: 2vw;
+				margin: 2vw 2vw 0 2vw;
+				border-radius: 5px;
+			}
+		}
+	}
+	
+	.scroll-view {
+		position: absolute;
+		top: 0;
+		left: 0;
+		right: 0;
+		bottom: 0;
+	
+		.list-scroll-view {
+			display: flex;
+			flex-direction: column;
+		}
+	}
+	
+	.is_bottom {
+		width: 100%;
+		text-align: center;
+	
+		text {
+			padding: 2vw 0;
+			display: inline-block;
+			color: var(--f85Color);
+			font-size: var(--font14Size);
+		}
 	}
 </style>

+ 197 - 4
pagesMy/group/index.vue

@@ -1,22 +1,215 @@
 <template>
 	<view class="main">
-		群组信息
+		<view class="one">
+			<input type="text" v-model="searchInfo.name" @input="toInput" placeholder="搜索群组名称">
+		</view>
+		<view class="two">
+			<scroll-view scroll-y="true" class="scroll-view" @scrolltolower="toPage" @scroll="toScroll">
+				<view class="list-scroll-view">
+					<view class="list" v-for="(item, index) in list" :key="index" @tap="toInfo(item)">
+						1111
+					</view>
+					<view class="is_bottom" v-if="is_bottom">
+						<text>{{config.bottom_title||'到底了!'}}</text>
+					</view>
+				</view>
+			</scroll-view>
+		</view>
 	</view>
 </template>
 
 <script>
 	export default {
 		data() {
-			return {}
+			return {
+				config: {},
+				user: {},
+				list: [],
+				total: 0,
+				skip: 0,
+				limit: 6,
+				page: 0,
+				// 数据是否触底
+				is_bottom: false,
+				scrollTop: 0,
+			}
+		},
+		onLoad: async function(e) {
+			const that = this;
+			that.searchToken();
+			that.searchConfig();
+		},
+		onShow: async function() {
+			const that = this;
+			that.clearPage();
+			await that.search();
+		},
+		onPullDownRefresh: async function() {
+			const that = this;
+			that.clearPage();
+			await that.search();
+			uni.stopPullDownRefresh();
 		},
 		methods: {
-
+			searchToken() {
+				const that = this;
+				try {
+					const res = uni.getStorageSync('token');
+					if (res) that.$set(that, `user`, res);
+				} catch (e) {
+					uni.showToast({
+						title: err.errmsg,
+						icon: 'error',
+						duration: 2000
+					});
+				}
+			},
+			searchConfig() {
+				const that = this;
+				try {
+					const res = uni.getStorageSync('config');
+					if (res) that.$set(that, `config`, res);
+				} catch (e) {
+					uni.showToast({
+						title: err.errmsg,
+						icon: 'error',
+						duration: 2000
+					});
+				}
+			},
+			async search() {
+				const that = this;
+				let info = {
+					skip: that.skip,
+					limit: that.limit,
+					is_use: '0'
+				}
+				const res = await that.$api(`/group`, 'GET', {
+					...info,
+					...that.searchInfo
+				})
+				if (res.errcode == '0') {
+					let list = [...that.list, ...res.data];
+					that.$set(that, `list`, list)
+					that.$set(that, `total`, res.total)
+				} else {
+					uni.showToast({
+						title: res.errmsg,
+					});
+				}
+			},
+			// 输入框
+			toInput(e) {
+				const that = this;
+				if (that.searchInfo.name) that.$set(that.searchInfo, `name`, e.detail.value)
+				else that.$set(that, `searchInfo`, {})
+				that.clearPage();
+				that.search();
+			},
+			// 查看详情
+			toInfo(item) {
+				uni.navigateTo({
+					url: `/pagesScience/science/index?id=${item.id||item._id}`
+				})
+			},
+			// 分页
+			toPage(e) {
+				const that = this;
+				let list = that.list;
+				let limit = that.limit;
+				if (that.total > list.length) {
+					uni.showLoading({
+						title: '加载中',
+						mask: true
+					})
+					let page = that.page + 1;
+					that.$set(that, `page`, page)
+					let skip = page * limit;
+					that.$set(that, `skip`, skip)
+					that.search();
+					uni.hideLoading();
+				} else that.$set(that, `is_bottom`, true)
+			},
+			toScroll(e) {
+				const that = this;
+				let up = that.scrollTop;
+				that.$set(that, `scrollTop`, e.detail.scrollTop);
+				let num = Math.sign(up - e.detail.scrollTop);
+				if (num == 1) that.$set(that, `is_bottom`, false);
+			},
+			// 清空列表
+			clearPage() {
+				const that = this;
+				that.$set(that, `list`, [])
+				that.$set(that, `skip`, 0)
+				that.$set(that, `limit`, 6)
+				that.$set(that, `page`, 0)
+			}
 		}
 	}
 </script>
 
 <style lang="scss" scoped>
 	.main {
-		padding: 2vw;
+		display: flex;
+		flex-direction: column;
+		width: 100vw;
+		height: 100vh;
+	
+		.one {
+			display: flex;
+			justify-content: center;
+			align-items: center;
+			padding: 2vw;
+	
+			input {
+				width: 100%;
+				padding: 2vw;
+				background-color: var(--f1Color);
+				font-size: var(--font14Size);
+				border-radius: 5px;
+			}
+		}
+	
+		.two {
+			position: relative;
+			flex-grow: 1;
+			background-color: var(--f9Color);
+			margin: 2vw 0 0 0;
+	
+			.list {
+				display: flex;
+				background-color: var(--mainColor);
+				border: 1px solid var(--f5Color);
+				padding: 2vw;
+				margin: 2vw 2vw 0 2vw;
+				border-radius: 5px;
+			}
+		}
+	}
+	
+	.scroll-view {
+		position: absolute;
+		top: 0;
+		left: 0;
+		right: 0;
+		bottom: 0;
+	
+		.list-scroll-view {
+			display: flex;
+			flex-direction: column;
+		}
+	}
+	
+	.is_bottom {
+		width: 100%;
+		text-align: center;
+	
+		text {
+			padding: 2vw 0;
+			display: inline-block;
+			color: var(--f85Color);
+			font-size: var(--font14Size);
+		}
 	}
 </style>

La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 1 - 1
unpackage/dist/dev/.sourcemap/mp-weixin/common/vendor.js.map


La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 1 - 1
unpackage/dist/dev/.sourcemap/mp-weixin/pages/my/index.js.map


La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 1 - 1
unpackage/dist/dev/.sourcemap/mp-weixin/pagesMy/answer/index.js.map


La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 1 - 1
unpackage/dist/dev/.sourcemap/mp-weixin/pagesMy/group/index.js.map


+ 3 - 3
unpackage/dist/dev/mp-weixin/common/vendor.js

@@ -11152,15 +11152,15 @@ var _default = {
   system: system,
   share: {},
   menuList: [{
-    icon: "icon-fabu",
+    icon: "icon-yonghuxinxi",
     title: "基本信息",
     route: "pagesMy/basic/index"
   }, {
-    icon: "icon-youhuijuan",
+    icon: "icon-qunzu",
     title: "群组信息",
     route: "pagesMy/group/index"
   }, {
-    icon: "icon-7yijianfankui",
+    icon: "icon-Detailsoftheproblem",
     title: "答复记录",
     route: "pagesMy/answer/index"
   }],

+ 3 - 0
unpackage/dist/dev/mp-weixin/pages/my/index.js

@@ -178,6 +178,9 @@ var _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(/*! @babel/r
 //
 //
 //
+//
+//
+//
 var _default = {
   data: function data() {
     return {

+ 0 - 1
unpackage/dist/dev/mp-weixin/pages/my/index.json

@@ -1,5 +1,4 @@
 {
   "navigationBarTitleText": "个人中心",
-  "navigationStyle": "custom",
   "usingComponents": {}
 }

La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 1 - 1
unpackage/dist/dev/mp-weixin/pages/my/index.wxml


+ 13 - 5
unpackage/dist/dev/mp-weixin/pages/my/index.wxss

@@ -12,7 +12,6 @@
   padding: 15vw 5vw;
   display: flex;
   align-items: center;
-  font-size: var(--font18Size);
 }
 .main .one .one_1 .image.data-v-4dcceeb0 {
   width: 15vw;
@@ -20,6 +19,18 @@
   border-radius: 2vw;
   margin: 0 2vw;
 }
+.main .one .one_1 .right.data-v-4dcceeb0 {
+  display: flex;
+  flex-direction: column;
+}
+.main .one .one_1 .right .name.data-v-4dcceeb0 {
+  font-size: var(--font18Size);
+}
+.main .one .one_1 .right .phone.data-v-4dcceeb0 {
+  margin: 1vw 0 0 0;
+  font-size: var(--font14Size);
+  color: var(--f99Color);
+}
 .main .two.data-v-4dcceeb0 {
   display: flex;
   flex-direction: column;
@@ -37,7 +48,6 @@
 .main .two .list .left.data-v-4dcceeb0 {
   display: flex;
   align-items: center;
-  font-size: var(--font12Size);
 }
 .main .two .list .left .icon.data-v-4dcceeb0 {
   padding: 0 1vw 0 0;
@@ -48,11 +58,9 @@
 }
 .main .two .list .left .title.data-v-4dcceeb0 {
   display: inline-block;
-  font-size: var(--font12Size);
+  font-size: var(--font14Size);
 }
 .main .two .list .right.data-v-4dcceeb0 {
-  display: flex;
-  align-items: center;
   font-size: var(--font12Size);
   color: var(--f99Color);
 }

La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 209 - 3
unpackage/dist/dev/mp-weixin/pagesMy/answer/index.js


La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 1 - 1
unpackage/dist/dev/mp-weixin/pagesMy/answer/index.wxml


+ 51 - 0
unpackage/dist/dev/mp-weixin/pagesMy/answer/index.wxss

@@ -2,6 +2,57 @@
 /* 水平间距 */
 /* 水平间距 */
 .main.data-v-6be376ee {
+  display: flex;
+  flex-direction: column;
+  width: 100vw;
+  height: 100vh;
+}
+.main .one.data-v-6be376ee {
+  display: flex;
+  justify-content: center;
+  align-items: center;
+  padding: 2vw;
+}
+.main .one input.data-v-6be376ee {
+  width: 100%;
+  padding: 2vw;
+  background-color: var(--f1Color);
+  font-size: var(--font14Size);
+  border-radius: 5px;
+}
+.main .two.data-v-6be376ee {
+  position: relative;
+  flex-grow: 1;
+  background-color: var(--f9Color);
+  margin: 2vw 0 0 0;
+}
+.main .two .list.data-v-6be376ee {
+  display: flex;
+  background-color: var(--mainColor);
+  border: 1px solid var(--f5Color);
   padding: 2vw;
+  margin: 2vw 2vw 0 2vw;
+  border-radius: 5px;
+}
+.scroll-view.data-v-6be376ee {
+  position: absolute;
+  top: 0;
+  left: 0;
+  right: 0;
+  bottom: 0;
+}
+.scroll-view .list-scroll-view.data-v-6be376ee {
+  display: flex;
+  flex-direction: column;
+}
+.is_bottom.data-v-6be376ee {
+  width: 100%;
+  text-align: center;
+}
+.is_bottom text.data-v-6be376ee {
+  padding: 2vw 0;
+  display: inline-block;
+  color: var(--f85Color);
+  font-size: var(--font14Size);
 }
 

La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 214 - 3
unpackage/dist/dev/mp-weixin/pagesMy/group/index.js


La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 1 - 1
unpackage/dist/dev/mp-weixin/pagesMy/group/index.wxml


+ 51 - 0
unpackage/dist/dev/mp-weixin/pagesMy/group/index.wxss

@@ -2,6 +2,57 @@
 /* 水平间距 */
 /* 水平间距 */
 .main.data-v-1761c2b6 {
+  display: flex;
+  flex-direction: column;
+  width: 100vw;
+  height: 100vh;
+}
+.main .one.data-v-1761c2b6 {
+  display: flex;
+  justify-content: center;
+  align-items: center;
+  padding: 2vw;
+}
+.main .one input.data-v-1761c2b6 {
+  width: 100%;
+  padding: 2vw;
+  background-color: var(--f1Color);
+  font-size: var(--font14Size);
+  border-radius: 5px;
+}
+.main .two.data-v-1761c2b6 {
+  position: relative;
+  flex-grow: 1;
+  background-color: var(--f9Color);
+  margin: 2vw 0 0 0;
+}
+.main .two .list.data-v-1761c2b6 {
+  display: flex;
+  background-color: var(--mainColor);
+  border: 1px solid var(--f5Color);
   padding: 2vw;
+  margin: 2vw 2vw 0 2vw;
+  border-radius: 5px;
+}
+.scroll-view.data-v-1761c2b6 {
+  position: absolute;
+  top: 0;
+  left: 0;
+  right: 0;
+  bottom: 0;
+}
+.scroll-view .list-scroll-view.data-v-1761c2b6 {
+  display: flex;
+  flex-direction: column;
+}
+.is_bottom.data-v-1761c2b6 {
+  width: 100%;
+  text-align: center;
+}
+.is_bottom text.data-v-1761c2b6 {
+  padding: 2vw 0;
+  display: inline-block;
+  color: var(--f85Color);
+  font-size: var(--font14Size);
 }