diff --git a/common/api/user.js b/common/api/user.js index f2f9ecc..d4de83e 100644 --- a/common/api/user.js +++ b/common/api/user.js @@ -68,6 +68,10 @@ export default { launch_id: launch_id }); }, + // 标签的列表 + labelList({}) { + return vm.$u.post('StartUp/labelList', {}); + }, // 获取地区列表 getAreaList({ pid }) { return vm.$u.post('Area/areaList', { @@ -78,6 +82,6 @@ export default { getAddressList() { return vm.$u.post('MemberAddress/addressList'); } - } + } } } \ No newline at end of file diff --git a/components/logininput/rictText.js b/components/logininput/rictText.js new file mode 100644 index 0000000..65f97a1 --- /dev/null +++ b/components/logininput/rictText.js @@ -0,0 +1,74 @@ +/* +graceUI rich-text 鍔犲己宸ュ叿 +link : graceui.hcoder.net +author : 5213606@qq.com 娣辨捣 + +*/ + +// 姝e垯鍙橀噺 +var graceRichTextReg; + +// 鎵归噺鏇挎崲鐨勬牱寮� [ 鏍规嵁椤圭洰闇€姹傝嚜琛岃缃� ] +var GRT = [ + // div 鏍峰紡 + ['div', "line-height:2em;"], + // h1 鏍峰紡 + ['h1', "font-size:3em; line-height:1.5em;"], + // h2 鏍峰紡 + ['h2', "font-size:2em; line-height:1.8em;"], + // h3 鏍峰紡 + ['h3', "font-size:1.6em; line-height:2em;"], + // h4 鏍峰紡 + ['h4', "font-size:1.2em; line-height:2em;"], + // h5 鏍峰紡 + ['h5', "font-size:1em; line-height:2em;"], + // h6 鏍峰紡 + ['h6', "font-size:0.9em; line-height:2em;"], + // p 鏍峰紡 + ['p', "font-size:1em; line-height:2em;"], + // b 鏍峰紡 + ['b', "font-size:1em; line-height:2em;"], + // strong 鏍峰紡 + ['strong', "font-size:1em; line-height:2em;"], + // code 鏍峰紡 + ['code', "font-size:1em; line-height:1.2em; background:#F6F7F8; padding:8px 2%; width:96%;"], + // img 鏍峰紡 + ['img', "width:100%; margin:8px 0;"], + // blockquote + ['blockquote', "font-size:1em; border-left:3px solid #D1D1D1; line-height:2em; border-radius:5px; background:#F6F7F8; padding:8px 2%;"], + // li 鏍峰紡 + ['ul', "padding:5px 0; list-style:none; padding:0; margin:0;"], + ['li', "line-height:1.5em; padding:5px 0; list-style:none; padding:0; margin:0; margin-top:10px;"], + // table + ['table', "width:100%; border-left:1px solid #F2F3F4; border-top:1px solid #F2F3F4;"], + ['th', "border-right:1px solid #F2F3F4; border-bottom:1px solid #F2F3F4;"], + ['td', "border-right:1px solid #F2F3F4; border-bottom:1px solid #F2F3F4; padding-left:5px;"] +]; + + +module.exports = { + format : function(html){ + html = html.replace(/
|<'+GRT[i][0]+' (.*?)>', 'gi'); + html = html.replace(graceRichTextReg , function(word){ + // 鍒嗘瀽 dom 涓婃槸鍚﹀甫鏈� style="" + if(word.indexOf('style=') != -1){ + var regIn = new RegExp('<' + GRT[i][0] + '(.*?)style="(.*?)"(.*?)(/?)>', 'gi'); + return word.replace(regIn, '<'+ GRT[i][0] +'$1style="$2 ' + GRT[i][1] +'"$3$4>'); + }else{ + var regIn = new RegExp('<' + GRT[i][0] + '(.*?)(/?)>', 'gi'); + return word.replace(regIn, '<'+ GRT[i][0] +'$1 style="' + GRT[i][1] +'$2">'); + } + }); + } + return html; + } + +} \ No newline at end of file diff --git a/components/mine/address-active/index.vue b/components/mine/address-active/index.vue index df3052b..ca8983d 100644 --- a/components/mine/address-active/index.vue +++ b/components/mine/address-active/index.vue @@ -22,7 +22,7 @@保存地址 -+ + diff --git a/pageA/login/login.vue b/pageA/login/login.vue index 8d8692a..1ec664f 100644 --- a/pageA/login/login.vue +++ b/pageA/login/login.vue @@ -14,16 +14,16 @@ - + - + - - 我已详细阅读并同意 -《用户协议》 -《隐私协议》 -《使用协议》 ++ + 我已详细阅读并同意 +{{item.text}} +@@ -68,50 +68,100 @@ disabled: false }], value: '', - phones : '', + phones: '', text: '获取验证码', login: '登录', - register : '新用户点击注册', + register: '新用户点击注册', show: false, tips: '', // refCode: null, seconds: 60, member_mobile: '', //手机号 - smslog_type : '2',//状态 - sms_code : '', //验证码 + smslog_type: '2', //状态 + sms_code: '', //验证码 + // 协议渲染 + pact_text: [{ + "id": '1', + "text": "《用户协议》" + }, { + "id": '2', + "text": "《隐私协议》" + }, { + "id": '3', + "text": "《使用协议》" + }, + + ] }; }, onLoad() { // 数据的请求 - this.apiwelcome() + this.apiwelcome() }, methods: { - apiwelcome(){ + apiwelcome() { this.$u.api.sendSmsCode({ - - }).then((res)=>{ + + }).then((res) => { console.log(res) }) }, + // 协议跳转 + pact_click(index){ + console.log(index) + uni.navigateTo({ + url: '/pageA/pactList/pactList?index=' + index + }); + }, // 用户登录 - loginOn(){ - // console.log("登录") + loginOn() { + console.log("登录") // console.log(this.member_mobile) // console.log(this.sms_code) + // 判断手机号是否为空 + // 校验手机号 + let type_phone = this.$u.test.mobile( this.member_mobile) + if( this.member_mobile == ''){ + this.$refs.uToast.show({ + title: '手机号不能为空', + type: 'error' + }) + return false; + } + if (type_phone == false) { + this.$refs.uToast.show({ + title: '手机号格式不正确', + type: 'error' + }); + return false; + } + if( this.sms_code == ''){ + this.$refs.uToast.show({ + title: '验证码不能为空', + type: 'error' + }) + return false; + } this.$u.api.phoneLogin({ member_mobile: this.member_mobile, sms_code: this.sms_code }).then((res) => { + console.log(res) // console.log(res) - if(res.errCode == 0){ + if (res.errCode == 0) { // 缓存用户的信息 uni.setStorage({ - key: 'user_info', - data: res.data, - success: function () { - console.log('success'); - } + key: 'user_info', + data: res.data, + success: function() { + console.log('success'); + // 跳转首页 + uni.navigateTo({ + url : '/pageA/topick/topick' + }) + } }); + // 存储接口请求所需token uni.setStorage({ key: 'token', @@ -124,61 +174,61 @@ url: '/pageA/topick/topick' }) } - if(res.errCode == 1){ + if (res.errCode == 1) { this.$refs.uToast.show({ title: res.message, type: 'error' }) } - + }) }, // qq授权登录 - rect_qq(){ + rect_qq() { console.log("授权Q") var vm = this; uni.getProvider({ service: 'oauth', - success: function (res) { - console.log('qq',res) //weixin + success: function(res) { + console.log('qq', res) //weixin if (~res.provider.indexOf('qq')) { uni.login({ - provider: 'qq', - success: function (loginRes) { + provider: 'qq', + success: function(loginRes) { console.log(loginRes) this.getApplogin(loginRes) vm.$HTTP({ - method: 'GET', - baseURL:'https://graph.qq.com/user/get_user_info', - url: '', - data: { - openid:loginRes.authResult.openid, - access_token:loginRes.authResult.access_token, - appid:'101884160' - }, - load:true - }).then((data) =>{ - console.log(data) - + method: 'GET', + baseURL: 'https://graph.qq.com/user/get_user_info', + url: '', + data: { + openid: loginRes.authResult.openid, + access_token: loginRes.authResult.access_token, + appid: '101884160' + }, + load: true + }).then((data) => { + console.log(data) + }, (err) => { - console.log(err) + console.log(err) }); } }); - }else{ + } else { console.log("错误") } } }); }, // 跳转注册页面 - registerUrl(){ + registerUrl() { uni.navigateTo({ url: '/pageA/register/register' }); }, // 授权登录 - getApplogin(){ + getApplogin() { console.log("11") }, // 选中某个复选框时,由checkbox时触发 @@ -192,18 +242,17 @@ mask_u() { this.show = !this.show }, - tochange(){ - + tochange() { + } }, - components:{ + components: { identifying } }; diff --git a/pageA/register/register.vue b/pageA/register/register.vue index aa9fe07..4366424 100644 --- a/pageA/register/register.vue +++ b/pageA/register/register.vue @@ -80,11 +80,35 @@ methods: { // 用户注册 loginIn(){ + let type_phone = this.$u.test.mobile( this.member_mobile) + if( this.member_mobile == ''){ + this.$refs.uToast.show({ + title: '手机号不能为空', + type: 'error' + }) + return false; + } + if (type_phone == false) { + this.$refs.uToast.show({ + title: '手机号格式不正确', + type: 'error' + }); + return false; + } + if( this.sms_code == ''){ + this.$refs.uToast.show({ + title: '验证码不能为空', + type: 'error' + }) + return false; + } this.$u.api.phoneRegister({ member_mobile: this.member_mobile, sms_code: this.sms_code }).then((res) => { - console.log(res) + console.log('3333333333',res); + // 校验手机号 + // console.log(res) if(res.errCode == 0){ // 缓存用户的信息 @@ -93,6 +117,10 @@ data: res.data, success: function () { console.log('success'); + // 跳转选择页面 + uni.navigateTo({ + url : '/pageA/topick/topick' + }) } }); // 注册返回参数 @@ -108,6 +136,13 @@ type: 'error' }) } + if(res.errCode == 2){ + this.$refs.uToast.show({ + title: res.message, + type: 'primary', + url: '/pageA/login/login' + }) + } }) }, // 选中某个复选框时,由checkbox时触发 diff --git a/pageA/topick/topick.vue b/pageA/topick/topick.vue index fb1912c..800b00c 100644 --- a/pageA/topick/topick.vue +++ b/pageA/topick/topick.vue @@ -10,7 +10,7 @@ - {{item}} +{{item.name}} {{submites}} @@ -28,11 +28,19 @@ value: '', login: '登录', show: false, - tab_lables: ["科技", "科技", "科技", "科技", "科技", "科技", "科技", "科技", "科技", "科技"], + tab_lables: [], submites: '选好了进入首页', rSelect:[] }; }, + onLoad(){ + + // 列表的方法 + this.labelList() + }, + + mounted(){ + }, methods: { // 选中某个复选框时,由checkbox时触发 checkboxChange(e) { @@ -59,7 +67,17 @@ uni.switchTab({ url: '/pages/index/index' }); - } + }, + // 标签的列表展示 + labelList(){ + console.log("11111222") + this.$u.api.labelList({ + + }).then((res) => { + console.log(res) + this.tab_lables = res.data + }) + }, } }; diff --git a/pages.json b/pages.json index 08bf068..10063a7 100644 --- a/pages.json +++ b/pages.json @@ -17,6 +17,17 @@ } } }, + { + "path": "pactList/pactList", + "style": { + "navigationBarTitleText": "用户协议详情", + "app-plus":{ + "titleNView":{ + "backgroundColor":"#fff" + } + } + } + }, { "path": "bindinges/bindinges", "style": { diff --git a/static/mp4.mp4 b/static/mp4.mp4 new file mode 100644 index 0000000..86cd8de Binary files /dev/null and b/static/mp4.mp4 differ