Commit ae07b3e9 authored by IvyXia123's avatar IvyXia123

Merge branch 'master' of http://git.singsingenglish.com/new-sing/wechat

# Conflicts:
#	src/components/punchTheClock/index.vue
parents 384bace4 81b6b31f
<template> <template>
<div class="group-buy"> <div class="group-buy">
<!-- <guidelines v-if="guidelinesShow"></guidelines>-->
<div :style="{backgroundImage:`url('${lineImage}')`}" class="main-background"> <div :style="{backgroundImage:`url('${lineImage}')`}" class="main-background">
<div class="title-top"> <div class="title-top">
<img :src="clock" /> <img :src="clock" />
...@@ -71,7 +74,7 @@ ...@@ -71,7 +74,7 @@
</div> </div>
<!-- 支付方式选择 --> <!-- 支付方式选择 -->
<!--<div class="pay-list"> <div class="pay-list">
<div class="pay-choice">支付方式选择</div> <div class="pay-choice">支付方式选择</div>
<ul class="pay"> <ul class="pay">
<li v-for="item in payList" :key="item.value" @click="payListClick(item.value)"> <li v-for="item in payList" :key="item.value" @click="payListClick(item.value)">
...@@ -82,7 +85,8 @@ ...@@ -82,7 +85,8 @@
</div> </div>
</li> </li>
</ul> </ul>
</div>--> </div>
<footer> <footer>
<div class="sub-block"> <div class="sub-block">
...@@ -91,11 +95,8 @@ ...@@ -91,11 +95,8 @@
class="tips-price" class="tips-price"
v-if="groupDetail.goods_desc" v-if="groupDetail.goods_desc"
>{{groupDetail.goods_desc.tips?groupDetail.goods_desc.tips:''}}</span> >{{groupDetail.goods_desc.tips?groupDetail.goods_desc.tips:''}}</span>
<!-- <div class="pay-btn" @click="payOrder(orderFlag)">提交订单</div>-->
<div class="pay-btn" @click="payOrder(orderFlag)">提交订单</div> <div class="pay-btn" @click="payOrder(orderFlag)">提交订单</div>
<!--<div class="pay-btn" @click="payOrder(orderFlag)"
v-clipboard:copy="payIndex !== 0 ? payUrl : ''"
v-clipboard:success="copy"
v-clipboard:error="onError">提交订单</div>-->
</div> </div>
</footer> </footer>
<transition name="slide-fade"> <transition name="slide-fade">
...@@ -130,8 +131,8 @@ ...@@ -130,8 +131,8 @@
</template> </template>
<script> <script>
import { Toast } from "vant"; import { Toast } from "vant";
import { import {
getUserAdressApi, getUserAdressApi,
getGoodsDetailApi, getGoodsDetailApi,
payApi, payApi,
...@@ -140,31 +141,33 @@ import { ...@@ -140,31 +141,33 @@ import {
getCouponListApi, getCouponListApi,
getCourseInfoApi, getCourseInfoApi,
postPayBillApi postPayBillApi
} from "../../service/api"; } from "../../service/api";
import addAddress from "./address"; import addAddress from "./address";
import loginPage from "./login"; import loginPage from "./login";
import youHuiUrl from "../../assets/shop/pic.png"; import youHuiUrl from "../../assets/shop/pic.png";
import saleDiv from "./sale"; import saleDiv from "./sale";
import lineImage from "../../assets/shop/buyBg.png"; import lineImage from "../../assets/shop/buyBg.png";
import clock from "../../assets/shop/clock.png"; import clock from "../../assets/shop/clock.png";
import addressImg from "../../assets/shop/address.png"; import addressImg from "../../assets/shop/address.png";
import leftG from "../../assets/shop/leftg.png"; import leftG from "../../assets/shop/leftg.png";
import popup_img from "../../assets/shop/popup_img@2x.png"; import popup_img from "../../assets/shop/popup_img@2x.png";
import weixin from "../../assets/evaluate/weixin.png"; import weixin from "../../assets/evaluate/weixin.png";
import zhifubao from "../../assets/evaluate/zhifubao.png"; import zhifubao from "../../assets/evaluate/zhifubao.png";
import xinyongka from "../../assets/evaluate/xinyongka.png"; import xinyongka from "../../assets/evaluate/xinyongka.png";
import fenqi from "../../assets/evaluate/fenqi.png"; import fenqi from "../../assets/evaluate/fenqi.png";
import icon_re from "../../assets/evaluate/icon_re.png"; import icon_re from "../../assets/evaluate/icon_re.png";
import icon_re_acitve from "../../assets/evaluate/icon_re_acitve.png"; import icon_re_acitve from "../../assets/evaluate/icon_re_acitve.png";
import { Popup } from "mint-ui"; import { Popup } from "mint-ui";
import guidelines from './guidelines'
export default { export default {
name: "buy", name: "buy",
components: { components: {
addAddress, addAddress,
saleDiv, saleDiv,
loginPage, loginPage,
[Popup.name]: Popup [Popup.name]: Popup,
guidelines
}, },
data() { data() {
return { return {
...@@ -210,12 +213,9 @@ export default { ...@@ -210,12 +213,9 @@ export default {
userCourse: {}, userCourse: {},
payList: [ payList: [
{ icon: weixin, title: '微信支付', value: 0 }, { icon: weixin, title: '微信支付', value: 0 },
{ icon: zhifubao, title: '支付宝支付', value: 1 }, { icon: zhifubao, title: '支付宝支付', value: 1 }
{ icon: xinyongka,title: '信用卡分期', value: 2 },
{ icon: fenqi, title: '其他分期', value: 3 },
], ],
payIndex: 0, payIndex: 0,
payUrl: ''
}; };
}, },
mounted() { mounted() {
...@@ -247,20 +247,9 @@ export default { ...@@ -247,20 +247,9 @@ export default {
} }
}, },
methods: { methods: {
copy(e) {
if(this.payIndex === 1) {
Toast("支付宝支付获取成功,请把粘贴到支付宝里");
}else if(this.payIndex === 2) {
Toast("信用卡支付获取成功");
}
},
onError() {
if(this.payIndex === 1) {
Toast("信用卡支付获取成功");
}
},
// 支付方式 // 支付方式
payListClick(val) { payListClick(val) {
this.orderFlag = true;
this.payIndex = val this.payIndex = val
}, },
recursion() { recursion() {
...@@ -283,13 +272,10 @@ export default { ...@@ -283,13 +272,10 @@ export default {
that.jsApiParameters, that.jsApiParameters,
function(res) { function(res) {
that.orderFlag = true; that.orderFlag = true;
console.log(res,110);
if (res.err_msg === "get_brand_wcpay_request:ok") { if (res.err_msg === "get_brand_wcpay_request:ok") {
// 支付成功后处理 // 支付成功后处理
console.log(237)
Toast("支付成功"); Toast("支付成功");
setTimeout(() => { setTimeout(() => {
console.log(238)
getCourseInfoApi().then(res => { getCourseInfoApi().then(res => {
that.userCourse = JSON.parse(JSON.stringify(res)); that.userCourse = JSON.parse(JSON.stringify(res));
localStorage.setItem( localStorage.setItem(
...@@ -300,8 +286,6 @@ export default { ...@@ -300,8 +286,6 @@ export default {
}); });
}, 1500); }, 1500);
} }
// alert(res.errMsg)
// alert(res.err_msg)
if (res.err_msg === "get_brand_wcpay_request:fail") { if (res.err_msg === "get_brand_wcpay_request:fail") {
} }
if (res.err_msg === "get_brand_wcpay_request:cancel") { if (res.err_msg === "get_brand_wcpay_request:cancel") {
...@@ -319,10 +303,10 @@ export default { ...@@ -319,10 +303,10 @@ export default {
}, },
buttonClick(buttonType, buttonName) { buttonClick(buttonType, buttonName) {
this.$sa.track("buttonClick", { this.$sa.track("buttonClick", {
tabTitle: "商品", tabTitle : "商品",
moduleTitle: "购买页", moduleTitle : "购买页",
buttonType: buttonType, buttonType : buttonType,
buttonName: buttonName buttonName : buttonName
}); });
}, },
goToBuyPage() { goToBuyPage() {
...@@ -330,6 +314,7 @@ export default { ...@@ -330,6 +314,7 @@ export default {
this.bindMobile.show = false; this.bindMobile.show = false;
}, },
payOrder(flag) { payOrder(flag) {
console.log(flag)
let type = this.type ? 0 : 1; let type = this.type ? 0 : 1;
let that = this; let that = this;
this.orderCancel = false; this.orderCancel = false;
...@@ -380,18 +365,8 @@ export default { ...@@ -380,18 +365,8 @@ export default {
} }
this.orderFlag = false; this.orderFlag = false;
/*let payTypeArr = ['WX', 'ALI', 'KFQ']
let data = { pay_type: payTypeArr[this.payIndex], return_url: window.location.href, goods_id: json.goods_id, buy_type: this.groupDetail.goods_type, group_order_id: json.group_order_id, order_coupon_id:json.order_coupon_id }
postPayBillApi(data).then(res => {
if(this.payIndex === 0) { if(this.payIndex === 0) {
window.location.href = res.pay_url; // 微信支付
}else if(this.payIndex === 1){
this.payUrl = res.pay_url;
}else if(this.payIndex === 2) {
this.payUrl = res.pay_url;
}
})*/
payApi(json).then(res => { payApi(json).then(res => {
this.orderNo = res.out_trade_no; this.orderNo = res.out_trade_no;
console.log(res) console.log(res)
...@@ -438,6 +413,20 @@ export default { ...@@ -438,6 +413,20 @@ export default {
// alert(res) // alert(res)
this.orderFlag = true; this.orderFlag = true;
}); });
}else {
// 支付宝支付
let data = { pay_type: 'ALI', return_url: window.location.href, buy_type: this.groupDetail.goods_type }
let dataObj = Object.assign({}, data, json)
postPayBillApi(dataObj).then(res => {
let outTradEno = JSON.stringify({ out_trade_no: res.out_trade_no, invite_code: this.$route.query.invite_code, shopId: this.$route.query.shopId, goods_type: this.groupDetail.goods_type, is_subscribe: this.userDetail.open_info.is_subscribe })
localStorage.setItem('out_trade_no', outTradEno);
localStorage.setItem('pay_url', res.pay_url);
location.href = `http://${ window.location.host }/#/guidelines?pay_url=${ encodeURI(res.pay_url) }`
}).catch(err => {
console.log(err)
Toast(err.msg)
})
}
} }
}, },
closeAdd(data) { closeAdd(data) {
...@@ -484,7 +473,7 @@ export default { ...@@ -484,7 +473,7 @@ export default {
data.goods_desc = JSON.parse(data.goods_desc); data.goods_desc = JSON.parse(data.goods_desc);
data.share_desc = JSON.parse(data.share_desc); data.share_desc = JSON.parse(data.share_desc);
this.groupDetail = JSON.parse(JSON.stringify(data)); this.groupDetail = JSON.parse(JSON.stringify(data));
sessionStorage.setItem("groupDetail", JSON.stringify(data)); localStorage.setItem("groupDetail", JSON.stringify(data));
console.log(this.groupDetail, 408); console.log(this.groupDetail, 408);
this.invite_code = this.$route.query.invite_code; this.invite_code = this.$route.query.invite_code;
if (this.type && this.type === 0) { if (this.type && this.type === 0) {
...@@ -558,18 +547,18 @@ export default { ...@@ -558,18 +547,18 @@ export default {
} }
} }
} }
}; };
</script> </script>
<style scoped lang="less"> <style scoped lang="less">
@import "../../util/public"; @import "../../util/public";
img { img {
max-width: none; max-width: none;
} }
.slide-fade-enter-active { .slide-fade-enter-active {
transition: all 0.5s ease; transition: all 0.5s ease;
} }
.you-block { .you-block {
font-size: 16 * @toVw; font-size: 16 * @toVw;
font-family: PingFang-SC-Medium; font-family: PingFang-SC-Medium;
font-weight: 500; font-weight: 500;
...@@ -589,8 +578,8 @@ img { ...@@ -589,8 +578,8 @@ img {
color: #999999; color: #999999;
font-size: 14 * @toVw; font-size: 14 * @toVw;
} }
} }
.orderCancel { .orderCancel {
top: 45%; top: 45%;
background: transparent; background: transparent;
.box { .box {
...@@ -641,22 +630,22 @@ img { ...@@ -641,22 +630,22 @@ img {
} }
} }
} }
} }
.slide-fade-leave-active { .slide-fade-leave-active {
transition: all 0.5s cubic-bezier(1, 0.5, 0.8, 1); transition: all 0.5s cubic-bezier(1, 0.5, 0.8, 1);
} }
.slide-fade-enter, .slide-fade-leave-to .slide-fade-enter, .slide-fade-leave-to
/* .slide-fade-leave-active for below version 2.1.8 */ { /* .slide-fade-leave-active for below version 2.1.8 */ {
transform: translateX(10px); transform: translateX(10px);
opacity: 0; opacity: 0;
} }
.phone-block { .phone-block {
padding: 10 * @toVw; padding: 10 * @toVw;
text-align: center; text-align: center;
background: #f8f8f8; background: #f8f8f8;
} }
.phone-input { .phone-input {
width: 280 * @toVw; width: 280 * @toVw;
height: 30 * @toVw; height: 30 * @toVw;
border-radius: 8 * @toVw; border-radius: 8 * @toVw;
...@@ -664,13 +653,13 @@ img { ...@@ -664,13 +653,13 @@ img {
padding: 0 10 * @toVw; padding: 0 10 * @toVw;
border: 1px solid #e8e8e8; border: 1px solid #e8e8e8;
text-align: center; text-align: center;
} }
.block-title { .block-title {
font-size: 12 * @toVw; font-size: 12 * @toVw;
color: #999; color: #999;
padding: 8 * @toVw 16 * @toVw; padding: 8 * @toVw 16 * @toVw;
} }
.group-buy { .group-buy {
.main-background { .main-background {
padding: 0 20 * @toVw; padding: 0 20 * @toVw;
background: white no-repeat; background: white no-repeat;
...@@ -890,5 +879,5 @@ img { ...@@ -890,5 +879,5 @@ img {
position: absolute; position: absolute;
background: white; background: white;
} }
} }
</style> </style>
<template>
<div class="guidelines">
<div class="zhiying" v-if="micromessenger == 0">
<img :src="zhiying" alt="">
</div>
</div>
</template>
<script>
import common from '../../util/common'
import zhiying from "../../assets/punchTheClock/zhiying.png"
import zhufubao from "../../assets/punchTheClock/zhifubaotup.png"
export default {
name: "guidelines",
data() {
return {
micromessenger: 0, // 判断在微信里还是在浏览器里
zhiying: zhiying, // 图片
zhufubao: zhufubao
}
},
mounted() {
// 0 -> 微信 1 -> 支付宝
this.micromessenger = common.isWeixinBrowser()
// 到浏览器里支付宝支付
if (this.micromessenger == 1) {
location.href = this.$route.query.pay_url
}
}
}
</script>
<style scoped lang="less">
@import "../../util/public";
.guidelines {
width: 100%;
height: 100%;
padding-top: 3 * @toVw;
background: #F3F2F7;
text-align: center;
.zhiying {
width: 244 * @toVw;
height: 361 * @toVw;
margin-left: 112 * @toVw;
box-sizing: border-box;
img {
width: 100%;
height: 100%;
}
}
}
</style>
...@@ -10,10 +10,12 @@ import VueClipboard from 'vue-clipboard2' ...@@ -10,10 +10,12 @@ import VueClipboard from 'vue-clipboard2'
import sa from 'sa-sdk-javascript'; import sa from 'sa-sdk-javascript';
import 'mint-ui/lib/style.css' import 'mint-ui/lib/style.css'
import scroll from "./base/scroll/scroll" import scroll from "./base/scroll/scroll"
import { Popup, Lazyload, Button, Dialog, Toast } from 'vant'; import {Popup, Lazyload, Button, Dialog, Toast} from 'vant';
import {getBillRefreshApi, getStatusWechatApi,getCourseInfoApi} from './service/api'
import './util/vancs.less'
import * as fundebug from 'fundebug-javascript'; import * as fundebug from 'fundebug-javascript';
import fundebugVue from 'fundebug-vue'; import fundebugVue from 'fundebug-vue';
fundebug.apikey = '4d414770c72b034dfa896048206a72258ede4e4ad5f9c6c4320d19b7f91a567e'; fundebug.apikey = '4d414770c72b034dfa896048206a72258ede4e4ad5f9c6c4320d19b7f91a567e';
fundebugVue(fundebug, Vue); fundebugVue(fundebug, Vue);
...@@ -46,12 +48,62 @@ Vue.prototype.$sa.quick('autoTrack') ...@@ -46,12 +48,62 @@ Vue.prototype.$sa.quick('autoTrack')
Vue.use(VueClipboard); Vue.use(VueClipboard);
Vue.use(Popup).use(Lazyload).use(Button).use(Dialog).use(Toast); Vue.use(Popup).use(Lazyload).use(Button).use(Dialog).use(Toast);
Vue.component('scroll', scroll); Vue.component('scroll', scroll);
// 支付宝支付完成,订单状态查询
let timer = null;
if (window.localStorage.out_trade_no) {
timer = setInterval(() => {
let outTradEno = JSON.parse(window.localStorage.out_trade_no);
getBillRefreshApi({outTradeNo: outTradEno.out_trade_no}).then(res => {
// 支付成功
if (res.status === "SUCCESS") {
getCourseInfoApi().then(response => {
this.userCourse = JSON.parse(JSON.stringify(response));
console.log(this.userCourse)
localStorage.setItem("userCourse", JSON.stringify(this.userCourse));
localStorage.setItem("buyindex", 1);
Dialog.confirm({title: '标题', message: '支付成功', confirmButtonText: '去查看'}).then(() => {
if (response.teacher_alias && response.teacher_alias.substr(0, 1) == 1 && outTradEno.goods_type != 4 && outTradEno.is_subscribe == 1) {
clearInterval(timer);
router.push({ name: "guide", query: {shopId: outTradEno.shopId} });
localStorage.removeItem('out_trade_no')
}else {
if (res.buy_type == 1) {
clearInterval(timer);
router.push({name: "buySuccess", query: outTradEno});
localStorage.removeItem('out_trade_no')
} else {
clearInterval(timer);
router.push({name: "success", query: outTradEno});
localStorage.removeItem('out_trade_no')
}
}
}).catch(() => {
clearInterval(timer);
localStorage.removeItem('out_trade_no')
});
});
} else if (res.status === "NO_SYNC") {
Dialog.confirm({title: '标题', message: '您有一笔未支付的订单', confirmButtonText: '去查看'}).then(() => {
clearInterval(timer);
location.href = `http://${window.location.host}/#/guidelines?pay_url=${encodeURI(window.localStorage.pay_url)}`
localStorage.removeItem('out_trade_no')
}).catch(() => {
clearInterval(timer);
localStorage.removeItem('out_trade_no')
});
}
})
}, 6000)
}
// 全局错误日志 // 全局错误日志
const errorHandler = (error, vm)=>{ const errorHandler = (error, vm) => {
Vue.prototype.$post(`api/client/report/errors/log`,{'routes_url':vm.$route.name,'result_text':error.toString()}) Vue.prototype.$post(`api/client/report/errors/log`, {'routes_url': vm.$route.name, 'result_text': error.toString()})
} }
Vue.config.errorHandler = errorHandler; Vue.config.errorHandler = errorHandler;
Vue.prototype.$throw = (error)=> errorHandler(error,this); Vue.prototype.$throw = (error) => errorHandler(error, this);
Vue.prototype.$common = common Vue.prototype.$common = common
//VConsole关闭屏蔽代码 //VConsole关闭屏蔽代码
if (process.env.NODE_ENV != 'production') { if (process.env.NODE_ENV != 'production') {
...@@ -70,13 +122,16 @@ router.beforeEach((to, from, next) => { ...@@ -70,13 +122,16 @@ router.beforeEach((to, from, next) => {
} }
}) })
new Vue({ new Vue({
el: '#app', el: '#app',
router, router,
store, store,
components: { App }, components: {App},
template: '<App/>' template: '<App/>'
}); });
if (!Array.prototype.find) { if (!Array.prototype.find) {
Array.prototype.find = function (predicate) { Array.prototype.find = function (predicate) {
'use strict'; 'use strict';
......
...@@ -39,7 +39,6 @@ const router = new Router({ ...@@ -39,7 +39,6 @@ const router = new Router({
deep: 0, deep: 0,
} }
}, },
{ {
path: '/extensionV1Shop', path: '/extensionV1Shop',
name: 'extensionV1Shop', name: 'extensionV1Shop',
...@@ -571,6 +570,12 @@ const router = new Router({ ...@@ -571,6 +570,12 @@ const router = new Router({
name: 'punchTheClock', name: 'punchTheClock',
component: e => require(['@/components/punchTheClock'], e) component: e => require(['@/components/punchTheClock'], e)
}, },
// 微信跳转支付宝
{
path: '/guidelines',
name: 'guidelines',
component: e => require(['@/components/buy/guidelines'], e)
},
{ {
path: '*', path: '*',
component: () => import('@/components/error'), component: () => import('@/components/error'),
...@@ -599,6 +604,16 @@ router.beforeEach((to, from, next) => { ...@@ -599,6 +604,16 @@ router.beforeEach((to, from, next) => {
next({ name: 'noWechat', query: { url: encodeURIComponent(to.fullPath) } }); next({ name: 'noWechat', query: { url: encodeURIComponent(to.fullPath) } });
} }
} }
/*let micromessenger = common.isWeixinBrowser();
if(micromessenger == 2){
alert(micromessenger);
alert(999999)
// location.href = `http://${ window.location.host }/#/guidelines`
next({ path: 'guidelines' })
return false;
}*/
// 移动端判断 // 移动端判断
store.dispatch('isMobile', browser.versions.mobile); store.dispatch('isMobile', browser.versions.mobile);
// 默认title // 默认title
...@@ -610,9 +625,9 @@ router.beforeEach((to, from, next) => { ...@@ -610,9 +625,9 @@ router.beforeEach((to, from, next) => {
if (to.meta.title) { if (to.meta.title) {
document.title = to.meta.title; document.title = to.meta.title;
} }
let goOn = function () { let goOn = function () {
if (localStorage.getItem('retUrl') && localStorage.getItem('retUrl') !== null && localStorage.getItem('retUrl') !== '') { if (localStorage.getItem('retUrl') && localStorage.getItem('retUrl') !== null && localStorage.getItem('retUrl') !== '') {
console.log(localStorage.getItem('retUrl'))
let retUrl = localStorage.getItem('retUrl').toString(); let retUrl = localStorage.getItem('retUrl').toString();
localStorage.removeItem('retUrl'); localStorage.removeItem('retUrl');
next(retUrl); next(retUrl);
...@@ -621,22 +636,30 @@ router.beforeEach((to, from, next) => { ...@@ -621,22 +636,30 @@ router.beforeEach((to, from, next) => {
} }
}; };
if (window.location.href.indexOf('gdt_vid') > -1) { if (window.location.href.indexOf('gdt_vid') > -1) {
console.log(3333333, common.getUrlParam())
localStorage.setItem('gdt_vid', common.getUrlParam().gdt_vid); localStorage.setItem('gdt_vid', common.getUrlParam().gdt_vid);
localStorage.setItem('cct_user_id', common.getUrlParam().cct_user_id); localStorage.setItem('cct_user_id', common.getUrlParam().cct_user_id);
localStorage.setItem('redeem_code', common.getUrlParam().cct_user_id); localStorage.setItem('redeem_code', common.getUrlParam().cct_user_id);
// localStorage.setItem('redeem_code', common.getParamhref().redeem_code);
} }
// 在支付宝里跳转
let micromessenger = common.isWeixinBrowser();
if(micromessenger == 2){
// alert("支付成功啦,请回到唱唱公众号继续操作!")
// location.href = "https://wechat-pre.changchangenglish.com/#/weixin"
location.href = "https://static-cdn.changchangenglish.com/public/images/alipay_success.png"
// location.href = "https://www.changchangenglish.com/zhifubao.html"
return ;
}
// extensionV1Shop // extensionV1Shop
// extensionV1 // extensionV1
if (to.name === 'spcShop' || to.name === 'mpShop' || to.name === 'extensionV1Shop' || to.name === 'extensionV1' || to.name === 'author' || to.name === 'bindMobile' || to.name === 'noWechat' || to.name === 'inspectorActivit' || to.name === 'buyDetail'|| to.name === 'passShop'|| to.name === 'ybIndex' ) { if (to.name === 'starRankV2' || to.name === 'order' || to.name === 'buySuccess' || to.name === 'success' || to.name === 'guidelines' || to.name === 'spcShop' || to.name === 'mpShop' || to.name === 'extensionV1Shop' || to.name === 'extensionV1' || to.name === 'author' || to.name === 'bindMobile' || to.name === 'noWechat' || to.name === 'inspectorActivit' || to.name === 'buyDetail'|| to.name === 'passShop'|| to.name === 'ybIndex' ) {
// 无需登录的页面 // 无需登录的页面
console.log(488) console.log(899, to.name)
next() next()
} else if (window.location.href.indexOf('token') > -1 && to.name === 'index') { } else if (window.location.href.indexOf('token') > -1 && to.name === 'index') {
console.log(99000)
let token = common.getUrlParam().token || to.query.token; let token = common.getUrlParam().token || to.query.token;
console.log(common.getUrlParam())
console.log(to.name)
// debugger // debugger
store.dispatch('setToken', token); store.dispatch('setToken', token);
getUserDetailApi().then(res => { getUserDetailApi().then(res => {
......
...@@ -431,3 +431,8 @@ const getNewCashUrl = `${_baseUrl}api/client/new/return/cash/` ...@@ -431,3 +431,8 @@ const getNewCashUrl = `${_baseUrl}api/client/new/return/cash/`
export const getNewCashApi = function (element_id, category_id, periods_id, json) { export const getNewCashApi = function (element_id, category_id, periods_id, json) {
return Vue.prototype.$fetch(`${getNewCashUrl}${element_id}/${category_id}/${periods_id}`, json) return Vue.prototype.$fetch(`${getNewCashUrl}${element_id}/${category_id}/${periods_id}`, json)
}; };
const getBillRefreshUrl = `${_baseUrl}api/client/bill/refresh`
export const getBillRefreshApi = function (json) {
return Vue.prototype.$fetch(getBillRefreshUrl, json)
};
...@@ -118,5 +118,32 @@ export default { ...@@ -118,5 +118,32 @@ export default {
} }
} }
return newObj; return newObj;
},
/**
* 判断是否在那个浏览器里
* @returns {number}
*/
isWeixinBrowser() {
var ui = 0
// 0 -> 微信 2 -> 支付宝 1 -> 其他
if (/MicroMessenger/.test(window.navigator.userAgent)) {
ui = 0
} else if (/AlipayClient/.test(window.navigator.userAgent)) {
ui = 2
} else {
ui = 1
}
return ui;
},
/**
* 获取链接后的参数
* @param name
* @param url
* @returns {RegExpExecArray | string}
*/
getParamByName(name, url) {
url = url || window.location;
var match = RegExp('[?&]' + name + '=([^&]*)').exec(url);
return match && decodeURIComponent(match[1].replace(/\+/g, ' '))
} }
} }
.van-dialog {
border-radius: 15px;
padding-bottom: 25px;
.van-dialog__header {
opacity: 0;
}
.van-button__text {
display: inline-block;
width: 98px;
height: 44px;
color: #FFFFFF;
border-radius: 25px;
}
[class*=van-hairline]::after {
border: none
}
.van-button::before {
}
border-color: transparent;
//background-color: transparent;
.van-dialog__cancel {
.van-button__text {
background: #97A0BB;
}
}
.van-dialog__confirm {
.van-button__text {
background: #40A9FF;
}
}
}
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