对接手机端

This commit is contained in:
范强强
2023-06-05 14:29:22 +08:00
parent 115f6dfc60
commit e7ccc9e3b5
2 changed files with 126 additions and 27 deletions
+63 -13
View File
@@ -8,37 +8,86 @@
</div> </div>
<div class="content"> <div class="content">
<div class="content-text" v-for="item in 8"> <van-list
<div class="content-text-left"> v-model="loading"
<div class="content-text-top"> :finished="finished"
:finished-text="$t('noMore')"
:loading-text="$t('loading')"
@load="onLoad"
>
<div class="content-text" v-for="(item,index) in collectionList" :key="index">
<div class="content-text-left">
<div class="content-text-top">
<span class="content-text-top-left"> <span class="content-text-top-left">
测试类别 {{item.serialNumber}}
</span>
<span class="content-text-top-right">
测试检验项目
</span> </span>
<!-- <span class="content-text-top-right">-->
<!-- 测试检验项目-->
<!-- </span>-->
</div>
<div class="content-text-button">
<span> {{item.title}}</span>
</div>
</div> </div>
<div class="content-text-button"> <div class="content-text-right">
<span>ISO 898-1-2013</span> <van-icon name="arrow"/>
</div> </div>
</div> </div>
<div class="content-text-right"> </van-list>
<van-icon name="arrow"/>
</div>
</div>
</div> </div>
</div> </div>
</template> </template>
<script> <script>
import { getAction, postAction, deleteAction, downloadFile } from '@/api/manage'
export default { export default {
name: 'phoneMyCollection', name: 'phoneMyCollection',
data() {
return {
collectionList: [],
pageNo: 1,
pageSize: 10,
loading: false,
finished: false
}
},
mounted() { mounted() {
document.title = 'NIO GRP' document.title = 'NIO GRP'
this.getCollection()
}, },
methods: { methods: {
iconClick() { iconClick() {
this.$router.go(-1) this.$router.go(-1)
},
onLoad() {
if (this.finished) {
this.collectionList = []
this.finished = false
} else {
this.pageNo++
this.getCollection()
}
},
getCollection() {
let params = {
pageNo: this.pageNo,
pageSize: this.pageSize
}
postAction(`collection/onlCgformCollection/page`, params).then(res => {
if (res.success) {
if (res.result.records.length > 0 && this.pageNo > 1) {
this.collectionList = this.collectionList.concat(res.result.records)
} else if (res.result.records.length > 0 && this.pageNo == 1) {
this.collectionList = res.result.records
} else if (res.result.records.length == 0) {
this.finished = true
}
this.loading = false
} else {
this.collectionList = []
}
})
} }
} }
} }
@@ -108,6 +157,7 @@
font-weight: 400; font-weight: 400;
color: #595E72; color: #595E72;
margin-top: 0.13rem; margin-top: 0.13rem;
word-break: break-all;
} }
.content-text-right .van-icon { .content-text-right .van-icon {
+63 -14
View File
@@ -6,39 +6,87 @@
{{$t('mySubscription')}} {{$t('mySubscription')}}
</span> </span>
</div> </div>
<div class="content"> <div class="content">
<div class="content-text" v-for="item in 8"> <van-list
<div class="content-text-left"> v-model="loading"
<div class="content-text-top"> :finished="finished"
:finished-text="$t('noMore')"
:loading-text="$t('loading')"
@load="onLoad"
>
<div class="content-text" v-for="(item,index) in subscribeList" :key="index">
<div class="content-text-left">
<div class="content-text-top">
<span class="content-text-top-left"> <span class="content-text-top-left">
测试类别 {{item.serialNumber}}
</span>
<span class="content-text-top-right">
测试检验项目
</span> </span>
<!-- <span class="content-text-top-right">-->
<!-- 测试检验项目-->
<!-- </span>-->
</div>
<div class="content-text-button">
<span>{{item.title}}</span>
</div>
</div> </div>
<div class="content-text-button"> <div class="content-text-right">
<span>ISO 898-1-2013</span> <van-icon name="arrow"/>
</div> </div>
</div> </div>
<div class="content-text-right"> </van-list>
<van-icon name="arrow"/>
</div>
</div>
</div> </div>
</div> </div>
</template> </template>
<script> <script>
import { getAction, postAction, deleteAction, downloadFile } from '@/api/manage'
export default { export default {
name: 'phoneMySubscribe', name: 'phoneMySubscribe',
data() {
return {
subscribeList: [],
pageNo: 1,
pageSize: 10,
loading: false,
finished: false
}
},
mounted() { mounted() {
document.title = 'NIO GRP' document.title = 'NIO GRP'
this.getSubscribe()
}, },
methods: { methods: {
iconClick() { iconClick() {
this.$router.go(-1) this.$router.go(-1)
},
onLoad() {
if (this.finished) {
this.subscribeList = []
this.finished = false
} else {
this.pageNo++
this.getSubscribe()
}
},
getSubscribe() {
let params = {
pageNo: this.pageNo,
pageSize: this.pageSize
}
postAction(`subscribe/onlCgformSubscribe/page`, params).then(res => {
if (res.success) {
if (res.result.records.length > 0 && this.pageNo > 1) {
this.subscribeList = this.subscribeList.concat(res.result.records)
} else if (res.result.records.length > 0 && this.pageNo == 1) {
this.subscribeList = res.result.records
} else if (res.result.records.length == 0) {
this.finished = true
}
this.loading = false
} else {
this.subscribeList = []
}
})
} }
} }
} }
@@ -108,6 +156,7 @@
font-weight: 400; font-weight: 400;
color: #595E72; color: #595E72;
margin-top: 0.13rem; margin-top: 0.13rem;
word-break: break-all;
} }
.content-text-right .van-icon { .content-text-right .van-icon {