Commit 2dcce91f by huyue

修改附近门店地址

1 parent dc7d1f6d
...@@ -44,21 +44,26 @@ ...@@ -44,21 +44,26 @@
</view> </view>
</view> </view>
<view class="tabs-bottom"></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"> <template v-if="list.length">
<view class="coupon-list"> <view class="coupon-list">
<template v-for="item in list"> <template v-for="item in list">
<view :class="['coupon-bg', `${TYPE_LIST[item.couponState]}-bg`]"> <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"> <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>
<view class="coupon-info"> <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>
<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>
<view :class="['coupon-time', { 'gray-text': item.couponState == 3 }]">有效期:{{ item.couponDeadline }}</view>
</view> </view>
<view @click="openCoupon(item)" <view @click="openCoupon(item)"
:class="['coupon-btn', item.couponState == 2 ? 'blue' : item.couponState == 3 ? 'gray gray-name' : 'red']"> :class="['coupon-btn', item.couponState == 2 ? 'blue' : item.couponState == 3 ? 'gray gray-name' : 'red']">
...@@ -88,9 +93,9 @@ ...@@ -88,9 +93,9 @@
<image :src="couponDetailInfo.couUrl || require('@/assets/images/point/default-coupon.png')" alt="" /> <image :src="couponDetailInfo.couUrl || require('@/assets/images/point/default-coupon.png')" alt="" />
</view> </view>
<view class="coupon-base-info"> <view class="coupon-base-info">
<h3>{{couponDetailInfo.couponName}}</h3> <h3>{{ couponDetailInfo.couponName }}</h3>
<p>官方价:¥{{ couponDetailInfo.lineationPrice }}</p> <p>官方价:¥{{ couponDetailInfo.lineationPrice }}</p>
<p>有效期:{{couponDetailInfo.couponDeadline}}</p> <p>有效期:{{ couponDetailInfo.couponDeadline }}</p>
</view> </view>
</view> </view>
<view class="coupon-line"></view> <view class="coupon-line"></view>
...@@ -101,7 +106,8 @@ ...@@ -101,7 +106,8 @@
<view>请截屏发送至手机或手机拍摄保存,按「使用须知」使用卡券</view> <view>请截屏发送至手机或手机拍摄保存,按「使用须知」使用卡券</view>
</view> </view>
<view class="coupon-qrcode"> <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="" /> <image class="qr-img" :src="couponDetailInfo.qrCodeUrl" alt="" />
</template> </template>
<!-- <template v-if="couponDetailInfo.cardType == 1"> <!-- <template v-if="couponDetailInfo.cardType == 1">
...@@ -118,7 +124,7 @@ ...@@ -118,7 +124,7 @@
<view class="redeem-code"> <view class="redeem-code">
<view class="redeem-item"> <view class="redeem-item">
<view class="redeem-name">卡券URL:</view> <view class="redeem-name">卡券URL:</view>
<view class="redeem-value">{{couponDetailInfo.couponCardUrl || ''}}</view> <view class="redeem-value">{{ couponDetailInfo.couponCardUrl || '' }}</view>
</view> </view>
</view> </view>
</template> </template>
...@@ -126,7 +132,7 @@ ...@@ -126,7 +132,7 @@
<view class="redeem-code"> <view class="redeem-code">
<view class="redeem-item"> <view class="redeem-item">
<view class="redeem-name">密码:</view> <view class="redeem-name">密码:</view>
<view class="redeem-value">{{couponDetailInfo.couponPassword}}</view> <view class="redeem-value">{{ couponDetailInfo.couponPassword }}</view>
</view> </view>
</view> </view>
</template> </template>
...@@ -134,11 +140,11 @@ ...@@ -134,11 +140,11 @@
<view class="redeem-code"> <view class="redeem-code">
<view class="redeem-item"> <view class="redeem-item">
<view class="redeem-name">卡号:</view> <view class="redeem-name">卡号:</view>
<view class="redeem-value">{{couponDetailInfo.cardNo}}</view> <view class="redeem-value">{{ couponDetailInfo.cardNo }}</view>
</view> </view>
<view class="redeem-item"> <view class="redeem-item">
<view class="redeem-name">密码:</view> <view class="redeem-name">密码:</view>
<view class="redeem-value">{{couponDetailInfo.couponPassword}}</view> <view class="redeem-value">{{ couponDetailInfo.couponPassword }}</view>
</view> </view>
</view> </view>
</template> </template>
...@@ -147,14 +153,16 @@ ...@@ -147,14 +153,16 @@
</template> --> </template> -->
</view> </view>
</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> <view class="sprite-icon icon-icon-store"></view>
<p class="store-label">附近门店</p> <p class="store-label">附近门店</p>
<p class="store-address">{{ storeAddress }}</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>
<view :class="['usage-notice', couponDetailInfo.couponState == 2 ? 'claimed-usage':'']"> <view :class="['usage-notice', couponDetailInfo.couponState == 2 ? 'claimed-usage' : '']">
<view :class="[couponDetailInfo.couponState == 2 ? 'claimed-notice':'']"> <view :class="[couponDetailInfo.couponState == 2 ? 'claimed-notice' : '']">
<view class="notice-title"> <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 class="m-l-8">使用须知</view>
...@@ -254,27 +262,68 @@ export default { ...@@ -254,27 +262,68 @@ export default {
this.getGrantRecord() this.getGrantRecord()
}, },
getLocation(brandName) { getLocation(brandName) {
const _this = this
uni.getLocation({ uni.getLocation({
type: 'gcj02', type: 'wgs84',
geocode: true, // 设置为 true 可直接获取经纬度及城市信息 success: (res) => {
success: function (res) {
console.log(res, '===='); // 打印位置信息 console.log(res, '===='); // 打印位置信息
// 处理位置数据 // 处理位置数据
const params = { const params = {
brandName, brandName,
lat: res.latitude, lat: res.latitude,
lng: res.longitude lng: res.longitude
// lat: 22.587424,
// lng: 113.991215
} }
uni.$api.pointApi.searchStoreAddress(params).then(res => { uni.$api.pointApi.searchStoreAddress(params).then(res => {
console.log(res, '======'); console.log(res, '======');
this.storeAddress = res _this.storeAddress = res
}) })
}, },
fail: function () { fail: (err) => {
uni.showToast({ console.error('获取位置失败', err);
title: '获取地址失败,将导致部分功能不可用', if (err.errMsg.includes('auth deny')) {
icon: 'none' 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 { ...@@ -307,7 +356,7 @@ export default {
console.log(params, 'chaxun'); console.log(params, 'chaxun');
const res = await uni.$api.pointApi.getGrantRecord(params) const res = await uni.$api.pointApi.getGrantRecord(params)
console.log(res, '========================', pageNum); console.log(res, '========================', pageNum);
if(pageNum == 1) { if (pageNum == 1) {
this.list = res.list this.list = res.list
} else { } else {
this.list = this.list.concat(res.list) this.list = this.list.concat(res.list)
...@@ -342,7 +391,7 @@ export default { ...@@ -342,7 +391,7 @@ export default {
this.getGrantRecord(this.firstIndex) this.getGrantRecord(this.firstIndex)
}, },
//下拉分页 //下拉分页
pageonReachBottom () { pageonReachBottom() {
console.log('到底了'); console.log('到底了');
let { pageNum, total, nothing, pageSize } = this let { pageNum, total, nothing, pageSize } = this
if (!nothing) nothing = 'nothing' if (!nothing) nothing = 'nothing'
...@@ -388,8 +437,8 @@ export default { ...@@ -388,8 +437,8 @@ export default {
// 确认领取 // 确认领取
handleConfirm() { handleConfirm() {
console.log('确认领取'); console.log('确认领取');
const {id} = this.couponDetailInfo const { id } = this.couponDetailInfo
const params = {id} const params = { id }
uni.$api.pointApi.receiveCoupon(params).then(res => { uni.$api.pointApi.receiveCoupon(params).then(res => {
console.log(res); console.log(res);
this.couponDetailInfo = res this.couponDetailInfo = res
...@@ -403,7 +452,7 @@ export default { ...@@ -403,7 +452,7 @@ export default {
copyText() { copyText() {
uni.setClipboardData({ uni.setClipboardData({
data: this.storeAddress, data: this.storeAddress,
success: function() { success: function () {
uni.showToast({ uni.showToast({
title: '复制成功', title: '复制成功',
icon: 'success' icon: 'success'
...@@ -565,6 +614,7 @@ export default { ...@@ -565,6 +614,7 @@ export default {
.record-list { .record-list {
position: relative; position: relative;
z-index: 4; z-index: 4;
&.scroll-list { &.scroll-list {
height: calc(100% - #{toRpx(170)}); height: calc(100% - #{toRpx(170)});
} }
...@@ -593,6 +643,7 @@ export default { ...@@ -593,6 +643,7 @@ export default {
width: toRpx(452); width: toRpx(452);
height: toRpx(536); height: toRpx(536);
background-size: 100%; background-size: 100%;
.claimed-left { .claimed-left {
width: toRpx(126); width: toRpx(126);
height: toRpx(40); height: toRpx(40);
...@@ -1038,9 +1089,11 @@ export default { ...@@ -1038,9 +1089,11 @@ export default {
-webkit-mask: radial-gradient(circle at 12px 12px, transparent 12px, red 12px) -12px -12px; -webkit-mask: radial-gradient(circle at 12px 12px, transparent 12px, red 12px) -12px -12px;
-webkit-mask-position: -12px -24px; -webkit-mask-position: -12px -24px;
border-radius: toRpx(64); border-radius: toRpx(64);
&.detail-header { &.detail-header {
background-image: linear-gradient(104deg, #DBEBFF 0%, #F1F5FD 39%, #E2F2FE 82%, #D1F0FF 100%); background-image: linear-gradient(104deg, #DBEBFF 0%, #F1F5FD 39%, #E2F2FE 82%, #D1F0FF 100%);
} }
.header-img { .header-img {
width: toRpx(200); width: toRpx(200);
height: toRpx(200); height: toRpx(200);
...@@ -1082,9 +1135,11 @@ export default { ...@@ -1082,9 +1135,11 @@ export default {
margin-top: toRpx(-24); margin-top: toRpx(-24);
background-color: #fff; background-color: #fff;
padding: toRpx(24) toRpx(80); padding: toRpx(24) toRpx(80);
border-radius: 0 0 toRpx(32) toRpx(32); border-radius: 0 0 toRpx(64) toRpx(64);
.coupon-qr { .coupon-qr {
text-align: center; text-align: center;
.coupon-tips { .coupon-tips {
display: flex; display: flex;
align-items: center; align-items: center;
...@@ -1092,18 +1147,22 @@ export default { ...@@ -1092,18 +1147,22 @@ export default {
font-size: toRpx(28); font-size: toRpx(28);
padding-left: toRpx(36); padding-left: toRpx(36);
} }
.coupon-qrcode { .coupon-qrcode {
width: 100%; width: 100%;
.qr-img { .qr-img {
width: toRpx(320); width: toRpx(320);
height: toRpx(320); height: toRpx(320);
margin: toRpx(80) 0; margin: toRpx(40) 0;
} }
.qr-1-img { .qr-1-img {
width: toRpx(640); width: toRpx(640);
height: toRpx(192); height: toRpx(192);
margin: toRpx(80) 0; margin: toRpx(80) 0;
} }
.qr-2-box { .qr-2-box {
display: flex; display: flex;
margin: toRpx(80) 0; margin: toRpx(80) 0;
...@@ -1111,11 +1170,13 @@ export default { ...@@ -1111,11 +1170,13 @@ export default {
// padding: 0 toRpx(60); // padding: 0 toRpx(60);
padding-left: toRpx(168); padding-left: toRpx(168);
align-items: center; align-items: center;
.qr-img { .qr-img {
width: toRpx(320); width: toRpx(320);
height: toRpx(320); height: toRpx(320);
margin: 0; margin: 0;
} }
.qr-line { .qr-line {
width: toRpx(6); width: toRpx(6);
height: toRpx(288); height: toRpx(288);
...@@ -1124,24 +1185,29 @@ export default { ...@@ -1124,24 +1185,29 @@ export default {
margin-left: toRpx(60); margin-left: toRpx(60);
margin-right: toRpx(-50); margin-right: toRpx(-50);
} }
.qr-2-img { .qr-2-img {
height: toRpx(96); height: toRpx(96);
width: toRpx(320); width: toRpx(320);
rotate: 90deg; rotate: 90deg;
} }
} }
.redeem-code { .redeem-code {
padding: 0 toRpx(40); padding: 0 toRpx(40);
margin: toRpx(48) 0 toRpx(80); margin: toRpx(48) 0 toRpx(80);
.redeem-item { .redeem-item {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
text-align: left; text-align: left;
margin-bottom: toRpx(40); margin-bottom: toRpx(40);
.redeem-name { .redeem-name {
font-size: toRpx(28); font-size: toRpx(28);
color: #808291; color: #808291;
} }
.redeem-value { .redeem-value {
font-size: toRpx(40); font-size: toRpx(40);
color: #181A1F; color: #181A1F;
...@@ -1152,6 +1218,7 @@ export default { ...@@ -1152,6 +1218,7 @@ export default {
} }
} }
} }
// .coupon-qrcode { // .coupon-qrcode {
// width: 100%; // width: 100%;
// // width: toRpx(544); // // width: toRpx(544);
...@@ -1176,6 +1243,7 @@ export default { ...@@ -1176,6 +1243,7 @@ export default {
align-items: center; align-items: center;
margin-left: auto; margin-left: auto;
color: #808291; color: #808291;
.copy { .copy {
margin-right: toRpx(8); margin-right: toRpx(8);
} }
...@@ -1193,6 +1261,10 @@ export default { ...@@ -1193,6 +1261,10 @@ export default {
margin-left: toRpx(32); margin-left: toRpx(32);
font-size: toRpx(28); font-size: toRpx(28);
color: #1F1F1F; color: #1F1F1F;
width: calc(100% - #{toRpx(300)});
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
} }
} }
...@@ -1208,6 +1280,7 @@ export default { ...@@ -1208,6 +1280,7 @@ export default {
.store-info p { .store-info p {
margin: 0; margin: 0;
} }
.notice-title { .notice-title {
display: flex; display: flex;
align-items: center; align-items: center;
...@@ -1217,16 +1290,18 @@ export default { ...@@ -1217,16 +1290,18 @@ export default {
margin-bottom: toRpx(16); margin-bottom: toRpx(16);
padding: 0 toRpx(26); padding: 0 toRpx(26);
} }
.usage-notice { .usage-notice {
background-color: #F5F7FA; background-color: #F5F7FA;
padding: toRpx(24) toRpx(6); padding: toRpx(24) toRpx(6);
border-radius: toRpx(24); border-radius: toRpx(24);
&.claimed-usage { &.claimed-usage {
margin-bottom: toRpx(56); margin-bottom: toRpx(56);
} }
} }
.claimed-notice {
} .claimed-notice {}
.usage-notice { .usage-notice {
.m-l-8 { .m-l-8 {
...@@ -1350,6 +1425,7 @@ export default { ...@@ -1350,6 +1425,7 @@ export default {
line-height: 46rpx; line-height: 46rpx;
margin-top: 16rpx; margin-top: 16rpx;
padding: 0 64rpx; padding: 0 64rpx;
.highlight { .highlight {
display: inline-block; display: inline-block;
color: #2C66F7; color: #2C66F7;
...@@ -1382,6 +1458,7 @@ export default { ...@@ -1382,6 +1458,7 @@ export default {
} }
} }
} }
.end-text { .end-text {
color: #999; color: #999;
text-align: center; text-align: center;
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!