Browse Source

bug fixed

devlop
邓雄飞 4 years ago
parent
commit
df26fc4bc3
6 changed files with 210 additions and 239 deletions
  1. 2
      common/css/reset.scss
  2. 364
      pages/message/system-message.vue
  3. 3
      pages/mine/index.vue
  4. 4
      pages/order-detail/index.vue
  5. 74
      pages/trade/quotationList.vue
  6. 2
      store/index.js

2
common/css/reset.scss

@ -91,7 +91,7 @@ cover-view {
white-space: normal;
}
::webkit-scrollbar {
*::webkit-scrollbar {
display: none;
}

364
pages/message/system-message.vue

@ -1,195 +1,195 @@
<template>
<view class="system-message">
<scroll-list ref="messageRef" :option="option" @load="quotationUp" @refresh="quotationDown">
<view v-for="(item, index) in list" :key="index">
<view class="system-message-main">
<view class="system-message-main-top">
<view class="system-message-title">
<view class="">{{ item.messageType | meesageTypeFilter }}</view>
<view class="dian" v-if="item.readOrNot === 0"></view>
</view>
<view class="system-message-subtitle">{{ item.createTime }}</view>
</view>
<view class="system-message-contant">{{ item.content }}</view>
</view>
</view>
</scroll-list>
</view>
<view class="system-message">
<scroll-list ref="messageRef" :option="option" @load="quotationUp" @refresh="quotationDown">
<view v-for="(item, index) in list" :key="index">
<view class="system-message-main">
<view class="system-message-main-top">
<view class="system-message-title">
<view class="">{{ item.messageType | meesageTypeFilter }}</view>
<view class="dian" v-if="item.readOrNot === 0"></view>
</view>
<view class="system-message-subtitle">{{ item.createTime }}</view>
</view>
<view class="system-message-contant">{{ item.content }}</view>
</view>
</view>
</scroll-list>
</view>
</template>
<script>
import { systemMessageList, systemRead } from '@/apis/trade'
export default {
data() {
return {
option: {
size: 10,
auto: true,
emptyText: '暂无消息~',
background: '#F7F8FA',
fontSize: '40rpx'
},
pagination: {
pageNum: 0, //
pageSize: 10
},
list: []
}
},
filters: {
meesageTypeFilter(value) {
var mes = ''
if (value) {
switch (value) {
case 1:
mes = '客户下单'
break
case 2:
mes = '客户付款'
break
case 3:
mes = '客户收货'
break
case 4:
mes = '客户询价'
break
case 4:
mes = '取消订单'
bre
default:
break
}
}
return mes
// 1- 2- 3- 4- 5-
}
},
onLoad(option) {
this.queryData()
},
methods: {
queryData() {
return new Promise((resolve, reject) => {
systemMessageList({ ...this.pagination })
.then(res => {
if (res) {
var data = res.records
var count = 0
for (let i = 0; i < data.length; i++) {
if (data[i].readOrNot === 0) {
count = count + 1
}
}
this.$emit('systemCount', count)
if (this.pagination.pageNum === 0) {
this.list = res.records
} else {
this.list = this.list.concat(res.records)
}
resolve({ list: this.list, total: res.total })
} else {
reject()
}
})
.catch(err => {
reject(err)
})
})
},
//
quotationUp(page) {
this.pagination.pageNum++
this.queryData()
.then(({ list, total }) => {
this.$refs.messageRef.refreshSuccess({ list, total })
})
.catch(() => {
this.$refs.messageRef.loadFail()
})
},
//
quotationDown() {
this.pagination.pageNum = 0
this.queryData()
.then(({ list, total }) => {
this.$refs.messageRef.refreshSuccess({ list, total })
})
.catch(() => {
this.$refs.messageRef.refreshFail()
})
},
allread() {
return new Promise((resolve, reject) => {
var meesage = this.list.map(item => {
return item.id
})
var params = {
messageIds:meesage
}
systemRead(params)
.then(res => {
if (res) {
uni.showToast({
title: '操作成功',
icon: 'success'
})
this.pagination.pageNum = 0
this.queryData()
this.$emit('systemCount', 0)
} else {
reject()
}
})
.catch(err => {
reject(err)
})
})
}
}
data() {
return {
option: {
size: 10,
auto: true,
emptyText: '暂无消息~',
background: '#F7F8FA',
fontSize: '40rpx'
},
pagination: {
pageNum: 0, //
pageSize: 10
},
list: []
}
},
filters: {
meesageTypeFilter(value) {
var mes = ''
if (value) {
switch (value) {
case 1:
mes = '客户下单'
break
case 2:
mes = '客户付款'
break
case 3:
mes = '客户收货'
break
case 4:
mes = '客户询价'
break
case 4:
mes = '取消订单'
break
default:
break
}
}
return mes
// 1- 2- 3- 4- 5-
}
},
onLoad(option) {
this.queryData()
},
methods: {
queryData() {
return new Promise((resolve, reject) => {
systemMessageList({ ...this.pagination })
.then((res) => {
if (res) {
var data = res.records
var count = 0
for (let i = 0; i < data.length; i++) {
if (data[i].readOrNot === 0) {
count = count + 1
}
}
this.$emit('systemCount', count)
if (this.pagination.pageNum === 0) {
this.list = res.records
} else {
this.list = this.list.concat(res.records)
}
resolve({ list: this.list, total: res.total })
} else {
reject()
}
})
.catch((err) => {
reject(err)
})
})
},
//
quotationUp(page) {
this.pagination.pageNum++
this.queryData()
.then(({ list, total }) => {
this.$refs.messageRef.refreshSuccess({ list, total })
})
.catch(() => {
this.$refs.messageRef.loadFail()
})
},
//
quotationDown() {
this.pagination.pageNum = 0
this.queryData()
.then(({ list, total }) => {
this.$refs.messageRef.refreshSuccess({ list, total })
})
.catch(() => {
this.$refs.messageRef.refreshFail()
})
},
allread() {
return new Promise((resolve, reject) => {
var meesage = this.list.map((item) => {
return item.id
})
var params = {
messageIds: meesage
}
systemRead(params)
.then((res) => {
if (res) {
uni.showToast({
title: '操作成功',
icon: 'success'
})
this.pagination.pageNum = 0
this.queryData()
this.$emit('systemCount', 0)
} else {
reject()
}
})
.catch((err) => {
reject(err)
})
})
}
}
}
</script>
<style lang="scss">
.system-message {
.system-message-main {
background-color: #ffffff;
margin: 20rpx 32rpx;
border-radius: 20rpx;
}
.system-message-main-top {
display: flex;
justify-content: space-between;
padding: 24rpx 32rpx;
}
.system-message-title {
font-size: 32rpx;
color: #333333;
letter-spacing: 0;
font-weight: 600;
display: flex;
}
.system-message-subtitle {
font-size: 24rpx;
color: #333333;
font-weight: 400;
}
.system-message-contant {
font-size: 28rpx;
color: #888888;
letter-spacing: 0;
font-weight: 400;
padding: 0rpx 32rpx;
line-height: 40rpx;
overflow: auto;
max-height: 100rpx;
height: 100rpx;
}
.dian {
background: #ff0000;
height: 14rpx;
width: 14rpx;
border-radius: 20rpx;
margin-left: 10rpx;
}
.system-message-main {
background-color: #ffffff;
margin: 20rpx 32rpx;
border-radius: 20rpx;
}
.system-message-main-top {
display: flex;
justify-content: space-between;
padding: 24rpx 32rpx;
}
.system-message-title {
font-size: 32rpx;
color: #333333;
letter-spacing: 0;
font-weight: 600;
display: flex;
}
.system-message-subtitle {
font-size: 24rpx;
color: #333333;
font-weight: 400;
}
.system-message-contant {
font-size: 28rpx;
color: #888888;
letter-spacing: 0;
font-weight: 400;
padding: 0rpx 32rpx;
line-height: 40rpx;
overflow: auto;
max-height: 100rpx;
height: 100rpx;
}
.dian {
background: #ff0000;
height: 14rpx;
width: 14rpx;
border-radius: 20rpx;
margin-left: 10rpx;
}
}
</style>

3
pages/mine/index.vue

@ -275,9 +275,6 @@ export default {
}
},
watch: {
tradeDate(val) {
console.log('val:', val)
},
'$store.state.supplierInfo.supplierId': {
handler(val) {
console.log('切换了供应商:', val)

4
pages/order-detail/index.vue

@ -396,7 +396,9 @@ export default {
go2('page-view', { title: '供应商订单签约', url: encodeURIComponent(res.signUrl), params: this.params })
// #endif
// #ifdef H5
window ? (window.location.href = res.signUrl) : ''
if (window) {
window.location.href = res.signUrl
}
// #endif
}
}

74
pages/trade/quotationList.vue

@ -1,50 +1,30 @@
<template>
<view class="quotation-list">
<scroll-list
ref="quotationRef"
:option="option"
@load="quotationUp"
@refresh="quotationDown"
>
<view
v-for="(item, index) in list"
:key="index"
style="margin-bottom: 20rpx"
>
<scroll-list ref="quotationRef" :option="option" @load="quotationUp" @refresh="quotationDown">
<view v-for="(item, index) in list" :key="index" style="margin-bottom: 20rpx">
<view class="list-border list-title-line">
<text class="list-title">{{ item.belongEnterpriseName }}</text>
<text class="list-title-Subtitle">{{
item.replyStatus | replyStatusName
}}</text>
<text class="list-title-Subtitle">{{ item.replyStatus | replyStatusName }}</text>
</view>
<view class="" @click="offerClick(item)">
<view class="list-border list-info-line">
<view
class="list-info"
:class="
subIndex + 1 === item.itemList.length ? '' : 'list-border'
"
:class="subIndex + 1 === item.itemList.length ? '' : 'list-border'"
v-for="(subItem, subIndex) in item.itemList"
:key="subIndex"
>
<view class="">
<image
class="list-image"
:src="
subItem.productImg ||
'https://qncloud.oss-cn-shenzhen.aliyuncs.com/paper_shopkeeper/paper-default-small.png'
"
:src="subItem.productImg || 'https://qncloud.oss-cn-shenzhen.aliyuncs.com/paper_shopkeeper/paper-default-small.png'"
mode=""
></image>
</view>
<view class="list-info-contant">
<view class="list-info-title">{{ subItem.paperName }}</view>
<view class="list-info-text">
{{ subItem.brandName }}/{{ subItem.categoryName }}/{{
subItem.gramWeight
}}g/{{ subItem.width }}*{{ subItem.length }}/{{
subItem.quantity
}}
{{ subItem.brandName }}/{{ subItem.categoryName }}/{{ subItem.gramWeight }}g/{{ subItem.width }}*{{ subItem.length }}/{{ subItem.quantity }}
</view>
</view>
</view>
@ -63,9 +43,7 @@
<text>报价截止</text>
<text>{{ item.enquiryValidTime }}</text>
</view>
<view
><button type="primary" class="offer-btn">报价</button></view
>
<view><button type="primary" class="offer-btn">报价</button></view>
</view>
</view>
</view>
@ -73,11 +51,7 @@
</scroll-list>
<view>
<view class="offer-prices" @click="nativeTo()">
<image
class="my-image"
src="../../static/imgs/trade/myPrice.png"
mode=""
></image>
<image class="my-image" src="../../static/imgs/trade/myPrice.png" mode=""></image>
<view class="my-price">我的报价</view>
</view>
</view>
@ -92,17 +66,15 @@ export default {
props: {
queryData: {
type: Object,
default: () => {},
default: () => {}
},
},
components: {
uGap,
},
props: {
refresh: {
type: Boolean,
default: false,
},
default: false
}
},
components: {
uGap
},
data() {
return {
@ -111,25 +83,25 @@ export default {
auto: true,
emptyText: '暂无报价信息~',
fontSize: '40rpx',
emptyImage: '/static/imgs/client-detail/no-data-icon.png',
emptyImage: '/static/imgs/client-detail/no-data-icon.png'
},
params: {
asc: '',
desc: '',
mallSupplierIds: [this.$store.state.supplierInfo.supplierId], // ID
mallSupplierIds: [this.$store.state.supplierInfo.supplierId] // ID
// mallSupplierIds: ['553703427180466176'] // ID
},
pagination: {
pageNum: 0, //
pageSize: 20,
pageSize: 20
},
list: [],
list: []
}
},
watch: {
refresh() {
this.quotationDown()
},
}
},
filters: {
replyStatusName(status) {
@ -152,7 +124,7 @@ export default {
break
}
return name
},
}
},
methods: {
//
@ -205,15 +177,15 @@ export default {
offerClick(item) {
var params = {
...item,
title: '提交报价',
title: '提交报价'
}
go2('submit-quotation', params)
},
//
nativeTo() {
go2('my-offer')
},
},
}
}
}
</script>

2
store/index.js

@ -236,7 +236,7 @@ if (!store) {
commit('removeSupplierInfo')
},
addSearchHistory({ commit, state }, searchHistory) {
const arr = [...state.searchHistory] // 单层数组直接解构
let arr = [...state.searchHistory] // 单层数组直接解构
let index = arr.findIndex((item) => item === searchHistory)
if (index > -1) {
arr.splice(index, 1)

Loading…
Cancel
Save