Commit 286c0ae7 authored by Junling Bu's avatar Junling Bu
Browse files

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

parent 20b97ec8
page { page {
min-height: 100%; min-height: 100%;
background-color: #f4f4f4; background-color: #f4f4f4;
} }
.container { .container {
min-height: 100%; min-height: 100%;
background-color: #f4f4f4; background-color: #f4f4f4;
} }
.search-header { .search-header {
position: fixed; position: fixed;
top: 0; top: 0;
width: 750rpx; width: 750rpx;
height: 91rpx; height: 91rpx;
display: flex; display: flex;
background: #fff; background: #fff;
border-bottom: 1px solid rgba(0, 0, 0, 0.15); border-bottom: 1px solid rgba(0, 0, 0, 0.15);
padding: 0 31.25rpx; padding: 0 31.25rpx;
font-size: 29rpx; font-size: 29rpx;
color: #333; color: #333;
} }
.search-header .input-box { .search-header .input-box {
position: relative; position: relative;
margin-top: 16rpx; margin-top: 16rpx;
float: left; float: left;
width: 0; width: 0;
flex: 1; flex: 1;
height: 59rpx; height: 59rpx;
line-height: 59rpx; line-height: 59rpx;
padding: 0 20rpx; padding: 0 20rpx;
background: #f4f4f4; background: #f4f4f4;
} }
.search-header .icon { .search-header .icon {
position: absolute; position: absolute;
top: 14rpx; top: 14rpx;
left: 20rpx; left: 20rpx;
width: 31rpx; width: 31rpx;
height: 31rpx; height: 31rpx;
} }
.search-header .del { .search-header .del {
position: absolute; position: absolute;
top: 3rpx; top: 3rpx;
right: 10rpx; right: 10rpx;
width: 53rpx; width: 53rpx;
height: 53rpx; height: 53rpx;
z-index: 10; z-index: 10;
} }
.search-header .keywrod { .search-header .keywrod {
position: absolute; position: absolute;
top: 0; top: 0;
left: 40rpx; left: 40rpx;
width: 506rpx; width: 506rpx;
height: 59rpx; height: 59rpx;
padding-left: 30rpx; padding-left: 30rpx;
} }
.search-header .right { .search-header .right {
margin-top: 24rpx; margin-top: 24rpx;
margin-left: 31rpx; margin-left: 31rpx;
margin-right: 6rpx; margin-right: 6rpx;
width: 58rpx; width: 58rpx;
height: 43rpx; height: 43rpx;
line-height: 43rpx; line-height: 43rpx;
float: right; float: right;
} }
.no-search { .no-search {
height: auto; height: auto;
overflow: hidden; overflow: hidden;
margin-top: 91rpx; margin-top: 91rpx;
} }
.search-keywords { .search-keywords {
background: #fff; background: #fff;
width: 750rpx; width: 750rpx;
height: auto; height: auto;
overflow: hidden; overflow: hidden;
margin-bottom: 20rpx; margin-bottom: 20rpx;
} }
.search-keywords .h { .search-keywords .h {
padding: 0 31.25rpx; padding: 0 31.25rpx;
height: 93rpx; height: 93rpx;
line-height: 93rpx; line-height: 93rpx;
width: 100%; width: 100%;
color: #999; color: #999;
font-size: 29rpx; font-size: 29rpx;
} }
.search-keywords .title { .search-keywords .title {
display: block; display: block;
width: 120rpx; width: 120rpx;
float: left; float: left;
} }
.search-keywords .icon { .search-keywords .icon {
margin-top: 19rpx; margin-top: 19rpx;
float: right; float: right;
display: block; display: block;
margin-left: 511rpx; margin-left: 511rpx;
height: 55rpx; height: 55rpx;
width: 55rpx; width: 55rpx;
} }
.search-keywords .b { .search-keywords .b {
width: 750rpx; width: 750rpx;
height: auto; height: auto;
overflow: hidden; overflow: hidden;
padding-left: 31.25rpx; padding-left: 31.25rpx;
} }
.search-keywords .item { .search-keywords .item {
display: inline-block; display: inline-block;
width: auto; width: auto;
height: 48rpx; height: 48rpx;
line-height: 48rpx; line-height: 48rpx;
padding: 0 15rpx; padding: 0 15rpx;
border: 1px solid #999; border: 1px solid #999;
margin: 0 31.25rpx 31.25rpx 0; margin: 0 31.25rpx 31.25rpx 0;
font-size: 24rpx; font-size: 24rpx;
color: #333; color: #333;
} }
.search-keywords .item.active { .search-keywords .item.active {
color: #a78845; color: #a78845;
border: 1px solid #a78845; border: 1px solid #a78845;
} }
.shelper-list { .shelper-list {
width: 750rpx; width: 750rpx;
height: auto; height: auto;
overflow: hidden; overflow: hidden;
background: #fff; background: #fff;
padding: 0 31.25rpx; padding: 0 31.25rpx;
} }
.shelper-list .item { .shelper-list .item {
height: 93rpx; height: 93rpx;
width: 687.5rpx; width: 687.5rpx;
line-height: 93rpx; line-height: 93rpx;
font-size: 24rpx; font-size: 24rpx;
color: #333; color: #333;
border-bottom: 1px solid #f4f4f4; border-bottom: 1px solid #f4f4f4;
} }
.sort { .sort {
position: fixed; position: fixed;
top: 91rpx; top: 91rpx;
background: #fff; background: #fff;
width: 100%; width: 100%;
height: 78rpx; height: 78rpx;
} }
.sort-box { .sort-box {
background: #fff; background: #fff;
width: 100%; width: 100%;
height: 78rpx; height: 78rpx;
overflow: hidden; overflow: hidden;
padding: 0 30rpx; padding: 0 30rpx;
display: flex; display: flex;
border-bottom: 1px solid #d9d9d9; border-bottom: 1px solid #d9d9d9;
} }
.sort-box .item { .sort-box .item {
height: 78rpx; height: 78rpx;
line-height: 78rpx; line-height: 78rpx;
text-align: center; text-align: center;
flex: 1; flex: 1;
color: #333; color: #333;
font-size: 30rpx; font-size: 30rpx;
} }
.sort-box .item .txt { .sort-box .item .txt {
display: block; display: block;
width: 100%; width: 100%;
height: 100%; height: 100%;
color: #333; color: #333;
} }
.sort-box .item.active .txt { .sort-box .item.active .txt {
color: #a78845; color: #a78845;
} }
.sort-box .item.by-price { .sort-box .item.by-price {
background: url(//yanxuan.nosdn.127.net/hxm/yanxuan-wap/p/20161201/style/img/icon-normal/no-3127092a69.png) 155rpx center no-repeat; background: url(//yanxuan.nosdn.127.net/hxm/yanxuan-wap/p/20161201/style/img/icon-normal/no-3127092a69.png) 155rpx center no-repeat;
background-size: 15rpx 21rpx; background-size: 15rpx 21rpx;
} }
.sort-box .item.by-price.active.asc { .sort-box .item.by-price.active.asc {
background: url(http://yanxuan.nosdn.127.net/hxm/yanxuan-wap/p/20161201/style/img/icon-normal/up-636b92c0a5.png) 155rpx center no-repeat; background: url(http://yanxuan.nosdn.127.net/hxm/yanxuan-wap/p/20161201/style/img/icon-normal/up-636b92c0a5.png) 155rpx center no-repeat;
background-size: 15rpx 21rpx; background-size: 15rpx 21rpx;
} }
.sort-box .item.by-price.active.desc { .sort-box .item.by-price.active.desc {
background: url(http://yanxuan.nosdn.127.net/hxm/yanxuan-wap/p/20161201/style/img/icon-normal/down-95e035f3e5.png) 155rpx center no-repeat; background: url(http://yanxuan.nosdn.127.net/hxm/yanxuan-wap/p/20161201/style/img/icon-normal/down-95e035f3e5.png) 155rpx center no-repeat;
background-size: 15rpx 21rpx; background-size: 15rpx 21rpx;
} }
.sort-box-category { .sort-box-category {
background: #fff; background: #fff;
width: 100%; width: 100%;
height: auto; height: auto;
overflow: hidden; overflow: hidden;
padding: 40rpx 40rpx 0 0; padding: 40rpx 40rpx 0 0;
border-bottom: 1px solid #d9d9d9; border-bottom: 1px solid #d9d9d9;
} }
.sort-box-category .item { .sort-box-category .item {
height: 54rpx; height: 54rpx;
line-height: 54rpx; line-height: 54rpx;
text-align: center; text-align: center;
float: left; float: left;
padding: 0 16rpx; padding: 0 16rpx;
margin: 0 0 40rpx 40rpx; margin: 0 0 40rpx 40rpx;
border: 1px solid #666; border: 1px solid #666;
color: #333; color: #333;
font-size: 24rpx; font-size: 24rpx;
} }
.sort-box-category .item.active { .sort-box-category .item.active {
color: #a78845; color: #a78845;
border: 1px solid #a78845; border: 1px solid #a78845;
} }
.cate-item { .cate-item {
margin-top: 175rpx; margin-top: 175rpx;
height: auto; height: auto;
overflow: hidden; overflow: hidden;
} }
.cate-item .h { .cate-item .h {
height: 145rpx; height: 145rpx;
width: 750rpx; width: 750rpx;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
} }
.cate-item .h .name { .cate-item .h .name {
display: block; display: block;
height: 35rpx; height: 35rpx;
margin-bottom: 18rpx; margin-bottom: 18rpx;
font-size: 30rpx; font-size: 30rpx;
color: #333; color: #333;
} }
.cate-item .h .desc { .cate-item .h .desc {
display: block; display: block;
height: 24rpx; height: 24rpx;
font-size: 24rpx; font-size: 24rpx;
color: #999; color: #999;
} }
.search-result-empty { .search-result-empty {
width: 100%; width: 100%;
height: 100%; height: 100%;
padding-top: 300rpx; padding-top: 300rpx;
} }
.search-result-empty .icon { .search-result-empty .icon {
margin: 0 auto; margin: 0 auto;
display: block; display: block;
width: 240rpx; width: 240rpx;
height: 240rpx; height: 240rpx;
} }
.search-result-empty .text { .search-result-empty .text {
display: block; display: block;
width: 100%; width: 100%;
height: 40rpx; height: 40rpx;
font-size: 28rpx; font-size: 28rpx;
text-align: center; text-align: center;
color: #999; color: #999;
} }
...@@ -4,170 +4,170 @@ var api = require('../../../config/api.js'); ...@@ -4,170 +4,170 @@ var api = require('../../../config/api.js');
var app = getApp(); var app = getApp();
Page({ Page({
data: { data: {
checkedGoodsList: [], checkedGoodsList: [],
checkedAddress: {}, checkedAddress: {},
checkedCoupon: [], checkedCoupon: [],
goodsTotalPrice: 0.00, //商品总价 goodsTotalPrice: 0.00, //商品总价
freightPrice: 0.00, //快递费 freightPrice: 0.00, //快递费
couponPrice: 0.00, //优惠券的价格 couponPrice: 0.00, //优惠券的价格
grouponPrice: 0.00, //团购优惠价格 grouponPrice: 0.00, //团购优惠价格
orderTotalPrice: 0.00, //订单总价 orderTotalPrice: 0.00, //订单总价
actualPrice: 0.00, //实际需要支付的总价 actualPrice: 0.00, //实际需要支付的总价
cartId: 0, cartId: 0,
addressId: 0, addressId: 0,
couponId: 0, couponId: 0,
grouponLinkId: 0, //参与的团购,如果是发起则为0 grouponLinkId: 0, //参与的团购,如果是发起则为0
grouponRulesId: 0 //团购规则ID grouponRulesId: 0 //团购规则ID
}, },
onLoad: function(options) { onLoad: function(options) {
// 页面初始化 options为页面跳转所带来的参数 // 页面初始化 options为页面跳转所带来的参数
}, },
//获取checkou信息 //获取checkou信息
getCheckoutInfo: function() { getCheckoutInfo: function() {
let that = this; let that = this;
util.request(api.CartCheckout, { util.request(api.CartCheckout, {
cartId: that.data.cartId, cartId: that.data.cartId,
addressId: that.data.addressId, addressId: that.data.addressId,
couponId: that.data.couponId, couponId: that.data.couponId,
grouponRulesId: that.data.grouponRulesId grouponRulesId: that.data.grouponRulesId
}).then(function(res) { }).then(function(res) {
if (res.errno === 0) { if (res.errno === 0) {
that.setData({ that.setData({
checkedGoodsList: res.data.checkedGoodsList, checkedGoodsList: res.data.checkedGoodsList,
checkedAddress: res.data.checkedAddress, checkedAddress: res.data.checkedAddress,
actualPrice: res.data.actualPrice, actualPrice: res.data.actualPrice,
checkedCoupon: res.data.checkedCoupon, checkedCoupon: res.data.checkedCoupon,
couponPrice: res.data.couponPrice, couponPrice: res.data.couponPrice,
grouponPrice: res.data.grouponPrice, grouponPrice: res.data.grouponPrice,
freightPrice: res.data.freightPrice, freightPrice: res.data.freightPrice,
goodsTotalPrice: res.data.goodsTotalPrice, goodsTotalPrice: res.data.goodsTotalPrice,
orderTotalPrice: res.data.orderTotalPrice, orderTotalPrice: res.data.orderTotalPrice,
addressId: res.data.addressId, addressId: res.data.addressId,
couponId: res.data.couponId, couponId: res.data.couponId,
grouponRulesId: res.data.grouponRulesId, grouponRulesId: res.data.grouponRulesId,
});
}
wx.hideLoading();
}); });
} },
wx.hideLoading(); selectAddress() {
}); wx.navigateTo({
}, url: '/pages/ucenter/address/address',
selectAddress() { })
wx.navigateTo({ },
url: '/pages/ucenter/address/address', onReady: function() {
}) // 页面渲染完成
},
onReady: function() {
// 页面渲染完成
}, },
onShow: function() { onShow: function() {
// 页面显示 // 页面显示
wx.showLoading({ wx.showLoading({
title: '加载中...', title: '加载中...',
});
try {
var cartId = wx.getStorageSync('cartId');
if (cartId) {
this.setData({
'cartId': cartId
}); });
} try {
var cartId = wx.getStorageSync('cartId');
if (cartId) {
this.setData({
'cartId': cartId
});
}
var addressId = wx.getStorageSync('addressId'); var addressId = wx.getStorageSync('addressId');
if (addressId) { if (addressId) {
this.setData({ this.setData({
'addressId': addressId 'addressId': addressId
}); });
} }
var couponId = wx.getStorageSync('couponId'); var couponId = wx.getStorageSync('couponId');
if (couponId) { if (couponId) {
this.setData({ this.setData({
'couponId': couponId 'couponId': couponId
}); });
} }
var grouponRulesId = wx.getStorageSync('grouponRulesId'); var grouponRulesId = wx.getStorageSync('grouponRulesId');
if (grouponRulesId) { if (grouponRulesId) {
this.setData({ this.setData({
'grouponRulesId': grouponRulesId 'grouponRulesId': grouponRulesId
}); });
} }
var grouponLinkId = wx.getStorageSync('grouponLinkId'); var grouponLinkId = wx.getStorageSync('grouponLinkId');
if (grouponLinkId) { if (grouponLinkId) {
this.setData({ this.setData({
'grouponLinkId': grouponLinkId 'grouponLinkId': grouponLinkId
}); });
} }
} catch (e) { } catch (e) {
// Do something when catch error // Do something when catch error
console.log(e); console.log(e);
} }
this.getCheckoutInfo(); this.getCheckoutInfo();
}, },
onHide: function() { onHide: function() {
// 页面隐藏 // 页面隐藏
}, },
onUnload: function() { onUnload: function() {
// 页面关闭 // 页面关闭
}, },
submitOrder: function() { submitOrder: function() {
if (this.data.addressId <= 0) { if (this.data.addressId <= 0) {
util.showErrorToast('请选择收货地址'); util.showErrorToast('请选择收货地址');
return false; return false;
} }
util.request(api.OrderSubmit, { util.request(api.OrderSubmit, {
cartId: this.data.cartId, cartId: this.data.cartId,
addressId: this.data.addressId, addressId: this.data.addressId,
couponId: this.data.couponId, couponId: this.data.couponId,
grouponRulesId: this.data.grouponRulesId, grouponRulesId: this.data.grouponRulesId,
grouponLinkId: this.data.grouponLinkId grouponLinkId: this.data.grouponLinkId
}, 'POST').then(res => { }, 'POST').then(res => {
if (res.errno === 0) { if (res.errno === 0) {
const orderId = res.data.orderId; const orderId = res.data.orderId;
util.request(api.OrderPrepay, { util.request(api.OrderPrepay, {
orderId: orderId orderId: orderId
}, 'POST').then(function(res) { }, 'POST').then(function(res) {
if (res.errno === 0) { if (res.errno === 0) {
const payParam = res.data; const payParam = res.data;
console.log("支付过程开始"); console.log("支付过程开始");
wx.requestPayment({ wx.requestPayment({
'timeStamp': payParam.timeStamp, 'timeStamp': payParam.timeStamp,
'nonceStr': payParam.nonceStr, 'nonceStr': payParam.nonceStr,
'package': payParam.packageValue, 'package': payParam.packageValue,
'signType': payParam.signType, 'signType': payParam.signType,
'paySign': payParam.paySign, 'paySign': payParam.paySign,
'success': function(res) { 'success': function(res) {
console.log("支付过程成功"); console.log("支付过程成功");
wx.redirectTo({ wx.redirectTo({
url: '/pages/payResult/payResult?status=1&orderId=' + orderId url: '/pages/payResult/payResult?status=1&orderId=' + orderId
});
},
'fail': function(res) {
console.log("支付过程失败");
wx.redirectTo({
url: '/pages/payResult/payResult?status=0&orderId=' + orderId
});
},
'complete': function(res) {
console.log("支付过程结束")
}
});
} else {
wx.redirectTo({
url: '/pages/payResult/payResult?status=0&orderId=' + orderId
});
}
}); });
},
'fail': function(res) {
console.log("支付过程失败");
wx.redirectTo({
url: '/pages/payResult/payResult?status=0&orderId=' + orderId
});
},
'complete': function(res) {
console.log("支付过程结束")
}
});
} else {
wx.redirectTo({
url: '/pages/payResult/payResult?status=0&orderId=' + orderId
});
}
});
} else { } else {
util.showErrorToast(res.errmsg); util.showErrorToast(res.errmsg);
} }
}); });
} }
}); });
\ No newline at end of file
<view class="container"> <view class="container">
<view class="address-box"> <view class="address-box">
<view class="address-item" bindtap="selectAddress" wx:if="{{checkedAddress.id > 0}}"> <view class="address-item" bindtap="selectAddress" wx:if="{{checkedAddress.id > 0}}">
<view class="l"> <view class="l">
<text class="name">{{checkedAddress.name}}</text> <text class="name">{{checkedAddress.name}}</text>
<text class="default" wx:if="{{checkedAddress.isDefault}}">默认</text> <text class="default" wx:if="{{checkedAddress.isDefault}}">默认</text>
</view> </view>
<view class="m"> <view class="m">
<text class="mobile">{{checkedAddress.mobile}}</text> <text class="mobile">{{checkedAddress.mobile}}</text>
<text class="address">{{checkedAddress.address}}</text> <text class="address">{{checkedAddress.address}}</text>
</view> </view>
<view class="r"> <view class="r">
<image src="/static/images/address_right.png"></image> <image src="/static/images/address_right.png"></image>
</view> </view>
</view> </view>
<view class="address-item address-empty" bindtap="selectAddress" wx:else> <view class="address-item address-empty" bindtap="selectAddress" wx:else>
<view class="m"> <view class="m">
还没有收货地址,去添加 还没有收货地址,去添加
</view> </view>
<view class="r"> <view class="r">
<image src="/static/images/address_right.png"></image> <image src="/static/images/address_right.png"></image>
</view> </view>
</view>
</view> </view>
</view>
<view class="order-box"> <view class="order-box">
<view class="order-item"> <view class="order-item">
<view class="l"> <view class="l">
<text class="name">商品合计</text> <text class="name">商品合计</text>
</view> </view>
<view class="r"> <view class="r">
<text class="txt">¥ {{goodsTotalPrice}}元</text> <text class="txt">¥ {{goodsTotalPrice}}元</text>
</view> </view>
</view> </view>
<view class="order-item"> <view class="order-item">
<view class="l"> <view class="l">
<text class="name">运费</text> <text class="name">运费</text>
</view> </view>
<view class="r"> <view class="r">
<text class="txt">¥ {{freightPrice}}元</text> <text class="txt">¥ {{freightPrice}}元</text>
</view> </view>
</view>
</view> </view>
</view>
<view class="goods-items"> <view class="goods-items">
<view class="item" wx:for="{{checkedGoodsList}}" wx:key="id"> <view class="item" wx:for="{{checkedGoodsList}}" wx:key="id">
<view class="img"> <view class="img">
<image src="{{item.picUrl}}"></image> <image src="{{item.picUrl}}"></image>
</view> </view>
<view class="info"> <view class="info">
<view class="t"> <view class="t">
<text class="name">{{item.goodsName}}</text> <text class="name">{{item.goodsName}}</text>
<text class="number">x{{item.number}}</text> <text class="number">x{{item.number}}</text>
</view>
<view class="m">{{item.specifications}}</view>
<view class="b">¥{{item.price}}</view>
</view>
</view> </view>
<view class="m">{{item.specifications}}</view>
<view class="b">¥{{item.price}}</view>
</view>
</view> </view>
</view>
<view class="order-total"> <view class="order-total">
<view class="l">实付:¥{{actualPrice}}</view> <view class="l">实付:¥{{actualPrice}}</view>
<view class="r" bindtap="submitOrder">去付款</view> <view class="r" bindtap="submitOrder">去付款</view>
</view> </view>
</view> </view>
\ No newline at end of file
page{ page {
height: 100%; height: 100%;
background: #f4f4f4; background: #f4f4f4;
} }
.address-box{ .address-box {
width: 100%; width: 100%;
height: 166.55rpx; height: 166.55rpx;
background: url('http://yanxuan.nosdn.127.net/hxm/yanxuan-wap/p/20161201/style/img/icon-normal/address-bg-bd30f2bfeb.png') 0 0 repeat-x; background: url('http://yanxuan.nosdn.127.net/hxm/yanxuan-wap/p/20161201/style/img/icon-normal/address-bg-bd30f2bfeb.png') 0 0 repeat-x;
background-size: 62.5rpx 10.5rpx; background-size: 62.5rpx 10.5rpx;
margin-bottom: 20rpx; margin-bottom: 20rpx;
padding-top: 10.5rpx; padding-top: 10.5rpx;
} }
.address-item{ .address-item {
display: flex; display: flex;
height: 155.55rpx; height: 155.55rpx;
background: #fff; background: #fff;
padding: 41.6rpx 0 41.6rpx 31.25rpx; padding: 41.6rpx 0 41.6rpx 31.25rpx;
} }
.address-item.address-empty{ .address-item.address-empty {
line-height: 75rpx; line-height: 75rpx;
text-align: center; text-align: center;
} }
.address-box .l{ .address-box .l {
width: 125rpx; width: 125rpx;
height: 100%; height: 100%;
} }
.address-box .l .name{ .address-box .l .name {
margin-left: 6.25rpx; margin-left: 6.25rpx;
margin-top: -7.25rpx; margin-top: -7.25rpx;
display: block; display: block;
width: 125rpx; width: 125rpx;
height: 43rpx; height: 43rpx;
line-height: 43rpx; line-height: 43rpx;
font-size: 30rpx; font-size: 30rpx;
color: #333; color: #333;
margin-bottom: 5rpx; margin-bottom: 5rpx;
} }
.address-box .l .default{ .address-box .l .default {
margin-left: 6.25rpx; margin-left: 6.25rpx;
display: block; display: block;
width: 62rpx; width: 62rpx;
height: 33rpx; height: 33rpx;
border-radius: 5rpx; border-radius: 5rpx;
border: 1px solid #b4282d; border: 1px solid #b4282d;
font-size: 20.5rpx; font-size: 20.5rpx;
text-align: center; text-align: center;
line-height: 29rpx; line-height: 29rpx;
color: #b4282d; color: #b4282d;
} }
.address-box .m{ .address-box .m {
flex: 1; flex: 1;
height: 72.25rpx; height: 72.25rpx;
color: #999; color: #999;
} }
.address-box .mobile{ .address-box .mobile {
display: block; display: block;
height: 29rpx; height: 29rpx;
line-height: 29rpx; line-height: 29rpx;
margin-bottom: 6.25rpx; margin-bottom: 6.25rpx;
font-size: 30rpx; font-size: 30rpx;
color:#333; color: #333;
} }
.address-box .address{ .address-box .address {
display: block; display: block;
height: 37.5rpx; height: 37.5rpx;
line-height: 37.5rpx; line-height: 37.5rpx;
font-size: 25rpx; font-size: 25rpx;
color:#666; color: #666;
} }
.address-box .r{ .address-box .r {
width: 77rpx; width: 77rpx;
height: 77rpx; height: 77rpx;
display: flex; display: flex;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
} }
.address-box .r image{ .address-box .r image {
width: 52.078rpx; width: 52.078rpx;
height: 52.078rpx; height: 52.078rpx;
} }
.coupon-box{ .coupon-box {
width: 100%; width: 100%;
height: auto; height: auto;
overflow: hidden; overflow: hidden;
background: #fff; background: #fff;
} }
.coupon-box .coupon-item{ .coupon-box .coupon-item {
width: 100%; width: 100%;
height: 108.3rpx; height: 108.3rpx;
overflow: hidden; overflow: hidden;
background: #fff; background: #fff;
display: flex; display: flex;
padding-left: 31.25rpx; padding-left: 31.25rpx;
} }
.coupon-box .l{ .coupon-box .l {
flex: 1; flex: 1;
height: 43rpx; height: 43rpx;
line-height: 43rpx; line-height: 43rpx;
padding-top: 35rpx; padding-top: 35rpx;
} }
.coupon-box .l .name{ .coupon-box .l .name {
float: left; float: left;
font-size: 30rpx; font-size: 30rpx;
color: #666; color: #666;
} }
.coupon-box .l .txt{ .coupon-box .l .txt {
float: right; float: right;
font-size: 30rpx; font-size: 30rpx;
color: #666; color: #666;
} }
.coupon-box .r{ .coupon-box .r {
margin-top: 15.5rpx; margin-top: 15.5rpx;
width: 77rpx; width: 77rpx;
height: 77rpx; height: 77rpx;
display: flex; display: flex;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
} }
.coupon-box .r image{ .coupon-box .r image {
width: 52.078rpx; width: 52.078rpx;
height: 52.078rpx; height: 52.078rpx;
} }
.order-box{ .order-box {
margin-top: 20rpx; margin-top: 20rpx;
width: 100%; width: 100%;
height: auto; height: auto;
overflow: hidden; overflow: hidden;
background: #fff; background: #fff;
} }
.order-box .order-item{ .order-box .order-item {
height: 104.3rpx; height: 104.3rpx;
overflow: hidden; overflow: hidden;
background: #fff; background: #fff;
display: flex; display: flex;
margin-left: 31.25rpx; margin-left: 31.25rpx;
padding-right: 31.25rpx; padding-right: 31.25rpx;
padding-top: 26rpx; padding-top: 26rpx;
border-bottom: 1px solid #d9d9d9; border-bottom: 1px solid #d9d9d9;
} }
.order-box .order-item .l{ .order-box .order-item .l {
float: left; float: left;
height: 52rpx; height: 52rpx;
width: 50%; width: 50%;
line-height: 52rpx; line-height: 52rpx;
overflow: hidden; overflow: hidden;
} }
.order-box .order-item .r{ .order-box .order-item .r {
float: right; float: right;
text-align: right; text-align: right;
width: 50%; width: 50%;
height: 52rpx; height: 52rpx;
line-height: 52rpx; line-height: 52rpx;
overflow: hidden; overflow: hidden;
} }
.order-box .order-item.no-border{ .order-box .order-item.no-border {
border-bottom: none; border-bottom: none;
} }
.goods-items{ .goods-items {
margin-top: 20rpx; margin-top: 20rpx;
width: 100%; width: 100%;
height: auto; height: auto;
overflow: hidden; overflow: hidden;
background: #fff; background: #fff;
padding-left: 31.25rpx; padding-left: 31.25rpx;
margin-bottom: 120rpx; margin-bottom: 120rpx;
} }
.goods-items .item{ .goods-items .item {
height: 192rpx; height: 192rpx;
padding-right: 31.25rpx; padding-right: 31.25rpx;
display: flex; display: flex;
align-items: center; align-items: center;
border-bottom: 1px solid rgba(0,0,0,0.15); border-bottom: 1px solid rgba(0, 0, 0, 0.15);
} }
.goods-items .item.no-border{ .goods-items .item.no-border {
border-bottom: none; border-bottom: none;
} }
.goods-items .item:last-child {
.goods-items .item:last-child{ border-bottom: none;
border-bottom: none;
} }
.goods-items .img{ .goods-items .img {
height: 145.83rpx; height: 145.83rpx;
width: 145.83rpx; width: 145.83rpx;
background-color: #f4f4f4; background-color: #f4f4f4;
margin-right: 20rpx; margin-right: 20rpx;
} }
.goods-items .img image{ .goods-items .img image {
height: 145.83rpx; height: 145.83rpx;
width: 145.83rpx; width: 145.83rpx;
} }
.goods-items .info{ .goods-items .info {
flex: 1; flex: 1;
height: 145.83rpx; height: 145.83rpx;
padding-top: 5rpx; padding-top: 5rpx;
} }
.goods-items .t{ .goods-items .t {
height: 33rpx; height: 33rpx;
line-height: 33rpx; line-height: 33rpx;
margin-bottom: 10rpx; margin-bottom: 10rpx;
overflow: hidden; overflow: hidden;
font-size: 30rpx; font-size: 30rpx;
color: #333; color: #333;
} }
.goods-items .t .name{ .goods-items .t .name {
display: block; display: block;
float: left; float: left;
} }
.goods-items .t .number{ .goods-items .t .number {
display: block; display: block;
float: right; float: right;
text-align: right; text-align: right;
} }
.goods-items .m { .goods-items .m {
height: 29rpx; height: 29rpx;
overflow: hidden; overflow: hidden;
line-height: 29rpx; line-height: 29rpx;
margin-bottom: 25rpx; margin-bottom: 25rpx;
font-size: 25rpx; font-size: 25rpx;
color: #666; color: #666;
} }
.goods-items .b { .goods-items .b {
height: 41rpx; height: 41rpx;
overflow: hidden; overflow: hidden;
line-height: 41rpx; line-height: 41rpx;
font-size: 30rpx; font-size: 30rpx;
color: #333; color: #333;
} }
.order-total{ .order-total {
position: fixed; position: fixed;
left:0; left: 0;
bottom: 0; bottom: 0;
height: 100rpx; height: 100rpx;
width: 100%; width: 100%;
display: flex; display: flex;
} }
.order-total .l{ .order-total .l {
flex: 1; flex: 1;
height: 100rpx; height: 100rpx;
line-height: 100rpx; line-height: 100rpx;
color: #a78845; color: #a78845;
background: #fff; background: #fff;
font-size: 33rpx; font-size: 33rpx;
padding-left: 31.25rpx; padding-left: 31.25rpx;
border-top: 1rpx solid rgba(0,0,0,0.2); border-top: 1rpx solid rgba(0, 0, 0, 0.2);
border-bottom: 1rpx solid rgba(0,0,0,0.2); border-bottom: 1rpx solid rgba(0, 0, 0, 0.2);
} }
.order-total .r{ .order-total .r {
width: 233rpx; width: 233rpx;
height: 100rpx; height: 100rpx;
background: #a78845; background: #a78845;
border: 1px solid #a78845; border: 1px solid #a78845;
line-height: 100rpx; line-height: 100rpx;
text-align: center; text-align: center;
color: #fff; color: #fff;
font-size: 30rpx; font-size: 30rpx;
} }
\ No newline at end of file
...@@ -2,93 +2,93 @@ var util = require('../../utils/util.js'); ...@@ -2,93 +2,93 @@ var util = require('../../utils/util.js');
var api = require('../../config/api.js'); var api = require('../../config/api.js');
var app = getApp() var app = getApp()
Page({ Page({
data: { data: {
topicList: [], topicList: [],
page: 1, page: 1,
size: 10, size: 10,
count: 0, count: 0,
scrollTop: 0, scrollTop: 0,
showPage: false showPage: false
}, },
onLoad: function(options) { onLoad: function(options) {
// 页面初始化 options为页面跳转所带来的参数 // 页面初始化 options为页面跳转所带来的参数
this.getTopic(); this.getTopic();
}, },
onReady: function() { onReady: function() {
// 页面渲染完成 // 页面渲染完成
}, },
onShow: function() { onShow: function() {
// 页面显示 // 页面显示
}, },
onHide: function() { onHide: function() {
// 页面隐藏 // 页面隐藏
}, },
onUnload: function() { onUnload: function() {
// 页面关闭 // 页面关闭
}, },
nextPage: function(event) { nextPage: function(event) {
var that = this; var that = this;
if (this.data.page > that.data.count / that.data.size) { if (this.data.page > that.data.count / that.data.size) {
return true; return true;
} }
that.setData({
page: that.data.page + 1
});
this.getTopic(); that.setData({
page: that.data.page + 1
});
}, this.getTopic();
onPullDownRefresh() { },
wx.showNavigationBarLoading() //在标题栏中显示加载
this.getTopic();
wx.hideNavigationBarLoading() //完成停止加载
wx.stopPullDownRefresh() //停止下拉刷新
},
getTopic: function() {
let that = this; onPullDownRefresh() {
that.setData({ wx.showNavigationBarLoading() //在标题栏中显示加载
scrollTop: 0, this.getTopic();
showPage: false, wx.hideNavigationBarLoading() //完成停止加载
topicList: [] wx.stopPullDownRefresh() //停止下拉刷新
}); },
// 页面渲染完成
wx.showToast({
title: '加载中...',
icon: 'loading',
duration: 2000
});
util.request(api.TopicList, { getTopic: function() {
page: that.data.page,
size: that.data.size
}).then(function(res) {
if (res.errno === 0) {
let that = this;
that.setData({ that.setData({
scrollTop: 0, scrollTop: 0,
topicList: res.data.data, showPage: false,
showPage: true, topicList: []
count: res.data.count });
// 页面渲染完成
wx.showToast({
title: '加载中...',
icon: 'loading',
duration: 2000
}); });
}
wx.hideToast();
});
}, util.request(api.TopicList, {
prevPage: function(event) { page: that.data.page,
if (this.data.page <= 1) { size: that.data.size
return false; }).then(function(res) {
} if (res.errno === 0) {
var that = this; that.setData({
that.setData({ scrollTop: 0,
page: that.data.page - 1 topicList: res.data.data,
}); showPage: true,
this.getTopic(); count: res.data.count
} });
}
wx.hideToast();
});
},
prevPage: function(event) {
if (this.data.page <= 1) {
return false;
}
var that = this;
that.setData({
page: that.data.page - 1
});
this.getTopic();
}
}) })
\ No newline at end of file
<view class="container"> <view class="container">
<scroll-view class="topic-list" scroll-y="true" scroll-top="{{scrollTop}}"> <scroll-view class="topic-list" scroll-y="true" scroll-top="{{scrollTop}}">
<navigator class="item" wx:for="{{topicList}}" wx:key="id" url="../topicDetail/topicDetail?id={{item.id}}"> <navigator class="item" wx:for="{{topicList}}" wx:key="id" url="../topicDetail/topicDetail?id={{item.id}}">
<image class="img" src="{{item.picUrl}}"></image> <image class="img" src="{{item.picUrl}}"></image>
<view class="info"> <view class="info">
<text class="title">{{item.title}}</text> <text class="title">{{item.title}}</text>
<text class="desc">{{item.subtitle}}</text> <text class="desc">{{item.subtitle}}</text>
<!-- <text class="price">{{item.price}}元起</text> --> <!-- <text class="price">{{item.price}}元起</text> -->
</view> </view>
</navigator> </navigator>
<view class="page" wx:if="{{showPage}}"> <view class="page" wx:if="{{showPage}}">
<view class="prev {{ page <= 1 ? 'disabled' : ''}}" bindtap="prevPage">上一页</view> <view class="prev {{ page <= 1 ? 'disabled' : ''}}" bindtap="prevPage">上一页</view>
<view class="next {{ (count / size) < page ? 'disabled' : ''}}" bindtap="nextPage">下一页</view> <view class="next {{ (count / size) < page ? 'disabled' : ''}}" bindtap="nextPage">下一页</view>
</view> </view>
</scroll-view> </scroll-view>
</view> </view>
\ No newline at end of file
page ,.container{ page, .container {
width: 750rpx; width: 750rpx;
height: 100%; height: 100%;
overflow: hidden; overflow: hidden;
background: #f4f4f4; background: #f4f4f4;
}
.topic-list{
width: 750rpx;
height: 100%;
overflow: hidden;
background: #f4f4f4;
} }
.topic-list .item{ .topic-list {
width: 100%; width: 750rpx;
height: 625rpx; height: 100%;
overflow: hidden; overflow: hidden;
background: #fff; background: #f4f4f4;
margin-bottom: 20rpx;
} }
.topic-list .img{ .topic-list .item {
width: 100%; width: 100%;
height: 415rpx; height: 625rpx;
overflow: hidden;
background: #fff;
margin-bottom: 20rpx;
} }
.topic-list .info{ .topic-list .img {
width: 100%; width: 100%;
height: 210rpx; height: 415rpx;
overflow: hidden;
} }
.topic-list .title{ .topic-list .info {
display: block; width: 100%;
text-align: center; height: 210rpx;
width: 100%; overflow: hidden;
height: 33rpx;
line-height: 35rpx;
color: #a78845;
overflow: hidden;
font-size: 35rpx;
margin-top: 30rpx;
} }
.topic-list .desc{ .topic-list .title {
display: block; display: block;
text-align: center; text-align: center;
position: relative; width: 100%;
width: auto; height: 33rpx;
height: 24rpx; line-height: 35rpx;
line-height: 24rpx; color: #a78845;
overflow: hidden; overflow: hidden;
color: #999; font-size: 35rpx;
font-size: 24rpx; margin-top: 30rpx;
margin-top: 16rpx;
margin-bottom: 30rpx;
} }
.topic-list .price{ .topic-list .desc {
display: block; display: block;
text-align: center; text-align: center;
width: 100%; position: relative;
height: 27rpx; width: auto;
line-height: 27rpx; height: 24rpx;
overflow: hidden; line-height: 24rpx;
color: #b4282d; overflow: hidden;
font-size: 27rpx; color: #999;
font-size: 24rpx;
margin-top: 16rpx;
margin-bottom: 30rpx;
} }
.topic-list .price {
display: block;
text-align: center;
width: 100%;
height: 27rpx;
line-height: 27rpx;
overflow: hidden;
color: #b4282d;
font-size: 27rpx;
}
.page{ .page {
width: 750rpx; width: 750rpx;
height: 108rpx; height: 108rpx;
background: #fff; background: #fff;
margin-bottom: 20rpx; margin-bottom: 20rpx;
} }
.page view{ .page view {
height: 108rpx; height: 108rpx;
width: 50%; width: 50%;
float: left; float: left;
font-size: 29rpx; font-size: 29rpx;
color: #333; color: #333;
text-align: center; text-align: center;
line-height: 108rpx; line-height: 108rpx;
} }
.page .prev{ .page .prev {
border-right: 1px solid #D9D9D9; border-right: 1px solid #d9d9d9;
} }
.page .disabled{ .page .disabled {
color: #ccc; color: #ccc;
} }
\ No newline at end of file
<scroll-view class="container"> <scroll-view class="container">
<scroll-view class="content"> <scroll-view class="content">
<import src="../../lib/wxParse/wxParse.wxml"/> <import src="../../lib/wxParse/wxParse.wxml" />
<template is="wxParse" data="{{wxParseData:topicDetail.nodes}}"/> <template is="wxParse" data="{{wxParseData:topicDetail.nodes}}" />
</scroll-view> </scroll-view>
<view class="topic-goods"> <view class="topic-goods">
</view> </view>
......
.content {
width: 100%;
height: auto;
.content{ font-size: 0;
width: 100%;
height: auto;
font-size: 0;
}
.content image{
display: inline-block;
width: 100%;
} }
.comments{ .content image {
width: 100%; display: inline-block;
height: auto; width: 100%;
padding-left:30rpx;
background: #fff;
margin-top: 20rpx;
} }
.comments .h{ .comments {
height: 93rpx; width: 100%;
line-height: 93rpx; height: auto;
width: 720rpx; padding-left: 30rpx;
padding-right: 30rpx; background: #fff;
border-bottom: 1px solid #d9d9d9; margin-top: 20rpx;
} }
.comments .h .t{ .comments .h {
display: block; height: 93rpx;
float: left; line-height: 93rpx;
width: 50%; width: 720rpx;
font-size: 29rpx; padding-right: 30rpx;
color: #333; border-bottom: 1px solid #d9d9d9;
} }
.comments .h .i{ .comments .h .t {
display: block; display: block;
float: right; float: left;
margin-top: 30rpx; width: 50%;
width: 33rpx; font-size: 29rpx;
height: 33rpx; color: #333;
} }
.comments .b{ .comments .h .i {
height: auto; display: block;
width: 720rpx; float: right;
margin-top: 30rpx;
width: 33rpx;
height: 33rpx;
} }
.comments .item{ .comments .b {
height: auto; height: auto;
width: 720rpx; width: 720rpx;
overflow: hidden;
border-bottom: 1px solid #d9d9d9;
} }
.comments .info{ .comments .item {
height: 127rpx; height: auto;
width: 100%; width: 720rpx;
padding: 33rpx 0 27rpx 0; overflow: hidden;
border-bottom: 1px solid #d9d9d9;
} }
.comments .user{ .comments .info {
float: left; height: 127rpx;
width: auto; width: 100%;
height: 67rpx; padding: 33rpx 0 27rpx 0;
line-height: 67rpx;
font-size: 0;
} }
.comments .user .avatar{ .comments .user {
display: block; float: left;
float: left; width: auto;
width: 67rpx; height: 67rpx;
height: 67rpx; line-height: 67rpx;
margin-right: 17rpx; font-size: 0;
border-radius: 50%;
} }
.comments .user .nickname{ .comments .user .avatar {
display: block; display: block;
width: auto; float: left;
float: left; width: 67rpx;
height: 66rpx; height: 67rpx;
overflow: hidden; margin-right: 17rpx;
font-size: 29rpx; border-radius: 50%;
line-height: 66rpx;
} }
.comments .time{ .comments .user .nickname {
display: block; display: block;
float: right; width: auto;
width: auto; float: left;
height: 67rpx; height: 66rpx;
line-height: 67rpx; overflow: hidden;
color: #7f7f7f; font-size: 29rpx;
font-size: 25rpx; line-height: 66rpx;
margin-right: 30rpx;
} }
.comments .comment{ .comments .time {
width: 720rpx; display: block;
padding-right: 30rpx; float: right;
line-height: 45.8rpx; width: auto;
margin-bottom: 30rpx; height: 67rpx;
font-size: 29rpx; line-height: 67rpx;
color: #333; color: #7f7f7f;
font-size: 25rpx;
margin-right: 30rpx;
} }
.comments .load{ .comments .comment {
width: 720rpx; width: 720rpx;
height: 108rpx; padding-right: 30rpx;
line-height: 108rpx; line-height: 45.8rpx;
text-align: center; margin-bottom: 30rpx;
font-size: 38.5rpx; font-size: 29rpx;
color: #333;
} }
.no-comments{ .comments .load {
height: 297rpx; width: 720rpx;
height: 108rpx;
line-height: 108rpx;
text-align: center;
font-size: 38.5rpx;
} }
.no-comments .txt{ .no-comments {
height: 43rpx; height: 297rpx;
line-height: 43rpx; }
display: block;
width: 100%; .no-comments .txt {
text-align: center; height: 43rpx;
font-size: 29rpx; line-height: 43rpx;
color: #7f7f7f; display: block;
} width: 100%;
text-align: center;
.no-comments .icon{ font-size: 29rpx;
margin: 48rpx auto 18rpx auto; color: #7f7f7f;
height: 130rpx;
display: block;
width: 115rpx;
}
.rec-box{
width: 690rpx;
height: auto;
margin: 0 30rpx;
} }
.rec-box .h{ .no-comments .icon {
position: relative; margin: 48rpx auto 18rpx auto;
width: 690rpx; height: 130rpx;
height: 110rpx; display: block;
/*border-bottom: 1px solid #d0d0d0;*/ width: 115rpx;
margin-bottom: 32rpx; }
.rec-box {
width: 690rpx;
height: auto;
margin: 0 30rpx;
} }
.rec-box .h .txt{ .rec-box .h {
display: inline-block; position: relative;
position: absolute; width: 690rpx;
background: #f4f4f4; height: 110rpx;
top: 59rpx; /*border-bottom: 1px solid #d0d0d0;*/
left: 200rpx; margin-bottom: 32rpx;
width: 290rpx; }
height: 45rpx;
line-height: 45rpx; .rec-box .h .txt {
font-size: 30rpx; display: inline-block;
color: #999; position: absolute;
text-align: center; background: #f4f4f4;
} top: 59rpx;
left: 200rpx;
.rec-box .b .item{ width: 290rpx;
width: 690rpx; height: 45rpx;
height: auto; line-height: 45rpx;
padding: 24rpx 24rpx 30rpx 24rpx; font-size: 30rpx;
background: #fff; color: #999;
margin-bottom: 30rpx; text-align: center;
} }
.rec-box .b .item .img{ .rec-box .b .item {
height: 355rpx; width: 690rpx;
width: 642rpx; height: auto;
} padding: 24rpx 24rpx 30rpx 24rpx;
background: #fff;
.rec-box .b .item .title{ margin-bottom: 30rpx;
display: block; }
margin-top: 30rpx;
height: 30rpx; .rec-box .b .item .img {
width: 642rpx; height: 355rpx;
font-size: 28rpx; width: 642rpx;
}
.rec-box .b .item .title {
display: block;
margin-top: 30rpx;
height: 30rpx;
width: 642rpx;
font-size: 28rpx;
} }
@import "../../lib/wxParse/wxParse.wxss"; @import "../../lib/wxParse/wxParse.wxss";
...@@ -3,95 +3,95 @@ var api = require('../../../config/api.js'); ...@@ -3,95 +3,95 @@ var api = require('../../../config/api.js');
var app = getApp(); var app = getApp();
Page({ Page({
data: { data: {
addressList: [], addressList: [],
}, },
onLoad: function(options) { onLoad: function(options) {
// 页面初始化 options为页面跳转所带来的参数 // 页面初始化 options为页面跳转所带来的参数
}, },
onReady: function() { onReady: function() {
// 页面渲染完成 // 页面渲染完成
}, },
onShow: function() { onShow: function() {
// 页面显示 // 页面显示
this.getAddressList(); this.getAddressList();
}, },
onPullDownRefresh() { onPullDownRefresh() {
wx.showNavigationBarLoading() //在标题栏中显示加载 wx.showNavigationBarLoading() //在标题栏中显示加载
this.getAddressList(); this.getAddressList();
wx.hideNavigationBarLoading() //完成停止加载 wx.hideNavigationBarLoading() //完成停止加载
wx.stopPullDownRefresh() //停止下拉刷新 wx.stopPullDownRefresh() //停止下拉刷新
}, },
getAddressList() { getAddressList() {
let that = this; let that = this;
util.request(api.AddressList).then(function(res) { util.request(api.AddressList).then(function(res) {
if (res.errno === 0) { if (res.errno === 0) {
that.setData({ that.setData({
addressList: res.data addressList: res.data
});
}
}); });
} },
});
},
addressAddOrUpdate(event) { addressAddOrUpdate(event) {
//返回之前,先取出上一页对象,并设置addressId //返回之前,先取出上一页对象,并设置addressId
var pages = getCurrentPages(); var pages = getCurrentPages();
var prevPage = pages[pages.length - 2]; var prevPage = pages[pages.length - 2];
if (prevPage.route == "pages/shopping/checkout/checkout") { if (prevPage.route == "pages/shopping/checkout/checkout") {
try { try {
wx.setStorageSync('addressId', event.currentTarget.dataset.addressId); wx.setStorageSync('addressId', event.currentTarget.dataset.addressId);
} catch (e) { } catch (e) {
} }
let addressId = event.currentTarget.dataset.addressId; let addressId = event.currentTarget.dataset.addressId;
if (addressId && addressId != 0) { if (addressId && addressId != 0) {
wx.navigateBack(); wx.navigateBack();
} else { } else {
wx.navigateTo({ wx.navigateTo({
url: '/pages/ucenter/addressAdd/addressAdd?id=' + addressId url: '/pages/ucenter/addressAdd/addressAdd?id=' + addressId
}) })
}
} else {
wx.navigateTo({
url: '/pages/ucenter/addressAdd/addressAdd?id=' + event.currentTarget.dataset.addressId
})
}
},
deleteAddress(event) {
console.log(event.target);
let that = this;
wx.showModal({
title: '',
content: '确定要删除地址?',
success: function(res) {
if (res.confirm) {
let addressId = event.target.dataset.addressId;
util.request(api.AddressDelete, {
id: addressId
}, 'POST').then(function(res) {
if (res.errno === 0) {
that.getAddressList();
wx.removeStorage({
key: 'addressId',
success: function(res) {},
})
} }
}); } else {
console.log('用户点击确定') wx.navigateTo({
url: '/pages/ucenter/addressAdd/addressAdd?id=' + event.currentTarget.dataset.addressId
})
} }
} },
}); deleteAddress(event) {
return false; console.log(event.target);
let that = this;
wx.showModal({
title: '',
content: '确定要删除地址?',
success: function(res) {
if (res.confirm) {
let addressId = event.target.dataset.addressId;
util.request(api.AddressDelete, {
id: addressId
}, 'POST').then(function(res) {
if (res.errno === 0) {
that.getAddressList();
wx.removeStorage({
key: 'addressId',
success: function(res) {},
})
}
});
console.log('用户点击确定')
}
}
});
return false;
}, },
onHide: function() { onHide: function() {
// 页面隐藏 // 页面隐藏
}, },
onUnload: function() { onUnload: function() {
// 页面关闭 // 页面关闭
} }
}); });
\ No newline at end of file
<view class="container"> <view class="container">
<view class="address-list" wx:if="{{ addressList.length > 0 }}"> <view class="address-list" wx:if="{{ addressList.length > 0 }}">
<view class="item" wx:for="{{addressList}}" wx:key="id" bindtap="addressAddOrUpdate" data-address-id="{{item.id}}"> <view class="item" wx:for="{{addressList}}" wx:key="id" bindtap="addressAddOrUpdate" data-address-id="{{item.id}}">
<view class="l"> <view class="l">
<view class="name">{{item.name}}</view> <view class="name">{{item.name}}</view>
<view class="default" wx:if="{{item.isDefault}}">默认</view> <view class="default" wx:if="{{item.isDefault}}">默认</view>
</view> </view>
<view class="c"> <view class="c">
<view class="mobile">{{item.mobile}}</view> <view class="mobile">{{item.mobile}}</view>
<view class="address">{{item.detailedAddress}}</view> <view class="address">{{item.detailedAddress}}</view>
</view> </view>
<view class="r"> <view class="r">
<image catchtap="deleteAddress" data-address-id="{{item.id}}" class="del" src="/static/images/del-address.png"></image> <image catchtap="deleteAddress" data-address-id="{{item.id}}" class="del" src="/static/images/del-address.png"></image>
</view> </view>
</view>
</view> </view>
<view class="empty-view" wx:if="{{ addressList.length <= 0 }}"> </view>
<image class="icon" src="http://yanxuan.nosdn.127.net/hxm/yanxuan-wap/p/20161201/style/img/icon-normal/noAddress-26d570cefa.png"></image> <view class="empty-view" wx:if="{{ addressList.length <= 0 }}">
<text class="text">收货地址在哪里</text> <image class="icon" src="http://yanxuan.nosdn.127.net/hxm/yanxuan-wap/p/20161201/style/img/icon-normal/noAddress-26d570cefa.png"></image>
</view> <text class="text">收货地址在哪里</text>
<view class="add-address" bindtap="addressAddOrUpdate" data-address-id="0">新建</view> </view>
</view> <view class="add-address" bindtap="addressAddOrUpdate" data-address-id="0">新建</view>
</view>
\ No newline at end of file
page{ page {
height: 100%; height: 100%;
width: 100%; width: 100%;
background: #f4f4f4; background: #f4f4f4;
} }
.container{ .container {
height: 100%; height: 100%;
width: 100%; width: 100%;
} }
.address-list{ .address-list {
padding-left: 31.25rpx; padding-left: 31.25rpx;
background: #fff url(http://yanxuan.nosdn.127.net/hxm/yanxuan-wap/p/20161201/style/img/icon-normal/address-bg-bd30f2bfeb.png) 0 0 repeat-x; background: #fff url(http://yanxuan.nosdn.127.net/hxm/yanxuan-wap/p/20161201/style/img/icon-normal/address-bg-bd30f2bfeb.png) 0 0 repeat-x;
background-size: auto 10.5rpx; background-size: auto 10.5rpx;
margin-bottom: 90rpx; margin-bottom: 90rpx;
} }
.address-list .item{ .address-list .item {
height: 156.55rpx; height: 156.55rpx;
align-items: center; align-items: center;
display: flex; display: flex;
border-bottom: 1rpx solid #DCD9D9; border-bottom: 1rpx solid #dcd9d9;
} }
.address-list .l{ .address-list .l {
width: 125rpx; width: 125rpx;
height: 80rpx; height: 80rpx;
overflow: hidden; overflow: hidden;
} }
.address-list .name{ .address-list .name {
width: 125rpx; width: 125rpx;
height: 43rpx; height: 43rpx;
font-size: 29rpx; font-size: 29rpx;
margin-bottom: 5.2rpx; margin-bottom: 5.2rpx;
text-overflow: ellipsis; text-overflow: ellipsis;
white-space: nowrap; white-space: nowrap;
overflow: hidden; overflow: hidden;
} }
.address-list .default{ .address-list .default {
width: 62.5rpx; width: 62.5rpx;
height: 33rpx; height: 33rpx;
line-height: 28rpx; line-height: 28rpx;
text-align: center; text-align: center;
font-size: 20rpx; font-size: 20rpx;
color: #a78845; color: #a78845;
border: 1rpx solid #a78845; border: 1rpx solid #a78845;
visibility: visible; visibility: visible;
} }
.address-list .c {
.address-list .c{ flex: 1;
flex: 1; height: auto;
height: auto; overflow: hidden;
overflow: hidden;
} }
.address-list .mobile{ .address-list .mobile {
height: 29rpx;
height: 29rpx; font-size: 29rpx;
font-size: 29rpx; line-height: 29rpx;
line-height: 29rpx; overflow: hidden;
overflow: hidden; margin-bottom: 6.25rpx;
margin-bottom: 6.25rpx;
} }
.address-list .address{ .address-list .address {
height: 37rpx; height: 37rpx;
font-size: 25rpx; font-size: 25rpx;
line-height: 37rpx; line-height: 37rpx;
overflow: hidden; overflow: hidden;
} }
.address-list .r{ .address-list .r {
width: 52rpx; width: 52rpx;
height: auto; height: auto;
overflow: hidden; overflow: hidden;
margin-right: 16.5rpx; margin-right: 16.5rpx;
} }
.address-list .del{ .address-list .del {
display: block; display: block;
width: 52rpx; width: 52rpx;
height: 52rpx; height: 52rpx;
} }
.add-address{ .add-address {
background: #a78845; background: #a78845;
text-align: center; text-align: center;
width: 100%; width: 100%;
height: 99rpx; height: 99rpx;
line-height: 99rpx; line-height: 99rpx;
position: fixed; position: fixed;
border-radius: 0; border-radius: 0;
border: none; border: none;
color: #fff; color: #fff;
font-size: 29rpx; font-size: 29rpx;
bottom: 0; bottom: 0;
left:0; left: 0;
} }
.empty-view{ .empty-view {
height: 100%; height: 100%;
width: 100%; width: 100%;
display: flex; display: flex;
...@@ -112,15 +108,15 @@ page{ ...@@ -112,15 +108,15 @@ page{
justify-content: center; justify-content: center;
} }
.empty-view .icon{ .empty-view .icon {
height: 248rpx; height: 248rpx;
width: 258rpx; width: 258rpx;
margin-bottom: 10rpx; margin-bottom: 10rpx;
} }
.empty-view .text{ .empty-view .text {
width: auto; width: auto;
font-size: 28rpx; font-size: 28rpx;
line-height: 35rpx; line-height: 35rpx;
color: #999; color: #999;
} }
\ No newline at end of file
...@@ -20,10 +20,24 @@ Page({ ...@@ -20,10 +20,24 @@ Page({
}, },
addressId: 0, addressId: 0,
openSelectRegion: false, openSelectRegion: false,
selectRegionList: [ selectRegionList: [{
{ id: 0, name: '省份', pid: 1, type: 1 }, id: 0,
{ id: 0, name: '城市', pid: 1, type: 2 }, name: '省份',
{ id: 0, name: '区县', pid: 1, type: 3 } pid: 1,
type: 1
},
{
id: 0,
name: '城市',
pid: 1,
type: 2
},
{
id: 0,
name: '区县',
pid: 1,
type: 3
}
], ],
regionType: 1, regionType: 1,
regionList: [], regionList: [],
...@@ -59,7 +73,9 @@ Page({ ...@@ -59,7 +73,9 @@ Page({
}, },
getAddressDetail() { getAddressDetail() {
let that = this; let that = this;
util.request(api.AddressDetail, { id: that.data.addressId }).then(function (res) { util.request(api.AddressDetail, {
id: that.data.addressId
}).then(function(res) {
if (res.errno === 0) { if (res.errno === 0) {
if (res.data) { if (res.data) {
that.setData({ that.setData({
...@@ -110,10 +126,24 @@ Page({ ...@@ -110,10 +126,24 @@ Page({
this.getRegionList(address.cityId); this.getRegionList(address.cityId);
} else { } else {
this.setData({ this.setData({
selectRegionList: [ selectRegionList: [{
{ id: 0, name: '省份', pid: 0, type: 1 }, id: 0,
{ id: 0, name: '城市', pid: 0, type: 2 }, name: '省份',
{ id: 0, name: '区县', pid: 0, type: 3 } pid: 0,
type: 1
},
{
id: 0,
name: '城市',
pid: 0,
type: 2
},
{
id: 0,
name: '区县',
pid: 0,
type: 3
}
], ],
regionType: 1 regionType: 1
}) })
...@@ -123,7 +153,7 @@ Page({ ...@@ -123,7 +153,7 @@ Page({
this.setRegionDoneStatus(); this.setRegionDoneStatus();
}, },
onLoad: function (options) { onLoad: function(options) {
// 页面初始化 options为页面跳转所带来的参数 // 页面初始化 options为页面跳转所带来的参数
console.log(options) console.log(options)
if (options.id && options.id != 0) { if (options.id && options.id != 0) {
...@@ -133,7 +163,7 @@ Page({ ...@@ -133,7 +163,7 @@ Page({
this.getAddressDetail(); this.getAddressDetail();
} }
}, },
onReady: function () { onReady: function() {
}, },
selectRegionType(event) { selectRegionType(event) {
...@@ -240,7 +270,9 @@ Page({ ...@@ -240,7 +270,9 @@ Page({
getRegionList(regionId) { getRegionList(regionId) {
let that = this; let that = this;
let regionType = that.data.regionType; let regionType = that.data.regionType;
util.request(api.RegionList, { pid: regionId }).then(function (res) { util.request(api.RegionList, {
pid: regionId
}).then(function(res) {
if (res.errno === 0) { if (res.errno === 0) {
that.setData({ that.setData({
regionList: res.data.map(item => { regionList: res.data.map(item => {
...@@ -302,7 +334,7 @@ Page({ ...@@ -302,7 +334,7 @@ Page({
areaId: address.areaId, areaId: address.areaId,
address: address.address, address: address.address,
isDefault: address.isDefault isDefault: address.isDefault
}, 'POST').then(function (res) { }, 'POST').then(function(res) {
if (res.errno === 0) { if (res.errno === 0) {
//返回之前,先取出上一页对象,并设置addressId //返回之前,先取出上一页对象,并设置addressId
var pages = getCurrentPages(); var pages = getCurrentPages();
...@@ -325,15 +357,15 @@ Page({ ...@@ -325,15 +357,15 @@ Page({
}); });
}, },
onShow: function () { onShow: function() {
// 页面显示 // 页面显示
}, },
onHide: function () { onHide: function() {
// 页面隐藏 // 页面隐藏
}, },
onUnload: function () { onUnload: function() {
// 页面关闭 // 页面关闭
} }
......
<view class="add-address"> <view class="add-address">
<view class="add-form"> <view class="add-form">
<view class="form-item"> <view class="form-item">
<input class="input" bindinput="bindinputName" placeholder="姓名" value="{{address.name}}" auto-focus/> <input class="input" bindinput="bindinputName" placeholder="姓名" value="{{address.name}}" auto-focus/>
</view>
<view class="form-item">
<input class="input" bindinput="bindinputMobile" value="{{address.mobile}}" placeholder="手机号码"/>
</view>
<view class="form-item">
<input class="input" value="{{address.provinceName + address.cityName + address.areaName}}" disabled="true" bindtap="chooseRegion" placeholder="省份、城市、区县"/>
</view>
<view class="form-item">
<input class="input" bindinput="bindinputAddress" value="{{address.address}}" placeholder="详细地址, 如街道、楼盘号等"/>
</view>
<view class="form-default">
<text bindtap="bindIsDefault" class="default-input {{address.isDefault == 1 ? 'selected' : ''}}">设为默认地址</text>
</view>
</view> </view>
<view class="form-item">
<view class="btns"> <input class="input" bindinput="bindinputMobile" value="{{address.mobile}}" placeholder="手机号码" />
<button class="cannel" bindtap="cancelAddress">取消</button> </view>
<button class="save" bindtap="saveAddress">保存</button> <view class="form-item">
<input class="input" value="{{address.provinceName + address.cityName + address.areaName}}" disabled="true" bindtap="chooseRegion" placeholder="省份、城市、区县" />
</view>
<view class="form-item">
<input class="input" bindinput="bindinputAddress" value="{{address.address}}" placeholder="详细地址, 如街道、楼盘号等" />
</view>
<view class="form-default">
<text bindtap="bindIsDefault" class="default-input {{address.isDefault == 1 ? 'selected' : ''}}">设为默认地址</text>
</view> </view>
</view>
<view class="region-select" wx:if="{{openSelectRegion}}"> <view class="btns">
<view class="hd"> <button class="cannel" bindtap="cancelAddress">取消</button>
<view class="region-selected"> <button class="save" bindtap="saveAddress">保存</button>
<view class="item {{item.id == 0 ? 'disabled' : ''}} {{(regionType -1) === index ? 'selected' : ''}}" bindtap="selectRegionType" data-region-type-index="{{index}}" wx:for="{{selectRegionList}}" wx:key="id">{{item.name}}</view> </view>
</view>
<view class="done {{selectRegionDone ? '' : 'disabled'}}" bindtap="doneSelectRegion">确定</view> <view class="region-select" wx:if="{{openSelectRegion}}">
<view class="hd">
<view class="region-selected">
<view class="item {{item.id == 0 ? 'disabled' : ''}} {{(regionType -1) === index ? 'selected' : ''}}" bindtap="selectRegionType" data-region-type-index="{{index}}" wx:for="{{selectRegionList}}" wx:key="id">{{item.name}}</view>
</view> </view>
<view class="bd"> <view class="done {{selectRegionDone ? '' : 'disabled'}}" bindtap="doneSelectRegion">确定</view>
</view>
<view class="bd">
<scroll-view scroll-y class="region-list"> <scroll-view scroll-y class="region-list">
<view class="item {{item.selected ? 'selected' : ''}}" bindtap="selectRegion" data-region-index="{{index}}" wx:for="{{regionList}}" wx:key="id">{{item.name}}</view> <view class="item {{item.selected ? 'selected' : ''}}" bindtap="selectRegion" data-region-index="{{index}}" wx:for="{{regionList}}" wx:key="id">{{item.name}}</view>
</scroll-view> </scroll-view>
</view>
</view> </view>
</view>
</view> </view>
<view class="bg-mask" bindtap="cancelSelectRegion" wx:if="{{openSelectRegion}}"></view> <view class="bg-mask" bindtap="cancelSelectRegion" wx:if="{{openSelectRegion}}"></view>
\ No newline at end of file
page{ page {
height: 100%; height: 100%;
background: #f4f4f4; background: #f4f4f4;
}
.add-address .add-form{
background: #fff;
width: 100%;
height: auto;
overflow: hidden;
} }
.add-address .form-item{ .add-address .add-form {
height: 116rpx; background: #fff;
padding-left: 31.25rpx; width: 100%;
border-bottom: 1px solid #d9d9d9; height: auto;
display: flex; overflow: hidden;
align-items: center;
padding-right: 31.25rpx;
} }
.add-address .input{ .add-address .form-item {
flex: 1; height: 116rpx;
height: 44rpx; padding-left: 31.25rpx;
line-height: 44rpx; border-bottom: 1px solid #d9d9d9;
overflow: hidden; display: flex;
align-items: center;
padding-right: 31.25rpx;
} }
.add-address .form-default{ .add-address .input {
border-bottom: 1px solid #d9d9d9; flex: 1;
height: 96rpx; height: 44rpx;
background: #fafafa; line-height: 44rpx;
padding-top: 28rpx; overflow: hidden;
font-size: 28rpx;
} }
.default-input{ .add-address .form-default {
margin: 0 auto; border-bottom: 1px solid #d9d9d9;
display: block; height: 96rpx;
width: 240rpx; background: #fafafa;
height: 40rpx; padding-top: 28rpx;
padding-left: 50rpx; font-size: 28rpx;
line-height: 40rpx;
background: url(http://yanxuan.nosdn.127.net/hxm/yanxuan-wap/p/20161201/style/img/sprites/checkbox-sed825af9d3-a6b8540d42.png) 1rpx -448rpx no-repeat;
background-size: 38rpx 486rpx;
font-size: 28rpx;
} }
.default-input.selected{ .default-input {
background: url(http://yanxuan.nosdn.127.net/hxm/yanxuan-wap/p/20161201/style/img/sprites/checkbox-sed825af9d3-a6b8540d42.png) 0 -192rpx no-repeat; margin: 0 auto;
background-size: 38rpx 486rpx; display: block;
width: 240rpx;
height: 40rpx;
padding-left: 50rpx;
line-height: 40rpx;
background: url(http://yanxuan.nosdn.127.net/hxm/yanxuan-wap/p/20161201/style/img/sprites/checkbox-sed825af9d3-a6b8540d42.png) 1rpx -448rpx no-repeat;
background-size: 38rpx 486rpx;
font-size: 28rpx;
} }
.add-address .btns{ .default-input.selected {
position: fixed; background: url(http://yanxuan.nosdn.127.net/hxm/yanxuan-wap/p/20161201/style/img/sprites/checkbox-sed825af9d3-a6b8540d42.png) 0 -192rpx no-repeat;
bottom: 0; background-size: 38rpx 486rpx;
left: 0;
overflow: hidden;
display: flex;
height: 100rpx;
width: 100%;
} }
.add-address .cannel,.add-address .save{ .add-address .btns {
flex: 1; position: fixed;
height: 100rpx; bottom: 0;
text-align: center; left: 0;
line-height: 100rpx; overflow: hidden;
font-size: 28rpx; display: flex;
color: #fff; height: 100rpx;
border:none; width: 100%;
border-radius: 0;
} }
.add-address .cannel{ .add-address .cannel, .add-address .save {
background: #3F3F3F; flex: 1;
height: 100rpx;
text-align: center;
line-height: 100rpx;
font-size: 28rpx;
color: #fff;
border: none;
border-radius: 0;
} }
.add-address .save{ .add-address .cannel {
background: #a78845; background: #3f3f3f;
} }
.add-address .save {
background: #a78845;
}
.region-select{ .region-select {
width: 100%; width: 100%;
height: 600rpx; height: 600rpx;
background: #fff; background: #fff;
position: fixed; position: fixed;
z-index: 10; z-index: 10;
left:0; left: 0;
bottom: 0; bottom: 0;
} }
.region-select .hd{ .region-select .hd {
height: 108rpx; height: 108rpx;
width: 100%; width: 100%;
border-bottom: 1px solid #f4f4f4; border-bottom: 1px solid #f4f4f4;
padding: 46rpx 30rpx 0 30rpx; padding: 46rpx 30rpx 0 30rpx;
} }
.region-select .region-selected{ .region-select .region-selected {
float: left; float: left;
height: 60rpx; height: 60rpx;
display: flex; display: flex;
} }
.region-select .region-selected .item{ .region-select .region-selected .item {
max-width: 140rpx; max-width: 140rpx;
margin-right: 30rpx; margin-right: 30rpx;
text-align: left; text-align: left;
...@@ -112,19 +112,19 @@ page{ ...@@ -112,19 +112,19 @@ page{
color: #333; color: #333;
font-size: 28rpx; font-size: 28rpx;
overflow: hidden; overflow: hidden;
text-overflow: ellipsis; text-overflow: ellipsis;
white-space: nowrap; white-space: nowrap;
} }
.region-select .region-selected .item.disabled{ .region-select .region-selected .item.disabled {
color: #999; color: #999;
} }
.region-select .region-selected .item.selected{ .region-select .region-selected .item.selected {
color: #a78845; color: #a78845;
} }
.region-select .done{ .region-select .done {
float: right; float: right;
height: 60rpx; height: 60rpx;
width: 60rpx; width: 60rpx;
...@@ -136,21 +136,21 @@ page{ ...@@ -136,21 +136,21 @@ page{
font-size: 28rpx; font-size: 28rpx;
} }
.region-select .done.disabled{ .region-select .done.disabled {
color: #999; color: #999;
} }
.region-select .bd{ .region-select .bd {
height: 492rpx; height: 492rpx;
width: 100%; width: 100%;
padding: 0 30rpx; padding: 0 30rpx;
} }
.region-select .region-list{ .region-select .region-list {
height: 492rpx; height: 492rpx;
} }
.region-select .region-list .item{ .region-select .region-list .item {
width: 100%; width: 100%;
height: 104rpx; height: 104rpx;
line-height: 104rpx; line-height: 104rpx;
...@@ -159,17 +159,16 @@ page{ ...@@ -159,17 +159,16 @@ page{
font-size: 28rpx; font-size: 28rpx;
} }
.region-select .region-list .item.selected{ .region-select .region-list .item.selected {
color: #b4282d; color: #b4282d;
} }
.bg-mask {
.bg-mask{
height: 100%; height: 100%;
width: 100%; width: 100%;
background: rgba(0, 0, 0, 0.4); background: rgba(0, 0, 0, 0.4);
position: fixed; position: fixed;
top:0; top: 0;
left:0; left: 0;
z-index: 8; z-index: 8;
} }
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
</view> </view>
</view> </view>
<view class="collect-list" wx:else> <view class="collect-list" wx:else>
<view class="item" bindtap="openGoods" bindtouchstart="touchStart" bindtouchend="touchEnd" wx:for="{{collectList}}" wx:key="id" data-index="{{index}}"> <view class="item" bindtap="openGoods" bindtouchstart="touchStart" bindtouchend="touchEnd" wx:for="{{collectList}}" wx:key="id" data-index="{{index}}">
<image class="img" src="{{item.picUrl}}"></image> <image class="img" src="{{item.picUrl}}"></image>
<view class="info"> <view class="info">
<view class="name">{{item.name}}</view> <view class="name">{{item.name}}</view>
...@@ -16,4 +16,4 @@ ...@@ -16,4 +16,4 @@
</view> </view>
</view> </view>
</view> </view>
\ No newline at end of file
page{ page {
background: #f4f4f4; background: #f4f4f4;
min-height: 100%; min-height: 100%;
} }
.container{ .container {
background: #f4f4f4; background: #f4f4f4;
min-height: 100%; min-height: 100%;
width: 100%; width: 100%;
height: auto; height: auto;
overflow: hidden; overflow: hidden;
} }
.no-collect {
.no-collect{ width: 100%;
width: 100%; height: auto;
height: auto; margin: 0 auto;
margin: 0 auto;
} }
.no-collect .c{ .no-collect .c {
width: 100%; width: 100%;
height: auto; height: auto;
margin-top: 200rpx; margin-top: 200rpx;
} }
.no-collect .c image{ .no-collect .c image {
margin: 0 auto; margin: 0 auto;
display: block; display: block;
text-align: center; text-align: center;
width: 258rpx; width: 258rpx;
height: 258rpx; height: 258rpx;
} }
.no-collect .c text{ .no-collect .c text {
margin: 0 auto; margin: 0 auto;
display: block; display: block;
width: 258rpx; width: 258rpx;
height: 29rpx; height: 29rpx;
line-height: 29rpx; line-height: 29rpx;
text-align: center; text-align: center;
font-size: 29rpx; font-size: 29rpx;
color: #999; color: #999;
} }
.collect-list{ .collect-list {
width: 100%; width: 100%;
height: auto; height: auto;
overflow: hidden; overflow: hidden;
...@@ -52,7 +51,7 @@ page{ ...@@ -52,7 +51,7 @@ page{
border-top: 1px solid #e1e1e1; border-top: 1px solid #e1e1e1;
} }
.item{ .item {
height: 212rpx; height: 212rpx;
width: 720rpx; width: 720rpx;
background: #fff; background: #fff;
...@@ -60,17 +59,17 @@ page{ ...@@ -60,17 +59,17 @@ page{
border-bottom: 1px solid #e1e1e1; border-bottom: 1px solid #e1e1e1;
} }
.item:last-child{ .item:last-child {
border-bottom: 1px solid #fff; border-bottom: 1px solid #fff;
} }
.item .img{ .item .img {
float: left; float: left;
width: 150rpx; width: 150rpx;
height: 150rpx; height: 150rpx;
} }
.item .info{ .item .info {
float: right; float: right;
width: 540rpx; width: 540rpx;
height: 150rpx; height: 150rpx;
...@@ -80,21 +79,20 @@ page{ ...@@ -80,21 +79,20 @@ page{
padding-left: 20rpx; padding-left: 20rpx;
} }
.item .info .name{ .item .info .name {
font-size: 28rpx; font-size: 28rpx;
color: #333; color: #333;
line-height: 40rpx; line-height: 40rpx;
} }
.item .info .subtitle {
.item .info .subtitle{
margin-top: 8rpx; margin-top: 8rpx;
font-size: 24rpx; font-size: 24rpx;
color: #888; color: #888;
line-height: 40rpx; line-height: 40rpx;
} }
.item .info .price{ .item .info .price {
margin-top: 8rpx; margin-top: 8rpx;
font-size: 28rpx; font-size: 28rpx;
color: #333; color: #333;
......
var util = require('../../../utils/util.js'); var util = require('../../../utils/util.js');
var api = require('../../../config/api.js'); var api = require('../../../config/api.js');
var app = getApp(); var app = getApp();
Page({ Page({
data: { data: {
}, },
onLoad: function (options) { onLoad: function(options) {},
}, onReady: function() {
onReady: function () {
}, },
onShow: function () { onShow: function() {
}, },
onHide: function () { onHide: function() {
// 页面隐藏 // 页面隐藏
}, },
onUnload: function () { onUnload: function() {
// 页面关闭 // 页面关闭
} }
}) })
\ No newline at end of file
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
</view> </view>
</view> </view>
<view class="item"> <view class="item">
<view class="tag">新人专享</view> <view class="tag">新人专享</view>
<view class="content"> <view class="content">
<view class="left"> <view class="left">
......
page{ page {
background: #f4f4f4; background: #f4f4f4;
min-height: 100%; min-height: 100%;
} }
.container{ .container {
background: #f4f4f4; background: #f4f4f4;
min-height: 100%; min-height: 100%;
padding-top: 30rpx; padding-top: 30rpx;
} }
.coupon-form{ .coupon-form {
height: 110rpx; height: 110rpx;
width: 100%; width: 100%;
background: #fff; background: #fff;
...@@ -19,7 +19,7 @@ page{ ...@@ -19,7 +19,7 @@ page{
display: flex; display: flex;
} }
.input-box{ .input-box {
flex: 1; flex: 1;
height: 70rpx; height: 70rpx;
color: #333; color: #333;
...@@ -31,7 +31,7 @@ page{ ...@@ -31,7 +31,7 @@ page{
margin-right: 30rpx; margin-right: 30rpx;
} }
.input-box .coupon-sn{ .input-box .coupon-sn {
position: absolute; position: absolute;
top: 10rpx; top: 10rpx;
left: 30rpx; left: 30rpx;
...@@ -42,7 +42,7 @@ page{ ...@@ -42,7 +42,7 @@ page{
font-size: 24rpx; font-size: 24rpx;
} }
.clear-icon{ .clear-icon {
position: absolute; position: absolute;
top: 21rpx; top: 21rpx;
right: 30rpx; right: 30rpx;
...@@ -50,9 +50,9 @@ page{ ...@@ -50,9 +50,9 @@ page{
height: 28rpx; height: 28rpx;
} }
.add-btn{ .add-btn {
height: 70rpx; height: 70rpx;
border:none; border: none;
width: 168rpx; width: 168rpx;
background: #b4282d; background: #b4282d;
border-radius: 0; border-radius: 0;
...@@ -61,11 +61,11 @@ page{ ...@@ -61,11 +61,11 @@ page{
font-size: 28rpx; font-size: 28rpx;
} }
.add-btn.disabled{ .add-btn.disabled {
background: #ccc; background: #ccc;
} }
.help{ .help {
height: 72rpx; height: 72rpx;
line-height: 72rpx; line-height: 72rpx;
text-align: right; text-align: right;
...@@ -76,7 +76,7 @@ page{ ...@@ -76,7 +76,7 @@ page{
font-size: 24rpx; font-size: 24rpx;
} }
.coupon-list{ .coupon-list {
width: 100%; width: 100%;
height: auto; height: auto;
overflow: hidden; overflow: hidden;
...@@ -84,18 +84,18 @@ page{ ...@@ -84,18 +84,18 @@ page{
padding-right: 30rpx; padding-right: 30rpx;
} }
.item{ .item {
position: relative; position: relative;
height: 290rpx; height: 290rpx;
width: 100%; width: 100%;
background: linear-gradient(to right,#cfa568,#e3bf79); background: linear-gradient(to right, #cfa568, #e3bf79);
margin-bottom: 30rpx; margin-bottom: 30rpx;
padding-top: 52rpx; padding-top: 52rpx;
} }
.tag{ .tag {
height: 32rpx; height: 32rpx;
background: #A48143; background: #a48143;
padding-left: 16rpx; padding-left: 16rpx;
padding-right: 16rpx; padding-right: 16rpx;
position: absolute; position: absolute;
...@@ -107,8 +107,7 @@ page{ ...@@ -107,8 +107,7 @@ page{
line-height: 32rpx; line-height: 32rpx;
} }
.content {
.content{
margin-top: 24rpx; margin-top: 24rpx;
margin-left: 40rpx; margin-left: 40rpx;
display: flex; display: flex;
...@@ -117,50 +116,50 @@ page{ ...@@ -117,50 +116,50 @@ page{
align-items: center; align-items: center;
} }
.content .left{ .content .left {
flex: 1; flex: 1;
} }
.name{ .name {
font-size: 44rpx; font-size: 44rpx;
color: #fff; color: #fff;
margin-bottom: 14rpx; margin-bottom: 14rpx;
} }
.time{ .time {
font-size: 24rpx; font-size: 24rpx;
color: rgba(255,255,255, 0.8); color: rgba(255, 255, 255, 0.8);
line-height: 30rpx; line-height: 30rpx;
} }
.content .right{ .content .right {
width: 162rpx; width: 162rpx;
} }
.go{ .go {
height: 48rpx; height: 48rpx;
border:none; border: none;
width: 162rpx; width: 162rpx;
background: rgba(255,255,255, 0.8); background: rgba(255, 255, 255, 0.8);
border-radius: 4rpx; border-radius: 4rpx;
line-height: 48rpx; line-height: 48rpx;
color: #b69150; color: #b69150;
font-size: 24rpx; font-size: 24rpx;
} }
.condition{ .condition {
position: absolute; position: absolute;
width: 100%; width: 100%;
bottom: 0; bottom: 0;
left:0; left: 0;
height: 78rpx; height: 78rpx;
background: rgba(0,0,0,.08); background: rgba(0, 0, 0, 0.08);
padding: 24rpx 40rpx; padding: 24rpx 40rpx;
display: flex; display: flex;
flex-direction: row; flex-direction: row;
} }
.condition .txt{ .condition .txt {
display: block; display: block;
height: 30rpx; height: 30rpx;
flex: 1; flex: 1;
...@@ -170,9 +169,8 @@ page{ ...@@ -170,9 +169,8 @@ page{
color: #fff; color: #fff;
} }
.condition .icon {
.condition .icon{
margin-left: 30rpx; margin-left: 30rpx;
width: 24rpx; width: 24rpx;
height: 24rpx; height: 24rpx;
} }
\ 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