Commit 40e7e2ae authored by lijin's avatar lijin

优化姓名测算

parent 4e48e1e8
...@@ -26,7 +26,7 @@ module.exports = { ...@@ -26,7 +26,7 @@ module.exports = {
// Various Dev Server settings // Various Dev Server settings
// host: 'localhost', // can be overwritten by process.env.HOST // host: 'localhost', // can be overwritten by process.env.HOST
host: IPAdress, host: '0.0.0.0',
port: 8080, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined port: 8080, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined
autoOpenBrowser: false, autoOpenBrowser: false,
errorOverlay: true, errorOverlay: true,
......
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
}, },
"dependencies": { "dependencies": {
"axios": "^0.21.1", "axios": "^0.21.1",
"jquery": "^3.6.1",
"js-md5": "^0.7.3", "js-md5": "^0.7.3",
"vue": "^2.5.2", "vue": "^2.5.2",
"vue-router": "^3.0.1" "vue-router": "^3.0.1"
......
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
import Vue from 'vue' import Vue from 'vue'
import App from './App' import App from './App'
import router from './router' import router from './router'
import {reportEvent} from "@/utils/report";
import './assets/css/font-color.css' import './assets/css/font-color.css'
import './assets/css/font-size.css' import './assets/css/font-size.css'
...@@ -15,6 +16,7 @@ router.beforeEach((to, from, next) => { ...@@ -15,6 +16,7 @@ router.beforeEach((to, from, next) => {
if (to.meta.title) { if (to.meta.title) {
document.title = to.meta.title; document.title = to.meta.title;
} }
reportEvent("page_load", "", "", {from: from.fullPath, path: to.fullPath})
next(); next();
}); });
......
...@@ -45,7 +45,7 @@ const API = { ...@@ -45,7 +45,7 @@ const API = {
// 创建订单 将信息以请求体的形式传递给后端 // 创建订单 将信息以请求体的形式传递给后端
API_createorder: function (params, data) { API_createorder: function (params, data) {
return request("/h5game/peidui/createOrder", "post", params, 'form', data); return request("/h5game/locationH5/createOrder", "post", params, 'form', data);
}, },
// 获取支付价格 // 获取支付价格
...@@ -69,7 +69,7 @@ const API = { ...@@ -69,7 +69,7 @@ const API = {
// 查询支付结果 // 查询支付结果
API_gatewayQueryOrder: function (data) { API_gatewayQueryOrder: function (data) {
return request(payUrl + "/unifiedpay/gateway/queryOrder", "get", data); return request(payUrl + "/unifiedpay/gateway/queryOrderByNo", "get", data);
}, },
// 收集数据 // 收集数据
......
import axios from 'axios' import axios from 'axios'
let baseURL = 'https://feedapi.zhangxinhulian.com' let baseURL = 'https://feedapi.zhangxinhulian.com'
// let baseURL = 'http://192.168.64.6:19898'
const service = axios.create({ const service = axios.create({
baseURL: baseURL, baseURL: baseURL,
...@@ -19,4 +20,4 @@ service.interceptors.response.use( ...@@ -19,4 +20,4 @@ service.interceptors.response.use(
} }
); );
export default service export default service
\ No newline at end of file
<template> <template>
<div class="home"> <div class="home">
<div ref="lucky_empty">
<form id="payForm" v-if="enc !== ''" method="post" action="https://api.minpayment.com/pay.do">
<input type="hidden" name="sendMsg" :value="enc" /> <br/>
<!--<input type="submit" />-->
</form>
</div>
<div class="blind_box_pay_header" <div class="blind_box_pay_header"
:style="'padding-top: 7.54rem;position:relative;width: 100%;background-repeat: no-repeat;background-color: #ff7989;justify-content: center; background-size:contain;background-image:url('+require('@/assets/img/index/WechatIMG3667.jpeg')+');'"> :style="'padding-top: 7.54rem;position:relative;width: 100%;background-repeat: no-repeat;background-color: #ff7989;justify-content: center; background-size:contain;background-image:url('+require('@/assets/img/index/WechatIMG3667.jpeg')+');'">
<img style="position: fixed; <img style="position: fixed;
...@@ -33,23 +39,23 @@ ...@@ -33,23 +39,23 @@
alt=""> alt="">
<input type="text" <input type="text"
placeholder="请输入男方姓名" placeholder="请输入男方姓名"
v-model="manName"> v-model="male">
</div> </div>
<div class="input_area_box"> <div class="input_area_box">
<img src="@/assets/img/index/WechatIMG3642.png" <img src="@/assets/img/index/WechatIMG3642.png"
alt=""> alt="">
<input type="text" <input type="text"
placeholder="请输入女方姓名" placeholder="请输入女方姓名"
v-model="womName"> v-model="female">
</div> </div>
<div class="input_area_btn animation_scale_class"> <div class="input_area_btn animation_scale_class" @click="toPayPage">
<img style="width:100%;" <img style="width:100%;"
src="@/assets/img/index/WechatIMG3640.png" src="@/assets/img/index/WechatIMG3640.png"
alt=""> alt="">
</div> </div>
<p data-v-5b831c31="" <p data-v-5b831c31=""
class="text-class">已有<span data-v-5b831c31="" class="text-class">已有<span data-v-5b831c31=""
class="color_">898436</span>完成配对,并参与了领<span data-v-5b831c31="" class="color_">998431</span>完成配对,并参与了领<span data-v-5b831c31=""
class="color_">iphone13</span>活动</p> class="color_">iphone13</span>活动</p>
<label class="read_message_xiaoxiang_area" <label class="read_message_xiaoxiang_area"
style="color:#999999;"> style="color:#999999;">
...@@ -81,9 +87,9 @@ ...@@ -81,9 +87,9 @@
<div class="van-dialog__header">活动规则</div> <div class="van-dialog__header">活动规则</div>
<div class="van-dialog__content"> <div class="van-dialog__content">
<div class="van-dialog__message van-dialog__message--has-title van-dialog__message--left"> <div class="van-dialog__message van-dialog__message--has-title van-dialog__message--left">
<p style="margin:0;">1、活动时间:即日起至2023年6月30日;</p> <p style="margin:0;">1、活动时间:即日起至2023年6月30日;</p>
<p style="margin:0;">2、凡付费购买姓名配对的用户,若速配指数是99(含99)以上的用户凭测算的订单号联系客服,可免费领取iphone13一台;</p> <p style="margin:0;">2、凡付费购买姓名配对的用户,若速配指数是99(含99)以上的用户凭测算的订单号联系客服,可免费领取iphone13一台;</p>
<p style="margin:0;">3、速配指数以领到的姓名配对测试报告结果页中的匹配契合度分值为准;</p> <p style="margin:0;">3、速配指数以领到的姓名配对测试报告结果页中的匹配契合度分值为准;</p>
<p style="margin:0;">4、活动中奖率:1/9999,符合领取条件的用户,结果页会自动出现客服联系方式,每个用户活动期间限制免费领取一台;</p> <p style="margin:0;">4、活动中奖率:1/9999,符合领取条件的用户,结果页会自动出现客服联系方式,每个用户活动期间限制免费领取一台;</p>
</div> </div>
</div> </div>
...@@ -97,71 +103,276 @@ ...@@ -97,71 +103,276 @@
</div> </div>
</div> </div>
</div> </div>
<template v-if="toast">
<div class="toast fc-f fs-28 ff-pp fw-5">请将信息填写完整</div>
</template>
</div> </div>
</template> </template>
<script> <script>
import StatusBar from "@/components/StatusBar"; import utils from '@/utils/index';
import AccrodWithName from "./child_cpn/AccordWithName"; import API from '@/service/api';
import utils from "@/utils"; import {reportEvent} from "@/utils/report";
import API from "@/service/api"; import $ from "jquery";
export default { export default {
components: {
},
data () { data () {
return { return {
message: '',
show: false,
friendNumber: '',
endTime: '',
minute: '',
second: '',
showPrice: '',
orderId: '',
h5LogsObj: {},
pkg: 'com.h5game.peidui',
showRules: false,
host: '',
cash: '',
fen: '990',
originalPrice: '',
apkUrl: 'http://apk2-cdn.zhangxinhulian.com/com.zxhl.shop_huafei_h5-1.2.3_123_jiagu_sign.apk',
source: '',
agreeAdvice: true, agreeAdvice: true,
manName: '', is20: false,
womName: '', is50: false,
is100: true,
checkCount: 0,
allPrice: [],
goodsId: '',
isIos: false,
checkTimer: null,
xiaoxiangPayType: 1,
companyInfo: {
companyName: "北京掌心互联科技有限公司",
companyAddress: "北京市海淀区永定河路26号50幢01层101-38",
beianNo: "京ICP备19006544号-31"
},
female: "",
male: "",
toast: false,
showRuleArea: false, showRuleArea: false,
html: "",
enc: '',
} }
}, },
components: {
StatusBar,
AccrodWithName,
},
mounted () { mounted () {
let h5LogsObj = utils.getUrlParams(); this.setCompanyInfo()
let link = encodeURIComponent(window.location.href); this.host = window.location.host;
this.source = utils.getCookie("source");
utils.setCookie("h5LogsObj", encodeURI(JSON.stringify(h5LogsObj)), 0);
utils.setCookie("link", encodeURI(link), 0);
API.API_reportView("home_page_view"); this.getPrice();
}, },
methods: { methods: {
setCompanyInfo() {
let host = window.location.host;
if(host.indexOf("yuwenshop.com") > 0) {
this.companyInfo = {
companyName: "天津雨文科技有限公司",
companyAddress: "天津健康产业园昆明湖路与健康大道交口合作示范区管委会3141室",
beianNo: "津ICP备2022005759号-1"
}
}
if(host.indexOf("zhuojieshop.com") > 0) {
this.companyInfo = {
companyName: "天津卓界科技有限公司",
companyAddress: "天津健康产业园昆明湖路与健康大道交口合作示范区管委会3142室",
beianNo: "津ICP备2022005715号-1"
}
}
},
showRule () { showRule () {
this.showRuleArea = true; this.showRuleArea = true;
}, },
hideWarn () { hideWarn () {
this.showRuleArea = false; this.showRuleArea = false;
}, },
agreePage(){
agreePage () {
this.agreeAdvice = !this.agreeAdvice; this.agreeAdvice = !this.agreeAdvice;
}, },
begin () {
if (this.$refs.accord.male == "" || this.$refs.accord.female == "") { toPayPage () {
window.scrollTo(0, window.screen.height / 2); if (this.male == "" || this.female == "") {
this.toast = true;
setTimeout(() => {
this.toast = false;
}, 1000);
return; return;
}
reportEvent("pay_btn_click", "", "", {phone: this.friendNumber})
let reg = /^(13[0-9]|14[01456879]|15[0-35-9]|16[2567]|17[0-8]|18[0-9]|19[0-35-9])\d{8}$/;
if (this.agreeAdvice === false) {
this.message = "请阅读勾选相关协议!";
this.show = true;
setTimeout(() => {
this.message = '';
this.show = false;
}, 2000)
} else { } else {
window.sessionStorage.setItem('itemPrice', this.fen)
utils.setCookie("friendNumber", this.friendNumber, 0); // 将orderId放入cookie中
this.message = '';
let i = Math.floor(Math.random()*100)
let resultIndex = i < 20 ? 0: i < 60? 1: 2;
let params = { let params = {
info: [ baseInfo: [
{ gender: 1, name: this.$refs.accord.male }, { gender: 1, name: this.male },
{ gender: 0, name: this.$refs.accord.female }, { gender: 0, name: this.female },
], ],
resultIndex: resultIndex
}; };
this.$router.push({ path: "/pay", query: params }); utils.setCookie("baseInfo", JSON.stringify(params), 0);
let h5LogsObj = utils.getUrlParams();
let params_createorder = {
pkg: this.pkg,
source: h5LogsObj.source ? h5LogsObj.source : "tuia",
phone: this.friendNumber,
};
API.API_createorder(params_createorder, params).then((res_order) => {
this.orderId = res_order.result.data.orderId;
utils.setCookie("orderId", this.orderId, 0); // 将orderId放入cookie中
let link = encodeURIComponent(window.location.href);
// 上报-- > 信息收集;
API.API_h5Logs({
outTradeNo: this.orderId,
link: link,
clickId: h5LogsObj.a_oId || h5LogsObj.dm_id || h5LogsObj.bxm_id || h5LogsObj.bc_tag || h5LogsObj.octid || h5LogsObj.jcid || h5LogsObj.tid || h5LogsObj.bd_vid,
mob_cid: h5LogsObj.mob_cid ? h5LogsObj.mob_cid : '',
plid: h5LogsObj.plid ? h5LogsObj.plid : '',
pageId: h5LogsObj.pageId ? h5LogsObj.pageId : '',
lbid: h5LogsObj.lbid ? h5LogsObj.lbid : '',
source: h5LogsObj.source ? h5LogsObj.source : "tuia",
pkg: this.pkg,
ua: encodeURI(navigator.userAgent),
phone: this.friendNumber,
adid: h5LogsObj.adid ? h5LogsObj.adid : '',
creativeid: h5LogsObj.creativeid ? h5LogsObj.creativeid : '',
et: h5LogsObj.et ? h5LogsObj.et : '2'
}).then((res) => {
if (res.status === 200) {
console.log("收集数据===", res);
this.payment();
}
}).catch((err) => {
console.log('pay', err)
//this.$router.push({ name: 'saveMoney_pay', params: { friendNumber } })
});
}).catch((err) => {
console.log(err)
});
} }
}, },
},
}; getPrice () {
//获取价格信息
API.API_payConfig({
pkg: this.pkg,
zygt: "hzwz",
tgtk: 1,
uid: 1008611,
source: this.source
}).then((res) => {
console.log(res)
let newRes = res.result.data.goodsList;
this.xiaoxiangPayType = res.result.data.xiaoxiangPayType
// this.xiaoxiangPayType = 18
newRes.forEach((item) => {
this.fen = item.fen;
//测试数据,付费1分钱
this.fen = 1;
this.goodsId = item.goodsId;
})
this.allPrice = newRes;
console.log(this.allPrice)
})
},
// 支付
async payment () {
localStorage.setItem("friendNumber", this.friendNumber);
utils.setCookie("friendNumber", this.friendNumber, 0);
// 支付
API.API_gatewayCreateorder({
payType: this.xiaoxiangPayType,
wxType: "H5",
pkg: this.pkg,
payPlatform: 1,
goodsId: this.goodsId,
orderType: 6,
body: "【24小时商家电话 4000033616】",
subject: "【24小时商家电话 4000033616】",
totalFee: Number(this.fen),
// totalFee: 1,
outTradeNo: this.orderId,
returnUrl: `http://${this.host}/result`,
}).then((res) => {
//this.$refs.payBtn.style.opacity = "1";
if(this.xiaoxiangPayType == 1){
//如果走支付宝官方支付
let html = res.result.data.wakeup;
this.goToPay(html)
}else if(this.xiaoxiangPayType == 14) {
window.location.href= res.result.data.wakeup
}else if( [16, 17, 18, 19].includes(this.xiaoxiangPayType)) {
window.location.href= res.result.data.wakeup
}else if( [30, 31, 32, 33].includes(this.xiaoxiangPayType)) {
window.location.href= res.result.data.wakeup
}
}).catch((err) => {
console.log('err', err)
});
},
// 查询支付结果
queryOrder () {
API.API_isMember({
phone: this.friendNumber,
pkg: this.pkg
}).then((res) => {
let status = res.result.data.isMember;
if (status) {
this.showRules = true;
} else {
this.showRules = false;
}
}).catch((err) => {
console.log('err', err)
})
},
goToPay(html){
this.enc = ""
this.html = html;
if (this.html.indexOf("<") < 0) {
this.enc = this.html
this.$nextTick(() => {
document.getElementById("payForm").submit()
})
}else {
$(this.$refs.lucky_empty).html(this.html);
}
}
}
}
</script> </script>
<style> <style>
.van-dialog { .van-dialog {
position: fixed; position: fixed;
top: 45%; top: 45%;
left: 50%; left: 50%;
...@@ -392,4 +603,16 @@ export default { ...@@ -392,4 +603,16 @@ export default {
transform: scale(1); transform: scale(1);
} }
} }
</style>
\ No newline at end of file .toast {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
padding: 0.1rem;
background-color: #000;
opacity: 0.4;
z-index: 2;
border-radius: 0.2rem;
}
</style>
...@@ -97,7 +97,7 @@ export default { ...@@ -97,7 +97,7 @@ export default {
}, },
mounted() { mounted() {
const n = JSON.parse(utils.getCookie("baseInfo")); const n = JSON.parse(utils.getCookie("baseInfo")).baseInfo;
this.baseInfo = n ? n : ["name", "name"]; this.baseInfo = n ? n : ["name", "name"];
this._queryOrder(); this._queryOrder();
...@@ -139,11 +139,7 @@ export default { ...@@ -139,11 +139,7 @@ export default {
let params = { let params = {
outTradeNo: orderId, outTradeNo: orderId,
payPlatform: 1, mediaType: 'h5'
payType: 2,
wxType: "H5Page",
// pkg: h5LogsObj.pkg
pkg: "com.h5game.peidui",
}; };
API.API_gatewayQueryOrder(params).then((res) => { API.API_gatewayQueryOrder(params).then((res) => {
let status = res.result.data.status; let status = res.result.data.status;
...@@ -170,4 +166,4 @@ export default { ...@@ -170,4 +166,4 @@ export default {
</script> </script>
<style scoped src='./index.css'> <style scoped src='./index.css'>
</style> </style>
\ No newline at end of file
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