Browse Source

代驾会员更新

vaecebyZ 8 tháng trước cách đây
mục cha
commit
2e9653e39c
1 tập tin đã thay đổi với 39 bổ sung6 xóa
  1. 39 6
      trip/index/index.vue

+ 39 - 6
trip/index/index.vue

@@ -11,8 +11,7 @@
 
 			<!-- 选择地址 -->
 			<template v-if="step == 1 || step == 2">
-				<image class="img"
-					src="https://oss.dev.zonelife.cn/static/zshsh/img/ad.png">
+				<image class="img" src="https://oss.dev.zonelife.cn/static/zshsh/img/ad.png">
 				</image>
 				<view class="operation">
 					<view class="start-box" @click="chooseAddress('start')">
@@ -25,7 +24,7 @@
 					<view class="end" @click="chooseAddress('end')">
 						<view class="point"></view>
 						<view class="place">
-							{{ form.end || '您想去哪里' }} 
+							{{ form.end || '您想去哪里' }}
 						</view>
 					</view>
 					<u-button @click="call()" color="#FF4A39" shape="circle" :loading="loading">
@@ -713,6 +712,7 @@ export default {
 		// 如果start 有值则不进行初始化
 	},
 	onLoad(option) {
+		// 会员检测
 		let that = this
 		// 获取地址选择页面传来的数据
 		const eventChannel = this.getOpenerEventChannel();
@@ -752,10 +752,43 @@ export default {
 			uni.hideLoading();
 			this.startTimer(true);
 		}
-
+		``
 	},
-	created() {
-
+	onShow() {
+		if (uni.getStorageSync('token')) {
+			if (JSON.parse(uni.getStorageSync('userInfo')).setMealCode != 0 && JSON.parse(uni.getStorageSync('userInfo')).setMealCode) {
+			} else {
+				uni.showModal({
+					title: '此商品需要开通会员才能使用',
+					cancelText: '下次再说',
+					confirmText: '立即开通',
+					success(res) {
+						console.log(res)
+						if (res.confirm) {
+							uni.navigateTo({
+								url: '/my/memberCenter/index'
+							})
+						}
+						if (res.cancel) {
+							uni.navigateBack()
+						}
+					}
+				})
+			}
+		} else {
+			uni.showModal({
+				title: '请登录',
+				confirmText: '去登录',
+				success(res) {
+					console.log(res);
+					if (res.confirm) {
+						uni.navigateTo({
+							url: `/login/login/login?redirect=/trip/index/index`
+						})
+					}
+				}
+			})
+		}
 	}
 }
 </script>