|
@@ -1,6 +1,6 @@
|
|
<template>
|
|
<template>
|
|
<view class="winnerContent">
|
|
<view class="winnerContent">
|
|
- <image class="backImage" :src="imgObj.backImg" mode="scaleToFill" />
|
|
|
|
|
|
+ <image class="backImage" :src="backImage" mode="scaleToFill" />
|
|
<view class="content">
|
|
<view class="content">
|
|
<view class="floatWindow">
|
|
<view class="floatWindow">
|
|
<image @click="showDesc = true" :src="imgObj.rule" mode="scaleToFill" />
|
|
<image @click="showDesc = true" :src="imgObj.rule" mode="scaleToFill" />
|
|
@@ -22,7 +22,7 @@
|
|
</view>
|
|
</view>
|
|
<view class="uploadBox">
|
|
<view class="uploadBox">
|
|
<view class="count">您还有0次奖励机会</view>
|
|
<view class="count">您还有0次奖励机会</view>
|
|
- <view @click="showUpload = true" class="btnBox">
|
|
|
|
|
|
+ <view @click="handledUpload" class="btnBox">
|
|
<image :src="gifObj.pointer" />
|
|
<image :src="gifObj.pointer" />
|
|
</view>
|
|
</view>
|
|
<view class="tip"
|
|
<view class="tip"
|
|
@@ -42,9 +42,11 @@
|
|
<text class="bigTitle title">商品列表</text>
|
|
<text class="bigTitle title">商品列表</text>
|
|
</view>
|
|
</view>
|
|
<view class="goodsList">
|
|
<view class="goodsList">
|
|
- <view v-for="item in 6" :key="item" class="goodsItem">
|
|
|
|
- <text class="money">8元</text>
|
|
|
|
- <text class="content">满25返8</text>
|
|
|
|
|
|
+ <view v-for="item in list" :key="item.id" class="goodsItem">
|
|
|
|
+ <text class="money">{{ item.cashbackAmount }}元</text>
|
|
|
|
+ <text class="content"
|
|
|
|
+ >满{{ item.thresholdAmount }}返{{ item.cashbackAmount }}</text
|
|
|
|
+ >
|
|
<text class="name">满返红包</text>
|
|
<text class="name">满返红包</text>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
@@ -52,7 +54,10 @@
|
|
</view>
|
|
</view>
|
|
<wd-gap bg-color="transparent"></wd-gap>
|
|
<wd-gap bg-color="transparent"></wd-gap>
|
|
<photo-example-popup v-model:show="showExample"></photo-example-popup>
|
|
<photo-example-popup v-model:show="showExample"></photo-example-popup>
|
|
- <upload-recept-popop v-model:show="showUpload"></upload-recept-popop>
|
|
|
|
|
|
+ <upload-recept-popop
|
|
|
|
+ :list="list"
|
|
|
|
+ v-model:show="showUpload"
|
|
|
|
+ ></upload-recept-popop>
|
|
<win-record-popup v-model:show="showWiner"></win-record-popup>
|
|
<win-record-popup v-model:show="showWiner"></win-record-popup>
|
|
<upload-record-popup v-model:show="showRecord"></upload-record-popup>
|
|
<upload-record-popup v-model:show="showRecord"></upload-record-popup>
|
|
<activity-desc-popup v-model:show="showDesc"></activity-desc-popup>
|
|
<activity-desc-popup v-model:show="showDesc"></activity-desc-popup>
|
|
@@ -60,19 +65,77 @@
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script setup lang="ts">
|
|
<script setup lang="ts">
|
|
-import { ref } from "vue";
|
|
|
|
|
|
+import { reactive, ref, computed } from "vue";
|
|
|
|
+import { onLoad, onShow } from "@dcloudio/uni-app";
|
|
|
|
+
|
|
import { imgObj, gifObj } from "./utils/source";
|
|
import { imgObj, gifObj } from "./utils/source";
|
|
import PhotoExamplePopup from "./components/photoExamplePopup.vue";
|
|
import PhotoExamplePopup from "./components/photoExamplePopup.vue";
|
|
import UploadReceptPopop from "./components/uploadReceptPopop.vue";
|
|
import UploadReceptPopop from "./components/uploadReceptPopop.vue";
|
|
import WinRecordPopup from "./components/winRecordPopup.vue";
|
|
import WinRecordPopup from "./components/winRecordPopup.vue";
|
|
import UploadRecordPopup from "./components/uploadRecordPopup.vue";
|
|
import UploadRecordPopup from "./components/uploadRecordPopup.vue";
|
|
import ActivityDescPopup from "./components/activityDescPopup.vue";
|
|
import ActivityDescPopup from "./components/activityDescPopup.vue";
|
|
-
|
|
|
|
|
|
+import { getActivity } from "@/services/ams";
|
|
|
|
+import { receptProp } from "./utils/interface";
|
|
let showExample = ref<boolean>(false);
|
|
let showExample = ref<boolean>(false);
|
|
let showUpload = ref<boolean>(false);
|
|
let showUpload = ref<boolean>(false);
|
|
let showWiner = ref<boolean>(false);
|
|
let showWiner = ref<boolean>(false);
|
|
let showRecord = ref<boolean>(false);
|
|
let showRecord = ref<boolean>(false);
|
|
let showDesc = ref<boolean>(false);
|
|
let showDesc = ref<boolean>(false);
|
|
|
|
+const appid = uni.getStorageSync("appid");
|
|
|
|
+const backImage = ref<string>(
|
|
|
|
+ "https://qiuyu-daodian.oss-cn-beijing.aliyuncs.com/images/Group%201.png"
|
|
|
|
+);
|
|
|
|
+
|
|
|
|
+let aData: any = reactive({ discounts: [] });
|
|
|
|
+let list = ref([] as receptProp[]);
|
|
|
|
+
|
|
|
|
+const isAddress = computed(() => {
|
|
|
|
+ return aData.authCheck.includes("2") ? true : false;
|
|
|
|
+});
|
|
|
|
+
|
|
|
|
+const getList = () => {
|
|
|
|
+ getActivity(appid)
|
|
|
|
+ .then((res: any) => {
|
|
|
|
+ aData = res.data[0] || {};
|
|
|
|
+ aData.authCheck = aData.authCheck.split(",");
|
|
|
|
+ list.value = aData.discounts.map((item: receptProp) => {
|
|
|
|
+ return {
|
|
|
|
+ ...item,
|
|
|
|
+ checked: false,
|
|
|
|
+ };
|
|
|
|
+ });
|
|
|
|
+ console.log("---------------------", aData);
|
|
|
|
+
|
|
|
|
+ // backImage.value = res.data[0].activityImage;
|
|
|
|
+ })
|
|
|
|
+ .catch((err) => {
|
|
|
|
+ console.log(err);
|
|
|
|
+ });
|
|
|
|
+};
|
|
|
|
+
|
|
|
|
+const handledUpload = () => {
|
|
|
|
+ uni.getLocation({
|
|
|
|
+ type: "gcj02",
|
|
|
|
+ success: async (res) => {
|
|
|
|
+ const { latitude, longitude } = res;
|
|
|
|
+ // 调用高德API
|
|
|
|
+ const key = "7c607ea6b491804270ddcdd72daad58c";
|
|
|
|
+ const url = `https://restapi.amap.com/v3/geocode/regeo?key=${key}&location=${longitude},${latitude}`;
|
|
|
|
+ const data = await uni.request({ url });
|
|
|
|
+ console.log("用户所在位置", res);
|
|
|
|
+ },
|
|
|
|
+ fail: (err) => {
|
|
|
|
+ uni.showToast({
|
|
|
|
+ title: "获取位置失败",
|
|
|
|
+ icon: "none",
|
|
|
|
+ });
|
|
|
|
+ },
|
|
|
|
+ });
|
|
|
|
+};
|
|
|
|
+
|
|
|
|
+onShow(() => {
|
|
|
|
+ getList();
|
|
|
|
+});
|
|
</script>
|
|
</script>
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
<style lang="scss" scoped>
|
|
@@ -124,7 +187,7 @@ let showDesc = ref<boolean>(false);
|
|
align-items: center;
|
|
align-items: center;
|
|
box-sizing: border-box;
|
|
box-sizing: border-box;
|
|
> view {
|
|
> view {
|
|
- width: 306rpx;
|
|
|
|
|
|
+ width: 49%;
|
|
height: 144rpx;
|
|
height: 144rpx;
|
|
background: linear-gradient(180deg, #e5fff6 0%, #ffffff 100%);
|
|
background: linear-gradient(180deg, #e5fff6 0%, #ffffff 100%);
|
|
border-radius: 24rpx;
|
|
border-radius: 24rpx;
|