From bef074338d9dc1120503f86d7c52523e76d8ad64 Mon Sep 17 00:00:00 2001 From: wpf <2187978347@qq.com> Date: Mon, 18 Mar 2024 13:32:07 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/payment.js | 4 +++- components/Authorize.vue | 20 +++++++++++++++----- pages.json | 2 +- pages/payment/get_payment.vue | 34 ++++++++++++++++++---------------- 4 files changed, 37 insertions(+), 23 deletions(-) diff --git a/api/payment.js b/api/payment.js index 441e510..8b769a3 100644 --- a/api/payment.js +++ b/api/payment.js @@ -20,7 +20,9 @@ export function addCart(data) { * 根据店铺id 获取店铺信息 */ export function getProductInfo(data) { - return request.get(`scanPay/product`, data); + return request.get(`scanPay/product`, data, { + noAuth: true + }); } /** diff --git a/components/Authorize.vue b/components/Authorize.vue index 7674fcd..79fa858 100644 --- a/components/Authorize.vue +++ b/components/Authorize.vue @@ -6,7 +6,7 @@ --> - 授权提醒 + {{isPay?'付款提醒':'授权提醒'}} {{title}} @@ -16,7 +16,7 @@ {{title}} - 请授权头像等信息,以便为您提供更好的服务! + {{ isPay ? payInfo : '请授权头像等信息,以便为您提供更好的服务!'}} {{info}} @@ -26,7 +26,8 @@ {{info}} - 随便逛逛 + 取消 + 随便逛逛 @@ -38,7 +39,7 @@ @@ -89,7 +90,11 @@ isShowAuth: { type: Boolean, default: false - } + }, + isPay:{ + type: Boolean, + default: false + }, }, components: { // #ifdef MP @@ -108,6 +113,7 @@ title: '授权提醒', info: '请授权头像等信息,以便为您提供更好的服务!', //#endif + payInfo: '', canUseGetUserProfile: false, code: null, top: 0, @@ -146,6 +152,9 @@ this.editModal = false }, // #endif + setPayInfo(e){ + this.payInfo = e; + }, setAuthStatus() { //#ifdef MP Routine.authorize().then(res => { @@ -317,6 +326,7 @@ } .Popup .bottom .item { + flex: 1; width: 250rpx; height: 80rpx; background-color: #eeeeee; diff --git a/pages.json b/pages.json index 83c8c81..dc7a27f 100644 --- a/pages.json +++ b/pages.json @@ -112,7 +112,7 @@ { "path": "pages/payment/get_payment", "style": { - "navigationBarTitleText": "提货付款", + "navigationBarTitleText": "", "navigationStyle": "custom" } }, diff --git a/pages/payment/get_payment.vue b/pages/payment/get_payment.vue index 78e7720..eb4577d 100644 --- a/pages/payment/get_payment.vue +++ b/pages/payment/get_payment.vue @@ -52,8 +52,8 @@ {{tips}} - + @@ -70,7 +70,7 @@ mapGetters } from "vuex"; import authorize from '@/components/Authorize'; -import { Toast } from "../../libs/uniApi"; + import { Toast } from "../../libs/uniApi"; export default { components: { authorize @@ -92,6 +92,7 @@ import { Toast } from "../../libs/uniApi"; total_amount: '' }, merchantInfo: '', + mer_name: '', checkForm: { address_id: '', cart_id: [], @@ -114,19 +115,12 @@ import { Toast } from "../../libs/uniApi"; }, onShow() { if (!this.isLogin) { - Cache.set("login_back_url_weixin", "/" + getCurrentPages()[0].route + "?mer_id=" + this.mer_id); - this.isAuto = true; - this.isShowAuth = true; - if(this.isWeixin) { - this.tips = '加载中...'; - this.$nextTick(()=>{ - this.$refs.authRef.toWecahtAuth(); - }) - } - } else { - this.checkForm.cart_id = []; - this.getProductInfoByMerid(this.mer_id); + Cache.set("login_back_url_weixin", "/" + getCurrentPages()[0].route + "?mer_id=" + this.mer_id); + this.isAuto = true; + this.isShowAuth = true; } + this.checkForm.cart_id = []; + this.getProductInfoByMerid(this.mer_id); }, methods: { validateDecimal(event) { @@ -190,12 +184,20 @@ import { Toast } from "../../libs/uniApi"; getProductInfo({ mer_id: merid }).then(res => { - this.merchantInfo = res.data; + this.merchantInfo = res.data; + let mer_name = ''; + if(this.merchantInfo.merchant&&this.merchantInfo.merchant.mer_name) mer_name = this.merchantInfo.merchant.mer_name || ''; + this.$nextTick(()=>{ + this.$refs.authRef.setPayInfo(mer_name); + }) }).catch((err) => { this.tips = err.message || err.smg || err; this.$util.Tips({ title: err.message || err.msg || err }) + this.$nextTick(()=>{ + this.$refs.authRef.setPayInfo(''); + }) // #ifdef APP setTimeout(() => { uni.navigateBack({