作者 李洪娟

合并分支 'suhang' 到 'li_hongjuan'

大兄弟



查看合并请求 !3
... ... @@ -3,6 +3,8 @@
"pages/index/index",
"pages/homeindex/homeindex",
... ... @@ -12,7 +14,6 @@
"pages/kind/kind",
"pages/homeindex/result/result",
"pages/homeindex/search/search",
... ...
... ... @@ -14,12 +14,15 @@ Page({
class_id: '',
detailCon: {},
id: '',
keyword:'',
page: 2,
page_type: true
},
look_category(e) {
console.log(e)
app.globalData.cid = e.currentTarget.dataset.index
app.globalData.class_id = e.currentTarget.dataset.class_id
console.log(app.globalData.cid)
wx.switchTab({
url: '/pages/kind/kind'
})
... ... @@ -41,15 +44,16 @@ Page({
let params = {
class_id: that.data.class_id
}
console.log(params)
app.post(url, params, header).then((res) => {
console.log(res)
that.setData({
banner: res.data.banner,
shop_class: res.data.shop_class,
middle: res.data.middle,
shop: res.data.shop,
now_time: res.data.now_time
now_time: res.data.now_time,
// totalpae: res.last_page
})
that.countDown()
... ... @@ -58,13 +62,7 @@ Page({
}).catch((errMsg) => {})
},
goConfirm: function(e) {
this.setData({
showModal: true,
index: e.currentTarget.dataset.index
})
},
m_close: function() {
this.setData({
showModal: false,
... ... @@ -113,21 +111,17 @@ Page({
let that = this
let objs = Object.assign([], that.data.shop)
let now_time = parseInt(new Date().getTime())
// console.log(now_time)
for (let obj of objs) {
let end_time = obj.end_time*1000
// console.log(end_time)
let open_time = obj.open_time*1000
if (now_time < open_time) {
// console.log(333)
//活动未开始
} else if (now_time > end_time) {
// console.log(222)
//活动结束
} else {
// console.log(1111)
let time = (end_time - now_time) / 1000;
let day = parseInt(time / (60 * 60 * 24));
let hou = parseInt(time % (60 * 60 * 24) / 3600);
... ... @@ -139,13 +133,11 @@ Page({
obj.min = that.timeFormat(min),
obj.sec = that.timeFormat(sec)
// console.log(obj.day, obj.hou, obj.min, obj.sec)
}
}
that.setData({
shop: objs
})
// console.log(that.data.shop)
setTimeout(that.countDown, 1000);
},
/**
... ... @@ -153,7 +145,53 @@ Page({
*/
onLoad: function(options) {
let that = this
that.get_info()
that.get_info();
},
info() {
let that = this
let url = app.interface.shopPage
let header = {
'XX-Device-Type': 'wxapp',
'XX-Token': wx.getStorageSync('token')
}
let paramer = {
page: that.data.page,
type: 1
}
app.post(url, paramer,header).then((res) => {
if (res.data.shop.length > 0){
wx.showLoading({
title: '加载中',
})
let t = setInterval((red)=>{
wx.hideLoading()
that.setData({
shop: that.data.shop.concat(res.data.shop),
page_type: true
})
},1000)
} else{
that.setData({
page_type: false
})
wx.showToast({
title: '暂无更多数据',
icon: 'none',
duration: 1000
})
}
}).catch((errMsg) => {
})
},
/**
... ... @@ -172,7 +210,6 @@ Page({
that.setData({
currentTab: app.globalData.cid
})
console.log(this.data.aa)
}
that.get_info()
that.countDown()
... ... @@ -203,7 +240,17 @@ Page({
* 页面上拉触底事件的处理函数
*/
onReachBottom: function() {
let that=this
if(that.data.page_type == false){
return false
}
let page=that.data.page;
page++;
that.setData({
page:page
})
that.info()
},
/**
... ...
... ... @@ -78,7 +78,7 @@
<view class='ware5_t3'>{{item.text_table}}</view>
<view class='ware5_t4'>{{item.text_content}}</view>
</view>
<view class='ware_6' data-index="{{index}}" catchtap='goConfirm'>
<view class='ware_6' >
<view>立即参团</view>
</view>
</view>
... ... @@ -91,6 +91,8 @@
</view>
</view>
</view>
<view class='Load'>—— {{page_type?'下拉加载更多':'暂无跟多数据'}} ——</view>
<!-- 弹窗 -->
<view class="mask" catchtouchmove="preventTouchMove" wx:if="{{showModal}}"></view>
<!-- 弹出层 -->
... ...
/* pages/homeindex/homeindex.wxss */
page{
padding-bottom: 50rpx;
}
.search {
padding: 16rpx 32rpx;
... ... @@ -171,11 +173,12 @@
.ware_box {
width: 688rpx;
height: 400rpx;
margin: 32rpx auto;
background: #f9fafc;
}
.ware_box:last-child{
margin-bottom: 0;
}
.ware_top {
overflow: hidden;
display: flex;
... ... @@ -583,3 +586,10 @@
box-shadow: 0rpx 6rpx 40rpx rgba(162, 255, 0, 0.15);
border-radius: 48rpx;
}
.Load{
width: 100%;
text-align: center;
color: #aaa;
font-size: 26rpx;
margin-top: 50rpx;
}
\ No newline at end of file
... ...
// pages/homeindex/result/result.js
Page({
/**
* 页面的初始数据
*/
data: {
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
}
})
\ No newline at end of file
{
"navigationBarTitleText": "",
"navigationBarBackgroundColor": "#6EAC3D",
"navigationBarTextStyle": "white"
}
\ No newline at end of file
<!--pages/homeindex/result/result.wxml-->
<!-- <text>pages/homeindex/result/result.wxml</text> -->
<view class='search'>
<view class='search_inp'>
<input type='text' placeholder='请输入商品名称'></input>
<image src='../../../img/search.png'></image>
</view>
<view class='search_txt'>
取消
</view>
</view>
<view class='container'>
<view class='mid'>
<view class='mid_item'>
<!-- 顶部 -->
<view class='mid_item_top'>
<!-- 左边 -->
<view class='mid_item_top_left'>
<view class='top_left_pic'>
<image src='../../../img/goods_1.png'></image>
</view>
<view class='top_left_text'>
距结束23时59分距结束23时59分
</view>
</view>
<!-- 右边 -->
<view class='mid_item_top_right'>
<!-- 右上 -->
<view class='right_top'>
<view class='right_top_lef'>
纯进口有机菜花
</view>
<view class='right_top_rig'>
产地:智利
</view>
</view>
<!-- 右中1 -->
<view class='right_mid'>
<view class='right_mid_lef'>
<view class='right_mid_lef_color'></view>
</view>
<view class='right_mid_rig'>
42%
</view>
</view>
<!-- 右中2 -->
<view class='right_text'>
已拼300份,目标500份
</view>
<!-- 右下 -->
<view class='right_bottom'>
<!-- 右下左 -->
<view class='right_bottom_lef'>
<span class='RBM'>¥</span>
<span class='number'>52/</span>
<span class='text'>1磅1份1磅1份</span>
</view>
<!-- 右下中 -->
<view class='right_bottom_mid'>
<view class='right_bottom_mid_t'>
40mm-50m
</view>
<view class='right_bottom_mid_b'>
番茄果径番茄果径番茄果径
</view>
</view>
<!-- 右下右 -->
<view class='right_bottom_rig'>
立即参团
</view>
</view>
</view>
</view>
<view class='mid_item_bottom'>
<view class='mid_item_bottom_left'>
经典推荐
</view>
<!-- 竖线 -->
<view class='mid_line'></view>
<!-- 底部文本 -->
<view class='mid_item_bottom_bot'>
智利进口,绿色健康,硕大饱满
</view>
</view>
</view>
<view class='mid_item'>
<!-- 顶部 -->
<view class='mid_item_top'>
<!-- 左边 -->
<view class='mid_item_top_left'>
<view class='top_left_pic'>
<image src='../../../img/goods_1.png'></image>
</view>
<view class='top_left_text'>
距结束23时59分距结束23时59分
</view>
</view>
<!-- 右边 -->
<view class='mid_item_top_right'>
<!-- 右上 -->
<view class='right_top'>
<view class='right_top_lef'>
纯进口有机菜花
</view>
<view class='right_top_rig'>
产地:智利
</view>
</view>
<!-- 右中1 -->
<view class='right_mid'>
<view class='right_mid_lef'>
<view class='right_mid_lef_color'></view>
</view>
<view class='right_mid_rig'>
42%
</view>
</view>
<!-- 右中2 -->
<view class='right_text'>
已拼300份,目标500份
</view>
<!-- 右下 -->
<view class='right_bottom'>
<!-- 右下左 -->
<view class='right_bottom_lef'>
<span class='RBM'>¥</span>
<span class='number'>52/</span>
<span class='text'>1磅1份1磅1份</span>
</view>
<!-- 右下中 -->
<view class='right_bottom_mid'>
<view class='right_bottom_mid_t'>
40mm-50m
</view>
<view class='right_bottom_mid_b'>
番茄果径番茄果径番茄果径
</view>
</view>
<!-- 右下右 -->
<view class='right_bottom_rig'>
立即参团
</view>
</view>
</view>
</view>
<view class='mid_item_bottom'>
<view class='mid_item_bottom_left'>
经典推荐
</view>
<!-- 竖线 -->
<view class='mid_line'></view>
<!-- 底部文本 -->
<view class='mid_item_bottom_bot'>
智利进口,绿色健康,硕大饱满
</view>
</view>
</view>
<view class='mid_item'>
<!-- 顶部 -->
<view class='mid_item_top'>
<!-- 左边 -->
<view class='mid_item_top_left'>
<view class='top_left_pic'>
<image src='../../../img/goods_1.png'></image>
</view>
<view class='text_color'>
距结束2时22分距结束2时22分
</view>
</view>
<!-- 右边 -->
<view class='mid_item_top_right'>
<!-- 右上 -->
<view class='right_top'>
<view class='right_top_lef'>
纯进口有机菜花
</view>
<view class='right_top_rig'>
产地:罗利
</view>
</view>
<!-- 右中1 -->
<view class='right_mid'>
<view class='right_mid_lef'>
<view class='right_mid_lef_color'></view>
</view>
<view class='right_mid_rig'>
42%
</view>
</view>
<!-- 右中2 -->
<view class='right_text'>
已拼300份,目标500份
</view>
<!-- 右下 -->
<view class='right_bottom'>
<!-- 右下左 -->
<view class='right_bottom_lef'>
<span class='RBM'>¥</span>
<span class='number'>52/</span>
<span class='text'>1磅1份1磅1份</span>
</view>
<!-- 右下中 -->
<view class='right_bottom_mid'>
<view class='right_bottom_mid_t'>
40mm-50m
</view>
<view class='right_bottom_mid_b'>
番茄果径 番茄果径番茄果径
</view>
</view>
<!-- 右下右 -->
<view class='right_bottom_rig'>
立即参团
</view>
</view>
</view>
</view>
<view class='mid_item_bottom'>
<view class='mid_item_bottom_left'>
经典推荐
</view>
<!-- 竖线 -->
<view class='mid_line'></view>
<!-- 底部文本 -->
<view class='mid_item_bottom_bot'>
智利进口,绿色健康,硕大饱满
</view>
</view>
</view>
</view>
</view>
/* pages/homeindex/result/result.wxss */
.search{
padding: 16rpx 32rpx;
height: 64rpx;
background: #6EAC3D;
display: flex;
justify-content: center;
align-content: space-between;
}
.search_inp{
box-sizing: border-box;
width: 608rpx;
height: 64rpx;
border-radius: 32rpx;
display:flex;
align-items: center;
padding-left: 76rpx;
padding-right: 32rpx;
background:#fff;
border: 0;
outline: none;
font-size: 26rpx;
position: relative;
}
.search_inp input{
width: 100%;
}
.search_inp image{
position: absolute;
left: 32rpx;
width: 32rpx;
height: 32rpx;
}
.search_txt{
height: 64rpx;
font-size: 30rpx;
color: #fff;
line-height: 64rpx;
padding-left: 16rpx;
}
.container{
width: 750rpx;
display: flex;
align-items: center;
flex-flow: column;
}
.mid{
margin-top: 16rpx;
display: flex;
flex-flow: column;
}
.mid_item{
margin-top: 16rpx;
width:688rpx;
/* height:400rpx; */
background:rgba(249,250,252,1);
opacity:1;
border-radius:8rpx;
display: flex;
align-items: center;
flex-flow: column;
box-sizing: border-box;
padding: 52rpx 16rpx 48rpx;
}
.mid_item_top{
display: flex;
width: 100%;
}
.mid_item_top_left{
width:208rpx;
height:208rpx;
/* background:rgba(250,250,250,1); */
opacity:1;
display: flex;
flex-flow: column;
}
.top_left_pic{
width: 208rpx;
height: 160rpx;
display: flex;
}
.top_left_pic image{
width: 100%;
height: 100%;
}
.top_left_text{
width: 202rpx;
height:48rpx;
background:rgba(251,4,4,1);
opacity:0.2;
text-align: center;
font-size:24rpx;
font-family:PingFang SC;
font-weight:400;
line-height:48rpx;
color:rgba(255,255,255,1);
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.mid_item_top_right{
width: 100%;
margin-left: 14rpx;
}
.right_top{
display: flex;
align-items: center;
justify-content: space-between;
margin-top: 20rpx;
}
.right_top_lef{
width: 270rpx;
font-size:32rpx;
font-family:PingFang SC;
font-weight:600;
color:rgba(51,51,51,1);
opacity:1;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.right_top_rig{
font-size:22rpx;
font-family:PingFang SC;
font-weight:400;
line-height:32rpx;
color:rgba(204,204,204,1);
opacity:1;
}
.right_mid{
margin-top: 16rpx;
display: flex;
align-items: center;
}
.right_mid_lef{
width:288rpx;
height:16rpx;
background:rgba(236,236,236,1);
opacity:1;
border-radius:8rpx;
}
.right_mid_lef_color{
width:206rpx;
height:16rpx;
background:rgba(181,222,150,1);
opacity:1;
border-radius:8rpx;
}
.right_mid_rig{
margin-left: 16rpx;
font-size:24rpx;
font-family:PingFang SC;
font-weight:400;
line-height:34rpx;
color:rgba(181,222,150,1);
opacity:1;
}
.right_text{
margin-top: 14rpx;
font-size:22rpx;
font-family:PingFang SC;
font-weight:400;
color:rgba(204,204,204,1);
opacity:1;
}
.right_bottom{
display: flex;
align-items: center;
justify-content: space-between;
}
.RBM{
font-size: 22rpx;
color: #ff0000;
}
.number{
font-size: 30rpx;
color: #ff0000;
}
.text{
font-size:22rpx;
font-family:PingFang SC;
font-weight:400;
line-height:32rpx;
color:rgba(204,204,204,1);
opacity:1;
}
.right_bottom_mid{
width: 122rpx;
}
.right_bottom_mid_t{
font-size:22rpx;
font-family:PingFang SC;
font-weight:400;
color:rgba(51,51,51,1);
opacity:1;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.right_bottom_mid_b{
font-size:18rpx;
font-family:PingFang SC;
font-weight:400;
color:rgba(153,153,153,1);
opacity:1;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.right_bottom_rig{
width:144rpx;
height:48rpx;
line-height: 48rpx;
background:rgba(249,150,20,1);
box-shadow:0rpx 2rpx 12rpx rgba(255,145,0,0.16);
opacity:1;
border-radius:24rpx;
text-align: center;
font-size:26rpx;
font-family:PingFang SC;
font-weight:400;
color:rgba(255,255,255,1);
}
.mid_item_bottom{
margin-top: 32rpx;
width:640rpx;
height:80rpx;
background:rgba(181,222,150,0.1);
border-radius:16rpx;
display: flex;
align-items: center;
box-sizing: border-box;
padding: 0 32rpx;
}
.mid_item_bottom_left{
font-size:30rpx;
font-family:汉真广标;
font-weight:400;
color:rgba(110,172,61,1);
opacity:1;
}
.mid_line{
margin: 0 36rpx;
width:2rpx;
height:60rpx;
background:rgba(181,222,150,1);
opacity:1;
border-radius:4rpx;
}
.mid_item_bottom_bot{
font-size:24rpx;
font-family:PingFang SC;
font-weight:400;
color:rgba(153,153,153,1);
opacity:1;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.text_color{
width:202rpx;
height:48rpx;
line-height: 48rpx;
text-align: center;
background:rgba(204,204,204,0.7);
font-size:24rpx;
font-family:PingFang SC;
font-weight:400;
color:rgba(255,255,255,1);
opacity:1;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.right_bottom_lef{
width: 140rpx;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
\ No newline at end of file
... ... @@ -57,6 +57,7 @@ Page({
keyword: e._relatedInfo.anchorTargetText
})
},
info(event) {
let that = this
if (that.data.keyword == '') {
... ... @@ -81,11 +82,13 @@ Page({
page: 1,
keyword: keyword
},header).then((res) => {
console.log
that.setData({
shop: res.data.shop,
type:false,
dis: false,
keyword: ''
keyword: '',
shop: that.data.shop.concat(res.data.shop)
})
that.get_info()
}).catch((errMsg) => {
... ... @@ -144,6 +147,12 @@ Page({
timeFormat(param) { //小于10的格式化函数
return param < 10 ? '0' + param : param;
},
shoptail(e) {
let id = e.currentTarget.dataset.shop_id;
wx.navigateTo({
url: '/pages/kind/detail_1/detail_1?id=' + id,
})
},
//团购倒计时
countDown() {
let that = this
... ... @@ -187,46 +196,7 @@ Page({
timeFormat(param) { //小于10的格式化函数
return param < 10 ? '0' + param : param;
},
//团购倒计时
countDown() {
let that = this
let objs = Object.assign([], that.data.shop)
let now_time = parseInt(new Date().getTime())
// console.log(now_time)
for (let obj of objs) {
let end_time = obj.end_time * 1000
// console.log(end_time)
let open_time = obj.open_time * 1000
if (now_time < open_time) {
// console.log(333)
//活动未开始
} else if (now_time > end_time) {
// console.log(222)
//活动结束
} else {
// console.log(1111)
let time = (end_time - now_time) / 1000;
let day = parseInt(time / (60 * 60 * 24));
let hou = parseInt(time % (60 * 60 * 24) / 3600);
let min = parseInt(time % (60 * 60 * 24) % 3600 / 60);
let sec = parseInt(time % (60 * 60 * 24) % 3600 % 60);
obj.day = that.timeFormat(day),
obj.hou = that.timeFormat(hou),
obj.min = that.timeFormat(min),
obj.sec = that.timeFormat(sec)
// console.log(obj.day, obj.hou, obj.min, obj.sec)
}
}
that.setData({
shop: objs
})
// console.log(that.data.shop)
setTimeout(that.countDown, 1000);
},
add(){
},
... ... @@ -241,7 +211,7 @@ Page({
* 生命周期函数--监听页面显示
*/
onShow: function() {
that.countDown()
this.countDown()
},
... ... @@ -270,7 +240,14 @@ Page({
* 页面上拉触底事件的处理函数
*/
onReachBottom: function() {
let that = this;
let page = that.data.page;
page++;
that.setData({
page: page
})
that.info()
},
/**
... ...
... ... @@ -34,7 +34,7 @@
</view>
<view class='container' bindtap='display' wx:else>
<view class='mid'>
<view class='ware_box' wx:for='{{shop}}' wx:key="index">
<view class='ware_box' wx:for='{{shop}}' bindtap="shoptail" data-shop_id='{{item.shop_id}}' wx:key="index">
<view class='ware_top'>
<view class='ware_1'>
<image src='{{item.thumb}}'></image>
... ... @@ -78,4 +78,35 @@
<view class='empty' wx:if="{{shop.length == 0}}">暂无更多结果</view>
</view>
<!-- 弹窗 -->
<view class="mask" catchtouchmove="preventTouchMove" wx:if="{{showModal}}"></view>
<!-- 弹出层 -->
<view class="modalDlg" wx:if="{{showModal}}">
<view class='modalDlg_p'>
<view class='m_top'>
<view class='m_topImg'>
<image src='{{shop[index].thumb}}'></image>
</view>
<view class='m_topTxt'>
<view class='m_topTxt1'>
<view class='m_topName'>{{shop[index].name}}</view>
<image bindtap='m_close' src='../../img/cha.png'></image>
</view>
<view class='m_topTxt2'>
<view class='m_topPrice'>¥{{shop[index].money_sale}}</view>
<view class='m_topHelf'>{{shop[index].shop_type}}</view>
</view>
</view>
</view>
<view class='m_number'>
<view class='m_numTxt'>购买数量</view>
<view class='minus_push'>
<view class='minus' bindtap="bindMinus">-</view>
<view class='num' bindchange="bindManual">{{num}}</view>
<view class='push' bindtap="bindPlus">+</view>
</view>
</view>
<button class='m_btn' bindtap='goFirm_order1' data-id="{{shop[index].shop_id}}">确认</button>
</view>
</view>
\ No newline at end of file
... ...
... ... @@ -318,4 +318,148 @@
margin-top: 120px;
text-align: center;
color: #ccc;
}
/* 弹出层 */
.modalDlg {
width: 100%;
height: 454rpx;
bottom: 0;
position: fixed;
z-index: 9999;
background-color: #fff;
}
.modalDlg_p {
padding: 0 30rpx;
}
.m_top {
display: flex;
}
.m_topTxt1 {
display: flex;
align-self: center;
justify-content: space-between;
margin-top: 30rpx;
}
.m_topTxt {
width: 100%;
margin-left: 16rpx;
}
.m_topImg {
margin-top: -48rpx;
display: flex;
}
.m_topImg image {
width: 208rpx;
height: 208rpx;
}
.m_topTxt1 image {
width: 32rpx;
height: 32rpx;
}
.m_topName {
font-size: 32rpx;
font-family: PingFang SC;
font-weight: 600;
color: rgba(51, 51, 51, 1);
}
.m_topTxt2 {
display: flex;
margin-top: 16rpx;
align-items: center;
}
.m_topPrice {
width: 120rpx;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
font-size: 28rpx;
font-family: DIN 1451 Std Mittelschrift;
font-weight: 400;
color: #f00;
}
.m_topHelf {
width: 280rpx;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
font-size: 22rpx;
font-family: PingFang SC;
font-weight: 400;
margin-left: 16rpx;
color: rgba(204, 204, 204, 1);
}
.m_number {
display: flex;
align-items: center;
margin-top: 18rpx;
}
.minus_push {
display: flex;
margin-left: auto;
align-items: center;
}
.m_numTxt {
font-size: 24rpx;
font-family: PingFang SC;
font-weight: 400;
color: rgba(153, 153, 153, 1);
}
.minus, .push {
width: 48rpx;
height: 48rpx;
font-size: 40rpx;
text-align: center;
line-height: 48rpx;
border: 2px solid rgba(110, 172, 61, 1);
border-radius: 50%;
}
.minus {
color: #6eac3d;
}
.num {
margin: 0 26rpx;
font-size: 32rpx;
font-family: PingFang SC;
font-weight: 400;
color: rgba(110, 172, 61, 1);
}
.push {
color: white;
background: rgba(110, 172, 61, 1);
}
.m_btn {
width: 688rpx;
height: 80rpx;
border: 0;
margin-top: 62rpx;
font-size: 32rpx;
font-family: PingFang SC;
font-weight: 600;
color: rgba(255, 255, 255, 1);
background: linear-gradient(170deg, rgba(181, 222, 150, 1) 0%, rgba(169, 209, 33, 1) 100%);
box-shadow: 0rpx 6rpx 40rpx rgba(162, 255, 0, 0.15);
border-radius: 48rpx;
}
.ware_box:last-child{
margin-bottom: 0;
}
\ No newline at end of file
... ...
... ... @@ -125,6 +125,44 @@ Page({
that.get_info()
that.countDown()
},
info(event) {
let that = this
// if (that.data.keyword == '') {
// wx.showToast({
// title: '商品名称不能为空',
// icon: 'none',
// duration: 1000
// })
// return false
// }
// 接口地址
let url = app.interface.shopPage
let header = {
'XX-Device-Type': 'wxapp',
'XX-Token': wx.getStorageSync('token')
}
let paramer = {
page: that.data.page,
keyword: keyword
}
let keyword = this.data.keyword
app.post(url, paramer, header).then((res) => {
console.log(res)
that.setData({
shop: res.data.shop,
type: false,
dis: false,
keyword: '',
shop: that.data.shop.concat(res.data.shop)
})
// that.get_info()
}).catch((errMsg) => {
})
},
/**
* 生命周期函数--监听页面隐藏
... ... @@ -151,7 +189,14 @@ Page({
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
let that = this;
let page = that.data.page;
page++;
that.setData({
page: page
})
that.info()
},
/**
... ...
... ... @@ -277,4 +277,7 @@
margin-top: 120px;
text-align: center;
color: #ccc;
}
.ware_box:last-child{
margin-bottom: 0;
}
\ No newline at end of file
... ...
... ... @@ -13,7 +13,7 @@
},
"compileType": "miniprogram",
"libVersion": "2.6.2",
"appid": "wxd577c8d542ca150e",
"appid": "wx9f7abdcb841c8fb1",
"projectname": "teamshop",
"debugOptions": {
"hidedInDevtools": []
... ...