【类 型】:refactor

【主	题】:订单提交时候 判断手机号
【描	述】:
	[原因]:改为正则匹配判断手机号合法性  而不是值判断是否为空
	[过程]:
	[影响]:
【结	束】

# 类型 包含:
# feat:新功能(feature)
# fix:修补bug
# docs:文档(documentation)
# style: 格式(不影响代码运行的变动)
# refactor:重构(即不是新增功能,也不是修改bug的代码变动)
# test:增加测试
# chore:构建过程或辅助工具的变动
This commit is contained in:
tk 2024-06-05 18:14:46 +08:00
parent 1645e9c70b
commit 242b5b5fee

View File

@ -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 @@
// resnull
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'
})
}
}
},