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

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",
"rendererOptions": {},
"navigationStyle": "custom"
"navigationStyle": "custom",
"lazyCodeLoading": "requiredComponents"
}

View File

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

View File

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

View File

@ -3,7 +3,8 @@
"topbar": "/components/topbar/index",
"select": "/components/select/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": "手动绑定"
}

View File

@ -8,7 +8,7 @@
value="{{ phone }}"
label="联系人手机号"
placeholder="请输入联系人手机号"
border="{{ false }}"
border="{{ true }}"
bind:change="onChangePhone"
/>
<van-field
@ -16,10 +16,18 @@
value="{{ name }}"
label="你的昵称"
placeholder="请输入你的昵称"
border="{{ false }}"
border="{{ true }}"
bind:change="onChangeName"
/>
<view class="submit">
<van-button type="info" block bind:click="handleSubmit"> 提交 </van-button>
</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 File

@ -1,5 +1,21 @@
/* pages/handleLogin/index.wxss */
@import "/app.wxss";
.submit {
margin-top: 40rpx;
margin-top: 60rpx;
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 {
margin-left: 30rpx;
margin-left: 20rpx;
}
.parkContent {
@ -124,3 +124,8 @@
border: 1rpx solid #ccc;
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 request from "../../../../utils/request"
@ -46,9 +46,6 @@ Component({
return;
}
const newUser = wx.getStorageSync('user')
newUser.isAdmin = false;
wx.setStorageSync('user', newUser)
wx.switchTab({
url: '/pages/home/index',
})

View File

@ -1,5 +1,9 @@
import { alertInfo } from "../../utils/index";
import Dialog from '@vant/weapp/dialog/dialog';
import { getUserInfo } from "../../service/user";
import request from "../../utils/request"
const { OK } = request;
// pages/my/index.js
Page({
@ -50,7 +54,15 @@ Page({
alertInfo("请先登录");
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() {
Dialog.alert({

View File

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

View File

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