first commit

This commit is contained in:
PC-202306242200\Administrator
2026-03-28 23:10:55 +08:00
commit 1c24452b6c
1735 changed files with 150474 additions and 0 deletions

View File

@@ -0,0 +1,118 @@
"use strict";
const common_vendor = require("../../common/vendor.js");
const api_index = require("../../api/index.js");
if (!Array) {
const _easycom_wd_search2 = common_vendor.resolveComponent("wd-search");
const _easycom_z_paging2 = common_vendor.resolveComponent("z-paging");
(_easycom_wd_search2 + _easycom_z_paging2)();
}
const _easycom_wd_search = () => "../../uni_modules/wot-design-uni/components/wd-search/wd-search.js";
const _easycom_z_paging = () => "../../uni_modules/z-paging/components/z-paging/z-paging.js";
if (!Math) {
(_easycom_wd_search + _easycom_z_paging)();
}
const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
__name: "cate",
setup(__props) {
const current = common_vendor.ref(0);
const goodsCate = common_vendor.ref([]);
common_vendor.ref([]);
const paging = common_vendor.ref(null);
const dataList = common_vendor.ref([]);
const goodsCateId = common_vendor.ref(null);
const name = common_vendor.ref("");
common_vendor.onLoad(() => {
api_index.api.goodsCate().then((res) => {
goodsCate.value = res.list;
goodsCateId.value = res.list[0].id;
});
});
const queryList = (pageNo, pageSize) => {
if (!goodsCateId.value) {
api_index.api.goodsCate().then((res) => {
goodsCate.value = res.list;
goodsCateId.value = res.list[0].id;
api_index.api.goodsPage({ pageNo, pageSize, categoryId: goodsCateId.value, name: name.value }).then((res2) => {
paging.value.complete(res2.list);
}).catch((res2) => {
paging.value.complete(false);
});
});
} else {
api_index.api.goodsPage({ pageNo, pageSize, categoryId: goodsCateId.value, name: name.value }).then((res) => {
paging.value.complete(res.list);
}).catch((res) => {
paging.value.complete(false);
});
}
};
const toGoods = (e) => {
common_vendor.index.navigateTo({
url: `/pages/goods/goods?id=${e}`
});
};
const clear = () => {
name.value = "";
paging.value.reload();
};
const search = (e) => {
name.value = e.value;
paging.value.reload();
};
let swichMenu = (index, id) => {
current.value = index;
goodsCateId.value = id;
paging.value.reload();
};
return (_ctx, _cache) => {
return {
a: common_vendor.o(search),
b: common_vendor.o(clear),
c: common_vendor.p({
["placeholder-left"]: true,
placeholder: "搜一搜药品名称",
["hide-cancel"]: true,
customStyle: {
background: "#799675",
height: "80rpx"
}
}),
d: common_vendor.f(goodsCate.value, (item, index, i0) => {
return {
a: common_vendor.t(item.name),
b: index,
c: common_vendor.n(current.value == index ? "u-tab-item-active" : ""),
d: index,
e: common_vendor.o(($event) => common_vendor.unref(swichMenu)(index, item.id), index)
};
}),
e: common_vendor.f(dataList.value, (item, index, i0) => {
return {
a: item.cover,
b: common_vendor.t(item.name),
c: common_vendor.t(item.specs),
d: common_vendor.t(item.currentPrice),
e: common_vendor.t(item.originalPrice),
f: index,
g: common_vendor.o(($event) => toGoods(item.id), index)
};
}),
f: common_vendor.sr(paging, "7db0ce29-1", {
"k": "paging"
}),
g: common_vendor.o(queryList),
h: common_vendor.o(($event) => dataList.value = $event),
i: common_vendor.p({
["use-page-scroll"]: true,
["paging-style"]: {
"background-color": "#FFF"
},
modelValue: dataList.value
})
};
};
}
});
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-7db0ce29"]]);
wx.createPage(MiniProgramPage);
//# sourceMappingURL=../../../.sourcemap/mp-weixin/pages/cate/cate.js.map

View File

@@ -0,0 +1,8 @@
{
"navigationBarTitleText": "",
"navigationBarBackgroundColor": "#799675",
"usingComponents": {
"wd-search": "../../uni_modules/wot-design-uni/components/wd-search/wd-search",
"z-paging": "../../uni_modules/z-paging/components/z-paging/z-paging"
}
}

View File

@@ -0,0 +1 @@
<view class="u-wrap data-v-7db0ce29"><wd-search wx:if="{{c}}" class="data-v-7db0ce29" bindsearch="{{a}}" bindclear="{{b}}" u-i="7db0ce29-0" bind:__l="__l" u-p="{{c}}"/><view class="u-menu-wrap data-v-7db0ce29"><scroll-view scroll-y scroll-with-animation class="u-tab-view menu-scroll-view data-v-7db0ce29"><view wx:for="{{d}}" wx:for-item="item" wx:key="b" class="{{['u-tab-item', 'data-v-7db0ce29', item.c]}}" data-current="{{item.d}}" catchtap="{{item.e}}"><text class="u-line-1 data-v-7db0ce29">{{item.a}}</text></view></scroll-view><z-paging wx:if="{{i}}" class="r data-v-7db0ce29" u-s="{{['d']}}" u-r="paging" bindquery="{{g}}" u-i="7db0ce29-1" bind:__l="__l" bindupdateModelValue="{{h}}" u-p="{{i}}"><view class="right-box data-v-7db0ce29"><view class="page-view data-v-7db0ce29"><view wx:for="{{e}}" wx:for-item="item" wx:key="f" class="page-view_item data-v-7db0ce29" bindtap="{{item.g}}"><image class="data-v-7db0ce29" src="{{item.a}}" mode="aspectFill"></image><view class="data-v-7db0ce29" style="flex:1"><view class="page-view_item_title data-v-7db0ce29">{{item.b}}</view><view class="page-view_item_info data-v-7db0ce29">{{item.c}}</view><view class="page-view_item_price data-v-7db0ce29"><view class="page-view_item_price_left data-v-7db0ce29">¥{{item.d}}</view><view class="page-view_item_price_right data-v-7db0ce29">¥{{item.e}}</view></view></view></view></view></view></z-paging></view></view>

View File

@@ -0,0 +1,139 @@
/* 水平间距 */
/* 水平间距 */
.u-wrap.data-v-7db0ce29 {
height: 100vh;
display: flex;
flex-direction: column;
}
.u-search-box.data-v-7db0ce29 {
padding: 18rpx 30rpx;
}
.u-menu-wrap.data-v-7db0ce29 {
flex: 1;
display: flex;
overflow: hidden;
}
.u-search-inner.data-v-7db0ce29 {
background-color: #eaeaea;
border-radius: 100rpx;
display: flex;
align-items: center;
padding: 10rpx 16rpx;
}
.u-search-text.data-v-7db0ce29 {
font-size: 26rpx;
color: #799675;
margin-left: 10rpx;
}
.u-tab-view.data-v-7db0ce29 {
width: 200rpx;
height: 100%;
}
.u-tab-item.data-v-7db0ce29 {
height: 110rpx;
background: #f6f6f6;
box-sizing: border-box;
display: flex;
align-items: center;
justify-content: center;
font-size: 26rpx;
color: #444;
font-weight: 400;
line-height: 1;
}
.u-tab-item-active.data-v-7db0ce29 {
position: relative;
color: #799675;
font-size: 30rpx;
font-weight: 600;
background: #fff;
}
.u-tab-item-active.data-v-7db0ce29::before {
content: "";
position: absolute;
border-left: 4px solid #799675;
height: 32rpx;
left: 0;
top: 39rpx;
}
.u-tab-view.data-v-7db0ce29 {
height: 100%;
}
.right-box.data-v-7db0ce29 {
width: 550rpx;
flex: 1;
background-color: #fff;
}
.page-view.data-v-7db0ce29 {
padding: 16rpx;
}
.page-view_item.data-v-7db0ce29 {
display: flex;
align-items: center;
margin-bottom: 25rpx;
}
.page-view_item image.data-v-7db0ce29 {
width: 160rpx;
height: 160rpx;
margin-right: 22rpx;
border-radius: 18rpx;
}
.page-view_item_title.data-v-7db0ce29 {
font-size: 28rpx;
font-weight: bold;
color: #232323;
}
.page-view_item_info.data-v-7db0ce29 {
font-weight: 400;
font-size: 24rpx;
color: #232323;
margin: 20rpx 0;
}
.page-view_item_price.data-v-7db0ce29 {
display: flex;
align-items: center;
}
.page-view_item_price_left.data-v-7db0ce29 {
font-weight: bold;
font-size: 38rpx;
color: #ff2929;
margin-right: 35rpx;
}
.page-view_item_price_right.data-v-7db0ce29 {
font-size: 24rpx;
color: #999999;
-webkit-text-decoration-line: line-through;
text-decoration-line: line-through;
}
.class-item.data-v-7db0ce29 {
margin-bottom: 30rpx;
background-color: #fff;
padding: 16rpx;
border-radius: 8rpx;
}
.item-title.data-v-7db0ce29 {
font-size: 26rpx;
color: #000;
font-weight: bold;
}
.item-menu-name.data-v-7db0ce29 {
font-weight: normal;
font-size: 24rpx;
color: #000;
}
.item-container.data-v-7db0ce29 {
display: flex;
flex-wrap: wrap;
}
.thumb-box.data-v-7db0ce29 {
width: 33.333333%;
display: flex;
align-items: center;
justify-content: center;
flex-direction: column;
margin-top: 20rpx;
}
.item-menu-image.data-v-7db0ce29 {
width: 120rpx;
height: 120rpx;
}