diff --git a/src/app.wpy b/src/app.wpy index 8cf5aa8..66767a7 100644 --- a/src/app.wpy +++ b/src/app.wpy @@ -212,6 +212,7 @@ subPackages: [ 'exclusiveService', 'myDynamic', 'logoutDefault', + 'ImageCropper', ] }, { diff --git a/src/components/uploadPic.wpy b/src/components/uploadPic.wpy index 1687d26..4acfbf8 100644 --- a/src/components/uploadPic.wpy +++ b/src/components/uploadPic.wpy @@ -118,7 +118,7 @@ wepy.component({ console.log(vm.uploadData, 'vm.uploadData') if (vm.uploadData) { vm.$showLoading(`上传中...`) - let fileName = new Date().getTime() + Math.floor(Math.random() * 150) + '.' + type.split('/').pop().toLowerCase() + let fileName = new Date().getTime() + Math.floor(Math.random() * 150) + '.' + filePath.split('.').pop().toLowerCase() let filePathUrl = vm.uploadData.host + '/' + vm.uploadData.dir + fileName wx.uploadFile({ url: vm.uploadData.host, @@ -182,7 +182,7 @@ wepy.component({ let vm = this vm.$showToast(`网络环境异常,请稍后重试`) wx.request({ - url: `${service.host}/ali/upload/sts/token`, + url: `${service.host}/ali/upload/signature`, header: { 'Authorization': 'Bearer ' + wx.getStorageSync('token'), 'X-Requested-With': 'XMLHttpRequest' @@ -192,16 +192,7 @@ wepy.component({ success: ({code, data}) => { vm.uploadData = data.data vm.$app.$options.globalData.uploadData = data.data - // vm.date = new Date() - // vm.date.setHours( vm.date.getHours() + 1) - // vm.olicyText = { - // expiration: vm.toISOString(), // 设置policy过期时间。 - // conditions: [ - // // 限制上传大小。 - // ["content-length-range", 0, 1024 * 1024 * 1024], - // ], - // } - // vm.uploadData.policy = Base64.encode(JSON.stringify(policyText)) // policy必须为base64的string。 + vm.uploadFile(filePath, type, filePaths, index) } }) console.log('1111111111') diff --git a/src/components/userTitle.wpy b/src/components/userTitle.wpy index 566ce75..f09eac4 100644 --- a/src/components/userTitle.wpy +++ b/src/components/userTitle.wpy @@ -87,8 +87,8 @@ default: '' }, is_base_info: { - type: String, - default: '' + type: Boolean, + default: false } }, @@ -474,6 +474,7 @@ height:100%; display: flex; align-items: center; + z-index: 1; .main{ flex:1; display: flex; diff --git a/src/components/wepy-image-cropper.wpy b/src/components/wepy-image-cropper.wpy new file mode 100644 index 0000000..b90c0c2 --- /dev/null +++ b/src/components/wepy-image-cropper.wpy @@ -0,0 +1,1292 @@ + + + + + { + usingComponents: { + chooseImageTips: '~@/components/chooseImageTips', + } + } + diff --git a/src/components/wepy-image-cropperV2.wpy b/src/components/wepy-image-cropperV2.wpy new file mode 100644 index 0000000..8f76cff --- /dev/null +++ b/src/components/wepy-image-cropperV2.wpy @@ -0,0 +1,1320 @@ + + + + + { + usingComponents: { + chooseImageTips: '~@/components/chooseImageTips', + } + } + diff --git a/src/pages/tabBar/user.wpy b/src/pages/tabBar/user.wpy index 2c51cba..19e7705 100644 --- a/src/pages/tabBar/user.wpy +++ b/src/pages/tabBar/user.wpy @@ -11,11 +11,11 @@ {{ listCount.follow_count || '0' }} 关注 - + {{ listCount.fans_count || '0' }} 粉丝 - + {{ listCount.preview_count || '0' }} 访客 @@ -222,16 +222,16 @@ - - - - - - - - - - + + + + + + + + @@ -249,11 +249,7 @@ import https from '../../mixins/https' import base from '../../mixins/base' import {service} from '../../config.js' - // import visitorModel from '../../components/visitorModel' // 访客弹框 - // import userTitle from '../../components/userTitle' - // import loginTips from '../../components/loginTips' - // import chooseImageTips from '../../components/chooseImageTips' const app = getApp().$wepy.$options // import shareComponent from '../../components/shareComponent' import {getPhoneNumber} from '../../utils/util' @@ -636,51 +632,53 @@ // var recordTime = String(parseFloat(new Date(repTime).getTime()) / 1000) // self.UID = recordTime.substring(recordTime.length - 5) + String(data.id) wx.setStorageSync('UID', self.UID) - self.shareConfig.images[1].url = data.user_share_qrcode + self.shareConfig.images[1].url = data.user_share_qrcode || 'https://local-pictures.oss-cn-shenzhen.aliyuncs.com/202409/12/1726111703932.img' self.posterConfig = self.shareConfig - // self.$nextTick(() => { - // setTimeout(() => { - // self.$wx.selectComponent('#poster').onCreate(true, self) - // }, 100) - // }) + console.log('333===0999') + self.$nextTick(() => { + setTimeout(() => { + console.log(self.$wx.selectComponent('#poster'), self.$refs.poster, '---99') + self.$wx.selectComponent('#poster').onCreate(true, self.$wx) + }, 100) + }) // 小程序分享 - // self.title = `我是"${data.user.nickname}",这是我的小程序卡片` - // if (data.photo || data.avatar) { - // let year = '', city = '', degree = '', industry_sub = '' - // if (data.profile_courtship.birthday) { - // year = data.profile_courtship.birthday.slice(2, 4) + '年' - // } - // if (data.profile_courtship.city) { - // city = data.profile_courtship.city - // } - // if (data.profile_courtship.degree) { - // degree = data.profile_courtship.degree - // } - // if (data.industry_sub) { - // industry_sub = data.industry_sub - // } - // console.log(year, city, degree, industry_sub) - // self.shareConfig1.texts[0].text = `${year} | ${city}` - // self.shareConfig1.texts[1].text = `${degree} | ${industry_sub}` - // self.shareConfig1.images[0].url = data.photo || data.avatar - // self.posterConfig1 = self.shareConfig1 - // self.$nextTick(() => { - // setTimeout(() => { - // self.$wx.selectComponent('#posterV1').onCreate(true) - // }, 100) - // }) - // } else { - // // 重新获取分享码 - // self.$showToast('分享图片获取失败') - // } + self.title = `我是"${data.user.nickname}",这是我的小程序卡片` + if (data.photo || data.avatar) { + let year = '', city = '', degree = '', industry_sub = '' + if (data.profile_courtship.birthday) { + year = data.profile_courtship.birthday.slice(2, 4) + '年' + } + if (data.profile_courtship.city) { + city = data.profile_courtship.city + } + if (data.profile_courtship.degree) { + degree = data.profile_courtship.degree + } + if (data.industry_sub) { + industry_sub = data.industry_sub + } + console.log(year, city, degree, industry_sub) + self.shareConfig1.texts[0].text = `${year} | ${city}` + self.shareConfig1.texts[1].text = `${degree} | ${industry_sub}` + self.shareConfig1.images[0].url = data.photo || data.avatar + self.posterConfig1 = self.shareConfig1 + self.$nextTick(() => { + setTimeout(() => { + self.$wx.selectComponent('#posterV1').onCreate(true, self.$wx) + }, 100) + }) + } else { + // 重新获取分享码 + self.$showToast('分享图片获取失败') + } console.log(self.posterConfig1, '7777') this.init = true this.user = data.user this.user.rank_id = data.rank_profile.rank_id // this.user.card_num = data.approve_profile.card_num - // this.user.is_approved = data.approve_profile.is_approved - // this.user.is_real_approved = data.approve_profile.is_real_approved - // this.user.is_photo_audited = data.approve_profile.is_photo_audited + this.user.is_approved = data.approve_profile.is_approved + this.user.is_real_approved = data.approve_profile.is_real_approved + this.user.is_photo_audited = data.approve_profile.is_photo_audited // this.user.name = data.approve_profile.name this.listCount = { friend_count: data.friend_count, @@ -791,7 +789,7 @@ console.log(url, text) let titles = ['好友', '关注', '粉丝', '访客'], {is_base_info} = app.globalData, vm = this, {id} = wx.getStorageSync('userInfo') - if (titles.includes(text) && is_base_info !== 2) { + if (titles.includes(text) && !is_base_info) { vm.showVisitorModel = true return // return vm.$invoke('visitorModel', 'showModal', '0') // 游客模式,无法查看 diff --git a/src/pages/users/ImageCropper.wpy b/src/pages/users/ImageCropper.wpy new file mode 100644 index 0000000..8feb789 --- /dev/null +++ b/src/pages/users/ImageCropper.wpy @@ -0,0 +1,267 @@ + + + + + + + { + navigationBarTitleText: '编辑资料', + enablePullDownRefresh: false, + backgroundColorTop: '#ffffff', + backgroundColorBottom: '#ffffff', + usingComponents: { + WepyImageCropper: '~@/components/wepy-image-cropper', + } + } + diff --git a/src/pages/users/artificial.wpy b/src/pages/users/artificial.wpy index 375f32a..cb081ba 100644 --- a/src/pages/users/artificial.wpy +++ b/src/pages/users/artificial.wpy @@ -116,7 +116,8 @@ justShow: false, holdShow: false, againShow: false, - approve_history_body_reason: '' + approve_history_body_reason: '', + uploadData: null }, onShow() { // this.$parent.getTracker(this.$root.$name, this.config.navigationBarTitleText) @@ -141,81 +142,197 @@ uploadFile(filePaths, text) { let vm = this - vm.setImgArr = wx.getStorageSync('authenticationImg') - wx.uploadFile({ - url: service.image_upload, - filePath: filePaths, - method: 'POST', - name: 'fileData', - header: { - 'Authorization': 'Bearer ' + wx.getStorageSync('token'), - 'content-type': 'multipart/form-data', - 'X-Requested-With': 'XMLHttpRequest' - }, - success: (res) => { - let value = JSON.parse(res.data).data - if (value && !vm.audit) { - vm.nodata = true - if (text) { - if (text == 'back') { - vm.photo.splice(2, 1, value) - } else if (text == 'just') { - vm.photo.splice(1, 1, value) + console.log(filePaths, 'filePath') + console.log(vm.uploadData, 'vm.uploadData') + if (vm.uploadData) { + vm.$showLoading(`上传中...`) + let fileName = new Date().getTime() + Math.floor(Math.random() * 150) + '.' + filePaths.split('.').pop().toLowerCase() + let filePathUrl = vm.uploadData.host + '/' + vm.uploadData.dir + fileName + wx.uploadFile({ + url: vm.uploadData.host, + filePath: filePaths, + name: 'file', // 必须填file。 + formData: { + key: vm.uploadData.dir + fileName, + policy: vm.uploadData.policy, + OSSAccessKeyId: vm.uploadData.access_id, + signature: vm.uploadData.signature + // 'x-oss-security-token': securityToken // 使用STS签名时必传。 + }, + header: { + 'Authorization': 'Bearer ' + wx.getStorageSync('token'), + // 'content-type': 'multipart/form-data', + 'X-Requested-With': 'XMLHttpRequest' + }, + success: (res) => { + if (filePathUrl && !vm.audit) { + vm.nodata = true + if (text) { + if (text == 'back') { + vm.photo.splice(2, 1, filePathUrl) + } else if (text == 'just') { + vm.photo.splice(1, 1, filePathUrl) + } + } else { + vm.photo.splice(0, 1, filePathUrl) } - } else { - vm.photo.splice(0, 1, value) - } - setTimeout(() => { - vm.loading = false - }, 500) - } else if (value && vm.audit) { - // vm.showSubmit = true - vm.nodata = true - if (text) { - if (text == 'back') { - vm.photo.splice(2, 1, value) - vm.backShow = true - } else if (text == 'just') { - vm.photo.splice(1, 1, value) - vm.justShow = true + setTimeout(() => { + vm.loading = false + }, 500) + } else if (filePathUrl && vm.audit) { + // vm.showSubmit = true + vm.nodata = true + if (text) { + if (text == 'back') { + vm.photo.splice(2, 1, filePathUrl) + vm.backShow = true + } else if (text == 'just') { + vm.photo.splice(1, 1, filePathUrl) + vm.justShow = true + } + } else { + vm.photo.splice(0, 1, filePathUrl) + vm.holdShow = true } - } else { - vm.photo.splice(0, 1, value) - vm.holdShow = true - } - setTimeout(() => { + setTimeout(() => { vm.loading = false - }, 500) + }, 500) + } + wx.hideLoading() + console.log(vm.photo) + console.log(vm.setImgArr) + if (vm.photo[0] != vm.setImgArr[0] && vm.photo[1] != vm.setImgArr[1] && vm.photo[2] != vm.setImgArr[2]) { + vm.showSubmit = true + } + if (vm.audit) { + vm.againShow = true + } + }, + fail: (err) => { + wx.showModal({ // 使用模态框提示用户进行操作 + title: `温馨提示:`, + content: `很抱歉` + err, + showCancel: false, + confirmText: `确定`, + success: function (res) { + if (res.confirm) { + vm.$gotoBack(1) + vm.$emit('changeVal', '') + } + } + }) } - - console.log(vm.photo) - console.log(vm.setImgArr) - if (vm.photo[0] != vm.setImgArr[0] && vm.photo[1] != vm.setImgArr[1] && vm.photo[2] != vm.setImgArr[2]) { - vm.showSubmit = true + }) + } else { + let vm = this + vm.$showToast(`网络环境异常,请稍后重试`) + wx.request({ + url: `${service.host}/ali/upload/signature`, + header: { + 'Authorization': 'Bearer ' + wx.getStorageSync('token'), + 'X-Requested-With': 'XMLHttpRequest' + }, + method: 'get', + data: {}, + success: ({code, data}) => { + console.log(filePaths, data, 'd=====') + vm.uploadData = data.data + vm.$app.$options.globalData.uploadData = data.data + vm.uploadFile(filePaths) + // vm.date = new Date() + // vm.date.setHours( vm.date.getHours() + 1) + // vm.olicyText = { + // expiration: vm.toISOString(), // 设置policy过期时间。 + // conditions: [ + // // 限制上传大小。 + // ["content-length-range", 0, 1024 * 1024 * 1024], + // ], + // } + // vm.uploadData.policy = Base64.encode(JSON.stringify(policyText)) // policy必须为base64的string。 } - if (vm.audit) { - vm.againShow = true - } - }, - fail: (res) => { - vm.loading = false - vm.$showToast('上传失败,请重新上传') - }, - complete: () => { - } - }) + }) + console.log('1111111111') + } }, + // uploadFile(filePaths, text) { + // let vm = this + // vm.setImgArr = wx.getStorageSync('authenticationImg') + // wx.uploadFile({ + // url: service.image_upload, + // filePath: filePaths, + // method: 'POST', + // name: 'fileData', + // header: { + // 'Authorization': 'Bearer ' + wx.getStorageSync('token'), + // 'content-type': 'multipart/form-data', + // 'X-Requested-With': 'XMLHttpRequest' + // }, + // success: (res) => { + // let value = JSON.parse(res.data).data + // if (value && !vm.audit) { + // vm.nodata = true + // if (text) { + // if (text == 'back') { + // vm.photo.splice(2, 1, value) + // } else if (text == 'just') { + // vm.photo.splice(1, 1, value) + // } + // } else { + // vm.photo.splice(0, 1, value) + // } + // setTimeout(() => { + // vm.loading = false + // }, 500) + // } else if (value && vm.audit) { + // // vm.showSubmit = true + // vm.nodata = true + // if (text) { + // if (text == 'back') { + // vm.photo.splice(2, 1, value) + // vm.backShow = true + // } else if (text == 'just') { + // vm.photo.splice(1, 1, value) + // vm.justShow = true + // } + // } else { + // vm.photo.splice(0, 1, value) + // vm.holdShow = true + // } + // setTimeout(() => { + // vm.loading = false + // }, 500) + // } + // + // console.log(vm.photo) + // console.log(vm.setImgArr) + // if (vm.photo[0] != vm.setImgArr[0] && vm.photo[1] != vm.setImgArr[1] && vm.photo[2] != vm.setImgArr[2]) { + // vm.showSubmit = true + // } + // if (vm.audit) { + // vm.againShow = true + // } + // }, + // fail: (res) => { + // vm.loading = false + // vm.$showToast('上传失败,请重新上传') + // }, + // complete: () => { + // } + // }) + // }, + chooseimage(type) { let vm = this - wx.chooseImage({ + wx.chooseMedia({ count: 1, // sizeType: ['original', 'compressed'], // 可以指定是原图还是压缩图,默认二者都有 sizeType: ['compressed'], // 可以指定是原图还是压缩图,默认二者都有 sourceType: ['album', 'camera'], // 可以指定来源是相册还是相机,默认二者都有 success: (res) => { vm.loading = true - vm.uploadFile(res.tempFilePaths[0], type) + console.log(res, 'res====') + vm.uploadFile(res.tempFiles[0].tempFilePath, type) }, fail: () => { vm.loading = false @@ -227,7 +344,7 @@ let that = this, data = { chat_user_id: that.chat_user_id, - photos: that.photo, + photos: JSON.stringify(that.photo), from_user_id: wx.getStorageSync('from_user_id') ? wx.getStorageSync('from_user_id') : '' } if (that.showSubmit || that.againShow) { @@ -235,7 +352,7 @@ return that.$showToast('请上传手持身份证照') } that.$showLoading('提交中...') - that.$post({url: `${service.host}/app/manual/approve`, data}).then(({code, res}) => { + that.$post({url: `${service.host}/user/manual/approve`, data}).then(({code, res}) => { that.loading = false // if (!that.audit) { that.modalName = 'showAudit' @@ -264,7 +381,7 @@ // 初始化页面数据 initPageData() { - this.$get({url: `${service.host}/approve/profile`}, { + this.$get({url: `${service.host}/user/approve/profile`}, { success: ({code, data}) => { this.is_real_approved = data.is_real_approved if (data.identification_photos.length != 0) { diff --git a/src/pages/users/report.wpy b/src/pages/users/report.wpy index 04ae0bf..e0e4504 100644 --- a/src/pages/users/report.wpy +++ b/src/pages/users/report.wpy @@ -78,7 +78,7 @@ import {getPhoneNumber} from '../../utils/util' content: 0, value: '', mobile: '', - imgList: ['https://image.fulllinkai.com/202407/29/81VtbuoehYoi8ade6037c96a5b403f5311e662f6fae8.jpg'], + imgList: [], id: '', title: '', lable: [], diff --git a/src/pages/users/selfTextarea.wpy b/src/pages/users/selfTextarea.wpy index 206f93b..46629a0 100644 --- a/src/pages/users/selfTextarea.wpy +++ b/src/pages/users/selfTextarea.wpy @@ -331,19 +331,30 @@ import base from '../../mixins/base' that.tscList = [] that.submitList = [] } - - that.hobbiesList = that.hobbiesList.map(item => { + that.customHobbiesList = wx.getStorageSync('customHobList') || [] + // 兴趣爱好有值 + if (data.interest_label && data.interest_label.length > 0) { + that.hobbiesList = that.hobbiesList.map(item => { return { - title: item.title, - show: that.selectHobbiesList.includes(item.title) + title: item.title, + show: data.interest_label.includes(item.title) } - }) - that.customHobbiesList = that.customHobbiesList.map(item => { - return { - title: item, - show: that.selCustomList.includes(item.title) + }) + that.customHobbiesList = that.customHobbiesList.map(item => { + return { + title: item, + show: data.interest_label.includes(item.title) + } + }) + } else { + that.customHobbiesList = that.customHobbiesList.map(item => { + return { + title: item, + show: false + } + }) } - }) + try { // this.mate_conditon = data.mate_conditon let ageArr = data.mate_conditon.age.split('-', 2) @@ -445,7 +456,7 @@ import base from '../../mixins/base' let that = this if (this.throttleShow) { // this.throttleShow = false - if (!this.value) { + if (!this.value && that.text != '兴趣爱好') { this.$showToast('请输入内容') return } @@ -466,8 +477,7 @@ import base from '../../mixins/base' return item.show }).map(item => { return item.title }) console.log(defaultHob, customHob, '----999-----') - return - // data.interest_hobby = that.value + data.interest_label = [...defaultHob, ...customHob] } else if (that.text == '期望对方') { data.ideal_mate = that.value if (this.ageIndex.length != 0) { @@ -690,7 +700,10 @@ import base from '../../mixins/base' let data = { customName: that.customName } + that.customHobbiesList.push({title: that.customName, show: false}) + let list = that.customHobbiesList.map(item => item.title) + wx.setStorageSync('customHobList', list) that.modalName = '' // that.$post({url: `${service.host}/addresses/v2`}, data).then(({code, data}) => { // that.getuser() @@ -703,6 +716,8 @@ import base from '../../mixins/base' customName: item } that.customHobbiesList.splice(index, 1) + let list = that.customHobbiesList.map(item => item.title) + wx.setStorageSync('customHobList', list) console.log(that.customHobbiesList, 'that.customHobbiesList==') // that.$delete({url: `${service.host}/addresses/v2`}).then(({code, data}) => { // that.getuser() diff --git a/src/pages/users/unmarriV2.wpy b/src/pages/users/unmarriV2.wpy index ee2bd60..502c30c 100644 --- a/src/pages/users/unmarriV2.wpy +++ b/src/pages/users/unmarriV2.wpy @@ -335,6 +335,25 @@ } } } + + .ui-hobbies-big-box { + //margin: 20rpx 30rpx; + + .hobbies-box { + position: relative; + margin-right: 20rpx; + margin-bottom: 24rpx; + padding: 10rpx 22rpx; + height: 60rpx; + background: #f5f5f5; + border-radius: 30rpx; + } + + .hobbies-box-select { + color: #FFFFFF; + background: #FF5380; + } + } .textareaStyle{ margin-top: -8rpx; width: 80vw; @@ -818,7 +837,11 @@ - {{mylibs.interest_hobby}} + + + {{item}} + + 日常生活你有什么爱好?可以写一下 @@ -1223,7 +1246,10 @@ url: images } }).then(({code, data}) => { - vm.photos = [...vm.photos, ...data] + let dataV = data.map(item => { + return { photo: item } + }) + vm.photos = [...vm.photos, ...dataV] vm.lipImgs.push(data) vm.choosePicsShow = false clearTimeout(vm.nextTimer) diff --git a/src/pages/users/upgradeVIP.wpy b/src/pages/users/upgradeVIP.wpy index 313a4e7..83e8eaa 100644 --- a/src/pages/users/upgradeVIP.wpy +++ b/src/pages/users/upgradeVIP.wpy @@ -118,9 +118,10 @@ import wepy from '@wepy/core' import https from '../../mixins/https' import base from '../../mixins/base' - import { service } from '../../config.js' + const app = getApp().$wepy.$options + wepy.page({ mixins: [base, https], data: { @@ -177,8 +178,8 @@ this.chat_user_id = e.chat_user_id } this.rankList = [] - this.system = wx.getStorageSync('system') - console.log(this.system, '222') + this.system = app.globalData.systemInfo.system.split(' ')[0] + console.log(this.system, '2224') if (this.system == 'iOS') { this.$redirectTo(`/pages/users/upgradeVIP2?chat_user_id=${this.chat_user_id}`) return diff --git a/src/pages/users/upgradeVIP2.wpy b/src/pages/users/upgradeVIP2.wpy index 7c36c4d..4051143 100644 --- a/src/pages/users/upgradeVIP2.wpy +++ b/src/pages/users/upgradeVIP2.wpy @@ -23,7 +23,7 @@ {{user.rank_deadline?user.rank_deadline+'到期':'未开通'}} - +