商城下单购买,品类接口,钱包依赖

This commit is contained in:
唐明明
2022-01-07 16:28:29 +08:00
parent 6d4971bc5e
commit a75b9e7964
20 changed files with 1176 additions and 69 deletions

View File

@@ -1,5 +1,10 @@
<template>
<view>
<view class="content">
<!-- 分类 -->
<u-sticky bgColor="#fff" zIndex="99">
<u-tabs :list="classify" lineColor="#34CE98" @click="onTabs()"></u-tabs>
</u-sticky>
<!-- 分类商品 -->
<oct-goods
:lists="goodsArr"
color="#e6576b"
@@ -9,24 +14,52 @@
</template>
<script>
import { meals } from "@/apis/interfaces/store"
import { lists } from "@/apis/interfaces/store"
export default {
data() {
return {
goodsArr: []
goodsArr: [],
classify: [
{ name: "全部" },
{ name: "21天盒子" },
{ name: "7天盒子" },
{ name: "3天盒子" },
{ name: "复食餐" },
]
};
},
mounted(){
meals(this.$Route.query.id).then(res => {
uni.setNavigationBarTitle({
title: res.title
})
this.goodsArr = res.items
uni.setNavigationBarTitle({
title: this.$Route.query.title
})
this.getLists()
},
methods:{
// 商品列表
getLists() {
// {
// this.$Route.query.id
// }
lists({}).then(res => {
this.goodsArr = res.data
uni.stopPullDownRefresh()
})
},
// 二级分类筛选
onTabs(){
this.goodsArr = []
this.getLists()
}
},
onPullDownRefresh() {
this.getLists()
}
}
</script>
<style lang="scss">
<style lang="scss" scoped>
.content{
background: $window-color;
min-height: 100vh;
}
</style>