团队id等

master
yujialong 2 years ago
parent 2be807f0ee
commit c5b618e5ae
  1. 4
      App.vue
  2. 4
      config/request.js
  3. 8
      order/orders/orders.vue
  4. 8
      pages/clients/clients.vue
  5. 22
      pages/index/index.vue
  6. 2
      pages/products/products.vue
  7. 8
      pages/teams/teams.vue

@ -1,7 +1,9 @@
<script>
export default {
onLaunch: function() {
uni.setEnableDebug({
enableDebug: true
})
},
onShow: function() {
console.log('App Launch');

@ -5,7 +5,9 @@
*/
export default {
baseURL: 'https://huorantech.cn/',
// baseURL: 'https://huorantech.cn/',
// baseURL: 'http://192.168.31.137:9000/',
baseURL: 'http://121.37.12.51/',
headers: {
'Content-Type': 'application/json;charset=UTF-8'
},

@ -182,7 +182,11 @@
orderStatus: this.orderStatus,
type: this.curTab
}
uni.showLoading({
title: '加载中'
})
list(data).then(({ data }) => {
uni.hideLoading()
// list
const list = data.records
list.map(e => {
@ -193,7 +197,9 @@
const noMore = this.list.length === data.total //
this.status = noMore ? 'noMore' : 'more' // noMore
this.reachBottom = noMore ? -1 : 0 // -1
}).catch(e => {})
}).catch(e => {
uni.hideLoading()
})
},
initList() {
this.page = 1

@ -149,14 +149,20 @@
pageSize: this.pageSize,
type: this.curTab // 团队:1 / 个人:0
}
uni.showLoading({
title: '加载中'
})
all(data).then(({ data }) => {
uni.hideLoading()
// list
this.list = this.reachBottom > 0 ? [...this.list, ...data.records] : data.records
this.page++ // page+1
const noMore = this.list.length === data.total //
this.status = noMore ? 'noMore' : 'more' // noMore
this.reachBottom = noMore ? -1 : 0 // -1
}).catch(e => {})
}).catch(e => {
uni.hideLoading()
})
},
initList() {
this.page = 1

@ -110,7 +110,8 @@
data() {
return {
per: true, //
teamId: uni.getStorageSync('team').teamId || '',
// teamId: uni.getStorageSync('team').teamId || '',
teamId: '',
list: [],
id: '',
teamList: []
@ -133,6 +134,7 @@
teamId: this.teamId,
platformId: 4
}).then(({ permissionMenu }) => {
uni.hideLoading()
const auth = []
const generateAuth = (list, parent) => {
list.map(e => {
@ -146,28 +148,36 @@
this.$forceUpdate()
this.initRole()
}).catch(e => {
uni.hideLoading()
uni.setStorageSync('auth', [])
this.initRole()
})
},
//
getInfo() {
uni.showLoading({
title: '加载中'
})
getTeamsByAccountId().then(({ data }) => {
data.map(e => {
const n = e.partnerClassificationList
e.id = n.id
e.teamId = e.partnerClassificationId
e.teamId = n.isTeam == 1 ? e.partnerClassificationId : n.id
e.partnerClassificationName = n.partnerClassificationName
delete e.partnerClassificationList
})
if (data.length) {
//
if (!this.teamId) {
/**
* @description 如果是第一次进则默认选中第一个团队并把该团队的信息存入缓存
* 或者团队列表里没有该id则说明超管已经被转让也需要重新选中团队
*/
if (!this.teamId || !data.find(e => e.teamId == this.teamId)) {
this.teamId = data[0].teamId
uni.setStorageSync('team', data[0])
}
} else {
// 退
uni.hideLoading()
uni.clearStorageSync()
uni.navigateTo({
url: '../login/login'
@ -176,7 +186,9 @@
this.list = data
this.getAuth()
}).catch(e => {})
}).catch(e => {
uni.hideLoading()
})
},
//
teamChange() {

@ -12,7 +12,7 @@
<ul class="list">
<li v-for="item in list">
<view class="pro-name">
<image v-if="item.miniProgramPictureAddress" class="icon" :src="item.miniProgramPictureAddress" mode="widthFix"></image>
<image class="icon" :src="$util.getIcon(item)" mode="widthFix"></image>
{{ item.productName }}
</view>
<view class="info">

@ -84,6 +84,9 @@
},
//
getList() {
uni.showLoading({
title: '加载中'
})
teamList({
type: 1,
pageNum: this.page,
@ -91,6 +94,7 @@
keyWord: this.keyword,
partnerClassificationId: uni.getStorageSync('team').teamId
}).then(({ pageList }) => {
uni.hideLoading()
const { records } = pageList
// list
this.list = this.reachBottom > 0 ? [...this.list, ...records] : records
@ -98,7 +102,9 @@
const noMore = this.list.length === pageList.total //
this.status = noMore ? 'noMore' : 'more' // noMore
this.reachBottom = noMore ? -1 : 0 // -1
}).catch(e => {})
}).catch(e => {
uni.hideLoading()
})
},
initList() {
this.page = 1

Loading…
Cancel
Save