修复问题
parent
9cf068a1bb
commit
82674b1104
6
.env
6
.env
|
|
@ -2,10 +2,10 @@
|
||||||
SHOPRO_VERSION = v1.8.3
|
SHOPRO_VERSION = v1.8.3
|
||||||
|
|
||||||
# 后端接口 - 正式环境(通过 process.env.NODE_ENV 非 developmentSHOPRO_BASE_URL = http://api-dashboard.yudao.iocoder.cn
|
# 后端接口 - 正式环境(通过 process.env.NODE_ENV 非 developmentSHOPRO_BASE_URL = http://api-dashboard.yudao.iocoder.cn
|
||||||
SHOPRO_BASE_URL = http://100.80.97.101:48080
|
SHOPRO_BASE_URL = http://192.168.10.207:48080
|
||||||
|
|
||||||
# 后端接口 - 测试环境(通过 process.env.NODE_ENV = developmentSHOPRO_DEV_BASE_URL = http://saas.yibeidl.cn
|
# 后端接口 - 测试环境(通过 process.env.NODE_ENV = developmentSHOPRO_DEV_BASE_URL = http://saas.yibeidl.cn
|
||||||
SHOPRO_DEV_BASE_URL = http://100.80.97.101:48080
|
SHOPRO_DEV_BASE_URL = http://192.168.10.207:48080
|
||||||
### SHOPRO_DEV_BASE_URL = http://yunai.natapp1.cc
|
### SHOPRO_DEV_BASE_URL = http://yunai.natapp1.cc
|
||||||
|
|
||||||
# 后端接口前缀(一般不建议调整)
|
# 后端接口前缀(一般不建议调整)
|
||||||
|
|
@ -18,7 +18,7 @@ SHOPRO_WEBSOCKET_PATH = /infra/ws
|
||||||
SHOPRO_DEV_PORT = 48080
|
SHOPRO_DEV_PORT = 48080
|
||||||
|
|
||||||
# 客户端静态资源地址 空=默认使用服务端指定的CDN资源地址前缀 | local=本地 | http(s)://xxx.xxx=自定义静态资源地址前缀SHOPRO_STATIC_URL = https://file.sheepjs.com
|
# 客户端静态资源地址 空=默认使用服务端指定的CDN资源地址前缀 | local=本地 | http(s)://xxx.xxx=自定义静态资源地址前缀SHOPRO_STATIC_URL = https://file.sheepjs.com
|
||||||
SHOPRO_STATIC_URL = http://100.80.97.101
|
SHOPRO_STATIC_URL = http://192.168.10.207
|
||||||
|
|
||||||
# 是否开启直播 1 开启直播 | 0 关闭直播 (小程序官方后台未审核开通直播权限时请勿开启)
|
# 是否开启直播 1 开启直播 | 0 关闭直播 (小程序官方后台未审核开通直播权限时请勿开启)
|
||||||
SHOPRO_MPLIVE_ON = 0
|
SHOPRO_MPLIVE_ON = 0
|
||||||
|
|
|
||||||
|
|
@ -136,13 +136,13 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// 2.1 情况三一:未支付,且轮询次数小于三次,则继续轮询
|
// 2.1 情况三一:未支付,且轮询次数小于三次,则继续轮询
|
||||||
if (state.counter < 3 && state.result === 'unpaid') {
|
if (state.counter < 10 && state.result === 'unpaid') {
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
getOrderInfo(id);
|
getOrderInfo(id);
|
||||||
}, 1500);
|
}, 1500);
|
||||||
}
|
}
|
||||||
// 2.2 情况二:超过三次检测才判断为支付失败
|
// 2.2 情况二:超过三次检测才判断为支付失败
|
||||||
if (state.counter >= 3) {
|
if (state.counter >= 10) {
|
||||||
state.result = 'failed';
|
state.result = 'failed';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,7 @@
|
||||||
<su-popup :show="show" type="bottom" round="20" @close="emits('close')" showClose>
|
<su-popup :show="show" type="bottom" round="20" @close="emits('close')" showClose>
|
||||||
<view class="model-box">
|
<view class="model-box">
|
||||||
<view class="title ss-m-t-16 ss-m-l-20 ss-flex">优惠</view>
|
<view class="title ss-m-t-16 ss-m-l-20 ss-flex">优惠</view>
|
||||||
|
<view v-if="state.activityMap.length">
|
||||||
<view class="titleLi">促销</view>
|
<view class="titleLi">促销</view>
|
||||||
<scroll-view class="model-content" scroll-y :scroll-with-animation="false" :enable-back-to-top="true">
|
<scroll-view class="model-content" scroll-y :scroll-with-animation="false" :enable-back-to-top="true">
|
||||||
<view class="actBox">
|
<view class="actBox">
|
||||||
|
|
@ -41,7 +42,8 @@
|
||||||
<view class="model-content-title">
|
<view class="model-content-title">
|
||||||
<view class="contBu">
|
<view class="contBu">
|
||||||
<text v-for="(item,index) in state.activityMap[state.activityInfo[0]?.id]?.scor"
|
<text v-for="(item,index) in state.activityMap[state.activityInfo[0]?.id]?.scor"
|
||||||
:key="index" v-show="item.bull">满{{fen2yuan(item.discountPrice)}}元送{{item.value}}积分;</text>
|
:key="index"
|
||||||
|
v-show="item.bull">满{{fen2yuan(item.discountPrice)}}元送{{item.value}}积分;</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="ss-m-b-24 cotBu-txt">
|
<view class="ss-m-b-24 cotBu-txt">
|
||||||
{{formatDateRange(state.activityInfo[0]?.startTime,state.activityInfo[0]?.endTime)}}
|
{{formatDateRange(state.activityInfo[0]?.startTime,state.activityInfo[0]?.endTime)}}
|
||||||
|
|
@ -56,7 +58,8 @@
|
||||||
<view class="model-content-title">
|
<view class="model-content-title">
|
||||||
<view class="contBu">
|
<view class="contBu">
|
||||||
<text v-for="(item,index) in state.activityMap[state.activityInfo[0]?.id]?.cou"
|
<text v-for="(item,index) in state.activityMap[state.activityInfo[0]?.id]?.cou"
|
||||||
:key="index" v-show="item.bull">满{{fen2yuan(item.discountPrice)}}元送{{item.value}}张优惠券;</text>
|
:key="index"
|
||||||
|
v-show="item.bull">满{{fen2yuan(item.discountPrice)}}元送{{item.value}}张优惠券;</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="ss-m-b-24 cotBu-txt">
|
<view class="ss-m-b-24 cotBu-txt">
|
||||||
{{formatDateRange(state.activityInfo[0]?.startTime,state.activityInfo[0]?.endTime)}}
|
{{formatDateRange(state.activityInfo[0]?.startTime,state.activityInfo[0]?.endTime)}}
|
||||||
|
|
@ -66,6 +69,7 @@
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</scroll-view>
|
</scroll-view>
|
||||||
|
</view>
|
||||||
<view class="titleLi">可领优惠券</view>
|
<view class="titleLi">可领优惠券</view>
|
||||||
<scroll-view class="model-content" scroll-y :scroll-with-animation="false" :enable-back-to-top="true">
|
<scroll-view class="model-content" scroll-y :scroll-with-animation="false" :enable-back-to-top="true">
|
||||||
<view class="actBox" v-for="item in state.couponInfo" :key="item.id">
|
<view class="actBox" v-for="item in state.couponInfo" :key="item.id">
|
||||||
|
|
@ -83,7 +87,7 @@
|
||||||
{{item.name}}
|
{{item.name}}
|
||||||
</view>
|
</view>
|
||||||
<view class="ss-m-b-24 cotBu-txt">
|
<view class="ss-m-b-24 cotBu-txt">
|
||||||
{{item.validityType==1?formatDateRange(item.startTime,item.endTime) : '领取后'+item.fixedStartTerm+'-'+item.fixedEndTerm +'天可用'}}
|
{{item.validityType==1?formatDateRange(item.validStartTime,item.validEndTime) : '领取后'+item.fixedStartTerm+'-'+item.fixedEndTerm +'天可用'}}
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="coupon" @click.stop="getBuy(item.id)" v-if="item.canTake">
|
<view class="coupon" @click.stop="getBuy(item.id)" v-if="item.canTake">
|
||||||
|
|
|
||||||
|
|
@ -13,10 +13,18 @@
|
||||||
:style="[{ color: titleColor, width: titleWidth ? titleWidth + 'rpx' : '' }]">
|
:style="[{ color: titleColor, width: titleWidth ? titleWidth + 'rpx' : '' }]">
|
||||||
{{ data.title || data.name }}
|
{{ data.title || data.name }}
|
||||||
</view>
|
</view>
|
||||||
|
<!-- 这里是新加的会员价和限时优惠 -->
|
||||||
|
<view class="iconBox" v-if="data.discountPrice || data.vipPrice || data.reward">
|
||||||
|
<view class="card" v-if="iconShow">{{iconShow}}</view>
|
||||||
|
<view class="card2" v-if="data.reward">{{data.reward.rewardActivity}}</view>
|
||||||
|
</view>
|
||||||
|
<!-- 这里是新加的会员价和限时优惠结束 -->
|
||||||
<view v-if="goodsFields.price?.show" class="xs-goods-price font-OPPOSANS"
|
<view v-if="goodsFields.price?.show" class="xs-goods-price font-OPPOSANS"
|
||||||
:style="[{ color: goodsFields.price.color }]">
|
:style="[{ color: goodsFields.price.color }]">
|
||||||
<text class="price-unit ss-font-24">{{ priceUnit }}</text>
|
<text class="price-unit ss-font-24">{{ priceUnit }}</text>
|
||||||
{{ isArray(data.price) ? fen2yuan(data.price[0]) : fen2yuan(data.price) }}
|
<text v-if="iconShow=='限时优惠'">{{fen2yuan(data.discountPrice)}}</text>
|
||||||
|
<text v-else-if="iconShow=='会员价'">{{fen2yuan(data.vipPrice)}}</text>
|
||||||
|
<text v-else>{{ isArray(data.price) ? fen2yuan(data.price[0]) : fen2yuan(data.price) }}</text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
@ -34,10 +42,18 @@
|
||||||
class="sm-goods-title ss-line-1 ss-m-b-16">
|
class="sm-goods-title ss-line-1 ss-m-b-16">
|
||||||
{{ data.title || data.name }}
|
{{ data.title || data.name }}
|
||||||
</view>
|
</view>
|
||||||
|
<!-- 这里是新加的会员价和限时优惠 -->
|
||||||
|
<view class="iconBox" v-if="data.discountPrice || data.vipPrice || data.reward">
|
||||||
|
<view class="card" v-if="iconShow">{{iconShow}}</view>
|
||||||
|
<view class="card2" v-if="data.reward">{{data.reward.rewardActivity}}</view>
|
||||||
|
</view>
|
||||||
|
<!-- 这里是新加的会员价和限时优惠结束 -->
|
||||||
<view v-if="goodsFields.price?.show" class="sm-goods-price font-OPPOSANS"
|
<view v-if="goodsFields.price?.show" class="sm-goods-price font-OPPOSANS"
|
||||||
:style="[{ color: goodsFields.price.color }]">
|
:style="[{ color: goodsFields.price.color }]">
|
||||||
<text class="price-unit ss-font-24">{{ priceUnit }}</text>
|
<text class="price-unit ss-font-24">{{ priceUnit }}</text>
|
||||||
{{ isArray(data.price) ? fen2yuan(data.price[0]) : fen2yuan(data.price) }}
|
<text v-if="iconShow=='限时优惠'">{{fen2yuan(data.discountPrice)}}</text>
|
||||||
|
<text v-else-if="iconShow=='会员价'">{{fen2yuan(data.vipPrice)}}</text>
|
||||||
|
<text v-else>{{ isArray(data.price) ? fen2yuan(data.price[0]) : fen2yuan(data.price) }}</text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
@ -131,6 +147,12 @@
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</slot>
|
</slot>
|
||||||
|
<!-- 这里是新加的会员价和限时优惠 -->
|
||||||
|
<view class="iconBox" v-if="data.discountPrice || data.vipPrice || data.reward">
|
||||||
|
<view class="card" v-if="iconShow">{{iconShow}}</view>
|
||||||
|
<view class="card2" v-if="data.reward">{{data.reward.rewardActivity}}</view>
|
||||||
|
</view>
|
||||||
|
<!-- 这里是新加的会员价和限时优惠结束 -->
|
||||||
<view class="ss-flex ss-col-bottom ss-m-t-10">
|
<view class="ss-flex ss-col-bottom ss-m-t-10">
|
||||||
<view v-if="goodsFields.price?.show"
|
<view v-if="goodsFields.price?.show"
|
||||||
class="lg-goods-price ss-m-r-12 ss-flex ss-col-bottom font-OPPOSANS"
|
class="lg-goods-price ss-m-r-12 ss-flex ss-col-bottom font-OPPOSANS"
|
||||||
|
|
@ -143,7 +165,9 @@
|
||||||
(data.original_price > 0 || data.marketPrice > 0)
|
(data.original_price > 0 || data.marketPrice > 0)
|
||||||
" class="goods-origin-price ss-flex ss-col-bottom font-OPPOSANS" :style="[{ color: originPriceColor }]">
|
" class="goods-origin-price ss-flex ss-col-bottom font-OPPOSANS" :style="[{ color: originPriceColor }]">
|
||||||
<text class="price-unit ss-font-20">{{ priceUnit }}</text>
|
<text class="price-unit ss-font-20">{{ priceUnit }}</text>
|
||||||
<view class="ss-m-l-8">{{ fen2yuan(data.marketPrice) }}</view>
|
<text v-if="iconShow=='限时优惠'">{{fen2yuan(data.discountPrice)}}</text>
|
||||||
|
<text v-else-if="iconShow=='会员价'">{{fen2yuan(data.vipPrice)}}</text>
|
||||||
|
<text v-else>{{ isArray(data.price) ? fen2yuan(data.price[0]) : fen2yuan(data.price) }}</text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="ss-m-t-8 ss-flex ss-col-center ss-flex-wrap">
|
<view class="ss-m-t-8 ss-flex ss-col-center ss-flex-wrap">
|
||||||
|
|
|
||||||
|
|
@ -13,8 +13,10 @@
|
||||||
<view class="ss-flex">
|
<view class="ss-flex">
|
||||||
<view class="price-text">
|
<view class="price-text">
|
||||||
{{ fen2yuan( state.selectedSku.price || goodsInfo.price) }}
|
{{ fen2yuan( state.selectedSku.price || goodsInfo.price) }}
|
||||||
<text class="iconBox" v-if="state.selectedSku.type == 6">会员价</text>
|
<text v-if="state.selectedSku.type == 6"><text class="iconBox">会员价</text><text
|
||||||
<text class="iconBox" v-if="state.selectedSku.type == 4">限时优惠</text>
|
class="origin-price-text">{{fen2yuan(state.selectedSku.oldPrice)}}</text></text>
|
||||||
|
<text v-if="state.selectedSku.type == 4"><text class="iconBox">限时优惠</text><text
|
||||||
|
class="origin-price-text">{{fen2yuan(state.selectedSku.oldPrice)}}</text></text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="stock-text ss-m-l-20">
|
<view class="stock-text ss-m-l-20">
|
||||||
|
|
@ -62,9 +64,17 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { computed, reactive, watch } from 'vue';
|
import {
|
||||||
|
computed,
|
||||||
|
reactive,
|
||||||
|
watch
|
||||||
|
} from 'vue';
|
||||||
import sheep from '@/sheep';
|
import sheep from '@/sheep';
|
||||||
import { formatStock, convertProductPropertyList, fen2yuan } from '@/sheep/hooks/useGoods';
|
import {
|
||||||
|
formatStock,
|
||||||
|
convertProductPropertyList,
|
||||||
|
fen2yuan
|
||||||
|
} from '@/sheep/hooks/useGoods';
|
||||||
|
|
||||||
const emits = defineEmits(['change', 'addCart', 'buy', 'close']);
|
const emits = defineEmits(['change', 'addCart', 'buy', 'close']);
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
|
|
@ -84,7 +94,7 @@
|
||||||
});
|
});
|
||||||
|
|
||||||
const propertyList = convertProductPropertyList(props.goodsInfo.skus);
|
const propertyList = convertProductPropertyList(props.goodsInfo.skus);
|
||||||
console.log('传递来的sku信息',props.goodsInfo.skus)
|
console.log('传递来的sku信息', props.goodsInfo.skus)
|
||||||
// SKU 列表
|
// SKU 列表
|
||||||
const skuList = computed(() => {
|
const skuList = computed(() => {
|
||||||
let skuPrices = props.goodsInfo.skus;
|
let skuPrices = props.goodsInfo.skus;
|
||||||
|
|
@ -98,7 +108,7 @@
|
||||||
() => state.selectedSku,
|
() => state.selectedSku,
|
||||||
(newVal) => {
|
(newVal) => {
|
||||||
emits('change', newVal);
|
emits('change', newVal);
|
||||||
console.log('选中的sku信息',state.selectedSku)
|
console.log('选中的sku信息', state.selectedSku)
|
||||||
}, {
|
}, {
|
||||||
immediate: true, // 立即执行
|
immediate: true, // 立即执行
|
||||||
deep: true, // 深度监听
|
deep: true, // 深度监听
|
||||||
|
|
@ -208,7 +218,8 @@
|
||||||
// 如果当前 property id 不存在于有库存的 SKU 中,则禁用
|
// 如果当前 property id 不存在于有库存的 SKU 中,则禁用
|
||||||
for (let valueIndex in propertyList[propertyIndex]['values']) {
|
for (let valueIndex in propertyList[propertyIndex]['values']) {
|
||||||
propertyList[propertyIndex]['values'][valueIndex]['disabled'] =
|
propertyList[propertyIndex]['values'][valueIndex]['disabled'] =
|
||||||
noChooseValueIds.indexOf(propertyList[propertyIndex]['values'][valueIndex]['id']) < 0; // true 禁用 or false 不禁用
|
noChooseValueIds.indexOf(propertyList[propertyIndex]['values'][valueIndex]['id']) <
|
||||||
|
0; // true 禁用 or false 不禁用
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -406,6 +417,7 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.iconBox {
|
.iconBox {
|
||||||
width: fit-content;
|
width: fit-content;
|
||||||
height: fit-content;
|
height: fit-content;
|
||||||
|
|
@ -415,4 +427,16 @@
|
||||||
font-size: 24rpx;
|
font-size: 24rpx;
|
||||||
margin-left: 5rpx;
|
margin-left: 5rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.origin-price-text {
|
||||||
|
font-size: 26rpx;
|
||||||
|
font-weight: 400;
|
||||||
|
text-decoration: line-through;
|
||||||
|
color: $gray-c;
|
||||||
|
font-family: OPPOSANS;
|
||||||
|
|
||||||
|
&::before {
|
||||||
|
content: '¥';
|
||||||
|
}
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
@ -447,6 +447,7 @@ export function handListPrice(array,array2) {
|
||||||
// 遍历 array 数组并更新 price 和 type
|
// 遍历 array 数组并更新 price 和 type
|
||||||
array.forEach(item => {
|
array.forEach(item => {
|
||||||
if (array2Map[item.id]) {
|
if (array2Map[item.id]) {
|
||||||
|
item.oldPrice = item.price
|
||||||
// 如果在 array2Map 中找到了对应的 skuId(即 id)
|
// 如果在 array2Map 中找到了对应的 skuId(即 id)
|
||||||
item.price = array2Map[item.id].price;
|
item.price = array2Map[item.id].price;
|
||||||
item.type = array2Map[item.id].type;
|
item.type = array2Map[item.id].type;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue