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

1

parent ad92ab88
...@@ -280,4 +280,12 @@ image{ ...@@ -280,4 +280,12 @@ image{
} }
.felx2{ .felx2{
flex: 2; flex: 2;
}
.body_footer{
display: flex;
justify-content: center;
align-items: center;
height: 30px;
font-size: 12px;
color: #666666;
} }
\ No newline at end of file
...@@ -9,7 +9,8 @@ ...@@ -9,7 +9,8 @@
"pages/Product/Settlement/Settlement", "pages/Product/Settlement/Settlement",
"pages/mine/mineAddrEdit/mineAddrEdit", "pages/mine/mineAddrEdit/mineAddrEdit",
"pages/mine/mineAddrList/mineAddrList", "pages/mine/mineAddrList/mineAddrList",
"pages/mine/mineOrder/mineOrder" "pages/mine/mineOrder/mineOrder",
"pages/mine/mineOrder/mineOrderDetails/mineOrderDetails"
], ],
"permission": { "permission": {
"scope.userLocation": { "scope.userLocation": {
......
...@@ -18,8 +18,17 @@ Page({ ...@@ -18,8 +18,17 @@ Page({
details: {}, details: {},
proId: '' proId: ''
}, },
goShoppingCart: function (e) { goSettlement: function() {
wx.setStorage({
key: "product",
data: [this.data.details]
})
wx.navigateTo({ wx.navigateTo({
url: "/pages/Product/Settlement/Settlement",
})
},
goShoppingCart: function (e) {
wx.switchTab({
url: '/pages/ShoppingCart/ShoppingCart', url: '/pages/ShoppingCart/ShoppingCart',
}) })
}, },
...@@ -49,34 +58,63 @@ Page({ ...@@ -49,34 +58,63 @@ Page({
[e.currentTarget.dataset.name]: !this.data[e.currentTarget.dataset.name] [e.currentTarget.dataset.name]: !this.data[e.currentTarget.dataset.name]
}) })
}, },
// regNumber: function (e){
// this.setData({
// number: e.detail.value * 1
// })
// },
// calculation: function (e) {
// let type = e.currentTarget.dataset.type
// if (type == 1) {
// this.setData({
// number: this.data.number === 1 ? 1 : this.data.number - 1
// })
// } else {
// this.setData({
// number: this.data.number + 1
// })
// }
// },
bindanimationfinish: function (e){
let index = e.detail.current
this.setData({
currentIndex: index + 1
})
},
regNumber: function (e){ regNumber: function (e){
if (isNaN(this.data.details.number * 1)) {
this.data.details.number = 1
} else {
this.data.details.number = e.detail.value * 1
}
this.setData({ this.setData({
number: e.detail.value * 1 details: this.data.details
}) })
}, },
calculation: function (e) { calculation: function (e) {
let type = e.currentTarget.dataset.type let type = e.currentTarget.dataset.type;
let details = this.data.details
if (isNaN(details.number)) {
details.number = 1
}
if (type == 1) { if (type == 1) {
details.number = details.number === 1 ? 1 : details.number - 1
this.setData({ this.setData({
number: this.data.number === 1 ? 1 : this.data.number - 1 details: details
}) })
} else { } else {
details.number = details.number + 1
this.setData({ this.setData({
number: this.data.number + 1 details: details
}) })
} }
}, },
bindanimationfinish: function (e){
let index = e.detail.current
this.setData({
currentIndex: index + 1
})
},
init: function (id){ init: function (id){
app.$api('Shop_post_GetCommodityInfo', { app.$api('Shop_post_GetCommodityInfo', {
CommodityId: id CommodityId: id
}).then(res => { }).then(res => {
console.log(res) let data = res
res.number = 1
WxParse.wxParse('Content', 'html', res.Content, this, 0); WxParse.wxParse('Content', 'html', res.Content, this, 0);
this.setData({ this.setData({
details: res details: res
...@@ -93,7 +131,6 @@ Page({ ...@@ -93,7 +131,6 @@ Page({
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
onLoad: function (options) { onLoad: function (options) {
console.log(options)
wx.setNavigationBarTitle({ wx.setNavigationBarTitle({
title: '商品详情' title: '商品详情'
}) })
......
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
<view class="product-info"> <view class="product-info">
<view class="product-info-price"> <view class="product-info-price">
<text class="f24 cee">¥</text> <text class="f24 cee">¥</text>
<text class="f36 bold cee">11.90</text> <text class="f36 bold cee">{{details.SellPrice}}</text>
<!-- <text class="f24 c66 padding-left-20">进口税:包税</text> <!-- <text class="f24 c66 padding-left-20">进口税:包税</text>
<image src="/images/product/beizhu.png"></image> --> <image src="/images/product/beizhu.png"></image> -->
</view> </view>
...@@ -94,6 +94,16 @@ ...@@ -94,6 +94,16 @@
</view> </view>
</view> </view>
</view> --> </view> -->
<view class="peisong other-info">
<text class="f24 c88 left-name">数量</text>
<view class="flex2 f24 c11 bb1e9 padr30">
<view class="sit-pirce-count padb30">
<text class="bold f30" catchtap="calculation" data-type="1" data-index="{{index}}">-</text>
<input type="number" value="{{details.number}}" data-index="{{index}}" catchtap bindinput="regNumber"></input>
<text class="bold f30" catchtap="calculation" data-type="2" data-index="{{index}}">+</text>
</view>
</view>
</view>
<view class="peisong other-info"> <view class="peisong other-info">
<text class="f24 c88 left-name">说明</text> <text class="f24 c88 left-name">说明</text>
<view class="flex2 f24 c11 padr30"> <view class="flex2 f24 c11 padr30">
...@@ -197,7 +207,7 @@ ...@@ -197,7 +207,7 @@
</view> </view>
<view class="right-btn"> <view class="right-btn">
<view class="jiagouwu" bindtap="addGwc">加入购物车</view> <view class="jiagouwu" bindtap="addGwc">加入购物车</view>
<view class="goumai">立即购买</view> <view class="goumai" bindtap="goSettlement">立即购买</view>
</view> </view>
</view> </view>
<view class="taocan-box" wx:if="{{taocanBoxShow}}" bindtap="setBoxShow" data-name="taocanBoxShow"> <view class="taocan-box" wx:if="{{taocanBoxShow}}" bindtap="setBoxShow" data-name="taocanBoxShow">
...@@ -216,7 +226,7 @@ ...@@ -216,7 +226,7 @@
<view class="f24 c11">购买数量</view> <view class="f24 c11">购买数量</view>
<view class="taocan-count"> <view class="taocan-count">
<text class="bold f30" bindtap="calculation" data-type="1">-</text> <text class="bold f30" bindtap="calculation" data-type="1">-</text>
<input type="number" value="{{number}}" bindinput="regNumber"></input> <input type="number" value="{{details.number}}" bindinput="regNumber"></input>
<text class="bold f30" bindtap="calculation" data-type="2">+</text> <text class="bold f30" bindtap="calculation" data-type="2">+</text>
</view> </view>
</view> </view>
......
...@@ -271,4 +271,17 @@ ...@@ -271,4 +271,17 @@
padding: 23rpx; padding: 23rpx;
background:linear-gradient(90deg,rgba(226,20,54,1),rgba(253,78,107,1)); background:linear-gradient(90deg,rgba(226,20,54,1),rgba(253,78,107,1));
border-radius:37px; border-radius:37px;
}
.ProductDetails .sit-pirce-count{
display: flex;
justify-content: flex-end;
align-items: center;
}
.sit-pirce-count text {
padding: 0 20rpx;
}
.sit-pirce-count input{
width: 60rpx;
padding: 0 10rpx;
text-align: center;
} }
\ No newline at end of file
...@@ -6,16 +6,130 @@ Page({ ...@@ -6,16 +6,130 @@ Page({
*/ */
data: { data: {
wxPay: false, wxPay: false,
dataList: [],
allPrice: 0,
AddrObj: [],
AddrYes: true,
isGowuche: 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
}
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
})
})
},
jumpEidtAddrPage: function (e) {
let url = "/pages/mine/mineAddrEdit/mineAddrEdit"
if (e.currentTarget.dataset.index >= 0) {
url = url + '?edit=1&hide=1'
let _this = this;
wx.setStorage({
key: "addrEdit",
data: _this.data.AddrObj
})
}
wx.navigateTo({
url: url,
})
},
getAddrList: function () {
app.$api('ShopGuest_get_GetGuestAddressListService', {
GuestAccountId: app.state.admin.id
}).then(res => {
console.log(res, res.length < 1)
if (res.length < 1) {
this.setData({
AddrYes: false
})
return
} else {
this.setData({
AddrYes: true
})
}
let obj = {}, flag = false;
res.map(x=>{
if (x.IsDefault === 1) {
obj = x
flag = true
}
})
if (!flag) {
obj = res[0]
}
this.setData({
AddrObj: obj
})
}).catch(err => {
wx.showToast({
title: err.message,
icon: 'none',
duration: 2000
})
})
}, },
changePayway: function () { changePayway: function () {
this.setData({ this.setData({
wxPay: !this.data.wxPay wxPay: !this.data.wxPay
}) })
}, },
init: function (){
let _this = this;
wx.getStorage({
key: 'product',
success: function(res) {
console.log(res)
let list = res.data
let price = 0;
list.map(x=>{
x.number = x.number ? x.number : x.Number
price = price + (x.number * x.SellPrice)
})
_this.setData({
dataList: res.data,
allPrice: price
})
},
})
},
/** /**
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
onLoad: function (options) { onLoad: function (options) {
if (options.isGowuche) {
this.setData({
isGowuche: true
})
}
wx.setNavigationBarTitle({ wx.setNavigationBarTitle({
title: '确认订单' title: '确认订单'
}) })
...@@ -32,7 +146,8 @@ Page({ ...@@ -32,7 +146,8 @@ Page({
* 生命周期函数--监听页面显示 * 生命周期函数--监听页面显示
*/ */
onShow: function () { onShow: function () {
this.init()
this.getAddrList()
}, },
/** /**
......
<view class="Settlement commonF"> <view class="Settlement commonF">
<view class="Settlement-addr"> <view class="Settlement-addr">
<view class="sar-tit f28 c11">李思思 <text>13800138000</text></view> <view wx:if="{{AddrYes}}">
<view class="sar-info"> <view class="sar-tit f28 c11">{{AddrObj.LinkMan}} <text>{{AddrObj.LinkTel}}</text></view>
<image src="/images/mine/dingwei2.png"></image> <view class="sar-info">
<view class="text2 f28 c22">四川省成都市高新区天晖路曙光国际B座1503(美豪丽致)酒店楼上</view> <image src="/images/mine/dingwei2.png"></image>
<view class="edit-btn f28">修改</view> <view class="text2 f28 c22">{{AddrObj.DetaileAddress}}</view>
<view class="edit-btn f28" bindtap="jumpEidtAddrPage" data-index="1">修改</view>
</view>
</view>
<view class="add-btn f30" bindtap="jumpEidtAddrPage" wx:else>
<text>新建收货地址</text>
</view> </view>
</view> </view>
<image class="se-line" src="/images/mine/line.png"></image> <image class="se-line" src="/images/mine/line.png"></image>
<view class="Gray30"></view> <!-- <view class="Gray30"></view>
<view class="shenfenz f24 c11"> <view class="shenfenz f24 c11">
<view>身份证号</view> <view>身份证号</view>
<view>5139**********1234</view> <view>5139**********1234</view>
</view> </view> -->
<view class="Gray30"></view> <view class="Gray30"></view>
<scroll-view class="Settlement-scroll-view" scroll-y> <scroll-view class="Settlement-scroll-view" scroll-y>
<view class="sett-pro-item"> <view class="sett-pro-item" wx:for="{{dataList}}" wx:key="index">
<view class="left">
<image mode="aspectFit" src="/images/home/bizi.png"></image>
</view>
<view class="right c11 bold">
<view class="f26 text2">日本进口 黛珂 (Cosme Decorte) 高妆水日本进口 黛珂 (Cosme Decorte) 高妆水...</view>
<view class="price">
<view class="f28">¥ 561.00</view>
<view class="f22 c88">x1</view>
</view>
</view>
</view>
<view class="sett-pro-item">
<view class="left">
<image mode="aspectFit" src="/images/home/chaozhi.png"></image>
</view>
<view class="right c11 bold">
<view class="f26 text2">日本进口 黛珂 (Cosme Decorte) 高妆水日本进口 黛珂 (Cosme Decorte) 高妆水...</view>
<view class="price">
<view class="f28">¥ 561.00</view>
<view class="f22 c88">x1</view>
</view>
</view>
</view>
<view class="sett-pro-item">
<view class="left"> <view class="left">
<image mode="aspectFit" src="/images/home/demo2.jpg"></image> <image mode="aspectFit" src="{{item.FlowImgList[0]}}"></image>
</view> </view>
<view class="right c11 bold"> <view class="right c11 bold">
<view class="f26 text2">日本进口 黛珂 (Cosme Decorte) 高妆水日本进口 黛珂 (Cosme Decorte) 高妆水...</view> <view class="f26 text2">{{item.Name}}</view>
<view class="price"> <view class="price">
<view class="f28">¥ 561.00</view> <view class="f28">¥ {{item.SellPrice}}</view>
<view class="f22 c88">x1</view> <view class="f22 c88">x{{item.number}}</view>
</view> </view>
</view> </view>
</view> </view>
...@@ -59,7 +40,7 @@ ...@@ -59,7 +40,7 @@
</view> </view>
<view class="allprice"> <view class="allprice">
<text class="f24 c99">共2件 </text> <text class="f24 c99">共2件 </text>
<text class="f24 c11">小计: <text class="f30 cee">¥600.00</text></text> <text class="f24 c11">小计: <text class="f30 cee">¥{{allPrice}}</text></text>
</view> </view>
</view> </view>
<view class="Gray30"></view> <view class="Gray30"></view>
...@@ -76,9 +57,9 @@ ...@@ -76,9 +57,9 @@
<view class="tips f22 c99">点击支付则表示您同意 <text class="c11">《用户购买须知》</text></view> <view class="tips f22 c99">点击支付则表示您同意 <text class="c11">《用户购买须知》</text></view>
<view class="pay-box"> <view class="pay-box">
<view class="f24"> <view class="f24">
总计: <text class="cee bold f30">¥600.00</text> 总计: <text class="cee bold f30">¥{{allPrice}}</text>
</view> </view>
<view class="pay-btn f30 cff"> <view class="pay-btn f30 cff" bindtap="setOrder">
立即支付 立即支付
</view> </view>
</view> </view>
......
.Settlement-scroll-view { .Settlement-scroll-view {
height: calc(100vh - 820rpx); max-height: calc(100vh - 820rpx);
} }
.Settlement-addr{ .Settlement-addr{
height: 190rpx; height: 190rpx;
...@@ -127,3 +127,15 @@ ...@@ -127,3 +127,15 @@
line-height: 70rpx; line-height: 70rpx;
text-align: center; text-align: center;
} }
.add-btn{
width: calc(100vw - 60rpx);
padding: 23rpx 0;
display: flex;
justify-content: center;
align-items: center;
height: 74rpx;
border: 1px solid rgba(226,20,54,1);
border-radius:37rpx;
margin-top: 40rpx;
color: rgba(226,20,54,1);
}
\ No newline at end of file
...@@ -17,11 +17,23 @@ Page({ ...@@ -17,11 +17,23 @@ Page({
pageSize: 10, pageSize: 10,
CustomerId: 0, CustomerId: 0,
GuestId: app.state.admin.id, GuestId: app.state.admin.id,
} },
totalPage: 0,
pageIndex: 1,
}, },
submit: function (){ submit: function (){
let list = []
this.data.dataList.map(x=>{
if (x.select) {
list.push(x)
}
})
wx.setStorage({
key: "product",
data: list
})
wx.navigateTo({ wx.navigateTo({
url: '/pages/Product/Settlement/Settlement', url: '/pages/Product/Settlement/Settlement?isGowuche=1',
}) })
}, },
checkAll: function (){ checkAll: function (){
...@@ -44,7 +56,11 @@ Page({ ...@@ -44,7 +56,11 @@ Page({
} }
}, },
regNumber: function (e) { regNumber: function (e) {
this.data.dataList[e.currentTarget.dataset.index].ShopNum = e.detail.value * 1 if (isNaN(e.detail.value * 1)) {
this.data.dataList[e.currentTarget.dataset.index].Number = 1
} else {
this.data.dataList[e.currentTarget.dataset.index].Number = e.detail.value * 1
}
this.setData({ this.setData({
dataList: this.data.dataList dataList: this.data.dataList
}) })
...@@ -54,12 +70,12 @@ Page({ ...@@ -54,12 +70,12 @@ Page({
let index = e.currentTarget.dataset.index; let index = e.currentTarget.dataset.index;
let dataList = this.data.dataList let dataList = this.data.dataList
if (type == 1) { if (type == 1) {
dataList[index].ShopNum = dataList[index].ShopNum === 1 ? 1 : dataList[index].ShopNum - 1 dataList[index].Number = dataList[index].Number === 1 ? 1 : dataList[index].Number - 1
this.setData({ this.setData({
dataList: dataList dataList: dataList
}) })
} else { } else {
dataList[index].ShopNum = dataList[index].ShopNum + 1 dataList[index].Number = dataList[index].Number + 1
this.setData({ this.setData({
dataList: dataList dataList: dataList
}) })
...@@ -73,8 +89,8 @@ Page({ ...@@ -73,8 +89,8 @@ Page({
this.data.dataList.map(x => { this.data.dataList.map(x => {
if (x.select) { if (x.select) {
selectNum += 1; selectNum += 1;
// allShuiMoney += x.shuifei * x.ShopNum; // allShuiMoney += x.shuifei * x.Number;
allMoney += x.SellPrice * x.ShopNum; allMoney += x.SellPrice * x.Number;
} }
}) })
this.setData({ this.setData({
...@@ -164,7 +180,7 @@ Page({ ...@@ -164,7 +180,7 @@ Page({
success(res) { success(res) {
if (res.confirm) { if (res.confirm) {
app.$api('Shop_post_DelCommodityShopInfo', { app.$api('Shop_post_DelCommodityShopInfo', {
CommodityId: id, Id: id,
GuestId: app.state.admin.id GuestId: app.state.admin.id
}).then(res => { }).then(res => {
wx.showToast({ wx.showToast({
...@@ -249,6 +265,12 @@ Page({ ...@@ -249,6 +265,12 @@ Page({
wx.showLoading({ wx.showLoading({
title: '加载中', title: '加载中',
}); });
this.setData({
'msg.pageIndex': 1,
selectNum: selectNum,
allMoney: allMoney,
allShuiMoney: allShuiMoney,
})
this.getList() this.getList()
}, },
......
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
</view> </view>
<view class="sit-pirce-count"> <view class="sit-pirce-count">
<text class="bold f30" catchtap="calculation" data-type="1" data-index="{{index}}">-</text> <text class="bold f30" catchtap="calculation" data-type="1" data-index="{{index}}">-</text>
<input type="number" value="{{item.ShopNum}}" data-index="{{index}}" catchtap bindinput="regNumber"></input> <input type="number" value="{{item.Number}}" data-index="{{index}}" catchtap bindinput="regNumber"></input>
<text class="bold f30" catchtap="calculation" data-type="2" data-index="{{index}}">+</text> <text class="bold f30" catchtap="calculation" data-type="2" data-index="{{index}}">+</text>
</view> </view>
</view> </view>
......
...@@ -56,7 +56,7 @@ ...@@ -56,7 +56,7 @@
flex: 2; flex: 2;
} }
.ShoppingCart-item-info-r> view:nth-child(1){ .ShoppingCart-item-info-r> view:nth-child(1){
height: 60rpx; height: 80rpx;
margin-bottom: 20rpx; margin-bottom: 20rpx;
} }
.sit-guige{ .sit-guige{
......
...@@ -15,30 +15,30 @@ ...@@ -15,30 +15,30 @@
<view class="order-box"> <view class="order-box">
<view class="order-box-tit"> <view class="order-box-tit">
<view class="c30 c11 bold">我的订单</view> <view class="c30 c11 bold">我的订单</view>
<view bindtap="jumpPage" data-url="/pages/mine/mineOrder/mineOrder"> <view bindtap="jumpPage" data-url="/pages/mine/mineOrder/mineOrder?type=0">
<text class="f24 c99">查看更多</text><image src="/images/product/right.png"></image> <text class="f24 c99">查看更多</text><image src="/images/product/right.png"></image>
</view> </view>
</view> </view>
<view class="order-type"> <view class="order-type">
<view bindtap="jumpPage" data-url="/pages/mine/mineOrder/mineOrder?type=1"> <view bindtap="jumpPage" data-url="/pages/mine/mineOrder/mineOrder?type=2">
<view> <view>
<image src="/images/mine/qianbao.png"></image> <image src="/images/mine/qianbao.png"></image>
</view> </view>
<view>待付款</view> <view>待付款</view>
</view> </view>
<view bindtap="jumpPage" data-url="/pages/mine/mineOrder/mineOrder?type=2"> <view bindtap="jumpPage" data-url="/pages/mine/mineOrder/mineOrder?type=5">
<view> <view>
<image src="/images/mine/baoguo.png"></image> <image src="/images/mine/baoguo.png"></image>
</view> </view>
<view>待发货</view> <view>待发货</view>
</view> </view>
<view bindtap="jumpPage" data-url="/pages/mine/mineOrder/mineOrder?type=3"> <view bindtap="jumpPage" data-url="/pages/mine/mineOrder/mineOrder?type=6">
<view> <view>
<image src="/images/mine/che.png"></image> <image src="/images/mine/che.png"></image>
</view> </view>
<view>待收货</view> <view>待收货</view>
</view> </view>
<view bindtap="jumpPage" data-url="/pages/mine/mineOrder/mineOrder?type=4"> <view bindtap="jumpPage" data-url="/pages/mine/mineOrder/mineOrder?type=7">
<view> <view>
<image src="/images/mine/wancheng.png"></image> <image src="/images/mine/wancheng.png"></image>
</view> </view>
......
...@@ -19,7 +19,8 @@ Page({ ...@@ -19,7 +19,8 @@ Page({
province: '', province: '',
city: '', city: '',
county: '', county: '',
switch1Checked: false switch1Checked: true,
IsDefaultShow: true,
}, },
switch1Change: function (e){ switch1Change: function (e){
console.log(e) console.log(e)
...@@ -137,6 +138,11 @@ Page({ ...@@ -137,6 +138,11 @@ Page({
} }
}) })
} }
if (options.hide) {
this.setData({
IsDefaultShow: false,
})
}
}, },
/** /**
......
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
<view class="f20">提醒:每次下单会默认推荐使用该地址</view> <view class="f20">提醒:每次下单会默认推荐使用该地址</view>
</view> </view>
<view> <view>
<switch color="#E21436" checked="{{switch1Checked}}" bindchange="switch1Change"/> <switch color="#E21436" disabled="{{!IsDefaultShow}}" checked="{{switch1Checked}}" bindchange="switch1Change"/>
</view> </view>
</view> </view>
</view> </view>
......
// pages/mine/mineOrder/mineOrder.js let app = getApp();
Page({ Page({
/** /**
* 页面的初始数据 * 页面的初始数据
*/ */
data: { data: {
active: -1,
statusList: [
{
id: -1,
name: '全部'
},
{
id: 2,
name: '待支付'
},
{
id: 5,
name: '待发货'
},
{
id: 6,
name: '待收货'
},
{
id: 7,
name: '已完成'
},
{
id: 1,
name: '取消'
},
],
msg: {
AccountName: "", //旅客名称
CustomerId: 0, //同行编号
SaleId: 0, //销售编号
COrderState: -1, //订单状态
ReciveLeaderId: 0,//接单领队
pageIndex: 1,
pageSize: 10,
total: 0,
},
dataList: [],
},
goDetails: function (e){
let id = e.currentTarget.dataset.id
wx.navigateTo({
url: "/pages/mine/mineOrder/mineOrderDetails/mineOrderDetails?id=" + id,
})
},
changeStatus: function (e) {
let id = e.currentTarget.dataset.id
this.setData({
active: id,
'msg.pageIndex': 1,
pageIndex: 1
})
this.getList()
},
cancelOrder: function(e) {
let id = e.currentTarget.dataset.id
console.log(id)
let _this = this;
wx.showModal({
title: '提示',
content: '是否取消?取消后不可恢复!',
success(res) {
if (res.confirm) {
app.$api('ShopOrder_post_CancelOrderStatusService', { CorderId: id}).then(res => {
wx.showToast({
title: '删除成功',
icon: 'none',
duration: 2000
})
_this.setData({
pageIndex: 1,
'msg.pageIndex': 1
})
_this.getList()
}).catch(err => {
wx.showToast({
title: err.message,
icon: 'none',
duration: 2000
})
})
} else if (res.cancel) {
}
}
})
},
scrollGetMore: function () {
this.setData({
'msg.pageIndex': this.data.pageIndex + 1,
})
this.getList(1)
},
getList: function (type){
if (this.data.pageIndex >= this.data.totalPage && type) {
return
}
this.data.msg.COrderState = this.data.active
app.$api('ShopOrder_get_GetCommodityOrderPageListService', this.data.msg).then(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
}
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
})
})
}, },
/** /**
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
onLoad: function (options) { onLoad: function (options) {
console.log(options) console.log(options.type * 1)
if (options.type) {
this.setData({
active: options.type * 1 === 0 ? -1 : options.type * 1
})
}
this.getList()
wx.setNavigationBarTitle({ wx.setNavigationBarTitle({
title: '我的订单' title: '我的订单'
}) })
......
<view class="mineOrder commonF"> <view class="mineOrder commonF">
<scroll-view scroll-x style="width: 100%;white-space: nowrap;" class="top-scroll">
<view class="top-scroll-nav">
<view wx:for="{{statusList}}" wx:key="index" bindtap="changeStatus" class="{{active === item.id ? 'active' : ''}}" data-id="{{item.id}}">{{item.name}}</view>
</view>
</scroll-view>
<scroll-view scroll-y class="order-box" bindscrolltolower="scrollGetMore">
<view class="order-item" wx:for="{{dataList}}" wx:key="index" wx:for-item="item" wx:for-index="index">
<view class="Gray30"></view>
<view class="oi-tit">
<view class="f24 c11">{{item.CreateTimeStr}}</view>
<view class="f26 cee">{{item.COrderStateStr}}</view>
</view>
<view class="pro-box" bindtap="goDetails" data-id="{{item.CorderId}}">
<view class="sett-pro-item" wx:for="{{item.OrderDetailsList}}" wx:key="sIndex" wx:for-item="sItem" wx:for-index="sIndex">
<view class="left">
<image mode="aspectFit" src="{{sItem.FlowImgList[0]}}"></image>
</view>
<view class="right c11 bold">
<view class="f26 text2">{{sItem.CommodityName}} </view>
<view class="price">
<view class="f28">¥ {{sItem.CommodityPrice}}</view>
<view class="f22 c88">x{{sItem.CommodityNum}}</view>
</view>
</view>
</view>
<view class="bottom-price">
<view class="f22 c88">共{{item.OrderDetailsList.length}}件</view>
<view class="f26 c11">应付: ¥{{item.PreferPrice}}.00</view>
</view>
</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 c99" wx:if="{{item.COrderState === 6}}">查看物流</view>
</view>
</view>
<view class='body_footer'>{{pageIndex >= totalPage ? '没有更多了...' : '上拉获取更多数据'}}</view>
</scroll-view>
</view> </view>
\ No newline at end of file
/* pages/mine/mineOrder/mineOrder.wxss */ .top-nav{
\ No newline at end of file width: 100%;
}
.top-scroll-nav {
display: flex;
}
.top-scroll-nav view{
padding: 30rpx;
text-align: center;
border-bottom: 4rpx solid rgba(0,0,0,0);
flex: 1;
}
.top-scroll-nav view.active{
color: #E21436;
border-bottom: 4rpx solid #E21436;
}
.order-box {
height: calc(100vh - 100rpx)
}
.order-box .order-item .oi-tit{
display: flex;
justify-content: space-between;
align-items: center;
padding: 35rpx 30rpx;
}
.pro-box{
padding: 30rpx 30rpx 0 30rpx;
}
.sett-pro-item {
display: flex;
align-items: center;
padding: 0 0 30rpx 0;
}
.sett-pro-item .left{
width: 170rpx;
height: 170rpx;
display: flex;
justify-content: center;
align-items: center;
margin-right: 18rpx;
}
.sett-pro-item .left image{
max-height: 150rpx;
}
.sett-pro-item .right{
flex: 2;
}
.sett-pro-item .right .price{
display: flex;
justify-content: space-between;
align-content: center;
margin-top: 50rpx;
}
.pro-box .bottom-price{
display: flex;
justify-content: space-between;
padding: 35rpx 0;
border-top: 1px solid #E5E5E5;
border-bottom: 1px solid #E5E5E5;
}
.btn-box{
display: flex;
align-items: center;
justify-content: flex-end;
padding: 15rpx 30rpx;
}
.btn-box view{
margin-left: 30rpx;
padding: 10rpx 22rpx;
border: 1px solid rgb(192, 192, 192);
border-radius: 35px;
text-align: center;
}
.btn-box view.pay{
border-color: #E21436;
}
\ No newline at end of file
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
</template> </template>
<template name="wxParseImg"> <template name="wxParseImg">
<image class="{{item.classStr}} wxParse-{{item.tag}}" data-from="{{item.from}}" data-src="{{item.attr.src}}" data-idx="{{item.imgIndex}}" src="{{item.attr.src}}" mode="aspectFit" bindload="wxParseImgLoad" bindtap="wxParseImgTap" mode="widthFix" style="width:{{item.width}}px;" <image class="{{item.classStr}} wxParse-{{item.tag}}" data-from="{{item.from}}" data-src="{{item.attr.src}}" data-idx="{{item.imgIndex}}" src="{{item.attr.src}}" mode="aspectFit" bindload="wxParseImgLoad" bindtap="wxParseImgTap" mode="widthFix"
/> />
</template> </template>
......
...@@ -105,6 +105,19 @@ ...@@ -105,6 +105,19 @@
"pathName": "pages/mine/mineAddrEdit/mineAddrEdit", "pathName": "pages/mine/mineAddrEdit/mineAddrEdit",
"query": "", "query": "",
"scene": null "scene": null
},
{
"id": -1,
"name": "我的订单",
"pathName": "pages/mine/mineOrder/mineOrder",
"query": "",
"scene": null
},
{
"id": -1,
"name": "订单详情",
"pathName": "pages/mine/mineOrder/mineOrderDetails/mineOrderDetails",
"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