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); + }, + }) + }, + + },