Commit 9fdeb4da by 程默

fix

parent 731ac6f4
...@@ -82,6 +82,6 @@ module.exports = merge(baseWebpackConfig, { ...@@ -82,6 +82,6 @@ module.exports = merge(baseWebpackConfig, {
// inject: true // inject: true
// }), // }),
new FriendlyErrorsPlugin(), new FriendlyErrorsPlugin(),
// new UglifyJsPlugin({ sourceMap: true }) new UglifyJsPlugin({ sourceMap: true })
] ]
}) })
...@@ -17,7 +17,7 @@ module.exports = merge(prodEnv, {//zjgyl ...@@ -17,7 +17,7 @@ module.exports = merge(prodEnv, {//zjgyl
// BASE_URL:"'http://192.168.1.146:3005'", // BASE_URL:"'http://192.168.1.146:3005'",
// BASE_URL:"'http://192.168.1.127:3000'", // BASE_URL:"'http://192.168.1.127:3000'",
BASE_URL:"'https://test-m-shop.mayi888.cn'", BASE_URL:"'https://test-m-shop.mayi888.cn'",
// BASE_URL:"'http://172.16.1.32:3000'", // BASE_URL:"'http://172.16.1.61:3004'",
OLSHOP_URL:'"https://test-m-shop.mayi888.cn/innerApi/shopApiService"', OLSHOP_URL:'"https://test-m-shop.mayi888.cn/innerApi/shopApiService"',
// OLSHOP_URL:'"https://shop.mayi888.com/innerApi/shopApiService"', // OLSHOP_URL:'"https://shop.mayi888.com/innerApi/shopApiService"',
......
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
"description": "项目配置文件。", "description": "项目配置文件。",
"setting": { "setting": {
"urlCheck": false, "urlCheck": false,
"es6": true, "es6": false,
"enhance": true, "enhance": true,
"postcss": true, "postcss": true,
"minified": true, "minified": true,
...@@ -16,14 +16,22 @@ ...@@ -16,14 +16,22 @@
"checkInvalidKey": true, "checkInvalidKey": true,
"checkSiteMap": true, "checkSiteMap": true,
"uploadWithSourceMap": true, "uploadWithSourceMap": true,
"useMultiFrameRuntime": true,
"useApiHook": true,
"useApiHostProcess": true,
"babelSetting": { "babelSetting": {
"ignore": [], "ignore": [],
"disablePlugins": [], "disablePlugins": [],
"outputPath": "" "outputPath": ""
}, },
"bundle": true, "bundle": false,
"useIsolateContext": true,
"useCompilerModule": true, "useCompilerModule": true,
"userConfirmedUseCompilerModuleSwitch": false "userConfirmedUseCompilerModuleSwitch": false,
"userConfirmedBundleSwitch": false,
"packNpmManually": false,
"packNpmRelationList": [],
"minifyWXSS": true
}, },
"miniprogramRoot": "dist/wx/", "miniprogramRoot": "dist/wx/",
"compileType": "miniprogram", "compileType": "miniprogram",
...@@ -31,18 +39,15 @@ ...@@ -31,18 +39,15 @@
"projectname": "mayi-mp-shop", "projectname": "mayi-mp-shop",
"simulatorType": "wechat", "simulatorType": "wechat",
"simulatorPluginLibVersion": {}, "simulatorPluginLibVersion": {},
"libVersion": "2.14.3", "libVersion": "2.15.0",
"condition": { "condition": {
"search": { "search": {
"current": -1,
"list": [] "list": []
}, },
"conversation": { "conversation": {
"current": -1,
"list": [] "list": []
}, },
"plugin": { "plugin": {
"current": -1,
"list": [] "list": []
}, },
"game": { "game": {
...@@ -50,11 +55,9 @@ ...@@ -50,11 +55,9 @@
"list": [] "list": []
}, },
"gamePlugin": { "gamePlugin": {
"current": -1,
"list": [] "list": []
}, },
"miniprogram": { "miniprogram": {
"current": -1,
"list": [ "list": [
{ {
"id": 0, "id": 0,
......
<script> <script>
import shop from "@/api/shop"; import shop from "@/api/shop";
import {themeColor , checkShowConditionIds} from "@/utils/mayi" import { themeColor, checkShowConditionIds } from "@/utils/mayi";
export default { export default {
created() { created() {
// NODE_ENV // NODE_ENV
...@@ -11,7 +11,7 @@ export default { ...@@ -11,7 +11,7 @@ export default {
process.env.NODE_ENV == "development" || process.env.NODE_ENV == "development" ||
JSON.stringify(extConfig) == "{}" JSON.stringify(extConfig) == "{}"
) { ) {
extConfig = { mixid: "antgood", shopid:67}; extConfig = { mixid: "antgood", shopid: 67 };
} }
console.log("1444444444", extConfig.mixid); console.log("1444444444", extConfig.mixid);
this.$store.commit("setExtConfig", extConfig.mixid); this.$store.commit("setExtConfig", extConfig.mixid);
...@@ -41,39 +41,87 @@ export default { ...@@ -41,39 +41,87 @@ export default {
// 初始 // 初始
this.getShopInfo(extConfig); this.getShopInfo(extConfig);
console.log(this,'this.mpApp') console.log(this, "this.mpApp");
// 页面配置信息 // 页面配置信息
this.getThemePage(extConfig); this.getThemePage(extConfig);
}, },
methods: { methods: {
async setVisible(pageList){ async setVisible(pageList, cb) {
console.log("51111111");
// 首页显示条件 // 首页显示条件
this.pageInfo = pageList.filter((item) => item.pageCode == 1)[0]; let pageInfo = pageList.filter((item) => item.pageCode == 1)[0];
this.pageData = JSON.parse(this.pageInfo.pageData); let pageData = JSON.parse(pageInfo.pageData);
// 显示条件列表 // 查询显示条件id
let showConditionIds=checkShowConditionIds(this.pageData) let showConditionIds = checkShowConditionIds(pageData);
let ll=await this.checkCondition(showConditionIds) // 查询可显示的条件
console.log(showConditionIds,'--------------5454',ll) let { data: ids } = await this.checkCondition(showConditionIds);
// 设置visible
pageInfo.pageData = this.updateCondition(pageData, ids);
console.log(showConditionIds, "--------------5454", ids, pageInfo);
cb()
}, },
checkCondition({allCondition}) { checkCondition({ allCondition }) {
return new Promise((resolve,reject)=>{ return new Promise((resolve, reject) => {
// 获取 // 获取
let params = { allCondition, region: '' } let params = { showConditionIds:allCondition, region: "" };
shop.checkShowCondition(params).then(res => { shop
if (res.code == 200) { .checkShowCondition(params)
console.log(params, 'check显示条件', res.data) .then((res) => {
// commit('setShowConditionIds', res.data) console.log(params, "check显示条件", res.data);
// commit('updateCondition') if (res.data.code == 200) {
resolve(res.data) resolve(res.data);
} }
}).catch(err => {
console.log('check显示条件失败', err)
}) })
.catch((err) => {
console.log("check显示条件失败", err);
});
});
},
updateCondition(pageData, ids) {
pageData.forEach((item) => {
pollCondition(item);
});
function pollCondition(data) {
if (Object.prototype.toString.call(data) === "[object Object]") {
if (data.condition != "" && data.condition != undefined) {
data.visible = ids.some((item) => {
return item == data.condition;
})
? 1
: 0;
}
for (const key in data) {
if (data.hasOwnProperty(key)) {
const element = data[key];
if (
Object.prototype.toString.call(element) === "[object Object]"
) {
if (element.condition != "" && element.condition != undefined) {
console.log("979797", element.condition);
element.visible = ids.some((item) => {
return item == element.condition;
}) })
? 1
: 0;
}
pollCondition(element);
} else if (
Object.prototype.toString.call(element) === "[object Array]" &&
element.length > 0
) {
element.forEach((item) => {
pollCondition(item);
});
}
}
}
}
}
return JSON.stringify(pageData);
}, },
//商城配置 //商城配置
getShopInfo({mixid}) { getShopInfo({ mixid }) {
shop.getShopInfo({ shopMixId: mixid }).then((res) => { shop.getShopInfo({ shopMixId: mixid }).then((res) => {
if (res.data.code == 200) { if (res.data.code == 200) {
let mpApp = getApp(); let mpApp = getApp();
...@@ -82,7 +130,7 @@ export default { ...@@ -82,7 +130,7 @@ export default {
let defaultComponentModel = res.data.data.shopThemeData; let defaultComponentModel = res.data.data.shopThemeData;
this.mpApp.globalData.shopThemeData = res.data.data.shopThemeData; this.mpApp.globalData.shopThemeData = res.data.data.shopThemeData;
this.mpApp.globalData.shopInfo=res.data.data; this.mpApp.globalData.shopInfo = res.data.data;
// 获取底部栏数据 // 获取底部栏数据
let val = JSON.parse(defaultComponentModel); let val = JSON.parse(defaultComponentModel);
...@@ -100,16 +148,16 @@ export default { ...@@ -100,16 +148,16 @@ export default {
} }
// 设置主题色 // 设置主题色
themeColor['--main-color']=val.themeColor.mainColor themeColor["--main-color"] = val.themeColor.mainColor;
themeColor['--minor-color']=val.themeColor.minorColor themeColor["--minor-color"] = val.themeColor.minorColor;
mpApp.themeColorCallBack(themeColor); mpApp.themeColorCallBack(themeColor);
// //
console.log(this.mpApp,'mmmmm74',themeColor) console.log(this.mpApp, "mmmmm74", themeColor);
} }
}); });
}, },
getThemePage({mixid,shopid}) { async getThemePage({ mixid, shopid }) {
shop await shop
.themePagesInfo({ .themePagesInfo({
shopid, shopid,
shopMixId: mixid, shopMixId: mixid,
...@@ -119,14 +167,16 @@ export default { ...@@ -119,14 +167,16 @@ export default {
let data = response.data.data; let data = response.data.data;
if (Array.isArray(data) && data.length > 0) { if (Array.isArray(data) && data.length > 0) {
console.log("90", data); console.log("90", data);
// 设置显示条件
this.setVisible(data,()=>{
console.log(1711111111);
this.mpApp.globalData.pageList = data; this.mpApp.globalData.pageList = data;
this.setVisible(data)
// app中异步数据回调 底部栏数据 // app中异步数据回调 底部栏数据
if (this.mpApp.pageCallBack) { if (this.mpApp.pageCallBack) {
this.mpApp.pageCallBack(data); this.mpApp.pageCallBack(data);
} }
});
} }
} }
...@@ -134,13 +184,12 @@ export default { ...@@ -134,13 +184,12 @@ export default {
.catch((err) => {}); .catch((err) => {});
}, },
// --- // ---
}, },
onError(data) { onError(data) {
console.log(data, "js异常捕获"); console.log(data, "js异常捕获");
this.$mpAnalytics.recordError({ this.$mpAnalytics.recordError({
data, data,
'keyword': data, keyword: data,
extendsInfo: { extendsInfo: {
mixid: this.$store.state.mixid || null, mixid: this.$store.state.mixid || null,
}, },
...@@ -169,5 +218,4 @@ export default { ...@@ -169,5 +218,4 @@ export default {
/* @import url("../static/nicon/iconfont.css"); */ /* @import url("../static/nicon/iconfont.css"); */
@import url("../static/font/iconfont.css"); @import url("../static/font/iconfont.css");
@import url("../static/css/common.scss"); @import url("../static/css/common.scss");
</style> </style>
import { requestPOST, requestGET } from "@/utils/request.js"; import { requestPOST, requestPOST1 } from "@/utils/request.js";
export default { export default {
...@@ -12,9 +12,9 @@ export default { ...@@ -12,9 +12,9 @@ export default {
}, },
// 页面数据 // 页面数据
themePagesInfo(params) { themePagesInfo(params) {
return requestPOST(`${process.env.OLSHOP_URL}/cms/get_shop_install_pages`, { params }) return requestPOST(`${process.env.OLSHOP_URL}/cms/get_shop_install_pages`, params )
}, },
checkShowCondition(params) { checkShowCondition(params) {
return requestPOST(`${process.env.OLSHOP_URL}/cms/check_show_condition`, {params}) return requestPOST(`${process.env.OLSHOP_URL}/cms/check_show_condition`, params)
}, },
}; };
...@@ -90,10 +90,10 @@ ...@@ -90,10 +90,10 @@
this.define() this.define()
}, },
define(){ define(){
wx.navigateBack() // wx.navigateBack()
// wx.reLaunch({ wx.reLaunch({
// url:'/pages/home/main' url:'/pages/home/main'
// }) })
}, },
locationStart(type){ locationStart(type){
console.log(wx.getStorageSync('location'),'2222222222222222222222222222') console.log(wx.getStorageSync('location'),'2222222222222222222222222222')
......
...@@ -161,6 +161,12 @@ export default { ...@@ -161,6 +161,12 @@ export default {
// }; // };
}, },
onLoad(options) { onLoad(options) {
let location=JSON.parse(wx.getStorageSync('location') || '{}')
if (!location.areaGroupId) {
wx.redirectTo({
url: '/pages/changeAdr/main?areaGroupId=' + this.data.designateAreaObj.areaGroupId
})
}
let that = this; let that = this;
// 来源 // 来源
if (options.from == "logout") { if (options.from == "logout") {
......
...@@ -21,7 +21,7 @@ export default { ...@@ -21,7 +21,7 @@ export default {
baseUrl: process.env.BASE_URL, baseUrl: process.env.BASE_URL,
link: this.baseUrl, link: this.baseUrl,
page: "/", page: "/",
params: "?mixid=" + this.shopId, params: "?mixid=" + this.shopId+'&native=1',
userInfo: { userInfo: {
nickName: "mpvue", nickName: "mpvue",
...@@ -76,10 +76,10 @@ export default { ...@@ -76,10 +76,10 @@ export default {
} }
}, },
onLoad(options) { onLoad(options) {
this.withoutScene = true;
this.options = options; this.options = options;
Object.assign(this.$data, this.$options.data()); Object.assign(this.$data, this.$options.data());
this.withoutScene = true;
//获取openId //获取openId
wx.login({ wx.login({
success: res => { success: res => {
......
...@@ -3,7 +3,6 @@ ...@@ -3,7 +3,6 @@
--> -->
<template> <template>
<div> <div>
{{ pageUrl }}
<web-view :src="pageUrl" @error="handleError"></web-view> <web-view :src="pageUrl" @error="handleError"></web-view>
</div> </div>
</template> </template>
...@@ -19,7 +18,7 @@ export default { ...@@ -19,7 +18,7 @@ export default {
return { return {
link: process.env.BASE_URL, link: process.env.BASE_URL,
page: "/", page: "/",
params: "?mixid=" + this.$store.state.mixid + "&tabbar=1", params: "?mixid=" + this.$store.state.mixid + "&tabbar=1&native=1",
index: 1, index: 1,
ss: "", ss: "",
}; };
......
...@@ -3,7 +3,6 @@ ...@@ -3,7 +3,6 @@
--> -->
<template> <template>
<div> <div>
{{ pageUrl }}
<web-view :src="pageUrl" @error="handleError"></web-view> <web-view :src="pageUrl" @error="handleError"></web-view>
</div> </div>
</template> </template>
...@@ -19,7 +18,7 @@ export default { ...@@ -19,7 +18,7 @@ export default {
return { return {
link: process.env.BASE_URL, link: process.env.BASE_URL,
page: "/", page: "/",
params: "?mixid=" + this.$store.state.mixid + "&tabbar=1", params: "?mixid=" + this.$store.state.mixid + "&tabbar=1&native=1",
index: 2, index: 2,
ss: "", ss: "",
}; };
......
...@@ -3,7 +3,6 @@ ...@@ -3,7 +3,6 @@
--> -->
<template> <template>
<div> <div>
{{ pageUrl }}
<web-view :src="pageUrl" @error="handleError"></web-view> <web-view :src="pageUrl" @error="handleError"></web-view>
</div> </div>
</template> </template>
...@@ -19,7 +18,7 @@ export default { ...@@ -19,7 +18,7 @@ export default {
return { return {
link: process.env.BASE_URL, link: process.env.BASE_URL,
page: "/", page: "/",
params: "?mixid=" + this.$store.state.mixid + "&tabbar=1", params: "?mixid=" + this.$store.state.mixid + "&tabbar=1&native=1",
index: 3, index: 3,
ss: "", ss: "",
}; };
......
...@@ -3,7 +3,6 @@ ...@@ -3,7 +3,6 @@
--> -->
<template> <template>
<div> <div>
{{ pageUrl }}
<web-view :src="pageUrl" @error="handleError"></web-view> <web-view :src="pageUrl" @error="handleError"></web-view>
</div> </div>
</template> </template>
...@@ -19,7 +18,7 @@ export default { ...@@ -19,7 +18,7 @@ export default {
return { return {
link: process.env.BASE_URL, link: process.env.BASE_URL,
page: "/", page: "/",
params: "?mixid=" + this.$store.state.mixid + "&tabbar=1", params: "?mixid=" + this.$store.state.mixid + "&tabbar=1&native=1",
index: 4, index: 4,
ss: "", ss: "",
}; };
......
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