|
@@ -63,7 +63,7 @@
|
|
|
<view class="radio_label">
|
|
|
<image
|
|
|
class="radio_icon"
|
|
|
- :src="item.id == checkedAddr.id ? 'https://kailin-mp.oss-cn-shenzhen.aliyuncs.com/static/icon/radioed.png' : 'https://kailin-mp.oss-cn-shenzhen.aliyuncs.com/static/icon/radio.png'"
|
|
|
+ :src="item.id == checkedAddr?.id ? 'https://kailin-mp.oss-cn-shenzhen.aliyuncs.com/static/icon/radioed.png' : 'https://kailin-mp.oss-cn-shenzhen.aliyuncs.com/static/icon/radio.png'"
|
|
|
></image>
|
|
|
</view>
|
|
|
<view class="contact_user">
|
|
@@ -92,14 +92,14 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import FollowPopup from "@/components/FollowPopup/FollowPopup.vue";
|
|
|
+import FollowPopup from '@/components/FollowPopup/FollowPopup.vue';
|
|
|
export default {
|
|
|
components: {
|
|
|
FollowPopup,
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
- height: "",
|
|
|
+ height: '',
|
|
|
// 奖项列表,
|
|
|
prizeList: [],
|
|
|
// 中奖记录
|
|
@@ -109,14 +109,14 @@ export default {
|
|
|
// 抽奖信息
|
|
|
lotteryInfo: {
|
|
|
id: 0,
|
|
|
- name: "",
|
|
|
- logo: "",
|
|
|
- number: "0",
|
|
|
- start_date: "",
|
|
|
- end_date: "",
|
|
|
- start_time: "",
|
|
|
- end_time: "",
|
|
|
- rule: "",
|
|
|
+ name: '',
|
|
|
+ logo: '',
|
|
|
+ number: '0',
|
|
|
+ start_date: '',
|
|
|
+ end_date: '',
|
|
|
+ start_time: '',
|
|
|
+ end_time: '',
|
|
|
+ rule: '',
|
|
|
},
|
|
|
recordId: 0,
|
|
|
// 请求参数
|
|
@@ -124,6 +124,7 @@ export default {
|
|
|
id: 0,
|
|
|
activity_id: 0,
|
|
|
},
|
|
|
+ checkedAddr: {},
|
|
|
};
|
|
|
},
|
|
|
onLoad(param) {
|
|
@@ -140,9 +141,9 @@ export default {
|
|
|
// 窗口信息
|
|
|
var sysinfo = uni.getWindowInfo();
|
|
|
// 获取屏幕可用高度
|
|
|
- this.height = "height:" + sysinfo.windowHeight + "px;";
|
|
|
+ this.height = 'height:' + sysinfo.windowHeight + 'px;';
|
|
|
// 监听地址变动
|
|
|
- uni.$on("addr_list_change", (data) => {
|
|
|
+ uni.$on('addr_list_change', (data) => {
|
|
|
// 地址列表
|
|
|
this.addrList = data.list;
|
|
|
});
|
|
@@ -150,7 +151,7 @@ export default {
|
|
|
//分享按钮
|
|
|
uni.showShareMenu({
|
|
|
withShareTicket: true,
|
|
|
- menus: ["shareAppMessage", "shareTimeline"],
|
|
|
+ menus: ['shareAppMessage', 'shareTimeline'],
|
|
|
});
|
|
|
// #endif
|
|
|
},
|
|
@@ -159,16 +160,16 @@ export default {
|
|
|
this.shareRequest();
|
|
|
}
|
|
|
return {
|
|
|
- title: "999智控终端平台\n正月十五猜灯谜",
|
|
|
- path: "/pages/activity/index?id=" + this.requestParam.activity_id,
|
|
|
- imageUrl: "https://kailin-mp.oss-cn-shenzhen.aliyuncs.com/static/lottery/20250210-143021.jpg",
|
|
|
+ title: '999智控终端平台\n正月十五猜灯谜',
|
|
|
+ path: '/pages/activity/index?id=' + this.requestParam.activity_id,
|
|
|
+ imageUrl: 'https://kailin-mp.oss-cn-shenzhen.aliyuncs.com/static/lottery/20250210-143021.jpg',
|
|
|
promise: new Promise((resolve, reject) => {
|
|
|
- this.$http.request("api/share_message/get_item", { item_id: this.requestParam.activity_id, pages: "/pages/activity/index" }).then((callback) => {
|
|
|
- console.log(callback, "api/share_message/get_item");
|
|
|
+ this.$http.request('api/share_message/get_item', { item_id: this.requestParam.activity_id, pages: '/pages/activity/index' }).then((callback) => {
|
|
|
+ console.log(callback, 'api/share_message/get_item');
|
|
|
let obj = {
|
|
|
- title: callback.data?.title == "" ? this.lotteryInfo.name : callback.data.title,
|
|
|
- path: "/pages/activity/index?id=" + this.requestParam.activity_id,
|
|
|
- imageUrl: callback.data?.image_url == "" ? this.lotteryInfo.logo : callback.data.image_url,
|
|
|
+ title: callback.data?.title == '' ? this.lotteryInfo.name : callback.data.title,
|
|
|
+ path: '/pages/activity/index?id=' + this.requestParam.activity_id,
|
|
|
+ imageUrl: callback.data?.image_url == '' ? this.lotteryInfo.logo : callback.data.image_url,
|
|
|
};
|
|
|
resolve(obj);
|
|
|
});
|
|
@@ -185,15 +186,15 @@ export default {
|
|
|
// 设置请求中
|
|
|
this.isReqing = true;
|
|
|
// 请求
|
|
|
- this.$http.request("api/lottery_riddle/get_detail", this.requestParam).then((re) => {
|
|
|
+ this.$http.request('api/lottery_riddle/get_detail', this.requestParam).then((re) => {
|
|
|
// 设置非请求中
|
|
|
this.isReqing = false;
|
|
|
// 成功结果
|
|
|
- if (re.code == "success") {
|
|
|
+ if (re.code == 'success') {
|
|
|
this.lotteryInfo = re.data;
|
|
|
this.prizeList = re.data.reward_list;
|
|
|
} else {
|
|
|
- if (re.code != "no_login") {
|
|
|
+ if (re.code != 'no_login') {
|
|
|
uni.showModal({
|
|
|
content: re.msg,
|
|
|
showCancel: false,
|
|
@@ -203,22 +204,22 @@ export default {
|
|
|
});
|
|
|
} else {
|
|
|
uni.showModal({
|
|
|
- content: "未知的活动ID",
|
|
|
+ content: '未知的活动ID',
|
|
|
showCancel: false,
|
|
|
});
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
shareRequest() {
|
|
|
- this.$http.request("api/riddle_active_share/add", { active_id: this.requestParam.activity_id }).then((response) => {
|
|
|
+ this.$http.request('api/riddle_active_share/add', { active_id: this.requestParam.activity_id }).then((response) => {
|
|
|
uni.showModal({
|
|
|
- title: "分享成功",
|
|
|
- confirmText: "立即答题",
|
|
|
- cancelText: "留在此页",
|
|
|
+ title: '分享成功',
|
|
|
+ confirmText: '立即答题',
|
|
|
+ cancelText: '留在此页',
|
|
|
success: (res) => {
|
|
|
if (res.confirm) {
|
|
|
uni.redirectTo({
|
|
|
- url: "/pages/activity/index?id=" + this.requestParam.activity_id,
|
|
|
+ url: '/pages/activity/index?id=' + this.requestParam.activity_id,
|
|
|
});
|
|
|
}
|
|
|
},
|
|
@@ -231,8 +232,8 @@ export default {
|
|
|
let prize = this.prizeList[index];
|
|
|
// 结果
|
|
|
uni.showModal({
|
|
|
- title: prize.id == 0 ? "很遗憾" : "恭喜您",
|
|
|
- content: (prize.id != 0 ? `获得` : "") + prize.name + (prize.reward_type == 5 ? ",请在中奖记录中填写收货地址" : ""),
|
|
|
+ title: prize.id == 0 ? '很遗憾' : '恭喜您',
|
|
|
+ content: (prize.id != 0 ? `获得` : '') + prize.name + (prize.reward_type == 5 ? ',请在中奖记录中填写收货地址' : ''),
|
|
|
showCancel: false,
|
|
|
success: (re) => {
|
|
|
if (re.confirm && prize.reward_type == 5) {
|
|
@@ -246,47 +247,47 @@ export default {
|
|
|
// 活动是否开始
|
|
|
if (!this.lotteryInfo.id) {
|
|
|
uni.showToast({
|
|
|
- title: "暂无可参与活动",
|
|
|
- icon: "none",
|
|
|
+ title: '暂无可参与活动',
|
|
|
+ icon: 'none',
|
|
|
});
|
|
|
return;
|
|
|
}
|
|
|
// 活动是否开始
|
|
|
if (this.lotteryInfo.start_time * 1000 > new Date().getTime()) {
|
|
|
uni.showToast({
|
|
|
- title: "活动还没开始哦",
|
|
|
- icon: "none",
|
|
|
+ title: '活动还没开始哦',
|
|
|
+ icon: 'none',
|
|
|
});
|
|
|
return;
|
|
|
}
|
|
|
// 活动是否结束
|
|
|
if (this.lotteryInfo.end_time * 1000 <= new Date().getTime()) {
|
|
|
uni.showToast({
|
|
|
- title: "活动已结束了哦",
|
|
|
- icon: "none",
|
|
|
+ title: '活动已结束了哦',
|
|
|
+ icon: 'none',
|
|
|
});
|
|
|
return;
|
|
|
}
|
|
|
// 次数已用完了
|
|
|
if (this.lotteryInfo.number <= 0) {
|
|
|
uni.showToast({
|
|
|
- title: "次数已用完了",
|
|
|
- icon: "none",
|
|
|
+ title: '次数已用完了',
|
|
|
+ icon: 'none',
|
|
|
});
|
|
|
return;
|
|
|
}
|
|
|
if (!this.$checkAccess.getHasFollow()) {
|
|
|
- this.$refs.addFollow.open("center");
|
|
|
+ this.$refs.addFollow.open('center');
|
|
|
return;
|
|
|
}
|
|
|
// 次数操作
|
|
|
this.lotteryInfo.number = this.lotteryInfo.number - 1;
|
|
|
// 请求列表
|
|
|
- this.$http.request("/api/lottery_riddle/get_reward", { lottery_id: this.lotteryInfo.id }).then((re) => {
|
|
|
+ this.$http.request('/api/lottery_riddle/get_reward', { lottery_id: this.lotteryInfo.id }).then((re) => {
|
|
|
// 设置非请求中
|
|
|
this.isReqing = false;
|
|
|
// 成功结果
|
|
|
- if (re.code == "success") {
|
|
|
+ if (re.code == 'success') {
|
|
|
// 奖品列表更新
|
|
|
this.prizeList = re.data.reward_list;
|
|
|
// 奖品的索引
|
|
@@ -294,7 +295,7 @@ export default {
|
|
|
} else {
|
|
|
uni.showToast({
|
|
|
title: re.msg,
|
|
|
- icon: "none",
|
|
|
+ icon: 'none',
|
|
|
});
|
|
|
return;
|
|
|
}
|
|
@@ -304,7 +305,7 @@ export default {
|
|
|
this.$refs.addFollow.close();
|
|
|
},
|
|
|
showRule() {
|
|
|
- this.$refs.lotteryRule.open("center");
|
|
|
+ this.$refs.lotteryRule.open('center');
|
|
|
},
|
|
|
closeRule() {
|
|
|
this.$refs.lotteryRule.close();
|
|
@@ -313,21 +314,22 @@ export default {
|
|
|
// 活动是否开始
|
|
|
if (this.lotteryInfo.id) {
|
|
|
// 请求列表
|
|
|
- this.$http.request("/api/lottery_riddle_record/get_list", { lottery_id: this.lotteryInfo.id }).then((re) => {
|
|
|
+ this.$http.request('/api/lottery_riddle_record/get_list', { lottery_id: this.lotteryInfo.id }).then((re) => {
|
|
|
// 设置非请求中
|
|
|
this.isReqing = false;
|
|
|
// 成功结果
|
|
|
- if (re.code == "success") {
|
|
|
+ if (re.code == 'success') {
|
|
|
this.recordList = re.data;
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
- this.$refs.lotteryRecord.open("bottom");
|
|
|
+ this.$refs.lotteryRecord.open('bottom');
|
|
|
},
|
|
|
closeRecord() {
|
|
|
this.$refs.lotteryRecord.close();
|
|
|
},
|
|
|
openAddr(index) {
|
|
|
+ console.log(index, 'test');
|
|
|
// 选择的下标
|
|
|
this.recordIndex = index;
|
|
|
// 地址列表
|
|
@@ -336,20 +338,20 @@ export default {
|
|
|
// 选择地址
|
|
|
checkedAddrItem(item) {
|
|
|
// 判断数据
|
|
|
- this.$http.request("api/lottery_riddle_record/set_addr", { id: this.recordList[this.recordIndex].id, addr_id: item.id }, "post").then((callback) => {
|
|
|
+ this.$http.request('api/lottery_riddle_record/set_addr', { id: this.recordList[this.recordIndex].id, addr_id: item.id }, 'post').then((callback) => {
|
|
|
// 获取成功
|
|
|
- if (callback.code == "success") {
|
|
|
+ if (callback.code == 'success') {
|
|
|
this.recordList[this.recordIndex].status = 1;
|
|
|
- this.recordList[this.recordIndex].state = "进行中";
|
|
|
+ this.recordList[this.recordIndex].state = '进行中';
|
|
|
}
|
|
|
this.$refs.addrPopup.close();
|
|
|
});
|
|
|
},
|
|
|
getAddrList(showPopup = false) {
|
|
|
// 判断数据
|
|
|
- this.$http.request("api/custom_addr/get_list").then((callback) => {
|
|
|
+ this.$http.request('api/custom_addr/get_list').then((callback) => {
|
|
|
// 获取成功
|
|
|
- if (callback.code == "success") {
|
|
|
+ if (callback.code == 'success') {
|
|
|
this.addrList = callback.data;
|
|
|
// 如果有的话
|
|
|
if (this.addrList.length) {
|
|
@@ -359,12 +361,12 @@ export default {
|
|
|
if (this.addrList[i].is_default) this.checkedAddr = this.addrList[i];
|
|
|
}
|
|
|
// 如果没有默认的话
|
|
|
- if (!this.checkedAddr.id) {
|
|
|
+ if (!this.checkedAddr?.id) {
|
|
|
this.checkedAddr = this.addrList[this.addrList.length - 1];
|
|
|
}
|
|
|
}
|
|
|
// 弹出地址层
|
|
|
- if (showPopup) this.$refs.addrPopup.open("bottom");
|
|
|
+ if (showPopup) this.$refs.addrPopup.open('bottom');
|
|
|
}
|
|
|
});
|
|
|
},
|
|
@@ -591,16 +593,16 @@ export default {
|
|
|
}
|
|
|
.reward_state {
|
|
|
float: right;
|
|
|
- color: #deb887;
|
|
|
- display: block;
|
|
|
- font-size: 26rpx;
|
|
|
- overflow: hidden;
|
|
|
- background: transparent;
|
|
|
+ color: #deb887;
|
|
|
+ display: block;
|
|
|
+ font-size: 26rpx;
|
|
|
+ overflow: hidden;
|
|
|
+ background: transparent;
|
|
|
+ }
|
|
|
+ .reward_state::after {
|
|
|
+ border: none;
|
|
|
+ background: transparent;
|
|
|
}
|
|
|
- .reward_state::after{
|
|
|
- border: none;
|
|
|
- background: transparent;
|
|
|
- }
|
|
|
}
|
|
|
}
|
|
|
}
|