Commit 81b6b31f authored by IvyXia123's avatar IvyXia123

201910-09

parent f739834f
<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,765 +131,753 @@ ...@@ -130,765 +131,753 @@
</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() {
return {
bindMobile: {
show: false,
mobile: "",
img_code: "",
verify_code: "",
flag: false
},
iconRe: icon_re,
icon_re_acitve: icon_re_acitve,
lineImage: lineImage,
youHuiUrl: youHuiUrl,
leftG: leftG,
addressImg: addressImg,
addressPop: false,
clock: clock,
groupDetail: false,
popupVisible: true,
orderFlag: false,
shopId: "",
salePop: {
show: false,
id: ""
},
saleObj: null,
hasMObile:
!JSON.parse(localStorage.getItem("userDesc")).mobile ||
JSON.parse(localStorage.getItem("userDesc")).mobile === "",
userDetail: JSON.parse(localStorage.getItem("userDesc")),
// mobile:'',
group_order_id: null,
addressObj: false,
price: "",
invite_code: "",
type: this.$route.query.type,
jsApiParameters: "",
orderNo: "",
canSale: false,
popup_img: popup_img,
orderCancel: false,
userCourse: {},
payList: [
{ icon: weixin, title: '微信支付', value: 0 },
{ icon: zhifubao, title: '支付宝支付', value: 1 },
{ icon: xinyongka,title: '信用卡分期', value: 2 },
{ icon: fenqi, title: '其他分期', value: 3 },
],
payIndex: 0,
payUrl: ''
};
},
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("信用卡支付获取成功");
}
}, },
onError() { data() {
if(this.payIndex === 1) { return {
Toast("信用卡支付获取成功"); bindMobile: {
} show: false,
mobile: "",
img_code: "",
verify_code: "",
flag: false
},
iconRe: icon_re,
icon_re_acitve: icon_re_acitve,
lineImage: lineImage,
youHuiUrl: youHuiUrl,
leftG: leftG,
addressImg: addressImg,
addressPop: false,
clock: clock,
groupDetail: false,
popupVisible: true,
orderFlag: false,
shopId: "",
salePop: {
show: false,
id: ""
},
saleObj: null,
hasMObile:
!JSON.parse(localStorage.getItem("userDesc")).mobile ||
JSON.parse(localStorage.getItem("userDesc")).mobile === "",
userDetail: JSON.parse(localStorage.getItem("userDesc")),
// mobile:'',
group_order_id: null,
addressObj: false,
price: "",
invite_code: "",
type: this.$route.query.type,
jsApiParameters: "",
orderNo: "",
canSale: false,
popup_img: popup_img,
orderCancel: false,
userCourse: {},
payList: [
{ icon: weixin, title: '微信支付', value: 0 },
{ icon: zhifubao, title: '支付宝支付', value: 1 }
],
payIndex: 0,
};
}, },
// 支付方式 mounted() {
payListClick(val) { this.initPage();
this.payIndex = val
}, },
recursion() { filters: {
getCourseInfoApi().then(res => { price(value) {
if(res.status){ return (value / 100).toFixed(1);
this.userCourse = JSON.parse(JSON.stringify(res)); }
localStorage.setItem("userCourse", JSON.stringify(this.userCourse)); },
this.navPage(res); computed: {
}else{ priceTotal() {
setTimeout(() => { let priceT = 0;
this.recursion() if (this.type) {
}, 500); 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;
}
}, },
jsApiCall: function() { methods: {
let that = this; // 支付方式
WeixinJSBridge.invoke( payListClick(val) {
"getBrandWCPayRequest", this.orderFlag = true;
that.jsApiParameters, this.payIndex = val
function(res) { },
that.orderFlag = true; recursion() {
console.log(res,110); getCourseInfoApi().then(res => {
if (res.err_msg === "get_brand_wcpay_request:ok") { if(res.status){
// 支付成功后处理 this.userCourse = JSON.parse(JSON.stringify(res));
console.log(237) localStorage.setItem("userCourse", JSON.stringify(this.userCourse));
Toast("支付成功"); this.navPage(res);
}else{
setTimeout(() => { setTimeout(() => {
console.log(238) this.recursion()
getCourseInfoApi().then(res => { }, 500);
that.userCourse = JSON.parse(JSON.stringify(res)); }
localStorage.setItem( });
"userCourse", },
JSON.stringify(that.userCourse) jsApiCall: function() {
); let that = this;
that.navPage(res); WeixinJSBridge.invoke(
}); "getBrandWCPayRequest",
}, 1500); that.jsApiParameters,
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;
} }
// alert(res.errMsg) if (this.groupDetail.goods_type === 2 && !this.type) {
// alert(res.err_msg) json.buy_type = 2;
if (res.err_msg === "get_brand_wcpay_request:fail") {
} }
if (res.err_msg === "get_brand_wcpay_request:cancel") { if (this.invite_code) {
that.orderCancel = true; 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) {
json.group_order_id = this.$route.query.group_order_id;
}
this.orderFlag = false;
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) {
chooseSale(data) { this.addressPop = data;
this.saleObj = data; this.initPage();
}, },
showSale() { showAdd() {
this.salePop.id = this.shopId; this.addressPop = true;
this.salePop.show = true; },
}, initPage() {
buttonClick(buttonType, buttonName) { Toast.loading({
this.$sa.track("buttonClick", { mask: true,
tabTitle: "商品", message: ""
moduleTitle: "购买页",
buttonType: buttonType,
buttonName: buttonName
});
},
goToBuyPage() {
Toast("提交成功");
this.bindMobile.show = false;
},
payOrder(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")) sessionStorage.setItem("buyindex", 1);
if(window.location.href.indexOf("gdt_vid") > -1){ getwechatParam({ api_list: "chooseWXPay" }).then(res => {
json.gdt_vid = localStorage.getItem("gdt_vid") wx.config({
} debug: false,
if(window.location.href.indexOf("group_order_id") > -1){ appId: res.appId,
json.cct_user_id = localStorage.getItem("cct_user_id") timestamp: parseInt(res.timestamp),
} nonceStr: res.nonceStr,
if (window.location.href.indexOf("group_order_id") > -1) { signature: res.signature,
json.group_order_id = this.$route.query.group_order_id; jsApiList: res.jsApiList
} });
this.orderFlag = false; });
getUserAdressApi().then(res => {
/*let payTypeArr = ['WX', 'ALI', 'KFQ'] this.addressObj = res;
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 => { this.shopId = this.$route.query.shopId;
if(this.payIndex === 0) { this.group_order_id = this.$route.query.group_order_id;
window.location.href = res.pay_url; getCouponListApi(this.shopId).then(res => {
}else if(this.payIndex === 1){ if (res.length > 0) {
this.payUrl = res.pay_url; let x = { money: 0 };
}else if(this.payIndex === 2) { for (let k = 0; k < res.length; k++) {
this.payUrl = res.pay_url; x = res[k].money > x.money ? res[k] : x;
} }
})*/ this.saleObj = x;
this.canSale = true;
payApi(json).then(res => { }
});
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));
localStorage.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 {
this.price = data.group_price / 100;
}
getStatusWechatApi({ goods_id: this.shopId }).then(res => {
Toast.clear();
let orderData = res;
this.orderNo = res.out_trade_no; this.orderNo = res.out_trade_no;
console.log(res) if (res.out_trade_no) {
if (res.out_trade_no && !res.appId) {
getCourseInfoApi().then(res => { getCourseInfoApi().then(res => {
this.userCourse = res; this.userCourse = JSON.parse(JSON.stringify(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();
}
}); });
} }
}) });
.catch(res => { this.$nextTick(() => {
// 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
}); });
}); },
getUserAdressApi().then(res => { navPage(res) {
this.addressObj = res; console.log(res, 437);
}); console.log(this.groupDetail);
this.shopId = this.$route.query.shopId; if (
this.group_order_id = this.$route.query.group_order_id; res.teacher_alias &&
getCouponListApi(this.shopId).then(res => { res.teacher_alias.substr(0, 1) == 1 &&
if (res.length > 0) { this.groupDetail.goods_type != 4 &&
let x = { money: 0 }; this.userDetail.open_info.is_subscribe == 1
for (let k = 0; k < res.length; k++) { ) {
x = res[k].money > x.money ? res[k] : x;
}
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 {
this.price = data.group_price / 100;
}
getStatusWechatApi({ goods_id: this.shopId }).then(res => {
Toast.clear();
let orderData = res;
this.orderNo = res.out_trade_no;
if (res.out_trade_no) {
getCourseInfoApi().then(res => {
this.userCourse = JSON.parse(JSON.stringify(res));
localStorage.setItem(
"userCourse",
JSON.stringify(this.userCourse)
);
this.navPage(res);
console.log(res, 424);
});
}
});
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({ this.$router.push({
name: "saleSuccess", name: "guide",
query: { query: { shopId: this.shopId }
out_trade_no: this.orderNo,
invite_code: this.invite_code,
shopId: this.shopId
}
}); });
} else { } else {
this.$router.push({ if (this.groupDetail.goods_type === 2 && !this.type) {
name: "buySuccess", this.$router.push({
query: { name: "success",
out_trade_no: this.orderNo, query: {
invite_code: this.invite_code, out_trade_no: this.orderNo,
shopId: this.shopId 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 {
width: 16 * @toVw; max-width: none;
margin-left: 8 * @toVw;
vertical-align: middle;
} }
.you-content { .slide-fade-enter-active {
float: right; transition: all 0.5s ease;
color: #999999;
font-size: 14 * @toVw;
} }
} .you-block {
.orderCancel { font-size: 16 * @toVw;
top: 45%; font-family: PingFang-SC-Medium;
background: transparent; font-weight: 500;
.box { color: rgba(0, 0, 0, 1);
width: 315 * @toVw; line-height: 40 * @toVw;
} margin-top: 10 * @toVw;
.img { height: 40 * @toVw;
width: 315 * @toVw; padding: 5 * @toVw 15 * @toVw;
} background: white;
.content { img {
position: absolute; width: 16 * @toVw;
width: 315 * @toVw; margin-left: 8 * @toVw;
top: 112 * @toVw; vertical-align: middle;
left: 0;
text-align: center;
h2 {
font-size: 25 * @toVw;
color: #6c6c6c;
} }
p { .you-content {
font-size: 14 * @toVw; float: right;
color: #999999; color: #999999;
margin: 20 * @toVw 0 0; font-size: 14 * @toVw;
} }
.warn { }
font-size: 15 * @toVw; .orderCancel {
color: #ec612a; top: 45%;
margin: 10 * @toVw 0 25 * @toVw; background: transparent;
font-weight: bold; .box {
width: 315 * @toVw;
}
.img {
width: 315 * @toVw;
} }
.btnbox { .content {
display: flex; position: absolute;
.btn { width: 315 * @toVw;
width: 118 * @toVw; top: 112 * @toVw;
height: 40 * @toVw; left: 0;
line-height: 40 * @toVw; text-align: center;
h2 {
font-size: 25 * @toVw;
color: #6c6c6c;
}
p {
font-size: 14 * @toVw; font-size: 14 * @toVw;
color: white; color: #999999;
border-radius: 20 * @toVw; margin: 20 * @toVw 0 0;
font-weight: bold;
} }
.fal { .warn {
background: #f8d56b; font-size: 15 * @toVw;
box-shadow: 0px 4px 0px 0px rgba(239, 147, 70, 0.97); color: #ec612a;
margin: 10 * @toVw 0 25 * @toVw;
font-weight: bold;
} }
.suc { .btnbox {
background: #ec612a; display: flex;
box-shadow: 0px 4px 0px 0px rgba(190, 61, 10, 0.97); .btn {
width: 118 * @toVw;
height: 40 * @toVw;
line-height: 40 * @toVw;
font-size: 14 * @toVw;
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: #666666; color: rgba(255, 255, 255, 1);
} line-height: 60 * @toVw;
.icon-address { span {
width: 12 * @toVw; vertical-align: middle;
position: absolute; }
top: 23 * @toVw; img {
left: 17 * @toVw; width: 20 * @toVw;
vertical-align: middle;
margin-right: 5 * @toVw;
}
} }
.address-content { .user-message {
.name { 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-size: 16 * @toVw;
font-family: PingFang-SC-Bold; font-family: PingFang-SC-Bold;
font-weight: bold; font-weight: bold;
color: rgba(0, 0, 0, 1); color: #666666;
.mobile { }
display: inline-block; .icon-address {
margin-left: 10 * @toVw; width: 12 * @toVw;
font-size: 14 * @toVw; position: absolute;
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(0, 0, 0, 1); color: rgba(102, 102, 102, 1);
margin-top: 7 * @toVw;
} }
} }
.address { }
}
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; 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;
}
}
}
}
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;
} }
} .price {
.title { font-size: 16 * @toVw;
font-size: 16 * @toVw; margin-top: 15 * @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(153, 153, 153, 1); color: rgba(248, 78, 78, 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 { .pay-list {
width: 100%; width: 100%;
li { padding-bottom: 80 * @toVw;
position: relative; .pay-choice {
padding: 14 * @toVw 14 * @toVw; padding: 15 * @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;
}
.icon-re { .pay {
width: 18 * @toVw; width: 100%;
height: 18 * @toVw; li {
position: absolute; position: relative;
top: 19 * @toVw; padding: 14 * @toVw 14 * @toVw;
right: 21 * @toVw; box-sizing: border-box;
background: #ffffff;
border-bottom: 1px solid #DFDFDF;
img { img {
width: 100%; width: 28 * @toVw;
height: 100%; height: 28 * @toVw;
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;
} }
} }
span { .address-pop {
font-size: 22 * @toVw; top: 0;
color: #f83534; bottom: 0;
} left: 0;
.pay-btn { right: 0;
width: 300/7.5vw; position: absolute;
text-align: center; background: white;
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">很遗憾,您未在指定时间内完成任务哦</div> <div class="punch-the-clock-name-contentText" v-if="!hasEnded && forthRate !== 100">很遗憾,您未在指定时间内完成任务哦</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,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