Commit fe81399e authored by xd's avatar xd

维护信息未成功

parent aa19b01b
...@@ -17,6 +17,7 @@ ...@@ -17,6 +17,7 @@
"jssdk": "^0.0.1", "jssdk": "^0.0.1",
"vant": "^2.5.9", "vant": "^2.5.9",
"vconsole": "^3.3.4", "vconsole": "^3.3.4",
"vee-validate": "^3.2.5",
"vue": "^2.6.10", "vue": "^2.6.10",
"vue-quill-editor": "^3.0.6", "vue-quill-editor": "^3.0.6",
"vue-router": "^3.1.6", "vue-router": "^3.1.6",
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
<head> <head>
<meta charset="UTF-8"> <meta charset="UTF-8">
<title>会员拉新</title> <title>专柜首页</title>
<link rel="stylesheet" href="../css/swiper.css" /> <link rel="stylesheet" href="../css/swiper.css" />
<link rel="stylesheet" href="../css/iconfont.css"> <link rel="stylesheet" href="../css/iconfont.css">
<script src="../js/jquery-3.4.1.min.js"></script> <script src="../js/jquery-3.4.1.min.js"></script>
......
...@@ -3,15 +3,16 @@ import qs from 'qs' ...@@ -3,15 +3,16 @@ import qs from 'qs'
export function getUserInfoByUserId(params) { export function getUserInfoByUserId(params) {
return requestCF({ return requestCF({
url: '/admin/auth/addressbook/clerk/getByUserIdOrUserName', url: '/admin/auth/addressbook/clerk/getStallCodeByClerkId',
method: 'get', method: 'get',
params params
}) })
} }
// export function ApiLoginSubmit(inData) { // 门店维护
// return requestCF({ export function editStore(data) {
// url: '/admin/common/login', return requestCF({
// method: 'post', url: '/admin/auth/stall/settingOrUpdateStall',
// data: qs.stringify(inData) method: 'post',
// }) data
// } })
}
...@@ -7,7 +7,10 @@ import './lib/rem'; ...@@ -7,7 +7,10 @@ import './lib/rem';
import Vant from 'vant'; import Vant from 'vant';
import { Toast } from 'vant'; import { Toast } from 'vant';
import 'vant/lib/index.css'; import 'vant/lib/index.css';
import vConsole from 'vconsole'
Vue.prototype.$vConsole= new vConsole()
Vue.config.productionTip = false Vue.config.productionTip = false
Vue.use(Vant); Vue.use(Vant);
......
...@@ -21,10 +21,7 @@ async function getXToken() { ...@@ -21,10 +21,7 @@ async function getXToken() {
await wxRequest('/workWx/auth/oauth2/getAccessToken', qs.stringify(postData)).then(res => { await wxRequest('/workWx/auth/oauth2/getAccessToken', qs.stringify(postData)).then(res => {
if (res.result === 'success') { if (res.result === 'success') {
sessionStorage.setItem('XToken', res.data) sessionStorage.setItem('XToken', res.data)
console.log('%c--->getXToken: RD =', 'background: limegreen;', res)
} else { } else {
console.log('%c--->getXToken: N/A. ', 'background: red;')
// this.$message({ // this.$message({
// message: res.errorMsg, // message: res.errorMsg,
// type: 'error' // type: 'error'
...@@ -66,17 +63,9 @@ Vue.prototype.getAgentAuth = function () { ...@@ -66,17 +63,9 @@ Vue.prototype.getAgentAuth = function () {
} }
// alert(`--->zCommon.js: header =${JSON.stringify(header)}`) // alert(`--->zCommon.js: header =${JSON.stringify(header)}`)
console.log('%c--->getAgentAuth: getJsSdkSignature: PD =', 'background: orange;', header)
wxRequest('/workWx/auth/base/getJsSdkSignature', qs.stringify(postData), header) wxRequest('/workWx/auth/base/getJsSdkSignature', qs.stringify(postData), header)
.then(res => { .then(res => {
// alert(`--->zCommon.js: getJsSdkSignature: then.`)
// alert(`--->zCommon.js: getJsSdkSignature: then: res =${JSON.stringify(res)}`)
if (res.result === 'success') { if (res.result === 'success') {
console.log('%c--->getAgentAuth: getJsSdkSignature: RD =', 'background: limegreen;', res.data)
// alert(`--->zCommon.js: getJsSdkSignature: then: res.result === "success".`)
let config = res.data let config = res.data
wx.config({ wx.config({
beta: true, beta: true,
...@@ -86,7 +75,7 @@ Vue.prototype.getAgentAuth = function () { ...@@ -86,7 +75,7 @@ Vue.prototype.getAgentAuth = function () {
nonceStr: config.jsApiSignature.nonceStr, // 必填,生成签名的随机串 nonceStr: config.jsApiSignature.nonceStr, // 必填,生成签名的随机串
signature: config.jsApiSignature.signature, // 必填,签名 signature: config.jsApiSignature.signature, // 必填,签名
// 根据自己的需求,填写 jsapilist 内容 // 根据自己的需求,填写 jsapilist 内容
jsApiList: ['agentConfig', 'sendChatMessage'], jsApiList: ['agentConfig', 'sendChatMessage','selectExternalContact','shareToExternalContact'],
success: function(res) { success: function(res) {
}, },
fail: function(err) { fail: function(err) {
...@@ -106,7 +95,7 @@ Vue.prototype.getAgentAuth = function () { ...@@ -106,7 +95,7 @@ Vue.prototype.getAgentAuth = function () {
// 配置成功后验证API接口在当前客户端是否支持:判断当前客户端版本是否支持指定JS接口 // 配置成功后验证API接口在当前客户端是否支持:判断当前客户端版本是否支持指定JS接口
wx.checkJsApi( wx.checkJsApi(
{ {
jsApiList: ['config', 'agentConfig', 'sendChatMessage'], jsApiList: ['config', 'agentConfig', 'sendChatMessage','selectExternalContact','shareToExternalContact'],
success: function (res) { success: function (res) {
if (res.errMsg != "checkJsApi:ok") { if (res.errMsg != "checkJsApi:ok") {
// alert("JS-SDK接口检测失败:" + JSON.stringify(res)); // alert("JS-SDK接口检测失败:" + JSON.stringify(res));
...@@ -126,7 +115,7 @@ Vue.prototype.getAgentAuth = function () { ...@@ -126,7 +115,7 @@ Vue.prototype.getAgentAuth = function () {
timestamp: agentConfig.agentJsApiSignature.timestamp, // 必填,生成签名的时间戳 timestamp: agentConfig.agentJsApiSignature.timestamp, // 必填,生成签名的时间戳
nonceStr: agentConfig.agentJsApiSignature.nonceStr, // 必填,生成签名的随机串 nonceStr: agentConfig.agentJsApiSignature.nonceStr, // 必填,生成签名的随机串
signature: agentConfig.agentJsApiSignature.signature,// 必填,签名,agentConfig所以为应用签名 signature: agentConfig.agentJsApiSignature.signature,// 必填,签名,agentConfig所以为应用签名
jsApiList: ['sendChatMessage'], //必填 jsApiList: ['sendChatMessage','selectExternalContact','shareToExternalContact'], //必填
success: function (res) { success: function (res) {
// alert('agentConfigSuccess') // alert('agentConfigSuccess')
// alert(`!-->zCommon.js: getJsSdkSignature: then: wx.ready: wx.checkJsApi: getAgentJsSdkSignature: wx.agentConfig: res.`) // alert(`!-->zCommon.js: getJsSdkSignature: then: wx.ready: wx.checkJsApi: getAgentJsSdkSignature: wx.agentConfig: res.`)
...@@ -188,7 +177,7 @@ function configWx(to) { ...@@ -188,7 +177,7 @@ function configWx(to) {
let config = res.data let config = res.data
wx.config({ wx.config({
beta: true, beta: true,
debug: true, //调试的时候可以开启 debug: false, //调试的时候可以开启
appId: config.jsApiSignature.appId, // 必填,公众号的唯一标识 appId: config.jsApiSignature.appId, // 必填,公众号的唯一标识
timestamp: config.jsApiSignature.timestamp, // 必填,生成签名的时间戳 timestamp: config.jsApiSignature.timestamp, // 必填,生成签名的时间戳
nonceStr: config.jsApiSignature.nonceStr, // 必填,生成签名的随机串 nonceStr: config.jsApiSignature.nonceStr, // 必填,生成签名的随机串
...@@ -208,7 +197,7 @@ function configWx(to) { ...@@ -208,7 +197,7 @@ function configWx(to) {
// router.push(to) // router.push(to)
if (res.errMsg != "checkJsApi:ok") { if (res.errMsg != "checkJsApi:ok") {
// alert("JS-SDK接口检测失败:" + JSON.stringify(res)); alert("JS-SDK接口检测失败:" + JSON.stringify(res));
return false; return false;
} }
} }
...@@ -232,9 +221,9 @@ function configWx(to) { ...@@ -232,9 +221,9 @@ function configWx(to) {
timestamp: agentConfig.agentJsApiSignature.timestamp, // 必填,生成签名的时间戳 timestamp: agentConfig.agentJsApiSignature.timestamp, // 必填,生成签名的时间戳
nonceStr: agentConfig.agentJsApiSignature.nonceStr, // 必填,生成签名的随机串 nonceStr: agentConfig.agentJsApiSignature.nonceStr, // 必填,生成签名的随机串
signature: agentConfig.agentJsApiSignature.signature,// 必填,签名,agentConfig所以为应用签名 signature: agentConfig.agentJsApiSignature.signature,// 必填,签名,agentConfig所以为应用签名
jsApiList: ['getCurExternalContact'], //必填 jsApiList: ['getCurExternalContact','selectExternalContact','shareToExternalContact'], //必填
success: function (res) { success: function (res) {
alert('agentConfig:ok') // alert('agentConfig:ok')
// alert(`--->configWx/getJsSdkSignature/getAgentJsSdkSignature: then: agentConfig: res =${res}`) // alert(`--->configWx/getJsSdkSignature/getAgentJsSdkSignature: then: agentConfig: res =${res}`)
// alert(`--->configWx/getJsSdkSignature/getAgentJsSdkSignature: then: agentConfig: to =${JSON.stringify(to)}`) // alert(`--->configWx/getJsSdkSignature/getAgentJsSdkSignature: then: agentConfig: to =${JSON.stringify(to)}`)
sessionStorage.setItem('zConfigWx', 'Pass') sessionStorage.setItem('zConfigWx', 'Pass')
...@@ -284,13 +273,12 @@ function getUnionid(to) { ...@@ -284,13 +273,12 @@ function getUnionid(to) {
wxRequest('/workWx/auth/contact/getExternalContact', postData, header, 'get').then(res => { wxRequest('/workWx/auth/contact/getExternalContact', postData, header, 'get').then(res => {
if (res.result == 'success') { if (res.result == 'success') {
sessionStorage.setItem('unionid', res.data.externalContact.unionId) sessionStorage.setItem('unionid', res.data.externalContact.unionId)
console.log('%c--->UnionId: RES: ', 'background: limegreen;', res.data.externalContact.unionId)
router.push(to) router.push(to)
} }
}) })
} else { } else {
console.log('%c--->UnionId: N/A', 'background: red;') console.log()
console.log(res, 'res')
} }
}); });
} }
......
<template> <template>
<div> <div class="bg">
<div></div> <div class="bd">
<div>收款码</div> <div class="title">收款码</div>
<div class="img"><img src="../../../public/img/code.jpg" alt=""></div>
</div>
<!-- <div>收款码</div> -->
</div> </div>
</template> </template>
...@@ -11,6 +14,33 @@ export default { ...@@ -11,6 +14,33 @@ export default {
} }
</script> </script>
<style> <style scoped>
.bg {
background-color: #a7cfff;
display: flex;
justify-content: center;
height: 100%;
}
.bd {
margin-top: 25px;
width: 90%;
height: 50%;
background-color: #fff;
box-shadow: 0px 2px 4px 0px rgba(221, 221, 221, 1);
}
.title {
background-color: #f1f1f1;
height: 18%;
justify-content: center;
display: flex;
align-items: center;
font-size: 22px;
}
.img {
justify-content: center;
display: flex;
align-items: center;
height: 82%;
}
</style>
</style>
\ No newline at end of file
<template>
<div class="container">
<div class="flex-start">
<van-uploader v-model="bannerList" :max-count="4" />
<div>
<quill-editors @ChangeText="(text)=>{content=text}" :title="title" />
<!-- <van-uploader class="avatar-uploader" />D -->
<quill-editor v-model="content" ref="myQuillEditor" :options="editorOption" @change="onEditorChange($event)"></quill-editor>
</div>
</div>
<div class="creat">保存信息</div>
</div>
</template>
<script>
import QuillEditors from "@/components/quill"
// import { quillEditor } from "vue-quill-editor"
// import "quill/dist/quill.core.css"
// import "quill/dist/quill.snow.css"
// import "quill/dist/quill.bubble.css"
const toolbarOptions = [
[{ size: ["small", false, "large", "huge"] }], // 字体大小
[ "image" ] // 链接、图片、视频
]
export default {
components: {
// quillEditor
QuillEditors
},
data() {
return {
bannerList: [],
content: '',
isClear: false,
detail:"",
editorOption: {
placeholder: "",
theme: "snow", // or 'bubble'
modules: {
toolbar: {
container: toolbarOptions,
handlers: {
// image: function(value) {
// if (value) {
// // 触发input框选择图片文件
// document.querySelector(".avatar-uploader input").click();
// } else {
// this.quill.format("image", false);
// }
// }
}
}
}
},
header: {
}, // 有的图片服务器要求请求头需要有token
serverUrl: "https://139.219.7.104:8021/file/upload",
// title:
}
},
methods: {
change(val) {
console.log(val)
},
onEditorChange({ editor, html, text }) {
console.log(this.content,'内容')
console.log(html,'html')
console.log(editor,'editor')
console.log(text,'text')
this.$emit("input", this.content);
},
}
}
</script>
<style >
</style>
<style scoped>
.container {
min-height: 100%;
height: auto;
background: #F8F8F8;
display: flex;
justify-content: space-between;
flex-direction: column;
align-items: center;
}
.content {
background: #fff;
height: auto;
}
.creat {
margin: 20px 0;
width: 343px;
height: 40px;
line-height: 40px;
background: rgba(117, 178, 253, 1);
border-radius: 10px;
font-size: 16px;
font-weight: bold;
color: rgba(255, 255, 255, 1);
text-align: center;
bottom: 0;
}
</style>
...@@ -3,12 +3,11 @@ ...@@ -3,12 +3,11 @@
<div class="flex-start top" > <div class="flex-start top" >
<div class="flex-start"> <div class="flex-start">
<van-cell-group class="gn"> <van-cell-group class="gn">
<van-cell title="专柜LOGO" center class="logo"> <van-cell title="专柜LOGO" >
<template slot="default"> <template slot="default">
<van-uploader v-model="addForm.logo" :max-count="1" class="input"> <van-uploader v-model="addForm.logoList" :max-count="1" class="input" :after-read="afterRead" :before-read="beforeRead" @delete="deleteLogo" >
<div class="cube" style="width:54px;height:50px;"> <div>
<van-icon name="photo" size="40" /> <van-icon name="photo" size="20" />
<div class="mb">点击替换</div>
</div> </div>
</van-uploader> </van-uploader>
</template> </template>
...@@ -18,20 +17,15 @@ ...@@ -18,20 +17,15 @@
<van-field v-model="addForm.name" placeholder="输入名称" class="input" /> <van-field v-model="addForm.name" placeholder="输入名称" class="input" />
</template> </template>
</van-cell> </van-cell>
<van-cell title="门店">
<template slot="default">
<van-field v-model="addForm.store" placeholder="输入名称" class="input" />
</template>
</van-cell>
<van-cell title="专柜地址"> <van-cell title="专柜地址">
<template slot="default"> <template slot="default">
<van-field v-model="addForm.address" placeholder="输入名称" class="input" /> <van-field v-model="addForm.location" placeholder="输入名称" class="input" />
</template> </template>
</van-cell> </van-cell>
<div class="border"> <div class="border">
<div class="des">摘要信息</div> <div class="des">摘要信息</div>
<van-field <van-field
v-model="addForm.abstract" v-model="addForm.summaryTitle"
rows="4" rows="4"
autosize autosize
type="textarea" type="textarea"
...@@ -44,24 +38,25 @@ ...@@ -44,24 +38,25 @@
</div> </div>
<div class="flex-start fwb" > <div class="flex-start fwb" >
<div class="txt">轮播图</div> <div class="txt">轮播图</div>
<van-uploader v-model="bannerList" :max-count="4" class="pic" /> <van-uploader v-model="bannerList" :max-count="4" class="pic" :before-read="beforeRead" />
<van-field v-model="addForm.title" placeholder="标题(不超过30个字)" maxlength="30"></van-field> <quill-editor v-model="addForm.summary" ref="myQuillEditor" :options="editorOption" @change="onEditorChange($event)" @delete="deleteBanner" ></quill-editor>
<quill-editor v-model="content" ref="myQuillEditor" :options="editorOption" @change="onEditorChange($event)"></quill-editor>
</div> </div>
</div> </div>
<div class="creat">保存信息</div> <div class="creat" @click="handleSave">保存信息</div>
</div> </div>
</template> </template>
<script> <script>
import { quillEditor, Quill } from "vue-quill-editor"; import { quillEditor, Quill } from "vue-quill-editor";
import { container, ImageExtend, QuillWatch } from "quill-image-extend-module"; import { container, ImageExtend, QuillWatch } from "quill-image-extend-module";
import { editStore } from "@/api/sidebar/voucher";
import "quill/dist/quill.core.css"; import "quill/dist/quill.core.css";
import "quill/dist/quill.snow.css"; import "quill/dist/quill.snow.css";
import "quill/dist/quill.bubble.css"; import "quill/dist/quill.bubble.css";
Quill.register("modules/ImageExtend", ImageExtend); Quill.register("modules/ImageExtend", ImageExtend);
import axios from 'axios'
import { log } from 'util';
const toolbarOptions = [ const toolbarOptions = [
[{ size: ["small", false, "large", "huge"] }], // 字体大小 [{ size: ["small", false, "large", "huge"] }], // 字体大小
["image"] // 图片 ["image"] // 图片
...@@ -75,16 +70,17 @@ export default { ...@@ -75,16 +70,17 @@ export default {
data() { data() {
return { return {
addForm: { addForm: {
logo: [], logoList: [],
abstract: '', logo: '',
store: '', summaryTitle: '',
name: '', name: '',
address: '', location: '',
title: '' summary: ''
}, },
oyStallCode: '',
list: [],
bannerList: [], bannerList: [],
title: "", title: "",
content: "",
// 富文本框参数设置 // 富文本框参数设置
editorOption: { editorOption: {
modules: { modules: {
...@@ -92,9 +88,6 @@ export default { ...@@ -92,9 +88,6 @@ export default {
name: "file", // 图片参数名 name: "file", // 图片参数名
// size: 3, // size: 3,
action: "http://139.155.48.151:8084/admin/auth/util/saveImg", action: "http://139.155.48.151:8084/admin/auth/util/saveImg",
// response 为一个函数用来获取服务器返回的具体图片地址
// 例如服务器返回{code: 200; data:{ url: 'baidu.com'}}
// 则 return res.data.url
response: res => { response: res => {
return res.data.imgPath; return res.data.imgPath;
}, },
...@@ -117,16 +110,62 @@ export default { ...@@ -117,16 +110,62 @@ export default {
} }
}; };
}, },
mounted() {
this.addForm.oyStallCode = sessionStorage.getItem('oyStallCode')
},
methods: { methods: {
change(val) { change(val) {
console.log(val); console.log(val)
}, },
onEditorChange({ editor, html, text }) { onEditorChange({ editor, html, text }) {
console.log(this.content, "内容") this.$emit("input", this.addForm.summary)
this.$emit("input", this.content) },
beforeRead (file) { //上传之前校验
if (file.type !== 'image/jpeg' && file.type !== 'image/png') {
Toast('只允许上传jpg/png格式的图片!')
return false
}
return true
},
async afterRead (file) {
this.addForm.logo = await this.getImgUrl(file.file)//使用上传的方法。file.file
},
async getImgUrl(file) {
let params = new FormData()
params.append('file', file)
let url = 'http://139.155.48.151:8084/admin/auth/util/saveImg'
const img = await axios.post(url, params)
let urls = img.data.data.imgPath
console.log(urls,'urls')
return urls
},
deleteLogo(file) {
this.addForm.logo = ''
},
async handleSave() {
let list = []
let carousel = 'http://139.155.48.151/img/39e948a1-83ae-4769-bd8b-cbdca065a17a.jpeg,http://139.155.48.151/img/1f10d588-13bf-4436-98f0-88bebe557f6f.jpg'
this.addForm.oyStallCode = 1
let lists = ''
await this.bannerList.forEach( async item => {
let img = await this.getImgUrl(item.file)
console.log(img,'imggggg')
list.push(img)
lists = list.toString()
})
console.log(carousel,'carousel111')
console.log(lists,'lists')
editStore(Object.assign(this.addForm,{ carousel })).then( res => {
console.log(res,'res')
})
},
deleteBanner(file) {
} }
} }
}; }
</script> </script>
<style > <style >
</style> </style>
......
...@@ -38,7 +38,12 @@ import "quill/dist/quill.snow.css" ...@@ -38,7 +38,12 @@ import "quill/dist/quill.snow.css"
import "quill/dist/quill.bubble.css" import "quill/dist/quill.bubble.css"
export default { export default {
data() { data() {
return {}; return {
oyStallCode: ''
}
},
mounted() {
this.getAgentAuth()
}, },
methods: { methods: {
handleEdit() { handleEdit() {
...@@ -47,14 +52,27 @@ export default { ...@@ -47,14 +52,27 @@ export default {
getChargeCode() { getChargeCode() {
this.$router.push("chargeCode") this.$router.push("chargeCode")
}, },
handlePushInfo() { handleCounterHome() {
this.$router.push("pushStoreInfo")
},
handleCounterHome() {
this.$router.push("counterHome") this.$router.push("counterHome")
},
handlePushInfo() {
this.oyStallCode = sessionStorage.getItem('oyStallCode')
let url = `http://oysales.oywanhao.com:8087/counterPageHome?oyStallCode=${this.oyStallCode}`
wx.invoke("shareToExternalContact", {
title: '专柜首页', // 消息的标题
desc: '专柜首页详情', // 消息的描述
link: url, // 消息链接
imgUrl: '' // 消息封面
},function(res) {
if (res.err_msg == "shareToExternalContact:ok") {
this.$router.push({ path: "counterInfo" })
}else {
console.log(res.err_msg,'错误信息')
}
})
}
} }
} }
};
</script> </script>
<style scoped> <style scoped>
......
<template> <template>
<div class="container"> <div class="container">
<div> <div>推送</div>
<!-- 搜索框 --> <!-- <div>
<van-search v-model="inputValue" placeholder="请输入搜索关键词" /> <van-search v-model="inputValue" placeholder="请输入搜索关键词" />
</div> </div>
<van-checkbox-group v-model="list" @change="onChange"> <van-checkbox-group v-model="list" @change="onChange">
...@@ -14,13 +14,16 @@ ...@@ -14,13 +14,16 @@
<van-checkbox slot="right-icon" catch:tap="noop" :name="item.id" /> <van-checkbox slot="right-icon" catch:tap="noop" :name="item.id" />
</van-cell> </van-cell>
</van-cell-group> </van-cell-group>
</van-checkbox-group> </van-checkbox-group> -->
<div>外部联系人{{ info }}</div>
</div> </div>
</template> </template>
<script> <script>
import axios from "axios"; import axios from "axios";
import { wxRequest } from '@/utils/aWxRequest'
// import VConsole from 'vconsole/dist/vconsole.min.js' //import vconsole
// let vConsole = new VConsole()
export default { export default {
data() { data() {
return { return {
...@@ -47,24 +50,36 @@ export default { ...@@ -47,24 +50,36 @@ export default {
this.getList() this.getList()
}, },
methods: { methods: {
getList() { getList() {
alert('获取外部联系人') let url = 'http://oysales.oywanhao.com:8087/counterPageHome'
alert(sessionStorage.getItem('userId')) wx.invoke("shareToExternalContact", {
sessionStorage.getItem('userId') title: '专柜首页', // 消息的标题
this.userId = sessionStorage.getItem('userId') desc: '专柜首页详情', // 消息的描述
axios({ link: url, // 消息链接
url: "/workWx/auth/contact/listExternalContacts?userId=" + this.userId, imgUrl: '' // 消息封面
method: "get", },function(res) {
headers: headerData if (res.err_msg == "shareToExternalContact:ok") {
}) this.$router.push({ path: "counterInfo" })
.then(res => { }else {
alert('获取外部联系人成功') console.log(res.err_msg,'错误信息')
alert('JSON.stringify(res)') }
this.userInfo = JSON.stringify(res)
}) })
.catch(err => { // this.userId = sessionStorage.getItem('userId')
this.zcache.userInfoResNew = "RESERR."; // let postData = {
}); // userId: this.userId
// }
// let header = {
// token: sessionStorage.getItem('XToken'),
// corpId: 'ww4df265003b43fa0d',
// agentId: '1000033'
// }
// wx.invoke('selectExternalContact', { "filterType": 0}, function(res){
// if(res.err_msg == "selectExternalContact:ok"){
// console.log(res,'联系人列表')
// }else {
// console.log('获取失败')
// }
// })
}, },
onChange(val) { }, onChange(val) { },
toggle(event) { toggle(event) {
......
...@@ -48,11 +48,7 @@ ...@@ -48,11 +48,7 @@
</div> </div>
<div class="main-actives"> <div class="main-actives">
<div class="actives-banners"> <div class="actives-banners">
<!--<img class="actives-banner-small" :src="test.activeInfo.icon['0']">-->
<div class="actives-banner-title">现有开展活动</div> <div class="actives-banner-title">现有开展活动</div>
<!-- <img class="actives-banner-small" :src="test.cache.imgUrl">-->
</div> </div>
<div class="actives-main"> <div class="actives-main">
<div class="active-logos"> <div class="active-logos">
......
...@@ -69,8 +69,11 @@ ...@@ -69,8 +69,11 @@
</template> </template>
<script> <script>
import {configWx, getUserInfo} from "@/utils/aCommon"; import {configWx, getUserInfo} from "@/utils/aCommon"
import axios from "axios"; import axios from "axios"
// import VConsole from 'vconsole/dist/vconsole.min.js' //import vconsole
import { editStore } from "@/api/sidebar/voucher";
// let vConsole = new VConsole()
export default { export default {
name: "me", name: "me",
...@@ -157,12 +160,6 @@ ...@@ -157,12 +160,6 @@
}, },
// 获取code // 获取code
zReadyUserId() { zReadyUserId() {
/* zlog(
"%c--->this.zcache.code =",
"color: orange;",
this.$route.query.code
) */
if (this.$route.query.code === undefined){ if (this.$route.query.code === undefined){
// alert('没code') // alert('没code')
this.zTestPreAuthCode() this.zTestPreAuthCode()
...@@ -172,69 +169,76 @@ ...@@ -172,69 +169,76 @@
this.zTestGetUserInfoByOldToken(); this.zTestGetUserInfoByOldToken();
} }
}, },
// 测试-获取当前Url信息 // 测试-获取当前Url信息
zTestGetNowUrlInfo() { zTestGetNowUrlInfo() {
// alert('获取url') this.zcache.nowUrl = JSON.stringify(this.$route.query);
this.zcache.nowUrl = JSON.stringify(this.$route.query); this.zcache.code = String(this.$route.query.code);
this.zcache.code = String(this.$route.query.code); this.url = this.zcache.nowUrl
this.url = this.zcache.nowUrl },
}, zTestPreAuthCode() {
zTestPreAuthCode() { // alert('获取code')
// alert('获取code') const basicInfo = {
const basicInfo = { head: "https://open.weixin.qq.com/connect/oauth2/authorize?",
head: "https://open.weixin.qq.com/connect/oauth2/authorize?", // appId: "wwd1cdbca7b8b2b6c4",
// appId: "wwd1cdbca7b8b2b6c4", appId: "ww4df265003b43fa0d",
appId: "ww4df265003b43fa0d", redirectUrI: encodeURIComponent("oysales.oywanhao.com:8087"),
redirectUrI: encodeURIComponent("oysales.oywanhao.com:8087"), responseType: "code",
responseType: "code", scope: "snsapi_base",
scope: "snsapi_base", state: "ztest",
state: "ztest", tail: "#wechat_redirect"
tail: "#wechat_redirect" };
};
let url = let url =
basicInfo.head + basicInfo.head +
"appid=" + "appid=" +
basicInfo.appId + basicInfo.appId +
"&redirect_uri=" + "&redirect_uri=" +
basicInfo.redirectUrI + basicInfo.redirectUrI +
"&response_type=" + "&response_type=" +
basicInfo.responseType + basicInfo.responseType +
"&scope=" + "&scope=" +
basicInfo.scope + basicInfo.scope +
"&state=" + "&state=" +
basicInfo.state + basicInfo.state +
basicInfo.tail; basicInfo.tail;
this.zcache.preAuthCodeUrl = url; this.zcache.preAuthCodeUrl = url;
window.location.href = url; window.location.href = url;
}, },
// 测试-获取用户信息 // 测试-获取用户信息
zTestGetUserInfoByOldToken() { zTestGetUserInfoByOldToken() {
// alert('获取用户信息')
let postData = { let postData = {
code: this.zcache.code, code: this.zcache.code,
}; };
let headerData = { let headerData = {
agentId: "1000032", agentId: "1000033",
corpId: "ww4df265003b43fa0d" corpId: "ww4df265003b43fa0d"
}; };
this.zcache.userInfoResOld = "PostData:" + JSON.stringify(postData); this.zcache.userInfoResOld = "PostData:" + JSON.stringify(postData)
axios({ axios({
url: "http://139.155.48.151:8085/workWx/auth/oauth2/getUserInfo?code=" + this.zcache.code, url: "http://139.155.48.151:8085/workWx/auth/oauth2/getUserInfo?code=" + this.zcache.code,
method: "post", method: "post",
headers: headerData, headers: headerData,
}) })
.then(res => { .then(res => {
// alert('获取用户信息接口成功') // alert('获取用户信息接口成功')
this.userInfo = JSON.stringify(res); sessionStorage.setItem("userId", String(res.data.data.userId))
this.zcache.userInfoResNew = "RESOK:" + res.data.data.userId; this.zcache.userId = String(res.data.data.userId)
sessionStorage.setItem("userId", String(res.data.data.userId)); this.getUserFromId(this.zcache.userId)
this.zcache.userId = String(res.data.data.userId);
}) })
.catch(err => { .catch(err => {
this.zcache.userInfoResNew = "RESERR."; console.log(err)
}); });
}, },
getUserFromId(id) {
let userName = id
getUserInfoByUserId({ userName }).then(res => {
// alert('获取成功')
sessionStorage.setItem("oyStallCode",res.data[0].oyStallCode)
this.storeCode = res.data[0].oyStallCode
})
.catch(err => {
})
},
handleDetail(type){ handleDetail(type){
if(type === 'message'){ if(type === 'message'){
this.$router.push('/message') this.$router.push('/message')
......
...@@ -56,16 +56,15 @@ ...@@ -56,16 +56,15 @@
</div> </div>
<script> <script>
function GetQueryString(name) { function GetQueryString(name) {
var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i"); var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
var r = window.location.search.substr(1).match(reg) var r = window.location.search.substr(1).match(reg)
var context = "" var context = ""
if (r != null) if (r != null)
context = r[2] context = r[2]
reg = null reg = null
r = null r = null
return context == null || context == "" || context == "undefined" ? "" : context; return context == null || context == "" || context == "undefined" ? "" : context;
} }
// alert(GetQueryString("storeCode"))
const storecode = GetQueryString("storeCode") const storecode = GetQueryString("storeCode")
$(function () { $(function () {
showQRInfo() showQRInfo()
......
...@@ -21,7 +21,7 @@ export default { ...@@ -21,7 +21,7 @@ export default {
// alert('--->arCode: mounted: IN.') // alert('--->arCode: mounted: IN.')
this.cleanUrl() this.cleanUrl()
// this.getAcessToken(); // this.getAcessToken();
this.createCode(); this.createCode()
}, },
methods: { methods: {
cleanUrl() { cleanUrl() {
......
...@@ -29,7 +29,8 @@ import { getUserInfoByUserId } from "@/api/sidebar/voucher"; ...@@ -29,7 +29,8 @@ import { getUserInfoByUserId } from "@/api/sidebar/voucher";
logoUrl: "/mainSale/4.png" logoUrl: "/mainSale/4.png"
} }
], ],
storeCode: '' storeCode: '',
oyStallCode: ''
} }
}, },
created() { created() {
......
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