Browse Source

Merge branch 'guoqiang' into test

test
zhaoguoqiang 3 years ago
parent
commit
c8d3efa677
  1. 5
      .env.online
  2. 2
      package.json
  3. 5
      src/api/data.js
  4. 19
      src/views/dataOverview/index.vue
  5. 27
      src/views/login.vue
  6. 47
      src/views/teamList/index.vue
  7. 22
      src/views/teamPerformance/index.vue

5
.env.online

@ -1,3 +1,4 @@
NODE_ENV=production
NODE_ENV=online
BUILD_ENV=online
VUE_APP_ENV=online
VUE_APP_ENV=online
VUE_APP_BASE_URL="http://test.qingweilai888.xyz"

2
package.json

@ -3,7 +3,7 @@
"version": "0.1.0",
"private": true,
"scripts": {
"serve": "vue-cli-service serve --mode development",
"serve": "vue-cli-service serve --mode online",
"build:dev": "vue-cli-service build --mode development",
"build:pro": "vue-cli-service build --mode production",
"lint": "vue-cli-service lint"

5
src/api/data.js

@ -19,6 +19,11 @@ class data{
async poxyList(param){
return await get("/admin/DataReport/ShopDataReport/poxyList",param)
}
async overviewByUserId(param){
return await get("/admin/DataReport/ShopDataReport/overviewByUserId",param)
}
}
export default new data()

19
src/views/dataOverview/index.vue

@ -110,7 +110,7 @@
<div class="moneyRanking">
<div class="title">本月团队业绩排名TOP</div>
<div class="list">
<div class="item" @click="toTeamPerformance" v-for="(item,index) of list.month_money_top" :key="index">
<div class="item" @click="toTeamPerformance(item.id)" v-for="(item,index) of list.month_money_top" :key="index">
<div class="rankNum">
<p>{{index+1}}</p>
</div>
@ -155,18 +155,17 @@
path: '/teamList',
query: {
type: type,
level_id: id,
level_id: id
}
})
},
toTeamPerformance(){
// this.$router.push({
// path: '/teamPerformance',
// query: {
// // type: type,
// // level_id: id,
// }
// })
toTeamPerformance(id){
this.$router.push({
path: '/teamPerformance',
query: {
lid:id,
}
})
},
}
}

27
src/views/login.vue

@ -6,22 +6,25 @@
let url = this.$route.query;
let token;
let url_string = JSON.stringify(url);
if (url_string == "{}") {
this.$toast('请先登录')
} else {
token = url.token_type + " " + url.access_token;
if (process.env.NODE_ENV == "online") {
token =
"bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwOlwvXC90ZXN0LnFpbmd3ZWlsYWk4ODgueHl6XC9hZG1pblwvbG9naW4iLCJpYXQiOjE2Mjc0NjU1ODksImV4cCI6MTk4NzQ2NTU4OSwibmJmIjoxNjI3NDY1NTg5LCJqdGkiOiJ6clVHYnJCOXlPWkpRanRUIiwic3ViIjoxNjEsInBydiI6IjBiMzZjMGUwMjMyZGVlZTlkOTZhZDA0NGY3YWE2MjQ2YTUwYTU3ZmEifQ.aFc5fCUffmDN7zBRn-D13kx1LuLNG1Ej7vQOu4O2_AA"
this.$store.commit("user/setToken", token);
this.$router.push({
path: "/home",
});
path: "/home",
});
} else {
if (url_string == "{}") {
this.$toast('请先登录')
} else {
token = url.token_type + " " + url.access_token;
this.$store.commit("user/setToken", token);
this.$router.push({
path: "/home",
});
}
}
// token =
// "bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwOlwvXC90ZXN0LnFpbmd3ZWlsYWk4ODgueHl6XC9hZG1pblwvbG9naW4iLCJpYXQiOjE2Mjc0NjU1ODksImV4cCI6MTk4NzQ2NTU4OSwibmJmIjoxNjI3NDY1NTg5LCJqdGkiOiJ6clVHYnJCOXlPWkpRanRUIiwic3ViIjoxNjEsInBydiI6IjBiMzZjMGUwMjMyZGVlZTlkOTZhZDA0NGY3YWE2MjQ2YTUwYTU3ZmEifQ.aFc5fCUffmDN7zBRn-D13kx1LuLNG1Ej7vQOu4O2_AA"
// this.$store.commit("user/setToken", token);
// this.$router.push({
// path: "/home",
// });
},
};
</script>

47
src/views/teamList/index.vue

@ -14,8 +14,9 @@
</div>
<div class="teamInfo">
<div class="teamName">{{item.username}}</div>
<div class="teamMoney">7月打款业绩{{item.team_integral | capitalize}}</div>
<div class="teamNum">团队人数{{item.team_num}}</div>
<div class="teamNum" v-if="id"></div>
<div class="teamMoney">注册时间{{item.created_at |time}}</div>
<div class="teamNum" v-if="!id">团队人数{{item.team_num}}</div>
</div>
</div>
</van-list>
@ -30,7 +31,7 @@
import {
Tab,
Tabs,
Empty
Empty
} from 'vant';
export default {
data() {
@ -43,16 +44,20 @@
totalPage: 1,
},
error: false,
type:'',
level_id:'',
type: '',
level_id: '',
id: '',
}
},
filters: {
capitalize: function (val) {
return (+val || 0).toFixed(0).replace(/\d{1,3}(?=(\d{3})+(\.\d*)?$)/g, '$&,')
},
time: function (val) {
return val.substring(0, 10);
},
capitalize2: function (index) {
let key = Number(index-1)
let key = Number(index - 1)
const statusList = [
"vip",
"总代",
@ -64,6 +69,10 @@
}
},
created() {
if (this.$route.query.id) {
console.log(`2222222222222222`);
this.id = this.$route.query.id
}
this.getList()
},
methods: {
@ -71,9 +80,16 @@
const res = await data.poxyList({
type: this.$route.query.type,
level_id: this.$route.query.level_id,
page:++this.list.curPage,
user_id: this.id,
page: ++this.list.curPage,
})
const information = res.data.data
let information
if (this.$route.query.id) {
information = res.data
} else {
information = res.data.data
}
console.log(information, '222');
if (JSON.stringify(information.data) != '[]') {
this.list.data.push(...information.data);
this.list.totalPage = information.last_page;
@ -90,9 +106,6 @@
this.list.finished = true;
});
}
},
addList() {
},
onLoad() {
var _this = this;
@ -112,18 +125,20 @@
min-height: 100vh;
background: RGBA(63, 66, 88, 1);
position: relative;
.empty{
.empty {
position: absolute;
top: 20%;
left:50%;
left: 50%;
transform: translateX(-50%);
}
.moneyRanking {
min-height: 100vh;
background: RGBA(63, 66, 88, 1);
padding: 0 70px;
padding-top: 50px;
.title {
font-size: 40px;
@ -189,8 +204,8 @@
}
.teamMoney {
height: 26px;
line-height: 26px;
// height: 26px;
// line-height: 26px;
font-size: 26px;
font-weight: 400;
color: #FFFFFF;

22
src/views/teamPerformance/index.vue

@ -134,6 +134,7 @@
data() {
return {
list: {},
id:'',
}
},
filters: {
@ -142,22 +143,27 @@
},
},
created() {
this.id = this.$route.query.lid
console.log(this.id,'-----------------');
this.getData()
},
methods: {
async getData() {
const res = await data.overview();
const res = await data.overviewByUserId({
user_id:this.id,
});
this.list = res.data
console.log(this.list, '---this.list');
},
toTeamList(type, id) {
// this.$router.push({
// path: '/teamList',
// query: {
// type: type,
// level_id: id,
// }
// })
this.$router.push({
path: '/teamList',
query: {
type: type,
level_id: id,
id:this.id,
}
})
},
}
}

Loading…
Cancel
Save