Commit 950a961f by 赵雅纹

Merge branch 'dev_7.1.0' into feature-zyw-sc

parents 64c751ff 2331e964
......@@ -19,7 +19,6 @@ Component({
currentRoute: `/${utils.getCurrentPageUrl()}`
})
},
// pages/consumptionDetails/consumptionDetails
observers: {
currentRoute(nRoute, oRoute) {
console.log('nRoute, oRoute', nRoute, oRoute)
......@@ -38,12 +37,12 @@ Component({
{
active: '/assets/imgs/heart-primary.png',
inactive: '/assets/imgs/heart-default.png',
route: '/pages/consumptionDetails/consumptionDetails'
route: '/pages/userCenter/userCenter'
},
{
active: '/assets/imgs/heart-primary.png',
inactive: '/assets/imgs/heart-default.png',
route: '/pages/home/home'
route: '/pages/category/category'
},
{
active: '/assets/imgs/heart-primary.png',
......
<!--component/scrollDel/scrollDel.wxml-->
<scroll-view scroll-y="{{isScroll}}" style='height:{{windowHeight}}px'>
<!--<scroll-view scroll-y="{{isScroll}}" style='height:{{windowHeight}}px'>-->
<scroll-view scroll-y="{{isScroll}}">
<block class="cart-item" wx:key="item" wx:for="{{cartList}}">
<view data-index='{{index}}' class="order-item cart-list" bindtouchstart="drawStart" bindtouchmove="drawMove" bindtouchend="drawEnd" style="right:{{item.right}}rpx">
<view data-index="{{index}}">
......
......@@ -52,20 +52,22 @@ wxService.page({
})
// 1556108807316001
// 1556108807316000
const trolleySku = {
count: 1,
skuId: '1556108807316001'
}
// 加入购物车
wxService.post('/sale/trolley/put', trolleySku).then(res => {
if (res) {
const { result } = res.data
if (result == 0) {
wx.hideLoading()
this.getCartList()
}
}
})
// const trolleySku = {
// count: 1,
// skuId: '1556108807316001'
// }
// // 加入购物车
// wxService.post('/sale/trolley/put', trolleySku).then(res => {
// if (res) {
// const { result } = res.data
// if (result == 0) {
// wx.hideLoading()
// this.getCartList()
// }
// }
// })
},
// 查询 /trolley/query
getCartList() {
......
......@@ -12,6 +12,7 @@
</view>
</view>
<view class="cart-content" wx:if="{{cartList.length}}">
<!-- 购物车列表 -->
<scroll-del
cartList="{{cartList}}"
bind:checkProChange="checkProChange"
......@@ -23,33 +24,6 @@
/>
</view>
<!-- 购物车列表 -->
<!-- <view class="cart-content" wx:if="{{cartList.length}}">
<view class="cart-item" wx:for="{{cartList}}" wx:key="{{index}}">
<view class="cart-list" bindtouchstart="touchS" bindtouchmove="touchM" bindtouchend="touchE" style="{{item.shows}}" data-index="{{index}}">
<view class="select-radio" data-index="{{index}}">
<icon size="16" type="{{item.checked ? 'success' : 'circle'}}" color="{{checkedColor}}" data-index="{{index}}" catchtap="checkPro"></icon>
</view>
<view class="pro-info">
<image class="pro-img" src="/assets/imgs/7_1_0/icon.png" mode="widthFix"></image>
<view class="pro-right-info">
<view class="pro-name">{{item.productName}}</view>
<view class="pro-sku">{{item.skuSpec}}</view>
<view class="pro-price">
<view class="price">¥{{item.price}}</view>
<view class="pro-num-edit">
<button class="redus-num" data-index="{{index}}" catchtap="minusNum">-</button>
<input class="pro-num-edit-input" type="number" data-index="{{index}}" catchtap bindblur="blurNum" bindinput="inputNum" value="{{item.count}}"></input>
<button class="add-num" data-index="{{index}}" catchtap="addNum">+</button>
</view>
</view>
</view>
</view>
</view>
<view class="delete" data-index="{{index}}" data-skuId="{{item.skuId}}" bindtap="deletePro">删除</view>
</view>
</view>-->
<!-- 失效宝贝 -->
<view class="overdue-pro" wx:if="{{outGoods.length}}">
<view class="clear-btn">清除失效商品</view>
......@@ -71,7 +45,8 @@
<view class="empty" wx-if="{{cartList !== null && cartList.length == 0}}">亲,您的购物车还空空的哟~</view>
<!-- 底部 -->
<view class="cart-bottom" style="bottom:{{currentHeight}}px">
<!-- <view class="cart-bottom" style="bottom:{{currentHeight}}px">-->
<view class="cart-bottom">
<view class="total">
<view class="select-radio all-radio" bindtap="checkAll">
<icon type="{{checkAll ? 'success' : 'circle'}}" color="{{checkedColor}}" size="16" />
......
......@@ -162,6 +162,7 @@ page{
position: fixed;
left: 0;
/* bottom: 124rpx; */
bottom: 0rpx;
display: flex;
align-items: center;
......
{
"navigationBarTitleText": "我的",
"usingComponents": {}
"usingComponents": {
"bottom-tabs": "./../../component/bottomTabs/bottomTabs"
}
}
\ No newline at end of file
......@@ -193,3 +193,4 @@
</view>
</view>
<bottom-tabs />
\ No newline at end of file
......@@ -44,7 +44,8 @@ wxService.page({
orderList: null,
totalPages: 0,
subImgs: [],
trade: '' // 订单状态(C:取消;N:新建,P:已支付;D:已发货;R:已收货)
trade: '', // 订单状态(C:取消;N:新建,P:已支付;D:已发货;R:已收货)
no_data: true
},
/**
......@@ -61,20 +62,54 @@ wxService.page({
this.initOrderList(this.data.pageNo, this.data.pageSize, this.data.trade)
},
// 确认收货
handelConfirmReceipt() {
handelConfirmReceipt(e) {
const { id } = e.currentTarget.dataset
wx.showLoading({
title: '加载中',
mask: true
})
wxService.post(`/sale/trade/buyer/confirm/${id}`).then(res => {
if (res) {
const { result, data } = res.data
if (result == 0) {
wx.hideLoading()
this.setData({
})
}
}
})
},
handelDetail(e) {
// const {detail} = e.currentTarget.dataset
const { id } = e.currentTarget.dataset
wxService.router(`/pages/orderDetail/orderDetail?id=${id}`)
},
initOrderList(pageNo, pageSize,trade) {
//点击切换tab
switchTab(e) {
const { type, status } = e.currentTarget.dataset
const { currentIndex } = this.data
if (currentIndex == type) return false
this.setData({
currentIndex: type,
pageNo: 1,
orderList: [],
trade: '',
no_data: true
}, () => {
if (type == 5 && status == 'RF') {
this.getRefundList(this.data.pageNo, this.data.pageSize)
} else {
this.initOrderList(this.data.pageNo, this.data.pageSize, status)
}
})
},
initOrderList(pageNo, pageSize, trade) {
wx.showLoading({
title: '加载中',
mask: true
})
const params = {trade}
const params = { trade }
wxService.post(`/sale/trade/buyer/history?pageNum=${pageNo}&pageSize=${pageSize}`, params).then(res => {
if (res) {
const { result, data } = res.data
......@@ -82,34 +117,42 @@ wxService.page({
wx.hideLoading()
this.setData({
orderList: this.data.pageNo == 1 ? [...data] : [...this.data.orderList, ...data],
noMoreFlag: data.length < pageSize ? true : false
},()=> {
noMoreFlag: data.length < pageSize ? true : false,
}, () => {
this.setData({
no_data: this.data.orderList.length ? true : false
})
wx.setStorageSync('orderList', this.data.orderList)
})
}
}
})
},
//点击切换tab
switchTab(e) {
const { type, status } = e.currentTarget.dataset
const {currentIndex} = this.data
if(currentIndex == type) return false
// 退款列表 /refund/buyer/history 滚动查询
getRefundList(pageNo, pageSize) {
wx.showLoading({
title: '加载中',
mask: true
})
const params = {}
wxService.post(`/sale/refund/buyer/history?pageNum=${pageNo}&pageSize=${pageSize}`, params).then(res => {
if (res) {
const { result, data } = res.data
if (result == 0) {
wx.hideLoading()
this.setData({
currentIndex: type,
pageNo: 1,
orderList: [],
trade: ''
orderList: this.data.pageNo == 1 ? [...data] : [...this.data.orderList, ...data],
noMoreFlag: data.length < pageSize ? true : false
},()=>{
if(type == 5 && status == 'RF'){
console.log("退款/售后")
} else {
this.initOrderList(this.data.pageNo, this.data.pageSize, status)
this.setData({
no_data: this.data.orderList.length ? true : false
})
})
}
}
})
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
......@@ -124,7 +167,7 @@ wxService.page({
this.setData({
pageNo: this.data.pageNo + 1,
}, () => {
this.initOrderList(this.data.pageNo, this.data.pageSize,this.data.trade)
this.initOrderList(this.data.pageNo, this.data.pageSize, this.data.trade)
})
},
......
......@@ -12,7 +12,7 @@
{{item.name}}
</view>
</view>
<view class="order-content">
<view class="order-content" wx:if="{{orderList.length}}">
<block
wx:for="{{orderList}}"
wx:for-item="item"
......@@ -61,26 +61,30 @@
</view>
</view>
<view class="btn-group">
<text class="order-status" wx-if="{{item.status == 'C'}}">
<button class="btn btn-sm btn-default">删除订单</button></text>
<text class="order-status" wx-if="{{item.status == 'N'}}">
<button class="btn btn-sm btn-primary btn-outline">立即支付</button>
</text>
<text class="order-status" wx-if="{{item.status == 'P'}}">
<button class="btn btn-sm btn-default">查看物流</button>
</text>
<text class="order-status" wx-if="{{item.status == 'D'}}">
<button class="btn btn-sm btn-default">查看物流</button>
</text>
<button class="btn btn-sm btn-default" bindtap="handelConfirmReceipt">确认收货</button>
<text class="order-status" wx-if="{{item.status == 'R'}}"/>
<view class="order-status" wx-if="{{item.status == 'C'}}">
<button class="btn btn-sm btn-default" data-id="{{item.id}}">删除订单</button>
</view>
<view class="order-status" wx-if="{{item.status == 'N'}}">
<button class="btn btn-sm btn-primary btn-outline" data-id="{{item.id}}">立即支付</button>
</view>
<view class="order-status" wx-if="{{item.status == 'P'}}">
<button class="btn btn-sm btn-default" data-id="{{item.id}}">查看物流</button>
</view>
<view class="order-status" wx-if="{{item.status == 'D'}}">
<button class="btn btn-sm btn-default" data-id="{{item.id}}">查看物流</button>
<button class="btn btn-sm btn-default" data-id="{{item.id}}" bindtap="handelConfirmReceipt">确认收货</button>
</view>
<view class="order-status" wx-if="{{item.status == 'R'}}" />
<!--<button class="btn btn-sm btn-primary btn-outline ">再来一单</button>-->
</view>
</view>
</block>
</view>
</view>
<view class="no-bottom">
<view class="no-bottom">
<no-more wx:if="{{noMoreFlag}}" />
</view>
</view>
<view hidden="{{no_data}}" class="no-list df border_box">
当前无数据
</view>
</view>
......@@ -115,3 +115,7 @@ scroll-view{
width: 140rpx;
height: 140rpx;
}
.no-list {
padding-top: 300rpx;
font-size: 26rpx;
}
......@@ -26,10 +26,30 @@ wxService.page({
const { id } = this.options
let detailOrderList = wx.getStorageSync('orderList')
let currentDetail = detailOrderList.filter(item => item.id == id)
// if (!Object.keys(this.options).length){ return }
// /trade/buyer/{id} 订单详情
console.log('id', id)
if(id) {
this.getOrderDetail(id)
}
// this.setData({
// detail: currentDetail[0]
// })
},
getOrderDetail(id){
wx.showLoading({
title: '加载中',
mask: true
})
wxService.get(`/sale/trade/buyer/${id}`).then(res => {
if (res) {
const { result, data } = res.data
if (result == 0) {
wx.hideLoading()
this.setData({
detail: currentDetail[0]
detail: data
})
}
}
})
},
// 删除订单
......
<!--pages/productDetail/productDetail.wxml-->
<view class="page-product-detail product-container"
<view
class="page-product-detail product-container"
bindtouchstart="pageTouchStart"
bindtouchmove="pageMove"
bindtouchend="pageMoveEnd"
bindtap="handleCloseSharePopup">
bindtap="handleCloseSharePopup"
>
<view>
<!-- <buy-image-swiper image-data="{{imageData}}"/>
-->
<swiper
autoplay="true" style="height: 750rpx;line-height: 100rpx;" bindchange="swiperChange">
<swiper autoplay="true" style="height: 750rpx;line-height: 100rpx;" bindchange="swiperChange">
<block wx:for="{{productInfo.listUrl}}" wx:key="index">
<swiper-item>
<image class="swiper-image" mode="widthFix" src="{{baseImgUrl}}{{item.imageUrl}}"></image>
<image class="swiper-image" mode="widthFix" src="{{baseImgUrl}}{{item.imageUrl}}" />
</swiper-item>
</block>
</swiper>
<view class="dots">
<block wx:for="{{productInfo.listUrl}}" wx:key="index">
<view class="dot{{index == swiperCurrent ? ' active' : ''}}"></view>
<view class="dot{{index == swiperCurrent ? ' active' : ''}}" />
</block>
</view>
</view>
......@@ -30,7 +31,7 @@
<text class="cost-price">¥888</text>
</view>
<view class="share-wrap">
<image class="share-img" src="/assets/imgs/share.png"></image>
<image class="share-img" src="/assets/imgs/share.png" />
<text class="share-text">分享</text>
</view>
</view>
......@@ -42,18 +43,18 @@
</view>
<view class="member-price" wx:if="{{openPlusStatus}}">
<view class="member-price-info">
<image class="member-price-icon" src="/assets/imgs/7_1_0/plus.png"></image>
<image class="member-price-icon" src="/assets/imgs/7_1_0/plus.png" />
<text class="before-reduce-price">¥558,</text>
<text class="reduce-price">本次立减¥60</text>
</view>
<view class="open" >
<view class="open">
<text class="open-text">立即开通</text>
<image class="big-arrow" src="/assets/imgs/big-arrow-right.png"></image>
<image class="big-arrow" src="/assets/imgs/big-arrow-right.png" />
</view>
</view>
<view class="choose-wrap" bindtap="addCart">
{{selectSkuName ? '已选:' + selectSkuName : '请选择规格'}}
<image class="arrow-right" src="/assets/imgs/7_1_0/arrow-right-sku.png" mode="widthFix"></image>
<image class="arrow-right" src="/assets/imgs/7_1_0/arrow-right-sku.png" mode="widthFix" />
</view>
<!-- <view class="choose-wrap">
支持快递配送</view> -->
......@@ -65,7 +66,7 @@
</view>
<view class="gray-line"></view>
<view class="gray-line" />
<view class="scroll-tips">
继续拖动,查看图文详情
......@@ -81,9 +82,9 @@
>
<navigator
class='get-formId--btn footer-icon'
data-url="/pages/page/page"
url="/pages/userCenter/userCenter"
formType="submit"
open-type="switchTab"
open-type="navigate"
>
<image src="https://hwimagecdn.ihotwind.cn/hotwind-mini/images/hotnewicon/bottom-index.png" mode="widthFix" />
<view>首页</view>
......@@ -93,30 +94,29 @@
class='get-formId'
bindsubmit="nav"
report-submit
name='home'
name='nav'
>
<navigator class="get-formId--btn footer-icon" >
<image src="https://hwimagecdn.ihotwind.cn/hotwind-mini/images/hotnewicon/bottom-kefu.png" mode="widthFix"></image>
<view class="tab-text">客服</view>
<navigator class='get-formId--btn footer-icon' open-type="navigate" url="/pages/cart/cart">
<image class="contact-share-img" src="https://hwimagecdn.ihotwind.cn/hotwind-mini/images/hotnewicon/bottom-shop-cart.png" />
<view class="add-car-text">购物车</view>
</navigator>
</form>
<form
class='get-formId'
bindsubmit="nav"
report-submit
name='nav'
name='home'
>
<navigator class='get-formId--btn footer-icon' open-type="switchTab" url="/pages/cart/cart">
<image class="contact-share-img" src="https://hwimagecdn.ihotwind.cn/hotwind-mini/images/hotnewicon/bottom-shop-cart.png" />
<view class="add-car-text">购物车</view>
<navigator class="get-formId--btn footer-icon">
<image src="https://hwimagecdn.ihotwind.cn/hotwind-mini/images/hotnewicon/bottom-kefu.png" mode="widthFix" />
<view class="tab-text">分享</view>
</navigator>
</form>
</view>
<block >
<view class="footer-buttons clearfix" >
<block >
<block>
<view class="footer-buttons clearfix">
<block>
<form
class='get-formId get-formId--form'
bindsubmit="addCart"
......@@ -156,3 +156,4 @@
product-sku="{{productInfo.productSku}}"
/> -->
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