陈祥坤电脑坏了用我电脑写的
This commit is contained in:
1 parent
b6c3e73900
commit
226a5bbc2d
4 files changed
+434
-58
No files matched your search
@@ -3,18 +3,25 @@
|
||||
|
||||
const app = getApp<IAppOption>()
|
||||
|
||||
// class stack{
|
||||
// data=[]
|
||||
// push=(d: any) =>{
|
||||
// this.data.push(d);
|
||||
// }
|
||||
// }
|
||||
|
||||
Page({
|
||||
ctx:wx.createCameraContext(),
|
||||
data: {
|
||||
motto: 'Hello World',
|
||||
// motto: 'Hello World',
|
||||
text_startPage1: "知识库",
|
||||
text_startPage4: "个性化",
|
||||
imgUrl_startPage1:"./static/icons/lib.svg",
|
||||
function_startPage1:"",
|
||||
function_startPage1:"popup_lib",
|
||||
imgUrl_startPage2:"./static/icons/history.svg",
|
||||
function_startPage2:"popup_history",
|
||||
imgUrl_startPage3:"./static/icons/heart.svg",
|
||||
function_startPage3:"popup_collect",
|
||||
text_startPage4: "个性化",
|
||||
imgUrl_startPage4:"./static/icons/self.svg",
|
||||
tip_content: "不吃饭会饿死",
|
||||
tip_hidden: false,
|
||||
@@ -31,11 +38,78 @@ Page({
|
||||
"2023.2.36":["test9","test0"],
|
||||
"2023.12.37":["test9","test0"],
|
||||
},
|
||||
// userInfo: {},
|
||||
// hasUserInfo: false,
|
||||
// canIUse: wx.canIUse('button.open-type.getUserInfo'),
|
||||
// canIUseGetUserProfile: false,
|
||||
// canIUseOpenData: wx.canIUse('open-data.type.userAvatarUrl') && wx.canIUse('open-data.type.userNickName') // 如需尝试获取用户信息可改为false
|
||||
data_collect_test:[
|
||||
{ "date":"2023.15.16",
|
||||
"scores":"99",
|
||||
"imgUrl":"./static/icons/history.svg",
|
||||
"remark":"方师傅康便面",
|
||||
"riskBgColor":"springgreen",
|
||||
"riskStr":"低风险"
|
||||
},
|
||||
{ "date":"2023.5.6",
|
||||
"scores":"1",
|
||||
"imgUrl":"./static/icons/history.svg",
|
||||
"remark":"一二三四五六七",
|
||||
"riskBgColor":"tomato",
|
||||
"riskStr":"高风险"
|
||||
},
|
||||
{ "date":"2023.5.6",
|
||||
"scores":"100",
|
||||
"imgUrl":"./static/icons/history.svg",
|
||||
"remark":"一二三四五六七",
|
||||
"riskBgColor":"tomato",
|
||||
"riskStr":"高风险"
|
||||
},
|
||||
{ "date":"2023.15.16",
|
||||
"scores":"99",
|
||||
"imgUrl":"./static/icons/history.svg",
|
||||
"remark":"方师傅康便面",
|
||||
"riskBgColor":"springgreen",
|
||||
"riskStr":"低风险"
|
||||
},
|
||||
{ "date":"2023.5.6",
|
||||
"scores":"1",
|
||||
"imgUrl":"./static/icons/history.svg",
|
||||
"remark":"一二三四五六七",
|
||||
"riskBgColor":"tomato",
|
||||
"riskStr":"高风险"
|
||||
},
|
||||
{ "date":"2023.5.6",
|
||||
"scores":"100",
|
||||
"imgUrl":"./static/icons/history.svg",
|
||||
"remark":"一二三四五六七",
|
||||
"riskBgColor":"tomato",
|
||||
"riskStr":"高风险"
|
||||
},
|
||||
],
|
||||
data_lib_test:[
|
||||
{
|
||||
name:{
|
||||
zh:"山梨酸钾",
|
||||
en:"potassium sorbate"
|
||||
},
|
||||
scores:73,
|
||||
info:"山梨酸钾,又名2,4-己二烯酸钾,是山梨酸的钾盐,分子式为C6H7O2K,无色或白色鳞片状结晶或结晶性粉末。 [1] 无臭或微有臭味,长期暴露在空气中易吸潮、被氧化分解而变色。易溶于水(67.6g/100mL 20℃),溶于丙二醇(5.8g/100mL)和乙醇(0.3g/10 mL)。山梨酸钾和山梨酸是常用的有机防腐剂,广泛用于食品、化状品、饲料的防腐。易于被人体吸收代谢,在体内无残留,无毒性。",
|
||||
risk:[],
|
||||
"riskBgColor":"springgreen",
|
||||
"riskStr":"低风险"
|
||||
},{
|
||||
name:{
|
||||
zh:"丁基羟基茴香醚",
|
||||
en:"Butyl hydroxyanisole(BHA)"
|
||||
},
|
||||
scores:21,
|
||||
info:"丁基羟基茴香醚(BHA),又名叔丁基-4-羟基茴香醚,化学式为C11H16O2,有两种异构体:3-BHA和2-BHA,一般指二者的混合物。2017年10月27日,世界卫生组织国际癌症研究机构公布的致癌物清单初步整理参考,叔丁基对羟基茴香醚(BHA)在2B类致癌物清单中。",
|
||||
risk:["2B类致癌物"],
|
||||
"riskBgColor":"tomato",
|
||||
"riskStr":"高风险"
|
||||
}
|
||||
],
|
||||
userInfo: {},
|
||||
hasUserInfo: false,
|
||||
canIUse: wx.canIUse('button.open-type.getUserInfo'),
|
||||
canIUseGetUserProfile: false,
|
||||
canIUseOpenData: wx.canIUse('open-data.type.userAvatarUrl') && wx.canIUse('open-data.type.userNickName') // 如需尝试获取用户信息可改为false
|
||||
},
|
||||
onLoad() {
|
||||
// @ts-ignore
|
||||
@@ -169,6 +243,22 @@ Page({
|
||||
], 1000)
|
||||
},
|
||||
|
||||
popup_lib(){
|
||||
this.startPage_Bottons_leave()
|
||||
this.animate('#page_lib', [
|
||||
{ opacity: 0, translateY: 0 }, { opacity: 1, translateY: "-100%", ease: 'ease-in-out', },
|
||||
], 1000,()=>{
|
||||
this.selectComponent('#page_collect')
|
||||
})
|
||||
},
|
||||
|
||||
exit_lib(){
|
||||
this.startPage_Bottons_in()
|
||||
this.animate('#page_lib', [
|
||||
{ opacity: 1, translateY: "-100%" }, { opacity: 0, translateY: "0", ease: 'ease-in-out' },
|
||||
], 1000)
|
||||
},
|
||||
|
||||
takePhoto() {
|
||||
// ctx = wx.createCameraContext()
|
||||
console.log('takePhoto..')
|
||||
@@ -182,6 +272,33 @@ Page({
|
||||
})
|
||||
},
|
||||
|
||||
scores2risk(scores: Number){
|
||||
if(scores < 33){
|
||||
return "high";
|
||||
}else if(scores < 66){
|
||||
return "middle";
|
||||
}else{
|
||||
return "low";
|
||||
}
|
||||
},
|
||||
|
||||
//将risk转为存储color和content的map
|
||||
scores2map(scores: Number){
|
||||
var risk=this.scores2risk(scores)
|
||||
switch(risk){
|
||||
case "low":{
|
||||
return {"color":"springgreen","content":"低风险"};
|
||||
}
|
||||
case "middle":{
|
||||
return {"color":"yellow","content":"中风险"};
|
||||
}
|
||||
case "high":{
|
||||
return {"color":"tomato","content":"高风险"};
|
||||
}
|
||||
}
|
||||
return {"color":"tomato","content":"高风险"};
|
||||
},
|
||||
|
||||
|
||||
|
||||
// 事件处理函数
|
||||
|
||||
Reference in new issue
Block a user