更新项目,ios打包

This commit is contained in:
liuyuan
2025-03-17 17:00:10 +08:00
parent efb76a1716
commit 896f897014
27 changed files with 1147 additions and 237 deletions

View File

@@ -13,30 +13,45 @@
<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_box"
v-if="curriculumData.isVipPrice==1&&curriculumData.vipPrice!=null&&curriculumData.vipPrice!=0
||curriculumData.activityPrice && curriculumData.activityPrice > 0">
<view class="price_left">
<template v-if="
curriculumData.activityPrice &&
curriculumData.activityPrice > 0
">
<template v-if="curriculumData.isVipPrice==1&&curriculumData.vipPrice!=null&&curriculumData.vipPrice!=0">
<text class="aui-text-danger price">
¥{{ curriculumData.vipPrice }}
</text>
<text class="price original_price">¥{{ curriculumData.price }}
</text>
</template>
<template v-else>
<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 class="price original_price sales_number">已售 {{ curriculumData.sumSales }}件
</view>
</view>
<view class="xianshimaiosha_box">
<text class="xianshimaiosha">秒杀商品</text>
<text class="xianshimaiosha"
v-if="curriculumData.isVipPrice==1&&curriculumData.vipPrice!=null&&curriculumData.vipPrice!=0">
VIP优惠
</text>
<text class="xianshimaiosha" v-else-if="curriculumData.activityPrice && curriculumData.activityPrice > 0">活动立减</text>
</view>
</view>
<view class="putong" v-else>
<template>
<text class="aui-text-danger price">
¥{{ curriculumData.price }}
</text>
</template>
<view class="price original_price sales_number">已售 {{ curriculumData.sumSales }}件
</view>
</view>
@@ -424,8 +439,6 @@
productImages: this.selectGoodsData.productImages,
productId: this.selectGoodsData.productId,
productName: this.selectGoodsData.productName,
price: this.selectGoodsData.activityPrice ?
this.selectGoodsData.activityPrice : this.selectGoodsData.price,
goodsType: this.selectGoodsData.goodsType,
}],
navTitle: this.options.navTitle,
@@ -796,15 +809,12 @@
background-color: #fff;
.curriulum_title {
padding: 0 30rpx;
width: calc(100%);
font-weight: 600;
font-size: 34rpx;
// line-height: 40rpx;
// display: flex;
// align-items: center;
margin-top: 80rpx;
margin-bottom: 0rpx;
// padding: 20rpx;
font-size: 38rpx;
margin-top: 40rpx;
margin-bottom: 30rpx;
box-sizing: border-box;
}
}
@@ -816,10 +826,6 @@
box-sizing: border-box;
}
/deep/.titleItem {
// width: calc(100% - 120rpx) !important;
}
/deep/.scroll-view-item:nth-child(2n-1) {
background-color: transparent !important;
}
@@ -957,12 +963,12 @@
.original_price {
font-size: 28rpx !important;
font-weight: 500;
color: #999 !important;
font-weight: normal;
white-space: nowrap;
text-decoration: line-through;
float: left;
margin-top: 6rpx;
margin-left: 20rpx;
}
.price {
@@ -970,7 +976,6 @@
font-weight: 700;
float: left;
margin-right: 10rpx;
// font-family: PangMenZhengDaoBiaoTiTiMianFeiBan;
}
.price_box {
@@ -1009,13 +1014,6 @@
color: #fff !important;
}
.original_price {
color: #e4dede !important;
font-weight: 500;
margin-left: 20rpx;
font-size: 26rpx !important;
}
.sales_number {
display: block;
width: 100%;
@@ -1028,12 +1026,6 @@
padding: 30rpx 20rpx 30rpx;
background: linear-gradient(to right, #ff2701, #fd8d024d);
// height: 100rpx;
}
.curriulum_title {
padding: 20rpx 40rpx;
margin-top: 20rpx !important;
}
}
@@ -1279,4 +1271,10 @@
display: block;
}
}
.putong{
padding: 30rpx 30rpx 0 30rpx;
display: flex;
align-items: center;
justify-content: space-between;
}
</style>

View File

@@ -26,23 +26,31 @@
</view>
<view class="order_top common_radius_box color_shandow goods_box">
<view class="curriulum_title_box goods_item" v-for="(v, i) in goodsDataList">
<view class="curriulum_title_box goods_item" style=" position: relative;" v-for="(v, i) in goodsDataList">
<text class="goods_item_vip" v-if="v.isVipPrice==1&&v.vipPrice!=null&&v.vipPrice!=0">VIP优惠</text>
<image class="goods_item_img" :src="v.productImages" mode="aspectFit">
</image>
<view class="normal_box">
<view class="normal_box_top" style="justify-content: space-between">
<view class="normal_box_top">
<view class="curriulum_title">{{ v.productName }} </view>
<view class="price_box">
<text class="price" v-if="v.activityPrice&&v.activityPrice>0" style="margin-right: 0">
{{ v.activityPrice }}
<view class="vip_price" v-if="v.isVipPrice==1&&v.vipPrice!=null&&v.vipPrice!=0">
<text class="vip_price_jg">{{ v.vipPrice }}</text>
<text class="vip_price_text">VIP到手价</text>
<text class="vip_price_line">{{ v.price }}</text>
</view>
<text class="price" v-else-if="v.activityPrice&&v.activityPrice>0">
<text class="vip_price_jg">{{ v.activityPrice }}</text>
<text class="vip_price_text">活动价</text>
<text class="vip_price_line">{{ v.price }}</text>
</text>
<text v-else>{{ v.price }}</text>
<view>
x 1
</view>
</view>
</view>
<view style="width: 100%; text-align: right">
x 1
</view>
</view>
</view>
<view class="pay_box" style="margin-top: 20rpx">
@@ -81,7 +89,7 @@
<u-icon v-if="v.icon" name="map-fill" color="#018F89" size="20"
style="display: inline-block"></u-icon>
<text> {{ v.text }}</text>
<text :class="v.type==5||v.type==6?'type_text_red':''">{{ v.text }}</text>
<template v-if="v.type == 3">
<text style="color: #aaa; margin-left: 10rpx">
(全部积分{{ initData.user.jf }})</text>
@@ -96,6 +104,9 @@
<template v-if="v.type == 3">
<text style="color: #fe6035"> -{{ jfNumberShow }}</text>
</template>
<template v-if="v.type == 5||v.type == 6">
<text class="type_text_red">-{{districtAmount}}</text>
</template>
</view>
</view>
@@ -129,7 +140,7 @@
<text v-else> {{ v.text }}</text>
</view>
<template v-if="isDefaultCurrency">
<radio v-if="i == 2" :value="v.value" color="#7dc1f0"
<radio :value="v.value" color="#7dc1f0"
:checked="selectPayIndex == i ? true : false" @click="radioChange(i)" size="10" />
</template>
<template v-else>
@@ -342,7 +353,7 @@ import parse from "../../uni_modules/uview-ui/libs/config/props/parse";
scrollViewHeight: 0,
urlList: {
list: "app/phone.do?getCourseDetail_new",
initPrepareOrder: "/common/buyOrder/initPrepareOrder",
initPrepareOrder: "common/buyOrder/initPrepareOrder",
buyOrder: "book/buyOrder/placeOrder",
curriculumInfo: "app/phone.do?getCourseInfo",
detailInfo: "app/phoneDoctor.do?getTaiHuClassInfo_new",
@@ -361,13 +372,15 @@ import parse from "../../uni_modules/uview-ui/libs/config/props/parse";
backgroundColor: "linear-gradient(90deg, #294a97 0%, #7dc1f0 80%)",
color: "#fff",
}, ],
//立减金额
districtAmount: 0,
orderNumber: 1, //商品数量
};
},
async onLoad(options) {
var that = this;
var mynavData = uni.getStorageSync('mynavData');
this.options = mynavData;
this.goodsDataList = this.options.goods;
if (this.options.sourceType == "curriculum") {
this.goToInfo = {
url: "/pages/curriculum/index/index",
@@ -379,7 +392,7 @@ import parse from "../../uni_modules/uview-ui/libs/config/props/parse";
type: 1,
};
}
that.initPrepareOrder();
that.getData();
},
async onShow() {
var that = this;
@@ -392,13 +405,12 @@ import parse from "../../uni_modules/uview-ui/libs/config/props/parse";
consigneePhone: data.consigneePhone,
};
that.$forceUpdate();
that.getUserAddress();
} else {
}
});
if (that.$platform == "ios") {
if (platform == "ios") {
that.payList = [
{
text: "天医币",
@@ -438,6 +450,88 @@ import parse from "../../uni_modules/uview-ui/libs/config/props/parse";
...mapState(["userInfo"]),
},
methods: {
//获取数据
async getData(){
this.$http.request({
url: 'book/buyOrder/getShopProductListByIds',
method: "POST",
data: {
productIds: this.options.goods[0].productId.toString()
},
header: {
"Content-Type": "application/json",
},
})
.then(async (res) => {
if (res.code == 0) {
this.goodsDataList = res.shopProductList;
//请求VIP还是活动的逻辑
if(this.goodsDataList[0].isVipPrice==1&&
this.goodsDataList[0].vipPrice!=null&&
this.goodsDataList[0].vipPrice!=0){
await this.getVipDiscountAmount();
}else if(this.goodsDataList[0].activityPrice&&
this.goodsDataList[0].activityPrice>0){
await this.getDistrictAmount();
}else{
await this.initPrepareOrder();
}
}
});
},
//VIP立减
async getVipDiscountAmount(){
let data = [];
this.goodsDataList.forEach((item, index) => {
data.push({
productId: item.productId,
quantity: this.orderNumber,
});
});
this.$http.request({
url: 'book/buyOrder/getVipDiscountAmount',
method: "POST",
data: {
productList: data
},
header: {
"Content-Type": "application/json",
},
})
.then(async (res) => {
if (res.code == 0) {
this.districtAmount = res.discountAmount;
await this.initPrepareOrder();
}
});
},
//活动立减
async getDistrictAmount(){
let data = [];
this.goodsDataList.forEach((item, index) => {
data.push({
productId: item.productId,
quantity: this.orderNumber,
});
});
this.$http.request({
url: 'book/buyOrder/getDistrictAmount',
method: "POST",
data: {
productList: data
},
header: {
"Content-Type": "application/json",
},
})
.then(async (res) => {
if (res.code == 0) {
this.districtAmount = res.districtAmount;
await this.initPrepareOrder();
}
});
},
handleChangejf(val) {
var value = val;
this.$nextTick(() => {
@@ -454,7 +548,7 @@ import parse from "../../uni_modules/uview-ui/libs/config/props/parse";
this.jfNumberShow = this.jfNumber.toFixed(2);
}
this.actualPayment = this.totalPrice - this.jfNumber + this.freightNum;
this.actualPayment = this.totalPrice - this.jfNumber -this.districtAmount + this.freightNum;
if (this.actualPayment == 0) {
this.isDefaultCurrency = true;
@@ -492,12 +586,28 @@ import parse from "../../uni_modules/uview-ui/libs/config/props/parse";
type: 2,
},
];
//如果是vip
if(this.goodsDataList[0].activityPrice&&this.goodsDataList[0].activityPrice>0){
this.priceBreakdownList.push({
text: "活动立减",
imgUrl: "",
type: 5,
})
}
//如果是vip
if(this.goodsDataList[0].isVipPrice==1&&this.goodsDataList[0].vipPrice!=null&&this.goodsDataList[0].vipPrice!=0){
this.priceBreakdownList.push({
text: "VIP专享立减",
imgUrl: "",
type: 6,
})
}
var data = {
uid: this.userInfo.id,
productList: this.goodsDataList.map((e) => {
return {
productId: this.goodsDataList[0].productId,
quantity: 1,
quantity: this.orderNumber,
};
}),
};
@@ -594,7 +704,7 @@ import parse from "../../uni_modules/uview-ui/libs/config/props/parse";
products: this.goodsDataList.map((e) => {
return {
productId: e.productId,
quantity: 1,
quantity: this.orderNumber,
};
}),
regionCode: this.addressData.regionCode,
@@ -625,39 +735,47 @@ import parse from "../../uni_modules/uview-ui/libs/config/props/parse";
handleFresh() {
this.show = false;
},
getTotalPrice() {
//获取总金额
async getTotalPrice() {
var s = 0;
var that = this;
for (var i = this.goodsDataList.length - 1; i >= 0; i--) {
if(this.goodsDataList[i].activityPrice&&this.goodsDataList[i].activityPrice>0){
s += this.goodsDataList[i].activityPrice ? this.goodsDataList[i].activityPrice : 0;
}else{
s += this.goodsDataList[i].price ? this.goodsDataList[i].price : 0;
}
s += this.goodsDataList[i].price;
}
that.totalPrice = s;
that.totalPrice = s * that.orderNumber;
if (!this.isShowAddress) {
if (this.initData.user.jf >= that.totalPrice) {
this.jfNumber = that.totalPrice;
this.jfNumberMax = that.totalPrice;
this.jfNumber = that.totalPrice - that.districtAmount;
this.jfNumberMax = that.totalPrice - that.districtAmount;
} else {
this.jfNumber = this.initData.user.jf;
this.jfNumberMax = this.initData.user.jf;
}
if (that.jfNumber == 0 || that.jfNumber == null) {
that.jfNumberShow = "0.00";
that.actualPayment = that.totalPrice;
that.actualPayment = that.totalPrice - that.districtAmount;
} else {
that.jfNumberShow = that.jfNumber.toFixed(2);
that.actualPayment = that.totalPrice - that.jfNumber;
}
that.actualPayment = that.actualPayment + that.freightNum;
that.actualPayment = that.actualPayment + that.freightNum - that.districtAmount;
} else {
that.actualPayment = that.totalPrice + that.freightNum;
that.actualPayment = that.totalPrice + that.freightNum - that.districtAmount;
}
if (this.actualPayment == 0 && !this.isShowAddress) {
this.isDefaultCurrency = true;
this.payList = [
{
text: "天医币",
imgUrl: require("@/static/icon/pay_3.png"),
type: 4,
value: "2",
},
];
this.selectPayIndex = 0;
this.payType = 4;
} else {
this.isDefaultCurrency = false;
}
@@ -717,14 +835,13 @@ import parse from "../../uni_modules/uview-ui/libs/config/props/parse";
shippingMoney: this.freightNum, //运费
remark: this.remark, //备注
couponId: null, //优惠券Id
// isSend: this.isSend,
couponName: "", //优惠券名称
districtMoney: 0, //优惠金额
districtMoney: 0, //活动
productList: this.goodsDataList.map((e) => {
return {
productId: e.productId,
quantity: 1,
quantity: this.orderNumber,
};
}), //订单列表商品
orderType: "order", //订单类型
@@ -732,6 +849,14 @@ import parse from "../../uni_modules/uview-ui/libs/config/props/parse";
appName: "xlkj",
come: "3", //3心灵空间
}
if(this.goodsDataList[0].isVipPrice==1&&
this.goodsDataList[0].vipPrice!=null&&
this.goodsDataList[0].vipPrice!=0){
data.vipDiscountAmount = this.districtAmount; //vip
}else if(this.goodsDataList[0].activityPrice&&
this.goodsDataList[0].activityPrice>0){
data.districtMoney = this.districtAmount; //活动
}
await $http.request({
url: that.urlList.buyOrder,
@@ -851,7 +976,6 @@ import parse from "../../uni_modules/uview-ui/libs/config/props/parse";
}
}
}
uni.removeStorageSync('mynavData');
});
}, 200);
@@ -957,7 +1081,6 @@ import parse from "../../uni_modules/uview-ui/libs/config/props/parse";
.normal_box_top {
width: 100%;
display: flex;
height: 100rpx;
}
}
@@ -1031,7 +1154,6 @@ import parse from "../../uni_modules/uview-ui/libs/config/props/parse";
font-weight: 500;
font-size: 30rpx;
margin-top: 10rpx;
float: left;
margin-bottom: 0rpx;
color: #333;
box-sizing: border-box;
@@ -1088,13 +1210,32 @@ import parse from "../../uni_modules/uview-ui/libs/config/props/parse";
float: right;
margin-right: 10rpx;
color: #333;
// font-family: PangMenZhengDaoBiaoTiTiMianFeiBan;
}
.price_box {
.normal_box_top .price_box {
width: auto;
overflow: hidden;
margin-top: 10rpx;
margin-top: 20rpx;
display: flex;
align-items: center;
justify-content: space-between;
.vip_price_jg{
color: red;
font-weight: bold;
}
.vip_price_text{
color: red;
padding-left: 10rpx;
font-size: 24rpx;
font-weight: normal;
}
.vip_price_line{
color: #666;
text-decoration: line-through;
padding-left: 15rpx;
}
}
.commonTags {
@@ -1416,8 +1557,20 @@ import parse from "../../uni_modules/uview-ui/libs/config/props/parse";
.hasRemark {
color: #333 !important;
}
.bgGrey {
.goods_item_vip{
position: absolute;
left: 0px;
top: 0;
z-index: 99;
background: #ff1f00;
padding: 0 4px;
border-radius: 4px;
line-height: 18px;
font-size: 9px;
color: #fff;
}
.type_text_red{
color: red;
}
</style>