|
@@ -0,0 +1,433 @@
|
|
|
|
+<template>
|
|
|
|
+ <div class="course">
|
|
|
|
+ <!-- <van-swipe class="course-swipe" :autoplay="3000">
|
|
|
|
+ <van-swipe-item v-for="thumb in course.thumb" :key="thumb">
|
|
|
|
+ <img :src="thumb" />
|
|
|
|
+ </van-swipe-item>
|
|
|
|
+ </van-swipe> -->
|
|
|
|
+ <van-cell-group class="course-img">
|
|
|
|
+ <van-image
|
|
|
|
+ class="course-img-img"
|
|
|
|
+ src="https://img01.yzcdn.cn/vant/cat.jpeg"
|
|
|
|
+ />
|
|
|
|
+ <div class="course-img-price">
|
|
|
|
+ <div class="course-img-price-group">¥365/年</div>
|
|
|
|
+ <div class="course-img-price-tag">
|
|
|
|
+ <div class="tag">3人团</div>
|
|
|
|
+ <div class="single">单独购600</div>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ <div class="course-count-title">距结束仅剩</div>
|
|
|
|
+ <van-count-down :time="time" class="course-count-time">
|
|
|
|
+ <template #default="timeData">
|
|
|
|
+ <span class="block">{{ timeData.hours }}</span>
|
|
|
|
+ <span class="colon">:</span>
|
|
|
|
+ <span class="block">{{ timeData.minutes }}</span>
|
|
|
|
+ <span class="colon">:</span>
|
|
|
|
+ <span class="block">{{ timeData.seconds }}</span>
|
|
|
|
+ </template>
|
|
|
|
+ </van-count-down>
|
|
|
|
+ </van-cell-group>
|
|
|
|
+
|
|
|
|
+ <van-cell-group class="course-title-box">
|
|
|
|
+ <van-cell
|
|
|
|
+ :title="course.title"
|
|
|
|
+ :label="course.desc"
|
|
|
|
+ title-class="course-title"
|
|
|
|
+ lable-class="course-desc"
|
|
|
|
+ center
|
|
|
|
+ />
|
|
|
|
+ </van-cell-group>
|
|
|
|
+
|
|
|
|
+ <van-cell-group>
|
|
|
|
+ <van-cell
|
|
|
|
+ is-link
|
|
|
|
+ @click="sorry"
|
|
|
|
+ title="拼团玩法"
|
|
|
|
+ label="好友拼单-人满成团-人不满自动退款"
|
|
|
|
+ title-class="course-title-s"
|
|
|
|
+ lable-class="course-desc"
|
|
|
|
+ center
|
|
|
|
+ />
|
|
|
|
+ </van-cell-group>
|
|
|
|
+
|
|
|
|
+ <van-cell-group class="course-cell-group">
|
|
|
|
+ <van-cell>
|
|
|
|
+ <template #title>
|
|
|
|
+ <div class="header-title">
|
|
|
|
+ <span>可直接参与拼团</span>
|
|
|
|
+ <van-icon name="arrow-down" />
|
|
|
|
+ </div>
|
|
|
|
+ </template>
|
|
|
|
+ </van-cell>
|
|
|
|
+
|
|
|
|
+ <van-cell class="group-item" v-for="group in groups" :key="group">
|
|
|
|
+ <template #title>
|
|
|
|
+ <div class="group">
|
|
|
|
+ <div class="group-user">
|
|
|
|
+ <van-image class="group-user-avatar" round :src="group.avatar" />
|
|
|
|
+ <span class="group-user-name">{{ group.nickName }}</span>
|
|
|
|
+ </div>
|
|
|
|
+ <div class="group-info">
|
|
|
|
+ <div class="group-info-left">
|
|
|
|
+ <div class="group-info-left-number">
|
|
|
|
+ {{ group.sum }}人团,还差<span>{{ group.need }}人</span>成团
|
|
|
|
+ </div>
|
|
|
|
+ <div class="group-info-left-time">
|
|
|
|
+ <span>剩余</span><van-count-down :time="group.countTime" />
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ <div class="group-info-btn" @click="sorry(group.id)">去拼团</div>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ </template>
|
|
|
|
+ </van-cell>
|
|
|
|
+ </van-cell-group>
|
|
|
|
+
|
|
|
|
+ <footer class="footer">
|
|
|
|
+ <div class="footer-icon">
|
|
|
|
+ <van-icon
|
|
|
|
+ name="wap-home-o"
|
|
|
|
+ class="footer-icon-img"
|
|
|
|
+ size="30"
|
|
|
|
+ color="#000"
|
|
|
|
+ />
|
|
|
|
+ <span>首页</span>
|
|
|
|
+ </div>
|
|
|
|
+ <div class="footer-single-btn" @click="sorry">
|
|
|
|
+ <span>¥{{ course.originPrice }}元</span>
|
|
|
|
+ <span>单独购买</span>
|
|
|
|
+ </div>
|
|
|
|
+ <div class="footer-group-btn" @click="onClickGroup">
|
|
|
|
+ <span>¥{{ course.price }}元</span>
|
|
|
|
+ <span>3人开团</span>
|
|
|
|
+ </div>
|
|
|
|
+ </footer>
|
|
|
|
+ <!-- <van-action-bar>
|
|
|
|
+ <van-action-bar-icon icon="cart-o" @click="onClickCart">
|
|
|
|
+ 购物车
|
|
|
|
+ </van-action-bar-icon>
|
|
|
|
+ <van-action-bar-button type="warning" @click="sorry">
|
|
|
|
+ 加入购物车
|
|
|
|
+ </van-action-bar-button>
|
|
|
|
+ <van-action-bar-button type="danger" @click="sorry">
|
|
|
|
+ 立即购买
|
|
|
|
+ </van-action-bar-button>
|
|
|
|
+ </van-action-bar> -->
|
|
|
|
+ </div>
|
|
|
|
+</template>
|
|
|
|
+
|
|
|
|
+<script>
|
|
|
|
+import { Icon, Cell, CellGroup, Image, Toast, CountDown } from "vant";
|
|
|
|
+import { getExampleData } from "../../api/base";
|
|
|
|
+
|
|
|
|
+export default {
|
|
|
|
+ components: {
|
|
|
|
+ [Icon.name]: Icon,
|
|
|
|
+ [Cell.name]: Cell,
|
|
|
|
+ [CellGroup.name]: CellGroup,
|
|
|
|
+ [Image.name]: Image,
|
|
|
|
+ [CountDown.name]: CountDown,
|
|
|
|
+ },
|
|
|
|
+
|
|
|
|
+ data() {
|
|
|
|
+ return {
|
|
|
|
+ course: {
|
|
|
|
+ title: "学有义方APP-学习卡(会员年卡)",
|
|
|
|
+ desc: "小学1-4年级,语文/数学,教材同步,AI互动教学",
|
|
|
|
+ price: 365,
|
|
|
|
+ originPrice: 600,
|
|
|
|
+ express: "免运费",
|
|
|
|
+ remain: 19,
|
|
|
|
+ thumb: [
|
|
|
|
+ "https://img.yzcdn.cn/public_files/2017/10/24/e5a5a02309a41f9f5def56684808d9ae.jpeg",
|
|
|
|
+ "https://img.yzcdn.cn/public_files/2017/10/24/1791ba14088f9c2be8c610d0a6cc0f93.jpeg",
|
|
|
|
+ ],
|
|
|
|
+ },
|
|
|
|
+ groups: [
|
|
|
|
+ {
|
|
|
|
+ avatar: "https://img01.yzcdn.cn/vant/cat.jpeg",
|
|
|
|
+ nickName: "平安妈妈",
|
|
|
|
+ sum: 5,
|
|
|
|
+ need: 1,
|
|
|
|
+ countTime: 29 * 60 * 60 * 1000,
|
|
|
|
+ id: 1,
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ avatar: "https://img01.yzcdn.cn/vant/cat.jpeg",
|
|
|
|
+ nickName: "喔喔奶糖",
|
|
|
|
+ sum: 5,
|
|
|
|
+ need: 2,
|
|
|
|
+ countTime: 15 * 60 * 60 * 1000,
|
|
|
|
+ id: 2,
|
|
|
|
+ },
|
|
|
|
+ ],
|
|
|
|
+ time: 30 * 60 * 60 * 1000,
|
|
|
|
+ };
|
|
|
|
+ },
|
|
|
|
+
|
|
|
|
+ methods: {
|
|
|
|
+ formatPrice() {
|
|
|
|
+ return "¥" + (this.course.price / 100).toFixed(2);
|
|
|
|
+ },
|
|
|
|
+
|
|
|
|
+ onClickCart() {
|
|
|
|
+ console.log(1111111);
|
|
|
|
+ getExampleData();
|
|
|
|
+ this.$router.push("cart");
|
|
|
|
+ },
|
|
|
|
+ onClickGroup() {
|
|
|
|
+ this.$router.push("order");
|
|
|
|
+ },
|
|
|
|
+
|
|
|
|
+ sorry() {
|
|
|
|
+ Toast("暂无后续逻辑~");
|
|
|
|
+ },
|
|
|
|
+ },
|
|
|
|
+};
|
|
|
|
+</script>
|
|
|
|
+
|
|
|
|
+<style lang="less">
|
|
|
|
+.course {
|
|
|
|
+ padding-bottom: 50px;
|
|
|
|
+
|
|
|
|
+ .cell-font-size {
|
|
|
|
+ font-size: 30px;
|
|
|
|
+ }
|
|
|
|
+ &-swipe {
|
|
|
|
+ img {
|
|
|
|
+ width: 100%;
|
|
|
|
+ display: block;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ &-img {
|
|
|
|
+ width: 750px;
|
|
|
|
+ height: 560px;
|
|
|
|
+ &-img {
|
|
|
|
+ width: 100%;
|
|
|
|
+ height: 100%;
|
|
|
|
+ }
|
|
|
|
+ &-price {
|
|
|
|
+ position: absolute;
|
|
|
|
+ left: 13px;
|
|
|
|
+ bottom: 20px;
|
|
|
|
+ display: flex;
|
|
|
|
+ align-items: center;
|
|
|
|
+ justify-content: center;
|
|
|
|
+ &-group {
|
|
|
|
+ color: #fff;
|
|
|
|
+ font-size: 58px;
|
|
|
|
+ font-weight: bold;
|
|
|
|
+ margin-right: 12px;
|
|
|
|
+ }
|
|
|
|
+ &-tag {
|
|
|
|
+ display: flex;
|
|
|
|
+ flex-direction: column;
|
|
|
|
+ .tag {
|
|
|
|
+ background: #ce3110;
|
|
|
|
+ width: 98px;
|
|
|
|
+ height: 35px;
|
|
|
|
+ border-radius: 21px 80px 80px 0;
|
|
|
|
+ text-align: center;
|
|
|
|
+ line-height: 35px;
|
|
|
|
+ color: #fff;
|
|
|
|
+ font-size: 25.6px;
|
|
|
|
+ margin-bottom: 7.2px;
|
|
|
|
+ }
|
|
|
|
+ .single {
|
|
|
|
+ color: #fff;
|
|
|
|
+ font-size: 24px;
|
|
|
|
+ font-weight: bold;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ .course-count-title {
|
|
|
|
+ color: #fff;
|
|
|
|
+ font-size: 32px;
|
|
|
|
+ right: 63px;
|
|
|
|
+ bottom: 57px;
|
|
|
|
+ position: absolute;
|
|
|
|
+ }
|
|
|
|
+ .course-count-time {
|
|
|
|
+ position: absolute;
|
|
|
|
+ right: 60px;
|
|
|
|
+ bottom: 16px;
|
|
|
|
+ display: flex;
|
|
|
|
+ flex-direction: row;
|
|
|
|
+ .block {
|
|
|
|
+ display: block;
|
|
|
|
+ width: 42px;
|
|
|
|
+ height: 42px;
|
|
|
|
+ background: #fff;
|
|
|
|
+ border-radius: 6px;
|
|
|
|
+ line-height: 42px;
|
|
|
|
+ text-align: center;
|
|
|
|
+ color: #fc522e;
|
|
|
|
+ font-weight: bold;
|
|
|
|
+ font-size: 28px;
|
|
|
|
+ }
|
|
|
|
+ .colon {
|
|
|
|
+ display: block;
|
|
|
|
+ color: #fff;
|
|
|
|
+ font-weight: bold;
|
|
|
|
+ font-size: 28px;
|
|
|
|
+ width: 28px;
|
|
|
|
+ text-align: center;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ &-title-box {
|
|
|
|
+ padding-top: 30px;
|
|
|
|
+ }
|
|
|
|
+ &-title {
|
|
|
|
+ font-size: 32px;
|
|
|
|
+ color: #000;
|
|
|
|
+ line-height: 50px;
|
|
|
|
+ padding-left: 20px;
|
|
|
|
+ }
|
|
|
|
+ &-title-s {
|
|
|
|
+ font-size: 28px;
|
|
|
|
+ color: #000;
|
|
|
|
+ line-height: 50px;
|
|
|
|
+ padding-left: 20px;
|
|
|
|
+ }
|
|
|
|
+ &-desc {
|
|
|
|
+ font-size: 28px;
|
|
|
|
+ color: rgba(0, 0, 0, 0.6);
|
|
|
|
+ line-height: 45px;
|
|
|
|
+ padding-left: 20px;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ &-express {
|
|
|
|
+ color: #999;
|
|
|
|
+ font-size: 12px;
|
|
|
|
+ padding: 5px 15px;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ &-cell-group {
|
|
|
|
+ margin: 15px 0;
|
|
|
|
+ background: #f6f6f6;
|
|
|
|
+ .header-title {
|
|
|
|
+ color: #000;
|
|
|
|
+ font-size: 28px;
|
|
|
|
+ padding-top: 21px;
|
|
|
|
+ padding-left: 18px;
|
|
|
|
+ padding-bottom: 10px;
|
|
|
|
+ display: flex;
|
|
|
|
+ align-items: center;
|
|
|
|
+ span {
|
|
|
|
+ margin-right: 10px;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ .group-item {
|
|
|
|
+ margin-bottom: 10px;
|
|
|
|
+ }
|
|
|
|
+ .group {
|
|
|
|
+ display: flex;
|
|
|
|
+ flex-direction: row;
|
|
|
|
+ align-items: center;
|
|
|
|
+ justify-content: space-between;
|
|
|
|
+ padding-left: 35px;
|
|
|
|
+ padding-right: 35px;
|
|
|
|
+ &-user {
|
|
|
|
+ display: flex;
|
|
|
|
+ align-items: center;
|
|
|
|
+ &-avatar {
|
|
|
|
+ width: 80px;
|
|
|
|
+ height: 80px;
|
|
|
|
+ margin-right: 14px;
|
|
|
|
+ }
|
|
|
|
+ &-name {
|
|
|
|
+ font-size: 28px;
|
|
|
|
+ color: #000;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ &-info {
|
|
|
|
+ display: flex;
|
|
|
|
+ align-items: center;
|
|
|
|
+ &-left {
|
|
|
|
+ display: flex;
|
|
|
|
+ flex-direction: column;
|
|
|
|
+ align-items: flex-end;
|
|
|
|
+ margin-right: 16px;
|
|
|
|
+ &-number {
|
|
|
|
+ color: #000;
|
|
|
|
+ font-size: 26px;
|
|
|
|
+ margin-bottom: 12px;
|
|
|
|
+ }
|
|
|
|
+ &-time {
|
|
|
|
+ color: #000;
|
|
|
|
+ font-size: 20px;
|
|
|
|
+ display: flex;
|
|
|
|
+ flex-direction: row;
|
|
|
|
+ align-items: center;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ &-btn {
|
|
|
|
+ width: 128px;
|
|
|
|
+ height: 46px;
|
|
|
|
+ background: #ff5e60;
|
|
|
|
+ box-shadow: 0px 2px 4px 0px #ffc6c6;
|
|
|
|
+ border-radius: 23px;
|
|
|
|
+ color: rgba(255, 255, 255, 0.89);
|
|
|
|
+ text-shadow: 0px 2px 4px #ffc6c6;
|
|
|
|
+ font-size: 26px;
|
|
|
|
+ text-align: center;
|
|
|
|
+ line-height: 46px;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ .footer {
|
|
|
|
+ width: 100%;
|
|
|
|
+ height: 148px;
|
|
|
|
+ position: fixed;
|
|
|
|
+ bottom: 0;
|
|
|
|
+ background: #fff;
|
|
|
|
+ display: flex;
|
|
|
|
+ flex-direction: row;
|
|
|
|
+ align-items: center;
|
|
|
|
+ justify-content: space-around;
|
|
|
|
+ padding-left: 20px;
|
|
|
|
+ box-sizing: border-box;
|
|
|
|
+ &-icon {
|
|
|
|
+ display: flex;
|
|
|
|
+ align-items: center;
|
|
|
|
+ flex-direction: column;
|
|
|
|
+ color: #000;
|
|
|
|
+ font-size: 30px;
|
|
|
|
+ &-img {
|
|
|
|
+ margin-bottom: 4px;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ &-single-btn {
|
|
|
|
+ width: 277px;
|
|
|
|
+ height: 88px;
|
|
|
|
+ background: #ffe8d5;
|
|
|
|
+ border-radius: 51px;
|
|
|
|
+ display: flex;
|
|
|
|
+ flex-direction: column;
|
|
|
|
+ align-items: center;
|
|
|
|
+ justify-content: space-around;
|
|
|
|
+ color: #5e5e5e;
|
|
|
|
+ font-size: 32px;
|
|
|
|
+ font-weight: 500;
|
|
|
|
+ }
|
|
|
|
+ &-group-btn {
|
|
|
|
+ width: 328px;
|
|
|
|
+ height: 88px;
|
|
|
|
+ background: #fe7801;
|
|
|
|
+ border-radius: 44px;
|
|
|
|
+ display: flex;
|
|
|
|
+ flex-direction: column;
|
|
|
|
+ align-items: center;
|
|
|
|
+ justify-content: space-around;
|
|
|
|
+ color: #fff;
|
|
|
|
+ font-size: 32px;
|
|
|
|
+ font-weight: 500;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+</style>
|