zs 1 yıl önce
ebeveyn
işleme
546cc32bcd

+ 37 - 0
App.vue

@@ -6,11 +6,48 @@
 		},
 		onShow: function() {
 			const that = this;
+			that.search();
 		},
 		onHide: function() {
 			console.log('App Hide')
 		},
 		methods: {
+			search() {
+				const that = this;
+				uni.login({
+					success: function(res) {
+						if (res.code) {
+							uni.getStorage({
+								key: 'openid',
+								success: function(res) {},
+								fail: async function(err) {
+									const aee = await that.$api('/tool/app', 'GET', {
+										js_code: res.code,
+										config: that.$config.wx_projectkey
+									})
+									if (aee.errcode == '0') {
+										uni.setStorage({
+											key: "openid",
+											data: aee.data.openid
+										})
+									} else {
+										uni.showToast({
+											title: aee.errmsg,
+											icon: 'none'
+										})
+									}
+								}
+							})
+						} else {
+							uni.showToast({
+								title: res.errMsg,
+								icon: 'none'
+							})
+						}
+					}
+				});
+
+			},
 			// 强制更新
 			forceUpdate() {
 				const that = this;

+ 36 - 21
common/css/iconfont.css

@@ -1,21 +1,36 @@
-@font-face {
-	font-family: "iconfont"; 
-	src: url('@/common/css/iconfont.ttf') format('truetype');
-}
-
-.iconfont {
-  font-family: "iconfont" !important;
-  font-size: 16px;
-  font-style: normal;
-  -webkit-font-smoothing: antialiased;
-  -moz-osx-font-smoothing: grayscale;
-}
-
-.icon-shanchu:before {
-  content: "\e68a";
-}
-
-.icon-dayuhao:before {
-  content: "\e625";
-}
-
+@font-face {
+	font-family: "iconfont";
+	src: url('@/common/css/iconfont.ttf') format('truetype');
+}
+
+.iconfont {
+	font-family: "iconfont" !important;
+	font-size: 16px;
+	font-style: normal;
+	-webkit-font-smoothing: antialiased;
+	-moz-osx-font-smoothing: grayscale;
+}
+
+.icon-yonghu:before {
+	content: "\e614";
+}
+
+.icon-shanchu:before {
+	content: "\e68a";
+}
+
+.icon-dayuhao:before {
+	content: "\e625";
+}
+
+.icon-gengduo:before {
+	content: "\1017a";
+}
+
+.icon-erweima:before {
+	content: "\1017b";
+}
+
+.icon-shezhi:before {
+	content: "\1017c";
+}

BIN
common/css/iconfont.ttf


+ 6 - 16
config.js

@@ -16,28 +16,18 @@ export default {
 	share: {},
 	menuList: [{
 			icon: "icon-fabu",
-			title: "我的作品",
-			route: "pagesMy/article/index",
+			title: "基本信息",
+			route: "pagesMy/basic/index",
 		},
 		{
 			icon: "icon-youhuijuan",
-			title: "我的优惠卷",
-			route: "pagesMy/coupon/index",
+			title: "群组信息",
+			route: "pagesMy/group/index",
 		},
 		{
 			icon: "icon-7yijianfankui",
-			title: "意见反馈",
-			route: "pagesMy/opinion/index",
-		},
-		{
-			icon: "icon-zaixiankefu",
-			title: "客服电话",
-			route: "pagesMy/service/index",
-		},
-		{
-			icon: "icon-zhanghaoshezhi",
-			title: "账号设置",
-			route: "pagesMy/account/index",
+			title: "答复记录",
+			route: "pagesMy/answer/index",
 		}
 	],
 	china: [

+ 13 - 13
main.js

@@ -4,19 +4,19 @@ import App from './App'
 
 Vue.config.productionTip = false
 
-// // jwt解析
-// import weappJwt from '@/common/weapp-jwt.js';
-// Vue.prototype.$jwt = weappJwt;
-// // requset请求
-// import {
-// 	requestBase,
-// 	requestFile
-// } from '@/common/api.js';
-// Vue.prototype.$api = requestBase;
-// Vue.prototype.$apifile = requestFile;
-// // 配置文件
-// import config from '@/config.js';
-// Vue.prototype.$config = config;
+// jwt解析
+import weappJwt from '@/common/weapp-jwt.js';
+Vue.prototype.$jwt = weappJwt;
+// requset请求
+import {
+	requestBase,
+	requestFile
+} from '@/common/api.js';
+Vue.prototype.$api = requestBase;
+Vue.prototype.$apifile = requestFile;
+// 配置文件
+import config from '@/config.js';
+Vue.prototype.$config = config;
 
 App.mpType = 'app'
 

+ 14 - 11
pages.json

@@ -8,15 +8,6 @@
 				}
 			}
 		},
-		{
-			"path": "pages/login/index",
-			"style": {
-				"navigationBarTitleText": "登录",
-				"app-plus": {
-					"titleNView": false //禁用原生导航栏  
-				}
-			}
-		},
 		{
 			"path": "pages/home/index",
 			"style": {
@@ -74,9 +65,21 @@
 			"root": "pagesMy",
 			"pages": [ //分包
 				{
-					"path": "index/index",
+					"path": "basic/index",
 					"style": {
-						"navigationBarTitleText": "test"
+						"navigationBarTitleText": "基本信息"
+					}
+				},
+				{
+					"path": "group/index",
+					"style": {
+						"navigationBarTitleText": "群组信息"
+					}
+				},
+				{
+					"path": "answer/index",
+					"style": {
+						"navigationBarTitleText": "答复记录"
 					}
 				}
 			]

+ 1 - 5
pages/index/index.vue

@@ -15,15 +15,11 @@
 			searchToken() {
 				const that = this;
 				try {
-					const res = uni.getStorageSync('token');
+					const res = uni.getStorageSync('openid');
 					if (res) {
 						uni.reLaunch({
 							url: `/pages/home/index`
 						})
-					} else {
-						uni.reLaunch({
-							url: `/pages/home/index`
-						})
 					}
 				} catch (e) {
 					uni.showToast({

+ 0 - 124
pages/login/index.vue

@@ -1,124 +0,0 @@
-<template>
-	<view class="main" style="background-image: url('../../static/login.png')">
-		<view class="one">
-			<text>随访小程序</text>
-			<text>登录</text>
-		</view>
-		<view class="two">
-			<uni-forms ref="valiForm" :rules="rules" :modelValue="form" label-position="top">
-				<uni-forms-item label="账号" required name="account">
-					<uni-easyinput v-model="form.account" placeholder="请输入账号" />
-				</uni-forms-item>
-				<uni-forms-item label="密码" required name="password">
-					<uni-easyinput type="password" v-model="form.password" placeholder="请输入密码" />
-				</uni-forms-item>
-			</uni-forms>
-			<button class="button" type="primary" @click="onSubmit('valiForm')">登录</button>
-		</view>
-	</view>
-</template>
-
-<script>
-	export default {
-		data() {
-			return {
-				form: {
-					account: '',
-					password: ''
-				},
-				// 校验规则
-				rules: {
-					account: {
-						rules: [{
-							required: true,
-							errorMessage: '账号不能为空'
-						}]
-					},
-					password: {
-						rules: [{
-							required: true,
-							errorMessage: '密码不能为空'
-						}]
-					}
-				},
-			}
-		},
-		onShow: function(e) {
-			const that = this;
-			that.searchToken();
-		},
-		methods: {
-			searchToken() {
-				const that = this;
-				try {
-					const res = uni.getStorageSync('token');
-					if (res) {
-						uni.reLaunch({
-							url: `/pages/home/index`
-						})
-					}
-				} catch (e) {
-					uni.showToast({
-						title: err.errmsg,
-						icon: 'error',
-						duration: 2000
-					});
-				}
-			},
-			// 登录
-			onSubmit(ref) {
-				const that = this;
-				that.$refs[ref].validate().then(async form => {
-					const arr = await that.$api(`/admin/login`, 'POST', form);
-					if (arr.errcode == '0') {
-						uni.setStorage({
-							key: 'token',
-							data: arr.data,
-							success: function(res) {
-								uni.reLaunch({
-									url: `/pages/home/index`
-								})
-							},
-							fail: function(err) {
-								console.log(err);
-							}
-						})
-					} else {
-						uni.showToast({
-							title: arr.errmsg,
-							icon: 'none'
-						})
-					}
-				})
-			},
-		}
-	}
-</script>
-
-<style lang="scss" scoped>
-	.main {
-		display: flex;
-		flex-direction: column;
-		width: 100vw;
-		height: 100vh;
-		background-size: cover;
-		background-repeat: no-repeat;
-		background-position: center;
-
-		.one {
-			padding: 30vw 10vw 20vw 10vw;
-			text-align: center;
-			font-family: 'Franklin Gothic Medium', 'Arial Narrow', Arial, sans-serif;
-			font-size: var(--font20Size);
-		}
-
-		.two {
-			padding: 2vw;
-
-			.button {
-				background: #007aff;
-				border-radius: 30px;
-			}
-		}
-	}
-</style>

pagesMy/index/index.vue → pagesMy/answer/index.vue


+ 22 - 0
pagesMy/basic/index.vue

@@ -0,0 +1,22 @@
+<template>
+	<view class="main">
+		首页
+	</view>
+</template>
+
+<script>
+	export default {
+		data() {
+			return {}
+		},
+		methods: {
+
+		}
+	}
+</script>
+
+<style lang="scss" scoped>
+	.main {
+		padding: 2vw;
+	}
+</style>

+ 22 - 0
pagesMy/group/index.vue

@@ -0,0 +1,22 @@
+<template>
+	<view class="main">
+		首页
+	</view>
+</template>
+
+<script>
+	export default {
+		data() {
+			return {}
+		},
+		methods: {
+
+		}
+	}
+</script>
+
+<style lang="scss" scoped>
+	.main {
+		padding: 2vw;
+	}
+</style>

BIN
static/login.png