团购秒杀

This commit is contained in:
2024-03-14 22:58:38 +08:00
parent 9dda08a1b1
commit 7a3dd0fae8
11 changed files with 347 additions and 11 deletions

View File

@@ -8,9 +8,8 @@
<view class='top-row'>
<image :src='userInfo.image' />
<view class='u-flex-column'>
<text>{{ userInfo.nickName}}</text>
<text>{{ userInfo.nickName }}</text>
<text>{{ userInfo.telephone }}</text>
</view>
@@ -18,15 +17,15 @@
</view>
<view class='bottom-row'>
<view @click.stop='goPath("/pages/mine/subs/integral/index")'>
<view @click.stop='gotoPath("/pages/mine/subs/integral/index")'>
<text>{{ userInfo.integration }}</text>
<text>积分</text>
</view>
<view @click.stop='goPath("/pages/mine/subs/recharge/index")'>
<view @click.stop='gotoPath("/pages/mine/subs/recharge/index")'>
<text>{{ userInfo.balance }}</text>
<text>余额</text>
</view>
<view @click.stop='goPath("/pages/mine/subs/coupon/coupon-list")'>
<view @click.stop='gotoPath("/pages/mine/subs/coupon/coupon-list")'>
<text>3</text>
<text>优惠券</text>
</view>
@@ -36,14 +35,14 @@
<view class='integral-add-view'>
<text>将会员卡放入微信卡包及时了解积分变动</text>
<text>去添加</text>
<image :src=' assetsUrl("ic_arrow_right_yellow.png")' />
<image :src='assetsUrl("ic_arrow_right_yellow.png")' />
</view>
<text class='title-view'>
我的订单
</text>
<view class='card-order-view'>
<view v-for='(item,index) in orderActionList' :key='index' @click.stop='goPath(item.path)'>
<view v-for='(item,index) in orderActionList' :key='index' @click.stop='gotoPath(item.path)'>
<image :src='item.icon' />
<text>{{ item.title }}</text>
<text v-if='item.amount>0'>{{ item.amount }}</text>
@@ -55,18 +54,23 @@
</text>
<view class='card-service-view'>
<view v-for='(item,index) in serviceList' :key='index' @click.stop='goPath(item.path)'>
<view v-for='(item,index) in serviceList' :key='index' @click.stop='gotoPath(item.path)'>
<image :src='item.icon' />
<text>{{ item.title }}</text>
</view>
</view>
</view>
<official-account-dialog ref='officialAccountDialogRef' />
</template>
<script setup lang='ts'>
import { useUserStore } from '@/store';
import { assetsUrl } from '@/utils/assets';
import { goPath } from '@/utils';
import OfficialAccountDialog from '@/components/official-account-dialog.vue';
const officialAccountDialogRef = ref();
const orderActionList = ref([{
title: '进行中',
@@ -99,7 +103,7 @@ const serviceList = [
{
title: '关注公众号',
icon: assetsUrl('ic_member_service_follow.png'),
path: ''
path: 'follow_official_account'
},
{
title: '收货地址',
@@ -123,6 +127,18 @@ title.value = import.meta.env.VITE_APP_TITLE;
const store = useUserStore();
const { userInfo } = storeToRefs(store);
const gotoPath = (path: string) => {
if(path === 'follow_official_account') {
showOfficialAccountDialog();
} else {
goPath(path);
}
};
const showOfficialAccountDialog = () => {
officialAccountDialogRef.value.show();
};
</script>
<style lang='scss' scoped>

View File

@@ -0,0 +1,79 @@
<template>
<uni-popup type='bottom' ref='popupRef' :mask-click='false' @touchmove.stop.prevent=''>
<view class='popup-content c-flex-column'>
<view class='c-flex-row'>
<text>关注公众号</text>
<image :src='assetsUrl("ic_close.png")' @click.stop='close()' />
</view>
<image class='qrcode' :src='assetsUrl("test_bg.png")' />
<text class='tips'>长按关注会员中心公众号
获得更多优惠和服务信息
</text>
</view>
</uni-popup>
</template>
<script lang='ts' setup>
import { assetsUrl } from '@/utils/assets';
const popupRef = ref();
const show = () => {
popupRef.value.open();
};
const close = () => {
popupRef.value.close();
};
defineExpose({ show });
</script>
<style lang='scss' scoped>
.popup-content {
background: #FFFFFF;
border-radius: 20rpx 20rpx 0 0;
padding: 38rpx 45rpx 140rpx 45rpx;
view:nth-of-type(1) {
display: flex;
margin-bottom: 70rpx;
position: relative;
image {
width: 35rpx;
height: 35rpx;
align-self: flex-start;
}
text {
font-weight: bold;
font-size: 30rpx;
color: #333333;
position: absolute;
left: 0;
right: 0;
text-align: center;
}
}
.qrcode {
width: 377rpx;
height: 377rpx;
margin-top: 50rpx;
align-self: center;
}
.tips {
font-weight: bold;
font-size: 30rpx;
color: #333333;
margin-top: 10rpx;
margin-bottom: 104rpx;
}
}
</style>