fix bug
parent
3566cca5f0
commit
0b31c3eb0a
|
|
@ -1,15 +1,15 @@
|
|||
APP_BASE_URL=http://47.103.169.154:8080/api/h5app/wxapp
|
||||
APP_WEBSOCKET=wss://http://47.103.169.154:8080/ws
|
||||
APP_BASE_URL=https://test.birkenstock.net.cn/api/h5app/wxapp
|
||||
APP_WEBSOCKET=wss://test.birkenstock.net.cn/ws
|
||||
APP_COMPANY_ID=1
|
||||
APP_PLATFORM=standard
|
||||
APP_CUSTOM_SERVER=http://47.103.169.154:8081/
|
||||
APP_CUSTOM_SERVER=https://test.birkenstock.net.cn/
|
||||
APP_HOME_PAGE=/pages/index
|
||||
APP_TRACK=youshu
|
||||
APP_YOUSHU_TOKEN=bi281e87ab2424481a
|
||||
# APP_ID=wx3e1c17c88abf3e45
|
||||
APP_ID=wx55ff808ba0e28b1d
|
||||
APP_ID=wx72e9e1a93420862c
|
||||
APP_MAP_KEY=1ccc1ebc947719886f0cd766d70241fe
|
||||
APP_MAP_NAME=oneX新零售门店定位
|
||||
APP_MAP_NAME=BIRKENSTOCK门店定位
|
||||
APP_IMAGE_CDN=https://b-img-cdn.yuanyuanke.cn/ecshopx-vshop
|
||||
APP_IMAGE_CDN_NEW=https://espier-oss-cdn.oss-cn-shanghai.aliyuncs.com/default_project/wxAssets
|
||||
APP_DIANWU_URL=
|
||||
|
|
|
|||
|
|
@ -1,15 +1,15 @@
|
|||
APP_BASE_URL=https://test.birkenstock.net.cn/api/h5app/wxapp
|
||||
APP_WEBSOCKET=wss://test.birkenstock.net.cn/ws
|
||||
APP_BASE_URL=http://47.103.169.154:8080/api/h5app/wxapp
|
||||
APP_WEBSOCKET=wss://http://47.103.169.154:8080/ws
|
||||
APP_COMPANY_ID=1
|
||||
APP_PLATFORM=standard
|
||||
APP_CUSTOM_SERVER=https://test.birkenstock.net.cn/
|
||||
APP_CUSTOM_SERVER=http://47.103.169.154:8081/
|
||||
APP_HOME_PAGE=/pages/index
|
||||
APP_TRACK=youshu
|
||||
APP_YOUSHU_TOKEN=bi281e87ab2424481a
|
||||
# APP_ID=wx3e1c17c88abf3e45
|
||||
APP_ID=wx72e9e1a93420862c
|
||||
APP_ID=wx55ff808ba0e28b1d
|
||||
APP_MAP_KEY=1ccc1ebc947719886f0cd766d70241fe
|
||||
APP_MAP_NAME=BIRKENSTOCK门店定位
|
||||
APP_MAP_NAME=oneX新零售门店定位
|
||||
APP_IMAGE_CDN=https://b-img-cdn.yuanyuanke.cn/ecshopx-vshop
|
||||
APP_IMAGE_CDN_NEW=https://espier-oss-cdn.oss-cn-shanghai.aliyuncs.com/default_project/wxAssets
|
||||
APP_DIANWU_URL=
|
||||
|
|
@ -1,8 +1,8 @@
|
|||
APP_BASE_URL=https://slb.birkenstock.net.cn/api/h5app/wxapp
|
||||
APP_WEBSOCKET=wss://slb.birkenstock.net.cn/ws
|
||||
APP_BASE_URL=https://test.birkenstock.net.cn/api/h5app/wxapp
|
||||
APP_WEBSOCKET=wss://test.birkenstock.net.cn/ws
|
||||
APP_COMPANY_ID=1
|
||||
APP_PLATFORM=standard
|
||||
APP_CUSTOM_SERVER=https://slb.birkenstock.net.cn/
|
||||
APP_CUSTOM_SERVER=https://test.birkenstock.net.cn/
|
||||
APP_HOME_PAGE=/pages/index
|
||||
APP_TRACK=youshu
|
||||
APP_YOUSHU_TOKEN=bi281e87ab2424481a
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
"miniprogramRoot": "dist/",
|
||||
"projectname": "ecshopx-vshop",
|
||||
"description": "weshop for platform",
|
||||
"appid": "wx55ff808ba0e28b1d",
|
||||
"appid": "wx72e9e1a93420862c",
|
||||
"setting": {
|
||||
"urlCheck": false,
|
||||
"es6": false,
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ export const TRADE_ITEM = {
|
|||
// 可售后商品数
|
||||
leftAftersalesNum: 'left_aftersales_num',
|
||||
// 默认售后商品数
|
||||
refundNum: 1,
|
||||
refundNum: ({ num }) => num || 1,
|
||||
itemSpecDesc: 'item_spec_desc',
|
||||
point: 'point',
|
||||
checked: () => false,
|
||||
|
|
|
|||
|
|
@ -149,8 +149,8 @@ function TradeAfterSale (props) {
|
|||
}
|
||||
setState(draft => {
|
||||
draft.aftersales = _aftersales
|
||||
draft.afterSaleTotalNum = _aftersales.items.reduce((sum, { num }) => sum + num, 0)
|
||||
draft.afterSaleTotalprice = _aftersales.items.reduce((sum, { price }) => sum + price, 0)
|
||||
draft.afterSaleTotalNum = _aftersales.items.reduce((sum, { num, refundNum }) => sum + +refundNum, 0)
|
||||
draft.afterSaleTotalprice = _aftersales.items.reduce((sum, { price, num, refundNum }) => sum + price / num * refundNum, 0)
|
||||
})
|
||||
}
|
||||
const { orderInfo, offline_aftersales_is_open, distributor } = await api.trade.detail(id)
|
||||
|
|
@ -183,19 +183,22 @@ function TradeAfterSale (props) {
|
|||
draft.allClicked = !allClicked
|
||||
draft.info.items.map((_item) => {
|
||||
_item.checked = !allClicked
|
||||
_item.refundNum = _item.num
|
||||
})
|
||||
} else {
|
||||
draft.info.items[index].checked = !item.checked
|
||||
}
|
||||
draft.allClicked = draft.info.items.every((item) => item.checked)
|
||||
draft.afterSaleTotalNum = draft.info.items.filter((_item) => _item.checked).reduce((sum, { num }) => sum + num, 0)
|
||||
draft.afterSaleTotalprice = draft.info.items.filter((_item) => _item.checked).reduce((sum, { price }) => sum + price, 0)
|
||||
draft.afterSaleTotalNum = draft.info.items.filter((_item) => _item.checked).reduce((sum, { num, refundNum }) => sum + +refundNum, 0)
|
||||
draft.afterSaleTotalprice = draft.info.items.filter((_item) => _item.checked).reduce((sum, { price, num, refundNum }) => sum + price / num * refundNum, 0)
|
||||
})
|
||||
}
|
||||
|
||||
const onChangeItemNum = (e, index) => {
|
||||
setState(draft => {
|
||||
draft.info.items[index].refundNum = e
|
||||
draft.afterSaleTotalNum = draft.info.items.filter((_item) => _item.checked).reduce((sum, { num, refundNum }) => sum + +refundNum, 0)
|
||||
draft.afterSaleTotalprice = draft.info.items.filter((_item) => _item.checked).reduce((sum, { price, num, refundNum }) => sum + price / num * refundNum, 0)
|
||||
})
|
||||
}
|
||||
|
||||
|
|
@ -248,7 +251,7 @@ function TradeAfterSale (props) {
|
|||
detail: checkedItems.map(({ id: _id, refundNum, num }) => {
|
||||
return {
|
||||
id: _id,
|
||||
num: num || refundNum
|
||||
num: refundNum
|
||||
}
|
||||
}),
|
||||
order_id: id,
|
||||
|
|
@ -399,9 +402,10 @@ function TradeAfterSale (props) {
|
|||
</> : <Text className="choose-item" style={{ fontSize: '30rpx', fontWeight: 'bold' }}>已选择的退货商品</Text>}
|
||||
<View className='refund-items'>
|
||||
<View className='items-container'>
|
||||
{console.log(aftersales?.items || info?.items, '--------')}
|
||||
{
|
||||
(aftersales?.items || info?.items || []).map((item, index) => (
|
||||
<View className="item-box" onClick={onChangeItemCheck.bind(this, item, index)}>
|
||||
<View className="item-box">
|
||||
<View className='item-wrap' key={`item-wrap__${index}`}>
|
||||
{!afterSaleTid && <View className='item-hd'>
|
||||
<SpCheckbox checked={item.checked} onChange={onChangeItemCheck.bind(this, item, index)} />
|
||||
|
|
@ -422,7 +426,7 @@ function TradeAfterSale (props) {
|
|||
}
|
||||
}}
|
||||
/> */}
|
||||
<SpImage src={item.pic} width={150} height={150} mode='aspectFill' radius={4} circle={4} />
|
||||
<SpImage onClick={onChangeItemCheck.bind(this, item, index)} src={item.pic} width={150} height={150} mode='aspectFill' radius={4} circle={4} />
|
||||
<View className='goods-info'>
|
||||
<View className='goods-info-hd'>
|
||||
<Text className='goods-title'>{item.itemName}</Text>
|
||||
|
|
@ -432,15 +436,15 @@ function TradeAfterSale (props) {
|
|||
{/* <View><SpPrice size={28} value={item.price / item.num} /> x <Text className='num'>{item.num}</Text></View> */}
|
||||
</View>
|
||||
<View className='goods-info-ft'>
|
||||
<Text>数量:{item.num}</Text>
|
||||
<SpPrice size={20} value={item.price / item.num} showSeparator noDecimal={false} />
|
||||
{/* <SpInputNumber
|
||||
disabled={!item.leftAftersalesNum}
|
||||
{/* <Text>数量:{item.num}</Text> */}
|
||||
<SpInputNumber
|
||||
// disabled={!item.leftAftersalesNum}
|
||||
value={item.refundNum}
|
||||
max={item.leftAftersalesNum}
|
||||
max={item.num}
|
||||
min={1}
|
||||
onChange={(e) => onChangeItemNum(e, index)}
|
||||
/> */}
|
||||
/>
|
||||
<SpPrice size={20} value={item.price / item.num * item.refundNum} showSeparator noDecimal={false} />
|
||||
</View>
|
||||
</View>
|
||||
</View>
|
||||
|
|
|
|||
|
|
@ -188,6 +188,7 @@
|
|||
align-items: center;
|
||||
// margin-top: 10px;
|
||||
font-size: 20px;
|
||||
|
||||
.sp-price {
|
||||
margin-left: 30px;
|
||||
.sp-price__symbol {
|
||||
|
|
@ -354,15 +355,17 @@
|
|||
/* prettier-ignore */
|
||||
border: 1PX solid #999;
|
||||
border-radius: 0;
|
||||
height: 44px;
|
||||
height: 34px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
&__btn {
|
||||
color: #222;
|
||||
padding: 0;
|
||||
width: 40px;
|
||||
width: 34px;
|
||||
display: block;
|
||||
height: 40px;
|
||||
height: 34px;
|
||||
box-sizing: border-box;
|
||||
line-height: 44px;
|
||||
line-height: 34px;
|
||||
.at-icon-subtract {
|
||||
transform: scale(0.8);
|
||||
}
|
||||
|
|
@ -375,8 +378,8 @@
|
|||
border-left: 1PX solid #999;
|
||||
border-right: 1px solid #999;
|
||||
width: 60px;
|
||||
height: 32px;
|
||||
line-height: 32px;
|
||||
height: 30px;
|
||||
line-height: 30px;
|
||||
font-size: 24px;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue