高敬炎 1 yıl önce
ebeveyn
işleme
a277672606

+ 1 - 1
uni_applet/pageA/login/index.vue

@@ -15,7 +15,7 @@
 					<u--image @click='value= !value' width='16' height='16' :src="value?'/static/image/login/checked.png':'/static/image/login/no-checked.png'" radius='10' shape="square"></u--image>
 				</view>
 				登录代表您已同意<navigator
-							url="/pageA/webview?can_share=false&url=https://liangxin.zthymaoyi.com/youyuquan.html"
+							url="/pageA/webview?can_share=false&url=liangxin.zthymaoyi.com/youyuquan.html"
 							class="path" hover-class="navigator-hover">用户服务协议和隐私政策</navigator>
 			</view>
 		</view>

+ 3 - 3
uni_applet/pageA/webview.vue

@@ -1,16 +1,16 @@
 <template>
-    <web-view :src="url"></web-view>
+    <web-view :src="url1"></web-view>
 </template>
 
 <script>
 	export default {
         data() {
             return {
-                url:""
+                url1:""
             }
         },
         onLoad(option) {
-            this.url = option.url;
+            this.url1 = option.url;
         },
         methods: {
         }

+ 40 - 1
uni_applet/pages/my/my.vue

@@ -105,11 +105,13 @@
 				</u-cell-group>
 			</view>
 		</view>
+		<view v-if='userInfo.nickname' class='quit-login' @click='quitLogin'>退出登录</view>
 		<login-pop-up ref='loginpopup' :content='"手机登录后才能查看我的哦~"'></login-pop-up>
 	</view>
 </template>
 
 <script>
+	var that
 		import loginPopUp from "@/components/loginPopUp/index.vue"
 	export default {
 		components: {
@@ -126,7 +128,7 @@
 			}
 		},
 		onLoad() {
-
+			that = this
 		},
 		onShow(){
 			if(!uni.getStorageSync("userInfo").phone){
@@ -139,6 +141,34 @@
 			}
 		},
 		methods: {
+			quitLogin(){
+				uni.showModal({
+					title: '提示',
+					content: '确定退出当前账号?',
+					success (res) {
+					    if (res.confirm) {
+							uni.removeStorageSync("userInfo")
+							that.userInfo = {}
+							setTimeout(()=>{
+								that.reload()
+							},500)
+					    } else if (res.cancel) {
+					      console.log('用户点击取消')
+					    }
+					  }
+				})
+			},
+			reload() {
+			       // 页面重载
+			       const pages = getCurrentPages()
+			       // 声明一个pages使用getCurrentPages方法
+			       const curPage = pages[pages.length - 1]
+			       // 声明一个当前页面
+			       curPage.onLoad(curPage.options) // 传入参数
+			       curPage.onShow()
+			       curPage.onReady()
+			       // 执行刷新
+			   },
 			editNickName(){
 				this.$request.baseRequest('admin.unimall.commonUserInfo', 'update', {
 					commonUserInfo:JSON.stringify(this.userInfo)
@@ -192,6 +222,7 @@
 	}
 	.wrap{
 		width:92vw;
+		padding:0 20rpx;
 	}
 	.orderList{
 		display:flex;
@@ -221,4 +252,12 @@
 		width:92vw;
 		margin:0 auto;
 	}
+	.quit-login{
+		background:#fff;
+		width:91%;
+		padding:10rpx 20rpx;
+		text-align:center;
+		margin:10rpx 20rpx;
+		border-radius:10rpx;
+	}
 </style>