|
@@ -13,10 +13,10 @@
|
|
|
duration="1500"
|
|
duration="1500"
|
|
|
circular="true"
|
|
circular="true"
|
|
|
>
|
|
>
|
|
|
- <swiper-item v-if="dataForm.video_url">
|
|
|
|
|
|
|
+ <swiper-item v-if="dataForm.videoUrl">
|
|
|
<j-video
|
|
<j-video
|
|
|
class="jvideo"
|
|
class="jvideo"
|
|
|
- :url="dataForm.video_url"
|
|
|
|
|
|
|
+ :url="dataForm.videoUrl"
|
|
|
width="750rpx"
|
|
width="750rpx"
|
|
|
height="620rpx"
|
|
height="620rpx"
|
|
|
></j-video>
|
|
></j-video>
|
|
@@ -30,11 +30,11 @@
|
|
|
<view class="pd24 u-flex-center" style="align-items: baseline">
|
|
<view class="pd24 u-flex-center" style="align-items: baseline">
|
|
|
<view class="u-FFF u-font36">
|
|
<view class="u-FFF u-font36">
|
|
|
<rich-text
|
|
<rich-text
|
|
|
- :nodes="$mUtil.priceBigSmallTwo(dataForm.min_price)"
|
|
|
|
|
|
|
+ :nodes="$mUtil.priceBigSmallTwo(dataForm.minPrice)"
|
|
|
></rich-text>
|
|
></rich-text>
|
|
|
</view>
|
|
</view>
|
|
|
<text class="discount u-font24 u-ml20 u-del"
|
|
<text class="discount u-font24 u-ml20 u-del"
|
|
|
- >¥{{ dataForm.max_sale_price }}</text
|
|
|
|
|
|
|
+ >¥{{ dataForm.maxSalePrice }}</text
|
|
|
>
|
|
>
|
|
|
</view>
|
|
</view>
|
|
|
<view class="p-ab u-flex-center">
|
|
<view class="p-ab u-flex-center">
|
|
@@ -42,29 +42,23 @@
|
|
|
<view class="seckill u-text-center u-font28">
|
|
<view class="seckill u-text-center u-font28">
|
|
|
<!-- active_state 0:未开始 * 1:进行中 * 2:已结束 -->
|
|
<!-- active_state 0:未开始 * 1:进行中 * 2:已结束 -->
|
|
|
|
|
|
|
|
- <view class="u-bold" v-if="dataForm.active_state == 1"
|
|
|
|
|
|
|
+ <view class="u-bold" v-if="dataForm.activeTimeState == 1"
|
|
|
>距结束</view
|
|
>距结束</view
|
|
|
>
|
|
>
|
|
|
|
|
|
|
|
<view
|
|
<view
|
|
|
class="u-bold"
|
|
class="u-bold"
|
|
|
v-if="
|
|
v-if="
|
|
|
- dataForm.active_state == 0 || dataForm.active_state == 2
|
|
|
|
|
|
|
+ dataForm.activeTimeState == 0 ||
|
|
|
|
|
+ dataForm.activeTimeState == 2
|
|
|
"
|
|
"
|
|
|
>已结束</view
|
|
>已结束</view
|
|
|
>
|
|
>
|
|
|
- <view v-if="dataForm.active_state != 2">
|
|
|
|
|
- <uni-countdown
|
|
|
|
|
- :backgroundColor="'none'"
|
|
|
|
|
- @timeup="overDown1"
|
|
|
|
|
- :color="'#3775F6'"
|
|
|
|
|
- :splitorColor="'#3775F6'"
|
|
|
|
|
- :show-day="time1[0] > 0"
|
|
|
|
|
- :day="time1[0]"
|
|
|
|
|
- :hour="time1[1]"
|
|
|
|
|
- :minute="time1[2]"
|
|
|
|
|
- :second="time1[3]"
|
|
|
|
|
- ></uni-countdown>
|
|
|
|
|
|
|
+ <view v-if="dataForm.activeTimeState != 2">
|
|
|
|
|
+ <uv-count-down
|
|
|
|
|
+ :time="remainingTime"
|
|
|
|
|
+ format="HH:mm:ss"
|
|
|
|
|
+ ></uv-count-down>
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
@@ -73,7 +67,7 @@
|
|
|
<view class="mt10 u-plr30">
|
|
<view class="mt10 u-plr30">
|
|
|
<view>
|
|
<view>
|
|
|
<view
|
|
<view
|
|
|
- v-if="shop.platform_shop"
|
|
|
|
|
|
|
+ v-if="shop.platformShop"
|
|
|
class="tipsStatus"
|
|
class="tipsStatus"
|
|
|
style="vertical-align: middle"
|
|
style="vertical-align: middle"
|
|
|
>自营</view
|
|
>自营</view
|
|
@@ -85,9 +79,9 @@
|
|
|
<view class="u-font24 u-mt15 u-999">
|
|
<view class="u-font24 u-mt15 u-999">
|
|
|
<text
|
|
<text
|
|
|
>已售
|
|
>已售
|
|
|
- <text class="u-FF0000">{{ dataForm.result_sale_num }}</text
|
|
|
|
|
|
|
+ <text class="u-FF0000">{{ dataForm.resultSaleNum }}</text
|
|
|
>件,仅剩<text class="u-FF0000">{{
|
|
>件,仅剩<text class="u-FF0000">{{
|
|
|
- dataForm.residue_stock_total
|
|
|
|
|
|
|
+ dataForm.residueStockTotal
|
|
|
}}</text
|
|
}}</text
|
|
|
>件</text
|
|
>件</text
|
|
|
>
|
|
>
|
|
@@ -101,20 +95,20 @@
|
|
|
<view class="u-plr30 u-flex-center-sb pt-pb35">
|
|
<view class="u-plr30 u-flex-center-sb pt-pb35">
|
|
|
<view class="u-flex-center" @click="goShop">
|
|
<view class="u-flex-center" @click="goShop">
|
|
|
<view>
|
|
<view>
|
|
|
- <image class="u-avatar104" :src="shop.logo"></image>
|
|
|
|
|
|
|
+ <image class="u-avatar104" :src="shop.image"></image>
|
|
|
</view>
|
|
</view>
|
|
|
<view class="u-ml25">
|
|
<view class="u-ml25">
|
|
|
<view class="u-font28 u-1A1A1A u-bold"
|
|
<view class="u-font28 u-1A1A1A u-bold"
|
|
|
- >{{ shop.shop_name }}
|
|
|
|
|
|
|
+ >{{ shop.businessName }}
|
|
|
</view>
|
|
</view>
|
|
|
<view class="u-999 u-font24 u-mt5 u-text2">
|
|
<view class="u-999 u-font24 u-mt5 u-text2">
|
|
|
<text
|
|
<text
|
|
|
class="iconfont"
|
|
class="iconfont"
|
|
|
style="color: #00bf5a"
|
|
style="color: #00bf5a"
|
|
|
@click.stop="goLocal"
|
|
@click.stop="goLocal"
|
|
|
- ></text
|
|
|
|
|
|
|
+ ></text
|
|
|
>
|
|
>
|
|
|
- {{ shop.province_name }}{{ shop.city_name }}{{ shop.area_name
|
|
|
|
|
|
|
+ {{ shop.provinceName }}{{ shop.cityName }}{{ shop.areaName
|
|
|
}}{{ shop.address }}
|
|
}}{{ shop.address }}
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
@@ -146,10 +140,10 @@
|
|
|
<!--商品详情-->
|
|
<!--商品详情-->
|
|
|
<view v-if="isChecked == 0">
|
|
<view v-if="isChecked == 0">
|
|
|
<view class="richText ql-editor-box">
|
|
<view class="richText ql-editor-box">
|
|
|
- <u-parse
|
|
|
|
|
|
|
+ <uv-parse
|
|
|
class="custom-parse"
|
|
class="custom-parse"
|
|
|
- :html="goodsInfo.mobile_detail"
|
|
|
|
|
- ></u-parse>
|
|
|
|
|
|
|
+ :content="productObj.content"
|
|
|
|
|
+ ></uv-parse>
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
|
|
|
|
|
@@ -173,12 +167,12 @@
|
|
|
</button>
|
|
</button>
|
|
|
|
|
|
|
|
<!--秒杀按钮-->
|
|
<!--秒杀按钮-->
|
|
|
- <view class="seckill-btn" v-if="dataForm.active_state == 0">
|
|
|
|
|
|
|
+ <view class="seckill-btn" v-if="dataForm.activeTimeState == 0">
|
|
|
<button v-if="ispay" class="u-btn-two u-DCCDA4" @click="notStarted()">
|
|
<button v-if="ispay" class="u-btn-two u-DCCDA4" @click="notStarted()">
|
|
|
立即购买
|
|
立即购买
|
|
|
</button>
|
|
</button>
|
|
|
</view>
|
|
</view>
|
|
|
- <view class="seckill-btn" v-if="dataForm.active_state == 1">
|
|
|
|
|
|
|
+ <view class="seckill-btn" v-if="dataForm.activeTimeState == 1">
|
|
|
<button
|
|
<button
|
|
|
v-if="ispay"
|
|
v-if="ispay"
|
|
|
class="u-btn-two u-DCCDA4"
|
|
class="u-btn-two u-DCCDA4"
|
|
@@ -187,7 +181,7 @@
|
|
|
立即购买
|
|
立即购买
|
|
|
</button>
|
|
</button>
|
|
|
</view>
|
|
</view>
|
|
|
- <view class="seckill-btn" v-if="dataForm.active_state == 2">
|
|
|
|
|
|
|
+ <view class="seckill-btn" v-if="dataForm.activeTimeState == 2">
|
|
|
<button
|
|
<button
|
|
|
v-if="ispay"
|
|
v-if="ispay"
|
|
|
class="u-btn-two u-DCCDA4"
|
|
class="u-btn-two u-DCCDA4"
|
|
@@ -200,56 +194,40 @@
|
|
|
</view>
|
|
</view>
|
|
|
|
|
|
|
|
<!--规格-->
|
|
<!--规格-->
|
|
|
- <uv-popup type="bottom" ref="specOpenRef">
|
|
|
|
|
|
|
+ <uv-popup mode="bottom" ref="specOpenRef" round="30rpx">
|
|
|
<view class="u-bg-fff spec">
|
|
<view class="u-bg-fff spec">
|
|
|
<view class="u-plr30 flex-sb u-border-one-one pb30">
|
|
<view class="u-plr30 flex-sb u-border-one-one pb30">
|
|
|
<view class="u-flex-center">
|
|
<view class="u-flex-center">
|
|
|
<image
|
|
<image
|
|
|
class="u-goods200"
|
|
class="u-goods200"
|
|
|
- :src="choseConfig.cover ? choseConfig.cover : cover"
|
|
|
|
|
|
|
+ :src="skuObj.cover ? skuObj.cover : cover"
|
|
|
></image>
|
|
></image>
|
|
|
<view class="u-ml20">
|
|
<view class="u-ml20">
|
|
|
<view class="u-999 u-font24 u-flex-center">
|
|
<view class="u-999 u-font24 u-flex-center">
|
|
|
<view class="u-00BF5A u-font36">
|
|
<view class="u-00BF5A u-font36">
|
|
|
<rich-text
|
|
<rich-text
|
|
|
- :nodes="
|
|
|
|
|
- $mUtil.priceBigSmall(
|
|
|
|
|
- choseConfig.activity_price
|
|
|
|
|
- ? choseConfig.activity_price
|
|
|
|
|
- : moPrice
|
|
|
|
|
- )
|
|
|
|
|
- "
|
|
|
|
|
|
|
+ :nodes="$mUtil.priceBigSmall(skuObj.marketPrice || 0)"
|
|
|
></rich-text>
|
|
></rich-text>
|
|
|
</view>
|
|
</view>
|
|
|
|
|
|
|
|
<text class="u-del u-ml15"
|
|
<text class="u-del u-ml15"
|
|
|
- >¥{{
|
|
|
|
|
- choseConfig.market_price
|
|
|
|
|
- ? choseConfig.market_price
|
|
|
|
|
- : moDelPrice
|
|
|
|
|
- }}
|
|
|
|
|
|
|
+ >¥{{ skuObj.originalSalePrice || 0 }}
|
|
|
</text>
|
|
</text>
|
|
|
</view>
|
|
</view>
|
|
|
<view class="u-font22 u-999 u-mt5"
|
|
<view class="u-font22 u-999 u-mt5"
|
|
|
- >活动库存 {{ stock }} 件
|
|
|
|
|
- <text
|
|
|
|
|
- >商品库存{{
|
|
|
|
|
- choseConfig.able_stock
|
|
|
|
|
- ? choseConfig.able_stock
|
|
|
|
|
- : goods_total_stock
|
|
|
|
|
- }}</text
|
|
|
|
|
- >
|
|
|
|
|
|
|
+ >活动库存 {{ skuObj.stock }} 件
|
|
|
</view>
|
|
</view>
|
|
|
<view class="u-1A1A1A u-mt25"
|
|
<view class="u-1A1A1A u-mt25"
|
|
|
- >{{
|
|
|
|
|
- choseConfig.sku_set_name ? choseConfig.sku_set_name : "请选择"
|
|
|
|
|
- }}
|
|
|
|
|
|
|
+ >{{ skuObj.skuSetName ? skuObj.skuSetName : "请选择" }}
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
|
- <view class="iconfont u-999 closeIcon" @click="specOpenRef.close()"
|
|
|
|
|
|
|
+ <!-- <view class="iconfont u-999 closeIcon" @click="specOpenRef.close()"
|
|
|
></view
|
|
></view
|
|
|
- >
|
|
|
|
|
|
|
+ > -->
|
|
|
|
|
+ <view class="closeIcon" @click.stop="specOpenRef.close()">
|
|
|
|
|
+ <uv-icon name="close-circle" color="#999999" size="36rpx"></uv-icon>
|
|
|
|
|
+ </view>
|
|
|
</view>
|
|
</view>
|
|
|
|
|
|
|
|
<view>
|
|
<view>
|
|
@@ -279,19 +257,12 @@
|
|
|
<view class="u-flex-center-sb">
|
|
<view class="u-flex-center-sb">
|
|
|
<view>购买数量</view>
|
|
<view>购买数量</view>
|
|
|
<view class="u-flex-center">
|
|
<view class="u-flex-center">
|
|
|
- <view class="iconfont minus" @click="resNum"></view>
|
|
|
|
|
- <view class="num">{{ add_num }}</view>
|
|
|
|
|
- <view class="iconfont plus-sign" @click="addNum"></view>
|
|
|
|
|
|
|
+ <uv-number-box v-model="addNumber" disabledInput></uv-number-box>
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
|
<view class="specOpen-btn">
|
|
<view class="specOpen-btn">
|
|
|
- <view v-if="btnType == 0">
|
|
|
|
|
- <button class="u-btn-two" @click="btnBuy(btnType)">
|
|
|
|
|
- {{ btnName }}
|
|
|
|
|
- </button>
|
|
|
|
|
- </view>
|
|
|
|
|
- <view v-else>
|
|
|
|
|
- <button class="u-btn-two" @click="btnBuy(btnType)">
|
|
|
|
|
|
|
+ <view>
|
|
|
|
|
+ <button class="u-btn-two" @click="btnBuy(1)">
|
|
|
{{ btnName }}
|
|
{{ btnName }}
|
|
|
</button>
|
|
</button>
|
|
|
</view>
|
|
</view>
|
|
@@ -308,10 +279,16 @@
|
|
|
<script setup>
|
|
<script setup>
|
|
|
import { ref } from "vue";
|
|
import { ref } from "vue";
|
|
|
import { onShareAppMessage, onShow, onLoad } from "@dcloudio/uni-app";
|
|
import { onShareAppMessage, onShow, onLoad } from "@dcloudio/uni-app";
|
|
|
|
|
+import { seckillActivityProductInfo_Api } from "@/api/seckill.js";
|
|
|
|
|
+import {
|
|
|
|
|
+ getBusinessInfoId_Api,
|
|
|
|
|
+ productInfo,
|
|
|
|
|
+ shopOrderCommentPage,
|
|
|
|
|
+} from "@/api/shop.js";
|
|
|
|
|
+
|
|
|
import comment from "@/components/ld-comment/ld-comment.vue";
|
|
import comment from "@/components/ld-comment/ld-comment.vue";
|
|
|
|
|
+import utils from "@/util/index.js";
|
|
|
|
|
|
|
|
-const $http = uni.$http;
|
|
|
|
|
-const $mUtil = uni.$mUtil;
|
|
|
|
|
const specOpenRef = ref(null);
|
|
const specOpenRef = ref(null);
|
|
|
// 手机状态栏高度
|
|
// 手机状态栏高度
|
|
|
const statusBarHeight = ref(uni.getSystemInfoSync().statusBarHeight);
|
|
const statusBarHeight = ref(uni.getSystemInfoSync().statusBarHeight);
|
|
@@ -319,31 +296,19 @@ const statusBarHeight = ref(uni.getSystemInfoSync().statusBarHeight);
|
|
|
const imglist = ref([]); // 详情图片数组
|
|
const imglist = ref([]); // 详情图片数组
|
|
|
const isChecked = ref(0);
|
|
const isChecked = ref(0);
|
|
|
const btnName = ref("");
|
|
const btnName = ref("");
|
|
|
-const btnType = ref(""); // 0 购物车,1 立即购买
|
|
|
|
|
const dataForm = ref({}); // 商品详情
|
|
const dataForm = ref({}); // 商品详情
|
|
|
const shop = ref({}); // 店铺信息
|
|
const shop = ref({}); // 店铺信息
|
|
|
-const shopDiscounts = ref({}); // 店铺首单优惠
|
|
|
|
|
-const stock = ref(0);
|
|
|
|
|
-const goods_total_stock = ref(0);
|
|
|
|
|
const cover = ref("");
|
|
const cover = ref("");
|
|
|
const loading = ref(true);
|
|
const loading = ref(true);
|
|
|
-const moDelPrice = ref("");
|
|
|
|
|
-const moPrice = ref("");
|
|
|
|
|
-const goodsSkuList = ref([]); // sku 组合值
|
|
|
|
|
const skuTab = ref([]); // sku 二位数组
|
|
const skuTab = ref([]); // sku 二位数组
|
|
|
-const goods_id = ref(null);
|
|
|
|
|
-const limit_buy_num = ref(0);
|
|
|
|
|
-const choseConfig = ref({});
|
|
|
|
|
|
|
+const skuObj = ref({}); // sku 对象
|
|
|
const hasId = ref("");
|
|
const hasId = ref("");
|
|
|
-const add_num = ref(1);
|
|
|
|
|
-const goStatus = ref(0); // 0: 购物车,1 下单
|
|
|
|
|
-const shop_id = ref(0);
|
|
|
|
|
|
|
+const addNumber = ref(1);
|
|
|
const commentList = ref([]);
|
|
const commentList = ref([]);
|
|
|
const commentListLength = ref(0);
|
|
const commentListLength = ref(0);
|
|
|
-const goodsInfo = ref({});
|
|
|
|
|
-const time1 = ref([0, 0, 0, 0]);
|
|
|
|
|
-const ispay = ref(getApp().globalData.openPay);
|
|
|
|
|
-const able_stock = ref(0);
|
|
|
|
|
|
|
+const productObj = ref({});
|
|
|
|
|
+const remainingTime = ref(0); // 剩余时间
|
|
|
|
|
+const ispay = ref(true);
|
|
|
|
|
|
|
|
// 生命周期
|
|
// 生命周期
|
|
|
onShow(() => {});
|
|
onShow(() => {});
|
|
@@ -387,8 +352,8 @@ const itSover = () => {
|
|
|
|
|
|
|
|
const goLocal = () => {
|
|
const goLocal = () => {
|
|
|
uni.openLocation({
|
|
uni.openLocation({
|
|
|
- latitude: Number(shop.value.tx_latitude),
|
|
|
|
|
- longitude: Number(shop.value.tx_longitude),
|
|
|
|
|
|
|
+ latitude: Number(shop.value.txLatitude),
|
|
|
|
|
+ longitude: Number(shop.value.txLongitude),
|
|
|
name: shop.value.name,
|
|
name: shop.value.name,
|
|
|
address: shop.value.address,
|
|
address: shop.value.address,
|
|
|
success: function () {
|
|
success: function () {
|
|
@@ -399,64 +364,63 @@ const goLocal = () => {
|
|
|
|
|
|
|
|
const goShop = () => {
|
|
const goShop = () => {
|
|
|
uni.navigateTo({
|
|
uni.navigateTo({
|
|
|
- url: "/pages/convenienceService/shopDetails?shopId=" + shop_id.value,
|
|
|
|
|
|
|
+ url:
|
|
|
|
|
+ "/pages/convenienceService/shopDetails?businessId=" +
|
|
|
|
|
+ dataForm.value.businessId,
|
|
|
});
|
|
});
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
-const recordSave = (share_user_id, goods_id) => {
|
|
|
|
|
|
|
+const recordSave = (shareUserId, productI) => {
|
|
|
|
|
+ return;
|
|
|
$http
|
|
$http
|
|
|
.post("/share/record/save", {
|
|
.post("/share/record/save", {
|
|
|
- share_user_id: share_user_id,
|
|
|
|
|
- goods_id: goods_id,
|
|
|
|
|
|
|
+ shareUserId: shareUserId,
|
|
|
|
|
+ productI: productI,
|
|
|
})
|
|
})
|
|
|
.then((res) => {});
|
|
.then((res) => {});
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
const getDetailInfo = (id) => {
|
|
const getDetailInfo = (id) => {
|
|
|
- $http.get("/marketing/seckillActivityGoods/info/" + id).then((res) => {
|
|
|
|
|
|
|
+ seckillActivityProductInfo_Api(id).then((res) => {
|
|
|
loading.value = false;
|
|
loading.value = false;
|
|
|
if (res && res.code == 200) {
|
|
if (res && res.code == 200) {
|
|
|
dataForm.value = res.data;
|
|
dataForm.value = res.data;
|
|
|
- shop_id.value = res.data.shop_id;
|
|
|
|
|
- $http
|
|
|
|
|
- .get("/marketing/firstOrder/getByShop/" + shop_id.value)
|
|
|
|
|
- .then((res) => {
|
|
|
|
|
- if (res && res.code == 200) {
|
|
|
|
|
- shopDiscounts.value = res.data;
|
|
|
|
|
- }
|
|
|
|
|
- });
|
|
|
|
|
- $http.get("/yxt/shop/info/" + shop_id.value).then((res) => {
|
|
|
|
|
- if (res.data && res.code == 200) {
|
|
|
|
|
- shop.value = res.data;
|
|
|
|
|
|
|
+ imglist.value = res.data.coverImage.split(",");
|
|
|
|
|
+
|
|
|
|
|
+ if (res.data.activeTimeState == 1) {
|
|
|
|
|
+ remainingTime.value = res.data.finishTime * 1000 - new Date().getTime();
|
|
|
|
|
+ // console.log("remainingTime.value", remainingTime.value);
|
|
|
|
|
+ }
|
|
|
|
|
+ productInfo(dataForm.value.productId).then((ret) => {
|
|
|
|
|
+ if (ret && ret.code == 200) {
|
|
|
|
|
+ productObj.value = ret.data;
|
|
|
|
|
+ skuTab.value = ret.data.skuTable.map((item) => {
|
|
|
|
|
+ if (item.values) {
|
|
|
|
|
+ item.values[0].flag = true;
|
|
|
|
|
+ }
|
|
|
|
|
+ return item;
|
|
|
|
|
+ });
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
- imglist.value = res.data.cover.split(",");
|
|
|
|
|
-
|
|
|
|
|
- if (res.data.active_state == 0 || res.data.active_state == 2) {
|
|
|
|
|
- time1.value = $mUtil
|
|
|
|
|
- .countDown(res.data.will_start_time)
|
|
|
|
|
- .split(":")
|
|
|
|
|
- .map((val) => Number(val));
|
|
|
|
|
- } else {
|
|
|
|
|
- time1.value = $mUtil
|
|
|
|
|
- .countDown(res.data.finish_time)
|
|
|
|
|
- .split(":")
|
|
|
|
|
- .map((val) => Number(val));
|
|
|
|
|
- }
|
|
|
|
|
- $http.get(`/goods/content/${dataForm.value.goods_id}`).then((res) => {
|
|
|
|
|
|
|
+
|
|
|
|
|
+ getBusinessInfoId_Api(dataForm.value.businessId).then((ret) => {
|
|
|
|
|
+ if (ret.data && ret.code == 200) {
|
|
|
|
|
+ shop.value = ret.data;
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
|
|
+ // return
|
|
|
|
|
+ shopOrderCommentPage({
|
|
|
|
|
+ productId: dataForm.value.productId,
|
|
|
|
|
+ page: 1,
|
|
|
|
|
+ pageSize: 10,
|
|
|
|
|
+ }).then((res) => {
|
|
|
if (res && res.code == 200) {
|
|
if (res && res.code == 200) {
|
|
|
- goodsInfo.value = res.data;
|
|
|
|
|
|
|
+ commentList.value = res.list;
|
|
|
|
|
+ commentListLength.value =
|
|
|
|
|
+ res.list && res.list.length ? res.list.length : 0;
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
- $http
|
|
|
|
|
- .get(`/comment/orderGoods/getgoodscomments/${dataForm.value.goods_id}`)
|
|
|
|
|
- .then((res) => {
|
|
|
|
|
- if (res && res.code == 200) {
|
|
|
|
|
- commentList.value = res.list;
|
|
|
|
|
- commentListLength.value =
|
|
|
|
|
- res.list && res.list.length ? res.list.length : 0;
|
|
|
|
|
- }
|
|
|
|
|
- });
|
|
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
};
|
|
};
|
|
@@ -466,32 +430,21 @@ const change = (i) => {
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
const buy = (i, id) => {
|
|
const buy = (i, id) => {
|
|
|
- btnType.value = i;
|
|
|
|
|
- checkSku(id);
|
|
|
|
|
- if (i == 0) {
|
|
|
|
|
- btnName.value = "加入购物车";
|
|
|
|
|
- } else {
|
|
|
|
|
- btnName.value = "立即购买";
|
|
|
|
|
- }
|
|
|
|
|
-};
|
|
|
|
|
-
|
|
|
|
|
-const resNum = () => {
|
|
|
|
|
- if (add_num.value > 1) {
|
|
|
|
|
- add_num.value--;
|
|
|
|
|
- }
|
|
|
|
|
-};
|
|
|
|
|
-
|
|
|
|
|
-const addNum = () => {
|
|
|
|
|
- add_num.value++;
|
|
|
|
|
|
|
+ chonseSku();
|
|
|
|
|
+ btnName.value = "立即购买";
|
|
|
|
|
+ specOpenRef.value.open();
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
|
|
+// 处理选中的
|
|
|
const chonseSku = (index, id) => {
|
|
const chonseSku = (index, id) => {
|
|
|
- skuTab.value[index].values.forEach((res) => {
|
|
|
|
|
- res.flag = false;
|
|
|
|
|
- if (res.id == id) {
|
|
|
|
|
- res.flag = true;
|
|
|
|
|
- }
|
|
|
|
|
- });
|
|
|
|
|
|
|
+ if (index != null) {
|
|
|
|
|
+ skuTab.value[index].values.forEach((res) => {
|
|
|
|
|
+ res.flag = false;
|
|
|
|
|
+ if (res.id == id) {
|
|
|
|
|
+ res.flag = true;
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
let choseId = [];
|
|
let choseId = [];
|
|
|
skuTab.value.forEach((res) => {
|
|
skuTab.value.forEach((res) => {
|
|
|
res.values.forEach((Key) => {
|
|
res.values.forEach((Key) => {
|
|
@@ -500,134 +453,66 @@ const chonseSku = (index, id) => {
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
});
|
|
});
|
|
|
- let totalId = choseId.sort((a, b) => a - b).join("|");
|
|
|
|
|
|
|
+ let totalId = choseId.sort((a, b) => a - b).join("_");
|
|
|
|
|
+ totalId = "_" + totalId + "_";
|
|
|
hasId.value = totalId;
|
|
hasId.value = totalId;
|
|
|
- goodsSkuList.value.forEach((res) => {
|
|
|
|
|
- let temp = res.sku_hash_code;
|
|
|
|
|
- let sku_hash_code_val = temp
|
|
|
|
|
- .split("|")
|
|
|
|
|
- .sort((a, b) => a - b)
|
|
|
|
|
- .join("|");
|
|
|
|
|
- if (sku_hash_code_val == totalId) {
|
|
|
|
|
- choseConfig.value = res;
|
|
|
|
|
- stock.value = dataForm.value.real_stock_total;
|
|
|
|
|
- able_stock.value = res.able_stock;
|
|
|
|
|
|
|
+ dataForm.value.productSkuSetList.forEach((res) => {
|
|
|
|
|
+ if (res.skuHashCode == totalId) {
|
|
|
|
|
+ skuObj.value = res;
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
-const checkSku = (id) => {
|
|
|
|
|
- $http
|
|
|
|
|
- .get(`/marketing/seckillActivityGoods/skus/${dataForm.value.id}`)
|
|
|
|
|
- .then((res) => {
|
|
|
|
|
- loading.value = false;
|
|
|
|
|
- goods_total_stock.value = res.data.goods_total_stock;
|
|
|
|
|
- if (res && res.code == 200) {
|
|
|
|
|
- choseConfig.value = {};
|
|
|
|
|
- hasId.value = "";
|
|
|
|
|
- res.data.goods.sku_table.forEach((keys) => {
|
|
|
|
|
- keys.values.forEach((val) => {
|
|
|
|
|
- val.flag = false;
|
|
|
|
|
- });
|
|
|
|
|
- });
|
|
|
|
|
- limit_buy_num.value = dataForm.value.limit_buy_num;
|
|
|
|
|
- goods_id.value = dataForm.value.goods_id;
|
|
|
|
|
- goodsSkuList.value = res.data.goods_sku_list;
|
|
|
|
|
- moPrice.value = dataForm.value.min_price;
|
|
|
|
|
- moDelPrice.value = dataForm.value.min_sale_price;
|
|
|
|
|
- cover.value = imglist.value[0];
|
|
|
|
|
- stock.value = dataForm.value.real_stock_total;
|
|
|
|
|
- if (res.data.goods_auth) {
|
|
|
|
|
- if (res.data.goods_auth.added) {
|
|
|
|
|
- specOpenRef.value.open();
|
|
|
|
|
- } else {
|
|
|
|
|
- uni.$uv.toast("该商品已经下架");
|
|
|
|
|
- }
|
|
|
|
|
- } else {
|
|
|
|
|
- uni.$uv.toast("没有经营权限");
|
|
|
|
|
- }
|
|
|
|
|
- if (skuTab.value.length == 0) {
|
|
|
|
|
- skuTab.value = res.data.goods.sku_table;
|
|
|
|
|
- for (let i in skuTab.value) {
|
|
|
|
|
- skuTab.value[i].values[0].flag = true;
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- chonseSku(0, skuTab.value[0].values[0].id);
|
|
|
|
|
- }
|
|
|
|
|
- });
|
|
|
|
|
-};
|
|
|
|
|
-
|
|
|
|
|
const btnBuys = () => {
|
|
const btnBuys = () => {
|
|
|
- if (skuTab.value.length > 0 && hasId.value == "") {
|
|
|
|
|
|
|
+ if (!skuObj.value.id && hasId.value == "") {
|
|
|
uni.$uv.toast("请选中 sku");
|
|
uni.$uv.toast("请选中 sku");
|
|
|
return false;
|
|
return false;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- if (add_num.value > limit_buy_num.value && limit_buy_num.value != 0) {
|
|
|
|
|
- uni.$uv.toast("商品限购" + limit_buy_num.value + "件");
|
|
|
|
|
|
|
+ if (
|
|
|
|
|
+ Number(addNumber.value) > dataForm.value.limitBuyNum &&
|
|
|
|
|
+ dataForm.value.limitBuyNum != 0
|
|
|
|
|
+ ) {
|
|
|
|
|
+ uni.$uv.toast("商品限购" + dataForm.value.limitBuyNum + "件");
|
|
|
return false;
|
|
return false;
|
|
|
}
|
|
}
|
|
|
- if (goodsSkuList.value.length > 0 && able_stock.value < add_num.value) {
|
|
|
|
|
- uni.$uv.toast("商品库存只有" + able_stock.value + "件");
|
|
|
|
|
- $http
|
|
|
|
|
- .post(`/singlegoods/understockrecord/save`, {
|
|
|
|
|
- shop_id: shop_id.value,
|
|
|
|
|
- goods_id: goods_id.value,
|
|
|
|
|
- single_goods_id: choseConfig.value.single_goods_id,
|
|
|
|
|
- sku_set_name: choseConfig.value.sku_set_name,
|
|
|
|
|
- buy_num: add_num.value,
|
|
|
|
|
- })
|
|
|
|
|
- .then((res) => {});
|
|
|
|
|
|
|
+ if (
|
|
|
|
|
+ dataForm.value.productSkuSetList.length > 0 &&
|
|
|
|
|
+ Number(skuObj.value.stock) < Number(addNumber.value)
|
|
|
|
|
+ ) {
|
|
|
|
|
+ uni.$uv.toast("商品库存只有" + skuObj.value.stock + "件");
|
|
|
return false;
|
|
return false;
|
|
|
}
|
|
}
|
|
|
- if (goStatus.value == 0) {
|
|
|
|
|
- let data = {
|
|
|
|
|
- goods_id: goods_id.value,
|
|
|
|
|
- sku_hash_code: hasId.value,
|
|
|
|
|
- add_num: add_num.value,
|
|
|
|
|
- source_shop_id: shop_id.value.toString(),
|
|
|
|
|
- };
|
|
|
|
|
- $http.post(`/cart/add`, data).then((res) => {
|
|
|
|
|
- if (res && res.code == 200) {
|
|
|
|
|
- uni.$uv.toast("添加成功");
|
|
|
|
|
- // specOpen.value.close();
|
|
|
|
|
- choseConfig.value = {};
|
|
|
|
|
- add_num.value = 1;
|
|
|
|
|
- cartList();
|
|
|
|
|
- }
|
|
|
|
|
- });
|
|
|
|
|
- } else {
|
|
|
|
|
- psotJson();
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ // psotJson();
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
const psotJson = () => {
|
|
const psotJson = () => {
|
|
|
let dataJson = {};
|
|
let dataJson = {};
|
|
|
let childArr = [];
|
|
let childArr = [];
|
|
|
let parendArr = [];
|
|
let parendArr = [];
|
|
|
- choseConfig.value;
|
|
|
|
|
|
|
+ skuObj.value;
|
|
|
|
|
|
|
|
childArr.push({
|
|
childArr.push({
|
|
|
- user_cart_id: 0,
|
|
|
|
|
- activity_goods_id: choseConfig.value.activity_goods_id,
|
|
|
|
|
- goods_id: goods_id.value,
|
|
|
|
|
- num: add_num.value,
|
|
|
|
|
- sku_hash_code: choseConfig.value.sku_hash_code,
|
|
|
|
|
|
|
+ userCartId: 0,
|
|
|
|
|
+ activityGoodsId: skuObj.value.activityGoodsId,
|
|
|
|
|
+ productI: dataForm.value.productI,
|
|
|
|
|
+ num: addNumber.value,
|
|
|
|
|
+ skuHashCode: skuObj.value.skuHashCode,
|
|
|
});
|
|
});
|
|
|
parendArr.push({
|
|
parendArr.push({
|
|
|
- shop_id: shop.value.id,
|
|
|
|
|
- source_shop_id: shop.value.id,
|
|
|
|
|
- activity_id: dataForm.value.seckill_id,
|
|
|
|
|
- sponsor_activity_id: 0,
|
|
|
|
|
- user_remark: "",
|
|
|
|
|
|
|
+ businessId: shop.value.id,
|
|
|
|
|
+ sourceBusinessId: shop.value.id,
|
|
|
|
|
+ activityId: dataForm.value.seckillId,
|
|
|
|
|
+ sponsorActivityId: 0,
|
|
|
|
|
+ userRemark: "",
|
|
|
items: childArr,
|
|
items: childArr,
|
|
|
});
|
|
});
|
|
|
dataJson = {
|
|
dataJson = {
|
|
|
- is_cart: false,
|
|
|
|
|
- receipt_id: null,
|
|
|
|
|
|
|
+ isCart: false,
|
|
|
|
|
+ receiptId: null,
|
|
|
shipment_mode: 0,
|
|
shipment_mode: 0,
|
|
|
- shop_orders: parendArr,
|
|
|
|
|
- marketing_type: 1,
|
|
|
|
|
|
|
+ shopOrders: parendArr,
|
|
|
|
|
+ marketingType: 1,
|
|
|
};
|
|
};
|
|
|
uni.setStorageSync("dataJson", dataJson);
|
|
uni.setStorageSync("dataJson", dataJson);
|
|
|
uni.navigateTo({
|
|
uni.navigateTo({
|
|
@@ -636,20 +521,10 @@ const psotJson = () => {
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
const btnBuy = (i) => {
|
|
const btnBuy = (i) => {
|
|
|
- goStatus.value = i;
|
|
|
|
|
- let token = uni.getStorageSync("apiToken");
|
|
|
|
|
- if (!token) {
|
|
|
|
|
- uni.navigateTo({
|
|
|
|
|
- url: "/pages/login/index",
|
|
|
|
|
- });
|
|
|
|
|
- } else {
|
|
|
|
|
|
|
+ if (!utils.isLoginTo(true)) {
|
|
|
btnBuys();
|
|
btnBuys();
|
|
|
}
|
|
}
|
|
|
};
|
|
};
|
|
|
-
|
|
|
|
|
-const cartList = () => {
|
|
|
|
|
- // 实现购物车逻辑
|
|
|
|
|
-};
|
|
|
|
|
</script>
|
|
</script>
|
|
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
<style lang="scss" scoped>
|
|
@@ -808,6 +683,10 @@ const cartList = () => {
|
|
|
border-radius: 5rpx 20rpx 0px 0px;
|
|
border-radius: 5rpx 20rpx 0px 0px;
|
|
|
text-align: center;
|
|
text-align: center;
|
|
|
// width: 150rpx;
|
|
// width: 150rpx;
|
|
|
|
|
+ &:deep(.uv-count-down__text) {
|
|
|
|
|
+ color: #3775f6;
|
|
|
|
|
+ font-size: 24rpx;
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
.seckill-btn {
|
|
.seckill-btn {
|