Commit c648649e by 谢中龙

退单以及优化

parent 67e70295
......@@ -9,6 +9,8 @@
justify-content: center;
font-size: 24rpx;
color: #999999;
box-sizing: border-box;
-webkit-box-sizing: border-box;
}
.page-empty image{
......
......@@ -7,7 +7,8 @@
<icon size="18" type="{{item.checked ? 'success' : 'circle'}}" color="{{checkedColor}}" data-index="{{index}}" ></icon>
</view>
<!-- 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>
<view class="pro-right-info">
<view class="pro-name">{{item.productName}}</view>
......
......@@ -9,7 +9,8 @@
.remove{
width: 132rpx;
height: 100%;
background-color: rgba(149, 149, 149, 1);
/* background-color: rgba(149, 149, 149, 1); */
background-color: #cb3c3c;
color: white;
position: absolute;
top: 0;
......@@ -25,6 +26,11 @@
.cart-item:last-child .pro-info{
border-bottom: none;
}
.pro-info:last-child{
border-bottom: none;
}
.cart-content {
background-color: #ffffff;
}
......
// 新增商户时 需要在prod_brand_config 配置相应的信息 key是商户Id
// 发生产环境配置流程
// PROJECT_ENV 修改 为 prod
// project.config.json 中appId 更换为生成
// Http.js 中 部分token修改
// 组件plus 中数据请求 token 修改
// 修改 BRANCH_ID 为对应的商户id
// app.js 中brandId 修改为对应
const PROJECT_ENV = 'test' // 生产 prod, 开发 dev, 测试 test, 预生产 pre
//仅生产环境时 配置 :
//3001 3001 ,
//泰华 2006 ,
//多多一上 2007 ,
//雪岛书屋 2008
//苏州邻里 2006
const BRANCH_ID = 2007
const needMock = '' //
// 舞象联系我 :766c50920993bf9c41c6c3d2761a2df5
//泰华 联系我 :6e4314d558e55fbc64fe2e757e24d61f
......@@ -50,7 +59,13 @@ const needMock = '' //
*/
/**
* 泰华 生产环境配置
* 泰华 商城生产环境配置
* appId = wx40fec8944623c8b3
* tunnel-token = 8724303981a00b56869f3d26f7a6c643
* brandId= 2006
* contactUspluginId = a6ea55b56eb09ced8f9aeeaa14383b52 联系我插件id
*
* 泰华 门户生产环境配置
* appId = wx40fec8944623c8b3
* tunnel-token = 8724303981a00b56869f3d26f7a6c643
* brandId= 2006
......@@ -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
......@@ -121,7 +206,6 @@ const appId = {
dev: 'wxc3b64b09b1d3dfc2',//appid_dev_wx
test: 'wxac09792264c49b5c',//appid_test_wx 1002商城
pre: 'wxac09792264c49b5c',//appid_test_wx 1002商城
prod: 'wx207f8a95bbc9d3ab',//appid_prod_
}
const imgConfig = {
......@@ -135,21 +219,34 @@ const token = {
dev: 'brand1001', //开发
test: '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 = (() => {
return {
ctx: config[PROJECT_ENV],
env: PROJECT_ENV,
imgCtx: imgConfig[PROJECT_ENV],
tunnelToken: token[PROJECT_ENV],
appId: appId[PROJECT_ENV],
brandId: 1002,// 1001 1002 3001 3002 //2711 711生产brandId,
plusIsOpen: false, //是否开启plus
contactUsPluginId: '766c50920993bf9c41c6c3d2761a2df5',
contactUsIsOpen : false,//是否开启联系我
hasTrial : false , //是否开启体验者功能
tunnelToken: tunnelToken,
appId: fixed_appId,
brandId: brandId,// 1001 1002 3001 3002 //2711 711生产brandId,
plusIsOpen: plusIsOpen, //是否开启plus
contactUsPluginId: contactUsPluginId,
contactUsIsOpen: contactUsIsOpen,//是否开启联系我
hasTrial: hasTrial , //是否开启体验者功能
isMall: isMall,//商城和门户区分 门户时 false; 商城 true
orderingMustOpenCard: orderingMustOpenCard,//下单时是否强校验必须开卡 true 必须开卡才可下单 false 不开卡可以下单
}
})()
......
......@@ -390,7 +390,7 @@ wxService.page({
var self = this
wx.showModal({
title: '提示',
content: '确认删除该商品',
content: '确认删除购物车中该商品?',
success(res) {
if (res.confirm) {
var cartList = self.data.cartList
......
......@@ -72,6 +72,11 @@ page{
padding-bottom: 32rpx;
align-items: center;
}
.pro-info:last-child{
border-bottom: none;
}
.cart-item:last-child .pro-info{
border-bottom: none;
}
......
......@@ -35,6 +35,7 @@ wxService.page({
defalutCoupon: '',
defalutCouponId: '', // 默认第一项
addressId: '', // 收货地址id
totalGoodsPrice : 0,
},
/**
......@@ -121,6 +122,40 @@ wxService.page({
})
},
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
// 保存地址 && 支付
if (goodsAddress) {
......@@ -340,11 +375,13 @@ wxService.page({
wx.hideLoading()
let skuList = data.tradePreviewSkus
let sum =0
let sum = 0
skuList.forEach((item,index) => {
// item.price
sum += skuList[index].price
})
sum += skuList[index].price * skuList[index].count;
});
this.data.totalGoodsPrice = sum;
// 初始化商品价格
const { isSelect } = this.data
......@@ -373,7 +410,8 @@ wxService.page({
couponSettingId: data && data.couponDiscountPreviews.length &&
data.couponDiscountPreviews[0] && data.couponDiscountPreviews[0].couponDTOS[0] &&
data.couponDiscountPreviews[0].couponDTOS[0].couponSettingId || '',
orderInitPrice: data.amount
orderInitPrice: data.amount,
totalGoodsPrice: this.data.totalGoodsPrice
}, () => {
// 实付款
this.setPayPrice()
......
......@@ -110,7 +110,7 @@
<view class="order-price">
<view class="pro-total-price">
<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 class="plus-price" wx:if="{{isSelect}}">
<view class="plus-info">
......
......@@ -15,27 +15,32 @@ wxService.page({
{
type: '1',
status: '',
name: '全部'
name: '全部',
hasTips : false
},
{
type: '2',
status: 'N',
name: '待付款' // 新建
name: '待付款', // 新建
hasTips: false
},
{
type: '3',
status: 'P',
name: '待发货'
name: '待发货',
hasTips: false
},
{
type: '4',
status: 'D',
name: '待收货'
name: '待收货',
hasTips: false
},
{
type: '5',
status: 'RF',
name: '退款/售后'
name: '退款/售后',
hasTips: false
}
],
currentIndex: 1,
......@@ -62,7 +67,6 @@ wxService.page({
* 生命周期函数--监听页面显示
*/
onShow: function () {
console.log('currentIndex', this.data.currentIndex)
const { currentIndex } = this.data
if (currentIndex == 5) {
......@@ -75,9 +79,6 @@ wxService.page({
this.initOrderList(this.data.pageNo, this.data.pageSize, this.data.status)
})
}
},
// 确认收货
handelConfirmReceipt(e) {
......@@ -112,9 +113,19 @@ wxService.page({
},
// 删除订单
handelDelOrder(e) {
let _this = this;
wx.showModal({
title: '订单删除提示',
content: '确认删除此订单?',
showCancel: true,
cancelText: '取消',
confirmText: '删除',
confirmColor: '#cb3c3c',
success: function (modalRes) {
if (modalRes.confirm) {
const { id } = e.currentTarget.dataset
wx.showLoading({
title: '加载中',
title: '订单删除中..',
mask: true
})
wxService.post(`/sale/trade/buyer/delete/${id}`).then(res => {
......@@ -127,21 +138,19 @@ wxService.page({
icon: 'none'
})
setTimeout(() => {
this.onShow()
_this.initOrderList(_this.data.pageNo, _this.data.pageSize, _this.data.status)
}, 200)
}
} else {
wx.showToast({
title: `删除失败!`,
icon: 'none'
})
setTimeout(() => {
this.onShow()
}, 200)
}
})
});
}
}
});
},
// 立即支付
handelToPay(e) {
......@@ -201,7 +210,6 @@ wxService.page({
// 取消退款
handelCancelRefund(e) {
const { id } = e.currentTarget.dataset
console.log('取消退款', id)
this.handelRevokeRefund(id)
},
handelRevokeRefund(id) {
......@@ -216,11 +224,10 @@ wxService.page({
if (result == 0) {
wx.hideLoading()
wx.showToast({
title: '撤销退款成功',
icon: 'none'
title: '取消退款成功',
});
setTimeout(() => {
wxService.router('/pages/order/order')
this.getRefundList(this.data.pageNo, this.data.pageSize);
}, 200)
}
}
......@@ -251,8 +258,8 @@ wxService.page({
}
})
},
initOrderList(pageNo, pageSize, status) {
console.log('-------------', status)
wx.showLoading({
title: '加载中',
mask: true
......@@ -287,66 +294,32 @@ wxService.page({
if (res) {
const { result, data } = res.data
if (result == 0) {
wx.hideLoading()
wx.hideLoading();
this.setData({
orderList: this.data.pageNo == 1 ? [...data] : [...this.data.orderList, ...data],
noMoreFlag: data.length < pageSize ? true : false
}, () => {
// this.data.orderList.forEach(item =>{
// console.log('item', item)
// // 退单列表
// if(item.tradeId){
// console.log('item.tradeId', item.tradeId)
// let currentTradeId = item.tradeId
// this.setData({
// currentTradeId
// },()=>{
// this.refundDetail()
// })
// console.log(this.data.orderList)
// let hasFilter = this.data.orderList.filter(item => item.status != 'C' && item.status != 'D');
// if (hasFilter.length > 0){
// this.data.swiperItem[4].hasTips = true;
// }
// else{
// this.data.swiperItem[4].hasTips = false;
// }
// })
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(){
this.getRefundList(1,5);
......@@ -363,7 +336,17 @@ wxService.page({
* 页面相关事件处理函数--监听用户下拉动作
*/
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 @@
"usingComponents": {
"no-more": "/component/noMore/noMore",
"go-home": "/component/goHome/goHome",
"empty": "/component/empty/empty",
"apply-refund": "/component/applyRefund/applyRefund"
}
}
\ No newline at end of file
......@@ -10,6 +10,7 @@
data-status="{{item.status}}"
>
{{item.name}}
<view class='red-num' wx:if="{{item.hasTips}}"></view>
</view>
</view>
<view class="order-content" wx:if="{{orderList.length}}">
......@@ -47,6 +48,8 @@
<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 == 'R'}}">已完成</text>
<text class="order-status" wx-if="{{item.status == 'PR'}}">退货中</text>
<text class="order-status" wx-if="{{item.status == 'RE'}}">退货完成</text>
</view>
</view>
<!-- 类型 -->
......@@ -137,12 +140,13 @@
</view>
</view>
<view wx:else>
<view class="btn-group">
<view class="order-status" wx-if="{{item.status == 'C'}}">
<view class="btn-group" wx:if="{{item.status != 'PR'}}">
<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>
</view>
<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 class="order-status" wx-if="{{item.status == 'P'}}">
<button
......@@ -163,7 +167,7 @@
</button>
<button class="btn btn-sm btn-primary btn-outline" data-id="{{item.id}}" bindtap="handelConfirmReceipt">确认收货</button>
</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>-->
</view>
</view>
......@@ -174,7 +178,8 @@
</view>
</view>
<view hidden="{{no_data}}" class="no-list df border_box">
当前无数据
<!-- 当前无数据 -->
<empty show="{{no_data}}" text="未查找您的订单信息哦~" />
</view>
</view>
<apply-refund show="{{showApplyRefundModal}}" refundId="{{refundId}}" bind:ok="onDeliveryOk" />
......
......@@ -8,7 +8,8 @@ scroll-view{
}
.swiper-tab{
width: 580rpx;
/* width: 580rpx; */
width: 100%;
display: flex;
background-color: #ffffff;
color: #000000;
......@@ -16,16 +17,38 @@ scroll-view{
top: 0;
z-index:1;
justify-content: space-between;
padding: 24rpx 85rpx 0;
padding: 24rpx 40rpx 0;
box-sizing: border-box;
-webkit-box-sizing: border-box;
}
.swiper-tab-item{
padding: 14rpx 0;
padding: 14rpx 10rpx;
padding-bottom: 20rpx;
text-align: center;
font-size: 24rpx;
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{
color: #C09A74;
color: #cb3c3c;
}
.order-content{
margin-top: 100rpx;
......@@ -122,4 +145,6 @@ scroll-view{
.no-list {
padding-top: 300rpx;
font-size: 26rpx;
box-sizing: border-box;
-webkit-box-sizing: border-box;
}
......@@ -17,7 +17,9 @@ wxService.page({
min: '00',
sec: '00',
ms: '0',
mergedAmount: 0
mergedAmount: 0,
totalGoodsPrice : 0,
canApplyRefund : true
},
/**
......@@ -71,9 +73,30 @@ wxService.page({
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({
detail: data,
mergedAmount: data.mergedAmount || 0
totalGoodsPrice: this.data.totalGoodsPrice,
mergedAmount: data.mergedAmount || 0,
canApplyRefund: canApplyRefund
}, ()=>{
this.initCountDown(data.countDownOrderTime, data.createOrderTime, data.localNowTime)
})
......@@ -141,9 +164,19 @@ wxService.page({
},
// 删除订单
handelDelOrder(e) {
let _this = this;
wx.showModal({
title: '订单删除提示',
content: '确认删除此订单?',
showCancel: true,
cancelText: '取消',
confirmText: '删除',
confirmColor: '#cb3c3c',
success: function (modalRes) {
if (modalRes.confirm) {
const { id } = e.currentTarget.dataset
wx.showLoading({
title: '加载中',
title: '订单删除中..',
mask: true
})
wxService.post(`/sale/trade/buyer/delete/${id}`).then(res => {
......@@ -153,22 +186,24 @@ wxService.page({
wx.hideLoading()
wx.showToast({
title: `删除成功!`,
icon: 'none'
})
});
setTimeout(() => {
wxService.router('/pages/order/order')
},200)
wx.navigateBack({
delta : 1
});
}, 500);
} else {
wx.showToast({
title: `删除失败!`,
icon: 'none'
})
setTimeout(() => {
wxService.router('/pages/order/order')
},200)
}
}
})
});
}
}
});
},
// 立即支付
handelToPay(e) {
......@@ -204,11 +239,22 @@ wxService.page({
},
// 取消订单
handelCancelOrder(e) {
let _this = this;
wx.showModal({
title: '订单取消提示',
content: '确认取消此订单?',
showCancel: true,
cancelText: '再想想',
confirmText: '取消订单',
confirmColor: '#cb3c3c',
success: function (modalRes) {
if (modalRes.confirm) {
//跳去开卡
const { id } = e.currentTarget.dataset
wx.showLoading({
title: '加载中',
title: '订单取消中..',
mask: true
})
});
wxService.post(`/sale/trade/buyer/cancel/${id}`).then(res => {
if (res) {
......@@ -220,20 +266,19 @@ wxService.page({
icon: 'none'
})
setTimeout(() => {
wxService.router('/pages/order/order')
},200)
_this.getOrderDetail(_this.data.id);
}, 200)
} else {
wx.showToast({
title: `取消失败!`,
icon: 'none'
})
setTimeout(() => {
wxService.router('/pages/order/order')
},200)
}
}
})
}
}
});
},
// 查看物流
checkLogistics(e) {
......@@ -246,8 +291,17 @@ wxService.page({
handelRequestRefund(e) {
const { id } = e.currentTarget.dataset
const { detail } = e.currentTarget.dataset
detail.id = this.data.id
let params = JSON.stringify(detail)
detail.id = this.data.id;
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})
},
......
......@@ -16,7 +16,15 @@
<!--订单状态(C:取消;N:新建,P:已支付;D:已发货;R:已收货) -->
<view class="order-status" wx-if="{{detail.status == 'C'}}">
<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 class="order-status" wx-if="{{detail.status == 'N'}}">
<view class="status">待付款</view>
......@@ -36,7 +44,7 @@
</view>
</view>
</view>
<view class="address-info" wx:if="{{detail.member}}">
<!-- <view class="address-info" wx:if="{{detail.member}}">
<view class="address-name">
<text>{{detail.member.name}}</text>
<text class="user-phone">{{detail.member.mobile}}</text>
......@@ -44,17 +52,17 @@
<view class="address-detail">
{{detail.member.address}}
</view>
<!-- <view class="edit-address">
<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">
<block wx:for="{{detail.skuVOList}}" wx:for-item="item" wx:key="">
<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-name">{{item.productName}}</view>
<view class="pro-desc">{{item.skuSpec}}</view>
......@@ -62,6 +70,10 @@
<text class="price">¥{{item.price}}</text>
<text class="number">x {{item.count}}</text>
</view>
<view class="refund-info" wx:if="{{item.refundCount != 0}}">
<text class='refund-name'>退款</text>
<text>x {{item.refundCount}}</text>
</view>
</view>
</view>
</block>
......@@ -71,7 +83,7 @@
<view class="order-pro-info">
<view class="order-pro-list">
<text>商品合计</text>
<text>¥{{detail.skuAmount}}</text>
<text>¥{{totalGoodsPrice}}</text>
</view>
<view class="order-pro-list">
<text>运费</text>
......@@ -122,7 +134,7 @@
<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>
</view>
<view class="button-wrap" wx-if="{{detail.status == 'P'}}">
<view class="button-wrap" wx-if="{{detail.status == 'P' && canApplyRefund}}">
<button
class="btn btn-lg btn-gray"
data-id="{{detail.id}}"
......@@ -131,7 +143,7 @@
>申请退款
</button>
</view>
<view class="button-wrap" wx-if="{{detail.status == 'D'}}">
<view class="button-wrap" wx-if="{{detail.status == 'D' && canApplyRefund}}">
<button
class="btn btn-primary btn-lg"
data-id="{{detail.id}}"
......
......@@ -65,7 +65,7 @@ page{
justify-content: space-between;
}
.pro-wrap{
padding: 19rpx 32rpx 53rpx 30rpx;
padding: 20rpx 30rpx;
background-color: #ffffff;
}
.choose-pro{
......@@ -81,12 +81,28 @@ page{
font-size: 28rpx;
}
.pro-list{
border-bottom: 1px solid rgba(151,151,151,0.3);
border-bottom: 1px solid #eeeeee;
padding:31rpx 0 25rpx;
display: flex;
}
.pro-list:last-child{
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{
width: 160rpx;
height: 160rpx;
......@@ -99,17 +115,24 @@ page{
}
.pro-name{
font-size: 25rpx;
color: #666666;
color: #333333;
width: 500rpx;
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{
font-size: 22rpx;
color: #aaaaaa;
color: #999999;
margin-top: 10rpx;
}
.pro-price{
margin-top: 16rpx;
margin-top: 12rpx;
}
.price{
color: #cb3c3c;
......
......@@ -147,19 +147,6 @@ wxService.page({
const { id } = e.currentTarget.dataset
wxService.router(`/pages/pointDetail/pointDetail`).search({ id })
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
......
......@@ -52,6 +52,7 @@ wxService.page({
const { result, data } = res.data
if (result == 0) {
wx.hideLoading()
this.setData({
productInfo: data
})
......@@ -165,6 +166,7 @@ wxService.page({
const { result, data } = res.data
if (result == 0) {
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({
productInfo: data
})
......
......@@ -89,7 +89,9 @@
</view>
<block wx:if="{{showHtml}}">
<view class='html'>
<x-html html="{{productInfo.descHtml}}" />
</view>
</block>
<view class="product-footer">
......@@ -146,7 +148,8 @@
report-submit
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
class='get-formId get-formId--form'
......
......@@ -4,6 +4,11 @@
page{
padding-bottom: 100rpx;
}
.html{
margin-bottom: 40rpx;
}
.swiper-image{
width: 100%;
}
......
......@@ -75,6 +75,7 @@ wxService.page({
})
this.handelRequestRefund(refundCreateDto)
},
//创建退款
handelRequestRefund(params) {
wx.showLoading({
title: '加载中',
......@@ -87,7 +88,6 @@ wxService.page({
wx.hideLoading()
wx.showToast({
title: '申请退款成功',
icon: 'none'
});
// 订单列表
setTimeout(() => {
......@@ -101,6 +101,7 @@ wxService.page({
})
},
//获取退款原因列表
getReasonList() {
wx.showLoading({
title: '加载中',
......@@ -184,12 +185,21 @@ wxService.page({
this.editOk(cartList[index]) //调用完成
})
},
//新增数量
addNum: function (e) { // 增加数量
var index = e.currentTarget.dataset.index
var cartList = this.data.cartList
var proNum = cartList[index].count
var proNum = cartList[index].count;
if (proNum < cartList[index].canRefundNum){
proNum++
}
else{
wx.showToast({
title: '退单数量不能大于当前商品购买数量',
icon : 'none'
});
return ;
}
cartList[index].count = proNum
this.setData({
......@@ -243,8 +253,7 @@ wxService.page({
for (let i = 0; i < cartList.length; i++) {
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({
......@@ -252,12 +261,29 @@ wxService.page({
})
},
/**
* 生命周期函数--监听页面加载
*/
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({
* 生命周期函数--监听页面显示
*/
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={}) {
// const params = {
// refundCreateDto: {...cartPro}
// }
const params = {...cartPro}
wx.showLoading({
title: '加载中',
......@@ -305,38 +315,5 @@ wxService.page({
}
})
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
}
})
\ No newline at end of file
});
\ No newline at end of file
......@@ -14,10 +14,12 @@
/>
</view>
<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-name">{{item.name}}</view>
<view class="pro-sku">{{item.sku}}</view>
<view class="pro-name">{{item.productName}}</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="price">¥ {{item.price}}</view>
<view class="pro-num-edit">
......@@ -37,7 +39,7 @@
</view>
</view>
</view>
<!-- 退款信息 -->
<view class="refund-info">
<view class="form">
<view class="form-label">退款原因</view>
......@@ -62,8 +64,7 @@
<view class="form">
<view class="form-label block-label">申请说明</view>
<view class="form-input">
<input
type="textarea"
<textarea
class="desc"
placeholder="请您详细填写退款说明(最多200字)"
maxlength="200"
......
......@@ -28,8 +28,8 @@ page{
margin-left: 24rpx;
flex: 1;
display: flex;
border-bottom: 1rpx solid rgba(151,151,151,0.3);
padding-bottom: 32rpx;
border-bottom: 1rpx solid #eeeeee;
padding-bottom: 20rpx;
align-items: center;
}
.cart-item:last-child .pro-info{
......@@ -104,8 +104,13 @@ page{
padding: 26rpx 30rpx 35rpx;
}
.form{
margin-top: 27rpx;
margin-top: 20rpx;
}
.form:first-child{
margin-top: 0;
}
.form-label{
font-size: 26rpx;
color: #333333;
......@@ -123,7 +128,7 @@ page{
height: 68rpx;
line-height: 68rpx;
border-radius: 5rpx;
border: 1px solid rgba(170, 170, 170, 1);
border: 1px solid #eeeeee;
padding: 0 20rpx;
color: #aaaaaa;
font-size: 22rpx;
......@@ -138,10 +143,13 @@ page{
}
.desc{
width: 632rpx;
height: 104rpx;
min-height: 160rpx;
border-radius: 5rpx;
border: 1px solid rgba(170, 170, 170, 1);
padding: 21rpx 29rpx;
border: 1px solid #eeeeee;
padding: 20rpx;
font-size: 28rpx;
text-align: left;
vertical-align: top;
}
.submit{
width: 750rpx;
......
......@@ -54,7 +54,9 @@ wxService.page({
icon: 'none'
});
setTimeout(() => {
wxService.router('/pages/order/order')
wx.navigateBack({
delta : 1
});
},200)
}
}
......
......@@ -117,7 +117,7 @@
</view>
<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>
......
......@@ -258,7 +258,8 @@ wxService.page({
wx.showLoading({
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
const { result, data } = res.data
if (result == 0) {
......
......@@ -39,7 +39,7 @@
"list": []
},
"miniprogram": {
"current": 32,
"current": 24,
"list": [
{
"id": -1,
......@@ -144,7 +144,7 @@
"id": 16,
"name": "商品详情页",
"pathName": "pages/productDetail/productDetail",
"query": "id=636986178138152960",
"query": "id=619906008814456832",
"scene": null
},
{
......@@ -200,7 +200,7 @@
"id": 24,
"name": "订单详情",
"pathName": "pages/orderDetail/orderDetail",
"query": "id=625052614006149120",
"query": "id=661154673541124096",
"scene": null
},
{
......
......@@ -578,6 +578,7 @@ class WXService extends Http {
config.data.plusIsOpen = envInfo.plusIsOpen;
config.data.contactUsPluginId = envInfo.contactUsPluginId;
config.data.contactUsIsOpen = envInfo.contactUsIsOpen;
config.data.orderingMustOpenCard = envInfo.orderingMustOpenCard;
const CONFIG_PAPGE = {
onLoad: function (...args) {
......@@ -683,6 +684,11 @@ class WXService extends Http {
}
});
}
else{
this.setData({
experAccessible: true
})
}
});
} else {
page.setData({
......@@ -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))
}
......
......@@ -2,6 +2,7 @@
/**
* wxParser 基础样式
*/
.wxParser-div,
.wxParser-p {
word-break: break-all;
......@@ -18,7 +19,15 @@
padding: 0; }
.wxParser-p {
margin: 5rpx 0; }
/* margin: 5rpx 0; */
/* padding-bottom: 0; */
overflow: hidden;
}
.wxParser-p image{
display: inline-block;
float:left;
}
.wxParser-br {
height: 0.4em; }
......@@ -125,6 +134,7 @@
.wxParser-img {
overflow: hidden;
/* vertical-align:top; */
max-width: 100%; }
.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