【前端】云工厂的纸掌柜app
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

337 lines
7.5 KiB

<template>
<view class="warpper">
<uni-nav-bar>
<view slot="left" class="left-title">纸商城</view>
<view slot="right" class="right-title">分享</view>
</uni-nav-bar>
<view class="top-box">
<view class=""><image class="image" src="https://qncloud.oss-cn-shenzhen.aliyuncs.com/ztb_pic/testPic.jfif" mode=""></image></view>
<view class="center">
<view class="title">东莞市隆兴纸业有限公司</view>
<view class="desc">全部商品 39 &nbsp; | &nbsp;上新 9</view>
</view>
<view class="right">
<view class="cut" @click="checkMall()">
切换商城
<image class="cut-icon" src="/static/imgs/mall/cut-icon.png" mode=""></image>
</view>
<view class="set" @click="setting()">设置</view>
</view>
</view>
<uGap></uGap>
<scroll-list ref="list" :option="option" @load="upCallback" @refresh="downCallback" style="background-color: #FFFFFF;">
<view v-for="(item, index) in listData" :key="index">
<view class="content">
<image class="image" src="https://qncloud.oss-cn-shenzhen.aliyuncs.com/ztb_pic/testPic.jfif" mode=""></image>
<view class="">
<view class="title">
<view class="">{{item.brandName}}</view>
<view class="">
<image class="icon" :src="item.status === 1 ? '/static/imgs/mall/grounding-icon.png' : '/static/imgs/mall/sold-out-icon.png'" mode=""></image>
</view>
</view>
<view class="sub-title">{{item.categoryName}}/{{item.name}}/{{item.manufacturerName}}</view>
<view class="desc">克重(价格)200(3900) 235(3900) 255(390 0)255(390</view>
</view>
</view>
<view class="other">
<view class="time">{{item.updateTime}}</view>
<view class="btn">
<view class="" @click="editPaper()">编辑</view>
<view class="divide"></view>
<view class="">下架</view>
</view>
</view>
<uGap></uGap>
</view>
</scroll-list>
<view>
<view class="offer-prices" @click="nativeTo()">
<image class="my-image" src="../../static/imgs/trade/camera.png" mode=""></image>
</view>
</view>
</view>
</template>
<script>
import uGap from '@/components/u-gap/u-gap.vue'
import { back, go2 } from '@/utils/hook.js'
import { SupplierList } from '@/apis/add-paper.js'
export default {
components: { uGap },
data() {
return {
option: {
size: 10,
auto: true,
emptyText: '暂无数据~',
background: '#F7F8FA',
disabled: false
},
pattern: {
backgroundColor: '#007AFF',
buttonColor: '#007AFF'
},
content: [],
horizontal: 'right',
vertical: 'bottom',
direction: 'vertical',
orderPagination: {
pageNum: 0, // 初始会执行一次下拉加载
pageSize: 10,
storeId:null,
name:null
},
listData:[{}]
}
},
onLoad() {
},
methods: {
back,
// 获取纸品列表
quertData() {
return new Promise((resolve, reject) => {
SupplierList({ ...this.orderPagination })
.then(res => {
if (res) {
if (this.orderPagination.pageNum == 1) {
this.listData = res.records
} else {
this.listData = this.listData.concat(res.records)
}
resolve({ list: this.listData, total: res.total })
}
})
.catch(err => {
reject(err)
})
})
},
downCallback() {
this.orderPagination.pageNum = 1
this.quertData()
.then(({ list, total }) => {
this.$refs.list.refreshSuccess({ list, total })
})
.catch(() => {
this.$refs.list.refreshFail()
})
},
upCallback() {
this.orderPagination.pageNum++
this.quertData()
.then(({ list, total }) => {
this.$refs.list.loadSuccess({ list, total })
})
.catch(() => {
this.$refs.list.loadFail()
})
},
// 切换商城按钮
checkMall() {
go2('switching-mall')
},
// 按钮点击事件
nativeTo() {
var params = {
title: '添加纸品'
}
go2('add-paper',params)
},
// 编辑事件
editPaper(){
var params = {
title: '编辑纸品'
}
go2('add-paper',params)
},
// 店铺设置按钮
setting(){
go2('store-settings')
}
}
}
</script>
<style lang="scss">
.warpper {
width: 750rpx;
.left-title {
font-size: 40rpx;
color: #000000;
letter-spacing: 0;
font-weight: 500;
}
.right-title {
font-size: 28rpx;
color: #007aff;
text-align: right;
font-weight: 500;
}
.top-box {
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-around;
height: 180rpx;
background: url('/static/imgs/mall/zsc-bg-icon.png') no-repeat;
background-size: 100%;
.image {
width: 100rpx;
height: 100rpx;
border-radius: 50%;
}
.right {
width: 140rpx;
}
.center {
position: relative;
left: -20rpx;
}
.title {
font-size: 34rpx;
color: #ffffff;
letter-spacing: 2rpx;
font-weight: 600;
margin-bottom: 12rpx;
}
.desc {
opacity: 0.75;
font-size: 28rpx;
color: #ffffff;
letter-spacing: 0;
font-weight: 500;
padding-right: 32rpx;
}
.cut {
display: flex;
align-items: center;
font-size: 24rpx;
color: #ffffff;
letter-spacing: 0;
text-align: center;
font-weight: 400;
.cut-icon {
width: 29.42rpx;
height: 26.67rpx;
margin-left: 10rpx;
}
}
.set {
opacity: 0.75;
font-size: 28rpx;
color: #ffffff;
letter-spacing: 0;
font-weight: 500;
position: relative;
top: 39rpx;
left: 60rpx;
}
}
.content {
background: #ffffff;
border-bottom: 2rpx solid #dddddd;
display: flex;
flex-direction: row;
padding: 24rpx 0rpx 24rpx 32rpx;
.image {
width: 100rpx;
height: 100rpx;
flex: 0 0 100rpx;
margin-right: 18rpx;
}
.title {
display: flex;
flex-direction: row;
justify-content: space-between;
font-size: 32rpx;
color: #333333;
letter-spacing: 0;
font-weight: 500;
.icon {
position: relative;
top: -22rpx;
width: 150rpx;
height: 50rpx;
}
}
.sub-title {
position: relative;
font-size: 28rpx;
color: #333333;
letter-spacing: 0;
font-weight: 400;
top: -4rpx;
}
.desc {
font-size: 28rpx;
color: #555555;
letter-spacing: 0;
font-weight: 400;
padding-top: 10rpx;
line-height: 1.4;
}
}
.other {
display: flex;
flex-direction: row;
justify-content: space-between;
align-items: center;
height: 80rpx;
background: #ffffff;
padding: 0rpx 32rpx;
.time {
font-size: 28rpx;
color: #888888;
letter-spacing: 0;
font-weight: 400;
}
.btn {
display: flex;
flex-direction: row;
justify-content: space-between;
align-items: center;
font-size: 28rpx;
color: #007aff;
letter-spacing: 0;
text-align: right;
font-weight: 400;
}
.divide {
width: 2rpx;
height: 32rpx;
background: #d8d8d8;
margin: 0 32rpx;
}
.icon {
width: 24rpx;
height: 24rpx;
margin-left: 6rpx;
}
}
.offer-prices {
position: absolute;
z-index: 9999;
right: 32rpx;
bottom: 122rpx;
background-color: #007AFF;
border-radius: 50%;
padding: 10rpx;
text-align: center;
width: 110rpx;
height: 110rpx;
border: 2rpx solid #f9f9f9;
box-shadow: 0rpx 4rpx 34rpx 0rpx rgba(0, 0, 0, 0.2);
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
}
.my-image {
width: 100rpx;
height: 100rpx;
}
}
</style>