1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374 |
- import * as WxJsApi from '@/utils/wxJsApi.js'
- import * as API from '@/apis/index.js'
- export default {
- data() {
- return {
- longitude: '',
- latitude: '',
- list: [{
- image: 'https://cdn.uviewui.com/uview/swiper/1.jpg',
- title: '昨夜星辰昨夜风,画楼西畔桂堂东',
- url:"/pages/buytickets/site?id=0cb4dd6c-ca33-4837-bd4a-7f01afb4d1a3"
- },
- {
- image: 'https://cdn.uviewui.com/uview/swiper/2.jpg',
- title: '身无彩凤双飞翼,心有灵犀一点通',
- url:"/pages/buytickets/site?id=0cb4dd6c-ca33-4837-bd4a-7f01afb4d1a3"
- },
- {
- image: 'https://cdn.uviewui.com/uview/swiper/3.jpg',
- title: '谁念西风独自凉,萧萧黄叶闭疏窗,沉思往事立残阳',
- url:"/pages/buytickets/site?id=0cb4dd6c-ca33-4837-bd4a-7f01afb4d1a3"
- }
- ],
- }
- },
- onLoad(){
-
- },
- methods: {
- getPoint() {
-
-
- WxJsApi.getLocation().then((res) => {
-
- var latitude = parseFloat(res.latitude);
- var longitude = parseFloat(res.longitude);
-
- this.latitude = latitude;
- this.longitude = longitude;
-
-
- }).catch(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",{});
- }
- }
|