修改手动绑定结构,,调整用户最新信息

This commit is contained in:
qiaomu 2024-03-29 10:02:14 +08:00
parent c9abd2cfa0
commit 567133455c
11 changed files with 64 additions and 13 deletions

View File

@ -40,5 +40,6 @@
}, },
"sitemapLocation": "sitemap.json", "sitemapLocation": "sitemap.json",
"rendererOptions": {}, "rendererOptions": {},
"navigationStyle": "custom" "navigationStyle": "custom",
"lazyCodeLoading": "requiredComponents"
} }

View File

@ -3,7 +3,7 @@
<van-field <van-field
value="{{ value }}" value="{{ value }}"
placeholder="{{'请选择' + label}}" placeholder="{{'请选择' + label}}"
border="{{ false }}" border="{{ true }}"
label="{{label}}" label="{{label}}"
custom-style="height:100rpx" custom-style="height:100rpx"
bind:input="onInput" bind:input="onInput"

View File

@ -47,6 +47,12 @@ Page({
tenementName: data.name tenementName: data.name
}) })
}, },
callPhone(e) {
const { phone } = e.currentTarget.dataset;
wx.makePhoneCall({
phoneNumber: phone,
})
},
handleSubmit() { handleSubmit() {
const { park, tenement, name, phone } = this.data; const { park, tenement, name, phone } = this.data;
if (!park) { if (!park) {

View File

@ -3,7 +3,8 @@
"topbar": "/components/topbar/index", "topbar": "/components/topbar/index",
"select": "/components/select/index", "select": "/components/select/index",
"van-button": "@vant/weapp/button/index", "van-button": "@vant/weapp/button/index",
"van-field": "@vant/weapp/field/index" "van-field": "@vant/weapp/field/index",
"van-icon": "@vant/weapp/icon/index"
}, },
"navigationBarTitleText": "手动绑定" "navigationBarTitleText": "手动绑定"
} }

View File

@ -8,7 +8,7 @@
value="{{ phone }}" value="{{ phone }}"
label="联系人手机号" label="联系人手机号"
placeholder="请输入联系人手机号" placeholder="请输入联系人手机号"
border="{{ false }}" border="{{ true }}"
bind:change="onChangePhone" bind:change="onChangePhone"
/> />
<van-field <van-field
@ -16,10 +16,18 @@
value="{{ name }}" value="{{ name }}"
label="你的昵称" label="你的昵称"
placeholder="请输入你的昵称" placeholder="请输入你的昵称"
border="{{ false }}" border="{{ true }}"
bind:change="onChangeName" bind:change="onChangeName"
/> />
<view class="submit"> <view class="submit">
<van-button type="info" block bind:click="handleSubmit"> 提交 </van-button> <van-button type="info" block bind:click="handleSubmit"> 提交 </van-button>
</view> </view>
<view class="way">
<view>
不知道预留的手机号?可联系后台管理员查询!
</view>
<view class="phone" bind:tap="callPhone" data-phone="13266911877">
<van-icon name="phone-o" class="phoneIcon" /> 13266911877
</view>
</view>
</view> </view>

View File

@ -1,5 +1,21 @@
/* pages/handleLogin/index.wxss */ /* pages/handleLogin/index.wxss */
@import "/app.wxss";
.submit { .submit {
margin-top: 40rpx; margin-top: 60rpx;
padding: 0 32rpx; padding: 0 32rpx;
} }
.way {
margin-top: 60rpx;
margin-left: 32rpx;
margin-right: 32rpx;
font-size: 34rpx;
}
.phone {
margin-top: 30rpx;
color: var(--middle-green);
display: inline-block;
}

View File

@ -20,7 +20,7 @@
} }
.park { .park {
margin-left: 30rpx; margin-left: 20rpx;
} }
.parkContent { .parkContent {
@ -124,3 +124,8 @@
border: 1rpx solid #ccc; border: 1rpx solid #ccc;
margin-right: 30rpx; margin-right: 30rpx;
} }
.moneyInput {
margin-top: 30rpx;
margin-bottom: 30rpx;
}

View File

@ -1,4 +1,4 @@
import { approveUser, getApproveList, removeUser } from "../../../../service/user" import { approveUser, getApproveList, getUserInfo, removeUser } from "../../../../service/user"
import { alertInfo, alertSuccess, wxModal } from "../../../../utils/index"; import { alertInfo, alertSuccess, wxModal } from "../../../../utils/index";
import request from "../../../../utils/request" import request from "../../../../utils/request"
@ -46,9 +46,6 @@ Component({
return; return;
} }
const newUser = wx.getStorageSync('user')
newUser.isAdmin = false;
wx.setStorageSync('user', newUser)
wx.switchTab({ wx.switchTab({
url: '/pages/home/index', url: '/pages/home/index',
}) })

View File

@ -1,5 +1,9 @@
import { alertInfo } from "../../utils/index"; import { alertInfo } from "../../utils/index";
import Dialog from '@vant/weapp/dialog/dialog'; import Dialog from '@vant/weapp/dialog/dialog';
import { getUserInfo } from "../../service/user";
import request from "../../utils/request"
const { OK } = request;
// pages/my/index.js // pages/my/index.js
Page({ Page({
@ -50,7 +54,15 @@ Page({
alertInfo("请先登录"); alertInfo("请先登录");
return false; return false;
} }
this.setData({ user }) this.init()
},
async init() {
const result = await getUserInfo();
if (result.code !== OK) {
alertInfo(result.message)
return;
}
wx.setStorageSync('user', result.data)
}, },
connect() { connect() {
Dialog.alert({ Dialog.alert({

View File

@ -2,7 +2,7 @@
"description": "项目私有配置文件。此文件中的内容将覆盖 project.config.json 中的相同字段。项目的改动优先同步到此文件中。详见文档https://developers.weixin.qq.com/miniprogram/dev/devtools/projectconfig.html", "description": "项目私有配置文件。此文件中的内容将覆盖 project.config.json 中的相同字段。项目的改动优先同步到此文件中。详见文档https://developers.weixin.qq.com/miniprogram/dev/devtools/projectconfig.html",
"projectname": "electricity_bill_calc_wx", "projectname": "electricity_bill_calc_wx",
"setting": { "setting": {
"compileHotReLoad": false, "compileHotReLoad": true,
"urlCheck": false, "urlCheck": false,
"skylineRenderEnable": true "skylineRenderEnable": true
}, },

View File

@ -45,3 +45,8 @@ export const reApprove = async function() {
export const userApply = async function(data) { export const userApply = async function(data) {
return await POST('/wx/apply', data); return await POST('/wx/apply', data);
} }
// 获取所有的园区和商户
export const getUserParksAndTenementsList = async function() {
return await GET('/wx/getUserParksAndTenementsList');
}