| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512 |
- <template>
- <view class="flex-col page">
- <view class="flex-col content">
- <view class="out1">
- <view class="flex-col top">
- <view class="flex-row title">
- <text>{{ activity.title }}</text>
- </view>
- <view class="flex-row price">
- <text v-if="isShare">¥{{ activity.sharePrice }}</text>
- <text
- :style="{textDecorationLine:(isShare ?'line-through' :'none'),color:(isShare ? '#878787':''), fontSize:(isShare ? '24rpx':'') }">
- ¥{{ activity.salePrice }}
- </text>
- </view>
- <view class="flex-row">
- <view class="activityKey ">
- <text>活动时间:</text>
- </view>
- <view>
- <text v-if="activity.valid == 2">{{ activity.validBeginTime.substring(0, 10) }} 至
- {{ activity.validEndTime.substring(0, 10) }}
- </text>
- <text v-else>长期有效</text>
- </view>
- </view>
- <view class="flex-row">
- <view class="activityKey">
- <text>活动门店:</text>
- </view>
- <view class="activityValue">
- <text>{{ activity.partStoreName }}</text>
- </view>
- </view>
- <view class="flex-row">
- <view class="activityKey ">
- <text>活动描述:</text>
- </view>
- <view class="activityValue">
- <text>{{ activity.description }}</text>
- </view>
- </view>
- </view>
- </view>
- <view class="out2" v-if="activity.couponList">
- <view class="flex-col ticket">
- <view class="flex-row justify-center title">
- <text>赠送优惠券</text>
- </view>
- <view v-for="(item,index) in activity.couponList">
- <view class="flex-row ticketList">
- <view class="row-list flex-row justify-start">
- <view class="h-text flex-col justify-center ">
- <view class="money">
- <text class="money" v-if="item.discountsType == 2">{{ item.discount }}折</text>
- <text class="money" v-else>{{ `减` + item.discountsPrice }}</text>
- </view>
- <view class="desc">
- <text>满{{ item.reachPrice }}可用</text>
- </view>
- </view>
- <view class="h-center-content flex-col justify-around">
- <view class="h-value">
- <text>{{ item.name }}</text>
- </view>
- <view class="itemTitle">
- 使用次数:{{ item.degree }}
- </view>
- <view class="itemTitle">
- <text v-if="item.validType == 1">领取后{{ item.effectiveDays }}天内有效</text>
- <view v-else>
- <view>使用期限:{{ item.startTime.substring(0, 10) }}</view>
- <view> 至 {{ item.endTime.substring(0, 10) }}</view>
- </view>
- </view>
- <view class="itemTitle flex-row">
- <text @click.stop="showRemark(item)">使用规则</text>
- <u-icon v-if="item.id == showRemarkId" name="arrow-down-fill" color="" size="12"></u-icon>
- <u-icon v-else name="play-right-fill" color="" size="12"></u-icon>
- </view>
- </view>
- </view>
- </view>
- <view v-if="showRemarkId == item.id" class="remark" style="text-indent:unset">
- <view>
- 可用门店:
- <text>{{ item.useStoreDesc }}</text>
- </view>
- <view>
- 适用项目:
- <text>{{ item.useServiceDesc }}</text>
- </view>
- <view v-if="item.remark !=null">
- 使用说明:
- <text>{{ item.remark }}</text>
- </view>
- <text v-else class="remarkText">该优惠券暂无使用说明</text>
- </view>
- </view>
- </view>
- </view>
- <view class="out2" v-if="activity.equityList">
- <view class="flex-col ticket">
- <view class="flex-row justify-center title">
- <text>赠送权益卡</text>
- </view>
- <view v-for="(i,index) in activity.equityList">
- <view class="flex-row ticketList">
- <view class="h-text flex-col justify-center ">
- <text class="money">{{ i.faceValue }}</text>
- <text class="desc">权益价</text>
- </view>
- <view class="h-center-content flex-col justify-around">
- <view class="h-value">
- <text>{{ i.title }}</text>
- </view>
- <view class="ticketMsg">
- 领取后{{ i.effectiveDays }}天内有效
- </view>
- <view class="itemTitle flex-row">
- <text @click.stop="showRemark(i)">使用规则</text>
- <u-icon v-if="i.id == showRemarkId" name="arrow-down-fill" color="" size="12"></u-icon>
- <u-icon v-else name="play-right-fill" color="" size="12"></u-icon>
- </view>
- </view>
- </view>
- <view v-if="showRemarkId == i.id" class="remark" style="text-indent:unset">
- <view>
- 可用门店:
- <text>{{ i.useStoreDesc }}</text>
- </view>
- <view v-if="i.description !=null">
- 使用说明:
- <text>{{ i.description }}</text>
- </view>
- <text v-else class="remarkText">该权益卡暂无使用说明</text>
- </view>
- </view>
- </view>
- </view>
- <view class="out2" v-if="activity.rechargeList">
- <view class="flex-col ticket">
- <view class="flex-row justify-center title">
- <text>赠送储值卡</text>
- </view>
- <view class="flex-row ticketList" v-for="(i,index) in activity.rechargeList">
- <view class="h-text flex-col justify-center ">
- <text class="money">{{ i.reachPrice }}</text>
- <text class="desc">储值额度</text>
- </view>
- <view class="h-center-content flex-col justify-around">
- <view class="h-value">
- <text>{{ i.name }}</text>
- </view>
- </view>
- </view>
- </view>
- </view>
- </view>
- <view v-if="!isShareMax" class="flex-row justify-center inBtnView">
- <view class="inBtn" @click="beforeCommitOrder" v-if="!isActivityCheck">立即参与</view>
- <view class="inBtn" v-else>已参与</view>
- </view>
- <myPay ref="myPay" :selectBlPay="userInfo.balance *1 >= totalAmount *1" :balance="userInfo.balance"
- :totalAmount="totalAmount" :lovePay="false" :blPay="false"
- :orderNo="subOrderNo" @payResult="payResult" @improperClose="improperClose"></myPay>
- <!-- <view>-->
- <!-- <u-picker :show="show" title="选择服务对象" :closeOnClickOverlay="true" @close="show = false"-->
- <!-- :columns="serviceObjectList"-->
- <!-- keyName="nickName" @cancel="show = false" @confirm="confirm"></u-picker>-->
- <!-- </view>-->
- <uni-popup ref="popup" type="bottom">
- <view class="addService">
- <view class="popupTitle">
- <text>切换服务对象</text>
- </view>
- <scroll-view class="scrollY" scroll-y>
- <view class="flex-row objectItem" :class="{'vBackGround': selectServiceObjectIndex === index}"
- v-for="(item,index) in serviceObjectList" :key="index"
- @click="selectServiceObjectIndex = index">
- <image class="objectImage" :src="item.facePhotoUrl || '/static/ud4.png'"></image>
- <view class="flex-col objectName ">
- <text>{{ item.nickName }}</text>
- </view>
- <image v-if="selectServiceObjectIndex === index" class="vImage"
- src="/static/index/xuanzhong.png"></image>
- </view>
- </scroll-view>
- <view class="flex-row justify-around">
- <view class="cancelButton" @click="closeSelectServiceObjectPopup">
- <text>取消</text>
- </view>
- <view class="confirmButton" @click="confirm(serviceObjectList[selectServiceObjectIndex].id)">
- <text>确定</text>
- </view>
- </view>
- </view>
- </uni-popup>
- </view>
- </template>
- <script>
- import myPay from '../../components/pay/pay';
- export default {
- components: {
- myPay
- },
- data() {
- return {
- selectServiceObjectIndex:-1,
- showRemarkId: '',
- userInfo: {},
- subOrderNo: '',
- id: '',
- storeId: '',
- userId: '',
- techNo: '',
- activity: {},
- requestStatus: false,
- isActivityCheck: true, //是否参与过该活动
- serviceObjectList: [],
- show: false,
- serviceObjectId: null,
- isShare: false,
- inviteUserId: null,
- inviteOrderId: null,
- isShareMax: false,
- }
- },
- computed: {
- totalAmount() {
- if (this.isShare) {
- return this.activity.sharePrice
- } else {
- return this.activity.salePrice
- }
- }
- },
- onLoad(e) {
- console.log(e)
- if (e.id) {
- this.id = e.id
- console.log('上一个页面传递过来的活动ID===>', this.id)
- }
- if (e.inviteUserId) {
- console.log(e)
- this.id = e.activityId
- this.inviteUserId = e.inviteUserId
- this.inviteOrderId = e.inviteOrderId
- this.isShare = true
- }
- // 扫技师端携带的参数,已存在缓存中
- let promotionParam = uni.getStorageSync('promotionParam')
- if (promotionParam) {
- console.log('获取到技师的二维码数据', promotionParam)
- this.storeId = promotionParam.storeId
- this.techNo = promotionParam.techNo
- } else {
- let storeParam = uni.getStorageSync('storeParam')
- // console.log('获取到门店的二维码数据',param)
- this.storeId = storeParam.storeId
- }
- if (e.q) {
- //扫店长端二维码进来的活动参数
- const q = decodeURIComponent(e.q)
- let a = q.split('?')
- let b = a[1].split('&')
- let param = {} //技师端分享过来的参数
- for (let i = 0; i < b.length; i++) {
- param[b[i].split('=')[0]] = b[i].split('=')[1]
- }
- this.id = param.activityId
- this.storeId = param.storeId
- this.techNo = ''
- console.log("扫店长端二维码进来的活动参数===》", param)
- uni.setStorageSync('storeParam', param)
- uni.removeStorageSync('promotionParam');
- }
- this.userInfo = uni.getStorageSync('userInfo')
- this.activityDetail()
- this.activityCheck()
- },
- onShow() {
- this.userInfo = uni.getStorageSync('userInfo')
- this.listServiceObject()
- },
- methods: {
- showRemark(item) {
- if (this.showRemarkId == item.id) {
- this.showRemarkId = ''
- } else {
- this.showRemarkId = item.id
- }
- },
- getImgUrlByBannerOssId(items) {
- for (let i = 0; i < items.length; i++) {
- if (items[i].facePhoto) {
- this.$api.getImgUrlByOssId({ossId: items[i].facePhoto}).then(res => {
- items[i].facePhotoUrl = res.data.data[0].url.replace(/^http:/, "https:")
- this.$set(this.serviceObjectList, i, items[i])
- })
- }
- }
- },
- // 查询服务对像信息列表
- listServiceObject() {
- let serviceObjectList = []
- this.$api.listServiceObject(this.reqParm).then((res) => {
- res.data.data.forEach(i => {
- if (i.isSelf != 1) {
- serviceObjectList.push(i)
- }
- })
- // this.serviceObjectList[0] = serviceObjectList
- this.$set(this.serviceObjectList, 0, serviceObjectList)
- this.getImgUrlByBannerOssId(this.serviceObjectList[0]);
- console.log('执行了+++++++++++++++++++', this.serviceObjectList)
- // if (this.isShare) {
- if (serviceObjectList.length === 0) {
- uni.showToast({
- duration: 2500,
- title: '当前账号没有服务对象,即将跳转服务对象绑定',
- icon: 'none',
- });
- setTimeout(() => {
- uni.hideToast();
- //关闭提示后跳转
- uni.navigateTo({
- url: '/myPages/serviceObjectFaceAuth/index'
- })
- }, 1500)
- }
- // }
- })
- },
- closeSelectServiceObjectPopup(){
- this.selectServiceObjectIndex = -1
- this.$refs.popup.close()
- },
- //支付结果回调
- payResult(e) {
- console.log(e)
- if (e.payResult) {
- uni.showToast({
- duration: 2000,
- title: '支付成功!'
- });
- this.isActivityCheck = true
- setTimeout(() => {
- uni.navigateTo({
- url: '/myPages/myActivity/myActivity'
- })
- }, 2000)
- } else {
- uni.showToast({
- duration: 2000,
- title: '支付失败!',
- icon: 'error'
- });
- }
- },
- //支付弹窗关闭回调
- improperClose() {
- },
- beforeCommitOrder() {
- if (!this.userInfo.phone) {
- uni.showModal({
- title: '温馨提示',
- content: '请先绑定手机号',
- success: res => {
- if (res.confirm) {
- uni.navigateTo({
- url: '/myPages/setting/setting-telphone',
- })
- }
- }
- })
- return
- }
- if (this.activity.isAddServiceObject == 1) {
- // this.show = true
- this.$refs.popup.open()
- } else {
- this.commitOrder()
- }
- },
- confirm(e) {
- // console.log(e)
- // this.serviceObjectId = e.value[0].id
- console.log(e)
- this.serviceObjectId = e
- // this.show = false
- this.$refs.popup.close()
- this.commitOrder()
- },
- //提交订单
- commitOrder() {
- // if (this.subOrderNo){
- // this.$refs.myPay.openPopup()
- // }else {
- if (this.requestStatus) {
- return;
- }
- this.requestStatus = true
- uni.showLoading({
- title: '加载中'
- });
- this.$api.commonGeneralOrder({
- orderType: 7,
- serviceObjectId: this.serviceObjectId,
- activityId: this.activity.id,
- storeId: this.storeId,
- inviteUserId: this.inviteUserId,
- inviteOrderId: this.inviteOrderId,
- techNo: this.techNo
- }).then(res => {
- console.log('++++++++++++++++++订单提交+++++++++++', res)
- uni.hideLoading();
- this.subOrderNo = res.data.data.orderNo
- if (this.activity.salePrice * 1 > 0) {
- this.$refs.myPay.openPopup()
- } else {
- uni.showToast({
- duration: 2000,
- title: '活动参与成功!'
- });
- this.isActivityCheck = true
- }
- this.requestStatus = false
- }).catch(err => {
- this.requestStatus = false
- })
- // }
- },
- activityDetail() {
- console.log(this.id, '活动ID')
- const data = {
- id: this.id,
- }
- if (this.inviteUserId) {
- data.userId = this.inviteUserId
- }
- if (this.inviteOrderId) {
- data.inviteOrderId = this.inviteOrderId
- }
- this.$api.activityDetail(data).then(res => {
- console.log(res)
- this.activity = res.data.data
- this.$set(this.activity)
- if (this.isShare) {
- console.log(this.activity)
- if (this.activity.shareMax > 0 && this.activity.shareMax <= this.activity.shareCount) {
- uni.showToast({
- duration: 3000,
- title: '当前链接已经超出最大分享次数',
- icon: 'none'
- });
- this.isShareMax = true
- }
- }
- })
- },
- activityCheck() {
- this.$api.activityCheck({activityId: this.id,}).then(res => {
- console.log(res)
- this.isActivityCheck = res.data.data
- })
- }
- }
- }
- </script>
- <style lang="scss" scoped>
- @import '/common/css/common.css';
- @import './index.rpx.scss';
- </style>
|