<template>
  <view class="card-info-wrapper" :style="{ 'border-radius': borderRadius }">
    <view class="card-info-top">
      <view class="card-top">
        <view class="card-title">变更送货人信息</view>
      </view>
      <view class="card-content">
        <popupSelectItemVue
          defaultLabel="请选择送货人员"
          name="送货人员信息"
          title="送货人员信息"
          :styles="{ color: '#999999' }"
        >
          <view class="upop" slot="right">
            <view class="select-item_txt">配送人姓名 15000000000</view>
          </view>
        </popupSelectItemVue>
      </view>
    </view>
    <view class="card-info-bottom">
      <view class="card-top">
        <view class="card-title">变更送货人信息</view>
      </view>
      <view class="card-content">
        <popupSelectItemVue
          defaultLabel="重新选择送货人"
          name="重新选择送货人"
          title="重新选择送货人"
        >
          <view class="upop" slot="right" @click="selectUserInfo">
            <view class="deliveryMan">{{ deliveryMan }}</view>
            <image src="/static/images/new_ui/arrow-right.png" mode=""></image>
          </view>
        </popupSelectItemVue>
      </view>
    </view>
  </view>
</template>

<script>
import { toQueryString } from "@/utils/index.js";
import popupSelectItemVue from "../popupSelectItem/popupSelectItem.vue";
//待收货---【送货】----变更送货人信息
export default {
  components: {
    popupSelectItemVue
  },
  props: {
    borderRadius: {
      type: String,
      default: "16rpx"
    }
  },
  data() {
    return {
      deliveryMan: "请选择送货人信息",
      indexs: "",
      status: "",
      order_id: "", //订单ID
      goodsCustomType: "sendGoods"
    };
  },
  onLoad(e) {
    this.order_id = e.order_id;
    this.indexs = e.indexs;
    this.status = e.status;
    this.goodsCustomType = e.goodsCustomType;
  },
  methods: {
    selectUserInfo() {
      console.log("选择用户信息");
      const urlParams = {
        status: this.status,
        index: this.indexs,
        goodsCustomType: this.goodsCustomType,
        order_id: this.order_id
      };
      const url = toQueryString(urlParams);
      console.log(url);
      uni.redirectTo({
        url: `./deliveryman?${url}`
      });
    }
  }
};
</script>

<style lang="scss" scoped>
.card-info-wrapper {
  //   min-height: 345rpx;
  background: #ffffff;
  padding: 32rpx 32rpx 5rpx;
  .card-info-top {
    color: #e5e5e5;
    border-bottom: 2rpx solid #e5e5e5;
    .card-top {
      font-family: PingFangSC, PingFang SC;
      font-weight: 500;
      font-size: 30rpx;
      color: #999999;
    }
  }
  .upop {
    display: flex;
    width: 100%;
    align-items: center;
    justify-content: flex-end;
    image {
      width: 30rpx;
      height: 30rpx;
      margin-left: 5rpx;
    }
    .image-box {
      width: 40rpx;
      height: 38rpx;
    }
    .select-item_txt,
    .deliveryMan {
      flex: 1;
      font-family: PingFangSC, PingFang SC;
      font-weight: 400;
      font-size: 28rpx;
      color: #999999;
    }
  }
  .card-info-bottom {
    margin-top: 36rpx;
    .card-title {
      font-weight: 600;
      font-size: 30rpx;
      color: #333333;
    }
  }
}
</style>
