Commit 4a94b1d0 authored by xd's avatar xd

首页修改

parent d8baabf8
......@@ -149,6 +149,7 @@
})
let info = data.data.stallInfo
$("#logo").attr('src',info.logo)
$(".title").text(info.name)
let content = info.summary.replace(/<img/g,'<img style="width:100%;"')
$("#address").text(info.location)
$("#phone").text(info.phone)
......
......@@ -8,50 +8,50 @@ import Vant from 'vant';
import { Toast } from 'vant';
import 'vant/lib/index.css';
import vConsole from 'vconsole'
import VeeValidate, { Validator } from 'vee-validate'
// import VeeValidate, { Validator } from 'vee-validate'
import cn from 'vee-validate/dist/locale/zh_CN';
Validator.addLocale(cn)
Vue.use(VeeValidate, {
locale: 'zh_CN'
})
// Vue.use(VeeValidate, {
// locale: 'zh_CN'
// })
const dictionary = {
zh_CN: {
messages: {
required: (val) => {
let msg = ''
switch (val) {
case 'logo':
msg = 'logo'
break
case 'name':
msg = '专柜名称'
break
case 'location':
msg = '专柜地址'
break
case 'number':
msg = '电话号码'
break
case 'summaryTitle':
msg = '摘要信息'
break
case 'summary':
msg = '正文内容'
break
case 'banner':
msg = '轮播图'
break
default:;
}
msg = msg + '不能为空'
return msg
}
}
}
}
Validator.updateDictionary(dictionary)
// const dictionary = {
// zh_CN: {
// messages: {
// required: (val) => {
// let msg = ''
// switch (val) {
// case 'logo':
// msg = 'logo'
// break
// case 'name':
// msg = '专柜名称'
// break
// case 'location':
// msg = '专柜地址'
// break
// case 'number':
// msg = '电话号码'
// break
// case 'summaryTitle':
// msg = '摘要信息'
// break
// case 'summary':
// msg = '正文内容'
// break
// case 'banner':
// msg = '轮播图'
// break
// default:;
// }
// msg = msg + '不能为空'
// return msg
// }
// }
// }
// }
// Validator.updateDictionary(dictionary)
Vue.prototype.$vConsole= new vConsole()
Vue.config.productionTip = false
......
......@@ -9,8 +9,8 @@ Vue.use(VueRouter)
const routes = [
{
path: '/',
name: 'Me',
component: () => import('@/views/mainSale/me/main/index')
name: 'mainSale',
component: () => import('@/views/mainSale/active/main/index')
},
{
path: '/turntableDetail',
......
......@@ -20,14 +20,18 @@
</div>
<div class="main-menus">
<div class="menus-row">
<div class="menu">
<!-- <div class="menu">
<img class="menu-logo" :src="test.menuInfo.icon['1']" />
<div class="menu-text">优惠券核销</div>
</div>
</div> -->
<div class="menu" @click="menu02Click">
<img class="menu-logo" :src="test.menuInfo.icon['2']" />
<div class="menu-text">任务列表</div>
</div>
<div class="menu" @click="menu05Click">
<img class="menu-logo" :src="test.menuInfo.icon['5']" />
<div class="menu-text">活动模版</div>
</div>
<div class="menu" @click="menu03Click">
<img class="menu-logo" :src="test.menuInfo.icon['3']" />
<div class="menu-text">活动列表</div>
......@@ -38,14 +42,11 @@
<img class="menu-logo" :src="test.menuInfo.icon['4']" />
<div class="menu-text">专柜维护</div>
</div>
<div class="menu" @click="menu05Click">
<img class="menu-logo" :src="test.menuInfo.icon['5']" />
<div class="menu-text">活动模版</div>
</div>
<div class="menu" @click="menu06Click">
<img class="menu-logo" :src="test.menuInfo.icon['6']" />
<div class="menu-text">商品管理</div>
</div>
<div class="menu"></div>
</div>
</div>
<div class="main-actives">
......@@ -112,6 +113,8 @@
<script>
import axios from "axios"
import { getStoreDetail } from "@/api/sidebar/voucher";
import {configWx, getUserInfo} from "@/utils/aCommon"
import { getUserInfoByUserId } from "@/api/sidebar/voucher";
export default {
name: "discountIndex",
data() {
......@@ -193,16 +196,25 @@ export default {
},
dis: {},
oyStallCode: '',
userId: ''
};
userId: '',
zcache: {
nowUrl: "",
preAuthCodeUrl: "",
code: "",
userId: "",
userInfoResOld: "",
userInfoResNew: ""
}
}
},
created() {
this.checkNowMenuBar()
this.oyStallCode = sessionStorage.getItem('oyStallCode')
this.userId = sessionStorage.getItem('userId')
this.getUserInfo()
this.getStore()
this.getFans()
this.zReadyUserId()
this.zTestGetNowUrlInfo()
// this.oyStallCode = sessionStorage.getItem('oyStallCode')
// this.userId = sessionStorage.getItem('userId')
},
methods: {
// 获取用户信息
......@@ -213,13 +225,14 @@ export default {
};
axios({
url: "http://139.155.48.151:8085/workWx/auth/user/get?userId=" + this.userId,
url: "http://139.155.48.151:8085/workWx/auth/user/get?userId=" + this.zcache.userId,
method: "get",
headers: headerData
})
.then(res => {
this.test.manInfo.barFrom = res.data.data.name
this.test.manInfo.logoUrl = res.data.data.avatar
sessionStorage.setItem("avatar", res.data.data.avatar)
})
.catch(err => {
console.log(err)
......@@ -232,7 +245,7 @@ export default {
};
axios({
url: "http://139.155.48.151:8085/workWx/auth/contact/listExternalContacts?userId=" + this.userId,
url: "http://139.155.48.151:8085/workWx/auth/contact/listExternalContacts?userId=" + this.zcache.userId,
method: "get",
headers: headerData
})
......@@ -298,6 +311,89 @@ export default {
},
menuTask() {
this.$router.push({ path: "/taskList" });
},
// 获取code
zReadyUserId() {
if (this.$route.query.code === undefined){
// alert('没code')
this.zTestPreAuthCode()
} else {
// alert('有code')
this.zTestGetNowUrlInfo();
this.zTestGetUserInfoByOldToken();
}
},
// 测试-获取当前Url信息
zTestGetNowUrlInfo() {
this.zcache.nowUrl = JSON.stringify(this.$route.query);
this.zcache.code = String(this.$route.query.code);
this.url = this.zcache.nowUrl
},
zTestPreAuthCode() {
// alert('获取code')
const basicInfo = {
head: "https://open.weixin.qq.com/connect/oauth2/authorize?",
// appId: "wwd1cdbca7b8b2b6c4",
appId: "ww4df265003b43fa0d",
redirectUrI: encodeURIComponent("oysales.oywanhao.com:8087"),
responseType: "code",
scope: "snsapi_base",
state: "ztest",
tail: "#wechat_redirect"
};
let url =
basicInfo.head +
"appid=" +
basicInfo.appId +
"&redirect_uri=" +
basicInfo.redirectUrI +
"&response_type=" +
basicInfo.responseType +
"&scope=" +
basicInfo.scope +
"&state=" +
basicInfo.state +
basicInfo.tail;
this.zcache.preAuthCodeUrl = url;
window.location.href = url;
},
// 测试-获取用户信息
zTestGetUserInfoByOldToken() {
let postData = {
code: this.zcache.code,
};
let headerData = {
agentId: "1000033",
corpId: "ww4df265003b43fa0d"
};
this.zcache.userInfoResOld = "PostData:" + JSON.stringify(postData)
axios({
url: "http://139.155.48.151:8085/workWx/auth/oauth2/getUserInfo?code=" + this.zcache.code,
method: "post",
headers: headerData,
})
.then(res => {
// alert('获取用户信息接口成功')
sessionStorage.setItem("userId", String(res.data.data.userId))
this.zcache.userId = String(res.data.data.userId)
this.getUserFromId(this.zcache.userId)
this.getUserInfo()
})
.catch(err => {
console.log(err)
});
},
getUserFromId(id) {
let userName = id
getUserInfoByUserId({ userName }).then(res => {
sessionStorage.setItem("oyStallCode",res.data[0].oyStallCode)
this.oyStallCode = res.data[0].oyStallCode
this.getStore()
this.getFans()
})
.catch(err => {
})
}
}
};
......
......@@ -131,7 +131,7 @@
},
mounted() {
this.checkNowMenuBar()
this.zReadyUserId()
// this.zReadyUserId()
this.zTestGetNowUrlInfo()
},
......
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