diff --git a/src/components/pickerArea/index.ts b/src/components/pickerArea/index.ts index eeccd32..db3f450 100644 --- a/src/components/pickerArea/index.ts +++ b/src/components/pickerArea/index.ts @@ -257,17 +257,26 @@ Component({ }) }, handleShare() { + const { ProvinceName, ProvinceId, CityName, CityId } = this.data + if (!ProvinceId) { + wx.showToast({ title: '请选择省份', icon: 'none' }) + return + } + if (!CityId) { + wx.showToast({ title: '请选择城市', icon: 'none' }) + return + } this.setData({ show: false, }) this.triggerEvent('change', [ { - label: this.data.ProvinceName, - value: this.data.ProvinceId, + label: ProvinceName, + value: ProvinceId, }, { - label: this.data.CityName, - value: this.data.CityId, + label: CityName, + value: CityId, }, ]) }, @@ -286,7 +295,7 @@ Component({ range, active: 1, scrollIntoView0: '', - scrollIntoView1: `id${this.data.CityId}`, + scrollIntoView1: this.data.CityId ? `id${this.data.CityId}` : '', }) }, handleProvince() { diff --git a/src/components/popup/index.scss b/src/components/popup/index.scss index 7363368..b71d6ef 100644 --- a/src/components/popup/index.scss +++ b/src/components/popup/index.scss @@ -1,1259 +1,125 @@ .popup1 { - padding: 84rpx 60rpx; - background: linear-gradient(6deg, #ffffff 0%, #ffe6e4 100%); - max-height: 75vh; - overflow-y: auto; - overflow-x: hidden; - .logo { - display: block; - margin: 0 auto; - width: 164rpx; - height: 164rpx; - border-radius: 32rpx; - } - .title { - margin-top: 32rpx; - font-size: 48rpx; - color: #f23a2f; - font-weight: bold; - text-align: center; - } - .content { - margin-top: 30rpx; - font-size: 32rpx; - color: #010105; - line-height: 52rpx; - } - .check { - margin-top: 64rpx; - font-size: 32rpx; - color: rgba(1, 1, 5, 0.3); - display: flex; - .checkbox { - transform: scale(0.8); - } - .c-content { - padding-top: 5rpx; - line-height: 48rpx; - } - } - .link { - color: #f23a2f; - } - .btn1 { - margin-top: 40rpx; - height: 88rpx; - border-radius: 84rpx; - font-size: 32rpx; - color: #ffffff; - text-align: center; - line-height: 88rpx; - background: linear-gradient(356deg, #f23a2f 0%, #fc684f 100%); - } - .btn2 { - margin-top: 20rpx; - height: 88rpx; - text-align: center; - line-height: 88rpx; - font-size: 32rpx; - color: rgba(1, 1, 5, 0.4); - } -} - -.popup2 { - padding: 36rpx 34rpx 58rpx; - background-color: #fff; - .photo { - width: 492rpx; - height: 492rpx; - } - .content { - font-size: 40rpx; - color: rgba(0, 0, 0, 1); - text-align: center; - } -} - -.popup3 { - .icon { - position: relative; - z-index: 1; - margin: 0 auto; - display: block; - width: 144rpx; - height: 144rpx; - } - .container { - margin-top: -94rpx; - padding: 124rpx 32rpx 32rpx; - width: 604rpx; - background: linear-gradient(7deg, #ffffff 19%, #ffe8e4 100%); - border-radius: 24rpx 24rpx 24rpx 24rpx; - box-sizing: border-box; - .title { - display: block; - margin: 0 auto; - text-align: center; - font-size: 36rpx; - font-weight: bold; - transform: skew(-10deg); - color: transparent; - background: linear-gradient(356deg, rgba(225, 36, 42, 1) 0%, rgba(255, 116, 64, 1) 100%); - background-clip: text; - -webkit-background-clip: text; - } - .card { - position: relative; - margin-top: 32rpx; - padding: 32rpx; - background: #ffffff; - display: flex; - gap: 16rpx; - justify-content: space-between; - box-shadow: 0rpx 4rpx 32rpx 0rpx rgba(0, 0, 0, 0.05); - border-radius: 24rpx 24rpx 24rpx 24rpx; - &::after { - position: absolute; - bottom: -24rpx; - left: 32rpx; - content: ''; - width: 476rpx; - height: 24rpx; - background: #ffebea; - border-radius: 0 0 24rpx 24rpx; - } - .avatar { - flex-shrink: 0; - width: 92rpx; - height: 92rpx; - border-radius: 50%; - } - .wrap { - flex: 1; - .name { - font-size: 32rpx; - color: rgba(1, 1, 5, 1); - font-weight: bold; - } - .hostipal { - margin-top: 16rpx; - line-height: 28rpx; - .content { - display: inline; - margin-right: 8rpx; - font-size: 28rpx; - color: rgba(161, 164, 172, 1); - } - .tag { - vertical-align: 2rpx; - display: inline-block; - font-size: 20rpx; - color: rgba(255, 255, 255, 1); - padding: 0 8rpx; - background-color: rgba(255, 186, 1, 1); - border-radius: 6rpx; - } - } - } - } - .btn { - margin-top: 66rpx; - height: 88rpx; - line-height: 88rpx; - font-size: 32rpx; - color: rgba(255, 255, 255, 1); - text-align: center; - background: linear-gradient(356deg, #f23a2f 0%, #fc684f 100%); - border-radius: 84rpx 84rpx 84rpx 84rpx; - } - } -} - -.popup4 { - .icon { - position: relative; - z-index: 1; - margin: 0 auto; - display: block; - width: 144rpx; - height: 144rpx; - } - .container { - margin-top: -94rpx; - padding: 124rpx 32rpx 32rpx; - width: 604rpx; - background: linear-gradient(7deg, #ffffff 19%, #ffe8e4 100%); - border-radius: 24rpx 24rpx 24rpx 24rpx; - box-sizing: border-box; - .title { - display: block; - margin: 0 auto; - width: 146rpx; - height: 34rpx; - } - .content { - margin-top: 16rpx; - font-size: 32rpx; - color: rgba(161, 164, 172, 1); - text-align: center; - } - .btn { - margin-top: 32rpx; - height: 88rpx; - line-height: 88rpx; - font-size: 32rpx; - color: rgba(255, 255, 255, 1); - text-align: center; - background: linear-gradient(356deg, #f23a2f 0%, #fc684f 100%); - border-radius: 84rpx 84rpx 84rpx 84rpx; - } - } -} - -.popup5 { - .container { - padding: 36rpx 32rpx 32rpx; - width: 604rpx; - background: linear-gradient(4deg, #f7f7fa 19%, #ffe8e4 100%); - border-radius: 24rpx 24rpx 24rpx 24rpx; + .popup-container { + width: 650rpx; + height: 840rpx; box-sizing: border-box; + padding: 238rpx 48rpx 0; .title { - display: block; - margin: 0 auto; - width: 242rpx; - height: 38rpx; - } - .row { - margin-top: 32rpx; - padding: 26rpx 32rpx; - display: flex; - gap: 22rpx; - align-items: center; - background: #ffffff; - border-radius: 16rpx 16rpx 16rpx 16rpx; - &:last-of-type { - margin-top: 24rpx; - } - .avatar { - flex-shrink: 0; - width: 96rpx; - height: 103rpx; - } - .wrap { - flex: 1; - line-height: 44rpx; - .name { - font-size: 32rpx; - color: rgba(1, 1, 5, 1); - font-weight: bold; - } - .content { - font-size: 32rpx; - color: rgba(161, 164, 172, 1); - } - } - .icon { - width: 40rpx; - height: 40rpx; - } - } - } -} - -.popup6 { - .container { - padding: 420rpx 0 0; - width: 610rpx; - height: 600rpx; - box-sizing: border-box; - text-align: center; - .title { - font-size: 40rpx; - color: rgba(1, 1, 5, 1); + font-size: 44rpx; + color: rgba(30, 41, 59, 1); font-weight: bold; + line-height: 53rpx; } .content { margin-top: 20rpx; font-size: 36rpx; - color: rgba(1, 1, 5, 1); - } - } -} - -.popup7 { - .container { - padding: 64rpx 66rpx 136rpx; - background: linear-gradient(6deg, #ffffff 0%, #ffdcd9 100%); - .title { - font-size: 36rpx; - color: rgba(1, 1, 5, 1); - font-weight: bold; - text-align: center; + color: rgba(100, 116, 139, 1); + line-height: 52rpx; } - .content { - margin-top: 24rpx; - font-size: 28rpx; - color: rgba(167, 169, 177, 1); - text-align: center; - } - .status-wrap { - margin-top: 28rpx; - display: grid; - grid-template-columns: repeat(3, 1fr); - gap: 20rpx; - .s-item { - .icon { - display: block; - width: 192rpx; - height: 192rpx; - } - .s-content { - position: relative; - margin: 0 auto; - padding: 16rpx; - font-size: 28rpx; - color: rgba(137, 141, 151, 1); - background: rgba(247, 247, 250, 1); - line-height: 36rpx; - border-radius: 12rpx; - text-align: center; - border: 1px solid rgba(247, 247, 250, 1); - .radio { - display: none; - position: absolute; - right: -1px; - bottom: -1px; - width: 32rpx; - height: 32rpx; - border-radius: 12rpx 0 12rpx 0; - background-color: rgba(246, 74, 58, 1); - .r-icon { - width: 24rpx; - height: 24rpx; - } - } - } - &.active { - .s-content { - background-color: rgba(255, 242, 240, 1); - border-color: rgba(246, 74, 58, 1); - color: rgba(246, 74, 58, 1); - .radio { - display: block; - } - } - } - } - } - } -} - -.popup8 { - .bg { - position: relative; - margin: 0 auto; - width: 492rpx; - height: 434rpx; - .header { - position: absolute; - top: 0; - left: 0; - width: 100%; - display: flex; - align-items: center; - justify-content: center; - gap: 12rpx; - .icon1 { - width: 36rpx; - height: 36rpx; - } - .icon2 { - width: 35rpx; - height: 43rpx; - } - .name { - font-size: 48rpx; - color: rgba(255, 255, 255, 1); - font-weight: bold; - line-height: 64rpx; - text-align: center; - } - } - } - .container { - margin-top: -180rpx; - position: relative; - padding: 178rpx 36rpx 36rpx; - width: 610rpx; - height: 390rpx; - box-sizing: border-box; - background: linear-gradient(180deg, #ffd6d4 0%, #ffffff 100%); - border-radius: 32rpx; - .icon { - position: absolute; - top: -110rpx; - left: 50%; - transform: translateX(-50%); - width: 280rpx; - height: 280rpx; - } - .title { - font-size: 32rpx; - color: rgba(1, 1, 5, 1); - font-weight: bold; - text-align: center; - } - .footer { - margin-top: 48rpx; - display: flex; - gap: 26rpx; - .cancel { - flex: 1; - padding: 22rpx; - display: flex; - align-items: center; - justify-content: center; - font-size: 32rpx; - color: rgba(246, 74, 58, 1); - border-radius: 84rpx; - border: 1px solid #f64a3a; - } - .submit { - flex: 1; - padding: 22rpx; - display: flex; - align-items: center; - justify-content: center; - font-size: 32rpx; - color: #fff; - background: linear-gradient(356deg, #f23a2f 0%, #fc684f 100%); - border-radius: 84rpx; - border: 1px solid #f64a3a; - } - } - } -} - -.popup9 { - .container { - width: 630rpx; - padding: 48rpx 32rpx 34rpx; - box-sizing: border-box; - background: linear-gradient(to top, #ffffff 0%, #ffffff 86%, #ffedeb 100%); - .title { - font-size: 36rpx; - color: rgba(1, 1, 5, 1); - font-weight: bold; - text-align: center; - } - .list { - .list-item { - padding: 32rpx 0; - display: flex; - align-items: center; - gap: 24rpx; - border-bottom: 1px solid rgba(247, 247, 250, 1); - &:last-of-type { - border: none; - } - .radio { - flex-shrink: 0; - width: 32rpx; - height: 32rpx; - background-color: rgba(247, 247, 250, 1); - border-radius: 50%; - .r-icon { - width: 100%; - height: 100%; - border-radius: 50%; - } - } - .content { - font-size: 32rpx; - color: rgba(137, 141, 151, 1); - line-height: 1; - } - } - } - .footer { - margin-top: 48rpx; - display: flex; - gap: 26rpx; - .cancel { - flex: 1; - padding: 22rpx; - display: flex; - align-items: center; - justify-content: center; - font-size: 32rpx; - color: rgba(246, 74, 58, 1); - border-radius: 84rpx; - border: 1px solid #f64a3a; - } - .submit { - flex: 1; - padding: 22rpx; - display: flex; - align-items: center; - justify-content: center; - font-size: 32rpx; - color: #fff; - background: linear-gradient(356deg, #f23a2f 0%, #fc684f 100%); - border-radius: 84rpx; - border: 1px solid #f64a3a; - } - } - } -} - -.popup10 { - .status { - position: relative; - z-index: 1; - display: block; - margin: 0 auto; - width: 144rpx; - height: 144rpx; - } - .container { - margin-top: -72rpx; - padding: 106rpx 0 0; - width: 604rpx; - height: 244rpx; - background: linear-gradient(7deg, #ffffff 19%, #ffe8e4 100%); - border-radius: 24rpx 24rpx 24rpx 24rpx; - box-sizing: border-box; - .title { + .code { + margin: 70rpx auto 0; display: block; - margin: 0 auto; - width: 306rpx; - height: 40rpx; + width: 318rpx; + height: 318rpx; } } } -.popup11 { - .container { - width: 630rpx; - padding: 48rpx 32rpx 34rpx; - box-sizing: border-box; - background: linear-gradient(to top, #ffffff 0%, #ffffff 86%, #ffedeb 100%); - .title { - font-size: 36rpx; - color: rgba(1, 1, 5, 1); - font-weight: bold; - text-align: center; - } - .list { - margin-top: 20rpx; - max-height: 40vh; - overflow-y: ayto; - overflow-x: hidden; - .list-item { - padding: 32rpx 0; - display: flex; - align-items: center; - gap: 24rpx; - border-bottom: 1px solid rgba(247, 247, 250, 1); - &:last-of-type { - border: none; - } - .radio { - width: 32rpx; - height: 32rpx; - background-color: rgba(247, 247, 250, 1); - border-radius: 50%; - .r-icon { - width: 100%; - height: 100%; - border-radius: 50%; - } - } - .content { - font-size: 32rpx; - color: rgba(137, 141, 151, 1); - line-height: 1; - } - } - } - .texcarea { - padding: 24rpx 32rpx; - border-radius: 12rpx; - width: 100%; - height: 150rpx; - box-sizing: border-box; - font-size: 32rpx; - color: rgba(1, 1, 5, 1); - background-color: rgba(247, 247, 250, 1); - } - .footer { - margin-top: 48rpx; - display: flex; - gap: 26rpx; - .cancel { - flex: 1; - padding: 22rpx; - display: flex; - align-items: center; - justify-content: center; - font-size: 32rpx; - color: rgba(246, 74, 58, 1); - border-radius: 84rpx; - border: 1px solid #f64a3a; - } - .submit { - flex: 1; - padding: 22rpx; - display: flex; - align-items: center; - justify-content: center; - font-size: 32rpx; - color: #fff; - background: linear-gradient(356deg, #f23a2f 0%, #fc684f 100%); - border-radius: 84rpx; - border: 1px solid #f64a3a; - } - } - } -} - -.popup12 { - .icon { - position: relative; - z-index: 1; - margin: 0 auto; - display: block; - width: 144rpx; - height: 144rpx; - } - .container { - margin-top: -94rpx; - padding: 108rpx 32rpx 32rpx; - width: 604rpx; - background: linear-gradient(7deg, #ffffff 19%, #ffe8e4 100%); - border-radius: 24rpx 24rpx 24rpx 24rpx; - box-sizing: border-box; - .title { - display: block; - margin: 0 auto; - width: 308rpx; - height: 34rpx; - } - .content { - margin-top: 16rpx; - font-size: 32rpx; - line-height: 48rpx; - color: rgba(161, 164, 172, 1); - text-align: center; - } - .tip { - margin-top: 24rpx; - padding: 10rpx 22rpx; - font-size: 28rpx; - color: rgba(246, 74, 58, 1); - text-align: center; - border-radius: 24rpx; - background-color: rgba(255, 231, 228, 1); - } - .footer { - margin-top: 32rpx; - display: flex; - gap: 26rpx; - .cancel { - flex: 1; - padding: 22rpx; - display: flex; - align-items: center; - justify-content: center; - font-size: 32rpx; - color: rgba(246, 74, 58, 1); - border-radius: 84rpx; - border: 1px solid #f64a3a; - } - .submit { - flex: 1; - padding: 22rpx; - display: flex; - align-items: center; - justify-content: center; - font-size: 32rpx; - color: #fff; - background: linear-gradient(356deg, #f23a2f 0%, #fc684f 100%); - border-radius: 84rpx; - border: 1px solid #f64a3a; - } - } - } -} - -.popup13 { - .icon { - position: relative; - z-index: 1; - margin: 0 auto; - display: block; - width: 144rpx; - height: 144rpx; - } - .container { - margin-top: -94rpx; - padding: 106rpx 32rpx 32rpx; - width: 604rpx; - background: linear-gradient(7deg, #ffffff 19%, #ffe8e4 100%); - border-radius: 24rpx 24rpx 24rpx 24rpx; - box-sizing: border-box; - .title { - display: block; - margin: 0 auto; - width: 495rpx; - height: 78rpx; - } - .card { +.popup2 { + .popup-container { + .badge { position: relative; - margin-top: 32rpx; - padding: 32rpx; - background: #ffffff; - display: flex; - gap: 16rpx; - justify-content: space-between; - box-shadow: 0rpx 4rpx 32rpx 0rpx rgba(0, 0, 0, 0.05); - border-radius: 24rpx 24rpx 24rpx 24rpx; - &::after { - position: absolute; - bottom: -24rpx; - left: 32rpx; - content: ''; - width: 476rpx; - height: 24rpx; - background: #ffebea; - border-radius: 0 0 24rpx 24rpx; - } - .avatar { - flex-shrink: 0; - width: 92rpx; - height: 92rpx; - border-radius: 50%; - } - .wrap { - flex: 1; - .name { - font-size: 32rpx; - color: rgba(1, 1, 5, 1); - font-weight: bold; - } - .hostipal { - margin-top: 16rpx; - line-height: 28rpx; - .content { - margin-right: 8rpx; - display: inline-block; - font-size: 28rpx; - color: rgba(161, 164, 172, 1); - } - .tag { - display: inline-block; - font-size: 20rpx; - color: rgba(255, 255, 255, 1); - padding: 0 8rpx; - background-color: rgba(255, 186, 1, 1); - border-radius: 6rpx; - } - } - } - } - .footer { - margin-top: 52rpx; - display: flex; - gap: 26rpx; - .cancel { - flex: 1; - padding: 22rpx; - display: flex; - align-items: center; - justify-content: center; - font-size: 32rpx; - color: rgba(246, 74, 58, 1); - border-radius: 84rpx; - border: 1px solid #f64a3a; - } - .submit { - flex: 1; - padding: 22rpx; - display: flex; - align-items: center; - justify-content: center; - font-size: 32rpx; - color: #fff; - background: linear-gradient(356deg, #f23a2f 0%, #fc684f 100%); - border-radius: 84rpx; - border: 1px solid #f64a3a; - } - } - } -} - -.popup14 { - .container { - padding: 48rpx 32rpx 32rpx; - width: 604rpx; - background: linear-gradient(7deg, #ffffff 19%, #ffe8e4 100%); - border-radius: 24rpx 24rpx 24rpx 24rpx; - box-sizing: border-box; - .title { - display: block; - margin: 0 auto; - width: 365rpx; - height: 34rpx; - } - .picker-content { - margin-top: 24rpx; - padding: 28rpx; - background-color: rgba(255, 255, 255, 1); - border-radius: 24rpx; - font-size: 32rpx; - color: rgba(1, 1, 5, 1); - text-align: center; - &:empty::after { - color: rgba(161, 164, 172, 0.5); - content: attr(data-place); - } - } - .footer { - margin-top: 32rpx; - display: flex; - gap: 26rpx; - .cancel { - flex: 1; - padding: 22rpx; - display: flex; - align-items: center; - justify-content: center; - font-size: 32rpx; - color: rgba(246, 74, 58, 1); - border-radius: 84rpx; - border: 1px solid #f64a3a; - } - .submit { - flex: 1; - padding: 22rpx; - display: flex; - align-items: center; - justify-content: center; - font-size: 32rpx; - color: #fff; - background: linear-gradient(356deg, #f23a2f 0%, #fc684f 100%); - border-radius: 84rpx; - border: 1px solid #f64a3a; - } - } - } -} - -.popup15 { - .icon { - position: relative; - z-index: 1; - margin: 0 auto; - display: block; - width: 144rpx; - height: 144rpx; - } - .container { - margin-top: -94rpx; - padding: 106rpx 32rpx 32rpx; - width: 604rpx; - background: linear-gradient(7deg, #ffffff 19%, #ffe8e4 100%); - border-radius: 24rpx 24rpx 24rpx 24rpx; - box-sizing: border-box; - .title { + z-index: 1; display: block; margin: 0 auto; - width: 495rpx; - height: 78rpx; - } - .card { - position: relative; - margin-top: 32rpx; - padding: 32rpx; - background: #ffffff; - display: flex; - gap: 16rpx; - justify-content: space-between; - box-shadow: 0rpx 4rpx 32rpx 0rpx rgba(0, 0, 0, 0.05); - border-radius: 24rpx 24rpx 24rpx 24rpx; - &::after { - position: absolute; - bottom: -24rpx; - left: 32rpx; - content: ''; - width: 476rpx; - height: 24rpx; - background: #ffebea; - border-radius: 0 0 24rpx 24rpx; - } - .avatar { - flex-shrink: 0; - width: 92rpx; - height: 92rpx; - border-radius: 50%; - } - .wrap { - flex: 1; - .name { - font-size: 32rpx; - color: rgba(1, 1, 5, 1); - font-weight: bold; - } - .hostipal { - margin-top: 16rpx; - line-height: 28rpx; - .content { - margin-right: 8rpx; - display: inline-block; - font-size: 28rpx; - color: rgba(161, 164, 172, 1); - } - .tag { - vertical-align: 2rpx; - display: inline-block; - font-size: 20rpx; - color: rgba(255, 255, 255, 1); - padding: 0 8rpx; - background-color: rgba(255, 186, 1, 1); - border-radius: 6rpx; - } + width: 400rpx; + height: 252rpx; + } + .container { + margin-top: -126rpx; + width: 650rpx; + height: 736rpx; + border-radius: 42rpx; + .title { + padding-top: 146rpx; + text-align: center; + font-size: 40rpx; + color: rgba(30, 41, 59, 1); + font-weight: bold; + line-height: 53rpx; + } + .code-wrap { + margin: 36rpx auto 0; + width: 318rpx; + height: 318rpx; + padding: 18rpx; + box-sizing: border-box; + .code { + display: block; + width: 100%; + height: 100%; } } - } - .footer { - margin-top: 52rpx; - display: flex; - gap: 26rpx; - .cancel { - flex: 1; - padding: 22rpx; - display: flex; - align-items: center; - justify-content: center; - font-size: 32rpx; - color: rgba(246, 74, 58, 1); - border-radius: 84rpx; - border: 1px solid #f64a3a; - } - .submit { - flex: 1; - padding: 22rpx; - display: flex; - align-items: center; - justify-content: center; - font-size: 32rpx; - color: #fff; - background: linear-gradient(356deg, #f23a2f 0%, #fc684f 100%); - border-radius: 84rpx; - border: 1px solid #f64a3a; - } - } - } -} - -.popup16 { - .container { - width: 630rpx; - padding: 48rpx 32rpx 34rpx; - box-sizing: border-box; - background: linear-gradient(to top, rgba(247, 247, 250, 1) 0%, rgba(247, 247, 250, 1) 86%, #ffedeb 100%); - .title { - display: block; - margin: 0 auto; - width: 320rpx; - height: 38rpx; - } - .list { - margin-top: 20rpx; - max-height: 50vh; - overflow-y: auto; - &::-webkit-scrollbar { - display: none; - } - .list-item { - position: relative; + .content { margin-top: 32rpx; - padding: 32rpx; - background: rgba(255, 255, 255, 1); - display: flex; - align-items: center; - gap: 16rpx; - justify-content: space-between; - box-shadow: 0rpx 4rpx 32rpx 0rpx rgba(0, 0, 0, 0.05); - border-radius: 24rpx 24rpx 24rpx 24rpx; - &:last-of-type { - border: none; - } - .radio { - width: 32rpx; - height: 32rpx; - background-color: rgba(247, 247, 250, 1); - border-radius: 50%; - .r-icon { - width: 100%; - height: 100%; - border-radius: 50%; - } - } - .avatar { - flex-shrink: 0; - width: 92rpx; - height: 92rpx; - border-radius: 50%; - } - .wrap { - flex: 1; - .name { - font-size: 32rpx; - color: rgba(1, 1, 5, 1); - font-weight: bold; - } - .hostipal { - margin-top: 16rpx; - line-height: 36rpx; - .content { - margin-right: 8rpx; - display: inline; - font-size: 28rpx; - color: rgba(161, 164, 172, 1); - } - .tag { - vertical-align: 2rpx; - display: inline-block; - font-size: 20rpx; - color: rgba(255, 255, 255, 1); - padding: 0 8rpx; - background-color: rgba(255, 186, 1, 1); - border-radius: 6rpx; - } - } - } - } - } - .footer { - margin-top: 48rpx; - display: flex; - gap: 26rpx; - .cancel { - flex: 1; - padding: 22rpx; - display: flex; - align-items: center; - justify-content: center; - font-size: 32rpx; - color: rgba(246, 74, 58, 1); - border-radius: 84rpx; - border: 1px solid #f64a3a; - } - .submit { - flex: 1; - padding: 22rpx; - display: flex; - align-items: center; - justify-content: center; font-size: 32rpx; - color: #fff; - background: linear-gradient(356deg, #f23a2f 0%, #fc684f 100%); - border-radius: 84rpx; - border: 1px solid #f64a3a; - } - } - } -} - -.popup17 { - .icon { - position: relative; - z-index: 1; - margin: 0 auto; - display: block; - width: 144rpx; - height: 144rpx; - } - .container { - margin-top: -94rpx; - padding: 108rpx 32rpx 32rpx; - width: 604rpx; - background: linear-gradient(7deg, #ffffff 19%, #ffe8e4 100%); - border-radius: 24rpx 24rpx 24rpx 24rpx; - box-sizing: border-box; - .title { - font-size: 32rpx; - color: rgba(1, 1, 5, 1); - text-align: center; - } - .hostipal { - margin-top: 32rpx; - font-size: 36rpx; - color: rgba(1, 1, 5, 1); - font-weight: bold; - text-align: center; - } - .address { - margin-top: 12rpx; - text-align: center; - font-size: 28rpx; - color: rgba(161, 164, 172, 1); - } - .footer { - margin-top: 32rpx; - display: flex; - gap: 26rpx; - .cancel { - flex: 1; - padding: 22rpx; - display: flex; - align-items: center; - justify-content: center; - font-size: 32rpx; - color: rgba(246, 74, 58, 1); - border-radius: 84rpx; - border: 1px solid #f64a3a; - } - .submit { - flex: 1; - padding: 22rpx; - display: flex; - align-items: center; - justify-content: center; - font-size: 32rpx; - color: #fff; - background: linear-gradient(356deg, #f23a2f 0%, #fc684f 100%); - border-radius: 84rpx; - border: 1px solid #f64a3a; + color: rgba(100, 116, 139, 1); + line-height: 48rpx; + text-align: center; } } } } -.popup18 { - .container { - padding: 54rpx 32rpx 32rpx; - width: 590rpx; - height: 688rpx; - background: linear-gradient(5deg, #ffffff 0%, #ffe7e2 100%); - border-radius: 24rpx 24rpx 24rpx 24rpx; - box-sizing: border-box; - .title { +.popup3 { + .popup-container { + .badge { + position: relative; + z-index: 1; display: block; margin: 0 auto; - width: 287rpx; - height: 98rpx; - } - .code-wrap { - margin: 40rpx auto 0; - padding-top: 60rpx; - width: 382rpx; - height: 430rpx; - .code { - margin: 0 auto; - display: block; - width: 296rpx; - height: 296rpx; - border-radius: 36rpx; - } - } - } -} - -.popup19 { - .badge { - position: relative; - z-index: 1; - margin: 0 auto; - display: block; - width: 194rpx; - height: 167rpx; - } - .container { - margin-top: -87rpx; - padding: 116rpx 36rpx 34rpx; - width: 610rpx; - height: 370rpx; - box-sizing: border-box; - background: linear-gradient(7deg, #ffffff 19%, #ffe8e4 100%); - border-radius: 24rpx 24rpx 24rpx 24rpx; - border: 2rpx solid #ffffff; - .title { - font-size: 32rpx; - color: rgba(1, 1, 5, 1); - line-height: 48rpx; - font-weight: bold; - text-align: center; - } - .footer { - margin-top: 32rpx; - display: flex; - gap: 26rpx; - .cancel { - flex: 1; - padding: 22rpx; - display: flex; - align-items: center; - justify-content: center; - font-size: 32rpx; - color: rgba(246, 74, 58, 1); - border-radius: 84rpx; - border: 1px solid #f64a3a; + width: 400rpx; + height: 252rpx; + } + .container { + margin-top: -126rpx; + width: 650rpx; + height: 736rpx; + border-radius: 42rpx; + .title { + padding-top: 146rpx; + text-align: center; + font-size: 40rpx; + color: rgba(30, 41, 59, 1); + font-weight: bold; + line-height: 53rpx; + } + .code-wrap { + margin: 36rpx auto 0; + width: 318rpx; + height: 318rpx; + padding: 18rpx; + box-sizing: border-box; + .code { + display: block; + width: 100%; + height: 100%; + } } - .submit { - flex: 1; - padding: 22rpx; - display: flex; - align-items: center; - justify-content: center; + .content { + margin-top: 32rpx; font-size: 32rpx; - color: #fff; - background: linear-gradient(356deg, #f23a2f 0%, #fc684f 100%); - border-radius: 84rpx; - border: 1px solid #f64a3a; + color: rgba(100, 116, 139, 1); + line-height: 48rpx; + text-align: center; } } } } -.popup20 { - .badge { - position: relative; - z-index: 1; - display: block; - margin: 0 auto; - width: 220rpx; - height: 278rpx; - } - .container { - margin-top: -150rpx; - padding: 166rpx 60rpx 48rpx; - background: linear-gradient(180deg, #ffe8e4 0%, #ffffff 56.28%, #ffffff 100%); - border-radius: 48rpx; - .title { - text-align: center; - font-size: 32rpx; - color: #010105; - } - .submit { - margin: 32rpx auto 0; - width: 440rpx; - height: 88rpx; - font-size: 32rpx; - color: #ffffff; - display: flex; - align-items: center; - justify-content: center; - background: linear-gradient(184deg, #f23a2f 0%, #fc684f 100%); - border-radius: 84rpx 84rpx 84rpx 84rpx; - } - } -} - .close { margin: 32rpx auto 0; display: block; - width: 64rpx; - height: 64rpx; + width: 88rpx; + height: 88rpx; } diff --git a/src/components/popup/index.wxml b/src/components/popup/index.wxml index 88360ea..6bdc8e7 100644 --- a/src/components/popup/index.wxml +++ b/src/components/popup/index.wxml @@ -9,35 +9,48 @@ safe-area-inset-bottom="{{false}}" root-portal > - - - 欢迎加入“愈见守护” - - 亲爱的用户,为了更好地向您提供平台服务保护您的权益,我们完善了 - 《个人信息及隐私政策》 - ,请您仔细阅读。一旦您开始使用,即表示您已充分理解并同意协议内容。 + + + + 关注“星动守护” + 我们将在每周五下午7点提醒您记录 + - - - - 我特此同意 - 《个人信息及隐私政策》 - 规定收集我的相关敏感个人信息 + + + + + + + 保存复诊记录成功! + + + + + 关注“心动守护”公众号 + + 获得服务通知 + + + + + + + + + + 保存复诊记录成功! + + + + + 关注“心动守护”公众号 + + 获得服务通知 + - 同意并继续 - 不同意 - + diff --git a/src/images/badge1.png b/src/images/badge1.png new file mode 100644 index 0000000..bfe28f3 Binary files /dev/null and b/src/images/badge1.png differ diff --git a/src/images/badge2.png b/src/images/badge2.png new file mode 100644 index 0000000..9199794 Binary files /dev/null and b/src/images/badge2.png differ diff --git a/src/images/bg13.png b/src/images/bg13.png new file mode 100644 index 0000000..27d8ef5 Binary files /dev/null and b/src/images/bg13.png differ diff --git a/src/images/bg14.png b/src/images/bg14.png new file mode 100644 index 0000000..e82443b Binary files /dev/null and b/src/images/bg14.png differ diff --git a/src/images/bg15.png b/src/images/bg15.png new file mode 100644 index 0000000..ad2f0ae Binary files /dev/null and b/src/images/bg15.png differ diff --git a/src/images/bg16.png b/src/images/bg16.png new file mode 100644 index 0000000..2be099b Binary files /dev/null and b/src/images/bg16.png differ diff --git a/src/images/clsoe.png b/src/images/clsoe.png new file mode 100644 index 0000000..bb23ac9 Binary files /dev/null and b/src/images/clsoe.png differ diff --git a/src/pages/articleDetail/index.scss b/src/pages/articleDetail/index.scss index 0a7767b..53bcf63 100644 --- a/src/pages/articleDetail/index.scss +++ b/src/pages/articleDetail/index.scss @@ -169,6 +169,7 @@ page { position: fixed; bottom: 0; left: 0; + z-index: 10; width: 100%; padding: 0 30rpx calc(env(safe-area-inset-bottom) + 30rpx) 20rpx; box-sizing: border-box; diff --git a/src/pages/followForm/index.ts b/src/pages/followForm/index.ts index e661e7d..742440f 100644 --- a/src/pages/followForm/index.ts +++ b/src/pages/followForm/index.ts @@ -3,9 +3,10 @@ const app = getApp() Page({ data: { popupShow: false, - popupType: '', + popupType: 'popup2', popupParams: { - position: 'bottom', + position: 'center', + close: true, } as any, topicShow: false, diff --git a/src/pages/followForm/index.wxml b/src/pages/followForm/index.wxml index 6ec15da..c6011be 100644 --- a/src/pages/followForm/index.wxml +++ b/src/pages/followForm/index.wxml @@ -88,3 +88,11 @@ 保存记录 + + diff --git a/src/pages/health/index.scss b/src/pages/health/index.scss index 3587122..d2c1957 100644 --- a/src/pages/health/index.scss +++ b/src/pages/health/index.scss @@ -70,6 +70,25 @@ page { height: 24rpx; } } + .week-alert { + display: flex; + align-items: center; + gap: 12rpx; + font-size: 28rpx; + color: rgba(30, 41, 59, 1); + .wx-checkbox-input { + width: 32rpx; + height: 32rpx; + border-radius: 8rpx; + &.wx-checkbox-input-checked { + background: linear-gradient(270deg, #439fc7 0%, #2f82a9 100%); + border-color: transparent; + &::before { + color: #fff; + } + } + } + } } .stats-grid { margin: 32rpx 30rpx 0; @@ -151,6 +170,55 @@ page { } } } + .list { + .list-card { + margin: 24rpx 30rpx; + padding: 32rpx; + border-radius: 32rpx; + border: 2rpx solid #fff; + background: rgba(255, 255, 255, 0.7); + box-shadow: 0 16rpx 64rpx 0 rgba(0, 99, 132, 0.04); + backdrop-filter: blur(10rpx); + .lc-header { + display: flex; + align-items: center; + justify-content: space-between; + .status { + padding: 8rpx 16rpx; + font-size: 24rpx; + border-radius: 12rpx; + &.status1 { + color: rgba(47, 130, 169, 1); + background-color: rgba(47, 130, 169, 0.05); + } + &.status2 { + color: rgba(234, 88, 26, 1); + background-color: rgba(234, 88, 26, 0.08); + } + } + .date { + font-size: 28rpx; + color: rgba(100, 116, 139, 1); + } + } + .row { + margin-top: 32rpx; + display: flex; + .label { + flex-shrink: 0; + font-size: 32rpx; + color: rgba(148, 163, 184, 1); + line-height: 44rpx; + } + .content { + padding-left: 32rpx; + font-size: 32rpx; + color: rgba(30, 41, 59, 1); + line-height: 44rpx; + } + } + } + } } .body3 { diff --git a/src/pages/health/index.ts b/src/pages/health/index.ts index f53059c..8552a7c 100644 --- a/src/pages/health/index.ts +++ b/src/pages/health/index.ts @@ -6,12 +6,12 @@ const PAGE_SIZE = 10 Page({ data: { popupShow: false, - popupType: '', + popupType: 'popup1', popupParams: { - position: 'bottom', + close: true, } as any, - tab: 2, + tab: 0, offsetTop: 0, // 复诊记录 @@ -21,10 +21,24 @@ Page({ pages: 1, count: 0, }, - startMonth: '', - endMonth: '', daysSinceLastRevisit: 0, totalRevisits: 0, + + startMonth: '', + endMonth: '', + + // 心率记录 + heartRateList: [] as any[], + heartRatePagination: { + page: 1, + pages: 1, + count: 0, + }, + heartStats: { + lastHeartRate: 0, + attackCount: 0, + maxHeartRate: 0, + }, }, ecDataTrendComponent: null as any, _loaded: false, @@ -40,8 +54,14 @@ Page({ app.waitLogin({ type: 0 }).then(() => { this._loaded = true - this.getRevisitList() - this.getLastRevisit() + if (this.data.tab === 1) { + this.getHeartStats() + this.getHeartChart() + this.getHeartRateList() + } else if (this.data.tab === 2) { + this.getRevisitList() + this.getLastRevisit() + } }) }, onReady() { @@ -63,20 +83,35 @@ Page({ if (query.tab !== undefined) { const tab = Number(query.tab) this.setData({ tab }) - if (tab === 2) { + if (tab === 1) { + this.getHeartStats() + this.getHeartChart() + this.getHeartRateList() + } else if (tab === 2) { this.getRevisitList() this.getLastRevisit() } return } } - if (this._loaded && this.data.tab === 2) { - this.getRevisitList() - this.getLastRevisit() + if (this._loaded) { + if (this.data.tab === 1) { + this.getHeartStats() + this.getHeartChart() + this.getHeartRateList() + } else if (this.data.tab === 2) { + this.getRevisitList() + this.getLastRevisit() + } } }, onReachBottom() { - if (this.data.tab === 2) { + if (this.data.tab === 1) { + const { heartRatePagination } = this.data + if (heartRatePagination.page < heartRatePagination.pages) { + this.getHeartRateList(heartRatePagination.page + 1, true) + } + } else if (this.data.tab === 2) { const { revisitPagination } = this.data if (revisitPagination.page < revisitPagination.pages) { this.getRevisitList(revisitPagination.page + 1, true) @@ -86,7 +121,11 @@ Page({ onChange(e: any) { const { index } = e.detail this.setData({ tab: index }) - if (index === 2) { + if (index === 1) { + this.getHeartStats() + this.getHeartChart() + this.getHeartRateList() + } else if (index === 2) { this.getRevisitList() this.getLastRevisit() } @@ -134,11 +173,21 @@ Page({ }, onStartMonthChange(e: any) { this.setData({ startMonth: e.detail.value }) - this.getRevisitList() + if (this.data.tab === 1) { + this.getHeartChart() + this.getHeartRateList() + } else { + this.getRevisitList() + } }, onEndMonthChange(e: any) { this.setData({ endMonth: e.detail.value }) - this.getRevisitList() + if (this.data.tab === 1) { + this.getHeartChart() + this.getHeartRateList() + } else { + this.getRevisitList() + } }, handleRevisitTap(e: any) { const { id } = e.currentTarget.dataset @@ -146,13 +195,83 @@ Page({ url: `/pages/followDetail/index?id=${id}`, }) }, - handleAddRevisit() { + handleHeartTap(e: any) { + const { id } = e.currentTarget.dataset wx.navigateTo({ - url: '/pages/followForm/index', + url: `/pages/heartDetail/index?id=${id}`, + }) + }, + handleAdd() { + if (this.data.tab === 1) { + wx.navigateTo({ + url: '/pages/heartForm/index', + }) + } else if (this.data.tab === 2) { + wx.navigateTo({ + url: '/pages/followForm/index', + }) + } + }, + getHeartRateList(page = 1, append = false) { + const { startMonth, endMonth } = this.data + wx.ajax({ + method: 'GET', + url: '?r=psvt/heart-rate-record/list', + data: { + page, + count: PAGE_SIZE, + startMonth, + endMonth, + }, + }).then((res: any) => { + const list = res.list || [] + this.setData({ + heartRateList: append ? this.data.heartRateList.concat(list) : list, + heartRatePagination: { + page: res.page || 1, + pages: res.pages || 1, + count: res.count || 0, + }, + }) + }) + }, + getHeartStats() { + wx.ajax({ + method: 'GET', + url: '?r=psvt/heart-rate-record/statistics', + }).then((res: any) => { + const lastRecord = res?.lastRecord || {} + this.setData({ + heartStats: { + lastHeartRate: lastRecord.heartRate || 0, + attackCount: res?.attackCount || 0, + maxHeartRate: res?.maxHeartRate || 0, + }, + }) + }) + }, + getHeartChart() { + const { startMonth, endMonth } = this.data + wx.ajax({ + method: 'GET', + url: '?r=psvt/heart-rate-record/chart-data', + data: { startMonth, endMonth }, + }).then((res: any) => { + this.initChart(res || []) }) }, - initChart() { - const arr = ['2026-06-01', '2026-06-02', '2026-06-03', '2026-06-04', '2026-06-05', '2026-06-06', '2026-06-07'] + initChart(chartData: any[] = []) { + const xAxisData = chartData.map((item: any) => item.recordDateTime) + const seriesData = chartData.map((item: any) => { + const isAttack = Number(item.isPsvtAttack) === 1 + return { + value: Number(item.heartRate), + itemStyle: isAttack + ? { color: '#d62828', borderColor: '#fff' } + : { color: '#fff', borderColor: '#46bc70', borderWidth: 2 }, + } + }) + this.ecDataTrendComponent.init((canvas, width, height, dpr) => { const chart = echarts.init(canvas, null, { width, @@ -166,7 +285,7 @@ Page({ { type: 'inside', startValue: 0, - endValue: 6, + endValue: Math.max(chartData.length - 1, 6), xAxisIndex: [0], }, ], @@ -222,8 +341,11 @@ Page({ type: 'category', axisLabel: { color: 'rgba(148, 163, 184, 1)', - formatter: function (value) { - const [_year, month, day] = value.split('-') + formatter: (value) => { + if (!value) return '' + const parts = value.split(' ') + const datePart = parts[0] || '' + const [_year, month, day] = datePart.split('-') return `${month}/${day}` }, }, @@ -236,7 +358,7 @@ Page({ splitLine: { show: false, }, - data: arr, + data: xAxisData, }, yAxis: [ { @@ -265,15 +387,22 @@ Page({ symbol: 'circle', symbolSize: 8, lineStyle: { color: '#46bc70', width: 2 }, - data: [ - { value: 62, itemStyle: { color: '#fff', borderColor: '#46bc70', borderWidth: 2 } }, - { value: 60, itemStyle: { color: '#fff', borderColor: '#46bc70', borderWidth: 2 } }, - { value: 61, itemStyle: { color: '#fff', borderColor: '#46bc70', borderWidth: 2 } }, - { value: 66, itemStyle: { color: '#d62828', borderColor: '#fff' } }, - { value: 63, itemStyle: { color: '#fff', borderColor: '#46bc70', borderWidth: 2 } }, - { value: 69, itemStyle: { color: '#d62828', borderColor: '#fff' } }, - { value: 64, itemStyle: { color: '#fff', borderColor: '#46bc70', borderWidth: 2 } }, - ], + data: seriesData, + markArea: { + itemStyle: { + color: 'rgba(45, 190, 141, 0.07)', + }, + data: [ + [ + { + yAxis: 60, + }, + { + yAxis: 100, + }, + ], + ], + }, }, ], } diff --git a/src/pages/health/index.wxml b/src/pages/health/index.wxml index 66bc011..f989d79 100644 --- a/src/pages/health/index.wxml +++ b/src/pages/health/index.wxml @@ -26,52 +26,81 @@ - - 2026.01 + + {{startMonth}} - - - 2026.01 + + {{endMonth}} + + + 每周提醒我 + 最近1次 - 59 + {{heartStats.lastHeartRate}} 次/分 最近发作 - 2 + {{heartStats.attackCount}} 最高心率 - 156 + {{heartStats.maxHeartRate}} 次/分 -
-
-
+ + + 正常心率 -
-
-
+ + + 发作心率 -
-
+
+
+ + + + + {{item.isPsvtAttack === 1 ? 'PSVT发作' : '未发作'}} + + {{item.recordDateTime}} + + + 心率 + {{item.heartRate}}次/分 + + + 备注 + {{item.remark}} + + + +
@@ -116,6 +145,14 @@ - + + + diff --git a/src/pages/heartDetail/index.ts b/src/pages/heartDetail/index.ts index 04c510a..4260e82 100644 --- a/src/pages/heartDetail/index.ts +++ b/src/pages/heartDetail/index.ts @@ -8,10 +8,54 @@ Page({ position: 'bottom', } as any, - fileList: [] as any[], + id: '', + detail: {} as any, }, - onLoad() { - app.waitLogin({ type: 0 }).then(() => {}) + onLoad(options: any) { + if (options.id) { + this.setData({ id: options.id }) + app.waitLogin({ type: 'any' }).then(() => { + this.getDetail(options.id) + }) + } + }, + getDetail(id: string) { + wx.ajax({ + method: 'GET', + url: '?r=psvt/heart-rate-record/detail', + data: { id }, + }).then((res: any) => { + this.setData({ detail: res || {} }) + }) + }, + handleDelete() { + const { id } = this.data + wx.showModal({ + title: '提示', + content: '确定删除该心率记录吗?', + success: (res) => { + if (!res.confirm) return + wx.ajax({ + method: 'POST', + url: '?r=psvt/heart-rate-record/delete', + data: { id: Number(id) }, + }).then(() => { + wx.showToast({ title: '删除成功', icon: 'success' }) + setTimeout(() => { + wx.navigateBack() + }, 1000) + }) + }, + }) + }, + handleEdit() { + const { id } = this.data + wx.navigateTo({ + url: `/pages/heartForm/index?id=${id}`, + }) + }, + handleBack() { + wx.navigateBack() }, handlePopupOk() { const { popupType } = this.data @@ -71,24 +115,6 @@ Page({ }) } }, - handleWechatWork() { - wx.navigateTo({ - url: '/pages/wechatWork/index', - }) - }, - handleSetData(e) { - const { fileList } = this.data - this.setData({ - fileList: [...fileList, ...e.detail], - }) - }, - handleDeleteFile(e) { - const { index } = e.detail - const { fileList } = this.data - this.setData({ - fileList: fileList.filter((_, i) => i !== index), - }) - }, }) export {} diff --git a/src/pages/heartDetail/index.wxml b/src/pages/heartDetail/index.wxml index 83b2661..82c7637 100644 --- a/src/pages/heartDetail/index.wxml +++ b/src/pages/heartDetail/index.wxml @@ -1,5 +1,5 @@ - + 心率记录详情 @@ -13,25 +13,23 @@ 日期 - 2026.07.06 21:30 + {{detail.recordDateTime || ''}} 心率 - 65 + {{detail.heartRate || ''}} 其他备注 - - 本次复诊心悸发作频率较上次减少,发作持续时间约5–10分钟,含服药物后可自行缓解。医生建议继续规律服药,避免剧烈运动及情绪激动,定期复查心电图。 - + {{detail.remark || ''}} - PSVT发作 + PSVT发作 - 删除 - 编辑 + 删除 + 编辑 diff --git a/src/pages/heartForm/index.json b/src/pages/heartForm/index.json index 5c0f8d9..db5e5f4 100644 --- a/src/pages/heartForm/index.json +++ b/src/pages/heartForm/index.json @@ -4,6 +4,7 @@ "popup": "/components/popup/index", "navbar": "/components/navbar/index", "uploadFile": "/components/uploadFile/index", - "van-popup": "@vant/weapp/popup/index" + "van-popup": "@vant/weapp/popup/index", + "van-datetime-picker": "@vant/weapp/datetime-picker/index" } } diff --git a/src/pages/heartForm/index.ts b/src/pages/heartForm/index.ts index 04c510a..0736f02 100644 --- a/src/pages/heartForm/index.ts +++ b/src/pages/heartForm/index.ts @@ -3,15 +3,144 @@ const app = getApp() Page({ data: { popupShow: false, - popupType: '', + popupType: 'popup3', popupParams: { - position: 'bottom', + position: 'center', + close: true, } as any, - fileList: [] as any[], + id: '', + heartRate: '', + recordDateTime: '', + datetimePickerShow: false, + datetimeValue: Date.now(), + isPsvtAttack: 0, + remark: '', + isEdit: false, }, - onLoad() { - app.waitLogin({ type: 0 }).then(() => {}) + onLoad(options: any) { + if (options.id) { + this.setData({ id: options.id, isEdit: true }) + app.waitLogin({ type: 'any' }).then(() => { + this.getDetail(options.id) + }) + } else { + app.waitLogin({ type: 'any' }).then(() => {}) + } + }, + getDetail(id: string) { + wx.ajax({ + method: 'GET', + url: '?r=psvt/heart-rate-record/detail', + data: { id }, + }).then((res: any) => { + if (!res) return + const recordDateTime = res.recordDateTime || '' + // 解析为时间戳供picker使用 + let datetimeValue = Date.now() + if (recordDateTime) { + const ts = new Date(recordDateTime.replace(/-/g, '/')).getTime() + if (!isNaN(ts)) datetimeValue = ts + } + // 显示格式 YYYY-MM-DD HH:mm(去掉秒) + const display = recordDateTime ? recordDateTime.replace(/:(\d{2})$/, '') : '' + this.setData({ + heartRate: String(res.heartRate || ''), + recordDateTime: display, + datetimeValue, + isPsvtAttack: res.isPsvtAttack ?? 0, + remark: res.remark || '', + }) + }) + }, + onHeartRateInput(e: any) { + this.setData({ heartRate: e.detail.value }) + }, + showDatetimePicker() { + this.setData({ datetimePickerShow: true }) + }, + hideDatetimePicker() { + this.setData({ datetimePickerShow: false }) + }, + onDatetimeConfirm(e: any) { + const date = new Date(e.detail) + const y = date.getFullYear() + const m = String(date.getMonth() + 1).padStart(2, '0') + const d = String(date.getDate()).padStart(2, '0') + const h = String(date.getHours()).padStart(2, '0') + const min = String(date.getMinutes()).padStart(2, '0') + const recordDateTime = `${y}-${m}-${d} ${h}:${min}` + this.setData({ + recordDateTime, + datetimeValue: e.detail, + datetimePickerShow: false, + }) + }, + onPsvtAttackChange(e: any) { + const checked = (e.detail.value || []).includes('1') + this.setData({ isPsvtAttack: checked ? 1 : 0 }) + }, + onRemarkInput(e: any) { + this.setData({ remark: e.detail.value }) + }, + handleSubmit() { + const { id, heartRate, recordDateTime, isPsvtAttack, remark, isEdit } = this.data + + if (!heartRate) { + wx.showToast({ title: '请输入心率数值', icon: 'none' }) + return + } + if (!recordDateTime) { + wx.showToast({ title: '请选择日期时间', icon: 'none' }) + return + } + + // API需要 Y-m-d H:i:s 格式,补秒 + const data = { + heartRate: Number(heartRate), + recordDateTime: `${recordDateTime}:00`, + isPsvtAttack, + remark, + } + + wx.showLoading({ title: '保存中' }) + + if (isEdit) { + wx.ajax({ + method: 'POST', + url: '?r=psvt/heart-rate-record/update', + data: { id: Number(id), ...data }, + }) + .then(() => { + wx.hideLoading() + wx.showToast({ title: '保存成功', icon: 'success' }) + setTimeout(() => { + wx.navigateBack() + }, 1000) + }) + .catch(() => { + wx.hideLoading() + }) + } else { + wx.ajax({ + method: 'POST', + url: '?r=psvt/heart-rate-record/create', + data, + }) + .then(() => { + wx.hideLoading() + wx.showToast({ title: '保存成功', icon: 'success' }) + setTimeout(() => { + wx.navigateBack() + }, 1000) + }) + .catch(() => { + wx.hideLoading() + }) + } + }, + handleBack() { + wx.navigateBack() }, handlePopupOk() { const { popupType } = this.data @@ -71,24 +200,6 @@ Page({ }) } }, - handleWechatWork() { - wx.navigateTo({ - url: '/pages/wechatWork/index', - }) - }, - handleSetData(e) { - const { fileList } = this.data - this.setData({ - fileList: [...fileList, ...e.detail], - }) - }, - handleDeleteFile(e) { - const { index } = e.detail - const { fileList } = this.data - this.setData({ - fileList: fileList.filter((_, i) => i !== index), - }) - }, }) export {} diff --git a/src/pages/heartForm/index.wxml b/src/pages/heartForm/index.wxml index fc7a363..7269ab4 100644 --- a/src/pages/heartForm/index.wxml +++ b/src/pages/heartForm/index.wxml @@ -1,5 +1,5 @@ - + 心率记录 @@ -13,27 +13,44 @@ 当前心率数值 - + 次/分 - 日期 - - - - - - + 日期时间 + + {{recordDateTime}} + + 其他备注 - + - PSVT发作 + + PSVT发作 + - 取消 - 保存记录 + 取消 + 保存记录 + + + + + + diff --git a/src/pages/index/index.scss b/src/pages/index/index.scss index a732eb2..d96e71e 100644 --- a/src/pages/index/index.scss +++ b/src/pages/index/index.scss @@ -150,6 +150,13 @@ page { display: flex; flex-direction: column; justify-content: flex-end; + .title { + overflow: hidden; + text-overflow: ellipsis; + display: -webkit-box; + -webkit-line-clamp: 2; + -webkit-box-orient: vertical; + } } } } @@ -210,6 +217,7 @@ page { } .i-list { margin: 32rpx 30rpx 0; + min-height: 80vh; .list-card { margin-top: 32rpx; padding: 32rpx; diff --git a/src/pages/index/index.ts b/src/pages/index/index.ts index 10270d4..0a9c1dc 100644 --- a/src/pages/index/index.ts +++ b/src/pages/index/index.ts @@ -22,11 +22,11 @@ Page({ sectionList: [] as Array<{ code: string; visible: boolean; subList: any[] }>, moduleVisible: { health: true, - 'spread1': true, + spread1: true, 'video-big': true, - 'spread2': true, + spread2: true, 'qiye-wx': true, - 'education': true, + education: true, } as Record, }, onLoad() { @@ -51,10 +51,7 @@ Page({ }).then((res: any) => { const list = res || [] list.forEach((item: any) => { - if ( - (item.code === 'spread1' || item.code === 'spread2' || item.code === 'serviceConf') && - item.subList - ) { + if ((item.code === 'spread1' || item.code === 'spread2' || item.code === 'serviceConf') && item.subList) { item.subList = item.subList.filter((subItem: any) => subItem.showStatus == 1) } }) @@ -70,8 +67,8 @@ Page({ const conf = list.find((item: any) => item.code === code) return { code, - visible: conf ? conf.showStatus == 1 : false, subList: conf?.subList || [], + visible: conf ? (conf.showStatus == 1 && (conf.subList || []).length > 0) : false, } }) .sort((a, b) => { diff --git a/src/pages/index/index.wxml b/src/pages/index/index.wxml index 2fdd79e..d5ef668 100644 --- a/src/pages/index/index.wxml +++ b/src/pages/index/index.wxml @@ -25,7 +25,14 @@ + - diff --git a/src/pages/myCollection/index.ts b/src/pages/myCollection/index.ts index 18e8117..ccfe5ee 100644 --- a/src/pages/myCollection/index.ts +++ b/src/pages/myCollection/index.ts @@ -19,7 +19,7 @@ Page({ count: 0, }, }, - onLoad() { + onShow() { app.waitLogin({ type: 0 }).then(() => { this.getVideoList() this.getArticleList() diff --git a/src/pages/videoList/index.scss b/src/pages/videoList/index.scss index d731adb..f044be0 100644 --- a/src/pages/videoList/index.scss +++ b/src/pages/videoList/index.scss @@ -5,6 +5,7 @@ page { .page-title { font-size: 36rpx; color: rgba(51, 51, 51, 1); + padding-right: 100rpx; } .page { @@ -74,64 +75,75 @@ page { display: grid; grid-template-columns: repeat(2, 1fr); gap: 48rpx 30rpx; - .card { - display: block; - width: 100%; - overflow: hidden; - .photo { - position: relative; + .card-wrap { + position: relative; + .hot { + position: absolute; + top: -10rpx; + left: 24rpx; + width: 104rpx; + height: 48rpx; + z-index: 1; + } + .card { + display: block; width: 100%; - height: 442rpx; - border-radius: 32rpx; overflow: hidden; - .p-img { - display: block; + .photo { + position: relative; width: 100%; - height: 100%; - } - .stat { - position: absolute; - bottom: 0; - left: 0; - width: 100%; - padding: 0 12rpx; - height: 104rpx; - box-sizing: border-box; - background: linear-gradient(180deg, rgba(2, 2, 2, 0) 0%, rgba(3, 3, 3, 0.11) 20.97%, #090909 100%); - backdrop-filter: opacity(67%); - display: flex; - align-items: center; - justify-content: flex-end; - gap: 8rpx; - .s-item { - padding: 48rpx 12rpx 24rpx; + height: 442rpx; + border-radius: 32rpx; + overflow: hidden; + .p-img { + display: block; + width: 100%; + height: 100%; + } + .stat { + position: absolute; + bottom: 0; + left: 0; + width: 100%; + padding: 0 12rpx; + height: 104rpx; + box-sizing: border-box; + background: linear-gradient(180deg, rgba(2, 2, 2, 0) 0%, rgba(3, 3, 3, 0.11) 20.97%, #090909 100%); + backdrop-filter: opacity(67%); display: flex; align-items: center; + justify-content: flex-end; gap: 8rpx; - font-size: 28rpx; - color: rgba(255, 255, 255, 1); - .icon { - width: 32rpx; - height: 32rpx; - } - &.active1 { - color: rgba(234, 88, 26, 1); + .s-item { + padding: 48rpx 12rpx 24rpx; + display: flex; + align-items: center; + gap: 8rpx; + font-size: 28rpx; + color: rgba(255, 255, 255, 1); + .icon { + width: 32rpx; + height: 32rpx; + } + &.active1 { + color: rgba(234, 88, 26, 1); + } } } } - } - .title { - margin-top: 24rpx; - height: 80rpx; - padding: 0 12rpx; - color: #2a3544; - font-size: 28rpx; - line-height: 40rpx; - overflow: hidden; - text-overflow: ellipsis; - display: -webkit-box; - -webkit-line-clamp: 2; - -webkit-box-orient: vertical; + .title { + margin-top: 24rpx; + height: 80rpx; + padding: 0 12rpx; + color: #2a3544; + font-size: 28rpx; + line-height: 40rpx; + overflow: hidden; + text-overflow: ellipsis; + display: -webkit-box; + -webkit-line-clamp: 2; + -webkit-box-orient: vertical; + } } } } diff --git a/src/pages/videoList/index.wxml b/src/pages/videoList/index.wxml index 3429fb6..78c2772 100644 --- a/src/pages/videoList/index.wxml +++ b/src/pages/videoList/index.wxml @@ -55,32 +55,39 @@ - - - - - - {{item.OpenNum}} - - - - - {{item.ComplimentNum || 0}} + + + + + + + + {{item.OpenNum}} + + + + + {{item.ComplimentNum || 0}} + + {{item.Title}} - {{item.Title}}