diff --git a/App.vue b/App.vue index ccc2c3e..5b932ee 100644 --- a/App.vue +++ b/App.vue @@ -161,9 +161,9 @@ this.init(this.userId); }else { // 跳转到登录页 - uni.navigateTo({ - url: "/pages/login/login" - }) + // uni.navigateTo({ + // url: "/pages/login/login" + // }) } // 未读消息总数(用于角标) diff --git a/components/privacy-agreement.vue b/components/privacy-agreement.vue new file mode 100644 index 0000000..48a138f --- /dev/null +++ b/components/privacy-agreement.vue @@ -0,0 +1,117 @@ + + + + + + diff --git a/pages/cart/cart.vue b/pages/cart/cart.vue index ef14cc6..c4f9861 100644 --- a/pages/cart/cart.vue +++ b/pages/cart/cart.vue @@ -206,7 +206,7 @@ }, onShow() { //判断登录,跳转去登录 - logindo(); + // logindo(); console.log('onShow'); this.openId = myCache('openId'); diff --git a/pages/category/category.vue b/pages/category/category.vue index 57beada..374d95b 100644 --- a/pages/category/category.vue +++ b/pages/category/category.vue @@ -309,8 +309,8 @@ this.getSort(); }, onShow(){ - //判断登录,跳转去登录 - logindo(); + // 判断登录,跳转去登录 + // logindo(); this.openId = myCache('openId'); var user = myCache('user'); @@ -351,7 +351,7 @@ }, mounted() { if(this.userid==""||this.userid=="0"){ - this.$refs.loginId.open(); + // this.$refs.loginId.open(); } }, onPullDownRefresh() { diff --git a/pages/chatbox/chat.vue b/pages/chatbox/chat.vue index 1992736..e429e0d 100644 --- a/pages/chatbox/chat.vue +++ b/pages/chatbox/chat.vue @@ -12,34 +12,38 @@ - - - - - - - - {{ chat.showName || '未知' }} - {{ changeTime(chat.lastSendTime) }} - - - - {{ chat.lastContent || '' }} - - - {{ chat.unreadCount }} - - - - - + + + + + + + + + + {{ chat.showName || '未知' }} + {{ changeTime(chat.lastSendTime) }} + + + + {{ chat.lastContent || '' }} + + + {{ chat.unreadCount }} + + + + + + + @@ -62,6 +66,7 @@ export default { data() { return { loadStatus: 'loadmore', + activeSwipeId:-1, options: [ { text: '删除', @@ -69,7 +74,7 @@ export default { backgroundColor: '#ed2a28' } } - ], + ], messageText: '', msgType: 'error' } @@ -100,7 +105,7 @@ export default { }, onShow() { //判断登录,跳转去登录 - logindo(); + // logindo(); console.log("this.chats列表.......",this.chats) this.loadStatus = 'nomore' this.setBadge(this.unreadCount) @@ -137,27 +142,34 @@ export default { clearBadgeNumber(); } }, + + swipeChange(e, index) { + console.log('返回:', e); + console.log('当前索引:', index); + }, + swipeClick(e, index) { + let { content } = e; + if (content.text === '删除') { + const that = this + uni.showModal({ + title: '提示', + content: '确定要删除此聊天记录吗?', + success: res => { + if (res.confirm) { + that.removeChat(index) // 调用 Vuex action + } + } + }); + } + }, // 长按打开滑动菜单 handleLongPress(index) { - this.$refs.swipeRef[index].open() + console.log("handleLongPress",index) + this.activeSwipeId=this.chats[index].targetId; + this.$forceUpdate(); }, - - // 滑动菜单点击(删除) - actionClick(chat, index) { - const that = this - uni.showModal({ - title: '提示', - content: '确定要删除此聊天记录吗?', - success: res => { - if (res.confirm) { - that.$refs.swipeRef[index].close() - that.removeChat(index) // 调用 Vuex action - } - } - }) - }, - + // 跳转到聊天页面 gotoChat(chat, index) { // 清除该会话的未读(由chat页面处理) diff --git a/pages/chatbox/chat0.vue b/pages/chatbox/chat0.vue new file mode 100644 index 0000000..7718389 --- /dev/null +++ b/pages/chatbox/chat0.vue @@ -0,0 +1,356 @@ + + + + + diff --git a/pages/chatbox/report.vue b/pages/chatbox/report.vue index 580cd57..3dc1ee6 100644 --- a/pages/chatbox/report.vue +++ b/pages/chatbox/report.vue @@ -333,15 +333,46 @@ export default { }); if (res.data.success ) { uni.hideLoading(); - uni.showToast({ title: '投诉已提交,我们会尽快处理', icon: 'success' }); - setTimeout(() => uni.navigateBack(), 1500); + // uni.showToast({ title: '投诉已提交,我们会尽快处理', icon: 'success' }); + // setTimeout(() => uni.navigateBack(), 1500); + uni.showModal({ + title: '提示', + content: '投诉已提交,我们会尽快处理!', + cancelText: '取消', + confirmText: '确定', + success: ress => { + if (ress.confirm) { + } + uni.navigateBack(); + } + }); } else { uni.hideLoading(); - uni.showToast({ title: res.data.msg || '提交失败', icon: 'none' }); + // uni.showToast({ title: res.data.msg || '提交失败', icon: 'none' }); + uni.showModal({ + title: '提示', + content: res.data.msg|| '提交失败', + cancelText: '取消', + confirmText: '确定', + success: ress => { + if (ress.confirm) { + } + } + }); } } catch (e) { uni.hideLoading(); - uni.showToast({ title: '网络异常,请稍后重试', icon: 'none' }); + // uni.showToast({ title: '网络异常,请稍后重试', icon: 'none' }); + uni.showModal({ + title: '提示', + content: '网络异常,请稍后重试', + cancelText: '取消', + confirmText: '确定', + success: ress => { + if (ress.confirm) { + } + } + }); console.error('举报提交失败', e); } } diff --git a/pages/index/index.vue b/pages/index/index.vue index 677d597..e9efc70 100644 --- a/pages/index/index.vue +++ b/pages/index/index.vue @@ -79,6 +79,9 @@ + + + @@ -90,13 +93,15 @@ import top from "../components/top.vue"; import service from "../components/service.vue"; import selShop from "../components/selShop.vue"; + import privacyAgreement from "../../components/privacy-agreement.vue"; export default { components: { openlogin, top, service, - selShop + selShop, + privacyAgreement }, data() { return { @@ -108,8 +113,7 @@ shop: myCache('myshop'), // banner swiperList:[ - "../../static/image/b1.jpg", - "../../static/image/b2.png" + "../../static/image/b.png" ],// myCache('swiperCache'), colors:[ "#f9d1c8","#c7d7bd","#c4dfe4","#efdddd","#c4ccdf","#fceaac","#d5e7c1", @@ -200,10 +204,12 @@ }; }, onLoad() { + var shop=myCache('shop'); var banner=shop&&shop.banner?shop.banner:""; banner=banner.split(','); - if(banner.length>0){ + console.log(banner) + if(banner.length>0&&banner[0]!==''){ this.swiperList=banner; this.$forceUpdate(); } @@ -224,7 +230,7 @@ }, onShow() { //判断登录,跳转去登录 - logindo(); + // logindo(); this.shopid = myCache('myshopid')?myCache('myshopid'):null; this.shop = myCache('myshop')?myCache('myshop'):''; @@ -304,7 +310,7 @@ // 版本更新 checkupdate(); - + console.log(this.swiperList) }, onPullDownRefresh() { console.log('onPullDownRefresh'); @@ -316,6 +322,27 @@ //调用子组件方法 this.$refs.topId.topData(e.scrollTop); }, + mounted() { + uni.setStorageSync("firstLaunchFlag", false) + let firstLaunchFlag = uni.getStorageSync("firstLaunchFlag"); + // #ifdef APP-PLUS | H5 + console.log("firstLaunchFlag", firstLaunchFlag); + if (firstLaunchFlag) { + return + }else{ + uni.showLoading({ + mask: true + }); + this.$refs.privacyPop.open(); + } + // #endif + + if(firstLaunchFlag){ + if(this.userid==""||this.userid=="0"){ + this.$refs.loginId.open(); + } + } + }, methods: { getCurrentActivity() { diff --git a/pages/product/cdetail.vue b/pages/product/cdetail.vue index 92d94f1..cb1fbde 100644 --- a/pages/product/cdetail.vue +++ b/pages/product/cdetail.vue @@ -314,7 +314,7 @@ }, mounted() { if(this.userid==""||this.userid=="0"){ - this.$refs.loginId.open(); + // this.$refs.loginId.open(); } else{ this.getcollect(); diff --git a/pages/product/detail.vue b/pages/product/detail.vue index 064f95d..07ce100 100644 --- a/pages/product/detail.vue +++ b/pages/product/detail.vue @@ -266,7 +266,7 @@ import { mapState, mapGetters, mapActions } from 'vuex'; }, mounted() { if(this.userid==""||this.userid=="0"){ - this.$refs.loginId.open(); + // this.$refs.loginId.open(); } else{ this.getcollect(); diff --git a/pages/product/list.vue b/pages/product/list.vue index e5bbc15..6de3f01 100644 --- a/pages/product/list.vue +++ b/pages/product/list.vue @@ -195,7 +195,7 @@ onShow() { //判断登录,跳转去登录 - logindo(); + // logindo(); this.openId = myCache('openId'); var user = myCache('user'); diff --git a/pages/user/user.vue b/pages/user/user.vue index 5b9d194..7016634 100644 --- a/pages/user/user.vue +++ b/pages/user/user.vue @@ -325,7 +325,7 @@ }, onShow() { //判断登录,跳转去登录 - logindo(); + // logindo(); this.openId = myCache('openId'); diff --git a/static/image/b.png b/static/image/b.png new file mode 100644 index 0000000..cc3e153 Binary files /dev/null and b/static/image/b.png differ diff --git a/uni_modules/uni-popup/components/uni-popup-dialog/uni-popup-dialog.vue b/uni_modules/uni-popup/components/uni-popup-dialog/uni-popup-dialog.vue index f5731d5..2aa9118 100644 --- a/uni_modules/uni-popup/components/uni-popup-dialog/uni-popup-dialog.vue +++ b/uni_modules/uni-popup/components/uni-popup-dialog/uni-popup-dialog.vue @@ -228,8 +228,8 @@