Commit 681a6788 authored by 罗超's avatar 罗超

修改部分样式

Signed-off-by: 罗超's avatar罗超 <alex9012@vip.qq.com>
parent 5992ad52
<template>
<view @click="close" class="mask">
<view @click.stop="onClick" class="content">
<text class="text">点击蒙层关闭</text>
</view>
</view>
</template>
<script>
export default {
data() {
return {
}
},
methods: {
onClick(e) {
uni.showToast({
title: "点击蒙层关闭"
})
// #ifdef APP-NVUE
e.stopPropagation()
// #endif
},
close() {
uni.navigateBack()
}
}
}
</script>
<style>
page {
background: transparent;
}
.mask {
position: fixed;
left: 0;
top: 0;
right: 0;
bottom: 0;
/* #ifndef APP-NVUE */
display: flex;
/* #endif */
justify-content: center;
align-items: center;
background-color: rgba(0, 0, 0, 0.4);
}
.content {
width: 200px;
height: 200px;
background-color: #007AFF;
}
.text {
/* #ifndef APP-NVUE */
display: block;
/* #endif */
line-height: 200px;
text-align: center;
color: #FFFFFF;
}
</style>
<template> <template>
<view :style="st"></view> <view :style="{'background':block.background,'height':block.height+'px'}"></view>
</template> </template>
<script> <script>
...@@ -7,11 +7,11 @@ export default { ...@@ -7,11 +7,11 @@ export default {
props:['block'], props:['block'],
data() { data() {
return { return {
st:'' st:{}
} }
}, },
created() { created() {
this.st=`background:${this.block.background};height:${this.block.height}rpx` this.st={'background':this.block.background,'height':this.block.height+'rpx'}
}, },
} }
</script> </script>
......
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
<image <image
:src="getIconLink(c.icon)" :src="getIconLink(c.icon)"
mode="widthFix" mode="widthFix"
style="width: 88rpx; height: 88rpx;" style="width: 64rpx; height: 64rpx;"
/> />
<text :style="{'color':navs.color}">{{ c.name }}</text> <text :style="{'color':navs.color}">{{ c.name }}</text>
</u-grid-item> </u-grid-item>
......
<template> <template>
<view <view
class="ad-box" class="ad-box"
:style="{ height: ad.height == 'auto' ? 'auto' : ad.height + 'rpx' }" :style="{ height: ad.height == 'auto' ? 'auto' : ad.height + 'rpx',margin:marginStyle }"
> >
<view <view
class="ad-chi" class="ad-chi"
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
:style="[item.formatStyle]" :style="[item.formatStyle]"
@click="clickHandler(item.link[0].new_link_url)" @click="clickHandler(item.link[0].new_link_url)"
> >
<img :src="item.pic_url" mode="widthFix"/> <img :src="item.pic_url" style="margin-bottom:-4px" mode="widthFix"/>
</view> </view>
</view> </view>
</template> </template>
...@@ -20,7 +20,8 @@ export default { ...@@ -20,7 +20,8 @@ export default {
props: ["ad"], props: ["ad"],
data() { data() {
return { return {
adtemp:[] adtemp:[],
marginStyle:""
} }
}, },
created() { created() {
...@@ -38,6 +39,7 @@ export default { ...@@ -38,6 +39,7 @@ export default {
if (this.ad.height == "auto") { if (this.ad.height == "auto") {
x.formatStyle.position = "unset"; x.formatStyle.position = "unset";
} }
this.marginStyle=`${this.ad.top??0}px ${this.ad.right??0}px ${this.ad.bottom??0}px ${this.ad.left??0}px `
this.adtemp.push(x) this.adtemp.push(x)
}); });
}, },
......
...@@ -20,6 +20,7 @@ ...@@ -20,6 +20,7 @@
:text-color="styleStr.textColor" :text-color="styleStr.textColor"
:radius="styleStr.radius" :radius="styleStr.radius"
:show-action="false" :show-action="false"
:margin="marginStyle"
></u-search> ></u-search>
</view> </view>
</template> </template>
...@@ -33,6 +34,7 @@ export default { ...@@ -33,6 +34,7 @@ export default {
formatStyle: "", formatStyle: "",
postionStyle: "", postionStyle: "",
bg: "", bg: "",
marginStyle:""
}; };
}, },
created() { created() {
...@@ -44,6 +46,7 @@ export default { ...@@ -44,6 +46,7 @@ export default {
} else { } else {
this.bg = this.styleStr.background; this.bg = this.styleStr.background;
} }
this.marginStyle=`${this.styleStr.top??0}px ${this.styleStr.right??0}px ${this.styleStr.bottom??0}px ${this.styleStr.left??0}px `
console.log(this.styleStr.bg); console.log(this.styleStr.bg);
// if (this.styleStr.p) { // if (this.styleStr.p) {
// let p = this.styleStr.p; // let p = this.styleStr.p;
...@@ -64,5 +67,7 @@ export default { ...@@ -64,5 +67,7 @@ export default {
<style> <style>
.search-box { .search-box {
padding: 5px; padding: 5px;
position: relative;
z-index: 2;
} }
</style> </style>
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
</swiper-item> </swiper-item>
</block> </block>
</swiper> --> </swiper> -->
<view :style="{marginTop:swipers.topAndBottom+'px',marginBottom:swipers.topAndBottom+'px',marginLeft:swipers.leftAndRight+'px',marginRight:swipers.leftAndRight+'px'}"> <view :style="{marginTop:swipers.topAndBottom+'px',marginBottom:(swipers.topAndBottom<0?0:swipers.topAndBottom)+'px',marginLeft:swipers.leftAndRight+'px',marginRight:swipers.leftAndRight+'px'}">
<u-swiper <u-swiper
:list="banners" :list="banners"
:effect3d="swipers.style == 2" :effect3d="swipers.style == 2"
......
...@@ -4,7 +4,6 @@ import api from './plugin/api' ...@@ -4,7 +4,6 @@ import api from './plugin/api'
import uiconfig from './plugin/uiconfig' import uiconfig from './plugin/uiconfig'
import uView from "uview-ui"; import uView from "uview-ui";
import utils from './plugin/utils' import utils from './plugin/utils'
Vue.use(api) Vue.use(api)
Vue.use(uView) Vue.use(uView)
Vue.config.productionTip = false Vue.config.productionTip = false
......
<template> <template>
<view class="u-search"> <view class="u-search" :style="{'margin':margin}">
<view <view
class="u-content" class="u-content"
:style="{ :style="{
...@@ -76,6 +76,10 @@ export default { ...@@ -76,6 +76,10 @@ export default {
type: String, type: String,
default: '#000' default: '#000'
}, },
margin:{
type: String,
default: '0'
},
// 搜索框背景色,默认值#f2f2f2 // 搜索框背景色,默认值#f2f2f2
bgColor: { bgColor: {
type: String, type: String,
......
export default { export default {
install(Vue, options) { install(Vue, options) {
Vue.prototype.host = "https://wx.weibaoge.cn/web/index.php?_mall_id=1285" Vue.prototype.host = "https://wx.weibaoge.cn/web/index.php?_mall_id=1285"
// Vue.prototype.host2 = "http://192.168.0.110:8200" // Vue.prototype.host2 = "http://192.168.0.110:8200"
// Vue.prototype.host2 = "https://mallApi.oytour.com" Vue.prototype.host2 = "https://mallApi.oytour.com"
// Vue.prototype.host2 = "http://192.168.2.16:8088" // Vue.prototype.host2 = "http://192.168.2.16:8088"
Vue.prototype.host2 = "http://192.168.2.65" //Vue.prototype.host2 = "http://192.168.2.65"
Vue.prototype.request = function(param, success, failed) { Vue.prototype.request = function(param, success, failed) {
//网络请求
uni.request({
url: this.host + "&r=" + param.data.r,
method: param.method || "GET",
header: param.header || {
'content-type': "application/json"
},
data: param.data,
success: res => {
if (res.data.code != 0 && res.data.msg != "商品未上架") {
}
typeof success == "function" && success(res.data);
},
fail: (e) => {
console.log("网络请求fail:" + JSON.stringify(e));
uni.showModal({
content: "" + res.errMsg
});
typeof failed == "function" && failed(res.data);
}
});
}
Vue.prototype.request2 = function(param, success, failed) {
//网络请求 //网络请求
uni.request({ uni.request({
url: this.host2 + param.url, url: this.host + "&r=" + param.data.r,
method: param.method || "Post", method: param.method || "GET",
header: param.header || { header: param.header || {
'content-type': "application/json" 'content-type': "application/json"
}, },
data: { data: param.data,
MallBaseId: 1, success: res => {
TenantId: 1, if (res.data.code != 0 && res.data.msg != "商品未上架") {
OpenId: this.GetOpenId().OpenId,
UserId: this.GetOpenId().UserId,
MiniAppId: this.GetMiniAppId(),
msg: param.data,
token: this.GetOpenId().token
},
success: res => {
if(res.data.resultCode == 10000){
let u = uni.getStorageSync("mall_UserInfo");
if(u){
this.getLogin_t(u)
typeof failed == "function" && failed(res.data);
}
}else if(res.data.resultCode != 1) {
if(res.data.couponResultCode==0){
}else{
uni.showToast({
title: res.data.message,
icon: "none",
});
}
typeof failed == "function" && failed(res.data);
}
else{
typeof success == "function" && success(res.data);
} }
typeof success == "function" && success(res.data);
}, },
fail: (e) => { fail: (e) => {
console.log("网络请求fail:" + JSON.stringify(e)); console.log("网络请求fail:" + JSON.stringify(e));
...@@ -82,34 +28,86 @@ export default { ...@@ -82,34 +28,86 @@ export default {
typeof failed == "function" && failed(res.data); typeof failed == "function" && failed(res.data);
} }
}); });
} }
// token失效再次登录接口 Vue.prototype.request2 = function(param, success, failed) {
Vue.prototype.getLogin_t = function(obj) { //网络请求
let pid = uni.getStorageSync("pid")?uni.getStorageSync("pid").pid:0; uni.request({
this.request2( url: this.host2 + param.url,
{ method: param.method || "Post",
url: '/api/AppletLogin/Login', header: param.header || {
data: { 'content-type': "application/json"
Source: 1, },
OpenId: obj.OpenId, data: {
Name: obj.Name, MallBaseId: 1,
Photo: obj.Photo, TenantId: 1,
Moblie: '', OpenId: this.GetOpenId().OpenId,
SuperiorId: pid UserId: this.GetOpenId().UserId,
} MiniAppId: this.GetMiniAppId(),
}, msg: param.data,
res => { token: this.GetOpenId().token
if (res.resultCode == 1) { },
uni.setStorageSync('mall_UserInfo', res.data); success: res => {
uni.removeStorageSync('pid');
} if (res.data.resultCode == 10000) {
}
); let u = uni.getStorageSync("mall_UserInfo");
} if (u) {
// 获取小程序APPID this.getLogin_t(u)
typeof failed == "function" && failed(res.data);
}
} else if (res.data.resultCode != 1) {
if (res.data.couponResultCode == 0) {
} else {
uni.showToast({
title: res.data.message,
icon: "none",
});
}
typeof failed == "function" && failed(res.data);
} else {
typeof success == "function" && success(res.data);
}
},
fail: (e) => {
console.log("网络请求fail:" + JSON.stringify(e));
uni.showModal({
content: "" + res.errMsg
});
typeof failed == "function" && failed(res.data);
}
});
}
// token失效再次登录接口
Vue.prototype.getLogin_t = function(obj) {
let pid = uni.getStorageSync("pid") ? uni.getStorageSync("pid").pid : 0;
this.request2({
url: '/api/AppletLogin/Login',
data: {
Source: 1,
OpenId: obj.OpenId,
Name: obj.Name,
Photo: obj.Photo,
Moblie: '',
SuperiorId: pid
}
},
res => {
if (res.resultCode == 1) {
uni.setStorageSync('mall_UserInfo', res.data);
uni.removeStorageSync('pid');
}
}
);
}
// 获取小程序APPID
Vue.prototype.GetMiniAppId = function() { Vue.prototype.GetMiniAppId = function() {
return 'wxacd9f8cc3480d29e' return 'wxacd9f8cc3480d29e'
// return 'wxcf0727a7c78b501e' //旅小友 // return 'wxcf0727a7c78b501e' //旅小友
} }
//获取OpenId //获取OpenId
Vue.prototype.GetOpenId = function() { Vue.prototype.GetOpenId = function() {
......
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