【修复】商品详情页,未登录状态下,需要登录的问题
parent
508bd9cbd7
commit
2ea027a6e0
|
@ -99,14 +99,8 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import {
|
import { reactive, computed } from 'vue';
|
||||||
reactive,
|
import { onLoad, onPageScroll } from '@dcloudio/uni-app';
|
||||||
computed
|
|
||||||
} from 'vue';
|
|
||||||
import {
|
|
||||||
onLoad,
|
|
||||||
onPageScroll
|
|
||||||
} from '@dcloudio/uni-app';
|
|
||||||
import sheep from '@/sheep';
|
import sheep from '@/sheep';
|
||||||
import CouponApi from '@/sheep/api/promotion/coupon';
|
import CouponApi from '@/sheep/api/promotion/coupon';
|
||||||
import ActivityApi from '@/sheep/api/promotion/activity';
|
import ActivityApi from '@/sheep/api/promotion/activity';
|
||||||
|
@ -124,7 +118,8 @@
|
||||||
|
|
||||||
onPageScroll(() => {});
|
onPageScroll(() => {});
|
||||||
|
|
||||||
const state = reactive({
|
const isLogin = computed(() => sheep.$store('user').isLogin);
|
||||||
|
const state = reactive({
|
||||||
goodsId: 0,
|
goodsId: 0,
|
||||||
skeletonLoading: true, // SPU 加载中
|
skeletonLoading: true, // SPU 加载中
|
||||||
goodsInfo: {}, // SPU 信息
|
goodsInfo: {}, // SPU 信息
|
||||||
|
@ -235,12 +230,14 @@
|
||||||
state.goodsInfo = res.data;
|
state.goodsInfo = res.data;
|
||||||
|
|
||||||
// 加载是否收藏
|
// 加载是否收藏
|
||||||
FavoriteApi.isFavoriteExists(state.goodsId, 'goods').then((res) => {
|
if (isLogin.value) {
|
||||||
if (res.code !== 0) {
|
FavoriteApi.isFavoriteExists(state.goodsId, 'goods').then((res) => {
|
||||||
return;
|
if (res.code !== 0) {
|
||||||
}
|
return;
|
||||||
state.goodsInfo.favorite = res.data;
|
}
|
||||||
});
|
state.goodsInfo.favorite = res.data;
|
||||||
|
});
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
// 2. 加载优惠劵信息
|
// 2. 加载优惠劵信息
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import request from '@/sheep/request';
|
import request from '@/sheep/request';
|
||||||
|
|
||||||
const BrokerageApi = {
|
const BrokerageApi = {
|
||||||
// 绑定推广员
|
// 绑定分销用户
|
||||||
bindBrokerageUser: (data)=>{
|
bindBrokerageUser: (data)=>{
|
||||||
return request({
|
return request({
|
||||||
url: '/trade/brokerage-user/bind',
|
url: '/trade/brokerage-user/bind',
|
||||||
|
|
Loading…
Reference in New Issue