1 Star 0 Fork 0

Laughing/柒星社区

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
mine.html 8.31 KB
一键复制 编辑 原始数据 按行查看 历史
Laughing 提交于 2021-05-06 21:25 . 文件夹重命名
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1.0,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no">
<link rel="stylesheet/less" href="./less/reset.less">
<link rel="stylesheet/less" href="./less/mine.less">
<script src="https://cdn.bootcdn.net/ajax/libs/less.js/4.1.1/less.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
<script src="https://unpkg.com/axios/dist/axios.min.js"></script>
<script src="https://cdn.bootcdn.net/ajax/libs/qs/6.9.6/qs.js"></script>
<script src="http://res2.wx.qq.com/open/js/jweixin-1.6.0.js"></script>
<title></title>
</head>
<body>
<div id="app">
<div class="main">
<div class="login-top">
<header class="title">
<ul>
<li @click="goRegister">
<ul>
<li>
<img :src="userIcon">
</li>
<li>{{userName}}</li>
</ul>
</li>
<li @click="businessCard">
<img src="./img/code.png">
</li>
</ul>
<ul v-show="messageStatus">
<li v-for="(item,index) in identity">
<ul>
<li>{{item.name}}</li>
<li>{{index==1?inviteCode:marketpName+'/'+levelName}}</li>
</ul>
</li>
</ul>
</header>
</div>
<div class="bulk">
<div>我的团购</div>
<ul>
<li v-for="(item,index) in bulk" @click=" bulkGoods(index,item.name,item.type)">
<img :src="item.img">
<div>{{item.name}}</div>
</li>
</ul>
</div>
<div class="wallet">
<ul>
<li v-for="(item,index) in wallet" @click="groupJump(index)" v-if="item.status">
<img :src="item.img">
<div>{{item.name}}</div>
</li>
</ul>
</div>
<a href="./index.html">返回首页</a>
</div>
</div>
</body>
</html>
<script type="module">
import { myLevel } from './js/request/api.js';
import { shareLink } from './js/public.js';
Vue.prototype.public = {shareLink};
let app = new Vue({
el: '#app',
data: {
userIcon: '',
userName: '',
messageStatus: false,
inviteCode: '',
userId: '',
levelName: '',
marketpName: '',
identity:[
{
name: '身份级别',
rank: '团长/粉丝'
},
{
name: '邀请码',
rank: 'SJSHRN'
}
],
bulk:[
{
img: './img/team.png',
name: '我的团'
},
{
img: './img/spelling.png',
name: '拼购中',
type: 1
},
{
img: './img/notSpell.png',
name: '拼成功',
type: 2
},
{
img: './img/auditFailure.png',
name: '拼失败',
type: 3
}
],
wallet:[
{
img: './img/wallet.png',
name: '我的钱包',
status: true
},
{
img: './img/earnings.png',
name: '我的收益',
status: true
},
{
img: './img/address.png',
name: '收货地址',
status: true
},
{
img: './img/payment.png',
name: '设置密码',
status: true
},
{
img: './img/loginOut.png',
name: '退出登录',
status: true
},
]
},
mounted(){
let that = this;
that.userMessage();
that.public.shareLink();
},
methods:{
bulkGoods(index,name,type){
let userData = JSON.parse(localStorage.getItem("userData"));
if(userData == null){
let url = './login.html';
window.location.href = url;
return false;
}
if(index == 0){
let url = "./team.html";
window.location.href = url;
}else{
let url = "./orderDetails.html?name="+name+"&type="+type;
window.location.href = url;
}
},
userMessage(){
let that = this;
let userData = JSON.parse(localStorage.getItem("userData"));
if(userData == null){
that.userIcon = './img/photo.png';
that.userName = '登录/注册';
that.wallet[3].status = false;
that.wallet[4].status = false;
return false;
}
that.messageStatus = true;
that.userIcon = userData.userIcon;
that.userName = userData.userName;
that.inviteCode = userData.inviteCode;
that.userId = userData.userId;
myLevel({
userId: that.userId
}).then((res)=>{
that.levelName = res.data.levelName;
that.marketpName = res.data.marketpName;
}).catch((error)=>{
console.log(error);
})
},
groupJump(index){
let userData = JSON.parse(localStorage.getItem("userData"));
if(userData == null){
let url = './login.html';
window.location.href = url;
return false;
}
if(index==0){
let url = './myWallet.html';
window.location.href = url;
}else if(index == 1){
let url = './earnings.html';
window.location.href = url;
}else if(index == 2){
let url = './addressManagement.html?type='+1;
window.location.href = url;
}else if(index == 3){
let url = './setPassword.html';
window.location.href = url;
}else if(index == 4){
let url = './login.html';
window.location.href = url;
localStorage.clear();
}
},
businessCard(){
let userData = JSON.parse(localStorage.getItem("userData"));
let url;
if(userData == null){
url = './login.html';
window.location.href = url;
return false;
}
url = './businessCard.html';
window.location.href = url;
},
goRegister(){
let that = this;
let userData = JSON.parse(localStorage.getItem("userData"));
let url;
if(userData == null){
url = './login.html';
window.location.href = url;
return false;
}
},
},
})
</script>
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/DarkerTao/qixing-community.git
git@gitee.com:DarkerTao/qixing-community.git
DarkerTao
qixing-community
柒星社区
master

搜索帮助

0d507c66 1850385 C8b1a773 1850385