Commit 2dcce7ac by 杨北旺

模拟后台数据字段,对接页面显示

1 parent 48118a5f

1.9 KB | W: | H:

604 Bytes | W: | H:

src/assets/images/cardRoll.png
src/assets/images/cardRoll.png
src/assets/images/cardRoll.png
src/assets/images/cardRoll.png
  • 2-up
  • Swipe
  • Onion skin

27.3 KB | W: | H:

15.6 KB | W: | H:

src/assets/images/equity/scrm_vip_package_icon.png
src/assets/images/equity/scrm_vip_package_icon.png
src/assets/images/equity/scrm_vip_package_icon.png
src/assets/images/equity/scrm_vip_package_icon.png
  • 2-up
  • Swipe
  • Onion skin
...@@ -73,6 +73,24 @@ ...@@ -73,6 +73,24 @@
</template> </template>
</div> </div>
</template> </template>
<template v-if="item.orderType==2">
<div class="card-img card-package-img"></div>
<div class="card-desc">
<div class="card-num"><span style="font-size: 18px;">¥</span>{{ item.orderPrices }}</div>
<div class="card-name">
<span class="card-name-span text-hide">{{ item.productName }}</span>
</div>
<div style="width:130px" class="card-time text-hide">
{{item.productNameDesc}}
</div>
<div class="card-operation">
<span class="lookbg" @click="jumpDetail(item)">查看卡券</span>
</div>
</div>
<div class="new-ver-card-status">
<span>已完成</span>
</div>
</template>
</div> </div>
</div> </div>
<div class="van-empty" v-if="cardList.length == 0"> <div class="van-empty" v-if="cardList.length == 0">
...@@ -190,6 +208,23 @@ export default { ...@@ -190,6 +208,23 @@ export default {
let { code, data, message } = res let { code, data, message } = res
if (code == 0) { if (code == 0) {
this.cardList = data?data:[]; this.cardList = data?data:[];
this.cardList.push({
orderStatus:6,
openRefund:0,
appearance:null,
refundCode:null,
orderType:2,
goodsQuality:1,
warrantyDate:null,
productNameDesc:'炸鸡腿券1炸鸡腿券1炸鸡腿券1炸鸡腿券1炸鸡腿券1炸鸡腿券1',
supplier:'HW',
officePrice:150,
brandName:null,
orderPrices:130,
productName:'单人套餐1',
orderCode:'GL113213416465',
orderDate:'2021.9.18'
})
} else { } else {
this.showToast(message) this.showToast(message)
} }
...@@ -277,8 +312,13 @@ export default { ...@@ -277,8 +312,13 @@ export default {
let { sessionId } = this.$store.state; let { sessionId } = this.$store.state;
this.$store.commit('setOrder',val) this.$store.commit('setOrder',val)
let [href] = window.location.href.split('/#/'); let [href] = window.location.href.split('/#/');
let url = `${href}/#/cardRoll/detail?sessionId=${sessionId}&orderCode=${val.orderCode}`; if(val.orderType==1){
this.openWindows(url, 'cardRoll.detail') let url = `${href}/#/cardRoll/detail?sessionId=${sessionId}&orderCode=${val.orderCode}`;
this.openWindows(url, 'cardRoll.detail')
}else{
let url = `${href}/#/commodity/packageDetail?sessionId=${sessionId}&orderCode=${val.orderCode}`;
this.openWindows(url, 'commodity.packageDetail')
}
}, },
jumpSales(val) { jumpSales(val) {
if(val.openRefund) { if(val.openRefund) {
...@@ -345,24 +385,27 @@ export default { ...@@ -345,24 +385,27 @@ export default {
//min-height: calc(100vh - 70px); //min-height: calc(100vh - 70px);
&-item { &-item {
margin-bottom: 10px; margin-bottom: 10px;
height: 100px; height: 101px;
box-sizing: border-box; box-sizing: border-box;
padding: 15px; padding: 10px;
background: #FFFFFF; background: #FFFFFF;
border-radius: 6px; border-radius: 4px;
display: flex; display: flex;
position: relative; position: relative;
>.card-img { >.card-img {
width: 70px; width: 81px;
height: 70px; height: 81px;
background-image: url('~@a/images/cardRoll.png'); background-image: url('~@a/images/cardRoll.png');
background-size: 100% 100%; background-size: 100% 100%;
.card-l-panel { .card-l-panel {
width: 70px; width: 81px;
height: 70px; height: 81px;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
text-align: center; text-align: center;
color: #FFFFFF; color: #FFFFFF;
padding: 9px 0px;
box-sizing: border-box; box-sizing: border-box;
.card-l-title,card-l-num { .card-l-title,card-l-num {
font-size: 12px; font-size: 12px;
...@@ -426,6 +469,8 @@ export default { ...@@ -426,6 +469,8 @@ export default {
} }
} }
>.card-operation { >.card-operation {
height: 24.3px;
margin-top: 10px;
span { span {
margin-right: 10px; margin-right: 10px;
display: inline-block; display: inline-block;
...@@ -459,6 +504,10 @@ export default { ...@@ -459,6 +504,10 @@ export default {
color: #FFFFFF; color: #FFFFFF;
font-size: 10px; font-size: 10px;
} }
>.card-package-img{
background-image: url('~@a/images/equity/scrm_vip_package_icon.png');
background-size: 100% 100%;
}
} }
} }
} }
......
...@@ -21,14 +21,14 @@ ...@@ -21,14 +21,14 @@
</div> </div>
</div> </div>
<div class="business-item business-number-n" v-if="!isHaveInventory">已抢光</div> <div class="business-item business-number-n" v-if="!isHaveInventory">已抢光</div>
<!-- <div class="business-item new-version"> <div v-if="addressInfo" class="business-item new-version">
<div class="business-item-label">附近门店</div> <div class="business-item-label">附近门店</div>
<div class="business-item-quality new-version-quality">南山区桃源街道塘朗城广场二楼..</div> <div class="business-item-quality new-version-quality">{{addressInfo.gasAddress}}</div>
<div class="new-version-location"> <div class="new-version-location" @click="openlocation">
<div class="location_text">5.5km</div> <div class="location_text">{{addressInfo.localAddressDistance}}km</div>
<div class="localtion_icon"></div> <div class="localtion_icon"></div>
</div> </div>
</div> --> </div>
<div class="business-item"> <div class="business-item">
<div class="business-item-label">质保期至</div> <div class="business-item-label">质保期至</div>
<div class="business-item-quality" v-if="selectData.warrantyDate">{{ new Date(selectData.warrantyDate).format('yyyy-MM-dd hh:mm:ss')}}</div> <div class="business-item-quality" v-if="selectData.warrantyDate">{{ new Date(selectData.warrantyDate).format('yyyy-MM-dd hh:mm:ss')}}</div>
...@@ -104,6 +104,8 @@ ...@@ -104,6 +104,8 @@
import { pay} from '@/mixins' import { pay} from '@/mixins'
import { commodity,equity} from "@r/api"; import { commodity,equity} from "@r/api";
import { Dialog } from 'vant' import { Dialog } from 'vant'
import WxConfig from "@u/WxConfig";
const WX = new WxConfig(["openLocation", "getLocation"]);
export default { export default {
mixins: [pay], mixins: [pay],
name: "business", name: "business",
...@@ -124,6 +126,7 @@ export default { ...@@ -124,6 +126,7 @@ export default {
status: true, status: true,
supplier: '', supplier: '',
isHaveInventory:true,//是否有库存 isHaveInventory:true,//是否有库存
addressInfo:null
} }
}, },
mounted() { mounted() {
...@@ -159,6 +162,13 @@ export default { ...@@ -159,6 +162,13 @@ export default {
commodity.getCouponDetail(para).then(res => { commodity.getCouponDetail(para).then(res => {
let { code, data, message } = res let { code, data, message } = res
if (code == 0) { if (code == 0) {
// 新版外包了一层经纬度,所以这里得处理一下
// this.addressInfo = {
// gasAddressLatitude:data.latitude,
// gasAddressLongitude:data.longitude,
// gasAddress:data.localAddress,
// localAddressDistance:data.localAddressDistance
// }
this.businessList = data; this.businessList = data;
this.selectData = this.businessList[0] this.selectData = this.businessList[0]
if(this.selectedId){//存在则是从精选处跳转进来的 if(this.selectedId){//存在则是从精选处跳转进来的
...@@ -272,6 +282,10 @@ export default { ...@@ -272,6 +282,10 @@ export default {
} }
} }
}, },
// 打开导航
openlocation(){
this.openNavigation(this.addressInfo,WX)
}
} }
} }
</script> </script>
......
<template> <template>
<div class="package_detail_page"> <div class="package_detail_page">
<div class="content_wrapper"> <div class="content_wrapper">
<div v-for="count in 6" :key="count" class="line_wrpper"> <div v-for="(item,index) in packageInfo.couponsDetails" :key="index" class="line_wrpper">
<div class="line_left"> <div class="line_left">
<div class="line_icon"></div> <div class="line_icon"></div>
<div class="line_text">{{ count }}、全车镀金</div> <div class="line_text">{{ index+1 }}、{{item.couponName}}</div>
</div> </div>
<div class="line_right">去使用</div> <div class="line_right">去使用</div>
</div> </div>
<div class="title_tip">附:购买套餐后到店赠送餐具一套</div> <div v-if="packageInfo.notes" class="title_tip">附:{{packageInfo.notes}}</div>
</div> </div>
<div class="store_wrapper"> <div class="store_wrapper">
<div class="cell_wrap"> <div class="cell_wrap">
<span>服务门店</span> <span>服务门店</span>
<span class="cell_val">城中店</span> <span class="cell_val">{{packageInfo.merchantName}}</span>
</div> </div>
<div class="cell_wrap"> <div class="cell_wrap">
<span>付款金额</span> <span>付款金额</span>
<span class="cell_val">299元</span> <span class="cell_val">{{packageInfo.orderPrice}}元</span>
</div> </div>
<div class="cell_wrap"> <div class="cell_wrap">
<span>订单编号</span> <span>订单编号</span>
<span class="cell_val">465465456456</span> <span class="cell_val">{{packageInfo.orderCode}}</span>
</div> </div>
<div class="cell_wrap"> <div class="cell_wrap">
<span>下单时间</span> <span>下单时间</span>
<span class="cell_val">2021-07-22 12:34:36</span> <span class="cell_val">{{packageInfo.createDate}}</span>
</div> </div>
<div class="location_wrap"> <div class="location_wrap" @click="toOpenLocation">
<div class="icon_l"></div> <div class="icon_l"></div>
<div class="text_l">导航</div> <div class="text_l">导航</div>
</div> </div>
...@@ -36,16 +36,54 @@ ...@@ -36,16 +36,54 @@
</template> </template>
<script type='text/ecmascript-6'> <script type='text/ecmascript-6'>
import WxConfig from "@u/WxConfig";
const WX = new WxConfig(["openLocation", "getLocation"]);
export default { export default {
name: "", name: "",
data() { data() {
return {}; return {
packageInfo:{}
};
}, },
beforeCreate() { beforeCreate() {
document.querySelector("body").setAttribute("style", "background:#F5F5F5"); document.querySelector("body").setAttribute("style", "background:#F5F5F5");
}, },
mounted() {}, mounted() {
methods: {}, this.packageInfo = {
notes:'这是套餐的备注',
createDate:'2021-09-18',
latitude:22.536197,
longitude: 113.959296,
merchantAddress:'湾科技生态园',
packageName:'单人套餐1',
merchantName:'广汇门店',
orderPrice:130,
orderCode:'GL21321321321',
couponsDetails:[
{
couponName:'炸鸡腿1',
userCouponsId:1,
shortLink:'跳转小程序券详情短链'
},
{
couponName:'炸鸡腿2',
userCouponsId:2,
shortLink:'跳转小程序券详情短链'
},
]
}
},
methods: {
toOpenLocation(){
let temp = this.packageInfo
let val = {
gasAddressLatitude:temp.latitude,
gasAddressLongitude:temp.longitude,
gasAddress:temp.merchantAddress
}
this.openNavigation(val,WX)
}
},
}; };
</script> </script>
......
<template> <template>
<div class="package_page_widget"> <div class="package_page_widget">
<div class="top_wrapper">高级会员套餐</div> <div class="top_wrapper">{{packageInfo.packageName}}</div>
<div class="title_widget"> <div class="title_widget">
现在购买尊享<span class="title_num">13项</span>超值权益 现在购买尊享<span class="title_num">{{packageInfo.count}}项</span>超值权益
</div> </div>
<div class="package_content_wrapper"> <div class="package_content_wrapper">
<div v-for="count in 6" :key="count" class="package_element"> <div v-for="(item,index) in packageInfo.couponsDetailList" :key="index" class="package_element">
<div class="ele_top">{{ count }}、全车镀金</div> <div class="ele_top">{{index+1}}、{{ item.couponName }}</div>
<div class="ele_right">数量:x3</div> <div class="ele_right">数量:x{{item.serviceQuantity}}</div>
<div class="ele_left">有效期:365天</div> <div v-if="item.useType!=0&&item.effectiveType==1" class="ele_left">有效期:{{item.effectiveDays}}天</div>
<div class="ele_bottom">使用限制:有效期内可用1次</div> <div v-if="item.useType!=0&&item.effectiveType==2" class="ele_left">有效期:{{item.effectiveStarttime}}-{{item.effectiveEndTime}}</div>
<div v-if="item.useType==0" class="ele_left">有效期:无有效期</div>
<div v-if="item.useType==1" class="ele_bottom">有效期内可用{{item.useAmount}}次</div>
<div v-if="item.useType==2" class="ele_bottom">有效期内每{{item.useLimitDays}}天可用{{item.useAmount}}次</div>
<div v-if="item.useType==0" class="ele_bottom"></div>
</div> </div>
<div class="content_tip">附:购买套餐后到店赠送餐具一套</div> <div v-if="packageInfo.notes" class="content_tip">附:{{packageInfo.notes}}</div>
</div> </div>
<div class="title_widget">权益计价器</div> <div class="title_widget">权益计价器</div>
<div class="price_content_wrapper"> <div class="price_content_wrapper">
<div v-for="count in 6" :key="count" class="content_line_wrap"> <div v-for="(item,index) in packageInfo.couponsDetailList" :key="index" class="content_line_wrap">
<div class="line_left">全车镀金</div> <div class="line_left">{{item.couponName}}</div>
<div class="line_mid">数量:x3</div> <div class="line_mid">数量:x{{item.serviceQuantity}}</div>
<div class="line_right"> <div class="line_right">
价值约:<span class="red_price">127</span>元 价值约:<span class="red_price">{{item.shopTotalPrice}}</span>元
</div> </div>
</div> </div>
<div class="total_price"> <div class="total_price">
套餐内权益实际价值总计约<span class="red_price">720</span>元 套餐内权益实际价值总计约<span class="red_price">{{packageInfo.totalPrice}}</span>元
</div> </div>
</div> </div>
<div class="title_min_tip">注意:套餐一经购买,不支持退款</div> <div class="title_min_tip">注意:套餐一经购买,不支持退款</div>
<div class="buy_btn" @click="jumpToPackageDetail"> <div class="buy_btn" @click="jumpToPackageDetail">
限时特价仅需¥299,点击购买 限时特价仅需¥{{packageInfo.packagePrice}},点击购买
</div> </div>
<div style="height: 28px"></div> <div style="height: 28px"></div>
</div> </div>
</template> </template>
<script type='text/ecmascript-6'> <script type='text/ecmascript-6'>
import {cardRoll} from "@r/api";
export default { export default {
name: "", name: "",
data() { data() {
return {}; return {
packageInfo:{},
orderCode:'',
paySource:1,
};
}, },
beforeCreate() { beforeCreate() {
document.querySelector("body").setAttribute("style", "background:#F5F5F5"); document.querySelector("body").setAttribute("style", "background:#F5F5F5");
}, },
mounted() {}, mounted() {
document.title = '广汇门店'
this.getDetailInfo()
this.getPaySource()
},
methods: { methods: {
// 判断当前环境获取支付环境
getPaySource(){
let num = this.getChannel()
if(num==3){//H5
this.paySource = 1
}else if(num==1){//小程序
this.paySource = 3
}else if(num==2){//app
this.paySource = 2
}
},
// 获取门店套餐详情
getDetailInfo(){
let data = {
id:1,
packageName:'单人套餐1',
totalPrice:150,
packagePrice:135,
notes:'这是套餐的备注',
count:10,
couponsDetailList:[
{
serviceQuantity:3,
useType:0,
effectiveType:3,
effectiveEndTime:'2022.9.10',
effectiveStarttime:'2021.9.18',
useLimitDays:6,
couponName:'炸鸡腿券1炸鸡腿券1炸鸡腿券1炸鸡腿券1炸鸡腿券1炸鸡腿券1',
shopTotalPrice:50,
effectiveDays:20,
useAmount:3
},
{
serviceQuantity:4,
useType:1,
effectiveType:2,
effectiveEndTime:'2022.9.10',
effectiveStarttime:'2021.9.18',
useLimitDays:6,
couponName:'炸鸡腿券2',
shopTotalPrice:50,
effectiveDays:20,
useAmount:3
},
{
serviceQuantity:3,
useType:2,
effectiveType:1,
effectiveEndTime:'2022.9.10',
effectiveStarttime:'2021.9.18',
useLimitDays:6,
couponName:'炸鸡腿券3',
shopTotalPrice:50,
effectiveDays:20,
useAmount:3
},
]
}
this.packageInfo = data
},
// 购买套餐
toBuyPackage(){
//先获取门店订单编号---在发起请求
let { sessionId} = this.$store.state;
let para = {
orderCode:this.orderCode,
packageId:this.packageInfo.id,
paySource:this.paySource,
sessionId:sessionId
}
console.log(para);
},
// 获取门店单号
getOrderCode(){
this.showLoading();
cardRoll.getStoreOrderCode().then(res=>{
const {code,data,message} = res
if(code==0){
this.orderCode = data.data
}else{
this.showToast(message);
}
this.hideLoading();
})
},
// 跳转到套餐详情 // 跳转到套餐详情
jumpToPackageDetail() { jumpToPackageDetail() {
let { sessionId } = this.$store.state; let { sessionId } = this.$store.state;
...@@ -97,22 +196,27 @@ export default { ...@@ -97,22 +196,27 @@ export default {
height: 41px; height: 41px;
margin-bottom: 24px; margin-bottom: 24px;
.ele_top { .ele_top {
width: 70%;
color: #282829; color: #282829;
font-size: 14px; font-size: 14px;
font-weight: 500; font-weight: 500;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
} }
.ele_right { .ele_right {
color: #282829; color: #282829;
font-size: 12px; font-size: 12px;
position: absolute; position: absolute;
right: 0; right: 0;
top: 0px; top: 2px;
font-weight: 500;
} }
.ele_left { .ele_left {
color: #b1b1b3; color: #b1b1b3;
font-size: 12px; font-size: 12px;
position: absolute; position: absolute;
left: 23px; left: 20px;
bottom: 0; bottom: 0;
} }
.ele_bottom { .ele_bottom {
...@@ -147,6 +251,9 @@ export default { ...@@ -147,6 +251,9 @@ export default {
color: #282829; color: #282829;
font-size: 12px; font-size: 12px;
font-weight: 500; font-weight: 500;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
} }
.line_mid { .line_mid {
width: 50px; width: 50px;
......
...@@ -292,8 +292,13 @@ export default { ...@@ -292,8 +292,13 @@ export default {
sessionStorage.setItem("GL_EQUITY_USER_INFO",JSON.stringify(data)); sessionStorage.setItem("GL_EQUITY_USER_INFO",JSON.stringify(data));
sessionStorage.setItem("CODE_PAST_DUE",false); sessionStorage.setItem("CODE_PAST_DUE",false);
this.$store.commit("setUserInfo", data); this.$store.commit("setUserInfo", data);
let flag = window.location.href.indexOf('/#/')
if(flag!=-1){
window.location.href = `${window.location.href.split('/#/')[0]}/#/equity/index`
}else{
window.location.href = `${window.location.href.split('?')[0]}#/equity/index`
}
// window.vm.$router.replace({ name: 'equity.index' }); // window.vm.$router.replace({ name: 'equity.index' });
window.location.href = `${window.location.href.split('?')[0]}#/equity/index`
} else { } else {
this.showToast(message); this.showToast(message);
} }
......
...@@ -67,22 +67,32 @@ export default { ...@@ -67,22 +67,32 @@ export default {
let wheight = window.innerHeight + "px"; let wheight = window.innerHeight + "px";
this.deviceH = wheight; this.deviceH = wheight;
this.showLoading(); this.showLoading();
let self = this let self = this;
setTimeout(() => { setTimeout(() => {
self.$nextTick(() => { self.$nextTick(() => {
self.getTwoHeightArr(); self.getTwoHeightArr();
}); });
self.hideLoading() self.hideLoading();
}, 2000); }, 2000);
}, },
methods: { methods: {
// 点击跳转商品详情 // 点击跳转商品详情
toNextPage(e, cate) { toNextPage(e, cate) {
let temp = cate.goodsCategory; let temp = cate.goodsCategory;
console.log(temp);
if (temp == "汽车权益") { if (temp == "汽车权益") {
this.CarLink(e); this.CarLink(e);
} else { } else {
this.jumpLink(e); let { sessionId } = this.$store.state;
if (e.appearance == 1) {
let [href] = window.location.href.split("/#/");
let url = `${href}/#/commodity/business?sessionId=${sessionId}&supplier=${e.supplier}&brandName=${e.brandName}`;
this.openWindows(url);
} else if (e.appearance == 2) {
let [href] = window.location.href.split("/#/");
let url = `${href}/#/commodity/recharge?sessionId=${sessionId}&supplier=${e.supplier}&brandName=${e.brandName}`;
this.openWindows(url);
}
} }
}, },
// 获取所有权益商品 // 获取所有权益商品
...@@ -172,8 +182,8 @@ export default { ...@@ -172,8 +182,8 @@ export default {
}; };
}, },
}, },
destroyed(){ destroyed() {
window.removeEventListener('scroll', this.bindScrollEvent, false); window.removeEventListener("scroll", this.bindScrollEvent, false);
}, },
}; };
</script> </script>
...@@ -192,7 +202,7 @@ export default { ...@@ -192,7 +202,7 @@ export default {
.left_element { .left_element {
width: 100%; width: 100%;
height: 60px; height: 60px;
background: #EFF0F2; background: #eff0f2;
font-size: 13px; font-size: 13px;
color: #656566; color: #656566;
display: flex; display: flex;
...@@ -200,18 +210,18 @@ export default { ...@@ -200,18 +210,18 @@ export default {
justify-content: center; justify-content: center;
} }
.left_active { .left_active {
background:#FFF; background: #fff;
color: #282829; color: #282829;
font-weight: bold; font-weight: bold;
} }
.left_active_line{ .left_active_line {
position: absolute; position: absolute;
left: 0; left: 0;
top: 50%; top: 50%;
transform: translate(0,-50%); transform: translate(0, -50%);
width: 4px; width: 4px;
height: 30px; height: 30px;
background: #FC5B32; background: #fc5b32;
border-radius: 1px; border-radius: 1px;
} }
} }
...@@ -266,8 +276,8 @@ export default { ...@@ -266,8 +276,8 @@ export default {
color: #282829; color: #282829;
font-size: 12px; font-size: 12px;
} }
.espc{ .espc {
color: #FC5B32; color: #fc5b32;
font-size: 10px; font-size: 10px;
} }
} }
......
...@@ -75,6 +75,7 @@ ...@@ -75,6 +75,7 @@
v-for="(ele, i) in menuList[index]" v-for="(ele, i) in menuList[index]"
:key="i" :key="i"
class="menu_elememt" class="menu_elememt"
@click="toNewPage(ele)"
> >
<div class="menu_icon"> <div class="menu_icon">
<img :src="ele.equityIcon" alt="" /> <img :src="ele.equityIcon" alt="" />
...@@ -143,7 +144,9 @@ ...@@ -143,7 +144,9 @@
<template v-for="(item, index) in siftList"> <template v-for="(item, index) in siftList">
<div :key="index" class="high_widget"> <div :key="index" class="high_widget">
<div class="left_fixed_box"> <div class="left_fixed_box">
<div class="label_icon"></div> <div class="label_icon">
<img :src="item.icon">
</div>
<div class="label_text">{{item.equityName}}</div> <div class="label_text">{{item.equityName}}</div>
</div> </div>
<div class="right_box"> <div class="right_box">
...@@ -172,43 +175,50 @@ ...@@ -172,43 +175,50 @@
{{item.localAddress}} {{item.localAddress}}
</div> </div>
<div class="line"></div> <div class="line"></div>
<div class="sistence">距您{{item.localAddressDistance}}km</div> <div class="sistence" @click="jxOpenLocation(item)">距您{{item.localAddressDistance}}km</div>
</div> </div>
</div> </div>
</div> </div>
</template> </template>
</div> </div>
<div v-if="curTabIndex == 1" class="oil_serve_widget"> <van-list
<div class="oil-list-box" v-for="(item, index) in oilList" :key="index"> v-if="curTabIndex == 1"
<div class="oil-list-h"> v-model="loading"
<div class="oil-list-img"> :finished="finished"
<img :src="item.gasLogoSmall" alt="" /> @load="getMoreOilData"
</div> @offset="300">
<div class="oil-list-desc"> <div class="oil_serve_widget">
<div class="oil-desc-t1 text-hide">{{ item.gasName }}</div> <div class="oil-list-box" v-for="(item, index) in oilList" :key="index" @click="jumpDetail(item)">
<div class="oil-desc-t2"> <div class="oil-list-h">
<span>¥{{ item.priceYfq }}/升</span> <div class="oil-list-img">
<span>国标价¥{{ item.priceOfficial }}/升</span> <img :src="item.gasLogoSmall" alt="" />
</div>
<div class="oil-list-desc">
<div class="oil-desc-t1 text-hide">{{ item.gasName }}</div>
<div class="oil-desc-t2">
<span>¥{{ item.priceYfq }}/升</span>
<span>国标价¥{{ item.priceOfficial }}/升</span>
</div>
<div class="oil-desc-t3">每升优惠 {{ item.priceReduced }} 元</div>
</div> </div>
<div class="oil-desc-t3">每升优惠 {{ item.priceReduced }} 元</div>
</div> </div>
</div> <div class="oil-list-f">
<div class="oil-list-f"> <span class="text-hide"
<span class="text-hide" ><van-icon color="#FC5B32" name="location" class="location-icon" />{{
><van-icon color="#FC5B32" name="location" class="location-icon" />{{ item.gasAddress
item.gasAddress }}</span
}}</span >
> <div class="list-f-distance-line"></div>
<div class="list-f-distance-line"></div> <div class="list-f-distance">
<div class="list-f-distance"> {{ item.distance }}km
{{ item.distance }}km <div @click.stop="openLocation(item)" class="navigation-btn">
<div @click.stop="openLocation(item)" class="navigation-btn"> <img src="@a/images/equity/scrm_location_icon.png" alt="" />
<img src="@a/images/equity/scrm_location_icon.png" alt="" /> </div>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
</div> </van-list>
</div> </div>
</template> </template>
...@@ -245,6 +255,8 @@ export default { ...@@ -245,6 +255,8 @@ export default {
oilList: [], oilList: [],
pageNum: 1, pageNum: 1,
pageSize: 10, pageSize: 10,
loading:false,
finished: false,
//卡包数量 //卡包数量
packageNumber:0, packageNumber:0,
//门店套餐 //门店套餐
...@@ -300,7 +312,6 @@ export default { ...@@ -300,7 +312,6 @@ export default {
} }
equity.getFissionInfo(URLParams).then((res) => { equity.getFissionInfo(URLParams).then((res) => {
let { code, data } = res; let { code, data } = res;
// this.hideLoading();
if (code == 0) { if (code == 0) {
if (data) { if (data) {
this.inviteUrl = data.posterUrl; this.inviteUrl = data.posterUrl;
...@@ -321,7 +332,6 @@ export default { ...@@ -321,7 +332,6 @@ export default {
} else if (urlObj.fissionUser === "false") { } else if (urlObj.fissionUser === "false") {
equity.getFissionInfo(URLParams).then((res) => { equity.getFissionInfo(URLParams).then((res) => {
let { code, data } = res; let { code, data } = res;
// this.hideLoading();
if (code == 0) { if (code == 0) {
if (data) { if (data) {
if (data.presentNumber > 0) { if (data.presentNumber > 0) {
...@@ -440,7 +450,6 @@ export default { ...@@ -440,7 +450,6 @@ export default {
openCard(data) { openCard(data) {
equity.openCardFission({ ...data }).then((res) => { equity.openCardFission({ ...data }).then((res) => {
let { code, message } = res; let { code, message } = res;
// this.hideLoading()
if (code == 0) { if (code == 0) {
// //
} else { } else {
...@@ -643,10 +652,19 @@ export default { ...@@ -643,10 +652,19 @@ export default {
}); });
}); });
}, },
// 打开导航 // 加油打开导航
openLocation(val) { openLocation(val) {
this.openNavigation(val, WX); this.openNavigation(val, WX);
}, },
// 精选打开导航
jxOpenLocation(item){
let val = {
gasAddressLatitude:item.lat,
gasAddressLongitude:item.lng,
gasAddress:item.localAddress
}
this.openNavigation(val, WX);
},
// 退出登录 // 退出登录
toLoginOut() { toLoginOut() {
this.myDialog( this.myDialog(
...@@ -674,6 +692,21 @@ export default { ...@@ -674,6 +692,21 @@ export default {
let url = `${href}/#/cardRoll/cardPage?sessionId=${sessionId}`; let url = `${href}/#/cardRoll/cardPage?sessionId=${sessionId}`;
this.openWindows(url, "cardRoll.cardPage"); this.openWindows(url, "cardRoll.cardPage");
}, },
// 跳转到新的页面
toNewPage(item){
let { sessionId } = this.$store.state;
if(item.appearance==1){
let [href] = window.location.href.split('/#/');
let url = `${href}/#/commodity/business?sessionId=${sessionId}&supplier=${item.supplier}&brandName=${item.brandName}`;
this.openWindows(url)
}else if(item.appearance==2){
let [href] = window.location.href.split('/#/');
let url = `${href}/#/commodity/recharge?sessionId=${sessionId}&supplier=${item.supplier}&brandName=${item.brandName}`;
this.openWindows(url)
}else{
this.CarLink(item);
}
},
// 跳转到权益集合 // 跳转到权益集合
toAllEquityPage() { toAllEquityPage() {
let { sessionId } = this.$store.state; let { sessionId } = this.$store.state;
...@@ -690,7 +723,6 @@ export default { ...@@ -690,7 +723,6 @@ export default {
}, },
// 精选去购买 // 精选去购买
toBuyGoods(goods,item){ toBuyGoods(goods,item){
// this.jumpLink(item,goods)
let selectedId = goods.id let selectedId = goods.id
let { sessionId } = this.$store.state; let { sessionId } = this.$store.state;
if(item.appearance==1){ if(item.appearance==1){
...@@ -719,11 +751,39 @@ export default { ...@@ -719,11 +751,39 @@ export default {
let { code, data, message } = res; let { code, data, message } = res;
if (code == 0) { if (code == 0) {
this.oilList = this.pageNum == 1 ? data : this.oilList.concat(data); this.oilList = this.pageNum == 1 ? data : this.oilList.concat(data);
this.loading = false;
if (this.oilList.length%this.pageSize != 0 || (data.length == 0 && this.oilList.length !=0)) this.finished = true
} else { } else {
this.showToast(message); this.showToast(message);
} }
}); });
}, },
// 跳转加油站详情
jumpDetail(val) {
const ua = navigator.userAgent.toLowerCase()
if (ua.match(/MicroMessenger/i) == 'micromessenger') {
window.vm.$router.push({ name: 'oilStation.detail',query:{
oilId: val.id,
oilNo: val.oilNo,
longitude: val.gasAddressLongitude,
latitude: val.gasAddressLatitude,
distance: val.distance
}
})
}else{
let { sessionId } = this.$store.state;
let [href] = window.location.href.split('/#/');
let url = `${href}/#/oilStation/detail?sessionId=${sessionId}&oilId=${val.id}&&oilNo=${val.oilNo}&longitude=${val.gasAddressLongitude}&latitude=${val.gasAddressLatitude}&distance=${val.distance}`;
this.openWindows(url, 'oilStation.detail')
}
},
// 加油列表分页
getMoreOilData() {
if (this.oilList.length != 0 && this.oilList.length % this.pageSize == 0) {
this.pageNum = this.pageNum + 1
this.getStationList()
}
},
// 数组切割 // 数组切割
splitArr(arr, num) { splitArr(arr, num) {
let newArr = []; let newArr = [];
...@@ -793,11 +853,14 @@ export default { ...@@ -793,11 +853,14 @@ export default {
let data = [ let data = [
{ {
supplier:'HW', supplier:'HW',
icon:'http://qcimg01.glsx.net:7060/group1/M00/00/21/wKgD3mD5RSyAAnfDAADXLGDvl9k971.jpg',
appearance:1, appearance:1,
brandName:'星巴克', brandName:'星巴克',
equityName:'星巴克', equityName:'星巴克',
localAddress:'广东省深圳市南山区塘朗崇文花园附近', localAddress:'湾科技生态园',
localAddressDistance:0.2, localAddressDistance:0.2,
lat:'22.536197',
lng:'113.959296',
couponsGoodsList:[ couponsGoodsList:[
{ {
id:160, id:160,
...@@ -817,11 +880,14 @@ export default { ...@@ -817,11 +880,14 @@ export default {
}, },
{ {
supplier:'HW', supplier:'HW',
icon:'http://qcimg01.glsx.net:7060/group1/M00/00/21/wKgD3mD5RSyAAnfDAADXLGDvl9k971.jpg',
appearance:2, appearance:2,
brandName:'芒果TV', brandName:'芒果TV',
equityName:'1', equityName:'1',
localAddress:'广东省深圳市南山区塘朗崇文花园附近', localAddress:'湾科技生态园',
localAddressDistance:0.3, localAddressDistance:0.3,
lat:'22.536197',
lng:'113.959296',
chargeGoddsList:[ chargeGoddsList:[
{ {
productName:'视频会员月卡', productName:'视频会员月卡',
...@@ -1290,7 +1356,11 @@ body { ...@@ -1290,7 +1356,11 @@ body {
width: 45.34px; width: 45.34px;
height: 45.34px; height: 45.34px;
border-radius: 50%; border-radius: 50%;
background: brown; >img{
width: 45.34px;
height: 45.34px;
border-radius: 50%;
}
} }
.label_text { .label_text {
width: 45.34px; width: 45.34px;
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!