森蓝小程序
This commit is contained in:
173
pages/mine/index.css
Normal file
173
pages/mine/index.css
Normal file
@@ -0,0 +1,173 @@
|
||||
.page {
|
||||
position: absolute;
|
||||
height: 100vh;
|
||||
width: 100vw;
|
||||
overflow: hidden;
|
||||
display: flex;
|
||||
align-items: center; /* 垂直居中 */
|
||||
background: url(https://humeng-res.oss-cn-beijing.aliyuncs.com/hm_aigc/applet/bg_%E4%B8%BB%E8%83%8C%E6%99%AF%402x.png)
|
||||
100% no-repeat;
|
||||
background-size: 100% 100%;
|
||||
}
|
||||
|
||||
.title {
|
||||
position: absolute;
|
||||
font-size: 16px;
|
||||
line-height: 22px;
|
||||
color: #454F63;
|
||||
z-index: 999;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
.section_8 {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 130rpx;
|
||||
background: #ffffff
|
||||
100% no-repeat;
|
||||
background-size: 100% 100%;
|
||||
padding: 14px 72px 4px 72px;
|
||||
bottom: 0;
|
||||
}
|
||||
|
||||
.content {
|
||||
position: relative;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.box_1 {
|
||||
position: relative;
|
||||
border-radius: 40rpx 40rpx 0 0;
|
||||
width: 85%;
|
||||
height: 240rpx;
|
||||
overflow: hidden;
|
||||
background: linear-gradient(to bottom, rgba(42, 156, 249, 0.6) 10%, rgba(42, 156, 249, 0.5) 30%, rgba(42, 156, 249, 0.4) 60%);
|
||||
display: block;
|
||||
align-items: center;
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
}
|
||||
|
||||
.head-img {
|
||||
width: 48px;
|
||||
height: 48px;
|
||||
position: relative;
|
||||
z-index: 10;
|
||||
border-radius: 50%;
|
||||
overflow: hidden;
|
||||
left: 40rpx;
|
||||
top: 50rpx;
|
||||
}
|
||||
|
||||
.nickname {
|
||||
position: absolute;
|
||||
left: 180rpx;
|
||||
top: 80rpx;
|
||||
font-size: 14px;
|
||||
font-weight: 500;
|
||||
color: #30334B;
|
||||
opacity: 1;
|
||||
font-family: 'Microsoft YaHei', Arial, sans-serif;
|
||||
}
|
||||
|
||||
.box_2 {
|
||||
position: relative;
|
||||
background-color: #ffffff;
|
||||
/* height: 530rpx; */
|
||||
width: 85%;
|
||||
border-radius: 40rpx;
|
||||
margin-top: -40rpx;
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
}
|
||||
|
||||
.orders{
|
||||
width: 90%;
|
||||
height: 100rpx;
|
||||
border-bottom: 1px solid rgba(192, 196, 202, 0.3);
|
||||
position: relative;
|
||||
left: 5%;
|
||||
}
|
||||
|
||||
.orders-name{
|
||||
text-align: left;
|
||||
line-height: 100rpx;
|
||||
font-size: 16px;
|
||||
font-weight: 300;
|
||||
color: #333333;
|
||||
opacity: 1;
|
||||
font-family: 'Microsoft YaHei', Arial, sans-serif;
|
||||
}
|
||||
|
||||
.coupons {
|
||||
width: 90%;
|
||||
height: 100rpx;
|
||||
border-bottom: 1px solid rgba(192, 196, 202, 0.3);
|
||||
position: relative;
|
||||
left: 5%;
|
||||
}
|
||||
|
||||
.coupons-name {
|
||||
text-align: left;
|
||||
line-height: 100rpx;
|
||||
font-size: 16px;
|
||||
font-weight: 300;
|
||||
color: #333333;
|
||||
opacity: 1;
|
||||
font-family: 'Microsoft YaHei', Arial, sans-serif;
|
||||
}
|
||||
|
||||
.yjfk {
|
||||
width: 90%;
|
||||
height: 100rpx;
|
||||
position: relative;
|
||||
left: 5%;
|
||||
border-bottom: 1px solid rgba(192, 196, 202, 0.3);;
|
||||
}
|
||||
|
||||
.yjfk-name {
|
||||
text-align: left;
|
||||
line-height: 100rpx;
|
||||
font-size: 16px;
|
||||
font-weight: 300;
|
||||
color: #333333;
|
||||
opacity: 1;
|
||||
font-family: 'Microsoft YaHei', Arial, sans-serif;
|
||||
}
|
||||
|
||||
.kfhh::after{
|
||||
background:none;
|
||||
border:none;
|
||||
}
|
||||
|
||||
.kfhh {
|
||||
width: 90%;
|
||||
height: 100rpx;
|
||||
position: relative;
|
||||
left: 5%;
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
background:none;
|
||||
border:none;
|
||||
}
|
||||
|
||||
.kfhh-name {
|
||||
text-align: left;
|
||||
line-height: 100rpx;
|
||||
font-size: 16px;
|
||||
font-weight: 300;
|
||||
color: #333333;
|
||||
opacity: 1;
|
||||
font-family: 'Microsoft YaHei', Arial, sans-serif;
|
||||
}
|
||||
|
||||
.coupons-icon,.yjfk-icon,.kfhh-icon,.myOrders-icon {
|
||||
position: absolute;
|
||||
right: 0px;
|
||||
width: 30rpx;
|
||||
top: 34rpx;
|
||||
height: 30rpx;
|
||||
background-image: url(https://humeng-res.oss-cn-beijing.aliyuncs.com/humeng/vlog/ly_icon_listNext%402x.png);
|
||||
background-size: 100% 100%;
|
||||
}
|
||||
181
pages/mine/mine.vue
Normal file
181
pages/mine/mine.vue
Normal file
@@ -0,0 +1,181 @@
|
||||
<template>
|
||||
<view class="page flex-col">
|
||||
<view class="title" :style="{'top': uniMenuInfo.top + 6 + 'px'}">个人中心</view>
|
||||
<view class="content" :style="{'top' : uniMenuInfo.top + 60 + 'px'}">
|
||||
<view class="box_1">
|
||||
<view>
|
||||
<image class="head-img" src="/static/center/user_img2.png"></image>
|
||||
<view class="nickname">
|
||||
<text>用户编号: {{ userNumber }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="box_2">
|
||||
<view class="orders" @tap="menuClick(1)">
|
||||
<view class="orders-name">我的写真</view>
|
||||
<view class="myOrders-icon"></view>
|
||||
</view>
|
||||
<view class="yjfk" @tap="menuClick(3)">
|
||||
<view class="yjfk-name">意见反馈</view>
|
||||
<view class="yjfk-icon"></view>
|
||||
</view>
|
||||
<button class="kfhh" open-type="contact">
|
||||
<view class="kfhh-name">联系微信客服</view>
|
||||
<view class="kfhh-icon"></view>
|
||||
</button>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="section_8 flex-row justify-between">
|
||||
<custom-tab-bar :selected="1" />
|
||||
</view>
|
||||
<!-- 隐私授权弹窗 -->
|
||||
<zero-privacy ref="privacy" @agree='handleAgree' @disagree='handleDisagree'></zero-privacy>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import CustomTabBar from "@/components/customTabBar/customTabBar.vue"
|
||||
export default {
|
||||
components: {
|
||||
CustomTabBar
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
uniMenuInfo: {},
|
||||
userNumber: '',
|
||||
userInfo: {},
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
getUserInfo() {
|
||||
var _this = this;
|
||||
uni.getUserInfo({
|
||||
desc: '用于完善会员资料',
|
||||
lang: 'zh_CN',
|
||||
success: (user) => {
|
||||
// >>当用户同意授权后, 获取到用户信息user
|
||||
uni.login({
|
||||
provider: 'weixin',
|
||||
success: loginRes => {
|
||||
let userInfo = JSON.parse(user.rawData);
|
||||
userInfo.code = loginRes.code;
|
||||
uni.getSystemInfo({
|
||||
success: function(res) {
|
||||
userInfo.model = res.model
|
||||
userInfo.edition = res.version
|
||||
uni.request({
|
||||
url: _this.java_http_url + '/applet/smart_camera/codeGetUserInfo',
|
||||
method: "POST",
|
||||
data: userInfo,
|
||||
success(res) {
|
||||
if(res.data.code == 200) {
|
||||
userInfo = res.data.data;
|
||||
_this.userInfo = userInfo;
|
||||
_this.userNumber = _this.userInfo.openId.slice(-6);
|
||||
uni.setStorageSync('userInfo', userInfo);
|
||||
}
|
||||
},
|
||||
complete() {
|
||||
uni.hideLoading();
|
||||
}
|
||||
})
|
||||
},
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
fail(err) {
|
||||
console.log(err);
|
||||
uni.hideLoading();
|
||||
}
|
||||
})
|
||||
},
|
||||
handleDisagree() {
|
||||
console.log('拒绝隐私授权');
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '拒绝授权部分功能将无法使用,是否退出小程序',
|
||||
success: function (res) {
|
||||
if (res.confirm) {
|
||||
console.log('用户点击确定');
|
||||
wx.exitMiniProgram({
|
||||
success: (res) => {
|
||||
console.log('退出小程序', res)
|
||||
}})
|
||||
} else if (res.cancel) {
|
||||
console.log('用户点击取消');
|
||||
uni.switchTab({
|
||||
url: '../home/home'
|
||||
})
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
handleAgree() {
|
||||
var _this = this;
|
||||
uni.showLoading({
|
||||
title: '正在加载...',
|
||||
mask: true
|
||||
});
|
||||
_this.getUserInfo();
|
||||
},
|
||||
getPrivacySetting() {
|
||||
var _this = this;
|
||||
wx.getPrivacySetting({
|
||||
success: res => {
|
||||
if (res.needAuthorization) {
|
||||
_this.$refs.privacy.open(res.privacyContractName);
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
menuClick(e){
|
||||
console.log(e);
|
||||
if(e == 1) {
|
||||
uni.navigateTo({
|
||||
url: '../myPhoto/myPhoto'
|
||||
})
|
||||
} else if(e ==2) {
|
||||
uni.navigateTo({
|
||||
url: '../myVideo/myVideo'
|
||||
})
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: '该功能正在完善中!',
|
||||
icon: 'none',
|
||||
duration: 2000
|
||||
})
|
||||
}
|
||||
},
|
||||
goHome() {
|
||||
uni.navigateTo({
|
||||
url: '../home/home'
|
||||
})
|
||||
}
|
||||
},
|
||||
onShow() {
|
||||
var _this = this;
|
||||
if (typeof this.$mp.page.getTabBar === 'function' && this.$mp.page.getTabBar()) {
|
||||
this.$mp.page.getTabBar().setData({
|
||||
selected: 1
|
||||
})
|
||||
}
|
||||
if(!uni.getStorageSync('userInfo')) {
|
||||
_this.getPrivacySetting();
|
||||
} else {
|
||||
_this.userInfo = uni.getStorageSync('userInfo');
|
||||
_this.userNumber = _this.userInfo.openId.slice(-6);
|
||||
}
|
||||
},
|
||||
onLoad(option) {
|
||||
var _this = this;
|
||||
_this.uniMenuInfo = uni.getStorageSync('uniMenuInfo');
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
@import '@/css/common.css';
|
||||
@import './index.css';
|
||||
</style>
|
||||
Reference in New Issue
Block a user