This commit is contained in:
@@ -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 () => {
|
||||
|
||||
Reference in New Issue
Block a user