第一次提交
This commit is contained in:
158
pages/activity/activity.js
Normal file
158
pages/activity/activity.js
Normal file
@@ -0,0 +1,158 @@
|
||||
//获取应用实例
|
||||
var app = getApp();
|
||||
Page({
|
||||
|
||||
/**
|
||||
* 页面的初始数据
|
||||
*/
|
||||
data: {
|
||||
order_list:[],
|
||||
navHeight: '',
|
||||
menuButtonInfo: {},
|
||||
searchMarginTop: 0, // 搜索框上边距
|
||||
searchWidth: 0, // 搜索框宽度
|
||||
searchHeight: 0, // 搜索框高度
|
||||
style_id:'',
|
||||
search:''
|
||||
},
|
||||
/**
|
||||
* 监听搜索内容
|
||||
*/
|
||||
changeSearch: function(e) {
|
||||
let that = this;
|
||||
var inputSearch = e.detail.value;
|
||||
that.setData({
|
||||
search: inputSearch
|
||||
})
|
||||
app.console(inputSearch+"================="+'22dddddddddddddddddddddd2')
|
||||
this.getGoodsList();
|
||||
},
|
||||
back(){
|
||||
wx.navigateBack()
|
||||
},
|
||||
/**
|
||||
* 生命周期函数--监听页面加载
|
||||
*/
|
||||
onLoad: function (options) {
|
||||
app.console('sssssss'+"================="+options.id),
|
||||
this.setData({
|
||||
style_id:options.id
|
||||
|
||||
});
|
||||
this.getGoodsList();
|
||||
this.setData({
|
||||
menuButtonInfo: wx.getMenuButtonBoundingClientRect()
|
||||
})
|
||||
console.log(this.data.menuButtonInfo)
|
||||
const { top, width, height, right } = this.data.menuButtonInfo
|
||||
wx.getSystemInfo({
|
||||
success: (res) => {
|
||||
const { statusBarHeight } = res
|
||||
const margin = top - statusBarHeight
|
||||
this.setData({
|
||||
navHeight: (height + statusBarHeight + (margin * 2) + 15),
|
||||
searchMarginTop: statusBarHeight + margin, // 状态栏 + 胶囊按钮边距
|
||||
searchHeight: height, // 与胶囊按钮同高
|
||||
searchWidth: right - width // 胶囊按钮右边坐标 - 胶囊按钮宽度 = 按钮左边可使用宽度
|
||||
})
|
||||
},
|
||||
})
|
||||
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面初次渲染完成
|
||||
*/
|
||||
onReady: function () {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面显示
|
||||
*/
|
||||
onShow: function () {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面隐藏
|
||||
*/
|
||||
onHide: function () {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面卸载
|
||||
*/
|
||||
onUnload: function () {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 页面相关事件处理函数--监听用户下拉动作
|
||||
*/
|
||||
onPullDownRefresh: function () {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 页面上拉触底事件的处理函数
|
||||
*/
|
||||
onReachBottom: function () {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 用户点击右上角分享
|
||||
*/
|
||||
onShareAppMessage: function () {
|
||||
|
||||
},
|
||||
// 跳转详情
|
||||
activity(e){
|
||||
|
||||
if (e.currentTarget.dataset.id != 0) {
|
||||
console.log("你选择的课程id是"+e.currentTarget.dataset.id);
|
||||
wx.navigateTo({
|
||||
url: "/shopping/pages/goddess/goddess?id=" + e.currentTarget.dataset.id,
|
||||
});
|
||||
}
|
||||
|
||||
},
|
||||
//商品列表
|
||||
getGoodsList: function () {
|
||||
var that = this;
|
||||
wx.request({
|
||||
url: app.buildUrl("/app/Goddesswechat/getGoodsList"),
|
||||
header: app.getRequestHeader(),
|
||||
method:'POST',
|
||||
data: {
|
||||
version_number: this.data.version_number,
|
||||
uid:wx.getStorageSync('uid'),
|
||||
token:wx.getStorageSync('token'),
|
||||
page:'1',
|
||||
page_size:10,
|
||||
city:'',
|
||||
style_id:this.data.style_id,
|
||||
mechanism_id:'',
|
||||
serach_name:this.data.search,
|
||||
px_type:'',
|
||||
lng:'',
|
||||
lat:''
|
||||
},
|
||||
success: function (res) {
|
||||
var resp = res.data;
|
||||
console.log(resp+"=================dddddddddddddddddddddddddddddddddddddddddddd")
|
||||
console.log(resp.erro+"=================dddddddddddddddddddddddddddddddddddddddddddd")
|
||||
if(resp.erro==0){
|
||||
that.setData({
|
||||
order_list:resp.lists
|
||||
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
})
|
||||
4
pages/activity/activity.json
Normal file
4
pages/activity/activity.json
Normal file
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"usingComponents": {},
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
45
pages/activity/activity.wxml
Normal file
45
pages/activity/activity.wxml
Normal file
@@ -0,0 +1,45 @@
|
||||
<!--pages/activity/activity.wxml-->
|
||||
<!-- 顶部排序 -->
|
||||
<!--index.wxml-->
|
||||
<view>
|
||||
<view class="custom-bar" style="height:{{navHeight}}px">
|
||||
<view class="custom-bar__wrapper" style="margin-top:{{searchMarginTop}}px; height: {{searchHeight}}px;width: {{searchWidth}}px" >
|
||||
<view style="height:24rpx;width:24rpx;border-right: 2px solid black;border-top: 2px solid black;transform: rotate(-135deg);margin-left:10px" bindtap="back"></view>
|
||||
<view class="search-group">
|
||||
<icon class="icon-small searchicon" type="search" size="38rpx"></icon>
|
||||
<input class="search-group__input" bindblur='changeSearch' bindconfirm='changeSearch' bindinput='changeSearch' placeholder="搜索"/>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- <view style="display:flex;justify-content: space-around;margin-bottom:23rpx;margin-top:{{navHeight}}px;font-size:24rpx;color: #585858;">
|
||||
<view>西安市</view>
|
||||
<view>智能排序</view>
|
||||
<view>分类</view>
|
||||
</view> -->
|
||||
|
||||
|
||||
<view class="order-list" style="margin-top: 160rpx;" wx:if="{{order_list.length}}">
|
||||
<view wx:for="{{order_list}}" wx:key="{{index}}" wx:for-item="item">
|
||||
<view class="Group" bindtap="activity" data-id="{{item.id}}">
|
||||
<view class="Group-image">
|
||||
<image src="{{item.index_img}}"></image>
|
||||
</view>
|
||||
<view class="content">
|
||||
<view class="title1">{{item.goods_name}}</view>
|
||||
<view class="title2">
|
||||
<view class="house">
|
||||
<image src="/pages/image/address.png"/>
|
||||
</view>
|
||||
<view >{{item.mechanism_name}}</view>
|
||||
</view>
|
||||
<view class="Price">
|
||||
<view class="Price1">¥{{item.price}}</view>
|
||||
<view class="Price2">¥{{item.original_price}}</view>
|
||||
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
128
pages/activity/activity.wxss
Normal file
128
pages/activity/activity.wxss
Normal file
@@ -0,0 +1,128 @@
|
||||
/* pages/activity/activity.wxss */
|
||||
.Group {
|
||||
height: 270rpx;
|
||||
display: flex;
|
||||
/* border-bottom: 1px solid #999999; */
|
||||
}
|
||||
|
||||
.Group-image {
|
||||
width: 230rpx;
|
||||
height: 230rpx;
|
||||
margin: 19rpx 28rpx 19rpx 31rpx;
|
||||
}
|
||||
|
||||
.Group-image image {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.content {
|
||||
/* padding: 20rpx 35rpx; */
|
||||
width: 400rpx;
|
||||
height: 201rpx;
|
||||
margin-top: 28rpx;
|
||||
}
|
||||
|
||||
.content .title1 {
|
||||
font-size: 30rpx;
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
.content .title2 {
|
||||
font-size: 26rpx;
|
||||
height: 37rpx;
|
||||
line-height: 37rpx;
|
||||
display: flex;
|
||||
color: #B4B4B4;
|
||||
margin: 11rpx 0 18rpx 0;
|
||||
}
|
||||
|
||||
.content .title2 .house {
|
||||
width: 28rpx;
|
||||
height: 28rpx;
|
||||
margin-right: 7rpx;
|
||||
margin-top: 5rpx;
|
||||
}
|
||||
|
||||
.content .title2 .house image {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.content .Price {
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.content .Price .Price1 {
|
||||
font-size: 34rpx;
|
||||
color: #FF4A4A;
|
||||
line-height: 42rpx;
|
||||
margin-right: 17rpx;
|
||||
}
|
||||
|
||||
.content .Price .Price2 {
|
||||
font-size: 24rpx;
|
||||
color: #CBCBCB;
|
||||
line-height: 41rpx;
|
||||
margin-right: 23rpx;
|
||||
text-decoration:line-through;
|
||||
}
|
||||
|
||||
.content .Price .Price3 {
|
||||
width: 51rpx;
|
||||
height: 21rpx;
|
||||
font-size: 15rpx;
|
||||
color: #E75D4D;
|
||||
border: 1px solid #E75D4D;
|
||||
border-radius: 4rpx;
|
||||
text-align: center;
|
||||
line-height: 18rpx;
|
||||
margin-top: 10rpx;
|
||||
}
|
||||
|
||||
.order-list{
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/* _______________________________________ */
|
||||
view {
|
||||
box-sizing: border-box;
|
||||
overflow: hidden;
|
||||
}
|
||||
.custom-bar {
|
||||
/* background-color: #aaa; */
|
||||
position: fixed;
|
||||
left: 0;
|
||||
top: 0;
|
||||
width: 100%;
|
||||
}
|
||||
.custom-bar__wrapper {
|
||||
padding: 0 10rpx;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
.search-group {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
display: flex;
|
||||
justify-content: flex-start;
|
||||
align-items: center;
|
||||
border-radius: 60rpx;
|
||||
/* padding: 0 10rpx; */
|
||||
padding-left: 25rpx;
|
||||
background: #F5F5F5;
|
||||
}
|
||||
.search-group > input {
|
||||
font-size: 25rpx;
|
||||
width: 800rpx;
|
||||
}
|
||||
.search-group > image {
|
||||
height: 32rpx;
|
||||
width: 32rpx;
|
||||
margin-right: 20rpx
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user