diff --git a/src/chat-env.js b/src/chat-env.js index 4f47a82b..6299276c 100644 --- a/src/chat-env.js +++ b/src/chat-env.js @@ -6,6 +6,7 @@ const CHAT_ENV = {}; if (ENV == 'DEV') { CHAT_ENV.BASE_URL = 'http://chatsever.zianxin.com'; CHAT_ENV.WS_URL = 'ws://chatapp.zianxin.com/im'; + // CHAT_ENV.BASE_URL = 'http://127.0.0.1:8888'; // CHAT_ENV.WS_URL = 'ws://127.0.0.1:8876/im' @@ -18,10 +19,10 @@ if (ENV == 'DEV') { console.log("CHAT_ENV:", CHAT_ENV); -// // 生产 -// if (ENV == 'PROD') { -// CHAT_ENV.BASE_URL = 'http://chatsever.zianxin.com'; -// CHAT_ENV.WS_URL = 'ws://chatapp.zianxin.com/im'; -// } +// 生产 +if (ENV == 'PROD') { + CHAT_ENV.BASE_URL = 'http://chatsever.zianxin.com'; + CHAT_ENV.WS_URL = 'ws://chatapp.zianxin.com/im'; +} export default CHAT_ENV; diff --git a/src/manifest.json b/src/manifest.json index f45d5680..f532ee6c 100644 --- a/src/manifest.json +++ b/src/manifest.json @@ -2,8 +2,8 @@ "name" : "荷塘月色", "appid" : "__UNI__5B53E65", "description" : "聊天交友app", - "versionName" : "0.0.0", - "versionCode" : 1, + "versionName" : "0.0.1", + "versionCode" : 2, "transformPx" : false, "app-plus" : { "usingComponents" : true, diff --git a/src/pages/login/login.vue b/src/pages/login/login.vue index a2bbf942..dd092cc7 100644 --- a/src/pages/login/login.vue +++ b/src/pages/login/login.vue @@ -121,6 +121,16 @@ const handleLogin = async () => { ) return uni.showToast({ title: '手机号格式错误', icon: 'none' }); if (!smsCode.value) return uni.showToast({ title: '请填写验证码', icon: 'none' }); + + // #ifdef MP-WEIXIN + if (!isAgree.value) { + uni.showToast({ title: '请先同意授权', icon: 'none' }); + return + } + disposeLogin(); + // #endif + + // #ifndef MP-WEIXIN if (!isAgree.value) { agreeMessage .confirm({ @@ -133,6 +143,7 @@ const handleLogin = async () => { return; } disposeLogin(); + // #endif }; const disposeLogin = async () => { diff --git a/src/pages/message/chat-box.vue b/src/pages/message/chat-box.vue index 1a67c94d..56f6e72a 100644 --- a/src/pages/message/chat-box.vue +++ b/src/pages/message/chat-box.vue @@ -1295,11 +1295,13 @@ export default { }, }, }, - onLoad(options) { + async onLoad(options) { this.userId = options.memberId // 聊天数据 - if (options.chatIdx == -200) { + if (options.chatIdx == -200 && options.memberId == -200) { + await this.friendStore.loadFriend(); this.chat = this.chatStore.chats.find((chat) => chat.targetId == this.userId); + console.log("chat:", this.chat); } else { this.chat = this.chatStore.chats[options.chatIdx]; } diff --git a/src/pages/profile/like.vue b/src/pages/profile/like.vue index c4e03c94..31a29cfb 100644 --- a/src/pages/profile/like.vue +++ b/src/pages/profile/like.vue @@ -6,7 +6,7 @@ diff --git a/src/pages/profile/view-record.vue b/src/pages/profile/view-record.vue index 2be69987..b45fb35f 100644 --- a/src/pages/profile/view-record.vue +++ b/src/pages/profile/view-record.vue @@ -8,7 +8,7 @@ - + diff --git a/src/pages/tabbar/home.vue b/src/pages/tabbar/home.vue index 728054d8..ff2ebc35 100644 --- a/src/pages/tabbar/home.vue +++ b/src/pages/tabbar/home.vue @@ -136,3 +136,11 @@ const goSelectAddress = () => { }); }; + + \ No newline at end of file diff --git a/src/pages/tabbar/moments.vue b/src/pages/tabbar/moments.vue index 5c82eb89..779cba5e 100644 --- a/src/pages/tabbar/moments.vue +++ b/src/pages/tabbar/moments.vue @@ -14,7 +14,7 @@ + @change="(e) => (current = e.detail.current)" :duration="200"> diff --git a/src/pages/tabbar/profile.vue b/src/pages/tabbar/profile.vue index ba8eb54d..d15e42ce 100644 --- a/src/pages/tabbar/profile.vue +++ b/src/pages/tabbar/profile.vue @@ -244,16 +244,8 @@ const subOfficial = () => { confirmButtonText: "保存图片", }) .then(async () => { - // 首先请求存储权限 - // #ifdef APP-PLUS || MP-WEIXIN - const permissionStatus = await requestPermission("location") - // 已拒绝|受限 - if (permissionStatus === 'denied') { - gotoAppPermissionSetting() - } - // #endif uni.saveImageToPhotosAlbum({ - filePath: "/src/static/gzh/gzh.jpg", + filePath: "http://hch5.zianxin.com/gzh.jpg", success: () => { uni.showToast({ title: '保存成功', icon: 'success' }); }, @@ -274,7 +266,7 @@ const goFeedback = () => { // 菜单 const MenuCellList = [ - { title: '我的收益', value: '', icon: 'wallet', to: '/pages/wechat-tabbar/index' }, + // { title: '我的收益', value: '', icon: 'wallet', to: '/pages/wechat-tabbar/index' }, { title: '访客记录', value: '', icon: 'browse', to: '/pages/profile/view-record' }, { title: '认证中心', value: '', icon: 'user', to: '/pages/profile/verify-status' }, { title: '联系方式', value: '修改微信需客服核实', icon: 'user', to: '/pages/profile/set-wechat' }, diff --git a/src/sheep/components/segmented/segmented.vue b/src/sheep/components/segmented/segmented.vue index e8ced203..64650b9d 100644 --- a/src/sheep/components/segmented/segmented.vue +++ b/src/sheep/components/segmented/segmented.vue @@ -17,10 +17,12 @@ import { computed } from 'vue'; const props = withDefaults( defineProps<{ + itemWidht?: number | string; items?: { label: string }[]; modelValue?: number | string; }>(), { + itemWidht: 50, items: () => [], modelValue: 0, }, @@ -31,15 +33,15 @@ const emit = defineEmits<{ }>(); const activeStyle = computed(() => { - const x = 60 * Number(props.modelValue); + const x = Number(props.itemWidht) * Number(props.modelValue); return { - width: `${60}px`, + width: `${Number(props.itemWidht)}px`, transform: `translate3d(${x}px, 0, 0)`, }; }); const segmentedWidth = computed(() => { - return { width: `${props.items.length * 60}px` }; + return { width: `${props.items.length * Number(props.itemWidht)}px` }; }); function segmentedItem(item: { label: string }, index: number) {