first commit
This commit is contained in:
164
pages/mine/mine.js
Normal file
164
pages/mine/mine.js
Normal file
@@ -0,0 +1,164 @@
|
||||
var util = require('../../utils/util.js'); // 确保你有这样一个文件
|
||||
|
||||
|
||||
var e = getApp();
|
||||
|
||||
Component({
|
||||
data: {
|
||||
defaultDailyFreeParseNum: "--",
|
||||
totalParseNum: "--",
|
||||
userInfo: null,
|
||||
hasUserInfo: !1,
|
||||
uuid: null,
|
||||
isVip: !1,
|
||||
startTime: "--",
|
||||
endTime: "--",
|
||||
formattedEndTime: ""
|
||||
},
|
||||
methods: {
|
||||
onLoad: function() {
|
||||
wx.showShareMenu({
|
||||
withShareTicket: !0,
|
||||
menus: [ "shareAppMessage", "shareTimeline" ]
|
||||
});
|
||||
},
|
||||
onShow: function() {
|
||||
var t = this;
|
||||
e.getCurrentTabbar(3, this), e.checkUpdateVersion(), console.log("执行用户.jsonShow"),
|
||||
e.getUserInfo().then(function() {
|
||||
console.log("获取用户信息开始"), console.log(wx.getStorageSync("defaultDailyFreeParseNum")),
|
||||
t.setData({
|
||||
hasUserInfo: !0,
|
||||
uuid: wx.getStorageSync("uuid"),
|
||||
defaultDailyFreeParseNum: wx.getStorageSync("defaultDailyFreeParseNum"),
|
||||
totalParseNum: wx.getStorageSync("totalParseNum"),
|
||||
isVip: wx.getStorageSync("isMember"),
|
||||
startTime: wx.getStorageSync("startTime"),
|
||||
endTime: wx.getStorageSync("endTime")
|
||||
}), t.formatEndTime(), console.log("获取用户信息结束");
|
||||
}).catch(function(e) {
|
||||
console.error("获取用户信息失败:", e);
|
||||
}).finally(function() {
|
||||
console.log("getUserInfo调用完成");
|
||||
});
|
||||
},
|
||||
formatEndTime: function() {
|
||||
var e = this.data.endTime;
|
||||
// 将秒时间戳转换为毫秒时间戳
|
||||
var date = new Date(e * 1000);
|
||||
|
||||
// 格式化为“YYYY年MM月DD日”
|
||||
var year = date.getFullYear();
|
||||
var month = String(date.getMonth() + 1).padStart(2, "0"); // 月份从 0 开始,需要 +1
|
||||
var day = String(date.getDate()).padStart(2, "0");
|
||||
|
||||
var formattedDate = `${year}-${month}-${day}`;
|
||||
|
||||
// 更新到 data
|
||||
this.setData({
|
||||
formattedEndTime: formattedDate
|
||||
});
|
||||
|
||||
},
|
||||
getUserInfo: function(e) {},
|
||||
openvip: function(e) {
|
||||
wx.navigateTo({
|
||||
url: "../vip_recharge/vip_recharge?show=true"
|
||||
});
|
||||
},
|
||||
opennum: function(e) {
|
||||
wx.navigateTo({
|
||||
url: "../vip_recharge/vip_recharge?show=true"
|
||||
});
|
||||
},
|
||||
getTotalParseNum: function() {
|
||||
this.setData({
|
||||
defaultDailyFreeParseNum: wx.getStorageSync("defaultDailyFreeParseNum")
|
||||
});
|
||||
},
|
||||
showExchangeModal: function(t) {
|
||||
var o = this;
|
||||
wx.showLoading(), wx.showModal({
|
||||
title: "卡密兑换",
|
||||
content: "",
|
||||
editable: !0,
|
||||
placeholderText: "输入卡密",
|
||||
success: function(t) {
|
||||
t.confirm ? (console.log("用户点击确定"), e.apiRequest({
|
||||
url: "/myapp/redeem_card/",
|
||||
method: "POST",
|
||||
data: {
|
||||
openid: wx.getStorageSync("openid"),
|
||||
uuid: wx.getStorageSync("uuid"),
|
||||
card_code: t.content
|
||||
},
|
||||
success: function(t) {
|
||||
e.getUserInfo().then(function() {
|
||||
o.getTotalParseNum(), console.log(wx.getStorageSync("defaultDailyFreeParseNum"));
|
||||
}).catch(function(e) {
|
||||
console.error("An error occurred:", e);
|
||||
}), "success" == t.data.status ? wx.showToast({
|
||||
title: t.data.message,
|
||||
icon: "success",
|
||||
duration: 1e3
|
||||
}) : wx.showToast({
|
||||
title: t.data.error,
|
||||
icon: "error",
|
||||
duration: 1e3
|
||||
}), console.log("卡密兑换成功:", t.data);
|
||||
},
|
||||
fail: function(e) {
|
||||
wx.showToast({
|
||||
title: "请求网络失败",
|
||||
icon: "none",
|
||||
duration: 1e3
|
||||
}), console.error("卡密兑换失败:", e);
|
||||
}
|
||||
})) : t.cancel && (console.log("用户点击取消"), wx.hideLoading());
|
||||
}
|
||||
});
|
||||
},
|
||||
onShareAppMessage: function() {
|
||||
return {
|
||||
title: "推荐一款免费又超好用的视频文案创作工具,分享给大家一起使用",
|
||||
path: "/pages/index/index?uuid=" + wx.getStorageSync("uuid"),
|
||||
imageUrl: "/images/share.jpg",
|
||||
success: function(e) {
|
||||
wx.showToast({
|
||||
title: "分享成功",
|
||||
icon: "success",
|
||||
duration: 2e3
|
||||
});
|
||||
},
|
||||
fail: function(e) {
|
||||
wx.showToast({
|
||||
title: "分享失败",
|
||||
icon: "none",
|
||||
duration: 2e3
|
||||
});
|
||||
}
|
||||
};
|
||||
}
|
||||
},
|
||||
onShareTimeline: function() {
|
||||
return {
|
||||
title: "推荐一款免费又超好用的视频文案创作工具,分享给大家一起使用",
|
||||
path: "/pages/index/index?uuid=" + wx.getStorageSync("uuid"),
|
||||
imageUrl: "/images/share.jpg",
|
||||
success: function(e) {
|
||||
wx.showToast({
|
||||
title: "分享成功",
|
||||
icon: "success",
|
||||
duration: 2e3
|
||||
});
|
||||
},
|
||||
fail: function(e) {
|
||||
wx.showToast({
|
||||
title: "分享失败",
|
||||
icon: "none",
|
||||
duration: 2e3
|
||||
});
|
||||
}
|
||||
};
|
||||
}
|
||||
});
|
||||
8
pages/mine/mine.json
Normal file
8
pages/mine/mine.json
Normal file
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"navigationBarTitleText": "个人中心",
|
||||
"navigationBarBackgroundColor": "#222238",
|
||||
"navigationBarTextStyle": "white",
|
||||
"component": true,
|
||||
"custom-tab-bar": "/custom-tab-bar/index",
|
||||
"usingComponents": {}
|
||||
}
|
||||
70
pages/mine/mine.wxml
Normal file
70
pages/mine/mine.wxml
Normal file
@@ -0,0 +1,70 @@
|
||||
<view class="center">
|
||||
<view class="blue-top">
|
||||
<view class="user-card">
|
||||
<view class="card-top">
|
||||
<view class="user-top">
|
||||
<view class="user-vip" style="position:relative;">
|
||||
<image class="user-pic" src="/images/老师教师男人.png"></image>
|
||||
</view>
|
||||
<view class="user-board">
|
||||
<button bindgetuserinfo="getUserInfo" class="user-name" openType="getUserInfo" wx:if="{{!hasUserInfo}}">点击登陆</button>
|
||||
<view class="user-name" userSelect="true" wx:if="{{hasUserInfo}}">ID:{{uuid}}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="card-bottom">
|
||||
<view class="left">
|
||||
<view class="count">
|
||||
<text class="num">{{defaultDailyFreeParseNum}} </text>
|
||||
</view>
|
||||
<!-- <text bindtap="opennum" class="txt">创意点</text> -->
|
||||
<text class="txt">创意点</text>
|
||||
</view>
|
||||
<view class="right">
|
||||
<view class="count">
|
||||
<text class="num" style="color:rgb(253, 217, 10)" wx:if="{{isVip}}">{{formattedEndTime}}</text>
|
||||
<text class="num" bindtap="openvip" wx:else>开通会员</text>
|
||||
<!-- <text class="num" wx:else>Null</text> -->
|
||||
</view>
|
||||
<text class="txt" style="color:rgb(253, 217, 10)" wx:if="{{isVip}}">尊贵VIP</text>
|
||||
<text class="txt" wx:else>您还不是会员</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- <navigator class="center-list-item" url="/pages/vip_recharge/vip_recharge"> -->
|
||||
|
||||
<view class="center-list">
|
||||
<navigator class="center-list-item" url="/pages/vip_recharge/vip_recharge">
|
||||
<image class="icon1" src="../../images/huiyuan.png" style="width: 30px; height: 30px;"></image>
|
||||
<text class="list-text">开通会员</text>
|
||||
</navigator>
|
||||
|
||||
<navigator class="center-list-item" url="/pages/details/details">
|
||||
<image class="icon1" src="../../icons/lw.png" style="width: 30px; height: 30px;"></image>
|
||||
<text class="list-text">新人礼包</text>
|
||||
</navigator>
|
||||
<view bindtap="showExchangeModal" class="center-list-item">
|
||||
<image class="icon1" src="../../images/兑换码.png" style="width: 30px; height: 30px;"></image>
|
||||
<text class="list-text">卡密兑换</text>
|
||||
</view>
|
||||
<navigator class="center-list-item" url="/pages/invite_incentive/invite_incentive">
|
||||
<image class="icon1" src="../../images/人民币.png" style="width: 30px; height: 30px;"></image>
|
||||
<text class="list-text">分享奖励</text>
|
||||
</navigator>
|
||||
<!-- <navigator class="center-list-item" url="/pages/business_cooperation/business_cooperation">
|
||||
<image class="icon1" src="../../images/代理商.png" style="width: 30px; height: 30px;"></image>
|
||||
<text class="list-text">商业合作</text>
|
||||
</navigator> -->
|
||||
<button class="center-list-item" openType="contact">
|
||||
<image class="icon1" src="../../images/客服.png" style="width: 30px; height: 30px;"></image>
|
||||
<text class="list-text">联系客服</text>
|
||||
</button>
|
||||
<navigator class="center-list-item" url="/pages/faq/faq">
|
||||
<image class="icon1" src="../../images/帮助.png" style="width: 30px; height: 30px;"></image>
|
||||
<text class="list-text">使用教程</text>
|
||||
</navigator>
|
||||
</view>
|
||||
<view class="relief">© 2024 创作者服务</view>
|
||||
<view class="buttom" style="height: 65px;"></view>
|
||||
</view>
|
||||
248
pages/mine/mine.wxss
Normal file
248
pages/mine/mine.wxss
Normal file
@@ -0,0 +1,248 @@
|
||||
page {
|
||||
background: #f5f5f5;
|
||||
}
|
||||
|
||||
.cu-avatar {
|
||||
align-items: center;
|
||||
background-color: #ccc;
|
||||
background-position: 50%;
|
||||
background-size: cover;
|
||||
color: var(--white);
|
||||
display: inline-flex;
|
||||
font-size: 1.5em;
|
||||
font-variant: small-caps;
|
||||
height: 64rpx;
|
||||
justify-content: center;
|
||||
text-align: center;
|
||||
vertical-align: middle;
|
||||
white-space: nowrap;
|
||||
width: 64rpx;
|
||||
}
|
||||
|
||||
.cu-avatar,button {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
button {
|
||||
-webkit-tap-highlight-color: transparent;
|
||||
background-color: inherit;
|
||||
border-radius: 0;
|
||||
box-sizing: border-box;
|
||||
color: inherit;
|
||||
display: block;
|
||||
font-size: inherit;
|
||||
line-height: inherit;
|
||||
overflow: hidden;
|
||||
text-align: inherit;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
button::after {
|
||||
border: none;
|
||||
}
|
||||
|
||||
.center {
|
||||
-webkit-box-orient: vertical;
|
||||
-webkit-box-direction: normal;
|
||||
flex-direction: column;
|
||||
padding-bottom: 61px;
|
||||
}
|
||||
|
||||
.center .blue-top {
|
||||
background-color: #0b0c0c;
|
||||
border-radius: 0 0 350rpx 350rpx/0 0 30rpx 30rpx;
|
||||
height: 230rpx;
|
||||
margin-bottom: 160rpx;
|
||||
width: 750rpx;
|
||||
}
|
||||
|
||||
.center .blue-top .user-card {
|
||||
background: linear-gradient(90deg,#8d72d2,#7183f3);
|
||||
border-radius: 20rpx;
|
||||
box-sizing: border-box;
|
||||
height: 330rpx;
|
||||
left: 50%;
|
||||
position: absolute;
|
||||
transform: translate(-50%,28rpx);
|
||||
width: 686rpx;
|
||||
}
|
||||
|
||||
.center .blue-top .user-card .card-top {
|
||||
border-bottom: 1px solid #eee;
|
||||
box-sizing: border-box;
|
||||
height: 190rpx;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.center .blue-top .user-card .card-top .user-top {
|
||||
position: absolute;
|
||||
top: -26rpx;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.center .blue-top .user-card .card-top .user-top .user-vip {
|
||||
height: 130rpx;
|
||||
margin: 0 auto;
|
||||
width: 130rpx;
|
||||
}
|
||||
|
||||
.center .blue-top .user-card .card-top .user-top .user-vip .user-pic {
|
||||
background: #fff;
|
||||
border-radius: 50%;
|
||||
display: block;
|
||||
height: 130rpx;
|
||||
margin: 0 auto;
|
||||
overflow: hidden;
|
||||
width: 130rpx;
|
||||
}
|
||||
|
||||
.center .blue-top .user-card .card-top .user-top .user-board {
|
||||
-webkit-box-pack: center;
|
||||
-ms-flex-pack: center;
|
||||
display: -ms-flexbox;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
margin-top: 20rpx;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.center .blue-top .user-card .card-top .user-top .user-board .user-name {
|
||||
color: #ccc;
|
||||
font-size: 36rpx;
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
.center .blue-top .user-card .card-top .user-top .user-board .vip-icon {
|
||||
display: block;
|
||||
height: 44rpx;
|
||||
margin-left: 17rpx;
|
||||
margin-top: 2rpx;
|
||||
width: 44rpx;
|
||||
}
|
||||
|
||||
.center .blue-top .user-card .card-bottom {
|
||||
box-sizing: border-box;
|
||||
display: -ms-flexbox;
|
||||
display: flex;
|
||||
height: 140rpx;
|
||||
padding: 18rpx 0;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.center .blue-top .user-card .card-bottom .left {
|
||||
border-right: 1px solid #eee;
|
||||
}
|
||||
|
||||
.center .blue-top .user-card .card-bottom .left,.center .blue-top .user-card .card-bottom .right {
|
||||
-webkit-box-orient: vertical;
|
||||
-webkit-box-direction: normal;
|
||||
-webkit-box-pack: center;
|
||||
-ms-flex-pack: center;
|
||||
display: -ms-flexbox;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
width: 50%;
|
||||
}
|
||||
|
||||
.center .blue-top .user-card .card-bottom .count {
|
||||
color: #fff;
|
||||
font-size: 36rpx;
|
||||
font-weight: 700;
|
||||
margin-bottom: 10rpx;
|
||||
}
|
||||
|
||||
.center .blue-top .user-card .card-bottom .count .num {
|
||||
color: #fff;
|
||||
display: inline;
|
||||
}
|
||||
|
||||
.center .blue-top .user-card .card-bottom .txt {
|
||||
color: #fff;
|
||||
font-size: 24rpx;
|
||||
}
|
||||
|
||||
.center-list {
|
||||
-webkit-box-orient: vertical;
|
||||
background-color: #fff;
|
||||
border-radius: 20rpx;
|
||||
display: -ms-flexbox;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
margin: 0 auto;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.center-list,.center-list-item {
|
||||
-webkit-box-direction: normal;
|
||||
width: 686rpx;
|
||||
}
|
||||
|
||||
.center-list-item {
|
||||
-webkit-box-orient: horizontal;
|
||||
border-bottom: 1px solid;
|
||||
border-color: #eee;
|
||||
box-sizing: border-box;
|
||||
display: -webkit-box;
|
||||
display: -ms-flexbox;
|
||||
flex-direction: row;
|
||||
height: 114rpx;
|
||||
padding: 0rpx 32rpx;
|
||||
}
|
||||
|
||||
.center-list-item:last-child {
|
||||
border-bottom: 0;
|
||||
}
|
||||
|
||||
.center-list-item .icon1 {
|
||||
background-position: 50%;
|
||||
background-repeat: no-repeat;
|
||||
background-size: 50rpx 50rpx;
|
||||
color: #00c8fd;
|
||||
display: block;
|
||||
margin-right: 18rpx;
|
||||
width: 50rpx;
|
||||
}
|
||||
|
||||
.center-list-item .icon1,.list-text {
|
||||
height: 114rpx;
|
||||
line-height: 114rpx;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.list-text {
|
||||
-webkit-box-flex: 1;
|
||||
color: #1f1f1f;
|
||||
flex: 1;
|
||||
font-size: 28rpx;
|
||||
}
|
||||
|
||||
.icon2 {
|
||||
color: #8a8a8a;
|
||||
display: block;
|
||||
height: 114rpx;
|
||||
line-height: 114rpx;
|
||||
text-align: right;
|
||||
width: 40rpx;
|
||||
}
|
||||
|
||||
.relief {
|
||||
color: #999;
|
||||
font-size: 24rpx;
|
||||
padding-top: 30rpx;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.center-list-item {
|
||||
align-items: center;
|
||||
display: flex;
|
||||
justify-content: flex-start;
|
||||
}
|
||||
|
||||
.icon1 {
|
||||
height: 30px;
|
||||
margin-right: 10px;
|
||||
width: 30px;
|
||||
}
|
||||
Reference in New Issue
Block a user