Commit f1d838da authored by xd's avatar xd

侧边栏优惠券修改未测试

parent 5fdc149f
......@@ -149,18 +149,18 @@ export default {
},
manInfo: {
bk_logoUrl: "https://ezhq.xyz/img/main/logo_sona.jpg",
logoUrl: "/photo.png",
barFrom: "alice",
barName: "未配置",
logoUrl: "",
barFrom: "",
barName: "",
icon: {
"1": "/mainSale/icon-arrow-right-light.png"
}
},
barInfo: {
fans: "0",
personalFans: "0",
newFans: "0",
allNewFans: "0"
fans: "",
personalFans: "",
newFans: "",
allNewFans: ""
},
menuInfo: {
icon: {
......@@ -231,8 +231,8 @@ export default {
};
},
created() {
this.overlayShow = true
this.checkNowMenuBar();
console.log('created')
this.checkNowMenuBar()
if (sessionStorage.getItem("userId")) {
if (sessionStorage.getItem("avatar")) {
this.test.manInfo.logoUrl = sessionStorage.getItem("avatar");
......@@ -256,10 +256,10 @@ export default {
this.flag = sessionStorage.getItem("role");
}
} else {
this.zReadyUserId();
this.zTestGetNowUrlInfo();
this.zReadyUserId()
this.zTestGetNowUrlInfo()
}
this.GET_CurrentActive();
this.GET_CurrentActive()
},
methods: {
// 跳转到 活动详情
......@@ -283,7 +283,7 @@ export default {
GET_CurrentActive() {
getCurrentActive().then(res => {
this.currentActives = res.data || [];
});
})
},
// 获取用户角色
getDirector(userId) {
......@@ -319,12 +319,12 @@ export default {
console.log(err);
});
},
// 获取个人粉丝
getFans() {
let headerData = {
agentId: "1000033",
corpId: "ww4df265003b43fa0d"
};
axios({
url:
"http://139.155.48.151:8085/workWx/auth/contact/listExternalContacts?userId=" +
......@@ -340,6 +340,7 @@ export default {
console.log(err);
});
},
// 获取店铺所有粉丝
getAllFans() {
let headerData = {
agentId: "1000033",
......@@ -367,9 +368,11 @@ export default {
console.log(err)
});
},
// 获取个人新增粉丝
getNewFans() {
this.getAddFans(1, this.zcache.userId);
},
// 获取店铺所有新增粉丝
getAllNewFans() {
let params = {
oyStallCode: this.oyStallCode
......@@ -473,13 +476,13 @@ export default {
this.$router.push(inData);
},
menuCase() {
this.$router.push({ path: "/case" });
this.$router.push({ path: "/case" })
},
menuProfit() {
this.$router.push({ path: "/profitList" });
this.$router.push({ path: "/profitList" })
},
menuTask() {
this.$router.push({ path: "/taskList" });
this.$router.push({ path: "/taskList" })
},
// 获取code
zReadyUserId() {
......@@ -499,6 +502,8 @@ export default {
this.url = this.zcache.nowUrl;
},
zTestPreAuthCode() {
console.log('获取code')
this.overlayShow = true
// alert('获取code')
const basicInfo = {
head: "https://open.weixin.qq.com/connect/oauth2/authorize?",
......
......@@ -155,4 +155,12 @@ export function getHistoryList(data) {
method: 'put',
params
})
}
// 获取部门 用于修改
export function getEditOrg(params) {
return request({
url: '/admin/auth/addressbook/orgnization/getAllForUpdate',
method: 'get',
params
})
}
\ No newline at end of file
......@@ -66,7 +66,7 @@
</template>
<script>
import { editDept, getWxAllDeptList, getAllMemberList,getGroupById,getAllPeopleList,getOrgTree,getDeptDetail } from "@/api/in/mail";
import { editDept, getWxAllDeptList, getAllMemberList,getGroupById,getAllPeopleList,getDeptDetail,getEditOrg } from "@/api/in/mail";
import { log } from "util";
export default {
......@@ -208,8 +208,13 @@ export default {
console.log(val,'val')
},
getOrgTree() {
getOrgTree().then(res => {
this.orgTree = [res.data.organizations]
let params = {
deptId: this.groupId
}
getEditOrg(params).then(res => {
console.log(res,'数据111');
this.orgTree = [res.data]
})
},
handleParentChange(val) {
......
......@@ -199,25 +199,33 @@
const cleanUrlAndPostQRInfo = () => {
// alert(`--->qrCode: cleanUrlAndPostQRInfo: IN.`)
let nowUrl = ''
let id = ''
let actionid = ''
let activeId = ''
let voucherId = ''
let unionId = ''
nowUrl = document.location.toString().slice(42);
// alert(`--->nowUrl =${nowUrl}`)
id = String(nowUrl.split("?")[1].slice(3).split("&")[0]);
actionid = String(nowUrl.split("?")[1].slice(3).split("&")[1].split("=")[1]);
activeId = String(nowUrl.split("?")[1].slice(3).split("&")[2].split("=")[1]);
voucherId = String(nowUrl.split("?")[1].slice(3).split("&")[3].split("=")[1]);
unionId = String(nowUrl.split("?")[1].slice(3).split("&")[4].split("=")[1]);
// let nowUrl = ''
// let id = ''
// let actionid = ''
// let activeId = ''
// let voucherId = ''
// let unionId = ''
// nowUrl = document.location.toString().slice(42)
// id = String(nowUrl.split("?")[1].slice(3).split("&")[0])
// actionid = String(nowUrl.split("?")[1].slice(3).split("&")[1].split("=")[1])
// activeId = String(nowUrl.split("?")[1].slice(3).split("&")[2].split("=")[1])
// voucherId = String(nowUrl.split("?")[1].slice(3).split("&")[3].split("=")[1])
// unionId = String(nowUrl.split("?")[1].slice(3).split("&")[4].split("=")[1])
// let pageUri = `${nowUrl}&detailid=${voucherId}&actionid=${activeId}&unionid=${unionId}`;
let pageUri = `${nowUrl}`;
pageUri = pageUri.split('&').slice(0, 5).join('&')
let pageUrl = `http://139.155.48.151:8085/workWx/auth/oauth2/wxMiniQrCode?pageUri=${pageUri}`;
function GetQueryString(name) {
var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
var r = window.location.search.substr(1).match(reg)
var context = ""
if (r != null)
context = r[2]
reg = null
r = null
return context == null || context == "" || context == "undefined" ? "" : context;
}
const nowUrl= GetQueryString('Url')
let pageUrl = `http://139.155.48.151:8085/workWx/auth/oauth2/wxMiniQrCode?pageUri=${nowUrl}`;
// document.getElementById('uri').innerHTML = 'Uri=' + String(pageUri)
......
......@@ -107,33 +107,33 @@ export default {
if(res.data.length == 0) {
alert('您当前没有绑定店铺')
}else {
this.zcache.storeId = res.data[0].oyStallCode
this.zReadySetVoucherList()
// this.zcache.storeId = res.data[0].oyStallCode
res.data.forEach(item => {
this.zReadySetVoucherList(item.id)
})
}
})
.catch(err => {})
},
// 获取优惠券列表
zReadySetVoucherList() {
this.zReadyDelVoucherList();
zReadySetVoucherList(mdid) {
// this.zReadyDelVoucherList()
const postData = {
appCode: "0696", // j接口编码
mdid: this.zcache.storeId
mdid: mdid
}
getVoucherList(postData).then(res => {
if(res.errCode == 0) {
if(res.result.coupons.length != 0) {
this.zlist.voucher.push(...res.result.coupons)
}
else {
this.zVoucherSet(res.result.coupons)
console.log(this.zlist.voucher,'this.zlist.voucher')
}
}
})
.catch(err => {
})
})
.catch(err => {
})
},
zReadyDelVoucherList() {
this.zVoucherDel()
......@@ -143,8 +143,7 @@ export default {
zVoucherPick(inActiveId, inVoucherId) {
this.zcache.now.activeId = String(inActiveId)
this.zcache.now.voucherId = String(inVoucherId)
this.zVoucherUrlDel()
this.zlist.voucherUrl = "";
const postData = {
appCode: "0697",
......@@ -152,6 +151,7 @@ export default {
coupon_id: Number(inVoucherId)
}
getVoucherWxUrl(postData).then(res => {
console.log(res,'指向小程序的链接')
this.zVoucherUrlSet(res.result.link)
});
},
......@@ -185,7 +185,7 @@ export default {
{
msgtype: "news", //消息类型,必填
news: {
link: `http://oysales.oywanhao.com/qrCode?Url=${inUrl}&activeId=${this.zcache.now.activeId}&voucherId=${this.zcache.now.voucherId}&unionId=1234`, //H5消息页面url 必填
link: `http://oysales.oywanhao.com/qrCode?Url=${inUrl}`, //H5消息页面url 必填
title: "领取优惠券", //H5消息标题
desc: inUrl, //H5消息摘要
imgUrl: inUrl //H5消息封面图片URL
......@@ -208,11 +208,6 @@ export default {
break;
}
},
zVoucherSet(inArray) {
// alert('zVoucherSet')
this.zlist.voucher = inArray;
},
zVoucherDel() {
this.zlist.voucher = [];
},
......@@ -220,10 +215,6 @@ export default {
this.zlist.voucherUrl = String(inData);
this.zpick('h5', String(inData))
},
zVoucherUrlDel() {
this.zlist.voucherUrl = "";
},
testEaPost() {
let postData = {
appCode: "0696",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment