From 7c2e14772a1bb48eecc80236377de68803b03210 Mon Sep 17 00:00:00 2001 From: "DESKTOP-8FGKA8Q\\chunfen" Date: Fri, 9 May 2025 19:23:58 +0800 Subject: [PATCH] =?UTF-8?q?APP=E7=99=BB=E5=BD=95=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=E8=B4=A6=E5=8F=B7=E5=AF=86=E7=A0=81=E7=99=BB=E5=BD=95=E6=B5=81?= =?UTF-8?q?=E7=A8=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- App.vue | 2 +- api/index.js | 4 ++-- components/sku/directPay.vue | 3 ++- manifest.json | 4 ++-- pages/pay/index.vue | 3 ++- pages/user/index.vue | 19 ++++++++++++++++--- pages/user/info.vue | 2 ++ pages/user/login.vue | 28 ++++++++++++---------------- pages/user/setpwd.vue | 26 +++++++++----------------- 9 files changed, 48 insertions(+), 43 deletions(-) diff --git a/App.vue b/App.vue index b4cbc28..e13dad6 100644 --- a/App.vue +++ b/App.vue @@ -6,7 +6,7 @@ export default { onLaunch: function(options) { - this.authLogin(options.scene, options.query.source || '') + // this.authLogin(options.scene, options.query.source || '') getShopInfo() // this.isLogin() // this.judgeLogin() diff --git a/api/index.js b/api/index.js index d8cedc8..0f4bd39 100644 --- a/api/index.js +++ b/api/index.js @@ -1,8 +1,8 @@ const url = 'https://shop.chutang66.com' // 正式 // const url = 'https://shop.dev.chutang66.com' // 测试 // const url = 'http://warehouse.dev.chutang66.com' // 测试 -// const url = 'http://192.168.99.31:8095' // 本地1 -// const url = 'http://192.168.88.6:8092' // 本地2 +// const url = 'http://192.168.31.70:82' // 本地1 +// const url = 'http://192.168.30.6:8092' // 本地2 const appId = 'wx73163c7bace1750b' const protoId = 'gh_ca74730c9f77' const webUrl = 'http://uniapp.dcloud.io' diff --git a/components/sku/directPay.vue b/components/sku/directPay.vue index 2d5e479..8a27871 100644 --- a/components/sku/directPay.vue +++ b/components/sku/directPay.vue @@ -1162,7 +1162,8 @@ use_coupons: data.use_coupons, scene: uni.getEnterOptionsSync().scene, score_cash: data.is_use_score, - pay_type: data.pay_method == 'wxpay' ? 1 : 2 + pay_type: data.pay_method == 'wxpay' ? 1 : 2, + channel: 'app' } if(data.needReal) { params.identity_card_id = realInfo.value.id diff --git a/manifest.json b/manifest.json index 9d3c4a7..5cb4cba 100644 --- a/manifest.json +++ b/manifest.json @@ -2,8 +2,8 @@ "name" : "妙选商城", "appid" : "__UNI__743F2C0", "description" : "", - "versionName" : "1.0.6", - "versionCode" : 106, + "versionName" : "1.0.7", + "versionCode" : 107, "transformPx" : false, /* 5+App特有相关 */ "app-plus" : { diff --git a/pages/pay/index.vue b/pages/pay/index.vue index 0a398f9..945a1ab 100644 --- a/pages/pay/index.vue +++ b/pages/pay/index.vue @@ -833,7 +833,8 @@ scene: uni.getEnterOptionsSync().scene, gift_goods_ids: data.gift_ids, score_cash: data.is_use_score, - pay_type: data.pay_method == 'wxpay' ? 1 : 2 + pay_type: data.pay_method == 'wxpay' ? 1 : 2, + channel: 'app' } if(data.needReal) { params.identity_card_id = realInfo.value.id diff --git a/pages/user/index.vue b/pages/user/index.vue index e6dc307..87c5e00 100644 --- a/pages/user/index.vue +++ b/pages/user/index.vue @@ -115,7 +115,7 @@ - + 设置密码 @@ -191,7 +191,9 @@ export default { count: {}, showFill: false, score_on: 0, - statusBarHeight: 0 + statusBarHeight: 0, + showSet: false, + isIOS: false }) const user = reactive({ @@ -246,6 +248,12 @@ export default { data.user_bg = res.user_background_img } + function getUserInfo() { + get('/api/v1/user/detail').then((res) => { + data.showSet = res.data.mobile ? true : false + }) + } + return { ...toRefs(data), ...toRefs(user), @@ -253,17 +261,22 @@ export default { toOrder, getUserNum, toVip, - getStoreInfo + getStoreInfo, + getUserInfo } }, async onLoad(options) { // await this.$onLaunched + if (plus.os.name === 'iOS') { + this.isIOS = true + } uni.getSystemInfo({ success: (res) => { this.statusBarHeight = res.statusBarHeight } }) this.getStoreInfo() + this.getUserInfo() }, onShow() { this.cartNum = Number(uni.getStorageSync('cartNum')) || 0 diff --git a/pages/user/info.vue b/pages/user/info.vue index 033aa67..09a718b 100644 --- a/pages/user/info.vue +++ b/pages/user/info.vue @@ -216,6 +216,8 @@ import { func } from '../../uni_modules/uview-plus/libs/function/test' uni.removeStorageSync('expires_in') uni.removeStorageSync('login_type') uni.removeStorageSync('unionid_open') + uni.removeStorageSync('msgNum') + uni.removeStorageSync('cartNum') uni.switchTab({ url: '/pages/index/index' }) diff --git a/pages/user/login.vue b/pages/user/login.vue index 8832636..a604161 100644 --- a/pages/user/login.vue +++ b/pages/user/login.vue @@ -94,6 +94,7 @@ logo: uni.getStorageSync('logo'), Checked: false, Color: uni.getStorageSync('theme_color'), + shopId: uni.getStorageSync('shop_id'), error: '', login_error: '', authResult: '', @@ -325,21 +326,17 @@ mobile: data.mobile, password: data.password } - post('/api/app/login/mobile/code/validate', params).then(async(res) => { - if(res.data.from == 'mini-app') { // 已经注册过小程序 - await unionidLogin('abcdefg', res.data.shop_id, res.data.unionid_open) + post('/api/app/login/mobile/loginByPwd', params).then(async(res) => { + if(res.data.login_code == 0) { // 已经注册过小程序 + await unionidLogin('abcdefg', data.shopId, res.data.unionid_open) uni.hideLoading() } else { - uni.setStorageSync('avatar', res.data.avatar) - uni.setStorageSync('nickname', res.data.nickname) - uni.setStorageSync('shop_id', res.data.shop_id) - uni.setStorageSync('login_type', res.data.from) - uni.setStorageSync('unionid_open', res.data.unionid_open) - uni.hideLoading() - uni.reLaunch({ - url: '/pages/index/index' - }) + showToast('账号不存在') } + }).catch((err) => { + console.log(err) + uni.hideLoading() + showToast('账号密码错误') }) } else { showToast('请勾选《用户协议》和《隐私政策》') @@ -392,10 +389,9 @@ }, async onLoad(options) { // await this.$onLaunched - this.showOther = true - // if (plus.os.name === 'iOS') { - // this.showOther = true - // } + if (plus.os.name === 'iOS') { + this.showOther = true + } let login_type = uni.getStorageSync('login_type') if(login_type == 'mobile') { // 已经手机号登陆,未授权微信 uni.redirectTo({ diff --git a/pages/user/setpwd.vue b/pages/user/setpwd.vue index 3e6b38e..507a2bd 100644 --- a/pages/user/setpwd.vue +++ b/pages/user/setpwd.vue @@ -50,6 +50,8 @@ return showToast('请输入密码') } else if(!data.password_again) { return showToast('请输入确认密码') + } else if(data.password != data.password_again) { + return showToast('两次密码输入不一致') } uni.showLoading({ title: '加载中...', @@ -57,23 +59,13 @@ }) let params = { password: data.password, - password_again: data.password_again + confirm_password: data.password_again } - post('/api/app/login/mobile/code/validate', params).then(async(res) => { - if(res.data.from == 'mini-app') { // 已经注册过小程序 - await unionidLogin('abcdefg', res.data.shop_id, res.data.unionid_open) - uni.hideLoading() - } else { - uni.setStorageSync('avatar', res.data.avatar) - uni.setStorageSync('nickname', res.data.nickname) - uni.setStorageSync('shop_id', res.data.shop_id) - uni.setStorageSync('login_type', res.data.from) - uni.setStorageSync('unionid_open', res.data.unionid_open) - uni.hideLoading() - uni.reLaunch({ - url: '/pages/index/index' - }) - } + post('/api/app/login/mobile/setPassword', params).then(async(res) => { + showToast('设置成功', 'success') + setTimeout(() => { + uni.navigateBack({delta:1}) + }, 1000) }) } @@ -120,7 +112,7 @@ background-color: v-bind('Color'); color: #fff; border-radius: 80rpx; - margin: 24rpx auto; + margin: 80rpx auto 0; } }