d48fd4cd by joe

部分功能修改

1 parent 2fd73dd4
let global_view_coupon_url = "http://www.baidu.com";
let global_view_integral_url = "http://www.bing.com";
\ No newline at end of file
let global_wx_appid = "wx9fc8816188c0ef2a";
let global_view_coupon_url = "https://clubwxuat.hm.liby.com.cn/integral/weixin_integral.htm?appId=wx9fc8816188c0ef2a";
let global_view_integral_url = "https://clubwxuat.hm.liby.com.cn/integral/weixin_integral.htm?appId=wx9fc8816188c0ef2a";
let global_wx_oauth_url = "http://clubwxuat.hm.liby.com.cn/api/getOpenId.htm";
let golbal_api_proxy = "https://ow.go.qudone.com";
// if (location.href.indexOf("//k.wxpai.cn") > 0) {
// base = "https://api.k.wxpai.cn/bizproxy"
// wxOauthUrl = "";
// }
\ No newline at end of file
......
......@@ -14,14 +14,10 @@ Vue.use(Toast);
// axios.defaults.baseURL = ""
// 服务器地址
let base = "https://ow.go.qudone.com";
let baseWxAppid = "wx9fc8816188c0ef2a";
let wxOauthUrl = "http://clubwxuat.hm.liby.com.cn/api/getOpenId.htm";
if (location.href.indexOf("//k.wxpai.cn") > 0) {
base = "https://api.k.wxpai.cn/bizproxy"
baseWxAppid = "wx9fc8816188c0ef2a";
wxOauthUrl = "http://clubwxuat.hm.liby.com.cn/api/getOpenId.htm";
}
let base = golbal_api_proxy;
let baseWxAppid = global_wx_appid;
let wxOauthUrl = global_wx_oauth_url;
let whileList = [
"https://api.k.wxpai.cn/bizproxy/kdapi/file/upload"
......@@ -46,7 +42,7 @@ axios.interceptors.request.use(
// 响应拦截器
axios.interceptors.response.use(
response => {
if(!response){
if (!response) {
return;
}
if (response.status === 200) {
......@@ -57,7 +53,7 @@ axios.interceptors.response.use(
store.removeSession();
store.saveRedirectUrl();
Router.push("/");
} else {
} else {
Toast(response.data.errMsg);
}
return Promise.reject(response);
......@@ -144,6 +140,13 @@ export const store = {
}
localStorage.setItem("_jiajia_childrenhost_redirect", JSON.stringify(data));
},
saveWorksRedirectUrl(worksCode) {
let data = {
route: "/list",
params: { worksCode: worksCode }
};
localStorage.setItem("_jiajia_childrenhost_redirect", JSON.stringify(data));
},
getRedirectUrl() {
let dataStr = localStorage.getItem("_jiajia_childrenhost_redirect");
if (dataStr) {
......@@ -209,16 +212,16 @@ export const request = {
let requestUrl = url.indexOf("://") >= 0 ? `${url}` : `${base}${url}`;
return axios.post(requestUrl, formData, formDataHeaders)
},
build(url, params){
build(url, params) {
let fullUrl = `${base}${url}`;
let split = "";
for(let key in params){
if(split){
for (let key in params) {
if (split) {
split = "&";
} else {
split = "?"
}
fullUrl += split + key +"="+params[key];
fullUrl += split + key + "=" + params[key];
}
return fullUrl;
},
......

965 Bytes | W: | H:

2.28 KB | W: | H:

  • 2-up
  • Swipe
  • Onion skin

1.46 KB | W: | H:

3.26 KB | W: | H:

  • 2-up
  • Swipe
  • Onion skin

2.5 KB | W: | H:

7.34 KB | W: | H:

  • 2-up
  • Swipe
  • Onion skin

2.6 KB | W: | H:

7.01 KB | W: | H:

  • 2-up
  • Swipe
  • Onion skin

30.3 KB | W: | H:

30.4 KB | W: | H:

  • 2-up
  • Swipe
  • Onion skin

5.93 KB | W: | H:

9.13 KB | W: | H:

  • 2-up
  • Swipe
  • Onion skin
......@@ -26,16 +26,16 @@
<span class="tip">优惠券可以在立乐家商城购物当现金使用</span>
</div>
<div
class="sys-btn-02 base-top"
class="sys-btn-02 base-top-2"
@click="toViewIntegralHandler"
v-if="data.drawResult.prizeType == 'integral'"
>前往查看</div>
<div
class="sys-btn-02 base-top"
class="sys-btn-02 base-top-2"
@click="toViewCouponHandler"
v-if="data.drawResult.prizeType == 'coupon'"
>前往使用</div>
<div class="sys-btn-02" @click="modelBtnClickHandler">返回抽奖</div>
<div class="sys-btn-02" @click="modelBtnClickHandler">返回</div>
</div>
</div>
......@@ -214,7 +214,7 @@ export default {
.prize-name {
font-size: 28px;
margin-bottom: 30px;
// margin-bottom: 30px;
font-weight: bold;
}
......@@ -244,6 +244,11 @@ export default {
.base-top {
margin-top: 60px !important;
}
.base-top-2 {
margin-top: 80px !important;
}
.content {
padding-bottom: 60px;
}
......
......@@ -19,7 +19,7 @@
position: relative;
left: 0;
top: 0;
z-index: 999;
z-index: 99;
}
</style>
\ No newline at end of file
......
......@@ -31,10 +31,18 @@ export default {
},
methods: {
init() {
let params = this.analysisParams();
let worksCode = params["worksCode"];
if (worksCode) {
store.saveWorksRedirectUrl(worksCode);
let link = location.origin + location.pathname;
location.href = link;
return;
}
if (store.getSession()) {
this.$router.push("/index");
this.toNextPath();
} else {
let params = this.analysisParams();
if (params["openId"]) {
this.loginParam.openid = params["openId"];
this.loginParam.accessToken = params["access_token"];
......@@ -60,12 +68,15 @@ export default {
store.toWxLogin();
} else {
store.putSession(res.sessionId);
let path = store.getRedirectUrl();
path = !path ? "/index" : path;
store.delRedirectUrl();
this.$router.push(path);
this.toNextPath();
}
});
},
toNextPath() {
let path = store.getRedirectUrl();
path = !path ? "/index" : path;
store.delRedirectUrl();
this.$router.push(path);
}
},
created() {
......
......@@ -346,7 +346,7 @@ export default {
position: fixed;
left: 0;
top: 30px;
z-index: 2000;
z-index: 100;
}
.btn-prize-list{
width: 166px;
......@@ -356,6 +356,6 @@ export default {
position: fixed;
right: 0;
top: 30px;
z-index: 2000;
z-index: 100;
}
</style>
......
......@@ -77,6 +77,9 @@ export default {
// this.searchWorksHandler();
// },
toWorksViewHandler(code) {
let link = location.origin + location.pathname;
link += "?worksCode=" + code;
as.setShare(link, null, null, null);
this.$emit("worksDetail", { worksCode: code });
},
searchWorksHandler(action) {
......@@ -92,32 +95,34 @@ export default {
});
}
console.log("this.listForm === ", this.listForm);
httpGet({ url: urls.list, data: this.listForm }).then(res => {
Toast.clear();
let list = [];
if (this.listForm.page != 1) {
list = this.worksList;
}
httpGet({ url: urls.list, data: this.listForm })
.then(res => {
Toast.clear(true);
let list = [];
if (this.listForm.page != 1) {
list = this.worksList;
}
let tempList = [];
for (let index = 0; index < res.list.length; index++) {
if (index % 2 == 0) {
tempList = [];
list.push(tempList);
let tempList = [];
for (let index = 0; index < res.list.length; index++) {
if (index % 2 == 0) {
tempList = [];
list.push(tempList);
}
tempList.push(res.list[index]);
}
tempList.push(res.list[index]);
}
// console.log(list);
// console.log(list);
// list = list.concat(res.list);
this.worksList = list;
// list = list.concat(res.list);
this.worksList = list;
// 加载更多
this.hasMore = res.list.length == this.listForm.size;
this.isLoading = false;
}).catch(e=>{
Toast.clear();
});
// 加载更多
this.hasMore = res.list.length == this.listForm.size;
this.isLoading = false;
})
.catch(e => {
Toast.clear(true);
});
},
refreshMore() {
// console.log("refresh more");
......@@ -126,6 +131,9 @@ export default {
}
},
created() {
// if (!this.isLoading && this.listForm.page == 0) {
// this.refreshMore();
// }
// this.initActvity();
}
};
......@@ -161,7 +169,7 @@ export default {
padding-left: 20px;
font-size: 28px;
position: relative;
z-index: 1000;
z-index: 100;
}
}
......@@ -171,7 +179,7 @@ export default {
background: url(../../../assets/imgs/list-search-btn.png);
background-size: 100%;
position: relative;
z-index: 1000;
z-index: 100;
}
}
......@@ -227,7 +235,7 @@ export default {
.worksPraise {
width: 28px;
height: 24px;
background: url(../../../assets/imgs/list-heart-red.png);
background: url(../../../assets/imgs/list-heart-red.png) no-repeat;
background-size: 100%;
}
}
......
......@@ -99,7 +99,6 @@ export default {
},
methods: {
praiseHandler() {
as.setShare("","","","");
Toast.loading({
mask: true,
message: "请稍等..."
......@@ -119,7 +118,6 @@ export default {
}
});
},
showShareHandler() {
// 出现分享层
this.$emit("showShare");
......@@ -297,6 +295,6 @@ export default {
position: fixed;
left: 0;
top: 30px;
z-index: 1000;
z-index: 100;
}
</style>
......
......@@ -277,6 +277,6 @@ export default {
position: fixed;
left: 0;
top: 30px;
z-index: 1000;
z-index: 100;
}
</style>
......
......@@ -5,7 +5,7 @@
<works-list-view
v-model="formData"
v-if="init"
v-if="init && listVisiabled"
v-show="listVisiabled"
v-on:showRule="showRuleHandler"
v-on:worksDetail="showWorksDetail"
......@@ -90,22 +90,47 @@ export default {
};
},
methods: {
initUrlQuery() {
let worksCode = this.$route.query.worksCode;
console.log("worksCode === ", worksCode);
if (worksCode) {
Toast.loading({
mask: true,
message: "加载中..."
});
console.log("get data === ", worksCode);
httpGet({ url: urls.getWorks, data: { worksCode: worksCode } }).then(
res => {
if (res && res.data) {
this.memberWorks.data = res.data;
this.memberWorks.isMy = res.isMy;
this.listVisiabled = false;
}
this.initActivity();
Toast.clear();
}
);
} else {
console.log("init activity");
this.initActivity();
}
},
initActivity() {
Toast.loading({
mask: true,
message: "加载中..."
});
httpGet({ url: urls.myWork }).then(res => {
this.init = true;
this.formData = res.data || {};
if (!res.data) {
this.formEdit = true;
} else {
this.formEdit = false;
}
Toast.clear();
});
this.init = true;
// Toast.loading({
// mask: true,
// message: "加载中..."
// });
// httpGet({ url: urls.myWork }).then(res => {
// this.init = true;
// this.formData = res.data || {};
// if (!res.data) {
// this.formEdit = true;
// } else {
// this.formEdit = false;
// }
// Toast.clear();
// });
},
showRuleHandler() {
this.model.show = true;
......@@ -150,7 +175,8 @@ export default {
}
},
created() {
this.initActivity();
this.initUrlQuery();
// this.initActivity();
},
components: {
BottomTool,
......
<template>
<div class="home">
<head-view></head-view>
<div class="btn-back" @click="backHandler"></div>
<div class="sys-container-panel content">
<div class="container-title">{{title}}</div>
......@@ -100,7 +101,10 @@ export default {
// location.href = global_view_integral_url;
// break;
// }
}
},
backHandler(){
window.history.go(-1);
},
},
components: {
BottomTool,
......@@ -193,4 +197,16 @@ export default {
color: #a1a1a1;
}
}
.btn-back {
width: 170px;
height: 52px;
background: url(../../assets/imgs/list-btn-back.png) no-repeat;
background-size: 100%;
position: fixed;
left: 0;
top: 30px;
z-index: 100;
}
</style>
......
......@@ -4,9 +4,10 @@
<div class="container-title">我要报名</div>
<div class="head-line"></div>
<div class="edit">
<u @click="formEditHandler">
<van-icon name="edit" />信息编辑
</u>
<div class="btn-edit" @click="formEditHandler">
<div class="icon-edit"></div>
<u>信息编辑</u>
</div>
</div>
<div class="swipe">
<van-swipe :autoplay="5000">
......@@ -37,7 +38,7 @@
<div class="label">竞赛宣言:</div>
<div class="msg">{{formData.slogan}}</div>
</div>
<div class="text-container space top">
<div class="label">我的简介:</div>
<div class="msg">{{formData.profile}}</div>
......@@ -129,15 +130,30 @@ export default {
.edit {
width: 630px;
text-align: right;
u {
font-size: 24px;
color: #5db288;
position: relative;
z-index: 1000;
display: flex;
justify-content: flex-end;
.btn-edit {
width: auto;
display: flex;
align-items: center;
justify-content: flex-end;
.icon-edit {
width: 21px;
height: 26px;
background: url(../../../assets/imgs/edit-pancel.png) no-repeat;
background-size: 100%;
}
u {
font-size: 24px;
color: #5db288;
position: relative;
z-index: 1000;
display: flex;
align-items: center;
justify-content: flex-end;
}
}
}
......
......@@ -137,13 +137,13 @@ export default {
} else {
return;
}
let title = "我C位出道,需要你的一票";
let desc = this.formData.profile || null;
let imgurl =
this.formData.worksList.length > 0
? this.formData.worksList[0].worksUrl
: null;
as.setShare(link, title, desc, imgurl);
// let title = "我C位出道,需要你的一票";
// let desc = this.formData.profile || null;
// let imgurl =
// this.formData.worksList.length > 0
// ? this.formData.worksList[0].worksUrl
// : null;
as.setShare(link, "", "", "");
}
},
components: {
......
......@@ -72,6 +72,8 @@ const router = new Router({
});
router.beforeEach((to, from, next) => {
let link = location.origin + location.pathname;
as.setShare(link, null, null, null);
const title = to.meta && to.meta.title;
if (title) {
document.title = title;
......