parent
85075e3f7c
commit
9635927ca4
@ -1,378 +1,333 @@ |
|||||||
<template> |
<template> |
||||||
<view> |
<view> |
||||||
<view class="width90"> |
<view class="width90"> |
||||||
<view class="flright fotct"> |
<view class="flright fotct"> |
||||||
<image class="coupon-img" :src="imageUrl+couponsDetails.highDiscount.discountImg"></image> |
<image class="coupon-img" :src="imageUrl+couponsDetails.highDiscount.discountImg"></image> |
||||||
</view> |
</view> |
||||||
<view class="coupon-mes mart10" style="margin-right: 90px;"> |
<view class="coupon-mes mart10" style="margin-right: 90px;"> |
||||||
<view class="fcor333 fontwig6 font24 width100 text2">{{couponsDetails.highDiscount.discountName}}</view> |
<view class="fcor333 fontwig6 font24 width100 text2">{{couponsDetails.highDiscount.discountName}}</view> |
||||||
<view class="fcor666 font13 width100 mart5"> |
<view class="fcor666 font13 width100 mart5"> |
||||||
活动截止时间:{{salesEndTime | formatDate('-')}}</view> |
活动截止时间:{{salesEndTime | formatDate('-')}}</view> |
||||||
</view> |
</view> |
||||||
<view class="fcor666 font13 width100 mart5"> |
<view class="fcor666 font13 width100 mart5"> |
||||||
领取有效期:{{couponsDetails.highDiscount.effectiveDay}}天 |
领取有效期:{{couponsDetails.highDiscount.effectiveDay}}天 |
||||||
</view> |
</view> |
||||||
</view> |
</view> |
||||||
<view class="line1 mart15"></view> |
<view class="line1 mart15"></view> |
||||||
<button class="coupne-btn width60w mart20 marb20" v-if="userInfo == 1" lang="zh_CN" open-type="getPhoneNumber" @getphonenumber="loginByPhone" |
<button class="coupne-btn width60w mart20 marb20" v-if="userInfo == 1" lang="zh_CN" |
||||||
withCredentials="true">点击领取</button> |
@click="jumpres">点击领取</button> |
||||||
<button class="coupne-btn width60w mart20 marb20" v-else @click="receiveDiscount">点击领取</button> |
<button class="coupne-btn width60w mart20 marb20" v-else @click="receiveDiscount">点击领取</button> |
||||||
<view class="width90 mart10 fcor666">去使用</view> |
<view class="width90 mart10 fcor666">去使用</view> |
||||||
<view v-if="minecoupones == '' " class="mart60 fotct font14 fcor666"> |
<view v-if="minecoupones == '' " class="mart60 fotct font14 fcor666"> |
||||||
<image mode="widthFix" style="width: 70vw;" :src="imagewxUrl+imgadres"></image> |
<image mode="widthFix" style="width: 70vw;" :src="imagewxUrl+imgadres"></image> |
||||||
</view> |
</view> |
||||||
<view class="product-list mart20 width90"> |
<view class="product-list mart20 width90"> |
||||||
<view class="product" v-for="product in minecoupones" :key="product.id" |
<view class="product" v-for="product in minecoupones" :key="product.id" |
||||||
@tap="toGoods(product.highCoupon.id)"> |
@tap="toGoods(product.highCoupon.id)"> |
||||||
<image mode="widthFix" :src="imageUrl+product.highCoupon.couponImg"></image> |
<image mode="widthFix" :src="imageUrl+product.highCoupon.couponImg"></image> |
||||||
<view class="name">{{ product.highCoupon.couponName }}</view> |
<view class="name">{{ product.highCoupon.couponName }}</view> |
||||||
<view class="info" v-if="product.highCoupon.payType == 1"> |
<view class="info" v-if="product.highCoupon.payType == 1"> |
||||||
<view class="price"> |
<view class="price"> |
||||||
¥{{ product.highCoupon.discountPrice}} |
¥{{ product.highCoupon.discountPrice}} |
||||||
</view> |
</view> |
||||||
<view class="slogan" v-if="product.highCoupon.discountPrice !== product.highCoupon.salesPrice"> |
<view class="slogan" v-if="product.highCoupon.discountPrice !== product.highCoupon.salesPrice"> |
||||||
¥{{ product.highCoupon.salesPrice}} |
¥{{ product.highCoupon.salesPrice}} |
||||||
</view> |
</view> |
||||||
</view> |
</view> |
||||||
<view class="info" v-else> |
<view class="info" v-else> |
||||||
<view class="price"> |
<view class="price"> |
||||||
<image style="width: 15px;height: 15px;vertical-align: sub;" |
<image style="width: 15px;height: 15px;vertical-align: sub;" src="../../../static/img/jfx.png"> |
||||||
src="../../../static/img/jfx.png"> |
</image>{{ product.highCoupon.discountPrice*100}} |
||||||
</image>{{ product.highCoupon.discountPrice*100}} |
</view> |
||||||
</view> |
<view class="slogan" v-if="product.highCoupon.discountPrice !== product.highCoupon.salesPrice"> |
||||||
<view class="slogan" v-if="product.highCoupon.discountPrice !== product.highCoupon.salesPrice"> |
<image style="width: 15px;height: 15px;vertical-align: sub;" src="../../../static/img/jfh.png"> |
||||||
<image style="width: 15px;height: 15px;vertical-align: sub;" |
</image>{{ product.highCoupon.salesPrice*100}} |
||||||
src="../../../static/img/jfh.png"> |
</view> |
||||||
</image>{{ product.highCoupon.salesPrice*100}} |
</view> |
||||||
</view> |
</view> |
||||||
</view> |
</view> |
||||||
</view> |
<view class="width100 height60"></view> |
||||||
</view> |
<!-- <button class="coupne-btn width100" v-if="userInfo == 1" open-type="getUserInfo" lang="zh_CN" |
||||||
<view class="width100 height60"></view> |
@getuserinfo="getuserinfo" withCredentials="true">点击领取</button> |
||||||
<!-- <button class="coupne-btn width100" v-if="userInfo == 1" open-type="getUserInfo" lang="zh_CN" |
<button class="coupne-btn width100" v-else @click="receiveDiscount">点击领取</button> --> |
||||||
@getuserinfo="getuserinfo" withCredentials="true">点击领取</button> |
<!-- <authorize></authorize> --> |
||||||
<button class="coupne-btn width100" v-else @click="receiveDiscount">点击领取</button> --> |
</view> |
||||||
<!-- <authorize></authorize> --> |
</template> |
||||||
</view> |
|
||||||
</template> |
<script> |
||||||
|
import { |
||||||
<script> |
getCouponByDiscount, |
||||||
import { |
getDiscountByQrCode, |
||||||
getCouponByDiscount, |
receiveDiscount, |
||||||
getDiscountByQrCode, |
HandleCode, |
||||||
receiveDiscount, |
getUserInfo, |
||||||
HandleCode, |
getH5AccessToken, |
||||||
getUserInfo, |
loginByPhone |
||||||
loginByPhone |
} from '../../../Utils/Api.js'; |
||||||
} from '../../../Utils/Api.js'; |
// import authorize from '../../../components/Authorize'; |
||||||
// import authorize from '../../../components/Authorize'; |
let app = getApp(); |
||||||
let app = getApp(); |
export default { |
||||||
export default { |
// components: { |
||||||
// components: { |
// authorize |
||||||
// authorize |
// }, |
||||||
// }, |
data() { |
||||||
data() { |
return { |
||||||
return { |
minecoupones: [], |
||||||
minecoupones: [], |
imageUrl: app.globalData.imgUrl, |
||||||
imageUrl: app.globalData.imgUrl, |
imagewxUrl: app.globalData.imageWxImg, |
||||||
imagewxUrl: app.globalData.imageWxImg, |
imgadres: 'noorder.png', |
||||||
imgadres:'noorder.png', |
pageNum: 1, |
||||||
pageNum: 1, |
pageSize: 10, |
||||||
pageSize: 10, |
isNoMoreData: false, |
||||||
isNoMoreData: false, |
couponsDetails: '', |
||||||
couponsDetails: '', |
salesEndTime: '', |
||||||
salesEndTime: '', |
codes: '', |
||||||
codes: '', |
userInfo: '' |
||||||
userInfo: '' |
} |
||||||
} |
}, |
||||||
}, |
filters: { |
||||||
filters: { |
//过滤器 用于格式化时间 |
||||||
//过滤器 用于格式化时间 |
formatDate: function(value, spe = '/') { |
||||||
formatDate: function(value, spe = '/') { |
let data = new Date(value); |
||||||
let data = new Date(value); |
let year = data.getFullYear(); |
||||||
let year = data.getFullYear(); |
let month = data.getMonth() + 1; |
||||||
let month = data.getMonth() + 1; |
let day = data.getDate(); |
||||||
let day = data.getDate(); |
let h = data.getHours(); |
||||||
let h = data.getHours(); |
let mm = data.getMinutes(); |
||||||
let mm = data.getMinutes(); |
let s = data.getSeconds(); |
||||||
let s = data.getSeconds(); |
month = month >= 10 ? month : "0" + month; |
||||||
month = month >= 10 ? month : "0" + month; |
day = day >= 10 ? day : "0" + day; |
||||||
day = day >= 10 ? day : "0" + day; |
h = h >= 10 ? h : "0" + h; |
||||||
h = h >= 10 ? h : "0" + h; |
mm = mm >= 10 ? mm : "0" + mm; |
||||||
mm = mm >= 10 ? mm : "0" + mm; |
s = s >= 10 ? s : "0" + s; |
||||||
s = s >= 10 ? s : "0" + s; |
return `${year}${spe}${month}${spe}${day}`; |
||||||
return `${year}${spe}${month}${spe}${day}`; |
} |
||||||
} |
}, |
||||||
}, |
onShow() { |
||||||
onLoad(options) { |
if (app.globalData.userInfo.phone) { |
||||||
if (app.globalData.userInfo) { |
this.userInfo = 2; |
||||||
this.userInfo = 2; |
} else { |
||||||
} else { |
this.userInfo = 1; |
||||||
this.userInfo = 1; |
} |
||||||
} |
}, |
||||||
uni.login({ |
onLoad() { |
||||||
provider: 'weixin', |
var arr1 = window.location.href; |
||||||
success: function(loginRes) { |
var arr2 = arr1.split('='); |
||||||
app.globalData.code = loginRes.code; |
this.getH5AccessToken(arr2[1]); |
||||||
// 请求接口 |
this.getDiscountByQrCode(); |
||||||
let params = { |
|
||||||
code: app.globalData.code |
}, |
||||||
} |
methods: { |
||||||
HandleCode(params).then(res => { |
//获取卡券详情 |
||||||
if (res.return_code == '000000') { |
getDiscountByQrCode() { |
||||||
app.globalData.openId = res.return_data.openId; |
let that = this; |
||||||
} |
uni.getStorage({ |
||||||
}) |
key: 'h5code', |
||||||
} |
success: (res) => { |
||||||
}) |
let params = { |
||||||
// var arr1 = decodeURIComponent(options.q); |
code: res.data |
||||||
// var arr2 = arr1.split('='); |
} |
||||||
this.codes = options.id; |
getDiscountByQrCode(params).then(res => { |
||||||
this.getDiscountByQrCode(); |
if (res.return_code == '000000') { |
||||||
|
that.couponsDetails = res.return_data; |
||||||
}, |
that.salesEndTime = res.return_data.highDiscount.salesEndTime; |
||||||
methods: { |
that.getCouponByDiscount(res.return_data.highDiscount.id); |
||||||
//获取卡券详情 |
} else { |
||||||
getDiscountByQrCode() { |
uni.showToast({ |
||||||
let params = { |
title: res.return_msg, |
||||||
code: this.codes |
icon: 'none', |
||||||
} |
duration: 20000 |
||||||
getDiscountByQrCode(params).then(res => { |
}) |
||||||
if (res.return_code == '000000') { |
} |
||||||
this.couponsDetails = res.return_data; |
}) |
||||||
this.salesEndTime = res.return_data.highDiscount.salesEndTime; |
} |
||||||
this.getCouponByDiscount(res.return_data.highDiscount.id); |
}); |
||||||
} |
|
||||||
}) |
}, |
||||||
}, |
//根据优惠券查询卡券列表 |
||||||
//根据优惠券查询卡券列表 |
getCouponByDiscount(item) { |
||||||
getCouponByDiscount(item) { |
let params = { |
||||||
let params = { |
discountId: item |
||||||
discountId: item |
} |
||||||
} |
getCouponByDiscount(params).then(res => { |
||||||
getCouponByDiscount(params).then(res => { |
if (res.return_code == '000000') { |
||||||
if (res.return_code == '000000') { |
this.minecoupones = res.return_data; |
||||||
this.minecoupones = res.return_data; |
} |
||||||
} |
}) |
||||||
}) |
}, |
||||||
}, |
//领取 |
||||||
//领取 |
receiveDiscount() { |
||||||
receiveDiscount() { |
|
||||||
|
uni.showLoading({ |
||||||
uni.showLoading({ |
title: '领取中...' |
||||||
title: '领取中...' |
}) |
||||||
}) |
let params = { |
||||||
let params = { |
codeId: this.couponsDetails.highDiscountAgentCode.id |
||||||
codeId: this.couponsDetails.highDiscountAgentCode.id |
} |
||||||
} |
receiveDiscount(params).then(res => { |
||||||
receiveDiscount(params).then(res => { |
if (res.return_code == '000000') { |
||||||
if (res.return_code == '000000') { |
uni.hideLoading(); |
||||||
uni.hideLoading(); |
uni.showToast({ |
||||||
uni.showToast({ |
icon: 'none', |
||||||
icon: 'none', |
title: res.return_data, |
||||||
title: res.return_data, |
duration: 2000 |
||||||
duration: 2000 |
}) |
||||||
}) |
} else { |
||||||
} else { |
uni.hideLoading(); |
||||||
uni.hideLoading(); |
uni.showToast({ |
||||||
uni.showToast({ |
icon: 'none', |
||||||
icon: 'none', |
title: res.return_msg, |
||||||
title: res.return_msg, |
duration: 2000 |
||||||
duration: 2000 |
}) |
||||||
}) |
} |
||||||
} |
}) |
||||||
}) |
|
||||||
|
}, |
||||||
}, |
//跳转登录 |
||||||
//获取登陆信息 |
jumpres() { |
||||||
getuserinfo() { |
uni.navigateTo({ |
||||||
let that = this; |
url: '../../login/register?id=2' |
||||||
// wx.login({ |
}) |
||||||
// success(res) { |
|
||||||
// if (res.code) { |
}, |
||||||
// 发起网络请求 |
//H5 获取openId |
||||||
// var code = res.code; |
getH5AccessToken(item) { |
||||||
// 获取微信用户信息 |
let params = { |
||||||
uni.getUserProfile({ |
code: item |
||||||
desc: '登录中...', |
} |
||||||
success: function(res) { |
getH5AccessToken(params).then(res => { |
||||||
let params = { |
if (res.return_code == '000000') { |
||||||
openId: app.globalData.openId, |
app.globalData.openId = res.return_data.openid; |
||||||
iv: res.iv, |
uni.setStorage({ |
||||||
encryptedData: res.encryptedData |
key: "openId", |
||||||
} |
data: res.return_data.openid |
||||||
getUserInfo(params).then(res => { |
}) |
||||||
if (res.return_code == '000000') { |
} |
||||||
uni.hideLoading(); |
}); |
||||||
app.globalData.userInfo = res |
}, |
||||||
.return_data |
// 微信获取手机号 |
||||||
.object |
loginByPhone(PhoneNumber) { |
||||||
.highUser; |
if (PhoneNumber.detail.iv == undefined) { |
||||||
app.globalData.token = res |
uni.showToast({ |
||||||
.return_data.uniqueCode; |
title: "用户取消授权", |
||||||
uni.setStorage({ |
icon: "none" |
||||||
key: "user", |
}); |
||||||
data: res.return_data |
return; |
||||||
.object |
} |
||||||
.highUser |
let params = { |
||||||
}) |
openId: app.globalData.openId, |
||||||
uni.setStorage({ |
iv: PhoneNumber.detail.iv, |
||||||
key: "token", |
encryptedData: PhoneNumber.detail.encryptedData |
||||||
data: res.return_data |
} |
||||||
.uniqueCode |
loginByPhone(params).then(res => { |
||||||
}) |
if (res.return_code == '000000') { |
||||||
that.receiveDiscount(); |
uni.showToast({ |
||||||
that.userInfo = 2; |
title: '手机号授权成功', |
||||||
} else { |
icon: 'none', |
||||||
uni.hideLoading(); |
duration: 2000 |
||||||
uni.showToast({ |
}) |
||||||
title: res.return_msg, |
this.user = res.return_data.object.highUser; |
||||||
icon: 'none', |
app.globalData.token = res.return_data.uniqueCode; |
||||||
duration: 2000 |
app.globalData.userInfo = res.return_data |
||||||
}) |
.object |
||||||
} |
.highUser; |
||||||
}); |
uni.setStorage({ |
||||||
}, |
key: "user", |
||||||
fail: res => { |
data: res.return_data |
||||||
uni.showToast({ |
.object |
||||||
title: "微信登录授权失败", |
.highUser |
||||||
icon: "none" |
}) |
||||||
}); |
uni.setStorage({ |
||||||
} |
key: "token", |
||||||
}) |
data: res.return_data.uniqueCode |
||||||
// } else { |
}) |
||||||
// uni.showToast({ |
this.receiveDiscount(); |
||||||
// title: "微信登录授权失败", |
this.userInfo = 2; |
||||||
// icon: "none" |
} |
||||||
// }); |
}); |
||||||
// } |
}, |
||||||
// } |
//商品跳转 |
||||||
// }) |
toGoods(e) { |
||||||
|
if (app.globalData.userInfo) { |
||||||
}, |
uni.navigateTo({ |
||||||
// 微信获取手机号 |
url: '../../order/confirmation?id=' + e |
||||||
loginByPhone(PhoneNumber) { |
}) |
||||||
if(PhoneNumber.detail.iv == undefined){ |
} else { |
||||||
uni.showToast({ |
uni.showToast({ |
||||||
title: "用户取消授权", |
icon: 'none', |
||||||
icon: "none" |
title: '请点击领取后再使用', |
||||||
}); |
duration: 2000 |
||||||
return; |
}) |
||||||
} |
} |
||||||
let params = { |
} |
||||||
openId: app.globalData.openId, |
} |
||||||
iv: PhoneNumber.detail.iv, |
|
||||||
encryptedData: PhoneNumber.detail.encryptedData |
} |
||||||
} |
</script> |
||||||
loginByPhone(params).then(res => { |
|
||||||
if (res.return_code == '000000') { |
<style lang="scss"> |
||||||
uni.showToast({ |
.coupon-mes { |
||||||
title: '手机号授权成功', |
// margin-right: 90px; |
||||||
icon: 'none', |
} |
||||||
duration: 2000 |
|
||||||
}) |
.coupon-img { |
||||||
this.user = res.return_data.object.highUser; |
width: 80px; |
||||||
app.globalData.token = res.return_data.uniqueCode; |
height: 80px; |
||||||
app.globalData.userInfo = res.return_data |
} |
||||||
.object |
|
||||||
.highUser; |
.product-list { |
||||||
uni.setStorage({ |
display: flex; |
||||||
key: "user", |
justify-content: space-between; |
||||||
data: res.return_data |
flex-wrap: wrap; |
||||||
.object |
|
||||||
.highUser |
.product { |
||||||
}) |
width: 48%; |
||||||
uni.setStorage({ |
border-radius: 20upx; |
||||||
key: "token", |
background-color: #fff; |
||||||
data: res.return_data.uniqueCode |
margin: 0 0 15upx 0; |
||||||
}) |
box-shadow: 0upx 5upx 25upx rgba(0, 0, 0, 0.1); |
||||||
this.receiveDiscount(); |
|
||||||
this.userInfo = 2; |
image { |
||||||
} |
width: 100%; |
||||||
}); |
border-radius: 20upx 20upx 0 0; |
||||||
}, |
} |
||||||
//商品跳转 |
|
||||||
toGoods(e) { |
.name { |
||||||
if (app.globalData.userInfo) { |
width: 92%; |
||||||
uni.navigateTo({ |
padding: 8upx 4%; |
||||||
url: '../../order/confirmation?id=' + e |
display: -webkit-box; |
||||||
}) |
-webkit-box-orient: vertical; |
||||||
} else { |
-webkit-line-clamp: 1; |
||||||
uni.showToast({ |
text-align: justify; |
||||||
icon: 'none', |
overflow: hidden; |
||||||
title: '请点击领取后再使用', |
font-size: 30upx; |
||||||
duration: 2000 |
} |
||||||
}) |
|
||||||
} |
.info { |
||||||
} |
display: flex; |
||||||
} |
justify-content: space-between; |
||||||
|
align-items: flex-end; |
||||||
} |
width: 92%; |
||||||
</script> |
padding: 10upx 4% 10upx 4%; |
||||||
|
|
||||||
<style lang="scss"> |
.price { |
||||||
.coupon-mes { |
color: #e65339; |
||||||
// margin-right: 90px; |
font-size: 30upx; |
||||||
} |
font-weight: 600; |
||||||
|
} |
||||||
.coupon-img { |
|
||||||
width: 80px; |
.slogan { |
||||||
height: 80px; |
color: #807c87; |
||||||
} |
font-size: 24upx; |
||||||
|
text-decoration: line-through; |
||||||
.product-list { |
margin-right: 10px; |
||||||
display: flex; |
} |
||||||
justify-content: space-between; |
} |
||||||
flex-wrap: wrap; |
} |
||||||
|
} |
||||||
.product { |
|
||||||
width: 48%; |
.coupne-btn { |
||||||
border-radius: 20upx; |
background-color: red; |
||||||
background-color: #fff; |
color: #FFFFFF; |
||||||
margin: 0 0 15upx 0; |
} |
||||||
box-shadow: 0upx 5upx 25upx rgba(0, 0, 0, 0.1); |
|
||||||
|
|
||||||
image { |
|
||||||
width: 100%; |
|
||||||
border-radius: 20upx 20upx 0 0; |
|
||||||
} |
|
||||||
|
|
||||||
.name { |
|
||||||
width: 92%; |
|
||||||
padding: 8upx 4%; |
|
||||||
display: -webkit-box; |
|
||||||
-webkit-box-orient: vertical; |
|
||||||
-webkit-line-clamp: 1; |
|
||||||
text-align: justify; |
|
||||||
overflow: hidden; |
|
||||||
font-size: 30upx; |
|
||||||
} |
|
||||||
|
|
||||||
.info { |
|
||||||
display: flex; |
|
||||||
justify-content: space-between; |
|
||||||
align-items: flex-end; |
|
||||||
width: 92%; |
|
||||||
padding: 10upx 4% 10upx 4%; |
|
||||||
|
|
||||||
.price { |
|
||||||
color: #e65339; |
|
||||||
font-size: 30upx; |
|
||||||
font-weight: 600; |
|
||||||
} |
|
||||||
|
|
||||||
.slogan { |
|
||||||
color: #807c87; |
|
||||||
font-size: 24upx; |
|
||||||
text-decoration: line-through; |
|
||||||
margin-right: 10px; |
|
||||||
} |
|
||||||
} |
|
||||||
} |
|
||||||
} |
|
||||||
|
|
||||||
.coupne-btn { |
|
||||||
background-color: red; |
|
||||||
color: #FFFFFF; |
|
||||||
} |
|
||||||
</style> |
</style> |
||||||
|
@ -1,27 +1,192 @@ |
|||||||
<template> |
<template> |
||||||
<view> |
<view> |
||||||
<view>测试中。。。。</view> |
<image class="width100" mode="widthFix" :src="imagewxUrl+imgadres" @click="showModal"></image> |
||||||
</view> |
<image class="width100" mode="widthFix" :src="imagewxUrl+imgadres1" @click="jumpMp"></image> |
||||||
</template> |
|
||||||
|
<view v-if="isShowModal"> |
||||||
<script> |
<view class="masking" v-if="showMasking" :style="{'background-color': bgColor}"></view> |
||||||
export default { |
<view class="model-wraper"> |
||||||
data() { |
<view class="modal-title"> |
||||||
return { |
亲,请务必输入云闪付绑定的手机号 |
||||||
url: 'https://base.95516.com/s/wl/WebAPP/helpAgree/page/help/shareRutineHelp.html?params=eyJlbmNyeXB0QXBwSWQiOiIxOTAwYmM4NDQ5N2NhYjNiIiwidG9MaW5rIjoiaHR0cHMlM0ElMkYlMkZoc2cuZGN0cGF5LmNvbSUyRnVuaW9uUGF5JTJGIn0' |
</view> |
||||||
} |
<view class="modal-body"> |
||||||
}, |
<input v-model="inputSerialNum" type="number" maxlength="11" |
||||||
onLoad() { |
style="padding: 10rpx;font-size: 30rpx;" class="uni-input" focus placeholder="请输入" /> |
||||||
this.jumpurl(); |
</view> |
||||||
}, |
<view> |
||||||
methods: { |
<view class="btn cancel" :style="{'color': cancelTextColor}" @click="handleCancel">{{cancelText}} |
||||||
jumpurl(){ |
</view> |
||||||
location.href = this.url; |
<view class="btn confirm" :style="{'color': confirmTextColor}" @click="handleConfirm"> |
||||||
} |
{{confirmText}} |
||||||
} |
</view> |
||||||
} |
</view> |
||||||
</script> |
</view> |
||||||
|
</view> |
||||||
<style> |
</view> |
||||||
|
</template> |
||||||
|
|
||||||
|
<script> |
||||||
|
import { |
||||||
|
setCacheParam, |
||||||
|
HandleCode |
||||||
|
} from '../../../Utils/Api.js'; |
||||||
|
let app = getApp(); |
||||||
|
export default { |
||||||
|
props: { |
||||||
|
// 是否显示蒙层 |
||||||
|
showMasking: { |
||||||
|
type: Boolean, |
||||||
|
default: true |
||||||
|
}, |
||||||
|
// 蒙层背景色 |
||||||
|
bgColor: { |
||||||
|
type: String, |
||||||
|
default: 'rgba(0,0,0,.6)' |
||||||
|
}, |
||||||
|
// 取消按钮文字 |
||||||
|
cancelText: { |
||||||
|
type: String, |
||||||
|
default: '取消' |
||||||
|
}, |
||||||
|
// 确定按钮文字 |
||||||
|
confirmText: { |
||||||
|
type: String, |
||||||
|
default: '确定' |
||||||
|
}, |
||||||
|
// 取消按钮文字颜色 |
||||||
|
cancelTextColor: { |
||||||
|
type: String, |
||||||
|
default: '#666' |
||||||
|
}, |
||||||
|
// 确定按钮文字颜色 |
||||||
|
confirmTextColor: { |
||||||
|
type: String, |
||||||
|
default: '#5999FF' |
||||||
|
} |
||||||
|
}, |
||||||
|
data() { |
||||||
|
return { |
||||||
|
imagewxUrl: app.globalData.imageWxImg, |
||||||
|
imgadres: 'union1.jpg?id=1', |
||||||
|
imgadres1: 'union2.jpg?id=2', |
||||||
|
codes: '', |
||||||
|
isShowModal: false, |
||||||
|
inputSerialNum: '', |
||||||
|
url: 'https://base.95516.com/s/wl/WebAPP/helpAgree/page/help/shareRutineHelp.html?params=eyJlbmNyeXB0QXBwSWQiOiIxOTAwYmM4NDQ5N2NhYjNiIiwidG9MaW5rIjoiaHR0cHMlM0ElMkYlMkZoc2cuZGN0cGF5LmNvbSUyRnVuaW9uUGF5JTJGIn0' |
||||||
|
} |
||||||
|
|
||||||
|
}, |
||||||
|
onLoad() { |
||||||
|
var arr1 = window.location.href; |
||||||
|
var arr2 = arr1.split('='); |
||||||
|
var arr3 = arr2[2].split('#/'); |
||||||
|
this.codes = arr3[0]; |
||||||
|
uni.setStorage({ |
||||||
|
key: "h5code", |
||||||
|
data: arr3[0] |
||||||
|
}) |
||||||
|
}, |
||||||
|
methods: { |
||||||
|
showModal() { |
||||||
|
this.isShowModal = true; |
||||||
|
}, |
||||||
|
handleCancel() { |
||||||
|
this.$emit('onClickCancel', 'cancel') |
||||||
|
this.isShowModal = false; |
||||||
|
}, |
||||||
|
//跳转银联支付 |
||||||
|
handleConfirm() { |
||||||
|
this.isShowModal = false; |
||||||
|
this.$emit('onClickConfirm', this.inputSerialNum) |
||||||
|
if (!this.inputSerialNum) { |
||||||
|
uni.showToast({ |
||||||
|
title: '请输入银联绑定手机号', |
||||||
|
icon: 'none', |
||||||
|
duration: 2000 |
||||||
|
}) |
||||||
|
return; |
||||||
|
} |
||||||
|
let params = { |
||||||
|
key: this.inputSerialNum, |
||||||
|
value: this.codes |
||||||
|
} |
||||||
|
setCacheParam(params).then(res => { |
||||||
|
if (res.return_code == '000000') { |
||||||
|
location.href = this.url; |
||||||
|
} else { |
||||||
|
uni.showToast({ |
||||||
|
title: res.return_msg, |
||||||
|
icon: 'none', |
||||||
|
duration: 2000 |
||||||
|
}) |
||||||
|
} |
||||||
|
}) |
||||||
|
|
||||||
|
}, |
||||||
|
//跳转到小程序 |
||||||
|
jumpMp() { |
||||||
|
if (!app.globalData.openId) { |
||||||
|
location.href = |
||||||
|
'https://open.weixin.qq.com/connect/oauth2/authorize?appid=wxa075e8509802f826&redirect_uri=https%3A%2F%2Fhsg.dctpay.com%2FH5%2F%23%2Fpages%2Fgoods%2FexternalCoupon%2FexternalCoupon&response_type=code&scope=snsapi_base#wechat_redirect'; |
||||||
|
} else { |
||||||
|
uni.reLaunch({ |
||||||
|
url: '../../goods/externalCoupon/externalCoupon' |
||||||
|
}) |
||||||
|
} |
||||||
|
|
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
</script> |
||||||
|
|
||||||
|
<style scoped> |
||||||
|
.masking { |
||||||
|
height: 100vh; |
||||||
|
width: 100vw; |
||||||
|
position: fixed; |
||||||
|
top: 0; |
||||||
|
left: 0; |
||||||
|
z-index: 999; |
||||||
|
} |
||||||
|
|
||||||
|
.model-wraper { |
||||||
|
width: 600rpx; |
||||||
|
background-color: #fff; |
||||||
|
border-radius: 16rpx; |
||||||
|
position: absolute; |
||||||
|
z-index: 1000; |
||||||
|
top: 50%; |
||||||
|
left: 50%; |
||||||
|
margin-top: -161rpx; |
||||||
|
margin-left: -300rpx; |
||||||
|
box-shadow: #dcdcdc 0px 0px 20rpx; |
||||||
|
} |
||||||
|
|
||||||
|
.modal-title { |
||||||
|
height: 90rpx; |
||||||
|
line-height: 90rpx; |
||||||
|
width: 100%; |
||||||
|
text-align: center; |
||||||
|
font-size: 32rpx; |
||||||
|
color: #666; |
||||||
|
} |
||||||
|
|
||||||
|
.modal-body { |
||||||
|
padding: 30rpx 30rpx 80rpx 30rpx; |
||||||
|
} |
||||||
|
|
||||||
|
.btn { |
||||||
|
width: 300rpx; |
||||||
|
height: 90rpx; |
||||||
|
text-align: center; |
||||||
|
line-height: 90rpx; |
||||||
|
font-size: 32rpx; |
||||||
|
float: left; |
||||||
|
border-top: 1rpx solid #ddd; |
||||||
|
} |
||||||
|
|
||||||
|
.btn.cancel { |
||||||
|
width: 299rpx; |
||||||
|
border-right: 1rpx solid #dcdcdc; |
||||||
|
} |
||||||
</style> |
</style> |
||||||
|
Loading…
Reference in new issue