记得上下班打卡 | git大法好,push需谨慎

Commit 539e80a5 authored by dongchun's avatar dongchun

动态修改iframe地址

parent 07743253
...@@ -153,7 +153,7 @@ ...@@ -153,7 +153,7 @@
</div> </div>
<div class="function_area"> <div class="function_area">
<iframe src="http://172.16.3.82:8080/#/goods/home?place=admin" width="375" height="1190" frameborder="0"></iframe> <iframe id="iframe" src="http://172.16.3.82:8080/#/goods/home?place=admin" width="375" height="1190" frameborder="0"></iframe>
</div> </div>
</div> </div>
</div> </div>
...@@ -171,6 +171,14 @@ ...@@ -171,6 +171,14 @@
let updateTime = ''; let updateTime = '';
$(function() { $(function() {
// addItem (1); // addItem (1);
let url = window.location.hostname;
if (url.includes('test')) {
$("#iframe").attr('src', 'https://testm.zhengzai.tv/#/goods/home?place=admin');
} else if (!url.includes('test') && url.includes('admin')) {
$("#iframe").attr('src', 'https://m.zhengzai.tv/#/goods/home?place=admin');
} else {
}
promiseMethods('/goblin-front-cube/list', 'post').then(res => { promiseMethods('/goblin-front-cube/list', 'post').then(res => {
let { data } = res; let { data } = res;
if (data && data.length > 0) { if (data && data.length > 0) {
......
...@@ -168,7 +168,7 @@ ...@@ -168,7 +168,7 @@
</div> </div>
<div class="function_area"> <div class="function_area">
<iframe src="http://172.16.3.82:8080/#/goods/home?place=admin" width="375" height="1190" frameborder="0"></iframe> <iframe id="iframe" src="http://172.16.3.82:8080/#/goods/home?place=admin" width="375" height="1190" frameborder="0"></iframe>
</div> </div>
</div> </div>
</div> </div>
...@@ -184,6 +184,14 @@ ...@@ -184,6 +184,14 @@
let selectGoodsId = ''; let selectGoodsId = '';
let updateTime = ''; let updateTime = '';
$(function() { $(function() {
let url = window.location.hostname;
if (url.includes('test')) {
$("#iframe").attr('src', 'https://testm.zhengzai.tv/#/goods/home?place=admin');
} else if (!url.includes('test') && url.includes('admin')) {
$("#iframe").attr('src', 'https://m.zhengzai.tv/#/goods/home?place=admin');
} else {
}
promiseMethods('/selectGoods/getList', 'post').then(res => { promiseMethods('/selectGoods/getList', 'post').then(res => {
console.log(res, 121212) console.log(res, 121212)
let { data } = res; let { data } = res;
......
...@@ -138,7 +138,7 @@ ...@@ -138,7 +138,7 @@
<div class="huDongBanner" onclick="goArea(2)"> <div class="huDongBanner" onclick="goArea(2)">
<span class="huDongBannerSp" onclick="delSp(2)">X</span> <span class="huDongBannerSp" onclick="delSp(2)">X</span>
</div> </div>
<iframe src="http://172.16.3.82:8080/#/goods/home?place=admin" width="375" height="1190" frameborder="0"></iframe> <iframe id="iframe" src="http://172.16.3.82:8080/#/goods/home?place=admin" width="375" height="1190" frameborder="0"></iframe>
</div> </div>
</div> </div>
...@@ -147,7 +147,14 @@ ...@@ -147,7 +147,14 @@
<script th:inline="javascript"> <script th:inline="javascript">
var prefix2 = ctx + "local"; var prefix2 = ctx + "local";
$(function() { $(function() {
console.log(window.location, ctx,window.location.hostname, 'ctx') let url = window.location.hostname;
if (url.includes('test')) {
$("#iframe").attr('src', 'https://testm.zhengzai.tv/#/goods/home?place=admin');
} else if (!url.includes('test') && url.includes('admin')) {
$("#iframe").attr('src', 'https://m.zhengzai.tv/#/goods/home?place=admin');
} else {
}
modalPx() modalPx()
}) })
function goArea (num) { function goArea (num) {
......
...@@ -145,7 +145,7 @@ ...@@ -145,7 +145,7 @@
</div> </div>
<div class="function_area"> <div class="function_area">
<iframe src="http://172.16.3.82:8080/#/goods/home?place=admin" width="375" height="1190" frameborder="0"></iframe> <iframe id="iframe" src="http://172.16.3.82:8080/#/goods/home?place=admin" width="375" height="1190" frameborder="0"></iframe>
</div> </div>
</div> </div>
</div> </div>
...@@ -159,7 +159,14 @@ ...@@ -159,7 +159,14 @@
let jumpType = 1; let jumpType = 1;
let hang = 1; let hang = 1;
$(function() { $(function() {
let url = window.location.hostname;
if (url.includes('test')) {
$("#iframe").attr('src', 'https://testm.zhengzai.tv/#/goods/home?place=admin');
} else if (!url.includes('test') && url.includes('admin')) {
$("#iframe").attr('src', 'https://m.zhengzai.tv/#/goods/home?place=admin');
} else {
}
promiseMethods('/navigation/list', 'post').then(res => { promiseMethods('/navigation/list', 'post').then(res => {
let { data } = res; let { data } = res;
if (data&&data.length>0) { if (data&&data.length>0) {
......
...@@ -114,7 +114,7 @@ ...@@ -114,7 +114,7 @@
</div> </div>
<div class="function_area"> <div class="function_area">
<iframe src="http://172.16.3.82:8080/#/goods/home?place=admin" width="375" height="1190" frameborder="0"></iframe> <iframe id="iframe" src="http://172.16.3.82:8080/#/goods/home?place=admin" width="375" height="1190" frameborder="0"></iframe>
</div> </div>
</div> </div>
</div> </div>
...@@ -128,6 +128,14 @@ ...@@ -128,6 +128,14 @@
let hotWordId = ''; let hotWordId = '';
let updateTime = ''; let updateTime = '';
$(function(){ $(function(){
let url = window.location.hostname;
if (url.includes('test')) {
$("#iframe").attr('src', 'https://testm.zhengzai.tv/#/goods/home?place=admin');
} else if (!url.includes('test') && url.includes('admin')) {
$("#iframe").attr('src', 'https://m.zhengzai.tv/#/goods/home?place=admin');
} else {
}
promiseMethods('/hotWord/list', 'post').then(res => { promiseMethods('/hotWord/list', 'post').then(res => {
let data = res.data[0]; let data = res.data[0];
mid = data.mid; mid = data.mid;
......
...@@ -150,7 +150,7 @@ ...@@ -150,7 +150,7 @@
</div> </div>
<div class="function_area"> <div class="function_area">
<iframe src="http://172.16.3.82:8080/#/goods/home?place=admin" width="375" height="1190" frameborder="0"></iframe> <iframe id="iframe" src="http://172.16.3.82:8080/#/goods/home?place=admin" width="375" height="1190" frameborder="0"></iframe>
</div> </div>
</div> </div>
</div> </div>
...@@ -163,6 +163,14 @@ ...@@ -163,6 +163,14 @@
let num = 0; let num = 0;
let type = 0; let type = 0;
$(function(){ $(function(){
let url = window.location.hostname;
if (url.includes('test')) {
$("#iframe").attr('src', 'https://testm.zhengzai.tv/#/goods/home?place=admin');
} else if (!url.includes('test') && url.includes('admin')) {
$("#iframe").attr('src', 'https://m.zhengzai.tv/#/goods/home?place=admin');
} else {
}
let name = 'id'; let name = 'id';
var reg = new RegExp("(^|&)"+ name +"=([^&]*)(&|$)"); var reg = new RegExp("(^|&)"+ name +"=([^&]*)(&|$)");
var r = window.location.search.substr(1).match(reg); var r = window.location.search.substr(1).match(reg);
......
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