<template>
  <div class="app-container">
    <div class="app-container__item">
      <div class="app-container__item-h1">文本比对</div>
      <div class="app-container__item-body">
        <xd-diff-data :new-value="newData" :old-value="oloData" is-read-only></xd-diff-data>
      </div>
    </div>
    <div class="app-container__item">
      <div class="app-container__item-h1">全屏插件</div>
      <div class="app-container__item-body">
        <xd-full-screen v-model="screen">
          <div style="height: 100%">full</div>
        </xd-full-screen>
      </div>
    </div>
    <div class="app-container__item">
      <div class="app-container__item-h1">无限级联选择插件</div>
      <div class="app-container__item-body">
        <div class="app-container__item-body-value">
          <xd-json-view :data="xdCascadeSelect" show level="2"></xd-json-view>
        </div>
        <el-image v-if="src" :src="src" style="border:2px solid #e5e5e5"></el-image>
        <div>
          <el-button type="primary" @click="handleDownLoad">测试下载Base64图片</el-button>
        </div>
        <xd-cascade-select
          v-if="0"
          :default-value="['1', 'jfb1', '2807', '54706']"
          v-model="xdCascadeSelect"
          @loadChildren="handleChildren"
          @change="handleChange"
        ></xd-cascade-select>
      </div>
    </div>
    <div class="app-container__item">
      <div class="app-container__item-h1">创建工单</div>
      <div class="app-container__item-body">
        <div class="app-container__item-body-value">
          <xd-json-view :data="xdCascadeSelect" show level="2"></xd-json-view>
        </div>
        <xd-customer-operation
          :maps="customerOperation.map"
          :setting="customerOperation.setting"
          :handle-custom="customerOperation.handleCustom"
        ></xd-customer-operation>
      </div>
    </div>
    <div class="app-container__item">
      <div class="app-container__item-h1">自定义弹窗</div>
      <div class="app-container__item-body">
        <div class="app-container__item-body-value">
          <el-button type="primary" @click="handleClick">点击打开Dialog</el-button>
        </div>
        <xd-dialog
          title="标题"
          :show.sync="show"
          :is-move="true"
        >
          <div style="height: 200px; background: #efefef"></div>
        </xd-dialog>
      </div>
    </div>
    <div class="app-container__item">
      <div class="app-container__item-h1">翻页插件</div>
      <div class="app-container__item-body">
        <div class="app-container__item-body-value">
          <xd-json-view :data="{pageSize:pageSize,hasNextPage:hasNextPage}"></xd-json-view>
        </div>
        <xd-pagination-custom
          :pagesize.sync="pageSize"
          :hasNextPage="hasNextPage"
          @onPagination="handlePagination"
        ></xd-pagination-custom>
      </div>
    </div>
    <div class="app-container__item">
      <div class="app-container__item-h1">图片显示</div>
      <div class="app-container__item-body">
        <xd-item-image ></xd-item-image>
      </div>
    </div>
    <div class="app-container__item">
      <div class="app-container__item-h1">JSON页面展示</div>
      <div class="app-container__item-body">
        <xd-json-view
          :data="list"
          show
          copy
          level="1"
        ></xd-json-view>
      </div>
    </div>
    <div class="app-container__item">
      <div class="app-container__item-h1">无数据插件</div>
      <div class="app-container__item-body">
        <xd-no-data></xd-no-data>
      </div>
    </div>
    <div class="app-test" id="app-test" style="width: 100%; height: 50vh"></div>
  </div>
</template>

<script>
  import XdJsonView from "@/components/XdJsonView";
  import XdNoData from "@/components/XdNoData";
  import XdItemImage from "@/components/XdItemImage";
  import XdPaginationCustom from "@/components/XdPaginationCustom";
  import XdDialog from "@/components/XdDialog";
  import XdCascadeSelect from "@/components/XdCascadeSelect";
  import {Loading} from 'element-ui';
  import axios from 'axios';
  import XdCustomerOperation from "@/components/XdCustomerOperation";
  import qrCode from "@/utils/QRCode";
  import barCode from "@/utils/BarCode";
  const downloadJs = require('downloadjs');
  import testMixins from './testMixins';
  import XdFullScreen from "@/components/XdFullScreen.vue";
  import XdDiffData from "@/components/XdDiffData.vue";


  export default {
    name: 'index',
    components: {
      XdFullScreen,
      XdCustomerOperation,
      XdCascadeSelect,
      XdDialog,
      XdPaginationCustom,
      XdNoData,
      XdJsonView,
      XdItemImage,
      XdDiffData
    },
    data() {
      return {
        newData:{"item":{"partner_id":161,"product_id":60030198,"product_type":"good","product_name":"测试","sub_title":"","short_title":"","thumb":"\\/uploads\\/20231226\\/cebe2bdca9a0f5b63a3c304c4d995971.png","images":[{"src":"\\/uploads\\/20231226\\/84ea06afeacaaf7af10f5b92920f3b18.png"}],"videos":[],"sku_count":0,"sku_on_count":0,"specs":{"dist_price":103,"purchase_price":100,"market_price":300,"jfb_price":300,"min_sale_price":0,"purchase_div_market_discount_ratio":3334,"dist_div_market_discount_ratio":3434,"purchase_div_jfb_discount_ratio":3334,"dist_div_jfb_discount_ratio":3434,"weight":0,"volume":0,"product_code":"","product_bar_code":"","wholesale_prices":[]},"stock_set":{"deduct_mode":"NO","enabled_alert":false,"alert_num":0},"stocks":{"init_num":1000},"category_id":100315,"category_id_path":[100315],"category_name_path":["王睿的测试分类001"],"brand_type":"MA","brand_id":10954,"channel_code":"jufubao","channel_product_id":"60030198","supplier_id":1358285,"supplier_category_ids":[],"product_form_id":"","product_tags":[],"buy_limit":{"enabled":false,"single_max_buy":0,"single_min_buy":0,"single_user":{"day":0,"number":0},"single_card":{"day":0,"number":0},"total_max":{"day":0,"number":0}},"region_limit":{"enabled":false,"tpl_id":""},"deliveries":{"logistics":{"enabled":true,"value":"Iil4PXt58tjoQue0e7Fhc","company":""},"samecity":{"enabled":true},"takeout":{"enabled":true},"auto":{"enabled":false},"virtual":{"enabled":false}},"base_sale_num":0,"audit_status":"N","last_reject_reason":"123123","audit_policy_id":"","audit_time":1703558722,"last_audit_user_id":"lichao","last_audit_username":"李超","submit_audit_user_id":"lichao","submit_audit_username":"李超","submit_audit_time":1703558712,"version":3,"is_public":"N","dist_price_set":{"unit":"ratio","value":300,"method":"default"},"parameters":[],"skus":[],"supplier_partner_id":161,"spider_url":"","create_user_id":"lichao","aftersale_service":[],"product_status":"Y","invoice_name":"1","old_source_from":"","old_source_id":0,"keywords":["测试"],"online_time":0,"wholesale_price_enabled":false,"created_time":1703558705,"updated_time":1703558722,"deleted_time":0},"data":{"content":""}},
        oloData:{"item":{"partner_id":161,"product_id":60030198,"product_type":"good","product_name":"测试","sub_title":"","short_title":"","thumb":"\\/uploads\\/20231226\\/cebe2bdca9a0f5b63a3c304c4d995971.png","images":[{"src":"\\/uploads\\/20231226\\/84ea06afeacaaf7af10f5b92920f3b18.png"}],"videos":[],"sku_count":0,"sku_on_count":0,"specs":{"dist_price":103,"purchase_price":100,"market_price":300,"jfb_price":300,"min_sale_price":0,"purchase_div_market_discount_ratio":3334,"dist_div_market_discount_ratio":3434,"purchase_div_jfb_discount_ratio":3334,"dist_div_jfb_discount_ratio":3434,"weight":0,"volume":0,"product_code":"","product_bar_code":"","wholesale_prices":[],"date_prices":[]},"stock_set":{"deduct_mode":"NO","enabled_alert":false,"alert_num":0},"stocks":{"init_num":1000},"category_id":100315,"category_id_path":[100315],"category_name_path":["王睿的测试分类001"],"brand_type":"MA","brand_id":10954,"channel_code":"jufubao","channel_product_id":"60030198","supplier_id":1358285,"supplier_category_ids":[],"product_form_id":"blessing","product_tags":[],"buy_limit":{"enabled":false,"single_max_buy":0,"single_min_buy":0,"single_user":{"day":0,"number":0},"single_card":{"day":0,"number":0},"total_max":{"day":0,"number":0}},"region_limit":{"enabled":false,"tpl_id":""},"deliveries":{"logistics":{"enabled":true,"value":"Iil4PXt58tjoQue0e7Fhc","company":""},"samecity":{"enabled":true},"takeout":{"enabled":true},"auto":{"enabled":false},"virtual":{"enabled":false}},"base_sale_num":0,"audit_status":"D","last_reject_reason":"","audit_policy_id":"","audit_time":0,"last_audit_user_id":"","last_audit_username":"","submit_audit_user_id":"","submit_audit_username":"","submit_audit_time":0,"version":4,"is_public":"N","dist_price_set":{"unit":"ratio","value":300,"method":"default"},"parameters":[],"skus":[],"supplier_partner_id":161,"spider_url":"","create_user_id":"lichao","aftersale_service":[],"product_status":"Y","invoice_name":"1","old_source_from":"","old_source_id":0,"keywords":["测试"],"online_time":0,"wholesale_price_enabled":false,"updated_time":1705472590,"deleted_time":0},"data":{"content":"<p>123123<\\/p>"}},
        src: null,
        screen:false,
        customerOperation: {
          value: null,
          handleCustom: ({action, data}) => {
            //计算价格总价
            if (action === 'addPrice') {
              return this.$xdHelper.multiplyFloatNumber(data.price, data.num)
            }

            //获取表头
            if (action === 'headers') {
              if (data === 'refund') {
                return [
                  {type: 'selection'},
                  {
                    type: 'priceNumber',
                    prop: "priceNumber",
                    align: 'center',
                    width: 150,
                    label: '价格&数量',
                    message: ['sale_price', 'num']
                  },
                  {type: 'price', prop: 'refunded_price', align: 'center', width: 150, label: '已退金额'},
                  {type: 'price', prop: 'allow_refunded_price', align: 'center', width: 150, label: '可退金额'},
                  {type: 'input', prop: 'refund_price', align: 'center', width: 150, label: '退款金额'}
                ]
              }
              if (data === 'change') {
                return [
                  {type: 'selection'},
                  {
                    type: 'priceNumber',
                    prop: "priceNumber",
                    align: 'center',
                    width: 150,
                    label: '价格&数量',
                    message: ['price', 'num']
                  },
                  {type: 'price', prop: 'from_price', align: 'center', width: 150, label: '平台进货价'},
                  {type: 'price', prop: 'sale_price', align: 'center', width: 150, label: '售价'},
                ]
              }
              if (data === 'again') {
                return [
                  {type: 'selection'},
                  {type: 'normal', prop: 'num', align: 'center', width: 150, label: '已换数量'},
                  {
                    type: 'priceNumber',
                    prop: "priceNumber",
                    align: 'center',
                    width: 150,
                    label: '价格&数量',
                    message: ['price', 'num']
                  },
                  {type: 'normal', prop: 'total_price', align: 'center', center: 150, label: '订单金额'},
                  {type: 'input', prop: 'again_num', align: 'center', width: 150, label: '补发数量'}
                ]
              }
            }

            //获取商品信息插件数据格式
            if(action === 'productInfo') {
              return {
                thumb: data.image,
                title: data.name,
                icon: data.icon,
                specific: data.category,
              }
            }

            //获取交换商品数据
            if(action === 'getProductInfo'){
              let {level, select, item, resolve } = data;
              this.handleChildren({level, select, item}, resolve);
            }

          },
          setting: {
            btn_name: '完成并创建售后单',
            btn_size: 'mini',
            dialog_width: '1000px',
            default_title: '完成并创建售后单',

            //操作方式
            operationList: [
              {label: '退款', value: 'refund'},
              {label: '退货退款', value: 'refund_and_good'},
              {label: '换货', value: 'exchange'},
              {label: '补发', value: 'again'},
              {label: '0元换购', value: 'zero'},
            ],

            //售后类型
            typeList: [
              {"label": "供应商未及时提供物流单号", "value": 1, "type": 200},
              {"label": "供应商提供虚假物流单号", "value": 2, "type": 200},
              {"label": "供应商漏发、错发产品", "value": 3, "type": 200},
              {"label": "供应商产品无库存未及时通知", "value": 4, "type": 200},
              {"label": "供应商产品存在质量问题", "value": 5, "type": 200},
              {"label": "物流原因导致配送错误或延误", "value": 6, "type": 201},
              {"label": "物流原因导致包裹破损或丢失 ", "value": 7, "type": 201},
              {"label": "供应商处理问题不当导致投诉升级", "value": 8, "type": 202},
              {"label": "供应商原因导致平台产生损失", "value": 9, "type": 202},
              {"label": "其他", "value": 10, "type": 203}
            ],

            //审核人员
            userCheckList: [
              {label: '退款', value: 'refund'},
              {label: '退货退款', value: 'refund_and_good'},
              {label: '换货', value: 'exchange'},
              {label: '补发', value: 'again'},
              {label: '0元换购', value: 'zero'},
            ],

            //快递列表
            expressList: [
              {label: '退款', value: 'refund'},
              {label: '退货退款', value: 'refund_and_good'},
              {label: '换货', value: 'exchange'},
              {label: '补发', value: 'again'},
              {label: '0元换购', value: 'zero'},
            ],

            //退款返回渠道
            refundList: [
              {label: '原路返回', value: 'origin'},
              {label: '线下转账', value: 'offline'},
            ],

            //表列表
            tableList:[
              {
                id: '12987122',
                name: '好滋好味鸡蛋仔',
                category: '江浙小吃、小吃零食',
                desc: '荷兰优质淡奶，奶香浓而不腻',
                address: '上海市普陀区真北路',
                shop: '王小虎夫妻店',
                shopId: '10333',
                refunded_price: 0,
                sale_price: 8000,
                allow_refunded_price: 8000,
                again_num:'',
                num: 1,
                icon: '实',
                is_required: true,
                sort: 10,
                status: '已完成',
                image: 'https://jfbcake.oss-cn-beijing.aliyuncs.com/uploads/20200710/6e6e8d3be52ec622216e667620ee9634.jpg',
              },
              {
                id: '12987123',
                name: '好滋好味鸡蛋仔',
                category: '江浙小吃、小吃零食',
                desc: '荷兰优质淡奶，奶香浓而不腻',
                address: '上海市普陀区真北路',
                shop: '王小虎夫妻店',
                shopId: '10333',
                refunded_price: 10000,
                sale_price: 12000,
                allow_refunded_price: 2000,
                again_num: '',
                num: 1,
                sort: 10,
                icon: '生',
                is_required: false,
                status: 2,
                image: 'https://jfbcake.oss-cn-beijing.aliyuncs.com/uploads/20200710/6e6e8d3be52ec622216e667620ee9634.jpg'
              },
              {
                id: '12987125',
                name: '好滋好味鸡蛋仔',
                category: '江浙小吃、小吃零食',
                desc: '荷兰优质淡奶，奶香浓而不腻',
                address: '上海市普陀区真北路',
                shop: '王小虎夫妻店',
                shopId: '10333',
                refunded_price: 40000,
                sale_price: 20000,
                allow_refunded_price: 0,
                again_num: '',
                num: 2,
                icon: '电',
                is_required: true,
                sort: 10,
                status: 1,
                image: 'https://jfbcake.oss-cn-beijing.aliyuncs.com/uploads/20200710/6e6e8d3be52ec622216e667620ee9634.jpg'
              },
              {
                id: '12987126',
                name: '好滋好味鸡蛋仔',
                category: '江浙小吃、小吃零食',
                desc: '荷兰优质淡奶，奶香浓而不腻',
                address: '上海市普陀区真北路',
                shop: '王小虎夫妻店',
                shopId: '10333',
                refunded_price: 0,
                sale_price: 30009,
                allow_refunded_price: 30009,
                again_num: '',
                num: 1,
                icon: '线',
                is_required: true,
                sort: 10,
                status: 0,
                image: 'https://jfbcake.oss-cn-beijing.aliyuncs.com/uploads/20200710/6e6e8d3be52ec622216e667620ee9634.jpg'
              }
            ],

          },
          map: {
            operation: 'fix_operation',
            type: 'fix_type',
            user_check: 'fix_user_check',
            description: 'fix_description',
            refund_channel: 'fix_refund_channel',
            express_id: 'fix_express_id',
            express_num: 'fix_express_num',
            selectTableList: 'fix_selectTableList',
            selectTableListIds: 'fix_selectTableListIds',
            refund_price: 'fix_refund_price',
            again_num: 'fix_again_num',
          }
        },

        list: {
          //支付信息
          unit: '点', //单位
          card_price: 300, //福卡总计
          total_price: 360, //支付总计
          express_price: 30, //快递运费
          card: [ //消费卡列表
            // {
            //   card_number: "101070100032692",
            //   card_type_name: "聚福宝福卡测试",
            //   point: "45"
            // }
          ],
          otherPay: { //其他支付补差
            name: '微信支付',
            price: 30,
          },

          payTotal: {
            name: '合计：',
            price: 30,
          },

          //电子码
          code: [
            {
              label: "密码：",
              value: "1515"
            },
            {
              label: "密码：",
              value: "45122"
            }
          ],
          barcode: [
            {
              label: "券号:cardcardcardcard0001 密码：21337",
              value: "http://sandbox-m-cake.jufubao.cn/rest/3.0/cakeshop/order/order/barcode_img?c=&p=21337"
            },
            {
              label: "券号:cardcardcardcard0001 密码：21337",
              value: "http://sandbox-m-cake.jufubao.cn/rest/3.0/cakeshop/order/order/barcode_img?c=cardcardcardcard0001&p=21337"
            }
          ],
          twocode: [
            {
              label: "券号:cardcardcardcard0001 密码：21337",
              value: "https://c.jufubao.cn/web/pb/qrcode/image?content=21337"
            },
            {
              label: "券号:cardcardcardcard0001 密码：21337",
              value: "https://c.jufubao.cn/web/pb/qrcode/image?content=21337"
            }
          ],

          //自提模块
          self: {
            receipt_phone: "15110208397",
            receipt_username: "高世勇",
          },

          address: {
            receipt_address: "北京北京石景山区八大处科技园区小区AQ1-1-2000",
            receipt_phone: "15110208397",
            receipt_username: "高世勇",
          },


          //快递必要信息
          express: {
            number: 'YT4770941764061',
            company: '圆通速递',
            process: [
              {
                "date": "2020-09-13 09:42:41",
                "context": "\u5ba2\u6237\u7b7e\u6536\u4eba: \u4efb\u589e\u9e4f \u5df2\u7b7e\u6536 \u611f\u8c22\u4f7f\u7528\u5706\u901a\u901f\u9012\uff0c\u671f\u5f85\u518d\u6b21\u4e3a\u60a8\u670d\u52a1 \u5982\u6709\u7591\u95ee\u8bf7\u8054\u7cfb\uff1a13400242093\uff0c\u6295\u8bc9\u7535\u8bdd\uff1a13315610360"
              }, {
                "date": "2020-09-11 09:58:32",
                "context": "\u9752\u5e74\u793e\u533a\u4e8c\u671f\u5317\u95e8\u4e1c\u4fa7\u5e95\u554616-6\u718a\u732b\u5feb\u6536\u5df2\u53d1\u51fa\u81ea\u63d0\u901a\u77e5\uff0c\u8bf7\u4e0a\u95e8\u81ea\u63d0\uff0c\u8054\u7cfb\u7535\u8bdd17370265893"
              }
            ]
          },

          //配送模块
          send: {
            label: '专人配送/配送时间',
            value: '2020-08-16 11:30:00'
          },




          //订单信息
          orderInfo: [
            {label: '订单号：', value: '12588744664462252'},
            {label: '物流单号：', value: 'JT5020234707556'},
            //{label: '合计消费：', value: '90', unit: true},
            {label: '下单时间：', value: '2020-08-15 10:25:56'},
            {label: '支付时间：', value: ' 2020-08-15 12:00:00'},
            {label: '确认时间：', value: '2020-08-15 12:00:00'},
            {label: '发货时间：', value: '2020-08-15 12:00:00'},
            {label: '订单备注：', value: '通过记录自己从纽约出发到洛杉矶，再飞到中国的经历'},
            {label: '祝福语：', value: '生日快乐'},
          ],

          //购买产品对象数组
          title: '我爱蛋糕（天洋城店）', //订单状态 （必填）
          shop_address: '北京北京石景山区八大处科技园区小区AQ1-1-2000', //店铺名称
          titleIcon: true, //是否显示右箭头图片 （必填）
          products: [
            {
              id: 161078,
              num: 3, //产品数量
              product_id: 423457, //商品ID （必填）
              product_name: "金龙鱼 醇香菜籽油 5L*4桶", //产品名称 （必填）
              product_uuid: '5f71e590-ee83-11ea-b9ba-debcd2503074', //产品uuid （选填）
              product_sku: "0", //产品型号ID （选填）
              product_sku_text: "", //产品型号名称 （选填）
              price: 312, //产品价格 （必填）
              thumb: "https://jfbcake.oss-cn-beijing.aliyuncs.com/uploads/20210126/26cfc49abbdc33eeb187ca22730b995a.jpg?x-oss-process=style/400_400" //产品缩略图 （必填）
            },
            {
              id: 161078,
              num: 4, //产品数量
              product_id: 423457, //商品ID （必填）
              product_name: "金龙鱼 醇香菜籽油 5L*4桶", //产品名称 （必填）
              product_uuid: '5f71e590-ee83-11ea-b9ba-debcd2503074', //产品uuid （选填）
              product_sku: "0", //产品型号ID （选填）
              product_sku_text: "", //产品型号名称 （选填）
              price: 312, //产品价格 （必填）
              thumb: "https://jfbcake.oss-cn-beijing.aliyuncs.com/uploads/20210126/5e4a80111fb9c9a85b8b7c9ce85095e5.jpg?x-oss-process=style/400_400" //产品缩略图 （必填）
            },
            {
              id: 161078,
              num: 1, //产品数量
              product_id: 423457, //商品ID （必填）
              product_name: "金龙鱼 醇香菜籽油 5L*4桶", //产品名称 （必填）
              product_uuid: '5f71e590-ee83-11ea-b9ba-debcd2503074', //产品uuid （选填）
              product_sku: "0", //产品型号ID （选填）
              product_sku_text: "", //产品型号名称 （选填）
              price: 312, //产品价格 （必填）
              thumb: "https://jfb-public-images.oss-cn-qingdao.aliyuncs.com/20200426093257532.jpg?x-oss-process=style/200_200" //产品缩略图 （必填）
            },
            {
              id: 161078,
              num: 1, //产品数量
              product_id: 423457, //商品ID （必填）
              product_name: "金龙鱼 醇香菜籽油 5L*4桶", //产品名称 （必填）
              product_uuid: '5f71e590-ee83-11ea-b9ba-debcd2503074', //产品uuid （选填）
              product_sku: "0", //产品型号ID （选填）
              product_sku_text: "", //产品型号名称 （选填）
              price: 312, //产品价格 （必填）
              thumb: "https://jfbcake.oss-cn-beijing.aliyuncs.com/uploads/20210301/d3aebbf398b2832634b18a54089a33a0.jpg?x-oss-process=style/400_400" //产品缩略图 （必填）
            }
          ],

          //显示操作按钮（选填）（不显示按钮btn为空数组）
          btn: [
            {'label': '取消订单', value: 1, type: 'info', radius: '12rpx'},
            {'label': '去付款', value: 2, type: 'primary', radius: '12rpx'},
          ]
        },

        pageSize: 1,//当前页面数量
        hasNextPage: true, //是否有下一页

        show:false,
        token: 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwOlwvXC9zYW5kYm94LWMuanVmdWJhby5jbiIsImlhdCI6MTY0MDE0NDI0MywiZXhwIjoxNjQwMjMwNjQzLCJhY2NvdW50X2lkIjo4LCJtZXJjaGFudF9pZCI6IjBfb05ua2M2SHVtd1JqV0Nja3c3WFBxdmNpbWJyWSIsInBsYXRmb3JtX2NvZGUiOiJ3eCIsImlwIjoiMTAuMC4yLjQiLCJjaGVja3N1bSI6ImFhYmNkNzJhNTRlYmE0MjI3MGMyODYzNzI1MTk5ODEyIn0.e7AgEQKtj_Ju7-_FQbTEdqZTpKs1DtX2RVe8ZH-MKoE',
        getCity: 'http://sandbox-c.jufubao.cn/api/pb/city/getsub',
        xdCascadeSelect: {},
      }
    },

    created(){
      // qrCode({
      //   text: 'https://www.npmjs.com/package/qrcode#todataurltext-options-cberror-url'
      // })
      //   .then(url => {
      //     this.src = url;
      //   })
      //   .catch(err => {
      //     console.error(err)
      //   })
      //
      // barCode({
      //   text: '123456789098765ASF'
      // })
      //   .then(url => {
      //     this.src = url;
      //   })
      //   .catch(err => {
      //     console.error(err)
      //   })
      console.log('parent',this)
      let $node = this.JfbPage(this, 'app-test', {
        name:'TestA',
        mode:{
          one: true,
          two: false,
          three: true,
        },
        mixins: [testMixins],
        filters: {},
        watch: { },
        computed:{},
        methods:{
          handle(){
            console.log('children',this)
          }
        },
      })
    },
    methods: {
      handleDownLoad(){
        if(this.src) {
          downloadJs(this.src, '下载二维码.png');
        }
      },
      handlePagination(){
        if(this.pageSize > 3) this.hasNextPage = false;
        else this.hasNextPage = true;
      },

      handleClick(){
        this.show = true;
      },



      handleChildren({level, select, item}, resolve){
        let loading = Loading.service({});
        console.log('handleChildren', level, select, item)
        axios({
          method: 'get',
          url: this.getCity,
          params: {
            token: this.token,
            parent_code: level === 0 ? 0: select.value
          }
        })
          .then((res)=>{
            let temp = [];
            res.data.result.map((item)=>{
              temp.push({...item, value: item['city_code'], label: item['name']});
            });
            resolve({
              list: temp, //数据列表(必选)
              isChildren: level < 3, //是否有子集(必选)
              placeholder: '请选择城市', //占位符(必选)
              custom: 1, //自定义字段
              params: {a:1,b:2} //自定义字段
            });
            loading.close();
            console.log('handleChildren',temp);
          })
          .catch((error)=>{

          });

      },
      handleChange(list){
        console.log('handleChange',list)
      }
    }
  }
</script>

<style lang="scss" scoped>
  .app-container {
    padding: 20px;

    &__item {
      margin-bottom: 20px;

      &-h1 {
        height: 50px;
        line-height: 50px;
        padding: 0 20px;
        font-weight: bold;
        background: #efefef;
        font-size: 16px;
        text-align: left;
        margin-bottom: 30px;
      }

      &-body {
        padding: 0 20px;
      }
    }
  }
</style>
