Commit 465e9148 authored by IvyXia123's avatar IvyXia123

20191009-打卡

parent ae07b3e9
<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" />
...@@ -74,7 +71,7 @@ ...@@ -74,7 +71,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)">
...@@ -85,8 +82,7 @@ ...@@ -85,8 +82,7 @@
</div> </div>
</li> </li>
</ul> </ul>
</div> </div>-->
<footer> <footer>
<div class="sub-block"> <div class="sub-block">
...@@ -95,8 +91,11 @@ ...@@ -95,8 +91,11 @@
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">
...@@ -131,753 +130,765 @@ ...@@ -131,753 +130,765 @@
</template> </template>
<script> <script>
import { Toast } from "vant"; import { Toast } from "vant";
import { import {
getUserAdressApi, getUserAdressApi,
getGoodsDetailApi, getGoodsDetailApi,
payApi, payApi,
getwechatParam, getwechatParam,
getStatusWechatApi, getStatusWechatApi,
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 { bindMobile: {
bindMobile: { show: false,
show: false, mobile: "",
mobile: "", img_code: "",
img_code: "", verify_code: "",
verify_code: "", flag: false
flag: false },
}, iconRe: icon_re,
iconRe: icon_re, icon_re_acitve: icon_re_acitve,
icon_re_acitve: icon_re_acitve, lineImage: lineImage,
lineImage: lineImage, youHuiUrl: youHuiUrl,
youHuiUrl: youHuiUrl, leftG: leftG,
leftG: leftG, addressImg: addressImg,
addressImg: addressImg, addressPop: false,
addressPop: false, clock: clock,
clock: clock, groupDetail: false,
groupDetail: false, popupVisible: true,
popupVisible: true, orderFlag: false,
orderFlag: false, shopId: "",
shopId: "", salePop: {
salePop: { show: false,
show: false, id: ""
id: "" },
}, saleObj: null,
saleObj: null, hasMObile:
hasMObile: !JSON.parse(localStorage.getItem("userDesc")).mobile ||
!JSON.parse(localStorage.getItem("userDesc")).mobile || JSON.parse(localStorage.getItem("userDesc")).mobile === "",
JSON.parse(localStorage.getItem("userDesc")).mobile === "", userDetail: JSON.parse(localStorage.getItem("userDesc")),
userDetail: JSON.parse(localStorage.getItem("userDesc")), // mobile:'',
// mobile:'', group_order_id: null,
group_order_id: null, addressObj: false,
addressObj: false, price: "",
price: "", invite_code: "",
invite_code: "", type: this.$route.query.type,
type: this.$route.query.type, jsApiParameters: "",
jsApiParameters: "", orderNo: "",
orderNo: "", canSale: false,
canSale: false, popup_img: popup_img,
popup_img: popup_img, orderCancel: false,
orderCancel: false, 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() { };
this.initPage(); },
mounted() {
this.initPage();
},
filters: {
price(value) {
return (value / 100).toFixed(1);
}
},
computed: {
priceTotal() {
let priceT = 0;
if (this.type) {
priceT = this.groupDetail.original_price;
} else {
priceT = this.groupDetail.current_price;
}
if (this.saleObj) {
priceT = priceT - this.saleObj.money;
}
priceT = (priceT / 100).toFixed(2);
let str = priceT.toString();
if (str.length > 1) {
str = str.split(".")[1];
if (str === "0") priceT = parseInt(priceT);
}
return priceT;
}
},
methods: {
copy(e) {
if(this.payIndex === 1) {
Toast("支付宝支付获取成功,请把粘贴到支付宝里");
}else if(this.payIndex === 2) {
Toast("信用卡支付获取成功");
}
}, },
filters: { onError() {
price(value) { if(this.payIndex === 1) {
return (value / 100).toFixed(1); Toast("信用卡支付获取成功");
} }
}, },
computed: { // 支付方式
priceTotal() { payListClick(val) {
let priceT = 0; this.payIndex = val
if (this.type) { },
priceT = this.groupDetail.original_price; recursion() {
} else { getCourseInfoApi().then(res => {
priceT = this.groupDetail.current_price; if(res.status){
} this.userCourse = JSON.parse(JSON.stringify(res));
if (this.saleObj) { localStorage.setItem("userCourse", JSON.stringify(this.userCourse));
priceT = priceT - this.saleObj.money; this.navPage(res);
} }else{
priceT = (priceT / 100).toFixed(2); setTimeout(() => {
let str = priceT.toString(); this.recursion()
if (str.length > 1) { }, 500);
str = str.split(".")[1];
if (str === "0") priceT = parseInt(priceT);
} }
return priceT; });
}
}, },
methods: { jsApiCall: function() {
// 支付方式 let that = this;
payListClick(val) { WeixinJSBridge.invoke(
this.orderFlag = true; "getBrandWCPayRequest",
this.payIndex = val that.jsApiParameters,
}, function(res) {
recursion() { that.orderFlag = true;
getCourseInfoApi().then(res => { console.log(res,110);
if(res.status){ if (res.err_msg === "get_brand_wcpay_request:ok") {
this.userCourse = JSON.parse(JSON.stringify(res)); // 支付成功后处理
localStorage.setItem("userCourse", JSON.stringify(this.userCourse)); console.log(237)
this.navPage(res); Toast("支付成功");
}else{
setTimeout(() => { setTimeout(() => {
this.recursion() console.log(238)
}, 500); getCourseInfoApi().then(res => {
} that.userCourse = JSON.parse(JSON.stringify(res));
}); localStorage.setItem(
}, "userCourse",
jsApiCall: function() { JSON.stringify(that.userCourse)
let that = this; );
WeixinJSBridge.invoke( that.navPage(res);
"getBrandWCPayRequest", });
that.jsApiParameters, }, 1500);
function(res) {
that.orderFlag = true;
if (res.err_msg === "get_brand_wcpay_request:ok") {
// 支付成功后处理
Toast("支付成功");
setTimeout(() => {
getCourseInfoApi().then(res => {
that.userCourse = JSON.parse(JSON.stringify(res));
localStorage.setItem(
"userCourse",
JSON.stringify(that.userCourse)
);
that.navPage(res);
});
}, 1500);
}
if (res.err_msg === "get_brand_wcpay_request:fail") {
}
if (res.err_msg === "get_brand_wcpay_request:cancel") {
that.orderCancel = true;
}
}
);
},
chooseSale(data) {
this.saleObj = data;
},
showSale() {
this.salePop.id = this.shopId;
this.salePop.show = true;
},
buttonClick(buttonType, buttonName) {
this.$sa.track("buttonClick", {
tabTitle : "商品",
moduleTitle : "购买页",
buttonType : buttonType,
buttonName : buttonName
});
},
goToBuyPage() {
Toast("提交成功");
this.bindMobile.show = false;
},
payOrder(flag) {
console.log(flag)
let type = this.type ? 0 : 1;
let that = this;
this.orderCancel = false;
if (
!JSON.parse(localStorage.getItem("userDesc")).mobile ||
JSON.parse(localStorage.getItem("userDesc")).mobile === ""
) {
this.bindMobile.flag = type;
this.bindMobile.show = true;
setTimeout(() => {
this.$sa.track("ViewRegisterpage", {});
}, 1000);
} else if (flag) {
let json = {
goods_id: Number(this.shopId)
};
if (this.groupDetail.is_real === 1 && !this.addressObj) {
Toast("请填写地址");
return false;
}
if (this.groupDetail.goods_type === 2 && !this.type) {
json.buy_type = 2;
}
if (this.invite_code) {
json.invite_code = this.invite_code;
}
if (this.saleObj) {
json.order_coupon_id = this.saleObj.id;
}
let invite = this.$route.query.invite_code;
this.$sa.track("placeOrder", {
buyType: this.groupDetail.goods_type === 2 && !this.type ? "团购" : "直购",
couponAmount: this.saleObj ? Number(this.saleObj.money / 100) : 0,
paymentAmount: Number(this.priceTotal),
goodsID: this.shopId.toString(),
salesType: invite ? invite.split("-")[1] : "null",
salesID: invite ? Number(invite.split("-")[2]) : 0
});
console.log(window.location.href.indexOf("gdt_vid"))
if(window.location.href.indexOf("gdt_vid") > -1){
json.gdt_vid = localStorage.getItem("gdt_vid")
}
if(window.location.href.indexOf("group_order_id") > -1){
json.cct_user_id = localStorage.getItem("cct_user_id")
} }
if (window.location.href.indexOf("group_order_id") > -1) { // alert(res.errMsg)
json.group_order_id = this.$route.query.group_order_id; // alert(res.err_msg)
if (res.err_msg === "get_brand_wcpay_request:fail") {
} }
this.orderFlag = false; if (res.err_msg === "get_brand_wcpay_request:cancel") {
that.orderCancel = true;
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)
);
this.navPage(res);
});
} else {
let that = this;
this.orderNo = res.out_trade_no;
this.jsApiParameters = res;
wx.miniProgram.getEnv(function(res) {
if (res.miniprogram) {
let payParam = encodeURIComponent(JSON.stringify(json));
wx.miniProgram.navigateTo({
url: `pages/wxPay/main?payParam=${payParam}`
});
} else if (typeof WeixinJSBridge === "undefined") {
if (document.addEventListener) {
document.addEventListener(
"WeixinJSBridgeReady",
that.jsApiCall,
false
);
} else if (document.attachEvent) {
document.attachEvent("WeixinJSBridgeReady", that.jsApiCall);
document.attachEvent(
"onWeixinJSBridgeReady",
that.jsApiCall
);
}
} else {
that.jsApiCall();
}
});
}
})
.catch(res => {
// alert(res)
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) { },
this.addressPop = data; chooseSale(data) {
this.initPage(); this.saleObj = data;
}, },
showAdd() { showSale() {
this.addressPop = true; this.salePop.id = this.shopId;
}, this.salePop.show = true;
initPage() { },
Toast.loading({ buttonClick(buttonType, buttonName) {
mask: true, this.$sa.track("buttonClick", {
message: "" tabTitle: "商品",
}); moduleTitle: "购买页",
sessionStorage.setItem("buyindex", 1); buttonType: buttonType,
getwechatParam({ api_list: "chooseWXPay" }).then(res => { buttonName: buttonName
wx.config({ });
debug: false, },
appId: res.appId, goToBuyPage() {
timestamp: parseInt(res.timestamp), Toast("提交成功");
nonceStr: res.nonceStr, this.bindMobile.show = false;
signature: res.signature, },
jsApiList: res.jsApiList payOrder(flag) {
}); let type = this.type ? 0 : 1;
}); let that = this;
getUserAdressApi().then(res => { this.orderCancel = false;
this.addressObj = res; if (
}); !JSON.parse(localStorage.getItem("userDesc")).mobile ||
this.shopId = this.$route.query.shopId; JSON.parse(localStorage.getItem("userDesc")).mobile === ""
this.group_order_id = this.$route.query.group_order_id; ) {
getCouponListApi(this.shopId).then(res => { this.bindMobile.flag = type;
if (res.length > 0) { this.bindMobile.show = true;
let x = { money: 0 }; setTimeout(() => {
for (let k = 0; k < res.length; k++) { this.$sa.track("ViewRegisterpage", {});
x = res[k].money > x.money ? res[k] : x; }, 1000);
} } else if (flag) {
this.saleObj = x; let json = {
this.canSale = true; goods_id: Number(this.shopId)
} };
if (this.groupDetail.is_real === 1 && !this.addressObj) {
Toast("请填写地址");
return false;
}
if (this.groupDetail.goods_type === 2 && !this.type) {
json.buy_type = 2;
}
if (this.invite_code) {
json.invite_code = this.invite_code;
}
if (this.saleObj) {
json.order_coupon_id = this.saleObj.id;
}
let invite = this.$route.query.invite_code;
this.$sa.track("placeOrder", {
buyType: this.groupDetail.goods_type === 2 && !this.type ? "团购" : "直购",
couponAmount: this.saleObj ? Number(this.saleObj.money / 100) : 0,
paymentAmount: Number(this.priceTotal),
goodsID: this.shopId.toString(),
salesType: invite ? invite.split("-")[1] : "null",
salesID: invite ? Number(invite.split("-")[2]) : 0
}); });
getGoodsDetailApi(this.shopId).then(data => { console.log(window.location.href.indexOf("gdt_vid"))
// debugger if(window.location.href.indexOf("gdt_vid") > -1){
data.desc = JSON.parse(data.desc); json.gdt_vid = localStorage.getItem("gdt_vid")
data.goods_desc = JSON.parse(data.goods_desc); }
data.share_desc = JSON.parse(data.share_desc); if(window.location.href.indexOf("group_order_id") > -1){
this.groupDetail = JSON.parse(JSON.stringify(data)); json.cct_user_id = localStorage.getItem("cct_user_id")
localStorage.setItem("groupDetail", JSON.stringify(data)); }
console.log(this.groupDetail, 408); if (window.location.href.indexOf("group_order_id") > -1) {
this.invite_code = this.$route.query.invite_code; json.group_order_id = this.$route.query.group_order_id;
if (this.type && this.type === 0) { }
this.price = data.single_price / 100; this.orderFlag = false;
} else {
this.price = data.group_price / 100; /*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 }
getStatusWechatApi({ goods_id: this.shopId }).then(res => { postPayBillApi(data).then(res => {
Toast.clear(); if(this.payIndex === 0) {
let orderData = res; 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 => {
this.orderNo = res.out_trade_no; this.orderNo = res.out_trade_no;
if (res.out_trade_no) { console.log(res)
if (res.out_trade_no && !res.appId) {
getCourseInfoApi().then(res => { getCourseInfoApi().then(res => {
this.userCourse = JSON.parse(JSON.stringify(res)); this.userCourse = res;
localStorage.setItem( localStorage.setItem(
"userCourse", "userCourse",
JSON.stringify(this.userCourse) JSON.stringify(this.userCourse)
); );
this.navPage(res); this.navPage(res);
console.log(res, 424); });
} else {
let that = this;
this.orderNo = res.out_trade_no;
this.jsApiParameters = res;
wx.miniProgram.getEnv(function(res) {
if (res.miniprogram) {
let payParam = encodeURIComponent(JSON.stringify(json));
wx.miniProgram.navigateTo({
url: `pages/wxPay/main?payParam=${payParam}`
});
} else if (typeof WeixinJSBridge === "undefined") {
if (document.addEventListener) {
document.addEventListener(
"WeixinJSBridgeReady",
that.jsApiCall,
false
);
} else if (document.attachEvent) {
document.attachEvent("WeixinJSBridgeReady", that.jsApiCall);
document.attachEvent(
"onWeixinJSBridgeReady",
that.jsApiCall
);
}
} else {
that.jsApiCall();
}
}); });
} }
}); })
this.$nextTick(() => { .catch(res => {
// alert(res)
this.orderFlag = true; this.orderFlag = true;
}); });
}
},
closeAdd(data) {
this.addressPop = data;
this.initPage();
},
showAdd() {
this.addressPop = true;
},
initPage() {
Toast.loading({
mask: true,
message: ""
});
sessionStorage.setItem("buyindex", 1);
getwechatParam({ api_list: "chooseWXPay" }).then(res => {
wx.config({
debug: false,
appId: res.appId,
timestamp: parseInt(res.timestamp),
nonceStr: res.nonceStr,
signature: res.signature,
jsApiList: res.jsApiList
}); });
}, });
navPage(res) { getUserAdressApi().then(res => {
console.log(res, 437); this.addressObj = res;
console.log(this.groupDetail); });
if ( this.shopId = this.$route.query.shopId;
res.teacher_alias && this.group_order_id = this.$route.query.group_order_id;
res.teacher_alias.substr(0, 1) == 1 && getCouponListApi(this.shopId).then(res => {
this.groupDetail.goods_type != 4 && if (res.length > 0) {
this.userDetail.open_info.is_subscribe == 1 let x = { money: 0 };
) { for (let k = 0; k < res.length; k++) {
this.$router.push({ x = res[k].money > x.money ? res[k] : x;
name: "guide", }
query: { shopId: this.shopId } this.saleObj = x;
}); this.canSale = true;
}
});
getGoodsDetailApi(this.shopId).then(data => {
// debugger
data.desc = JSON.parse(data.desc);
data.goods_desc = JSON.parse(data.goods_desc);
data.share_desc = JSON.parse(data.share_desc);
this.groupDetail = JSON.parse(JSON.stringify(data));
sessionStorage.setItem("groupDetail", JSON.stringify(data));
console.log(this.groupDetail, 408);
this.invite_code = this.$route.query.invite_code;
if (this.type && this.type === 0) {
this.price = data.single_price / 100;
} else { } else {
if (this.groupDetail.goods_type === 2 && !this.type) { this.price = data.group_price / 100;
this.$router.push({ }
name: "success", getStatusWechatApi({ goods_id: this.shopId }).then(res => {
query: { Toast.clear();
out_trade_no: this.orderNo, let orderData = res;
invite_code: this.invite_code, this.orderNo = res.out_trade_no;
shopId: this.shopId if (res.out_trade_no) {
} getCourseInfoApi().then(res => {
}); this.userCourse = JSON.parse(JSON.stringify(res));
} else if (this.groupDetail.goods_type === 4) { localStorage.setItem(
this.$router.push({ "userCourse",
name: "saleSuccess", JSON.stringify(this.userCourse)
query: { );
out_trade_no: this.orderNo, this.navPage(res);
invite_code: this.invite_code, console.log(res, 424);
shopId: this.shopId
}
});
} else {
this.$router.push({
name: "buySuccess",
query: {
out_trade_no: this.orderNo,
invite_code: this.invite_code,
shopId: this.shopId
}
}); });
} }
});
this.$nextTick(() => {
this.orderFlag = true;
});
});
},
navPage(res) {
console.log(res, 437);
console.log(this.groupDetail);
if (
res.teacher_alias &&
res.teacher_alias.substr(0, 1) == 1 &&
this.groupDetail.goods_type != 4 &&
this.userDetail.open_info.is_subscribe == 1
) {
this.$router.push({
name: "guide",
query: { shopId: this.shopId }
});
} else {
if (this.groupDetail.goods_type === 2 && !this.type) {
this.$router.push({
name: "success",
query: {
out_trade_no: this.orderNo,
invite_code: this.invite_code,
shopId: this.shopId
}
});
} else if (this.groupDetail.goods_type === 4) {
this.$router.push({
name: "saleSuccess",
query: {
out_trade_no: this.orderNo,
invite_code: this.invite_code,
shopId: this.shopId
}
});
} else {
this.$router.push({
name: "buySuccess",
query: {
out_trade_no: this.orderNo,
invite_code: this.invite_code,
shopId: this.shopId
}
});
} }
} }
} }
}; }
};
</script> </script>
<style scoped lang="less"> <style scoped lang="less">
@import "../../util/public"; @import "../../util/public";
img {
max-width: none;
}
.slide-fade-enter-active {
transition: all 0.5s ease;
}
.you-block {
font-size: 16 * @toVw;
font-family: PingFang-SC-Medium;
font-weight: 500;
color: rgba(0, 0, 0, 1);
line-height: 40 * @toVw;
margin-top: 10 * @toVw;
height: 40 * @toVw;
padding: 5 * @toVw 15 * @toVw;
background: white;
img { img {
max-width: none; width: 16 * @toVw;
margin-left: 8 * @toVw;
vertical-align: middle;
} }
.slide-fade-enter-active { .you-content {
transition: all 0.5s ease; float: right;
color: #999999;
font-size: 14 * @toVw;
} }
.you-block { }
font-size: 16 * @toVw; .orderCancel {
font-family: PingFang-SC-Medium; top: 45%;
font-weight: 500; background: transparent;
color: rgba(0, 0, 0, 1); .box {
line-height: 40 * @toVw; width: 315 * @toVw;
margin-top: 10 * @toVw; }
height: 40 * @toVw; .img {
padding: 5 * @toVw 15 * @toVw; width: 315 * @toVw;
background: white; }
img { .content {
width: 16 * @toVw; position: absolute;
margin-left: 8 * @toVw; width: 315 * @toVw;
vertical-align: middle; top: 112 * @toVw;
left: 0;
text-align: center;
h2 {
font-size: 25 * @toVw;
color: #6c6c6c;
} }
.you-content { p {
float: right;
color: #999999;
font-size: 14 * @toVw; font-size: 14 * @toVw;
color: #999999;
margin: 20 * @toVw 0 0;
} }
} .warn {
.orderCancel { font-size: 15 * @toVw;
top: 45%; color: #ec612a;
background: transparent; margin: 10 * @toVw 0 25 * @toVw;
.box { font-weight: bold;
width: 315 * @toVw;
}
.img {
width: 315 * @toVw;
} }
.content { .btnbox {
position: absolute; display: flex;
width: 315 * @toVw; .btn {
top: 112 * @toVw; width: 118 * @toVw;
left: 0; height: 40 * @toVw;
text-align: center; line-height: 40 * @toVw;
h2 {
font-size: 25 * @toVw;
color: #6c6c6c;
}
p {
font-size: 14 * @toVw; font-size: 14 * @toVw;
color: #999999; color: white;
margin: 20 * @toVw 0 0; border-radius: 20 * @toVw;
}
.warn {
font-size: 15 * @toVw;
color: #ec612a;
margin: 10 * @toVw 0 25 * @toVw;
font-weight: bold; font-weight: bold;
} }
.btnbox { .fal {
display: flex; background: #f8d56b;
.btn { box-shadow: 0px 4px 0px 0px rgba(239, 147, 70, 0.97);
width: 118 * @toVw; }
height: 40 * @toVw; .suc {
line-height: 40 * @toVw; background: #ec612a;
font-size: 14 * @toVw; box-shadow: 0px 4px 0px 0px rgba(190, 61, 10, 0.97);
color: white;
border-radius: 20 * @toVw;
font-weight: bold;
}
.fal {
background: #f8d56b;
box-shadow: 0px 4px 0px 0px rgba(239, 147, 70, 0.97);
}
.suc {
background: #ec612a;
box-shadow: 0px 4px 0px 0px rgba(190, 61, 10, 0.97);
}
} }
} }
} }
}
.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;
outline: none; outline: none;
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;
background-size: 100% auto; background-size: 100% auto;
.title-top { .title-top {
color: white; color: white;
font-size: 14 * @toVw; font-size: 14 * @toVw;
font-family: PingFang-SC-Bold;
font-weight: bold;
color: rgba(255, 255, 255, 1);
line-height: 60 * @toVw;
span {
vertical-align: middle;
}
img {
width: 20 * @toVw;
vertical-align: middle;
margin-right: 5 * @toVw;
}
}
.user-message {
border-radius: 8 * @toVw;
position: relative;
background: white;
padding: 20 * @toVw 40 * @toVw;
box-shadow: 0 1 * @toVw 20 * @toVw -3 * @toVw rgba(255, 77, 84, 0.2);
margin-bottom: 10 * @toVw;
.icon-left {
width: 10 * @toVw;
position: absolute;
right: 17 * @toVw;
top: 50%;
margin-top: -8 * @toVw;
}
.add-address {
line-height: 50 * @toVw;
text-align: center;
font-size: 16 * @toVw;
font-family: PingFang-SC-Bold; font-family: PingFang-SC-Bold;
font-weight: bold; font-weight: bold;
color: rgba(255, 255, 255, 1); color: #666666;
line-height: 60 * @toVw;
span {
vertical-align: middle;
}
img {
width: 20 * @toVw;
vertical-align: middle;
margin-right: 5 * @toVw;
}
} }
.user-message { .icon-address {
border-radius: 8 * @toVw; width: 12 * @toVw;
position: relative; position: absolute;
background: white; top: 23 * @toVw;
padding: 20 * @toVw 40 * @toVw; left: 17 * @toVw;
box-shadow: 0 1 * @toVw 20 * @toVw -3 * @toVw rgba(255, 77, 84, 0.2); }
margin-bottom: 10 * @toVw; .address-content {
.icon-left { .name {
width: 10 * @toVw;
position: absolute;
right: 17 * @toVw;
top: 50%;
margin-top: -8 * @toVw;
}
.add-address {
line-height: 50 * @toVw;
text-align: center;
font-size: 16 * @toVw; font-size: 16 * @toVw;
font-family: PingFang-SC-Bold; font-family: PingFang-SC-Bold;
font-weight: bold; font-weight: bold;
color: #666666; color: rgba(0, 0, 0, 1);
} .mobile {
.icon-address { display: inline-block;
width: 12 * @toVw; margin-left: 10 * @toVw;
position: absolute; font-size: 14 * @toVw;
top: 23 * @toVw;
left: 17 * @toVw;
}
.address-content {
.name {
font-size: 16 * @toVw;
font-family: PingFang-SC-Bold;
font-weight: bold;
color: rgba(0, 0, 0, 1);
.mobile {
display: inline-block;
margin-left: 10 * @toVw;
font-size: 14 * @toVw;
font-family: PingFang-SC-Medium;
font-weight: 500;
color: rgba(0, 0, 0, 1);
}
}
.address {
font-size: 12 * @toVw;
font-family: PingFang-SC-Medium; font-family: PingFang-SC-Medium;
font-weight: 500; font-weight: 500;
color: rgba(102, 102, 102, 1); color: rgba(0, 0, 0, 1);
margin-top: 7 * @toVw;
}
}
}
}
background: #f0f0f0;
.shop-block {
background: white;
padding-top: 10 * @toVw;
.shop {
position: relative;
padding-bottom: 20 * @toVw;
&:after {
content: "";
display: block;
clear: both;
}
.img-block {
float: left;
margin-right: 20/7.5vw;
img {
width: 80 * @toVw;
} }
} }
.title { .address {
font-size: 16 * @toVw;
font-family: PingFang-SC-Bold;
font-weight: bold;
color: rgba(0, 0, 0, 1);
}
.content {
font-size: 12 * @toVw; font-size: 12 * @toVw;
margin-top: 8 * @toVw;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
font-family: PingFang-SC-Medium; font-family: PingFang-SC-Medium;
font-weight: 500; font-weight: 500;
color: rgba(102, 102, 102, 1); color: rgba(102, 102, 102, 1);
margin-top: 7 * @toVw;
} }
.price { }
font-size: 16 * @toVw; }
margin-top: 15 * @toVw; }
background: #f0f0f0;
.shop-block {
background: white;
padding-top: 10 * @toVw;
.shop {
position: relative;
padding-bottom: 20 * @toVw;
&:after {
content: "";
display: block;
clear: both;
}
.img-block {
float: left;
margin-right: 20/7.5vw;
img {
width: 80 * @toVw;
}
}
.title {
font-size: 16 * @toVw;
font-family: PingFang-SC-Bold;
font-weight: bold;
color: rgba(0, 0, 0, 1);
}
.content {
font-size: 12 * @toVw;
margin-top: 8 * @toVw;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
font-family: PingFang-SC-Medium;
font-weight: 500;
color: rgba(102, 102, 102, 1);
}
.price {
font-size: 16 * @toVw;
margin-top: 15 * @toVw;
font-family: PingFang-SC-Medium;
font-weight: 500;
color: rgba(248, 78, 78, 1);
.origina {
font-size: 12 * @toVw;
text-decoration: line-through;
font-family: PingFang-SC-Medium; font-family: PingFang-SC-Medium;
font-weight: 500; font-weight: 500;
color: rgba(248, 78, 78, 1); color: rgba(153, 153, 153, 1);
.origina {
font-size: 12 * @toVw;
text-decoration: line-through;
font-family: PingFang-SC-Medium;
font-weight: 500;
color: rgba(153, 153, 153, 1);
}
} }
} }
} }
}
.pay-list {
width: 100%;
padding-bottom: 80 * @toVw;
.pay-choice {
padding: 15 * @toVw;
font-size: 13 * @toVw;
color: #666;
box-sizing: border-box;
}
.pay-list { .pay {
width: 100%; width: 100%;
padding-bottom: 80 * @toVw; li {
.pay-choice { position: relative;
padding: 15 * @toVw; padding: 14 * @toVw 14 * @toVw;
font-size: 13 * @toVw;
color: #666;
box-sizing: border-box; box-sizing: border-box;
} background: #ffffff;
border-bottom: 1px solid #DFDFDF;
img {
width: 28 * @toVw;
height: 28 * @toVw;
vertical-align: middle;
}
span {
padding-left: 7 * @toVw;
font-size: 15 * @toVw;
color: #333333;
vertical-align: middle;
}
.pay { .icon-re {
width: 100%; width: 18 * @toVw;
li { height: 18 * @toVw;
position: relative; position: absolute;
padding: 14 * @toVw 14 * @toVw; top: 19 * @toVw;
box-sizing: border-box; right: 21 * @toVw;
background: #ffffff;
border-bottom: 1px solid #DFDFDF;
img { img {
width: 28 * @toVw; width: 100%;
height: 28 * @toVw; height: 100%;
vertical-align: middle;
}
span {
padding-left: 7 * @toVw;
font-size: 15 * @toVw;
color: #333333;
vertical-align: middle;
}
.icon-re {
width: 18 * @toVw;
height: 18 * @toVw;
position: absolute;
top: 19 * @toVw;
right: 21 * @toVw;
img {
width: 100%;
height: 100%;
}
}
&:last-child {
border-bottom: none;
} }
} }
&:last-child {
border-bottom: none;
}
} }
}
} }
footer { footer {
position: fixed; position: fixed;
background: white; background: white;
bottom: 0; bottom: 0;
width: 100%; width: 100%;
.sub-block { .sub-block {
padding-left: 20/7.5vw; padding-left: 20/7.5vw;
line-height: 60 * @toVw; line-height: 60 * @toVw;
height: 60 * @toVw; height: 60 * @toVw;
.tips-price { .tips-price {
font-size: 12 * @toVw; font-size: 12 * @toVw;
font-family: PingFang-SC-Medium; font-family: PingFang-SC-Medium;
font-weight: 500; font-weight: 500;
color: rgba(0, 0, 0, 1); color: rgba(0, 0, 0, 1);
display: inline-block; display: inline-block;
vertical-align: middle; vertical-align: middle;
max-width: 125 * @toVw; max-width: 125 * @toVw;
white-space: nowrap; white-space: nowrap;
text-overflow: ellipsis; text-overflow: ellipsis;
overflow: hidden; overflow: hidden;
}
}
span {
font-size: 22 * @toVw;
color: #f83534;
}
.pay-btn {
width: 300/7.5vw;
text-align: center;
float: right;
height: 60 * @toVw;
background: #f83534;
color: white;
font-size: 16 * @toVw;
} }
} }
.address-pop { span {
top: 0; font-size: 22 * @toVw;
bottom: 0; color: #f83534;
left: 0;
right: 0;
position: absolute;
background: white;
} }
.pay-btn {
width: 300/7.5vw;
text-align: center;
float: right;
height: 60 * @toVw;
background: #f83534;
color: white;
font-size: 16 * @toVw;
}
}
.address-pop {
top: 0;
bottom: 0;
left: 0;
right: 0;
position: absolute;
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>
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
<div class="punch-the-clock-name-bg"> <div class="punch-the-clock-name-bg">
<div class="punch-the-clock-name-content"> <div class="punch-the-clock-name-content">
<!-- 倒计时 hasEnded 指是否在规定时间内完成学习 --> <!-- 倒计时 hasEnded 指是否在规定时间内完成学习 -->
<div class="punch-the-clock-name-contentText" v-if="!hasEnded && forthRate != 100">很遗憾,您未在指定时间内完成任务哦</div> <div class="punch-the-clock-name-contentText" v-if="!hasEnded">很遗憾,您未在指定时间内完成任务哦</div>
<div class="punch-the-clock-name-content-timer" v-if="hasEnded"> <div class="punch-the-clock-name-content-timer" v-if="hasEnded">
<span>剩余完成时间</span> <span>剩余完成时间</span>
<span class="timer">{{ countDownDay }}</span> <span class="timer">{{ countDownDay }}</span>
......
...@@ -10,12 +10,10 @@ import VueClipboard from 'vue-clipboard2' ...@@ -10,12 +10,10 @@ 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);
...@@ -48,62 +46,12 @@ Vue.prototype.$sa.quick('autoTrack') ...@@ -48,62 +46,12 @@ 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') {
...@@ -122,16 +70,13 @@ router.beforeEach((to, from, next) => { ...@@ -122,16 +70,13 @@ 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,6 +39,7 @@ const router = new Router({ ...@@ -39,6 +39,7 @@ const router = new Router({
deep: 0, deep: 0,
} }
}, },
{ {
path: '/extensionV1Shop', path: '/extensionV1Shop',
name: 'extensionV1Shop', name: 'extensionV1Shop',
...@@ -570,12 +571,6 @@ const router = new Router({ ...@@ -570,12 +571,6 @@ 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'),
...@@ -604,16 +599,6 @@ router.beforeEach((to, from, next) => { ...@@ -604,16 +599,6 @@ 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
...@@ -625,9 +610,9 @@ router.beforeEach((to, from, next) => { ...@@ -625,9 +610,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);
...@@ -636,30 +621,22 @@ router.beforeEach((to, from, next) => { ...@@ -636,30 +621,22 @@ 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 === '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' ) { 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' ) {
// 无需登录的页面 // 无需登录的页面
console.log(899, to.name) console.log(488)
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,8 +431,3 @@ const getNewCashUrl = `${_baseUrl}api/client/new/return/cash/` ...@@ -431,8 +431,3 @@ 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,32 +118,5 @@ export default { ...@@ -118,32 +118,5 @@ 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