"use strict";const uni_modules_uviewPlus_libs_function_index=require("../../libs/function/index.js");const uni_modules_uviewPlus_libs_function_test=require("../../libs/function/test.js");const value={computed:{value(){const{text:text,mode:mode,format:format,href:href}=this;if(mode==="price"){if(uni_modules_uviewPlus_libs_function_test.test.func(format)){return format(text)}return uni_modules_uviewPlus_libs_function_index.priceFormat(text,2)}if(mode==="date"){!uni_modules_uviewPlus_libs_function_test.test.date(text)&&uni_modules_uviewPlus_libs_function_index.error();if(uni_modules_uviewPlus_libs_function_test.test.func(format)){return format(text)}if(format){return uni_modules_uviewPlus_libs_function_index.timeFormat(text,format)}return uni_modules_uviewPlus_libs_function_index.timeFormat(text,"yyyy-mm-dd")}if(mode==="phone"){if(uni_modules_uviewPlus_libs_function_test.test.func(format)){return format(text)}if(format==="encrypt"){return`${text.substr(0,3)}****${text.substr(7)}`}return text}if(mode==="name"){if(uni_modules_uviewPlus_libs_function_test.test.func(format)){return format(text)}if(format==="encrypt"){return this.formatName(text)}return text}if(mode==="link"){!uni_modules_uviewPlus_libs_function_test.test.url(href)&&uni_modules_uviewPlus_libs_function_index.error();return text}return text}},methods:{formatName(name){let value2="";if(name.length===2){value2=name.substr(0,1)+"*"}else if(name.length>2){let char="";for(let i=0,len=name.length-2;i<len;i++){char+="*"}value2=name.substr(0,1)+char+name.substr(-1,1)}else{value2=name}return value2}}};exports.value=value;
