123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838 |
- <template>
- <view class="border">
- <view class="header">
- </view>
- <view class="toast" v-show="isShow">
- <view class="toast-list">
- <view class="list-left">
- <view v-for="(item,index) in Province" :key='index' @click="changProvince(index,item)">
- <view class="name" :class="curPage==index ? 'active':''">
- {{item.name}}
- </view>
- </view>
- </view>
- <view class="list-right">
- <view v-for="(item, index1) in City" :key='index1' @click="changCity(index1,item)">
- <view class="name" :class="Page==index1 ? 'active':''">
- {{item.name}}
- </view>
- </view>
- </view>
- </view>
- <view class="cha" @click="close">
- <image src="../../static/img/cha.png" mode=""></image>
- </view>
- </view>
- <view class="select">
- <view class="setcity" @click="searchSetCity">
- <view class="title">
- 出发城市
- </view>
- <view class="city">
- {{setName}}
- <image src="../../static/img/down.png" mode=""></image>
- </view>
- </view>
- <view class="change" @click="changeCity">
- <image src="../../static/img/change.png" mode=""></image>
- </view>
- <view class="reachcity" @click="searchReachCity">
- <view class="title">
- 到达城市
- </view>
- <view class="city">
- {{reachName}}
- <image src="../../static/img/down.png" mode=""></image>
- </view>
- </view>
- </view>
- <view class="content">
- <view class="set">
- <view class="text">
- <image src="../../static/img/icon2.png" mode=""></image>
- <view class="text1">
- 出发地:{{setName}}
- </view>
- <view class="text2" v-if="setpoilist.high_num!=0 && setpoilist.high_num">
- 高风险地区
- <view class="num1">
- {{setpoilist.high_num}}
- </view>
- </view>
- <view class="text3" v-if="setpoilist.middle_num!=0 && setpoilist.middle_num">
- 中风险地区
- <view class="num2">
- {{setpoilist.middle_num}}
- </view>
- </view>
- </view>
- <view class="source">
- <text>数据来源:当地卫健委</text><text style="margin: 0 10upx;">|</text><text>发布时间:{{setPolicy.leave_policy_date}}</text>
- </view>
- <view class="conter">
- <p v-for="(item,index2) in setPolicy.leave_policy_list" :key='index2'>
- {{item}}
- </p>
- </view>
- </view>
- <view class="reach">
- <view class="text">
- <image src="../../static/img/icon1.png" mode=""></image>
- <view class="text1">
- 目的地:{{reachName}}
- </view>
- <view class="text2" v-if="reachpoilist.high_num && reachpoilist.high_num!=0">
- 高风险地区
- <view class="num1">
- {{reachpoilist.high_num}}
- </view>
- </view>
- <view class="text3" v-if="reachpoilist.middle_num && reachpoilist.middle_num!=0">
- 中风险地区
- <view class="num2">
- {{reachpoilist.middle_num}}
- </view>
- </view>
- </view>
- <view class="source">
- <text>数据来源:当地卫健委</text><text style="margin: 0 10upx;">|</text><text>发布时间:{{reachPolicy.back_policy_date}}</text>
- </view>
- <view class="conter">
- <p v-for="(item,index2) in reachPolicy.back_policy_list" :key='index2'>
- {{item}}
- </p>
- </view>
- </view>
- </view>
- <view class="bottom-bt">
- <view class="left" @click="shareImage">
- 分享
- </view>
- <view class="right" @click="feedBack">
- 信息反馈
- </view>
- </view>
- </view>
- </template>
- <script>
- import jcAddressPicker from '@/components/easy-select/easy-select.vue'
- export default {
- data() {
- return {
- Page: 0,
- curPage: 0,
- isShow: false,
- setProvinceCode: '', //出发地省份索引
- reachProvinceCode: '', //目的地省份索引
- setCityCode: '', //出发地省份索引
- reachCityCode: '', //目的地省份索引
- Province: '', //省份
- City: '', //城市
- setName: "请选择", //出发城市名称
- reachName: "请选择", //到达城市名称
- status: '', //判断当前为出发地还是目的地0出发,1目的
- index: 0,
- index1: 0,
- setPolicy: "",
- reachPolicy: "",
- setName1: "",
- reachpoilist: "",
- setpoilist: '',
- City1:''
- }
- },
- onLoad() {
-
- var that = this
- uni.showLoading({})
- uni.request({
- url: 'http://epidemic.site.ximengnaikang.com/api/v1/area/provinces', //仅为示例,并非真实接口地址。
- method: 'GET',
- success: (res) => {
- if (res.data.code == 200) {
- console.log(res.data.data)
- this.Province = res.data.data
- this.setProvinceCode = res.data.data[0].code
- this.reachProvinceCode = res.data.data[0].code
- uni.request({
- url: 'http://epidemic.site.ximengnaikang.com/api/v1/area/provinces/' + this.setProvinceCode, //仅为示例,并非真实接口地址。
- method: 'GET',
- success: (res) => {
- if (res.data.code == 200) {
- console.log(res, 'res')
- this.City = res.data.data
- this.City1=res.data.data
- uni.request({
- url: 'http://epidemic.site.ximengnaikang.com/api/v1/city/policy', //仅为示例,并非真实接口地址。
- method: 'POST',
- data: {
- city_code: this.City[0].code
- },
- success: (res) => {
- uni.hideLoading()
- if (res.data.code == 200) {
- this.setCityCode = this.City[0].code
- this.reachCityCode = this.City[0].code
- console.log(res.data.data)
- this.setName = this.City[0].name
- this.reachName = this.City[0].name
- this.setPolicy = res.data.data
- this.reachPolicy = res.data.data
- this.reachpoilist = res.data.data.poi_list
- that.setpoilist = res.data.data.poi_list
- uni.setStorageSync('setCity', this.setName)
- uni.setStorageSync('reachCity', this.reachName)
- uni.setStorageSync('policy', res.data.data.back_policy_list)
- } else {
- uni.showToast({
- title: res.data.message,
- icon: 'none'
- })
- }
- }
- })
- } else {
- uni.showToast({
- title: res.data.message,
- icon: 'none'
- })
- }
- }
- })
-
- } else {
- uni.showToast({
- title: res.data.message,
- icon: 'none'
- })
- }
- }
- })
- var ua = window.navigator.userAgent.toLowerCase();
- if (ua.match(/MicroMessenger/i) == 'micromessenger') {
- //自定义分享
- const script = document.createElement('script')
- script.style = 'text/javascript';
- script.src = 'http://res.wx.qq.com/open/js/jweixin-1.6.0.js';
- const script1 = document.createElement('script1')
- script1.style = 'text/javascript';
- script1.src = 'http://map.qq.com/api/js?v=2.exp';
- document.getElementsByTagName('head')[0].appendChild(script);
- script.onload = () => {
- uni.request({
- url: 'http://epidemic.site.ximengnaikang.com/api/v1/wechat/share',
- method: 'POST',
- data: {
- url: 'http://h5.epidemic.site.ximengnaikang.com/#/',
- apis: 'updateAppMessageShareData,getLocation'
- },
- success: (res) => {
- wx.config({
- debug: false, // 开启调试模式,调用的所有api的返回值会在客户端alert出来,若要查看传入的参数,可以在pc端打开,参数信息会通过log打出,仅在pc端时才会打印。
- appId: res.data.data.appId, // 必填,公众号的唯一标识
- timestamp: res.data.data.timestamp, // 必填,生成签名的时间戳
- nonceStr: res.data.data.nonceStr, // 必填,生成签名的随机串
- signature: res.data.data.signature, // 必填,签名
- jsApiList: res.data.data.jsApiList // 必填,需要使用的JS接口列表
- })
- setTimeout(function() {
- wx.ready(function() { //需在用户可能点击分享按钮前就先调用
- wx.updateAppMessageShareData({
- title: '疫情隔离政策查询', // 分享标题
- desc: '足不出户即可查询,隔离政策最新情况信息', // 分享描述
- link: location.href, // 分享链接,该链接域名或路径必须与当前页面对应的公众号JS安全域名一致
- imgUrl: 'https://resource.bike.hanyiyun.com/index.jpg', // 分享图标网络图片
- success: function() {
- // 设置成功
- }
- })
- });
- }, 1000)
- // uni.showLoading({
- // title:"位置加载中",
- // })
-
- wx.ready(function() {
- wx.getLocation({
- type: 'wgs84', // 默认为wgs84的gps坐标,如果要返回直接给openLocation用的火星坐标,可传入'gcj02'
- success: function(res) {
- var latitude = res.latitude; // 纬度,浮点数,范围为90 ~ -90
- var longitude = res.longitude; // 经度,浮点数,范围为180 ~ -180。
- var speed = res.speed; // 速度,以米/每秒计
- var accuracy = res.accuracy; // 位置精度
- console.log('89898')
-
- uni.request({
- url: 'http://epidemic.site.ximengnaikang.com/api/v1/area/location2CityCode', //仅为示例,并非真实接口地址。
- method: 'POST',
- data: {
- lat: latitude,
- lng: longitude
- },
- success: (res) => {
- if (res.data.code == 200) {
- console.log(res, '地址解析')
- var date = res.data.data
- uni.request({
- url: 'http://epidemic.site.ximengnaikang.com/api/v1/city/policy', //仅为示例,并非真实接口地址。
- method: 'POST',
- data: {
- city_code: date.code
- },
- success: (res) => {
- // uni.hideLoading()
- if (res.data.code == 200) {
- // uni.hideLoading()
- // this.setName='郑州市1'
- that.setCityCode = date.code
- // this.reachCityCode = this.City[0].code
- console.log(res.data.data)
- that.setName = res.data.data.city
- console.log(that, 'that')
- // that.$set(that,'setName',res.data.data.city)
-
- // this.setName='郑州市'
- console.log(that.setName, 'this.setName')
- // this.reachName = this.City[0].name
- that.setPolicy = res.data.data
- that.setpoilist = res.data.data.poi_list
- // this.reachPolicy = res.data.data
- uni.setStorageSync('setCity', that.setName)
- // uni.setStorageSync('reachCity', this.reachName)
- // uni.setStorageSync('policy', res.data.data.back_policy_list)
- } else {
- uni.showToast({
- title: res.data.message,
- icon: 'none'
- })
- }
-
-
- }
- })
- } else {
- uni.showToast({
- title: res.data.message,
- icon: 'none'
- })
- }
- }
- })
-
- },
- })
- })
-
- },
- })
- }
-
- }
-
- },
- methods: {
- //出发地搜索
- searchSetCity: function() {
- this.City=this.City1
- this.curPage = 0
- this.Page = 0
- this.isShow = true
- this.status = 0
- },
- //目的地搜索
- searchReachCity: function() {
- this.isShow = true
- this.City=this.City1
- this.curPage = 0
- this.Page = 0
- this.status = 1
- },
- //关闭遮罩层
- close: function() {
- this.isShow = false
- },
- changProvince: function(index, e) {
- uni.showLoading()
- var result = e
- this.curPage = index
- uni.request({
- url: 'http://epidemic.site.ximengnaikang.com/api/v1/area/provinces/' + result.code, //仅为示例,并非真实接口地址。
- method: 'GET',
- success: (res) => {
- uni.hideLoading()
- if (res.data.code == 200) {
- console.log(res, 'res1')
- this.City = res.data.data
- } else {
- uni.showToast({
- title: res.data.message,
- icon: "none"
- })
- }
- }
- })
- },
- //修改城市
- changCity: function(index1, item) {
- this.isShow = false
- uni.showLoading()
- var city_code = item.code
- uni.request({
- url: 'http://epidemic.site.ximengnaikang.com/api/v1/city/policy', //仅为示例,并非真实接口地址。
- method: 'POST',
- data: {
- city_code: city_code
- },
- success: (res) => {
- uni.hideLoading()
- console.log(res, 'pppp')
- if (res.data.code == 200) {
- if (this.status == 0) {
- this.setCityCode = city_code
- this.setName = item.name
- this.setPolicy = res.data.data
- this.setpoilist = res.data.data.poi_list
- uni.setStorageSync('setCity', this.setName)
-
- } else if (this.status == 1) {
- this.reachName = item.name
- this.reachCityCode = city_code
- this.reachPolicy = res.data.data
- this.reachpoilist = res.data.data.poi_list
- uni.setStorageSync('setCity', this.setName)
- uni.setStorageSync('reachCity', this.reachName)
- uni.setStorageSync('policy', res.data.data.back_policy_list)
- }
-
- } else {
- uni.showToast({
- title: res.data.message,
- icon: "none"
- })
- }
- }
- })
- },
- //修改出发地和目的地
- changeCity: function() {
- // uni.showLoading()
- var setname = this.setName
- var reachname = this.reachName
- this.setName = reachname
- this.reachName = setname
- var setCityCode = this.setCityCode
- var reachCityCode = this.reachCityCode
- console.log(this.setCityCode, 'this.setCityCode')
- console.log(this.reachCityCode, 'this.reachCityCode')
- uni.request({
- url: 'http://epidemic.site.ximengnaikang.com/api/v1/city/policy', //仅为示例,并非真实接口地址。
- method: 'POST',
- data: {
- city_code: reachCityCode
- },
- success: (res) => {
- // uni.hideLoading()
- if (res.data.code == 200) {
- this.setCityCode = reachCityCode
- this.setPolicy = res.data.data
- this.setpoilist = res.data.data.poi_list
- uni.setStorageSync('setCity', this.setName)
- } else {
- uni.showToast({
- title: res.data.message,
- icon: "none"
- })
- }
- }
- })
- uni.request({
- url: 'http://epidemic.site.ximengnaikang.com/api/v1/city/policy', //仅为示例,并非真实接口地址。
- method: 'POST',
- data: {
- city_code: setCityCode
- },
- success: (res) => {
- if (res.data.code == 200) {
- this.reachCityCode = setCityCode
- this.reachPolicy = res.data.data
- this.reachpoilist = res.data.data.poi_list
- uni.setStorageSync('reachCity', this.reachName)
- uni.setStorageSync('policy', res.data.data.back_policy_list)
- } else {
- uni.showToast({
- title: res.data.message,
- icon: "none"
- })
- }
- }
- })
- },
- //信息反馈
- feedBack: function() {
- uni.navigateTo({
- url: './feedBack'
- })
- },
- //分享
- shareImage() {
- uni.navigateTo({
- url: './share'
- })
- },
- //关注公众号
- subscribe: function() {
- uni.navigateTo({
- url: './follow'
- })
- },
- },
- }
- </script>
- <style>
- page {
- height: 100vh;
- width: 100%;
- background-color: #f4f4f4;
- }
- .toast {
- position: fixed;
- top: 0;
- right: 0;
- background-color: rgba(0, 0, 0, 0.7);
- height: 100vh;
- z-index: 9999999999;
- width: 100%;
- }
- .toast-list {
- background-color: #FFFFFF;
- height: 75%;
- width: 90%;
- margin: 0 auto;
- margin-top: 25%;
- display: flex;
- border-radius: 15upx;
- overflow: hidden;
- /* padding: 20upx 0; */
- }
- .list-left {
- flex: 0 0 45%;
- font-size: 32upx;
- overflow-y: scroll;
- text-align: center;
- background-color: #f0f0f0;
- }
- .cha {
- margin: 0 auto;
- margin-top: 30upx;
- width: 100%;
- }
- .cha image {
- height: 60upx;
- width: 60upx;
- margin: 0 auto;
- display: block;
- }
- /* ::-webkit-scrollbar {
- display: none;
- } */
- .list-right {
- flex: 1;
- font-size: 32upx;
- overflow-y: scroll;
- /* height: 100upx; */
- overflow-y: scroll;
- line-height: 100upx;
- text-align: left;
- padding-left: 60upx;
- /* background-color: #23459D; */
- }
- .name {
- padding: 0 10upx;
- min-height: 100upx;
- line-height: 100upx;
- /* background-color: #f0f0f0; */
- /* padding: 20upx 30upx; */
- }
- .active {
- background-color: #FFFFFF;
- color: #23459D;
- }
- .province {
- background-color: #F7F7F7;
- margin: 0 10upx;
- text-align: center;
- background-image: url(../../static/img/down.png);
- background-repeat: no-repeat;
- background-size: 30upx;
- background-position: 95% center;
- }
- .province view {
- width: 85%;
- /* text-align: left; */
- word-break: keep-all;
- white-space: nowrap;
- overflow: hidden;
- text-overflow: ellipsis;
- white-space: nowrap;
- }
- .border {
- height: 100vh;
- /* position: relative; */
- }
- .header {
- width: 100%;
- height: 396upx;
- background-image: url(../../static/img/header6.png);
- background-size: 100% auto;
- background-repeat: no-repeat;
- }
- .header image {
- width: 100%;
- height: 198px;
- }
- .select {
- display: flex;
- padding: 30upx;
- width: 85%;
- margin: 0 auto;
- background-color: #FFFFFF;
- border-radius: 20upx;
- margin-top: -100upx;
- }
- .setcity,
-
- .reachcity {
- flex: 1;
- width: 100%;
- text-align: center;
- }
- .change{
- flex: 0 0 70upx;
- }
- .title {
- font-size: 28upx;
- height: 50upx;
- line-height: 50upx;
- color: #3B4144;
- text-align: center;
- }
- .city {
- font-size: 36upx;
- font-weight: bold;
- height: 70upx;
- line-height: 70upx;
- text-align: center;
- }
- .city image {
- height: 30upx;
- width: 30upx;
- display: inline-block;
- vertical-align: middle;
- margin-left: 10upx;
- }
- .change image {
- height: 60upx;
- width: 60upx;
- margin-top: 30upx;
- }
- .content {
- /* width: 85%; */
- margin: 0 auto;
- margin-top: 10upx;
- padding: 30upx;
- padding-bottom: 110upx;
- }
- .reach,
- .set {
- padding: 30upx;
- background-color: #FFFFFF;
- border-radius: 20upx;
- }
- .reach {
- margin-top: 30upx;
- }
- .text {
- height: 70upx;
- line-height: 70upx;
- }
- .text1,
- .text2,
- .text3 {
- display: inline-block;
- margin-right: 10upx;
- }
- .text image {
- height: 32upx;
- width: 30upx;
- margin-right: 10upx;
- display: inline-block;
- vertical-align: middle;
- }
- .text1 {
- font-size: 28upx;
- font-weight: bold;
- }
- .text2,
- .text3 {
- font-size: 20upx;
- height: 35upx;
- line-height: 35upx;
- padding-left: 5upx;
- border-radius: 10upx;
- text-align: center;
- }
- .num1,
- .num2 {
- width: 35upx;
- heigh: 35upx;
- display: inline-block;
- vertical-align: top;
- color: #FFFFFF;
- margin-left: 5upx;
- }
- .num1 {
- background-color: #ff6164;
- }
- .num2 {
- background-color: #ffa657;
- }
- .text2 {
- color: #ff6164;
- background-color: rgba(255, 97, 100, 0.1);
- border: solid 2upx #ff6164;
- }
- .text3 {
- color: #ffa657;
- background-color: rgba(255, 166, 87, 0.1);
- border: solid 2upx #ffa657;
- }
- .source {
- height: 50upx;
- line-height: 50upx;
- font-size: 24upx;
- color: #9f9d9e;
- }
- .conter {
- line-height: 42upx;
- font-size: 26upx;
- color: #4b4a4a;
- margin-top: 20upx;
- }
-
- .conter p{
- padding: 2upx 0 8upx 0;
- line-height: 40upx;
- /* color: #4b4a4a; */
- color: #666;
- font-size: 28upx;
- text-align:justify;
- }
- .tip {
- margin-top: 42upx;
- font-size: 26upx;
- font-weight: 400;
- line-height: 36upx;
- color: #999999;
- opacity: 1;
- }
- .bottom-bt {
- padding: 10upx 0;
- width: 100%;
- position: fixed;
- bottom: 0;
- height: 80upx;
- display: flex;
- background-color: #FFFFFF;
- z-index: 999;
- border-top: solid 4upx #EEEEEE;
- }
- .left,
- .right {
- flex: 0 0 30%;
- height: 80upx;
- line-height: 80upx;
- background-color: #23459D;
- color: #FFFFFF;
- font-size: 32upx;
- text-align: center;
- border-radius: 40upx;
- }
- .left {
- margin-left: 15%;
- margin-right: 5%;
- }
- .right {
- margin-left: 5%;
- margin-right: 15%;
- }
- </style>
|