Commit 5c8342f3 authored by jiaoyahui's avatar jiaoyahui

router的更改位置,和支付浏览器的测试

parent ee0e2323
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
<meta name="viewport" content="width=device-width,initial-scale=1.0"> <meta name="viewport" content="width=device-width,initial-scale=1.0">
<link rel="icon" href="<%= BASE_URL %>favicon.ico"> <link rel="icon" href="<%= BASE_URL %>favicon.ico">
<script src="./static/js/mqttws31.js" type="text/javascript"></script> <script src="./static/js/mqttws31.js" type="text/javascript"></script>
<title><%= htmlWebpackPlugin.options.title %></title> <title>斗牛财经</title>
</head> </head>
<body> <body>
<noscript> <noscript>
......
...@@ -9,6 +9,7 @@ import store from './store/index' ...@@ -9,6 +9,7 @@ import store from './store/index'
import server from './axios/api' import server from './axios/api'
import VideoPlayer from 'vue-video-player' import VideoPlayer from 'vue-video-player'
import 'vue-video-player/src/custom-theme.css' import 'vue-video-player/src/custom-theme.css'
import common from '../static/js/common.js' //公共方法
import 'video.js/dist/video-js.css' import 'video.js/dist/video-js.css'
//引入 hls,视频直播(m3u8)必须引入的 //引入 hls,视频直播(m3u8)必须引入的
import 'videojs-contrib-hls' import 'videojs-contrib-hls'
...@@ -25,6 +26,7 @@ Vue.prototype.qs = Qs; ...@@ -25,6 +26,7 @@ Vue.prototype.qs = Qs;
Vue.prototype.axios = axios; Vue.prototype.axios = axios;
Vue.prototype.router = router; Vue.prototype.router = router;
Vue.prototype.$md5 = md5; Vue.prototype.$md5 = md5;
Vue.prototype.common = common; //引入公共方法
new Vue({ new Vue({
render: h => h(App), render: h => h(App),
router, router,
......
...@@ -21,21 +21,31 @@ Vue.use(Router) ...@@ -21,21 +21,31 @@ Vue.use(Router)
const router = new Router({ const router = new Router({
routes:[ routes:[
{ {
path: '/login', path: '/',
name: 'index', name: 'index',
component: index, component: password,
meta: { meta: {
requireAuth: true requireAuth: true,
} // 判断是否需要登录
}, // 判断是否需要登录
redirect:'/password'
}, },
{ {
path: '/', path: '/login',
name: 'index', name: 'login',
component: index, component: index,
meta: { meta: {
requireAuth: true requireAuth: true
} // 判断是否需要登录 } // 判断是否需要登录
}, },
// {
// path: '/',
// name: 'index',
// component: password,
// meta: {
// requireAuth: true
// } // 判断是否需要登录
// },
{ {
path: '/password', path: '/password',
name: 'password', name: 'password',
......
...@@ -479,7 +479,7 @@ export default { ...@@ -479,7 +479,7 @@ export default {
applicationType:4, applicationType:4,
pmAppVersion: 868, pmAppVersion: 868,
// applicationType: 3, // applicationType: 3,
goodsType:3, goodsType:3,
goodsId:429, goodsId:429,
}) })
...@@ -497,20 +497,19 @@ export default { ...@@ -497,20 +497,19 @@ export default {
// 订单 // 订单
payorder(){ payorder(){
let temp=this.qs.stringify({ let temp=this.qs.stringify({
goodsId:429, goodsId:429,
goodsType:3, goodsType:3,
sxUbId:26, sxUbId:26,
pmoType:0, pmoType:0,
subscribeDayType:26, subscribeDayType:26,
applicationType:4, applicationType:4,
payType:1, payType:1,
// orderType:2, // orderType:2,
subscribeDayType:19, subscribeDayType:19,
rechargeFrom:1, rechargeFrom:1,
isCheckBuy:1, isCheckBuy:1,
paySource:"douniu_h5",
paySource:"douniu_h5", chargeModeKey:this.chargeModeKey
chargeModeKey:this.chargeModeKey
...@@ -520,7 +519,7 @@ export default { ...@@ -520,7 +519,7 @@ export default {
this.pmoOrder=res.data.data.pmoOrder this.pmoOrder=res.data.data.pmoOrder
if(res.code=200){ if(res.code=200){
console.log(res.data.data.pmoOrder,'===-') console.log(res.data.data.pmoOrder,'===-')
this.paybuy() this.paybuy()
} }
...@@ -531,26 +530,19 @@ export default { ...@@ -531,26 +530,19 @@ export default {
}, },
paybuy(){ paybuy(){
let temp=this.qs.stringify({ let temp=this.qs.stringify({
orderId:this.pmoId,
orderNo:this.pmoOrder,
payType:1,
orderId:this.pmoId, orderType:3,
orderNo:this.pmoOrder, pmoType:0,
payType:1,
orderType:3,
pmoType:0,
goodsType:3, goodsType:3,
}) })
this.server.live.buy(temp).then(res=>{
this.server.live.buy(temp).then(res=>{
window.location.href=res.data.data.wechatInfo.payUrl
console.log(this.pmoOrder,'===') console.log(res.data.data.wechatInfo.payUrl,'===')
}) })
...@@ -931,7 +923,7 @@ display: block; ...@@ -931,7 +923,7 @@ display: block;
} }
.conten{ .conten{
position:fixed; position:fixed;
top:27%; top:24%;
left:0%; left:0%;
width:100%; width:100%;
/* background:red */ /* background:red */
......
// 判断是否为微信浏览器
const isWX = () => {
var ua = navigator.userAgent.toLowerCase();
if (ua.match(/MicroMessenger/i) == 'micromessenger') {
return true;
} else {
return false;
}
}
// 判断是否为移动端浏览器
const isMobile = () => {
var ua = navigator.userAgent;
var ipad = ua.match(/(iPad).*OS\s([\d_]+)/),
isIphone = !ipad && ua.match(/(iPhone\sOS)\s([\d_]+)/),
isAndroid = ua.match(/(Android)\s+([\d.]+)/),
isMobile = isIphone || isAndroid || ipad;
//判断
if (isMobile) {
return true;
} else {
return false;
}
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment