Commit fae1fade authored by leiqingsong's avatar leiqingsong

活动模块前端细节处理1

parent 7e806b05
...@@ -69,9 +69,13 @@ export function getAllCouponsByOyStallCode(id) { ...@@ -69,9 +69,13 @@ export function getAllCouponsByOyStallCode(id) {
}) })
} }
export function getUserBaseInfo(code) { /**
* 现有开展活动
*/
export function getCurrentActive() {
return request({ return request({
url: `activity/getUserInfo?code=${code}`, url: `activity/underway`,
method: 'get' method: 'get'
}) })
} }
\ No newline at end of file
export function CoutDown(Endtime) {
let leftTime = (new Date(Endtime)) - new Date(); //计算剩余的毫秒数
let days = parseInt(leftTime / 1000 / 60 / 60 / 24, 10); //计算剩余的天数
let hours = parseInt(leftTime / 1000 / 60 / 60 % 24, 10); //计算剩余的小时
let minutes = parseInt(leftTime / 1000 / 60 % 60, 10);//计算剩余的分钟
let seconds = parseInt(leftTime / 1000 % 60, 10);//计算剩余的秒数
days = checkTime(days);
hours = checkTime(hours);
minutes = checkTime(minutes);
seconds = checkTime(seconds);
if (days >= 0 || hours >= 0 || minutes >= 0 || seconds >= 0) {
document.getElementById("timer").innerHTML = days + "天" + hours + "小时" + minutes + "分" + seconds + "秒";
}
if (days <= 0 && hours <= 0 && minutes <= 0 && seconds <= 0) {
window.clearInterval(_ordertimer);
_ordertimer = null;
}
function checkTime(i) { //将0-9的数字前面加上0,例1变为01
if (i < 10) {
i = "0" + i;
}
return i;
}
}
\ No newline at end of file
<template> <template>
<div id="active-detail"> <div id="active-detail">
<img class="bg" src="../../../public/img/activeDetail_bg.jpg" alt="bg" /> <img class="bg" src="../../../public/img/activeDetail_bg.jpg" alt="bg" />
<template v-if="type === 'coupon'"> <template v-if="active_type === 'coupon'">
<div class="coupon"> <div class="coupon">
<div class="user-icon">用户头像</div> <div class="user-icon">用户头像</div>
<p class="slogan">送你限量优惠券,手慢无~</p> <p class="slogan">送你限量优惠券,手慢无~</p>
...@@ -22,12 +22,13 @@ ...@@ -22,12 +22,13 @@
<div class="btn">立即领取</div> <div class="btn">立即领取</div>
</div> </div>
</template> </template>
<template v-if="type === 'wheel'"> <template v-if="active_type === 'wheel'">
<div class="wheel-container"> <div class="wheel-container">
<p class="title">{{ activityName }}</p> <p class="title">{{ activityName }}</p>
<div class="wheel"> <div class="wheel">
<div class="wheel-point" @click="Start_Game"></div> <div class="wheel-point" @click="Start_Game"></div>
<img src="../../../public/img/wheel.png" alt="wheel" /> <img src="../../../public/img/wheel.png" alt="wheel" />
<div class="circle"></div>
<div <div
class="wheel-bg" class="wheel-bg"
:class="{freeze: freeze}" :class="{freeze: freeze}"
...@@ -41,7 +42,7 @@ ...@@ -41,7 +42,7 @@
> >
<div class="prize-name">{{ item.name }}</div> <div class="prize-name">{{ item.name }}</div>
<div class="prize-icon"> <div class="prize-icon">
<img :src="item.icon" /> <img src="/img/counter.png" />
</div> </div>
</div> </div>
</div> </div>
...@@ -59,7 +60,7 @@ ...@@ -59,7 +60,7 @@
</div> </div>
<div class="time-line"> <div class="time-line">
距离结束仅剩 距离结束仅剩
<span>16天10:45:38</span> <span id="timer"></span>
</div> </div>
<div class="description"> <div class="description">
<div class="t">活动介绍</div> <div class="t">活动介绍</div>
...@@ -67,12 +68,16 @@ ...@@ -67,12 +68,16 @@
</div> </div>
</div> </div>
</template> </template>
<div class="btn-share" :style="type === 'coupon'? 'bottom: 0': ''" @click="handleShare">立即分享</div> <div
class="btn-share"
:style="active_type === 'coupon'? 'bottom: 0': ''"
@click="handleShare"
>立即分享</div>
<van-overlay :show="showAward" @click="showAward = false"> <van-overlay :show="showAward" @click="showAward = false">
<div class="wrapper" @click.stop> <div class="wrapper" @click.stop>
<div v-if="isAward" class="block"> <div v-if="isAward" class="block">
<p style="font-size: 20px;font-weight: bold;">OLAY全场通用抵扣券</p> <p style="font-size: 20px;font-weight: bold;">OLAY全场通用抵扣券</p>
<p style="font-size: 20px;font-weight: bold;">一等奖</p> <p style="font-size: 20px;font-weight: bold;">{{ awardGood.prizeName }}</p>
<p style="font-size: 20px;font-weight: bold;">恭喜您中奖!</p> <p style="font-size: 20px;font-weight: bold;">恭喜您中奖!</p>
<van-button style="background: #f00;color: #fff;" @click="handleGet">领取奖品</van-button> <van-button style="background: #f00;color: #fff;" @click="handleGet">领取奖品</van-button>
<van-button style="border-color: #7f7777;" @click="showAward = false">继续抽奖</van-button> <van-button style="border-color: #7f7777;" @click="showAward = false">继续抽奖</van-button>
...@@ -83,7 +88,6 @@ ...@@ -83,7 +88,6 @@
</div> </div>
</div> </div>
</van-overlay> </van-overlay>
<wx-auth :show-auth="showAuthDialog" @confirm="handleCheckAuth"></wx-auth> <wx-auth :show-auth="showAuthDialog" @confirm="handleCheckAuth"></wx-auth>
</div> </div>
</template> </template>
...@@ -92,11 +96,14 @@ ...@@ -92,11 +96,14 @@
import axios from "axios"; import axios from "axios";
import wxAuth from "@/components/wxAuth"; import wxAuth from "@/components/wxAuth";
import * as APi_Active from "@/api/active"; import * as APi_Active from "@/api/active";
import { CoutDown } from "@/utils/Foundation";
export default { export default {
name: "active-detail", name: "active-detail",
components: { wxAuth }, components: { wxAuth },
data() { data() {
return { return {
timer: null,
timeLine: "1586628005000",
isAward: false, isAward: false,
showAward: false, showAward: false,
userBaseInfo: "", userBaseInfo: "",
...@@ -110,7 +117,7 @@ export default { ...@@ -110,7 +117,7 @@ export default {
userId: "", userId: "",
code: "", code: "",
active_id: "", active_id: "",
type: "coupon", active_type: "coupon",
freeze: false, freeze: false,
rolling: false, rolling: false,
wheelDeg: 0, wheelDeg: 0,
...@@ -149,40 +156,41 @@ export default { ...@@ -149,40 +156,41 @@ export default {
], ],
activityName: "", activityName: "",
prizeDesc: "", prizeDesc: "",
des: "" des: "",
awardGood: {
prizeName: ""
}
}; };
}, },
async created() { async created() {
console.log("活动详情1"); console.log("活动详情1");
this.currentUrl = location.href; this.currentUrl = location.href;
this.active_id = this.$route.query.id; this.active_id = this.$route.query.id;
this.type = this.$route.query.type; this.active_type = this.$route.query.active_type;
console.log("query", this.$route.query); console.log("query", this.$route.query);
// 验证用户是否登录 // 验证用户是否登录
if (!sessionStorage.getItem("userId")) { if (!sessionStorage.getItem("userId")) {
// 1.获取code // 1.获取code
if (this.$route.query.code === undefined) { if (this.$route.query.unionid === undefined) {
this.showAuthDialog = true; // this.showAuthDialog = true;
// this.getUnionid();
} else { } else {
this.userBaseInfo = await this.getUserBaseInfo(this.$route.query.code); let params = {
console.log("userbaseInfo", this.userBaseInfo); number: 7,
if (this.userBaseInfo.unionid) { unionId: this.$route.query.unionid
let params = { };
number: 7, APi_Active.isMember(params).then(res => {
unionId: this.userBaseInfo.unionid this.isMember = res.data.vipId !== "";
}; this.userBaseInfo.mobile = res.data.mobile;
APi_Active.isMember(params).then(res => { this.userBaseInfo.name = res.data.name;
this.isMember = res.data.vipId !== ""; });
this.userBaseInfo.phone = res.data.mobile ? res.data.mobile : "";
});
} else {
console.log("没有unionid");
this.isMember = false;
}
} }
} }
}, },
mounted() { mounted() {
this.timer = setInterval(() => {
CoutDown('2020-5-13 2:5:47');
}, 1000);
this.getAgentAuth(); this.getAgentAuth();
this.GET_DetailById(this.active_id); this.GET_DetailById(this.active_id);
}, },
...@@ -205,7 +213,9 @@ export default { ...@@ -205,7 +213,9 @@ export default {
// 领取 // 领取
handleGet() { handleGet() {
this.showAward = false; this.showAward = false;
this.$toast('领取成功!奖品已经发送到您的会员账户,请进入欧亚小程序查看。') this.$toast(
"领取成功!奖品已经发送到您的会员账户,请进入欧亚小程序查看。"
);
}, },
GET_DetailById(id) { GET_DetailById(id) {
APi_Active.getActiveDetailById(id).then(res => { APi_Active.getActiveDetailById(id).then(res => {
...@@ -213,64 +223,18 @@ export default { ...@@ -213,64 +223,18 @@ export default {
this.activityName = res.data.activityName; this.activityName = res.data.activityName;
this.des = res.data.des; this.des = res.data.des;
this.prizeDesc = res.data.prizeDesc; this.prizeDesc = res.data.prizeDesc;
// this.prizeListOrigin = res.data.list;
}); });
}, },
handleCheckAuth() { handleCheckAuth() {
this.showAuthDialog = false; this.showAuthDialog = false;
this.getAuthCode(); this.getUnionid();
},
async getUserBaseInfo(code) {
const res = await APi_Active.getUserBaseInfo(code);
return res;
},
// 获取code
getAuthCode() {
// alert('获取code')
const basicInfo = {
head: "https://open.weixin.qq.com/connect/oauth2/authorize?",
appId: "ww4df265003b43fa0d",
redirectUrI: encodeURIComponent(
`oysales.oywanhao.com:8087/activeDetail?id=${this.active_id}&type=${this.type}`
),
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;
window.location.href = url;
}, },
getUnionid() { getUnionid() {
// window.location.href = 'http://wxmc.oysd.cn/GetWXUserInfo.aspx' let redirect_uri = encodeURIComponent(
// 获取用户 unionid、openid `oysales.oywanhao.com:8087/activeDetail?id=${this.active_id}&active_type=${this.active_type}`
// http://wxmc.oysd.cn/GetWXUserInfo.aspx );
// axios({ window.location.href = `http://wxsyls.oysd.cn/getwxuserinfo.aspx?jump=${redirect_uri}`;
// url: `http://wxmc.oysd.cn/GetWXUserInfo.aspx`,
// method: 'get'
// }).then(res => {
// console.log(res);
// this.unionid = res.msg.unionid;
// this.openid = res.msg.openid;
// let params = {
// number: 7,
// unionId: this.unionid
// }
// APi_Active.isMember(params).then(res => {
// this.isMember = res.data.vipId !== '';
// })
// })
}, },
Start_Game() { Start_Game() {
if (!this.isMember) { if (!this.isMember) {
...@@ -281,23 +245,26 @@ export default { ...@@ -281,23 +245,26 @@ export default {
} }
let params = { let params = {
activityId: this.active_id, activityId: this.active_id,
openId: this.userBaseInfo.openId, openId: this.$route.query.openId,
phone: this.userBaseInfo.phone, phone: this.userBaseInfo.phone,
unionId: this.userBaseInfo.unionId, unionId: this.$route.query.unionId,
// userId: userName: this.userBaseInfo.name
userName: this.getUserBaseInfo.nickname
}; };
APi_Active.play(params) APi_Active.play(params)
.then(res => { .then(res => {
this.rolling = true; this.rolling = true;
const { wheelDeg, prizeList } = this; const { wheelDeg, prizeList } = this;
const random = parseInt(6 * Math.random(0, 5)); // const random = parseInt(6 * Math.random(0, 5));
const random = prizeList
.map(item => item.id)
.indexOf(res.data.prizeId);
this.wheelDeg = this.wheelDeg =
wheelDeg - wheelDeg -
(wheelDeg % 360) + (wheelDeg % 360) +
6 * 360 - 6 * 360 -
(360 / prizeList.length) * random; (360 / prizeList.length) * random;
setTimeout(() => { setTimeout(() => {
this.awardGood = prizeList[random] || "";
this.rolling = false; this.rolling = false;
this.showAward = true; this.showAward = true;
this.isAward = res.data.prizeName !== "谢谢惠顾"; this.isAward = res.data.prizeName !== "谢谢惠顾";
...@@ -309,14 +276,12 @@ export default { ...@@ -309,14 +276,12 @@ export default {
}, },
// 分享 // 分享
handleShare() { handleShare() {
console.log("立即分享"); let url = `http://oysales.oywanhao.com:8087/activeDetail?id=${this.active_id}&active_type=${this.active_type}`;
let url = `http://oysales.oywanhao.com:8087/activeDetail?id=${this.active_id}&type=${this.type}`;
console.log("url", url);
wx.invoke( wx.invoke(
"shareToExternalContact", "shareToExternalContact",
{ {
title: "大转盘", // 分享标题 title: `${this.activityName}`, // 分享标题
desc: "抽奖活动", // 分享描述 desc: `${this.des}`, // 分享描述
link: url, // 分享链接 link: url, // 分享链接
imgUrl: "" // 分享封面 imgUrl: "" // 分享封面
}, },
...@@ -329,6 +294,9 @@ export default { ...@@ -329,6 +294,9 @@ export default {
} }
); );
} }
},
destroyed() {
clearInterval(this.timer)
} }
}; };
</script> </script>
......
...@@ -2,102 +2,137 @@ ...@@ -2,102 +2,137 @@
<div class="container"> <div class="container">
<div class="title"> <div class="title">
<span>大转盘抽奖</span> <span>大转盘抽奖</span>
<span class="fr">查看更多<span class="icon">></span></span>
</div> </div>
<div class="active"> <div class="active">
<div class="list" v-for="item in activeList" :key="item.id" @click="toDetail(item.id, item.activityType)"> <template v-for="(item, index) in activeList">
<div class="left"></div> <div
v-if="index < wheelActive_limit"
class="list"
:key="item.id"
@click="toDetail(item.id, item.activityType)"
>
<div class="left">
<img :src="item.logo" alt="logo" style="width:100%;height:100%;" />
</div>
<div class="right"> <div class="right">
<h3>{{ item.activityName }}</h3> <h3>{{ item.activityName }}</h3>
<p>{{ item.des }}</p> <p>{{ item.des }}</p>
</div> </div>
</div> </div>
</template>
<span
class="more"
v-if="activeList.length && !activeList_finished"
@click="handleWheelActiveMore"
>
查看更多
<span class="icon">></span>
</span>
</div> </div>
<div v-if="couponList.length > 0" class="fg">送券活动</div> <div v-if="couponList.length > 0" class="fg">送券活动</div>
<div class="active"> <div class="active">
<div class="list" v-for="item in couponList" :key="item.id" @click="toDetail(item.id, item.activityType)"> <div
<div class="left"></div> class="list"
<div class="right"> v-for="item in couponList"
<h3>{{ item.activityName }}</h3> :key="item.id"
<p>{{ item.des }}</p> @click="toDetail(item.id, item.activityType)"
</div> >
<div class="left"></div>
<div class="right">
<h3>{{ item.activityName }}</h3>
<p>{{ item.des }}</p>
</div>
</div> </div>
</div> </div>
</div> </div>
</template> </template>
<script> <script>
import * as API_Active from '@/api/active'; import * as API_Active from "@/api/active";
export default { export default {
data() { data() {
return { return {
wheelActive_limit: 3,
activeList_finished: false,
activeList: [ activeList: [
{ {
id: 1, id: 1,
activityType: 'coupon', activityType: "coupon",
activityName: '砍价', activityName: "砍价",
des: '由各种物质组成的巨型球状天体,叫做星球。星球有一定的形状。' des: "由各种物质组成的巨型球状天体,叫做星球。星球有一定的形状。"
}, },
{ {
id: 2, id: 2,
activityType: 'wheel', activityType: "wheel",
activityName: '集赞', activityName: "集赞",
des: '由各种物质组成的巨型球状天体,叫做星球。星球有一定的形状。' des: "由各种物质组成的巨型球状天体,叫做星球。星球有一定的形状。"
} }
], ],
couponList: [ couponList: [
{ {
id: 1, id: 1,
activityType: 'coupon', activityType: "coupon",
activityName: '砍价', activityName: "砍价",
des: '由各种物质组成的巨型球状天体,叫做星球。星球有一定的形状。' des: "由各种物质组成的巨型球状天体,叫做星球。星球有一定的形状。"
}, },
{ {
id: 2, id: 2,
activityType: 'wheel', activityType: "wheel",
activityName: '集赞', activityName: "集赞",
des: '由各种物质组成的巨型球状天体,叫做星球。星球有一定的形状。' des: "由各种物质组成的巨型球状天体,叫做星球。星球有一定的形状。"
} }
], ],
params: { params: {
pageNo: 1, pageNo: 1,
pageSize: 10 pageSize: 10
} }
} };
}, },
mounted() { mounted() {
this.getActiveList(this.params); this.getActiveList(this.params);
}, },
methods: { methods: {
handleWheelActiveMore() {
this.wheelActive_limit += 3;
if (this.wheelActive_limit === this.activeList.length - 3) {
this.activeList_finished = true;
return;
}
},
// 获取 活动列表 // 获取 活动列表
getActiveList(params) { getActiveList(params) {
API_Active.getActiveList(params).then(res => { API_Active.getActiveList(params).then(res => {
console.log('获取到数据'); console.log("获取到数据");
this.activeList = res.data.list; this.activeList = res.data.list;
}) });
}, },
// 跳转到 活动详情 // 跳转到 活动详情
toDetail(active_id, type) { toDetail(active_id, type) {
this.$router.push({ this.$router.push({
path: '/activeDetail', path: "/activeDetail",
query: { query: {
id: active_id, id: active_id,
type: type active_type: type
} }
}) });
} }
} }
}; };
</script> </script>
<style scoped> <style scoped>
.more {
float: right;
margin-bottom: 5px;
font-size: 12px;
}
.container { .container {
height: auto; height: auto;
background-color: rgba(248, 248, 248, 1); background-color: rgba(248, 248, 248, 1);
min-height: 100%; min-height: 100%;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
justify-content: flex-start; justify-content: flex-start;
} }
.title { .title {
height: 44px; height: 44px;
...@@ -114,7 +149,7 @@ export default { ...@@ -114,7 +149,7 @@ export default {
font-size: 12px; font-size: 12px;
color: rgba(45, 71, 106, 1); color: rgba(45, 71, 106, 1);
height: 44px; height: 44px;
line-height: 44px; line-height: 44px;
} }
.icon { .icon {
font-weight: 800; font-weight: 800;
...@@ -122,7 +157,7 @@ export default { ...@@ -122,7 +157,7 @@ export default {
.active { .active {
background-color: #fff; background-color: #fff;
padding: 12px 12px 0 12px; padding: 12px 12px 0 12px;
box-shadow:0px 2px 4px 0px rgba(221,221,221,1); box-shadow: 0px 2px 4px 0px rgba(221, 221, 221, 1);
} }
.list { .list {
height: 94px; height: 94px;
...@@ -130,19 +165,20 @@ export default { ...@@ -130,19 +165,20 @@ export default {
background-color: #fff; background-color: #fff;
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
border-bottom: 1px solid rgba(238,238,238,1); border-bottom: 1px solid rgba(238, 238, 238, 1);
margin-bottom: 14px; margin-bottom: 14px;
} }
.list3 { .list3 {
border-bottom: none; border-bottom: none;
margin-bottom: 0; margin-bottom: 0;
} }
.left,.right { .left,
.right {
height: 80px; height: 80px;
} }
.left { .left {
width: 80px; width: 80px;
background:rgba(248,248,248,1); background: rgba(248, 248, 248, 1);
} }
.right { .right {
width: 76%; width: 76%;
...@@ -151,12 +187,12 @@ export default { ...@@ -151,12 +187,12 @@ export default {
} }
h3 { h3 {
font-size: 14px; font-size: 14px;
font-weight:bold; font-weight: bold;
color:rgba(45,71,106,1); color: rgba(45, 71, 106, 1);
} }
p { p {
margin-top: 10px; margin-top: 10px;
font-size:12px; font-size: 12px;
color:rgba(45,71,106,0.8); color: rgba(45, 71, 106, 0.8);
} }
</style> </style>
...@@ -127,7 +127,13 @@ ...@@ -127,7 +127,13 @@
<van-field class="right" v-model="prizeList[index].name" placeholder="请输入奖项名称" /> <van-field class="right" v-model="prizeList[index].name" placeholder="请输入奖项名称" />
</template> </template>
</van-cell> </van-cell>
<van-cell title="选择优惠券" value="1" is-link @click="show = true" center /> <van-cell
title="选择优惠券"
:value="prizeList[index].checked_coupon.name"
is-link
@click="handleCheckCoupon(index)"
center
/>
<van-cell title="总发放数量限制" style="font-size:14px;"> <van-cell title="总发放数量限制" style="font-size:14px;">
<template slot="default"> <template slot="default">
<div class="jpsl"> <div class="jpsl">
...@@ -135,15 +141,15 @@ ...@@ -135,15 +141,15 @@
class="right noborder" class="right noborder"
readonly readonly
clickable clickable
:value="prizeList[index].prize" :value="prizeList[index].total_limit"
placeholder="请输入限制次数" placeholder="请输入限制次数"
@touchstart.native.stop="prizeList[index].prizeShow = true" @touchstart.native.stop="prizeList[index].total_limit_show = true"
/> />
<van-number-keyboard <van-number-keyboard
v-model="prizeList[index].prize" v-model="prizeList[index].total_limit"
:show="prizeList[index].prizeShow" :show="prizeList[index].total_limit_show"
:maxlength="6" :maxlength="6"
@blur="prizeList[index].prizeShow = false" @blur="prizeList[index].total_limit_show = false"
/> />
</div> </div>
</template> </template>
...@@ -155,15 +161,15 @@ ...@@ -155,15 +161,15 @@
class="right noborder" class="right noborder"
readonly readonly
clickable clickable
:value="prizeList[index].prize" :value="prizeList[index].preLimit"
placeholder="请输入限制次数" placeholder="请输入限制次数"
@touchstart.native.stop="prizeList[index].prizeShow = true" @touchstart.native.stop="prizeList[index].preLimit_show = true"
/> />
<van-number-keyboard <van-number-keyboard
v-model="prizeList[index].prize" v-model="prizeList[index].preLimit"
:show="prizeList[index].prizeShow" :show="prizeList[index].preLimit_show"
:maxlength="6" :maxlength="6"
@blur="prizeList[index].prizeShow = false" @blur="prizeList[index].preLimit_show = false"
/> />
</div> </div>
</template> </template>
...@@ -175,15 +181,15 @@ ...@@ -175,15 +181,15 @@
class="right noborder" class="right noborder"
readonly readonly
clickable clickable
:value="prizeList[index].prize" :value="prizeList[index].limit"
placeholder="请输入限制数量" placeholder="请输入限制数量"
@touchstart.native.stop="prizeList[index].prizeShow = true" @touchstart.native.stop="prizeList[index].limit_show = true"
/> />
<van-number-keyboard <van-number-keyboard
v-model="prizeList[index].prize" v-model="prizeList[index].limit"
:show="prizeList[index].prizeShow" :show="prizeList[index].limit_show"
:maxlength="6" :maxlength="6"
@blur="prizeList[index].prizeShow = false" @blur="prizeList[index].limit_show = false"
/> />
</div> </div>
</template> </template>
...@@ -231,7 +237,7 @@ ...@@ -231,7 +237,7 @@
<!-- 活动图片 --> <!-- 活动图片 -->
<div class="detail" style="margin-top:0;"> <div class="detail" style="margin-top:0;">
<div class="des">活动图片</div> <div class="des">活动图片</div>
<van-uploader v-model="fileList" multiple :max-count="9" /> <van-uploader v-model="fileList_show" multiple :max-count="9" :after-read="afterImgRead" />
</div> </div>
<!-- 奖品介绍 --> <!-- 奖品介绍 -->
<div class="detail"> <div class="detail">
...@@ -250,7 +256,7 @@ ...@@ -250,7 +256,7 @@
</div> </div>
<div class="creat" @click="handleCreate">创建活动</div> <div class="creat" @click="handleCreate">创建活动</div>
<van-action-sheet v-model="show" :actions="coupons" cancel-text="取消" /> <van-action-sheet v-model="show" :actions="coupons" cancel-text="取消" @select="onSelect" />
</div> </div>
</template> </template>
...@@ -261,25 +267,23 @@ import { Toast } from "vant"; ...@@ -261,25 +267,23 @@ import { Toast } from "vant";
export default { export default {
data() { data() {
return { return {
// 选择优惠券 当前下标
current_index: -1,
logo_imgs: [], logo_imgs: [],
bg_imgs: [], bg_imgs: [],
show: false, show: false,
coupons: [ coupons: [],
{ name: "选项" },
{ name: "选项" },
{ name: "选项", subname: "描述信息" }
],
basicInfo: { basicInfo: {
title: "第一个转盘活动", title: "",
startTime: new Date(), startTime: new Date(),
startTime1: "2020-04-09 08:25:25", startTime1: "",
endTime: new Date(), endTime: new Date(),
endTime1: "2020-04-10 18:25:25", endTime1: "",
startShow: false, startShow: false,
endShow: false, endShow: false,
jointimes: "2", jointimes: "",
jointimes_show: false, jointimes_show: false,
total_join: "4", total_join: "",
total_join_show: false total_join_show: false
}, },
// 抽奖设置 // 抽奖设置
...@@ -297,27 +301,30 @@ export default { ...@@ -297,27 +301,30 @@ export default {
// 奖品设置 // 奖品设置
prizeList: [ prizeList: [
{ {
name: "奖1", name: "",
timeLine_type: "1", timeLine_type: "",
type: "1", type: "",
discountsMoney: "1", discountsMoney: "",
discountsShow: false, discountsShow: false,
full: "", full: "",
fullMoney: "", fullMoney: "",
fullShow: false, fullShow: false,
validity: "", validity: "",
startTime: new Date(), startTime: new Date(),
startTime1: "2020-04-08 08:25:25", startTime1: "",
startShow: false, startShow: false,
endTime: new Date(), endTime: new Date(),
endTime1: "2020-04-16 18:25:25", endTime1: "",
endShow: false, endShow: false,
prize: "1", total_limit: "",
prizeShow: false, total_limit_show: false,
limit: "1", preLimit: "",
limitShow: false, preLimit_show: false,
probability: "5", limit: "",
probability_show: false limit_show: false,
probability: "",
probability_show: false,
checked_coupon: {}
} }
], ],
title: "", title: "",
...@@ -329,76 +336,104 @@ export default { ...@@ -329,76 +336,104 @@ export default {
startShow: false, startShow: false,
endShow: false, endShow: false,
// 活动描述 // 活动描述
message: "123", message: "",
// 活动图片 // 活动图片
fileList_show: [],
fileList: [], fileList: [],
prize_produce: "456", prize_produce: "",
pTime: new Date(), pTime: new Date(),
confirmTime: new Date() confirmTime: new Date()
}; };
}, },
methods: { methods: {
handleCheckCoupon(index) {
this.show = true;
this.current_index = index;
},
onSelect(val) {
this.prizeList[this.current_index].checked_coupon = val;
this.show = false;
},
getCoupons() { getCoupons() {
let id = sessionStorage.getItem("oyStallCode") || 1; let id = sessionStorage.getItem("oyStallCode") || 1;
API_Active.getAllCouponsByOyStallCode(id).then(res => { API_Active.getAllCouponsByOyStallCode(id).then(res => {
this.coupons = res.data; this.coupons = res.data;
}); });
}, },
afterImgRead(file) {
if (file.length) {
// let imgs = [];
file.forEach(e => {
let params = new FormData();
params.append("file", e.file);
let url = "http://139.155.48.151:8084/admin/auth/util/saveImg";
axios.post(url, params).then(res => {
let img_url = JSON.parse(JSON.stringify(res.data.data.imgPath));
// imgs.push(img_url);
this.fileList.push(img_url);
});
});
} else {
let params = new FormData();
params.append("file", file.file);
let url = "http://139.155.48.151:8084/admin/auth/util/saveImg";
axios.post(url, params).then(res => {
this.fileList.push(JSON.parse(JSON.stringify(res.data.data.imgPath)));
});
}
console.log(this.fileList);
},
async afterLogoRead(file) { async afterLogoRead(file) {
let logo_img = await this.getImgUrl(file.file); let logo_img = await this.getImgUrl(file.file);
if (logo_img.result === "success") { let item = {
let item = { url: logo_img,
url: bg_img.data.imgPath, status: "done",
status: "done", message: "上传成功"
message: "上传成功" };
}; this.logo_imgs[0] = item;
this.logo_imgs.push(item);
}
}, },
async afterBGRead(file) { async afterBGRead(file) {
let bg_img = await this.getImgUrl(file.file); let bg_img = await this.getImgUrl(file.file);
if (bg_img.result === "success") { let item = {
let item = { url: bg_img,
url: bg_img.data.imgPath, status: "done",
status: "done", message: "上传成功"
message: "上传成功" };
}; this.bg_imgs[0] = item;
this.bg_imgs.push(item);
}
}, },
// 上传图片 // 上传图片
async getImgUrl(file) { async getImgUrl(file) {
let params = new FormData(); let params = new FormData();
params.append("file", file); params.append("file", file);
let url = "http://139.155.48.151:8084/admin/auth/util/saveImg"; let url = "http://139.155.48.151:8084/admin/auth/util/saveImg";
const res = await axios.post(url, params); const img = await axios.post(url, params);
return res; let urls = img.data.data.imgPath;
return urls;
}, },
radioChange(val) { radioChange(val) {
// console.log(val); // console.log(val);
}, },
handleCreate() { handleCreate() {
console.log("创建活动"); console.log("创建活动");
console.log(this.basicInfo);
console.log(this.LuckyDraw);
console.log(this.prizeList);
console.log(this.message);
console.log(this.fileList);
let params_prizeList = []; let params_prizeList = [];
this.prizeList.forEach(p => { this.prizeList.forEach((p, index) => {
let temp = {}; let temp = {};
temp.id = index;
temp.prizeName = p.name; temp.prizeName = p.name;
if (p.type == 1) { if (p.type == 1) {
temp.prizeType = 2; temp.prizeType = 2;
} else if (p.type === 2) { } else if (p.type == 2) {
temp.prizeType = 3; temp.prizeType = 1;
temp.prizeName = "谢谢惠顾";
} }
temp.startTime = p.startTime1; temp.startTime = p.startTime1;
temp.endTime = p.endTime1; temp.endTime = p.endTime1;
temp.quantity = p.prize; temp.quantity = p.total_limit;
temp.personLimit = p.limit;
temp.probability = p.probability; temp.probability = p.probability;
temp.limitReceive = p.limit; temp.limitReceive = p.preLimit;
temp.coupon_id = p.checked_coupon.couponId;
params_prizeList.push(temp); params_prizeList.push(temp);
}); });
let params = { let params = {
...@@ -553,6 +588,7 @@ export default { ...@@ -553,6 +588,7 @@ export default {
} }
this.prizeList.push({ this.prizeList.push({
name: "", name: "",
timeLine_type: "",
type: "", type: "",
discountsMoney: "", discountsMoney: "",
discountsShow: false, discountsShow: false,
...@@ -566,10 +602,15 @@ export default { ...@@ -566,10 +602,15 @@ export default {
endTime: new Date(), endTime: new Date(),
endTime1: "", endTime1: "",
endShow: false, endShow: false,
prize: "", total_limit: "",
prizeShow: false, total_limit_show: false,
preLimit: "",
preLimit_show: false,
limit: "", limit: "",
limitShow: false limit_show: false,
probability: "",
probability_show: false,
checked_coupon: {}
}); });
}, },
removePrice(index) { removePrice(index) {
......
<template>
<div id="more">
</div>
</template>
<script>
export default {
name: 'more',
components: {},
data() {
return {
}
}
}
</script>
<style lang="scss">
</style>
...@@ -4,10 +4,7 @@ ...@@ -4,10 +4,7 @@
<div class="manInfo-logos"> <div class="manInfo-logos">
<img class="logos-logo" :src="test.manInfo.logoUrl" /> <img class="logos-logo" :src="test.manInfo.logoUrl" />
</div> </div>
<div <div class="manInfo-name" @click="manInfoClick">我的专柜:{{test.manInfo.barName}}</div>
class="manInfo-name"
@click="manInfoClick"
>我的专柜:{{test.manInfo.barName}}</div>
<div class="manInfo-switch" @click="switchBarClick"> <div class="manInfo-switch" @click="switchBarClick">
<div class="switch-text">切换</div> <div class="switch-text">切换</div>
<img class="switch-icon" :src="test.manInfo.icon['1']" /> <img class="switch-icon" :src="test.manInfo.icon['1']" />
...@@ -17,7 +14,8 @@ ...@@ -17,7 +14,8 @@
<div class="tips-tip">店铺粉丝 {{test.barInfo.fans}}</div> <div class="tips-tip">店铺粉丝 {{test.barInfo.fans}}</div>
<div class="tips-tip">个人粉丝 {{test.barInfo.personalFans}}</div> <div class="tips-tip">个人粉丝 {{test.barInfo.personalFans}}</div>
<div class="tips-tip"> <div class="tips-tip">
昨日新增 <span>{{test.barInfo.newFans}}</span> 昨日新增
<span>{{test.barInfo.newFans}}</span>
<span>/</span> <span>/</span>
<span>{{test.barInfo.allNewFans}}</span> <span>{{test.barInfo.allNewFans}}</span>
</div> </div>
...@@ -56,16 +54,19 @@ ...@@ -56,16 +54,19 @@
<div class="actives-banners"> <div class="actives-banners">
<div class="actives-banner-title">现有开展活动</div> <div class="actives-banner-title">现有开展活动</div>
</div> </div>
<div class="actives-main"> <template v-for="(item, index) in currentActives">
<div class="active-logos"> <div v-if="index < active_limit" :key="item.id" class="actives-main">
<img class="active-logo" :src="test.activeInfo.icon['1']" /> <div class="active-logos">
</div> <!-- <img class="active-logo" :src="test.activeInfo.icon['1']" /> -->
<div class="active-infos"> <img class="active-logo" :src="item.logo" />
<div class="active-title">大转盘</div> </div>
<div class="active-dsc">{{test.cache.actDsc}}</div> <div class="active-infos">
<div class="active-title">{{item.activityName}}}</div>
<div class="active-dsc">{{item.des}}</div>
</div>
</div> </div>
</div> </template>
<div class="actives-main"> <!-- <div class="actives-main">
<div class="active-logos"> <div class="active-logos">
<img class="active-logo" :src="test.activeInfo.icon['2']" /> <img class="active-logo" :src="test.activeInfo.icon['2']" />
</div> </div>
...@@ -82,8 +83,8 @@ ...@@ -82,8 +83,8 @@
<div class="active-title">集卡</div> <div class="active-title">集卡</div>
<div class="active-dsc">{{test.cache.actDsc}}</div> <div class="active-dsc">{{test.cache.actDsc}}</div>
</div> </div>
</div> </div>-->
<div class="actives-mores"> <div v-if="currentActives.length > 3 && !finished" class="actives-mores" @click="handleMore">
<div class="mores-title">查看更多</div> <div class="mores-title">查看更多</div>
<img class="mores-icon" :src="test.cache.arrowRightDark" /> <img class="mores-icon" :src="test.cache.arrowRightDark" />
</div> </div>
...@@ -115,14 +116,22 @@ ...@@ -115,14 +116,22 @@
<script> <script>
import axios from "axios"; import axios from "axios";
import { getStoreDetail, getMemberListByCode, getDirector } from "@/api/sidebar/voucher"; import {
getStoreDetail,
getMemberListByCode,
getDirector
} from "@/api/sidebar/voucher";
import { configWx, getUserInfo } from "@/utils/aCommon"; import { configWx, getUserInfo } from "@/utils/aCommon";
import { getUserInfoByUserId } from "@/api/sidebar/voucher"; import { getUserInfoByUserId } from "@/api/sidebar/voucher";
import { log } from 'util'; import { getCurrentActive } from "@/api/active";
import { log } from "util";
export default { export default {
name: "discountIndex", name: "discountIndex",
data() { data() {
return { return {
finished: false,
active_limit: 3,
currentActives: [],
test: { test: {
cache: { cache: {
imgUrl: "/hi.jpg", imgUrl: "/hi.jpg",
...@@ -143,7 +152,7 @@ export default { ...@@ -143,7 +152,7 @@ export default {
fans: "299", fans: "299",
personalFans: "77", personalFans: "77",
newFans: "11", newFans: "11",
allNewFans: '15' allNewFans: "15"
}, },
menuInfo: { menuInfo: {
icon: { icon: {
...@@ -210,55 +219,69 @@ export default { ...@@ -210,55 +219,69 @@ export default {
userInfoResNew: "" userInfoResNew: ""
}, },
flag: 1 flag: 1
} };
}, },
created() { created() {
this.checkNowMenuBar() this.checkNowMenuBar();
if(sessionStorage.getItem('userId')) { if (sessionStorage.getItem("userId")) {
if(sessionStorage.getItem('avatar')) { if (sessionStorage.getItem("avatar")) {
this.test.manInfo.logoUrl = sessionStorage.getItem('avatar') this.test.manInfo.logoUrl = sessionStorage.getItem("avatar");
} }
if(sessionStorage.getItem('personalFan')) { if (sessionStorage.getItem("personalFan")) {
this.test.barInfo.personalFans = sessionStorage.getItem('personalFan') this.test.barInfo.personalFans = sessionStorage.getItem("personalFan");
} }
if(sessionStorage.getItem('barName')) { if (sessionStorage.getItem("barName")) {
this.test.manInfo.barName = sessionStorage.getItem('barName') this.test.manInfo.barName = sessionStorage.getItem("barName");
} }
if(sessionStorage.getItem('allFans')) { if (sessionStorage.getItem("allFans")) {
this.test.barInfo.fans = sessionStorage.getItem('allFans') this.test.barInfo.fans = sessionStorage.getItem("allFans");
} }
if(sessionStorage.getItem('newFans')) { if (sessionStorage.getItem("newFans")) {
this.test.barInfo.newFans = sessionStorage.getItem('newFans') this.test.barInfo.newFans = sessionStorage.getItem("newFans");
} }
if(sessionStorage.getItem('allNewFans')) { if (sessionStorage.getItem("allNewFans")) {
this.test.barInfo.allNewFans = sessionStorage.getItem('allNewFans') this.test.barInfo.allNewFans = sessionStorage.getItem("allNewFans");
} }
if(sessionStorage.getItem('role')) { if (sessionStorage.getItem("role")) {
this.flag = sessionStorage.getItem('role') this.flag = sessionStorage.getItem("role");
} }
}else { } else {
this.zReadyUserId() this.zReadyUserId()
this.zTestGetNowUrlInfo() this.zTestGetNowUrlInfo();
} }
this.GET_CurrentActive();
}, },
methods: { methods: {
handleMore() {
this.active_limit += 3;
if (this.active_limit === this.currentActives.length - 3) {
this.finished = true;
return;
}
},
// 获取当前 活动
GET_CurrentActive() {
getCurrentActive().then(res => {
this.currentActives = res.data;
});
},
// 获取用户角色 // 获取用户角色
getDirector(userId) { getDirector(userId) {
getDirector({userId}).then(res => { getDirector({ userId }).then(res => {
if(res.data == true) { if (res.data == true) {
this.flag = 1 this.flag = 1;
}else { } else {
this.flag = 2 this.flag = 2;
} }
sessionStorage.setItem("role", this.flag) sessionStorage.setItem("role", this.flag);
}) });
}, },
// 获取用户信息 // 获取用户信息
getUserInfo() { getUserInfo() {
let headerData = { let headerData = {
agentId: "1000033", agentId: "1000033",
corpId: "ww4df265003b43fa0d" corpId: "ww4df265003b43fa0d"
} };
axios({ axios({
url: url:
"http://139.155.48.151:8085/workWx/auth/user/get?userId=" + "http://139.155.48.151:8085/workWx/auth/user/get?userId=" +
...@@ -267,10 +290,10 @@ export default { ...@@ -267,10 +290,10 @@ export default {
headers: headerData headers: headerData
}) })
.then(res => { .then(res => {
this.test.manInfo.barFrom = res.data.data.name this.test.manInfo.barFrom = res.data.data.name;
sessionStorage.setItem("barFrom", res.data.data.name) sessionStorage.setItem("barFrom", res.data.data.name);
this.test.manInfo.logoUrl = res.data.data.avatar this.test.manInfo.logoUrl = res.data.data.avatar;
sessionStorage.setItem("avatar", res.data.data.avatar) sessionStorage.setItem("avatar", res.data.data.avatar);
}) })
.catch(err => { .catch(err => {
console.log(err); console.log(err);
...@@ -290,8 +313,8 @@ export default { ...@@ -290,8 +313,8 @@ export default {
headers: headerData headers: headerData
}) })
.then(res => { .then(res => {
this.test.barInfo.personalFans = res.data.data.length this.test.barInfo.personalFans = res.data.data.length;
sessionStorage.setItem("personalFan", res.data.data.length) sessionStorage.setItem("personalFan", res.data.data.length);
}) })
.catch(err => { .catch(err => {
console.log(err); console.log(err);
...@@ -301,68 +324,74 @@ export default { ...@@ -301,68 +324,74 @@ export default {
let headerData = { let headerData = {
agentId: "1000033", agentId: "1000033",
corpId: "ww4df265003b43fa0d" corpId: "ww4df265003b43fa0d"
} };
axios({ axios({
url: "http://139.155.48.151:8085/workWx/auth/contact/getCustomerInfoByOyStallCode?oyStallCode=" + this.oyStallCode, url:
"http://139.155.48.151:8085/workWx/auth/contact/getCustomerInfoByOyStallCode?oyStallCode=" +
this.oyStallCode,
method: "get", method: "get",
headers: headerData headers: headerData
}) })
.then(res => { .then(res => {
console.log(res,'粉丝') console.log(res, "粉丝");
this.test.barInfo.fans = res.data.data.length this.test.barInfo.fans = res.data.data.length;
sessionStorage.setItem("allFans", res.data.data.length) sessionStorage.setItem("allFans", res.data.data.length);
}) })
.catch(err => { .catch(err => {
console.log(err) console.log(err);
}) });
}, },
getNewFans() { getNewFans() {
this.getAddFans(1,this.zcache.userId) this.getAddFans(1, this.zcache.userId);
}, },
getAllNewFans() { getAllNewFans() {
let params = { let params = {
oyStallCode: this.oyStallCode oyStallCode: this.oyStallCode
} };
getMemberListByCode(params).then(res => { getMemberListByCode(params).then(res => {
console.log(res,'res'); console.log(res, "res");
this.getAddFans(2,res.data) this.getAddFans(2, res.data);
}) });
}, },
getAddFans(flag,userId) { getAddFans(flag, userId) {
let JsonStr = {} let JsonStr = {};
if(flag == 1) { if (flag == 1) {
JsonStr.userid = [userId] JsonStr.userid = [userId];
}else { } else {
JsonStr.userid = userId JsonStr.userid = userId;
} }
let timeNow = Math.round(new Date() / 1000) let timeNow = Math.round(new Date() / 1000);
JsonStr.start_time = timeNow-24*60*60 JsonStr.start_time = timeNow - 24 * 60 * 60;
JsonStr.end_time = timeNow JsonStr.end_time = timeNow;
console.log(JsonStr,'obj') console.log(JsonStr, "obj");
axios({ axios({
url: "http://139.155.48.151:8085/workWx/auth/contact/getUserBehaviorData", url:
"http://139.155.48.151:8085/workWx/auth/contact/getUserBehaviorData",
method: "post", method: "post",
headers: { headers: {
'Content-Type': 'application/json', "Content-Type": "application/json",
'agentId': "1000033", agentId: "1000033",
'corpId': "ww4df265003b43fa0d" corpId: "ww4df265003b43fa0d"
}, },
data: JsonStr data: JsonStr
}) })
.then(res => { .then(res => {
let data = JSON.parse(res.data.data) let data = JSON.parse(res.data.data);
if(flag == 1) { if (flag == 1) {
this.test.barInfo.newFans = data.behavior_data[0].new_contact_cnt + data.behavior_data[1].new_contact_cnt this.test.barInfo.newFans =
sessionStorage.setItem("newFans", this.test.barInfo.newFans) data.behavior_data[0].new_contact_cnt +
}else { data.behavior_data[1].new_contact_cnt;
this.test.barInfo.allNewFans = data.behavior_data[0].new_contact_cnt + data.behavior_data[1].new_contact_cnt sessionStorage.setItem("newFans", this.test.barInfo.newFans);
sessionStorage.setItem("allNewFans", this.test.barInfo.allNewFans) } else {
} this.test.barInfo.allNewFans =
data.behavior_data[0].new_contact_cnt +
data.behavior_data[1].new_contact_cnt;
sessionStorage.setItem("allNewFans", this.test.barInfo.allNewFans);
}
}) })
.catch(err => { .catch(err => {
console.log(err) console.log(err);
}) });
}, },
// 获取店铺信息 // 获取店铺信息
getStore() { getStore() {
...@@ -370,16 +399,18 @@ export default { ...@@ -370,16 +399,18 @@ export default {
oyStallCode: this.oyStallCode oyStallCode: this.oyStallCode
}; };
getStoreDetail(params).then(res => { getStoreDetail(params).then(res => {
if(res.data.stallInfo != null) { if (res.data.stallInfo != null) {
this.test.manInfo.barName = res.data.stallInfo.name this.test.manInfo.barName = res.data.stallInfo.name;
sessionStorage.setItem("barName", res.data.stallInfo.name) sessionStorage.setItem("barName", res.data.stallInfo.name);
} }
}); });
}, },
checkNowMenuBar() { checkNowMenuBar() {
let inData = "1"; let inData = "1";
this.test.menuBarInfo.icon.now = this.test.menuBarInfo.icon.ua; this.test.menuBarInfo.icon.now = this.test.menuBarInfo.icon.ua;
this.test.menuBarInfo.icon.now[inData] = this.test.menuBarInfo.icon.ac[inData]; this.test.menuBarInfo.icon.now[inData] = this.test.menuBarInfo.icon.ac[
inData
];
}, },
manInfoClick() { manInfoClick() {
this.$router.push("counterInfo"); this.$router.push("counterInfo");
...@@ -395,22 +426,22 @@ export default { ...@@ -395,22 +426,22 @@ export default {
testButtonClick() {}, testButtonClick() {},
menu01Click() {}, menu01Click() {},
menu02Click() { menu02Click() {
this.$router.push("Task") this.$router.push("Task");
}, },
menu03Click() { menu03Click() {
this.$router.push("activeList") this.$router.push("activeList");
}, },
menu04Click() { menu04Click() {
this.$router.push("counterInfo") this.$router.push("counterInfo");
}, },
menu05Click() { menu05Click() {
this.$router.push("ActTemplate") this.$router.push("ActTemplate");
}, },
menu06Click() { menu06Click() {
this.$router.push("goodManage") this.$router.push("goodManage");
}, },
handleCoupon() { handleCoupon() {
this.$router.push("coupon") this.$router.push("coupon");
}, },
buttonMainMarketingClick() { buttonMainMarketingClick() {
// this.$router.push("home") // this.$router.push("home")
...@@ -431,11 +462,11 @@ export default { ...@@ -431,11 +462,11 @@ export default {
zReadyUserId() { zReadyUserId() {
if (this.$route.query.code === undefined) { if (this.$route.query.code === undefined) {
// alert('没code') // alert('没code')
this.zTestPreAuthCode() this.zTestPreAuthCode();
} else { } else {
// alert('有code') // alert('有code')
this.zTestGetNowUrlInfo() this.zTestGetNowUrlInfo();
this.zTestGetUserInfoByOldToken() this.zTestGetUserInfoByOldToken();
} }
}, },
// 测试-获取当前Url信息 // 测试-获取当前Url信息
...@@ -484,7 +515,9 @@ export default { ...@@ -484,7 +515,9 @@ export default {
}; };
this.zcache.userInfoResOld = "PostData:" + JSON.stringify(postData); this.zcache.userInfoResOld = "PostData:" + JSON.stringify(postData);
axios({ axios({
url: "http://139.155.48.151:8085/workWx/auth/oauth2/getUserInfo?code=" + this.zcache.code, url:
"http://139.155.48.151:8085/workWx/auth/oauth2/getUserInfo?code=" +
this.zcache.code,
method: "post", method: "post",
headers: headerData headers: headerData
}) })
...@@ -493,8 +526,8 @@ export default { ...@@ -493,8 +526,8 @@ export default {
this.zcache.userId = String(res.data.data.userId); this.zcache.userId = String(res.data.data.userId);
this.getUserFromId(this.zcache.userId); this.getUserFromId(this.zcache.userId);
this.getUserInfo(); this.getUserInfo();
this.getNewFans() this.getNewFans();
this.getDirector(res.data.data.userId) this.getDirector(res.data.data.userId);
}) })
.catch(err => { .catch(err => {
console.log(err); console.log(err);
...@@ -504,15 +537,15 @@ export default { ...@@ -504,15 +537,15 @@ export default {
let userName = id; let userName = id;
getUserInfoByUserId({ userName }) getUserInfoByUserId({ userName })
.then(res => { .then(res => {
sessionStorage.setItem("oyStallCode", res.data[0].oyStallCode) sessionStorage.setItem("oyStallCode", res.data[0].oyStallCode);
this.oyStallCode = res.data[0].oyStallCode this.oyStallCode = res.data[0].oyStallCode;
this.getStore() this.getStore();
this.getFans() this.getFans();
this.getAllFans() this.getAllFans();
this.getNewFans() this.getNewFans();
this.getAllNewFans() this.getAllNewFans();
}) })
.catch(err => {}) .catch(err => {});
} }
} }
}; };
...@@ -686,7 +719,6 @@ export default { ...@@ -686,7 +719,6 @@ export default {
.main-actives { .main-actives {
/*border: 1px solid lightcoral;*/ /*border: 1px solid lightcoral;*/
width: 100%; width: 100%;
height: 380px;
/*margin-bottom: 94px;*/ /*margin-bottom: 94px;*/
margin-top: 36px; margin-top: 36px;
padding: 0px 12px; padding: 0px 12px;
......
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