Browse Source

feat: page-collect;

pull/2/head
Fox-33 2 weeks ago
parent
commit
450e9603b5
6 changed files with 78 additions and 15 deletions
  1. +25
    -11
      components/product/productCard.vue
  2. +1
    -1
      pages_order/auth/wxUserInfo.vue
  3. +2
    -1
      pages_order/partner/team.vue
  4. +1
    -1
      pages_order/partner/withdraw.vue
  5. +48
    -0
      pages_order/product/collectList.vue
  6. +1
    -1
      uni.scss

+ 25
- 11
components/product/productCard.vue View File

@ -35,7 +35,7 @@
@click.stop="onCollect" @click.stop="onCollect"
@touchstart.stop="() => {}" @touchstart.stop="() => {}"
> >
<view>收藏</view>
<view>{{ isCollected ? '移除收藏' : '收藏' }}</view>
</button> </button>
</view> </view>
</template> </template>
@ -48,6 +48,10 @@
default() { default() {
return {} return {}
} }
},
isCollected: {
type: Boolean,
default: false,
} }
}, },
data() { data() {
@ -65,13 +69,16 @@
return (this.data.currentPrice % this.priceInt).toFixed(2).slice(1) return (this.data.currentPrice % this.priceInt).toFixed(2).slice(1)
}, },
collectBtnStyle() { collectBtnStyle() {
let display = Math.ceil(this.displayX / 56 * 100)
const width = this.isCollected ? 80 : 56
const background = this.isCollected ? '#26334E' : '#FF9035'
let display = Math.ceil(this.displayX / this.collectBtnWidth * 100)
display > 100 && (display = 100) display > 100 && (display = 100)
const translateX = 100 - display const translateX = 100 - display
return `transform: translateX(${translateX}%);`
return `width: ${width}px; transform: translateX(${translateX}%); background: ${background};`
} }
}, },
methods: { methods: {
@ -108,13 +115,20 @@
}, },
onCollect() { onCollect() {
console.log('onCollect') console.log('onCollect')
// todo: fetch collect
uni.showToast({
icon: 'success',
title: '已收藏',
});
if (this.isCollected) {
// todo: fetch cancel collect
uni.showToast({
icon: 'success',
title: '已移除收藏',
});
} else {
// todo: fetch collect
uni.showToast({
icon: 'success',
title: '已收藏',
});
}
this.hiddenCollectBtn() this.hiddenCollectBtn()
}, },
onRegistrate() { onRegistrate() {
@ -216,12 +230,12 @@
top: 0; top: 0;
right: 0; right: 0;
row-gap: 8rpx; row-gap: 8rpx;
width: 112rpx;
// width: 112rpx;
height: 100%; height: 100%;
font-size: 24rpx; font-size: 24rpx;
line-height: 1; line-height: 1;
color: #FFFFFF; color: #FFFFFF;
background: #FF9035;
// background: #FF9035;
} }
</style> </style>

+ 1
- 1
pages_order/auth/wxUserInfo.vue View File

@ -202,7 +202,7 @@
.page__view { .page__view {
width: 100vw; width: 100vw;
min-height: 100vh; min-height: 100vh;
background: unset;
background: $uni-bg-color;
position: relative; position: relative;
/deep/ .nav-bar__view { /deep/ .nav-bar__view {


+ 2
- 1
pages_order/partner/team.vue View File

@ -1,7 +1,7 @@
<template> <template>
<view class="page__view"> <view class="page__view">
<navbar title="我的团队" leftClick @leftClick="$utils.navigateBack" color="#191919" bgColor="#FFFFFF" />
<navbar title="我的团队" leftClick @leftClick="$utils.navigateBack" />
<view class="main"> <view class="main">
@ -57,6 +57,7 @@
{ name: '直推用户列表' }, { name: '直推用户列表' },
{ name: '间推用户列表' }, { name: '间推用户列表' },
], ],
// todo
mixinsListApi: '', mixinsListApi: '',
current: 0, current: 0,
} }


+ 1
- 1
pages_order/partner/withdraw.vue View File

@ -118,7 +118,7 @@
.page__view { .page__view {
width: 100vw; width: 100vw;
min-height: 100vh; min-height: 100vh;
background: unset;
background: $uni-bg-color;
position: relative; position: relative;
/deep/ .nav-bar__view { /deep/ .nav-bar__view {


+ 48
- 0
pages_order/product/collectList.vue View File

@ -0,0 +1,48 @@
<template>
<view class="page__view">
<navbar title="我的收藏" leftClick @leftClick="$utils.navigateBack" />
<view class="list">
<view class="list-item" v-for="item in list" :key="item.id">
<productCard :data="item" :isCollected="true" ></productCard>
</view>
</view>
</view>
</template>
<script>
import mixinsList from '@/mixins/list.js'
import productCard from '@/components/product/productCard.vue'
export default {
mixins: [mixinsList],
components: {
productCard,
},
data() {
return {
// todo
mixinsListApi: '',
}
},
}
</script>
<style lang="scss" scoped>
.page__view {
background: $uni-bg-color;
}
.list {
padding: 32rpx;
&-item {
& + & {
margin-top: 32rpx;
}
}
}
</style>

+ 1
- 1
uni.scss View File

@ -30,7 +30,7 @@ $uni-text-color-disable:#c0c0c0;
/* 背景颜色 */ /* 背景颜色 */
$uni-fg-color:#ffffff; $uni-fg-color:#ffffff;
$uni-bg-color: #E5F2F9;
$uni-bg-color: #F2F2F2;
$uni-bg-color-grey:#F4F4F4; $uni-bg-color-grey:#F4F4F4;
$uni-bg-color-hover:#f1f1f1;//点击状态颜色 $uni-bg-color-hover:#f1f1f1;//点击状态颜色
$uni-bg-color-mask:rgba(0, 0, 0, 0.4);//遮罩颜色 $uni-bg-color-mask:rgba(0, 0, 0, 0.4);//遮罩颜色


Loading…
Cancel
Save