微信小程序 更改手机号弹出框

 

/* <!-- changePhone --> */

.show-btn {

margin-top: 100rpx;

color: #22cc22;

}

 

.modal-mask {

width: 100%;

height: 100%;

position: fixed;

top: 0;

left: 0;

background: #000;

opacity: 0.5;

overflow: hidden;

z-index: 9000;

color: #fff;

}

 

.modal-dialog {

/* width: 540rpx; */

width: 86%;

overflow: hidden;

position: fixed;

top: 50%;

left: 0;

z-index: 9999;

background: #f9f9f9;

/* margin: -180rpx 105rpx; */

margin-left: 7%;

margin-top: -180px;

border-radius: 36rpx;

}

 

.modal-title {

padding-top: 50rpx;

font-size: 36rpx;

color: #030303;

text-align: center;

}

 

.modal-content {

padding: 10rpx 32rpx 30rpx 32rpx;

}

 

.modal-input {

display: flex;

background: #fff;

/* border: 2rpx solid #ddd; */

border-radius: 4rpx;

font-size: 28rpx;

flex-direction: column;

background: #f9f9f9;

}

 

.modal-input-div {

display: flex;

/* background: #fff; */

justify-content: center;

align-items: center;

text-align: center;

background: #f9f9f9;

margin-top: 20px;

/* border: 2rpx solid #ddd; */

/* border-radius: 4rpx; */

/* font-size: 28rpx; */

 

height: 40px;

}

.text {

flex: 0 0 60px;

background: #f9f9f9;

text-align: left;

}

.btn-text {

background-color: #fd4343;

width: 60px;

height: 40px;

flex: 0 0 100px;

color: white;

border-radius: 40px;

margin-left: 20px;

line-height: 40px;

}

.input {

width: 100%;

height: 82rpx;

font-size: 28rpx;

line-height: 28rpx;

padding: 0 20rpx;

box-sizing: border-box;

color: #333;

border: 2rpx solid #ddd;

background-color: white;

text-align: left;

}

 

input-holder {

color: #666;

font-size: 28rpx;

/* background-color: white; */

/* text-align: left; */

}

 

.modal-footer {

display: flex;

flex-direction: row;

height: 86rpx;

border-top: 1px solid #dedede;

font-size: 34rpx;

line-height: 86rpx;

margin-top: 20px;

}

 

.btn-cancel {

width: 50%;

color: #666;

text-align: center;

border-right: 1px solid #dedede;

}

 

.btn-confirm {

width: 50%;

color: #fd4343;

text-align: center;

}

/* <!-- changePhoneEnd --> */

<!-- changePhone -->

<view class='containerPromotion' bindtap ="clickCell">

 

<!--弹窗-->

<view class="modal-mask" bindtap="hideModal" catchtouchmove="preventTouchMove" wx:if="{{showModal}}"></view>

<view class="modal-dialog" wx:if="{{showModal}}">

<view class="modal-title">验证手机号</view>

<view class="modal-content">

<view class="modal-input">

<view class="modal-input-div">

<text class="text">手机号</text>

<input placeholder-class="input-holder" type="number" bindinput="inputValuePhone" maxlength="11" class="input" placeholder="请输入手机号"> </input>

</view>

<view class="modal-input-div">

<text class="text">验证码</text>

<input placeholder-class="input-holder" type="number" bindinput="inputValueCode" maxlength="6" class="input" placeholder="请输入验证码"></input>

<text class="btn-text" bindtap="onClickBtn">{{theString}}</text>

</view>

</view>

</view>

<view class="modal-footer">

<view class="btn-cancel" bindtap="onCancel" data-status="cancel">取消</view>

<view class="btn-confirm" bindtap="onConfirm" data-status="confirm">确定</view>

</view>

</view>

 

</view>

 

<!-- changePhoneEnd -->

 

/**changePhone*/

showModal: false,

timer: "",

timerNum: 60,

theString: "获取验证码",

phoneNum: "",

codeNum: ""

/**changePhoneEnd*/

### 使用 UniApp 开发基于 Vue 的微信小程序 #### 创建项目前的准备 为了顺利创建和运行一个基于 Vue 和 UniApp 的微信小程序,需先完成必要的环境搭建工作[^3]。这包括安装 HBuilderX 集成开发环境 (IDE),以及确保本地计算机上已正确设置 Node.js 环境。 #### 初始化新项目 打开 HBuilderX 后,在菜单栏选择 `File` -> `New Project...` 来新建一个项目。在出窗口中输入项目的名称,并勾选 “使用模板”,从中挑选适合初学者使用的默认模板来快速构建应用架[^1]。 #### 安装依赖项 进入刚刚创建好的项目根目录下执行如下命令以下载所需的 npm 包: ```bash npm install ``` 此操作会依据 package.json 文件中的定义自动拉取所有必需库及其版本号[^2]。 #### 编写代码逻辑 接下来可以着手于具体的业务功能实现了。对于每一个页面而言,通常会在 pages 目录内找到对应的 .vue 文件;这些文件遵循单文件组件(SFC)语法格式,允许在同一位置声明 HTML 结构、CSS 样式表以及 JavaScript 行为脚本。 作为入门练习,尝试修改首页 index.vue 中的内容,比如更改 `<template>` 下的文字显示效果或是调整样式属性等。 #### 运行与调试 当一切就绪之后,可以通过以下方式启动模拟器查看实际成果: - **直接编译**:点击左侧边栏上的 "Run" 图标旁边的下拉箭头,选取目标平台(此处应为 WeChat Mini Program),随后按下回车键即可; - 或者利用终端指令实现相同目的: ```bash npm run dev:mp-weixin ``` 上述过程将会把当前工程打包成为适用于微信公众平台的小应用程序包,并同步加载到连接着电脑端的手机设备上去预览测试。 #### 发布上线 经过充分的功能验证阶段后,如果确认无误,则可按照官方文档指引提交审核材料给腾讯团队审批发布正式版产品了。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值