瀏覽代碼

跳转码上快购小程序弹框

DELL 3 年之前
父節點
當前提交
be1bacb5ca
共有 2 個文件被更改,包括 15 次插入9 次删除
  1. 13 0
      src/App.vue
  2. 2 9
      src/pages/index/index.vue

+ 13 - 0
src/App.vue

@@ -21,6 +21,7 @@
 				uni.setStorageSync('code', parameter.id)
 			}
 			this.updateManager()
+			this.anotherApplet()
 		},
 		methods: {
 			updateManager() {
@@ -52,6 +53,18 @@
 					})
 				}
 			},
+			anotherApplet() {
+				$http.post('/api/v1/mp/user/isJump', {}).then(res => {
+					if(res.data) {
+						uni.setStorageSync('anotherApplet',true)
+						uni.switchTab({
+							url:'/pages/index/index'
+						})
+					}else {
+						uni.removeStorageSync('anotherApplet')
+					}
+				})
+			},
 		}
 	}
 </script>

+ 2 - 9
src/pages/index/index.vue

@@ -137,14 +137,7 @@
 
 		</view>
 		<!-- 引导页面 -->
-		<u-popup :show='showMp'  mode='center' round='7'>
-			<view style="width: 500rpx; display: inline-block;">
-				<view style="display: inline-block; margin: 20rpx 10rpx 10rpx 20rpx;font-size: 34rpx;font-weight: bold;">提示:</view>
-				<view class="" style=" margin: 10rpx 10rpx 40rpx 20rpx;font-size: 34rpx;">
-					&emsp;&emsp;“盲票”已升级为“码上快购”点击“ <view @click='toAnotherApplet' style="display: inline-block;color: #FFAE00;">立即前往</view> ” ,跳转至 “码上快购”小程序
-				</view>
-			</view>
-		</u-popup>
+		<u-modal :show="showMp" content='“盲票”已升级为“码上快购”' width='530rpx' confirmText='立即前往' @confirm='toAnotherApplet'></u-modal>
 		<!-- tabbar组件 -->
 		<custom-tab-bar :activeValue="'index'" />
 		<!-- 支付弹框组件 -->
@@ -189,7 +182,7 @@
 			};
 		},
 		onLoad(opthios) {
-			if(appId == 1) return this.showMp = true
+			this.showMp = uni.getStorageSync('anotherApplet') ? true : false
 			
 			uni.hideTabBar()
 			if (opthios.userId) {