|
@@ -11,8 +11,8 @@
|
|
|
<div class="swiper-container" id="goodlist">
|
|
|
<ul class="swiper-wrapper">
|
|
|
<li class="swiper-slide" v-for="(i, index) in tagclick.data.products" :key="index">
|
|
|
- <viewimg :list="i.pics" :keyid="`viewimg_${index+1}`"/>
|
|
|
-
|
|
|
+ <viewimg :list="i.pics" :keyid="`viewimg_${index + 1}`" />
|
|
|
+
|
|
|
<div class="info">
|
|
|
<p>{{ i.name }}</p>
|
|
|
<div v-if="i.skus">
|
|
@@ -72,11 +72,10 @@ import { onMounted, watch, toRaw, computed, defineEmits, ref, defineProps, nextT
|
|
|
import { useApp, getApp } from "@/app";
|
|
|
import { useStore } from "vuex";
|
|
|
import * as apis from "@/apis/index.js";
|
|
|
-import { Loading,Dialog } from "@/global_components/";
|
|
|
+import { Loading, Dialog } from "@/global_components/";
|
|
|
import browser from "@/utils/browser";
|
|
|
import viewimg from "@/views/viewimg";
|
|
|
|
|
|
-
|
|
|
// get_product_info
|
|
|
const store = useStore();
|
|
|
|
|
@@ -86,11 +85,9 @@ const emit = defineEmits(["close"]);
|
|
|
|
|
|
const current = ref(0);
|
|
|
|
|
|
-
|
|
|
-
|
|
|
const viewDetail = (item) => {
|
|
|
- apis.burying_point({type:3});
|
|
|
- browser.openLink(`/pages/item/item?productId=${item.id}`,`https://m.cdfmembers.com/shop/600667208/item?productId=${item.id}`)
|
|
|
+ apis.burying_point({ type: 3 });
|
|
|
+ browser.openLink(`/pages/item/item?productId=${item.id}`, `https://m.cdfmembers.com/shop/600667208/item?productId=${item.id}`);
|
|
|
};
|
|
|
|
|
|
const onClickSku = (item) => {
|
|
@@ -116,27 +113,43 @@ const addCart = async (item) => {
|
|
|
num: item.cartnum,
|
|
|
});
|
|
|
|
|
|
-
|
|
|
Loading.hide();
|
|
|
- if (result.data.status==200) {
|
|
|
- return Dialog.toast({ content: `添加成功`, type: 'success' })
|
|
|
- } else{
|
|
|
- // Dialog.toast({ content: `登录状态失效,请重新登录`, type: 'error' })
|
|
|
- browser.openLink(`/pages/login/login`,`https://m.cdfmembers.com/shop/600667208/h5login?redirectUrl=${encodeURIComponent(window.location.href)}`)
|
|
|
- return
|
|
|
+ if (result.data.status == 200) {
|
|
|
+ return Dialog.toast({ content: `添加成功`, type: "success" });
|
|
|
+ } else {
|
|
|
+ let callbackUrl = "";
|
|
|
+ if (!browser.hasURLParam("pose")) {
|
|
|
+ callbackUrl = window.location.href + `&${getApp().Camera.getPoseUrlParams()}`;
|
|
|
+ } else {
|
|
|
+ callbackUrl = browser.replaceQueryString(window.location.href, "pose", getApp().Camera.getPoseUrlParams().replace("pose=", ""));
|
|
|
+ }
|
|
|
+
|
|
|
+ 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)}`
|
|
|
+ );
|
|
|
+ return;
|
|
|
}
|
|
|
-
|
|
|
};
|
|
|
|
|
|
-const close = ()=>{
|
|
|
- emit('close')
|
|
|
-}
|
|
|
+const close = () => {
|
|
|
+ emit("close");
|
|
|
+};
|
|
|
|
|
|
const updateProductsById = async (idx) => {
|
|
|
- if(!tagclick.value.data.products[idx]){
|
|
|
- Dialog.toast({ content: `获取商品详情失败,请稍后再试`, type: 'error' })
|
|
|
- close()
|
|
|
- return
|
|
|
+ if (!tagclick.value.data.products[idx]) {
|
|
|
+ Dialog.toast({ content: `获取商品详情失败,请稍后再试`, type: "error" });
|
|
|
+ close();
|
|
|
+ return;
|
|
|
}
|
|
|
Loading.show();
|
|
|
let res = await apis.get_product_info({
|
|
@@ -258,8 +271,7 @@ onMounted(() => {
|
|
|
overflow: hidden;
|
|
|
background: #fff;
|
|
|
padding-bottom: 14px;
|
|
|
-
|
|
|
-
|
|
|
+
|
|
|
.info {
|
|
|
font-size: 14px;
|
|
|
color: #131d34;
|