Feat:购物车推荐商品
This commit is contained in:
@@ -577,3 +577,12 @@ export function getUserSpreadRule(param) {
|
|||||||
export function getHistory(params) {
|
export function getHistory(params) {
|
||||||
return request.get('/history/list', params)
|
return request.get('/history/list', params)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 购物车猜你喜欢
|
||||||
|
* @param {*} params
|
||||||
|
* @returns
|
||||||
|
*/
|
||||||
|
export function getUserLike(params) {
|
||||||
|
return request.get('/cart/guessYouLike',params)
|
||||||
|
}
|
||||||
@@ -3,8 +3,8 @@
|
|||||||
@dark-color: #333333;
|
@dark-color: #333333;
|
||||||
@white-color: #fff;
|
@white-color: #fff;
|
||||||
|
|
||||||
@colors: #C52733, #333333, #fff, #666, #F0F0F0, #999999, #E92727;
|
@colors: #C52733, #333333, #fff, #666, #F0F0F0, #999999, #E92727, #FFC543;
|
||||||
@classnames: primary, dark, white, secondary-dark, grey, dark1, red;
|
@classnames: primary, dark, white, secondary-dark, grey, dark1, red, yellow;
|
||||||
/*=====================================*/
|
/*=====================================*/
|
||||||
|
|
||||||
each(@colors, {
|
each(@colors, {
|
||||||
|
|||||||
+106
-6
@@ -23,8 +23,7 @@
|
|||||||
</view>
|
</view>
|
||||||
<view
|
<view
|
||||||
v-if="list.length === 0"
|
v-if="list.length === 0"
|
||||||
class="tc"
|
class="tc v12-my-6"
|
||||||
style="margin-top: 300rpx"
|
|
||||||
>
|
>
|
||||||
<image
|
<image
|
||||||
:src="$VUE_APP_RESOURCES_URL + '/orderIcon/购物车2.png'"
|
:src="$VUE_APP_RESOURCES_URL + '/orderIcon/购物车2.png'"
|
||||||
@@ -32,7 +31,67 @@
|
|||||||
mode="scaleToFill"
|
mode="scaleToFill"
|
||||||
/>
|
/>
|
||||||
</view>
|
</view>
|
||||||
|
<view v-if="list.length === 0">
|
||||||
|
<view class="v12-px-14">
|
||||||
|
<u-divider
|
||||||
|
text=" · 猜你喜欢 · "
|
||||||
|
textColor="#333"
|
||||||
|
lineColor="#333"
|
||||||
|
textPosition="center"
|
||||||
|
></u-divider>
|
||||||
|
</view>
|
||||||
|
<view class="userlike-wrap">
|
||||||
|
<view
|
||||||
|
v-for="(item, index) in userLikeList"
|
||||||
|
:key="index"
|
||||||
|
@click="goGoodsCon(item)"
|
||||||
|
class="v12-radius-20 v12-white v12-mb-3"
|
||||||
|
>
|
||||||
|
<view class="img-wrap">
|
||||||
|
<image :src="item.image" class="img"></image>
|
||||||
|
<image
|
||||||
|
v-if="item.isOldBrand"
|
||||||
|
:src="webUrl + '/home/old-mark.png'"
|
||||||
|
class="mark-img"
|
||||||
|
/>
|
||||||
|
<image
|
||||||
|
v-if="item.isLandmarkGoods"
|
||||||
|
:src="webUrl + '/home/mark-land.png'"
|
||||||
|
class="mark-img"
|
||||||
|
/>
|
||||||
|
<image
|
||||||
|
v-if="item.isCountyFamous"
|
||||||
|
:src="webUrl + '/home/qixian-mark.png'"
|
||||||
|
class="mark-img"
|
||||||
|
/>
|
||||||
|
</view>
|
||||||
|
<view class="info-wrap v12-pa-2">
|
||||||
|
<view class="more-t v12-font-28 v12-dark-text v12-mb-2">
|
||||||
|
{{ item.storeName }}
|
||||||
|
</view>
|
||||||
|
<view v-if="item.bestContent" class="more-t v12-mb-2 v12-font-24 v12-yellow-text v12-font-weight-300">
|
||||||
|
{{ item.bestContent }}
|
||||||
|
</view>
|
||||||
|
<view class="v12-align-center v12-primary-text v12-font-24 v12-mb-2" v-if="item.couponName">
|
||||||
|
<view class="v12-primary-border v12-radius-8 v12-px-1">券</view>
|
||||||
|
<view class="v12-primary-border v12-radius-8 v12-px-1">{{ item.couponName }}</view>
|
||||||
|
</view>
|
||||||
|
<view class="v12-justify-between v12-align-center">
|
||||||
|
<view class="v12-font-40 v12-font-bold v12-primary-text">
|
||||||
|
<text class="">¥</text>
|
||||||
|
<text class="price-txt price-red">{{ item.price }}</text>
|
||||||
|
</view>
|
||||||
|
<view class="btn">
|
||||||
|
<image
|
||||||
|
:src="webUrl + '/home/icon-cart.png'"
|
||||||
|
class="img-icon"
|
||||||
|
/>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
<view
|
<view
|
||||||
v-for="(item, index) in list"
|
v-for="(item, index) in list"
|
||||||
:key="index"
|
:key="index"
|
||||||
@@ -151,7 +210,7 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="footer-fixed flex jc-between ai-center">
|
<view class="footer-fixed flex jc-between ai-center" v-if="list.length > 0">
|
||||||
<view style="margin-left: 32rpx;">
|
<view style="margin-left: 32rpx;">
|
||||||
<CheckboxIcon
|
<CheckboxIcon
|
||||||
style="margin-right: 24rpx;"
|
style="margin-right: 24rpx;"
|
||||||
@@ -270,7 +329,7 @@
|
|||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
import XddTabbar from '@/components/xdd-tabbar'
|
import XddTabbar from '@/components/xdd-tabbar'
|
||||||
import {getAddressList} from "@/api/user";
|
import {getAddressList, getUserLike} from "@/api/user";
|
||||||
import {
|
import {
|
||||||
changeCartNum,
|
changeCartNum,
|
||||||
getCartGroup,
|
getCartGroup,
|
||||||
@@ -304,7 +363,8 @@ export default {
|
|||||||
pageKeyId: Object.freeze('landmarkGoodsIndex'),
|
pageKeyId: Object.freeze('landmarkGoodsIndex'),
|
||||||
isEdit: false,
|
isEdit: false,
|
||||||
addressList:[],
|
addressList:[],
|
||||||
addressInfo: {}
|
addressInfo: {},
|
||||||
|
userLikeList: []
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
@@ -349,6 +409,14 @@ export default {
|
|||||||
this.pageToHideHandle()
|
this.pageToHideHandle()
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
goGoodsCon(item) {
|
||||||
|
this.$yrouter.push({
|
||||||
|
path: '/pages/shop/GoodsCon/index',
|
||||||
|
query: {
|
||||||
|
id: item.productId
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
closePopup() {
|
closePopup() {
|
||||||
this.show = false
|
this.show = false
|
||||||
},
|
},
|
||||||
@@ -409,6 +477,8 @@ export default {
|
|||||||
this.isLoad = true
|
this.isLoad = true
|
||||||
this.list = res.data['valid']
|
this.list = res.data['valid']
|
||||||
this.handleAll(false)
|
this.handleAll(false)
|
||||||
|
const _res = await getUserLike()
|
||||||
|
this.userLikeList = _res.data
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
handleAll(state) {
|
handleAll(state) {
|
||||||
@@ -670,6 +740,10 @@ export default {
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped lang="less">
|
<style scoped lang="less">
|
||||||
|
.img-icon{
|
||||||
|
width: 48rpx;
|
||||||
|
height: 48rpx;
|
||||||
|
}
|
||||||
.list-wrap{
|
.list-wrap{
|
||||||
height: calc(100vh - 410rpx);
|
height: calc(100vh - 410rpx);
|
||||||
overflow: auto;
|
overflow: auto;
|
||||||
@@ -937,4 +1011,30 @@ view {
|
|||||||
.tabbar-page {
|
.tabbar-page {
|
||||||
padding: 0 0 180rpx 0;
|
padding: 0 0 180rpx 0;
|
||||||
}
|
}
|
||||||
|
.userlike-wrap{
|
||||||
|
column-count: 2;
|
||||||
|
padding: 0 20rpx;
|
||||||
|
}
|
||||||
|
.img {
|
||||||
|
position: relative;
|
||||||
|
z-index: 2;
|
||||||
|
display: block;
|
||||||
|
width: 345rpx;
|
||||||
|
height: 345rpx;
|
||||||
|
border-radius: 20rpx;
|
||||||
|
}
|
||||||
|
.mark-img {
|
||||||
|
position: absolute;
|
||||||
|
top: 0;
|
||||||
|
right: -2px;
|
||||||
|
z-index: 3;
|
||||||
|
display: block;
|
||||||
|
width: 84rpx;
|
||||||
|
height: 74rpx;
|
||||||
|
}
|
||||||
|
.img-wrap{
|
||||||
|
position: relative;
|
||||||
|
overflow: hidden;
|
||||||
|
border-radius: 20rpx;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
Reference in New Issue
Block a user