-
Notifications
You must be signed in to change notification settings - Fork 63
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
189 changed files
with
2,682 additions
and
1,097 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,9 @@ | ||
{ | ||
"description": "项目私有配置文件。此文件中的内容将覆盖 project.config.json 中的相同字段。项目的改动优先同步到此文件中。详见文档:https://developers.weixin.qq.com/miniprogram/dev/devtools/projectconfig.html", | ||
"projectname": "tixwork-taro", | ||
"projectname": "marketing", | ||
"setting": { | ||
"compileHotReLoad": true | ||
} | ||
"compileHotReLoad": true, | ||
"urlCheck": false | ||
}, | ||
"libVersion": "3.3.1" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
import { Text, View } from '@tarojs/components'; | ||
import Taro from '@tarojs/taro'; | ||
import Q from '@/http/q'; | ||
import NavigationService from '@/nice-router/navigation-service'; | ||
import ApiConfig from '@/utils/api-config'; | ||
import { Order } from '@/types'; | ||
import WechatPayUtils from '@/utils/wechat-pay-utils'; | ||
|
||
// const mockActions = [ | ||
// { code: 'CANCEL', title: '取消订单', uiType: 'primary' }, | ||
// { code: 'PAY', title: '微信支付' }, | ||
// { code: 'CONFIRM_RECEIVE', title: '确认收货' }, | ||
// { code: 'REORDER', title: '再来一单' }, | ||
// { code: 'VIEW', title: '查看详情' }, | ||
// ]; | ||
export default function OrderActions(props: { order: Order; onRefresh: () => void }) { | ||
const { order, onRefresh } = props; | ||
const goToDetail = () => NavigationService.goPage('/pages/order/order-detail-page', { id: order?.id }); | ||
|
||
const { actions = [] } = order; | ||
const handleClick = async (e, it) => { | ||
e.preventDefault(); | ||
e.stopPropagation(); | ||
|
||
if (it.code === 'CANCEL') { | ||
Taro.showModal({ | ||
title: '取消订单', | ||
content: '是否确认取消订单?', | ||
success: async (res) => { | ||
if (res.confirm) { | ||
const resp = await Q.remove(ApiConfig.cancelOrder, { id: order?.id }); | ||
if (resp.data === true) { | ||
Taro.showToast({ title: '取消成功', icon: 'none' }); | ||
onRefresh?.(); | ||
} | ||
} | ||
}, | ||
}); | ||
return; | ||
} | ||
|
||
if (it.code === 'PAY') { | ||
await WechatPayUtils.pay(order?.id); | ||
onRefresh?.(); | ||
return; | ||
} | ||
if (it.code === 'CONFIRM_RECEIVE') { | ||
// TODO | ||
Taro.showToast({ title: '确认订单', icon: 'none' }); | ||
return; | ||
} | ||
if (it.code === 'REORDER') { | ||
Taro.showModal({ | ||
title: '再来一单', | ||
content: '重新添加到购物车?', | ||
success: async (res) => { | ||
if (res.confirm) { | ||
const resp = await Q.get(ApiConfig.reorder, { id: order?.id }); | ||
if (resp.data === true) { | ||
Taro.showToast({ title: '添加成功', icon: 'none' }); | ||
await NavigationService.goPage('/pages/cart/cart-page'); | ||
} | ||
} | ||
}, | ||
}); | ||
return; | ||
} | ||
if (it.code === 'VIEW') { | ||
goToDetail(); | ||
return; | ||
} | ||
Taro.showToast({ title: '暂未开放', icon: 'none' }); | ||
}; | ||
|
||
return ( | ||
<View className='order-item-footer'> | ||
{actions.map((it) => { | ||
return ( | ||
<View | ||
key={it.code} | ||
className={'order-action ' + (it.uiType == 'primary' ? 'primary' : '')} | ||
onClick={(e) => handleClick(e, it)} | ||
> | ||
<Text className='order-action-txt'>{it.title}</Text> | ||
</View> | ||
); | ||
})} | ||
</View> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.