|
@@ -3,7 +3,7 @@
|
|
<image class="good-img" :src="info.activityCover" mode="aspectFit"></image>
|
|
<image class="good-img" :src="info.activityCover" mode="aspectFit"></image>
|
|
<view class="goods-info">
|
|
<view class="goods-info">
|
|
<view class="goods-name">
|
|
<view class="goods-name">
|
|
- {{info.activityName}}
|
|
|
|
|
|
+ {{ info.activityName }}
|
|
</view>
|
|
</view>
|
|
<view class="price-box" v-if="info.activityEnable == 1">
|
|
<view class="price-box" v-if="info.activityEnable == 1">
|
|
<view class="left">
|
|
<view class="left">
|
|
@@ -11,20 +11,20 @@
|
|
¥
|
|
¥
|
|
</view>
|
|
</view>
|
|
<view class="price">
|
|
<view class="price">
|
|
- {{info.price}}
|
|
|
|
|
|
+ {{ info.price }}
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
-
|
|
|
|
|
|
+
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
-
|
|
|
|
|
|
+
|
|
<view class="list">
|
|
<view class="list">
|
|
<view class="item">
|
|
<view class="item">
|
|
<view class="label">
|
|
<view class="label">
|
|
活动时间
|
|
活动时间
|
|
</view>
|
|
</view>
|
|
<view class="value">
|
|
<view class="value">
|
|
- {{info.activityStartTime}} 至 {{info.activityEndTime}}
|
|
|
|
|
|
+ {{ info.activityStartTime }} 至 {{ info.activityEndTime }}
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
<view class="item" v-if="info.activityEnable == 1">
|
|
<view class="item" v-if="info.activityEnable == 1">
|
|
@@ -32,7 +32,7 @@
|
|
报名时间
|
|
报名时间
|
|
</view>
|
|
</view>
|
|
<view class="value">
|
|
<view class="value">
|
|
- {{info.signupStartTime}} 至 {{info.signupEndTime}}
|
|
|
|
|
|
+ {{ info.signupStartTime }} 至 {{ info.signupEndTime }}
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
<view class="item" v-if="info.address">
|
|
<view class="item" v-if="info.address">
|
|
@@ -40,140 +40,236 @@
|
|
活动地址
|
|
活动地址
|
|
</view>
|
|
</view>
|
|
<view class="value">
|
|
<view class="value">
|
|
- {{info.address}}
|
|
|
|
|
|
+ {{ info.address }}
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
-
|
|
|
|
|
|
+
|
|
<view class="sub-title">
|
|
<view class="sub-title">
|
|
活动详情
|
|
活动详情
|
|
</view>
|
|
</view>
|
|
<view class="desc-box">
|
|
<view class="desc-box">
|
|
- <rich-text class="goods-desc" :nodes="info.activityDetail"></rich-text>
|
|
|
|
|
|
+ <rich-text @click="goImgDetials" class="goods-desc" :nodes="info.activityDetail"></rich-text>
|
|
</view>
|
|
</view>
|
|
-
|
|
|
|
-
|
|
|
|
- <view class="buy-box" v-if="info.activityEnable == 1&&!isEnd">
|
|
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ <view class="buy-box" v-if="info.activityEnable == 1 && !isEnd">
|
|
<button class="buy-btn" type="default" @click="handleSignUp">报名</button>
|
|
<button class="buy-btn" type="default" @click="handleSignUp">报名</button>
|
|
</view>
|
|
</view>
|
|
-
|
|
|
|
|
|
+
|
|
</view>
|
|
</view>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script>
|
|
<script>
|
|
- import {getActivityDetail} from '@/api/activity.js'
|
|
|
|
- export default {
|
|
|
|
- data() {
|
|
|
|
- return {
|
|
|
|
- id:0,
|
|
|
|
- info: {},
|
|
|
|
- isEnd:false
|
|
|
|
|
|
+import { getActivityDetail } from '@/api/activity.js'
|
|
|
|
+export default {
|
|
|
|
+ data() {
|
|
|
|
+ return {
|
|
|
|
+ id: 0,
|
|
|
|
+ info: {},
|
|
|
|
+ isEnd: false
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ onshareAppMessage() {
|
|
|
|
+ return {
|
|
|
|
+ title: this.info.activityName,
|
|
|
|
+ path: `/signUp/index?scene=${this.id}`
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ methods: {
|
|
|
|
+ extractImageSrcFromHtml(htmlString) {
|
|
|
|
+ // 正则表达式用于匹配 <img> 标签的 src 属性
|
|
|
|
+ const regex = /<img[^>]+src="([^"]+)"[^>]*>/gi;
|
|
|
|
+ let match;
|
|
|
|
+ const result = [];
|
|
|
|
+
|
|
|
|
+ // 执行正则表达式匹配,并收集所有匹配到的 src 属性
|
|
|
|
+ while ((match = regex.exec(htmlString)) !== null) {
|
|
|
|
+ result.push(match[1]); // match[1] 是正则表达式中的第一个捕获组,即 src 属性的值
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ return result;
|
|
},
|
|
},
|
|
- methods: {
|
|
|
|
- handleSignUp(){
|
|
|
|
- let that = this
|
|
|
|
- let {activityStartTime,activityEndTime,limited,activityName,id,price,shopId} = this.info
|
|
|
|
- let obj = {
|
|
|
|
- activityStartTime,
|
|
|
|
- activityEndTime,
|
|
|
|
- limited,
|
|
|
|
- activityName,
|
|
|
|
- id,
|
|
|
|
- price,
|
|
|
|
- shopId
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- if (uni.getStorageSync('token')) {
|
|
|
|
- uni.setStorageSync('activity',JSON.stringify(obj) )
|
|
|
|
- uni.navigateTo({
|
|
|
|
- url:'/signUp/makeOut?id='+this.info.dataCollectId
|
|
|
|
- })
|
|
|
|
-
|
|
|
|
- } else {
|
|
|
|
- uni.showModal({
|
|
|
|
- title:'请登录',
|
|
|
|
- confirmText:'去登录',
|
|
|
|
- success(res){
|
|
|
|
- console.log(res);
|
|
|
|
- if(res.confirm){
|
|
|
|
- uni.navigateTo({
|
|
|
|
- url:`/login/login/login?redirect=/signUp/index&scene=${that.id}`
|
|
|
|
|
|
+ goImgDetials(e) {
|
|
|
|
+ // console.log('e', e);
|
|
|
|
+ // console.log(this.info.activityDetail)
|
|
|
|
+ const imgArr = this.extractImageSrcFromHtml(this.info.activityDetail)
|
|
|
|
+ // console.log('imgArr', imgArr);
|
|
|
|
+ // let item = e.detail.node;
|
|
|
|
+ // if (item.name == "img") {
|
|
|
|
+ uni.previewImage({
|
|
|
|
+ urls: imgArr,
|
|
|
|
+ longPressActions: {
|
|
|
|
+ itemList: ["保存到相册", "识别二维码"],
|
|
|
|
+ itemColor: "#007AFF",
|
|
|
|
+ success: function (data) {
|
|
|
|
+ let {
|
|
|
|
+ tapIndex,
|
|
|
|
+ index
|
|
|
|
+ } = data;
|
|
|
|
+ // tapIndex 第几个按钮
|
|
|
|
+ // index 第几张图片
|
|
|
|
+ //#ifdef APP-PLUS
|
|
|
|
+ if (tapIndex == 0) {
|
|
|
|
+ // 保存到相册
|
|
|
|
+ plus.gallery.save(imgArr[index], () => {
|
|
|
|
+ uni.showToast({
|
|
|
|
+ icon: "none",
|
|
|
|
+ title: "保存成功!"
|
|
|
|
+ })
|
|
|
|
+ }, () => {
|
|
|
|
+ uni.showToast({
|
|
|
|
+ icon: "none",
|
|
|
|
+ title: "保存失败!"
|
|
})
|
|
})
|
|
- }
|
|
|
|
|
|
+ })
|
|
|
|
+
|
|
|
|
+ } else {
|
|
|
|
+ // 现将文件下载到本地
|
|
|
|
+ uni.downloadFile({
|
|
|
|
+ url: imgArr[index],
|
|
|
|
+ success: (args) => {
|
|
|
|
+ // 扫描二维码
|
|
|
|
+ plus.barcode.scan(
|
|
|
|
+ args.tempFilePath,
|
|
|
|
+ (code, url) => {
|
|
|
|
+ // 如果识别成功
|
|
|
|
+ if (code == 0) {
|
|
|
|
+ // 打开扫描结果
|
|
|
|
+ plus.runtime.openURL(url)
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ (err) => {
|
|
|
|
+ uni.showToast({
|
|
|
|
+ icon: 'none',
|
|
|
|
+ title: "图中没有可识别的二维码"
|
|
|
|
+ })
|
|
|
|
+ console.log(err, 'err');
|
|
|
|
+ },
|
|
|
|
+ [plus.barcode.QR],
|
|
|
|
+ true)
|
|
|
|
+ },
|
|
|
|
+ fail: () => {
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+ })
|
|
}
|
|
}
|
|
- })
|
|
|
|
|
|
+ //#endif
|
|
|
|
+ }
|
|
}
|
|
}
|
|
- },
|
|
|
|
- getActivityDetail(id){
|
|
|
|
- getActivityDetail({id}).then(res=>{
|
|
|
|
- if (res.state == 'Success') {
|
|
|
|
- this.info = res.content
|
|
|
|
- this.info.activityDetail = res.content.activityDetail.replace(/<img/gi, '<img class="img_class" ')
|
|
|
|
- uni.setNavigationBarTitle({
|
|
|
|
- title:this.info.activityName
|
|
|
|
- })
|
|
|
|
- if(new Date(this.info.activityEndTime).getTime()< new Date().getTime() ){//活动结束
|
|
|
|
- this.isEnd = true
|
|
|
|
|
|
+ })
|
|
|
|
+ // }
|
|
|
|
+ },
|
|
|
|
+ handleSignUp() {
|
|
|
|
+ let that = this
|
|
|
|
+ let { activityStartTime, activityEndTime, limited, activityName, id, price, shopId } = this.info
|
|
|
|
+ let obj = {
|
|
|
|
+ activityStartTime,
|
|
|
|
+ activityEndTime,
|
|
|
|
+ limited,
|
|
|
|
+ activityName,
|
|
|
|
+ id,
|
|
|
|
+ price,
|
|
|
|
+ shopId
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if (uni.getStorageSync('token')) {
|
|
|
|
+ uni.setStorageSync('activity', JSON.stringify(obj))
|
|
|
|
+ uni.navigateTo({
|
|
|
|
+ url: '/signUp/makeOut?id=' + this.info.dataCollectId
|
|
|
|
+ })
|
|
|
|
+
|
|
|
|
+ } else {
|
|
|
|
+ uni.showModal({
|
|
|
|
+ title: '请登录',
|
|
|
|
+ confirmText: '去登录',
|
|
|
|
+ success(res) {
|
|
|
|
+ console.log(res);
|
|
|
|
+ if (res.confirm) {
|
|
|
|
+ uni.navigateTo({
|
|
|
|
+ url: `/login/login/login?redirect=/signUp/index&scene=${that.id}`
|
|
|
|
+ })
|
|
}
|
|
}
|
|
}
|
|
}
|
|
})
|
|
})
|
|
}
|
|
}
|
|
},
|
|
},
|
|
- onLoad(options) {
|
|
|
|
- console.log('options',options);
|
|
|
|
- this.id = decodeURIComponent(options.scene)
|
|
|
|
- this.getActivityDetail(this.id)
|
|
|
|
|
|
+ getActivityDetail(id) {
|
|
|
|
+ getActivityDetail({ id }).then(res => {
|
|
|
|
+ if (res.state == 'Success') {
|
|
|
|
+ this.info = res.content
|
|
|
|
+ this.info.activityDetail = res.content.activityDetail.replace(/<img/gi, '<img class="img_class" ')
|
|
|
|
+ uni.setNavigationBarTitle({
|
|
|
|
+ title: this.info.activityName
|
|
|
|
+ })
|
|
|
|
+ if (new Date(this.info.activityEndTime).getTime() < new Date().getTime()) {//活动结束
|
|
|
|
+ this.isEnd = true
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ })
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+ },
|
|
|
|
+ onLoad(options) {
|
|
|
|
+ console.log('options', options);
|
|
|
|
+ this.id = decodeURIComponent(options.scene)
|
|
|
|
+ this.getActivityDetail(this.id)
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+}
|
|
</script>
|
|
</script>
|
|
|
|
|
|
-<style lang="scss" >
|
|
|
|
-.signUp{
|
|
|
|
|
|
+<style lang="scss">
|
|
|
|
+.signUp {
|
|
background: #F9F9F9;
|
|
background: #F9F9F9;
|
|
padding-bottom: 200rpx;
|
|
padding-bottom: 200rpx;
|
|
min-height: 100vh;
|
|
min-height: 100vh;
|
|
- .good-img{
|
|
|
|
|
|
+
|
|
|
|
+ .good-img {
|
|
width: 100%;
|
|
width: 100%;
|
|
height: 750rpx;
|
|
height: 750rpx;
|
|
vertical-align: bottom;
|
|
vertical-align: bottom;
|
|
}
|
|
}
|
|
- .goods-info{
|
|
|
|
|
|
+
|
|
|
|
+ .goods-info {
|
|
padding: 24rpx;
|
|
padding: 24rpx;
|
|
margin-bottom: 20rpx;
|
|
margin-bottom: 20rpx;
|
|
background: #fff;
|
|
background: #fff;
|
|
- .price-box{
|
|
|
|
|
|
+
|
|
|
|
+ .price-box {
|
|
display: flex;
|
|
display: flex;
|
|
justify-content: space-between;
|
|
justify-content: space-between;
|
|
align-items: center;
|
|
align-items: center;
|
|
margin-top: 20rpx;
|
|
margin-top: 20rpx;
|
|
- .left{
|
|
|
|
|
|
+
|
|
|
|
+ .left {
|
|
display: flex;
|
|
display: flex;
|
|
align-items: flex-end;
|
|
align-items: flex-end;
|
|
- .unit{
|
|
|
|
|
|
+
|
|
|
|
+ .unit {
|
|
font-size: 20rpx;
|
|
font-size: 20rpx;
|
|
color: $uni-color-primary;
|
|
color: $uni-color-primary;
|
|
font-weight: bold;
|
|
font-weight: bold;
|
|
}
|
|
}
|
|
- .price{
|
|
|
|
|
|
+
|
|
|
|
+ .price {
|
|
font-size: 36rpx;
|
|
font-size: 36rpx;
|
|
color: $uni-color-primary;
|
|
color: $uni-color-primary;
|
|
font-weight: bold;
|
|
font-weight: bold;
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+
|
|
}
|
|
}
|
|
- .goods-name{
|
|
|
|
|
|
+
|
|
|
|
+ .goods-name {
|
|
font-size: 32rpx;
|
|
font-size: 32rpx;
|
|
color: #222222;
|
|
color: #222222;
|
|
font-weight: bold;
|
|
font-weight: bold;
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+
|
|
}
|
|
}
|
|
-
|
|
|
|
- .sub-title{
|
|
|
|
|
|
+
|
|
|
|
+ .sub-title {
|
|
font-weight: 600;
|
|
font-weight: 600;
|
|
font-size: 28rpx;
|
|
font-size: 28rpx;
|
|
color: #222222;
|
|
color: #222222;
|
|
@@ -181,29 +277,34 @@
|
|
border-radius: 16rpx 16rpx 0 0;
|
|
border-radius: 16rpx 16rpx 0 0;
|
|
background: #fff;
|
|
background: #fff;
|
|
}
|
|
}
|
|
- .desc-box{
|
|
|
|
- .goods-desc{
|
|
|
|
|
|
+
|
|
|
|
+ .desc-box {
|
|
|
|
+ .goods-desc {
|
|
color: #222222;
|
|
color: #222222;
|
|
font-size: 24rpx;
|
|
font-size: 24rpx;
|
|
- .img_class{
|
|
|
|
- max-width: 100%!important;
|
|
|
|
|
|
+
|
|
|
|
+ .img_class {
|
|
|
|
+ max-width: 100% !important;
|
|
vertical-align: bottom;
|
|
vertical-align: bottom;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
-
|
|
|
|
- .list{
|
|
|
|
|
|
+
|
|
|
|
+ .list {
|
|
background: #fff;
|
|
background: #fff;
|
|
margin-bottom: 20rpx;
|
|
margin-bottom: 20rpx;
|
|
- .item{
|
|
|
|
|
|
+
|
|
|
|
+ .item {
|
|
padding: 24rpx;
|
|
padding: 24rpx;
|
|
- border-top:1rpx solid #F0F0F0;
|
|
|
|
- .label{
|
|
|
|
|
|
+ border-top: 1rpx solid #F0F0F0;
|
|
|
|
+
|
|
|
|
+ .label {
|
|
font-weight: 600;
|
|
font-weight: 600;
|
|
font-size: 28rpx;
|
|
font-size: 28rpx;
|
|
color: #222222;
|
|
color: #222222;
|
|
}
|
|
}
|
|
- .value{
|
|
|
|
|
|
+
|
|
|
|
+ .value {
|
|
font-weight: 300;
|
|
font-weight: 300;
|
|
font-size: 24rpx;
|
|
font-size: 24rpx;
|
|
color: #AAAAAA;
|
|
color: #AAAAAA;
|
|
@@ -212,8 +313,8 @@
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
-
|
|
|
|
- .buy-box{
|
|
|
|
|
|
+
|
|
|
|
+ .buy-box {
|
|
position: fixed;
|
|
position: fixed;
|
|
bottom: 0%;
|
|
bottom: 0%;
|
|
left: 0%;
|
|
left: 0%;
|
|
@@ -222,7 +323,8 @@
|
|
padding: 10rpx 24rpx env(safe-area-inset-bottom);
|
|
padding: 10rpx 24rpx env(safe-area-inset-bottom);
|
|
border-top: 1rpx solid #EEEEEE;
|
|
border-top: 1rpx solid #EEEEEE;
|
|
box-sizing: border-box;
|
|
box-sizing: border-box;
|
|
- .buy-btn{
|
|
|
|
|
|
+
|
|
|
|
+ .buy-btn {
|
|
width: 702rpx;
|
|
width: 702rpx;
|
|
height: 80rpx;
|
|
height: 80rpx;
|
|
line-height: 80rpx;
|
|
line-height: 80rpx;
|
|
@@ -233,9 +335,9 @@
|
|
font-size: 28rpx;
|
|
font-size: 28rpx;
|
|
color: #FFFFFF;
|
|
color: #FFFFFF;
|
|
}
|
|
}
|
|
-
|
|
|
|
-
|
|
|
|
|
|
+
|
|
|
|
+
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+
|
|
}
|
|
}
|
|
</style>
|
|
</style>
|