提交 a3cad55d 编写于 作者: DCloud_JSON's avatar DCloud_JSON

修改组件名称

上级 1882983f
......@@ -10,7 +10,7 @@
console.log('App Launch')
initApp();
// #ifdef APP-PLUS
checkIsAgree();
//checkIsAgree(); 暂时先用默认生成的,自定义的等待原生支持后实现。因为启动vue界面时已经,请求了部分权限这并不符合国家的法规
// #endif
//#ifdef APP-NVUE || H5
......
......@@ -34,6 +34,10 @@ module.exports = {
"url": "https://ask.dcloud.net.cn/protocol.html"
}
],
"download": "https://m3w.cn/uniapp"
"download": "https://m3w.cn/uniapp"
},
"marketId":{//用于打开应用市场评分界面
"ios":"id1417078253",
"android":"123456"
}
}
......@@ -5,7 +5,11 @@ import callCheckVersion from '@/uni_modules/uni-upgrade-center-app/utils/call-ch
// #endif
export default function() {
// 初始化appVersion(仅app生效)
initAppVersion();
initAppVersion();
// baseappConfig挂载到getApp().
getApp({allowDefault: true}).config = baseappConfig;
//自定义路由拦截
const {
......
......@@ -20,7 +20,7 @@
}
}
export default {
name: "login-short-code",
name: "send-sms-code",
props: {
/**
* 倒计时时长 s
......@@ -35,6 +35,15 @@
phone: {
type: [String, Number],
default: ''
},
/*
验证码类型,用于防止不同功能的验证码混用,目前支持的类型login登录、register注册、bind绑定手机、unbind解绑手机
*/
codeType:{
type: String,
default(){
return 'login'
}
}
},
data() {
......@@ -69,7 +78,7 @@
this.request('user-center/sendSmsCode',
{
"mobile": this.phone,
"type": "login"
"type": this.codeType
},(data,result)=>{
console.log(data,result);
uni.showToast({
......@@ -79,37 +88,8 @@
this.reverseNumber = Number(this.count);
this.getCode();
this.$emit('getCode');
})
// uniCloud.callFunction({
// "name": "user-center",
// "data": {
// "action": "sendSmsCode",
// "params": {
// "mobile": this.phone,
// "type": "login"
// }
// },
// success: (e) => {
// uni.showToast({
// title: "短信验证码发送成功",
// icon: 'none'
// });
// this.reverseNumber = Number(this.count);
// this.getCode();
// this.$emit('getCode');
// },
// fail: (err) => {
// console.log(err);
// uni.showToast({
// title: '短信验证码发送失败',
// icon: 'none'
// });
// },
// complete: () => {
// uni.hideLoading()
// }
// })
}
)
},
getCode() {
if (this.reverseNumber == 0) {
......
......@@ -9,7 +9,6 @@ const debug = true;//开启后,会alert错误信息
export default function request(name,params,callback=false,{showLoading=false,loadText='',fail=()=>{}}={}){
// console.log('request');
showLoading||loadText? uni.showLoading({title:loadText}):'';
let routers = name.split('/');
var action = false
if (routers.length>1){
......@@ -23,28 +22,12 @@ export default function request(name,params,callback=false,{showLoading=false,lo
console.log(e);
const {result:{data,code}} = e
console.log(data,code);
if (code != 0 ) {
if(debug){
uni.showModal({
content: JSON.stringify(e),
showCancel: false,
confirmText: '知道了'
})
}
}
resolve(e)
return callback(data,e.result,e)
},
fail(err){
reject(err)
console.log(err);
if(debug){
uni.showModal({
content: JSON.stringify(err),
showCancel: false,
confirmText: '知道了'
})
}
fail(err)
},
complete() {
......
......@@ -7,6 +7,15 @@
"transformPx" : false,
/* 5+App特有相关 */
"app-plus" : {
"privacy" : {
"prompt" : "template",
"template" : {
"title" : "服务协议和隐私政策",
"message" : "  请你务必审慎阅读、充分理解“服务协议”和“隐私政策”各条款,包括但不限于:为了更好的向你提供服务,我们需要收集你的设备标识、操作日志等信息用于分析、优化应用性能。<br/>  你可阅读<a href=\"\">《服务协议》</a>和<a href=\"\">《隐私政策》</a>了解详细信息。如果你同意,请点击下面按钮开始接受我们的服务。",
"buttonAccept" : "我知道了",
"buttonRefuse" : "暂不同意"
}
},
"compatible" : {
"ignoreVersion" : true //true表示忽略版本检查提示框,HBuilderX1.9.0及以上版本支持
},
......@@ -31,14 +40,14 @@
"distribute" : {
/* android打包配置 */
"android" : {
"permissionExternalStorage" : {
"request" : "none",
"prompt" : "应用保存运行状态等信息,需要获取读写手机存储(系统提示为访问设备上的照片、媒体内容和文件)权限,请允许。"
},
"permissionPhoneState" : {
"request" : "none",
"prompt" : "为保证您正常、安全地使用,需要获取设备识别码(部分手机提示为获取手机号码)使用权限,请允许。"
},
// "permissionExternalStorage" : {
// "request" : "none",
// "prompt" : "应用保存运行状态等信息,需要获取读写手机存储(系统提示为访问设备上的照片、媒体内容和文件)权限,请允许。"
// },
// "permissionPhoneState" : {
// "request" : "none",
// "prompt" : "为保证您正常、安全地使用,需要获取设备识别码(部分手机提示为获取手机号码)使用权限,请允许。"
// },
"permissions" : [
"<uses-feature android:name=\"android.hardware.camera\"/>",
"<uses-feature android:name=\"android.hardware.camera.autofocus\"/>",
......
......@@ -61,16 +61,16 @@
}
}, {
"path": "pages/ucenter/edit/bind-mobile/bind-mobile",
"style": {
"navigationBarTitleText": "绑定手机号码"
}
},
{
"path": "pages/ucenter/ucenter",
"style": {
"navigationStyle": "custom"
}
},
{
"path": "pages/ucenter/ucenter",
"style": {
"navigationStyle": "custom"
}
},{
}, {
"path": "uni_modules/uni-feedback/pages/opendb-feedback/list",
"style": {
"navigationBarTitleText": "常见问题"
......@@ -90,8 +90,7 @@
"style": {
"navigationBarTitleText": "关于"
// #ifdef APP-PLUS
,
"app-plus": {
,"app-plus": {
"titleNView": {
"buttons": [{
"type": "share"
......@@ -138,7 +137,9 @@
"path": "uni_modules/uni-agree/pages/uni-agree/uni-agree",
"style": {
"navigationStyle": "custom",
"app-plus":{"popGesture": "none"}
"app-plus": {
"popGesture": "none"
}
}
}, {
"path": "pages/ucenter/settings/settings",
......@@ -195,8 +196,8 @@
},
{
"path":"uni_modules/uni-news-favorite/pages/uni-news-favorite/list",
"style":{
"path": "uni_modules/uni-news-favorite/pages/uni-news-favorite/list",
"style": {
"navigationBarTitleText": "阅读记录",
"enablePullDownRefresh": false
}
......@@ -246,4 +247,4 @@
"text": "我的"
}]
}
}
}
......@@ -9,7 +9,7 @@
disabled />
</template>
<!-- banner -->
<unicloud-db ref="bannerdb" v-slot:default="{data, loading, error, options}" :collection="collection"
<unicloud-db ref="bannerdb" v-slot:default="{data, loading, error, options}" collection="opendb-banner"
:field="field" @load="load">
<uni-swiper-dot class="uni-swiper-dot-box" @clickItem="clickItem" :info="data || bannerFormate(data, loading)"
:current="current" :mode="mode" :dots-styles="dotsStyles" field="content">
......@@ -88,8 +88,6 @@
text: 'Grid 9'
}
],
collection: 'opendb-banner',
// 查询字段,多个字段用 , 分割
field: '_id,bannerfile,open_url,title',
where: 'category_id==grid',
......
<template>
<view class="box">
<view class="box">
<!-- 登录框 (选择手机号所属国家和地区需要另行实现) -->
<uni-easyinput focus type="number" class="phone-input-box" :inputBorder="false" v-model="formData.phone"
<uni-easyinput clearable focus type="number" class="input-box" :inputBorder="false" v-model="formData.phone"
maxlength="11" placeholder="请输入手机号"></uni-easyinput>
<uni-easyinput type="number" class="phone-input-box" :inputBorder="false" v-model="formData.code" maxlength="6"
<uni-easyinput clearable type="number" class="input-box" :inputBorder="false" v-model="formData.code" maxlength="6"
placeholder="请输入验证码">
<template slot="right">
<login-short-code ref="shortCode" :phone="formData.phone"></login-short-code>
<send-sms-code ref="shortCode" code-type="bind" :phone="formData.phone"></send-sms-code>
</template>
</uni-easyinput>
<button class="send-btn-box" type="primary" @click="submit">提交</button>
</view>
</template>
<script>
import {
mapMutations,
mapGetters
<script>
import {
mapMutations,
mapGetters
} from 'vuex';
export default {
data() {
......@@ -39,28 +39,28 @@
},
onReady() {
},
methods: {
...mapMutations({
setUserInfo: 'user/login'
methods: {
...mapMutations({
setUserInfo: 'user/login'
}),
/**
* 完成并提交
*/
submit() {
console.log(this.formData);
this.request('user-center/bind_mobile_by_sms', {
"mobile": this.formData.phone,
"code": this.formData.code
}, (data, result) => {
console.log(result);
this.setUserInfo({"mobile":result.mobile})
uni.showToast({
title: result.msg,
icon: 'none'
});
if (result.code === 0) {
uni.navigateBack()
}
submit() {
console.log(this.formData);
this.request('user-center/bind_mobile_by_sms', {
"mobile": this.formData.phone,
"code": this.formData.code
}, (data, result) => {
console.log(result);
this.setUserInfo({"mobile":result.mobile})
uni.showToast({
title: result.msg,
icon: 'none'
});
if (result.code === 0) {
uni.navigateBack()
}
})
}
}
......@@ -71,16 +71,15 @@
.box {
align-items: center;
justify-content: center;
padding: 50rpx;
padding-top: 10px;
}
.box /deep/ .uni-easyinput__content {
height: 45px;
height: 50px;
}
.phone-input-box {
width: 650rpx;
height: 50px;
.input-box {
margin-top: 16px;
background-color: #f9f9f9;
border-radius: 6rpx;
......@@ -92,4 +91,4 @@
width: 650rpx;
margin-top: 15px;
}
</style>
</style>
......@@ -91,7 +91,9 @@
},
fail: (err) => {
console.log(err);
this.bindMobileBySmsCode()
if(err.code=='30002'){
this.bindMobileBySmsCode()
}
}
})
},
......
......@@ -5,31 +5,31 @@
<!-- 顶部文字 -->
<text class="content-top-title">请输入验证码</text>
<login-ikonw class="login-iknow" :text="tipText"></login-ikonw>
<!-- 登录框 (选择手机号所属国家和地区需要另行实现) -->
<uni-forms ref="form" :value="formData" :rules="rules">
<uni-forms-item name="phone">
<!-- <uni-easyinput type="number" class="phone-input-box" :inputBorder="false"
v-model="formData.phone" maxlength="11" placeholder="请输入手机号码">
</uni-easyinput> -->
<uni-easyinput type="number" class="phone-input-box" :inputBorder="false"
v-model="formData.code" maxlength="6" placeholder="请输入验证码">
<template slot="right">
<login-short-code :phone="formData.phone" ref="shortCode"></login-short-code>
</template>
</uni-easyinput>
</uni-forms-item>
<button class="send-btn-box" :disabled="!canSubmit" :type="canSubmit?'primary':'default'"
@click="submit">登录</button>
<!-- 登录框 (选择手机号所属国家和地区需要另行实现) -->
<uni-forms ref="form" :value="formData" :rules="rules">
<uni-forms-item name="phone">
<!-- <uni-easyinput type="number" class="phone-input-box" :inputBorder="false"
v-model="formData.phone" maxlength="11" placeholder="请输入手机号码">
</uni-easyinput> -->
<uni-easyinput type="number" class="phone-input-box" :inputBorder="false"
v-model="formData.code" maxlength="6" placeholder="请输入验证码">
<template slot="right">
<send-sms-code :phone="formData.phone" ref="shortCode"></send-sms-code>
</template>
</uni-easyinput>
</uni-forms-item>
<button class="send-btn-box" :disabled="!canSubmit" :type="canSubmit?'primary':'default'"
@click="submit">登录</button>
</uni-forms>
</view>
</view>
</view>
<uni-quick-login></uni-quick-login>
</view>
</template>
<script>
<script>
import mixin from '../common/loginPage.mixin.js';
export default {
export default {
mixins:[mixin],
data() {
return {
......@@ -47,62 +47,62 @@
onLoad({phoneNumber,phoneArea}) {
this.formData.phone = phoneNumber;
this.currenPhoneArea = '+' + Number(phoneArea);
},
onReady() {
this.$refs.shortCode.start();
},
methods: {
/**
* 完成并提交
*/
submit(){
uniCloud.callFunction({//联网验证登陆
"name": "user-center",
"data": {
"action": "loginBySms",
"params":{
"mobile":this.formData.phone,
"code":this.formData.code
}
},
success:async (e) => {
uni.hideLoading()
console.log(e.result);
if(e.result.code === 0){
this.loginSuccess(e.result)
}else{
uni.showModal({
title: '错误',
content: e.result.msg,
showCancel: false,
confirmText: '知道了',
});
}
},
fail: (err) => {
console.log(err);
uni.showModal({
title: '错误',
content: JSON.stringify(err),
showCancel: false,
confirmText: '知道了',
});
if(err.errCode===30002){
}
},
complete: () => {
uni.hideLoading()
}
})
onReady() {
this.$refs.shortCode.start();
},
methods: {
/**
* 完成并提交
*/
submit(){
uniCloud.callFunction({//联网验证登陆
"name": "user-center",
"data": {
"action": "loginBySms",
"params":{
"mobile":this.formData.phone,
"code":this.formData.code
}
},
success:async (e) => {
uni.hideLoading()
console.log(e.result);
if(e.result.code === 0){
this.loginSuccess(e.result)
}else{
uni.showModal({
title: '错误',
content: e.result.msg,
showCancel: false,
confirmText: '知道了',
});
}
},
fail: (err) => {
console.log(err);
uni.showModal({
title: '错误',
content: JSON.stringify(err),
showCancel: false,
confirmText: '知道了',
});
if(err.errCode===30002){
}
},
complete: () => {
uni.hideLoading()
}
})
}
}
}
</script>
<style>
@import url("../common/loginPage.css");
.phone-input-box{
margin-top: 10px;
}
</style>
<style>
@import url("../common/loginPage.css");
.phone-input-box{
margin-top: 10px;
}
</style>
......@@ -3,46 +3,46 @@
<view class="wrap-content">
<view class="content">
<!-- 顶部文字 -->
<text class="content-top-title">重置密码</text>
<text class="content-top-title">重置密码</text>
<login-ikonw v-show="isPhone" class="login-iknow" :text="tipText"></login-ikonw>
<!-- 登录框 (选择手机号所属国家和地区需要另行实现) -->
<uni-forms ref="form" :value="formData" :rules="rules">
<uni-forms-item name="phone">
<!-- focus规则如果上一页携带来“手机号码”数据就focus验证码输入框,否则focus手机号码输入框 -->
<uni-easyinput :focus="!formData.phone.length" type="number" class="phone-input-box" :inputBorder="false"
v-model="formData.phone" maxlength="11" placeholder="请输入手机号"></uni-easyinput>
</uni-forms-item>
<uni-forms-item name="code">
<uni-easyinput :focus="formData.phone.length" type="number" class="phone-input-box" :inputBorder="false"
v-model="formData.code" maxlength="6" placeholder="请输入验证码">
<template slot="right">
<login-short-code ref="shortCode" :phone="formData.phone"></login-short-code>
</template>
</uni-easyinput>
</uni-forms-item>
<uni-forms-item name="pwd">
<uni-easyinput type="password" class="phone-input-box" :inputBorder="false"
v-model="formData.pwd" placeholder="请输入新密码"></uni-easyinput>
</uni-forms-item>
<uni-forms-item name="pwd2">
<uni-easyinput type="password" class="phone-input-box" :inputBorder="false"
v-model="formData.pwd2" placeholder="请确认新密码"></uni-easyinput>
</uni-forms-item>
<button class="send-btn-box" :disabled="!canSubmit" :type="canSubmit?'primary':'default'"
@click="submit">完成</button>
<!-- 登录框 (选择手机号所属国家和地区需要另行实现) -->
<uni-forms ref="form" :value="formData" :rules="rules">
<uni-forms-item name="phone">
<!-- focus规则如果上一页携带来“手机号码”数据就focus验证码输入框,否则focus手机号码输入框 -->
<uni-easyinput :focus="!formData.phone.length" type="number" class="phone-input-box" :inputBorder="false"
v-model="formData.phone" maxlength="11" placeholder="请输入手机号"></uni-easyinput>
</uni-forms-item>
<uni-forms-item name="code">
<uni-easyinput :focus="formData.phone.length" type="number" class="phone-input-box" :inputBorder="false"
v-model="formData.code" maxlength="6" placeholder="请输入验证码">
<template slot="right">
<send-sms-code ref="shortCode" :phone="formData.phone"></send-sms-code>
</template>
</uni-easyinput>
</uni-forms-item>
<uni-forms-item name="pwd">
<uni-easyinput type="password" class="phone-input-box" :inputBorder="false"
v-model="formData.pwd" placeholder="请输入新密码"></uni-easyinput>
</uni-forms-item>
<uni-forms-item name="pwd2">
<uni-easyinput type="password" class="phone-input-box" :inputBorder="false"
v-model="formData.pwd2" placeholder="请确认新密码"></uni-easyinput>
</uni-forms-item>
<button class="send-btn-box" :disabled="!canSubmit" :type="canSubmit?'primary':'default'"
@click="submit">完成</button>
</uni-forms>
</view>
</view>
</view>
</template>
<script>
<script>
import mixin from '../common/loginPage.mixin.js';
export default {
export default {
mixins:[mixin],
data() {
return {
currenPhoneArea: ''
currenPhoneArea: ''
}
},
computed: {
......@@ -58,42 +58,42 @@ import mixin from '../common/loginPage.mixin.js';
this.formData.phone = event.phoneNumber;
this.currenPhoneArea = '+' + Number(event.phoneArea);
}
},
onReady() {
if(this.formData.phone){
this.$refs.shortCode.start();
}
},
methods: {
/**
* 完成并提交
*/
submit(){
this.$refs.form.submit()
.then(res=>{
this.request('user-center/resetPwdBySmsCode',{
"mobile":this.formData.phone,
"code":this.formData.code,
"password":this.formData.pwd
},(data,result)=>{
console.log(result);
uni.showToast({
title: result.msg,
icon: 'none'
});
if(result.code === 0){
uni.navigateBack()
}
})
})
onReady() {
if(this.formData.phone){
this.$refs.shortCode.start();
}
},
methods: {
/**
* 完成并提交
*/
submit(){
this.$refs.form.submit()
.then(res=>{
this.request('user-center/resetPwdBySmsCode',{
"mobile":this.formData.phone,
"code":this.formData.code,
"password":this.formData.pwd
},(data,result)=>{
console.log(result);
uni.showToast({
title: result.msg,
icon: 'none'
});
if(result.code === 0){
uni.navigateBack()
}
})
})
}
}
}
</script>
<style>
<style>
@import url("../common/loginPage.css");
.phone-input-box{
margin-top: 20rpx;
.content-top-title{
margin-bottom: 6px;
}
</style>
</style>
......@@ -111,7 +111,10 @@
appVersion() {
return getApp().appVersion
}
// #endif
// #endif
,appConfig(){
return getApp().config
}
},
methods: {
...mapMutations({
......@@ -156,15 +159,15 @@
* 去应用市场评分
*/
gotoMarket() {
// #ifdef APP-PLUS
// #ifdef APP-PLUS
if (uni.getSystemInfoSync().platform == "ios") {
// 这里填写appstore应用id
let appstoreid = 'id1417078253';
let appstoreid = this.appConfig.marketId.ios;// 'id1417078253';
plus.runtime.openURL("itms-apps://" + 'itunes.apple.com/cn/app/wechat/' + appstoreid + '?mt=8');
}
if (uni.getSystemInfoSync().platform == "android") {
var Uri = plus.android.importClass("android.net.Uri");
var uri = Uri.parse("market://details?id=" + plus.runtime.appid);
var uri = Uri.parse("market://details?id=" + this.appConfig.marketId.android);
var Intent = plus.android.importClass('android.content.Intent');
var intent = new Intent(Intent.ACTION_VIEW, uri);
var main = plus.android.runtimeMainActivity();
......
......@@ -124,19 +124,20 @@ exports.main = async (event, context) => {
mobile: params.mobile,
code: params.code
});
let verifyCode = await uniID.verifyCode({
mobile: params.mobile,
code: params.code
// let verifyCode = await uniID.verifyCode({
// mobile: params.mobile,
// code: params.code
// })
// if (verifyCode.code === 0) {
// } else {
// res = verifyCode
// }
res = await uniID.bindMobile({
uid: params.uid,
mobile: params.mobile,
code: params.code
})
if (verifyCode.code === 0) {
res = await uniID.bindMobile({
uid: params.uid,
mobile: params.mobile
})
} else {
res = verifyCode
}
console.log(res, verifyCode);
console.log(res);
break;
case 'register':
let {
......@@ -210,10 +211,10 @@ exports.main = async (event, context) => {
break;
case 'sendSmsCode':
//123546
return uniID.setVerifyCode({
mobile: params.mobile,
code:'123456'
code:'123456',
type: params.type
})
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册