Commit 7b41b5ad authored by 罗超's avatar 罗超

修复BUG

parent 7beacd5b
......@@ -13,30 +13,33 @@ export default {
},
onShow: function () {
//console.log('App Show')
this.formatNavigation();
},
onHide: function () {
//console.log('App Hide')
},
methods: {
init() {
if (uni.getStorageSync("basedata")) {
this.basedata = uni.getStorageSync("basedata");
this.formatTabbar();
} else {
this.request2(
{
url: '/api/Mall/GetHome',
data: {
},
},
(res) => {
uni.setStorageSync("basedata", res.data);
this.basedata = res.data;
this.formatTabbar();
}
);
}
console.log(uni.getStorageSync("basedata"));
// if (uni.getStorageSync("basedata")) {
// this.basedata = uni.getStorageSync("basedata");
// this.formatTabbar();
// this.formatNavigation();
// } else {
this.request2(
{
url: "/api/Mall/GetHome",
data: {},
},
(res) => {
uni.setStorageSync("basedata", res.data);
this.basedata = res.data;
this.$uiConfig.mainColor=this.basedata.mall.setting.mallStyle.main
this.$uiConfig.secondary=this.basedata.mall.setting.mallStyle.secondary
this.formatTabbar();
this.formatNavigation();
}
);
//}
},
formatPlat() {
let modelmes = uni.getSystemInfoSync().model;
......@@ -67,9 +70,9 @@ export default {
timingFunc: "easeIn",
},
});
uni.setNavigationBarTitle({
title: this.basedata.mall.name,
});
// uni.setNavigationBarTitle({
// title: this.basedata.mall.name,
// });
},
formatTabbar() {
let navs = this.basedata.navbar.navs;
......@@ -102,10 +105,11 @@ export default {
font-family: "oswald";
src: url("https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/smallapp/Oswald-Regular.ttf");
}
html,body{
html,
body {
font-family: "oswald" !important;
}
swiper{
swiper {
height: unset;
}
</style>
\ No newline at end of file
</style>
......@@ -10,13 +10,13 @@
style="width: 100%; height: 100%;"
/>
</view>
<view class="good-name" v-if="setting.is_show_goods_name=='1'">{{ cx.name }}</view>
<view class="good-name" v-if="setting.is_show_goods_name==1">{{ cx.name }}</view>
<view class="good-info">
<view class="price" :style="{ color: mainColor }">
{{cx.price}}</view>
<!-- v-if="setting.is_show_sales_num=='1'" -->
<view class="sell">{{ cx.sales }}</view>
<view v-if="setting.is_show_cart=='1'" class="cart" @click.stop="showSkuHandler(cx)">
<view v-if="setting.is_show_cart==1" class="cart" @click.stop="showSkuHandler(cx)">
<u-icon name="cart-o" size="40" :color="mainColor" />
</view>
</view>
......@@ -65,7 +65,7 @@ export default {
},
methods: {
initConfig() {
this.setting = uni.getStorageSync("basedata").setting
this.setting = uni.getStorageSync("basedata").mall.setting
},
clickHandler(item) {
console.log("GoodsId",item)
......
......@@ -9,7 +9,7 @@
right: 0;
z-index: 99999999;
border-top: 1upx solid #ddd;
background: #FFF;
background: #fff;
}
.tabbarMainIphone {
height: 156upx;
......@@ -50,7 +50,7 @@
.itmMain {
/* width: 250upx; */
width: 150upx;
flex:1;
flex: 1;
justify-content: center;
align-items: center;
display: flex;
......@@ -141,16 +141,10 @@ export default {
leftWidth: 0,
flagTypeInfo: false,
navs: [],
crtPath:""
crtPath: "",
};
},
created() {
setTimeout(() => {
this.navs = uni.getStorageSync("basedata")
? uni.getStorageSync("basedata").navbar.navs
: [];
}, 400);
},
created() {},
mounted() {
this.flagTypeInfo = this.$uiConfig.is_bang;
let tempSystem = uni.getSystemInfoSync();
......@@ -164,30 +158,32 @@ export default {
}
// #endif
});
this.activeHandler()
this.navs = uni.getStorageSync("basedata")
? uni.getStorageSync("basedata").navbar.navs
: [];
this.activeHandler();
},
methods: {
activeHandler() {
let t=getCurrentPages()
this.crtPath = "/"+t[t.length-1].route
let t = getCurrentPages();
this.crtPath = "/" + t[t.length - 1].route;
this.navs.forEach((x, i) => {
if (x.url == this.crtPath) {
if (x.url.split("?")[0] == this.crtPath) {
this.active = i;
}
});
console.log(this.active)
},
goUrl(url){
if(this.crtPath!=url){
goUrl(url) {
if (this.crtPath != url) {
uni.redirectTo({
url: url
url: url,
});
}else{
} else {
uni.reLaunch({
url: url
})
url: url,
});
}
}
}
},
},
};
</script>
......@@ -101,7 +101,7 @@ export default {
genernalHandler() {
//this.goodId
uni.navigateTo({
url: "/pages/goods/draw",
url: "/pages/goods/draw?id"+this.goodId,
});
},
sendQuanHandler() {
......@@ -200,6 +200,7 @@ export default {
padding-bottom: 40rpx;
display: block;
border-bottom: 2rpx solid #f1f1f1;
overflow-x: auto;
}
.share-box .img-box .box {
white-space: nowrap;
......
......@@ -271,15 +271,38 @@ export default {
this.generterConfig.bgType = this.types[v].clsName == "fill" ? 1 : 2;
}
},
// init() {
// let h = this.apiheader();
// this.request(
// {
// url: "",
// header: h,
// data: {
// r: "plugin/quick_share/api/poster/config",
// goods_id: this.id,
// },
// },
// (res) => {
// this.config = res.data.config;
// this.info = res.data.info;
// this.loading = false;
// this.generterConfig.bgColor = this.config.color[0];
// let temp = parseInt(this.config.image_style[0]);
// for (let i = 0; i < temp; i++) {
// this.generterConfig.images.push(this.info.multi_map[i]);
// }
// this.newInit();
// }
// );
// },
init() {
let h = this.apiheader();
this.request(
let u = uni.getStorageSync("mall_UserInfo");
this.request2(
{
url: "",
header: h,
url: "/api/Mall/GetGoosPoster",
data: {
r: "plugin/quick_share/api/poster/config",
goods_id: this.id,
goodsId: this.id,
path: "/pages/goods/goods?id=" + this.id + "&pid=" + u.UserId,
},
},
(res) => {
......@@ -288,6 +311,7 @@ export default {
this.loading = false;
this.generterConfig.bgColor = this.config.color[0];
let temp = parseInt(this.config.image_style[0]);
this.info.qrcode_url=this.host2+this.info.qrcode_url
for (let i = 0; i < temp; i++) {
this.generterConfig.images.push(this.info.multi_map[i]);
}
......
......@@ -28,10 +28,10 @@
<!-- TODO is_common_user_member_price 普通用户会员价 -->
<!-- TODO is_member_user_member_price 会员用户会员价 -->
<view class="sell u-skeleton-rect">
<text class="oprice" v-if="setting.is_underline_price == '1'">{{
<text class="oprice" v-if="setting.is_underline_price == 1">{{
g.original_price
}}</text>
<text v-if="setting.is_sales == '1'"
<text v-if="setting.is_sales == 1"
>已售出{{ g.sales }}{{ g.unit }}</text
>
</view>
......@@ -139,7 +139,7 @@
<view
class="sku-box u-skeleton-rect"
v-if="comments.length == 0 && setting.is_comment == '1'"
v-if="comments.length == 0 && setting.is_comment == 1"
>
<view class="label">暂无评论信息</view>
</view>
......@@ -219,7 +219,7 @@
v-if="!isExsitGoods"
></u-empty>
<share
:id="id"
:good-id="id"
v-if="showShare"
:good-name="g.name"
:images="g.pic_url"
......@@ -281,7 +281,7 @@ export default {
this.mc = this.$uiConfig.mainColor;
this.secondary = this.$uiConfig.secondary;
this.initPage();
this.setting = uni.getStorageSync("basedata").setting;
this.setting = uni.getStorageSync("basedata").mall.setting
},
onShareAppMessage(res) {
return {
......
export default {
install(Vue, options) {
//Vue.prototype.host2 = "http://192.168.0.110:8200"
Vue.prototype.host2 = "https://mallApi.oytour.com"
Vue.prototype.host = "https://wx.weibaoge.cn/web/index.php?_mall_id=1285"
// Vue.prototype.host2 = "https://mallApi.oytour.com"
//Vue.prototype.host2 = "http://192.168.2.16:8088"
Vue.prototype.host2 = "https://mallApi.oytour.com"
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({
......
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