Explorar o código

新增卡号页面调整

xiaohuangmao %!s(int64=4) %!d(string=hai) anos
pai
achega
005dc6149c

+ 1 - 1
pages/phoneCharges/phoneCharges.wxml

@@ -4,7 +4,7 @@
   <view class="tabs">
     <view class="tabs-content border-top-radius">
       <view class="tabs-content__tips">
-        <text class="tabs-content__tips-text">选择手机号(一人最多三个手机号)</text>
+        <text class="tabs-content__tips-text">选择手机号</text>
         <!-- <image class="tabs-content__tips-add" src="/image/postage/add.png"></image> -->
       </view>
       <view class="card-no vux-1px-b" bindtap="handlerAddCard">

+ 2 - 2
pages/postage/postage.js

@@ -19,8 +19,8 @@ Page({
     card_no: '', //油卡号
     firstLoad: true,
     tabsData: [
-      { id: 0, icon: '/image/postage/sinopec.png', title: '中国石化', tips: '选择油卡(一人最多十张油卡)', card_type: 'sinopec', card_no: '' },
-      { id: 1, icon: '/image/postage/petrochina.png', title: '中国石油', tips: '选择油卡(一人最多八张油卡)', card_type: 'petrochina', card_no: '' }
+      { id: 0, icon: '/image/postage/sinopec.png', title: '中国石化', tips: '选择油卡', card_type: 'sinopec', card_no: '' },
+      { id: 1, icon: '/image/postage/petrochina.png', title: '中国石油', tips: '选择油卡', card_type: 'petrochina', card_no: '' }
     ],
     fromSource: ''
   },

+ 21 - 3
pages/postageDetail/postageDetail.js

@@ -17,7 +17,7 @@ Page({
    * 表单提交
    */
   formSubmit(e) {
-    const { card_type , card_no } = e.detail.value
+    const { card_type , card_no, confirm_card_no } = e.detail.value
     if(!card_type) {
       appInstance.showToast('请选择卡类型')
       return
@@ -25,7 +25,18 @@ Page({
     if(!card_no) {
       appInstance.showToast('卡号不能为空')
       return
+    }else if(card_type ==='phone' && !this.checkPhone(card_no)){
+      appInstance.showToast('请输入正确的手机号码')
+      return
     }
+    if(!confirm_card_no) {
+      appInstance.showToast('请再次输入卡号')
+      return
+    }else if(card_no !== confirm_card_no) {
+      appInstance.showToast('两次密码不一致')
+      return
+    }
+   
     this.handleSubmit(e.detail.value)
   },
 
@@ -58,13 +69,20 @@ Page({
     // console.log('e',e)
   },
 
+ checkPhone(phone){ 
+    if(!(/^[1]([3-9])[0-9]{9}$/.test(phone))){
+    return false;
+  }
+    return true
+ },
+
   /**
    * 生命周期函数--监听页面加载
    */
   onLoad: function (options) {
-    let title = '添加油卡'
+    let title = '添加卡'
     if(options.card_no){
-      title = '修改油卡'
+      title = '修改卡'
       this.setData({isEdit:true})
     }
     wx.setNavigationBarTitle({ title })

+ 30 - 30
pages/postageDetail/postageDetail.wxml

@@ -1,32 +1,32 @@
 <form catchsubmit="formSubmit">
-    <view class="info_cell-wrap bacfff">
-      <view class="info_cell">
-        <view class="info_cell_lable">卡号:</view>
-        <view class="info_cell_content">
-          <input class="postage_input" type="number" name="card_no" placeholder="请输入卡号" value="{{card_no}}"/>
-        </view>
-      </view>
-    </view>
-
-    
-    <radio-group bindchange="radioChange" name="card_type">
-      <label class="radiobox">
-        <image src="/image/postage/petrochina.png" class="radiobox-image"></image>
-        <text class="radiobox-text">中国石油</text>
-        <radio value="petrochina" checked="{{card_type === 'petrochina'}}" disabled="{{card_type && card_type !== 'petrochina'}}" class="radiobox-radio" /> 
-      </label>
-      <label class="radiobox">
-        <image src="/image/postage/sinopec.png" class="radiobox-image"></image>
-        <text class="radiobox-text">中国石化</text>
-        <radio value="sinopec" checked="{{card_type === 'sinopec'}}" disabled="{{card_type && card_type !== 'sinopec'}}"  class="radiobox-radio" />
-      </label>
-      <label class="radiobox">
-        <image src="/image/postage/phone.png" class="radiobox-image"></image>
-        <text class="radiobox-text">手机号</text>
-        <radio value="phone" checked="{{card_type === 'phone'}}" disabled="{{card_type && card_type !== 'phone'}}" class="radiobox-radio" /> 
-      </label>
-    </radio-group>
-
-    <button class="add_postage_btn" formType="submit" type="primary">确认</button>
-    <view class="tips">为了您的财产安全,请确认卡号正确无误!</view>
+  <view class="form-control">
+      <view class="title">选择卡类别</view>
+      <radio-group bindchange="radioChange" name="card_type">
+        <label class="radiobox">
+          <image src="/image/postage/petrochina.png" class="radiobox-image"></image>
+          <text class="radiobox-text">中国石油</text>
+          <radio value="petrochina" checked="{{card_type === 'petrochina'}}" disabled="{{card_type && card_type !== 'petrochina'}}" class="radiobox-radio" /> 
+        </label>
+        <label class="radiobox">
+          <image src="/image/postage/sinopec.png" class="radiobox-image"></image>
+          <text class="radiobox-text">中国石化</text>
+          <radio value="sinopec" checked="{{card_type === 'sinopec'}}" disabled="{{card_type && card_type !== 'sinopec'}}"  class="radiobox-radio" />
+        </label>
+        <label class="radiobox">
+          <image src="/image/postage/phone.png" class="radiobox-image"></image>
+          <text class="radiobox-text">手机号</text>
+          <radio value="phone" checked="{{card_type === 'phone'}}" disabled="{{card_type && card_type !== 'phone'}}" class="radiobox-radio" /> 
+        </label>
+      </radio-group>
+  </view>
+  <view class="form-control form-control-flex">
+    <label class="form-label">卡号:</label>
+    <input class="input-control" type="number" name="card_no" value="{{card_no}}"/>
+  </view>
+  <view class="form-control form-control-flex">
+    <label class="form-label">确认卡号:</label>
+    <input class="input-control" type="number" name="confirm_card_no"  value="{{confirm_card_no}}"/>
+  </view>
+  <button class="add_postage_btn" formType="submit" type="primary">确认</button>
+  <view class="tips">为了您的财产安全,请确认卡号正确无误!</view>
 </form>

+ 37 - 2
pages/postageDetail/postageDetail.wxss

@@ -175,13 +175,43 @@
   font-size: 26rpx;
 }
 
+.form-control{
+  padding: 0 25rpx;
+  /* margin: 10rpx auto */
+}
+
+.form-control-flex{
+  display: flex;
+  align-items: center;
+  width: 87%;
+  margin: 20rpx auto;
+  background-color: #fff;
+  border-radius: 10rpx;
+}
+
+.form-control .title{
+  padding: 20rpx 0;
+  color: #2b2b2b;
+  font-weight: bold;
+}
+
+.form-control .input-control{
+  /* font-size: 26rpx; */
+  padding: 25rpx;
+  background-color: #fff;
+}
+
+.form-label{
+  color: #2b2b2b; 
+}
+
 .radiobox{
   display: flex;
   align-items: center;
-  width: 85%;
+  /* width: 85%; */
   background-color: #fff;
   border-radius: 10rpx;
-  margin: 25rpx auto;
+  margin: 0 auto 25rpx;
   padding: 20rpx;
   box-shadow: 5rpx 5rpx 5rpx #eee;
 }
@@ -194,4 +224,9 @@
 
 .radiobox-text{
   flex: 1;
+}
+
+.radiobox-title{
+  padding: 0 40rpx;
+  color: #5e5e5e;
 }

+ 1 - 1
pages/postageManage/postageManage.js

@@ -87,7 +87,7 @@ Page({
             act: 'member_card',
             op: 'card_del',
             topcard_id
-          }, function (res) {
+          },  res => {
             if (res.code == 200) {
               this.getDatas()
             }

+ 1 - 1
project.config.json

@@ -24,7 +24,7 @@
 			"outputPath": ""
 		},
 		"useIsolateContext": true,
-		"useCompilerModule": true,
+		"useCompilerModule": false,
 		"userConfirmedUseCompilerModuleSwitch": false
 	},
 	"compileType": "miniprogram",