From bf8608f29483584bdba182ac84913d7d247dd42c Mon Sep 17 00:00:00 2001 From: lion <120344285@qq.com> Date: Tue, 2 Jul 2024 10:26:48 +0800 Subject: [PATCH] =?UTF-8?q?=E7=A7=AF=E5=88=86=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/my/score.vue | 105 +++++------------------------------ packages/myorder/myorder.vue | 39 ++++++++----- pages/home/home.vue | 5 +- 3 files changed, 44 insertions(+), 105 deletions(-) diff --git a/packages/my/score.vue b/packages/my/score.vue index c9fad09..e9f3484 100644 --- a/packages/my/score.vue +++ b/packages/my/score.vue @@ -3,36 +3,23 @@ - 1580 + {{totalScore}} - 积分规则 - + - + 积分获取 - 2024-06-27 - 09:10:10 + {{item.created_at}} - +20 - - - - - 积分获取 - - 2024-06-27 - 09:10:10 - - - - +20 + +{{item.score}} @@ -47,83 +34,21 @@ data() { return { isLoading: false, - dataList: [] + totalScore:0, + scoreLog:[] } }, onLoad() { - // this.loadOrder(1) + // this.loadOrder(1) + this.loadScore() }, - onPullDownRefresh() { - if (!this.isLoading) { - this.loadOrder(this.currentPage + 1); - } - }, - onReachBottom() { - if (!this.isLoading) { - this.loadOrder(this.currentPage + 1); - } - }, + methods: { - todetail(id) { - // uni.navigateTo({ - // url: "/pages/exhibit/detail?id=" + id - // }); - }, - loadOrder(page) { - uni.hideKeyboard() - var that = this; - that.isLoading = true; - // this.util.request({ - // api: '/api/mobile/exhibit-hall/index', - // customLoading: false, - // data: { - // page: page, - // page_size: 6, - // state: this.tablist[this.current].idx, - // sort_name: 'state', - // sort_name_tow: 'release_time', - // sort_type: "DESC", - // sort_type_tow: 'DESC' - // }, - // utilSuccess: function(r) { - // var res = r.data; - // that.isLoading = false; - // var hasNoMore = r.total < 6 && page > 1; - // console.log("hasNoMore", hasNoMore) - // if (hasNoMore || res.length == 0 && page > 1) { - // uni.stopPullDownRefresh(); // 服务器总条数 < 每页条数, 会将第一页的条数重新返回 - // // 已加载到最后一页 - // uni.showToast({ - // title: '已加载到最后一页', - // icon: 'none' - // }); - // return; - // } - // var dataList = that.dataList; - // for(var m of res){ - // m.dateRange = that.util.splitTime(m.start_time,m.over_time) - // } - - // if (page == 1) { - // dataList = res; - // } else { - // dataList.push(...res); - // } - - // that.currentPage = page; - // that.dataList = dataList; - // }, - // utilFail: function(res) { - - // if (page == 1) { - - // that.currentPage = page; - // } - - // that.util.alert(res); - // } - // }); + async loadScore(){ + const res = await this.$u.api.user() + this.totalScore = res.user.score + this.scoreLog = res.scoreLog } } } diff --git a/packages/myorder/myorder.vue b/packages/myorder/myorder.vue index 4beace4..41f937a 100644 --- a/packages/myorder/myorder.vue +++ b/packages/myorder/myorder.vue @@ -28,7 +28,7 @@ + > {{item.sku?item.sku.name:''}} @@ -45,7 +45,7 @@ 物流查询 修改 - 通知收件人 + 通知收件人 @@ -120,17 +120,30 @@ }) }, // 复制文本到剪贴板 - copyText(text) { + copyText(item,type) { + // 通知收件人 + let message = '' + if(type=='send'){ + message = `${item.contact}先生/女士,您兑换的${item.sku.name}(${item.sku.specs})将于${item.send_date} ${item.hh}开始配送,请保持电话${item.mobile}畅通。` + }else{ + message = item + } uni.setClipboardData({ - data: text, - success: function() { - console.log('复制成功'); - // 可以添加用户友好的提示,例如使用uni.showToast提示复制成功 - uni.showToast({ - title: '单号复制成功', - icon: 'none', - duration: 2000 - }); + data: message, + success: function() { + if(type=='send'){ + uni.showToast({ + title: '复制成功,快发给好友吧。', + icon: 'none', + duration: 2000 + }); + }else{ + uni.showToast({ + title: '单号复制成功', + icon: 'none', + duration: 2000 + }); + } }, fail: function(e) { uni.showToast({ @@ -222,7 +235,7 @@ .orderimg image { width: 100%; - height: auto; + height: 100%; vertical-align: middle; } diff --git a/pages/home/home.vue b/pages/home/home.vue index c25bf85..8da349e 100644 --- a/pages/home/home.vue +++ b/pages/home/home.vue @@ -121,8 +121,9 @@ // return shareInfo }, onLoad(option) { - this.getBanner() - if (isNull(this.vuex_token)) { + this.getBanner() + let token = uni.getStorageSync('xtt_lifeData')?uni.getStorageSync('xtt_lifeData').vuex_token:'' + if (isNull(token)) { this.getToken() } },