Commit 1c1a1fdf authored by 华国豪's avatar 华国豪 🙄

1

parent b376fe5a
......@@ -7,6 +7,7 @@
"pages/Product/Settlement/Settlement",
"pages/Product/Search/Search",
"pages/Product/logistics/logistics",
"pages/Product/payOK/payOK",
"pages/ShoppingCart/ShoppingCart",
"pages/mine/mine",
"pages/mine/mineAddrEdit/mineAddrEdit",
......
......@@ -144,9 +144,19 @@ Page({
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
if (options.GuestId) {
app.state.admin.id = options.GuestId
wx.setStorage({
key: "admin",
data: {
id: options.GuestId
}
})
}
},
onGotUserInfo: function (e) {
console.log(e)
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
......
......@@ -48,6 +48,7 @@
height: 102rpx;
background:rgba(242,242,242,1);
border-radius:50%;
overflow: hidden;
}
.new-pro-tit,.zhi-pro-tit{
padding: 30rpx 0;
......
......@@ -20,7 +20,8 @@ Page({
pageIndex: 1,
dataList: [],
active: true,
searchKey: ''
searchKey: '',
allNumber: 0,
},
zongheSort: function (){
this.setData({
......@@ -70,6 +71,10 @@ Page({
})
},
SearchPage: function (e){
this.setData({
'msg.pageIndex': 1,
pageIndex: 1,
})
this.getList()
},
getList: function (type) {
......@@ -116,6 +121,26 @@ Page({
})
this.getList(1)
},
getGwc: function () {
app.$api('Shop_post_GetCommodityShopNumber', {
GuestId: app.state.admin.id,
}).then(res => {
this.setData({
allNumber: res
})
}).catch(err => {
wx.showToast({
title: err.message,
icon: 'none',
duration: 2000
})
})
},
goShoppingCart: function () {
wx.switchTab({
url: '/pages/ShoppingCart/ShoppingCart',
})
},
addGwc: function (e) {
let id = e.currentTarget.dataset.id
app.$api('Shop_post_SetCommodityShopInfo', {
......@@ -125,6 +150,7 @@ Page({
Number: 1,
}).then(res => {
console.log(res)
this.getGwc()
wx.showToast({
title: '添加成功',
icon: 'none',
......@@ -144,7 +170,7 @@ Page({
onLoad: function (options) {
console.log(options)
let searchKey = ''
if (options.searchKey) {
if (typeof (options.searchKey) !== "undefined") {
searchKey = options.searchKey
}
wx.setNavigationBarTitle({
......@@ -157,7 +183,7 @@ Page({
allShuiMoney: 0,
searchKey: searchKey
})
this.getList()
// this.getList()
},
/**
......@@ -171,7 +197,8 @@ Page({
* 生命周期函数--监听页面显示
*/
onShow: function () {
this.getGwc()
this.getList()
},
/**
......
......@@ -24,10 +24,10 @@
<image class="sanjiao" wx:if="{{priceSort == 1}}" src="/images/product/xia.png"></image>
</view>
</view>
<view>
<!-- <view>
<text>筛选</text>
<image class="shaixuan-img" src="/images/product/shaixuan.png"></image>
</view>
</view> -->
</view>
<view class="Gray30"></view>
<scroll-view class="ProductList-scroll-view" scroll-y bindscrolltolower="scrollGetMore">
......@@ -55,4 +55,8 @@
</view>
<view class='body_footer'>{{pageIndex >= totalPage ? '没有更多了...' : '上拉获取更多数据'}}</view>
</scroll-view>
<view class="gouwuche-big" bindtap="goShoppingCart">
<image src="/images/product/gouwuche.png"></image>
<text class="f18 cff" wx:if="{{allNumber > 0}}">{{allNumber}}</text>
</view>
</view>
\ No newline at end of file
......@@ -88,4 +88,23 @@
.zhi-pro-item-info .zhi-pro-item-price .gouwuche image{
width: 36rpx;
height: 32rpx;
}
.gouwuche-big{
position: fixed;
right: 30rpx;
bottom: 190rpx;
width: 110rpx;
height: 110rpx;
}
.gouwuche-big image{
width: 100%;
height: 100%;
}
.gouwuche-big text{
position: absolute;
right: 25rpx;
top: 5rpx;
padding: 0 4rpx;
background-color: #E21436;
border-radius:11rpx;
}
\ No newline at end of file
......@@ -10,41 +10,51 @@ Page({
allPrice: 0,
AddrObj: [],
AddrYes: true,
isGowuche: false
isGowuche: false,
isOrder: false,
},
setOrder: function(){
console.log(this.data.AddrObj)
let msg = {
GuestId: app.state.admin.id,
ShopList: [],
GuestAddressId: this.data.AddrObj.Id
}
this.data.dataList.map(x=>{
let obj = {
"Id": 0,
"CustomerId": 0,
"GuestId": 0,
"CommodityId": 0,
"CostPrice": 0,
"SellPrice": 0,
"Number": 0
let orderId = null
if (this.data.isOrder) {
// 已下单未支付
orderId = this.data.dataList[0].CorderId
} else {
let msg = {
GuestId: app.state.admin.id,
ShopList: [],
GuestAddressId: this.data.AddrObj.Id
}
obj.Id = this.data.isGowuche ? x.Id : 0
obj.CommodityId = this.data.isGowuche ? x.CommodityId : x.Id
obj.CostPrice = x.CostPrice
obj.SellPrice = x.SellPrice
obj.Number = x.number
msg.ShopList.push(obj)
})
app.$api('ShopOrder_post_AddCommodityOrderService', msg).then(res => {
console.log(res)
}).catch(err => {
wx.showToast({
title: err.message,
icon: 'none',
duration: 2000
this.data.dataList.map(x => {
let obj = {
"Id": 0,
"CustomerId": 0,
"GuestId": 0,
"CommodityId": 0,
"CostPrice": 0,
"SellPrice": 0,
"Number": 0
}
obj.Id = this.data.isGowuche ? x.Id : 0
obj.CommodityId = this.data.isGowuche ? x.CommodityId : x.Id
obj.CostPrice = x.CostPrice
obj.SellPrice = x.SellPrice
obj.Number = x.number
msg.ShopList.push(obj)
})
app.$api('ShopOrder_post_AddCommodityOrderService', msg).then(res => {
console.log(res)
// orderId = this.data.dataList[0].CorderId
}).catch(err => {
wx.showToast({
title: err.message,
icon: 'none',
duration: 2000
})
})
}
console.log(orderId)
wx.redirectTo({
url: '/pages/Product/payOK/payOK?id=' + orderId,
})
},
jumpEidtAddrPage: function (e) {
......@@ -125,11 +135,16 @@ Page({
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
if (options.isGowuche) {
if (typeof (options.isGowuche) !== "undefined") {
this.setData({
isGowuche: true
})
}
if (typeof (options.isOrder) !== "undefined") {
this.setData({
isOrder: true
})
}
wx.setNavigationBarTitle({
title: '确认订单'
})
......
......@@ -12,6 +12,7 @@ Page({
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
console.log(options)
wx.setNavigationBarTitle({
title: '查看物流'
})
......
......@@ -16,13 +16,42 @@
物流状态
</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 class="item-box">
<view class="item">
<image class="left-raduis-img" wx:show="{{false}}" src="/images/product/left-raduis.png"></image>
<view class="info c55">
<view class="f24">四川省成都市双流县华阳公司 已签收 签收人:金棕榈云生活超市菜鸟驿站 感谢使用圆通速递,期待再次为您服务</view>
<view class="f20">2018-12-11 15:18:48</view>
</view>
</view>
<view class="item">
<view class="left-raduis"></view>
<view class="info c88">
<view class="f24">四川省成都市双流县华阳公司 已签收 签收人:金棕榈云生活超市菜鸟驿站 感谢使用圆通速递,期待再次为您服务</view>
<view class="f20">2018-12-11 15:18:48</view>
</view>
</view>
<view class="item">
<view class="left-raduis"></view>
<view class="info c88">
<view class="f24">四川省成都市双流县华阳公司 已签收 签收人:金棕榈云生活超市菜鸟驿站 感谢使用圆通速递,期待再次为您服务</view>
<view class="f20">2018-12-11 15:18:48</view>
</view>
</view>
<view class="item">
<view class="left-raduis"></view>
<view class="info c88">
<view class="f24">四川省成都市双流县华阳公司 已签收 签收人:金棕榈云生活超市菜鸟驿站 感谢使用圆通速递,期待再次为您服务</view>
<view class="f20">2018-12-11 15:18:48</view>
</view>
</view>
<view class="item">
<view class="left-raduis"></view>
<view class="info c88">
<view class="f24">四川省成都市双流县华阳公司 已签收 签收人:金棕榈云生活超市菜鸟驿站 感谢使用圆通速递,期待再次为您服务</view>
<view class="f20">2018-12-11 15:18:48</view>
</view>
</view>
</view>
</scroll-view>
</view>
\ No newline at end of file
......@@ -28,6 +28,8 @@
}
.logistics-scroll{
height: calc(100vh - 322rpx);
}
.item-box{
padding: 30rpx 45rpx;
}
.logistics-scroll view.item{
......@@ -41,15 +43,20 @@
background:rgba(233,233,233,1);
border-radius:50%;
position: absolute;
left: 7rpx;
left: -7rpx;
z-index: 66;
}
.left-raduis-img{
width: 30rpx;
height: 30rpx;
position: absolute;
left: 15rpx;
left: -15rpx;
z-index: 66;
}
.info{
padding: 30rpx 0;
border-bottom: 1px solid rgba(233,233,233,1);
}
.item-box .item:first-child .info{
padding-top: 0;
}
\ No newline at end of file
......@@ -44,6 +44,29 @@ Page({
},
dataList: [],
},
goSettlement: function (e) {
let index = e.currentTarget.dataset.index;
let id = e.currentTarget.dataset.id;
let obj = this.data.dataList[index],
obj2 = [];
obj.OrderDetailsList.map(x=>{
x.Id = x.CommodityId
x.CostPrice = x.CommodityCostPrice
x.number = x.CommodityNum
x.Name = x.CommodityName
x.SellPrice = x.CommodityPrice
x.SellPrice = x.CommodityPrice
x.CorderId = id
obj2.push(x)
})
wx.setStorage({
key: "product",
data: obj2
})
wx.navigateTo({
url: "/pages/Product/Settlement/Settlement?isOrder=1",
})
},
goDetails: function (e){
let id = e.currentTarget.dataset.id
wx.navigateTo({
......@@ -142,7 +165,6 @@ Page({
active: options.type * 1 === 0 ? -1 : options.type * 1
})
}
this.getList()
wx.setNavigationBarTitle({
title: '我的订单'
})
......@@ -159,7 +181,11 @@ Page({
* 生命周期函数--监听页面显示
*/
onShow: function () {
this.setData({
'msg.pageIndex': 1,
pageIndex: 1,
})
this.getList()
},
/**
......
......@@ -31,7 +31,7 @@
</view>
<view class="btn-box" wx:if="{{item.COrderState !== 0}}">
<view class="f30 c99" wx:if="{{item.COrderState === 2}}" data-id="{{item.CorderId}}" bindtap="cancelOrder">取消订单</view>
<view class="f30 cee pay" wx:if="{{item.COrderState === 2}}">去支付</view>
<view class="f30 cee pay" wx:if="{{item.COrderState === 2}}" data-id="{{item.CorderId}}" bindtap="goSettlement" data-index="{{index}}">去支付</view>
<view class="f30 c99" wx:if="{{item.COrderState === 6}}">查看物流</view>
</view>
</view>
......
......@@ -9,6 +9,28 @@ Page({
},
CorderId: 0
},
goSettlement: function (e) {
let index = e.currentTarget.dataset.index;
let obj = this.data.details.OrderDetailsList,
obj2 = [];
obj.map(x => {
x.Id = x.CommodityId
x.CostPrice = x.CommodityCostPrice
x.number = x.CommodityNum
x.Name = x.CommodityName
x.SellPrice = x.CommodityPrice
x.SellPrice = x.CommodityPrice
x.CorderId = this.data.CorderId
obj2.push(x)
})
wx.setStorage({
key: "product",
data: obj2
})
wx.navigateTo({
url: "/pages/Product/Settlement/Settlement?isOrder=1",
})
},
goLogistics: function (){
wx.navigateTo({
url: "/pages/Product/logistics/logistics?id=" + this.data.CorderId,
......@@ -62,6 +84,7 @@ Page({
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
console.log(options)
this.setData({
CorderId: options.id
})
......
......@@ -17,7 +17,7 @@
<text class="c30 cff">{{details.COrderStateStr}}</text>
</view>
</view>
<view class="wuliu-info" bindtap="goLogistics">
<view class="wuliu-info" bindtap="goLogistics" wx:if="{{details.COrderState === 3}}">
<image src="/images/mine/wuliu.png"></image>
<view>
<view>
......@@ -81,7 +81,7 @@
<view class="Gray30"></view>
<view class="btn-box" wx:if="{{details.COrderState !== 0}}">
<view class="f30 c99" wx:if="{{details.COrderState === 2}}" bindtap="cancelOrder">取消订单</view>
<view class="f30 cee pay" wx:if="{{details.COrderState === 2}}">去支付</view>
<view class="f30 cee pay" wx:if="{{details.COrderState === 2}}" bindtap="goSettlement">去支付</view>
<view class="f30 c99" wx:if="{{details.COrderState === 6}}">查看物流</view>
</view>
</view>
\ No newline at end of file
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