邓雄飞 4 years ago
parent
commit
0106b943e7
6 changed files with 60 additions and 45 deletions
  1. 62
      components/scroll-list/scroll-list.vue
  2. 1
      pages.json
  3. 2
      pages/notification-page/index.vue
  4. 15
      pages/paper-details/index.vue
  5. 23
      pages/store/index.vue
  6. 2
      utils/http/index.js

62
components/scroll-list/scroll-list.vue

@ -24,11 +24,12 @@
</view>
</view>
<view class="empty-wrap" v-if="showEmpty">
<slot name="empty" v-if="$slots.empty"></slot>
<view class="empty-view" v-else>
<image class="empty-image" :src="defaultOption.emptyImage || images.empty" mode="aspectFit"></image>
<text class="empty-text" :style="[emptyTextStyle]">{{ emptyText }}</text>
</view>
<slot name="empty">
<view class="empty-view flex-col-center-center">
<image class="empty-image" :src="defaultOption.emptyImage || images.empty" mode="aspectFit"></image>
<text class="empty-text" :style="[emptyTextStyle]">{{ emptyText }}</text>
</view>
</slot>
</view>
<view class="list-content"><slot></slot></view>
<view class="pull-up-wrap" v-if="showPullUp">
@ -614,31 +615,7 @@ export default {
}
}
}
.empty-wrap {
top: 0;
left: 0;
width: 100%;
height: 100%;
display: flex;
position: absolute;
align-items: center;
flex-direction: column;
.empty-view {
margin: auto;
display: flex;
align-items: center;
margin-bottom: 400rpx;
flex-direction: column;
.empty-image {
width: 600rpx;
height: 600rpx;
}
.empty-text {
color: #606266;
margin-top: 20rpx;
}
}
}
.list-content {
}
.pull-up-wrap {
@ -666,4 +643,29 @@ export default {
}
}
}
.empty-wrap {
top: 0;
left: 0;
width: 100%;
height: 100%;
display: flex;
position: absolute;
align-items: center;
flex-direction: column;
.empty-view {
margin: auto;
display: flex;
align-items: center;
margin-bottom: 400rpx;
flex-direction: column;
.empty-image {
width: 600rpx;
height: 600rpx;
}
.empty-text {
color: #606266;
margin-top: 20rpx;
}
}
}
</style>

1
pages.json

@ -111,6 +111,7 @@
"path": "pages/paper-details/index",
"style": {
"navigationBarTitleText": "纸品详情",
"navigationStyle": "custom",
"enablePullDownRefresh": false
}
},

2
pages/notification-page/index.vue

@ -36,7 +36,7 @@ export default {
// 退
this.backInfo.isBack = true
this.backInfo.isBackTo = 'order-list'
go2('order-detail', { orderId: orderId })
go2('order-detail', { orderId: orderId }, true)
} else {
this.handleResultError({ fn: this.certifySign, data: orderId, errType: '订单合同签约' })
}

15
pages/paper-details/index.vue

@ -1,5 +1,6 @@
<template>
<view class="warpper">
<view class="wrapper">
<uni-nav-bar left-icon="back" @clickLeft="back" statusBar fixed title="纸品详情"></uni-nav-bar>
<view class="swiper-dot">
<uni-swiper-dot :info="info.imgList" :current="current" field="content" mode="indexes" style="height: 100%">
<swiper class="swiper-box" @change="swiperChange" style="height: 100%">
@ -141,7 +142,7 @@
import uGap from '@/components/u-gap/u-gap.vue'
import qnFooter from '@/components/qn-footer/qn-footer.vue'
import qnInputNumber from '@/components/qn-input-number/qn-input-number.vue'
import { go2 } from '@/utils/hook.js'
import { go2, back } from '@/utils/hook.js'
import { getPaperDetail, createGoodsReserve, createShoppingCar } from '@/apis/paperDetailsApi.js'
import { round } from '@/utils/index.js'
export default {
@ -214,11 +215,17 @@ export default {
computed: {
buyTon() {
let num = 0
num = round(this.buyPaperDto.gramWeight * this.buyPaperDto.width * this.buyPaperDto.length * this.buyPaperDto.pieceQuantity * 1e-12, 4)
num = round(this.buyPaperDto.gramWeight * this.buyPaperDto.width * this.buyPaperDto.length * this.buyPaperDto.pieceQuantity * 1e-12, 4)
return num
}
},
watch: {
buyTon(newVal) {
this.buyPaperDto.buyTon = newVal
}
},
methods: {
back,
//
queryData() {
getPaperDetail(this.params).then((res) => {
@ -346,7 +353,7 @@ export default {
</script>
<style lang="scss">
.warpper {
.wrapper {
.swiper-dot {
width: 100%;
height: 500rpx;

23
pages/store/index.vue

@ -26,7 +26,7 @@
type="text"
class="easyinput"
prefixIcon="search"
@confirm="searchConfirm"
@input="searchConfirm"
/>
</view>
<scroll-list ref="list" :option="option" @load="upCallback" @refresh="downCallback" style="background-color: #ffffff">
@ -93,12 +93,10 @@ export default {
supplierId: this.$store.state.supplierId || null
// supplierId: '677166944742412288'
},
customerInfo: {}
customerInfo: {},
timer: null
}
},
onLoad() {
this.getCustomer()
},
methods: {
seeDetailsTap(item) {
loginGo2('paper-details', { id: item.id })
@ -123,9 +121,10 @@ export default {
} else {
this.list = this.list.concat(res.records)
}
// this.list = []
// this.list = [...this.list, ...[1, 2, 3, 4, 5, 6, 7, 8, 9, 10]]
resolve({ list: this.list, total: res.total })
} else {
reject()
}
})
.catch((err) => {
@ -155,8 +154,13 @@ export default {
},
searchConfirm(value) {
this.params.name = value
this.pagination.pageNum = 1
this.getList()
if (this.timer) {
clearTimeout(this.timer)
this.timer = null
}
this.timer = setTimeout(() => {
this.downCallback()
}, 500)
},
transformPrice(value) {
if (this.hasLogin) {
@ -168,6 +172,7 @@ export default {
},
onShow() {
this.downCallback()
this.getCustomer()
},
computed: {
hasLogin() {
@ -357,7 +362,7 @@ export default {
height: 48rpx;
background: #ff4849;
border-radius: 27rpx;
ont-size: 26rpx;
font-size: 26rpx;
color: #ffffff;
letter-spacing: 0;
font-weight: 400;

2
utils/http/index.js

@ -92,7 +92,7 @@ const resInterceptor = (response, options) => {
if (statusCode >= 200 && statusCode < 300) {
if (res.code == 0) {
// 将成功的null置位1
return res.data || 1
return res.data === null ? 1 : res.data
} else {
uni.showToast({
title: res.message,

Loading…
Cancel
Save