cshenfu
2024-06-27 58aa6e282bb343503be3cb198948328ea3ed7b79
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
'use strict';
const orderState = require('../../../../../application/service/orderState.js')
const applicationConstant = require('../../../../../application/constant/applicationsConstant.js')
const businessState = require('../../../../../application/service/businessState.js')
const orderPaySuccess = require('../../../../../application/service/orderPaySuccess.js');
module.exports = {
    /**
     * 充值学习币
     * @url client/order/kh/create/coin 前端调用的url参数地址
     * data 请求参数
     * @param {String} params1  参数1
     */
    main: async (event) => {
        let { data = {}, userInfo, util, filterResponse, originalParam } = event;
        let { customUtil, uniID, config, pubFun, vk, db, _ } = util;
        let { uid } = data;
        let res = { code: 0, msg: "" };
        // 业务逻辑开始-----------------------------------------------------------
 
        //数据准备
        let promoCodeId = ""
        let title = '充值学习币'
        let total = data.amount
        let platform = data.platform
        let type = 'recharge'
        let goods_item = [{
            'oid': null,
            'user_id': uid,
            'charge': total,
            'type': type,
            'num': 1,
            'goods_name': title,
        }]
 
        //统一创建订单
        res = await orderState.createOrder(event, uid, total, title, type, platform, goods_item, promoCodeId)
 
        // 业务逻辑结束-----------------------------------------------------------
        return res;
    }
}