Compare commits
8 Commits
main
...
feat-color
Author | SHA1 | Date | |
---|---|---|---|
5c26420d8f | |||
6c43ef111a | |||
f2d6c66ebd | |||
979ef57e36 | |||
59e7742132 | |||
4997496d9c | |||
e10eec01be | |||
|
9fd672b356 |
21
LICENSE
@ -1,21 +0,0 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2022 程序员小墨
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
40
README.md
@ -1,41 +1,5 @@
|
||||
# 通信行程卡纪念版 H5
|
||||
|
||||
> **关于网传微信小程序涉嫌违规相关资讯与本项目无关,且不存在相互抄袭,[点击查看特别说明](https://www.bilibili.com/read/cv20610303)。**
|
||||
|
||||
仓库地址:[GitHub](https://github.com/coder-xiaomo/travel-card) [Gitee](https://gitee.com/coder-xiaomo/travel-card)
|
||||
|
||||
演示地址:https://coder-xiaomo.gitee.io/travel-card/
|
||||
|
||||
<div align=center><img src="docs/Screenshot.jpg" width="300px" /></div>
|
||||
|
||||
|
||||
|
||||
## 更多版本
|
||||
|
||||
感谢大家提的Pr,由于功能差异无法合并到同一分支,所以合并到不同分支中了,大家可以前往以下分支查看:
|
||||
|
||||
### [feat-color](https://gitee.com/coder-xiaomo/travel-card/tree/feat-color/): 黄、红卡及彩蛋卡版
|
||||
|
||||
> [@小林囝](https://gitee.com/teochew)提交的[Pull Request](https://gitee.com/coder-xiaomo/travel-card/pulls/1)
|
||||
|
||||
**演示地址:https://coder-xiaomo.gitee.io/travel-card/feat-color**
|
||||
|
||||
<div align=center><img src="docs/Screenshot-feat-color.jpg" width="300px" /></div>
|
||||
|
||||
|
||||
|
||||
### [feat-optimize](https://gitee.com/coder-xiaomo/travel-card/tree/feat-optimize/): 优化页面结构,更像原版,添加标题字体等
|
||||
|
||||
> [@呱行次比猫](https://space.bilibili.com/38238808)提交的[Pull Request](https://gitee.com/coder-xiaomo/travel-card/pulls/3)
|
||||
|
||||
**演示地址:https://coder-xiaomo.gitee.io/travel-card/feat-optimize**
|
||||
|
||||
<div align=center><img src="docs/Screenshot-feat-optimize.jpg" width="300px" /></div>
|
||||
|
||||
|
||||
|
||||
## 一些说明
|
||||
# 通信行程卡 之 黄、红卡及彩蛋卡版
|
||||
|
||||
**注意:本项目仅作纪念,无实际意义,不得用于防疫等相关场景**
|
||||
|
||||
欢迎关注我的[B站](https://space.bilibili.com/457109942)和公众号(ID:程序员小墨)
|
||||
本项目由 程序员小墨 制作并开源,当前分支由[@小林囝](https://gitee.com/teochew)基于 main 分支修改而来
|
||||
|
BIN
assets/image/birthday-compressed.png
Normal file
After Width: | Height: | Size: 26 KiB |
BIN
assets/image/birthday.png
Normal file
After Width: | Height: | Size: 26 KiB |
BIN
assets/image/no-compressed.png
Normal file
After Width: | Height: | Size: 24 KiB |
BIN
assets/image/no.png
Normal file
After Width: | Height: | Size: 69 KiB |
BIN
assets/image/red-compressed.png
Normal file
After Width: | Height: | Size: 48 KiB |
BIN
assets/image/red.png
Normal file
After Width: | Height: | Size: 124 KiB |
BIN
assets/image/yellow-compressed.png
Normal file
After Width: | Height: | Size: 14 KiB |
BIN
assets/image/yellow.png
Normal file
After Width: | Height: | Size: 38 KiB |
Before Width: | Height: | Size: 86 KiB |
Before Width: | Height: | Size: 85 KiB |
Before Width: | Height: | Size: 118 KiB |
121
index.html
@ -4,7 +4,7 @@
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="theme-color" content="#00A961">
|
||||
<meta name="theme-color" content="#00A961" id="metaThemeColor">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>通信行程卡 - 纪念版</title>
|
||||
<link rel="shortcut icon" href="./assets/image/arrow-compressed.png" type="image/x-icon">
|
||||
@ -165,6 +165,30 @@
|
||||
.setting-input input {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.yellow {
|
||||
background-color: #f7ba00;
|
||||
}
|
||||
|
||||
.red,
|
||||
.no {
|
||||
background-color: #e43b00;
|
||||
}
|
||||
|
||||
.text-green {
|
||||
color: #00A766;
|
||||
background-color: #CFEEDF;
|
||||
}
|
||||
|
||||
.text-red {
|
||||
color: #e43b00;
|
||||
background-color: #ffe6dc;
|
||||
}
|
||||
|
||||
.text-yellow {
|
||||
color: #f7ba00;
|
||||
background-color: #fff4d3;
|
||||
}
|
||||
</style>
|
||||
<script src="https://cdn.staticfile.org/vue/3.2.45/vue.global.min.js"></script>
|
||||
<!-- <script src="https://cdn.staticfile.org/vue/3.2.45/vue.global.prod.min.js"></script> -->
|
||||
@ -172,7 +196,7 @@
|
||||
|
||||
<body>
|
||||
<div id="app">
|
||||
<div class="container">
|
||||
<div class="container" :class="cardClass">
|
||||
<div>
|
||||
<!-- 用于占位 -->
|
||||
</div>
|
||||
@ -182,12 +206,11 @@
|
||||
</div>
|
||||
<div class="card">
|
||||
<div>
|
||||
<div style="background-color: #CFEEDF; height: 20px;"></div>
|
||||
<div style="background-color: #CFEEDF;
|
||||
<div :class="`text-${cardClass}`" style=" height: 20px;"></div>
|
||||
<div :class="`text-${cardClass}`" style="
|
||||
height: 40px;
|
||||
position: relative;
|
||||
margin: 0 auto;
|
||||
color: #00A766;
|
||||
border-bottom-left-radius: 24px;
|
||||
border-bottom-right-radius: 24px;
|
||||
top: -20px;
|
||||
@ -195,7 +218,7 @@
|
||||
display: inline-block;
|
||||
padding: 0 40px;
|
||||
letter-spacing: 0.8px;">
|
||||
请收下绿色行程卡
|
||||
请收下{{ cardColor }}色行程卡
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
@ -207,7 +230,7 @@
|
||||
</p>
|
||||
</div>
|
||||
<div style="display: grid; place-items: center;">
|
||||
<img src="./assets/image/arrow-compressed.png" style="width: 45%;" class="animate" />
|
||||
<img :src="cardArrow" style="width: 45%;" class="animate" />
|
||||
</div>
|
||||
<div>
|
||||
<div
|
||||
@ -252,13 +275,22 @@
|
||||
<template v-for="item in setting">
|
||||
<div class="setting-title">{{ item.name }}</div>
|
||||
<div class="setting-input" :style="item.more ? {} : { 'grid-column': 'span 2' }">
|
||||
<textarea v-if="item.textarea" v-model="card[item.key]" :maxlength="item.maxlength"
|
||||
style="width: 100%; resize: none;" rows="3"></textarea>
|
||||
<textarea v-if="item.type == 'textarea'" v-model="card[item.key]"
|
||||
:maxlength="item.maxlength" style="width: 100%; resize: none;"
|
||||
rows="3"></textarea>
|
||||
<div v-else-if="item.type == 'radio'">
|
||||
<select v-model="card[item.key]">
|
||||
<option v-for="radioItem in item.more" :value="radioItem.value"
|
||||
:selected="card[item.key] == radioItem.value">
|
||||
{{radioItem.name}}
|
||||
</option>
|
||||
</select>
|
||||
</div>
|
||||
<input v-else :placeholder="item.name" :maxlength="item.maxlength"
|
||||
v-model="card[item.key]" />
|
||||
</div>
|
||||
<div class="setting-reset" v-if="item.more">
|
||||
<button style="width: 100%;"
|
||||
<button v-if="item.type != 'radio'" style="width: 100%;"
|
||||
@click="card[item.key] = getRandom(item.more, card[item.key])">换一个</button>
|
||||
</div>
|
||||
</template>
|
||||
@ -277,18 +309,9 @@
|
||||
|
||||
<!-- 底部说明 -->
|
||||
<div class="footbar" :class="{ 'footbar-setting': showSetting }">
|
||||
<p :style="showSetting ? {} : { color: '#cfeedf' }">
|
||||
<p :style="showSetting ? {} : { color: '#fffffffa' }">
|
||||
* 本页面仅作纪念,无实际意义,不得用于防疫等相关场景
|
||||
</p>
|
||||
<p v-if="showSetting">
|
||||
本页面由 程序员小墨 制作并开源<br>
|
||||
欢迎关注:
|
||||
<a target="_blank" href="https://space.bilibili.com/457109942">B站</a>
|
||||
<a @click="alert('微信搜索 [程序员小墨] 公众号并关注即可,感谢支持!')">公众号</a>
|
||||
开源地址:
|
||||
<a target="_blank" href="https://github.com/coder-xiaomo/travel-card">GitHub</a>
|
||||
<a target="_blank" href="https://gitee.com/coder-xiaomo/travel-card">Gitee</a>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
@ -301,46 +324,84 @@
|
||||
card: {
|
||||
title: "通信行程卡纪念版",
|
||||
subtitle: "做自己的健康第一责任人",
|
||||
phone: "某某某",
|
||||
phone: "芒小幻",
|
||||
time: "停止于:2022.12.13 00:00:00",
|
||||
timeSpan: "2020 - 2022",
|
||||
location: "湖北省武汉市、湖北省天门市", // ["湖北省武汉市", "湖北省天门市"],
|
||||
type: 0,
|
||||
location: "湖南省长沙市、芒果幻城",
|
||||
},
|
||||
setting: [
|
||||
{
|
||||
key: "title",
|
||||
name: "标题",
|
||||
type: 'input',
|
||||
maxlength: 15,
|
||||
more: ["通信行程卡纪念版", "行程卡纪念版", "通信大数据行程卡纪念版"]
|
||||
},
|
||||
{
|
||||
key: "subtitle",
|
||||
name: "副标题",
|
||||
type: 'input',
|
||||
maxlength: 15,
|
||||
more: ["做自己的健康第一责任人", "回顾行程卡的1034天", "做好疫情防控第一责任人", "疫情防控,人人有责"]
|
||||
},
|
||||
{
|
||||
key: "phone",
|
||||
name: "归属人",
|
||||
type: 'input',
|
||||
maxlength: 15,
|
||||
more: ["2020***2022", "您的姓名", "189****1234", "某某某"]
|
||||
more: ["2020***2022", "您的姓名", "189****1234", "某某某", "芒小幻"]
|
||||
},
|
||||
{
|
||||
key: "time",
|
||||
name: "时间",
|
||||
type: 'input',
|
||||
maxlength: 25,
|
||||
more: ["2020.02.13 - 2022.12.13", "2020年 - 2022年", "停止于:2022.12.13 00:00:00", "更新于:2022.12.13 00:00:00"]
|
||||
},
|
||||
{
|
||||
key: "type",
|
||||
name: "类型",
|
||||
type: 'radio',
|
||||
maxlength: 1,
|
||||
more: [{ name: '绿色', value: 0 }, { name: '黄色', value: 1 }, { name: '红色', value: 2 }, { name: '禁止', value: 3 }, { name: '生日', value: 4 }]
|
||||
},
|
||||
{
|
||||
key: "location",
|
||||
name: "到达地点",
|
||||
type: 'textarea',
|
||||
maxlength: 300,
|
||||
more: null,
|
||||
more: ["芒果幻城", "湖南省长沙市、芒果幻城", "湖北省武汉市", "湖北省武汉市、湖北省天门市"],
|
||||
textarea: true,
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
cardColor() {
|
||||
switch (this.card.type) {
|
||||
case 0: return "绿"
|
||||
case 1: return "黄"
|
||||
default: return "红"
|
||||
}
|
||||
},
|
||||
cardClass() {
|
||||
switch (this.card.type) {
|
||||
case 0: return "green"
|
||||
case 1: return "yellow"
|
||||
default: return "red"
|
||||
}
|
||||
},
|
||||
cardArrow() {
|
||||
switch (this.card.type) {
|
||||
case 1: return './assets/image/yellow-compressed.png'
|
||||
case 2: return './assets/image/red-compressed.png'
|
||||
case 3: return './assets/image/no-compressed.png'
|
||||
case 4: return './assets/image/birthday-compressed.png'
|
||||
default: return './assets/image/arrow-compressed.png'
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
toggleSetting(e) {
|
||||
console.log(e)
|
||||
@ -355,6 +416,18 @@
|
||||
}
|
||||
return returnVal
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.$watch("card.type", (newVal, oldVal) => {
|
||||
// console.log(oldVal, newVal)
|
||||
let newColor = ''
|
||||
switch (newVal) {
|
||||
case 0: newColor = "#00A961"; break;
|
||||
case 1: newColor = "#f7ba00"; break;
|
||||
default: newColor = "#e43b00"; break;
|
||||
}
|
||||
document.getElementById('metaThemeColor').content = newColor
|
||||
});
|
||||
}
|
||||
}).mount('#app')
|
||||
</script>
|
||||
|