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')
......
...@@ -71,13 +71,12 @@ export default { ...@@ -71,13 +71,12 @@ export default {
subIcon: '10000' subIcon: '10000'
} }
], ],
...shopList, ...shopList
equityList:[]
} }
}, },
mounted() { mounted() {
this.setNoticeInfo(); this.setNoticeInfo();
this.getMerchantid(); // this.getMerchantid();
if (this.isMiniprogram) wx.miniProgram.postMessage({}) if (this.isMiniprogram) wx.miniProgram.postMessage({})
}, },
methods: { methods: {
...@@ -99,12 +98,12 @@ export default { ...@@ -99,12 +98,12 @@ export default {
this.setNoticeInfo() this.setNoticeInfo()
}, },
CarLink(e) { CarLink(e) {
let {sessionId} = this.$store.state; let { sessionId } = this.$store.state;
let [href] = window.location.href.split('/#/'); let [href] = window.location.href.split('/#/');
let url; let url;
let supplier = e.supplier; let supplier = e.supplier;
sessionStorage.setItem('common',this.icon?1:0) sessionStorage.setItem('common', this.icon ? 1 : 0)
switch(supplier) { switch (supplier) {
case 'GL_OIL': case 'GL_OIL':
url = `${href}/#/oilStation/index?sessionId=${sessionId}` url = `${href}/#/oilStation/index?sessionId=${sessionId}`
this.openWindows(url, 'oilStation.index') this.openWindows(url, 'oilStation.index')
...@@ -137,13 +136,13 @@ export default { ...@@ -137,13 +136,13 @@ export default {
} }
}, },
jumpDEJ() { jumpDEJ() {
let {sessionId} = this.$store.state; let { sessionId } = this.$store.state;
let para = { let para = {
sessionId sessionId
} }
equity.getEdjUrl(para).then(res => { equity.getEdjUrl(para).then(res => {
let {code, data, message} = res let { code, data, message } = res
if (code == 0){ if (code == 0) {
this.openWindows(data) this.openWindows(data)
} else { } else {
this.showToast(message) this.showToast(message)
...@@ -152,44 +151,45 @@ export default { ...@@ -152,44 +151,45 @@ export default {
}, },
jumpLink(e) { jumpLink(e) {
let { sessionId } = this.$store.state; let { sessionId } = this.$store.state;
this.$store.commit('setGoodsInfo',e); this.$store.commit('setGoodsInfo', e);
let {brandId,supplier,brandName} = e; let { brandId, supplier, brandName } = e;
if(e.appearance == 1) { if (e.appearance == 1) {
let [href] = window.location.href.split('/#/'); let [href] = window.location.href.split('/#/');
let url = `${href}/#/commodity/business?sessionId=${sessionId}&brandId=${brandId}&supplier=${supplier}&brandName=${brandName}`; let url = `${href}/#/commodity/business?sessionId=${sessionId}&brandId=${brandId}&supplier=${supplier}&brandName=${brandName}`;
this.openWindows(url, 'commodity.business') this.openWindows(url, 'commodity.business')
}else { } else {
let [href] = window.location.href.split('/#/'); let [href] = window.location.href.split('/#/');
let url = `${href}/#/commodity/recharge?sessionId=${sessionId}&brandId=${brandId}&supplier=${supplier}&brandName=${brandName}`; let url = `${href}/#/commodity/recharge?sessionId=${sessionId}&brandId=${brandId}&supplier=${supplier}&brandName=${brandName}`;
this.openWindows(url, 'commodity.recharge') this.openWindows(url, 'commodity.recharge')
} }
}, },
getMerchantid() { // getMerchantid() {
this.carServiceList = [] // this.carServiceList = []
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.carServiceList = data.carServiceList // this.carServiceList = data.carServiceList
this.goodsServiceList = data.goodsServiceList; // this.goodsServiceList = data.goodsServiceList;
this.equityGoodsGroupDescDtos = this.goodsServiceList[0].equityGoodsGroupDescDtos; // this.equityGoodsGroupDescDtos = this.goodsServiceList[0].equityGoodsGroupDescDtos;
// 权益集合页面使用(需要深拷贝) // // 权益集合页面使用(需要深拷贝)
this.equityList = JSON.parse(JSON.stringify(data.goodsServiceList)); // this.equityList = JSON.parse(JSON.stringify(data.goodsServiceList));
this.equityList.unshift({ // this.equityList.unshift({
goodsCategory: "汽车权益", // goodsCategory: "汽车权益",
equityGoodsGroupDescDtos: JSON.parse(JSON.stringify(data.carServiceList)), // equityGoodsGroupDescDtos: JSON.parse(JSON.stringify(data.carServiceList)),
}); // });
} else { // } else {
this.showToast(message) // this.showToast(message)
} // }
}) // })
}, // },
changeGoods(item) { changeGoods(item) {
this.goodsTab = item; console.log(item);
this.equityGoodsGroupDescDtos = this.goodsServiceList[item].equityGoodsGroupDescDtos; // this.goodsTab = item;
// this.equityGoodsGroupDescDtos = this.goodsServiceList[item].equityGoodsGroupDescDtos;
}, },
jumpMore() { jumpMore() {
equity.getCouponList({ equity.getCouponList({
......
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,7 +110,7 @@ const pages = { ...@@ -112,7 +110,7 @@ const pages = {
}, },
{ {
name: 'packageSuccess', name: 'packageSuccess',
title:'支付成功', title: '支付成功',
showNavBar: true showNavBar: true
}, },
], ],
...@@ -125,7 +123,8 @@ const pages = { ...@@ -125,7 +123,8 @@ const pages = {
{ {
name: 'list', name: 'list',
title: '设备关联' title: '设备关联'
}] }
]
} }
const getParams = str => { const getParams = str => {
let params = str.split('?') let params = str.split('?')
...@@ -139,27 +138,29 @@ const getParams = str => { ...@@ -139,27 +138,29 @@ const getParams = str => {
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')){ }
if (flag.length) {
if ((urlParam.freecards == '1') || (freecards == '1')) {
defaultName = 'common.expcard' defaultName = 'common.expcard'
sessionStorage.setItem('freecards','1') sessionStorage.setItem('freecards', '1')
} }
} }
if(freecards=='1'){ if (freecards == '1') {
defaultName = 'common.expcard' 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
......
...@@ -51,8 +51,8 @@ const showLoading = (title = '加载中...') => { ...@@ -51,8 +51,8 @@ const showLoading = (title = '加载中...') => {
const hideLoading = () => { const hideLoading = () => {
Toast.clear() Toast.clear()
} }
/**复制 */ /**复制 */
const cloneText = (message)=> { const cloneText = (message) => {
let input = document.createElement("input"); let input = document.createElement("input");
input.value = message; input.value = message;
document.body.appendChild(input); document.body.appendChild(input);
...@@ -60,7 +60,7 @@ const cloneText = (message)=> { ...@@ -60,7 +60,7 @@ const cloneText = (message)=> {
input.setSelectionRange(0, input.value.length), document.execCommand('Copy'); input.setSelectionRange(0, input.value.length), document.execCommand('Copy');
document.body.removeChild(input); document.body.removeChild(input);
Toast('复制成功'); Toast('复制成功');
} }
/**num:要转换的数值,fixed:精确几位小数 */ /**num:要转换的数值,fixed:精确几位小数 */
const decimal = (num, fixed) => { const decimal = (num, fixed) => {
let pow = Math.pow(10, fixed) let pow = Math.pow(10, fixed)
...@@ -115,7 +115,8 @@ const checkPhoneType = () => { ...@@ -115,7 +115,8 @@ const checkPhoneType = () => {
const openWindows = (url, name) => { const openWindows = (url, name) => {
if (window.__wxjs_environment === 'miniprogram') { if (window.__wxjs_environment === 'miniprogram') {
wx.miniProgram.navigateTo({ wx.miniProgram.navigateTo({
url: `/pages/commonWebView/commonWebView?path=${encodeURIComponent(url)}` // url: `/pages/commonWebView/commonWebView?path=${encodeURIComponent(url)}`
url: `/pages/webView/webView?url=${encodeURIComponent(url)}`
}) })
} else { } else {
const ua = navigator.userAgent.toLowerCase() const ua = navigator.userAgent.toLowerCase()
...@@ -212,39 +213,39 @@ const equityLogin = () => { ...@@ -212,39 +213,39 @@ const equityLogin = () => {
} }
//自定义弹框dialog //自定义弹框dialog
const myDialog = (message,confirmText,cancelText,comfirmFn,cancelFn)=>{ const myDialog = (message, confirmText, cancelText, comfirmFn, cancelFn) => {
Dialog.confirm({ Dialog.confirm({
title: '提示', title: '提示',
message: message, message: message,
confirmButtonText: confirmText, confirmButtonText: confirmText,
cancelButtonText: cancelText, cancelButtonText: cancelText,
confirmButtonColor:'#008fff', confirmButtonColor: '#008fff',
closeOnClickOverlay:true, closeOnClickOverlay: true,
beforeClose(action,done){ beforeClose(action, done) {
if(action==='confirm'){ if (action === 'confirm') {
comfirmFn() comfirmFn()
done() done()
}else if(action==='cancel'){ } else if (action === 'cancel') {
cancelFn() cancelFn()
done() done()
}else{ } else {
done() done()
} }
} }
}) })
} }
// 导航 (微信环境需要传WX过来,如果在这里直接导入会报错) // 导航 (微信环境需要传WX过来,如果在这里直接导入会报错)
const openNavigation = (val,WX)=>{ const openNavigation = (val, WX) => {
const ua = navigator.userAgent.toLowerCase() const ua = navigator.userAgent.toLowerCase()
if (ua.match(/MicroMessenger/i) == 'micromessenger') { if (ua.match(/MicroMessenger/i) == 'micromessenger') {
WX.openLocation(Number(val.gasAddressLatitude),Number(val.gasAddressLongitude),val.gasName,val.gasAddress,18).then(() => { WX.openLocation(Number(val.gasAddressLatitude), Number(val.gasAddressLongitude), val.gasName, val.gasAddress, 18).then(() => {
// console.log(res) // console.log(res)
}) })
}else{ } else {
if (checkPhoneType() == 'ios') { if (checkPhoneType() == 'ios') {
window.webkit.messageHandlers.jumpNativeApp.postMessage(JSON.stringify({ type: 8,address:val.gasAddress,latitude:Number(val.gasAddressLatitude),longitude:Number(val.gasAddressLongitude)})) window.webkit.messageHandlers.jumpNativeApp.postMessage(JSON.stringify({ type: 8, address: val.gasAddress, latitude: Number(val.gasAddressLatitude), longitude: Number(val.gasAddressLongitude) }))
} else { } else {
window.myjs.jumpNativeApp(JSON.stringify({ type: 8,address:val.gasAddress,latitude:Number(val.gasAddressLatitude),longitude:Number(val.gasAddressLongitude)})) window.myjs.jumpNativeApp(JSON.stringify({ type: 8, address: val.gasAddress, latitude: Number(val.gasAddressLatitude), longitude: Number(val.gasAddressLongitude) }))
} }
} }
} }
......
...@@ -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:'跳转小程序券详情短链'
}, },
{ methods: {
couponName:'炸鸡腿2', getDetailInfo(orderCode){
userCouponsId:2, let { sessionId} = this.$store.state;
shortLink:'跳转小程序券详情短链' 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")
}
})
}, },
methods: {
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
},
]
} }
commodity.getPackageDeail(para).then(res=>{
const {code,data,message} = res
if(code==0){
this.packageInfo = data 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,26 +804,18 @@ export default { ...@@ -802,26 +804,18 @@ 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: "星巴克",
equityDesc: "测试时安徽的",
equityIcon:
"http://qcimg01.glsx.net:7060/group1/M00/00/21/wKgD3mD5RSyAAnfDAADXLGDvl9k971.jpg",
appearance: 1,
};
menuList.push(temp);
}
let dataLen = menuList.length; let dataLen = menuList.length;
if (dataLen < 10) { if (dataLen < 10) {
this.menuList[0] = menuList; this.menuList[0] = menuList;
...@@ -832,84 +826,38 @@ export default { ...@@ -832,84 +826,38 @@ export default {
this.menuList[0] = temp1; this.menuList[0] = temp1;
this.menuList = this.menuList.concat(temp3); 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,
lat:'22.536197',
lng:'113.959296',
couponsGoodsList:[
{
id:160,
brandName:'星巴克',
productName:'中杯全国通兑券',
goodsImage:'http://qcimg01.glsx.net:7060/group1/M00/00/26/wKgD3mETfpCAUxWGAAqTcVMvFUE986.png',
salesPrice:'0.01',
lineationPrice:1,
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) => { data.map((item) => {
if(item.appearance==2){ if(item.appearance==2){
let tempArr = [] let tempArr = []
if(item.chargeGoddsList){
item.chargeGoddsList.forEach((ele)=>{ item.chargeGoddsList.forEach((ele)=>{
ele.denominationList.forEach((info)=>{ ele.denominationList.forEach((info)=>{
let tempobj = { let tempobj = {
...@@ -919,12 +867,15 @@ export default { ...@@ -919,12 +867,15 @@ export default {
tempArr.push(tempobj) tempArr.push(tempobj)
}) })
}) })
}
item.couponsGoodsList = tempArr item.couponsGoodsList = tempArr
} }
item.couponsGoodsList = this.splitArr(item.couponsGoodsList, 2); item.couponsGoodsList = this.splitArr(item.couponsGoodsList, 2);
return item; return item;
}); });
this.siftList = data; 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!