123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493 |
- <template>
- <view>
- <mescroll-body ref="mescrollRef" @init="mescrollInit" top="20" @down="downCallback" :up="upOption"
- @up="upCallback" @emptyclick="emptyClick">
- <!-- 数据列表 -->
- <view class="list" v-if="goods.length!=0">
- <view class="list-item" v-for="(item,index) in goods">
- <view class="row1 flex jcsb alc">
- <view class="left flex alc">
- <view class="bottom" style="margin-top: 6rpx;">
- <text class="color1" v-if="item.tranType=='采购'">采购</text>
- <text class="color2" v-if="item.tranType=='销售'">销售</text>
- <text class="color3">{{item.remark3}}</text>
- </view>
- </view>
- <view class="right" style="color: #FE6430;" v-if="item.status=='待审核'">审核中</view>
- <view class="right" style="color: #FB2323;" v-if="item.status=='已驳回'">已驳回</view>
- <view class="right" style="color: #22C572;" v-if="item.status=='审核通过'">已通过</view>
- </view>
- <view class="row2">
- <mote-lines-divide :dt="item.publishingContent" :line="3" expandText="展开" foldHint="收起" />
- </view>
- <view class="row3">
- <!-- <image :src="item1" mode="aspectFill" v-for="(item1,index) in item.imgList" class="img">
- </image> -->
- <image :src="item1" mode="aspectFill" v-for="(item1,index) in item.imgList"
- @tap="previewImage(item,index)" class="img">
- </image>
- <image v-if='item.imgList&&item.imgList.length%3==1||item.imgList&&item.imgList.length%3==2'
- class="img" style='background:#fff;'></image>
- <image v-if='item.imgList&&item.imgList.length%3==1' class="img" style='background:#fff;'>
- </image>
- </view>
- <view class="row4">
- <u-icon name="map-fill" color="#AFB3BF" size="28" bold></u-icon>
- <text class="text">{{item.placeDelivery}}</text>
- </view>
- <view class="row5">
- <view class="del btn" @click="del(item)">
- 删除
- </view>
- <view v-if="item.status!='待审核'" class="edit btn" @click="edit(item)">
- 编辑
- </view>
- <view v-if="item.status!='已驳回'&&item.status!='待审核'" class="edit btn" @click="refresh(item)">
- 刷新
- </view>
- </view>
- </view>
- </view>
- </mescroll-body>
- <!-- <view class="add" @click="release">
- <u-icon name="plus" color="#fff" size="34" bold></u-icon>
- </view> -->
- <u-toast ref="uToast" />
- <u-modal v-model="isShowAlert" :title-style="{fontSize: '18px',fontWeight:'500'}"
- :content-style="{fontSize: '14px',fontWeight:'400'}" confirm-color='#22C572' confirm-text='确定' title='提示'
- :showCancelButton='false' content="确定删除当前记录?" @confirm="alertBtn" @cancel="cancelClick"></u-modal>
- </view>
- </template>
- <script>
- import MescrollMixin from "@/components/mescroll-uni/mescroll-mixins.js";
- import MoteLinesDivide from "@/components/text-over-flow"
- import selectAddress from "@/components/selectAddress.vue"
- import {
- apiGoods
- } from "@/api/mock.js"
- export default {
- components: {
- MoteLinesDivide,
- selectAddress
- },
- mixins: [MescrollMixin], // 使用mixin
- data() {
- return {
- selectObj: {},
- isShowAlert: false,
- canReset: false,
- keyword: '',
- inputStyle: {
- // "padding-left": '30rpx'
- },
- content: '上半年,普陀区开展“绿剑”系列执法行动二次,共计出动执法人员120余人次,检有关经营主体87余家次,发放宣传资料等200余份;加强农产品和农业…上半年,普陀区开展“绿剑”系列执法行动二次,共计出动执法人员120余人次,检有关经营主体87余家次,发放宣传资料等200余份;加强农产品和农业…',
- upOption: {
- // page: {
- // num: 0, // 当前页码,默认0,回调之前会加1,即callback(page)会从1开始
- // size: 10 // 每页数据的数量
- // },
- noMoreSize: 4, //如果列表已无数据,可设置列表的总数量要大于半页才显示无更多数据;避免列表数据过少(比如只有一条数据),显示无更多数据会不好看; 默认5
- empty: {
- icon: '/static/empty.png',
- tip: '暂无内容', // 提示
- // btnText: '去看看'
- },
- textNoMore: '没有更多了~',
- textColor: '#878C9C',
- },
- goods: [], //列表数据
- tabs: [{
- name: '全部',
- type: 'xx'
- }, {
- name: '采购',
- type: 'xx'
- }, {
- name: '销售',
- type: 'xx'
- }, {
- name: '关注',
- type: 'xx'
- }],
- tabIndex: 0 // tab下标
- }
- },
- onShow() {
- uni.showTabBar()
- uni.hideKeyboard()
- var userInfo = uni.getStorageSync("userInfo")
- var that = this
- console.log("userInfo", userInfo)
- this.$nextTick(function() {
- this.canReset && this.mescroll.resetUpScroll() // 重置列表数据为第一页
- this.canReset && this.mescroll.scrollTo(0, 0) // 重置列表数据为第一页时,建议把滚动条也重置到顶部,避免无法再次翻页的问题
- this.canReset = true // 过滤第一次的onShow事件,避免初始化界面时重复触发upCallback, 无需配置auto:false
- });
- },
- onLoad(options) {},
- methods: {
- cancelClick() {
- this.isShowAlert = false
- },
- alertBtn() {
- let _obj = {
- id: this.selectObj.id,
- }
- uni.showLoading({
- title: '数据加载中',
- mask: true
- })
- this.$api.doRequest('post', '/transactionExchangeInfo/deleteInfo', _obj).then(res => {
- console.log(res.data)
- if (res.data.code == 200) {
- this.$refs.uToast.show({
- title: '删除成功',
- type: 'success',
- })
- this.mescroll.resetUpScroll()
- }
- uni.hideLoading()
- })
- },
- previewImage(item, index) {
- console.log(111111111)
- var i = item.imgList; //获取当前页面的轮播图数据
- //uniapp预览轮播图
- uni.previewImage({
- indicator: 'default',
- current: index, //预览图片的下标
- urls: i //预览图片的地址,必须要数组形式,如果不是数组形式就转换成数组形式就可以
- })
- },
- refresh(val) {
- let _obj = {
- id: val.id,
- flag: 0,
- remark3: new Date().getTime()
- }
- uni.showLoading({
- title: '数据加载中',
- mask: true
- })
- this.$api.doRequest('post', '/transactionExchangeInfo/editInfo', _obj).then(res => {
- console.log(res.data)
- if (res.data.code == 200) {
- this.$refs.uToast.show({
- title: '刷新成功成功',
- type: 'success',
- })
- this.mescroll.resetUpScroll()
- }
- uni.hideLoading()
- })
- },
- edit(val) {
- uni.navigateTo({
- url: '/pages/business/editRelease?id=' + val.id
- })
- },
- del(val) {
- this.selectObj = val
- this.isShowAlert = true
- },
- selectAddress(val) {
- console.log(val)
- },
- release() {
- uni.navigateTo({
- url: 'release'
- })
- },
- /*上拉加载的回调: 其中page.num:当前页 从1开始, page.size:每页数据条数,默认10 */
- async upCallback(page) {
- //联网加载数据
- let _obj = {
- pageSize: page.size,
- currentPage: page.num,
- userId: this.userInfo.id,
- }
- await this.$api.doRequest('get', '/transactionExchangeInfo/selectTransactionExchangeInfo', _obj).then(
- res => {
- console.log(res.data)
- if (res.data.code == 200) {
- let curPageData = res.data.data.records;
- let curPageLen = curPageData.length;
- let totalPage = res.data.data.total;
- if (page.num == 1) this.goods = [];
- this.goods = this.goods.concat(curPageData);
- console.log(curPageLen, totalPage)
- this.mescroll.endByPage(curPageLen, totalPage);
- // for (let i = 0; i < this.goods.length; i++) {
- // this.goods[i].imgList = this.goods[i].urlImg.split(',')
- // }
- }
- // uni.hideLoading()
- })
- if (this.goods.length > 0) {
- for (let i = 0; i < this.goods.length; i++) {
- await this.$api.doRequest('get', 'appendix/query/getFileList', {
- appendixIds: this.goods[i].urlImg
- }).then(res1 => {
- if (i == this.goods.length - 1) {
- uni.hideLoading()
- }
- var arr = []
- for (let q = 0; q < res1.data.data.length; q++) {
- arr.push(res1.data.data[q].appendixPath)
- }
- this.goods[i].imgList = arr
- this.$forceUpdate()
- })
- }
- }
- },
- //点击空布局按钮的回调
- emptyClick() {
- uni.showToast({
- title: '点击了按钮,具体逻辑自行实现'
- })
- },
- // 切换菜单
- tabChange() {
- this.goods = [] // 先置空列表,显示加载进度
- this.mescroll.resetUpScroll() // 再刷新列表数据
- }
- }
- }
- </script>
- <style lang='scss'>
- page,
- .content {
- background: #F5F6FA;
- }
- .flex {
- display: flex;
- }
- .alc {
- align-items: center;
- }
- .jcse {
- justify-content: space-evenly;
- }
- .jcsb {
- justify-content: space-between;
- }
- .top-warp {
- z-index: 998;
- position: fixed;
- top: --window-top;
- /* css变量 */
- left: 0;
- width: 100%;
- /* height: 120upx; */
- background-color: white;
- }
- .top-warp .tip {
- font-size: 28upx;
- height: 60upx;
- line-height: 60upx;
- text-align: center;
- }
- .slot-wrap {
- margin-right: 45rpx;
- font-size: 32rpx;
- }
- .list {
- margin: 0 20rpx;
- .list-item {
- padding: 26rpx 17rpx;
- background: #fff;
- margin-bottom: 20rpx;
- border-radius: 20rpx;
- .row1 {
- .head-img {
- width: 72rpx;
- border-radius: 8rpx;
- margin-right: 22rpx;
- }
- .left {
- .title {
- font-weight: 700;
- color: #333333;
- }
- .bottom {
- .color1 {
- font-size: 24rpx;
- padding: 4rpx 10rpx;
- color: #fff;
- display: inline-block;
- background: linear-gradient(180deg, #607AE0 0%, #516CDC 100%);
- border-radius: 4rpx;
- }
- .color2 {
- font-size: 24rpx;
- padding: 4rpx 10rpx;
- color: #fff;
- display: inline-block;
- background: linear-gradient(180deg, #FD714F 0%, #FD613C 100%);
- border-radius: 4rpx;
- }
- .color3 {
- font-size: 24rpx;
- color: #AFB3BF;
- margin-left: 14rpx;
- }
- }
- }
- .right {
- padding: 10rpx 20rpx;
- border: 1px solid #CDCDCD;
- border-radius: 50rpx;
- }
- }
- .row2 {
- margin-top: 20rpx;
- /* overflow: hidden;
- text-overflow: ellipsis;
- width: 100%;
- display: -webkit-box;
- -webkit-box-orient: vertical;
- -webkit-line-clamp: 3;
- word-break: break-all; */
- }
- .row3 {
- /* padding: 30rpx 30rpx 0 30rpx; */
- margin-top: 18rpx;
- display: flex;
- align-items: center;
- justify-content: space-between;
- flex-wrap: wrap;
- /* background: #bbb; */
- .img {
- display: flex;
- align-items: center;
- /* justify-content: space-between; */
- width: 210rpx;
- height: 210rpx;
- margin-bottom: 20rpx;
- background: lightblue;
- list-style: none;
- border-radius: 10rpx;
- margin-right: 16rpx;
- }
- .img:nth-of-type(3),
- .img:nth-of-type(6),
- .img:nth-of-type(9) {
- margin-right: 0;
- }
- }
- .row4 {
- margin-top: 4rpx;
- .text {
- color: #878C9C;
- font-size: 24rpx;
- }
- }
- }
- .case {
- font-weight: 700;
- margin-left: 6rpx;
- }
- }
- .add {
- position: fixed;
- bottom: 250rpx;
- right: 32rpx;
- background: #22C572;
- z-index: 999;
- width: 84rpx;
- height: 84rpx;
- border-radius: 50%;
- display: flex;
- align-items: center;
- justify-content: center;
- }
- .search {
- display: flex;
- align-items: center;
- position: relative;
- margin: 20rpx 28rpx 20rpx 28rpx;
- .text {
- width: 90rpx;
- overflow: hidden;
- white-space: nowrap;
- text-overflow: ellipsis;
- }
- }
- /deep/.u-content {
- padding-left: 170rpx;
- }
- .place {
- display: flex;
- align-items: center;
- left: 28rpx;
- position: absolute;
- font-weight: 700;
- }
- .row5 {
- display: flex;
- justify-content: flex-end;
- margin-top: 20rpx;
- .btn {
- width: 120rpx;
- height: 66rpx;
- background: #FFFFFF;
- border-radius: 33px;
- border: 1px solid #CDCDCD;
- font-size: 28rpx;
- font-weight: 400;
- color: #333333;
- line-height: 66rpx;
- text-align: center;
- margin-left: 24rpx;
- }
- }
- </style>
|