提交一波半成品

This commit is contained in:
aixianling
2023-01-11 17:47:02 +08:00
parent a17e67ad6c
commit 7244927127
5 changed files with 37 additions and 13 deletions

View File

@@ -22,7 +22,7 @@
"@dcloudio/uni-mp-weixin": "3.0.0-3061420221215001", "@dcloudio/uni-mp-weixin": "3.0.0-3061420221215001",
"@dcloudio/uni-quickapp-webview": "3.0.0-3061420221215001", "@dcloudio/uni-quickapp-webview": "3.0.0-3061420221215001",
"@dcloudio/uni-ui": "^1.4.23", "@dcloudio/uni-ui": "^1.4.23",
"axios": "^1.2.2", "axios": "^0.27.2",
"axios-miniprogram-adapter": "^0.3.5", "axios-miniprogram-adapter": "^0.3.5",
"dayjs": "^1.11.7", "dayjs": "^1.11.7",
"query-string": "^8.1.0", "query-string": "^8.1.0",

View File

@@ -14,7 +14,7 @@ export default {
/*每个页面公共css */ /*每个页面公共css */
@each $padMar, $pm in (mar:margin, pad:padding) { @each $padMar, $pm in (mar:margin, pad:padding) {
@each $v in (8, 10, 16, 20, 32, 48, 64) { @each $v in (8, 10, 16, 20, 32, 48, 64, 80) {
@each $pos, $p in (l:left, r:right, t:top, b:bottom) { @each $pos, $p in (l:left, r:right, t:top, b:bottom) {
.#{$padMar}-#{$pos+$v} { .#{$padMar}-#{$pos+$v} {
#{$pm}-#{$p}: #{$v}px #{$pm}-#{$p}: #{$v}px

View File

@@ -8,7 +8,11 @@
"mp-weixin": { "mp-weixin": {
"appid": "wx68ef6cfaa104652a", "appid": "wx68ef6cfaa104652a",
"setting": { "setting": {
"urlCheck": false "urlCheck": false,
"enhance": true
},
"optimization": {
"subPackages": true
}, },
"usingComponents": true "usingComponents": true
}, },

View File

@@ -2,8 +2,21 @@
<section class="home"> <section class="home">
<uni-search-bar class="sticky-t" placeholder="搜索商品" cancelText="更多" @cancel="" radius="100" @input="handleSearch"/> <uni-search-bar class="sticky-t" placeholder="搜索商品" cancelText="更多" @cancel="" radius="100" @input="handleSearch"/>
<ai-tabs class="fixedTabs" :tabs="indexList" vertical v-model="currentType" @click="handleType"/> <ai-tabs class="fixedTabs" :tabs="indexList" vertical v-model="currentType" @click="handleType"/>
<div class="pad-l64"> <div class="pad-l80 pad-t64">
<!-- <uni-card isFull :border="false" title="示例产品" subTitle="规格:8mmX10mm" extra="查看详情"-->
<!-- thumbnail="https://web-assets.dcloud.net.cn/unidoc/zh/unicloudlogo.png"/>-->
<uni-list-item title="示例产品" note="规格:8mmX10mm" thumbSize="lg" thumb="https://web-assets.dcloud.net.cn/unidoc/zh/unicloudlogo.png" @click="handleDetail"
clickable>
<template v-slot:footer>
<div class="flex center">
<div class="mar-r8">2.60</div>
<uni-icons type="cart" size="28" @click.stop="handleAdd2Cart"/>
</div>
</template>
</uni-list-item>
<uni-list-item title="示例产品" note="规格:8mmX10mm" thumbSize="lg" thumb="https://web-assets.dcloud.net.cn/unidoc/zh/unicloudlogo.png" rightText="2.60元"/>
<uni-list-item title="示例产品" note="规格:8mmX10mm" thumbSize="lg" thumb="https://web-assets.dcloud.net.cn/unidoc/zh/unicloudlogo.png" rightText="2.60"/>
<uni-list-item title="示例产品" note="规格:8mmX10mm" thumbSize="lg" thumb="https://web-assets.dcloud.net.cn/unidoc/zh/unicloudlogo.png" rightText="¥2.60"/>
</div> </div>
<ai-gap h="50"/> <ai-gap h="50"/>
<uni-goods-nav class="fixed-b" @click="handleGoodNav"/> <uni-goods-nav class="fixed-b" @click="handleGoodNav"/>
@@ -13,6 +26,7 @@
<script> <script>
import AiTabs from "../components/AiTabs"; import AiTabs from "../components/AiTabs";
import AiGap from "../components/AiGap"; import AiGap from "../components/AiGap";
import List from "../utils/list";
export default { export default {
name: "home", name: "home",
@@ -21,12 +35,13 @@ export default {
return { return {
indexList: ["全部", "螺丝", "螺母", "平垫", "弹垫", "钢丝绳", "铆钉", "工具", "劳保", "其他"], indexList: ["全部", "螺丝", "螺母", "平垫", "弹垫", "钢丝绳", "铆钉", "工具", "劳保", "其他"],
currentType: 0, currentType: 0,
list: [] products: null,
} }
}, },
methods: { methods: {
getList() { getList() {
this.products = new List("/api/product/list")
this.products.init()
}, },
handleGoodNav() { handleGoodNav() {
@@ -35,15 +50,20 @@ export default {
}, },
handleSearch() { handleSearch() {
},
handleAdd2Cart() {
this.$toast("加入购物车")
},
handleDetail(e) {
console.log(e)
this.$toast("查看详情")
} }
}, },
onShow() { onShow() {
this.current = 1
this.getList() this.getList()
}, },
onReachBottom() { onReachBottom() {
this.current++ this.products?.loadMore()
this.getList()
} }
} }
</script> </script>
@@ -58,6 +78,8 @@ export default {
height: calc(100vh - 100px); height: calc(100vh - 100px);
overflow-y: auto; overflow-y: auto;
font-size: 12px; font-size: 12px;
z-index: 202301111557;
background: #fff;
} }
} }
</style> </style>

View File

@@ -3,7 +3,5 @@ import uni from '@dcloudio/vite-plugin-uni'
export default defineConfig({ export default defineConfig({
optimizeDeps: ['@dcloudio/uni-ui'], optimizeDeps: ['@dcloudio/uni-ui'],
plugins: [ plugins: [uni()],
uni(),
],
}) })