<template>
|
<view class="index" :data-theme='theme()' :class="theme() || ''"
|
:style="'background-color: '+activityData.background_color">
|
<view v-if="activityData.name" class="personal-data">
|
<view class='list'>
|
<!--活动背景图-->
|
<view class="activity-pic">
|
<image :src="activityData.image_id?activityData.image.file_path:remoteImg('activity_bg')"
|
class="image" mode="widthFix"></image>
|
</view>
|
<view class="wrapper bg-white radius24">
|
<view class="text-info">
|
<view class="d-b-c activity-name">
|
<view class="title text-ellipsis-2">{{activityData.name}}</view>
|
<view class="share" @click="showShare">
|
<text class="iconfont icon-share1"></text>
|
分享
|
</view>
|
</view>
|
<view class="activity-item">
|
<view class="gray6 f24">报名截止时间</view>
|
<view class="info">{{activityData.status_text.reg_end_time}}</view>
|
</view>
|
<view class="activity-item">
|
<view class="gray6 f24">活动时间</view>
|
<view class="info">{{activityData.activity_time_text}}</view>
|
</view>
|
<view class="activity-item d-b-c">
|
<view class="flex-1">
|
<view class="gray6 f24">活动名额</view>
|
<view class="info">{{activityData.limit_num == 0 ? '不限' : activityData.limit_num+'人'}}
|
</view>
|
</view>
|
|
<view class="flex-1">
|
<view class="activity-item">
|
<view class="gray6 f24">活动费用</view>
|
<view class="info" v-if="activityData.fee > 0">¥{{activityData.fee}}/人</view>
|
<view class="info" v-else>免费</view>
|
</view>
|
</view>
|
</view>
|
<view class="activity-item d-b-c" v-if="activityData.address">
|
<view class="flex-1">
|
<view class="gray6 f24">活动地点</view>
|
<view class="info">{{activityData.address}}</view>
|
</view>
|
<view>
|
<view class="d-s-c contact ml20">
|
<view class="d-c-c d-c" @click="openLocation()">
|
<text class="iconfont icon-dizhi"></text>
|
<text class="text">导航</text>
|
</view>
|
<view class="d-c-c d-c ml20" @click="callPhone()">
|
<text class="iconfont icon-002dianhua"></text>
|
<text class="text">电话</text>
|
</view>
|
</view>
|
</view>
|
</view>
|
<view class="activity-item" v-if="activityData.is_visit == 1">
|
<view class="gray6 f24">走访企业</view>
|
<view class="info">{{activityData.visitSupplier?activityData.visitSupplier.name:''}}</view>
|
<view class="info">{{activityData.visit_supplier_name?activityData.visit_supplier_name:''}}</view>
|
</view>
|
<view class="activity-item"
|
v-if="activityData.is_visit == 0 && activityData.space_supplier_id > 0">
|
<view class="gray6 f24">提供场地企业</view>
|
<view class="info">{{activityData.spaceSupplier?activityData.spaceSupplier.name:''}}</view>
|
</view>
|
<view class="activity-item">
|
<view class="gray6 f24">活动发起分会</view>
|
<view class="info">{{activityData.branch.name}}</view>
|
</view>
|
<view class="activity-item">
|
<view>
|
<view class="gray6 f24">已报名人员({{activityData.total}}人)</view>
|
<view class="info"></view>
|
</view>
|
<view class="avatar-list d-s-c pt10">
|
<view class="d-c-c d-c avatar-item" v-for="(item, index) in userList" :key="index">
|
<image :src="item.avatarUrl" mode="aspectFill"></image>
|
<text class="text-ellipsis">{{item.real_name}}</text>
|
</view>
|
<view class="more d-c-c d-c" v-if="activityData.total > 5" @click="openUser">
|
<view class="d-c-c more-icon">
|
<text class="iconfont icon-gengduo"></text>
|
</view>
|
<text>更多</text>
|
</view>
|
</view>
|
</view>
|
|
<!-- 活动结束图标 -->
|
<view class="status-image" v-if="activityData.status_text.status==2">
|
<image :src="remoteImg('finish')"></image>
|
</view>
|
<!-- 活动进行中图标 -->
|
<view class="status-image" v-else-if="activityData.status_text.status==1">
|
<image :src="remoteImg('in_progress')"></image>
|
</view>
|
<!-- 已签到状态显示 -->
|
<view class="status-verify" v-if="activityData.is_verify">
|
<text class="iconfont icon-dianzan"></text>您已签到
|
</view>
|
</view>
|
</view>
|
<!-- 活动介绍 -->
|
<view class="wrapper bg-white radius24" v-if="activityData.content || activityData.describe">
|
<view class="info-title-box tc pt30 fb f30">
|
<view class="info-title">活动介绍</view>
|
</view>
|
<view class="activity-desc p30" v-html="activityData.content||activityData.describe"></view>
|
<!-- <view class="activity-desc p30" v-else>{{ activityData.describe }}</view> -->
|
</view>
|
</view>
|
<view class="detail-footer">
|
<!-- 如果是扫码进来的,都显示可以签到 -->
|
<view :class="{'d-c-c two-col-btn':canReg == 1}" v-if="user_verify">
|
<button class='modifyBnt disabled' v-if="activityData.is_verify">您已签到</button>
|
<button class='modifyBnt' @click="onVerify" v-else>马上签到</button>
|
<button class='modifyBnt' @click="onReg(true)" v-if="canReg==1">帮朋友报名</button>
|
</view>
|
<!-- 如果活动已结束 -->
|
<view class="d-c-c two-col-btn" v-else-if="activityData.status_text.status==2">
|
<button class='modifyBnt' @click="onAlbum">活动相册</button>
|
<!-- 如果有走访企业,跳转企业店铺 -->
|
<button class='modifyBnt' @click="gotoSupplier" v-if="activityData.is_visit">走访企业的店铺</button>
|
<button class='modifyBnt' @click="showShare" v-else>分享给好友</button>
|
</view>
|
<block v-else>
|
<!-- 如果已经报名 -->
|
<view class="d-c-c two-col-btn" v-if="activityData.is_reg">
|
<button class='modifyBnt disabled' v-if="activityData.is_verify">您已签到</button>
|
<button class='modifyBnt disabled' v-else @click="scanCode">您已报名</button>
|
<button class='modifyBnt' @click="onReg(true)" v-if="canReg==1">帮朋友报名</button>
|
<block v-else>
|
<button class='modifyBnt' @click="showShare" v-if="activityData.is_verify">分享给好友</button>
|
<button class='modifyBnt' @click="scanCode" v-else>扫码签到</button>
|
</block>
|
</view>
|
<!-- 如果还没有报名 -->
|
<block v-else>
|
<view class="d-c-c two-col-btn" v-if="canReg==1">
|
<button class='modifyBnt' @click="onReg(false)">我要报名</button>
|
<button class='modifyBnt' @click="onReg(true)">帮朋友报名</button>
|
</view>
|
<view class="d-c-c" v-else>
|
<button v-if="canReg==0" class='modifyBnt disabled'>报名未开始</button>
|
<button v-else-if="canReg==3" class='modifyBnt disabled'>已报满</button>
|
<button v-else class='modifyBnt disabled'>报名已结束</button>
|
</view>
|
</block>
|
</block>
|
</view>
|
</view>
|
<!-- 活动购物图标(仅在活动进行时显示) -->
|
<view class="shopping-box" @click="gotoPage('pages/branch/activity/product/index?activity_id='+activity_id)" v-if="activityData.is_visit && activityData.status_text.status == 1 && activityData.is_verify">
|
<image :src="remoteImg('activity_shopping')"></image>
|
</view>
|
<!--报名成功弹窗-->
|
<view class="success-box" v-if="isShowbox">
|
<view class="bg" @click="isShowbox=false"></view>
|
<view class="con bg-white radius24">
|
<image :src="remoteImg('sign_success')" mode=""></image>
|
<view class="title">报名成功</view>
|
<view class="text">感谢参与,您已完成报名!</view>
|
<view class="foot">
|
<navigator url="/pages/user/my_activity/index" hover-class='none' class="btn">查看我的报名</navigator>
|
<view class="btn" @click="showShare">分享报名</view>
|
</view>
|
</view>
|
</view>
|
<!--签到成功弹窗-->
|
<view class="success-box" v-if="isVerify">
|
<view class="bg" @click="isVerify=false"></view>
|
<view class="con bg-white radius24">
|
<image :src="remoteImg('sign_success')" mode=""></image>
|
<view class="title">签到成功</view>
|
<view class="text">感谢参与,祝您收获满满!</view>
|
<view class="foot">
|
<view class="btn" @click="isVerify=false">确定</view>
|
</view>
|
</view>
|
</view>
|
<!--生成分享图片-->
|
<uniPopup :show="isCreatedImg" type="middle" @hidePopup="hidePopupFunc">
|
<view class="d-c-c d-c create-img">
|
<image :src="poster_img" mode="widthFix"></image>
|
<!-- #ifdef MP -->
|
<button class="btn-red mt20" type="default" @click="savePosterImg">保存图片</button>
|
<!-- #endif -->
|
<!-- #ifdef H5 -->
|
<view class="mt20 f34 red" type="default">长按保存图片</view>
|
<!-- #endif -->
|
</view>
|
</uniPopup>
|
<!--核销失败弹窗-->
|
<uniPopup :show="isShowVerify" type="middle" @hidePopup="popupVerifyFunc(null)">
|
<view class="d-c-c d-c verify-choose">
|
<view class="f30 fb">签到失败了,因为您还没报名</view>
|
<view class="p-20-0 f28 gray6">如果您朋友已经帮您报名了,请输入您的手机号重新签到:</view>
|
<input class="ww100 f30 fb tc verify-input" type="text" maxlength="30" placeholder="请输入手机号码" v-model="verify_mobile" placeholder-class="placeholder" />
|
<view class="foot">
|
<view class="btn" @click="popupVerifyFunc('reg')">现在报名</view>
|
<view class="btn" @click="popupVerifyFunc('retry')">重新签到</view>
|
</view>
|
</view>
|
</uniPopup>
|
<!-- 报名弹窗 -->
|
<RegForm ref="regForm" :isOpenReg="isOpenReg" :in_radius="in_radius" :is_friend="is_friend" @close="closeRegFunc"></RegForm>
|
<!--分享底部弹窗-->
|
<Share :isbottmpanel="isbottmpanel" :activity_id="activity_id" @close="closeBottmpanel"></Share>
|
<!--app分享-->
|
<AppShare :isAppShare="isAppShare" :appParams="appParams" @close="closeAppShare"></AppShare>
|
<!-- 打开活动相册 -->
|
<Album ref="album" :isOpenAlbum="isOpenAlbum" :activity_id="activity_id" @close="closeAlbumFunc"></Album>
|
<!-- 打开报名用户名单 -->
|
<User ref="user" :isOpenUser="isOpenUser" :activity_id="activity_id" @close="closeUserFunc"></User>
|
</view>
|
</template>
|
|
<script>
|
import {
|
pay
|
} from '@/common/pay.js';
|
import RegForm from './popup/reg';
|
import AppShare from '@/components/app-share.vue';
|
import Share from './popup/share.vue';
|
import Album from './popup/album.vue'; // 相册
|
import uniPopup from '@/components/uni-popup.vue';
|
import utils from '@/common/utils.js';
|
import User from './popup/user.vue'; // 相册
|
export default {
|
components: {
|
RegForm,
|
AppShare,
|
Share,
|
Album,
|
uniPopup,
|
User,
|
},
|
data() {
|
return {
|
form: {
|
activity_id: '',
|
user_name: '',
|
mobile: '',
|
},
|
balance: 0,
|
activity_id: 0,
|
activityData: {
|
status_text: {
|
reg_status: 0
|
}
|
},
|
userList: [],
|
/*是否显示支付宝支付,只有在h5,非微信内打开才显示*/
|
showAlipay: false,
|
pay_type: "",
|
isOpenReg: false,
|
isShowbox: false, // 报名成功弹窗
|
isOpenAlbum: false, // 相册
|
/*分享*/
|
isbottmpanel: false,
|
/*是否生成图片*/
|
isCreatedImg: false,
|
poster_img: '',
|
/*app分享*/
|
isAppShare: false,
|
appParams: {
|
title: '',
|
summary: '',
|
path: '',
|
image: ''
|
},
|
// 用户当前坐标
|
latitude: 0,
|
longitude: 0,
|
isVerify: false, // 签到成功弹窗
|
in_radius: false, // 用户是否在活动地点限定范围内
|
user_verify: 0, // 核销标识,只有扫核销码进来值才是1
|
is_friend: false, // 是否是帮朋友报名
|
isShowVerify: false, // 核销选择框(针对核销时返回未报名的情况,选择是否有朋友帮报名)
|
verify_mobile: '', // 朋友帮报名填的手机号
|
isOpenUser: false, // 报名用户名单弹窗
|
}
|
},
|
onLoad(e) {
|
/*活动id*/
|
let scene = utils.getSceneData(e);
|
if (scene && typeof scene === 'object' && Object.keys(scene).length > 0) {
|
this.activity_id = scene.activity_id;
|
this.user_verify = scene.user_verify;
|
} else {
|
this.activity_id = e.activity_id;
|
}
|
},
|
onShow() {
|
this.getData();
|
},
|
onUnload() {
|
this.stopWatchingLocation();
|
},
|
computed: {
|
canReg() {
|
let status = this.activityData.status_text.reg_status; // 0未开始 1可报 2报名已结束 3报满
|
if (this.activityData.status_text.reg_status == 1 && (this.activityData.limit_num > this.activityData.total || this.activityData.limit_num == 0)) {
|
status = 1;
|
} else if (this.activityData.limit_num == this.activityData.total && this.activityData.limit_num > 0) {
|
status = 3;
|
}
|
return status;
|
},
|
},
|
methods: {
|
/*获取数据*/
|
getData() {
|
let self = this;
|
uni.showLoading({
|
title: '加载中'
|
});
|
self.loading = true;
|
self._get(
|
'branch.activity/detail', {
|
activity_id: self.activity_id
|
},
|
function(res) {
|
self.activityData = res.data.detail;
|
self.userList = res.data.userList;
|
// 当活动设置了签到范围并且是扫核销码进来的
|
if (self.activityData.radius > 0 && self.user_verify) {
|
self.initializeWithLocation();
|
}
|
self.loadding = false;
|
uni.hideLoading();
|
}
|
);
|
},
|
|
// 初始化并等待位置信息
|
async initializeWithLocation() {
|
try {
|
|
// 等待获取第一个有效位置
|
const location = await this.startWatchingLocation();
|
|
console.log('获得初始位置:', location);
|
|
// 检查用户是否在活动范围
|
this.updateInRadius();
|
|
} catch (error) {
|
console.error('初始化失败:', error);
|
uni.showToast({
|
title: '位置获取失败,请重新扫码试试',
|
icon: 'none'
|
});
|
}
|
},
|
|
// 修改后的开始监听位置方法,返回 Promise
|
startWatchingLocation() {
|
return new Promise(async (resolve, reject) => {
|
try {
|
// 存储 resolve 和 reject 以便在位置回调中使用
|
this.locationResolve = resolve;
|
this.locationReject = reject;
|
|
// 申请定位权限
|
await this.authorizeLocation();
|
|
// 开始位置更新
|
await this.startLocationUpdate();
|
|
// 监听位置变化
|
this.watchLocationChange();
|
|
// 设置超时处理
|
setTimeout(() => {
|
if (this.locationReject) {
|
this.locationReject(new Error('位置获取超时'));
|
this.locationResolve = null;
|
this.locationReject = null;
|
}
|
}, 10000); // 10秒超时
|
|
} catch (error) {
|
reject(error);
|
}
|
});
|
},
|
|
// 授权定位
|
authorizeLocation() {
|
return new Promise((resolve, reject) => {
|
uni.authorize({
|
scope: 'scope.userLocation',
|
success: resolve,
|
fail: (err) => {
|
uni.showModal({
|
title: '提示',
|
content: '需要您授权位置信息,请前往设置页开启权限',
|
success: (modalRes) => {
|
if (modalRes.confirm) {
|
uni.openSetting({
|
success: (openRes) => {
|
if (openRes.authSetting[
|
'scope.userLocation'
|
]) {
|
resolve();
|
} else {
|
reject(new Error(
|
'用户未授权位置权限'));
|
}
|
}
|
});
|
} else {
|
reject(new Error('用户取消授权'));
|
}
|
}
|
});
|
}
|
});
|
});
|
},
|
|
// 开启位置更新
|
startLocationUpdate() {
|
return new Promise((resolve, reject) => {
|
uni.startLocationUpdate({
|
success: resolve,
|
fail: reject
|
});
|
});
|
},
|
|
// 监听位置变化
|
watchLocationChange() {
|
if (this._locationChangeCallback) {
|
uni.offLocationChange(this._locationChangeCallback);
|
}
|
|
this._locationChangeCallback = (res) => {
|
console.log('位置变化:', res);
|
this.latitude = res.latitude;
|
this.longitude = res.longitude;
|
|
// 如果是第一次获取位置,解析 Promise
|
if (this.locationResolve) {
|
this.locationResolve({
|
latitude: res.latitude,
|
longitude: res.longitude,
|
accuracy: res.accuracy
|
});
|
this.locationResolve = null;
|
this.locationReject = null;
|
}
|
|
// 位置更新后处理
|
this.updateInRadius();
|
};
|
|
uni.onLocationChange(this._locationChangeCallback);
|
},
|
|
// 检查是否在签到范围
|
updateInRadius() {
|
let self = this;
|
// 如果不是扫码进来的或者没有设置活动范围
|
if (!self.user_verify || !self.activityData.radius) {
|
return;
|
}
|
// 计算距离
|
const distance = this.calculateDistance(
|
parseFloat(self.latitude),
|
parseFloat(self.longitude),
|
parseFloat(self.activityData.latitude),
|
parseFloat(self.activityData.longitude)
|
);
|
if (distance <= self.activityData.radius) {
|
self.in_radius = true;
|
}
|
},
|
|
// 停止监听位置
|
stopWatchingLocation() {
|
if (this._locationChangeCallback) {
|
uni.offLocationChange(this._locationChangeCallback);
|
this._locationChangeCallback = null;
|
}
|
|
// 清理 Promise 相关状态
|
if (this.locationReject) {
|
this.locationReject(new Error('位置监听已停止'));
|
this.locationResolve = null;
|
this.locationReject = null;
|
}
|
|
uni.stopLocationUpdate();
|
},
|
|
// 获取用户坐标并判断在不在活动范围内(弃用)
|
// getUserLocation() {
|
// let self = this;
|
// uni.getLocation({
|
// type: 'gcj02',
|
// success: (res) => {
|
// self.latitude = res.latitude;
|
// self.longitude = res.longitude;
|
// // 计算距离
|
// const distance = this.calculateDistance(
|
// res.latitude, res.longitude,
|
// parseFloat(self.activityData.latitude), parseFloat(self.activityData.longitude)
|
// );
|
// if (distance <= self.activityData.radius) {
|
// self.in_radius = true;
|
// }
|
// },
|
// fail: (err) => {
|
// console.error('获取位置失败:', err);
|
// uni.showToast({
|
// title: '获取位置失败' + err,
|
// icon: 'none'
|
// });
|
// }
|
// });
|
// },
|
|
onReg(e) {
|
this.$refs.regForm.activityData = this.activityData;
|
/* this.$refs.regForm.branch_name = this.activityData.branch.name;
|
this.$refs.regForm.formData.branch_id = this.activityData.branch_id; */
|
this.is_friend = e;
|
//if (this.activityData.fee > 0 || e || !this.activityData.is_member) {
|
this.isOpenReg = true;
|
/* } else {
|
uni.showModal({
|
title: '提示',
|
content: '确定要报名吗?',
|
success: (modalRes) => {
|
if (modalRes.confirm) {
|
this.$refs.regForm.onSubmit();
|
}
|
}
|
});
|
} */
|
},
|
|
closeRegFunc(e) {
|
this.isOpenReg = false;
|
if (e !== null) {
|
if (e == 1) {
|
this.isShowbox = true;
|
this.getData();
|
} else {
|
uni.showToast({
|
title: '报名失败',
|
duration: 1000,
|
icon: 'none'
|
});
|
}
|
}
|
},
|
|
// 签到
|
onVerify() {
|
let self = this;
|
if (!self.in_radius && self.activityData.radius > 0) {
|
uni.showModal({
|
title: '签到失败',
|
content: `您距离活动地点太远,无法签到`,
|
showCancel: false
|
});
|
return false;
|
} else {
|
self.doVierfy();
|
}
|
},
|
|
// 执行签到
|
doVierfy() {
|
let self = this;
|
uni.showLoading({
|
title: '正在签到...'
|
});
|
self._post(
|
'branch.activityUser/verify', {
|
activity_id: self.activity_id,
|
verify_mobile: self.verify_mobile
|
},
|
function(res) {
|
uni.hideLoading();
|
if (res.data.result =='not_reg') {
|
self.isShowVerify = true;
|
return;
|
}
|
self.isVerify = true;
|
self.getData();
|
}
|
);
|
},
|
|
// 签到失败弹窗处理
|
popupVerifyFunc(e) {
|
if (e == 'reg') {
|
this.onReg(false);
|
} else if (e == 'retry') { // 朋友帮报名,输入手机号重新签到
|
if (this.verify_mobile == '') {
|
uni.showToast({
|
title: '请输入手机号',
|
icon: 'none'
|
});
|
return;
|
}
|
if (!/^1(3|4|5|7|8|9|6)\d{9}$/i.test(this.verify_mobile)) {
|
uni.showToast({
|
title: '请输入正确的手机号',
|
icon: 'none'
|
});
|
return;
|
}
|
this.doVierfy();
|
}
|
this.verify_mobile = '';
|
this.isShowVerify = false;
|
},
|
|
// 计算坐标距离
|
calculateDistance(lat1, lng1, lat2, lng2) {
|
const R = 6371000; // 地球半径(米)
|
const toRadians = (degree) => degree * (Math.PI / 180);
|
|
const φ1 = toRadians(lat1);
|
const φ2 = toRadians(lat2);
|
const Δφ = toRadians(lat2 - lat1);
|
const Δλ = toRadians(lng2 - lng1);
|
|
const a = Math.sin(Δφ / 2) * Math.sin(Δφ / 2) +
|
Math.cos(φ1) * Math.cos(φ2) *
|
Math.sin(Δλ / 2) * Math.sin(Δλ / 2);
|
const c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a));
|
|
const distance = R * c;
|
return Math.round(distance * 100) / 100; // 保留两位小数
|
},
|
|
// 打开相册
|
onAlbum() {
|
this.isOpenAlbum = true;
|
this.$refs.album.initData();
|
this.$refs.album.getData();
|
},
|
|
closeAlbumFunc(e) {
|
this.isOpenAlbum = false;
|
},
|
|
//关闭分享
|
closeBottmpanel(data) {
|
this.isbottmpanel = false;
|
if (data.type == 2) {
|
this.poster_img = data.poster_img;
|
this.isCreatedImg = true;
|
}
|
},
|
|
/*APP分享*/
|
onShareAppMessage() {
|
let self = this;
|
// 构建页面参数
|
let params = self.getShareUrlParams({
|
activity_id: self.activity_id
|
});
|
return {
|
title: self.activityData.name,
|
path: '/pages/branch/activity/detail/detail?' + params
|
};
|
},
|
|
//分享按钮
|
showShare() {
|
let self = this;
|
//#ifndef APP-PLUS
|
self.isbottmpanel = true;
|
//#endif
|
//#ifdef APP-PLUS
|
self.appParams.title = self.activityData.name;
|
self.appParams.summary = self.activityData.describe;
|
// 构建页面参数
|
let params = self.getShareUrlParams({
|
activity_id: self.activity_id
|
});
|
self.appParams.path = '/pages/branch/activity/detail/detail?' + params;
|
self.appParams.image = self.activityData.image.file_path;
|
self.isAppShare = true;
|
//#endif
|
},
|
//关闭分享
|
closeAppShare(data) {
|
this.isAppShare = false;
|
},
|
//关闭生成图片
|
hidePopupFunc() {
|
this.isCreatedImg = false;
|
},
|
|
//保存海报图片
|
savePosterImg() {
|
let self = this;
|
uni.showLoading({
|
title: '加载中'
|
});
|
// 下载海报图片
|
uni.downloadFile({
|
url: self.poster_img,
|
success(res) {
|
uni.hideLoading();
|
// 图片保存到本地
|
uni.saveImageToPhotosAlbum({
|
filePath: res.tempFilePath,
|
success(data) {
|
uni.showToast({
|
title: '保存成功',
|
icon: 'success',
|
duration: 2000
|
});
|
// 关闭商品海报
|
self.isCreatedImg = false;
|
},
|
fail(err) {
|
if (err.errMsg === 'saveImageToPhotosAlbum:fail auth deny') {
|
uni.showToast({
|
title: '请允许访问相册后重试',
|
icon: 'none',
|
duration: 1000
|
});
|
setTimeout(() => {
|
uni.openSetting();
|
}, 1000);
|
}
|
},
|
complete(res) {
|
console.log('complete');
|
}
|
});
|
}
|
});
|
},
|
|
gotoSupplier() {
|
this.gotoPage('pages/shop/shop?shop_supplier_id=' + this.activityData.visit_supplier_id);
|
},
|
|
scanCode() {
|
let self = this;
|
//#ifndef H5
|
// 只允许通过相机扫码
|
uni.scanCode({
|
onlyFromCamera: true,
|
success: function(res) {
|
if (res.errMsg == 'scanCode:ok') {
|
if (res.path != 'undefined') {
|
self.gotoPage(res.path);
|
}
|
} else {
|
uni.showToast({
|
title: '扫码失败,请重试'
|
})
|
}
|
}
|
});
|
//#endif
|
},
|
|
callPhone(){
|
uni.makePhoneCall({
|
phoneNumber: this.activityData.phone + ''
|
});
|
},
|
|
/*导航*/
|
openLocation() {
|
let self = this;
|
uni.openLocation({
|
latitude: Number(this.activityData.latitude),
|
longitude: Number(this.activityData.longitude),
|
address: this.activityData.address
|
});
|
},
|
|
// 打开报名名单
|
openUser() {
|
this.isOpenUser = true;
|
},
|
|
closeUserFunc(e) {
|
this.isOpenUser = false;
|
},
|
|
},
|
onShareAppMessage() {
|
if (this.activityData) {
|
return {
|
title: `${this.activityData.name}`,
|
path: `/pages/plus/business/detail?activity_id=${this.activity_id}`
|
};
|
}
|
return {
|
title: '活动详情',
|
path: `/pages/plus/business/detail?activity_id=${this.activity_id}`
|
};
|
},
|
onShareTimeline() {
|
if (this.activityData) {
|
return {
|
title: `${this.activityData.name}`,
|
path: `/pages/plus/business/detail?activity_id=${this.activity_id}`
|
};
|
}
|
return {
|
title: '活动详情',
|
path: `/pages/plus/business/detail?activity_id=${this.activity_id}`
|
};
|
}
|
}
|
</script>
|
|
<style lang="scss" scoped>
|
.personal-data {
|
padding-bottom: 150rpx;
|
padding-bottom: calc(150rpx + constant(safe-area-inset-bottom)); ///兼容 IOS<11.2/
|
padding-bottom: calc(150rpx + env(safe-area-inset-bottom)); ///兼容 IOS>11.2/
|
min-height: 100vh;
|
}
|
|
.personal-data .activity-pic {
|
display: flex;
|
align-items: center;
|
justify-content: center;
|
|
.image {
|
width: 100%;
|
}
|
}
|
|
.personal-data .wrapper {
|
width: 710rpx;
|
margin: 0 auto;
|
position: relative;
|
top: -30rpx;
|
|
+.wrapper {
|
margin-top: 20rpx;
|
}
|
}
|
|
.form-wrapper {
|
pointer-events: none;
|
}
|
|
.personal-data .wrapper .text-info {
|
padding: 30rpx;
|
position: relative;
|
|
>view {
|
+view {
|
margin-top: 30rpx;
|
}
|
}
|
|
.activity-name {
|
justify-content: space-between;
|
|
.title {
|
width: 576rpx;
|
color: #282828;
|
font-size: 32rpx;
|
font-weight: bold;
|
}
|
}
|
|
.share {
|
text-align: center;
|
color: #666666;
|
font-size: 18rpx;
|
cursor: pointer;
|
|
.iconfont {
|
display: block;
|
color: #282828;
|
font-size: 34rpx;
|
margin: 0 0 6rpx 0;
|
}
|
}
|
|
.iconfont {
|
// margin-right: 17rpx;
|
font-size: 34rpx;
|
}
|
|
.activity-item {
|
.avatar-list {
|
.avatar-item {
|
width: 90rpx;
|
padding-right: 10rpx;
|
}
|
image {
|
width: 70rpx;
|
height: 70rpx;
|
border-radius: 70rpx;
|
}
|
|
.more {
|
padding-left: 10rpx;
|
|
.more-icon {
|
width: 70rpx;
|
height: 70rpx;
|
border-radius: 70rpx;
|
background: #f1f1f1;
|
}
|
}
|
}
|
|
.contact {
|
.iconfont {
|
font-size: 30rpx;
|
// font-weight: bold;
|
color: #333333;
|
margin-right: 0;
|
}
|
|
.text {
|
font-size: 24rpx;
|
color: #333333;
|
}
|
}
|
}
|
|
.status-image {
|
position: absolute;
|
top: 180rpx;
|
right: 30rpx;
|
|
image {
|
width: 120rpx;
|
height: 120rpx;
|
}
|
}
|
|
.status-verify {
|
position: absolute;
|
bottom: 200rpx;
|
right: 0;
|
background: linear-gradient(145deg, #f8e3a8, #e8c077);
|
border-radius: 60rpx 0 0 60rpx;
|
font-size: 28rpx;
|
padding: 6rpx 20rpx;
|
|
.iconfont {
|
margin-right: 10rpx;
|
}
|
}
|
}
|
|
.personal-data .wrapper .text-info .iconfont {
|
color: #666666;
|
}
|
|
.personal-data .wrapper .text-info .info {
|
color: #000000;
|
font-size: 26rpx;
|
padding-top: 8rpx;
|
|
&.info-theme {
|
@include font_color('font_color');
|
}
|
}
|
|
.personal-data .wrapper .text-info .acea-info {
|
max-width: 580rpx;
|
text-align: justify;
|
word-break: break-all;
|
}
|
|
.personal-data .wrapper .item .name {
|
position: relative;
|
width: 190rpx;
|
}
|
|
.personal-data .wrapper .item {
|
padding: 27rpx 30rpx;
|
font-size: 28rpx;
|
color: #282828;
|
position: relative;
|
|
&::after {
|
content: "";
|
width: 650rpx;
|
border-bottom: 1rpx solid #eee;
|
position: absolute;
|
bottom: 0;
|
}
|
|
&:last-child {
|
&::after {
|
display: none;
|
}
|
}
|
}
|
|
.personal-data .wrapper .disabled {
|
pointer-events: none;
|
}
|
|
.personal-data .wrapper .item.on {
|
padding: 16rpx 30rpx;
|
align-items: baseline;
|
}
|
|
.personal-data .wrapper .item.on3 {
|
align-items: baseline;
|
}
|
|
.personal-data .wrapper .info-title-box {
|
.info-title {
|
display: inline-block;
|
position: relative;
|
|
&::after {
|
position: absolute;
|
content: ' ';
|
background: #ccc;
|
width: 160rpx;
|
height: 1rpx;
|
right: -180rpx;
|
bottom: 20rpx;
|
}
|
|
&::before {
|
position: absolute;
|
content: ' ';
|
background: #ccc;
|
width: 160rpx;
|
height: 1rpx;
|
left: -180rpx;
|
bottom: 20rpx;
|
}
|
}
|
|
}
|
|
.personal-data .wrapper .activity-desc {
|
line-height: 50rpx;
|
font-size: 34 rpx;
|
overflow: hidden;
|
}
|
|
.detail-footer {
|
background: #ffffff;
|
width: 750rpx;
|
height: 126rpx;
|
height: calc(126rpx + constant(safe-area-inset-bottom)); ///兼容 IOS<11.2/
|
height: calc(126rpx + env(safe-area-inset-bottom)); ///兼容 IOS>11.2/
|
display: flex;
|
align-items: center;
|
justify-content: center;
|
position: fixed;
|
left: 0;
|
bottom: 0;
|
border-top: 1rpx solid #eeeeee;
|
}
|
|
.personal-data .modifyBnt {
|
font-size: 28rpx;
|
@include font_color("font_color");
|
background-color: #ffffff;
|
@include border_color("border_color");
|
border-width: 2rpx;
|
border-style: solid;
|
width: 690rpx;
|
height: 90rpx;
|
border-radius: 200rpx;
|
text-align: center;
|
line-height: 90rpx;
|
font-weight: bold;
|
|
&.disabled {
|
color: #ffffff !important;
|
background-color: #BBBBBB !important;
|
border-color: #BBBBBB !important;
|
}
|
}
|
|
.personal-data .two-col-btn .modifyBnt {
|
width: 325rpx;
|
margin: 0 20rpx;
|
}
|
|
.success-box {
|
z-index: 10;
|
position: fixed;
|
left: 0;
|
top: 0;
|
width: 100%;
|
height: 100%;
|
|
.bg {
|
position: absolute;
|
left: 0;
|
top: 0;
|
width: 100%;
|
height: 100%;
|
background-color: rgba(0, 0, 0, .5);
|
}
|
|
.con {
|
position: absolute;
|
left: 50%;
|
top: 50%;
|
transform: translate(-50%, -50%);
|
display: flex;
|
flex-direction: column;
|
align-items: center;
|
justify-content: center;
|
width: 520rpx;
|
height: 526rpx;
|
font-size: 34rpx;
|
color: #282828;
|
|
image {
|
width: 214rpx;
|
height: 180rpx;
|
}
|
|
.title {
|
color: #282828;
|
font-size: 32rpx;
|
font-weight: bold;
|
}
|
|
.text {
|
color: #999999;
|
font-size: 26rpx;
|
margin-top: 30rpx;
|
}
|
|
.foot {
|
height: 78rpx;
|
border-top: 1px solid #EAEAEA;
|
display: flex;
|
align-items: center;
|
justify-content: center;
|
width: 100%;
|
position: absolute;
|
bottom: 0;
|
left: 0;
|
|
.btn {
|
color: #999999;
|
font-size: 26rpx;
|
width: 50%;
|
text-align: center;
|
height: 78rpx;
|
display: flex;
|
align-items: center;
|
justify-content: center;
|
|
+.btn {
|
color: #E93323;
|
position: relative;
|
|
&::before {
|
content: "";
|
display: block;
|
width: 1px;
|
height: 78rpx;
|
background: #EAEAEA;
|
position: absolute;
|
left: 0;
|
top: 0;
|
}
|
}
|
}
|
}
|
}
|
}
|
|
.create-img {
|
width: 100%;
|
box-sizing: border-box;
|
|
image {
|
width: 100%;
|
}
|
|
button {
|
width: 100%;
|
height: 88rpx;
|
line-height: 88rpx;
|
border-radius: 44rpx;
|
box-shadow: 0 8rpx 16rpx 0 rgba(226, 35, 26, 0.6);
|
}
|
}
|
|
.verify-choose {
|
padding-bottom: 78rpx;
|
|
.verify-input {
|
border: 1rpx solid #ddd;
|
border-radius: 12rpx;
|
padding: 16rpx 0;
|
}
|
|
.foot {
|
height: 78rpx;
|
border-top: 1px solid #EAEAEA;
|
display: flex;
|
align-items: center;
|
justify-content: center;
|
width: 100%;
|
position: absolute;
|
bottom: 0;
|
left: 0;
|
|
.btn {
|
color: #999999;
|
font-size: 26rpx;
|
width: 50%;
|
text-align: center;
|
height: 78rpx;
|
display: flex;
|
align-items: center;
|
justify-content: center;
|
|
+.btn {
|
color: #E93323;
|
position: relative;
|
|
&::before {
|
content: "";
|
display: block;
|
width: 1px;
|
height: 78rpx;
|
background: #EAEAEA;
|
position: absolute;
|
left: 0;
|
top: 0;
|
}
|
}
|
}
|
}
|
}
|
@keyframes pulse {
|
0% {
|
transform: scale(1);
|
}
|
50% {
|
transform: scale(1.2); /* 放大到1.2倍 */
|
}
|
100% {
|
transform: scale(1);
|
}
|
}
|
.shopping-box {
|
|
image {
|
width: 180rpx;
|
height: 180rpx;
|
position: fixed;
|
bottom: 130rpx;
|
right: 20rpx;
|
animation: pulse 0.8s infinite; /* 动画名称,持续时间,无限循环 */
|
}
|
}
|
</style>
|