소스 검색

新增消息

xiaohaizhao 2 년 전
부모
커밋
e658e8ff2e
8개의 변경된 파일246개의 추가작업 그리고 71개의 파일을 삭제
  1. 3 0
      pages/index/home/index.js
  2. 102 57
      pages/index/home/index.scss
  3. 10 1
      pages/index/home/index.wxml
  4. 46 3
      pages/index/index.js
  5. 1 1
      pages/index/index.json
  6. 7 7
      pages/index/index.wxml
  7. 64 1
      pages/login/retrievePassword.scss
  8. 13 1
      project.private.config.json

+ 3 - 0
pages/index/home/index.js

@@ -15,6 +15,9 @@ Component({
 				item
 			} = e.currentTarget.dataset;
 			if (it.PageCur) this.triggerEvent("cutBar", it.PageCur)
+		},
+		toMsg(){
+			this.triggerEvent("cutBar", 'Message')
 		}
 	}
 })

+ 102 - 57
pages/index/home/index.scss

@@ -1,59 +1,104 @@
-
 .grld {
-    width: 100vw;
-    background-color: #fff;
-    box-sizing: border-box;
-    padding-top: 30rpx;
-
-    .group {
-        margin-bottom: 30rpx;
-
-        .label {
-            height: 36rpx;
-            font-size: 30rpx;
-            font-family: AppleSystemUIFont-Bold, AppleSystemUIFont;
-            font-weight: bold;
-            color: #333333;
-            margin-bottom: 10rpx;
-
-            text {
-                margin: 0 20rpx 0 30rpx;
-            }
-        }
-
-        .main {
-            display: flex;
-            flex-wrap: wrap;
-
-            .item {
-                display: flex;
-                flex-direction: column;
-                align-items: center;
-                padding: 20rpx 0;
-                width: 20%;
-                border-radius: 16rpx;
-
-                .icon-box {
-                    width: 80rpx;
-                    border-radius: 16rpx;
-                    line-height: 80rpx;
-                    text-align: center;
-
-                    text {
-                        font-size: 40rpx;
-                    }
-                }
-
-                .name {
-                    width: 80%;
-                    line-height: 30rpx;
-                    font-size: 24rpx;
-                    font-family: AppleSystemUIFont-Regular, AppleSystemUIFont;
-                    color: #333333;
-                    margin-top: 16rpx;
-                    text-align: center;
-                }
-            }
-        }
-    }
+	width: 100vw;
+	background-color: #fff;
+	box-sizing: border-box;
+	padding-top: 30rpx;
+
+	.group {
+		margin-bottom: 30rpx;
+
+		.label {
+			height: 36rpx;
+			font-size: 30rpx;
+			font-family: AppleSystemUIFont-Bold, AppleSystemUIFont;
+			font-weight: bold;
+			color: #333333;
+			margin-bottom: 10rpx;
+
+			text {
+				margin: 0 20rpx 0 30rpx;
+			}
+		}
+
+		.main {
+			display: flex;
+			flex-wrap: wrap;
+
+			.item {
+				display: flex;
+				flex-direction: column;
+				align-items: center;
+				padding: 20rpx 0;
+				width: 20%;
+				border-radius: 16rpx;
+
+				.icon-box {
+					width: 80rpx;
+					border-radius: 16rpx;
+					line-height: 80rpx;
+					text-align: center;
+
+					text {
+						font-size: 40rpx;
+					}
+				}
+
+				.name {
+					width: 80%;
+					line-height: 30rpx;
+					font-size: 24rpx;
+					font-family: AppleSystemUIFont-Regular, AppleSystemUIFont;
+					color: #333333;
+					margin-top: 16rpx;
+					text-align: center;
+				}
+			}
+		}
+	}
+}
+
+.msg-box {
+	width: 690rpx;
+	background-color: #fff;
+	margin: 20rpx auto;
+	border-radius: 16rpx;
+	box-sizing: border-box;
+	padding-bottom: 10rpx;
+
+	>.title {
+		display: flex;
+		justify-content: space-between;
+		align-items: center;
+		padding: 20rpx 30rpx;
+		border-bottom: 1px solid #999;
+		font-weight: 600;
+		margin-bottom: 10rpx;
+		text {
+			font-weight: normal;
+			font-size: 24rpx;
+			color: #999;
+		}
+	}
+
+	.msg-mian {
+		padding: 18rpx 30rpx;
+
+		.name {
+			font-size: 26rpx;
+			color: #000;
+
+			text {
+				margin-left: 10rpx;
+				font-size: 20rpx;
+				color: #999;
+				font-weight: normal;
+			}
+		}
+
+		.message{
+			margin-top: 10rpx;
+			font-size: 24rpx;
+		}
+	}
+
 }

+ 10 - 1
pages/index/home/index.wxml

@@ -20,6 +20,15 @@
 			</view>
 		</block>
 	</view>
-	<MsgList list="{{msgList}}" />
+	<view class="msg-box">
+		<view class="title">
+			最新消息
+			<text bindtap="toMsg">查看全部 ></text>
+		</view>
+		<navigator class="msg-mian" url="/pages/index/message/detail?id={{item.messageid}}" wx:for="{{msgList}}" wx:key="messageid">
+			<view class="name">{{item.title}}<text>{{item.createdate}}</text></view>
+			<view class="message line-1">{{item.message}}</view>
+		</navigator>
+	</view>
 	<view style="height: 200rpx;" />
 </Yl_ListBox>

+ 46 - 3
pages/index/index.js

@@ -6,6 +6,7 @@ Page({
 	data: {
 		PageCur: 'Home',
 		collectCount: "", //购物车商品数量
+		msgList: []
 	},
 	onLoad(options) {
 		if (options.PageCur) this.setData({
@@ -13,7 +14,9 @@ Page({
 		})
 		this.refreshData();
 		this.getCollectCount();
+		this.updateMsgCount();
 		getApp().globalData.getCollectCount = this.getCollectCount.bind(this);
+		getApp().globalData.socketCallback = this.updateMsgCount.bind(this);
 	},
 	/**
 	 * 更新站点信息
@@ -37,7 +40,7 @@ Page({
 					icon: "work-shangcheng"
 				}, {
 					name: "销售订单",
-					PageCur: "OrderForm",
+					path: "/packageA/orderForm/index",
 					icon: "work-dingdan"
 				}, {
 					name: "账户",
@@ -145,6 +148,8 @@ Page({
 				bannerList: banner ? banner.ads : []
 			});
 			pageInit.Home = true;
+      page.selectComponent("#ListBox").setHeight(".head", page);
+
 		} else {
 			setTimeout(this.refreshData, 10);
 			return;
@@ -167,13 +172,51 @@ Page({
 			return res.data.num;
 		});
 	},
+	/* 更新消息数量 */
+	updateMsgCount() {
+		pageInit.Message = false;
+		_Http.basic({
+			"classname": "system.message.Message",
+			"method": "unReadMessageCount",
+			"content": {
+				nocache: true
+			}
+		}, false).then(res => {
+			console.log('信息数量', res)
+			if (res.msg != '成功') return;
+			let fcount = res.data.fcount > 99 ? '99+' : res.data.fcount;
+			if (res.data.fcount == 0) fcount = "";
+			this.setData({
+				fcount
+			})
+		});
+
+		_Http.basic({
+			"classname": "system.message.Message",
+			"method": "queryMessage",
+			content: {
+				nocache: true,
+				pageNumber: 1,
+				pageSize: 3,
+				pageTotal: 1,
+				type: "",
+				where: {}
+			},
+		}).then(res => {
+			if (res.msg != '成功') return;
+			this.selectComponent("#Home").setData({
+				msgList: res.data
+			})
+		})
+	},
 	/** 
 	 * 切换页面
 	 */
 	NavChange(e) {
 		this.cutBar({
 			detail: e.currentTarget.dataset.cur
-		})
+		});
+		if (!getApp().globalData.socketEstablish) getApp().initSocket();
 	},
 	/** 
 	 * 切换bar
@@ -189,5 +232,5 @@ Page({
 		this.setData({
 			PageCur: detail
 		})
-	}
+	},
 })

+ 1 - 1
pages/index/index.json

@@ -5,7 +5,7 @@
 		"Collect": "./collect/index",
 		"UserCenter": "./userCenter",
 		"Market": "./market/index",
-		"OrderForm": "./orderForm/index"
+		"Message": "./message/index"
 	},
 	"navigationStyle": "custom"
 }

+ 7 - 7
pages/index/index.wxml

@@ -4,8 +4,8 @@
 <view hidden="{{PageCur!='Home'}}">
 	<Home id='Home' bind:cutBar="cutBar" />
 </view>
-<view hidden="{{PageCur!='OrderForm'}}">
-	<OrderForm id='OrderForm' />
+<view hidden="{{PageCur!='Message'}}">
+	<Message id='Message' />
 </view>
 <view hidden="{{PageCur!='Market'}}">
 	<Market id='Market' />
@@ -16,14 +16,15 @@
 <view hidden="{{PageCur!='UserCenter'}}">
 	<UserCenter id='UserCenter' />
 </view>
-
 <view class="cu-bar tabbar bg-white foot">
 	<view class="action {{PageCur=='Home'?'text-blue':'text-gray'}}" bindtap="NavChange" data-cur="Home">
 		<view class="cuIcon-homefill"></view>
 		首页
 	</view>
-	<view class="action {{PageCur=='OrderForm'?'text-blue':'text-gray'}}" bindtap="NavChange" data-cur="OrderForm">
-		<view class="cuIcon-punch"></view> 销售订单
+	<view class="action {{PageCur=='Message'?'text-blue':'text-gray'}}" bindtap="NavChange" data-cur="Message">
+		<view class="cuIcon-comment">
+			<view class="cu-tag badge" wx:if="{{fcount}}">{{fcount}}</view>
+		</view> 消息
 	</view>
 	<view class="action {{PageCur=='Market'?'text-blue':'text-gray'}} add-action" bindtap="NavChange" data-cur="Market">
 		<button class="cu-btn cuIcon-shopfill bg-blue shadow"></button>
@@ -39,5 +40,4 @@
 		<view class="cuIcon-my"></view>
 		我的
 	</view>
-</view>
-<!-- calendar -->
+</view>

+ 64 - 1
pages/login/retrievePassword.scss

@@ -1 +1,64 @@
-@import "../../pages/tabbar/mine/changePassword/index.scss";
+.input-field {
+	width: 690rpx;
+	background-color: #fff;
+	box-sizing: border-box;
+	border-radius: 16rpx;
+	display: flex;
+	position: relative;
+	padding: 26rpx 20rpx 24rpx 30rpx;
+	margin: 20rpx auto;
+
+	.icon-box {
+			width: 40rpx;
+			height: 40rpx;
+			margin-right: 50rpx;
+
+			.iconfont {
+					font-size: 40rpx;
+					color: var(--assist);
+			}
+	}
+
+	.input {
+			flex: 1;
+			font-size: 28rpx;
+			font-family: PingFang SC-Regular, PingFang SC;
+			color: #333333;
+			margin-top: -5rpx;
+	}
+
+	.auth-code {
+			width: 180rpx;
+			height: 40rpx;
+			line-height: 40rpx;
+			text-align: center;
+			flex-shrink: 0;
+			font-size: 28rpx;
+			font-family: PingFang SC-Regular, PingFang SC;
+			color: #3874F6;
+			border-left: 1rpx solid #EEE;
+	}
+
+	.errmsg {
+			font-size: 24rpx;
+			font-family: PingFang SC-Regular, PingFang SC;
+			color: #FF3B30;
+
+			.iconfont {
+					padding-left: 10rpx;
+					color: #BBBBBB;
+			}
+	}
+}
+
+.but-style {
+	width: 500rpx;
+	height: 90rpx;
+	background: #3874F6 !important;
+	border-radius: 45rpx !important;
+	opacity: 0.85;
+	font-size: 28rpx;
+	font-family: PingFang SC-Bold, PingFang SC;
+	font-weight: bold;
+	color: #FFFFFF !important;
+}

+ 13 - 1
project.private.config.json

@@ -6,5 +6,17 @@
     "urlCheck": false
   },
   "libVersion": "2.25.3",
-  "condition": {}
+  "condition": {
+    "miniprogram": {
+      "list": [
+        {
+          "name": "",
+          "pathName": "pages/index/index",
+          "query": "",
+          "launchMode": "default",
+          "scene": null
+        }
+      ]
+    }
+  }
 }