diff --git a/package1/buyFood/buyFood.vue b/package1/buyFood/buyFood.vue index 2b3e1c4..04d8ce5 100644 --- a/package1/buyFood/buyFood.vue +++ b/package1/buyFood/buyFood.vue @@ -908,8 +908,10 @@ return arr.join(','); }, submitPay() { - if (this.currentOrderId && this.backendTotalAmount) { - this.$refs.payPopup.open('bottom'); + if (this.currentOrderId) { + uni.redirectTo({ + url: '/package1/order/orderDetail?id=' + this.currentOrderId + }); return; } if (this.isCreatingOrder) return; diff --git a/package1/components/common-loading/common-loading.vue b/package1/components/common-loading/common-loading.vue new file mode 100644 index 0000000..5ca3165 --- /dev/null +++ b/package1/components/common-loading/common-loading.vue @@ -0,0 +1,128 @@ + + + + + diff --git a/package1/components/ie-auth-dialog/ie-auth-dialog.vue b/package1/components/ie-auth-dialog/ie-auth-dialog.vue new file mode 100644 index 0000000..ab465b7 --- /dev/null +++ b/package1/components/ie-auth-dialog/ie-auth-dialog.vue @@ -0,0 +1,211 @@ + + + + + diff --git a/package1/components/ie-bottom-tab/ie-bottom-tab.vue b/package1/components/ie-bottom-tab/ie-bottom-tab.vue new file mode 100644 index 0000000..f780e8c --- /dev/null +++ b/package1/components/ie-bottom-tab/ie-bottom-tab.vue @@ -0,0 +1,155 @@ + + + + + diff --git a/package1/ieBrowser/chat.vue b/package1/ieBrowser/chat.vue index a42e4a9..cb22142 100644 --- a/package1/ieBrowser/chat.vue +++ b/package1/ieBrowser/chat.vue @@ -982,43 +982,117 @@ } this.closeEmoji() if (this.uploadingImage) return - if (!uni.chooseMedia) { - this.chooseImageCompat() + uni.showActionSheet({ + itemList: ['拍照', '从相册选图', '拍视频', '从相册选视频'], + success: (res) => { + if (res.tapIndex === 0) this.chooseHighQualityImage(['camera']) + if (res.tapIndex === 1) this.chooseHighQualityImage(['album']) + if (res.tapIndex === 2) this.chooseHighQualityVideo(['camera']) + if (res.tapIndex === 3) this.chooseHighQualityVideo(['album']) + } + }) + }, + compressCameraImage(filePath) { + return new Promise(resolve => { + if (!uni.compressImage || !filePath) { + resolve(filePath) + return + } + uni.compressImage({ + src: filePath, + quality: 88, + success: res => resolve(res.tempFilePath || filePath), + fail: () => resolve(filePath) + }) + }) + }, + chooseHighQualityImage(sourceType = ['album', 'camera']) { + const checkAndSend = async (filePath, fileSize) => { + if (!filePath) return + if (fileSize && fileSize > 20 * 1024 * 1024) { + uni.showToast({ title: '图片不能超过20MB,请换一张', icon: 'none' }) + return + } + const isCamera = sourceType.length === 1 && sourceType[0] === 'camera' + const finalPath = isCamera ? await this.compressCameraImage(filePath) : filePath + await this.uploadAndSendImage(finalPath, fileSize) + } + const isCamera = sourceType.length === 1 && sourceType[0] === 'camera' + if (uni.chooseMedia) { + uni.chooseMedia({ + count: 1, + mediaType: ['image'], + sourceType, + camera: 'back', + sizeType: isCamera ? ['compressed'] : ['original', 'compressed'], + success: async (res) => { + const file = res.tempFiles && res.tempFiles[0] + await checkAndSend(file && file.tempFilePath, file && file.size) + } + }) return } - uni.chooseMedia({ + uni.chooseImage({ count: 1, - mediaType: ['image', 'video'], - sourceType: ['album', 'camera'], - camera: 'back', - maxDuration: 60, + sourceType, + sizeType: isCamera ? ['compressed'] : ['original', 'compressed'], success: async (res) => { const file = res.tempFiles && res.tempFiles[0] - if (!file || !file.tempFilePath) return - if (res.type === 'video' || file.fileType === 'video') { - if (file.size && file.size > 100 * 1024 * 1024) { - uni.showToast({ title: '视频不能超过100MB,请先剪辑', icon: 'none' }) - return - } - if (file.duration && file.duration > 61) { - uni.showToast({ title: '视频时长不能超过60秒', icon: 'none' }) - return - } - await this.uploadAndSendVideo(file) - return - } - if (file.size && file.size > 10 * 1024 * 1024) { - uni.showToast({ title: '图片不能超过10MB', icon: 'none' }) - return - } - await this.uploadAndSendImage(file.tempFilePath, file.size) + const filePath = (file && file.path) || (res.tempFilePaths && res.tempFilePaths[0]) + await checkAndSend(filePath, file && file.size) } }) }, + chooseHighQualityVideo(sourceType = ['album', 'camera']) { + const checkAndSend = async (file) => { + if (!file || !file.tempFilePath) return + if (file.size && file.size > 150 * 1024 * 1024) { + uni.showToast({ title: '视频不能超过150MB,请先剪辑', icon: 'none' }) + return + } + if (file.duration && file.duration > 61) { + uni.showToast({ title: '视频时长不能超过60秒', icon: 'none' }) + return + } + await this.uploadAndSendVideo(file) + } + if (uni.chooseMedia) { + uni.chooseMedia({ + count: 1, + mediaType: ['video'], + sourceType, + camera: 'back', + maxDuration: 60, + sizeType: ['original', 'compressed'], + success: async (res) => { + const file = res.tempFiles && res.tempFiles[0] + await checkAndSend(file) + } + }) + return + } + if (uni.chooseVideo) { + uni.chooseVideo({ + sourceType, + camera: 'back', + maxDuration: 60, + compressed: false, + success: async (res) => { + await checkAndSend({ + tempFilePath: res.tempFilePath, + thumbTempFilePath: res.thumbTempFilePath || '', + duration: res.duration, + size: res.size + }) + } + }) + } + }, chooseImageCompat() { uni.chooseImage({ count: 1, sourceType: ['album', 'camera'], + sizeType: ['original', 'compressed'], success: async (res) => { const filePath = res.tempFilePaths && res.tempFilePaths[0] if (!filePath) return @@ -1118,6 +1192,7 @@ const local = this.messages.find(item => item.clientMsgId === clientMsgId) if (local) { local.localState = 'sending' + local.poster = posterUrl || local.poster || '' this.saveLocalMessages() } this.persistMessage({ @@ -1128,6 +1203,7 @@ mediaDuration, mediaSize: file.size, mediaFormat: 'video', + poster: posterUrl, mediaCheckUrl: posterUrl, mediaCheckType: posterUrl ? 2 : undefined }) diff --git a/package1/ieBrowser/index.vue b/package1/ieBrowser/index.vue index b04ce3a..272cca3 100644 --- a/package1/ieBrowser/index.vue +++ b/package1/ieBrowser/index.vue @@ -213,23 +213,30 @@ {{ matchedPerson.avatar }} {{ matchedPerson.name }} - - - {{ matchedPerson.lastActiveText }} + + + + {{ matchedPerson.lastActiveText }} + + + ⚡ 也在找{{ intentLabel(currentMatch.intent) }} + + + {{ matchedPerson.moodIcon }} + {{ matchedPerson.moodText }} + - - ⚡ TA 也在找{{ intentLabel(currentMatch.intent) }} + + + {{ modeText(matchedPerson.mode) }} + {{ genderText(matchedPerson.gender) }} + 📍 {{ matchedPerson.regionName }} + + + # {{ tag }} + + {{ matchedPerson.state }} - - {{ matchedPerson.moodIcon }} - {{ matchedPerson.moodText }} - - {{ modeText(matchedPerson.mode) }} · {{ genderText(matchedPerson.gender) }} - 📍 {{ matchedPerson.regionName }} - - # {{ tag }} - - {{ matchedPerson.state }} {{ matchedPerson.quote }} 人格卡片 @@ -271,16 +278,20 @@ + +