Commit ff28a65a by 赵雅纹

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

parents d6a3421a c0baa9e0
......@@ -233,11 +233,17 @@ wxService.page({
})
return false
}
console.log('trolleySku2Buy', trolleySku2Buy)
// 去下单页 && 参数
let parmas = {
trolleySku2Buy: JSON.stringify(trolleySku2Buy)
// let parmas = {
// trolleySku2Buy: JSON.stringify(trolleySku2Buy)
// }
let tradeDto = {
couponId: '',
trolleySku2Buy:JSON.stringify(trolleySku2Buy)
}
const parmas = tradeDto
wxService
.router('/pages/confirmOrder/confirmOrder')
.search(parmas)
......
......@@ -24,19 +24,27 @@ wxService.page({
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
let trolleySku2Buy = this.options.trolleySku2Buy
// 下单 && 计算优惠价
if (trolleySku2Buy.length) {
this.setData({ trolleySku2Buy }, () => {
this.calPreferentialPrice(trolleySku2Buy) // 计算优惠价
})
const { couponId, trolleySku2Buy } = this.options
let tradeDto = {
couponId: couponId,
trolleySku2Buy: JSON.parse(trolleySku2Buy)
}
console.log('tradeDto', tradeDto)
// 下单 && 计算优惠价
this.setData({ trolleySku2Buy: tradeDto }, () => {
this.calPreferentialPrice(tradeDto) // 计算优惠价
})
this.initCitys()
// 地址列表
this.getAddressList()
......@@ -177,11 +185,11 @@ wxService.page({
wxService.router('/pages/myAddress/myAddress')
},
// 计算优惠价
calPreferentialPrice(trolleySku2Buy) {
calPreferentialPrice(tradeDto) {
wx.showLoading({
title: '加载中'
})
wxService.post(`/sale/trade/buyer/preview`, trolleySku2Buy).then(res => {
wxService.post(`/sale/trade/buyer/preview`, tradeDto).then(res => {
if (res) {
const { result, data } = res.data
if (result == 0) {
......@@ -242,16 +250,16 @@ wxService.page({
let hasDefalut = wx.getStorageSync('_defalutAddress')
let _defalutAddress = null
if(hasDefalut) {
if (hasDefalut) {
_defalutAddress = hasDefalut
} else {
data.forEach(item=>{
if(item.type == 1){
data.forEach(item => {
if (item.type == 1) {
_defalutAddress = item
}
})
}
this.setData({
addressInfo: _defalutAddress
})
......
......@@ -63,7 +63,7 @@
<view class="gray-line" />
<!-- 商品列表 -->
<view class="pro-wrap">
<block wx:for="{{currentOrderList}}" wx:key="{{item}}">
<block wx:for="{{currentOrderList.tradePreviewSkus}}" wx:key="{{item}}">
<view class="pro-list">
<image class="pro-img" src="{{item.productImgUrl}}" />
<view class="pro-info">
......@@ -108,7 +108,7 @@
<view class="order-price">
<view class="pro-total-price">
<text class="price-label">商品合计</text>
<text class="total-price">¥306</text>
<text class="total-price">¥{{currentOrderList.amount}}</text>
</view>
<view class="plus-price" wx:if="{{isSelect}}">
<view class="plus-info">
......@@ -147,7 +147,7 @@
<view class="pro-footer">
<view class="cost">
<text class="cost-label">实付款:</text>
<text class="cost-price">¥306</text>
<text class="cost-price">¥{{currentOrderList.amount}}</text>
</view>
<!-- <button form-type="submit" class="theme-color buy-btn">立即购买</button>-->
<!-- <view class="theme-color buy-btn" bindtap="handelGobuy">立即购买</view> -->
......
......@@ -60,7 +60,24 @@ wxService.page({
* 生命周期函数--监听页面显示
*/
onShow: function () {
this.initOrderList(this.data.pageNo, this.data.pageSize, this.data.trade)
console.log('currentIndex', this.data.currentIndex)
const {currentIndex} = this.data
if(currentIndex == 5){
this.getRefundList(this.data.pageNo, this.data.pageSize)
} else {
this.setData({
pageNo: 1,
pageSize: 5
},()=>{
const params = { trade: this.data.trade }
this.initOrderList(this.data.pageNo, this.data.pageSize, params)
// this.initOrderList(this.data.pageNo, this.data.pageSize, this.data.trade)
})
}
},
// 确认收货
handelConfirmReceipt(e) {
......@@ -74,9 +91,7 @@ wxService.page({
const { result, data } = res.data
if (result == 0) {
wx.hideLoading()
this.setData({
})
this.initOrderList(this.data.pageNo, this.data.pageSize, this.data.trade)
}
}
})
......@@ -116,37 +131,30 @@ wxService.page({
})
wxService.post(`/sale/trade/buyer/wxprepay/${id}`).then(res => {
if (res) {
const { result } = res.data
const { result, data } = res.data
if (result == 0) {
wx.hideLoading()
// const payJson = JSON.parse(decodeURIComponent(res_.data.data.parameter))
// wx.requestPayment({
// 'timeStamp': payJson.timeStamp,
// 'nonceStr': payJson.nonceStr,
// 'package': payJson.package,
// 'signType': payJson.signType,
// 'paySign': payJson.paySign,
// 'success': _res => {
// wx.hideLoading()
// wx.showToast({
// title: '支付成功',
// icon: 'none',
// mask: true
// })
// wx.reportAnalytics('api_pay_success', {
// orderno: orderNo
// })
// this.initByStatus(this.data.status)
// },
// 'fail': _res => {
// wx.hideLoading()
// wx.showToast({
// title: '支付失败',
// icon: 'none',
// mask: true
// })
// }
// })
wx.requestPayment(Object.assign({
success(res) {
wx.hideLoading()
// wx.showToast({
// title: '支付成功',
// icon: 'none',
// mask: true
// })
// 支付成功页面
wxService.router('/subPackage/page/pages/paymentStatus/paymentStatus')
},
fail(res) {
wx.hideLoading()
wx.showToast({
title: '支付失败',
icon: 'none',
mask: true
})
}
}, data))
}
}
})
......@@ -192,11 +200,17 @@ wxService.page({
if (type == 5 && status == 'RF') {
this.getRefundList(this.data.pageNo, this.data.pageSize)
} else {
this.initOrderList(this.data.pageNo, this.data.pageSize, status)
this.setData({
trade:status
},()=>{
this.initOrderList(this.data.pageNo, this.data.pageSize, status)
})
}
})
},
initOrderList(pageNo, pageSize, trade) {
console.log('-------------', trade)
wx.showLoading({
title: '加载中',
mask: true
......
......@@ -50,22 +50,24 @@ wxService.page({
pics:[]
},
submitRefund() {
if (this.data.curType.value == 0) {
var selectGoods = this.data.cartList.filter(item => item.checked)
if (selectGoods.length == 0) {
wx.showToast({
title: '请选择退款原因',
title: '请选择退款商品',
icon: 'none'
})
return false
}
var selectGoods = this.data.cartList.filter(item => item.checked)
if (selectGoods.length == 0) {
if (this.data.curType.value == 0) {
wx.showToast({
title: '请选择退款商品',
title: '请选择退款原因',
icon: 'none'
})
return false
}
console.log('selectGoods', selectGoods)
var refundCreateDto = this.data.refundCreateDto
......
......@@ -39,7 +39,7 @@
"list": []
},
"miniprogram": {
"current": 16,
"current": 17,
"list": [
{
"id": -1,
......@@ -151,7 +151,7 @@
"id": 17,
"name": "确认订单",
"pathName": "pages/confirmOrder/confirmOrder",
"query": "trolleySku2Buy=[{\"count\":1,\"skuId\":2000704}]",
"query": "couponId=&trolleySku2Buy=[{\"count\":1,\"skuId\":613473098901098500}]",
"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