jiuyiUniapp/jiuyi2/pages/shop/collect.vue

140 lines
3.1 KiB
Vue
Raw Normal View History

2024-12-27 15:03:48 +08:00
<script setup>
// 商品收藏
import {
2025-01-21 22:33:44 +08:00
ref,
reactive,
2024-12-27 15:03:48 +08:00
} from 'vue';
import apex from '@/components/header/apex'
2025-01-19 13:55:21 +08:00
import {
onReachBottom,
onPullDownRefresh,
onShow,
onLoad,
onReady,
} from '@dcloudio/uni-app';
//
import api from '@/api/index.js';
// util
import util from '@/common/js/util';
2024-12-27 15:03:48 +08:00
//
const setting = ref(false)
2025-01-21 22:33:44 +08:00
// 收藏列表
const list = reactive({
data: [],
})
2025-01-19 13:55:21 +08:00
onLoad(() => {
// 获取列表
getList()
})
// 获取列表
function getList() {
api.shop.getCollectList({}).then(res => {
console.log(res)
2025-01-21 22:33:44 +08:00
if (res.code == 200) {
list.data = res.data
return
}
util.alert({
content: res.msg,
showCancel: false,
})
2025-01-19 13:55:21 +08:00
})
}
2025-01-21 22:33:44 +08:00
/**
* 规格选择
* @param {Object} secItem
*/
function handleSpec(secItem) {
//
}
2024-12-27 15:03:48 +08:00
</script>
<template>
<view class="app">
<apex title="商品收藏">
<template #right>
<view class="f26" @click="setting = !setting">
<text v-if="setting">完成</text>
<text v-else>管理</text>
</view>
</template>
</apex>
<view class="list">
2025-01-21 22:33:44 +08:00
<view class="item oh mb20 plr30 bfff" v-for="(item,index) in list.data" :key="index">
2024-12-27 15:03:48 +08:00
<!-- 店铺 -->
<view class="store line df aic ptb20 thd f1 f28">
2025-01-21 22:33:44 +08:00
<image class="wh50 br10" :src="item.rectangleLogo"
2024-12-27 15:03:48 +08:00
mode="aspectFill" />
2025-01-21 22:33:44 +08:00
<view class="name ml10 c333">{{item.name}}</view>
2024-12-27 15:03:48 +08:00
</view>
<!-- 商品信息 -->
2025-01-21 22:33:44 +08:00
<view class="product line df ptb20" v-for="(secItem,secIndex) in item.shopifyProductInfos" :key="secIndex">
2024-12-27 15:03:48 +08:00
<view class="fmid mr10">
<template v-if="index == 0">
<uni-icons type="circle" size="40rpx" color="#aaa" />
</template>
<template v-else>
<uni-icons type="checkbox-filled" size="40rpx" color="#F8BA4D" />
</template>
</view>
<view class="poster wh160">
<image class="wh160 br10"
2025-01-21 22:33:44 +08:00
:src="secItem.sliderImage.split(',')[0]"
2024-12-27 15:03:48 +08:00
mode="aspectFill" />
</view>
2025-01-21 22:33:44 +08:00
<view class="info oh df fdc jcsb f1 ml20">
<view class="name thd c333 f28">{{item.name}}</view>
<view class="spec line df thd mtb10 ptb10 plr10 df aic c666 f24 br10" @click="handleSpec(secItem)">
<text>已选规格 升级款/小熊</text>
</view>
2024-12-27 15:03:48 +08:00
<view class="other df aic">
<view class="price c333">
<text class="f20"></text>
2025-01-21 22:33:44 +08:00
<text class="f30">{{secItem.price}}</text>
2024-12-27 15:03:48 +08:00
</view>
2025-01-21 22:33:44 +08:00
<view class="count ml20 fs0 c999 f24">销量{{secItem.sales}}</view>
2024-12-27 15:03:48 +08:00
</view>
</view>
</view>
</view>
</view>
<view class="fill" style="height: 180rpx;"></view>
<view class="footer rows plr30 bfff shadow">
<view class="c999 f26">已选择9款</view>
<view class="col df aic">
<view class="total mr20" v-if="!setting">
<text class="c333 f20">合计</text>
<text class="cFF9B27 f20"></text>
<text class="cFF9B27 f46">98</text>
</view>
<view class="btn primary w200">去结算</view>
</view>
</view>
</view>
</template>
<style lang="scss" scoped>
// 产品
.item {
.line+.line {
border-top: 2rpx solid #eee;
}
2025-01-21 22:33:44 +08:00
// 规格
.spec {
border: 2rpx solid #ddd;
}
2024-12-27 15:03:48 +08:00
}
</style>