Commit d8546463 by 程默

Merge branch 'nativehome_tst' of http://code.mayi888.com/chengmo/mayi-mp-shop into nativehome_tst

parents 7d93cbf7 b559d7b3
import indexApi from "@/api/index";
export function getBcakUrlApi(data) {
return new Promise((resolve, reject) => {
data.fromAppid = 'VsEOuDJqBnGNyXZJWCQS'
indexApi.getSsoCallbackUrl(data).then(res => {
if (res.data.code == 200) {
resolve(res.data.data);
}
});
})
}
export function createdUserJWTApi(data) {
return new Promise((resolve, reject) => {
indexApi.createdUserJWT().then(res => {
if (res.data.code == 200) {
resolve(res.data.data);
}
});
})
}
......@@ -33,6 +33,22 @@ console.log(process.env,'-----------------config------')
},
get_multi_merchant_by_tags(data){
return requestPOST(`${process.env.OLSHOP_URL}/shop/get_multi_merchant_by_tags`,data)
},
getSsoCallbackUrl(data) {
return requestPOST(
`${process.env.OLSHOP_URL}/common/getSsoCallbackUrl`,
{ data }
);
},
// 动态表单获取token 信息
createdUserJWT(data) {
return requestPOST(
`${process.env.OLSHOP_URL}/user/createUserJWT`,
{
data
}
);
}
}
\ No newline at end of file
......@@ -6,6 +6,7 @@ import goodsApi from "./api/goods"
import orderApi from "./api/order"
import promoteApi from "./api/promote";
import indexApi from './api/index'
import { createdUserJWTApi, getBcakUrlApi } from "./api/daoke";
import cartApi from './api/cart'
import classificationApi from "./api/classification";
import spokesmanApi from './api/spokesman'
......@@ -18,6 +19,7 @@ import fenxiaoModel from "@/utils/fenxiaoModel";
// themeMemberCardClick
// } from "@/utils/mayi";
import { $themeToLink, $themeAddToCard, $themeArticleLike } from "@/utils/mayi";
import "@/utils/themeModule";
// import { themeToLinkInit } from "@/utils/themeModule";
import shop from "./api/shop";
import spokesman from "@/api/spokesman";
......@@ -38,12 +40,11 @@ Vue.prototype.$mpAnalytics = mpAnalytics;
const app = new Vue(App)
app.$mount()
// 初始化
// themeToLinkInit({ homeNative: 2, getCoupon, themeMemberCardClick });
// glob挂载到
let mpApp = getApp();
Vue.prototype.mpApp = mpApp
// 初始化
mpApp.fenxiaoModel = new fenxiaoModel({
query_login_spoken:spokesman.query_login_spoken,
becomepokesmanCustomer:spokesman.becomepokesmanCustomer,
......@@ -56,7 +57,17 @@ mpApp.fenxiaoModel = new fenxiaoModel({
oneClickShopQuickCopy: spokesman.oneClickShopQuickCopy,
apply_for_withdraw: spokesman.apply_for_withdraw
});
// 多主题方法初始化
global.themeToLinkInit({
homeNative: 2,
wx,
getCoupon,
themeMemberCardClick,
requireFun: {
createdUserJWT: createdUserJWTApi,
getBcakUrl: getBcakUrlApi
}
});
// 数据异步回调函数
// 商城
mpApp.shopCallBack = function () { }
......
......@@ -156,6 +156,7 @@ export function $themeAddToCard(item, callback) {
}
function toPage(backPath, backParams = "") {
console.log(backPath, backParams,'--------------------------159');
wx.navigateTo({
url: `../index/main?from=themeLink&backpath=${encodeURIComponent(backPath)}&params=${encodeURIComponent(backParams)}`
});
......@@ -299,9 +300,9 @@ export function themeMemberCardClick (item) {
});
} else {
if (res.data.msg == "不能重复领卡") {
let query = { cardId: cardData.id, userTel: userInfo.mobilephone };
let url = `../index/main?from=themeLink&backpath=${encodeURIComponent("/personalCenter/membershipCard")}&params=${encodeURIComponent(query)}`;
wx.navigateTo({url});
console.log("---------------------------to-----1")
let backParams = `&cardId=${cardData.id}&userTel=${userInfo.mobilephone}`;
toPage("/personalCenter/membershipCard",backParams);
} else {
wx.showToast({ title: res.data.msg, icon: "none" });
}
......@@ -313,16 +314,13 @@ export function themeMemberCardClick (item) {
} else if (cardData.receiveWay == 2) {
// 付费购买
if (cardData.receiveStatus == 0) {
let query= { cardId: cardData.id };
let url = `../index/main?from=themeLink&backpath=${encodeURIComponent("/pay/payCard")}&params=${encodeURIComponent(query)}`;
wx.navigateTo({ url });
console.log("---------------------------to-----2")
let backParams = `&cardId=${cardData.id}`;
toPage("/pay/payCard", backParams);
} else {
let query = {
cardId: cardData.id,
userTel: userInfo.mobilephone
};
let url = `../index/main?from=themeLink&backpath=${encodeURIComponent("/personalCenter/membershipCard")}&params=${encodeURIComponent(query)}`;
wx.navigateTo({ url });
console.log("---------------------------to-----3")
let backParams = `&cardId=${cardData.id}&userTel=${userInfo.mobilephone}`;
toPage("/personalCenter/membershipCard", backParams);
}
} else {
console.error("无效的领取方式");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment