Browse Source

商城bug

devlop
mo-bai 4 years ago
parent
commit
775d65ebe3
2 changed files with 65 additions and 70 deletions
  1. 133
      pages/mall/index.vue
  2. 2
      pages/setting/index.vue

133
pages/mall/index.vue

@ -19,49 +19,43 @@
<view class="set" @click="setting">设置</view>
</view>
</view>
<view>
<scroll-list ref="list" :option="option" @load="upCallback" @refresh="downCallback">
<view v-for="(item, index) in listData" :key="index" style="margin-bottom: 20rpx">
<view class="content" @click="detailInfo(item)">
<image
class="image"
:src="item.litPicUrl || 'https://qncloud.oss-cn-shenzhen.aliyuncs.com/paper_shopkeeper/paper-default-small.png'"
mode=""
></image>
<view style="flex: 1 1 auto">
<view class="title">
<view>{{ item.name }}</view>
<view>
<image
class="icon"
:src="item.status === 30111 ? '/static/imgs/mall/grounding-icon.png' : '/static/imgs/mall/sold-out-icon.png'"
mode=""
></image>
</view>
</view>
<view class="sub-title">{{ item.manufacturerName }}/{{ item.categoryName }}/{{ item.brandName }}</view>
<view class="desc flex-row-center-start" style="flex-wrap: wrap">
克重(价格)
<text style="margin-right: 8rpx" v-for="(sku, index) in item.skuList" :key="index">{{ sku.weight }}g({{ sku.listPrice }})</text>
<scroll-list ref="list" :option="option" @load="upCallback" @refresh="downCallback">
<view v-for="(item, index) in listData" :key="index" style="margin-bottom: 20rpx">
<view class="content" @click="detailInfo(item)">
<image class="image" :src="item.litPicUrl || 'https://qncloud.oss-cn-shenzhen.aliyuncs.com/paper_shopkeeper/paper-default-small.png'"></image>
<view style="flex: 1 1 auto">
<view class="title">
<view>{{ item.name }}</view>
<view>
<image
class="icon"
:src="item.status === 30111 ? '/static/imgs/mall/grounding-icon.png' : '/static/imgs/mall/sold-out-icon.png'"
mode=""
></image>
</view>
</view>
</view>
<view class="other">
<view class="time">{{ item.updateTime | timeFilter }}</view>
<view class="btn">
<view @click="editPaper(item)" v-if="item.status === 30112">编辑</view>
<view class="divide"></view>
<view @click="productStatusChange(item)">{{ item.status === 30111 ? '下架' : '上架' }}</view>
<view class="sub-title">{{ item.manufacturerName }}/{{ item.categoryName }}/{{ item.brandName }}</view>
<view class="desc flex-row-center-start" style="flex-wrap: wrap">
克重(价格)
<text style="margin-right: 8rpx" v-for="(sku, index) in item.skuList" :key="index">{{ sku.weight }}g({{ sku.listPrice }})</text>
</view>
</view>
</view>
<view slot="empty">
<no-data></no-data>
<view class="other">
<view class="time">{{ item.updateTime | timeFilter }}</view>
<view class="btn">
<view @click="editPaper(item)" v-if="item.status === 30112">编辑</view>
<view class="divide"></view>
<view @click="productStatusChange(item)">{{ item.status === 30111 ? '下架' : '上架' }}</view>
</view>
</view>
</scroll-list>
</view>
</view>
<view slot="empty">
<no-data></no-data>
</view>
</scroll-list>
</view>
<view v-else>
<view v-if="!hasCompany || !hasLogin">
<uni-nav-bar :fixed="true" :status-bar="true">
<view slot="left" style="font-size: 40rpx; color: #000000">纸商城</view>
</uni-nav-bar>
@ -90,20 +84,20 @@
</view>
</view>
</view>
<view class="offer-prices" @click="nativeTo()"><image class="my-image" src="../../static/imgs/trade/camera.png"></image></view>
<view v-show="hasCompany && hasLogin" class="offer-prices" @click="nativeTo()">
<image class="my-image" src="../../static/imgs/trade/camera.png"></image>
</view>
</view>
</template>
<script>
import notLogged from '@/components/not-logged/not-logged.vue'
import uGap from '@/components/u-gap/u-gap.vue'
import { back, go2, loginGo2, saveImage } from '@/utils/hook.js'
import { SupplierList, productStatus, storeDetail, getSupplierQrCode } from '@/apis/add-paper.js'
import { getTimer } from '@/utils/index.js'
import noData from './no-data.vue'
import { H5_URL_STORE } from '@/enums/index.js'
export default {
components: { uGap, noData, notLogged },
components: { noData },
filters: {
timeFilter(value) {
let abs = ''
@ -143,26 +137,23 @@ export default {
direction: 'vertical',
orderPagination: {
pageNum: 0, //
pageSize: 10,
storeId: null,
name: null,
supplierId: this.$store.state.supplierInfo.supplierId
pageSize: 10
// storeId: null,
// name: null,
// supplierId: this.$store.state.supplierInfo.supplierId
},
listData: [],
logo: '/static/imgs/mine/user-avatar.png',
backgroundStyle: 'background: url("/static/imgs/mall/top-bg.png") no-repeat;',
storeInfo: ''
}
},
computed: {
hasCompany() {
return this.$store.state.supplierInfo.id != null
},
hasLogin() {
return this.$store.state.qnToken != ''
storeInfo: '',
hasCompany: this.$store.state.supplierInfo.id != null,
hasLogin: this.$store.state.qnToken != ''
}
},
onShow() {
// 使computedtabcomputedfixedscroll
this.hasCompany = this.$store.state.supplierInfo.id != null
this.hasLogin = this.$store.state.qnToken != ''
if (this.hasCompany) {
this.storeInformation = {
supplierId: this.$store.state.supplierInfo.supplierId
@ -181,6 +172,7 @@ export default {
getSupplier(id) {
storeDetail(id).then((res) => {
if (res) {
console.log('获取店铺信息', res)
this.storeInfo = res
this.$set(this.storeInformation, 'productNumber', res.productNumber)
this.$set(this.storeInformation, 'currentProductNumber', res.currentProductNumber)
@ -200,24 +192,25 @@ export default {
},
//
queryData() {
if (!this.hasCompany || !this.hasLogin) {
return
}
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)
if (!this.hasCompany) {
reject()
} else {
SupplierList({ ...this.orderPagination, supplierId: this.$store.state.supplierInfo.supplierId })
.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 })
}
resolve({ list: this.listData, total: res.total })
}
})
.catch((err) => {
reject(err)
})
})
.catch((err) => {
reject(err)
})
}
})
},
downCallback() {
@ -348,6 +341,7 @@ export default {
.wrapper {
width: 750rpx;
overflow: hidden;
height: 100vh;
.left-title {
font-size: 40rpx;
color: #000000;
@ -361,6 +355,7 @@ export default {
font-weight: 500;
}
.top-box {
flex: 0 0 auto;
display: flex;
flex-direction: row;
align-items: center;

2
pages/setting/index.vue

@ -13,7 +13,7 @@
<text>{{ item }}</text>
</view>
<view>
<text><uni-icons type="right" color="#000000" size="18"></uni-icons></text>
<uni-icons type="right" color="#000000" size="18"></uni-icons>
</view>
</view>
</view>

Loading…
Cancel
Save