This commit is contained in:
@zuopngfei 2025-05-22 18:34:51 +08:00
parent 0984a8157a
commit 65e6cff360
37 changed files with 353 additions and 1322 deletions

View File

@ -1,6 +1,7 @@
import config from '~/config'; import config from '~/config';
const { baseUrl } = config; const baseUrl = 'https://ddbs.1024tool.vip/';
console.log(config, baseUrl)
const delay = config.isMock ? 500 : 0; const delay = config.isMock ? 500 : 0;
function request(url, method = 'GET', data = {}) { function request(url, method = 'GET', data = {}) {
const header = { const header = {

9
api/user.js Normal file
View File

@ -0,0 +1,9 @@
import request from './request'
export const userLogin = () => {
return request({
url: 'patient/password_login',
method: 'post',
data
})
}

View File

@ -4,21 +4,13 @@
"t-toast": "tdesign-miniprogram/toast/toast" "t-toast": "tdesign-miniprogram/toast/toast"
}, },
"subpackages": [ "subpackages": [
{
"root": "pages/search",
"name": "search",
"pages": ["index"]
},
{ {
"root": "pages/my/info-edit", "root": "pages/my/info-edit",
"name": "edit", "name": "edit",
"pages": ["index"] "pages": ["index"]
}, },
{
"root": "pages/chat",
"name": "chat",
"pages": ["index"]
},
{ {
"root": "pages/login", "root": "pages/login",
"name": "login", "name": "login",
@ -29,19 +21,12 @@
"name": "loginCode", "name": "loginCode",
"pages": ["loginCode"] "pages": ["loginCode"]
}, },
{ {
"root": "pages/dataCenter", "root": "pages/forGetPassword",
"name": "dataCenter", "name": "forGetPassword",
"pages": ["index"]
},
{
"root": "pages/setting",
"name": "setting",
"pages": ["index"]
},
{
"root": "pages/release",
"name": "release",
"pages": ["index"] "pages": ["index"]
} }
], ],
@ -64,7 +49,7 @@
}, },
{ {
"pagePath": "pages/my/index", "pagePath": "pages/my/index",
"text": "我2的" "text": "我的"
} }
] ]
}, },

View File

@ -1,6 +1,6 @@
<view class="home-navbar"> <view class="home-navbar">
<t-navbar title="{{ navType === 'search' ? '' : titleText }}"> <t-navbar title="{{ titleText }}">
<view slot="left"> <!-- <view slot="left">
<view class="home-navbar__left"> <view class="home-navbar__left">
<t-icon class="home-navbar__icon" bind:tap="openDrawer" name="view-list" size="48rpx" /> <t-icon class="home-navbar__icon" bind:tap="openDrawer" name="view-list" size="48rpx" />
<t-search <t-search
@ -10,14 +10,14 @@
wx:if="{{navType === 'search'}}" wx:if="{{navType === 'search'}}"
/> />
</view> </view>
</view> </view> -->
</t-navbar> </t-navbar>
<t-drawer <!-- <t-drawer
style="padding-top: {{statusHeight}}px;" style="padding-top: {{statusHeight}}px;"
visible="{{visible}}" visible="{{visible}}"
items="{{sidebar}}" items="{{sidebar}}"
placement="left" placement="left"
title="页面目录" title="页面目录"
bind:item-click="itemClick" bind:item-click="itemClick"
/> /> -->
</view> </view>

View File

@ -1,5 +1,6 @@
/** 是否使用mock代替api返回 */ /** 是否使用mock代替api返回 */
export const config = { export const config = {
baseUrl: 'https://ddbs.1024tool.vip/',
useMock: true, useMock: true,
}; };

View File

@ -1,85 +0,0 @@
// pages/chat/index.js
const app = getApp();
const { socket } = app.globalData; // 获取已连接的socketTask
Page({
/** 页面的初始数据 */
data: {
myAvatar: '/static/chat/avatar.png', // 自己的头像
userId: null, // 对方userId
avatar: '', // 对方头像
name: '', // 对方昵称
messages: [], // 消息列表 { messageId, from, content, time, read }
input: '', // 输入框内容
anchor: '', // 消息列表滚动到 id 与之相同的元素的位置
keyboardHeight: 0, // 键盘当前高度(px)
},
/** 生命周期函数--监听页面加载 */
onLoad(options) {
this.getOpenerEventChannel().on('update', this.update);
},
/** 生命周期函数--监听页面初次渲染完成 */
onReady() {},
/** 生命周期函数--监听页面显示 */
onShow() {},
/** 生命周期函数--监听页面隐藏 */
onHide() {},
/** 生命周期函数--监听页面卸载 */
onUnload() {
app.eventBus.off('update', this.update);
},
/** 页面相关事件处理函数--监听用户下拉动作 */
onPullDownRefresh() {},
/** 页面上拉触底事件的处理函数 */
onReachBottom() {},
/** 用户点击右上角分享 */
onShareAppMessage() {},
/** 更新数据 */
update({ userId, avatar, name, messages }) {
this.setData({ userId, avatar, name, messages: [...messages] });
wx.nextTick(this.scrollToBottom);
},
/** 处理唤起键盘事件 */
handleKeyboardHeightChange(event) {
const { height } = event.detail;
if (!height) return;
this.setData({ keyboardHeight: height });
wx.nextTick(this.scrollToBottom);
},
/** 处理收起键盘事件 */
handleBlur() {
this.setData({ keyboardHeight: 0 });
},
/** 处理输入事件 */
handleInput(event) {
this.setData({ input: event.detail.value });
},
/** 发送消息 */
sendMessage() {
const { userId, messages, input: content } = this.data;
if (!content) return;
const message = { messageId: null, from: 0, content, time: Date.now(), read: true };
messages.push(message);
this.setData({ input: '', messages });
socket.send(JSON.stringify({ type: 'message', data: { userId, content } }));
wx.nextTick(this.scrollToBottom);
},
/** 消息列表滚动到底部 */
scrollToBottom() {
this.setData({ anchor: 'bottom' });
},
});

View File

@ -1,9 +0,0 @@
{
"usingComponents": {
"t-navbar": "tdesign-miniprogram/navbar/navbar",
"t-avatar": "tdesign-miniprogram/avatar/avatar",
"t-loading": "tdesign-miniprogram/loading/loading",
"t-button": "tdesign-miniprogram/button/button"
},
"navigationStyle": "custom"
}

View File

@ -1,110 +0,0 @@
/* pages/chat/index.wxss */
.chat-container {
display: flex;
flex-direction: column;
box-sizing: border-box;
height: 100vh;
font-size: 32rpx;
background-color: #fff;
}
.nav-bar {
border-bottom: 1rpx solid #e7e7e7;
}
.content {
height: 0;
flex-grow: 1;
}
.messages {
display: flex;
flex-direction: column;
gap: 32rpx;
padding: 32rpx 24rpx;
}
.time {
display: flex;
justify-content: center;
align-items: flex-end;
height: 56rpx;
color: #00000066;
font-size: 24rpx;
line-height: 40rpx;
}
.message-area {
display: flex;
align-items: flex-start;
gap: 16rpx;
}
.message {
position: relative;
box-sizing: border-box;
max-width: 510rpx;
padding: 24rpx;
font-size: 28rpx;
line-height: 44rpx;
}
.message.self {
border-radius: 24rpx 0 24rpx 24rpx;
margin-left: auto;
background-color: #d9e1ff;
}
.message.other {
border-radius: 0 24rpx 24rpx 24rpx;
background-color: #f3f3f3;
}
.loading {
position: absolute;
right: calc(100% + 16rpx);
top: 50%;
transform: translateY(-50%);
}
.block {
height: calc(env(safe-area-inset-bottom) + 129rpx);
}
.bottom {
position: fixed;
left: 0;
right: 0;
bottom: 0;
display: flex;
justify-content: space-between;
align-items: center;
gap: 24rpx;
padding: 24rpx 24rpx calc(env(safe-area-inset-bottom) + 24rpx);
border-top: 1rpx solid #e7e7e7;
background-color: #ffffff;
}
.input {
box-sizing: border-box;
flex-grow: 1;
height: 80rpx;
padding: 16rpx 32rpx;
border-radius: 40rpx;
border: 1rpx solid #dcdcdc;
background: #f3f3f3;
line-height: 48rpx;
}
.input > input {
width: 100%;
height: 48rpx;
line-height: 48rpx;
margin-bottom: 40rpx;
}
.send {
width: 128rpx !important;
margin: 0;
font-weight: normal !important;
}

View File

@ -1,58 +0,0 @@
<wxs src="./index.wxs" module="utils" />
<t-navbar class="nav-bar" title="{{ name }}" left-arrow />
<view class="chat-container">
<scroll-view class="content" scroll-y scroll-into-view="{{ anchor }}">
<view class="messages">
<block wx:for="{{ messages }}" wx:key="index">
<view wx:if="{{ index === 0 || item.time - messages[index - 1].time > 120000 }}" class="time" >
{{ utils.formatTime(item.time) }}
</view>
<view wx:if="{{ item.from === 0 }}" class="message-area">
<view class="message self">
<text space="nbsp">{{ item.content }}</text>
<t-loading
wx:if="{{ item.messageId === null }}"
t-class="loading"
theme="spinner"
size="32rpx"
class="wrapper"
/>
</view>
<t-avatar image="{{ myAvatar }}" size="small" />
</view>
<view wx:else class="message-area">
<t-avatar image="{{ avatar }}" size="small" />
<view class="message other">
<text space="nbsp">{{ item.content }}</text>
</view>
</view>
</block>
<view id="bottom" />
</view>
</scroll-view>
</view>
<view class="block" style="margin-bottom: {{ keyboardHeight }}px" />
<view class="bottom" style="margin-bottom: {{ keyboardHeight }}px">
<view class="input">
<input
value="{{ input }}"
type="text"
confirm-type="send"
placeholder="请输入"
placeholder-style="color: #00000066"
adjust-position="{{ false }}"
hold-keyboard
confirm-hold
bindkeyboardheightchange="handleKeyboardHeightChange"
bindblur="handleBlur"
bindinput="handleInput"
bindconfirm="sendMessage"
/>
</view>
<t-button class="send" theme="primary" shape="round" disabled="{{ !input }}" bind:tap="sendMessage">发送</t-button>
</view>

View File

@ -1,28 +0,0 @@
/** 将数字补足2位 */
function formatNum(num) {
return num < 10 ? '0' + num : num;
}
/** 格式化时间 */
function formatTime(time) {
var date = getDate(time);
var now = getDate();
var Y = date.getFullYear(),
M = date.getMonth() + 1,
D = date.getDate(),
h = date.getHours(),
m = date.getMinutes();
var Y0 = now.getFullYear(),
M0 = now.getMonth() + 1,
D0 = now.getDate();
if (Y === Y0) {
if (M === M0 && D === D0) return '今天 ' + formatNum(h) + ':' + formatNum(m);
if (M === M0 && D === D0 - 1) return '昨天 ' + formatNum(h) + ':' + formatNum(m);
return M + '月' + D + '日 ' + formatNum(h) + ':' + formatNum(m);
}
return Y + '年' + M + '月' + D + '日 ' + formatNum(h) + ':' + formatNum(m);
}
module.exports = {
formatTime: formatTime,
};

View File

@ -1,104 +0,0 @@
import request from '~/api/request';
Page({
/**
* 页面的初始数据
*/
data: {
totalSituationDataList: null,
totalSituationKeyList: null,
completeRateDataList: null,
complete_rate_keyList: null,
interactionSituationDataList: null,
interaction_situation_keyList: null,
areaDataList: null,
areaDataKeysList: null,
memberitemWidth: null,
smallitemWidth: null,
},
onLoad() {
this.init();
},
init() {
this.getMemberData();
this.getInteractionData();
this.getCompleteRateData();
this.getAreaData();
},
/**
* 获取 整体情况 数据
*/
getMemberData() {
request('/dataCenter/member').then((res) => {
const totalSituationData = res.data.template.succ.data.list;
this.setData({
totalSituationDataList: totalSituationData,
});
// 计算每个.item元素的宽度
const itemWidth = `${(750 - 32 * (totalSituationData.length - 1)) / totalSituationData.length}rpx`;
// 更新.item元素的样式
this.setData({
memberitemWidth: itemWidth,
});
});
},
/**
* 获取 互动情况 数据
*/
getInteractionData() {
request('/dataCenter/interaction').then((res) => {
const interactionSituationData = res.data.template.succ.data.list;
this.setData({
interactionSituationDataList: interactionSituationData,
interactionSituationKeysList: Object.keys(interactionSituationData[0]),
});
// 计算每个.item元素的宽度
const itemWidth = `${(750 - 32 * (interactionSituationData.length - 1)) / interactionSituationData.length}rpx`;
// 更新.item元素的样式
this.setData({
smallitemWidth: itemWidth,
});
});
},
/**
* 完播率
*/
getCompleteRateData() {
request('/dataCenter/complete-rate').then((res) => {
const completeRateData = res.data.template.succ.data.list;
this.setData({
completeRateDataList: completeRateData,
completeRateKeysList: Object.keys(completeRateData[0]),
});
// 计算每个.item元素的宽度
const itemHeight = `${380 / completeRateData.length}rpx`;
// 更新.item元素的样式
this.setData({
itemHeight: itemHeight,
});
});
},
/**
* 按区域统计
*/
getAreaData() {
request('/dataCenter/area').then((res) => {
const areaData = res.data.template.succ.data.list;
this.setData({
areaDataList: areaData,
areaDataKeysList: Object.keys(areaData[0]),
});
});
},
});

View File

@ -1,8 +0,0 @@
{
"navigationStyle": "custom",
"usingComponents": {
"t-navbar": "tdesign-miniprogram/navbar/navbar",
"t-progress": "tdesign-miniprogram/progress/progress",
"t-empty": "tdesign-miniprogram/empty/empty"
}
}

View File

@ -1,133 +0,0 @@
.card {
display: inline-flex;
flex-direction: column;
align-items: flex-start;
gap: 32rpx;
width: 100%;
padding: 24rpx 32rpx 32rpx 32rpx;
box-sizing: border-box;
background-color: #fff;
.card-header {
width: 100%;
display: flex;
justify-content: space-between;
&__title {
color: rgba(0, 0, 0, 0.9);
font-size: 32rpx;
font-weight: 600;
line-height: 48rpx;
}
&__desc {
color: rgba(0, 0, 0, 0.4);
font-size: 24rpx;
line-height: 40rpx;
}
}
.card-content {
display: flex;
width: 100%;
align-items: flex-start;
gap: 32rpx;
&__item {
display: flex;
flex-direction: column;
align-items: flex-start;
flex: 1 0 0;
&--desc {
color: rgba(0, 0, 0, 0.4);
font-size: 24rpx;
line-height: 40rpx;
}
&--count {
font-size: 48rpx;
font-weight: 600;
line-height: 64rpx;
}
}
}
}
.first {
.card-content {
&__item {
&:first-child {
.card-content__item--count {
color: #0052d9;
}
}
}
}
}
.second,
.third,
.forth {
gap: 24rpx;
padding: 32rpx;
margin: 32rpx 32rpx 0;
width: calc(100% - 64rpx);
border-radius: 9px;
.card-header__title {
font-size: 28rpx;
line-height: 44rpx;
}
}
.second {
.card-content__item--desc {
font-size: 20rpx;
line-height: 32rpx;
}
.card-content__item--count {
margin-top: 8rpx;
font-size: 40rpx;
line-height: 56rpx;
}
.unit {
margin-left: 4rpx;
color: rgba(0, 0, 0, 0.6);
font-size: 20rpx;
font-weight: 400;
line-height: 32rpx;
}
}
.third {
.card-content {
display: flex;
flex-direction: column;
gap: 16rpx;
}
.card-content__item {
width: 100%;
display: flex;
flex-direction: row;
align-items: flex-start;
gap: 16rpx;
align-self: stretch;
}
.progress__content {
flex: 1 0 0;
}
}
.forth {
.card-content {
display: flex;
justify-content: center;
}
margin-bottom: 16rpx;
}

View File

@ -1,53 +0,0 @@
<t-navbar title="数据中心" left-arrow />
<view class="data-center">
<view class="card first">
<view class="card-header">
<view class="card-header__title"> 整体情况 </view>
<view class="card-header__desc"> 截止12:00累计数值 </view>
</view>
<view class="card-content">
<view class="card-content__item" wx:for="{{totalSituationDataList}}" wx:for-item="item" wx:key="index">
<view class="card-content__item--desc"> {{item.name}} </view>
<view class="card-content__item--count"> {{item.number}} </view>
</view>
</view>
</view>
<view class="card second">
<view class="card-header">
<view class="card-header__title"> 互动情况 </view>
</view>
<view class="card-content">
<view class="card-content__item" wx:for="{{interactionSituationDataList}}" wx:for-item="item" wx:key="*this">
<view class="card-content__item--desc"> {{item.name}} </view>
<view class="card-content__item--count">
<text>{{item.number}}</text>
<text class="unit">次</text>
</view>
</view>
</view>
</view>
<view class="card third">
<view class="card-header">
<view class="card-header__title"> 完播率 </view>
</view>
<view class="card-content">
<view class="card-content__item" wx:for="{{completeRateDataList}}" wx:for-item="item" wx:key="index">
<text class="progress__label"> {{item.time}} </text>
<view class="progress__content">
<t-progress percentage="{{item.percentage}}" />
</view>
</view>
</view>
</view>
<view class="card forth">
<view class="card-header">
<view class="card-header__title"> 按区域统计 </view>
</view>
<view class="card-content">
<t-empty icon="info-circle-filled" description="Empty Data" />
</view>
</view>
</view>

View File

@ -0,0 +1,66 @@
// pages/forGetPassword/index.js
Page({
/**
* 页面的初始数据
*/
data: {
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
}
})

View File

@ -0,0 +1,12 @@
{
"navigationStyle": "custom",
"usingComponents": {
"t-navbar": "tdesign-miniprogram/navbar/navbar",
"t-input": "tdesign-miniprogram/input/input",
"t-icon": "tdesign-miniprogram/icon/icon",
"t-link": "tdesign-miniprogram/link/link",
"t-button": "tdesign-miniprogram/button/button",
"t-radio-group": "tdesign-miniprogram/radio-group/radio-group",
"t-radio": "tdesign-miniprogram/radio/radio"
}
}

View File

@ -0,0 +1,95 @@
/* pages/forGetPassword/index.wxss */
.login {
&__title {
color: rgba(0, 0, 0, 0.9);
font-size: 56rpx;
font-weight: 600;
line-height: 72rpx;
padding: 16rpx 32rpx 40rpx;
}
&__input {
.input-label {
display: flex;
padding-right: 32rpx;
box-sizing: border-box;
border-right: 1rpx solid #e7e7e7;
}
.input-icon {
margin-left: 8rpx;
}
}
&__tips {
color: rgba(0, 0, 0, 0.4);
font-size: 24rpx;
font-style: normal;
font-weight: 400;
line-height: 40rpx;
margin: 24rpx 32rpx 32rpx;
}
&__button {
margin: 0 32rpx;
}
&__password--forget {
display: flex;
font-size: 24rpx;
align-items: center;
margin: 32rpx;
line-height: 40rpx;
}
&__others {
margin: 64rpx 32rpx auto 32rpx;
display: flex;
align-items: center;
justify-content: space-between;
&-label {
min-width: 96rpx;
color: rgba(0, 0, 0, 0.6);
font-size: 24rpx;
line-height: 40rpx;
}
&-buttons {
flex: 1;
margin-left: 32rpx;
display: flex;
align-items: center;
justify-content: flex-end;
.button {
margin: 0 !important;
&:not(:last-child) {
margin-right: 32rpx !important;
}
}
}
}
// 覆盖组件样式
.radio-class {
--td-radio-icon-size: 32rpx;
--td-radio-label-line-height: 40rpx;
align-items: center;
}
.radio-class-icon {
margin-top: 0 !important;
}
.radio-class-label {
margin-left: 8rpx !important;
font-size: 24rpx !important;
line-height: 40rpx !important;
}
.login__button{
margin-top: 40rpx;
}
}

View File

@ -0,0 +1,51 @@
<!--pages/forGetPassword/index.wxml-->
<t-navbar left-arrow />
<view class="page login">
<view class="login__content">
<view class="login__input">
<view>
<t-input value="{{phoneNumber}}" placeholder="请输入手机号" type="number" bindchange="onPhoneInput">
<view slot="label" class="input-label">
<t-icon name="mobile" size="40rpx" class="input-iconl"></t-icon>
</view>
</t-input>
<t-input value="{{code}}" placeholder="请输入验证码" type="number" bindchange="onCodeInput">
<view slot="label" class="input-label">
<t-icon name="mail" size="40rpx" class="input-iconl"></t-icon>
</view>
<view slot="suffix" style="display: flex; align-items: center">
<view class="suffix--line"></view>
<view class="verify" aria-role="button" bindtap="getCode"> 发送验证码 </view>
</view>
</t-input>
<t-input value="{{phoneNumber}}" placeholder="请设置6-20位密码" type="number" bindchange="onPhoneInput">
<view slot="label" class="input-label">
<t-icon name="git-repository-private" size="40rpx" class="input-iconl"></t-icon>
</view>
</t-input>
<t-input value="{{phoneNumber}}" placeholder="请重新输入密码" type="number" bindchange="onPhoneInput">
<view slot="label" class="input-label">
<t-icon name="git-repository-private" size="40rpx" class="input-iconl"></t-icon>
</view>
</t-input>
</view>
</view>
<view class="login__button">
<t-button theme="primary" size="large" block disabled="{{!isSubmit}}" bindtap="login">
确定
</t-button>
</view>
</view>
</view>

View File

@ -6,12 +6,13 @@ Page({
isPhoneNumber: false, isPhoneNumber: false,
isCheck: false, isCheck: false,
isSubmit: false, isSubmit: false,
isPasswordLogin: false, isPasswordLogin: true,
passwordInfo: { passwordInfo: {
account: '', account: '',
password: '', password: '',
}, },
radioValue: '', radioValue: '',
code: ''
}, },
/* 自定义功能函数 */ /* 自定义功能函数 */
@ -66,7 +67,7 @@ Page({
async login() { async login() {
if (this.data.isPasswordLogin) { if (this.data.isPasswordLogin) {
const res = await request('/login/postPasswordLogin', 'post', { data: this.data.passwordInfo }); const res = await request('patient/password_login', 'post', { mobile: this.data.passwordInfo.account, password: this.data.passwordInfo.password });
if (res.success) { if (res.success) {
await wx.setStorageSync('access_token', res.data.token); await wx.setStorageSync('access_token', res.data.token);
wx.switchTab({ wx.switchTab({
@ -74,12 +75,24 @@ Page({
}); });
} }
} else { } else {
const res = await request('/login/getSendMessage', 'get'); const res = await request('/patient/code_login', 'post', {code: this.data.code, mobile: this.data.phoneNumber});
if (res.success) { // if (res.success) {
wx.navigateTo({ // wx.navigateTo({
url: `/pages/loginCode/loginCode?phoneNumber=${this.data.phoneNumber}`, // url: `/pages/loginCode/loginCode?phoneNumber=${this.data.phoneNumber}`,
}); // });
} // }
} }
}, },
// 获取验证码
async getCode() {
const res = await request('patient/send_code', 'post', { mobile: this.data.phoneNumber, type: 1 });
},
uploadPass() {
console.log('1222')
wx.navigateTo({
url: `/pages/forGetPassword/index`,
})
}
}); });

View File

@ -4,40 +4,41 @@
<view class="login__content"> <view class="login__content">
<view class="login__input"> <view class="login__input">
<view class="login__password" wx:if="{{isPasswordLogin}}"> <view class="login__password" wx:if="{{isPasswordLogin}}">
<t-input <t-input placeholder="请输入手机号" value="{{passwordInfo.account}}" bindchange="onAccountChange">
label="账号" <view slot="label" class="input-label">
placeholder="请输入手机号/邮箱" <t-icon name="mobile" size="40rpx" class="input-iconl"></t-icon>
value="{{passwordInfo.account}}" </view>
bindchange="onAccountChange" </t-input>
></t-input> <t-input placeholder="请输入密码" type="password" clearable value="{{passwordInfo.password}}" bindchange="onPasswordChange" >
<t-input <view slot="label" class="input-label">
label="密码" <t-icon name="git-repository-private" size="40rpx" class="input-iconl"></t-icon>
placeholder="请输入密码" </view>
type="password" </t-input>
clearable
value="{{passwordInfo.password}}"
bindchange="onPasswordChange"
/>
</view> </view>
<view wx:else>
<t-input value="{{phoneNumber}}" placeholder="请输入手机号" type="number" bindchange="onPhoneInput">
<view slot="label" class="input-label">
<t-icon name="mobile" size="40rpx" class="input-iconl"></t-icon>
</view>
<t-input wx:else value="{{phoneNumber}}" placeholder="请输入手机号" type="number" bindchange="onPhoneInput"> </t-input>
<view slot="label" class="input-label"> <t-input value="{{code}}" placeholder="请输入验证码" type="number" bindchange="onCodeInput">
<text>+86</text>
<t-icon name="caret-down-small" size="40rpx" class="input-iconl"></t-icon> <view slot="label" class="input-label">
</view> <t-icon name="mail" size="40rpx" class="input-iconl"></t-icon>
</t-input> </view>
<view slot="suffix" style="display: flex; align-items: center">
<view class="suffix--line"></view>
<view class="verify" aria-role="button" bindtap="getCode"> 发送验证码 </view>
</view>
</t-input>
</view>
</view> </view>
<view class="login__tips">未注册的手机号验证通过后将自动注册</view> <view class="login__tips">未注册的手机号验证通过后将自动注册</view>
<t-radio-group allow-uncheck borderless value="{{radioValue}}" bind:change="onCheckChange"> <t-radio-group allow-uncheck borderless value="{{radioValue}}" bind:change="onCheckChange">
<t-radio <t-radio label="同意《用户服务协议条款》" value="agree" t-class="radio-class" t-class-icon="radio-class-icon" t-class-label="radio-class-label" />
label="同意《协议条款》"
value="agree"
t-class="radio-class"
t-class-icon="radio-class-icon"
t-class-label="radio-class-label"
/>
</t-radio-group> </t-radio-group>
<view class="login__button"> <view class="login__button">
@ -48,7 +49,7 @@
<view class="login__password--forget" wx:if="{{isPasswordLogin}}"> <view class="login__password--forget" wx:if="{{isPasswordLogin}}">
<text>忘记密码?</text> <text>忘记密码?</text>
<t-link theme="primary" size="small">找回密码</t-link> <text bindtap="uploadPass" >找回密码</text>
</view> </view>
</view> </view>
@ -58,7 +59,7 @@
<t-button class="button" variant="outline" theme="default" size="medium" shape="round" bindtap="changeLogin"> <t-button class="button" variant="outline" theme="default" size="medium" shape="round" bindtap="changeLogin">
{{isPasswordLogin ? '验证码登录' : '密码登录' }} {{isPasswordLogin ? '验证码登录' : '密码登录' }}
</t-button> </t-button>
<t-button <!-- <t-button
class="button" class="button"
variant="outline" variant="outline"
theme="default" theme="default"
@ -74,7 +75,7 @@
size="medium" size="medium"
icon="logo-wecom" icon="logo-wecom"
shape="circle" shape="circle"
></t-button> ></t-button> -->
</view> </view>
</view> </view>
</view> </view>

View File

@ -8,7 +8,7 @@
refresher-triggered="{{ loading }}" refresher-triggered="{{ loading }}"
bindrefresherrefresh="getMessageList" bindrefresherrefresh="getMessageList"
> >
<t-cell <!-- <t-cell
wx:for="{{ messageList }}" wx:for="{{ messageList }}"
wx:key="index" wx:key="index"
t-class-image="avatar" t-class-image="avatar"
@ -21,5 +21,5 @@
data-user-id="{{ item.userId }}" data-user-id="{{ item.userId }}"
> >
<t-badge slot="right-icon" count="{{ utils.computeUnreadNum(item.messages) }}" class="wrapper" /> <t-badge slot="right-icon" count="{{ utils.computeUnreadNum(item.messages) }}" class="wrapper" />
</t-cell> </t-cell> -->
</scroll-view> </scroll-view>

View File

@ -7,7 +7,9 @@ Page({
data: { data: {
isLoad: false, isLoad: false,
service: [], service: [],
personalInfo: {}, personalInfo: {
name: '邹方成'
},
gridList: [ gridList: [
{ {
name: '全部发布', name: '全部发布',
@ -36,12 +38,9 @@ Page({
], ],
settingList: [ settingList: [
{ label: '姓名', text: '张三', icon: 'service', type: 'text' }, { label: '用药方案', text: '', icon: 'service', type: 'text' },
{ label: '性别', text: '男', icon: 'setting', type: 'text' }, { label: '健康教育', text: '', icon: 'setting', type: 'text' },
{ label: '出生日期', text: '1990-01-01', icon: 'setting', type: 'text' },
{ label: '身份证号', text: '13800138000', icon: 'setting', type: 'text' },
{ label: '手机号', text: '421033201810101601', icon: 'setting', type: 'text' },
{ label: '胆道闭锁手术时间', text: '2025-01-01', icon: 'setting', type: 'text' },
], ],
}, },

View File

@ -99,4 +99,24 @@
font-weight: 600; font-weight: 600;
} }
} }
.my-cell{
margin-top: 30rpx;
}
.my-info__person{
position: relative;
text{
font-size: 24rpx;
}
.edit{
position: absolute;
right: 0;
top: 0;
}
}
.time{
font-size: 26rpx;
}
.peld{
color: red;
}
} }

View File

@ -8,68 +8,36 @@
<t-cell wx:if="{{!isLoad}}" bordered="{{false}}"> <t-cell wx:if="{{!isLoad}}" bordered="{{false}}">
<t-avatar image="{{personalInfo.image}}" slot="left-icon" size="large" /> <t-avatar image="{{personalInfo.image}}" slot="left-icon" size="large" />
<view class="my-info__person" slot="description"> <view class="my-info__person" slot="description">
<view class="name">{{personalInfo.name}}</view> <view class="name">{{personalInfo.name}}
<text>男 1岁5个月</text>
<t-icon class="edit" slot="right-icon" name="edit" size="40rpx" color="#000000e6" bindtap="onNavigateTo" />
</view>
<view class="time">胆道闭锁手术时间2024年12月15日</view>
<view class="peld">PELD评分12
<t-tag class="tag" theme="danger">高危</t-tag></view>
<!-- <view class="tags"> <!-- <view class="tags">
<t-tag class="tag" variant="light" icon="discount">{{personalInfo.star}}</t-tag> <t-tag class="tag" variant="light" icon="discount">{{personalInfo.star}}</t-tag>
<t-tag class="tag" variant="light" icon="location">{{personalInfo.city}}</t-tag> <t-tag class="tag" variant="light" icon="location">{{personalInfo.city}}</t-tag>
</view> --> </view> -->
</view> </view>
<t-icon slot="right-icon" name="edit" size="40rpx" color="#000000e6" bindtap="onNavigateTo" />
</t-cell> </t-cell>
<t-cell <t-cell wx:if="{{isLoad}}" title="请先登录/注册" bordered="{{false}}" t-class-title="cell-class-title" t-class-center="cell-class-center" bindtap="onLogin">
wx:if="{{isLoad}}"
title="请先登录/注册"
bordered="{{false}}"
t-class-title="cell-class-title"
t-class-center="cell-class-center"
bindtap="onLogin"
>
<t-avatar slot="left-icon" icon="user" size="128rpx" /> <t-avatar slot="left-icon" icon="user" size="128rpx" />
</t-cell> </t-cell>
</t-cell-group> </t-cell-group>
<t-divider t-class="divider-class" />
<!--
<t-grid t-class="grid-class"> </view>
<t-grid-item <view class="my-cell">
wx:for="{{gridList}}"
wx:for-item="gridItem"
wx:key="type"
text="{{gridItem.name}}"
icon="{{gridItem.icon}}"
class="grid-item {{gridItem.type === 'all' ? 'split-line' : ''}}"
data-data="{{gridItem}}"
bindclick="onEleClick"
/>
</t-grid> -->
<t-cell-group theme="card"> <t-cell-group theme="card">
<t-cell <t-cell wx:for="{{settingList}}" wx:for-item="item" wx:key="type" title="{{item.label}}" url="{{item.url}}" arrow />
wx:for="{{settingList}}"
wx:for-item="item"
wx:key="type"
title="{{item.label}}"
url="{{item.url}}"
note="{{item.text}}"
/> </t-cell-group>
</t-cell-group>
</view> </view>
<!-- <view class="my-service">
<view class="my-service--tips">推荐服务</view>
<t-grid column="{{4}}" class="my-service__list">
<t-grid-item
class="my-service__list-item"
wx:for="{{service}}"
wx:key="item"
text="{{item.name}}"
image="{{item.image}}"
url="{{item.url}}"
data-data="{{item}}"
bindclick="onEleClick"
/>
</t-grid>
</view> -->
</view> </view>

View File

@ -1,66 +0,0 @@
// pages/release/index.js
Page({
/**
* 页面的初始数据
*/
data: {
originFiles: [
{
url: '/static/image1.png',
name: 'uploaded1.png',
type: 'image',
},
{
url: '/static/image2.png',
name: 'uploaded2.png',
type: 'image',
},
],
gridConfig: {
column: 4,
width: 160,
height: 160,
},
config: {
count: 1,
},
tags: ['AI绘画', '版权素材', '原创', '风格灵动'],
},
handleSuccess(e) {
const { files } = e.detail;
this.setData({
originFiles: files,
});
},
handleRemove(e) {
const { index } = e.detail;
const { originFiles } = this.data;
originFiles.splice(index, 1);
this.setData({
originFiles,
});
},
gotoMap() {
wx.showToast({
title: '获取当前位置...',
icon: 'none',
image: '',
duration: 1500,
mask: false,
success: () => {},
fail: () => {},
complete: () => {},
});
},
saveDraft() {
wx.reLaunch({
url: `/pages/home/index?oper=save`,
});
},
release() {
wx.reLaunch({
url: `/pages/home/index?oper=release`,
});
},
});

View File

@ -1,11 +0,0 @@
{
"navigationStyle": "custom",
"usingComponents": {
"t-navbar": "tdesign-miniprogram/navbar/navbar",
"t-upload": "tdesign-miniprogram/upload/upload",
"t-textarea": "tdesign-miniprogram/textarea/textarea",
"t-cell": "tdesign-miniprogram/cell/cell",
"t-check-tag": "tdesign-miniprogram/check-tag/check-tag",
"t-button": "tdesign-miniprogram/button/button"
}
}

View File

@ -1,60 +0,0 @@
/* pages/release/index.wxss */
.release-container {
display: flex;
flex-direction: column;
align-items: center;
justify-content: space-between;
padding: 0;
box-sizing: border-box;
.box {
width: 100%;
}
.upload {
height: 112rpx * 2;
position: relative;
&-class {
width: 344rpx * 2;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
}
.desc {
height: 132rpx * 2;
display: flex;
padding: 32rpx;
align-items: flex-start;
justify-content: space-between;
box-sizing: border-box;
.desc-class {
width: 246rpx * 2;
height: 100%;
padding: 0;
}
}
.taggroup {
.cell-title-class {
width: 81rpx * 2;
}
.cell-note-class {
overflow-x: auto;
justify-content: start;
}
.tag-class {
margin-left: 24rpx;
}
}
.btngroup {
display: flex;
justify-content: space-evenly;
padding: 32rpx;
position: fixed;
bottom: 64rpx;
.btn-class {
width: 163.5rpx * 2;
margin: 0;
}
}
}

View File

@ -1,26 +0,0 @@
<t-navbar title="发布动态" left-arrow />
<view class="page">
<view class="release-container">
<view class="upload box">
<t-upload t-class="upload-class" media-type="{{['image']}}" files="{{originFiles}}" gridConfig="{{gridConfig}}" bind:success="handleSuccess" bind:remove="handleRemove" max="4" />
</view>
<view class="desc box">
<view class="desc-label">添加描述</view>
<t-textarea t-class="desc-class" t-class-textarea="placeholder-class" placeholder="分享你此刻的想法" maxlength="500" disableDefaultPadding="{{true}}" indicator />
</view>
<view class="taggroup box">
<t-cell t-class-title="cell-title-class" t-class-note="cell-note-class" title="添加标签">
<block wx:for="{{tags}}" wx:key="index">
<t-check-tag t-class="tag-class" size="medium" default-checked="{{index===0}}" variant="dark" content="#{{item}}" slot="note" />
</block>
</t-cell>
</view>
<view class="location box">
<t-cell title="所在位置" hover arrow leftIcon="location" bindtap="gotoMap" />
</view>
<view class="btngroup box">
<t-button t-class="btn-class" theme="light" icon="file-copy" content="存草稿" size="large" bindtap="saveDraft"></t-button>
<t-button t-class="btn-class" theme="primary" icon="upload" content="发布" size="large" bindtap="release"></t-button>
</view>
</view>
</view>

View File

@ -1,181 +0,0 @@
import request from '~/api/request';
Page({
data: {
historyWords: [],
popularWords: [],
searchValue: '',
dialog: {
title: '确认删除当前历史记录',
showCancelButton: true,
message: '',
},
dialogShow: false,
},
deleteType: 0,
deleteIndex: '',
onShow() {
this.queryHistory();
this.queryPopular();
},
/**
* 查询历史记录
* @returns {Promise<void>}
*/
async queryHistory() {
request('/api/searchHistory').then((res) => {
const { code, data } = res;
if (code === 200) {
const { historyWords = [] } = data;
this.setData({
historyWords,
});
}
});
},
/**
* 查询热门搜索
* @returns {Promise<void>}
*/
async queryPopular() {
request('/api/searchPopular').then((res) => {
const { code, data } = res;
if (code === 200) {
const { popularWords = [] } = data;
this.setData({
popularWords,
});
}
});
},
setHistoryWords(searchValue) {
if (!searchValue) return;
const { historyWords } = this.data;
const index = historyWords.indexOf(searchValue);
if (index !== -1) {
historyWords.splice(index, 1);
}
historyWords.unshift(searchValue);
this.setData({
searchValue,
historyWords,
});
// if (searchValue) {
// wx.navigateTo({
// url: `/pages/goods/result/index?searchValue=${searchValue}`,
// });
// }
},
/**
* 清空历史记录的再次确认框
* 后期可能需要增加一个向后端请求的接口
* @returns {Promise<void>}
*/
confirm() {
const { historyWords } = this.data;
const { deleteType, deleteIndex } = this;
if (deleteType === 0) {
historyWords.splice(deleteIndex, 1);
this.setData({
historyWords,
dialogShow: false,
});
} else {
this.setData({ historyWords: [], dialogShow: false });
}
},
/**
* 取消清空历史记录
* @returns {Promise<void>}
*/
close() {
this.setData({ dialogShow: false });
},
/**
* 点击清空历史记录
* @returns {Promise<void>}
*/
handleClearHistory() {
const { dialog } = this.data;
this.deleteType = 1;
this.setData({
dialog: {
...dialog,
message: '确认删除所有历史记录',
},
dialogShow: true,
});
},
deleteCurr(e) {
const { index } = e.currentTarget.dataset;
const { dialog } = this.data;
this.deleteIndex = index;
this.deleteType = 0;
this.setData({
dialog: {
...dialog,
message: '确认删除当前历史记录',
},
dialogShow: true,
});
},
/**
* 点击关键词跳转搜索
* 后期需要增加跳转和后端请求接口
* @returns {Promise<void>}
*/
handleHistoryTap(e) {
const { historyWords } = this.data;
const { index } = e.currentTarget.dataset;
const searchValue = historyWords[index || 0] || '';
this.setHistoryWords(searchValue);
},
handlePopularTap(e) {
const { popularWords } = this.data;
const { index } = e.currentTarget.dataset;
const searchValue = popularWords[index || 0] || '';
this.setHistoryWords(searchValue);
},
/**
* 提交搜索框内容
* 后期需要增加跳转和后端请求接口
* @returns {Promise<void>}
*/
handleSubmit(e) {
const { value } = e.detail;
if (value.length === 0) return;
this.setHistoryWords(value);
},
/**
* 点击取消回到主页
* @returns {Promise<void>}
*/
actionHandle() {
this.setData({
searchValue: '',
});
wx.switchTab({ url: '/pages/home/index' });
},
});

View File

@ -1,11 +0,0 @@
{
"navigationStyle": "custom",
"usingComponents": {
"t-navbar": "tdesign-miniprogram/navbar/navbar",
"t-search": "/miniprogram_npm/tdesign-miniprogram/search/search",
"t-icon": "/miniprogram_npm/tdesign-miniprogram/icon/icon",
"t-dialog": "/miniprogram_npm/tdesign-miniprogram/dialog/dialog",
"t-tag": "/miniprogram_npm/tdesign-miniprogram/tag/tag",
"t-check-tag": "/miniprogram_npm/tdesign-miniprogram/check-tag/check-tag"
}
}

View File

@ -1,65 +0,0 @@
<t-navbar title="搜索" left-arrow />
<view class="page search-page">
<view class="search-input">
<t-search
t-class-input-container="t-class__input-container"
t-class-input="t-search__input"
value="{{searchValue}}"
leftIcon="search"
action="取消"
shape="round"
placeholder="请搜索你想要的内容"
bind:submit="handleSubmit"
bind:action-click="actionHandle"
focus
></t-search>
</view>
<view class="search-wrap">
<view class="history-wrap">
<view class="search-header">
<text class="search-title">历史记录</text>
<t-icon name="delete" size="large" class="search-clear" bind:click="handleClearHistory" />
</view>
<view class="search-content">
<view
class="search-item"
hover-class="hover-history-item"
wx:for="{{historyWords}}"
bind:tap="handleHistoryTap"
bindlongpress="deleteCurr"
data-index="{{index}}"
wx:key="*this"
>
<t-tag class="history-item margin-12" max-width="{{343}}" variant="light">{{item}}</t-tag>
</view>
</view>
</view>
<view class="popular-wrap">
<view class="search-header">
<text class="search-title">搜索发现</text>
</view>
<view class="search-content">
<view
class="search-item"
hover-class="hover-history-item"
wx:for="{{popularWords}}"
bind:tap="handlePopularTap"
data-index="{{index}}"
wx:key="*this"
>
<t-tag class="popular-item margin-12" max-width="{{343}}" variant="light" icon="search"> {{item}} </t-tag>
</view>
</view>
</view>
</view>
<t-dialog
visible="{{dialogShow}}"
content="{{dialog.message}}"
bindconfirm="confirm"
bind:close="close"
confirm-btn="确定"
cancel-btn="{{dialog.showCancelButton ? '取消' : null}}"
t-class-confirm="dialog__button-confirm"
t-class-cancel="dialog__button-cancel"
/>
</view>

View File

@ -1,94 +0,0 @@
.search-input {
padding: 16rpx 0;
}
.search-page {
box-sizing: border-box;
width: 100vw;
height: 100vh;
padding: 0 30rpx;
}
.search-page .t-class__input-container {
border-radius: 999rpx !important;
}
.search-page .t-search__input {
font-size: 28rpx !important;
color: #333 !important;
}
.search-page .search-wrap {
margin-top: 24rpx;
}
.search-page .history-wrap {
margin-bottom: 20px;
}
.search-page .search-header {
display: flex;
flex-flow: row nowrap;
justify-content: space-between;
align-items: center;
}
.search-page .search-title {
font-size: 30rpx;
font-family:
PingFangSC-Semibold,
PingFang SC;
font-weight: 600;
color: rgba(51, 51, 51, 1);
line-height: 42rpx;
}
.search-page .search-clear {
font-size: 30rpx;
font-family: PingFang SC;
line-height: 32rpx;
color: #999999;
font-weight: bold;
}
.search-page .search-content {
overflow: hidden;
display: flex;
flex-flow: row wrap;
justify-content: flex-start;
align-items: flex-start;
margin-top: 24rpx;
}
.search-page .search-item {
color: #333333;
font-size: 24rpx;
line-height: 32rpx;
font-weight: 400;
margin-right: 24rpx;
margin-bottom: 24rpx;
border-radius: 3rpx;
}
.search-page .hover-history-item {
position: relative;
top: 3rpx;
left: 3rpx;
box-shadow: 0px 0px 8px rgba(0, 0, 0, 0.1) inset;
}
.add-notes__confirm {
color: #fa4126 !important;
}
.popular-wrap {
margin-top: 32rpx;
}
.search-page .search-item .popular-item {
background: #f3f3f3;
}
.search-page .search-item .history-item {
background: #e7e7e7;
}

View File

@ -1,56 +0,0 @@
import useToastBehavior from '~/behaviors/useToast';
Page({
behaviors: [useToastBehavior],
data: {
menuData: [
[
{
title: '通用设置',
url: '',
icon: 'app',
},
{
title: '通知设置',
url: '',
icon: 'notification',
},
],
[
{
title: '深色模式',
url: '',
icon: 'image',
},
{
title: '字体大小',
url: '',
icon: 'chart',
},
{
title: '播放设置',
url: '',
icon: 'sound',
},
],
[
{
title: '账号安全',
url: '',
icon: 'secured',
},
{
title: '隐私',
url: '',
icon: 'info-circle',
},
],
],
},
onEleClick(e) {
const { title, url } = e.currentTarget.dataset.data;
if (url) return;
this.onShowToast('#t-toast', title);
},
});

View File

@ -1,9 +0,0 @@
{
"navigationStyle": "custom",
"usingComponents": {
"t-navbar": "tdesign-miniprogram/navbar/navbar",
"t-cell-group": "tdesign-miniprogram/cell-group/cell-group",
"t-cell": "tdesign-miniprogram/cell/cell",
"t-icon": "tdesign-miniprogram/icon/icon"
}
}

View File

@ -1,3 +0,0 @@
.cell-group-class {
margin: 32rpx !important;
}

View File

@ -1,21 +0,0 @@
<t-navbar title="设置" left-arrow />
<view class="setting">
<t-cell-group wx:for="{{menuData}}" wx:for-item="item" wx:key="index" t-class="cell-group-class" theme="card">
<t-cell
wx:for="{{item}}"
wx:for-item="carditem"
wx:key="cardkey"
title="{{carditem.title}}"
hover
arrow
left-icon="app"
url="{{carditem.url}}"
bordered="true"
leftIcon="{{carditem.icon}}"
data-data="{{carditem}}"
bindclick="onEleClick"
/>
</t-cell-group>
</view>
<t-toast id="t-toast" />

View File

@ -67,7 +67,8 @@
"projectname": "patient-mini", "projectname": "patient-mini",
"setting": { "setting": {
"compileHotReLoad": true, "compileHotReLoad": true,
"bigPackageSizeSupport": true "bigPackageSizeSupport": true,
"urlCheck": false
}, },
"libVersion": "3.7.12" "libVersion": "3.7.12"
} }