Browse Source

个人中心

dev
jiazhipeng 7 months ago
parent
commit
6fb8ce35de
  1. 5
      package-lock.json
  2. 20
      package.json
  3. 12
      pages.json
  4. 21
      subPackages/user/changeNickname.vue
  5. 10
      subPackages/user/myAddressAdd.vue
  6. 13
      subPackages/user/myContactsAdd.vue
  7. 103
      subPackages/user/profile.vue
  8. 6
      subPackages/user/travelerList.vue

5
package-lock.json

@ -6,6 +6,11 @@
"version": "2.30.1",
"resolved": "https://registry.npmmirror.com/moment/-/moment-2.30.1.tgz",
"integrity": "sha512-uEmtNhbDOrWPFS+hdjFCBfy9f2YoyzRpwcl+DqpC6taX21FzsTLQVbMV/W7PzNSX6x/bhC1zA3c2UQ5NzH6how=="
},
"ydui-district": {
"version": "1.1.0",
"resolved": "https://registry.npmmirror.com/ydui-district/-/ydui-district-1.1.0.tgz",
"integrity": "sha512-MBhvfaR5Gkn6MUmEnrH1A7IFB5igALuDgtIF+gz3dRwNwW9+KOmih7z+xZFfGluMsEbWaT7C3lWOckYsLZQnFg=="
}
}
}

20
package.json

@ -0,0 +1,20 @@
{
"name": "changshu_wechat",
"version": "1.0.0",
"description": "",
"main": "main.js",
"dependencies": {
"moment": "^2.30.1",
"ydui-district": "^1.1.0"
},
"devDependencies": {},
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"repository": {
"type": "git",
"url": "http://123.60.98.226:3000/chenkainan/changshu_WeChat.git"
},
"author": "",
"license": "ISC"
}

12
pages.json

@ -96,6 +96,18 @@
"navigationBarTitleText": "常用信息"
}
},
{
"path": "user/myContactsAdd",
"style": {
"navigationBarTitleText": "常用联系人"
}
},
{
"path": "user/myAddressAdd",
"style": {
"navigationBarTitleText": "收货地址"
}
},
{
"path": "user/privacy",
"style": {

21
subPackages/user/changeNickname.vue

@ -1,10 +1,10 @@
<template>
<view class="bg">
<view class="nickname-box">
<span>姓名</span>
<input v-model="nickname" type="text" placeholder="请输入您的姓名" />
<!-- <span>姓名</span> -->
<input v-model="nickname" type="text" placeholder="请输入内容" />
</view>
<view class="btn" @click="save">保存修改</view>
<view class="btn" @click="save">保存</view>
</view>
</template>
@ -16,6 +16,12 @@
nickname: ""
}
},
onLoad(options) {
if (options.nickname) {
this.nickname = options.nickname
}
},
methods: {
save: function() {
if (!this.nickname) {
@ -29,7 +35,7 @@
nickname: this.nickname
}, '/api/user/profile').then(res => {
console.log(res)
if (res.code == 1) {
if (res.code == 1 || res.code==200) {
uni.showModal({
title: '提示',
content: '保存成功!',
@ -55,10 +61,11 @@
display: flex;
padding: 10rpx 30rpx;
align-items: center;
background: white;
margin-bottom: 100rpx;
/* background: white; */
margin: 60rpx 30rpx;
font-size: 30rpx;
height: 70rpx;
border-bottom: 1px solid #D8D8D8;
}
.nickname-box span {
@ -80,7 +87,7 @@
text-align: center;
width: 333rpx;
height: 80rpx;
background: linear-gradient(90deg, #9EE4FE, #7FD491);
background: #00AEA0;
border-radius: 40rpx;
color: #FFFFFF;
}

10
subPackages/user/myAddressAdd.vue

@ -27,7 +27,7 @@
<view class="list-item">
<view class="list-item-title">设为默认:</view>
<view class="list-item-switch">
<switch :checked="idDefault" @change="switchChange" color="#7FD491"/>
<switch :checked="idDefault" @change="switchChange" color="#00AEA0"/>
</view>
</view>
<view class="list-item-btn">
@ -90,7 +90,7 @@
getSeldCityList() {
let that = this
that.Post({}, '/api/areas/getAll').then(res => {
if (res.code === 1) {
if (res.code === 1 || res.code==200) {
var data = res.data;
var result = {};
for (var i = 0; i < data.length; i++) {
@ -280,7 +280,7 @@
detail_addr: this.detailAddr,
id: this.id || null
},'/api/user/' + (this.id > 0 ? 'edit' : 'add') + 'Consignee').then(res => {
if(res.code == 1){
if(res.code == 1 || res.code == 200){
uni.setStorageSync('addressNow',JSON.stringify(res.data))
uni.showModal({
title: '提示',
@ -373,11 +373,11 @@
.list-item-post {
display: flex;
color: #000;
color: white;
font-size: 36rpx;
width: 697rpx;
height: 73rpx;
background: linear-gradient(90deg, #9EE4FE, #7FD491);
background: #00AEA0;
border-radius: 37rpx;
justify-content: center;
align-items: center;

13
subPackages/user/myContactsAdd.vue

@ -6,13 +6,14 @@
<view class="list-item-input"><input type="text" v-model="username" placeholder="请输入姓名" /></view>
</view>
<view class="list-item">
<picker mode="selector" :range="idcardTypeList" range-key="title" @change="changeIdType">
<!-- <picker mode="selector" :range="idcardTypeList" range-key="title" @change="changeIdType">
<view class="list-item-title flex-center"
style="border: 1rpx solid #999999;border-radius: 7rpx;padding: 18rpx 19rpx;">{{idcardTypeValue}}
<image src="https://static.ticket.sz-trip.com/yandu/images/user/dui.png" mode=""
style="width: 40rpx;height: 40rpx;margin-left: 48rpx;"></image>
</view>
</picker>
</picker> -->
<view class="list-item-title">身份证号:</view>
<view class="list-item-input"><input type="text" v-model="idNumber" placeholder="请输入正确的证件号" /></view>
</view>
<view class="list-item">
@ -68,7 +69,7 @@
this.Post({
id: this.id
}, '/api/user/contactDetail').then(res => {
if (res.code === 1) {
if (res.code === 1 || res.code == 200) {
res = res.data
if (res && res.id > 0) {
this.username = res.name
@ -167,7 +168,7 @@
tel: this.mobile,
document_type: this.document_type
}, this.type=='edit'?'/api/user/editContact':'/api/user/addContact').then(res => {
if (res.code == 1) {
if (res.code == 1 || res.code == 200) {
uni.showModal({
title: '提示',
content: '成功',
@ -232,14 +233,14 @@
.btn {
width: 697rpx;
height: 80rpx;
background: linear-gradient(90deg, #9EE4FE, #7FD491);
background: #00AEA0;
color: white;
border-radius: 40rpx;
text-align: center;
line-height: 80rpx;
font-size: 36rpx;
font-family: PingFang SC;
font-weight: 500;
color: black;
position: absolute;
bottom: 53rpx;
left: 27rpx;

103
subPackages/user/profile.vue

@ -8,18 +8,13 @@
style="width: 80rpx;height: 80rpx;border-radius: 50%;"></image>
</view>
</div>
<navigator url="/subPackages/user/changeNickname" tag="view" class="userinfo-item">
<navigator :url="'/subPackages/user/changeNickname?nicknane='+nickname" tag="view" class="userinfo-item">
<span>姓名</span>
<view>{{nickname}}</view>
</navigator>
<view class="userinfo-item" @click="showSexSelect = true">
<span>性别</span>
<!-- <view>{{sexes[info.gender]}}</view> -->
<radio-group @change="changesex">
<label style="margin-right: 15rpx;" v-for="(item,index) in sexes" :key="index">
<radio color="#7FD491" :value="item.value" :checked="index === info.gender-1" />{{item.text}}
</label>
</radio-group>
<view @click="$refs.popup.open()">{{gender == 1 ? '' : (gender == 2 ? '' : '保密')}}</view>
</view>
<view class="userinfo-item">
<span>手机号</span>
@ -31,8 +26,20 @@
<view class="uni-input">{{birthday}}</view>
</picker>
</view>
<!-- <navigator url="/subPackages/user/logout" tag="view" class="userinfo-item">
<span>注销账号</span>
<i>注销后账号无法恢复请谨慎操作</i>
</navigator> -->
<view class="btn-tao" @click="submit">保存</view>
</view>
<!-- 性别弹框 -->
<uni-popup ref="popup" type="bottom">
<view class="popup-box">
<view class="popup-item flex-center" v-for="(item,index) in sexes" :key="index" @click="changesex(index)">{{item.text}}</view>
<view class="popup-items flex-center" @click="$refs.popup.close()">取消</view>
</view>
</uni-popup>
</view>
</template>
@ -55,6 +62,10 @@
{
value: '2',
text: '女'
},
{
value: '0',
text: '保密'
}
],
today: null,
@ -183,8 +194,9 @@
day = day > 9 ? day : '0' + day;
return `${year}/${month}/${day}`;
},
changesex(value) {
this.gender = value.detail.value
changesex(index) {
this.gender = this.sexes[index].value
this.$refs.popup.close()
},
submit() {
uni.showModal({
@ -220,7 +232,7 @@
}
</script>
<style scoped>
<style scoped lang="scss">
view {
box-sizing: content-box;
}
@ -239,11 +251,12 @@
align-items: center;
}
.info-avatar-top view:after{
font-family: "iconfont";
content: "\e62e";
font-size: 26rpx;
font-weight: bold;
content: "";
width: 20rpx;
height: 20rpx;
margin-left: 6rpx;
background-image: url('https://static.ticket.sz-trip.com/tongli/images/user/rightIcon-gray.png');
background-size: 100% 100%;
}
.info-avatar-top img {
width: 80rpx;
@ -282,9 +295,10 @@
align-items: center;
font-size: 30rpx;
border-bottom: 1rpx solid #D8D8D8;
padding: 40rpx 0;
padding: 40rpx 30rpx 40rpx 0;
height: 48rpx;
color: #333;
position: relative;
}
.info-avatar-top span {
@ -297,15 +311,29 @@
font-weight: 500;
font-size: 31rpx;
flex-shrink: 0;
color: #000;
}
.userinfo-item i {
font-weight: 500;
font-size: 24rpx;
color: #999999;
}
.userinfo-item view:after,
.birthday-box:after {
font-family: "iconfont";
content: "\e62e";
font-size: 26rpx;
font-weight: bold;
margin-left: 6rpx;
.userinfo-item {
& view::after {
content: "";
width: 20rpx;
height: 20rpx;
margin-left: 6rpx;
background-image: url('https://static.ticket.sz-trip.com/tongli/images/user/rightIcon-gray.png');
background-size: 100% 100%;
position: absolute;
right: 0;
margin: auto;
top: 0;
bottom: 0;
}
}
.birthday-box {
@ -339,7 +367,7 @@
font-size: 30rpx;
width: 697rpx;
height: 80rpx;
background: linear-gradient(90deg, #9EE4FE, #7FD491);
background: #00AEA0;
border-radius: 40rpx;
line-height: 80rpx;
color: #FFFFFF;
@ -347,4 +375,33 @@
left: 26rpx;
bottom: 100rpx;
}
.popup-box {
border-radius: 20rpx 20rpx 0rpx 0rpx;
background: #fff;
overflow: hidden;
.popup-item {
width: 697rpx;
height: 99rpx;
font-weight: 500;
font-size: 31rpx;
color: #12293C;
margin: auto;
}
.popup-item:nth-child(2) {
border: none;
border-bottom: 1rpx solid #D8D8D8;
border-top: 1rpx solid #D8D8D8;
}
.popup-items {
width: 100%;
height: 99rpx;
font-weight: 500;
font-size: 31rpx;
color: #12293C;
border-top: 13rpx solid #F2F2F2;
}
}
</style>

6
subPackages/user/travelerList.vue

@ -32,7 +32,7 @@
</view>
<view class="item-btn">
<view class="choice">
<image src="https://static.ticket.sz-trip.com/yandu/images/user/dui.png" mode="aspectFill"
<image src="https://changshu.js-dyyj.com/uploads/20250327/94abd5a9289f5bc6a31a580a1a0f358f.png" mode="aspectFill"
v-if="item.is_default==1">
</image>
<view class="yuan" v-else @click.stop="defaultC(item)">
@ -149,7 +149,7 @@
id: item.id,
is_default: 1
}, "/api/user/editContact").then(res => {
if (res.code == 1) {
if (res.code == 1 || res.code == 200) {
this.travelList.forEach(i => i.is_default = 0)
item.is_default = !item.is_default
}
@ -197,7 +197,7 @@
.active-bar{
width: 100%;
height: 11rpx;
background: #71B580;
background: #00AEA0;
}
}

Loading…
Cancel
Save