【类 型】:refactor
【主 题】:订单提交时候 判断手机号 【描 述】: [原因]:改为正则匹配判断手机号合法性 而不是值判断是否为空 [过程]: [影响]: 【结 束】 # 类型 包含: # feat:新功能(feature) # fix:修补bug # docs:文档(documentation) # style: 格式(不影响代码运行的变动) # refactor:重构(即不是新增功能,也不是修改bug的代码变动) # test:增加测试 # chore:构建过程或辅助工具的变动
This commit is contained in:
parent
1645e9c70b
commit
242b5b5fee
@ -75,7 +75,8 @@
|
||||
@click="$store.commit('setCartShow',!$store.state.cartShow)" />
|
||||
</view>
|
||||
<view class="fci fz36 flex1 flex msb">
|
||||
<view class="flex1 p-l-12 flex column mc" @click="$store.commit('setCartShow',!$store.state.cartShow)">
|
||||
<view class="flex1 p-l-12 flex column mc"
|
||||
@click="$store.commit('setCartShow',!$store.state.cartShow)">
|
||||
<view class="fz36 fb">¥{{total | formatPrice}}</view>
|
||||
<view class="fz24" v-if="minimumOrderDifference>0">还差¥{{minimumOrderDifference | formatPrice}}起送
|
||||
</view>
|
||||
@ -186,13 +187,13 @@
|
||||
// 如果节点尚未生成,res值为null,循环调用执行
|
||||
if (!res) {
|
||||
setTimeout(() => {
|
||||
this.getElRect(elClass);
|
||||
this.getElRect(elClass)
|
||||
}, 10)
|
||||
return
|
||||
}
|
||||
this[dataVal] = res.height;
|
||||
this[dataVal] = res.height
|
||||
resolve()
|
||||
}).exec();
|
||||
}).exec()
|
||||
})
|
||||
},
|
||||
// 观测元素相交状态
|
||||
@ -262,21 +263,22 @@
|
||||
// 如果不存在height2,意味着数据循环已经到了最后一个,设置左边菜单为最后一项即可
|
||||
if (!height2 || scrollHeight >= height1 && scrollHeight < height2) {
|
||||
this.leftMenuStatus(i)
|
||||
return;
|
||||
return
|
||||
}
|
||||
}
|
||||
}, 10)
|
||||
},
|
||||
//"选好了"执行
|
||||
handleSeled() {
|
||||
if (!this.$store.state.userInfo.tel) { //没有手机号 跳转到手机获取
|
||||
uni.navigateTo({
|
||||
url: '/pages/main/getTel'
|
||||
})
|
||||
} else { //跳转到 确认订单页面
|
||||
uni.navigateTo({
|
||||
const regex = /^(\+?\d{1,4}[\s-]?)?\d{3}\*{4}\d{4}$/
|
||||
if (regex.test(this.$store.state.userInfo.tel)) { //手机号合法
|
||||
uni.navigateTo({ //跳转到订单页面
|
||||
url: '/pages/shop/order'
|
||||
})
|
||||
} else { //手机号不合法 获取为空
|
||||
uni.navigateTo({ //跳转到获取手机号页面
|
||||
url: '/pages/main/getTel'
|
||||
})
|
||||
}
|
||||
}
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user