Browse Source

设置服务者弹框,和首页登录

una 4 years ago
parent
commit
8d2aa4597d

+ 24 - 0
client/app.acss

@@ -77,3 +77,27 @@ page {
   color: #09AFFF;
   font-weight: bold;
 }
+/* 垂直弹框样式 */
+.am-modal-buttons--vertical{
+  padding:0 32rpx;
+}
+.am-modal-buttons--vertical.am-modal-buttons .am-modal-button{
+font-size: 28rpx;
+  font-weight: bold;
+  color:#666;
+}
+.am-modal-buttons--vertical.am-modal-buttons .buttonBold{
+  background: #08A1F9;
+  color:#fff;
+  border-radius:12rpx;
+}
+.am-modal-buttons--vertical.am-modal-buttons::before{
+  background-color: #fff;
+}
+.am-modal-body{
+font-size: 28rpx;
+  color:#666;
+}
+
+
+

BIN
client/image/login-bg.png


+ 5 - 1
client/pages/common/index/index.acss

@@ -1 +1,5 @@
-/* required by usingComponents */
+/* required by usingComponents */
+.login-img{
+  width:100%;
+  height: 100vh;
+}

+ 2 - 2
client/pages/common/index/index.axml

@@ -1,4 +1,4 @@
-<view onTap="requestPost">
-  this is a blank page
+<view >
+ <image mode="aspectFill" class="login-img" src="/image/login-bg.png"/>
   
 </view>

+ 8 - 2
client/pages/common/index/index.js

@@ -5,7 +5,9 @@ import moment from 'moment'
 Page({
   onLoad(query) {
     // 页面加载
+    console.log('onLoad');
     console.info(`Page onLoad with query: ${JSON.stringify(query)}`);
+    this.authInit();
   },
   onReady() {
     // 页面加载完成
@@ -36,8 +38,9 @@ Page({
       path: 'pages/index/index',
     };
   },
-  requestPost(){
-    my.authorize({
+  // 授权登录
+  authInit(){
+ my.authorize({
   scopes: 'scope.userInfo',
   success: (res) => {
     my.getAuthUserInfo({
@@ -51,6 +54,9 @@ Page({
     });
   },
 });
+  },
+  requestPost(){
+   
   
   
   }

+ 12 - 0
client/pages/customer/myServantList/myServantList.axml

@@ -51,6 +51,18 @@
 <button type="primary" class="common-button" hover-class="active-button"  size="mini" onTap="addServant">现在添加</button>
       </view>
       <view class="switch-role">角色选择错啦,去切换 >> </view>
+<!-- 提示暂未设置服务者 -->
+<modal
+		show="{{unSetModal}}"
+    showClose="{{false}}"
+    onButtonClick="onSetButtonClick"
+    buttonsLayout="vertical"
+    buttons="{{unSetBtn}}"
+	>
+		<view slot="header">您尚未设置服务者</view>
+		先设置服务者吧。
+	</modal>
+
 
   </view>
 

+ 19 - 0
client/pages/customer/myServantList/myServantList.js

@@ -2,6 +2,11 @@ Page({
   data: {
     listShow:false,
     editModalShow:false,//编辑弹框
+    unSetModal:true,//未设置服务者提醒
+      unSetBtn: [
+      { text: '设置', extClass: 'buttonBold' },
+      { text: '暂不' },
+    ],
     customerName:'',//客户姓名输入
     buttonFooter:[
       { text: '取消' },
@@ -53,5 +58,19 @@ Page({
  },
   enterServantCenter(){
     //  my.navigateTo({ url: '../servantCenter/servantCenter' });
+  },
+  // 点击设置按钮
+  onSetButtonClick(e){
+    console.log(e.target);
+    if(e.target.dataset.index==0){
+       this.setData({
+      unSetModal: false,
+    });
+       my.navigateTo({ url: '../createServant/createServant' });
+    }else{
+      this.setData({
+      unSetModal: false,
+    });
+    }
   }
 });