fix:bug修复

This commit is contained in:
黄泽群
2026-07-22 17:18:26 +08:00
parent 53f1ebba18
commit 17ab8beefa
6 changed files with 237 additions and 179 deletions
+1 -7
View File
@@ -46,16 +46,10 @@
methods: {
leftJump() {
const leftPath = this.leftPath;
if(!leftPath){
return;
}
const leftPathType = this.leftPathType;
if(leftPathType === "navigateTo"){
// uni.navigateTo({
// url:leftPath,
// })
uni.navigateBack();
}else if(leftPathType === "switchTab"){
}else if(leftPathType === "switchTab" && leftPath){
uni.switchTab({
url: leftPath,
});
+205 -142
View File
@@ -79,6 +79,18 @@
</up-checkbox>
</view>
<up-toast ref="uToastRef"></up-toast>
<!-- 自定义协议弹窗 -->
<view v-if="showPolicyModal" class="modal-overlay" @click="showPolicyModal = false">
<view class="modal-content" @click.stop>
<view class="modal-title">温馨提示</view>
<view class="modal-message">请您阅读并同意《服务协议》与《隐私政策》</view>
<view class="modal-buttons">
<view class="modal-btn modal-btn-cancel" @click="showPolicyModal = false">取消</view>
<view class="modal-btn modal-btn-confirm" @click="handlePolicyConfirm">同意并登录</view>
</view>
</view>
</view>
</view>
</template>
@@ -109,106 +121,97 @@
const hyyAlipay = uni.requireNativePlugin("Hyy-Alipay");
// #endif
export default {
onLaunch: function() {
console.log("App Launch");
const res = uni.getSystemInfoSync();
uni.setStorageSync("platform", res.platform);
// #ifdef APP-PLUS
// 获取应用版本信息
plus.runtime.getProperty(plus.runtime.appid, function(inf) {
console.log("版本信息", inf.versionCode);
uni.setStorageSync("version-1", inf.version); // 大版本号
uni.setStorageSync("versionCode", inf.versionCode); // 小版本号
});
let uuid = plus.device.uuid;
// #endif
},
components: {
InputCodeComm,
},
data() {
return {
form: {
name: null,
password: null,
code: null,
},
inputCss: {
height: "80rpx",
background: "#F3F3F3FF",
"border-radius": "30rpx",
border: "0rpx",
"padding-left": "16px",
},
loginWay: "password",
isShow: false, // 是否显示
isPolicy: false, // 是否同意
countdown: false, // 清空倒计时
loading: false,
};
},
methods: {
onBack(){
console.log('onBack',)
uni.switchTab({
url:'/pages/home/home'
})
export default {
onLaunch: function () {
console.log("App Launch");
const res = uni.getSystemInfoSync();
uni.setStorageSync("platform", res.platform);
// #ifdef APP-PLUS
// 获取应用版本信息
plus.runtime.getProperty(plus.runtime.appid, function (inf) {
console.log("版本信息", inf.versionCode);
uni.setStorageSync("version-1", inf.version); // 大版本号
uni.setStorageSync("versionCode", inf.versionCode); // 小版本号
});
let uuid = plus.device.uuid;
// #endif
},
components: {
InputCodeComm,
},
data() {
return {
form: {
name: null,
password: null,
code: null,
},
aa() {
const nativiPlugin = uni.requireNativePlugin('WITTestUniPlugin');
console.log("隐藏原生tabbar", nativiPlugin)
nativiPlugin.testAsyncFunc({},
(ret) => {
uni.showToast({
title: '调用异步方法 ' + ret,
icon: "none"
})
console.log(ret);
});
inputCss: {
height: "80rpx",
background: "#F3F3F3FF",
"border-radius": "30rpx",
border: "0rpx",
"padding-left": "16px",
},
jumpHome() {
// const sysPlatform = getCurrentSysPlatform();
// if(sysPlatform === "android"){
// uni.switchTab({
// url: '/pages/message/message',
// })
// }else{
uni.switchTab({
url: "/pages/home/home",
loginWay: "password",
isShow: false,
isPolicy: false,
countdown: false,
loading: false,
showPolicyModal: false,
};
},
methods: {
onBack() {
console.log('onBack',)
uni.switchTab({
url: '/pages/home/home'
})
},
aa() {
const nativiPlugin = uni.requireNativePlugin('WITTestUniPlugin');
console.log("隐藏原生tabbar", nativiPlugin)
nativiPlugin.testAsyncFunc({},
(ret) => {
uni.showToast({
title: '调用异步方法 ' + ret,
icon: "none"
})
console.log(ret);
});
// }
},
async loginFun(val = {}) {
const then = this;
const form = this.form;
const params = {};
if (!this.isPolicy) {
uni.showModal({
title: '温馨提示',
content: '请您阅读并同意《服务协议》与《隐私政策》',
confirmText: "同意并登录",
success: (res) => {
if (res.confirm) {
this.isPolicy = true;
this.loginFun(val);
}
}
});
return;
}
let response = val;
if (this.loginWay === "password") {
params.mobile = form.name;
params.password = CryptoJS.MD5(form.password).toString();
response = await loginbypw(params);
}
if (this.loginWay === "code") {
params.mobile = form.name;
params.smsCode = form.code;
response = await loginbysms(params);
}
},
jumpHome() {
// const sysPlatform = getCurrentSysPlatform();
// if(sysPlatform === "android"){
// uni.switchTab({
// url: '/pages/message/message',
// })
// }else{
uni.switchTab({
url: "/pages/home/home",
});
// }
},
async loginFun(val = {}) {
const then = this;
const form = this.form;
const params = {};
if (!this.isPolicy) {
this.showPolicyModal = true;
return;
}
let response = val;
if (this.loginWay === "password") {
params.mobile = form.name;
params.password = CryptoJS.MD5(form.password).toString();
response = await loginbypw(params);
}
if (this.loginWay === "code") {
params.mobile = form.name;
params.smsCode = form.code;
response = await loginbysms(params);
}
const data = response.data;
setStorageFun(TOKEN_NAME, data.token);
@@ -419,48 +422,53 @@
return;
}
hyyAlipay.openAuthScheme({
appId: "2021005183625053", // 支付宝分配给开发者的应用 ID
scheme: "trustbridgeapp", // manifest.json -> "App常用其他设置" -> "UrlSchemes"里设置
},
(res) => {
console.log("支付宝回调", res);
alipayLogin({
isValid: false,
token: res.auth_code,
}).then((response) => {
console.log("支付宝登录接口返回:", response, !response.data.userId);
if (response && response.bizcode === 100) {
if (response.data.userId) {
// 登录
this.loginWay = "alipay";
this.loginFun(response);
} else {
// 去微信注册
uni.navigateTo({
url: `/pages/login_package/bind-phone/bind-phone?token=${response.data.token}&type=2`,
});
}
hyyAlipay.openAuthScheme({
appId: "2021005183625053", // 支付宝分配给开发者的应用 ID
scheme: "trustbridgeapp", // manifest.json -> "App常用其他设置" -> "UrlSchemes"里设置
},
(res) => {
console.log("支付宝回调", res);
alipayLogin({
isValid: false,
token: res.auth_code,
}).then((response) => {
console.log("支付宝登录接口返回:", response, !response.data.userId);
if (response && response.bizcode === 100) {
if (response.data.userId) {
// 登录
this.loginWay = "alipay";
this.loginFun(response);
} else {
this.$refs.uToastRef.show({
type: "error",
message: response.msg || "微信登录失败",
// 去微信注册
uni.navigateTo({
url: `/pages/login_package/bind-phone/bind-phone?token=${response.data.token}&type=2`,
});
}
});
}
);
},
} else {
this.$refs.uToastRef.show({
type: "error",
message: response.msg || "微信登录失败",
});
}
});
}
);
},
computed: {
isIOS() {
// #ifdef APP-PLUS
return uni.getSystemInfoSync().platform === "ios";
// #endif
return false;
},
handlePolicyConfirm() {
this.showPolicyModal = false;
this.isPolicy = true;
this.loginFun();
},
};
},
computed: {
isIOS() {
// #ifdef APP-PLUS
return uni.getSystemInfoSync().platform === "ios";
// #endif
return false;
},
},
};
</script>
<style lang="scss" scoped>
@@ -527,13 +535,68 @@
padding: 0 100rpx;
justify-content: center;
.login_other_item {
display: flex;
flex: 50%;
font-size: 28rpx;
flex-direction: column;
align-items: center;
margin-bottom: 80rpx;
}
.login_other_item {
display: flex;
flex: 50%;
font-size: 28rpx;
flex-direction: column;
align-items: center;
margin-bottom: 80rpx;
}
}
.modal-overlay {
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
background: rgba(0, 0, 0, 0.5);
display: flex;
align-items: center;
justify-content: center;
z-index: 1000;
}
.modal-content {
width: 500rpx;
background: #fff;
border-radius: 20rpx;
padding:24rpx;
text-align: center;
}
.modal-title {
font-size: 36rpx;
font-weight: bold;
color: #333;
margin-bottom: 30rpx;
}
.modal-message {
font-size: 28rpx;
color: #666;
line-height: 1.6;
margin-bottom: 40rpx;
}
.modal-buttons {
display: flex;
}
.modal-btn {
flex: 1;
height: 80rpx;
line-height: 80rpx;
font-size: 30rpx;
}
.modal-btn-cancel {
color: #999;
border-right: 1rpx solid #eee;
}
.modal-btn-confirm {
color: #7934F6;
}
</style>
+3 -3
View File
@@ -11,7 +11,7 @@
<text style="margin-right: 20rpx">{{ currentUserData.nickname || '信任桥用户' }}</text>
<view class="level level-grade" @click="jumpToTrustBridge" v-if="currentUserData.agentName">
<up-image src="https://static.tbmall.xin/static/mine/rz.png"
<up-image src="/static/common/rz.png"
style="margin-right: 8rpx; margin-top: 6rpx" shape="circle" width="13" height="13"
bgColor="#f1f6ff00"></up-image>
<view>{{ currentUserData.agentName }}</view>
@@ -680,8 +680,8 @@ export default {
}
&.level-grade {
background: rgba(122, 53, 246, 0.1);
color: #7a35f6;
background: rgba(248,185,75,0.15);
color: #613700;
}
}
@@ -1,6 +1,6 @@
<template>
<view class="order_submit_warp">
<Header leftTitle="提交订单" leftPathType="switchTab" leftPath="/pages/shopping_cart/shopping_cart" />
<Header leftTitle="提交订单" :leftPathType="leftPathType" :leftPath="leftPath" />
<!-- 收件人信息 -->
<view class="order_submit_header_warp" @click="checkAddressShow(true, 'data')"
v-if="orderInfo.address && Object.keys(orderInfo.address).length !== 0">
@@ -261,11 +261,9 @@
<view class="address_popup_warp">
<view class="address_popup_title">收件地址</view>
<view class="address_popup_content">
<view class="address_popup_content_add" @click="addAdress">
+ 新增地址</view>
<Address @valueFunc="getAddressValueFunc" />
</view>
<view class="popup_but" @click="addressOk"> 确认 </view>
<view class="popup_but" @click="addAdress"> 新增地址 </view>
</view>
</up-popup>
<u-modal :show="tipsShow" v-if="tipsShow" title="提示" showCancelButton @cancel="onCancel" @confirm="onConfirm"
@@ -364,6 +362,8 @@ export default {
isShow: false,
addressListOne: [],
ids: 0,
leftPathType: "switchTab",
leftPath: "/pages/shopping_cart/shopping_cart",
orderInfo: {
// coupon:2,//优惠卷
paymentMethod: PAYMENT_WAY.ALIPAY, // 支付方式,暂时默认用支付宝
@@ -409,6 +409,8 @@ export default {
if (option.sed) {
this.isPoints = 1;
this.sed = JSON.parse(option.sed);
this.leftPathType = "navigateTo";
this.leftPath = null;
await this.addressList();
// console.log('addressListOne',this.addressListOne)
// if(this.addressListOne && this.addressListOne.length){
@@ -1005,14 +1007,10 @@ export default {
}
},
// 地址选中
getAddressValueFunc(item) {
async getAddressValueFunc(item) {
const addressObj = item;
addressObj.addressStr = assembleAddress(addressObj).names;
this.selectAddress = addressObj;
},
// 地址选中OK
async addressOk() {
console.log("this.selectAddress", this.selectAddress);
const type = this.addressType;
const addressIndex = this.addressIndex;
const shopsIndex = this.shopsIndex;
@@ -1022,7 +1020,7 @@ export default {
this.orderInfo.shops[shopsIndex].addrTimes[addressIndex].address =
this.selectAddress;
}
this.addressShow = this.false;
this.addressShow = false;
if (this.selectAddress && !this.sed) {
const params = {
cartIds: this.ids,
@@ -1040,7 +1038,7 @@ export default {
});
}
data.shops = shops;
data.paymentMethod = null; // 支付方式
data.paymentMethod = null;
this.orderInfo = data;
}
}
+14 -13
View File
@@ -1190,7 +1190,7 @@ export default {
};
console.log("selectTempl", selectTempl);
if (this.isShowCart == 1 || this.isCoupon) {
if (this.isShowCart == 1 || this.isCoupon || isBy) {
console.log("活动类型params---秦星星", params, this.isCoupon);
params["specsId"] = selectTempl;
let url = "";
@@ -1208,6 +1208,13 @@ export default {
)}&address=${this.selectAddress?.id}&isCoupon=${this.isCoupon}`
}
if (!url) {
url = `/pages/order_package/order_submit/order_submit?sed=${JSON.stringify(
params
)}&address=${this.selectAddress?.id}`;
this.specificationShow = false;
}
uni.navigateTo({
url: url
});
@@ -1215,18 +1222,12 @@ export default {
}
const resp = await addGoods(params);
if (resp && resp.bizcode === 100) {
if (isBy) {
uni.navigateTo({
url: `/pages/order_package/order_submit/order_submit?ids=${resp.data}&address=${this.selectAddress?.id}`,
});
} else {
this.specificationShow = false;
uni.showToast({
title: "成功加入购物车",
icon: "success", // 可选 success/loading/none
duration: 2000, // 持续时长,单位ms
});
}
this.specificationShow = false;
uni.showToast({
title: "成功加入购物车",
icon: "success", // 可选 success/loading/none
duration: 2000, // 持续时长,单位ms
});
}
},
// 跳转到分享页面
+5 -3
View File
@@ -5,7 +5,7 @@
<template v-slot:left>
<view class="header-left-content">
<u-icon size="36rpx" name="arrow-left" color="#000" @click="goback"></u-icon>
<up-image src="https://static.tbmall.xin/static/mine-purse/vcoin.png" width="22" height="22"
<up-image src="https://static.tbmall.xin/static/mine-purse/vcoin.png" width="18" height="18"
bgColor="#f1f6ff00" class="purse_amount"></up-image>
<text class="header-text">数字积分兑换专区: {{ balanceData.curAmount || 0 }}</text>
</view>
@@ -196,14 +196,16 @@ export default {
.header-text {
font-size: 28rpx;
color: #333;
margin-left: 18rpx;
}
.purse_amount{
width: 36rpx;
height: 36rpx;
margin: 0 12rpx;
display: flex;
margin-top: 8rpx;
align-items: center;
justify-content: center;
vertical-align: middle;
}
.bottom-btn {
width: 100%;
@@ -276,4 +278,4 @@ export default {
grid-gap: 12rpx;
}
}
</style>
</style>