更新小程序仓库
This commit is contained in:
@@ -0,0 +1,128 @@
|
||||
// pages/commonSick/commonSick.js
|
||||
import {sickList,hotSickList} from "../../api/common"
|
||||
const app=getApp();
|
||||
Page({
|
||||
|
||||
/**
|
||||
* 页面的初始数据
|
||||
*/
|
||||
data: {
|
||||
list:[],
|
||||
showKeyboard:false,
|
||||
isSearch:false,
|
||||
commonList:[],
|
||||
img_host:'https://oss.prod.applets.igandanyiyuan.com/applet/patient/static',
|
||||
keyWord:''
|
||||
},
|
||||
getSick() {
|
||||
let { keyWord }=this.data;
|
||||
sickList({
|
||||
disease_class_name:keyWord
|
||||
}).then((data) => {
|
||||
this.setData({
|
||||
list: data
|
||||
})
|
||||
})
|
||||
},
|
||||
gethotSickList(){
|
||||
hotSickList().then(data=>{
|
||||
this.setData({
|
||||
commonList:data
|
||||
})
|
||||
})
|
||||
},
|
||||
onfoucs(){
|
||||
this.setData({
|
||||
showKeyboard:true,
|
||||
})
|
||||
},
|
||||
goSearch(event){
|
||||
this.setData({
|
||||
keyWord:event.detail.value,
|
||||
isSearch:true,
|
||||
})
|
||||
this.getSick()
|
||||
},
|
||||
changeIpt(event){
|
||||
this.setData({
|
||||
keyWord:event.detail.value,
|
||||
})
|
||||
},
|
||||
handleSearch(){
|
||||
console.log(111);
|
||||
this.setData({
|
||||
isSearch:true,
|
||||
})
|
||||
this.getSick()
|
||||
},
|
||||
confirmBack(event){
|
||||
let {id,name}=event.currentTarget.dataset;
|
||||
let pages = getCurrentPages();
|
||||
let prevPage = pages[pages.length - 2]; //上一页
|
||||
prevPage.setData({
|
||||
prevData:{
|
||||
disease_class_name:name,
|
||||
disease_class_id:id
|
||||
}
|
||||
});
|
||||
wx.navigateBack({
|
||||
delta: 1,
|
||||
})
|
||||
},
|
||||
/**
|
||||
* 生命周期函数--监听页面加载
|
||||
*/
|
||||
onLoad(options) {
|
||||
this.gethotSickList();
|
||||
//this.getSick()
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面初次渲染完成
|
||||
*/
|
||||
onReady() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面显示
|
||||
*/
|
||||
onShow() {
|
||||
this.setData({
|
||||
img_host:app.hostConfig().imghost
|
||||
})
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面隐藏
|
||||
*/
|
||||
onHide() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面卸载
|
||||
*/
|
||||
onUnload() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 页面相关事件处理函数--监听用户下拉动作
|
||||
*/
|
||||
onPullDownRefresh() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 页面上拉触底事件的处理函数
|
||||
*/
|
||||
onReachBottom() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 用户点击右上角分享
|
||||
*/
|
||||
|
||||
})
|
||||
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"usingComponents": {
|
||||
"nav":"../../components/nav/nav"
|
||||
},
|
||||
"navigationStyle":"custom",
|
||||
"navigationBarTitleText": "肝胆相照互联网医院"
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
<!--pages/commonSick/commonSick.wxml-->
|
||||
<nav navName="选择常见疾病"></nav>
|
||||
<view class="page">
|
||||
<view class="searchbox">
|
||||
<input type="text" value="{{keyWord}}" placeholder="请输入所患疾病名称" bindconfirm="goSearch" placeholder-class="searchIpt" bindinput="changeIpt" bindfocus="onfoucs" confirm-type="search">
|
||||
<keyboard-accessory >
|
||||
<cover-view class="keycontainer">
|
||||
<cover-view class="text">常见疾病:</cover-view>
|
||||
<cover-view class="cell" bindtap="confirmBack" wx:for="{{commonList}}" wx:key="disease_class_id" data-id="{{item.disease_class_id}}" data-name="{{item.disease_class_name}}">{{item.disease_class_name}}</cover-view>
|
||||
</cover-view>
|
||||
</keyboard-accessory>
|
||||
</input>
|
||||
<image src="{{img_host+'/greenss.png'}}" bindtap="handleSearch"></image>
|
||||
</view>
|
||||
<view class="listbox" wx:if="{{list.length>0}}">
|
||||
<view class="cell" wx:for="{{list}}" bindtap="confirmBack" wx:key="disease_class_id" data-id="{{item.disease_class_id}}" data-name="{{item.disease_class_name}}">{{item.disease_class_name}}</view>
|
||||
</view>
|
||||
<view class="nonedata" wx:elif="{{list.length==0 && isSearch}}">暂无数据!</view>
|
||||
|
||||
</view>
|
||||
@@ -0,0 +1,78 @@
|
||||
/* pages/commonSick/commonSick.wxss */
|
||||
.page{
|
||||
background: #fff;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
.searchbox {
|
||||
|
||||
margin:30rpx 30rpx 0;
|
||||
height: 72rpx;
|
||||
display: flex;
|
||||
border-radius: 40rpx;
|
||||
align-items: center;
|
||||
margin-top: 192rpx;
|
||||
background: #FBFBFB;
|
||||
border-radius: 36px;
|
||||
border: 1rpx solid #3CC7C0;
|
||||
}
|
||||
.searchIpt{
|
||||
font-size: 28rpx;
|
||||
font-weight: 400;
|
||||
color: #999999;
|
||||
}
|
||||
.searchbox input {
|
||||
margin-left: 30rpx;
|
||||
flex: 1;
|
||||
font-size: 32rpx;
|
||||
height: 80rpx;
|
||||
}
|
||||
.searchbox image {
|
||||
width: 30rpx;
|
||||
height: 30rpx;
|
||||
padding:30rpx;
|
||||
}
|
||||
.listbox{
|
||||
flex:1;
|
||||
overflow: scroll;
|
||||
color:#333;
|
||||
-webkit-overflow-scrolling: touch;
|
||||
margin:30rpx 30rpx 0;
|
||||
}
|
||||
.listbox .cell{
|
||||
text-indent:10rpx;
|
||||
line-height: 75rpx;
|
||||
font-size: 28rpx;
|
||||
border-bottom: 1px solid #E3E4E5;
|
||||
}
|
||||
.keycontainer{
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
|
||||
}
|
||||
.keycontainer {
|
||||
padding: 27rpx 24rpx 27rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
background: #FBFBFB;
|
||||
box-shadow: 0rpx 0rpx 10rpx 0rpx rgba(153,153,153,0.5);
|
||||
}
|
||||
.keycontainer .text{
|
||||
color: #333333;
|
||||
font-size: 34rpx;
|
||||
margin-bottom: 18rpx;
|
||||
}
|
||||
.keycontainer .cell{
|
||||
height: 60rpx;
|
||||
background: #F4F4F4;
|
||||
padding:0 14rpx;
|
||||
margin-bottom: 18rpx;
|
||||
display: flex;
|
||||
font-size: 28rpx;
|
||||
color: #666666;
|
||||
align-items: center;
|
||||
line-height: 60rpx;
|
||||
justify-content: center;
|
||||
border-radius: 30rpx;
|
||||
margin-left: 14rpx;
|
||||
}
|
||||
Reference in New Issue
Block a user