xuxueyang
2024-07-30 c212c9ab501e1aff9e2dd90e8e87871c0bc7f1bc
pages/order/order-sale/order-sale.vue
@@ -51,6 +51,12 @@
                     <view class="label">理由</view>
                     <view class="value">{{item.reason}}</view>
                  </view>
                  <!-- #ifdef PUB_CUSTOMER -->
                  <view class="line-gray" v-if="item.status=='PENDING'"></view>
                  <view class="flex buttons" v-if="item.status=='PENDING'">
                     <view class="button button-1 m-l-15 m-r-0" @click="cancelSale(item)">取消售后</view>
                  </view>
                  <!-- #endif -->
               </view>
            </view>
         </view>
@@ -92,6 +98,22 @@
         uni.stopPullDownRefresh()
      },
      methods: {
         async cancelSale(item) {
            await this.$message.confirm('是否取消售后')
            this.$message.showLoading()
            const {
               code,
               data
            } = await this.$http.request('get', '/api/customer/sales/list/cancel', {
               params: {
                  id: item.id
               }
            })
            this.$message.hideLoading()
            if (code === 0) {
               this.refreshList()
            }
         },
         changeIndex(index) {
            if (this.tabIndex !== index) {
               this.tabIndex = index
@@ -165,6 +187,37 @@
               max-width: unset;
            }
         }
         .buttons {
            display: flex;
            margin-left: auto;
            width: fit-content;
            .button {
               // width: 216rpx;
               padding: 10rpx 20rpx;
               line-height: 34rpx;
               font-size: 24rpx;
               height: 34rpx;
               background: #20613D;
               text-align: center;
               border-radius: 30rpx;
            }
            .button-1 {
               background: #fff;
               color: #333;
               border: 2rpx solid #333;
            }
            .button-0 {
               color: #fff;
               border: 2rpx solid #20613D;
            }
         }
      }
   }
</style>