index.vue 1.46 KB
Newer Older
李嘉林 committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75
<template>
  <!-- 选择企业账号 -->
  <div class="SelectEnterpriseAccount">
    <van-popup
      :show="show"
      round
      :close-on-click-overlay="false"
      position="bottom"
    >
      <van-picker
        title="选择企业登录"
        :columns="masterAccount"
        :value-key="'customerName'"
        :show-toolbar="true"
        @confirm="confirm"
      />
    </van-popup>
  </div>
</template>

<script type="text/ecmascript-6">
// import { setEnterpriseAccount } from "~/plugins/auth";
export default {
  name: "SelectEnterpriseAccount",
  data() {
    return {
      show: false,
      masterAccount: [],
    };
  },
  components: {},
  computed: {},
  created() {},
  mounted() {
    this.list1;
  },
  methods: {
    open(val) {
      this.masterAccount = val;
      console.log(this.masterAccount,'----this.masterAccount')
      this.show = true;
    },
    close() {
      this.show = false;
    },
    confirm(val) {
      console.log(val.target.value, "------------41");
      // 选择数据
      this.$emit("confirm", val.target.value);
      
      wx.setStorage({
        key: "enterpriseAccount",
        data: JSON.stringify(val.target.value)
      });
      this.close();
    },
  },
};
</script>

<style lang="scss">
.SelectEnterpriseAccount {
  .van-popup {
    height: 40vh;
    .van-picker__toolbar{
      .van-picker__cancel{
        opacity: 0;
      }
      .van-picker__confirm{
        color: var(--main-color);
      }
    }
  }
}
</style>