diff --git a/README.md b/README.md index dab1b4f..03211d0 100644 --- a/README.md +++ b/README.md @@ -1 +1,53 @@ -# intellij-assistant \ No newline at end of file +# intellij-assistant + +## 项目简介 + +你的智能私人助理,从文本,图片,文件中 识别并创建日程信息,让你不漏掉任务重要事项。 +背景:我妻子是一名律师,当他收到法院开庭传票或未来计划性的事情,往往是在桌面的日历本上手写下日程。还有几次因为忘了日程,差点耽误大事的经历。于是我想开发个小程序帮他去识别一些传票(短信,图片,PDF),在手机上创建日程,提前提醒。 + +他需要一个OCR识别图片和PDF,我选用了百度智能云,因为他有足够多的免费额度。 + +还需要一个识别日程的功能,chatgpt做的很好,具有语义理解,时间推理(例如明天下午),地点人物等实体识别(识别日程地点)和关键信息提取(日程名称)。选用Azure Openai,国内使用起来最方便。 + +大模型默认选择通义千问。 + +客户端选择微信小程序,用户使用成本最小,也支持添加系统日历的功能。 + +# 预览 + +| ![截图1](imgs/demo_1.jpg) | ![截图2](imgs/demo_2.jpg) | ![截图3](imgs/demo_3.jpg) | +|:-------------------------:|:-------------------------:|:-------------------------:| + +## server + +spring-boot + h2数据库 + +src/main/resource/application.properties 把对应的项值填充了 + +mvn clean install 就可以生成一个可执行的jar包,很简单。在前面放一个nginx,绑定域名既可以上线。 + +[x] 用户管理(新建,查询,邀请评价) + +[x]日程管理(新建,删除,列表查询) + +[x]统计(用户操作分析) + + + +## weapp + +用微信开发者 打开该目录即可 + +app.js中的API_KEY,ADMIN_HOST按照你的实际情况填写好。 APK_KEY对应就是服务端项目的application.properties的server.api.key的值 + +[x]从文本,图片,PDF识别日程,修改并创建 + +[x]我的日程(列表,删除,再次创建) + +[ ]分享日程 + +[ ]交互优化 + +# 试用 + +QR Code diff --git a/imgs/demo_1.jpg b/imgs/demo_1.jpg new file mode 100644 index 0000000..feb7ee5 Binary files /dev/null and b/imgs/demo_1.jpg differ diff --git a/imgs/demo_2.jpg b/imgs/demo_2.jpg new file mode 100644 index 0000000..7f5d4d1 Binary files /dev/null and b/imgs/demo_2.jpg differ diff --git a/imgs/demo_3.jpg b/imgs/demo_3.jpg new file mode 100644 index 0000000..8d9e213 Binary files /dev/null and b/imgs/demo_3.jpg differ diff --git a/imgs/public.png b/imgs/public.png new file mode 100644 index 0000000..61eeb88 Binary files /dev/null and b/imgs/public.png differ diff --git a/intelli-assistant-admin/pom.xml b/intelli-assistant-admin/pom.xml new file mode 100644 index 0000000..ae6b4f2 --- /dev/null +++ b/intelli-assistant-admin/pom.xml @@ -0,0 +1,83 @@ + + + 4.0.0 + + org.springframework.boot + spring-boot-starter-parent + 2.7.14 + + + cn.intellij-assistant + admin + 0.0.1-SNAPSHOT + admin + Demo project for Spring Boot + + 1.8 + + + + ch.qos.logback + logback-classic + + + org.springframework.boot + spring-boot-starter-data-jpa + + + org.springframework.boot + spring-boot-starter-web + + + org.projectlombok + lombok + 1.18.24 + + + com.alibaba + fastjson + 2.0.32 + + + joda-time + joda-time + 2.10.14 + + + com.h2database + h2 + runtime + + + org.springframework.boot + spring-boot-starter-test + test + + + com.squareup.okhttp3 + okhttp + 4.9.1 + + + com.squareup.okhttp3 + okhttp-dnsoverhttps + 4.9.1 + + + org.springframework.boot + spring-boot-starter-thymeleaf + + + + + + + + org.springframework.boot + spring-boot-maven-plugin + + + + + diff --git a/intelli-assistant-admin/src/main/java/cn/intellijassistant/admin/AdminApplication.java b/intelli-assistant-admin/src/main/java/cn/intellijassistant/admin/AdminApplication.java new file mode 100644 index 0000000..d6698ef --- /dev/null +++ b/intelli-assistant-admin/src/main/java/cn/intellijassistant/admin/AdminApplication.java @@ -0,0 +1,13 @@ +package cn.intellijassistant.admin; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; + +@SpringBootApplication +public class AdminApplication { + + public static void main(String[] args) { + SpringApplication.run(AdminApplication.class, args); + } + +} diff --git a/intelli-assistant-admin/src/main/java/cn/intellijassistant/admin/OperationLogType.java b/intelli-assistant-admin/src/main/java/cn/intellijassistant/admin/OperationLogType.java new file mode 100644 index 0000000..5a32659 --- /dev/null +++ b/intelli-assistant-admin/src/main/java/cn/intellijassistant/admin/OperationLogType.java @@ -0,0 +1,52 @@ +package cn.intellijassistant.admin; + +import lombok.Getter; + +import java.util.HashMap; +import java.util.Map; + +/** + * @Author: Jason Wu + * @Date: 2023/7/31 + * @Description: + */ +@Getter +public enum OperationLogType { + + TXT_RECOGNIZE(0, "识别文字"), + IMAGE_RECOGNIZE(1, "识别图片"), + + PDF_RECOGNIZE(2, "识别PDF"), + + CREATE_SCHEDULE_TXT(10, "创建文字日程"), + CREATE_SCHEDULE_IMAGE(11, "创建图片日程"), + CREATE_SCHEDULE_PDF(12, "创建PDF日程"), + + CREATE_SCHEDULE_AGAIN(13, "再一次创建日程"), + CREATE_SCHEDULE_TXT_CACHE(20, "从缓存创建文字日程"), + CREATE_SCHEDULE_IMAGE_CACHE(21, "从缓存创建图片日程"), + CREATE_SCHEDULE_PDF_CACHE(22, "从缓存创建PDF日程"), + + APP_LOAD(50, "应用加载") + ; + int value; + String desc; + + OperationLogType(int value, String desc) { + this.value = value; + this.desc = desc; + } + + + static Map map = new HashMap<>(); + + static { + for (OperationLogType value : OperationLogType.values()) { + map.put(value.getValue(), value.getDesc()); + } + } + + public static String findByValue(int v) { + return map.get(v); + } +} diff --git a/intelli-assistant-admin/src/main/java/cn/intellijassistant/admin/conf/AuthInterceptor.java b/intelli-assistant-admin/src/main/java/cn/intellijassistant/admin/conf/AuthInterceptor.java new file mode 100644 index 0000000..edac4a7 --- /dev/null +++ b/intelli-assistant-admin/src/main/java/cn/intellijassistant/admin/conf/AuthInterceptor.java @@ -0,0 +1,39 @@ +package cn.intellijassistant.admin.conf; + +import org.springframework.stereotype.Component; +import org.springframework.web.method.HandlerMethod; +import org.springframework.web.servlet.handler.HandlerInterceptorAdapter; + +import javax.annotation.Resource; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +/** + * @Author: Jason Wu + * @Date: 2023/7/26 + * @Description: + */ +@Component +public class AuthInterceptor extends HandlerInterceptorAdapter { + + @Resource + private Configuration configuration; + @Override + public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception { + if (handler instanceof HandlerMethod) { + //做一个简单的鉴权 + String apiKey = request.getHeader("x-api-key"); + if (apiKey == null) { + apiKey = request.getParameter("x-api-key"); + } + if (apiKey == null || apiKey.length() == 0) return false; + + if (configuration.getServerApiKey().equals(apiKey)) { + return true; + } + + return false; + } + return true; + } +} diff --git a/intelli-assistant-admin/src/main/java/cn/intellijassistant/admin/conf/Configuration.java b/intelli-assistant-admin/src/main/java/cn/intellijassistant/admin/conf/Configuration.java new file mode 100644 index 0000000..4019eac --- /dev/null +++ b/intelli-assistant-admin/src/main/java/cn/intellijassistant/admin/conf/Configuration.java @@ -0,0 +1,31 @@ +package cn.intellijassistant.admin.conf; + +import lombok.Getter; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.stereotype.Component; + +/** + * @Author: Jason Wu + * @Date: 2023/12/14 + * @Description: + */ +@Component +@Getter +public class Configuration { + + @Value("${openai.azure.endpoint}") + private String openaiAzureEndpoint; + + @Value("${openai.azure.api.key}") + private String openaiAzureApiKey; + + @Value("${baidu.bce.ak}") + private String baiduBceAK; + + @Value("${baidu.bce.sk}") + private String baiduBecSK; + + @Value("${server.api.key}") + private String serverApiKey; + +} diff --git a/intelli-assistant-admin/src/main/java/cn/intellijassistant/admin/conf/InterceptorAppConfig.java b/intelli-assistant-admin/src/main/java/cn/intellijassistant/admin/conf/InterceptorAppConfig.java new file mode 100644 index 0000000..c4ca160 --- /dev/null +++ b/intelli-assistant-admin/src/main/java/cn/intellijassistant/admin/conf/InterceptorAppConfig.java @@ -0,0 +1,23 @@ +package cn.intellijassistant.admin.conf; + +import org.springframework.stereotype.Component; +import org.springframework.web.servlet.config.annotation.InterceptorRegistry; +import org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport; + +import javax.annotation.Resource; + +/** + * @Author: Jason Wu + * @Date: 2023/7/26 + * @Description: + */ +@Component +public class InterceptorAppConfig extends WebMvcConfigurationSupport { + + @Resource + private AuthInterceptor authInterceptor; + @Override + protected void addInterceptors(InterceptorRegistry registry) { + registry.addInterceptor(authInterceptor); + } +} diff --git a/intelli-assistant-admin/src/main/java/cn/intellijassistant/admin/controller/AccountController.java b/intelli-assistant-admin/src/main/java/cn/intellijassistant/admin/controller/AccountController.java new file mode 100644 index 0000000..9b098ad --- /dev/null +++ b/intelli-assistant-admin/src/main/java/cn/intellijassistant/admin/controller/AccountController.java @@ -0,0 +1,129 @@ +package cn.intellijassistant.admin.controller; + +import cn.intellijassistant.admin.conf.Configuration; +import cn.intellijassistant.admin.domain.Account; +import cn.intellijassistant.admin.dto.AccountLoginDTO; +import cn.intellijassistant.admin.dto.BaiduTokenDTO; +import cn.intellijassistant.admin.repository.AccountMapper; +import cn.intellijassistant.admin.repository.ScheduleMapper; +import cn.intellijassistant.admin.service.ISnsService; +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONObject; +import lombok.extern.slf4j.Slf4j; +import okhttp3.MediaType; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; + +import javax.annotation.Resource; +import java.io.IOException; +import java.util.Optional; + +/** + * @Author: Jason Wu + * @Date: 2023/8/1 + * @Description: + */ +@RestController +@Slf4j +@RequestMapping("/admin/accounts") +public class AccountController { + @Resource + private ISnsService snsService; + @Resource + private AccountMapper accountMapper; + @Resource + private ScheduleMapper scheduleMapper; + @Resource + private Configuration configuration; + + private String baiduToken; + private Long baiduTokenExpiredAt = -1L; + + private String getBaiduToken() { + if (baiduTokenExpiredAt == -1 || System.currentTimeMillis() > baiduTokenExpiredAt) { + loadBaiduToken(false); + } + return baiduToken; + } + static final OkHttpClient HTTP_CLIENT = new OkHttpClient().newBuilder().build(); + + final + private synchronized void loadBaiduToken(boolean refresh) { + if (!refresh && baiduTokenExpiredAt > System.currentTimeMillis()) return; + MediaType mediaType = MediaType.parse("application/json"); + RequestBody body = RequestBody.create(mediaType, ""); + String baidubceUrl = String.format("https://aip.baidubce.com/oauth/2.0/token?client_id=%s&client_secret=%s&grant_type=client_credentials", + configuration.getBaiduBceAK(), configuration.getBaiduBecSK()); + Request request = new Request.Builder() + .url(baidubceUrl) + .method("POST", body) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + Response response = null; + try { + response = HTTP_CLIENT.newCall(request).execute(); + String responseString = response.body().string(); + JSONObject jsonObject = JSON.parseObject(responseString); + if (jsonObject.getString("error") != null) { + log.error("登录失败, response:{}", responseString); + return; + } + baiduToken = jsonObject.getString("access_token"); + //往前推5天 + baiduTokenExpiredAt = System.currentTimeMillis() + jsonObject.getLong("expires_in") * 1000 - 432000000; + } catch (IOException e) { + log.error("百度登录请求接口失败", e); + } + + + } + + @GetMapping("/invite_comment") + public boolean inviteComment(@RequestParam("openid") String openid) { + if (openid == null || openid.length() != 28) return false; + Optional userOptional = accountMapper.findById(openid); + if (userOptional.isPresent()) { + Account account = userOptional.get(); + if (account.isCommentInvited()) return false; + return scheduleMapper.countByOpenid(openid) >= 10 ; + } + Account account = new Account(); + account.setId(openid); + account.setCommentInvited(false); + account.setTimeCreate(System.currentTimeMillis()); + accountMapper.save(account); + return false; + } + + @GetMapping("/baiduToken/refresh") + public BaiduTokenDTO refreshBaiduToken() { + loadBaiduToken(true); + return new BaiduTokenDTO(baiduToken, baiduTokenExpiredAt); + } + + @GetMapping("/login") + public AccountLoginDTO login(@RequestParam("code") String code) throws IOException { + AccountLoginDTO result = new AccountLoginDTO(); + result.setBaiduToken(getBaiduToken()); + String openidRespStr = snsService.openid(code); + String openid = JSON.parseObject(openidRespStr).getString("openid"); + result.setOpenid(openid); + result.setNeedInviteComment(inviteComment(openid)); + return result; + } + + @PostMapping("/{id}/commentInvited") + public void update(@PathVariable String id) { + + accountMapper.commentInvited(id); + } +} diff --git a/intelli-assistant-admin/src/main/java/cn/intellijassistant/admin/controller/HelpRememberController.java b/intelli-assistant-admin/src/main/java/cn/intellijassistant/admin/controller/HelpRememberController.java new file mode 100644 index 0000000..2648d71 --- /dev/null +++ b/intelli-assistant-admin/src/main/java/cn/intellijassistant/admin/controller/HelpRememberController.java @@ -0,0 +1,243 @@ +package cn.intellijassistant.admin.controller; + +import cn.intellijassistant.admin.conf.Configuration; +import cn.intellijassistant.admin.dto.ScheduleInfoDTO; +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONObject; +import lombok.extern.slf4j.Slf4j; +import okhttp3.Cache; +import okhttp3.Dns; +import okhttp3.HttpUrl; +import okhttp3.MediaType; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; +import okhttp3.dnsoverhttps.DnsOverHttps; +import org.joda.time.DateTime; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.core.io.Resource; +import org.springframework.core.io.ResourceLoader; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import javax.annotation.PostConstruct; +import java.io.BufferedReader; +import java.io.File; +import java.io.IOException; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.nio.charset.StandardCharsets; +import java.text.SimpleDateFormat; +import java.util.Date; +import java.util.HashMap; +import java.util.concurrent.TimeUnit; + +/** + * @Author: Jason Wu + * @Date: 2023/8/23 + * @Description: + */ +@RestController +@Slf4j +@RequestMapping("/admin/help_remember") +public class HelpRememberController { + + @Autowired + private ResourceLoader resourceLoader; + + @Autowired + private Configuration configuration; + + public String requestBodyFormat; + + public static final String QianWenApiKey = "sk-your key"; + public static final String QIANWEN_API_ENDPOINT = "https://dashscope.aliyuncs.com/api/v1/services/aigc/text-generation/generation"; + + private String promptTemplate; + + @PostConstruct + public void postConstruct(){ + Resource resource = resourceLoader.getResource("classpath:help_remember_request_body.json"); + try (InputStream inputStream = resource.getInputStream(); + BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(inputStream, StandardCharsets.UTF_8))) { + StringBuilder content = new StringBuilder(); + String line; + while ((line = bufferedReader.readLine()) != null) { + content.append(line).append("\n"); + } + requestBodyFormat = content.toString(); + // Use the resource content as needed + } catch (IOException e) { + // Handle the exception + } + + // 读取提示词模板 + Resource promptResource = resourceLoader.getResource("classpath:qianwen_prompt_template.txt"); + try (InputStream promptInputStream = promptResource.getInputStream(); + BufferedReader promptBufferedReader = new BufferedReader(new InputStreamReader(promptInputStream, StandardCharsets.UTF_8))) { + StringBuilder promptContent = new StringBuilder(); + String promptLine; + while ((promptLine = promptBufferedReader.readLine()) != null) { + promptContent.append(promptLine).append("\n"); + } + promptTemplate = promptContent.toString(); + } catch (IOException e) { + log.error("Failed to load prompt template", e); + // 设置一个默认的提示词模板作为后备 + promptTemplate = "你是一个日程提取助手。请帮我从用户输入中提取日程信息。\n" + + "当前时间是:%s\n用户输入:%s\n" + + "请返回JSON格式:{\"dateTimeFrom\":\"yyyy-MM-dd HH:mm\",\"timeDuration\":0,\"title\":\"\",\"location\":\"\"}"; + } + } + + public static final String EMPTY_SCHEDULE_STR = JSON.toJSONString(new ScheduleInfoDTO()); + SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm"); + + Cache appCache = new Cache(new File("cacheDir", "okhttpcache"), 10 * 1024 * 1024); + OkHttpClient bootstrapClient = new OkHttpClient.Builder().cache(appCache).build(); + + //加速国内云对azure的访问 + Dns dns = new DnsOverHttps.Builder().client(bootstrapClient) + .url(HttpUrl.get("https://1.1.1.1/dns-query")) + .build(); + + OkHttpClient azureClient = bootstrapClient.newBuilder() + .readTimeout(15, TimeUnit.SECONDS) + + .build(); + public static final ScheduleInfoDTO EMPTY_SCHEDULE = new ScheduleInfoDTO(); + + public static final String QIANWEN_MODEL = "qwen-turbo"; + + @PostMapping("") + public ScheduleInfoDTO save(@RequestBody HashMap map) { + String text = map.get("text"); + if (text == null || text.trim().length() < 6) return EMPTY_SCHEDULE; + return requestQianWen(text); + + } + + private ScheduleInfoDTO requestOpenAi(String text) { + long start = System.currentTimeMillis(); + String textJson = JSON.toJSONString(text); + String formattedDate = dateFormat.format(new Date()); + MediaType mediaType = MediaType.parse("application/json"); + String bodyStr = String.format(requestBodyFormat, formattedDate, textJson); + okhttp3.RequestBody body = okhttp3.RequestBody.create(mediaType, bodyStr); + Request request = new Request.Builder() + .url(configuration.getOpenaiAzureEndpoint()) + .method("POST", body) + .addHeader("Content-Type", "application/json") + .addHeader("api-key", configuration.getOpenaiAzureApiKey()) + .build(); + String responseBody = ""; + long requestStart = System.currentTimeMillis(); + try { + Response response = azureClient.newCall(request).execute(); + responseBody = response.body().string(); + + } catch (Exception e) { + log.error("OPENAI请求失败:{}, text:{}, response: {}", e.getMessage(), text, responseBody); + return EMPTY_SCHEDULE; + } + long requestEnd = System.currentTimeMillis(); + JSONObject jsonObject = JSON.parseObject(responseBody); + + try { + String s = jsonObject.getJSONArray("choices").getJSONObject(0).getJSONObject("message").getJSONObject("function_call").getString("arguments"); + ScheduleInfoDTO result = JSON.parseObject(s, ScheduleInfoDTO.class); + DateTime dateTime = new DateTime(result.getDateTimeFrom()); + if (dateTime.getHourOfDay() == 0) dateTime = dateTime.withHourOfDay(8); + //识别返回的可能会没有小时信息,所以重新识别 + result.setDateTimeFrom(dateTime.toString("yyyy-MM-dd HH:mm")); + result.setTimestampFrom(dateTime.getMillis()); + + result.setDescription(text); + log.warn("openai请求耗时:{}, 接口耗时:{}", (requestEnd - requestStart), (System.currentTimeMillis() - start)); + return result; + } catch (Exception e) { + log.error("解析失败: text:{}, response:{}", text, responseBody); + return EMPTY_SCHEDULE; + } + } + + + private ScheduleInfoDTO requestQianWen(String text) { + long start = System.currentTimeMillis(); + String formattedDate = dateFormat.format(new Date()); + // 使用加载的模板 + String prompt = String.format(promptTemplate, formattedDate, text); + + // 构建通义千问的请求体 + JSONObject requestBody = new JSONObject(); + requestBody.put("model", QIANWEN_MODEL); + + JSONObject input = new JSONObject(); + input.put("prompt", prompt); + requestBody.put("input", input); + + JSONObject parameters = new JSONObject(); + parameters.put("result_format", "json"); + parameters.put("temperature", 0.7); + parameters.put("top_p", 0.8); + requestBody.put("parameters", parameters); + + MediaType mediaType = MediaType.parse("application/json"); + okhttp3.RequestBody body = okhttp3.RequestBody.create(mediaType, requestBody.toJSONString()); + + Request request = new Request.Builder() + .url(QIANWEN_API_ENDPOINT) + .method("POST", body) + .addHeader("Content-Type", "application/json") + .addHeader("Authorization", "Bearer " + QianWenApiKey) + .build(); + + String responseBody = ""; + long requestStart = System.currentTimeMillis(); + try { + Response response = azureClient.newCall(request).execute(); + responseBody = response.body().string(); + } catch (Exception e) { + log.error("千问API请求失败:{}, text:{}, response: {}", e.getMessage(), text, responseBody); + return EMPTY_SCHEDULE; + } + long requestEnd = System.currentTimeMillis(); + + try { + JSONObject jsonObject = JSON.parseObject(responseBody); + // 通义千问的返回格式:output.text 中包含生成的JSON字符串 + String generatedJson = jsonObject.getJSONObject("output").getString("text"); + // 移除可能的多余字符,确保是纯JSON + generatedJson = generatedJson.trim(); + if (generatedJson.startsWith("```json")) { + generatedJson = generatedJson.substring(7, generatedJson.length() - 3).trim(); + } + + ScheduleInfoDTO result = JSON.parseObject(generatedJson, ScheduleInfoDTO.class); + if (result == null || result.getDateTimeFrom() == null) { + return EMPTY_SCHEDULE; + } + + DateTime dateTime = DateTime.parse(result.getDateTimeFrom(), + org.joda.time.format.DateTimeFormat.forPattern("yyyy-MM-dd HH:mm")); + + if (dateTime.getHourOfDay() == 0) { + dateTime = dateTime.withHourOfDay(8); + } + result.setDateTimeFrom(dateTime.toString("yyyy-MM-dd HH:mm")); + result.setTimestampFrom(dateTime.getMillis()); + result.setDescription(text); + + log.warn("千问请求耗时:{}, 接口耗时:{}", (requestEnd - requestStart), (System.currentTimeMillis() - start)); + return result; + } catch (Exception e) { + e.printStackTrace(); + log.error("解析失败: text:{}, response:{}", text, responseBody); + return EMPTY_SCHEDULE; + } + } + +} + diff --git a/intelli-assistant-admin/src/main/java/cn/intellijassistant/admin/controller/OperationLogController.java b/intelli-assistant-admin/src/main/java/cn/intellijassistant/admin/controller/OperationLogController.java new file mode 100644 index 0000000..4585e08 --- /dev/null +++ b/intelli-assistant-admin/src/main/java/cn/intellijassistant/admin/controller/OperationLogController.java @@ -0,0 +1,31 @@ +package cn.intellijassistant.admin.controller; + +import cn.intellijassistant.admin.domain.OperationLog; +import cn.intellijassistant.admin.repository.OperationLogMapper; +import cn.intellijassistant.admin.util.StringUtil; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import javax.annotation.Resource; + +/** + * @Author: Jason Wu + * @Date: 2023/7/31 + * @Description: + */ +@RestController +@RequestMapping("/admin/operation_logs") +public class OperationLogController { + + @Resource + private OperationLogMapper operationLogMapper; + + @PostMapping("") + public void save(@RequestBody OperationLog operationLog) { + operationLog.setTimeCreate(System.currentTimeMillis()); + operationLog.setContent(StringUtil.safeLength(operationLog.getContent(), 500)); + operationLogMapper.save(operationLog); + } +} diff --git a/intelli-assistant-admin/src/main/java/cn/intellijassistant/admin/controller/ScheduleController.java b/intelli-assistant-admin/src/main/java/cn/intellijassistant/admin/controller/ScheduleController.java new file mode 100644 index 0000000..3aa3c7c --- /dev/null +++ b/intelli-assistant-admin/src/main/java/cn/intellijassistant/admin/controller/ScheduleController.java @@ -0,0 +1,52 @@ +package cn.intellijassistant.admin.controller; + +import cn.intellijassistant.admin.domain.Schedule; +import cn.intellijassistant.admin.repository.ScheduleMapper; +import cn.intellijassistant.admin.util.StringUtil; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; + +import javax.annotation.Resource; +import java.util.List; +import java.util.UUID; + +/** + * @Author: Jason Wu + * @Date: 2023/7/24 + * @Description: + */ +@RestController +@RequestMapping("/admin/schedules") +public class ScheduleController { + + @Resource + private ScheduleMapper scheduleMapper; + + @GetMapping("") + public List list(@RequestParam("openid") String openid, @RequestParam("timeFrom") Long timeFrom, + @RequestParam("timeTo") Long timeTo) { + + return scheduleMapper.findByOpenidAndStartTimeBetweenOrderByStartTimeDesc(openid, timeFrom, timeTo); + } + + @DeleteMapping("/{id}") + public void delete(@PathVariable String id) { + scheduleMapper.deleteById(id); + } + + @PostMapping("") + public Schedule save(@RequestBody Schedule schedule) { + + schedule.setId(UUID.randomUUID().toString()); + schedule.setTimeCreate(System.currentTimeMillis()); + schedule.setDescription(StringUtil.safeLength(schedule.getDescription(), 500)); + scheduleMapper.save(schedule); + return schedule; + } +} diff --git a/intelli-assistant-admin/src/main/java/cn/intellijassistant/admin/controller/SnsController.java b/intelli-assistant-admin/src/main/java/cn/intellijassistant/admin/controller/SnsController.java new file mode 100644 index 0000000..8386688 --- /dev/null +++ b/intelli-assistant-admin/src/main/java/cn/intellijassistant/admin/controller/SnsController.java @@ -0,0 +1,30 @@ +package cn.intellijassistant.admin.controller; + +import cn.intellijassistant.admin.service.ISnsService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; + +import java.io.IOException; + +/** + * @Author: Jason Wu + * @Date: 2023/7/25 + * @Description: + */ +@RequestMapping("/admin/sns") +@RestController +public class SnsController { + + @Autowired + private ISnsService snsService; + + + @GetMapping("/openid") + public String openid(@RequestParam String code) throws IOException { + + return snsService.openid(code); + } +} diff --git a/intelli-assistant-admin/src/main/java/cn/intellijassistant/admin/controller/StatisticsController.java b/intelli-assistant-admin/src/main/java/cn/intellijassistant/admin/controller/StatisticsController.java new file mode 100644 index 0000000..2ab78fd --- /dev/null +++ b/intelli-assistant-admin/src/main/java/cn/intellijassistant/admin/controller/StatisticsController.java @@ -0,0 +1,158 @@ +package cn.intellijassistant.admin.controller; + +import cn.intellijassistant.admin.OperationLogType; +import cn.intellijassistant.admin.domain.Account; +import cn.intellijassistant.admin.domain.OperationLog; +import cn.intellijassistant.admin.domain.Schedule; +import cn.intellijassistant.admin.dto.StatisticsDTO; +import cn.intellijassistant.admin.repository.AccountMapper; +import cn.intellijassistant.admin.repository.OperationLogMapper; +import cn.intellijassistant.admin.repository.ScheduleMapper; +import org.springframework.stereotype.Controller; +import org.springframework.ui.Model; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; + +import javax.annotation.Resource; +import java.text.SimpleDateFormat; +import java.util.Comparator; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Optional; +import java.util.Set; +import java.util.TreeSet; +import java.util.concurrent.atomic.AtomicInteger; +import java.util.function.Function; +import java.util.stream.Collectors; + +/** + * @Author: Jason Wu + * @Date: 2023/8/14 + * @Description: + */ +@Controller +@RequestMapping("/admin/statistics") +public class StatisticsController { + + @Resource + private OperationLogMapper operationLogMapper; + @Resource + private ScheduleMapper scheduleMapper; + @Resource + private AccountMapper accountMapper; + + SimpleDateFormat simpleDateFormat = new SimpleDateFormat("MM-dd HH:mm"); + + + @GetMapping("") + public String getTableData(Model model, @RequestParam(value = "days", required = false) Integer days) { + if (days == null) days = 1; + Long now = System.currentTimeMillis(); + Long timeFrom = now - 24*60*60*1000L*days; + + List operationLogs = operationLogMapper.findByTimeCreateGreaterThan(timeFrom); + Map> operationMap = operationLogs.stream().collect(Collectors.groupingBy(OperationLog::getOpenid)); + operationMap.forEach((key, value)->value.sort(Comparator.comparing(OperationLog::getTimeCreate))); + //operationLogs.sort(Comparator.comparing(OperationLog::getTimeCreate).reversed()); + List schedules = scheduleMapper.findByTimeCreateGreaterThan(timeFrom); + Map> scheduleMap = schedules.stream().collect(Collectors.groupingBy(Schedule::getOpenid)); + scheduleMap.forEach((key, value)->value.sort(Comparator.comparing(Schedule::getTimeCreate))); + Set openids = operationLogs.stream().map(OperationLog::getOpenid).collect(Collectors.toSet()); + List accounts = accountMapper.findAllById(openids); + List scheduleProjections = scheduleMapper.findByOpenidIn(openids); + Map> scheduleProjectionMap = scheduleProjections.stream().collect(Collectors.groupingBy(ScheduleMapper.ScheduleProjection::getOpenid, + Collectors.mapping(ScheduleMapper.ScheduleProjection::getTimeCreate, Collectors.toCollection(TreeSet::new)))); + Map accountMap = accounts.stream().collect(Collectors.toMap(Account::getId, Function.identity())); + Map counterMap = new HashMap<>(); + Map> statisticsMap = new HashMap<>(); + operationMap.forEach((key, value) ->{ + if (key.length() == 0) return; + List statisticsDTOS = value.stream().map(operationLog -> { + final String openid = operationLog.getOpenid(); + StatisticsDTO statisticsDTO = new StatisticsDTO(); + statisticsDTO.setId(operationLog.getId()); + statisticsDTO.setOpenid(openid); + if (statisticsDTO.getOpenid().length() > 10) { + statisticsDTO.setOpenid(statisticsDTO.getOpenid().substring(10)); + } + Account account = accountMap.get(openid); + if (account != null) { + statisticsDTO.setUserCreateTime(simpleDateFormat.format(account.getTimeCreate())); + } + statisticsDTO.setOperatorTime(simpleDateFormat.format(operationLog.getTimeCreate())); + TreeSet treeSet = scheduleProjectionMap.get(openid); + if (treeSet != null && treeSet.size() > 0) { + statisticsDTO.setCount(treeSet.size()); + Optional.ofNullable(treeSet.lower(operationLog.getTimeCreate())).map(simpleDateFormat::format).ifPresent(statisticsDTO::setLastOperateTime); + } + statisticsDTO.setOperatorType(OperationLogType.findByValue(Math.abs(operationLog.getType())) + (operationLog.getType() < 0 ? "失败":"")); + statisticsDTO.setScheduleDescription(operationLog.getContent()); + if (operationLog.getType() >= 10 && operationLog.getType() % 10 < 3) { + + List theSchedules = scheduleMap.get(openid); + if (theSchedules != null && theSchedules.size() > 0) { + AtomicInteger atomicInteger = counterMap.computeIfAbsent(openid, (id)->new AtomicInteger()); + if (atomicInteger.get() < theSchedules.size()) { + Schedule schedule = theSchedules.get(atomicInteger.getAndAdd(1)); + if (schedule != null) { + statisticsDTO.setScheduleDescription(statisticsDTO.getScheduleDescription() + "\n"+schedule.getDescription()); + statisticsDTO.setScheduleMainInfo(getScheduleMainInfo(schedule)); + } + } + } + } + return statisticsDTO; + }).collect(Collectors.toList()); + statisticsMap.put(key, statisticsDTOS); + }); + model.addAttribute("operationLogNum", operationLogs.size()); + model.addAttribute("operationAccountNum", operationLogs.stream().map(OperationLog::getOpenid).collect(Collectors.toSet()).size()); + model.addAttribute("scheduleNum", schedules.size()); + model.addAttribute("scheduleAccountNum", ""+schedules.stream().map(Schedule::getOpenid).collect(Collectors.toSet()).size()); + model.addAttribute("freshAccountNum", ""+accounts.stream().filter(account -> account.getTimeCreate()>timeFrom).count()); + model.addAttribute("oldAccountNum", ""+accounts.stream().filter(account -> account.getTimeCreate()>> statistics = statisticsMap.entrySet().stream().sorted((entry1, entry2)-> { + String lastTime1 = entry1.getValue().get(entry1.getValue().size() - 1).getOperatorTime(); + String lastTime2 = entry2.getValue().get(entry2.getValue().size() - 1).getOperatorTime(); + return lastTime2.compareTo(lastTime1); + }).collect(Collectors.toList()); + model.addAttribute("statistics", statistics); + + return "table"; + } + + public String getScheduleMainInfo(Schedule schedule) { + return String.format("标题:%s, 地点:%s, 开始时间:%s, 提前提醒:%s", schedule.getTitle(), + schedule.getLocation(), simpleDateFormat.format(schedule.getStartTime()), + getAlarmOffsetString(schedule.getAlarmOffset())); + } + public String getAlarmOffsetString(int offset) { + if (offset == 0) { + return "日程开始时"; + } else if (offset == 5 * 60) { + return "5分钟前" ; + } else if (offset == 10 * 60) { + return "10分钟前"; + } else if (offset == 15 * 60) { + return "15分钟前"; + } else if (offset == 30 * 60) { + return "30分钟前"; + } else if (offset == 60 * 60) { + return "1小时前"; + } else if (offset == 2 * 60 * 60) { + return "2小时前" ; + } else if (offset == 24 * 60 * 60) { + return "1天前" ; + } else if (offset == 2 * 24 * 60 * 60) { + return "2天前"; + } else if (offset == 7 * 24 * 60 * 60) { + return "1周前"; + } + return ""; + + } + +} diff --git a/intelli-assistant-admin/src/main/java/cn/intellijassistant/admin/domain/Account.java b/intelli-assistant-admin/src/main/java/cn/intellijassistant/admin/domain/Account.java new file mode 100644 index 0000000..4f00bc7 --- /dev/null +++ b/intelli-assistant-admin/src/main/java/cn/intellijassistant/admin/domain/Account.java @@ -0,0 +1,24 @@ +package cn.intellijassistant.admin.domain; + +import lombok.Data; + +import javax.persistence.Entity; +import javax.persistence.Id; + +/** + * @Author: Jason Wu + * @Date: 2023/8/1 + * @Description: + */ +@Data +@Entity +public class Account { + + //openid + @Id + private String id; + + private boolean commentInvited; + + private Long timeCreate; +} diff --git a/intelli-assistant-admin/src/main/java/cn/intellijassistant/admin/domain/OperationLog.java b/intelli-assistant-admin/src/main/java/cn/intellijassistant/admin/domain/OperationLog.java new file mode 100644 index 0000000..d326186 --- /dev/null +++ b/intelli-assistant-admin/src/main/java/cn/intellijassistant/admin/domain/OperationLog.java @@ -0,0 +1,33 @@ +package cn.intellijassistant.admin.domain; + +import lombok.Data; + +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; + +/** + * @Author: Jason Wu + * @Date: 2023/7/31 + * @Description: + */ +@Entity +@Data +public class OperationLog { + + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + private Long id; + + private String openid; + + @Column(columnDefinition = "TINYINT") + private int type; + + //长度500 + private String content; + + private Long timeCreate; +} diff --git a/intelli-assistant-admin/src/main/java/cn/intellijassistant/admin/domain/Schedule.java b/intelli-assistant-admin/src/main/java/cn/intellijassistant/admin/domain/Schedule.java new file mode 100644 index 0000000..af8ab88 --- /dev/null +++ b/intelli-assistant-admin/src/main/java/cn/intellijassistant/admin/domain/Schedule.java @@ -0,0 +1,28 @@ +package cn.intellijassistant.admin.domain; + +import lombok.Data; + +import javax.persistence.Entity; +import javax.persistence.Id; + +/** + * @Author: Jason Wu + * @Date: 2023/7/24 + * @Description: + */ +@Entity +@Data +public class Schedule { + + @Id + private String id; + private String location; + private String openid; + private String title; + private Long startTime; + //长度500 + private String description; + private int alarmOffset; + + private Long timeCreate; +} diff --git a/intelli-assistant-admin/src/main/java/cn/intellijassistant/admin/dto/AccountLoginDTO.java b/intelli-assistant-admin/src/main/java/cn/intellijassistant/admin/dto/AccountLoginDTO.java new file mode 100644 index 0000000..0ff6016 --- /dev/null +++ b/intelli-assistant-admin/src/main/java/cn/intellijassistant/admin/dto/AccountLoginDTO.java @@ -0,0 +1,19 @@ +package cn.intellijassistant.admin.dto; + +import lombok.Data; + +/** + * @Author: Jason Wu + * @Date: 2023/9/4 + * @Description: + */ +@Data +public class AccountLoginDTO { + + private boolean needInviteComment; + + private String baiduToken; + + private String openid; + +} diff --git a/intelli-assistant-admin/src/main/java/cn/intellijassistant/admin/dto/BaiduTokenDTO.java b/intelli-assistant-admin/src/main/java/cn/intellijassistant/admin/dto/BaiduTokenDTO.java new file mode 100644 index 0000000..0464d6c --- /dev/null +++ b/intelli-assistant-admin/src/main/java/cn/intellijassistant/admin/dto/BaiduTokenDTO.java @@ -0,0 +1,18 @@ +package cn.intellijassistant.admin.dto; + +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * @Author: Jason Wu + * @Date: 2023/9/4 + * @Description: + */ +@Data +@AllArgsConstructor +@NoArgsConstructor +public class BaiduTokenDTO { + private String token; + private Long expiredAt; +} diff --git a/intelli-assistant-admin/src/main/java/cn/intellijassistant/admin/dto/ScheduleInfoDTO.java b/intelli-assistant-admin/src/main/java/cn/intellijassistant/admin/dto/ScheduleInfoDTO.java new file mode 100644 index 0000000..db56d49 --- /dev/null +++ b/intelli-assistant-admin/src/main/java/cn/intellijassistant/admin/dto/ScheduleInfoDTO.java @@ -0,0 +1,21 @@ +package cn.intellijassistant.admin.dto; + +import lombok.Data; + +/** + * @Author: Jason Wu + * @Date: 2023/8/23 + * @Description: + */ +@Data +public class ScheduleInfoDTO { + + private String title; + private String dateTimeFrom; + + private Long timestampFrom; + + private String location; + + private String description; +} diff --git a/intelli-assistant-admin/src/main/java/cn/intellijassistant/admin/dto/StatisticsDTO.java b/intelli-assistant-admin/src/main/java/cn/intellijassistant/admin/dto/StatisticsDTO.java new file mode 100644 index 0000000..f34a336 --- /dev/null +++ b/intelli-assistant-admin/src/main/java/cn/intellijassistant/admin/dto/StatisticsDTO.java @@ -0,0 +1,25 @@ +package cn.intellijassistant.admin.dto; + +import lombok.Data; + +/** + * @Author: Jason Wu + * @Date: 2023/8/14 + * @Description: + */ +@Data +public class StatisticsDTO { + + private Long id; + private String openid; + private String userCreateTime; + private String operatorTime; + + private String lastOperateTime; + private Integer count; + private String operatorType; + + private String scheduleDescription; + + private String scheduleMainInfo; +} diff --git a/intelli-assistant-admin/src/main/java/cn/intellijassistant/admin/repository/AccountMapper.java b/intelli-assistant-admin/src/main/java/cn/intellijassistant/admin/repository/AccountMapper.java new file mode 100644 index 0000000..5b4a15c --- /dev/null +++ b/intelli-assistant-admin/src/main/java/cn/intellijassistant/admin/repository/AccountMapper.java @@ -0,0 +1,20 @@ +package cn.intellijassistant.admin.repository; + +import cn.intellijassistant.admin.domain.Account; +import org.springframework.data.jpa.repository.JpaRepository; +import org.springframework.data.jpa.repository.Modifying; +import org.springframework.data.jpa.repository.Query; +import org.springframework.data.repository.query.Param; +import org.springframework.transaction.annotation.Transactional; + +/** + * @Author: Jason Wu + * @Date: 2023/8/1 + * @Description: + */ +public interface AccountMapper extends JpaRepository { + @Modifying + @Transactional + @Query("update Account u set u.commentInvited = true where u.id = :id") + void commentInvited(@Param("id") String id); +} diff --git a/intelli-assistant-admin/src/main/java/cn/intellijassistant/admin/repository/OperationLogMapper.java b/intelli-assistant-admin/src/main/java/cn/intellijassistant/admin/repository/OperationLogMapper.java new file mode 100644 index 0000000..de7ab7e --- /dev/null +++ b/intelli-assistant-admin/src/main/java/cn/intellijassistant/admin/repository/OperationLogMapper.java @@ -0,0 +1,16 @@ +package cn.intellijassistant.admin.repository; + +import cn.intellijassistant.admin.domain.OperationLog; +import org.springframework.data.jpa.repository.JpaRepository; + +import java.util.List; + +/** + * @Author: Jason Wu + * @Date: 2023/7/31 + * @Description: + */ +public interface OperationLogMapper extends JpaRepository { + + public List findByTimeCreateGreaterThan(Long timeFrom); +} diff --git a/intelli-assistant-admin/src/main/java/cn/intellijassistant/admin/repository/ScheduleMapper.java b/intelli-assistant-admin/src/main/java/cn/intellijassistant/admin/repository/ScheduleMapper.java new file mode 100644 index 0000000..29724c7 --- /dev/null +++ b/intelli-assistant-admin/src/main/java/cn/intellijassistant/admin/repository/ScheduleMapper.java @@ -0,0 +1,29 @@ +package cn.intellijassistant.admin.repository; + +import cn.intellijassistant.admin.domain.Schedule; +import org.springframework.data.jpa.repository.JpaRepository; + +import java.util.Collection; +import java.util.List; + +/** + * @Author: Jason Wu + * @Date: 2023/7/24 + * @Description: + */ +public interface ScheduleMapper extends JpaRepository { + List findByOpenidAndStartTimeBetweenOrderByStartTimeDesc(String openid, Long timeFrom, Long timeTo); + Long countByOpenid(String openid); + + List findByTimeCreateGreaterThan(Long timeFrom); + +// @Query(value = "select openid, time_create from SCHEDULE where openid in :openids", nativeQuery = true) + List findByOpenidIn(Collection openids); + + interface ScheduleProjection { + String getOpenid(); + Long getTimeCreate(); + + + } +} diff --git a/intelli-assistant-admin/src/main/java/cn/intellijassistant/admin/service/ISnsService.java b/intelli-assistant-admin/src/main/java/cn/intellijassistant/admin/service/ISnsService.java new file mode 100644 index 0000000..b83ed4e --- /dev/null +++ b/intelli-assistant-admin/src/main/java/cn/intellijassistant/admin/service/ISnsService.java @@ -0,0 +1,14 @@ +package cn.intellijassistant.admin.service; + +import org.springframework.web.bind.annotation.RequestParam; + +import java.io.IOException; + +/** + * @Author: Jason Wu + * @Date: 2023/9/4 + * @Description: + */ +public interface ISnsService { + String openid(@RequestParam String code) throws IOException; +} diff --git a/intelli-assistant-admin/src/main/java/cn/intellijassistant/admin/service/impl/SnsServiceImpl.java b/intelli-assistant-admin/src/main/java/cn/intellijassistant/admin/service/impl/SnsServiceImpl.java new file mode 100644 index 0000000..0b47f86 --- /dev/null +++ b/intelli-assistant-admin/src/main/java/cn/intellijassistant/admin/service/impl/SnsServiceImpl.java @@ -0,0 +1,35 @@ +package cn.intellijassistant.admin.service.impl; + +import cn.intellijassistant.admin.service.ISnsService; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; +import org.springframework.stereotype.Component; +import org.springframework.web.bind.annotation.RequestParam; + +import java.io.IOException; + +/** + * @Author: Jason Wu + * @Date: 2023/9/4 + * @Description: + */ +@Component +public class SnsServiceImpl implements ISnsService { + private static final String AD="d3g0YjZlNTJkYTEyNDJkZDdh"; + private static final String SC = "NjFiN2YxZjJlMTVmZjYzYTIxOTI0NTEzMTAzN2Q4MTY="; + + OkHttpClient client = new OkHttpClient().newBuilder() + .build(); + + @Override + public String openid(@RequestParam String code) throws IOException { + + String url = "https://api.weixin.qq.com/sns/jscode2session?appid=wx4b6e52da1242dd7a&secret=61b7f1f2e15ff63a219245131037d816&js_code="+code+"&grant_type=authorization_code "; + Request request = new Request.Builder() + .url(url) + .build(); + Response response = client.newCall(request).execute(); + return response.body().string(); + } +} diff --git a/intelli-assistant-admin/src/main/java/cn/intellijassistant/admin/util/StringUtil.java b/intelli-assistant-admin/src/main/java/cn/intellijassistant/admin/util/StringUtil.java new file mode 100644 index 0000000..8404e61 --- /dev/null +++ b/intelli-assistant-admin/src/main/java/cn/intellijassistant/admin/util/StringUtil.java @@ -0,0 +1,19 @@ +package cn.intellijassistant.admin.util; + +/** + * @Author: Jason Wu + * @Date: 2023/7/31 + * @Description: + */ +public class StringUtil { + public static boolean isEmpty(String s) { + return s == null || s.trim().length() == 0; + } + + public static String safeLength(String s, int len) { + if (s.length() > len) { + return s.substring(0, len); + } + return s; + } +} diff --git a/intelli-assistant-admin/src/main/resources/application.properties b/intelli-assistant-admin/src/main/resources/application.properties new file mode 100644 index 0000000..83e8dad --- /dev/null +++ b/intelli-assistant-admin/src/main/resources/application.properties @@ -0,0 +1,21 @@ +spring.datasource.url=jdbc:h2:file:~/intellij-assistant +spring.datasource.driverClassName=org.h2.Driver +spring.datasource.username=sa +spring.datasource.password=password +spring.jpa.database-platform=org.hibernate.dialect.H2Dialect +spring.jpa.hibernate.ddl-auto=update +spring.h2.console.path=/admin/h2-console +spring.h2.console.enabled=true + +spring.thymeleaf.prefix=classpath:/templates/ +spring.thymeleaf.suffix=.html +spring.thymeleaf.cache=false + +#Openai Azure +#openai.azure.endpoint= +#openai.api.key= + +#?????AK +#openai.bce.ak= +#openai.bce.sk= +#server.api.key= diff --git a/intelli-assistant-admin/src/main/resources/help_remember_request_body.json b/intelli-assistant-admin/src/main/resources/help_remember_request_body.json new file mode 100644 index 0000000..a471d6b --- /dev/null +++ b/intelli-assistant-admin/src/main/resources/help_remember_request_body.json @@ -0,0 +1,41 @@ +{ + "functions": [ + { + "name": "get_schedule_info", + "description": "Extract schedule information from a paragraph", + "parameters": { + "type": "object", + "properties": { + "title": { + "type": "string", + "description": "one-sentence summary,如果是法院传票,则是案由。 " + }, + "dateTimeFrom": { + "type": "string", + "description": "schedule start time, format is yyyy-MM-ddTHH:mm" + }, + "location": { + "type": "string", + "description": "the schedule location" + } + }, + "required": [ + "title", + "dateTimeFrom", + "location" + ] + } + } + ], + "temperature": 0, + "messages": [ + { + "role": "system", + "content": "现在是%s,如果日程信息中小时缺失就默认是早晨8点,早上就是08:00, 中午是12:00,下午是14:00,傍晚是18:00,晚上是20:00,深夜是23:00。" + }, + { + "role": "user", + "content": %s + } + ] +} \ No newline at end of file diff --git a/intelli-assistant-admin/src/main/resources/logback.xml b/intelli-assistant-admin/src/main/resources/logback.xml new file mode 100644 index 0000000..2e28c6c --- /dev/null +++ b/intelli-assistant-admin/src/main/resources/logback.xml @@ -0,0 +1,22 @@ + + + + + %d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n + + + + /var/log/intellij-assistant-admin/intellij-assistant-admin.log + + /var/log/intellij-assistant-admin/intellij-assistant-admin.%d{yyyy-MM-dd}.log + + + %d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n + + + + + + + + \ No newline at end of file diff --git a/intelli-assistant-admin/src/main/resources/static/send.sh b/intelli-assistant-admin/src/main/resources/static/send.sh new file mode 100644 index 0000000..e69de29 diff --git a/intelli-assistant-admin/src/main/resources/templates/table.html b/intelli-assistant-admin/src/main/resources/templates/table.html new file mode 100644 index 0000000..7bd051f --- /dev/null +++ b/intelli-assistant-admin/src/main/resources/templates/table.html @@ -0,0 +1,119 @@ + + + + Table Data + + + + + +

概览

+ +
+
+
+ 新用户: + +
+
+ 老用户回流: + +
+
+
+
+ + 重要操作次数: + +
+
+ 操作人数: + +
+
+ +
+
+ 新增日程个数: + +
+
+ 创建日程的人数: + +
+
+ + +
+ +
+

+ + + + + + + + + + + + + + + + + + + + + + + + + + +
用户创建时间用户操作时间上一次操作时间使用次数操作类型日程描述日程摘要
+
+ + + \ No newline at end of file diff --git a/intelli-assistant-admin/src/test/java/cn/intellijassistant/admin/T1.java b/intelli-assistant-admin/src/test/java/cn/intellijassistant/admin/T1.java new file mode 100644 index 0000000..2cf3f29 --- /dev/null +++ b/intelli-assistant-admin/src/test/java/cn/intellijassistant/admin/T1.java @@ -0,0 +1,29 @@ +package cn.intellijassistant.admin; + +import org.joda.time.DateTime; +import org.junit.jupiter.api.Test; + +/** + * @Author: Jason Wu + * @Date: 2023/8/10 + * @Description: + */ +public class T1 { + + @Test + public void t2() { + int n = 9, n1 = 2; + char c = (char) n; + int n2 = '0' + n1; + System.out.printf(""); + DateTime dateTime = new DateTime("2023-11-09"); + if (dateTime.getHourOfDay() == 0) { + dateTime = dateTime.withHourOfDay(8); + } + System.out.println(dateTime.getMillis()); + } +} + +/** + * + */ diff --git a/weapp/app.js b/weapp/app.js new file mode 100644 index 0000000..ef04265 --- /dev/null +++ b/weapp/app.js @@ -0,0 +1,114 @@ +App({ + onLaunch: function () { + // 全局分享配置 + Page = (function (Page) { + return function (pageConfig) { + pageConfig.onShareAppMessage = function () { + return { + title: '日程小帮手', + path: '/pages/home/index', + imageUrl: '/static/relax12.png' + }; + }; + pageConfig.onShareTimeline = function () { + return { + title: '日程小帮手', + path: '/pages/home/index', + imageUrl: '/static/relax12.png' + }; + }; + return Page(pageConfig); + }; + })(Page); +}, +"shareTimeline": true, + globalData: { + needRetry: false, + API_KEY:'d8y4XLDphC1W9dtDgt68d9toAi7HXT1P7KCH25b4', + ADMIN_HOST: 'https://lawyertools.cn/admin', + // ADMIN_HOST:"http://www.localhost:8080/admin", + openid:'', + inviteComment: false, + }, + + // 可以定义全局方法 + resetRetry: function () { + this.globalData.needRetry=false; + }, + commentInvited: function(){ + this.globalData.inviteComment = false; + wx.request({ + url:`${this.globalData.ADMIN_HOST}/accounts/${this.globalData.openid}/commentInvited`, + method:'POST', + header:{ + 'x-api-key': this.globalData.API_KEY + }, + complete:()=>wx.navigateBack() + }) + }, + needRetry:function(){ + return this.globalData.needRetry; + }, + retry: function() { + this.globalData.needRetry=true; + }, + + afterLogin: function(data){ + this.globalData.openid = data.openid; + //1. 判断是否需要要求评价 + this.globalData.inviteComment = data.needInviteComment; + + }, + + requestAdmin(options){ + + // 在请求的 options.header 中添加自定义头部 + options.header = { + ...options.header, + 'openid': this.globalData.openid, + 'x-api-key': this.globalData.API_KEY + }; + if (!options.url.startsWith("https")) { + options.url=this.globalData.ADMIN_HOST+options.url + } + + // 调用原始的 wx.request 方法 + wx.request(options); + }, + formatTimestamp: function (timestamp) { + const date = new Date(timestamp); + + const year = date.getFullYear(); + const month = String(date.getMonth() + 1).padStart(2, '0'); + const day = String(date.getDate()).padStart(2, '0'); + const hours = String(date.getHours()).padStart(2, '0'); + const minutes = String(date.getMinutes()).padStart(2, '0'); + + const formattedDate = `${year}-${month}-${day} ${hours}:${minutes}`; + + return formattedDate; + }, + logOperation: function(type, success, content) { + wx.request({ + url: this.globalData.ADMIN_HOST+"/operation_logs", + method:'POST', + header:{ + 'x-api-key': this.globalData.API_KEY + }, + data: { + openid: this.globalData.openid, + type: success ? type : 0 - type, + content: (content).substring(0, 255) + } + }) + }, + onError(error) { + console.error('App onError:', error); + wx.showToast({ + title: '发生错误,请重试', + icon: 'none' + }); + }, + // 其他全局方法 + // ... +}); \ No newline at end of file diff --git a/weapp/app.json b/weapp/app.json new file mode 100644 index 0000000..c5835c9 --- /dev/null +++ b/weapp/app.json @@ -0,0 +1,51 @@ +{ + + "pages": [ + "pages/home/index" + ], + "lazyCodeLoading": "requiredComponents", + "__usePrivacyCheck__": true, + + "permission": { + "scope.addPhoneCalendar": { + "desc": "需要给你手机日历创建日程" + }, + "scope.userInfo": { + "desc": "需要获取您的头像信息以展示在应用中" + } + }, + "plugins": { + + }, + "subPackages": [], + "window": { + "navigationBarTextStyle": "black", + "navigationBarTitleText": "👋欢迎", + "navigationBarBackgroundColor": "#F8F8F8", + "backgroundColor": "#F8F8F8" + }, + + + "usingComponents": { + "custom-header": "/components/custom-header/custom-header", + "schedule-details": "/components/schedule-details/schedule-details", + "sidebar": "/components/sidebar/sidebar" + }, + "useExtendedLib": { + "weui": true + }, + "supportedMaterials": [ + { + "materialType": "image/*", + "name": "用${nickname}识创建日程", + "desc": "使用该图片创建日程", + "path": "pages/home/index" + }, + { + "materialType": "application/pdf", + "name": "用${nickname}创建日程", + "desc": "使用该PDF创建日程", + "path": "pages/home/index" + } + ] +} diff --git a/weapp/app.wxss b/weapp/app.wxss new file mode 100644 index 0000000..a07298e --- /dev/null +++ b/weapp/app.wxss @@ -0,0 +1,3 @@ + + +[data-custom-hidden="true"],[bind-data-custom-hidden="true"]{display: none !important;} \ No newline at end of file diff --git a/weapp/components/custom-header/custom-header.js b/weapp/components/custom-header/custom-header.js new file mode 100644 index 0000000..248c607 --- /dev/null +++ b/weapp/components/custom-header/custom-header.js @@ -0,0 +1,28 @@ +Component({ + properties: { + title: { + type: String, + value: '👋 欢迎' + } + }, + data: { + statusBarHeight: 0 + }, + lifetimes: { + attached() { + this.setStatusBarHeight(); + } + }, + methods: { + setStatusBarHeight() { + const systemInfo = wx.getSystemInfoSync(); + this.setData({ + statusBarHeight: systemInfo.statusBarHeight + }); + }, + onLeftTap() { + console.log('Left tap triggered'); // 添加日志 + this.triggerEvent('toggleSidebar'); + } + } +}) diff --git a/weapp/components/custom-header/custom-header.json b/weapp/components/custom-header/custom-header.json new file mode 100644 index 0000000..a89ef4d --- /dev/null +++ b/weapp/components/custom-header/custom-header.json @@ -0,0 +1,4 @@ +{ + "component": true, + "usingComponents": {} +} diff --git a/weapp/components/custom-header/custom-header.wxml b/weapp/components/custom-header/custom-header.wxml new file mode 100644 index 0000000..3f773c1 --- /dev/null +++ b/weapp/components/custom-header/custom-header.wxml @@ -0,0 +1,8 @@ + + + + + {{title}} + + + diff --git a/weapp/components/custom-header/custom-header.wxss b/weapp/components/custom-header/custom-header.wxss new file mode 100644 index 0000000..3518b9b --- /dev/null +++ b/weapp/components/custom-header/custom-header.wxss @@ -0,0 +1,50 @@ +.custom-nav { + position: fixed; + top: 0; + left: 0; + width: 100%; + background-color: #bbecdc; + z-index: 999; +} + +.status-bar { + width: 100%; +} + +.nav-content { + display: flex; + justify-content: space-between; + align-items: center; + height: 44px; + padding: 0 15px; +} + +.menu-icon { + font-size: 24px; + color: #333; + width: 24px; +} + +.title { + font-size: 18px; + font-weight: bold; + color: #333; + flex: 1; + text-align: center; +} + +.placeholder { + width: 24px; +} + +.custom-header { + position: fixed; + top: 0; + left: 0; + right: 0; + height: calc(88rpx + env(safe-area-inset-top)); + padding-top: env(safe-area-inset-top); + background-color: #F8F8F8; + z-index: 1001; + /* 其他样式保持不变 */ +} diff --git a/weapp/components/privacyPopup/privacyPopup.js b/weapp/components/privacyPopup/privacyPopup.js new file mode 100644 index 0000000..397e259 --- /dev/null +++ b/weapp/components/privacyPopup/privacyPopup.js @@ -0,0 +1,61 @@ + Component({ + data: { + title: "用户隐私保护提示", + desc1: "感谢您使用本程序,您使用本程序前应当阅读并同意", + urlTitle: "《用户隐私保护指引》", + desc2: "当您点击同意并开始时用产品服务时,即表示你已理解并同息该条款内容,该条款将对您产生法律约束力。如您拒绝,将无法使用本程序。", + innerShow: false, + height: 0, + }, + lifetimes: { + attached: function() { + if (wx.getPrivacySetting) { + wx.getPrivacySetting({ + success: res => { + console.log("是否需要授权:", res.needAuthorization, "隐私协议的名称为:", res.privacyContractName) + if (res.needAuthorization) { + this.popUp() + } else{ + this.triggerEvent("agree") + } + }, + fail: () => { }, + complete: () => { }, + }) + } else { + // 低版本基础库不支持 wx.getPrivacySetting 接口,隐私接口可以直接调用 + this.triggerEvent("agree") + } + }, + }, + methods: { + handleDisagree(e) { + this.triggerEvent("disagree") + this.disPopUp() + }, + handleAgree(e) { + this.triggerEvent("agree") + this.disPopUp() + }, + popUp() { + this.setData({ + innerShow: true + }) + }, + disPopUp() { + this.setData({ + innerShow: false + }) + }, + openPrivacyContract() { + wx.openPrivacyContract({ + success: res => { + console.log('openPrivacyContract success') + }, + fail: res => { + console.error('openPrivacyContract fail', res) + } + }) + } + } +}) \ No newline at end of file diff --git a/weapp/components/privacyPopup/privacyPopup.json b/weapp/components/privacyPopup/privacyPopup.json new file mode 100644 index 0000000..7e37c03 --- /dev/null +++ b/weapp/components/privacyPopup/privacyPopup.json @@ -0,0 +1,4 @@ +{ + "component": true, + "usingComponents": {} +} \ No newline at end of file diff --git a/weapp/components/privacyPopup/privacyPopup.wxml b/weapp/components/privacyPopup/privacyPopup.wxml new file mode 100644 index 0000000..a52b1b2 --- /dev/null +++ b/weapp/components/privacyPopup/privacyPopup.wxml @@ -0,0 +1,25 @@ + + + {{title}} + + + {{desc1}} + {{urlTitle}} + {{desc2}} + + + + + + + + \ No newline at end of file diff --git a/weapp/components/privacyPopup/privacyPopup.wxss b/weapp/components/privacyPopup/privacyPopup.wxss new file mode 100644 index 0000000..9c3965b --- /dev/null +++ b/weapp/components/privacyPopup/privacyPopup.wxss @@ -0,0 +1,5177 @@ +/*! + * WeUI v2.5.16 (https://github.com/weui/weui-wxss) + * Copyright 2023 Tencent, Inc. + * Licensed under the MIT license + */ + [data-weui-theme='light'], + page { + --weui-BTN-DISABLED-FONT-COLOR: rgba(0, 0, 0, 0.2); + } + [data-weui-theme='dark'] { + --weui-BTN-DISABLED-FONT-COLOR: hsla(0, 0%, 100%, 0.2); + } + [data-weui-theme='light'], + page { + --weui-BTN-DEFAULT-BG: #f2f2f2; + } + [data-weui-theme='dark'] { + --weui-BTN-DEFAULT-BG: hsla(0, 0%, 100%, 0.08); + } + [data-weui-theme='light'], + page { + --weui-BTN-DEFAULT-COLOR: #06ae56; + } + [data-weui-theme='dark'] { + --weui-BTN-DEFAULT-COLOR: hsla(0, 0%, 100%, 0.8); + } + [data-weui-theme='light'], + page { + --weui-BTN-DEFAULT-ACTIVE-BG: #e6e6e6; + } + [data-weui-theme='dark'] { + --weui-BTN-DEFAULT-ACTIVE-BG: hsla(0, 0%, 100%, 0.126); + } + [data-weui-theme='light'], + page { + --weui-BTN-ACTIVE-MASK: rgba(0, 0, 0, 0.1); + } + [data-weui-theme='dark'] { + --weui-BTN-ACTIVE-MASK: hsla(0, 0%, 100%, 0.05); + } + [data-weui-theme='light'][data-weui-mode='care'], + page[data-weui-mode='care'] { + --weui-BTN-DEFAULT-COLOR: #018942; + } + [data-weui-theme='dark'][data-weui-mode='care'] { + --weui-BTN-DEFAULT-COLOR: hsla(0, 0%, 100%, 0.8); + } + [data-weui-theme='light'], + page { + --weui-DIALOG-LINE-COLOR: rgba(0, 0, 0, 0.1); + } + [data-weui-theme='dark'] { + --weui-DIALOG-LINE-COLOR: hsla(0, 0%, 100%, 0.1); + } + page { + line-height: 1.6; + font-family: system-ui, -apple-system, Helvetica Neue, sans-serif; + } + icon { + vertical-align: middle; + } + .weui-input__placeholder { + color: var(--weui-FG-2); + } + [data-weui-theme='light'], + page { + --weui-BG-0: #ededed; + --weui-BG-1: #f7f7f7; + --weui-BG-2: #fff; + --weui-BG-3: #f7f7f7; + --weui-BG-4: #4c4c4c; + --weui-BG-5: #fff; + --weui-FG-0: rgba(0, 0, 0, 0.9); + --weui-FG-HALF: rgba(0, 0, 0, 0.9); + --weui-FG-1: rgba(0, 0, 0, 0.5); + --weui-FG-2: rgba(0, 0, 0, 0.3); + --weui-FG-3: rgba(0, 0, 0, 0.1); + --weui-FG-4: rgba(0, 0, 0, 0.15); + --weui-RED: #fa5151; + --weui-REDORANGE: #ff6146; + --weui-ORANGE: #fa9d3b; + --weui-YELLOW: #ffc300; + --weui-GREEN: #91d300; + --weui-LIGHTGREEN: #95ec69; + --weui-BRAND: #07c160; + --weui-BLUE: #10aeff; + --weui-INDIGO: #1485ee; + --weui-PURPLE: #6467f0; + --weui-WHITE: #fff; + --weui-LINK: #576b95; + --weui-TEXTGREEN: #06ae56; + --weui-FG: #000; + --weui-BG: #fff; + --weui-TAG-TEXT-ORANGE: #fa9d3b; + --weui-TAG-BACKGROUND-ORANGE: rgba(250, 157, 59, 0.1); + --weui-TAG-TEXT-GREEN: #06ae56; + --weui-TAG-BACKGROUND-GREEN: rgba(6, 174, 86, 0.1); + --weui-TAG-TEXT-BLUE: #10aeff; + --weui-TAG-BACKGROUND-BLUE: rgba(16, 174, 255, 0.1); + --weui-TAG-TEXT-BLACK: rgba(0, 0, 0, 0.5); + --weui-TAG-BACKGROUND-BLACK: rgba(0, 0, 0, 0.05); + } + [data-weui-theme='dark'] { + --weui-BG-0: #111; + --weui-BG-1: #1e1e1e; + --weui-BG-2: #191919; + --weui-BG-3: #202020; + --weui-BG-4: #404040; + --weui-BG-5: #2c2c2c; + --weui-FG-0: hsla(0, 0%, 100%, 0.8); + --weui-FG-HALF: hsla(0, 0%, 100%, 0.6); + --weui-FG-1: hsla(0, 0%, 100%, 0.5); + --weui-FG-2: hsla(0, 0%, 100%, 0.3); + --weui-FG-3: hsla(0, 0%, 100%, 0.1); + --weui-FG-4: hsla(0, 0%, 100%, 0.15); + --weui-RED: #fa5151; + --weui-REDORANGE: #ff6146; + --weui-ORANGE: #c87d2f; + --weui-YELLOW: #cc9c00; + --weui-GREEN: #74a800; + --weui-LIGHTGREEN: #3eb575; + --weui-BRAND: #07c160; + --weui-BLUE: #10aeff; + --weui-INDIGO: #1196ff; + --weui-PURPLE: #8183ff; + --weui-WHITE: hsla(0, 0%, 100%, 0.8); + --weui-LINK: #7d90a9; + --weui-TEXTGREEN: #259c5c; + --weui-FG: #fff; + --weui-BG: #000; + --weui-TAG-TEXT-ORANGE: rgba(250, 157, 59, 0.6); + --weui-TAG-BACKGROUND-ORANGE: rgba(250, 157, 59, 0.1); + --weui-TAG-TEXT-GREEN: rgba(6, 174, 86, 0.6); + --weui-TAG-BACKGROUND-GREEN: rgba(6, 174, 86, 0.1); + --weui-TAG-TEXT-BLUE: rgba(16, 174, 255, 0.6); + --weui-TAG-BACKGROUND-BLUE: rgba(16, 174, 255, 0.1); + --weui-TAG-TEXT-BLACK: hsla(0, 0%, 100%, 0.5); + --weui-TAG-BACKGROUND-BLACK: hsla(0, 0%, 100%, 0.05); + } + [data-weui-theme='light'][data-weui-mode='care'], + page[data-weui-mode='care'] { + --weui-BG-0: #ededed; + --weui-BG-1: #f7f7f7; + --weui-BG-2: #fff; + --weui-BG-3: #f7f7f7; + --weui-BG-4: #4c4c4c; + --weui-BG-5: #fff; + --weui-FG-0: #000; + --weui-FG-HALF: #000; + --weui-FG-1: rgba(0, 0, 0, 0.6); + --weui-FG-2: rgba(0, 0, 0, 0.42); + --weui-FG-3: rgba(0, 0, 0, 0.1); + --weui-FG-4: rgba(0, 0, 0, 0.15); + --weui-RED: #dc3636; + --weui-REDORANGE: #ff6146; + --weui-ORANGE: #e17719; + --weui-YELLOW: #bb8e00; + --weui-GREEN: #4f8400; + --weui-LIGHTGREEN: #2e8800; + --weui-BRAND: #018942; + --weui-BLUE: #007dbb; + --weui-INDIGO: #0075e2; + --weui-PURPLE: #6265f1; + --weui-WHITE: #fff; + --weui-LINK: #576b95; + --weui-TEXTGREEN: #06ae56; + --weui-FG: #000; + --weui-BG: #fff; + --weui-TAG-TEXT-ORANGE: #e17719; + --weui-TAG-BACKGROUND-ORANGE: rgba(225, 119, 25, 0.1); + --weui-TAG-TEXT-GREEN: #06ae56; + --weui-TAG-BACKGROUND-GREEN: rgba(6, 174, 86, 0.1); + --weui-TAG-TEXT-BLUE: #007dbb; + --weui-TAG-BACKGROUND-BLUE: rgba(0, 125, 187, 0.1); + --weui-TAG-TEXT-BLACK: rgba(0, 0, 0, 0.5); + --weui-TAG-BACKGROUND-BLACK: rgba(0, 0, 0, 0.05); + } + [data-weui-theme='dark'][data-weui-mode='care'] { + --weui-BG-0: #111; + --weui-BG-1: #1e1e1e; + --weui-BG-2: #191919; + --weui-BG-3: #202020; + --weui-BG-4: #404040; + --weui-BG-5: #2c2c2c; + --weui-FG-0: hsla(0, 0%, 100%, 0.85); + --weui-FG-HALF: hsla(0, 0%, 100%, 0.65); + --weui-FG-1: hsla(0, 0%, 100%, 0.55); + --weui-FG-2: hsla(0, 0%, 100%, 0.35); + --weui-FG-3: hsla(0, 0%, 100%, 0.1); + --weui-FG-4: hsla(0, 0%, 100%, 0.15); + --weui-RED: #fa5151; + --weui-REDORANGE: #ff6146; + --weui-ORANGE: #c87d2f; + --weui-YELLOW: #cc9c00; + --weui-GREEN: #74a800; + --weui-LIGHTGREEN: #3eb575; + --weui-BRAND: #07c160; + --weui-BLUE: #10aeff; + --weui-INDIGO: #1196ff; + --weui-PURPLE: #8183ff; + --weui-WHITE: hsla(0, 0%, 100%, 0.8); + --weui-LINK: #7d90a9; + --weui-TEXTGREEN: #259c5c; + --weui-FG: #fff; + --weui-BG: #000; + --weui-TAG-TEXT-ORANGE: rgba(250, 157, 59, 0.6); + --weui-TAG-BACKGROUND-ORANGE: rgba(250, 157, 59, 0.1); + --weui-TAG-TEXT-GREEN: rgba(6, 174, 86, 0.6); + --weui-TAG-BACKGROUND-GREEN: rgba(6, 174, 86, 0.1); + --weui-TAG-TEXT-BLUE: rgba(16, 174, 255, 0.6); + --weui-TAG-BACKGROUND-BLUE: rgba(16, 174, 255, 0.1); + --weui-TAG-TEXT-BLACK: hsla(0, 0%, 100%, 0.5); + --weui-TAG-BACKGROUND-BLACK: hsla(0, 0%, 100%, 0.05); + } + [data-weui-theme='light'], + page { + --weui-BG-COLOR-ACTIVE: #ececec; + } + [data-weui-theme='dark'] { + --weui-BG-COLOR-ACTIVE: #373737; + } + [class*=' weui-icon-'][class*=' weui-icon-'], + [class*=' weui-icon-'][class^='weui-icon-'], + [class^='weui-icon-'][class*=' weui-icon-'], + [class^='weui-icon-'][class^='weui-icon-'] { + display: inline-block; + vertical-align: middle; + font-size: 20rpx; + width: 2.4em; + height: 2.4em; + -webkit-mask-position: 50% 50%; + mask-position: 50% 50%; + -webkit-mask-repeat: no-repeat; + mask-repeat: no-repeat; + -webkit-mask-size: 100%; + mask-size: 100%; + background-color: currentColor; + } + .weui-icon-circle { + -webkit-mask-image: url(data:image/svg+xml,%3Csvg%20width%3D%221000%22%20height%3D%221000%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M500%20916.667C269.881%20916.667%2083.333%20730.119%2083.333%20500%2083.333%20269.881%20269.881%2083.333%20500%2083.333c230.119%200%20416.667%20186.548%20416.667%20416.667%200%20230.119-186.548%20416.667-416.667%20416.667zm0-50c202.504%200%20366.667-164.163%20366.667-366.667%200-202.504-164.163-366.667-366.667-366.667-202.504%200-366.667%20164.163-366.667%20366.667%200%20202.504%20164.163%20366.667%20366.667%20366.667z%22%20fill-rule%3D%22evenodd%22%20fill-opacity%3D%22.9%22%2F%3E%3C%2Fsvg%3E); + mask-image: url(data:image/svg+xml,%3Csvg%20width%3D%221000%22%20height%3D%221000%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M500%20916.667C269.881%20916.667%2083.333%20730.119%2083.333%20500%2083.333%20269.881%20269.881%2083.333%20500%2083.333c230.119%200%20416.667%20186.548%20416.667%20416.667%200%20230.119-186.548%20416.667-416.667%20416.667zm0-50c202.504%200%20366.667-164.163%20366.667-366.667%200-202.504-164.163-366.667-366.667-366.667-202.504%200-366.667%20164.163-366.667%20366.667%200%20202.504%20164.163%20366.667%20366.667%20366.667z%22%20fill-rule%3D%22evenodd%22%20fill-opacity%3D%22.9%22%2F%3E%3C%2Fsvg%3E); + } + .weui-icon-download { + -webkit-mask-image: url(data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M11.25%2012.04l-1.72-1.72-1.06%201.06%202.828%202.83a1%201%200%20001.414-.001l2.828-2.828-1.06-1.061-1.73%201.73V7h-1.5v5.04zm0-5.04V2h1.5v5h6.251c.55%200%20.999.446.999.996v13.008a.998.998%200%2001-.996.996H4.996A.998.998%200%20014%2021.004V7.996A1%201%200%20014.999%207h6.251z%22%2F%3E%3C%2Fsvg%3E); + mask-image: url(data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M11.25%2012.04l-1.72-1.72-1.06%201.06%202.828%202.83a1%201%200%20001.414-.001l2.828-2.828-1.06-1.061-1.73%201.73V7h-1.5v5.04zm0-5.04V2h1.5v5h6.251c.55%200%20.999.446.999.996v13.008a.998.998%200%2001-.996.996H4.996A.998.998%200%20014%2021.004V7.996A1%201%200%20014.999%207h6.251z%22%2F%3E%3C%2Fsvg%3E); + } + .weui-icon-info { + -webkit-mask-image: url(data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M12%2022C6.477%2022%202%2017.523%202%2012S6.477%202%2012%202s10%204.477%2010%2010-4.477%2010-10%2010zm-.75-12v7h1.5v-7h-1.5zM12%209a1%201%200%20100-2%201%201%200%20000%202z%22%2F%3E%3C%2Fsvg%3E); + mask-image: url(data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M12%2022C6.477%2022%202%2017.523%202%2012S6.477%202%2012%202s10%204.477%2010%2010-4.477%2010-10%2010zm-.75-12v7h1.5v-7h-1.5zM12%209a1%201%200%20100-2%201%201%200%20000%202z%22%2F%3E%3C%2Fsvg%3E); + } + .weui-icon-safe-success { + -webkit-mask-image: url(data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%201000%201000%22%3E%3Cpath%20d%3D%22M500.9%204.6C315.5%2046.7%20180.4%2093.1%2057.6%20132c0%20129.3.2%20231.7.2%20339.7%200%20304.2%20248.3%20471.6%20443.1%20523.7C695.7%20943.3%20944%20775.9%20944%20471.7c0-108%20.2-210.4.2-339.7C821.4%2093.1%20686.3%2046.7%20500.9%204.6zm248.3%20349.1l-299.7%20295c-2.1%202-5.3%202-7.4-.1L304.4%20506.1c-2-2.1-2.3-5.7-.6-8l18.3-24.9c1.7-2.3%205-2.8%207.2-1l112.2%2086c2.3%201.8%206%201.7%208.1-.1l274.7-228.9c2.2-1.8%205.7-1.7%207.7.3l17%2016.8c2.2%202.1%202.2%205.3.2%207.4z%22%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20fill%3D%22%23070202%22%2F%3E%3C%2Fsvg%3E); + mask-image: url(data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%201000%201000%22%3E%3Cpath%20d%3D%22M500.9%204.6C315.5%2046.7%20180.4%2093.1%2057.6%20132c0%20129.3.2%20231.7.2%20339.7%200%20304.2%20248.3%20471.6%20443.1%20523.7C695.7%20943.3%20944%20775.9%20944%20471.7c0-108%20.2-210.4.2-339.7C821.4%2093.1%20686.3%2046.7%20500.9%204.6zm248.3%20349.1l-299.7%20295c-2.1%202-5.3%202-7.4-.1L304.4%20506.1c-2-2.1-2.3-5.7-.6-8l18.3-24.9c1.7-2.3%205-2.8%207.2-1l112.2%2086c2.3%201.8%206%201.7%208.1-.1l274.7-228.9c2.2-1.8%205.7-1.7%207.7.3l17%2016.8c2.2%202.1%202.2%205.3.2%207.4z%22%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20fill%3D%22%23070202%22%2F%3E%3C%2Fsvg%3E); + } + .weui-icon-safe-warn { + -webkit-mask-image: url(data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%201000%201000%22%3E%3Cpath%20d%3D%22M500.9%204.5c-185.4%2042-320.4%2088.4-443.2%20127.3%200%20129.3.2%20231.7.2%20339.6%200%20304.1%20248.2%20471.4%20443%20523.6%20194.7-52.2%20443-219.5%20443-523.6%200-107.9.2-210.3.2-339.6C821.3%2092.9%20686.2%2046.5%20500.9%204.5zm-26.1%20271.1h52.1c5.8%200%2010.3%204.7%2010.1%2010.4l-11.6%20313.8c-.1%202.8-2.5%205.2-5.4%205.2h-38.2c-2.9%200-5.3-2.3-5.4-5.2L464.8%20286c-.2-5.8%204.3-10.4%2010-10.4zm26.1%20448.3c-20.2%200-36.5-16.3-36.5-36.5s16.3-36.5%2036.5-36.5%2036.5%2016.3%2036.5%2036.5-16.4%2036.5-36.5%2036.5z%22%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20fill%3D%22%23020202%22%2F%3E%3C%2Fsvg%3E); + mask-image: url(data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%201000%201000%22%3E%3Cpath%20d%3D%22M500.9%204.5c-185.4%2042-320.4%2088.4-443.2%20127.3%200%20129.3.2%20231.7.2%20339.6%200%20304.1%20248.2%20471.4%20443%20523.6%20194.7-52.2%20443-219.5%20443-523.6%200-107.9.2-210.3.2-339.6C821.3%2092.9%20686.2%2046.5%20500.9%204.5zm-26.1%20271.1h52.1c5.8%200%2010.3%204.7%2010.1%2010.4l-11.6%20313.8c-.1%202.8-2.5%205.2-5.4%205.2h-38.2c-2.9%200-5.3-2.3-5.4-5.2L464.8%20286c-.2-5.8%204.3-10.4%2010-10.4zm26.1%20448.3c-20.2%200-36.5-16.3-36.5-36.5s16.3-36.5%2036.5-36.5%2036.5%2016.3%2036.5%2036.5-16.4%2036.5-36.5%2036.5z%22%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20fill%3D%22%23020202%22%2F%3E%3C%2Fsvg%3E); + } + .weui-icon-success { + -webkit-mask-image: url(data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M12%2022C6.477%2022%202%2017.523%202%2012S6.477%202%2012%202s10%204.477%2010%2010-4.477%2010-10%2010zm-1.177-7.86l-2.765-2.767L7%2012.431l3.119%203.121a1%201%200%20001.414%200l5.952-5.95-1.062-1.062-5.6%205.6z%22%2F%3E%3C%2Fsvg%3E); + mask-image: url(data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M12%2022C6.477%2022%202%2017.523%202%2012S6.477%202%2012%202s10%204.477%2010%2010-4.477%2010-10%2010zm-1.177-7.86l-2.765-2.767L7%2012.431l3.119%203.121a1%201%200%20001.414%200l5.952-5.95-1.062-1.062-5.6%205.6z%22%2F%3E%3C%2Fsvg%3E); + } + .weui-icon-success-circle { + -webkit-mask-image: url(data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M12%2022C6.477%2022%202%2017.523%202%2012S6.477%202%2012%202s10%204.477%2010%2010-4.477%2010-10%2010zm0-1.2a8.8%208.8%200%20100-17.6%208.8%208.8%200%20000%2017.6zm-1.172-6.242l5.809-5.808.848.849-5.95%205.95a1%201%200%2001-1.414%200L7%2012.426l.849-.849%202.98%202.98z%22%2F%3E%3C%2Fsvg%3E); + mask-image: url(data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M12%2022C6.477%2022%202%2017.523%202%2012S6.477%202%2012%202s10%204.477%2010%2010-4.477%2010-10%2010zm0-1.2a8.8%208.8%200%20100-17.6%208.8%208.8%200%20000%2017.6zm-1.172-6.242l5.809-5.808.848.849-5.95%205.95a1%201%200%2001-1.414%200L7%2012.426l.849-.849%202.98%202.98z%22%2F%3E%3C%2Fsvg%3E); + } + .weui-icon-success-no-circle { + -webkit-mask-image: url(data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M8.657%2018.435L3%2012.778l1.414-1.414%204.95%204.95L20.678%205l1.414%201.414-12.02%2012.021a1%201%200%2001-1.415%200z%22%20fill-rule%3D%22evenodd%22%2F%3E%3C%2Fsvg%3E); + mask-image: url(data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M8.657%2018.435L3%2012.778l1.414-1.414%204.95%204.95L20.678%205l1.414%201.414-12.02%2012.021a1%201%200%2001-1.415%200z%22%20fill-rule%3D%22evenodd%22%2F%3E%3C%2Fsvg%3E); + } + .weui-icon-waiting { + -webkit-mask-image: url(data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M12.75%2011.38V6h-1.5v6l4.243%204.243%201.06-1.06-3.803-3.804zM12%2022C6.477%2022%202%2017.523%202%2012S6.477%202%2012%202s10%204.477%2010%2010-4.477%2010-10%2010z%22%20fill-rule%3D%22evenodd%22%2F%3E%3C%2Fsvg%3E); + mask-image: url(data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M12.75%2011.38V6h-1.5v6l4.243%204.243%201.06-1.06-3.803-3.804zM12%2022C6.477%2022%202%2017.523%202%2012S6.477%202%2012%202s10%204.477%2010%2010-4.477%2010-10%2010z%22%20fill-rule%3D%22evenodd%22%2F%3E%3C%2Fsvg%3E); + } + .weui-icon-waiting-circle { + -webkit-mask-image: url(data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M12.6%2011.503l3.891%203.891-.848.849L11.4%2012V6h1.2v5.503zM12%2022C6.477%2022%202%2017.523%202%2012S6.477%202%2012%202s10%204.477%2010%2010-4.477%2010-10%2010zm0-1.2a8.8%208.8%200%20100-17.6%208.8%208.8%200%20000%2017.6z%22%2F%3E%3C%2Fsvg%3E); + mask-image: url(data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M12.6%2011.503l3.891%203.891-.848.849L11.4%2012V6h1.2v5.503zM12%2022C6.477%2022%202%2017.523%202%2012S6.477%202%2012%202s10%204.477%2010%2010-4.477%2010-10%2010zm0-1.2a8.8%208.8%200%20100-17.6%208.8%208.8%200%20000%2017.6z%22%2F%3E%3C%2Fsvg%3E); + } + .weui-icon-warn { + -webkit-mask-image: url(data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M12%2022C6.477%2022%202%2017.523%202%2012S6.477%202%2012%202s10%204.477%2010%2010-4.477%2010-10%2010zm-.763-15.864l.11%207.596h1.305l.11-7.596h-1.525zm.759%2010.967c.512%200%20.902-.383.902-.882%200-.5-.39-.882-.902-.882a.878.878%200%2000-.896.882c0%20.499.396.882.896.882z%22%2F%3E%3C%2Fsvg%3E); + mask-image: url(data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M12%2022C6.477%2022%202%2017.523%202%2012S6.477%202%2012%202s10%204.477%2010%2010-4.477%2010-10%2010zm-.763-15.864l.11%207.596h1.305l.11-7.596h-1.525zm.759%2010.967c.512%200%20.902-.383.902-.882%200-.5-.39-.882-.902-.882a.878.878%200%2000-.896.882c0%20.499.396.882.896.882z%22%2F%3E%3C%2Fsvg%3E); + } + .weui-icon-info-circle { + -webkit-mask-image: url(data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M12%2022C6.477%2022%202%2017.523%202%2012S6.477%202%2012%202s10%204.477%2010%2010-4.477%2010-10%2010zm0-1.2a8.8%208.8%200%20100-17.6%208.8%208.8%200%20000%2017.6zM11.4%2010h1.2v7h-1.2v-7zm.6-1a1%201%200%20110-2%201%201%200%20010%202z%22%2F%3E%3C%2Fsvg%3E); + mask-image: url(data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M12%2022C6.477%2022%202%2017.523%202%2012S6.477%202%2012%202s10%204.477%2010%2010-4.477%2010-10%2010zm0-1.2a8.8%208.8%200%20100-17.6%208.8%208.8%200%20000%2017.6zM11.4%2010h1.2v7h-1.2v-7zm.6-1a1%201%200%20110-2%201%201%200%20010%202z%22%2F%3E%3C%2Fsvg%3E); + } + .weui-icon-cancel { + -webkit-mask-image: url(data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cg%20fill-rule%3D%22evenodd%22%3E%3Cpath%20d%3D%22M12%2022C6.477%2022%202%2017.523%202%2012S6.477%202%2012%202s10%204.477%2010%2010-4.477%2010-10%2010zm0-1.2a8.8%208.8%200%20100-17.6%208.8%208.8%200%20000%2017.6z%22%20fill-rule%3D%22nonzero%22%2F%3E%3Cpath%20d%3D%22M12.849%2012l3.11%203.111-.848.849L12%2012.849l-3.111%203.11-.849-.848L11.151%2012l-3.11-3.111.848-.849L12%2011.151l3.111-3.11.849.848L12.849%2012z%22%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E); + mask-image: url(data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cg%20fill-rule%3D%22evenodd%22%3E%3Cpath%20d%3D%22M12%2022C6.477%2022%202%2017.523%202%2012S6.477%202%2012%202s10%204.477%2010%2010-4.477%2010-10%2010zm0-1.2a8.8%208.8%200%20100-17.6%208.8%208.8%200%20000%2017.6z%22%20fill-rule%3D%22nonzero%22%2F%3E%3Cpath%20d%3D%22M12.849%2012l3.11%203.111-.848.849L12%2012.849l-3.111%203.11-.849-.848L11.151%2012l-3.11-3.111.848-.849L12%2011.151l3.111-3.11.849.848L12.849%2012z%22%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E); + } + .weui-icon-search { + -webkit-mask-image: url(data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M16.31%2015.561l4.114%204.115-.848.848-4.123-4.123a7%207%200%2011.857-.84zM16.8%2011a5.8%205.8%200%2010-11.6%200%205.8%205.8%200%200011.6%200z%22%20fill-rule%3D%22evenodd%22%2F%3E%3C%2Fsvg%3E); + mask-image: url(data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M16.31%2015.561l4.114%204.115-.848.848-4.123-4.123a7%207%200%2011.857-.84zM16.8%2011a5.8%205.8%200%2010-11.6%200%205.8%205.8%200%200011.6%200z%22%20fill-rule%3D%22evenodd%22%2F%3E%3C%2Fsvg%3E); + } + .weui-icon-clear { + -webkit-mask-image: url(data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M13.06%2012l3.006-3.005-1.06-1.06L12%2010.938%208.995%207.934l-1.06%201.06L10.938%2012l-3.005%203.005%201.06%201.06L12%2013.062l3.005%203.005%201.06-1.06L13.062%2012zM12%2022C6.477%2022%202%2017.523%202%2012S6.477%202%2012%202s10%204.477%2010%2010-4.477%2010-10%2010z%22%2F%3E%3C%2Fsvg%3E); + mask-image: url(data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M13.06%2012l3.006-3.005-1.06-1.06L12%2010.938%208.995%207.934l-1.06%201.06L10.938%2012l-3.005%203.005%201.06%201.06L12%2013.062l3.005%203.005%201.06-1.06L13.062%2012zM12%2022C6.477%2022%202%2017.523%202%2012S6.477%202%2012%202s10%204.477%2010%2010-4.477%2010-10%2010z%22%2F%3E%3C%2Fsvg%3E); + } + .weui-icon-back { + -webkit-mask-image: url(data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M12%2022C6.477%2022%202%2017.523%202%2012S6.477%202%2012%202s10%204.477%2010%2010-4.477%2010-10%2010zm1.999-6.563L10.68%2012%2014%208.562%2012.953%207.5%209.29%2011.277a1.045%201.045%200%20000%201.446l3.663%203.777L14%2015.437z%22%20fill-rule%3D%22evenodd%22%2F%3E%3C%2Fsvg%3E); + mask-image: url(data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M12%2022C6.477%2022%202%2017.523%202%2012S6.477%202%2012%202s10%204.477%2010%2010-4.477%2010-10%2010zm1.999-6.563L10.68%2012%2014%208.562%2012.953%207.5%209.29%2011.277a1.045%201.045%200%20000%201.446l3.663%203.777L14%2015.437z%22%20fill-rule%3D%22evenodd%22%2F%3E%3C%2Fsvg%3E); + } + .weui-icon-delete { + -webkit-mask-image: url(data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M6.774%206.4l.812%2013.648a.8.8%200%2000.798.752h7.232a.8.8%200%2000.798-.752L17.226%206.4H6.774zm11.655%200l-.817%2013.719A2%202%200%200115.616%2022H8.384a2%202%200%2001-1.996-1.881L5.571%206.4H3.5v-.7a.5.5%200%2001.5-.5h16a.5.5%200%2001.5.5v.7h-2.071zM14%203a.5.5%200%2001.5.5v.7h-5v-.7A.5.5%200%200110%203h4zM9.5%209h1.2l.5%209H10l-.5-9zm3.8%200h1.2l-.5%209h-1.2l.5-9z%22%2F%3E%3C%2Fsvg%3E); + mask-image: url(data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M6.774%206.4l.812%2013.648a.8.8%200%2000.798.752h7.232a.8.8%200%2000.798-.752L17.226%206.4H6.774zm11.655%200l-.817%2013.719A2%202%200%200115.616%2022H8.384a2%202%200%2001-1.996-1.881L5.571%206.4H3.5v-.7a.5.5%200%2001.5-.5h16a.5.5%200%2001.5.5v.7h-2.071zM14%203a.5.5%200%2001.5.5v.7h-5v-.7A.5.5%200%200110%203h4zM9.5%209h1.2l.5%209H10l-.5-9zm3.8%200h1.2l-.5%209h-1.2l.5-9z%22%2F%3E%3C%2Fsvg%3E); + } + .weui-icon-success-no-circle-thin { + -webkit-mask-image: url(data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M8.864%2016.617l-5.303-5.303-1.061%201.06%205.657%205.657a1%201%200%20001.414%200L21.238%206.364l-1.06-1.06L8.864%2016.616z%22%20fill-rule%3D%22evenodd%22%2F%3E%3C%2Fsvg%3E); + mask-image: url(data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M8.864%2016.617l-5.303-5.303-1.061%201.06%205.657%205.657a1%201%200%20001.414%200L21.238%206.364l-1.06-1.06L8.864%2016.616z%22%20fill-rule%3D%22evenodd%22%2F%3E%3C%2Fsvg%3E); + } + .weui-icon-arrow { + -webkit-mask-image: url(data:image/svg+xml,%3Csvg%20width%3D%2212%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M2.454%206.58l1.06-1.06%205.78%205.779a.996.996%200%20010%201.413l-5.78%205.779-1.06-1.061%205.425-5.425-5.425-5.424z%22%20fill%3D%22%23B2B2B2%22%20fill-rule%3D%22evenodd%22%2F%3E%3C%2Fsvg%3E); + mask-image: url(data:image/svg+xml,%3Csvg%20width%3D%2212%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M2.454%206.58l1.06-1.06%205.78%205.779a.996.996%200%20010%201.413l-5.78%205.779-1.06-1.061%205.425-5.425-5.425-5.424z%22%20fill%3D%22%23B2B2B2%22%20fill-rule%3D%22evenodd%22%2F%3E%3C%2Fsvg%3E); + } + .weui-icon-arrow-bold { + -webkit-mask-image: url(data:image/svg+xml,%3Csvg%20height%3D%2224%22%20width%3D%2212%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M10.157%2012.711L4.5%2018.368l-1.414-1.414%204.95-4.95-4.95-4.95L4.5%205.64l5.657%205.657a1%201%200%20010%201.414z%22%20fill-rule%3D%22evenodd%22%2F%3E%3C%2Fsvg%3E); + mask-image: url(data:image/svg+xml,%3Csvg%20height%3D%2224%22%20width%3D%2212%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M10.157%2012.711L4.5%2018.368l-1.414-1.414%204.95-4.95-4.95-4.95L4.5%205.64l5.657%205.657a1%201%200%20010%201.414z%22%20fill-rule%3D%22evenodd%22%2F%3E%3C%2Fsvg%3E); + } + .weui-icon-back-arrow { + -webkit-mask-image: url(data:image/svg+xml,%3Csvg%20width%3D%2212%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M3.343%2012l7.071%207.071L9%2020.485l-7.778-7.778a1%201%200%20010-1.414L9%203.515l1.414%201.414L3.344%2012z%22%20fill-rule%3D%22evenodd%22%2F%3E%3C%2Fsvg%3E); + mask-image: url(data:image/svg+xml,%3Csvg%20width%3D%2212%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M3.343%2012l7.071%207.071L9%2020.485l-7.778-7.778a1%201%200%20010-1.414L9%203.515l1.414%201.414L3.344%2012z%22%20fill-rule%3D%22evenodd%22%2F%3E%3C%2Fsvg%3E); + } + .weui-icon-back-arrow-thin { + -webkit-mask-image: url(data:image/svg+xml,%3Csvg%20width%3D%2212%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M10%2019.438L8.955%2020.5l-7.666-7.79a1.02%201.02%200%20010-1.42L8.955%203.5%2010%204.563%202.682%2012%2010%2019.438z%22%20fill-rule%3D%22evenodd%22%2F%3E%3C%2Fsvg%3E); + mask-image: url(data:image/svg+xml,%3Csvg%20width%3D%2212%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M10%2019.438L8.955%2020.5l-7.666-7.79a1.02%201.02%200%20010-1.42L8.955%203.5%2010%204.563%202.682%2012%2010%2019.438z%22%20fill-rule%3D%22evenodd%22%2F%3E%3C%2Fsvg%3E); + } + .weui-icon-close { + -webkit-mask-image: url(data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M12%2010.586l5.657-5.657%201.414%201.414L13.414%2012l5.657%205.657-1.414%201.414L12%2013.414l-5.657%205.657-1.414-1.414L10.586%2012%204.929%206.343%206.343%204.93%2012%2010.586z%22%20fill-rule%3D%22evenodd%22%2F%3E%3C%2Fsvg%3E); + mask-image: url(data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M12%2010.586l5.657-5.657%201.414%201.414L13.414%2012l5.657%205.657-1.414%201.414L12%2013.414l-5.657%205.657-1.414-1.414L10.586%2012%204.929%206.343%206.343%204.93%2012%2010.586z%22%20fill-rule%3D%22evenodd%22%2F%3E%3C%2Fsvg%3E); + } + .weui-icon-close-thin { + -webkit-mask-image: url(data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M12.25%2010.693L6.057%204.5%205%205.557l6.193%206.193L5%2017.943%206.057%2019l6.193-6.193L18.443%2019l1.057-1.057-6.193-6.193L19.5%205.557%2018.443%204.5z%22%20fill-rule%3D%22evenodd%22%2F%3E%3C%2Fsvg%3E); + mask-image: url(data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M12.25%2010.693L6.057%204.5%205%205.557l6.193%206.193L5%2017.943%206.057%2019l6.193-6.193L18.443%2019l1.057-1.057-6.193-6.193L19.5%205.557%2018.443%204.5z%22%20fill-rule%3D%22evenodd%22%2F%3E%3C%2Fsvg%3E); + } + .weui-icon-back-circle { + -webkit-mask-image: url(data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M12%2022C6.477%2022%202%2017.523%202%2012S6.477%202%2012%202s10%204.477%2010%2010-4.477%2010-10%2010zm0-1.2a8.8%208.8%200%20100-17.6%208.8%208.8%200%20000%2017.6zm1.999-5.363L12.953%2016.5%209.29%2012.723a1.045%201.045%200%20010-1.446L12.953%207.5%2014%208.563%2010.68%2012%2014%2015.438z%22%2F%3E%3C%2Fsvg%3E); + mask-image: url(data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M12%2022C6.477%2022%202%2017.523%202%2012S6.477%202%2012%202s10%204.477%2010%2010-4.477%2010-10%2010zm0-1.2a8.8%208.8%200%20100-17.6%208.8%208.8%200%20000%2017.6zm1.999-5.363L12.953%2016.5%209.29%2012.723a1.045%201.045%200%20010-1.446L12.953%207.5%2014%208.563%2010.68%2012%2014%2015.438z%22%2F%3E%3C%2Fsvg%3E); + } + .weui-icon-success { + color: var(--weui-BRAND); + } + .weui-icon-waiting { + color: var(--weui-BLUE); + } + .weui-icon-warn { + color: var(--weui-RED); + } + .weui-icon-info { + color: var(--weui-BLUE); + } + .weui-icon-success-circle, + .weui-icon-success-no-circle, + .weui-icon-success-no-circle-thin { + color: var(--weui-BRAND); + } + .weui-icon-waiting-circle { + color: var(--weui-BLUE); + } + .weui-icon-circle { + color: var(--weui-FG-2); + } + .weui-icon-download { + color: var(--weui-BRAND); + } + .weui-icon-info-circle { + color: var(--weui-FG-2); + } + .weui-icon-safe-success { + color: var(--weui-BRAND); + } + .weui-icon-safe-warn { + color: var(--weui-YELLOW); + } + .weui-icon-cancel { + color: var(--weui-RED); + } + .weui-icon-search { + color: var(--weui-FG-1); + } + .weui-icon-clear { + color: var(--weui-FG-2); + } + .weui-icon-clear:active { + color: var(--weui-FG-1); + } + .weui-icon-delete.weui-icon_gallery-delete { + color: var(--weui-WHITE); + } + .weui-icon-arrow-bold.weui-icon-arrow, + .weui-icon-arrow-bold.weui-icon-arrow-bold, + .weui-icon-arrow-bold.weui-icon-back-arrow, + .weui-icon-arrow-bold.weui-icon-back-arrow-thin, + .weui-icon-arrow.weui-icon-arrow, + .weui-icon-arrow.weui-icon-arrow-bold, + .weui-icon-arrow.weui-icon-back-arrow, + .weui-icon-arrow.weui-icon-back-arrow-thin, + .weui-icon-back-arrow-thin.weui-icon-arrow, + .weui-icon-back-arrow-thin.weui-icon-arrow-bold, + .weui-icon-back-arrow-thin.weui-icon-back-arrow, + .weui-icon-back-arrow-thin.weui-icon-back-arrow-thin, + .weui-icon-back-arrow.weui-icon-arrow, + .weui-icon-back-arrow.weui-icon-arrow-bold, + .weui-icon-back-arrow.weui-icon-back-arrow, + .weui-icon-back-arrow.weui-icon-back-arrow-thin { + width: 1.2em; + } + .weui-icon-arrow, + .weui-icon-arrow-bold { + color: var(--weui-FG-2); + } + .weui-icon-back, + .weui-icon-back-arrow, + .weui-icon-back-arrow-thin, + .weui-icon-back-circle { + color: var(--weui-FG-0); + } + .weui-icon_msg.weui-icon_msg { + width: 6.4em; + height: 6.4em; + } + .weui-icon_msg.weui-icon_msg.weui-icon-warn { + color: var(--weui-RED); + } + .weui-icon_msg.weui-icon_msg.weui-icon-info-circle { + color: var(--weui-BLUE); + } + .weui-icon_msg-primary.weui-icon_msg-primary { + width: 6.4em; + height: 6.4em; + } + .weui-icon_msg-primary.weui-icon_msg-primary.weui-icon-warn { + color: var(--weui-YELLOW); + } + .weui-hidden_abs { + opacity: 0; + position: absolute; + width: 2rpx; + height: 2rpx; + overflow: hidden; + } + .weui-a11y_ref { + display: none; + } + .weui-hidden-space:empty:before { + content: '\00A0'; + position: absolute; + width: 2rpx; + height: 2rpx; + overflow: hidden; + } + .weui-a11y-combo { + position: relative; + } + .weui-a11y-combo__helper { + opacity: 0; + position: absolute; + width: 100%; + height: 100%; + overflow: hidden; + } + .weui-a11y-combo__content { + position: relative; + z-index: 1; + } + .weui-wa-hotarea-el { + position: absolute; + top: 50%; + left: 50%; + -webkit-transform: translate(-50%, -50%); + transform: translate(-50%, -50%); + min-width: 88rpx; + min-height: 88rpx; + width: 100%; + height: 100%; + } + .weui-wa-hotarea, + .weui-wa-hotarea-el__wrp, + .weui-wa-hotarea_before { + position: relative; + } + .weui-wa-hotarea-el__wrp a, + .weui-wa-hotarea-el__wrp button, + .weui-wa-hotarea-el__wrp navigator, + .weui-wa-hotarea_before a, + .weui-wa-hotarea_before button, + .weui-wa-hotarea_before navigator, + .weui-wa-hotarea a, + .weui-wa-hotarea button, + .weui-wa-hotarea navigator { + position: relative; + z-index: 1; + } + .weui-wa-hotarea:after, + .weui-wa-hotarea_before:before { + content: ''; + pointer-events: auto; + position: absolute; + top: 50%; + left: 50%; + -webkit-transform: translate(-50%, -50%); + transform: translate(-50%, -50%); + min-width: 88rpx; + min-height: 88rpx; + width: 100%; + height: 100%; + } + .weui-link { + -webkit-tap-highlight-color: rgba(0, 0, 0, 0); + } + .weui-link, + .weui-link:visited { + color: var(--weui-LINK); + } + .weui-link:active { + opacity: 0.5; + } + .weui-btn { + position: relative; + display: block; + width: 368rpx; + margin-left: auto; + margin-right: auto; + padding: 16rpx 48rpx; + box-sizing: border-box; + font-weight: 700; + font-size: 34rpx; + text-align: center; + text-decoration: none; + color: #fff; + line-height: 1.88235294; + border-radius: 16rpx; + -webkit-tap-highlight-color: rgba(0, 0, 0, 0); + -webkit-user-select: none; + user-select: none; + } + .weui-btn:before { + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100%; + background-color: var(--weui-BTN-ACTIVE-MASK); + border-radius: 16rpx; + } + .weui-btn:not(.weui-btn_disabled):not(.weui-btn_loading):active:before, + .weui-btn:not([disabled]):not(.weui-btn_loading):active:before { + content: ''; + } + .weui-btn_block { + width: auto; + } + .weui-btn_inline { + display: inline-block; + } + .weui-btn_default { + background-color: var(--weui-BTN-DEFAULT-BG); + } + .weui-btn_default, + .weui-btn_default:not(.weui-btn_disabled):visited { + color: var(--weui-BTN-DEFAULT-COLOR); + } + .weui-btn_primary { + background-color: var(--weui-BRAND); + } + .weui-btn_primary:not(.weui-btn_disabled):visited { + color: #fff; + } + .weui-btn_warn { + background-color: var(--weui-BTN-DEFAULT-BG); + } + .weui-btn_warn, + .weui-btn_warn:not(.weui-btn_disabled):visited { + color: var(--weui-RED); + } + .weui-btn[disabled], + .weui-btn_disabled { + color: var(--weui-BTN-DISABLED-FONT-COLOR); + background-color: var(--weui-BTN-DEFAULT-BG); + } + .weui-btn_loading .weui-loading { + margin: -0.2em 16rpx 0 0; + } + .weui-btn_loading .weui-mask-loading { + margin: -0.2em 16rpx 0 0; + color: currentColor; + } + .weui-btn_loading .weui-primary-loading { + margin: -0.2em 16rpx 0 0; + vertical-align: middle; + color: currentColor; + } + .weui-btn_loading .weui-primary-loading:before { + content: ''; + } + .weui-btn_loading.weui-btn_primary { + color: var(--weui-WHITE); + } + .weui-btn_cell { + position: relative; + display: block; + margin-left: auto; + margin-right: auto; + box-sizing: border-box; + font-size: 34rpx; + text-align: center; + text-decoration: none; + color: #fff; + line-height: 1.41176471; + padding: 32rpx; + -webkit-tap-highlight-color: rgba(0, 0, 0, 0); + overflow: hidden; + background-color: var(--weui-BG-5); + } + .weui-btn_cell + .weui-btn_cell { + margin-top: 32rpx; + } + .weui-btn_cell:active { + background-color: var(--weui-BG-COLOR-ACTIVE); + } + .weui-btn_cell__icon { + display: inline-block; + vertical-align: middle; + width: 48rpx; + height: 48rpx; + margin: -0.2em 0.34em 0 0; + } + .weui-btn_cell-default { + color: var(--weui-FG-0); + } + .weui-btn_cell-primary { + color: var(--weui-LINK); + } + .weui-btn_cell-warn { + color: var(--weui-RED); + } + .weui-bottom-fixed-opr-page { + height: 100%; + display: -webkit-box; + display: -webkit-flex; + display: flex; + -webkit-box-orient: vertical; + -webkit-box-direction: normal; + -webkit-flex-direction: column; + flex-direction: column; + } + .weui-bottom-fixed-opr-page__content { + min-height: 0; + -webkit-box-flex: 1; + -webkit-flex: 1; + flex: 1; + padding-bottom: 160rpx; + box-sizing: border-box; + overflow-y: auto; + -webkit-overflow-scrolling: touch; + } + .weui-bottom-fixed-opr { + padding: 32rpx 64rpx 48rpx; + padding: 32rpx calc(64rpx + constant(safe-area-inset-right)) + calc(48rpx + constant(safe-area-inset-bottom)) + calc(64rpx + constant(safe-area-inset-left)); + padding: 32rpx calc(64rpx + env(safe-area-inset-right)) + calc(48rpx + env(safe-area-inset-bottom)) + calc(64rpx + env(safe-area-inset-left)); + background: #fff; + position: relative; + } + .weui-bottom-fixed-opr:before { + content: ''; + height: 160rpx; + background: -webkit-linear-gradient(bottom, #fff, hsla(0, 0%, 100%, 0)); + background: linear-gradient(0deg, #fff, hsla(0, 0%, 100%, 0)); + position: absolute; + bottom: calc(100% - 2rpx); + left: 0; + right: 0; + -webkit-transform: translateZ(0); + transform: translateZ(0); + } + [data-weui-theme='dark'] .weui-bottom-fixed-opr { + background: #191919; + } + [data-weui-theme='dark'] .weui-bottom-fixed-opr:before { + background: -webkit-linear-gradient(bottom, #191919, rgba(25, 25, 25, 0)); + background: linear-gradient(0deg, #191919, rgba(25, 25, 25, 0)); + } + .weui-bottom-fixed-opr-page .weui-bottom-fixed-opr { + display: -webkit-box; + display: -webkit-flex; + display: flex; + -webkit-box-align: center; + -webkit-align-items: center; + align-items: center; + -webkit-box-pack: center; + -webkit-justify-content: center; + justify-content: center; + } + .weui-bottom-fixed-opr-page .weui-bottom-fixed-opr .weui-btn { + width: 368rpx; + padding-left: 32rpx; + padding-right: 32rpx; + } + .weui-bottom-fixed-opr-page + .weui-bottom-fixed-opr + .weui-btn:nth-last-child(n + 2), + .weui-bottom-fixed-opr-page + .weui-bottom-fixed-opr + .weui-btn:nth-last-child(n + 2) + + .weui-btn { + margin: 0 16rpx; + width: 272rpx; + } + .weui-bottom-fixed-opr-page + .weui-bottom-fixed-opr + .weui-btn:nth-last-child(n + 2) + + .weui-btn:first-child, + .weui-bottom-fixed-opr-page + .weui-bottom-fixed-opr + .weui-btn:nth-last-child(n + 2):first-child { + margin-left: 0; + } + .weui-bottom-fixed-opr-page + .weui-bottom-fixed-opr + .weui-btn:nth-last-child(n + 2) + + .weui-btn:last-child, + .weui-bottom-fixed-opr-page + .weui-bottom-fixed-opr + .weui-btn:nth-last-child(n + 2):last-child { + margin-right: 0; + } + .weui-bottom-fixed-opr-page_btn-wrap .weui-bottom-fixed-opr { + -webkit-box-orient: vertical; + -webkit-box-direction: normal; + -webkit-flex-direction: column; + flex-direction: column; + } + .weui-bottom-fixed-opr-page_btn-wrap + .weui-bottom-fixed-opr + .weui-btn:nth-last-child(n + 2), + .weui-bottom-fixed-opr-page_btn-wrap + .weui-bottom-fixed-opr + .weui-btn:nth-last-child(n + 2) + + .weui-btn { + width: 368rpx; + margin: 32rpx 0 0; + } + .weui-bottom-fixed-opr-page_btn-wrap + .weui-bottom-fixed-opr + .weui-btn:nth-last-child(n + 2) + + .weui-btn:first-child, + .weui-bottom-fixed-opr-page_btn-wrap + .weui-bottom-fixed-opr + .weui-btn:nth-last-child(n + 2):first-child { + margin-top: 0; + } + .weui-half-screen-dialog.weui-half-screen-dialog_bottom-fixed { + padding: 0; + } + .weui-half-screen-dialog.weui-half-screen-dialog_bottom-fixed + .weui-half-screen-dialog__hd { + padding: 0 48rpx; + padding: 0 calc(48rpx + constant(safe-area-inset-right)) 0 + calc(48rpx + constant(safe-area-inset-left)); + padding: 0 calc(48rpx + env(safe-area-inset-right)) 0 + calc(48rpx + env(safe-area-inset-left)); + } + .weui-half-screen-dialog.weui-half-screen-dialog_bottom-fixed + .weui-half-screen-dialog__bd { + padding-bottom: 0; + display: -webkit-box; + display: -webkit-flex; + display: flex; + -webkit-box-orient: vertical; + -webkit-box-direction: normal; + -webkit-flex-direction: column; + flex-direction: column; + } + .weui-half-screen-dialog.weui-half-screen-dialog_bottom-fixed + .weui-half-screen-dialog__ft { + padding: 0; + } + .weui-half-screen-dialog.weui-half-screen-dialog_bottom-fixed + .weui-bottom-fixed-opr-page { + -webkit-box-flex: 1; + -webkit-flex: 1; + flex: 1; + min-height: 0; + } + .weui-half-screen-dialog.weui-half-screen-dialog_bottom-fixed + .weui-bottom-fixed-opr-page__content { + padding: 0 48rpx; + padding: 0 calc(48rpx + constant(safe-area-inset-right)) 0 + calc(48rpx + constant(safe-area-inset-left)); + padding: 0 calc(48rpx + env(safe-area-inset-right)) 0 + calc(48rpx + env(safe-area-inset-left)); + } + .weui-half-screen-dialog.weui-half-screen-dialog_bottom-fixed + .weui-bottom-fixed-opr { + padding: 32rpx 0 128rpx; + padding: 32rpx 0 calc(128rpx + constant(safe-area-inset-bottom)); + padding: 32rpx 0 calc(128rpx + env(safe-area-inset-bottom)); + } + button.weui-btn, + input.weui-btn { + border-width: 0; + outline: 0; + -webkit-appearance: none; + } + button.weui-btn:focus, + input.weui-btn:focus { + outline: 0; + } + button.weui-btn_inline, + button.weui-btn_mini, + input.weui-btn_inline, + input.weui-btn_mini { + width: auto; + } + .weui-btn_mini { + line-height: 1.375; + padding: 10rpx 24rpx; + font-size: 32rpx; + border-radius: 12rpx; + } + .weui-btn_mini, + .weui-btn_xmini { + display: inline-block; + width: auto; + } + .weui-btn_xmini { + padding: 8rpx 24rpx; + line-height: 1.42857; + font-size: 28rpx; + font-weight: 500; + border-radius: 8rpx; + } + .weui-btn + .weui-btn { + margin-top: 32rpx; + } + .weui-btn.weui-btn_mini + .weui-btn.weui-btn_mini, + .weui-btn.weui-btn_xmini + .weui-btn.weui-btn_xmini { + margin-top: auto; + } + .weui-btn.weui-btn_inline + .weui-btn.weui-btn_inline { + margin-left: 32rpx; + } + .weui-btn-area { + margin: 96rpx 32rpx 16rpx; + } + .weui-btn-area_inline { + display: -webkit-box; + display: -webkit-flex; + display: flex; + } + .weui-btn-area_inline .weui-btn { + margin-top: auto; + margin-right: 32rpx; + width: 100%; + -webkit-box-flex: 1; + -webkit-flex: 1; + flex: 1; + } + .weui-btn-area_inline .weui-btn:last-child { + margin-right: 0; + } + .weui-btn_reset { + font-size: inherit; + } + .weui-btn_icon, + .weui-btn_reset { + background: transparent; + border: 0; + padding: 0; + outline: 0; + } + .weui-btn_icon { + font-size: 0; + } + .weui-btn_icon:active [class*='weui-icon-'] { + color: var(--weui-FG-1); + } + .weui-cells { + margin-top: 16rpx; + background-color: var(--weui-BG-2); + overflow: hidden; + position: relative; + } + .weui-cells:before { + top: 0; + border-top: 2rpx solid var(--weui-FG-3); + -webkit-transform-origin: 0 0; + transform-origin: 0 0; + -webkit-transform: scaleY(0.5); + transform: scaleY(0.5); + } + .weui-cells:after, + .weui-cells:before { + content: ' '; + position: absolute; + left: 0; + right: 0; + height: 2rpx; + color: var(--weui-FG-3); + z-index: 2; + } + .weui-cells:after { + bottom: 0; + border-bottom: 2rpx solid var(--weui-FG-3); + -webkit-transform-origin: 0 100%; + transform-origin: 0 100%; + -webkit-transform: scaleY(0.5); + transform: scaleY(0.5); + } + .weui-cells__title { + margin-top: 32rpx; + margin-bottom: 6rpx; + padding-left: 32rpx; + padding-right: 32rpx; + color: var(--weui-FG-1); + font-size: 28rpx; + line-height: 1.4; + } + .weui-cells__title + .weui-cells { + margin-top: 0; + } + .weui-cells__tips { + margin-top: 16rpx; + color: var(--weui-FG-1); + padding-left: 32rpx; + padding-right: 32rpx; + font-size: 28rpx; + line-height: 1.4; + } + .weui-cells__tips a, + .weui-cells__tips navigator { + color: var(--weui-LINK); + } + .weui-cells__tips navigator { + display: inline; + } + .weui-cell { + padding: 32rpx; + position: relative; + display: -webkit-box; + display: -webkit-flex; + display: flex; + -webkit-box-align: center; + -webkit-align-items: center; + align-items: center; + line-height: 1.41176471; + font-size: 34rpx; + color: var(--weui-FG-0); + } + .weui-cell:before { + content: ' '; + position: absolute; + left: 0; + top: 0; + right: 0; + height: 2rpx; + border-top: 2rpx solid var(--weui-FG-3); + color: var(--weui-FG-3); + -webkit-transform-origin: 0 0; + transform-origin: 0 0; + -webkit-transform: scaleY(0.5); + transform: scaleY(0.5); + left: 32rpx; + z-index: 2; + } + .weui-cell:first-child:before { + display: none; + } + .weui-cell_active:active:after { + content: ''; + position: absolute; + left: 0; + right: 0; + top: 0; + bottom: 0; + background: var(--weui-FG-3); + pointer-events: none; + } + .weui-cell_primary { + -webkit-box-align: start; + -webkit-align-items: flex-start; + align-items: flex-start; + } + .weui-cell__bd { + -webkit-box-flex: 1; + -webkit-flex: 1; + flex: 1; + min-width: 0; + } + .weui-cell__ft { + text-align: right; + color: var(--weui-FG-1); + } + .weui-cell__ft button { + vertical-align: bottom; + } + .weui-cell__desc { + font-size: 24rpx; + color: var(--weui-FG-2); + line-height: 1.4; + padding-top: 8rpx; + } + .weui-cell_swiped { + display: block; + padding: 0; + } + .weui-cell_swiped > .weui-cell__bd { + position: relative; + z-index: 1; + background-color: var(--weui-BG-2); + } + .weui-cell_swiped > .weui-cell__ft { + position: absolute; + right: 0; + top: 0; + bottom: 0; + color: #fff; + } + .weui-cell_swiped > .weui-cell__ft, + .weui-swiped-btn { + display: -webkit-box; + display: -webkit-flex; + display: flex; + } + .weui-swiped-btn { + -webkit-box-align: center; + -webkit-align-items: center; + align-items: center; + padding: 32rpx 1em; + line-height: 1.41176471; + color: inherit; + } + .weui-swiped-btn_default { + background-color: var(--weui-BG-0); + } + .weui-swiped-btn_warn { + background-color: var(--weui-RED); + } + .weui-cell_access { + -webkit-tap-highlight-color: rgba(0, 0, 0, 0); + color: inherit; + } + .weui-cell_access:active:after { + content: ''; + position: absolute; + left: 0; + right: 0; + top: 0; + bottom: 0; + background: var(--weui-FG-3); + pointer-events: none; + } + .weui-cell_access .weui-cell__ft { + padding-right: 48rpx; + position: relative; + } + .weui-cell_access .weui-cell__ft:after { + content: ' '; + width: 24rpx; + height: 48rpx; + -webkit-mask-position: 0 0; + mask-position: 0 0; + -webkit-mask-repeat: no-repeat; + mask-repeat: no-repeat; + -webkit-mask-size: 100%; + mask-size: 100%; + background-color: currentColor; + color: var(--weui-FG-2); + -webkit-mask-image: url(data:image/svg+xml,%3Csvg%20width%3D%2212%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M2.454%206.58l1.06-1.06%205.78%205.779a.996.996%200%20010%201.413l-5.78%205.779-1.06-1.061%205.425-5.425-5.425-5.424z%22%20fill%3D%22%23B2B2B2%22%20fill-rule%3D%22evenodd%22%2F%3E%3C%2Fsvg%3E); + mask-image: url(data:image/svg+xml,%3Csvg%20width%3D%2212%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M2.454%206.58l1.06-1.06%205.78%205.779a.996.996%200%20010%201.413l-5.78%205.779-1.06-1.061%205.425-5.425-5.425-5.424z%22%20fill%3D%22%23B2B2B2%22%20fill-rule%3D%22evenodd%22%2F%3E%3C%2Fsvg%3E); + position: absolute; + top: 50%; + right: 0; + margin-top: -24rpx; + } + .weui-cell_link { + color: var(--weui-LINK); + } + .weui-cell_link:first-child:before { + display: block; + } + .weui-check__label { + -webkit-tap-highlight-color: rgba(0, 0, 0, 0); + } + .weui-check__label.weui-cell_disabled, + .weui-check__label.weui-cell_readonly { + color: var(--weui-FG-3); + } + .weui-check { + opacity: 0; + position: absolute; + width: 0; + height: 0; + overflow: hidden; + } + .weui-check[disabled] + .weui-icon-checked { + opacity: 0.1; + } + .weui-cells_radio .weui-cell__ft { + padding-left: 32rpx; + font-size: 0; + } + .weui-cells_radio .weui-check + .weui-icon-checked { + min-width: 32rpx; + color: transparent; + } + .weui-cells_radio .weui-check:checked + .weui-icon-checked, + .weui-cells_radio .weui-check[aria-checked='true'] + .weui-icon-checked { + color: var(--weui-BRAND); + -webkit-mask-image: url(data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M8.657%2018.435L3%2012.778l1.414-1.414%204.95%204.95L20.678%205l1.414%201.414-12.02%2012.021a1%201%200%2001-1.415%200z%22%20fill-rule%3D%22evenodd%22%2F%3E%3C%2Fsvg%3E); + mask-image: url(data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M8.657%2018.435L3%2012.778l1.414-1.414%204.95%204.95L20.678%205l1.414%201.414-12.02%2012.021a1%201%200%2001-1.415%200z%22%20fill-rule%3D%22evenodd%22%2F%3E%3C%2Fsvg%3E); + } + .weui-cells_checkbox .weui-check__label:before { + left: 110rpx; + } + .weui-cells_checkbox .weui-cell__hd { + padding-right: 32rpx; + font-size: 0; + } + .weui-cells_checkbox .weui-icon-checked { + color: var(--weui-FG-2); + -webkit-mask-image: url(data:image/svg+xml,%3Csvg%20width%3D%221000%22%20height%3D%221000%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M500%20916.667C269.881%20916.667%2083.333%20730.119%2083.333%20500%2083.333%20269.881%20269.881%2083.333%20500%2083.333c230.119%200%20416.667%20186.548%20416.667%20416.667%200%20230.119-186.548%20416.667-416.667%20416.667zm0-50c202.504%200%20366.667-164.163%20366.667-366.667%200-202.504-164.163-366.667-366.667-366.667-202.504%200-366.667%20164.163-366.667%20366.667%200%20202.504%20164.163%20366.667%20366.667%20366.667z%22%20fill-rule%3D%22evenodd%22%20fill-opacity%3D%22.9%22%2F%3E%3C%2Fsvg%3E); + mask-image: url(data:image/svg+xml,%3Csvg%20width%3D%221000%22%20height%3D%221000%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M500%20916.667C269.881%20916.667%2083.333%20730.119%2083.333%20500%2083.333%20269.881%20269.881%2083.333%20500%2083.333c230.119%200%20416.667%20186.548%20416.667%20416.667%200%20230.119-186.548%20416.667-416.667%20416.667zm0-50c202.504%200%20366.667-164.163%20366.667-366.667%200-202.504-164.163-366.667-366.667-366.667-202.504%200-366.667%20164.163-366.667%20366.667%200%20202.504%20164.163%20366.667%20366.667%20366.667z%22%20fill-rule%3D%22evenodd%22%20fill-opacity%3D%22.9%22%2F%3E%3C%2Fsvg%3E); + } + .weui-cells_checkbox .weui-check:checked + .weui-icon-checked, + .weui-cells_checkbox .weui-check[aria-checked='true'] + .weui-icon-checked { + color: var(--weui-BRAND); + -webkit-mask-image: url(data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M12%2022C6.477%2022%202%2017.523%202%2012S6.477%202%2012%202s10%204.477%2010%2010-4.477%2010-10%2010zm-1.177-7.86l-2.765-2.767L7%2012.431l3.119%203.121a1%201%200%20001.414%200l5.952-5.95-1.062-1.062-5.6%205.6z%22%2F%3E%3C%2Fsvg%3E); + mask-image: url(data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M12%2022C6.477%2022%202%2017.523%202%2012S6.477%202%2012%202s10%204.477%2010%2010-4.477%2010-10%2010zm-1.177-7.86l-2.765-2.767L7%2012.431l3.119%203.121a1%201%200%20001.414%200l5.952-5.95-1.062-1.062-5.6%205.6z%22%2F%3E%3C%2Fsvg%3E); + } + .weui-label { + display: block; + width: 210rpx; + word-wrap: break-word; + word-break: break-all; + } + .weui-input { + width: 100%; + border: 0; + outline: 0; + -webkit-appearance: none; + background-color: transparent; + font-size: inherit; + color: inherit; + height: 1.41176471em; + line-height: 1.41176471; + } + .weui-input::-webkit-inner-spin-button, + .weui-input::-webkit-outer-spin-button { + -webkit-appearance: none; + margin: 0; + } + .weui-input:focus:not(:placeholder-shown) + .weui-btn_input-clear { + display: inline; + } + .weui-textarea { + display: block; + border: 0; + resize: none; + background: transparent; + width: 100%; + color: inherit; + font-size: 1em; + line-height: inherit; + height: 160rpx; + outline: 0; + } + .weui-textarea-counter { + color: var(--weui-FG-2); + text-align: right; + font-size: 28rpx; + } + .weui-cell_warn, + .weui-cell_warn .weui-textarea-counter { + color: var(--weui-RED); + } + .weui-cell_warn .weui-icon-warn { + display: inline-block; + } + .weui-cell_disabled .weui-input:disabled, + .weui-cell_disabled .weui-textarea:disabled, + .weui-cell_readonly .weui-input:disabled, + .weui-cell_readonly .weui-textarea:disabled { + opacity: 1; + -webkit-text-fill-color: var(--weui-FG-1); + } + .weui-cell_disabled .weui-input[disabled], + .weui-cell_disabled .weui-input[readonly], + .weui-cell_disabled .weui-textarea[disabled], + .weui-cell_disabled .weui-textarea[readonly], + .weui-cell_readonly .weui-input[disabled], + .weui-cell_readonly .weui-input[readonly], + .weui-cell_readonly .weui-textarea[disabled], + .weui-cell_readonly .weui-textarea[readonly] { + color: var(--weui-FG-1); + } + .weui-btn_input-clear { + display: none; + padding-left: 16rpx; + } + .weui-btn_input-clear [class*='weui-icon-'] { + width: 36rpx; + } + .weui-cells_form .weui-cell_disabled:active, + .weui-cells_form .weui-cell_readonly:active, + .weui-cells_form .weui-cell_switch:active, + .weui-cells_form .weui-cell_vcode:active { + background-color: transparent; + } + .weui-cells_form .weui-cell__ft { + font-size: 0; + } + .weui-cells_form .weui-icon-warn { + display: none; + } + .weui-cells_form input, + .weui-cells_form label[for], + .weui-cells_form textarea { + -webkit-tap-highlight-color: rgba(0, 0, 0, 0); + } + .weui-form-preview { + position: relative; + background-color: var(--weui-BG-2); + } + .weui-form-preview:before { + top: 0; + border-top: 2rpx solid var(--weui-FG-3); + -webkit-transform-origin: 0 0; + transform-origin: 0 0; + -webkit-transform: scaleY(0.5); + transform: scaleY(0.5); + } + .weui-form-preview:after, + .weui-form-preview:before { + content: ' '; + position: absolute; + left: 0; + right: 0; + height: 2rpx; + color: var(--weui-FG-3); + } + .weui-form-preview:after { + bottom: 0; + border-bottom: 2rpx solid var(--weui-FG-3); + -webkit-transform-origin: 0 100%; + transform-origin: 0 100%; + -webkit-transform: scaleY(0.5); + transform: scaleY(0.5); + } + .weui-form-preview__hd { + position: relative; + padding: 32rpx; + text-align: right; + line-height: 2.5em; + } + .weui-form-preview__hd:after { + content: ' '; + position: absolute; + left: 0; + bottom: 0; + right: 0; + height: 2rpx; + border-bottom: 2rpx solid var(--weui-FG-3); + color: var(--weui-FG-3); + -webkit-transform-origin: 0 100%; + transform-origin: 0 100%; + -webkit-transform: scaleY(0.5); + transform: scaleY(0.5); + left: 32rpx; + } + .weui-form-preview__hd .weui-form-preview__value { + font-style: normal; + font-size: 1.6em; + } + .weui-form-preview__bd { + padding: 32rpx; + font-size: 0.9em; + text-align: right; + color: var(--weui-FG-1); + line-height: 2; + } + .weui-form-preview__ft { + position: relative; + line-height: 100rpx; + display: -webkit-box; + display: -webkit-flex; + display: flex; + } + .weui-form-preview__ft:before { + content: ' '; + position: absolute; + left: 0; + top: 0; + right: 0; + height: 2rpx; + border-top: 2rpx solid var(--weui-DIALOG-LINE-COLOR); + color: var(--weui-DIALOG-LINE-COLOR); + -webkit-transform-origin: 0 0; + transform-origin: 0 0; + -webkit-transform: scaleY(0.5); + transform: scaleY(0.5); + } + .weui-form-preview__item { + overflow: hidden; + } + .weui-form-preview__label { + float: left; + margin-right: 1em; + width: 4.2em; + color: var(--weui-FG-1); + text-align: left; + } + .weui-form-preview__value { + display: block; + overflow: hidden; + word-break: normal; + word-wrap: break-word; + color: var(--weui-FG-0); + } + .weui-form-preview__btn { + position: relative; + display: block; + -webkit-box-flex: 1; + -webkit-flex: 1; + flex: 1; + color: var(--weui-LINK); + text-align: center; + -webkit-tap-highlight-color: rgba(0, 0, 0, 0); + } + button.weui-form-preview__btn { + background-color: transparent; + border: 0; + outline: 0; + line-height: inherit; + font-size: inherit; + } + .weui-form-preview__btn:active { + background-color: var(--weui-BG-COLOR-ACTIVE); + } + .weui-form-preview__btn:after { + content: ' '; + position: absolute; + left: 0; + top: 0; + width: 2rpx; + bottom: 0; + border-left: 2rpx solid var(--weui-DIALOG-LINE-COLOR); + color: var(--weui-DIALOG-LINE-COLOR); + -webkit-transform-origin: 0 0; + transform-origin: 0 0; + -webkit-transform: scaleX(0.5); + transform: scaleX(0.5); + } + .weui-form-preview__btn:first-child:after { + display: none; + } + .weui-form-preview__btn_default { + color: var(--weui-FG-HALF); + } + .weui-form-preview__btn_primary { + color: var(--weui-LINK); + } + .weui-form-preview__list { + padding-top: 48rpx; + padding-bottom: 48rpx; + line-height: 1.4; + font-size: 28rpx; + position: relative; + } + .weui-form-preview__list:before { + content: ''; + content: ' '; + position: absolute; + left: 0; + top: 0; + right: 0; + height: 2rpx; + border-top: 2rpx solid var(--weui-FG-3); + color: var(--weui-FG-3); + -webkit-transform-origin: 0 0; + transform-origin: 0 0; + -webkit-transform: scaleY(0.5); + transform: scaleY(0.5); + } + .weui-form-preview__list:last-child { + padding-bottom: 0; + } + .weui-form-preview__list .weui-form-preview__label { + text-align: left; + width: 6em; + } + .weui-form-preview__list .weui-form-preview__value { + -webkit-hyphens: auto; + hyphens: auto; + } + .weui-form-preview__list .weui-form-preview__item { + margin-top: 24rpx; + } + .weui-form-preview__list .weui-form-preview__item:first-child, + .weui-form-preview__list > .weui-cells__title:first-child { + margin-top: 0; + } + .weui-cell_select { + padding: 0; + } + .weui-cell_select .weui-cell__bd:after { + content: ' '; + width: 24rpx; + height: 48rpx; + -webkit-mask-position: 0 0; + mask-position: 0 0; + -webkit-mask-repeat: no-repeat; + mask-repeat: no-repeat; + -webkit-mask-size: 100%; + mask-size: 100%; + background-color: currentColor; + color: var(--weui-FG-2); + -webkit-mask-image: url(data:image/svg+xml,%3Csvg%20width%3D%2212%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M2.454%206.58l1.06-1.06%205.78%205.779a.996.996%200%20010%201.413l-5.78%205.779-1.06-1.061%205.425-5.425-5.425-5.424z%22%20fill%3D%22%23B2B2B2%22%20fill-rule%3D%22evenodd%22%2F%3E%3C%2Fsvg%3E); + mask-image: url(data:image/svg+xml,%3Csvg%20width%3D%2212%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M2.454%206.58l1.06-1.06%205.78%205.779a.996.996%200%20010%201.413l-5.78%205.779-1.06-1.061%205.425-5.425-5.425-5.424z%22%20fill%3D%22%23B2B2B2%22%20fill-rule%3D%22evenodd%22%2F%3E%3C%2Fsvg%3E); + position: absolute; + top: 50%; + right: 32rpx; + margin-top: -24rpx; + } + .weui-select { + -webkit-appearance: none; + border: 0; + outline: 0; + background-color: transparent; + width: 100%; + font-size: inherit; + min-height: 112rpx; + line-height: 112rpx; + position: relative; + z-index: 1; + padding-left: 32rpx; + padding-right: 80rpx; + color: var(--weui-FG-0); + vertical-align: bottom; + box-sizing: border-box; + } + .weui-cell_select-before .weui-cell__hd { + padding-left: 0; + position: relative; + } + .weui-cell_select-before .weui-cell__hd:after { + content: ' '; + position: absolute; + right: 0; + top: 0; + width: 2rpx; + bottom: 0; + border-right: 2rpx solid var(--weui-FG-3); + color: var(--weui-FG-3); + -webkit-transform-origin: 100% 0; + transform-origin: 100% 0; + -webkit-transform: scaleX(0.5); + transform: scaleX(0.5); + } + .weui-cell_select-before .weui-cell__hd:before { + content: ' '; + width: 24rpx; + height: 48rpx; + -webkit-mask-position: 0 0; + mask-position: 0 0; + -webkit-mask-repeat: no-repeat; + mask-repeat: no-repeat; + -webkit-mask-size: 100%; + mask-size: 100%; + background-color: currentColor; + color: var(--weui-FG-2); + -webkit-mask-image: url(data:image/svg+xml,%3Csvg%20width%3D%2212%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M2.454%206.58l1.06-1.06%205.78%205.779a.996.996%200%20010%201.413l-5.78%205.779-1.06-1.061%205.425-5.425-5.425-5.424z%22%20fill%3D%22%23B2B2B2%22%20fill-rule%3D%22evenodd%22%2F%3E%3C%2Fsvg%3E); + mask-image: url(data:image/svg+xml,%3Csvg%20width%3D%2212%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M2.454%206.58l1.06-1.06%205.78%205.779a.996.996%200%20010%201.413l-5.78%205.779-1.06-1.061%205.425-5.425-5.425-5.424z%22%20fill%3D%22%23B2B2B2%22%20fill-rule%3D%22evenodd%22%2F%3E%3C%2Fsvg%3E); + position: absolute; + top: 50%; + right: 32rpx; + margin-top: -24rpx; + } + .weui-cell_select-before .weui-cell__bd { + padding-left: 32rpx; + } + .weui-cell_select-before .weui-cell__bd:after { + display: none; + } + .weui-cell_select-before .weui-select { + max-width: 5em; + width: 210rpx; + box-sizing: content-box; + } + .weui-cell_select-after .weui-cell__hd { + padding-left: 32rpx; + } + .weui-cell_select-after .weui-select { + padding-left: 0; + } + .weui-cell_vcode { + padding-top: 0; + padding-right: 0; + padding-bottom: 0; + } + .weui-vcode-btn, + .weui-vcode-img { + margin-left: 10rpx; + height: 112rpx; + vertical-align: middle; + } + .weui-vcode-btn { + display: inline-block; + padding: 0 0.6em 0 0.7em; + line-height: 112rpx; + font-size: 34rpx; + color: var(--weui-LINK); + position: relative; + } + .weui-vcode-btn:before { + content: ' '; + position: absolute; + left: 0; + top: 0; + width: 2rpx; + bottom: 0; + border-left: 2rpx solid var(--weui-FG-3); + color: var(--weui-FG-3); + -webkit-transform-origin: 0 0; + transform-origin: 0 0; + -webkit-transform: scaleX(0.5); + transform: scaleX(0.5); + } + button.weui-vcode-btn { + background-color: transparent; + border: 0; + outline: 0; + } + .weui-vcode-btn:active { + color: var(--weui-LINK-ACTIVE); + } + .weui-gallery { + display: none; + position: fixed; + top: 0; + right: 0; + bottom: 0; + left: 0; + background-color: #000; + z-index: 1000; + } + .weui-gallery__img, + .weui-gallery__opr { + position: absolute; + left: 0; + left: constant(safe-area-inset-left); + left: env(safe-area-inset-left); + right: 0; + right: constant(safe-area-inset-right); + right: env(safe-area-inset-right); + } + .weui-gallery__img { + top: 0; + top: constant(safe-area-inset-top); + top: env(safe-area-inset-top); + bottom: 120rpx; + bottom: calc(120rpx + constant(safe-area-inset-bottom)); + bottom: calc(120rpx + env(safe-area-inset-bottom)); + background: 50% no-repeat; + background-size: contain; + } + .weui-gallery__opr { + position: absolute; + bottom: 0; + background-color: #0d0d0d; + color: var(--weui-WHITE); + line-height: 120rpx; + text-align: center; + } + .weui-gallery__del { + display: block; + padding-bottom: 0; + padding-bottom: constant(safe-area-inset-bottom); + padding-bottom: env(safe-area-inset-bottom); + } + .weui-gallery__del:active { + opacity: 0.5; + } + .weui-cell_switch { + padding-top: 24rpx; + padding-bottom: 24rpx; + } + .weui-cell_switch.weui-cell_disabled, + .weui-cell_switch.weui-cell_readonly { + color: var(--weui-FG-3); + } + .weui-switch { + -webkit-appearance: none; + appearance: none; + } + .weui-switch, + .weui-switch-cp__box { + vertical-align: bottom; + position: relative; + width: 104rpx; + height: 64rpx; + background-color: var(--weui-FG-3); + border: 0; + padding: 4rpx; + outline: 0; + border-radius: 32rpx; + box-sizing: border-box; + -webkit-transition: background-color 0.1s, border 0.1s; + transition: background-color 0.1s, border 0.1s; + } + .weui-switch-cp__box:after, + .weui-switch:after { + content: ' '; + position: absolute; + top: 4rpx; + left: 4rpx; + width: 56rpx; + height: 56rpx; + border-radius: 30rpx; + background-color: #fff; + box-shadow: 0 4rpx 6rpx 0 rgba(0, 0, 0, 0.06); + -webkit-transition: -webkit-transform 0.35s cubic-bezier(0.4, 0.4, 0.25, 1.35); + transition: -webkit-transform 0.35s cubic-bezier(0.4, 0.4, 0.25, 1.35); + transition: transform 0.35s cubic-bezier(0.4, 0.4, 0.25, 1.35); + transition: transform 0.35s cubic-bezier(0.4, 0.4, 0.25, 1.35), + -webkit-transform 0.35s cubic-bezier(0.4, 0.4, 0.25, 1.35); + } + .weui-switch-cp__input:checked + .weui-switch-cp__box, + .weui-switch-cp__input[aria-checked='true'] + .weui-switch-cp__box, + .weui-switch:checked { + background-color: var(--weui-BRAND); + } + .weui-switch-cp__input:checked + .weui-switch-cp__box:after, + .weui-switch-cp__input[aria-checked='true'] + .weui-switch-cp__box:after, + .weui-switch:checked:after { + -webkit-transform: translateX(40rpx); + transform: translateX(40rpx); + } + .weui-switch-cp__input[aria-disabled='true'] + .weui-switch-cp__box, + .weui-switch-cp__input[disabled] + .weui-switch-cp__box, + .weui-switch[disabled] { + opacity: 0.1; + } + .weui-switch-cp__input { + position: absolute; + width: 0; + height: 0; + opacity: 0; + overflow: hidden; + } + .weui-switch-cp__box { + display: block; + } + .weui-cell_uploader { + padding-bottom: 48rpx; + } + .weui-uploader { + -webkit-box-flex: 1; + -webkit-flex: 1; + flex: 1; + } + .weui-uploader__hd { + display: -webkit-box; + display: -webkit-flex; + display: flex; + padding-bottom: 32rpx; + -webkit-box-align: center; + -webkit-align-items: center; + align-items: center; + } + .weui-uploader__title { + -webkit-box-flex: 1; + -webkit-flex: 1; + flex: 1; + } + .weui-uploader__info { + color: var(--weui-FG-2); + } + .weui-uploader__bd { + margin-bottom: -16rpx; + margin-right: -16rpx; + overflow: hidden; + } + .weui-uploader__files { + list-style: none; + } + .weui-uploader__file { + float: left; + margin-right: 16rpx; + margin-bottom: 16rpx; + width: 192rpx; + height: 192rpx; + background: no-repeat 50%; + background-size: cover; + } + .weui-uploader__file_status { + position: relative; + } + .weui-uploader__file_status:before { + content: ' '; + position: absolute; + top: 0; + right: 0; + bottom: 0; + left: 0; + background-color: rgba(0, 0, 0, 0.5); + } + .weui-uploader__file_status .weui-uploader__file-content { + display: block; + } + .weui-uploader__file-content { + display: none; + position: absolute; + top: 50%; + left: 50%; + -webkit-transform: translate(-50%, -50%); + transform: translate(-50%, -50%); + color: var(--weui-WHITE); + } + .weui-uploader__file-content .weui-icon-warn { + display: inline-block; + } + .weui-uploader__input-box { + float: left; + position: relative; + margin-right: 16rpx; + margin-bottom: 16rpx; + width: 192rpx; + height: 192rpx; + box-sizing: border-box; + background-color: #ededed; + } + [data-weui-theme='dark'] .weui-uploader__input-box { + background-color: #2e2e2e; + } + .weui-uploader__input-box:after, + .weui-uploader__input-box:before { + content: ' '; + position: absolute; + top: 50%; + left: 50%; + -webkit-transform: translate(-50%, -50%); + transform: translate(-50%, -50%); + background-color: #a3a3a3; + } + [data-weui-theme='dark'] .weui-uploader__input-box:after, + [data-weui-theme='dark'] .weui-uploader__input-box:before { + background-color: #6d6d6d; + } + .weui-uploader__input-box:before { + width: 4rpx; + height: 33.33%; + } + .weui-uploader__input-box:after { + width: 33.33%; + height: 4rpx; + } + .weui-uploader__input-box:active:after, + .weui-uploader__input-box:active:before { + opacity: 0.7; + } + .weui-uploader__input { + position: absolute; + z-index: 1; + top: 0; + left: 0; + width: 100%; + height: 100%; + opacity: 0; + -webkit-tap-highlight-color: rgba(0, 0, 0, 0); + } + .weui-msg__desc-primary a, + .weui-msg__desc a, + .weui-msg__tips a, + .weui-msg__desc-primary .a, + .weui-msg__desc .a, + .weui-msg__tips .a { + color: var(--weui-LINK); + display: inline-block; + vertical-align: baseline; + } + .weui-msg { + padding-top: 96rpx; + padding: calc(96rpx + constant(safe-area-inset-top)) + constant(safe-area-inset-right) constant(safe-area-inset-bottom) + constant(safe-area-inset-left); + padding: calc(96rpx + env(safe-area-inset-top)) env(safe-area-inset-right) + env(safe-area-inset-bottom) env(safe-area-inset-left); + text-align: center; + line-height: 1.4; + min-height: 100%; + box-sizing: border-box; + display: -webkit-box; + display: -webkit-flex; + display: flex; + -webkit-box-orient: vertical; + -webkit-box-direction: normal; + -webkit-flex-direction: column; + flex-direction: column; + background-color: var(--weui-BG-2); + } + .weui-msg__icon-area { + margin-bottom: 64rpx; + } + .weui-msg__text-area { + margin-bottom: 64rpx; + padding: 0 64rpx; + -webkit-box-flex: 1; + -webkit-flex: 1; + flex: 1; + line-height: 1.6; + word-wrap: break-word; + -webkit-hyphens: auto; + hyphens: auto; + } + .weui-msg__text-area:first-child { + padding-top: 192rpx; + } + .weui-msg__title { + font-weight: 500; + font-size: 44rpx; + } + .weui-msg__desc, + .weui-msg__title { + margin-bottom: 32rpx; + color: var(--weui-FG-0); + } + .weui-msg__desc { + font-size: 34rpx; + font-weight: 400; + } + .weui-msg__desc-primary { + font-size: 28rpx; + color: var(--weui-FG-1); + margin-bottom: 32rpx; + } + .weui-msg__custom-area { + text-align: left; + word-wrap: break-word; + -webkit-hyphens: auto; + hyphens: auto; + margin-bottom: 32rpx; + } + .weui-msg__title + .weui-msg__custom-area { + margin-top: 96rpx; + } + .weui-msg__desc + .weui-msg__custom-area, + .weui-msg__desc-primary + .weui-msg__custom-area { + margin-top: 80rpx; + } + .weui-msg__custom-area .weui-cells__group_form .weui-cells { + margin: 0; + } + .weui-msg__opr-area { + margin-bottom: 32rpx; + } + .weui-msg__opr-area .weui-btn-area { + margin: 0; + } + .weui-msg__opr-area .weui-btn + .weui-btn { + margin-bottom: 32rpx; + } + .weui-msg__opr-area:last-child { + margin-bottom: 192rpx; + } + .weui-msg__opr-area + .weui-msg__extra-area { + margin-top: 96rpx; + } + .weui-msg__tips-area { + margin-bottom: 32rpx; + padding: 0 80rpx; + word-wrap: break-word; + -webkit-hyphens: auto; + hyphens: auto; + } + .weui-msg__opr-area + .weui-msg__tips-area { + margin-bottom: 96rpx; + } + .weui-msg__tips-area:last-child { + margin-bottom: 128rpx; + } + .weui-msg__tips { + font-size: 28rpx; + color: var(--weui-FG-1); + } + .weui-msg__extra-area { + margin-bottom: 48rpx; + padding: 0 64rpx; + box-sizing: border-box; + font-size: 24rpx; + color: var(--weui-FG-1); + } + .weui-msg__extra-area a, + .weui-msg__extra-area navigator { + color: var(--weui-LINK); + } + .weui-msg__extra-area navigator { + display: inline; + } + .weui-msg_align-top .weui-msg__text-area:first-child { + padding-top: 0; + } + body, + page { + --weui-STEPS-DEFAULT-COLOR: var(--weui-FG-3); + --weui-STEPS-HIGHLIGHT-COLOR: var(--weui-BRAND); + --weui-STEPS-FONT-SIZE: 17; + --weui-STEPS-LINEHEIGHT: 1.4; + --weui-STEPS-DOT-SIZE: calc(8 / var(--weui-STEPS-FONT-SIZE) * 1em); + --weui-STEPS-ICON-SIZE: 40; + --weui-STEPS-VERTICAL-DOT-GAP: calc((1em - var(--weui-STEPS-DOT-SIZE)) / 2); + --weui-STEPS-HORIZONAL-DOT-GAP: 8rpx; + } + .weui-steps { + line-height: var(--weui-STEPS-LINEHEIGHT); + font-size: calc(2rpx * var(--weui-STEPS-FONT-SIZE)); + } + .weui-steps__item__desc, + .weui-steps__item__title { + display: block; + } + .weui-steps__item__title { + font-weight: 500; + } + .weui-steps__item__desc { + font-size: 28rpx; + color: var(--weui-FG-2); + margin-top: 8rpx; + } + .weui-steps_vertical { + position: relative; + } + .weui-steps_vertical .weui-steps__item { + position: relative; + padding-bottom: 64rpx; + } + .weui-steps_vertical .weui-steps__item:before { + content: ''; + content: ' '; + position: absolute; + left: 0; + top: 0; + width: 2rpx; + bottom: 0; + border-left: 2rpx solid var(--weui-STEPS-DEFAULT-COLOR); + color: var(--weui-STEPS-DEFAULT-COLOR); + -webkit-transform-origin: 0 0; + transform-origin: 0 0; + -webkit-transform: scaleX(0.5); + transform: scaleX(0.5); + top: calc( + (var(--weui-STEPS-LINEHEIGHT) - (var(--weui-STEPS-LINEHEIGHT) - 1) / 2) * + 1em + ); + bottom: calc((var(--weui-STEPS-LINEHEIGHT) - 1) / 2 * -1em); + } + .weui-steps_vertical + .weui-steps__item:first-child:not(.weui-steps__item_success) + .weui-steps__item__inner:before { + background-color: var(--weui-STEPS-HIGHLIGHT-COLOR); + } + .weui-steps_vertical .weui-steps__item:last-child:before { + display: none; + } + .weui-steps_vertical .weui-steps__item__inner { + position: relative; + z-index: 1; + padding-left: 72rpx; + } + .weui-steps_vertical .weui-steps__item__inner:before { + content: ''; + width: var(--weui-STEPS-DOT-SIZE); + height: var(--weui-STEPS-DOT-SIZE); + border-radius: 100%; + background-color: var(--weui-STEPS-DEFAULT-COLOR); + } + .weui-steps_vertical .weui-steps__icon, + .weui-steps_vertical .weui-steps__item__inner:before { + position: absolute; + z-index: 1; + left: 0; + top: calc(var(--weui-STEPS-LINEHEIGHT) / 2 * 1em); + -webkit-transform: translate(-50%, -50%); + transform: translate(-50%, -50%); + } + .weui-steps_vertical .weui-steps__icon { + font-size: calc(2rpx * var(--weui-STEPS-FONT-SIZE)); + width: calc(var(--weui-STEPS-ICON-SIZE) / var(--weui-STEPS-FONT-SIZE) * 1em); + height: calc(var(--weui-STEPS-ICON-SIZE) / var(--weui-STEPS-FONT-SIZE) * 1em); + margin-top: calc( + (var(--weui-STEPS-ICON-SIZE) / var(--weui-STEPS-FONT-SIZE) * 1em - 1em) / 2 - + 0.28em + ); + } + .weui-steps_vertical .weui-steps__item_icon:before { + top: calc( + var(--weui-STEPS-VERTICAL-DOT-GAP) + var(--weui-STEPS-ICON-SIZE) / + var(--weui-STEPS-FONT-SIZE) * 1em - 0.14em + ); + } + .weui-steps_vertical .weui-steps__item_icon .weui-steps__item__inner:before { + display: none; + } + .weui-steps_vertical .weui-steps__item_icon-prev:before { + bottom: calc( + var(--weui-STEPS-VERTICAL-DOT-GAP) - (var(--weui-STEPS-LINEHEIGHT) - 1) / 2 * + 1em + 0.14em + ); + } + .weui-steps_vertical .weui-steps__item_success:before { + border-color: var(--weui-STEPS-HIGHLIGHT-COLOR); + } + .weui-steps_vertical + .weui-steps__item_success + + .weui-steps__item + .weui-steps__item__inner:before, + .weui-steps_vertical .weui-steps__item_success .weui-steps__item__inner:before { + background-color: var(--weui-STEPS-HIGHLIGHT-COLOR); + } + .weui-steps_horizonal, + .weui-steps_horizonal .weui-steps__item { + display: -webkit-box; + display: -webkit-flex; + display: flex; + } + .weui-steps_horizonal .weui-steps__item { + -webkit-box-flex: 1; + -webkit-flex: 1; + flex: 1; + -webkit-box-align: center; + -webkit-align-items: center; + align-items: center; + } + .weui-steps_horizonal .weui-steps__item:before { + content: ''; + display: block; + width: var(--weui-STEPS-DOT-SIZE); + height: var(--weui-STEPS-DOT-SIZE); + border-radius: 100%; + background-color: var(--weui-STEPS-DEFAULT-COLOR); + -webkit-flex-shrink: 0; + flex-shrink: 0; + } + .weui-steps_horizonal .weui-steps__item:after { + content: ''; + height: 1rpx; + -webkit-box-flex: 1; + -webkit-flex: 1; + flex: 1; + margin: 0 var(--weui-STEPS-HORIZONAL-DOT-GAP); + background: var(--weui-STEPS-DEFAULT-COLOR); + } + .weui-steps_horizonal .weui-steps__item:last-child { + -webkit-box-flex: 0; + -webkit-flex: none; + flex: none; + } + .weui-steps_horizonal .weui-steps__item:last-child:after { + display: none; + } + .weui-steps_horizonal + .weui-steps__item:first-child:not(.weui-steps__item_success):before { + background: var(--weui-STEPS-HIGHLIGHT-COLOR); + } + .weui-steps_horizonal .weui-steps__item__inner { + margin-left: 16rpx; + } + .weui-steps_horizonal .weui-steps__item_success + .weui-steps__item:before, + .weui-steps_horizonal .weui-steps__item_success:after, + .weui-steps_horizonal .weui-steps__item_success:before { + background: var(--weui-STEPS-HIGHLIGHT-COLOR); + } + .weui-steps_horizonal-primary { + display: -webkit-box; + display: -webkit-flex; + display: flex; + } + .weui-steps_horizonal-primary .weui-steps__item { + -webkit-box-flex: 1; + -webkit-flex: 1; + flex: 1; + position: relative; + } + .weui-steps_horizonal-primary .weui-steps__item:before { + content: ' '; + position: absolute; + left: 0; + top: 0; + right: 0; + height: 2rpx; + border-top: 2rpx solid var(--weui-STEPS-DEFAULT-COLOR); + color: var(--weui-STEPS-DEFAULT-COLOR); + -webkit-transform-origin: 0 0; + transform-origin: 0 0; + -webkit-transform: scaleY(0.5); + transform: scaleY(0.5); + } + .weui-steps_horizonal-primary .weui-steps__item:last-child { + -webkit-box-flex: 0; + -webkit-flex: none; + flex: none; + } + .weui-steps_horizonal-primary .weui-steps__item:last-child:before { + display: none; + } + .weui-steps_horizonal-primary .weui-steps__item__inner { + position: relative; + padding-top: 72rpx; + } + .weui-steps_horizonal-primary .weui-steps__item__inner:before { + content: ''; + position: absolute; + z-index: 1; + width: var(--weui-STEPS-DOT-SIZE); + height: var(--weui-STEPS-DOT-SIZE); + border-radius: 100%; + background-color: var(--weui-STEPS-DEFAULT-COLOR); + top: 0; + left: 0; + -webkit-transform: translateY(-50%); + transform: translateY(-50%); + } + .weui-steps_horizonal-primary .weui-steps__item__inner:after { + content: ''; + background-color: var(--weui-BG-2); + width: calc( + var(--weui-STEPS-DOT-SIZE) + 2 * var(--weui-STEPS-HORIZONAL-DOT-GAP) + ); + height: calc( + var(--weui-STEPS-DOT-SIZE) + 2 * var(--weui-STEPS-HORIZONAL-DOT-GAP) + ); + position: absolute; + top: 0; + left: 0; + -webkit-transform: translate( + calc(-50% + var(--weui-STEPS-DOT-SIZE) / 2), + -50% + ); + transform: translate(calc(-50% + var(--weui-STEPS-DOT-SIZE) / 2), -50%); + } + .weui-steps_horizonal-primary .weui-steps__item_success:before { + border-color: var(--weui-STEPS-HIGHLIGHT-COLOR); + } + .weui-steps_horizonal-primary + .weui-steps__item_success + + .weui-steps__item + .weui-steps__item__inner:before, + .weui-steps_horizonal-primary + .weui-steps__item_success + .weui-steps__item__inner:before { + background: var(--weui-STEPS-HIGHLIGHT-COLOR); + } + .weui-steps_horizonal-center { + display: -webkit-box; + display: -webkit-flex; + display: flex; + text-align: center; + } + .weui-steps_horizonal-center .weui-steps__item { + -webkit-box-flex: 1; + -webkit-flex: 1; + flex: 1; + position: relative; + } + .weui-steps_horizonal-center .weui-steps__item:after, + .weui-steps_horizonal-center .weui-steps__item:before { + content: ' '; + position: absolute; + left: 0; + top: 0; + right: 0; + height: 2rpx; + border-top: 2rpx solid var(--weui-STEPS-DEFAULT-COLOR); + color: var(--weui-STEPS-DEFAULT-COLOR); + -webkit-transform-origin: 0 0; + transform-origin: 0 0; + -webkit-transform: scaleY(0.5); + transform: scaleY(0.5); + } + .weui-steps_horizonal-center .weui-steps__item:before { + right: 50%; + } + .weui-steps_horizonal-center .weui-steps__item:after { + left: 50%; + } + .weui-steps_horizonal-center .weui-steps__item:first-child:before, + .weui-steps_horizonal-center .weui-steps__item:last-child:after { + display: none; + } + .weui-steps_horizonal-center .weui-steps__item__inner { + position: relative; + z-index: 1; + padding-top: 72rpx; + } + .weui-steps_horizonal-center .weui-steps__item__inner:before { + content: ''; + position: absolute; + z-index: 1; + width: var(--weui-STEPS-DOT-SIZE); + height: var(--weui-STEPS-DOT-SIZE); + border-radius: 100%; + background-color: var(--weui-STEPS-DEFAULT-COLOR); + top: 0; + left: 50%; + -webkit-transform: translate(-50%, -50%); + transform: translate(-50%, -50%); + } + .weui-steps_horizonal-center .weui-steps__item__inner:after { + content: ''; + background-color: var(--weui-BG-2); + width: calc( + var(--weui-STEPS-DOT-SIZE) + 2 * var(--weui-STEPS-HORIZONAL-DOT-GAP) + ); + height: calc( + var(--weui-STEPS-DOT-SIZE) + 2 * var(--weui-STEPS-HORIZONAL-DOT-GAP) + ); + position: absolute; + top: 0; + left: 50%; + -webkit-transform: translate(-50%, -50%); + transform: translate(-50%, -50%); + } + .weui-steps_horizonal-center + .weui-steps__item_success + + .weui-steps__item + .weui-steps__item__inner:before, + .weui-steps_horizonal-center + .weui-steps__item_success + + .weui-steps__item:before, + .weui-steps_horizonal-center + .weui-steps__item_success + .weui-steps__item__inner:before, + .weui-steps_horizonal-center .weui-steps__item_success:after, + .weui-steps_horizonal-center .weui-steps__item_success:before { + background: var(--weui-STEPS-HIGHLIGHT-COLOR); + } + body, + page { + --weui-cellMarginLR: 32rpx; + --weui-cellPaddingLR: 32rpx; + } + .weui-cells__group { + border: 0; + } + .weui-cells__group:first-child { + margin-top: 0; + } + .weui-cells__group_form { + margin-top: 48rpx; + } + .weui-cells__group_form .weui-cells { + margin-left: var(--weui-cellMarginLR); + margin-right: var(--weui-cellMarginLR); + } + .weui-cells__group_form .weui-cells:after, + .weui-cells__group_form .weui-cells:before { + left: var(--weui-cellPaddingLR); + right: var(--weui-cellPaddingLR); + } + .weui-cells__group_form .weui-cell { + padding: 32rpx var(--weui-cellPaddingLR); + } + .weui-cells__group_form .weui-cell:before { + left: var(--weui-cellPaddingLR); + right: var(--weui-cellPaddingLR); + } + .weui-cells__group_form .weui-cell__hd { + padding-right: 32rpx; + } + .weui-cells__group_form .weui-cell__ft { + padding-left: 32rpx; + } + .weui-cells__group_form .weui-cells__title { + margin-top: 48rpx; + margin-bottom: 16rpx; + padding: 0 64rpx; + } + .weui-cells__group_form:first-child .weui-cells__title { + margin-top: 0; + } + .weui-cells__group_form .weui-cells__tips { + margin-top: 16rpx; + padding: 0 calc(var(--weui-cellMarginLR) + var(--weui-cellPaddingLR)); + color: var(--weui-FG-2); + } + .weui-cells__group_form .weui-cells__tips a, .weui-cells__group_form .weui-cells__tips .a { + font-weight: 700; + } + .weui-cells__group_form .weui-cells__tips_warn { + color: var(--weui-RED); + } + .weui-cells__group_form .weui-label { + max-width: 5em; + margin-right: 16rpx; + } + .weui-cells__group_form .weui-cell_access:active:after, + .weui-cells__group_form .weui-cell_active:active:after { + border-radius: 16rpx; + } + .weui-cells__group_form .weui-cell_warn input { + color: var(--weui-RED); + } + .weui-cells__group_form .weui-cell_disabled:active:after, + .weui-cells__group_form .weui-cell_readonly:active:after, + .weui-cells__group_form .weui-cell_switch:active:after, + .weui-cells__group_form .weui-cell_vcode:active:after, + .weui-cells__group_form .weui-icon-warn { + display: none; + } + .weui-cells__group_form input, + .weui-cells__group_form label[for], + .weui-cells__group_form textarea { + -webkit-tap-highlight-color: rgba(0, 0, 0, 0); + } + .weui-cells__group_form .weui-cell_wrap { + -webkit-box-align: initial; + -webkit-align-items: initial; + align-items: initial; + padding-top: 16rpx; + padding-bottom: 16rpx; + } + .weui-cells__group_form .weui-cell_wrap .weui-cell__hd { + padding-right: 0; + } + .weui-cells__group_form .weui-cell_wrap .weui-label { + margin-top: 16rpx; + } + .weui-cells__group_form .weui-cell_wrap .weui-cell__bd { + display: -webkit-box; + display: -webkit-flex; + display: flex; + -webkit-flex-wrap: wrap; + flex-wrap: wrap; + -webkit-box-align: center; + -webkit-align-items: center; + align-items: center; + } + .weui-cells__group_form .weui-cell__control { + margin: 16rpx 0 16rpx 32rpx; + } + .weui-cells__group_form .weui-cell__control_flex { + -webkit-box-flex: 1; + -webkit-flex: 1; + flex: 1; + min-width: 30vw; + } + .weui-cells__group_form .weui-vcode-btn { + font-size: 32rpx; + padding: 0 24rpx; + height: auto; + width: auto; + line-height: 2; + border-radius: 12rpx; + color: var(--weui-BTN-DEFAULT-COLOR); + background-color: var(--weui-BTN-DEFAULT-BG); + } + .weui-cells__group_form .weui-vcode-btn:before { + display: none; + } + .weui-cells__group_form .weui-cell_vcode.weui-cell_wrap { + padding-top: 8rpx; + padding-bottom: 8rpx; + } + .weui-cells__group_form .weui-cell_vcode.weui-cell_wrap .weui-label { + margin-top: 24rpx; + } + .weui-cells__group_form .weui-cell_vcode.weui-cell_wrap .weui-input { + font-size: 34rpx; + min-height: 1.88235294em; + } + .weui-cells__group_form .weui-cells_checkbox .weui-check__label:before { + left: calc(80rpx + var(--weui-cellPaddingLR)); + } + .weui-cells__group_form .weui-cell_select { + padding: 0; + } + .weui-cells__group_form .weui-cell_select-before .weui-cell__hd { + padding-right: 0; + } + .weui-cells__group_form .weui-cell_switch { + padding: 24rpx 32rpx; + } + .weui-cells__group_form-primary { + margin-top: 64rpx; + } + .weui-cells__group_form-primary .weui-cells { + background: var(--weui-BG-1); + border-radius: 16rpx; + overflow: hidden; + } + .weui-cells__group_form-primary .weui-cells:after, + .weui-cells__group_form-primary .weui-cells:before { + display: none; + } + .weui-cells__group_form-primary .weui-cell_access:active:after, + .weui-cells__group_form-primary .weui-cell_active:active:after { + border-radius: 0; + } + .weui-form { + padding: 112rpx 0 0; + padding: calc(112rpx + constant(safe-area-inset-top)) + constant(safe-area-inset-right) constant(safe-area-inset-bottom) + constant(safe-area-inset-left); + padding: calc(112rpx + env(safe-area-inset-top)) env(safe-area-inset-right) + env(safe-area-inset-bottom) env(safe-area-inset-left); + display: -webkit-box; + display: -webkit-flex; + display: flex; + -webkit-box-orient: vertical; + -webkit-box-direction: normal; + -webkit-flex-direction: column; + flex-direction: column; + line-height: 1.4; + min-height: 100%; + box-sizing: border-box; + background-color: var(--weui-BG-2); + } + .weui-form .weui-footer, + .weui-form .weui-footer__link { + font-size: 28rpx; + } + .weui-form .weui-agree { + padding: 0; + display: -webkit-box; + display: -webkit-flex; + display: flex; + text-align: justify; + -webkit-box-pack: center; + -webkit-justify-content: center; + justify-content: center; + line-height: 1.6; + -webkit-box-align: center; + -webkit-align-items: center; + align-items: center; + word-wrap: break-word; + -webkit-hyphens: auto; + hyphens: auto; + } + .weui-form .weui-agree__checkbox { + -webkit-flex-shrink: 0; + flex-shrink: 0; + margin-top: 0; + } + .weui-form .weui-agree__text { + min-width: 0; + } + .weui-form__text-area { + padding: 0 64rpx; + color: var(--weui-FG-0); + text-align: center; + } + .weui-form__control-area { + -webkit-box-flex: 1; + -webkit-flex: 1; + flex: 1; + margin: 96rpx 0; + } + .weui-form__extra-area, + .weui-form__tips-area { + margin-bottom: 48rpx; + padding: 0 64rpx; + text-align: center; + } + .weui-form__extra-area { + margin-top: 104rpx; + } + .weui-form__opr-area { + padding: 0 64rpx; + } + .weui-form__opr-area:last-child { + margin-bottom: 192rpx; + } + .weui-form__opr-area + .weui-form__tips-area { + margin-top: 32rpx; + margin-bottom: 0; + } + .weui-form__tips-area + .weui-form__extra-area { + margin-top: 64rpx; + } + .weui-form__tips-area:last-child { + margin-bottom: 120rpx; + } + .weui-form__title { + font-size: 44rpx; + font-weight: 700; + line-height: 1.36; + } + .weui-form__desc { + font-size: 34rpx; + margin-top: 32rpx; + } + .weui-form__tips { + color: var(--weui-FG-1); + font-size: 28rpx; + } + .weui-form__tips a, + .weui-form__tips navigator { + color: var(--weui-LINK); + } + .weui-form__tips navigator { + display: inline; + } + .weui-article { + padding: 96rpx 48rpx; + padding: 96rpx calc(48rpx + constant(safe-area-inset-right)) + calc(96rpx + constant(safe-area-inset-bottom)) + calc(48rpx + constant(safe-area-inset-left)); + padding: 96rpx calc(48rpx + env(safe-area-inset-right)) + calc(96rpx + env(safe-area-inset-bottom)) + calc(48rpx + env(safe-area-inset-left)); + color: var(--weui-FG-0); + font-size: 34rpx; + line-height: 1.4; + word-wrap: break-word; + -webkit-hyphens: auto; + hyphens: auto; + } + .weui-article image { + margin: 0; + vertical-align: bottom; + } + .weui-article__section { + margin-bottom: 96rpx; + } + .weui-article__section .weui-article__section { + margin-bottom: 64rpx; + } + .weui-article__section .weui-article__section .weui-article__section { + margin-bottom: 48rpx; + } + .weui-article__h1 { + font-size: 44rpx; + font-weight: 500; + margin-bottom: 96rpx; + text-align: center; + } + .weui-article__h2 { + font-size: 40rpx; + font-weight: 500; + margin-bottom: 32rpx; + } + .weui-article__h3 { + font-size: 34rpx; + font-weight: 500; + margin-bottom: 16rpx; + } + .weui-article__h4 { + margin-bottom: 8rpx; + } + .weui-article__h4, + .weui-article__h5, + .weui-article__h6 { + font-size: 34rpx; + font-weight: 400; + } + .weui-article__p { + margin: 0 0 48rpx; + line-height: 1.6; + } + .weui-article__ol, + .weui-article__ul { + margin-left: 1.2em; + margin-bottom: 48rpx; + } + .weui-article__ol .weui-article__ol, + .weui-article__ol .weui-article__ul, + .weui-article__ul .weui-article__ol, + .weui-article__ul .weui-article__ul { + margin: 0.5em 0 0.5em 1.2em; + } + .weui-article__ol { + list-style: decimal; + } + .weui-article__ul { + list-style: disc; + } + .weui-article__li { + display: list-item; + margin: 0.5em 0; + } + .weui-article__list_inside .weui-article__li { + list-style-position: inside; + } + .weui-article__list_none .weui-article__li { + list-style: none; + } + .weui-tabbar { + display: -webkit-box; + display: -webkit-flex; + display: flex; + position: relative; + z-index: 500; + background-color: var(--weui-BG-1); + } + .weui-tabbar:before { + content: ' '; + position: absolute; + left: 0; + top: 0; + right: 0; + height: 2rpx; + border-top: 2rpx solid var(--weui-FG-3); + color: var(--weui-FG-3); + -webkit-transform-origin: 0 0; + transform-origin: 0 0; + -webkit-transform: scaleY(0.5); + transform: scaleY(0.5); + } + .weui-tabbar__item { + display: block; + -webkit-box-flex: 1; + -webkit-flex: 1; + flex: 1; + padding: 16rpx 0; + padding-bottom: calc(16rpx + constant(safe-area-inset-bottom)); + padding-bottom: calc(16rpx + env(safe-area-inset-bottom)); + font-size: 0; + color: var(--weui-FG-1); + text-align: center; + -webkit-tap-highlight-color: rgba(0, 0, 0, 0); + } + .weui-tabbar__item:first-child { + padding-left: constant(safe-area-inset-left); + padding-left: env(safe-area-inset-left); + } + .weui-tabbar__item:last-child { + padding-right: constant(safe-area-inset-right); + padding-right: env(safe-area-inset-right); + } + .weui-tabbar__item.weui-bar__item_on .weui-tabbar__icon, + .weui-tabbar__item.weui-bar__item_on .weui-tabbar__icon > i, + .weui-tabbar__item.weui-bar__item_on .weui-tabbar__label { + color: var(--weui-BRAND); + } + .weui-tabbar__icon { + display: inline-block; + font-size: 20rpx; + width: 2.8em; + height: 2.8em; + margin-bottom: 4rpx; + } + .weui-tabbar__icon > i, + i.weui-tabbar__icon { + font-size: 48rpx; + color: var(--weui-FG-1); + } + .weui-tabbar__icon img, .weui-tabbar__icon .img { + width: 100%; + height: 100%; + } + .weui-tabbar__label { + color: var(--weui-FG-0); + font-size: 20rpx; + line-height: 1.4; + } + .weui-navbar { + display: -webkit-box; + display: -webkit-flex; + display: flex; + position: relative; + z-index: 500; + background-color: var(--weui-BG-2); + padding-top: constant(safe-area-inset-top); + padding-top: env(safe-area-inset-top); + } + .weui-navbar:after { + content: ' '; + position: absolute; + left: 0; + bottom: 0; + right: 0; + height: 2rpx; + border-bottom: 2rpx solid var(--weui-FG-3); + color: var(--weui-FG-3); + -webkit-transform-origin: 0 100%; + transform-origin: 0 100%; + -webkit-transform: scaleY(0.5); + transform: scaleY(0.5); + } + .weui-navbar + .weui-tab__panel { + padding-bottom: constant(safe-area-inset-bottom); + padding-bottom: env(safe-area-inset-bottom); + } + .weui-navbar__item { + position: relative; + display: block; + -webkit-box-flex: 1; + -webkit-flex: 1; + flex: 1; + padding: 32rpx 0; + padding-top: calc(32rpx + constant(safe-area-inset-top)); + padding-top: calc(32rpx + env(safe-area-inset-top)); + text-align: center; + font-size: 34rpx; + line-height: 1.41176471; + -webkit-tap-highlight-color: rgba(0, 0, 0, 0); + } + .weui-navbar__item.weui-bar__item_on, + .weui-navbar__item:active { + background-color: var(--weui-BG-COLOR-ACTIVE); + } + .weui-navbar__item:after { + content: ' '; + position: absolute; + right: 0; + top: 0; + width: 2rpx; + bottom: 0; + border-right: 2rpx solid var(--weui-FG-3); + color: var(--weui-FG-3); + -webkit-transform-origin: 100% 0; + transform-origin: 100% 0; + -webkit-transform: scaleX(0.5); + transform: scaleX(0.5); + } + .weui-navbar__item:first-child { + padding-left: constant(safe-area-inset-left); + padding-left: env(safe-area-inset-left); + } + .weui-navbar__item:last-child { + padding-right: constant(safe-area-inset-right); + padding-right: env(safe-area-inset-right); + } + .weui-navbar__item:last-child:after { + display: none; + } + .weui-tab { + display: -webkit-box; + display: -webkit-flex; + display: flex; + height: 100%; + box-sizing: border-box; + -webkit-box-orient: vertical; + -webkit-box-direction: normal; + -webkit-flex-direction: column; + flex-direction: column; + } + .weui-tab__panel { + box-sizing: border-box; + -webkit-box-flex: 1; + -webkit-flex: 1; + flex: 1; + overflow: auto; + -webkit-overflow-scrolling: touch; + } + .weui-tab__content { + display: none; + } + .weui-progress { + display: -webkit-box; + display: -webkit-flex; + display: flex; + -webkit-box-align: center; + -webkit-align-items: center; + align-items: center; + } + .weui-progress__bar { + background-color: var(--weui-BG-0); + height: 6rpx; + -webkit-box-flex: 1; + -webkit-flex: 1; + flex: 1; + } + .weui-progress__inner-bar { + width: 0; + height: 100%; + background-color: var(--weui-BRAND); + } + .weui-progress__opr { + display: block; + margin-left: 30rpx; + font-size: 0; + } + .weui-panel { + background-color: var(--weui-BG-2); + margin-top: 20rpx; + position: relative; + overflow: hidden; + } + .weui-panel:first-child { + margin-top: 0; + } + .weui-panel:before { + top: 0; + border-top: 2rpx solid var(--weui-FG-3); + -webkit-transform-origin: 0 0; + transform-origin: 0 0; + -webkit-transform: scaleY(0.5); + transform: scaleY(0.5); + } + .weui-panel:after, + .weui-panel:before { + content: ' '; + position: absolute; + left: 0; + right: 0; + height: 2rpx; + color: var(--weui-FG-3); + } + .weui-panel:after { + bottom: 0; + border-bottom: 2rpx solid var(--weui-FG-3); + -webkit-transform-origin: 0 100%; + transform-origin: 0 100%; + -webkit-transform: scaleY(0.5); + transform: scaleY(0.5); + } + .weui-panel .weui-cells:after { + display: none; + } + .weui-panel__hd { + padding: 32rpx 32rpx 26rpx; + color: var(--weui-FG-0); + font-size: 30rpx; + font-weight: 500; + position: relative; + } + .weui-panel__hd:after { + content: ' '; + position: absolute; + left: 0; + bottom: 0; + right: 0; + height: 2rpx; + border-bottom: 2rpx solid var(--weui-FG-3); + color: var(--weui-FG-3); + -webkit-transform-origin: 0 100%; + transform-origin: 0 100%; + -webkit-transform: scaleY(0.5); + transform: scaleY(0.5); + left: 30rpx; + } + .weui-media-box { + padding: 32rpx; + position: relative; + } + .weui-media-box:before { + content: ' '; + position: absolute; + left: 0; + top: 0; + right: 0; + height: 2rpx; + border-top: 2rpx solid var(--weui-FG-3); + color: var(--weui-FG-3); + -webkit-transform-origin: 0 0; + transform-origin: 0 0; + -webkit-transform: scaleY(0.5); + transform: scaleY(0.5); + left: 32rpx; + } + .weui-media-box:first-child:before { + display: none; + } + a.weui-media-box { + color: #000; + -webkit-tap-highlight-color: rgba(0, 0, 0, 0); + } + a.weui-media-box:active { + background-color: var(--weui-BG-COLOR-ACTIVE); + } + .weui-media-box__title { + display: block; + font-weight: 400; + font-size: 34rpx; + color: var(--weui-FG-0); + width: auto; + white-space: nowrap; + word-wrap: normal; + } + .weui-media-box__desc, + .weui-media-box__title { + line-height: 1.4; + overflow: hidden; + text-overflow: ellipsis; + word-wrap: break-word; + -webkit-hyphens: auto; + hyphens: auto; + } + .weui-media-box__desc { + color: var(--weui-FG-2); + font-size: 28rpx; + padding-top: 8rpx; + display: -webkit-box; + -webkit-box-orient: vertical; + -webkit-line-clamp: 2; + } + .weui-media-box__info { + display: block; + margin-top: 32rpx; + padding-bottom: 8rpx; + font-size: 26rpx; + color: var(--weui-FG-2); + line-height: 1em; + list-style: none; + overflow: hidden; + } + .weui-media-box__info__meta { + float: left; + padding-right: 1em; + } + .weui-media-box__info__meta_extra { + padding-left: 1em; + border-left: 2rpx solid var(--weui-FG-2); + } + .weui-media-box_appmsg { + display: -webkit-box; + display: -webkit-flex; + display: flex; + -webkit-box-align: center; + -webkit-align-items: center; + align-items: center; + } + .weui-media-box_appmsg .weui-media-box__hd { + margin-right: 32rpx; + width: 120rpx; + height: 120rpx; + line-height: 120rpx; + text-align: center; + } + .weui-media-box_appmsg .weui-media-box__thumb { + width: 100%; + max-height: 100%; + vertical-align: top; + } + .weui-media-box_appmsg .weui-media-box__bd { + -webkit-box-flex: 1; + -webkit-flex: 1; + flex: 1; + min-width: 0; + } + .weui-media-box_small-appmsg { + padding: 0; + } + .weui-media-box_small-appmsg .weui-cells { + margin-top: 0; + } + .weui-media-box_small-appmsg .weui-cells:before { + display: none; + } + .weui-grids { + position: relative; + overflow: hidden; + } + .weui-grids:before { + right: 0; + height: 2rpx; + border-top: 2rpx solid var(--weui-FG-3); + -webkit-transform-origin: 0 0; + transform-origin: 0 0; + -webkit-transform: scaleY(0.5); + transform: scaleY(0.5); + } + .weui-grids:after, + .weui-grids:before { + content: ' '; + position: absolute; + left: 0; + top: 0; + color: var(--weui-FG-3); + } + .weui-grids:after { + width: 2rpx; + bottom: 0; + border-left: 2rpx solid var(--weui-FG-3); + -webkit-transform-origin: 0 0; + transform-origin: 0 0; + -webkit-transform: scaleX(0.5); + transform: scaleX(0.5); + } + .weui-grid { + position: relative; + float: left; + padding: 40rpx 20rpx; + width: 33.33333333%; + box-sizing: border-box; + } + .weui-grid:before { + top: 0; + width: 2rpx; + border-right: 2rpx solid var(--weui-FG-3); + -webkit-transform-origin: 100% 0; + transform-origin: 100% 0; + -webkit-transform: scaleX(0.5); + transform: scaleX(0.5); + } + .weui-grid:after, + .weui-grid:before { + content: ' '; + position: absolute; + right: 0; + bottom: 0; + color: var(--weui-FG-3); + } + .weui-grid:after { + left: 0; + height: 2rpx; + border-bottom: 2rpx solid var(--weui-FG-3); + -webkit-transform-origin: 0 100%; + transform-origin: 0 100%; + -webkit-transform: scaleY(0.5); + transform: scaleY(0.5); + } + .weui-grid:active { + background-color: var(--weui-BG-COLOR-ACTIVE); + } + .weui-grid__icon { + width: 56rpx; + height: 56rpx; + margin: 0 auto; + } + .weui-grid__icon img { + display: block; + width: 100%; + height: 100%; + } + .weui-grid__icon + .weui-grid__label { + margin-top: 8rpx; + } + .weui-grid__label { + display: block; + color: var(--weui-FG-0); + white-space: nowrap; + text-overflow: ellipsis; + overflow: hidden; + } + .weui-footer, + .weui-grid__label { + text-align: center; + font-size: 28rpx; + } + .weui-footer { + color: rgba(0, 0, 0, 0.2); + line-height: 1.4; + } + [data-weui-theme='dark'] .weui-footer { + color: hsla(0, 0%, 100%, 0.2); + } + .weui-footer a, + .weui-footer navigator { + color: var(--weui-LINK); + } + .weui-footer navigator { + display: inline; + } + .weui-footer_fixed-bottom { + position: fixed; + bottom: 0; + left: 0; + right: 0; + padding-top: 32rpx; + padding-bottom: 32rpx; + padding-bottom: calc(32rpx + constant(safe-area-inset-bottom)); + padding-bottom: calc(32rpx + env(safe-area-inset-bottom)); + left: constant(safe-area-inset-left); + left: env(safe-area-inset-left); + right: constant(safe-area-inset-right); + right: env(safe-area-inset-right); + } + .weui-footer__links { + font-size: 0; + } + .weui-footer__link { + display: inline-block; + vertical-align: top; + margin: 0 16rpx; + position: relative; + font-size: 28rpx; + } + .weui-footer__link:before { + content: ' '; + position: absolute; + left: 0; + top: 0; + width: 2rpx; + bottom: 0; + border-left: 2rpx solid var(--weui-FG-3); + color: var(--weui-FG-3); + -webkit-transform-origin: 0 0; + transform-origin: 0 0; + -webkit-transform: scaleX(0.5); + transform: scaleX(0.5); + left: -16rpx; + top: 0.36em; + bottom: 0.36em; + } + .weui-footer__link:first-child:before { + display: none; + } + .weui-footer__text { + padding: 0 32rpx; + font-size: 24rpx; + } + .weui-flex { + display: -webkit-box; + display: -webkit-flex; + display: flex; + } + .weui-flex__item { + -webkit-box-flex: 1; + -webkit-flex: 1; + flex: 1; + min-width: 0; + } + .weui-dialog { + position: fixed; + z-index: 5000; + top: 50%; + left: 32rpx; + right: 32rpx; + -webkit-transform: translateY(-50%); + transform: translateY(-50%); + background-color: var(--weui-BG-2); + text-align: center; + border-radius: 24rpx; + overflow: hidden; + display: -webkit-box; + display: -webkit-flex; + display: flex; + -webkit-flex-direction: column; + -webkit-box-orient: vertical; + -webkit-box-direction: normal; + flex-direction: column; + max-height: 90%; + outline: 0; + } + .weui-dialog__hd { + padding: 64rpx 48rpx 32rpx; + } + .weui-dialog__title { + font-weight: 700; + font-size: 34rpx; + line-height: 1.4; + color: var(--weui-FG-0); + } + .weui-dialog__bd { + overflow-y: auto; + -webkit-overflow-scrolling: touch; + padding: 0 48rpx; + margin-bottom: 64rpx; + font-size: 34rpx; + line-height: 1.4; + word-wrap: break-word; + -webkit-hyphens: auto; + hyphens: auto; + color: var(--weui-FG-1); + } + .weui-dialog__bd:first-child { + min-height: 80rpx; + padding: 64rpx 48rpx 0; + font-weight: 700; + color: var(--weui-FG-0); + -webkit-flex-direction: column; + -webkit-box-orient: vertical; + -webkit-box-direction: normal; + flex-direction: column; + -webkit-box-pack: center; + -webkit-justify-content: center; + justify-content: center; + } + .weui-dialog__bd:first-child, + .weui-dialog__ft { + display: -webkit-box; + display: -webkit-flex; + display: flex; + } + .weui-dialog__ft { + position: relative; + } + .weui-dialog__ft:after { + content: ' '; + position: absolute; + left: 0; + top: 0; + right: 0; + height: 2rpx; + border-top: 2rpx solid var(--weui-DIALOG-LINE-COLOR); + color: var(--weui-DIALOG-LINE-COLOR); + -webkit-transform-origin: 0 0; + transform-origin: 0 0; + -webkit-transform: scaleY(0.5); + transform: scaleY(0.5); + } + .weui-dialog__btn { + -webkit-box-flex: 1; + -webkit-flex: 1; + flex: 1; + display: block; + line-height: 1.41176471; + padding: 32rpx 0; + font-size: 34rpx; + color: var(--weui-LINK); + font-weight: 700; + text-decoration: none; + -webkit-tap-highlight-color: rgba(0, 0, 0, 0); + -webkit-user-select: none; + user-select: none; + position: relative; + overflow: hidden; + } + .weui-dialog__btn:active { + background-color: var(--weui-BG-COLOR-ACTIVE); + } + .weui-dialog__btn:after { + content: ' '; + position: absolute; + left: 0; + top: 0; + width: 2rpx; + bottom: 0; + border-left: 2rpx solid var(--weui-DIALOG-LINE-COLOR); + color: var(--weui-DIALOG-LINE-COLOR); + -webkit-transform-origin: 0 0; + transform-origin: 0 0; + -webkit-transform: scaleX(0.5); + transform: scaleX(0.5); + } + .weui-dialog__btn:first-child:after { + display: none; + } + .weui-dialog__btn_default { + color: var(--weui-FG-HALF); + } + .weui-skin_android .weui-dialog { + text-align: left; + box-shadow: 0 12rpx 60rpx 0 rgba(0, 0, 0, 0.1); + } + .weui-skin_android .weui-dialog__title { + font-size: 44rpx; + line-height: 1.4; + } + .weui-skin_android .weui-dialog__hd { + text-align: left; + } + .weui-skin_android .weui-dialog__bd { + color: var(--weui-FG-1); + text-align: left; + } + .weui-skin_android .weui-dialog__bd:first-child { + color: var(--weui-FG-0); + } + .weui-skin_android .weui-dialog__ft { + display: block; + text-align: right; + line-height: 80rpx; + min-height: 80rpx; + padding: 0 48rpx 32rpx; + } + .weui-skin_android .weui-dialog__ft:after { + display: none; + } + .weui-skin_android .weui-dialog__btn { + display: inline-block; + vertical-align: top; + padding: 0 0.8em; + } + .weui-skin_android .weui-dialog__btn:after { + display: none; + } + .weui-skin_android .weui-dialog__btn:last-child { + margin-right: -0.8em; + } + .weui-skin_android .weui-dialog__btn_default { + color: var(--weui-FG-HALF); + } + @media screen and (min-width: 704rpx) { + .weui-dialog { + width: 640rpx; + margin: 0 auto; + } + } + .weui-half-screen-dialog { + position: fixed; + left: 0; + right: 0; + bottom: 0; + min-height: 510rpx; + max-height: 75%; + z-index: 5000; + line-height: 1.4; + background-color: var(--weui-BG-2); + color: var(--weui-FG-0); + border-top-left-radius: 24rpx; + border-top-right-radius: 24rpx; + overflow: hidden; + padding: 0 48rpx; + padding: 0 calc(48rpx + constant(safe-area-inset-right)) + constant(safe-area-inset-bottom) + calc(48rpx + constant(safe-area-inset-left)); + padding: 0 calc(48rpx + env(safe-area-inset-right)) + env(safe-area-inset-bottom) calc(48rpx + env(safe-area-inset-left)); + box-sizing: border-box; + display: -webkit-box; + display: -webkit-flex; + display: flex; + -webkit-box-orient: vertical; + -webkit-box-direction: normal; + -webkit-flex-direction: column; + flex-direction: column; + outline: 0; + } + + .weui-half-screen-dialog__hd { + min-height: 128rpx; + display: -webkit-box; + display: -webkit-flex; + display: flex; + -webkit-box-align: center; + -webkit-align-items: center; + align-items: center; + -webkit-flex-shrink: 0; + flex-shrink: 0; + } + .weui-half-screen-dialog__hd .weui-btn_icon { + position: absolute; + top: 50%; + -webkit-transform: translateY(-50%); + transform: translateY(-50%); + color: inherit; + } + .weui-half-screen-dialog__hd .weui-btn_icon:active { + opacity: 0.5; + } + .weui-half-screen-dialog__hd__side { + position: relative; + left: -16rpx; + } + .weui-half-screen-dialog__hd__main { + -webkit-box-flex: 1; + -webkit-flex: 1; + flex: 1; + } + .weui-half-screen-dialog__hd__side + .weui-half-screen-dialog__hd__main { + text-align: center; + padding: 0 80rpx; + } + .weui-half-screen-dialog__hd__main + .weui-half-screen-dialog__hd__side { + right: -16rpx; + left: auto; + } + .weui-half-screen-dialog__hd__main + + .weui-half-screen-dialog__hd__side + .weui-btn_icon, + .weui-half-screen-dialog__hd__main + + .weui-half-screen-dialog__hd__side + .weui-icon-btn { + right: 0; + } + .weui-half-screen-dialog__title { + display: block; + color: var(--weui-FG-0); + font-weight: 500; + font-size: 30rpx; + } + .weui-half-screen-dialog__subtitle { + display: block; + color: var(--weui-FG-1); + font-size: 20rpx; + } + .weui-half-screen-dialog__bd { + -webkit-box-flex: 1; + -webkit-flex: 1; + flex: 1; + min-height: 0; + overflow-y: auto; + word-wrap: break-word; + -webkit-hyphens: auto; + hyphens: auto; + padding-bottom: 112rpx; + font-size: 28rpx; + color: var(--weui-FG-0); + } + .weui-half-screen-dialog__desc { + font-size: 34rpx; + font-weight: 700; + color: var(--weui-FG-0); + line-height: 1.4; + } + .weui-half-screen-dialog__tips { + padding-top: 32rpx; + font-size: 28rpx; + color: var(--weui-FG-2); + line-height: 1.4; + } + .weui-half-screen-dialog__ft { + padding: 0 0 128rpx; + text-align: center; + } + .weui-half-screen-dialog__ft .weui-btn:nth-last-child(n + 2), + .weui-half-screen-dialog__ft .weui-btn:nth-last-child(n + 2) + .weui-btn { + display: inline-block; + vertical-align: top; + margin: 0 16rpx; + width: 240rpx; + } + .weui-half-screen-dialog__btn-area { + display: -webkit-box; + display: -webkit-flex; + display: flex; + -webkit-box-align: center; + -webkit-align-items: center; + align-items: center; + -webkit-box-pack: center; + -webkit-justify-content: center; + justify-content: center; + } + .weui-half-screen-dialog__btn-area .weui-btn { + width: 368rpx; + padding-left: 32rpx; + padding-right: 32rpx; + } + .weui-half-screen-dialog__btn-area .weui-btn:nth-last-child(n + 2), + .weui-half-screen-dialog__btn-area .weui-btn:nth-last-child(n + 2) + .weui-btn { + margin: 0 16rpx; + width: 272rpx; + } + .weui-half-screen-dialog__btn-area + .weui-btn:nth-last-child(n + 2) + + .weui-btn:first-child, + .weui-half-screen-dialog__btn-area .weui-btn:nth-last-child(n + 2):first-child { + margin-left: 0; + } + .weui-half-screen-dialog__btn-area + .weui-btn:nth-last-child(n + 2) + + .weui-btn:last-child, + .weui-half-screen-dialog__btn-area .weui-btn:nth-last-child(n + 2):last-child { + margin-right: 0; + } + .weui-half-screen-dialog__btn-area + .weui-half-screen-dialog__attachment-area { + margin-top: 48rpx; + margin-bottom: -68rpx; + } + .weui-half-screen-dialog_btn-wrap .weui-half-screen-dialog__btn-area { + -webkit-box-orient: vertical; + -webkit-box-direction: normal; + -webkit-flex-direction: column; + flex-direction: column; + } + + .weui-half-screen-dialog_large { + max-height: none; + top: 32rpx; + } + .weui-half-screen-dialog_slide .weui-half-screen-dialog__hd { + min-height: 0; + padding: 24rpx 32rpx 32rpx; + -webkit-box-pack: center; + -webkit-justify-content: center; + justify-content: center; + } + .weui-half-screen-dialog_slide .weui-half-screen-dialog__slide-icon { + position: absolute; + top: 24rpx; + display: -webkit-box; + display: -webkit-flex; + display: flex; + width: 80rpx; + height: 8rpx; + border-radius: 4rpx; + background: var(--weui-BG-0); + -webkit-box-pack: center; + -webkit-justify-content: center; + justify-content: center; + -webkit-box-align: center; + -webkit-align-items: center; + align-items: center; + } + [data-weui-theme='dark'] + .weui-half-screen-dialog_slide + .weui-half-screen-dialog__slide-icon { + background: var(--weui-FG-3); + } + .weui-half-screen-dialog_slide + .weui-half-screen-dialog__slide-icon + .weui-icon-arrow { + -webkit-transform: rotate(90deg); + transform: rotate(90deg); + width: 0.8em; + height: 1.6em; + opacity: 0; + } + .weui-icon-more { + -webkit-mask: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24'%3E %3Cpath fill-opacity='.9' fill-rule='evenodd' d='M5 10.25a1.75 1.75 0 1 1 0 3.5 1.75 1.75 0 0 1 0-3.5zm7 0a1.75 1.75 0 1 1 0 3.5 1.75 1.75 0 0 1 0-3.5zm7 0a1.75 1.75 0 1 1 0 3.5 1.75 1.75 0 0 1 0-3.5z'/%3E%3C/svg%3E") + no-repeat 50% 50%; + mask: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24'%3E %3Cpath fill-opacity='.9' fill-rule='evenodd' d='M5 10.25a1.75 1.75 0 1 1 0 3.5 1.75 1.75 0 0 1 0-3.5zm7 0a1.75 1.75 0 1 1 0 3.5 1.75 1.75 0 0 1 0-3.5zm7 0a1.75 1.75 0 1 1 0 3.5 1.75 1.75 0 0 1 0-3.5z'/%3E%3C/svg%3E") + no-repeat 50% 50%; + } + .weui-icon-slide-down { + -webkit-mask-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' width='24' height='24' viewBox='0 0 24 24'%3E %3Cdefs%3E %3Crect id='dda90263-a290-4594-926f-6aba8cb4779f-a' width='24' height='24' x='0' y='0' rx='12'/%3E %3C/defs%3E %3Cg fill='none' fill-rule='evenodd'%3E %3Cmask id='dda90263-a290-4594-926f-6aba8cb4779f-b' fill='%23fff'%3E %3Cuse xlink:href='%23dda90263-a290-4594-926f-6aba8cb4779f-a'/%3E %3C/mask%3E %3Cuse fill='%23000' fill-opacity='.05' xlink:href='%23dda90263-a290-4594-926f-6aba8cb4779f-a'/%3E %3Cg fill-opacity='.9' mask='url(%23dda90263-a290-4594-926f-6aba8cb4779f-b)'%3E %3Cpath fill='%23000' d='M11.407 15.464L6.693 10.75l1.179-1.179 4.125 4.125 4.124-4.125L17.3 10.75l-4.714 4.714a.833.833 0 0 1-1.179 0z'/%3E %3C/g%3E %3C/g%3E%3C/svg%3E"); + mask-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' width='24' height='24' viewBox='0 0 24 24'%3E %3Cdefs%3E %3Crect id='dda90263-a290-4594-926f-6aba8cb4779f-a' width='24' height='24' x='0' y='0' rx='12'/%3E %3C/defs%3E %3Cg fill='none' fill-rule='evenodd'%3E %3Cmask id='dda90263-a290-4594-926f-6aba8cb4779f-b' fill='%23fff'%3E %3Cuse xlink:href='%23dda90263-a290-4594-926f-6aba8cb4779f-a'/%3E %3C/mask%3E %3Cuse fill='%23000' fill-opacity='.05' xlink:href='%23dda90263-a290-4594-926f-6aba8cb4779f-a'/%3E %3Cg fill-opacity='.9' mask='url(%23dda90263-a290-4594-926f-6aba8cb4779f-b)'%3E %3Cpath fill='%23000' d='M11.407 15.464L6.693 10.75l1.179-1.179 4.125 4.125 4.124-4.125L17.3 10.75l-4.714 4.714a.833.833 0 0 1-1.179 0z'/%3E %3C/g%3E %3C/g%3E%3C/svg%3E"); + } + .weui-half-screen-dialog__hd .weui-icon-btn { + position: absolute; + top: 50%; + -webkit-transform: translateY(-50%); + transform: translateY(-50%); + color: inherit; + } + .weui-half-screen-dialog__hd .weui-icon-btn:active { + opacity: 0.5; + } + .weui-half-screen-dialog__hd .weui-icon-btn:after { + content: ''; + position: absolute; + top: 50%; + left: 50%; + -webkit-transform: translate(-50%, -50%); + transform: translate(-50%, -50%); + min-width: 88rpx; + min-height: 88rpx; + width: 100%; + height: 100%; + } + .weui-icon-btn.weui-icon-btn { + outline: 0; + -webkit-appearance: none; + -webkit-tap-highlight-color: rgba(0, 0, 0, 0); + border-width: 0; + background-color: transparent; + color: var(--weui-FG-0); + font-size: 0; + width: auto; + height: auto; + } + .weui-icon-btn_goback.weui-icon-btn_goback { + color: var(--weui-FG-0); + background-color: currentColor; + width: 0.71rem; + height: 1.42rem; + -webkit-mask: url('data:image/svg+xml,%3Csvg%20width%3D%2212%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M10%2019.438L8.955%2020.5l-7.666-7.79a1.02%201.02%200%20010-1.42L8.955%203.5%2010%204.563%202.682%2012%2010%2019.438z%22%20fill-rule%3D%22evenodd%22%2F%3E%3C%2Fsvg%3E') + no-repeat 50% 50%; + mask: url('data:image/svg+xml,%3Csvg%20width%3D%2212%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M10%2019.438L8.955%2020.5l-7.666-7.79a1.02%201.02%200%20010-1.42L8.955%203.5%2010%204.563%202.682%2012%2010%2019.438z%22%20fill-rule%3D%22evenodd%22%2F%3E%3C%2Fsvg%3E') + no-repeat 50% 50%; + -webkit-mask-size: 100%; + mask-size: 100%; + } + .weui-icon-btn_close.weui-icon-btn_close { + color: var(--weui-FG-0); + background-color: currentColor; + width: 1.42rem; + height: 1.42rem; + -webkit-mask: url('data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M12.25%2010.693L6.057%204.5%205%205.557l6.193%206.193L5%2017.943%206.057%2019l6.193-6.193L18.443%2019l1.057-1.057-6.193-6.193L19.5%205.557%2018.443%204.5z%22%20fill-rule%3D%22evenodd%22%2F%3E%3C%2Fsvg%3E') + no-repeat 50% 50%; + mask: url('data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M12.25%2010.693L6.057%204.5%205%205.557l6.193%206.193L5%2017.943%206.057%2019l6.193-6.193L18.443%2019l1.057-1.057-6.193-6.193L19.5%205.557%2018.443%204.5z%22%20fill-rule%3D%22evenodd%22%2F%3E%3C%2Fsvg%3E') + no-repeat 50% 50%; + -webkit-mask-size: 100%; + mask-size: 100%; + } + .weui-toast { + position: fixed; + z-index: 5500; + font-size: 20rpx; + width: 13.6em; + height: 13.6em; + top: 40%; + left: 50%; + -webkit-transform: translate(-50%, -50%); + transform: translate(-50%, -50%); + text-align: center; + border-radius: 24rpx; + color: hsla(0, 0%, 100%, 0.9); + display: -webkit-box; + display: -webkit-flex; + display: flex; + -webkit-box-orient: vertical; + -webkit-box-direction: normal; + -webkit-flex-direction: column; + flex-direction: column; + -webkit-box-align: center; + -webkit-align-items: center; + align-items: center; + -webkit-box-pack: center; + -webkit-justify-content: center; + justify-content: center; + background-color: var(--weui-BG-4); + box-sizing: border-box; + line-height: 1.4; + } + .weui-toast_text { + width: auto; + height: auto; + min-width: 304rpx; + max-width: 432rpx; + padding: 24rpx 0; + border-radius: 16rpx; + } + .weui-toast_text .weui-toast__content { + font-size: 28rpx; + padding: 0 40rpx; + } + .weui-icon_toast { + display: block; + margin-bottom: 32rpx; + } + .weui-icon_toast.weui-icon_toast { + width: 4em; + height: 4em; + } + .weui-icon_toast.weui-icon-success-no-circle, + .weui-icon_toast.weui-icon-warn { + color: hsla(0, 0%, 100%, 0.9); + } + .weui-icon_toast.weui-loading { + width: 1em; + height: 1em; + font-size: 80rpx; + } + .weui-icon_toast.weui-primary-loading { + display: -webkit-box; + display: -webkit-flex; + display: flex; + width: 1em; + height: 1em; + font-size: 80rpx; + color: #ededed; + } + .weui-icon_toast.weui-primary-loading:before { + border-width: 8rpx 0 8rpx 8rpx; + } + .weui-icon_toast.weui-primary-loading:after { + border-width: 8rpx 8rpx 8rpx 0; + } + .weui-icon_toast.weui-primary-loading .weui-primary-loading__dot { + width: 8rpx; + height: 8rpx; + border-top-right-radius: 8rpx; + border-bottom-right-radius: 8rpx; + } + .weui-toast__content { + font-size: 34rpx; + padding: 0 24rpx; + word-wrap: break-word; + -webkit-hyphens: auto; + hyphens: auto; + } + .weui-toast_text-more .weui-icon_toast { + margin-bottom: 24rpx; + } + .weui-toast_text-more .weui-toast__content { + font-size: 28rpx; + line-height: 1.6; + } + .weui-mask { + background: rgba(0, 0, 0, 0.6); + } + .weui-mask, + .weui-mask_transparent { + position: fixed; + z-index: 1000; + top: 0; + right: 0; + left: 0; + bottom: 0; + } + .weui-actionsheet { + position: fixed; + left: 0; + bottom: 0; + -webkit-transform: translateY(100%); + transform: translateY(100%); + -webkit-backface-visibility: hidden; + backface-visibility: hidden; + z-index: 5000; + width: 100%; + background-color: var(--weui-BG-1); + -webkit-transition: -webkit-transform 0.3s; + transition: -webkit-transform 0.3s; + transition: transform 0.3s; + transition: transform 0.3s, -webkit-transform 0.3s; + border-top-left-radius: 24rpx; + border-top-right-radius: 24rpx; + overflow: hidden; + outline: 0; + } + .weui-actionsheet__title { + position: relative; + height: 112rpx; + padding: 16rpx 48rpx; + padding: 16rpx calc(48rpx + constant(safe-area-inset-right)) 16rpx + calc(48rpx + constant(safe-area-inset-left)); + padding: 16rpx calc(48rpx + env(safe-area-inset-right)) 16rpx + calc(48rpx + env(safe-area-inset-left)); + box-sizing: border-box; + display: -webkit-box; + display: -webkit-flex; + display: flex; + -webkit-box-pack: center; + -webkit-justify-content: center; + justify-content: center; + -webkit-box-orient: vertical; + -webkit-box-direction: normal; + -webkit-flex-direction: column; + flex-direction: column; + text-align: center; + font-size: 24rpx; + color: var(--weui-FG-1); + line-height: 1.4; + background: var(--weui-BG-2); + } + .weui-actionsheet__title:before { + content: ' '; + position: absolute; + left: 0; + bottom: 0; + right: 0; + height: 2rpx; + border-bottom: 2rpx solid var(--weui-FG-3); + color: var(--weui-FG-3); + -webkit-transform-origin: 0 100%; + transform-origin: 0 100%; + -webkit-transform: scaleY(0.5); + transform: scaleY(0.5); + } + .weui-actionsheet__title .weui-actionsheet__title-text { + overflow: hidden; + text-overflow: ellipsis; + display: -webkit-box; + -webkit-box-orient: vertical; + -webkit-line-clamp: 2; + } + .weui-actionsheet__action, + .weui-actionsheet__menu { + color: var(--weui-FG-0); + background-color: var(--weui-BG-2); + } + .weui-actionsheet__action { + margin-top: 16rpx; + } + .weui-actionsheet__action .weui-actionsheet__cell:last-child { + padding-bottom: calc(32rpx + constant(safe-area-inset-bottom)); + padding-bottom: calc(32rpx + env(safe-area-inset-bottom)); + } + .weui-actionsheet__cell { + position: relative; + padding: 32rpx; + padding: 32rpx calc(32rpx + constant(safe-area-inset-right)) 32rpx + calc(32rpx + constant(safe-area-inset-left)); + padding: 32rpx calc(32rpx + env(safe-area-inset-right)) 32rpx + calc(32rpx + env(safe-area-inset-left)); + text-align: center; + font-size: 34rpx; + line-height: 1.41176471; + overflow: hidden; + } + .weui-actionsheet__cell:before { + content: ' '; + position: absolute; + left: 0; + top: 0; + right: 0; + height: 2rpx; + border-top: 2rpx solid var(--weui-FG-3); + color: var(--weui-FG-3); + -webkit-transform-origin: 0 0; + transform-origin: 0 0; + -webkit-transform: scaleY(0.5); + transform: scaleY(0.5); + } + .weui-actionsheet__cell:active { + background-color: var(--weui-BG-COLOR-ACTIVE); + } + .weui-actionsheet__cell:first-child:before { + display: none; + } + .weui-actionsheet__cell_warn { + color: var(--weui-RED); + } + .weui-skin_android .weui-actionsheet { + position: fixed; + left: 50%; + top: 50%; + bottom: auto; + -webkit-transform: translate(-50%, -50%); + transform: translate(-50%, -50%); + width: 548rpx; + box-sizing: border-box; + -webkit-backface-visibility: hidden; + backface-visibility: hidden; + background: transparent; + -webkit-transition: -webkit-transform 0.3s; + transition: -webkit-transform 0.3s; + transition: transform 0.3s; + transition: transform 0.3s, -webkit-transform 0.3s; + border-top-left-radius: 0; + border-top-right-radius: 0; + } + .weui-skin_android .weui-actionsheet__action { + display: none; + } + .weui-skin_android .weui-actionsheet__menu { + border-radius: 4rpx; + box-shadow: 0 12rpx 60rpx 0 rgba(0, 0, 0, 0.1); + } + .weui-skin_android .weui-actionsheet__cell { + padding: 32rpx; + font-size: 34rpx; + line-height: 1.41176471; + color: var(--weui-FG-0); + text-align: left; + } + .weui-skin_android .weui-actionsheet__cell:first-child { + border-top-left-radius: 4rpx; + border-top-right-radius: 4rpx; + } + .weui-skin_android .weui-actionsheet__cell:last-child { + border-bottom-left-radius: 4rpx; + border-bottom-right-radius: 4rpx; + } + .weui-actionsheet_toggle { + -webkit-transform: translate(0); + transform: translate(0); + } + .weui-loadmore { + width: 65%; + margin: 40rpx auto; + text-align: center; + font-size: 0; + } + .weui-loadmore .weui-loading, + .weui-loadmore .weui-primary-loading { + margin-right: 16rpx; + } + .weui-loadmore__tips { + display: inline-block; + vertical-align: middle; + font-size: 28rpx; + line-height: 1.6; + color: var(--weui-FG-1); + } + .weui-loadmore_line { + border-top: 2rpx solid var(--weui-FG-3); + margin-top: 64rpx; + } + .weui-loadmore_line .weui-loadmore__tips { + position: relative; + top: -0.9em; + padding: 0 16rpx; + background-color: var(--weui-BG-2); + } + .weui-loadmore_dot .weui-loadmore__tips:before { + content: ' '; + width: 8rpx; + height: 8rpx; + border-radius: 50%; + background-color: var(--weui-FG-3); + display: inline-block; + position: relative; + vertical-align: 0; + top: -0.16em; + } + .weui-badge { + display: inline-block; + padding: 0.15em 0.4em; + min-width: 0.66666667em; + border-radius: 36rpx; + background-color: var(--weui-RED); + color: #fff; + line-height: 1.2; + text-align: center; + font-size: 24rpx; + vertical-align: middle; + } + .weui-badge_dot { + padding: 0.4em; + min-width: 0; + } + .weui-toptips { + display: none; + position: fixed; + -webkit-transform: translateZ(0); + transform: translateZ(0); + top: 16rpx; + left: 16rpx; + right: 16rpx; + padding: 20rpx; + border-radius: 16rpx; + font-size: 28rpx; + text-align: center; + color: #fff; + z-index: 5500; + word-wrap: break-word; + word-break: break-all; + } + .weui-toptips_warn { + background-color: var(--weui-RED); + } + .weui-list-tips { + list-style: none; + padding-top: 48rpx; + padding-bottom: 48rpx; + line-height: 1.4; + font-size: 28rpx; + color: var(--weui-FG-1); + position: relative; + } + .weui-list-tips:before { + content: ''; + content: ' '; + position: absolute; + left: 0; + top: 0; + right: 0; + height: 2rpx; + border-top: 2rpx solid var(--weui-FG-3); + color: var(--weui-FG-3); + -webkit-transform-origin: 0 0; + transform-origin: 0 0; + -webkit-transform: scaleY(0.5); + transform: scaleY(0.5); + } + .weui-list-tips:last-child { + padding-bottom: 0; + } + .weui-list-tips__item { + position: relative; + padding-left: 30rpx; + margin: 32rpx 0; + } + .weui-list-tips__item:before { + content: '\2022'; + position: absolute; + left: 0; + top: -0.1em; + } + .weui-list-tips__item:first-child { + margin-top: 0; + } + .weui-form-preview__list + .weui-list-tips > .weui-list-tips__item:first-child { + margin-top: 12rpx; + } + .weui-search-bar { + position: relative; + padding: 16rpx; + display: -webkit-box; + display: -webkit-flex; + display: flex; + box-sizing: border-box; + background-color: var(--weui-BG-0); + -webkit-box-align: center; + -webkit-align-items: center; + align-items: center; + } + .weui-search-bar.weui-search-bar_focusing .weui-search-bar__cancel-btn { + display: block; + } + .weui-search-bar.weui-search-bar_focusing .weui-search-bar__label { + display: none; + } + .weui-search-bar .weui-icon-search { + font-size: 20rpx; + width: 1.6em; + height: 1.6em; + margin-left: 16rpx; + margin-right: 8rpx; + -webkit-flex-shrink: 0; + flex-shrink: 0; + } + .weui-search-bar__form { + position: relative; + -webkit-box-flex: 1; + -webkit-flex: 1; + flex: 1; + min-width: 0; + background-color: var(--weui-BG-2); + border-radius: 8rpx; + } + .weui-search-bar__box { + position: relative; + z-index: 1; + display: -webkit-box; + display: -webkit-flex; + display: flex; + -webkit-box-align: center; + -webkit-align-items: center; + align-items: center; + } + .weui-search-bar__box .weui-search-bar__input { + padding: 16rpx 0; + width: 100%; + height: 1.14285714em; + border: 0; + font-size: 28rpx; + line-height: 1.14285714em; + box-sizing: content-box; + background: transparent; + caret-color: var(--weui-BRAND); + color: var(--weui-FG-0); + } + .weui-search-bar__box .weui-search-bar__input:focus { + outline: none; + } + .weui-search-bar__box .weui-icon-clear { + -webkit-flex-shrink: 0; + flex-shrink: 0; + font-size: 20rpx; + width: 2em; + height: 2em; + margin-left: 16rpx; + -webkit-mask-size: 2em; + mask-size: 2em; + -webkit-mask-position: calc(100% - 16rpx) 0; + mask-position: calc(100% - 16rpx) 0; + min-width: 88rpx; + } + .weui-search-bar__box .weui-icon-clear:after { + content: ''; + position: absolute; + top: 0; + bottom: 0; + width: 88rpx; + } + .weui-search-bar__label { + position: absolute; + top: 0; + right: 0; + bottom: 0; + left: 0; + z-index: 2; + font-size: 0; + border-radius: 8rpx; + display: -webkit-box; + display: -webkit-flex; + display: flex; + -webkit-box-align: center; + -webkit-align-items: center; + align-items: center; + -webkit-box-pack: center; + -webkit-justify-content: center; + justify-content: center; + color: var(--weui-FG-1); + background: var(--weui-BG-2); + } + .weui-search-bar__label span, .weui-search-bar__label .span { + display: inline-block; + font-size: 28rpx; + vertical-align: middle; + } + .weui-search-bar__cancel-btn { + -webkit-flex-shrink: 0; + flex-shrink: 0; + display: none; + margin-left: 16rpx; + line-height: 56rpx; + color: var(--weui-LINK); + } + .weui-search-bar__input:not(:valid) + .weui-icon-clear { + display: none; + } + input[type='search']::-webkit-search-cancel-button, + input[type='search']::-webkit-search-decoration, + input[type='search']::-webkit-search-results-button, + input[type='search']::-webkit-search-results-decoration { + display: none; + } + .weui-picker { + position: fixed; + width: 100%; + box-sizing: border-box; + left: 0; + bottom: 0; + z-index: 5000; + background-color: var(--weui-BG-2); + padding-left: 0; + padding-left: constant(safe-area-inset-left); + padding-left: env(safe-area-inset-left); + padding-right: 0; + padding-right: constant(safe-area-inset-right); + padding-right: env(safe-area-inset-right); + -webkit-backface-visibility: hidden; + backface-visibility: hidden; + -webkit-transform: translateY(100%); + transform: translateY(100%); + -webkit-transition: -webkit-transform 0.3s; + transition: -webkit-transform 0.3s; + transition: transform 0.3s; + transition: transform 0.3s, -webkit-transform 0.3s; + outline: 0; + } + .weui-picker .weui-half-screen-dialog__hd { + padding-left: 48rpx; + padding-right: 48rpx; + } + .weui-picker .weui-half-screen-dialog__bd { + overflow: visible; + } + .weui-picker__hd { + display: -webkit-box; + display: -webkit-flex; + display: flex; + padding: 32rpx; + padding: 32rpx calc(32rpx + constant(safe-area-inset-right)) 32rpx + calc(32rpx + constant(safe-area-inset-left)); + padding: 32rpx calc(32rpx + env(safe-area-inset-right)) 32rpx + calc(32rpx + env(safe-area-inset-left)); + position: relative; + text-align: center; + font-size: 34rpx; + line-height: 1.4; + } + .weui-picker__hd:after { + content: ' '; + position: absolute; + left: 0; + bottom: 0; + right: 0; + height: 2rpx; + border-bottom: 2rpx solid var(--weui-FG-3); + color: var(--weui-FG-3); + -webkit-transform-origin: 0 100%; + transform-origin: 0 100%; + -webkit-transform: scaleY(0.5); + transform: scaleY(0.5); + } + .weui-picker__bd { + display: -webkit-box; + display: -webkit-flex; + display: flex; + position: relative; + background-color: var(--weui-BG-2); + height: 480rpx; + overflow: hidden; + } + .weui-picker__group { + -webkit-box-flex: 1; + -webkit-flex: 1; + flex: 1; + position: relative; + height: 100%; + font-size: 34rpx; + } + .weui-picker__group:first-child .weui-picker__indicator { + left: 16rpx; + border-top-left-radius: 16rpx; + border-bottom-left-radius: 16rpx; + } + .weui-picker__group:last-child .weui-picker__indicator { + right: 16rpx; + border-top-right-radius: 16rpx; + border-bottom-right-radius: 16rpx; + } + .weui-picker__mask { + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100%; + margin: 0 auto; + z-index: 3; + background-image: -webkit-linear-gradient( + top, + hsla(0, 0%, 100%, 0.95), + hsla(0, 0%, 100%, 0.6) + ), + -webkit-linear-gradient(bottom, hsla(0, 0%, 100%, 0.95), hsla(0, 0%, 100%, 0.6)); + background-image: linear-gradient( + 180deg, + hsla(0, 0%, 100%, 0.95), + hsla(0, 0%, 100%, 0.6) + ), + linear-gradient(0deg, hsla(0, 0%, 100%, 0.95), hsla(0, 0%, 100%, 0.6)); + background-position: top, bottom; + background-size: 100% 224rpx; + background-repeat: no-repeat; + -webkit-transform: translateZ(0); + transform: translateZ(0); + } + [data-weui-theme='dark'] .weui-picker__mask { + background-image: -webkit-linear-gradient( + top, + rgba(25, 25, 25, 0.95), + rgba(25, 25, 25, 0.6) + ), + -webkit-linear-gradient(bottom, rgba(25, 25, 25, 0.95), rgba(25, 25, 25, 0.6)); + background-image: linear-gradient( + 180deg, + rgba(25, 25, 25, 0.95), + rgba(25, 25, 25, 0.6) + ), + linear-gradient(0deg, rgba(25, 25, 25, 0.95), rgba(25, 25, 25, 0.6)); + } + .weui-picker__indicator { + height: 112rpx; + position: absolute; + top: 224rpx; + left: 0; + right: 0; + z-index: 1; + background: var(--weui-BG-3); + } + .weui-picker__content { + position: absolute; + top: 0; + left: 0; + width: 100%; + z-index: 2; + } + .weui-picker__item { + height: 112rpx; + line-height: 112rpx; + text-align: center; + color: var(--weui-FG-0); + text-overflow: ellipsis; + white-space: nowrap; + overflow: hidden; + } + .weui-picker__item_disabled { + color: var(--weui-FG-1); + } + @-webkit-keyframes weuiSlideUp { + 0% { + -webkit-transform: translate3d(0, 100%, 0); + transform: translate3d(0, 100%, 0); + } + to { + -webkit-transform: translateZ(0); + transform: translateZ(0); + } + } + @keyframes weuiSlideUp { + 0% { + -webkit-transform: translate3d(0, 100%, 0); + transform: translate3d(0, 100%, 0); + } + to { + -webkit-transform: translateZ(0); + transform: translateZ(0); + } + } + .weui-animate-slide-up, + .weui-animate_slide-up { + -webkit-animation: ease 0.3s forwards; + animation: ease 0.3s forwards; + } + @-webkit-keyframes weuiSlideDown { + 0% { + -webkit-transform: translateZ(0); + transform: translateZ(0); + } + to { + -webkit-transform: translate3d(0, 100%, 0); + transform: translate3d(0, 100%, 0); + } + } + @keyframes weuiSlideDown { + 0% { + -webkit-transform: translateZ(0); + transform: translateZ(0); + } + to { + -webkit-transform: translate3d(0, 100%, 0); + transform: translate3d(0, 100%, 0); + } + } + .weui-animate-slide-down, + .weui-animate_slide-down { + -webkit-animation: ease 0.3s forwards; + animation: ease 0.3s forwards; + } + .weui-animate-fade-in, + .weui-animate_fade-in { + -webkit-animation: fadeIn ease 0.3s forwards; + animation: fadeIn ease 0.3s forwards; + } + .weui-animate-fade-out, + .weui-animate_fade-out { + -webkit-animation: fadeOut ease 0.3s forwards; + animation: fadeOut ease 0.3s forwards; + } + .weui-transition.weui-mask { + -webkit-transition: opacity 0.3s, visibility 0.3s; + transition: opacity 0.3s, visibility 0.3s; + opacity: 0; + visibility: hidden; + } + .weui-transition.weui-half-screen-dialog { + -webkit-transition: -webkit-transform 0.3s; + transition: -webkit-transform 0.3s; + transition: transform 0.3s; + transition: transform 0.3s, -webkit-transform 0.3s; + -webkit-transform: translateY(100%); + transform: translateY(100%); + } + .weui-transition_show.weui-mask { + opacity: 1; + visibility: visible; + } + .weui-transition_show.weui-half-screen-dialog { + -webkit-transform: translateY(0); + transform: translateY(0); + } + .weui-agree { + display: block; + padding: 16rpx 30rpx 0; + font-size: 28rpx; + -webkit-tap-highlight-color: rgba(0, 0, 0, 0); + } + .weui-agree a, + .weui-agree navigator { + color: var(--weui-LINK); + } + .weui-agree navigator { + display: inline; + } + .weui-agree__text { + color: var(--weui-FG-1); + margin-left: 4rpx; + } + .weui-agree__checkbox { + -webkit-appearance: none; + appearance: none; + display: inline-block; + border: 0; + outline: 0; + vertical-align: middle; + background-color: currentColor; + -webkit-mask-position: 0 0; + mask-position: 0 0; + -webkit-mask-repeat: no-repeat; + mask-repeat: no-repeat; + -webkit-mask-size: 100%; + mask-size: 100%; + -webkit-mask-image: url(data:image/svg+xml,%3Csvg%20width%3D%221000%22%20height%3D%221000%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M500%20916.667C269.881%20916.667%2083.333%20730.119%2083.333%20500%2083.333%20269.881%20269.881%2083.333%20500%2083.333c230.119%200%20416.667%20186.548%20416.667%20416.667%200%20230.119-186.548%20416.667-416.667%20416.667zm0-50c202.504%200%20366.667-164.163%20366.667-366.667%200-202.504-164.163-366.667-366.667-366.667-202.504%200-366.667%20164.163-366.667%20366.667%200%20202.504%20164.163%20366.667%20366.667%20366.667z%22%20fill-rule%3D%22evenodd%22%20fill-opacity%3D%22.9%22%2F%3E%3C%2Fsvg%3E); + mask-image: url(data:image/svg+xml,%3Csvg%20width%3D%221000%22%20height%3D%221000%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M500%20916.667C269.881%20916.667%2083.333%20730.119%2083.333%20500%2083.333%20269.881%20269.881%2083.333%20500%2083.333c230.119%200%20416.667%20186.548%20416.667%20416.667%200%20230.119-186.548%20416.667-416.667%20416.667zm0-50c202.504%200%20366.667-164.163%20366.667-366.667%200-202.504-164.163-366.667-366.667-366.667-202.504%200-366.667%20164.163-366.667%20366.667%200%20202.504%20164.163%20366.667%20366.667%20366.667z%22%20fill-rule%3D%22evenodd%22%20fill-opacity%3D%22.9%22%2F%3E%3C%2Fsvg%3E); + color: var(--weui-FG-2); + width: 1em; + height: 1em; + font-size: 34rpx; + margin-top: -0.2em; + } + .weui-agree__checkbox-check { + opacity: 0; + position: absolute; + width: 2rpx; + height: 2rpx; + overflow: hidden; + } + .weui-agree__checkbox-check[aria-checked='true'] + .weui-agree__checkbox, + .weui-agree__checkbox:checked { + -webkit-mask-image: url(data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M12%2022C6.477%2022%202%2017.523%202%2012S6.477%202%2012%202s10%204.477%2010%2010-4.477%2010-10%2010zm-1.177-7.86l-2.765-2.767L7%2012.431l3.119%203.121a1%201%200%20001.414%200l5.952-5.95-1.062-1.062-5.6%205.6z%22%2F%3E%3C%2Fsvg%3E); + mask-image: url(data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M12%2022C6.477%2022%202%2017.523%202%2012S6.477%202%2012%202s10%204.477%2010%2010-4.477%2010-10%2010zm-1.177-7.86l-2.765-2.767L7%2012.431l3.119%203.121a1%201%200%20001.414%200l5.952-5.95-1.062-1.062-5.6%205.6z%22%2F%3E%3C%2Fsvg%3E); + color: var(--weui-BRAND); + } + .weui-agree_animate { + -webkit-animation: weuiAgree 0.3s 1; + animation: weuiAgree 0.3s 1; + } + @-webkit-keyframes weuiAgree { + 0% { + -webkit-transform: translateX(0); + transform: translateX(0); + } + 16% { + -webkit-transform: translateX(-16rpx); + transform: translateX(-16rpx); + } + 28% { + -webkit-transform: translateX(-32rpx); + transform: translateX(-32rpx); + } + 44% { + -webkit-transform: translateX(0); + transform: translateX(0); + } + 59% { + -webkit-transform: translateX(-32rpx); + transform: translateX(-32rpx); + } + 73% { + -webkit-transform: translateX(0); + transform: translateX(0); + } + 82% { + -webkit-transform: translateX(32rpx); + transform: translateX(32rpx); + } + 94% { + -webkit-transform: translateX(16rpx); + transform: translateX(16rpx); + } + to { + -webkit-transform: translateX(0); + transform: translateX(0); + } + } + @keyframes weuiAgree { + 0% { + -webkit-transform: translateX(0); + transform: translateX(0); + } + 16% { + -webkit-transform: translateX(-16rpx); + transform: translateX(-16rpx); + } + 28% { + -webkit-transform: translateX(-32rpx); + transform: translateX(-32rpx); + } + 44% { + -webkit-transform: translateX(0); + transform: translateX(0); + } + 59% { + -webkit-transform: translateX(-32rpx); + transform: translateX(-32rpx); + } + 73% { + -webkit-transform: translateX(0); + transform: translateX(0); + } + 82% { + -webkit-transform: translateX(32rpx); + transform: translateX(32rpx); + } + 94% { + -webkit-transform: translateX(16rpx); + transform: translateX(16rpx); + } + to { + -webkit-transform: translateX(0); + transform: translateX(0); + } + } + .weui-primary-loading { + font-size: 32rpx; + display: -webkit-inline-box; + display: -webkit-inline-flex; + display: inline-flex; + position: relative; + width: 1em; + height: 1em; + vertical-align: middle; + color: #606060; + -webkit-animation: circleLoading 1s steps(60) infinite; + animation: circleLoading 1s steps(60) infinite; + } + .weui-primary-loading:after, + .weui-primary-loading:before { + content: ''; + display: block; + width: 0.5em; + height: 1em; + box-sizing: border-box; + border: 0.0875em solid; + border-color: currentColor; + } + .weui-primary-loading:before { + border-right-width: 0; + border-top-left-radius: 1em; + border-bottom-left-radius: 1em; + -webkit-mask-image: -webkit-linear-gradient( + top, + #000 8%, + rgba(0, 0, 0, 0.3) 95% + ); + } + .weui-primary-loading:after { + border-left-width: 0; + border-top-right-radius: 1em; + border-bottom-right-radius: 1em; + -webkit-mask-image: -webkit-linear-gradient( + top, + transparent 8%, + rgba(0, 0, 0, 0.3) 95% + ); + } + .weui-primary-loading__dot { + position: absolute; + top: 0; + left: 50%; + margin-left: -0.04375em; + width: 0.0875em; + height: 0.0875em; + border-top-right-radius: 100%; + border-bottom-right-radius: 100%; + background: currentColor; + } + @-webkit-keyframes circleLoading { + 0% { + -webkit-transform: rotate(0deg); + transform: rotate(0deg); + } + to { + -webkit-transform: rotate(1turn); + transform: rotate(1turn); + } + } + @keyframes circleLoading { + 0% { + -webkit-transform: rotate(0deg); + transform: rotate(0deg); + } + to { + -webkit-transform: rotate(1turn); + transform: rotate(1turn); + } + } + .weui-primary-loading_brand { + color: var(--weui-BRAND); + } + .weui-primary-loading_transparent { + color: #ededed; + } + .weui-loading { + font-size: 32rpx; + width: 1em; + height: 1em; + display: inline-block; + vertical-align: middle; + background: transparent + url("data:image/svg+xml,%3C%3Fxml version='1.0' encoding='UTF-8'%3F%3E%3Csvg width='160rpx' height='160rpx' viewBox='0 0 80 80' version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink'%3E%3Ctitle%3Eloading%3C/title%3E%3Cdefs%3E%3ClinearGradient x1='94.0869141%25' y1='0%25' x2='94.0869141%25' y2='90.559082%25' id='linearGradient-1'%3E%3Cstop stop-color='%23606060' stop-opacity='0' offset='0%25'%3E%3C/stop%3E%3Cstop stop-color='%23606060' stop-opacity='0.3' offset='100%25'%3E%3C/stop%3E%3C/linearGradient%3E%3ClinearGradient x1='100%25' y1='8.67370605%25' x2='100%25' y2='90.6286621%25' id='linearGradient-2'%3E%3Cstop stop-color='%23606060' offset='0%25'%3E%3C/stop%3E%3Cstop stop-color='%23606060' stop-opacity='0.3' offset='100%25'%3E%3C/stop%3E%3C/linearGradient%3E%3C/defs%3E%3Cg stroke='none' stroke-width='1' fill='none' fill-rule='evenodd' opacity='0.9'%3E%3Cg%3E%3Cpath d='M40,0 C62.09139,0 80,17.90861 80,40 C80,62.09139 62.09139,80 40,80 L40,73 C58.2253967,73 73,58.2253967 73,40 C73,21.7746033 58.2253967,7 40,7 L40,0 Z' fill='url(%23linearGradient-1)'%3E%3C/path%3E%3Cpath d='M40,0 L40,7 C21.7746033,7 7,21.7746033 7,40 C7,58.2253967 21.7746033,73 40,73 L40,80 C17.90861,80 0,62.09139 0,40 C0,17.90861 17.90861,0 40,0 Z' fill='url(%23linearGradient-2)'%3E%3C/path%3E%3Ccircle id='Oval' fill='%23606060' cx='40.5' cy='3.5' r='3.5'%3E%3C/circle%3E%3C/g%3E%3CanimateTransform attributeName='transform' begin='0s' dur='1s' type='rotate' values='0 40 40;360 40 40' repeatCount='indefinite'/%3E%3C/g%3E%3C/svg%3E%0A") + no-repeat; + background-size: 100%; + } + .weui-btn_loading.weui-btn_primary .weui-loading, + .weui-loading.weui-icon_toast, + .weui-loading.weui-loading_transparent { + background-image: url("data:image/svg+xml,%3C%3Fxml version='1.0' encoding='UTF-8'%3F%3E%3Csvg width='160rpx' height='160rpx' viewBox='0 0 80 80' version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink'%3E%3Ctitle%3Eloading%3C/title%3E%3Cdefs%3E%3ClinearGradient x1='94.0869141%25' y1='0%25' x2='94.0869141%25' y2='90.559082%25' id='linearGradient-1'%3E%3Cstop stop-color='%23ededed' stop-opacity='0' offset='0%25'%3E%3C/stop%3E%3Cstop stop-color='%23ededed' stop-opacity='0.3' offset='100%25'%3E%3C/stop%3E%3C/linearGradient%3E%3ClinearGradient x1='100%25' y1='8.67370605%25' x2='100%25' y2='90.6286621%25' id='linearGradient-2'%3E%3Cstop stop-color='%23ededed' offset='0%25'%3E%3C/stop%3E%3Cstop stop-color='%23ededed' stop-opacity='0.3' offset='100%25'%3E%3C/stop%3E%3C/linearGradient%3E%3C/defs%3E%3Cg stroke='none' stroke-width='1' fill='none' fill-rule='evenodd' opacity='0.9'%3E%3Cg%3E%3Cpath d='M40,0 C62.09139,0 80,17.90861 80,40 C80,62.09139 62.09139,80 40,80 L40,73 C58.2253967,73 73,58.2253967 73,40 C73,21.7746033 58.2253967,7 40,7 L40,0 Z' fill='url(%23linearGradient-1)'%3E%3C/path%3E%3Cpath d='M40,0 L40,7 C21.7746033,7 7,21.7746033 7,40 C7,58.2253967 21.7746033,73 40,73 L40,80 C17.90861,80 0,62.09139 0,40 C0,17.90861 17.90861,0 40,0 Z' fill='url(%23linearGradient-2)'%3E%3C/path%3E%3Ccircle id='Oval' fill='%23ededed' cx='40.5' cy='3.5' r='3.5'%3E%3C/circle%3E%3C/g%3E%3CanimateTransform attributeName='transform' begin='0s' dur='1s' type='rotate' values='0 40 40;360 40 40' repeatCount='indefinite'/%3E%3C/g%3E%3C/svg%3E%0A"); + } + .weui-mask-loading { + display: inline-block; + vertical-align: middle; + font-size: 32rpx; + width: 1em; + height: 1em; + -webkit-mask: url("data:image/svg+xml,%3C%3Fxml version='1.0' encoding='UTF-8'%3F%3E%3Csvg width='160rpx' height='160rpx' viewBox='0 0 80 80' version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink'%3E%3Ctitle%3Eloading%3C/title%3E%3Cdefs%3E%3ClinearGradient x1='94.0869141%25' y1='0%25' x2='94.0869141%25' y2='90.559082%25' id='linearGradient-1'%3E%3Cstop stop-color='%23606060' stop-opacity='0' offset='0%25'%3E%3C/stop%3E%3Cstop stop-color='%23606060' stop-opacity='0.3' offset='100%25'%3E%3C/stop%3E%3C/linearGradient%3E%3ClinearGradient x1='100%25' y1='8.67370605%25' x2='100%25' y2='90.6286621%25' id='linearGradient-2'%3E%3Cstop stop-color='%23606060' offset='0%25'%3E%3C/stop%3E%3Cstop stop-color='%23606060' stop-opacity='0.3' offset='100%25'%3E%3C/stop%3E%3C/linearGradient%3E%3C/defs%3E%3Cg stroke='none' stroke-width='1' fill='none' fill-rule='evenodd' opacity='0.9'%3E%3Cg%3E%3Cpath d='M40,0 C62.09139,0 80,17.90861 80,40 C80,62.09139 62.09139,80 40,80 L40,73 C58.2253967,73 73,58.2253967 73,40 C73,21.7746033 58.2253967,7 40,7 L40,0 Z' fill='url(%23linearGradient-1)'%3E%3C/path%3E%3Cpath d='M40,0 L40,7 C21.7746033,7 7,21.7746033 7,40 C7,58.2253967 21.7746033,73 40,73 L40,80 C17.90861,80 0,62.09139 0,40 C0,17.90861 17.90861,0 40,0 Z' fill='url(%23linearGradient-2)'%3E%3C/path%3E%3Ccircle id='Oval' fill='%23606060' cx='40.5' cy='3.5' r='3.5'%3E%3C/circle%3E%3C/g%3E%3CanimateTransform attributeName='transform' begin='0s' dur='1s' type='rotate' values='0 40 40;360 40 40' repeatCount='indefinite'/%3E%3C/g%3E%3C/svg%3E%0A") + 0 0 no-repeat; + mask: url("data:image/svg+xml,%3C%3Fxml version='1.0' encoding='UTF-8'%3F%3E%3Csvg width='160rpx' height='160rpx' viewBox='0 0 80 80' version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink'%3E%3Ctitle%3Eloading%3C/title%3E%3Cdefs%3E%3ClinearGradient x1='94.0869141%25' y1='0%25' x2='94.0869141%25' y2='90.559082%25' id='linearGradient-1'%3E%3Cstop stop-color='%23606060' stop-opacity='0' offset='0%25'%3E%3C/stop%3E%3Cstop stop-color='%23606060' stop-opacity='0.3' offset='100%25'%3E%3C/stop%3E%3C/linearGradient%3E%3ClinearGradient x1='100%25' y1='8.67370605%25' x2='100%25' y2='90.6286621%25' id='linearGradient-2'%3E%3Cstop stop-color='%23606060' offset='0%25'%3E%3C/stop%3E%3Cstop stop-color='%23606060' stop-opacity='0.3' offset='100%25'%3E%3C/stop%3E%3C/linearGradient%3E%3C/defs%3E%3Cg stroke='none' stroke-width='1' fill='none' fill-rule='evenodd' opacity='0.9'%3E%3Cg%3E%3Cpath d='M40,0 C62.09139,0 80,17.90861 80,40 C80,62.09139 62.09139,80 40,80 L40,73 C58.2253967,73 73,58.2253967 73,40 C73,21.7746033 58.2253967,7 40,7 L40,0 Z' fill='url(%23linearGradient-1)'%3E%3C/path%3E%3Cpath d='M40,0 L40,7 C21.7746033,7 7,21.7746033 7,40 C7,58.2253967 21.7746033,73 40,73 L40,80 C17.90861,80 0,62.09139 0,40 C0,17.90861 17.90861,0 40,0 Z' fill='url(%23linearGradient-2)'%3E%3C/path%3E%3Ccircle id='Oval' fill='%23606060' cx='40.5' cy='3.5' r='3.5'%3E%3C/circle%3E%3C/g%3E%3CanimateTransform attributeName='transform' begin='0s' dur='1s' type='rotate' values='0 40 40;360 40 40' repeatCount='indefinite'/%3E%3C/g%3E%3C/svg%3E%0A") + 0 0 no-repeat; + -webkit-mask-size: cover; + mask-size: cover; + background-color: currentColor; + color: #606060; + } + .weui-slider { + padding: 30rpx 36rpx; + -webkit-user-select: none; + user-select: none; + } + .weui-slider__inner { + position: relative; + height: 4rpx; + background-color: var(--weui-FG-3); + } + .weui-slider__track { + height: 100%; + background-color: var(--weui-BRAND); + width: 0; + } + .weui-slider__handler { + position: absolute; + left: 0; + top: 50%; + width: 56rpx; + height: 56rpx; + margin-left: -28rpx; + margin-top: -28rpx; + border-radius: 50%; + background-color: #fff; + box-shadow: 0 0 8rpx var(--weui-FG-3); + } + .weui-slider-box { + display: -webkit-box; + display: -webkit-flex; + display: flex; + -webkit-box-align: center; + -webkit-align-items: center; + align-items: center; + } + .weui-slider-box .weui-slider { + -webkit-box-flex: 1; + -webkit-flex: 1; + flex: 1; + } + .weui-slider-box__value { + margin-left: 0.5em; + min-width: 48rpx; + color: var(--weui-FG-1); + text-align: center; + font-size: 28rpx; + } + .wx_dot_loading, + .wx_dot_loading:after, + .wx_dot_loading:before { + display: inline-block; + vertical-align: middle; + width: 12rpx; + height: 12rpx; + border-radius: 50%; + background-color: rgba(0, 0, 0, 0.3); + font-size: 0; + -webkit-animation: dot2 1.6s step-start infinite; + animation: dot2 1.6s step-start infinite; + } + .wx_dot_loading { + position: relative; + } + .wx_dot_loading:before { + content: ''; + position: absolute; + left: -24rpx; + background-color: rgba(0, 0, 0, 0.1); + -webkit-animation: dot1 1.6s step-start infinite; + animation: dot1 1.6s step-start infinite; + } + .wx_dot_loading:after { + content: ''; + position: absolute; + right: -24rpx; + background-color: rgba(0, 0, 0, 0.5); + -webkit-animation: dot3 1.6s step-start infinite; + animation: dot3 1.6s step-start infinite; + } + @-webkit-keyframes dot1 { + 0%, + to { + background-color: rgba(0, 0, 0, 0.1); + } + 30% { + background-color: rgba(0, 0, 0, 0.5); + } + 60% { + background-color: rgba(0, 0, 0, 0.3); + } + } + @keyframes dot1 { + 0%, + to { + background-color: rgba(0, 0, 0, 0.1); + } + 30% { + background-color: rgba(0, 0, 0, 0.5); + } + 60% { + background-color: rgba(0, 0, 0, 0.3); + } + } + @-webkit-keyframes dot2 { + 0%, + to { + background-color: rgba(0, 0, 0, 0.3); + } + 30% { + background-color: rgba(0, 0, 0, 0.1); + } + 60% { + background-color: rgba(0, 0, 0, 0.5); + } + } + @keyframes dot2 { + 0%, + to { + background-color: rgba(0, 0, 0, 0.3); + } + 30% { + background-color: rgba(0, 0, 0, 0.1); + } + 60% { + background-color: rgba(0, 0, 0, 0.5); + } + } + @-webkit-keyframes dot3 { + 0%, + to { + background-color: rgba(0, 0, 0, 0.5); + } + 30% { + background-color: rgba(0, 0, 0, 0.3); + } + 60% { + background-color: rgba(0, 0, 0, 0.1); + } + } + @keyframes dot3 { + 0%, + to { + background-color: rgba(0, 0, 0, 0.5); + } + 30% { + background-color: rgba(0, 0, 0, 0.3); + } + 60% { + background-color: rgba(0, 0, 0, 0.1); + } + } + .wx_dot_loading_white { + background-color: hsla(0, 0%, 100%, 0.3); + -webkit-animation: dotw2 1.6s step-start infinite; + animation: dotw2 1.6s step-start infinite; + } + .wx_dot_loading_white:before { + background-color: hsla(0, 0%, 100%, 0.5); + -webkit-animation: dotw1 1.6s step-start infinite; + animation: dotw1 1.6s step-start infinite; + } + .wx_dot_loading_white:after { + background-color: hsla(0, 0%, 100%, 0.1); + -webkit-animation: dotw3 1.6s step-start infinite; + animation: dotw3 1.6s step-start infinite; + } + @-webkit-keyframes dotw1 { + 0%, + to { + background-color: hsla(0, 0%, 100%, 0.5); + } + 30% { + background-color: hsla(0, 0%, 100%, 0.1); + } + 60% { + background-color: hsla(0, 0%, 100%, 0.3); + } + } + @keyframes dotw1 { + 0%, + to { + background-color: hsla(0, 0%, 100%, 0.5); + } + 30% { + background-color: hsla(0, 0%, 100%, 0.1); + } + 60% { + background-color: hsla(0, 0%, 100%, 0.3); + } + } + @-webkit-keyframes dotw2 { + 0%, + to { + background-color: hsla(0, 0%, 100%, 0.3); + } + 30% { + background-color: hsla(0, 0%, 100%, 0.5); + } + 60% { + background-color: hsla(0, 0%, 100%, 0.1); + } + } + @keyframes dotw2 { + 0%, + to { + background-color: hsla(0, 0%, 100%, 0.3); + } + 30% { + background-color: hsla(0, 0%, 100%, 0.5); + } + 60% { + background-color: hsla(0, 0%, 100%, 0.1); + } + } + @-webkit-keyframes dotw3 { + 0%, + to { + background-color: hsla(0, 0%, 100%, 0.1); + } + 30% { + background-color: hsla(0, 0%, 100%, 0.3); + } + 60% { + background-color: hsla(0, 0%, 100%, 0.5); + } + } + @keyframes dotw3 { + 0%, + to { + background-color: hsla(0, 0%, 100%, 0.1); + } + 30% { + background-color: hsla(0, 0%, 100%, 0.3); + } + 60% { + background-color: hsla(0, 0%, 100%, 0.5); + } + } + :host { + width: 100%; + } + .weui-slideview { + position: relative; + overflow: hidden; + } + .weui-slideview__left { + position: relative; + z-index: 10; + } + .weui-slideview__right { + position: absolute; + z-index: 1; + left: 100%; + top: 0; + height: 100%; + } + .weui-slideview__buttons { + height: 100%; + } + .weui-slideview__btn, + .weui-slideview__btn__wrp { + height: 100%; + display: -webkit-box; + display: -webkit-flex; + display: flex; + -webkit-box-align: center; + -webkit-align-items: center; + align-items: center; + -webkit-box-pack: center; + -webkit-justify-content: center; + justify-content: center; + } + .weui-slideview__btn__wrp { + position: absolute; + left: 0; + bottom: 0; + min-width: 138rpx; + white-space: nowrap; + } + .weui-slideview__btn { + -webkit-box-flex: 1; + -webkit-flex: 1; + flex: 1; + min-width: 0; + color: #fff; + padding: 0 34rpx; + text-align: center; + } + .weui-slideview__btn-group_default .weui-slideview__btn { + background: #c7c7cc; + } + [data-weui-theme='dark'] + .weui-slideview__btn-group_default + .weui-slideview__btn { + background: var(--weui-BG-4); + } + .weui-slideview__btn-group_default ~ .weui-slideview__btn-group_default:before { + content: ' '; + position: absolute; + left: 0; + top: 0; + width: 2rpx; + bottom: 0; + border-left: 2rpx solid #fff; + color: #fff; + -webkit-transform-origin: 0 0; + transform-origin: 0 0; + -webkit-transform: scaleX(0.5); + transform: scaleX(0.5); + } + [data-weui-theme='dark'] + .weui-slideview__btn-group_default + ~ .weui-slideview__btn-group_default:before { + border-left-color: var(--weui-FG-3); + } + .weui-slideview__btn-group_default:first-child:before { + display: none; + } + .weui-slideview__btn-group_warn .weui-slideview__btn { + background: #fe3b30; + } + .weui-slideview__btn-group_warn ~ .weui-slideview__btn-group_warn:before { + content: ' '; + position: absolute; + left: 0; + top: 0; + width: 2rpx; + bottom: 0; + border-left: 2rpx solid #fff; + color: #fff; + -webkit-transform-origin: 0 0; + transform-origin: 0 0; + -webkit-transform: scaleX(0.5); + transform: scaleX(0.5); + } + .weui-slideview__btn-group_warn:first-child:before { + display: none; + } + .weui-slideview_icon .weui-slideview__btn__wrp { + background: transparent; + font-size: 0; + } + .weui-slideview_icon .weui-slideview__btn__wrp:first-child { + padding-left: 32rpx; + } + .weui-slideview_icon .weui-slideview__btn__wrp:last-child { + padding-right: 16rpx; + } + .weui-slideview_icon .weui-slideview__btn { + -webkit-box-flex: 0; + -webkit-flex: none; + flex: none; + width: 96rpx; + height: 96rpx; + line-height: 96rpx; + padding: 0; + display: inline-block; + vertical-align: middle; + border-radius: 50%; + background-color: #fff; + } + [data-weui-theme='dark'] .weui-slideview_icon .weui-slideview__btn { + background-color: var(--weui-BG-4); + } + .weui-slideview_icon .weui-slideview__btn__icon { + display: inline-block; + vertical-align: middle; + width: 44rpx; + height: 44rpx; + } + page { + --height: 88rpx; + --right: 190rpx; + } + .weui-navigation-bar { + overflow: hidden; + color: var(--weui-FG-0); + } + .weui-navigation-bar .android { + --height: 96rpx; + --right: 222rpx; + } + .weui-navigation-bar__inner { + position: fixed; + top: 0; + left: 0; + z-index: 5001; + height: var(--height); + padding-right: var(--right); + width: calc(100% - var(--right)); + } + .weui-navigation-bar__inner, + .weui-navigation-bar__inner .weui-navigation-bar__left { + display: -webkit-box; + display: -webkit-flex; + display: flex; + -webkit-box-align: center; + -webkit-align-items: center; + align-items: center; + } + .weui-navigation-bar__inner .weui-navigation-bar__left { + position: relative; + width: var(--right); + padding-left: 32rpx; + } + .weui-navigation-bar__inner + .weui-navigation-bar__left + .weui-navigation-bar__btn { + display: inline-block; + vertical-align: middle; + background-repeat: no-repeat; + } + .weui-navigation-bar__inner + .weui-navigation-bar__left + .weui-navigation-bar__btn_goback { + font-size: 24rpx; + width: 1em; + height: 2em; + -webkit-mask: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='24' viewBox='0 0 12 24'%3E %3Cpath fill-opacity='.9' fill-rule='evenodd' d='M10 19.438L8.955 20.5l-7.666-7.79a1.02 1.02 0 0 1 0-1.42L8.955 3.5 10 4.563 2.682 12 10 19.438z'/%3E%3C/svg%3E") + no-repeat 50% 50%; + mask: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='24' viewBox='0 0 12 24'%3E %3Cpath fill-opacity='.9' fill-rule='evenodd' d='M10 19.438L8.955 20.5l-7.666-7.79a1.02 1.02 0 0 1 0-1.42L8.955 3.5 10 4.563 2.682 12 10 19.438z'/%3E%3C/svg%3E") + no-repeat 50% 50%; + -webkit-mask-size: cover; + mask-size: cover; + background-color: currentColor; + } + .weui-navigation-bar__inner + .weui-navigation-bar__left + .weui-navigation-bar__btn_goback:active { + opacity: 0.5; + } + .weui-navigation-bar__inner .weui-navigation-bar__center { + font-size: 34rpx; + text-align: center; + position: relative; + -webkit-box-flex: 1; + -webkit-flex: 1; + flex: 1; + display: -webkit-box; + display: -webkit-flex; + display: flex; + -webkit-box-align: center; + -webkit-align-items: center; + align-items: center; + -webkit-box-pack: center; + -webkit-justify-content: center; + justify-content: center; + } + .weui-navigation-bar__inner .weui-navigation-bar__loading { + margin-right: 8rpx; + display: -webkit-inline-box; + display: -webkit-inline-flex; + display: inline-flex; + -webkit-box-align: center; + -webkit-align-items: center; + align-items: center; + } + .weui-navigation-bar__inner .weui-navigation-bar__loading .weui-loading { + margin-left: 0; + } + .weui-navigation-bar__inner .weui-navigation-bar__right { + margin-right: 32rpx; + } + .weui-navigation-bar__placeholder { + height: var(--height); + background: var(--weui-BG-1); + position: relative; + z-index: 50; + } + .weui-uploader__hd { + display: block; + } + .weui-uploader__overview { + display: -webkit-box; + display: -webkit-flex; + display: flex; + -webkit-box-align: center; + -webkit-align-items: center; + align-items: center; + } + .weui-uploader__tips { + color: var(--weui-FG-2); + font-size: 28rpx; + line-height: 1.4; + padding-top: 8rpx; + } + .weui-uploader__img { + display: block; + width: 100%; + height: 100%; + } + .weui-gallery { + display: -webkit-box; + display: -webkit-flex; + display: flex; + -webkit-box-orient: vertical; + -webkit-box-direction: normal; + -webkit-flex-direction: column; + flex-direction: column; + -webkit-flex-wrap: nowrap; + flex-wrap: nowrap; + } + .weui-gallery__info { + color: #fff; + font-size: 34rpx; + line-height: 120rpx; + min-height: 120rpx; + text-align: center; + } + .weui-gallery__img__wrp { + -webkit-box-flex: 1; + -webkit-flex: 1; + flex: 1; + position: relative; + font-size: 0; + } + .weui-gallery__img { + position: absolute; + width: 100%; + height: 100%; + } + .weui-gallery__opr { + position: static; + } + .weui-search-bar .weui-search-bar__box .weui-search-bar__input { + height: inherit; + line-height: inherit; + } + .weui-search-bar .weui-search-bar__box .weui-icon-clear { + display: block; + } + .weui-loadmore .weui-loading { + margin-right: 0.3em; + } + .weui-btn_input-clear { + display: block; + } + .weui-agree__text { + display: inline; + } + @supports (-webkit-overflow-scrolling: touch) { + .weui-form .weui-agree__checkbox { + margin-top: -2rpx; + } + } + page { + height: 100%; + } + .page { + min-height: 100%; + background-color: var(--weui-BG-0); + color: var(--weui-FG-0); + font-size: 32rpx; + font-family: system-ui, -apple-system, Helvetica Neue, sans-serif; + } + image { + max-width: 100%; + max-height: 100%; + } + .link { + display: inline; + color: var(--weui-LINK); + } + .fadeIn { + -webkit-animation: fadeIn 0.3s forwards; + animation: fadeIn 0.3s forwards; + } + .fadeOut { + -webkit-animation: fadeOut 0.3s forwards; + animation: fadeOut 0.3s forwards; + } + @-webkit-keyframes fadeIn { + 0% { + opacity: 0; + } + to { + opacity: 1; + } + } + @keyframes fadeIn { + 0% { + opacity: 0; + } + to { + opacity: 1; + } + } + @-webkit-keyframes fadeOut { + 0% { + opacity: 1; + } + to { + opacity: 0; + } + } + @keyframes fadeOut { + 0% { + opacity: 1; + } + to { + opacity: 0; + } + } + .weui-msg__extra-area { + position: static; + } + .page__hd { + padding: 80rpx; + } + .page__bd { + padding-bottom: 80rpx; + } + .page__bd_spacing { + padding-left: 30rpx; + padding-right: 30rpx; + } + .page__ft { + padding-top: 80rpx; + padding-bottom: 20rpx; + padding-bottom: calc(20rpx + constant(safe-area-inset-bottom)); + padding-bottom: calc(20rpx + env(safe-area-inset-bottom)); + text-align: center; + } + [data-weui-theme='dark'] .page__ft image { + -webkit-filter: invert(100) hue-rotate(180deg); + filter: invert(100) hue-rotate(180deg); + } + .page__title { + text-align: left; + font-size: 40rpx; + font-weight: 400; + } + .page__desc { + margin-top: 10rpx; + color: var(--weui-FG-1); + text-align: left; + font-size: 28rpx; + } + .weui-cell_example:before { + left: 104rpx; + } \ No newline at end of file diff --git a/weapp/components/schedule-details/schedule-details.js b/weapp/components/schedule-details/schedule-details.js new file mode 100644 index 0000000..515b027 --- /dev/null +++ b/weapp/components/schedule-details/schedule-details.js @@ -0,0 +1,306 @@ +// 在 Component 外部定义防抖函数 +function debounce(func, wait) { + let timeout; + return function() { + const context = this; + const args = arguments; + clearTimeout(timeout); + timeout = setTimeout(() => { + func.apply(context, args); + }, wait); + }; +} + +Component({ + properties: { + show: { + type: Boolean, + value: false + }, + loadingDetails: { + type: Boolean, + value: true + }, + scheduleInfo: { + type: Object, + value: {}, + observer: function(newVal) { + console.log("scheduleInfo changed:", newVal); + if (newVal && (newVal.startTime || newVal.timeFrom)) { + const date = new Date(newVal.startTime || newVal.timeFrom); + this.setData({ + 'scheduleInfo.dateStr': `${date.getFullYear()}-${String(date.getMonth() + 1).padStart(2, '0')}-${String(date.getDate()).padStart(2, '0')}`, + 'scheduleInfo.timeStr': `${String(date.getHours()).padStart(2, '0')}:${String(date.getMinutes()).padStart(2, '0')}` + }); + } + if (newVal && newVal.alarmOffset !== undefined) { + this.setScheduleAlarmText(newVal.alarmOffset); + } + } + }, + lastScheduleType: { + type: Number, + value: 0 + }, + lastScheduleText: { + type: String, + value: '' + }, + keyboardHeight: { + type: Number, + value: 0 + }, + loading: { + type: Boolean, + value: false + }, + isNewSchedule: { + type: Boolean, + value: true + } + }, + + data: { + alarmOptions: [ + { label: '不提醒', value: -1 }, + { label: '日程开始时', value: 0 }, + { label: '提前 5 分钟', value: 300 }, + { label: '提前 15 分钟', value: 900 }, + { label: '提前 30 分钟', value: 1800 }, + { label: '提前 1 小时', value: 3600 }, + { label: '提前 2 小时', value: 7200 }, + { label: '提前 1 天', value: 86400 }, + { label: '提前 2 天', value: 172800 }, + { label: '提前 1 周', value: 604800 }, + ], + alarmOptionsMap: {}, + scheduleAlarmText: '日程开始时', + scheduleAlarmOffset: 0, + reminderIndex: 1, // 默认选中 "日程开始时" + showReminderOptions: false, + selectedReminder: '', // 存储当前选中的提醒选项, + keyboardHeight: 0, + textareaHeight: 100, // 初始高度 + }, + + lifetimes: { + attached() { + this.initAlarmOptionsMap(); + } + }, + + methods: { + initAlarmOptionsMap() { + const map = {}; + this.data.alarmOptions.forEach(option => { + map[option.value] = option.label; + }); + this.setData({ alarmOptionsMap: map }); + }, + + onHide() { + this.triggerEvent('hide'); + }, + + onScheduleCreate() { + const { scheduleInfo } = this.data; + // 确保 alarmOffset 有默认值 + if (scheduleInfo.alarmOffset === undefined) { + scheduleInfo.alarmOffset = 0; // 默认为日程开始时 + } + + wx.addPhoneCalendar({ + title: scheduleInfo.title, + startTime: (scheduleInfo.timeFrom || scheduleInfo.startTime) / 1000, + description: scheduleInfo.description, + location: scheduleInfo.location, + alarm: scheduleInfo.alarmOffset !== -1, + alarmOffset: scheduleInfo.alarmOffset, + success: () => { + this.createScheduleOnServer(scheduleInfo); + getApp().logOperation(this.data.lastScheduleType, true, ""); + this.showSuccessNotification(); + this.handleInviteComment(); + // 触发刷新事件 + this.triggerEvent('refresh'); + }, + fail: (e) => { + this.handleAddCalendarFail(e, scheduleInfo); + } + }); + }, + + showSuccessNotification() { + wx.showToast({ + title: '日程创建成功', + icon: 'success', + duration: 2000 + }); + }, + + handleInviteComment() { + if (!getApp().globalData.inviteComment) { + this.setData({ show: false }); + return; + } + + wx.showModal({ + title: '喜欢我们的小程序吗?', + content: '请留下您的宝贵意见和建议吧!您的评价对我们很重要,能让我们走的更长更远!', + confirmText: '愿意推荐', + cancelText: '不好用', + success: (res) => { + if (res.confirm) { + this.openCommentPlugin(); + } else if (res.cancel) { + getApp().commentInvited(); + } + } + }); + }, + createScheduleOnServer(scheduleInfo) { + wx.request({ + url: getApp().globalData.ADMIN_HOST + '/schedules', + method: 'POST', + header: { + 'x-api-key': getApp().globalData.API_KEY + }, + data: { + title: scheduleInfo.title, + location: scheduleInfo.location, + openid: getApp().globalData.openid, + startTime: (scheduleInfo.timeFrom || scheduleInfo.startTime), + description: scheduleInfo.description, + alarmOffset: scheduleInfo.alarmOffset + }, + success: (res) => { + console.log("请求成功:", res); + }, + fail: (res) => { + console.log("请求失败:", res); + } + }); + }, + + handleAddCalendarFail(e, scheduleInfo) { + const errMsg = e.errMsg; + let userWarnTip, operationLogMsg; + const scheduleInfoStr = `title:${scheduleInfo.title}, startTime:${scheduleInfo.timeFrom}, startTimeStr:${new Date(scheduleInfo.timeFrom).toLocaleString()}, location:${scheduleInfo.location}`; + + if (errMsg === 'addPhoneCalendar:fail cancel') { + userWarnTip = "取消创建日程"; + operationLogMsg = "用户取消创建日程"; + } else if (errMsg === 'addPhoneCalendar:fail need startTime') { + userWarnTip = "需要填写开始时间,请重新选择正确的开始时间"; + operationLogMsg = "开始时间未填"; + } else if (errMsg === 'addPhoneCalendar:fail:wrong format:title or startTime') { + userWarnTip = "请检查日程标题和开始时间是否正确填写"; + operationLogMsg = "标题和开始时间格式不正确"; + } else if (errMsg === 'addPhoneCalendar:fail auth deny') { + userWarnTip = "本程序需要「添加日历」的权限,请返回首页再次操作,并授予权限"; + operationLogMsg = "未授予权限"; + } else if (errMsg === 'addPhoneCalendar:fail:not supported') { + userWarnTip = '请在手机端上使用,不支持在PC上使用'; + operationLogMsg = "不支持"; + } else { + userWarnTip = errMsg; + operationLogMsg = errMsg; + } + + wx.showToast({ + title: userWarnTip, + icon: 'none', + duration: 3000 + }); + + getApp().logOperation(this.data.lastScheduleType + (scheduleInfo.scheduleFromCache ? 20 : 10), false, operationLogMsg + scheduleInfoStr); + }, + + onRetry() { + this.triggerEvent('retry', { text: this.properties.lastScheduleText }); + }, + + onReminderChange(e) { + const selectedValue = this.data.alarmOptions[e.detail.value].value; + this.setData({ + 'scheduleInfo.alarmOffset': selectedValue + }); + }, + + setScheduleAlarmText(offset) { + const offsetMap = [-1, 0, 5 * 60, 10 * 60, 15 * 60, 30 * 60, 60 * 60, 2 * 60 * 60, 24 * 60 * 60, 2 * 24 * 60 * 60, 7 * 24 * 60 * 60]; + const index = offsetMap.indexOf(offset); + if (index !== -1) { + this.setData({ + scheduleAlarmText: this.data.alarmOptions[index], + reminderIndex: index + }); + } + }, + + onTitleInput: debounce(function(e) { + this.setData({ + 'scheduleInfo.title': e.detail.value, + title: e.detail.value || '新建日程' // 更新顶部标题 + }); + }, 300), + + onLocationInput: debounce(function(e) { + this.setData({ 'scheduleInfo.location': e.detail.value }); + }, 300), + + onDescriptionInput: debounce(function(e) { + // 立即更新输入值 + console.log("onDescriptionInput", e.detail.value); + this.setData({ 'scheduleInfo.description': e.detail.value }); + },300), + + onDateChange(e) { + this.setData({ 'scheduleInfo.dateStr': e.detail.value }); + this.updateTimeFrom(); + }, + + onTimeChange(e) { + this.setData({ 'scheduleInfo.timeStr': e.detail.value }); + this.updateTimeFrom(); + }, + + updateTimeFrom() { + const { dateStr, timeStr } = this.data.scheduleInfo; + if (dateStr && timeStr) { + const newTimeFrom = new Date(`${dateStr} ${timeStr}`).getTime(); + this.setData({ 'scheduleInfo.timeFrom': newTimeFrom }); + } + }, + + onRecreateSchedule() { + // 实现再次创建日程的逻辑 + this.onScheduleCreate(); + }, + + onInputFocus(e) { + // 获取当前获得焦点的输入框的位置信息 + const query = wx.createSelectorQuery().in(this); + query.select(`.${e.target.dataset.class}`).boundingClientRect(); + query.selectViewport().scrollOffset(); + query.exec((res) => { + if (res && res[0] && res[1]) { + const inputTop = res[0].top; + const scrollTop = res[1].scrollTop; + const viewportHeight = wx.getSystemInfoSync().windowHeight; + + // 计算需要滚动的距离 + const scrollDistance = inputTop - (viewportHeight / 2) + scrollTop; + + // 滚动到合适的位置 + wx.pageScrollTo({ + scrollTop: scrollDistance, + duration: 300 + }); + } else { + console.error('Failed to get element position', res); + } + }); + }, + } +}); diff --git a/weapp/components/schedule-details/schedule-details.json b/weapp/components/schedule-details/schedule-details.json new file mode 100644 index 0000000..e8cfaaf --- /dev/null +++ b/weapp/components/schedule-details/schedule-details.json @@ -0,0 +1,4 @@ +{ + "component": true, + "usingComponents": {} +} \ No newline at end of file diff --git a/weapp/components/schedule-details/schedule-details.wxml b/weapp/components/schedule-details/schedule-details.wxml new file mode 100644 index 0000000..2499050 --- /dev/null +++ b/weapp/components/schedule-details/schedule-details.wxml @@ -0,0 +1,100 @@ + + + + + + + + × + + + + + + + + + + + + + + + + + + 📍 + + + + + + + + 📅 + + {{scheduleInfo.dateStr}} + + + + 🕒 + + {{scheduleInfo.timeStr}} + + + + + 🔔 + + {{(scheduleInfo.alarmOffset !== undefined && alarmOptionsMap[scheduleInfo.alarmOffset]) || alarmOptionsMap[0]}} + + + + + + + + + + + + + + + + + + + + + + diff --git a/weapp/components/schedule-details/schedule-details.wxss b/weapp/components/schedule-details/schedule-details.wxss new file mode 100644 index 0000000..c8faf65 --- /dev/null +++ b/weapp/components/schedule-details/schedule-details.wxss @@ -0,0 +1,381 @@ +.details-container { + position: fixed; + bottom: 0; + left: 0; + right: 0; + max-height: 90vh; /* 设置最大高度 */ + background-color: white; + border-top-left-radius: 24rpx; + border-top-right-radius: 24rpx; + box-shadow: 0 -4rpx 20rpx rgba(0, 0, 0, 0.1); + transform: translateY(100%); + transition: transform 0.3s ease-out, bottom 0.3s ease-out; + display: flex; + flex-direction: column; + z-index: 1001; /* 确保在蒙版之上 */ +} + +.details-container.show { + transform: translateY(0); +} + +.drag-indicator { + position: absolute; + top: 12rpx; + left: 50%; + transform: translateX(-50%); + width: 80rpx; + height: 4rpx; + background-color: #e0e0e0; + border-radius: 4rpx; +} + +.details-content { + flex-grow: 1; + overflow-y: auto; + -webkit-overflow-scrolling: touch; +} + +.content-wrapper { + padding: 40rpx 40rpx 120rpx 40rpx; /* 增加右边距 */ +} + +.close-button { + position: absolute; + top: 20rpx; + right: 20rpx; + padding: 10rpx; +} + +.icon-x { + font-size: 32rpx; + color: #999; +} + +.title { + font-size: 36rpx; + font-weight: bold; + color: #333; + margin-bottom: 30rpx; + padding-right: 20rpx; /* 为这些元素添加右边距 */ +} + +.detail-item { + margin-bottom: 30rpx; +} + +.border-bottom { + border-bottom: 1rpx solid #e0e0e0; + padding-bottom: 20rpx; +} + +.detail-title { + font-size: 32rpx; + font-weight: 600; + color: #333; + margin-bottom: 10rpx; + width: 100%; +} + +.location { + display: flex; + align-items: center; + font-size: 24rpx; + color: #666; + padding-right: 20rpx; /* 为这些元素添加右边距 */ +} + +.location input { + flex: 1; +} + +.icon-map-pin { + margin-right: 10rpx; + color: #4a90e2; +} + +.time-reminder { + display: flex; + justify-content: space-between; + align-items: center; + margin-bottom: 30rpx; + padding-right: 20rpx; /* 为这些元素添加右边距 */ +} + +.time-info { + display: flex; + align-items: center; +} + +.date, .time { + display: flex; + align-items: center; + font-size: 28rpx; + color: #333; + margin-right: 30rpx; +} + +.date .picker, .time .picker { + padding: 10rpx; + min-width: 120rpx; + color: #4a90e2; + font-weight: 500; +} + +.date input, .time input { + width: 120rpx; +} + +.icon-calendar, .icon-clock { + margin-right: 10rpx; +} + +.icon-calendar { + color: #4caf50; +} + +.icon-clock { + color: #ff9800; +} + +.reminder { + display: flex; + align-items: center; +} + +.reminder .weui-select { + padding: 10rpx; + font-size: 24rpx; + color: #4a90e2; + font-weight: 500; +} + +.icon-bell { + margin-right: 10rpx; + color: #4a90e2; +} + +.icon-chevron-down { + margin-left: 10rpx; + font-size: 20rpx; + color: #999; +} + +.description { + background-color: #f5f5f5; + padding: 20rpx; + border-radius: 10rpx; + font-size: 28rpx; + color: #333; + line-height: 1.5; + margin-bottom: 40rpx; /* 减小底部边距,原来是 120rpx */ + padding-right: 20rpx; +} + +.description textarea { + width: 100%; + padding-right: 20rpx; + min-height: 100px; /* 设置最小高度 */ +} + +.footer { + position: absolute; + bottom: 0; + left: 0; + right: 0; + padding: 20rpx 40rpx; /* 增加上下内边距 */ + background-color: #fff; + border-top: 1rpx solid #e0e0e0; + display: flex; + justify-content: space-between; + z-index: 1002; + box-shadow: 0 -2rpx 10rpx rgba(0, 0, 0, 0.1); +} + +.buttons { + display: flex; + justify-content: space-between; +} + +.footer-button { + flex: 1; + margin: 0 10rpx; + padding: 15rpx 0; /* 减小按钮的上下内边距 */ + border: none; + border-radius: 8rpx; /* 稍微减小圆角 */ + font-size: 28rpx; + display: flex; + align-items: center; + justify-content: center; + transition: all 0.3s ease; +} + +.retry { + background-color: #f0f0f0; + color: #333; +} + +.retry:active { + background-color: #e0e0e0; +} + +.create { + background-color: #4caf50; + color: white; +} + +.create:active { + background-color: #45a049; +} + +.icon-refresh-cw, .icon-plus { + margin-right: 8rpx; /* 稍微减小图标和文字的间距 */ + font-size: 28rpx; /* 减小图标大小 */ +} + +.reminder-options { + position: fixed; + bottom: 0; + left: 0; + right: 0; + height: 0; + background-color: rgba(0, 0, 0, 0.5); + transition: height 0.3s ease-out; + z-index: 2000; +} + +.reminder-options.show { + height: 100%; +} + +.options-content { + position: absolute; + bottom: 0; + left: 0; + right: 0; + height: 50%; + background-color: #fff; + border-top-left-radius: 20rpx; + border-top-right-radius: 20rpx; + overflow: hidden; + display: flex; + flex-direction: column; +} + +.options-header { + display: flex; + justify-content: space-between; + align-items: center; + padding: 20rpx; + border-bottom: 1rpx solid #e0e0e0; +} + +.cancel-btn, .confirm-btn { + font-size: 28rpx; + color: #007AFF; +} + +.title { + font-size: 32rpx; + font-weight: bold; +} + +.options-list { + flex: 1; + overflow-y: auto; +} + +.option { + padding: 30rpx 0; + text-align: center; + font-size: 30rpx; + border-bottom: 1rpx solid #e0e0e0; +} + +.option.selected { + background-color: #f0f0f0; + color: #007AFF; +} + +input, textarea { + border: 1px solid transparent; + padding: 5rpx; + border-radius: 5rpx; + font-size: 28rpx; + background-color: #f5f5f5; + width: 100%; + box-sizing: border-box; +} + +input:focus, textarea:focus { + border-color: #4a90e2; + outline: none; + background-color: #ffffff; +} + +.mask { + position: fixed; + top: 0; + left: 0; + right: 0; + bottom: 0; + background-color: rgba(0, 0, 0, 0.5); + z-index: 1000; + opacity: 0; + visibility: hidden; + transition: opacity 0.3s ease-out, visibility 0.3s ease-out; +} + +.mask.show { + opacity: 1; + visibility: visible; +} + +.edit-area { + position: absolute; + left: 0; + right: 0; + bottom: 0; + background-color: white; + padding: 20rpx; + transition: bottom 0.3s; + z-index: 1000; +} + +.skeleton-loading { + padding: 20px; +} + +.skeleton-title { + height: 24px; + background-color: #f0f0f0; + margin-bottom: 15px; + border-radius: 4px; +} + +.skeleton-text { + height: 16px; + background-color: #f0f0f0; + margin-bottom: 10px; + border-radius: 4px; +} + +.skeleton-text:last-child { + width: 80%; +} + +@keyframes shimmer { + 0% { + background-position: -200% 0; + } + 100% { + background-position: 200% 0; + } +} + +.skeleton-loading .skeleton-title, +.skeleton-loading .skeleton-text { + background-image: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%); + background-size: 200% 100%; + animation: shimmer 1.5s infinite; +} diff --git a/weapp/components/sidebar/sidebar.js b/weapp/components/sidebar/sidebar.js new file mode 100644 index 0000000..87271e1 --- /dev/null +++ b/weapp/components/sidebar/sidebar.js @@ -0,0 +1,45 @@ +Component({ + properties: { + show: { + type: Boolean, + value: false + }, + userInfo: { + type: Object, + value: {} + }, + isHistoryView: { + type: Boolean, + value: false + } + }, + data: { + statusBarHeight: 0, + headerHeight: 44 // 假设 custom-header 的高度是 44px + }, + lifetimes: { + attached() { + const systemInfo = wx.getSystemInfoSync(); + this.setData({ + statusBarHeight: systemInfo.statusBarHeight + }); + } + }, + methods: { + closeSidebar() { + this.triggerEvent('close'); + }, + onSwitchToWelcome() { + if (this.properties.isHistoryView) { + this.triggerEvent('toggleView'); + } + this.closeSidebar(); + }, + onSwitchToHistory() { + if (!this.properties.isHistoryView) { + this.triggerEvent('toggleView'); + } + this.closeSidebar(); + } + } +}); diff --git a/weapp/components/sidebar/sidebar.json b/weapp/components/sidebar/sidebar.json new file mode 100644 index 0000000..6d1e729 --- /dev/null +++ b/weapp/components/sidebar/sidebar.json @@ -0,0 +1,5 @@ +{ + "component": true, + "usingComponents": {} + } + \ No newline at end of file diff --git a/weapp/components/sidebar/sidebar.wxml b/weapp/components/sidebar/sidebar.wxml new file mode 100644 index 0000000..cd9b443 --- /dev/null +++ b/weapp/components/sidebar/sidebar.wxml @@ -0,0 +1,24 @@ + + + + + + + + × + + + + 👋 + 欢迎 + + + 📅 + 历史任务 + + + + 版本 1.0.0 + + + diff --git a/weapp/components/sidebar/sidebar.wxss b/weapp/components/sidebar/sidebar.wxss new file mode 100644 index 0000000..eea79ba --- /dev/null +++ b/weapp/components/sidebar/sidebar.wxss @@ -0,0 +1,117 @@ +.sidebar-container { + position: fixed; + top: 0; + left: 0; + width: 100%; + height: 100%; + z-index: 1000; + pointer-events: none; +} + +.sidebar-container.show { + pointer-events: auto; +} + +.sidebar-mask { + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100%; + background-color: rgba(0, 0, 0, 0.5); + opacity: 0; + transition: opacity 0.3s ease-out; +} + +.sidebar-container.show .sidebar-mask { + opacity: 1; +} + +.sidebar-content { + position: absolute; + top: 0; + left: 0; + width: 80%; + height: 100%; + background-color: #6fa087; + box-shadow: 0 0 20px rgba(0, 0, 0, 0.1); + transition: transform 0.3s ease-out; + display: flex; + flex-direction: column; + box-sizing: border-box; + transform: translateX(-100%); +} + +.sidebar-container.show .sidebar-content { + transform: translateX(0); +} + +.sidebar-header { + padding: 60rpx 40rpx; /* 将顶部内边距从 40rpx 增加到 60rpx */ + position: relative; +} + +.user-avatar { + width: 120rpx; + height: 120rpx; + border-radius: 60rpx; + overflow: hidden; +} + +.user-avatar image { + width: 100%; + height: 100%; + object-fit: cover; +} + +.close-button { + position: absolute; + top: 100rpx; + right: 50rpx; + width: 60rpx; + height: 60rpx; + display: flex; + justify-content: center; + align-items: center; + font-size: 40rpx; + color: #fff; + background-color: rgba(255, 255, 255, 0.2); + border-radius: 30rpx; +} + +.sidebar-menu { + flex: 1; + padding: 20rpx 0; +} + +.menu-item { + display: flex; + align-items: center; + padding: 30rpx 40rpx; + font-size: 28rpx; + color: #fff; + transition: background-color 0.3s; +} + +.menu-item:active { + background-color: rgba(255, 255, 255, 0.1); +} + +.menu-icon { + font-size: 40rpx; + margin-right: 20rpx; + width: 40rpx; + text-align: center; +} + +.sidebar-footer { + padding: 20rpx 40rpx; + border-top: 1rpx solid rgba(255, 255, 255, 0.2); +} + +.version-info { + text-align: center; + font-size: 24rpx; + color: rgba(255, 255, 255, 0.7); + margin-top: 20rpx; +} diff --git a/weapp/index.html b/weapp/index.html new file mode 100644 index 0000000..faeb959 --- /dev/null +++ b/weapp/index.html @@ -0,0 +1,46 @@ + + + + 日程捕手 + + + + + +

欢迎使用日程捕手

+ +

简介:智能的帮助完成工作生活中的繁琐小事。目前实现:1. 从文本,图片,文件中识别并创建日程信息;

+ +

每次开庭总担心记错时间,到了法院开始找传票确认具体法庭。现在有了日程捕手,只需要拍一张照片或者上传一份PDF,就可以自动识别日程,并在手机系统上为你创建,再也不用手写日历了。另外保全期限也可以在这里直接添加,欢迎试用

+ +

请扫描下方的二维码或点击链接以开始使用我们的小程序:

+ + QR Code + +

或者,您也可以点击以下链接:

+ + 立即使用 + + \ No newline at end of file diff --git a/weapp/miniprogram_npm/blueimp-md5/index.js b/weapp/miniprogram_npm/blueimp-md5/index.js new file mode 100644 index 0000000..1813905 --- /dev/null +++ b/weapp/miniprogram_npm/blueimp-md5/index.js @@ -0,0 +1,415 @@ +module.exports = (function() { +var __MODS__ = {}; +var __DEFINE__ = function(modId, func, req) { var m = { exports: {}, _tempexports: {} }; __MODS__[modId] = { status: 0, func: func, req: req, m: m }; }; +var __REQUIRE__ = function(modId, source) { if(!__MODS__[modId]) return require(source); if(!__MODS__[modId].status) { var m = __MODS__[modId].m; m._exports = m._tempexports; var desp = Object.getOwnPropertyDescriptor(m, "exports"); if (desp && desp.configurable) Object.defineProperty(m, "exports", { set: function (val) { if(typeof val === "object" && val !== m._exports) { m._exports.__proto__ = val.__proto__; Object.keys(val).forEach(function (k) { m._exports[k] = val[k]; }); } m._tempexports = val }, get: function () { return m._tempexports; } }); __MODS__[modId].status = 1; __MODS__[modId].func(__MODS__[modId].req, m, m.exports); } return __MODS__[modId].m.exports; }; +var __REQUIRE_WILDCARD__ = function(obj) { if(obj && obj.__esModule) { return obj; } else { var newObj = {}; if(obj != null) { for(var k in obj) { if (Object.prototype.hasOwnProperty.call(obj, k)) newObj[k] = obj[k]; } } newObj.default = obj; return newObj; } }; +var __REQUIRE_DEFAULT__ = function(obj) { return obj && obj.__esModule ? obj.default : obj; }; +__DEFINE__(1692159285361, function(require, module, exports) { +/* + * JavaScript MD5 + * https://github.com/blueimp/JavaScript-MD5 + * + * Copyright 2011, Sebastian Tschan + * https://blueimp.net + * + * Licensed under the MIT license: + * https://opensource.org/licenses/MIT + * + * Based on + * A JavaScript implementation of the RSA Data Security, Inc. MD5 Message + * Digest Algorithm, as defined in RFC 1321. + * Version 2.2 Copyright (C) Paul Johnston 1999 - 2009 + * Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet + * Distributed under the BSD License + * See http://pajhome.org.uk/crypt/md5 for more info. + */ + +/* global define */ + +/* eslint-disable strict */ + +;(function ($) { + + + /** + * Add integers, wrapping at 2^32. + * This uses 16-bit operations internally to work around bugs in interpreters. + * + * @param {number} x First integer + * @param {number} y Second integer + * @returns {number} Sum + */ + function safeAdd(x, y) { + var lsw = (x & 0xffff) + (y & 0xffff) + var msw = (x >> 16) + (y >> 16) + (lsw >> 16) + return (msw << 16) | (lsw & 0xffff) + } + + /** + * Bitwise rotate a 32-bit number to the left. + * + * @param {number} num 32-bit number + * @param {number} cnt Rotation count + * @returns {number} Rotated number + */ + function bitRotateLeft(num, cnt) { + return (num << cnt) | (num >>> (32 - cnt)) + } + + /** + * Basic operation the algorithm uses. + * + * @param {number} q q + * @param {number} a a + * @param {number} b b + * @param {number} x x + * @param {number} s s + * @param {number} t t + * @returns {number} Result + */ + function md5cmn(q, a, b, x, s, t) { + return safeAdd(bitRotateLeft(safeAdd(safeAdd(a, q), safeAdd(x, t)), s), b) + } + /** + * Basic operation the algorithm uses. + * + * @param {number} a a + * @param {number} b b + * @param {number} c c + * @param {number} d d + * @param {number} x x + * @param {number} s s + * @param {number} t t + * @returns {number} Result + */ + function md5ff(a, b, c, d, x, s, t) { + return md5cmn((b & c) | (~b & d), a, b, x, s, t) + } + /** + * Basic operation the algorithm uses. + * + * @param {number} a a + * @param {number} b b + * @param {number} c c + * @param {number} d d + * @param {number} x x + * @param {number} s s + * @param {number} t t + * @returns {number} Result + */ + function md5gg(a, b, c, d, x, s, t) { + return md5cmn((b & d) | (c & ~d), a, b, x, s, t) + } + /** + * Basic operation the algorithm uses. + * + * @param {number} a a + * @param {number} b b + * @param {number} c c + * @param {number} d d + * @param {number} x x + * @param {number} s s + * @param {number} t t + * @returns {number} Result + */ + function md5hh(a, b, c, d, x, s, t) { + return md5cmn(b ^ c ^ d, a, b, x, s, t) + } + /** + * Basic operation the algorithm uses. + * + * @param {number} a a + * @param {number} b b + * @param {number} c c + * @param {number} d d + * @param {number} x x + * @param {number} s s + * @param {number} t t + * @returns {number} Result + */ + function md5ii(a, b, c, d, x, s, t) { + return md5cmn(c ^ (b | ~d), a, b, x, s, t) + } + + /** + * Calculate the MD5 of an array of little-endian words, and a bit length. + * + * @param {Array} x Array of little-endian words + * @param {number} len Bit length + * @returns {Array} MD5 Array + */ + function binlMD5(x, len) { + /* append padding */ + x[len >> 5] |= 0x80 << len % 32 + x[(((len + 64) >>> 9) << 4) + 14] = len + + var i + var olda + var oldb + var oldc + var oldd + var a = 1732584193 + var b = -271733879 + var c = -1732584194 + var d = 271733878 + + for (i = 0; i < x.length; i += 16) { + olda = a + oldb = b + oldc = c + oldd = d + + a = md5ff(a, b, c, d, x[i], 7, -680876936) + d = md5ff(d, a, b, c, x[i + 1], 12, -389564586) + c = md5ff(c, d, a, b, x[i + 2], 17, 606105819) + b = md5ff(b, c, d, a, x[i + 3], 22, -1044525330) + a = md5ff(a, b, c, d, x[i + 4], 7, -176418897) + d = md5ff(d, a, b, c, x[i + 5], 12, 1200080426) + c = md5ff(c, d, a, b, x[i + 6], 17, -1473231341) + b = md5ff(b, c, d, a, x[i + 7], 22, -45705983) + a = md5ff(a, b, c, d, x[i + 8], 7, 1770035416) + d = md5ff(d, a, b, c, x[i + 9], 12, -1958414417) + c = md5ff(c, d, a, b, x[i + 10], 17, -42063) + b = md5ff(b, c, d, a, x[i + 11], 22, -1990404162) + a = md5ff(a, b, c, d, x[i + 12], 7, 1804603682) + d = md5ff(d, a, b, c, x[i + 13], 12, -40341101) + c = md5ff(c, d, a, b, x[i + 14], 17, -1502002290) + b = md5ff(b, c, d, a, x[i + 15], 22, 1236535329) + + a = md5gg(a, b, c, d, x[i + 1], 5, -165796510) + d = md5gg(d, a, b, c, x[i + 6], 9, -1069501632) + c = md5gg(c, d, a, b, x[i + 11], 14, 643717713) + b = md5gg(b, c, d, a, x[i], 20, -373897302) + a = md5gg(a, b, c, d, x[i + 5], 5, -701558691) + d = md5gg(d, a, b, c, x[i + 10], 9, 38016083) + c = md5gg(c, d, a, b, x[i + 15], 14, -660478335) + b = md5gg(b, c, d, a, x[i + 4], 20, -405537848) + a = md5gg(a, b, c, d, x[i + 9], 5, 568446438) + d = md5gg(d, a, b, c, x[i + 14], 9, -1019803690) + c = md5gg(c, d, a, b, x[i + 3], 14, -187363961) + b = md5gg(b, c, d, a, x[i + 8], 20, 1163531501) + a = md5gg(a, b, c, d, x[i + 13], 5, -1444681467) + d = md5gg(d, a, b, c, x[i + 2], 9, -51403784) + c = md5gg(c, d, a, b, x[i + 7], 14, 1735328473) + b = md5gg(b, c, d, a, x[i + 12], 20, -1926607734) + + a = md5hh(a, b, c, d, x[i + 5], 4, -378558) + d = md5hh(d, a, b, c, x[i + 8], 11, -2022574463) + c = md5hh(c, d, a, b, x[i + 11], 16, 1839030562) + b = md5hh(b, c, d, a, x[i + 14], 23, -35309556) + a = md5hh(a, b, c, d, x[i + 1], 4, -1530992060) + d = md5hh(d, a, b, c, x[i + 4], 11, 1272893353) + c = md5hh(c, d, a, b, x[i + 7], 16, -155497632) + b = md5hh(b, c, d, a, x[i + 10], 23, -1094730640) + a = md5hh(a, b, c, d, x[i + 13], 4, 681279174) + d = md5hh(d, a, b, c, x[i], 11, -358537222) + c = md5hh(c, d, a, b, x[i + 3], 16, -722521979) + b = md5hh(b, c, d, a, x[i + 6], 23, 76029189) + a = md5hh(a, b, c, d, x[i + 9], 4, -640364487) + d = md5hh(d, a, b, c, x[i + 12], 11, -421815835) + c = md5hh(c, d, a, b, x[i + 15], 16, 530742520) + b = md5hh(b, c, d, a, x[i + 2], 23, -995338651) + + a = md5ii(a, b, c, d, x[i], 6, -198630844) + d = md5ii(d, a, b, c, x[i + 7], 10, 1126891415) + c = md5ii(c, d, a, b, x[i + 14], 15, -1416354905) + b = md5ii(b, c, d, a, x[i + 5], 21, -57434055) + a = md5ii(a, b, c, d, x[i + 12], 6, 1700485571) + d = md5ii(d, a, b, c, x[i + 3], 10, -1894986606) + c = md5ii(c, d, a, b, x[i + 10], 15, -1051523) + b = md5ii(b, c, d, a, x[i + 1], 21, -2054922799) + a = md5ii(a, b, c, d, x[i + 8], 6, 1873313359) + d = md5ii(d, a, b, c, x[i + 15], 10, -30611744) + c = md5ii(c, d, a, b, x[i + 6], 15, -1560198380) + b = md5ii(b, c, d, a, x[i + 13], 21, 1309151649) + a = md5ii(a, b, c, d, x[i + 4], 6, -145523070) + d = md5ii(d, a, b, c, x[i + 11], 10, -1120210379) + c = md5ii(c, d, a, b, x[i + 2], 15, 718787259) + b = md5ii(b, c, d, a, x[i + 9], 21, -343485551) + + a = safeAdd(a, olda) + b = safeAdd(b, oldb) + c = safeAdd(c, oldc) + d = safeAdd(d, oldd) + } + return [a, b, c, d] + } + + /** + * Convert an array of little-endian words to a string + * + * @param {Array} input MD5 Array + * @returns {string} MD5 string + */ + function binl2rstr(input) { + var i + var output = '' + var length32 = input.length * 32 + for (i = 0; i < length32; i += 8) { + output += String.fromCharCode((input[i >> 5] >>> i % 32) & 0xff) + } + return output + } + + /** + * Convert a raw string to an array of little-endian words + * Characters >255 have their high-byte silently ignored. + * + * @param {string} input Raw input string + * @returns {Array} Array of little-endian words + */ + function rstr2binl(input) { + var i + var output = [] + output[(input.length >> 2) - 1] = undefined + for (i = 0; i < output.length; i += 1) { + output[i] = 0 + } + var length8 = input.length * 8 + for (i = 0; i < length8; i += 8) { + output[i >> 5] |= (input.charCodeAt(i / 8) & 0xff) << i % 32 + } + return output + } + + /** + * Calculate the MD5 of a raw string + * + * @param {string} s Input string + * @returns {string} Raw MD5 string + */ + function rstrMD5(s) { + return binl2rstr(binlMD5(rstr2binl(s), s.length * 8)) + } + + /** + * Calculates the HMAC-MD5 of a key and some data (raw strings) + * + * @param {string} key HMAC key + * @param {string} data Raw input string + * @returns {string} Raw MD5 string + */ + function rstrHMACMD5(key, data) { + var i + var bkey = rstr2binl(key) + var ipad = [] + var opad = [] + var hash + ipad[15] = opad[15] = undefined + if (bkey.length > 16) { + bkey = binlMD5(bkey, key.length * 8) + } + for (i = 0; i < 16; i += 1) { + ipad[i] = bkey[i] ^ 0x36363636 + opad[i] = bkey[i] ^ 0x5c5c5c5c + } + hash = binlMD5(ipad.concat(rstr2binl(data)), 512 + data.length * 8) + return binl2rstr(binlMD5(opad.concat(hash), 512 + 128)) + } + + /** + * Convert a raw string to a hex string + * + * @param {string} input Raw input string + * @returns {string} Hex encoded string + */ + function rstr2hex(input) { + var hexTab = '0123456789abcdef' + var output = '' + var x + var i + for (i = 0; i < input.length; i += 1) { + x = input.charCodeAt(i) + output += hexTab.charAt((x >>> 4) & 0x0f) + hexTab.charAt(x & 0x0f) + } + return output + } + + /** + * Encode a string as UTF-8 + * + * @param {string} input Input string + * @returns {string} UTF8 string + */ + function str2rstrUTF8(input) { + return unescape(encodeURIComponent(input)) + } + + /** + * Encodes input string as raw MD5 string + * + * @param {string} s Input string + * @returns {string} Raw MD5 string + */ + function rawMD5(s) { + return rstrMD5(str2rstrUTF8(s)) + } + /** + * Encodes input string as Hex encoded string + * + * @param {string} s Input string + * @returns {string} Hex encoded string + */ + function hexMD5(s) { + return rstr2hex(rawMD5(s)) + } + /** + * Calculates the raw HMAC-MD5 for the given key and data + * + * @param {string} k HMAC key + * @param {string} d Input string + * @returns {string} Raw MD5 string + */ + function rawHMACMD5(k, d) { + return rstrHMACMD5(str2rstrUTF8(k), str2rstrUTF8(d)) + } + /** + * Calculates the Hex encoded HMAC-MD5 for the given key and data + * + * @param {string} k HMAC key + * @param {string} d Input string + * @returns {string} Raw MD5 string + */ + function hexHMACMD5(k, d) { + return rstr2hex(rawHMACMD5(k, d)) + } + + /** + * Calculates MD5 value for a given string. + * If a key is provided, calculates the HMAC-MD5 value. + * Returns a Hex encoded string unless the raw argument is given. + * + * @param {string} string Input string + * @param {string} [key] HMAC key + * @param {boolean} [raw] Raw output switch + * @returns {string} MD5 output + */ + function md5(string, key, raw) { + if (!key) { + if (!raw) { + return hexMD5(string) + } + return rawMD5(string) + } + if (!raw) { + return hexHMACMD5(key, string) + } + return rawHMACMD5(key, string) + } + + if (typeof define === 'function' && define.amd) { + define(function () { + return md5 + }) + } else if (typeof module === 'object' && module.exports) { + module.exports = md5 + } else { + $.md5 = md5 + } +})(this) + +}, function(modId) {var map = {}; return __REQUIRE__(map[modId], modId); }) +return __REQUIRE__(1692159285361); +})() +//miniprogram-npm-outsideDeps=[] +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/weapp/miniprogram_npm/blueimp-md5/index.js.map b/weapp/miniprogram_npm/blueimp-md5/index.js.map new file mode 100644 index 0000000..b8839d1 --- /dev/null +++ b/weapp/miniprogram_npm/blueimp-md5/index.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["md5.js"],"names":[],"mappings":";;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","file":"index.js","sourcesContent":["/*\n * JavaScript MD5\n * https://github.com/blueimp/JavaScript-MD5\n *\n * Copyright 2011, Sebastian Tschan\n * https://blueimp.net\n *\n * Licensed under the MIT license:\n * https://opensource.org/licenses/MIT\n *\n * Based on\n * A JavaScript implementation of the RSA Data Security, Inc. MD5 Message\n * Digest Algorithm, as defined in RFC 1321.\n * Version 2.2 Copyright (C) Paul Johnston 1999 - 2009\n * Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet\n * Distributed under the BSD License\n * See http://pajhome.org.uk/crypt/md5 for more info.\n */\n\n/* global define */\n\n/* eslint-disable strict */\n\n;(function ($) {\n \n\n /**\n * Add integers, wrapping at 2^32.\n * This uses 16-bit operations internally to work around bugs in interpreters.\n *\n * @param {number} x First integer\n * @param {number} y Second integer\n * @returns {number} Sum\n */\n function safeAdd(x, y) {\n var lsw = (x & 0xffff) + (y & 0xffff)\n var msw = (x >> 16) + (y >> 16) + (lsw >> 16)\n return (msw << 16) | (lsw & 0xffff)\n }\n\n /**\n * Bitwise rotate a 32-bit number to the left.\n *\n * @param {number} num 32-bit number\n * @param {number} cnt Rotation count\n * @returns {number} Rotated number\n */\n function bitRotateLeft(num, cnt) {\n return (num << cnt) | (num >>> (32 - cnt))\n }\n\n /**\n * Basic operation the algorithm uses.\n *\n * @param {number} q q\n * @param {number} a a\n * @param {number} b b\n * @param {number} x x\n * @param {number} s s\n * @param {number} t t\n * @returns {number} Result\n */\n function md5cmn(q, a, b, x, s, t) {\n return safeAdd(bitRotateLeft(safeAdd(safeAdd(a, q), safeAdd(x, t)), s), b)\n }\n /**\n * Basic operation the algorithm uses.\n *\n * @param {number} a a\n * @param {number} b b\n * @param {number} c c\n * @param {number} d d\n * @param {number} x x\n * @param {number} s s\n * @param {number} t t\n * @returns {number} Result\n */\n function md5ff(a, b, c, d, x, s, t) {\n return md5cmn((b & c) | (~b & d), a, b, x, s, t)\n }\n /**\n * Basic operation the algorithm uses.\n *\n * @param {number} a a\n * @param {number} b b\n * @param {number} c c\n * @param {number} d d\n * @param {number} x x\n * @param {number} s s\n * @param {number} t t\n * @returns {number} Result\n */\n function md5gg(a, b, c, d, x, s, t) {\n return md5cmn((b & d) | (c & ~d), a, b, x, s, t)\n }\n /**\n * Basic operation the algorithm uses.\n *\n * @param {number} a a\n * @param {number} b b\n * @param {number} c c\n * @param {number} d d\n * @param {number} x x\n * @param {number} s s\n * @param {number} t t\n * @returns {number} Result\n */\n function md5hh(a, b, c, d, x, s, t) {\n return md5cmn(b ^ c ^ d, a, b, x, s, t)\n }\n /**\n * Basic operation the algorithm uses.\n *\n * @param {number} a a\n * @param {number} b b\n * @param {number} c c\n * @param {number} d d\n * @param {number} x x\n * @param {number} s s\n * @param {number} t t\n * @returns {number} Result\n */\n function md5ii(a, b, c, d, x, s, t) {\n return md5cmn(c ^ (b | ~d), a, b, x, s, t)\n }\n\n /**\n * Calculate the MD5 of an array of little-endian words, and a bit length.\n *\n * @param {Array} x Array of little-endian words\n * @param {number} len Bit length\n * @returns {Array} MD5 Array\n */\n function binlMD5(x, len) {\n /* append padding */\n x[len >> 5] |= 0x80 << len % 32\n x[(((len + 64) >>> 9) << 4) + 14] = len\n\n var i\n var olda\n var oldb\n var oldc\n var oldd\n var a = 1732584193\n var b = -271733879\n var c = -1732584194\n var d = 271733878\n\n for (i = 0; i < x.length; i += 16) {\n olda = a\n oldb = b\n oldc = c\n oldd = d\n\n a = md5ff(a, b, c, d, x[i], 7, -680876936)\n d = md5ff(d, a, b, c, x[i + 1], 12, -389564586)\n c = md5ff(c, d, a, b, x[i + 2], 17, 606105819)\n b = md5ff(b, c, d, a, x[i + 3], 22, -1044525330)\n a = md5ff(a, b, c, d, x[i + 4], 7, -176418897)\n d = md5ff(d, a, b, c, x[i + 5], 12, 1200080426)\n c = md5ff(c, d, a, b, x[i + 6], 17, -1473231341)\n b = md5ff(b, c, d, a, x[i + 7], 22, -45705983)\n a = md5ff(a, b, c, d, x[i + 8], 7, 1770035416)\n d = md5ff(d, a, b, c, x[i + 9], 12, -1958414417)\n c = md5ff(c, d, a, b, x[i + 10], 17, -42063)\n b = md5ff(b, c, d, a, x[i + 11], 22, -1990404162)\n a = md5ff(a, b, c, d, x[i + 12], 7, 1804603682)\n d = md5ff(d, a, b, c, x[i + 13], 12, -40341101)\n c = md5ff(c, d, a, b, x[i + 14], 17, -1502002290)\n b = md5ff(b, c, d, a, x[i + 15], 22, 1236535329)\n\n a = md5gg(a, b, c, d, x[i + 1], 5, -165796510)\n d = md5gg(d, a, b, c, x[i + 6], 9, -1069501632)\n c = md5gg(c, d, a, b, x[i + 11], 14, 643717713)\n b = md5gg(b, c, d, a, x[i], 20, -373897302)\n a = md5gg(a, b, c, d, x[i + 5], 5, -701558691)\n d = md5gg(d, a, b, c, x[i + 10], 9, 38016083)\n c = md5gg(c, d, a, b, x[i + 15], 14, -660478335)\n b = md5gg(b, c, d, a, x[i + 4], 20, -405537848)\n a = md5gg(a, b, c, d, x[i + 9], 5, 568446438)\n d = md5gg(d, a, b, c, x[i + 14], 9, -1019803690)\n c = md5gg(c, d, a, b, x[i + 3], 14, -187363961)\n b = md5gg(b, c, d, a, x[i + 8], 20, 1163531501)\n a = md5gg(a, b, c, d, x[i + 13], 5, -1444681467)\n d = md5gg(d, a, b, c, x[i + 2], 9, -51403784)\n c = md5gg(c, d, a, b, x[i + 7], 14, 1735328473)\n b = md5gg(b, c, d, a, x[i + 12], 20, -1926607734)\n\n a = md5hh(a, b, c, d, x[i + 5], 4, -378558)\n d = md5hh(d, a, b, c, x[i + 8], 11, -2022574463)\n c = md5hh(c, d, a, b, x[i + 11], 16, 1839030562)\n b = md5hh(b, c, d, a, x[i + 14], 23, -35309556)\n a = md5hh(a, b, c, d, x[i + 1], 4, -1530992060)\n d = md5hh(d, a, b, c, x[i + 4], 11, 1272893353)\n c = md5hh(c, d, a, b, x[i + 7], 16, -155497632)\n b = md5hh(b, c, d, a, x[i + 10], 23, -1094730640)\n a = md5hh(a, b, c, d, x[i + 13], 4, 681279174)\n d = md5hh(d, a, b, c, x[i], 11, -358537222)\n c = md5hh(c, d, a, b, x[i + 3], 16, -722521979)\n b = md5hh(b, c, d, a, x[i + 6], 23, 76029189)\n a = md5hh(a, b, c, d, x[i + 9], 4, -640364487)\n d = md5hh(d, a, b, c, x[i + 12], 11, -421815835)\n c = md5hh(c, d, a, b, x[i + 15], 16, 530742520)\n b = md5hh(b, c, d, a, x[i + 2], 23, -995338651)\n\n a = md5ii(a, b, c, d, x[i], 6, -198630844)\n d = md5ii(d, a, b, c, x[i + 7], 10, 1126891415)\n c = md5ii(c, d, a, b, x[i + 14], 15, -1416354905)\n b = md5ii(b, c, d, a, x[i + 5], 21, -57434055)\n a = md5ii(a, b, c, d, x[i + 12], 6, 1700485571)\n d = md5ii(d, a, b, c, x[i + 3], 10, -1894986606)\n c = md5ii(c, d, a, b, x[i + 10], 15, -1051523)\n b = md5ii(b, c, d, a, x[i + 1], 21, -2054922799)\n a = md5ii(a, b, c, d, x[i + 8], 6, 1873313359)\n d = md5ii(d, a, b, c, x[i + 15], 10, -30611744)\n c = md5ii(c, d, a, b, x[i + 6], 15, -1560198380)\n b = md5ii(b, c, d, a, x[i + 13], 21, 1309151649)\n a = md5ii(a, b, c, d, x[i + 4], 6, -145523070)\n d = md5ii(d, a, b, c, x[i + 11], 10, -1120210379)\n c = md5ii(c, d, a, b, x[i + 2], 15, 718787259)\n b = md5ii(b, c, d, a, x[i + 9], 21, -343485551)\n\n a = safeAdd(a, olda)\n b = safeAdd(b, oldb)\n c = safeAdd(c, oldc)\n d = safeAdd(d, oldd)\n }\n return [a, b, c, d]\n }\n\n /**\n * Convert an array of little-endian words to a string\n *\n * @param {Array} input MD5 Array\n * @returns {string} MD5 string\n */\n function binl2rstr(input) {\n var i\n var output = ''\n var length32 = input.length * 32\n for (i = 0; i < length32; i += 8) {\n output += String.fromCharCode((input[i >> 5] >>> i % 32) & 0xff)\n }\n return output\n }\n\n /**\n * Convert a raw string to an array of little-endian words\n * Characters >255 have their high-byte silently ignored.\n *\n * @param {string} input Raw input string\n * @returns {Array} Array of little-endian words\n */\n function rstr2binl(input) {\n var i\n var output = []\n output[(input.length >> 2) - 1] = undefined\n for (i = 0; i < output.length; i += 1) {\n output[i] = 0\n }\n var length8 = input.length * 8\n for (i = 0; i < length8; i += 8) {\n output[i >> 5] |= (input.charCodeAt(i / 8) & 0xff) << i % 32\n }\n return output\n }\n\n /**\n * Calculate the MD5 of a raw string\n *\n * @param {string} s Input string\n * @returns {string} Raw MD5 string\n */\n function rstrMD5(s) {\n return binl2rstr(binlMD5(rstr2binl(s), s.length * 8))\n }\n\n /**\n * Calculates the HMAC-MD5 of a key and some data (raw strings)\n *\n * @param {string} key HMAC key\n * @param {string} data Raw input string\n * @returns {string} Raw MD5 string\n */\n function rstrHMACMD5(key, data) {\n var i\n var bkey = rstr2binl(key)\n var ipad = []\n var opad = []\n var hash\n ipad[15] = opad[15] = undefined\n if (bkey.length > 16) {\n bkey = binlMD5(bkey, key.length * 8)\n }\n for (i = 0; i < 16; i += 1) {\n ipad[i] = bkey[i] ^ 0x36363636\n opad[i] = bkey[i] ^ 0x5c5c5c5c\n }\n hash = binlMD5(ipad.concat(rstr2binl(data)), 512 + data.length * 8)\n return binl2rstr(binlMD5(opad.concat(hash), 512 + 128))\n }\n\n /**\n * Convert a raw string to a hex string\n *\n * @param {string} input Raw input string\n * @returns {string} Hex encoded string\n */\n function rstr2hex(input) {\n var hexTab = '0123456789abcdef'\n var output = ''\n var x\n var i\n for (i = 0; i < input.length; i += 1) {\n x = input.charCodeAt(i)\n output += hexTab.charAt((x >>> 4) & 0x0f) + hexTab.charAt(x & 0x0f)\n }\n return output\n }\n\n /**\n * Encode a string as UTF-8\n *\n * @param {string} input Input string\n * @returns {string} UTF8 string\n */\n function str2rstrUTF8(input) {\n return unescape(encodeURIComponent(input))\n }\n\n /**\n * Encodes input string as raw MD5 string\n *\n * @param {string} s Input string\n * @returns {string} Raw MD5 string\n */\n function rawMD5(s) {\n return rstrMD5(str2rstrUTF8(s))\n }\n /**\n * Encodes input string as Hex encoded string\n *\n * @param {string} s Input string\n * @returns {string} Hex encoded string\n */\n function hexMD5(s) {\n return rstr2hex(rawMD5(s))\n }\n /**\n * Calculates the raw HMAC-MD5 for the given key and data\n *\n * @param {string} k HMAC key\n * @param {string} d Input string\n * @returns {string} Raw MD5 string\n */\n function rawHMACMD5(k, d) {\n return rstrHMACMD5(str2rstrUTF8(k), str2rstrUTF8(d))\n }\n /**\n * Calculates the Hex encoded HMAC-MD5 for the given key and data\n *\n * @param {string} k HMAC key\n * @param {string} d Input string\n * @returns {string} Raw MD5 string\n */\n function hexHMACMD5(k, d) {\n return rstr2hex(rawHMACMD5(k, d))\n }\n\n /**\n * Calculates MD5 value for a given string.\n * If a key is provided, calculates the HMAC-MD5 value.\n * Returns a Hex encoded string unless the raw argument is given.\n *\n * @param {string} string Input string\n * @param {string} [key] HMAC key\n * @param {boolean} [raw] Raw output switch\n * @returns {string} MD5 output\n */\n function md5(string, key, raw) {\n if (!key) {\n if (!raw) {\n return hexMD5(string)\n }\n return rawMD5(string)\n }\n if (!raw) {\n return hexHMACMD5(key, string)\n }\n return rawHMACMD5(key, string)\n }\n\n if (typeof define === 'function' && define.amd) {\n define(function () {\n return md5\n })\n } else if (typeof module === 'object' && module.exports) {\n module.exports = md5\n } else {\n $.md5 = md5\n }\n})(this)\n"]} \ No newline at end of file diff --git a/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/action-sheet/index.d.ts b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/action-sheet/index.d.ts new file mode 100644 index 0000000..cb0ff5c --- /dev/null +++ b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/action-sheet/index.d.ts @@ -0,0 +1 @@ +export {}; diff --git a/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/action-sheet/index.js b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/action-sheet/index.js new file mode 100644 index 0000000..a39818a --- /dev/null +++ b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/action-sheet/index.js @@ -0,0 +1,74 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var component_1 = require("../common/component"); +var button_1 = require("../mixins/button"); +(0, component_1.VantComponent)({ + classes: ['list-class'], + mixins: [button_1.button], + props: { + show: Boolean, + title: String, + cancelText: String, + description: String, + round: { + type: Boolean, + value: true, + }, + zIndex: { + type: Number, + value: 100, + }, + actions: { + type: Array, + value: [], + }, + overlay: { + type: Boolean, + value: true, + }, + closeOnClickOverlay: { + type: Boolean, + value: true, + }, + closeOnClickAction: { + type: Boolean, + value: true, + }, + safeAreaInsetBottom: { + type: Boolean, + value: true, + }, + }, + methods: { + onSelect: function (event) { + var _this = this; + var index = event.currentTarget.dataset.index; + var _a = this.data, actions = _a.actions, closeOnClickAction = _a.closeOnClickAction, canIUseGetUserProfile = _a.canIUseGetUserProfile; + var item = actions[index]; + if (item) { + this.$emit('select', item); + if (closeOnClickAction) { + this.onClose(); + } + if (item.openType === 'getUserInfo' && canIUseGetUserProfile) { + wx.getUserProfile({ + desc: item.getUserProfileDesc || ' ', + complete: function (userProfile) { + _this.$emit('getuserinfo', userProfile); + }, + }); + } + } + }, + onCancel: function () { + this.$emit('cancel'); + }, + onClose: function () { + this.$emit('close'); + }, + onClickOverlay: function () { + this.$emit('click-overlay'); + this.onClose(); + }, + }, +}); diff --git a/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/action-sheet/index.json b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/action-sheet/index.json new file mode 100644 index 0000000..19bf989 --- /dev/null +++ b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/action-sheet/index.json @@ -0,0 +1,8 @@ +{ + "component": true, + "usingComponents": { + "van-icon": "../icon/index", + "van-popup": "../popup/index", + "van-loading": "../loading/index" + } +} diff --git a/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/action-sheet/index.wxml b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/action-sheet/index.wxml new file mode 100644 index 0000000..d59a45d --- /dev/null +++ b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/action-sheet/index.wxml @@ -0,0 +1,69 @@ + + + + + {{ title }} + + + + {{ description }} + + + + + + + + + + {{ cancelText }} + + + diff --git a/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/action-sheet/index.wxss b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/action-sheet/index.wxss new file mode 100644 index 0000000..eedd361 --- /dev/null +++ b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/action-sheet/index.wxss @@ -0,0 +1 @@ +@import '../common/index.wxss';.van-action-sheet{color:var(--action-sheet-item-text-color,#323233);max-height:var(--action-sheet-max-height,90%)!important}.van-action-sheet__cancel,.van-action-sheet__item{background-color:var(--action-sheet-item-background,#fff);font-size:var(--action-sheet-item-font-size,16px);line-height:var(--action-sheet-item-line-height,22px);padding:14px 16px;text-align:center}.van-action-sheet__cancel--hover,.van-action-sheet__item--hover{background-color:#f2f3f5}.van-action-sheet__cancel:after,.van-action-sheet__item:after{border-width:0}.van-action-sheet__cancel{color:var(--action-sheet-cancel-text-color,#646566)}.van-action-sheet__gap{background-color:var(--action-sheet-cancel-padding-color,#f7f8fa);display:block;height:var(--action-sheet-cancel-padding-top,8px)}.van-action-sheet__item--disabled{color:var(--action-sheet-item-disabled-text-color,#c8c9cc)}.van-action-sheet__item--disabled.van-action-sheet__item--hover{background-color:var(--action-sheet-item-background,#fff)}.van-action-sheet__subname{color:var(--action-sheet-subname-color,#969799);font-size:var(--action-sheet-subname-font-size,12px);line-height:var(--action-sheet-subname-line-height,20px);margin-top:var(--padding-xs,8px)}.van-action-sheet__header{font-size:var(--action-sheet-header-font-size,16px);font-weight:var(--font-weight-bold,500);line-height:var(--action-sheet-header-height,48px);text-align:center}.van-action-sheet__description{color:var(--action-sheet-description-color,#969799);font-size:var(--action-sheet-description-font-size,14px);line-height:var(--action-sheet-description-line-height,20px);padding:20px var(--padding-md,16px);text-align:center}.van-action-sheet__close{color:var(--action-sheet-close-icon-color,#c8c9cc);font-size:var(--action-sheet-close-icon-size,22px)!important;line-height:inherit!important;padding:var(--action-sheet-close-icon-padding,0 16px);position:absolute!important;right:0;top:0}.van-action-sheet__loading{display:flex!important} \ No newline at end of file diff --git a/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/area/index.d.ts b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/area/index.d.ts new file mode 100644 index 0000000..cb0ff5c --- /dev/null +++ b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/area/index.d.ts @@ -0,0 +1 @@ +export {}; diff --git a/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/area/index.js b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/area/index.js new file mode 100644 index 0000000..73de66d --- /dev/null +++ b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/area/index.js @@ -0,0 +1,235 @@ +"use strict"; +var __assign = (this && this.__assign) || function () { + __assign = Object.assign || function(t) { + for (var s, i = 1, n = arguments.length; i < n; i++) { + s = arguments[i]; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) + t[p] = s[p]; + } + return t; + }; + return __assign.apply(this, arguments); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +var component_1 = require("../common/component"); +var shared_1 = require("../picker/shared"); +var utils_1 = require("../common/utils"); +var EMPTY_CODE = '000000'; +(0, component_1.VantComponent)({ + classes: ['active-class', 'toolbar-class', 'column-class'], + props: __assign(__assign({}, shared_1.pickerProps), { showToolbar: { + type: Boolean, + value: true, + }, value: { + type: String, + observer: function (value) { + this.code = value; + this.setValues(); + }, + }, areaList: { + type: Object, + value: {}, + observer: 'setValues', + }, columnsNum: { + type: null, + value: 3, + }, columnsPlaceholder: { + type: Array, + observer: function (val) { + this.setData({ + typeToColumnsPlaceholder: { + province: val[0] || '', + city: val[1] || '', + county: val[2] || '', + }, + }); + }, + } }), + data: { + columns: [{ values: [] }, { values: [] }, { values: [] }], + typeToColumnsPlaceholder: {}, + }, + mounted: function () { + var _this = this; + (0, utils_1.requestAnimationFrame)(function () { + _this.setValues(); + }); + }, + methods: { + getPicker: function () { + if (this.picker == null) { + this.picker = this.selectComponent('.van-area__picker'); + } + return this.picker; + }, + onCancel: function (event) { + this.emit('cancel', event.detail); + }, + onConfirm: function (event) { + var index = event.detail.index; + var value = event.detail.value; + value = this.parseValues(value); + this.emit('confirm', { value: value, index: index }); + }, + emit: function (type, detail) { + detail.values = detail.value; + delete detail.value; + this.$emit(type, detail); + }, + parseValues: function (values) { + var columnsPlaceholder = this.data.columnsPlaceholder; + return values.map(function (value, index) { + if (value && + (!value.code || value.name === columnsPlaceholder[index])) { + return __assign(__assign({}, value), { code: '', name: '' }); + } + return value; + }); + }, + onChange: function (event) { + var _this = this; + var _a; + var _b = event.detail, index = _b.index, picker = _b.picker, value = _b.value; + this.code = value[index].code; + (_a = this.setValues()) === null || _a === void 0 ? void 0 : _a.then(function () { + _this.$emit('change', { + picker: picker, + values: _this.parseValues(picker.getValues()), + index: index, + }); + }); + }, + getConfig: function (type) { + var areaList = this.data.areaList; + return (areaList && areaList["".concat(type, "_list")]) || {}; + }, + getList: function (type, code) { + if (type !== 'province' && !code) { + return []; + } + var typeToColumnsPlaceholder = this.data.typeToColumnsPlaceholder; + var list = this.getConfig(type); + var result = Object.keys(list).map(function (code) { return ({ + code: code, + name: list[code], + }); }); + if (code != null) { + // oversea code + if (code[0] === '9' && type === 'city') { + code = '9'; + } + result = result.filter(function (item) { return item.code.indexOf(code) === 0; }); + } + if (typeToColumnsPlaceholder[type] && result.length) { + // set columns placeholder + var codeFill = type === 'province' + ? '' + : type === 'city' + ? EMPTY_CODE.slice(2, 4) + : EMPTY_CODE.slice(4, 6); + result.unshift({ + code: "".concat(code).concat(codeFill), + name: typeToColumnsPlaceholder[type], + }); + } + return result; + }, + getIndex: function (type, code) { + var compareNum = type === 'province' ? 2 : type === 'city' ? 4 : 6; + var list = this.getList(type, code.slice(0, compareNum - 2)); + // oversea code + if (code[0] === '9' && type === 'province') { + compareNum = 1; + } + code = code.slice(0, compareNum); + for (var i = 0; i < list.length; i++) { + if (list[i].code.slice(0, compareNum) === code) { + return i; + } + } + return 0; + }, + setValues: function () { + var picker = this.getPicker(); + if (!picker) { + return; + } + var code = this.code || this.getDefaultCode(); + var provinceList = this.getList('province'); + var cityList = this.getList('city', code.slice(0, 2)); + var stack = []; + var indexes = []; + var columnsNum = this.data.columnsNum; + if (columnsNum >= 1) { + stack.push(picker.setColumnValues(0, provinceList, false)); + indexes.push(this.getIndex('province', code)); + } + if (columnsNum >= 2) { + stack.push(picker.setColumnValues(1, cityList, false)); + indexes.push(this.getIndex('city', code)); + if (cityList.length && code.slice(2, 4) === '00') { + code = cityList[0].code; + } + } + if (columnsNum === 3) { + stack.push(picker.setColumnValues(2, this.getList('county', code.slice(0, 4)), false)); + indexes.push(this.getIndex('county', code)); + } + return Promise.all(stack) + .catch(function () { }) + .then(function () { return picker.setIndexes(indexes); }) + .catch(function () { }); + }, + getDefaultCode: function () { + var columnsPlaceholder = this.data.columnsPlaceholder; + if (columnsPlaceholder.length) { + return EMPTY_CODE; + } + var countyCodes = Object.keys(this.getConfig('county')); + if (countyCodes[0]) { + return countyCodes[0]; + } + var cityCodes = Object.keys(this.getConfig('city')); + if (cityCodes[0]) { + return cityCodes[0]; + } + return ''; + }, + getValues: function () { + var picker = this.getPicker(); + if (!picker) { + return []; + } + return this.parseValues(picker.getValues().filter(function (value) { return !!value; })); + }, + getDetail: function () { + var values = this.getValues(); + var area = { + code: '', + country: '', + province: '', + city: '', + county: '', + }; + if (!values.length) { + return area; + } + var names = values.map(function (item) { return item.name; }); + area.code = values[values.length - 1].code; + if (area.code[0] === '9') { + area.country = names[1] || ''; + area.province = names[2] || ''; + } + else { + area.province = names[0] || ''; + area.city = names[1] || ''; + area.county = names[2] || ''; + } + return area; + }, + reset: function (code) { + this.code = code || ''; + return this.setValues(); + }, + }, +}); diff --git a/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/area/index.json b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/area/index.json new file mode 100644 index 0000000..a778e91 --- /dev/null +++ b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/area/index.json @@ -0,0 +1,6 @@ +{ + "component": true, + "usingComponents": { + "van-picker": "../picker/index" + } +} diff --git a/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/area/index.wxml b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/area/index.wxml new file mode 100644 index 0000000..3a437b7 --- /dev/null +++ b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/area/index.wxml @@ -0,0 +1,20 @@ + + + diff --git a/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/area/index.wxs b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/area/index.wxs new file mode 100644 index 0000000..07723c1 --- /dev/null +++ b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/area/index.wxs @@ -0,0 +1,8 @@ +/* eslint-disable */ +function displayColumns(columns, columnsNum) { + return columns.slice(0, +columnsNum); +} + +module.exports = { + displayColumns: displayColumns, +}; diff --git a/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/area/index.wxss b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/area/index.wxss new file mode 100644 index 0000000..99694d6 --- /dev/null +++ b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/area/index.wxss @@ -0,0 +1 @@ +@import '../common/index.wxss'; \ No newline at end of file diff --git a/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/button/index.d.ts b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/button/index.d.ts new file mode 100644 index 0000000..cb0ff5c --- /dev/null +++ b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/button/index.d.ts @@ -0,0 +1 @@ +export {}; diff --git a/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/button/index.js b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/button/index.js new file mode 100644 index 0000000..984135c --- /dev/null +++ b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/button/index.js @@ -0,0 +1,67 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var component_1 = require("../common/component"); +var button_1 = require("../mixins/button"); +var version_1 = require("../common/version"); +var mixins = [button_1.button]; +if ((0, version_1.canIUseFormFieldButton)()) { + mixins.push('wx://form-field-button'); +} +(0, component_1.VantComponent)({ + mixins: mixins, + classes: ['hover-class', 'loading-class'], + data: { + baseStyle: '', + }, + props: { + formType: String, + icon: String, + classPrefix: { + type: String, + value: 'van-icon', + }, + plain: Boolean, + block: Boolean, + round: Boolean, + square: Boolean, + loading: Boolean, + hairline: Boolean, + disabled: Boolean, + loadingText: String, + customStyle: String, + loadingType: { + type: String, + value: 'circular', + }, + type: { + type: String, + value: 'default', + }, + dataset: null, + size: { + type: String, + value: 'normal', + }, + loadingSize: { + type: String, + value: '20px', + }, + color: String, + }, + methods: { + onClick: function (event) { + var _this = this; + this.$emit('click', event); + var _a = this.data, canIUseGetUserProfile = _a.canIUseGetUserProfile, openType = _a.openType, getUserProfileDesc = _a.getUserProfileDesc, lang = _a.lang; + if (openType === 'getUserInfo' && canIUseGetUserProfile) { + wx.getUserProfile({ + desc: getUserProfileDesc || ' ', + lang: lang || 'en', + complete: function (userProfile) { + _this.$emit('getuserinfo', userProfile); + }, + }); + } + }, + }, +}); diff --git a/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/button/index.json b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/button/index.json new file mode 100644 index 0000000..e00a588 --- /dev/null +++ b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/button/index.json @@ -0,0 +1,7 @@ +{ + "component": true, + "usingComponents": { + "van-icon": "../icon/index", + "van-loading": "../loading/index" + } +} diff --git a/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/button/index.wxml b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/button/index.wxml new file mode 100644 index 0000000..b87b9b8 --- /dev/null +++ b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/button/index.wxml @@ -0,0 +1,55 @@ + + + + diff --git a/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/button/index.wxs b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/button/index.wxs new file mode 100644 index 0000000..8b649fe --- /dev/null +++ b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/button/index.wxs @@ -0,0 +1,39 @@ +/* eslint-disable */ +var style = require('../wxs/style.wxs'); + +function rootStyle(data) { + if (!data.color) { + return data.customStyle; + } + + var properties = { + color: data.plain ? data.color : '#fff', + background: data.plain ? null : data.color, + }; + + // hide border when color is linear-gradient + if (data.color.indexOf('gradient') !== -1) { + properties.border = 0; + } else { + properties['border-color'] = data.color; + } + + return style([properties, data.customStyle]); +} + +function loadingColor(data) { + if (data.plain) { + return data.color ? data.color : '#c9c9c9'; + } + + if (data.type === 'default') { + return '#c9c9c9'; + } + + return '#fff'; +} + +module.exports = { + rootStyle: rootStyle, + loadingColor: loadingColor, +}; diff --git a/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/button/index.wxss b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/button/index.wxss new file mode 100644 index 0000000..bd8bb5a --- /dev/null +++ b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/button/index.wxss @@ -0,0 +1 @@ +@import '../common/index.wxss';.van-button{-webkit-text-size-adjust:100%;align-items:center;-webkit-appearance:none;border-radius:var(--button-border-radius,2px);box-sizing:border-box;display:inline-flex;font-size:var(--button-default-font-size,16px);height:var(--button-default-height,44px);justify-content:center;line-height:var(--button-line-height,20px);padding:0;position:relative;text-align:center;transition:opacity .2s;vertical-align:middle}.van-button:before{background-color:#000;border:inherit;border-color:#000;border-radius:inherit;content:" ";height:100%;left:50%;opacity:0;position:absolute;top:50%;transform:translate(-50%,-50%);width:100%}.van-button:after{border-width:0}.van-button--active:before{opacity:.15}.van-button--unclickable:after{display:none}.van-button--default{background:var(--button-default-background-color,#fff);border:var(--button-border-width,1px) solid var(--button-default-border-color,#ebedf0);color:var(--button-default-color,#323233)}.van-button--primary{background:var(--button-primary-background-color,#07c160);border:var(--button-border-width,1px) solid var(--button-primary-border-color,#07c160);color:var(--button-primary-color,#fff)}.van-button--info{background:var(--button-info-background-color,#1989fa);border:var(--button-border-width,1px) solid var(--button-info-border-color,#1989fa);color:var(--button-info-color,#fff)}.van-button--danger{background:var(--button-danger-background-color,#ee0a24);border:var(--button-border-width,1px) solid var(--button-danger-border-color,#ee0a24);color:var(--button-danger-color,#fff)}.van-button--warning{background:var(--button-warning-background-color,#ff976a);border:var(--button-border-width,1px) solid var(--button-warning-border-color,#ff976a);color:var(--button-warning-color,#fff)}.van-button--plain{background:var(--button-plain-background-color,#fff)}.van-button--plain.van-button--primary{color:var(--button-primary-background-color,#07c160)}.van-button--plain.van-button--info{color:var(--button-info-background-color,#1989fa)}.van-button--plain.van-button--danger{color:var(--button-danger-background-color,#ee0a24)}.van-button--plain.van-button--warning{color:var(--button-warning-background-color,#ff976a)}.van-button--large{height:var(--button-large-height,50px);width:100%}.van-button--normal{font-size:var(--button-normal-font-size,14px);padding:0 15px}.van-button--small{font-size:var(--button-small-font-size,12px);height:var(--button-small-height,30px);min-width:var(--button-small-min-width,60px);padding:0 var(--padding-xs,8px)}.van-button--mini{display:inline-block;font-size:var(--button-mini-font-size,10px);height:var(--button-mini-height,22px);min-width:var(--button-mini-min-width,50px)}.van-button--mini+.van-button--mini{margin-left:5px}.van-button--block{display:flex;width:100%}.van-button--round{border-radius:var(--button-round-border-radius,999px)}.van-button--square{border-radius:0}.van-button--disabled{opacity:var(--button-disabled-opacity,.5)}.van-button__text{display:inline}.van-button__icon+.van-button__text:not(:empty),.van-button__loading-text{margin-left:4px}.van-button__icon{line-height:inherit!important;min-width:1em;vertical-align:top}.van-button--hairline{border-width:0;padding-top:1px}.van-button--hairline:after{border-color:inherit;border-radius:calc(var(--button-border-radius, 2px)*2);border-width:1px}.van-button--hairline.van-button--round:after{border-radius:var(--button-round-border-radius,999px)}.van-button--hairline.van-button--square:after{border-radius:0} \ No newline at end of file diff --git a/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/calendar/calendar.wxml b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/calendar/calendar.wxml new file mode 100644 index 0000000..2ba6f30 --- /dev/null +++ b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/calendar/calendar.wxml @@ -0,0 +1,68 @@ + +
+ +
+ + + + + + + + + + + + {{ + computed.getButtonDisabled(type, currentDate, minRange) + ? confirmDisabledText + : confirmText + }} + + +
diff --git a/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/calendar/components/header/index.d.ts b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/calendar/components/header/index.d.ts new file mode 100644 index 0000000..cb0ff5c --- /dev/null +++ b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/calendar/components/header/index.d.ts @@ -0,0 +1 @@ +export {}; diff --git a/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/calendar/components/header/index.js b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/calendar/components/header/index.js new file mode 100644 index 0000000..544b3a4 --- /dev/null +++ b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/calendar/components/header/index.js @@ -0,0 +1,45 @@ +"use strict"; +var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) { + if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) { + if (ar || !(i in from)) { + if (!ar) ar = Array.prototype.slice.call(from, 0, i); + ar[i] = from[i]; + } + } + return to.concat(ar || Array.prototype.slice.call(from)); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +var component_1 = require("../../../common/component"); +(0, component_1.VantComponent)({ + props: { + title: { + type: String, + value: '日期选择', + }, + subtitle: String, + showTitle: Boolean, + showSubtitle: Boolean, + firstDayOfWeek: { + type: Number, + observer: 'initWeekDay', + }, + }, + data: { + weekdays: [], + }, + created: function () { + this.initWeekDay(); + }, + methods: { + initWeekDay: function () { + var defaultWeeks = ['日', '一', '二', '三', '四', '五', '六']; + var firstDayOfWeek = this.data.firstDayOfWeek || 0; + this.setData({ + weekdays: __spreadArray(__spreadArray([], defaultWeeks.slice(firstDayOfWeek, 7), true), defaultWeeks.slice(0, firstDayOfWeek), true), + }); + }, + onClickSubtitle: function (event) { + this.$emit('click-subtitle', event); + }, + }, +}); diff --git a/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/calendar/components/header/index.json b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/calendar/components/header/index.json new file mode 100644 index 0000000..467ce29 --- /dev/null +++ b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/calendar/components/header/index.json @@ -0,0 +1,3 @@ +{ + "component": true +} diff --git a/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/calendar/components/header/index.wxml b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/calendar/components/header/index.wxml new file mode 100644 index 0000000..7e56c83 --- /dev/null +++ b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/calendar/components/header/index.wxml @@ -0,0 +1,16 @@ + + + + {{ title }} + + + + {{ subtitle }} + + + + + {{ item }} + + + diff --git a/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/calendar/components/header/index.wxss b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/calendar/components/header/index.wxss new file mode 100644 index 0000000..272537e --- /dev/null +++ b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/calendar/components/header/index.wxss @@ -0,0 +1 @@ +@import '../../../common/index.wxss';.van-calendar__header{box-shadow:var(--calendar-header-box-shadow,0 2px 10px hsla(220,1%,50%,.16));flex-shrink:0}.van-calendar__header-subtitle,.van-calendar__header-title{font-weight:var(--font-weight-bold,500);height:var(--calendar-header-title-height,44px);line-height:var(--calendar-header-title-height,44px);text-align:center}.van-calendar__header-title+.van-calendar__header-title,.van-calendar__header-title:empty{display:none}.van-calendar__header-title:empty+.van-calendar__header-title{display:block!important}.van-calendar__weekdays{display:flex}.van-calendar__weekday{flex:1;font-size:var(--calendar-weekdays-font-size,12px);line-height:var(--calendar-weekdays-height,30px);text-align:center} \ No newline at end of file diff --git a/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/calendar/components/month/index.d.ts b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/calendar/components/month/index.d.ts new file mode 100644 index 0000000..3ccf85a --- /dev/null +++ b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/calendar/components/month/index.d.ts @@ -0,0 +1,6 @@ +export interface Day { + date: Date; + type: string; + text: number; + bottomInfo?: string; +} diff --git a/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/calendar/components/month/index.js b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/calendar/components/month/index.js new file mode 100644 index 0000000..4d137f5 --- /dev/null +++ b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/calendar/components/month/index.js @@ -0,0 +1,158 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var component_1 = require("../../../common/component"); +var utils_1 = require("../../utils"); +(0, component_1.VantComponent)({ + props: { + date: { + type: null, + observer: 'setDays', + }, + type: { + type: String, + observer: 'setDays', + }, + color: String, + minDate: { + type: null, + observer: 'setDays', + }, + maxDate: { + type: null, + observer: 'setDays', + }, + showMark: Boolean, + rowHeight: null, + formatter: { + type: null, + observer: 'setDays', + }, + currentDate: { + type: null, + observer: 'setDays', + }, + firstDayOfWeek: { + type: Number, + observer: 'setDays', + }, + allowSameDay: Boolean, + showSubtitle: Boolean, + showMonthTitle: Boolean, + }, + data: { + visible: true, + days: [], + }, + methods: { + onClick: function (event) { + var index = event.currentTarget.dataset.index; + var item = this.data.days[index]; + if (item.type !== 'disabled') { + this.$emit('click', item); + } + }, + setDays: function () { + var days = []; + var startDate = new Date(this.data.date); + var year = startDate.getFullYear(); + var month = startDate.getMonth(); + var totalDay = (0, utils_1.getMonthEndDay)(startDate.getFullYear(), startDate.getMonth() + 1); + for (var day = 1; day <= totalDay; day++) { + var date = new Date(year, month, day); + var type = this.getDayType(date); + var config = { + date: date, + type: type, + text: day, + bottomInfo: this.getBottomInfo(type), + }; + if (this.data.formatter) { + config = this.data.formatter(config); + } + days.push(config); + } + this.setData({ days: days }); + }, + getMultipleDayType: function (day) { + var currentDate = this.data.currentDate; + if (!Array.isArray(currentDate)) { + return ''; + } + var isSelected = function (date) { + return currentDate.some(function (item) { return (0, utils_1.compareDay)(item, date) === 0; }); + }; + if (isSelected(day)) { + var prevDay = (0, utils_1.getPrevDay)(day); + var nextDay = (0, utils_1.getNextDay)(day); + var prevSelected = isSelected(prevDay); + var nextSelected = isSelected(nextDay); + if (prevSelected && nextSelected) { + return 'multiple-middle'; + } + if (prevSelected) { + return 'end'; + } + return nextSelected ? 'start' : 'multiple-selected'; + } + return ''; + }, + getRangeDayType: function (day) { + var _a = this.data, currentDate = _a.currentDate, allowSameDay = _a.allowSameDay; + if (!Array.isArray(currentDate)) { + return ''; + } + var startDay = currentDate[0], endDay = currentDate[1]; + if (!startDay) { + return ''; + } + var compareToStart = (0, utils_1.compareDay)(day, startDay); + if (!endDay) { + return compareToStart === 0 ? 'start' : ''; + } + var compareToEnd = (0, utils_1.compareDay)(day, endDay); + if (compareToStart === 0 && compareToEnd === 0 && allowSameDay) { + return 'start-end'; + } + if (compareToStart === 0) { + return 'start'; + } + if (compareToEnd === 0) { + return 'end'; + } + if (compareToStart > 0 && compareToEnd < 0) { + return 'middle'; + } + return ''; + }, + getDayType: function (day) { + var _a = this.data, type = _a.type, minDate = _a.minDate, maxDate = _a.maxDate, currentDate = _a.currentDate; + if ((0, utils_1.compareDay)(day, minDate) < 0 || (0, utils_1.compareDay)(day, maxDate) > 0) { + return 'disabled'; + } + if (type === 'single') { + return (0, utils_1.compareDay)(day, currentDate) === 0 ? 'selected' : ''; + } + if (type === 'multiple') { + return this.getMultipleDayType(day); + } + /* istanbul ignore else */ + if (type === 'range') { + return this.getRangeDayType(day); + } + return ''; + }, + getBottomInfo: function (type) { + if (this.data.type === 'range') { + if (type === 'start') { + return '开始'; + } + if (type === 'end') { + return '结束'; + } + if (type === 'start-end') { + return '开始/结束'; + } + } + }, + }, +}); diff --git a/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/calendar/components/month/index.json b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/calendar/components/month/index.json new file mode 100644 index 0000000..467ce29 --- /dev/null +++ b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/calendar/components/month/index.json @@ -0,0 +1,3 @@ +{ + "component": true +} diff --git a/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/calendar/components/month/index.wxml b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/calendar/components/month/index.wxml new file mode 100644 index 0000000..0c73b2f --- /dev/null +++ b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/calendar/components/month/index.wxml @@ -0,0 +1,39 @@ + + + + + + {{ computed.formatMonthTitle(date) }} + + + + + {{ computed.getMark(date) }} + + + + + {{ item.topInfo }} + {{ item.text }} + + {{ item.bottomInfo }} + + + + + {{ item.topInfo }} + {{ item.text }} + + {{ item.bottomInfo }} + + + + + diff --git a/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/calendar/components/month/index.wxs b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/calendar/components/month/index.wxs new file mode 100644 index 0000000..55e45a5 --- /dev/null +++ b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/calendar/components/month/index.wxs @@ -0,0 +1,71 @@ +/* eslint-disable */ +var utils = require('../../utils.wxs'); + +function getMark(date) { + return getDate(date).getMonth() + 1; +} + +var ROW_HEIGHT = 64; + +function getDayStyle(type, index, date, rowHeight, color, firstDayOfWeek) { + var style = []; + var current = getDate(date).getDay() || 7; + var offset = current < firstDayOfWeek ? (7 - firstDayOfWeek + current) : + current === 7 && firstDayOfWeek === 0 ? 0 : + (current - firstDayOfWeek); + + if (index === 0) { + style.push(['margin-left', (100 * offset) / 7 + '%']); + } + + if (rowHeight !== ROW_HEIGHT) { + style.push(['height', rowHeight + 'px']); + } + + if (color) { + if ( + type === 'start' || + type === 'end' || + type === 'start-end' || + type === 'multiple-selected' || + type === 'multiple-middle' + ) { + style.push(['background', color]); + } else if (type === 'middle') { + style.push(['color', color]); + } + } + + return style + .map(function(item) { + return item.join(':'); + }) + .join(';'); +} + +function formatMonthTitle(date) { + date = getDate(date); + return date.getFullYear() + '年' + (date.getMonth() + 1) + '月'; +} + +function getMonthStyle(visible, date, rowHeight) { + if (!visible) { + date = getDate(date); + + var totalDay = utils.getMonthEndDay( + date.getFullYear(), + date.getMonth() + 1 + ); + var offset = getDate(date).getDay(); + var padding = Math.ceil((totalDay + offset) / 7) * rowHeight; + + return 'padding-bottom:' + padding + 'px'; + } +} + +module.exports = { + getMark: getMark, + getDayStyle: getDayStyle, + formatMonthTitle: formatMonthTitle, + getMonthStyle: getMonthStyle +}; diff --git a/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/calendar/components/month/index.wxss b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/calendar/components/month/index.wxss new file mode 100644 index 0000000..9aee73d --- /dev/null +++ b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/calendar/components/month/index.wxss @@ -0,0 +1 @@ +@import '../../../common/index.wxss';.van-calendar{background-color:var(--calendar-background-color,#fff);display:flex;flex-direction:column;height:100%}.van-calendar__month-title{font-size:var(--calendar-month-title-font-size,14px);font-weight:var(--font-weight-bold,500);height:var(--calendar-header-title-height,44px);line-height:var(--calendar-header-title-height,44px);text-align:center}.van-calendar__days{display:flex;flex-wrap:wrap;position:relative;-webkit-user-select:none;user-select:none}.van-calendar__month-mark{color:var(--calendar-month-mark-color,rgba(242,243,245,.8));font-size:var(--calendar-month-mark-font-size,160px);left:50%;pointer-events:none;position:absolute;top:50%;transform:translate(-50%,-50%);z-index:0}.van-calendar__day,.van-calendar__selected-day{align-items:center;display:flex;justify-content:center;text-align:center}.van-calendar__day{font-size:var(--calendar-day-font-size,16px);height:var(--calendar-day-height,64px);position:relative;width:14.285%}.van-calendar__day--end,.van-calendar__day--multiple-middle,.van-calendar__day--multiple-selected,.van-calendar__day--start,.van-calendar__day--start-end{background-color:var(--calendar-range-edge-background-color,#ee0a24);color:var(--calendar-range-edge-color,#fff)}.van-calendar__day--start{border-radius:4px 0 0 4px}.van-calendar__day--end{border-radius:0 4px 4px 0}.van-calendar__day--multiple-selected,.van-calendar__day--start-end{border-radius:4px}.van-calendar__day--middle{color:var(--calendar-range-middle-color,#ee0a24)}.van-calendar__day--middle:after{background-color:currentColor;bottom:0;content:"";left:0;opacity:var(--calendar-range-middle-background-opacity,.1);position:absolute;right:0;top:0}.van-calendar__day--disabled{color:var(--calendar-day-disabled-color,#c8c9cc);cursor:default}.van-calendar__bottom-info,.van-calendar__top-info{font-size:var(--calendar-info-font-size,10px);left:0;line-height:var(--calendar-info-line-height,14px);position:absolute;right:0}@media (max-width:350px){.van-calendar__bottom-info,.van-calendar__top-info{font-size:9px}}.van-calendar__top-info{top:6px}.van-calendar__bottom-info{bottom:6px}.van-calendar__selected-day{background-color:var(--calendar-selected-day-background-color,#ee0a24);border-radius:4px;color:var(--calendar-selected-day-color,#fff);height:var(--calendar-selected-day-size,54px);width:var(--calendar-selected-day-size,54px)} \ No newline at end of file diff --git a/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/calendar/index.d.ts b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/calendar/index.d.ts new file mode 100644 index 0000000..cb0ff5c --- /dev/null +++ b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/calendar/index.d.ts @@ -0,0 +1 @@ +export {}; diff --git a/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/calendar/index.js b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/calendar/index.js new file mode 100644 index 0000000..d4fbd91 --- /dev/null +++ b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/calendar/index.js @@ -0,0 +1,371 @@ +"use strict"; +var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) { + if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) { + if (ar || !(i in from)) { + if (!ar) ar = Array.prototype.slice.call(from, 0, i); + ar[i] = from[i]; + } + } + return to.concat(ar || Array.prototype.slice.call(from)); +}; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +var component_1 = require("../common/component"); +var utils_1 = require("./utils"); +var toast_1 = __importDefault(require("../toast/toast")); +var utils_2 = require("../common/utils"); +var initialMinDate = (0, utils_1.getToday)().getTime(); +var initialMaxDate = (function () { + var now = (0, utils_1.getToday)(); + return new Date(now.getFullYear(), now.getMonth() + 6, now.getDate()).getTime(); +})(); +var getTime = function (date) { + return date instanceof Date ? date.getTime() : date; +}; +(0, component_1.VantComponent)({ + props: { + title: { + type: String, + value: '日期选择', + }, + color: String, + show: { + type: Boolean, + observer: function (val) { + if (val) { + this.initRect(); + this.scrollIntoView(); + } + }, + }, + formatter: null, + confirmText: { + type: String, + value: '确定', + }, + confirmDisabledText: { + type: String, + value: '确定', + }, + rangePrompt: String, + showRangePrompt: { + type: Boolean, + value: true, + }, + defaultDate: { + type: null, + value: (0, utils_1.getToday)().getTime(), + observer: function (val) { + this.setData({ currentDate: val }); + this.scrollIntoView(); + }, + }, + allowSameDay: Boolean, + type: { + type: String, + value: 'single', + observer: 'reset', + }, + minDate: { + type: Number, + value: initialMinDate, + }, + maxDate: { + type: Number, + value: initialMaxDate, + }, + position: { + type: String, + value: 'bottom', + }, + rowHeight: { + type: null, + value: utils_1.ROW_HEIGHT, + }, + round: { + type: Boolean, + value: true, + }, + poppable: { + type: Boolean, + value: true, + }, + showMark: { + type: Boolean, + value: true, + }, + showTitle: { + type: Boolean, + value: true, + }, + showConfirm: { + type: Boolean, + value: true, + }, + showSubtitle: { + type: Boolean, + value: true, + }, + safeAreaInsetBottom: { + type: Boolean, + value: true, + }, + closeOnClickOverlay: { + type: Boolean, + value: true, + }, + maxRange: { + type: null, + value: null, + }, + minRange: { + type: Number, + value: 1, + }, + firstDayOfWeek: { + type: Number, + value: 0, + }, + readonly: Boolean, + }, + data: { + subtitle: '', + currentDate: null, + scrollIntoView: '', + }, + created: function () { + this.setData({ + currentDate: this.getInitialDate(this.data.defaultDate), + }); + }, + mounted: function () { + if (this.data.show || !this.data.poppable) { + this.initRect(); + this.scrollIntoView(); + } + }, + methods: { + reset: function () { + this.setData({ currentDate: this.getInitialDate() }); + this.scrollIntoView(); + }, + initRect: function () { + var _this = this; + if (this.contentObserver != null) { + this.contentObserver.disconnect(); + } + var contentObserver = this.createIntersectionObserver({ + thresholds: [0, 0.1, 0.9, 1], + observeAll: true, + }); + this.contentObserver = contentObserver; + contentObserver.relativeTo('.van-calendar__body'); + contentObserver.observe('.month', function (res) { + if (res.boundingClientRect.top <= res.relativeRect.top) { + // @ts-ignore + _this.setData({ subtitle: (0, utils_1.formatMonthTitle)(res.dataset.date) }); + } + }); + }, + limitDateRange: function (date, minDate, maxDate) { + if (minDate === void 0) { minDate = null; } + if (maxDate === void 0) { maxDate = null; } + minDate = minDate || this.data.minDate; + maxDate = maxDate || this.data.maxDate; + if ((0, utils_1.compareDay)(date, minDate) === -1) { + return minDate; + } + if ((0, utils_1.compareDay)(date, maxDate) === 1) { + return maxDate; + } + return date; + }, + getInitialDate: function (defaultDate) { + var _this = this; + if (defaultDate === void 0) { defaultDate = null; } + var _a = this.data, type = _a.type, minDate = _a.minDate, maxDate = _a.maxDate, allowSameDay = _a.allowSameDay; + if (!defaultDate) + return []; + var now = (0, utils_1.getToday)().getTime(); + if (type === 'range') { + if (!Array.isArray(defaultDate)) { + defaultDate = []; + } + var _b = defaultDate || [], startDay = _b[0], endDay = _b[1]; + var startDate = getTime(startDay || now); + var start = this.limitDateRange(startDate, minDate, allowSameDay ? startDate : (0, utils_1.getPrevDay)(new Date(maxDate)).getTime()); + var date = getTime(endDay || now); + var end = this.limitDateRange(date, allowSameDay ? date : (0, utils_1.getNextDay)(new Date(minDate)).getTime()); + return [start, end]; + } + if (type === 'multiple') { + if (Array.isArray(defaultDate)) { + return defaultDate.map(function (date) { return _this.limitDateRange(date); }); + } + return [this.limitDateRange(now)]; + } + if (!defaultDate || Array.isArray(defaultDate)) { + defaultDate = now; + } + return this.limitDateRange(defaultDate); + }, + scrollIntoView: function () { + var _this = this; + (0, utils_2.requestAnimationFrame)(function () { + var _a = _this.data, currentDate = _a.currentDate, type = _a.type, show = _a.show, poppable = _a.poppable, minDate = _a.minDate, maxDate = _a.maxDate; + if (!currentDate) + return; + // @ts-ignore + var targetDate = type === 'single' ? currentDate : currentDate[0]; + var displayed = show || !poppable; + if (!targetDate || !displayed) { + return; + } + var months = (0, utils_1.getMonths)(minDate, maxDate); + months.some(function (month, index) { + if ((0, utils_1.compareMonth)(month, targetDate) === 0) { + _this.setData({ scrollIntoView: "month".concat(index) }); + return true; + } + return false; + }); + }); + }, + onOpen: function () { + this.$emit('open'); + }, + onOpened: function () { + this.$emit('opened'); + }, + onClose: function () { + this.$emit('close'); + }, + onClosed: function () { + this.$emit('closed'); + }, + onClickDay: function (event) { + if (this.data.readonly) { + return; + } + var date = event.detail.date; + var _a = this.data, type = _a.type, currentDate = _a.currentDate, allowSameDay = _a.allowSameDay; + if (type === 'range') { + // @ts-ignore + var startDay_1 = currentDate[0], endDay = currentDate[1]; + if (startDay_1 && !endDay) { + var compareToStart = (0, utils_1.compareDay)(date, startDay_1); + if (compareToStart === 1) { + var days_1 = this.selectComponent('.month').data.days; + days_1.some(function (day, index) { + var isDisabled = day.type === 'disabled' && + getTime(startDay_1) < getTime(day.date) && + getTime(day.date) < getTime(date); + if (isDisabled) { + (date = days_1[index - 1].date); + } + return isDisabled; + }); + this.select([startDay_1, date], true); + } + else if (compareToStart === -1) { + this.select([date, null]); + } + else if (allowSameDay) { + this.select([date, date], true); + } + } + else { + this.select([date, null]); + } + } + else if (type === 'multiple') { + var selectedIndex_1; + // @ts-ignore + var selected = currentDate.some(function (dateItem, index) { + var equal = (0, utils_1.compareDay)(dateItem, date) === 0; + if (equal) { + selectedIndex_1 = index; + } + return equal; + }); + if (selected) { + // @ts-ignore + var cancelDate = currentDate.splice(selectedIndex_1, 1); + this.setData({ currentDate: currentDate }); + this.unselect(cancelDate); + } + else { + // @ts-ignore + this.select(__spreadArray(__spreadArray([], currentDate, true), [date], false)); + } + } + else { + this.select(date, true); + } + }, + unselect: function (dateArray) { + var date = dateArray[0]; + if (date) { + this.$emit('unselect', (0, utils_1.copyDates)(date)); + } + }, + select: function (date, complete) { + if (complete && this.data.type === 'range') { + var valid = this.checkRange(date); + if (!valid) { + // auto selected to max range if showConfirm + if (this.data.showConfirm) { + this.emit([ + date[0], + (0, utils_1.getDayByOffset)(date[0], this.data.maxRange - 1), + ]); + } + else { + this.emit(date); + } + return; + } + } + this.emit(date); + if (complete && !this.data.showConfirm) { + this.onConfirm(); + } + }, + emit: function (date) { + this.setData({ + currentDate: Array.isArray(date) ? date.map(getTime) : getTime(date), + }); + this.$emit('select', (0, utils_1.copyDates)(date)); + }, + checkRange: function (date) { + var _a = this.data, maxRange = _a.maxRange, rangePrompt = _a.rangePrompt, showRangePrompt = _a.showRangePrompt; + if (maxRange && (0, utils_1.calcDateNum)(date) > maxRange) { + if (showRangePrompt) { + (0, toast_1.default)({ + context: this, + message: rangePrompt || "\u9009\u62E9\u5929\u6570\u4E0D\u80FD\u8D85\u8FC7 ".concat(maxRange, " \u5929"), + }); + } + this.$emit('over-range'); + return false; + } + return true; + }, + onConfirm: function () { + var _this = this; + if (this.data.type === 'range' && + !this.checkRange(this.data.currentDate)) { + return; + } + wx.nextTick(function () { + // @ts-ignore + _this.$emit('confirm', (0, utils_1.copyDates)(_this.data.currentDate)); + }); + }, + onClickSubtitle: function (event) { + this.$emit('click-subtitle', event); + }, + }, +}); diff --git a/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/calendar/index.json b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/calendar/index.json new file mode 100644 index 0000000..397d5ae --- /dev/null +++ b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/calendar/index.json @@ -0,0 +1,10 @@ +{ + "component": true, + "usingComponents": { + "header": "./components/header/index", + "month": "./components/month/index", + "van-button": "../button/index", + "van-popup": "../popup/index", + "van-toast": "../toast/index" + } +} diff --git a/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/calendar/index.wxml b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/calendar/index.wxml new file mode 100644 index 0000000..9667eef --- /dev/null +++ b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/calendar/index.wxml @@ -0,0 +1,26 @@ + + + + + + + + + + + + diff --git a/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/calendar/index.wxs b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/calendar/index.wxs new file mode 100644 index 0000000..0a56646 --- /dev/null +++ b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/calendar/index.wxs @@ -0,0 +1,37 @@ +/* eslint-disable */ +var utils = require('./utils.wxs'); + +function getMonths(minDate, maxDate) { + var months = []; + var cursor = getDate(minDate); + + cursor.setDate(1); + + do { + months.push(cursor.getTime()); + cursor.setMonth(cursor.getMonth() + 1); + } while (utils.compareMonth(cursor, getDate(maxDate)) !== 1); + + return months; +} + +function getButtonDisabled(type, currentDate, minRange) { + if (currentDate == null) { + return true; + } + + if (type === 'range') { + return !currentDate[0] || !currentDate[1]; + } + + if (type === 'multiple') { + return currentDate.length < minRange; + } + + return !currentDate; +} + +module.exports = { + getMonths: getMonths, + getButtonDisabled: getButtonDisabled +}; diff --git a/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/calendar/index.wxss b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/calendar/index.wxss new file mode 100644 index 0000000..a1f1cf0 --- /dev/null +++ b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/calendar/index.wxss @@ -0,0 +1 @@ +@import '../common/index.wxss';.van-calendar{background-color:var(--calendar-background-color,#fff);display:flex;flex-direction:column;height:var(--calendar-height,100%)}.van-calendar__close-icon{top:11px}.van-calendar__popup--bottom,.van-calendar__popup--top{height:var(--calendar-popup-height,90%)}.van-calendar__popup--left,.van-calendar__popup--right{height:100%}.van-calendar__body{-webkit-overflow-scrolling:touch;flex:1;overflow:auto}.van-calendar__footer{flex-shrink:0;padding:0 var(--padding-md,16px)}.van-calendar__footer--safe-area-inset-bottom{padding-bottom:env(safe-area-inset-bottom)}.van-calendar__footer+.van-calendar__footer,.van-calendar__footer:empty{display:none}.van-calendar__footer:empty+.van-calendar__footer{display:block!important}.van-calendar__confirm{height:var(--calendar-confirm-button-height,36px)!important;line-height:var(--calendar-confirm-button-line-height,34px)!important;margin:var(--calendar-confirm-button-margin,7px 0)!important} \ No newline at end of file diff --git a/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/calendar/utils.d.ts b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/calendar/utils.d.ts new file mode 100644 index 0000000..889e6e7 --- /dev/null +++ b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/calendar/utils.d.ts @@ -0,0 +1,12 @@ +export declare const ROW_HEIGHT = 64; +export declare function formatMonthTitle(date: Date): string; +export declare function compareMonth(date1: Date | number, date2: Date | number): 0 | 1 | -1; +export declare function compareDay(day1: Date | number, day2: Date | number): 0 | 1 | -1; +export declare function getDayByOffset(date: Date, offset: number): Date; +export declare function getPrevDay(date: Date): Date; +export declare function getNextDay(date: Date): Date; +export declare function getToday(): Date; +export declare function calcDateNum(date: [Date, Date]): number; +export declare function copyDates(dates: Date | Date[]): Date | Date[]; +export declare function getMonthEndDay(year: number, month: number): number; +export declare function getMonths(minDate: number, maxDate: number): number[]; diff --git a/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/calendar/utils.js b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/calendar/utils.js new file mode 100644 index 0000000..c9e5df7 --- /dev/null +++ b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/calendar/utils.js @@ -0,0 +1,97 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.getMonths = exports.getMonthEndDay = exports.copyDates = exports.calcDateNum = exports.getToday = exports.getNextDay = exports.getPrevDay = exports.getDayByOffset = exports.compareDay = exports.compareMonth = exports.formatMonthTitle = exports.ROW_HEIGHT = void 0; +exports.ROW_HEIGHT = 64; +function formatMonthTitle(date) { + if (!(date instanceof Date)) { + date = new Date(date); + } + return "".concat(date.getFullYear(), "\u5E74").concat(date.getMonth() + 1, "\u6708"); +} +exports.formatMonthTitle = formatMonthTitle; +function compareMonth(date1, date2) { + if (!(date1 instanceof Date)) { + date1 = new Date(date1); + } + if (!(date2 instanceof Date)) { + date2 = new Date(date2); + } + var year1 = date1.getFullYear(); + var year2 = date2.getFullYear(); + var month1 = date1.getMonth(); + var month2 = date2.getMonth(); + if (year1 === year2) { + return month1 === month2 ? 0 : month1 > month2 ? 1 : -1; + } + return year1 > year2 ? 1 : -1; +} +exports.compareMonth = compareMonth; +function compareDay(day1, day2) { + if (!(day1 instanceof Date)) { + day1 = new Date(day1); + } + if (!(day2 instanceof Date)) { + day2 = new Date(day2); + } + var compareMonthResult = compareMonth(day1, day2); + if (compareMonthResult === 0) { + var date1 = day1.getDate(); + var date2 = day2.getDate(); + return date1 === date2 ? 0 : date1 > date2 ? 1 : -1; + } + return compareMonthResult; +} +exports.compareDay = compareDay; +function getDayByOffset(date, offset) { + date = new Date(date); + date.setDate(date.getDate() + offset); + return date; +} +exports.getDayByOffset = getDayByOffset; +function getPrevDay(date) { + return getDayByOffset(date, -1); +} +exports.getPrevDay = getPrevDay; +function getNextDay(date) { + return getDayByOffset(date, 1); +} +exports.getNextDay = getNextDay; +function getToday() { + var today = new Date(); + today.setHours(0, 0, 0, 0); + return today; +} +exports.getToday = getToday; +function calcDateNum(date) { + var day1 = new Date(date[0]).getTime(); + var day2 = new Date(date[1]).getTime(); + return (day2 - day1) / (1000 * 60 * 60 * 24) + 1; +} +exports.calcDateNum = calcDateNum; +function copyDates(dates) { + if (Array.isArray(dates)) { + return dates.map(function (date) { + if (date === null) { + return date; + } + return new Date(date); + }); + } + return new Date(dates); +} +exports.copyDates = copyDates; +function getMonthEndDay(year, month) { + return 32 - new Date(year, month - 1, 32).getDate(); +} +exports.getMonthEndDay = getMonthEndDay; +function getMonths(minDate, maxDate) { + var months = []; + var cursor = new Date(minDate); + cursor.setDate(1); + do { + months.push(cursor.getTime()); + cursor.setMonth(cursor.getMonth() + 1); + } while (compareMonth(cursor, maxDate) !== 1); + return months; +} +exports.getMonths = getMonths; diff --git a/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/calendar/utils.wxs b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/calendar/utils.wxs new file mode 100644 index 0000000..e57f6b3 --- /dev/null +++ b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/calendar/utils.wxs @@ -0,0 +1,25 @@ +/* eslint-disable */ +function getMonthEndDay(year, month) { + return 32 - getDate(year, month - 1, 32).getDate(); +} + +function compareMonth(date1, date2) { + date1 = getDate(date1); + date2 = getDate(date2); + + var year1 = date1.getFullYear(); + var year2 = date2.getFullYear(); + var month1 = date1.getMonth(); + var month2 = date2.getMonth(); + + if (year1 === year2) { + return month1 === month2 ? 0 : month1 > month2 ? 1 : -1; + } + + return year1 > year2 ? 1 : -1; +} + +module.exports = { + getMonthEndDay: getMonthEndDay, + compareMonth: compareMonth +}; diff --git a/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/card/index.d.ts b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/card/index.d.ts new file mode 100644 index 0000000..cb0ff5c --- /dev/null +++ b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/card/index.d.ts @@ -0,0 +1 @@ +export {}; diff --git a/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/card/index.js b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/card/index.js new file mode 100644 index 0000000..2815655 --- /dev/null +++ b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/card/index.js @@ -0,0 +1,51 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var link_1 = require("../mixins/link"); +var component_1 = require("../common/component"); +(0, component_1.VantComponent)({ + classes: [ + 'num-class', + 'desc-class', + 'thumb-class', + 'title-class', + 'price-class', + 'origin-price-class', + ], + mixins: [link_1.link], + props: { + tag: String, + num: String, + desc: String, + thumb: String, + title: String, + price: { + type: String, + observer: 'updatePrice', + }, + centered: Boolean, + lazyLoad: Boolean, + thumbLink: String, + originPrice: String, + thumbMode: { + type: String, + value: 'aspectFit', + }, + currency: { + type: String, + value: '¥', + }, + }, + methods: { + updatePrice: function () { + var price = this.data.price; + var priceArr = price.toString().split('.'); + this.setData({ + integerStr: priceArr[0], + decimalStr: priceArr[1] ? ".".concat(priceArr[1]) : '', + }); + }, + onClickThumb: function () { + this.jumpLink('thumbLink'); + }, + }, +}); diff --git a/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/card/index.json b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/card/index.json new file mode 100644 index 0000000..e917407 --- /dev/null +++ b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/card/index.json @@ -0,0 +1,6 @@ +{ + "component": true, + "usingComponents": { + "van-tag": "../tag/index" + } +} diff --git a/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/card/index.wxml b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/card/index.wxml new file mode 100644 index 0000000..62173e4 --- /dev/null +++ b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/card/index.wxml @@ -0,0 +1,56 @@ + + + + + + + + + {{ tag }} + + + + + + + {{ title }} + + + {{ desc }} + + + + + + + + + {{ currency }} + {{ integerStr }} + {{ decimalStr }} + + + {{ currency }} {{ originPrice }} + + x {{ num }} + + + + + + + + + + diff --git a/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/card/index.wxss b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/card/index.wxss new file mode 100644 index 0000000..0f4d7c5 --- /dev/null +++ b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/card/index.wxss @@ -0,0 +1 @@ +@import '../common/index.wxss';.van-card{background-color:var(--card-background-color,#fafafa);box-sizing:border-box;color:var(--card-text-color,#323233);font-size:var(--card-font-size,12px);padding:var(--card-padding,8px 16px);position:relative}.van-card__header{display:flex}.van-card__header--center{align-items:center;justify-content:center}.van-card__thumb{flex:none;height:var(--card-thumb-size,88px);margin-right:var(--padding-xs,8px);position:relative;width:var(--card-thumb-size,88px)}.van-card__thumb:empty{display:none}.van-card__img{border-radius:8px;height:100%;width:100%}.van-card__content{display:flex;flex:1;flex-direction:column;justify-content:space-between;min-height:var(--card-thumb-size,88px);min-width:0;position:relative}.van-card__content--center{justify-content:center}.van-card__desc,.van-card__title{word-wrap:break-word}.van-card__title{font-weight:700;line-height:var(--card-title-line-height,16px)}.van-card__desc{color:var(--card-desc-color,#646566);line-height:var(--card-desc-line-height,20px)}.van-card__bottom{line-height:20px}.van-card__price{color:var(--card-price-color,#ee0a24);display:inline-block;font-size:var(--card-price-font-size,12px);font-weight:700}.van-card__price-integer{font-size:var(--card-price-integer-font-size,16px)}.van-card__price-decimal,.van-card__price-integer{font-family:var(--card-price-font-family,Avenir-Heavy,PingFang SC,Helvetica Neue,Arial,sans-serif)}.van-card__origin-price{color:var(--card-origin-price-color,#646566);display:inline-block;font-size:var(--card-origin-price-font-size,10px);margin-left:5px;text-decoration:line-through}.van-card__num{float:right}.van-card__tag{left:0;position:absolute!important;top:2px}.van-card__footer{flex:none;text-align:right;width:100%} \ No newline at end of file diff --git a/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/cascader/index.d.ts b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/cascader/index.d.ts new file mode 100644 index 0000000..cb0ff5c --- /dev/null +++ b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/cascader/index.d.ts @@ -0,0 +1 @@ +export {}; diff --git a/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/cascader/index.js b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/cascader/index.js new file mode 100644 index 0000000..63915ee --- /dev/null +++ b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/cascader/index.js @@ -0,0 +1,222 @@ +"use strict"; +var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) { + if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) { + if (ar || !(i in from)) { + if (!ar) ar = Array.prototype.slice.call(from, 0, i); + ar[i] = from[i]; + } + } + return to.concat(ar || Array.prototype.slice.call(from)); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +var component_1 = require("../common/component"); +var FieldName; +(function (FieldName) { + FieldName["TEXT"] = "text"; + FieldName["VALUE"] = "value"; + FieldName["CHILDREN"] = "children"; +})(FieldName || (FieldName = {})); +var defaultFieldNames = { + text: FieldName.TEXT, + value: FieldName.VALUE, + children: FieldName.CHILDREN, +}; +(0, component_1.VantComponent)({ + props: { + title: String, + value: { + type: String, + }, + placeholder: { + type: String, + value: '请选择', + }, + activeColor: { + type: String, + value: '#1989fa', + }, + options: { + type: Array, + value: [], + }, + swipeable: { + type: Boolean, + value: false, + }, + closeable: { + type: Boolean, + value: true, + }, + showHeader: { + type: Boolean, + value: true, + }, + closeIcon: { + type: String, + value: 'cross', + }, + fieldNames: { + type: Object, + value: defaultFieldNames, + observer: 'updateFieldNames', + }, + }, + data: { + tabs: [], + activeTab: 0, + textKey: FieldName.TEXT, + valueKey: FieldName.VALUE, + childrenKey: FieldName.CHILDREN, + innerValue: '', + }, + watch: { + options: function () { + this.updateTabs(); + }, + value: function (newVal) { + this.updateValue(newVal); + }, + }, + created: function () { + this.updateTabs(); + }, + methods: { + updateValue: function (val) { + var _this = this; + if (val !== undefined) { + var values = this.data.tabs.map(function (tab) { return tab.selected && tab.selected[_this.data.valueKey]; }); + if (values.indexOf(val) > -1) { + return; + } + } + this.innerValue = val; + this.updateTabs(); + }, + updateFieldNames: function () { + var _a = this.data.fieldNames || defaultFieldNames, _b = _a.text, text = _b === void 0 ? 'text' : _b, _c = _a.value, value = _c === void 0 ? 'value' : _c, _d = _a.children, children = _d === void 0 ? 'children' : _d; + this.setData({ + textKey: text, + valueKey: value, + childrenKey: children, + }); + }, + getSelectedOptionsByValue: function (options, value) { + for (var i = 0; i < options.length; i++) { + var option = options[i]; + if (option[this.data.valueKey] === value) { + return [option]; + } + if (option[this.data.childrenKey]) { + var selectedOptions = this.getSelectedOptionsByValue(option[this.data.childrenKey], value); + if (selectedOptions) { + return __spreadArray([option], selectedOptions, true); + } + } + } + }, + updateTabs: function () { + var _this = this; + var options = this.data.options; + var innerValue = this.innerValue; + if (!options.length) { + return; + } + if (innerValue !== undefined) { + var selectedOptions = this.getSelectedOptionsByValue(options, innerValue); + if (selectedOptions) { + var optionsCursor_1 = options; + var tabs_1 = selectedOptions.map(function (option) { + var tab = { + options: optionsCursor_1, + selected: option, + }; + var next = optionsCursor_1.find(function (item) { return item[_this.data.valueKey] === option[_this.data.valueKey]; }); + if (next) { + optionsCursor_1 = next[_this.data.childrenKey]; + } + return tab; + }); + if (optionsCursor_1) { + tabs_1.push({ + options: optionsCursor_1, + selected: null, + }); + } + this.setData({ + tabs: tabs_1, + }); + wx.nextTick(function () { + _this.setData({ + activeTab: tabs_1.length - 1, + }); + }); + return; + } + } + this.setData({ + tabs: [ + { + options: options, + selected: null, + }, + ], + }); + }, + onClose: function () { + this.$emit('close'); + }, + onClickTab: function (e) { + var _a = e.detail, tabIndex = _a.index, title = _a.title; + this.$emit('click-tab', { title: title, tabIndex: tabIndex }); + this.setData({ + activeTab: tabIndex, + }); + }, + // 选中 + onSelect: function (e) { + var _this = this; + var _a = e.currentTarget.dataset, option = _a.option, tabIndex = _a.tabIndex; + if (option && option.disabled) { + return; + } + var _b = this.data, valueKey = _b.valueKey, childrenKey = _b.childrenKey; + var tabs = this.data.tabs; + tabs[tabIndex].selected = option; + if (tabs.length > tabIndex + 1) { + tabs = tabs.slice(0, tabIndex + 1); + } + if (option[childrenKey]) { + var nextTab = { + options: option[childrenKey], + selected: null, + }; + if (tabs[tabIndex + 1]) { + tabs[tabIndex + 1] = nextTab; + } + else { + tabs.push(nextTab); + } + wx.nextTick(function () { + _this.setData({ + activeTab: tabIndex + 1, + }); + }); + } + this.setData({ + tabs: tabs, + }); + var selectedOptions = tabs.map(function (tab) { return tab.selected; }).filter(Boolean); + var value = option[valueKey]; + var params = { + value: value, + tabIndex: tabIndex, + selectedOptions: selectedOptions, + }; + this.innerValue = value; + this.$emit('change', params); + if (!option[childrenKey]) { + this.$emit('finish', params); + } + }, + }, +}); diff --git a/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/cascader/index.json b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/cascader/index.json new file mode 100644 index 0000000..d0f75eb --- /dev/null +++ b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/cascader/index.json @@ -0,0 +1,8 @@ +{ + "component": true, + "usingComponents": { + "van-icon": "../icon/index", + "van-tab": "../tab/index", + "van-tabs": "../tabs/index" + } +} \ No newline at end of file diff --git a/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/cascader/index.wxml b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/cascader/index.wxml new file mode 100644 index 0000000..1794b82 --- /dev/null +++ b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/cascader/index.wxml @@ -0,0 +1,53 @@ + + + + {{ title }} + + + + + + + + + + + {{ option[textKey] }} + + + + + + + diff --git a/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/cascader/index.wxs b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/cascader/index.wxs new file mode 100644 index 0000000..b1aab58 --- /dev/null +++ b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/cascader/index.wxs @@ -0,0 +1,24 @@ +var utils = require('../wxs/utils.wxs'); +var style = require('../wxs/style.wxs'); + +function isSelected(tab, valueKey, option) { + return tab.selected && tab.selected[valueKey] === option[valueKey] +} + +function optionClass(tab, valueKey, option) { + return utils.bem('cascader__option', { selected: isSelected(tab, valueKey, option), disabled: option.disabled }) +} + +function optionStyle(data) { + var color = data.option.color || (isSelected(data.tab, data.valueKey, data.option) ? data.activeColor : undefined); + return style({ + color + }); +} + + +module.exports = { + isSelected: isSelected, + optionClass: optionClass, + optionStyle: optionStyle, +}; \ No newline at end of file diff --git a/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/cascader/index.wxss b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/cascader/index.wxss new file mode 100644 index 0000000..7062486 --- /dev/null +++ b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/cascader/index.wxss @@ -0,0 +1 @@ +@import '../common/index.wxss';.van-cascader__header{align-items:center;display:flex;height:48px;justify-content:space-between;padding:0 16px}.van-cascader__title{font-size:16px;font-weight:600;line-height:20px}.van-cascader__close-icon{color:#c8c9cc;font-size:22px;height:22px}.van-cascader__tabs-wrap{height:48px!important;padding:0 8px}.van-cascader__tab{color:#323233!important;flex:none!important;font-weight:600!important;padding:0 8px!important}.van-cascader__tab--unselected{color:#969799!important;font-weight:400!important}.van-cascader__option{align-items:center;cursor:pointer;display:flex;font-size:14px;justify-content:space-between;line-height:20px;padding:10px 16px}.van-cascader__option:active{background-color:#f2f3f5}.van-cascader__option--selected{color:#1989fa;font-weight:600}.van-cascader__option--disabled{color:#c8c9cc;cursor:not-allowed}.van-cascader__option--disabled:active{background-color:initial}.van-cascader__options{-webkit-overflow-scrolling:touch;box-sizing:border-box;height:384px;overflow-y:auto;padding-top:6px} \ No newline at end of file diff --git a/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/cell-group/index.d.ts b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/cell-group/index.d.ts new file mode 100644 index 0000000..cb0ff5c --- /dev/null +++ b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/cell-group/index.d.ts @@ -0,0 +1 @@ +export {}; diff --git a/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/cell-group/index.js b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/cell-group/index.js new file mode 100644 index 0000000..34a93a6 --- /dev/null +++ b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/cell-group/index.js @@ -0,0 +1,13 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var component_1 = require("../common/component"); +(0, component_1.VantComponent)({ + props: { + title: String, + border: { + type: Boolean, + value: true, + }, + inset: Boolean, + }, +}); diff --git a/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/cell-group/index.json b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/cell-group/index.json new file mode 100644 index 0000000..467ce29 --- /dev/null +++ b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/cell-group/index.json @@ -0,0 +1,3 @@ +{ + "component": true +} diff --git a/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/cell-group/index.wxml b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/cell-group/index.wxml new file mode 100644 index 0000000..311e064 --- /dev/null +++ b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/cell-group/index.wxml @@ -0,0 +1,11 @@ + + + + {{ title }} + + + + diff --git a/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/cell-group/index.wxss b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/cell-group/index.wxss new file mode 100644 index 0000000..08b252f --- /dev/null +++ b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/cell-group/index.wxss @@ -0,0 +1 @@ +@import '../common/index.wxss';.van-cell-group--inset{border-radius:var(--cell-group-inset-border-radius,8px);margin:var(--cell-group-inset-padding,0 16px);overflow:hidden}.van-cell-group__title{color:var(--cell-group-title-color,#969799);font-size:var(--cell-group-title-font-size,14px);line-height:var(--cell-group-title-line-height,16px);padding:var(--cell-group-title-padding,16px 16px 8px)}.van-cell-group__title--inset{padding:var(--cell-group-inset-title-padding,16px 16px 8px 32px)} \ No newline at end of file diff --git a/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/cell/index.d.ts b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/cell/index.d.ts new file mode 100644 index 0000000..cb0ff5c --- /dev/null +++ b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/cell/index.d.ts @@ -0,0 +1 @@ +export {}; diff --git a/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/cell/index.js b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/cell/index.js new file mode 100644 index 0000000..80f3039 --- /dev/null +++ b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/cell/index.js @@ -0,0 +1,40 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var link_1 = require("../mixins/link"); +var component_1 = require("../common/component"); +(0, component_1.VantComponent)({ + classes: [ + 'title-class', + 'label-class', + 'value-class', + 'right-icon-class', + 'hover-class', + ], + mixins: [link_1.link], + props: { + title: null, + value: null, + icon: String, + size: String, + label: String, + center: Boolean, + isLink: Boolean, + required: Boolean, + clickable: Boolean, + titleWidth: String, + customStyle: String, + arrowDirection: String, + useLabelSlot: Boolean, + border: { + type: Boolean, + value: true, + }, + titleStyle: String, + }, + methods: { + onClick: function (event) { + this.$emit('click', event.detail); + this.jumpLink(); + }, + }, +}); diff --git a/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/cell/index.json b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/cell/index.json new file mode 100644 index 0000000..0a336c0 --- /dev/null +++ b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/cell/index.json @@ -0,0 +1,6 @@ +{ + "component": true, + "usingComponents": { + "van-icon": "../icon/index" + } +} diff --git a/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/cell/index.wxml b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/cell/index.wxml new file mode 100644 index 0000000..8387c3c --- /dev/null +++ b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/cell/index.wxml @@ -0,0 +1,47 @@ + + + + + + + + + + {{ title }} + + + + + {{ label }} + + + + + {{ value }} + + + + + + + + diff --git a/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/cell/index.wxs b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/cell/index.wxs new file mode 100644 index 0000000..e3500c4 --- /dev/null +++ b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/cell/index.wxs @@ -0,0 +1,17 @@ +/* eslint-disable */ +var style = require('../wxs/style.wxs'); +var addUnit = require('../wxs/add-unit.wxs'); + +function titleStyle(data) { + return style([ + { + 'max-width': addUnit(data.titleWidth), + 'min-width': addUnit(data.titleWidth), + }, + data.titleStyle, + ]); +} + +module.exports = { + titleStyle: titleStyle, +}; diff --git a/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/cell/index.wxss b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/cell/index.wxss new file mode 100644 index 0000000..1802f8e --- /dev/null +++ b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/cell/index.wxss @@ -0,0 +1 @@ +@import '../common/index.wxss';.van-cell{background-color:var(--cell-background-color,#fff);box-sizing:border-box;color:var(--cell-text-color,#323233);display:flex;font-size:var(--cell-font-size,14px);line-height:var(--cell-line-height,24px);padding:var(--cell-vertical-padding,10px) var(--cell-horizontal-padding,16px);position:relative;width:100%}.van-cell:after{border-bottom:1px solid #ebedf0;bottom:0;box-sizing:border-box;content:" ";left:16px;pointer-events:none;position:absolute;right:16px;transform:scaleY(.5);transform-origin:center}.van-cell--borderless:after{display:none}.van-cell-group{background-color:var(--cell-background-color,#fff)}.van-cell__label{color:var(--cell-label-color,#969799);font-size:var(--cell-label-font-size,12px);line-height:var(--cell-label-line-height,18px);margin-top:var(--cell-label-margin-top,3px)}.van-cell__value{color:var(--cell-value-color,#969799);overflow:hidden;text-align:right;vertical-align:middle}.van-cell__title,.van-cell__value{flex:1}.van-cell__title:empty,.van-cell__value:empty{display:none}.van-cell__left-icon-wrap,.van-cell__right-icon-wrap{align-items:center;display:flex;font-size:var(--cell-icon-size,16px);height:var(--cell-line-height,24px)}.van-cell__left-icon-wrap{margin-right:var(--padding-base,4px)}.van-cell__right-icon-wrap{color:var(--cell-right-icon-color,#969799);margin-left:var(--padding-base,4px)}.van-cell__left-icon{vertical-align:middle}.van-cell__left-icon,.van-cell__right-icon{line-height:var(--cell-line-height,24px)}.van-cell--clickable.van-cell--hover{background-color:var(--cell-active-color,#f2f3f5)}.van-cell--required{overflow:visible}.van-cell--required:before{color:var(--cell-required-color,#ee0a24);content:"*";font-size:var(--cell-font-size,14px);left:var(--padding-xs,8px);position:absolute}.van-cell--center{align-items:center}.van-cell--large{padding-bottom:var(--cell-large-vertical-padding,12px);padding-top:var(--cell-large-vertical-padding,12px)}.van-cell--large .van-cell__title{font-size:var(--cell-large-title-font-size,16px)}.van-cell--large .van-cell__value{font-size:var(--cell-large-value-font-size,16px)}.van-cell--large .van-cell__label{font-size:var(--cell-large-label-font-size,14px)} \ No newline at end of file diff --git a/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/checkbox-group/index.d.ts b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/checkbox-group/index.d.ts new file mode 100644 index 0000000..cb0ff5c --- /dev/null +++ b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/checkbox-group/index.d.ts @@ -0,0 +1 @@ +export {}; diff --git a/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/checkbox-group/index.js b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/checkbox-group/index.js new file mode 100644 index 0000000..80c93a1 --- /dev/null +++ b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/checkbox-group/index.js @@ -0,0 +1,39 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var relation_1 = require("../common/relation"); +var component_1 = require("../common/component"); +(0, component_1.VantComponent)({ + field: true, + relation: (0, relation_1.useChildren)('checkbox', function (target) { + this.updateChild(target); + }), + props: { + max: Number, + value: { + type: Array, + observer: 'updateChildren', + }, + disabled: { + type: Boolean, + observer: 'updateChildren', + }, + direction: { + type: String, + value: 'vertical', + }, + }, + methods: { + updateChildren: function () { + var _this = this; + this.children.forEach(function (child) { return _this.updateChild(child); }); + }, + updateChild: function (child) { + var _a = this.data, value = _a.value, disabled = _a.disabled, direction = _a.direction; + child.setData({ + value: value.indexOf(child.data.name) !== -1, + parentDisabled: disabled, + direction: direction, + }); + }, + }, +}); diff --git a/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/checkbox-group/index.json b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/checkbox-group/index.json new file mode 100644 index 0000000..467ce29 --- /dev/null +++ b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/checkbox-group/index.json @@ -0,0 +1,3 @@ +{ + "component": true +} diff --git a/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/checkbox-group/index.wxml b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/checkbox-group/index.wxml new file mode 100644 index 0000000..638bf9d --- /dev/null +++ b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/checkbox-group/index.wxml @@ -0,0 +1,5 @@ + + + + + diff --git a/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/checkbox-group/index.wxss b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/checkbox-group/index.wxss new file mode 100644 index 0000000..c5666d7 --- /dev/null +++ b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/checkbox-group/index.wxss @@ -0,0 +1 @@ +@import '../common/index.wxss';.van-checkbox-group--horizontal{display:flex;flex-wrap:wrap} \ No newline at end of file diff --git a/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/checkbox/index.d.ts b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/checkbox/index.d.ts new file mode 100644 index 0000000..cb0ff5c --- /dev/null +++ b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/checkbox/index.d.ts @@ -0,0 +1 @@ +export {}; diff --git a/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/checkbox/index.js b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/checkbox/index.js new file mode 100644 index 0000000..6247365 --- /dev/null +++ b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/checkbox/index.js @@ -0,0 +1,79 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var relation_1 = require("../common/relation"); +var component_1 = require("../common/component"); +function emit(target, value) { + target.$emit('input', value); + target.$emit('change', value); +} +(0, component_1.VantComponent)({ + field: true, + relation: (0, relation_1.useParent)('checkbox-group'), + classes: ['icon-class', 'label-class'], + props: { + value: Boolean, + disabled: Boolean, + useIconSlot: Boolean, + checkedColor: String, + labelPosition: { + type: String, + value: 'right', + }, + labelDisabled: Boolean, + shape: { + type: String, + value: 'round', + }, + iconSize: { + type: null, + value: 20, + }, + }, + data: { + parentDisabled: false, + direction: 'vertical', + }, + methods: { + emitChange: function (value) { + if (this.parent) { + this.setParentValue(this.parent, value); + } + else { + emit(this, value); + } + }, + toggle: function () { + var _a = this.data, parentDisabled = _a.parentDisabled, disabled = _a.disabled, value = _a.value; + if (!disabled && !parentDisabled) { + this.emitChange(!value); + } + }, + onClickLabel: function () { + var _a = this.data, labelDisabled = _a.labelDisabled, parentDisabled = _a.parentDisabled, disabled = _a.disabled, value = _a.value; + if (!disabled && !labelDisabled && !parentDisabled) { + this.emitChange(!value); + } + }, + setParentValue: function (parent, value) { + var parentValue = parent.data.value.slice(); + var name = this.data.name; + var max = parent.data.max; + if (value) { + if (max && parentValue.length >= max) { + return; + } + if (parentValue.indexOf(name) === -1) { + parentValue.push(name); + emit(parent, parentValue); + } + } + else { + var index = parentValue.indexOf(name); + if (index !== -1) { + parentValue.splice(index, 1); + emit(parent, parentValue); + } + } + }, + }, +}); diff --git a/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/checkbox/index.json b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/checkbox/index.json new file mode 100644 index 0000000..0a336c0 --- /dev/null +++ b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/checkbox/index.json @@ -0,0 +1,6 @@ +{ + "component": true, + "usingComponents": { + "van-icon": "../icon/index" + } +} diff --git a/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/checkbox/index.wxml b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/checkbox/index.wxml new file mode 100644 index 0000000..39a7bb0 --- /dev/null +++ b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/checkbox/index.wxml @@ -0,0 +1,31 @@ + + + + + + + + + + + + + + + diff --git a/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/checkbox/index.wxs b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/checkbox/index.wxs new file mode 100644 index 0000000..eb9c772 --- /dev/null +++ b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/checkbox/index.wxs @@ -0,0 +1,20 @@ +/* eslint-disable */ +var style = require('../wxs/style.wxs'); +var addUnit = require('../wxs/add-unit.wxs'); + +function iconStyle(checkedColor, value, disabled, parentDisabled, iconSize) { + var styles = { + 'font-size': addUnit(iconSize), + }; + + if (checkedColor && value && !disabled && !parentDisabled) { + styles['border-color'] = checkedColor; + styles['background-color'] = checkedColor; + } + + return style(styles); +} + +module.exports = { + iconStyle: iconStyle, +}; diff --git a/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/checkbox/index.wxss b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/checkbox/index.wxss new file mode 100644 index 0000000..da2272a --- /dev/null +++ b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/checkbox/index.wxss @@ -0,0 +1 @@ +@import '../common/index.wxss';.van-checkbox{align-items:center;display:flex;overflow:hidden;-webkit-user-select:none;user-select:none}.van-checkbox--horizontal{margin-right:12px}.van-checkbox__icon-wrap,.van-checkbox__label{line-height:var(--checkbox-size,20px)}.van-checkbox__icon-wrap{flex:none}.van-checkbox__icon{align-items:center;border:1px solid var(--checkbox-border-color,#c8c9cc);box-sizing:border-box;color:transparent;display:flex;font-size:var(--checkbox-size,20px);height:1em;justify-content:center;text-align:center;transition-duration:var(--checkbox-transition-duration,.2s);transition-property:color,border-color,background-color;width:1em}.van-checkbox__icon--round{border-radius:100%}.van-checkbox__icon--checked{background-color:var(--checkbox-checked-icon-color,#1989fa);border-color:var(--checkbox-checked-icon-color,#1989fa);color:#fff}.van-checkbox__icon--disabled{background-color:var(--checkbox-disabled-background-color,#ebedf0);border-color:var(--checkbox-disabled-icon-color,#c8c9cc)}.van-checkbox__icon--disabled.van-checkbox__icon--checked{color:var(--checkbox-disabled-icon-color,#c8c9cc)}.van-checkbox__label{word-wrap:break-word;color:var(--checkbox-label-color,#323233);padding-left:var(--checkbox-label-margin,10px)}.van-checkbox__label--left{float:left;margin:0 var(--checkbox-label-margin,10px) 0 0}.van-checkbox__label--disabled{color:var(--checkbox-disabled-label-color,#c8c9cc)}.van-checkbox__label:empty{margin:0} \ No newline at end of file diff --git a/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/circle/canvas.d.ts b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/circle/canvas.d.ts new file mode 100644 index 0000000..8a0b71e --- /dev/null +++ b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/circle/canvas.d.ts @@ -0,0 +1,4 @@ +/// +type CanvasContext = WechatMiniprogram.CanvasContext; +export declare function adaptor(ctx: CanvasContext & Record): CanvasContext; +export {}; diff --git a/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/circle/canvas.js b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/circle/canvas.js new file mode 100644 index 0000000..d81df74 --- /dev/null +++ b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/circle/canvas.js @@ -0,0 +1,47 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.adaptor = void 0; +function adaptor(ctx) { + // @ts-ignore + return Object.assign(ctx, { + setStrokeStyle: function (val) { + ctx.strokeStyle = val; + }, + setLineWidth: function (val) { + ctx.lineWidth = val; + }, + setLineCap: function (val) { + ctx.lineCap = val; + }, + setFillStyle: function (val) { + ctx.fillStyle = val; + }, + setFontSize: function (val) { + ctx.font = String(val); + }, + setGlobalAlpha: function (val) { + ctx.globalAlpha = val; + }, + setLineJoin: function (val) { + ctx.lineJoin = val; + }, + setTextAlign: function (val) { + ctx.textAlign = val; + }, + setMiterLimit: function (val) { + ctx.miterLimit = val; + }, + setShadow: function (offsetX, offsetY, blur, color) { + ctx.shadowOffsetX = offsetX; + ctx.shadowOffsetY = offsetY; + ctx.shadowBlur = blur; + ctx.shadowColor = color; + }, + setTextBaseline: function (val) { + ctx.textBaseline = val; + }, + createCircularGradient: function () { }, + draw: function () { }, + }); +} +exports.adaptor = adaptor; diff --git a/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/circle/index.d.ts b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/circle/index.d.ts new file mode 100644 index 0000000..cb0ff5c --- /dev/null +++ b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/circle/index.d.ts @@ -0,0 +1 @@ +export {}; diff --git a/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/circle/index.js b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/circle/index.js new file mode 100644 index 0000000..e131e4b --- /dev/null +++ b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/circle/index.js @@ -0,0 +1,207 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var color_1 = require("../common/color"); +var component_1 = require("../common/component"); +var utils_1 = require("../common/utils"); +var validator_1 = require("../common/validator"); +var version_1 = require("../common/version"); +var canvas_1 = require("./canvas"); +function format(rate) { + return Math.min(Math.max(rate, 0), 100); +} +var PERIMETER = 2 * Math.PI; +var BEGIN_ANGLE = -Math.PI / 2; +var STEP = 1; +(0, component_1.VantComponent)({ + props: { + text: String, + lineCap: { + type: String, + value: 'round', + }, + value: { + type: Number, + value: 0, + observer: 'reRender', + }, + speed: { + type: Number, + value: 50, + }, + size: { + type: Number, + value: 100, + observer: function () { + this.drawCircle(this.currentValue); + }, + }, + fill: String, + layerColor: { + type: String, + value: color_1.WHITE, + }, + color: { + type: null, + value: color_1.BLUE, + observer: function () { + var _this = this; + this.setHoverColor().then(function () { + _this.drawCircle(_this.currentValue); + }); + }, + }, + type: { + type: String, + value: '', + }, + strokeWidth: { + type: Number, + value: 4, + }, + clockwise: { + type: Boolean, + value: true, + }, + }, + data: { + hoverColor: color_1.BLUE, + }, + methods: { + getContext: function () { + var _this = this; + var _a = this.data, type = _a.type, size = _a.size; + if (type === '' || !(0, version_1.canIUseCanvas2d)()) { + var ctx = wx.createCanvasContext('van-circle', this); + return Promise.resolve(ctx); + } + var dpr = (0, utils_1.getSystemInfoSync)().pixelRatio; + return new Promise(function (resolve) { + wx.createSelectorQuery() + .in(_this) + .select('#van-circle') + .node() + .exec(function (res) { + var canvas = res[0].node; + var ctx = canvas.getContext(type); + if (!_this.inited) { + _this.inited = true; + canvas.width = size * dpr; + canvas.height = size * dpr; + ctx.scale(dpr, dpr); + } + resolve((0, canvas_1.adaptor)(ctx)); + }); + }); + }, + setHoverColor: function () { + var _this = this; + var _a = this.data, color = _a.color, size = _a.size; + if ((0, validator_1.isObj)(color)) { + return this.getContext().then(function (context) { + if (!context) + return; + var LinearColor = context.createLinearGradient(size, 0, 0, 0); + Object.keys(color) + .sort(function (a, b) { return parseFloat(a) - parseFloat(b); }) + .map(function (key) { + return LinearColor.addColorStop(parseFloat(key) / 100, color[key]); + }); + _this.hoverColor = LinearColor; + }); + } + this.hoverColor = color; + return Promise.resolve(); + }, + presetCanvas: function (context, strokeStyle, beginAngle, endAngle, fill) { + var _a = this.data, strokeWidth = _a.strokeWidth, lineCap = _a.lineCap, clockwise = _a.clockwise, size = _a.size; + var position = size / 2; + var radius = position - strokeWidth / 2; + context.setStrokeStyle(strokeStyle); + context.setLineWidth(strokeWidth); + context.setLineCap(lineCap); + context.beginPath(); + context.arc(position, position, radius, beginAngle, endAngle, !clockwise); + context.stroke(); + if (fill) { + context.setFillStyle(fill); + context.fill(); + } + }, + renderLayerCircle: function (context) { + var _a = this.data, layerColor = _a.layerColor, fill = _a.fill; + this.presetCanvas(context, layerColor, 0, PERIMETER, fill); + }, + renderHoverCircle: function (context, formatValue) { + var clockwise = this.data.clockwise; + // 结束角度 + var progress = PERIMETER * (formatValue / 100); + var endAngle = clockwise + ? BEGIN_ANGLE + progress + : 3 * Math.PI - (BEGIN_ANGLE + progress); + this.presetCanvas(context, this.hoverColor, BEGIN_ANGLE, endAngle); + }, + drawCircle: function (currentValue) { + var _this = this; + var size = this.data.size; + this.getContext().then(function (context) { + if (!context) + return; + context.clearRect(0, 0, size, size); + _this.renderLayerCircle(context); + var formatValue = format(currentValue); + if (formatValue !== 0) { + _this.renderHoverCircle(context, formatValue); + } + context.draw(); + }); + }, + reRender: function () { + var _this = this; + // tofector 动画暂时没有想到好的解决方案 + var _a = this.data, value = _a.value, speed = _a.speed; + if (speed <= 0 || speed > 1000) { + this.drawCircle(value); + return; + } + this.clearMockInterval(); + this.currentValue = this.currentValue || 0; + var run = function () { + _this.interval = setTimeout(function () { + if (_this.currentValue !== value) { + if (Math.abs(_this.currentValue - value) < STEP) { + _this.currentValue = value; + } + else if (_this.currentValue < value) { + _this.currentValue += STEP; + } + else { + _this.currentValue -= STEP; + } + _this.drawCircle(_this.currentValue); + run(); + } + else { + _this.clearMockInterval(); + } + }, 1000 / speed); + }; + run(); + }, + clearMockInterval: function () { + if (this.interval) { + clearTimeout(this.interval); + this.interval = null; + } + }, + }, + mounted: function () { + var _this = this; + this.currentValue = this.data.value; + this.setHoverColor().then(function () { + _this.drawCircle(_this.currentValue); + }); + }, + destroyed: function () { + this.clearMockInterval(); + }, +}); diff --git a/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/circle/index.json b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/circle/index.json new file mode 100644 index 0000000..467ce29 --- /dev/null +++ b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/circle/index.json @@ -0,0 +1,3 @@ +{ + "component": true +} diff --git a/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/circle/index.wxml b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/circle/index.wxml new file mode 100644 index 0000000..52bc59f --- /dev/null +++ b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/circle/index.wxml @@ -0,0 +1,9 @@ + + + + + + + + {{ text }} + diff --git a/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/circle/index.wxss b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/circle/index.wxss new file mode 100644 index 0000000..2200751 --- /dev/null +++ b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/circle/index.wxss @@ -0,0 +1 @@ +@import '../common/index.wxss';.van-circle{display:inline-block;position:relative;text-align:center}.van-circle__text{color:var(--circle-text-color,#323233);left:0;position:absolute;top:50%;transform:translateY(-50%);width:100%} \ No newline at end of file diff --git a/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/col/index.d.ts b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/col/index.d.ts new file mode 100644 index 0000000..cb0ff5c --- /dev/null +++ b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/col/index.d.ts @@ -0,0 +1 @@ +export {}; diff --git a/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/col/index.js b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/col/index.js new file mode 100644 index 0000000..63c56eb --- /dev/null +++ b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/col/index.js @@ -0,0 +1,11 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var relation_1 = require("../common/relation"); +var component_1 = require("../common/component"); +(0, component_1.VantComponent)({ + relation: (0, relation_1.useParent)('row'), + props: { + span: Number, + offset: Number, + }, +}); diff --git a/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/col/index.json b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/col/index.json new file mode 100644 index 0000000..467ce29 --- /dev/null +++ b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/col/index.json @@ -0,0 +1,3 @@ +{ + "component": true +} diff --git a/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/col/index.wxml b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/col/index.wxml new file mode 100644 index 0000000..975348b --- /dev/null +++ b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/col/index.wxml @@ -0,0 +1,9 @@ + + + + + + diff --git a/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/col/index.wxs b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/col/index.wxs new file mode 100644 index 0000000..507c1cb --- /dev/null +++ b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/col/index.wxs @@ -0,0 +1,18 @@ +/* eslint-disable */ +var style = require('../wxs/style.wxs'); +var addUnit = require('../wxs/add-unit.wxs'); + +function rootStyle(data) { + if (!data.gutter) { + return ''; + } + + return style({ + 'padding-right': addUnit(data.gutter / 2), + 'padding-left': addUnit(data.gutter / 2), + }); +} + +module.exports = { + rootStyle: rootStyle, +}; diff --git a/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/col/index.wxss b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/col/index.wxss new file mode 100644 index 0000000..2fa265e --- /dev/null +++ b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/col/index.wxss @@ -0,0 +1 @@ +@import '../common/index.wxss';.van-col{box-sizing:border-box;float:left}.van-col--1{width:4.16666667%}.van-col--offset-1{margin-left:4.16666667%}.van-col--2{width:8.33333333%}.van-col--offset-2{margin-left:8.33333333%}.van-col--3{width:12.5%}.van-col--offset-3{margin-left:12.5%}.van-col--4{width:16.66666667%}.van-col--offset-4{margin-left:16.66666667%}.van-col--5{width:20.83333333%}.van-col--offset-5{margin-left:20.83333333%}.van-col--6{width:25%}.van-col--offset-6{margin-left:25%}.van-col--7{width:29.16666667%}.van-col--offset-7{margin-left:29.16666667%}.van-col--8{width:33.33333333%}.van-col--offset-8{margin-left:33.33333333%}.van-col--9{width:37.5%}.van-col--offset-9{margin-left:37.5%}.van-col--10{width:41.66666667%}.van-col--offset-10{margin-left:41.66666667%}.van-col--11{width:45.83333333%}.van-col--offset-11{margin-left:45.83333333%}.van-col--12{width:50%}.van-col--offset-12{margin-left:50%}.van-col--13{width:54.16666667%}.van-col--offset-13{margin-left:54.16666667%}.van-col--14{width:58.33333333%}.van-col--offset-14{margin-left:58.33333333%}.van-col--15{width:62.5%}.van-col--offset-15{margin-left:62.5%}.van-col--16{width:66.66666667%}.van-col--offset-16{margin-left:66.66666667%}.van-col--17{width:70.83333333%}.van-col--offset-17{margin-left:70.83333333%}.van-col--18{width:75%}.van-col--offset-18{margin-left:75%}.van-col--19{width:79.16666667%}.van-col--offset-19{margin-left:79.16666667%}.van-col--20{width:83.33333333%}.van-col--offset-20{margin-left:83.33333333%}.van-col--21{width:87.5%}.van-col--offset-21{margin-left:87.5%}.van-col--22{width:91.66666667%}.van-col--offset-22{margin-left:91.66666667%}.van-col--23{width:95.83333333%}.van-col--offset-23{margin-left:95.83333333%}.van-col--24{width:100%}.van-col--offset-24{margin-left:100%} \ No newline at end of file diff --git a/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/collapse-item/animate.d.ts b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/collapse-item/animate.d.ts new file mode 100644 index 0000000..32157b6 --- /dev/null +++ b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/collapse-item/animate.d.ts @@ -0,0 +1,2 @@ +/// +export declare function setContentAnimate(context: WechatMiniprogram.Component.TrivialInstance, expanded: boolean, mounted: boolean): void; diff --git a/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/collapse-item/animate.js b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/collapse-item/animate.js new file mode 100644 index 0000000..5734087 --- /dev/null +++ b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/collapse-item/animate.js @@ -0,0 +1,43 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.setContentAnimate = void 0; +var utils_1 = require("../common/utils"); +function useAnimation(context, expanded, mounted, height) { + var animation = wx.createAnimation({ + duration: 0, + timingFunction: 'ease-in-out', + }); + if (expanded) { + if (height === 0) { + animation.height('auto').top(1).step(); + } + else { + animation + .height(height) + .top(1) + .step({ + duration: mounted ? 300 : 1, + }) + .height('auto') + .step(); + } + context.setData({ + animation: animation.export(), + }); + return; + } + animation.height(height).top(0).step({ duration: 1 }).height(0).step({ + duration: 300, + }); + context.setData({ + animation: animation.export(), + }); +} +function setContentAnimate(context, expanded, mounted) { + (0, utils_1.getRect)(context, '.van-collapse-item__content') + .then(function (rect) { return rect.height; }) + .then(function (height) { + useAnimation(context, expanded, mounted, height); + }); +} +exports.setContentAnimate = setContentAnimate; diff --git a/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/collapse-item/index.d.ts b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/collapse-item/index.d.ts new file mode 100644 index 0000000..cb0ff5c --- /dev/null +++ b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/collapse-item/index.d.ts @@ -0,0 +1 @@ +export {}; diff --git a/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/collapse-item/index.js b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/collapse-item/index.js new file mode 100644 index 0000000..982490e --- /dev/null +++ b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/collapse-item/index.js @@ -0,0 +1,62 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var component_1 = require("../common/component"); +var relation_1 = require("../common/relation"); +var animate_1 = require("./animate"); +(0, component_1.VantComponent)({ + classes: ['title-class', 'content-class'], + relation: (0, relation_1.useParent)('collapse'), + props: { + size: String, + name: null, + title: null, + value: null, + icon: String, + label: String, + disabled: Boolean, + clickable: Boolean, + border: { + type: Boolean, + value: true, + }, + isLink: { + type: Boolean, + value: true, + }, + }, + data: { + expanded: false, + }, + mounted: function () { + this.updateExpanded(); + this.mounted = true; + }, + methods: { + updateExpanded: function () { + if (!this.parent) { + return; + } + var _a = this.parent.data, value = _a.value, accordion = _a.accordion; + var _b = this.parent.children, children = _b === void 0 ? [] : _b; + var name = this.data.name; + var index = children.indexOf(this); + var currentName = name == null ? index : name; + var expanded = accordion + ? value === currentName + : (value || []).some(function (name) { return name === currentName; }); + if (expanded !== this.data.expanded) { + (0, animate_1.setContentAnimate)(this, expanded, this.mounted); + } + this.setData({ index: index, expanded: expanded }); + }, + onClick: function () { + if (this.data.disabled) { + return; + } + var _a = this.data, name = _a.name, expanded = _a.expanded; + var index = this.parent.children.indexOf(this); + var currentName = name == null ? index : name; + this.parent.switch(currentName, !expanded); + }, + }, +}); diff --git a/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/collapse-item/index.json b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/collapse-item/index.json new file mode 100644 index 0000000..0e5425c --- /dev/null +++ b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/collapse-item/index.json @@ -0,0 +1,6 @@ +{ + "component": true, + "usingComponents": { + "van-cell": "../cell/index" + } +} diff --git a/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/collapse-item/index.wxml b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/collapse-item/index.wxml new file mode 100644 index 0000000..f11d0d4 --- /dev/null +++ b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/collapse-item/index.wxml @@ -0,0 +1,45 @@ + + + + + + + + + + + + + + + diff --git a/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/collapse-item/index.wxss b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/collapse-item/index.wxss new file mode 100644 index 0000000..4a65b5a --- /dev/null +++ b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/collapse-item/index.wxss @@ -0,0 +1 @@ +@import '../common/index.wxss';.van-collapse-item__title .van-cell__right-icon{transform:rotate(90deg);transition:transform var(--collapse-item-transition-duration,.3s)}.van-collapse-item__title--expanded .van-cell__right-icon{transform:rotate(-90deg)}.van-collapse-item__title--disabled .van-cell,.van-collapse-item__title--disabled .van-cell__right-icon{color:var(--collapse-item-title-disabled-color,#c8c9cc)!important}.van-collapse-item__title--disabled .van-cell--hover{background-color:#fff!important}.van-collapse-item__wrapper{overflow:hidden}.van-collapse-item__content{background-color:var(--collapse-item-content-background-color,#fff);color:var(--collapse-item-content-text-color,#969799);font-size:var(--collapse-item-content-font-size,13px);line-height:var(--collapse-item-content-line-height,1.5);padding:var(--collapse-item-content-padding,15px)} \ No newline at end of file diff --git a/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/collapse/index.d.ts b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/collapse/index.d.ts new file mode 100644 index 0000000..cb0ff5c --- /dev/null +++ b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/collapse/index.d.ts @@ -0,0 +1 @@ +export {}; diff --git a/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/collapse/index.js b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/collapse/index.js new file mode 100644 index 0000000..943d542 --- /dev/null +++ b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/collapse/index.js @@ -0,0 +1,48 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var component_1 = require("../common/component"); +var relation_1 = require("../common/relation"); +(0, component_1.VantComponent)({ + relation: (0, relation_1.useChildren)('collapse-item'), + props: { + value: { + type: null, + observer: 'updateExpanded', + }, + accordion: { + type: Boolean, + observer: 'updateExpanded', + }, + border: { + type: Boolean, + value: true, + }, + }, + methods: { + updateExpanded: function () { + this.children.forEach(function (child) { + child.updateExpanded(); + }); + }, + switch: function (name, expanded) { + var _a = this.data, accordion = _a.accordion, value = _a.value; + var changeItem = name; + if (!accordion) { + name = expanded + ? (value || []).concat(name) + : (value || []).filter(function (activeName) { return activeName !== name; }); + } + else { + name = expanded ? name : ''; + } + if (expanded) { + this.$emit('open', changeItem); + } + else { + this.$emit('close', changeItem); + } + this.$emit('change', name); + this.$emit('input', name); + }, + }, +}); diff --git a/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/collapse/index.json b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/collapse/index.json new file mode 100644 index 0000000..467ce29 --- /dev/null +++ b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/collapse/index.json @@ -0,0 +1,3 @@ +{ + "component": true +} diff --git a/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/collapse/index.wxml b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/collapse/index.wxml new file mode 100644 index 0000000..fd4e171 --- /dev/null +++ b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/collapse/index.wxml @@ -0,0 +1,3 @@ + + + diff --git a/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/collapse/index.wxss b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/collapse/index.wxss new file mode 100644 index 0000000..99694d6 --- /dev/null +++ b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/collapse/index.wxss @@ -0,0 +1 @@ +@import '../common/index.wxss'; \ No newline at end of file diff --git a/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/common/color.d.ts b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/common/color.d.ts new file mode 100644 index 0000000..386f307 --- /dev/null +++ b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/common/color.d.ts @@ -0,0 +1,7 @@ +export declare const RED = "#ee0a24"; +export declare const BLUE = "#1989fa"; +export declare const WHITE = "#fff"; +export declare const GREEN = "#07c160"; +export declare const ORANGE = "#ff976a"; +export declare const GRAY = "#323233"; +export declare const GRAY_DARK = "#969799"; diff --git a/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/common/color.js b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/common/color.js new file mode 100644 index 0000000..008a45a --- /dev/null +++ b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/common/color.js @@ -0,0 +1,10 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.GRAY_DARK = exports.GRAY = exports.ORANGE = exports.GREEN = exports.WHITE = exports.BLUE = exports.RED = void 0; +exports.RED = '#ee0a24'; +exports.BLUE = '#1989fa'; +exports.WHITE = '#fff'; +exports.GREEN = '#07c160'; +exports.ORANGE = '#ff976a'; +exports.GRAY = '#323233'; +exports.GRAY_DARK = '#969799'; diff --git a/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/common/component.d.ts b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/common/component.d.ts new file mode 100644 index 0000000..1d0fd27 --- /dev/null +++ b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/common/component.d.ts @@ -0,0 +1,4 @@ +/// +import { VantComponentOptions } from 'definitions/index'; +declare function VantComponent(vantOptions: VantComponentOptions): void; +export { VantComponent }; diff --git a/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/common/component.js b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/common/component.js new file mode 100644 index 0000000..66da00e --- /dev/null +++ b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/common/component.js @@ -0,0 +1,49 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.VantComponent = void 0; +var basic_1 = require("../mixins/basic"); +function mapKeys(source, target, map) { + Object.keys(map).forEach(function (key) { + if (source[key]) { + target[map[key]] = source[key]; + } + }); +} +function VantComponent(vantOptions) { + var options = {}; + mapKeys(vantOptions, options, { + data: 'data', + props: 'properties', + watch: 'observers', + mixins: 'behaviors', + methods: 'methods', + beforeCreate: 'created', + created: 'attached', + mounted: 'ready', + destroyed: 'detached', + classes: 'externalClasses', + }); + // add default externalClasses + options.externalClasses = options.externalClasses || []; + options.externalClasses.push('custom-class'); + // add default behaviors + options.behaviors = options.behaviors || []; + options.behaviors.push(basic_1.basic); + // add relations + var relation = vantOptions.relation; + if (relation) { + options.relations = relation.relations; + options.behaviors.push(relation.mixin); + } + // map field to form-field behavior + if (vantOptions.field) { + options.behaviors.push('wx://form-field'); + } + // add default options + options.options = { + multipleSlots: true, + addGlobalClass: true, + }; + Component(options); +} +exports.VantComponent = VantComponent; diff --git a/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/common/index.wxss b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/common/index.wxss new file mode 100644 index 0000000..a73bb7a --- /dev/null +++ b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/common/index.wxss @@ -0,0 +1 @@ +.van-ellipsis{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.van-multi-ellipsis--l2{-webkit-line-clamp:2}.van-multi-ellipsis--l2,.van-multi-ellipsis--l3{-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden;text-overflow:ellipsis}.van-multi-ellipsis--l3{-webkit-line-clamp:3}.van-clearfix:after{clear:both;content:"";display:table}.van-hairline,.van-hairline--bottom,.van-hairline--left,.van-hairline--right,.van-hairline--surround,.van-hairline--top,.van-hairline--top-bottom{position:relative}.van-hairline--bottom:after,.van-hairline--left:after,.van-hairline--right:after,.van-hairline--surround:after,.van-hairline--top-bottom:after,.van-hairline--top:after,.van-hairline:after{border:0 solid #ebedf0;bottom:-50%;box-sizing:border-box;content:" ";left:-50%;pointer-events:none;position:absolute;right:-50%;top:-50%;transform:scale(.5);transform-origin:center}.van-hairline--top:after{border-top-width:1px}.van-hairline--left:after{border-left-width:1px}.van-hairline--right:after{border-right-width:1px}.van-hairline--bottom:after{border-bottom-width:1px}.van-hairline--top-bottom:after{border-width:1px 0}.van-hairline--surround:after{border-width:1px} \ No newline at end of file diff --git a/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/common/relation.d.ts b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/common/relation.d.ts new file mode 100644 index 0000000..10193fa --- /dev/null +++ b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/common/relation.d.ts @@ -0,0 +1,15 @@ +/// +type TrivialInstance = WechatMiniprogram.Component.TrivialInstance; +export declare function useParent(name: string, onEffect?: (this: TrivialInstance) => void): { + relations: { + [x: string]: WechatMiniprogram.Component.RelationOption; + }; + mixin: string; +}; +export declare function useChildren(name: string, onEffect?: (this: TrivialInstance, target: TrivialInstance) => void): { + relations: { + [x: string]: WechatMiniprogram.Component.RelationOption; + }; + mixin: string; +}; +export {}; diff --git a/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/common/relation.js b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/common/relation.js new file mode 100644 index 0000000..008256c --- /dev/null +++ b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/common/relation.js @@ -0,0 +1,65 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.useChildren = exports.useParent = void 0; +function useParent(name, onEffect) { + var _a; + var path = "../".concat(name, "/index"); + return { + relations: (_a = {}, + _a[path] = { + type: 'ancestor', + linked: function () { + onEffect && onEffect.call(this); + }, + linkChanged: function () { + onEffect && onEffect.call(this); + }, + unlinked: function () { + onEffect && onEffect.call(this); + }, + }, + _a), + mixin: Behavior({ + created: function () { + var _this = this; + Object.defineProperty(this, 'parent', { + get: function () { return _this.getRelationNodes(path)[0]; }, + }); + Object.defineProperty(this, 'index', { + // @ts-ignore + get: function () { var _a, _b; return (_b = (_a = _this.parent) === null || _a === void 0 ? void 0 : _a.children) === null || _b === void 0 ? void 0 : _b.indexOf(_this); }, + }); + }, + }), + }; +} +exports.useParent = useParent; +function useChildren(name, onEffect) { + var _a; + var path = "../".concat(name, "/index"); + return { + relations: (_a = {}, + _a[path] = { + type: 'descendant', + linked: function (target) { + onEffect && onEffect.call(this, target); + }, + linkChanged: function (target) { + onEffect && onEffect.call(this, target); + }, + unlinked: function (target) { + onEffect && onEffect.call(this, target); + }, + }, + _a), + mixin: Behavior({ + created: function () { + var _this = this; + Object.defineProperty(this, 'children', { + get: function () { return _this.getRelationNodes(path) || []; }, + }); + }, + }), + }; +} +exports.useChildren = useChildren; diff --git a/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/common/style/clearfix.wxss b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/common/style/clearfix.wxss new file mode 100644 index 0000000..442246f --- /dev/null +++ b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/common/style/clearfix.wxss @@ -0,0 +1 @@ +.van-clearfix:after{clear:both;content:"";display:table} \ No newline at end of file diff --git a/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/common/style/ellipsis.wxss b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/common/style/ellipsis.wxss new file mode 100644 index 0000000..ee701df --- /dev/null +++ b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/common/style/ellipsis.wxss @@ -0,0 +1 @@ +.van-ellipsis{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.van-multi-ellipsis--l2{-webkit-line-clamp:2}.van-multi-ellipsis--l2,.van-multi-ellipsis--l3{-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden;text-overflow:ellipsis}.van-multi-ellipsis--l3{-webkit-line-clamp:3} \ No newline at end of file diff --git a/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/common/style/hairline.wxss b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/common/style/hairline.wxss new file mode 100644 index 0000000..f7c6260 --- /dev/null +++ b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/common/style/hairline.wxss @@ -0,0 +1 @@ +.van-hairline,.van-hairline--bottom,.van-hairline--left,.van-hairline--right,.van-hairline--surround,.van-hairline--top,.van-hairline--top-bottom{position:relative}.van-hairline--bottom:after,.van-hairline--left:after,.van-hairline--right:after,.van-hairline--surround:after,.van-hairline--top-bottom:after,.van-hairline--top:after,.van-hairline:after{border:0 solid #ebedf0;bottom:-50%;box-sizing:border-box;content:" ";left:-50%;pointer-events:none;position:absolute;right:-50%;top:-50%;transform:scale(.5);transform-origin:center}.van-hairline--top:after{border-top-width:1px}.van-hairline--left:after{border-left-width:1px}.van-hairline--right:after{border-right-width:1px}.van-hairline--bottom:after{border-bottom-width:1px}.van-hairline--top-bottom:after{border-width:1px 0}.van-hairline--surround:after{border-width:1px} \ No newline at end of file diff --git a/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/common/style/mixins/clearfix.wxss b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/common/style/mixins/clearfix.wxss new file mode 100644 index 0000000..e69de29 diff --git a/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/common/style/mixins/ellipsis.wxss b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/common/style/mixins/ellipsis.wxss new file mode 100644 index 0000000..e69de29 diff --git a/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/common/style/mixins/hairline.wxss b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/common/style/mixins/hairline.wxss new file mode 100644 index 0000000..e69de29 diff --git a/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/common/style/var.wxss b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/common/style/var.wxss new file mode 100644 index 0000000..e69de29 diff --git a/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/common/utils.d.ts b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/common/utils.d.ts new file mode 100644 index 0000000..805b399 --- /dev/null +++ b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/common/utils.d.ts @@ -0,0 +1,20 @@ +/// +/// +/// +/// +/// +export { isDef } from './validator'; +export { getSystemInfoSync } from './version'; +export declare function range(num: number, min: number, max: number): number; +export declare function nextTick(cb: (...args: any[]) => void): void; +export declare function addUnit(value?: string | number): string | undefined; +export declare function requestAnimationFrame(cb: () => void): NodeJS.Timeout; +export declare function pickExclude(obj: unknown, keys: string[]): {}; +export declare function getRect(context: WechatMiniprogram.Component.TrivialInstance, selector: string): Promise; +export declare function getAllRect(context: WechatMiniprogram.Component.TrivialInstance, selector: string): Promise; +export declare function groupSetData(context: WechatMiniprogram.Component.TrivialInstance, cb: () => void): void; +export declare function toPromise(promiseLike: Promise | unknown): Promise; +export declare function addNumber(num1: any, num2: any): number; +export declare const clamp: (num: any, min: any, max: any) => number; +export declare function getCurrentPage(): T & WechatMiniprogram.OptionalInterface & WechatMiniprogram.Page.InstanceProperties & WechatMiniprogram.Page.InstanceMethods & WechatMiniprogram.Page.Data & WechatMiniprogram.IAnyObject; +export declare const isPC: boolean; diff --git a/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/common/utils.js b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/common/utils.js new file mode 100644 index 0000000..80fb803 --- /dev/null +++ b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/common/utils.js @@ -0,0 +1,107 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.isPC = exports.getCurrentPage = exports.clamp = exports.addNumber = exports.toPromise = exports.groupSetData = exports.getAllRect = exports.getRect = exports.pickExclude = exports.requestAnimationFrame = exports.addUnit = exports.nextTick = exports.range = exports.getSystemInfoSync = exports.isDef = void 0; +var validator_1 = require("./validator"); +var version_1 = require("./version"); +var validator_2 = require("./validator"); +Object.defineProperty(exports, "isDef", { enumerable: true, get: function () { return validator_2.isDef; } }); +var version_2 = require("./version"); +Object.defineProperty(exports, "getSystemInfoSync", { enumerable: true, get: function () { return version_2.getSystemInfoSync; } }); +function range(num, min, max) { + return Math.min(Math.max(num, min), max); +} +exports.range = range; +function nextTick(cb) { + if ((0, version_1.canIUseNextTick)()) { + wx.nextTick(cb); + } + else { + setTimeout(function () { + cb(); + }, 1000 / 30); + } +} +exports.nextTick = nextTick; +function addUnit(value) { + if (!(0, validator_1.isDef)(value)) { + return undefined; + } + value = String(value); + return (0, validator_1.isNumber)(value) ? "".concat(value, "px") : value; +} +exports.addUnit = addUnit; +function requestAnimationFrame(cb) { + return setTimeout(function () { + cb(); + }, 1000 / 30); +} +exports.requestAnimationFrame = requestAnimationFrame; +function pickExclude(obj, keys) { + if (!(0, validator_1.isPlainObject)(obj)) { + return {}; + } + return Object.keys(obj).reduce(function (prev, key) { + if (!keys.includes(key)) { + prev[key] = obj[key]; + } + return prev; + }, {}); +} +exports.pickExclude = pickExclude; +function getRect(context, selector) { + return new Promise(function (resolve) { + wx.createSelectorQuery() + .in(context) + .select(selector) + .boundingClientRect() + .exec(function (rect) { + if (rect === void 0) { rect = []; } + return resolve(rect[0]); + }); + }); +} +exports.getRect = getRect; +function getAllRect(context, selector) { + return new Promise(function (resolve) { + wx.createSelectorQuery() + .in(context) + .selectAll(selector) + .boundingClientRect() + .exec(function (rect) { + if (rect === void 0) { rect = []; } + return resolve(rect[0]); + }); + }); +} +exports.getAllRect = getAllRect; +function groupSetData(context, cb) { + if ((0, version_1.canIUseGroupSetData)()) { + context.groupSetData(cb); + } + else { + cb(); + } +} +exports.groupSetData = groupSetData; +function toPromise(promiseLike) { + if ((0, validator_1.isPromise)(promiseLike)) { + return promiseLike; + } + return Promise.resolve(promiseLike); +} +exports.toPromise = toPromise; +// 浮点数精度处理 +function addNumber(num1, num2) { + var cardinal = Math.pow(10, 10); + return Math.round((num1 + num2) * cardinal) / cardinal; +} +exports.addNumber = addNumber; +// 限制value在[min, max]之间 +var clamp = function (num, min, max) { return Math.min(Math.max(num, min), max); }; +exports.clamp = clamp; +function getCurrentPage() { + var pages = getCurrentPages(); + return pages[pages.length - 1]; +} +exports.getCurrentPage = getCurrentPage; +exports.isPC = ['mac', 'windows'].includes((0, version_1.getSystemInfoSync)().platform); diff --git a/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/common/validator.d.ts b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/common/validator.d.ts new file mode 100644 index 0000000..152894a --- /dev/null +++ b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/common/validator.d.ts @@ -0,0 +1,9 @@ +export declare function isFunction(val: unknown): val is Function; +export declare function isPlainObject(val: unknown): val is Record; +export declare function isPromise(val: unknown): val is Promise; +export declare function isDef(value: unknown): boolean; +export declare function isObj(x: unknown): x is Record; +export declare function isNumber(value: string): boolean; +export declare function isBoolean(value: unknown): value is boolean; +export declare function isImageUrl(url: string): boolean; +export declare function isVideoUrl(url: string): boolean; diff --git a/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/common/validator.js b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/common/validator.js new file mode 100644 index 0000000..169e796 --- /dev/null +++ b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/common/validator.js @@ -0,0 +1,43 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.isVideoUrl = exports.isImageUrl = exports.isBoolean = exports.isNumber = exports.isObj = exports.isDef = exports.isPromise = exports.isPlainObject = exports.isFunction = void 0; +// eslint-disable-next-line @typescript-eslint/ban-types +function isFunction(val) { + return typeof val === 'function'; +} +exports.isFunction = isFunction; +function isPlainObject(val) { + return val !== null && typeof val === 'object' && !Array.isArray(val); +} +exports.isPlainObject = isPlainObject; +function isPromise(val) { + return isPlainObject(val) && isFunction(val.then) && isFunction(val.catch); +} +exports.isPromise = isPromise; +function isDef(value) { + return value !== undefined && value !== null; +} +exports.isDef = isDef; +function isObj(x) { + var type = typeof x; + return x !== null && (type === 'object' || type === 'function'); +} +exports.isObj = isObj; +function isNumber(value) { + return /^\d+(\.\d+)?$/.test(value); +} +exports.isNumber = isNumber; +function isBoolean(value) { + return typeof value === 'boolean'; +} +exports.isBoolean = isBoolean; +var IMAGE_REGEXP = /\.(jpeg|jpg|gif|png|svg|webp|jfif|bmp|dpg)/i; +var VIDEO_REGEXP = /\.(mp4|mpg|mpeg|dat|asf|avi|rm|rmvb|mov|wmv|flv|mkv)/i; +function isImageUrl(url) { + return IMAGE_REGEXP.test(url); +} +exports.isImageUrl = isImageUrl; +function isVideoUrl(url) { + return VIDEO_REGEXP.test(url); +} +exports.isVideoUrl = isVideoUrl; diff --git a/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/common/version.d.ts b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/common/version.d.ts new file mode 100644 index 0000000..7142201 --- /dev/null +++ b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/common/version.d.ts @@ -0,0 +1,9 @@ +/// +export declare function getSystemInfoSync(): WechatMiniprogram.SystemInfo; +export declare function canIUseModel(): boolean; +export declare function canIUseFormFieldButton(): boolean; +export declare function canIUseAnimate(): boolean; +export declare function canIUseGroupSetData(): boolean; +export declare function canIUseNextTick(): boolean; +export declare function canIUseCanvas2d(): boolean; +export declare function canIUseGetUserProfile(): boolean; diff --git a/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/common/version.js b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/common/version.js new file mode 100644 index 0000000..5937008 --- /dev/null +++ b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/common/version.js @@ -0,0 +1,70 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.canIUseGetUserProfile = exports.canIUseCanvas2d = exports.canIUseNextTick = exports.canIUseGroupSetData = exports.canIUseAnimate = exports.canIUseFormFieldButton = exports.canIUseModel = exports.getSystemInfoSync = void 0; +var systemInfo; +function getSystemInfoSync() { + if (systemInfo == null) { + systemInfo = wx.getSystemInfoSync(); + } + return systemInfo; +} +exports.getSystemInfoSync = getSystemInfoSync; +function compareVersion(v1, v2) { + v1 = v1.split('.'); + v2 = v2.split('.'); + var len = Math.max(v1.length, v2.length); + while (v1.length < len) { + v1.push('0'); + } + while (v2.length < len) { + v2.push('0'); + } + for (var i = 0; i < len; i++) { + var num1 = parseInt(v1[i], 10); + var num2 = parseInt(v2[i], 10); + if (num1 > num2) { + return 1; + } + if (num1 < num2) { + return -1; + } + } + return 0; +} +function gte(version) { + var system = getSystemInfoSync(); + return compareVersion(system.SDKVersion, version) >= 0; +} +function canIUseModel() { + return gte('2.9.3'); +} +exports.canIUseModel = canIUseModel; +function canIUseFormFieldButton() { + return gte('2.10.3'); +} +exports.canIUseFormFieldButton = canIUseFormFieldButton; +function canIUseAnimate() { + return gte('2.9.0'); +} +exports.canIUseAnimate = canIUseAnimate; +function canIUseGroupSetData() { + return gte('2.4.0'); +} +exports.canIUseGroupSetData = canIUseGroupSetData; +function canIUseNextTick() { + try { + return wx.canIUse('nextTick'); + } + catch (e) { + return gte('2.7.1'); + } +} +exports.canIUseNextTick = canIUseNextTick; +function canIUseCanvas2d() { + return gte('2.9.0'); +} +exports.canIUseCanvas2d = canIUseCanvas2d; +function canIUseGetUserProfile() { + return !!wx.getUserProfile; +} +exports.canIUseGetUserProfile = canIUseGetUserProfile; diff --git a/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/config-provider/index.d.ts b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/config-provider/index.d.ts new file mode 100644 index 0000000..cb0ff5c --- /dev/null +++ b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/config-provider/index.d.ts @@ -0,0 +1 @@ +export {}; diff --git a/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/config-provider/index.js b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/config-provider/index.js new file mode 100644 index 0000000..21fb1c4 --- /dev/null +++ b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/config-provider/index.js @@ -0,0 +1,11 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var component_1 = require("../common/component"); +(0, component_1.VantComponent)({ + props: { + themeVars: { + type: Object, + value: {}, + }, + }, +}); diff --git a/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/config-provider/index.json b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/config-provider/index.json new file mode 100644 index 0000000..467ce29 --- /dev/null +++ b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/config-provider/index.json @@ -0,0 +1,3 @@ +{ + "component": true +} diff --git a/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/config-provider/index.wxml b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/config-provider/index.wxml new file mode 100644 index 0000000..3cfb461 --- /dev/null +++ b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/config-provider/index.wxml @@ -0,0 +1,5 @@ + + + + + diff --git a/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/config-provider/index.wxs b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/config-provider/index.wxs new file mode 100644 index 0000000..7ca0203 --- /dev/null +++ b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/config-provider/index.wxs @@ -0,0 +1,29 @@ +/* eslint-disable */ +var object = require('../wxs/object.wxs'); +var style = require('../wxs/style.wxs'); + +function kebabCase(word) { + var newWord = word + .replace(getRegExp("[A-Z]", 'g'), function (i) { + return '-' + i; + }) + .toLowerCase() + .replace(getRegExp("^-"), ''); + + return newWord; +} + +function mapThemeVarsToCSSVars(themeVars) { + var cssVars = {}; + object.keys(themeVars).forEach(function (key) { + var cssVarsKey = '--' + kebabCase(key); + cssVars[cssVarsKey] = themeVars[key]; + }); + + return style(cssVars); +} + +module.exports = { + kebabCase: kebabCase, + mapThemeVarsToCSSVars: mapThemeVarsToCSSVars, +}; diff --git a/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/count-down/index.d.ts b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/count-down/index.d.ts new file mode 100644 index 0000000..cb0ff5c --- /dev/null +++ b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/count-down/index.d.ts @@ -0,0 +1 @@ +export {}; diff --git a/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/count-down/index.js b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/count-down/index.js new file mode 100644 index 0000000..afc780b --- /dev/null +++ b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/count-down/index.js @@ -0,0 +1,104 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var component_1 = require("../common/component"); +var utils_1 = require("./utils"); +function simpleTick(fn) { + return setTimeout(fn, 30); +} +(0, component_1.VantComponent)({ + props: { + useSlot: Boolean, + millisecond: Boolean, + time: { + type: Number, + observer: 'reset', + }, + format: { + type: String, + value: 'HH:mm:ss', + }, + autoStart: { + type: Boolean, + value: true, + }, + }, + data: { + timeData: (0, utils_1.parseTimeData)(0), + formattedTime: '0', + }, + destroyed: function () { + clearTimeout(this.tid); + this.tid = null; + }, + methods: { + // 开始 + start: function () { + if (this.counting) { + return; + } + this.counting = true; + this.endTime = Date.now() + this.remain; + this.tick(); + }, + // 暂停 + pause: function () { + this.counting = false; + clearTimeout(this.tid); + }, + // 重置 + reset: function () { + this.pause(); + this.remain = this.data.time; + this.setRemain(this.remain); + if (this.data.autoStart) { + this.start(); + } + }, + tick: function () { + if (this.data.millisecond) { + this.microTick(); + } + else { + this.macroTick(); + } + }, + microTick: function () { + var _this = this; + this.tid = simpleTick(function () { + _this.setRemain(_this.getRemain()); + if (_this.remain !== 0) { + _this.microTick(); + } + }); + }, + macroTick: function () { + var _this = this; + this.tid = simpleTick(function () { + var remain = _this.getRemain(); + if (!(0, utils_1.isSameSecond)(remain, _this.remain) || remain === 0) { + _this.setRemain(remain); + } + if (_this.remain !== 0) { + _this.macroTick(); + } + }); + }, + getRemain: function () { + return Math.max(this.endTime - Date.now(), 0); + }, + setRemain: function (remain) { + this.remain = remain; + var timeData = (0, utils_1.parseTimeData)(remain); + if (this.data.useSlot) { + this.$emit('change', timeData); + } + this.setData({ + formattedTime: (0, utils_1.parseFormat)(this.data.format, timeData), + }); + if (remain === 0) { + this.pause(); + this.$emit('finish'); + } + }, + }, +}); diff --git a/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/count-down/index.json b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/count-down/index.json new file mode 100644 index 0000000..467ce29 --- /dev/null +++ b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/count-down/index.json @@ -0,0 +1,3 @@ +{ + "component": true +} diff --git a/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/count-down/index.wxml b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/count-down/index.wxml new file mode 100644 index 0000000..e206e16 --- /dev/null +++ b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/count-down/index.wxml @@ -0,0 +1,4 @@ + + + {{ formattedTime }} + diff --git a/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/count-down/index.wxss b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/count-down/index.wxss new file mode 100644 index 0000000..8b957f7 --- /dev/null +++ b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/count-down/index.wxss @@ -0,0 +1 @@ +@import '../common/index.wxss';.van-count-down{color:var(--count-down-text-color,#323233);font-size:var(--count-down-font-size,14px);line-height:var(--count-down-line-height,20px)} \ No newline at end of file diff --git a/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/count-down/utils.d.ts b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/count-down/utils.d.ts new file mode 100644 index 0000000..876a6c1 --- /dev/null +++ b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/count-down/utils.d.ts @@ -0,0 +1,10 @@ +export type TimeData = { + days: number; + hours: number; + minutes: number; + seconds: number; + milliseconds: number; +}; +export declare function parseTimeData(time: number): TimeData; +export declare function parseFormat(format: string, timeData: TimeData): string; +export declare function isSameSecond(time1: number, time2: number): boolean; diff --git a/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/count-down/utils.js b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/count-down/utils.js new file mode 100644 index 0000000..a7cfa5f --- /dev/null +++ b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/count-down/utils.js @@ -0,0 +1,64 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.isSameSecond = exports.parseFormat = exports.parseTimeData = void 0; +function padZero(num, targetLength) { + if (targetLength === void 0) { targetLength = 2; } + var str = num + ''; + while (str.length < targetLength) { + str = '0' + str; + } + return str; +} +var SECOND = 1000; +var MINUTE = 60 * SECOND; +var HOUR = 60 * MINUTE; +var DAY = 24 * HOUR; +function parseTimeData(time) { + var days = Math.floor(time / DAY); + var hours = Math.floor((time % DAY) / HOUR); + var minutes = Math.floor((time % HOUR) / MINUTE); + var seconds = Math.floor((time % MINUTE) / SECOND); + var milliseconds = Math.floor(time % SECOND); + return { + days: days, + hours: hours, + minutes: minutes, + seconds: seconds, + milliseconds: milliseconds, + }; +} +exports.parseTimeData = parseTimeData; +function parseFormat(format, timeData) { + var days = timeData.days; + var hours = timeData.hours, minutes = timeData.minutes, seconds = timeData.seconds, milliseconds = timeData.milliseconds; + if (format.indexOf('DD') === -1) { + hours += days * 24; + } + else { + format = format.replace('DD', padZero(days)); + } + if (format.indexOf('HH') === -1) { + minutes += hours * 60; + } + else { + format = format.replace('HH', padZero(hours)); + } + if (format.indexOf('mm') === -1) { + seconds += minutes * 60; + } + else { + format = format.replace('mm', padZero(minutes)); + } + if (format.indexOf('ss') === -1) { + milliseconds += seconds * 1000; + } + else { + format = format.replace('ss', padZero(seconds)); + } + return format.replace('SSS', padZero(milliseconds, 3)); +} +exports.parseFormat = parseFormat; +function isSameSecond(time1, time2) { + return Math.floor(time1 / 1000) === Math.floor(time2 / 1000); +} +exports.isSameSecond = isSameSecond; diff --git a/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/datetime-picker/index.d.ts b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/datetime-picker/index.d.ts new file mode 100644 index 0000000..cb0ff5c --- /dev/null +++ b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/datetime-picker/index.d.ts @@ -0,0 +1 @@ +export {}; diff --git a/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/datetime-picker/index.js b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/datetime-picker/index.js new file mode 100644 index 0000000..e30afef --- /dev/null +++ b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/datetime-picker/index.js @@ -0,0 +1,329 @@ +"use strict"; +var __assign = (this && this.__assign) || function () { + __assign = Object.assign || function(t) { + for (var s, i = 1, n = arguments.length; i < n; i++) { + s = arguments[i]; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) + t[p] = s[p]; + } + return t; + }; + return __assign.apply(this, arguments); +}; +var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) { + if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) { + if (ar || !(i in from)) { + if (!ar) ar = Array.prototype.slice.call(from, 0, i); + ar[i] = from[i]; + } + } + return to.concat(ar || Array.prototype.slice.call(from)); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +var component_1 = require("../common/component"); +var validator_1 = require("../common/validator"); +var shared_1 = require("../picker/shared"); +var currentYear = new Date().getFullYear(); +function isValidDate(date) { + return (0, validator_1.isDef)(date) && !isNaN(new Date(date).getTime()); +} +function range(num, min, max) { + return Math.min(Math.max(num, min), max); +} +function padZero(val) { + return "00".concat(val).slice(-2); +} +function times(n, iteratee) { + var index = -1; + var result = Array(n < 0 ? 0 : n); + while (++index < n) { + result[index] = iteratee(index); + } + return result; +} +function getTrueValue(formattedValue) { + if (formattedValue === undefined) { + formattedValue = '1'; + } + while (isNaN(parseInt(formattedValue, 10))) { + formattedValue = formattedValue.slice(1); + } + return parseInt(formattedValue, 10); +} +function getMonthEndDay(year, month) { + return 32 - new Date(year, month - 1, 32).getDate(); +} +var defaultFormatter = function (type, value) { return value; }; +(0, component_1.VantComponent)({ + classes: ['active-class', 'toolbar-class', 'column-class'], + props: __assign(__assign({}, shared_1.pickerProps), { value: { + type: null, + observer: 'updateValue', + }, filter: null, type: { + type: String, + value: 'datetime', + observer: 'updateValue', + }, showToolbar: { + type: Boolean, + value: true, + }, formatter: { + type: null, + value: defaultFormatter, + }, minDate: { + type: Number, + value: new Date(currentYear - 10, 0, 1).getTime(), + observer: 'updateValue', + }, maxDate: { + type: Number, + value: new Date(currentYear + 10, 11, 31).getTime(), + observer: 'updateValue', + }, minHour: { + type: Number, + value: 0, + observer: 'updateValue', + }, maxHour: { + type: Number, + value: 23, + observer: 'updateValue', + }, minMinute: { + type: Number, + value: 0, + observer: 'updateValue', + }, maxMinute: { + type: Number, + value: 59, + observer: 'updateValue', + } }), + data: { + innerValue: Date.now(), + columns: [], + }, + methods: { + updateValue: function () { + var _this = this; + var data = this.data; + var val = this.correctValue(data.value); + var isEqual = val === data.innerValue; + this.updateColumnValue(val).then(function () { + if (!isEqual) { + _this.$emit('input', val); + } + }); + }, + getPicker: function () { + if (this.picker == null) { + this.picker = this.selectComponent('.van-datetime-picker'); + var picker_1 = this.picker; + var setColumnValues_1 = picker_1.setColumnValues; + picker_1.setColumnValues = function () { + var args = []; + for (var _i = 0; _i < arguments.length; _i++) { + args[_i] = arguments[_i]; + } + return setColumnValues_1.apply(picker_1, __spreadArray(__spreadArray([], args, true), [false], false)); + }; + } + return this.picker; + }, + updateColumns: function () { + var _a = this.data.formatter, formatter = _a === void 0 ? defaultFormatter : _a; + var results = this.getOriginColumns().map(function (column) { return ({ + values: column.values.map(function (value) { return formatter(column.type, value); }), + }); }); + return this.set({ columns: results }); + }, + getOriginColumns: function () { + var filter = this.data.filter; + var results = this.getRanges().map(function (_a) { + var type = _a.type, range = _a.range; + var values = times(range[1] - range[0] + 1, function (index) { + var value = range[0] + index; + return type === 'year' ? "".concat(value) : padZero(value); + }); + if (filter) { + values = filter(type, values); + } + return { type: type, values: values }; + }); + return results; + }, + getRanges: function () { + var data = this.data; + if (data.type === 'time') { + return [ + { + type: 'hour', + range: [data.minHour, data.maxHour], + }, + { + type: 'minute', + range: [data.minMinute, data.maxMinute], + }, + ]; + } + var _a = this.getBoundary('max', data.innerValue), maxYear = _a.maxYear, maxDate = _a.maxDate, maxMonth = _a.maxMonth, maxHour = _a.maxHour, maxMinute = _a.maxMinute; + var _b = this.getBoundary('min', data.innerValue), minYear = _b.minYear, minDate = _b.minDate, minMonth = _b.minMonth, minHour = _b.minHour, minMinute = _b.minMinute; + var result = [ + { + type: 'year', + range: [minYear, maxYear], + }, + { + type: 'month', + range: [minMonth, maxMonth], + }, + { + type: 'day', + range: [minDate, maxDate], + }, + { + type: 'hour', + range: [minHour, maxHour], + }, + { + type: 'minute', + range: [minMinute, maxMinute], + }, + ]; + if (data.type === 'date') + result.splice(3, 2); + if (data.type === 'year-month') + result.splice(2, 3); + return result; + }, + correctValue: function (value) { + var data = this.data; + // validate value + var isDateType = data.type !== 'time'; + if (isDateType && !isValidDate(value)) { + value = data.minDate; + } + else if (!isDateType && !value) { + var minHour = data.minHour; + value = "".concat(padZero(minHour), ":00"); + } + // time type + if (!isDateType) { + var _a = value.split(':'), hour = _a[0], minute = _a[1]; + hour = padZero(range(hour, data.minHour, data.maxHour)); + minute = padZero(range(minute, data.minMinute, data.maxMinute)); + return "".concat(hour, ":").concat(minute); + } + // date type + value = Math.max(value, data.minDate); + value = Math.min(value, data.maxDate); + return value; + }, + getBoundary: function (type, innerValue) { + var _a; + var value = new Date(innerValue); + var boundary = new Date(this.data["".concat(type, "Date")]); + var year = boundary.getFullYear(); + var month = 1; + var date = 1; + var hour = 0; + var minute = 0; + if (type === 'max') { + month = 12; + date = getMonthEndDay(value.getFullYear(), value.getMonth() + 1); + hour = 23; + minute = 59; + } + if (value.getFullYear() === year) { + month = boundary.getMonth() + 1; + if (value.getMonth() + 1 === month) { + date = boundary.getDate(); + if (value.getDate() === date) { + hour = boundary.getHours(); + if (value.getHours() === hour) { + minute = boundary.getMinutes(); + } + } + } + } + return _a = {}, + _a["".concat(type, "Year")] = year, + _a["".concat(type, "Month")] = month, + _a["".concat(type, "Date")] = date, + _a["".concat(type, "Hour")] = hour, + _a["".concat(type, "Minute")] = minute, + _a; + }, + onCancel: function () { + this.$emit('cancel'); + }, + onConfirm: function () { + this.$emit('confirm', this.data.innerValue); + }, + onChange: function () { + var _this = this; + var data = this.data; + var value; + var picker = this.getPicker(); + var originColumns = this.getOriginColumns(); + if (data.type === 'time') { + var indexes = picker.getIndexes(); + value = "".concat(+originColumns[0].values[indexes[0]], ":").concat(+originColumns[1] + .values[indexes[1]]); + } + else { + var indexes = picker.getIndexes(); + var values = indexes.map(function (value, index) { return originColumns[index].values[value]; }); + var year = getTrueValue(values[0]); + var month = getTrueValue(values[1]); + var maxDate = getMonthEndDay(year, month); + var date = getTrueValue(values[2]); + if (data.type === 'year-month') { + date = 1; + } + date = date > maxDate ? maxDate : date; + var hour = 0; + var minute = 0; + if (data.type === 'datetime') { + hour = getTrueValue(values[3]); + minute = getTrueValue(values[4]); + } + value = new Date(year, month - 1, date, hour, minute); + } + value = this.correctValue(value); + this.updateColumnValue(value).then(function () { + _this.$emit('input', value); + _this.$emit('change', picker); + }); + }, + updateColumnValue: function (value) { + var _this = this; + var values = []; + var type = this.data.type; + var formatter = this.data.formatter || defaultFormatter; + var picker = this.getPicker(); + if (type === 'time') { + var pair = value.split(':'); + values = [formatter('hour', pair[0]), formatter('minute', pair[1])]; + } + else { + var date = new Date(value); + values = [ + formatter('year', "".concat(date.getFullYear())), + formatter('month', padZero(date.getMonth() + 1)), + ]; + if (type === 'date') { + values.push(formatter('day', padZero(date.getDate()))); + } + if (type === 'datetime') { + values.push(formatter('day', padZero(date.getDate())), formatter('hour', padZero(date.getHours())), formatter('minute', padZero(date.getMinutes()))); + } + } + return this.set({ innerValue: value }) + .then(function () { return _this.updateColumns(); }) + .then(function () { return picker.setValues(values); }); + }, + }, + created: function () { + var _this = this; + var innerValue = this.correctValue(this.data.value); + this.updateColumnValue(innerValue).then(function () { + _this.$emit('input', innerValue); + }); + }, +}); diff --git a/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/datetime-picker/index.json b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/datetime-picker/index.json new file mode 100644 index 0000000..a778e91 --- /dev/null +++ b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/datetime-picker/index.json @@ -0,0 +1,6 @@ +{ + "component": true, + "usingComponents": { + "van-picker": "../picker/index" + } +} diff --git a/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/datetime-picker/index.wxml b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/datetime-picker/index.wxml new file mode 100644 index 0000000..ade2202 --- /dev/null +++ b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/datetime-picker/index.wxml @@ -0,0 +1,16 @@ + diff --git a/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/datetime-picker/index.wxss b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/datetime-picker/index.wxss new file mode 100644 index 0000000..99694d6 --- /dev/null +++ b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/datetime-picker/index.wxss @@ -0,0 +1 @@ +@import '../common/index.wxss'; \ No newline at end of file diff --git a/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/definitions/index.d.ts b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/definitions/index.d.ts new file mode 100644 index 0000000..d0554f6 --- /dev/null +++ b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/definitions/index.d.ts @@ -0,0 +1,28 @@ +/// +interface VantComponentInstance { + parent: WechatMiniprogram.Component.TrivialInstance; + children: WechatMiniprogram.Component.TrivialInstance[]; + index: number; + $emit: (name: string, detail?: unknown, options?: WechatMiniprogram.Component.TriggerEventOption) => void; +} +export type VantComponentOptions = { + data?: Data; + field?: boolean; + classes?: string[]; + mixins?: string[]; + props?: Props; + relation?: { + relations: Record; + mixin: string; + }; + watch?: Record any>; + methods?: Methods; + beforeCreate?: () => void; + created?: () => void; + mounted?: () => void; + destroyed?: () => void; +} & ThisType, Props, Methods> & Record>; +export {}; diff --git a/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/definitions/index.js b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/definitions/index.js new file mode 100644 index 0000000..c8ad2e5 --- /dev/null +++ b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/definitions/index.js @@ -0,0 +1,2 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/dialog/dialog.d.ts b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/dialog/dialog.d.ts new file mode 100644 index 0000000..db2da5f --- /dev/null +++ b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/dialog/dialog.d.ts @@ -0,0 +1,55 @@ +/// +/// +export type Action = 'confirm' | 'cancel' | 'overlay'; +type DialogContext = WechatMiniprogram.Page.TrivialInstance | WechatMiniprogram.Component.TrivialInstance; +interface DialogOptions { + lang?: string; + show?: boolean; + title?: string; + width?: string | number | null; + zIndex?: number; + theme?: string; + context?: (() => DialogContext) | DialogContext; + message?: string; + overlay?: boolean; + selector?: string; + ariaLabel?: string; + /** + * @deprecated use custom-class instead + */ + className?: string; + customStyle?: string; + transition?: string; + /** + * @deprecated use beforeClose instead + */ + asyncClose?: boolean; + beforeClose?: null | ((action: Action) => Promise | void); + businessId?: number; + sessionFrom?: string; + overlayStyle?: string; + appParameter?: string; + messageAlign?: string; + sendMessageImg?: string; + showMessageCard?: boolean; + sendMessagePath?: string; + sendMessageTitle?: string; + confirmButtonText?: string; + cancelButtonText?: string; + showConfirmButton?: boolean; + showCancelButton?: boolean; + closeOnClickOverlay?: boolean; + confirmButtonOpenType?: string; +} +declare const Dialog: { + (options: DialogOptions): Promise; + alert(options: DialogOptions): Promise; + confirm(options: DialogOptions): Promise; + close(): void; + stopLoading(): void; + currentOptions: DialogOptions; + defaultOptions: DialogOptions; + setDefaultOptions(options: DialogOptions): void; + resetDefaultOptions(): void; +}; +export default Dialog; diff --git a/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/dialog/dialog.js b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/dialog/dialog.js new file mode 100644 index 0000000..400f4f1 --- /dev/null +++ b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/dialog/dialog.js @@ -0,0 +1,92 @@ +"use strict"; +var __assign = (this && this.__assign) || function () { + __assign = Object.assign || function(t) { + for (var s, i = 1, n = arguments.length; i < n; i++) { + s = arguments[i]; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) + t[p] = s[p]; + } + return t; + }; + return __assign.apply(this, arguments); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +var queue = []; +var defaultOptions = { + show: false, + title: '', + width: null, + theme: 'default', + message: '', + zIndex: 100, + overlay: true, + selector: '#van-dialog', + className: '', + asyncClose: false, + beforeClose: null, + transition: 'scale', + customStyle: '', + messageAlign: '', + overlayStyle: '', + confirmButtonText: '确认', + cancelButtonText: '取消', + showConfirmButton: true, + showCancelButton: false, + closeOnClickOverlay: false, + confirmButtonOpenType: '', +}; +var currentOptions = __assign({}, defaultOptions); +function getContext() { + var pages = getCurrentPages(); + return pages[pages.length - 1]; +} +var Dialog = function (options) { + options = __assign(__assign({}, currentOptions), options); + return new Promise(function (resolve, reject) { + var context = (typeof options.context === 'function' + ? options.context() + : options.context) || getContext(); + var dialog = context.selectComponent(options.selector); + delete options.context; + delete options.selector; + if (dialog) { + dialog.setData(__assign({ callback: function (action, instance) { + action === 'confirm' ? resolve(instance) : reject(instance); + } }, options)); + wx.nextTick(function () { + dialog.setData({ show: true }); + }); + queue.push(dialog); + } + else { + console.warn('未找到 van-dialog 节点,请确认 selector 及 context 是否正确'); + } + }); +}; +Dialog.alert = function (options) { return Dialog(options); }; +Dialog.confirm = function (options) { + return Dialog(__assign({ showCancelButton: true }, options)); +}; +Dialog.close = function () { + queue.forEach(function (dialog) { + dialog.close(); + }); + queue = []; +}; +Dialog.stopLoading = function () { + queue.forEach(function (dialog) { + dialog.stopLoading(); + }); +}; +Dialog.currentOptions = currentOptions; +Dialog.defaultOptions = defaultOptions; +Dialog.setDefaultOptions = function (options) { + currentOptions = __assign(__assign({}, currentOptions), options); + Dialog.currentOptions = currentOptions; +}; +Dialog.resetDefaultOptions = function () { + currentOptions = __assign({}, defaultOptions); + Dialog.currentOptions = currentOptions; +}; +Dialog.resetDefaultOptions(); +exports.default = Dialog; diff --git a/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/dialog/index.d.ts b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/dialog/index.d.ts new file mode 100644 index 0000000..cb0ff5c --- /dev/null +++ b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/dialog/index.d.ts @@ -0,0 +1 @@ +export {}; diff --git a/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/dialog/index.js b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/dialog/index.js new file mode 100644 index 0000000..3ca0b44 --- /dev/null +++ b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/dialog/index.js @@ -0,0 +1,128 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var component_1 = require("../common/component"); +var button_1 = require("../mixins/button"); +var color_1 = require("../common/color"); +var utils_1 = require("../common/utils"); +(0, component_1.VantComponent)({ + mixins: [button_1.button], + classes: ['cancle-button-class', 'confirm-button-class'], + props: { + show: { + type: Boolean, + observer: function (show) { + !show && this.stopLoading(); + }, + }, + title: String, + message: String, + theme: { + type: String, + value: 'default', + }, + useSlot: Boolean, + className: String, + customStyle: String, + asyncClose: Boolean, + messageAlign: String, + beforeClose: null, + overlayStyle: String, + useTitleSlot: Boolean, + showCancelButton: Boolean, + closeOnClickOverlay: Boolean, + confirmButtonOpenType: String, + width: null, + zIndex: { + type: Number, + value: 2000, + }, + confirmButtonText: { + type: String, + value: '确认', + }, + cancelButtonText: { + type: String, + value: '取消', + }, + confirmButtonColor: { + type: String, + value: color_1.RED, + }, + cancelButtonColor: { + type: String, + value: color_1.GRAY, + }, + showConfirmButton: { + type: Boolean, + value: true, + }, + overlay: { + type: Boolean, + value: true, + }, + transition: { + type: String, + value: 'scale', + }, + }, + data: { + loading: { + confirm: false, + cancel: false, + }, + callback: (function () { }), + }, + methods: { + onConfirm: function () { + this.handleAction('confirm'); + }, + onCancel: function () { + this.handleAction('cancel'); + }, + onClickOverlay: function () { + this.close('overlay'); + }, + close: function (action) { + var _this = this; + this.setData({ show: false }); + wx.nextTick(function () { + _this.$emit('close', action); + var callback = _this.data.callback; + if (callback) { + callback(action, _this); + } + }); + }, + stopLoading: function () { + this.setData({ + loading: { + confirm: false, + cancel: false, + }, + }); + }, + handleAction: function (action) { + var _a; + var _this = this; + this.$emit(action, { dialog: this }); + var _b = this.data, asyncClose = _b.asyncClose, beforeClose = _b.beforeClose; + if (!asyncClose && !beforeClose) { + this.close(action); + return; + } + this.setData((_a = {}, + _a["loading.".concat(action)] = true, + _a)); + if (beforeClose) { + (0, utils_1.toPromise)(beforeClose(action)).then(function (value) { + if (value) { + _this.close(action); + } + else { + _this.stopLoading(); + } + }); + } + }, + }, +}); diff --git a/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/dialog/index.json b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/dialog/index.json new file mode 100644 index 0000000..43417fc --- /dev/null +++ b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/dialog/index.json @@ -0,0 +1,9 @@ +{ + "component": true, + "usingComponents": { + "van-popup": "../popup/index", + "van-button": "../button/index", + "van-goods-action": "../goods-action/index", + "van-goods-action-button": "../goods-action-button/index" + } +} diff --git a/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/dialog/index.wxml b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/dialog/index.wxml new file mode 100644 index 0000000..364dd4c --- /dev/null +++ b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/dialog/index.wxml @@ -0,0 +1,113 @@ + + + + + + {{ title }} + + + + + {{ message }} + + + + + {{ cancelButtonText }} + + + {{ confirmButtonText }} + + + + + + {{ cancelButtonText }} + + + {{ confirmButtonText }} + + + diff --git a/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/dialog/index.wxss b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/dialog/index.wxss new file mode 100644 index 0000000..507a789 --- /dev/null +++ b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/dialog/index.wxss @@ -0,0 +1 @@ +@import '../common/index.wxss';.van-dialog{background-color:var(--dialog-background-color,#fff);border-radius:var(--dialog-border-radius,16px);font-size:var(--dialog-font-size,16px);overflow:hidden;top:45%!important;width:var(--dialog-width,320px)}@media (max-width:321px){.van-dialog{width:var(--dialog-small-screen-width,90%)}}.van-dialog__header{font-weight:var(--dialog-header-font-weight,500);line-height:var(--dialog-header-line-height,24px);padding-top:var(--dialog-header-padding-top,24px);text-align:center}.van-dialog__header--isolated{padding:var(--dialog-header-isolated-padding,24px 0)}.van-dialog__message{-webkit-overflow-scrolling:touch;font-size:var(--dialog-message-font-size,14px);line-height:var(--dialog-message-line-height,20px);max-height:var(--dialog-message-max-height,60vh);overflow-y:auto;padding:var(--dialog-message-padding,24px);text-align:center}.van-dialog__message-text{word-wrap:break-word}.van-dialog__message--hasTitle{color:var(--dialog-has-title-message-text-color,#646566);padding-top:var(--dialog-has-title-message-padding-top,8px)}.van-dialog__message--round-button{color:#323233;padding-bottom:16px}.van-dialog__message--left{text-align:left}.van-dialog__message--right{text-align:right}.van-dialog__message--justify{text-align:justify}.van-dialog__footer{display:flex}.van-dialog__footer--round-button{padding:8px 24px 16px!important;position:relative!important}.van-dialog__button{flex:1}.van-dialog__cancel,.van-dialog__confirm{border:0!important}.van-dialog-bounce-enter{opacity:0;transform:translate3d(-50%,-50%,0) scale(.7)}.van-dialog-bounce-leave-active{opacity:0;transform:translate3d(-50%,-50%,0) scale(.9)} \ No newline at end of file diff --git a/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/divider/index.d.ts b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/divider/index.d.ts new file mode 100644 index 0000000..cb0ff5c --- /dev/null +++ b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/divider/index.d.ts @@ -0,0 +1 @@ +export {}; diff --git a/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/divider/index.js b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/divider/index.js new file mode 100644 index 0000000..5c63844 --- /dev/null +++ b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/divider/index.js @@ -0,0 +1,14 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var component_1 = require("../common/component"); +(0, component_1.VantComponent)({ + props: { + dashed: Boolean, + hairline: Boolean, + contentPosition: String, + fontSize: String, + borderColor: String, + textColor: String, + customStyle: String, + }, +}); diff --git a/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/divider/index.json b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/divider/index.json new file mode 100644 index 0000000..a89ef4d --- /dev/null +++ b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/divider/index.json @@ -0,0 +1,4 @@ +{ + "component": true, + "usingComponents": {} +} diff --git a/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/divider/index.wxml b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/divider/index.wxml new file mode 100644 index 0000000..f6a5a45 --- /dev/null +++ b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/divider/index.wxml @@ -0,0 +1,9 @@ + + + + + + diff --git a/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/divider/index.wxs b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/divider/index.wxs new file mode 100644 index 0000000..215b14f --- /dev/null +++ b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/divider/index.wxs @@ -0,0 +1,18 @@ +/* eslint-disable */ +var style = require('../wxs/style.wxs'); +var addUnit = require('../wxs/add-unit.wxs'); + +function rootStyle(data) { + return style([ + { + 'border-color': data.borderColor, + color: data.textColor, + 'font-size': addUnit(data.fontSize), + }, + data.customStyle, + ]); +} + +module.exports = { + rootStyle: rootStyle, +}; diff --git a/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/divider/index.wxss b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/divider/index.wxss new file mode 100644 index 0000000..e91dc44 --- /dev/null +++ b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/divider/index.wxss @@ -0,0 +1 @@ +@import '../common/index.wxss';.van-divider{align-items:center;border:0 solid var(--divider-border-color,#ebedf0);color:var(--divider-text-color,#969799);display:flex;font-size:var(--divider-font-size,14px);line-height:var(--divider-line-height,24px);margin:var(--divider-margin,16px 0)}.van-divider:after,.van-divider:before{border-color:inherit;border-style:inherit;border-width:1px 0 0;box-sizing:border-box;display:block;flex:1;height:1px}.van-divider:before{content:""}.van-divider--hairline:after,.van-divider--hairline:before{transform:scaleY(.5)}.van-divider--dashed{border-style:dashed}.van-divider--center:before,.van-divider--left:before,.van-divider--right:before{margin-right:var(--divider-content-padding,16px)}.van-divider--center:after,.van-divider--left:after,.van-divider--right:after{content:"";margin-left:var(--divider-content-padding,16px)}.van-divider--left:before{max-width:var(--divider-content-left-width,10%)}.van-divider--right:after{max-width:var(--divider-content-right-width,10%)} \ No newline at end of file diff --git a/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/dropdown-item/index.d.ts b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/dropdown-item/index.d.ts new file mode 100644 index 0000000..cb0ff5c --- /dev/null +++ b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/dropdown-item/index.d.ts @@ -0,0 +1 @@ +export {}; diff --git a/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/dropdown-item/index.js b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/dropdown-item/index.js new file mode 100644 index 0000000..826c26a --- /dev/null +++ b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/dropdown-item/index.js @@ -0,0 +1,136 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var relation_1 = require("../common/relation"); +var component_1 = require("../common/component"); +(0, component_1.VantComponent)({ + classes: ['item-title-class'], + field: true, + relation: (0, relation_1.useParent)('dropdown-menu', function () { + this.updateDataFromParent(); + }), + props: { + value: { + type: null, + observer: 'rerender', + }, + title: { + type: String, + observer: 'rerender', + }, + disabled: Boolean, + titleClass: { + type: String, + observer: 'rerender', + }, + options: { + type: Array, + value: [], + observer: 'rerender', + }, + popupStyle: String, + useBeforeToggle: { + type: Boolean, + value: false, + }, + rootPortal: { + type: Boolean, + value: false, + }, + }, + data: { + transition: true, + showPopup: false, + showWrapper: false, + displayTitle: '', + safeAreaTabBar: false, + }, + methods: { + rerender: function () { + var _this = this; + wx.nextTick(function () { + var _a; + (_a = _this.parent) === null || _a === void 0 ? void 0 : _a.updateItemListData(); + }); + }, + updateDataFromParent: function () { + if (this.parent) { + var _a = this.parent.data, overlay = _a.overlay, duration = _a.duration, activeColor = _a.activeColor, closeOnClickOverlay = _a.closeOnClickOverlay, direction = _a.direction, safeAreaTabBar = _a.safeAreaTabBar; + this.setData({ + overlay: overlay, + duration: duration, + activeColor: activeColor, + closeOnClickOverlay: closeOnClickOverlay, + direction: direction, + safeAreaTabBar: safeAreaTabBar, + }); + } + }, + onOpen: function () { + this.$emit('open'); + }, + onOpened: function () { + this.$emit('opened'); + }, + onClose: function () { + this.$emit('close'); + }, + onClosed: function () { + this.$emit('closed'); + this.setData({ showWrapper: false }); + }, + onOptionTap: function (event) { + var option = event.currentTarget.dataset.option; + var value = option.value; + var shouldEmitChange = this.data.value !== value; + this.setData({ showPopup: false, value: value }); + this.$emit('close'); + this.rerender(); + if (shouldEmitChange) { + this.$emit('change', value); + } + }, + toggle: function (show, options) { + var _this = this; + if (options === void 0) { options = {}; } + var showPopup = this.data.showPopup; + if (typeof show !== 'boolean') { + show = !showPopup; + } + if (show === showPopup) { + return; + } + this.onBeforeToggle(show).then(function (status) { + var _a; + if (!status) { + return; + } + _this.setData({ + transition: !options.immediate, + showPopup: show, + }); + if (show) { + (_a = _this.parent) === null || _a === void 0 ? void 0 : _a.getChildWrapperStyle().then(function (wrapperStyle) { + _this.setData({ wrapperStyle: wrapperStyle, showWrapper: true }); + _this.rerender(); + }); + } + else { + _this.rerender(); + } + }); + }, + onBeforeToggle: function (status) { + var _this = this; + var useBeforeToggle = this.data.useBeforeToggle; + if (!useBeforeToggle) { + return Promise.resolve(true); + } + return new Promise(function (resolve) { + _this.$emit('before-toggle', { + status: status, + callback: function (value) { return resolve(value); }, + }); + }); + }, + }, +}); diff --git a/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/dropdown-item/index.json b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/dropdown-item/index.json new file mode 100644 index 0000000..88d5409 --- /dev/null +++ b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/dropdown-item/index.json @@ -0,0 +1,8 @@ +{ + "component": true, + "usingComponents": { + "van-popup": "../popup/index", + "van-cell": "../cell/index", + "van-icon": "../icon/index" + } +} diff --git a/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/dropdown-item/index.wxml b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/dropdown-item/index.wxml new file mode 100644 index 0000000..63904f4 --- /dev/null +++ b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/dropdown-item/index.wxml @@ -0,0 +1,50 @@ + + + + + + + {{ item.text }} + + + + + + + diff --git a/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/dropdown-item/index.wxss b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/dropdown-item/index.wxss new file mode 100644 index 0000000..80505e9 --- /dev/null +++ b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/dropdown-item/index.wxss @@ -0,0 +1 @@ +@import '../common/index.wxss';.van-dropdown-item{left:0;overflow:hidden;position:fixed;right:0}.van-dropdown-item__option{text-align:left}.van-dropdown-item__option--active .van-dropdown-item__icon,.van-dropdown-item__option--active .van-dropdown-item__title{color:var(--dropdown-menu-option-active-color,#ee0a24)}.van-dropdown-item--up{top:0}.van-dropdown-item--down{bottom:0}.van-dropdown-item__icon{display:block;line-height:inherit} \ No newline at end of file diff --git a/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/dropdown-item/shared.d.ts b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/dropdown-item/shared.d.ts new file mode 100644 index 0000000..774eb4c --- /dev/null +++ b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/dropdown-item/shared.d.ts @@ -0,0 +1,5 @@ +export interface Option { + text: string; + value: string | number; + icon: string; +} diff --git a/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/dropdown-item/shared.js b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/dropdown-item/shared.js new file mode 100644 index 0000000..c8ad2e5 --- /dev/null +++ b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/dropdown-item/shared.js @@ -0,0 +1,2 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/dropdown-menu/index.d.ts b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/dropdown-menu/index.d.ts new file mode 100644 index 0000000..cb0ff5c --- /dev/null +++ b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/dropdown-menu/index.d.ts @@ -0,0 +1 @@ +export {}; diff --git a/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/dropdown-menu/index.js b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/dropdown-menu/index.js new file mode 100644 index 0000000..aed2921 --- /dev/null +++ b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/dropdown-menu/index.js @@ -0,0 +1,122 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var component_1 = require("../common/component"); +var relation_1 = require("../common/relation"); +var utils_1 = require("../common/utils"); +var ARRAY = []; +(0, component_1.VantComponent)({ + field: true, + classes: ['title-class'], + relation: (0, relation_1.useChildren)('dropdown-item', function () { + this.updateItemListData(); + }), + props: { + activeColor: { + type: String, + observer: 'updateChildrenData', + }, + overlay: { + type: Boolean, + value: true, + observer: 'updateChildrenData', + }, + zIndex: { + type: Number, + value: 10, + }, + duration: { + type: Number, + value: 200, + observer: 'updateChildrenData', + }, + direction: { + type: String, + value: 'down', + observer: 'updateChildrenData', + }, + safeAreaTabBar: { + type: Boolean, + value: false, + }, + closeOnClickOverlay: { + type: Boolean, + value: true, + observer: 'updateChildrenData', + }, + closeOnClickOutside: { + type: Boolean, + value: true, + }, + }, + data: { + itemListData: [], + }, + beforeCreate: function () { + var windowHeight = (0, utils_1.getSystemInfoSync)().windowHeight; + this.windowHeight = windowHeight; + ARRAY.push(this); + }, + destroyed: function () { + var _this = this; + ARRAY = ARRAY.filter(function (item) { return item !== _this; }); + }, + methods: { + updateItemListData: function () { + this.setData({ + itemListData: this.children.map(function (child) { return child.data; }), + }); + }, + updateChildrenData: function () { + this.children.forEach(function (child) { + child.updateDataFromParent(); + }); + }, + toggleItem: function (active) { + this.children.forEach(function (item, index) { + var showPopup = item.data.showPopup; + if (index === active) { + item.toggle(); + } + else if (showPopup) { + item.toggle(false, { immediate: true }); + } + }); + }, + close: function () { + this.children.forEach(function (child) { + child.toggle(false, { immediate: true }); + }); + }, + getChildWrapperStyle: function () { + var _this = this; + var _a = this.data, zIndex = _a.zIndex, direction = _a.direction; + return (0, utils_1.getRect)(this, '.van-dropdown-menu').then(function (rect) { + var _a = rect.top, top = _a === void 0 ? 0 : _a, _b = rect.bottom, bottom = _b === void 0 ? 0 : _b; + var offset = direction === 'down' ? bottom : _this.windowHeight - top; + var wrapperStyle = "z-index: ".concat(zIndex, ";"); + if (direction === 'down') { + wrapperStyle += "top: ".concat((0, utils_1.addUnit)(offset), ";"); + } + else { + wrapperStyle += "bottom: ".concat((0, utils_1.addUnit)(offset), ";"); + } + return wrapperStyle; + }); + }, + onTitleTap: function (event) { + var _this = this; + var index = event.currentTarget.dataset.index; + var child = this.children[index]; + if (!child.data.disabled) { + ARRAY.forEach(function (menuItem) { + if (menuItem && + menuItem.data.closeOnClickOutside && + menuItem !== _this) { + menuItem.close(); + } + }); + this.toggleItem(index); + } + }, + }, +}); diff --git a/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/dropdown-menu/index.json b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/dropdown-menu/index.json new file mode 100644 index 0000000..467ce29 --- /dev/null +++ b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/dropdown-menu/index.json @@ -0,0 +1,3 @@ +{ + "component": true +} diff --git a/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/dropdown-menu/index.wxml b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/dropdown-menu/index.wxml new file mode 100644 index 0000000..ec165a9 --- /dev/null +++ b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/dropdown-menu/index.wxml @@ -0,0 +1,23 @@ + + + + + + + + {{ computed.displayTitle(item) }} + + + + + + diff --git a/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/dropdown-menu/index.wxs b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/dropdown-menu/index.wxs new file mode 100644 index 0000000..6538854 --- /dev/null +++ b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/dropdown-menu/index.wxs @@ -0,0 +1,16 @@ +/* eslint-disable */ +function displayTitle(item) { + if (item.title) { + return item.title; + } + + var match = item.options.filter(function(option) { + return option.value === item.value; + }); + var displayTitle = match.length ? match[0].text : ''; + return displayTitle; +} + +module.exports = { + displayTitle: displayTitle +}; diff --git a/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/dropdown-menu/index.wxss b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/dropdown-menu/index.wxss new file mode 100644 index 0000000..dba000e --- /dev/null +++ b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/dropdown-menu/index.wxss @@ -0,0 +1 @@ +@import '../common/index.wxss';.van-dropdown-menu{background-color:var(--dropdown-menu-background-color,#fff);box-shadow:var(--dropdown-menu-box-shadow,0 2px 12px hsla(210,1%,40%,.12));display:flex;height:var(--dropdown-menu-height,50px);-webkit-user-select:none;user-select:none}.van-dropdown-menu__item{align-items:center;display:flex;flex:1;justify-content:center;min-width:0}.van-dropdown-menu__item:active{opacity:.7}.van-dropdown-menu__item--disabled:active{opacity:1}.van-dropdown-menu__item--disabled .van-dropdown-menu__title{color:var(--dropdown-menu-title-disabled-text-color,#969799)}.van-dropdown-menu__title{box-sizing:border-box;color:var(--dropdown-menu-title-text-color,#323233);font-size:var(--dropdown-menu-title-font-size,15px);line-height:var(--dropdown-menu-title-line-height,18px);max-width:100%;padding:var(--dropdown-menu-title-padding,0 24px 0 8px);position:relative}.van-dropdown-menu__title:after{border-color:transparent transparent currentcolor currentcolor;border-style:solid;border-width:3px;content:"";margin-top:-5px;opacity:.8;position:absolute;right:11px;top:50%;transform:rotate(-45deg)}.van-dropdown-menu__title--active{color:var(--dropdown-menu-title-active-text-color,#ee0a24)}.van-dropdown-menu__title--down:after{margin-top:-1px;transform:rotate(135deg)} \ No newline at end of file diff --git a/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/empty/index.d.ts b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/empty/index.d.ts new file mode 100644 index 0000000..cb0ff5c --- /dev/null +++ b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/empty/index.d.ts @@ -0,0 +1 @@ +export {}; diff --git a/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/empty/index.js b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/empty/index.js new file mode 100644 index 0000000..755e638 --- /dev/null +++ b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/empty/index.js @@ -0,0 +1,12 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var component_1 = require("../common/component"); +(0, component_1.VantComponent)({ + props: { + description: String, + image: { + type: String, + value: 'default', + }, + }, +}); diff --git a/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/empty/index.json b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/empty/index.json new file mode 100644 index 0000000..a89ef4d --- /dev/null +++ b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/empty/index.json @@ -0,0 +1,4 @@ +{ + "component": true, + "usingComponents": {} +} diff --git a/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/empty/index.wxml b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/empty/index.wxml new file mode 100644 index 0000000..9c7b719 --- /dev/null +++ b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/empty/index.wxml @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + {{ description }} + + + + + + diff --git a/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/empty/index.wxs b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/empty/index.wxs new file mode 100644 index 0000000..cf92ece --- /dev/null +++ b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/empty/index.wxs @@ -0,0 +1,15 @@ +/* eslint-disable */ +var PRESETS = ['error', 'search', 'default', 'network']; + +function imageUrl(image) { + if (PRESETS.indexOf(image) !== -1) { + return 'https://img.yzcdn.cn/vant/empty-image-' + image + '.png'; + } + + return image; +} + +module.exports = { + imageUrl: imageUrl, +}; + diff --git a/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/empty/index.wxss b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/empty/index.wxss new file mode 100644 index 0000000..0fb74fe --- /dev/null +++ b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/empty/index.wxss @@ -0,0 +1 @@ +@import '../common/index.wxss';.van-empty{align-items:center;box-sizing:border-box;display:flex;flex-direction:column;justify-content:center;padding:32px 0}.van-empty__image{height:160px;width:160px}.van-empty__image:empty{display:none}.van-empty__image__img{height:100%;width:100%}.van-empty__image:not(:empty)+.van-empty__image{display:none}.van-empty__description{color:#969799;font-size:14px;line-height:20px;margin-top:16px;padding:0 60px}.van-empty__description:empty,.van-empty__description:not(:empty)+.van-empty__description{display:none}.van-empty__bottom{margin-top:24px} \ No newline at end of file diff --git a/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/field/index.d.ts b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/field/index.d.ts new file mode 100644 index 0000000..cb0ff5c --- /dev/null +++ b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/field/index.d.ts @@ -0,0 +1 @@ +export {}; diff --git a/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/field/index.js b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/field/index.js new file mode 100644 index 0000000..c20d266 --- /dev/null +++ b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/field/index.js @@ -0,0 +1,137 @@ +"use strict"; +var __assign = (this && this.__assign) || function () { + __assign = Object.assign || function(t) { + for (var s, i = 1, n = arguments.length; i < n; i++) { + s = arguments[i]; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) + t[p] = s[p]; + } + return t; + }; + return __assign.apply(this, arguments); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +var utils_1 = require("../common/utils"); +var component_1 = require("../common/component"); +var props_1 = require("./props"); +(0, component_1.VantComponent)({ + field: true, + classes: ['input-class', 'right-icon-class', 'label-class'], + props: __assign(__assign(__assign(__assign({}, props_1.commonProps), props_1.inputProps), props_1.textareaProps), { size: String, icon: String, label: String, error: Boolean, center: Boolean, isLink: Boolean, leftIcon: String, rightIcon: String, autosize: null, required: Boolean, iconClass: String, clickable: Boolean, inputAlign: String, customStyle: String, errorMessage: String, arrowDirection: String, showWordLimit: Boolean, errorMessageAlign: String, readonly: { + type: Boolean, + observer: 'setShowClear', + }, clearable: { + type: Boolean, + observer: 'setShowClear', + }, clearTrigger: { + type: String, + value: 'focus', + }, border: { + type: Boolean, + value: true, + }, titleWidth: { + type: String, + value: '6.2em', + }, clearIcon: { + type: String, + value: 'clear', + }, extraEventParams: { + type: Boolean, + value: false, + } }), + data: { + focused: false, + innerValue: '', + showClear: false, + }, + created: function () { + this.value = this.data.value; + this.setData({ innerValue: this.value }); + }, + methods: { + formatValue: function (value) { + var maxlength = this.data.maxlength; + if (maxlength !== -1 && value.length > maxlength) { + return value.slice(0, maxlength); + } + return value; + }, + onInput: function (event) { + var _a = (event.detail || {}).value, value = _a === void 0 ? '' : _a; + var formatValue = this.formatValue(value); + this.value = formatValue; + this.setShowClear(); + return this.emitChange(__assign(__assign({}, event.detail), { value: formatValue })); + }, + onFocus: function (event) { + this.focused = true; + this.setShowClear(); + this.$emit('focus', event.detail); + }, + onBlur: function (event) { + this.focused = false; + this.setShowClear(); + this.$emit('blur', event.detail); + }, + onClickIcon: function () { + this.$emit('click-icon'); + }, + onClickInput: function (event) { + this.$emit('click-input', event.detail); + }, + onClear: function () { + var _this = this; + this.setData({ innerValue: '' }); + this.value = ''; + this.setShowClear(); + (0, utils_1.nextTick)(function () { + _this.emitChange({ value: '' }); + _this.$emit('clear', ''); + }); + }, + onConfirm: function (event) { + var _a = (event.detail || {}).value, value = _a === void 0 ? '' : _a; + this.value = value; + this.setShowClear(); + this.$emit('confirm', value); + }, + setValue: function (value) { + this.value = value; + this.setShowClear(); + if (value === '') { + this.setData({ innerValue: '' }); + } + this.emitChange({ value: value }); + }, + onLineChange: function (event) { + this.$emit('linechange', event.detail); + }, + onKeyboardHeightChange: function (event) { + this.$emit('keyboardheightchange', event.detail); + }, + emitChange: function (detail) { + var extraEventParams = this.data.extraEventParams; + this.setData({ value: detail.value }); + var result; + var data = extraEventParams + ? __assign(__assign({}, detail), { callback: function (data) { + result = data; + } }) : detail.value; + this.$emit('input', data); + this.$emit('change', data); + return result; + }, + setShowClear: function () { + var _a = this.data, clearable = _a.clearable, readonly = _a.readonly, clearTrigger = _a.clearTrigger; + var _b = this, focused = _b.focused, value = _b.value; + var showClear = false; + if (clearable && !readonly) { + var hasValue = !!value; + var trigger = clearTrigger === 'always' || (clearTrigger === 'focus' && focused); + showClear = hasValue && trigger; + } + this.setData({ showClear: showClear }); + }, + noop: function () { }, + }, +}); diff --git a/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/field/index.json b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/field/index.json new file mode 100644 index 0000000..5906c50 --- /dev/null +++ b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/field/index.json @@ -0,0 +1,7 @@ +{ + "component": true, + "usingComponents": { + "van-cell": "../cell/index", + "van-icon": "../icon/index" + } +} diff --git a/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/field/index.wxml b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/field/index.wxml new file mode 100644 index 0000000..6018993 --- /dev/null +++ b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/field/index.wxml @@ -0,0 +1,56 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/field/index.wxs b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/field/index.wxs new file mode 100644 index 0000000..78575b9 --- /dev/null +++ b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/field/index.wxs @@ -0,0 +1,18 @@ +/* eslint-disable */ +var style = require('../wxs/style.wxs'); +var addUnit = require('../wxs/add-unit.wxs'); + +function inputStyle(autosize) { + if (autosize && autosize.constructor === 'Object') { + return style({ + 'min-height': addUnit(autosize.minHeight), + 'max-height': addUnit(autosize.maxHeight), + }); + } + + return ''; +} + +module.exports = { + inputStyle: inputStyle, +}; diff --git a/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/field/index.wxss b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/field/index.wxss new file mode 100644 index 0000000..7571fe6 --- /dev/null +++ b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/field/index.wxss @@ -0,0 +1 @@ +@import '../common/index.wxss';.van-field{--cell-icon-size:var(--field-icon-size,16px)}.van-field__label{color:var(--field-label-color,#646566)}.van-field__label--disabled{color:var(--field-disabled-text-color,#c8c9cc)}.van-field__body{align-items:center;display:flex}.van-field__body--textarea{box-sizing:border-box;line-height:1.2em;min-height:var(--cell-line-height,24px);padding:3.6px 0}.van-field__control:empty+.van-field__control{display:block}.van-field__control{background-color:initial;border:0;box-sizing:border-box;color:var(--field-input-text-color,#323233);display:none;height:var(--cell-line-height,24px);line-height:inherit;margin:0;min-height:var(--cell-line-height,24px);padding:0;position:relative;resize:none;text-align:left;width:100%}.van-field__control:empty{display:none}.van-field__control--textarea{height:var(--field-text-area-min-height,18px);min-height:var(--field-text-area-min-height,18px)}.van-field__control--error{color:var(--field-input-error-text-color,#ee0a24)}.van-field__control--disabled{background-color:initial;color:var(--field-input-disabled-text-color,#c8c9cc);opacity:1}.van-field__control--center{text-align:center}.van-field__control--right{text-align:right}.van-field__control--custom{align-items:center;display:flex;min-height:var(--cell-line-height,24px)}.van-field__placeholder{color:var(--field-placeholder-text-color,#c8c9cc);left:0;pointer-events:none;position:absolute;right:0;top:0}.van-field__placeholder--error{color:var(--field-error-message-color,#ee0a24)}.van-field__icon-root{align-items:center;display:flex;min-height:var(--cell-line-height,24px)}.van-field__clear-root,.van-field__icon-container{line-height:inherit;margin-right:calc(var(--padding-xs, 8px)*-1);padding:0 var(--padding-xs,8px);vertical-align:middle}.van-field__button,.van-field__clear-root,.van-field__icon-container{flex-shrink:0}.van-field__clear-root{color:var(--field-clear-icon-color,#c8c9cc);font-size:var(--field-clear-icon-size,16px)}.van-field__icon-container{color:var(--field-icon-container-color,#969799);font-size:var(--field-icon-size,16px)}.van-field__icon-container:empty{display:none}.van-field__button{padding-left:var(--padding-xs,8px)}.van-field__button:empty{display:none}.van-field__error-message{color:var(--field-error-message-color,#ee0a24);font-size:var(--field-error-message-text-font-size,12px);text-align:left}.van-field__error-message--center{text-align:center}.van-field__error-message--right{text-align:right}.van-field__word-limit{color:var(--field-word-limit-color,#646566);font-size:var(--field-word-limit-font-size,12px);line-height:var(--field-word-limit-line-height,16px);margin-top:var(--padding-base,4px);text-align:right}.van-field__word-num{display:inline}.van-field__word-num--full{color:var(--field-word-num-full-color,#ee0a24)} \ No newline at end of file diff --git a/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/field/input.wxml b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/field/input.wxml new file mode 100644 index 0000000..e39a5ee --- /dev/null +++ b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/field/input.wxml @@ -0,0 +1,29 @@ + diff --git a/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/field/props.d.ts b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/field/props.d.ts new file mode 100644 index 0000000..5cd130a --- /dev/null +++ b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/field/props.d.ts @@ -0,0 +1,4 @@ +/// +export declare const commonProps: WechatMiniprogram.Component.PropertyOption; +export declare const inputProps: WechatMiniprogram.Component.PropertyOption; +export declare const textareaProps: WechatMiniprogram.Component.PropertyOption; diff --git a/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/field/props.js b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/field/props.js new file mode 100644 index 0000000..3cb8dca --- /dev/null +++ b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/field/props.js @@ -0,0 +1,67 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.textareaProps = exports.inputProps = exports.commonProps = void 0; +exports.commonProps = { + value: { + type: String, + observer: function (value) { + if (value !== this.value) { + this.setData({ innerValue: value }); + this.value = value; + } + }, + }, + placeholder: String, + placeholderStyle: String, + placeholderClass: String, + disabled: Boolean, + maxlength: { + type: Number, + value: -1, + }, + cursorSpacing: { + type: Number, + value: 50, + }, + autoFocus: Boolean, + focus: Boolean, + cursor: { + type: Number, + value: -1, + }, + selectionStart: { + type: Number, + value: -1, + }, + selectionEnd: { + type: Number, + value: -1, + }, + adjustPosition: { + type: Boolean, + value: true, + }, + holdKeyboard: Boolean, +}; +exports.inputProps = { + type: { + type: String, + value: 'text', + }, + password: Boolean, + confirmType: String, + confirmHold: Boolean, + alwaysEmbed: Boolean, +}; +exports.textareaProps = { + autoHeight: Boolean, + fixed: Boolean, + showConfirmBar: { + type: Boolean, + value: true, + }, + disableDefaultPadding: { + type: Boolean, + value: true, + }, +}; diff --git a/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/field/textarea.wxml b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/field/textarea.wxml new file mode 100644 index 0000000..d42c184 --- /dev/null +++ b/weapp/miniprogram_npm/miniprogram_npm/@vant/weapp/field/textarea.wxml @@ -0,0 +1,30 @@ + + + + 随便试试 + + + + + + + + diff --git a/weapp/pages/home/index.wxss b/weapp/pages/home/index.wxss new file mode 100644 index 0000000..1f3ba9d --- /dev/null +++ b/weapp/pages/home/index.wxss @@ -0,0 +1,620 @@ +/* 在文件顶部添加这段代码 */ +.custom-refresh { + height: 80rpx; + display: flex; + justify-content: center; + align-items: center; + transition: all 0.3s; + opacity: 0; + transform: translateY(-100%); +} + +.custom-refresh.refreshing { + opacity: 1; + transform: translateY(0); +} + +.refresh-icon { + width: 40rpx; + height: 40rpx; + border: 4rpx solid #4285F4; + border-top-color: transparent; + border-radius: 50%; + margin-right: 20rpx; + animation: spin 1s linear infinite; +} + +.refresh-text { + font-size: 28rpx; + color: #4285F4; +} + +@keyframes spin { + 0% { transform: rotate(0deg); } + 100% { transform: rotate(360deg); } +} + +/* 注释掉搜索栏样式 +.search-bar { + background-color: #FFFFFF; + border-radius: 20rpx; + padding: 10rpx 20rpx; + margin-bottom: 20rpx; +} + +.search-input { + width: 100%; + border: none; + outline: none; + font-size: 28rpx; +} +*/ + +/* 其余样式保持不变 */ +.container { + background-color: #F0F2F5; + min-height: 100vh; + padding: 40rpx 20rpx; /* 减小左右内边距 */ + padding-top: calc(88rpx + env(safe-area-inset-top) + 80rpx); /* 调整这里 */ + padding-bottom: calc(120rpx + env(safe-area-inset-bottom)); + box-sizing: border-box; + position: relative; + display: flex; + flex-direction: column; +} + +.container-with-schedules { + background: linear-gradient(to bottom, #f0f4ff, #FFFFFF); +} + +.schedule-container { + display: flex; + flex-direction: column; + height: 100vh; + padding-top: 20px; +} + +/* 修改标题样式 */ +.title { + font-size: 36rpx; + font-weight: 600; + color: #333; +} + +/* 修改菜单图标样式 */ +.menu-icon { + font-size: 48rpx; + color: #333; +} + +/* 修改日程列表样式 */ +.schedule-list { + padding: 20rpx 30rpx; /* 增加左右内边距 */ +} + +.section-title { + font-size: 36rpx; + font-weight: bold; + color: #333; + margin-bottom: 20rpx; + text-align: left; /* 改为左对齐 */ + padding-left: 20rpx; /* 添加左边距,使标题与左边界有一定距离 */ +} + +/* 修改日程卡片样式 */ +.schedule-items { + display: flex; + flex-direction: column; + gap: 20rpx; + background-color: transparent; + align-items: center; /* 居中显示 */ +} + +.schedule-item { + width: 100%; + max-width: 680rpx; + background-color: #ffffff; + border-radius: 10rpx; + margin-bottom: 20rpx; + box-shadow: 0 2rpx 10rpx rgba(0, 0, 0, 0.1); +} + +.schedule-info { + width: 100%; + padding: 0 20rpx; /* 添加左右内边距 */ +} + +.schedule-header { + display: flex; + justify-content: space-between; + margin-bottom: 15rpx; + align-items: center; + padding: 0 5rpx; /* 添加左右内边距 */ +} + +.schedule-date { + font-size: 24rpx; + color: #4285F4; /* 使用蓝色 */ + font-weight: 500; +} + +.schedule-time { + font-size: 24rpx; + color: #34A853; /* 使用绿色 */ + font-weight: 500; +} + +.schedule-description { + font-size: 28rpx; + color: #333; + font-weight: 500; +} + +/* 删除 .schedule-detail-btn 和 .detail-icon 相关样式 */ + +/* 修改添加按钮样式 */ +.add-button-container { + position: fixed; + right: 30rpx; + bottom: 140rpx; /* 保持不变或根据需要微调 */ + display: flex; + flex-direction: column; + align-items: center; + z-index: 100; +} + +.option-buttons-overlay { + position: fixed; + top: 0; + left: 0; + right: 0; + bottom: 0; + background-color: rgba(0, 0, 0, 0.5); + opacity: 0; + visibility: hidden; + transition: opacity 0.3s ease; +} + +.option-buttons-overlay.show { + opacity: 1; + visibility: visible; +} + +.option-buttons { + position: absolute; + bottom: 180rpx; /* 增加这个值,使选项按钮组整体上移 */ + right: 0; + display: flex; + flex-direction: column; + align-items: flex-end; + opacity: 0; + transform: translateY(20px); + pointer-events: none; + transition: opacity 0.3s ease, transform 0.3s ease; +} + +.option-buttons.show { + opacity: 1; + transform: translateY(0); + pointer-events: auto; +} + +.option-button { + width: 240rpx; + height: 100rpx; + border-radius: 50rpx; + display: flex; + justify-content: center; + align-items: center; + margin-bottom: 40rpx; /* 增加按钮之间的间距 */ + box-shadow: 0 4rpx 12rpx rgba(0, 0, 0, 0.2); + opacity: 0; + transform: translateX(20px); + transition: opacity 0.3s ease, transform 0.3s ease; +} + +.option-buttons.show .option-button { + opacity: 1; + transform: translateX(0); +} + +.option-buttons.show .option-button:nth-child(1) { + transition-delay: 0.1s; +} + +.option-buttons.show .option-button:nth-child(2) { + transition-delay: 0.2s; +} + +.option-buttons.show .option-button:nth-child(3) { + transition-delay: 0.3s; +} + +.option-icon { + width: 48rpx; /* 增加图标大小 */ + height: 48rpx; + margin-right: 16rpx; /* 增加图标和文字之间的间距 */ +} + +.option-text { + font-size: 32rpx; /* 增加文字大小 */ + color: #ffffff; + font-weight: bold; +} + +.pdf-option { + background-color: #8E44AD; +} + +.image-option { + background-color: #27AE60; +} + +.text-option { + background-color: #3498DB; +} + +.add-button { + width: 140rpx; + height: 140rpx; + border-radius: 50%; + background-color: #4285F4; + color: white; + font-size: 90rpx; /* 增加加号大小 */ + display: flex; + justify-content: center; + align-items: center; + box-shadow: 0 4rpx 12rpx rgba(0, 0, 0, 0.2); + transition: all 0.3s ease; + line-height: 1; + text-align: center; + position: relative; + z-index: 2; + align-self: flex-end; + margin-right: 40rpx; +} + +.add-button::before { + content: ''; + position: absolute; + top: 50%; + left: 50%; + width: 100%; + height: 100%; + border-radius: 50%; + background-color: rgba(66, 133, 244, 0.3); + z-index: -1; + animation: pulse 4s infinite; +} + +@keyframes pulse { + 0% { + transform: translate(-50%, -50%) scale(1); + opacity: 0.8; + } + 50% { + transform: translate(-50%, -50%) scale(1.8); + opacity: 0; + } + 100% { + transform: translate(-50%, -50%) scale(1); + opacity: 0.8; + } +} + +.add-button.cancel { + transform: rotate(45deg); + background-color: #FF4081; +} + +.add-button.cancel::before { + display: none; +} + +.add-icon, .cancel-icon { + transition: all 0.3s ease; + display: flex; + justify-content: center; + align-items: center; + width: 100%; + height: 100%; + position: relative; + z-index: 3; +} + +.no-schedules { + flex: 1; /* 让这个容器占据剩余空间 */ + display: flex; + flex-direction: column; + justify-content: center; /* 垂直居中 */ + align-items: center; /* 水平居中 */ + padding-bottom: 50vh; /* 向上偏移一些,可以根据需要调整 */ +} + +.no-schedules-image { + width: 500rpx; /* 增加宽度 */ + +} + +.no-schedules-text { + display: flex; + flex-direction: column; + align-items: center; + text-align: center; /* 确保文字居中 */ +} + +.primary-text { + font-size: 40rpx; + font-weight: bold; + color: #333; + margin-bottom: 20rpx; /* 增加底部边距 */ +} + +.secondary-text { + font-size: 28rpx; + color: #666; +} + +/* 在文件末尾添加���下样式 */ +.text-input-popup { + position: fixed; + left: 0; + right: 0; + bottom: 0; + background-color: white; + z-index: 999; + transition: bottom 0.3s ease, opacity 0.3s ease; + opacity: 0; + pointer-events: none; +} + +.text-input-popup.show { + opacity: 1; + pointer-events: auto; +} + +.text-input-content { + padding: 20rpx; + width: 100%; + box-sizing: border-box; +} + +.text-input-area { + width: 100%; + min-height: 80rpx; + max-height: 200rpx; + border: 1px solid #ccc; + border-radius: 10rpx; + padding: 10rpx; + margin-bottom: 20rpx; + font-size: 28rpx; +} + +.button-container { + display: flex; + justify-content: space-between; + align-items: center; + height: 40px; +} + +.try-button { + background-color: #4CAF50; + border-radius: 20rpx; + padding: 0 20rpx; + height: 100%; + display: flex; + align-items: center; + justify-content: center; +} + +.try-text { + color: white; + font-size: 28rpx; +} + +.send-button { + width: 40px; + height: 40px; + border-radius: 50%; + background-color: #007AFF; + display: flex; + align-items: center; + justify-content: center; +} + +.send-button.inactive { + opacity: 0.5; +} + +.send-icon { + width: 24px; + height: 24px; +} + +/* 添加蒙版样式 */ +.overlay { + position: fixed; + top: 0; + left: 0; + right: 0; + bottom: 0; + background-color: rgba(0, 0, 0, 0.5); + z-index: 999; + display: none; +} + +.overlay.show { + display: block; +} + +schedule-details { + z-index: 1000; +} + +.loading-container { + position: fixed; + top: 50%; + left: 50%; + transform: translate(-50%, -50%); + display: flex; + flex-direction: column; + align-items: center; + z-index: 1000; +} + +.loading-spinner { + width: 40rpx; + height: 40rpx; + border: 4rpx solid #f3f3f3; + border-top: 4rpx solid #3498db; + border-radius: 50%; + animation: spin 1s linear infinite; +} + +.loading-text { + margin-top: 20rpx; + font-size: 28rpx; + color: #333; +} + +@keyframes spin { + 0% { transform: rotate(0deg); } + 100% { transform: rotate(360deg); } +} + +.schedule-list { + padding: 5rpx; +} + +.time-section { + margin-bottom: 40rpx; +} + + +.schedule-item { + display: flex; + justify-content: space-between; + align-items: center; + padding: 20rpx 10rpx; + border-bottom: 1rpx solid #f0f0f0; +} + +.schedule-item:last-child { + border-bottom: none; +} + +.schedule-info { + flex: 1; +} + +.sidebar { + position: fixed; + top: 0; + left: -70%; + width: 70%; + height: 100%; + background-color: #fff; + z-index: 1000; + transition: left 0.3s ease-out; +} + +.sidebar.show { + left: 0; +} + +.sidebar-mask { + position: fixed; + top: 0; + left: 0; + width: 100%; + height: 100%; + background-color: rgba(0, 0, 0, 0.5); + z-index: 999; + display: none; +} + +.sidebar.show .sidebar-mask { + display: block; +} + +.sidebar-content { + height: 100%; + display: flex; + flex-direction: column; +} + +.sidebar-header { + padding: 20px; + background-color: #f0f0f0; +} + +.sidebar-menu { + flex: 1; + padding: 20px; +} + +.menu-item { + padding: 10px 0; + font-size: 16px; + border-bottom: 1px solid #eee; +} + +.page-container { + transition: transform 0.3s ease-out; +} + +.page-container.sidebar-open { + transform: translateX(80%); +} + +/* 添加以下样式 */ +.input-overlay { + position: fixed; + top: 0; + left: 0; + right: 0; + bottom: 0; + background-color: rgba(0, 0, 0, 0.5); + z-index: 998; + opacity: 0; + visibility: hidden; + transition: opacity 0.3s ease, visibility 0.3s ease; +} + +.input-overlay.show { + opacity: 1; + visibility: visible; +} + +/* 修改 text-input-popup 的 z-index */ +.text-input-popup { + /* ... 其他样式保持不变 ... */ + z-index: 999; +} + +/* 添加一个新的样式来美化时间和日期的容器 */ +.schedule-datetime { + display: flex; + align-items: center; + background-color: #f0f4ff; /* 淡蓝色背景 */ + border-radius: 20rpx; + padding: 6rpx 12rpx; +} + +.schedule-datetime .schedule-date { + margin-right: 10rpx; /* 在日期和时间之间添加一些间距 */ +} + +/* 可以添加一个小图标来分隔日期和时间 */ +.schedule-datetime::after { + content: '•'; + margin: 0 6rpx; + color: #888; +} + + + + + + + diff --git a/weapp/pages/home/txtExample.js b/weapp/pages/home/txtExample.js new file mode 100644 index 0000000..57b5ac7 --- /dev/null +++ b/weapp/pages/home/txtExample.js @@ -0,0 +1 @@ +module.exports = ["【朝歌法院】(申请执行人/代理人)张三:你方申请执行XX集团有限公司合同纠纷执行一案,【案号:(2023)商5104执3287号】,请你方于2023年6月30日上午9时后,至朝歌市文山区人民法院执行局(三楼300室)办理执行相关手续。 承办人:李四联系电话:0591-88265553 地址:朝歌市文山区石边路3号 注:申请执行人(代理人)须准时到庭。若无正当理由未到庭,本院将依据《最高人民法院关于适用<中华人民共和国民事诉讼法>的解释》第五百一十七条之规定,依职权终结本案的本次执行程序。", "11:47川令<100106846207137165432>短信星期二22:55【朝歌市儿童医院】您好,您已成功预约福建省儿童医院牙齿矫正专病门诊(门诊楼三层(口腔科)诊室3)孙严医生,(预估看诊时间:2023年07月16日周日上午09:09),实际看诊时间以医生看诊叫号为准,请于预约时间前30分钟内取号,过号则作废,需导诊台重新预约。我院已实现同级医院间的部分检查检验结果互通、互认。就医时请主动告知就诊医师,互认后无需重复开具相关检查、检验项目。短信","【飞鹿运动】亲爱的飞鹿用户,您预约了07月26日12:30-13:30 六一公馆店的塑形杠铃 BODYPUMP?,记得提前15分钟进馆热身喲!"] \ No newline at end of file diff --git a/weapp/project.config.json b/weapp/project.config.json new file mode 100644 index 0000000..0e726f2 --- /dev/null +++ b/weapp/project.config.json @@ -0,0 +1,40 @@ +{ + "description": "项目配置文件。", + "packOptions": { + "ignore": [], + "include": [] + }, + "setting": { + "urlCheck": false, + "es6": true, + "postcss": false, + "minified": true, + "newFeature": true, + "bigPackageSizeSupport": true, + "babelSetting": { + "ignore": [], + "disablePlugins": [], + "outputPath": "" + }, + "packNpmManually": true, + "packNpmRelationList": [ + { + "packageJsonPath": "./package.json", + "miniprogramNpmDistDir": "./" + } + ], + "enhance": true + }, + "compileType": "miniprogram", + "libVersion": "2.30.0", + "appid": "wx4b6e52da1242dd7a", + "projectname": "百事通", + "condition": {}, + "editorSetting": { + "tabIndent": "insertSpaces", + "tabSize": 2 + }, + "simulatorPluginLibVersion": { + "wxext14566970e7e9f62": "2.27.3" + } +} \ No newline at end of file diff --git a/weapp/project.private.config.json b/weapp/project.private.config.json new file mode 100644 index 0000000..ffde684 --- /dev/null +++ b/weapp/project.private.config.json @@ -0,0 +1,8 @@ +{ + "description": "项目私有配置文件。此文件中的内容将覆盖 project.config.json 中的相同字段。项目的改动优先同步到此文件中。详见文档:https://developers.weixin.qq.com/miniprogram/dev/devtools/projectconfig.html", + "projectname": "百事通", + "setting": { + "compileHotReLoad": true + }, + "libVersion": "2.33.0" +} \ No newline at end of file diff --git a/weapp/static/head.jpg b/weapp/static/head.jpg new file mode 100644 index 0000000..9f0543c Binary files /dev/null and b/weapp/static/head.jpg differ diff --git a/weapp/static/img.png b/weapp/static/img.png new file mode 100644 index 0000000..76ad993 Binary files /dev/null and b/weapp/static/img.png differ diff --git a/weapp/static/pdf.png b/weapp/static/pdf.png new file mode 100644 index 0000000..38e28b2 Binary files /dev/null and b/weapp/static/pdf.png differ diff --git a/weapp/static/relax12.png b/weapp/static/relax12.png new file mode 100644 index 0000000..c68b1db Binary files /dev/null and b/weapp/static/relax12.png differ diff --git a/weapp/static/send.png b/weapp/static/send.png new file mode 100644 index 0000000..4111839 Binary files /dev/null and b/weapp/static/send.png differ diff --git a/weapp/static/text.png b/weapp/static/text.png new file mode 100644 index 0000000..4288c09 Binary files /dev/null and b/weapp/static/text.png differ diff --git a/weapp/test.html b/weapp/test.html new file mode 100644 index 0000000..bddddf4 --- /dev/null +++ b/weapp/test.html @@ -0,0 +1,74 @@ + + + + + + AI 日程 + + + +
+
+

AI 日程

+
+
+

今天是 2023 年 12 月 18 日 星期一

+
+
+

今天有没有安排日程呢?

+
+
+

今天还没有安排日程呢。

+
+
+ +
+
+ + \ No newline at end of file diff --git a/weapp/tsconfig.json b/weapp/tsconfig.json new file mode 100644 index 0000000..b135192 --- /dev/null +++ b/weapp/tsconfig.json @@ -0,0 +1,10 @@ +{ + "compilerOptions": { + "baseUrl": ".", + "types": ["miniprogram-api-typings"], + "paths": { + + }, + "lib": ["ES6"] + } +} \ No newline at end of file diff --git a/weapp/utils/config.js b/weapp/utils/config.js new file mode 100644 index 0000000..7677e86 --- /dev/null +++ b/weapp/utils/config.js @@ -0,0 +1,7 @@ +module.exports = { + AK: "rH3Dz9kfLV0oZtBidprxnb25", + SK: "esnS3c8CpbQxGVmu1wgqSXp4WMDcIG5K", + XAPIKEY: "d8y4XLDphC1W9dtDgt68d9toAi7HXT1P7KCH25b4", + API_KEY:'d8y4XLDphC1W9dtDgt68d9toAi7HXT1P7KCH25b4', + ADMIN_HOST: 'https://lawyertools.cn/admin', +}; \ No newline at end of file diff --git a/weapp/utils/dateUtils.js b/weapp/utils/dateUtils.js new file mode 100644 index 0000000..e8114df --- /dev/null +++ b/weapp/utils/dateUtils.js @@ -0,0 +1,18 @@ +function formatDate(timestamp) { + const date = new Date(timestamp); + const month = date.getMonth() + 1; + const day = date.getDate(); + return `${month}月${day}日`; +} + +function formatTime(timestamp) { + const date = new Date(timestamp); + const hours = date.getHours().toString().padStart(2, '0'); + const minutes = date.getMinutes().toString().padStart(2, '0'); + return `${hours}:${minutes}`; +} + +module.exports = { + formatDate, + formatTime +}; \ No newline at end of file diff --git a/weapp/utils/scheduleListService.js b/weapp/utils/scheduleListService.js new file mode 100644 index 0000000..5b6a838 --- /dev/null +++ b/weapp/utils/scheduleListService.js @@ -0,0 +1,71 @@ +const { fetchSchedules } = require('./scheduleService'); +const { formatDate, formatTime } = require('./dateUtils'); + +const loadSchedules = async (isHistoryView) => { + try { + const schedules = await fetchSchedules(isHistoryView ? 'done' : 'pending'); + const formattedSchedules = schedules.map(schedule => ({ + ...schedule, + dateStr: formatDate(schedule.startTime), + timeStr: formatTime(schedule.startTime) + })); + return isHistoryView + ? groupSchedulesByYear(formattedSchedules) + : groupSchedulesByTime(formattedSchedules); + } catch (error) { + console.error('loadSchedules failed:', error); + throw error; + } +}; + +const groupSchedulesByTime = (schedules) => { + const now = new Date().getTime(); + const oneWeek = 7 * 24 * 60 * 60 * 1000; + const oneMonth = 30 * 24 * 60 * 60 * 1000; + const threeMonths = 90 * 24 * 60 * 60 * 1000; + + const timeSections = [ + { title: '近一周', schedules: [] }, + { title: '近一个月', schedules: [] }, + { title: '近三个月', schedules: [] }, + { title: '未来', schedules: [] } + ]; + + schedules.forEach(schedule => { + const timeFrom = new Date(schedule.startTime).getTime(); + if (timeFrom - now <= oneWeek) { + timeSections[0].schedules.push(schedule); + } else if (timeFrom - now <= oneMonth) { + timeSections[1].schedules.push(schedule); + } else if (timeFrom - now <= threeMonths) { + timeSections[2].schedules.push(schedule); + } else { + timeSections[3].schedules.push(schedule); + } + }); + + return timeSections; +}; + +const groupSchedulesByYear = (schedules) => { + const yearSections = {}; + + schedules.forEach(schedule => { + const year = new Date(schedule.startTime).getFullYear(); + if (!yearSections[year]) { + yearSections[year] = []; + } + yearSections[year].push(schedule); + }); + + return Object.entries(yearSections).map(([year, schedules]) => ({ + title: `${year}年`, + schedules: schedules + })).sort((a, b) => parseInt(b.title) - parseInt(a.title)); +}; + +module.exports = { + loadSchedules, + groupSchedulesByTime, + groupSchedulesByYear +}; diff --git a/weapp/utils/scheduleService.js b/weapp/utils/scheduleService.js new file mode 100644 index 0000000..972e682 --- /dev/null +++ b/weapp/utils/scheduleService.js @@ -0,0 +1,176 @@ +const md5 = require('blueimp-md5'); +const config = require('./config'); +const app = getApp(); + +const fetchSchedules = (tabActive) => { + return new Promise((resolve, reject) => { + wx.showLoading({ + title: '加载中...', + mask: false // Set mask to true to prevent user interaction during loading + }); + + const now = new Date().getTime(); + let timeFrom = now, timeTo = now; + const tenYearMills = 10 * 365 * 24 * 60 * 60 * 1000; + + if (tabActive === 'pending') { + timeTo = now + tenYearMills; + } else if (tabActive === 'done') { + timeFrom = now - tenYearMills; + } + + wx.request({ + url: `${app.globalData.ADMIN_HOST}/schedules`, + header: { + 'x-api-key': app.globalData.API_KEY + }, + data: { + openid: app.globalData.openid, + timeFrom: timeFrom, + timeTo: timeTo + }, + success: (res) => { + const scheduleList = res.data; + if (tabActive === 'pending') { + scheduleList.sort((a, b) => a.startTime - b.startTime); + } + scheduleList.forEach(item => { + item.time = formatDate(item.startTime); + }); + wx.hideLoading(); + resolve(scheduleList); + }, + fail: (res) => { + wx.hideLoading(); + wx.showToast({ + title: res.errMsg, + icon: 'none' + }); + reject(res); + } + }); + }); +}; + +const formatDate = (startTime) => { + const date = new Date(startTime); + const year = date.getFullYear(); + const month = (date.getMonth() + 1).toString().padStart(2, '0'); + const day = date.getDate().toString().padStart(2, '0'); + const week = ['日', '一', '二', '三', '四', '五', '六'][date.getDay()]; + const hours = date.getHours().toString().padStart(2, '0'); + const minutes = date.getMinutes().toString().padStart(2, '0'); + const timeStr = `${year}年${month}月${day}日 星期${week} ${hours}:${minutes}`; + return timeStr; +}; + +const groupSchedulesByTime = (schedules) => { + const now = new Date().getTime(); + const oneWeek = 7 * 24 * 60 * 60 * 1000; + const oneMonth = 30 * 24 * 60 * 60 * 1000; + const threeMonths = 90 * 24 * 60 * 60 * 1000; + + const timeSections = [ + { title: '近一周', schedules: [] }, + { title: '近一个月', schedules: [] }, + { title: '近三个月', schedules: [] }, + { title: '未来', schedules: [] } + ]; + + schedules.forEach(schedule => { + const timeFrom = new Date(schedule.startTime).getTime(); + if (timeFrom - now <= oneWeek) { + timeSections[0].schedules.push(schedule); + } else if (timeFrom - now <= oneMonth) { + timeSections[1].schedules.push(schedule); + } else if (timeFrom - now <= threeMonths) { + timeSections[2].schedules.push(schedule); + } else { + timeSections[3].schedules.push(schedule); + } + }); + + return timeSections; +}; + +const recognizeSchedule = (text, fromCache = true) => { + console.log('recognizeSchedule called with:', text, fromCache); + const md5Value = md5(text); + + const fetchDataFromServer = () => new Promise((resolve, reject) => { + wx.request({ + url: `${config.ADMIN_HOST}/help_remember`, + method: 'POST', + header: { + 'x-api-key': config.API_KEY, + 'Content-Type': 'application/json' + }, + data: { + 'text': text + }, + success: (resp) => { + const scheduleInfo = {}; + const respData = resp.data; + scheduleInfo.title = respData.title; + const timeFrom = respData.dateTimeFrom; + scheduleInfo.startTimeStr = timeFrom; + scheduleInfo.startTime = respData.timestampFrom; + scheduleInfo.description = respData.description; + scheduleInfo.location = respData.location; + // Set alarmOffset based on the start time + const now = new Date().getTime(); + const startTime = new Date(respData.timestampFrom).getTime(); + const timeDiff = startTime - now; + + if (timeDiff <= 15 * 60 * 1000) { // Within 15 minutes + scheduleInfo.alarmOffset = 0; // Remind at event time + } else if (timeDiff <= 60 * 60 * 1000) { // Within 1 hour + scheduleInfo.alarmOffset = 900; // 15 minutes before + } else if (timeDiff <= 24 * 60 * 60 * 1000) { // Within 1 day + scheduleInfo.alarmOffset = 3600; // 1 hour before + } else if (timeDiff <= 7 * 24 * 60 * 60 * 1000) { // Within 1 week + scheduleInfo.alarmOffset = 86400; // 1 day before + } else { + scheduleInfo.alarmOffset = 604800; // 1 week before + } + + if (timeFrom && scheduleInfo.title && scheduleInfo.title !== "") { + wx.setStorageSync(md5Value, scheduleInfo); + resolve(scheduleInfo); + } else { + reject(new Error("未识别到日程,请重试或更换内容")); + } + }, + fail: (err) => { + reject(new Error(err.errMsg)); + } + }); + }); + + if (!fromCache) { + return fetchDataFromServer(); + } + + return new Promise((resolve, reject) => { + wx.getStorage({ + key: md5Value, + success: res => { + console.log("从storage中获取:" + JSON.stringify(res.data)); + res.data["isCache"] = true; + resolve(res.data); + }, + fail: () => { + fetchDataFromServer().then(res => { + res["isCache"] = false; + resolve(res); + }).catch(err => reject(err)); + } + }); + }); +}; + +module.exports = { + fetchSchedules, + groupSchedulesByTime, + recognizeSchedule +}; diff --git a/weapp/utils/sha256.js b/weapp/utils/sha256.js new file mode 100644 index 0000000..14bcf45 --- /dev/null +++ b/weapp/utils/sha256.js @@ -0,0 +1,518 @@ +/** + * [js-sha256]{@link https://github.com/emn178/js-sha256} + * + * @version 0.9.0 + * @author Chen, Yi-Cyuan [emn178@gmail.com] + * @copyright Chen, Yi-Cyuan 2014-2017 + * @license MIT + */ +/*jslint bitwise: true */ +(function () { + 'use strict'; + + var ERROR = 'input is invalid type'; + var WINDOW = typeof window === 'object'; + var root = WINDOW ? window : {}; + if (root.JS_SHA256_NO_WINDOW) { + WINDOW = false; + } + var WEB_WORKER = !WINDOW && typeof self === 'object'; + var NODE_JS = !root.JS_SHA256_NO_NODE_JS && typeof process === 'object' && process.versions && process.versions.node; + if (NODE_JS) { + root = global; + } else if (WEB_WORKER) { + root = self; + } + var COMMON_JS = !root.JS_SHA256_NO_COMMON_JS && typeof module === 'object' && module.exports; + var AMD = typeof define === 'function' && define.amd; + var ARRAY_BUFFER = !root.JS_SHA256_NO_ARRAY_BUFFER && typeof ArrayBuffer !== 'undefined'; + var HEX_CHARS = '0123456789abcdef'.split(''); + var EXTRA = [-2147483648, 8388608, 32768, 128]; + var SHIFT = [24, 16, 8, 0]; + var K = [ + 0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5, 0x3956c25b, 0x59f111f1, 0x923f82a4, 0xab1c5ed5, + 0xd807aa98, 0x12835b01, 0x243185be, 0x550c7dc3, 0x72be5d74, 0x80deb1fe, 0x9bdc06a7, 0xc19bf174, + 0xe49b69c1, 0xefbe4786, 0x0fc19dc6, 0x240ca1cc, 0x2de92c6f, 0x4a7484aa, 0x5cb0a9dc, 0x76f988da, + 0x983e5152, 0xa831c66d, 0xb00327c8, 0xbf597fc7, 0xc6e00bf3, 0xd5a79147, 0x06ca6351, 0x14292967, + 0x27b70a85, 0x2e1b2138, 0x4d2c6dfc, 0x53380d13, 0x650a7354, 0x766a0abb, 0x81c2c92e, 0x92722c85, + 0xa2bfe8a1, 0xa81a664b, 0xc24b8b70, 0xc76c51a3, 0xd192e819, 0xd6990624, 0xf40e3585, 0x106aa070, + 0x19a4c116, 0x1e376c08, 0x2748774c, 0x34b0bcb5, 0x391c0cb3, 0x4ed8aa4a, 0x5b9cca4f, 0x682e6ff3, + 0x748f82ee, 0x78a5636f, 0x84c87814, 0x8cc70208, 0x90befffa, 0xa4506ceb, 0xbef9a3f7, 0xc67178f2 + ]; + var OUTPUT_TYPES = ['hex', 'array', 'digest', 'arrayBuffer']; + + var blocks = []; + + if (root.JS_SHA256_NO_NODE_JS || !Array.isArray) { + Array.isArray = function (obj) { + return Object.prototype.toString.call(obj) === '[object Array]'; + }; + } + + if (ARRAY_BUFFER && (root.JS_SHA256_NO_ARRAY_BUFFER_IS_VIEW || !ArrayBuffer.isView)) { + ArrayBuffer.isView = function (obj) { + return typeof obj === 'object' && obj.buffer && obj.buffer.constructor === ArrayBuffer; + }; + } + + var createOutputMethod = function (outputType, is224) { + return function (message) { + return new Sha256(is224, true).update(message)[outputType](); + }; + }; + + var createMethod = function (is224) { + var method = createOutputMethod('hex', is224); + if (NODE_JS) { + method = nodeWrap(method, is224); + } + method.create = function () { + return new Sha256(is224); + }; + method.update = function (message) { + return method.create().update(message); + }; + for (var i = 0; i < OUTPUT_TYPES.length; ++i) { + var type = OUTPUT_TYPES[i]; + method[type] = createOutputMethod(type, is224); + } + return method; + }; + + var nodeWrap = function (method, is224) { + var crypto = eval("require('crypto')"); + var Buffer = eval("require('buffer').Buffer"); + var algorithm = is224 ? 'sha224' : 'sha256'; + var nodeMethod = function (message) { + if (typeof message === 'string') { + return crypto.createHash(algorithm).update(message, 'utf8').digest('hex'); + } else { + if (message === null || message === undefined) { + throw new Error(ERROR); + } else if (message.constructor === ArrayBuffer) { + message = new Uint8Array(message); + } + } + if (Array.isArray(message) || ArrayBuffer.isView(message) || + message.constructor === Buffer) { + return crypto.createHash(algorithm).update(new Buffer(message)).digest('hex'); + } else { + return method(message); + } + }; + return nodeMethod; + }; + + var createHmacOutputMethod = function (outputType, is224) { + return function (key, message) { + return new HmacSha256(key, is224, true).update(message)[outputType](); + }; + }; + + var createHmacMethod = function (is224) { + var method = createHmacOutputMethod('hex', is224); + method.create = function (key) { + return new HmacSha256(key, is224); + }; + method.update = function (key, message) { + return method.create(key).update(message); + }; + for (var i = 0; i < OUTPUT_TYPES.length; ++i) { + var type = OUTPUT_TYPES[i]; + method[type] = createHmacOutputMethod(type, is224); + } + return method; + }; + + function Sha256(is224, sharedMemory) { + if (sharedMemory) { + blocks[0] = blocks[16] = blocks[1] = blocks[2] = blocks[3] = + blocks[4] = blocks[5] = blocks[6] = blocks[7] = + blocks[8] = blocks[9] = blocks[10] = blocks[11] = + blocks[12] = blocks[13] = blocks[14] = blocks[15] = 0; + this.blocks = blocks; + } else { + this.blocks = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]; + } + + if (is224) { + this.h0 = 0xc1059ed8; + this.h1 = 0x367cd507; + this.h2 = 0x3070dd17; + this.h3 = 0xf70e5939; + this.h4 = 0xffc00b31; + this.h5 = 0x68581511; + this.h6 = 0x64f98fa7; + this.h7 = 0xbefa4fa4; + } else { // 256 + this.h0 = 0x6a09e667; + this.h1 = 0xbb67ae85; + this.h2 = 0x3c6ef372; + this.h3 = 0xa54ff53a; + this.h4 = 0x510e527f; + this.h5 = 0x9b05688c; + this.h6 = 0x1f83d9ab; + this.h7 = 0x5be0cd19; + } + + this.block = this.start = this.bytes = this.hBytes = 0; + this.finalized = this.hashed = false; + this.first = true; + this.is224 = is224; + } + + Sha256.prototype.update = function (message) { + if (this.finalized) { + return; + } + var notString, type = typeof message; + if (type !== 'string') { + if (type === 'object') { + if (message === null) { + throw new Error(ERROR); + } else if (ARRAY_BUFFER && message.constructor === ArrayBuffer) { + message = new Uint8Array(message); + } else if (!Array.isArray(message)) { + if (!ARRAY_BUFFER || !ArrayBuffer.isView(message)) { + throw new Error(ERROR); + } + } + } else { + throw new Error(ERROR); + } + notString = true; + } + var code, index = 0, i, length = message.length, blocks = this.blocks; + + while (index < length) { + if (this.hashed) { + this.hashed = false; + blocks[0] = this.block; + blocks[16] = blocks[1] = blocks[2] = blocks[3] = + blocks[4] = blocks[5] = blocks[6] = blocks[7] = + blocks[8] = blocks[9] = blocks[10] = blocks[11] = + blocks[12] = blocks[13] = blocks[14] = blocks[15] = 0; + } + + if (notString) { + for (i = this.start; index < length && i < 64; ++index) { + blocks[i >> 2] |= message[index] << SHIFT[i++ & 3]; + } + } else { + for (i = this.start; index < length && i < 64; ++index) { + code = message.charCodeAt(index); + if (code < 0x80) { + blocks[i >> 2] |= code << SHIFT[i++ & 3]; + } else if (code < 0x800) { + blocks[i >> 2] |= (0xc0 | (code >> 6)) << SHIFT[i++ & 3]; + blocks[i >> 2] |= (0x80 | (code & 0x3f)) << SHIFT[i++ & 3]; + } else if (code < 0xd800 || code >= 0xe000) { + blocks[i >> 2] |= (0xe0 | (code >> 12)) << SHIFT[i++ & 3]; + blocks[i >> 2] |= (0x80 | ((code >> 6) & 0x3f)) << SHIFT[i++ & 3]; + blocks[i >> 2] |= (0x80 | (code & 0x3f)) << SHIFT[i++ & 3]; + } else { + code = 0x10000 + (((code & 0x3ff) << 10) | (message.charCodeAt(++index) & 0x3ff)); + blocks[i >> 2] |= (0xf0 | (code >> 18)) << SHIFT[i++ & 3]; + blocks[i >> 2] |= (0x80 | ((code >> 12) & 0x3f)) << SHIFT[i++ & 3]; + blocks[i >> 2] |= (0x80 | ((code >> 6) & 0x3f)) << SHIFT[i++ & 3]; + blocks[i >> 2] |= (0x80 | (code & 0x3f)) << SHIFT[i++ & 3]; + } + } + } + + this.lastByteIndex = i; + this.bytes += i - this.start; + if (i >= 64) { + this.block = blocks[16]; + this.start = i - 64; + this.hash(); + this.hashed = true; + } else { + this.start = i; + } + } + if (this.bytes > 4294967295) { + this.hBytes += this.bytes / 4294967296 << 0; + this.bytes = this.bytes % 4294967296; + } + return this; + }; + + Sha256.prototype.finalize = function () { + if (this.finalized) { + return; + } + this.finalized = true; + var blocks = this.blocks, i = this.lastByteIndex; + blocks[16] = this.block; + blocks[i >> 2] |= EXTRA[i & 3]; + this.block = blocks[16]; + if (i >= 56) { + if (!this.hashed) { + this.hash(); + } + blocks[0] = this.block; + blocks[16] = blocks[1] = blocks[2] = blocks[3] = + blocks[4] = blocks[5] = blocks[6] = blocks[7] = + blocks[8] = blocks[9] = blocks[10] = blocks[11] = + blocks[12] = blocks[13] = blocks[14] = blocks[15] = 0; + } + blocks[14] = this.hBytes << 3 | this.bytes >>> 29; + blocks[15] = this.bytes << 3; + this.hash(); + }; + + Sha256.prototype.hash = function () { + var a = this.h0, b = this.h1, c = this.h2, d = this.h3, e = this.h4, f = this.h5, g = this.h6, + h = this.h7, blocks = this.blocks, j, s0, s1, maj, t1, t2, ch, ab, da, cd, bc; + + for (j = 16; j < 64; ++j) { + // rightrotate + t1 = blocks[j - 15]; + s0 = ((t1 >>> 7) | (t1 << 25)) ^ ((t1 >>> 18) | (t1 << 14)) ^ (t1 >>> 3); + t1 = blocks[j - 2]; + s1 = ((t1 >>> 17) | (t1 << 15)) ^ ((t1 >>> 19) | (t1 << 13)) ^ (t1 >>> 10); + blocks[j] = blocks[j - 16] + s0 + blocks[j - 7] + s1 << 0; + } + + bc = b & c; + for (j = 0; j < 64; j += 4) { + if (this.first) { + if (this.is224) { + ab = 300032; + t1 = blocks[0] - 1413257819; + h = t1 - 150054599 << 0; + d = t1 + 24177077 << 0; + } else { + ab = 704751109; + t1 = blocks[0] - 210244248; + h = t1 - 1521486534 << 0; + d = t1 + 143694565 << 0; + } + this.first = false; + } else { + s0 = ((a >>> 2) | (a << 30)) ^ ((a >>> 13) | (a << 19)) ^ ((a >>> 22) | (a << 10)); + s1 = ((e >>> 6) | (e << 26)) ^ ((e >>> 11) | (e << 21)) ^ ((e >>> 25) | (e << 7)); + ab = a & b; + maj = ab ^ (a & c) ^ bc; + ch = (e & f) ^ (~e & g); + t1 = h + s1 + ch + K[j] + blocks[j]; + t2 = s0 + maj; + h = d + t1 << 0; + d = t1 + t2 << 0; + } + s0 = ((d >>> 2) | (d << 30)) ^ ((d >>> 13) | (d << 19)) ^ ((d >>> 22) | (d << 10)); + s1 = ((h >>> 6) | (h << 26)) ^ ((h >>> 11) | (h << 21)) ^ ((h >>> 25) | (h << 7)); + da = d & a; + maj = da ^ (d & b) ^ ab; + ch = (h & e) ^ (~h & f); + t1 = g + s1 + ch + K[j + 1] + blocks[j + 1]; + t2 = s0 + maj; + g = c + t1 << 0; + c = t1 + t2 << 0; + s0 = ((c >>> 2) | (c << 30)) ^ ((c >>> 13) | (c << 19)) ^ ((c >>> 22) | (c << 10)); + s1 = ((g >>> 6) | (g << 26)) ^ ((g >>> 11) | (g << 21)) ^ ((g >>> 25) | (g << 7)); + cd = c & d; + maj = cd ^ (c & a) ^ da; + ch = (g & h) ^ (~g & e); + t1 = f + s1 + ch + K[j + 2] + blocks[j + 2]; + t2 = s0 + maj; + f = b + t1 << 0; + b = t1 + t2 << 0; + s0 = ((b >>> 2) | (b << 30)) ^ ((b >>> 13) | (b << 19)) ^ ((b >>> 22) | (b << 10)); + s1 = ((f >>> 6) | (f << 26)) ^ ((f >>> 11) | (f << 21)) ^ ((f >>> 25) | (f << 7)); + bc = b & c; + maj = bc ^ (b & d) ^ cd; + ch = (f & g) ^ (~f & h); + t1 = e + s1 + ch + K[j + 3] + blocks[j + 3]; + t2 = s0 + maj; + e = a + t1 << 0; + a = t1 + t2 << 0; + } + + this.h0 = this.h0 + a << 0; + this.h1 = this.h1 + b << 0; + this.h2 = this.h2 + c << 0; + this.h3 = this.h3 + d << 0; + this.h4 = this.h4 + e << 0; + this.h5 = this.h5 + f << 0; + this.h6 = this.h6 + g << 0; + this.h7 = this.h7 + h << 0; + }; + + Sha256.prototype.hex = function () { + this.finalize(); + + var h0 = this.h0, h1 = this.h1, h2 = this.h2, h3 = this.h3, h4 = this.h4, h5 = this.h5, + h6 = this.h6, h7 = this.h7; + + var hex = HEX_CHARS[(h0 >> 28) & 0x0F] + HEX_CHARS[(h0 >> 24) & 0x0F] + + HEX_CHARS[(h0 >> 20) & 0x0F] + HEX_CHARS[(h0 >> 16) & 0x0F] + + HEX_CHARS[(h0 >> 12) & 0x0F] + HEX_CHARS[(h0 >> 8) & 0x0F] + + HEX_CHARS[(h0 >> 4) & 0x0F] + HEX_CHARS[h0 & 0x0F] + + HEX_CHARS[(h1 >> 28) & 0x0F] + HEX_CHARS[(h1 >> 24) & 0x0F] + + HEX_CHARS[(h1 >> 20) & 0x0F] + HEX_CHARS[(h1 >> 16) & 0x0F] + + HEX_CHARS[(h1 >> 12) & 0x0F] + HEX_CHARS[(h1 >> 8) & 0x0F] + + HEX_CHARS[(h1 >> 4) & 0x0F] + HEX_CHARS[h1 & 0x0F] + + HEX_CHARS[(h2 >> 28) & 0x0F] + HEX_CHARS[(h2 >> 24) & 0x0F] + + HEX_CHARS[(h2 >> 20) & 0x0F] + HEX_CHARS[(h2 >> 16) & 0x0F] + + HEX_CHARS[(h2 >> 12) & 0x0F] + HEX_CHARS[(h2 >> 8) & 0x0F] + + HEX_CHARS[(h2 >> 4) & 0x0F] + HEX_CHARS[h2 & 0x0F] + + HEX_CHARS[(h3 >> 28) & 0x0F] + HEX_CHARS[(h3 >> 24) & 0x0F] + + HEX_CHARS[(h3 >> 20) & 0x0F] + HEX_CHARS[(h3 >> 16) & 0x0F] + + HEX_CHARS[(h3 >> 12) & 0x0F] + HEX_CHARS[(h3 >> 8) & 0x0F] + + HEX_CHARS[(h3 >> 4) & 0x0F] + HEX_CHARS[h3 & 0x0F] + + HEX_CHARS[(h4 >> 28) & 0x0F] + HEX_CHARS[(h4 >> 24) & 0x0F] + + HEX_CHARS[(h4 >> 20) & 0x0F] + HEX_CHARS[(h4 >> 16) & 0x0F] + + HEX_CHARS[(h4 >> 12) & 0x0F] + HEX_CHARS[(h4 >> 8) & 0x0F] + + HEX_CHARS[(h4 >> 4) & 0x0F] + HEX_CHARS[h4 & 0x0F] + + HEX_CHARS[(h5 >> 28) & 0x0F] + HEX_CHARS[(h5 >> 24) & 0x0F] + + HEX_CHARS[(h5 >> 20) & 0x0F] + HEX_CHARS[(h5 >> 16) & 0x0F] + + HEX_CHARS[(h5 >> 12) & 0x0F] + HEX_CHARS[(h5 >> 8) & 0x0F] + + HEX_CHARS[(h5 >> 4) & 0x0F] + HEX_CHARS[h5 & 0x0F] + + HEX_CHARS[(h6 >> 28) & 0x0F] + HEX_CHARS[(h6 >> 24) & 0x0F] + + HEX_CHARS[(h6 >> 20) & 0x0F] + HEX_CHARS[(h6 >> 16) & 0x0F] + + HEX_CHARS[(h6 >> 12) & 0x0F] + HEX_CHARS[(h6 >> 8) & 0x0F] + + HEX_CHARS[(h6 >> 4) & 0x0F] + HEX_CHARS[h6 & 0x0F]; + if (!this.is224) { + hex += HEX_CHARS[(h7 >> 28) & 0x0F] + HEX_CHARS[(h7 >> 24) & 0x0F] + + HEX_CHARS[(h7 >> 20) & 0x0F] + HEX_CHARS[(h7 >> 16) & 0x0F] + + HEX_CHARS[(h7 >> 12) & 0x0F] + HEX_CHARS[(h7 >> 8) & 0x0F] + + HEX_CHARS[(h7 >> 4) & 0x0F] + HEX_CHARS[h7 & 0x0F]; + } + return hex; + }; + + Sha256.prototype.toString = Sha256.prototype.hex; + + Sha256.prototype.digest = function () { + this.finalize(); + + var h0 = this.h0, h1 = this.h1, h2 = this.h2, h3 = this.h3, h4 = this.h4, h5 = this.h5, + h6 = this.h6, h7 = this.h7; + + var arr = [ + (h0 >> 24) & 0xFF, (h0 >> 16) & 0xFF, (h0 >> 8) & 0xFF, h0 & 0xFF, + (h1 >> 24) & 0xFF, (h1 >> 16) & 0xFF, (h1 >> 8) & 0xFF, h1 & 0xFF, + (h2 >> 24) & 0xFF, (h2 >> 16) & 0xFF, (h2 >> 8) & 0xFF, h2 & 0xFF, + (h3 >> 24) & 0xFF, (h3 >> 16) & 0xFF, (h3 >> 8) & 0xFF, h3 & 0xFF, + (h4 >> 24) & 0xFF, (h4 >> 16) & 0xFF, (h4 >> 8) & 0xFF, h4 & 0xFF, + (h5 >> 24) & 0xFF, (h5 >> 16) & 0xFF, (h5 >> 8) & 0xFF, h5 & 0xFF, + (h6 >> 24) & 0xFF, (h6 >> 16) & 0xFF, (h6 >> 8) & 0xFF, h6 & 0xFF + ]; + if (!this.is224) { + arr.push((h7 >> 24) & 0xFF, (h7 >> 16) & 0xFF, (h7 >> 8) & 0xFF, h7 & 0xFF); + } + return arr; + }; + + Sha256.prototype.array = Sha256.prototype.digest; + + Sha256.prototype.arrayBuffer = function () { + this.finalize(); + + var buffer = new ArrayBuffer(this.is224 ? 28 : 32); + var dataView = new DataView(buffer); + dataView.setUint32(0, this.h0); + dataView.setUint32(4, this.h1); + dataView.setUint32(8, this.h2); + dataView.setUint32(12, this.h3); + dataView.setUint32(16, this.h4); + dataView.setUint32(20, this.h5); + dataView.setUint32(24, this.h6); + if (!this.is224) { + dataView.setUint32(28, this.h7); + } + return buffer; + }; + + function HmacSha256(key, is224, sharedMemory) { + var i, type = typeof key; + if (type === 'string') { + var bytes = [], length = key.length, index = 0, code; + for (i = 0; i < length; ++i) { + code = key.charCodeAt(i); + if (code < 0x80) { + bytes[index++] = code; + } else if (code < 0x800) { + bytes[index++] = (0xc0 | (code >> 6)); + bytes[index++] = (0x80 | (code & 0x3f)); + } else if (code < 0xd800 || code >= 0xe000) { + bytes[index++] = (0xe0 | (code >> 12)); + bytes[index++] = (0x80 | ((code >> 6) & 0x3f)); + bytes[index++] = (0x80 | (code & 0x3f)); + } else { + code = 0x10000 + (((code & 0x3ff) << 10) | (key.charCodeAt(++i) & 0x3ff)); + bytes[index++] = (0xf0 | (code >> 18)); + bytes[index++] = (0x80 | ((code >> 12) & 0x3f)); + bytes[index++] = (0x80 | ((code >> 6) & 0x3f)); + bytes[index++] = (0x80 | (code & 0x3f)); + } + } + key = bytes; + } else { + if (type === 'object') { + if (key === null) { + throw new Error(ERROR); + } else if (ARRAY_BUFFER && key.constructor === ArrayBuffer) { + key = new Uint8Array(key); + } else if (!Array.isArray(key)) { + if (!ARRAY_BUFFER || !ArrayBuffer.isView(key)) { + throw new Error(ERROR); + } + } + } else { + throw new Error(ERROR); + } + } + + if (key.length > 64) { + key = (new Sha256(is224, true)).update(key).array(); + } + + var oKeyPad = [], iKeyPad = []; + for (i = 0; i < 64; ++i) { + var b = key[i] || 0; + oKeyPad[i] = 0x5c ^ b; + iKeyPad[i] = 0x36 ^ b; + } + + Sha256.call(this, is224, sharedMemory); + + this.update(iKeyPad); + this.oKeyPad = oKeyPad; + this.inner = true; + this.sharedMemory = sharedMemory; + } + HmacSha256.prototype = new Sha256(); + + HmacSha256.prototype.finalize = function () { + Sha256.prototype.finalize.call(this); + if (this.inner) { + this.inner = false; + var innerHash = this.array(); + Sha256.call(this, this.is224, this.sharedMemory); + this.update(this.oKeyPad); + this.update(innerHash); + Sha256.prototype.finalize.call(this); + } + }; + + var exports = createMethod(); + exports.sha256 = exports; + exports.sha224 = createMethod(true); + exports.sha256.hmac = createHmacMethod(); + exports.sha224.hmac = createHmacMethod(true); + + if (COMMON_JS) { + module.exports = exports; + } else { + root.sha256 = exports.sha256; + root.sha224 = exports.sha224; + if (AMD) { + define(function () { + return exports; + }); + } + } +})(); diff --git a/weapp/utils/utils.js b/weapp/utils/utils.js new file mode 100644 index 0000000..2f73bad --- /dev/null +++ b/weapp/utils/utils.js @@ -0,0 +1,57 @@ +// utils.js +const md5 = require('blueimp-md5'); + +const base64 = (file) => new Promise((resolve, reject) => { + wx.getFileSystemManager().readFile({ + filePath: file, + encoding: 'base64', + success: (res) => resolve(res.data), + fail: reject + }); +}); + +// 新增的 OCR 方法 +const ocr = async (type, file_base64, access_token) => { + const fetchDataFromServer = () => new Promise((resolve, reject) => { + wx.request({ + method: 'POST', + url: `https://aip.baidubce.com/rest/2.0/ocr/v1/general_basic?access_token=${access_token}`, + header: { + 'Content-Type': 'application/x-www-form-urlencoded', + 'Accept': 'application/json' + }, + data: { + [type]: file_base64 + }, + success: (res) => { + console.log("识别结果:" + JSON.stringify(res.data)); + resolve(res.data); + }, + fail: reject + }); + }); + + const md5Value = md5(file_base64); + + return new Promise((resolve, reject) => { + wx.getStorage({ + key: md5Value, + success: res => resolve(res.data), + fail: () => { + fetchDataFromServer().then((fetchedData) => { + wx.setStorage({ + key: md5Value, + data: fetchedData + }); + return resolve(fetchedData); + }).catch(reject); + } + }); + }); +}; + +module.exports = { + md5, + base64, + ocr +};