Commit b1beab30 authored by xd's avatar xd

解决冲突4。8

parents 9b0dbe03 305c6a7e
...@@ -78,6 +78,7 @@ export default { ...@@ -78,6 +78,7 @@ export default {
components: {}, components: {},
data() { data() {
return { return {
code: '',
type: "coupon", type: "coupon",
freeze: false, freeze: false,
rolling: false, rolling: false,
...@@ -119,6 +120,9 @@ export default { ...@@ -119,6 +120,9 @@ export default {
}, },
created() { created() {
this.type = this.$route.query.type; this.type = this.$route.query.type;
// 检测用户身份
// 获取code
this.zReadyUserId()
}, },
watch: { watch: {
prizeNumber() { prizeNumber() {
...@@ -136,6 +140,46 @@ export default { ...@@ -136,6 +140,46 @@ export default {
} }
}, },
methods: { methods: {
zReadyUserId() {
if (this.$route.query.code === undefined) {
alert("没code");
console.log('code', this.$route.query.code);
this.zTestPreAuthCode();
} else {
alert("有code");
// this.zTestGetNowUrlInfo();
// this.zTestGetUserInfoByOldToken();
}
},
// 获取code
zTestPreAuthCode() {
// alert('获取code')
const basicInfo = {
head: "https://open.weixin.qq.com/connect/oauth2/authorize?",
// appId: "wwd1cdbca7b8b2b6c4",
appId: "ww4df265003b43fa0d",
redirectUrI: encodeURIComponent("oysales.oywanhao.com:8087/activeDetail?id=2&type=wheel"),
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;
},
Start_Game() { Start_Game() {
this.rolling = true; this.rolling = true;
const { wheelDeg, prizeList } = this; const { wheelDeg, prizeList } = this;
......
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
<!-- <div class="menu"> <!-- <div class="menu">
<img class="menu-logo" :src="test.menuInfo.icon['1']" /> <img class="menu-logo" :src="test.menuInfo.icon['1']" />
<div class="menu-text">优惠券核销</div> <div class="menu-text">优惠券核销</div>
</div> --> </div>-->
<div class="menu" @click="menu02Click"> <div class="menu" @click="menu02Click">
<img class="menu-logo" :src="test.menuInfo.icon['2']" /> <img class="menu-logo" :src="test.menuInfo.icon['2']" />
<div class="menu-text">任务列表</div> <div class="menu-text">任务列表</div>
...@@ -111,9 +111,9 @@ ...@@ -111,9 +111,9 @@
</template> </template>
<script> <script>
import axios from "axios" import axios from "axios";
import { getStoreDetail } from "@/api/sidebar/voucher"; import { getStoreDetail } 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";
export default { export default {
name: "discountIndex", name: "discountIndex",
...@@ -191,12 +191,11 @@ export default { ...@@ -191,12 +191,11 @@ export default {
"5": "/mainSale/icon-menuBar-5-ac.png" "5": "/mainSale/icon-menuBar-5-ac.png"
} }
} }
}, }
}, },
dis: {}, dis: {},
oyStallCode: '', oyStallCode: "",
userId: '', userId: "",
zcache: { zcache: {
nowUrl: "", nowUrl: "",
preAuthCodeUrl: "", preAuthCodeUrl: "",
...@@ -205,7 +204,7 @@ export default { ...@@ -205,7 +204,7 @@ export default {
userInfoResOld: "", userInfoResOld: "",
userInfoResNew: "" userInfoResNew: ""
} }
} };
}, },
created() { created() {
if(sessionStorage.getItem('personalFan')) { if(sessionStorage.getItem('personalFan')) {
...@@ -225,8 +224,6 @@ export default { ...@@ -225,8 +224,6 @@ export default {
this.zTestGetNowUrlInfo() this.zTestGetNowUrlInfo()
// this.oyStallCode = sessionStorage.getItem('oyStallCode') // this.oyStallCode = sessionStorage.getItem('oyStallCode')
// this.userId = sessionStorage.getItem('userId') // this.userId = sessionStorage.getItem('userId')
}, },
methods: { methods: {
// 获取用户信息 // 获取用户信息
...@@ -237,7 +234,9 @@ export default { ...@@ -237,7 +234,9 @@ export default {
}; };
axios({ axios({
url: "http://139.155.48.151:8085/workWx/auth/user/get?userId=" + this.zcache.userId, url:
"http://139.155.48.151:8085/workWx/auth/user/get?userId=" +
this.zcache.userId,
method: "get", method: "get",
headers: headerData headers: headerData
}) })
...@@ -248,7 +247,7 @@ export default { ...@@ -248,7 +247,7 @@ export default {
sessionStorage.setItem("avatar", res.data.data.avatar) sessionStorage.setItem("avatar", res.data.data.avatar)
}) })
.catch(err => { .catch(err => {
console.log(err) console.log(err);
}); });
}, },
getFans() { getFans() {
...@@ -258,7 +257,9 @@ export default { ...@@ -258,7 +257,9 @@ export default {
}; };
axios({ axios({
url: "http://139.155.48.151:8085/workWx/auth/contact/listExternalContacts?userId=" + this.zcache.userId, url:
"http://139.155.48.151:8085/workWx/auth/contact/listExternalContacts?userId=" +
this.zcache.userId,
method: "get", method: "get",
headers: headerData headers: headerData
}) })
...@@ -274,13 +275,13 @@ export default { ...@@ -274,13 +275,13 @@ export default {
getStore() { getStore() {
let params = { let params = {
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";
...@@ -292,11 +293,11 @@ export default { ...@@ -292,11 +293,11 @@ export default {
}, },
switchBarClick() { switchBarClick() {
this.$router.push({ this.$router.push({
path:'ChangeCounter', path: "ChangeCounter",
query:{ query: {
userId: this.zcache.userId userId: this.zcache.userId
} }
}) });
}, },
testButtonClick() {}, testButtonClick() {},
menu01Click() {}, menu01Click() {},
...@@ -332,9 +333,9 @@ export default { ...@@ -332,9 +333,9 @@ export default {
}, },
// 获取code // 获取code
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();
...@@ -345,7 +346,7 @@ export default { ...@@ -345,7 +346,7 @@ export default {
zTestGetNowUrlInfo() { zTestGetNowUrlInfo() {
this.zcache.nowUrl = JSON.stringify(this.$route.query); this.zcache.nowUrl = JSON.stringify(this.$route.query);
this.zcache.code = String(this.$route.query.code); this.zcache.code = String(this.$route.query.code);
this.url = this.zcache.nowUrl this.url = this.zcache.nowUrl;
}, },
zTestPreAuthCode() { zTestPreAuthCode() {
// alert('获取code') // alert('获取code')
...@@ -379,39 +380,41 @@ export default { ...@@ -379,39 +380,41 @@ export default {
// 测试-获取用户信息 // 测试-获取用户信息
zTestGetUserInfoByOldToken() { zTestGetUserInfoByOldToken() {
let postData = { let postData = {
code: this.zcache.code, code: this.zcache.code
}; };
let headerData = { let headerData = {
agentId: "1000033", agentId: "1000033",
corpId: "ww4df265003b43fa0d" corpId: "ww4df265003b43fa0d"
}; };
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
}) })
.then(res => { .then(res => {
// alert('获取用户信息接口成功') // alert('获取用户信息接口成功')
sessionStorage.setItem("userId", String(res.data.data.userId)) sessionStorage.setItem("userId", String(res.data.data.userId));
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();
}) })
.catch(err => { .catch(err => {
console.log(err) console.log(err);
}); });
}, },
getUserFromId(id) { getUserFromId(id) {
let userName = id let userName = id;
getUserInfoByUserId({ userName }).then(res => { getUserInfoByUserId({ userName })
sessionStorage.setItem("oyStallCode",res.data[0].oyStallCode) .then(res => {
this.oyStallCode = res.data[0].oyStallCode sessionStorage.setItem("oyStallCode", res.data[0].oyStallCode);
this.getStore() this.oyStallCode = res.data[0].oyStallCode;
this.getFans() this.getStore();
}) this.getFans();
.catch(err => {
}) })
.catch(err => {});
} }
} }
}; };
......
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