<style>
.signList {
  background-color: #f3f5f7;
  padding: 15px;
}

.signList .activeList {
  height: 210rpx;
  background: #ffffff;
  box-shadow: 0px 10rpx 50rpx 0px rgba(218, 220, 230, 0.85);
  border-radius: 30rpx;
  padding: 30rpx;
  margin-bottom: 30rpx;
  display: flex;
}
.signList .left {
  width: 130rpx;
  height: 100%;
  border-right: 1px solid #a5b1c5;
  display: flex;
  flex-wrap: wrap;
  align-content: space-between;
  padding-top: 10rpx;
  padding-right: 20rpx;
}
.signList .right {
  padding-left: 20rpx;
}
.rightItem {
  margin: 10rpx;
  font-size: 28rpx;
  font-family: PingFang SC;
  font-weight: 600;
  color: #1f1f1f;
}
.rightItem .label {
  color: #a4b0c4;
  font-weight: 400;
}
.signList .activeTop {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.signList .activeLeftTitle {
  color: #111111;
  font-size: 14px;
  font-weight: bold;
}

.signList .activeBtm {
  display: flex;
  margin-top: 10px;
  justify-content: space-between;
}

.signList .activeLeftImg {
  width: 111px;
  height: 70px;
  flex-shrink: 0;
}

.signList .activeRight {
  margin-left: 15px;
  color: #b9b9b9;
  font-size: 12px;
  width: 100%;
}
.signList .LinkMan {
  width: 100%;
  font-size: 32rpx;
  font-family: PingFang SC;
  font-weight: bold;
  color: #1f1f1f;
}
.linkIconBox {
  width: 100%;
  display: flex;
  justify-content: space-between;
}
</style>
<template>
  <view class="signList" style="height: 100vh">
    <u-empty v-if="dataList.length == 0" text="暂无数据" mode="data"></u-empty>
    <scroll-view
      v-else
      :scroll-y="true"
      :enable-back-to-top="true"
      :enable-flex="true"
      @scrolltolower="lower"
      :style="{ height: `calc(100%)` }"
    >
      <view>
        <view class="activeList" v-for="(item, index) in dataList" :key="index">
          <view class="left">
            <view class="LinkMan">{{ item.LinkMan }}</view>
			<view class="linkIconBox">
				<image mode="heightFit" @click="edituser(item)" style="width:32rpx;height:32rpx"
					src="@/static/images/aedit.png">
				<image mode="heightFit" @click="deleteUser(item)" style="width:33rpx;height:33rpx;margin-left:40rpx;"
					src="@/static/images/adel.png">
			</view>
          </view>
          <view class="right">
            <view class="rightItem">
              <text class="label">公司职务：</text>{{ item.Post }}</view
            >
            <view class="rightItem">
              <text class="label">所属区域：</text>{{ item.CountryInfo }}</view
            >
            <view class="rightItem">
              <text class="label">联系电话：</text>{{ item.LinkTel }}</view
            >
          </view>
        </view>
      </view>
      <view style="padding: 10px 0">
        <u-loadmore
          :status="status"
          :load-text="loadText"
          bg-color="#F3F5F7"
          :font-size="24"
          :margin-top="0"
          :margin-bottom="0"
        />
      </view>
    </scroll-view>
  </view>
</template>
<script>
export default {
  data() {
    return {
      pageTitle: "我的活动",
      qmsg: {
        Id: 0,
      },
      dataList: [],
      loadText: {
        loadmore: "轻轻上拉，加载更多",
        loading: "努力加载中",
        nomore: "没有更多了",
      },
      status: "",
    };
  },
  created() {},
  mounted() {
    uni.setNavigationBarTitle({
      title: this.pageTitle,
    });
  },
  onLoad(option) {
    this.qmsg.Id = option.Id;
    this.getList();
  },
  methods: {
    getList() {
      this.request2(
        {
          url: "/api/AppletTrade/GetCommerceActivity",
          data: this.qmsg,
        },
        (res) => {
          if (res.resultCode == 1) {
            this.dataList = res.data.CommerceConsultList;
          }
        }
      );
    },
    //删除用户
    deleteUser(item) {
      let delMsg = {
        Id: item.Id,
      };
      let that = this;
      uni.showModal({
        title: "提示",
        content: "确认删除？",
        success: function (res) {
          if (res.confirm) {
            that.request2(
              {
                url: "/api/AppletTrade/DeleteTrdceConsult",
                data: delMsg,
              },
              (_res) => {
                if (_res.resultCode == 1) {
                  uni.showToast({
                    title: "删除成功",
                    duration: 2000,
                  });
                  that.getList();
                }
              }
            );
          } else if (res.cancel) {
          }
        },
      });
    },
    //修改用户信息
    setUser(item) {
      var postMsg = {
        Id: item.Id,
        ActivityId: item.ActivityId,
        LinkMan: item.LinkMan,
        LinkTel: item.LinkTel,
        Post: item.Post,
        CountryInfo: item.CountryInfo,
      };
      this.request2(
        {
          url: "/api/AppletTrade/SetTradeConsult",
          data: postMsg,
        },
        (res) => {
          if (res.resultCode == 1) {
            this.getList();
          }
        }
      );
    },
    edituser(item) {
      let obj = {
        activeId: this.qmsg.Id,
      };
      uni.navigateTo({
        url:
          "/pages/kotra/signListEdit?data=" +
          JSON.stringify({ ...obj, ...item }),
      });
    },
  },
};
</script>
