Kaynağa Gözat

to: change dialog action

wangyuan 2 yıl önce
ebeveyn
işleme
e9c197dd40

+ 8 - 15
pages/appointment/appointment.js

@@ -1,5 +1,4 @@
 // pages/appointment/appointment.js
-import Dialog from '../../miniprogram_npm/@vant/weapp/dialog/dialog';
 Page({
 
   /**
@@ -8,7 +7,8 @@ Page({
   data: {
     hasAddress: true,
     calendarcolor: '#45A6B5',
-    timeActive: '0'
+    timeActive: '0',
+    vanoverlayshow: false
   },
 
   /**
@@ -29,18 +29,7 @@ Page({
    * 生命周期函数--监听页面显示
    */
   onShow() {
-    Dialog.confirm({
-      title: '',
-      confirmButtonText: '去充值',
-      cancelButtonText: '实体卡激活',
-      confirmButtonColor: '#333333',
-      cancelButtonColor: '#333333',
-      message: '您当前的检测次数为0,先充值次数',
-    }).then(() => {
-        // on confirm
-      }).catch(() => {
-        // on cancel
-      });
+    
   },
   handleTime (e) {
     console.log(e);
@@ -48,5 +37,9 @@ Page({
     this.setData({
       timeActive: timeActiveIndex
     })
-  }
+  },
+  // 激活卡片
+  handleActiveCard () {},
+  // 去充值
+  handleCharge () {}
 })

+ 11 - 1
pages/appointment/appointment.wxml

@@ -72,6 +72,16 @@
       <view class="f-btn cancel-btn ittflex">取消</view>
       <view class="f-btn confirm-btn itt-btn">确定</view>
     </view>
-    <van-dialog id="van-dialog" />
+    <van-overlay show="{{ vanoverlayshow }}">
+      <view class="wrapper ittflex">
+        <view class="model">
+          <view class="top-title">您当前的检测次数为0,先充值次数</view>
+          <view class="bottom-action ittflex">
+            <view class="btn w-cancel-btn ittflex" bindtap="handleActiveCard">实体卡激活</view>
+            <view class="btn w-confirm-btn ittflex" bindtap="handleCharge">去充值</view>
+          </view>
+        </view>
+      </view>
+    </van-overlay>
   </view>
 </view>

+ 33 - 0
pages/appointment/appointment.wxss

@@ -226,4 +226,37 @@ view .van-calendar__days {
 .cancel-btn {
   background-color: #F7F7F7;
   border: 1rpx solid #333333;
+}
+.wrapper {
+  height: 100%;
+}
+.model {
+  width: 540rpx;
+  height: 208rpx;
+  background: #FFFFFF;
+  border-radius: 24rpx;
+}
+.top-title {
+  font-size: 34rpx;
+  font-weight: 600;
+  color: #333333;
+  text-align: center;
+  height: 118rpx;
+  line-height: 118rpx;
+  border-bottom: 1rpx solid #DDDDDD;
+  box-sizing:border-box;
+}
+.btn {
+  width: 270rpx;
+  height: 90rpx;
+  box-sizing: border-box;
+  font-size: 34rpx;
+  color: #333333;
+}
+.w-cancel-btn {
+  font-weight: 400;
+}
+.w-confirm-btn {
+  border-left: 1rpx solid #DDDDDD;
+  font-weight: 600;
 }