添加loading等

master
yujialong 2 years ago
parent c5b618e5ae
commit d71cd65494
  1. 4
      apis/modules/order.js
  2. 3
      apis/request.js
  3. 4
      config/request.js
  4. 8
      order/addCourse/addCourse.vue
  5. 74
      order/curClient/curClient.vue
  6. 8
      order/orderDetail/orderDetail.vue
  7. 8
      order/ordered/ordered.vue
  8. 1
      order/orders/orders.vue
  9. 8
      pages/clientDetail/clientDetail.vue
  10. 5
      pages/index/index.vue

@ -32,3 +32,7 @@ export const orderList = (data) => {
export const del = (data) => {
return post('nakadai/nakadai/order/delete', data)
}
export const miniProgramOrderRecord = (data) => {
return post('nakadai/nakadai/applets/order/miniProgramOrderRecord', data)
}

@ -14,11 +14,12 @@ const request = options => {
const header = Object.assign({}, config.headers, {
token: uni.getStorageSync('token')
})
const otherUrl = ['generateInvitationCode', 'weChatAppletCallback', 'userBinding', 'getUserRolesPermissionMenu']
const otherUrl = ['getTeamsByAccountId']
return new Promise((resolve, reject)=>{
const { url } = options
uni.request({
header,
// url: (otherUrl.map(e => config.baseURL.includes(e)) ? 'http://192.168.31.137:9000/' : config.baseURL) + url,
url: config.baseURL + url,
method: options.method || 'GET', // 请求类型,默认为GET
data: options.data || {}, // 请求参数,默认空对象

@ -1,12 +1,12 @@
/**
/**
* axios 配置文件
* 请求配置文件
* @author yujialong
*/
export default {
// baseURL: 'https://huorantech.cn/',
// baseURL: 'http://192.168.31.137:9000/',
// baseURL: 'http://192.168.31.151:9000/',
baseURL: 'http://121.37.12.51/',
headers: {
'Content-Type': 'application/json;charset=UTF-8'

@ -110,6 +110,9 @@
methods: {
//
getList() {
uni.showLoading({
title: '加载中'
})
AppletsDataProductList({
sort: 'desc',
keywords: this.keyword,
@ -144,7 +147,10 @@
const noMore = this.list.length === data.total //
this.status = noMore ? 'noMore' : 'more' // noMore
this.reachBottom = noMore ? -1 : 0 // -1
}).catch(e => {})
uni.hideLoading()
}).catch(e => {
uni.hideLoading()
})
},
initList() {
this.page = 1

@ -33,8 +33,8 @@
<view class="line">
<text class="name">订单内容</text>
<view class="val ell-wrap">
<view :class="{ell: !item.toggle}">{{ item.orderContent }}</view>
<view v-if="item.orderContent.length > 14" class="toggle" @click.stop="toggle(item)">{{ item.toggle ? '收起' : '展开' }}</view>
<view :class="{ell: !item.toggle}">{{ item.productName }}</view>
<view v-if="item.productName.length > 14" class="toggle" @click.stop="toggle(item)">{{ item.toggle ? '收起' : '展开' }}</view>
</view>
</view>
<view class="line">
@ -50,6 +50,7 @@
</uni-swipe-action-item>
</uni-swipe-action>
</view>
<uni-load-more :status="status" />
</template>
<empty v-else></empty>
@ -59,7 +60,7 @@
</template>
<script>
import { orderList, del } from '@/apis/modules/order.js'
import { miniProgramOrderRecord, del } from '@/apis/modules/order.js'
export default {
data() {
return {
@ -86,13 +87,13 @@
],
}
],
reachBottom: 0, // 0->,1->,-1->
status: 'more', // more|loading|noMore
filterForm: {},
isFilter: 0, // 0->,1->
searchTimer: null,
orderStatus: '',
keyword: '',
list: [],
listAll: [],
page: 1,
pageSize: 10,
delOption: [{
@ -107,10 +108,18 @@
keyword () {
clearTimeout(this.searchTimer)
this.searchTimer = setTimeout(() => {
this.filter()
this.initList()
}, 500)
}
},
//
onReachBottom() {
if (this.reachBottom >= 0) {
this.reachBottom = 1
this.status = 'loading'
this.getList()
}
},
//
onPullDownRefresh() {
this.getList()
@ -123,23 +132,42 @@
const { options } = pages[pages.length - 1]
this.customerId = options.customerId
this.customerName = options.name
this.getList()
// this.initList()
},
methods: {
getList() {
orderList({
cityId: '',
customerName: this.customerName,
uni.showLoading({
title: '加载中'
})
const team = uni.getStorageSync('team')
miniProgramOrderRecord({
businessManagerId: this.$util.getBmId(),
teamId: team.id,
customerId: this.customerId,
orderStatus: this.orderStatus,
orderType: '',
pageNo: 1,
pageSize: 10000,
provinceId: ''
}).then(({ orderPage }) => {
const { orders } = orderPage
this.list = orders
this.listAll = orders
}).catch(e => {})
isAdmin: +team.isTeam, // (0 1)
pageNum: this.page,
pageSize: this.pageSize,
keywords: this.keyword
}).then(({ data }) => {
const { records } = data
records.map(e => {
e.toggle = e.productName.length < 14 // 14
})
this.list = this.reachBottom > 0 ? [...this.list, ...records] : records
this.page++ // page+1
const noMore = this.list.length === data.total //
this.status = noMore ? 'noMore' : 'more' // noMore
this.reachBottom = noMore ? -1 : 0 // -1
uni.hideLoading()
}).catch(e => {
uni.hideLoading()
})
},
initList() {
this.page = 1
this.reachBottom = 0
this.getList()
},
//
toggle(item) {
@ -149,13 +177,7 @@
subFinsh(val) {
const { orderStatus } = val
this.orderStatus = orderStatus.length ? orderStatus[0] : ''
this.getList()
},
//
filter() {
const list = this.listAll
const { keyword } = this
this.list = list.filter(e => e.orderNumber.includes(keyword) || e.orderContent.includes(keyword))
this.initList()
},
//
toDetail(item) {

@ -238,6 +238,9 @@
methods: {
//
getInfo() {
uni.showLoading({
title: '加载中'
})
getDetail({
orderId: this.orderId
}).then(({ orderDetails }) => {
@ -247,7 +250,10 @@
this.courses = order.orderOther
this.handleProduct(order.orderOther)
this.calcTotal()
}).catch(e => {})
uni.hideLoading()
}).catch(e => {
uni.hideLoading()
})
},
//
handleProduct(list) {

@ -134,6 +134,9 @@
},
methods: {
getList() {
uni.showLoading({
title: '加载中'
})
getProductsSubscribedByCustomers({
customeId: this.customerId
}).then(({ data }) => {
@ -193,7 +196,10 @@
})
this.list = data
this.listAll = data
}).catch(e => {})
uni.hideLoading()
}).catch(e => {
uni.hideLoading()
})
},
//
subFinsh(val) {

@ -103,7 +103,6 @@
}
],
reachBottom: 0, // 0->,1->,-1->
isFilter: 0, // 0->,1->
status: 'more', // more|loading|noMore
searchTimer: null,
orderStatus: '',

@ -183,6 +183,9 @@
methods: {
//
getInfo() {
uni.showLoading({
title: '加载中'
})
queryCustomerDetails({
customerId: this.customerId
}).then(({ result }) => {
@ -190,7 +193,10 @@
this.form = customer
!this.isDetail && customer.industryClassId && this.getIndustry()
this.customerType = this.customerTypeList.find(e => e.value === customer.customerType).name
}).catch(e => {})
uni.hideLoading()
}).catch(e => {
uni.hideLoading()
})
},
//
getSchool() {

@ -131,11 +131,12 @@
//
getAuth() {
uni.getStorageSync('token') && getUserRolesPermissionMenu({
teamId: this.teamId,
teamId: this.list.find(e => e.teamId === this.teamId).partnerClassificationId,
platformId: 4
}).then(({ permissionMenu }) => {
uni.hideLoading()
const auth = []
//
const generateAuth = (list, parent) => {
list.map(e => {
const name = `${parent ? parent + ':' : ''}${e.name}`
@ -162,7 +163,7 @@
data.map(e => {
const n = e.partnerClassificationList
e.id = n.id
e.teamId = n.isTeam == 1 ? e.partnerClassificationId : n.id
e.teamId = e.isTeam == 1 ? e.partnerClassificationId : n.id
e.partnerClassificationName = n.partnerClassificationName
delete e.partnerClassificationList
})

Loading…
Cancel
Save