137 lines
7.0 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!--pages/home/session/session.wxml-->
<view class="main">
<view class="header">
<view class="left">
<view class="type">
<text>{{ pageData.typeName ? pageData.typeName : '无分类 | ' }}</text>
<text class="type-code">{{ pageData.typeCode ? pageData.typeCode : 'xxx' }}</text>
</view>
<view>
<t-tag class="type-tag" wx:for="{{ pageData.tags }}" wx:key="index" wx:for-item="tag" variant="light" theme="warning">{{ tag }}</t-tag>
<!-- <t-tag class="type-tag" size="small" variant="light" theme="warning">反式脂肪酸</t-tag> -->
</view>
<view class="header-time">{{pageData.createTime}}</view>
</view>
<view class="right">
<t-icon class="header-icon" data-name="add-rectangle" name="add-rectangle" size="64rpx" bind:click="onAddImage" />
<t-badge count="{{pageData.images.length}}" color="#0052d9" offset="{{ [64, 8] }}">
<image class="header-image" wx:if="{{ pageData.images.length >= 1 }}" src="{{ pageData.images[0] }} " bindtap="onShowImages"></image>
</t-badge>
</view>
</view>
<view class="body">
<t-tabs defaultValue="{{0}}" space-evenly="{{false}}" bind:click="onTabsClick" sticky>
<t-tab-panel label="总览" value="{{ 0 }}">
<view class="total">
<view wx:if="{{pageData.sessionId != 0}}">
<view class="body-section">
<view class="body-row">
<text class="body-key">推荐指数:</text>
<view style="margin-left: 20px;">
<t-rate value="{{pageData.rate.level}}" icon="heart-filled" />
<view wx:if="{{pageData.rate.text != ''}}" :style="margin-top: 5px;">{{pageData.rate.text}}</view>
</view>
</view>
</view>
<view class="body-section">
<view class="body-row">
<text class="body-key">类别:</text>
<view>
<text class="body-value" wx:if="{{pageData.typeName}}">{{pageData.typeCode}} {{pageData.typeName}}</text>
<text class="body-value" wx:else>暂无分类</text>
</view>
</view>
<view class="body-row">
<text class="body-key">食品标准号:</text>
<view>
<text class="body-value" wx:if="{{pageData.standard}}">{{pageData.standard}}</text>
<text class="body-empty" wx:else>暂无数据</text>
</view>
</view>
<view class="body-row">
<text class="body-key">生产许可证:</text>
<view>
<text class="body-value" wx:if="{{pageData.licenseCode.length}}" wx:for="{{pageData.licenseCode}}" wx:key="index" wx:for-item="item">{{item}}</text>
<text class="body-empty" wx:if="{{pageData.licenseCode.length == 0}}">暂无数据</text>
</view>
</view>
</view>
<view class="body-section">
<view class="body-row" style="margin-bottom: 10px;">
<text class="body-key body-title">添加剂:</text>
<view>
<text class="body-value" wx:if="{{pageData.additives.count}}">{{pageData.additives.count}}</text>
<text wx:else>无添加</text>
</view>
</view>
<t-grid column="{{2}}" align="left">
<t-grid-item wx:for="{{pageData.additives.kinds}}" wx:key="index" wx:for-item="item">
<view class="body-additive-row" style="margin: 0;">
<text class="body-key">{{item.name}}</text>
<text class="body-value">{{item.count}}</text>
</view>
</t-grid-item>
</t-grid>
<!-- <view class="body-additive-row" wx:for="{{pageData.additives.kinds}}" wx:key="index" wx:for-item="item">
</view> -->
</view>
<view class="body-section">
<text class="body-key body-title">生产企业</text>
<view class="body-company">
<t-icon class="body-company-icon" data-name="home" name="home" size="48rpx" color="#0052d9" />
<view wx:for="{{pageData.company}}" wx:key="index" wx:for-item="item">
<text class="body-company-raw">{{item}}</text>
</view>
</view>
<view class="body-company">
<t-icon class="body-company-icon" data-name="location" name="location" size="48rpx" color="#0052d9" />
<view wx:for="{{pageData.address}}" wx:key="index" wx:for-item="item">
<text class="body-company-raw">{{item}}</text>
</view>
</view>
</view>
</view>
<view wx:if="{{pageData.sessionId == 0}}">
<t-skeleton theme="paragraph" loading="{{true}}" style="margin: 20px;"></t-skeleton>
<t-skeleton theme="paragraph" loading="{{true}}" style="margin: 20px;"></t-skeleton>
</view>
</view>
</t-tab-panel>
<t-tab-panel label="添加剂" value="{{ 1 }}">
<view wx:if="{{additives.length != 0}}" class="additive">
<view class="additive-item" wx:for="{{additives}}" wx:key="index" wx:for-item="item" data-additive="{{item.additiveId}}" bindtap="onGoAdditive">
<view class="additive-title">
<view class="additive-name">{{item.name}}</view>
<view>
<text class="additive-type" wx:for="{{item.types}}" wx:key="index" wx:for-item="tag">{{tag}}</text>
</view>
</view>
<view class="additive-standard">{{item.standard}}</view>
<view class="body-key" style="margin-bottom: 10px;" wx:if="{{item.chemicals.lenth != 0}}">所含元素:</view>
<view class="additive-chemical" wx:for="{{item.chemicals}}" wx:key="index" wx:for-item="chemical" data-chemical="{{chemical.id}}" bindtap="onGoChemical">
<view class="additive-chemical-left">
<view class="additive-chemical-name">{{chemical.name}}</view>
<view class="additive-chemical-cas">{{chemical.cas}}</view>
</view>
<view class="additive-chemical-right">
<view class="additive-chemical-right-tags"></view>
<view class="additive-chemical-right-icon">
<t-icon data-name="chevron-right-double" name="chevron-right-double" size="64rpx" />
</view>
</view>
</view>
</view>
</view>
<no-data wx:else></no-data>
</t-tab-panel>
<t-tab-panel label="相关标准" value="{{ 2 }}">
<no-data></no-data>
</t-tab-panel>
<t-tab-panel label="生产企业" value="{{ 3 }}">
<no-data></no-data>
</t-tab-panel>
</t-tabs>
</view>
</view>
<t-image-viewer closeBtn="{{true}}" showIndex="{{true}}" visible="{{visibleImages}}" images="{{pageData.images}}" bind:close="onCloseImages"></t-image-viewer>