201 lines
5.0 KiB
Vue
201 lines
5.0 KiB
Vue
<template>
|
|
<view class="content">
|
|
<view class="contentbox"
|
|
:style="'background:url('+(shopExtend?shopExtend.value:'https://czg-qr-order.oss-cn-beijing.aliyuncs.com/indexs/shuangbackground.png')+') no-repeat center center / cover' ">
|
|
<view class="contentboxitem flex-between">
|
|
<view class="contentboxitemleft flex-colum" @click="scanCodehandle(0)">
|
|
<image src="https://czg-qr-order.oss-cn-beijing.aliyuncs.com/indexs/Xdiancan.png" mode="aspectFill">
|
|
</image>
|
|
<text class="contentboxitemlefttextone">点餐</text>
|
|
<text class="contentboxitemlefttexttow">在线点不排队</text>
|
|
</view>
|
|
<view class="contentboxitemright">
|
|
<view class="contentboxitemright_item flex-between" @click="memberindex('member/memberdetails')">
|
|
<image src="https://czg-qr-order.oss-cn-beijing.aliyuncs.com/indexs/Xvip.png" mode="aspectFill">
|
|
</image>
|
|
<view class="contentboxitemright_itembox flex-colum">
|
|
<text>会员</text>
|
|
<text>入会享权益</text>
|
|
</view>
|
|
</view>
|
|
<view class="contentboxitemright_item flex-between" @click="memberindex('member/index')">
|
|
<image src="https://czg-qr-order.oss-cn-beijing.aliyuncs.com/indexs/Xchong.png"
|
|
mode="aspectFill"></image>
|
|
<view class="contentboxitemright_itembox flex-colum">
|
|
<text>充值</text>
|
|
<text>充值享更多优惠</text>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</template>
|
|
|
|
<script setup>
|
|
import {
|
|
ref,
|
|
onMounted,
|
|
reactive
|
|
} from "vue";
|
|
import {
|
|
onShow,
|
|
} from '@dcloudio/uni-app'
|
|
import {
|
|
APIproductqueryShop
|
|
} from "@/common/api/product/product.js";
|
|
import {
|
|
APIshopExtend
|
|
} from "@/common/api/index/index.js";
|
|
|
|
const shopExtend = reactive({
|
|
autokey: "index_bg",
|
|
createTime: "2024-08-27T06:59:35.000+00:00",
|
|
id: 17,
|
|
name: "首页",
|
|
shopId: 29,
|
|
type: "img",
|
|
updateTime: null,
|
|
value: ""
|
|
})
|
|
const userInfo = uni.cache.get('userInfo')
|
|
const shopUserInfo = uni.cache.get('shopUserInfo')
|
|
|
|
const scanCodehandle = (i) => {
|
|
uni.pro.navigateTo('product/index', {
|
|
tableCode: uni.cache.get('tableCode')
|
|
})
|
|
// uni.scanCode({
|
|
// success: async (res) => {
|
|
// let tableCode = getQueryString(decodeURIComponent(res.result), 'code')
|
|
// uni.cache.set('tableCode', tableCode)
|
|
// if (tableCode) {
|
|
// let data = await APIproductqueryShop({
|
|
// code: uni.cache.get('tableCode'),
|
|
// })
|
|
// if (data.data.shopTableInfo && !data.data.shopTableInfo.choseCount) {
|
|
// uni.pro.navigateTo('/pagesOrder/orderAMeal/index', {
|
|
// tableCode: tableCode,
|
|
// shopId: data.data.storeInfo.id,
|
|
// })
|
|
// } else {
|
|
// uni.pro.navigateTo('product/product', {
|
|
// tableCode: tableCode,
|
|
// })
|
|
// }
|
|
// }
|
|
// },
|
|
// fail: () => {}
|
|
// })
|
|
}
|
|
const memberindex = (url) => {
|
|
uni.pro.navigateTo(url, {
|
|
shopId: uni.cache.get('shopId'),
|
|
type: 'index',
|
|
})
|
|
}
|
|
const getQueryString = (url, name) => { //解码
|
|
var reg = new RegExp('(^|&|/?)' + name + '=([^&|/?]*)(&|/?|$)', 'i')
|
|
var r = url.substr(1).match(reg)
|
|
if (r != null) {
|
|
return r[2]
|
|
}
|
|
return null;
|
|
}
|
|
onShow(async () => {
|
|
let res = await APIshopExtend({
|
|
shopId: uni.cache.get('shopId'),
|
|
autokey: "index_bg" //index_bg my_bg member_bg shopInfo_bg
|
|
})
|
|
Object.assign(shopExtend, res.data)
|
|
})
|
|
</script>
|
|
|
|
<style scoped lang="scss">
|
|
page {
|
|
background: #F6F8FA;
|
|
}
|
|
|
|
.content {
|
|
.contentbox {
|
|
position: relative;
|
|
width: 100%;
|
|
height: 1046rpx;
|
|
padding: 0 24rpx;
|
|
|
|
.contentboxitem {
|
|
position: absolute;
|
|
bottom: 0;
|
|
width: 90%;
|
|
left: 50%;
|
|
transform: translate(-50%, 50%);
|
|
padding: 38rpx 0 26rpx 0;
|
|
background: rgba(255, 255, 255, 0.98);
|
|
box-shadow: 0rpx 6rpx 12rpx 2rpx rgba(0, 0, 0, 0.16);
|
|
border-radius: 20rpx 20rpx 20rpx 20rpx;
|
|
|
|
.contentboxitemleft {
|
|
width: 50%;
|
|
border-right: 2rpx solid #623618;
|
|
|
|
image {
|
|
width: 134rpx;
|
|
height: 134rpx;
|
|
}
|
|
|
|
.contentboxitemlefttextone {
|
|
margin-top: 10rpx;
|
|
font-family: Source Han Sans CN, Source Han Sans CN;
|
|
font-weight: 400;
|
|
font-size: 32rpx;
|
|
color: #333333;
|
|
}
|
|
|
|
.contentboxitemlefttexttow {
|
|
margin-top: 2rpx;
|
|
font-family: Source Han Sans CN, Source Han Sans CN;
|
|
font-weight: 400;
|
|
font-size: 24rpx;
|
|
color: #999999;
|
|
}
|
|
}
|
|
|
|
.contentboxitemright {
|
|
width: 50%;
|
|
padding: 0 34rpx;
|
|
|
|
.contentboxitemright_item:nth-child(2) {
|
|
margin-top: 30rpx;
|
|
}
|
|
|
|
.contentboxitemright_item {
|
|
image {
|
|
width: 96rpx;
|
|
height: 96rpx;
|
|
}
|
|
|
|
.contentboxitemright_itembox {
|
|
width: 170rpx;
|
|
|
|
text:nth-child(1) {
|
|
font-family: Source Han Sans CN, Source Han Sans CN;
|
|
font-weight: 400;
|
|
font-size: 32rpx;
|
|
color: #333333;
|
|
}
|
|
|
|
text:nth-child(2) {
|
|
margin-top: 2rpx;
|
|
font-family: Source Han Sans CN, Source Han Sans CN;
|
|
font-weight: 400;
|
|
font-size: 24rpx;
|
|
color: #999999;
|
|
}
|
|
}
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
</style> |