更新C端后端api

This commit is contained in:
许红梅 2022-04-18 15:01:12 +08:00
parent d097528236
commit 0d620b6a2e
3 changed files with 60 additions and 58 deletions

View File

@ -14,8 +14,8 @@
<link href="https://lsxdemall.oss-cn-beijing.aliyuncs.com/siteqiexchange/css/swiper.min.css" rel="stylesheet">
<link rel="stylesheet" href="https://lsxdemall.oss-cn-beijing.aliyuncs.com/MarketingSystem/css/homepage1_1_0.css">
<link rel="stylesheet" href="https://lsxdemall.oss-cn-beijing.aliyuncs.com/MarketingSystem/css/loading.css">
<script src="https://lsxdemall.oss-cn-beijing.aliyuncs.com/MarketingSystem/js/apitest1_1_0.js"></script>"></script>
<style>
<script src="https://lsxdemall.oss-cn-beijing.aliyuncs.com/MarketingSystem/js/apitest1_1_0.js"></script>
<style>
* {
margin: 0 auto;
padding: 0;
@ -70,7 +70,7 @@
<div class="bottom" id="bottom" v-show="describe.type||detailUrl">
<img :src="detailUrl" v-show="detailUrl">
<img :src="detailUrl" v-show="detailUrl">
<img :src="describe.bg_image" v-show="describe.type==1&&describe.bg_image">
<div v-html="describe.content" class="goodsTip" v-show="describe.type==3&&describe.content"></div>
</div>
@ -145,12 +145,12 @@
suspension: false,
popboxtype: '',
describe: {},
detailUrl:'',
detailUrl: '',
successTip: '',
goodInfo: '',
bgcolor: '',
ftcolor: '',
backAble:true,
backAble: true,
goodsShow: [
'https://lsxd-yunshanfu.oss-cn-hangzhou.aliyuncs.com/common_image/20220120/9bedd7af6a8a570be8f2858564f9ec6d.png'
]
@ -160,17 +160,19 @@
let self = this;
document.title = sessionStorage.getItem('title');
let detailsConfig = JSON.parse(sessionStorage.getItem('product_detail'));
let goodsCount=sessionStorage.getItem('goodsCount');
this.backAble=goodsCount>1;
let goodsCount = sessionStorage.getItem('goodsCount');
this.backAble = goodsCount > 1;
this.bgcolor = detailsConfig.button_color;
this.bgcolor = '#f00'
this.ftcolor = detailsConfig.font_color;
this.describe = detailsConfig.describe;
let goodsInform=JSON.parse(sessionStorage.getItem('goodsInfo'));//商品信息
let goodsInform = JSON.parse(sessionStorage.getItem('goodsInfo')); //商品信息
this.goodInfo = goodsInform;
let goods_desc=goodsInform.describe_url;
this.goodsShow = goods_desc.length>0?goods_desc:[JSON.parse(sessionStorage.getItem('goodsInfo')).show_url];
this.detailUrl=goodsInform.detail_url?goodsInform.detail_url:'';
let goods_desc = goodsInform.describe_url;
this.goodsShow = goods_desc.length > 0 ? goods_desc : [JSON.parse(sessionStorage.getItem('goodsInfo'))
.show_url
];
this.detailUrl = goodsInform.detail_url ? goodsInform.detail_url : '';
this.productType = JSON.parse(sessionStorage.getItem('goodsInfo')).account_type;
self.$nextTick(function () {
@ -184,11 +186,11 @@
},
methods: {
backgoodsFn() {
let goodsCount=sessionStorage.getItem('goodsCount');
if(goodsCount>1){
let goodsCount = sessionStorage.getItem('goodsCount');
if (goodsCount > 1) {
// window.location.replace(document.referrer);
window.location.replace('./homepage.html');
}else{
} else {
history.go(-2);
}
// window.location.replace(document.referrer);
@ -304,16 +306,16 @@
this.popboxshow = true;
this.tiptext = res.message;
if (res.code == -1) {
let goodsCount=sessionStorage.getItem('goodsCount');
if(goodsCount>1){
let goodsCount = sessionStorage.getItem('goodsCount');
if (goodsCount > 1) {
setTimeout(() => {
// window.location.replace(document.referrer);
window.location.replace('./homepage.html');
}, 3000);
}else{
let backUrl=window.history.length;
if(backUrl){
history.go(-backUrl+1);
} else {
let backUrl = window.history.length;
if (backUrl) {
history.go(-backUrl + 1);
}
}
}

View File

@ -14,7 +14,7 @@
<link href="https://lsxdemall.oss-cn-beijing.aliyuncs.com/siteqiexchange/css/swiper.min.css" rel="stylesheet">
<link rel="stylesheet" href="https://lsxdemall.oss-cn-beijing.aliyuncs.com/MarketingSystem/css/homepage1_1_0.css">
<link rel="stylesheet" href="https://lsxdemall.oss-cn-beijing.aliyuncs.com/MarketingSystem/css/loading.css">
<script src="https://lsxdemall.oss-cn-beijing.aliyuncs.com/MarketingSystem/js/apitest1_1_0.js"></script>"></script>
<script src="https://lsxdemall.oss-cn-beijing.aliyuncs.com/MarketingSystem/js/apitest1_1_0.js"></script>
</head>
<style scoped>
* {
@ -98,7 +98,8 @@
</div>
</div>
<!-- 立即兑换 -->
<div class="exchangeBtn" :class="gstatus!=1?describe.type&&describe.type!=2&&describe.content?'bottomBtn noexchangeBtn':'noexchangeBtn':describe.type&&describe.type!=2&&describe.content?'bottomBtn':''"
<div class="exchangeBtn"
:class="gstatus!=1?describe.type&&describe.type!=2&&describe.content?'bottomBtn noexchangeBtn':'noexchangeBtn':describe.type&&describe.type!=2&&describe.content?'bottomBtn':''"
:style="{'background': bgcolor,'color':ftcolor}" @click="exchangeBtn()">
立即兑换
</div>
@ -106,7 +107,7 @@
<!-- 列表 -->
<div id="list" v-if="layout=='1'">
<div class="topBanner">
<img class="backpresty" @click="backgoodsFn" v-if="goodsShow&&!iskey"
<img class="backpresty" @click="backgoodsFn" v-if="goodsShow&&!iskey"
src="https://lsxdemall.oss-cn-beijing.aliyuncs.com/MarketingSystem/img/backprepageBtn.png" alt="">
<img :src="topImg" alt="">
</div>
@ -131,7 +132,7 @@
<!-- 矩阵 -->
<div id="matrix" v-if="layout=='3'">
<div class="topBanner">
<img class="backpresty" @click="backgoodsFn" v-if="goodsShow&&!iskey"
<img class="backpresty" @click="backgoodsFn" v-if="goodsShow&&!iskey"
src="https://lsxdemall.oss-cn-beijing.aliyuncs.com/MarketingSystem/img/backprepageBtn.png" alt="">
<img :src="topImg" alt="">
@ -226,9 +227,9 @@
bgcolor: '',
describe: {},
ftcolor: '',
iskey:true,
iskey: true,
allgoods: [],
showType:0,
showType: 0,
tiptext: '还没开始哟兑换时间为2021-12-05 12:12:12至2021-01-01 12:12:12',
successTip: '兑换成功请直接登录app使用'
}
@ -241,7 +242,7 @@
this.topImg = productConfig.top_image;
document.title = sessionStorage.getItem('title');
this.layout = productConfig.list;
this.iskey=sessionStorage.getItem('haskey');
this.iskey = sessionStorage.getItem('haskey');
this.describe = productConfig.describe;
},
methods: {
@ -256,10 +257,10 @@
this.gstatus = item.available;
},
backgoodsFn() {
let backUrl=window.history.length;
if(window.history.length){
history.go(-backUrl+1);
}
let backUrl = window.history.length;
if (window.history.length) {
history.go(-backUrl + 1);
}
},
// 单条弹框
openDialog() {
@ -273,7 +274,7 @@
async getGoods() {
let self = this;
let showType = sessionStorage.getItem('showType');
this.showType=showType;
this.showType = showType;
let data = {
"last_product_id": sessionStorage.getItem('lastid') | 0,
}
@ -289,16 +290,16 @@
it.token = item;
});
goodsItem = res.data;
}else{
self.maskshow = true;
self.popboxtype = '提示';
self.popboxshow = true;
self.tiptext = res.message;
if (res.code == -1) {
setTimeout(() => {
window.location.href = sessionStorage.getItem('white_link');
}, 3000);
}
} else {
self.maskshow = true;
self.popboxtype = '提示';
self.popboxshow = true;
self.tiptext = res.message;
if (res.code == -1) {
setTimeout(() => {
window.location.href = sessionStorage.getItem('white_link');
}, 3000);
}
}
});
goodsList = goodsList.concat(goodsItem);
@ -333,14 +334,14 @@
self.swiperDataList = goodsArr;
self.goodsShow = goodsArr.length > 1;
sessionStorage.setItem('goodsCount', goodsArr.length);
if (goodsArr && goodsArr.length == 1&&goodsArr[0].available==1) {
if (goodsArr && goodsArr.length == 1 && goodsArr[0].available == 1) {
sessionStorage.setItem('goodsInfo', JSON.stringify(goodsArr[0]));
sessionStorage.setItem('key',goodsArr[0].key);
sessionStorage.setItem('token',goodsArr[0].token);
sessionStorage.setItem('key', goodsArr[0].key);
sessionStorage.setItem('token', goodsArr[0].token);
// window.location.href = "./exchange.html";
window.location.replace("./exchange.html");
return false;
}else if(goodsArr && goodsArr.length >= 1) {
} else if (goodsArr && goodsArr.length >= 1) {
self.goodsNum = true;
self.onSelected(goodsArr[0])
self.$nextTick(function () {
@ -363,19 +364,19 @@
} else {
self.goodsNum = false;
}
}else {//兑换码
} else { //兑换码
data.token = sessionStorage.getItem('token')
req.axiosPostproducts('/key/products', data).then(res => {
if (res.code == 200) {
self.swiperDataList = res.data;
sessionStorage.setItem('goodsCount',res.data.length);
sessionStorage.setItem('goodsCount', res.data.length);
self.goodsShow = res.data.length > 1;
if (res.data && res.data.length == 1&&res.data[0].available==1) {
sessionStorage.setItem('goodsInfo', JSON.stringify(res.data[0]));
// window.location.href = "./exchange.html";
window.location.replace("./exchange.html");
return false;
}else if(res.data && res.data.length >= 1) {
if (res.data && res.data.length == 1 && res.data[0].available == 1) {
sessionStorage.setItem('goodsInfo', JSON.stringify(res.data[0]));
// window.location.href = "./exchange.html";
window.location.replace("./exchange.html");
return false;
} else if (res.data && res.data.length >= 1) {
self.goodsNum = true;
self.onSelected(res.data[0])
self.$nextTick(function () {
@ -429,9 +430,9 @@
this.gstatus = gstatus;
if (gstatus == 1) {
// 跳转商品详情页面
if(this.showType==1){//白名单
sessionStorage.setItem('token',row.token);
sessionStorage.setItem('key',row.key);
if (this.showType == 1) { //白名单
sessionStorage.setItem('token', row.token);
sessionStorage.setItem('key', row.key);
}
sessionStorage.setItem('goodsInfo', JSON.stringify(row));
// window.location.href = './exchange.html';

View File

@ -20,7 +20,6 @@
font-size: 26.66666667vw;
height: 100%;
}
body {
padding: 0;
font-size: .14rem;