Commit 0395931dbcf6825c9678d28d215da9df6e0ab891

Authored by xp.Huang
2 parents 587ab894 fa720dc6

Merge branch 'local_dev_ft' into 'main'

pref:优化app端部分内容

See merge request huang/thingskit-app!97
1 <script> 1 <script>
2 -import store from '@/store';  
3 -import { mpUpData, scene } from '@/config/common'; 2 + import store from '@/store';
  3 + // import {
  4 + // scene
  5 + // } from '@/config/common';
4 6
5 -export default {  
6 - //设置全局变量,解绑时从这里取  
7 - globalData: {  
8 - openId: ''  
9 - },  
10 - onLaunch(e) {  
11 - //取出缓存数据  
12 - // store.commit('setCacheData');  
13 - //获取二维码信息  
14 - // scene(e);  
15 - // #ifdef APP-PLUS  
16 - uni.reLaunch({  
17 - url:'/pages/index/splash'  
18 - })  
19 - // #endif  
20 - },  
21 - onShow(e) {  
22 - // #ifdef MP  
23 - mpUpData(); //检测小程序更新  
24 - // #endif  
25 - },  
26 - onHide() {  
27 - }  
28 -}; 7 + export default {
  8 + //设置全局变量,解绑时从这里取
  9 + globalData: {
  10 + openId: ''
  11 + },
  12 + onLaunch(e) {
  13 + //取出缓存数据
  14 + // store.commit('setCacheData');
  15 + //获取二维码信息
  16 + // scene(e);
  17 + // #ifdef APP-PLUS
  18 + uni.reLaunch({
  19 + url: '/pages/index/splash'
  20 + })
  21 + // #endif
  22 + },
  23 + onShow(e) {
  24 + // #ifdef MP
  25 + // mpUpData(); //检测小程序更新
  26 + // #endif
  27 + // #ifdef APP-PLUS
  28 + // uni.reLaunch({
  29 + // url: '/pages/index/splash'
  30 + // })
  31 + // #endif
  32 + },
  33 + onHide() {}
  34 + };
29 </script> 35 </script>
30 36
31 <style lang="scss"> 37 <style lang="scss">
32 -@import '@/uni_modules/uview-ui/index.scss';  
33 -@import './style/iconfont.scss';  
34 -@import './style/common.scss';  
35 -page {  
36 - background: #ffffff;  
37 -}  
38 -::-webkit-scrollbar {  
39 - display: none;  
40 - width: 0 !important;  
41 - height: 0 !important;  
42 - -webkit-appearance: none;  
43 - background: transparent;  
44 -} 38 + @import '@/uni_modules/uview-ui/index.scss';
  39 + @import './style/iconfont.scss';
  40 + @import './style/common.scss';
  41 +
  42 + page {
  43 + background: #ffffff;
  44 + }
  45 +
  46 + ::-webkit-scrollbar {
  47 + display: none;
  48 + width: 0 !important;
  49 + height: 0 !important;
  50 + -webkit-appearance: none;
  51 + background: transparent;
  52 + }
45 </style> 53 </style>
@@ -28,12 +28,12 @@ @@ -28,12 +28,12 @@
28 @delete="deletePic" name="1" multiple :maxCount="6"></u-upload> 28 @delete="deletePic" name="1" multiple :maxCount="6"></u-upload>
29 </u-form-item> 29 </u-form-item>
30 </view> 30 </view>
  31 + <view style="width:427rpx;margin:0 auto;">
  32 + <u-button class="buttonSty button-sty" shape="circle" type="primary" text="提交"
  33 + customStyle="margin-top: 129rpx" @click="submit"></u-button>
  34 + </view>
31 </view> 35 </view>
32 </u--form> 36 </u--form>
33 - <view style="width:427rpx;margin:0 auto;">  
34 - <u-button class="buttonSty button-sty" shape="circle" type="primary" text="提交"  
35 - customStyle="margin-top: 129rpx" @click="submit"></u-button>  
36 - </view>  
37 </view> 37 </view>
38 <!-- #ifdef MP --> 38 <!-- #ifdef MP -->
39 <view style="height: 18rpx;"></view> 39 <view style="height: 18rpx;"></view>
1 { 1 {
2 - "name": "yun-teng-app",  
3 - "appid": "__UNI__AD0D64F",  
4 - "description": "thingskit",  
5 - "versionName": "1.0.0",  
6 - "versionCode": 100,  
7 - "transformPx": false,  
8 - "app-plus": {  
9 - "usingComponents": true,  
10 - "nvueStyleCompiler": "uni-app",  
11 - "compilerVersion": 3,  
12 - "splashscreen": {  
13 - "alwaysShowBeforeRender": true,  
14 - "waiting": false,  
15 - "autoclose": true,  
16 - "delay": 0  
17 - },  
18 - "modules": {  
19 - "VideoPlayer": {},  
20 - "Maps": {},  
21 - "Contacts": {},  
22 - "FaceID": {},  
23 - "Messaging": {},  
24 - "OAuth": {}  
25 - },  
26 - "compatible": {  
27 - "ignoreVersion": true  
28 - },  
29 - "distribute": {  
30 - "android": {  
31 - "permissions": [  
32 - "<uses-feature android:name=\"android.hardware.camera\"/>",  
33 - "<uses-feature android:name=\"android.hardware.camera.autofocus\"/>",  
34 - "<uses-permission android:name=\"android.permission.ACCESS_COARSE_LOCATION\"/>",  
35 - "<uses-permission android:name=\"android.permission.ACCESS_FINE_LOCATION\"/>",  
36 - "<uses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\"/>",  
37 - "<uses-permission android:name=\"android.permission.ACCESS_WIFI_STATE\"/>",  
38 - "<uses-permission android:name=\"android.permission.CAMERA\"/>",  
39 - "<uses-permission android:name=\"android.permission.CHANGE_NETWORK_STATE\"/>",  
40 - "<uses-permission android:name=\"android.permission.CHANGE_WIFI_STATE\"/>",  
41 - "<uses-permission android:name=\"android.permission.FLASHLIGHT\"/>",  
42 - "<uses-permission android:name=\"android.permission.GET_ACCOUNTS\"/>",  
43 - "<uses-permission android:name=\"android.permission.INSTALL_PACKAGES\"/>",  
44 - "<uses-permission android:name=\"android.permission.INTERNET\"/>",  
45 - "<uses-permission android:name=\"android.permission.MODIFY_AUDIO_SETTINGS\"/>",  
46 - "<uses-permission android:name=\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\"/>",  
47 - "<uses-permission android:name=\"android.permission.READ_CONTACTS\"/>",  
48 - "<uses-permission android:name=\"android.permission.READ_LOGS\"/>",  
49 - "<uses-permission android:name=\"android.permission.READ_PHONE_STATE\"/>",  
50 - "<uses-permission android:name=\"android.permission.READ_SMS\"/>",  
51 - "<uses-permission android:name=\"android.permission.REQUEST_INSTALL_PACKAGES\"/>",  
52 - "<uses-permission android:name=\"android.permission.SEND_SMS\"/>",  
53 - "<uses-permission android:name=\"android.permission.VIBRATE\"/>",  
54 - "<uses-permission android:name=\"android.permission.WAKE_LOCK\"/>",  
55 - "<uses-permission android:name=\"android.permission.WRITE_CONTACTS\"/>",  
56 - "<uses-permission android:name=\"android.permission.WRITE_EXTERNAL_STORAGE\"/>",  
57 - "<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>",  
58 - "<uses-permission android:name=\"android.permission.WRITE_SMS\"/>"  
59 - ],  
60 - "autoSdkPermissions": true  
61 - },  
62 - "ios": {  
63 - "dSYMs": false  
64 - },  
65 - "sdkConfigs": {  
66 - "ad": {},  
67 - "geolocation": {  
68 - "system": {  
69 - "__platform__": ["ios", "android"]  
70 - },  
71 - "amap": {  
72 - "__platform__": ["ios", "android"],  
73 - "appkey_ios": "",  
74 - "appkey_android": ""  
75 - }  
76 - },  
77 - "maps": {  
78 - "amap": {  
79 - "appkey_ios": "5221d1373233c782efac82fb176f7f7d",  
80 - "appkey_android": "5221d1373233c782efac82fb176f7f7d"  
81 - }  
82 - },  
83 - "oauth": {}  
84 - },  
85 - "splashscreen": {  
86 - "androidStyle": "default",  
87 - "android": {}  
88 - },  
89 - "icons": {  
90 - "android": {  
91 - "xxhdpi": "C:/Users/YunTeng/Desktop/公司图标/微信图片_20220506171238.png",  
92 - "xhdpi": "C:/Users/YunTeng/Desktop/公司图标/微信图片_20220506171238.png",  
93 - "hdpi": "C:/Users/YunTeng/Desktop/公司图标/微信图片_20220506171238.png",  
94 - "xxxhdpi": "C:/Users/YunTeng/Desktop/公司图标/微信图片_20220506171238.png"  
95 - }  
96 - }  
97 - }  
98 - },  
99 - "quickapp": {},  
100 - "mp-weixin": {  
101 - "appid": "wx99c411dc3c5571ef",  
102 - "setting": {  
103 - "urlCheck": false,  
104 - "minified": true,  
105 - "es6": false,  
106 - "postcss": true  
107 - },  
108 - "usingComponents": true,  
109 - "permission": {  
110 - "scope.userLocation": {  
111 - "desc": "你的位置信息将用于小程序位置接口的效果展示"  
112 - }  
113 - },  
114 - "lazyCodeLoading": "requiredComponents",  
115 - "optimization": {  
116 - "subPackages": true  
117 - }  
118 - },  
119 - "mp-alipay": {  
120 - "usingComponents": true  
121 - },  
122 - "mp-baidu": {  
123 - "usingComponents": true  
124 - },  
125 - "mp-toutiao": {  
126 - "usingComponents": true  
127 - },  
128 - "uniStatistics": {  
129 - "enable": false  
130 - },  
131 - "vueVersion": "2",  
132 - "h5": {  
133 - "sdkConfigs": {  
134 - "maps": {}  
135 - },  
136 - "router": {  
137 - "base": "minImage/h5/"  
138 - }  
139 - } 2 + "name" : "yun-teng-app",
  3 + "appid" : "__UNI__AD0D64F",
  4 + "description" : "thingskit",
  5 + "versionName" : "1.0.0",
  6 + "versionCode" : 100,
  7 + "transformPx" : false,
  8 + "app-plus" : {
  9 + "usingComponents" : true,
  10 + "nvueStyleCompiler" : "uni-app",
  11 + "compilerVersion" : 3,
  12 + "splashscreen" : {
  13 + "alwaysShowBeforeRender" : false,
  14 + "waiting" : false,
  15 + "autoclose" : true,
  16 + "delay" : 0
  17 + },
  18 + "modules" : {
  19 + "VideoPlayer" : {},
  20 + "Maps" : {},
  21 + "Contacts" : {},
  22 + "FaceID" : {},
  23 + "Messaging" : {},
  24 + "OAuth" : {},
  25 + "Camera" : {}
  26 + },
  27 + "compatible" : {
  28 + "ignoreVersion" : true
  29 + },
  30 + "distribute" : {
  31 + "android" : {
  32 + "permissions" : [
  33 + "<uses-feature android:name=\"android.hardware.camera\"/>",
  34 + "<uses-feature android:name=\"android.hardware.camera.autofocus\"/>",
  35 + "<uses-permission android:name=\"android.permission.ACCESS_COARSE_LOCATION\"/>",
  36 + "<uses-permission android:name=\"android.permission.ACCESS_FINE_LOCATION\"/>",
  37 + "<uses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\"/>",
  38 + "<uses-permission android:name=\"android.permission.ACCESS_WIFI_STATE\"/>",
  39 + "<uses-permission android:name=\"android.permission.CAMERA\"/>",
  40 + "<uses-permission android:name=\"android.permission.CHANGE_NETWORK_STATE\"/>",
  41 + "<uses-permission android:name=\"android.permission.CHANGE_WIFI_STATE\"/>",
  42 + "<uses-permission android:name=\"android.permission.FLASHLIGHT\"/>",
  43 + "<uses-permission android:name=\"android.permission.GET_ACCOUNTS\"/>",
  44 + "<uses-permission android:name=\"android.permission.INSTALL_PACKAGES\"/>",
  45 + "<uses-permission android:name=\"android.permission.INTERNET\"/>",
  46 + "<uses-permission android:name=\"android.permission.MODIFY_AUDIO_SETTINGS\"/>",
  47 + "<uses-permission android:name=\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\"/>",
  48 + "<uses-permission android:name=\"android.permission.READ_CONTACTS\"/>",
  49 + "<uses-permission android:name=\"android.permission.READ_LOGS\"/>",
  50 + "<uses-permission android:name=\"android.permission.READ_PHONE_STATE\"/>",
  51 + "<uses-permission android:name=\"android.permission.READ_SMS\"/>",
  52 + "<uses-permission android:name=\"android.permission.REQUEST_INSTALL_PACKAGES\"/>",
  53 + "<uses-permission android:name=\"android.permission.SEND_SMS\"/>",
  54 + "<uses-permission android:name=\"android.permission.VIBRATE\"/>",
  55 + "<uses-permission android:name=\"android.permission.WAKE_LOCK\"/>",
  56 + "<uses-permission android:name=\"android.permission.WRITE_CONTACTS\"/>",
  57 + "<uses-permission android:name=\"android.permission.WRITE_EXTERNAL_STORAGE\"/>",
  58 + "<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>",
  59 + "<uses-permission android:name=\"android.permission.WRITE_SMS\"/>"
  60 + ],
  61 + "autoSdkPermissions" : false
  62 + },
  63 + "ios" : {
  64 + "dSYMs" : false
  65 + },
  66 + "sdkConfigs" : {
  67 + "ad" : {},
  68 + "geolocation" : {
  69 + "system" : {
  70 + "__platform__" : [ "ios", "android" ]
  71 + },
  72 + "amap" : {
  73 + "__platform__" : [ "ios", "android" ],
  74 + "appkey_ios" : "",
  75 + "appkey_android" : ""
  76 + }
  77 + },
  78 + "maps" : {
  79 + "amap" : {
  80 + "appkey_ios" : "5221d1373233c782efac82fb176f7f7d",
  81 + "appkey_android" : "5221d1373233c782efac82fb176f7f7d"
  82 + }
  83 + },
  84 + "oauth" : {
  85 + "weixin" : {
  86 + "appid" : "wx0ad61d7bf6808e02",
  87 + "UniversalLinks" : ""
  88 + }
  89 + }
  90 + },
  91 + "splashscreen" : {
  92 + "androidStyle" : "default",
  93 + "android" : {}
  94 + },
  95 + "icons" : {
  96 + "android" : {
  97 + "xxhdpi" : "static/logo.png",
  98 + "xhdpi" : "static/logo.png",
  99 + "hdpi" : "static/logo.png",
  100 + "xxxhdpi" : "static/logo.png"
  101 + }
  102 + }
  103 + }
  104 + },
  105 + "quickapp" : {},
  106 + "mp-weixin" : {
  107 + "appid" : "wx99c411dc3c5571ef",
  108 + "setting" : {
  109 + "urlCheck" : false,
  110 + "minified" : true,
  111 + "es6" : false,
  112 + "postcss" : true
  113 + },
  114 + "usingComponents" : true,
  115 + "permission" : {
  116 + "scope.userLocation" : {
  117 + "desc" : "你的位置信息将用于小程序位置接口的效果展示"
  118 + }
  119 + },
  120 + "lazyCodeLoading" : "requiredComponents",
  121 + "optimization" : {
  122 + "subPackages" : true
  123 + }
  124 + },
  125 + "mp-alipay" : {
  126 + "usingComponents" : true
  127 + },
  128 + "mp-baidu" : {
  129 + "usingComponents" : true
  130 + },
  131 + "mp-toutiao" : {
  132 + "usingComponents" : true
  133 + },
  134 + "uniStatistics" : {
  135 + "enable" : false
  136 + },
  137 + "vueVersion" : "2",
  138 + "h5" : {
  139 + "sdkConfigs" : {
  140 + "maps" : {}
  141 + },
  142 + "router" : {
  143 + "base" : "minImage/h5/"
  144 + }
  145 + }
140 } 146 }
@@ -3,13 +3,6 @@ @@ -3,13 +3,6 @@
3 "^u-(.*)": "@/uni_modules/uview-ui/components/u-$1/u-$1.vue" 3 "^u-(.*)": "@/uni_modules/uview-ui/components/u-$1/u-$1.vue"
4 }, 4 },
5 "pages": [{ 5 "pages": [{
6 - "path": "pages/index/index",  
7 - "style": {  
8 - "navigationBarTitleText": "首页",  
9 - "disableScroll": true  
10 - }  
11 - },  
12 - {  
13 "path": "pages/index/splash", 6 "path": "pages/index/splash",
14 "style": { 7 "style": {
15 "navigationBarTitleText": "", 8 "navigationBarTitleText": "",
@@ -17,7 +10,13 @@ @@ -17,7 +10,13 @@
17 "app-plus": { 10 "app-plus": {
18 "titleNView": false 11 "titleNView": false
19 } 12 }
20 - 13 + }
  14 + },
  15 + {
  16 + "path": "pages/index/index",
  17 + "style": {
  18 + "navigationBarTitleText": "首页",
  19 + "disableScroll": true
21 } 20 }
22 }, 21 },
23 { 22 {
@@ -19,11 +19,12 @@ @@ -19,11 +19,12 @@
19 <view class="f__login"> 19 <view class="f__login">
20 <view class="loginPhone"> 20 <view class="loginPhone">
21 <view class="form-row u-flex"> 21 <view class="form-row u-flex">
22 - <u-input v-model="loginForm.username" type="text" placeholder="请输入登录账号" border="bottom" /> 22 + <u-input :adjust-position="false" v-model="loginForm.username" type="text" placeholder="请输入登录账号"
  23 + border="bottom" />
23 </view> 24 </view>
24 <view class="form-row u-flex"> 25 <view class="form-row u-flex">
25 - <u-input v-model="loginForm.password" :password="showPassword" placeholder="请输入登录密码"  
26 - border="bottom"> 26 + <u-input :adjust-position="false" v-model="loginForm.password" :password="showPassword"
  27 + placeholder="请输入登录密码" border="bottom">
27 <template slot="suffix"> 28 <template slot="suffix">
28 <view @click="showPasswordMode" style="padding: 10rpx"> 29 <view @click="showPasswordMode" style="padding: 10rpx">
29 <u-icon width="18" height="14" :name=" 30 <u-icon width="18" height="14" :name="
@@ -41,17 +42,19 @@ @@ -41,17 +42,19 @@
41 <view class="row-reset login-text-gray" @click="findPassrordFunc">忘记密码</view> 42 <view class="row-reset login-text-gray" @click="findPassrordFunc">忘记密码</view>
42 </view> 43 </view>
43 <view class="u-flex link-login"> 44 <view class="u-flex link-login">
  45 + <!-- #ifdef MP-WEIXIN -->
44 <view class="link-text login-text-gray">第三方账号登录</view> 46 <view class="link-text login-text-gray">第三方账号登录</view>
45 <view style="height: 20rpx"></view> 47 <view style="height: 20rpx"></view>
46 - <!-- #ifdef MP-WEIXIN -->  
47 <button class="link-image" @tap="handleWenxinAuthorization"> 48 <button class="link-image" @tap="handleWenxinAuthorization">
48 <image class="image" src="../../static/weixin.png" mode="aspectFill"></image> 49 <image class="image" src="../../static/weixin.png" mode="aspectFill"></image>
49 </button> 50 </button>
50 <!-- #endif --> 51 <!-- #endif -->
51 <!-- #ifdef APP-PLUS --> 52 <!-- #ifdef APP-PLUS -->
  53 + <!-- <view class="link-text login-text-gray">第三方账号登录</view>
  54 + <view style="height: 20rpx"></view>
52 <button class="link-image" @click="handleAppPlusAuthorization"> 55 <button class="link-image" @click="handleAppPlusAuthorization">
53 <image class="image" src="../../static/weixin.png" mode="aspectFill"></image> 56 <image class="image" src="../../static/weixin.png" mode="aspectFill"></image>
54 - </button> 57 + </button> -->
55 <!-- #endif --> 58 <!-- #endif -->
56 </view> 59 </view>
57 </view> 60 </view>
@@ -187,9 +190,32 @@ @@ -187,9 +190,32 @@
187 }, 190 },
188 //#endif 191 //#endif
189 //#ifdef APP-PLUS 192 //#ifdef APP-PLUS
190 - handleAppPlusAuthorization() {  
191 - console.log('TODO');  
192 - }, 193 + // handleAppPlusAuthorization() {
  194 + // var that = this;
  195 + // uni.getProvider({
  196 + // service: 'oauth',
  197 + // success: function(res) {
  198 + // if (~res.provider.indexOf('weixin')) {
  199 + // uni.login({
  200 + // provider: 'weixin',
  201 + // success: function(loginRes) {
  202 + // // loginRes 包含access_token,expires_in,openid,unionid等信息
  203 + // uni.showToast({
  204 + // title: "第三方账号登录成功",
  205 + // icon: "none",
  206 + // })
  207 + // },
  208 + // fail: function(res) {
  209 + // // that.$refs.uToast.show({
  210 + // // title: '微信登录失败',
  211 + // // type: 'warning'
  212 + // // });
  213 + // }
  214 + // });
  215 + // }
  216 + // }
  217 + // });
  218 + // },
193 //#endif 219 //#endif
194 async saveUserInfo() { 220 async saveUserInfo() {
195 const userInfoRes = await api.loginApi.setUserInfoApi() 221 const userInfoRes = await api.loginApi.setUserInfoApi()