diff --git a/pages.json b/pages.json index 748d6ac..6d2ea96 100644 --- a/pages.json +++ b/pages.json @@ -17,6 +17,18 @@ "enablePullDownRefresh": true } }, + { + "path": "pages/register/basicInfo", + "style": { + "navigationBarTitleText": "会员注册-基本信息" + } + }, + { + "path": "pages/register/perfectInfo", + "style": { + "navigationBarTitleText": "会员注册-完善信息" + } + }, { "path": "pages/upTheWall/upTheWall", "style": { diff --git a/pages/my/basicInformation.vue b/pages/my/basicInformation.vue index 8b059e7..a03ff87 100644 --- a/pages/my/basicInformation.vue +++ b/pages/my/basicInformation.vue @@ -144,6 +144,12 @@ } diff --git a/pages/my/uploadInfo.vue b/pages/my/uploadInfo.vue index 5efc8cb..d0a985a 100644 --- a/pages/my/uploadInfo.vue +++ b/pages/my/uploadInfo.vue @@ -24,10 +24,14 @@ 请根据示例图上传清晰照片 - - + + + + + + - + @@ -39,10 +43,13 @@ *上传身份证正面 - - + + - + + + + @@ -64,120 +71,76 @@ export default { data() { return { - hostImg: '', - frontPic: '', - backPic: '' + image_list: [], + image_list_back: [], + image_count: 6, + content: '', + frontImg: '', + backImg: '' } }, methods: { - checkImgInfo(tempFilePath, suc){ - uni.getImageInfo({ - src: tempFilePath, - success (res) { - let type = res.type; - console.log('checkImgInfo...', type); - if(type == 'png' || type == 'jpeg' || type == 'jpg'){ - suc && suc(true); - } else { - suc && suc(false); - } - }, - fail(err) { - suc && suc(false); - } - }) + // 预览图片 + lookImage(type,index){ + if(type == 1) { + this.$u.throttle(() => { + uni.previewImage({ + urls: this.image_list, + current: index + }); + }, 500); + }else { + this.$u.throttle(() => { + uni.previewImage({ + urls: this.image_list_back, + current: index + }); + }, 500); + } + + }, - // 选择图片 - ChooseImage(e) { - let that = this; + // 移除图片 + removeInage(current){ + this.image_list.splice(current, 1); + }, + // 上传凭证图片 + uploadImage(type){ + let current_count = this.image_count - this.image_list.length; + if(current_count == 0) return; uni.chooseImage({ - count: 1, - sizeType: ['original'], // 可以指定是原图original还是压缩图compressed ,默认二者都有 - sourceType: ['album', 'camera'], // album 从相册选图,camera 使用相机,默认二者都有 - success: res => { - that.hostImg = res.tempFilePaths[0]; - let tempFile = res.tempFiles.shift(); - let tempFilePath = res.tempFilePaths.shift(); - console.log('临时路径',res) - that.checkImgInfo(tempFilePath, (res) => { - // 过滤不是图片不是png、jpeg 格式 - if(res){ - if(tempFile.size > 10000000){ - uni.showModal({ - title: '', - content: '您选择的图片过大:'+ (tempFile.size / 1024000).toFixed(2) +"M,请点击确定重新上传", - success: res2 => { - if(res2.confirm){ - uni.chooseImage({ - count: 1, - sizeType: ['compressed'], - sourceType: ['album', 'camera'], - success: (res3) => { - console.log(res3) - let tempFilePath = res3.tempFilePaths.shift(); - that.frontPic = res3.tempFilePaths - that.is_wx_reduce = true; - } - }) - } - } - }) - } else{ - that.frontPic = res3.tempFilePaths + count: current_count, + complete: result => { + let tempFiles = result.tempFiles; + let image_list = []; + let overstep = false; + tempFiles.map(item => { + // 上传的图片需小于10MB + if(item.size < 10464788){ + if(type == 1) { + this.image_list.push(item.path) + console.log(this.image_list) + // this.frontImg = item.path + }else { + // this.backImg = item.path + this.image_list_back.push(item.path) } - } else { - uni.showModal({ - title: '', - content: '选择的图片须为jpg、jpeg或png格式', - showCancel: false, - confirmColor: '#1697EE' - }) + }else{ + overstep = true; } - }); - } - }); - }, - - // 上传图片到服务器 - upload(url){ - let that = this; - let uploads = []; - // 商品banner图上传 - if (that.img_list.length > 0) { - for (let i = 0; i < that.img_list.length; i++) { - let upload_img = new Promise((resolve, reject) => { - that.uploadFile(that.img_list[i], (res) => { - resolve(res); - }, (err) => { - reject(err); - }); }) - uploads.push(upload_img); - } - } - if(uploads.length == 0) { - that.realSubmitInfo([]); - return - } - Promise.all(uploads).then((result) => { - let img_url_list = []; - if(result.length > 0){ - img_url_list = result; - } - if(img_url_list) { - that.realSubmitInfo(img_url_list); + if(overstep){ + uni.showModal({ + title: '温馨提示', + content: '您上传的图片含有超出10M大小的限制,请优化大小后再上传!', + showCancel: false + }) + } + // this.image_list.push(...image_list); } - - - }).catch(err => { - that.is_publish = false; // 恢复提交按钮 - uni.showModal({ - title: '', - content: '图片上传失败,请重新提交', - confirmColor: '#1697EE' - }) }) }, + } } diff --git a/pages/my/welfare.vue b/pages/my/welfare.vue index f6d6bbd..b597fef 100644 --- a/pages/my/welfare.vue +++ b/pages/my/welfare.vue @@ -7,12 +7,44 @@ - - + + + + + + 1条红线 + 2900桃花 + 兑换 - - + + + + + + 1条红线 + 2900桃花 + + 兑换 + + + + + + + 1条红线 + 2900桃花 + + 兑换 + + + + + + + 1条红线 + 2900桃花 + 兑换 @@ -28,6 +60,11 @@ } diff --git a/pages/register/perfectInfo.vue b/pages/register/perfectInfo.vue new file mode 100644 index 0000000..24cd302 --- /dev/null +++ b/pages/register/perfectInfo.vue @@ -0,0 +1,394 @@ +