Commit b376fe5a authored by 华国豪's avatar 华国豪 🙄

1

parent 826d2372
......@@ -4,9 +4,11 @@
"pages/Product/ProductDetails/ProductDetails",
"pages/Product/classify/classify",
"pages/Product/ProductList/ProductList",
"pages/mine/mine",
"pages/ShoppingCart/ShoppingCart",
"pages/Product/Settlement/Settlement",
"pages/Product/Search/Search",
"pages/Product/logistics/logistics",
"pages/ShoppingCart/ShoppingCart",
"pages/mine/mine",
"pages/mine/mineAddrEdit/mineAddrEdit",
"pages/mine/mineAddrList/mineAddrList",
"pages/mine/mineOrder/mineOrder",
......
......@@ -17,6 +17,11 @@ Page({
hotList: [],
imgList: [],
},
goSearchPage: function (){
wx.navigateTo({
url: "/pages/Product/Search/Search",
})
},
jumpPage: function (e) {
let id = e.currentTarget.dataset.id
wx.navigateTo({
......
......@@ -3,7 +3,7 @@
<view class="search">
<view>
<image src="/images/tarbar/sousuo.png"></image>
<input placeholder="请输入搜索的商品" class="f26"></input>
<input placeholder="请输入搜索的商品" bindtap="goSearchPage" class="f26"></input>
</view>
</view>
<view class="page-section page-section-spacing swiper">
......
// pages/Product/ProductList/ProductList.js
let app = getApp();
Page({
/**
* 页面的初始数据
*/
data: {
msg: {
pageSize: 5,
pageIndex: 1,
SellType: 0,
Status: 3,
OrderBy: 0,
OrderType: 1,
Name: ''
},
saleSort: 0,
priceSort: 0,
totalPage: 0,
pageIndex: 1,
dataList: [],
active: true,
searchKey: ''
},
zongheSort: function (){
this.setData({
"msg.pageSize": 5,
"msg.pageIndex": 1,
"msg.SellType": .0,
"msg.Status": 3,
"msg.OrderBy": 0,
"msg.OrderType": 1,
"msg.Name": '',
saleSort: 0,
priceSort: 0,
active: true
})
this.getList()
},
changeSort: function (e) {
let type = e.currentTarget.dataset.type
console.log(type)
if (type == 'saleSor') {
this.setData({
'msg.OrderBy': 1,
'msg.OrderType': this.data.saleSort === 0 ? 2 : 1,
priceSort: 0,
saleSort: this.data.saleSort === 0 ? 1 : 0,
'msg.pageIndex': 1,
pageIndex: 1,
active: false
})
} else {
this.setData({
'msg.OrderBy': 3,
'msg.OrderType': this.data.priceSort === 0 ? 2 : 1,
saleSort: 0,
priceSort: this.data.priceSort === 0 ? 1 : 0,
'msg.pageIndex': 1,
pageIndex: 1,
active: false
})
}
this.getList()
},
inputText: function (e) {
this.setData({
'msg.Name': e.detail.value,
searchKey: e.detail.value
})
},
SearchPage: function (e){
this.getList()
},
getList: function (type) {
this.setData({
'msg.Name': this.data.searchKey,
})
if (this.data.pageIndex >= this.data.totalPage && type) {
return
}
app.$api('Shop_post_GetPageList', this.data.msg).then(res => {
console.log(res)
let arr = this.data.dataList;
let arr2 = []
res.pageData.map(x => {
x.select = false;
x.right = 0;
arr2.push(x)
});
if (type) {
for (let i = 0; i < arr2.length; i++) {
arr.push(arr2[i])
}
} else {
arr = arr2
}
console.log(arr)
this.setData({
dataList: arr,
totalPage: res.pageCount ? res.pageCount : 1,
pageIndex: res.pageIndex ? res.pageIndex : 1,
})
wx.hideLoading()
}).catch(err => {
wx.showToast({
title: err.message,
icon: 'none',
duration: 2000
})
})
},
scrollGetMore: function () {
this.setData({
'msg.pageIndex': this.data.pageIndex + 1,
})
this.getList(1)
},
addGwc: function (e) {
let id = e.currentTarget.dataset.id
app.$api('Shop_post_SetCommodityShopInfo', {
CommodityId: id,
GuestId: app.state.admin.id,
CustomerId: 0,
Number: 1,
}).then(res => {
console.log(res)
wx.showToast({
title: '添加成功',
icon: 'none',
duration: 2000
})
}).catch(err => {
wx.showToast({
title: err.message,
icon: 'none',
duration: 2000
})
})
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
console.log(options)
let searchKey = ''
if (options.searchKey) {
searchKey = options.searchKey
}
wx.setNavigationBarTitle({
title: '商品列表'
})
this.setData({
'msg.pageIndex': 1,
selectNum: 0,
allMoney: 0,
allShuiMoney: 0,
searchKey: searchKey
})
this.getList()
},
/**
......
<!--pages/Product/ProductList/ProductList.wxml-->
<text>pages/Product/ProductList/ProductList.wxml</text>
<view class="ProductList commonF">
<view class="search">
<view>
<image src="/images/tarbar/sousuo.png"></image>
<input placeholder="请输入搜索的商品" value="{{searchKey}}" bindinput="inputText" class="f26"></input>
</view>
<text class="f26 c55" bindtap="SearchPage">搜索</text>
</view>
<view class="screen f28">
<view class="{{active ? 'active' : ''}}" bindtap="zongheSort">
<text>综合</text>
</view>
<view class="shengjiang" bindtap="changeSort" data-type="saleSor">
<text>销量</text>
<view class="sanjiao-box">
<image class="sanjiao" wx:if="{{saleSort == 0}}" src="/images/product/shang.png"></image>
<image class="sanjiao" wx:if="{{saleSort == 1}}" src="/images/product/xia.png"></image>
</view>
</view>
<view class="shengjiang" bindtap="changeSort" data-type="priceSort">
<text>价格</text>
<view class="sanjiao-box">
<image class="sanjiao" wx:if="{{priceSort == 0}}" src="/images/product/shang.png"></image>
<image class="sanjiao" wx:if="{{priceSort == 1}}" src="/images/product/xia.png"></image>
</view>
</view>
<view>
<text>筛选</text>
<image class="shaixuan-img" src="/images/product/shaixuan.png"></image>
</view>
</view>
<view class="Gray30"></view>
<scroll-view class="ProductList-scroll-view" scroll-y bindscrolltolower="scrollGetMore">
<view class="zhi-pro">
<view class="zhi-pro-item" wx:for="{{dataList}}" wx:key="index" data-id="{{item.Id}}" bindtap="goDerails">
<view class="zhi-pro-item-box">
<view>
<image src="{{item.FlowImgList[0]}}"></image>
</view>
<view class="zhi-pro-item-info">
<view class="text1 f26 bold">{{item.Name}}</view>
<view class="text1 f22 c66 sub-tit">{{item.Description}}</view>
<view class="zhi-pro-item-price">
<view class="price cee">
<text class="f22">¥</text>
<text class="f28 bold">{{item.SellPrice}}</text>
</view>
<view class="gouwuche" catchtap="addGwc" data-id="{{item.Id}}">
<image src="/images/tarbar/gouwuche1.png"></image>
</view>
</view>
</view>
</view>
</view>
</view>
<view class='body_footer'>{{pageIndex >= totalPage ? '没有更多了...' : '上拉获取更多数据'}}</view>
</scroll-view>
</view>
\ No newline at end of file
/* pages/Product/ProductList/ProductList.wxss */
\ No newline at end of file
.search{
margin: 0 30rpx;
padding: 14rpx 0;
display: flex;
align-items: center;
}
.search view{
height: 60rpx;
box-sizing: border-box;
background:rgba(242,242,242,1);
border-radius:30rpx;
flex: 1;
display: flex;
align-items: center;
padding: 0 30rpx;
}
.search input{
flex: 2;
}
.search image{
width: 26rpx;
height: 26rpx;
margin-right: 10rpx;
}
.search text{
padding-left: 30rpx;
}
.screen{
display: flex;
justify-content: space-around;
align-items: center;
padding: 30rpx 0;
}
.screen>view{
border-bottom: 2px solid rgba(226,20,54, 0);
}
.screen>view.active{
border-bottom: 2px solid rgba(226,20,54, 1);
}
.screen .sanjiao{
width: 18rpx;
height: 8rpx;
}
.sanjiao-box{
position: relative;
bottom: 6rpx;
left: 6rpx;
}
.screen .shengjiang{
display: flex;
align-items: center;
}
.shaixuan-img{
width: 22rpx;
height: 22rpx;
margin-left: 6rpx;
}
.ProductList-scroll-view{
height: calc(100vh - 226rpx)
}
.zhi-pro{
background-color: #F0F0F0;
border-radius: 12rpx;
}
.zhi-pro-item{
padding: 20rpx 20rpx 0 20rpx;
background-color: white;
}
.zhi-pro-item-box{
display: flex;
border-bottom: 1px solid #E5E5E5;
}
.zhi-pro-item-box image{
width: 180rpx;
height: 180rpx;
margin-right: 20rpx;
}
.zhi-pro-item-info{
flex: 2;
}
.zhi-pro-item-info .sub-tit{
margin: 19rpx 0 56rpx 0;
}
.zhi-pro-item-info .zhi-pro-item-price{
display: flex;
justify-content: space-between;
}
.zhi-pro-item-info .zhi-pro-item-price .gouwuche image{
width: 36rpx;
height: 32rpx;
}
\ No newline at end of file
// component/Search/search.js
let app = getApp();
Page({
data: {
searchKey: '',
},
goSearchPage: function (e){
this.setData({
searchKey: e.detail.value,
})
},
InputFous() {
if (this.data.searchKey.replace(/\s*/g, "") === '') {
wx.showToast({
title: '请输入商品名称',
icon: 'none',
duration: 2000
})
return false
}
wx.navigateTo({
url: '/pages/Product/ProductList/ProductList?searchKey=' + this.data.searchKey,
})
}
})
\ No newline at end of file
{
"component": true,
"usingComponents": {}
}
\ No newline at end of file
<view class="search commonF">
<view>
<image src="/images/tarbar/sousuo.png"></image>
<input placeholder="请输入搜索的商品" bindinput="goSearchPage" class="f26"></input>
</view>
<text class="f26 c55" bindtap="InputFous">搜索</text>
</view>
\ No newline at end of file
.search{
margin: 0 30rpx;
padding: 14rpx 0;
display: flex;
align-items: center;
}
.search view{
height: 60rpx;
box-sizing: border-box;
background:rgba(242,242,242,1);
border-radius:30rpx;
flex: 1;
display: flex;
align-items: center;
padding: 0 30rpx;
}
.search input{
flex: 2;
}
.search image{
width: 26rpx;
height: 26rpx;
margin-right: 10rpx;
}
.search text{
padding-left: 30rpx;
}
\ No newline at end of file
// pages/Product/logistics/logistics.js
Page({
/**
* 页面的初始数据
*/
data: {
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
wx.setNavigationBarTitle({
title: '查看物流'
})
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
}
})
\ No newline at end of file
{
"usingComponents": {}
}
\ No newline at end of file
<view class="logistics commonF">
<view class="wl-cp">
<view class="left">
<image mode="widthFix" src="/images/product/zheng.png"></image>
</view>
<view>
<view class="f26 c11">圆通快递</view>
<view class="f22 c66">物流电话:95554</view>
</view>
</view>
<view class="wl-dh f22 c66">
物流单号: <text class="c11">803259893151569820</text>
</view>
<view class="Gray30"></view>
<view class="sts f30 c11">
物流状态
</view>
<scroll-view scroll-y class="logistics-scroll">
<view class="item">
<image class="left-raduis-img" wx:show="{{false}}" src="/images/product/left-raduis.png"></image>
<view class="left-raduis"></view>
<view class="info">
<view> 四川省成都市双流县华阳公司 已签收 签收人:金棕榈云生活超市菜鸟驿站 感谢使用圆通速递,期待再次为您服务</view>
<view>2018-12-11 15:18:48</view>
</view>
</view>
</scroll-view>
</view>
\ No newline at end of file
.wl-cp{
height: 150rpx;
display: flex;
align-items: center;
padding: 30rpx;
}
.wl-cp .left{
width:90rpx;
height:90rpx;
background:rgba(246,246,246,1);
border-radius:50%;
margin-right: 30rpx;
}
.sts{
height: 90rpx;
padding: 0 30rpx;
display: flex;
align-items: center;
border-bottom: 1px solid rgba(233,233,233,1);
}
.wl-dh{
height: 52rpx;
display: flex;
align-items: center;
padding: 0 30rpx;
background:rgba(250,251,255,1);
border-radius:0px 0px 12rpx 12rpx;
}
.logistics-scroll{
height: calc(100vh - 322rpx);
padding: 30rpx 45rpx;
}
.logistics-scroll view.item{
padding-left: 45rpx;
border-left: 1px solid rgba(233,233,233,1);
position: relative;
}
.left-raduis{
width:14rpx;
height:14rpx;
background:rgba(233,233,233,1);
border-radius:50%;
position: absolute;
left: 7rpx;
}
.left-raduis-img{
width: 30rpx;
height: 30rpx;
position: absolute;
left: 15rpx;
}
.info{
padding: 30rpx 0;
border-bottom: 1px solid rgba(233,233,233,1);
}
\ No newline at end of file
......@@ -267,9 +267,9 @@ Page({
});
this.setData({
'msg.pageIndex': 1,
selectNum: selectNum,
allMoney: allMoney,
allShuiMoney: allShuiMoney,
selectNum: 0,
allMoney: 0,
allShuiMoney: 0,
})
this.getList()
},
......
......@@ -9,6 +9,11 @@ Page({
},
CorderId: 0
},
goLogistics: function (){
wx.navigateTo({
url: "/pages/Product/logistics/logistics?id=" + this.data.CorderId,
})
},
init: function (){
let id = this.data.CorderId
app.$api('ShopOrder_get_GetCommodityOrderDetailsService', { CorderId: id }).then(res => {
......
......@@ -17,7 +17,7 @@
<text class="c30 cff">{{details.COrderStateStr}}</text>
</view>
</view>
<view class="wuliu-info">
<view class="wuliu-info" bindtap="goLogistics">
<image src="/images/mine/wuliu.png"></image>
<view>
<view>
......
......@@ -117,6 +117,20 @@
"id": -1,
"name": "订单详情",
"pathName": "pages/mine/mineOrder/mineOrderDetails/mineOrderDetails",
"query": "",
"scene": null
},
{
"id": -1,
"name": "商品列表",
"pathName": "pages/Product/ProductList/ProductList",
"query": "",
"scene": null
},
{
"id": -1,
"name": "物流",
"pathName": "pages/Product/logistics/logistics",
"scene": null
}
]
......
Markdown is supported
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