jwyu 3 years ago
parent
commit
e1b189aed4
7 changed files with 97 additions and 17 deletions
  1. 12 2
      App.vue
  2. 2 1
      manifest.json
  3. 6 0
      pages.json
  4. 1 1
      pages/activity/activity.vue
  5. 35 1
      pages/login.vue
  6. 29 0
      pages/pc.vue
  7. 12 12
      utils/config.js

+ 12 - 2
App.vue

@@ -2,13 +2,23 @@
 	import {hasUpdate} from '@/utils/common.js'
 	export default {
 		onLaunch: function(options) {
-			console.log('App Launch')
+			console.log('App Launch',options)
 			this.$store.dispatch('getUserInfo')
 			this.$store.dispatch('getTabBar')
 		},
 		onShow: function(options) {
-			console.log('App Show')
+			console.log('App Show:',options)
 			hasUpdate()
+			uni.getSystemInfo({
+				success: function (res) {
+					if (res.windowWidth > 700) {
+						console.log('进入pc');
+						uni.reLaunch({
+							url: "/pages/pc",
+						});
+					}
+				},
+			})
 		},
 		onHide: function() {
 			console.log('App Hide')

+ 2 - 1
manifest.json

@@ -59,7 +59,8 @@
             "postcss" : true
         },
         "usingComponents" : true,
-        "requiredBackgroundModes": ["audio"]
+        "resizable" : true,
+        "requiredBackgroundModes" : [ "audio" ]
     },
     "mp-alipay" : {
         "usingComponents" : true

+ 6 - 0
pages.json

@@ -37,6 +37,12 @@
 			"style":{
 				"navigationBarTitleText":"绑定联系方式"
 			}
+		},
+		{
+			"path": "pages/pc",
+			"style":{
+				"navigationBarTitleText": ""
+			}
 		}
 	],
 	"subPackages":[

+ 1 - 1
pages/activity/activity.vue

@@ -890,7 +890,7 @@ export default {
         border-radius: 40rpx;
         background-color: #f6f6f6;
         margin-right: 40rpx;
-        height: 60rpx;
+        // height: 60rpx;
     }
     .status-active {
         background: linear-gradient(270deg, #efc896 0%, #d9a35f 100%);

+ 35 - 1
pages/login.vue

@@ -125,7 +125,6 @@ export default {
 
         // 获取微信绑定的手机号登录
         async getPhoneNumber({detail}){
-            if(!detail.encryptedData||!detail.iv) return
             const res=await apiGetWechatPhone({
                 encryptedData:detail.encryptedData||'',
                 iv:detail.iv||'',
@@ -248,12 +247,23 @@ export default {
 .login-page {
     padding: 34rpx;
     text-align: center;
+    @media screen and (min-width: 700px){
+        max-width: 500px;
+        margin-left: auto;
+        margin-right: auto;
+    }
 }
 .top-img {
     width: 140rpx;
     height: 140rpx;
     margin-top: 70rpx;
     margin-bottom: 100rpx;
+    @media screen and (min-width: 700px){
+        width: 70px;
+        height: 70px;
+        margin-top: 35px;
+        margin-bottom: 50px;
+    }
 }
 .van-cell {
     border-bottom: 1px solid $global-border-color;
@@ -273,6 +283,9 @@ export default {
 }
 .change-wrap{
     margin-top: 100rpx;
+    @media screen and (min-width: 700px){
+        margin-top: 50px;
+    }
     .text{
         color: #CFCFCF;
         display: flex;
@@ -285,6 +298,10 @@ export default {
             display: inline-block;
             background-color: #E1E2E6;
             margin-right: 20rpx;
+            @media screen and (min-width: 700px){
+                width: 70px;
+                margin-right: 10px;
+            }
         }
         &::after{
             content: '';
@@ -293,12 +310,21 @@ export default {
             display: inline-block;
             background-color: #E1E2E6;
             margin-left: 20rpx;
+            @media screen and (min-width: 700px){
+                width: 70px;
+                margin-left: 10px;
+            }
         }
     }
     .img{
         margin-top: 40rpx;
         width: 80rpx;
         height: 80rpx;
+        @media screen and (min-width: 700px){
+            margin-top: 20px;
+            width: 40px;
+            height: 40px;
+        }
     }
 }
 .submit-btn {
@@ -306,6 +332,11 @@ export default {
     margin-left: auto;
     margin-right: auto;
     margin-top: 100rpx;
+    @media screen and (min-width: 700px){
+        width: 245px;
+        margin-top: 50px;
+        line-height: 35px;
+    }
 }
 .bot-text{
     position: fixed;
@@ -314,5 +345,8 @@ export default {
     bottom: 100rpx;
     color: $global-text-color-999;
     width: 100%;
+    @media screen and (min-width: 700px){
+        bottom: 50px;
+    }
 }
 </style>

+ 29 - 0
pages/pc.vue

@@ -0,0 +1,29 @@
+<template>
+  <view class="pc-page">
+      <web-view :src="url" />
+  </view>
+</template>
+
+<script>
+import {pcBaseUrl} from '../utils/config'
+export default {
+    data () {
+        return {
+            url:''
+        }
+    },
+    onLoad(options) {
+        let paramsObj={
+
+            token:this.$store.state.user.token,
+            timestamp:new Date().getTime(),//防止缓存
+        }
+        let paramsObjStr=''
+        for (const key in paramsObj) {
+            paramsObjStr=`${paramsObjStr}&${key}=${paramsObj[key]}`
+        }
+        console.log('字符串:',paramsObjStr);
+        this.url=`${pcBaseUrl}`
+    }
+}
+</script>

+ 12 - 12
utils/config.js

@@ -1,26 +1,25 @@
 // 配置文件
 
 const env=uni.getAccountInfoSync().miniProgram
-// 请求根路径
-let baseApiUrl=''
-if(env.envVersion==='develop'){//开发
-    baseApiUrl='http://8.136.199.33:8612'
-}else if(env.envVersion==='trial'){//体验版
-    baseApiUrl='http://8.136.199.33:8612'
-}else if(env.envVersion==='release'){//正式版
-    baseApiUrl='https://yanbao.hzinsights.com'
-}
 
-// h5页面根路径
-let h5BaseUrl=''
+let baseApiUrl=''// 请求根路径
+let h5BaseUrl=''// h5页面根路径
+let pcBaseUrl=''//pc页面根路径
 if(env.envVersion==='develop'){//开发
+    baseApiUrl='http://8.136.199.33:8612'
     h5BaseUrl='http://advisoryadmin.brilliantstart.cn/xcx_h5'
+    pcBaseUrl=''
 }else if(env.envVersion==='trial'){//体验版
+    baseApiUrl='http://8.136.199.33:8612'
     h5BaseUrl='http://advisoryadmin.brilliantstart.cn/xcx_h5'
+    pcBaseUrl=''
 }else if(env.envVersion==='release'){//正式版
+    baseApiUrl='https://yanbao.hzinsights.com'
     h5BaseUrl='https://details.hzinsights.com'
+    pcBaseUrl=''
 }
 
+
 // 配置图片资源 https://hzstatic.hzinsights.com/static/icon/hzyb/
 const globalImgUrls={
     chartWait:'https://hzstatic.hzinsights.com/static/icon/hzyb/chart_wait.png',
@@ -76,5 +75,6 @@ module.exports={
     baseApiUrl,
     globalImgUrls,
     defaultTabBarListConfig,
-    h5BaseUrl
+    h5BaseUrl,
+    pcBaseUrl
 }