From f301c9c0cd64a8e58e6b2c560223b7370b627aef Mon Sep 17 00:00:00 2001 From: liuye Date: Mon, 17 Jul 2023 17:06:35 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=B6=E5=BA=AD=E7=A7=AF=E5=88=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/project/fengdu/AppMine/AppMine.vue | 16 ++-- src/project/fengdu/AppMine/addFamily.vue | 84 +++++++++++++++++++ src/project/fengdu/AppMine/integralRank.vue | 20 +++-- src/project/fengdu/AppMine/myFamily.vue | 65 +++++++------- .../fengdu/AppMine/transferIntrgral.vue | 56 +++++++++---- 5 files changed, 174 insertions(+), 67 deletions(-) create mode 100644 src/project/fengdu/AppMine/addFamily.vue diff --git a/src/project/fengdu/AppMine/AppMine.vue b/src/project/fengdu/AppMine/AppMine.vue index 01193b6..d3bf43f 100644 --- a/src/project/fengdu/AppMine/AppMine.vue +++ b/src/project/fengdu/AppMine/AppMine.vue @@ -192,17 +192,11 @@ export default { }) }, scan() { - wx.scanQRCode({ - needResult: 1, // 默认为0,扫描结果由微信处理,1则直接返回扫描结果, - scanType: ['qrCode', 'barCode'], // 可以指定扫二维码还是一维码,默认二者都有 - success: (res)=> { - // var result = res.resultStr; // 当 needResult 为 1 时,扫码返回的结果 - // var resultArr = result.split(','); // 扫描结果以逗号分割数组(一维码) - // var codeContent = resultArr[resultArr.length - 1]; // 获取数组最后一个元素,也就是最终的内容 - }, - fail: (err) => { - console.log("调用wx.scanQRCode扫码失败"); - }, + uni.scanCode({ + success: (res) => { + var info = JSON.parse(res.result) + uni.navigateTo({url: `./addFamily?avatarUrl=${info.avatarUrl}&nickName=${info.nickName}&openId=${info.openId}`}) + } }); } }, diff --git a/src/project/fengdu/AppMine/addFamily.vue b/src/project/fengdu/AppMine/addFamily.vue new file mode 100644 index 0000000..d6a7670 --- /dev/null +++ b/src/project/fengdu/AppMine/addFamily.vue @@ -0,0 +1,84 @@ + + + diff --git a/src/project/fengdu/AppMine/integralRank.vue b/src/project/fengdu/AppMine/integralRank.vue index 31ad102..dc3f35e 100644 --- a/src/project/fengdu/AppMine/integralRank.vue +++ b/src/project/fengdu/AppMine/integralRank.vue @@ -19,7 +19,9 @@
{{ inx + 1 }} - +
+ +
{{ formatName(userInfo[0].name) }}
{{ userInfo[0].name }} {{ userInfo[0].integral }} @@ -207,6 +209,7 @@ export default { padding: 0 64px; box-sizing: border-box; // border: 4px solid #2d7dffff; + display: flex; .item-num { display: inline-block; @@ -218,10 +221,15 @@ export default { vertical-align: top; } - - .user-img { - margin-right: 24px; - vertical-align: middle; + .user-img-content { + display: inline-block; + width: 92px; + height: 92px; + padding: 4px; + box-sizing: border-box; + border-radius: 50%; + border: 1px solid #2D7DFF; + margin: 14px 24px 0 0; } .item-name { @@ -233,7 +241,7 @@ export default { .item-point { display: inline-block; - width: calc(100% - 420px); + width: calc(100% - 430px); text-align: right; font-size: 30px; font-family: PingFangSC-Medium, PingFang SC; diff --git a/src/project/fengdu/AppMine/myFamily.vue b/src/project/fengdu/AppMine/myFamily.vue index a64e3b5..a82dbbc 100644 --- a/src/project/fengdu/AppMine/myFamily.vue +++ b/src/project/fengdu/AppMine/myFamily.vue @@ -1,31 +1,21 @@ diff --git a/src/project/fengdu/AppMine/transferIntrgral.vue b/src/project/fengdu/AppMine/transferIntrgral.vue index 2aa6657..3d7d6a9 100644 --- a/src/project/fengdu/AppMine/transferIntrgral.vue +++ b/src/project/fengdu/AppMine/transferIntrgral.vue @@ -2,11 +2,11 @@

积分收入方

- -

代玲昌

+ +

{{userInfo.nickName}}

-

剩余积分余额:567

-
确认转出
+

剩余积分余额:{{total}}

+
确认转出
@@ -20,23 +20,45 @@ export default { }, data() { return { - num: '' + num: '', + total: '', + userInfo: {} } }, - onLoad() { - this.$dict.load('householdRelation').then(() => { - this.$nextTick(() => { - this.getUser() - }) - }) + onLoad(options) { + this.userInfo = {...options} + this.getIntegral() }, methods: { - getUser() { - // this.$instance.post(`/app/appresident/detailForWx?id=${this.user.residentId}`).then(res => { - // if (res.code === 0) { - // this.info = res.data - // } - // }) + getIntegral() { + this.$instance.post(`/app/appintegraluser/girdDetail?id=${this.user.openId}`).then(res => { + if (res.code === 0) { + this.total = res.data.integral || 0 + } + }) + }, + confirm() { + if (!/^[0-9]*[1-9][0-9]*$/g.test(this.num)) { + this.num = '' + return this.$u.toast('积分数量请输入正整数') + } + if (this.num > this.total) { + return this.$u.toast('转出积分不能大于剩余积分') + } + this.$instance.post(`/app/appintegraluser/transferIntegral`,{ + fromId: this.user.openId, + ids: [this.userInfo.openId], + integral: this.num, + integralUserType: '3', + integralCalcType: '1' + }).then(res => { + if (res.code === 0) { + this.$u.toast('积分转出成功!') + setTimeout(() => { + uni.navigateBack() + }, 600) + } + }) } } }