From 39924c310ef7c5b936a5cbd71ec96b144ef133f7 Mon Sep 17 00:00:00 2001 From: litian <C21AF165> Date: 星期四, 29 二月 2024 18:32:36 +0800 Subject: [PATCH] 个人中心,首页 --- pages/home/home.js | 12 pages/testLogin/index.wxml | 8 pages/testLogin/index.js | 132 +++++++++++ pages/personalCenter/components/user-center-card/index.wxml | 5 pages/personalCenter/components/user-center-card/index.wxss | 14 + pages/personalCenter/index.wxml | 119 +++++---- pages/personalCenter/index.wxss | 26 ++ pages/personalCenter/myMassage/index.wxss | 60 +++++ pages/home/home.wxml | 6 pages/personalCenter/index.js | 19 + pages/personalCenter/myMassage/massageDetail/index.wxml | 8 custom-tab-bar/index.json | 3 pages/home/home.wxss | 65 +++++ pages/personalCenter/myMassage/index.wxml | 16 pages/personalCenter/myMassage/massageDetail/index.wxss | 28 ++ pages/testLogin/index.json | 6 custom-tab-bar/index.wxss | 3 pages/home/home.json | 2 custom-tab-bar/index.wxml | 29 - static/images/personal/notification1.png | 0 custom-tab-bar/data.js | 17 app.json | 24 + assets/request/index.js | 2 pages/personalCenter/myMassage/massageDetail/index.json | 4 pages/personalCenter/myMassage/index.js | 11 pages/personalCenter/myMassage/massageDetail/index.js | 79 ++++++ pages/testLogin/index.wxss | 4 27 files changed, 595 insertions(+), 107 deletions(-) diff --git a/app.json b/app.json index 464fcdc..6a6b402 100644 --- a/app.json +++ b/app.json @@ -37,13 +37,15 @@ "pages/personalCenter/myOrder/index", "pages/personalCenter/myCollection/index", "pages/personalCenter/myMassage/index", + "pages/personalCenter/myMassage/massageDetail/index", "pages/personalCenter/feedBack/index", "pages/personalCenter/feedBackSubmit/index", "pages/personalCenter/certificate/index", "pages/personalCenter/publishBooks/index", "pages/personalCenter/sampleBooks/index", "pages/personalCenter/downloads/index", - "pages/personalCenter/activateProduct/index" + "pages/personalCenter/activateProduct/index", + "pages/testLogin/index" ], "tabBar": { "custom": true, @@ -54,23 +56,33 @@ "list": [ { "pagePath": "pages/home/home", - "text": "棣栭〉" + "text": "棣栭〉", + "iconPath": "/static/images/home/Home@2x.png", + "selectedIconPatn": "/static/images/home/Home-click@2x.png" }, { "pagePath": "pages/bookServices/index", - "text": "鍥句功鏈嶅姟" + "text": "鍥句功鏈嶅姟", + "iconPath": "/static/images/home/service@2x.png", + "selectedIconPatn": "/static/images/home/service-click@2x.png" }, { "pagePath": "pages/goods/category/index", - "text": "瀛︿範" + "text": "瀛︿範", + "iconPath": "/static/images/home/learn@2x.png", + "selectedIconPatn": "/static/images/home/learn-click@2x.png" }, { "pagePath": "pages/cart/index", - "text": "璐墿杞�" + "text": "璐墿杞�", + "iconPath": "/static/images/home/cart@2x.png", + "selectedIconPatn": "/static/images/home/cart-click@2x.png" }, { "pagePath": "pages/personalCenter/index", - "text": "鎴戠殑" + "text": "鎴戠殑", + "iconPath": "/static/images/home/my@2x.png", + "selectedIconPatn": "/static/images/home/my-click@2x.png" } ] }, diff --git a/assets/request/index.js b/assets/request/index.js index 6320e10..f782c3a 100644 --- a/assets/request/index.js +++ b/assets/request/index.js @@ -38,7 +38,7 @@ } currentUrl = JSON.stringify(currentUrl) wx.reLaunch({ - url: urlargs ? '/pages/index/index?backUrl=' + encodeURIComponent(currentUrl) : '/pages/index/index' + url: urlargs ? '/pages/home/home?backUrl=' + encodeURIComponent(currentUrl) : '/pages/home/home' }) } } else { diff --git a/custom-tab-bar/data.js b/custom-tab-bar/data.js index 34da94e..5bd6ab5 100644 --- a/custom-tab-bar/data.js +++ b/custom-tab-bar/data.js @@ -1,28 +1,33 @@ export default [ { - icon: 'home', text: '棣栭〉', url: 'pages/home/home', + icon: '/static/images/home/Home@2x.png', + activeIcon: '/static/images/home/Home-click@2x.png' }, { - icon: 'sort', text: '鍥句功鏈嶅姟', - url: 'pages/bookServices/index' + url: 'pages/bookServices/index', + icon: '/static/images/home/service@2x.png', + activeIcon: '/static/images/home/service-click@2x.png' }, { - icon: 'sort', text: '瀛︿範', url: 'pages/goods/category/index', + icon: '/static/images/home/learn@2x.png', + activeIcon: '/static/images/home/learn-click@2x.png' }, { - icon: 'cart', text: '璐墿杞�', url: 'pages/cart/index', + icon: '/static/images/home/cart@2x.png', + activeIcon: '/static/images/home/cart-click@2x.png' }, { - icon: 'person', text: '涓汉涓績', url: 'pages/personalCenter/index', + icon: '/static/images/home/my@2x.png', + activeIcon: '/static/images/home/my-click@2x.png' }, ]; diff --git a/custom-tab-bar/index.json b/custom-tab-bar/index.json index c8ba0bd..eab5fb3 100644 --- a/custom-tab-bar/index.json +++ b/custom-tab-bar/index.json @@ -3,6 +3,7 @@ "usingComponents": { "t-tab-bar": "tdesign-miniprogram/tab-bar/tab-bar", "t-tab-bar-item": "tdesign-miniprogram/tab-bar-item/tab-bar-item", - "t-icon": "tdesign-miniprogram/icon/icon" + "t-icon": "tdesign-miniprogram/icon/icon", + "t-image": "tdesign-miniprogram/image/image" } } \ No newline at end of file diff --git a/custom-tab-bar/index.wxml b/custom-tab-bar/index.wxml index 384fd2f..01c11e0 100644 --- a/custom-tab-bar/index.wxml +++ b/custom-tab-bar/index.wxml @@ -1,18 +1,11 @@ -<t-tab-bar - value="{{active}}" - bindchange="onChange" - split="{{false}}" -> - <t-tab-bar-item - wx:for="{{list}}" - wx:for-item="item" - wx:for-index="index" - wx:key="index" - > - <view class="custom-tab-bar-wrapper"> - <t-icon prefix="wr" name="{{item.icon}}" size="48rpx" /> - <view class="text">{{ item.text }}</view> - </view> - </t-tab-bar-item> -</t-tab-bar> - +<t-tab-bar value="{{active}}" bindchange="onChange" split="{{false}}"> + <t-tab-bar-item wx:for="{{list}}" wx:for-item="item" wx:for-index="index" wx:key="index"> + <view class="custom-tab-bar-wrapper"> + <!-- <t-icon prefix="wr" name="{{item.icon}}" size="48rpx" /> + <view class="text">{{ item.text }}</view> --> + <t-image wx:if="{{active !== index}}" class="tabImg" src="{{item.icon}}" mode="heightFix" width="22" height="22" /> + <t-image wx:else class="tabImg" src="{{item.activeIcon}}" mode="heightFix" width="22" height="22" /> + <view class="text">{{ item.text }}</view> + </view> + </t-tab-bar-item> +</t-tab-bar> \ No newline at end of file diff --git a/custom-tab-bar/index.wxss b/custom-tab-bar/index.wxss index 3b855f5..ebc4be3 100644 --- a/custom-tab-bar/index.wxss +++ b/custom-tab-bar/index.wxss @@ -6,4 +6,5 @@ .custom-tab-bar-wrapper .text { font-size: 20rpx; -} + margin-top: 10rpx; +} \ No newline at end of file diff --git a/pages/home/home.js b/pages/home/home.js index c15deef..6632815 100644 --- a/pages/home/home.js +++ b/pages/home/home.js @@ -4,6 +4,7 @@ const app = getApp() Page({ data: { + isWhite: false, backUrl: null, userInfo: {}, tabList: [], //鐩綍 @@ -274,7 +275,6 @@ }) }) }, -<<<<<<< HEAD tabChangeHandle(item) { let info = this.data.courseTypeList[item.detail.value] this.getCourseList(info) @@ -396,8 +396,12 @@ rankingList: res.datas }) }) - } -======= ->>>>>>> master + }, + onPageScroll(e) { + this.setData({ + isWhite: e.scrollTop > 50 ? true : false + }) + + } }); diff --git a/pages/home/home.json b/pages/home/home.json index d71c11f..3193cbf 100644 --- a/pages/home/home.json +++ b/pages/home/home.json @@ -1,5 +1,5 @@ { - "navigationBarTitleText": "棣栭〉", + "navigationStyle": "custom", "onReachBottomDistance": 10, "backgroundTextStyle": "light", "enablePullDownRefresh": true, diff --git a/pages/home/home.wxml b/pages/home/home.wxml index f9b7583..547af8b 100644 --- a/pages/home/home.wxml +++ b/pages/home/home.wxml @@ -1,7 +1,13 @@ <view style="text-align: center; color: #b9b9b9" wx:if="{{pageLoading}}"> <t-loading theme="circular" size="40rpx" text="鍔犺浇涓�..." inherit-color /> </view> +<view class="background {{ isWhite ? 'white':''}}"> + <text class="text">浜笀E璇�</text> +</view> <view class="home-page-header"> + <view class="bg"> + <image src="/static/images/home/home-bg@2x.png" mode="heightFix" class="image" /> + </view> <view class="search"> <t-search t-class-input="t-search__input" t-class-input-container="t-search__input-container" placeholder="璇疯緭鍏ュ叧閿瘝/涔﹀悕/ISBN/浣滆��" leftIcon=""> <t-icon slot="left-icon" prefix="wr" name="search" size="40rpx" color="#bbb" bind:tap="navToSearchPage" /> diff --git a/pages/home/home.wxss b/pages/home/home.wxss index bdacc2e..fa02cf0 100644 --- a/pages/home/home.wxss +++ b/pages/home/home.wxss @@ -3,6 +3,71 @@ padding-bottom: calc(env(safe-area-inset-bottom) + 96rpx); } +.background { + width: 100%; + position: fixed; + top: 0; + left: 0; + height: 80rpx; + z-index: 3; + text-align: center; + padding-top: 110rpx; + color: #fff; + font-size: 36rpx; +} + +.white { + background: #fff; + color: #333; +} + +.background .text { + height: 100%; +} + +.home-page-header, +.home-page-menu, +.home-page-container { + position: relative; + padding: 0 24rpx; +} + +.home-page-header { + padding-top: 230rpx; +} + +.home-page-header .bg { + height: 680rpx; + position: absolute; + top: 0; + left: 0; + z-index: -1; +} + +.home-page-header .bg .image { + height: 100%; +} + +.home-page-header .search .t-search__input-container { + height: 96rpx; + background: #fff !important; + font-size: 28rpx !important; +} + +.home-page-header .t-search__input { + font-size: 28rpx !important; + color: rgb(116, 116, 116) !important; +} + +.home-page-header .swiper-wrap { + margin-top: 30rpx; + margin-bottom: 10rpx; +} + +.home-page-menu .t-grid--card { + margin: 0; +} + .flex { display: flex; } diff --git a/pages/personalCenter/components/user-center-card/index.wxml b/pages/personalCenter/components/user-center-card/index.wxml index 38c8fe7..d6af2e3 100644 --- a/pages/personalCenter/components/user-center-card/index.wxml +++ b/pages/personalCenter/components/user-center-card/index.wxml @@ -4,7 +4,10 @@ <view class="user-center-card__header" bind:tap="gotoUserEditPage"> <t-avatar image="{{userInfo.avatarUrl || defaultAvatarUrl}}" class="user-center-card__header__avatar" /> <view class="user-center-card__header__name">{{'璇风櫥褰�'}}</view> - <view>璁剧疆</view> + <view class="setting"> + <image src="/static/images/personal/setting.png" mode="heightFix" class="img" /> + <text>璁剧疆</text> + </view> </view> </block> <!-- 宸茬櫥褰曚絾鏈巿鏉冪敤鎴蜂俊鎭儏鍐� --> diff --git a/pages/personalCenter/components/user-center-card/index.wxss b/pages/personalCenter/components/user-center-card/index.wxss index 62048d8..cee02f2 100644 --- a/pages/personalCenter/components/user-center-card/index.wxss +++ b/pages/personalCenter/components/user-center-card/index.wxss @@ -1,5 +1,5 @@ .user-center-card { - background-image: url('https://cdn-we-retail.ym.tencent.com/miniapp/template/user-center-bg-v1.png'); + /* background-image: url('https://cdn-we-retail.ym.tencent.com/miniapp/template/user-center-bg-v1.png'); */ background-size: cover; background-repeat: no-repeat; padding: 0 24rpx; @@ -45,4 +45,16 @@ .user-center-card__icon { line-height: 96rpx; +} + +.setting { + margin-left: auto; + display: flex; + align-items: center; +} + +.setting .img { + height: 34rpx; + width: 34rpx; + margin-right: 10rpx; } \ No newline at end of file diff --git a/pages/personalCenter/index.js b/pages/personalCenter/index.js index e086528..164d8b3 100644 --- a/pages/personalCenter/index.js +++ b/pages/personalCenter/index.js @@ -83,6 +83,7 @@ * 椤甸潰鐨勫垵濮嬫暟鎹� */ data: { + isWhite: false, show: false, userInfo: { avatarUrl: @@ -122,9 +123,11 @@ selected: 4 //杩欎釜鏁板瓧鏄綋鍓嶉〉闈㈠湪tabBar涓璴ist鏁扮粍鐨勭储寮� }) } - if (this.data.userInfo) { - this.getTeacherInfo() - } + this.getTeacherInfo() + } else { + wx.navigateTo({ + url: "/pages/testLogin/index", + }); } }, /** @@ -159,7 +162,8 @@ } } app.MG.ugc.getTopicMessageList(data).then((res) => { - const resData = res.datas.find((i) => i.appUserCreator.userId == userId.value) + console.log(this.data.userInfo, "userInfo") + const resData = res.datas.find((i) => i.appUserCreator.userId == this.data.userInfo.userId) if (resData) { this.setData({ teacherState: { @@ -193,5 +197,12 @@ */ onShareAppMessage() { + }, + + onPageScroll(e) { + this.setData({ + isWhite: e.scrollTop > 50 ? true : false + }) + } }) \ No newline at end of file diff --git a/pages/personalCenter/index.wxml b/pages/personalCenter/index.wxml index af3efc5..4e3b370 100644 --- a/pages/personalCenter/index.wxml +++ b/pages/personalCenter/index.wxml @@ -1,63 +1,70 @@ -<image class="background" src="/static/images/personal/my-bg.png" mode="heightFix" /> -<t-user-center-card userInfo="{{userInfo}}" isPhoneHide="{{true}}" name-class="custom-name-class" phone-class="custom-phone-class" avatar-class="customer-avatar-class" currAuthStep="{{currAuthStep}}" bind:gotoUserEditPage="gotoUserEditPage" /> -<view class="content-wrapper"> - <view class="topBox"> - <view class="teacherBox"> - <view> - <view class="wait" wx:if="{{teacherState.state == 'WaitAudit'}}">绛夊緟瀹℃牳</view> - <view class="yes" wx:if="{{teacherState.state == 'Normal'}}">宸茶璇�</view> - <view class="no" wx:if="{{teacherState.state == 'Reject'}}">宸查┏鍥�</view> - <view class="wait" wx:if="{{teacherState.state == ''}}">寰呰璇�</view> - <view class="title"><text>鏁欏笀璁よ瘉</text> - <text class="change-info" wx:if="{{teacherState.state == ''}}">璁よ瘉</text> - <text class="change-info" wx:if="{{teacherState.state == 'Normal' || teacherState.state == 'Reject'}}">淇敼</text> - </view> - </view> - <view> - <view>{{integral}}</view> - <view class="title">绉垎</view> - </view> - </view> +<view class="background {{ isWhite ? 'white':''}}"> + <text class="text">涓汉涓績</text> +</view> +<view class="home-page"> + <view class="bg"> + <image src="/static/images/personal/my-bg.png" mode="heightFix" class="image" /> </view> - <view class="domainBox"> - <view class="title"> - <text>甯哥敤鍔熻兘</text> - </view> - <view class="domainList"> - <view wx:for="{{menuData}}" wx:for-item="item" wx:for-index="index" wx:key="index" bindtap="toPages" data-info="{{item}}" class="listItem"> - <view class="icon"> - <t-image src="{{item.icon}}" mode="heightFix" class="img" /> + <image class="background" src="/static/images/personal/my-bg.png" mode="heightFix" /> + <t-user-center-card userInfo="{{userInfo}}" isPhoneHide="{{true}}" name-class="custom-name-class" phone-class="custom-phone-class" avatar-class="customer-avatar-class" currAuthStep="{{currAuthStep}}" bind:gotoUserEditPage="gotoUserEditPage" /> + <view class="content-wrapper"> + <view class="topBox"> + <view class="teacherBox"> + <view> + <view class="wait" wx:if="{{teacherState.state == 'WaitAudit'}}">绛夊緟瀹℃牳</view> + <view class="yes" wx:if="{{teacherState.state == 'Normal'}}">宸茶璇�</view> + <view class="no" wx:if="{{teacherState.state == 'Reject'}}">宸查┏鍥�</view> + <view class="wait" wx:if="{{teacherState.state == ''}}">寰呰璇�</view> + <view class="title"><text>鏁欏笀璁よ瘉</text> + <text class="change-info" wx:if="{{teacherState.state == ''}}">璁よ瘉</text> + <text class="change-info" wx:if="{{teacherState.state == 'Normal' || teacherState.state == 'Reject'}}">淇敼</text> + </view> </view> - <view class="label"> - <text>{{item.title}}</text> + <view> + <view>{{integral}}</view> + <view class="title">绉垎</view> + </view> + </view> + </view> + <view class="domainBox"> + <view class="title"> + <text>甯哥敤鍔熻兘</text> + </view> + <view class="domainList"> + <view wx:for="{{menuData}}" wx:for-item="item" wx:for-index="index" wx:key="index" bindtap="toPages" data-info="{{item}}" class="listItem"> + <view class="icon"> + <t-image src="{{item.icon}}" mode="heightFix" class="img" /> + </view> + <view class="label"> + <text>{{item.title}}</text> + </view> + </view> + </view> + </view> + <view class="domainBox"> + <view class="title"> + <text>鏇村鍔熻兘</text> + </view> + <view class="domainList1"> + <view wx:for="{{moreMenu}}" wx:for-item="item" wx:for-index="index" wx:key="index" bindtap="toPages" data-info="{{item}}" class="listItem"> + <view class="icon"> + <t-image src="{{item.icon}}" mode="heightFix" class="img" /> + </view> + <view class="label"> + <text>{{item.title}}</text> + </view> + </view> + </view> + <view class="domainList2"> + <view wx:for="{{moreMenu1}}" wx:for-item="item" wx:for-index="index" wx:key="index" bindtap="toPages" data-info="{{item}}" class="listItem"> + <view class="icon"> + <t-image src="{{item.icon}}" mode="heightFix" class="img" /> + </view> + <view class="label"> + <text>{{item.title}}</text> + </view> </view> </view> </view> </view> - <view class="domainBox"> - <view class="title"> - <text>鏇村鍔熻兘</text> - </view> - <view class="domainList1"> - <view wx:for="{{moreMenu}}" wx:for-item="item" wx:for-index="index" wx:key="index" bindtap="toPages" data-info="{{item}}" class="listItem"> - <view class="icon"> - <t-image src="{{item.icon}}" mode="heightFix" class="img" /> - </view> - <view class="label"> - <text>{{item.title}}</text> - </view> - </view> - </view> - <view class="domainList2"> - <view wx:for="{{moreMenu1}}" wx:for-item="item" wx:for-index="index" wx:key="index" bindtap="toPages" data-info="{{item}}" class="listItem"> - <view class="icon"> - <t-image src="{{item.icon}}" mode="heightFix" class="img" /> - </view> - <view class="label"> - <text>{{item.title}}</text> - </view> - </view> - </view> - </view> - </view> \ No newline at end of file diff --git a/pages/personalCenter/index.wxss b/pages/personalCenter/index.wxss index 7496efb..07525f0 100644 --- a/pages/personalCenter/index.wxss +++ b/pages/personalCenter/index.wxss @@ -5,11 +5,33 @@ } .background { + width: 100%; position: fixed; top: 0; left: 0; - width: 100% !important; - height: 680rpx; + height: 80rpx; + z-index: 3; + text-align: center; + padding-top: 110rpx; + font-size: 36rpx; +} + +.white { + background: #fff; + color: #333; +} + +.home-page .bg { + height: 780rpx; + width: 100%; + position: absolute; + top: 0; + left: 0; + z-index: -1; +} + +.home-page .bg .image { + height: 100%; } .content-wrapper { diff --git a/pages/personalCenter/myMassage/index.js b/pages/personalCenter/myMassage/index.js index 9bc0496..b6c2b58 100644 --- a/pages/personalCenter/myMassage/index.js +++ b/pages/personalCenter/myMassage/index.js @@ -1,3 +1,4 @@ +import moment from 'moment' const app = getApp(); Page({ /** @@ -38,7 +39,11 @@ .then(res => { try { if (res.datas.length > 0) { + res.datas.forEach((item) => { + item.createDate = moment(item.createDate).format("YYYY-MM-DD HH:mm"); + }); let dataList = res.datas; + //瑙﹀簳鍔犺浇鏂版暟鎹苟淇濈暀鑰佹暟鎹� if (isReachBottom) { dataList = [...this.data.list, ...dataList] //灏嗘柊鏁版嵁鍔犲叆鑰佹暟鎹腑 @@ -61,6 +66,12 @@ }) }, + toList(itemData) { + let info = itemData.currentTarget.dataset.info; + wx.navigateTo({ + url: "/pages/personalCenter/myMassage/massageDetail/index?id=" + info.id, + }); + }, /** * 鐢熷懡鍛ㄦ湡鍑芥暟--鐩戝惉椤甸潰鍒濇娓叉煋瀹屾垚 */ diff --git a/pages/personalCenter/myMassage/index.wxml b/pages/personalCenter/myMassage/index.wxml index fd1393a..5a96715 100644 --- a/pages/personalCenter/myMassage/index.wxml +++ b/pages/personalCenter/myMassage/index.wxml @@ -6,12 +6,18 @@ </view> </view> <view class="pageInfo" wx:if="{{list.length > 0}}"> - <view class="content-item" wx:for="{{list}}" wx:for-item="item" wx:for-index="index" wx:key="index" bindtap="toList" data-info="{{item}}"> - <view> - <text class="item-title">{{item.name}}</text> + <view class="content-item" wx:for="{{list}}" wx:for-item="item" wx:for-index="index" wx:key="index"> + <view class="icon"> + <t-image src="/static/images/personal/notification1.png" mode="heightFix" class="img" /> </view> - <view class="imageBox"> - <t-image src="{{item.icon}}" mode="aspectFill" width="50" height="50" class="item-icon" /> + <view class="item-con" data-info="{{item}}" bindtap="toList"> + <view class="titleBox"> + <view class="item-title">{{item.name}}</view> + <view class="createDate">{{item.createDate}}</view> + </view> + <view class="description"> + {{item.description}} + </view> </view> </view> </view> diff --git a/pages/personalCenter/myMassage/index.wxss b/pages/personalCenter/myMassage/index.wxss index e69de29..2848b48 100644 --- a/pages/personalCenter/myMassage/index.wxss +++ b/pages/personalCenter/myMassage/index.wxss @@ -0,0 +1,60 @@ +.pageInfo { + padding: 40rpx 20rpx; +} + +.content-item { + padding: 20rpx 0; + border-bottom: 1px solid #EDEDED; + display: flex; +} + +.content-item .icon { + width: 58rpx; + height: 58rpx; +} + +.content-item .icon .img { + width: 100%; + height: 100%; +} + +.item-con { + flex: 1; + margin-left: 30rpx; +} + +.titleBox { + display: flex; + justify-content: space-between +} + +.titleBox .item-title { + font-weight: bold; +} + +.createDate { + font-size: 24rpx; + color: #949494; +} + +.description { + font-size: 24rpx; + height: 88rpx; + line-height: 40rpx; + display: -webkit-box; + margin-top: 20rpx; + -webkit-box-orient: vertical; + -webkit-line-clamp: 2; + overflow: hidden; + text-overflow: ellipsis; +} + +.refresh-container { + margin: 0 auto; +} + +.bottom-loading, +.loading { + padding: 20rpx; + text-align: center; +} \ No newline at end of file diff --git a/pages/personalCenter/myMassage/massageDetail/index.js b/pages/personalCenter/myMassage/massageDetail/index.js new file mode 100644 index 0000000..e8ed824 --- /dev/null +++ b/pages/personalCenter/myMassage/massageDetail/index.js @@ -0,0 +1,79 @@ +const app = getApp(); +import moment from 'moment' +Page({ + + /** + * 椤甸潰鐨勫垵濮嬫暟鎹� + */ + data: { + dataInfo: {} + }, + + /** + * 鐢熷懡鍛ㄦ湡鍑芥暟--鐩戝惉椤甸潰鍔犺浇 + */ + onLoad(options) { + this.getDataInfo(options.id) + }, + getDataInfo(id) { + app.MG.app.getMessage({ + messageId: id + }) + .then(res => { + res.createDate = moment(res.createDate).format("YYYY-MM-DD HH:mm"); + this.setData({ + dataInfo: res, + }) + + }) + }, + + /** + * 鐢熷懡鍛ㄦ湡鍑芥暟--鐩戝惉椤甸潰鍒濇娓叉煋瀹屾垚 + */ + onReady() { + + }, + + /** + * 鐢熷懡鍛ㄦ湡鍑芥暟--鐩戝惉椤甸潰鏄剧ず + */ + onShow() { + + }, + + /** + * 鐢熷懡鍛ㄦ湡鍑芥暟--鐩戝惉椤甸潰闅愯棌 + */ + onHide() { + + }, + + /** + * 鐢熷懡鍛ㄦ湡鍑芥暟--鐩戝惉椤甸潰鍗歌浇 + */ + onUnload() { + + }, + + /** + * 椤甸潰鐩稿叧浜嬩欢澶勭悊鍑芥暟--鐩戝惉鐢ㄦ埛涓嬫媺鍔ㄤ綔 + */ + onPullDownRefresh() { + + }, + + /** + * 椤甸潰涓婃媺瑙﹀簳浜嬩欢鐨勫鐞嗗嚱鏁� + */ + onReachBottom() { + + }, + + /** + * 鐢ㄦ埛鐐瑰嚮鍙充笂瑙掑垎浜� + */ + onShareAppMessage() { + + } +}) \ No newline at end of file diff --git a/pages/personalCenter/myMassage/massageDetail/index.json b/pages/personalCenter/myMassage/massageDetail/index.json new file mode 100644 index 0000000..211820b --- /dev/null +++ b/pages/personalCenter/myMassage/massageDetail/index.json @@ -0,0 +1,4 @@ +{ + "navigationBarTitleText": "鎴戠殑娑堟伅", + "usingComponents": {} +} \ No newline at end of file diff --git a/pages/personalCenter/myMassage/massageDetail/index.wxml b/pages/personalCenter/myMassage/massageDetail/index.wxml new file mode 100644 index 0000000..80216eb --- /dev/null +++ b/pages/personalCenter/myMassage/massageDetail/index.wxml @@ -0,0 +1,8 @@ +<view class="container"> + <view> + <view class="name">{{dataInfo.name}}</view> + <view class="createDate">{{dataInfo.createDate}}</view> + <view class="description">{{dataInfo.description}}</view> + <rich-text space="emsp" nodes="{{dataInfo.content}}" class="content" /> + </view> +</view> \ No newline at end of file diff --git a/pages/personalCenter/myMassage/massageDetail/index.wxss b/pages/personalCenter/myMassage/massageDetail/index.wxss new file mode 100644 index 0000000..67696db --- /dev/null +++ b/pages/personalCenter/myMassage/massageDetail/index.wxss @@ -0,0 +1,28 @@ +.container { + padding: 20rpx; +} + +.name { + text-align: center; + font-size: 32rpx; + font-weight: bold; +} + +.createDate { + margin-top: 20rpx; + color: #999; + text-align: center; + font-size: 28rpx; +} + +.description { + padding: 30rpx 0; + color: #999; + font-size: 28rpx; + line-height: 40rpx; +} + +.content { + font-size: 28rpx; + line-height: 40rpx; +} \ No newline at end of file diff --git a/pages/testLogin/index.js b/pages/testLogin/index.js new file mode 100644 index 0000000..e402ac9 --- /dev/null +++ b/pages/testLogin/index.js @@ -0,0 +1,132 @@ +// pages/testLogin/index.js +const app = getApp(); + +Page({ + + /** + * 椤甸潰鐨勫垵濮嬫暟鎹� + */ + data: { + textName: "18892081234", + textPassword: "xA123456", + loading: false, + userInfo: { + name: "", + icon: "" + } + }, + + // 鐧诲綍 + onLogin() { + this.setData({ + loading: true + }) + const data = { + loginName: this.data.textName, + password: this.data.textPassword, + appRefCode: app.config.appRefCode, + platform: "Mobile", + }; + app.MG.identity.loginByPassword(data).then(res => { + if (res && res.status == "Ok") { + this.setData({ + loginInfo: JSON.stringify(res) + }) + wx.setStorageSync(app.config.tokenKey, res.token); + this.getUserInfo() + } else { + wx.showToast({ + title: res.message || "鎵嬫満鍙锋垨瀵嗙爜閿欒", + icon: "error", + duration: 2000 + }) + } + }); + }, + + // 鑾峰彇鐢ㄦ埛淇℃伅 + // 鑾峰彇鐧诲綍鐢ㄦ埛韬唤 + getUserInfo() { + app.MG.identity.getCurrentAppUser().then(res => { + // 鐢ㄦ埛淇℃伅浼樺厛绾э細鏁欏笀璁よ瘉 > 寰俊 > 瀛︾敓锛堟敞鍐屾椂榛樿锛� + if (res) { + console.log(res, "user"); + let defaultUser = {}; + let secretData = res.secretList.find(i => i.type == 'LoginNameAndPassword') + let WeChatInfo = res.infoList.find((item) => item.type === "WeChat"); + if (WeChatInfo) { + defaultUser = { + nickName: WeChatInfo.name, + avatarUrl: WeChatInfo.icon, + userId: res.userId + } + } + if (secretData) { + defaultUser = { + nickName: secretData.credential, + avatarUrl: "../../static/images/index/tab.png", + userId: res.userId + } + } + + this.setData({ + userInfo: defaultUser, + loading: false + }) + wx.setStorageSync(app.config.userInfoKey, JSON.stringify(this.data.userInfo)); + } + wx.switchTab({ + url: '/pages/home/home' + }) + }); + }, + + /** + * 鐢熷懡鍛ㄦ湡鍑芥暟--鐩戝惉椤甸潰鍔犺浇 + */ + onLoad(options) { + + }, + + /** + * 鐢熷懡鍛ㄦ湡鍑芥暟--鐩戝惉椤甸潰鍒濇娓叉煋瀹屾垚 + */ + onReady() { + + }, + + /** + * 鐢熷懡鍛ㄦ湡鍑芥暟--鐩戝惉椤甸潰鏄剧ず + */ + onShow() { + + }, + + /** + * 鐢熷懡鍛ㄦ湡鍑芥暟--鐩戝惉椤甸潰闅愯棌 + */ + onHide() { + + }, + + /** + * 鐢熷懡鍛ㄦ湡鍑芥暟--鐩戝惉椤甸潰鍗歌浇 + */ + onUnload() { + + }, + + /** + * 椤甸潰鐩稿叧浜嬩欢澶勭悊鍑芥暟--鐩戝惉鐢ㄦ埛涓嬫媺鍔ㄤ綔 + */ + onPullDownRefresh() { + + }, + + /** + * 椤甸潰涓婃媺瑙﹀簳浜嬩欢鐨勫鐞嗗嚱鏁� + */ + onReachBottom() { + + } +}) \ No newline at end of file diff --git a/pages/testLogin/index.json b/pages/testLogin/index.json new file mode 100644 index 0000000..fd16c3b --- /dev/null +++ b/pages/testLogin/index.json @@ -0,0 +1,6 @@ +{ + "usingComponents": { + "t-input": "tdesign-miniprogram/input/input", + "t-button": "tdesign-miniprogram/button/button" + } +} \ No newline at end of file diff --git a/pages/testLogin/index.wxml b/pages/testLogin/index.wxml new file mode 100644 index 0000000..b538be0 --- /dev/null +++ b/pages/testLogin/index.wxml @@ -0,0 +1,8 @@ +<!--pages/testLogin/index.wxml--> +<view> + <t-input label="鐢ㄦ埛璐﹀彿" placeholder="璇疯緭鍏ョ敤鎴峰悕" model:value="{{textName}}" suffixIcon="{{ { name: 'user-avatar', ariaLabel: '閫氳褰�' } }}"></t-input> + <t-input label="鐢ㄦ埛瀵嗙爜" placeholder="璇疯緭鍏ュ瘑鐮�" type="password" model:value="{{textPassword}}" clearable /> +</view> +<view class="button-example"> + <t-button theme="primary" loading="{{loading}}" bindtap="onLogin" size="large" block>绔嬪嵆鐧诲綍</t-button> +</view> \ No newline at end of file diff --git a/pages/testLogin/index.wxss b/pages/testLogin/index.wxss new file mode 100644 index 0000000..7eb603b --- /dev/null +++ b/pages/testLogin/index.wxss @@ -0,0 +1,4 @@ +/* pages/testLogin/index.wxss */ +.button-example { + margin: 60rpx 32rpx; +} \ No newline at end of file diff --git a/static/images/personal/notification1.png b/static/images/personal/notification1.png new file mode 100644 index 0000000..8132730 --- /dev/null +++ b/static/images/personal/notification1.png Binary files differ -- Gitblit v1.9.1