当前位置: 首页 > news >正文

帝国cms小程序搞起来简直好用的不行

首先来一个首页代码

<!--index.wxml-->

<navigationbar-wx title="" logo="{{logoUrl}}" color="#000000" bgColor="#FFFFFF" hideHome="true" showBack="false"></navigationbar-wx>

<scroll-view class="scrollarea" scroll-y type="list" refresher-enabled="{{true}}" refresher-threshold="80" refresher-triggered="{{refreshing}}" bindrefresherrefresh="onRefresh" bindscroll="onPageScroll">

  <view class="index_zhu">

    <!-- 搜索框 -->

    <view class="search-bar">

      <image src="{{searchIconUrl}}" class="search-icon"></image>

      <input type="text" placeholder="搜索课程/图书" class="search-input" />

    </view>

    <!-- 轮播图 -->

    <swiper class="banner" autoplay interval="3000" circular>

      <block wx:for="{{bannerUrls}}" wx:key="*this">

        <swiper-item>

          <image src="{{item}}" mode="aspectFill" class="banner-img" />

        </swiper-item>

      </block>

    </swiper>

    <!-- 快捷入口 -->

    <view class="quick-entries">

      <view class="entry">

        <image src="{{bkkc}}" class="entry-icon" />

        <text>爆款课程</text>

      </view>

      <view class="entry">

        <image src="{{lbkc}}" class="entry-icon" />

        <text>老板课程</text>

      </view>

      <view class="entry">

        <image src="{{ggkc}}" class="entry-icon" />

        <text>高管进阶</text>

      </view>

      <view class="entry">

        <image src="{{zcts}}" class="entry-icon" />

        <text>职场提升</text>

      </view>

    </view>

    <!-- 功能按钮 -->

    <view class="action-buttons">

      <view class="button">

        <text class="button-title">我的学习</text>

        <text class="button-subtitle">从这里开始学习</text>

      </view>

      <view class="button">

        <text class="button-title">全部课程</text>

        <text class="button-subtitle">选好课,用高修成长汇</text>

      </view>

    </view>

    <!-- VIP会员广告 -->

    <view class="vip-ad">

      <view class="vip-content">

        <view class="vip-info">

          <view class="vip-title">

            <image src="{{vipicon}}" class="vip-crown" />

            VIP会员专享

          </view>

          <text class="vip-desc">开通VIP,尊享全部课程免费学</text>

          <view class="vip-benefits">

            <text class="vip-benefit-tag">专属内容</text>

            <text class="vip-benefit-tag">优先客服</text>

            <text class="vip-benefit-tag">免费课程</text>

          </view>

        </view>

        <view>

          <view class="vip-button" bindtap="onVipButtonTap">立即开通</view>

          <view class="vip-price">仅需 <text>¥99</text> /年</view>

        </view>

      </view>

    </view>

    <!-- 爆款推荐 -->

    <view class="section">

      <view class="section-header">

        <view class="section-tabs">

          <block wx:for="{{courseCategories}}" wx:key="classid">

            <text class="tab-item {{activeTab === index ? 'active' : ''}}" data-index="{{index}}" bindtap="switchTab">{{item.name}}</text>

          </block>

        </view>

        <text class="section-more" bindtap="goToCourseList">更多 ></text>

      </view>

      <view class="section-content">

        <block wx:for="{{courseCategories}}" wx:key="classid">

          <view class="tab-content {{activeTab === index ? 'active' : ''}}">

            <view class="item-list">

              <block wx:if="{{courseListByCategory[item.classid] && courseListByCategory[item.classid].length > 0}}">

                <block wx:for="{{courseListByCategory[item.classid]}}" wx:key="id">

                  <view class="item" data-id="{{item.id}}" data-type="course" bindtap="onItemTap">

                    <image src="{{item.titlepic || ontitlepic}}" class="item-image" />

                    <view class="item_box">

                      <text class="item-title">{{item.title}}</text>

                      <text class="item-description">{{item.smalltext.length > 30 ? item.smalltext.substring(0,30) + '...' : item.smalltext}}</text>

                      <view class="item-tags">

                        <text class="tag hot" wx:if="{{item.type == '3'}}">热销</text>

                        <text class="tag new" wx:if="{{item.isnew == '1'}}">新上架</text>

                      </view>

                      <view class="item-price-container">

                        <text class="item-price">¥{{item.price}}</text>

                        <view class="item-sales">

                          <image src="{{eyeicon}}" class="meta-icon"></image>

                          <text>{{item.sales}}</text>

                        </view>

                      </view>

                      <text class="item-points" wx:if="{{item.points != 0}}">{{item.points}}积分</text>

                    </view>

                  </view>

                </block>

              </block>

              <block wx:else>

                <view wx:if="{{loadingCourses}}" class="loading-text">加载中...</view>

                <view wx:else class="empty-text" style="text-align: center;">暂无课程</view>

              </block>

            </view>

          </view>

        </block>

      </view>

    </view>

    <!-- 猜你喜欢 -->

    <view class="section">

      <view class="section-header">

        <text class="section-title">猜你喜欢</text>

        <text class="section-more" bindtap="goToCourseList">更多 ></text>

      </view>

      <view class="section-content">

        <view class="item-list">

          <block wx:if="{{recommendList && recommendList.length > 0}}">

            <block wx:for="{{recommendList}}" wx:key="id">

              <view class="item" data-id="{{item.id}}" data-type="course" bindtap="onItemTap">

                <image src="{{item.titlepic || ontitlepic}}" class="item-image" />

                <view class="item_box">

                  <text class="item-title">{{item.title}}</text>

                  <view class="item-price-container">

                    <text class="item-price">¥{{item.price}}</text>

                    <view class="item-sales">

                      <image src="{{eyeicon}}" class="onclick-icon"></image><text class="onclick">{{item.onclick}}</text>

                    </view>

                  </view>

                </view>

              </view>

            </block>

          </block>

          <block wx:else>

            <view class="empty-text" style="text-align: center;">暂无推荐课程</view>

          </block>

        </view>

      </view>

    </view>

    <!-- 热门图书 -->

    <view class="section">

      <view class="section-header">

        <text class="section-title">热门图书</text>

        <text class="section-more" bindtap="goToBookList">更多 ></text>

      </view>

      <view class="section-content">

        <view class="item-list">

          <block wx:if="{{bookList && bookList.length > 0}}">

            <block wx:for="{{bookList}}" wx:key="id">

              <view class="book-item" data-id="{{item.id}}" data-type="book" bindtap="onItemTap">

                <view class="book-image">

                  <image src="{{item.titlepic || '/images/book.jpg'}}" mode="aspectFill" />

                </view>

                <text class="item-title">{{item.title}}</text>

                <text class="item-price">¥{{item.price}}</text>

              </view>

            </block>

          </block>

          <block wx:else>

            <view class="empty-text" style="text-align: center;">暂无图书数据</view>

          </block>

        </view>

      </view>

    </view>

    <!-- 普通文章 -->

    <view class="section">

      <view class="section-header">

        <text class="section-title">精选文章</text>

        <text class="section-more" bindtap="goToNewsList">更多 ></text>

      </view>

      <view class="section-content">

        <view class="article-list">

          <block wx:if="{{articleList && articleList.length > 0}}">

            <block wx:for="{{articleList}}" wx:key="id">

              <view class="article-item" data-id="{{item.id}}" bindtap="onArticleTap">

                <image src="{{item.titlepic || articleDefaultImage}}" class="article-image" mode="aspectFill" />

                <view class="article-content">

                  <text class="article-title">{{item.title}}</text>

                  <view class="article-meta">

                    <view class="meta-item left">

                      <image src="{{eyeicon}}" class="meta-icon"></image>

                      <text>{{item.onclick || '0'}}阅读</text>

                    </view>

                    <view class="meta-item right">

                      <image src="{{timeicon}}" class="meta-icon"></image>

                      <text>{{item.newstime}}</text>

                    </view>

                  </view>

                </view>

              </view>

            </block>

          </block>

          <block wx:else>

            <view class="empty-text" style="text-align: center;">暂无文章数据</view>

          </block>

        </view>

      </view>

    </view>

   

  </view>

  <view class="dixian">

      <text class="dixian-text">我也是有底线的</text>

    </view>

</scroll-view>

<!-- 底部导航 -->

<view class="tab-bar">

  <view class="tab-item {{currentTab === 0 ? 'active' : ''}}" data-index="0" bindtap="switchTabBar">

    <image src="{{currentTab === 0 ? homeactive : home}}" class="tab-icon" />

    <text>首页</text>

  </view>

  <view class="tab-item {{currentTab === 1 ? 'active' : ''}}" data-index="1" bindtap="switchTabBar">

    <image src="{{currentTab === 1 ? courseactive : bkkc}}" class="tab-icon" />

    <text>课程</text>

  </view>

  <view class="tab-item {{currentTab === 2 ? 'active' : ''}}" data-index="2" bindtap="switchTabBar">

    <image src="{{currentTab === 2 ? bookactiveicon : bookicon}}" class="tab-icon" />

    <text>图书</text>

  </view>

  <view class="tab-item {{currentTab === 3 ? 'active' : ''}}" data-index="3" bindtap="switchTabBar">

    <view class="tab-icon-container">

      <image src="{{currentTab === 3 ? carticon : carticon}}" class="tab-icon" />

      <view class="cart-badge">3</view>

    </view>

    <text>购物车</text>

  </view>

  <view class="tab-item {{currentTab === 4 ? 'active' : ''}}" data-index="4" bindtap="switchTabBar">

    <image src="{{currentTab === 4 ? usericon : usericon}}" class="tab-icon" />

    <text>我的</text>

  </view>

</view>

http://www.dtcms.com/a/461197.html

相关文章:

  • 高效批量调整图像尺寸的方案
  • 单片机供电处3.3V大电容导致程序可进调试但是无法暂停到具体语句
  • Java 实战:为 Word 文档中的文本与段落添加边框
  • 创业网站怎么做网站建设与网页设计...
  • git大文件储存机制是什么-为什么有大文件会出错并且处理大文件非常麻烦-优雅草卓伊凡
  • 机器学习之规则学习(Rule Learning)
  • 【神经网络】从逻辑回归到神经网络
  • 工厂抽烟检测系统 智能化安全管控新方案 加油站吸烟检测技术 吸烟行为智能监测
  • 做外贸怎么看外国网站wordpress配置邮件发送
  • 使用Python对PDF进行拆分与合并
  • 嵌入式软件/硬件工程师面试答案
  • 6.DSP学习记录之定时器
  • 阳春新农村建设网站中铁建设集团有限公司西北分公司
  • 简化OffSec考试报告编写:OSCP-Exam-Report-Template-Markdown项目详解
  • 北京网站设计制作过程数据服务网站开发
  • Go基础:一文掌握Go语言网络编程
  • TENGJUN-3.5MM耳机插座(JA06-BPF032-A):反向沉板结构下的4极音频连接解决方案
  • 使用IOT-Tree接入各种设备转OPC UA Server输出
  • 【大模型实战篇】从Python函数到MCP服务器:完整转换示例
  • 怎样增加网站的权重小企业做网站有用吗
  • 【ArkTS-通用事件】
  • 为什么要放弃用Docker?
  • 东方仙盟修仙(五)赛博科技修仙养老是一种爱好
  • 大模型训练过程中主动学习和课程学习的全面对比
  • Redis数据库隔离业务缓存对查询性能的影响分析
  • Mapper接口的解析
  • 网站中链接怎么做的广东网站建设案例
  • 网站开发部门结构公司做网站的费用属于什么费用
  • 做电影方面的网站怎么做外贸免费平台
  • transformers音频实战02-基于 Speech Commands 数据集的语音识别实战项目全流程