Commit 581a9b8a authored by xulili's avatar xulili

会员注册

parent df550118
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>会员拉新</title>
<script src="../js/jquery-3.4.1.min.js"></script>
<style>
html,body{
width: 100%;
height: 100%;
margin: 0;
padding: 0;
font-size: 16px;
color: #ffffff;
}
.register_container{
height: 100%;
background-color: rgba(15, 106, 184, 0.99);
margin: 0;
padding: 2.5rem 2rem;
box-sizing: border-box;
text-align: center;
}
.register_titles .title{
font-size: 3rem;
line-height: 5rem;
}
.register_qrcode #image{
display: inline-block;
width: 60%;
height: auto;
margin: 3rem 0;
}
.register_qrcode .qrcodeTip{
font-size: 2rem;
}
</style>
</head>
<body>
<div class="register_container">
<div class="register_titles">
<div class="title">扫码注册成为会员</div>
</div>
<div class="register_qrcode">
<img class="qrcode" id="image" src="" alt />
<div class="qrcodeTip">长按识别二维码</div>
</div>
</div>
<script>
$(function () {
showQRInfo()
});
const showQRInfo = () => {
// let pageUri = `${nowUrl}&detailid=${voucherId}&actionid=${activeId}&unionid=${unionId}`;
let storecode = "181"
let pageUri = `pages/user/register/register?storeCode=
${storecode}`;
let pageUrl = `http://139.155.48.151:8085/workWx/auth/oauth2/wxMiniQrCode?pageUri=${pageUri}`;
$.ajax({
type: "POST",
url: pageUrl,
data: {},
success: function (res) {
$('#image').attr('src', res.data)
},
error: function (data) {
alert(`--->qrCode: ajax: err.`)
alert(`--->qrCode: ajax: err: err =${JSON.stringify(err)}`)
alert('error' + JSON.stringify(data))
console.log(data);
}
});
}
</script>
</body>
</html>
...@@ -42,6 +42,11 @@ const routes = [ ...@@ -42,6 +42,11 @@ const routes = [
name: 'Discount', name: 'Discount',
component: () => import('@/views/sideNav/discount/index') component: () => import('@/views/sideNav/discount/index')
}, },
{
path: '/register',
name: 'register',
component: () => import('@/views/sideNav/register/index')
},
{ {
path: '/mainSale', path: '/mainSale',
name: 'MainSale', name: 'MainSale',
......
<template> <template>
<!-- <div> <div class="main">
<button @click="disClick">discount</button> <div class="lists">
<button @click="mainSaleClick">mainSale</button> <div v-for="(item, index) of list.main" :key="index">
</div>--> <div class="list" @click="listClick(item.redirect)">
<div class="main"> <div>
<!-- <div class="tops"></div> --> <img class="list-logo" :src="item.logoUrl" alt/>
<div class="lists"> </div>
<!-- <div <div class="list-infos">
v-if="this.$route.query.code !== undefined" <div class="list-info-title">{{item.name}}</div>
style="font-size: 14px;" <div class="list-info-dsc">{{item.dsc}}</div>
>Code: {{this.$route.query.code}}</div> --> </div>
<div v-for="(item, index) of list.main" :key="index"> </div>
<div class="list" @click="listClick(item.redirect)"> </div>
<div>
<img class="list-logo" :src="item.logoUrl" alt />
</div>
<div class="list-infos">
<div class="list-info-title">{{item.name}}</div>
<div class="list-info-dsc">{{item.dsc}}</div>
</div>
</div> </div>
</div>
<!-- <button class="testButton" @click="zTestPreAuthCode">preAuthCodeUrl</button>
<div class="fkwindow">{{zcache.preAuthCodeUrl}}</div>-->
<!--
<button class="testButton" @click="zTestGetNowUrlInfo">nowUrlInfo</button>
<div class="fkwindow">{{zcache.nowUrl}}</div>-->
<!-- <button class="testButton" @click="zTestGetUserInfoByOldToken">GetUserInfoByOldToken</button>
<div class="fkwindow">{{zcache.userInfoResOld}}</div>-->
<!-- <button class="testButton" @click="zTestGetUserInfoByNewToken">GetUserInfoByNewToken</button> -->
<!-- <button class="testButton" @click="zTestGetUserInfoByNewToken">RES</button> -->
<!-- <div
style="border:1px solid limegreen;padding:4px;height: 100px; width: 100%; overflow: auto; font-size:14px;word-wrap:break-word;"
>{{zcache.userInfoResNew}}</div>-->
</div> </div>
<!-- <div class="menus">
<div class="menu" @click="buttonMainMarketingClick">精准营销</div>
<div class="menu activeMenu" @click="buttonSingleMarketingClick">一对一营销侧边栏</div>
</div>-->
</div>
</template> </template>
<script> <script>
import { ApiTestCfPost, ApiTestEaPost } from "@/api/test/test"; import {ApiTestCfPost, ApiTestEaPost} from "@/api/test/test";
import { configWx, getUserInfo } from "@/utils/aCommon"; import {configWx, getUserInfo} from "@/utils/aCommon";
import * as APIHome from "@/api/sidebar/home"; import * as APIHome from "@/api/sidebar/home";
import axios from "axios"; import axios from "axios";
const zlog = console.log.bind(console);
const zlog = console.log.bind(console);
export default {
name: "home", export default {
data() { name: "home",
return { data() {
zcache: { return {
nowUrl: "", zcache: {
preAuthCodeUrl: "", nowUrl: "",
code: "", preAuthCodeUrl: "",
userId: "", code: "",
userInfoResOld: "", userId: "",
userInfoResNew: "" userInfoResOld: "",
}, userInfoResNew: ""
list: { },
main: [ list: {
{ main: [
name: "顾客画像", {
dsc: name: "顾客画像",
"亿百分会员画像,通过一方消费者数据结合三方数据为营业员展示顾客特点", dsc: "欧亚会员画像,通过一方消费者数据结合三方数据为营业员展示顾客特点",
redirect: "ManInfo", redirect: "ManInfo",
logoUrl: "/mainSale/1.png" logoUrl: "/mainSale/1.png"
}, },
{ {
name: "优惠券推送", name: "优惠券推送",
dsc: dsc: "欧亚会员画像,通过一方消费者数据结合三方数据为营业员展示顾客特点",
"亿百分会员画像,通过一方消费者数据结合三方数据为营业员展示顾客特点", redirect: "Discount",
redirect: "Discount", logoUrl: "/mainSale/2.png"
logoUrl: "/mainSale/2.png" },
}, {
{ name: "爆品推送",
name: "爆品推送", dsc: "欧亚会员画像,通过一方消费者数据结合三方数据为营业员展示顾客特点",
dsc: redirect: "GoodPost",
"亿百分会员画像,通过一方消费者数据结合三方数据为营业员展示顾客特点", logoUrl: "/mainSale/3.png"
redirect: "GoodPost", },
logoUrl: "/mainSale/3.png" {
} name: "营销工具箱",
] dsc: "欧亚营销工具箱,通过营销工具箱可以为营业员提供更多的在线营销工具",
} redirect: "register",
}; logoUrl: "/mainSale/4.png"
}, }
mounted() { ]
this.zReadyUserId(); }
this.zTestGetNowUrlInfo(); };
},
created() {
// alert(`--->home: created.`)
// this.zReadyUserId()
// this.zReadyUserId();
// this.zTestGetNowUrlInfo();
},
methods: {
zReadyUserId() {
zlog(
"%c--->this.zcache.code =",
"color: orange;",
this.$route.query.code
);
if (this.$route.query.code === undefined) {
this.zTestPreAuthCode();
} else {
this.zTestGetNowUrlInfo();
this.zTestGetUserInfoByOldToken();
}
// if(this.zcache.code === "") {
// this.zTestGetUserInfoByOldToken()
// } else {
// this.zTestPreAuthCode()
// }
}, },
// 测试-获取当前Url信息 mounted() {
zTestGetNowUrlInfo() { this.zReadyUserId();
this.zcache.nowUrl = JSON.stringify(this.$route.query); this.zTestGetNowUrlInfo();
this.zcache.code = String(this.$route.query.code);
// alert(`--->nowUrl and code =${this.zcache.nowUrl}`)
zlog("%c--->zTestGetNowUrlInfo: ", "color: orange;", this.zcache.nowUrl);
}, },
// 测试-获取预授权码 created() {
// redirectUrI: encodeURIComponent(location.href.split('#')[0]),
zTestPreAuthCode() {
// alert(`--->home: zTestPreAuthCode: IN.`)
const basicInfo = {
head: "https://open.weixin.qq.com/connect/oauth2/authorize?",
// appId: "wwd1cdbca7b8b2b6c4",
appId: "ww4df265003b43fa0d",
redirectUrI: encodeURIComponent("qywx2.100smartdata.com"),
responseType: "code",
scope: "snsapi_base",
state: "ztest",
tail: "#wechat_redirect"
};
let url =
basicInfo.head +
"appid=" +
basicInfo.appId +
"&redirect_uri=" +
basicInfo.redirectUrI +
"&response_type=" +
basicInfo.responseType +
"&scope=" +
basicInfo.scope +
"&state=" +
basicInfo.state +
basicInfo.tail;
zlog("%c--->zTestPreAuthCode: Url =", "background: orange", url);
this.zcache.preAuthCodeUrl = url;
window.location.href = url;
}, },
// 测试-获取用户信息 methods: {
zTestGetUserInfoByOldToken() { zReadyUserId() {
let postData = { zlog(
code: this.zcache.code, "%c--->this.zcache.code =",
}; "color: orange;",
let headerData = { this.$route.query.code
// agentId: "1000015", );
// corpId: "wwd1cdbca7b8b2b6c4"
agentId: "1000032", if (this.$route.query.code === undefined){
corpId: "ww4df265003b43fa0d"
}; this.zTestPreAuthCode()
// url: "http://139.155.48.151:8085/workWx/auth/oauth2/getUserInfo", } else {
// headers: header, this.zTestGetNowUrlInfo();
this.zTestGetUserInfoByOldToken();
// alert( }
// `--->home.vue: zTestGetUserInfoByOldToken: postData =${JSON.stringify( },
// postData // 测试-获取当前Url信息
// )}` zTestGetNowUrlInfo() {
// ); this.zcache.nowUrl = JSON.stringify(this.$route.query);
// alert( this.zcache.code = String(this.$route.query.code);
// `--->home.vue: zTestGetUserInfoByOldToken: headerData =${JSON.stringify( zlog("%c--->zTestGetNowUrlInfo: ", "color: orange;", this.zcache.nowUrl);
// headerData },
// )}` zTestPreAuthCode() {
// ); const basicInfo = {
head: "https://open.weixin.qq.com/connect/oauth2/authorize?",
this.zcache.userInfoResOld = "PostData:" + JSON.stringify(postData); // appId: "wwd1cdbca7b8b2b6c4",
appId: "ww4df265003b43fa0d",
redirectUrI: encodeURIComponent("qywx2.100smartdata.com"),
axios({ responseType: "code",
url: "http://139.155.48.151:8085/workWx/auth/oauth2/getUserInfo?code=" + this.zcache.code, scope: "snsapi_base",
method: "post", state: "ztest",
headers: headerData, tail: "#wechat_redirect"
// data: postData };
})
.then(res => { let url =
// alert(`--->home.vue: zTestGetUserInfoByOldToken: axios: res.`); basicInfo.head +
// alert( "appid=" +
// `--->home.vue: zTestGetUserInfoByOldToken: axios: res =${JSON.stringify( basicInfo.appId +
// res "&redirect_uri=" +
// )}` basicInfo.redirectUrI +
// ); "&response_type=" +
// this.zcache.userInfoResNew = "RESOK:" + JSON.stringify(res.data); basicInfo.responseType +
this.zcache.userInfoResNew = "RESOK:" + res.data.data.userId; "&scope=" +
sessionStorage.setItem("userId", String(res.data.data.userId)); basicInfo.scope +
this.zcache.userId = String(res.data.data.userId); "&state=" +
basicInfo.state +
basicInfo.tail;
zlog("%c--->zTestPreAuthCode: Url =", "background: orange", url);
this.zcache.preAuthCodeUrl = url;
window.location.href = url;
},
// 测试-获取用户信息
zTestGetUserInfoByOldToken() {
let postData = {
code: this.zcache.code,
};
let headerData = {
agentId: "1000032",
corpId: "ww4df265003b43fa0d"
};
this.zcache.userInfoResOld = "PostData:" + JSON.stringify(postData);
axios({
url: "http://139.155.48.151:8085/workWx/auth/oauth2/getUserInfo?code=" + this.zcache.code,
method: "post",
headers: headerData,
}) })
.catch(err => { .then(res => {
// alert(`--->home.vue: zTestGetUserInfoByOldToken: axios: err.`); this.zcache.userInfoResNew = "RESOK:" + res.data.data.userId;
// alert( sessionStorage.setItem("userId", String(res.data.data.userId));
// `--->home.vue: zTestGetUserInfoByOldToken: axios: res =${JSON.stringify( this.zcache.userId = String(res.data.data.userId);
// err })
// )}` .catch(err => {
// ); this.zcache.userInfoResNew = "RESERR.";
this.zcache.userInfoResNew = "RESERR."; });
},
listClick(inData) {
this.$router.push({
name: inData,
params: {userId: this.zcache.userId}
}); });
}, },
zTestGetUserInfoByNewToken() { }
// let basicInfo = { };
// token: sessionStorage.getItem("XToken"),
// code: this.$route.query
// };
// getUserInfo()
// .then(res => {
// zlog('%c--->getUserInfo: res =', 'background: red;')
// })
// let token =
// "2CjH4hx8dtY_uQYjRggRk0NxtuBrpYC9Z7kqytWgys2AlIUWzCFEGeYfVCM3Ywq16M-WA7n7oMWMNMJl8JXxEgiTNIsil-Z7YzoDoeVaoilwIaukTBfppmkqQZd7uxfxK8I5CDXDB2GtZI_ufke6ln9n30vfq7p6Q8BzBplmoRLXR21qLgVmcfEcaHO0UbcnVTyHStG0FVad-dZY_AsJ-g";
// let code = this.zcache.code;
// let url = `https://qyapi.weixin.qq.com/cgi-bin/service/getuserinfo3rd?suite_access_token=${token}&code=${code}`;
// axios
// .get(url)
// .then(function(res) {
// zcache("$c--->axios: res.", "background: red.");
// this.zcache.userInfoResNew = JSON.stringify(res);
// })
// .catch(function(err) {
// zcache("$c--->axios: err.", "background: red.");
// });
},
// disClick() {
// this.$router.push("Discount");
// },
// mainSaleClick() {
// this.$router.push("MainSale");
// },
listClick(inData) {
// this.$router.push(inData);
// this.$router.push({name: inData, transData: {userId: this.zcache.code}})
// alert(`--->listClick: IN.`)
// alert(`--->listClick: indata =${inData}. userId =${this.zcache.userId}`)
this.$router.push({
name: inData,
params: { userId: this.zcache.userId }
});
// this.$router.push({name: inData, params: {userId: 'SEGA'}})
},
buttonSingleMarketingClick() {
// this.$router.push("");
},
buttonMainMarketingClick() {
this.$router.push("MainSale");
},
testButton(inCode) {}
}
};
</script> </script>
<style scoped> <style scoped lang="scss">
/* button { .main {
border: 1px solid gray; background-color: white;
margin: 2px; width: 100%;
border-radius: 4px; height: 100%;
padding: 4px;
} */ display: flex;
flex-direction: column;
.main { justify-content: start;
background-color: white; overflow: scroll;
width: 100%; }
height: 100%;
.lists {
display: flex; height: auto;
flex-direction: column; padding: 4px 12px;
justify-content: start; padding-bottom: 40px;
overflow: scroll;
} display: flex;
.lists { flex-direction: column;
/* border: 2px solid red; */ justify-content: flex-start;
height: auto; align-items: flex-start;
padding: 4px 12px; overflow: scroll;
/* margin-bottom: 20px; */ }
padding-bottom: 40px;
.list {
display: flex; height: 140px;
flex-direction: column; box-shadow: 0px 2px 4px 0px rgb(187, 187, 187);
justify-content: flex-start; margin: 6px 0px;
align-items: flex-start; padding: 0px 12px;
overflow: scroll; border-radius: 6px;
}
.list { display: flex;
height: 140px; flex-direction: row;
/* border: 2px solid orange; */ justify-content: flex-start;
box-shadow: 0px 2px 4px 0px rgb(187, 187, 187); align-items: center;
margin: 6px 0px; }
padding: 0px 12px;
border-radius: 6px; .list-logo {
/* border: 1px solid red; */
display: flex; width: 100px;
flex-direction: row; height: 100px;
justify-content: flex-start; border-radius: 6px;
align-items: center; }
}
.list-logo { .list-infos {
/* border: 1px solid red; */ /* border: 1px solid orange; */
width: 100px; height: 100px;
height: 100px; padding-left: 12px;
border-radius: 6px;
} display: flex;
.list-infos { flex-direction: column;
/* border: 1px solid orange; */ justify-content: flex-start;
width: 100; align-items: flex-start;
height: 100px; }
padding-left: 12px;
.list-info-title {
display: flex; width: 100%;
flex-direction: column; height: 18px;
justify-content: flex-start;
align-items: flex-start; font-size: 16px;
} font-weight: bold;
.list-info-title { line-height: 18px;
width: 100%; }
height: 18px;
.list-info-dsc {
font-size: 16px; margin-top: 6px;
font-weight: bold; width: 100%;
line-height: 18px; height: 16px;
}
.list-info-dsc { font-size: 12px;
margin-top: 6px; font-weight: normal;
width: 100%; line-height: 18px;
height: 16px; }
font-size: 12px;
font-weight: normal;
line-height: 18px;
}
.menus {
border-top: 1px solid rgb(194, 194, 194);
position: fixed;
bottom: 0px;
left: 0px;
width: 100%;
height: 50px;
background-color: white;
display: flex;
flex-direction: row;
justify-content: start;
align-items: center;
}
.menu {
/* border: 1px solid red; */
height: 50px;
/* width: 120px; */
width: 50%;
line-height: 50px;
text-align: center;
font-size: 14px;
color: black;
}
.activeMenu {
color: lightcoral;
}
</style>
<style scoped>
.testButton {
border: 1px solid red;
/* width: 140px; */
width: auto;
font-size: 14px;
margin-top: 4px;
padding-bottom: 4px;
}
.fkwindow {
border: 1px solid limegreen;
padding: 4px;
height: 100px;
width: 100%;
overflow: auto;
font-size: 14px;
word-wrap: break-word;
}
</style> </style>
<template>
<div class="register_container">
<div v-for="(item, index) of list" :key="index" @click="sendMessage">
<div class="list">
<div>
<img class="list-logo" :src="item.logoUrl" alt/>
</div>
<div class="list-infos">
<div class="list-info-title">{{item.name}}</div>
<div class="list-info-dsc">{{item.dsc}}</div>
</div>
</div>
</div>
</div>
</template>
<script>
export default {
name: 'register',
data() {
return {
list:[
{
name: "会员拉新",
dsc: "推送给顾客成为欧亚会员,完成拉新任务",
logoUrl: "/mainSale/4.png"
}
]
}
},
mounted(){
},
methods:{
sendMessage(){
wx.invoke(
"sendChatMessage",
{
msgtype: "text", //消息类型,必填
news: {
link: `http://qywx2.100smartdata.com/register`, //H5消息页面url 必填
title: "会员拉新", //H5消息标题
desc: '注册成为欧亚会员', //H5消息摘要
imgUrl: "" //H5消息封面图片URL
}
},
function(res) {
if (res.err_msg == "sendChatMessage:ok") {
alert("--->register.vue: zpick: h5 分享成功!");
} else if (res.err_msg != "sendChatMessage:ok") {
alert(`--->register.vue: zpick: h5 分享失败.`);
}
}
);
}
}
}
</script>
<style lang="scss" scoped>
.register_container{
padding: 4px 12px 40px 12px;
.list {
height: 140px;
box-shadow: 0px 2px 4px 0px rgb(187, 187, 187);
margin: 6px 0px;
padding: 0px 12px;
border-radius: 6px;
display: flex;
flex-direction: row;
justify-content: flex-start;
align-items: center;
.list-logo {
width: 100px;
height: 100px;
border-radius: 6px;
}
.list-infos {
height: 100px;
padding-left: 12px;
display: flex;
flex-direction: column;
justify-content: flex-start;
align-items: flex-start;
}
.list-info-title {
width: 100%;
height: 18px;
font-size: 16px;
font-weight: bold;
line-height: 18px;
}
.list-info-dsc {
margin-top: 6px;
width: 100%;
height: 16px;
font-size: 12px;
font-weight: normal;
line-height: 18px;
}
}
}
</style>
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