Commit 4fed14ea by 杨北旺

个人中心

1 parent 5a43dd0e
Showing 77 changed files with 4827 additions and 4 deletions
...@@ -61,6 +61,27 @@ ...@@ -61,6 +61,27 @@
"pages": [ "pages": [
"pages/carLife/index" "pages/carLife/index"
] ]
},
{
"root": "packageMine",
"pages": [
"pages/setting/index",
"pages/address/index/index",
"pages/address/detail/detail",
"pages/order/index/index",
"pages/order/detail/detail",
"pages/order/complete/complete",
"pages/order/afterSale_step_one/afterSale_step_one",
"pages/order/afterSale_step_two/afterSale_step_two",
"pages/order/afterSale_step_three/afterSale_step_three",
"pages/order/afterSaleDetail/afterSaleDetail",
"pages/coupon/index/index",
"pages/coupon/success/success",
"pages/coupon/center/center",
"pages/coupon/detail/detail",
"pages/coupon/recommend/recommend",
"pages/coupon/usedDetail/usedDetail"
]
} }
], ],
"usingComponents": { "usingComponents": {
......
@import "assets/style/common.wxss"; @import "assets/style/common.wxss";
page { page {
background-color: #FFFFFF !important; background-color: #F8F8F8 !important;
color: #282829; color: #282829;
font-size: 28rpx; font-size: 28rpx;
--themeColor: #8A303A; --themeColor: #3772EC;
--btnColor: #8A303A; --btnColor: #3772EC;
--borderRadius: 8rpx; --borderRadius: 8rpx;
--margin: 32rpx; --margin: 32rpx;
/* 兼容 IOS<11.2 先constant再env */ /* 兼容 IOS<11.2 先constant再env */
--constantSafeAreaInsetBottom: constant(safe-area-inset-bottom); --constantSafeAreaInsetBottom: constant(safe-area-inset-bottom);
/* 兼容 IOS>11.2 */ /* 兼容 IOS>11.2 */
--envSafeAreaInsetBottom: env(safe-area-inset-bottom); --envSafeAreaInsetBottom: env(safe-area-inset-bottom);
--priceColor:#EC3C1F
} }
image { image {
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
}, },
"repository": { "repository": {
"type": "git", "type": "git",
"url": "http://192.168.3.233:8090/saas/mini-program/hmd" "url": "http://192.168.3.233:8090/saas/mini-program/zhwy"
}, },
"author": "", "author": "",
"license": "ISC", "license": "ISC",
......
// packageMine/pages/address/detail/detail.js
import mapApi from '~/utils/mapapi/mapapi'
const phoneRex = /^[1]([3-9])[0-9]{9}$/
Page({
/**
* 页面的初始数据
*/
data: {
userObj: {
receiveName: '',
phoneNumber: '',
region: [],
address: '',
isDefault: 0,
platformObj: {}
}
},
onLoad: function (options) {
if (options.id) {
wx.setNavigationBarTitle({
title: '编辑收货地址'
})
wx.p.api.mineApi.getUserAddress(options).then(data => {
data = wx.p.util.clearObjNull(data)
data.region = [data.province, data.city, data.area]
this.setData({
userObj: data
})
})
}
if (options.isChooseAddress) {
this.setData({
isChooseAddress: true
})
}
if (options.isDefault) {
this.setData({
'userObj.isDefault': 1
})
}
},
useLocation() {
let {
currentAddress: {
formatted_addresses,
address_component,
ad_info
}
} = this.data
this.setData({
'userObj.address': formatted_addresses.recommend,
'userObj.region': [address_component.province, address_component.city, address_component.district],
'userObj.areaId': ad_info.adcode
})
},
/**获取当前位置 */
getLocation() {
let {
currentAddress
} = this.data
if (currentAddress) return
this.setData({
unauthorized: false
})
wx.getLocation({
type: 'gcj02'
}).then(({
latitude,
longitude
}) => {
console.log(this)
this.setData({
current: true
})
mapApi.detailedAdrress([latitude, longitude]).then(detail => {
this.setData({
currentAddress: detail
})
})
})
.catch(err => {
wx.p.wxApi.showToast('获取位置失败')
})
},
/**打开授权设置 */
authAddress() {
this.setData({
showAuth: true
})
},
/**授权失败 */
authFail() {
this.setData({
unauthorized: true
})
},
/**授权成功 */
authSuccess() {
this.getLocation()
},
input(e) {
let {
target
} = e.currentTarget.dataset
let {
value
} = e.detail
this.setData({
[`userObj.${target}`]: value
})
},
blur(e) {
let {
value
} = e.detail
this.setData({
'userObj.address': value
})
},
save() {
let {
userObj,
isChooseAddress
} = this.data
try {
Object.keys(userObj).map(key => {
if (key == 'receiveName' && !userObj[key]) throw '请输入姓名'
if (key == 'phoneNumber') {
if (!userObj[key]) throw '请输入手机号'
if (!phoneRex.test(userObj[key])) throw '请输入正确的手机号'
}
if (Array.isArray(userObj[key]) && !userObj[key].length) throw '请选择省市区'
if (key == 'address' && !userObj[key]) throw '请填写详细地址'
})
} catch (error) {
wx.p.wxApi.showToast(error)
return
}
let [province, city, area] = userObj.region
let obj = {
...userObj,
province,
city,
area
}
delete obj.region
let target = obj.id ? 'updateUserAddress' : 'addUserAddress'
if (obj.id) {
delete obj.userId
delete obj.createTime
delete obj.updateTime
}
wx.p.api.mineApi[target](obj).then(() => {
wx.p.wxApi.showToast('操作成功')
setTimeout(() => {
if (isChooseAddress) {
wx.p.router.back(page => {
let contactAddress = `${province}${city}${area}${userObj.address}`
page.setData({
contactAddress,
contactInfo: {
contactAddress,
contactName: userObj.receiveName,
contactPhone: userObj.phoneNumber
}
})
}, 2)
} else {
wx.p.router.back()
}
}, 1.5e3)
})
},
/**选择地区 */
chooseArea(e) {
let {
value,
code
} = e.detail
let {
userObj
} = this.data
userObj.region = [value[0], value[1], value[2]]
userObj.provinceId = code[0]
userObj.cityId = code[1]
userObj.areaId = code[2]
this.setData({
userObj
})
},
setDefault() {
this.setData({
'userObj.isDefault': this.data.userObj.isDefault == 0 ? 1 : 0
})
},
showSelect() {
this.setData({
showAreaSelect: true
})
},
cancelProvince() {
this.setData({
showAreaSelect: false
})
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {}
})
\ No newline at end of file \ No newline at end of file
{
"navigationBarTitleText": "新建收货地址",
"usingComponents":{
"gl-textarea": "/components/GlTextarea/GlTextarea"
}
}
\ No newline at end of file \ No newline at end of file
/* packageMine/pages/address/detail/detail.wxss */
@import '../index/index.scss';
.layout {
padding: var(--margin);
}
.current {
padding: var(--margin);
background: #fff;
border-radius:var(--borderRadius);
height: 156rpx;
box-sizing: border-box;
.flex{
height: 100%;
}
}
.current .address-box {
display: flex;
align-items: flex-start;
font-size: var(--margin);
justify-content: space-between;
position: relative;
}
.current .address-box .address-icon{
position: absolute;
width: 36rpx;
height: 36rpx;
left: 0;
}
.current .address-info {
width: calc(100% - 178rpx);
box-sizing: border-box;
padding-left: 68rpx;
}
.current .address-info .address-title {
font-weight: 500;
margin-bottom: 12rpx;
}
.current .address-info .address {
color: #656566;
font-size: 28rpx;
}
.current .address-btn {
font-size: 24rpx;
background-color: var(--themeColor);
width: 168rpx;
height: 40rpx;
color: #fff;
}
.user-info {
margin-top: 24rpx;
padding: 0 var(--margin);
background-color: #fff;
font-size: 28rpx;
}
.user-info .item {
min-height: 108rpx;
display: flex;
align-items: center;
border-bottom: 2rpx solid #E3E3E6;
box-sizing: border-box;
padding: 26rpx 0;
}
.user-info .textarea {
border-bottom: none;
}
.user-info .item .label {
width: 192rpx;
}
.user-info .item .value {
width: calc(100% - 192rpx);
font-size: 28rpx;
}
.user-info .textarea {
align-items: flex-start;
padding-top: 26rpx;
}
.user-info .textarea .value{
height: 120rpx;
}
.default {
display: flex;
align-items: center;
font-size: 24rpx;
color: #2D2D2E;
margin-top: 24rpx;
}
.default icon {
margin-right: 8rpx;
}
.default-btn{
margin-top: 206rpx;
}
\ No newline at end of file \ No newline at end of file
<view class="layout">
<view class="current">
<block wx:if="{{!current}}">
<block wx:if="{{unauthorized}}">
<view class="flex" bindtap="authAddress">授权获取当前位置</view>
</block>
<block wx:else>
<view class="flex">
获取当前位置中...
</view>
</block>
</block>
<block wx:else>
<view class="address-box">
<view class="address-icon y-center">
<glsx-image src="mine/location.png"></glsx-image>
</view>
<view class="address-info">
<view class="address-title text-hide">{{currentAddress.formatted_addresses.recommend}}</view>
<view class="address text-hide">{{currentAddress.address}}</view>
</view>
<view class="address-btn text-center" bindtap="useLocation">使用当前定位</view>
</view>
</block>
</view>
<view class="user-info">
<view class="item">
<view class="label">
收货人
</view>
<view class="value">
<input bindblur="input" data-target="receiveName" maxlength="10" value="{{userObj.receiveName}}" type="text" placeholder="请输入姓名" placeholder-style="color:#B1B1B3;" />
</view>
</view>
<view class="item">
<view class="label">
手机号
</view>
<view class="value">
<input bindblur="input" data-target="phoneNumber" value="{{userObj.phoneNumber}}" type="number" maxlength="11" placeholder="请输入手机号" placeholder-style="color:#B1B1B3;" />
</view>
</view>
<picker value="{{userObj.region}}" mode="region" bindchange="chooseArea">
<view class="item">
<view class="label">
选择地区
</view>
<view class="value " style="color:{{userObj.region.length?'':'#B1B1B3'}}">
{{userObj.region[0]}}
<block wx:if="{{userObj.region.length}}">
{{userObj.region[0]}}{{userObj.region[1]}}{{userObj.region[2]}}
</block>
<block wx:else>请选择省/市/区</block>
</view>
</view>
</picker>
<view class="item textarea">
<view class="label">
详细地址
</view>
<view class="value">
<gl-textarea value="{{userObj.address}}" bindblur="blur" customMaxLength filterEmoji maxlength="30" placeholder="小区楼栋/乡村名称">
</gl-textarea>
</view>
</view>
</view>
<view class="default" bindtap="setDefault">
<block wx:if="{{userObj.isDefault == 1}}">
<icon type="success" size="24rpx" color="#3772EC"></icon>
</block>
<block wx:else>
<icon type="circle" size="24rpx" color="#E3E3E6"></icon>
</block>
设为默认地址
</view>
<view class="default-btn" bindtap="save">保存并使用</view>
</view>
<authorize scopeType="userLocation" bindfail="authFail" bindsuccess="authSuccess" show="{{showAuth}}"></authorize>
<glsx-privacy appletName="海马刀"></glsx-privacy>
\ No newline at end of file \ No newline at end of file
// packageMine/pages/address/index/index.js
Page({
/**
* 页面的初始数据
*/
data: {
addressList: []
},
jump(e) {
let {
id,
} = e.currentTarget.dataset, {
isChooseAddress,
addressList,
} = this.data, isDefault = addressList.length == 0
wx.p.router.go('/packageMine/pages/address/detail/detail', {
id,
isChooseAddress,
isDefault
})
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
this.setData(options)
},
chooseThis(e) {
let {
item
} = e.currentTarget.dataset, {
isChooseAddress,
} = this.data
if (isChooseAddress) {
wx.p.router.back(page => {
const contactAddress = `${item.province}${item.city}${item.area}${item.address}`
page.setData({
contactAddress,
contactInfo: {
contactAddress,
contactName: item.receiveName,
contactPhone: item.phoneNumber
},
isDefault: item.isDefault == 1
})
})
} else {
wx.p.router.go('/packageMine/pages/address/detail/detail', {
id: item.id,
})
}
},
getUserAddressList(showTips = '') {
wx.showLoading()
this.setData({
addressList: []
})
wx.p.api.mineApi.getUserAddressList().then(data => {
this.setData({
addressList: data
})
wx.hideLoading()
if(showTips) wx.p.wxApi.showToast(showTips)
})
},
chooseDefault(e) {
let {
item: {
id,
isDefault
},
item
} = e.currentTarget.dataset
if (isDefault != 0) return
wx.p.api.mineApi.setUserAddressDefault({
id
}).then(() => {
wx.p.wxApi.showToast('操作成功')
let {
isChooseAddress
} = this.data
if (isChooseAddress) {
wx.p.router.back(page => {
const contactAddress = `${item.province}${item.city}${item.area}${item.address}`
page.setData({
contactAddress,
contactInfo: {
contactAddress,
contactName: item.receiveName,
contactPhone: item.phoneNumber
},
isDefault: true,
})
})
} else {
this.getUserAddressList('默认地址更新成功')
}
})
},
del(e) {
let {
id
} = e.currentTarget.dataset
wx.showModal({
title: '温馨提示',
content: '是否删除当前地址?',
cancelText: '否',
confirmText: '是',
confirmColor: '#F13C3D'
}).then(res => {
if (res.confirm) {
wx.p.api.mineApi.delUserAddress({
id
}).then(() => {
wx.p.wxApi.showToast('删除成功')
setTimeout(() => {
this.getUserAddressList()
}, 1.5e3)
})
}
})
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
this.getUserAddressList()
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {}
})
\ No newline at end of file \ No newline at end of file
{
"navigationBarTitleText": "我的地址"
}
\ No newline at end of file \ No newline at end of file
/* packageMine/pages/address/index/index.wxss *//* packageMine/pages/address/index/index.wxss */
.layout{
padding-bottom: calc(100rpx + var(--constantSafeAreaInsetBottom));
padding-bottom: calc(100rpx + var(--envSafeAreaInsetBottom));
}
.address-item{
margin: var(--margin);
background-color: #fff;
border-radius:var(--borderRadius);
min-height: 234rpx;
padding: 0 var(--margin);
}
.address-item .top{
display: flex;
align-items: center;
padding-top: 34rpx;
justify-content: space-between;
}
.address-item .top .info{
width: calc(100% - 70rpx);
padding-bottom: 20rpx;
}
.address-item .top .info .user{
margin-bottom: 20rpx;
}
.address-item .top .info .user text{
margin-left: 48rpx;
}
.address-item .top .icon-box{
width: 70rpx;
min-height: 154rpx;
}
.address-item .top .icon {
width: var(--margin);
height: var(--margin);
}
.address-item .bottom{
height: 78rpx;
border-top: 2rpx solid #E3E3E6;
display: flex;
align-items: center;
justify-content: space-between;
font-size: 24rpx;
}
.address-item .bottom .choose {
display: flex;
align-items: center;
height: 100%;
}
.address-item .bottom .del {
display: flex;
align-items: center;
height: 100%;
color: #656566;
width: 100rpx;
justify-content: flex-end;
}
.address-item .bottom .choose.default{
color: var(--btnColor);
}
.address-item .bottom .choose icon{
margin-right: 20rpx;
}
.btn-box{
position: fixed;
bottom: 0;
left: 0;
width: 100%;
height: 100rpx;
background-color: #fff;
}
.btn-box .btn{
margin: 6rpx var(--margin);
background-color:var(--btnColor);
height: 88rpx;
color: #fff;
font-size: var(--margin);
border-radius:var(--borderRadius);
}
\ No newline at end of file \ No newline at end of file
<view class="layout">
<block wx:for="{{addressList}}" wx:key="index">
<view class="address-item" catchtap="chooseThis" data-item="{{item}}">
<view class="top">
<view class="info">
<view class="user">
{{item.receiveName}}
<text>{{platform?item.receiveMobile:item.phoneNumber}}</text>
</view>
<view wx:if="{{!platform}}" class="address">{{item.province}}{{item.city}}{{item.area}}{{item.address}}</view>
<view wx:if="{{platform}}" class="address">{{item.provinceName}}{{item.cityName}}{{item.countyName}}{{item.address}}</view>
</view>
<block wx:if="{{!isChooseAddress}}">
<view class="icon-box text-center" catchtap="jump" data-item="{{item}}" data-edit data-id="{{item.id}}">
<view class="sprite-icon icon-address-edit"></view>
</view>
</block>
</view>
<view class="bottom">
<view class="choose {{item.isDefault == 1?'default':''}}" catchtap="chooseDefault" data-item="{{item}}">
<icon type="{{item.isDefault == 1?'success':'circle'}}" size="28rpx" color="{{item.isDefault == 1?'#3772EC':'#E3E3E6'}}"></icon>
默认地址
</view>
<block wx:if="{{!isChooseAddress}}">
<view class="del" catchtap="del" data-item="{{item}}" data-id="{{item.id}}">删除</view>
</block>
</view>
</view>
</block>
</view>
<view class="btn-box isFullSucreen">
<view class="btn text-center" bindtap="jump">新增收货地址</view>
</view>
\ No newline at end of file \ No newline at end of file
Page({
data: {
couponsList: []
},
toReciveAll() {
let para = {
couponIdList: this.data.ids
}
wx.p.api.couponsApi.toReciveCard(para).then(res => {
if (res) {
wx.p.router.go('/packageMine/pages/coupon/success/success')
}
})
},
/**获取礼券 */
getCoupons() {
let para = {
discountTypes: [3]
}
let ids = []
wx.p.api.couponsApi.getHomeCardData(para).then(res => {
res.list.map(item => {
if (item.effectiveStartTime) {
item.effectiveStartTime = new Date(item.effectiveStartTime).format('yyyy.MM.dd')
item.effectiveEndTime = new Date(item.effectiveEndTime).format('yyyy.MM.dd')
}
ids.push(item.id)
return item
})
this.setData({
couponsList: res.list,
ids
})
})
},
onLoad() {
this.getCoupons()
}
})
{
"navigationBarTitleText": "领券中心",
"usingComponents": {
"coupon-item": "../components/CouponsItem/element"
}
}
\ No newline at end of file \ No newline at end of file
page {
background: #F9F7F7;
}
.center-page {
box-sizing: border-box;
padding: 0 32rpx;
}
.btn_wrapper {
/* width: calc(100% - 64rpx); */
width: 100%;
background: var(--btnColor);
height: 88rpx;
text-align: center;
line-height: 88rpx;
border-radius: 8rpx;
font-size: 32rpx;
color: #FFFFFF;
margin-top: 100rpx;
margin-bottom: 210rpx;
/* position: fixed;
bottom: 210rpx;
left: 50%;
transform: translate(-50%, 0);
z-index: 10; */
}
\ No newline at end of file \ No newline at end of file
<view class="center-page">
<block wx:for="{{couponsList}}" wx:key="index">
<coupon-item mode="center" coupons="{{item}}"></coupon-item>
</block>
<view class="btn_wrapper" bind:tap="toReciveAll">一键领取</view>
</view>
\ No newline at end of file \ No newline at end of file
Component({
properties: {
coupons: {
type: Object,
value: {}
},
mode: {
type: String,
value: 'coupon' //coupon卡券 center领券中心
},
btnStatus: {
type: Number,
value: 0
},
useMemberType: Number,
hideBtn: Boolean,
couponStyle: String
},
data: {
// 2 折扣券,3 代金券,4 兑换券,7 服务券
IMGURL: wx.$imgUrl
},
methods: {
toRecive() {
let para = {
couponIdList: [this.data.coupons.id]
}
wx.p.api.couponsApi.toReciveCard(para).then(res => {
if (res) {
wx.p.router.go('/packageMine/pages/coupon/success/success')
}
})
},
toDetail() {
let {
coupons,
useMemberType
} = this.data, {
discountType,
useChannel,
id
} = coupons, detailInfo = {
xx: 'xx'
}
if (discountType == 2 || discountType == 4) {
wx.p.router.go('/packageMall/pages/coupon/coupon', {
userCouponId: id,
useMemberType,
detailInfo
})
return
}
/**线上商品代金券 */
if (discountType == 3 && useChannel == 1) {
wx.p.router.go('/packageMine/pages/coupon/recommend/recommend', {
couponInfo: coupons
})
return
}
wx.p.router.go('/packageMine/pages/coupon/detail/detail', {
item: coupons
})
}
}
})
\ No newline at end of file \ No newline at end of file
{
"component": true
}
\ No newline at end of file \ No newline at end of file
<!-- <view class="box_wrapper" style="{{couponStyle}}; background-image: url({{btnStatus == 0 ? couponBaseList[coupons.discountType]:unCouponBaseList[coupons.discountType]}});"> -->
<view class="box_wrapper" style="{{couponStyle}}">
<view class="bg">
<glsx-image webp src="mine/coupon/{{btnStatus == 0 ? '' :'un-'}}coupon-{{coupons.discountType}}.png"></glsx-image>
</view>
<view class="container">
<view class="{{coupons.discountType==4 || coupons.discountType==7 ? '':'left_icon_box'}}">
<!-- <image wx:if="{{btnStatus==0}}" class="left_bg" src="../../packageMine/images/coupons/coupons_active.png" />
<image wx:else class="left_bg" src="../../packageMine/images/coupons/coupons.png" /> -->
<!-- <view wx:if="{{coupons.discountType==7}}" class="left_text_one left_text_four">
<text class="anText">券</text>
<text wx:if="{{coupons.useType&&coupons.effectiveType!=3}}">{{ coupons.usedAmount }}/{{ coupons.useAllAmount }}</text>
<text wx:else>不限次数</text>
</view> -->
<view wx:if="{{coupons.discountType==3}}" class="left_text_one left_text_two {{btnStatus == 0 ? 'brightColor':'darkColor'}}">
<text class="price_icon">¥</text>
<text>{{coupons.denomination}}</text>
</view>
<view wx:if="{{coupons.discountType==2}}" class="left_text_one left_text_two {{btnStatus == 0 ? 'brightColor':'darkColor'}}">
<!-- <text class="anText">券</text> -->
<text class="anText" wx:if="{{coupons.discountIntensity}}">{{coupons.discountIntensity}}</text>
<text class="discount" wx:if="{{coupons.discountIntensity}}">折</text>
</view>
<!-- <view class="left_text_one">8.5折</view> -->
<!-- <view class="left_text_one left_text_two">
</view> -->
<!-- <view class="left_text_one left_text_three">满99可用</view> -->
</view>
<view class="main_box {{coupons.discountType==4 || coupons.discountType==7 ? 'leftMargin':''}}">
<view class="title_text {{btnStatus == 0 ? 'brightColor':'darkColor'}}">{{coupons.couponName}}</view>
<view wx:if="{{coupons.useType==0 && coupons.discountType==7}}" class="h4_text {{btnStatus == 0 ? 'describeColor':'darkColor'}}">不限次数</view>
<view wx:if="{{coupons.useType==1 && coupons.discountType==7}}" class="h4_text {{btnStatus == 0 ? 'describeColor':'darkColor'}}">可用{{coupons.useAmount}}次</view>
<view wx:if="{{coupons.useType==2 && coupons.discountType==7}}" class="h4_text {{btnStatus == 0 ? 'describeColor':'darkColor'}}">{{coupons.useLimitDays}}天可用{{coupons.useAmount}}次</view>
<!-- <view wx:if="{{coupons.discountType==3}}" style="height:1px" class="drive"></view> -->
<view wx:if="{{coupons.useBarriers==1 && coupons.discountType!=4}}" class="h4_text {{btnStatus == 0 ? 'describeColor':'darkColor'}}">无门槛</view>
<view wx:if="{{coupons.useBarriers==2 && coupons.discountType!=4}}" class="h4_text {{btnStatus == 0 ? 'describeColor':'darkColor'}}">满{{coupons.full}}元可用</view>
<view wx:if="{{coupons.effectiveType==3}}" class="h4_text {{btnStatus == 0 ? 'describeColor':'darkColor'}}">永久有效</view>
<view wx:if="{{coupons.effectiveType==2}}" class="h4_text {{btnStatus == 0 ? 'describeColor':'darkColor'}}">{{coupons.receiveStartTime}}-{{coupons.receiveEndTime}}</view>
<view wx:if="{{coupons.effectiveType==1}}" class="h4_text {{btnStatus == 0 ? 'describeColor':'darkColor'}}">有效期至{{coupons.receiveEndTime}}</view>
<!-- <view wx:else class="h4_text drive">{{coupons.receiveStartTime}}-{{coupons.receiveEndTime}}</view> -->
<!-- <view wx:if="{{coupons.effectiveType==1}}" class="h4_text drive">{{coupons.effectiveStartTime}}-{{coupons.effectiveEndTime}}</view> -->
</view>
<!-- <view wx:if="{{mode=='center'}}" class="box_btn box_btn_color" bind:tap="toRecive">领取</view> -->
<block wx:if="{{!hideBtn}}">
<view wx:if="{{mode=='coupon'&&btnStatus==0}}" class="box_btn box_btn_color" bind:tap="toDetail">去使用</view>
<view wx:if="{{mode=='coupon'&&btnStatus==1}}" class="box_btn box_btn_color box_btn_color_grey" bind:tap="toDetail">去查看</view>
<view wx:if="{{mode=='coupon'&&btnStatus==2}}" class="box_btn box_btn_color box_btn_color_grey" bind:tap="toDetail">去查看</view>
</block>
</view>
</view>
\ No newline at end of file \ No newline at end of file
page {
background: white;
}
.box_wrapper {
width: 100%;
height: 162rpx;
/* background: #FFFFFF; */
/* border-radius: 8rpx; */
margin-top: 19rpx;
display: flex;
align-items: center;
position: relative;
box-sizing: border-box;
background-size: cover;
}
.left_icon_box {
width: 156rpx;
height: 156rpx;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
position: relative;
}
.left_bg {
position: absolute;
left: 0;
right: 0;
top: 0;
bottom: 0;
width: 156rpx;
height: 156rpx;
z-index: 1;
}
.left_text_one {
font-size: 48rpx;
font-weight: 600;
z-index: 2;
}
.left_text_two {
display: flex;
align-items: flex-end;
}
.left_text_four {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
}
.left_text_three {
font-size: 20rpx;
margin-top: 6rpx;
}
.left_tran {
transform: translateX(-120rpx);
}
.anText {
font-size: 48rpx;
/* color: rgba(white, white, white, 0.45); */
font-weight: 600;
/* color: #FFF; */
/* opacity: 0.45; */
}
.price_icon {
font-size: 24rpx;
/* margin-right: 4rpx; */
margin-bottom: 7rpx;
font-weight: 500;
}
.main_box {
height: 156rpx;
box-sizing: border-box;
padding: 24rpx 24rpx 24rpx 0rpx;
justify-content: space-evenly;
display: flex;
flex-direction: column;
z-index: 1;
}
.box_btn {
position: absolute;
right: 47rpx;
top: 50%;
transform: translate(0, -50%);
width: 120rpx;
height: 44rpx;
/* background: #B1B1B3; */
text-align: center;
line-height: 44rpx;
font-size: 28rpx;
font-weight: 600;
}
.box_btn_color {
/* background:#FC5B32; */
color:#FC5B32;
}
.box_btn_color_grey {
color: #6D6D6D;
}
.title_text {
color: #282829;
font-weight: 600;
color: #282829;
font-size: 28rpx;
width: 309rpx;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
.h4_text {
font-weight: 400;
color: #B1B1B3;
font-size: 20rpx;
}
.leftMargin {
padding-left: 32rpx;
}
.brightColor {
color:#FC5B32;
}
.darkColor {
color: #6D6D6D;
}
.describeColor {
color: #D83C14;
}
.discount {
font-size: 20rpx;
font-weight: 500;
margin-bottom: 10rpx;
}
.box_wrapper .bg{
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
}
.box_wrapper .container {
display: flex;
align-items: center;
position: relative;
z-index: 1;
width: 100%;
height: 100%;
}
import QR from '~/lib/wxqrcode'
Page({
data: {
coupon: {
discountType: 7
},
detailInfo: {},
failure: false,
future: false,
dayDiff: 0,
hourDiff: 0,
minDiff: 0
},
jump(e) {
let { item } = e.currentTarget.dataset
wx.openLocation({
latitude: item.lat,
longitude: item.lng,
name: item.merchantName,
address: item.merchantAddress
})
},
getDetailData(id) {
let para = {
userCouponId: id
}
wx.p.wxApi.showLoading('加载中...')
wx.p.api.couponsApi.couponsDetail(para).then(res => {
wx.hideLoading()
let qrcodeURL = QR.createQrCodeImg(`t=2&c=${res.verificationCode}`)
let failure = false
let future = false
res.receiveTime = new Date(res.receiveTime).format('yyyy.MM.dd hh:mm:ss')
res.verificationCode = res.verificationCode.replace(/(.{4})/g, '$1 ')
if (res.couponState == 2) {
failure = true
} else if (res.couponState == 1) {
failure = false
} else if (res.couponState == 3) {
future = true
} else if (res.couponState == 4) {
future = true
} else if (res.couponState == 5) {
failure = true
}
let dayDiff = 0
let hourDiff = 0
let minDiff = 0
if (future) {
dayDiff = res.nextLimitDays
hourDiff = res.nextLimitHours
minDiff = res.nextLimitMin
}
if (res.list.length) {
res.list.map(el => {
el.verificationTime = new Date(el.verificationTime).format('yyyy-MM-dd hh:mm:ss')
return el
})
}
res.receiveEndTime = new Date(res.receiveEndTime).format('yyyy.MM.dd hh:mm:ss')
res.receiveStartTime = new Date(res.receiveStartTime).format('yyyy.MM.dd hh:mm:ss')
this.setData({
detailInfo: res,
future,
failure,
dayDiff,
hourDiff,
minDiff,
qrcodeURL,
coupon: res,
flag: true
})
})
},
onLoad(options) {
let couponInfo = options.item
this.getDetailData(couponInfo.id)
this.setData({
couponInfo
})
// wx.$Track.setTrack(
// {
// couponInfo
// },
// 6
// )
}
})
{
"navigationBarTitleText": "卡券详情",
"usingComponents": {
"coupon-item": "../components/CouponsItem/element"
}
}
\ No newline at end of file \ No newline at end of file
page {
background: #F7F8FA !important;
/* background: #f5f5f5; */
}
.detail-page {
box-sizing: border-box;
padding: 32rpx 32rpx 20rpx;
}
.an-page {
box-sizing: border-box;
padding: 32rpx;
}
.wrapper {
width: 100%;
background: #FFFFFF;
border-radius: 8rpx;
}
.top_element_wrap {
display: flex;
box-sizing: border-box;
border-bottom: 2rpx solid #EFF0F2;
}
.coupon {
height: 196rpx;
border-radius: 8rpx;
margin: 0 32rpx;
}
.icon_box {
width: 156rpx;
height: 156rpx;
display: flex;
align-items: center;
justify-content: center;
position: relative;
}
.ele_icon {
position: absolute;
width: 100%;
height: 100%;
left: 0;
right: 0;
top: 0;
bottom: 0;
z-index: 1;
}
.icon_text {
font-size: 36rpx;
font-family: PingFangSC-Semibold, PingFang SC;
font-weight: 600;
color: #FFFFFF;
position: relative;
z-index: 2;
}
.ele_conetent_box {
box-sizing: border-box;
padding-left: 20rpx;
}
.title_wrap {
margin-top: 64rpx;
box-sizing: border-box;
padding-left: 20rpx;
}
.code_wrap {
margin-top: 36rpx;
box-sizing: border-box;
width: 100%;
text-align: center;
}
.code-text {
font-size: 64rpx;
font-family: DINAlternate-Bold, DINAlternate;
font-weight: bold;
color: #FC5B32;
letter-spacing: 20rpx;
}
.code_box {
width: calc(100% - 64rpx);
height: 140rpx;
background: #979797;
margin: 0 auto;
margin-top: 36rpx;
}
.html-wrap {
width: 100%;
box-sizing: border-box;
padding: 0 20rpx;
word-wrap: break-word;
}
.title-text {
font-size: 28rpx;
font-weight: 600;
color: #282829;
margin-top: 4rpx;
}
.min-text {
font-size: 24rpx;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #B1B1B3;
margin-top: 2rpx;
}
.date-text {
margin-top: 38rpx;
}
.code-tip {
margin-top: 10rpx;
text-align: center;
}
.drive_line {
width: 100%;
height: 2rpx;
background: #EFF0F2;
}
.shop_info_wrap {
box-sizing: border-box;
padding: 0 20rpx;
margin-top: 24rpx;
}
.shop_header {
display: flex;
align-items: center;
}
.header_img {
width: 40rpx;
height: 40rpx;
border-radius: 50%;
}
.shop_title {
color: #282829;
font-size: 28rpx;
padding-left: 28rpx;
font-weight: 400;
}
.shop_adress {
width: 100%;
font-size: 24rpx;
font-weight: 400;
color: #656566;
margin-top: 24rpx;
}
.shop_date {
font-size: 24rpx;
font-weight: 400;
color: #656566;
margin-top: 8rpx;
}
/* 服务券 */
.other_wrapper {
width: 100%;
}
.an_title_text {
font-size: 32rpx;
font-weight: 500;
color: #333;
margin-bottom: 20rpx;
}
.an_min_title_text {
text-align: center;
font-size: 22rpx;
font-weight: 500;
color: #B1B1B3;
margin-top: 10rpx;
}
/* .code_widget {
width: 100%;
height: 364rpx;
box-sizing: border-box;
background: #FEFFFE;
border-radius: 8rpx;
margin-top: 32rpx;
padding: 32rpx 0;
padding-top: 32rpx;
padding-bottom: 32rpx;
position: relative;
} */
.code_failture {
position: absolute;
left: 50%;
top: 154rpx;
transform: translate(-50%, 0);
padding: 10rpx 44rpx;
color: #FFFFFF;
background: #999999;
border-radius: 16rpx;
}
.code_future {
position: absolute;
left: 50%;
top: 144rpx;
transform: translate(-50%, 0);
padding: 10rpx 50rpx;
color: #FC5B32;
background: #FDDED5;
border-radius: 16rpx;
}
.code_text_red {
font-size: 28rpx;
text-align: center;
line-height: 40rpx;
}
.mar5 {
margin-bottom: 10rpx;
}
.iamge_qr_wrap {
width: 280rpx;
height: 280rpx;
position: relative;
margin: 24rpx auto;
}
.qrcodeimage {
width: 280rpx;
height: 280rpx;
}
.qrBtn {
/* position: absolute;
left: 50%;
top: 50%;
transform: translate(-50%, -50%);
width: 236rpx;
height: 64rpx; */
display: flex;
/* align-items: center; */
justify-content: center;
/* background: #FFFFFF;
border: 2rpx solid #979797;
box-shadow: 0px 4rpx 8rpx 0px rgba(0, 0, 0, 0.29);
border-radius: 16rpx; */
font-size: 28rpx;
margin: 24rpx 0 12rpx;
/* line-height: 40px; */
/* color: #656566;
font-weight: 400; */
}
.qrBtns {
position: absolute;
left: 50%;
top: 50%;
transform: translate(-50%, -50%);
display: flex;
align-items: center;
justify-content: center;
font-size: 28rpx;
font-weight: 400;
color: #FFFFFF;
line-height: 32rpx;
width: 181rpx;
height: 84rpx;
background: #000;
border-radius: 8rpx;
opacity: 0.7;
}
.op30 {
opacity: 0.3;
}
.qrText {
color: #FC5B32;
}
.code_main_text {
text-align: center;
display: flex;
align-items: center;
justify-content: center;
font-size: 32rpx;
}
.count_text {
margin-left: 10rpx;
font-weight: 600;
}
/* .useed_widget {
width: 100%;
height: 554rpx;
box-sizing: border-box;
background: #FEFFFE;
margin-top: 32rpx;
padding: 32rpx 0;
border-radius: 8rpx;
} */
.step_wrapper {
display: flex;
align-items: center;
justify-content: center;
margin-top: 40rpx;
}
.step_icon {
width: 92rpx;
height: 92rpx;
margin-bottom: 20rpx;
}
.step_arrpw {
width: 46rpx;
height: 33rpx;
margin: 0 24rpx;
}
.step_box {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
}
.desc_wrapper {
padding: 0 24rpx;
color: #B1B1B3;
font-size: 28rpx;
margin-top: 40rpx;
}
.note_line {
box-sizing: border-box;
/* padding: 0 24rpx; */
/* margin-bottom: 20rpx; */
line-height: 48rpx;
/* display: flex;
align-items: center;
justify-content: space-between; */
}
.line_text {
font-size: 24rpx;
color: #666;
}
.price_icon {
font-size: 20rpx;
margin-right: 4rpx;
}
.code_text_grey {
color: #B1B1B3;
}
.box {
padding: 0 32rpx 40rpx 32rpx;
}
.box-X {
border-radius: 8rpx;
background-color: #fff;
padding: 24rpx 24rpx 40rpx;
}
.box .title {
font-size: 32rpx;
padding-bottom: 24rpx;
font-weight: 500;
}
.box .goods {
margin-top: 24rpx;
display: flex;
align-items: center;
height: 160rpx;
}
.box .goods .icon {
width: 160rpx;
height: 100%;
overflow: hidden;
border-radius: 8rpx;
margin-right: 20rpx;
}
.box .goods .info {
width: calc(100% - 180rpx);
height: 100%;
display: flex;
flex-direction: column;
justify-content: space-between;
}
.box .goods .info .name {
font-size: 30rpx;
color: #333;
}
.box .goods .info .price {
display: flex;
color: #FC5B32;
font-weight: 500;
}
.box .goods .info .price-X {
margin-top: -8rpx;
font-size: 36rpx;
font-family: DINAlternate-Bold, DINAlternate;
}
.couponBox {
border-radius: 8rpx;
background-color: #fff;
padding: 32rpx 32rpx 20rpx 32rpx;
margin: 0 0 20rpx;
box-shadow: 0rpx 8rpx 16rpx 0rpx rgba(224, 224, 224, 0.5);
}
.note_line .line_text_name {
font-size: 28rpx;
color: #333;
}
.note_line .line {
height: 2rpx;
background: #EEE;
margin: 16rpx 0 14rpx;
}
.couponBox .couponBox-X {
max-width: 610rpx;
line-height: 48rpx;
}
.couponBox .couponBox-X .titleDay {
font-size: 28rpx;
font-weight: 500;
color: #333;
}
.titleDay_text {
font-size: 24rpx;
color: #666;
}
.darkColor {
color: #666;
}
.couponBox .title {
font-size: 32rpx;
font-weight: 500;
color: #333;
}
.couponBox .store-box {
background: #F9F9F9;
border: 2rpx solid #E9E9E9;
border-radius: 8rpx;
padding: 16rpx 32rpx;
margin-bottom: 18rpx;
}
.couponBox .store-box:last-child {
margin-bottom: 0;
}
.couponBox .storeName {
font-size: 28rpx;
color: #333;
margin-bottom: 8rpx;
}
.couponBox .businessTime {
font-size: 24rpx;
color: #999;
padding-bottom: 18rpx;
}
.couponBox .line {
height: 2rpx;
background: #EEE;
}
.couponBox .addressBox {
padding-top: 20rpx;
font-size: 24rpx;
color: #666;
display: flex;
align-items: center;
}
.couponBox .addressBox .navigation {
width: 32rpx;
height: 32rpx;
}
.timeColor {
color: #999;
}
.changeColor {
color: #333;
}
.numberColor {
color: #B4B4B4;
}
.couponBox .topBox {
display: flex;
}
.couponBox .topBox .baseImage {
width: 140rpx;
height: 138rpx;
background-size: cover;
position: absolute;
right: 24rpx;
top: 22rpx;
}
.couponBox .topBox .title_text {
font-size: 36rpx;
font-weight: 600;
margin-bottom: 20rpx;
max-width: 510rpx;
}
.couponBox .lines {
height: 2rpx;
background: #EEE;
margin: 32rpx 0 30rpx;
}
.couponBox .process {
display: flex;
align-items: center;
justify-content: center;
margin-bottom: 4rpx;
}
.process .process_text {
margin-left: 4rpx;
font-size: 24rpx;
color: #333;
}
.process image {
width: 24rpx;
height: 24rpx;
}
.process .rightArrow {
padding: 0 40rpx;
}
\ No newline at end of file \ No newline at end of file
// index.js
// 获取应用实例
Page({
data: {
tabs: ['店铺优惠券', '权益优惠券'],
curTabIndex: 0,
couponsList: [],
imgBaseURL: 'https://img01.glsx.com.cn/weapp/resource/equity-h5-new/mini/',
showGiftsModal: false,
giftsList: [],
haveCouponsList: []
},
jump(e) {
let {
item
} = e.currentTarget.dataset
let url = '/packageMine/pages/order/detail/detail'
wx.p.router.go(url, item)
},
state(e) {
let {
key
} = e.currentTarget.dataset
let {
couponsList,
haveCouponsList
} = this.data
couponsList[key].checkCoupon = !couponsList[key].checkCoupon
if (!couponsList[key].checkCoupon) {
couponsList[key].userCouponList = haveCouponsList[key].slice(0, 4)
} else {
couponsList[key].userCouponList = haveCouponsList[key]
}
this.setData({
couponsList
})
},
changeTab(e) {
let {
showLogin
} = this.data
if(showLogin) return
this.data.haveCouponsList = []
this.setData({
curTabIndex: e.detail,
couponsList: [],
flag: false
})
this.getCouponsList()
},
bottomToRefresh(e) {
let isBottom = e.detail.direction
if (isBottom == 'bottom') {
//刷新下一页
}
},
getCouponsList() {
wx.p.wxApi.showLoading('加载中...')
let {
curTabIndex,
isMerchant
} = this.data
let {merchantId} = wx.p.storage.get('merchant_info')
let para = {
useMemberType: 0
}
if (curTabIndex == 1) para.discountType = 8 //线上优惠券加上这个参数
if (!isMerchant) para.merchantId = merchantId
wx.p.api.couponsApi.getCardData(para).then(res => {
wx.hideLoading()
let list = res.map(item => {
item.checkCoupon = false
item.userCouponList.map((itm, index) => {
itm.receiveStartTime = new Date(itm.receiveStartTime).format('yyyy.MM.dd')
if (itm.effectiveType == 1) {
itm.receiveEndTime = new Date(itm.receiveEndTime).format('yyyy.MM.dd hh:mm:ss')
} else {
itm.receiveEndTime = new Date(itm.receiveEndTime).format('yyyy.MM.dd')
}
itm.discountIntensity = itm.discountIntensity / 100
return itm
})
this.data.haveCouponsList.push(item.userCouponList)
return item
})
list = res.map(item => {
if (item.userCouponList.length > 4 && curTabIndex != 1) {
item.userCouponList = item.userCouponList.slice(0, 4)
}
return item
})
this.setData({
couponsList: list,
haveCouponsList: this.data.haveCouponsList,
flag: true
})
})
},
async onLoad(options) {
const showLogin = await wx.p.router.intercept(false)
this.setData({
showLogin
})
//判断只展示当前门店的
if (options.isMerchant == 1) {
this.setData({
isMerchant: true
})
}
if (options.pageFrom == 'directional') {
this.setData({
showGiftsModal: true,
giftsList: options.list
})
}
this.getCouponsList()
},
// ***********定向礼包相关内容***********
clickClose() {
this.setData({
showGiftsModal: false
})
},
goInvolidPage() {
wx.p.router.go('../usedDetail/usedDetail', {
isOnline: this.data.curTabIndex
})
},
// 去使用
toUseGifts(e) {
let {
item
} = e.currentTarget.dataset
let {
discountType,
useChannel,
id
} = item
if (discountType == 2 || discountType == 4) {
wx.p.router.go('/packageMall/pages/coupon/coupon', {
userCouponId: id,
useMemberType: item.useMemberType
})
return
}
/**线上商品代金券 */
if (discountType == 3 && useChannel == 1) {
if (item.useMemberType == 1) {
wx.p.wxApi.showToast('代金券已使用')
return
}
wx.p.router.go('/packageMine/pages/coupon/recommend/recommend', {
couponInfo: item
})
return
}
wx.p.router.go('/packageMine/pages/coupon/detail/detail', {
item
})
},
toUseConpon(e) {
const {
brandName,
goodsId,
id,
goodsLogo,
appearance,
goodsName,
couponId
} = e.currentTarget.dataset.item
let path = '/packageEquity/pages/commodity/detail/detail'
let param = {
supplier: 'HW',
brandName,
id: goodsId,
couponsId: id,
couponId
}
if (appearance == 2) {
path = '/packageEquity/pages/commodity/chargeDetail/chargeDetail'
param.productName = goodsName
param.icon = goodsLogo
}
wx.p.router.go(path, {
inType: 'game',
param
})
}
})
\ No newline at end of file \ No newline at end of file
{
"usingComponents": {
"coupon-item": "../components/CouponsItem/element",
"tab":"/components/Tab/Tab"
},
"navigationBarTitleText": "我的卡券"
}
\ No newline at end of file \ No newline at end of file
/* packageMine/pages/coupon/index/index.wxss */
/**index.wxss**/
::-webkit-scrollbar {
width: 0;
height: 0;
color: transparent;
}
page {
background: #F9F7F7;
}
.tab_widget {
width: 100%;
height: 92rpx;
background: #F9F7F7;
}
.tab_element {
width: 120rpx;
height: 92rpx;
position: relative;
color: #707071;
font-size: 36rpx;
display: flex;
align-items: center;
justify-content: center;
font-weight: 400;
}
.tab_element_active {
font-size: 40rpx;
color: #2D2D2E;
font-weight: 500;
}
.active_tab_line {
width: 48rpx;
height: 8rpx;
background: #FC5B32;
border-radius: 2rpx;
position: absolute;
left: 50%;
bottom: 0;
transform: translate(-50%, 0);
}
.content_widget {
box-sizing: border-box;
/* padding: 0 32rpx; */
}
.box_wrapper {
width: 100%;
box-sizing: border-box;
padding: 20rpx;
display: flex;
align-items: center;
position: relative;
margin-top: 24rpx;
}
.left_icon_box {
width: 156rpx;
height: 156rpx;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
position: relative;
}
.left_bg {
position: absolute;
left: 0;
right: 0;
top: 0;
bottom: 0;
width: 156rpx;
height: 156rpx;
z-index: 1;
}
.left_text_one {
font-size: 36rpx;
font-weight: 600;
color: #FFFFFF;
z-index: 2;
}
.left_text_two {
display: flex;
align-items: flex-end;
}
.left_text_three {
font-size: 20rpx;
margin-top: 6rpx;
}
.price_icon {
font-size: 20rpx;
margin-right: 4rpx;
}
.main_box {
height: 156rpx;
box-sizing: border-box;
padding: 4rpx 0 4rpx 20rpx;
}
.box_btn {
position: absolute;
right: 20rpx;
top: 50%;
transform: translate(0, -50%);
width: 120rpx;
height: 44rpx;
background: #B1B1B3;
border-radius: 22rpx;
color: #FFF;
font-size: 20rpx;
text-align: center;
line-height: 44rpx;
}
.title_text {
color: #282829;
font-weight: 600;
color: #282829;
font-size: 28rpx;
}
.h4_text {
font-weight: 400;
color: #B1B1B3;
font-size: 24rpx;
}
.drive {
margin-top: 38rpx;
}
.involid_btn{
display: flex;
justify-content: center;
}
.view_involid{
height: 48rpx;
line-height: 48rpx;
border: 2rpx solid #999999;
border-radius: 24rpx;
color: #999999;
width: 204rpx;
text-align: center;
display: flex;
align-items: center;
justify-content: center;
}
.view_involid .text{
height: 48rpx;
line-height: 48rpx;
}
.view_involid .right{
width: 24rpx;
height: 24rpx;
// vertical-align: middle;
}
.no_data {
padding-top: 48rpx;
display: flex;
flex-direction: column;
align-items: center;
margin-bottom: 36rpx;
}
.nodata_bg {
width: 320rpx;
height: 320rpx;
}
.nodata_text {
color: #B1B1B3;
font-size: 28rpx;
line-height: 44rpx;
margin-top: 8rpx;
}
/* 定向礼包弹框 */
.flex_ccc {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
}
.gifts_modal {
position: fixed;
left: 0;
right: 0;
top: 0;
right: 0;
background: rgba(0, 0, 0, 0.66);
width: 100%;
height: 100%;
z-index: 999999;
}
.gifts_wrap {
width: 100%;
height: 100%;
}
.gifts_wrapper {
width: 100%;
/* height: 337rpx; */
position: relative;
}
/*自定义背景颜色*/
.custom_banner_wrap{
width: 86%;
min-height: 170rpx;
/* background: linear-gradient(-180deg, #FE7534, #FF4815); */
position: absolute;
top:51.3%;
left: 50%;
transform: translateX(-50%);
z-index: -1;
/* border-radius:0 0 32rpx 32rpx; */
}
.custom_box{
height: 170rpx;
}
.gifts_modal_bg {
width: 87.3%;
height: 51.3%;
}
.gifts_modal_btn {
width: 39%;
height: 102rpx;
margin-top: 56rpx;
}
.gifts_content_wrap {
width: calc(87.3% - 52rpx);
height: 64%;
/* background: #FFFFFF; */
position: absolute;
left: 50%;
bottom: 6rpx;
transform: translate(-50%, 0);
overflow-x: hidden;
overflow-y: scroll;
}
.gifts_modal_bottom_bg {
position: absolute;
left: 50%;
bottom: 6rpx;
transform: translate(-50%, 0);
width: 83.2%;
height: 87rpx;
}
.gifts_item_wrap {
width: 100%;
height: 170rpx;
position: relative;
}
.gifts_item_bg {
width: 100%;
height: 170rpx;
}
.gifts_po_wrap {
position: absolute;
left: 0;
top: 0;
height: 170rpx;
width: 100%;
display: flex;
align-items: center;
justify-content: space-between;
}
.left_widget {
box-sizing: border-box;
padding:0 0 0 40rpx;
width: 70%;
}
.coup_title{
font-size: 30rpx;
font-weight: 400;
color: #1A1919;
width: 70%;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
.coup_tip {
font-size: 24rpx;
font-weight: 400;
color: #817F7C;
margin-top: 19rpx;
}
.right_widget{
padding-right: 32rpx;
}
.gifts_to_use_bg{
width: 120rpx;
height: 46rpx;
}
/**小于2的样式*/
.mini_widget{
width: 100%;
min-height: 207rpx;
}
.mini_header_bg{
width: 87.3%;
height: 207rpx;
}
.mini_box_wrap{
width: 86.3%;
height: 281rpx;
position: relative;
box-sizing: border-box;
padding: 0 29rpx;
}
.mini_box_bg{
width: 100%;
height: 345rpx;
position: absolute;
top: -54rpx;
left: 0;
right: 0;
z-index: -1;
}
.storeName {
margin-top: 30rpx;
font-size: 32rpx;
font-weight: 500;
color: #282829;
/* display: inline-block; */
}
.storeWidth {
max-width: 477rpx;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
.stretch {
font-size: 32rpx;
font-weight: 500;
color: #999;
margin-left: 10rpx;
}
.stretchColor {
color: #FC5B32;
font-size: 32rpx;
font-weight: 500;
margin-left: 10rpx;
}
/* .listWidth {
max-height: 810rpx;
overflow: hidden;
white-space: nowrap;
} */
.checkList {
justify-content: center;
margin-top: 18rpx;
}
.checkList .check {
font-size: 24rpx;
color: #999;
}
.state {
width: 24rpx;
height: 24rpx;
margin-left: 10rpx;
}
.associatedOrder {
display: flex;
font-size: 24rpx;
padding-top: 8rpx;
}
.associatedOrder .order {
color: #666;
}
.associatedOrder .order-X {
color: #333;
max-width: 337rpx;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
.associatedOrder .checkOrder {
color: #FC5B32;
position: absolute;
right: 0;
}
.online_conpon_ctnr{
margin-top: 32rpx;
}
.online_conpon{
height: 156rpx;
background: #FFF5F3;
border-radius: 8rpx;
padding: 8rpx;
display: flex;
}
.online_conpon .price_wrap{
padding-left: 16rpx;
display: flex;
flex-direction: column;
justify-content: center;
width: 154rpx;
flex-shrink: 0;
color: #FC5B32;
}
.price_wrap .num{
height: 84rpx;
font-weight: 600;
font-size: 42rpx;
color: #FC5B32;
}
.price_wrap .unit{
height: 28rpx;
font-weight: 500;
font-size: 20rpx;
color: #FC5B32;
vertical-align: text-top;
margin-left: 4rpx;
}
.price_wrap .tip{
height: 34rpx;
font-weight: 400;
font-size: 24rpx;
color: #D83C14;
}
.online_conpon .info_wrap{
flex: 1;
background-color: #fff;
padding: 16rpx 12rpx 16rpx 24rpx;
display: flex;
flex-direction: column;
justify-content: space-between;
position: relative;
}
.info_wrap .name{
height: 80rpx;
font-weight: 600;
font-size: 28rpx;
color: #333333;
line-height: 40rpx;
}
.info_wrap .remark,.info_wrap .date{
height: 28rpx;
line-height: 20rpx;
font-weight: 400;
font-size: 20rpx;
color: #D83C14;
}
.info_wrap .use_btn{
position: absolute;
width: 136rpx;
height: 48rpx;
line-height: 48rpx;
background-image: linear-gradient(90deg, #FC5B32 2%, #FF1A33 96%);
border-radius: 23rpx;
color: #fff;
text-align: center;
right: 12rpx;
bottom: 16rpx;
}
.isFullSucreen-btn{
padding-bottom: constant(safe-area-inset-bottom) !important;
padding-bottom: env(safe-area-inset-bottom) !important;
}
\ No newline at end of file \ No newline at end of file
<view class="coupons_container">
<view class="tab_widget">
<tab tab="{{tabs}}" bindclick="changeTab"></tab>
</view>
<block wx:if="{{showLogin}}">
<view class="no_data">
<glsx-image webp class="nodata_bg" src="coupons/no_card_bg.png" />
<view class="nodata_text">暂无优惠券</view>
</view>
</block>
<block wx:else>
<block wx:if="{{flag}}">
<view wx:if="{{couponsList.length}}" style="height:-116rpx;padding-bottom: 35rpx;" class="content_widget">
<scroll-view scroll-y="{{true}}" style="height:100%;padding: 0 32rpx;box-sizing: border-box;" class="scroll_wrap" bindscrolltolower="bottomToRefresh">
<!-- listWidth -->
<view wx:for="{{couponsList}}" wx:key="index">
<block wx:if="{{curTabIndex == 0}}">
<view class="flex storeName">
<text class="storeWidth">{{item.merchantName}}</text>
<text class="{{curTabIndex == 0 ? 'stretchColor':'stretch'}}">({{item.couponAmount}}张)</text>
</view>
<block wx:for="{{item.userCouponList}}" wx:for-item="i" wx:key="id">
<coupon-item btnStatus="{{curTabIndex}}" coupons="{{i}}" useMemberType="{{curTabIndex}}"></coupon-item>
<view class="associatedOrder" wx:if="{{i.goodsOrderCode && curTabIndex == 1}}">
<view class="order">该券已用在订单:</view>
<view class="order-X" catchtap="jump" data-item="{{i.goodsOrderCode}}">{{i.goodsName}}</view>
<view class="checkOrder" catchtap="jump" data-item="{{i.goodsOrderCode}}">查看订单></view>
</view>
</block>
<block wx:if="{{haveCouponsList[index].length > 4}}">
<view class="flex checkList" wx:if="{{!item.checkCoupon}}" catchtap="state" data-key="{{index}}">
<view class="check">查看剩余所有券</view>
<glsx-image webp class="state" src="mine/coupon/down.png" />
</view>
<view class="flex checkList" wx:else catchtap="state" data-key="{{index}}">
<view class="check">收起</view>
<glsx-image webp class="state" src="mine/coupon/up.png" />
</view>
</block>
</block>
<block wx:else>
<view class="online_conpon_ctnr" wx:for="{{item.userCouponList}}" wx:for-item="i" wx:key="id">
<view class="online_conpon">
<view class="price_wrap">
<view>
<text class="num">{{i.denomination || 0}}</text>
<text class="unit">元</text>
</view>
<view class="tip">无门槛</view>
</view>
<view class="info_wrap">
<view class="name">{{i.brandName ? i.brandName + '·' : ''}}{{i.appearance == 2 ? i.goodsName + i.rechargeDenomination : i.goodsName}}</view>
<!-- <view class="remark">无门槛</view> -->
<view class="date" wx:if="{{i.discountType == 8}}">数量:{{i.amount}}</view>
<view class="date" wx:if="{{i.discountType != 8}}">有效期{{i.effectiveDays || 0}}天</view>
<view class="date" wx:else>剩余有效期:{{i.residueEffectiveDays || 0}}天</view>
<view class="use_btn" bindtap="toUseConpon" data-item="{{i}}">去使用</view>
</view>
</view>
</view>
</block>
</view>
</scroll-view>
</view>
<view wx:else class="no_data">
<glsx-image webp class="nodata_bg" src="coupons/no_card_bg.png" />
<view class="nodata_text">暂无优惠券</view>
</view>
<view class="involid_btn isFullSucreen-btn">
<view class="view_involid" bindtap="goInvolidPage">
<text class="text">查看失效券</text>
<glsx-image class="right" src="mine/right.png"></glsx-image>
</view>
</view>
</block>
<!-- 定向礼包弹框 -->
<view wx:if="{{showGiftsModal}}" class="gifts_modal flex_ccc">
<view class="gifts_wrap flex_ccc">
<view wx:if="{{giftsList.length>2}}" class="gifts_wrapper flex_ccc">
<glsx-image webp mode="widthFix" class="gifts_modal_bg" src="{{imgBaseURL}}gifts_list_bg.png" />
<view class="gifts_content_wrap">
<view wx:for="{{giftsList}}" class="gifts_item_wrap">
<glsx-image webp mode="widthFix" class="gifts_item_bg" src="{{imgBaseURL}}gifts_coupons_bg.png" />
<view class="gifts_po_wrap">
<view class="left_widget">
<view class="coup_title">{{item.couponName}}</view>
<view wx:if="{{item.effectiveType==3}}" class="coup_tip">无限期</view>
<view wx:if="{{item.effectiveType==2}}" class="coup_tip">有效期:{{item.receiveStartTime}}-{{item.receiveEndTime}}</view>
<view wx:if="{{item.effectiveType==1}}" class="coup_tip">有效至{{item.receiveEndTime}}</view>
</view>
<view class="right_widget">
<glsx-image webp mode="widthFix" bind:tap="toUseGifts" data-item="{{item}}" class="gifts_to_use_bg" src="{{imgBaseURL}}gifts_touse.png" />
</view>
</view>
</view>
<view style="height:88rpx"></view>
</view>
<glsx-image webp mode="widthFix" class="gifts_modal_bottom_bg" src="{{imgBaseURL}}gifts_fixed_bottom.png" />
</view>
<view wx:if="{{giftsList.length<3}}" class="mini_widget flex_ccc">
<glsx-image webp mode="widthFix" class="mini_header_bg" src="{{imgBaseURL}}gifts_header_bg.png" />
<view class="mini_box_wrap" style="height:{{giftsList.length==2?408:298}}rpx">
<glsx-image webp class="mini_box_bg" style="height:{{giftsList.length==2?450:340}}rpx" src="{{imgBaseURL}}gifts_box_bg.png" />
<view style="height:50rpx"></view>
<view wx:for="{{giftsList}}" class="gifts_item_wrap">
<glsx-image webp mode="widthFix" class="gifts_item_bg" src="{{imgBaseURL}}gifts_coupons_bg.png" />
<view class="gifts_po_wrap">
<view class="left_widget">
<view class="coup_title">{{item.couponName}}</view>
<view wx:if="{{item.effectiveType==3}}" class="coup_tip">无限期</view>
<view wx:if="{{item.effectiveType==2}}" class="coup_tip">有效期:{{item.receiveStartTime}}-{{item.receiveEndTime}}</view>
<view wx:if="{{item.effectiveType==1}}" class="coup_tip">有效至{{item.receiveEndTime}}</view>
</view>
<view class="right_widget">
<glsx-image webp mode="widthFix" bind:tap="toUseGifts" data-item="{{item}}" class="gifts_to_use_bg" src="{{imgBaseURL}}gifts_touse.png" />
</view>
</view>
</view>
</view>
</view>
<glsx-image webp mode="widthFix" bind:tap="clickClose" class="gifts_modal_btn" src="{{imgBaseURL}}gifts_comfirm_btn.png" />
</view>
</view>
</block>
</view>
\ No newline at end of file \ No newline at end of file
// packageMine/pages/coupon/recommend/recommend.js
Page({
/**
* 页面的初始数据
*/
data: {
list: [],
pageNum: 1,
detailInfo: {}
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
if(options.id){
// 领取记录id 优惠券id 门店id
this.setData({
couponInfo: { merchantId:options.merchantId,couponId:options.couponId }
},()=>{
this.getDetailData(options.id)
})
return
}
this.setData(options, () => {
this.getDetailData(options.couponInfo.id)
})
},
jump(e) {
let { item } = e.currentTarget.dataset
wx.openLocation({
latitude: item.lat,
longitude: item.lng,
name: item.merchantName,
address: item.merchantAddress
})
},
jumpCommodity(e) {
let { item } = e.currentTarget.dataset
// console.log('item',item);
let { id } = item
let isActivity = false
if (this.data.couponInfo.merchantId == this.data.userInfo.merchantId) {
wx.p.router.go('/packageMall/pages/detail/detail', { id, isActivity, notIntercept: true })
} else {
wx.p.wxApi.showToast('其他门店商品,暂不支持查看')
}
},
getDetailData(id) {
let para = {
userCouponId: id
}
wx.p.wxApi.showLoading('加载中...')
wx.p.api.couponsApi.couponsDetail(para).then(res => {
res.receiveEndTime = new Date(res.receiveEndTime).format('yyyy.MM.dd hh:mm:ss')
res.receiveStartTime = new Date(res.receiveStartTime).format('yyyy.MM.dd hh:mm:ss')
res.receiveTime = new Date(res.receiveTime).format('yyyy.MM.dd hh:mm:ss')
this.setData(
{
detailInfo: res,
flag: true
},
() => {
this.getCouponGoodsPage()
}
)
})
},
getCouponGoodsPage() {
// wx.p.wxApi.showLoading()
let total = 0
let {
list,
pageNum,
couponInfo: { merchantId },
couponInfo: { couponId, id }
} = this.data
wx.p.api.shopmallApi
.getCouponGoodsPage({
pageNum,
couponId: couponId || id,
merchantId
})
.then(data => {
console.log(data)
this.setData({
list: [...list, ...data.list],
total,
listFlag: true
})
wx.hideLoading()
})
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
let { pageNum, total } = this.data
wx.p.util.onReachBottom(
{
pageNum,
total
},
() => {
this.getCouponGoodsPage()
}
)
}
})
{
"navigationBarTitleText": "卡券详情",
"usingComponents": {
}
}
/* packageMine/pages/coupon/recommend/recommend.wxss */
page {
background-color: #F7F8FA !important;
}
.layout{
padding-top: 24rpx;
padding-bottom: 24rpx;
}
.coupon {
height: 203rpx;
/* background: rgba(252, 91, 50, 0.05); */
/* border-radius: 8rpx; */
margin: 0 24rpx;
position: relative;
}
.coupon .bg {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
}
.coupon .info {
position: relative;
z-index: 2;
display: flex;
width: 100%;
height: 100%;
}
.tips {
font-size: 28rpx;
color: #b1b1b3;
text-align: center;
margin: 32rpx 0 20rpx;
}
.goods-box{
display: flex;
flex-wrap: wrap;
justify-content: space-between;
padding: 0 32rpx ;
}
.goods{
width: 328rpx;
height: 520rpx;
margin-bottom: 32rpx;
position: relative;
}
.coupon .left_box {
width: 255rpx;
height: 150rpx;
color: #FFFFFF;
font-size: 56rpx;
font-weight: 600;
text-align: center;
line-height: 150rpx;
}
.coupon .left_box .price_icon {
font-size: 24rpx;
font-weight: 500;
}
.coupon .right_box {
padding: 28rpx 28rpx 0 28rpx;
width: 464rpx;
}
.top_box {
height: 120rpx;
border-bottom: 2rpx dashed rgba(216, 60, 20, 0.1);
}
.top_box .voucherName {
font-size: 28rpx;
font-weight: 600;
padding-bottom: 8rpx;
}
.h4_text {
font-size: 20rpx;
font-weight: 400;
}
.brightColor {
color: #FC5B32;
}
.darkColor {
color: #666;
}
.describeColor {
color: #D83C14;
}
.timeColor {
color: #999;
}
.bottom_box {
height: 42rpx;
line-height: 42rpx;
}
.box {
border-radius: 8rpx;
background-color: #fff;
padding: 32rpx 32rpx 20rpx 32rpx;
margin: 20rpx 32rpx 0;
box-shadow: 0rpx 8rpx 16rpx 0rpx rgba(224, 224, 224, 0.5);
}
.box .title {
font-size: 32rpx;
font-weight: 500;
padding-bottom: 24rpx;
color: #333;
}
.box .good {
display: flex;
padding-bottom: 12rpx;
}
.box .good .icon {
width: 144rpx;
height: 144rpx;
}
.box .good .icon image {
border-radius: 8rpx;
}
.box .lines {
height: 2rpx;
background: #EFF0F2;
margin: 20rpx 0 32rpx 0;
}
.box .good .info {
margin-left: 32rpx;
}
.box .good .info .name {
font-size: 28rpx;
color: #282829;
}
.box .good .info .price {
display: flex;
margin-top: 50rpx;
font-size: 36rpx;
font-weight: 600;
color: #FC5B32;
}
.box .good .info .price .price-X {
margin-left: 10rpx;
}
.box .store-box {
background: #F9F9F9;
border: 2rpx solid #E9E9E9;
border-radius: 8rpx;
padding: 16rpx 32rpx;
margin-bottom: 18rpx;
}
.box .store-box:last-child {
margin-bottom: 0;
}
.box .storeName {
font-size: 28rpx;
color: #333;
margin-top: -4rpx;
}
.box .businessTime {
font-size: 24rpx;
color: #999;
margin-top: 4rpx;
padding-bottom: 18rpx;
}
.box .line {
height: 2rpx;
background: #EEE;
}
.box .addressBox {
padding-top: 20rpx;
font-size: 24rpx;
color: #666;
display: flex;
align-items: center;
}
.box .addressBox .navigation {
width: 32rpx;
height: 32rpx;
}
.box .box-X {
max-width: 610rpx;
line-height: 48rpx;
}
.box .box-X .titleDay {
font-size: 28rpx;
font-weight: 500;
color: #333;
}
.box .box-X .titleDay_text {
font-size: 24rpx;
color: #666;
}
\ No newline at end of file \ No newline at end of file
<block wx:if="{{flag}}">
<view class="layout">
<!-- <view class="coupon" style="background-image: url({{detailInfo.useMemberType == 0 ? onlineCouponBaseList[0]:onlineCouponBaseList[1]}});"> -->
<!-- <coupon-item coupons="{{couponInfo}}" hideBtn couponStyle="background:transparent"></coupon-item> -->
<view class="coupon">
<glsx-image webp src="mine/coupon/daijin{{detailInfo.useMemberType == 0 == 1?'':'-lose'}}.png" class="bg"></glsx-image>
<view class="info">
<view class="left_box">
<text class="price_icon">¥</text>
<text>{{detailInfo.denomination / 100}}</text>
</view>
<view class="right_box">
<view class="top_box">
<view class="voucherName {{detailInfo.useMemberType == 0 ? 'brightColor':''}}">{{couponInfo.couponName}}</view>
<view wx:if="{{(couponInfo.useBarriers==1 && couponInfo.discountType!=4) || (detailInfo.useBarriers==1 && detailInfo.discountType!=4)}}" class="h4_text {{detailInfo.useMemberType == 0 ? 'describeColor':'darkColor'}}">无门槛</view>
<view wx:if="{{(couponInfo.useBarriers==2 && couponInfo.discountType!=4) || (detailInfo.useBarriers==2 && detailInfo.discountType!=4)}}" class="h4_text {{detailInfo.useMemberType == 0 ? 'describeColor':'darkColor'}}">满{{detailInfo.full / 100}}元可用</view>
</view>
<view class="bottom_box">
<view wx:if="{{couponInfo.effectiveType==3 || detailInfo.effectiveType==3}}" class="h4_text timeColor">永久有效</view>
<view wx:if="{{couponInfo.effectiveType==2 || detailInfo.effectiveType==2}}" class="h4_text timeColor">{{detailInfo.receiveStartTime}}-{{detailInfo.receiveEndTime}}</view>
<view wx:if="{{couponInfo.effectiveType==1 || detailInfo.effectiveType==1}}" class="h4_text timeColor">有效期至{{detailInfo.receiveEndTime}}</view>
</view>
</view>
</view>
</view>
<view class="box" style="padding-bottom: 32rpx;">
<view class="box-X" style="padding-bottom: 16rpx;">
<view class="titleDay">有效日期:</view>
<view wx:if="{{couponInfo.effectiveType==3 || detailInfo.effectiveType==3}}" class="titleDay_text darkColor">永久有效</view>
<view wx:if="{{couponInfo.effectiveType==2 || detailInfo.effectiveType==2}}" class="titleDay_text darkColor">{{detailInfo.receiveStartTime}}-{{detailInfo.receiveEndTime}}</view>
<view wx:if="{{couponInfo.effectiveType==1 || detailInfo.effectiveType==1}}" class="titleDay_text darkColor">有效期至{{detailInfo.receiveEndTime}}</view>
</view>
<view class="box-X" style="padding-bottom: 16rpx;">
<view class="titleDay">获取日期:</view>
<view class="titleDay_text darkColor">{{detailInfo.receiveTime}}</view>
</view>
<view class="box-X" style="line-height: 44rpx;">
<view class="titleDay">使用说明:</view>
<view class="titleDay_text darkColor" style="white-space:pre-wrap">{{detailInfo.useDescription || ''}}</view>
</view>
</view>
<view class="box" wx:if="{{list.length}}">
<view class="title">适用商品</view>
<block wx:for="{{list}}" wx:key="index">
<view class="good" catchtap="jumpCommodity" data-item="{{item}}">
<view class="icon">
<image webp src="{{item.goodsImage}}"></image>
</view>
<view class="info">
<view class="name">{{item.goodsName}}</view>
<view class="price">
¥<view class="price-X">{{item.retailPrice / 100}}</view>
</view>
</view>
</view>
<view class="lines" wx:if="{{index < list.length - 1}}"></view>
</block>
</view>
<!-- <view class="box" style="margin-bottom: 32rpx;" wx:if="{{detailInfo.suitMerchantLists && detailInfo.suitMerchantLists.length}}">
<view class="title">适用门店</view>
<view wx:for="{{detailInfo.suitMerchantLists}}" wx:key="index" class="store-box">
<view class="storeName">{{item.merchantName}}</view>
<view wx:if="{{item.bussinessBegintime}}" class="businessTime">营业时间:{{item.bussinessBegintime}}-{{item.bussinessEndtime}}</view>
<view wx:else class="businessTime">营业时间:无</view>
<view class="line" wx:if="{{item.merchantAddress}}"></view>
<view class="addressBox" wx:if="{{item.merchantAddress}}">
<view style="width: 552rpx;padding-right: 24rpx;">{{item.merchantAddress}}</view>
<view class="navigation" catchtap="jump" data-item="{{item}}">
<glsx-image webp src="mine/icon-go.png"></glsx-image>
</view>
</view>
</view>
</view> -->
<!-- <view class="tips">- 为你推荐 -</view>
<view class="goods-box">
<block wx:if="{{listFlag}}">
<block wx:if="{{list.length}}">
<block wx:for="{{list}}" wx:key="index">
<view class="goods">
<goods item="{{item}}"></goods>
</view>
</block>
<block wx:if="{{nothing}}">
<view class="list-nothing ">到底啦!!</view>
</block>
</block>
<block wx:else>
<view class="list-nothing">
暂无可使用商品
</view>
</block>
</block>
</view> -->
</view>
</block>
\ No newline at end of file \ No newline at end of file
Page({
data: {
count: 5
},
countDown() {
let count = this.data.count
this.data.countDownTime = setInterval(() => {
if (count == 0) {
clearInterval(this.data.countDownTime);
this.goToIndex()
return;
}
count--;
this.setData({
count
})
}, 1 * 1000);
},
goToIndex() {
wx.p.router.switchTab('/pages/tab/index/index')
},
goToCoupons() {
clearInterval(this.data.countDownTime);
wx.p.router.redirectTo('/packageMine/pages/coupon/index/index')
},
onUnload() {
clearInterval(this.data.countDownTime);
},
onLoad() {
this.countDown()
}
})
\ No newline at end of file \ No newline at end of file
{
"navigationBarTitleText": "领取成功"
}
\ No newline at end of file \ No newline at end of file
/* packageMine/pages/coupon/success/success.wxss */
\ No newline at end of file \ No newline at end of file
<view class="success_page">
<!-- <image webp class="success_icon" src="../../../../images/coupons/success.png" /> -->
<glsx-image webp class="success_icon" src="coupons/success.png" />
<view class="success_text">您的优惠礼券领取成功!</view>
<view class="success_count">{{count}}秒后自动跳转到首页</view>
<view class="success_btn_wrap btn_pos">
<view class="btn_box btn_orage" bind:tap="goToCoupons">使用优惠券</view>
</view>
<view class="success_btn_wrap">
<view bind:tap="goToIndex" class="btn_box">回到首页</view>
</view>
</view>
\ No newline at end of file \ No newline at end of file
page {
background: #F9F7F7;
}
.success_page {
display: flex;
flex-direction: column;
align-items: center;
}
.success_icon {
width: 140rpx;
height: 140rpx;
border-radius: 50%;
margin-top: 112rpx;
}
.success_text {
font-weight: 500;
color: #282829;
font-size: 32rpx;
margin-top: 84rpx;
}
.success_count {
font-weight: 400;
color: #B1B1B3;
font-size: 28rpx;
margin-top: 20rpx;
}
.success_btn_wrap {
position: fixed;
bottom: 270rpx;
left: 0;
right: 0;
box-sizing: border-box;
padding: 0 32rpx;
}
.btn_box {
width: 100%;
height: 88rpx;
text-align: center;
line-height: 88rpx;
color: #B1B1B3;
font-size: 32rpx;
border-radius: 8rpx;
border: 2rpx solid #B1B1B3;
}
.btn_orage {
background: var(--btnColor);
border: 2rpx solid var(--btnColor);
color: #FFFFFF;
}
.btn_pos {
bottom: 390rpx;
}
\ No newline at end of file \ No newline at end of file
// index.js
// 获取应用实例
Page({
data: {
tabs: ['已使用', '已失效'],
curTabIndex: 0,
couponsList: [],
imgBaseURL: 'https://img01.glsx.com.cn/weapp/resource/equity-h5-new/mini/',
showGiftsModal: false,
giftsList: [],
haveCouponsList: []
},
jump(e) {
let {
item
} = e.currentTarget.dataset
// console.log(e)
let url = '/packageMine/pages/order/detail/detail'
// if (orderStatus > 5 && orderStatus != 14 && orderStatus != 13&&orderStatus != 15) url = 'afterSaleDetail'
wx.p.router.go(url, {
orderCode: item
})
},
state(e) {
let {
key
} = e.currentTarget.dataset
let {
couponsList,
haveCouponsList
} = this.data
couponsList[key].checkCoupon = !couponsList[key].checkCoupon
if (!couponsList[key].checkCoupon) {
couponsList[key].userCouponList = haveCouponsList[key].slice(0, 4)
} else {
couponsList[key].userCouponList = haveCouponsList[key]
}
this.setData({
couponsList
})
},
changeTab(e) {
this.data.haveCouponsList = []
this.setData({
curTabIndex: e.detail,
couponsList: [],
flag: false
})
this.getCouponList()
},
bottomToRefresh(e) {
let isBottom = e.detail.direction
if (isBottom == 'bottom') {
//刷新下一页
}
},
getCouponList() {
wx.p.wxApi.showLoading('加载中...')
let {
curTabIndex,
isMerchant,
isOnline
} = this.data
let {
merchantId
} = wx.p.storage.get('merchant_info')
let para = {
useMemberType: curTabIndex + 1
}
if (isOnline == 1) para.discountType = 8 //线上优惠券加上这个参数
if (!isMerchant) para.merchantId = merchantId
wx.p.api.couponsApi.getCardData(para).then(res => {
wx.hideLoading()
// console.log(res);
let list = res.map(item => {
item.checkCoupon = false
item.userCouponList.map((itm, index) => {
itm.receiveStartTime = new Date(itm.receiveStartTime).format('yyyy.MM.dd')
if (itm.effectiveType == 1) {
itm.receiveEndTime = new Date(itm.receiveEndTime).format('yyyy.MM.dd hh:mm:ss')
} else {
itm.receiveEndTime = new Date(itm.receiveEndTime).format('yyyy.MM.dd')
}
itm.discountIntensity = itm.discountIntensity / 100
return itm
})
this.data.haveCouponsList.push(item.userCouponList)
return item
})
list = res.map(item => {
if (item.userCouponList.length > 4 && isOnline != 1) {
item.userCouponList = item.userCouponList.slice(0, 4)
}
return item
})
this.setData({
couponsList: list,
haveCouponsList: this.data.haveCouponsList,
flag: true
})
})
},
onLoad(options) {
if (options.pageFrom == 'directional') {
this.setData({
showGiftsModal: true,
giftsList: options.list
})
}
this.setData({
isMerchant: true,
isOnline: options.isOnline
})
//判断只展示当前门店的
// if (isMerchant == 1) {
// this.setData({
// isMerchant: true
// })
// }
this.getCouponList()
},
// ***********定向礼包相关内容***********
clickClose() {
this.setData({
showGiftsModal: false
})
},
// 去使用
toUseGifts(e) {
let {
item
} = e.currentTarget.dataset
let {
discountType,
useChannel,
id
} = item
if (discountType == 2 || discountType == 4) {
wx.p.router.go('/packageMall/pages/coupon/coupon', {
userCouponId: id,
useMemberType: item.useMemberType
})
return
}
/**线上商品代金券 */
if (discountType == 3 && useChannel == 1) {
if (item.useMemberType == 1) {
wx.p.wxApi.showToast('代金券已使用')
return
}
wx.p.router.go('/packageMine/pages/coupon/recommend/recommend', {
couponInfo: item
})
return
}
wx.p.router.go('/packageMine/pages/coupon/detail/detail', {
item
})
}
})
\ No newline at end of file \ No newline at end of file
{
"usingComponents": {
"coupon-item": "../components/CouponsItem/element",
"tab":"/components/Tab/Tab"
},
"navigationBarTitleText": "我的卡券"
}
\ No newline at end of file \ No newline at end of file
/* packageMine/pages/coupon/index/index.wxss */
/**index.wxss**/
::-webkit-scrollbar {
width: 0;
height: 0;
color: transparent;
}
page {
background: #F9F7F7;
}
.tab_widget {
width: 100%;
height: 92rpx;
background: #FFFFFF;
}
.tab_element {
width: 120rpx;
height: 92rpx;
position: relative;
color: #707071;
font-size: 36rpx;
display: flex;
align-items: center;
justify-content: center;
font-weight: 400;
}
.tab_element_active {
font-size: 40rpx;
color: #2D2D2E;
font-weight: 500;
}
.active_tab_line {
width: 48rpx;
height: 8rpx;
background: var(--btnColor);
border-radius: 2rpx;
position: absolute;
left: 50%;
bottom: 0;
transform: translate(-50%, 0);
}
.content_widget {
box-sizing: border-box;
/* padding: 0 32rpx; */
}
.box_wrapper {
width: 100%;
box-sizing: border-box;
padding: 20rpx;
display: flex;
align-items: center;
position: relative;
margin-top: 24rpx;
}
.left_icon_box {
width: 156rpx;
height: 156rpx;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
position: relative;
}
.left_bg {
position: absolute;
left: 0;
right: 0;
top: 0;
bottom: 0;
width: 156rpx;
height: 156rpx;
z-index: 1;
}
.left_text_one {
font-size: 36rpx;
font-weight: 600;
color: #FFFFFF;
z-index: 2;
}
.left_text_two {
display: flex;
align-items: flex-end;
}
.left_text_three {
font-size: 20rpx;
margin-top: 6rpx;
}
.price_icon {
font-size: 20rpx;
margin-right: 4rpx;
}
.main_box {
height: 156rpx;
box-sizing: border-box;
padding: 4rpx 0 4rpx 20rpx;
}
.box_btn {
position: absolute;
right: 20rpx;
top: 50%;
transform: translate(0, -50%);
width: 120rpx;
height: 44rpx;
background: #B1B1B3;
border-radius: 22rpx;
color: #FFF;
font-size: 20rpx;
text-align: center;
line-height: 44rpx;
}
.title_text {
color: #282829;
font-weight: 600;
color: #282829;
font-size: 28rpx;
}
.h4_text {
font-weight: 400;
color: #B1B1B3;
font-size: 24rpx;
}
.drive {
margin-top: 38rpx;
}
.involid_btn{
display: flex;
justify-content: center;
margin-top: 36rpx;
}
.view_involid{
height: 48rpx;
line-height: 48rpx;
border: 2rpx solid #999999;
border-radius: 24rpx;
color: #999999;
width: 204rpx;
text-align: center;
}
.no_data {
padding-top: 48rpx;
display: flex;
flex-direction: column;
align-items: center;
}
.nodata_bg {
width: 320rpx;
height: 320rpx;
}
.nodata_text {
color: #B1B1B3;
font-size: 28rpx;
line-height: 44rpx;
margin-top: 8rpx;
}
/* 定向礼包弹框 */
.flex_ccc {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
}
.gifts_modal {
position: fixed;
left: 0;
right: 0;
top: 0;
right: 0;
background: rgba(0, 0, 0, 0.66);
width: 100%;
height: 100%;
z-index: 999999;
}
.gifts_wrap {
width: 100%;
height: 100%;
}
.gifts_wrapper {
width: 100%;
/* height: 337rpx; */
position: relative;
}
/*自定义背景颜色*/
.custom_banner_wrap{
width: 86%;
min-height: 170rpx;
/* background: linear-gradient(-180deg, #FE7534, #FF4815); */
position: absolute;
top:51.3%;
left: 50%;
transform: translateX(-50%);
z-index: -1;
/* border-radius:0 0 32rpx 32rpx; */
}
.custom_box{
height: 170rpx;
}
.gifts_modal_bg {
width: 87.3%;
height: 51.3%;
}
.gifts_modal_btn {
width: 39%;
height: 102rpx;
margin-top: 56rpx;
}
.gifts_content_wrap {
width: calc(87.3% - 52rpx);
height: 64%;
/* background: #FFFFFF; */
position: absolute;
left: 50%;
bottom: 6rpx;
transform: translate(-50%, 0);
overflow-x: hidden;
overflow-y: scroll;
}
.gifts_modal_bottom_bg {
position: absolute;
left: 50%;
bottom: 6rpx;
transform: translate(-50%, 0);
width: 83.2%;
height: 87rpx;
}
.gifts_item_wrap {
width: 100%;
height: 170rpx;
position: relative;
}
.gifts_item_bg {
width: 100%;
height: 170rpx;
}
.gifts_po_wrap {
position: absolute;
left: 0;
top: 0;
height: 170rpx;
width: 100%;
display: flex;
align-items: center;
justify-content: space-between;
}
.left_widget {
box-sizing: border-box;
padding:0 0 0 40rpx;
width: 70%;
}
.coup_title{
font-size: 30rpx;
font-weight: 400;
color: #1A1919;
width: 70%;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
.coup_tip {
font-size: 24rpx;
font-weight: 400;
color: #817F7C;
margin-top: 19rpx;
}
.right_widget{
padding-right: 32rpx;
}
.gifts_to_use_bg{
width: 120rpx;
height: 46rpx;
}
/**小于2的样式*/
.mini_widget{
width: 100%;
min-height: 207rpx;
}
.mini_header_bg{
width: 87.3%;
height: 207rpx;
}
.mini_box_wrap{
width: 86.3%;
height: 281rpx;
position: relative;
box-sizing: border-box;
padding: 0 29rpx;
}
.mini_box_bg{
width: 100%;
height: 345rpx;
position: absolute;
top: -54rpx;
left: 0;
right: 0;
z-index: -1;
}
.storeName {
margin-top: 30rpx;
font-size: 32rpx;
font-weight: 500;
color: #282829;
/* display: inline-block; */
}
.storeWidth {
max-width: 477rpx;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
.stretch {
font-size: 32rpx;
font-weight: 500;
color: #999;
margin-left: 10rpx;
}
.stretchColor {
color: var(--btnColor);
font-size: 32rpx;
font-weight: 500;
margin-left: 10rpx;
}
/* .listWidth {
max-height: 810rpx;
overflow: hidden;
white-space: nowrap;
} */
.checkList {
justify-content: center;
margin-top: 18rpx;
}
.checkList .check {
font-size: 24rpx;
color: #999;
}
.state {
width: 24rpx;
height: 24rpx;
margin-left: 10rpx;
}
.associatedOrder {
display: flex;
font-size: 24rpx;
padding-top: 8rpx;
}
.associatedOrder .order {
color: #666;
}
.associatedOrder .order-X {
color: #333;
max-width: 337rpx;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
.associatedOrder .checkOrder {
color: var(--btnColor);
position: absolute;
right: 0;
}
.online_conpon_ctnr{
margin-top: 32rpx;
}
.online_conpon{
height: 156rpx;
background: #F1F1F1;
border-radius: 8rpx;
padding: 8rpx;
display: flex;
}
.online_conpon .price_wrap{
padding-left: 16rpx;
display: flex;
flex-direction: column;
justify-content: center;
width: 154rpx;
flex-shrink: 0;
color: var(--btnColor);
}
.price_wrap .num{
height: 84rpx;
font-weight: 600;
font-size: 42rpx;
color: #6D6D6D;
}
.price_wrap .unit{
height: 28rpx;
font-weight: 500;
font-size: 20rpx;
color: #6D6D6D;
vertical-align: text-top;
margin-left: 4rpx;
}
.price_wrap .tip{
height: 34rpx;
font-weight: 400;
font-size: 24rpx;
color: #6D6D6D;
}
.online_conpon .info_wrap{
flex: 1;
background-color: #fff;
padding: 16rpx 12rpx 16rpx 24rpx;
display: flex;
flex-direction: column;
justify-content: space-between;
position: relative;
}
.info_wrap .name{
height: 80rpx;
font-weight: 600;
font-size: 28rpx;
color: #333333;
line-height: 40rpx;
}
.info_wrap .remark,.info_wrap .date{
height: 28rpx;
line-height: 20rpx;
font-weight: 400;
font-size: 20rpx;
color: #6D6D6D;
}
.info_wrap .use_btn{
position: absolute;
width: 136rpx;
height: 48rpx;
line-height: 48rpx;
background-color: #B0B0B0;
border-radius: 23rpx;
color: #fff;
text-align: center;
right: 12rpx;
bottom: 16rpx;
}
\ No newline at end of file \ No newline at end of file
<view class="coupons_container">
<view class="tab_widget">
<tab tab="{{tabs}}" bindclick="changeTab"></tab>
</view>
<block wx:if="{{flag}}">
<view wx:if="{{couponsList.length}}" style="height:-116rpx;padding-bottom: 35rpx;" class="content_widget">
<scroll-view scroll-y="{{true}}" style="height:100%;padding: 0 32rpx;box-sizing: border-box;" class="scroll_wrap" bindscrolltolower="bottomToRefresh">
<!-- listWidth -->
<view wx:for="{{couponsList}}" wx:key="index">
<block wx:if="{{isOnline!=1}}">
<view class="flex storeName">
<text class="storeWidth">{{item.merchantName}}</text>
<text class="'stretch'">({{item.couponAmount}}张)</text>
</view>
<block wx:for="{{item.userCouponList}}" wx:for-item="i" wx:key="id">
<coupon-item btnStatus="{{curTabIndex+1}}" coupons="{{i}}" useMemberType="{{curTabIndex+1}}"></coupon-item>
<view class="associatedOrder" wx:if="{{i.goodsOrderCode && curTabIndex == 0}}">
<view class="order">该券已用在订单:</view>
<view class="order-X" catchtap="jump" data-item="{{i.goodsOrderCode}}">{{i.goodsName}}</view>
<view class="checkOrder" catchtap="jump" data-item="{{i.goodsOrderCode}}">查看订单></view>
</view>
</block>
<block wx:if="{{haveCouponsList[index].length > 4}}">
<view class="flex checkList" wx:if="{{!item.checkCoupon}}" catchtap="state" data-key="{{index}}">
<view class="check">查看剩余所有券</view>
<glsx-image webp class="state" src="mine/coupon/down.png" />
</view>
<view class="flex checkList" wx:else catchtap="state" data-key="{{index}}">
<view class="check">收起</view>
<glsx-image webp class="state" src="mine/coupon/up.png" />
</view>
</block>
</block>
<block wx:else>
<view class="online_conpon_ctnr" wx:for="{{item.userCouponList}}" wx:for-item="i" wx:key="id">
<view class="online_conpon">
<view class="price_wrap">
<view>
<text class="num">{{i.denomination || 0}}</text>
<text class="unit">元</text>
</view>
<view class="tip">无门槛</view>
</view>
<view class="info_wrap">
<view class="name">{{i.brandName ? i.brandName + '·' : ''}}{{i.appearance == 2 ? i.goodsName + i.rechargeDenomination : i.goodsName}}</view>
<view class="date" wx:if="{{i.discountType == 8}}">数量:{{i.amount}}</view>
<view class="date">有效期{{i.effectiveDays || 0}}天</view>
<view class="use_btn">去使用</view>
</view>
</view>
</view>
</block>
</view>
</scroll-view>
</view>
<view wx:else class="no_data">
<glsx-image webp class="nodata_bg" src="coupons/no_card_bg.png" />
<view class="nodata_text">暂无优惠券</view>
</view>
</block>
<!-- 定向礼包弹框 -->
<view wx:if="{{showGiftsModal}}" class="gifts_modal flex_ccc">
<view class="gifts_wrap flex_ccc">
<view wx:if="{{giftsList.length>2}}" class="gifts_wrapper flex_ccc">
<image webp mode="widthFix" class="gifts_modal_bg" src="{{imgBaseURL}}gifts_list_bg.png" />
<view class="gifts_content_wrap">
<view wx:for="{{giftsList}}" class="gifts_item_wrap">
<image webp mode="widthFix" class="gifts_item_bg" src="{{imgBaseURL}}gifts_coupons_bg.png" />
<view class="gifts_po_wrap">
<view class="left_widget">
<view class="coup_title">{{item.couponName}}</view>
<view wx:if="{{item.effectiveType==3}}" class="coup_tip">无限期</view>
<view wx:if="{{item.effectiveType==2}}" class="coup_tip">有效期:{{item.receiveStartTime}}-{{item.receiveEndTime}}</view>
<view wx:if="{{item.effectiveType==1}}" class="coup_tip">有效至{{item.receiveEndTime}}</view>
</view>
<view class="right_widget">
<image webp mode="widthFix" bind:tap="toUseGifts" data-item="{{item}}" class="gifts_to_use_bg" src="{{imgBaseURL}}gifts_touse.png" />
</view>
</view>
</view>
<view style="height:88rpx"></view>
</view>
<image webp mode="widthFix" class="gifts_modal_bottom_bg" src="{{imgBaseURL}}gifts_fixed_bottom.png" />
</view>
<view wx:if="{{giftsList.length<3}}" class="mini_widget flex_ccc">
<image webp mode="widthFix" class="mini_header_bg" src="{{imgBaseURL}}gifts_header_bg.png" />
<view class="mini_box_wrap" style="height:{{giftsList.length==2?408:298}}rpx">
<image webp class="mini_box_bg" style="height:{{giftsList.length==2?450:340}}rpx" src="{{imgBaseURL}}gifts_box_bg.png" />
<view style="height:50rpx"></view>
<view wx:for="{{giftsList}}" class="gifts_item_wrap">
<image webp mode="widthFix" class="gifts_item_bg" src="{{imgBaseURL}}gifts_coupons_bg.png" />
<view class="gifts_po_wrap">
<view class="left_widget">
<view class="coup_title">{{item.couponName}}</view>
<view wx:if="{{item.effectiveType==3}}" class="coup_tip">无限期</view>
<view wx:if="{{item.effectiveType==2}}" class="coup_tip">有效期:{{item.receiveStartTime}}-{{item.receiveEndTime}}</view>
<view wx:if="{{item.effectiveType==1}}" class="coup_tip">有效至{{item.receiveEndTime}}</view>
</view>
<view class="right_widget">
<image webp mode="widthFix" bind:tap="toUseGifts" data-item="{{item}}" class="gifts_to_use_bg" src="{{imgBaseURL}}gifts_touse.png" />
</view>
</view>
</view>
</view>
</view>
<image webp mode="widthFix" bind:tap="clickClose" class="gifts_modal_btn" src="{{imgBaseURL}}gifts_comfirm_btn.png" />
</view>
</view>
</view>
\ No newline at end of file \ No newline at end of file
// packageMine/pages/order/afterSaleDetail/afterSaleDetail.js
Page({
/**
* 页面的初始数据
*/
data: {
refundStatus: {
1: '待处理',
2: '待发货',
3: '待确认收到退货',
4: '退款中',
5: '已退款',
6: '退款失败',
7: '审核不通过'
},
// 退款状态1:待处理,2待发货,3待确认收到退货,4:退款中,5:已退款,6:退款失败,7:审核不通过
afterSaleObj: [
{
title: '售后类型',
key: 'refundType',
enum: {
1: '我要退款退货',
2: '我要退款(无需退货)'
}
},
{
title: '售后商品',
isArray: true,
key: 'goodsNames'
},
{
title: '申请金额',
key: 'refundPrice'
},
{
title: '申请时间',
key: 'time'
},
{
title: '申请描述',
key: 'remark'
},
{
title: '订单编号',
key: 'orderCode'
}
]
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
this.getOrderRefundDetail(options.orderCode)
},
getOrderRefundDetail(orderCode) {
wx.p.wxApi.showLoading('加载中...')
wx.p.api.shopmallApi.getOrderRefundDetail(orderCode).then(data => {
wx.hideLoading()
console.log(data)
if (data.refundStatus == 2 && data.refundType == 1) {
wx.p.router.redirectTo('/packageMine/pages/order/afterSale_step_three/afterSale_step_three', data)
return
}
data.time = new Date(data.createdDate).format('yyyy-MM-dd hh:mm:ss')
this.setData({
orderInfo: data
})
})
},
confirm() {
let { orderInfo } = this.data
console.log(orderInfo)
wx.p.router.go('/packageMine/pages/order/afterSale_step_two/afterSale_step_two', orderInfo)
},
previewImage(e) {
let params = e.currentTarget.dataset
wx.p.wxApi.previewImage(params)
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {}
})
{
"navigationBarTitleText": "售后详情"
}
\ No newline at end of file \ No newline at end of file
.layout {
padding: 32rpx;
}
.status-box {
text-align: center;
}
.status-box .icon {
margin: 80rpx auto 84rpx;
width: 140rpx;
height: 140rpx;
}
.status-box .title {
font-size: 40rpx;
font-weight: 500;
}
.status-box .tips {
margin: 20rpx 0 59rpx;
color: #656566;
}
.box {
border-radius: 8rpx;
background-color: #fff;
}
.text-box {
padding: 32rpx 24rpx;
border-bottom: 2rpx solid #EFF0F2;
}
.text-box .item{
margin-bottom: 12rpx;
display: flex;
align-items: flex-start;
}
.text-box .item .label{
width: 140rpx;
}
.text-box .item .value{
color: #656566;
width: calc(100% - 150rpx);
}
.photo-box {
padding: 40rpx 0 28rpx 20rpx;
display: flex;
flex-wrap: wrap;
}
.photo-box .item {
width: 200rpx;
height: 200rpx;
background: #D8D8D8;
margin: 0 20rpx 20rpx 0;
}
\ No newline at end of file \ No newline at end of file
<block wx:if="{{orderInfo}}">
<view class="layout isFullSucreen">
<view class="status-box">
<!-- 退款状态1:待处理,2待发货,3待确认收到退货,4:退款中,5:已退款,6:退款失败,7:审核不通过 -->
<view class="icon">
<block wx:if="{{orderInfo.refundStatus == 5}}">
<glsx-image webp src="mine/order/success.png"></glsx-image>
</block>
<block wx:elif="{{orderInfo.refundStatus <5}}">
<glsx-image webp src="mine/order/wait.png"></glsx-image>
</block>
<block wx:else>
<glsx-image webp src="mine/order/error.png"></glsx-image>
</block>
</view>
<view class="title">{{refundStatus[orderInfo.refundStatus]}}</view>
<view class="tips">
<block wx:if="{{orderInfo.refundStatus == 5}}">
钱款将原路退回至您的账户
</block>
<block wx:elif="{{orderInfo.refundStatus > 5 }}">退款不成功,您可以再次提交退款申请重试</block>
<block wx:else>等待平台处理</block>
</view>
</view>
<view class="box">
<view class="text-box">
<block wx:for="{{afterSaleObj}}" wx:key="index">
<view class="item">
<view class="label">{{item.title}}:</view>
<view class="value">
<block wx:if="{{item.enum}}">
{{item.enum[orderInfo[item.key]]}}
</block>
<block wx:elif="{{item.isArray}}">
<block wx:for="{{orderInfo[item.key]}}" wx:key="index" wx:for-item="i">
<text>{{i}};</text>
</block>
</block>
<block wx:else>
{{orderInfo[item.key] || ''}}
</block>
</view>
</view>
</block>
<block wx:if="{{orderInfo.deliveryCompany}}">
<view class="item">
<view class="label">快递公司:</view>
<view class="value">{{orderInfo.deliveryCompany}}</view>
</view>
<view class="item">
<view class="label">快递单号:</view>
<view class="value">{{orderInfo.deliveryNumber}}</view>
</view>
</block>
</view>
<block wx:if="{{orderInfo.imgUrls && orderInfo.imgUrls.length}}">
<view class="photo-box">
<block wx:for="{{orderInfo.imgUrls}}" wx:key="index">
<view class="item" bindtap="previewImage" data-current="{{item}}" data-urls="{{orderInfo.imgUrls}}">
<image webp src="{{item}}"></image>
</view>
</block>
</view>
</block>
</view>
<block wx:if="{{orderInfo.refundStatus >5}}">
<view class="default-btn" bindtap="confirm">重新提交</view>
</block>
</view>
</block>
\ No newline at end of file \ No newline at end of file
import { afterSaleMixin } from '~/mixins/index'
Page({
behaviors: [afterSaleMixin],
/**
* 页面的初始数据
*/
data: {
afterSaleList: [
{
active: true,
value: 2
},
{
value: 1
}
]
},
choose(e) {
let { index } = e.currentTarget.dataset
let { afterSaleList } = this.data
afterSaleList.map(i => (i.active = false))
afterSaleList[index].active = true
this.setData({
afterSaleList
})
},
click() {
let {
orderObj,
data: { afterSaleList }
} = this
orderObj.refundType = 2
afterSaleList.map(e => {
if (e.active) orderObj.refundType = e.value
})
wx.p.router.go('/packageMine/pages/order/afterSale_step_two/afterSale_step_two', orderObj)
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
this.orderObj = options
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {}
})
{
"navigationBarTitleText": "申请售后"
}
\ No newline at end of file \ No newline at end of file
/* packageMine/pages/order/afterSale_step_one/afterSale_step_one.wxss *//* packageMine/pages/order/afterSale_step_one/afterSale_step_one.wxss */
.layout {
padding: 24rpx var(--margin);
}
.title {
font-size: 32rpx;
font-weight: 500;
margin-bottom: 40rpx;
}
.item {
border: 4rpx solid transparent;
height: 152rpx;
position: relative;
background-color: #fff;
font-size: 40rpx;
margin-bottom: var(--margin);
border-radius: 8rpx;
overflow: hidden;
}
.item.active{
border-color: var(--btnColor);
}
.default-btn{
margin: 220rpx auto 0;
}
.active .icon{
position: absolute;
top: 0;
right: 0;
width: 64rpx;
height: 64rpx;
}
\ No newline at end of file \ No newline at end of file
<view class="layout">
<view class="title">请选择售后类型</view>
<view class="box">
<block wx:for="{{afterSaleList}}" wx:key="index">
<view class="item text-center {{item.active?'active':''}}" bindtap="choose" data-index="{{index}}">
{{afterType[item.value]}}
<view class="icon">
<glsx-image webp src="mine/active.png"></glsx-image>
</view>
</view>
</block>
</view>
</view>
<view class="default-btn" bindtap="click">确定</view>
\ No newline at end of file \ No newline at end of file
// packageMine/pages/order/afterSale_step_three/afterSale_step_three.js
Page({
/**
* 页面的初始数据
*/
data: {},
onLoad(options) {
this.setData({
orderInfo: options
})
},
input(e) {
let { value } = e.detail
let { key } = e.currentTarget.dataset
this.setData({
[`params.${key}`]: value
})
},
confirm() {
let { orderInfo, params } = this.data
if (!params.deliveryCompany && !params.deliveryNumber) {
wx.p.wxApi.showToast('请填写快递公司、单号')
return
}
params.id = orderInfo.id
wx.p.wxApi.showLoading('提交申请中...')
wx.p.api.shopmallApi.addDelivery(params).then(data => {
console.log(data)
wx.p.wxApi.showToast('申请成功!')
setTimeout(() => {
wx.p.router.back(prevPage => {
prevPage.clearData()
})
}, 1.5 * 1000)
})
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {}
})
{
"navigationBarTitleText": "申请售后"
}
\ No newline at end of file \ No newline at end of file
/* packageMine/pages/order/afterSale_step_three/afterSale_step_three.wxss */
.layout {
padding: 0 32rpx;
}
.title {
padding: 32rpx 0 24rpx;
}
.address {
background: #EFF0F2;
border-radius: 8rpx;
overflow-y: scroll;
box-sizing: border-box;
padding: 28rpx 32rpx;
line-height: 40rpx;
}
.box {
height: 216rpx;
background-color: #fff;
border-radius: 8rpx;
position: relative;
}
.box::after {
content: '';
position: absolute;
top: 50%;
left: 50%;
width: 654rpx;
height: 2rpx;
background: #EFF0F2;
transform: translate(-50%,-50%);
}
.item {
height: 108rpx;
display: flex;
align-items: center;
box-sizing: border-box;
}
.item .label{
width: 224rpx;
text-indent: 32rpx;
}
.item .input{
width: calc(100% - 256rpx);
}
.btn {
margin: 48rpx auto 20rpx;
width: 332rpx;
height: 80rpx;
background: var(--btnColor);
border-radius: 8rpx;
color: #fff;
}
.disabled{
background-color: #999;
}
\ No newline at end of file \ No newline at end of file
<view class="layout">
<view class="title">请将收到的货物发回以下地址</view>
<view class="address">
<view>地址:{{orderInfo.contactAddress}}</view>
<view>收货人:{{orderInfo.contactName}}</view>
<view>联系电话:{{orderInfo.contactPhone}}</view>
</view>
<view class="title">请输入您的快递信息</view>
<view class="box">
<view class="item">
<view class="label">快递公司</view>
<input class="input" type="text" placeholder="请输入" bindinput="input" data-key="deliveryCompany" />
</view>
<view class="item">
<view class="label">快递单号</view>
<input class="input" type="text" placeholder="请输入" bindinput="input" data-key="deliveryNumber" />
</view>
</view>
<view class="btn text-center {{params.deliveryCompany && params.deliveryNumber?'':'disabled'}}" bindtap="confirm">提交申请
</view>
</view>
\ No newline at end of file \ No newline at end of file
import {
afterSaleMixin
} from '~/mixins/index'
Page({
behaviors: [afterSaleMixin],
/**
* 页面的初始数据
*/
data: {
imgUrls: []
},
previewImage(e) {
let params = e.currentTarget.dataset
wx.p.wxApi.previewImage(params)
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
let imgUrls = []
if (options.imgUrls) imgUrls = options.imgUrls
this.setData({
orderObj: options,
imgUrls,
maxPrice: options.refundPrice
})
},
input(e) {
this.setData({
'orderObj.remark': e.detail.value
})
},
noScroll() {},
changePrice() {
this.setData({
showPriceInput: true
})
},
blur(e) {
const rex = /^(([1-9]{1}\d*)|(0{1}))(\.\d{2})$/
console.log(e)
let {
value
} = e.detail
let {
maxPrice
} = this.data
if (value > maxPrice) value = maxPrice
if (value < 0) value = 0
if (!rex.test(value)) value = maxPrice
this.setData({
'orderObj.refundPrice': Number(value).toFixed(2),
showPriceInput: false
})
},
del(e) {
let {
index
} = e.currentTarget.dataset
let {
imgUrls
} = this.data
imgUrls.splice(index, 1)
this.setData({
imgUrls
})
},
upLoad() {
let _this = this
let {
imgUrls
} = this.data
wx.chooseImage({
count: 1
}).then(res => {
let [tempFiles] = res.tempFilePaths
let imgType = tempFiles.split('.')[1]
let type = imgType == 'unknown' ? 'jpg' : imgType
wx.getFileSystemManager().readFile({
filePath: tempFiles, //选择图片返回的相对路径
encoding: 'base64', //编码格式
success(_res) {
wx.p.wxApi.showLoading('上传中...')
wx.p.api.common.uploadImg({
file: `${type}@${_res.data}`
})
.then(img => {
wx.p.wxApi.hideLoading()
console.log(img)
imgUrls.push(img)
_this.setData({
imgUrls
})
})
}
})
})
},
confirm() {
let {
orderObj,
imgUrls
} = this.data
orderObj.imgUrls = imgUrls
console.log(orderObj)
wx.p.api.shopmallApi.afterSale(orderObj).then(({
code,
data,
message
}) => {
if (code == '0') {
wx.p.wxApi.showToast('申请成功!')
setTimeout(() => {
wx.p.router.back(prevPage => {
prevPage.clearData && prevPage.clearData()
}, 2)
}, 1.5 * 1000)
} else {
wx.p.wxApi.showToast(message)
}
})
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {}
})
\ No newline at end of file \ No newline at end of file
{
"navigationBarTitleText": "申请售后",
"usingComponents": {
"gl-textarea": "/components/GlTextarea/GlTextarea"
}
}
\ No newline at end of file \ No newline at end of file
/* packageMine/pages/order/afterSale_step_two/afterSale_step_two.wxss */
.layout {
padding: 0 var(--margin) 24rpx;
}
.title {
font-weight: 500;
font-size: 32rpx;
padding: 24rpx 0;
}
.box {
background: #FFFFFF;
border-radius: 8rpx;
}
.type {
height: 104rpx;
background: #EFF0F2;
border-radius: 8rpx;
font-size: 40rpx;
}
.description {
height: 460rpx;
box-sizing: border-box;
padding: 28rpx 32rpx;
}
.price-box {
height: 100rpx;
display: flex;
align-items: center;
justify-content: space-between;
margin: 24rpx 0 8rpx;
box-sizing: border-box;
padding: 0 32rpx;
}
.price-box .value {
font-size: 24rpx;
color: var(--btnColor);
display: flex;
align-items: center;
}
.price-box .value .price {
margin-right: 28rpx;
font-size: 36rpx;
}
.upload-box {
min-height: 260rpx;
box-sizing: border-box;
padding: 30rpx 0 0 22rpx;
}
.upload-box .one {
width: 100%;
height: 260rpx;
}
.upload-box.flex {
display: flex;
flex-wrap: wrap;
}
.upload-box .icon {
width: 84rpx;
height: 64rpx;
}
.upload-box .item {
width: 200rpx;
height: 200rpx;
background: #D8D8D8;
margin-bottom: 30rpx;
margin-right: 20rpx;
position: relative;
}
.item .del {
position: absolute;
width: 72rpx;
height: 72rpx;
right: -32rpx;
top: -32rpx;
}
.upload-box .item .del .icon {
width: 36rpx;
height: 36rpx;
}
.upload-box .upload-item {
background-color: #fff;
border: 2rpx solid #D8D8D8;
box-sizing: border-box;
}
.btn {
margin: 48rpx auto 20rpx;
width: 332rpx;
height: 80rpx;
background: var(--btnColor);
border-radius: 8rpx;
color: #fff;
}
.price-input-box {
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
z-index: 2;
background-color: rgba(0, 0, 0, .7);
}
.price-input {
width: 100%;
height: 72rpx;
background-color: #fff;
box-sizing: border-box;
padding: 0 40rpx;
display: flex;
align-items: center;
}
\ No newline at end of file \ No newline at end of file
<view class="layout isFullSucreen">
<view class="title">售后类型</view>
<view class="type text-center">
{{afterType[orderObj.refundType]}}
</view>
<view class="title">申请描述</view>
<view class="description box">
<gl-textarea maxlength="230" value="{{orderObj.remark}}" bindinput="input" showWordLimit customMaxLength></gl-textarea>
</view>
<view class="price-box box">
申请金额
<view class="value" bindtap="changePrice">
<view class="price">¥{{orderObj.refundPrice}}</view>
修改金额
</view>
</view>
<view class="title">上传图片</view>
<view class="upload-box box flex">
<block wx:if="{{imgUrls.length < 1}}">
<view class="one text-center" bindtap="upLoad">
<view class="icon">
<glsx-image webp src="mine/camera.png"></glsx-image>
</view>
</view>
</block>
<block wx:else>
<block wx:for="{{imgUrls}}" wx:key="index">
<view class="item" catchtap="previewImage" data-current="{{item}}" data-urls="{{imgUrls}}">
<image webp src="{{item}}"></image>
<view class="del text-center" catchtap="del" data-index="{{index}}">
<view class="icon">
<glsx-image webp src="mine/del.png"></glsx-image>
</view>
</view>
</view>
</block>
<block wx:if="{{imgUrls.length < 5}}">
<view class="upload-item item text-center" bindtap="upLoad">
<view class="icon">
<glsx-image webp src="mine/camera.png"></glsx-image>
</view>
</view>
</block>
</block>
</view>
<view class="btn text-center" bindtap="confirm">提交申请</view>
</view>
<block wx:if="{{showPriceInput}}">
<view class="price-input-box" catchtouchmove="noScroll">
<view class="price-input">
<input type="digit" bindblur="blur" value="{{orderObj.refundPrice}}" focus="{{showPriceInput}}" class="input"
adjust-position="{{false}}" />
</view>
</view>
</block>
<glsx-privacy appletName="海马刀"></glsx-privacy>
\ No newline at end of file \ No newline at end of file
// packageMine/pages/order/complete/complete.js
Page({
/**
* 页面的初始数据
*/
data: {
success: false,
count: 5
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
if (options.success) {
this.setData(options)
this.countdown()
} else {
this.setData({
params: options.params
})
}
},
countdown() {
this.timer = setInterval(() => {
let { count } = this.data
if (count == 0) {
clearInterval(this.timer)
wx.p.router.reLaunch('/packageMine/pages/order/index/index')
return
}
this.setData({
count: --count
})
}, 1 * 1000)
},
pay() {
let { params } = this.data
let _this = this
wx.requestPayment({
...params,
success(res) {
_this.setData({
success: true
})
_this.countdown()
},
fail(res) {
if (res.errMsg == 'requestPayment:fail cancel') {
wx.p.wxApi.showToast('取消支付')
}
}
})
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
if (this.timer) clearInterval(this.timer)
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
if (this.timer) clearInterval(this.timer)
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {}
})
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!