协力抗疫,码力 全开”线上黑客马拉松+9+疫同程+疫同

项目名称

疫同

项目介绍

疫同,一款寻找新型冠状病毒感染的肺炎确诊患者同行程的系统。集成确诊同程线索发布、信息审核、同乘查询以及自主上报功能,从发布到上报形成一套闭环,做到疫情的防控的作用。

实现思路

1.用户上传确诊患者所乘坐过的行程线索,提交form表单

db.collection('Clue').add({ }) //云数据库增加表单

2.首页使用db.RegExp模糊查找数据,并使用.skip()进行分页加载

db.collection("busData").where(
      _.or([{
          t_no: db.RegExp({
            regexp: data.t_no,
            options: 'i',
          }),
          t_date: db.RegExp({
            regexp: this.data.date,
            options: 'i',
          }),
          t_pos_start: db.RegExp({
            regexp: data.t_city,
            options: 'i',
          }),

        },
        {
          t_no: db.RegExp({
            regexp: data.t_no,
            options: 'i',
          }),
          t_date: db.RegExp({
            regexp: this.data.date,
            options: 'i',
          }),
          t_pos_end: db.RegExp({
            regexp: data.t_city,
            options: 'i',
          }),
        }
      ])
    ).skip(this.data.page).get({
      success: res => {
        wx.hideLoading();
        if (res.data.length == 0){
          wx.showToast({
            icon: 'none',
            title: '暂无数据'
          })
        }else{
          this.setData({
            queryResult: res.data,
            page: this.data.page + 20
          })
        }
      },
      fail: err => {
        wx.hideLoading();
        wx.showToast({
          icon: 'none',
          title: '暂无数据'
        })
      }
    })

前端使用wx:for列表渲染和wx:if条件渲染数据

<view class="busList">
  <view wx:for="{{queryResult}}" wx:key="item" class="listBox" id="{{item._id}}" bindtap="goTotrip">
    <view class="boxListOne">
      <view class="t_no">
        <view wx:if="{{item.t_type == 1}}" class="t_type"> 飞机:</view>
        <view wx:if="{{item.t_type == 2}}" class="t_type"> 火车:</view>
        <view wx:if="{{item.t_type == 3}}" class="t_type"> 地铁:</view>
        <view wx:if="{{item.t_type == 4}}" class="t_type"> 大巴:</view>
        <view wx:if="{{item.t_type == 5}}" class="t_type"> 公交车:</view>
        <view wx:if="{{item.t_type == 6}}" class="t_type"> 出租车:</view>
        <view wx:if="{{item.t_type == 7}}" class="t_type"> 轮船:</view>
        <view wx:if="{{item.t_type == 8}}" class="t_type"> 公共场所:</view>
        {{item.t_no}}
      </view>
      <view class="t_date">{{item.t_date}}</view>
    </view>
    <view wx:if="{{item.t_pos_start.length > 0}}">
      <view class="t_pos_start">{{item.t_pos_start}}</view>
      =>
      <view class="t_pos_end">{{item.t_pos_end}}</view>
    </view>
    <view class="t_no_sub">{{item.t_no_sub}}</view>
    <view class="t_memo">{{item.t_memo}}</view>
    <view id="{{index}}" bindtap="copyLink" class="who">消息来源:{{item.who}}</view>
  </view>
</view>

3.项目数据使用“2019ncov.nosugartech.com”的数据接口和小程序中用户说上传并核实的线索作为支撑。

错误数据反馈:xunren@pdnews.cn, nearpost@qq.com, gainover@qq.com

若各地官方机构希望增补行程数据、寻人信息,可联系xunren@pdnews.cn

项目截图

项目主页
项目分页

代码链接

https://gitee.com/tysb7/tcb-hackthon-YT

视频演示

视频内容
本站文章资源均来源自网络,除非特别声明,否则均不代表站方观点,并仅供查阅,不作为任何参考依据!
如有侵权请及时跟我们联系,本站将及时删除!
如遇版权问题,请查看 本站版权声明
THE END
分享
二维码
海报
协力抗疫,码力 全开”线上黑客马拉松+9+疫同程+疫同
疫同,一款寻找新型冠状病毒感染的肺炎确诊患者同行程的系统。集成确诊同程线索发布、信息审核、同乘查询以及自主上报功能,从发布到上报形成一套闭环,做到疫情的防控的作...
<<上一篇
下一篇>>