Commit ff28a65a by 赵雅纹

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

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