新增订单详情页跳转商品详情页
This commit is contained in:
parent
045b56b98d
commit
08d3c6bab0
@ -9,4 +9,5 @@ export const apiArr = {
|
|||||||
updateApply: "/api/v2/wechat/commodity/after-sales/update-apply", //商品订单售后修改申请
|
updateApply: "/api/v2/wechat/commodity/after-sales/update-apply", //商品订单售后修改申请
|
||||||
createReview: "/api/v2/wechat/commodity/review/create", //创建订单评价
|
createReview: "/api/v2/wechat/commodity/review/create", //创建订单评价
|
||||||
orderRefund: "/api/v2/wechat/commodity/order/refund", //商品订单退款
|
orderRefund: "/api/v2/wechat/commodity/order/refund", //商品订单退款
|
||||||
|
selectGoodsDetail: "/api/v2/wechat/commodity/goods-info/by-goods", //根据货品id查询商品货品信息
|
||||||
};
|
};
|
||||||
|
|||||||
661
packages/myOrders/goodDetails/index.css
Normal file
661
packages/myOrders/goodDetails/index.css
Normal file
@ -0,0 +1,661 @@
|
|||||||
|
page {
|
||||||
|
background-color: #fff;
|
||||||
|
padding-bottom: 20rpx;
|
||||||
|
min-height: 100vh;
|
||||||
|
}
|
||||||
|
|
||||||
|
image {
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.header {
|
||||||
|
position: absolute;
|
||||||
|
z-index: 2;
|
||||||
|
width: 750rpx;
|
||||||
|
height: 243rpx;
|
||||||
|
background: linear-gradient(0deg, rgba(255, 255, 255, 0) 0%, #FFFFFF 100%);
|
||||||
|
}
|
||||||
|
|
||||||
|
.searchBox {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
z-index: 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
.isDay {
|
||||||
|
background-color: orangered;
|
||||||
|
height: 35rpx;
|
||||||
|
border-radius: 5rpx;
|
||||||
|
color: white;
|
||||||
|
font-size: 22rpx;
|
||||||
|
text-align: center;
|
||||||
|
justify-content: center;
|
||||||
|
padding: 5rpx 10rpx;
|
||||||
|
display: flex;
|
||||||
|
}
|
||||||
|
|
||||||
|
.tag {
|
||||||
|
background-color: orangered;
|
||||||
|
color: white;
|
||||||
|
font-size: 40rpx;
|
||||||
|
padding: 5rpx 10rpx;
|
||||||
|
border-radius: 5rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.tag-img {
|
||||||
|
position: absolute;
|
||||||
|
top: 20%;
|
||||||
|
left: 0;
|
||||||
|
z-index: 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
.searchBox_left {
|
||||||
|
box-sizing: border-box;
|
||||||
|
padding-left: 20rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.swiper {
|
||||||
|
height: 750rpx;
|
||||||
|
width: 750rpx;
|
||||||
|
position: relative;
|
||||||
|
}
|
||||||
|
|
||||||
|
.swiper swiper {
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.swiper .NumDot {
|
||||||
|
width: 100rpx;
|
||||||
|
height: 50rpx;
|
||||||
|
background: rgba(0, 0, 0, 0.5);
|
||||||
|
border-radius: 100rpx 100rpx 100rpx 100rpx;
|
||||||
|
font-size: 30rpx;
|
||||||
|
color: #FFFFFF;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
position: absolute;
|
||||||
|
right: 27rpx;
|
||||||
|
bottom: 20rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.Money {
|
||||||
|
display: flex;
|
||||||
|
align-items: flex-end;
|
||||||
|
margin-top: 40rpx;
|
||||||
|
font-weight: bold;
|
||||||
|
font-size: 80rpx;
|
||||||
|
color: #FF370B;
|
||||||
|
margin-left: 12rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.MoneyMark {
|
||||||
|
font-size: 60rpx;
|
||||||
|
padding-bottom: 6rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.MoneyUnit {
|
||||||
|
font-size: 40rpx;
|
||||||
|
font-weight: 400;
|
||||||
|
padding-bottom: 10rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.oldMoney {
|
||||||
|
font-size: 40rpx;
|
||||||
|
color: #C7C7C7;
|
||||||
|
margin-left: 30rpx;
|
||||||
|
padding-bottom: 4rpx;
|
||||||
|
text-decoration: line-through;
|
||||||
|
}
|
||||||
|
|
||||||
|
.GGBox {
|
||||||
|
margin: 0 20rpx;
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
margin-top: 30rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.GG_rigth {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.GG_left {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
flex: 1;
|
||||||
|
flex-wrap: nowrap;
|
||||||
|
overflow: hidden;
|
||||||
|
overflow-x: auto;
|
||||||
|
margin-right: 40rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 促销信息样式 */
|
||||||
|
.promotions-container {
|
||||||
|
padding: 15rpx;
|
||||||
|
background-color: #FFF;
|
||||||
|
border-radius: 10rpx;
|
||||||
|
margin: 15rpx 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.promotion-item {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
margin-bottom: 20rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.promotion-tag {
|
||||||
|
width: 80rpx;
|
||||||
|
text-align: center;
|
||||||
|
background-color: #ffe8e5;
|
||||||
|
color: #ff5029;
|
||||||
|
padding: 5rpx 15rpx;
|
||||||
|
border-radius: 10rpx;
|
||||||
|
font-size: 26rpx;
|
||||||
|
margin-right: 30rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.promotion-content {
|
||||||
|
font-size: 26rpx;
|
||||||
|
color: #333;
|
||||||
|
}
|
||||||
|
|
||||||
|
.promotion-content1 {
|
||||||
|
width: auto;
|
||||||
|
padding: 5rpx 10rpx;
|
||||||
|
text-align: center;
|
||||||
|
background-color: #ff6749;
|
||||||
|
color: white;
|
||||||
|
border-radius: 10rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.GG_Item {
|
||||||
|
font-size: 26rpx;
|
||||||
|
color: #999999;
|
||||||
|
background: #F6F7FB;
|
||||||
|
border-radius: 10rpx 10rpx 10rpx 10rpx;
|
||||||
|
padding: 12rpx 16rpx;
|
||||||
|
white-space: nowrap;
|
||||||
|
margin-right: 20rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.Tit {
|
||||||
|
font-size: 36rpx;
|
||||||
|
color: #222222;
|
||||||
|
margin: 0 20rpx;
|
||||||
|
margin-top: 20rpx;
|
||||||
|
font-weight: 700;
|
||||||
|
display: flex;
|
||||||
|
}
|
||||||
|
|
||||||
|
.Msg {
|
||||||
|
font-size: 26rpx;
|
||||||
|
color: #999999;
|
||||||
|
margin: 0 20rpx;
|
||||||
|
margin-top: 20rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.GoodsMsg {
|
||||||
|
/* font-size: 30rpx; */
|
||||||
|
color: #222222;
|
||||||
|
margin: 0 20rpx;
|
||||||
|
margin-top: 55rpx;
|
||||||
|
font-weight: 700;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
.Msg_Item {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
border-bottom: 1rpx solid #EBEBEB;
|
||||||
|
;
|
||||||
|
}
|
||||||
|
|
||||||
|
.Msg_ItemTit {
|
||||||
|
width: 120rpx;
|
||||||
|
margin-right: 100rpx;
|
||||||
|
font-size: 26rpx;
|
||||||
|
color: #999999;
|
||||||
|
margin: 0 20rpx;
|
||||||
|
padding: 30rpx 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.Msg_ItemCon {
|
||||||
|
font-size: 26rpx;
|
||||||
|
color: #222222;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.Msg_ItemCon image {
|
||||||
|
width: 28rpx;
|
||||||
|
height: 28rpx;
|
||||||
|
margin-left: 10rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.GoosMsg {
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.GoosMsg image {
|
||||||
|
width: 100%;
|
||||||
|
height: auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
.Car {
|
||||||
|
width: 750rpx;
|
||||||
|
height: 123rpx;
|
||||||
|
background: #FFFFFF;
|
||||||
|
box-shadow: 3rpx -3rpx 15rpx 0rpx rgba(255, 27, 27, 0.05);
|
||||||
|
display: flex;
|
||||||
|
position: fixed;
|
||||||
|
left: 0;
|
||||||
|
right: 0;
|
||||||
|
bottom: 0;
|
||||||
|
box-sizing: border-box;
|
||||||
|
padding: 0 30rpx;
|
||||||
|
justify-content: space-between;
|
||||||
|
}
|
||||||
|
|
||||||
|
.car_left {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
font-size: 24rpx;
|
||||||
|
color: #222222;
|
||||||
|
}
|
||||||
|
|
||||||
|
.car_left image {
|
||||||
|
width: 40rpx;
|
||||||
|
height: 40rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.car_right {
|
||||||
|
width: 470rpx;
|
||||||
|
height: 70rpx;
|
||||||
|
background: linear-gradient(91deg, #FF7658 0%, #FF370B 100%);
|
||||||
|
border-radius: 100rpx 100rpx 100rpx 100rpx;
|
||||||
|
font-size: 36rpx;
|
||||||
|
color: #FFFFFF;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
margin-top: 26rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.car_right_disabled {
|
||||||
|
background: #CCCCCC;
|
||||||
|
color: #FFFFFF;
|
||||||
|
}
|
||||||
|
|
||||||
|
.cars {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
position: relative;
|
||||||
|
}
|
||||||
|
|
||||||
|
.share {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
margin-right: 36rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.u-badge {
|
||||||
|
position: absolute;
|
||||||
|
right: 0;
|
||||||
|
top: -10rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.car_right .input {
|
||||||
|
font-size: 36rpx;
|
||||||
|
color: #FFFFFF;
|
||||||
|
font-weight: 700;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
.shadow {
|
||||||
|
background: rgba(0, 0, 0, 0.4);
|
||||||
|
position: fixed;
|
||||||
|
left: 0;
|
||||||
|
right: 0;
|
||||||
|
top: 0;
|
||||||
|
bottom: 0;
|
||||||
|
z-index: 9;
|
||||||
|
}
|
||||||
|
|
||||||
|
.shadowBox1 {
|
||||||
|
height: 250rpx;
|
||||||
|
width: 100%;
|
||||||
|
background-color: #fff;
|
||||||
|
position: absolute;
|
||||||
|
left: 0;
|
||||||
|
bottom: 0;
|
||||||
|
display: flex;
|
||||||
|
}
|
||||||
|
|
||||||
|
.shadowBox1Item_btn{
|
||||||
|
width: 150rpx;
|
||||||
|
height: 170rpx;
|
||||||
|
opacity:0;
|
||||||
|
position: absolute;
|
||||||
|
left: 100rpx;
|
||||||
|
top: 40rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.shadowBox1Item {
|
||||||
|
flex: 1;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
font-size: 26rpx;
|
||||||
|
color: #000000;
|
||||||
|
}
|
||||||
|
|
||||||
|
.shadowBox1Item image {
|
||||||
|
width: 100rpx;
|
||||||
|
height: 100rpx;
|
||||||
|
margin-bottom: 26rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.shadowBox2 {
|
||||||
|
position: absolute;
|
||||||
|
left: 50%;
|
||||||
|
top: 50%;
|
||||||
|
transform: translate(-50%, -50%);
|
||||||
|
width: auto;
|
||||||
|
height: auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
.shadowBox_img {
|
||||||
|
width: 600rpx;
|
||||||
|
height: 945rpx;
|
||||||
|
background: url('https://wechat-img-file.oss-cn-beijing.aliyuncs.com/property-img-file/shop_share_bg.png') no-repeat;
|
||||||
|
background-size: 100% 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.shadowBox_btn {
|
||||||
|
font-size: 36rpx;
|
||||||
|
color: #FFFFFF;
|
||||||
|
width: 600rpx;
|
||||||
|
height: 90rpx;
|
||||||
|
background: linear-gradient(91deg, #FF7658 0%, #FF370B 100%);
|
||||||
|
border-radius: 100rpx 100rpx 100rpx 100rpx;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
margin-top: 60rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.boxshadow_tit {
|
||||||
|
font-size: 32rpx;
|
||||||
|
color: #222222;
|
||||||
|
text-align: center;
|
||||||
|
padding-top: 40rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.boxshadow_img {
|
||||||
|
width: 450rpx;
|
||||||
|
height: 600rpx;
|
||||||
|
margin: 0 auto;
|
||||||
|
margin-top: 40rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.line {
|
||||||
|
margin: 0 auto;
|
||||||
|
width: 556rpx;
|
||||||
|
height: 1rpx;
|
||||||
|
border-bottom: 1rpx dashed #E9E9E9;
|
||||||
|
margin-top: 40rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
.shadowBoxInfo {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
margin-left: 62rpx;
|
||||||
|
margin-top: 11rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.shadowboxInfo_left {
|
||||||
|
width: 130rpx;
|
||||||
|
height: 130rpx;
|
||||||
|
background: #EFEFEF;
|
||||||
|
border-radius: 50%;
|
||||||
|
overflow: hidden;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
margin-right: 36rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.shadowboxInfo_right_1 {
|
||||||
|
font-size: 32rpx;
|
||||||
|
color: #222222;
|
||||||
|
margin-bottom: 10rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.shadowboxInfo_right_2 {
|
||||||
|
font-size: 26rpx;
|
||||||
|
color: #999999;
|
||||||
|
}
|
||||||
|
|
||||||
|
.active {
|
||||||
|
background: #FF370B;
|
||||||
|
color: #fff;
|
||||||
|
}
|
||||||
|
|
||||||
|
.priceInfo {
|
||||||
|
height: 450rpx;
|
||||||
|
padding: 20rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.priceInfo-title {
|
||||||
|
/* font-size: 30rpx; */
|
||||||
|
font-weight: bolder;
|
||||||
|
margin: 15rpx 0 20rpx 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.priceInfo-content {
|
||||||
|
font-size: 26rpx;
|
||||||
|
color: #9c9c9c;
|
||||||
|
line-height: 1.7;
|
||||||
|
}
|
||||||
|
|
||||||
|
.priceInfo-content-title {
|
||||||
|
font-size: 28rpx;
|
||||||
|
color: #333;
|
||||||
|
}
|
||||||
|
|
||||||
|
.fenge {
|
||||||
|
width: 100%;
|
||||||
|
height: 15rpx;
|
||||||
|
background-color: #f5f7fb;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 评价部分样式 */
|
||||||
|
.reviews-section {
|
||||||
|
padding: 20rpx;
|
||||||
|
background-color: #fff;
|
||||||
|
margin-bottom: 20rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.reviews-header {
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
align-items: center;
|
||||||
|
margin-bottom: 20rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.reviews-header h3 {
|
||||||
|
/* font-size: 32rpx; */
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
|
||||||
|
.view-all {
|
||||||
|
color: #999;
|
||||||
|
font-size: 26rpx;
|
||||||
|
background: none;
|
||||||
|
border: none;
|
||||||
|
padding: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.reviews-list {
|
||||||
|
margin-top: 20rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.review-item {
|
||||||
|
padding: 20rpx 0;
|
||||||
|
border-bottom: 1rpx solid #f5f5f5;
|
||||||
|
}
|
||||||
|
|
||||||
|
.review-user {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
margin-bottom: 15rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.user-avatar {
|
||||||
|
width: 60rpx;
|
||||||
|
height: 60rpx;
|
||||||
|
border-radius: 50%;
|
||||||
|
margin-right: 15rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.user-info {
|
||||||
|
flex: 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
.user-name {
|
||||||
|
font-size: 28rpx;
|
||||||
|
font-weight: 500;
|
||||||
|
}
|
||||||
|
|
||||||
|
.user-purchase {
|
||||||
|
font-size: 24rpx;
|
||||||
|
color: #999;
|
||||||
|
margin: 10rpx 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.review-content {
|
||||||
|
font-size: 27rpx;
|
||||||
|
line-height: 1.5;
|
||||||
|
margin-bottom: 15rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.review-images {
|
||||||
|
display: flex;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
gap: 10rpx;
|
||||||
|
margin-bottom: 15rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.review-img {
|
||||||
|
width: 140rpx;
|
||||||
|
height: 140rpx;
|
||||||
|
border-radius: 8rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.review-time {
|
||||||
|
font-size: 24rpx;
|
||||||
|
color: #999;
|
||||||
|
text-align: right;
|
||||||
|
}
|
||||||
|
|
||||||
|
.popup-header {
|
||||||
|
display: flex;
|
||||||
|
width: 90%;
|
||||||
|
padding-left: 80rpx;
|
||||||
|
margin: 20rpx 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.popup-header-h3 {
|
||||||
|
font-weight: bold;
|
||||||
|
margin: 0 auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
.popup-header-view {
|
||||||
|
font-size: 24rpx;
|
||||||
|
color: #999;
|
||||||
|
margin-right: 30rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.temp {
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.temp1 {
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
align-items: center;
|
||||||
|
font-size: 24rpx;
|
||||||
|
color: #959595;
|
||||||
|
margin: 20rpx 0 5rpx 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.temp_img {
|
||||||
|
width: 35rpx;
|
||||||
|
height: 35rpx;
|
||||||
|
margin-right: 10rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.temp_img1 {
|
||||||
|
width: 30rpx;
|
||||||
|
height: 30rpx;
|
||||||
|
margin: 5rpx 5rpx 0 5rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.itemSizeBox {
|
||||||
|
margin: 30rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.itemSize {
|
||||||
|
font-size: 26rpx;
|
||||||
|
color: #333;
|
||||||
|
background: #F6F7FB;
|
||||||
|
border-radius: 40rpx;
|
||||||
|
padding: 10rpx 15rpx;
|
||||||
|
white-space: nowrap;
|
||||||
|
}
|
||||||
|
|
||||||
|
.itemSize_active {
|
||||||
|
background: #FF370B;
|
||||||
|
color: #fff;
|
||||||
|
}
|
||||||
|
|
||||||
|
.itemSize-img {
|
||||||
|
width: 100rpx;
|
||||||
|
height: 100rpx;
|
||||||
|
margin-right: 30rpx;
|
||||||
|
border-radius: 20rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.itemSize_top {
|
||||||
|
display: flex;
|
||||||
|
margin-left: 30rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.itemSize_info {
|
||||||
|
margin-top: 10rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.itemSize_name {
|
||||||
|
font-size: 28rpx;
|
||||||
|
font-weight: 500;
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
|
||||||
|
.itemSize_price {
|
||||||
|
font-size: 28rpx;
|
||||||
|
font-weight: 500;
|
||||||
|
margin-top: 10rpx;
|
||||||
|
color: red;
|
||||||
|
}
|
||||||
629
packages/myOrders/goodDetails/index.vue
Normal file
629
packages/myOrders/goodDetails/index.vue
Normal file
@ -0,0 +1,629 @@
|
|||||||
|
<template>
|
||||||
|
<view>
|
||||||
|
<view class="swiper">
|
||||||
|
<view v-if="currentGG.is_same_day" class="tag tag-img">
|
||||||
|
当日达
|
||||||
|
</view>
|
||||||
|
<swiper :indicator-dots="false" :autoplay="true" :interval="3000" :duration="1000" @change="changeIndex">
|
||||||
|
<swiper-item v-for="(item, index) in currentGG.goods_carousel" :key="index">
|
||||||
|
<image :src="picUrl + item"></image>
|
||||||
|
</swiper-item>
|
||||||
|
</swiper>
|
||||||
|
|
||||||
|
<view class="NumDot">
|
||||||
|
{{ currentGG.goods_carousel ? currentIndex : 0 }} / {{ currentGG.goods_carousel ? currentGG.goods_carousel.length : 0 }}
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view class="Money">
|
||||||
|
<view class="MoneyMark">¥</view>
|
||||||
|
{{ currentGG.sales_price }}
|
||||||
|
<view class="MoneyUnit">/{{ currentGG.goods_unit }}</view>
|
||||||
|
|
||||||
|
<view class="oldMoney">¥{{ currentGG.market_price }}</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<!-- 规格 -->
|
||||||
|
<!-- @click="changeGG2(item, index)" :class="index == currentGGIndex ? 'active' : ''"> -->
|
||||||
|
<!-- 规格显示 - 不再有规格切换功能 -->
|
||||||
|
<view class="GGBox">
|
||||||
|
<view class="GG_left">
|
||||||
|
<view class="GG_Item active">
|
||||||
|
{{ currentGG.goods_spec }} / {{ currentGG.goods_unit }}
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view class="Tit">
|
||||||
|
<view class="isDay" v-if="currentGG.is_same_day">当日达</view>
|
||||||
|
<view>{{ currentGG.goods_name }}</view>
|
||||||
|
</view>
|
||||||
|
<view class="Msg">{{ currentGG.commodity_brief }}</view>
|
||||||
|
|
||||||
|
<view class="fenge"></view>
|
||||||
|
|
||||||
|
<!-- 促销信息区域 -->
|
||||||
|
<view class="promotions-container">
|
||||||
|
<view class="promotion-item">
|
||||||
|
<view class="promotion-tag">优惠</view>
|
||||||
|
<view class="promotion-content promotion-content1">满100减10</view>
|
||||||
|
</view>
|
||||||
|
<view class="promotion-item">
|
||||||
|
<view class="promotion-tag">限购</view>
|
||||||
|
<view class="promotion-content">限购5件</view>
|
||||||
|
</view>
|
||||||
|
<view class="promotion-item">
|
||||||
|
<view class="promotion-tag">阶梯价</view>
|
||||||
|
<view class="promotion-content">1~9件 9.5元/件;>10件 8.0元/件</view>
|
||||||
|
</view>
|
||||||
|
<view class="promotion-item">
|
||||||
|
<view class="promotion-tag">满赠</view>
|
||||||
|
<view class="promotion-content">满5赠1,满10赠3</view>
|
||||||
|
</view>
|
||||||
|
<view class="promotion-item">
|
||||||
|
<view class="promotion-tag">满减</view>
|
||||||
|
<view class="promotion-content">满100减5,满200减20</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view class="fenge"></view>
|
||||||
|
|
||||||
|
<view class="Msg_Item">
|
||||||
|
<view class="Msg_ItemTit">质检</view>
|
||||||
|
<view class="Msg_ItemCon">质检报告</view>
|
||||||
|
</view>
|
||||||
|
<view class="Msg_Item">
|
||||||
|
<view class="Msg_ItemTit">押金</view>
|
||||||
|
<view class="Msg_ItemCon">需另付押金:¥30.00(30天可退)</view>
|
||||||
|
</view>
|
||||||
|
<view class="Msg_Item">
|
||||||
|
<view class="Msg_ItemTit">配送</view>
|
||||||
|
<view class="Msg_ItemCon"> 12:00前下单,预计8月21日送达; </view>
|
||||||
|
</view>
|
||||||
|
<view class="fenge"></view>
|
||||||
|
|
||||||
|
<!-- 评价部分 -->
|
||||||
|
<view class="reviews-section">
|
||||||
|
<view class="reviews-header">
|
||||||
|
<h3>评价({{ comments.length ? comments.length : 0 }})</h3>
|
||||||
|
<view class="view-all" @click="showPopup">查看全部 ></view>
|
||||||
|
</view>
|
||||||
|
<view class="reviews-list" v-if="comments.length > 0">
|
||||||
|
<view class="review-item" v-for="(comment, index) in comments" :key="index">
|
||||||
|
<view class="review-user">
|
||||||
|
<image :src="comment.mpuser.avatar" class="user-avatar"></image>
|
||||||
|
<view class="user-info">
|
||||||
|
<view class="user-name">{{ comment.mpuser.nick_name }}</view>
|
||||||
|
</view>
|
||||||
|
<view class="review-time">{{ comment.create_time }}</view>
|
||||||
|
</view>
|
||||||
|
<view class="user-purchase">已购 {{ comment.goods_name.goods_name }}{{ comment.goods_name.goods_spec
|
||||||
|
}}</view>
|
||||||
|
<view class="review-content">{{ comment.user_review }}</view>
|
||||||
|
<view class="review-images" v-if="comment.review_image.length > 0">
|
||||||
|
<image :src="img" class="review-img" v-for="(img, idx) in comment.review_image" :key="idx">
|
||||||
|
</image>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view class="fenge"></view>
|
||||||
|
|
||||||
|
<h3 class="GoodsMsg">商品详情</h3>
|
||||||
|
|
||||||
|
<view class="Msg_Item">
|
||||||
|
<view class="Msg_ItemTit">商品编号</view>
|
||||||
|
<view class="Msg_ItemCon" @click="copys(currentGG.goods_no)">
|
||||||
|
{{ currentGG.goods_no }}
|
||||||
|
<image src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/property-img-file/shop_copy.png">
|
||||||
|
</image>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="Msg_Item">
|
||||||
|
<view class="Msg_ItemTit">规格说明</view>
|
||||||
|
<view class="Msg_ItemCon">{{ currentGG.goods_spec }}</view>
|
||||||
|
</view>
|
||||||
|
<view class="Msg_Item">
|
||||||
|
<view class="Msg_ItemTit">售卖单位</view>
|
||||||
|
<view class="Msg_ItemCon">{{ currentGG.goods_unit }}</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view class="GoosMsg">
|
||||||
|
<image v-for="item in currentGG.goods_detail_pic" :src="picUrl + item" :key="item" mode="widthFix"></image>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view class="priceInfo">
|
||||||
|
<h3 class="priceInfo-title">价格说明</h3>
|
||||||
|
<view class="priceInfo-content">
|
||||||
|
<view>
|
||||||
|
<text class="priceInfo-content-title">划线价格:</text>
|
||||||
|
指商品的厂商指导价、正品零售价、市面常见价或该商品曾经展示过的销售价等,并非原价。仅供参考。
|
||||||
|
</view>
|
||||||
|
<view>
|
||||||
|
<text class="priceInfo-content-title">未划线价格:</text>
|
||||||
|
指商品的实时价格,不因表述的差异改变性质,具体成交价格根据商品参加活动,或使用优惠券等发生变化最终以订单结算价格为准。
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<!-- 底部购物车 -->
|
||||||
|
<view class="Car">
|
||||||
|
<view class="car_left">
|
||||||
|
<view class="share" @click="share">
|
||||||
|
<image src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/property-img-file/shop_share.png"
|
||||||
|
mode="widthFix"></image>
|
||||||
|
分享
|
||||||
|
</view>
|
||||||
|
<view class="cars" @click="car">
|
||||||
|
<u-badge numberType="limit" :type="type" max="99" :value="carNum"></u-badge>
|
||||||
|
|
||||||
|
<image src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/property-img-file/shop_car.png"
|
||||||
|
mode="widthFix"></image>
|
||||||
|
购物车
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view class="car_right" v-if="
|
||||||
|
currentGG.stock_quantity > 0 &&
|
||||||
|
(!currentGG.cart_count || currentGG.cart_count.count == 0)
|
||||||
|
" @click="addCar">
|
||||||
|
加入购物车
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view class="car_right" @click="changeCar" v-if="
|
||||||
|
currentGG.cart_count && currentGG.cart_count.count > 0
|
||||||
|
&& currentGG.stock_quantity > 0
|
||||||
|
">
|
||||||
|
加入购物车
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view class="car_right car_right_disabled" v-if="currentGG.stock_quantity < 1">
|
||||||
|
已售罄
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<!-- 分享 -->
|
||||||
|
<view class="shadow" @click.stop="changeShadow" v-if="boxshadow1">
|
||||||
|
<view class="shadowBox1">
|
||||||
|
<button class="shadowBox1Item_btn" open-type="share" bindtap="onShareButtonClick" />
|
||||||
|
<view class="shadowBox1Item" @click="shareFriend">
|
||||||
|
<image src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/property-img-file/shop_WX.png"
|
||||||
|
mode="aspectFill"></image>
|
||||||
|
微信好友
|
||||||
|
</view>
|
||||||
|
<view class="shadowBox1Item" @click="openSave">
|
||||||
|
<image src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/property-img-file/shop_saveImg.png"
|
||||||
|
mode="aspectFill"></image>
|
||||||
|
生成海报
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<!-- 海报 -->
|
||||||
|
<view class="shadow" @click="changeShadow2" v-if="boxshadow2">
|
||||||
|
<view class="shadowBox2">
|
||||||
|
<view class="shadowBox_img">
|
||||||
|
<view class="boxshadow_tit">今日商品推荐</view>
|
||||||
|
<view class="boxshadow_img">
|
||||||
|
<image v-if="currentGG && currentGG.commodity_pic && currentGG.commodity_pic.length > 0"
|
||||||
|
:src="picUrl + currentGG.commodity_pic[0]">
|
||||||
|
</image>
|
||||||
|
<image v-else
|
||||||
|
src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/property-img-file/shop_share_img.png">
|
||||||
|
</image>
|
||||||
|
</view>
|
||||||
|
<view class="line"></view>
|
||||||
|
<view class="shadowBoxInfo">
|
||||||
|
<image class="shadowboxInfo_left"
|
||||||
|
:src="qrcodePath || 'https://wechat-img-file.oss-cn-beijing.aliyuncs.com/property-img-file/qrcode_placeholder.png'"
|
||||||
|
mode="aspectFill"></image>
|
||||||
|
<view class="shadowboxInfo_right">
|
||||||
|
<view class="shadowboxInfo_right_1">{{ currentGG && currentGG.goods_name ?
|
||||||
|
currentGG.goods_name : '' }}</view>
|
||||||
|
<view class="shadowboxInfo_right_2">
|
||||||
|
长按识别小程序 <br />
|
||||||
|
数量有限马上抢购
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="shadowBox_btn" @click.stop="saveImg(picUrl + currentGG.commodity_pic[0])">保存海报</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<!-- 评价 查看详情 -->
|
||||||
|
<u-popup :show="show" round="20rpx" mode="bottom" @close="close" @open="open" :z-index="10070">
|
||||||
|
<view class="reviews-section">
|
||||||
|
<view class="popup-header">
|
||||||
|
<h3 class="popup-header-h3">评价</h3>
|
||||||
|
<view class="popup-header-view" @click="close">取消</view>
|
||||||
|
</view>
|
||||||
|
<view class="temp">
|
||||||
|
<view class="temp1">
|
||||||
|
<img class="temp_img" src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/pingjia.png" />
|
||||||
|
为你展示真实评价
|
||||||
|
</view>
|
||||||
|
<!-- 移除款式选择按钮 -->
|
||||||
|
</view>
|
||||||
|
<view class="reviews-list" v-if="comments.length > 0">
|
||||||
|
<view class="review-item" v-for="(comment, index) in comments" :key="index">
|
||||||
|
<view class="review-user">
|
||||||
|
<image :src="comment.mpuser.avatar" class="user-avatar"></image>
|
||||||
|
<view class="user-info">
|
||||||
|
<view class="user-name">{{ comment.mpuser.nick_name }}</view>
|
||||||
|
</view>
|
||||||
|
<view class="review-time">{{ comment.create_time }}</view>
|
||||||
|
</view>
|
||||||
|
<view class="user-purchase">已购 {{ comment.goods_name.goods_name }}{{
|
||||||
|
comment.goods_name.goods_spec }}</view>
|
||||||
|
<view class="review-content">{{ comment.user_review }}</view>
|
||||||
|
<view class="review-images" v-if="comment.review_image.length > 0">
|
||||||
|
<image :src="img" class="review-img" v-for="(img, idx) in comment.review_image" :key="idx">
|
||||||
|
</image>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</u-popup>
|
||||||
|
|
||||||
|
<!-- 移除款式选择弹窗,因为现在只有一个货品规格 -->
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import {
|
||||||
|
apiArr
|
||||||
|
} from "../../../api/shop";
|
||||||
|
import { apiArr as afterSaleApi } from "../../../api/afterSale";
|
||||||
|
import {
|
||||||
|
picUrl,
|
||||||
|
menuButtonInfo,
|
||||||
|
request,
|
||||||
|
NavgateTo
|
||||||
|
} from "../../../utils";
|
||||||
|
export default {
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
picUrl,
|
||||||
|
top: "",
|
||||||
|
localHeight: "",
|
||||||
|
carNum: "",
|
||||||
|
prevCarNum: "",
|
||||||
|
currentNum: "0", //当前商品的数量
|
||||||
|
type: "error",
|
||||||
|
boxshadow1: false,
|
||||||
|
boxshadow2: false,
|
||||||
|
goods_id: "", // 货品ID
|
||||||
|
commodity_id: "", // 商品ID
|
||||||
|
order_cate: "", // 订单类型
|
||||||
|
info: "",
|
||||||
|
currentIndex: "1", //当前轮播图
|
||||||
|
|
||||||
|
currentGG: {}, //当前货品信息
|
||||||
|
|
||||||
|
carOrderList: [],
|
||||||
|
// 新增评论数据
|
||||||
|
showReviewPopup: false,
|
||||||
|
comments: [],
|
||||||
|
show: false,
|
||||||
|
showSize: false,
|
||||||
|
|
||||||
|
qrcodePath: null, // 存储当前页面的二维码路径
|
||||||
|
};
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
changeIndex(e) {
|
||||||
|
this.currentIndex = e.detail.current + 1;
|
||||||
|
},
|
||||||
|
|
||||||
|
back() {
|
||||||
|
uni.navigateBack({
|
||||||
|
delta: 1,
|
||||||
|
});
|
||||||
|
},
|
||||||
|
// 分享微信
|
||||||
|
shareFriend() {
|
||||||
|
this.boxshadow2 = false;
|
||||||
|
return;
|
||||||
|
// uniapp 分享微信好友
|
||||||
|
uni.share({
|
||||||
|
provider: "weixin",
|
||||||
|
type: "link",
|
||||||
|
scene: "session",
|
||||||
|
link: "https://uniapp.dcloud.net.cn/",
|
||||||
|
title: "商品名称",
|
||||||
|
imageUrl: "",
|
||||||
|
success: (res) => {
|
||||||
|
uni.showToast({
|
||||||
|
title: "分享成功",
|
||||||
|
icon: "success",
|
||||||
|
duration: 2000,
|
||||||
|
});
|
||||||
|
this.boxshadow1 = false;
|
||||||
|
},
|
||||||
|
fail: (err) => {
|
||||||
|
console.log("分享失败", err);
|
||||||
|
this.boxshadow1 = false;
|
||||||
|
},
|
||||||
|
});
|
||||||
|
},
|
||||||
|
changeShadow() {
|
||||||
|
this.boxshadow1 = false;
|
||||||
|
},
|
||||||
|
openSave() {
|
||||||
|
this.boxshadow1 = false;
|
||||||
|
this.boxshadow2 = true;
|
||||||
|
},
|
||||||
|
// 保存海报
|
||||||
|
saveImg(picUrl) {
|
||||||
|
this.boxshadow2 = false;
|
||||||
|
// 微信小程序保存图片
|
||||||
|
uni.downloadFile({
|
||||||
|
url: picUrl,
|
||||||
|
success: (res) => {
|
||||||
|
if (res.statusCode === 200) {
|
||||||
|
uni.saveImageToPhotosAlbum({
|
||||||
|
filePath: res.tempFilePath,
|
||||||
|
success: (res) => {
|
||||||
|
uni.showToast({
|
||||||
|
title: "保存成功",
|
||||||
|
icon: "success",
|
||||||
|
duration: 2000,
|
||||||
|
});
|
||||||
|
},
|
||||||
|
fail: (err) => {
|
||||||
|
console.log("保存失败", err);
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
fail: (err) => {
|
||||||
|
console.log("下载失败", err);
|
||||||
|
},
|
||||||
|
});
|
||||||
|
},
|
||||||
|
changeShadow2() {
|
||||||
|
this.boxshadow2 = false;
|
||||||
|
},
|
||||||
|
|
||||||
|
// 点分享按钮
|
||||||
|
share() {
|
||||||
|
this.boxshadow1 = true;
|
||||||
|
},
|
||||||
|
//货品详情 - 使用afterSaleApi.selectGoodsDetail接口
|
||||||
|
getGoodsInfo() {
|
||||||
|
request(afterSaleApi.selectGoodsDetail, "POST", {
|
||||||
|
goods_id: this.goods_id,
|
||||||
|
order_cate: this.order_cate
|
||||||
|
}).then((res) => {
|
||||||
|
// 处理返回的数据
|
||||||
|
let goodsData = res;
|
||||||
|
|
||||||
|
// 分割图片字符串为数组
|
||||||
|
if (goodsData.goods_detail_pic) {
|
||||||
|
goodsData.goods_detail_pic = goodsData.goods_detail_pic.split(",");
|
||||||
|
} else {
|
||||||
|
goodsData.goods_detail_pic = [];
|
||||||
|
}
|
||||||
|
|
||||||
|
if (goodsData.goods_carousel) {
|
||||||
|
goodsData.goods_carousel = goodsData.goods_carousel.split(",");
|
||||||
|
} else {
|
||||||
|
goodsData.goods_carousel = [];
|
||||||
|
}
|
||||||
|
|
||||||
|
if (goodsData.commodity_pic) {
|
||||||
|
goodsData.commodity_pic = goodsData.commodity_pic.split(",");
|
||||||
|
} else {
|
||||||
|
goodsData.commodity_pic = [];
|
||||||
|
}
|
||||||
|
|
||||||
|
// 根据购物车列表更新当前货品在购物车中的数量
|
||||||
|
if (this.carOrderList) {
|
||||||
|
this.carOrderList.forEach((items) => {
|
||||||
|
if (items.goods_id == goodsData.id) {
|
||||||
|
goodsData.cart_count = {
|
||||||
|
count: items.count
|
||||||
|
};
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// 如果没有cart_count,初始化为0
|
||||||
|
if (!goodsData.cart_count) {
|
||||||
|
goodsData.cart_count = {
|
||||||
|
count: 0
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
this.info = goodsData; // 保存完整信息
|
||||||
|
this.currentGG = goodsData; // 设置当前货品信息
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
copys(e) {
|
||||||
|
uni.setClipboardData({
|
||||||
|
data: e,
|
||||||
|
success: (res) => {
|
||||||
|
uni.showToast({
|
||||||
|
title: "复制成功",
|
||||||
|
icon: "success",
|
||||||
|
duration: 2000,
|
||||||
|
});
|
||||||
|
},
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
// 移除规格切换相关方法,因为现在只有一个货品规格
|
||||||
|
car() {
|
||||||
|
NavgateTo("../shopCar/index");
|
||||||
|
},
|
||||||
|
|
||||||
|
//获取购物车数量
|
||||||
|
getShopCar() {
|
||||||
|
request(apiArr.getCarCount, "POST", {}).then((res) => {
|
||||||
|
this.prevCarNum = res.total;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
getShopCarList() {
|
||||||
|
return request(apiArr.getCar, "POST", {}).then((res) => {
|
||||||
|
// 合并当日达和普通商品数据
|
||||||
|
this.carOrderList = [].concat(res.same_day_cart_list, res.normal_cart_list)
|
||||||
|
.flatMap(supplier => supplier.commodity_cart_and_goods_model);
|
||||||
|
this.carNum = res.total;
|
||||||
|
return res;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
addCar() {
|
||||||
|
let that = this;
|
||||||
|
// 获取当前货品
|
||||||
|
const currentGoods = this.currentGG;
|
||||||
|
|
||||||
|
// 获取当前购物车数量和库存数量
|
||||||
|
const currentQuantity = currentGoods.cart_count ? currentGoods.cart_count.count : 0;
|
||||||
|
const stockQuantity = currentGoods.stock_quantity || 0;
|
||||||
|
|
||||||
|
// 检查库存是否充足
|
||||||
|
if (currentQuantity >= stockQuantity) {
|
||||||
|
uni.showToast({
|
||||||
|
title: "库存不足",
|
||||||
|
icon: "none",
|
||||||
|
duration: 2000
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
//如果没有当前货品 直接添加一个
|
||||||
|
currentGoods.cart_count = {
|
||||||
|
count: currentQuantity + 1,
|
||||||
|
};
|
||||||
|
const params = {
|
||||||
|
goods_id_and_count: [
|
||||||
|
{
|
||||||
|
goods_id: currentGoods.id,
|
||||||
|
count: currentGoods.cart_count.count,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
};
|
||||||
|
|
||||||
|
//因为是当前商品没有 调用update就是增加商品。增加商品之后再获取购物车数量
|
||||||
|
request(apiArr.updateCar, "POST", params).then((res) => {
|
||||||
|
that.getShopCar();
|
||||||
|
that.getShopCarList();
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
// 购物车更改
|
||||||
|
changeCar() {
|
||||||
|
// 直接增加货品数量
|
||||||
|
const currentGoods = this.currentGG;
|
||||||
|
const currentQuantity = currentGoods.cart_count ? currentGoods.cart_count.count : 0;
|
||||||
|
const stockQuantity = currentGoods.stock_quantity || 0;
|
||||||
|
|
||||||
|
// 检查库存是否充足
|
||||||
|
if (currentQuantity >= stockQuantity) {
|
||||||
|
uni.showToast({
|
||||||
|
title: "库存不足",
|
||||||
|
icon: "none",
|
||||||
|
duration: 2000
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 增加货品数量
|
||||||
|
currentGoods.cart_count = {
|
||||||
|
count: currentQuantity + 1,
|
||||||
|
};
|
||||||
|
|
||||||
|
const params = {
|
||||||
|
user_id: uni.getStorageSync("userId"),
|
||||||
|
goods_id_and_count: [{
|
||||||
|
goods_id: currentGoods.id,
|
||||||
|
count: currentGoods.cart_count.count,
|
||||||
|
}],
|
||||||
|
};
|
||||||
|
|
||||||
|
request(apiArr.updateCar, "POST", params).then((res) => {
|
||||||
|
console.log(res);
|
||||||
|
this.getShopCarList();
|
||||||
|
this.getShopCar();
|
||||||
|
uni.showToast({
|
||||||
|
title: "操作成功!",
|
||||||
|
success() { },
|
||||||
|
});
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
showPopup() {
|
||||||
|
this.show = true;
|
||||||
|
},
|
||||||
|
|
||||||
|
close() {
|
||||||
|
this.show = false;
|
||||||
|
},
|
||||||
|
// 获取评论
|
||||||
|
getComment() {
|
||||||
|
let params = {
|
||||||
|
goods_id: this.goods_id,
|
||||||
|
commodity_id: this.commodity_id,
|
||||||
|
};
|
||||||
|
request(apiArr.getComment, "POST", params).then((res) => {
|
||||||
|
if (res.commodity_evaluate_list && Array.isArray(res.commodity_evaluate_list)) {
|
||||||
|
this.comments = res.commodity_evaluate_list.map(item => ({
|
||||||
|
...item,
|
||||||
|
review_image: item.review_image ? item.review_image.split(',') : []
|
||||||
|
}));
|
||||||
|
} else {
|
||||||
|
this.comments = [];
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}, onLoad(options) {
|
||||||
|
const itemObj = JSON.parse(decodeURIComponent(options.item));
|
||||||
|
const goodId = JSON.parse(decodeURIComponent(options.goodId));
|
||||||
|
const meun = menuButtonInfo();
|
||||||
|
this.top = meun.top;
|
||||||
|
this.localHeight = meun.height;
|
||||||
|
|
||||||
|
|
||||||
|
// 保存货品id和订单类型
|
||||||
|
this.goods_id = goodId;
|
||||||
|
this.commodity_id = itemObj.id;
|
||||||
|
this.order_cate = itemObj.order_cate;
|
||||||
|
this.selectedGoods = itemObj; // 保存传入的完整货品信息
|
||||||
|
},
|
||||||
|
onReachBottom() { },
|
||||||
|
onShow() {
|
||||||
|
this.getShopCarList().then(() => {
|
||||||
|
this.getGoodsInfo();
|
||||||
|
this.getShopCar();
|
||||||
|
this.getComment();
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
//离开页面的时候直接更新购物车数量(目前接口是 传入商品id 数量。如果有当前商品就更新数量。如果没有就增加商品。如果删除某个商品 count 为0 就删除)
|
||||||
|
onHide() {
|
||||||
|
let goods_id_and_count = [];
|
||||||
|
// 只有当前货品需要处理
|
||||||
|
if (this.currentGG && this.currentGG.cart_count) {
|
||||||
|
goods_id_and_count.push({
|
||||||
|
goods_id: this.currentGG.id,
|
||||||
|
count: this.currentGG.cart_count.count,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
request(apiArr.updateCar, "POST", {
|
||||||
|
goods_id_and_count,
|
||||||
|
}).then((res) => {
|
||||||
|
console.log("Cart updated on hide");
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
},
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style>
|
||||||
|
@import url("./index.css");
|
||||||
|
</style>
|
||||||
@ -46,7 +46,7 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="goods-item" v-for="(item, index) in orderInfo.commodity_order_item_list" :key="index">
|
<view class="goods-item" v-for="(item, index) in orderInfo.commodity_order_item_list" :key="index">
|
||||||
<view class="goods-content" @click="toDetail(orderInfo)">
|
<view class="goods-content" @click="toDetail(orderInfo, item)">
|
||||||
<image :src="item.commodity_pic" class="goods-img"></image>
|
<image :src="item.commodity_pic" class="goods-img"></image>
|
||||||
<view class="goods-info">
|
<view class="goods-info">
|
||||||
<view>
|
<view>
|
||||||
@ -178,9 +178,9 @@ export default {
|
|||||||
this.status = JSON.stringify(item.order_status);
|
this.status = JSON.stringify(item.order_status);
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
toDetail(item) {
|
toDetail(orderInfo, item) {
|
||||||
console.log("🚀 ~ item:", item)
|
const goodId = item.goods_id
|
||||||
// NavgateTo(`/packages/myOrders/commodityDetails/index?item=${JSON.stringify(item)}`);
|
NavgateTo(`/packages/myOrders/goodDetails/index?item=${JSON.stringify(orderInfo)} &goodId=${JSON.stringify(goodId)}`);
|
||||||
},
|
},
|
||||||
startCountdown() {
|
startCountdown() {
|
||||||
// 检查订单信息中是否有时效时间戳
|
// 检查订单信息中是否有时效时间戳
|
||||||
@ -188,23 +188,23 @@ export default {
|
|||||||
console.error('订单时效时间戳不存在');
|
console.error('订单时效时间戳不存在');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 获取当前时间和订单超时时间
|
// 获取当前时间和订单超时时间
|
||||||
const now = Math.floor(new Date().getTime() / 1000);
|
const now = Math.floor(new Date().getTime() / 1000);
|
||||||
const timeoutTime = this.orderInfo.timeout_time_stamp;
|
const timeoutTime = this.orderInfo.timeout_time_stamp;
|
||||||
|
|
||||||
// 判断当前时间是否已超过超时时间
|
// 判断当前时间是否已超过超时时间
|
||||||
if (now > timeoutTime) {
|
if (now > timeoutTime) {
|
||||||
// 已超过超时时间,直接取消订单
|
// 已超过超时时间,直接取消订单
|
||||||
this.handleOrderCancellation();
|
this.handleOrderCancellation();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 计算剩余时间(秒)
|
// 计算剩余时间(秒)
|
||||||
let remainingSeconds = timeoutTime - now;
|
let remainingSeconds = timeoutTime - now;
|
||||||
// 确保剩余时间不为负数
|
// 确保剩余时间不为负数
|
||||||
remainingSeconds = Math.max(0, remainingSeconds);
|
remainingSeconds = Math.max(0, remainingSeconds);
|
||||||
|
|
||||||
// 更新倒计时显示的函数
|
// 更新倒计时显示的函数
|
||||||
const updateCountdownDisplay = (seconds) => {
|
const updateCountdownDisplay = (seconds) => {
|
||||||
const hours = Math.floor(seconds / 3600);
|
const hours = Math.floor(seconds / 3600);
|
||||||
@ -212,16 +212,16 @@ export default {
|
|||||||
const secs = seconds % 60;
|
const secs = seconds % 60;
|
||||||
this.countdown = `${hours}:${minutes.toString().padStart(2, "0")}:${secs.toString().padStart(2, "0")}`;
|
this.countdown = `${hours}:${minutes.toString().padStart(2, "0")}:${secs.toString().padStart(2, "0")}`;
|
||||||
};
|
};
|
||||||
|
|
||||||
// 立即更新一次显示
|
// 立即更新一次显示
|
||||||
updateCountdownDisplay(remainingSeconds);
|
updateCountdownDisplay(remainingSeconds);
|
||||||
|
|
||||||
// 设置定时器,每秒更新一次倒计时
|
// 设置定时器,每秒更新一次倒计时
|
||||||
const timer = setInterval(() => {
|
const timer = setInterval(() => {
|
||||||
remainingSeconds--;
|
remainingSeconds--;
|
||||||
|
|
||||||
updateCountdownDisplay(remainingSeconds);
|
updateCountdownDisplay(remainingSeconds);
|
||||||
|
|
||||||
// 检查是否已经超时
|
// 检查是否已经超时
|
||||||
if (remainingSeconds <= 0) {
|
if (remainingSeconds <= 0) {
|
||||||
clearInterval(timer);
|
clearInterval(timer);
|
||||||
@ -230,7 +230,7 @@ export default {
|
|||||||
}
|
}
|
||||||
}, 1000);
|
}, 1000);
|
||||||
},
|
},
|
||||||
|
|
||||||
// 处理订单取消
|
// 处理订单取消
|
||||||
handleOrderCancellation() {
|
handleOrderCancellation() {
|
||||||
const params = {
|
const params = {
|
||||||
|
|||||||
@ -957,6 +957,12 @@
|
|||||||
"style": {
|
"style": {
|
||||||
"navigationBarTitleText": "换货详情"
|
"navigationBarTitleText": "换货详情"
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "goodDetails/index",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": "详情"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user