Commit cad00273 authored by IvyXia123's avatar IvyXia123

支付提交8

parent 91356804
...@@ -70,39 +70,18 @@ ...@@ -70,39 +70,18 @@
</div> </div>
</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> <li v-for="item in payList" :key="item.value" @click="payListClick(item.value)">
<img :src="weixin" alt=""> <img :src="item.icon" alt="">
<span>微信支付</span> <span>{{ item.title }}</span>
<div class="icon-re"> <div class="icon-re">
<img :src="iconRe" alt=""> <img :src="payIndex === item.value ? icon_re_acitve : iconRe" alt="">
</div>
</li>
<li>
<img :src="weixin" alt="">
<span>微信支付</span>
<div class="icon-re">
<img :src="iconRe" alt="">
</div>
</li>
<li>
<img :src="weixin" alt="">
<span>微信支付</span>
<div class="icon-re">
<img :src="iconRe" alt="">
</div>
</li>
<li>
<img :src="weixin" alt="">
<span>微信支付</span>
<div class="icon-re">
<img :src="iconRe" alt="">
</div> </div>
</li> </li>
</ul> </ul>
</div>--> </div>
<footer> <footer>
<div class="sub-block"> <div class="sub-block">
...@@ -154,7 +133,8 @@ import { ...@@ -154,7 +133,8 @@ import {
getwechatParam, getwechatParam,
getStatusWechatApi, getStatusWechatApi,
getCouponListApi, getCouponListApi,
getCourseInfoApi getCourseInfoApi,
postPayBillApi
} from "../../service/api"; } from "../../service/api";
import addAddress from "./address"; import addAddress from "./address";
import loginPage from "./login"; import loginPage from "./login";
...@@ -167,8 +147,12 @@ import leftG from "../../assets/shop/leftg.png"; ...@@ -167,8 +147,12 @@ 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 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 { Popup } from "mint-ui"; import { Popup } from "mint-ui";
export default { export default {
name: "buy", name: "buy",
components: { components: {
...@@ -187,7 +171,7 @@ export default { ...@@ -187,7 +171,7 @@ export default {
flag: false flag: false
}, },
iconRe: icon_re, iconRe: icon_re,
weixin: weixin, icon_re_acitve: icon_re_acitve,
lineImage: lineImage, lineImage: lineImage,
youHuiUrl: youHuiUrl, youHuiUrl: youHuiUrl,
leftG: leftG, leftG: leftG,
...@@ -221,8 +205,11 @@ export default { ...@@ -221,8 +205,11 @@ export default {
userCourse: {}, userCourse: {},
payList: [ payList: [
{ icon: weixin, title: '微信支付', value: 1 }, { icon: weixin, title: '微信支付', value: 1 },
{ icon: zhifubao, title: '支付宝支付', value: 1 }, { icon: zhifubao, title: '支付宝支付', value: 2 },
] { icon: xinyongka, title: '信用卡分期', value: 3 },
{ icon: fenqi, title: '其他分期', value: 4 },
],
payIndex: 1
}; };
}, },
mounted() { mounted() {
...@@ -254,6 +241,10 @@ export default { ...@@ -254,6 +241,10 @@ export default {
} }
}, },
methods: { methods: {
// 支付方式
payListClick(val) {
this.payIndex = val
},
recursion() { recursion() {
getCourseInfoApi().then(res => { getCourseInfoApi().then(res => {
if(res.status){ if(res.status){
...@@ -352,8 +343,7 @@ export default { ...@@ -352,8 +343,7 @@ export default {
} }
let invite = this.$route.query.invite_code; let invite = this.$route.query.invite_code;
this.$sa.track("placeOrder", { this.$sa.track("placeOrder", {
buyType: buyType: this.groupDetail.goods_type === 2 && !this.type ? "团购" : "直购",
this.groupDetail.goods_type === 2 && !this.type ? "团购" : "直购",
couponAmount: this.saleObj ? Number(this.saleObj.money / 100) : 0, couponAmount: this.saleObj ? Number(this.saleObj.money / 100) : 0,
paymentAmount: Number(this.priceTotal), paymentAmount: Number(this.priceTotal),
goodsID: this.shopId.toString(), goodsID: this.shopId.toString(),
...@@ -370,12 +360,12 @@ export default { ...@@ -370,12 +360,12 @@ export default {
json.group_order_id = this.$route.query.group_order_id; json.group_order_id = this.$route.query.group_order_id;
} }
this.orderFlag = false; this.orderFlag = false;
payApi(json) payApi(json)
.then(res => { .then(res => {
this.orderNo = res.out_trade_no; this.orderNo = res.out_trade_no;
if (res.out_trade_no && !res.appId) { if (res.out_trade_no && !res.appId) {
getCourseInfoApi().then(res => { getCourseInfoApi().then(res => {
console.log(res);
this.userCourse = res; this.userCourse = res;
localStorage.setItem( localStorage.setItem(
"userCourse", "userCourse",
......
<template> <template>
<div class="buy-success"> <div class="buy-success">
{{ subscribe }}
<div v-if="subscribe==0"> <div v-if="subscribe==0">
<div class="topTop"> <div class="topTop">
<div> <div>
...@@ -101,42 +100,35 @@ export default { ...@@ -101,42 +100,35 @@ export default {
mask: true, mask: true,
message: "" message: ""
}); });
console.log(sessionStorage.getItem('groupDetail'), 2222);
console.log(JSON.parse(sessionStorage.getItem('groupDetail')), 333);
// this.groupDetail = JSON.parse(sessionStorage.getItem('groupDetail')); // this.groupDetail = JSON.parse(sessionStorage.getItem('groupDetail'));
console.log(this.$route.query.shopId, 'id+'+87897) if(this.$route.query.shopId) {
getGoodsDetailApi(this.$route.query.shopId).then(data => { getGoodsDetailApi(this.$route.query.shopId).then(data => {
console.log(data)
data.desc = JSON.parse(data.desc); data.desc = JSON.parse(data.desc);
data.goods_desc = JSON.parse(data.goods_desc); data.goods_desc = JSON.parse(data.goods_desc);
data.share_desc = JSON.parse(data.share_desc); data.share_desc = JSON.parse(data.share_desc);
this.groupDetail = JSON.parse(JSON.stringify(data)); this.groupDetail = JSON.parse(JSON.stringify(data));
this.groupDetail = data this.groupDetail = data
}) })
}else {
this.groupDetail = JSON.parse(sessionStorage.getItem('groupDetail'));
}
if (sessionStorage.getItem("buyindex") == 1) { if (sessionStorage.getItem("buyindex") == 1) {
getUserDetailApi().then(res => { getUserDetailApi().then(res => {
console.log(9999)
localStorage.setItem("userDesc", JSON.stringify(res)); localStorage.setItem("userDesc", JSON.stringify(res));
this.userDesc = res; this.userDesc = res;
this.subscribe = this.userDesc.open_info.is_subscribe; this.subscribe = this.userDesc.open_info.is_subscribe;
conosle.log(this.userDesc.open_info, 786876)
getOrderDetailApi(this.orderNo).then(res => { getOrderDetailApi(this.orderNo).then(res => {
this.goods_id = res.goods_id; this.goods_id = res.goods_id;
this.invite_code = `CC-${res.invite_type}-${res.invite_id}`; this.invite_code = `CC-${res.invite_type}-${res.invite_id}`;
this.money = res.money; this.money = res.money;
this.invite_type = res.invite_type this.invite_type = res.invite_type
console.log(117)
Toast.clear() Toast.clear()
}); });
}); });
} else { } else {
this.userDesc = JSON.parse(localStorage.getItem("userDesc")); this.userDesc = JSON.parse(localStorage.getItem("userDesc"));
this.subscribe = this.userDesc.open_info.is_subscribe; this.subscribe = this.userDesc.open_info.is_subscribe;
console.log(this.userDesc.open_info)
console.log(this.subscribe, 87687678)
getOrderDetailApi(this.orderNo).then(res => { getOrderDetailApi(this.orderNo).then(res => {
console.log(3333)
this.goods_id = res.goods_id; this.goods_id = res.goods_id;
this.invite_code = `CC-${res.invite_type}-${res.invite_id}`; this.invite_code = `CC-${res.invite_type}-${res.invite_id}`;
this.money = res.money; this.money = res.money;
...@@ -151,7 +143,7 @@ export default { ...@@ -151,7 +143,7 @@ export default {
}; };
</script> </script>
<style scoped lang="less"> <style lang="less">
@import "../../util/public"; @import "../../util/public";
.topTop { .topTop {
line-height: 17 * @toVw; line-height: 17 * @toVw;
...@@ -164,6 +156,7 @@ export default { ...@@ -164,6 +156,7 @@ export default {
height: 12px; height: 12px;
} }
} }
.step2Box { .step2Box {
width: 343 * @toVw; width: 343 * @toVw;
height: 360 * @toVw; height: 360 * @toVw;
......
...@@ -341,9 +341,8 @@ export default { ...@@ -341,9 +341,8 @@ export default {
// this. // this.
}, },
goToBuyPage() { goToBuyPage() {
console.log(this.groupDetail.is_real);
if(this.groupDetail.is_real){ if(this.groupDetail.is_real){
console.log(2323)
let query = { shopId: this.shopId, invite_code: this.invite_code }; let query = { shopId: this.shopId, invite_code: this.invite_code };
let invite = this.invite_code; let invite = this.invite_code;
this.$sa.track("buyCourse", { this.$sa.track("buyCourse", {
...@@ -398,6 +397,7 @@ export default { ...@@ -398,6 +397,7 @@ export default {
this.payFlag = true; this.payFlag = true;
}); });
}else{ }else{
let json={ let json={
goods_id:Number(this.shopId) goods_id:Number(this.shopId)
}; };
...@@ -704,12 +704,12 @@ export default { ...@@ -704,12 +704,12 @@ export default {
this.onShare(1); this.onShare(1);
this.handleInviteCode(); this.handleInviteCode();
} }
console.log(sessionStorage.getItem('clickTag'), 979876896)
if(sessionStorage.getItem('clickTag')){ if(sessionStorage.getItem('clickTag')){
console.log(JSON.parse(localStorage.getItem("userDesc"))) console.log(JSON.parse(localStorage.getItem("userDesc")))
if (!JSON.parse(localStorage.getItem("userDesc")).mobile || JSON.parse(localStorage.getItem("userDesc")).mobile === "") { if (!JSON.parse(localStorage.getItem("userDesc")).mobile || JSON.parse(localStorage.getItem("userDesc")).mobile === "") {
this.bindMobile.flag = sessionStorage.getItem('type'); this.bindMobile.flag = sessionStorage.getItem('type');
this.bindMobile.show = true; this.bindMobile.show = true;
console.log(700)
setTimeout(() => { setTimeout(() => {
this.$sa.track("ViewRegisterpage", {}); this.$sa.track("ViewRegisterpage", {});
}, 1000); }, 1000);
...@@ -765,6 +765,7 @@ export default { ...@@ -765,6 +765,7 @@ export default {
this.groupSuc = status; this.groupSuc = status;
// console.log(status) // console.log(status)
} }
if(!localStorage.getItem("userDesc")){ if(!localStorage.getItem("userDesc")){
sessionStorage.setItem('clickTag',1) sessionStorage.setItem('clickTag',1)
sessionStorage.setItem('type',type) sessionStorage.setItem('type',type)
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
<div class="tishi-timer"> <div class="tishi-timer">
<img :src="tishiTimer" alt=""> <img :src="tishiTimer" alt="">
</div> </div>
<div class="time-setting" @click="dateShowClick"> <div class="time-setting" ref="timeSetting" @click="dateShowClick">
<div class="time-setting-text"> <div class="time-setting-text">
当前设定的时间 当前设定的时间
</div> </div>
...@@ -13,22 +13,16 @@ ...@@ -13,22 +13,16 @@
<img :src="youjiantou" alt=""> <img :src="youjiantou" alt="">
</div> </div>
</div> </div>
<div class="preservation" @click="preservationClick"> <div class="preservation" @click="preservationClick">保存</div>
保存
</div>
<van-popup v-model="dateShow" position="bottom"> <van-popup v-model="dateShow" position="bottom">
<van-datetime-picker <van-datetime-picker @confirm="dateConfirm" @cancel="dateConfirmNo" v-model="currentTime" type="time"/>
@confirm="dateConfirm"
@cancel="dateShow=false"
v-model="currentTime"
type="time"
/>
</van-popup> </van-popup>
</div> </div>
</template> </template>
<script> <script>
import {DatetimePicker, Popup} from 'vant'; import { postNotifySettingApi } from "../../service/api";
import { DatetimePicker, Popup, Toast } from 'vant';
import tishiTimer from '../../assets/evaluate/tishi_timer.png' import tishiTimer from '../../assets/evaluate/tishi_timer.png'
import youjiantou from '../../assets/evaluate/youjiantou.png' import youjiantou from '../../assets/evaluate/youjiantou.png'
...@@ -36,7 +30,7 @@ ...@@ -36,7 +30,7 @@
name: "promptTime", name: "promptTime",
data() { data() {
return { return {
currentTime: '--:--', currentTime: '',
dateVal: '', dateVal: '',
dateShow: false, dateShow: false,
selectedValue: '', selectedValue: '',
...@@ -54,32 +48,60 @@ ...@@ -54,32 +48,60 @@
this.$nextTick(() => { this.$nextTick(() => {
document.querySelectorAll('.van-picker-column')[1].style.display = 'none'; document.querySelectorAll('.van-picker-column')[1].style.display = 'none';
let oLi = document.querySelectorAll('.van-picker-column')[0].querySelectorAll('li'); let oLi = document.querySelectorAll('.van-picker-column')[0].querySelectorAll('li');
for(var i = 0; i < oLi.length; i++) { for (var i = 0; i < oLi.length; i++) {
console.log(oLi[i].innerText);
oLi[i].innerText = oLi[i].innerText + ':00' oLi[i].innerText = oLi[i].innerText + ':00'
} }
}) })
}, },
dateConfirm(val) { dateConfirm(val) {
this.currentTime = val this.currentTime = val == 'aN:aN' ? '00:00' : val
this.dateShow = false this.contentFn()
for(var i = 0; i < oLi.length; i++) { },
console.log(oLi[i].innerText); dateConfirmNo() {
this.contentFn()
},
contentFn() {
this.dateShow = false;
this.$refs.timeSetting.style.borderBottom = '1px solid #E2E2E2'
let oLi = document.querySelectorAll('.van-picker-column')[0].querySelectorAll('li');
for (var i = 0; i < oLi.length; i++) {
oLi[i].innerText = oLi[i].innerText.split(':')[0] oLi[i].innerText = oLi[i].innerText.split(':')[0]
} }
}, },
preservationClick() { preservationClick() {
if(this.currentTime) {
let pushAtData = { time: this.currentTime }
postNotifySettingApi(pushAtData).then(res => {
Toast("时间设定完成");
this.$router.go(-1);
})
}else {
Toast("请先设定时间");
console.log(this.$refs.timeSetting);
this.$refs.timeSetting.style.borderBottom = '1px solid red'
}
} }
} }
} }
</script> </script>
<style scoped lang="less"> <style lang="less">
@import "../../util/public"; @import "../../util/public";
.van-picker { .van-picker {
border-radius: 30 * @toVw 30 * @toVw 0 0; border-radius: 30 * @toVw 30 * @toVw 0 0;
} }
.van-picker-column__item {
color: #666666;
font-size: 20 * @toVw;
}
.van-picker-column__item--selected {
color: #40A9FF;
font-size: 26 * @toVw;
}
.prompt-time { .prompt-time {
width: 100%; width: 100%;
height: 100%; height: 100%;
......
...@@ -370,19 +370,13 @@ export const postErrorLogApi = function (json) { ...@@ -370,19 +370,13 @@ export const postErrorLogApi = function (json) {
return Vue.prototype.$post(`api/client/report/errors/log`, json) return Vue.prototype.$post(`api/client/report/errors/log`, json)
}; };
// 用户成长记录添加 // 设置课程提醒时间
export const postUserGrowthAddApi = function (periods_id, category_id, element_id, json) { export const postNotifySettingApi = function (json) {
return Vue.prototype.$post(`api/client/user/growth/record/${ periods_id }/${ category_id }/${ element_id }`, json) return Vue.prototype.$post(`/api/client/user/notify/setting`, json)
}; };
// 用户成长记录列表 // 支付
export const getUserGrowthListApi = function (json) { export const postPayBillApi = function (json) {
return Vue.prototype.$fetch(`${_baseUrl}api/client/user/growth/record/list`) return Vue.prototype.$post(`/client/bill/create`, json)
};
//
const getUserGrowthRecordUrl = `${_baseUrl}api/client/growth/record/`
export const getUserGrowthRecordApi = function (periods_id, category_id, element_id) {
return Vue.prototype.$fetch(`${getUserGrowthRecordUrl}${periods_id}/${category_id}/${element_id}`)
}; };
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