Commit c8b8cc6b by 李嘉林

新华优选兼容

parent 4536200b
......@@ -7,7 +7,7 @@ var packageInfo = require('../package.json')
var mkdirp = require('mkdirp')
exports.assetsPath = function (_path) {
var assetsSubDirectory = process.env.NODE_ENV === 'production'
var assetsSubDirectory = (process.env.NODE_ENV === 'production' || process.env.NODE_ENV == 'xhyx_prod')
? config.build.assetsSubDirectory
: config.dev.assetsSubDirectory
return path.posix.join(assetsSubDirectory, _path)
......@@ -19,7 +19,7 @@ exports.cssLoaders = function (options) {
var cssLoader = {
loader: 'css-loader',
options: {
minimize: process.env.NODE_ENV === 'production',
minimize: (process.env.NODE_ENV === 'production' || process.env.NODE_ENV == 'xhyx_prod'),
sourceMap: options.sourceMap
}
}
......
......@@ -38,7 +38,7 @@ let baseWebpackConfig = {
path: config.build.assetsRoot,
jsonpFunction: 'webpackJsonpMpvue',
filename: '[name].js',
publicPath: process.env.NODE_ENV === 'production'
publicPath: (process.env.NODE_ENV === 'production' || process.env.NODE_ENV == 'xhyx_prod')
? config.build.assetsPublicPath
: config.dev.assetsPublicPath
},
......
......@@ -32,7 +32,15 @@ var fileExt = fileExtConfig[process.env.PLATFORM]
console.log('node_dev',process.env.NODE_ENV)
module.exports = {
build: {
env: process.env.NODE_ENV=='production'?require('./prod.env'): require('./dev.env'),
env: (() => {
let configFile = {
development: require('./dev.env'),
production: require('./prod.env'),
xhyx_uat: require('./xhyx_uat.env'),
xhyx_prod: require('./xhyx_prod.env'),
}
return configFile[process.env.NODE_ENV];
})(),
index: path.resolve(__dirname, `../dist/${fileExt.platform}/index.html`),
assetsRoot: path.resolve(__dirname, `../dist/${fileExt.platform}`),
assetsSubDirectory: '',
......@@ -52,7 +60,16 @@ module.exports = {
fileExt: fileExt
},
dev: {
env: process.env.NODE_ENV=='production'?require('./prod.env'): require('./dev.env'),
// env: process.env.NODE_ENV=='production'?require('./prod.env'): require('./dev.env'),
env: (() => {
let configFile = {
development: require('./dev.env'),
production: require('./prod.env'),
xhyx_uat: require('./xhyx_uat.env'),
xhyx_prod: require('./xhyx_prod.env'),
}
return configFile[process.env.NODE_ENV];
})(),
port: 8080,
// 在小程序开发者工具中不需要自动打开浏览器
autoOpenBrowser: false,
......
/*
* @Author: your name
* @Date: 2020-10-21 09:46:59
* @LastEditTime: 2020-10-22 14:09:41
* @LastEditors: Please set LastEditors
* @Description: In User Settings Edit
* @FilePath: \mayi-mp-shop\config\dev.env.js
*/
var merge = require('webpack-merge')
var prodEnv = require('./prod.env')
module.exports = merge(prodEnv, {//zjgyl
SHOP_MIXID:"'antgood'",
NODE_ENV: '"xhyx_prod"',
// BASE_URL:"'https://shop.mayi888.com'",
// BASE_URL:"'http://192.168.1.146:3005'",
// BASE_URL:"'http://172.16.1.18:3000'",
BASE_URL:"'http://m.xinhuabest.com'",
ADMIN_URL:"'http://admin.xinhuabest.com'",
GUIDE_URL:"'http://guide.xinhuabest.com'",
// BASE_URL:"'http://192.168.137.1:3004'",
OLSHOP_URL:'"http://m.xinhuabest.com/innerApi/shopApiService"',
// OLSHOP_URL:'"https://shop.mayi888.com/innerApi/shopApiService"',
IMG_DOMAIN: '"http://new-xhyx.oss-cn-zhangjiakou.aliyuncs.com"',
POSTHOG_KEY: '"phc_nTr1oY7NkSuDMZsqCskE6iUIGKgWPmFHlRAKFVuZD2B"',
POSTHOG_HOST: '"https://posthog.mayi118.com"'
// IMG_DOMAIN: '"http://cdn.mayi888.com"',
})
/*
* @Author: your name
* @Date: 2020-10-21 09:46:59
* @LastEditTime: 2020-10-22 14:09:41
* @LastEditors: Please set LastEditors
* @Description: In User Settings Edit
* @FilePath: \mayi-mp-shop\config\dev.env.js
*/
var merge = require('webpack-merge')
var prodEnv = require('./prod.env')
module.exports = merge(prodEnv, {//zjgyl
SHOP_MIXID:"'antgood'",
NODE_ENV: '"xhyx_uat"',
// BASE_URL:"'https://shop.mayi888.com'",
// BASE_URL:"'http://192.168.1.146:3005'",
// BASE_URL:"'http://172.16.1.18:3000'",
BASE_URL:"'http://uat.m.xinhuabest.com'",
ADMIN_URL:"'http://uat.admin.xinhuabest.com'",
GUIDE_URL:"'http://uat.guide.xinhuabest.com'",
// BASE_URL:"'http://192.168.137.1:3004'",
OLSHOP_URL:'"http://uat.m.xinhuabest.com/innerApi/shopApiService"',
// OLSHOP_URL:'"https://shop.mayi888.com/innerApi/shopApiService"',
IMG_DOMAIN: '"http://new-xhyx-uat.oss-cn-zhangjiakou.aliyuncs.com"',
POSTHOG_KEY: '"phc_nTr1oY7NkSuDMZsqCskE6iUIGKgWPmFHlRAKFVuZD2B"',
POSTHOG_HOST: '"https://posthog.mayi118.com"'
// IMG_DOMAIN: '"http://cdn.mayi888.com"',
})
......@@ -10,7 +10,9 @@
"pro:wx": "cross-env NODE_ENV=production node build/dev-server.js wx",
"start:wx": "npm run dev:wx",
"build:wx": "cross-env NODE_ENV=production node build/build.js wx",
"build:xhyx_prod": "cross-env NODE_ENV=xhyx_prod node build/build.js wx",
"test:wx": "cross-env NODE_ENV=development node build/build.js wx",
"test:xhyx_uat": "cross-env NODE_ENV=xhyx_uat node build/build.js wx",
"dev:swan": "node build/dev-server.js swan",
"start:swan": "npm run dev:swan",
"build:swan": "node build/build.js swan",
......
......@@ -12,7 +12,13 @@ export default {
let extConfig = wx.getExtConfigSync ? wx.getExtConfigSync() : {};
console.log(extConfig, "-----------extConfig");
if (JSON.stringify(extConfig) == "{}") {
extConfig = process.env.NODE_ENV == "development" ? { mixid: "antgood", shopid: 67}:{ "mixid":"JSrLmM", "shopid": 1135 };
let shopItem = {
development: { mixid: "antgood", "shopid": 67},
production: { "mixid":"qiyeCT", "shopid": 1045 },
xhyx_uat: { "mixid":"xhyxshop", "shopid": 1 },
xhyx_prod: { "mixid":"antgood", "shopid": 67 },
}
extConfig = shopItem[process.env.NODE_ENV];
}
......
......@@ -13,12 +13,9 @@
"pages/tabBar3/main",
"pages/tabBar4/main",
"pages/changeAdr/main",
"pages/downFile/main",
"pages/wxArticle/main",
"pages/userInfo/main",
"pages/memberCode/main",
"pages/toMini/main",
"pages/paySuccess/main",
"pages/stateAccountList/main",
"pages/order/main"
],
......@@ -29,6 +26,14 @@
"pages": [
"article/main"
]
},
{
"root": "pages/pages_subpack1",
"name":"subPackages1",
"pages": [
"paySuccess/main",
"userInfo/main"
]
}
],
"usingComponents": {},
......
<template>
<div class="container">
<van-button @click="download">下载...</van-button>
</div>
</template>
<script>
import dzd from "../../api/wy";
export default {
data(){
return{
status : true
}
},
created(){
},
methods : {
download(){
let down = wx.downloadFile({
url : 'https://test-m-shop.mayi888.cn/innerApi/utilsService/genPdf?url=https://test-m-shop.mayi888.cn/customdev/wy/pgo6p?mixid=antgood',
success : (data) => {
console.log('下载成功',data)
console.log(data.tempFilePath)
if(data.statusCode == 200){
wx.openDocument({
filePath: data.tempFilePath,
showMenu:true,
fileType : 'pdf',
success: function (res) {
console.log('打开文档成功',res)
}
})
}
},
fail : (err) => {
console.log('下载失败',err)
}
})
down.onProgressUpdate((res) => {
console.log(res,'res')
if(res.progress == 100){
console.log('下载成功')
this.status = false
}
})
},
}
}
</script>
<style scoped lang="scss">
</style>
{
"navigationBarTitleText":"下载",
"usingComponents": {
"van-loading": "/static/vant/loading/index"
}
}
\ No newline at end of file
......@@ -103,18 +103,18 @@ import spokesman from "@/api/spokesman";
import { getMiniProgram, query_isEntry } from "@/utils/mayi_fenxiao";
import { serialize } from "@/utils/index";
import { checkTabbarPage, checkShowConditionIds, themeColor } from "@/utils/mayi";
import ThemeDataPlant from "../../components/ThemeDataPlant";
import paySuccessInfo from "../../components/paySuccess/paySuccessInfo";
import PayElectronCard from "../../components/paySuccess/PayElectronCard";
import automatiCard from "../../components/paySuccess/automatiCard";
import ThemeDataPlant from "@/components/ThemeDataPlant";
import paySuccessInfo from "@/components/paySuccess/paySuccessInfo";
import PayElectronCard from "@/components/paySuccess/PayElectronCard";
import automatiCard from "@/components/paySuccess/automatiCard";
import text from "@/components/content/text";
import richText from "../../components/basicTool/rich-text";
import richText from "@/components/basicTool/rich-text";
import interval from "@/components/basicTool/interval/index.vue";
import partition from "@/components/basicTool/partition/index.vue";
import coupon from '@/components/activity/coupon'
import integralTurntable from '@/components/activity/integralTurntable'
import spellGroup from '@/components/activity/spellGroup'
import tool from '../../utils/tool.js'
import tool from '@/utils/tool.js'
const app = getApp();
const { log } = app;
export default {
......
......@@ -127,7 +127,7 @@
import live from "@/api/live";
import index from "@/api/index";
import { DFSImg } from "@/utils/index";
import { themeColor } from "../../utils/mayi.js";
import { themeColor } from "@/utils/mayi.js";
import { formatTime } from "@/utils/index";
const app = getApp()
export default {
......
import Vue from 'vue'
import App from './index'
const app = new Vue(App)
app.$mount()
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