|
@@ -0,0 +1,188 @@
|
|
|
+<template>
|
|
|
+ <view class="page">
|
|
|
+ <view class="topBody">
|
|
|
+ <view class="header">
|
|
|
+ <view class="left">
|
|
|
+ <image class="img" mode="widthFix" src="../../static/home/avator.png"></image>
|
|
|
+ </view>
|
|
|
+ <view class="right">
|
|
|
+ <view class="nickname">
|
|
|
+ <text>{{myinfo.nickname}}</text>
|
|
|
+ <image src="../../static/me/icon_vip.png" mode="widthFix" />
|
|
|
+ <view class="siming">已实名</view>
|
|
|
+ </view>
|
|
|
+ <view class="join_date">
|
|
|
+ {{myinfo.join_name}}
|
|
|
+ <image src="../../static/me/arrow_right.png" mode="widthFix" />
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ <view class="dashang" @click="chkSel">
|
|
|
+ <view class="sel" v-if="sel == 1">
|
|
|
+ <view class="name">关闭<br />打赏</view>
|
|
|
+ <view class="block"></view>
|
|
|
+ </view>
|
|
|
+ <view class="selno" v-else>
|
|
|
+ <view class="blockGray"></view>
|
|
|
+ <view class="name">开启<br />打赏</view>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ <view class="myinfo">
|
|
|
+ <view class="line"></view>
|
|
|
+ <view class="numlist">
|
|
|
+ <view class="item">
|
|
|
+ <view class="num">
|
|
|
+ <text style="color:#FF2A95;">{{myinfo.num_1}}</text>
|
|
|
+ <view class="name">我的糖果</view>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ <view class="item">
|
|
|
+ <view class="num">
|
|
|
+ <text>{{myinfo.num_1}}</text>
|
|
|
+ <view class="name">我的M币</view>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ <view class="item">
|
|
|
+ <view class="num">
|
|
|
+ <image src="../../static/me/web3.0.png" mode="widthFix" />
|
|
|
+ <view class="name">WEB3.0</view>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+
|
|
|
+ </view>
|
|
|
+ <view class="numlist2" style="margin-top: 60rpx;">
|
|
|
+ <view class="item" v-for="(item,index) in 20">
|
|
|
+ <view class="num">
|
|
|
+ <image class="icon" src="../../static/me/icon_list.png" mode="widthFix" />
|
|
|
+ <view class="name">基本资料</view>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+
|
|
|
+ </view>
|
|
|
+
|
|
|
+
|
|
|
+ <view class="blankHeight"></view>
|
|
|
+ </view>
|
|
|
+
|
|
|
+
|
|
|
+ <!-- 提示框 -->
|
|
|
+ <DialogBox ref="DialogBox"></DialogBox>
|
|
|
+ </view>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+ export default {
|
|
|
+ components: {},
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ title: '',
|
|
|
+ sel: 1,
|
|
|
+ myinfo: {
|
|
|
+ nickname: '王思思',
|
|
|
+ join_name: '注册日期:2024年5月',
|
|
|
+ num_1: 0,
|
|
|
+ num_2: 0,
|
|
|
+ num_3: 0,
|
|
|
+ num_4: 0,
|
|
|
+ is_login: 'no',
|
|
|
+ num_history: 0,
|
|
|
+ num_collection: 0
|
|
|
+ },
|
|
|
+ }
|
|
|
+ },
|
|
|
+ onLoad() {
|
|
|
+ setTimeout(function() {
|
|
|
+ uni.setNavigationBarColor({
|
|
|
+ frontColor: '#ffffff',
|
|
|
+ backgroundColor: '#00000000',
|
|
|
+ animation: {
|
|
|
+ duration: 400,
|
|
|
+ timingFunc: 'easeIn'
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }, 200);
|
|
|
+ },
|
|
|
+ onShow() {
|
|
|
+ this.loadData();
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ onBack() {},
|
|
|
+ chkSel() {
|
|
|
+ if (this.sel == 1) {
|
|
|
+ this.sel = 0;
|
|
|
+ } else {
|
|
|
+ this.sel = 1;
|
|
|
+ }
|
|
|
+ },
|
|
|
+ loadData() {
|
|
|
+ console.log("this.globalData", getApp().globalData);
|
|
|
+ let obj2 = {
|
|
|
+ is_first: 0
|
|
|
+ }
|
|
|
+ const postData = Object.assign({}, getApp().globalData.postHeader, obj2);
|
|
|
+
|
|
|
+ console.log(postData);
|
|
|
+
|
|
|
+ uni.request({
|
|
|
+ url: this.$apiHost + '/Gushi/getmyinfo', //仅为示例,并非真实接口地址。
|
|
|
+ data: postData,
|
|
|
+ method: 'POST',
|
|
|
+ header: {
|
|
|
+ 'content-type': 'application/json', //自定义请求头信息
|
|
|
+ 'Access-Control-Allow-Origin': '*'
|
|
|
+ },
|
|
|
+ success: (res) => {
|
|
|
+ console.log('data:', res.data);
|
|
|
+ this.myinfo = res.data;
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ },
|
|
|
+ EditNickname() {
|
|
|
+ let that = this;
|
|
|
+ this.$refs['DialogBox'].confirm({
|
|
|
+ title: '更改昵称',
|
|
|
+ placeholder: '请输入修改的昵称',
|
|
|
+ value: that.myinfo.nickname,
|
|
|
+ DialogType: 'input',
|
|
|
+ animation: 0
|
|
|
+ }).then((res) => {
|
|
|
+ if (res.value.length < 1) {
|
|
|
+ uni.showToast({
|
|
|
+ title: "请输入有效的昵称",
|
|
|
+ icon: 'none'
|
|
|
+ });
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ that.myinfo.nickname = res.value;
|
|
|
+ let obj2 = {
|
|
|
+ nickname: res.value
|
|
|
+ }
|
|
|
+ const postData = Object.assign({}, getApp().globalData.postHeader, obj2);
|
|
|
+ uni.request({
|
|
|
+ url: that.$apiHost + '/Gushi/editinfo', //检测是否已绑定
|
|
|
+ data: postData,
|
|
|
+ method: 'POST',
|
|
|
+ header: {
|
|
|
+ 'content-type': 'application/json', //自定义请求头信息
|
|
|
+ 'Access-Control-Allow-Origin': '*'
|
|
|
+ },
|
|
|
+ success: (res) => {
|
|
|
+ uni.showToast({
|
|
|
+ title: res.data.str,
|
|
|
+ icon: 'none'
|
|
|
+ });
|
|
|
+ }
|
|
|
+ });
|
|
|
+ })
|
|
|
+ },
|
|
|
+ }
|
|
|
+ }
|
|
|
+</script>
|
|
|
+
|
|
|
+<style scoped lang="scss">
|
|
|
+ @import 'article.scss';
|
|
|
+</style>
|