潘超林 2 viikkoa sitten
vanhempi
commit
2ba61b6817

Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 3 - 0
api/index.js


+ 3 - 2
api/request.js

@@ -210,7 +210,7 @@ class Request {
 								// this.handleError({ code: 501 }, param)
 								// 	.then(refreshedRes => resolve(refreshedRes))
 								// 	.catch(err => reject(err));
-								localStorage.clear();
+								
 								uni.reLaunch({
 									url:
 										"/pages/index/index?shopId=" + uni.getStorageSync('shopId'),
@@ -219,12 +219,13 @@ class Request {
 							} else if (res.data.code === 400 && res.data.msg === '登录凭证不为空') {
 								const error = new Error(res.data.msg);
 								error.response = res;
-								localStorage.clear();
+								
 								// if (showToast) {
 								uni.reLaunch({
 									url:
 										"/pages/index/index?shopId=" + uni.getStorageSync('shopId'),
 								});
+								localStorage.clear();
 								// }
 								reject(error);
 							} else {

+ 16 - 15
pages/index/pay.vue

@@ -28,7 +28,8 @@
 					<view style="padding: 0px 30rpx">
 						<view style="margin-top: 66rpx; background: #fff7f6">
 							<u-cell-group :border="false">
-								<u-cell title="代金券折扣" value="可使用4个" :border="false" isLink @click="voucher"></u-cell>
+								<u-cell title="代金券折扣" :value="couponList.length + '个券可使用'" :border="false" isLink
+									@click="voucher"></u-cell>
 							</u-cell-group>
 						</view>
 
@@ -108,25 +109,25 @@ export default {
 			this.getShopInfo();
 		} else {
 			this.getInfo();
+			this.getVoucher();
 		}
 	},
 	methods: {
+		getVoucher() {
+			api
+				.byStore({
+					storeId: '2018881434293329922',
+				})
+				.then((res) => {
+					if (res.code == 200) {
+						this.couponList = res.data;
+					} else {
+						uni.$u.toast(res.msg);
+					}
+				});
+		},
 		voucher() {
 			this.showPopup = true;
-			console.log(this.showPopup);
-			// api
-			// 	.byStore({
-			// 		currPage: 1,
-			// 		pageSize: 999,
-			// 		storeId: this.shopId,
-			// 	})
-			// 	.then((res) => {
-			// 		if (res.code == 200) {
-			// 			this.couponList = res.data;
-			// 		} else {
-			// 			uni.$u.toast(res.msg);
-			// 		}
-			// 	});
 		},
 		getInfo() {
 			let code = this.GetQueryString("code");

Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 1 - 1
unpackage/dist/build/web/index.html


BIN
unpackage/dist/build/web/static/images/logo.png


BIN
unpackage/dist/build/web/static/images/payBack.png