添加:扫码使用会员卡兑换码

This commit is contained in:
wuhui_zzw 2024-03-02 18:53:01 +08:00
parent e81e120d4e
commit 0a60118afc
3 changed files with 43 additions and 7 deletions

View File

@ -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);
}

View File

@ -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 = {

View File

@ -102,6 +102,7 @@
</navigator>-->
<view class="right-btn">
<!--<view class="iconfont icon-erweima1" v-if="isLogin" @click="showQrCode()"></view>-->
<view class="iconfont icon-saoyisao" v-if="isLogin" @click="scanCode()"></view>
<view class="iconfont icon-shezhi" v-if="isLogin" @click="goSetting()"></view>
<view class="btn" @click="authTo('/pages/chat/customer_list/index?type=0')" hover-class="none">
<view class="iconfont icon-xiaoxi"></view>
@ -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);
},
})
},
},