Zhou Jianjia 3 роки тому
батько
коміт
1038caad22
3 змінених файлів з 74 додано та 34 видалено
  1. 1 2
      App.vue
  2. 56 28
      pages/login/login.vue
  3. 17 4
      pages/my/index.vue

+ 1 - 2
App.vue

xqd
@@ -12,9 +12,8 @@
                 for (const key in options.query) {
                     arr.push(`${key}=${options.query[key]}`)
                 }
-                this.$jump({
+                uni.reLaunch({
                     url: `/pages/login/login?redirect=${options.path}&${arr.join("&")}`,
-                    type: 'redirect',
                 });
             }
 		},

+ 56 - 28
pages/login/login.vue

xqd xqd xqd xqd
@@ -1,34 +1,30 @@
 <template>
-    <app-layout>
-        <u-modal v-model="modal.show"
-                 title="提示"
-                 content="需要获取您的用户信息"
-                 cancel-color="#CCCCCC"
-                 confirm-color="#046E64"
-                 :async-close="true"
-                 :show-cancel-button="true"
-                 @cancel="handleRedirect"
-        >
-            <view slot="confirm-button">
-                <button @click="handleLogin" class="btn main-center cross-center">确定</button>
+    <view class="login">
+        <view class="bg">
+            <u-image :src="bgSrc" width="100%" height="100%" mode="aspectFit"></u-image>
+        </view>
+        <u-popup v-model="modal.show" mode="bottom" :mask-close-able="false" border-radius="15">
+            <view class="popup-content">
+                <view class="title">需要获取您的用户信息</view>
+                <view class="btn-popup main-between">
+                    <button @click="handleRedirect" class="cancel btn main-center cross-center">取消</button>
+                    <button @click="handleLogin" class="btn main-center cross-center">确定</button>
+                </view>
             </view>
-        </u-modal>
-    </app-layout>
+        </u-popup>
+    </view>
 </template>
 
 <script>
-    import appLayout from "@/components/app-layout"
     export default {
-        components:{
-            appLayout,
-        },
         data() {
             return {
+                bgSrc: this.$site.root+"assets/images/formula/formula-cover.png",
                 redirect: '',
                 code: '',
                 modal: {
                     show: false
-                }
+                },
             }
         },
         methods: {
@@ -67,6 +63,7 @@
                 });
             },
             handleLogin(){
+                console.log('-->data 获取用户信息')
                 let _this = this;
                 uni.getUserProfile({
                     desc: '获取用户信息',
@@ -82,8 +79,10 @@
                         })
                     },
                     fail: err => {
-                        console.log('-->data',err)
                         _this.$u.toast('获取用户信息失败')
+                        uni.reLaunch({
+                            url: this.redirect
+                        });
                     }
                 });
             },
@@ -114,14 +113,43 @@
 </script>
 
 <style lang="scss" scoped>
-    .btn{
-        background: #fff;
-        color: $main-color;
-        border-radius: 0;
-        font-size: 28rpx;
-        height: 100rpx;
-        &:after{
-            content: unset;
+    .login{
+        position: relative;
+        .bg{
+            position: absolute;
+            top: 0;
+            left: 0;
+            width: 100%;
+            height: 100vh;
+        }
+    }
+    .popup-content{
+        height: 450rpx;
+        position: relative;
+        .title{
+            padding: 20rpx 30rpx;
+            font-weight: 600;
+            font-size: 42rpx;
+        }
+        .btn-popup{
+            position: absolute;
+            bottom: 0;
+            width: 100%;
+        }
+        .btn{
+            background: $main-color;
+            color: #fff;
+            border-radius: 0;
+            font-size: 28rpx;
+            height: 100rpx;
+            flex: 1;
+            &.cancel{
+                background: #f5f5f5;
+                color: #666;
+            }
+            &:after{
+                content: unset;
+            }
         }
     }
 </style>

+ 17 - 4
pages/my/index.vue

xqd xqd xqd xqd xqd
@@ -4,7 +4,7 @@
 			<view class="customer">
 				<view class="bg"></view>
 				<view class="info dir-top-wrap cross-center main-center">
-					<view class="head-img">
+					<view class="head-img" @click="handleGetInfo">
 						<u-image
 								width="140"
 								height="140"
@@ -45,7 +45,8 @@
 					{{setting.service_wechat}}
 					<view slot="icon" class="icon wechat"></view>
 				</u-cell-item>
-				<u-cell-item title="在线客服" :border-bottom="false" bg-color="#f9f9f9">
+				<u-cell-item title="在线客服" :border-bottom="false" :use-label-slot="true" bg-color="#f9f9f9" :value-style="{position: 'relative'}">
+					<button open-type="contact" class="cell-btn" slot="label"></button>
 					<view slot="icon" class="icon kefu"></view>
 				</u-cell-item>
 				<u-cell-item title="清除缓存" :border-bottom="false" icon="reload" bg-color="#f9f9f9" @click="handleClearCache">
@@ -120,7 +121,7 @@
 			handleGetInfo(){
 				let _this = this;
 				uni.getUserProfile({
-					desc: '获取用户信息',
+					desc: '重新获取用户信息',
 					success: data =>  {
 						let params = {
 							encryptedData: data.encryptedData,
@@ -128,7 +129,7 @@
 						}
 						_this.$u.api.userUpdate(params).then(res => {
 							_this.$u.vuex(_this.$const.USER_DATA, res)
-							_this.handleRedirect();
+							this.userData = res;
 						})
 					},
 					fail: err => {
@@ -170,6 +171,18 @@
 	/deep/.u-cell{
 		padding: 22rpx 32rpx !important;
 	}
+	.cell-btn{
+		border: 0;
+		background: transparent;
+		position: absolute;
+		height: 80rpx;
+		top: 0;
+		width: 86%;
+		z-index: 0;
+		&:after{
+			content: unset;
+		}
+	}
 	.container{
 		padding: 0;
 		height: 100vh;