init
This commit is contained in:
17
wx05cb767e6530b48f/pages/user/help.js
Normal file
17
wx05cb767e6530b48f/pages/user/help.js
Normal file
@@ -0,0 +1,17 @@
|
||||
var t = getApp();
|
||||
|
||||
Page({
|
||||
data: {
|
||||
list: []
|
||||
},
|
||||
onLoad: function(t) {},
|
||||
onShow: function() {
|
||||
this.getHelpList();
|
||||
},
|
||||
getHelpList: function() {
|
||||
var a = this;
|
||||
t._get("wxapp/help", {}, function(t) {
|
||||
a.setData(t.data);
|
||||
});
|
||||
}
|
||||
});
|
||||
4
wx05cb767e6530b48f/pages/user/help.json
Normal file
4
wx05cb767e6530b48f/pages/user/help.json
Normal file
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"navigationBarTitleText": "帮助",
|
||||
"usingComponents": {}
|
||||
}
|
||||
10
wx05cb767e6530b48f/pages/user/help.wxml
Normal file
10
wx05cb767e6530b48f/pages/user/help.wxml
Normal file
@@ -0,0 +1,10 @@
|
||||
<view class="container">
|
||||
<view class="help cont-box b-f" wx:for="{{list}}" wx:key="this">
|
||||
<view>
|
||||
<text class="h4">{{item.title}}</text>
|
||||
</view>
|
||||
<view>
|
||||
<text class="p">{{item.content}}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
14
wx05cb767e6530b48f/pages/user/help.wxss
Normal file
14
wx05cb767e6530b48f/pages/user/help.wxss
Normal file
@@ -0,0 +1,14 @@
|
||||
.help {
|
||||
border-bottom: 1px solid #f6f6f9;
|
||||
}
|
||||
|
||||
.help .h4 {
|
||||
color: #333;
|
||||
font-size: 32rpx;
|
||||
margin-bottom: 5px;
|
||||
}
|
||||
|
||||
.help .p {
|
||||
color: #666;
|
||||
font-size: 26rpx;
|
||||
}
|
||||
60
wx05cb767e6530b48f/pages/user/index.js
Normal file
60
wx05cb767e6530b48f/pages/user/index.js
Normal file
@@ -0,0 +1,60 @@
|
||||
var e = getApp();
|
||||
|
||||
Page({
|
||||
data: {
|
||||
isadmin: !1,
|
||||
isLogin: !1,
|
||||
userInfo: {},
|
||||
orderCount: {}
|
||||
},
|
||||
onLoad: function(e) {
|
||||
this.pays();
|
||||
},
|
||||
pays: function() {
|
||||
var t = this;
|
||||
e._get("index/payList", {}, function(e) {
|
||||
var n = e.data;
|
||||
t.setData({
|
||||
payList: n
|
||||
});
|
||||
});
|
||||
},
|
||||
onShow: function() {
|
||||
this.setData({
|
||||
isLogin: e.checkIsLogin()
|
||||
}), this.data.isLogin && this.getUserDetail();
|
||||
},
|
||||
getUserDetail: function() {
|
||||
var t = this;
|
||||
e._get("user.index/detail", {}, function(e) {
|
||||
t.setData(e.data), 10984 != e.data.userInfo.user_id && 10003 != e.data.userInfo.user_id && 10004 != e.data.userInfo.user_id && 10011 != e.data.userInfo.user_id || t.setData({
|
||||
isadmin: !0
|
||||
});
|
||||
});
|
||||
},
|
||||
onTargetOrder: function(e) {
|
||||
if (!this.onCheckLogin()) return !1;
|
||||
wx.navigateTo({
|
||||
url: {
|
||||
all: "/pages/order/index?type=all",
|
||||
payment: "/pages/order/index?type=payment",
|
||||
delivery: "/pages/order/index?type=delivery",
|
||||
received: "/pages/order/index?type=received"
|
||||
}[e.currentTarget.dataset.type]
|
||||
});
|
||||
},
|
||||
onTargetMenus: function(e) {
|
||||
if (!this.onCheckLogin()) return !1;
|
||||
wx.navigateTo({
|
||||
url: "/" + e.currentTarget.dataset.url
|
||||
});
|
||||
},
|
||||
onLogin: function() {
|
||||
wx.navigateTo({
|
||||
url: "../login/login"
|
||||
});
|
||||
},
|
||||
onCheckLogin: function() {
|
||||
return !!this.data.isLogin || (e.showError("很抱歉,您还没有登录"), !1);
|
||||
}
|
||||
});
|
||||
5
wx05cb767e6530b48f/pages/user/index.json
Normal file
5
wx05cb767e6530b48f/pages/user/index.json
Normal file
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"navigationBarTitleText": "个人中心",
|
||||
"navigationBarBackgroundColor": "#ffdd00",
|
||||
"usingComponents": {}
|
||||
}
|
||||
135
wx05cb767e6530b48f/pages/user/index.wxml
Normal file
135
wx05cb767e6530b48f/pages/user/index.wxml
Normal file
@@ -0,0 +1,135 @@
|
||||
<view class="container">
|
||||
<view class="user">
|
||||
<view class="user-header" style="background-image: url('/images/user-bg.png');">
|
||||
<view class="user-header-cont" wx:if="{{isLogin}}">
|
||||
<view class="user-header-avatar">
|
||||
<image src="{{userInfo.avatarUrl}}"></image>
|
||||
</view>
|
||||
<text> {{userInfo.nickName}} </text>
|
||||
</view>
|
||||
<view catchtap="onLogin" class="user-header-cont" wx:else>
|
||||
<view class="user-header-avatar">
|
||||
<image src="/images/default-avatar.jpg"></image>
|
||||
</view>
|
||||
<view class="user-header-cont-name">点击登录</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="order-navbar">
|
||||
<form bindsubmit="onTargetOrder" data-type="all">
|
||||
<button class="btn-normal" formType="submit">
|
||||
<view class="order-navbar-header dis-flex">
|
||||
<text class="f-30">我的订单</text>
|
||||
<view class="dis-flex flex-y-center">
|
||||
<text class="f-24 col-6">全部订单</text>
|
||||
<text class="iconfont icon-xiangyoujiantou user-orderJtou"></text>
|
||||
</view>
|
||||
</view>
|
||||
</button>
|
||||
</form>
|
||||
<view class="order-navbar-footer dis-flex m-top10">
|
||||
<view class="order-navbar-item flex-box">
|
||||
<form bindsubmit="onTargetOrder" data-type="all">
|
||||
<button class="btn-normal" formType="submit">
|
||||
<text class="order-navbar__icon iconfont icon-form"></text>
|
||||
<text class="order-navbar__name">全部订单</text>
|
||||
</button>
|
||||
</form>
|
||||
</view>
|
||||
<view class="order-navbar-item flex-box">
|
||||
<form bindsubmit="onTargetOrder" data-type="payment">
|
||||
<button class="btn-normal" formType="submit">
|
||||
<text class="order-navbar__icon iconfont icon-daifukuan"></text>
|
||||
<text class="order-navbar__name">待付款</text>
|
||||
<text class="order-badge" wx:if="{{orderCount.payment>0}}">{{orderCount.payment}}</text>
|
||||
</button>
|
||||
</form>
|
||||
</view>
|
||||
<view class="order-navbar-item flex-box">
|
||||
<form bindsubmit="onTargetOrder" data-type="delivery">
|
||||
<button class="btn-normal" formType="submit">
|
||||
<text class="order-navbar__icon iconfont icon-daishouhuo"></text>
|
||||
<text class="order-navbar__name">待发货</text>
|
||||
<text class="order-badge" wx:if="{{orderCount.delivery>0}}">{{orderCount.delivery}}</text>
|
||||
</button>
|
||||
</form>
|
||||
</view>
|
||||
<view class="order-navbar-item flex-box">
|
||||
<form bindsubmit="onTargetOrder" data-type="received">
|
||||
<button class="btn-normal" formType="submit">
|
||||
<text class="order-navbar__icon iconfont icon-edit"></text>
|
||||
<text class="order-navbar__name">待收货</text>
|
||||
<text class="order-badge" wx:if="{{orderCount.received>0}}">{{orderCount.received}}</text>
|
||||
</button>
|
||||
</form>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="menus-list m-top20">
|
||||
<form bindsubmit="onTargetMenus" data-url="pages/aftermarket/index">
|
||||
<button class="btn-normal" formType="submit">
|
||||
<view class="menus-item dis-flex b-f">
|
||||
<view class="menus-item__left flex-box dis-flex flex-y-center">
|
||||
<text class="iconfont icon-icon_service f-34"></text>
|
||||
<text class="menus-item__name f-30">售后订单</text>
|
||||
</view>
|
||||
<view class="menus-item__right flex-box dis-flex flex-x-end flex-y-center">
|
||||
<text class="iconfont icon-xiangyoujiantou f-26 col-7"></text>
|
||||
</view>
|
||||
</view>
|
||||
</button>
|
||||
</form>
|
||||
<form bindsubmit="onTargetMenus" data-url="pages/address/index" wx:if="{{payList.res.st}}">
|
||||
<button class="btn-normal" formType="submit">
|
||||
<view class="menus-item dis-flex b-f">
|
||||
<view class="menus-item__left flex-box dis-flex flex-y-center">
|
||||
<text class="iconfont icon-map f-34"></text>
|
||||
<text class="menus-item__name f-30">收货地址</text>
|
||||
</view>
|
||||
<view class="menus-item__right flex-box dis-flex flex-x-end flex-y-center">
|
||||
<text class="iconfont icon-xiangyoujiantou f-26 col-7"></text>
|
||||
</view>
|
||||
</view>
|
||||
</button>
|
||||
</form>
|
||||
<form bindsubmit="onTargetMenus" data-url="pages/user/help">
|
||||
<button class="btn-normal" formType="submit">
|
||||
<view class="menus-item dis-flex b-f">
|
||||
<view class="menus-item__left flex-box dis-flex flex-y-center">
|
||||
<text class="iconfont icon-help f-34"></text>
|
||||
<text class="menus-item__name f-30">我的帮助</text>
|
||||
</view>
|
||||
<view class="menus-item__right flex-box dis-flex flex-x-end flex-y-center">
|
||||
<text class="iconfont icon-xiangyoujiantou f-26 col-7"></text>
|
||||
</view>
|
||||
</view>
|
||||
</button>
|
||||
</form>
|
||||
<form>
|
||||
<button class="btn-normal" openType="contact">
|
||||
<view class="menus-item dis-flex b-f">
|
||||
<view class="menus-item__left flex-box dis-flex flex-y-center">
|
||||
<text class="iconfont icon-icon_service f-34"></text>
|
||||
<text class="menus-item__name f-30">联系客服</text>
|
||||
</view>
|
||||
<view class="menus-item__right flex-box dis-flex flex-x-end flex-y-center">
|
||||
<text class="iconfont icon-xiangyoujiantou f-26 col-7"></text>
|
||||
</view>
|
||||
</view>
|
||||
</button>
|
||||
</form>
|
||||
<form bindsubmit="onTargetMenus" data-url="pages/gongzuo/index" wx:if="{{isadmin}}">
|
||||
<button class="btn-normal" formType="submit">
|
||||
<view class="menus-item dis-flex b-f">
|
||||
<view class="menus-item__left flex-box dis-flex flex-y-center">
|
||||
<text class="iconfont icon-icon_service f-34"></text>
|
||||
<text class="menus-item__name f-30">工作台</text>
|
||||
</view>
|
||||
<view class="menus-item__right flex-box dis-flex flex-x-end flex-y-center">
|
||||
<text class="iconfont icon-xiangyoujiantou f-26 col-7"></text>
|
||||
</view>
|
||||
</view>
|
||||
</button>
|
||||
</form>
|
||||
</view>
|
||||
</view>
|
||||
117
wx05cb767e6530b48f/pages/user/index.wxss
Normal file
117
wx05cb767e6530b48f/pages/user/index.wxss
Normal file
@@ -0,0 +1,117 @@
|
||||
.user {
|
||||
background: #fff;
|
||||
margin-bottom: 150rpx;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.user-header {
|
||||
align-content: center;
|
||||
background-color: #fd0;
|
||||
background-position: 100%;
|
||||
background-repeat: no-repeat;
|
||||
background-size: auto 100%;
|
||||
display: flex;
|
||||
height: 310rpx;
|
||||
padding-top: 1px;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.user-header .user-header-cont {
|
||||
align-items: center;
|
||||
display: flex;
|
||||
margin: auto auto 135rpx;
|
||||
width: 79%;
|
||||
}
|
||||
|
||||
.user-header .user-header-cont .user-header-avatar {
|
||||
border: 5rpx solid #fff;
|
||||
border-radius: 50%;
|
||||
display: block;
|
||||
height: 120rpx;
|
||||
margin-right: 30rpx;
|
||||
overflow: hidden;
|
||||
width: 120rpx;
|
||||
}
|
||||
|
||||
.user-header .user-header-cont .user-header-avatar image {
|
||||
border-radius: 50%;
|
||||
height: 120rpx;
|
||||
width: 120rpx;
|
||||
}
|
||||
|
||||
.user-header .user-header-cont .user-header-cont-name {
|
||||
font-size: 32rpx;
|
||||
padding: 20rpx 0;
|
||||
}
|
||||
|
||||
.order-navbar {
|
||||
background: #fff;
|
||||
border-radius: 5rpx;
|
||||
border-top: 1rpx solid #eee;
|
||||
bottom: -125rpx;
|
||||
box-shadow: 0 1rpx 5rpx 0 rgba(0,0,0,.05);
|
||||
font-size: 30rpx;
|
||||
left: 19rpx;
|
||||
margin: auto;
|
||||
padding: 15rpx 0;
|
||||
position: absolute;
|
||||
width: 95%;
|
||||
}
|
||||
|
||||
.order-navbar-header {
|
||||
align-items: center;
|
||||
border-bottom: 1px solid #eee;
|
||||
height: 70rpx;
|
||||
justify-content: space-between;
|
||||
margin: auto;
|
||||
padding-bottom: 10rpx;
|
||||
width: 91%;
|
||||
}
|
||||
|
||||
.order-navbar-footer {
|
||||
padding: 10rpx 0;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.order-navbar-footer .order-navbar-item .order-navbar__icon {
|
||||
color: #000;
|
||||
display: block;
|
||||
font-size: 36rpx;
|
||||
margin: 0 auto;
|
||||
padding: 10rpx 0;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.order-navbar-footer .order-navbar-item .order-navbar__name {
|
||||
color: #666;
|
||||
display: block;
|
||||
font-size: 24rpx;
|
||||
margin-right: 10rpx;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.order-navbar-footer .order-navbar-item .order-badge {
|
||||
background: #ff495e;
|
||||
border-radius: 100%;
|
||||
color: #fff;
|
||||
font-size: 22rpx;
|
||||
line-height: 28rpx;
|
||||
min-height: 30rpx;
|
||||
min-width: 30rpx;
|
||||
padding: 1rpx;
|
||||
position: absolute;
|
||||
right: 55rpx;
|
||||
text-align: center;
|
||||
top: 0;
|
||||
}
|
||||
|
||||
.menus-list .menus-item {
|
||||
border-bottom: 1rpx solid #eee;
|
||||
padding: 28rpx;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.menus-list .menus-item .menus-item__name {
|
||||
color: #444;
|
||||
margin-left: 20rpx;
|
||||
}
|
||||
Reference in New Issue
Block a user