Commit c648649e by 谢中龙

退单以及优化

parent 67e70295
...@@ -9,6 +9,8 @@ ...@@ -9,6 +9,8 @@
justify-content: center; justify-content: center;
font-size: 24rpx; font-size: 24rpx;
color: #999999; color: #999999;
box-sizing: border-box;
-webkit-box-sizing: border-box;
} }
.page-empty image{ .page-empty image{
......
...@@ -7,7 +7,8 @@ ...@@ -7,7 +7,8 @@
<icon size="18" type="{{item.checked ? 'success' : 'circle'}}" color="{{checkedColor}}" data-index="{{index}}" ></icon> <icon size="18" type="{{item.checked ? 'success' : 'circle'}}" color="{{checkedColor}}" data-index="{{index}}" ></icon>
</view> </view>
<!-- bindtap="bindTapItem" data-id="{{item.id}}" --> <!-- bindtap="bindTapItem" data-id="{{item.id}}" -->
<view class="pro-info" bindtap="bindTapItem" data-id="{{item.productId}}"> <view class="pro-info" bindtap="bindTapItem" data-id="{{item.productId}}"
style='border-bottom:{{index == (cartList.length -1) ? "none" : "1rpx solid #eeeeee" }}'>
<image class="pro-img" src="{{item.skuImgUrl}}" mode="widthFix"></image> <image class="pro-img" src="{{item.skuImgUrl}}" mode="widthFix"></image>
<view class="pro-right-info"> <view class="pro-right-info">
<view class="pro-name">{{item.productName}}</view> <view class="pro-name">{{item.productName}}</view>
......
...@@ -9,7 +9,8 @@ ...@@ -9,7 +9,8 @@
.remove{ .remove{
width: 132rpx; width: 132rpx;
height: 100%; height: 100%;
background-color: rgba(149, 149, 149, 1); /* background-color: rgba(149, 149, 149, 1); */
background-color: #cb3c3c;
color: white; color: white;
position: absolute; position: absolute;
top: 0; top: 0;
...@@ -25,6 +26,11 @@ ...@@ -25,6 +26,11 @@
.cart-item:last-child .pro-info{ .cart-item:last-child .pro-info{
border-bottom: none; border-bottom: none;
} }
.pro-info:last-child{
border-bottom: none;
}
.cart-content { .cart-content {
background-color: #ffffff; background-color: #ffffff;
} }
......
// 新增商户时 需要在prod_brand_config 配置相应的信息 key是商户Id
// 发生产环境配置流程 // 发生产环境配置流程
// PROJECT_ENV 修改 为 prod // PROJECT_ENV 修改 为 prod
// project.config.json 中appId 更换为生成 // project.config.json 中appId 更换为生成
// Http.js 中 部分token修改 // 修改 BRANCH_ID 为对应的商户id
// 组件plus 中数据请求 token 修改
// app.js 中brandId 修改为对应 // app.js 中brandId 修改为对应
const PROJECT_ENV = 'test' // 生产 prod, 开发 dev, 测试 test, 预生产 pre const PROJECT_ENV = 'test' // 生产 prod, 开发 dev, 测试 test, 预生产 pre
//仅生产环境时 配置 :
//3001 3001 ,
//泰华 2006 ,
//多多一上 2007 ,
//雪岛书屋 2008
//苏州邻里 2006
const BRANCH_ID = 2007
const needMock = '' // const needMock = '' //
// 舞象联系我 :766c50920993bf9c41c6c3d2761a2df5 // 舞象联系我 :766c50920993bf9c41c6c3d2761a2df5
//泰华 联系我 :6e4314d558e55fbc64fe2e757e24d61f //泰华 联系我 :6e4314d558e55fbc64fe2e757e24d61f
...@@ -50,7 +59,13 @@ const needMock = '' // ...@@ -50,7 +59,13 @@ const needMock = '' //
*/ */
/** /**
* 泰华 生产环境配置 * 泰华 商城生产环境配置
* appId = wx40fec8944623c8b3
* tunnel-token = 8724303981a00b56869f3d26f7a6c643
* brandId= 2006
* contactUspluginId = a6ea55b56eb09ced8f9aeeaa14383b52 联系我插件id
*
* 泰华 门户生产环境配置
* appId = wx40fec8944623c8b3 * appId = wx40fec8944623c8b3
* tunnel-token = 8724303981a00b56869f3d26f7a6c643 * tunnel-token = 8724303981a00b56869f3d26f7a6c643
* brandId= 2006 * brandId= 2006
...@@ -82,6 +97,76 @@ const needMock = '' // ...@@ -82,6 +97,76 @@ const needMock = '' //
* *
*/ */
// 生产环境配置信息
const prod_brand_config = {
//3001舞象
3001 : {
appId: 'wx313ec36b710125d4',// 小程序AppID
tunnelToken: 'd6db651f8b9c7db4176465accfc1c913843fd9ad328cd5f4fe201d918072c9e8',//商户默认token
brandId: 3001,//商户ID
plusIsOpen: true, //是否开启plus
contactUsIsOpen: true,//是否开启联系我
contactUsPluginId: '766c50920993bf9c41c6c3d2761a2df5',//联系我们插件PluginID
hasTrial: true, // 是否有体验账号
isMall: true,// 商城或门户 true 商城 false 门户
orderingMustOpenCard : false, //下单是否必须卡开
},
//泰华配置
2006: {
appId: 'wx40fec8944623c8b3',
tunnelToken: '8724303981a00b56869f3d26f7a6c643',
brandId: 2006,
plusIsOpen: false,
contactUsIsOpen : true,
contactUsPluginId: 'a6ea55b56eb09ced8f9aeeaa14383b52',
hasTrial: false,
isMall: true,
orderingMustOpenCard: true,
},
//多多一上
2007 : {
appId: 'wxf7bc302c51166dc0',
tunnelToken: '1ea3f0c0dd0c91ee54e546a99beafbfb',
brandId: 2007,
plusIsOpen: false,
contactUsIsOpen: true,
contactUsPluginId: '64bf88d82b3f0d506bd00ed90d5706f1',
hasTrial: false,
isMall: true,
orderingMustOpenCard: false,
},
//雪岛书屋
2008 : {
appId: 'wx207f8a95bbc9d3ab',
tunnelToken: 'd93a5def7511da3d0f2d171d9c344e91',
brandId: 2008,
plusIsOpen: false,
contactUsIsOpen: false,
contactUsPluginId: '',
hasTrial: false,
isMall: true,
orderingMustOpenCard: false,
},
//苏州邻里
2003 : {
appId: 'wxe7770946f9d93d38',
tunnelToken: 'fde4fde168dd5aabe962643843c19290',
brandId: 2003,
plusIsOpen: false,
contactUsIsOpen: false,
contactUsPluginId: '',
hasTrial: false,
isMall: true,
orderingMustOpenCard: false,
}
}
// 开启联系我时 app.json plugin中添加此代码
// "contactPlugin": {
// "version": "1.0.12",
// "provider": "wx104a1a20c3f81ec2"
// }
// appid_dev_wx wxc3b64b09b1d3dfc2 // appid_dev_wx wxc3b64b09b1d3dfc2
...@@ -121,7 +206,6 @@ const appId = { ...@@ -121,7 +206,6 @@ const appId = {
dev: 'wxc3b64b09b1d3dfc2',//appid_dev_wx dev: 'wxc3b64b09b1d3dfc2',//appid_dev_wx
test: 'wxac09792264c49b5c',//appid_test_wx 1002商城 test: 'wxac09792264c49b5c',//appid_test_wx 1002商城
pre: 'wxac09792264c49b5c',//appid_test_wx 1002商城 pre: 'wxac09792264c49b5c',//appid_test_wx 1002商城
prod: 'wx207f8a95bbc9d3ab',//appid_prod_
} }
const imgConfig = { const imgConfig = {
...@@ -135,21 +219,34 @@ const token = { ...@@ -135,21 +219,34 @@ const token = {
dev: 'brand1001', //开发 dev: 'brand1001', //开发
test: 'aa8a1bfb7f6c5031d172d94b6574293ef954a6f2d4e16657da008e0cc15588feD', //测试 test: 'aa8a1bfb7f6c5031d172d94b6574293ef954a6f2d4e16657da008e0cc15588feD', //测试
pre: 'aa8a1bfb7f6c5031d172d94b6574293ef954a6f2d4e16657da008e0cc15588feD', //预生产 pre: 'aa8a1bfb7f6c5031d172d94b6574293ef954a6f2d4e16657da008e0cc15588feD', //预生产
prod: 'fde4fde168dd5aabe962643843c19290' ,// 生产
} }
//获取配置信息
let brandId = PROJECT_ENV == 'prod' ? prod_brand_config[BRANCH_ID].brandId : (PROJECT_ENV == 'dev' ? 1001 : 1002);
let fixed_appId = PROJECT_ENV == 'prod' ? prod_brand_config[BRANCH_ID].appId : appId[PROJECT_ENV];
let tunnelToken = PROJECT_ENV == 'prod' ? prod_brand_config[BRANCH_ID].tunnelToken : token[PROJECT_ENV];
let plusIsOpen = PROJECT_ENV == 'prod' ? prod_brand_config[BRANCH_ID].plusIsOpen : true;
let contactUsPluginId = PROJECT_ENV == 'prod' ? prod_brand_config[BRANCH_ID].contactUsPluginId : '766c50920993bf9c41c6c3d2761a2df5';
let contactUsIsOpen = PROJECT_ENV == 'prod' ? prod_brand_config[BRANCH_ID].contactUsIsOpen : true;
let hasTrial = PROJECT_ENV == 'prod' ? prod_brand_config[BRANCH_ID].hasTrial : true;
let isMall = PROJECT_ENV == 'prod' ? prod_brand_config[BRANCH_ID].isMall : true;
let orderingMustOpenCard = PROJECT_ENV == 'prod' ? prod_brand_config[BRANCH_ID].orderingMustOpenCard : false;
//配置信息导出
const envInfo = (() => { const envInfo = (() => {
return { return {
ctx: config[PROJECT_ENV], ctx: config[PROJECT_ENV],
env: PROJECT_ENV, env: PROJECT_ENV,
imgCtx: imgConfig[PROJECT_ENV], imgCtx: imgConfig[PROJECT_ENV],
tunnelToken: token[PROJECT_ENV], tunnelToken: tunnelToken,
appId: appId[PROJECT_ENV], appId: fixed_appId,
brandId: 1002,// 1001 1002 3001 3002 //2711 711生产brandId, brandId: brandId,// 1001 1002 3001 3002 //2711 711生产brandId,
plusIsOpen: false, //是否开启plus plusIsOpen: plusIsOpen, //是否开启plus
contactUsPluginId: '766c50920993bf9c41c6c3d2761a2df5', contactUsPluginId: contactUsPluginId,
contactUsIsOpen : false,//是否开启联系我 contactUsIsOpen: contactUsIsOpen,//是否开启联系我
hasTrial : false , //是否开启体验者功能 hasTrial: hasTrial , //是否开启体验者功能
isMall: isMall,//商城和门户区分 门户时 false; 商城 true
orderingMustOpenCard: orderingMustOpenCard,//下单时是否强校验必须开卡 true 必须开卡才可下单 false 不开卡可以下单
} }
})() })()
......
...@@ -390,7 +390,7 @@ wxService.page({ ...@@ -390,7 +390,7 @@ wxService.page({
var self = this var self = this
wx.showModal({ wx.showModal({
title: '提示', title: '提示',
content: '确认删除该商品', content: '确认删除购物车中该商品?',
success(res) { success(res) {
if (res.confirm) { if (res.confirm) {
var cartList = self.data.cartList var cartList = self.data.cartList
......
...@@ -72,6 +72,11 @@ page{ ...@@ -72,6 +72,11 @@ page{
padding-bottom: 32rpx; padding-bottom: 32rpx;
align-items: center; align-items: center;
} }
.pro-info:last-child{
border-bottom: none;
}
.cart-item:last-child .pro-info{ .cart-item:last-child .pro-info{
border-bottom: none; border-bottom: none;
} }
......
...@@ -35,6 +35,7 @@ wxService.page({ ...@@ -35,6 +35,7 @@ wxService.page({
defalutCoupon: '', defalutCoupon: '',
defalutCouponId: '', // 默认第一项 defalutCouponId: '', // 默认第一项
addressId: '', // 收货地址id addressId: '', // 收货地址id
totalGoodsPrice : 0,
}, },
/** /**
...@@ -121,6 +122,40 @@ wxService.page({ ...@@ -121,6 +122,40 @@ wxService.page({
}) })
}, },
formSubmit(e) { formSubmit(e) {
//判断是不是开卡了
if (this.data.orderingMustOpenCard){
let baseInfo = wx.getStorageSync('_baseUserInfo');
if(!baseInfo){
wx.showToast({
title: '你还未登录,请先去登录',
icon: 'none'
});
return ;
}
let memberActivateStatus = baseInfo.memberActivateStatus;
if (!memberActivateStatus){
wx.showModal({
title: '下单开卡提示',
content: '对不起,需要您先开卡后才能下单,点击确定去开卡',
showCancel : true,
confirmText : '确定',
confirmColor: '#cb3c3c',
success: function (res){
if (res.confirm){
//跳去开卡
wxService.openCard();
}
else if (res.cancel){
}
}
})
return;
}
}
const { goodsAddress } = this.data const { goodsAddress } = this.data
// 保存地址 && 支付 // 保存地址 && 支付
if (goodsAddress) { if (goodsAddress) {
...@@ -340,11 +375,13 @@ wxService.page({ ...@@ -340,11 +375,13 @@ wxService.page({
wx.hideLoading() wx.hideLoading()
let skuList = data.tradePreviewSkus let skuList = data.tradePreviewSkus
let sum =0 let sum = 0
skuList.forEach((item,index) => { skuList.forEach((item,index) => {
// item.price // item.price
sum += skuList[index].price sum += skuList[index].price * skuList[index].count;
}) });
this.data.totalGoodsPrice = sum;
// 初始化商品价格 // 初始化商品价格
const { isSelect } = this.data const { isSelect } = this.data
...@@ -373,7 +410,8 @@ wxService.page({ ...@@ -373,7 +410,8 @@ wxService.page({
couponSettingId: data && data.couponDiscountPreviews.length && couponSettingId: data && data.couponDiscountPreviews.length &&
data.couponDiscountPreviews[0] && data.couponDiscountPreviews[0].couponDTOS[0] && data.couponDiscountPreviews[0] && data.couponDiscountPreviews[0].couponDTOS[0] &&
data.couponDiscountPreviews[0].couponDTOS[0].couponSettingId || '', data.couponDiscountPreviews[0].couponDTOS[0].couponSettingId || '',
orderInitPrice: data.amount orderInitPrice: data.amount,
totalGoodsPrice: this.data.totalGoodsPrice
}, () => { }, () => {
// 实付款 // 实付款
this.setPayPrice() this.setPayPrice()
......
...@@ -110,7 +110,7 @@ ...@@ -110,7 +110,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">¥{{utils.numberFormat(currentOrderList.amount - currentOrderList.freight)}}</text> <text class="total-price">¥{{utils.numberFormat(totalGoodsPrice)}}</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">
......
...@@ -15,27 +15,32 @@ wxService.page({ ...@@ -15,27 +15,32 @@ wxService.page({
{ {
type: '1', type: '1',
status: '', status: '',
name: '全部' name: '全部',
hasTips : false
}, },
{ {
type: '2', type: '2',
status: 'N', status: 'N',
name: '待付款' // 新建 name: '待付款', // 新建
hasTips: false
}, },
{ {
type: '3', type: '3',
status: 'P', status: 'P',
name: '待发货' name: '待发货',
hasTips: false
}, },
{ {
type: '4', type: '4',
status: 'D', status: 'D',
name: '待收货' name: '待收货',
hasTips: false
}, },
{ {
type: '5', type: '5',
status: 'RF', status: 'RF',
name: '退款/售后' name: '退款/售后',
hasTips: false
} }
], ],
currentIndex: 1, currentIndex: 1,
...@@ -62,7 +67,6 @@ wxService.page({ ...@@ -62,7 +67,6 @@ wxService.page({
* 生命周期函数--监听页面显示 * 生命周期函数--监听页面显示
*/ */
onShow: function () { onShow: function () {
console.log('currentIndex', this.data.currentIndex)
const { currentIndex } = this.data const { currentIndex } = this.data
if (currentIndex == 5) { if (currentIndex == 5) {
...@@ -75,9 +79,6 @@ wxService.page({ ...@@ -75,9 +79,6 @@ wxService.page({
this.initOrderList(this.data.pageNo, this.data.pageSize, this.data.status) this.initOrderList(this.data.pageNo, this.data.pageSize, this.data.status)
}) })
} }
}, },
// 确认收货 // 确认收货
handelConfirmReceipt(e) { handelConfirmReceipt(e) {
...@@ -112,36 +113,44 @@ wxService.page({ ...@@ -112,36 +113,44 @@ wxService.page({
}, },
// 删除订单 // 删除订单
handelDelOrder(e) { handelDelOrder(e) {
const { id } = e.currentTarget.dataset let _this = this;
wx.showLoading({ wx.showModal({
title: '加载中', title: '订单删除提示',
mask: true content: '确认删除此订单?',
}) showCancel: true,
wxService.post(`/sale/trade/buyer/delete/${id}`).then(res => { cancelText: '取消',
if (res) { confirmText: '删除',
const { result } = res.data confirmColor: '#cb3c3c',
if (result == 0) { success: function (modalRes) {
wx.hideLoading() if (modalRes.confirm) {
wx.showToast({ const { id } = e.currentTarget.dataset
title: `删除成功!`, wx.showLoading({
icon: 'none' title: '订单删除中..',
mask: true
}) })
setTimeout(() => { wxService.post(`/sale/trade/buyer/delete/${id}`).then(res => {
this.onShow() if (res) {
}, 200) const { result } = res.data
if (result == 0) {
wx.hideLoading()
wx.showToast({
title: `删除成功!`,
icon: 'none'
})
setTimeout(() => {
_this.initOrderList(_this.data.pageNo, _this.data.pageSize, _this.data.status)
}, 200)
}
} else {
wx.showToast({
title: `删除失败!`,
icon: 'none'
})
}
});
} }
} else {
wx.showToast({
title: `删除失败!`,
icon: 'none'
})
setTimeout(() => {
this.onShow()
}, 200)
} }
}) });
}, },
// 立即支付 // 立即支付
handelToPay(e) { handelToPay(e) {
...@@ -201,7 +210,6 @@ wxService.page({ ...@@ -201,7 +210,6 @@ wxService.page({
// 取消退款 // 取消退款
handelCancelRefund(e) { handelCancelRefund(e) {
const { id } = e.currentTarget.dataset const { id } = e.currentTarget.dataset
console.log('取消退款', id)
this.handelRevokeRefund(id) this.handelRevokeRefund(id)
}, },
handelRevokeRefund(id) { handelRevokeRefund(id) {
...@@ -216,11 +224,10 @@ wxService.page({ ...@@ -216,11 +224,10 @@ wxService.page({
if (result == 0) { if (result == 0) {
wx.hideLoading() wx.hideLoading()
wx.showToast({ wx.showToast({
title: '撤销退款成功', title: '取消退款成功',
icon: 'none'
}); });
setTimeout(() => { setTimeout(() => {
wxService.router('/pages/order/order') this.getRefundList(this.data.pageNo, this.data.pageSize);
}, 200) }, 200)
} }
} }
...@@ -251,8 +258,8 @@ wxService.page({ ...@@ -251,8 +258,8 @@ wxService.page({
} }
}) })
}, },
initOrderList(pageNo, pageSize, status) { initOrderList(pageNo, pageSize, status) {
console.log('-------------', status)
wx.showLoading({ wx.showLoading({
title: '加载中', title: '加载中',
mask: true mask: true
...@@ -287,66 +294,32 @@ wxService.page({ ...@@ -287,66 +294,32 @@ wxService.page({
if (res) { if (res) {
const { result, data } = res.data const { result, data } = res.data
if (result == 0) { if (result == 0) {
wx.hideLoading() wx.hideLoading();
this.setData({ this.setData({
orderList: this.data.pageNo == 1 ? [...data] : [...this.data.orderList, ...data], orderList: this.data.pageNo == 1 ? [...data] : [...this.data.orderList, ...data],
noMoreFlag: data.length < pageSize ? true : false noMoreFlag: data.length < pageSize ? true : false
}, () => { }, () => {
// this.data.orderList.forEach(item =>{ // console.log(this.data.orderList)
// console.log('item', item) // let hasFilter = this.data.orderList.filter(item => item.status != 'C' && item.status != 'D');
// // 退单列表 // if (hasFilter.length > 0){
// if(item.tradeId){ // this.data.swiperItem[4].hasTips = true;
// console.log('item.tradeId', item.tradeId) // }
// let currentTradeId = item.tradeId // else{
// this.setData({ // this.data.swiperItem[4].hasTips = false;
// currentTradeId // }
// },()=>{
// this.refundDetail()
// })
// }
// })
this.setData({
no_data: this.data.orderList.length ? true : false
})
// console.log(hasFilter)
this.setData({
no_data: this.data.orderList.length ? true : false,
// swiperItem: this.data.swiperItem
});
}) })
} }
} }
}) })
}, },
// 退单详情
// refundDetail(){
// console.log('tradeId', this.data.currentTradeId)
// wx.showLoading({
// title: '加载中',
// mask: true
// })
// wxService.get(`/sale/trade/buyer/${this.data.currentTradeId}`).then(res => {
// if (res) {
// const { result, data } = res.data
// if (result == 0) {
// wx.hideLoading()
// console.log('daya', data, [...this.data.orderList, ...data])
// console.log('this.data.orderList', this.data.orderList)
// this.data.orderList.forEach(item =>{
// console.log('item.tradeId == data.id', item.tradeId,data.id)
// if(item.tradeId == data.id){
// console.log('...item, ...data',item, data)
// this.setData({
// orderList: [...item, ...data]
// },()=>{
// console.log('orderList', this.data.orderList)
// })
// }
// })
// }
// }
// })
// },
//发货之后回调 //发货之后回调
onDeliveryOk(){ onDeliveryOk(){
this.getRefundList(1,5); this.getRefundList(1,5);
...@@ -363,7 +336,17 @@ wxService.page({ ...@@ -363,7 +336,17 @@ wxService.page({
* 页面相关事件处理函数--监听用户下拉动作 * 页面相关事件处理函数--监听用户下拉动作
*/ */
onPullDownRefresh: function () { onPullDownRefresh: function () {
this.data.pageNo = 1;
if (this.data.currentIndex == 5){
this.getRefundList(this.data.pageNo, this.data.pageSize)
}
else{
this.initOrderList(this.data.pageNo, this.data.pageSize, this.data.status)
}
setTimeout(() => {
wx.stopPullDownRefresh();
},500);
}, },
/** /**
......
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
"usingComponents": { "usingComponents": {
"no-more": "/component/noMore/noMore", "no-more": "/component/noMore/noMore",
"go-home": "/component/goHome/goHome", "go-home": "/component/goHome/goHome",
"empty": "/component/empty/empty",
"apply-refund": "/component/applyRefund/applyRefund" "apply-refund": "/component/applyRefund/applyRefund"
} }
} }
\ No newline at end of file
...@@ -10,6 +10,7 @@ ...@@ -10,6 +10,7 @@
data-status="{{item.status}}" data-status="{{item.status}}"
> >
{{item.name}} {{item.name}}
<view class='red-num' wx:if="{{item.hasTips}}"></view>
</view> </view>
</view> </view>
<view class="order-content" wx:if="{{orderList.length}}"> <view class="order-content" wx:if="{{orderList.length}}">
...@@ -47,6 +48,8 @@ ...@@ -47,6 +48,8 @@
<text class="order-status" wx-if="{{item.status == 'P'}}">待发货</text> <text class="order-status" wx-if="{{item.status == 'P'}}">待发货</text>
<text class="order-status" wx-if="{{item.status == 'D'}}">待收货</text> <text class="order-status" wx-if="{{item.status == 'D'}}">待收货</text>
<text class="order-status" wx-if="{{item.status == 'R'}}">已完成</text> <text class="order-status" wx-if="{{item.status == 'R'}}">已完成</text>
<text class="order-status" wx-if="{{item.status == 'PR'}}">退货中</text>
<text class="order-status" wx-if="{{item.status == 'RE'}}">退货完成</text>
</view> </view>
</view> </view>
<!-- 类型 --> <!-- 类型 -->
...@@ -137,12 +140,13 @@ ...@@ -137,12 +140,13 @@
</view> </view>
</view> </view>
<view wx:else> <view wx:else>
<view class="btn-group"> <view class="btn-group" wx:if="{{item.status != 'PR'}}">
<view class="order-status" wx-if="{{item.status == 'C'}}"> <view class="order-status" wx-if="{{item.status == 'C' || item.status == 'RE'}}">
<button class="btn btn-sm btn-default" data-id="{{item.id}}" bindtap="handelDelOrder">删除订单</button> <button class="btn btn-sm btn-default" data-id="{{item.id}}" bindtap="handelDelOrder">删除订单</button>
</view> </view>
<view class="order-status" wx-if="{{item.status == 'N'}}"> <view class="order-status" wx-if="{{item.status == 'N'}}">
<button class="btn btn-sm btn-primary btn-outline" data-merged="{{item.mergedAmount}}" data-id="{{item.id}}" bindtap="handelToPay">立即支付</button> <button class="btn btn-sm btn-primary btn-outline"
data-merged="{{item.mergedAmount}}" data-id="{{item.id}}" bindtap="handelToPay">立即支付</button>
</view> </view>
<view class="order-status" wx-if="{{item.status == 'P'}}"> <view class="order-status" wx-if="{{item.status == 'P'}}">
<button <button
...@@ -163,7 +167,7 @@ ...@@ -163,7 +167,7 @@
</button> </button>
<button class="btn btn-sm btn-primary btn-outline" data-id="{{item.id}}" bindtap="handelConfirmReceipt">确认收货</button> <button class="btn btn-sm btn-primary btn-outline" data-id="{{item.id}}" bindtap="handelConfirmReceipt">确认收货</button>
</view> </view>
<view class="order-status" wx-if="{{item.status == 'R'}}" /> <!-- <view class="order-status" wx-if="{{item.status == 'R'}}" /> -->
<!--<button class="btn btn-sm btn-primary btn-outline ">再来一单</button>--> <!--<button class="btn btn-sm btn-primary btn-outline ">再来一单</button>-->
</view> </view>
</view> </view>
...@@ -174,7 +178,8 @@ ...@@ -174,7 +178,8 @@
</view> </view>
</view> </view>
<view hidden="{{no_data}}" class="no-list df border_box"> <view hidden="{{no_data}}" class="no-list df border_box">
当前无数据 <!-- 当前无数据 -->
<empty show="{{no_data}}" text="未查找您的订单信息哦~" />
</view> </view>
</view> </view>
<apply-refund show="{{showApplyRefundModal}}" refundId="{{refundId}}" bind:ok="onDeliveryOk" /> <apply-refund show="{{showApplyRefundModal}}" refundId="{{refundId}}" bind:ok="onDeliveryOk" />
......
...@@ -8,7 +8,8 @@ scroll-view{ ...@@ -8,7 +8,8 @@ scroll-view{
} }
.swiper-tab{ .swiper-tab{
width: 580rpx; /* width: 580rpx; */
width: 100%;
display: flex; display: flex;
background-color: #ffffff; background-color: #ffffff;
color: #000000; color: #000000;
...@@ -16,16 +17,38 @@ scroll-view{ ...@@ -16,16 +17,38 @@ scroll-view{
top: 0; top: 0;
z-index:1; z-index:1;
justify-content: space-between; justify-content: space-between;
padding: 24rpx 85rpx 0; padding: 24rpx 40rpx 0;
box-sizing: border-box;
-webkit-box-sizing: border-box;
} }
.swiper-tab-item{ .swiper-tab-item{
padding: 14rpx 0; padding: 14rpx 10rpx;
padding-bottom: 20rpx;
text-align: center; text-align: center;
font-size: 24rpx; font-size: 24rpx;
color: #787878; color: #787878;
position: relative;
} }
.red-num{
position: absolute;
width: 8rpx;
height: 8rpx;
right: -1rpx;
top: 14rpx;
background: #cb3c3c;
border-radius: 50%;
border: solid 1px #cb3c3c;
display: flex;
align-items: center;
justify-content: center;
font-size: 16rpx;
color: #cb3c3c;
font-weight: bold;
}
.active{ .active{
color: #C09A74; color: #cb3c3c;
} }
.order-content{ .order-content{
margin-top: 100rpx; margin-top: 100rpx;
...@@ -122,4 +145,6 @@ scroll-view{ ...@@ -122,4 +145,6 @@ scroll-view{
.no-list { .no-list {
padding-top: 300rpx; padding-top: 300rpx;
font-size: 26rpx; font-size: 26rpx;
box-sizing: border-box;
-webkit-box-sizing: border-box;
} }
...@@ -17,7 +17,9 @@ wxService.page({ ...@@ -17,7 +17,9 @@ wxService.page({
min: '00', min: '00',
sec: '00', sec: '00',
ms: '0', ms: '0',
mergedAmount: 0 mergedAmount: 0,
totalGoodsPrice : 0,
canApplyRefund : true
}, },
/** /**
...@@ -70,10 +72,31 @@ wxService.page({ ...@@ -70,10 +72,31 @@ wxService.page({
else{ else{
data.logistic = null; data.logistic = null;
} }
let skuVOList = data.skuVOList ? data.skuVOList : [];
let sum = 0 ;
skuVOList.forEach(item => {
item.refundCount = item.refundCount ? item.refundCount : 0;
item.canRefundNum = (item.count - item.refundCount) >= 0 ? (item.count - item.refundCount) : 0;
sum = sum + item.price * item.count;
});
//处理能不能退款
let canApplyRefund = true;
let filter = skuVOList.filter(c => c.canRefundNum > 0);
if (filter.length > 0){
canApplyRefund = true;
}
else{
canApplyRefund = false;
}
this.data.totalGoodsPrice = parseFloat(sum).toFixed(2);
this.setData({ this.setData({
detail: data, detail: data,
mergedAmount: data.mergedAmount || 0 totalGoodsPrice: this.data.totalGoodsPrice,
mergedAmount: data.mergedAmount || 0,
canApplyRefund: canApplyRefund
}, ()=>{ }, ()=>{
this.initCountDown(data.countDownOrderTime, data.createOrderTime, data.localNowTime) this.initCountDown(data.countDownOrderTime, data.createOrderTime, data.localNowTime)
}) })
...@@ -141,34 +164,46 @@ wxService.page({ ...@@ -141,34 +164,46 @@ wxService.page({
}, },
// 删除订单 // 删除订单
handelDelOrder(e) { handelDelOrder(e) {
const { id } = e.currentTarget.dataset let _this = this;
wx.showLoading({ wx.showModal({
title: '加载中', title: '订单删除提示',
mask: true content: '确认删除此订单?',
}) showCancel: true,
wxService.post(`/sale/trade/buyer/delete/${id}`).then(res => { cancelText: '取消',
if (res) { confirmText: '删除',
const { result } = res.data confirmColor: '#cb3c3c',
if (result == 0) { success: function (modalRes) {
wx.hideLoading() if (modalRes.confirm) {
wx.showToast({ const { id } = e.currentTarget.dataset
title: `删除成功!`, wx.showLoading({
icon: 'none' title: '订单删除中..',
mask: true
}) })
setTimeout(() => { wxService.post(`/sale/trade/buyer/delete/${id}`).then(res => {
wxService.router('/pages/order/order') if (res) {
},200) const { result } = res.data
} else { if (result == 0) {
wx.showToast({ wx.hideLoading()
title: `删除失败!`, wx.showToast({
icon: 'none' title: `删除成功!`,
}) });
setTimeout(() => { setTimeout(() => {
wxService.router('/pages/order/order') wx.navigateBack({
},200) delta : 1
});
}, 500);
} else {
wx.showToast({
title: `删除失败!`,
icon: 'none'
})
}
}
});
} }
} }
}) });
}, },
// 立即支付 // 立即支付
handelToPay(e) { handelToPay(e) {
...@@ -204,36 +239,46 @@ wxService.page({ ...@@ -204,36 +239,46 @@ wxService.page({
}, },
// 取消订单 // 取消订单
handelCancelOrder(e) { handelCancelOrder(e) {
const { id } = e.currentTarget.dataset let _this = this;
wx.showLoading({ wx.showModal({
title: '加载中', title: '订单取消提示',
mask: true content: '确认取消此订单?',
}) showCancel: true,
cancelText: '再想想',
wxService.post(`/sale/trade/buyer/cancel/${id}`).then(res => { confirmText: '取消订单',
if (res) { confirmColor: '#cb3c3c',
const { result } = res.data success: function (modalRes) {
if (result == 0) { if (modalRes.confirm) {
wx.hideLoading() //跳去开卡
wx.showToast({ const { id } = e.currentTarget.dataset
title: `取消成功!`, wx.showLoading({
icon: 'none' title: '订单取消中..',
}) mask: true
setTimeout(() => { });
wxService.router('/pages/order/order')
},200) wxService.post(`/sale/trade/buyer/cancel/${id}`).then(res => {
} else { if (res) {
wx.showToast({ const { result } = res.data
title: `取消失败!`, if (result == 0) {
icon: 'none' wx.hideLoading()
wx.showToast({
title: `取消成功!`,
icon: 'none'
})
setTimeout(() => {
_this.getOrderDetail(_this.data.id);
}, 200)
} else {
wx.showToast({
title: `取消失败!`,
icon: 'none'
})
}
}
}) })
setTimeout(() => {
wxService.router('/pages/order/order')
},200)
} }
} }
}) });
}, },
// 查看物流 // 查看物流
checkLogistics(e) { checkLogistics(e) {
...@@ -246,8 +291,17 @@ wxService.page({ ...@@ -246,8 +291,17 @@ wxService.page({
handelRequestRefund(e) { handelRequestRefund(e) {
const { id } = e.currentTarget.dataset const { id } = e.currentTarget.dataset
const { detail } = e.currentTarget.dataset const { detail } = e.currentTarget.dataset
detail.id = this.data.id detail.id = this.data.id;
let params = JSON.stringify(detail) let copyOrderInfo = JSON.parse(JSON.stringify(detail));
//过滤掉已经退货完的商品
copyOrderInfo.skuVOList = copyOrderInfo.skuVOList.filter(item => item.canRefundNum > 0);
//更新可退货数量
copyOrderInfo.skuVOList.forEach(item => {
item.count = item.canRefundNum;
});
let params = JSON.stringify(copyOrderInfo);
// 退款申请 // 退款申请
wxService.router(`/pages/refund/refund`).search({params}) wxService.router(`/pages/refund/refund`).search({params})
}, },
......
...@@ -16,7 +16,15 @@ ...@@ -16,7 +16,15 @@
<!--订单状态(C:取消;N:新建,P:已支付;D:已发货;R:已收货) --> <!--订单状态(C:取消;N:新建,P:已支付;D:已发货;R:已收货) -->
<view class="order-status" wx-if="{{detail.status == 'C'}}"> <view class="order-status" wx-if="{{detail.status == 'C'}}">
<view class="status">交易关闭</view> <view class="status">交易关闭</view>
<view class="desc">订单已关闭: 支付超时</view> <view class="desc">{{detail.status == '订单已取消' || detail.status == '退货完成'}}</view>
</view>
<view class="order-status" wx-if="{{detail.status == 'PR'}}">
<view class="status">退货中</view>
<view class="desc">订单申请退货中,请耐心等待...</view>
</view>
<view class="order-status" wx-if="{{detail.status == 'RE'}}">
<view class="status">已退款</view>
<view class="desc">您的订单已退款完成</view>
</view> </view>
<view class="order-status" wx-if="{{detail.status == 'N'}}"> <view class="order-status" wx-if="{{detail.status == 'N'}}">
<view class="status">待付款</view> <view class="status">待付款</view>
...@@ -36,7 +44,7 @@ ...@@ -36,7 +44,7 @@
</view> </view>
</view> </view>
</view> </view>
<view class="address-info" wx:if="{{detail.member}}"> <!-- <view class="address-info" wx:if="{{detail.member}}">
<view class="address-name"> <view class="address-name">
<text>{{detail.member.name}}</text> <text>{{detail.member.name}}</text>
<text class="user-phone">{{detail.member.mobile}}</text> <text class="user-phone">{{detail.member.mobile}}</text>
...@@ -44,17 +52,17 @@ ...@@ -44,17 +52,17 @@
<view class="address-detail"> <view class="address-detail">
{{detail.member.address}} {{detail.member.address}}
</view> </view>
<!-- <view class="edit-address"> </view> -->
<navigator url="/pages/addAddress/addAddress?id=1" hover-class="none">
<button class="btn btn-default btn-sm">修改地址</button>
</navigator>
</view> -->
</view>
<view class="pro-wrap"> <view class="pro-wrap">
<block wx:for="{{detail.skuVOList}}" wx:for-item="item" wx:key=""> <block wx:for="{{detail.skuVOList}}" wx:for-item="item" wx:key="">
<view class="pro-list"> <view class="pro-list">
<image class="pro-img" src="{{item.skuImgUrl ? item.skuImgUrl : item.mainImgUrl}}" mode='aspectFit'/> <image
data-img="{{item.skuImgUrl ? item.skuImgUrl : item.mainImgUrl}}"
bindtap='onTapShowImg'
class="pro-img"
src="{{item.skuImgUrl ? item.skuImgUrl : item.mainImgUrl}}"
mode='aspectFit'/>
<view class="pro-info"> <view class="pro-info">
<view class="pro-name">{{item.productName}}</view> <view class="pro-name">{{item.productName}}</view>
<view class="pro-desc">{{item.skuSpec}}</view> <view class="pro-desc">{{item.skuSpec}}</view>
...@@ -62,6 +70,10 @@ ...@@ -62,6 +70,10 @@
<text class="price">¥{{item.price}}</text> <text class="price">¥{{item.price}}</text>
<text class="number">x {{item.count}}</text> <text class="number">x {{item.count}}</text>
</view> </view>
<view class="refund-info" wx:if="{{item.refundCount != 0}}">
<text class='refund-name'>退款</text>
<text>x {{item.refundCount}}</text>
</view>
</view> </view>
</view> </view>
</block> </block>
...@@ -71,7 +83,7 @@ ...@@ -71,7 +83,7 @@
<view class="order-pro-info"> <view class="order-pro-info">
<view class="order-pro-list"> <view class="order-pro-list">
<text>商品合计</text> <text>商品合计</text>
<text>¥{{detail.skuAmount}}</text> <text>¥{{totalGoodsPrice}}</text>
</view> </view>
<view class="order-pro-list"> <view class="order-pro-list">
<text>运费</text> <text>运费</text>
...@@ -122,7 +134,7 @@ ...@@ -122,7 +134,7 @@
<button class="btn btn-primary btn-lg" data-id="{{detail.id}}" bindtap="handelToPay">立即支付</button> <button class="btn btn-primary btn-lg" data-id="{{detail.id}}" bindtap="handelToPay">立即支付</button>
<button class="btn btn-lg btn-gray" data-id="{{detail.id}}" bindtap="handelCancelOrder">取消订单</button> <button class="btn btn-lg btn-gray" data-id="{{detail.id}}" bindtap="handelCancelOrder">取消订单</button>
</view> </view>
<view class="button-wrap" wx-if="{{detail.status == 'P'}}"> <view class="button-wrap" wx-if="{{detail.status == 'P' && canApplyRefund}}">
<button <button
class="btn btn-lg btn-gray" class="btn btn-lg btn-gray"
data-id="{{detail.id}}" data-id="{{detail.id}}"
...@@ -131,7 +143,7 @@ ...@@ -131,7 +143,7 @@
>申请退款 >申请退款
</button> </button>
</view> </view>
<view class="button-wrap" wx-if="{{detail.status == 'D'}}"> <view class="button-wrap" wx-if="{{detail.status == 'D' && canApplyRefund}}">
<button <button
class="btn btn-primary btn-lg" class="btn btn-primary btn-lg"
data-id="{{detail.id}}" data-id="{{detail.id}}"
......
...@@ -65,7 +65,7 @@ page{ ...@@ -65,7 +65,7 @@ page{
justify-content: space-between; justify-content: space-between;
} }
.pro-wrap{ .pro-wrap{
padding: 19rpx 32rpx 53rpx 30rpx; padding: 20rpx 30rpx;
background-color: #ffffff; background-color: #ffffff;
} }
.choose-pro{ .choose-pro{
...@@ -81,12 +81,28 @@ page{ ...@@ -81,12 +81,28 @@ page{
font-size: 28rpx; font-size: 28rpx;
} }
.pro-list{ .pro-list{
border-bottom: 1px solid rgba(151,151,151,0.3); border-bottom: 1px solid #eeeeee;
padding:31rpx 0 25rpx; padding:31rpx 0 25rpx;
display: flex;
} }
.pro-list:last-child{ .pro-list:last-child{
border-bottom: none; border-bottom: none;
} }
.refund-info{
display: flex;
justify-content: space-between;
align-items: center;
font-size: 22rpx;
color: #cb3c3c;
margin-top: 5rpx;
opacity: 0.7;
}
.refund-info .refund-name{
color: #cb3c3c;
}
.pro-img{ .pro-img{
width: 160rpx; width: 160rpx;
height: 160rpx; height: 160rpx;
...@@ -99,17 +115,24 @@ page{ ...@@ -99,17 +115,24 @@ page{
} }
.pro-name{ .pro-name{
font-size: 25rpx; font-size: 25rpx;
color: #666666; color: #333333;
width: 500rpx; width: 500rpx;
line-height:36rpx; line-height:36rpx;
text-overflow: -o-ellipsis-lastline;
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 1;
line-clamp: 1;
-webkit-box-orient: vertical;
} }
.pro-desc{ .pro-desc{
font-size: 22rpx; font-size: 22rpx;
color: #aaaaaa; color: #999999;
margin-top: 10rpx; margin-top: 10rpx;
} }
.pro-price{ .pro-price{
margin-top: 16rpx; margin-top: 12rpx;
} }
.price{ .price{
color: #cb3c3c; color: #cb3c3c;
......
...@@ -60,44 +60,44 @@ wxService.page({ ...@@ -60,44 +60,44 @@ wxService.page({
experAccessible(newVal, oldVal) { experAccessible(newVal, oldVal) {
if(newVal) { if(newVal) {
// 登录接口返回err // 登录接口返回err
const reLoginErrFlag = wx.getStorageSync('reLoginErr') const reLoginErrFlag = wx.getStorageSync('reLoginErr')
const baseUserInfo = wx.getStorageSync('_baseUserInfo') const baseUserInfo = wx.getStorageSync('_baseUserInfo')
let id let id
if (baseUserInfo && !reLoginErrFlag) { if (baseUserInfo && !reLoginErrFlag) {
this.setData({ this.setData({
isAuthorization: false isAuthorization: false
}, () => { }, () => {
const option = this.options || {} const option = this.options || {}
const { scene } = option const { scene } = option
if (scene) { if (scene) {
let idParam = decodeURIComponent(scene).split('&')[0] let idParam = decodeURIComponent(scene).split('&')[0]
let shareId = idParam && idParam.split('=')[1] || 0 let shareId = idParam && idParam.split('=')[1] || 0
id = shareId id = shareId
} else { } else {
id = option.id id = option.id
} }
if (id) { if (id) {
this.setData({ this.setData({
id id
}, () => { }, () => {
this.getPointDetail(id) this.getPointDetail(id)
}) })
} }
// 隐藏 dialog // 隐藏 dialog
this.isShowDialog(false) this.isShowDialog(false)
}) })
} }
else if (!baseUserInfo && reLoginErrFlag) { else if (!baseUserInfo && reLoginErrFlag) {
this.setData({ this.setData({
isAuthorization: true isAuthorization: true
}) })
} }
else { else {
this.setData({ this.setData({
isAuthorization: true isAuthorization: true
}) })
} }
} else { } else {
// 去别的页面 // 去别的页面
wxService.router(`/subPackage/page/pages/goToHome/goToHome`).replace() wxService.router(`/subPackage/page/pages/goToHome/goToHome`).replace()
......
...@@ -147,19 +147,6 @@ wxService.page({ ...@@ -147,19 +147,6 @@ wxService.page({
const { id } = e.currentTarget.dataset const { id } = e.currentTarget.dataset
wxService.router(`/pages/pointDetail/pointDetail`).search({ id }) wxService.router(`/pages/pointDetail/pointDetail`).search({ id })
}, },
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/** /**
* 页面相关事件处理函数--监听用户下拉动作 * 页面相关事件处理函数--监听用户下拉动作
......
...@@ -52,6 +52,7 @@ wxService.page({ ...@@ -52,6 +52,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.setData({
productInfo: data productInfo: data
}) })
...@@ -165,6 +166,7 @@ wxService.page({ ...@@ -165,6 +166,7 @@ wxService.page({
const { result, data } = res.data const { result, data } = res.data
if (result == 0) { if (result == 0) {
wx.hideLoading() wx.hideLoading()
// data.descHtml = '<p><span style="color: rgb(230, 0, 0);" class="ql-size-large">这个是商品详情图文介绍</span></p><p><br></p><p><img src="https://img3.bigaka.com/test/1001/201912/20191226/10013c605d74-1098-4adb-a6ad-5b2397f9dc9a.png"></p><p><img src="https://img3.bigaka.com/test/1001/201912/20191226/100119d81a35-a821-45dd-a09a-caa04fe79e01.png"></p><p><img src="https://img3.bigaka.com/test/1001/201912/20191226/1001e793d3f6-a7f4-4523-bc42-0df5e3fc822b.png"></p>';
this.setData({ this.setData({
productInfo: data productInfo: data
}) })
......
...@@ -89,7 +89,9 @@ ...@@ -89,7 +89,9 @@
</view> </view>
<block wx:if="{{showHtml}}"> <block wx:if="{{showHtml}}">
<x-html html="{{productInfo.descHtml}}" /> <view class='html'>
<x-html html="{{productInfo.descHtml}}" />
</view>
</block> </block>
<view class="product-footer"> <view class="product-footer">
...@@ -146,7 +148,8 @@ ...@@ -146,7 +148,8 @@
report-submit report-submit
name='nav' name='nav'
> >
<button disabled="{{fromZc || productInfo.productStatus != 2}}" class="cart-button get-formId--btn {{(fromZc || productInfo.productStatus != 2) ? 'btn-default' : 'btn-cart'}}" formType="submit">加入购物车</button> <button disabled="{{fromZc || productInfo.productStatus != 2}}"
class="cart-button get-formId--btn {{(fromZc || productInfo.productStatus != 2) ? 'btn-default' : 'btn-cart'}}" formType="submit">加入购物车</button>
</form> </form>
<form <form
class='get-formId get-formId--form' class='get-formId get-formId--form'
......
...@@ -4,6 +4,11 @@ ...@@ -4,6 +4,11 @@
page{ page{
padding-bottom: 100rpx; padding-bottom: 100rpx;
} }
.html{
margin-bottom: 40rpx;
}
.swiper-image{ .swiper-image{
width: 100%; width: 100%;
} }
......
...@@ -75,6 +75,7 @@ wxService.page({ ...@@ -75,6 +75,7 @@ wxService.page({
}) })
this.handelRequestRefund(refundCreateDto) this.handelRequestRefund(refundCreateDto)
}, },
//创建退款
handelRequestRefund(params) { handelRequestRefund(params) {
wx.showLoading({ wx.showLoading({
title: '加载中', title: '加载中',
...@@ -87,7 +88,6 @@ wxService.page({ ...@@ -87,7 +88,6 @@ wxService.page({
wx.hideLoading() wx.hideLoading()
wx.showToast({ wx.showToast({
title: '申请退款成功', title: '申请退款成功',
icon: 'none'
}); });
// 订单列表 // 订单列表
setTimeout(() => { setTimeout(() => {
...@@ -101,6 +101,7 @@ wxService.page({ ...@@ -101,6 +101,7 @@ wxService.page({
}) })
}, },
//获取退款原因列表
getReasonList() { getReasonList() {
wx.showLoading({ wx.showLoading({
title: '加载中', title: '加载中',
...@@ -184,12 +185,21 @@ wxService.page({ ...@@ -184,12 +185,21 @@ wxService.page({
this.editOk(cartList[index]) //调用完成 this.editOk(cartList[index]) //调用完成
}) })
}, },
//新增数量
addNum: function (e) { // 增加数量 addNum: function (e) { // 增加数量
var index = e.currentTarget.dataset.index var index = e.currentTarget.dataset.index
var cartList = this.data.cartList var cartList = this.data.cartList
var proNum = cartList[index].count var proNum = cartList[index].count;
if (proNum < cartList[index].canRefundNum){
proNum++ proNum++
}
else{
wx.showToast({
title: '退单数量不能大于当前商品购买数量',
icon : 'none'
});
return ;
}
cartList[index].count = proNum cartList[index].count = proNum
this.setData({ this.setData({
...@@ -243,8 +253,7 @@ wxService.page({ ...@@ -243,8 +253,7 @@ wxService.page({
for (let i = 0; i < cartList.length; i++) { for (let i = 0; i < cartList.length; i++) {
if (cartList[i].checked) { if (cartList[i].checked) {
returnPrice += cartList[i].price * (cartList[i].count ? cartList[i].count : 1) returnPrice += cartList[i].paySkuPrice * (cartList[i].count ? cartList[i].count : 1)
} }
} }
this.setData({ this.setData({
...@@ -252,12 +261,29 @@ wxService.page({ ...@@ -252,12 +261,29 @@ wxService.page({
}) })
}, },
/** /**
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
onLoad: function (options) { onLoad: function (options) {
wx.hideShareMenu() wx.hideShareMenu();
const { params } = options;
let detail = JSON.parse(params)
// item.checked
detail.skuVOList.forEach(item => {
item.checked = false;
let paySkuPrice = parseInt(item.amount * 100 / item.count);
item.paySkuPrice = (paySkuPrice/100).toFixed(2);
});
this.setData({
id: detail.id,
cartList: detail.skuVOList,
refundAmount: detail.payAmount,
'refundCreateDto.tradeId': detail.id
}, () => {
// 退款原因列表 /refund/reason/buyer/sortAll
this.getReasonList()
})
}, },
/** /**
...@@ -271,26 +297,10 @@ wxService.page({ ...@@ -271,26 +297,10 @@ wxService.page({
* 生命周期函数--监听页面显示 * 生命周期函数--监听页面显示
*/ */
onShow: function () { onShow: function () {
const { params } = this.options
let detail = JSON.parse(params)
// item.checked
detail.skuVOList.forEach(item => {
item.checked = false
})
this.setData({
id: detail.id,
cartList: detail.skuVOList,
refundAmount: detail.payAmount,
'refundCreateDto.tradeId': detail.id
}, () => {
// 退款原因列表 /refund/reason/buyer/sortAll
this.getReasonList()
})
}, },
//退款prever
reFundPreview(cartPro={}) { reFundPreview(cartPro={}) {
// const params = {
// refundCreateDto: {...cartPro}
// }
const params = {...cartPro} const params = {...cartPro}
wx.showLoading({ wx.showLoading({
title: '加载中', title: '加载中',
...@@ -305,38 +315,5 @@ wxService.page({ ...@@ -305,38 +315,5 @@ wxService.page({
} }
}) })
}, },
/**
* 生命周期函数--监听页面隐藏 });
*/ \ No newline at end of file
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
}
})
\ No newline at end of file
...@@ -14,10 +14,12 @@ ...@@ -14,10 +14,12 @@
/> />
</view> </view>
<view class="pro-info"> <view class="pro-info">
<image class="pro-img" src="{{item.skuImgUrl ? item.skuImgUrl: 'https://bigaka-xie.oss-cn-shanghai.aliyuncs.com/icon.png'}}" mode="widthFix" /> <image class="pro-img"
src="{{item.skuImgUrl ? item.skuImgUrl: 'https://bigaka-xie.oss-cn-shanghai.aliyuncs.com/icon.png'}}" mode="aspectFit" />
<view class="pro-right-info"> <view class="pro-right-info">
<view class="pro-name">{{item.name}}</view> <view class="pro-name">{{item.productName}}</view>
<view class="pro-sku">{{item.sku}}</view> <view class="pro-sku">{{item.skuSpec}}</view>
<!-- <view class="pro-sku" wx:if="{{item.discountFromCoupon}}">优惠券抵扣:¥ {{item.discountFromCoupon}}</view> -->
<view class="pro-price"> <view class="pro-price">
<view class="price">¥ {{item.price}}</view> <view class="price">¥ {{item.price}}</view>
<view class="pro-num-edit"> <view class="pro-num-edit">
...@@ -37,7 +39,7 @@ ...@@ -37,7 +39,7 @@
</view> </view>
</view> </view>
</view> </view>
<!-- 退款信息 -->
<view class="refund-info"> <view class="refund-info">
<view class="form"> <view class="form">
<view class="form-label">退款原因</view> <view class="form-label">退款原因</view>
...@@ -62,8 +64,7 @@ ...@@ -62,8 +64,7 @@
<view class="form"> <view class="form">
<view class="form-label block-label">申请说明</view> <view class="form-label block-label">申请说明</view>
<view class="form-input"> <view class="form-input">
<input <textarea
type="textarea"
class="desc" class="desc"
placeholder="请您详细填写退款说明(最多200字)" placeholder="请您详细填写退款说明(最多200字)"
maxlength="200" maxlength="200"
......
...@@ -28,8 +28,8 @@ page{ ...@@ -28,8 +28,8 @@ page{
margin-left: 24rpx; margin-left: 24rpx;
flex: 1; flex: 1;
display: flex; display: flex;
border-bottom: 1rpx solid rgba(151,151,151,0.3); border-bottom: 1rpx solid #eeeeee;
padding-bottom: 32rpx; padding-bottom: 20rpx;
align-items: center; align-items: center;
} }
.cart-item:last-child .pro-info{ .cart-item:last-child .pro-info{
...@@ -104,8 +104,13 @@ page{ ...@@ -104,8 +104,13 @@ page{
padding: 26rpx 30rpx 35rpx; padding: 26rpx 30rpx 35rpx;
} }
.form{ .form{
margin-top: 27rpx; margin-top: 20rpx;
} }
.form:first-child{
margin-top: 0;
}
.form-label{ .form-label{
font-size: 26rpx; font-size: 26rpx;
color: #333333; color: #333333;
...@@ -123,7 +128,7 @@ page{ ...@@ -123,7 +128,7 @@ page{
height: 68rpx; height: 68rpx;
line-height: 68rpx; line-height: 68rpx;
border-radius: 5rpx; border-radius: 5rpx;
border: 1px solid rgba(170, 170, 170, 1); border: 1px solid #eeeeee;
padding: 0 20rpx; padding: 0 20rpx;
color: #aaaaaa; color: #aaaaaa;
font-size: 22rpx; font-size: 22rpx;
...@@ -138,10 +143,13 @@ page{ ...@@ -138,10 +143,13 @@ page{
} }
.desc{ .desc{
width: 632rpx; width: 632rpx;
height: 104rpx; min-height: 160rpx;
border-radius: 5rpx; border-radius: 5rpx;
border: 1px solid rgba(170, 170, 170, 1); border: 1px solid #eeeeee;
padding: 21rpx 29rpx; padding: 20rpx;
font-size: 28rpx;
text-align: left;
vertical-align: top;
} }
.submit{ .submit{
width: 750rpx; width: 750rpx;
......
...@@ -54,7 +54,9 @@ wxService.page({ ...@@ -54,7 +54,9 @@ wxService.page({
icon: 'none' icon: 'none'
}); });
setTimeout(() => { setTimeout(() => {
wxService.router('/pages/order/order') wx.navigateBack({
delta : 1
});
},200) },200)
} }
} }
......
...@@ -117,7 +117,7 @@ ...@@ -117,7 +117,7 @@
</view> </view>
<view class="cancel"> <view class="cancel">
<button class="btn btn-primary btn-lg" bindtap="handelRevokeRefund">撤销退款</button> <button class="btn btn-primary btn-lg" bindtap="handelRevokeRefund">取消退款</button>
</view> </view>
</view> </view>
......
...@@ -258,7 +258,8 @@ wxService.page({ ...@@ -258,7 +258,8 @@ wxService.page({
wx.showLoading({ wx.showLoading({
title: '加载中' title: '加载中'
}) })
wxService.post(`/merchant/modelPage/mainSetting/mall?brandId=${app.globalData.brandId}`).then(res => { let api = envInfo.isMall ? '/merchant/modelPage/mainSetting/mall' : '/merchant/modelPage/mainSetting';
wxService.post(`${api}?brandId=${app.globalData.brandId}`).then(res => {
if (!res) return false if (!res) return false
const { result, data } = res.data const { result, data } = res.data
if (result == 0) { if (result == 0) {
......
...@@ -39,7 +39,7 @@ ...@@ -39,7 +39,7 @@
"list": [] "list": []
}, },
"miniprogram": { "miniprogram": {
"current": 32, "current": 24,
"list": [ "list": [
{ {
"id": -1, "id": -1,
...@@ -144,7 +144,7 @@ ...@@ -144,7 +144,7 @@
"id": 16, "id": 16,
"name": "商品详情页", "name": "商品详情页",
"pathName": "pages/productDetail/productDetail", "pathName": "pages/productDetail/productDetail",
"query": "id=636986178138152960", "query": "id=619906008814456832",
"scene": null "scene": null
}, },
{ {
...@@ -200,7 +200,7 @@ ...@@ -200,7 +200,7 @@
"id": 24, "id": 24,
"name": "订单详情", "name": "订单详情",
"pathName": "pages/orderDetail/orderDetail", "pathName": "pages/orderDetail/orderDetail",
"query": "id=625052614006149120", "query": "id=661154673541124096",
"scene": null "scene": null
}, },
{ {
......
...@@ -578,6 +578,7 @@ class WXService extends Http { ...@@ -578,6 +578,7 @@ class WXService extends Http {
config.data.plusIsOpen = envInfo.plusIsOpen; config.data.plusIsOpen = envInfo.plusIsOpen;
config.data.contactUsPluginId = envInfo.contactUsPluginId; config.data.contactUsPluginId = envInfo.contactUsPluginId;
config.data.contactUsIsOpen = envInfo.contactUsIsOpen; config.data.contactUsIsOpen = envInfo.contactUsIsOpen;
config.data.orderingMustOpenCard = envInfo.orderingMustOpenCard;
const CONFIG_PAPGE = { const CONFIG_PAPGE = {
onLoad: function (...args) { onLoad: function (...args) {
...@@ -683,6 +684,11 @@ class WXService extends Http { ...@@ -683,6 +684,11 @@ class WXService extends Http {
} }
}); });
} }
else{
this.setData({
experAccessible: true
})
}
}); });
} else { } else {
page.setData({ page.setData({
...@@ -780,6 +786,25 @@ class WXService extends Http { ...@@ -780,6 +786,25 @@ class WXService extends Http {
} }
}); });
}, },
//展示图片
onTapShowImg(e){
let img = e.target.dataset.img ? e.target.dataset.img : null;
let index = e.target.dataset.index ? e.target.dataset.index : 0;
let imgsArr = [];
if(img){
if (typeof img === 'string') {
imgsArr = [img];
}
else if (Array.isArray(img)){
imgsArr = img;
}
wx.previewImage({
index : index,
urls: imgsArr,
});
}
}
} }
Page(Object.assign({}, config, CONFIG_PAPGE)) Page(Object.assign({}, config, CONFIG_PAPGE))
} }
......
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
/** /**
* wxParser 基础样式 * wxParser 基础样式
*/ */
.wxParser-div, .wxParser-div,
.wxParser-p { .wxParser-p {
word-break: break-all; word-break: break-all;
...@@ -18,7 +19,15 @@ ...@@ -18,7 +19,15 @@
padding: 0; } padding: 0; }
.wxParser-p { .wxParser-p {
margin: 5rpx 0; } /* margin: 5rpx 0; */
/* padding-bottom: 0; */
overflow: hidden;
}
.wxParser-p image{
display: inline-block;
float:left;
}
.wxParser-br { .wxParser-br {
height: 0.4em; } height: 0.4em; }
...@@ -125,6 +134,7 @@ ...@@ -125,6 +134,7 @@
.wxParser-img { .wxParser-img {
overflow: hidden; overflow: hidden;
/* vertical-align:top; */
max-width: 100%; } max-width: 100%; }
.wxParser-blockquote { .wxParser-blockquote {
......
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