"jetbrains:/idea/checkout/git" did not exist on "445b55449c73a292ba6abe7a22f82811e0d121c2"
Commit 286c0ae7 authored by Junling Bu's avatar Junling Bu
Browse files

chore[renard-wx]: 基于微信开发者工具的格式化代码

parent 20b97ec8
......@@ -4,127 +4,127 @@ var user = require('../../../utils/user.js');
var app = getApp();
Page({
data: {
aboutShow: true,
userInfo: {
nickName: '点击登录',
avatarUrl: 'http://yanxuan.nosdn.127.net/8945ae63d940cc42406c3f67019c5cb6.png'
}
},
onLoad: function(options) {
},
onReady: function() {
data: {
aboutShow: true,
userInfo: {
nickName: '点击登录',
avatarUrl: 'http://yanxuan.nosdn.127.net/8945ae63d940cc42406c3f67019c5cb6.png'
}
},
onLoad: function(options) {
},
onShow: function() {
},
onReady: function() {
//获取用户的登录信息
if (app.globalData.hasLogin) {
let userInfo = wx.getStorageSync('userInfo');
this.setData({
aboutShow: true,
userInfo: userInfo,
});
}
},
onShow: function() {
},
onHide: function() {
// 页面隐藏
//获取用户的登录信息
if (app.globalData.hasLogin) {
let userInfo = wx.getStorageSync('userInfo');
this.setData({
aboutShow: true,
userInfo: userInfo,
});
}
},
onUnload: function() {
// 页面关闭
},
goLogin() {
if (!app.globalData.hasLogin) {
wx.navigateTo({
url: "/pages/auth/login/login"
});
}
},
goOrder() {
if (app.globalData.hasLogin) {
wx.navigateTo({
url: "/pages/ucenter/order/order"
});
} else {
wx.navigateTo({
url: "/pages/auth/login/login"
});
}
},
goCoupon() {
if (app.globalData.hasLogin) {
wx.navigateTo({
url: "/pages/ucenter/coupon/coupon"
});
} else {
wx.navigateTo({
url: "/pages/auth/login/login"
});
};
},
onHide: function() {
// 页面隐藏
},
goGroupon() {
if (app.globalData.hasLogin) {
wx.navigateTo({
url: "/pages/groupon/myGroupon/myGroupon"
});
} else {
wx.navigateTo({
url: "/pages/auth/login/login"
});
};
},
goCollect() {
if (app.globalData.hasLogin) {
wx.navigateTo({
url: "/pages/ucenter/collect/collect"
});
} else {
wx.navigateTo({
url: "/pages/auth/login/login"
});
};
},
goFootprint() {
if (app.globalData.hasLogin) {
wx.navigateTo({
url: "/pages/ucenter/footprint/footprint"
});
} else {
wx.navigateTo({
url: "/pages/auth/login/login"
});
};
},
goAddress() {
if (app.globalData.hasLogin) {
wx.navigateTo({
url: "/pages/ucenter/address/address"
});
} else {
wx.navigateTo({
url: "/pages/auth/login/login"
});
};
},
exitLogin: function() {
wx.showModal({
title: '',
confirmColor: '#b4282d',
content: '退出登录?',
success: function(res) {
if (res.confirm) {
wx.removeStorageSync('token');
wx.removeStorageSync('userInfo');
wx.switchTab({
url: '/pages/index/index'
});
},
onUnload: function() {
// 页面关闭
},
goLogin() {
if (!app.globalData.hasLogin) {
wx.navigateTo({
url: "/pages/auth/login/login"
});
}
}
})
},
goOrder() {
if (app.globalData.hasLogin) {
wx.navigateTo({
url: "/pages/ucenter/order/order"
});
} else {
wx.navigateTo({
url: "/pages/auth/login/login"
});
}
},
goCoupon() {
if (app.globalData.hasLogin) {
wx.navigateTo({
url: "/pages/ucenter/coupon/coupon"
});
} else {
wx.navigateTo({
url: "/pages/auth/login/login"
});
};
},
goGroupon() {
if (app.globalData.hasLogin) {
wx.navigateTo({
url: "/pages/groupon/myGroupon/myGroupon"
});
} else {
wx.navigateTo({
url: "/pages/auth/login/login"
});
};
},
goCollect() {
if (app.globalData.hasLogin) {
wx.navigateTo({
url: "/pages/ucenter/collect/collect"
});
} else {
wx.navigateTo({
url: "/pages/auth/login/login"
});
};
},
goFootprint() {
if (app.globalData.hasLogin) {
wx.navigateTo({
url: "/pages/ucenter/footprint/footprint"
});
} else {
wx.navigateTo({
url: "/pages/auth/login/login"
});
};
},
goAddress() {
if (app.globalData.hasLogin) {
wx.navigateTo({
url: "/pages/ucenter/address/address"
});
} else {
wx.navigateTo({
url: "/pages/auth/login/login"
});
};
},
exitLogin: function() {
wx.showModal({
title: '',
confirmColor: '#b4282d',
content: '退出登录?',
success: function(res) {
if (res.confirm) {
wx.removeStorageSync('token');
wx.removeStorageSync('userInfo');
wx.switchTab({
url: '/pages/index/index'
});
}
}
})
}
}
})
\ No newline at end of file
<view class="container">
<view class="my-info">
<view class="profile-info" bindtap="goLogin">
<image class="avatar" src="{{userInfo.avatarUrl}}" />
<view class="my-info-name">{{userInfo.nickName}}
<text></text>
</view>
<view class="my-info">
<view class="profile-info" bindtap="goLogin">
<image class="avatar" src="{{userInfo.avatarUrl}}" />
<view class="my-info-name">{{userInfo.nickName}}
<text></text>
</view>
</view>
<view class="my-info-order">
<view class="list-icon" bindtap="goOrder" data-index="0">
<view class="{{tabClass[0]}}"></view>
<image src="../../../images/my-icon-1.png" />
<text>我的订单</text>
</view>
<view class="list-icon" bindtap="goGroupon" data-index="1">
<view class="{{tabClass[1]}}"></view>
<image src="../../../images/my-icon-2.png" />
<text>我的团购</text>
</view>
<view class="list-icon" bindtap="goCollect" data-index="2">
<view class="{{tabClass[2]}}"></view>
<image src="../../../images/my-icon-3.png" />
<text>我的收藏</text>
</view>
<view class="list-icon" bindtap="goAddress" data-index="3">
<view class="{{tabClass[3]}}"></view>
<image src="../../../images/my-icon-4.png" />
<text>收货地址</text>
</view>
</view>
</view>
<view class="my-info-order">
<view class="list-icon" bindtap="goOrder" data-index="0">
<view class="{{tabClass[0]}}"></view>
<image src="../../../images/my-icon-1.png" />
<text>我的订单</text>
</view>
<view class="list-icon" bindtap="goGroupon" data-index="1">
<view class="{{tabClass[1]}}"></view>
<image src="../../../images/my-icon-2.png" />
<text>我的团购</text>
</view>
<view class="list-icon" bindtap="goCollect" data-index="2">
<view class="{{tabClass[2]}}"></view>
<image src="../../../images/my-icon-3.png" />
<text>我的收藏</text>
</view>
<view class="list-icon" bindtap="goAddress" data-index="3">
<view class="{{tabClass[3]}}"></view>
<image src="../../../images/my-icon-4.png" />
<text>收货地址</text>
</view>
<view class="my-item-list">
<view class="my-item">
<navigator url="/pages/select-address/index" hover-class="none">快递费说明</navigator>
<image src="../../../images/right-icon.png" />
</view>
<view class="my-item">
<navigator url="/pages/select-address/index" hover-class="none">团购说明</navigator>
<image src="../../../images/right-icon.png" />
</view>
</view>
</view>
<view class="my-item-list">
<view class="my-item">
<navigator url="/pages/select-address/index" hover-class="none">快递费说明</navigator>
<image src="../../../images/right-icon.png" />
</view>
<view class="my-item">
<navigator url="/pages/select-address/index" hover-class="none">团购说明</navigator>
<image src="../../../images/right-icon.png" />
</view>
</view>
</view>
\ No newline at end of file
.my-info{
width:100%;
text-align:center;
border-bottom:20rpx solid #f5f5f5;
padding-bottom:30rpx;
}
.my-info .avatar{
width:176rpx;
height:176rpx;
border-radius:50%;
}
.my-info .my-info-name{
color:#293539;
font-size:76rrpx;
margin-top:10rpx;
.my-info {
width: 100%;
text-align: center;
border-bottom: 20rpx solid #f5f5f5;
padding-bottom: 30rpx;
}
.my-info .avatar {
width: 176rpx;
height: 176rpx;
border-radius: 50%;
}
.my-info .my-info-name {
color: #293539;
font-size: 76rrpx;
margin-top: 10rpx;
position: relative;
}
.my-info .my-info-name text{
width:10rpx;
height:10rpx;
position:absolute;
border:4rpx solid #a78845;
border-radius:50%;
margin-left:10rpx;
}
.my-info-order{
width:95%;
text-align:center;
margin:0 auto;
margin-top:60rpx;
}
.my-info-order .list-icon{
.my-info .my-info-name text {
width: 10rpx;
height: 10rpx;
position: absolute;
border: 4rpx solid #a78845;
border-radius: 50%;
margin-left: 10rpx;
}
.my-info-order {
width: 95%;
text-align: center;
margin: 0 auto;
margin-top: 60rpx;
}
.my-info-order .list-icon {
display: inline-block;
width: 25%;
position: relative;
}
.my-info-order .list-icon .red-dot{
width:18rpx;
height:18rpx;
border-radius:50%;
position:absolute;
right:30rpx;
.my-info-order .list-icon .red-dot {
width: 18rpx;
height: 18rpx;
border-radius: 50%;
position: absolute;
right: 30rpx;
background-color: #ff3f3e;
}
.my-info-order .list-icon text{
display:block;
font-size:22rpx;
color:#293539;
}
.my-info-order .list-icon image{
width:56rpx;
height:56rpx;
}
.my-item-list .my-item{
width:100%;
height:120rpx;
border-bottom:2rpx dashed #f5f5f5;
line-height:120rpx;
font-size:32rpx;
color:#293539;
position:relative;
font-weight:300;
}
.my-item-list .my-item text{
width:10rpx;
height:10rpx;
position:absolute;
border:2rpx solid #a78845;
border-radius:50%;
left:30rpx;
bottom:50rpx;
}
.my-item-list .my-item navigator{
display:inline-block;
margin-left:70rpx;
width:90%;
}
.my-item-list .my-item .about{
display:inline-block;
margin-left:70rpx;
width:90%;
}
.my-item-list .my-item image{
width:40rpx;
height:40rpx;
float:right;
margin-top:40rpx;
margin-right:30rpx;
position:absolute;
right:0;
}
.show-pop{
.my-info-order .list-icon text {
display: block;
font-size: 22rpx;
color: #293539;
}
.my-info-order .list-icon image {
width: 56rpx;
height: 56rpx;
}
.my-item-list .my-item {
width: 100%;
height: 120rpx;
border-bottom: 2rpx dashed #f5f5f5;
line-height: 120rpx;
font-size: 32rpx;
color: #293539;
position: relative;
font-weight: 300;
}
.my-item-list .my-item text {
width: 10rpx;
height: 10rpx;
position: absolute;
border: 2rpx solid #a78845;
border-radius: 50%;
left: 30rpx;
bottom: 50rpx;
}
.my-item-list .my-item navigator {
display: inline-block;
margin-left: 70rpx;
width: 90%;
}
.my-item-list .my-item .about {
display: inline-block;
margin-left: 70rpx;
width: 90%;
}
.my-item-list .my-item image {
width: 40rpx;
height: 40rpx;
float: right;
margin-top: 40rpx;
margin-right: 30rpx;
position: absolute;
right: 0;
}
.show-pop {
width: 100%;
height: 100%;
position: fixed;
top: 0;
left: 0;
background-color: rgba(255,255,255,.8);
}
.show-pop .show-pop-box{
width:55%;
margin:0 auto;
margin-top:30%;
background-color:#fff;
border-radius:10rpx;
text-align:center;
position:relative;
padding-bottom:40rpx;
padding-top:60rpx;
padding-left:30rpx;
padding-right:30rpx;
background-color: rgba(255, 255, 255, 0.8);
}
.show-pop .show-pop-box {
width: 55%;
margin: 0 auto;
margin-top: 30%;
background-color: #fff;
border-radius: 10rpx;
text-align: center;
position: relative;
padding-bottom: 40rpx;
padding-top: 60rpx;
padding-left: 30rpx;
padding-right: 30rpx;
box-shadow: 0rpx 4rpx 30rpx #eee;
}
.show-pop-box .close{
width:70rpx;
height:70rpx;
.show-pop-box .close {
width: 70rpx;
height: 70rpx;
position: absolute;
right: 0;
top: 0;
}
.show-pop .show-pop-box .show-pop-title{
color:#a78845;
font-size:36rpx;
font-weight:300;
.show-pop .show-pop-box .show-pop-title {
color: #a78845;
font-size: 36rpx;
font-weight: 300;
position: relative;
}
.show-pop .show-pop-box .show-pop-title .r{
width:10rpx;
height:10rpx;
position:absolute;
border:1px solid #a78845;
border-radius:50%;
margin-left:20rpx;
margin-top:20rpx;
}
.show-pop .show-pop-box .show-pop-title .l{
width:10rpx;
height:10rpx;
position:absolute;
border:2rpx solid #a78845;
border-radius:50%;
margin-left:-30rpx;
margin-top:20rpx;
}
.show-pop .show-pop-box .show-pop-text{
margin-top:20rpx;
color:#293539;
font-size:30rpx;
line-height:56rpx;
font-weight:300;
}
\ No newline at end of file
.show-pop .show-pop-box .show-pop-title .r {
width: 10rpx;
height: 10rpx;
position: absolute;
border: 1px solid #a78845;
border-radius: 50%;
margin-left: 20rpx;
margin-top: 20rpx;
}
.show-pop .show-pop-box .show-pop-title .l {
width: 10rpx;
height: 10rpx;
position: absolute;
border: 2rpx solid #a78845;
border-radius: 50%;
margin-left: -30rpx;
margin-top: 20rpx;
}
.show-pop .show-pop-box .show-pop-text {
margin-top: 20rpx;
color: #293539;
font-size: 30rpx;
line-height: 56rpx;
font-weight: 300;
}
......@@ -2,60 +2,60 @@ var util = require('../../../utils/util.js');
var api = require('../../../config/api.js');
Page({
data: {
orderList: [],
showType: 0
},
onLoad: function(options) {
// 页面初始化 options为页面跳转所带来的参数
},
data: {
orderList: [],
showType: 0
},
onLoad: function(options) {
// 页面初始化 options为页面跳转所带来的参数
},
onPullDownRefresh() {
// wx.showNavigationBarLoading() //在标题栏中显示加载
this.getOrderList();
// wx.hideNavigationBarLoading() //完成停止加载
wx.stopPullDownRefresh() //停止下拉刷新
},
onPullDownRefresh() {
// wx.showNavigationBarLoading() //在标题栏中显示加载
this.getOrderList();
// wx.hideNavigationBarLoading() //完成停止加载
wx.stopPullDownRefresh() //停止下拉刷新
},
getOrderList() {
wx.showLoading({
title: '加载中',
});
getOrderList() {
wx.showLoading({
title: '加载中',
});
setTimeout(function() {
wx.hideLoading()
}, 2000);
setTimeout(function() {
wx.hideLoading()
}, 2000);
let that = this;
util.request(api.OrderList, {
showType: that.data.showType
}).then(function(res) {
if (res.errno === 0) {
that.setData({
orderList: res.data.data
let that = this;
util.request(api.OrderList, {
showType: that.data.showType
}).then(function(res) {
if (res.errno === 0) {
that.setData({
orderList: res.data.data
});
wx.hideLoading();
}
});
},
switchTab: function(event) {
let showType = event.currentTarget.dataset.index;
this.setData({
showType: showType
});
wx.hideLoading();
}
});
},
switchTab: function(event) {
let showType = event.currentTarget.dataset.index;
this.setData({
showType: showType
});
this.getOrderList();
},
onReady: function() {
// 页面渲染完成
},
onShow: function() {
// 页面显示
this.getOrderList();
},
onHide: function() {
// 页面隐藏
},
onUnload: function() {
// 页面关闭
}
this.getOrderList();
},
onReady: function() {
// 页面渲染完成
},
onShow: function() {
// 页面显示
this.getOrderList();
},
onHide: function() {
// 页面隐藏
},
onUnload: function() {
// 页面关闭
}
})
\ No newline at end of file
{
"navigationBarTitleText": "我的订单",
"usingComponents": {
"zan-capsule": "/components/capsule/index"
}
"navigationBarTitleText": "我的订单",
"usingComponents": {
"zan-capsule": "/components/capsule/index"
}
}
\ No newline at end of file
<view class="container">
<view class="orders-switch">
<view class="item {{ showType == 0 ? 'active' : ''}}" bindtap="switchTab" data-index='0'>
<view class="txt">全部</view>
</view>
<view class="item {{ showType == 1 ? 'active' : ''}}" bindtap="switchTab" data-index='1'>
<view class="txt">待付款</view>
</view>
<view class="item {{ showType == 2 ? 'active' : ''}}" bindtap="switchTab" data-index='2'>
<view class="txt">待发货</view>
</view>
<view class="item {{ showType == 3 ? 'active' : ''}}" bindtap="switchTab" data-index='3'>
<view class="txt">待收货</view>
</view>
<view class="item {{ showType == 4 ? 'active' : ''}}" bindtap="switchTab" data-index='4'>
<view class="txt">待评价</view>
</view>
</view>
<view class="no-order" wx:if="{{orderList.length <= 0}}">
<view class="c">
<image src="http://nos.netease.com/mailpub/hxm/yanxuan-wap/p/20150730/style/img/icon-normal/noCart-a8fe3f12e5.png" />
<text>还没有任何订单呢</text>
</view>
</view>
<view class="orders">
<navigator url="../orderDetail/orderDetail?id={{item.id}}" class="order" open-type="navigate" wx:for="{{orderList}}" wx:key="id">
<view class="h">
<view class="l">订单编号:{{item.orderSn}}</view>
<view class="r">{{item.orderStatusText}}</view>
</view>
<view class="goods" wx:for="{{item.goodsList}}" wx:key="id" wx:for-item="gitem">
<view class="img">
<image src="{{gitem.picUrl}}"></image>
<view class="orders-switch">
<view class="item {{ showType == 0 ? 'active' : ''}}" bindtap="switchTab" data-index='0'>
<view class="txt">全部</view>
</view>
<view class="info">
<text class="name">{{gitem.goodsName}}</text>
<text class="number">共{{gitem.number}}件商品</text>
<view class="item {{ showType == 1 ? 'active' : ''}}" bindtap="switchTab" data-index='1'>
<view class="txt">待付款</view>
</view>
<view class="status"></view>
</view>
<view class="b">
<view class="l">实付:¥{{item.actualPrice}}</view>
<view class="capsule-tag">
<zan-capsule color="#a78845" leftText="" rightText="团购" wx:if="{{item.isGroupin}}" />
<view class="item {{ showType == 2 ? 'active' : ''}}" bindtap="switchTab" data-index='2'>
<view class="txt">待发货</view>
</view>
</view>
</navigator>
</view>
<view class="item {{ showType == 3 ? 'active' : ''}}" bindtap="switchTab" data-index='3'>
<view class="txt">待收货</view>
</view>
<view class="item {{ showType == 4 ? 'active' : ''}}" bindtap="switchTab" data-index='4'>
<view class="txt">待评价</view>
</view>
</view>
<view class="no-order" wx:if="{{orderList.length <= 0}}">
<view class="c">
<image src="http://nos.netease.com/mailpub/hxm/yanxuan-wap/p/20150730/style/img/icon-normal/noCart-a8fe3f12e5.png" />
<text>还没有任何订单呢</text>
</view>
</view>
<view class="orders">
<navigator url="../orderDetail/orderDetail?id={{item.id}}" class="order" open-type="navigate" wx:for="{{orderList}}" wx:key="id">
<view class="h">
<view class="l">订单编号:{{item.orderSn}}</view>
<view class="r">{{item.orderStatusText}}</view>
</view>
<view class="goods" wx:for="{{item.goodsList}}" wx:key="id" wx:for-item="gitem">
<view class="img">
<image src="{{gitem.picUrl}}"></image>
</view>
<view class="info">
<text class="name">{{gitem.goodsName}}</text>
<text class="number">共{{gitem.number}}件商品</text>
</view>
<view class="status"></view>
</view>
<view class="b">
<view class="l">实付:¥{{item.actualPrice}}</view>
<view class="capsule-tag">
<zan-capsule color="#a78845" leftText="" rightText="团购" wx:if="{{item.isGroupin}}" />
</view>
</view>
</navigator>
</view>
</view>
\ No newline at end of file
page {
height: 100%;
width: 100%;
background: #f4f4f4;
height: 100%;
width: 100%;
background: #f4f4f4;
}
.capsule-tag {
float: right;
/* padding-right: 10rpx; */
float: right;
/* padding-right: 10rpx; */
}
.zan-capsule + .zan-capsule {
margin-left: 5px;
margin-left: 5px;
}
.orders-switch {
width: 100%;
background: #fff;
height: 84rpx;
border-bottom: 1px solid #a78845;
width: 100%;
background: #fff;
height: 84rpx;
border-bottom: 1px solid #a78845;
}
.orders-switch .item {
display: inline-block;
height: 82rpx;
width: 18%;
padding: 0 15rpx;
text-align: center;
display: inline-block;
height: 82rpx;
width: 18%;
padding: 0 15rpx;
text-align: center;
}
.orders-switch .item .txt {
display: inline-block;
height: 82rpx;
padding: 0 20rpx;
line-height: 82rpx;
color: #333;
font-size: 30rpx;
width: 170rpx;
display: inline-block;
height: 82rpx;
padding: 0 20rpx;
line-height: 82rpx;
color: #333;
font-size: 30rpx;
width: 170rpx;
}
.orders-switch .item.active .txt {
color: #a78845;
border-bottom: 4rpx solid #a78845;
color: #a78845;
border-bottom: 4rpx solid #a78845;
}
.no-order {
width: 100%;
height: auto;
margin: 0 auto;
width: 100%;
height: auto;
margin: 0 auto;
}
.no-order .c {
width: 100%;
height: auto;
margin-top: 200rpx;
width: 100%;
height: auto;
margin-top: 200rpx;
}
.no-order .c image {
margin: 0 auto;
display: block;
text-align: center;
width: 258rpx;
height: 258rpx;
margin: 0 auto;
display: block;
text-align: center;
width: 258rpx;
height: 258rpx;
}
.no-order .c text {
margin: 0 auto;
display: block;
width: 258rpx;
height: 29rpx;
line-height: 29rpx;
text-align: center;
font-size: 29rpx;
color: #999;
margin: 0 auto;
display: block;
width: 258rpx;
height: 29rpx;
line-height: 29rpx;
text-align: center;
font-size: 29rpx;
color: #999;
}
.orders {
height: auto;
width: 100%;
overflow: hidden;
height: auto;
width: 100%;
overflow: hidden;
}
.order {
margin-top: 20rpx;
background: #fff;
margin-top: 20rpx;
background: #fff;
}
.order .h {
height: 83.3rpx;
line-height: 83.3rpx;
margin-left: 31.25rpx;
padding-right: 31.25rpx;
border-bottom: 1px solid #f4f4f4;
font-size: 30rpx;
color: #333;
height: 83.3rpx;
line-height: 83.3rpx;
margin-left: 31.25rpx;
padding-right: 31.25rpx;
border-bottom: 1px solid #f4f4f4;
font-size: 30rpx;
color: #333;
}
.order .h .l {
float: left;
float: left;
}
.order .h .r {
float: right;
color: #a78845;
font-size: 24rpx;
float: right;
color: #a78845;
font-size: 24rpx;
}
.order .goods {
display: flex;
align-items: center;
height: 199rpx;
margin-left: 31.25rpx;
display: flex;
align-items: center;
height: 199rpx;
margin-left: 31.25rpx;
}
.order .goods .img {
height: 145.83rpx;
width: 145.83rpx;
background: #f4f4f4;
height: 145.83rpx;
width: 145.83rpx;
background: #f4f4f4;
}
.order .goods .img image {
height: 145.83rpx;
width: 145.83rpx;
height: 145.83rpx;
width: 145.83rpx;
}
.order .goods .info {
height: 145.83rpx;
flex: 1;
padding-left: 20rpx;
height: 145.83rpx;
flex: 1;
padding-left: 20rpx;
}
.order .goods .name {
margin-top: 30rpx;
display: block;
height: 44rpx;
line-height: 44rpx;
color: #333;
font-size: 30rpx;
margin-top: 30rpx;
display: block;
height: 44rpx;
line-height: 44rpx;
color: #333;
font-size: 30rpx;
}
.order .goods .number {
display: block;
height: 37rpx;
line-height: 37rpx;
color: #666;
font-size: 25rpx;
display: block;
height: 37rpx;
line-height: 37rpx;
color: #666;
font-size: 25rpx;
}
.order .goods .status {
width: 105rpx;
color: #a78845;
font-size: 25rpx;
width: 105rpx;
color: #a78845;
font-size: 25rpx;
}
.order .b {
height: 103rpx;
line-height: 103rpx;
margin-left: 31.25rpx;
padding-right: 31.25rpx;
border-top: 1px solid #f4f4f4;
font-size: 30rpx;
color: #333;
height: 103rpx;
line-height: 103rpx;
margin-left: 31.25rpx;
padding-right: 31.25rpx;
border-top: 1px solid #f4f4f4;
font-size: 30rpx;
color: #333;
}
.order .b .l {
float: left;
float: left;
}
.order .b .r {
float: right;
float: right;
}
.order .b .btn {
margin-top: 19rpx;
height: 64.5rpx;
line-height: 64.5rpx;
text-align: center;
padding: 0 20rpx;
border-radius: 5rpx;
font-size: 28rpx;
color: #fff;
background: #a78845;
margin-top: 19rpx;
height: 64.5rpx;
line-height: 64.5rpx;
text-align: center;
padding: 0 20rpx;
border-radius: 5rpx;
font-size: 28rpx;
color: #fff;
background: #a78845;
}
......@@ -2,207 +2,207 @@ var util = require('../../../utils/util.js');
var api = require('../../../config/api.js');
Page({
data: {
orderId: 0,
orderInfo: {},
orderGoods: [],
expressInfo: {},
flag: false,
handleOption: {}
},
onLoad: function(options) {
// 页面初始化 options为页面跳转所带来的参数
this.setData({
orderId: options.id
});
this.getOrderDetail();
},
data: {
orderId: 0,
orderInfo: {},
orderGoods: [],
expressInfo: {},
flag: false,
handleOption: {}
},
onLoad: function(options) {
// 页面初始化 options为页面跳转所带来的参数
this.setData({
orderId: options.id
});
this.getOrderDetail();
},
onPullDownRefresh() {
// wx.showNavigationBarLoading() //在标题栏中显示加载
this.getOrderDetail();
// wx.hideNavigationBarLoading() //完成停止加载
wx.stopPullDownRefresh() //停止下拉刷新
},
onPullDownRefresh() {
// wx.showNavigationBarLoading() //在标题栏中显示加载
this.getOrderDetail();
// wx.hideNavigationBarLoading() //完成停止加载
wx.stopPullDownRefresh() //停止下拉刷新
},
expandDetail: function() {
let that = this;
this.setData({
flag: !that.data.flag
})
},
expandDetail: function() {
let that = this;
this.setData({
flag: !that.data.flag
})
},
getOrderDetail: function() {
wx.showLoading({
title: '加载中',
});
getOrderDetail: function() {
wx.showLoading({
title: '加载中',
});
setTimeout(function() {
wx.hideLoading()
}, 2000);
setTimeout(function() {
wx.hideLoading()
}, 2000);
let that = this;
util.request(api.OrderDetail, {
orderId: that.data.orderId
}).then(function(res) {
if (res.errno === 0) {
console.log(res.data);
that.setData({
orderInfo: res.data.orderInfo,
orderGoods: res.data.orderGoods,
handleOption: res.data.orderInfo.handleOption,
expressInfo: res.data.expressInfo
});
let that = this;
util.request(api.OrderDetail, {
orderId: that.data.orderId
}).then(function(res) {
if (res.errno === 0) {
console.log(res.data);
that.setData({
orderInfo: res.data.orderInfo,
orderGoods: res.data.orderGoods,
handleOption: res.data.orderInfo.handleOption,
expressInfo: res.data.expressInfo
});
wx.hideLoading();
}
});
},
// “去付款”按钮点击效果
payOrder: function() {
let that = this;
util.request(api.OrderPrepay, {
orderId: that.data.orderId
}, 'POST').then(function(res) {
if (res.errno === 0) {
const payParam = res.data;
console.log("支付过程开始");
wx.requestPayment({
'timeStamp': payParam.timeStamp,
'nonceStr': payParam.nonceStr,
'package': payParam.packageValue,
'signType': payParam.signType,
'paySign': payParam.paySign,
'success': function(res) {
console.log("支付过程成功");
util.redirect('/pages/ucenter/order/order');
},
'fail': function(res) {
console.log("支付过程失败");
util.showErrorToast('支付失败');
},
'complete': function(res) {
console.log("支付过程结束")
}
wx.hideLoading();
}
});
},
// “去付款”按钮点击效果
payOrder: function() {
let that = this;
util.request(api.OrderPrepay, {
orderId: that.data.orderId
}, 'POST').then(function(res) {
if (res.errno === 0) {
const payParam = res.data;
console.log("支付过程开始");
wx.requestPayment({
'timeStamp': payParam.timeStamp,
'nonceStr': payParam.nonceStr,
'package': payParam.packageValue,
'signType': payParam.signType,
'paySign': payParam.paySign,
'success': function(res) {
console.log("支付过程成功");
util.redirect('/pages/ucenter/order/order');
},
'fail': function(res) {
console.log("支付过程失败");
util.showErrorToast('支付失败');
},
'complete': function(res) {
console.log("支付过程结束")
}
});
}
});
}
});
},
// “取消订单”点击效果
cancelOrder: function() {
let that = this;
let orderInfo = that.data.orderInfo;
},
// “取消订单”点击效果
cancelOrder: function() {
let that = this;
let orderInfo = that.data.orderInfo;
wx.showModal({
title: '',
content: '确定要取消此订单?',
success: function(res) {
if (res.confirm) {
util.request(api.OrderCancel, {
orderId: orderInfo.id
}, 'POST').then(function(res) {
if (res.errno === 0) {
wx.showToast({
title: '取消订单成功'
});
util.redirect('/pages/ucenter/order/order');
} else {
util.showErrorToast(res.errmsg);
wx.showModal({
title: '',
content: '确定要取消此订单?',
success: function(res) {
if (res.confirm) {
util.request(api.OrderCancel, {
orderId: orderInfo.id
}, 'POST').then(function(res) {
if (res.errno === 0) {
wx.showToast({
title: '取消订单成功'
});
util.redirect('/pages/ucenter/order/order');
} else {
util.showErrorToast(res.errmsg);
}
});
}
}
});
}
}
});
},
// “取消订单并退款”点击效果
refundOrder: function() {
let that = this;
let orderInfo = that.data.orderInfo;
});
},
// “取消订单并退款”点击效果
refundOrder: function() {
let that = this;
let orderInfo = that.data.orderInfo;
wx.showModal({
title: '',
content: '确定要取消此订单?',
success: function(res) {
if (res.confirm) {
util.request(api.OrderRefund, {
orderId: orderInfo.id
}, 'POST').then(function(res) {
if (res.errno === 0) {
wx.showToast({
title: '取消订单成功'
});
util.redirect('/pages/ucenter/order/order');
} else {
util.showErrorToast(res.errmsg);
wx.showModal({
title: '',
content: '确定要取消此订单?',
success: function(res) {
if (res.confirm) {
util.request(api.OrderRefund, {
orderId: orderInfo.id
}, 'POST').then(function(res) {
if (res.errno === 0) {
wx.showToast({
title: '取消订单成功'
});
util.redirect('/pages/ucenter/order/order');
} else {
util.showErrorToast(res.errmsg);
}
});
}
}
});
}
}
});
},
// “删除”点击效果
deleteOrder: function() {
let that = this;
let orderInfo = that.data.orderInfo;
});
},
// “删除”点击效果
deleteOrder: function() {
let that = this;
let orderInfo = that.data.orderInfo;
wx.showModal({
title: '',
content: '确定要删除此订单?',
success: function(res) {
if (res.confirm) {
util.request(api.OrderDelete, {
orderId: orderInfo.id
}, 'POST').then(function(res) {
if (res.errno === 0) {
wx.showToast({
title: '删除订单成功'
});
util.redirect('/pages/ucenter/order/order');
} else {
util.showErrorToast(res.errmsg);
wx.showModal({
title: '',
content: '确定要删除此订单?',
success: function(res) {
if (res.confirm) {
util.request(api.OrderDelete, {
orderId: orderInfo.id
}, 'POST').then(function(res) {
if (res.errno === 0) {
wx.showToast({
title: '删除订单成功'
});
util.redirect('/pages/ucenter/order/order');
} else {
util.showErrorToast(res.errmsg);
}
});
}
}
});
}
}
});
},
// “确认收货”点击效果
confirmOrder: function() {
let that = this;
let orderInfo = that.data.orderInfo;
});
},
// “确认收货”点击效果
confirmOrder: function() {
let that = this;
let orderInfo = that.data.orderInfo;
wx.showModal({
title: '',
content: '确认收货?',
success: function(res) {
if (res.confirm) {
util.request(api.OrderConfirm, {
orderId: orderInfo.id
}, 'POST').then(function(res) {
if (res.errno === 0) {
wx.showToast({
title: '确认收货成功!'
});
util.redirect('/pages/ucenter/order/order');
} else {
util.showErrorToast(res.errmsg);
wx.showModal({
title: '',
content: '确认收货?',
success: function(res) {
if (res.confirm) {
util.request(api.OrderConfirm, {
orderId: orderInfo.id
}, 'POST').then(function(res) {
if (res.errno === 0) {
wx.showToast({
title: '确认收货成功!'
});
util.redirect('/pages/ucenter/order/order');
} else {
util.showErrorToast(res.errmsg);
}
});
}
}
});
}
}
});
},
onReady: function() {
// 页面渲染完成
},
onShow: function() {
// 页面显示
},
onHide: function() {
// 页面隐藏
},
onUnload: function() {
// 页面关闭
}
});
},
onReady: function() {
// 页面渲染完成
},
onShow: function() {
// 页面显示
},
onHide: function() {
// 页面隐藏
},
onUnload: function() {
// 页面关闭
}
});
\ No newline at end of file
<view class="container">
<view class="order-info">
<view class="item-a">下单时间:{{orderInfo.addTime}}</view>
<view class="item-b">订单编号:{{orderInfo.orderSn}}</view>
<view class="item-c">
<view class="l">实付:
<text class="cost">¥{{orderInfo.actualPrice}}</text>
</view>
<view class="r">
<view class="btn active" bindtap="cancelOrder" wx:if="{{handleOption.cancel}}">取消订单</view>
<view class="btn active" bindtap="payOrder" wx:if="{{handleOption.pay}}">去付款</view>
<view class="btn active" bindtap="confirmOrder" wx:if="{{handleOption.confirm}}">确认收货</view>
<view class="btn active" bindtap="deleteOrder" wx:if="{{handleOption.delete}}">删除订单</view>
<view class="btn active" bindtap="refundOrder" wx:if="{{handleOption.refund}}">申请退款</view>
</view>
</view>
</view>
<view class="order-goods">
<view class="h">
<view class="label">商品信息</view>
<view class="status">{{orderInfo.orderStatusText}}</view>
</view>
<view class="goods">
<view class="item" wx:for="{{orderGoods}}" wx:key="id">
<view class="img">
<image src="{{item.picUrl}}"></image>
</view>
<view class="info">
<view class="t">
<text class="name">{{item.goodsName}}</text>
<text class="number">x{{item.number}}</text>
</view>
<view class="attr">{{item.specifications}}</view>
<view class="price">¥{{item.price}}</view>
<view class="btn active" wx:if="{{handleOption.comment && (item.comment == 0)}}">
<navigator url="../../commentPost/commentPost?orderId={{item.orderId}}&&valueId={{item.goodsId}}&type=0">去评价</navigator>
</view>
<view class="btn active" wx:if="{{handleOption.rebuy}}">
<navigator url="../../goods/goods?id={{item.goodsId}}">再次购买</navigator>
</view>
<view class="order-info">
<view class="item-a">下单时间:{{orderInfo.addTime}}</view>
<view class="item-b">订单编号:{{orderInfo.orderSn}}</view>
<view class="item-c">
<view class="l">实付:
<text class="cost">¥{{orderInfo.actualPrice}}</text>
</view>
<view class="r">
<view class="btn active" bindtap="cancelOrder" wx:if="{{handleOption.cancel}}">取消订单</view>
<view class="btn active" bindtap="payOrder" wx:if="{{handleOption.pay}}">去付款</view>
<view class="btn active" bindtap="confirmOrder" wx:if="{{handleOption.confirm}}">确认收货</view>
<view class="btn active" bindtap="deleteOrder" wx:if="{{handleOption.delete}}">删除订单</view>
<view class="btn active" bindtap="refundOrder" wx:if="{{handleOption.refund}}">申请退款</view>
</view>
</view>
</view>
</view>
<view class="order-bottom">
<view class="address">
<view class="t">
<text class="name">{{orderInfo.consignee}}</text>
<text class="mobile">{{orderInfo.mobile}}</text>
<view class="order-goods">
<view class="h">
<view class="label">商品信息</view>
<view class="status">{{orderInfo.orderStatusText}}</view>
</view>
<view class="b">{{orderInfo.address}}</view>
</view>
<view class="total">
<view class="t">
<text class="label">商品合计:</text>
<text class="txt">¥{{orderInfo.goodsPrice}}</text>
<view class="goods">
<view class="item" wx:for="{{orderGoods}}" wx:key="id">
<view class="img">
<image src="{{item.picUrl}}"></image>
</view>
<view class="info">
<view class="t">
<text class="name">{{item.goodsName}}</text>
<text class="number">x{{item.number}}</text>
</view>
<view class="attr">{{item.specifications}}</view>
<view class="price">¥{{item.price}}</view>
<view class="btn active" wx:if="{{handleOption.comment && (item.comment == 0)}}">
<navigator url="../../commentPost/commentPost?orderId={{item.orderId}}&&valueId={{item.goodsId}}&type=0">去评价</navigator>
</view>
<view class="btn active" wx:if="{{handleOption.rebuy}}">
<navigator url="../../goods/goods?id={{item.goodsId}}">再次购买</navigator>
</view>
</view>
</view>
</view>
<view class="t">
<text class="label">运费:</text>
<text class="txt">¥{{orderInfo.freightPrice}}</text>
<view class="order-bottom">
<view class="address">
<view class="t">
<text class="name">{{orderInfo.consignee}}</text>
<text class="mobile">{{orderInfo.mobile}}</text>
</view>
<view class="b">{{orderInfo.address}}</view>
</view>
<view class="total">
<view class="t">
<text class="label">商品合计:</text>
<text class="txt">¥{{orderInfo.goodsPrice}}</text>
</view>
<view class="t">
<text class="label">运费:</text>
<text class="txt">¥{{orderInfo.freightPrice}}</text>
</view>
</view>
<view class="pay-fee">
<text class="label">实付:</text>
<text class="txt">¥{{orderInfo.actualPrice}}</text>
</view>
</view>
</view>
<view class="pay-fee">
<text class="label">实付:</text>
<text class="txt">¥{{orderInfo.actualPrice}}</text>
</view>
</view>
</view>
<!-- 物流信息,仅收货状态下可见 -->
<view class="order-express" bindtap="expandDetail" wx:if="{{ handleOption.confirm }}">
<view class="expand">
<view class="title">
<view class="t">快递公司:{{expressInfo.shipperName}}</view>
<view class="b">物流单号:{{expressInfo.shipperCode}}</view>
</view>
<image class="ti" src="/static/images/address_right.png" background-size="cover"></image>
</view>
<view class="traces" wx:for="{{expressInfo.Traces}}" wx:key="item" wx:for-item="iitem" wx:if="{{ flag }}">
<view class="trace">
<view class="acceptStation">{{iitem.AcceptStation}}</view>
<view class="acceptTime">{{iitem.AcceptTime}}</view>
</view>
<!-- 物流信息,仅收货状态下可见 -->
<view class="order-express" bindtap="expandDetail" wx:if="{{ handleOption.confirm }}">
<view class="expand">
<view class="title">
<view class="t">快递公司:{{expressInfo.shipperName}}</view>
<view class="b">物流单号:{{expressInfo.shipperCode}}</view>
</view>
<image class="ti" src="/static/images/address_right.png" background-size="cover"></image>
</view>
<view class="traces" wx:for="{{expressInfo.Traces}}" wx:key="item" wx:for-item="iitem" wx:if="{{ flag }}">
<view class="trace">
<view class="acceptStation">{{iitem.AcceptStation}}</view>
<view class="acceptTime">{{iitem.AcceptTime}}</view>
</view>
</view>
</view>
</view>
</view>
\ No newline at end of file
page {
height: 100%;
width: 100%;
background: #f4f4f4;
height: 100%;
width: 100%;
background: #f4f4f4;
}
.order-info {
padding-top: 25rpx;
background: #fff;
height: auto;
overflow: hidden;
padding-top: 25rpx;
background: #fff;
height: auto;
overflow: hidden;
}
.item-a {
padding-left: 31.25rpx;
height: 42.5rpx;
padding-bottom: 12.5rpx;
line-height: 30rpx;
font-size: 30rpx;
color: #666;
padding-left: 31.25rpx;
height: 42.5rpx;
padding-bottom: 12.5rpx;
line-height: 30rpx;
font-size: 30rpx;
color: #666;
}
.item-b {
padding-left: 31.25rpx;
height: 29rpx;
line-height: 29rpx;
margin-top: 12.5rpx;
margin-bottom: 41.5rpx;
font-size: 30rpx;
color: #666;
padding-left: 31.25rpx;
height: 29rpx;
line-height: 29rpx;
margin-top: 12.5rpx;
margin-bottom: 41.5rpx;
font-size: 30rpx;
color: #666;
}
.item-c {
margin-left: 31.25rpx;
border-top: 1px solid #f4f4f4;
height: 103rpx;
line-height: 103rpx;
margin-left: 31.25rpx;
border-top: 1px solid #f4f4f4;
height: 103rpx;
line-height: 103rpx;
}
.item-c .l {
float: left;
float: left;
}
.item-c .r {
height: 103rpx;
float: right;
display: flex;
align-items: center;
padding-right: 16rpx;
height: 103rpx;
float: right;
display: flex;
align-items: center;
padding-right: 16rpx;
}
.item-c .r .btn {
float: right;
float: right;
}
.item-c .cost {
color: #b4282d;
color: #b4282d;
}
.item-c .btn {
line-height: 66rpx;
border-radius: 5rpx;
text-align: center;
margin: 0 15rpx;
padding: 0 20rpx;
height: 66rpx;
line-height: 66rpx;
border-radius: 5rpx;
text-align: center;
margin: 0 15rpx;
padding: 0 20rpx;
height: 66rpx;
}
.item-c .btn.active {
background: #a78845;
color: #fff;
background: #a78845;
color: #fff;
}
.order-goods {
margin-top: 20rpx;
background: #fff;
margin-top: 20rpx;
background: #fff;
}
.order-goods .h {
height: 93.75rpx;
line-height: 93.75rpx;
margin-left: 31.25rpx;
border-bottom: 1px solid #f4f4f4;
padding-right: 31.25rpx;
height: 93.75rpx;
line-height: 93.75rpx;
margin-left: 31.25rpx;
border-bottom: 1px solid #f4f4f4;
padding-right: 31.25rpx;
}
.order-goods .h .label {
float: left;
font-size: 30rpx;
color: #333;
float: left;
font-size: 30rpx;
color: #333;
}
.order-goods .h .status {
float: right;
font-size: 30rpx;
color: #b4282d;
float: right;
font-size: 30rpx;
color: #b4282d;
}
.order-goods .item {
display: flex;
align-items: center;
height: 192rpx;
margin-left: 31.25rpx;
padding-right: 31.25rpx;
border-bottom: 1px solid #f4f4f4;
display: flex;
align-items: center;
height: 192rpx;
margin-left: 31.25rpx;
padding-right: 31.25rpx;
border-bottom: 1px solid #f4f4f4;
}
.order-goods .item:last-child {
border-bottom: none;
border-bottom: none;
}
.order-goods .item .img {
height: 145.83rpx;
width: 145.83rpx;
background: #f4f4f4;
height: 145.83rpx;
width: 145.83rpx;
background: #f4f4f4;
}
.order-goods .item .img image {
height: 145.83rpx;
width: 145.83rpx;
height: 145.83rpx;
width: 145.83rpx;
}
.order-goods .item .info {
flex: 1;
height: 145.83rpx;
margin-left: 20rpx;
flex: 1;
height: 145.83rpx;
margin-left: 20rpx;
}
.order-goods .item .t {
margin-top: 8rpx;
height: 33rpx;
line-height: 33rpx;
margin-bottom: 10.5rpx;
margin-top: 8rpx;
height: 33rpx;
line-height: 33rpx;
margin-bottom: 10.5rpx;
}
.order-goods .item .t .name {
display: block;
float: left;
height: 33rpx;
line-height: 33rpx;
color: #333;
font-size: 30rpx;
display: block;
float: left;
height: 33rpx;
line-height: 33rpx;
color: #333;
font-size: 30rpx;
}
.order-goods .item .t .number {
display: block;
float: right;
height: 33rpx;
text-align: right;
line-height: 33rpx;
color: #333;
font-size: 30rpx;
display: block;
float: right;
height: 33rpx;
text-align: right;
line-height: 33rpx;
color: #333;
font-size: 30rpx;
}
.order-goods .item .attr {
height: 29rpx;
line-height: 29rpx;
color: #666;
margin-bottom: 25rpx;
font-size: 25rpx;
height: 29rpx;
line-height: 29rpx;
color: #666;
margin-bottom: 25rpx;
font-size: 25rpx;
}
.order-goods .item .price {
display: block;
float: left;
height: 30rpx;
line-height: 30rpx;
color: #333;
font-size: 30rpx;
display: block;
float: left;
height: 30rpx;
line-height: 30rpx;
color: #333;
font-size: 30rpx;
}
.order-goods .item .btn {
height: 50rpx;
line-height: 50rpx;
border-radius: 5rpx;
text-align: center;
display: block;
float: right;
margin: 0 15rpx;
padding: 0 20rpx;
height: 50rpx;
line-height: 50rpx;
border-radius: 5rpx;
text-align: center;
display: block;
float: right;
margin: 0 15rpx;
padding: 0 20rpx;
}
.order-goods .item .btn.active {
background: #b4282d;
color: #fff;
background: #b4282d;
color: #fff;
}
.order-bottom {
margin-top: 20rpx;
padding-left: 31.25rpx;
height: auto;
overflow: hidden;
background: #fff;
margin-top: 20rpx;
padding-left: 31.25rpx;
height: auto;
overflow: hidden;
background: #fff;
}
.order-bottom .address {
height: 128rpx;
padding-top: 25rpx;
border-bottom: 1px solid #f4f4f4;
height: 128rpx;
padding-top: 25rpx;
border-bottom: 1px solid #f4f4f4;
}
.order-bottom .address .t {
height: 35rpx;
line-height: 35rpx;
margin-bottom: 7.5rpx;
height: 35rpx;
line-height: 35rpx;
margin-bottom: 7.5rpx;
}
.order-bottom .address .name {
display: inline-block;
height: 35rpx;
width: 140rpx;
line-height: 35rpx;
font-size: 30rpx;
display: inline-block;
height: 35rpx;
width: 140rpx;
line-height: 35rpx;
font-size: 30rpx;
}
.order-bottom .address .mobile {
display: inline-block;
height: 35rpx;
line-height: 35rpx;
font-size: 30rpx;
display: inline-block;
height: 35rpx;
line-height: 35rpx;
font-size: 30rpx;
}
.order-bottom .address .b {
height: 35rpx;
line-height: 35rpx;
font-size: 30rpx;
height: 35rpx;
line-height: 35rpx;
font-size: 30rpx;
}
.order-bottom .total {
height: 106rpx;
padding-top: 20rpx;
border-bottom: 1px solid #f4f4f4;
height: 106rpx;
padding-top: 20rpx;
border-bottom: 1px solid #f4f4f4;
}
.order-bottom .total .t {
height: 30rpx;
line-height: 30rpx;
margin-bottom: 7.5rpx;
display: flex;
height: 30rpx;
line-height: 30rpx;
margin-bottom: 7.5rpx;
display: flex;
}
.order-bottom .total .label {
width: 150rpx;
display: inline-block;
height: 35rpx;
line-height: 35rpx;
font-size: 30rpx;
width: 150rpx;
display: inline-block;
height: 35rpx;
line-height: 35rpx;
font-size: 30rpx;
}
.order-bottom .total .txt {
flex: 1;
display: inline-block;
height: 35rpx;
line-height: 35rpx;
font-size: 30rpx;
flex: 1;
display: inline-block;
height: 35rpx;
line-height: 35rpx;
font-size: 30rpx;
}
.order-bottom .pay-fee {
height: 81rpx;
line-height: 81rpx;
height: 81rpx;
line-height: 81rpx;
}
.order-bottom .pay-fee .label {
display: inline-block;
width: 140rpx;
color: #b4282d;
display: inline-block;
width: 140rpx;
color: #b4282d;
}
.order-bottom .pay-fee .txt {
display: inline-block;
width: 140rpx;
color: #b4282d;
display: inline-block;
width: 140rpx;
color: #b4282d;
}
.order-express {
margin-top: 20rpx;
width: 100%;
height: 100rpx;
background: #fff;
margin-top: 20rpx;
width: 100%;
height: 100rpx;
background: #fff;
}
.order-express .expand {
/* margin-top: 20rpx; */
width: 100%;
height: 100rpx;
background: #fff;
/* border: 10rpx #a78845; */
/* margin-top: 20rpx; */
width: 100%;
height: 100rpx;
background: #fff;
/* border: 10rpx #a78845; */
}
.order-express .title {
float: left;
margin-bottom: 20rpx;
padding: 10rpx;
float: left;
margin-bottom: 20rpx;
padding: 10rpx;
}
.order-express .ti {
float: right;
width: 52rpx;
height: 52rpx;
margin-right: 16rpx;
margin-top: 28rpx;
float: right;
width: 52rpx;
height: 52rpx;
margin-right: 16rpx;
margin-top: 28rpx;
}
.order-express .t {
font-size: 29rpx;
margin-left: 10.25rpx;
color: #a78845;
font-size: 29rpx;
margin-left: 10.25rpx;
color: #a78845;
}
.order-express .b {
font-size: 29rpx;
margin-left: 10.25rpx;
color: #a78845;
font-size: 29rpx;
margin-left: 10.25rpx;
color: #a78845;
}
.order-express .traces {
padding: 17.5rpx;
background: #fff;
border-bottom: 1rpx solid #f1e6cdcc;
padding: 17.5rpx;
background: #fff;
border-bottom: 1rpx solid #f1e6cdcc;
}
.order-express .trace {
padding-bottom: 17.5rpx;
padding-top: 17.5rpx;
background: #fff;
padding-bottom: 17.5rpx;
padding-top: 17.5rpx;
background: #fff;
}
.order-express .acceptTime {
margin-top: 20rpx;
margin-right: 40rpx;
text-align: right;
font-size: 26rpx;
margin-top: 20rpx;
margin-right: 40rpx;
text-align: right;
font-size: 26rpx;
}
.order-express .acceptStation {
font-size: 26rpx;
font-size: 26rpx;
}
{
"description": "项目配置文件。",
"setting": {
"urlCheck": false,
"es6": true,
"postcss": true,
"minified": true,
"newFeature": true
},
"compileType": "miniprogram",
"libVersion": "2.2.0",
"appid": "wxa5b486c6b918ecfb",
"projectname": "Renard",
"condition": {
"search": {
"current": -1,
"list": []
},
"conversation": {
"current": -1,
"list": []
},
"plugin": {
"current": -1,
"list": []
},
"game": {
"list": []
},
"miniprogram": {
"current": 34,
"list": [
{
"id": -1,
"name": "首页",
"pathName": "pages/index/index",
"query": ""
},
{
"id": -1,
"name": "专题",
"pathName": "pages/topic/topic",
"query": ""
},
{
"id": -1,
"name": "专题详情",
"pathName": "pages/topicDetail/topicDetail",
"query": "id=314"
},
{
"id": -1,
"name": "专题评论列表",
"pathName": "pages/topicComment/topicComment",
"query": "valueId=314&type=1"
},
{
"id": -1,
"name": "专题评论添加",
"pathName": "pages/topicCommentPost/topicCommentPost",
"query": "valueId=314&type=1"
},
{
"id": -1,
"name": "品牌",
"pathName": "pages/brand/brand",
"query": ""
},
{
"id": -1,
"name": "品牌详情",
"pathName": "pages/brandDetail/brandDetail",
"query": "id=1001000"
},
{
"id": -1,
"name": "人气推荐",
"pathName": "pages/hotGoods/hotGoods",
"query": ""
},
{
"id": -1,
"name": "新品首发",
"pathName": "pages/newGoods/newGoods",
"query": ""
},
{
"id": -1,
"name": "分类",
"pathName": "pages/catalog/catalog",
"query": ""
},
{
"id": -1,
"name": "分类详情",
"pathName": "pages/category/category",
"query": "id=1008002"
},
{
"id": -1,
"name": "查找",
"pathName": "pages/search/search",
"query": ""
},
{
"id": -1,
"name": "商品",
"pathName": "pages/goods/goods",
"query": "id=1181000"
},
{
"id": -1,
"name": "商品评论列表",
"pathName": "pages/comment/comment",
"query": "valueId=1181000&type=0"
},
{
"id": -1,
"name": "购物车",
"pathName": "pages/cart/cart",
"query": ""
},
{
"id": -1,
"name": "下单",
"pathName": "pages/shopping/checkout/checkout",
"query": ""
},
{
"id": -1,
"name": "支付结果",
"pathName": "pages/payResult/payResult",
"query": ""
},
{
"id": -1,
"name": "我的",
"pathName": "pages/ucenter/index/index",
"query": ""
},
{
"id": -1,
"name": "我的订单列表",
"pathName": "pages/ucenter/order/order",
"query": ""
},
{
"id": -1,
"name": "我的订单详情",
"pathName": "pages/ucenter/orderDetail/orderDetail",
"query": "id=1"
},
{
"id": 22,
"name": "待评价的订单详情",
"pathName": "pages/ucenter/orderDetail/orderDetail",
"query": "id=1"
},
{
"id": -1,
"name": "购买商品评价",
"pathName": "pages/commentPost/commentPost",
"query": "orderId=2&type=0&valueId=1116011"
},
{
"id": -1,
"name": "我的优惠券",
"pathName": "pages/ucenter/coupon/coupon",
"query": ""
},
{
"id": -1,
"name": "我的收藏",
"pathName": "pages/ucenter/collect/collect",
"query": ""
},
{
"id": -1,
"name": "我的足迹",
"pathName": "pages/ucenter/footprint/footprint",
"query": ""
},
{
"id": -1,
"name": "我的地址",
"pathName": "pages/ucenter/address/address",
"query": ""
},
{
"id": -1,
"name": "我的地址添加",
"pathName": "pages/ucenter/addressAdd/addressAdd",
"query": ""
},
{
"id": -1,
"name": "登录",
"pathName": "pages/auth/login/login",
"query": ""
},
{
"id": -1,
"name": "注册",
"pathName": "pages/auth/register/register",
"query": ""
},
{
"id": -1,
"name": "找回密码",
"pathName": "pages/auth/reset/reset",
"query": ""
}
]
}
}
"description": "项目配置文件。",
"setting": {
"urlCheck": false,
"es6": true,
"postcss": true,
"minified": true,
"newFeature": true
},
"compileType": "miniprogram",
"libVersion": "2.2.0",
"appid": "wxa5b486c6b918ecfb",
"projectname": "Renard",
"condition": {
"search": {
"current": -1,
"list": []
},
"conversation": {
"current": -1,
"list": []
},
"plugin": {
"current": -1,
"list": []
},
"game": {
"list": []
},
"miniprogram": {
"current": 34,
"list": [
{
"id": -1,
"name": "首页",
"pathName": "pages/index/index",
"query": ""
},
{
"id": -1,
"name": "专题",
"pathName": "pages/topic/topic",
"query": ""
},
{
"id": -1,
"name": "专题详情",
"pathName": "pages/topicDetail/topicDetail",
"query": "id=314"
},
{
"id": -1,
"name": "品牌",
"pathName": "pages/brand/brand",
"query": ""
},
{
"id": -1,
"name": "品牌详情",
"pathName": "pages/brandDetail/brandDetail",
"query": "id=1001000"
},
{
"id": -1,
"name": "人气推荐",
"pathName": "pages/hotGoods/hotGoods",
"query": ""
},
{
"id": -1,
"name": "新品首发",
"pathName": "pages/newGoods/newGoods",
"query": ""
},
{
"id": -1,
"name": "分类",
"pathName": "pages/catalog/catalog",
"query": ""
},
{
"id": -1,
"name": "分类详情",
"pathName": "pages/category/category",
"query": "id=1008002"
},
{
"id": -1,
"name": "查找",
"pathName": "pages/search/search",
"query": ""
},
{
"id": -1,
"name": "商品",
"pathName": "pages/goods/goods",
"query": "id=1181000"
},
{
"id": -1,
"name": "商品评论列表",
"pathName": "pages/comment/comment",
"query": "valueId=1181000&type=0"
},
{
"id": -1,
"name": "购物车",
"pathName": "pages/cart/cart",
"query": ""
},
{
"id": -1,
"name": "下单",
"pathName": "pages/shopping/checkout/checkout",
"query": ""
},
{
"id": -1,
"name": "支付结果",
"pathName": "pages/payResult/payResult",
"query": ""
},
{
"id": -1,
"name": "我的",
"pathName": "pages/ucenter/index/index",
"query": ""
},
{
"id": -1,
"name": "我的订单列表",
"pathName": "pages/ucenter/order/order",
"query": ""
},
{
"id": -1,
"name": "我的订单详情",
"pathName": "pages/ucenter/orderDetail/orderDetail",
"query": "id=1"
},
{
"id": 22,
"name": "待评价的订单详情",
"pathName": "pages/ucenter/orderDetail/orderDetail",
"query": "id=1"
},
{
"id": -1,
"name": "购买商品评价",
"pathName": "pages/commentPost/commentPost",
"query": "orderId=2&type=0&valueId=1116011"
},
{
"id": -1,
"name": "我的优惠券",
"pathName": "pages/ucenter/coupon/coupon",
"query": ""
},
{
"id": -1,
"name": "我的收藏",
"pathName": "pages/ucenter/collect/collect",
"query": ""
},
{
"id": -1,
"name": "我的地址",
"pathName": "pages/ucenter/address/address",
"query": ""
},
{
"id": -1,
"name": "我的地址添加",
"pathName": "pages/ucenter/addressAdd/addressAdd",
"query": ""
},
{
"id": -1,
"name": "登录",
"pathName": "pages/auth/login/login",
"query": ""
}
]
}
}
}
\ No newline at end of file
......@@ -5,7 +5,7 @@ function isValidPhone(str) {
} else {
return true;
}
}
}
module.exports = {
isValidPhone
......
......@@ -9,12 +9,12 @@ const api = require('../config/api.js');
* Promise封装wx.checkSession
*/
function checkSession() {
return new Promise(function (resolve, reject) {
return new Promise(function(resolve, reject) {
wx.checkSession({
success: function () {
success: function() {
resolve(true);
},
fail: function () {
fail: function() {
reject(false);
}
})
......@@ -25,16 +25,16 @@ function checkSession() {
* Promise封装wx.login
*/
function login() {
return new Promise(function (resolve, reject) {
return new Promise(function(resolve, reject) {
wx.login({
success: function (res) {
success: function(res) {
if (res.code) {
resolve(res);
} else {
reject(res);
}
},
fail: function (err) {
fail: function(err) {
reject(err);
}
});
......@@ -46,10 +46,13 @@ function login() {
*/
function loginByWeixin(userInfo) {
return new Promise(function (resolve, reject) {
return new Promise(function(resolve, reject) {
return login().then((res) => {
//登录远程服务器
util.request(api.AuthLoginByWeixin, { code: res.code, userInfo: userInfo }, 'POST').then(res => {
util.request(api.AuthLoginByWeixin, {
code: res.code,
userInfo: userInfo
}, 'POST').then(res => {
if (res.errno === 0) {
//存储用户信息
wx.setStorageSync('userInfo', res.data.userInfo);
......@@ -72,7 +75,7 @@ function loginByWeixin(userInfo) {
* 判断用户是否登录
*/
function checkLogin() {
return new Promise(function (resolve, reject) {
return new Promise(function(resolve, reject) {
if (wx.getStorageSync('userInfo') && wx.getStorageSync('token')) {
checkSession().then(() => {
resolve(true);
......
......@@ -23,7 +23,7 @@ function formatNumber(n) {
* 封装微信的的request
*/
function request(url, data = {}, method = "GET") {
return new Promise(function (resolve, reject) {
return new Promise(function(resolve, reject) {
wx.request({
url: url,
data: data,
......@@ -32,7 +32,7 @@ function request(url, data = {}, method = "GET") {
'Content-Type': 'application/json',
'X-Litemall-Token': wx.getStorageSync('token')
},
success: function (res) {
success: function(res) {
if (res.statusCode == 200) {
......@@ -56,7 +56,7 @@ function request(url, data = {}, method = "GET") {
}
},
fail: function (err) {
fail: function(err) {
reject(err)
}
})
......@@ -90,6 +90,4 @@ module.exports = {
request,
redirect,
showErrorToast
};
};
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment