123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108 |
- import * as WxJsApi from '@/utils/wxJsApi.js'
- import * as API from '@/apis/index.js'
- export default {
- data() {
- return {
- btn:{
- color: '#1677FF'
- },
- getPointBl:false,//是否定位完成
- longitude: '',
- latitude: '',
- list: [{
- image: 'https://cdn.uviewui.com/uview/swiper/1.jpg',
- title: '昨夜星辰昨夜风,画楼西畔桂堂东',
- url:"/pages/buytickets/index?id=0cb4dd6c-ca33-4837-bd4a-7f01afb4d1a3"
- },
- {
- image: 'https://cdn.uviewui.com/uview/swiper/2.jpg',
- title: '身无彩凤双飞翼,心有灵犀一点通',
- url:"/pages/buytickets/index?id=0cb4dd6c-ca33-4837-bd4a-7f01afb4d1a3"
- },
- {
- image: 'https://cdn.uviewui.com/uview/swiper/3.jpg',
- title: '谁念西风独自凉,萧萧黄叶闭疏窗,沉思往事立残阳',
- url:"/pages/buytickets/index?id=0cb4dd6c-ca33-4837-bd4a-7f01afb4d1a3"
- }
- ],
- siteList:[
- ]
- }
- },
- onLoad(){
-
- },
- methods: {
- gotoQuery(){
- uni.navigateTo({
- url:'/pages/query/index'
- })
- },
- gotoLine(item){
- uni.navigateTo({
- url:'/pages/buytickets/selectSite?id='+item.id
- })
- },
- getPoint() {
-
- this.$refs.common.alert("定位中...");
- WxJsApi.getLocation().then((res) => {
-
- var latitude = parseFloat(res.latitude);
- var longitude = parseFloat(res.longitude);
-
- this.latitude = latitude;
- this.longitude = longitude;
- this.passengerNearbyStation();
- this.getPointBl=true
-
- }).catch(error => {
- this.$refs.common.alert( error);
-
- })
- },
- passengerNearbyStation(){
- this.latitude = '30.284867';
- this.longitude = '112.291269';
-
- var form={
- longitude:this.longitude,
- latitude:this.latitude,
- pageIndex:1,
- pageSize:5
- }
- API.passengerNearbyStation(form).then((res) => {
- this.siteList=res.data;
- }).catch(error => {
- this.$refs.common.alert( error);
- })
- },
- getScan(){
- WxJsApi.scanQRCode(0).then(function(url){
- console.log(url)
- window.location.href=url;
- });
- },
- clickSwiper(index){
- var url=this.list[index].url;
- if(url){
- if(url.indexOf("http")==0){
- window.location.href=url;
- }else if(url.indexOf("/pages/")==0){
- uni.navigateTo({
- url:this.list[index].url
- })
- }
- }
- },
- closeDropdown() {
- this.$refs.uDropdown.close();
- }
- },onReady(){
- WxJsApi.getWxConfig(['scanQRCode','getLocation']);
- this.getPoint();
- //清空缓存
- this.carhelp.set("form",{});
- }
- }
|