Przeglądaj źródła

update

tags/2.2.4
LengYingxin 6 lat temu
rodzic
commit
4da823c84c
6 zmienionych plików z 223 dodań i 179 usunięć
  1. +1
    -1
      components/coupons/index.js
  2. +20
    -18
      components/coupons/index.wxml
  3. +9
    -4
      pages/coupons/details/index.js
  4. +8
    -4
      pages/coupons/details/index.wxml
  5. +144
    -124
      pages/coupons/details/index.wxss
  6. +41
    -28
      pages/index/rushToBuy/index.js

+ 1
- 1
components/coupons/index.js Wyświetl plik

@@ -17,7 +17,7 @@ Component({

},
methods: {
onLogin(e){
navigateTo(e){
let { id } = e.currentTarget.dataset.date;
wx.navigateTo({
url: `../../pages/coupons/details/index?id=${id}`,


+ 20
- 18
components/coupons/index.wxml Wyświetl plik

@@ -1,21 +1,23 @@
<view class="coupons">
<view class="coupons-img">
<image src="{{data.coverImg}}"></image>
</view>
<view class="coupons-info">
<view class="coupons-info-name">{{data.name}}</view>
<view class="coupons-info-price">
<text class="coupons-info-price-p">¥{{data.salePrice}}</text>
<text class="coupons-info-price-o">¥{{data.price}}</text>
<navigator url="/pages/coupons/details/index?id={{data.id}}">
<view class="coupons">
<view class="coupons-img">
<image src="{{data.coverImg}}"></image>
</view>
<view class="coupons-info-distance">
<text class="iconfont icon-dingweib"></text>
{{data.salePrice}}
<view class="coupons-info">
<view class="coupons-info-name">{{data.name}}</view>
<view class="coupons-info-price">
<text class="coupons-info-price-p">¥{{data.salePrice}}</text>
<text class="coupons-info-price-o">¥{{data.price}}</text>
</view>
<view class="coupons-info-distance">
<text class="iconfont icon-dingweib"></text>
{{data.salePrice}}
</view>
<view class="coupons-info-address">{{data.salePrice}}</view>
</view>
<view class="coupons-info-address">{{data.salePrice}}</view>
</view>
<view class="coupons-btn">
<i-button i-class="coupons-btn-gm" bind:click="onLogin" data-date='{{data}}'>购买</i-button>
<view class="coupons-btn">
<i-button i-class="coupons-btn-gm" bind:click="navigateTo" data-date='{{data}}'>购买</i-button>
</view>
<view class="coupons-border"></view>
</view>
<view class="coupons-border"></view>
</view>
</navigator>

+ 9
- 4
pages/coupons/details/index.js Wyświetl plik

@@ -3,20 +3,24 @@ var app = getApp()
const Http = require("../../../utils/HttpBasics")
Page({
data: {
list: {},
data: {},
couponId: null,
orderId: ''
},
onLoad(e) {
console.log(e.id)
console.log(e)
wx.showLoading({
title: '加载中...',
})
Http.get({
url: Http.config.api.couponDetail,
data: {
id: e.id
}
}).then(res => {
wx.hideLoading();
this.setData({
list: res,
data: res,
couponId: e.id
})
})
@@ -52,10 +56,11 @@ Page({
if (res.payment > 0) {
return Http.post({ url: Http.config.api.payOrderCreate, data: { orderId: orderId } })
} else {
// 免费卷
this.payOrderUpdate(orderId, "0", 1) // 支付成功
.then(res => {
wx.showToast({
title: "支付状态更新成功",
title: "支付成功",
duration: 3000
})
})


+ 8
- 4
pages/coupons/details/index.wxml Wyświetl plik

@@ -1,15 +1,16 @@
<view class='coupons'>
<view class="coupons-body">
<view class='banner'>
<image src='http://img02.tooopen.com/images/20150928/tooopen_sy_143912755726.jpg'></image>
<image src='{{data.coverImg}}'></image>
</view>
<view class='coupons_info'>
<view>
<text>黑椒牛排<text>限购一件</text></text>
<text>{{data.title}}<text>限购一件</text></text>
<text>剩余时间:<text>2天12小时25分钟</text></text>
<text>剩余件数:<text>19件</text></text>
</view>
<view>
<text>¥1.00</text>
<text>¥{{data.salePriceStr}}</text>
<text>¥59.00</text>
</view>
</view>
@@ -42,5 +43,8 @@
<text><text class='spot'></text>每桌限用2张</text>
</view>
</view>
<button bindtap='newOrderfunc' class='buy'>立即购买</button>
</view>
<view class="buy-view app-border-top">
<button bindtap='newOrderfunc' class='buy'>立即购买</button>
</view>
</view>

+ 144
- 124
pages/coupons/details/index.wxss Wyświetl plik

@@ -1,190 +1,210 @@
@import '../../../app.wxss';
.coupons {
width: 100%;
height: 100%;
position: absolute;
background: #f6f6f6;
width: 100%;
height: 100vh;
background: #f6f6f6;
position: relative;
display: flex;
flex-direction: column;
}
.coupons-body{
flex: 1;
overflow: auto;
}
.banner {
width: 100%;
height: 465rpx;
width: 100%;
height: 465rpx;
}
.banner image {
width: 100%;
height: 100%;
width: 100%;
height: 100%;
}
.coupons_info {
width: 92%;
height: 186rpx;
display: flex;
justify-content: space-between;
padding: 0 4%;
background: #fff;
width: 92%;
height: 186rpx;
display: flex;
justify-content: space-between;
padding: 0 4%;
background: #fff;
}
.coupons_info view {
display: flex;
flex-direction: column;
display: flex;
flex-direction: column;
}
.coupons_info view:nth-child(1) text {
font-size: 30rpx;
margin-top: 3%;
font-size: 30rpx;
margin-top: 3%;
}
.coupons_info view:nth-child(1) text:nth-child(1) text {
color: #ff3434;
font-size: 24rpx;
border: 1px solid #ff3434;
border-radius: 6rpx;
margin-left: 2%;
padding: 0 5rpx;
color: #ff3434;
font-size: 24rpx;
border: 1px solid #ff3434;
border-radius: 6rpx;
margin-left: 2%;
padding: 0 5rpx;
}
.coupons_info view:nth-child(1) text:nth-child(2),
.coupons_info view:nth-child(1) text:nth-child(3) {
color: #b8b8b8;
font-size: 24rpx;
margin-top: 4%;
color: #b8b8b8;
font-size: 24rpx;
margin-top: 4%;
}
.coupons_info view:nth-child(1) text:nth-child(2) text,
.coupons_info view:nth-child(1) text:nth-child(3) text {
color: #ff3434;
font-size: 24rpx;
color: #ff3434;
font-size: 24rpx;
}
.coupons_info view:nth-child(2) text:nth-child(1) {
font-size: 36rpx;
color: #ff3434;
margin-top: 40rpx;
font-weight: bold;
font-size: 36rpx;
color: #ff3434;
margin-top: 40rpx;
font-weight: bold;
}
.coupons_info view:nth-child(2) text:nth-child(2) {
font-size: 24rpx;
color: #b4b4b4;
text-decoration: line-through;
padding-left: 10rpx;
padding-top: 4rpx;
font-size: 24rpx;
color: #b4b4b4;
text-decoration: line-through;
padding-left: 10rpx;
padding-top: 4rpx;
}
.posi {
width: 92%;
display: flex;
flex-direction: column;
padding: 0 4%;
background: #fff;
margin-top: 2%;
width: 92%;
display: flex;
flex-direction: column;
padding: 0 4%;
background: #fff;
margin-top: 2%;
}
.posi>view:nth-child(2) {
width: 100%;
height: 87rpx;
display: flex;
justify-content: space-between;
border-top: 1px solid #f6f6f6;
line-height: 87rpx;
width: 100%;
height: 87rpx;
display: flex;
justify-content: space-between;
border-top: 1px solid #f6f6f6;
line-height: 87rpx;
}
.posi>view:nth-child(2) text:nth-child(1) {
font-size: 30rpx;
color: #a9a9a9;
font-size: 30rpx;
color: #a9a9a9;
}
.posi>view:nth-child(2) text:nth-child(2) {
font-size: 30rpx;
color: #a9a9a9;
font-size: 30rpx;
color: #a9a9a9;
}
.posi_logo {
width: 100%;
height: 156rpx;
display: flex;
margin-top: 30rpx;
width: 100%;
height: 156rpx;
display: flex;
margin-top: 30rpx;
}
.posi_logo view:nth-child(1) {
width: 126rpx;
height: 126rpx;
border-radius: 50%;
overflow: hidden;
flex: 2;
.posi_logo view:nth-child(1) {
width: 126rpx;
height: 126rpx;
border-radius: 50%;
overflow: hidden;
flex: 2;
}
.posi_logo view:nth-child(1) image {
width: 100%;
height: 100%;
.posi_logo view:nth-child(1) image {
width: 100%;
height: 100%;
}
.posi_logo view:nth-child(2) {
display: flex;
flex-direction: column;
flex: 8;
padding-top: 20rpx;
padding-left: 30rpx;
display: flex;
flex-direction: column;
flex: 8;
padding-top: 20rpx;
padding-left: 30rpx;
}
.posi_logo view:nth-child(2) text:nth-child(1) {
font-size: 30rpx;
font-size: 30rpx;
}
.posi_logo view:nth-child(2) text:nth-child(2) {
font-size: 24rpx;
color: #b8b8b8;
padding-top: 10rpx;
}
.notes{
margin-top: 2%;
}
.notes view:nth-child(1){
width: 92%;
height: 87rpx;
padding: 0 4%;
line-height: 87rpx;
background: #fff;
border-bottom: 1rpx solid #f5f5f5;
border-top: 1rpx solid #f5f5f5;
}
.notes view:nth-child(1) text{
font-size: 30rpx;
font-weight: bold;
}
.notes view:nth-child(2){
width: 92%;
height: 400rpx;
padding: 0 4%;
background: #fff;
border-bottom: 1rpx solid #f5f5f5;
display: flex;
flex-direction: column;
padding-top: 2%;
}
.notes view:nth-child(2)>text{
font-size: 28rpx;
color: #A9A9A9;
line-height: 56rpx;
font-size: 24rpx;
color: #b8b8b8;
padding-top: 10rpx;
}
.notes {
margin-top: 2%;
}
.notes view:nth-child(1) {
width: 92%;
height: 87rpx;
padding: 0 4%;
line-height: 87rpx;
background: #fff;
border-bottom: 1rpx solid #f5f5f5;
border-top: 1rpx solid #f5f5f5;
}
.notes view:nth-child(1) text {
font-size: 30rpx;
font-weight: bold;
}
.notes view:nth-child(2) {
width: 92%;
height: 400rpx;
padding: 0 4%;
background: #fff;
border-bottom: 1rpx solid #f5f5f5;
display: flex;
flex-direction: column;
padding-top: 2%;
}
.notes view:nth-child(2)>text {
font-size: 28rpx;
color: #A9A9A9;
line-height: 56rpx;
}
.spot {
width: 12rpx;
height: 12rpx;
display: inline-block;
background: #A9A9A9;
margin-right: 16rpx;
position: relative;
bottom: 4rpx;
border-radius: 50%;
width: 12rpx;
height: 12rpx;
display: inline-block;
background: #A9A9A9;
margin-right: 16rpx;
position: relative;
bottom: 4rpx;
border-radius: 50%;
}
.buy-view {
width: 100%;
padding: 10rpx;
/* position: fixed; */
/* bottom: 0; */
background: #fff;
box-sizing: border-box;
}
.buy {
width: 100%;
height: 88rpx;
background: #00C0FF;
color: #fff;
font-size: 36rpx;
line-height: 88rpx;
/* width: 100%; */
height: 88rpx;
background: #00C0FF;
color: #fff;
font-size: 36rpx;
line-height: 88rpx;
border-radius: 0;
}

+ 41
- 28
pages/index/rushToBuy/index.js Wyświetl plik

@@ -1,4 +1,5 @@
// pages/index/sw/index.js
let Http = require('../../../utils/HttpBasics')
Component({
/**
* 组件的属性列表
@@ -12,34 +13,34 @@ Component({
*/
data: {
list: [
{
img: "http://img02.tooopen.com/images/20150928/tooopen_sy_143912755726.jpg",
name: "海鲜焗饭",
time: "2天12小时25分钟",
oPrice: "59.00",
pPrice: "1.00",
},
{
img: "http://img06.tooopen.com/images/20160818/tooopen_sy_175866434296.jpg",
name: "海鲜焗饭",
time: "2天12小时25分钟",
oPrice: "59.00",
pPrice: "1.00",
},
{
img: "http://img02.tooopen.com/images/20150928/tooopen_sy_143912755726.jpg",
name: "海鲜焗饭",
time: "2天12小时25分钟",
oPrice: "59.00",
pPrice: "1.00",
},
{
img: "http://img06.tooopen.com/images/20160818/tooopen_sy_175866434296.jpg",
name: "海鲜焗饭",
time: "2天12小时25分钟",
oPrice: "59.00",
pPrice: "1.00",
},
// {
// img: "http://img02.tooopen.com/images/20150928/tooopen_sy_143912755726.jpg",
// name: "海鲜焗饭",
// time: "2天12小时25分钟",
// oPrice: "59.00",
// pPrice: "1.00",
// },
// {
// img: "http://img06.tooopen.com/images/20160818/tooopen_sy_175866434296.jpg",
// name: "海鲜焗饭",
// time: "2天12小时25分钟",
// oPrice: "59.00",
// pPrice: "1.00",
// },
// {
// img: "http://img02.tooopen.com/images/20150928/tooopen_sy_143912755726.jpg",
// name: "海鲜焗饭",
// time: "2天12小时25分钟",
// oPrice: "59.00",
// pPrice: "1.00",
// },
// {
// img: "http://img06.tooopen.com/images/20160818/tooopen_sy_175866434296.jpg",
// name: "海鲜焗饭",
// time: "2天12小时25分钟",
// oPrice: "59.00",
// pPrice: "1.00",
// },
]
},

@@ -48,5 +49,17 @@ Component({
*/
methods: {

},
ready() {
Http.get({
url: "/wxCouponChannel/list", data: {
pageNum: 1,
pageSize: 10
}
}).then(res=>{
this.setData({
list: res.list
})
})
}
})

Ładowanie…
Anuluj
Zapisz