wzx 1 year ago
parent
commit
89ddd57e57
6 changed files with 98 additions and 9 deletions
  1. 26 1
      shop/App.vue
  2. 3 0
      shop/common/api.js
  3. BIN
      shop/favicon.ico
  4. 2 2
      shop/manifest.json
  5. 19 5
      shop/pages/exchgRecord/exchgRecord.vue
  6. 48 1
      shop/pages/index/index.vue

+ 26 - 1
shop/App.vue

@@ -61,7 +61,32 @@
 		justify-content: space-evenly;
 	}
 
-	.hidden {
+	.uni-ais {
+		align-items: flex-start;
+	}
+	
+	.uni-aie {
+		align-items: flex-end;
+	}
+	
+	.uni-aibl {
+		align-items: baseline;
+	}
+	
+	.uni-hidden {
 		visibility: hidden;
 	}
+	
+	.uni-nowrap {
+		white-space: nowrap;
+	}
+	
+	.uni-ovf-hidden {
+		overflow: hidden;
+	}
+	
+	.uni-ovf-ellipsis {
+		text-overflow: ellipsis;
+	}
+	
 </style>

+ 3 - 0
shop/common/api.js

@@ -7,6 +7,9 @@ export const token = '';
 // 商家系统登录
 export const apiVerfSignIn = apiServer + 'VerfSignIn';
 
+// 商家系统退出
+export const apiVerfSignOut = apiServer + 'VerfSignOut';
+
 // 商家系统核销
 export const apiVerfExchange = apiServer + 'VerfExchange';
 

BIN
shop/favicon.ico


+ 2 - 2
shop/manifest.json

@@ -2,8 +2,8 @@
     "name" : "shop",
     "appid" : "__UNI__5D9E804",
     "description" : "彩图奔跑 - 商家小程序",
-    "versionName" : "1.0.0",
-    "versionCode" : "100",
+    "versionName" : "1.0.1",
+    "versionCode" : 101,
     "transformPx" : false,
     /* 5+App特有相关 */
     "app-plus" : {

+ 19 - 5
shop/pages/exchgRecord/exchgRecord.vue

@@ -6,9 +6,10 @@
 			<text class="topnav-right" @click="btnClose">×</text>
 		</view> -->
 		<view class="topbar uni-row uni-jcsb">
-			<view class="topbar-left">
-				<text class="btnBack" @click="btnBack">&lt;</text>
-				<text class="">{{shopInfo.shopName}}</text>
+			<view class="uni-row topbar-left">
+				<!-- <text class="btnBack" @click="btnBack">&lt;</text> -->
+				<uni-icons type="left" class="topbar-ico topbar-ico-back" @click="btnBack"></uni-icons>
+				<view class="shopName">{{shopInfo.shopName}}</view>
 			</view>
 			<!-- <text class="topbar-left" @click="btnBack"><</text>
 			<text class="topbar-left">{{shopInfo.shopName}}</text> -->
@@ -186,8 +187,6 @@
 		margin-left: 15px;
 		font-weight: 500;
 		color: #ffffff;
-		font-size: 20px;
-		text-align: center;
 	}
 
 	.topbar-right {
@@ -198,6 +197,21 @@
 		text-align: right;
 	}
 	
+	.topbar-ico {
+		color: inherit !important;
+		font-size: 24px !important;
+		/* line-height: 24px !important; */
+	}
+	
+	.topbar-ico-back {
+		padding-right: 15px;
+	}
+	
+	.shopName {
+		font-size: 20px;
+		/* line-height: 26px; */
+	}
+	
 	.btnBack {
 		font-size: 26px;
 		margin-right: 15px;

+ 48 - 1
shop/pages/index/index.vue

@@ -4,6 +4,7 @@
 			<text class="shopname">{{shopInfo.shopName}}</text>
 			<text class="button" @click="btnScanQR">扫码兑换</text>
 			<text class="button" @click="btnExchgRecord">兑换记录</text>
+			<text class="button" @click="btnSignOut">退出登录</text>
 			<!-- <text class="">{{qrCode}}</text> -->
 		</view>
 	</view>
@@ -14,6 +15,7 @@
 	import {
 		apiVerfExchange,
 		apiGetWxJsSdkConfig,
+		apiVerfSignOut,
 		checkResCode
 	} from '../../common/api.js';
 
@@ -129,11 +131,56 @@
 					},
 				});
 			},
+			verfSignOut() {
+				uni.request({
+					url: apiVerfSignOut,
+					header: {
+						"Content-Type": "application/x-www-form-urlencoded",
+						"token": this.token,
+					},
+					method: "POST",
+					data: {
+						qrCode: this.qrCode
+					},
+					success: (res) => {						
+						console.log("verfSignOut", res);
+						if (checkResCode(res)) {
+							uni.showToast({
+								icon: "none",
+								title: "您已退出登录",
+								duration: 2000
+							});
+							uni.navigateTo({
+								url: '/pages/login/login'
+							});
+						}
+					},
+					fail: (err) => {
+						console.log("verfSignOut err", err);
+					},
+				});
+			},
 			btnExchgRecord() {
 				uni.navigateTo({
 					url: "/pages/exchgRecord/exchgRecord"
 				})
-			}
+			},
+			btnSignOut() {
+				let that = this;
+				uni.showModal({
+					title: '提示',
+					content: `您确定要退出登录吗?`,
+					confirmText: '确定', //确定文本的文字
+					cancelText: '取消', //确定文本的文字
+					showCancel: true, //没有取消按钮的弹框
+					success: function(res) {
+						if (res.confirm) {
+							that.verfSignOut();
+						} else if (res.cancel) {
+						}
+					}
+				})
+			},
 		}
 	}
 </script>