家庭积分
This commit is contained in:
@@ -192,17 +192,11 @@ export default {
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
scan() {
|
scan() {
|
||||||
wx.scanQRCode({
|
uni.scanCode({
|
||||||
needResult: 1, // 默认为0,扫描结果由微信处理,1则直接返回扫描结果,
|
success: (res) => {
|
||||||
scanType: ['qrCode', 'barCode'], // 可以指定扫二维码还是一维码,默认二者都有
|
var info = JSON.parse(res.result)
|
||||||
success: (res)=> {
|
uni.navigateTo({url: `./addFamily?avatarUrl=${info.avatarUrl}&nickName=${info.nickName}&openId=${info.openId}`})
|
||||||
// var result = res.resultStr; // 当 needResult 为 1 时,扫码返回的结果
|
}
|
||||||
// var resultArr = result.split(','); // 扫描结果以逗号分割数组(一维码)
|
|
||||||
// var codeContent = resultArr[resultArr.length - 1]; // 获取数组最后一个元素,也就是最终的内容
|
|
||||||
},
|
|
||||||
fail: (err) => {
|
|
||||||
console.log("调用wx.scanQRCode扫码失败");
|
|
||||||
},
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
84
src/project/fengdu/AppMine/addFamily.vue
Normal file
84
src/project/fengdu/AppMine/addFamily.vue
Normal file
@@ -0,0 +1,84 @@
|
|||||||
|
<template>
|
||||||
|
<div class="page">
|
||||||
|
<div class="content">
|
||||||
|
<img :src="familyInfo.avatarUrl" alt="">
|
||||||
|
<p class="user-name">{{familyInfo.nickName}}</p>
|
||||||
|
<div class="btn" @click="add">加为家人</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
<script>
|
||||||
|
import {mapState} from 'vuex'
|
||||||
|
|
||||||
|
export default {
|
||||||
|
appName: "加家人",
|
||||||
|
computed: {
|
||||||
|
...mapState(['user', 'token'])
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
familyInfo: {}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
onLoad(options) {
|
||||||
|
this.familyInfo = {...options}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
add() {
|
||||||
|
this.$instance.post(`/app/appwechatuserrelation/addRelation?openId=${this.familyInfo.openId}`).then(res=> {
|
||||||
|
if(res.code == 0) {
|
||||||
|
this.$u.toast('添加成功')
|
||||||
|
setTimeout(() => uni.navigateBack({}), 1500)
|
||||||
|
}
|
||||||
|
}).catch(err => {
|
||||||
|
this.$u.toast(err)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
<style scoped lang="scss">
|
||||||
|
@import "~dvcp-wui/common";
|
||||||
|
.page {
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
height: 100vh;
|
||||||
|
padding: 32px 32px 96px 32px;
|
||||||
|
box-sizing: border-box;
|
||||||
|
background-color: #f3f6f9;
|
||||||
|
.content {
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
background-color: #fff;
|
||||||
|
border-radius: 8px;
|
||||||
|
text-align: center;
|
||||||
|
img {
|
||||||
|
width: 176px;
|
||||||
|
height: 176px;
|
||||||
|
border-radius: 88px;
|
||||||
|
margin: 160px auto 24px auto;
|
||||||
|
}
|
||||||
|
.user-name {
|
||||||
|
margin-bottom: 100px;
|
||||||
|
line-height: 42px;
|
||||||
|
font-family: PingFangSC-Regular;
|
||||||
|
font-weight: 400;
|
||||||
|
font-size: 36px;
|
||||||
|
color: #333;
|
||||||
|
}
|
||||||
|
.btn {
|
||||||
|
width: 400px;
|
||||||
|
height: 80px;
|
||||||
|
text-align: center;
|
||||||
|
line-height: 80px;
|
||||||
|
background: #4181FF;
|
||||||
|
border-radius: 44px;
|
||||||
|
font-family: PingFangSC-Medium;
|
||||||
|
font-weight: 500;
|
||||||
|
font-size: 34px;
|
||||||
|
color: #FFF;
|
||||||
|
margin: 0 auto;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -19,7 +19,9 @@
|
|||||||
<div class="header-content" v-if="userInfo.length">
|
<div class="header-content" v-if="userInfo.length">
|
||||||
<div class="item">
|
<div class="item">
|
||||||
<span class="item-num">{{ inx + 1 }}</span>
|
<span class="item-num">{{ inx + 1 }}</span>
|
||||||
<image :src="userInfo[0].avatar_url" alt="" class="user-img mar-b4" v-if="userInfo[0].avatar_url" />
|
<div class="user-img-content" v-if="userInfo[0].avatar_url">
|
||||||
|
<image :src="userInfo[0].avatar_url" alt="" class="user-img mar-b4" />
|
||||||
|
</div>
|
||||||
<div class="user-name-bg mar-b4 mar-r24" v-else>{{ formatName(userInfo[0].name) }}</div>
|
<div class="user-name-bg mar-b4 mar-r24" v-else>{{ formatName(userInfo[0].name) }}</div>
|
||||||
<span class="item-name">{{ userInfo[0].name }}</span>
|
<span class="item-name">{{ userInfo[0].name }}</span>
|
||||||
<span class="item-point">{{ userInfo[0].integral }}</span>
|
<span class="item-point">{{ userInfo[0].integral }}</span>
|
||||||
@@ -207,6 +209,7 @@ export default {
|
|||||||
padding: 0 64px;
|
padding: 0 64px;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
// border: 4px solid #2d7dffff;
|
// border: 4px solid #2d7dffff;
|
||||||
|
display: flex;
|
||||||
|
|
||||||
.item-num {
|
.item-num {
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
@@ -218,10 +221,15 @@ export default {
|
|||||||
vertical-align: top;
|
vertical-align: top;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.user-img-content {
|
||||||
.user-img {
|
display: inline-block;
|
||||||
margin-right: 24px;
|
width: 92px;
|
||||||
vertical-align: middle;
|
height: 92px;
|
||||||
|
padding: 4px;
|
||||||
|
box-sizing: border-box;
|
||||||
|
border-radius: 50%;
|
||||||
|
border: 1px solid #2D7DFF;
|
||||||
|
margin: 14px 24px 0 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.item-name {
|
.item-name {
|
||||||
@@ -233,7 +241,7 @@ export default {
|
|||||||
|
|
||||||
.item-point {
|
.item-point {
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
width: calc(100% - 420px);
|
width: calc(100% - 430px);
|
||||||
text-align: right;
|
text-align: right;
|
||||||
font-size: 30px;
|
font-size: 30px;
|
||||||
font-family: PingFangSC-Medium, PingFang SC;
|
font-family: PingFangSC-Medium, PingFang SC;
|
||||||
|
|||||||
@@ -1,31 +1,21 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="page">
|
<div class="page">
|
||||||
<div class="user-list">
|
<div class="user-list" v-if="list.length">
|
||||||
<div class="item">
|
<div class="item" v-for="(item, index) in list" :key="index">
|
||||||
<div class="item-left">
|
<div class="item-left">
|
||||||
<img src="https://cdn.cunwuyun.cn/wxmp/mine/wodejiating.png" alt="">
|
<img :src="item.avatarUrl" alt="">
|
||||||
<div class="user-info">
|
<div class="user-info">
|
||||||
<h3>代玲昌</h3>
|
<h3>{{item.nickName}}</h3>
|
||||||
<p>积玉桥社区</p>
|
<p>{{item.girdName || ''}}</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="item-right">
|
<div class="item-right">
|
||||||
<div @click="toTransfer">转积分</div>
|
<div @click="toTransfer(item)">转积分</div>
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="item">
|
|
||||||
<div class="item-left">
|
|
||||||
<img src="https://cdn.cunwuyun.cn/wxmp/mine/wodejiating.png" alt="">
|
|
||||||
<div class="user-info">
|
|
||||||
<h3>代玲昌</h3>
|
|
||||||
<p>积玉桥社区</p>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="item-right">
|
|
||||||
<div>转积分</div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<AiEmpty v-else/>
|
||||||
|
<p class="bottom-text">如果绑定错误,请联系网格员解绑!</p>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
@@ -38,28 +28,24 @@ export default {
|
|||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
info: {}
|
list: []
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onLoad() {
|
onLoad() {
|
||||||
this.$dict.load('householdRelation').then(() => {
|
this.getList()
|
||||||
this.$nextTick(() => {
|
|
||||||
this.getUser()
|
|
||||||
})
|
|
||||||
})
|
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
getUser() {
|
getList() {
|
||||||
// this.$instance.post(`/app/appresident/detailForWx?id=${this.user.residentId}`).then(res => {
|
this.$instance.post(`/app/appwechatuserrelation/list`).then(res => {
|
||||||
// if (res.code === 0) {
|
if (res.code === 0 && res.data) {
|
||||||
// this.info = res.data
|
this.list = res.data
|
||||||
// }
|
}
|
||||||
// })
|
})
|
||||||
},
|
},
|
||||||
toTransfer() {
|
toTransfer(row) {
|
||||||
uni.navigateTo({url: `./transferIntrgral`})
|
uni.navigateTo({url: `./transferIntrgral?openId=${row.openId}&nickName=${row.nickName}&avatarUrl=${row.avatarUrl}`})
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
},
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
<style scoped lang="scss">
|
<style scoped lang="scss">
|
||||||
@@ -67,10 +53,13 @@ export default {
|
|||||||
|
|
||||||
.page {
|
.page {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
height: 100vh;
|
||||||
background-color: #f3f6f9;
|
background-color: #f3f6f9;
|
||||||
|
|
||||||
.user-list {
|
.user-list {
|
||||||
padding: 32px 32px 0;
|
padding: 32px 32px 0;
|
||||||
|
height: calc(100% - 180px);
|
||||||
|
overflow-y: scroll;
|
||||||
.item {
|
.item {
|
||||||
padding: 26px;
|
padding: 26px;
|
||||||
background-color: #fff;
|
background-color: #fff;
|
||||||
@@ -119,5 +108,15 @@ export default {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.bottom-text {
|
||||||
|
line-height: 34px;
|
||||||
|
font-family: PingFangSC-Regular;
|
||||||
|
font-size: 24px;
|
||||||
|
color: #999;
|
||||||
|
position: fixed;
|
||||||
|
bottom: 92px;
|
||||||
|
left: 180px;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -2,11 +2,11 @@
|
|||||||
<div class="page">
|
<div class="page">
|
||||||
<div class="content">
|
<div class="content">
|
||||||
<p class="text">积分收入方</p>
|
<p class="text">积分收入方</p>
|
||||||
<img src="https://cdn.cunwuyun.cn/wxmp/mine/wodejiating.png" alt="">
|
<img :src="userInfo.avatarUrl" alt="">
|
||||||
<p class="user-name">代玲昌</p>
|
<p class="user-name">{{userInfo.nickName}}</p>
|
||||||
<u-input v-model="num" type="number" placeholder="请输入积分数量" :maxlength="11" :border="true" input-align="center" border-color="#ddd" height="76" class="input-num" />
|
<u-input v-model="num" type="number" placeholder="请输入积分数量" :maxlength="11" :border="true" input-align="center" border-color="#ddd" height="76" class="input-num" />
|
||||||
<p class="num-text">剩余积分余额:567</p>
|
<p class="num-text">剩余积分余额:{{total}}</p>
|
||||||
<div class="btn">确认转出</div>
|
<div class="btn" @click="confirm">确认转出</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@@ -20,23 +20,45 @@ export default {
|
|||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
num: ''
|
num: '',
|
||||||
|
total: '',
|
||||||
|
userInfo: {}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onLoad() {
|
onLoad(options) {
|
||||||
this.$dict.load('householdRelation').then(() => {
|
this.userInfo = {...options}
|
||||||
this.$nextTick(() => {
|
this.getIntegral()
|
||||||
this.getUser()
|
|
||||||
})
|
|
||||||
})
|
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
getUser() {
|
getIntegral() {
|
||||||
// this.$instance.post(`/app/appresident/detailForWx?id=${this.user.residentId}`).then(res => {
|
this.$instance.post(`/app/appintegraluser/girdDetail?id=${this.user.openId}`).then(res => {
|
||||||
// if (res.code === 0) {
|
if (res.code === 0) {
|
||||||
// this.info = res.data
|
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)
|
||||||
|
}
|
||||||
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user