|
@@ -39,11 +39,25 @@
|
|
<view class="button" @click="createCouponRecord">¥{{ coupon.moneyCouponPrice }}购买</view>
|
|
<view class="button" @click="createCouponRecord">¥{{ coupon.moneyCouponPrice }}购买</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
|
|
+ <!-- 弹窗提示 -->
|
|
|
|
+ <tui-modal
|
|
|
|
+ :show="modal"
|
|
|
|
+ @click="handleClick"
|
|
|
|
+ @cancel="hideMobel"
|
|
|
|
+ :content="contentModalText"
|
|
|
|
+ :button="modalButton"
|
|
|
|
+ color="#333"
|
|
|
|
+ :size="32"
|
|
|
|
+ shape="circle"
|
|
|
|
+ :maskClosable="false"
|
|
|
|
+ >
|
|
|
|
+ </tui-modal>
|
|
</view>
|
|
</view>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script>
|
|
<script>
|
|
import { mapState, mapMutations } from 'vuex'
|
|
import { mapState, mapMutations } from 'vuex'
|
|
|
|
+import wxLogin from '@/common/config/wxLogin.js'
|
|
import authorize from '@/common/config/authorize.js'
|
|
import authorize from '@/common/config/authorize.js'
|
|
export default {
|
|
export default {
|
|
data() {
|
|
data() {
|
|
@@ -55,10 +69,28 @@ export default {
|
|
userId: 0, // 机构Id
|
|
userId: 0, // 机构Id
|
|
couponId: 0, //优惠券Id
|
|
couponId: 0, //优惠券Id
|
|
payAmount: 100 ,//支付金额
|
|
payAmount: 100 ,//支付金额
|
|
- skeletonShow:true
|
|
|
|
|
|
+ skeletonShow:true,
|
|
|
|
+ contentModalText: '', //操作文字提示语句
|
|
|
|
+ modal: false,
|
|
|
|
+ modalButton: [
|
|
|
|
+ {
|
|
|
|
+ text: '取消',
|
|
|
|
+ type: 'gray',
|
|
|
|
+ plain: true //是否空心
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ text: '去升级',
|
|
|
|
+ customStyle: {
|
|
|
|
+ color: '#fff',
|
|
|
|
+ bgColor: 'linear-gradient(90deg, #F28F31 0%, #E15616 100%)'
|
|
|
|
+ },
|
|
|
|
+ plain: false
|
|
|
|
+ }
|
|
|
|
+ ],
|
|
}
|
|
}
|
|
},
|
|
},
|
|
onLoad(option) {
|
|
onLoad(option) {
|
|
|
|
+ wxLogin.wxLoginAuthorize()
|
|
this.userId = option.userId
|
|
this.userId = option.userId
|
|
this.couponId = option.couponId
|
|
this.couponId = option.couponId
|
|
console.log('机构userId', this.userId)
|
|
console.log('机构userId', this.userId)
|
|
@@ -111,7 +143,13 @@ export default {
|
|
this.MiniWxPayFor(response.data.couponRecordId)
|
|
this.MiniWxPayFor(response.data.couponRecordId)
|
|
})
|
|
})
|
|
.catch(error => {
|
|
.catch(error => {
|
|
- console.log(error)
|
|
|
|
|
|
+ if(error.code == -1){//个人机构不能购买
|
|
|
|
+ this.contentModalText ='该优惠券仅限医美机构购买,请升级为医美机构后再次购买。'
|
|
|
|
+ this.modal = true
|
|
|
|
+
|
|
|
|
+ }else if(error.code == -2){//会员机构不是医美机构不能购买
|
|
|
|
+ this.$util.msg('该优惠券仅限医美机构购买', 2000)
|
|
|
|
+ }
|
|
})
|
|
})
|
|
},
|
|
},
|
|
async MiniWxPayFor(couponRecordId) {
|
|
async MiniWxPayFor(couponRecordId) {
|
|
@@ -158,6 +196,16 @@ export default {
|
|
complete: function(res) {}
|
|
complete: function(res) {}
|
|
})
|
|
})
|
|
},
|
|
},
|
|
|
|
+ hideMobel(){
|
|
|
|
+ this.modal = false
|
|
|
|
+ },
|
|
|
|
+ handleClick(e){
|
|
|
|
+ //个人机构跳转升级页面
|
|
|
|
+ if (e.index == 1) {
|
|
|
|
+ this.$api.navigateTo('/pages/login/apply')
|
|
|
|
+ }
|
|
|
|
+ this.modal = false
|
|
|
|
+ },
|
|
navigator(url) {
|
|
navigator(url) {
|
|
this.$api.navigateTo(url)
|
|
this.$api.navigateTo(url)
|
|
}
|
|
}
|