Commit 75dfbac4 authored by mengcuiguang's avatar mengcuiguang

代码优化

parent 7d4fae55
......@@ -17,7 +17,7 @@ var systemInfoMixin = {
}
},
mounted() {
const systemInfo = com.mingce.wxhelibookgetSystemInfoSync();
const systemInfo = wx.getSystemInfoSync();
this.sdkVersion = systemInfo.hostSDKVersion;
this.windowWidth = this.dataCheck(systemInfo.windowWidth);
this.windowHeight = this.dataCheck(systemInfo.windowHeight);
......
......@@ -147,7 +147,7 @@ function postPhone(data, callback) {
// 请求token
function requestToken(data, callback) {
let url = `${config["BASE_URL"]}/user/ttLogin`;
let url = `${config["BASE_URL"]}/user/wechatlogin`;
let header = {
pkgName: PAKEAGE_NAME,
version: VERSION_CODE,
......
......@@ -139,15 +139,10 @@
login({
vedioId: bookId,
code: res.code,
anonymousCode: res.anonymousCode,
thirdParam: thirdParam
})
},
fail(res) {
// 登录授权失败
uni.navigateTo({
url: `/pages/warehouse/warehousetemp`,
})
},
});
......
......@@ -198,7 +198,7 @@
signType: wxParams.signType,
paySign: wxParams.paySign,
success(res) {
that.queryOrderStatus(largeType,wxParams.sigData.outTradeNo);
that.queryOrderStatus(largeType,wxData.tidStr);
},
fail(res) {}
})
......
......@@ -6,7 +6,7 @@
margin-bottom: 30rpx;" src="https://mints-web.oss-cn-beijing.aliyuncs.com/images/ic_close_white.png"></image>
<view class="content">
<button class="button1" type="default" size="default" @click="tapMakePhoneCall">客服电话</button>
<button class="button2" open-type="im" data-im-id="93264117800">客服在线</button>
<!-- <button class="button2" open-type="im" data-im-id="93264117800">客服在线</button> -->
</view>
</view>
</uni-popup>
......
......@@ -55,13 +55,6 @@
},
onLoad() {
this.getCategoryData();
watchUserInfoChange((info) => {
this.userInfo = info.userInfo
}, this);
},
onShow() {
this.refreshUserData();
},
computed: {
showEmpty: function() {
......@@ -97,6 +90,17 @@
}
},
methods: {
show(){
console.log("123123123")
this.getCategoryData();
watchUserInfoChange((info) => {
this.userInfo = info.userInfo
}, this);
this.refreshUserData();
},
hide() {
},
readyCategory() {
setTimeout(() => {
this.initHeight()
......
<template>
<view class="body">
<view v-if="localActiviteFlag==1" class="body">
<view style="height: 92%;">
<bookshelf v-show="currentPage==0" ref="index" />
<warehouse v-show="currentPage==1" ref="recommend" />
......@@ -36,6 +36,12 @@
</view>
</view>
</view>
<view v-else class="body">
<view style="height: 95%;">
<warehouse v-show="currentPage==1" ref="recommend" />
</view>
</view>
</template>
<script>
......@@ -60,11 +66,14 @@
},
data() {
return {
currentPage: 1
currentPage: 1,
localActiviteFlag: 0
}
},
onLoad(options) {
let index = options.index ?? ''
this.localActiviteFlag = options.activiteFlag;
console.log("activiteFlag====", options.activiteFlag)
if (index != '' && index != undefined) {
this.currentPage = index
}
......@@ -87,10 +96,13 @@
// 渲染完成 初始化首页数据
this.loadComponentData();
if (this.localActiviteFlag == 1) {
let that = this
uni.$on('goWareHouse', function(data) {
that.tabChange(1)
})
}
},
methods: {
tabChange(index) {
......@@ -99,6 +111,7 @@
this.loadComponentData();
},
loadComponentData() {
if (this.localActiviteFlag == 1) {
if (this.currentPage == 0) {
this.$refs.index.show();
} else if (this.currentPage == 1) {
......@@ -106,6 +119,11 @@
} else if (this.currentPage == 2) {
this.$refs.user.show();
}
} else {
if (this.currentPage == 1) {
this.$refs.recommend.show();
}
}
}
}
}
......
......@@ -90,16 +90,13 @@
app.globalData.userId = data.idcode;
saveToken(data.token)
setTimeout(() => {
redirectTo('home');
// redirectTo('home?activiteFlag='+data.activiteFlag);
redirectTo('home?activiteFlag='+0);
}, 1000);
}
});
},
fail: function(err) {
// 登录授权失败
uni.navigateTo({
url: `/pages/warehouse/warehousetemp`,
})
}
});
}
......
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