This commit is contained in:
2025-03-07 10:43:12 +08:00
parent 0020a80506
commit eb42140cae
9 changed files with 2784 additions and 2062 deletions

View File

@@ -24,7 +24,7 @@
"type" : "uni-app:app-ios"
},
{
"playground" : "custom",
"playground" : "standard",
"type" : "uni-app:app-android"
},
{

View File

@@ -136,9 +136,16 @@
>
</view>
<view
style="color: #c0c4cc; font-size: 26rpx; font-weight: 700"
style="color: #e97512; font-size: 26rpx; font-weight: 700"
>
×{{ item.quantity ? item.quantity : "" }}</view
<view style="text-align: right;font-size: 30rpx;margin-bottom: 10rpx;">
¥{{ item.price }}
</view>
<view style="text-align: right;color: #333;">
×{{ item.quantity ? item.quantity : "" }}
</view>
</view
>
</view>
<!-- <view class="btns flexbox" style="margin-top: 10rpx">
@@ -241,10 +248,46 @@
</span>
<span>¥</span>{{ orderContet.shippingMoney }}
</view>
<view
class="orderReal"
v-if="
orderContet.orderType == 'order' &&
orderContet.districtMoney &&
orderContet.districtMoney > 0
"
>
<span style="color: #666; margin-right: 10rpx; float: left">
活动立减:
</span>
<span style="color: #fa2d12"
>- ¥{{ orderContet.districtMoney }}</span
>
</view>
<view
class="orderReal"
v-if="
orderContet.orderType == 'order' &&
orderContet.vipDiscountAmount &&
orderContet.vipDiscountAmount > 0
"
>
<span style="color: #666; margin-right: 10rpx; float: left">
<span
style="color: #f94f04; font-weight: bold; margin-right: 2px"
>VIP</span
>
专享立减:
</span>
<span style="color: #fa2d12"
>- ¥{{ orderContet.vipDiscountAmount }}</span
>
</view>
<view
class="orderReal"
v-if="orderContet.couponId && orderContet.couponId != null"
>
<span style="color: #666; margin-right: 10rpx; float: left"
>优惠券 :
</span>

View File

@@ -1,6 +1,15 @@
<template>
<view class="container commonPageBox commonDetailPage" style="height: auto !important;padding-bottom: 0 !important;">
<u-popup :show="show" v-if="show" mode="bottom" @close="close" class="popup_box">
<view
class="container commonPageBox commonDetailPage"
style="height: auto !important; padding-bottom: 0 !important"
>
<u-popup
:show="show"
v-if="show"
mode="bottom"
@close="close"
class="popup_box"
>
<view class="popup_top">
<!-- @click="previewImage(selectGoodsData.productImages)" -->
<view class="product_image">
@@ -15,7 +24,30 @@
<view :class="`common_radius_box goods_box popup_content`">
<view class="title title_box"
><text class="title_price">{{ selectGoodsData.activityPrice?selectGoodsData.activityPrice:selectGoodsData.price }}</text
><text class="title_price"
>
<text v-if="selectGoodsData.isVipPrice==1&&selectGoodsData.vipPrice!=0&&selectGoodsData.vipPrice!=null">
<text style="color: #e97512;font-weight: bold;">{{(selectGoodsData.vipPrice).toFixed(2)}}</text>
<text style="color: #fa2d12;font-size: 12px;margin-left: 4px;">VIP到手价</text>
<!-- <text style="color: #8a8a8a;font-size: 10px;margin-left: 4px;font-weight: bold;text-decoration: line-through;">{{(selectGoodsData.price).toFixed(2)}}</text> -->
</text>
<text
v-else-if="selectGoodsData.activityPrice && selectGoodsData.activityPrice > 0">
<text style="color: #e97512;font-weight: bold;">{{(selectGoodsData.activityPrice).toFixed(2)}}</text>
<text style="color: #613804;font-size: 12px;margin-left: 4px;">活动价</text>
<!-- <text style="color: #8a8a8a;font-size: 10px;margin-left: 4px;font-weight: bold;text-decoration: line-through;">{{(selectGoodsData.price).toFixed(2)}}</text> -->
</text>
<text v-else style="color: #e97512;font-weight: bold;"> {{Number(selectGoodsData.price).toFixed(2)}}</text>
</text
>
<u-icon
name="close"
@@ -44,13 +76,16 @@
<view
class="related_courses_name"
:class="`goods_item ${
!isFudu && selectGoodsData &&
selectGoodsData.productId == slotProps.row.productId || isFudu && selectGoodsData.productName == slotProps.row.productName
(!isFudu &&
selectGoodsData &&
selectGoodsData.productId == slotProps.row.productId) ||
(isFudu &&
selectGoodsData.productName == slotProps.row.productName)
? 'isSelectGoods color_shandow'
: ''
}`"
>
<view class="image_box" style="margin-right: 10rpx; ">
<view class="image_box" style="margin-right: 10rpx">
<image
:src="slotProps.row.productImages"
mode="aspectFit"
@@ -58,17 +93,93 @@
></image>
</view>
<view :class="`goods_info flex_box just`" style="justify-content: space-between;">
<view :class="`goods_info just`" style="">
<view class="name">{{ slotProps.row.productName }}</view>
<view class="flex_box">
<text style="color: #999; text-decoration: line-through; margin-right: 20rpx;"
<view class="flex_box" style="align-items: center;">
<!-- <text style="color: #999; text-decoration: line-through; margin-right: 20rpx;"
v-if="slotProps.row.activityPrice > 0 && slotProps.row.activityPrice < slotProps.row.price" >{{slotProps.row.price}}</text>
<view class="price" style="color: #258feb"
>{{ slotProps.row.activityPrice?slotProps.row.activityPrice:slotProps.row.price }}</view
></view
>
</view>
> -->
<text
class="price"
v-if="
slotProps.row.isVipPrice == 1 &&
slotProps.row.vipPrice != 0 &&
slotProps.row.vipPrice != null
"
>
<text
style="color: #e97512; font-size: 12px; font-weight: bold"
>¥{{ slotProps.row.vipPrice.toFixed(2) }}</text
>
<!-- <text style="color: #fa2d12; font-size: 10px; margin-left: 4px"
>VIP到手价</text
> -->
<text
style="
color: #8a8a8a;
font-size: 10px;
margin-left: 4px;
font-weight: bold;
text-decoration: line-through;
"
>¥{{ Number(slotProps.row.price).toFixed(2) }}</text
>
</text>
<text
v-else-if="
slotProps.row.activityPrice &&
slotProps.row.activityPrice > 0
"
class="price"
>
<text
style="color: #e97512; font-size: 12px; font-weight: bold"
>¥{{ slotProps.row.activityPrice.toFixed(2) }}</text
>
<!-- <text style="color: #613804; font-size: 10px; margin-left: 4px"
>活动价</text
> -->
<text
style="
color: #8a8a8a;
font-size: 10px;
margin-left: 4px;
font-weight: bold;
text-decoration: line-through;
"
>¥{{ Number(slotProps.row.price).toFixed(2) }}</text
>
</text>
<text v-else class="price"
>¥{{ Number(slotProps.row.price).toFixed(2) }}</text
>
<text
v-if="
slotProps.row.isVipPrice == 1 &&
slotProps.row.vipPrice != 0 &&
slotProps.row.vipPrice != null
"
style="
z-index: 10;
margin-left: 10rpx;
font-size: 20rpx;
color: #f94f04;
font-weight: bold;
"
>VIP优惠</text
>
</view>
</view>
</view>
<!-- <text v-if="slotProps.row.conditions!='03'">【试听】</text> -->
@@ -109,7 +220,7 @@ export default {
"selectGoodsData",
"customButtonGroup1",
"buyOptions",
"isFudu", // 是否复读
"isFudu", // 是否复读
],
data() {
return {
@@ -166,7 +277,7 @@ export default {
</script>
<style lang="scss" scoped>
@import '@/style/mixin.scss';
@import "@/style/mixin.scss";
.goods_item {
overflow: hidden;
display: flex;
@@ -199,9 +310,9 @@ export default {
// padding: 10rpx 20rpx;
box-sizing: border-box;
// height: 100rpx;
display: flex;
align-items: center;
justify-content: space-between;
// display: flex;
// align-items: center;
// justify-content: space-between;
float: left;
.name {
font-size: 26rpx;

View File

@@ -273,17 +273,92 @@
<view class="list supermarketBox">
<scroll-view class="scroll-view_H" scroll-x="true">
<view class="item" v-for="(item, index) in tjProList" :key="index" @click="goToGoodsList(item)">
<view class="imgcontainer">
<view class="imgcontainer" style="position: relative;">
<view v-if="item.isVipPrice==1&&item.vipPrice!=0&&item.vipPrice!=null"
style="z-index:10;position: absolute;top: 10rpx;left: 10rpx;text-align: center;font-size: 22rpx;background-color: #f94f04;color: #fff;font-weight: bold;border-radius:4px;width: 120rpx; padding:4px;box-sizing: border-box;">
VIP优惠</view>
<image :src="item.productImages" mode="aspectFit"></image>
</view>
<view class="name">
{{ item.productName }}
</view>
<text
class="price"
v-if="
item.isVipPrice == 1 &&
item.vipPrice != 0 &&
item.vipPrice != null
"
>
<text
style="color: #e97512; font-size: 12px; font-weight: bold"
>¥{{ item.vipPrice.toFixed(2) }}</text
>
<!-- <text style="color: #fa2d12; font-size: 10px; margin-left: 4px"
>VIP到手价</text
> -->
<text
style="
color: #8a8a8a;
font-size: 10px;
margin-left: 4px;
font-weight: bold;
text-decoration: line-through;
"
>¥{{ Number(item.price) }}</text
>
</text>
<view class="price" v-if="item.activityPrice && item.activityPrice > 0">
<text
v-else-if="item.activityPrice && item.activityPrice > 0"
class="price"
>
<text
style="color: #e97512; font-size: 12px; font-weight: bold"
>¥{{ item.activityPrice }}</text
>
<!-- <text style="color: #613804; font-size: 10px; margin-left: 4px"
>活动价</text
> -->
<text
style="
color: #8a8a8a;
font-size: 10px;
margin-left: 4px;
font-weight: bold;
text-decoration: line-through;
"
>¥{{ Number(item.price)}}</text
>
</text>
<text v-else class="price" style="color: #e97512 !important;"
>¥{{ Number(item.price) }}</text
>
<!-- <text
v-if="
item.isVipPrice == 1 &&
item.vipPrice != 0 &&
item.vipPrice != null
"
style="
z-index: 10;
margin-left: 10rpx;
font-size: 20rpx;
color: #f94f04;
font-weight: bold;
"
>VIP优惠</text
> -->
<!-- <view class="price" v-if="item.activityPrice && item.activityPrice > 0">
¥{{ item.activityPrice }}
</view>
<view class="price" v-else> {{ item.price }} </view>
<view class="price" v-else> ¥{{ item.price }} </view> -->
</view>
</scroll-view>
</view>

View File

@@ -32,35 +32,76 @@
<view class="goods_box">
<view class="curriulum_title_box">
<view v-if="this.options.isMiaosha == 1" class="miaosha_box">
<view class="price_box">
<view class="price_left">
<template
v-if="
curriculumData.activityPrice &&
curriculumData.activityPrice > 0
"
>
<text class="aui-text-danger price">
¥{{ curriculumData.activityPrice }}
</text>
<text class="price original_price"
>原价:¥{{ curriculumData.price }}
</text>
</template>
<template v-else>
<text class="aui-text-danger price">
¥{{ curriculumData.price }}
</text>
</template>
<view v-if="(curriculumData.isVipPrice == 1 &&
curriculumData.vipPrice != 0 &&
curriculumData.vipPrice != null)|| curriculumData.activityPrice &&
curriculumData.activityPrice > 0" class="miaosha_box">
<view class="price_box">
<view class="price_left" v-if="curriculumData">
<text
class="price"
v-if="
curriculumData.isVipPrice == 1 &&
curriculumData.vipPrice != 0 &&
curriculumData.vipPrice != null
"
>
<text
>¥{{ curriculumData.vipPrice.toFixed(2) }}</text
>
<!-- <text style="color: #fa2d12; font-size: 10px; margin-left: 4px"
>VIP到手价</text
> -->
<text
style="
color: #8a8a8a;
font-size: 14px;
margin-left: 4px;
font-weight: bold;
text-decoration: line-through;
"
>¥{{ Number(curriculumData.price).toFixed(2) }}</text
>
</text>
<text
v-else-if="curriculumData.activityPrice && curriculumData.activityPrice > 0"
class="price"
>
<text
>¥{{ curriculumData.activityPrice.toFixed(2) }}</text
>
<!-- <text style="color: #613804; font-size: 10px; margin-left: 4px"
>活动价</text
> -->
<text
style="
color: #8a8a8a;
font-size: 14px;
margin-left: 4px;
font-weight: bold;
text-decoration: line-through;
"
>¥{{ Number(curriculumData.price).toFixed(2) }}</text
>
</text>
<text v-else-if="curriculumData&&curriculumData.price>0" class="price"
>¥{{ Number(curriculumData.price).toFixed(2) }}</text
>
<view class="price original_price sales_number"
>已售 {{ curriculumData.sumSales }}件
</view>
</view>
<view class="xianshimaiosha_box">
<text class="xianshimaiosha">秒杀商品</text>
<view class="xianshimaiosha_box" >
<text class="xianshimaiosha" v-if="curriculumData.isVipPrice == 1 &&
curriculumData.vipPrice != 0 &&
curriculumData.vipPrice != null">VIP优惠</text>
<text class="xianshimaiosha" v-else-if=" curriculumData.activityPrice &&
curriculumData.activityPrice > 0">活动立减</text>
</view>
</view>
@@ -68,6 +109,7 @@
>{{ curriculumData.productName }}
</view>
</view>
<view
v-else
class="normal_box"
@@ -87,9 +129,9 @@
>原价:¥{{ curriculumData.price }}
</text>
</template>
<template v-else>
<template v-else-if="curriculumData.price">
<text class="aui-text-danger price">
¥{{ curriculumData.price }}
¥{{ Number(curriculumData.price).toFixed(2) }}
</text>
</template>
<text

View File

@@ -42,8 +42,29 @@
<view class="order_top common_radius_box color_shandow goods_box">
<view
class="curriulum_title_box goods_item"
style="position: relative"
v-for="(v, i) in goodsDataList"
>
<span
v-if="v.isVipPrice == 1 && v.vipPrice != 0 && v.vipPrice != null"
style="
position: absolute;
z-index: 10;
top: 4px;
left: 0px;
margin-right: 10px;
text-align: center;
font-size: 18rpx;
background-color: #f94f04;
color: #fff;
font-weight: bold;
border-radius: 4px;
width: 80rpx;
padding: 2px 4px;
box-sizing: border-box;
"
>VIP优惠</span
>
<image
v-if="v.productImages && v.productImages != ''"
class="goods_item_img"
@@ -58,9 +79,12 @@
@click="goDetail(item.productId)"
></image>
<view class="normal_box">
<view class="normal_box_top" style="justify-content: space-between;position: relative;">
<view
class="normal_box_top"
style="justify-content: space-between; position: relative"
>
<view class="curriulum_title">{{ v.productName }} </view>
<view
<!-- <view
style="
width: 120rpx !important;
text-align: right;
@@ -75,8 +99,8 @@
: v.price
}}
</view>
</view>
<view
</view> -->
<!-- <view
v-if="v.activityPrice > 0 && v.activityPrice < v.price"
style="
position: absolute;
@@ -86,9 +110,54 @@
text-decoration: line-through;
font-size: 24rpx;
"
>原价{{ v.price }}</view>
>原价{{ v.price }}</view> -->
</view>
<view>
<text
v-if="
v.isVipPrice == 1 && v.vipPrice != 0 && v.vipPrice != null
"
>
<text style="color: #e97512; font-size: 12px; font-weight: bold"
>¥{{ v.vipPrice.toFixed(2) }}</text
>
<text style="color: #fa2d12; font-size: 10px; margin-left: 4px"
>VIP到手价</text
>
<text
style="
color: #8a8a8a;
font-size: 10px;
margin-left: 4px;
font-weight: bold;
text-decoration: line-through;
"
>¥{{ Number(v.price).toFixed(2) }}</text
>
</text>
<text v-else-if="v.activityPrice && v.activityPrice > 0">
<text style="color: #e97512; font-size: 12px; font-weight: bold"
>¥{{ v.activityPrice.toFixed(2) }}</text
>
<text style="color: #613804; font-size: 10px; margin-left: 4px"
>活动价</text
>
<text
style="
color: #8a8a8a;
font-size: 10px;
margin-left: 4px;
font-weight: bold;
text-decoration: line-through;
"
>¥{{ Number(v.price).toFixed(2) }}</text
>
</text>
<text v-else style="font-size: 12px"
>¥{{ Number(v.price).toFixed(2) }}</text
>
<u-number-box v-model="orderNumber" style="float: right">
<view slot="minus" class="minus">
<u-icon name="minus" size="12"></u-icon>
@@ -168,19 +237,30 @@
style="display: inline-block"
></u-icon>
<text> {{ v.text }}</text>
<template v-if="v.type == 4">
<text v-if="v.type == 6">
<span
style="color: #f94f04; font-weight: bold; margin-right: 2px"
>VIP</span
>
专享立减</text
>
<text v-else> {{ v.text }}</text>
<template v-if="v.type == 4">
<text style="color: #aaa; margin-left: 10rpx">
(全部积分{{ initData.user.jf }})</text>
(全部积分:{{ initData.user.jf }})</text
>
</template>
</view>
<view class="right">
<template v-if="v.type == 1"> {{ totalPrice }}</template>
<template v-if="v.type == 1">
¥{{ Number(totalPrice).toFixed(2) }}</template
>
<template v-if="v.type == 2">
<text>
¥{{
isShowAddress ? freightNum.toFixed(2) : Number(0).toFixed(2)
}}</text>
}}</text
>
</template>
<template v-if="v.type == 3">
<template v-if="!curCoupon.id">
@@ -239,6 +319,16 @@
<template v-if="v.type == 4">
<text style="color: #fe6035"> -¥{{ jfNumberShow }}</text>
</template>
<template v-if="v.type == 5">
<text style="color: #fa2d12"
>- ¥{{ districtAmount.toFixed(2) }}</text
>
</template>
<template v-if="v.type == 6">
<text style="color: #fa2d12"
>- ¥{{ vipPrice.toFixed(2) }}</text
>
</template>
</view>
</view>
@@ -269,44 +359,55 @@
<view class="order_top common_radius_box color_shandow goods_box pay_box">
<view class="title">支付方式</view>
<!-- 商品是安卓环境支付,或者商品列表中没有课程 -->
<view
class="curriulum_title_box goods_item pay_item"
v-for="(v, i) in payList"
>
<view :class="isDefaultCurrency && i != 2 ? 'bgGrey top' : 'top'">
<view class="left">
<image
class="pay_item_img"
:src="v.imgUrl"
mode="aspectFil"
:style="v.style"
>
</image>
<template v-if="v.type == 4">
<text> {{ v.text }}</text>
<text
style="color: #258feb; font-weight: 600; margin-left: 10rpx"
>
(余额{{
initData && initData.user ? initData.user.peanutCoin : 0
}})</text
>
</template>
<view
class="curriulum_title_box goods_item pay_item"
v-for="(v, i) in payList"
>
<view :class="isDefaultCurrency && i != 2 ? 'bgGrey top' : 'top'">
<view class="left">
<image
class="pay_item_img"
:src="v.imgUrl"
mode="aspectFil"
:style="v.style"
>
</image>
<template v-if="v.type == 4">
<text> {{ v.text }}</text>
<text
style="color: #258feb; font-weight: 600; margin-left: 10rpx"
>
(余额:{{
initData && initData.user ? initData.user.peanutCoin : 0
}})</text
>
</template>
<text v-else> {{ v.text }}</text>
</view>
<text v-else> {{ v.text }}</text>
</view>
<template v-if="isDefaultCurrency">
<radio v-if="i == 2" :value="v.value" color="#258feb"
:checked="selectPayIndex == i ? true : false" @click="radioChange(i)" size="10" />
</template>
<template v-else>
<radio :value="v.value" color="#258feb" :checked="selectPayIndex == i ? true : false"
@click="radioChange(i)" size="10" />
</template>
</view>
</view>
<template v-if="selectPayIndex==2||$platform=='ios'">
<template v-if="isDefaultCurrency">
<radio
v-if="i == 2"
:value="v.value"
color="#258feb"
:checked="selectPayIndex == i ? true : false"
@click="radioChange(i)"
size="10"
/>
</template>
<template v-else>
<radio
:value="v.value"
color="#258feb"
:checked="selectPayIndex == i ? true : false"
@click="radioChange(i)"
size="10"
/>
</template>
</view>
</view>
<template v-if="selectPayIndex == 2 || $platform == 'ios'">
<view
class="goods_detail_list_title bg_box_shandow color_shandow bg_color"
>
@@ -369,7 +470,7 @@
</view>
</view>
</template>
</view>
</view>
<template>
<common-sticky
@@ -397,7 +498,9 @@
<text class="price"
>合计:
<text class="total">{{ actualPayment }}</text>
<text class="total"
>¥{{ Number(actualPayment).toFixed(2) }}</text
>
</text>
</view>
</template>
@@ -478,22 +581,25 @@ export default {
watch: {
isDefaultCurrency: {
immediate: true,
handler(newRoute) { console.log('this.isDefaultCurrency at line 482:', this.isDefaultCurrency)
handler(newRoute) {
console.log(
"this.isDefaultCurrency at line 482:",
this.isDefaultCurrency
);
if (this.isDefaultCurrency) {
if (platform == "ios") {
this.selectPayIndex = 0;
} else {
this.selectPayIndex = 0;
}
if (platform == "ios") {
this.selectPayIndex = 0;
} else {
this.selectPayIndex = 0;
}
} else {
if (platform == "ios") {
this.selectPayIndex = 0;
} else {
this.selectPayIndex = 0;
}
if (platform == "ios") {
this.selectPayIndex = 0;
} else {
this.selectPayIndex = 0;
}
}
this.payType = this.payList[this.selectPayIndex].type;
this.payType = this.payList[this.selectPayIndex].type;
this.$forceUpdate();
},
},
@@ -502,7 +608,10 @@ export default {
handler(newRoute) {
if (this.orderNumber >= 1) {
this.$nextTick(async () => {
await this.getActiveCouponList();
await this.getGoodsList();
// await this.getVipFei();
// await this.getDistrictAmount();
// await this.getActiveCouponList();
});
}
this.$forceUpdate();
@@ -511,6 +620,8 @@ export default {
},
data() {
return {
vipPrice: 0,
districtAmount: 0,
historyOrderInfo: undefined, //上一个订单的参数
isDefaultCurrency: false,
isShowAddress: false,
@@ -650,27 +761,12 @@ export default {
async onLoad(options) {
var that = this;
this.options = JSON.parse(options.data);
this.goodsDataList = this.options.goods;
var list = [...this.options.goods];
list = list.map((e) => e.goodsType);
this.haveCourse = list.some((ele) => ele === "05");
if (this.options.sourceType == "curriculum") {
this.goToInfo = {
url: "/pages/curriculum/order/index/index",
type: 2,
};
} else {
this.goToInfo = {
url: "/pages/bookShop/orderList",
type: 1,
};
}
that.initPrepareOrder();
// this.getGoodsList();
},
async onShow() {
this.curCouponId = undefined;
var that = this;
// this.getGoodsList();
await uni.$on("returnData", function (data) {
if (data) {
that.addressData = {
@@ -683,49 +779,160 @@ export default {
that.getUserAddress();
} else {
}
});
if(platform=='ios'){
this.payList= [
{
text: "天医币",
imgUrl: require("@/static/icon/pay_3.png"),
type: 4,
value: "2",
},
]
this.selectPayIndex = 0;
this.payType=4
}else{
this.payList= [{
text: "支付宝",
imgUrl: require("@/static/icon/pay_1.png"),
type: 2,
value: "0",
},
{
text: "微信",
imgUrl: require("@/static/icon/pay_2.png"),
type: 1,
value: "1",
},
{
text: "天医币",
imgUrl: require("@/static/icon/pay_3.png"),
type: 4,
value: "2",
},
]
this.selectPayIndex = 1;
this.payType=1
}
if (platform == "ios") {
this.payList = [
{
text: "天医币",
imgUrl: require("@/static/icon/pay_3.png"),
type: 4,
value: "2",
},
];
this.selectPayIndex = 0;
this.payType = 4;
} else {
this.payList = [
{
text: "支付宝",
imgUrl: require("@/static/icon/pay_1.png"),
type: 2,
value: "0",
},
{
text: "微信",
imgUrl: require("@/static/icon/pay_2.png"),
type: 1,
value: "1",
},
{
text: "天医币",
imgUrl: require("@/static/icon/pay_3.png"),
type: 4,
value: "2",
},
];
this.selectPayIndex = 1;
this.payType = 1;
}
},
computed: {
...mapState(["userInfo"]),
},
methods: {
getGoodsList() {
this.$http
.request({
// url: "book/buyOrder/calculateTransportPrice/",
url: "/book/buyOrder/getShopProductListByIds",
// url: "book/buyorder/getTransPrice/" + this.adressMoRen.areaidpath + "?" + dataToString,
method: "POST", // POST、GET、PUT、DELETE具体说明查看官方文档
data: {
productIds: this.options.goods.map((e) => e.productId).toString(),
},
header: {
//默认 无 说明:请求头
"Content-Type": "application/json",
},
})
.then(async (res) => {
this.goodsDataList = res.shopProductList;
console.log("this.goodsDataList at line 780:", this.goodsDataList);
await this.getVipFei();
await this.getDistrictAmount();
await this.getActiveCouponList();
var list = [...this.goodsDataList];
list = list.map((e) => e.goodsType);
this.haveCourse = list.some((ele) => ele === "05");
if (this.options.sourceType == "curriculum") {
this.goToInfo = {
url: "/pages/curriculum/order/index/index",
type: 2,
};
} else {
this.goToInfo = {
url: "/pages/bookShop/orderList",
type: 1,
};
}
this.initPrepareOrder();
});
},
async getVipFei() {
let key = [];
let dataToString = "";
// console.log(this.adressMoRen, '默认地址')
this.goodsDataList.forEach((item, index) => {
key.push({
productId: item.productId,
quantity: this.orderNumber,
});
// dataToString = dataToString.concat(item.productId+"="+item.productAmount+"&")
});
// console.log(key,'this.adressMoRen.areaidpath')
await $http
.request({
// url: "book/buyOrder/calculateTransportPrice/",
url: "/book/buyOrder/getVipDiscountAmount",
// url: "book/buyorder/getTransPrice/" + this.adressMoRen.areaidpath + "?" + dataToString,
method: "POST", // POST、GET、PUT、DELETE具体说明查看官方文档
data: {
productList: key,
},
header: {
//默认 无 说明:请求头
"Content-Type": "application/json",
},
})
.then(async(res) => {
if (res.code == 0) {
console.log("res.code at line 538:", res);
this.vipPrice = res.discountAmount;
// console.log('需要的运费', res.result)
await this.getTotalPrice();
}
});
},
async getDistrictAmount() {
let key = [];
let dataToString = "";
this.goodsDataList.forEach((item, index) => {
key.push({
productId: item.productId,
quantity: this.orderNumber,
});
// dataToString = dataToString.concat(item.productId+"="+item.productAmount+"&")
});
console.log(key, "this.adressMoRen.areaidpath");
await $http
.request({
// url: "book/buyOrder/calculateTransportPrice/",
url: "/book/buyOrder/getDistrictAmount",
// url: "book/buyorder/getTransPrice/" + this.adressMoRen.areaidpath + "?" + dataToString,
method: "POST", // POST、GET、PUT、DELETE具体说明查看官方文档
data: {
productList: key,
},
header: {
//默认 无 说明:请求头
"Content-Type": "application/json",
},
})
.then(async(res) => {
if (res.code == 0) {
console.log("res.code at line 538111111111111111:", res);
this.districtAmount = res.districtAmount;
// console.log('需要的运费', res.result)
await this.getTotalPrice();
}
});
},
closeCoupon() {
this.showCouponPup = false;
},
@@ -742,13 +949,13 @@ export default {
},
// 查询商品可用优惠券
async getActiveCouponList() {
if (this.goodsDataList.length <= 0) {
uni.showToast({
title: "商品参数错误,无法获取优惠券",
icon: "none",
});
return;
}
// if (this.goodsDataList.length <= 0) {
// uni.showToast({
// title: "商品参数错误,无法获取优惠券",
// icon: "none",
// });
// return;
// }
var list = [];
this.goodsDataList.forEach((e) => {
@@ -849,7 +1056,12 @@ export default {
couponAmount = this.curCoupon.couponEntity.couponAmount;
}
this.actualPayment =
this.totalPrice - couponAmount - this.jfNumber + this.freightNum;
this.totalPrice -
couponAmount -
this.jfNumber +
this.freightNum -
this.districtAmount -
this.vipPrice;
if (this.actualPayment == 0) {
this.isDefaultCurrency = true;
@@ -902,6 +1114,7 @@ export default {
imgUrl: "",
type: 2,
},
{
text: "优惠券",
imgUrl: "",
@@ -909,6 +1122,27 @@ export default {
},
];
}
if (
this.goodsDataList[0].activityPrice &&
this.goodsDataList[0].activityPrice > 0
) {
this.priceBreakdownList.push({
text: "活动立减",
imgUrl: "",
type: 5,
});
}
if (
this.goodsDataList[0].isVipPrice &&
this.goodsDataList[0].vipPrice &&
this.goodsDataList[0].vipPrice > 0
) {
this.priceBreakdownList.push({
text: "VIP专享立减",
imgUrl: "",
type: 6,
});
}
var data = {
uid: this.userInfo.id,
productList: this.goodsDataList.map((e) => {
@@ -932,8 +1166,10 @@ export default {
})
.then(async (res) => {
console.log('res at line 1168:', res)
if (res.code == 0) {
this.initData = res.data;
console.log(
"this.initData at line 初始化课程订单信息:",
this.initData
@@ -946,8 +1182,6 @@ export default {
type: 4,
});
}
}
this.$forceUpdate();
@@ -1056,10 +1290,10 @@ export default {
var that = this;
for (var i = this.goodsDataList.length - 1; i >= 0; i--) {
s +=
this.goodsDataList[i].activityPrice &&
this.goodsDataList[i].activityPrice > 0
? this.goodsDataList[i].activityPrice
: this.goodsDataList[i].price;
// this.goodsDataList[i].activityPrice &&
// this.goodsDataList[i].activityPrice > 0
// ? this.goodsDataList[i].activityPrice
this.goodsDataList[i].price;
}
that.totalPrice = s * this.orderNumber;
var couponAmount = 0;
@@ -1072,7 +1306,8 @@ export default {
couponAmount = 0;
}
if (!this.isShowAddress) {
if (this.initData.user.jf >= that.totalPrice) {
if(that.initData.user&&that.initData.user.jf){
if (this.initData.user.jf >= that.totalPrice) {
this.jfNumber = that.totalPrice - couponAmount;
this.jfNumberMax = that.totalPrice - couponAmount;
console.log("this.jfNumberMax at line 1303:", this.jfNumberMax);
@@ -1085,6 +1320,10 @@ export default {
this.jfNumberMax = this.initData.user.jf;
}
}
}else{
this.jfNumber=0
}
if (that.jfNumber == 0 || that.jfNumber == null) {
that.jfNumberShow = "0.00";
that.actualPayment = that.totalPrice - couponAmount;
@@ -1092,9 +1331,18 @@ export default {
that.jfNumberShow = that.jfNumber.toFixed(2);
that.actualPayment = that.totalPrice - that.jfNumber - couponAmount;
}
that.actualPayment = that.actualPayment + that.freightNum;
that.actualPayment =
that.actualPayment +
that.freightNum -
that.districtAmount -
that.vipPrice;
} else {
that.actualPayment = that.totalPrice + that.freightNum - couponAmount;
that.actualPayment =
that.totalPrice +
that.freightNum -
couponAmount -
that.districtAmount -
that.vipPrice;
}
if (this.actualPayment == 0 && !this.isShowAddress) {
this.isDefaultCurrency = true;
@@ -1188,6 +1436,8 @@ export default {
? this.curCoupon.couponEntity.couponName
: "", //优惠券名称
districtMoney: 0, //优惠金额
vipDiscountAmount: this.vipPrice, //折扣金额
districtMoney: this.districtAmount, //折扣金额
productList: this.goodsDataList.map((e) => {
return {
@@ -1234,7 +1484,7 @@ export default {
that.submitorder(data);
}
},
//支付操作
//支付操作
async submitorder(data) {
uni.showLoading({
title: "正在请求订单",
@@ -1705,7 +1955,7 @@ export default {
.curriulum_title {
// width: calc(100% - 80rpx);
width: calc(100% - 130rpx);
width: calc(100%);
font-weight: 500;
font-size: 30rpx;
// line-height: 40rpx;
@@ -1934,7 +2184,7 @@ export default {
.price {
.total {
font-size: 38rpx;
font-size: 30rpx;
color: red;
}
}

File diff suppressed because it is too large Load Diff

BIN
static/icon/zhijiang.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB

Binary file not shown.