|
@@ -140,24 +140,53 @@ export default {
|
|
showConfirmButton: false,
|
|
showConfirmButton: false,
|
|
totalPrice: 0,
|
|
totalPrice: 0,
|
|
confirmText: "",
|
|
confirmText: "",
|
|
|
|
+ optObj: {},
|
|
};
|
|
};
|
|
},
|
|
},
|
|
onPullDownRefresh() {},
|
|
onPullDownRefresh() {},
|
|
onLoad(option) {
|
|
onLoad(option) {
|
|
- console.log(this.sac, 666);
|
|
|
|
let self = this;
|
|
let self = this;
|
|
this.fromCart = option.fromCart;
|
|
this.fromCart = option.fromCart;
|
|
- console.log(self.shoppingCartList, 6);
|
|
|
|
let list = self.shoppingCartList;
|
|
let list = self.shoppingCartList;
|
|
- console.log(list, 66);
|
|
|
|
this.isBK = option.isBK;
|
|
this.isBK = option.isBK;
|
|
for (let i = 0; i < list.length; i++) {
|
|
for (let i = 0; i < list.length; i++) {
|
|
this.totalPrice += Number(list[i].standPrice);
|
|
this.totalPrice += Number(list[i].standPrice);
|
|
}
|
|
}
|
|
- console.log(this.isBK == "1");
|
|
|
|
},
|
|
},
|
|
- onShow() {},
|
|
|
|
|
|
+ onShow() {
|
|
|
|
+ // #ifdef H5
|
|
|
|
+ if (location.search.includes("code")) {
|
|
|
|
+ let arrs = location.search.slice(1).split("&");
|
|
|
|
+ for (let i = 0; i < arrs.length; i++) {
|
|
|
|
+ this.optObj[arrs[i].split("=")[0]] = arrs[i].split("=")[1];
|
|
|
|
+ }
|
|
|
|
+ uni.setStorageSync("h5_code", this.optObj.code);
|
|
|
|
+ this.OfficialLogin();
|
|
|
|
+ } else {
|
|
|
|
+ // 没有code,就重定向到地址https://www.xyyxt.net?ask_type=h.xyyxt.net 去获取code,授权后就会把code带上然后访问域名
|
|
|
|
+ // ?fromCart=&code=061F5a1w3aolh03SLe1w3sMsCF4F5a16&state=STATE
|
|
|
|
+ this.$api.checkBindGzh().then((res) => {
|
|
|
|
+ if (!res.data.data && process.env.NODE_ENV !== "development") {
|
|
|
|
+ location.replace(
|
|
|
|
+ "https://www.xyyxt.net/?ask_type=" + window.location.host
|
|
|
|
+ );
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+ // #endif
|
|
|
|
+ },
|
|
methods: {
|
|
methods: {
|
|
|
|
+ OfficialLogin() {
|
|
|
|
+ this.$api
|
|
|
|
+ .OfficialLogin({
|
|
|
|
+ code: this.optObj.code,
|
|
|
|
+ })
|
|
|
|
+ .then((res) => {
|
|
|
|
+ if (res.data.code !== 200) {
|
|
|
|
+ this.$u.toast(res.data.msg);
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ },
|
|
postOrder() {
|
|
postOrder() {
|
|
console.log(12312312321);
|
|
console.log(12312312321);
|
|
let list = this.shoppingCartList;
|
|
let list = this.shoppingCartList;
|
|
@@ -407,7 +436,7 @@ export default {
|
|
components: { ClassTimeTip },
|
|
components: { ClassTimeTip },
|
|
};
|
|
};
|
|
</script>
|
|
</script>
|
|
-<style >
|
|
|
|
|
|
+<style>
|
|
::-webkit-scrollbar {
|
|
::-webkit-scrollbar {
|
|
width: 0;
|
|
width: 0;
|
|
height: 0;
|
|
height: 0;
|
|
@@ -576,4 +605,4 @@ page {
|
|
color: #fff;
|
|
color: #fff;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
-</style>
|
|
|
|
|
|
+</style>
|