feat:初始提交uni-app项目
This commit is contained in:
141
unpackage/dist/dev/mp-weixin/pages/index/index.js
vendored
Normal file
141
unpackage/dist/dev/mp-weixin/pages/index/index.js
vendored
Normal file
@@ -0,0 +1,141 @@
|
||||
"use strict";
|
||||
const common_vendor = require("../../common/vendor.js");
|
||||
const api_apis = require("../../api/apis.js");
|
||||
if (!Array) {
|
||||
const _easycom_custom_nav_bar2 = common_vendor.resolveComponent("custom-nav-bar");
|
||||
const _easycom_uni_icons2 = common_vendor.resolveComponent("uni-icons");
|
||||
const _easycom_uni_dateformat2 = common_vendor.resolveComponent("uni-dateformat");
|
||||
const _easycom_common_title2 = common_vendor.resolveComponent("common-title");
|
||||
const _easycom_theme_item2 = common_vendor.resolveComponent("theme-item");
|
||||
(_easycom_custom_nav_bar2 + _easycom_uni_icons2 + _easycom_uni_dateformat2 + _easycom_common_title2 + _easycom_theme_item2)();
|
||||
}
|
||||
const _easycom_custom_nav_bar = () => "../../components/custom-nav-bar/custom-nav-bar.js";
|
||||
const _easycom_uni_icons = () => "../../uni_modules/uni-icons/components/uni-icons/uni-icons.js";
|
||||
const _easycom_uni_dateformat = () => "../../uni_modules/uni-dateformat/components/uni-dateformat/uni-dateformat.js";
|
||||
const _easycom_common_title = () => "../../components/common-title/common-title.js";
|
||||
const _easycom_theme_item = () => "../../components/theme-item/theme-item.js";
|
||||
if (!Math) {
|
||||
(_easycom_custom_nav_bar + _easycom_uni_icons + _easycom_uni_dateformat + _easycom_common_title + _easycom_theme_item)();
|
||||
}
|
||||
const _sfc_main = {
|
||||
__name: "index",
|
||||
setup(__props) {
|
||||
const bannerList = common_vendor.ref([]);
|
||||
const randomList = common_vendor.ref([]);
|
||||
const noticeList = common_vendor.ref([]);
|
||||
const classifyList = common_vendor.ref([]);
|
||||
const getBanner = async () => {
|
||||
let res = await api_apis.apiGetBanner();
|
||||
bannerList.value = res.data;
|
||||
};
|
||||
const getDayRandom = async () => {
|
||||
let res = await api_apis.apiGetDayRandom();
|
||||
randomList.value = res.data;
|
||||
};
|
||||
const getNotice = async () => {
|
||||
let res = await api_apis.apiGetNotice({ select: true });
|
||||
noticeList.value = res.data;
|
||||
};
|
||||
const goPreview = (id) => {
|
||||
common_vendor.index.setStorageSync("storgClassList", randomList.value);
|
||||
common_vendor.index.navigateTo({
|
||||
url: "/pages/preview/preview?id=" + id
|
||||
});
|
||||
};
|
||||
const getClassify = async () => {
|
||||
let res = await api_apis.apiGetClassify({
|
||||
select: true
|
||||
});
|
||||
classifyList.value = res.data;
|
||||
};
|
||||
common_vendor.onShareAppMessage((e) => {
|
||||
return {
|
||||
title: "hzb壁纸",
|
||||
path: "/pages/index/index"
|
||||
};
|
||||
});
|
||||
common_vendor.onShareTimeline(() => {
|
||||
return {
|
||||
// 标题
|
||||
title: "hzb壁纸~~~",
|
||||
// 分享时候的图片地址。可以本地也可以网络图
|
||||
imageUrl: "/static/images/logo2.jpg"
|
||||
};
|
||||
});
|
||||
getBanner();
|
||||
getDayRandom();
|
||||
getNotice();
|
||||
getClassify();
|
||||
return (_ctx, _cache) => {
|
||||
return {
|
||||
a: common_vendor.p({
|
||||
title: "推荐"
|
||||
}),
|
||||
b: common_vendor.f(bannerList.value, (item, k0, i0) => {
|
||||
return common_vendor.e({
|
||||
a: item.target == "miniProgram"
|
||||
}, item.target == "miniProgram" ? {
|
||||
b: item.picurl,
|
||||
c: item.url,
|
||||
d: item.appid
|
||||
} : {
|
||||
e: item.picurl,
|
||||
f: `/pages/classlist/classlist?${item.url}`
|
||||
}, {
|
||||
g: item._id
|
||||
});
|
||||
}),
|
||||
c: common_vendor.p({
|
||||
type: "sound-filled",
|
||||
size: "20",
|
||||
color: "#28b389"
|
||||
}),
|
||||
d: common_vendor.f(noticeList.value, (item, k0, i0) => {
|
||||
return {
|
||||
a: common_vendor.t(item.title),
|
||||
b: "/pages/notice/detail?id=" + item._id,
|
||||
c: item._id
|
||||
};
|
||||
}),
|
||||
e: common_vendor.p({
|
||||
type: "forward",
|
||||
size: "20",
|
||||
color: "#28b389"
|
||||
}),
|
||||
f: common_vendor.p({
|
||||
type: "calendar",
|
||||
size: "20",
|
||||
color: "#28b389"
|
||||
}),
|
||||
g: common_vendor.p({
|
||||
date: Date.now(),
|
||||
format: "dd日"
|
||||
}),
|
||||
h: common_vendor.f(randomList.value, (item, k0, i0) => {
|
||||
return {
|
||||
a: item.smallPicurl,
|
||||
b: item._id,
|
||||
c: common_vendor.o(($event) => goPreview(item._id), item._id)
|
||||
};
|
||||
}),
|
||||
i: common_vendor.f(classifyList.value, (item, k0, i0) => {
|
||||
return {
|
||||
a: item._id,
|
||||
b: "1cf27b2a-7-" + i0,
|
||||
c: common_vendor.p({
|
||||
isMore: false,
|
||||
item
|
||||
})
|
||||
};
|
||||
}),
|
||||
j: common_vendor.p({
|
||||
isMore: true
|
||||
})
|
||||
};
|
||||
};
|
||||
}
|
||||
};
|
||||
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-1cf27b2a"]]);
|
||||
_sfc_main.__runtimeHooks = 6;
|
||||
wx.createPage(MiniProgramPage);
|
||||
//# sourceMappingURL=../../../.sourcemap/mp-weixin/pages/index/index.js.map
|
||||
11
unpackage/dist/dev/mp-weixin/pages/index/index.json
vendored
Normal file
11
unpackage/dist/dev/mp-weixin/pages/index/index.json
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
{
|
||||
"navigationBarTitleText": "uni-app",
|
||||
"navigationStyle": "custom",
|
||||
"usingComponents": {
|
||||
"custom-nav-bar": "../../components/custom-nav-bar/custom-nav-bar",
|
||||
"uni-icons": "../../uni_modules/uni-icons/components/uni-icons/uni-icons",
|
||||
"uni-dateformat": "../../uni_modules/uni-dateformat/components/uni-dateformat/uni-dateformat",
|
||||
"common-title": "../../components/common-title/common-title",
|
||||
"theme-item": "../../components/theme-item/theme-item"
|
||||
}
|
||||
}
|
||||
1
unpackage/dist/dev/mp-weixin/pages/index/index.wxml
vendored
Normal file
1
unpackage/dist/dev/mp-weixin/pages/index/index.wxml
vendored
Normal file
@@ -0,0 +1 @@
|
||||
<view class="homeLayout pageBg data-v-1cf27b2a"><custom-nav-bar wx:if="{{a}}" class="data-v-1cf27b2a" u-i="1cf27b2a-0" bind:__l="__l" u-p="{{a}}"></custom-nav-bar><view class="banner data-v-1cf27b2a"><swiper class="data-v-1cf27b2a" indicator-dots="{{true}}" circular="{{true}}" indicator-color="rgba(255,255,255,0.5)" indicator-active-color="#fff" autoplay="{{true}}"><swiper-item wx:for="{{b}}" wx:for-item="item" wx:key="g" class="data-v-1cf27b2a"><navigator wx:if="{{item.a}}" class="like data-v-1cf27b2a" url="{{item.c}}" target="miniProgram" app-id="{{item.d}}"><image class="data-v-1cf27b2a" src="{{item.b}}" mode="aspectFill"></image></navigator><navigator wx:else url="{{item.f}}" class="like data-v-1cf27b2a"><image class="data-v-1cf27b2a" src="{{item.e}}" mode="aspectFill"></image></navigator></swiper-item></swiper></view><view class="notice data-v-1cf27b2a"><view class="left data-v-1cf27b2a"><uni-icons wx:if="{{c}}" class="data-v-1cf27b2a" u-i="1cf27b2a-1" bind:__l="__l" u-p="{{c}}"></uni-icons><text class="text data-v-1cf27b2a">公告</text></view><view class="center data-v-1cf27b2a"><swiper class="data-v-1cf27b2a" vertical="{{true}}" autoplay="{{true}}" interval="1500" duration="300" circular="{{true}}"><swiper-item wx:for="{{d}}" wx:for-item="item" wx:key="c" class="data-v-1cf27b2a"><navigator class="data-v-1cf27b2a" url="{{item.b}}">{{item.a}}</navigator></swiper-item></swiper></view><view class="right data-v-1cf27b2a"><uni-icons wx:if="{{e}}" class="data-v-1cf27b2a" u-i="1cf27b2a-2" bind:__l="__l" u-p="{{e}}"></uni-icons></view></view><view class="select data-v-1cf27b2a"><common-title class="data-v-1cf27b2a" u-s="{{['name','custom']}}" u-i="1cf27b2a-3" bind:__l="__l"><view slot="name">每日推荐</view><view class="date data-v-1cf27b2a" slot="custom"><uni-icons wx:if="{{f}}" class="data-v-1cf27b2a" u-i="1cf27b2a-4,1cf27b2a-3" bind:__l="__l" u-p="{{f}}"></uni-icons><view class="text data-v-1cf27b2a"><uni-dateformat wx:if="{{g}}" class="data-v-1cf27b2a" u-i="1cf27b2a-5,1cf27b2a-3" bind:__l="__l" u-p="{{g}}"></uni-dateformat></view></view></common-title><view class="content data-v-1cf27b2a"><scroll-view class="data-v-1cf27b2a" scroll-x="{{true}}"><view wx:for="{{h}}" wx:for-item="item" wx:key="b" class="box data-v-1cf27b2a" bindtap="{{item.c}}"><image class="data-v-1cf27b2a" src="{{item.a}}" mode="aspectFill"></image></view></scroll-view></view></view><view class="theme data-v-1cf27b2a"><common-title class="data-v-1cf27b2a" u-s="{{['name','custom']}}" u-i="1cf27b2a-6" bind:__l="__l"><view slot="name">专题精选</view><view slot="custom"><navigator url="/pages/classify/classify" class="more data-v-1cf27b2a" open-type="reLaunch">More+</navigator></view></common-title><view class="content data-v-1cf27b2a"><theme-item wx:for="{{i}}" wx:for-item="item" wx:key="a" class="data-v-1cf27b2a" u-i="{{item.b}}" bind:__l="__l" u-p="{{item.c}}"></theme-item><theme-item wx:if="{{j}}" class="data-v-1cf27b2a" u-i="1cf27b2a-8" bind:__l="__l" u-p="{{j}}"></theme-item></view></view></view>
|
||||
130
unpackage/dist/dev/mp-weixin/pages/index/index.wxss
vendored
Normal file
130
unpackage/dist/dev/mp-weixin/pages/index/index.wxss
vendored
Normal file
@@ -0,0 +1,130 @@
|
||||
/**
|
||||
* 这里是uni-app内置的常用样式变量
|
||||
*
|
||||
* uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量
|
||||
* 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App
|
||||
*
|
||||
*/
|
||||
/**
|
||||
* 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能
|
||||
*
|
||||
* 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件
|
||||
*/
|
||||
/* 颜色变量 */
|
||||
/* 行为相关颜色 */
|
||||
/* 文字基本颜色 */
|
||||
/* 背景颜色 */
|
||||
/* 边框颜色 */
|
||||
/* 尺寸变量 */
|
||||
/* 文字尺寸 */
|
||||
/* 图片尺寸 */
|
||||
/* Border Radius */
|
||||
/* 水平间距 */
|
||||
/* 垂直间距 */
|
||||
/* 透明度 */
|
||||
/* 文章场景相关 */
|
||||
.homeLayout .banner.data-v-1cf27b2a {
|
||||
width: 750rpx;
|
||||
padding: 30rpx 0;
|
||||
}
|
||||
.homeLayout .banner swiper.data-v-1cf27b2a {
|
||||
width: 750rpx;
|
||||
height: 340rpx;
|
||||
}
|
||||
.homeLayout .banner swiper swiper-item.data-v-1cf27b2a {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
padding: 0 30rpx;
|
||||
}
|
||||
.homeLayout .banner swiper swiper-item .like.data-v-1cf27b2a {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
.homeLayout .banner swiper swiper-item .like image.data-v-1cf27b2a {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
border-radius: 10rpx;
|
||||
}
|
||||
.homeLayout .notice.data-v-1cf27b2a {
|
||||
width: 690rpx;
|
||||
margin: 0 auto;
|
||||
height: 80rpx;
|
||||
background: #f9f9f9;
|
||||
line-height: 80rpx;
|
||||
border-radius: 80rpx;
|
||||
display: flex;
|
||||
}
|
||||
.homeLayout .notice .left.data-v-1cf27b2a {
|
||||
width: 140rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
.homeLayout .notice .left .text.data-v-1cf27b2a {
|
||||
color: #000;
|
||||
font-size: 28rpx;
|
||||
font-weight: 600;
|
||||
}
|
||||
.homeLayout .notice .center.data-v-1cf27b2a {
|
||||
flex: 1;
|
||||
}
|
||||
.homeLayout .notice .center swiper.data-v-1cf27b2a {
|
||||
height: 100%;
|
||||
}
|
||||
.homeLayout .notice .center swiper swiper-item.data-v-1cf27b2a {
|
||||
height: 100%;
|
||||
font-size: 30rpx;
|
||||
color: #666;
|
||||
overflow: hidden;
|
||||
white-space: nowrap;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
.homeLayout .notice .right.data-v-1cf27b2a {
|
||||
width: 70rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
.homeLayout .select.data-v-1cf27b2a {
|
||||
padding-top: 50rpx;
|
||||
}
|
||||
.homeLayout .select .date.data-v-1cf27b2a {
|
||||
color: #28B389;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
.homeLayout .select .content.data-v-1cf27b2a {
|
||||
width: 720rpx;
|
||||
margin-left: 30rpx;
|
||||
margin-top: 30rpx;
|
||||
}
|
||||
.homeLayout .select .content scroll-view.data-v-1cf27b2a {
|
||||
white-space: nowrap;
|
||||
}
|
||||
.homeLayout .select .content scroll-view .box.data-v-1cf27b2a {
|
||||
display: inline-block;
|
||||
width: 200rpx;
|
||||
height: 430rpx;
|
||||
margin-right: 15rpx;
|
||||
}
|
||||
.homeLayout .select .content scroll-view .box image.data-v-1cf27b2a {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
.homeLayout .select .content scroll-view .box.data-v-1cf27b2a:last-child {
|
||||
margin-right: 30rpx;
|
||||
}
|
||||
.homeLayout .theme.data-v-1cf27b2a {
|
||||
padding: 50rpx 0;
|
||||
}
|
||||
.homeLayout .theme .more.data-v-1cf27b2a {
|
||||
font-size: 32rpx;
|
||||
color: #888;
|
||||
}
|
||||
.homeLayout .theme .content.data-v-1cf27b2a {
|
||||
margin-top: 30rpx;
|
||||
padding: 0 30rpx;
|
||||
display: grid;
|
||||
grid-template-columns: repeat(3, 1fr);
|
||||
gap: 15rpx;
|
||||
}
|
||||
Reference in New Issue
Block a user