|
|
@@ -3,8 +3,7 @@
|
|
|
<div class="goodlist" v-show="tagclick.type == 'goodlist'">
|
|
|
<div class="head-pages">
|
|
|
<div>
|
|
|
- <span>{{ current + 1 }}</span
|
|
|
- ><span>/{{ tagclick.data.products ? tagclick.data.products.length : "-" }}</span>
|
|
|
+ <span>{{ current + 1 }}</span><span>/{{ tagclick.data.products ? tagclick.data.products.length : "-" }}</span>
|
|
|
</div>
|
|
|
<ui-icon @click.stop="close" type="state_f"></ui-icon>
|
|
|
</div>
|
|
|
@@ -12,56 +11,16 @@
|
|
|
<ul class="swiper-wrapper">
|
|
|
<li class="swiper-slide" v-for="(i, index) in tagclick.data.products" :key="index">
|
|
|
<div>
|
|
|
- <viewimg :list="i.pics" :keyid="`viewimg_${index + 1}`" />
|
|
|
-
|
|
|
+ <!-- <viewimg :list="[i.pic]" :keyid="`viewimg_${index + 1}`" /> -->
|
|
|
+ <img :src="i.pic" alt="">
|
|
|
<div class="info">
|
|
|
<p>{{ i.name }}</p>
|
|
|
- <div v-if="i.skus">
|
|
|
- <span>{{ i.price[0].symbol }}</span
|
|
|
- ><span>{{ i.currentSku.price }}</span>
|
|
|
- </div>
|
|
|
- <ul>
|
|
|
- <li>
|
|
|
- <span>{{$t('common.guige')}}</span>
|
|
|
- <ul>
|
|
|
- <li @click.stop="onClickSku(item)" :class="{ active: item.id == i.currentSku.id }" v-for="(item, idx) in i.skus" :key="idx">
|
|
|
- <span v-if="item.properties[0]">
|
|
|
- {{ item.properties[0].value }}
|
|
|
- </span>
|
|
|
- </li>
|
|
|
- </ul>
|
|
|
- </li>
|
|
|
- <li>
|
|
|
- <span>{{$t('common.shuliang')}}</span>
|
|
|
- <div class="number">
|
|
|
- <ui-icon
|
|
|
- @click="
|
|
|
- () => {
|
|
|
- i.cartnum--;
|
|
|
- i.cartnum = Math.max(i.cartnum, 0);
|
|
|
- }
|
|
|
- "
|
|
|
- type="cad-neiqiang"
|
|
|
- ></ui-icon>
|
|
|
- <input maxlength="5" v-model="i.cartnum" type="number" />
|
|
|
- <ui-icon
|
|
|
- @click="
|
|
|
- () => {
|
|
|
- i.cartnum++;
|
|
|
- i.cartnum = Math.min(i.cartnum, 9999);
|
|
|
- }
|
|
|
- "
|
|
|
- type="add"
|
|
|
- ></ui-icon>
|
|
|
- </div>
|
|
|
- </li>
|
|
|
- </ul>
|
|
|
+
|
|
|
</div>
|
|
|
<div class="goods-button">
|
|
|
- <span v-if="i.saleChannel == 1" class="tipss">{{$t('common.onlyOffLine')}}</span>
|
|
|
+ <span v-if="i.saleChannel == 1" class="tipss">{{ $t('common.onlyOffLine') }}</span>
|
|
|
<template v-else>
|
|
|
- <div @click.stop="viewDetail(i)">{{$t('common.viewDetail')}}</div>
|
|
|
- <div @click.stop="addCart(i)">{{$t('common.addCart')}}</div>
|
|
|
+ <div @click.stop="viewDetail(i)">{{ $t('common.viewDetail') }}</div>
|
|
|
</template>
|
|
|
</div>
|
|
|
</div>
|
|
|
@@ -102,116 +61,16 @@ const viewDetail = (item) => {
|
|
|
return;
|
|
|
}
|
|
|
apis.burying_point({ type: 3, productId: item.id });
|
|
|
- browser.openLink(
|
|
|
- `/pages/item/item?productId=${item.id}`,
|
|
|
- `https://m.cdfmembers.com/shop/600667208/item?productId=${item.id}`,
|
|
|
- `/pages/item/item?productId=${item.id}`
|
|
|
- );
|
|
|
-};
|
|
|
-
|
|
|
-const onClickSku = (item) => {
|
|
|
- let tempData = toRaw(tagclick.value.data);
|
|
|
|
|
|
- tempData.products[current.value] = {
|
|
|
- ...tempData.products[current.value],
|
|
|
- currentSku: { ...item },
|
|
|
- };
|
|
|
+ browser.openLink(item.url)
|
|
|
|
|
|
- store.commit("tag/setTagClickType", {
|
|
|
- type: tagclick.value.type,
|
|
|
- data: tempData,
|
|
|
- });
|
|
|
};
|
|
|
|
|
|
-const addCart = async (item) => {
|
|
|
- if (isshoppingguide.value) {
|
|
|
- return;
|
|
|
- }
|
|
|
- Loading.show();
|
|
|
-
|
|
|
- let result = await apis.inCat({
|
|
|
- AccessToken: browser.getURLParam("AccessToken"),
|
|
|
- skuId: item.currentSku.id,
|
|
|
- num: item.cartnum,
|
|
|
- rnd: Math.random(),
|
|
|
- });
|
|
|
-
|
|
|
- Loading.hide();
|
|
|
- if (result.code === 0) {
|
|
|
- apis.burying_point({ type: 7, productId: item.id });
|
|
|
- return Dialog.toast({ content: t('common.addSuccess'), type: "success" });
|
|
|
- } else {
|
|
|
- let callbackUrl = `${window.location.origin}${window.location.pathname}?m=${browser.getURLParam("m")}&${getApp().Camera.getPoseUrlParams()}`;
|
|
|
-
|
|
|
- if (!browser.hasURLParam("tagid")) {
|
|
|
- callbackUrl += `&tagid=${tagclick.value.data.sid}`;
|
|
|
- } else {
|
|
|
- callbackUrl = browser.replaceQueryString(callbackUrl, "tagid", tagclick.value.data.sid);
|
|
|
- }
|
|
|
- console.log(callbackUrl);
|
|
|
- // Dialog.toast({ content: `登錄狀態失效,請重新登錄`, type: 'error' })
|
|
|
- browser.openLink(
|
|
|
- `/pages/login/login?callbackHttpUrl=${encodeURIComponent(callbackUrl)}`,
|
|
|
- `https://m.cdfmembers.com/shop/600667208/h5login?redirectUrl=${encodeURIComponent(callbackUrl)}`,
|
|
|
- `/pages/login/login?callbackHttpUrl=${encodeURIComponent(callbackUrl)}`
|
|
|
- );
|
|
|
- }
|
|
|
-};
|
|
|
|
|
|
const close = () => {
|
|
|
emit("close");
|
|
|
};
|
|
|
|
|
|
-const updateProductsById = async (idx) => {
|
|
|
- if (!tagclick.value.data.products[idx]) {
|
|
|
- Dialog.toast({ content: t('common.viewDetailFail'), type: "error" });
|
|
|
- close();
|
|
|
- return;
|
|
|
- }
|
|
|
- Loading.show();
|
|
|
- try {
|
|
|
- let res = await apis.get_product_info({
|
|
|
- // productId: 'p15677829'
|
|
|
- productId: tagclick.value.data.products[idx].id,
|
|
|
- });
|
|
|
-
|
|
|
- let tempData = toRaw(tagclick.value.data);
|
|
|
-
|
|
|
- tempData.products[idx] = {
|
|
|
- ...tempData.products[idx],
|
|
|
- ...res.data,
|
|
|
- currentSku: res.data.skus[0] || {
|
|
|
- price: "",
|
|
|
- id: "",
|
|
|
- },
|
|
|
- cartnum: 1,
|
|
|
- };
|
|
|
-
|
|
|
- store.commit("tag/setTagClickType", {
|
|
|
- type: tagclick.value.type,
|
|
|
- data: tempData,
|
|
|
- });
|
|
|
- Loading.hide();
|
|
|
- } catch (error) {
|
|
|
- Loading.hide();
|
|
|
- }
|
|
|
-};
|
|
|
-
|
|
|
-watch(
|
|
|
- () => tagclick.value.type,
|
|
|
- (val, old) => {
|
|
|
- if (mysw.value) {
|
|
|
- if (val === "goodlist") {
|
|
|
- current.value = 0;
|
|
|
- updateProductsById(current.value);
|
|
|
- }
|
|
|
- if (!val) {
|
|
|
- mysw.value.slideTo(0);
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
-);
|
|
|
-
|
|
|
const brandScroll = () => {
|
|
|
nextTick(() => {
|
|
|
let t = setTimeout(() => {
|
|
|
@@ -232,13 +91,7 @@ const brandScroll = () => {
|
|
|
touchMove(swiper, e) {
|
|
|
e.stopPropagation();
|
|
|
e.preventDefault();
|
|
|
- },
|
|
|
- slideChange() {
|
|
|
- if (tagclick.value.type) {
|
|
|
- current.value = this.activeIndex;
|
|
|
- updateProductsById(current.value);
|
|
|
- }
|
|
|
- },
|
|
|
+ }
|
|
|
},
|
|
|
});
|
|
|
}, 100);
|
|
|
@@ -267,84 +120,104 @@ onMounted(() => {
|
|
|
align-items: center;
|
|
|
flex-direction: column;
|
|
|
justify-content: center;
|
|
|
+
|
|
|
.head-pages {
|
|
|
display: flex;
|
|
|
justify-content: space-between;
|
|
|
align-items: center;
|
|
|
margin-bottom: 10px;
|
|
|
width: 76%;
|
|
|
- > div {
|
|
|
+
|
|
|
+ >div {
|
|
|
span {
|
|
|
font-size: 14px;
|
|
|
+
|
|
|
&:last-of-type {
|
|
|
color: rgba(255, 255, 255, 0.5);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- > i {
|
|
|
+
|
|
|
+ >i {
|
|
|
color: rgba(0, 0, 0, 1);
|
|
|
font-size: 20px;
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
#goodlist {
|
|
|
width: 100%;
|
|
|
overflow: hidden;
|
|
|
padding-right: 2px;
|
|
|
position: relative;
|
|
|
- > ul {
|
|
|
- > li {
|
|
|
+
|
|
|
+ >ul {
|
|
|
+ >li {
|
|
|
width: 76%;
|
|
|
border-radius: 2px;
|
|
|
position: relative;
|
|
|
font-size: 0;
|
|
|
overflow: hidden;
|
|
|
|
|
|
- > div {
|
|
|
- background: #fff;
|
|
|
- padding-bottom: 14px;
|
|
|
+ >div {
|
|
|
+ background: #fff;
|
|
|
+ padding-bottom: 14px;
|
|
|
+
|
|
|
+ >img{
|
|
|
+ width: 100%;
|
|
|
+ }
|
|
|
|
|
|
.info {
|
|
|
font-size: 14px;
|
|
|
color: #131d34;
|
|
|
padding: 16px 20px;
|
|
|
- > p {
|
|
|
+
|
|
|
+ >p {
|
|
|
font-size: 16px;
|
|
|
width: 100%;
|
|
|
line-height: 1.5;
|
|
|
word-break: break-all;
|
|
|
}
|
|
|
- > div {
|
|
|
+
|
|
|
+ >div {
|
|
|
color: var(--editor-main-color);
|
|
|
padding: 8px 0px 10px;
|
|
|
border-bottom: 1px solid #ebebeb;
|
|
|
- > span {
|
|
|
+
|
|
|
+ >span {
|
|
|
font-size: 16px;
|
|
|
+
|
|
|
&:first-of-type {
|
|
|
font-size: 12px;
|
|
|
margin-right: 4px;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- > ul {
|
|
|
+
|
|
|
+ >ul {
|
|
|
padding: 12px 0;
|
|
|
border-bottom: 1px solid #ebebeb;
|
|
|
|
|
|
- > li {
|
|
|
+ >li {
|
|
|
margin: 10px 0;
|
|
|
color: #909090;
|
|
|
+
|
|
|
&:last-of-type {
|
|
|
display: flex;
|
|
|
justify-content: space-between;
|
|
|
align-items: center;
|
|
|
}
|
|
|
- > span {
|
|
|
+
|
|
|
+ >span {
|
|
|
font-size: 12px;
|
|
|
}
|
|
|
- > ul {
|
|
|
+
|
|
|
+ >ul {
|
|
|
display: block;
|
|
|
- > li {
|
|
|
+
|
|
|
+ >li {
|
|
|
display: inline-block;
|
|
|
- > span {
|
|
|
+
|
|
|
+ >span {
|
|
|
display: inline-block;
|
|
|
border: 1px solid #ebebeb;
|
|
|
padding: 2px 4px;
|
|
|
@@ -356,22 +229,26 @@ onMounted(() => {
|
|
|
border-radius: 4px;
|
|
|
font-size: 12px;
|
|
|
}
|
|
|
+
|
|
|
&.active {
|
|
|
- > span {
|
|
|
+ >span {
|
|
|
border: solid 1px var(--editor-main-color);
|
|
|
color: var(--editor-main-color);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
.number {
|
|
|
display: flex;
|
|
|
+
|
|
|
i {
|
|
|
font-size: 12px;
|
|
|
border: 1px solid #ebebeb;
|
|
|
padding: 2px 8px;
|
|
|
border-radius: 15px;
|
|
|
}
|
|
|
+
|
|
|
input {
|
|
|
max-width: 40px;
|
|
|
text-align: center;
|
|
|
@@ -381,23 +258,26 @@ onMounted(() => {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
.goods-button {
|
|
|
display: flex;
|
|
|
justify-content: space-between;
|
|
|
font-size: 16px;
|
|
|
padding: 0 20px;
|
|
|
|
|
|
- > div {
|
|
|
+ >div {
|
|
|
height: 42px;
|
|
|
background: #ff8e24;
|
|
|
border-radius: 4px;
|
|
|
- width: 48%;
|
|
|
+ width: 100%;
|
|
|
text-align: center;
|
|
|
line-height: 42px;
|
|
|
+
|
|
|
&:last-of-type {
|
|
|
background: var(--editor-main-color);
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
.tipss {
|
|
|
color: #909090;
|
|
|
display: inline-block;
|