123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222 |
- <template>
- <div class="point-detail">
- <div class="good">
- <img :src="ware.waresPic" alt="" srcset="" />
- </div>
- <div class="title">
- <div class="text">{{ ware.waresName }}</div>
- <div class="price">
- <span class="icon"></span>
- <span class="amount">{{ ware.saleIntegral }}</span>
- </div>
- <div class="sold">已兑换 {{ ware.waresOutCount }}</div>
- </div>
- <!-- <div class="selected">
- <div class="text">已选</div>
- <div class="content">儿童情商课+智慧课堂,1</div>
- <div class="icon"></div>
- </div> -->
- <!-- <div class="pictures">
- <div class="text">- 图文详情 -</div>
- </div> -->
- <div class="buy">
- <nuxt-link :to="'/point/pay/' + this.id" tag="button">立刻兑换</nuxt-link>
- </div>
- </div>
- </template>
- <script>
- import { mapActions, mapGetters } from 'vuex'
- export default {
- validate({ params }) {
- // 必须是number类型
- return /^\d{1,}$/.test(params.id);
- },
- head() {
- return {
- title: "积分商品详情页",
- };
- },
- data() {
- return {
- ware:{},
- id:this.$route.params.id
- };
- },
- mounted() {
- this.getPointInfo();
- this.init();
- },
- computed: {
- ...mapGetters({
- findWare: "point/findWare",
- }),
- },
- methods: {
- ...mapActions({
- getPointInfo:"point/getPointInfo"
- }),
- init(){
- this.ware = this.findWare(this.id)
- }
- },
- };
- </script>
- <style>
- .point-detail {
- display: flex;
- width: 100vw;
- flex-direction: column;
- box-sizing: border-box;
- background: #f8f8f8;
- }
- .point-detail .good {
- box-sizing: border-box;
- width: 100vw;
- height: 100vw;
- padding: 15vw;
- background: #ffffff;
- }
- .point-detail .good img {
- width: 100%;
- height: 100%;
- }
- .point-detail .title {
- width: 100%;
- height: 26.66vw;
- padding: 4vw;
- background: #ffffff;
- position: relative;
- box-sizing: border-box;
- }
- .point-detail .title .text {
- width: 3.6rem;
- height: 0.5rem;
- font-size: 0.36rem;
- font-family: PingFangSC-Medium, PingFang SC;
- font-weight: 800;
- color: #111111;
- line-height: 0.5rem;
- position: absolute;
- left: 0.3rem;
- top: 0.3rem;
- }
- .point-detail .title .price {
- height: 0.7rem;
- font-size: 0.28rem;
- font-family: PingFangSC-Semibold, PingFang SC;
- font-weight: 600;
- color: #fe9700;
- line-height: 0.7rem;
- position: absolute;
- left: 0.57rem;
- bottom: 0.27rem;
- }
- .point-detail .title .price .icon {
- display: inline-block;
- width: 0.3rem;
- height: 0.3rem;
- background: url("../../../static/common/a01_jifen@2x.png") no-repeat;
- background-size: cover;
- margin-right: 0.1rem;
- }
- .point-detail .title .price .amount {
- display: inline-block;
- font-size: 0.5rem;
- }
- .point-detail .title .sold {
- height: 0.4rem;
- font-size: 0.28rem;
- font-family: PingFangSC-Regular, PingFang SC;
- font-weight: 400;
- color: #666666;
- line-height: 0.4rem;
- position: absolute;
- right: 0.45rem;
- bottom: 0.3rem;
- }
- .point-detail .selected {
- width: 100%;
- height: 1.1rem;
- background: #ffffff;
- margin-top: 0.2rem;
- position: relative;
- }
- .point-detail .selected .text {
- width: 0.56rem;
- height: 1.1rem;
- font-size: 0.28rem;
- font-family: PingFangSC-Regular, PingFang SC;
- font-weight: 400;
- color: #aaaaaa;
- line-height: 1.1rem;
- position: absolute;
- left: 0.31rem;
- top: 0rem;
- }
- .point-detail .selected .content {
- width: 3.09rem;
- height: 1.1rem;
- font-size: 0.28rem;
- font-family: PingFangSC-Regular, PingFang SC;
- font-weight: 500;
- color: #111111;
- line-height: 1.1rem;
- position: absolute;
- left: 1.17rem;
- }
- .point-detail .selected .icon {
- width: 0.42rem;
- height: 0.1rem;
- background: url("../../../static/point/6_d02_more.png") no-repeat 0px 0px;
- background-size: cover;
- position: absolute;
- left: 6.3rem;
- top: 0.49rem;
- }
- .point-detail .pictures {
- width: 100%;
- height: 3.2rem;
- background: #ffffff;
- margin-top: 0.21rem;
- position: relative;
- }
- .point-detail .pictures .text {
- width: 1.74rem;
- height: 1.1rem;
- font-size: 0.28rem;
- font-family: PingFangSC-Regular, PingFang SC;
- font-weight: 400;
- color: #aaaaaa;
- line-height: 1.1rem;
- position: absolute;
- top: 0rem;
- left: 2.88rem;
- }
- .point-detail .buy {
- position: fixed;
- bottom: 0.83rem;
- left: 0;
- right: 0;
- height: 1.03rem;
- }
- .point-detail .buy button {
- border: none;
- background-color: transparent;
- outline: none;
- display: block;
- width: 6.9rem;
- height: 0.8rem;
- background: #fe9700;
- border-radius: 0.45rem;
- font-size: 0.28rem;
- font-family: PingFangSC-Regular, PingFang SC;
- font-weight: 400;
- color: #ffffff;
- line-height: 0.4rem;
- margin: 0 auto;
- }
- </style>
|