This commit is contained in:
@@ -23,7 +23,7 @@ export default defineAppConfig({
|
||||
"login/index",
|
||||
"bindPhone/index",
|
||||
"pending_order/index",
|
||||
"pending_order/pending_order_detail/index"
|
||||
"pending_order/pending_order_detail/index",
|
||||
],
|
||||
},
|
||||
{
|
||||
@@ -55,7 +55,12 @@ export default defineAppConfig({
|
||||
},
|
||||
{
|
||||
root: "pages/game",
|
||||
pages: ["gamehome/index", "gamedetail/index", "gameview/index"],
|
||||
pages: [
|
||||
"gamehome/index",
|
||||
"gamedetail/index",
|
||||
"gameview/index",
|
||||
"view/index",
|
||||
],
|
||||
},
|
||||
{
|
||||
root: "pages/hotGoods",
|
||||
|
||||
@@ -1,28 +1,34 @@
|
||||
<script setup lang="ts">
|
||||
import { ref } from "vue";
|
||||
import Taro from "@tarojs/taro";
|
||||
import { userSign } from "@/api/user";
|
||||
|
||||
const show = ref(false);
|
||||
|
||||
const overlay = ref();
|
||||
|
||||
defineExpose({
|
||||
show,
|
||||
});
|
||||
|
||||
defineProps({
|
||||
src: {
|
||||
required: true,
|
||||
type: String,
|
||||
default: "",
|
||||
},
|
||||
type: Number,
|
||||
cb: {
|
||||
required: true,
|
||||
type: Function,
|
||||
default: () => {},
|
||||
},
|
||||
});
|
||||
|
||||
Taro.useLoad(async () => {
|
||||
if (Taro.getStorageSync("token")) show.value = true;
|
||||
// const res = await getSignRecord()
|
||||
// console.log(res)
|
||||
});
|
||||
|
||||
const toSign = async () => {
|
||||
try {
|
||||
await userSign();
|
||||
Taro.showToast({
|
||||
title: "签到成功",
|
||||
icon: "none",
|
||||
});
|
||||
} catch (e) {
|
||||
console.log(e);
|
||||
}
|
||||
show.value = false;
|
||||
};
|
||||
</script>
|
||||
|
||||
<template>
|
||||
@@ -32,8 +38,8 @@ const toSign = async () => {
|
||||
:close-on-click-overlay="false"
|
||||
>
|
||||
<view class="wrapper">
|
||||
<view @click.stop="toSign">
|
||||
<image class="image" src="../static/index/poppBg.png" />
|
||||
<view @click.stop="cb(type)">
|
||||
<image class="image" :src="src" />
|
||||
</view>
|
||||
<view @click.stop="show = false">
|
||||
<image class="icon" src="../static/index/close.png" />
|
||||
|
||||
@@ -10,9 +10,7 @@ import { ref } from "vue";
|
||||
import { getStorageSync, useLoad } from "@tarojs/taro";
|
||||
import { WebView } from "@tarojs/components";
|
||||
|
||||
const gameUrl = ref("");
|
||||
|
||||
const user = ref({});
|
||||
const user = ref<any>({});
|
||||
|
||||
useLoad(() => {
|
||||
user.value = getStorageSync("userInfo");
|
||||
|
||||
3
src/pages/game/view/index.config.ts
Normal file
3
src/pages/game/view/index.config.ts
Normal file
@@ -0,0 +1,3 @@
|
||||
export default definePageConfig({
|
||||
navigationBarTitleText: "",
|
||||
});
|
||||
17
src/pages/game/view/index.vue
Normal file
17
src/pages/game/view/index.vue
Normal file
@@ -0,0 +1,17 @@
|
||||
<template>
|
||||
<web-view style="height: 100vh; width: 100vw" :src="url"></web-view>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref } from "vue";
|
||||
import { getStorageSync, useLoad } from "@tarojs/taro";
|
||||
import { WebView } from "@tarojs/components";
|
||||
|
||||
const url = ref("");
|
||||
|
||||
useLoad(() => {
|
||||
url.value = getStorageSync("game_url");
|
||||
});
|
||||
</script>
|
||||
|
||||
<style lang="scss"></style>
|
||||
@@ -37,7 +37,14 @@
|
||||
</view>
|
||||
<MerList />
|
||||
<!-- 签到弹窗 -->
|
||||
<Popup />
|
||||
<Popup
|
||||
v-for="(item, index) in popupList"
|
||||
:ref="(el) => getRef(el, item.type)"
|
||||
:type="item.type"
|
||||
:src="item.src"
|
||||
:cb="item.cb"
|
||||
:key="index"
|
||||
/>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
@@ -47,7 +54,7 @@ import Taro from "@tarojs/taro";
|
||||
import Popup from "@/components/Popup.vue";
|
||||
import MerList from "@/components/MerList.vue";
|
||||
import { getHomeList } from "@/api/home";
|
||||
import { getBanner } from "@/api/user";
|
||||
import { getBanner, userSign } from "@/api/user";
|
||||
import { parseQueryString } from "@/utils";
|
||||
import { getMerList } from "@/api/goods";
|
||||
|
||||
@@ -65,6 +72,41 @@ const swiperList = ref<Array<SwiperList>>([]);
|
||||
|
||||
const bannerList = ref<any[]>([]);
|
||||
|
||||
const popupRefs = ref<Map<number, any>>(new Map());
|
||||
|
||||
const getRef = (el, type) => {
|
||||
popupRefs.value.set(type, el);
|
||||
};
|
||||
|
||||
const popupList = ref([
|
||||
{
|
||||
type: 1,
|
||||
src: require("../../static/index/poppBg.png"),
|
||||
cb: async (type) => {
|
||||
await userSign();
|
||||
Taro.showToast({
|
||||
title: "签到成功",
|
||||
icon: "none",
|
||||
});
|
||||
popupRefs.value.get(type).show = false;
|
||||
},
|
||||
},
|
||||
{
|
||||
type: 2,
|
||||
src: require("../../static/index/game_1.png"),
|
||||
cb: (type) => {
|
||||
Taro.setStorageSync(
|
||||
"game_url",
|
||||
`${process.env.TARO_APP_FISH_GAME}${Taro.getStorageSync("token")}`
|
||||
);
|
||||
Taro.navigateTo({
|
||||
url: `/pages/game/view/index`,
|
||||
});
|
||||
popupRefs.value.get(type).show = false;
|
||||
},
|
||||
},
|
||||
]);
|
||||
|
||||
Taro.useDidShow(async () => {
|
||||
await getBannerList();
|
||||
await get_banner_list();
|
||||
@@ -73,8 +115,7 @@ Taro.useDidShow(async () => {
|
||||
Taro.useShareAppMessage(() => ({
|
||||
title: "捷兑通",
|
||||
path: `/pages/index/index?scene=${Taro.getStorageSync("token")}`,
|
||||
imageUrl:
|
||||
"https://upload.jdt168.com/1694242954957988438_微信图片_20230909150016.jpg",
|
||||
imageUrl: "https://upload.jdt168.com/1714375021923881119_Share.jpg",
|
||||
}));
|
||||
|
||||
const getBannerList = async () => {
|
||||
|
||||
@@ -240,7 +240,6 @@ const getList = async () => {
|
||||
justify-content: center;
|
||||
|
||||
.num {
|
||||
font-size: 40px;
|
||||
font-weight: bold;
|
||||
margin-top: 10px;
|
||||
}
|
||||
|
||||
BIN
src/static/index/game_1.png
Normal file
BIN
src/static/index/game_1.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 657 KiB |
Reference in New Issue
Block a user