1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253 |
- const $ = global;
- const orderTexts = [
- '已预约,等待处理',
- '未付款',
- '已付款'
- ]
- new $.Page({
- data: {
- services: [],
- goods: []
- },
- onShow() {
- this.init();
- },
- init() {
- $.request('my/orders', 'GET', {}).then((res) => {
- const services = []
- const goods = []
- if (res.data && res.data.length > 0) {
- res.data.forEach(e => {
- e.orderText = orderTexts[e.status];
- if (e.order_type == 'product_order') {
- goods.push(e);
- } else {
- services.push(e);
- }
- });
- this.setData({
- services,
- goods
- });
- }
- });
- },
- toPay(e) {
- const {
- id
- } = e.target.dataset;
- if (id) {
-
- }
- },
- addComment(e) {
- const {
- id
- } = e.target.dataset;
- if (id) {
- $.router.goto({
- path: '/pages/addComment/index'
- });
- }
- }
- });
|