|
@@ -179,7 +179,9 @@
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
<div class="bnt-bos flex-row-start">
|
|
<div class="bnt-bos flex-row-start">
|
|
|
- <el-button :disabled="dataInfo.allStock > 0 ? false : true" class="btn" type="primary" @click="onCart">加入购物车</el-button>
|
|
|
|
|
|
|
+ <el-button :disabled="dataInfo.allStock > 0 && dataInfo.productStatus == 1 ? false : true" class="btn" type="primary" @click="onCart"
|
|
|
|
|
+ >加入购物车</el-button
|
|
|
|
|
+ >
|
|
|
<span v-if="dataInfo.allStock <= 0" class="btn-text">(库存不足)</span>
|
|
<span v-if="dataInfo.allStock <= 0" class="btn-text">(库存不足)</span>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
@@ -235,7 +237,7 @@
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
|
<script setup lang="ts">
|
|
<script setup lang="ts">
|
|
|
-import { getToken } from '@/utils/auth';
|
|
|
|
|
|
|
+import Cookies from 'js-cookie';
|
|
|
import { regionData } from 'element-china-area-data';
|
|
import { regionData } from 'element-china-area-data';
|
|
|
import { onPath } from '@/utils/siteConfig';
|
|
import { onPath } from '@/utils/siteConfig';
|
|
|
import figure from '@/assets/images/figure.png';
|
|
import figure from '@/assets/images/figure.png';
|
|
@@ -267,6 +269,7 @@ const recommendList = ref<any>([]);
|
|
|
const num = ref<any>(1);
|
|
const num = ref<any>(1);
|
|
|
const carouselIndex = ref<any>(0);
|
|
const carouselIndex = ref<any>(0);
|
|
|
const productNo = ref<any>(null);
|
|
const productNo = ref<any>(null);
|
|
|
|
|
+const token = Cookies.get('Authorization');
|
|
|
|
|
|
|
|
watch(route, () => {
|
|
watch(route, () => {
|
|
|
initData();
|
|
initData();
|
|
@@ -294,7 +297,8 @@ const initData = () => {
|
|
|
getInfoId();
|
|
getInfoId();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- if (getToken()) {
|
|
|
|
|
|
|
+ if (token) {
|
|
|
|
|
+ console.log('收藏');
|
|
|
getCollection();
|
|
getCollection();
|
|
|
// 浏览记录
|
|
// 浏览记录
|
|
|
addProductBrowsingHistory(id.value).then((res) => {});
|
|
addProductBrowsingHistory(id.value).then((res) => {});
|