123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170 |
- import {
- getStore,
-
- setStore
- } from "./index.js"
-
- import {
- requestEtcFnc,
- } from './requestEtc'
- import Api from '../api/etc-api'
- export async function etcWxSign() {
- const {
- orderId = '',
- openId = '',
- } = arguments[0] || {}
- const accessToken = getStore("etc-accessToken") || "token"
- let myWxOpenId = getStore("myWxOpenId")
- const params = {
- subOpenId: myWxOpenId,
- orderId,
- openId,
- accessToken: accessToken,
- loginSource: "69af303ba2eb4608a099163f0d2a5dbd"
- }
- const res = await requestEtcFnc(Api.userSignQuery, {
- data: params,
- })
-
- return res
-
-
-
- }
-
-
-
-
- export async function apiIssueApply() {
-
- const {
- orderId,
-
- cardId,
- obuId,
- } = arguments[0]
- const params = {
- orderId,
-
- agentId: "52010106004",
- loginSource: "69af303ba2eb4608a099163f0d2a5dbd",
- channelId: "5201010200601130001",
- channelType: 1,
- issueType: 1,
-
- cardId,
- obuId,
- }
- const res = await requestEtcFnc(Api.issueApply, {
- data: params,
- isNeedAuth: false,
- })
- return res
- }
-
-
- export async function apiIssueCallback() {
-
- const {
-
- transOrderId,
- cmd,
- cmdResult,
- stepNo,
- } = arguments[0]
-
- const params = {
- transOrderId,
- // openId,
- agentId: "52010106004",
- loginSource: "69af303ba2eb4608a099163f0d2a5dbd",
- channelId: "5201010200601130001",
- channelType: 1,
- cmd,
- cmdResult,
- stepNo,
- staffId: "54623263cb4d4a289dccbc983b22a4af",
-
- }
- const res = await requestEtcFnc(Api.issueCallback, {
- data: params,
- isNeedAuth: false,
- })
- return res
-
- }
-
- export async function repaetGetOpenId(jsCode) {
-
- const res = await requestEtcFnc(Api.getOpenId, {
- data: {
- jsCode: jsCode
- },
- isNeedAuth: false,
- })
- if (res.code == 0) {
- const data = res.data.data
- if (data) {
- const info = JSON.parse(data)
- console.log(info);
- const openId = info.openId;
- setStore("myWxOpenId", openId)
- }
- } else {
- wx.hideLoading()
- wx.showToast({
- title: res.message || "登录失败,请稍后重试",
- icon: false,
- });
- }
- return res.code;
- }
-
- export async function repeatLogin() {
- const openId = getStore('etc-openId')
- const accessToken = getStore("etc-accessToken") || "token"
- const params = {
- openId,
- accessToken,
- }
- const res = await requestEtcFnc(Api.phoneLogin, {
- data: params,
- isNeedAuth: false,
- })
-
- if (res.code == 0) {
- const {
- accessToken,
- openId,
- } = res.data
- setStore('etc-accessToken', accessToken)
- setStore('etc-openId', openId)
- }
- return res
- }
-
- export async function contractQuery() {
- const {
- orderId,
- } = arguments[0]
- const res = await requestEtcFnc(Api.contractQuery, {
- data: {
- orderId,
- },
- isNeedAuth: false,
- })
- return res
- }
- export async function accountSign() {
- const {
- orderId,
- } = arguments[0]
- const res = await requestEtcFnc(Api.accountSign, {
- data: {
- orderId,
- orderSource: "CHANNEL"
- },
- isNeedAuth: false,
- })
- return res
- }
|