284 lines
16 KiB
Plaintext
284 lines
16 KiB
Plaintext
<!--index.wxml-->
|
|
<view class="container" style="{{ miao_style }}">
|
|
<!-- <view class="container"> -->
|
|
|
|
<!-- 开始界面 -->
|
|
<view class="miao_page" id = 'startPage'>
|
|
<!-- 立即搜索 -->
|
|
<view class="buttom_startPage" id="gotoSearch" bind:tap="popup_camera">
|
|
<image src="./static/icons/camera.svg" mode="'aspectFit'" style="height: 180rpx;width: 180rpx;margin-right:50rpx;" />
|
|
<view class="text_startPage">立即搜索</view>
|
|
</view>
|
|
<view class='buttom_startPage' id="buttom_startPage1" bind:tap="{{function_startPage1}}">
|
|
<image src="{{imgUrl_startPage1}}" mode="'aspectFit'" style="height: 100rpx;width: 100rpx;margin-right:30rpx;" />
|
|
<view class="text_startPage">{{text_startPage1}}</view>
|
|
</view>
|
|
<view class='buttom_startPage' id="buttom_startPage2" bind:tap="{{function_startPage2}}">
|
|
<image src="{{imgUrl_startPage2}}" mode="'aspectFit'" style="height: 100rpx;width: 100rpx;" />
|
|
</view>
|
|
<view class='buttom_startPage' id="buttom_startPage3" bind:tap="{{function_startPage3}}">
|
|
<image src="{{imgUrl_startPage3}}" mode="'aspectFit'" style="height: 100rpx;width: 100rpx;" />
|
|
</view>
|
|
<view class='buttom_startPage' id="buttom_startPage4" bind:tap="{{function_startPage4}}">
|
|
<view class="text_startPage">{{text_startPage4}}</view>
|
|
<image src="{{imgUrl_startPage4}}" mode="'aspectFit'" style="height: 100rpx;width: 100rpx;margin-left:30rpx;" />
|
|
</view>
|
|
<view class="buttom_startPage" id="tips_startPage" hidden="{{tip_hidden}}" style="justify-content: left;">
|
|
<view class="tip_head" style="margin-left: 15rpx;font-weight: 600;">Daliy Tips:</view>
|
|
<view class="tip_content"style="margin-left:15rpx;font-weight: 600;">{{tip_content}}</view>
|
|
</view>
|
|
<!-- <view class="buttom_startPage test" id='test' bind:tap="startPage_Bottons_leave">测试移去</view>
|
|
<view class="buttom_startPage test" id='test2' bind:tap="popup_camera">弹出相机</view> -->
|
|
</view>
|
|
|
|
<!-- 相机界面,放在下面 -->
|
|
<view id='page_camera' class="miao_page" wx:if="{{!camera_hidden}}">
|
|
<camera id='camera' device-position="back" flash="off"></camera>
|
|
<view id="page_camera_background"></view>
|
|
<view id="buttom_takePhoto" bind:tap="takePhoto">
|
|
<view id="buttom_takePhoto1">
|
|
</view>
|
|
</view>
|
|
<view id="page_camera_back" bind:tap="exit_camera">
|
|
<image src="./static/icons/back.svg" mode="aspectFit" />
|
|
</view>
|
|
<view id="page_camera_local" bind:tap="choosePhoto">
|
|
<image src="./static/icons/local_Img.svg" mode="aspectFit" />
|
|
</view>
|
|
</view>
|
|
|
|
<!-- 知识库界面 -->
|
|
<view id="page_lib" class="miao_page">
|
|
<view class="title">
|
|
<view>知识库</view>
|
|
<view class="page_back" bind:tap="exit_lib">
|
|
<image src="./static/icons/back_black.svg" mode="aspectFit" />
|
|
</view>
|
|
</view>
|
|
<view class="content">
|
|
<view class="search lib_search">
|
|
<view class="search_bar lib_search_input">
|
|
<view class="search_icon">
|
|
<image src="./static/icons/search.svg" mode="aspectFit" />
|
|
</view>
|
|
<input class="search_input" id="input_libSearch" bindinput="readInput_lib" placeholder=" 输入中/英文名称搜索"/>
|
|
</view>
|
|
<!-- <view class="search_button" bind:tap="readInput_lib">搜索</view> -->
|
|
</view>
|
|
<view wx:for="{{ data_lib }}" wx:for-item="n">
|
|
<view class="ingredient_card" hidden="{{ hidden_lib[n.name.zh] }}" style="background-color: {{ n.riskBgColor }};">
|
|
<view class="node_content">
|
|
<view class="node_name">{{ n.name.zh }}</view>
|
|
<view class="node_name node_name_en">{{ n.name.en }}</view>
|
|
|
|
<view class="node_adi">
|
|
<view class="adi_title">ADI</view>
|
|
<view class="adi_content" wx:if="{{ n.ADI!='' }}">{{ n.ADI }}</view>
|
|
<view class="adi_content" wx:if="{{ n.ADI=='' }}">{{ "暂无数据" }}</view>
|
|
</view>
|
|
<!-- <image class="node_img" src="{{ n.imgUrl }}" mode="'aspectFit'"/> -->
|
|
<view class="node_safe" wx:if="{{ n.scores > 66 }}"><view>安全</view></view>
|
|
<view class="node_danger" wx:if="{{ n.scores < 33 }}"><view>危险</view></view>
|
|
<view class="node_scores">
|
|
<view class="scores_title" style="background-color: {{ n.riskBgColor }};">评分</view>
|
|
<view class="scores_num">{{ n.scores }}</view>
|
|
</view>
|
|
<view class="node_risk" style="background-color: {{ n.riskBgColor }};">{{ n.riskStr }}</view>
|
|
<view class="node_extra">
|
|
<view class="node_extra_empty" wx:if="{{ n.extra.length==0 }}">
|
|
暂无数据
|
|
</view>
|
|
<view wx:for="{{n.extra}}" wx:for-item="item">
|
|
<view class="node_ex_content" style="background-color: {{ item.type=='unsafe'?'tomato':'springgreen' }};">{{item.name}}</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
|
|
<!-- 历史记录界面 -->
|
|
<view id="page_history" class="miao_page">
|
|
<view class="title">
|
|
<view>历史记录</view>
|
|
<view class="page_back" bind:tap="exit_history">
|
|
<image src="./static/icons/back_black.svg" mode="aspectFit" />
|
|
</view>
|
|
</view>
|
|
<!-- <view class="date1">{{currentDate}}</view>
|
|
<view class="picture1">picture1</view>
|
|
<view class="picture2">picture2</view> -->
|
|
|
|
<view class="content">
|
|
<view class="history_part" wx:for="{{data_history}}" wx:for-index="date" wx:for-item="arr">
|
|
<view class="history_time">{{date}}</view>
|
|
<view class="history_content">
|
|
<view class="picture" wx:for="{{arr}}" wx:for-item="res" >
|
|
<!-- {{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 -->
|
|
<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 id="page_collect" class="miao_page">
|
|
<view class="title">
|
|
<view>我的收藏</view>
|
|
<view class="page_back" bind:tap="exit_collect">
|
|
<image src="./static/icons/back_black.svg" mode="aspectFit" />
|
|
</view>
|
|
</view>
|
|
<view class="content">
|
|
<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 }}">
|
|
<view class="node_content">
|
|
<view class="node_date">{{ n.date }}</view>
|
|
<image class="node_img" src="{{ n.imgUrl }}" mode="'aspectFit'"/>
|
|
<view class="node_scores">评分: {{ n.res.scores }}</view>
|
|
<view class="node_risk" style="background-color: {{ n.riskBgColor }};">{{ n.riskStr }}</view>
|
|
<view class="node_remark">{{ n.remark }}</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
|
|
<!-- 个性化界面 -->
|
|
<view id="page_style" class="miao_page">
|
|
<view class="title">
|
|
<view>个性化</view>
|
|
<view class="page_back" bind:tap="exit_style">
|
|
<image src="./static/icons/back_black.svg" mode="aspectFit" />
|
|
</view>
|
|
</view>
|
|
<view class="content">
|
|
<view wx:for="{{style_lib}}" wx:for-item="n" wx:for-index="index" class="choose_color" bind:tap="set_miaoStyle" data-index="{{index}}">
|
|
<view class="node" style="background-color: {{n.style.main}};"></view>
|
|
<view class="node" style="background-color: {{n.style.tertiary}};"></view>
|
|
<view class="node" style="background-color: {{n.style.secondary}};"></view>
|
|
<!-- {{ n.style.main }} -->
|
|
</view>
|
|
</view>
|
|
</view>
|
|
|
|
<!-- 透明遮罩 -->
|
|
<view id="curtain" hidden="{{curtain_hidden}}"></view>
|
|
|
|
<!-- 查询结果页面 -->
|
|
<view id="page_result">
|
|
<view class="title">
|
|
<view>{{resultTitle}}</view>
|
|
<view class="page_back" bind:tap="exit_result">
|
|
<image src="./static/icons/back_black.svg" mode="aspectFit" />
|
|
</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 class="content">
|
|
<!-- 丑出天际 -->
|
|
<view class="result_isSafe" style="background-color: {{ data_resultPage.circleColor }}">
|
|
<view hidden="{{ !(data_resultPage.scores < 33) }}">差</view>
|
|
<view hidden="{{ !(data_resultPage.scores >= 33 && data_resultPage.scores < 66) }}">良</view>
|
|
<view hidden="{{ !(data_resultPage.scores >= 66) }}" style="color:rgb(241, 255, 250)">优</view>
|
|
</view>
|
|
<!-- 我就知道GPT写不出来 -->
|
|
<view class="result_circle">
|
|
<view class="circle" style="clip-path:{{ data_resultPage.circleClip }}; border:13px solid {{ data_resultPage.circleColor }}"></view>
|
|
<view class="scores">{{data_resultPage.scores}}</view>
|
|
</view>
|
|
<view class="result_content">
|
|
<view class="search lib_search">
|
|
<view class="search_bar lib_search_input">
|
|
<view class="search_icon">
|
|
<image src="./static/icons/search.svg" mode="aspectFit" />
|
|
</view>
|
|
<input class="search_input" bindinput="readInput_result" placeholder=" 输入中/英文名称搜索"/>
|
|
</view>
|
|
<!-- <view class="search_button" bind:tap="readInput_lib">搜索</view> -->
|
|
</view>
|
|
<view wx:for="{{ data_resultPage.arr }}" wx:for-item="n">
|
|
<view class="ingredient_card" hidden="{{ hidden_result[n.name.zh] }}" style="background-color: {{ n.riskBgColor }};">
|
|
<view class="node_content">
|
|
<view class="node_name">{{ n.name.zh }}</view>
|
|
<view class="node_name node_name_en">{{ n.name.en }}</view>
|
|
|
|
<view class="node_adi">
|
|
<view class="adi_title">ADI</view>
|
|
<view class="adi_content" wx:if="{{ n.ADI!='' }}">{{ n.ADI }}</view>
|
|
<view class="adi_content" wx:if="{{ n.ADI=='' }}">{{ "暂无数据" }}</view>
|
|
</view>
|
|
<!-- <image class="node_img" src="{{ n.imgUrl }}" mode="'aspectFit'"/> -->
|
|
<view class="node_safe" wx:if="{{ n.scores > 66 }}"><view>安全</view></view>
|
|
<view class="node_danger" wx:if="{{ n.scores < 33 }}"><view>危险</view></view>
|
|
<view class="node_scores">
|
|
<view class="scores_title" style="background-color: {{ n.riskBgColor }};">评分</view>
|
|
<view class="scores_num">{{ n.scores }}</view>
|
|
</view>
|
|
<view class="node_risk" style="background-color: {{ n.riskBgColor }};">{{ n.riskStr }}</view>
|
|
<view class="node_extra">
|
|
<view class="node_extra_empty" wx:if="{{ n.extra.length==0 }}">
|
|
暂无数据
|
|
</view>
|
|
<view wx:for="{{n.extra}}" wx:for-item="item">
|
|
<view class="node_ex_content" style="background-color: {{ item.type=='unsafe'?'tomato':'springgreen' }};">{{item.name}}</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</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="7"/>
|
|
</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="7"/>
|
|
</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="testButtom2" bind:tap="updateHistory">测试更新历史记录</view>
|
|
<view class="testButtom" bind:tap="testfunction">测试获取</view> -->
|
|
</view> |