Commit 613d40ed authored by IvyXia123's avatar IvyXia123

20191014-15号发版

parent 845c12a6
<!DOCTYPE html><html><head><meta charset=utf-8><meta name=viewport content="width=device-width,initial-scale=1,maximum-scale=1,minimum-scale=1,user-scalable=no"><meta name=screen-orientation content=portrait><meta name=x5-orientation content=portrait><title>唱唱启蒙英语</title><link rel=stylesheet href=https://at.alicdn.com/t/font_822651_g9r2j7kybxu.css><style>*{
-webkit-overflow-scrolling:touch;
}</style><link href=https://static-cdn.changchangenglish.com/new-sing/static/css/app.5f3583bfe1a035c4f23bb6139d6a7afe.css rel=stylesheet></head><body><div id=app></div><script src=https://res.wx.qq.com/open/js/jweixin-1.3.2.js></script><script></script><script type=text/javascript src=https://static-cdn.changchangenglish.com/new-sing/static/js/manifest.acca5632900f87535f87.js></script><script type=text/javascript src=https://static-cdn.changchangenglish.com/new-sing/static/js/vendor.e524f5cccf757e45c672.js></script><script type=text/javascript src=https://static-cdn.changchangenglish.com/new-sing/static/js/app.d2f6f2a89dceff91d7d3.js></script></body></html>
\ No newline at end of file
}</style><link href=https://static-cdn.changchangenglish.com/new-sing/static/css/app.81ff810b654ae302b7808d851f979733.css rel=stylesheet></head><body><div id=app></div><script src=https://res.wx.qq.com/open/js/jweixin-1.3.2.js></script><script></script><script type=text/javascript src=https://static-cdn.changchangenglish.com/new-sing/static/js/manifest.5d37e9aa5a2bcabafb16.js></script><script type=text/javascript src=https://static-cdn.changchangenglish.com/new-sing/static/js/vendor.7b1120612b542658f62d.js></script><script type=text/javascript src=https://static-cdn.changchangenglish.com/new-sing/static/js/app.d23a4ea1fe38b2429fbb.js></script></body></html>
\ No newline at end of file
File mode changed from 100644 to 100755
......@@ -71,7 +71,7 @@
</div>
<!-- 支付方式选择 -->
<!--<div class="pay-list">
<div class="pay-list">
<div class="pay-choice">支付方式选择</div>
<ul class="pay">
<li v-for="item in payList" :key="item.value" @click="payListClick(item.value)">
......@@ -82,7 +82,7 @@
</div>
</li>
</ul>
</div>-->
</div>
<footer>
<div class="sub-block">
......@@ -210,9 +210,7 @@ export default {
userCourse: {},
payList: [
{ icon: weixin, title: '微信支付', value: 0 },
{ icon: zhifubao, title: '支付宝支付', value: 1 },
{ icon: xinyongka,title: '信用卡分期', value: 2 },
{ icon: fenqi, title: '其他分期', value: 3 },
{ icon: zhifubao, title: '支付宝支付', value: 1 }
],
payIndex: 0,
payUrl: ''
......@@ -380,27 +378,17 @@ export default {
}
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) {
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 => {
if(this.payIndex === 0) {
// 微信支付
payApi(json).then(res => {
this.orderNo = res.out_trade_no;
console.log(res)
if (res.out_trade_no && !res.appId) {
getCourseInfoApi().then(res => {
this.userCourse = res;
localStorage.setItem(
"userCourse",
JSON.stringify(this.userCourse)
"userCourse",
JSON.stringify(this.userCourse)
);
this.navPage(res);
});
......@@ -417,15 +405,15 @@ export default {
} else if (typeof WeixinJSBridge === "undefined") {
if (document.addEventListener) {
document.addEventListener(
"WeixinJSBridgeReady",
that.jsApiCall,
false
"WeixinJSBridgeReady",
that.jsApiCall,
false
);
} else if (document.attachEvent) {
document.attachEvent("WeixinJSBridgeReady", that.jsApiCall);
document.attachEvent(
"onWeixinJSBridgeReady",
that.jsApiCall
"onWeixinJSBridgeReady",
that.jsApiCall
);
}
} else {
......@@ -434,11 +422,25 @@ export default {
});
}
})
.catch(res => {
// alert(res)
Toast(res.msg);
this.orderFlag = true;
});
.catch(err => {
// alert(res)
Toast(err.msg)
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) {
......
<template>
<div class="guidelines">
<div class="zhiying" v-if="micromessenger == 0">
<img :src="zhiying" alt="">
</div>
</div>
</template>
<script>
import {getBillRefreshApi, getStatusWechatApi, getCourseInfoApi} from "../../service/api"
import {Popup, Lazyload, Button, Dialog, Toast} from 'vant';
import common from '../../util/common'
import zhiying from "../../assets/punchTheClock/zhiying.png"
import zhufubao from "../../assets/punchTheClock/zhifubaotup.png"
let timer = null;
export default {
name: "guidelines",
data() {
return {
micromessenger: 0, // 判断在微信里还是在浏览器里
zhiying: zhiying, // 图片
zhufubao: zhufubao
}
},
methods: {
outTrade() {
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);
this.$router.push({name: "guide", query: {shopId: outTradEno.shopId}});
localStorage.removeItem('out_trade_no')
} else {
if (res.buy_type == 1) {
clearInterval(timer);
this.$router.push({name: "buySuccess", query: outTradEno});
localStorage.removeItem('out_trade_no')
} else {
clearInterval(timer);
this.$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)}&out_trade_no=${window.localStorage.out_trade_no}`
localStorage.removeItem('out_trade_no')
}).catch(() => {
clearInterval(timer);
localStorage.removeItem('out_trade_no')
});
}
})
}, 6000)
}
},
mounted() {
// 0 -> 微信 1 -> 支付宝
this.micromessenger = common.isWeixinBrowser()
// 到浏览器里支付宝支付
if (this.micromessenger == 1) {
location.href = this.$route.query.pay_url
}
if (this.$route.query.out_trade_no) {
localStorage.setItem('out_trade_no', this.$route.query.out_trade_no);
}
this.outTrade()
}
}
</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>
......@@ -11,20 +11,9 @@
<div class="punch-the-clock-name-bg">
<div class="punch-the-clock-name-content">
<!-- 倒计时 hasEnded 指是否在规定时间内完成学习 -->
<div class="punch-the-clock-name-contentText" v-if="!hasEnded && forthRate != 100">很遗憾,您未在指定时间内完成任务哦</div>
<div class="punch-the-clock-name-content-timer" v-if="hasEnded">
<span>剩余完成时间</span>
<span class="timer">{{ countDownDay }}</span>
<span></span>
<span class="timer">{{ countDownhour }}</span>
<span></span>
<span class="timer">{{ countDownminu }}</span>
<span></span>
<span class="timer">{{ countDownsec }}</span>
<span></span>
</div>
<div class="punch-the-clock-name-contentText" v-if="!hasEnded && forthRate !== 100">很遗憾,您未在指定时间内完成任务哦</div>
<!-- 完成率 -->
<div class="punch-the-clock-name-content-completion">
<div class="punch-the-clock-name-content-completion" v-if="!hasEnded && forthRate !== 100">
<div class="daka-fu">
<img :src="punchTheClock.dakaFu" alt="">
</div>
......@@ -58,18 +47,14 @@
<!-- 恭喜您已获得奖励 快联系班主任领取吧! -->
<div class="punch-the-clock-reward" v-if="forthRate === 100">
<div class="punch-the-clock-reward-title">恭喜您已获得奖励</div>
<div class="punch-the-clock-reward-title">快联系班主任领取吧!</div>
<div class="punch-the-clock-reward-erweima">
<div class="punch-the-clock-reward-erweima-ma">
<img :src="qrErWeiMa" alt="">
</div>
</div>
<div class="punch-the-clock-reward-content">系统将在7个工作日内将奖励发放至您的微信钱包,还请注意查收!</div>
</div>
<!-- 今日卡 -->
<div class="today-list" v-if="todayData.length !== 0 && forthRate !== 100">
<div class="today-list today-list-padding" v-if="todayData.length !== 0 && forthRate !== 100">
<div class="punch-list-today" v-for="(item, index) in todayData">
<div class="punch-card-today">
<div class="day">今日</div>
<div class="day">今日打卡任务</div>
<div class="day-small">请在今日完成</div>
<div class="small-title">{{ item.sub_title }}</div>
<div class="title">{{ item.name.split(' ')[0] + ' ' +item.name.split(' ')[1] }}</div>
</div>
......@@ -108,31 +93,51 @@
{{ item.title }} <div class="xian" v-show="index === recordListIndex"></div>
</li>
</ul>
<!-- 倒计时 -->
<div class="count-down" v-if="hasEnded && recordListIndex === 2">
<!-- 倒计时 -->
<div class="punch-the-clock-name-content-timer">
<span>剩余补卡时间</span>
<span class="timer">{{ countDownDay }}</span>
<span></span>
<span class="timer">{{ countDownhour }}</span>
<span></span>
<span class="timer">{{ countDownminu }}</span>
<span></span>
<span class="timer">{{ countDownsec }}</span>
<span></span>
</div>
</div>
<!-- 我的打卡记录展示 -->
<div class="today-list">
<div class="today-list today-list-padding">
<div class="today-list-xian" v-for="(item, index) in punchCardData" v-if="punchCardData.length !== 0" :key="index">
<!-- 日期 -->
<div class="punch-card-today">
<div class="sou" v-if="recordListIndex === 0">
<div class="sou days" v-if="recordListIndex === 0">
<img :src="punchTheClock.sou" alt="">
</div>
<div class="day" v-if="recordListIndex !== 0">{{ item.push_time.split('-')[1] }}{{ item.push_time.split('-')[2] }}</div>
<div class="day" v-if="recordListIndex !== 0">{{ item.push_time.split('-')[1] }}{{ item.push_time.split('-')[2] }}日打卡任务</div>
<div class="day-small">{{ recordListIndex === 0 ? '请耐心等待课程开始' : recordListIndex === 1 ? '请在当日完成' : recordListIndex === 2 ? '需消耗星星补卡' : '很棒哦!继续加油' }}</div>
<div class="small-title">{{ item.sub_title }}</div>
<div class="title">{{ item.name.split(' ')[0] + ' ' +item.name.split(' ')[1] }}</div>
</div>
<!-- 去学习 -->
<div class="punch-card-today" @click="punchCardClick(index, item.status, item.type)" v-if="item.type == 1">
<div class="punch-card-today-learning">
<img :src="item.status === 1 ? punchTheClock.kaike_xuexi : item.status === 2 ? punchTheClock.daiwanc : item.status === 3 ? punchTheClock.buka_xuexi : punchTheClock.dakawancheng" alt="">
<div class="punch-card-today punch-card-today-list">
<div class="" @click="punchCardClick(index, item.status, item.type)" v-if="item.type == 1">
<div class="punch-card-today-learning">
<img :src="item.status === 1 ? punchTheClock.kaike_xuexi : item.status === 2 ? punchTheClock.daiwanc : item.status === 3 ? punchTheClock.buka_xuexi : punchTheClock.dakawancheng" alt="">
</div>
<div class="punch-card-today-xuexila">学习卡</div>
</div>
<div class="punch-card-today-xuexila">学习卡</div>
</div>
<!-- 成长卡 -->
<div class="punch-card-today" @click="punchCardClick(index, item.status1, item.type1)" v-if="item.type1 == 2">
<div class="punch-card-today-learning">
<img :src="item.status1 === 1 ? punchTheClock.kaike_chengz : item.status1 === 2 ? punchTheClock.daiwanChangz : item.status1 === 3 ? punchTheClock.buka_changz : punchTheClock.wanchengChengz" alt="">
<div class="punch-card-today punch-card-today-list">
<div class="" @click="punchCardClick(index, item.status1, item.type1)" v-if="item.type1 == 2">
<div class="punch-card-today-learning">
<img :src="item.status1 === 1 ? punchTheClock.kaike_chengz : item.status1 === 2 ? punchTheClock.daiwanChangz : item.status1 === 3 ? punchTheClock.buka_changz : punchTheClock.wanchengChengz" alt="">
</div>
<div class="punch-card-today-xuexila">成长卡</div>
</div>
<div class="punch-card-today-xuexila">成长卡</div>
</div>
</div>
<!-- 数据为空 -->
......@@ -183,7 +188,7 @@
</div>
</div>
<!-- 按钮点击 -->
<div :class="['get-stars-btn', {'get-stars-btn-clo' : status === 3 && lastValue <= 10}]" v-if="status !== 4" @click.stop="modelDataClick(modelData, typeStatus)">
<div :class="['get-stars-btn', {'get-stars-btn-clo' : status === 3 && lastValue <= 10}]" v-if="status !== 4 && statusShow" @click.stop="modelDataClick(modelData, typeStatus)">
{{ status === 2 ? ( goWhere == 1 ? '去学习' : '去提交' ) : status === 3 ? '去补卡' : '' }}
</div>
</div>
......@@ -248,6 +253,7 @@
firstRate: 0, // 待开课率
ruleShow: 0, // 规则展示
status: 0, // 状态
statusShow: false, // 状态呈现
secondRate: 0, // 待完成率
tishi: false, // 提示信息展示
thirdRate: 0, // 待补卡率
......@@ -260,8 +266,8 @@
recordListIndex: 1, // 我的打卡记录切换
returnCashData: {}, // 总数据
todayData: [], // 当天卡
currentTime: '',
dangqianTimer: '',
currentTime: '', // 当前时间
dangqianTimer: '', // 后台返回时间
recordList: [{ title: '待开课' }, { title: '待完成' }, { title: '待补卡' }, { title: '打卡完成' }]
}
},
......@@ -328,6 +334,7 @@
this.status = status;
this.typeStatus = type;
this.ruleShow = 0;
this.statusShow = false;
if(status !== 1) {
if(this.hasEnded && this.forthRate !== 100) {
// 今日和其他课程切换
......@@ -344,8 +351,9 @@
// 判断去学习还是去提交
getCardGoApi(this.modelData.ele_id, this.modelData.id, this.modelData.periods_id, getCardGoData).then(res => {
this.goWhere = res.go_where;
this.statusShow = true;
let currentTime = this.timerAddLing(new Date().getFullYear()) + '-' + this.timerAddLing(new Date().getMonth() + 1) + '-' + this.timerAddLing(new Date().getDate())
let da = new Date(currentTime).getTime()
let da = new Date(currentTime).getTime();
let dangqianTimer = new Date(this.modelData.push_time).getTime();
if(da == dangqianTimer) {
this.modelData.state = res.go_where === 1 ? '待学习' : '未提交'
......@@ -355,7 +363,8 @@
document.querySelectorAll('.uiyiyi')[0].innerText = this.modelData.state
})
}else {
this.modelData.state = status === 3 ? '待补卡' : '打卡完成'
this.modelData.state = status === 3 ? '待补卡' : '打卡完成';
this.statusShow = true;
document.querySelectorAll('.uiyiyi')[0].innerText = this.modelData.state
}
if(document.querySelectorAll('.get-stars-btn')[0])
......@@ -376,14 +385,9 @@
* @param dataObj
*/
modelDataClick(dataObj, type) {
console.log(this.status)
let getCardGoData = { start_at: this.$route.query.start_at, over_at: this.$route.query.over_at, push_time: dataObj.push_time, type: type };
if(this.status === 2) {
// 点击去学习和去提交
/*if(this.goWhere === 1) {
// 进入课程
this.getLessonDetailFn(dataObj)
}else*/
if(this.goWhere !== 1){
// 用户看课统计
getUserWatchApi({ category_id: dataObj.id }).then(res => {
......@@ -399,7 +403,7 @@
this.tishi = true
setTimeout(() => { this.tishi = false, this.punchClockModel = false }, 1500)
document.querySelectorAll('.get-stars-btn')[0].style.display = 'none';
this.lastValue = this.lastValue - 10
this.lastValue = this.lastValue - 10;
this.modelData.tishi = `补卡:消耗10星星补卡1次,当前共有${ this.lastValue }颗星星`
this.returnCash(2)
})
......@@ -521,7 +525,7 @@
.rule {
width: 54 * @toVw;
height: 30 * @toVw;
line-height: 30 * @toVw;
line-height: 7.666667vw;
background: rgba(0, 0, 0, .5);
border-radius: 50px 0 0 50px;
position: fixed;
......@@ -548,26 +552,7 @@
color: #FFFFFF;
text-align: center;
}
/* 倒计时 */
.punch-the-clock-name-content-timer {
padding: 8 * @toVw 0 0;
box-sizing: border-box;
font-size: 12 * @toVw;
color: #75290D;
span {
vertical-align: middle;
}
.timer {
width: 20 * @toVw;
height: 20 * @toVw;
line-height: 20 * @toVw;
margin: 0 3 * @toVw;
display: inline-block;
background: #FFEEED;
border-radius: 4 * @toVw;
text-align: center;
}
}
/* 完成率 */
.punch-the-clock-name-content-completion {
width: 288 * @toVw;
......@@ -702,10 +687,11 @@
/* 恭喜您已获得奖励 快联系班主任领取吧! */
.punch-the-clock-reward {
width: 335 * @toVw;
height: 275 * @toVw;
margin-top: 10 * @toVw;
padding-top: 15 * @toVw;
background: #FFFFFF;
height: 167 * @toVw;
margin-top: -18 * @toVw;
padding: 70 * @toVw 24 * @toVw 0;
background: url("../../assets/punchTheClock/gaozhi.png") no-repeat;
background-size: 100% 100%;
border-radius: 10 * @toVw;
box-sizing: border-box;
text-align: center;
......@@ -714,28 +700,12 @@
font-weight: 500;
color: #BB3E00;
}
.punch-the-clock-reward-erweima {
width: 170 * @toVw;
height: 170 * @toVw;
margin-top: 5 * @toVw;
background: #FFE1AE;
border-right: 7 * @toVw;
position: relative;
.punch-the-clock-reward-erweima-ma {
width: 150 * @toVw;
height: 150 * @toVw;
background: #BDBDBD;
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
margin: auto;
img {
width: 100%;
height: 100%;
}
}
.punch-the-clock-reward-content {
line-height: 21 * @toVw;
font-size: 14 * @toVw;
font-weight: 500;
text-align: left;
color: #505050;
}
}
/* 今日卡 */
......@@ -755,8 +725,7 @@
.today-list {
width: 335 * @toVw;
margin-top: 10 * @toVw;
padding: 19 * @toVw 20 * @toVw 14 * @toVw;
padding: 0 15 * @toVw 14 * @toVw;
background: #FFFFFF;
border-radius: 10 * @toVw;
box-sizing: border-box;
......@@ -790,31 +759,40 @@
}
}
.day {
font-size: 15 * @toVw;
width: 116 * @toVw;
font-size: 14 * @toVw;
font-weight: 500;
color: #6B5617;
}
.day-small {
padding-top: 3 * @toVw;
font-size: 10 * @toVw;
color: #AF5D21;
}
.small-title {
width: 97 * @toVw;
margin: 0;
padding-top: 3 * @toVw;
overflow: hidden;
text-overflow:ellipsis;
white-space: nowrap;
font-size: 12 * @toVw;
padding-top: 13 * @toVw;
text-align: left;
color: #A6A59F;
}
.title {
width: 97 * @toVw;
margin: 0;
padding-top: 3 * @toVw;
overflow: hidden;
text-overflow:ellipsis;
white-space: nowrap;
font-size: 12 * @toVw;
padding-top: 9 * @toVw;
color: #A6A59F;
}
.punch-card-today-learning {
width: 87 * @toVw;
height: 57 * @toVw;
width: 23.2vw;
height: 15.2vw;
img {
width: 100%;
height: 100%;
......@@ -828,13 +806,18 @@
text-align: center;
}
&:first-child {
padding-right: 14 * @toVw;
padding-right: 2.733333vw;
}
&:last-child {
padding-left: 8 * @toVw;
padding-left: 1.133333vw;
}
}
.punch-card-today-list {
width: 87 * @toVw;
padding-top: 1 * @toVw;
}
.today-list-null {
padding: 80 * @toVw 0 110 * @toVw;
.null-tu {
......@@ -853,6 +836,12 @@
}
}
}
.today-list-padding {
margin-top: 10 * @toVw;
padding: 19 * @toVw 15 * @toVw 14 * @toVw;
}
/* 已完成人数 */
.punch-the-clock-completed-persons {
width: 100%;
......@@ -936,6 +925,38 @@
}
}
}
/* 倒计时 */
.count-down {
width: 305 * @toVw;
height: 34 * @toVw;
margin-top:15 * @toVw;
background: #F76D39;
border-radius: 8 * @toVw;
display: table;
.punch-the-clock-name-content-timer {
display: table-cell;
vertical-align: middle;
box-sizing: border-box;
font-size: 12 * @toVw;
color: #FFFFFF;
span {
vertical-align: middle;
}
.timer {
width: 20 * @toVw;
height: 20 * @toVw;
line-height: 20 * @toVw;
margin: 0 3 * @toVw;
display: inline-block;
background: #FFEEED;
border-radius: 4 * @toVw;
text-align: center;
color: #75290D;
}
}
}
}
/* 弹框 */
.punch-the-clock-model {
......@@ -989,6 +1010,7 @@
font-size: 14 * @toVw;
color: #333333;
.small-title {
margin: 0;
color: #ff7d7a;
font-weight: 500;
}
......@@ -1052,13 +1074,14 @@
.rule-content {
margin-top: 16 * @toVw;
height: 295 * @toVw;
line-height: 7.666667vw;
line-height: 25 * @toVw;
overflow: auto;
-webkit-overflow-scrolling: touch;
.rule-content-list {
width: 100%;
font-size: 13 * @toVw;
.title {
margin: 0;
font-weight: 500;
color: #333333;
}
......
......@@ -571,6 +571,12 @@ const router = new Router({
name: 'punchTheClock',
component: e => require(['@/components/punchTheClock'], e)
},
// 微信跳转支付宝
{
path: '/guidelines',
name: 'guidelines',
component: e => require(['@/components/buy/guidelines'], e)
},
{
path: '*',
component: () => import('@/components/error'),
......
......@@ -431,3 +431,9 @@ const getNewCashUrl = `${_baseUrl}api/client/new/return/cash/`
export const getNewCashApi = function (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 {
}
}
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, ' '))
}
}
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