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

修复BUG

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