下单,地址管理

This commit is contained in:
唐明明
2022-01-10 16:51:02 +08:00
parent a75b9e7964
commit 69328de055
13 changed files with 482 additions and 106 deletions

View File

@@ -2,30 +2,39 @@
<view class="content">
<!-- 分类 -->
<u-sticky bgColor="#fff" zIndex="99">
<u-tabs :list="classify" lineColor="#34CE98" @click="onTabs()"></u-tabs>
<u-tabs :list="classify" lineColor="#34CE98" @click="onTabs"></u-tabs>
</u-sticky>
<!-- 分类商品 -->
<oct-goods
:lists="goodsArr"
color="#e6576b"
@onGoods="$Router.push({ name: 'StoreGoods', params: {id: $event.goods_id}})"
/>
<block v-if="goodsArr.length >= 1">
<oct-goods
:lists="goodsArr"
color="#e6576b"
@onGoods="$Router.push({ name: 'StoreGoods', params: {id: $event.goods_id}})"
/>
</block>
<block v-else>
<view class="vertical pages-empty">
<u-empty
icon="http://cdn.uviewui.com/uview/empty/data.png"
textColor="#999"
text="暂无数据"
>
</u-empty>
</view>
</block>
</view>
</template>
<script>
import { lists } from "@/apis/interfaces/store"
import { lists, classify } from "@/apis/interfaces/store"
export default {
data() {
return {
goodsArr: [],
classify: [
{ name: "全部" },
{ name: "21天盒子" },
{ name: "7天盒子" },
{ name: "3天盒子" },
{ name: "复食餐" },
]
{ name: "全部", category_id: "" }
],
cid : ""
};
},
mounted(){
@@ -33,21 +42,29 @@
title: this.$Route.query.title
})
this.getLists()
this.getClassify()
},
methods:{
// 商品列表
getLists() {
// {
// this.$Route.query.id
// }
lists({}).then(res => {
getLists(cid) {
lists({
category_id : this.$Route.query.id,
category_cid: this.cid
}).then(res => {
this.goodsArr = res.data
uni.stopPullDownRefresh()
})
},
// 获取二级分类
getClassify(){
classify(this.$Route.query.id).then(res => {
this.classify = this.classify.concat(res)
})
},
// 二级分类筛选
onTabs(){
onTabs(e){
this.goodsArr = []
this.cid = e.category_id
this.getLists()
}
},
@@ -62,4 +79,8 @@
background: $window-color;
min-height: 100vh;
}
.pages-empty{
height: 70vh;
}
</style>