This commit is contained in:
539943419 committed 2023-11-11 02:43:03 +08:00
1 parent fac7123cd1
commit 5e90a8b670
7 files changed
+541 -161

No files matched your search

+211
View File
@@ -734,6 +734,36 @@
translate: 0 100%; translate: 0 100%;
background-color: rgba($color: #ffffff, $alpha: 1.0); background-color: rgba($color: #ffffff, $alpha: 1.0);
border-radius: 50rpx; border-radius: 50rpx;
.title{
.page_star{
height: 70rpx;
width: 70rpx;
position: absolute;
display: flex;
align-items: center;
justify-content: center;
// background-color: aquamarine;
top: 50rpx;
right:30rpx;
// font-size: 150rpx;
// font-weight: 900;
// font-family: 'Gill Sans', 'Gill Sans MT', Calibri, 'Trebuchet MS', sans-serif;
}
.page_editRemark{
height: 70rpx;
width: 70rpx;
position: absolute;
display: flex;
align-items: center;
justify-content: center;
// background-color: aquamarine;
top: 50rpx;
right:100rpx;
// font-size: 150rpx;
// font-weight: 900;
// font-family: 'Gill Sans', 'Gill Sans MT', Calibri, 'Trebuchet MS', sans-serif;
}
}
.content{ .content{
position: relative; position: relative;
display: flex; display: flex;
@@ -994,8 +1024,189 @@
} }
} }
} }
//遮罩2
#curtain2{
background-color: rgba(0, 0, 0, 0.19);
// background-color: rgba(0, 0, 0, 0);
height: 100%;
width: 100%;
position: absolute;
top: 0;
left: 0;
opacity: 1;
// transform: ;
}
// 收藏的时候设置备注的输入框
#star_setRemark{
height: 200rpx;
width: 70%;
position: absolute;
top: 30%;
left: 15%;
// overflow: hidden;
translate: 0 1300rpx;
background-color: rgba($color: #ffffff, $alpha: 1.0);
border-radius: 25rpx;
box-shadow: rgba(0, 0, 0, 0.19) 0px 10px 20px, rgba(0, 0, 0, 0.23) 0px 6px 6px;
.title{
height: 30%;
border-radius: 25rpx 25rpx 0 0;
}
.input{
height: 120rpx;
width: 90%;
position: absolute;
top:30%;
right: 5%;
border-radius: 25rpx;
overflow: hidden;
input{
// background-color: #a79f84;
height: 100%;
// width: 100%;
display: flex;
justify-content: center;
font-size: 60rpx;
}
}
.verify{
position: absolute;
top:110%;
right: 0%;
background-color: greenyellow;
height: 100rpx;
width: 200rpx;
font-size: 50rpx;
display: flex;
justify-content: center;
align-items: center;
border-radius: 25rpx;
box-shadow: rgba(0, 0, 0, 0.19) 0px 10px 20px, rgba(0, 0, 0, 0.23) 0px 6px 6px;
}
.cancel{
position: absolute;
top:110%;
left: 0%;
background-color: tomato;
height: 100rpx;
width: 200rpx;
font-size: 50rpx;
display: flex;
justify-content: center;
align-items: center;
border-radius: 25rpx;
box-shadow: rgba(0, 0, 0, 0.19) 0px 10px 20px, rgba(0, 0, 0, 0.23) 0px 6px 6px;
}
}
#editRemark{
height: 200rpx;
width: 70%;
position: absolute;
top: 30%;
left: 15%;
// overflow: hidden;
translate: 0 1300rpx;
background-color: rgba($color: #ffffff, $alpha: 1.0);
border-radius: 25rpx;
box-shadow: rgba(0, 0, 0, 0.19) 0px 10px 20px, rgba(0, 0, 0, 0.23) 0px 6px 6px;
.title{
height: 30%;
border-radius: 25rpx 25rpx 0 0;
}
.input{
height: 120rpx;
width: 90%;
position: absolute;
top:30%;
right: 5%;
border-radius: 25rpx;
overflow: hidden;
input{
// background-color: #a79f84;
height: 100%;
// width: 100%;
display: flex;
justify-content: center;
font-size: 60rpx;
}
}
.verify{
position: absolute;
top:110%;
right: 0%;
background-color: greenyellow;
height: 100rpx;
width: 200rpx;
font-size: 50rpx;
display: flex;
justify-content: center;
align-items: center;
border-radius: 25rpx;
box-shadow: rgba(0, 0, 0, 0.19) 0px 10px 20px, rgba(0, 0, 0, 0.23) 0px 6px 6px;
}
.cancel{
position: absolute;
top:110%;
left: 0%;
background-color: tomato;
height: 100rpx;
width: 200rpx;
font-size: 50rpx;
display: flex;
justify-content: center;
align-items: center;
border-radius: 25rpx;
box-shadow: rgba(0, 0, 0, 0.19) 0px 10px 20px, rgba(0, 0, 0, 0.23) 0px 6px 6px;
}
}
#removeCollectionVerify{
height: 130rpx;
width: 70%;
position: absolute;
top: 30%;
left: 15%;
// overflow: hidden;
translate: 0 1300rpx;
background-color: rgba($color: #ffffff, $alpha: 1.0);
border-radius: 25rpx;
box-shadow: rgba(0, 0, 0, 0.19) 0px 10px 20px, rgba(0, 0, 0, 0.23) 0px 6px 6px;
.title{
height: 100%;
background-color: unset;
border-radius: 25rpx 25rpx 0 0;
}
.verify{
position: absolute;
top:110%;
right: 0%;
background-color: greenyellow;
height: 100rpx;
width: 200rpx;
font-size: 50rpx;
display: flex;
justify-content: center;
align-items: center;
border-radius: 25rpx;
box-shadow: rgba(0, 0, 0, 0.19) 0px 10px 20px, rgba(0, 0, 0, 0.23) 0px 6px 6px;
}
.cancel{
position: absolute;
top:110%;
left: 0%;
background-color: tomato;
height: 100rpx;
width: 200rpx;
font-size: 50rpx;
display: flex;
justify-content: center;
align-items: center;
border-radius: 25rpx;
box-shadow: rgba(0, 0, 0, 0.19) 0px 10px 20px, rgba(0, 0, 0, 0.23) 0px 6px 6px;
}
}
//测试按钮 //测试按钮
.testButtom{ .testButtom{
+279 -157
View File
@@ -21,8 +21,13 @@ Page({
tip_hidden: false, tip_hidden: false,
active_Page: "startPage", active_Page: "startPage",
currentDate: '', currentDate: '',
remarkTemp:'',
resultTitle:"查询结果",
pageStack:[],
curtain_hidden: true, curtain_hidden: true,
curtain2_hidden: true,
imgUrl_test:"https://tse4-mm.cn.bing.net/th/id/OIP-C.2MyVJAPY4CWrMUIKfruz9AHaHa?w=199&h=199&c=7&r=0&o=5&dpr=1.3&pid=1.7", imgUrl_test:"https://tse4-mm.cn.bing.net/th/id/OIP-C.2MyVJAPY4CWrMUIKfruz9AHaHa?w=199&h=199&c=7&r=0&o=5&dpr=1.3&pid=1.7",
@@ -34,87 +39,109 @@ Page({
data_history: { data_history: {
"2023.2.30": [ "2023.2.30": [
{ {
imgUrl:"https://tse3-mm.cn.bing.net/th/id/OIP-C.qM9D7c-Ow-C-xLARJdSwQwHaIO?pid=ImgDet&rs=1" , res:{scores: 1, arr: ["山梨酸钾","山梨酸钾","山梨酸钾","山梨酸钾","山梨酸钾","山梨酸钾","山梨酸钾","山梨酸钾","山梨酸钾","山梨酸钾","山梨酸钾","山梨酸钾","山梨酸钾","山梨酸钾","山梨酸钾","山梨酸钾",]} id:1,
imgUrl:"https://tse3-mm.cn.bing.net/th/id/OIP-C.qM9D7c-Ow-C-xLARJdSwQwHaIO?pid=ImgDet&rs=1" , res:{scores: 1, arr: ["山梨酸钾","山梨酸钾","山梨酸钾","山梨酸钾","山梨酸钾","山梨酸钾","山梨酸钾","山梨酸钾","山梨酸钾","山梨酸钾","山梨酸钾","山梨酸钾","山梨酸钾","山梨酸钾","山梨酸钾","山梨酸钾",]},
hasCollect:false,//目前全是false。。。
},{ },{
imgUrl:"https://tse3-mm.cn.bing.net/th/id/OIP-C.qM9D7c-Ow-C-xLARJdSwQwHaIO?pid=ImgDet&rs=1" , res:{scores: 75, arr: []}
id:2,
imgUrl:"https://tse3-mm.cn.bing.net/th/id/OIP-C.qM9D7c-Ow-C-xLARJdSwQwHaIO?pid=ImgDet&rs=1" , res:{scores: 75, arr: []} ,
hasCollect:false,
},{ },{
imgUrl:"https://tse3-mm.cn.bing.net/th/id/OIP-C.qM9D7c-Ow-C-xLARJdSwQwHaIO?pid=ImgDet&rs=1" , res:{scores: 1, arr: []} id:3,
imgUrl:"https://tse3-mm.cn.bing.net/th/id/OIP-C.qM9D7c-Ow-C-xLARJdSwQwHaIO?pid=ImgDet&rs=1" , res:{scores: 1, arr: []} ,
hasCollect:false,
},{ },{
imgUrl:"https://tse3-mm.cn.bing.net/th/id/OIP-C.qM9D7c-Ow-C-xLARJdSwQwHaIO?pid=ImgDet&rs=1" , res:{scores: 1, arr: []} id:4,
imgUrl:"https://tse3-mm.cn.bing.net/th/id/OIP-C.qM9D7c-Ow-C-xLARJdSwQwHaIO?pid=ImgDet&rs=1" , res:{scores: 1, arr: []} ,
hasCollect:false,
},{ },{
imgUrl:"https://tse3-mm.cn.bing.net/th/id/OIP-C.qM9D7c-Ow-C-xLARJdSwQwHaIO?pid=ImgDet&rs=1" , res:{scores: 1, arr: []} id:5,
imgUrl:"https://tse3-mm.cn.bing.net/th/id/OIP-C.qM9D7c-Ow-C-xLARJdSwQwHaIO?pid=ImgDet&rs=1" , res:{scores: 1, arr: []} ,
hasCollect:false,
},{ },{
imgUrl:"https://tse3-mm.cn.bing.net/th/id/OIP-C.qM9D7c-Ow-C-xLARJdSwQwHaIO?pid=ImgDet&rs=1" , res:{scores: 1, arr: []} id:6,
imgUrl:"https://tse3-mm.cn.bing.net/th/id/OIP-C.qM9D7c-Ow-C-xLARJdSwQwHaIO?pid=ImgDet&rs=1" , res:{scores: 1, arr: []} ,
hasCollect:false,
}, },
], "2023.2.10": [ ], "2023.2.10": [
{ {
imgUrl:"https://tse3-mm.cn.bing.net/th/id/OIP-C.qM9D7c-Ow-C-xLARJdSwQwHaIO?pid=ImgDet&rs=1" , res:{scores: 1, arr: []} id:7,
imgUrl:"https://tse3-mm.cn.bing.net/th/id/OIP-C.qM9D7c-Ow-C-xLARJdSwQwHaIO?pid=ImgDet&rs=1" , res:{scores: 1, arr: []} ,
hasCollect:false,
} }
], "2023.2.11": [ ], "2023.2.11": [
{ {
imgUrl:"https://tse3-mm.cn.bing.net/th/id/OIP-C.qM9D7c-Ow-C-xLARJdSwQwHaIO?pid=ImgDet&rs=1" , res:{scores: 1, arr: []} id:8,
imgUrl:"https://tse3-mm.cn.bing.net/th/id/OIP-C.qM9D7c-Ow-C-xLARJdSwQwHaIO?pid=ImgDet&rs=1" , res:{scores: 1, arr: []} ,
hasCollect:false,
} }
], "2023.2.12": [ ], "2023.2.12": [
{ {
imgUrl:"https://tse3-mm.cn.bing.net/th/id/OIP-C.qM9D7c-Ow-C-xLARJdSwQwHaIO?pid=ImgDet&rs=1" , res:{scores: 1, arr: []} id:9,
imgUrl:"https://tse3-mm.cn.bing.net/th/id/OIP-C.qM9D7c-Ow-C-xLARJdSwQwHaIO?pid=ImgDet&rs=1" , res:{scores: 1, arr: []} ,
hasCollect:false,
} }
], "2023.2.13": [ ], "2023.2.13": [
{ {
imgUrl:"https://tse3-mm.cn.bing.net/th/id/OIP-C.qM9D7c-Ow-C-xLARJdSwQwHaIO?pid=ImgDet&rs=1" , res:{scores: 1, arr: []} id:10,
imgUrl:"https://tse3-mm.cn.bing.net/th/id/OIP-C.qM9D7c-Ow-C-xLARJdSwQwHaIO?pid=ImgDet&rs=1" , res:{scores: 1, arr: []} ,
hasCollect:false,
} }
], ],
}, },
//收藏夹data //收藏夹data
data_collect: [ data_collect: [
{ // {
"date": "2023.15.16", // "id":1,
"res":{scores: 99, arr: []} , // "date": "2023.15.16",
"imgUrl": "./static/icons/history.svg", // "res":{scores: 99, arr: []} ,
"remark": "方师傅康便面", // "imgUrl": "./static/icons/history.svg",
"riskBgColor": "springgreen", // "remark": "方师傅康便面",
"riskStr": "低风险", // "riskBgColor": "springgreen",
}, // "riskStr": "低风险",
{ // },
"date": "2023.5.6", // {
"res":{scores: 99, arr: []} , // "date": "2023.5.6",
"imgUrl": "./static/icons/history.svg", // "res":{scores: 99, arr: []} ,
"remark": "一二三四五六七", // "imgUrl": "./static/icons/history.svg",
"riskBgColor": "sandybrown", // "remark": "一二三四五六七",
"riskStr": "中风险" // "riskBgColor": "sandybrown",
}, // "riskStr": "中风险"
{ // },
"date": "2023.5.6", // {
"res":{scores: 99, arr: []} , // "date": "2023.5.6",
"imgUrl": "./static/icons/history.svg", // "res":{scores: 99, arr: []} ,
"remark": "一二三四五六七", // "imgUrl": "./static/icons/history.svg",
"riskBgColor": "tomato", // "remark": "一二三四五六七",
"riskStr": "高风险" // "riskBgColor": "tomato",
}, // "riskStr": "高风险"
{ // },
"date": "2023.15.16", // {
"res":{scores: 99, arr: []} , // "date": "2023.15.16",
"imgUrl": "./static/icons/history.svg", // "res":{scores: 99, arr: []} ,
"remark": "方师傅康便面", // "imgUrl": "./static/icons/history.svg",
"riskBgColor": "springgreen", // "remark": "方师傅康便面",
"riskStr": "低风险" // "riskBgColor": "springgreen",
}, // "riskStr": "低风险"
{ // },
"date": "2023.5.6", // {
"res":{scores: 1, arr: []} , // "date": "2023.5.6",
"imgUrl": "./static/icons/history.svg", // "res":{scores: 1, arr: []} ,
"remark": "一二三四五六七", // "imgUrl": "./static/icons/history.svg",
"riskBgColor": "tomato", // "remark": "一二三四五六七",
"riskStr": "高风险" // "riskBgColor": "tomato",
}, // "riskStr": "高风险"
{ // },
"date": "2023.5.6", // {
"res":{scores: 99, arr: []} , // "date": "2023.5.6",
"imgUrl": "./static/icons/history.svg", // "res":{scores: 99, arr: []} ,
"remark": "一二三四五六七", // "imgUrl": "./static/icons/history.svg",
"riskBgColor": "tomato", // "remark": "一二三四五六七",
"riskStr": "高风险" // "riskBgColor": "tomato",
}, // "riskStr": "高风险"
// },
], ],
// 存储所有成分的信息, hidden: false, "riskBgColor": "springgreen", "riskStr": "低风险"由前端实现 // 存储所有成分的信息, hidden: false, "riskBgColor": "springgreen", "riskStr": "低风险"由前端实现
@@ -180,103 +207,14 @@ Page({
//查询展示用 //查询展示用
data_resultPage: { data_resultPage: {
scores: 65, scores: 65,
circleClip: "", circleClip: "",
circleColor: "", circleColor: "",
arr: [{ arr: [],
name: { tr:null,//top right
zh: "山梨酸钾",
en: "Potassium sorbate"
}, },
scores: 73,
info: "山梨酸钾,又名2,4-己二烯酸钾,是山梨酸的钾盐,分子式为C6H7O2K,无色或白色鳞片状结晶或结晶性粉末。 [1] 无臭或微有臭味,长期暴露在空气中易吸潮、被氧化分解而变色。易溶于水(67.6g/100mL 20℃),溶于丙二醇(5.8g/100mL)和乙醇(0.3g/10 mL)。山梨酸钾和山梨酸是常用的有机防腐剂,广泛用于食品、化状品、饲料的防腐。易于被人体吸收代谢,在体内无残留,无毒性。",
extra: [],
ADI: "",
// 搜索用 //收藏/取消收藏用
hidden: false, resultId:-1,
//前端赋值
"riskBgColor": "springgreen",
"riskStr": "低风险"
}, {
name: {
zh: "李宁",
en: "L.N.G.N.M.S.L."
},
scores: 45,
info: "HAHA",
extra: [
{ type: "safe", name: "LPL" },
{ type: "unsafe", name: "飞舞" },
{ type: "unsafe", name: "精忠报国" },
],
ADI: "",
hidden: false,
riskBgColor: "sandybrown",
riskStr: "中风险"
}, {
name: {
zh: "丁基羟基茴香醚",
en: "Butyl hydroxyanisole(BHA)"
},
scores: 21,
info: "丁基羟基茴香醚(BHA),又名叔丁基-4-羟基茴香醚,化学式为C11H16O2,有两种异构体:3-BHA和2-BHA,一般指二者的混合物。2017年10月27日,世界卫生组织国际癌症研究机构公布的致癌物清单初步整理参考,叔丁基对羟基茴香醚(BHA)在2B类致癌物清单中。",
extra: [
{ type: "unsafe", name: "2B类致癌物" }
],
ADI: "0~0.5mg/kg bw",
hidden: false,
riskBgColor: "tomato",
riskStr: "高风险"
},{
name: {
zh: "山梨酸钾",
en: "Potassium sorbate"
},
scores: 73,
info: "山梨酸钾,又名2,4-己二烯酸钾,是山梨酸的钾盐,分子式为C6H7O2K,无色或白色鳞片状结晶或结晶性粉末。 [1] 无臭或微有臭味,长期暴露在空气中易吸潮、被氧化分解而变色。易溶于水(67.6g/100mL 20℃),溶于丙二醇(5.8g/100mL)和乙醇(0.3g/10 mL)。山梨酸钾和山梨酸是常用的有机防腐剂,广泛用于食品、化状品、饲料的防腐。易于被人体吸收代谢,在体内无残留,无毒性。",
extra: [],
ADI: "",
// 搜索用
hidden: false,
//前端赋值
"riskBgColor": "springgreen",
"riskStr": "低风险"
}, {
name: {
zh: "李宁",
en: "L.N.G.N.M.S.L."
},
scores: 45,
info: "HAHA",
extra: [
{ type: "safe", name: "LPL" },
{ type: "unsafe", name: "飞舞" },
{ type: "unsafe", name: "精忠报国" },
],
ADI: "",
hidden: false,
riskBgColor: "sandybrown",
riskStr: "中风险"
}, {
name: {
zh: "丁基羟基茴香醚",
en: "Butyl hydroxyanisole(BHA)"
},
scores: 21,
info: "丁基羟基茴香醚(BHA),又名叔丁基-4-羟基茴香醚,化学式为C11H16O2,有两种异构体:3-BHA和2-BHA,一般指二者的混合物。2017年10月27日,世界卫生组织国际癌症研究机构公布的致癌物清单初步整理参考,叔丁基对羟基茴香醚(BHA)在2B类致癌物清单中。",
extra: [
{ type: "unsafe", name: "2B类致癌物" }
],
ADI: "0~0.5mg/kg bw",
hidden: false,
riskBgColor: "tomato",
riskStr: "高风险"
}],
},
// 收到的查询结果信息 // 收到的查询结果信息
data_rcv: { data_rcv: {
@@ -297,11 +235,11 @@ Page({
// 启动时获取session // 启动时获取session
async onLoad() { async onLoad() {
// wx.authorize() // wx.authorize()
await this.updateSession() // await this.updateSession()
// setInterval(()=>{ // setInterval(()=>{
// this.updateSession() // this.updateSession()
// },60*1000*5) // },60*1000*5)
console.log(this.data.sessionKey) // console.log(this.data.sessionKey)
}, },
@@ -384,6 +322,7 @@ Page({
// this.setData({ // this.setData({
// camera_hidden:false, // camera_hidden:false,
// }) // })
this.data.pageStack.push("camera")
this.startPage_Bottons_leave() this.startPage_Bottons_leave()
this.animate('#page_camera', [ this.animate('#page_camera', [
{ opacity: 0, translateY: 0 }, { opacity: 1, translateY: "-100%", ease: 'ease-in-out', }, { opacity: 0, translateY: 0 }, { opacity: 1, translateY: "-100%", ease: 'ease-in-out', },
@@ -393,6 +332,7 @@ Page({
}, },
exit_camera() { exit_camera() {
this.data.pageStack.pop()
this.startPage_Bottons_in() this.startPage_Bottons_in()
this.animate('#page_camera', [ this.animate('#page_camera', [
{ opacity: 1, translateY: "-100%" }, { opacity: 0, translateY: "0", ease: 'ease-in-out' }, { opacity: 1, translateY: "-100%" }, { opacity: 0, translateY: "0", ease: 'ease-in-out' },
@@ -404,6 +344,7 @@ Page({
}, },
popup_history() { popup_history() {
this.data.pageStack.push("history")
this.startPage_Bottons_leave() this.startPage_Bottons_leave()
this.animate('#page_history', [ this.animate('#page_history', [
{ opacity: 0, translateY: 0 }, { opacity: 1, translateY: "-100%", ease: 'ease-in-out', }, { opacity: 0, translateY: 0 }, { opacity: 1, translateY: "-100%", ease: 'ease-in-out', },
@@ -413,6 +354,7 @@ Page({
}, },
exit_history() { exit_history() {
this.data.pageStack.pop()
this.startPage_Bottons_in() this.startPage_Bottons_in()
this.animate('#page_history', [ this.animate('#page_history', [
{ opacity: 1, translateY: "-100%" }, { opacity: 0, translateY: "0", ease: 'ease-in-out' }, { opacity: 1, translateY: "-100%" }, { opacity: 0, translateY: "0", ease: 'ease-in-out' },
@@ -420,6 +362,7 @@ Page({
}, },
popup_collect() { popup_collect() {
this.data.pageStack.push("collect")
this.startPage_Bottons_leave() this.startPage_Bottons_leave()
this.animate('#page_collect', [ this.animate('#page_collect', [
{ opacity: 0, translateY: 0 }, { opacity: 1, translateY: "-100%", ease: 'ease-in-out', }, { opacity: 0, translateY: 0 }, { opacity: 1, translateY: "-100%", ease: 'ease-in-out', },
@@ -429,6 +372,7 @@ Page({
}, },
exit_collect() { exit_collect() {
this.data.pageStack.pop()
this.startPage_Bottons_in() this.startPage_Bottons_in()
this.animate('#page_collect', [ this.animate('#page_collect', [
{ opacity: 1, translateY: "-100%" }, { opacity: 0, translateY: "0", ease: 'ease-in-out' }, { opacity: 1, translateY: "-100%" }, { opacity: 0, translateY: "0", ease: 'ease-in-out' },
@@ -436,6 +380,7 @@ Page({
}, },
popup_lib() { popup_lib() {
this.data.pageStack.push("lib")
this.startPage_Bottons_leave() this.startPage_Bottons_leave()
this.animate('#page_lib', [ this.animate('#page_lib', [
{ opacity: 0, translateY: 0 }, { opacity: 1, translateY: "-100%", ease: 'ease-in-out', }, { opacity: 0, translateY: 0 }, { opacity: 1, translateY: "-100%", ease: 'ease-in-out', },
@@ -445,6 +390,7 @@ Page({
}, },
exit_lib() { exit_lib() {
this.data.pageStack.pop()
this.startPage_Bottons_in() this.startPage_Bottons_in()
this.animate('#page_lib', [ this.animate('#page_lib', [
{ opacity: 1, translateY: "-100%" }, { opacity: 0, translateY: "0", ease: 'ease-in-out' }, { opacity: 1, translateY: "-100%" }, { opacity: 0, translateY: "0", ease: 'ease-in-out' },
@@ -459,6 +405,7 @@ Page({
}, },
popup_style() { popup_style() {
this.data.pageStack.push("style")
this.startPage_Bottons_leave() this.startPage_Bottons_leave()
this.animate('#page_style', [ this.animate('#page_style', [
{ opacity: 0, translateY: 0 }, { opacity: 1, translateY: "-100%", ease: 'ease-in-out', }, { opacity: 0, translateY: 0 }, { opacity: 1, translateY: "-100%", ease: 'ease-in-out', },
@@ -468,6 +415,7 @@ Page({
}, },
exit_style() { exit_style() {
this.data.pageStack.pop()
this.startPage_Bottons_in() this.startPage_Bottons_in()
this.animate('#page_style', [ this.animate('#page_style', [
{ opacity: 1, translateY: "-100%" }, { opacity: 0, translateY: "0", ease: 'ease-in-out' }, { opacity: 1, translateY: "-100%" }, { opacity: 0, translateY: "0", ease: 'ease-in-out' },
@@ -519,13 +467,78 @@ Page({
], 600) ], 600)
}, },
//遮罩动画2
show_curtain2() {
this.setData({
curtain2_hidden: false
})
this.animate('#page_curtain2', [
{ opacity: 0 }, { opacity: 1, ease: 'ease-in-out' },
], 1000)
},
hide_curtain2() {
this.animate('#page_curtain2', [
{ opacity: 1 }, { opacity: 0, ease: 'ease-in-out' },
], 1000)
this.setData({
curtain2_hidden: true
})
},
// 设置备注
popup_setRemark() {
this.show_curtain2()
this.animate('#star_setRemark', [
{ opacity: 0, translateY: 0 }, { opacity: 1, translateY: "-1300rpx", ease: 'ease-in-out', },
], 600)
},
exit_setRemark() {
this.animate('#star_setRemark', [
{ opacity: 1, translateY: "-1300rpx" }, { opacity: 0, translateY: "0", ease: 'ease-in-out' },
], 600)
this.hide_curtain2()
},
popup_editRemark() {
this.show_curtain2()
this.animate('#editRemark', [
{ opacity: 0, translateY: 0 }, { opacity: 1, translateY: "-1300rpx", ease: 'ease-in-out', },
], 600)
},
exit_editRemark() {
this.animate('#editRemark', [
{ opacity: 1, translateY: "-1300rpx" }, { opacity: 0, translateY: "0", ease: 'ease-in-out' },
], 600)
this.hide_curtain2()
},
popup_removeCollectionVerify() {
this.show_curtain2()
this.animate('#removeCollectionVerify', [
{ opacity: 0, translateY: 0 }, { opacity: 1, translateY: "-1300rpx", ease: 'ease-in-out', },
], 600)
},
exit_removeCollectionVerify() {
this.animate('#removeCollectionVerify', [
{ opacity: 1, translateY: "-1300rpx" }, { opacity: 0, translateY: "0", ease: 'ease-in-out' },
], 600)
this.hide_curtain2()
},
// 根据传入的包含scores和arr的object更新this.data.data_resultPage并popup_result // 根据传入的包含scores和arr的object更新this.data.data_resultPage并popup_result
show_result(res: { scores: any,arr:Array<any> }) { show_result(res: { scores: any,arr:Array<any> } ,tr:string) {
console.log(res) // console.log(res)
var data_resultPage={ var data_resultPage={
scores: res.scores, scores: res.scores,
arr: []} arr: [],
tr:tr,
}
console.log(tr)
for(var name of res.arr){ for(var name of res.arr){
// 有时间去写个时间复杂度更低的,不过感觉也够用了 // 有时间去写个时间复杂度更低的,不过感觉也够用了
for(var n of this.data.data_lib){ for(var n of this.data.data_lib){
@@ -538,11 +551,110 @@ Page({
this.setData({ this.setData({
"data_resultPage":data_resultPage "data_resultPage":data_resultPage
}) })
// console.log(data_resultPage)
this.popup_result() this.popup_result()
}, },
show_result_wxml(e:any){ show_result_wxml(e:any){
var res=e.currentTarget.dataset.index; var res=e.currentTarget.dataset.index;
this.show_result(res) console.log(res)
this.data.resultId=res.id
// console.log(this.data.resultId)
var tr = ""
switch(this.data.pageStack[this.data.pageStack.length-1]){
case "collect":{
tr = "delete"
break;
}
case "history":{
if(res.hasCollect)
tr = "delete"
else
tr = "heart"
break;
}
}
res=res.res
this.show_result(res,tr)
},
getInputRemark(e:any){
this.data.remarkTemp = e.detail.value
},
// 收藏当前页面
add_collection(){
var r = this.id2resultAndDate(this.data.resultId)
if(r == null)return
var result = r.result
var date = r.date
var remark = this.data.remarkTemp
console.log(result,date,remark)
this.data.data_collect.push({
"id":this.data.resultId,
"date":date,
"res":result.res,
"imgUrl":result.imgUrl,
"remark":this.data.remarkTemp,
"riskBgColor":this.scores2map(result.res.scores).color,
"riskStr": this.scores2map(result.res.scores).content,
})
result.hasCollect=true
this.data.data_resultPage.tr="delete"
this.setData(
{data_collect:this.data.data_collect,
data_history:this.data.data_history,
data_resultPage:this.data.data_resultPage}
)
this.exit_setRemark()
},
editRemark(){
var r = this.id2resultAndDate(this.data.resultId)
if(r == null)return
var result = r.result
var date = r.date
var remark = this.data.remarkTemp
for(var i in this.data.data_collect){
if (this.data.data_collect[i].id == this.data.resultId){
this.data.data_collect[i].remark=remark
}
}
this.setData(
{data_collect:this.data.data_collect,
data_history:this.data.data_history,
data_resultPage:this.data.data_resultPage}
)
this.exit_editRemark()
},
//取消收藏。。。。
remove_collection(){
var flag = true
var r = this.id2resultAndDate(this.data.resultId)
if(r == null) flag = false
if(flag){
var result = r.result
result.hasCollect=false
}
for(var i in this.data.data_collect){
if (this.data.data_collect[i].id == this.data.resultId){
this.data.data_collect.splice(i,1)
}
}
this.data.data_resultPage.tr="heart"
this.setData(
{data_collect:this.data.data_collect,
data_history:this.data.data_history,
data_resultPage:this.data.data_resultPage}
)
this.exit_removeCollectionVerify()
}, },
// 根据角度计算剪切路径,错了不怪我。。 // 根据角度计算剪切路径,错了不怪我。。
@@ -835,6 +947,16 @@ Page({
return { "color": "tomato", "content": "高风险" }; return { "color": "tomato", "content": "高风险" };
}, },
id2resultAndDate(id:number){
for(var i in this.data.data_history){
for(var n of this.data.data_history[i])
if(n.id == id){
return {result:n,date:i}
}
}
return null;
},
// 事件处理函数 // 事件处理函数
+47 -4
View File
@@ -116,7 +116,7 @@
<view class="picture" wx:for="{{arr}}" wx:for-item="res" > <view class="picture" wx:for="{{arr}}" wx:for-item="res" >
<!-- {{content}} --> <!-- {{content}} -->
<!-- https://www.cnblogs.com/china-fanny/p/11213746.html#:~:text=%E5%A6%82%E4%BD%95%E6%98%BE%E7%A4%BA%20%EF%BC%9F%20%E4%BD%BF%E7%94%A8image%E6%A0%87%E7%AD%BE%EF%BC%8Csrc%E5%B1%9E%E6%80%A7%E6%B7%BB%E5%8A%A0,data%3Aimage%2Fpng%3Bbase64%2C%20%EF%BC%88%E6%B3%A8%E6%84%8F%EF%BC%9A%E8%8B%A5imgData%E8%BF%94%E5%9B%9E%E6%95%B0%E6%8D%AE%E4%B8%AD%E5%90%AB%E6%9C%89data%3Aimage%2Fpng%3Bbase64%2C%E6%97%B6%EF%BC%8Csrc%E7%9B%B4%E6%8E%A5%E5%86%99src%3D%22%20%7B%20%7BimgData%7D%7D%22%E5%8D%B3%E5%8F%AF%EF%BC%89 --> <!-- https://www.cnblogs.com/china-fanny/p/11213746.html#:~:text=%E5%A6%82%E4%BD%95%E6%98%BE%E7%A4%BA%20%EF%BC%9F%20%E4%BD%BF%E7%94%A8image%E6%A0%87%E7%AD%BE%EF%BC%8Csrc%E5%B1%9E%E6%80%A7%E6%B7%BB%E5%8A%A0,data%3Aimage%2Fpng%3Bbase64%2C%20%EF%BC%88%E6%B3%A8%E6%84%8F%EF%BC%9A%E8%8B%A5imgData%E8%BF%94%E5%9B%9E%E6%95%B0%E6%8D%AE%E4%B8%AD%E5%90%AB%E6%9C%89data%3Aimage%2Fpng%3Bbase64%2C%E6%97%B6%EF%BC%8Csrc%E7%9B%B4%E6%8E%A5%E5%86%99src%3D%22%20%7B%20%7BimgData%7D%7D%22%E5%8D%B3%E5%8F%AF%EF%BC%89 -->
<image src="{{ res.imgUrl }}" mode="'aspectFit'" style="height: 150rpx;width: 150rpx;"bind:tap="show_result_wxml" data-index="{{ res.res }}" /> <image src="{{ res.imgUrl }}" mode="'aspectFit'" style="height: 150rpx;width: 150rpx;"bind:tap="show_result_wxml" data-index="{{ res }}" />
</view> </view>
</view> </view>
</view> </view>
@@ -133,7 +133,7 @@
</view> </view>
<view class="content"> <view class="content">
<view wx:for="{{ data_collect }}" wx:for-item="n"> <view wx:for="{{ data_collect }}" wx:for-item="n">
<view class="node" style="background-color: {{ n.riskBgColor }};" bind:tap="show_result_wxml" data-index="{{ n.res }}"> <view class="node" style="background-color: {{ n.riskBgColor }};" bind:tap="show_result_wxml" data-index="{{ n }}">
<view class="node_content"> <view class="node_content">
<view class="node_date">{{ n.date }}</view> <view class="node_date">{{ n.date }}</view>
<image class="node_img" src="{{ n.imgUrl }}" mode="'aspectFit'"/> <image class="node_img" src="{{ n.imgUrl }}" mode="'aspectFit'"/>
@@ -164,10 +164,19 @@
<!-- 查询结果页面 --> <!-- 查询结果页面 -->
<view id="page_result"> <view id="page_result">
<view class="title"> <view class="title">
<view>{{"查询结果"}}</view> <view>{{resultTitle}}</view>
<view class="page_back" bind:tap="exit_result"> <view class="page_back" bind:tap="exit_result">
<image src="./static/icons/back.svg" mode="aspectFit" /> <image src="./static/icons/back.svg" mode="aspectFit" />
</view> </view>
<view class="page_star" bind:tap="popup_setRemark" data-index="{{}}" wx:if="{{ data_resultPage.tr=='heart' }}">
<image src="./static/icons/heart.svg" mode="aspectFit" wx:if="{{ data_resultPage.tr=='heart' }}"/>
</view>
<view class="page_star" bind:tap="popup_removeCollectionVerify" wx:if="{{ data_resultPage.tr=='delete' }}">
<image src="./static/icons/delete.svg" mode="aspectFit" wx:if="{{ data_resultPage.tr=='delete' }}"/>
</view>
<view class="page_editRemark" bind:tap="popup_editRemark" wx:if="{{ data_resultPage.tr=='delete' }}">
<image src="./static/icons/edit.svg" mode="aspectFit" wx:if="{{ data_resultPage.tr=='delete' }}"/>
</view>
</view> </view>
<view class="content"> <view class="content">
<!-- 丑出天际 --> <!-- 丑出天际 -->
@@ -187,7 +196,7 @@
<view class="search_icon"> <view class="search_icon">
<image src="./static/icons/search.svg" mode="aspectFit" /> <image src="./static/icons/search.svg" mode="aspectFit" />
</view> </view>
<input class="search_input" id="input_libSearch" bindinput="readInput_result" placeholder=" 输入中/英文名称搜索"/> <input class="search_input" bindinput="readInput_result" placeholder=" 输入中/英文名称搜索"/>
</view> </view>
<!-- <view class="search_button" bind:tap="readInput_lib">搜索</view> --> <!-- <view class="search_button" bind:tap="readInput_lib">搜索</view> -->
</view> </view>
@@ -228,6 +237,40 @@
<!-- 成分详细信息 --> <!-- 成分详细信息 -->
<view id="composition_info"></view> <view id="composition_info"></view>
<!-- 半透明遮罩2 -->
<view id="curtain2" hidden="{{curtain2_hidden}}"></view>
<!-- 收藏的时候设置备注的输入框 -->
<view id="star_setRemark">
<view class="title">
<view>{{"输入备注,至多八字"}}</view>
</view>
<view class="input">
<input id="input_setRemark" bindinput='getInputRemark' placeholder="___________________" maxlength="8"/>
</view>
<view class="verify" bind:tap="add_collection">确认</view>
<view class="cancel" bind:tap="exit_setRemark">取消</view>
</view>
<view id="editRemark">
<view class="title">
<view>{{"修改备注,至多八字"}}</view>
</view>
<view class="input">
<input bindinput='getInputRemark' placeholder="___________________" maxlength="8"/>
</view>
<view class="verify" bind:tap="editRemark">确认</view>
<view class="cancel" bind:tap="exit_editRemark">取消</view>
</view>
<!-- 收藏的时候设置备注的输入框 -->
<view id="removeCollectionVerify">
<view class="title">
<view>{{"确认移除收藏?"}}</view>
</view>
<view class="verify" bind:tap="remove_collection">确认</view>
<view class="cancel" bind:tap="exit_removeCollectionVerify">取消</view>
</view>
<!-- <view class="testButtom1" bind:tap="popup_result">强制显示查询结果</view> <!-- <view class="testButtom1" bind:tap="popup_result">强制显示查询结果</view>
<view class="testButtom2" bind:tap="updateHistory">测试更新历史记录</view> <view class="testButtom2" bind:tap="updateHistory">测试更新历史记录</view>
<view class="testButtom" bind:tap="testfunction">测试获取</view> --> <view class="testButtom" bind:tap="testfunction">测试获取</view> -->
@@ -0,0 +1 @@
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1699633081474" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="7919" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M202.666667 256h-42.666667a32 32 0 0 1 0-64h704a32 32 0 0 1 0 64H266.666667v565.333333a53.333333 53.333333 0 0 0 53.333333 53.333334h384a53.333333 53.333333 0 0 0 53.333333-53.333334V352a32 32 0 0 1 64 0v469.333333c0 64.8-52.533333 117.333333-117.333333 117.333334H320c-64.8 0-117.333333-52.533333-117.333333-117.333334V256z m224-106.666667a32 32 0 0 1 0-64h170.666666a32 32 0 0 1 0 64H426.666667z m-32 288a32 32 0 0 1 64 0v256a32 32 0 0 1-64 0V437.333333z m170.666666 0a32 32 0 0 1 64 0v256a32 32 0 0 1-64 0V437.333333z" fill="#000000" p-id="7920"></path></svg>

After

Width:  |  Height:  |  Size: 895 B

@@ -0,0 +1 @@
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1699641289024" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4183" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M816.277333 165.056a128 128 0 0 1 0 181.013333L309.653333 852.693333a21.333333 21.333333 0 0 1-15.082666 6.229334H165.056a42.666667 42.666667 0 0 1-42.666667-42.666667v-129.493333a21.333333 21.333333 0 0 1 6.229334-15.104L635.306667 165.056a128 128 0 0 1 180.992 0z m-45.226666 45.226667a64 64 0 0 0-87.786667-2.56l-2.752 2.56L188.885333 701.930667a8.533333 8.533333 0 0 0-2.496 6.037333v78.464c0 4.714667 3.818667 8.533333 8.533334 8.533333h78.421333a8.533333 8.533333 0 0 0 6.037333-2.517333l491.648-491.605333a64 64 0 0 0 2.581334-87.786667l-2.56-2.730667z" fill="#15aa87" p-id="4184"></path><path d="M590.016 210.304l181.013333 181.013333-45.248 45.248-181.013333-181.013333z" fill="#15aa87" p-id="4185"></path><path d="M490.666667 795.733333m8.533333 0l345.6 0q8.533333 0 8.533333 8.533334l0 46.933333q0 8.533333-8.533333 8.533333l-345.6 0q-8.533333 0-8.533333-8.533333l0-46.933333q0-8.533333 8.533333-8.533334Z" fill="#15aa87" p-id="4186"></path><path d="M661.333333 667.733333m8.533334 0l174.933333 0q8.533333 0 8.533333 8.533334l0 46.933333q0 8.533333-8.533333 8.533333l-174.933333 0q-8.533333 0-8.533334-8.533333l0-46.933333q0-8.533333 8.533334-8.533334Z" fill="#15aa87" p-id="4187"></path></svg>

After

Width:  |  Height:  |  Size: 1.5 KiB

@@ -0,0 +1 @@
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1699631961621" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4216" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M908.1 353.1l-253.9-36.9L540.7 86.1c-3.1-6.3-8.2-11.4-14.5-14.5-15.8-7.8-35-1.3-42.9 14.5L369.8 316.2l-253.9 36.9c-7 1-13.4 4.3-18.3 9.3-12.3 12.7-12.1 32.9 0.6 45.3l183.7 179.1-43.4 252.9c-1.2 6.9-0.1 14.1 3.2 20.3 8.2 15.6 27.6 21.7 43.2 13.4L512 754l227.1 119.4c6.2 3.3 13.4 4.4 20.3 3.2 17.4-3 29.1-19.5 26.1-36.9l-43.4-252.9 183.7-179.1c5-4.9 8.3-11.3 9.3-18.3 2.7-17.5-9.5-33.7-27-36.3z" p-id="4217" fill="#15aa87"></path></svg>

After

Width:  |  Height:  |  Size: 767 B

@@ -0,0 +1 @@
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1699631799553" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4014" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M908.1 353.1l-253.9-36.9L540.7 86.1c-3.1-6.3-8.2-11.4-14.5-14.5-15.8-7.8-35-1.3-42.9 14.5L369.8 316.2l-253.9 36.9c-7 1-13.4 4.3-18.3 9.3-12.3 12.7-12.1 32.9 0.6 45.3l183.7 179.1-43.4 252.9c-1.2 6.9-0.1 14.1 3.2 20.3 8.2 15.6 27.6 21.7 43.2 13.4L512 754l227.1 119.4c6.2 3.3 13.4 4.4 20.3 3.2 17.4-3 29.1-19.5 26.1-36.9l-43.4-252.9 183.7-179.1c5-4.9 8.3-11.3 9.3-18.3 2.7-17.5-9.5-33.7-27-36.3zM664.8 561.6l36.1 210.3L512 672.7 323.1 772l36.1-210.3-152.8-149L417.6 382 512 190.7 606.4 382l211.2 30.7-152.8 148.9z" p-id="4015" fill="#15aa87"></path></svg>

After

Width:  |  Height:  |  Size: 885 B