Commit f175a236 authored by 黄奎's avatar 黄奎

11

parent 2cce1bb2
...@@ -222,14 +222,16 @@ ...@@ -222,14 +222,16 @@
b2bResult.groupId = b2bData.groupId; b2bResult.groupId = b2bData.groupId;
b2bResult.contactNumber = b2bData.contactNumber; b2bResult.contactNumber = b2bData.contactNumber;
uni.setStorageSync('b2b_user', b2bResult) uni.setStorageSync('b2b_user', b2bResult)
} that.$emit("changeuserinfo");
}, (error2) => { } else {
if (that.isOpenAuth == 1) {
//未绑定的用户强制跳转到登录页面
uni.redirectTo({ uni.redirectTo({
url: '/pages/jiuzhai/bind_Customer' url: '/pages/jiuzhai/bind_Customer'
}) })
} }
}, (error2) => {
uni.redirectTo({
url: '/pages/jiuzhai/bind_Customer'
})
}); });
} }
} }
......
...@@ -195,6 +195,7 @@ ...@@ -195,6 +195,7 @@
configId: 0, //线路带过来字段 configId: 0, //线路带过来字段
cityId: 0, //线路带来字段 cityId: 0, //线路带来字段
videoId: 0, //视频字段 videoId: 0, //视频字段
b2bUser: {}, //同行信息
}; };
}, },
components: { components: {
...@@ -415,22 +416,34 @@ ...@@ -415,22 +416,34 @@
if (options && options.cityId) { if (options && options.cityId) {
this.cityId = options.cityId; this.cityId = options.cityId;
} }
let set = uni.getStorageSync("basedata") ?
uni.getStorageSync("basedata").mall.setting : {};
this.setting = set;
that.u = uni.getStorageSync("mall_UserInfo"); that.u = uni.getStorageSync("mall_UserInfo");
that.b2bUser = uni.getStorageSync("b2b_user");
console.log("onLoad_setting", this.setting);
console.log("onLoad_b2bUser", this.b2bUser);
if (!that.u) { if (!that.u) {
that.u = { that.u = {
nickName: "未登录", nickName: "未登录",
avatarUrl: "", avatarUrl: "",
}; };
that.showAuth = true; that.showAuth = true;
} else if (!that.b2bUser && this.setting && this.setting.is_show_auth && this.setting.is_show_auth == 1) {
that.u = {
nickName: "未登录",
avatarUrl: "",
};
that.showAuth = true;
} else { } else {
that.sharejump(); //4-9新加 that.sharejump(); //4-9新加
} }
// #endif // #endif
let set = uni.getStorageSync("basedata") ?
uni.getStorageSync("basedata").mall.setting : {};
this.setting = set;
if (!uni.getStorageSync("add_top_app")) { if (!uni.getStorageSync("add_top_app")) {
uni.setStorageSync("add_top_app", { uni.setStorageSync("add_top_app", {
add_top_app_show: 1, add_top_app_show: 1,
...@@ -1016,6 +1029,9 @@ ...@@ -1016,6 +1029,9 @@
uni.setStorageSync("navs", res.data.navbar.navs); uni.setStorageSync("navs", res.data.navbar.navs);
} }
uni.setStorageSync("basedata", res.data); uni.setStorageSync("basedata", res.data);
if (res.data && res.data.mall && res.data.mall.setting) {
this.setting = res.data.mall.setting;
}
if (Object.keys(this.$refs).length > 0 && this.$refs.study) { if (Object.keys(this.$refs).length > 0 && this.$refs.study) {
//判断 //判断
......
...@@ -457,6 +457,7 @@ ...@@ -457,6 +457,7 @@
</view> </view>
</template> </template>
</view> </view>
<auth v-if="showAuth&&is_show_auth==1" @changeuserinfo="reloadUserinfo" @gbAuth="gbAuth"></auth>
<u-picker mode="time" v-model="isShowDate" @confirm='getStratDate' :params="params"></u-picker> <u-picker mode="time" v-model="isShowDate" @confirm='getStratDate' :params="params"></u-picker>
<u-popup v-model="showTimePopup" mode="bottom" border-radius="20" length="90%" :safe-area-inset-bottom="true"> <u-popup v-model="showTimePopup" mode="bottom" border-radius="20" length="90%" :safe-area-inset-bottom="true">
<canlendar @finish="chosenDateResult"></canlendar> <canlendar @finish="chosenDateResult"></canlendar>
...@@ -467,9 +468,11 @@ ...@@ -467,9 +468,11 @@
</template> </template>
<script> <script>
import canlendar from "./components/time/index.vue" import canlendar from "./components/time/index.vue"
import auth from "@/components/auth/index.vue";
export default { export default {
components: { components: {
canlendar canlendar,
auth
}, },
data() { data() {
return { return {
...@@ -574,7 +577,11 @@ ...@@ -574,7 +577,11 @@
"天数日期", "天数日期",
"出发城市" "出发城市"
], ],
CityId: 0 CityId: 0,
showAuth: false,
is_show_auth: 0, //是否显示授权弹窗
b2bUser: {}, //同行信息
mallUserInfo: {},
}; };
}, },
created() { created() {
...@@ -583,7 +590,7 @@ ...@@ -583,7 +590,7 @@
}) })
}, },
onLoad(option) { onLoad(option) {
console.log("option",option); console.log("option", option);
if (option && option.LineTeamIds) { if (option && option.LineTeamIds) {
let NewArr = []; let NewArr = [];
NewArr = option.LineTeamIds.split(","); NewArr = option.LineTeamIds.split(",");
...@@ -601,9 +608,38 @@ ...@@ -601,9 +608,38 @@
if (option && option.teamType && option.teamType == "1") { if (option && option.teamType && option.teamType == "1") {
this.msg.teamType = option.teamType; this.msg.teamType = option.teamType;
} }
let basedata = uni.getStorageSync("basedata");
//判断后台是否开启自动授权
if (basedata && basedata.mall && basedata.mall.setting && basedata.mall.setting && basedata.mall.setting.is_show_auth ==
1) {
this.is_show_auth = 1;
}
this.b2bUser = uni.getStorageSync("b2b_user");
this.mallUserInfo = uni.getStorageSync("mall_UserInfo");
if (!this.mallUserInfo) {
this.mallUserInfo = {
nickName: "未登录",
avatarUrl: "",
};
this.showAuth = true;
} else if (!this.b2bUser && this.is_show_auth == 1) {
this.U = {
nickName: "未登录",
avatarUrl: "",
};
this.showAuth = true;
}
this.getLineQuery(); this.getLineQuery();
}, },
methods: { methods: {
reloadUserinfo() {
this.b2bUser = uni.getStorageSync("b2b_user");
this.mallUserInfo = uni.getStorageSync("mall_UserInfo");
},
//关闭登录窗口
gbAuth() {
this.showAuth = false;
},
allTeamsChangeHandler(e) { allTeamsChangeHandler(e) {
this.allTeams = e.detail.value.length > 0 this.allTeams = e.detail.value.length > 0
if (this.allTeams && this.msg.team.length > 0) { if (this.allTeams && this.msg.team.length > 0) {
...@@ -720,7 +756,7 @@ ...@@ -720,7 +756,7 @@
this.optionsTitle[1] = '线路玩法' this.optionsTitle[1] = '线路玩法'
this.currentLineId = null this.currentLineId = null
this.msg.lineId = 0; this.msg.lineId = 0;
this.msg.PlaceIds=""; this.msg.PlaceIds = "";
this.allTeams = false this.allTeams = false
this.$forceUpdate() this.$forceUpdate()
this.$refs.uDropdown.close(); this.$refs.uDropdown.close();
...@@ -754,7 +790,7 @@ ...@@ -754,7 +790,7 @@
this.research(); this.research();
}, },
setTeams(teamId) { setTeams(teamId) {
this.msg.PlaceIds=""; this.msg.PlaceIds = "";
let id = teamId let id = teamId
let temp = this.msg.team.indexOf(id) let temp = this.msg.team.indexOf(id)
if (temp == -1) { if (temp == -1) {
......
...@@ -1012,6 +1012,7 @@ ...@@ -1012,6 +1012,7 @@
isDownloading: false, isDownloading: false,
startCities: [], startCities: [],
is_show_auth: 0, //是否配置启用授权(1-开启) is_show_auth: 0, //是否配置启用授权(1-开启)
b2bUser: {}, //同行信息
}; };
}, },
created() {}, created() {},
...@@ -1049,6 +1050,7 @@ ...@@ -1049,6 +1050,7 @@
} }
this.getDetails(); this.getDetails();
this.U = uni.getStorageSync("mall_UserInfo"); this.U = uni.getStorageSync("mall_UserInfo");
this.b2bUser = uni.getStorageSync("b2b_user");
let basedata = uni.getStorageSync("basedata"); let basedata = uni.getStorageSync("basedata");
//判断后台是否开启自动授权 //判断后台是否开启自动授权
if (basedata && basedata.mall && basedata.mall.setting && basedata.mall.setting && basedata.mall.setting.is_show_auth == if (basedata && basedata.mall && basedata.mall.setting && basedata.mall.setting && basedata.mall.setting.is_show_auth ==
...@@ -1062,6 +1064,12 @@ ...@@ -1062,6 +1064,12 @@
avatarUrl: "", avatarUrl: "",
}; };
this.showAuth = true; this.showAuth = true;
} else if (!this.b2bUser && this.is_show_auth == 1) {
this.U = {
nickName: "未登录",
avatarUrl: "",
};
this.showAuth = true;
} }
let that = this; let that = this;
uni.getSystemInfo({ uni.getSystemInfo({
...@@ -1141,6 +1149,7 @@ ...@@ -1141,6 +1149,7 @@
}) })
}, },
reloadUserinfo() { reloadUserinfo() {
this.b2bUser = uni.getStorageSync("b2b_user");
this.u = uni.getStorageSync("mall_UserInfo"); this.u = uni.getStorageSync("mall_UserInfo");
}, },
//关闭登录窗口 //关闭登录窗口
...@@ -1446,6 +1455,7 @@ ...@@ -1446,6 +1455,7 @@
//立即预定 //立即预定
goReserce() { goReserce() {
this.u = uni.getStorageSync("mall_UserInfo"); this.u = uni.getStorageSync("mall_UserInfo");
if (!this.u) { if (!this.u) {
this.u = { this.u = {
nickName: "未登录", nickName: "未登录",
...@@ -1455,6 +1465,16 @@ ...@@ -1455,6 +1465,16 @@
this.is_show_auth = 1; this.is_show_auth = 1;
return; return;
} }
this.b2bUser = uni.getStorageSync("b2b_user");
if (!this.b2bUser) {
this.u = {
nickName: "未登录",
avatarUrl: "",
};
this.showAuth = true;
this.is_show_auth = 1;
return;
}
let myObj = {}; let myObj = {};
myObj.startCityName = this.dataList.startCityName; myObj.startCityName = this.dataList.startCityName;
myObj.startDate = this.currentPrice.startDate; myObj.startDate = this.currentPrice.startDate;
...@@ -1469,7 +1489,7 @@ ...@@ -1469,7 +1489,7 @@
myObj.b2BMemberPrice = this.currentPrice.b2BMemberPrice; myObj.b2BMemberPrice = this.currentPrice.b2BMemberPrice;
myObj.tcid = this.currentPrice.tcid; myObj.tcid = this.currentPrice.tcid;
myObj.teamType = this.currentPrice.teamType; myObj.teamType = this.currentPrice.teamType;
myObj.lineteamId=this.dataList.lineteamId; myObj.lineteamId = this.dataList.lineteamId;
let imgCover = JSON.parse(this.dataList.imgCover); let imgCover = JSON.parse(this.dataList.imgCover);
if (imgCover.length > 0) { if (imgCover.length > 0) {
myObj.CoverImg = imgCover[0].Url; myObj.CoverImg = imgCover[0].Url;
......
...@@ -208,15 +208,6 @@ ...@@ -208,15 +208,6 @@
}; };
}, },
created() { created() {
this.userInfo = uni.getStorageSync("mall_UserInfo");
this.b2b_user_info = uni.getStorageSync('b2b_user');
if (!this.b2b_user_info || !this.b2b_user_info.token) {
this.showAuth = true;
} else {
this.getOrderInfo();
}
// #ifdef MP-ALIPAY // #ifdef MP-ALIPAY
this.showBar = false; this.showBar = false;
// #endif // #endif
...@@ -236,11 +227,17 @@ ...@@ -236,11 +227,17 @@
uni.setNavigationBarTitle({ uni.setNavigationBarTitle({
title: this.pageTitle, title: this.pageTitle,
}); });
this.userInfo = uni.getStorageSync("mall_UserInfo");
this.b2b_user_info = uni.getStorageSync('b2b_user');
if (!this.b2b_user_info) {
this.showAuth = true;
} else {
this.getOrderInfo();
}
}, },
methods: { methods: {
//获取订单状态名称 //获取订单状态名称
getOrderStateName(item) { getOrderStateName(item) {
console.log("item", item);
var str = "待付款"; var str = "待付款";
if (item.orderState == 1) { if (item.orderState == 1) {
str = "已付款" str = "已付款"
...@@ -257,7 +254,9 @@ ...@@ -257,7 +254,9 @@
reloadUserinfo() { reloadUserinfo() {
this.userInfo = uni.getStorageSync("mall_UserInfo"); this.userInfo = uni.getStorageSync("mall_UserInfo");
this.b2b_user_info = uni.getStorageSync('b2b_user'); this.b2b_user_info = uni.getStorageSync('b2b_user');
this.getOrderInfo(); if (this.b2b_user_info) {
this.getOrderInfo();
}
}, },
goOrderDetail(item) { goOrderDetail(item) {
uni.navigateTo({ uni.navigateTo({
......
...@@ -79,10 +79,10 @@ ...@@ -79,10 +79,10 @@
<text>{{ meueData.user_center.foot_bar[1].name }}</text> <text>{{ meueData.user_center.foot_bar[1].name }}</text>
</view> </view>
<!--优惠劵--> <!--优惠劵-->
<view class="top_b_item" v-if=" meueData.user_center && meueData.user_center.is_account_status == 1" @click="goUrl(couponsObj.link_url)"> <!-- <view class="top_b_item" v-if=" meueData.user_center && meueData.user_center.is_account_status == 1" @click="goUrl(couponsObj.link_url)">
<text style="font-size: 21px">{{ user_info.coupon ? user_info.coupon : 0 }}</text> <text style="font-size: 21px">{{ user_info.coupon ? user_info.coupon : 0 }}</text>
<text>{{ couponsObj.name }}</text> <text>{{ couponsObj.name }}</text>
</view> </view> -->
</view> </view>
<view class="Receiptbalance" v-if=" meueData.user_center && meueData.user_center.is_account_status == 1"> <view class="Receiptbalance" v-if=" meueData.user_center && meueData.user_center.is_account_status == 1">
...@@ -212,7 +212,7 @@ ...@@ -212,7 +212,7 @@
</view> </view>
</view> </view>
</template> </template>
<!-- <view class="login-btn" style="margin:30px 0" @click='signOutHandler'>退出登录</view> --> <view class="login-btn" style="margin:30px 0" @click='signOutHandler'>退出登录</view>
</view> </view>
<auth v-if="showAuth" @changeuserinfo="reloadUserinfo" @gbAuth="gbAuth"></auth> <auth v-if="showAuth" @changeuserinfo="reloadUserinfo" @gbAuth="gbAuth"></auth>
<tabbars></tabbars> <tabbars></tabbars>
...@@ -271,7 +271,6 @@ ...@@ -271,7 +271,6 @@
appId: "2021002181604459" appId: "2021002181604459"
})), })),
userId: uni.getStorageSync("mall_UserInfo").UserId, userId: uni.getStorageSync("mall_UserInfo").UserId,
}; };
}, },
components: { components: {
...@@ -298,18 +297,20 @@ ...@@ -298,18 +297,20 @@
this.isAttestationEdu = basedata.user_info.isAttestationEdu ? this.isAttestationEdu = basedata.user_info.isAttestationEdu ?
basedata.user_info.isAttestationEdu : basedata.user_info.isAttestationEdu :
0; 0;
this.b2b_user_info = uni.getStorageSync('b2b_user')
}, },
onLoad() { onLoad() {
this.navHeight = this.$navHeight - 2; this.navHeight = this.$navHeight - 2;
this.u = wx.getStorageSync("basedata").user_info; this.u = wx.getStorageSync("basedata").user_info;
this.b2b_user_info = uni.getStorageSync('b2b_user')
this.mall_UserInfo = uni.getStorageSync("mall_UserInfo"); this.mall_UserInfo = uni.getStorageSync("mall_UserInfo");
this.nav = uni.getSystemInfoSync().statusBarHeight + "px"; this.nav = uni.getSystemInfoSync().statusBarHeight + "px";
this.headStyle.background = `linear-gradient(to right, '#e6b865',80%, '#ebb45e')`; this.headStyle.background = `linear-gradient(to right, '#e6b865',80%, '#ebb45e')`;
this.headStyle.paddingTop = this.nav; this.headStyle.paddingTop = this.nav;
if (!this.mall_UserInfo) { if (!this.mall_UserInfo) {
this.showAuth = true; this.showAuth = true;
} else if (!this.b2b_user_info ) {
//&& this.setting && this.setting.is_show_auth == 1
this.showAuth = true;
} }
}, },
mounted() { mounted() {
...@@ -343,10 +344,7 @@ ...@@ -343,10 +344,7 @@
// #endif // #endif
}, },
onShow() { onShow() {
this.userinfo(2); this.userCenterinfo(2);
if (this.mall_UserInfo) {
}
let basedata = uni.getStorageSync("basedata") ? let basedata = uni.getStorageSync("basedata") ?
uni.getStorageSync("basedata") : uni.getStorageSync("basedata") :
""; "";
...@@ -355,6 +353,7 @@ ...@@ -355,6 +353,7 @@
0; 0;
}, },
methods: { methods: {
//退出登录
signOutHandler() { signOutHandler() {
uni.removeStorageSync('b2b_user') uni.removeStorageSync('b2b_user')
uni.removeStorageSync('mall_UserInfo') uni.removeStorageSync('mall_UserInfo')
...@@ -458,7 +457,7 @@ ...@@ -458,7 +457,7 @@
return flag; return flag;
}, },
//获取菜单配置 //获取菜单配置
userinfo(type = 1) { userCenterinfo(type = 1) {
uni.showNavigationBarLoading(); uni.showNavigationBarLoading();
this.request2({ this.request2({
url: "/api/Mall/GetUserCenter", url: "/api/Mall/GetUserCenter",
...@@ -560,11 +559,11 @@ ...@@ -560,11 +559,11 @@
} }
}, },
reloadUserinfo() { reloadUserinfo() {
this.userinfo(); this.b2b_user_info = uni.getStorageSync('b2b_user');
this.userCenterinfo();
this.u = this.user_info; this.u = this.user_info;
this.mall_UserInfo = uni.getStorageSync("mall_UserInfo") ? this.mall_UserInfo = uni.getStorageSync("mall_UserInfo") ?
uni.getStorageSync("mall_UserInfo") : {}; uni.getStorageSync("mall_UserInfo") : {};
this.b2b_user_info = uni.getStorageSync('b2b_user');
this.getUserPoint(); this.getUserPoint();
}, },
login(name) { login(name) {
......
...@@ -23,7 +23,7 @@ export default { ...@@ -23,7 +23,7 @@ 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.5.46:5003" // Vue.prototype.host2 = "http://192.168.5.46:8300"
// Vue.prototype.host3 = "http://192.168.5.46" // Vue.prototype.host3 = "http://192.168.5.46"
Vue.prototype.host2 = "https://erpmallapi.oytour.com" Vue.prototype.host2 = "https://erpmallapi.oytour.com"
Vue.prototype.host3 = "https://reborn.oytour.com" Vue.prototype.host3 = "https://reborn.oytour.com"
...@@ -120,12 +120,12 @@ export default { ...@@ -120,12 +120,12 @@ export default {
if (res.data.resultCode == 10000 || res.data.resultCode == 10001) { if (res.data.resultCode == 10000 || res.data.resultCode == 10001) {
uni.removeStorageSync('b2b_user') uni.removeStorageSync('b2b_user')
uni.removeStorageSync('mall_UserInfo') uni.removeStorageSync('mall_UserInfo')
// uni.redirectTo({
// url: '/pages/jiuzhai/login'
// })
uni.redirectTo({ uni.redirectTo({
url: '/pages/index/index' url: '/pages/jiuzhai/bind_Customer'
}) })
// uni.redirectTo({
// url: '/pages/index/index'
// })
} else if (res.data.resultCode != 1) { } else if (res.data.resultCode != 1) {
if (!failed) { if (!failed) {
if (res.data.message != '') { if (res.data.message != '') {
......
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