| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288 |
- <template>
- <view class="page">
- <scroll-view class="scroll-content" scroll-y="true">
- <image class="detail-img" src="/static/home/detail.png" mode="aspectFill"></image>
- <view class="back-btn" @click="goBack">
- <image class="back-img" src="/static/public/back.png" mode="aspectFill"></image>
- </view>
- <view class="detail-box">
- <text class="detail-title">{{form.title}}</text>
- <text class="detail-author">{{form.createUserName || '无名氏'}}</text>
- <view class="detail-btn" @click="isShowDrawer = true">
- <text class="detail-btn-txt">立即体验</text>
- </view>
- <view class="line"></view>
- <!-- 简介 -->
- <text class="section-title">简介</text>
- <view class="detail-info" :style="{height: isExpanded ? '84rpx' : 'auto'}">
- <text class="detail-info-text">{{form.detail || '暂无'}}</text>
- <view class="more-btn-box" @click="toggle">
- <text class="more-btn">{{isExpanded ? '展开' : '收缩'}}</text>
- <text class="more-arrow" :class="[isExpanded ? '' : 'collapse']">▼</text>
- </view>
- </view>
- <!-- 艾灸穴位 -->
- <text class="section-title">艾灸穴位</text>
- <view class="acupoint-box">
- <view v-for="(itm, inx) in points" :key="inx">
- <text class="line-info">{{inx + 1}}.{{itm.name}}</text>
- <text class="line-info emsp">定位:{{itm.position}}</text>
- <text class="line-info emsp">作用:{{itm.effect}}</text>
- </view>
- </view>
- <!-- 适用人群 -->
- <text class="section-title">适用人群</text>
- <view class="people-box">
- <text class="line-info" v-for="(itm, inx) in peoples" :key="inx">{{inx + 1}}.{{itm}}</text>
- </view>
- <!-- 注意事项 -->
- <text class="section-title">注意事项</text>
- <view class="tips-box">
- <text class="line-info" v-for="(itm, inx) in atts" :key="inx">{{inx + 1}}.{{itm}}</text>
- </view>
- </view>
- </scroll-view>
- <customPopup :isShow="isShowDrawer" @closePop="isShowDrawer = false">
- <text class="popup-tips">确认添加到我的方案?</text>
- <view class="popup-btns">
- <view class="popup-btn" @click="isShowDrawer = false">
- <text class="popup-btn-text">取消</text>
- </view>
- <view class="popup-btn popup-btn-confirm" @click="confirmAdd">
- <text class="popup-btn-text popup-btn-text-confirm">确认</text>
- </view>
- </view>
- </customPopup>
- </view>
- </template>
- <script>
- import customPopup from '@/components/customPopup/customPopup.nvue'
- export default {
- components: {
- customPopup
- },
- data() {
- return {
- id: '',
- isExpanded: true,
- isShowDrawer: false,
- form: {
- title: '',
- createUserName: '',
- detail: ''
- },
- peoples: [],
- atts: [],
- points: []
- }
- },
- onLoad(options) {
- this.id = options.id || ''
- // 使用传入的标题
- if (options.title) {
- this.form.title = decodeURIComponent(options.title)
- }
- this.init()
- },
- methods: {
- init() {
- // TODO: 等后端接口出来后替换为真实请求
- // 暂时使用模拟数据展示
- this.form = {
- title: this.form.title || '春季艾灸养生方案',
- createUserName: '研年健康',
- detail: '本方案针对春季阳气初升、湿寒未退的时节特点,通过温补督脉、健脾祛湿等艾灸手法,帮助调理身体,增强免疫力。适合久坐办公、体寒怕冷的人群。'
- }
- this.points = [
- { name: '大椎穴', position: '第七颈椎棘突下凹陷中', effect: '通阳解表,缓解颈肩疼痛' },
- { name: '肩井穴', position: '大椎与肩峰端连线的中点', effect: '疏通经络,缓解肩颈僵硬' },
- { name: '足三里', position: '外膝眼下3寸,胫骨前嵴外1横指', effect: '健脾和胃,扶正培元' }
- ]
- this.peoples = [
- '久坐办公室',
- '低头族',
- '体寒阳虚体质者',
- '慢性颈肩疼痛患者'
- ]
- this.atts = [
- '艾灸前30分钟避免剧烈运动',
- '每个穴位建议艾灸10-20分钟',
- '灸后30分钟内避免洗澡',
- '皮肤发红或起泡应立即停止艾灸'
- ]
- },
- toggle() {
- this.isExpanded = !this.isExpanded
- },
- goBack() {
- uni.navigateBack()
- },
- confirmAdd() {
- // TODO: 等后端接口出来后替换为真实请求
- uni.showToast({
- icon: 'none',
- title: '已加入我的方案'
- })
- this.isShowDrawer = false
- }
- }
- }
- </script>
- <style>
- .page {
- flex: 1;
- background-color: #FFFFFF;
- }
- .scroll-content {
- flex: 1;
- }
- .detail-img {
- width: 750rpx;
- height: 560rpx;
- }
- .back-btn {
- position: absolute;
- left: 30rpx;
- top: 142rpx;
- }
- .back-img {
- width: 50rpx;
- height: 50rpx;
- }
- .detail-box {
- width: 750rpx;
- margin-top: -88rpx;
- border-top-left-radius: 30rpx;
- border-top-right-radius: 30rpx;
- background-color: #FFFFFF;
- padding-top: 40rpx;
- padding-bottom: 40rpx;
- padding-left: 60rpx;
- padding-right: 60rpx;
- }
- .detail-title {
- font-weight: bold;
- font-size: 40rpx;
- color: #545F71;
- lines: 2;
- text-overflow: ellipsis;
- margin-bottom: 4rpx;
- }
- .detail-author {
- font-size: 32rpx;
- color: #545F71;
- line-height: 44rpx;
- }
- .detail-btn {
- background-color: #389588;
- height: 66rpx;
- border-radius: 20rpx;
- margin-top: 26rpx;
- margin-bottom: 26rpx;
- justify-content: center;
- align-items: center;
- }
- .detail-btn-txt {
- color: #FFFFFF;
- font-size: 28rpx;
- }
- .line {
- height: 1px;
- background-color: #ECECEC;
- margin-bottom: 32rpx;
- }
- .section-title {
- font-weight: bold;
- font-size: 32rpx;
- color: #545F71;
- line-height: 44rpx;
- margin-bottom: 16rpx;
- }
- .detail-info {
- position: relative;
- margin-bottom: 24rpx;
- padding-bottom: 32rpx;
- }
- .detail-info-text {
- font-size: 28rpx;
- color: #545F71;
- line-height: 44rpx;
- }
- .more-btn-box {
- position: absolute;
- right: 0;
- bottom: 0;
- background-color: #FFFFFF;
- flex-direction: row;
- align-items: center;
- padding-left: 6rpx;
- padding-right: 6rpx;
- }
- .more-btn {
- font-size: 28rpx;
- color: #389588;
- line-height: 40rpx;
- margin-right: 4rpx;
- }
- .more-arrow {
- color: #389588;
- font-size: 20rpx;
- }
- .collapse {
- transform: rotateZ(180deg);
- }
- .acupoint-box {
- margin-bottom: 24rpx;
- }
- .people-box {
- margin-bottom: 24rpx;
- }
- .tips-box {
- margin-bottom: 24rpx;
- }
- .line-info {
- line-height: 44rpx;
- color: #545F71;
- font-size: 28rpx;
- margin-left: 20rpx;
- }
- .emsp {
- padding-left: 40rpx;
- }
- .popup-tips {
- text-align: center;
- margin-top: 48rpx;
- margin-bottom: 48rpx;
- font-size: 32rpx;
- color: #545F71;
- }
- .popup-btns {
- flex-direction: row;
- justify-content: space-between;
- padding-left: 20rpx;
- padding-right: 20rpx;
- }
- .popup-btn {
- width: 296rpx;
- height: 88rpx;
- background-color: #F3F3F3;
- border-radius: 20rpx;
- justify-content: center;
- align-items: center;
- }
- .popup-btn-confirm {
- background-color: #389588;
- margin-left: 20rpx;
- }
- .popup-btn-text {
- font-size: 30rpx;
- color: #545F71;
- }
- .popup-btn-text-confirm {
- color: #FFFFFF;
- }
- </style>
|