1
This commit is contained in:
@ -7,9 +7,10 @@ import { LOGIN, GET_PHONE, USER_SHARE,USER_WALLET,RECHARGE_WALLET,USER_WXPAY,USE
|
||||
// 微信登陆
|
||||
export const getCodeByWxLogin = () => {
|
||||
return new Promise((resolve, reject) => {
|
||||
uni.login({
|
||||
provider: "weixin",
|
||||
tt.login({
|
||||
provider: "toutiao",
|
||||
success: function (loginRes) {
|
||||
// console.log(loginRes,'?1?')
|
||||
resolve(loginRes.code);
|
||||
},
|
||||
fail: function (err) {
|
||||
@ -22,7 +23,7 @@ export const getCodeByWxLogin = () => {
|
||||
import Store from "../store";
|
||||
|
||||
// 登录鉴权
|
||||
export const login = (phone) => {
|
||||
export const login = (nickName, avatarUrl) => {
|
||||
return getCodeByWxLogin().then((code) => {
|
||||
// 从 vuex 中获取 referrerID(如果通过二维码扫描进入)
|
||||
const referrerID = Store.state.user?.referrerID || 0;
|
||||
@ -31,12 +32,17 @@ export const login = (phone) => {
|
||||
url: LOGIN,
|
||||
method: "POST",
|
||||
data: {
|
||||
nickName:nickName,
|
||||
avatarUrl:avatarUrl,
|
||||
code: code,
|
||||
// yaoqing_code: inviteCode || null,
|
||||
phone: phone || null,
|
||||
source: "wechat",
|
||||
referrerID: Number(referrerID) || 0,
|
||||
referrerType: "wechat"
|
||||
source:'douyin',
|
||||
referrerID:0,
|
||||
referrerType:'douyin'
|
||||
// // yaoqing_code: inviteCode || null,
|
||||
// phone: phone || null,
|
||||
// source: "wechat",
|
||||
// referrerID: Number(referrerID) || 0,
|
||||
// referrerType: "wechat"
|
||||
},
|
||||
}).then((res) => {
|
||||
// 登录接口使用完 referrerID 后,清除一次,避免重复使用
|
||||
|
||||
@ -26,7 +26,7 @@ export const RECHARGE_WALLET = '/wallet/details'
|
||||
export const USER_WALLET = '/wallet/info'
|
||||
|
||||
//钱包充值接口
|
||||
export const USER_WXPAY = '/wxpay/jsapi'
|
||||
export const USER_WXPAY = '/ttpay/jsapi'
|
||||
//钱包充值金额
|
||||
export const USER_RECHARGE = '/recharge/bonus-list'
|
||||
//积分充值列表
|
||||
@ -186,7 +186,7 @@ export const HOME_ORDERS_CANCEL = "/home/orders/cancel";
|
||||
// 校验节假日费用
|
||||
export const CHECK_HOLIDAY_FEE = "/check_holiday_fee";
|
||||
//支付订单
|
||||
export const PAY_ORDER = "/wxpay/jsapi";
|
||||
export const PAY_ORDER = "/ttpay/jsapi";
|
||||
|
||||
//取消订单
|
||||
export const CANCEL_ORDER = "/app/chongwu_order/order_quxiao";
|
||||
@ -235,7 +235,7 @@ export const CREATE_ORDER_NEW = "/product/order/create";
|
||||
// 创建购物车订单
|
||||
export const CREATE_CART_ORDER = "/product/order/create";
|
||||
// 订单支付
|
||||
export const PAY_ORDER_NEW = "/wxpay/jsapi";
|
||||
export const PAY_ORDER_NEW = "/ttpay/jsapi";
|
||||
// 订单列表
|
||||
export const SHOP_ORDER_LIST = "/product/order/list";
|
||||
// 订单详情
|
||||
@ -304,3 +304,5 @@ export const HOMETRAINING_ORDERS_CANCEL = '/hometraining/orders/cancel'
|
||||
// 撤销申请(领养申请)
|
||||
export const ADOPTIONS_PET_APPLY_CANCEL = '/adoptions/pet/apply/cancel'
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user