|
@@ -20,7 +20,7 @@
|
|
></userImage>
|
|
></userImage>
|
|
<div class="info">
|
|
<div class="info">
|
|
<span
|
|
<span
|
|
- >{{ user_info.name
|
|
|
|
|
|
+ >{{ user_info.name?user_info.name:'未知'
|
|
}}<van-icon
|
|
}}<van-icon
|
|
name="notes-o"
|
|
name="notes-o"
|
|
color="#E1B98B"
|
|
color="#E1B98B"
|
|
@@ -165,6 +165,7 @@ export default {
|
|
}
|
|
}
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
|
|
+ // 推广/学习标签切换
|
|
selectTbs(i){
|
|
selectTbs(i){
|
|
if(this.user_info.marketable){
|
|
if(this.user_info.marketable){
|
|
if(i == 0&&this.tbsIndex != 0){
|
|
if(i == 0&&this.tbsIndex != 0){
|
|
@@ -187,67 +188,34 @@ export default {
|
|
// this.$router.push(`/course/adlist`);
|
|
// this.$router.push(`/course/adlist`);
|
|
this.$router.push(`/course/limitChange`);
|
|
this.$router.push(`/course/limitChange`);
|
|
},
|
|
},
|
|
|
|
+ // 清楚本地存储/测试用
|
|
changeUSer() {
|
|
changeUSer() {
|
|
localStorage.clear();
|
|
localStorage.clear();
|
|
this.getUerInfo(this.wxId);
|
|
this.getUerInfo(this.wxId);
|
|
},
|
|
},
|
|
|
|
+ // 获取指定用户信息/测试用
|
|
getUerInfo(wxid) {
|
|
getUerInfo(wxid) {
|
|
getWxApiToken(wxid).then(token => {
|
|
getWxApiToken(wxid).then(token => {
|
|
getUSerInfo(token).then(res => {
|
|
getUSerInfo(token).then(res => {
|
|
this.user_info = JSON.parse(localStorage.getItem("wx_user_info"));
|
|
this.user_info = JSON.parse(localStorage.getItem("wx_user_info"));
|
|
- if (this.$route.query && this.$route.query.pid) {
|
|
|
|
- localStorage.setItem("pid", this.$route.query.pid);
|
|
|
|
- this.$router.push(`/courseLogin?pid=${this.$route.query.pid}`);
|
|
|
|
- } else{
|
|
|
|
- if (this.user_info.marketable) {
|
|
|
|
- getDealerCourseList();
|
|
|
|
- } else if (!this.user_info.marketable){
|
|
|
|
- this.tbsIndex = 1;
|
|
|
|
- }
|
|
|
|
- getUserCourseList();
|
|
|
|
|
|
+ if (this.user_info.marketable) {
|
|
|
|
+ getDealerCourseList();
|
|
|
|
+ } else if (!this.user_info.marketable){
|
|
|
|
+ this.tbsIndex = 1;
|
|
}
|
|
}
|
|
|
|
+ getUserCourseList();
|
|
});
|
|
});
|
|
});
|
|
});
|
|
},
|
|
},
|
|
//获取用户数据
|
|
//获取用户数据
|
|
init() {
|
|
init() {
|
|
- isWxEnv()
|
|
|
|
- .then(() => {
|
|
|
|
- if (getWxToken() && localStorage.getItem("wx_user_info")) {
|
|
|
|
- this.user_info = JSON.parse(localStorage.getItem("wx_user_info"));
|
|
|
|
- if (this.$route.query && this.$route.query.pid) {
|
|
|
|
- localStorage.setItem("pid", this.$route.query.pid);
|
|
|
|
- this.$router.push(`/courseLogin?pid=${this.$route.query.pid}`);
|
|
|
|
- } else{
|
|
|
|
- if (this.user_info.marketable) {
|
|
|
|
- this.getDealerCourseList();
|
|
|
|
- } else if (!this.user_info.marketable){
|
|
|
|
- this.tbsIndex = 1;
|
|
|
|
- }
|
|
|
|
- this.getUserCourseList();
|
|
|
|
- }
|
|
|
|
- } else {
|
|
|
|
- this.getUerInfo(this.wxId);
|
|
|
|
- }
|
|
|
|
- })
|
|
|
|
- .catch(err => {
|
|
|
|
- if (getWxToken() && localStorage.getItem("wx_user_info")) {
|
|
|
|
- this.user_info = JSON.parse(localStorage.getItem("wx_user_info"));
|
|
|
|
- if (this.$route.query && this.$route.query.pid) {
|
|
|
|
- localStorage.setItem("pid", this.$route.query.pid);
|
|
|
|
- this.$router.push(`/courseLogin?pid=${this.$route.query.pid}`);
|
|
|
|
- } else{
|
|
|
|
- if (this.user_info.marketable) {
|
|
|
|
- this.getDealerCourseList();
|
|
|
|
- } else if (!this.user_info.marketable){
|
|
|
|
- this.tbsIndex = 1;
|
|
|
|
- }
|
|
|
|
- this.getUserCourseList();
|
|
|
|
- }
|
|
|
|
- } else {
|
|
|
|
- this.getUerInfo(this.wxId);
|
|
|
|
- }
|
|
|
|
- });
|
|
|
|
|
|
+ this.user_info = JSON.parse(localStorage.getItem("wx_user_info"));
|
|
|
|
+ if (this.user_info.marketable) {
|
|
|
|
+ this.getDealerCourseList();
|
|
|
|
+ } else if (!this.user_info.marketable){
|
|
|
|
+ this.tbsIndex = 1;
|
|
|
|
+ }
|
|
|
|
+ this.getUserCourseList();
|
|
},
|
|
},
|
|
//获取经销推广课程列表
|
|
//获取经销推广课程列表
|
|
getDealerCourseList(done) {
|
|
getDealerCourseList(done) {
|
|
@@ -289,11 +257,9 @@ export default {
|
|
// 创建二维码
|
|
// 创建二维码
|
|
creatQrCode() {
|
|
creatQrCode() {
|
|
if (!this.qrcodeStatus) {
|
|
if (!this.qrcodeStatus) {
|
|
- console.log(
|
|
|
|
- `http://192.168.0.102:8088/#/courseHome?pid=${
|
|
|
|
|
|
+ console.log(`${window.location.href.split("#")[0]}#/courseHome?pid=${
|
|
JSON.parse(localStorage.getItem("wx_user_info")).id
|
|
JSON.parse(localStorage.getItem("wx_user_info")).id
|
|
- }`
|
|
|
|
- );
|
|
|
|
|
|
+ }`);
|
|
this.qrcode = new QRCode(this.$refs.qrCodeUrl, {
|
|
this.qrcode = new QRCode(this.$refs.qrCodeUrl, {
|
|
text: `${window.location.href.split("#")[0]}#/courseHome?pid=${
|
|
text: `${window.location.href.split("#")[0]}#/courseHome?pid=${
|
|
JSON.parse(localStorage.getItem("wx_user_info")).id
|
|
JSON.parse(localStorage.getItem("wx_user_info")).id
|
|
@@ -331,11 +297,6 @@ export default {
|
|
path: url
|
|
path: url
|
|
});
|
|
});
|
|
},
|
|
},
|
|
- // 下拉刷新
|
|
|
|
- refresh(done) {
|
|
|
|
- this.getDealerCourseList(done);
|
|
|
|
- this.getUserCourseList(done);
|
|
|
|
- }
|
|
|
|
}
|
|
}
|
|
};
|
|
};
|
|
</script>
|
|
</script>
|
|
@@ -477,7 +438,7 @@ img {
|
|
align-items: center;
|
|
align-items: center;
|
|
height: 100vh;
|
|
height: 100vh;
|
|
.qrContent{
|
|
.qrContent{
|
|
- width: 65%;
|
|
|
|
|
|
+ width: 70%;
|
|
border-radius: 0.2rem;
|
|
border-radius: 0.2rem;
|
|
overflow: hidden;
|
|
overflow: hidden;
|
|
.tit{
|
|
.tit{
|