Просмотр исходного кода

Merge branch 'master' of http://120.79.166.78:7071/zhongzheng-edu/zz--front

Tang 4 лет назад
Родитель
Сommit
2518cf82cc

+ 1 - 4
common/httpList/login.js

@@ -30,11 +30,8 @@ export default {
 	refreshUserInfo() {
 		this.getInfo().then(resdata => {
 			if(resdata.data.code == 200){
-				console.log("刷新")
-		//		store.state.userInfo = resdata.data.data;
 			store.commit('updateUserInfo',{userInfo:resdata.data.data})
-			}
-			
+			}	
 		});
 	}
 }

+ 9 - 0
common/methodTool.js

@@ -1,4 +1,5 @@
 const BASE_IMG_URL = 'https://file-dev.xyyxt.net/'
+import store from '@/store/index.js'  
 export default {
 	isLogin() {
 		if(uni.getStorageSync('union_id')){
@@ -16,4 +17,12 @@ export default {
 		}
 		return BASE_IMG_URL+url
 	},
+	exit() {
+		uni.removeStorageSync('union_id')
+		uni.removeStorageSync('token')
+		store.state.userInfo = null
+		uni.reLaunch({
+			url: '/pages/index/index'
+		});
+	},
 }

+ 29 - 1
package-lock.json

@@ -1,8 +1,36 @@
 {
   "name": "zz-applet",
   "version": "1.0.0",
-  "lockfileVersion": 1,
+  "lockfileVersion": 2,
   "requires": true,
+  "packages": {
+    "": {
+      "name": "zz-applet",
+      "version": "1.0.0",
+      "license": "ISC",
+      "dependencies": {
+        "jweixin-module": "^1.6.0",
+        "tki-qrcode": "^0.1.6",
+        "uview-ui": "^1.8.3"
+      },
+      "devDependencies": {}
+    },
+    "node_modules/jweixin-module": {
+      "version": "1.6.0",
+      "resolved": "https://registry.npmjs.org/jweixin-module/-/jweixin-module-1.6.0.tgz",
+      "integrity": "sha512-dGk9cf+ipipHmtzYmKZs5B2toX+p4hLyllGLF6xuC8t+B05oYxd8fYoaRz0T30U2n3RUv8a4iwvjhA+OcYz52w=="
+    },
+    "node_modules/tki-qrcode": {
+      "version": "0.1.6",
+      "resolved": "https://registry.npmjs.org/tki-qrcode/-/tki-qrcode-0.1.6.tgz",
+      "integrity": "sha512-EnnlS8psowC7PsW3MDYcxvJYkuklX3WAZ/BYanR4TdBHTu74GfjTBX8Y16REP+AeDENiVtBPh4jtTRL2P736hQ=="
+    },
+    "node_modules/uview-ui": {
+      "version": "1.8.3",
+      "resolved": "https://registry.npmjs.org/uview-ui/-/uview-ui-1.8.3.tgz",
+      "integrity": "sha512-DqKc+qRrOZLPcyfWv4b0HspSS9n1Cd6BbgKiYEv9rjTAnWoqJV7rXsvWqZdr5iKGP5EMNbNS741GLNw4sIHbpw=="
+    }
+  },
   "dependencies": {
     "jweixin-module": {
       "version": "1.6.0",

+ 9 - 0
pages.json

@@ -224,6 +224,15 @@
 					"bounce": "none"
 				}
 			}
+		},{
+			"path": "payment/payment",
+			"style": {
+				"navigationBarTitleText": "支付",
+				"app-plus": {
+					"titleNView": false, //禁用原生导航栏 
+					"bounce": "none"
+				}
+			}
 		}],
 		"plugins": {
 			"polyv-player": {

+ 7 - 1
pages2/course/keynote.vue

@@ -183,7 +183,13 @@
 				this.current = index;
 			},
 			jumpRead(){
-				this.$navTo.togo('/pages2/course/read', {})
+				if(!this.$method.isLogin()){
+					this.$navTo.togo('/pages/login/login');
+				}else{
+					this.$navTo.togo('/pages2/payment/payment', {})
+				//	this.$navTo.togo('/pages2/course/read', {})
+				}
+				
 			}
 		
 		},

+ 49 - 4
pages2/payment/payment.vue

@@ -1,8 +1,8 @@
 <template>
 	<view style="padding: 30rpx;" >
 		<view class="bd">
-			<text class="font1">¥{{price}}</text>
 			<text class="font2">付款金额</text>
+			<text class="font1">¥{{price}}</text>
 			<view class="flex">
 				<view class="flex_item">付款方式</view>
 				<view>微信支付</view>
@@ -13,7 +13,6 @@
 </template>
 
 <script>
-	import wxPay from '@/common/wxPay.js'
 	export default {
 		data() {
 			return {
@@ -27,7 +26,6 @@
 		},
 		methods: {
 			pay(){
-				
 			}
 		
 		},
@@ -38,6 +36,53 @@
 <style scope>
 	
 page {
-		background: #FFFFFF;
+		background: #f3f3f3;
+		font-size: 28rpx;
+	}
+
+	.flex {
+		display: flex;
+		align-items: center;
+	}
+
+	.flex_item {
+		flex: 1;
+	}
+
+	.container {
+		padding: 30rpx;
+	}
+
+	.container .bd {
+		background: #fff;
+		border-radius: 10rpx;
+		padding: 100rpx 30rpx 50rpx;
+	}
+
+	.container .bd .font1 {
+		display: block;
+		text-align: center;
+		font-size: 88rpx;
+	}
+
+	.container .bd .font2 {
+		display: block;
+		text-align: center;
+		font-size: 30rpx;
+		margin: 30rpx 0 60rpx;
+		color: #525252;
+	}
+
+	.container .bd .flex {
+		border-bottom: 1px solid #eee;
+		padding: 30rpx 0;
+		margin-bottom: 30rpx;
+	}
+
+	.container .bd .btn {
+		color: #fff;
+		font-size: 28rpx;
+		padding: 10rpx 0;
+		background: #eb3b2f;
 	}
 </style>

+ 34 - 0
pages2/wd/avatar.vue

@@ -11,6 +11,11 @@
 					<u-input v-model="userInfo.nickname"  />
 				</view>
 			</u-modal>
+			<view style="position: fixed;bottom: 50rpx;width: 100%;padding: 20rpx;">
+				<button  @click="submit" class="submit_btn">保存</button>
+				
+				<button  @click="exit" class="exit_btn">退出登录</button>
+			</view>
 	</view>
 </template>
 
@@ -28,6 +33,23 @@
 		onShow(){
 		},
 		methods: {
+			submit(){
+				if(this.userInfo.nickname==''){
+					return
+				}
+				this.$api.appuserInfo(this.userInfo).then(res => {
+					if (res.data.code === 200) {
+						uni.showToast({
+							title: '提交成功',
+							icon: 'none'
+						});
+						self.$api.refreshUserInfo()
+					}
+				});
+			},
+			exit(){
+				this.$method.exit()
+			},
 			editNickName(){
 				this.show = true
 			},
@@ -48,6 +70,18 @@
 </script>
 
 <style scope>
+	.exit_btn{
+		font-size: 30rpx;
+		margin-top: 30rpx;
+		padding: 5rpx;
+	}
+	.submit_btn{
+		background-color: #32467B !important;
+		border-color: #32467B !important;
+		color: #FFFFFF;
+		font-size: 30rpx;
+		padding: 5rpx;
+	}
 	.slot-content{
 		margin: 30rpx;
 		color: #606266;

+ 3 - 2
pages2/wd/info.vue

@@ -103,7 +103,7 @@
 				</u-form-item> -->
 			</u-form>
 		</view>
-		<button type="success" @click="resultForm" class="submit_btn">提交</button>
+		<button  @click="resultForm" class="submit_btn">提交</button>
 	</view>
 </template>
 
@@ -282,7 +282,7 @@ export default {
 						title: '提交成功',
 						icon: 'none'
 					});
-					self.getUserInfos();
+					self.$api.refreshUserInfo() 
 				}
 			});
 		},
@@ -383,6 +383,7 @@ export default {
 		border-color: #32467B !important;
 		color: #FFFFFF;
 		font-size: 30rpx;
+		padding: 5rpx;
 	}
 .u-form-item__message.data-v-5e7216f1 {
 	padding: 0px !important;