소스 검색

初始化

maxiaoxiao 8 달 전
커밋
f2c59552c3

+ 46 - 0
App.uvue

@@ -0,0 +1,46 @@
+<script lang="uts">
+	let firstBackTime = 0
+	export default {
+		onLaunch: function () {
+			console.log('App Launch')
+		},
+		onShow: function () {
+			console.log('App Show')
+		},
+		onHide: function () {
+			console.log('App Hide')
+		},
+		// #ifdef APP-ANDROID
+		onLastPageBackPress: function () {
+			console.log('App LastPageBackPress')
+			if (firstBackTime == 0) {
+				uni.showToast({
+					title: '再按一次退出应用',
+					position: 'bottom',
+				})
+				firstBackTime = Date.now()
+				setTimeout(() => {
+					firstBackTime = 0
+				}, 2000)
+			} else if (Date.now() - firstBackTime < 2000) {
+				firstBackTime = Date.now()
+				uni.exit()
+			}
+		},
+		// #endif
+		onExit: function () {
+			console.log('App Exit')
+		},
+	}
+</script>
+
+<style>
+	/*每个页面公共css */
+	.uni-row {
+		flex-direction: row;
+	}
+
+	.uni-column {
+		flex-direction: column;
+	}
+</style>

+ 93 - 0
api/apis.js

@@ -0,0 +1,93 @@
+import {request} from "@/utils/request.js"
+
+export function apiGetBanner(){
+	return request({
+		url:"/homeBanner"		
+	})	
+}
+
+export function apiGetDayRandom(){
+	return request({url:"/randomWall"})
+}
+
+export function apiGetNotice(data={}){
+	return request({
+		url:"/wallNewsList",
+		data
+	})
+}
+
+
+export function apiGetClassify(data={}){
+	return request({
+		url:"/classify",
+		data
+	})
+}
+
+
+
+export function apiGetClassList(data={}){
+	return request({
+		url:"/wallList",
+		data
+	})
+}
+
+
+export function apiGetSetupScore(data={}){
+	return request({
+		url:"/setupScore",
+		data
+	})
+}
+
+
+export function apiWriteDownload(data={}){
+	return request({
+		url:"/downloadWall",
+		data
+	})
+}
+
+
+
+export function apiDetailWall(data={}){
+	return request({
+		url:"/detailWall",
+		data
+	})
+}
+
+
+export function apiUserInfo(data={}){
+	return request({
+		url:"/userInfo",
+		data
+	})
+}
+
+
+export function apiGetHistoryList(data={}){
+	return request({
+		url:"/userWallList",
+		data
+	})
+}
+
+
+
+export function apiNoticeDetail(data={}){
+	return request({
+		url:"/wallNewsDetail",
+		data
+	})
+}
+
+
+export function apiSearchData(data={}){
+	return request({
+		url:"/searchWall",
+		data
+	})
+}

+ 20 - 0
index.html

@@ -0,0 +1,20 @@
+<!DOCTYPE html>
+<html lang="en">
+	<head>
+		<meta charset="UTF-8" />
+		<script>
+			var coverSupport = 'CSS' in window && typeof CSS.supports === 'function' && (CSS.supports('top: env(a)') ||
+				CSS.supports('top: constant(a)'))
+			document.write(
+				'<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0' +
+				(coverSupport ? ', viewport-fit=cover' : '') + '" />')
+		</script>
+		<title></title>
+		<!--preload-links-->
+		<!--app-context-->
+	</head>
+	<body>
+		<div id="app"><!--app-html--></div>
+		<script type="module" src="/main"></script>
+	</body>
+</html>

+ 9 - 0
main.uts

@@ -0,0 +1,9 @@
+import App from './App.uvue'
+
+import { createSSRApp } from 'vue'
+export function createApp() {
+	const app = createSSRApp(App)
+	return {
+		app
+	}
+}

+ 44 - 0
manifest.json

@@ -0,0 +1,44 @@
+{
+    "name" : "demoq",
+    "appid" : "__UNI__B8FCDB7",
+    "description" : "",
+    "versionName" : "1.0.0",
+    "versionCode" : "100",
+    "uni-app-x" : {},
+    /* 快应用特有相关 */
+    "quickapp" : {},
+    /* 小程序特有相关 */
+    "mp-weixin" : {
+        "appid" : "wxeeae42dfbd21bf46",
+        "setting" : {
+            "urlCheck" : false,
+			"minified" : true
+        },
+        "usingComponents" : true
+    },
+    "mp-alipay" : {
+        "usingComponents" : true
+    },
+    "mp-baidu" : {
+        "usingComponents" : true
+    },
+    "mp-toutiao" : {
+        "usingComponents" : true
+    },
+    "uniStatistics" : {
+        "enable" : false
+    },
+    "vueVersion" : "3",
+    "app" : {
+        "distribute" : {
+            "icons" : {
+                "android" : {
+                    "hdpi" : "",
+                    "xhdpi" : "",
+                    "xxhdpi" : "",
+                    "xxxhdpi" : ""
+                }
+            }
+        }
+    }
+}

+ 39 - 0
pages.json

@@ -0,0 +1,39 @@
+{
+	"pages": [ //pages数组中第一项表示应用启动页,参考:https://uniapp.dcloud.io/collocation/pages
+		{
+			"path": "pages/index/index",
+			"style": {
+				"navigationBarTitleText": "uni-app x"
+			}
+		}
+	],
+	"tabBar": {
+			"color": "#9799a5",
+			"selectedColor": "#28B389",
+			"list": [
+				{
+					"text": "推荐",
+					"pagePath": "pages/index/index",
+					"iconPath": "static/images/tabBar/home.png",
+					"selectedIconPath": "static/images/tabBar/home-h.png"
+				},{
+					"text": "分类",
+					"pagePath": "pages/classify/classify",
+					"iconPath": "static/images/tabBar/classify.png",
+					"selectedIconPath": "static/images/tabBar/classify-h.png"
+				},{
+					"text": "我的",
+					"pagePath": "pages/user/user",
+					"iconPath": "static/images/tabBar/user.png",
+					"selectedIconPath": "static/images/tabBar/user-h.png"
+				}
+			]
+		},
+	"globalStyle": {
+		"navigationBarTextStyle": "black",
+		"navigationBarTitleText": "uni-app x",
+		"navigationBarBackgroundColor": "#F8F8F8",
+		"backgroundColor": "#F8F8F8"
+	},
+	"uniIdRouter": {}
+}

+ 59 - 0
pages/classify/classify.vue

@@ -0,0 +1,59 @@
+<template>
+	<view class="classLayout pageBg">
+		<!-- #ifndef MP-TOUTIAO -->
+		<custom-nav-bar title="分类"></custom-nav-bar>
+		<!-- #endif -->
+		
+		<view class="classify">
+			<theme-item v-for="item in classifyList" 
+			:key="item._id"
+			:item="item"
+			></theme-item>
+		</view>
+		
+		
+	</view>
+</template>
+
+<script setup>
+import { ref } from 'vue';
+import {onShareAppMessage,onShareTimeline} from "@dcloudio/uni-app"
+import {apiGetClassify} from "@/api/apis.js"
+const classifyList = ref([]);
+
+const getClassify =async()=>{
+	let res =await apiGetClassify({
+		pageSize:15
+	});
+	classifyList.value = res.data
+	console.log(res);
+}
+
+
+//分享给好友
+onShareAppMessage((e)=>{
+	return {
+		title:"咸虾米壁纸,精选分类",
+		path:"/pages/classify/classify"
+	}
+})
+
+//分享朋友圈
+onShareTimeline(()=>{
+	return {
+		title:"咸虾米壁纸,精选分类"
+	}
+})
+
+
+getClassify();
+</script>
+
+<style lang="scss" scoped>
+.classify{
+	padding:30rpx;
+	display: grid;
+	grid-template-columns: repeat(3,1fr);
+	gap:15rpx;
+}
+</style>

+ 44 - 0
pages/index/index.uvue

@@ -0,0 +1,44 @@
+<template>
+	<view class="content">
+		<image class="logo" src="/static/logo.png"></image>
+		<view class="text-area">
+			<text class="title">{{title}}11</text>
+		</view>
+	</view>
+</template>
+
+<script>
+	export default {
+		data() {
+			return {
+				title: 'Hello'
+			}
+		},
+		onLoad() {
+
+		},
+		methods: {
+
+		}
+	}
+</script>
+
+<style>
+	.content {
+		display: flex;
+		align-items: center;
+		justify-content: center;
+	}
+
+	.logo {
+		height: 200rpx;
+		width: 200rpx;
+		margin-top: 200rpx;
+		margin-bottom: 50rpx;
+	}
+
+	.title {
+		font-size: 36rpx;
+		color: #8f8f94;
+	}
+</style>

+ 202 - 0
pages/user/user.vue

@@ -0,0 +1,202 @@
+<template>
+	<view class="userLayout pageBg" v-if="userinfo">
+		<view :style="{height:getNavBarHeight()+'px'}"></view>
+		<view class="userInfo">
+			<view class="avatar">
+				<image src="../../static/images/xxmLogo.png" mode="aspectFill"></image>
+			</view>
+			<view class="ip">{{userinfo.IP}}</view>
+			<view class="address">来自于:
+	{{ userinfo.address.city || userinfo.address.province || userinfo.address.country}}
+			
+			</view>
+		</view>
+				
+		
+		<view class="section">
+			<view class="list">
+				<navigator 
+				url="/pages/classlist/classlist?name=我的下载&type=download" 
+				class="row">
+					<view class="left">
+						<uni-icons type="download-filled" size="20" ></uni-icons>
+						<view class="text">我的下载</view>
+					</view>
+					<view class="right">
+						<view class="text">{{userinfo.downloadSize}}</view>
+						<uni-icons type="right" size="15" color="#aaa"></uni-icons>
+					</view>
+				</navigator>
+				
+				<navigator  
+				url="/pages/classlist/classlist?name=我的评分&type=score" 
+				class="row">
+					<view class="left">
+						<uni-icons type="star-filled" size="20"></uni-icons>
+						<view class="text">我的评分</view>
+					</view>
+					<view class="right">
+						<view class="text">{{userinfo.scoreSize}}</view>
+						<uni-icons type="right" size="15" color="#aaa"></uni-icons>
+					</view>
+				</navigator>
+				
+				<view class="row">
+					<view class="left">
+						<uni-icons type="chatboxes-filled" size="20"></uni-icons>
+						<view class="text">联系客服</view>
+					</view>
+					<view class="right">
+						<view class="text"></view>
+						<uni-icons type="right" size="15" color="#aaa"></uni-icons>
+					</view>
+					<!-- #ifdef MP -->
+					<button open-type="contact">联系客服</button>
+					<!-- #endif -->
+					<!-- #ifndef MP -->
+					<button @click="clickContact">拨打电话</button>
+					<!-- #endif -->				
+					
+					
+				</view>
+			</view>
+		</view>
+		
+		<view class="section">
+			<view class="list">
+				<navigator url="/pages/notice/detail?id=653507c6466d417a3718e94b" class="row">
+					<view class="left">
+						<uni-icons type="notification-filled" size="20"></uni-icons>
+						<view class="text">订阅更新</view>
+					</view>
+					<view class="right">
+						<view class="text"></view>
+						<uni-icons type="right" size="15" color="#aaa"></uni-icons>
+					</view>
+				</navigator>
+				
+				<navigator url="/pages/notice/detail?id=6536358ce0ec19c8d67fbe82" class="row">
+					<view class="left">
+						<uni-icons type="flag-filled" size="20"></uni-icons>
+						<view class="text">常见问题</view>
+					</view>
+					<view class="right">
+						<view class="text"></view>
+						<uni-icons type="right" size="15" color="#aaa"></uni-icons>
+					</view>
+				</navigator>
+			</view>
+		</view>
+		
+	</view>
+	
+	<view class="loadingLayout" v-else>
+		<view :style="{height:getNavBarHeight()+'px'}"></view>
+		<uni-load-more status="loading"></uni-load-more>
+	</view>
+</template>
+
+<script setup>
+import {getNavBarHeight} from "@/utils/system.js"
+import {apiUserInfo} from "@/api/apis.js"
+import { ref } from "vue";
+
+const userinfo = ref(null)
+
+const clickContact = ()=>{
+	uni.makePhoneCall({
+		phoneNumber:"114"
+	})
+}
+
+const getUserInfo = ()=>{
+	apiUserInfo().then(res=>{
+		console.log(res);
+		userinfo.value = res.data
+	})
+}
+
+getUserInfo();
+</script>
+
+<style lang="scss" scoped>
+.userLayout{
+	.userInfo{
+		display: flex;
+		align-items: center;
+		justify-content: center;
+		flex-direction: column;		
+		padding:50rpx 0;
+		.avatar{
+			width: 160rpx;
+			height: 160rpx;
+			border-radius: 50%;
+			overflow: hidden;
+			image{
+				width: 100%;
+				height: 100%;
+			}
+		}
+		.ip{
+			font-size: 44rpx;
+			color:#333;
+			padding:20rpx 0 5rpx;
+		}
+		.address{
+			font-size: 28rpx;
+			color:#aaa;
+		}
+	}
+	
+	.section{
+		width: 690rpx;
+		margin:50rpx auto;
+		border:1px solid #eee;
+		border-radius: 10rpx;
+		box-shadow: 0 0 30rpx rgba(0,0,0,0.05);
+		.list{
+			.row{
+				display: flex;
+				justify-content: space-between;
+				align-items: center;
+				padding:0 30rpx;
+				height: 100rpx;
+				border-bottom: 1px solid #eee;
+				position: relative;
+				background: #fff;
+				&:last-child{border-bottom:0}
+				.left{
+					display: flex;
+					align-items: center;
+					:deep(){
+						.uni-icons{
+							color:$brand-theme-color !important;
+						}
+					}
+					.text{
+						padding-left: 20rpx;
+						color:#666
+					}
+				}
+				.right{
+					display: flex;
+					align-items: center;
+					.text{
+						font-size: 28rpx;
+						color:#aaa;
+						
+					}
+				}
+				button{
+					position: absolute;
+					top:0;
+					left:0;
+					height: 100rpx;
+					width:100%;
+					opacity: 0;
+				}
+			}
+		}
+	}
+}
+</style>

BIN
static/images/logo2.jpg


BIN
static/images/tabBar/classify-h.png


BIN
static/images/tabBar/classify.png


BIN
static/images/tabBar/home-h.png


BIN
static/images/tabBar/home.png


BIN
static/images/tabBar/user-h.png


BIN
static/images/tabBar/user.png


BIN
static/images/xxmLogo.png


BIN
static/logo.png


+ 76 - 0
uni.scss

@@ -0,0 +1,76 @@
+/**
+ * 这里是uni-app内置的常用样式变量
+ *
+ * uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量
+ * 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App
+ *
+ */
+
+/**
+ * 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能
+ *
+ * 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件
+ */
+
+/* 颜色变量 */
+
+/* 行为相关颜色 */
+$uni-color-primary: #007aff;
+$uni-color-success: #4cd964;
+$uni-color-warning: #f0ad4e;
+$uni-color-error: #dd524d;
+
+/* 文字基本颜色 */
+$uni-text-color:#333;//基本色
+$uni-text-color-inverse:#fff;//反色
+$uni-text-color-grey:#999;//辅助灰色,如加载更多的提示信息
+$uni-text-color-placeholder: #808080;
+$uni-text-color-disable:#c0c0c0;
+
+/* 背景颜色 */
+$uni-bg-color:#ffffff;
+$uni-bg-color-grey:#f8f8f8;
+$uni-bg-color-hover:#f1f1f1;//点击状态颜色
+$uni-bg-color-mask:rgba(0, 0, 0, 0.4);//遮罩颜色
+
+/* 边框颜色 */
+$uni-border-color:#c8c7cc;
+
+/* 尺寸变量 */
+
+/* 文字尺寸 */
+$uni-font-size-sm:12px;
+$uni-font-size-base:14px;
+$uni-font-size-lg:16px;
+
+/* 图片尺寸 */
+$uni-img-size-sm:20px;
+$uni-img-size-base:26px;
+$uni-img-size-lg:40px;
+
+/* Border Radius */
+$uni-border-radius-sm: 2px;
+$uni-border-radius-base: 3px;
+$uni-border-radius-lg: 6px;
+$uni-border-radius-circle: 50%;
+
+/* 水平间距 */
+$uni-spacing-row-sm: 5px;
+$uni-spacing-row-base: 10px;
+$uni-spacing-row-lg: 15px;
+
+/* 垂直间距 */
+$uni-spacing-col-sm: 4px;
+$uni-spacing-col-base: 8px;
+$uni-spacing-col-lg: 12px;
+
+/* 透明度 */
+$uni-opacity-disabled: 0.3; // 组件禁用态的透明度
+
+/* 文章场景相关 */
+$uni-color-title: #2C405A; // 文章标题颜色
+$uni-font-size-title:20px;
+$uni-color-subtitle: #555555; // 二级标题颜色
+$uni-font-size-subtitle:26px;
+$uni-color-paragraph: #3F536E; // 文章段落颜色
+$uni-font-size-paragraph:15px;

+ 8 - 0
unpackage/dist/cache/.vite/deps/_metadata.json

@@ -0,0 +1,8 @@
+{
+  "hash": "61393a65",
+  "configHash": "436e6dbf",
+  "lockfileHash": "e3b0c442",
+  "browserHash": "3f9ab3ae",
+  "optimized": {},
+  "chunks": {}
+}

+ 3 - 0
unpackage/dist/cache/.vite/deps/package.json

@@ -0,0 +1,3 @@
+{
+  "type": "module"
+}