| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247 |
- <template>
- <view class="">
- <view class="goldenBean">
- <view class="title">
- <image src="@/static/img/list1.png"></image>
- <view class="title-t"> {{list}} </view>
- <text class="about">超值体验</text>
- <view class="">
- {{id}}
- </view>
- </view>
- <view class="box">
- <view class="header" :style="indexLoad%2!=1?bgColor[0]:bgColor[1]" >
- <view class="left">
- <view class="title">
- 热门好物推荐
- </view>
- <view class="about">
- 买到就是赚到
- </view>
- </view>
- <view class="right">
- <image src="@/static/img/right.png" @click="navto('/pages/product/fenlei?id='+id)"></image>
- </view>
- </view>
- <view class="footer">
- <view class="list">
- <view class="item" v-for="d in jdList"
- @click="navto('/pages/product/product?id=' + d.id + '&is_gold=' + 1)">
- <view class="img">
- <image :src="d.image" mode=""></image>
- </view>
- <view class="name nowarp" :title='d.store_name'>
- {{ d.store_name }}
- </view>
- <view class="price">
- ¥{{ d.price }}
- </view>
- <view class="name" style="font-size: 22rpx;color: #999;">
- 已售 {{ d.sales || '0'}}
- </view>
- </view>
- </view>
- </view>
- </view>
- </view>
- </view>
- </template>
- <script>
- import {
- goodsDetail,getProducts
- } from '@/api/product.js'
- export default {
- props: ['data', 'leibie', 'index'],
- mounted() {
- // console.log(this.data);
- console.log(this.leibie, this.index, 'ssss');
- this.list = this.leibie.cate_name
- this.id = this.leibie.id
- console.log(this.id,'eiddidi');
- this.indexLoad = this.index
- // this.leibie.forEach(
- // item => {
- // this.list = item.cate_name
- // console.log(this.list, 'weqeq')
- // });
- // for(let arr of this.leibie){arr=>{
- // console.log(arr,'2222');
- // }}
- },
- data() {
- return {
- list: '',
- id: '',
- indexLoad: '',
- jdList:[],
- bgColor: [{background: "linear-gradient(43deg, #FFBD70, #FF8F44)"},
- {background: "linear-gradient(90deg, #F75022, #FF8B6C)"},
- ]
- }
- },
- onLoad() {
- this.getBargainList()
- },
- // onShow() {
- // this.goodsDetail()
- // },
- methods: {
- getBargainList() {
- let that = this;
- getProducts({
- page: that.page,
- limit: that.limit,
- sid:that.id
- })
- .then(function(res) {
- that.jdList = res.data
- console.log(that.jdList,'jdlist');
- })
- .catch(res => {});
- },
- navto(url) {
- uni.navigateTo({
- url: url
- });
- },
- // 获取商品信息
- goodsDetail() {
- let obj = this;
- goodsDetail({}, this.id).then(function({
- data
- }) {
- console.log(data, 'data');
- });
- },
- }
- }
- </script>
- <style lang="scss" scoped>
- $grey: #95A0B1;
- $text: #333333;
- $red: #FF4C4C;
- // 金豆专区
- .goldenBean {
- font-family: PingFang-SC-Bold;
- margin-top: 20rpx;
- padding: 20rpx;
- background-color: #fff;
- .title {
- display: flex;
- line-height: 40rpx;
- .title-t {
- color: $text;
- font-weight: bold;
- margin: 0 20rpx;
- font-size: 34rpx;
- }
- .about {
- font-size: 24rpx;
- color: $grey;
- }
- image {
- width: 40rpx;
- height: 40rpx;
- }
- }
- .box {
- margin: 20rpx 0;
- border-radius: 10rpx;
- overflow: hidden;
- .header {
- padding: 20rpx;
- padding-bottom: 80rpx;
- width: 100%;
- display: flex;
- justify-content: space-between;
- color: #fff;
- .left {
- line-height: 40rpx;
- .title {
- font-size: 32rpx;
- }
- .about {
- opacity: 0.9;
- font-size: 24rpx;
- }
- }
- .right {
- margin: auto 0;
- image {
- width: 30rpx;
- height: 30rpx;
- }
- }
- }
- .footer {
- height: 300rpx;
- background-color: $page-color-base;
- padding: 20rpx;
- margin-bottom: -50rpx;
- .list {
- display: flex;
- justify-content: space-between;
- overflow: auto;
- border-radius: 10rpx;
- position: relative;
- top: -90rpx;
- background-color: #fff;
- .item {
- padding: 35rpx;
- border-right: solid 1rpx $page-color-base;
- .name {
- font-size: 24rpx;
- color: #3F3F3F;
- width: 150rpx;
- overflow: hidden;
- display: -webkit-box;
- -webkit-box-orient: vertical;
- -webkit-line-clamp: 1;
- border-radius: 10rpx;
- text-overflow: ellipsis;
- }
- .price {
- font-size: 28rpx;
- color: $red;
- font-weight: bold;
- }
- .img {
- overflow: hidden;
- border-radius: 20rpx;
- image {
- width: 150rpx;
- height: 150rpx;
- }
- }
- }
- }
- }
- }
- }
- </style>
|