|
@@ -25,7 +25,7 @@
|
|
|
<view class="page-2" v-if="pageIndex == 2">
|
|
|
<!-- 题干区域 -->
|
|
|
<view class="question">
|
|
|
- <text style="font-weight: bold">猜灯谜:{{ question.title }}</text>
|
|
|
+ <text style="font-weight: bold">{{ question.title }}</text>
|
|
|
<br />
|
|
|
<view style="margin-top: 20rpx">(请从下面选择正确答案提交)</view>
|
|
|
</view>
|
|
@@ -98,11 +98,11 @@
|
|
|
</template>
|
|
|
|
|
|
<script setup>
|
|
|
-import { ref, getCurrentInstance } from "vue";
|
|
|
+import { ref, getCurrentInstance } from 'vue';
|
|
|
|
|
|
-import { onShareAppMessage, onLoad, onShow } from "@dcloudio/uni-app";
|
|
|
+import { onShareAppMessage, onLoad, onShow } from '@dcloudio/uni-app';
|
|
|
|
|
|
-import http from "@/utils/request";
|
|
|
+import http from '@/utils/request';
|
|
|
|
|
|
const { appContext } = getCurrentInstance();
|
|
|
const $checkAccess = appContext.config.globalProperties.$checkAccess;
|
|
@@ -110,7 +110,7 @@ const $checkAccess = appContext.config.globalProperties.$checkAccess;
|
|
|
const pageIndex = ref(1);
|
|
|
|
|
|
const question = ref({
|
|
|
- title: "",
|
|
|
+ title: '',
|
|
|
answer_list: [],
|
|
|
});
|
|
|
|
|
@@ -124,7 +124,7 @@ const answer_id = ref(null);
|
|
|
|
|
|
const is_answer = ref(false);
|
|
|
|
|
|
-const lottery_list = ref("还没有人中奖,快来参与吧!");
|
|
|
+const lottery_list = ref('还没有人中奖,快来参与吧!');
|
|
|
|
|
|
const isFromIndex = ref(false);
|
|
|
|
|
@@ -136,10 +136,10 @@ onLoad((options) => {
|
|
|
//未登陆提醒用户登陆
|
|
|
if (!$checkAccess.checkLogin()) {
|
|
|
uni.showModal({
|
|
|
- title: "温馨提示",
|
|
|
- content: "请先登录",
|
|
|
- confirmText: "去登录",
|
|
|
- cancelText: "取消",
|
|
|
+ title: '温馨提示',
|
|
|
+ content: '请先登录',
|
|
|
+ confirmText: '去登录',
|
|
|
+ cancelText: '取消',
|
|
|
success: (res) => {
|
|
|
if (res.confirm) {
|
|
|
uni.redirectTo({
|
|
@@ -160,23 +160,23 @@ onLoad((options) => {
|
|
|
//分享按钮
|
|
|
uni.showShareMenu({
|
|
|
withShareTicket: true,
|
|
|
- menus: ["shareAppMessage", "shareTimeline"],
|
|
|
+ menus: ['shareAppMessage', 'shareTimeline'],
|
|
|
});
|
|
|
// #endif
|
|
|
});
|
|
|
|
|
|
onShow(() => {
|
|
|
- console.log("回到小程序");
|
|
|
+ console.log('回到小程序');
|
|
|
|
|
|
if (detialId.value) {
|
|
|
_getDeatail(detialId.value);
|
|
|
}
|
|
|
|
|
|
if ($checkAccess.checkLogin()) {
|
|
|
- http.request("api/custom/get_info").then((callback) => {
|
|
|
- if (callback.code == "success") {
|
|
|
+ http.request('api/custom/get_info').then((callback) => {
|
|
|
+ if (callback.code == 'success') {
|
|
|
// 存储登录标识
|
|
|
- uni.setStorageSync("userInfo", callback.data);
|
|
|
+ uni.setStorageSync('userInfo', callback.data);
|
|
|
}
|
|
|
});
|
|
|
}
|
|
@@ -192,12 +192,12 @@ onShareAppMessage((res) => {
|
|
|
path: `/pages/activity/index?id=${detialId.value}`,
|
|
|
imageUrl: acticve_detail.value.logo,
|
|
|
promise: new Promise((resolve, reject) => {
|
|
|
- http.request("api/share_message/get_item", { item_id: detialId.value, pages: "/pages/activity/index" }).then((callback) => {
|
|
|
- console.log(callback, "api/share_message/get_item");
|
|
|
+ http.request('api/share_message/get_item', { item_id: detialId.value, pages: '/pages/activity/index' }).then((callback) => {
|
|
|
+ console.log(callback, 'api/share_message/get_item');
|
|
|
resolve({
|
|
|
- title: callback.data?.title == "" ? acticve_detail.value.name : callback.data.title,
|
|
|
+ title: callback.data?.title == '' ? acticve_detail.value.name : callback.data.title,
|
|
|
path: `/pages/activity/index?id=${detialId.value}`,
|
|
|
- imageUrl: callback.data?.image_url == "" ? acticve_detail.value.logo : callback.data.image_url,
|
|
|
+ imageUrl: callback.data?.image_url == '' ? acticve_detail.value.logo : callback.data.image_url,
|
|
|
});
|
|
|
});
|
|
|
}),
|
|
@@ -210,9 +210,9 @@ const _handleCloseLottery = () => {
|
|
|
|
|
|
const _getDeatail = (id) => {
|
|
|
if (!id) return;
|
|
|
- http.request("api/riddle_active/get_detail", { id }).then((response) => {
|
|
|
+ http.request('api/riddle_active/get_detail', { id }).then((response) => {
|
|
|
console.log(response);
|
|
|
- if (response.code == "success") {
|
|
|
+ if (response.code == 'success') {
|
|
|
uni.setNavigationBarTitle({
|
|
|
title: response.data.name,
|
|
|
});
|
|
@@ -221,10 +221,10 @@ const _getDeatail = (id) => {
|
|
|
_getQuestion();
|
|
|
pageIndex.value = 1;
|
|
|
}
|
|
|
- http.request("api/lottery_riddle_record/get_list_all", { lottery_id: response.data.lottery_id }).then((res) => {
|
|
|
- if (res.code == "success") {
|
|
|
+ http.request('api/lottery_riddle_record/get_list_all', { lottery_id: response.data.lottery_id }).then((res) => {
|
|
|
+ if (res.code == 'success') {
|
|
|
if (res.data?.length > 0) {
|
|
|
- let str = "";
|
|
|
+ let str = '';
|
|
|
|
|
|
res.data.forEach((item) => {
|
|
|
str += `用户${item.username}已获得${item.reward_name};`;
|
|
@@ -238,15 +238,15 @@ const _getDeatail = (id) => {
|
|
|
console.log(response);
|
|
|
uni.showToast({
|
|
|
title: response.msg,
|
|
|
- icon: "none",
|
|
|
+ icon: 'none',
|
|
|
});
|
|
|
}
|
|
|
});
|
|
|
};
|
|
|
|
|
|
const _getQuestion = () => {
|
|
|
- http.request("api/riddle_question/get_question").then((response) => {
|
|
|
- if (response.code == "success") {
|
|
|
+ http.request('api/riddle_question/get_question').then((response) => {
|
|
|
+ if (response.code == 'success') {
|
|
|
question.value = response.data;
|
|
|
}
|
|
|
});
|
|
@@ -263,31 +263,31 @@ const _handleSubmitAnswer = () => {
|
|
|
question_id: question.value.id,
|
|
|
answer_id: answer_id.value,
|
|
|
};
|
|
|
- http.request("api/riddle_answer/check_answer", _param).then((response) => {
|
|
|
- if (response.code == "success") {
|
|
|
+ http.request('api/riddle_answer/check_answer', _param).then((response) => {
|
|
|
+ if (response.code == 'success') {
|
|
|
pageIndex.value = 3;
|
|
|
// _getDeatail(detialId.value);
|
|
|
is_answer.value = response.data.is_answer;
|
|
|
} else {
|
|
|
uni.showToast({
|
|
|
title: response.msg,
|
|
|
- icon: "none",
|
|
|
+ icon: 'none',
|
|
|
});
|
|
|
}
|
|
|
});
|
|
|
};
|
|
|
|
|
|
const _addShare = () => {
|
|
|
- http.request("api/riddle_active_share/add", { active_id: detialId.value }).then((response) => {});
|
|
|
+ http.request('api/riddle_active_share/add', { active_id: detialId.value }).then((response) => {});
|
|
|
};
|
|
|
|
|
|
const _goLottery = () => {
|
|
|
if (!$checkAccess.checkLogin()) {
|
|
|
uni.showModal({
|
|
|
- title: "温馨提示",
|
|
|
- content: "请先登录",
|
|
|
- confirmText: "去登录",
|
|
|
- cancelText: "取消",
|
|
|
+ title: '温馨提示',
|
|
|
+ content: '请先登录',
|
|
|
+ confirmText: '去登录',
|
|
|
+ cancelText: '取消',
|
|
|
success: (res) => {
|
|
|
if (res.confirm) {
|
|
|
uni.redirectTo({
|
|
@@ -319,7 +319,7 @@ const _handleChangePage = (index) => {
|
|
|
};
|
|
|
|
|
|
const _handleChangeRule = (type) => {
|
|
|
- if (type == "show") lotteryRule.value.open("center");
|
|
|
+ if (type == 'show') lotteryRule.value.open('center');
|
|
|
else lotteryRule.value.close();
|
|
|
};
|
|
|
</script>
|