|
|
@@ -1,407 +1,372 @@
|
|
|
-<script>
|
|
|
-import { mapState } from 'vuex'
|
|
|
-import api from '@/api'
|
|
|
-import AddOrder from '@/pagesGoods/goodsDetail/components/addOrder.vue'
|
|
|
-
|
|
|
-export default {
|
|
|
- components: { AddOrder },
|
|
|
- onPageScroll({ scrollTop }) {
|
|
|
- if (scrollTop < 20) {
|
|
|
- this.opacity = 0
|
|
|
- } else if (scrollTop > 20 && scrollTop <= 100) {
|
|
|
- this.opacity = scrollTop / 100
|
|
|
- } else if (scrollTop > 100) {
|
|
|
- this.opacity = 1
|
|
|
- }
|
|
|
- },
|
|
|
- data() {
|
|
|
- return {
|
|
|
- type: '', // goods | sweepstakes
|
|
|
- banner: [],
|
|
|
- current: 0, // swiper cur
|
|
|
- opacity: 0, // 用于标题栏透明
|
|
|
-
|
|
|
- detail: {}, //商品详情
|
|
|
- specIndex: 0, // 规格的下标
|
|
|
-
|
|
|
- isSc: false, // 是否收藏
|
|
|
-
|
|
|
- imgLoading: true // 图片加载时动画
|
|
|
- }
|
|
|
- },
|
|
|
- computed: {
|
|
|
- ...mapState({
|
|
|
- token: 'token'
|
|
|
- })
|
|
|
- },
|
|
|
- watch: {
|
|
|
- token() {
|
|
|
- this.getIsSc()
|
|
|
- }
|
|
|
- },
|
|
|
-
|
|
|
- methods: {
|
|
|
- async getDetail(sn) {
|
|
|
- try {
|
|
|
- this.detail = await api.goodsDetail(sn)
|
|
|
- this.banner = this.detail.goods_img_banner
|
|
|
- // 获取是否收藏
|
|
|
- await this.getIsSc()
|
|
|
- // setTimeout(() => {
|
|
|
- // this.imgLoading = false
|
|
|
- // }, 300)
|
|
|
- } catch (e) {}
|
|
|
- },
|
|
|
-
|
|
|
- async sc() {
|
|
|
- if (!this.token) {
|
|
|
- this.$jump({ url: '/pages/login/login' })
|
|
|
- return
|
|
|
- }
|
|
|
-
|
|
|
- if (this.isSc) {
|
|
|
- this.isSc = false
|
|
|
- await api.cancelAtt(this.detail.goods_id)
|
|
|
- } else {
|
|
|
- await api.goodsAtt(this.detail.goods_id)
|
|
|
- this.isSc = true
|
|
|
- this.$common.toast('收藏成功', 'success')
|
|
|
- }
|
|
|
- },
|
|
|
- async getIsSc() {
|
|
|
- if (!this.token) return
|
|
|
-
|
|
|
- let res = await api.isAtt(this.detail.goods_id)
|
|
|
- this.isSc = res.attension === 1
|
|
|
- },
|
|
|
- preview(i) {
|
|
|
- uni.previewImage({ urls: this.banner, current: i })
|
|
|
- }
|
|
|
- },
|
|
|
- onLoad() {
|
|
|
- let { sn, type = '' } = this.$store.state.params
|
|
|
- this.getDetail(sn)
|
|
|
- this.type = type
|
|
|
- }
|
|
|
-}
|
|
|
-</script>
|
|
|
-
|
|
|
-<template>
|
|
|
- <view>
|
|
|
- <view class="nav">
|
|
|
- <view :style="{ opacity: opacity }">
|
|
|
- <u-navbar title="商品详情" :fixed="false">
|
|
|
- <template slot="left">
|
|
|
- <text></text>
|
|
|
- </template>
|
|
|
- </u-navbar>
|
|
|
- </view>
|
|
|
- <view
|
|
|
- class="back flex flex-center"
|
|
|
- :style="{ borderColor: `rgba(233,233,233,${1 - opacity})` }"
|
|
|
- @click="$common.back()"
|
|
|
- >
|
|
|
- <u-icon name="arrow-left" color="#303133" size="40rpx"></u-icon>
|
|
|
- </view>
|
|
|
- </view>
|
|
|
-
|
|
|
- <u-swiper
|
|
|
- :loading="!Object.keys(detail).length"
|
|
|
- height="750rpx"
|
|
|
- circular
|
|
|
- :list="banner"
|
|
|
- :current="current"
|
|
|
- :autoplay="false"
|
|
|
- @change="e => (current = e.current)"
|
|
|
- @click="preview"
|
|
|
- >
|
|
|
- <view slot="indicator" class="indicator-num">
|
|
|
- <view class="cur">{{ current + 1 }}</view>
|
|
|
- <view class="total">{{ banner.length }}</view>
|
|
|
- </view>
|
|
|
- </u-swiper>
|
|
|
-
|
|
|
- <view class="main">
|
|
|
- <view class="info bg-white">
|
|
|
- <u-skeleton
|
|
|
- v-if="!Object.keys(detail).length"
|
|
|
- :loading="!Object.keys(detail).length"
|
|
|
- rows="3"
|
|
|
- :rowsWidth="['400rpx', '650rpx', '650rpx']"
|
|
|
- :rowsHeight="['42rpx', '42rpx', '80rpx']"
|
|
|
- :title="false"
|
|
|
- ></u-skeleton>
|
|
|
-
|
|
|
- <template v-else>
|
|
|
- <view class="flex flex-between align-center">
|
|
|
- <u-text mode="price" :text="detail.price" bold size="42rpx"></u-text>
|
|
|
- <view class="rebate_score text-right" v-if="type !== 'sweepstakes'">
|
|
|
- {{ `赠送${Number(detail.rebate_score)}积分` }}
|
|
|
- </view>
|
|
|
- </view>
|
|
|
-
|
|
|
- <u-text :text="detail.goods_name" size="32rpx" bold margin="32rpx 0 0"></u-text>
|
|
|
-
|
|
|
- <view class="inventory flex flex-between" v-if="type !== 'sweepstakes'">
|
|
|
- <view>销量:{{ detail.sales_volume }}</view>
|
|
|
- <view>库存:{{ detail.inventory }}</view>
|
|
|
- </view>
|
|
|
-
|
|
|
- <view class="limit" v-if="detail.restrictions_num > 0 && type !== 'sweepstakes'"
|
|
|
- >每人限购{{ detail.restrictions_num }}个</view
|
|
|
- >
|
|
|
- </template>
|
|
|
- </view>
|
|
|
-
|
|
|
- <view
|
|
|
- class="spec_toMore bg-white flex align-center"
|
|
|
- @click="
|
|
|
- () => {
|
|
|
- if (Object.keys(detail).length) $refs.addOrder.show = true
|
|
|
- }
|
|
|
- "
|
|
|
- >
|
|
|
- <u-skeleton
|
|
|
- v-if="!Object.keys(detail).length"
|
|
|
- :loading="!Object.keys(detail).length"
|
|
|
- rows="1"
|
|
|
- :rowsWidth="['650rpx']"
|
|
|
- :rowsHeight="['42rpx']"
|
|
|
- :title="false"
|
|
|
- ></u-skeleton>
|
|
|
-
|
|
|
- <template v-else>
|
|
|
- <text class="spec_text">规格</text>
|
|
|
- <u-text
|
|
|
- :text="detail.goods_spec && detail.goods_spec[specIndex].spec_text"
|
|
|
- size="28rpx"
|
|
|
- ></u-text>
|
|
|
- <u-icon name="arrow-right"></u-icon>
|
|
|
- </template>
|
|
|
- </view>
|
|
|
-
|
|
|
- <view class="notice bg-white">
|
|
|
- <u-skeleton
|
|
|
- :loading="!Object.keys(detail).length"
|
|
|
- titleWidth="150"
|
|
|
- titleHeight="42"
|
|
|
- rows="1"
|
|
|
- :rowsWidth="['650rpx']"
|
|
|
- :rowsHeight="['42rpx']"
|
|
|
- >
|
|
|
- <u-text text="购物须知" size="28rpx" bold margin="0 0 20rpx"></u-text>
|
|
|
- <rich-text class="notice_content" :nodes="detail.buyNote"></rich-text>
|
|
|
- </u-skeleton>
|
|
|
- </view>
|
|
|
-
|
|
|
- <view class="mt-10 goods_detail bg-white overflow-hidden">
|
|
|
- <u-skeleton
|
|
|
- v-if="!Object.keys(detail).length"
|
|
|
- :loading="!Object.keys(detail).length"
|
|
|
- titleWidth="150"
|
|
|
- titleHeight="42"
|
|
|
- rows="1"
|
|
|
- :rowsWidth="['650rpx']"
|
|
|
- :rowsHeight="['500rpx']"
|
|
|
- ></u-skeleton>
|
|
|
-
|
|
|
- <template v-else>
|
|
|
- <view class="goods_detail_title">
|
|
|
- <text>商品详情</text>
|
|
|
- </view>
|
|
|
- <u-parse
|
|
|
- :content="detail.goods_remark"
|
|
|
- :tagStyle="{
|
|
|
- p: 'text-align:center;display:flex;flex-flow: column nowrap;'
|
|
|
- }"
|
|
|
- ></u-parse>
|
|
|
- </template>
|
|
|
- </view>
|
|
|
- </view>
|
|
|
-
|
|
|
- <!-- 底部 -->
|
|
|
- <view class="bottom flex flex-between flex-center" v-show="Object.keys(detail).length">
|
|
|
- <view class="sc" @click="sc()">
|
|
|
- <image
|
|
|
- :src="`/static/images/goods/${isSc ? 'sc-fill' : 'sc'}.png`"
|
|
|
- mode="widthFix"
|
|
|
- class="sc_icon"
|
|
|
- ></image>
|
|
|
- <view class="sc_text">收藏</view>
|
|
|
- </view>
|
|
|
-
|
|
|
- <u-button
|
|
|
- :text="type === 'sweepstakes' ? '福袋商品暂不支持直售' : '立即购买'"
|
|
|
- color="#E82C45"
|
|
|
- :disabled="type === 'sweepstakes'"
|
|
|
- @click="$refs.addOrder.show = true"
|
|
|
- custom-style="marginRight:50rpx"
|
|
|
- ></u-button>
|
|
|
- </view>
|
|
|
-
|
|
|
- <add-order ref="addOrder" :detail="detail" />
|
|
|
- </view>
|
|
|
-</template>
|
|
|
-
|
|
|
-<style lang="scss" scoped>
|
|
|
-.nav {
|
|
|
- position: fixed;
|
|
|
- top: 0;
|
|
|
- z-index: 1;
|
|
|
- width: 100%;
|
|
|
-
|
|
|
- .back {
|
|
|
- position: absolute;
|
|
|
- left: 9px;
|
|
|
- bottom: 9px;
|
|
|
- z-index: 2;
|
|
|
- width: 54rpx;
|
|
|
- height: 54rpx;
|
|
|
- border-radius: 50%;
|
|
|
- border: 1px solid #e9e9e9;
|
|
|
- background-color: #fff;
|
|
|
- }
|
|
|
-}
|
|
|
-
|
|
|
-/deep/ .u-swiper__indicator {
|
|
|
- bottom: 40rpx;
|
|
|
- right: 24rpx;
|
|
|
-}
|
|
|
-
|
|
|
-.indicator-num {
|
|
|
- width: 76rpx;
|
|
|
- height: 36rpx;
|
|
|
- line-height: 36rpx;
|
|
|
- color: #ffffff;
|
|
|
- text-align: center;
|
|
|
- // background-color: #b3b3b3;
|
|
|
- background-color: rgba(0, 0, 0, 0.3);
|
|
|
- border-radius: 36rpx;
|
|
|
- overflow: hidden;
|
|
|
- display: flex;
|
|
|
- justify-content: center;
|
|
|
- align-items: center;
|
|
|
-
|
|
|
- .cur {
|
|
|
- flex-basis: 55%;
|
|
|
- background-color: rgba(0, 0, 0, 0.1);
|
|
|
- border-radius: 36rpx 0 40rpx 36rpx;
|
|
|
- font-size: 22rpx;
|
|
|
- }
|
|
|
-
|
|
|
- .total {
|
|
|
- flex-basis: 45%;
|
|
|
- height: 30rpx;
|
|
|
- line-height: 30rpx;
|
|
|
- font-size: 18rpx;
|
|
|
-
|
|
|
- /* #ifdef H5 */
|
|
|
- transform: scale(0.8) translateY(2rpx);
|
|
|
- /* #endif */
|
|
|
- }
|
|
|
-}
|
|
|
-
|
|
|
-.main {
|
|
|
- padding: 20rpx 0 180rpx;
|
|
|
-
|
|
|
- .info {
|
|
|
- padding: 30rpx 50rpx;
|
|
|
-
|
|
|
- .rebate_score {
|
|
|
- color: #e82c45;
|
|
|
- font-size: 30rpx;
|
|
|
- }
|
|
|
-
|
|
|
- .inventory {
|
|
|
- margin: 26rpx 0 0;
|
|
|
- color: #666666;
|
|
|
- font-size: 24rpx;
|
|
|
- }
|
|
|
-
|
|
|
- .limit {
|
|
|
- margin-top: 20rpx;
|
|
|
- color: #e82c45;
|
|
|
- font-size: 24rpx;
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- .spec_toMore {
|
|
|
- margin-top: 20rpx;
|
|
|
- padding: 20rpx 50rpx;
|
|
|
-
|
|
|
- .spec_text {
|
|
|
- color: #5d6167;
|
|
|
- font-size: 26rpx;
|
|
|
- margin-right: 20rpx;
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- .notice {
|
|
|
- margin-top: 20rpx;
|
|
|
- padding: 20rpx 50rpx;
|
|
|
-
|
|
|
- &_content {
|
|
|
- font-size: 24rpx;
|
|
|
- line-height: 40rpx;
|
|
|
- }
|
|
|
- }
|
|
|
-}
|
|
|
-
|
|
|
-.goods_detail {
|
|
|
- padding: 20rpx 35rpx;
|
|
|
-
|
|
|
- &_title {
|
|
|
- margin-bottom: 26rpx;
|
|
|
- margin-left: 15rpx;
|
|
|
- position: relative;
|
|
|
- z-index: 1;
|
|
|
-
|
|
|
- font-size: 30rpx;
|
|
|
- font-weight: bold;
|
|
|
- color: #232323;
|
|
|
- }
|
|
|
-}
|
|
|
-
|
|
|
-.bottom {
|
|
|
- position: fixed;
|
|
|
- bottom: 0;
|
|
|
- width: 100%;
|
|
|
- height: 136rpx;
|
|
|
- background-color: #fff;
|
|
|
- padding-bottom: var(--window-bottom);
|
|
|
- z-index: 1;
|
|
|
-
|
|
|
- .sc {
|
|
|
- width: 70rpx;
|
|
|
- text-align: center;
|
|
|
- margin: 0 42rpx 0 50rpx;
|
|
|
-
|
|
|
- &_icon {
|
|
|
- width: 40rpx;
|
|
|
- }
|
|
|
-
|
|
|
- &_text {
|
|
|
- font-size: 24rpx;
|
|
|
- font-weight: 500;
|
|
|
- color: #b4b4b4;
|
|
|
- }
|
|
|
- }
|
|
|
-}
|
|
|
-
|
|
|
-/deep/ .u-number-box__minus,
|
|
|
-::v-deep .u-number-box__minus {
|
|
|
- border-radius: 29rpx 0 0 29rpx;
|
|
|
-}
|
|
|
-
|
|
|
-/deep/ .u-number-box__plus,
|
|
|
-::v-deep .u-number-box__plus {
|
|
|
- border-radius: 0 29rpx 29rpx 0;
|
|
|
-}
|
|
|
-
|
|
|
-/deep/ .u-number-box__input,
|
|
|
-::v-deep .u-number-box__input {
|
|
|
- width: 58rpx !important;
|
|
|
- height: 58rpx !important;
|
|
|
- font-size: 30rpx;
|
|
|
-}
|
|
|
+<script>
|
|
|
+ import {
|
|
|
+ mapState
|
|
|
+ } from 'vuex'
|
|
|
+ import api from '@/api'
|
|
|
+ import AddOrder from '@/pagesGoods/goodsDetail/components/addOrder.vue'
|
|
|
+
|
|
|
+ export default {
|
|
|
+ components: {
|
|
|
+ AddOrder
|
|
|
+ },
|
|
|
+ onPageScroll({
|
|
|
+ scrollTop
|
|
|
+ }) {
|
|
|
+ if (scrollTop < 20) {
|
|
|
+ this.opacity = 0
|
|
|
+ } else if (scrollTop > 20 && scrollTop <= 100) {
|
|
|
+ this.opacity = scrollTop / 100
|
|
|
+ } else if (scrollTop > 100) {
|
|
|
+ this.opacity = 1
|
|
|
+ }
|
|
|
+ },
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ type: '', // goods | sweepstakes
|
|
|
+ banner: [],
|
|
|
+ current: 0, // swiper cur
|
|
|
+ opacity: 0, // 用于标题栏透明
|
|
|
+
|
|
|
+ detail: {}, //商品详情
|
|
|
+ specIndex: 0, // 规格的下标
|
|
|
+
|
|
|
+ isSc: false, // 是否收藏
|
|
|
+
|
|
|
+ imgLoading: true // 图片加载时动画
|
|
|
+ }
|
|
|
+ },
|
|
|
+ computed: {
|
|
|
+ ...mapState({
|
|
|
+ token: 'token'
|
|
|
+ })
|
|
|
+ },
|
|
|
+ watch: {
|
|
|
+ token() {
|
|
|
+ this.getIsSc()
|
|
|
+ }
|
|
|
+ },
|
|
|
+
|
|
|
+ methods: {
|
|
|
+ async getDetail(sn) {
|
|
|
+ try {
|
|
|
+ this.detail = await api.goodsDetail(sn)
|
|
|
+ this.banner = this.detail.goods_img_banner
|
|
|
+ // 获取是否收藏
|
|
|
+ await this.getIsSc()
|
|
|
+ // setTimeout(() => {
|
|
|
+ // this.imgLoading = false
|
|
|
+ // }, 300)
|
|
|
+ } catch (e) {}
|
|
|
+ },
|
|
|
+
|
|
|
+ async sc() {
|
|
|
+ if (!this.token) {
|
|
|
+ this.$jump({
|
|
|
+ url: '/pages/login/login'
|
|
|
+ })
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ if (this.isSc) {
|
|
|
+ this.isSc = false
|
|
|
+ await api.cancelAtt(this.detail.goods_id)
|
|
|
+ } else {
|
|
|
+ await api.goodsAtt(this.detail.goods_id)
|
|
|
+ this.isSc = true
|
|
|
+ this.$common.toast('收藏成功', 'success')
|
|
|
+ }
|
|
|
+ },
|
|
|
+ async getIsSc() {
|
|
|
+ if (!this.token) return
|
|
|
+
|
|
|
+ let res = await api.isAtt(this.detail.goods_id)
|
|
|
+ this.isSc = res.attension === 1
|
|
|
+ },
|
|
|
+ preview(i) {
|
|
|
+ uni.previewImage({
|
|
|
+ urls: this.banner,
|
|
|
+ current: i
|
|
|
+ })
|
|
|
+ }
|
|
|
+ },
|
|
|
+ onLoad() {
|
|
|
+ console.log(this.$store.state.params)
|
|
|
+ // let sn = typeof(this.$route.query.sn) != 'undefined' ? this.$route.query.sn : '';
|
|
|
+ // let type = typeof(this.$store.state.params.type) != 'undefined' ? $store.state.params.type : '';
|
|
|
+ let {
|
|
|
+ sn,
|
|
|
+ type = ''
|
|
|
+ } = this.$store.state.params
|
|
|
+ this.getDetail(sn)
|
|
|
+ this.type = type
|
|
|
+ }
|
|
|
+ }
|
|
|
+</script>
|
|
|
+
|
|
|
+<template>
|
|
|
+ <view>
|
|
|
+ <view class="nav">
|
|
|
+ <view :style="{ opacity: opacity }">
|
|
|
+ <u-navbar title="商品详情" :fixed="false">
|
|
|
+ <template slot="left">
|
|
|
+ <text></text>
|
|
|
+ </template>
|
|
|
+ </u-navbar>
|
|
|
+ </view>
|
|
|
+ <view class="back flex flex-center" :style="{ borderColor: `rgba(233,233,233,${1 - opacity})` }"
|
|
|
+ @click="$common.back()">
|
|
|
+ <u-icon name="arrow-left" color="#303133" size="40rpx"></u-icon>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+
|
|
|
+ <u-swiper :loading="!Object.keys(detail).length" height="750rpx" circular :list="banner" :current="current"
|
|
|
+ :autoplay="false" @change="e => (current = e.current)" @click="preview">
|
|
|
+ <view slot="indicator" class="indicator-num">
|
|
|
+ <view class="cur">{{ current + 1 }}</view>
|
|
|
+ <view class="total">{{ banner.length }}</view>
|
|
|
+ </view>
|
|
|
+ </u-swiper>
|
|
|
+
|
|
|
+ <view class="main">
|
|
|
+ <view class="info bg-white">
|
|
|
+ <u-skeleton v-if="!Object.keys(detail).length" :loading="!Object.keys(detail).length" rows="3"
|
|
|
+ :rowsWidth="['400rpx', '650rpx', '650rpx']" :rowsHeight="['42rpx', '42rpx', '80rpx']"
|
|
|
+ :title="false"></u-skeleton>
|
|
|
+
|
|
|
+ <template v-else>
|
|
|
+ <view class="flex flex-between align-center">
|
|
|
+ <u-text mode="price" :text="detail.price" bold size="42rpx"></u-text>
|
|
|
+ <view class="rebate_score text-right" v-if="type !== 'sweepstakes'">
|
|
|
+ {{ `赠送${Number(detail.rebate_score)}积分` }}
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+
|
|
|
+ <u-text :text="detail.goods_name" size="32rpx" bold margin="32rpx 0 0"></u-text>
|
|
|
+
|
|
|
+ <view class="inventory flex flex-between" v-if="type !== 'sweepstakes'">
|
|
|
+ <view>销量:{{ detail.sales_volume }}</view>
|
|
|
+ <view>库存:{{ detail.inventory }}</view>
|
|
|
+ </view>
|
|
|
+
|
|
|
+ <view class="limit" v-if="detail.restrictions_num > 0 && type !== 'sweepstakes'">
|
|
|
+ 每人限购{{ detail.restrictions_num }}个</view>
|
|
|
+ </template>
|
|
|
+ </view>
|
|
|
+
|
|
|
+ <view class="spec_toMore bg-white flex align-center" @click="
|
|
|
+ () => {
|
|
|
+ if (Object.keys(detail).length) $refs.addOrder.show = true
|
|
|
+ }
|
|
|
+ ">
|
|
|
+ <u-skeleton v-if="!Object.keys(detail).length" :loading="!Object.keys(detail).length" rows="1"
|
|
|
+ :rowsWidth="['650rpx']" :rowsHeight="['42rpx']" :title="false"></u-skeleton>
|
|
|
+
|
|
|
+ <template v-else>
|
|
|
+ <text class="spec_text">规格</text>
|
|
|
+ <u-text :text="detail.goods_spec && detail.goods_spec[specIndex].spec_text" size="28rpx"></u-text>
|
|
|
+ <u-icon name="arrow-right"></u-icon>
|
|
|
+ </template>
|
|
|
+ </view>
|
|
|
+
|
|
|
+ <view class="notice bg-white">
|
|
|
+ <u-skeleton :loading="!Object.keys(detail).length" titleWidth="150" titleHeight="42" rows="1"
|
|
|
+ :rowsWidth="['650rpx']" :rowsHeight="['42rpx']">
|
|
|
+ <u-text text="购物须知" size="28rpx" bold margin="0 0 20rpx"></u-text>
|
|
|
+ <rich-text class="notice_content" :nodes="detail.buyNote"></rich-text>
|
|
|
+ </u-skeleton>
|
|
|
+ </view>
|
|
|
+
|
|
|
+ <view class="mt-10 goods_detail bg-white overflow-hidden">
|
|
|
+ <u-skeleton v-if="!Object.keys(detail).length" :loading="!Object.keys(detail).length" titleWidth="150"
|
|
|
+ titleHeight="42" rows="1" :rowsWidth="['650rpx']" :rowsHeight="['500rpx']"></u-skeleton>
|
|
|
+
|
|
|
+ <template v-else>
|
|
|
+ <view class="goods_detail_title">
|
|
|
+ <text>商品详情</text>
|
|
|
+ </view>
|
|
|
+ <u-parse :content="detail.goods_remark" :tagStyle="{
|
|
|
+ p: 'text-align:center;display:flex;flex-flow: column nowrap;'
|
|
|
+ }"></u-parse>
|
|
|
+ </template>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+
|
|
|
+ <!-- 底部 -->
|
|
|
+ <view class="bottom flex flex-between flex-center" v-show="Object.keys(detail).length">
|
|
|
+ <view class="sc" @click="sc()">
|
|
|
+ <image :src="`/static/images/goods/${isSc ? 'sc-fill' : 'sc'}.png`" mode="widthFix" class="sc_icon">
|
|
|
+ </image>
|
|
|
+ <view class="sc_text">收藏</view>
|
|
|
+ </view>
|
|
|
+
|
|
|
+ <u-button :text="type === 'sweepstakes' ? '福袋商品暂不支持直售' : '立即购买'" color="#E82C45"
|
|
|
+ :disabled="type === 'sweepstakes'" @click="$refs.addOrder.show = true" custom-style="marginRight:50rpx">
|
|
|
+ </u-button>
|
|
|
+ </view>
|
|
|
+
|
|
|
+ <add-order ref="addOrder" :detail="detail" />
|
|
|
+ </view>
|
|
|
+</template>
|
|
|
+
|
|
|
+<style lang="scss" scoped>
|
|
|
+ .nav {
|
|
|
+ position: fixed;
|
|
|
+ top: 0;
|
|
|
+ z-index: 1;
|
|
|
+ width: 100%;
|
|
|
+
|
|
|
+ .back {
|
|
|
+ position: absolute;
|
|
|
+ left: 9px;
|
|
|
+ bottom: 9px;
|
|
|
+ z-index: 2;
|
|
|
+ width: 54rpx;
|
|
|
+ height: 54rpx;
|
|
|
+ border-radius: 50%;
|
|
|
+ border: 1px solid #e9e9e9;
|
|
|
+ background-color: #fff;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ /deep/ .u-swiper__indicator {
|
|
|
+ bottom: 40rpx;
|
|
|
+ right: 24rpx;
|
|
|
+ }
|
|
|
+
|
|
|
+ .indicator-num {
|
|
|
+ width: 76rpx;
|
|
|
+ height: 36rpx;
|
|
|
+ line-height: 36rpx;
|
|
|
+ color: #ffffff;
|
|
|
+ text-align: center;
|
|
|
+ // background-color: #b3b3b3;
|
|
|
+ background-color: rgba(0, 0, 0, 0.3);
|
|
|
+ border-radius: 36rpx;
|
|
|
+ overflow: hidden;
|
|
|
+ display: flex;
|
|
|
+ justify-content: center;
|
|
|
+ align-items: center;
|
|
|
+
|
|
|
+ .cur {
|
|
|
+ flex-basis: 55%;
|
|
|
+ background-color: rgba(0, 0, 0, 0.1);
|
|
|
+ border-radius: 36rpx 0 40rpx 36rpx;
|
|
|
+ font-size: 22rpx;
|
|
|
+ }
|
|
|
+
|
|
|
+ .total {
|
|
|
+ flex-basis: 45%;
|
|
|
+ height: 30rpx;
|
|
|
+ line-height: 30rpx;
|
|
|
+ font-size: 18rpx;
|
|
|
+
|
|
|
+ /* #ifdef H5 */
|
|
|
+ transform: scale(0.8) translateY(2rpx);
|
|
|
+ /* #endif */
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ .main {
|
|
|
+ padding: 20rpx 0 180rpx;
|
|
|
+
|
|
|
+ .info {
|
|
|
+ padding: 30rpx 50rpx;
|
|
|
+
|
|
|
+ .rebate_score {
|
|
|
+ color: #e82c45;
|
|
|
+ font-size: 30rpx;
|
|
|
+ }
|
|
|
+
|
|
|
+ .inventory {
|
|
|
+ margin: 26rpx 0 0;
|
|
|
+ color: #666666;
|
|
|
+ font-size: 24rpx;
|
|
|
+ }
|
|
|
+
|
|
|
+ .limit {
|
|
|
+ margin-top: 20rpx;
|
|
|
+ color: #e82c45;
|
|
|
+ font-size: 24rpx;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ .spec_toMore {
|
|
|
+ margin-top: 20rpx;
|
|
|
+ padding: 20rpx 50rpx;
|
|
|
+
|
|
|
+ .spec_text {
|
|
|
+ color: #5d6167;
|
|
|
+ font-size: 26rpx;
|
|
|
+ margin-right: 20rpx;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ .notice {
|
|
|
+ margin-top: 20rpx;
|
|
|
+ padding: 20rpx 50rpx;
|
|
|
+
|
|
|
+ &_content {
|
|
|
+ font-size: 24rpx;
|
|
|
+ line-height: 40rpx;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ .goods_detail {
|
|
|
+ padding: 20rpx 35rpx;
|
|
|
+
|
|
|
+ &_title {
|
|
|
+ margin-bottom: 26rpx;
|
|
|
+ margin-left: 15rpx;
|
|
|
+ position: relative;
|
|
|
+ z-index: 1;
|
|
|
+
|
|
|
+ font-size: 30rpx;
|
|
|
+ font-weight: bold;
|
|
|
+ color: #232323;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ .bottom {
|
|
|
+ position: fixed;
|
|
|
+ bottom: 0;
|
|
|
+ width: 100%;
|
|
|
+ height: 136rpx;
|
|
|
+ background-color: #fff;
|
|
|
+ padding-bottom: var(--window-bottom);
|
|
|
+ z-index: 1;
|
|
|
+
|
|
|
+ .sc {
|
|
|
+ width: 70rpx;
|
|
|
+ text-align: center;
|
|
|
+ margin: 0 42rpx 0 50rpx;
|
|
|
+
|
|
|
+ &_icon {
|
|
|
+ width: 40rpx;
|
|
|
+ }
|
|
|
+
|
|
|
+ &_text {
|
|
|
+ font-size: 24rpx;
|
|
|
+ font-weight: 500;
|
|
|
+ color: #b4b4b4;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ /deep/ .u-number-box__minus,
|
|
|
+ ::v-deep .u-number-box__minus {
|
|
|
+ border-radius: 29rpx 0 0 29rpx;
|
|
|
+ }
|
|
|
+
|
|
|
+ /deep/ .u-number-box__plus,
|
|
|
+ ::v-deep .u-number-box__plus {
|
|
|
+ border-radius: 0 29rpx 29rpx 0;
|
|
|
+ }
|
|
|
+
|
|
|
+ /deep/ .u-number-box__input,
|
|
|
+ ::v-deep .u-number-box__input {
|
|
|
+ width: 58rpx !important;
|
|
|
+ height: 58rpx !important;
|
|
|
+ font-size: 30rpx;
|
|
|
+ }
|
|
|
</style>
|