['我的资产-我的优惠券']

This commit is contained in:
2021-09-17 09:45:15 +08:00
parent 004536faeb
commit e9d6eae051
25 changed files with 27229 additions and 8134 deletions

View File

@@ -0,0 +1,217 @@
<template>
<view class="Collect-list">
<!--有收藏的店铺 -->
<view class="list-item" v-if="lists.length>0" v-for="(item,index) in lists" :key="index">
<view class="list-top">
<view class="list-top-left">
<image :src="item.cover" mode="aspectFill" class="list-banner"></image>
<view class="shop-info">
<view class="title ellipsis">{{item.name}}</view>
<view class="urate">
<u-rate :current="item.star" size="28rpx" :disabled="true"></u-rate>
</view>
<view class="des">销量:<span>100</span> <span> </span> 库存:<span>2524</span></view>
</view>
</view>
<view class="list-top-right" @click="onOpenWechat(item)">进店逛逛</view>
</view>
<view class="list-bottom">
<view class="list-bottom-item" v-for="(it,idx) in item.goods" :key='idx'>
<image class="goods-img" :src="it.cover" mode="aspectFill" @click="goGoods(it.goods_id)"></image>
<view class="money"> {{it.price.price_min}}</view>
</view>
</view>
</view>
<!-- 没有收藏的店铺 -->
<no-list name='no-shop' v-if="lists.length === 0" txt="您还没有收藏任何企业哦~" />
<!-- <u-toast ref="uToast" /> -->
<u-toast ref="uToast" />
</view>
</template>
<script>
import {
shopSubscribeList
} from '@/apis/interfaces/mine'
export default {
data() {
return {
lists: [],
page: 1,
has_more: true,
};
},
onLoad(e) {
this.getList()
},
onReachBottom() {
if (this.has_more) {
this.page = this.page + 1
this.getGoodsByCompanyidCaregoryid()
} else {
this.$refs.uToast.show({
title: '吼吼吼~我是有底的~',
type: 'primary',
duration: 3000
})
}
},
methods: {
// 获取列表
getList() {
shopSubscribeList(this.page).then(res => {
console.log(res)
this.lists = this.lists.concat(res.data)
if (res.page.has_more) {
this.has_more = true
} else {
this.has_more = false
}
}).catch(err => {
this.$refs.uToast.show({
title: err.message,
type: 'primary',
duration: 3000
})
})
},
// 打开微信小程序
onOpenWechat(e){
plus.share.getServices(res => {
let sweixin = null;
for(let val of res){
if(val.id === 'weixin'){
sweixin = val
}
}
/** 以此为例子 显示跳转引导页
* 'index_4'
* index 跳小程序企业首页
* 4 企业id
**/
if(sweixin != null){
sweixin.launchMiniProgram({
id : e.original_id,
path: 'pages/login/guide?scene=index_' + e.company_id,
})
}else{
uni.showToast({
title: '当前环境不支持打开微信小程序',
icon : 'none'
})
}
})
},
// 跳转商城
goShop(company_id) {
uni.setStorageSync('company_id', company_id)
uni.setStorageSync('refresh',true)
this.$Router.pushTab({
name: 'Goods'
})
},
goGoods(id) {
this.$Router.push({name: 'goodsDetails', query: {id: id}})
}
}
}
</script>
<style lang="scss" scoped>
.Collect-list {
.list-item {
border-top: solid 20rpx #F7F7F7;
padding: 0 30rpx 30rpx 30rpx;
.list-top {
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-between;
box-sizing: border-box;
padding: 30rpx 0;
font-size: $title-size*0.94;
border-bottom: solid 1rpx #f7f7f7;
.list-top-left {
display: flex;
flex-direction: row;
align-items: center;
justify-content: flex-start;
box-sizing: border-box;
.title {
width: 380rpx;
font-size: $title-size*1;
font-weight: 400;
}
.urate {
padding: 10rpx 0;
}
.des {
// padding-top: $padding*0.8;
font-size: $title-size * 0.8;
color: #999;
span {
color: #666;
padding: 0 10rpx;
}
}
.list-banner {
width: 120rpx;
margin-right: $margin*1.5;
height: 120rpx;
border-radius: 4rpx;
}
}
.list-top-right {
border: solid 1rpx $main-color;
color: $main-color;
display: inline-block;
padding: 8rpx 16rpx;
font-size: $title-size *0.8;
border-radius: 4rpx;
}
}
.list-bottom {
margin-top: 20rpx;
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-between;
box-sizing: border-box;
// padding: 0 30rpx;
.list-bottom-item {
width: 160rpx;
height: 160rpx;
position: relative;
.goods-img {
width: 100%;
height: 100%;
}
.money {
position: absolute;
bottom: 0;
right: 0;
background-color: rgba($color: #000000, $alpha: 0.5);
color: #fff;
padding: 2rpx 8rpx;
font-size: $title-size *0.9;
}
}
}
}
}
</style>

View File

@@ -34,7 +34,7 @@
},
onLoad(e) {
console.log(e)
this.id = this.$route.query.id
this.id = e.id
this.getMyCoupon()
},
onShow() {

View File

@@ -12,9 +12,9 @@
<view class="goods-title" v-if="info.goods.length>0">可用商品 <span
style='font-size: 24rpx;color:gray;'>多选一</span></view>
<view class="goods-item" v-if="info.goods.length>0" v-for="(item,index) in info.goods" :key='index'>
<image :src="item.cover" mode="aspectFill" class="goods-img" @click="$router.push({name:'goodsDetails',query:{id:item.goods_id}})" />
<image :src="item.cover" mode="aspectFill" class="goods-img" @click="goDetail(item.goods_id)" />
<view class="goods-right">
<view class="goods-right-title ellipsis-2" @click="$router.push({name:'goodsDetails',query:{id:item.goods_id}})">{{item.name}}</view>
<view class="goods-right-title ellipsis-2" @click="goDetail(item.goods_id)">{{item.name}}</view>
<view class="goods-right-bottom">
<span class='money'>{{item.price}}</span>
<view class="used" v-if='info.use_way.value=== 1' @click="nowBuy(item)">立即购买</view>
@@ -67,8 +67,7 @@
GoodTemplate
},
onLoad(e) {
console.log(this.$route)
this.coupon_grant_id = this.$route.query.id
this.coupon_grant_id = e.id
this.getList()
},
methods: {
@@ -87,16 +86,14 @@
},
// 点击立即购买去商品确认页面
nowBuy(items) {
console.log(items, 'items....')
let data = {
skuId: items.goods_sku_id,
qty: 1
}
this.$router.push({
name: 'Buy',
params: data
uni.navigateTo({
url:'/pages/order/buy?qty=1&skuId='+items.goods_sku_id,
})
},
goDetail(id){
uni.navigateTo({
url:'/pages/goods/details?id='+id
})
console.log(data)
},
// 点击二维码特效
clickCode(grantid) {
@@ -152,7 +149,7 @@
// 优惠券
.coupon {
margin: 0 $margin * 2;
margin: 0 $margin;
background-color: #Fff;
position: relative;
z-index: 1;
@@ -182,7 +179,7 @@
// 可用商品
.goods-item {
background-color: #fff;
margin: $margin*1.5 $margin * 2;
margin: $margin*1.5 $margin;
border-radius: 20rpx;
display: flex;
flex-direction: row;
@@ -237,18 +234,18 @@
font-size: 34rpx;
font-weight: bold;
text-align: left;
margin: $margin*2;
margin: $margin $margin;
// text-shadow:10rpx 10rpx linear-gradient(to right, #f39e17, #f85b05);
text-shadow: 2rpx 2rpx 10rpx $main-color;
}
// 描述
.describe {
margin: $margin * 2 0;
margin: $margin 0;
.describe-des {
color: #999;
padding: 10rpx $margin * 2;
padding: 10rpx $margin ;
font-size: 28rpx;
}
}

View File

@@ -83,18 +83,18 @@
<!-- 我的权证 -->
<view class="user-group">
<view class="group-flex group-flex-4">
<view class="item">
<image class="item-cover" src="@/static/icons/user_icon_01.png" mode="aspectFill" />
<view class="item-title">商品收藏</view>
</view>
<view class="item">
<view class="item" @click="$Router.push({name:'Collection'})">
<image class="item-cover" src="@/static/icons/user_icon_02.png" mode="aspectFill" />
<view class="item-title">关注企业</view>
<view class="item-title">收藏的企业</view>
</view>
<view class="item" @click="$Router.push({name:'CouponList'})">
<image class="item-cover" src="@/static/icons/user_icon_03.png" mode="aspectFill" />
<view class="item-title">我的优惠券</view>
</view>
<view class="item">
<image class="item-cover" src="@/static/icons/user_icon_01.png" mode="aspectFill" />
<view class="item-title">我的足迹</view>
</view>
<view class="item" @click="$Router.push({name:'AddressList'})">
<image class="item-cover" src="@/static/icons/user_icon_04.png" mode="aspectFill" />
<view class="item-title">地址管理</view>
@@ -140,13 +140,14 @@
<image class="tips" src="../../static/icons/property_icon_01.png" mode="aspectFill" />
</view>
</view>
<!-- 推广海报 -->
<view class="poster-text">推广海报</view>
<carousel :img-list="imgList" url-key="url" @selected="selectedBanner"/>
</block>
<!-- 版权信息 -->
<view class="copyright">易品新境 beta 1.0.0</view>
<view class="copyright" @click="copyright">易品新境 beta 1.0.0</view>
</view>
</template>
@@ -177,6 +178,12 @@
},
selectedBanner(item, index) {
console.log('🥒', item, index)
},
copyright(){
uni.clearStorageSync()
uni.navigateTo({
url:'/pages/login/login'
})
}
}
}