Commit d92f40e5 authored by 罗超's avatar 罗超

调整部分样式

parent 2816875c
...@@ -49,9 +49,7 @@ ...@@ -49,9 +49,7 @@
<addialog v-if="d.id == 'modal' && d.data.opened" :ads="d.data" :key="di"></addialog> <addialog v-if="d.id == 'modal' && d.data.opened" :ads="d.data" :key="di"></addialog>
<quicknav v-if="d.id == 'quick-nav' && d.data.navSwitch == 1" :navs="d.data" :key="di"></quicknav> <quicknav v-if="d.id == 'quick-nav' && d.data.navSwitch == 1" :navs="d.data" :key="di"></quicknav>
<pingtuan v-if="d.id == 'pintuan'" :goods="d.data" :key="di"></pingtuan> <pingtuan v-if="d.id == 'pintuan'" :goods="d.data" :key="di"></pingtuan>
<shopinfo v-if="d.id == 'shop-info' " :ad="d.data" :key="di" ref='son'></shopinfo> <shopinfo v-if="d.id == 'shop-info' " :ad="d.data" :key="di" ref="son"></shopinfo>
</template> </template>
</view> </view>
</template> </template>
...@@ -79,7 +77,8 @@ ...@@ -79,7 +77,8 @@
@goLook="goLook" @goLook="goLook"
@closeBtn="closeBtn" @closeBtn="closeBtn"
></coupon> ></coupon>
<auth v-if="showAuth" @changeuserinfo="reloadUserinfo" @gbAuth= 'gbAuth'></auth> <auth v-if="showAuth" @changeuserinfo="reloadUserinfo" @gbAuth="gbAuth"></auth>
<!-- <official-account></official-account> -->
</view> </view>
</view> </view>
</template> </template>
...@@ -127,9 +126,9 @@ export default { ...@@ -127,9 +126,9 @@ export default {
titleStyle: "", titleStyle: "",
pagePaddingBottom: "0px", pagePaddingBottom: "0px",
showBack: false, showBack: false,
showAuth:false, showAuth: false,
U:{}, U: {},
shopData:{}, shopData: {},
}; };
}, },
components: { components: {
...@@ -154,7 +153,7 @@ export default { ...@@ -154,7 +153,7 @@ export default {
coupon, coupon,
pingtuan, pingtuan,
shopinfo, shopinfo,
auth auth,
}, },
onLoad(options) { onLoad(options) {
console.log(options, "option"); console.log(options, "option");
...@@ -182,17 +181,16 @@ export default { ...@@ -182,17 +181,16 @@ export default {
} }
let p = 0; let p = 0;
if (uni.getStorageSync("navs")) { if (uni.getStorageSync("navs")) {
uni.getStorageSync("navs").forEach(x=>{ uni.getStorageSync("navs").forEach((x) => {
if (x.url == queryString) { if (x.url == queryString) {
p=1; p = 1;
} }
}) });
} }
if (p == 0) { if (p == 0) {
this.showtabs = false; this.showtabs = false;
this.contentHeight = this.$utils.calcContentHeight(); this.contentHeight = this.$utils.calcContentHeight();
} }
} }
if (options && options.custom_params) { if (options && options.custom_params) {
let custom_params = JSON.parse(decodeURIComponent(options.custom_params)); let custom_params = JSON.parse(decodeURIComponent(options.custom_params));
...@@ -206,11 +204,9 @@ export default { ...@@ -206,11 +204,9 @@ export default {
} }
if (options && options.SmallShopId) { if (options && options.SmallShopId) {
uni.setStorageSync("SmallShopId", { SmallShopId: options.SmallShopId }); uni.setStorageSync("SmallShopId", { SmallShopId: options.SmallShopId });
console.log(uni.getStorageSync("SmallShopId")) console.log(uni.getStorageSync("SmallShopId"));
} }
if (options && options.scene) { if (options && options.scene) {
//兼容之前小程序的调转 //兼容之前小程序的调转
this.getjump(options.scene); this.getjump(options.scene);
...@@ -222,7 +218,7 @@ export default { ...@@ -222,7 +218,7 @@ export default {
menus: ["shareAppMessage", "shareTimeline"], menus: ["shareAppMessage", "shareTimeline"],
}); });
that.u = uni.getStorageSync("mall_UserInfo") that.u = uni.getStorageSync("mall_UserInfo");
wx.getUserInfo({ wx.getUserInfo({
success: function (res) { success: function (res) {
if (uni.getStorageSync("mall_UserInfo")) { if (uni.getStorageSync("mall_UserInfo")) {
...@@ -233,48 +229,46 @@ export default { ...@@ -233,48 +229,46 @@ export default {
Photo: res.userInfo.avatarUrl, Photo: res.userInfo.avatarUrl,
}; };
that.updateuserinfo(msg); that.updateuserinfo(msg);
}else{ } else {
//静默登录操作 //静默登录操作
uni.login({ uni.login({
provider: 'weixin', provider: "weixin",
success: info => { success: (info) => {
let obj ={ let obj = {
Name: res.userInfo.nickName, Name: res.userInfo.nickName,
Photo: res.userInfo.avatarUrl, Photo: res.userInfo.avatarUrl,
code: info.code code: info.code,
} };
that.getCode(obj) that.getCode(obj);
}, },
fail: () => { fail: () => {
uni.showToast({ title: '微信登录授权失败', icon: 'none' }); uni.showToast({ title: "微信登录授权失败", icon: "none" });
if (!that.u) { if (!that.u) {
that.u = { that.u = {
nickName: "未登录", nickName: "未登录",
avatarUrl: "" avatarUrl: "",
}; };
that.showAuth = true; that.showAuth = true;
} }
} },
}); });
} }
}, },
fail:function(e){ fail: function (e) {
uni.showToast({ title: '微信登录授权失败', icon: 'none' }); uni.showToast({ title: "微信登录授权失败", icon: "none" });
if (!that.u) { if (!that.u) {
that.u = { that.u = {
nickName: "未登录", nickName: "未登录",
avatarUrl: "" avatarUrl: "",
}; };
that.showAuth = true; that.showAuth = true;
} }
} },
}); });
// #endif // #endif
this.init(); this.init();
this.getSmallShopById() this.getSmallShopById();
let set = uni.getStorageSync("basedata") let set = uni.getStorageSync("basedata")
? uni.getStorageSync("basedata").mall.setting ? uni.getStorageSync("basedata").mall.setting
: {}; : {};
...@@ -299,13 +293,14 @@ export default { ...@@ -299,13 +293,14 @@ export default {
let uid = uni.getStorageSync("mall_UserInfo") let uid = uni.getStorageSync("mall_UserInfo")
? uni.getStorageSync("mall_UserInfo").UserId ? uni.getStorageSync("mall_UserInfo").UserId
: 0; : 0;
if(uid==0){ if (uid == 0) {
uid = uni.getStorageSync("pid")?uni.getStorageSync("pid").pid:0 uid = uni.getStorageSync("pid") ? uni.getStorageSync("pid").pid : 0;
} }
let SmallShopId = uni.getStorageSync("mall_UserInfo") let SmallShopId = uni.getStorageSync("mall_UserInfo")
? uni.getStorageSync("mall_UserInfo").SmallShopId ? uni.getStorageSync("mall_UserInfo").SmallShopId
: 0; : 0;
if(SmallShopId == 0){//如果微店id为0 去找所属微店id if (SmallShopId == 0) {
//如果微店id为0 去找所属微店id
SmallShopId = uni.getStorageSync("mall_UserInfo") SmallShopId = uni.getStorageSync("mall_UserInfo")
? uni.getStorageSync("mall_UserInfo").UserSmallShopId ? uni.getStorageSync("mall_UserInfo").UserSmallShopId
: 0; : 0;
...@@ -313,7 +308,7 @@ export default { ...@@ -313,7 +308,7 @@ export default {
console.log(uid); console.log(uid);
return { return {
title: "", title: "",
query: "user_id=" + uid+"&SmallShopId=" + SmallShopId, query: "user_id=" + uid + "&SmallShopId=" + SmallShopId,
imageUrl: "", imageUrl: "",
}; };
}, },
...@@ -325,35 +320,37 @@ export default { ...@@ -325,35 +320,37 @@ export default {
let uid = uni.getStorageSync("mall_UserInfo") let uid = uni.getStorageSync("mall_UserInfo")
? uni.getStorageSync("mall_UserInfo").UserId ? uni.getStorageSync("mall_UserInfo").UserId
: 0; : 0;
if(uid==0){ if (uid == 0) {
uid = uni.getStorageSync("pid")?uni.getStorageSync("pid").pid:0 uid = uni.getStorageSync("pid") ? uni.getStorageSync("pid").pid : 0;
} }
let SmallShopId = uni.getStorageSync("mall_UserInfo") let SmallShopId = uni.getStorageSync("mall_UserInfo")
? uni.getStorageSync("mall_UserInfo").SmallShopId ? uni.getStorageSync("mall_UserInfo").SmallShopId
: 0; : 0;
if(SmallShopId == 0){//如果微店id为0 去找所属微店id if (SmallShopId == 0) {
//如果微店id为0 去找所属微店id
SmallShopId = uni.getStorageSync("mall_UserInfo") SmallShopId = uni.getStorageSync("mall_UserInfo")
? uni.getStorageSync("mall_UserInfo").UserSmallShopId ? uni.getStorageSync("mall_UserInfo").UserSmallShopId
: 0; : 0;
} }
if(SmallShopId!=0){ if (SmallShopId != 0) {
return{ return {
title: this.shopData.Name title: this.shopData.Name
? this.shopData.Name ? this.shopData.Name
: uni.getStorageSync("basedata").mall.name, : uni.getStorageSync("basedata").mall.name,
path: "/pages/index/index?user_id=" + uid+"&SmallShopId=" + SmallShopId, path:
imageUrl: '', "/pages/index/index?user_id=" + uid + "&SmallShopId=" + SmallShopId,
} imageUrl: "",
}else{ };
} else {
return { return {
title: this.setting.share_title title: this.setting.share_title
? this.setting.share_title ? this.setting.share_title
: uni.getStorageSync("basedata").mall.name, : uni.getStorageSync("basedata").mall.name,
path: "/pages/index/index?user_id=" + uid+"&SmallShopId=" + SmallShopId, path:
"/pages/index/index?user_id=" + uid + "&SmallShopId=" + SmallShopId,
imageUrl: this.setting.share_pic ? this.setting.share_pic : "", imageUrl: this.setting.share_pic ? this.setting.share_pic : "",
}; };
} }
}, },
// #endif // #endif
onShow() { onShow() {
...@@ -371,52 +368,53 @@ export default { ...@@ -371,52 +368,53 @@ export default {
//这里请求接口 //这里请求接口
that.request2( that.request2(
{ {
url: '/api/mall/GetWeChatOpenId', url: "/api/mall/GetWeChatOpenId",
data: { data: {
Code: obj.code Code: obj.code,
} },
}, },
res => { (res) => {
if (res.resultCode == 1) { if (res.resultCode == 1) {
obj.OpenId = res.data; obj.OpenId = res.data;
that.getLogin(obj); that.getLogin(obj);
} }
} }
); );
}, },
getLogin(obj) { getLogin(obj) {
var that = this; var that = this;
let pid = uni.getStorageSync("pid")?uni.getStorageSync("pid").pid:0; let pid = uni.getStorageSync("pid") ? uni.getStorageSync("pid").pid : 0;
let SmallShopId = uni.getStorageSync("SmallShopId")?uni.getStorageSync("SmallShopId").SmallShopId:0; let SmallShopId = uni.getStorageSync("SmallShopId")
? uni.getStorageSync("SmallShopId").SmallShopId
: 0;
that.request2( that.request2(
{ {
url: '/api/AppletLogin/Login', url: "/api/AppletLogin/Login",
data: { data: {
Source: 1, Source: 1,
OpenId: obj.OpenId, OpenId: obj.OpenId,
Name: obj.Name, Name: obj.Name,
Photo: obj.Photo, Photo: obj.Photo,
Moblie: '', Moblie: "",
SuperiorId: pid, SuperiorId: pid,
SmallShopId:SmallShopId, SmallShopId: SmallShopId,
}
}, },
res => { },
(res) => {
if (res.resultCode == 1) { if (res.resultCode == 1) {
uni.setStorageSync('mall_UserInfo', res.data); uni.setStorageSync("mall_UserInfo", res.data);
if(res.couponResultCode==1){ if (res.couponResultCode == 1) {
that.showCoupons = true; that.showCoupons = true;
that.couponMessage = res.couponMessage; that.couponMessage = res.couponMessage;
} }
that.u = res.data that.u = res.data;
uni.removeStorageSync('pid'); uni.removeStorageSync("pid");
uni.removeStorageSync('SmallShopId'); uni.removeStorageSync("SmallShopId");
}else{ } else {
if (!that.u) { if (!that.u) {
that.u = { that.u = {
nickName: "未登录", nickName: "未登录",
avatarUrl: "" avatarUrl: "",
}; };
that.showAuth = true; that.showAuth = true;
} }
...@@ -511,13 +509,17 @@ export default { ...@@ -511,13 +509,17 @@ export default {
uni.setNavigationBarTitle({ uni.setNavigationBarTitle({
title: res.data.home_pages.title, title: res.data.home_pages.title,
}); });
if (!this.shopData.Name || this.shopData.Name == "") {
this.pageTitleStr = res.data.home_pages.title; this.pageTitleStr = res.data.home_pages.title;
}
} else { } else {
uni.setNavigationBarTitle({ uni.setNavigationBarTitle({
title: res.data.home_pages.navs[0].name, title: res.data.home_pages.navs[0].name,
}); });
if (!this.shopData.Name || this.shopData.Name == "") {
this.pageTitleStr = res.data.home_pages.navs[0].name; this.pageTitleStr = res.data.home_pages.navs[0].name;
} }
}
// uni.setNavigationBarColor({ // uni.setNavigationBarColor({
// //字体颜色 // //字体颜色
...@@ -536,21 +538,28 @@ export default { ...@@ -536,21 +538,28 @@ export default {
(error) => {} (error) => {}
); );
}, },
getSmallShopById(){ getSmallShopById() {
let Id = uni.getStorageSync("mall_UserInfo") ? uni.getStorageSync("mall_UserInfo").SmallShopId: 0; let Id = uni.getStorageSync("mall_UserInfo")
if(Id==0){ ? uni.getStorageSync("mall_UserInfo").SmallShopId
Id = uni.getStorageSync("mall_UserInfo") ? uni.getStorageSync("mall_UserInfo").UserSmallShopId: 0; : 0;
if (Id == 0) {
Id = uni.getStorageSync("mall_UserInfo")
? uni.getStorageSync("mall_UserInfo").UserSmallShopId
: 0;
} }
this.request2( this.request2(
{ {
url: '/api/AppletUser/GetSmallShopById', url: "/api/AppletUser/GetSmallShopById",
data: { data: {
Id: Id Id: Id,
} },
}, },
res => { (res) => {
if (res.resultCode == 1) { if (res.resultCode == 1) {
this.shopData = res.data this.shopData = res.data;
if (this.shopData.Name && this.shopData.Name != "") {
this.pageTitleStr = this.shopData.Name;
}
} }
} }
); );
...@@ -689,12 +698,11 @@ export default { ...@@ -689,12 +698,11 @@ export default {
}, },
reloadUserinfo() { reloadUserinfo() {
this.u = uni.getStorageSync("mall_UserInfo"); this.u = uni.getStorageSync("mall_UserInfo");
this.$refs.son[0].getSmallShopById(2)//第一次登陆成功后去调取微店的信息 this.$refs.son[0].getSmallShopById(2); //第一次登陆成功后去调取微店的信息
}, },
//关闭登录窗口 //关闭登录窗口
gbAuth(){ gbAuth() {
this.showAuth=false; this.showAuth = false;
}, },
}, },
}; };
......
...@@ -56,7 +56,7 @@ ...@@ -56,7 +56,7 @@
} }
.cdetailStyle .listbox { .cdetailStyle .listbox {
width: 90%; width: 100%;
background: #fff; background: #fff;
padding: 0 15px; padding: 0 15px;
/* margin-top: 15px; */ /* margin-top: 15px; */
......
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