Browse Source

纸商城

devlop
buffeyu 4 years ago
parent
commit
fdbbf272eb
3 changed files with 137 additions and 47 deletions
  1. 93
      pages/mall/index.vue
  2. 71
      pages/mall/no-data.vue
  3. 20
      pages/switching-mall/index.vue

93
pages/mall/index.vue

@ -19,48 +19,51 @@
</view> </view>
</view> </view>
<uGap></uGap> <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" @click="detailInfo(item)">
<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 class="" v-if="pageShow">
<scroll-list ref="list" :option="option" @load="upCallback" @refresh="downCallback" style="background-color: #FFFFFF;">
<view v-for="(item, index) in listData" :key="index" @click="detailInfo(item)">
<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>
<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="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>
<view class="other">
<view class="time">{{item.updateTime}}</view>
<view class="btn">
<view class="" @click="editPaper()">编辑</view>
<view class="divide"></view>
<view class="" @click="productStatusChange(item)">{{item.status=== '30111'?'下架':'上架'}}</view>
<view class="other">
<view class="time">{{ item.updateTime }}</view>
<view class="btn">
<view class="" @click="editPaper()">编辑</view>
<view class="divide"></view>
<view class="" @click="productStatusChange(item)">{{ item.status === '30111' ? '下架' : '上架' }}</view>
</view>
</view> </view>
<uGap></uGap>
</view> </view>
<uGap></uGap>
</view>
</scroll-list>
</scroll-list>
</view>
<view> <view>
<view class="offer-prices" @click="nativeTo()">
<image class="my-image" src="../../static/imgs/trade/camera.png" mode=""></image>
</view>
<view class="offer-prices" @click="nativeTo()"><image class="my-image" src="../../static/imgs/trade/camera.png" mode=""></image></view>
</view> </view>
<no-data v-if="!pageShow"></no-data>
</view> </view>
</template> </template>
<script> <script>
import uGap from '@/components/u-gap/u-gap.vue' import uGap from '@/components/u-gap/u-gap.vue'
import { back, go2, loginG2 } from '@/utils/hook.js' import { back, go2, loginG2 } from '@/utils/hook.js'
import { SupplierList,productStatus } from '@/apis/add-paper.js'
import { SupplierList, productStatus } from '@/apis/add-paper.js'
import noData from './no-data.vue'
export default { export default {
components: { uGap },
components: { uGap, noData },
data() { data() {
return { return {
pageShow: true,
option: { option: {
size: 10, size: 10,
auto: true, auto: true,
@ -79,11 +82,11 @@ export default {
orderPagination: { orderPagination: {
pageNum: 0, // pageNum: 0, //
pageSize: 10, pageSize: 10,
storeId:null,
name:null,
supplierId:this.$store.state.supplierInfo.id
storeId: null,
name: null,
supplierId: this.$store.state.supplierInfo.supplierId
}, },
listData:[]
listData: []
} }
}, },
onLoad() { onLoad() {
@ -91,13 +94,17 @@ export default {
}, },
methods: { methods: {
back, back,
//
// pageShow
quertData() { quertData() {
console.log('this.$store.state',this.$store.state)
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
SupplierList({ ...this.orderPagination })
SupplierList({ ...this.orderPagination })
.then(res => { .then(res => {
console.log('纸品列表', res)
if (res) { if (res) {
if (res.records.length === 0) {
this.pageShow = false
return
}
if (this.orderPagination.pageNum == 1) { if (this.orderPagination.pageNum == 1) {
this.listData = res.records this.listData = res.records
} else { } else {
@ -140,28 +147,28 @@ export default {
var params = { var params = {
title: '添加纸品' title: '添加纸品'
} }
go2('add-paper',params)
go2('add-paper', params)
}, },
// //
editPaper(){
editPaper() {
var params = { var params = {
title: '编辑纸品' title: '编辑纸品'
} }
go2('add-paper',params)
go2('add-paper', params)
}, },
// //
setting(){
setting() {
go2('store-settings') go2('store-settings')
}, },
// //
detailInfo(){
detailInfo() {
loginGo2('paper-detail') loginGo2('paper-detail')
}, },
// //
productStatusChange(item){
productStatusChange(item) {
var params = { var params = {
id:item.id,
status:item.status === '30111'?'30112':'30111'
id: item.id,
status: item.status === '30111' ? '30112' : '30111'
} }
productStatus(params).then(res => { productStatus(params).then(res => {
if (res) { if (res) {
@ -174,7 +181,7 @@ export default {
}, 1000) }, 1000)
} }
}) })
},
}
} }
} }
</script> </script>
@ -340,7 +347,7 @@ export default {
z-index: 9999; z-index: 9999;
right: 32rpx; right: 32rpx;
bottom: 122rpx; bottom: 122rpx;
background-color: #007AFF;
background-color: #007aff;
border-radius: 50%; border-radius: 50%;
padding: 10rpx; padding: 10rpx;
text-align: center; text-align: center;

71
pages/mall/no-data.vue

@ -0,0 +1,71 @@
<template>
<view class="warpper">
<image class="icon" src="/static/imgs/client-detail/no-data-icon.png"></image>
<view class="text-row">
<view class="">
还没有纸品快去
</view>
<view class="btn" @tap="nativeTo">
添加
</view>
</view>
</view>
</template>
<script>
import { back, go2, loginG2 } from '@/utils/hook.js'
export default {
props: {
title:{
type: String,
default: null
}
},
data() {
return {
}
},
methods: {
//
nativeTo() {
var params = {
title: '添加纸品'
}
go2('add-paper',params)
},
}
}
</script>
<style lang="scss">
.warpper {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
text-align: center;
margin-top: 25%;
.icon {
width: 560rpx;
height: 320rpx;
}
.text-row {
display: flex;
flex-direction: row;
font-size: 30rpx;
color: #333333;
letter-spacing: 0;
text-align: center;
font-weight: 400;
}
.btn {
font-size: 32rpx;
color: #007AFF;
letter-spacing: 0;
text-align: center;
font-weight: 400;
text-decoration: underline;
}
}
</style>

20
pages/switching-mall/index.vue

@ -7,17 +7,17 @@
<view slot="right"></view> <view slot="right"></view>
</uni-nav-bar> </uni-nav-bar>
</view> </view>
<view class="" v-for="(item,index) in 5" :key="index" @click="checkCompany(item)">
<view class="" v-for="(item,index) in enterpriseList" :key="index" @click="checkCompany(item, index)">
<uni-list> <uni-list>
<uni-list-item> <uni-list-item>
<!-- 自定义 header --> <!-- 自定义 header -->
<view slot="header" class="slot-box"><image class="slot-image check-mall-image" src="/static/logo.png" mode="widthFix"></image></view> <view slot="header" class="slot-box"><image class="slot-image check-mall-image" src="/static/logo.png" mode="widthFix"></image></view>
<!-- 自定义 body --> <!-- 自定义 body -->
<view slot="body" class="slot-box check-mall-text"> <view slot="body" class="slot-box check-mall-text">
<view class="check-mall-text-textTitle"><text>东莞市隆兴纸业有限公司</text></view>
<view class="check-mall-text-textTitle"><text>{{item.name}}</text></view>
<view class="check-mall-text-textSubTitle"><text>全部商品39</text></view> <view class="check-mall-text-textSubTitle"><text>全部商品39</text></view>
</view> </view>
<view v-if="index === 2" slot="footer" class="slot-box check-mall-sure"><icon type="success_no_circle" size="26" /></view>
<view v-if="activeIndex === index" slot="footer" class="slot-box check-mall-sure"><icon type="success_no_circle" size="26" /></view>
</uni-list-item> </uni-list-item>
</uni-list> </uni-list>
</view> </view>
@ -27,17 +27,29 @@
<script> <script>
import { back, go2 } from '@/utils/hook.js' import { back, go2 } from '@/utils/hook.js'
import { getBaseInfo } from '@/apis/commonApi.js'
export default { export default {
data() { data() {
return { return {
activeIndex: 0,
companyData:[], companyData:[],
enterpriseList:[],
} }
}, },
onLoad() {
this.queryData()
},
methods: { methods: {
back, back,
queryData() {
getBaseInfo({}, true).then((res) => {
console.log('==', res)
this.enterpriseList = res.enterpriseList
})
},
// //
checkCompany(){ checkCompany(){
this.activeIndex = 0
go2('mall') go2('mall')
}, },
} }

Loading…
Cancel
Save