From 0a60118afc5146c23148531cc307892e01361bba Mon Sep 17 00:00:00 2001 From: wuhui_zzw <1760308791@qq.com> Date: Sat, 2 Mar 2024 18:53:01 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=EF=BC=9A=E6=89=AB=E7=A0=81?= =?UTF-8?q?=E4=BD=BF=E7=94=A8=E4=BC=9A=E5=91=98=E5=8D=A1=E5=85=91=E6=8D=A2?= =?UTF-8?q?=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/user.js | 5 ++++- config/app.js | 8 ++++---- pages/user/index.vue | 37 +++++++++++++++++++++++++++++++++++-- 3 files changed, 43 insertions(+), 7 deletions(-) diff --git a/api/user.js b/api/user.js index 4a92dd9..d9598b5 100644 --- a/api/user.js +++ b/api/user.js @@ -711,7 +711,10 @@ export function createQRcode(data) { export function writeOff(data) { return request.post("coupon/write_off", data); } - +// 完成核销操作 +export function vipExchangeCode(data) { + return request.post("sVip/vipExchangeCode", data); +} diff --git a/config/app.js b/config/app.js index 6a45260..e76d97b 100644 --- a/config/app.js +++ b/config/app.js @@ -6,13 +6,13 @@ let VUE_APP_WS_URL = `ws://${location.hostname}?type=user` let openPlantGrass = '-openPlantGrass-' // 网络接口修改此字符 小程序域名要求https -// let httpApi = 'https://bt.test.cdlfjy.com/' // 开发 -let httpApi = 'https://mp.scwmbh.cn/' // 生产 +let httpApi = 'https://bt.test.cdlfjy.com/' // 开发 +// let httpApi = 'https://mp.scwmbh.cn/' // 生产 // 聊天接口修改此字符 小程序聊天要求wss 例如: -// let wsApi = 'wss://bt.test.cdlfjy.com' -let wsApi = 'wss://mp.scwmbh.cn' +let wsApi = 'wss://bt.test.cdlfjy.com' +// let wsApi = 'wss://mp.scwmbh.cn' module.exports = { diff --git a/pages/user/index.vue b/pages/user/index.vue index d49faff..d73e724 100644 --- a/pages/user/index.vue +++ b/pages/user/index.vue @@ -102,6 +102,7 @@ --> + @@ -317,7 +318,7 @@ import spread from "../../libs/spread"; let sysHeight = uni.getSystemInfoSync().statusBarHeight + 'px'; - import { getMenuList, getUserInfo, setVisit } from '@/api/user.js'; + import { getMenuList, getUserInfo, setVisit, vipExchangeCode } from '@/api/user.js'; import { getVersion, getNavigation } from "@/api/public"; import { orderData } from '@/api/order.js' import { mapGetters } from "vuex"; @@ -790,7 +791,39 @@ // url: `/pages/agent/center?agent_id=${agentInfo.id}` url: path }) - } + }, + // 扫码 + scanCode(){ + let _this = this; + wx.scanCode({ + success(res) { + let result = res.result || ''; + if(result){ + vipExchangeCode({ + exchange_code: result + }).then(res => { + if(res.status == 200){ + uni.showModal({ + title: '开通成功', + success: (res) => { + uni.navigateTo({ + url: '/pages/annex/vip_center/index' + }); + } + }); + } + }).catch(err => { + _this.$util.Tips({title: err}); + }); + } + }, + fail(res) { + console.log(res); + }, + }) + }, + + },