上传代码
This commit is contained in:
139
uniapp04/unpackage/dist/dev/mp-alipay/pages/index/index.acss
vendored
Normal file
139
uniapp04/unpackage/dist/dev/mp-alipay/pages/index/index.acss
vendored
Normal file
@ -0,0 +1,139 @@
|
||||
/**
|
||||
* 这里是uni-app内置的常用样式变量
|
||||
*
|
||||
* uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量
|
||||
* 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App
|
||||
*
|
||||
*/
|
||||
/**
|
||||
* 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能
|
||||
*
|
||||
* 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件
|
||||
*/
|
||||
/* 颜色变量 */
|
||||
/* 行为相关颜色 */
|
||||
/* 文字基本颜色 */
|
||||
/* 背景颜色 */
|
||||
/* 边框颜色 */
|
||||
/* 尺寸变量 */
|
||||
/* 文字尺寸 */
|
||||
/* 图片尺寸 */
|
||||
/* Border Radius */
|
||||
/* 水平间距 */
|
||||
/* 垂直间距 */
|
||||
/* 透明度 */
|
||||
/* 文章场景相关 */
|
||||
.navbar {
|
||||
background-color: #4095e5;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
padding: 10px;
|
||||
}
|
||||
.navbar .search {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding: 0 10rpx 0 26rpx;
|
||||
height: 0.64rem;
|
||||
color: #fff;
|
||||
font-size: 28rpx;
|
||||
border-radius: 32rpx;
|
||||
background-color: rgba(255, 255, 255, 0.5);
|
||||
width: 70%;
|
||||
margin: 0 auto;
|
||||
}
|
||||
.navbar .icon-search {
|
||||
margin-right: 10rpx;
|
||||
}
|
||||
.navbar .search-button {
|
||||
margin-left: auto;
|
||||
height: 0.64rem;
|
||||
background-color: #fff;
|
||||
color: #4095e5;
|
||||
border: none;
|
||||
border-radius: 32rpx;
|
||||
padding: 0 20rpx;
|
||||
line-height: 0.64rem;
|
||||
font-size: 15px;
|
||||
}
|
||||
.navbar .transparent-input {
|
||||
background-color: transparent;
|
||||
border: none;
|
||||
color: #fff;
|
||||
outline: none;
|
||||
width: 100%;
|
||||
padding: 0 10rpx;
|
||||
font-size: 28rpx;
|
||||
}
|
||||
.navigator,
|
||||
.image {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
.category {
|
||||
margin: 20rpx 0 0;
|
||||
padding: 10rpx 0;
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
min-height: 1.5rem;
|
||||
}
|
||||
.category .category-item {
|
||||
width: 150rpx;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
.category .category-item .icon {
|
||||
width: 80rpx;
|
||||
height: 80rpx;
|
||||
margin-bottom: 5px;
|
||||
}
|
||||
.category .category-item .text {
|
||||
font-size: 26rpx;
|
||||
color: #111;
|
||||
}
|
||||
.IPtext {
|
||||
font-size: 28rpx;
|
||||
}
|
||||
.notice {
|
||||
height: 40px;
|
||||
}
|
||||
|
||||
/* 取餐吗 */
|
||||
.content {
|
||||
position: relative;
|
||||
}
|
||||
.movableArea {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
pointer-events: none;
|
||||
z-index: 999;
|
||||
}
|
||||
.movableView {
|
||||
pointer-events: auto;
|
||||
width: 60rpx;
|
||||
height: 60rpx;
|
||||
padding: 10rpx;
|
||||
border-radius: 100%;
|
||||
border: 2px solid #33A3DC;
|
||||
background-color: #eed43e;
|
||||
}
|
||||
.iconImage {
|
||||
display: block;
|
||||
width: 60rpx;
|
||||
height: 60rpx;
|
||||
}
|
||||
.contact {
|
||||
width: 50px;
|
||||
height: 50px;
|
||||
overflow: hidden;
|
||||
position: absolute;
|
||||
left: 0px;
|
||||
top: 0px;
|
||||
border-radius: 100%;
|
||||
opacity: 0;
|
||||
}
|
1
uniapp04/unpackage/dist/dev/mp-alipay/pages/index/index.axml
vendored
Normal file
1
uniapp04/unpackage/dist/dev/mp-alipay/pages/index/index.axml
vendored
Normal file
@ -0,0 +1 @@
|
||||
<view class="notice"><uni-notice-bar u-i="40416b23-0" onVI="__l" u-p="{{a||''}}"/></view><scroll-view refresher-enabled scroll-y><view class="navbar"><view class="search"><text class="icon-search" onTap="{{b}}"> 搜索店铺 </text></view><navigator url="/pages/messageCenter/messageCenter"><uni-icons class="talk" u-i="40416b23-1" onVI="__l" u-p="{{c||''}}"></uni-icons></navigator></view><view class="swiperPicture"><swiper circular="{{true}}" autoplay="{{true}}" interval="{{3000}}" indicator-dots><swiper-item><navigator class="navigator"><image mode="aspectFill" class="image" src="{{d}}"></image></navigator></swiper-item><swiper-item><navigator class="navigator"><image mode="aspectFill" class="image" src="{{e}}"></image></navigator></swiper-item><swiper-item><navigator class="navigator"><image mode="aspectFill" class="image" src="{{f}}"></image></navigator></swiper-item></swiper></view><view class="category"><view a:for="{{g}}" a:for-item="item" a:key="d" class="category-item" url="{{item.c}}" onTap="{{item.e}}"><image class="icon" src="{{item.a}}"></image><text>{{item.b}}</text></view></view><recommend u-i="40416b23-2" onVI="__l"></recommend><view class="content"><movable-area class="movableArea"><movable-view class="movableView" x="{{i}}" y="{{j}}" direction="{{k}}" damping="{{l}}" onChange="{{m}}" onTap="{{n}}" onTouchEnd="{{o}}"><image src="{{h}}" mode="widthFix" class="iconImage"></image></movable-view></movable-area></view></scroll-view>
|
208
uniapp04/unpackage/dist/dev/mp-alipay/pages/index/index.js
vendored
Normal file
208
uniapp04/unpackage/dist/dev/mp-alipay/pages/index/index.js
vendored
Normal file
@ -0,0 +1,208 @@
|
||||
"use strict";
|
||||
const common_vendor = require("../../common/vendor.js");
|
||||
const common_assets = require("../../common/assets.js");
|
||||
const API_api = require("../../API/api.js");
|
||||
if (!Array) {
|
||||
const _easycom_uni_notice_bar2 = common_vendor.resolveComponent("uni-notice-bar");
|
||||
const _easycom_uni_icons2 = common_vendor.resolveComponent("uni-icons");
|
||||
(_easycom_uni_notice_bar2 + _easycom_uni_icons2)();
|
||||
}
|
||||
const _easycom_uni_notice_bar = () => "../../uni_modules/uni-notice-bar/components/uni-notice-bar/uni-notice-bar.js";
|
||||
const _easycom_uni_icons = () => "../../uni_modules/uni-icons/components/uni-icons/uni-icons.js";
|
||||
if (!Math) {
|
||||
(_easycom_uni_notice_bar + _easycom_uni_icons + common_vendor.unref(recommend))();
|
||||
}
|
||||
const recommend = () => "../recommend/recommend.js";
|
||||
const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
|
||||
__name: "index",
|
||||
props: {
|
||||
damping: {
|
||||
type: Number,
|
||||
default: 10
|
||||
},
|
||||
direction: {
|
||||
type: String,
|
||||
default: "all"
|
||||
},
|
||||
position: {
|
||||
type: Number,
|
||||
default: 4
|
||||
}
|
||||
},
|
||||
setup(__props) {
|
||||
const meishi = common_vendor.ref("");
|
||||
const getCategoryList = () => {
|
||||
common_vendor.index.request({
|
||||
url: API_api.apiImageUrl + "/api/category/list",
|
||||
method: "GET",
|
||||
success(res) {
|
||||
console.log(res.data.data);
|
||||
meishi.value = res.data.data;
|
||||
},
|
||||
fail(err) {
|
||||
console.log(err);
|
||||
}
|
||||
});
|
||||
};
|
||||
common_vendor.onMounted(() => {
|
||||
getCategoryList();
|
||||
});
|
||||
const categorySort = (id) => {
|
||||
console.log(id);
|
||||
const pageRoutes = {
|
||||
1: "/pages/food/food",
|
||||
2: "/pages/drinks/drinks",
|
||||
3: "/pages/fruits/fruits",
|
||||
4: "/pages/points/points",
|
||||
5: "/pages/more/more"
|
||||
};
|
||||
if (pageRoutes[id]) {
|
||||
common_vendor.index.navigateTo({
|
||||
url: pageRoutes[id]
|
||||
});
|
||||
} else {
|
||||
console.warn("No matching page for id:", id);
|
||||
}
|
||||
};
|
||||
const systemList = common_vendor.ref([]);
|
||||
const lastSystemItem = common_vendor.computed(() => systemList.value[systemList.value.length - 1]);
|
||||
const system = () => {
|
||||
common_vendor.index.request({
|
||||
url: API_api.apiImageUrl + "/api/system/list",
|
||||
method: "POST",
|
||||
data: {
|
||||
type: 0
|
||||
},
|
||||
success(res) {
|
||||
systemList.value = res.data.data;
|
||||
console.log(systemList.value);
|
||||
},
|
||||
fail() {
|
||||
console.log("失败啦");
|
||||
}
|
||||
});
|
||||
};
|
||||
common_vendor.onMounted(system);
|
||||
common_vendor.ref(0);
|
||||
const goSearch = () => {
|
||||
common_vendor.index.navigateTo({
|
||||
url: "/pages/goSearch/goSearch"
|
||||
});
|
||||
};
|
||||
const props = __props;
|
||||
const state = common_vendor.reactive({
|
||||
x: 0,
|
||||
y: 0,
|
||||
x1: 0,
|
||||
x2: 0,
|
||||
y1: 0,
|
||||
y2: 0,
|
||||
move: {
|
||||
x: 0,
|
||||
y: 0
|
||||
}
|
||||
});
|
||||
common_vendor.onMounted(() => {
|
||||
common_vendor.index.getSystemInfo({
|
||||
success: (res) => {
|
||||
state.x1 = 0;
|
||||
state.x2 = parseInt(res.windowWidth) - 50;
|
||||
state.y1 = 0;
|
||||
state.y2 = parseInt(res.windowHeight) - 20;
|
||||
setTimeout(() => {
|
||||
if ([1, 2].includes(props.position))
|
||||
state.y = parseInt(state.y2 * 0.2);
|
||||
if ([3, 4].includes(props.position))
|
||||
state.y = parseInt(state.y2 * 0.8);
|
||||
if ([1, 3].includes(props.position))
|
||||
state.x = parseInt(state.x1);
|
||||
if ([2, 4].includes(props.position))
|
||||
state.x = parseInt(state.x2);
|
||||
state.move.x = state.x;
|
||||
state.move.y = state.y;
|
||||
}, 1e3);
|
||||
}
|
||||
});
|
||||
});
|
||||
function onChange(e) {
|
||||
if (e.detail.source === "touch") {
|
||||
state.move.x = e.detail.x;
|
||||
state.move.y = e.detail.y;
|
||||
}
|
||||
}
|
||||
function onTap(e) {
|
||||
console.log("Tap event");
|
||||
common_vendor.index.navigateTo({
|
||||
url: "/pages/testFive/testFive"
|
||||
});
|
||||
}
|
||||
function onTouchend() {
|
||||
state.x = state.move.x;
|
||||
state.y = state.move.y;
|
||||
setTimeout(() => {
|
||||
if (state.move.x < state.x2 / 2)
|
||||
state.x = state.x1;
|
||||
else
|
||||
state.x = state.x2;
|
||||
console.log("yuan" + state.x, state.y);
|
||||
}, 100);
|
||||
}
|
||||
const getloginUser = () => {
|
||||
const user = common_vendor.index.getStorageSync("userInfo");
|
||||
console.log(user);
|
||||
if (user == "") {
|
||||
common_vendor.index.showToast({
|
||||
title: "去登录",
|
||||
duration: 2e3
|
||||
});
|
||||
}
|
||||
};
|
||||
const getStaticImage = (categoryId) => {
|
||||
const imageMap = {
|
||||
1: "/static/cartory/1.png",
|
||||
// 注意这里改为 cartory
|
||||
2: "/static/cartory/2.png",
|
||||
3: "/static/cartory/3.png",
|
||||
4: "/static/cartory/4.png",
|
||||
5: "/static/cartory/5.png"
|
||||
};
|
||||
return imageMap[categoryId] || "/static/cartory/1.png";
|
||||
};
|
||||
common_vendor.onMounted(getloginUser);
|
||||
return (_ctx, _cache) => {
|
||||
return {
|
||||
a: common_vendor.p({
|
||||
["show-icon"]: true,
|
||||
scrollable: true,
|
||||
text: lastSystemItem.value.content
|
||||
}),
|
||||
b: common_vendor.o(goSearch),
|
||||
c: common_vendor.p({
|
||||
type: "chat-filled",
|
||||
size: "30"
|
||||
}),
|
||||
d: common_assets._imports_0,
|
||||
e: common_assets._imports_1,
|
||||
f: common_assets._imports_2,
|
||||
g: common_vendor.f(meishi.value, (item, index, i0) => {
|
||||
return {
|
||||
a: getStaticImage(item.id),
|
||||
b: common_vendor.t(item.name),
|
||||
c: item.url,
|
||||
d: index,
|
||||
e: common_vendor.o(($event) => categorySort(item.id))
|
||||
};
|
||||
}),
|
||||
h: common_assets._imports_3,
|
||||
i: state.x,
|
||||
j: state.y,
|
||||
k: props.direction,
|
||||
l: props.damping,
|
||||
m: common_vendor.o(onChange),
|
||||
n: common_vendor.o(onTap),
|
||||
o: common_vendor.o(onTouchend)
|
||||
};
|
||||
};
|
||||
}
|
||||
});
|
||||
my.createPage(_sfc_main);
|
9
uniapp04/unpackage/dist/dev/mp-alipay/pages/index/index.json
vendored
Normal file
9
uniapp04/unpackage/dist/dev/mp-alipay/pages/index/index.json
vendored
Normal file
@ -0,0 +1,9 @@
|
||||
{
|
||||
"defaultTitle": "首页",
|
||||
"titleBarColor": "#4095e5",
|
||||
"usingComponents": {
|
||||
"uni-notice-bar": "../../uni_modules/uni-notice-bar/components/uni-notice-bar/uni-notice-bar",
|
||||
"uni-icons": "../../uni_modules/uni-icons/components/uni-icons/uni-icons",
|
||||
"recommend": "../recommend/recommend"
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user