Commit ffb43c6d by yuzhenWang

修改bug,发布测试

parent 390791bf
......@@ -141,14 +141,30 @@
} catch (err) {
console.error('检查用户状态失败:', err);
}
}
return
}else {
this.checkToken()
}
},
// 清除登录状态
clearLoginState() {
uni.clearStorageSync();
uni.setStorageSync('loginType', 'visitor');
this.checkToken()
// 可以在这里添加其他需要清除的状态
},
// 未登录状态下需要重新获取token
checkToken(){
api.checkToken().then(res=>{
if(res['success']){}else{
api.obtainToken().then(res=>{
if(res.success){
uni.setStorageSync('uni-token',res.data['token']);
}
})
}
})
},
// 处理外部链接参数
handleExternalUrlParams() {
// #ifdef H5
......
......@@ -5,7 +5,7 @@
<view class="imgContainer">
<image
style="display: block;"
src="@/static/images/shareBg.png"
src="@/static/images/sharePoster.png"
mode="widthFix"
@load="handleBgImageLoad"
@error="handleBgImageError"
......@@ -24,10 +24,6 @@
<view class="preview-container" v-if="generatedImage">
<image :src="generatedImage" mode="widthFix" class="preview-image"></image>
</view>
<view class="bottomBox">
长按保存图片分享给好友
</view>
</view>
</template>
......@@ -270,13 +266,68 @@ export default {
</script>
<style lang="scss" scoped>
// .container {
// display: flex;
// flex-direction: column;
// height: 100vh;
// width: 100vw;
// .imgBox {
// position: relative;
// .imgContainer {
// position: relative;
// .qrcode-container {
// position: absolute;
// bottom: 10rpx;
// right: 10rpx;
// background: #fff;
// padding: 10rpx;
// border-radius: 10rpx;
// box-shadow: 0 0 10rpx rgba(0,0,0,0.1);
// .qrcode-canvas {
// display: block;
// }
// }
// }
// }
// .preview-container{
// box-sizing: border-box;
// flex: 1;
// padding: 30rpx;
// width: 100%;
// height: 100%;
// .preview-image {
// width: 100%;
// height: auto;
// max-height: 100%;
// object-fit: contain;
// }
// }
// }
.container {
display: flex;
flex-direction: column;
height: 100vh;
width: 100vw;
overflow: hidden;
.imgBox {
position: relative;
width: 100%;
height: auto;
.imgContainer {
width: 100%;
position: relative;
image {
width: 100%;
height: auto;
display: block;
}
.qrcode-container {
position: absolute;
bottom: 10rpx;
......@@ -285,38 +336,28 @@ export default {
padding: 10rpx;
border-radius: 10rpx;
box-shadow: 0 0 10rpx rgba(0,0,0,0.1);
.qrcode-canvas {
display: block;
}
}
}
}
.bottomBox {
// flex: 1;
border-radius: 20rpx 20rpx 0 0;
height: 200rpx;
width: 100%;
display: flex;
align-items: center;
justify-content: center;
flex-direction: column;
background-color: #fff;
font-size: 28rpx;
button {
margin-top: 20rpx;
.preview-container {
flex: 1;
width: 100%;
height: 100%;
display: flex;
justify-content: center;
align-items: center;
overflow: hidden;
.preview-image {
height: 100%; /* 让高度占满屏幕 */
width: auto; /* 宽度自动调整 */
object-fit: fill;
}
}
.preview-container{
box-sizing: border-box;
flex: 1;
padding: 80rpx 30rpx 0rpx 30rpx;
.preview-image {
width: 100%;
}
}
}
</style>
\ No newline at end of file
......@@ -265,6 +265,7 @@
}
})
this.releaseScroll()
this.checkToken()
}
})
},
......@@ -273,6 +274,19 @@
delta: 1
});
},
// 未登录状态下需要重新获取token
checkToken(){
api.checkToken().then(res=>{
if(res['success']){}else{
api.obtainToken().then(res=>{
if(res.success){
uni.setStorageSync('uni-token',res.data['token']);
uni.setStorageSync('loginType', 'visitor');
}
})
}
})
},
cancel(){
uni.navigateBack({delta:1})
},
......
......@@ -312,6 +312,7 @@
//分享
this.initShare();
this.getOneProduct()
},
onLoad(options) {
if(options.sharePoster){
......@@ -729,7 +730,22 @@
onChange: function(e) {
this.old.x = e.detail.x
this.old.y = e.detail.y
}
},
getOneProduct() {
api.courseList().then(res => {
if (res['success']) {
let result = res['data']['data'];
if(result.length>0){
result.forEach(item=>{
if(item.productCode&&item.productCode=='C09'){
this.productItem = item
uni.setStorageSync('productItem',this.productItem );
}
})
}
}
})
},
},
}
</script>
......
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