zhaoxw преди 4 години
родител
ревизия
df8fb3cb71
променени са 2 файла, в които са добавени 32 реда и са изтрити 6 реда
  1. 13 6
      pages/index/index.vue
  2. 19 0
      pages/user/index.vue

+ 13 - 6
pages/index/index.vue

@@ -14,12 +14,15 @@
 			</button>
 			<view class="authorize-info">{{wxPhoneData? '****************' : ''}}</view> -->
 			<!-- <view class="authorize-login" @click="getUserInfo">登录</view> -->
+			<text class="authorize-tip">提示:仅限入驻商家内部使用
+			</text>
+			<!-- <text class="underline authorize-tip">https://qianjiadi.com/merchant-web/</text> -->
 			<!-- #ifdef MP-WEIXIN -->
 			<button 
 				class="authorize-login" 
 				open-type="getUserInfo" 
 				@getuserinfo="getUserinfoWechat" withCredentials="true" >
-				登录
+				微信一键登录/注册
 			</button>
 			<!-- #endif -->
 
@@ -27,7 +30,7 @@
 			<button
 				class="authorize-login" 
 				@click="getUserinfoApp">
-				登录
+				微信一键登录/注册
 			</button>
 			<!-- #endif -->
 			<view @click="showAgreement = true" class="agreement">点击登录视为同意<text class="underline">商家入驻协议</text></view>
@@ -318,7 +321,7 @@
 								fail: () => {
 									console.log(33333, error)
 									this.$refs.uTips.show({
-										title: '微信登录授权失败',
+										title: '微信登录授权失败,请再试试',
 										type: 'warning',
 									})
 								}
@@ -369,7 +372,7 @@
 							fail: (error) => {
 								console.log(2222, error)
 								that.$refs.uTips.show({
-									title: '微信登录授权失败',
+									title: '微信登录授权失败,请再试试',
 									type: 'warning',
 								})
 							}
@@ -426,7 +429,7 @@
 					}
 				}).catch(error => {
 					this.$refs.uTips.show({
-						title: '微信登录授权失败',
+						title: '微信登录授权失败,请再试试',
 						type: 'warning',
 					})
 				})
@@ -533,7 +536,7 @@
 				width: 220px;
 				height: 20px;
 				float: left;
-				margin: 10px 5px;
+				// margin: 10px 5px;
 				font-size: 12px;
 				font-family: PingFang SC;
 				color: #FFFFFF;
@@ -565,5 +568,9 @@
 				padding: 8px;
 			}
 		}
+		
+		.underline {
+			text-decoration: underline;
+		}
 	}
 </style>

+ 19 - 0
pages/user/index.vue

@@ -70,9 +70,15 @@
 				<view class="item-btn-text">后台管理信息</view>
 				<view class="iconfont iconfangxiang"></view>
 			</view>
+			<view class="item-btn" @click="loginModal=true">
+				<view class="iconfont iconguanyu item-btn-icon"></view>
+				<view class="item-btn-text">退出登录</view>
+				<view class="iconfont iconfangxiang"></view>
+			</view>
 		</view>
 		<u-top-tips ref="uTips"></u-top-tips>
 		<u-modal v-model="modalShow" title="后台管理信息" :content="'账号:'+manageInfo.account+',密码'+ manageInfo.password"></u-modal>
+		<u-modal v-model="loginModal" content="确定退出登录?" @confirm="loginOut()" :async-close="true" :show-cancel-button="true"></u-modal>
 	</view>
 </template>
 
@@ -91,6 +97,7 @@
 				},
 				manageInfo: {},
 				modalShow: false,
+				loginModal: false,
 				num: {
 					unComment: 0, // 待评价
 					unPay: 0,  // 待付款
@@ -115,6 +122,18 @@
 			this.getNum()
 		},
 		methods: {
+			// 注销
+			loginOut() {
+			    try {
+			        uni.clearStorageSync();
+					this.loginModal = false
+					uni.reLaunch({
+						url: '/pages/index/index'
+					});
+			    } catch (e) {
+			        console.log(e, '退出登录')
+			    }
+			},
 			//  我的订单
 			orderClick(type) {
 				if(!this.userData.roleInfos.some(v=>v.menuInfos.some(vv=>vv.label == '订单管理'))){