Commit 2dcce91f by huyue

修改附近门店地址

1 parent dc7d1f6d
......@@ -44,21 +44,26 @@
</view>
</view>
<view class="tabs-bottom"></view>
<scroll-view :class="['record-list', list.length != 0 ? 'scroll-list':'']" scroll-y @scrolltolower="pageonReachBottom" :scroll-top="scrollTop">
<scroll-view :class="['record-list', list.length != 0 ? 'scroll-list' : '']" scroll-y
@scrolltolower="pageonReachBottom" :scroll-top="scrollTop">
<template v-if="list.length">
<view class="coupon-list">
<template v-for="item in list">
<view :class="['coupon-bg', `${TYPE_LIST[item.couponState]}-bg`]">
<image v-if="item.couponState == 2" class="claimed-left" :src="require('@/assets/images/point/claimed-left.png')" alt="" />
<image v-if="item.couponState == 2" class="claimed-left"
:src="require('@/assets/images/point/claimed-left.png')" alt="" />
<view class="coupon-img">
<image class="img" mode="aspectFill" :src="item.couUrl || require('@/assets/images/point/default-coupon.png')" alt="" />
<image class="img" mode="aspectFill"
:src="item.couUrl || require('@/assets/images/point/default-coupon.png')" alt="" />
</view>
<view class="coupon-info">
<view :class="['coupon-name', { 'gray-name': item.couponState == 3 }]">{{ item.couponName}}
<view :class="['coupon-name', { 'gray-name': item.couponState == 3 }]">{{ item.couponName }}
</view>
<view :class="['coupon-price', { 'gray-text': item.couponState == 3 }]">官方价:¥{{ item.lineationPrice }}
<view :class="['coupon-price', { 'gray-text': item.couponState == 3 }]">官方价:¥{{ item.lineationPrice
}}
</view>
<view :class="['coupon-time', { 'gray-text': item.couponState == 3 }]">有效期:{{ item.couponDeadline }}
</view>
<view :class="['coupon-time', { 'gray-text': item.couponState == 3 }]">有效期:{{ item.couponDeadline }}</view>
</view>
<view @click="openCoupon(item)"
:class="['coupon-btn', item.couponState == 2 ? 'blue' : item.couponState == 3 ? 'gray gray-name' : 'red']">
......@@ -88,9 +93,9 @@
<image :src="couponDetailInfo.couUrl || require('@/assets/images/point/default-coupon.png')" alt="" />
</view>
<view class="coupon-base-info">
<h3>{{couponDetailInfo.couponName}}</h3>
<h3>{{ couponDetailInfo.couponName }}</h3>
<p>官方价:¥{{ couponDetailInfo.lineationPrice }}</p>
<p>有效期:{{couponDetailInfo.couponDeadline}}</p>
<p>有效期:{{ couponDetailInfo.couponDeadline }}</p>
</view>
</view>
<view class="coupon-line"></view>
......@@ -101,7 +106,8 @@
<view>请截屏发送至手机或手机拍摄保存,按「使用须知」使用卡券</view>
</view>
<view class="coupon-qrcode">
<template v-if="couponDetailInfo.cardType == 0 || couponDetailInfo.cardType == 1 || couponDetailInfo.cardType == 2">
<template
v-if="couponDetailInfo.cardType == 0 || couponDetailInfo.cardType == 1 || couponDetailInfo.cardType == 2">
<image class="qr-img" :src="couponDetailInfo.qrCodeUrl" alt="" />
</template>
<!-- <template v-if="couponDetailInfo.cardType == 1">
......@@ -118,7 +124,7 @@
<view class="redeem-code">
<view class="redeem-item">
<view class="redeem-name">卡券URL:</view>
<view class="redeem-value">{{couponDetailInfo.couponCardUrl || ''}}</view>
<view class="redeem-value">{{ couponDetailInfo.couponCardUrl || '' }}</view>
</view>
</view>
</template>
......@@ -126,7 +132,7 @@
<view class="redeem-code">
<view class="redeem-item">
<view class="redeem-name">密码:</view>
<view class="redeem-value">{{couponDetailInfo.couponPassword}}</view>
<view class="redeem-value">{{ couponDetailInfo.couponPassword }}</view>
</view>
</view>
</template>
......@@ -134,11 +140,11 @@
<view class="redeem-code">
<view class="redeem-item">
<view class="redeem-name">卡号:</view>
<view class="redeem-value">{{couponDetailInfo.cardNo}}</view>
<view class="redeem-value">{{ couponDetailInfo.cardNo }}</view>
</view>
<view class="redeem-item">
<view class="redeem-name">密码:</view>
<view class="redeem-value">{{couponDetailInfo.couponPassword}}</view>
<view class="redeem-value">{{ couponDetailInfo.couponPassword }}</view>
</view>
</view>
</template>
......@@ -147,16 +153,18 @@
</template> -->
</view>
</view>
<view class="store-info" v-if="this.storeAddress">
<view class="store-info" v-if="storeAddress">
<view class="sprite-icon icon-icon-store"></view>
<p class="store-label">附近门店</p>
<p class="store-address">{{ storeAddress }}</p>
<view class="copy-btn" @click="copyText"><view class="sprite-icon icon-icon-copy copy"></view>复制</view>
<view class="copy-btn" @click="copyText">
<view class="sprite-icon icon-icon-copy copy"></view>复制
</view>
</view>
<view :class="['usage-notice', couponDetailInfo.couponState == 2 ? 'claimed-usage':'']">
<view :class="[couponDetailInfo.couponState == 2 ? 'claimed-notice':'']">
<view :class="['usage-notice', couponDetailInfo.couponState == 2 ? 'claimed-usage' : '']">
<view :class="[couponDetailInfo.couponState == 2 ? 'claimed-notice' : '']">
<view class="notice-title">
<view class="sprite-icon icon-icon-notice"></view>
<view class="sprite-icon icon-icon-notice"></view>
<view class="m-l-8">使用须知</view>
</view>
<view class="ol li" v-html="couponDetailInfo.apiUseExplain">
......@@ -167,8 +175,8 @@
<li>到店出示本券由门店扫描验证即可兑换。星巴克全国指定直营门店可用(臻选店,机场店,火车站等交通枢纽和景区门店除外)。</li>
<li>请在本产品使用后再确认收货,一旦收货无法提供售后服务。如有售后,请妥善保管好您的星巴克小票以备使用。</li>
</ol> -->
</view>
</view>
</view>
<view class="coupon-footer" v-if="couponDetailInfo.couponState == 1">
<button class="claim-button" @click="handleUse">领取使用</button>
</view>
......@@ -254,27 +262,68 @@ export default {
this.getGrantRecord()
},
getLocation(brandName) {
const _this = this
uni.getLocation({
type: 'gcj02',
geocode: true, // 设置为 true 可直接获取经纬度及城市信息
success: function (res) {
console.log(res, '===='); // 打印位置信息
// 处理位置数据
const params = {
brandName,
lat: res.latitude,
lng: res.longitude
}
uni.$api.pointApi.searchStoreAddress(params).then(res => {
console.log(res, '======');
this.storeAddress = res
})
},
fail: function () {
uni.showToast({
title: '获取地址失败,将导致部分功能不可用',
icon: 'none'
});
type: 'wgs84',
success: (res) => {
console.log(res, '===='); // 打印位置信息
// 处理位置数据
const params = {
brandName,
lat: res.latitude,
lng: res.longitude
// lat: 22.587424,
// lng: 113.991215
}
uni.$api.pointApi.searchStoreAddress(params).then(res => {
console.log(res, '======');
_this.storeAddress = res
})
},
fail: (err) => {
console.error('获取位置失败', err);
if (err.errMsg.includes('auth deny')) {
uni.showModal({
title: '提示',
content: '需要授权位置信息才能获取附近门店地址,请在设置中开启',
success: (res) => {
if (res.confirm) {
uni.openSetting({
success: (settingRes) => {
if (settingRes.authSetting['scope.userLocation']) {
console.log('用户已授权位置信息');
uni.getLocation({
type: 'wgs84',
success: (res) => {
console.log('获取位置成功', res);
},
fail: (err) => {
console.error('获取位置失败', err);
}
});
} else {
console.log('用户未授权位置信息');
}
}
});
}
}
});
} else if (err.errMsg.includes('fail authorize no app permission')) {
uni.showModal({
title: '提示',
content: '请在设置中开启定位服务',
success: (res) => {
if (res.confirm) {
uni.openSetting({
success: (settingRes) => {
console.log('用户已打开设置', settingRes);
}
});
}
}
});
}
}
});
},
......@@ -307,7 +356,7 @@ export default {
console.log(params, 'chaxun');
const res = await uni.$api.pointApi.getGrantRecord(params)
console.log(res, '========================', pageNum);
if(pageNum == 1) {
if (pageNum == 1) {
this.list = res.list
} else {
this.list = this.list.concat(res.list)
......@@ -342,7 +391,7 @@ export default {
this.getGrantRecord(this.firstIndex)
},
//下拉分页
pageonReachBottom () {
pageonReachBottom() {
console.log('到底了');
let { pageNum, total, nothing, pageSize } = this
if (!nothing) nothing = 'nothing'
......@@ -388,8 +437,8 @@ export default {
// 确认领取
handleConfirm() {
console.log('确认领取');
const {id} = this.couponDetailInfo
const params = {id}
const { id } = this.couponDetailInfo
const params = { id }
uni.$api.pointApi.receiveCoupon(params).then(res => {
console.log(res);
this.couponDetailInfo = res
......@@ -402,14 +451,14 @@ export default {
// 复制
copyText() {
uni.setClipboardData({
data: this.storeAddress,
success: function() {
uni.showToast({
title: '复制成功',
icon: 'success'
});
}
});
data: this.storeAddress,
success: function () {
uni.showToast({
title: '复制成功',
icon: 'success'
});
}
});
}
}
}
......@@ -565,6 +614,7 @@ export default {
.record-list {
position: relative;
z-index: 4;
&.scroll-list {
height: calc(100% - #{toRpx(170)});
}
......@@ -593,6 +643,7 @@ export default {
width: toRpx(452);
height: toRpx(536);
background-size: 100%;
.claimed-left {
width: toRpx(126);
height: toRpx(40);
......@@ -1038,9 +1089,11 @@ export default {
-webkit-mask: radial-gradient(circle at 12px 12px, transparent 12px, red 12px) -12px -12px;
-webkit-mask-position: -12px -24px;
border-radius: toRpx(64);
&.detail-header {
background-image: linear-gradient(104deg, #DBEBFF 0%, #F1F5FD 39%, #E2F2FE 82%, #D1F0FF 100%);
}
.header-img {
width: toRpx(200);
height: toRpx(200);
......@@ -1082,9 +1135,11 @@ export default {
margin-top: toRpx(-24);
background-color: #fff;
padding: toRpx(24) toRpx(80);
border-radius: 0 0 toRpx(32) toRpx(32);
border-radius: 0 0 toRpx(64) toRpx(64);
.coupon-qr {
text-align: center;
.coupon-tips {
display: flex;
align-items: center;
......@@ -1092,18 +1147,22 @@ export default {
font-size: toRpx(28);
padding-left: toRpx(36);
}
.coupon-qrcode {
width: 100%;
.qr-img {
width: toRpx(320);
height: toRpx(320);
margin: toRpx(80) 0;
margin: toRpx(40) 0;
}
.qr-1-img {
width: toRpx(640);
height: toRpx(192);
margin: toRpx(80) 0;
}
.qr-2-box {
display: flex;
margin: toRpx(80) 0;
......@@ -1111,11 +1170,13 @@ export default {
// padding: 0 toRpx(60);
padding-left: toRpx(168);
align-items: center;
.qr-img {
width: toRpx(320);
height: toRpx(320);
margin: 0;
}
.qr-line {
width: toRpx(6);
height: toRpx(288);
......@@ -1124,24 +1185,29 @@ export default {
margin-left: toRpx(60);
margin-right: toRpx(-50);
}
.qr-2-img {
height: toRpx(96);
width: toRpx(320);
rotate: 90deg;
}
}
.redeem-code {
padding: 0 toRpx(40);
margin: toRpx(48) 0 toRpx(80);
.redeem-item {
display: flex;
flex-direction: column;
text-align: left;
margin-bottom: toRpx(40);
.redeem-name {
font-size: toRpx(28);
color: #808291;
}
.redeem-value {
font-size: toRpx(40);
color: #181A1F;
......@@ -1152,6 +1218,7 @@ export default {
}
}
}
// .coupon-qrcode {
// width: 100%;
// // width: toRpx(544);
......@@ -1170,12 +1237,13 @@ export default {
// background-image: linear-gradient(90deg, #ffffff99 0%, #ffffffeb 23%, #F5F7FA 100%);
border-radius: toRpx(16);
padding: toRpx(16) toRpx(32);
.copy-btn {
display: flex;
align-items: center;
margin-left: auto;
color: #808291;
.copy {
margin-right: toRpx(8);
}
......@@ -1193,6 +1261,10 @@ export default {
margin-left: toRpx(32);
font-size: toRpx(28);
color: #1F1F1F;
width: calc(100% - #{toRpx(300)});
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
}
......@@ -1208,6 +1280,7 @@ export default {
.store-info p {
margin: 0;
}
.notice-title {
display: flex;
align-items: center;
......@@ -1217,16 +1290,18 @@ export default {
margin-bottom: toRpx(16);
padding: 0 toRpx(26);
}
.usage-notice {
background-color: #F5F7FA;
padding: toRpx(24) toRpx(6);
border-radius: toRpx(24);
&.claimed-usage {
margin-bottom: toRpx(56);
}
}
.claimed-notice {
}
.claimed-notice {}
.usage-notice {
.m-l-8 {
......@@ -1350,6 +1425,7 @@ export default {
line-height: 46rpx;
margin-top: 16rpx;
padding: 0 64rpx;
.highlight {
display: inline-block;
color: #2C66F7;
......@@ -1382,6 +1458,7 @@ export default {
}
}
}
.end-text {
color: #999;
text-align: center;
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!