feat: 商城app 和中台通讯
This commit is contained in:
@@ -4,7 +4,7 @@
|
||||
{
|
||||
"customPlaygroundType" : "local",
|
||||
"packageName" : "com.trustbridge.mm",
|
||||
"playground" : "custom",
|
||||
"playground" : "standard",
|
||||
"type" : "uni-app:app-android"
|
||||
},
|
||||
{
|
||||
|
||||
+116
-55
@@ -8,7 +8,8 @@
|
||||
"^u-([^-].*)": "@/uni_modules/uview-plus/components/u-$1/u-$1.vue"
|
||||
}
|
||||
},
|
||||
"pages": [ //pages数组中第一项表示应用启动页,参考:https://uniapp.dcloud.io/collocation/pages
|
||||
"pages": [
|
||||
//pages数组中第一项表示应用启动页,参考:https://uniapp.dcloud.io/collocation/pages
|
||||
{
|
||||
"path": "pages/home/home",
|
||||
"style": {
|
||||
@@ -67,14 +68,23 @@
|
||||
}
|
||||
}
|
||||
],
|
||||
"subPackages": [{
|
||||
"subPackages": [
|
||||
{
|
||||
"root": "pages/mine_package",
|
||||
"pages": [{
|
||||
"pages": [
|
||||
{
|
||||
"path": "mild-shopping/mild-shopping",
|
||||
"style": {
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "mine_bank_card/mine_bank_card",
|
||||
"style": {
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
}, {
|
||||
},
|
||||
{
|
||||
"path": "mine_bank_add/mine_bank_add",
|
||||
"style": {
|
||||
"navigationBarTitleText": "%bankCard.add.title%",
|
||||
@@ -83,42 +93,50 @@
|
||||
"enablePullDownRefresh": false,
|
||||
"navigationStyle": "default" // 默认样式,会显示返回图标
|
||||
}
|
||||
}, {
|
||||
},
|
||||
{
|
||||
"path": "mine_address/mine_address",
|
||||
"style": {
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
}, {
|
||||
},
|
||||
{
|
||||
"path": "mine_address_add/mine_address_add",
|
||||
"style": {
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
}, {
|
||||
},
|
||||
{
|
||||
"path": "mine_authentication/mine_authentication",
|
||||
"style": {
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
}, {
|
||||
},
|
||||
{
|
||||
"path": "mine_authentication_ok/mine_authentication_ok",
|
||||
"style": {
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
}, {
|
||||
},
|
||||
{
|
||||
"path": "mine_purse/mine_purse",
|
||||
"style": {
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
}, {
|
||||
},
|
||||
{
|
||||
"path": "mine_order/mine_order",
|
||||
"style": {
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
}, {
|
||||
},
|
||||
{
|
||||
"path": "mine_order_info/mine_order_info",
|
||||
"style": {
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
}, {
|
||||
},
|
||||
{
|
||||
"path": "mine_purse_bonus/mine_purse_bonus",
|
||||
"style": {
|
||||
"navigationBarTitleText": "%purse.bonus.title%",
|
||||
@@ -127,7 +145,8 @@
|
||||
"enablePullDownRefresh": false,
|
||||
"navigationStyle": "default" // 默认样式,会显示返回图标
|
||||
}
|
||||
}, {
|
||||
},
|
||||
{
|
||||
"path": "mine_winning_record/mine_winning_record",
|
||||
"style": {
|
||||
"navigationBarTitleText": "%mine.winning.record.title%",
|
||||
@@ -136,27 +155,32 @@
|
||||
"enablePullDownRefresh": false,
|
||||
"navigationStyle": "default" // 默认样式,会显示返回图标
|
||||
}
|
||||
}, {
|
||||
},
|
||||
{
|
||||
"path": "mine_transaction_password/mine_transaction_password",
|
||||
"style": {
|
||||
"navigationBarTitleText": ""
|
||||
}
|
||||
}, {
|
||||
},
|
||||
{
|
||||
"path": "mine_purse_recharge/mine_purse_recharge",
|
||||
"style": {
|
||||
"navigationBarTitleText": ""
|
||||
}
|
||||
}, {
|
||||
},
|
||||
{
|
||||
"path": "mine_purse_exchange/mine_purse_exchange",
|
||||
"style": {
|
||||
"navigationBarTitleText": ""
|
||||
}
|
||||
}, {
|
||||
},
|
||||
{
|
||||
"path": "mine_product_agreement/mine_product_agreement",
|
||||
"style": {
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
}, {
|
||||
},
|
||||
{
|
||||
"path": "mine_about_us/mine_about_us",
|
||||
"style": {
|
||||
"navigationBarTitleText": "%mine.about.us.title%",
|
||||
@@ -165,42 +189,50 @@
|
||||
"enablePullDownRefresh": false,
|
||||
"navigationStyle": "default" // 默认样式,会显示返回图标
|
||||
}
|
||||
}, {
|
||||
},
|
||||
{
|
||||
"path": "mine_privacy_agreement/mine_privacy_agreement",
|
||||
"style": {
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
}, {
|
||||
},
|
||||
{
|
||||
"path": "mine_user_agreement/mine_user_agreement",
|
||||
"style": {
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
}, {
|
||||
},
|
||||
{
|
||||
"path": "mine_collection_alipay/mine_collection_alipay",
|
||||
"style": {
|
||||
"navigationBarTitleText": ""
|
||||
}
|
||||
}, {
|
||||
},
|
||||
{
|
||||
"path": "mine_purse_log/mine_purse_log",
|
||||
"style": {
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
}, {
|
||||
},
|
||||
{
|
||||
"path": "mine_my_team_list/mine_my_team_list",
|
||||
"style": {
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
}, {
|
||||
},
|
||||
{
|
||||
"path": "mine_purse_bonus_withdraw/mine_purse_bonus_withdraw",
|
||||
"style": {
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
}, {
|
||||
},
|
||||
{
|
||||
"path": "mine_purse_bonus_withdraw_log/mine_purse_bonus_withdraw_log",
|
||||
"style": {
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
}, {
|
||||
},
|
||||
{
|
||||
"path": "mine_settings/mine_settings",
|
||||
"style": {
|
||||
"navigationStyle": "custom"
|
||||
@@ -211,7 +243,8 @@
|
||||
"style": {
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
}, {
|
||||
},
|
||||
{
|
||||
"path": "mine_coupon/mine_coupon",
|
||||
"style": {
|
||||
"navigationBarTitleText": "%mine.coupon.title%",
|
||||
@@ -222,27 +255,34 @@
|
||||
}
|
||||
}
|
||||
]
|
||||
}, {
|
||||
},
|
||||
{
|
||||
"root": "pages/order_package",
|
||||
"pages": [{
|
||||
"pages": [
|
||||
{
|
||||
"path": "order_submit/order_submit",
|
||||
"style": {
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
}, {
|
||||
},
|
||||
{
|
||||
"path": "order_submit_ok/order_submit_ok",
|
||||
"style": {
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
}, {
|
||||
},
|
||||
{
|
||||
"path": "order_submit_error/order_submit_error",
|
||||
"style": {
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
}]
|
||||
}, {
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"root": "pages/rwa_package",
|
||||
"pages": [{
|
||||
"pages": [
|
||||
{
|
||||
"path": "rwa/rwa",
|
||||
"style": {
|
||||
"navigationStyle": "custom"
|
||||
@@ -405,7 +445,8 @@
|
||||
"style": {
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
}, {
|
||||
},
|
||||
{
|
||||
"path": "rwa_binding/rwa_binding",
|
||||
"style": {
|
||||
"navigationStyle": "custom"
|
||||
@@ -424,68 +465,83 @@
|
||||
}
|
||||
}
|
||||
]
|
||||
}, {
|
||||
},
|
||||
{
|
||||
"root": "pages/login_package",
|
||||
"pages": [{
|
||||
"pages": [
|
||||
{
|
||||
"path": "accelerate/accelerate",
|
||||
"style": {
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
}, {
|
||||
},
|
||||
{
|
||||
"path": "news_info/news_info",
|
||||
"style": {
|
||||
"navigationBarTitleText": ""
|
||||
}
|
||||
}, {
|
||||
},
|
||||
{
|
||||
"path": "preference/preference",
|
||||
"style": {
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
}, {
|
||||
},
|
||||
{
|
||||
"path": "welcome/welcome",
|
||||
"style": {
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
}, {
|
||||
},
|
||||
{
|
||||
"path": "login/login",
|
||||
"style": {
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
},{
|
||||
},
|
||||
{
|
||||
"path": "bind-phone/bind-phone",
|
||||
"style": {
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
}, {
|
||||
},
|
||||
{
|
||||
"path": "register/register",
|
||||
"style": {
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
}, {
|
||||
},
|
||||
{
|
||||
"path": "news/news",
|
||||
"style": {
|
||||
"navigationBarTitleText": ""
|
||||
}
|
||||
}]
|
||||
}, {
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"root": "pages/other_package",
|
||||
"pages": [{
|
||||
"pages": [
|
||||
{
|
||||
"path": "payment_processing/payment_processing",
|
||||
"style": {
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
}, {
|
||||
},
|
||||
{
|
||||
"path": "pointsRedemption/pointsRedemption",
|
||||
"style": {
|
||||
"navigationBarTitleText": ""
|
||||
}
|
||||
}, {
|
||||
},
|
||||
{
|
||||
"path": "productInfo/productInfo",
|
||||
"style": {
|
||||
"navigationBarTitleText": "",
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
}, {
|
||||
},
|
||||
{
|
||||
"path": "search/search",
|
||||
"style": {
|
||||
"navigationStyle": "custom"
|
||||
@@ -496,7 +552,8 @@
|
||||
"style": {
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
}, {
|
||||
},
|
||||
{
|
||||
"path": "nine-grid/nine-grid",
|
||||
"style": {
|
||||
"navigationStyle": "custom"
|
||||
@@ -539,14 +596,16 @@
|
||||
}
|
||||
}
|
||||
]
|
||||
}],
|
||||
}
|
||||
],
|
||||
"tabBar": {
|
||||
"color": "#666",
|
||||
"selectedColor": "#7934F6",
|
||||
"borderStyle": "black",
|
||||
// "backgroundColor": "#F8F8F8",
|
||||
// "custom": true,
|
||||
"list": [{
|
||||
"list": [
|
||||
{
|
||||
"pagePath": "pages/home/home",
|
||||
"text": "%index.home%",
|
||||
"iconPath": "/static/column/home.png",
|
||||
@@ -569,7 +628,8 @@
|
||||
"text": "%index.shopping.cart%",
|
||||
"iconPath": "/static/column/shopping.png",
|
||||
"selectedIconPath": "/static/column/shopping_sel.png"
|
||||
}, {
|
||||
},
|
||||
{
|
||||
"pagePath": "pages/mine/mine",
|
||||
"text": "%index.mine%",
|
||||
"iconPath": "/static/column/mine.png",
|
||||
@@ -585,7 +645,8 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"condition" : { //模式配置,仅开发期间生效
|
||||
"condition": {
|
||||
//模式配置,仅开发期间生效
|
||||
"current": 0, //当前激活的模式(list 的索引项)
|
||||
"list": [
|
||||
{
|
||||
|
||||
+4
-1
@@ -526,7 +526,10 @@ export default {
|
||||
},
|
||||
jumpToTrustBridge() {
|
||||
// 跳转到指定的信任桥地址
|
||||
plus.runtime.openURL("http://agent.outer.tbmall.xin:6880/");
|
||||
console.log("跳转到指定的信任桥地址")
|
||||
uni.navigateTo({
|
||||
url:'/pages/mine_package/mild-shopping/mild-shopping'
|
||||
})
|
||||
},
|
||||
/**
|
||||
* 跳转到工具
|
||||
|
||||
@@ -0,0 +1,117 @@
|
||||
<template>
|
||||
<view class="mild-shopping">
|
||||
<web-view
|
||||
ref="webview"
|
||||
:webview-styles="webviewStyles"
|
||||
:src="webviewUrl"
|
||||
@message="handlePostMessage"
|
||||
@onPostMessage="handlePostMessage"
|
||||
></web-view></view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { TOKEN_NAME, USER_DATA, getStorageFun } from "@/utils/auth.js";
|
||||
// 全局变量
|
||||
let wv; // 计划创建的webview
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
webviewStyles: {
|
||||
progress: {
|
||||
color: "#333333",
|
||||
},
|
||||
},
|
||||
wvNode: null,
|
||||
webviewUrl:'http://agent.outer.tbmall.xin:6880/'
|
||||
// webviewUrl: "http://192.168.0.101:8000/",
|
||||
};
|
||||
},
|
||||
|
||||
onShow() {
|
||||
// #ifdef APP-PLUS
|
||||
this.initWebview();
|
||||
// #endif
|
||||
},
|
||||
|
||||
methods: {
|
||||
/**
|
||||
* 初始化webview
|
||||
*/
|
||||
initWebview() {
|
||||
const currentWebview = this.$scope.$getAppWebview();
|
||||
setTimeout(() => {
|
||||
wv = currentWebview.children()[0];
|
||||
console.log(
|
||||
"TOKEN_NAME-1",
|
||||
getStorageFun(TOKEN_NAME),
|
||||
getStorageFun(USER_DATA)
|
||||
);
|
||||
if (wv) {
|
||||
// this.evalJSWithLog("onBridgeShowApp", {
|
||||
// token: 'WnJyYmV5SmhiR2NpT2lKSVV6STFOaUo5LmV5SjFjMlZ5U1dRaU9qRTNNallzSW0xamFFbGtJam94TURBeUxDSnBjM01pT2lKb2MyMHRabkp2Ym5SbGJtUWlMQ0owSWpveE56WXlNVGczTURreE1qYzRmUS5Caml4VU8yS1ZoUHBmeHdjRDRPWE4tSmw5T1lBZnBlc3hCRUN6UUFzQUpzRkp2em4',
|
||||
// userId: '1726',
|
||||
// name: '陈俊兴',
|
||||
// });
|
||||
this.evalJSWithLog("onBridgeShowApp", {
|
||||
token: getStorageFun(TOKEN_NAME),
|
||||
userId: getStorageFun(USER_DATA).userId,
|
||||
name: getStorageFun(USER_DATA).name,
|
||||
});
|
||||
}
|
||||
}, 300);
|
||||
// 支付成功,小程序跳回app
|
||||
},
|
||||
|
||||
/**
|
||||
* 处理来自webview的消息
|
||||
*/
|
||||
handlePostMessage(val) {
|
||||
console.log("收到消息", val, val.detail.data);
|
||||
const detail = val.detail.data[0];
|
||||
const type = detail?.type;
|
||||
console.log("收到消息-1", type);
|
||||
|
||||
// 使用策略模式处理不同类型消息
|
||||
const handlers = {
|
||||
/** 一键登录 **/
|
||||
back: () => this.back(detail),
|
||||
|
||||
/** 默认 */
|
||||
default: () => {
|
||||
if (detail.userInfo) {
|
||||
this.handleChatMessage(detail, type);
|
||||
} else {
|
||||
console.log("未知类型:", type);
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
(handlers[type] || handlers["default"])();
|
||||
},
|
||||
|
||||
evalJSWithLog(callBackName, data) {
|
||||
if (!wv) return;
|
||||
|
||||
const params = JSON.stringify(data);
|
||||
console.log(`调用 evalJS: ${callBackName}(${params})`);
|
||||
wv.evalJS(`${callBackName}(${params})`);
|
||||
},
|
||||
|
||||
/**
|
||||
* 开始录音
|
||||
*/
|
||||
back() {
|
||||
uni.switchTab({
|
||||
url: "/pages/mine/mine",
|
||||
});
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.mild-shopping{
|
||||
padding-top: var(--status-bar-height);
|
||||
}
|
||||
</style>
|
||||
+2
-2
@@ -2,9 +2,9 @@
|
||||
// export const BASE_URL="https://frontend.jdns360.com/api"; // 正式环境
|
||||
// export const BASE_URL="http://cl55un59859.vicp.fun:24346"; // 测试环境
|
||||
|
||||
export const BASE_URL = "https://api.tbmall.xin"; //生产
|
||||
// export const BASE_URL = "https://api.tbmall.xin"; //生产
|
||||
// export const BASE_URL ='http://api.hm.a-d.work:6880' // 测试
|
||||
// export const BASE_URL ='http://api.outer.tbmall.xin:6880' // 本地测试
|
||||
export const BASE_URL ='http://api.outer.tbmall.xin:6880' // 本地测试
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user