This commit is contained in:
liuye
2024-07-05 09:14:53 +08:00
parent 4e07b5c13e
commit b777d3ee4d
9 changed files with 649 additions and 253 deletions

View File

@@ -1,37 +1,40 @@
<template>
<div class="AppDialogue">
<u-navbar title="Copilot小助理" title-color="#000" title-width="300" title-size="32" :title-bold="true" :background="backgroundNavbar" :is-back="false"></u-navbar>
<u-navbar title="Copilot小助理" title-color="#000" title-width="300" title-size="32" :title-bold="true" :background="backgroundNavbar" :is-back="false" height="88"></u-navbar>
<!-- <scroll-view scroll-y="true" class="scroll-Y" @scroll="scroll"> -->
<div class="service-content" v-if="!messageList.length">
<div class="text-content">
<div class="text-left">
<div>你好呀</div>
<p>我是您的<span>Copilot小助理</span></p>
<p>有什么问题都可以问我哟~</p>
</div>
<img src="https://cdn.cunwuyun.cn/wechat/biaopin/residentAssistant/service.png" alt="" class="service-img">
<div class="top-select">
{{typeList[type].dictName || '选择应用'}} <u-icon name="arrow-down" color="#fff" size="28" @click="showType=true"></u-icon>
</div>
<div class="service-content" v-if="!messageList.length">
<div class="text-content">
<div class="text-left">
<div>你好呀</div>
<p>我是您的<span>Copilot小助理</span></p>
<p>有什么问题都可以问我哟~</p>
</div>
<img src="https://cdn.cunwuyun.cn/wechat/biaopin/residentAssistant/service.png" alt="" class="service-img">
</div>
<div class="list-bg" v-if="messageList.length"></div>
<div class="list-content" v-if="messageList.length">
<div v-for="(item, index) in messageList" :key="index">
<div class="send-time">{{item.createTime.substring(5, 16)}}</div>
<div :class="item.userType == 1 ? 'item-left' : 'item-right'">
<img src="https://cdn.cunwuyun.cn/wechat/baiduAI/user-img.png" alt="" class="user-img" v-if="item.userType == 1">
<div class="item" :class="'item'+index">
<u-icon name="play-right-fill" color="#CCE2FF" size="20" v-if="item.userType != 1" class="u-icon-right"></u-icon>
<u-icon name="play-left-fill" color="#F3F5F7" size="20" v-if="item.userType == 1" class="u-icon-left"></u-icon>
<div class="voice-div" v-if="item.sdkFileUrl" @click="play(item.sdkFileUrl, index)">
<span>8</span>
<img src="https://cdn.cunwuyun.cn/wechat/baiduAI/play-d.gif" alt="" v-if="item.isPlay">
<img src="https://cdn.cunwuyun.cn/wechat/baiduAI/play-j.png" alt="" v-else>
</div>
<p v-if="!item.sdkFileUrl">{{item.content || ''}}</p>
</div>
<div class="list-bg" v-if="messageList.length"></div>
<div class="list-content" v-if="messageList.length">
<div v-for="(item, index) in messageList" :key="index">
<div class="send-time">{{item.createTime.substring(5, 16)}}</div>
<div :class="item.userType == 1 ? 'item-left' : 'item-right'">
<img src="https://cdn.cunwuyun.cn/wechat/baiduAI/user-img.png" alt="" class="user-img" v-if="item.userType == 1">
<div class="item" :class="'item'+index">
<u-icon name="play-right-fill" color="#CCE2FF" size="20" v-if="item.userType != 1" class="u-icon-right"></u-icon>
<u-icon name="play-left-fill" color="#F3F5F7" size="20" v-if="item.userType == 1" class="u-icon-left"></u-icon>
<div class="voice-div" v-if="item.sdkFileUrl" @click="play(item.sdkFileUrl, index)">
<span>8</span>
<img src="https://cdn.cunwuyun.cn/wechat/baiduAI/play-d.gif" alt="" v-if="item.isPlay">
<img src="https://cdn.cunwuyun.cn/wechat/baiduAI/play-j.png" alt="" v-else>
</div>
<img src="https://cdn.cunwuyun.cn/wechat/baiduAI/user-img.png" alt="" class="user-img" v-if="item.userType != 1">
<p v-if="!item.sdkFileUrl">{{item.content || ''}}</p>
</div>
<img src="https://cdn.cunwuyun.cn/wechat/baiduAI/user-img.png" alt="" class="user-img" v-if="item.userType != 1">
</div>
</div>
</div>
<!-- </scroll-view> -->
<div class="fixed-bottom">
<div class="type-text" v-if="type == 'text'">
@@ -59,6 +62,8 @@
<button class="login-btn" open-type="getPhoneNumber" @getphonenumber="handleAdminLogin" v-if="!token">
<img src="https://cdn.cunwuyun.cn/wechat/baiduAI/question-icon.png" alt="">登录
</button>
<u-select v-model="showType" :list="typeList" value-name="dictValue"
label-name="dictName" @confirm="confirmType"></u-select>
<AiLogin ref="login"/>
</div>
</template>
@@ -95,7 +100,13 @@ export default {
],
current: 1,
pages: 2,
areaId: ''
areaId: '',
statusBarHeight: uni.getSystemInfoSync().statusBarHeight,
typeList: [
{dictValue: '1', dictName: '文本助理'},
{dictValue: '2', dictName: '日常助理'}
],
type: ''
}
},
computed: {
@@ -292,6 +303,9 @@ export default {
})
}
},
confirmType(val) {
this.type = val[0].value;
},
},
}
</script>
@@ -305,13 +319,30 @@ page {
height: 100vh;
background-color: #fff;
position: relative;
.top-select {
line-height: 64px;
background: #026AF2;
border-radius: 32px;
position: fixed;
left: 28px;
text-align: center;
padding: 0 24px;
font-family: PingFangSC-Medium;
font-weight: 500;
font-size: 28px;
color: #FFF;
z-index: 9;
u-icon {
margin-left: 8px;
}
}
.service-content {
width: 100%;
height: 420px;
background-image: url("https://cdn.cunwuyun.cn/wechat/biaopin/residentAssistant/content-top-bg.png");
background-size: 100vw;
background-repeat: no-repeat;
padding-top: 20px;
padding-top: 84px;
box-sizing: border-box;
.text-content {
margin: 0 0 0 32px;

View File

@@ -24,12 +24,12 @@
</div>
</div>
</div>
<div class="approve">
<div class="approve" @click="$linkTo('./userInfo')">
<img class="icon" src="https://cdn.cunwuyun.cn/wxmp/mine/approve.png" alt="">
<div class="flex">
<span class="cert" v-if="isApprove" v-text="approveLabel" @click="$linkTo('/mods/AppAuth/AppAuth')"/>
<span class="cert" v-if="isApprove" v-text="approveLabel"></span>
<u-icon v-else name="arrow-right" color="#E7F2FF" size="28"
:label="approveLabel" label-color="#E7F2FF" label-pos="left" @click="approve"/>
:label="approveLabel" label-color="#E7F2FF" label-pos="left" @click="approve"/>
</div>
</div>
<div class="list-wrap">
@@ -39,11 +39,17 @@
<div class="block">
<img class="icon" :src="item.icon" alt="">
</div>
<span class="desc" v-if="!item.share">{{ item.label }}</span>
<span class="desc solid" v-if="!item.share">{{ item.label }}</span>
<button open-type="share" v-else>
<span>{{ item.label }}</span>
</button>
</div>
<!-- <div class="item" hover-class="bg-hover" @click="scan">
<div class="block">
<img class="icon" src="https://cdn.cunwuyun.cn/wxmp/mine/saoyisao.png" alt="">
</div>
<span class="desc">扫一扫</span>
</div> -->
</div>
</div>
<div class="logout" v-if="token">
@@ -59,31 +65,57 @@ export default {
name: "AppMine",
appName: "我的",
customNavigation: true,
navigationBarBackgroundColor: '#ffffff',
navigationBarTextStyle: 'black',
computed: {
...mapState(['user', 'token']),
isApprove: v => v.user?.status == 2,
isApprove() {
return this.user?.status == 2;
},
approveLabel() {
return this.user?.status == 2 ? "已认证" :
this.user?.status == 1 ? "审核中" :
this.user?.status == -1 ? "审核驳回" : "前往认证"
return this.user?.areaId? "已认证" : "前往认证"
},
listGroup() {
return [
// [
// {
// icon: "https://cdn.cunwuyun.cn/wxmp/mine/wodejiating.png",
// label: "我的家",
// path: "./myFamily",
// type: 'idNumber'
// },
// {
// icon: "https://cdn.cunwuyun.cn/wxmp/mine/wodejiaxiang.png",
// label: "我的家",
// path: "/mods/AppHometown/AppHometown",
// type: 'token'
// }
// ],
[
// {
// icon: "https://cdn.cunwuyun.cn/wxmp/mine/wodejiaxiang.png",
// label: "我的家",
// path: "/mods/AppHometown/AppHometown",
// type: 'token'
// },
// {
// icon: "https://cdn.cunwuyun.cn/wechat/biaopin/mine/mine-icon-wdjt.png",
// label: "我的家",
// path: "./myFamily",
// type: 'token'
// },
{
icon: "https://cdn.cunwuyun.cn/wechat/biaopin/mine/mine-icon-wdjf.png",
label: "我的积分",
path: "./myIntegral",
type: 'token'
},
// {
// icon: "https://cdn.cunwuyun.cn/wechat/biaopin/mine/mine-icon-wdewm.png",
// label: "我的二维码",
// path: "./myHarvestQR",
// type: 'token'
// },
// {
// icon: "https://cdn.cunwuyun.cn/wechat/biaopin/mine/mine-icon-sys.png",
// label: "扫一扫",
// path: "./myHarvestQR",
// type: 'scan'
// },
{
icon: "https://cdn.cunwuyun.cn/wechat/biaopin/mine/mine-icon-fxxcx.png",
label: "分享小程序",
path: "./myHarvestQR",
type: 'share',
share: true
},
],
// [
// {
// icon: "https://cdn.cunwuyun.cn/wxmp/mine/wodejifen.png",
@@ -114,8 +146,7 @@ export default {
this.$refs.login.show();
} else if (!this.isApprove) {
if (this.user.status == 0) {
// this.$linkTo('/mods/AppAuth/AppAuth');
this.$linkTo('./userInfo')
this.$linkTo('/mods/AppAuth/AppAuth');
} else {
this.$linkTo('/mods/AppAuth/authSuccess')
}
@@ -129,16 +160,24 @@ export default {
}
if (type == 'idNumber') {
if (this.user.status == 0) {
// if (!this.user.phone) {
// this.$linkTo('/pages/phone/bingPhoneNumber?from=auth')
// } else {
// this.$linkTo('/mods/AppAuth/AppAuth')
// }
this.$linkTo('./userInfo')
if (!this.user.phone) {
this.$linkTo('/pages/phone/bingPhoneNumber?from=auth')
} else {
this.$linkTo('/mods/AppAuth/AppAuth')
}
} else {
this.$linkTo(url)
}
}
if (type == 'scan') {
this.scan()
}
if (type == 'share') {
}
if (type == 'null') {
this.$u.toast('内容建设中...')
}
} else {
this.$refs.login.show()
}
@@ -153,7 +192,7 @@ export default {
},
getAuth() {
this.$nextTick(() => {
this.token && this.getUserInfo()
this.token && this.getUserInfo('qujing')
})
},
onLogout() {
@@ -171,13 +210,24 @@ export default {
}
})
},
scan() {
uni.scanCode({
success: (res) => {
var info = JSON.parse(res.result)
uni.navigateTo({url: `./addFamily?avatarUrl=${info.avatarUrl || ''}&nickName=${info.nickName}&openId=${info.openId}`})
}
});
}
},
onShow() {
onLoad() {
this.getAuth();
uni.$on('auth',()=> {
this.getAuth();
})
},
onShareAppMessage() {
return {
title: '欢迎使用数字巫溪治理服务一体化平台~',
title: '欢迎使用数字乡村治理服务一体化平台~',
path: `/pages/AppModules/AppModules`
}
},
@@ -200,8 +250,8 @@ export default {
.header-info {
width: 100%;
height: 100%;
background: url("https://cdn.cunwuyun.cn/wechat/wuxi/wuxi-my-nav-bg.png") no-repeat no-repeat;
background-size: 100% 100%;
background: url('https://cdn.cunwuyun.cn/wechat/biaopin/mine/mine-top-bg.png') no-repeat;
background: 100% auto;
box-sizing: border-box;
padding: 240px 0 0 48px;
@@ -273,7 +323,7 @@ export default {
.approve {
position: absolute;
left: 50%;
top: 384px;
top: 400px;
transform: translateX(-50%);
width: 686px;
height: 112px;
@@ -316,7 +366,7 @@ export default {
&:last-child {
.desc {
border-bottom: none !important;
// border-bottom: none !important;
}
}
@@ -342,7 +392,7 @@ export default {
color: #666666;
display: flex;
align-items: center;
border-bottom: 1px solid #EEEEEE;
box-sizing: border-box;
& > span {
width: 100%;
@@ -356,6 +406,11 @@ export default {
border: none;
}
}
.solid {
border-bottom: 1px solid #EEE;
}
.no-border {
border-bottom: none;
@@ -367,7 +422,6 @@ export default {
}
}
}
.logout {
width: 100%;
height: 96px;
@@ -380,7 +434,7 @@ export default {
border-radius: 16px;
font-size: 34px;
font-weight: 500;
color: #2D7DFF;
color: #4181FF;
}
}
}

View File

@@ -0,0 +1,85 @@
<template>
<div class="page">
<div class="content">
<img :src="familyInfo.avatarUrl" alt="" v-if="familyInfo.avatarUrl">
<img src="https://cdn.cunwuyun.cn/dvcp/myFamily/tx.png" alt="" v-else>
<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>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 993 B

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

View File

@@ -1,31 +1,31 @@
<template>
<div class="page">
<div class="credit-points">
<div class="bg-blue"></div>
<div class="header-content">
<div class="title">家庭地址</div>
<div class="address">
<img src="https://cdn.cunwuyun.cn/img/location-blue.svg" alt="">
<p>{{ info.resident.currentAreaName || '' }}{{ info.resident.currentAddress || '' }}</p>
<div class="user-list" v-if="list.length">
<div class="item">
<div class="item-left">
<img :src="user.avatarUrl" alt="">
<div class="user-info">
<h3>{{user.nickName}}</h3>
<p>{{user.girdName || ''}}</p>
</div>
</div>
</div>
<div class="list-content">
<div class="title">家庭成员</div>
<div class="item" v-for="(item, index) in info.family" :key="index">
<img src="https://cdn.cunwuyun.cn/dvcp/myFamily/1.png" alt="" class="banner-top" v-if="item.sex == 1">
<img src="https://cdn.cunwuyun.cn/dvcp/myFamily/2.png" alt="" class="banner-top" v-else>
<div class="user-img">
<img v-if="item.photo" :src="item.photo" alt=""/>
<img v-else src="https://cdn.cunwuyun.cn/dvcp/myFamily/tx.png" alt=""/>
</div>
<div class="item" v-for="(item, index) in list" :key="index" v-if="user.openId != item.openId">
<div class="item-left">
<img :src="item.avatarUrl" alt="" v-if="item.avatarUrl">
<img src="https://cdn.cunwuyun.cn/dvcp/myFamily/tx.png" alt="" v-else>
<div class="user-info">
<p>{{ item.name }}</p>
<div v-if="item.householdName == 1" class="color-5AAD6A">户主</div>
<div v-else>{{ $dict.getLabel('householdRelation', item.householdRelation) }}</div>
<h3>{{item.nickName}}</h3>
<p>{{item.girdName || ''}}</p>
</div>
</div>
<div class="item-right">
<div @click="toTransfer(item)">转积分</div>
</div>
</div>
</div>
<AiEmpty v-else/>
<p class="bottom-text">如果绑定错误请联系网格员解绑</p>
</div>
</template>
<script>
@@ -38,25 +38,25 @@ export default {
},
data() {
return {
info: {}
list: [],
userInfo: {}
}
},
onLoad() {
this.$dict.load('householdRelation').then(() => {
this.$nextTick(() => {
this.getUser()
})
})
this.getList()
},
methods: {
getUser() {
this.$instance.post(`/app/appresident/detailForWx?id=${this.user.residentId}`).then(res => {
if (res.code === 0) {
this.info = res.data
getList() {
this.$instance.post(`/app/appwechatuserrelation/list`).then(res => {
if (res.code === 0 && res.data) {
this.list = res.data
}
})
},
toTransfer(row) {
uni.navigateTo({url: `./transferIntrgral?openId=${row.openId}&nickName=${row.nickName}&avatarUrl=${row.avatarUrl || ''}`})
}
}
},
}
</script>
<style scoped lang="scss">
@@ -64,117 +64,70 @@ export default {
.page {
width: 100%;
height: 100vh;
background-color: #f3f6f9;
.credit-points {
.bg-blue {
width: 100%;
height: 112px;
background-color: #197DF0;
}
.header-content {
width: 690px;
background: #FFF;
border-radius: 16px;
margin: -80px 0 32px 30px;
padding: 0 30px 80px;
box-sizing: border-box;
box-shadow: 0 8px 16px 0 rgba(0, 0, 0, 0.02);
.address {
font-size: 32px;
color: #666;
overflow: hidden;
.user-list {
padding: 32px 32px 0;
height: calc(100% - 180px);
overflow-y: scroll;
.item {
padding: 26px;
background-color: #fff;
display: flex;
margin-bottom: 24px;
.item-left {
width: calc(100% - 150px);
display: flex;
img {
width: 34px;
height: 38px;
margin-right: 14px;
vertical-align: middle;
width: 108px;
height: 108px;
border-radius: 54px;
}
p {
line-height: 44px;
width: 580px;
word-break: break-all;
float: right;
.user-info {
margin-left: 20px;
h3 {
line-height: 42px;
font-family: PingFangSC-Regular;
font-weight: 400;
font-size: 32px;
color: #333;
margin-bottom: 10px;
}
p {
font-family: PingFangSC-Regular;
font-size: 24px;
color: #999;
line-height: 40px;
}
}
}
}
.title {
font-size: 32px;
font-weight: 500;
color: #333;
line-height: 120px;
}
.list-content {
width: 690px;
background: #FFF;
border-radius: 16px;
padding: 0 30px 110px;
box-sizing: border-box;
margin-left: 30px;
box-shadow: 0 8px 16px 0 rgba(0, 0, 0, 0.02);
.item {
width: 630px;
height: 192px;
background: #FFF;
box-shadow: 0 4px 10px 0 rgba(0, 0, 0, 0.08);
border-radius: 16px;
padding-left: 30px;
box-sizing: border-box;
margin-bottom: 32px;
overflow: hidden;
.banner-top {
width: 100%;
height: 72px;
}
.user-img {
width: 104px;
height: 104px;
margin: -16px 34px 0 0;
border-radius: 50%;
float: left;
img {
width: 100%;
height: 100%;
border-radius: 50%;
}
}
.user-info {
margin-top: -16px;
width: calc(100% - 138px);
float: right;
p {
font-size: 32px;
font-weight: 600;
color: #333;
line-height: 44px;
margin-bottom: 8px;
}
div {
font-size: 26px;
font-weight: 400;
color: #666;
line-height: 36px;
}
.color-5AAD6A {
color: #5AAD6A;
}
.item-right {
width: 150px;
div {
width: 126px;
height: 56px;
line-height: 56px;
text-align: center;
background: #2D7DFF;
border-radius: 30px;
font-family: PingFangSC-Regular;
font-size: 26px;
color: #FFF;
margin-top: 26px;
}
}
}
}
.bottom-text {
line-height: 34px;
font-family: PingFangSC-Regular;
font-size: 24px;
color: #999;
position: fixed;
bottom: 92px;
left: 180px;
}
}
</style>

View File

@@ -0,0 +1,125 @@
<template>
<div class="AppHarvestQR">
<div class="card">
<div class="myself">
<img class="avatar" :src="user.avatarUrl" alt="" v-if="user.avatarUrl">
<img class="avatar" src="https://cdn.cunwuyun.cn/dvcp/myFamily/tx.png" alt="" v-else>
<div class="info">
<div class="name">{{ user.nickName }}</div>
<div class="area">{{ user.areaName }}</div>
</div>
</div>
<div class="qr">
<img :src="user.qrCode" alt="">
</div>
<div class="my-qr">我的丰收码</div>
<div class="pic">
<img src="https://cdn.cunwuyun.cn/fengdu/img-zhuangshi.png" alt="">
</div>
</div>
</div>
</template>
<script>
import { mapState } from 'vuex'
export default {
name: "AppHarvestQR",
data() {
return {
qrCode: '',
}
},
methods: {
getQrCode() {
this.$instance.post('/app/appwechatuserqujing/queryMyQrCode').then(res=> {
if(res?.data) {
this.qrCode = res.data
}
})
}
},
computed: {
...mapState(['user'])
},
onLoad() {
// this.getQrCode()
uni.setNavigationBarTitle({
title: '我的丰收码'
})
}
}
</script>
<style lang="scss" scoped>
.AppHarvestQR {
padding: 32px;
box-sizing: border-box;
.card {
width: 100%;
height: 100%;
box-sizing: border-box;
border-radius: 16px;
background: #FFF;
.myself {
padding: 72px;
box-sizing: border-box;
display: flex;
justify-content: space-between;
.avatar {
width: 108px;
height: 108px;
border-radius: 16px;
}
.info {
width: calc(100% - 128px);
height: 100%;
.name {
color: #333333;
font-size: 34px;
font-weight: 500;
margin-top: 10px;
}
.area {
color: #999999;
font-size: 28px;
font-weight: 400;
margin-top: 10px;
}
}
}
.qr {
margin: 10% auto 24px;
width: 542px;
height: 542px;
border-radius: 32px;
border: 8px solid #f6f5f8;
padding: 36px;
box-sizing: border-box;
img {
width: 100%;
height: 100%;
}
}
.my-qr {
color: #999999;
font-size: 32px;
font-weight: 400;
text-align: center;
}
.pic {
margin-top: 10%;
width: 100%;
height: 234px;
img {
width: 100%;
height: 234px;
}
}
}
}
</style>

View File

@@ -0,0 +1,131 @@
<template>
<div class="page">
<div class="content">
<p class="text">积分收入方</p>
<img :src="userInfo.avatarUrl" alt="" v-if="userInfo.avatarUrl">
<img src="https://cdn.cunwuyun.cn/dvcp/myFamily/tx.png" alt="" v-else>
<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" />
<p class="num-text">剩余积分余额{{total}}</p>
<div class="btn" @click="confirm">确认转出</div>
</div>
</div>
</template>
<script>
import {mapState} from 'vuex'
export default {
appName: "我的家庭",
computed: {
...mapState(['user', 'token'])
},
data() {
return {
num: '',
total: '',
userInfo: {}
}
},
onLoad(options) {
this.userInfo = {...options}
this.getIntegral()
},
methods: {
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 (!/^(([1-9]{1}\d*)|(0{1}))(\.\d{1,2})?$/g.test(this.num)) {
this.num = ''
return this.$message.error('积分数量最多只保留两位小数点')
}
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)
}
})
}
}
}
</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;
.text {
padding-top: 96px;
line-height: 40px;
font-family: PingFangSC-Regular;
font-size: 28px;
color: #999;
margin-bottom: 26px;
}
img {
width: 176px;
height: 176px;
border-radius: 88px;
margin: 0 auto 24px auto;
}
.user-name {
margin-bottom: 100px;
line-height: 42px;
font-family: PingFangSC-Regular;
font-weight: 400;
font-size: 36px;
color: #333;
}
.input-num {
width: calc(100% - 144px);
margin: 0 0 16px 72px;
}
.num-text {
color: #222;
font-size: 28px;
font-family: PingFangSC;
font-weight: 400;
line-height: 40px;
margin-bottom: 82px;
}
.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>

View File

@@ -4,11 +4,14 @@
<div class="item-content mar-b8">
<div class="item solid">
<p class="mar-t22">头像</p>
<button class="user-img-div" v-if="editAvatarUrl" open-type="chooseAvatar" @chooseavatar="handleWeixinSync">
<!-- <button class="user-img-div" v-if="editAvatarUrl" open-type="chooseAvatar" @chooseavatar="handleWeixinSync">
<img v-if="user.avatarUrl && !avatar" :src="user.avatarUrl" class="user-img">
<img v-if="avatar" :src="avatar" alt="" class="user-img">
<img v-if="!user.avatarUrl && !avatar" src="https://cdn.cunwuyun.cn/dvcp/myFamily/tx.png" alt="" class="user-img">
</button>
</button> -->
<div class="user-img-div" v-if="editAvatarUrl">
<AiUploader v-model="avatarUrlList" multiple placeholder="上传头像" :limit="1"></AiUploader>
</div>
<div class="user-img-div" v-else>
<img v-if="user.avatarUrl && !avatar" :src="user.avatarUrl" class="user-img">
<img v-else src="https://cdn.cunwuyun.cn/dvcp/myFamily/tx.png" alt="" class="user-img">
@@ -33,8 +36,8 @@
</div>
<div class="item-content mar-b8">
<div class="item solid">
<p>姓名</p>
<!-- <div class="item solid">
<p>真实姓名</p>
<div class="item-right" v-if="!editRealName">
<p class="name">{{ user.realName || '' }}</p>
</div>
@@ -46,19 +49,15 @@
<p class="name">{{ user.idNumber || '' }}</p>
</div>
<input class="item-right" v-else type="idNumber" v-model="userIdNumber" maxlength="18" @input="idNumberInput">
</div>
</div> -->
<div class="item">
<p>地区</p>
<div class="item-right" v-if="!editArea">
<p class="name">{{ user.areaName || '' }}</p>
<p>所属网格</p>
<div class="item-right" v-if="!editGird">
<p class="name">{{ user.girdName || '' }}</p>
</div>
<AiAreaPicker class="item-right" :areaId="$areaId" v-model="userAreaId" :fullName.sync="userAreaName" v-else>
<div class="ai-area__wrapper">
<span class="label" v-if="userAreaName">{{ userAreaName }}</span>
<i v-else>请选择</i>
<u-icon name="arrow-right" color="#ddd"/>
</div>
</AiAreaPicker>
<AiPagePicker type="gird" class="item-right" v-model="userGirdId" :params="{formType:2}" @select="handleSelectGrid" nodeKey="id" v-else>
<AiMore v-model="userGirdName" />
</AiPagePicker>
</div>
</div>
@@ -91,17 +90,18 @@ export default {
editPhone: false,
editRealName: false,
editIdNumber: false,
editArea: false,
editGird: false,
avatar: '',
userName: '',
userPhone: '',
userRealName: '',
userIdNumber: '',
userAreaId: '',
userAreaName: '',
userGirdId: '',
userGirdName: '',
btnText: false,
isFromTabbar: '',
path: '',
avatarUrlList: []
}
},
methods: {
@@ -118,46 +118,53 @@ export default {
this.userRealName = this.user.realName
this.editIdNumber = true;
this.userIdNumber = this.user.idNumber
this.editArea = true
this.userAreaId = this.user.areaId
this.userAreaName = this.user.areaName
this.editGird = true
this.userGirdId = this.user.girdId
this.userGirdName = this.user.girdName
this.avatarUrlList = [{'url': this.user.avatarUrl}]
},
submit() {
if(this.flag) return
// if(!this.avatar) {
// return this.$u.toast('请上传头像')
// }
// if (!this.userName) {
// return this.$u.toast('请输入用户昵称')
// }
// if (this.userName == '微信用户') {
// return this.$u.toast('请修改用户昵称')
// }
// if (!this.userPhone) {
// return this.$u.toast('请输入手机号')
// }
if (!this.userRealName) {
return this.$u.toast('请输入姓名')
if(!this.avatarUrlList.length) {
return this.$u.toast('请上传头像')
}
if (!this.userIdNumber) {
return this.$u.toast('请输入身份证号')
if (!this.userName) {
return this.$u.toast('请输入用户昵称')
}
if (!this.$idCardNoUtil.checkIdCardNo(this.userIdNumber)) {
return this.$u.toast('请输入正确的身份证号码')
if (this.userName == '微信用户') {
return this.$u.toast('请修改用户昵称')
}
if (!this.userAreaId) {
return this.$u.toast('请选择地区')
if (!this.userPhone) {
return this.$u.toast('请输入手机号')
}
// if (!this.userRealName) {
// return this.$u.toast('请输入真实姓名')
// }
// if (!this.userIdNumber) {
// return this.$u.toast('请输入身份证号')
// }
// if (!this.$idCardNoUtil.checkIdCardNo(this.userIdNumber)) {
// return this.$u.toast('请输入正确的身份证号码')
// }
if (!this.userGirdId) {
return this.$u.toast('请选择所属网格')
}
// if (!this.userAreaId) {
// return this.$u.toast('请选择所属地区')
// }
// if (!/[^0]0{0,2}$/.test(this.userAreaId)) {
// return this.$u.toast('所属地区必须选到村级')
// }
this.flag = true
this.$instance.post(`/app/appwechatuserqujing/idNumberEdit`, {
avatarUrl: this.avatar,
this.$instance.post(`/app/appwechatuserqujing/idNumberAttestation`, {
// avatarUrl: this.avatar,
avatarUrl: this.avatarUrlList[0].url,
nickName: this.userName,
phone: this.userPhone,
name: this.userRealName,
name: this.userName,
idNumber: this.userIdNumber,
areaId: this.userAreaId,
areaName: this.userAreaName
girdId: this.userGirdId,
girdName: this.userGirdName
}).then(res=> {
if(res?.code==0) {
this.$u.toast('提交成功')
@@ -201,20 +208,20 @@ export default {
this.upLoad(avatarUrl)
}
},
handleSelectArea(v) {
this.userAreaName = v.areaName
this.userAreaId = v.id
handleSelectGrid(v) {
this.userGirdName = v.girdName
this.userGirdId = v.id
},
idNumberInput() {
if(this.userIdNumber.length == 18 && this.userRealName) {
if(!this.userAreaId) {
if(!this.userGirdId) {
this.$instance.post(`/app/appresidentapplet/queryDetailByIdNumberAndName`,{
name: this.userRealName,
idNumber: this.userIdNumber
}).then(res=> {
if(res.data && res.data.id) {
this.userAreaId = res.data.id
this.userAreaName = res.data.areaName
this.userGirdId = res.data.id
this.userGirdName = res.data.girdName
}
})
}
@@ -377,5 +384,15 @@ export default {
.btn-edit {
background: #FFF;
}
::v-deep.ai-uploader {
text-align: right;
display: inline-block;
.imgList {
width: 228px;
height: 200px;
display: inline-block!important;
}
}
}
</style>