-
Notifications
You must be signed in to change notification settings - Fork 6.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
16 changed files
with
228 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -84,9 +84,10 @@ App({ | |
}) | ||
} | ||
}) | ||
}, | ||
}, | ||
globalData:{ | ||
userInfo:null, | ||
subDomain: "mall" | ||
subDomain: "mall", | ||
version: "1.4.0" | ||
} | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
const app = getApp() | ||
|
||
Page({ | ||
data: { | ||
userInfo: {}, | ||
}, | ||
onLoad() { | ||
this.getUserInfo(); | ||
this.setData({ | ||
version: app.globalData.version | ||
}); | ||
}, | ||
getUserInfo: function (cb) { | ||
var that = this | ||
wx.login({ | ||
success: function () { | ||
wx.getUserInfo({ | ||
success: function (res) { | ||
that.setData({ | ||
userInfo: res.userInfo | ||
}); | ||
} | ||
}) | ||
} | ||
}) | ||
}, | ||
aboutUs : function () { | ||
wx.showModal({ | ||
title: '关于我们', | ||
content: '本系统基于开源小程序商城系统 https://github.com/EastWorld/wechat-app-mall 搭建,祝大家使用愉快!', | ||
showCancel:false | ||
}) | ||
} | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"navigationBarTitleText": "我的" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<view class="container"> | ||
<view bindtap="bindViewTap" class="userinfo"> | ||
<image class="userinfo-avatar" src="{{ userInfo.avatarUrl }}" background-size="cover"></image> | ||
<text class="userinfo-nickname">{{ userInfo.nickName }}</text> | ||
</view> | ||
<view style="height:20rpx;background: #eee;width:100%;"></view> | ||
<view class="my-item"> | ||
<navigator url="/pages/order-list/index" hover-class="navigator-hover">我的订单</navigator> | ||
</view> | ||
<view class="my-item"> | ||
<navigator url="/pages/select-address/index" hover-class="navigator-hover">我的收货地址</navigator> | ||
</view> | ||
<view class="my-item" style="border:none;"> | ||
<navigator url="/pages/mycoupons/index" hover-class="navigator-hover">我的优惠券</navigator> | ||
</view> | ||
<view style="height:20rpx;background: #eee;width:100%;"></view> | ||
<view class="about" bindtap="aboutUs"> | ||
关于我们 | ||
</view> | ||
|
||
<view style="height:20rpx;background: #eee;width:100%;"></view> | ||
<view class="version">Powered by EastWorld v {{version}}</view> | ||
<view style="height:20rpx;background: #eee;width:100%;"></view> | ||
</view> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
.userinfo { | ||
display: flex; | ||
flex-direction: column; | ||
padding: 50rpx 0; | ||
align-items: center; | ||
background: #e85654; | ||
width: 750rpx; | ||
} | ||
|
||
.userinfo-avatar { | ||
width: 160rpx; | ||
height: 160rpx; | ||
margin: 20rpx; | ||
border-radius: 50%; | ||
} | ||
|
||
.userinfo-nickname { | ||
margin-top: 20rpx; | ||
color: #FFF; | ||
} | ||
|
||
|
||
.version { | ||
width:100%; | ||
height: 40rpx; | ||
line-height: 40rpx; | ||
font-size: 24rpx; | ||
text-align: center; | ||
padding: 40rpx; | ||
} | ||
|
||
.my-item{ | ||
width: 100%; | ||
background: url(https://cdn.it120.cc/images/weappshop/arrow-right.png) no-repeat 750rpx center; | ||
background-size: 16rpx auto,750rpx auto; | ||
margin: 20rpx 0; | ||
border-bottom: 1px solid #eee; | ||
height: 100rpx; | ||
line-height: 100rpx; | ||
padding-left: 100rpx; | ||
} | ||
|
||
.about{ | ||
width: 100%; | ||
background: url(https://cdn.it120.cc/images/weappshop/arrow-right.png) no-repeat 750rpx center; | ||
background-size: 16rpx auto,750rpx auto; | ||
margin: 20rpx 0; | ||
height: 80rpx; | ||
line-height: 80rpx; | ||
padding-left: 100rpx; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
//index.js | ||
//获取应用实例 | ||
var app = getApp() | ||
Page({ | ||
data: { | ||
coupons:[] | ||
}, | ||
onLoad: function () { | ||
}, | ||
onShow : function () { | ||
this.getMyCoupons(); | ||
}, | ||
getMyCoupons: function () { | ||
var that = this; | ||
wx.request({ | ||
url: 'https://api.it120.cc/' + app.globalData.subDomain + '/discounts/my', | ||
data: { | ||
token: app.globalData.token, | ||
status: 0 | ||
}, | ||
success: function (res) { | ||
if (res.data.code == 0) { | ||
var coupons = res.data.data; | ||
if (coupons.length > 0) { | ||
that.setData({ | ||
coupons: coupons | ||
}); | ||
} | ||
} | ||
} | ||
}) | ||
}, | ||
goBuy:function(){ | ||
wx.reLaunch({ | ||
url: '/pages/index/index' | ||
}) | ||
} | ||
|
||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"navigationBarTitleText": "我的优惠券" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<view class="container"> | ||
<view class="coupons-list"> | ||
<view class="coupons-item" wx:for-items="{{coupons}}" wx:for-index="idx" bindtap="gitCoupon" data-id="{{item.id}}"> | ||
<view style="font-size: 50rpx"> ¥ {{item.money}}元 </view> | ||
<view> {{item.name}} </view> | ||
<view> 满 {{item.moneyHreshold}} 元使用 </view> | ||
<view> {{item.dateEnd}} 前有效 </view> | ||
</view> | ||
</view> | ||
<view style="height:100rpx;background-color:#fff;width:100%;"></view> | ||
<view class="bottom-box"> | ||
<view class="add-btn" bindtap="goBuy">立即前往下单</view> | ||
</view> | ||
|
||
</view> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
.container { | ||
background-color:#F2f2f2; | ||
} | ||
.coupons-list{ | ||
width: 100%; | ||
background-color: #fff; | ||
margin-top: 20rpx; | ||
} | ||
|
||
.bottom-box{ | ||
position: absolute; | ||
width: 100%; | ||
bottom: 0; | ||
font-size:28rpx; | ||
color:#000000; | ||
border-top: 1rpx solid #eee; | ||
height:100rpx; | ||
line-height: 100rpx; | ||
background-color: #fff; | ||
background: url(https://cdn.it120.cc/images/weappshop/arrow-right.png) no-repeat 705rpx center; | ||
background-size: 15rpx auto; | ||
} | ||
.bottom-box .add-btn{ | ||
margin-left: 30rpx; | ||
padding-left: 70rpx; | ||
background: url(https://cdn.it120.cc/images/weappshop/add-addr.png) no-repeat left center; | ||
background-size: 40rpx auto; | ||
} | ||
.coupons-item{ | ||
width:630rpx; | ||
height: 180rpx; | ||
margin: 10rpx; | ||
padding: 50rpx; | ||
background-color: #f1a83b; | ||
font-size: 30rpx; | ||
line-height: 50rpx; | ||
color: #fff; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -122,7 +122,7 @@ Page({ | |
} | ||
|
||
// 下单成功,跳转到订单管理界面 | ||
wx.reLaunch({ | ||
wx.redirectTo({ | ||
url: "/pages/order-list/index" | ||
}); | ||
} | ||
|