Commit ced8a2ab by 杨北旺

对接部分接口

1 parent 2dcce7ac
...@@ -32,7 +32,7 @@ export const equity = { ...@@ -32,7 +32,7 @@ export const equity = {
}, },
/** 是否开通权益 */ /** 是否开通权益 */
getMerchantid(data) { getMerchantid(data) {
return request(data, 'scrm.api.equity.pakage.by.merchantid') return request(data, 'scrm.api.equity.third.get')
}, },
/** 获取Edj地址 */ /** 获取Edj地址 */
getEdjUrl(data) { getEdjUrl(data) {
...@@ -59,8 +59,8 @@ export const equity = { ...@@ -59,8 +59,8 @@ export const equity = {
return request({}, 'scrm.api.equity.main.page.third.equity.get') return request({}, 'scrm.api.equity.main.page.third.equity.get')
}, },
/**获取门店套餐 */ /**获取门店套餐 */
getStorePackage() { getStorePackage(data) {
return request({}, 'scrm.api.equity.main.page.merchant.package.get') return request(data, 'scrm.api.equity.main.page.merchant.package.get')
}, },
/**获取首页精选 */ /**获取首页精选 */
getHotData(data) { getHotData(data) {
...@@ -230,6 +230,10 @@ export const commodity = { ...@@ -230,6 +230,10 @@ export const commodity = {
getPackageDeail(data) { getPackageDeail(data) {
return request(data, 'scrm.api.equity.main.page.package.detail.get') return request(data, 'scrm.api.equity.main.page.package.detail.get')
}, },
/**获取门店套餐订单详情 */
getPackageOrderDetail(data) {
return request(data, 'scrm.api.equity.h5.package.order.detail.get')
},
/**获取门店订单编号 */ /**获取门店订单编号 */
getStoreOrderCode(data) { getStoreOrderCode(data) {
return request(data, 'scrm.api.equity.merchant.order.code.create') return request(data, 'scrm.api.equity.merchant.order.code.create')
......
...@@ -19,17 +19,17 @@ Vue.use(preview) ...@@ -19,17 +19,17 @@ Vue.use(preview)
Vue.config.productionTip = false Vue.config.productionTip = false
Vue.prototype.isMiniprogram = window.__wxjs_environment === 'miniprogram' Vue.prototype.isMiniprogram = window.__wxjs_environment === 'miniprogram'
axios({ axios({
baseURL: process.env.VUE_APP_REPO + '/scrm-equity-mobile-config', baseURL: process.env.VUE_APP_REPO + '/scrm-equity-mobile-config',
method: 'get' method: 'get'
}).then(({ }).then(({
data: config data: config
}) => { }) => {
window.$baseConfig = config window.$baseConfig = config
window.vm = new Vue({ window.vm = new Vue({
router, router,
store, store,
render: h => { render: h => {
return h(App) return h(App)
} }
}).$mount('#app') }).$mount('#app')
}) })
\ No newline at end of file \ No newline at end of file
const pages = { const pages = {
equity: [ equity: [
{name: 'index'}, { name: 'index' },
{name: 'road', title: '道路救援',showNavBar: true}, { name: 'road', title: '道路救援', showNavBar: true },
{name: 'tyre', title: '轮胎保障',showNavBar: true}, { name: 'tyre', title: '轮胎保障', showNavBar: true },
{name: 'collision', title: '碰撞维修',showNavBar: true}, { name: 'collision', title: '碰撞维修', showNavBar: true },
{name: 'compensate', title: '盗抢补偿',showNavBar: true}, { name: 'compensate', title: '盗抢补偿', showNavBar: true },
{name: 'loss', title: '整车全损',showNavBar: true}, { name: 'loss', title: '整车全损', showNavBar: true },
{name: 'allEquity', title: '全部权益',showNavBar: true}, { name: 'allEquity', title: '全部权益', showNavBar: true },
], ],
oilStation: [ oilStation: [
{name: 'index'}, { name: 'index' },
{name: 'record', title: '加油记录',showNavBar: true}, { name: 'record', title: '加油记录', showNavBar: true },
{name: 'detail', title: '加油站详情',showNavBar: true}, { name: 'detail', title: '加油站详情', showNavBar: true },
{name: 'location', title: '加油站详情',showNavBar: true}, { name: 'location', title: '加油站详情', showNavBar: true },
], ],
common: [ common: [
{name: 'index'}, { name: 'index' },
{name: 'activate', title: '激活权益',showNavBar: true}, { name: 'activate', title: '激活权益', showNavBar: true },
{name: 'explain', title: '常见疑问',showNavBar: true}, { name: 'explain', title: '常见疑问', showNavBar: true },
{name: 'phoneLogin', title: '登录',wxAuth: true}, { name: 'phoneLogin', title: '登录', wxAuth: true },
{name: 'nothing'}, { name: 'nothing' },
{name: 'appTip'}, { name: 'appTip' },
{name: 'expcard',title: '体验卡领取'}, { name: 'expcard', title: '体验卡领取' },
{name: 'marketing', wxAuth: true}, { name: 'marketing', wxAuth: true },
], ],
car: [{ car: [{
name: 'marketing', name: 'marketing',
...@@ -32,8 +32,7 @@ const pages = { ...@@ -32,8 +32,7 @@ const pages = {
wxAuth: true, wxAuth: true,
title: '绑定挪车码' title: '绑定挪车码'
}], }],
cardRoll: [ cardRoll: [{
{
name: 'index', name: 'index',
title: '我的卡券', title: '我的卡券',
showNavBar: true showNavBar: true
...@@ -74,19 +73,18 @@ const pages = { ...@@ -74,19 +73,18 @@ const pages = {
}, },
{ {
name: 'cardPage', name: 'cardPage',
title:'我的卡包', title: '我的卡包',
showNavBar: true showNavBar: true
}, },
{ {
name: 'couponsDetail', name: 'couponsDetail',
title:'券详情', title: '券详情',
showNavBar: true showNavBar: true
} }
], ],
commodity: [ commodity: [{
{
name: 'process', name: 'process',
title:'充值流程', title: '充值流程',
showNavBar: true showNavBar: true
}, },
{ {
...@@ -95,7 +93,7 @@ const pages = { ...@@ -95,7 +93,7 @@ const pages = {
}, },
{ {
name: 'success', name: 'success',
title:'支付成功', title: '支付成功',
showNavBar: true showNavBar: true
}, },
{ {
...@@ -112,20 +110,21 @@ const pages = { ...@@ -112,20 +110,21 @@ const pages = {
}, },
{ {
name: 'packageSuccess', name: 'packageSuccess',
title:'支付成功', title: '支付成功',
showNavBar: true showNavBar: true
}, },
], ],
device: [{ device: [{
name: 'index', name: 'index',
wxAuth: true, wxAuth: true,
authBase: true, authBase: true,
title: '设备关联' title: '设备关联'
}, },
{ {
name: 'list', name: 'list',
title: '设备关联' title: '设备关联'
}] }
]
} }
const getParams = str => { const getParams = str => {
let params = str.split('?') let params = str.split('?')
...@@ -133,33 +132,35 @@ const getParams = str => { ...@@ -133,33 +132,35 @@ const getParams = str => {
let param = params[1].split('&') let param = params[1].split('&')
let obj = {} let obj = {}
for (let i = 0; i < param.length; i++) { for (let i = 0; i < param.length; i++) {
let paramsA = param[i].split('=') let paramsA = param[i].split('=')
let key = paramsA[0] let key = paramsA[0]
let value = paramsA[1] let value = paramsA[1]
obj[key] = value obj[key] = value
} }
return obj return obj
} }
let routes = [] let routes = []
const ua = navigator.userAgent.toLowerCase() const ua = navigator.userAgent.toLowerCase()
let isWeiXin = ua.match(/MicroMessenger/i) == 'micromessenger' let isWeiXin = ua.match(/MicroMessenger/i) == 'micromessenger'
let defaultName = isWeiXin?'common.phoneLogin':'common.marketing' let defaultName = isWeiXin ? 'common.phoneLogin' : 'common.marketing'
let urlParam = getParams(location.href) let urlParam = getParams(location.href)
let freecards = sessionStorage.getItem('freecards') let freecards = sessionStorage.getItem('freecards')
let flag = Object.keys(urlParam); let flag = Object.keys(urlParam);
console.log(flag); if (window.__wxjs_environment == 'miniprogram') {
if(flag.length){ defaultName = 'equity.index'
if((urlParam.freecards=='1') || (freecards=='1')){
defaultName = 'common.expcard'
sessionStorage.setItem('freecards','1')
}
} }
if(freecards=='1'){ if (flag.length) {
defaultName = 'common.expcard' if ((urlParam.freecards == '1') || (freecards == '1')) {
defaultName = 'common.expcard'
sessionStorage.setItem('freecards', '1')
}
}
if (freecards == '1') {
defaultName = 'common.expcard'
} }
Object.keys(pages).map(parent => { Object.keys(pages).map(parent => {
pages[parent].map((val, index) => { pages[parent].map((val, index) => {
let {name} = val let { name } = val
let meta = val let meta = val
delete meta.name delete meta.name
meta.rank = index meta.rank = index
...@@ -174,4 +175,4 @@ Object.keys(pages).map(parent => { ...@@ -174,4 +175,4 @@ Object.keys(pages).map(parent => {
routes.push(route) routes.push(route)
}) })
}) })
export default routes export default routes
\ No newline at end of file \ No newline at end of file
...@@ -208,23 +208,6 @@ export default { ...@@ -208,23 +208,6 @@ 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)
} }
...@@ -317,7 +300,7 @@ export default { ...@@ -317,7 +300,7 @@ export default {
this.openWindows(url, 'cardRoll.detail') this.openWindows(url, 'cardRoll.detail')
}else{ }else{
let url = `${href}/#/commodity/packageDetail?sessionId=${sessionId}&orderCode=${val.orderCode}`; let url = `${href}/#/commodity/packageDetail?sessionId=${sessionId}&orderCode=${val.orderCode}`;
this.openWindows(url, 'commodity.packageDetail') this.openWindows(url)
} }
}, },
jumpSales(val) { jumpSales(val) {
......
...@@ -126,7 +126,7 @@ export default { ...@@ -126,7 +126,7 @@ export default {
status: true, status: true,
supplier: '', supplier: '',
isHaveInventory:true,//是否有库存 isHaveInventory:true,//是否有库存
addressInfo:null addressInfo:null,
} }
}, },
mounted() { mounted() {
...@@ -140,11 +140,6 @@ export default { ...@@ -140,11 +140,6 @@ export default {
if(options.selectedId){//首页选择的元素 if(options.selectedId){//首页选择的元素
this.selectedId = options.selectedId this.selectedId = options.selectedId
} }
// console.log(this.$route.query);
// let goods = JSON.parse(sessionStorage.getItem('GL_GOODS_INFO'));
// document.title = goods.brandName
// this.brandName = goods.brandName;
// this.supplier = goods.supplier;
}else { }else {
let params = this.getParams(window.location.href) let params = this.getParams(window.location.href)
this.brandName = decodeURI(params.brandName); this.brandName = decodeURI(params.brandName);
...@@ -155,21 +150,24 @@ export default { ...@@ -155,21 +150,24 @@ export default {
} }
} }
this.showLoading(); this.showLoading();
let {latitude,longitude} = this.$store.state.address
let para = { let para = {
brandName: this.brandName, brandName: this.brandName,
supplier: this.supplier supplier: this.supplier,
lat:latitude,
lng:longitude
} }
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 = { this.addressInfo = {
// gasAddressLatitude:data.latitude, gasAddressLatitude:data.latitude,
// gasAddressLongitude:data.longitude, gasAddressLongitude:data.longitude,
// gasAddress:data.localAddress, gasAddress:data.localAddress,
// localAddressDistance:data.localAddressDistance localAddressDistance:data.localAddressDistance
// } }
this.businessList = data; this.businessList = data.goodsDetailList;
this.selectData = this.businessList[0] this.selectData = this.businessList[0]
if(this.selectedId){//存在则是从精选处跳转进来的 if(this.selectedId){//存在则是从精选处跳转进来的
this.businessList.forEach((el,index)=>{ this.businessList.forEach((el,index)=>{
......
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
<span>下单时间</span> <span>下单时间</span>
<span class="cell_val">{{packageInfo.createDate}}</span> <span class="cell_val">{{packageInfo.createDate}}</span>
</div> </div>
<div class="location_wrap" @click="toOpenLocation"> <div v-if="packageInfo.latitude" 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>
...@@ -38,6 +38,7 @@ ...@@ -38,6 +38,7 @@
<script type='text/ecmascript-6'> <script type='text/ecmascript-6'>
import WxConfig from "@u/WxConfig"; import WxConfig from "@u/WxConfig";
const WX = new WxConfig(["openLocation", "getLocation"]); const WX = new WxConfig(["openLocation", "getLocation"]);
import {commodity} from "@r/api";
export default { export default {
name: "", name: "",
data() { data() {
...@@ -49,31 +50,23 @@ export default { ...@@ -49,31 +50,23 @@ export default {
document.querySelector("body").setAttribute("style", "background:#F5F5F5"); document.querySelector("body").setAttribute("style", "background:#F5F5F5");
}, },
mounted() { mounted() {
this.packageInfo = { let options = this.$route.query
notes:'这是套餐的备注', this.getDetailInfo(options.orderCode)
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: { methods: {
getDetailInfo(orderCode){
let { sessionId} = this.$store.state;
let para = {
orderCode,
sessionId
}
commodity.getPackageOrderDetail(para).then(res=>{
if(res.code==0){
this.packageInfo = res.data
this.packageInfo.createDate = new Date(this.packageInfo.createDate).format("yyyy-MM-dd hh:mm:ss")
}
})
},
toOpenLocation(){ toOpenLocation(){
let temp = this.packageInfo let temp = this.packageInfo
let val = { let val = {
......
...@@ -39,7 +39,7 @@ ...@@ -39,7 +39,7 @@
</template> </template>
<script type='text/ecmascript-6'> <script type='text/ecmascript-6'>
import {cardRoll} from "@r/api"; import {cardRoll,commodity} from "@r/api";
export default { export default {
name: "", name: "",
data() { data() {
...@@ -54,7 +54,8 @@ export default { ...@@ -54,7 +54,8 @@ export default {
}, },
mounted() { mounted() {
document.title = '广汇门店' document.title = '广汇门店'
this.getDetailInfo() let options = this.$route.query
this.getDetailInfo(options.id)
this.getPaySource() this.getPaySource()
}, },
methods: { methods: {
...@@ -70,54 +71,18 @@ export default { ...@@ -70,54 +71,18 @@ export default {
} }
}, },
// 获取门店套餐详情 // 获取门店套餐详情
getDetailInfo(){ getDetailInfo(id){
let data = { let para = {
id:1, id
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 commodity.getPackageDeail(para).then(res=>{
const {code,data,message} = res
if(code==0){
this.packageInfo = data
}else{
this.showToast(message)
}
})
}, },
// 购买套餐 // 购买套餐
toBuyPackage(){ toBuyPackage(){
...@@ -144,7 +109,7 @@ export default { ...@@ -144,7 +109,7 @@ export default {
this.hideLoading(); this.hideLoading();
}) })
}, },
// 跳转到套餐详情 // 跳转购买成功
jumpToPackageDetail() { jumpToPackageDetail() {
let { sessionId } = this.$store.state; let { sessionId } = this.$store.state;
let [href] = window.location.href.split("/#/"); let [href] = window.location.href.split("/#/");
......
...@@ -45,7 +45,7 @@ ...@@ -45,7 +45,7 @@
</template> </template>
<script type='text/ecmascript-6'> <script type='text/ecmascript-6'>
// import { equity } from "@r/api.js"; import { equity } from "@r/api.js";
import { indexMixin } from "@/mixins"; import { indexMixin } from "@/mixins";
export default { export default {
name: "", name: "",
...@@ -63,17 +63,17 @@ export default { ...@@ -63,17 +63,17 @@ export default {
}; };
}, },
mounted() { mounted() {
// this.getMerchants();
let wheight = window.innerHeight + "px"; let wheight = window.innerHeight + "px";
this.deviceH = wheight; this.deviceH = wheight;
this.showLoading(); this.getMerchants();
let self = this; // this.showLoading();
setTimeout(() => { // let self = this;
self.$nextTick(() => { // setTimeout(() => {
self.getTwoHeightArr(); // self.$nextTick(() => {
}); // self.getTwoHeightArr();
self.hideLoading(); // });
}, 2000); // self.hideLoading();
// }, 2000);
}, },
methods: { methods: {
// 点击跳转商品详情 // 点击跳转商品详情
...@@ -96,28 +96,28 @@ export default { ...@@ -96,28 +96,28 @@ export default {
} }
}, },
// 获取所有权益商品 // 获取所有权益商品
// getMerchants() { getMerchants() {
// this.equityList = []; this.equityList = [];
// let para = { let para = {
// merchantId: this.merchantId, merchantId: this.merchantId,
// }; };
// equity.getMerchantid(para).then((res) => { equity.getMerchantid(para).then((res) => {
// let { code, data, message } = res; let { code, data, message } = res;
// if (code == 0) { if (code == 0) {
// this.equityList = data.goodsServiceList; this.equityList = data.goodsServiceList;
// this.equityList.unshift({ this.equityList.unshift({
// goodsCategory: "汽车权益", goodsCategory: "汽车权益",
// equityGoodsGroupDescDtos: data.carServiceList, equityGoodsGroupDescDtos: data.carServiceList,
// }); });
// //计算两个高度数组,延迟到下次 DOM 更新循环之后再计算 //计算两个高度数组,延迟到下次 DOM 更新循环之后再计算
// this.$nextTick(() => { this.$nextTick(() => {
// this.getTwoHeightArr(); this.getTwoHeightArr();
// }); });
// } else { } else {
// this.showToast(message); this.showToast(message);
// } }
// }); });
// }, },
//左侧选择元素--跳转到相对应的位置 //左侧选择元素--跳转到相对应的位置
selectLeftItem(i) { selectLeftItem(i) {
this.whichIndex = i; this.whichIndex = i;
...@@ -246,8 +246,8 @@ export default { ...@@ -246,8 +246,8 @@ export default {
width: 100%; width: 100%;
min-height: 100px; min-height: 100px;
display: grid; display: grid;
grid-template-columns: repeat(4, 46px); grid-template-columns: repeat(4, 57px);
grid-gap: 10px 23px; grid-gap: 10px 11px;
grid-auto-rows: 100px; grid-auto-rows: 100px;
// display: flex; // display: flex;
// flex-wrap: wrap; // flex-wrap: wrap;
......
...@@ -101,8 +101,9 @@ ...@@ -101,8 +101,9 @@
</div> </div>
</div> </div>
<div class="store_serve_widget"> <div class="store_serve_widget">
<div class="serve_title">本店服务</div> <div v-if="storePackageList.length" class="serve_title">本店服务</div>
<div <div
v-if="storePackageList.length"
class="serve_content" class="serve_content"
:class="showStoreMore ? 'content_all' : 'content_four'" :class="showStoreMore ? 'content_all' : 'content_four'"
> >
...@@ -110,7 +111,7 @@ ...@@ -110,7 +111,7 @@
v-for="(item, index) in storePackageList" v-for="(item, index) in storePackageList"
:key="index" :key="index"
class="serve_box" class="serve_box"
@click="jumpToStorePackage" @click="jumpToStorePackage(item.packageId)"
> >
<div class="serve_item_title">{{item.packageName}}</div> <div class="serve_item_title">{{item.packageName}}</div>
<div class="serve_item_desc"> <div class="serve_item_desc">
...@@ -119,7 +120,7 @@ ...@@ -119,7 +120,7 @@
</div> </div>
</div> </div>
</div> </div>
<div class="show_store_Btn" @click="changeStoreMore"> <div v-if="storePackageList.length>4" class="show_store_Btn" @click="changeStoreMore">
<div :class="showStoreMore ? 'icon_tip_up' : 'icon_tip_down'"></div> <div :class="showStoreMore ? 'icon_tip_up' : 'icon_tip_down'"></div>
<div class="text_tip">{{ showStoreMore ? "收起" : "展示更多" }}</div> <div class="text_tip">{{ showStoreMore ? "收起" : "展示更多" }}</div>
</div> </div>
...@@ -142,7 +143,7 @@ ...@@ -142,7 +143,7 @@
</div> </div>
<div v-if="curTabIndex == 0" class="swiper_serve_widget"> <div v-if="curTabIndex == 0" class="swiper_serve_widget">
<template v-for="(item, index) in siftList"> <template v-for="(item, index) in siftList">
<div :key="index" class="high_widget"> <div v-if="item.couponsGoodsList.length>0" :key="index" class="high_widget">
<div class="left_fixed_box"> <div class="left_fixed_box">
<div class="label_icon"> <div class="label_icon">
<img :src="item.icon"> <img :src="item.icon">
...@@ -170,7 +171,7 @@ ...@@ -170,7 +171,7 @@
</van-swipe-item> </van-swipe-item>
</van-swipe> </van-swipe>
</div> </div>
<div class="adress_widget"> <div v-if="item.appearance==1" class="adress_widget">
<div class="address_info_text"> <div class="address_info_text">
{{item.localAddress}} {{item.localAddress}}
</div> </div>
...@@ -274,9 +275,6 @@ export default { ...@@ -274,9 +275,6 @@ export default {
}, },
mounted() { mounted() {
console.log("更新页面时间:", new Date().format("hh:mm:ss")); console.log("更新页面时间:", new Date().format("hh:mm:ss"));
this.getAllMenuData();
this.getStoreData();
this.getHighData();
const ua = navigator.userAgent.toLowerCase(); const ua = navigator.userAgent.toLowerCase();
if (ua.match(/MicroMessenger/i) == "micromessenger") { if (ua.match(/MicroMessenger/i) == "micromessenger") {
this.isWXEnvironment = true; this.isWXEnvironment = true;
...@@ -300,6 +298,8 @@ export default { ...@@ -300,6 +298,8 @@ export default {
this.isLogin = false; this.isLogin = false;
} }
this.initLocation(); this.initLocation();
this.getAllMenuData();
this.getStoreData();
this.getPackageCount() this.getPackageCount()
}, },
methods: { methods: {
...@@ -619,7 +619,9 @@ export default { ...@@ -619,7 +619,9 @@ export default {
cityCode: adcode, cityCode: adcode,
address: formattedAddress, address: formattedAddress,
}; };
console.log(this.addressInfo,'定位信息---');
this.getStationList(); this.getStationList();
this.getHighData();
this.$store.commit("setAddress", this.addressInfo); this.$store.commit("setAddress", this.addressInfo);
} }
}); });
...@@ -715,11 +717,11 @@ export default { ...@@ -715,11 +717,11 @@ export default {
this.openWindows(url, "equity.allEquity"); this.openWindows(url, "equity.allEquity");
}, },
// 跳转到门店套餐 // 跳转到门店套餐
jumpToStorePackage() { jumpToStorePackage(id) {
let { sessionId } = this.$store.state; let { sessionId } = this.$store.state;
let [href] = window.location.href.split("/#/"); let [href] = window.location.href.split("/#/");
let url = `${href}/#/commodity/storePackage?sessionId=${sessionId}`; let url = `${href}/#/commodity/storePackage?sessionId=${sessionId}&id=${id}`;
this.openWindows(url, "commodity.storePackage"); this.openWindows(url);
}, },
// 精选去购买 // 精选去购买
toBuyGoods(goods,item){ toBuyGoods(goods,item){
...@@ -802,129 +804,78 @@ export default { ...@@ -802,129 +804,78 @@ export default {
data: 3 data: 3
} }
this.packageNumber = res.data this.packageNumber = res.data
// equity.getPackageNum().then((res)=>{ equity.getPackageNum().then((res)=>{
// console.log('获取卡包数据',res); console.log('获取卡包数据',res);
// }) })
}, },
// 2.获取首页权益 // 2.获取首页权益
getAllMenuData() { getAllMenuData() {
let menuList = [];// 后台返回的数组 let menuList = [];// 后台返回的数组
this.menuList = []; this.menuList = [];
for (let i = 0; i < 6; i++) { equity.getMenuData().then(res=>{
let temp = { const {data,code} = res
supplier: "HW", if(code==0){
brandName: "星巴克", menuList = data
equityName: "星巴克", let dataLen = menuList.length;
equityDesc: "测试时安徽的", if (dataLen < 10) {
equityIcon: this.menuList[0] = menuList;
"http://qcimg01.glsx.net:7060/group1/M00/00/21/wKgD3mD5RSyAAnfDAADXLGDvl9k971.jpg", } else if (dataLen >= 10) {
appearance: 1, let temp1 = menuList.slice(0, 9);
}; let temp2 = menuList.slice(9);
menuList.push(temp); let temp3 = this.splitArr(temp2, 10);
} this.menuList[0] = temp1;
let dataLen = menuList.length; this.menuList = this.menuList.concat(temp3);
if (dataLen < 10) { }
this.menuList[0] = menuList; }
} else if (dataLen >= 10) { })
let temp1 = menuList.slice(0, 9);
let temp2 = menuList.slice(9);
let temp3 = this.splitArr(temp2, 10);
this.menuList[0] = temp1;
this.menuList = this.menuList.concat(temp3);
}
}, },
// 3.获取门店服务套餐 // 3.获取门店服务套餐
getStoreData() { getStoreData() {
this.storePackageList = []; this.storePackageList = [];
for (let i = 1; i < 10; i++) { let para = {
let obj = { merchantId: sessionStorage.getItem("GL_WX_MERCHANTID")
packageId: i,
packageName: '单人套餐'+i,
packagePrice: i+20,
originalPrice:10,
num:3+i
};
this.storePackageList.push(obj);
} }
equity.getStorePackage(para).then(res=>{
const {code,data} = res
if(code==0){
this.storePackageList = data
}
})
}, },
// 4.获取精选 // 4.获取精选
getHighData() { getHighData() {
this.siftList = []; this.siftList = [];
let data = [ let {latitude,longitude} = this.addressInfo
{ let para = {
supplier:'HW', lat:latitude,
icon:'http://qcimg01.glsx.net:7060/group1/M00/00/21/wKgD3mD5RSyAAnfDAADXLGDvl9k971.jpg', lng:longitude
appearance:1, }
brandName:'星巴克', equity.getHotData(para).then(res=>{
equityName:'星巴克', let {code,data} = res
localAddress:'湾科技生态园', if(code==0){
localAddressDistance:0.2, data.map((item) => {
lat:'22.536197', if(item.appearance==2){
lng:'113.959296', let tempArr = []
couponsGoodsList:[ if(item.chargeGoddsList){
{ item.chargeGoddsList.forEach((ele)=>{
id:160, ele.denominationList.forEach((info)=>{
brandName:'星巴克', let tempobj = {
productName:'中杯全国通兑券', productName:ele.productName,
goodsImage:'http://qcimg01.glsx.net:7060/group1/M00/00/26/wKgD3mETfpCAUxWGAAqTcVMvFUE986.png', ...info
salesPrice:'0.01', }
lineationPrice:1, tempArr.push(tempobj)
noMemberPrice:null, })
warrantyDate:1631847332512, })
validityPeriod:null,
buysNotes:'%3Cp%3Egoumai%3C%2Fp%3E',
useNotes:'%3Cp%3Ekajuan%3C%2Fp%3E',
stock:10
}
]
},
{
supplier:'HW',
icon:'http://qcimg01.glsx.net:7060/group1/M00/00/21/wKgD3mD5RSyAAnfDAADXLGDvl9k971.jpg',
appearance:2,
brandName:'芒果TV',
equityName:'1',
localAddress:'湾科技生态园',
localAddressDistance:0.3,
lat:'22.536197',
lng:'113.959296',
chargeGoddsList:[
{
productName:'视频会员月卡',
denominationList:[
{
id:148,
denomination:'22',
salesPrice:0.02,
lineationPrice:11,
noMemberPrice:13,
buysNotes:'%3Cp%3E32%3C%2Fp%3E',
useNotes:'%3Cp%3E1%3C%2Fp%3E',
}
]
},
]
},
]
data.map((item) => {
if(item.appearance==2){
let tempArr = []
item.chargeGoddsList.forEach((ele)=>{
ele.denominationList.forEach((info)=>{
let tempobj = {
productName:ele.productName,
...info
} }
tempArr.push(tempobj) item.couponsGoodsList = tempArr
}) }
}) item.couponsGoodsList = this.splitArr(item.couponsGoodsList, 2);
item.couponsGoodsList = tempArr return item;
});
this.siftList = data;
} }
item.couponsGoodsList = this.splitArr(item.couponsGoodsList, 2); })
return item;
});
this.siftList = data;
}, },
}, },
}; };
...@@ -1269,7 +1220,6 @@ body { ...@@ -1269,7 +1220,6 @@ body {
} }
} }
.content_four { .content_four {
height: 170px;
overflow: hidden; overflow: hidden;
} }
.content_all { .content_all {
...@@ -1465,7 +1415,7 @@ body { ...@@ -1465,7 +1415,7 @@ body {
} }
.line { .line {
position: absolute; position: absolute;
right: 90px; right: 110px;
top: 50%; top: 50%;
transform: translate(0, -50%); transform: translate(0, -50%);
height: 12px; height: 12px;
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!