1 |
- <view class="container"><view class="search-container"><view class="search-box"><image class="search-icon" src="/static/icons/search.png" mode="aspectFit"></image><input class="search-input" type="text" placeholder="请输入药品名称或症状" data-event-opts="{{[['input',[['__set_model',['','searchKeyword','$event',[]]],['handleInput',['$event']]]],['confirm',[['searchMedicine',['$event']]]]]}}" value="{{searchKeyword}}" bindinput="__e" bindconfirm="__e"/><image class="voice-icon" src="/static/icons/voice.png" mode="aspectFit" data-event-opts="{{[['tap',[['startVoiceSearch',['$event']]]]]}}" bindtap="__e"></image></view><view data-event-opts="{{[['tap',[['searchMedicine',['$event']]]]]}}" class="search-btn" bindtap="__e">搜索</view></view><view class="hot-search"><text class="hot-title">热门搜索</text><view class="hot-tags"><view data-event-opts="{{[['tap',[['selectHotTag',['感冒']]]]]}}" class="tag" bindtap="__e">感冒</view><view data-event-opts="{{[['tap',[['selectHotTag',['退烧药']]]]]}}" class="tag" bindtap="__e">退烧药</view><view data-event-opts="{{[['tap',[['selectHotTag',['胃药']]]]]}}" class="tag" bindtap="__e">胃药</view><view data-event-opts="{{[['tap',[['selectHotTag',['消炎药']]]]]}}" class="tag" bindtap="__e">消炎药</view><view data-event-opts="{{[['tap',[['selectHotTag',['降压药']]]]]}}" class="tag" bindtap="__e">降压药</view></view></view><view class="category-container"><text class="category-title">药品分类</text><scroll-view class="category-scroll" scroll-x="true"><block wx:for="{{categories}}" wx:for-item="category" wx:for-index="index" wx:key="index"><view data-event-opts="{{[['tap',[['changeCategory',[index]]]]]}}" class="{{['category-item',(activeCategory===index)?'active':'']}}" bindtap="__e"><view class="category-icon"></view><text>{{category.name}}</text></view></block></scroll-view></view><view class="medicine-list"><view class="list-header"><text class="list-title">推荐药品</text><text data-event-opts="{{[['tap',[['viewAllMedicine',['$event']]]]]}}" class="view-all" bindtap="__e">查看全部</text></view><view class="medicine-cards"><block wx:for="{{medicineList}}" wx:for-item="medicine" wx:for-index="index" wx:key="index"><view data-event-opts="{{[['tap',[['goToMedicineDetail',['$0'],[[['medicineList','',index,'id']]]]]]]}}" class="medicine-card" bindtap="__e"><view class="card-image"><image src="{{medicine.image}}" mode="aspectFit"></image><block wx:if="{{medicine.badge}}"><view class="badge">{{medicine.badge}}</view></block></view><view class="card-content"><text class="card-title">{{medicine.name}}</text><text class="card-subtitle">{{medicine.brand}}</text><view class="card-info"><text class="card-price">{{"¥"+medicine.price}}</text><text class="card-rating"><image src="/static/icons/star.png" mode="aspectFit"></image>{{''+medicine.rating+''}}</text></view></view></view></block></view></view><view hidden="{{!(showSearchResults)}}" class="search-results"><view class="result-header"><text class="result-count">{{"找到 "+$root.g0+" 个结果"}}</text><text data-event-opts="{{[['tap',[['closeSearchResults',['$event']]]]]}}" class="close-results" bindtap="__e">关闭</text></view><view class="result-list"><block wx:for="{{searchResults}}" wx:for-item="result" wx:for-index="index" wx:key="index"><view data-event-opts="{{[['tap',[['goToMedicineDetail',['$0'],[[['searchResults','',index,'id']]]]]]]}}" class="result-item" bindtap="__e"><image class="result-image" src="{{result.image}}" mode="aspectFit"></image><view class="result-content"><text class="result-title">{{result.name}}</text><text class="result-subtitle">{{result.brand}}</text><text class="result-price">{{"¥"+result.price}}</text></view></view></block></view></view><view hidden="{{!(showVoiceDialog)}}" class="voice-dialog"><view data-event-opts="{{[['tap',[['closeVoiceDialog',['$event']]]]]}}" class="dialog-mask" bindtap="__e"></view><view class="dialog-content"><text class="dialog-title">语音搜索</text><view class="voice-icon-container"><image class="voice-mic" src="/static/icons/mic.png" mode="aspectFit"></image></view><text class="dialog-text">{{voiceText}}</text><view class="dialog-buttons"><view data-event-opts="{{[['tap',[['closeVoiceDialog',['$event']]]]]}}" class="cancel-btn" bindtap="__e">取消</view><view data-event-opts="{{[['tap',[['confirmVoiceSearch',['$event']]]]]}}" class="confirm-btn" bindtap="__e">搜索</view></view></view></view></view>
|