|
@@ -173,11 +173,6 @@
|
|
|
this.totalNum = Number(options.totalNum) || 0
|
|
this.totalNum = Number(options.totalNum) || 0
|
|
|
this.type = options.type
|
|
this.type = options.type
|
|
|
this.isFirstLoad = true;
|
|
this.isFirstLoad = true;
|
|
|
-<<<<<<< HEAD
|
|
|
|
|
-
|
|
|
|
|
-=======
|
|
|
|
|
-
|
|
|
|
|
->>>>>>> 8c8ec24aaf25141f3a66af3c1d21e5415ce32117
|
|
|
|
|
if (options.type == 'win') {
|
|
if (options.type == 'win') {
|
|
|
this.getKey()
|
|
this.getKey()
|
|
|
}
|
|
}
|
|
@@ -291,11 +286,7 @@
|
|
|
computedReward(data).then(res => {
|
|
computedReward(data).then(res => {
|
|
|
if (res.code == 200) {
|
|
if (res.code == 200) {
|
|
|
console.log("查询创建订单信息>>>>", res.data)
|
|
console.log("查询创建订单信息>>>>", res.data)
|
|
|
-<<<<<<< HEAD
|
|
|
|
|
this.orderData = res.data || {}
|
|
this.orderData = res.data || {}
|
|
|
-=======
|
|
|
|
|
- this.orderData = res.data||{}
|
|
|
|
|
->>>>>>> 8c8ec24aaf25141f3a66af3c1d21e5415ce32117
|
|
|
|
|
} else {
|
|
} else {
|
|
|
uni.showToast({
|
|
uni.showToast({
|
|
|
title: res.msg,
|
|
title: res.msg,
|
|
@@ -326,33 +317,21 @@
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-<<<<<<< HEAD
|
|
|
|
|
- return createliveOrder(data).then(res => {
|
|
|
|
|
- if (res.code == 200) {
|
|
|
|
|
- this.orderList = res.order;
|
|
|
|
|
- return res.order;
|
|
|
|
|
-=======
|
|
|
|
|
return createliveOrder(data).then(res => {
|
|
return createliveOrder(data).then(res => {
|
|
|
if (res.code == 200) {
|
|
if (res.code == 200) {
|
|
|
this.orderList = res.order;
|
|
this.orderList = res.order;
|
|
|
return res.order;
|
|
return res.order;
|
|
|
->>>>>>> 8c8ec24aaf25141f3a66af3c1d21e5415ce32117
|
|
|
|
|
} else {
|
|
} else {
|
|
|
uni.showToast({
|
|
uni.showToast({
|
|
|
title: res.msg,
|
|
title: res.msg,
|
|
|
icon: 'none'
|
|
icon: 'none'
|
|
|
});
|
|
});
|
|
|
-<<<<<<< HEAD
|
|
|
|
|
- throw new Error(res.msg);
|
|
|
|
|
-=======
|
|
|
|
|
throw new Error(res.msg);
|
|
throw new Error(res.msg);
|
|
|
->>>>>>> 8c8ec24aaf25141f3a66af3c1d21e5415ce32117
|
|
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
},
|
|
},
|
|
|
// 创建抽奖订单
|
|
// 创建抽奖订单
|
|
|
createRewardOrder() {
|
|
createRewardOrder() {
|
|
|
-<<<<<<< HEAD
|
|
|
|
|
let data = {
|
|
let data = {
|
|
|
cityId: this.cityId,
|
|
cityId: this.cityId,
|
|
|
liveId: this.liveId,
|
|
liveId: this.liveId,
|
|
@@ -379,33 +358,6 @@
|
|
|
throw new Error(res.msg);
|
|
throw new Error(res.msg);
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
-=======
|
|
|
|
|
- let data = {
|
|
|
|
|
- cityId: this.cityId,
|
|
|
|
|
- liveId: this.liveId,
|
|
|
|
|
- orderKey: this.orderKey,
|
|
|
|
|
- userName: this.address.realName,
|
|
|
|
|
- userPhone: this.address.phone,
|
|
|
|
|
- userAddress: this.address.province + ' ' + this.address.city + ' ' + this.address.district + ' ' + this.address.detail,
|
|
|
|
|
- cartId: "5",
|
|
|
|
|
- productId: this.productId,
|
|
|
|
|
- totalNum: this.totalNum,
|
|
|
|
|
- couponUserId: this.couponUserId
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- return createReward(data).then(res => {
|
|
|
|
|
- if (res.code == 200) {
|
|
|
|
|
- this.orderList = res.order || {};
|
|
|
|
|
- return res.order || {};
|
|
|
|
|
- } else {
|
|
|
|
|
- uni.showToast({
|
|
|
|
|
- title: res.msg,
|
|
|
|
|
- icon: 'none'
|
|
|
|
|
- });
|
|
|
|
|
- throw new Error(res.msg);
|
|
|
|
|
- }
|
|
|
|
|
- });
|
|
|
|
|
->>>>>>> 8c8ec24aaf25141f3a66af3c1d21e5415ce32117
|
|
|
|
|
},
|
|
},
|
|
|
couponSelect(item) {
|
|
couponSelect(item) {
|
|
|
this.couponText = "-¥" + (item.couponPrice || 0).toFixed(2);
|
|
this.couponText = "-¥" + (item.couponPrice || 0).toFixed(2);
|
|
@@ -423,11 +375,8 @@
|
|
|
if (this.couponsList.length === 0 || !this.isFirstLoad) {
|
|
if (this.couponsList.length === 0 || !this.isFirstLoad) {
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
-<<<<<<< HEAD
|
|
|
|
|
const availableCoupons = this.couponsList.filter(item =>
|
|
const availableCoupons = this.couponsList.filter(item =>
|
|
|
-=======
|
|
|
|
|
- const availableCoupons = this.couponsList.filter(item =>
|
|
|
|
|
->>>>>>> 8c8ec24aaf25141f3a66af3c1d21e5415ce32117
|
|
|
|
|
|
|
+
|
|
|
item.status === 0 && item.useMinPrice <= (this.orderData.totalPrice || 0)
|
|
item.status === 0 && item.useMinPrice <= (this.orderData.totalPrice || 0)
|
|
|
);
|
|
);
|
|
|
if (availableCoupons.length === 0) {
|
|
if (availableCoupons.length === 0) {
|
|
@@ -437,11 +386,7 @@
|
|
|
const maxCoupon = availableCoupons[0];
|
|
const maxCoupon = availableCoupons[0];
|
|
|
this.couponText = "-¥" + (maxCoupon.couponPrice || 0).toFixed(2);
|
|
this.couponText = "-¥" + (maxCoupon.couponPrice || 0).toFixed(2);
|
|
|
this.couponUserId = maxCoupon.id;
|
|
this.couponUserId = maxCoupon.id;
|
|
|
-<<<<<<< HEAD
|
|
|
|
|
|
|
|
|
|
-=======
|
|
|
|
|
-
|
|
|
|
|
->>>>>>> 8c8ec24aaf25141f3a66af3c1d21e5415ce32117
|
|
|
|
|
console.log('自动选择最大优惠券:', maxCoupon);
|
|
console.log('自动选择最大优惠券:', maxCoupon);
|
|
|
this.isFirstLoad = false;
|
|
this.isFirstLoad = false;
|
|
|
// 重新计算订单价格
|
|
// 重新计算订单价格
|
|
@@ -477,7 +422,6 @@
|
|
|
},
|
|
},
|
|
|
// 提交订单
|
|
// 提交订单
|
|
|
async submitOrder() {
|
|
async submitOrder() {
|
|
|
-<<<<<<< HEAD
|
|
|
|
|
try {
|
|
try {
|
|
|
if (this.orderKey == null) {
|
|
if (this.orderKey == null) {
|
|
|
uni.showToast({
|
|
uni.showToast({
|
|
@@ -800,328 +744,3 @@
|
|
|
line-height: 0.44 * 100rpx;
|
|
line-height: 0.44 * 100rpx;
|
|
|
background-color: red;
|
|
background-color: red;
|
|
|
}
|
|
}
|
|
|
-=======
|
|
|
|
|
- try {
|
|
|
|
|
- if (this.orderKey == null) {
|
|
|
|
|
- uni.showToast({
|
|
|
|
|
- icon: 'none',
|
|
|
|
|
- title: '订单KEY不存在',
|
|
|
|
|
- });
|
|
|
|
|
- return;
|
|
|
|
|
- }
|
|
|
|
|
- if (this.address == null) {
|
|
|
|
|
- uni.showToast({
|
|
|
|
|
- icon: 'none',
|
|
|
|
|
- title: '收货地址不能为空',
|
|
|
|
|
- });
|
|
|
|
|
- return;
|
|
|
|
|
- }
|
|
|
|
|
- let orderList;
|
|
|
|
|
- if (this.type == "win") {
|
|
|
|
|
- orderList = await this.createRewardOrder(); // 中奖订单
|
|
|
|
|
- } else {
|
|
|
|
|
- orderList = await this.createLiveOrder(); // 购买订单
|
|
|
|
|
- }
|
|
|
|
|
- console.log("orderList>>", orderList)
|
|
|
|
|
- const orderListStr = encodeURIComponent(JSON.stringify(orderList));
|
|
|
|
|
- uni.navigateTo({
|
|
|
|
|
- url: `/pages_shopping/live/paymentOrder?orderList=${orderListStr}&couponUserId=${this.couponUserId}&type=${this.type}`
|
|
|
|
|
- });
|
|
|
|
|
- } catch (error) {
|
|
|
|
|
- console.error('提交订单错误:', error);
|
|
|
|
|
- uni.showToast({
|
|
|
|
|
- title: error.message || '提交订单失败',
|
|
|
|
|
- icon: 'none'
|
|
|
|
|
- });
|
|
|
|
|
- }
|
|
|
|
|
- },
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
-</script>
|
|
|
|
|
-<style lang="scss">
|
|
|
|
|
- .inner-box {
|
|
|
|
|
- padding: 20rpx 20rpx 140rpx;
|
|
|
|
|
-
|
|
|
|
|
- .address-box {
|
|
|
|
|
- margin-bottom: 20rpx;
|
|
|
|
|
- box-sizing: border-box;
|
|
|
|
|
- min-height: 171rpx;
|
|
|
|
|
- background: #FFFFFF;
|
|
|
|
|
- border-radius: 16rpx;
|
|
|
|
|
- background-repeat: no-repeat;
|
|
|
|
|
- background-size: 100% 30rpx;
|
|
|
|
|
- background-position: left bottom;
|
|
|
|
|
- padding: 38rpx 30rpx 36rpx;
|
|
|
|
|
- display: flex;
|
|
|
|
|
- align-items: center;
|
|
|
|
|
- justify-content: space-between;
|
|
|
|
|
-
|
|
|
|
|
- .left {
|
|
|
|
|
- width: 92%;
|
|
|
|
|
-
|
|
|
|
|
- .name-box {
|
|
|
|
|
- display: flex;
|
|
|
|
|
- align-items: center;
|
|
|
|
|
-
|
|
|
|
|
- .text {
|
|
|
|
|
- font-size: 32rpx;
|
|
|
|
|
- font-family: PingFang SC;
|
|
|
|
|
- font-weight: bold;
|
|
|
|
|
- color: #111111;
|
|
|
|
|
- line-height: 1;
|
|
|
|
|
-
|
|
|
|
|
- &.name {
|
|
|
|
|
- margin-right: 30rpx;
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- .address {
|
|
|
|
|
- font-size: 28rpx;
|
|
|
|
|
- font-family: PingFang SC;
|
|
|
|
|
- font-weight: 500;
|
|
|
|
|
- color: #666666;
|
|
|
|
|
- line-height: 42rpx;
|
|
|
|
|
- text-align: left;
|
|
|
|
|
- margin-top: 23rpx;
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- .arrow-box {
|
|
|
|
|
- width: 12rpx;
|
|
|
|
|
- height: 23rpx;
|
|
|
|
|
- display: flex;
|
|
|
|
|
- align-items: cenetr;
|
|
|
|
|
- justify-content: cenetr;
|
|
|
|
|
-
|
|
|
|
|
- image {
|
|
|
|
|
- width: 100%;
|
|
|
|
|
- height: 100%;
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- .price-info {
|
|
|
|
|
- background: #FFFFFF;
|
|
|
|
|
- border-radius: 16rpx;
|
|
|
|
|
-
|
|
|
|
|
- &-title {
|
|
|
|
|
- padding: 30rpx 30rpx 20rpx 30rpx;
|
|
|
|
|
- font-family: PingFang SC, PingFang SC;
|
|
|
|
|
- font-weight: 500;
|
|
|
|
|
- font-size: 30rpx;
|
|
|
|
|
- color: #111;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- &-unit {
|
|
|
|
|
- font-size: 24rpx;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- &-num {
|
|
|
|
|
- font-size: 28rpx;
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- .points {
|
|
|
|
|
- height: 88rpx;
|
|
|
|
|
- padding: 0 30rpx;
|
|
|
|
|
- background: #FFFFFF;
|
|
|
|
|
- border-radius: 16rpx;
|
|
|
|
|
-
|
|
|
|
|
- display: flex;
|
|
|
|
|
- align-items: center;
|
|
|
|
|
- justify-content: space-between;
|
|
|
|
|
-
|
|
|
|
|
- .left {
|
|
|
|
|
- display: flex;
|
|
|
|
|
- align-items: center;
|
|
|
|
|
-
|
|
|
|
|
- image {
|
|
|
|
|
- width: 28rpx;
|
|
|
|
|
- height: 28rpx;
|
|
|
|
|
- margin-right: 20rpx;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- .text {
|
|
|
|
|
- font-size: 28rpx;
|
|
|
|
|
- font-family: PingFang SC;
|
|
|
|
|
- font-weight: 500;
|
|
|
|
|
- color: #666666;
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- .right {
|
|
|
|
|
- display: flex;
|
|
|
|
|
- align-items: center;
|
|
|
|
|
-
|
|
|
|
|
- .text {
|
|
|
|
|
- font-size: 28rpx;
|
|
|
|
|
- font-family: PingFang SC;
|
|
|
|
|
- font-weight: 500;
|
|
|
|
|
- color: #111111;
|
|
|
|
|
-
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- image {
|
|
|
|
|
- margin-left: 15rpx;
|
|
|
|
|
- width: 14rpx;
|
|
|
|
|
- height: 24rpx;
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
- .btn-foot {
|
|
|
|
|
- box-sizing: border-box;
|
|
|
|
|
- width: 100%;
|
|
|
|
|
- height: 121rpx;
|
|
|
|
|
- background: #FFFFFF;
|
|
|
|
|
- padding: 16rpx 30rpx 16rpx 60rpx;
|
|
|
|
|
- display: flex;
|
|
|
|
|
- align-items: center;
|
|
|
|
|
- justify-content: flex-end;
|
|
|
|
|
- position: fixed;
|
|
|
|
|
- left: 0;
|
|
|
|
|
- bottom: 0;
|
|
|
|
|
- z-index: 99;
|
|
|
|
|
-
|
|
|
|
|
- .right {
|
|
|
|
|
- display: flex;
|
|
|
|
|
- align-items: center;
|
|
|
|
|
-
|
|
|
|
|
- .total {
|
|
|
|
|
- display: flex;
|
|
|
|
|
- align-items: flex-end;
|
|
|
|
|
- margin-right: 36rpx;
|
|
|
|
|
-
|
|
|
|
|
- .label {
|
|
|
|
|
- font-size: 26rpx;
|
|
|
|
|
- font-family: PingFang SC;
|
|
|
|
|
- font-weight: 500;
|
|
|
|
|
- color: #999999;
|
|
|
|
|
- line-height: 1.5;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- .price {
|
|
|
|
|
- display: flex;
|
|
|
|
|
- align-items: flex-end;
|
|
|
|
|
-
|
|
|
|
|
- .unit {
|
|
|
|
|
- font-size: 32rpx;
|
|
|
|
|
- font-family: PingFang SC;
|
|
|
|
|
- font-weight: bold;
|
|
|
|
|
- color: #FF6633;
|
|
|
|
|
- line-height: 1.2;
|
|
|
|
|
- margin-right: 10rpx;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- .num {
|
|
|
|
|
- font-size: 50rpx;
|
|
|
|
|
- font-family: PingFang SC;
|
|
|
|
|
- font-weight: bold;
|
|
|
|
|
- color: #FF6633;
|
|
|
|
|
- line-height: 1;
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- .btn {
|
|
|
|
|
- width: 200rpx;
|
|
|
|
|
- height: 88rpx;
|
|
|
|
|
- line-height: 88rpx;
|
|
|
|
|
- text-align: center;
|
|
|
|
|
- font-size: 30rpx;
|
|
|
|
|
- font-family: PingFang SC;
|
|
|
|
|
- font-weight: bold;
|
|
|
|
|
- color: #FFFFFF;
|
|
|
|
|
- background: #2BC7B9;
|
|
|
|
|
- border-radius: 44rpx;
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- .coupon {
|
|
|
|
|
- height: 100%;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- /*优惠券列表公共*/
|
|
|
|
|
- .coupon-list {}
|
|
|
|
|
-
|
|
|
|
|
- .coupon-list .item {
|
|
|
|
|
- display: flex;
|
|
|
|
|
- flex-direction: column;
|
|
|
|
|
- justify-content: center;
|
|
|
|
|
- align-items: center;
|
|
|
|
|
- width: 100%;
|
|
|
|
|
- height: 1.7 * 100rpx;
|
|
|
|
|
- margin-bottom: 0.16 * 100rpx;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- .coupon-list .item .money {
|
|
|
|
|
- background-size: 100% 100%;
|
|
|
|
|
- width: 2.4 * 100rpx;
|
|
|
|
|
- height: 100%;
|
|
|
|
|
- color: #fff;
|
|
|
|
|
- font-size: 0.36 * 100rpx;
|
|
|
|
|
- font-weight: bold;
|
|
|
|
|
- text-align: center;
|
|
|
|
|
- display: flex;
|
|
|
|
|
- flex-direction: column;
|
|
|
|
|
- align-items: center;
|
|
|
|
|
- justify-content: center;
|
|
|
|
|
- position: relative;
|
|
|
|
|
-
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- .coupon-list .item .money .img {
|
|
|
|
|
- position: absolute;
|
|
|
|
|
- width: 2.4 * 100rpx;
|
|
|
|
|
- height: 100%;
|
|
|
|
|
- color: #fff;
|
|
|
|
|
-
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- .coupon-list .item .money .num {
|
|
|
|
|
- font-size: 0.6 * 100rpx;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- .coupon-list .item .money .pic-num {
|
|
|
|
|
- font-size: 20rpx;
|
|
|
|
|
- z-index: 99;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
- .coupon-list .item .text {
|
|
|
|
|
- width: 4.5 * 100rpx;
|
|
|
|
|
- padding: 0 0.17 * 100rpx 0 0.24 * 100rpx;
|
|
|
|
|
- background-color: #fff;
|
|
|
|
|
- box-sizing: border-box;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- .coupon-list .item .text .condition {
|
|
|
|
|
- font-size: 0.3 * 100rpx;
|
|
|
|
|
- color: #282828;
|
|
|
|
|
- height: 0.93 * 100rpx;
|
|
|
|
|
- line-height: 0.93 * 100rpx;
|
|
|
|
|
- border-bottom: 1px solid #f0f0f0;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- .coupon-list .item .text .data {
|
|
|
|
|
- font-size: 0.2 * 100rpx;
|
|
|
|
|
- color: #999;
|
|
|
|
|
- height: 0.76 * 100rpx;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- .coupon-list .item .text .data .bnt {
|
|
|
|
|
- width: 1.36 * 100rpx;
|
|
|
|
|
- height: 0.44 * 100rpx;
|
|
|
|
|
- border-radius: 0.22 * 100rpx;
|
|
|
|
|
- font-size: 0.22 * 100rpx;
|
|
|
|
|
- color: #fff;
|
|
|
|
|
- text-align: center;
|
|
|
|
|
- line-height: 0.44 * 100rpx;
|
|
|
|
|
- background-color: red;
|
|
|
|
|
- }
|
|
|
|
|
->>>>>>> 8c8ec24aaf25141f3a66af3c1d21e5415ce32117
|
|
|
|
|
-</style>
|
|
|