qinyan 1 year ago
parent
commit
819cd63aba

+ 16 - 27
src/App.vue

@@ -1,33 +1,22 @@
 <script>
-	export default {
-		onLaunch: function() {
-			console.log('App Launch')
-		},
-		onShow: function() {
-			console.log('App Show')
-		},
-		onHide: function() {
-			console.log('App Hide')
-		}
-	}
+export default {
+  onLaunch: function () {
+    console.log("App Launch");
+  },
+  onShow: function () {
+    console.log("App Show");
+  },
+  onHide: function () {
+    console.log("App Hide");
+  },
+};
 </script>
 
 <style>
-	@import './common/common.css';
+@import "./common/common.css";
 
-	page,
-	view {
-		display: flex;
-	}
-
-	page {
-		display: flex;
-		min-height: 100%;
-		background-color: #EFEFEF;
-	}
-
-	template {
-		display: flex;
-		flex: 1;
-	}
+page {
+  min-height: 100%;
+  background-color: #efefef;
+}
 </style>

+ 81 - 448
src/common/common.css

@@ -1,425 +1,58 @@
+/* global */
 @font-face {
-	font-family: texticons;
-	font-weight: normal;
-	font-style: normal;
-	src: url('https://at.alicdn.com/t/font_702773_g9f89om4v3j.ttf') format('truetype');
+  font-family: texticons;
+  font-weight: normal;
+  font-style: normal;
+  src: url("https://at.alicdn.com/t/font_702773_g9f89om4v3j.ttf")
+    format("truetype");
 }
 
 .index {
-	flex: 1;
-	width: 750upx;
-	min-height: 100vh;
-	flex-direction: column;
-	justify-content: center;
-	align-items: center;
+  width: 750rpx;
+  min-height: 100vh;
 }
-
-.row {
-	flex-direction: row;
-}
-
-.column {
-	flex-direction: column;
-}
-
-.card {
-	position: relative;
-	width: 710upx;
-	margin: 20upx 20upx 20upx 20upx;
-	border-radius: 10upx;
-	overflow: hidden;
-	flex-direction: column;
-	background-color: #FFFFFF;
-}
-
-.card-img {
-	width: 710upx;
-	height: 1065upx;
-}
-
-.card-num {
-	color: #FFFFFF;
-	font-size: 13px;
-	text-align: center;
-}
-
-.card-num-view {
-	background-color: #FF80AB;
-	line-height: 1;
-	display: inline-block;
-	padding: 3px 6px;
-	color: #FFFFFF;
-	font-size: 12px;
-	text-align: center;
-	justify-content: center;
-	align-items: center;
-	border-radius: 15px;
-	position: absolute;
-	top: 20upx;
-	right: 20upx;
-}
-
-.card-bottm {
-	justify-content: center;
-	align-items: center;
-}
-
-.card-share-view {
-	justify-content: center;
-	align-items: center;
-	padding: 14upx 0;
-	color: #FF80AB;
-	margin: 20upx 20upx 20upx;
-	font-size: 30upx;
-	font-family: texticons;
-}
-
-.card-share-view:before {
-	content: '\e62d';
-}
-
-.car-title-view {
-	flex: 1;
-	padding: 14upx 0upx 14upx 20upx;
-}
-
-.card-title {
-	flex: 1;
-	font-size: 30upx;
-	text-align: left;
-	color: #555555;
-	text-overflow: ellipsis;
-	lines: 2;
-	display: -webkit-box;
-	white-space: normal;
-	display: -webkit-box;
-	-webkit-box-orient: vertical;
-	-webkit-line-clamp: 2;
-	overflow: hidden;
-}
-
-
-
-
-
-
-
-
-
-/*双列表*/
-
-.card-list2 {
-	width: 345upx;
-	margin: 20upx 0 20upx 20upx;
-}
-
-.card-list2-img {
-	width: 345upx;
-	height: 517upx;
-}
-
-.card-list2-num-view {
-	transform: scale(0.8);
-	transform-origin: right;
-}
-
-.card-list2-num {
-	font-size: 22upx;
-}
-
-.card-list2-title {
-	font-size: 26upx;
-}
-
-
 .loadMore {
-	font-size: 30upx;
-	color: #555;
-	margin-bottom: 20upx;
-}
-
-
-
-
-
-
-/* 分类页面 */
-
-.tags {
-	background: #fff;
-	flex: 1;
-	width: 710upx;
-	margin: 20upx;
-	flex-direction: row;
-	flex-wrap: wrap;
-	justify-content: flex-start;
-	align-content: flex-start;
-}
-
-view.tag,
-.tag {
-	display: block;
-	width: 177.5upx;
-	height: 180upx;
-	padding: 24upx;
-	line-height: 1;
-	box-sizing: border-box;
-	text-align: center;
-}
-
-.tag-img {
-	border-radius: 60upx;
-	width: 120upx;
-	height: 120upx;
-}
-
-.tag-text {
-	font-size: 28upx;
-	color: #555555;
-}
-
-
-
-
-
-/* 个人中心 */
-
-.center {
-	flex-direction: column;
-	min-height: 100vh;
-}
-
-.logo {
-	width: 750upx;
-	height: 240upx;
-	padding: 20upx;
-	box-sizing: border-box;
-	background-color: #FF80AB;
-	flex-direction: row;
-	align-items: center;
-}
-
-.logo-hover {
-	opacity: 0.8;
-}
-
-.logo-img {
-	width: 150upx;
-	height: 150upx;
-	border-radius: 150upx;
-}
-
-.logo-title {
-	height: 150upx;
-	flex: 1;
-	align-items: center;
-	justify-content: space-between;
-	flex-direction: row;
-	margin-left: 20upx;
-}
-
-.uer-name {
-	height: 60upx;
-	line-height: 60upx;
-	font-size: 38upx;
-	color: #FFFFFF;
-}
-
-.go-login.navigat-arrow {
-	font-size: 38upx;
-	color: #FFFFFF;
-}
-
-.login-title {
-	height: 150upx;
-	align-items: self-start;
-	justify-content: center;
-	flex-direction: column;
-	margin-left: 20upx;
-}
-
-.center-list {
-	background-color: #FFFFFF;
-	margin-top: 20upx;
-	width: 750upx;
-	flex-direction: column;
-}
-
-.center-list-item {
-	height: 90upx;
-	width: 750upx;
-	box-sizing: border-box;
-	flex-direction: row;
-	padding: 0upx 20upx;
-}
-
-.border-bottom {
-	border-bottom-width: 1upx;
-	border-color: #c8c7cc;
-	border-bottom-style: solid;
-}
-
-.list-icon {
-	width: 40upx;
-	height: 90upx;
-	line-height: 90upx;
-	font-size: 34upx;
-	color: #FF80AB;
-	text-align: center;
-	font-family: texticons;
-	margin-right: 20upx;
-}
-
-.list-text {
-	height: 90upx;
-	line-height: 90upx;
-	font-size: 34upx;
-	color: #555;
-	flex: 1;
-	text-align: left;
+  padding: 30rpx 0;
+  text-align: center;
+  font-size: 30rpx;
+  color: #555;
 }
 
-.navigat-arrow {
-	height: 90upx;
-	width: 40upx;
-	line-height: 90upx;
-	font-size: 34upx;
-	color: #555;
-	text-align: right;
-	font-family: texticons;
+/* base */
+.flex {
+  display: flex;
 }
-
-
-
-
-/* 登录 */
-
-.loginView {
-	display: flex;
-	flex: 1;
-	flex-direction: column;
-	width: 750upx;
-	min-height: 100vh;
-	padding-top: 30upx;
-}
-
-.input-view {
-	border-bottom-style: solid;
-	border-bottom-width: 1upx;
-	border-bottom-color: #ddd;
-	background-color: #fff;
-	flex-direction: row;
-	width: 750upx;
-	padding: 20upx 20upx;
-	box-sizing: border-box;
-}
-
-.label-view {
-	width: 100upx;
-	height: 60upx;
-	align-items: center;
-	margin-right: 30upx;
-}
-
-.label {
-	flex: 1;
-	line-height: 60upx;
-	font-size: 38upx;
-	color: #555;
-	text-align: left;
-}
-
-.input {
-	flex: 1;
-	height: 60upx;
-	font-size: 38upx;
-	align-items: center;
-}
-
-.button-view {
-	width: 750upx;
-	margin-top: 50upx;
-	padding: 0 20upx;
-	box-sizing: border-box;
-	flex-direction: column;
-}
-
-button {
-	width: 710upx;
-	height: 80upx;
-	line-height: 80upx;
-	text-align: center;
-	font-size: 38upx;
-}
-
-button.login {
-	background-color: #FF80AB;
-	color: #fff;
-}
-
-button.register {
-	margin-top: 30upx;
-	color: #FF80AB;
-	background-color: #fff;
-	border-color: #FF80AB;
-	border-width: 2upx;
-}
-
-.register.hover,
-.login.hover {
-	opacity: 0.6;
-}
-
-
-
-/* 详情页面 */
-
-.detail-btn-view {
-	width: 750upx;
-	position: fixed;
-	bottom: 75upx;
-	font-size: 28upx;
-	justify-content: space-between;
-}
-
-.detail-btn-view view {
-	opacity: 0.75;
-	height: 80upx;
-	border-radius: 80upx;
-	width: 80upx;
-	justify-content: center;
-	align-items: center;
-	line-height: 80upx;
-	margin: 0 30upx;
-	font-family: texticons;
-	background: #eee;
-	color: #555;
+.row {
+  flex-direction: row;
 }
-
-.detail-btn-view view text {
-	margin-left: 10upx;
+.column {
+  flex-direction: column;
 }
-
-.detail-btn-view .download:before {
-	content: '\e617';
+.flex-1 {
+  flex: 1;
 }
-
-.detail-btn-view .collect:before {
-	content: '\e68d';
+.items-center {
+  align-items: center;
 }
-
-.detail-btn-view .setting {
-	flex: 1;
+.justify-center {
+  justify-content: center;
 }
 
+/* .login-title {
+  height: 150rpx;
+  align-items: self-start;
+  justify-content: center;
+  flex-direction: column;
+  margin-left: 20rpx;
+} */
 
 .grid {
-	display: flex;
-	flex-direction: row;
-	flex-wrap: wrap;
-	padding-left: 5px;
-	padding-right: 5px;
-	box-sizing: border-box;
+  display: flex;
+  flex-direction: row;
+  flex-wrap: wrap;
+  padding-left: 5px;
+  padding-right: 5px;
+  box-sizing: border-box;
 }
 
 .grid-c-01,
@@ -434,95 +67,95 @@ button.register {
 .grid-c-10,
 .grid-c-11,
 .grid-c-12 {
-	position: relative;
-	width: 100%;
-	padding-left: 5px;
-	padding-right: 5px;
-	box-sizing: border-box;
+  position: relative;
+  width: 100%;
+  padding-left: 5px;
+  padding-right: 5px;
+  box-sizing: border-box;
 }
 
 .grid-c-auto {
-	flex: 0 0 auto;
-	width: auto;
-	max-width: none;
+  flex: 0 0 auto;
+  width: auto;
+  max-width: none;
 }
 
 .grid-c-fill {
-	flex-basis: 0;
-	flex: 1;
-	flex-grow: 1;
-	max-width: 100%;
+  flex-basis: 0;
+  flex: 1;
+  flex-grow: 1;
+  max-width: 100%;
 }
 
 .grid-c-none {
-	flex: none;
+  flex: none;
 }
 
 .grid-c-01 {
-	flex: 0 0 8.333333%;
-	max-width: 8.333333%;
+  flex: 0 0 8.333333%;
+  max-width: 8.333333%;
 }
 
 .grid-c-02 {
-	flex: 0 0 16.666667%;
-	max-width: 16.666667%;
+  flex: 0 0 16.666667%;
+  max-width: 16.666667%;
 }
 
 .grid-c-03 {
-	flex: 0 0 25%;
-	max-width: 25%;
+  flex: 0 0 25%;
+  max-width: 25%;
 }
 
 .grid-c-04 {
-	flex: 0 0 33.333333%;
-	max-width: 33.333333%;
+  flex: 0 0 33.333333%;
+  max-width: 33.333333%;
 }
 
 .grid-c-05 {
-	flex: 0 0 41.666667%;
-	max-width: 41.666667%;
+  flex: 0 0 41.666667%;
+  max-width: 41.666667%;
 }
 
 .grid-c-06 {
-	flex: 0 0 50%;
-	max-width: 50%;
+  flex: 0 0 50%;
+  max-width: 50%;
 }
 
 .grid-c-07 {
-	flex: 0 0 58.333333%;
-	max-width: 58.333333%;
+  flex: 0 0 58.333333%;
+  max-width: 58.333333%;
 }
 
 .grid-c-08 {
-	flex: 0 0 66.666667%;
-	max-width: 66.666667%;
+  flex: 0 0 66.666667%;
+  max-width: 66.666667%;
 }
 
 .grid-c-09 {
-	flex: 0 0 75%;
-	max-width: 75%;
+  flex: 0 0 75%;
+  max-width: 75%;
 }
 
 .grid-c-10 {
-	flex: 0 0 83.333333%;
-	max-width: 83.333333%;
+  flex: 0 0 83.333333%;
+  max-width: 83.333333%;
 }
 
 .grid-c-11 {
-	flex: 0 0 91.666667%;
-	max-width: 91.666667%;
+  flex: 0 0 91.666667%;
+  max-width: 91.666667%;
 }
 
 .grid-c-12 {
-	flex: 0 0 100%;
-	max-width: 100%;
+  flex: 0 0 100%;
+  max-width: 100%;
 }
 
 .panel {
-	position: relative;
-	border-radius: 10upx;
-	overflow: hidden;
-	flex-direction: column;
-	background-color: #FFFFFF;
-	margin-bottom: 10px;
+  position: relative;
+  border-radius: 10rpx;
+  overflow: hidden;
+  flex-direction: column;
+  background-color: #ffffff;
+  margin-bottom: 10px;
 }

+ 12 - 0
src/dict/apis.js

@@ -0,0 +1,12 @@
+const baseURL = "https://www.infish.cn";
+
+const baseVersion = "/cloud/v1";
+const treeVersion = "/tree/v1";
+
+const Dict_Apis = {
+  auth: `${baseURL}${baseVersion}/usercenter`,
+  queentree: `${baseURL}${treeVersion}/assetcenter`,
+  promotion: `${baseURL}${baseVersion}/promotionv1`,
+};
+
+export { Dict_Apis };

+ 9 - 25
src/main.js

@@ -1,27 +1,11 @@
-import App from './App.vue'
+import App from "./App.vue";
+import Vue from "vue";
+import { Dict_Apis } from "./dict/apis";
 
-const host = 'https://unidemo.dcloud.net.cn/';
-
-// #ifndef VUE3
-import Vue from 'vue'
-Vue.config.productionTip = false
-Vue.prototype.$serverUrl = host;
-App.mpType = 'app'
+Vue.config.productionTip = false;
+Vue.prototype.$serverUrl = Dict_Apis.promotion;
+App.mpType = "app";
 const app = new Vue({
-  ...App
-})
-app.$mount()
-// #endif
-
-// #ifdef VUE3
-import {
-	createSSRApp
-} from 'vue'
-export function createApp() {
-	const app = createSSRApp(App)
-	app.config.globalProperties.$serverUrl = "https://unidemo.dcloud.net.cn/";
-	return {
-		app
-	}
-}
-// #endif
+  ...App,
+});
+app.$mount();

+ 45 - 44
src/manifest.json

@@ -1,47 +1,48 @@
 {
-    "name" : "图片App模版",
-    "appid" : "",
-    "description" : "图片App模版",
-    "transformPx" : false,
-    "icons" : [
-        {
-            "sizes" : "分辨率,192x192",
-            "src" : "图片路径"
-        }
-    ],
-    "versionName" : "1.0.2",
-    "versionCode" : 102,
-    "compatConfig" : {
-        "MODE" : 2 // 2代表兼容Vue2模式,3代表非兼容Vue2模式
+  "name": "Queen.show",
+  "appid": "wxd3579568e0e2cf2b",
+  "description": "Queen.show",
+  "transformPx": false,
+  "icons": [
+    {
+      "sizes": "分辨率,192x192",
+      "src": "图片路径"
+    }
+  ],
+  "versionName": "1.0.2",
+  "versionCode": 102,
+  "compatConfig": {
+    "MODE": 2 // 2代表兼容Vue2模式,3代表非兼容Vue2模式
+  },
+  "app-plus": {
+    "usingComponents": true,
+    "compilerVersion": 3
+  },
+  // 5+App特有相关
+  "quickapp": {},
+  // 快应用特有相关
+  "mp-weixin": {
+    "appid": "wxd3579568e0e2cf2b",
+    "setting": {
+      "urlCheck": false
     },
-    "app-plus" : {
-        "usingComponents" : true,
-        "compilerVersion" : 3
-    },
-    // 5+App特有相关
-    "quickapp" : {},
-    // 快应用特有相关
-    "mp-weixin" : {
-        "setting" : {
-            "urlCheck" : false
-        },
-        "usingComponents" : true
-    },
-    "mp-alipay" : {
-        "usingComponents" : true
-    },
-    "mp-baidu" : {
-        "usingComponents" : true
-    },
-    "mp-toutiao" : {
-        "usingComponents" : true
-    },
-    "h5" : {
-        "template" : "",
-        "router" : {
-            "mode" : "hash",
-            "base" : "./"
-        }
-    },
-    "vueVersion" : "2"
+    "usingComponents": true
+  },
+  "mp-alipay": {
+    "usingComponents": true
+  },
+  "mp-baidu": {
+    "usingComponents": true
+  },
+  "mp-toutiao": {
+    "usingComponents": true
+  },
+  "h5": {
+    "template": "",
+    "router": {
+      "mode": "hash",
+      "base": "./"
+    }
+  },
+  "vueVersion": "2"
 }

+ 98 - 107
src/pages.json

@@ -1,109 +1,100 @@
 {
-	"pages": [{
-			//pages数组中第一项表示应用启动页,参考:https://uniapp.dcloud.io/collocation/pages
-			"path": "pages/new/new",
-			"style": {
-				"navigationBarTitleText": "最新",
-				"enablePullDownRefresh": true
-			}
-		},
-		{
-			"path": "pages/hot/hot",
-			"style": {
-				"navigationBarTitleText": "最热",
-				"enablePullDownRefresh": true
-			}
-		},
-		{
-			"path": "pages/detail/detail",
-			"style": {
-				"navigationBarTitleText": "详情",
-				"navigationBarBackgroundColor": "#000000",
-				"backgroundColor": "#000000",
-				"app-plus": {
-					"bounce": "none",
-					"titleNView": {
-						"buttons": [{
-							"type": "share"
-						}]
-					}
-				},
-				"h5": {
-					"titleNView": {
-						"buttons": [{
-							"type": "favorite"
-						}]
-					}
-				}
-			}
-		},
-		{
-			"path": "pages/tag/tag",
-			"style": {
-				"navigationBarTitleText": "分类",
-				"enablePullDownRefresh": false
-			}
-		},
-		{
-			"path": "pages/list/list",
-			"style": {
-				"navigationBarTitleText": "专题",
-				"enablePullDownRefresh": true
-			}
-		},
-		{
-			"path": "pages/center/center",
-			"style": {
-				"navigationBarTitleText": "个人中心",
-				"enablePullDownRefresh": false
-			}
-		},
-		{
-			"path": "pages/login/login",
-			"style": {
-				"navigationBarTitleText": "登录"
-			}
-		},
-		{
-			"path": "pages/about/about",
-			"style": {}
-		}
-	],
-	"globalStyle": {
-		"navigationBarTextStyle": "white",
-		"navigationBarTitleText": "看图",
-		"navigationBarBackgroundColor": "#FF80AB",
-		"backgroundColor": "#EFEFEF"
-	},
-	"tabBar": {
-		"color": "#444444",
-		"selectedColor": "#FF80AB",
-		"borderStyle": "black",
-		"backgroundColor": "#ffffff",
-		"list": [{
-				"pagePath": "pages/new/new",
-				"iconPath": "static/index-0.png",
-				"selectedIconPath": "static/index-1.png",
-				"text": "最新"
-			},
-			{
-				"pagePath": "pages/hot/hot",
-				"iconPath": "static/hot-0.png",
-				"selectedIconPath": "static/hot-1.png",
-				"text": "推荐"
-			},
-			{
-				"pagePath": "pages/tag/tag",
-				"iconPath": "static/tag-0.png",
-				"selectedIconPath": "static/tag-1.png",
-				"text": "分类"
-			},
-			{
-				"pagePath": "pages/center/center",
-				"iconPath": "static/center-0.png",
-				"selectedIconPath": "static/center-1.png",
-				"text": "我的"
-			}
-		]
-	}
+  "pages": [
+    //pages数组中第一项表示应用启动页,参考:https://uniapp.dcloud.io/collocation/pages
+    {
+      "path": "pages/index/index",
+      "style": {
+        "navigationBarTitleText": "推广",
+        "enablePullDownRefresh": true
+      }
+    },
+    {
+      "path": "pages/hot/hot",
+      "style": {
+        "navigationBarTitleText": "最热",
+        "enablePullDownRefresh": true
+      }
+    },
+    {
+      "path": "pages/detail/detail",
+      "style": {
+        "navigationBarTitleText": "详情"
+      }
+    },
+    {
+      "path": "pages/tag/tag",
+      "style": {
+        "navigationBarTitleText": "分类",
+        "enablePullDownRefresh": false
+      }
+    },
+    {
+      "path": "pages/list/list",
+      "style": {
+        "navigationBarTitleText": "专题",
+        "enablePullDownRefresh": true
+      }
+    },
+    {
+      "path": "pages/center/center",
+      "style": {
+        "navigationBarTitleText": "个人中心",
+        "enablePullDownRefresh": false
+      }
+    },
+    {
+      "path": "pages/login/index",
+      "style": {
+        "navigationBarTitleText": "登录"
+      }
+    },
+    {
+      "path": "pages/login/login",
+      "style": {
+        "navigationBarTitleText": "手机号登录"
+      }
+    },
+    {
+      "path": "pages/about/about",
+      "style": {}
+    }
+  ],
+  "globalStyle": {
+    "navigationBarTextStyle": "white",
+    "navigationBarTitleText": "Queen.show",
+    "navigationBarBackgroundColor": "#41969c",
+    "backgroundColor": "#EFEFEF"
+  },
+  "tabBar": {
+    "color": "#444444",
+    "selectedColor": "#41969c",
+    "borderStyle": "black",
+    "backgroundColor": "#ffffff",
+    "list": [
+      {
+        "pagePath": "pages/index/index",
+        "iconPath": "static/index-0.png",
+        "selectedIconPath": "static/index-1.png",
+        "text": "推广"
+      },
+      // {
+      //   "pagePath": "pages/hot/hot",
+      //   "iconPath": "static/hot-0.png",
+      //   "selectedIconPath": "static/hot-1.png",
+      //   "text": "发现"
+      // },
+      // {
+      //   "pagePath": "pages/tag/tag",
+      //   "iconPath": "static/tag-0.png",
+      //   "selectedIconPath": "static/tag-1.png",
+      //   "text": "分类"
+      // },
+      {
+        "pagePath": "pages/center/center",
+        "iconPath": "static/center-0.png",
+        "selectedIconPath": "static/center-1.png",
+        "text": "我的"
+      }
+    ]
+  }
 }

+ 23 - 219
src/pages/about/about.vue

@@ -1,227 +1,31 @@
 <template>
-	<view class="about">
-		<view class="content">
-			<view class="qrcode">
-				<!-- #ifdef APP-PLUS -->
-				<image src="https://img.cdn.aliyun.dcloud.net.cn/stream/qr/__UNI__FAD3FD9.png/256" @longtap="save"></image>
-				<!-- #endif -->
-				<!-- #ifdef H5 -->
-				<image src="//img.cdn.aliyun.dcloud.net.cn/stream/qr/__UNI__FAD3FD9.png/256"></image>
-				<!-- #endif -->
-				<text class="tip">扫码体验看图App模板</text>
-			</view>
-			<view class="desc">
-				基于uni-app开发的看图App模版,项目已开源。
-			</view>
-			<view class="source">
-				<view class="title">本示例源码获取方式:</view>
-				<view class="source-list">
-					<view class="source-cell">
-						<text space="nbsp">1. </text>
-						<text>下载 HBuilderX,新建 uni-app 项目时选择 看图App 模板。</text>
-					</view>
-					<view class="source-cell">
-						<text space="nbsp">2. </text><text @click="openLink" class="link">{{sourceLink}}</text>
-					</view>
-				</view>
-			</view>
-			<!-- #ifdef APP-PLUS -->
-			<button type="primary" @click="share">分享</button>
-			<!-- #endif -->
-		</view>
-		<!-- #ifdef APP-PLUS -->
-		<view class="version">
-			当前版本:{{version}}
-		</view>
-		<!-- #endif -->
-	</view>
+  <view class="about">
+    <text class="tip">queen.show</text>
+  </view>
 </template>
 
 <script>
-	export default {
-		data() {
-			return {
-				providerList: [],
-				version: '',
-				sourceLink: 'https://github.com/dcloudio/uni-template-picture'
-			}
-		},
-		// #ifdef APP-PLUS
-		onLoad() {
-			this.version = plus.runtime.version;
-			uni.getProvider({
-				service: 'share',
-				success: (e) => {
-					let data = [];
-					for (let i = 0; i < e.provider.length; i++) {
-						switch (e.provider[i]) {
-							case 'weixin':
-								data.push({
-									name: '分享到微信好友',
-									id: 'weixin'
-								})
-								data.push({
-									name: '分享到微信朋友圈',
-									id: 'weixin',
-									type: 'WXSenceTimeline'
-								})
-								break;
-							case 'qq':
-								data.push({
-									name: '分享到QQ',
-									id: 'qq'
-								})
-								break;
-							default:
-								break;
-						}
-					}
-					this.providerList = data;
-				},
-				fail: (e) => {
-					console.log('获取登录通道失败' + JSON.stringify(e));
-				}
-			});
-		},
-		// #endif
-		methods: {
-			// #ifdef APP-PLUS
-			save() {
-				uni.showActionSheet({
-					itemList: ['保存图片到相册'],
-					success: () => {
-						plus.gallery.save('https://img.cdn.aliyun.dcloud.net.cn/guide/uniapp/app_download.png', function() {
-							uni.showToast({
-								title: '保存成功',
-								icon: 'none'
-							})
-						}, function() {
-							uni.showToast({
-								title: '保存失败,请重试!',
-								icon: 'none'
-							})
-						});
-					}
-				})
-			},
-			share(e) {
-				if (this.providerList.length === 0) {
-					uni.showModal({
-						title: '当前环境无分享渠道!',
-						showCancel: false
-					})
-					return;
-				}
-				let itemList = this.providerList.map(function(value) {
-					return value.name
-				})
-				uni.showActionSheet({
-					itemList: itemList,
-					success: (res) => {
-						uni.share({
-							provider: this.providerList[res.tapIndex].id,
-							scene: this.providerList[res.tapIndex].type && this.providerList[res.tapIndex].type === 'WXSenceTimeline' ?
-								'WXSenceTimeline' : "WXSceneSession",
-							type: 0,
-							title: '欢迎体验uni-app',
-							summary: 'uni-app 是一个使用 Vue.js 开发跨平台应用的前端框架',
-							imageUrl: 'https://img-cdn-qiniu.dcloud.net.cn/uploads/nav_menu/8.jpg',
-							href: "https://m3w.cn/uniapp",
-							success: (res) => {
-								console.log("success:" + JSON.stringify(res));
-							},
-							fail: (e) => {
-								uni.showModal({
-									content: e.errMsg,
-									showCancel: false
-								})
-							}
-						});
-					}
-				})
-			},
-			// #endif
-			openLink() {
-				if (plus) {
-					plus.runtime.openURL(this.sourceLink);
-				} else {
-					window.open(this.sourceLink);
-				}
-			}
-		}
-	}
+export default {
+  data() {
+    return {};
+  },
+
+  onLoad() {},
+  methods: {},
+};
 </script>
 
 <style>
-	page,
-	view {
-		display: flex;
-	}
-
-	page {
-		min-height: 100%;
-		background-color: #FFFFFF;
-	}
-
-	image {
-		width: 360upx;
-		height: 360upx;
-	}
-
-	.about {
-		flex-direction: column;
-		flex: 1;
-	}
-
-	.content {
-		flex: 1;
-		padding: 30upx;
-		flex-direction: column;
-		justify-content: center;
-	}
-
-	.qrcode {
-		display: flex;
-		align-items: center;
-		flex-direction: column;
-	}
-
-	.qrcode .tip {
-		margin-top: 20upx;
-	}
-
-	.desc {
-		margin-top: 30upx;
-		display: block;
-	}
-
-	.code {
-		color: #e96900;
-		background-color: #f8f8f8;
-	}
-
-	button {
-		width: 100%;
-		margin-top: 40upx;
-	}
-
-	.version {
-		height: 80upx;
-		line-height: 80upx;
-		justify-content: center;
-		color: #ccc;
-	}
-
-	.source {
-		margin-top: 30upx;
-		flex-direction: column;
-	}
-
-	.source-list {
-		flex-direction: column;
-	}
-
-	.link {
-		color: #007AFF;
-	}
+page,
+view {
+  display: block;
+  text-align: center;
+}
+page {
+  min-height: 100%;
+  background-color: #ffffff;
+}
+.about {
+  margin-top: 200rpx;
+}
 </style>

+ 161 - 68
src/pages/center/center.vue

@@ -1,76 +1,169 @@
 <template>
-	<view class="center">
-		<view class="logo" @click="goLogin" :hover-class="!login ? 'logo-hover' : ''">
-			<image class="logo-img" :src="login ? uerInfo.avatarUrl :avatarUrl"></image>
-			<view class="logo-title">
-				<text class="uer-name">Hi,{{login ? uerInfo.name : '您未登录'}}</text>
-				<text class="go-login navigat-arrow" v-if="!login">&#xe65e;</text>
-			</view>
-		</view>
-		<view class="center-list">
-			<view class="center-list-item border-bottom">
-				<text class="list-icon">&#xe60c;</text>
-				<text class="list-text">收藏图片</text>
-				<text class="navigat-arrow">&#xe65e;</text>
-			</view>
-			<view class="center-list-item">
-				<text class="list-icon">&#xe60d;</text>
-				<text class="list-text">收藏图集</text>
-				<text class="navigat-arrow">&#xe65e;</text>
-			</view>
-		</view>
-		<view class="center-list">
-			<view class="center-list-item border-bottom">
-				<text class="list-icon">&#xe60b;</text>
-				<text class="list-text">管理图片</text>
-				<text class="navigat-arrow">&#xe65e;</text>
-			</view>
-			<view class="center-list-item">
-				<text class="list-icon">&#xe61a;</text>
-				<text class="list-text">上传图片</text>
-				<text class="navigat-arrow">&#xe65e;</text>
-			</view>
-		</view>
-		<view class="center-list">
-			<view class="center-list-item border-bottom" @click="goAbout">
-				<text class="list-icon">&#xe603;</text>
-				<text class="list-text">关于</text>
-				<text class="navigat-arrow">&#xe65e;</text>
-			</view>
-			<view class="center-list-item">
-				<text class="list-icon">&#xe609;</text>
-				<text class="list-text">账号管理</text>
-				<text class="navigat-arrow">&#xe65e;</text>
-			</view>
-		</view>
-	</view>
+  <view class="center">
+    <view
+      class="logo flex"
+      @click="goLogin"
+      :hover-class="!login ? 'logo-hover' : ''"
+    >
+      <image
+        class="logo-img"
+        :src="login ? userInfo.avatar : avatarUrl"
+      ></image>
+      <view class="logo-title flex">
+        <text class="uer-name"
+          >Hi,{{ login ? userInfo.name : "您未登录" }}</text
+        >
+        <text class="go-login navigat-arrow" v-if="!login">&#xe65e;</text>
+      </view>
+    </view>
+
+    <view class="center-list">
+      <view class="center-list-item border-bottom" @click="goAbout">
+        <text class="list-icon">&#xe603;</text>
+        <text class="list-text">关于</text>
+        <text class="navigat-arrow">&#xe65e;</text>
+      </view>
+    </view>
+
+    <view class="center_footer">
+      <button class="btn" @click="goLogout">退出登录</button>
+    </view>
+  </view>
 </template>
 
 <script>
-	export default {
-		data() {
-			return {
-				login: false,
-				avatarUrl: '/static/logo.png',
-				uerInfo: {}
-			}
-		},
-		methods: {
-			goLogin() {
-				if (!this.login) {
-					uni.navigateTo({
-						url: '/pages/login/login'
-					});
-				}
-			},
-			goAbout() {
-				uni.navigateTo({
-					url: '/pages/about/about'
-				});
-			}
-		}
-	}
+import { getUserInfo } from "../../services/https/user";
+export default {
+  data() {
+    return {
+      login: false,
+      avatarUrl: "/static/avatar.png",
+      userInfo: {},
+    };
+  },
+  onLoad() {
+    this.queryData();
+  },
+  methods: {
+    async queryData() {
+      const res = await getUserInfo();
+      if (res.errorNo !== 200) return;
+      this.login = true;
+      this.userInfo = res.result.user;
+    },
+    goLogin() {
+      if (!this.login) {
+        uni.navigateTo({
+          url: "/pages/login/index",
+        });
+      }
+    },
+    goLogout() {
+      this.login = false;
+      this.userInfo = {};
+      uni.removeStorageSync("access-token");
+    },
+    goAbout() {
+      uni.navigateTo({
+        url: "/pages/about/about",
+      });
+    },
+  },
+};
 </script>
 
 <style>
+.center {
+  min-height: 100vh;
+}
+.logo {
+  padding: 20rpx;
+  box-sizing: border-box;
+  background-color: #41969c;
+  flex-direction: row;
+  align-items: center;
+}
+
+.logo-hover {
+  opacity: 0.8;
+}
+
+.logo-img {
+  width: 150rpx;
+  height: 150rpx;
+  border-radius: 150rpx;
+}
+
+.logo-title {
+  height: 150rpx;
+  flex: 1;
+  align-items: center;
+  justify-content: space-between;
+  flex-direction: row;
+  margin-left: 20rpx;
+}
+
+.uer-name {
+  height: 60rpx;
+  line-height: 60rpx;
+  font-size: 38rpx;
+  color: #ffffff;
+}
+
+.go-login.navigat-arrow {
+  font-size: 38rpx;
+  color: #ffffff;
+}
+.center-list {
+  background-color: #ffffff;
+  margin-top: 20rpx;
+  width: 750rpx;
+  flex-direction: column;
+}
+
+.center-list-item {
+  display: flex;
+  height: 90rpx;
+  width: 750rpx;
+  box-sizing: border-box;
+  flex-direction: row;
+  padding: 0rpx 20rpx;
+}
+.border-bottom {
+  border-bottom-width: 1rpx;
+  border-color: #c8c7cc;
+  border-bottom-style: solid;
+}
+.list-icon {
+  width: 40rpx;
+  height: 90rpx;
+  line-height: 90rpx;
+  font-size: 34rpx;
+  color: #41969c;
+  text-align: center;
+  margin-right: 20rpx;
+  font-family: texticons;
+}
+
+.list-text {
+  height: 90rpx;
+  line-height: 90rpx;
+  font-size: 34rpx;
+  color: #555;
+  flex: 1;
+  text-align: left;
+}
+
+.navigat-arrow {
+  height: 90rpx;
+  width: 40rpx;
+  line-height: 90rpx;
+  font-size: 34rpx;
+  color: #555;
+  text-align: right;
+  font-family: texticons;
+}
+.center_footer {
+  margin-top: 80rpx;
+}
 </style>

+ 25 - 270
src/pages/detail/detail.vue

@@ -1,279 +1,34 @@
 <template>
-	<view class="index">
-		<swiper @change="swpierChange" :style="{height:screenHeight + 'px'}">
-			<swiper-item v-for="(value,index) in data" :key="value" @click="preImg(index)">
-				<image :src="value" mode="widthFix"></image>
-			</swiper-item>
-		</swiper>
-		<!-- #ifndef H5 -->
-		<view class="detail-btn-view">
-			<view class="download" @click="download"></view>
-			<!-- #ifdef APP-PLUS -->
-			<view v-if="showBtn" class="setting" @click="setting">设为壁纸</view>
-			<!-- #endif -->
-			<view class="collect" @click="collect"></view>
-		</view>
-		<!-- #endif -->
-	</view>
+  <view class="index">
+    <web-view :src="url"></web-view>
+  </view>
 </template>
 
 <script>
-	export default {
-		data() {
-			return {
-				imgShow: false,
-				index: 0,
-				showBtn: false,
-				screenHeight: 0,
-				imgLength: 0,
-				providerList: [],
-				data: [],
-				detailDec: ""
-			}
-		},
-		onLoad(e) {
-			// #ifdef APP-PLUS
-			if (plus.os.name === 'Android') {
-				this.showBtn = true;
-			}
-			// #endif
-			this.screenHeight = uni.getSystemInfoSync().windowHeight;
-			this.detailDec = e.data;
-			let data = JSON.parse(decodeURIComponent(e.data));
-			this.imgLength = data.img_num;
-			this.data.push(data.img_src);
-			this.getData(data.id);
-			uni.setNavigationBarTitle({
-				title: "1/" + this.imgLength
-			});
-			// 获取分享通道
-			uni.getProvider({
-				service: "share",
-				success: (e) => {
-					let data = []
-					for (let i = 0; i < e.provider.length; i++) {
-						switch (e.provider[i]) {
-							case 'weixin':
-								data.push({
-									name: '分享到微信好友',
-									id: 'weixin'
-								})
-								data.push({
-									name: '分享到微信朋友圈',
-									id: 'weixin',
-									type: 'WXSenceTimeline'
-								})
-								break;
-							case 'qq':
-								data.push({
-									name: '分享到QQ',
-									id: 'qq'
-								})
-								break;
-							default:
-								break;
-						}
-					}
-					this.providerList = data;
-				},
-				fail: (e) => {
-					console.log("获取登录通道失败", e);
-				}
-			});
-		},
-		onShareAppMessage() {
-			return {
-				title: '欢迎使用uni-app看图模板',
-				path: '/pages/detail/detail?data=' + this.detailDec,
-				imageUrl: this.data[this.index]
-			}
-		},
-		onNavigationBarButtonTap(e) {
-			if (e.index === 0) {
-				// #ifdef APP-PLUS
-				if (this.providerList.length === 0) {
-					uni.showModal({
-						title: '当前环境无分享渠道!',
-						showCancel: false
-					})
-					return;
-				}
-				let itemList = this.providerList.map(function(value) {
-					return value.name
-				})
-				uni.showActionSheet({
-					itemList: itemList,
-					success: (res) => {
-						uni.share({
-							provider: this.providerList[res.tapIndex].id,
-							scene: this.providerList[res.tapIndex].type && this.providerList[res.tapIndex].type === 'WXSenceTimeline' ?
-								'WXSenceTimeline' : 'WXSceneSession',
-							type: 0,
-							title: 'uni-app模版',
-							summary: '欢迎使用uni-app模版',
-							imageUrl: this.data[this.index],
-							href: 'https://uniapp.dcloud.io',
-							success: (res) => {
-								console.log('success:' + JSON.stringify(res));
-							},
-							fail: (e) => {
-								uni.showModal({
-									content: e.errMsg,
-									showCancel: false
-								})
-							}
-						});
-					}
-				});
-				// #endif
-				// #ifdef H5
-				this.collect();
-				// #endif
-			}
-		},
-		methods: {
-			download() {
-				uni.downloadFile({
-					url: this.data[this.index],
-					success: (e) => {
-						uni.saveImageToPhotosAlbum({
-							filePath: e.tempFilePath,
-							success: () => {
-								uni.showToast({
-									icon: 'none',
-									title: '已保存到手机相册'
-								})
-							},
-							fail: () => {
-								uni.showToast({
-									icon: 'none',
-									title: '保存到手机相册失败'
-								})
-							}
-						});
-					},
-					fail: (e) => {
-						uni.showModal({
-							content: '下载失败,' + e.errMsg,
-							showCancel: false
-						})
-					}
-				})
-			},
-			collect() {
-				uni.showToast({
-					icon: 'none',
-					title: '点击收藏按钮'
-				})
-			},
-			//#ifdef APP-PLUS
-			setting() {
-				uni.showToast({
-					icon: 'none',
-					title: '正在设为壁纸'
-				})
-				setTimeout(() => {
-					var WallpaperManager = plus.android.importClass('android.app.WallpaperManager');
-					var Main = plus.android.runtimeMainActivity();
-					var wallpaperManager = WallpaperManager.getInstance(Main);
-					plus.android.importClass(wallpaperManager);
-					var BitmapFactory = plus.android.importClass('android.graphics.BitmapFactory');
-					uni.downloadFile({
-						url: this.data[this.index],
-						success: (e) => {
-							var filePath = plus.io.convertLocalFileSystemURL(e.tempFilePath);
-							var bitmap = BitmapFactory.decodeFile(filePath);
-							try {
-								wallpaperManager.setBitmap(bitmap);
-								uni.showToast({
-									icon: 'none',
-									title: '壁纸设置成功'
-								})
-							} catch (e) {
-								uni.showToast({
-									icon: 'none',
-									title: '壁纸设置失败'
-								})
-							}
-						},
-						fail: () => {
-							uni.showToast({
-								icon: 'none',
-								title: '壁纸设置失败'
-							})
-						}
-					})
-				}, 100)
-			},
-			//#endif
-			swpierChange(e) {
-				this.index = e.detail.current;
-				uni.setNavigationBarTitle({
-					title: e.detail.current + 1 + '/' + this.imgLength
-				})
-			},
-			preImg(index) {
-				if (this.imgShow) { //防止点击过快导致重复调用 
-					return;
-				}
-				this.imgShow = true;
-				setTimeout(() => {
-					this.imgShow = false;
-				}, 1000)
-				setTimeout(() => {
-					uni.previewImage({
-						current: this.data[index],
-						urls: this.data
-					})
-				}, 150)
-			},
-			getData(e) {
-				uni.request({
-					url: this.$serverUrl + '/api/picture/detail.php?id=' + e,
-					success: (res) => {
-						if (res.data.code !== 0) {
-							uni.showModal({
-								content: '请求失败,失败原因:' + res.data.msg,
-								showCancel: false
-							})
-							return;
-						}
+export default {
+  data() {
+    return {
+      url: "",
+    };
+  },
+  onLoad(e) {
+    this.url = `https://show.3dqueen.cloud/share.html?id=${e.id}`;
+  },
+  onShareAppMessage() {
+    return {
+      title: "欢迎使用uni-app看图模板",
+      path: "/pages/detail/detail?data=" + this.detailDec,
+      imageUrl: this.data[this.index],
+    };
+  },
 
-						this.data = this.data.concat(res.data.data);
-					},
-					fail: () => {
-						uni.showModal({
-							content: '请求失败,请重试!',
-							showCancel: false
-						})
-					}
-				})
-			}
-		}
-	}
+  methods: {},
+};
 </script>
 
 <style>
-	page {
-		background-color: #000;
-		height: 100%;
-	}
-
-	swiper {
-		flex: 1;
-		width: 750upx;
-		background-color: #000;
-		display: flex;
-		flex-direction: column;
-	}
-
-	swiper-item {
-		display: flex;
-		align-items: center;
-	}
-
-	image {
-		width: 750upx;
-		height: 1125upx;
-	}
+page {
+  background-color: #fff;
+  height: 100%;
+}
 </style>

+ 151 - 0
src/pages/index/index.vue

@@ -0,0 +1,151 @@
+<template>
+  <view class="index">
+    <block v-for="item in list" :key="item._id">
+      <view class="card" @click="goDetail(item)">
+        <image class="card-img" :src="item.thumbnail" mode="aspectFill"></image>
+        <text class="card-num-view">{{ item.views }} 次浏览</text>
+        <view class="card-bottm row">
+          <view class="car-title-view row">
+            <text class="card-title">{{ item.title }}</text>
+          </view>
+        </view>
+      </view>
+    </block>
+    <view class="loadMore">
+      <text>加载中...</text>
+    </view>
+  </view>
+</template>
+
+<script>
+export default {
+  data() {
+    return {
+      refreshing: false,
+      list: [],
+      fetchPageNum: 1,
+    };
+  },
+  onLoad() {
+    this.getData();
+  },
+  onReachBottom() {
+    console.log("滑动到页面底部");
+    this.getData();
+  },
+  onPullDownRefresh() {
+    console.log("下拉刷新");
+    this.refreshing = true;
+    this.getData();
+  },
+  methods: {
+    getData() {
+      uni.request({
+        url:
+          this.$serverUrl + "/h5/list?page=" + this.fetchPageNum + "&size=10",
+        header: {
+          Authorization: "Bearer " + uni.getStorageSync("access-token"),
+        },
+        success: (ret) => {
+          //   console.log("data", ret.data);
+          if (ret.statusCode !== 200 || ret.data.errorNo !== 200) {
+            console.log("失败!");
+          } else {
+            const list = ret.data.result.list;
+            if (this.refreshing) {
+              this.refreshing = false;
+              uni.stopPullDownRefresh();
+              this.list = list;
+              this.fetchPageNum = 2;
+            } else {
+              this.list = this.list.concat(list);
+              this.fetchPageNum += 1;
+            }
+          }
+        },
+      });
+    },
+    goDetail(data) {
+      uni.navigateTo({
+        url: "../detail/detail?id=" + data._id,
+      });
+    },
+  },
+};
+</script>
+
+<style>
+.card {
+  flex-direction: column;
+  position: relative;
+  margin: 20rpx;
+  border-radius: 10rpx;
+  overflow: hidden;
+  background-color: #ffffff;
+}
+
+.card-img {
+  width: 710rpx;
+  height: 710rpx;
+}
+
+.card-num {
+  color: #ffffff;
+  font-size: 13px;
+  text-align: center;
+}
+
+.card-num-view {
+  position: absolute;
+  top: 20rpx;
+  right: 20rpx;
+  line-height: 1;
+  display: inline-block;
+  padding: 3px 6px;
+  color: #ffffff;
+  font-size: 12px;
+  text-align: center;
+  justify-content: center;
+  align-items: center;
+  border-radius: 15px;
+  background-color: #41969c;
+}
+
+.card-bottm {
+  justify-content: center;
+  align-items: center;
+}
+
+.card-share-view {
+  justify-content: center;
+  align-items: center;
+  padding: 14rpx 0;
+  color: #41969c;
+  margin: 20rpx 20rpx 20rpx;
+  font-size: 30rpx;
+}
+
+.card-share-view:before {
+  content: "\e62d";
+}
+
+.car-title-view {
+  flex: 1;
+  padding: 14rpx 0rpx 14rpx 20rpx;
+}
+
+.card-title {
+  flex: 1;
+  font-size: 30rpx;
+  text-align: left;
+  color: #555555;
+  text-overflow: ellipsis;
+  lines: 2;
+  display: -webkit-box;
+  white-space: normal;
+  display: -webkit-box;
+  -webkit-box-orient: vertical;
+  -webkit-line-clamp: 2;
+  overflow: hidden;
+}
+</style>

+ 96 - 0
src/pages/login/index.vue

@@ -0,0 +1,96 @@
+<template>
+  <view class="content">
+    <image class="bg" src="/static/gr_bg.png"></image>
+    <image class="logo" src="/static/logo.png"></image>
+    <view>
+      <button
+        type="default"
+        class="btn btn_phone"
+        @click="phoneLogin"
+        style="color: #fff; background-color: #5a7bef"
+      >
+        手机号登录
+      </button>
+      <button
+        open-type="getPhoneNumber"
+        @getphonenumber="getPhoneNumber"
+        class="btn btn_wechat"
+        type="primary"
+      >
+        微信登录
+      </button>
+    </view>
+  </view>
+</template>
+
+<script>
+import { login } from "../../services/https/user";
+
+export default {
+  data() {
+    return {
+      jsCode: "",
+      redirect: "",
+    };
+  },
+  onLoad(options) {
+    this.redirect = options.redirect;
+    wx.login({
+      success: (res) => {
+        this.jsCode = res.code;
+      },
+    });
+  },
+  methods: {
+    phoneLogin() {
+      uni.navigateTo({
+        url: "/pages/login/login",
+      });
+    },
+    async getPhoneNumber(e) {
+      const res = await login({ jsCode: this.jsCode, code: e.detail.code });
+      if (res.errorNo !== 200) return;
+      const token = res.result.token;
+      uni.reLaunch({
+        url: `/pages/index/index?token=${token}&redirect=${this.redirect}`,
+      });
+    },
+  },
+};
+</script>
+
+<style>
+.content {
+  height: 100vh;
+  display: flex;
+  flex-direction: column;
+  align-items: center;
+  justify-content: center;
+}
+.bg {
+  position: absolute;
+  left: 0;
+  bottom: 0;
+  display: block;
+  width: 100%;
+  height: 100%;
+  z-index: -999;
+}
+.logo {
+  width: 154rpx;
+  height: 176rpx;
+}
+.btn {
+  width: 600rpx;
+  border-radius: 48rpx;
+  overflow: hidden;
+}
+.btn_phone {
+  margin-top: 100rpx;
+  background-color: #5a7bef;
+}
+.btn_wechat {
+  margin-top: 60rpx;
+  margin-bottom: 100rpx;
+}
+</style>

+ 142 - 32
src/pages/login/login.vue

@@ -1,40 +1,150 @@
 <template>
-	<form class='loginView' @submit="login">
-		<view class="input-view">
-			<view class="label-view">
-				<text class="label">账号 </text>
-			</view>
-			<input class="input" type="text" placeholder="请输入用户名" name="nameValue" />
-		</view>
-		<view class="input-view">
-			<view class="label-view">
-				<text class="label">密码</text>
-			</view>
-			<input class="input" type="password" placeholder="请输入密码" name="passwordValue" />
-		</view>
-		<view class="button-view">
-			<button type="default" class="login" hover-class="hover" formType="submit">登录</button>
-			<button type="default" class="register" hover-class="hover" @click="register">免费注册</button>
-		</view>
-	</form>
+  <form class="loginView" @submit="login">
+    <view class="input-view">
+      <view class="label-view">
+        <text class="label">账号 </text>
+      </view>
+      <input
+        class="input"
+        type="text"
+        placeholder="请输入用户名"
+        name="nameValue"
+      />
+    </view>
+    <view class="input-view">
+      <view class="label-view">
+        <text class="label">密码</text>
+      </view>
+      <input
+        class="input"
+        type="password"
+        placeholder="请输入密码"
+        name="passwordValue"
+      />
+    </view>
+    <view class="button-view">
+      <button
+        type="default"
+        class="login"
+        hover-class="hover"
+        formType="submit"
+      >
+        登录
+      </button>
+      <button
+        type="default"
+        class="register"
+        hover-class="hover"
+        @click="register"
+      >
+        免费注册
+      </button>
+    </view>
+  </form>
 </template>
 
 <script>
-	export default {
-		data() {
-			return {};
-		},
-		methods: {
-			login(e) {
-				console.log("得到账号:"+ e.detail.value.nameValue + ';得到密码:' + e.detail.value.passwordValue)
-			},
-			register() {
-				console.log("前往注册页面")
-			}
-		}
-	}
+import { pwdLogin } from "../../services/https/user";
+export default {
+  data() {
+    return {};
+  },
+  methods: {
+    async login(e) {
+      const res = await pwdLogin({
+        key: "queenshow",
+        password: e.detail.value.passwordValue,
+        phone: e.detail.value.nameValue,
+      });
+      if (res.errorNo !== 200) return;
+      const token = res.result.token;
+      uni.setStorageSync("access-token", token);
+      uni.reLaunch({
+        url: `/pages/index/index`,
+      });
+    },
+    register() {
+      console.log("前往注册页面");
+    },
+  },
+};
 </script>
 
 <style>
-	
+.loginView {
+  display: flex;
+  flex-direction: column;
+  align-items: center;
+  width: 750rpx;
+  min-height: 100vh;
+  padding-top: 30rpx;
+}
+
+.input-view {
+  border-bottom-style: solid;
+  border-bottom-width: 1rpx;
+  border-bottom-color: #ddd;
+  background-color: #fff;
+  flex-direction: row;
+  width: 710rpx;
+  margin: 0 20rpx;
+  padding: 20rpx 20rpx;
+  box-sizing: border-box;
+}
+
+.label-view {
+  width: 100rpx;
+  height: 60rpx;
+  align-items: center;
+  margin-right: 30rpx;
+}
+
+.label {
+  flex: 1;
+  line-height: 60rpx;
+  font-size: 38rpx;
+  color: #555;
+  text-align: left;
+}
+
+.input {
+  flex: 1;
+  height: 60rpx;
+  font-size: 38rpx;
+  align-items: center;
+}
+
+.button-view {
+  width: 750rpx;
+  margin-top: 50rpx;
+  padding: 0 20rpx;
+  box-sizing: border-box;
+  flex-direction: column;
+}
+
+button {
+  width: 710rpx;
+  height: 80rpx;
+  line-height: 80rpx;
+  text-align: center;
+  font-size: 38rpx;
+}
+
+button.login {
+  background-color: #41969c;
+  color: #fff;
+}
+
+button.register {
+  margin-top: 30rpx;
+  color: #41969c;
+  background-color: #fff;
+  border-color: #41969c;
+  border-width: 2rpx;
+}
+
+.register.hover,
+.login.hover {
+  opacity: 0.6;
+}
 </style>

+ 0 - 153
src/pages/new/new.vue

@@ -1,153 +0,0 @@
-<template>
-	<view class="index">
-		<block v-for="item in list" :key="item.img_src">
-			<view class="card" @click="goDetail(item)">
-				<image class="card-img" :src="item.img_src" mode="aspectFill"></image>
-				<text class="card-num-view">{{item.img_num}}P</text>
-				<view class="card-bottm row">
-					<view class="car-title-view row">
-						<text class="card-title">{{item.title}}</text>
-					</view>
-					<view @click.stop="share(item)" class="card-share-view"></view>
-				</view>
-			</view>
-		</block>
-		<text class="loadMore">加载中...</text>
-	</view>
-</template>
-
-<script>
-	export default {
-		data() {
-			return {
-				refreshing: false,
-				providerList: [],
-				list: [],
-				fetchPageNum: 1
-			}
-		},
-		onLoad() {
-			this.getData();
-			uni.getProvider({
-				service: 'share',
-				success: (e) => {
-					let data = []
-					for (let i = 0; i < e.provider.length; i++) {
-						switch (e.provider[i]) {
-							case 'weixin':
-								data.push({
-									name: '分享到微信好友',
-									id: 'weixin'
-								})
-								data.push({
-									name: '分享到微信朋友圈',
-									id: 'weixin',
-									type: 'WXSenceTimeline'
-								})
-								break;
-							case 'qq':
-								data.push({
-									name: '分享到QQ',
-									id: 'qq'
-								})
-								break;
-							default:
-								break;
-						}
-					}
-					this.providerList = data;
-				},
-				fail: (e) => {
-					console.log('获取分享通道失败', e);
-				}
-			});
-		},
-		onReachBottom() {
-			console.log('滑动到页面底部')
-			this.getData();
-		},
-		onPullDownRefresh() {
-			console.log('下拉刷新');
-			this.refreshing = true;
-			this.getData();
-		},
-		methods: {
-			getData() {
-				uni.request({
-					url: this.$serverUrl + '/api/picture/posts.php?page=' + (this.refreshing ? 1 : this.fetchPageNum) +
-						'&per_page=5',
-					success: (ret) => {
-						console.log('data', ret);
-						if (ret.statusCode !== 200) {
-							console.log('失败!');
-						} else {
-							if (this.refreshing && ret.data[0].id === this.list[0].id) {
-								uni.showToast({
-									title: '已经最新',
-									icon: 'none',
-								})
-								this.refreshing = false;
-								uni.stopPullDownRefresh();
-								return;
-							}
-							if (this.refreshing) {
-								this.refreshing = false;
-								uni.stopPullDownRefresh()
-								this.list = ret.data;
-								this.fetchPageNum = 2;
-							} else {
-								this.list = this.list.concat(ret.data);
-								this.fetchPageNum += 1;
-							}
-						}
-					}
-				});
-			},
-			goDetail(e) {
-				uni.navigateTo({
-					url: '../detail/detail?data=' + encodeURIComponent(JSON.stringify(e))
-				})
-			},
-			share(e) {
-				if (this.providerList.length === 0) {
-					uni.showModal({
-						title: '当前环境无分享渠道!',
-						showCancel: false
-					})
-					return;
-				}
-				let itemList = this.providerList.map(function(value) {
-					return value.name
-				})
-				uni.showActionSheet({
-					itemList: itemList,
-					success: (res) => {
-						uni.share({
-							provider: this.providerList[res.tapIndex].id,
-							scene: this.providerList[res.tapIndex].type && this.providerList[res.tapIndex].type === 'WXSenceTimeline' ?
-								'WXSenceTimeline' : 'WXSceneSession',
-							type: 0,
-							title: 'uni-app模版',
-							summary: e.title,
-							imageUrl: e.img_src,
-							href: 'https://uniapp.dcloud.io',
-							success: (res) => {
-								console.log('success:' + JSON.stringify(res));
-							},
-							fail: (e) => {
-								uni.showModal({
-									content: e.errMsg,
-									showCancel: false
-								})
-							}
-						});
-					}
-				})
-			}
-		}
-	}
-</script>
-
-<style>
-
-</style>

+ 8 - 0
src/services/https/promotion.js

@@ -0,0 +1,8 @@
+import request from "../request";
+
+export function login(data) {
+  return request("/wechat/mini/login", {
+    method: "POST",
+    data,
+  });
+}

+ 19 - 0
src/services/https/user.js

@@ -0,0 +1,19 @@
+import request from "../request";
+
+export function login(data) {
+  return request("/wechat/mini/login", {
+    method: "POST",
+    data,
+  });
+}
+
+export function pwdLogin(data) {
+  return request("/login/password", {
+    method: "POST",
+    data,
+  });
+}
+
+export function getUserInfo() {
+  return request("/profile", { method: "GET" });
+}

+ 38 - 0
src/services/request.js

@@ -0,0 +1,38 @@
+import { Dict_Apis } from "../dict/apis";
+
+const baseURL = Dict_Apis.auth;
+
+export default function (url, options = {}) {
+  return new Promise((resolve) => {
+    if (options.method && options.method !== "GET")
+      uni.showLoading({ title: "加载中" });
+
+    uni.request({
+      ...options,
+      url: (options.baseURL ? options.baseURL : baseURL) + url,
+      header: {
+        Authorization: "Bearer " + uni.getStorageSync("access-token"),
+      },
+      success(res) {
+        uni.hideLoading();
+        if (res.statusCode === 200) {
+          let data = res.data;
+          resolve(data);
+        } else {
+          resolve({
+            code: res.statusCode,
+            msg: res.errMsg,
+          });
+        }
+      },
+      fail(err) {
+        uni.hideLoading();
+        console.log("error", err);
+        resolve({
+          code: 500,
+          msg: err.errMsg,
+        });
+      },
+    });
+  });
+}

BIN
src/static/app-icon.png


BIN
src/static/avatar.png


BIN
src/static/gr_bg.png


BIN
src/static/icon.ttf


BIN
src/static/logo.png


+ 0 - 44
src/template.h5.html

@@ -1,44 +0,0 @@
-<!DOCTYPE html>
-<html lang="zh-CN">
-	<head>
-		<meta charset="utf-8">
-		<meta http-equiv="X-UA-Compatible" content="IE=edge">
-		<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
-		<title>
-			<%= htmlWebpackPlugin.options.title %>
-		</title>
-		<script>
-			var UA = window.navigator.userAgent.toLowerCase();
-			var isAndroid = UA.indexOf('android') > 0;
-			var isIOS = /iphone|ipad|ipod|ios/.test(UA);
-			if (!(isAndroid || isIOS)) {
-				// 正式发布的时候使用,开发期间不启用。
-				// window.location.href = '/demo/picture/website/pcguide.html';
-			}
-		</script>
-		<script>
-			document.addEventListener('DOMContentLoaded', function() {
-				document.documentElement.style.fontSize = document.documentElement.clientWidth / 20 + 'px'
-			})
-		</script>
-		<link rel="stylesheet" href="<%= BASE_URL %>static/index.css" />
-	</head>
-	<body>
-		<!-- 该文件为 H5 平台的模板 HTML,并非应用入口,请勿直接运行此文件。 -->
-		<!-- 详见文档:https://uniapp.dcloud.io/collocation/manifest?id=h5-template -->
-		<noscript>
-			<strong>Please enable JavaScript to continue.</strong>
-		</noscript>
-		<div id="app"></div>
-		<!-- built files will be auto injected -->
-		<script>
-			var _hmt = _hmt || [];
-			(function() {
-				var hm = document.createElement("script");
-				hm.src = "https://hm.baidu.com/hm.js?fe3b7a223fc08c795f0f4b6350703e6f";
-				var s = document.getElementsByTagName("script")[0];
-				s.parentNode.insertBefore(hm, s);
-			})();
-		</script>
-	</body>
-</html>