123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270 |
- <template>
- <view class="content">
- <view class="inner">
- <view class="goods-list">
- <view v-if="order!=null&&order.isPackage!=1" class="item" v-for="(item,index) in items" :key="index">
- <image class="goods-img" :src="JSON.parse(item.jsonInfo).image" mode="aspectFit"></image>
- <view class="info">
- <view class="top">
- <view class="title ellipsis2">{{ JSON.parse(item.jsonInfo).productName}}</view>
- <view class="spec">{{JSON.parse(item.jsonInfo).sku}}</view>
- </view>
- <view class="price-num">
- <view class="price-box">
- <text class="unit">¥</text>
- <text class="price">{{JSON.parse(item.jsonInfo).price.toFixed(2)}}</text>
- </view>
- <view class="num">x{{JSON.parse(item.jsonInfo).num}}</view>
- </view>
- </view>
- </view>
- <view v-if="order!=null&&order.isPackage==1&&order.packageJson!=null" class="item">
- <image class="goods-img" :src="JSON.parse(order.packageJson).imgUrl" mode="aspectFit"></image>
- <!-- <view class="info">
- <view class="top">
- <view class="title ellipsis2">
- <view class="tag">套餐</view>{{JSON.parse(order.packageJson).title}}
- </view>
- <view class="spec">{{JSON.parse(order.packageJson).descs}}</view>
- </view>
- </view> -->
- </view>
- </view>
- </view>
- <!-- 底部按钮 -->
- <view class="btn-box">
- <view class="text">提交申请后,客服会与您电话沟通,请保持手机通畅</view>
- <view class="btns">
- <view class="left"></view>
- <view class="right">
- <view class="btn cancel" v-if="order.status==2 || order.status==2" @click="submit(0)">仅退款</view>
- <view class="btn cancel" v-if="order.status==3||order.status==4" @click="submit(1)">退款退货</view>
- </view>
- </view>
- </view>
- </view>
- </template>
- <script>
- import {
- getStoreOrderItems, //获取订单项列表
- } from '@/api/order.js'
- // import {getStoreOrder,applyAfterSales} from '@/api/storeAfterSales'
- export default {
- data() {
- return {
- order: {},
- items: [],
- }
- },
- onLoad(option) {
- this.orderId = option.orderId;
- this.getStoreOrder()
- },
- methods: {
- checkChange(item) {
- item.checked = !item.checked;
- },
- submit(type) {
- uni.redirectTo({
- url: '/pages_shop/refundOrder?orderId=' + this.order.orderId + "&type=" + type + "&orderCode=" +
- this.order.orderCode
- })
- },
- getStoreOrder() {
- var data = {
- orderId: this.orderId
- };
- getStoreOrderItems(data).then(res => {
- if (res.code == 200) {
- console.log("获取订单项列表>>>", res)
- this.order = res.order;
- this.items = res.items;
- } else {
- uni.showToast({
- icon: 'none',
- title: "请求失败",
- });
- }
- });
- },
- }
- }
- </script>
- <style lang="scss">
- .content {
- margin-bottom: 170rpx;
- .inner {
- padding: 20rpx;
- .goods-list {
- .item {
- box-sizing: border-box;
- height: 221rpx;
- background: #FFFFFF;
- padding: 30rpx;
- display: flex;
- align-items: center;
- &:last-child {
- margin-bottom: 0;
- }
- .goods-img {
- width: 160rpx;
- height: 160rpx;
- background: #FFFFFF;
- margin-right: 30rpx;
- flex-shrink: 0;
- }
- .info {
- width: calc(100% - 160rpx);
- height: 160rpx;
- display: flex;
- flex-direction: column;
- justify-content: space-between;
- .top {
- .title {
- font-size: 28rpx;
- font-family: PingFang SC;
- font-weight: 500;
- color: #111111;
- line-height: 1.4;
- .tag {
- display: inline-block;
- padding: 0 6rpx;
- height: 30rpx;
- background: linear-gradient(90deg, #66b2ef 0%, #0bb3f2 100%);
- border-radius: 4rpx;
- margin-right: 10rpx;
- font-size: 22rpx;
- font-family: PingFang SC;
- font-weight: bold;
- color: #FFFFFF;
- line-height: 30rpx;
- float: left;
- margin-top: 7rpx;
- }
- }
- .spec {
- font-size: 24rpx;
- font-family: PingFang SC;
- font-weight: 500;
- color: #999999;
- line-height: 1;
- margin-top: 14rpx;
- }
- }
- .price-num {
- display: flex;
- align-items: center;
- justify-content: space-between;
- .price-box {
- display: flex;
- align-items: flex-end;
- .unit {
- font-size: 24rpx;
- font-family: PingFang SC;
- font-weight: 500;
- color: #111111;
- line-height: 1.2;
- margin-right: 5rpx;
- }
- .price {
- font-size: 32rpx;
- font-family: PingFang SC;
- font-weight: 500;
- color: #111111;
- line-height: 1;
- }
- }
- .num {
- font-size: 24rpx;
- font-family: PingFang SC;
- font-weight: bold;
- color: #666666;
- }
- }
- }
- }
- }
- }
- .btn-box {
- width: 100%;
- height: 160rpx;
- position: fixed;
- bottom: 0;
- background: #FFFFFF;
- .text {
- font-size: 24rpx;
- font-family: PingFang SC;
- font-weight: 500;
- color: #999999;
- line-height: 1;
- padding: 28rpx 0;
- text-align: center;
- }
- .btns {
- padding: 0rpx 30rpx;
- display: flex;
- flex-direction: row;
- justify-content: space-between;
- align-items: center;
- .left {
- font-size: 24rpx;
- font-family: PingFang SC;
- font-weight: 500;
- color: #999999;
- }
- .right {
- display: flex;
- flex-direction: row;
- justify-content: flex-end;
- align-items: center;
- .btn {
- width: 155rpx;
- height: 64rpx;
- line-height: 64rpx;
- font-size: 26rpx;
- font-family: PingFang SC;
- font-weight: 500;
- text-align: center;
- border-radius: 32rpx;
- margin-left: 15rpx;
- &.cancel {
- border: 1px solid #DDDDDD;
- color: #666666;
- }
- }
- }
- }
- }
- }
- </style>
|