Commit 4fed14ea by 杨北旺

个人中心

1 parent 5a43dd0e
Showing 77 changed files with 6982 additions and 5 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
<block wx:if="{{flag}}">
<view class="detail-page">
<!-- <view wx:if="{{coupon.discountType!=7}}" class="wrapper">
<view class="top_element_wrap">
<coupon-item coupons="{{couponInfo}}" hideBtn ></coupon-item>
</view>
<block wx:if="{{coupon.useChannel != 1}}">
<view class="title_wrap">
<view class="title-text">核销码</view>
</view>
<view class="code_wrap">
<text class="code_text_red {{failure || future?'code_text_grey':''}}">{{detailInfo.verificationCode}}</text>
<view wx:if="{{!failure&&!future}}" class="code-tip min-text">请将核销码拿给店员,避免泄露给他人</view>
<view wx:if="{{qrcodeURL}}" class="iamge_qr_wrap">
<image webp class="qrcodeimage {{failure || future?'op30':''}}" src="{{qrcodeURL}}" />
<view wx:if="{{failure}}" class="qrBtn">{{detailInfo.couponState==5?'已使用':'已失效'}}</view>
<view wx:if="{{future}}" class="qrBtn qrText">
<text wx:if="{{dayDiff}}">{{dayDiff}}天</text>
<text wx:if="{{hourDiff}}">{{hourDiff}}时</text>
<text wx:if="{{minDiff}}">{{minDiff}}分</text>
<text>后可用</text>
</view>
</view> -->
<!-- <view wx:if="{{failure}}" class="code_text_grey">已失效</view>
<view wx:if="{{future}}" class="code_future">
<text wx:if="{{dayDiff}}">{{dayDiff}}天</text>
<text wx:if="{{hourDiff}}">{{hourDiff}}时</text>
<text wx:if="{{minDiff}}">{{minDiff}}分</text>
<text>后可用</text>
</view> -->
<!-- </view>
</block>
<view class="title_wrap">
<view class="title-text">使用说明</view>
<view class="html-wrap">{{detailInfo.useDescription || ''}}</view>
</view>
<view style="height:64rpx"></view>
<view class="drive_line"></view>
<view class="title_wrap">
<view class="title-text">适用门店</view>
</view>
<view class="shop_info_wrap">
<view class="shop_header">
<image webp class="header_img" src="../../../images/success.png" />
<view class="shop_title">{{detailInfo.merchantName}}</view>
</view>
<view class="shop_adress">{{detailInfo.merchantAddress || ''}}</view>
<view wx:if="{{detailInfo.bussinessBegintime}}" class="shop_date">营业时间:{{detailInfo.bussinessBegintime}}-{{detailInfo.bussinessEndtime}}</view>
<view wx:else class="shop_date">营业时间:无</view>
</view>
<view style="height:48rpx"></view>
</view> -->
<view class="other_wrapper">
<!-- <view class="an_title_text">{{detailInfo.merchantName}}</view>
<view class="an_min_title_text">获取时间 {{detailInfo.receiveTime}}</view> -->
<view class="couponBox">
<view class="topBox">
<view class="title_text {{coupon.useMemberType == 0 ? 'qrText':'changeColor'}}">{{detailInfo.couponName}}</view>
<!-- <view class="baseImage" style="background-image: url({{coupon.useMemberType == 0 ? couponBaseList[couponInfo.discountType]:unCouponBaseList[couponInfo.discountType]}});"></view> -->
<glsx-image webp class="baseImage" src="mine/coupon/{{coupon.useMemberType == 0 ? '':'un-'}}{{couponInfo.discountType}}.png"></glsx-image>
</view>
<!-- <view class="an_min_title_text mar5">到店使用服务后请出示该核销码给店员进行核销</view> -->
<view wx:if="{{couponInfo.effectiveType==3 || coupon.effectiveType==3}}" class="titleDay_text timeColor">永久有效</view>
<view wx:if="{{couponInfo.effectiveType==2 || coupon.effectiveType==2}}" class="titleDay_text timeColor">{{detailInfo.receiveStartTime || coupon.receiveStartTime}}-{{detailInfo.receiveEndTime || coupon.receiveEndTime}}</view>
<view wx:if="{{couponInfo.effectiveType==1 || coupon.effectiveType==1}}" class="titleDay_text timeColor">有效期至{{detailInfo.receiveEndTime || coupon.receiveEndTime}}</view>
<view class="lines"></view>
<block wx:if="{{coupon.discountType == 7}}">
<view wx:if="{{detailInfo.useType && !(detailInfo.effectiveType == 3 && detailInfo.useType == 2)}}" class="code_main_text {{coupon.useMemberType == 0 ? 'qrText':'changeColor'}}">
<text>剩余可用</text>
<view class="count_text">{{detailInfo.useAllAmount - detailInfo.usedAmount}}/{{detailInfo.useAllAmount}}</view>
<text>次</text>
</view>
<view wx:else class="code_main_text {{coupon.useMemberType == 0 ? 'qrText':'changeColor'}}">不限次数</view>
</block>
<block wx:else>
<view class="code_main_text {{coupon.useMemberType == 0 ? 'qrText':'changeColor'}}">
<text style="font-size: 24rpx; margin-top: 10rpx;">¥</text>
<view style="font-size: 40rpx; margin-right: 10rpx;">{{coupon.denomination / 100}}</view>
<text>无门槛</text>
</view>
</block>
<view wx:if="{{qrcodeURL}}" class="iamge_qr_wrap">
<glsx-image webp wx:if="{{future}}" class="qrcodeimage" src="mine/qrCode.png" />
<image wx:else class="qrcodeimage" src="{{qrcodeURL}}" />
<view wx:if="{{failure}}" class="qrBtns">{{detailInfo.couponState==5?'已使用':'已失效'}}</view>
</view>
<view wx:if="{{future}}" class="qrBtn">
<text wx:if="{{dayDiff}}" class="qrText">{{dayDiff}}</text>
<text wx:if="{{dayDiff}}">天</text>
<text wx:if="{{hourDiff}}" class="qrText">{{hourDiff}}</text>
<text wx:if="{{hourDiff}}">时</text>
<text wx:if="{{minDiff}}" class="qrText">{{minDiff}}</text>
<text wx:if="{{minDiff}}">分</text>
<text>后可用</text>
</view>
<view class="code_text_red {{coupon.useMemberType == 0 ? 'darkColor':'numberColor'}}">
{{detailInfo.verificationCode}}
</view>
<view class="lines" style="margin: 20rpx 0 18rpx;"></view>
<view class="process">
<glsx-image webp src="mine/{{coupon.useMemberType == 0 ? 'arrows':'unArrow'}}.png"></glsx-image>
<text class="process_text">导航到店</text>
<glsx-image webp class="rightArrow" src="mine/rightArrow.png" />
<glsx-image webp src="mine/{{coupon.useMemberType == 0 ? 'car':'unCar'}}.png"></glsx-image>
<text class="process_text">开始服务</text>
<glsx-image webp class="rightArrow" src="mine/rightArrow.png" />
<glsx-image webp src="mine/{{coupon.useMemberType == 0 ? 'ticket':'unTicket'}}.png"></glsx-image>
<text class="process_text">出示核销码</text>
</view>
<!-- <view wx:if="{{failure}}" class="code_failture">已失效</view> -->
<!-- <view wx:if="{{future}}" class="code_future">
<text wx:if="{{dayDiff}}">{{dayDiff}}天</text>
<text wx:if="{{hourDiff}}">{{hourDiff}}时</text>
<text wx:if="{{minDiff}}">{{minDiff}}分</text>
<text>后可用</text>
</view> -->
</view>
<!-- <view class="couponBox">
<view class="an_title_text">使用流程</view>
<view class="step_wrapper">
<view class="step_box">
<image webp class="step_icon" src="../../../images/coupons/scrm_step_one.png" />
<view class="an_title_text">导航到店</view>
</view>
<image webp class="step_arrpw" src="../../../images/coupons/scrm_step_arrow.png" />
<view class="step_box">
<image webp class="step_icon" src="../../../images/coupons/scrm_step_two.png" />
<view class="an_title_text">开始服务</view>
</view>
<image webp class="step_arrpw" src="../../../images/coupons/scrm_step_arrow.png" />
<view class="step_box">
<image webp class="step_icon" src="../../../images/coupons/scrm_step_three.png" />
<view class="an_title_text">出示核销码</view>
</view>
</view>
<view class="desc_wrapper">{{detailInfo.useDescription || ''}}</view>
</view> -->
<view class="couponBox" style="margin-bottom: 0;">
<view class="couponBox-X" style="padding-bottom: 16rpx;">
<view class="titleDay">有效日期:</view>
<view wx:if="{{couponInfo.effectiveType==3 || coupon.effectiveType==3}}" class="titleDay_text darkColor">永久有效</view>
<view wx:if="{{couponInfo.effectiveType==2 || coupon.effectiveType==2}}" class="titleDay_text darkColor">{{detailInfo.receiveStartTime || coupon.receiveStartTime}}-{{detailInfo.receiveEndTime || coupon.receiveEndTime}}</view>
<view wx:if="{{couponInfo.effectiveType==1 || coupon.effectiveType==1}}" class="titleDay_text darkColor">有效期至{{detailInfo.receiveEndTime || coupon.receiveEndTime}}</view>
</view>
<view class="couponBox-X" style="padding-bottom: 16rpx;">
<view class="titleDay">获取日期:</view>
<view class="titleDay_text darkColor">{{detailInfo.receiveTime}}</view>
</view>
<view class="couponBox-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 wx:if="{{detailInfo.list.length}}" class="couponBox">
<view class="an_title_text">使用记录</view>
<view wx:for="{{detailInfo.list}}" wx:key="index" class="note_line">
<view class="line_text_name">{{item.verificationMerchantName}}</view>
<view class="line_text">{{item.verificationTime}}</view>
<view class="line" wx:if="{{index < detailInfo.list.length - 1}}"></view>
</view>
</view>
</view>
</view>
<view class="box" wx:if="{{coupon.relatedGoodsId}}">
<view class="box-X">
<view class="title">关联商品</view>
<view class="goods">
<view class="icon">
<image webp src="{{coupon.relatedGoodsImage || ''}}"></image>
</view>
<view class="info">
<view>
<view class="name">{{coupon.relatedGoodsName || ''}}</view>
</view>
<view class="price">
¥<view class="price-X">{{coupon.relatedGoodsPrice || ''}}</view>
</view>
</view>
</view>
</view>
</view>
<!-- <view class="box" wx:if="{{detailInfo.suitMerchantLists && detailInfo.suitMerchantLists.length}}">
<view class="couponBox">
<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> -->
</block>
\ 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 () {}
})
{
"usingComponents": {}
}
\ No newline at end of file \ No newline at end of file
/* packageMine/pages/order/complete/complete.wxss */
page {
background-color: #fff;
}
.layout {
display: flex;
align-items: center;
flex-direction: column;
}
.icon {
width: 140rpx;
height: 140rpx;
margin: 112rpx 0 84rpx;
}
.title {
font-size: 40rpx;
font-weight: 500;
margin-bottom: 64rpx;
}
.text {
color: #656566;
font-size: 32rpx;
}
.tips {
color: #B9BABB;
margin-top: 20rpx;
}
.pay {
width: 332rpx;
height: 80rpx;
background: var(--btnColor);
border-radius: 8rpx;
color: #fff;
margin-top: 112rpx;
}
\ No newline at end of file \ No newline at end of file
<view class="layout">
<view class="icon">
<glsx-image webp src="mine/order/{{success?'success':'error'}}.png"></glsx-image>
</view>
<view class="title">{{success?'支付成功':'支付失败'}}</view>
<block wx:if="{{success}}">
<view class="text">您的订单已支付成功,请耐心等待商品发货!</view>
<view class="tips">{{count}}秒后自动跳转到商城订单</view>
</block>
<block wx:else>
<view class="pay text-center" bindtap="pay">重新支付</view>
</block>
</view>
\ No newline at end of file \ No newline at end of file
// packageMine/pages/order/components/OrderItem/OrderItem.js
Component({
/**
* 组件的属性列表
*/
properties: {
},
/**
* 组件的初始数据
*/
data: {
},
/**
* 组件的方法列表
*/
methods: {
}
})
{
"component": true,
"usingComponents": {}
}
\ No newline at end of file \ No newline at end of file
/* packageMine/pages/order/components/OrderItem/OrderItem.wxss */
\ No newline at end of file \ No newline at end of file
<!--packageMine/pages/order/components/OrderItem/OrderItem.wxml-->
<text>packageMine/pages/order/components/OrderItem/OrderItem.wxml</text>
import { wxqrcode as QR } from "~/lib/index";
import { orderMixin } from "~/mixins/index";
import { iosTimeFormat } from "~/utils/format";
Page({
behaviors: [orderMixin],
/**
* 页面的初始数据
*/
data: {
couponsList: [],
orderObj: [
{
label: "下单日期",
key: "time",
},
{
label: "订单编号",
key: "orderCode",
},
{
label: "收货地址",
key: "shipAddress",
alignItems: "flex-start",
},
{
label: "订单状态",
key: "orderStatus",
enum: true,
},
],
deliveryStatus: {
1: "待发货",
2: "已发货",
3: "已收货",
},
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
console.log(options,'=======')
if (options && options.orderCode) {
let orderCode = options.orderCode;
this.getOrderDetail(orderCode);
}
},
getOrderDetail(orderCode) {
let { orderObj } = this.data;
wx.p.wxApi.showLoading("加载中...");
wx.p.api.shopmallApi.getOrderDetail(orderCode).then((data) => {
wx.hideLoading();
console.log(data);
data.time = new Date(iosTimeFormat(data.createdDate)).format(
"yyyy.MM.dd hh:mm:ss"
);
data.orderGoods.map((e) => {
e.retailPrice = Number(e.retailPrice).toFixed(2);
if (e.activityPrice)
e.activityPrice = Number(e.activityPrice).toFixed(2);
});
data.orderPrice = Number(data.orderPrice).toFixed(2);
data.expressFee = Number(data.expressFee).toFixed(2);
data.payPrice = Number(data.payPrice).toFixed(2);
if (data.orderSource == 4) {
orderObj[2] = {
label: "商户订单号",
key: "outTradeNo",
};
}
this.setData({
orderInfo: data,
orderObj,
});
if (data.deliveryType == 1 && data.orderVerification)
this.setQr(data.orderVerification.verificationCode);
if (data.relatedUserCoupon) {
let list = data.relatedUserCoupon.map((item) => {
item.receiveStartTime = new Date(
iosTimeFormat(item.receiveStartTime)
).format("yyyy.MM.dd");
if (item.effectiveType == 1) {
item.receiveEndTime = new Date(
iosTimeFormat(item.receiveEndTime)
).format("yyyy.MM.dd hh:mm:ss");
} else {
item.receiveEndTime = new Date(
iosTimeFormat(item.receiveEndTime)
).format("yyyy.MM.dd");
}
return item;
});
this.setData({
couponsList: list,
});
}
});
},
toDetail() {
let [temp] = this.data.orderInfo.relatedUserCoupon,
{ discountType, useChannel, id } = temp,
detailInfo = {
xx: "xx",
};
if (discountType == 2 || discountType == 4) {
wx.p.router.go("/packageMall/pages/coupon/coupon", {
userCouponId: id,
useMemberType: this.data.useMemberType,
detailInfo,
});
return;
}
/**线上商品代金券 */
if (discountType == 3 && useChannel == 1) {
if (this.data.useMemberType == 1) {
wx.p.wxApi.showToast("代金券已使用");
return;
}
wx.p.router.go("/packageMine/pages/coupon/recommend/recommend", {
couponInfo: temp,
});
return;
}
wx.p.router.go("/packageMine/pages/coupon/detail/detail", {
item: temp,
});
},
setQr(data) {
this.setData({
qr: QR.createQrCodeImg(`t=1&c=${data}`),
});
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
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/detail/detail.wxss */
.layout {
padding: 24rpx 32rpx 68rpx;
}
.status-box {
height: 98rpx;
font-size: 36rpx;
color: #2C2C2C;
margin-bottom: 6rpx;
}
.status-box .icon{
width: 50rpx;
height: 52rpx;
margin-right: 12rpx;
}
.box {
background-color: #fff;
border-radius: var(--borderRadius);
margin-top: 20rpx;
padding: 24rpx 24rpx 40rpx;
}
.box:first-of-type{
margin-top: 0;
}
.box .title {
font-size: 32rpx;
padding-bottom: 24rpx;
font-weight: 500;
}
.box .item {
display: flex;
align-items: center;
font-size: 24rpx;
min-height: 48rpx;
line-height: 48rpx;
}
.box .item.flex-start {
align-items: flex-start;
}
.box .item .label {
width: 150rpx;
}
.box .item .value {
width: calc(100% - 150rpx);
color: #656566;
}
.box .goods {
margin-top: 40rpx;
display: flex;
align-items: center;
height: 160rpx;
}
.box .goods .icon {
width: 160rpx;
height: 100%;
overflow: hidden;
border-radius: var(--borderRadius);
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 .specification{
font-size: 24rpx;
color: #B1B1B3;
}
.box .goods .info .price {
display: flex;
justify-content: space-between;
color: var(--priceColor);
font-weight: 500;
font-weight: 500;
}
.box .goods .info .price .count {
color: #656566;
font-weight: normal;
}
.price-item {
height: 60rpx;
display: flex;
justify-content: space-between;
align-items: center;
color: #656566;
font-size: 24rpx;
}
.price-item.line {
border-bottom: 2rpx solid #E3E3E6;
margin-bottom: 12rpx;
}
.price-item .price {
font-size: 28rpx;
color: var(--priceColor);
font-weight: 500;
}
.price-item .sum{
font-size: 34rpx;
font-weight: 500;
}
.price-item .unit{
font-size: 28rpx;
}
.discounts {
position: relative;
}
.discounts .selected {
height: 40rpx;
background: rgba(252, 91, 50, 0.12);
border-radius: 4rpx;
font-size: 24rpx;
font-weight: 500;
color: var(--priceColor);
line-height: 40rpx;
padding: 0 20rpx;
position: absolute;
left: 104rpx;
top: 50%;
transform: translate(0, -50%);
}
.qr-box {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
}
.qr-box .qr {
width: 250rpx;
height: 250rpx;
background: #FFF;
border: 2rpx solid #979797;
box-sizing: border-box;
padding: 10rpx;
}
.qr-box .code {
font-size: 64rpx;
margin: 20rpx 0;
color: var(--priceColor);
}
.qr-box .tips {
color: #656566;
font-size: 24rpx;
padding-bottom: 28rpx;
}
.box_wrapper {
width: 100%;
height: 150rpx;
margin-top: 19rpx;
display: flex;
align-items: center;
position: relative;
box-sizing: border-box;
background-size: cover;
}
.box_wrapper .bg{
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
}
.box_wrapper .info{
position: relative;
z-index: 2;
width: 100%;
height: 100%;
}
.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_four {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
}
.left_text_three {
font-size: 20rpx;
margin-top: 6rpx;
}
.anText {
font-size: 70rpx;
/* color: rgba(white, white, white, 0.45); */
font-weight: 600;
color: var(--priceColor);
/* opacity: 0.45; */
}
.price_icon {
font-size: 24rpx;
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;
text-align: center;
line-height: 44rpx;
font-size: 28rpx;
font-weight: 600;
z-index: 2;
}
.box_btn_color {
color: var(--priceColor);
}
.box_btn_color_grey {
color: #6D6D6D;
}
.title_text {
color: #282829;
font-weight: 600;
color: #282829;
font-size: 28rpx;
width: 420rpx;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
.h4_text {
font-weight: 400;
color: #B1B1B3;
font-size: 24rpx;
}
.brightColor {
color: var(--priceColor);
}
.darkColor {
color: #6D6D6D;
}
.describeColor {
color: #D83C14;
}
.discount {
font-size: 20rpx;
font-weight: 500;
margin-bottom: 10rpx;
}
.leftMargin {
padding-left: 32rpx;
}
\ No newline at end of file \ No newline at end of file
<block wx:if="{{orderInfo}}">
<view class="layout">
<view class="box">
<view class="status-box text-center">
<view class="icon">
<!-- // 订单状态(1:待付款;2:已支付;3:已关闭;4:已发货;5:已收货;6:待审核;7:审核通过;8:审核不通过;9:待确认收到退货;10:退款中;11:已退款;12:退款失败) -->
<block wx:if="{{orderInfo.orderStatus == 1||orderInfo.orderStatus == 13||orderInfo.orderStatus==14}}">
<glsx-image webp src="mine/order-wait.png"></glsx-image>
</block>
<block wx:elif="{{orderInfo.orderStatus == 2||orderInfo.orderStatus == 4 }}">
<glsx-image webp src="mine/order-receiving.png"></glsx-image>
</block>
<block wx:elif="{{orderInfo.orderStatus == 5||orderInfo.orderStatus == 15}}">
<glsx-image webp src="mine/order-success.png"></glsx-image>
</block>
<block wx:else>
<glsx-image webp src="mine/order-lose.png"></glsx-image>
</block>
</view>
{{statusEnum[orderInfo.orderStatus]}}
</view>
<block wx:if="{{orderInfo.deliveryCompany}}">
<view class="title">发货信息</view>
<view class="item">
<view class="label">物流信息:</view>
<view class="value">{{orderInfo.deliveryCompany || ''}}{{orderInfo.deliveryNumber || ''}}</view>
</view>
<view class="item">
<view class="label">物流进度:</view>
<view class="value">
{{deliveryStatus[orderInfo.deliveryStatus]}}
</view>
</view>
</block>
</view>
<view class="box">
<view class="title">订单信息</view>
<block wx:for="{{orderObj}}" wx:key="index">
<view class="item {{item.alignItems}}">
<view class="label">{{item.label}}:</view>
<view class="value">
<block wx:if="{{item.enum}}">
{{statusEnum[orderInfo[item.key]]|| ''}}
</block>
<block wx:else>{{orderInfo[item.key] || ''}}</block>
</view>
</view>
</block>
</view>
<view class=" box">
<view class="title">订单商品</view>
<view class="merchantName text-hide">
{{orderInfo.merchantName}}
</view>
<block wx:key="index" wx:for="{{orderInfo.orderGoods}}">
<view class="goods">
<view class="icon">
<image webp src="{{orderInfo.orderSource == 5?orderInfo.activityBigImg:item.goodsImage}}"></image>
</view>
<view class="info">
<view>
<view class="name text-hide">{{orderInfo.orderSource == 5?orderInfo.activityName:item.goodsName}}</view>
<view class="specification">{{item.specificationData || ''}}</view>
</view>
<view class="price">
¥{{orderInfo.orderSource == 5?orderInfo.payPrice:(item.activityPrice || item.retailPrice)}}
<view class="count">x{{orderInfo.orderSource == 5? 1: item.goodsNumber}}</view>
</view>
</view>
</view>
</block>
</view>
<view class="box" wx:if="{{orderInfo.orderSource!=5}}">
<view class="title">订单金额</view>
<view class="price-item">
商品总价:
<view class="price"><text class="unit">¥</text>{{orderInfo.orderPrice}}</view>
</view>
<view class="price-item line">
运费:
<view class="price"><text class="unit">¥</text>{{orderInfo.expressFee}}</view>
</view>
<view class="price-item line discounts" wx:if="{{orderInfo.subOrderCoupon.denomination}}">
优惠:
<view class="selected">已选一张</view>
<view class="price"><text class="unit">¥</text>{{(orderInfo.subOrderCoupon.discountAmount)/100}}</view>
</view>
<view class="price-item">
订单金额:
<view class="price sum"><text class="unit">¥</text>{{orderInfo.payPrice}}</view>
</view>
</view>
<!-- deliveryType 结算方式(1:到店核销,2:快递发货) -->
<block wx:if="{{orderInfo.deliveryType == 1 && qr && !orderInfo.relatedUserCoupon}}">
<view class="box">
<view class="title">核销码</view>
<view class="qr-box">
<view class="qr">
<image webp src="{{qr}}"></image>
</view>
<view class="code">{{orderInfo.orderVerification.verificationCode}}</view>
<view class="tips">请将核销码拿给店员,避免泄露给他人</view>
</view>
</view>
</block>
<view class="box" wx:if="{{orderInfo.relatedUserCoupon}}">
<view class="title">关联优惠券</view>
<block wx:for="{{couponsList}}" wx:key="index">
<view class="box_wrapper">
<glsx-image webp src="mine/coupon/{{item.usedAmount == 0?'':'un-'}}coupon-{{item.discountType}}.png" class="bg"></glsx-image>
<view class="info flex">
<view class="{{item.discountType==4 || item.discountType==7 ? '':'left_icon_box'}}">
<view wx:if="{{item.discountType==3}}" class="left_text_one left_text_two {{item.usedAmount == 0 ? 'brightColor':'darkColor'}}">
<text class="price_icon">¥</text>
<text>{{item.denomination}}</text>
</view>
<view wx:if="{{item.discountType==2}}" class="left_text_one left_text_two {{item.usedAmount == 0 ? 'brightColor':'darkColor'}}">
<text class="anText">{{item.discountIntensity / 100}}</text>
<text class="discount">折</text>
</view>
</view>
<view class="main_box {{item.discountType==4 || item.discountType==7 ? 'leftMargin':''}}">
<view class="title_text {{item.usedAmount == 0 ? 'brightColor':'darkColor'}}">{{item.couponName}}</view>
<view wx:if="{{item.useType==0 && coupons.discountType==7}}" class="h4_text {{item.usedAmount == 0 ? 'describeColor':'darkColor'}}">不限次数</view>
<view wx:if="{{item.useType==1 && coupons.discountType==7}}" class="h4_text {{item.usedAmount == 0 ? 'describeColor':'darkColor'}}">可用{{item.useAmount}}次</view>
<view wx:if="{{item.useType==2 && coupons.discountType==7}}" class="h4_text {{item.usedAmount == 0 ? 'describeColor':'darkColor'}}">{{item.useLimitDays}}天可用{{item.useAmount}}次</view>
<view wx:if="{{item.useBarriers==1 && item.discountType!=4}}" class="h4_text {{item.usedAmount == 0 ? 'describeColor':'darkColor'}}">无门槛</view>
<view wx:if="{{item.useBarriers==2 && item.discountType!=4}}" class="h4_text {{item.usedAmount == 0 ? 'describeColor':'darkColor'}}">满{{item.full}}元可用</view>
<view wx:if="{{item.effectiveType==3}}" class="h4_text {{item.usedAmount == 0 ? 'describeColor':'darkColor'}}">永久有效</view>
<view wx:if="{{item.effectiveType==2}}" class="h4_text {{item.usedAmount == 0 ? 'describeColor':'darkColor'}}">{{item.receiveStartTime}}-{{item.receiveEndTime}}</view>
<view wx:if="{{item.effectiveType==1}}" class="h4_text {{item.usedAmount == 0 ? 'describeColor':'darkColor'}}">有效至{{item.receiveEndTime}}</view>
</view>
<block wx:if="{{!hideBtn}}">
<view wx:if="{{item.usedAmount==0}}" class="box_btn box_btn_color" bind:tap="toDetail">去使用</view>
<view wx:if="{{item.usedAmount==1}}" class="box_btn box_btn_color box_btn_color_grey" bind:tap="toDetail">去查看</view>
<view wx:if="{{item.usedAmount==2}}" class="box_btn box_btn_color box_btn_color_grey" bind:tap="toDetail">去查看</view>
</block>
</view>
</view>
</block>
</view>
</view>
</block>
\ No newline at end of file \ No newline at end of file
// packageMine/pages/order/index/index.js
import {
orderMixin
} from '~/mixins/index'
import NP from 'number-precision'
/**查询订单
* '全部 ', '待付款 1', '待发货 3', '待收货 2', '评价 4', '退款/售后 5'
*/
const orderStatusPartEnum = {
0: '',
1: 1,
2: 3,
3: 2,
4: 5,
}
Page({
behaviors: [orderMixin],
/**
* 页面的初始数据
*/
data: {
pageNum: 1,
tab: ['全部', '待付款', '待发货', '待收货', '退款/售后'],
list: [],
hasUserInfo: true,
},
navbarReady(e) {
wx.p.wxApi.getViewInfo('.tab', (res) => {
this.setData({
padding_bottom: e.detail.height,
margin_top: e.detail.height + res.height,
})
})
},
jump(e) {
let {
item: {
orderStatus,
orderCode,
orderSource
},
} = e.currentTarget.dataset
if (orderSource == 5 && (orderStatus == 2 || orderStatus == 7)) return
let url = '/packageMine/pages/order/detail/detail'
wx.p.router.go(url, {
orderCode
})
},
afterSaleDetail(e) {
let url = '/packageMine/pages/order/afterSaleDetail/afterSaleDetail'
let {
item: {
orderCode
},
} = e.currentTarget.dataset
wx.p.router.go(url, {
orderCode
})
},
back() {
let {
length
} = getCurrentPages()
if (length == 1) wx.p.router.switchTab('/pages/tab/mine/index')
else wx.p.router.back()
},
changeTab(e) {
this.setData({
tabIndex: e.detail,
orderStatusPart: orderStatusPartEnum[e.detail],
})
this.clearData()
},
//立即评价
evaluate(e) {
let {
item: {
orderCode
},
} = e.currentTarget.dataset
let {
userInfo
} = this.data
wx.p.router.go('/packageMall/pages/addComment/addComment', {
orderCode,
userInfo,
})
},
//查看详情评价
lookevaluate(e) {
let {
item: {
orderCode
},
} = e.currentTarget.dataset
wx.p.router.go('/packageMall/pages/commentDetails/commentDetails', orderCode)
},
//取消售后
cancelOrder(e) {
let {
orderCode
} = e.currentTarget.dataset
wx.showModal({
title: '温馨提示',
content: '请问您是否要取消售后',
confirmText: '确认',
cancelText: '取消',
confirmColor: '#F13C3D',
}).then((res) => {
if (res.confirm) {
wx.p.api.shopmallApi.cancelOrder(orderCode).then(({
code,
message
}) => {
if (code == '0') {
wx.p.wxApi.showToast('操作成功')
setTimeout(() => {
this.clearData()
}, 1.5e3)
} else {
wx.p.wxApi.showToast(message)
}
})
}
})
},
//取消付款
cancelPay(e) {
let {
orderCode
} = e.currentTarget.dataset
wx.showModal({
title: '温馨提示',
content: '请问您是否要取消付款',
confirmText: '确认',
cancelText: '取消',
confirmColor: '#F13C3D',
}).then((res) => {
if (res.confirm) {
wx.p.api.shopmallApi.cancelPay(orderCode).then(({
code,
message
}) => {
if (code == '0') {
wx.p.wxApi.showToast('操作成功')
setTimeout(() => {
this.clearData()
}, 1.5e3)
} else {
wx.p.wxApi.showToast(message)
}
})
}
})
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
this.setData({
tabIndex: options.tabIndex,
orderStatusPart: orderStatusPartEnum[options.tabIndex],
})
this.clearData()
},
onShow() {
if (this.refresh) this.clearData()
},
onHide() {
this.refresh = true
},
async clearData() {
const res = await wx.p.router.intercept()
if (res) return
this.setData({
listFlag: false,
list: [],
nothing: false,
pageNum: 1,
})
this.getOrderList()
},
search() {
this.clearData()
},
clear() {
this.setData({
keyword: '',
})
},
input(e) {
this.setData({
keyword: e.detail.value,
})
},
blur() {
let {
keyword
} = this.data
this.setData({
keyword,
})
},
getOrderList() {
wx.p.wxApi.showLoading('加载中...')
let {
orderStatusPart,
pageNum,
keyword
} = this.data
let obj = {
orderStatusPart,
currentPage: pageNum,
}
if (keyword) {
keyword = keyword.replace(/\ /g, '')
if (keyword.length) obj.keyword = keyword
}
let list = []
wx.p.api.mineApi.getOrderList(obj).then((data) => {
wx.hideLoading()
data?.list?.map((e) => {
let {
orderGoods,
createdDate,
orderClassify
} = e
let goodsNumber = 0
let expiredTime = 0
orderGoods?.map((i) => {
i.retailPrice = Number(i.retailPrice).toFixed(2)
if (i.activityPrice)
i.activityPrice = Number(i.activityPrice).toFixed(2)
goodsNumber += i.goodsNumber
expiredTime = new Date(i.warrantyDate).format('yyyy-MM-dd hh:mm:ss')
if (orderClassify == 5) {
e.payPrice = NP.times(i.retailPrice, i.goodsNumber)
}
})
list.push({
...e,
goodsNumber,
time: new Date(createdDate).format('yyyy-MM-dd hh:mm:ss'),
expiredTime
})
})
this.setData({
list,
listFlag: true,
})
wx.hideLoading()
})
},
pay(e) {
let _this = this
wx.p.wxApi.showLoading('结算中...')
wx.p.api.shopmallApi
.payOrder(e.currentTarget.dataset)
.then(({
needPay,
payParams
}) => {
wx.hideLoading()
if (needPay) {
let params = {
nonceStr: payParams.nonceStr,
paySign: payParams.paySign,
signType: payParams.signType,
timeStamp: payParams.timeStamp,
package: payParams.packages,
}
wx.requestPayment({
...params,
success(res) {
setTimeout(() => {
_this.clearData()
}, 1.5e3)
_this.requestSubscribeMessage()
},
fail(res) {
if (res.errMsg == 'requestPayment:fail cancel') {
wx.p.wxApi.showToast('取消支付')
} else {
wx.p.router.go('/packageMine/pages/order/complete/complete', {
params
})
}
},
})
} else {
_this.requestSubscribeMessage()
}
})
},
requestSubscribeMessage() {
wx.p.router.go('/packageMine/pages/order/complete/complete', {
success: true,
})
return
let systemInfo = wx.p.storage.get('system_info')
if (systemInfo && systemInfo.environment != 'wxwork') {
wx.p.router.go('/packageMine/pages/order/complete/complete', {
success: true,
})
return
}
let tmplIds
wx.p.api.shopmallApi.requestSubscribeMessage().then((res) => {
tmplIds = res.data
wx.requestSubscribeMessage({
tmplIds: tmplIds,
success(res) {
wx.p.router.go('/packageMine/pages/order/complete/complete', {
success: true,
})
},
})
})
},
confirmReceipt(e) {
let {
orderCode
} = e.currentTarget.dataset
wx.showModal({
title: '温馨提示',
content: '是否确认收货',
confirmText: '确认',
cancelText: '取消',
confirmColor: '#F13C3D',
}).then((res) => {
if (res.confirm) {
wx.p.api.shopmallApi.confirmReceipt(orderCode).then((data) => {
wx.p.wxApi.showToast('操作成功')
setTimeout(() => {
this.clearData()
}, 1.5e3)
})
}
})
},
afterSale(e) {
let {
item: {
orderCode,
payPrice
},
} = e.currentTarget.dataset
wx.p.router.go('/packageMine/pages/order/afterSale_step_one/afterSale_step_one', {
orderCode,
refundPrice: payPrice,
})
},
// 卡卷 售后详情
toSaleDetailPage(e) {
const {
item
} = e.currentTarget.dataset
wx.p.router.go('/packageEquity/pages/saleDetail/saleDetail', {
orderCode: item.orderCode
})
},
// 查看卡券
toCheckCard(e) {
const {
item
} = e.currentTarget.dataset
wx.p.router.go('/packageEquity/pages/kaqDetail/kaqDetail', {
orderCode: item.orderCode
})
},
// 查看膨胀金详情
toGoldDetail(e) {
const {
item
} = e.currentTarget.dataset
wx.p.router.go('/packageEquity/pages/kaqDetail/orderDetail', {
orderCode: item.orderCode
})
},
// 卡卷 申请售后
toSaleApplyPage(e) {
let {
item
} = e.currentTarget.dataset
item.pageFrom = 'coupons'
wx.p.router.go('/packageEquity/pages/saleApply/saleApply', item)
},
// 卡卷 确认收货
toComfirmPage(e) {
let {
item
} = e.currentTarget.dataset
let para = {
orderCode: item.orderCode,
}
wx.showModal({
title: '提示',
content: '确认收货',
confirmText: '是',
cancelText: '否',
confirmColor: '#F13C3D',
}).then((res) => {
if (res.confirm) {
wx.p.api.equityApi.comfirmRevice(para).then((res) => {
wx.p.wxApi.showToast('确认收货成功')
setTimeout(() => {
this.clearData()
}, 1.5e3)
})
}
})
},
// 套餐申请售后
toSaleApplyPackage(e) {
let {
item
} = e.currentTarget.dataset
item.pageFrom = 'package'
wx.p.router.go('/packageEquity/pages/saleApply/saleApply', item)
},
// 套餐售后详情
toPackageDetail(e) {
const {
item
} = e.currentTarget.dataset
wx.p.router.go('/packageEquity/pages/packageDetail/packageDetail', {
orderCode: item.orderCode
})
},
// 套餐查看卡包
toCheckPackage(e) {
const {
item
} = e.currentTarget.dataset
wx.p.router.go('/packageEquity/pages/packageDetail/packageDetail', {
orderCode: item.orderCode
})
},
// 精品订单跳转页面
boutiqueJump(e) {
let {
orderCode
} = e.currentTarget.dataset
wx.p.router.go('/packageMine/pages/boutiquePages/boutiqueOrder/boutiqueOrder', {
orderCode,
type: 2,
})
}
})
\ No newline at end of file \ No newline at end of file
{
"navigationStyle": "custom",
"usingComponents": {
"tab": "/components/Tab/Tab"
}
}
\ No newline at end of file \ No newline at end of file
/* packageMine/pages/order/index/index.wxss */
.sticky-box {
background-color: #F9F7F7;
}
.tab {
position: fixed;
top: 0;
left: 0;
width: 100%;
background-color: #F9F7F7;
z-index: 2;
transition: all 0.4s;
}
.navigation {
width: 100%;
height: 100%;
position: relative;
}
.navigation .back {
width: 64rpx;
height: 64rpx;
background: rgba(255, 255, 255, 0.5);
border-radius: var(--margin);
position: absolute;
left: 20rpx;
}
.navigation .back .icon {
width: 36rpx;
height: 36rpx;
}
.search-box {
position: absolute;
left: 80rpx;
width: 420rpx;
height: 72rpx;
background: #F9F7F7;
border-radius: 36rpx;
display: flex;
align-items: center;
box-sizing: border-box;
padding: 0 16rpx 0 var(--margin);
}
.search-box .icon {
width: 40rpx;
height: 100%;
}
.search-box .input {
width: calc(100% - 98rpx);
}
.search-box .clear-box {
width: 58rpx;
height: 100%;
display: flex;
align-items: center;
justify-content: center;
}
.search-box .clear-box .clear {
width: 32rpx;
height: 32rpx;
opacity: 0.7;
}
.placeholder-class {
color: #c8c9cc;
}
.layout {
padding: 24rpx var(--margin) 40rpx;
}
.layout .item {
position: relative;
padding-left: 24rpx;
margin-bottom: 20rpx;
background-color: #fff;
box-sizing: border-box;
border-radius: var(--borderRadius);
display: flex;
flex-direction: column;
}
.layout .item .top {
height: 82rpx;
display: flex;
align-items: center;
justify-content: space-between;
padding-right: 24rpx;
position: relative;
}
.delivery-icon {
position: absolute;
width: 106rpx;
height: 80rpx;
left: 366rpx;
bottom: 0;
}
.layout .item .top .name {
width: 366rpx;
}
.layout .item .content-top {
border-top: 2rpx solid #eff0f2;
}
.layout .item .content {
border-top: 2rpx solid #eff0f2;
border-bottom: 2rpx solid #eff0f2;
}
.content-bottom {
border-bottom: 2rpx solid #eff0f2;
}
.layout .item .goods {
height: 208rpx;
padding: 24rpx 24rpx 24rpx 0;
box-sizing: border-box;
display: flex;
}
.addTo {
border-bottom: 2rpx solid #eff0f2;
}
.layout .item .goods .btn {
display: flex;
align-items: center;
justify-content: center;
width: 124rpx;
height: 46rpx;
border-radius: 25rpx;
border: 2rpx solid #b1b1b3;
font-size: 24rpx;
margin-left: 12rpx;
color: #656566;
position: absolute;
bottom: 0;
right: 0;
}
.layout .item .goods .confirm {
border-color: var(--priceColor);
color: var(--priceColor);
font-weight: 500;
}
.layout .item .icon {
width: 160rpx;
height: 160rpx;
margin-right: 20rpx;
border-radius: 8rpx;
overflow: hidden;
}
.background-X {
background-color: rgb(244, 244, 244);
}
.layout .item .info {
width: calc(100% - 180rpx);
height: 160rpx;
display: flex;
flex-direction: column;
position: relative;
}
.layout .item .info .info-top,
.layout .item .info .info-bottom {
display: flex;
align-items: center;
justify-content: space-between;
}
.layout .item .info .info-top .price {
color: var(--priceColor);
font-size: 36rpx;
letter-spacing: -2rpx;
font-weight: 500;
flex-shrink: 0;
}
.layout .item .info .info-top .price .unit {
font-size: 24rpx;
}
.layout .item .info .info-bottom {
margin-top: 4rpx;
font-size: 24rpx;
color: #707071;
}
.layout .item .info .info-bottom .number {
margin-left: auto;
}
.layout .item .info .info-bottom .specification {
color: #b1b1b3;
}
.layout .item .status {
color: #b1b1b3;
font-size: 24rpx;
color: #282829;
}
.layout .item .bottom {
height: 80rpx;
display: flex;
align-items: center;
font-size: 24rpx;
color: #656566;
}
.layout .item .bottom .price {
color: var(--priceColor);
font-weight: 500;
}
.layout .item .btn-box {
position: absolute;
right: 24rpx;
bottom: 16rpx;
display: flex;
align-items: center;
justify-content: flex-end;
}
.layout .item .btn-box .btn {
display: flex;
align-items: center;
justify-content: center;
width: 124rpx;
height: 46rpx;
border-radius: 25rpx;
border: 2rpx solid #b1b1b3;
font-size: 24rpx;
margin-left: 12rpx;
color: #656566;
}
.layout .item .btn-box .pay {
background-color: var(--priceColor);
color: #fff;
border-color: var(--priceColor);
}
.layout .item .btn-box .empty{
color: var(--priceColor);
background-color: #fff;
}
.layout .item .btn-box .confirm {
border-color: var(--priceColor);
color: var(--priceColor);
font-weight: 500;
}
.userProfile {
background-color: #fff;
font-size: 24rpx;
margin: 0;
padding: 0;
font-weight: 500;
line-height: 46rpx;
}
.layout .coupon-item {
height: 202rpx;
background: #fefffe;
border-radius: 8rpx;
margin-bottom: 36rpx;
padding: 20rpx;
box-sizing: border-box;
position: relative;
}
.layout .coupon-item .orderPrices {
position: absolute;
color: var(--priceColor);
font-size: 48rpx;
right: 32rpx;
}
.layout .coupon-item .orderPrices text {
font-size: 36rpx;
}
.layout .coupon-item .icon {
width: 162rpx;
height: 162rpx;
margin-right: 20rpx;
}
.layout .coupon-item .info {
width: 360rpx;
height: 100%;
color: #b1b1b3;
font-size: 24rpx;
}
.layout .coupon-item .info .name {
font-size: 28rpx;
font-weight: 500;
color: #282829;
}
.layout .coupon-item .info .order-btn {
width: 138rpx;
height: 48rpx;
background: var(--btnColor);
border-radius: 24rpx;
margin-top: 40rpx;
color: #ffffff;
font-size: 24rpx;
}
.imageHeight {
height: 99rpx !important;
}
.imageStraight {
width: 92rpx;
height: 92rpx;
border-radius: 50%;
}
\ No newline at end of file \ No newline at end of file
<view class="sticky-box">
<navigation-bar custom bindnavbarReady="navbarReady" page-title="我的订单">
<view class="navigation">
<view class="back text-center y-center" bindtap="back">
<glsx-image webp src="mall/back.png" class="icon"></glsx-image>
</view>
<view class="search-box y-center">
<view class="icon text-center">
<icon type="search" size="16"></icon>
</view>
<input type="text" placeholder="搜索" value="{{keyword}}" class="input" confirm-type="search" bindconfirm="search" bindinput="input" bindblur="blur" />
<block wx:if="{{keyword}}">
<view class="clear-box" bindtap="clear">
<view class="sprite-icon icon-clear"></view>
</view>
</block>
</view>
</view>
</navigation-bar>
<view class="tab" style="top:{{padding_bottom }}px;">
<tab tab="{{tab}}" bindclick="changeTab" index="{{tabIndex}}"></tab>
</view>
</view>
<block wx:if="{{margin_top}}">
<view class="layout isFullSucreen" style="margin-top:{{margin_top}}px;">
<block wx:if="{{listFlag}}">
<block wx:if="{{list.length}}">
<block wx:for="{{list}}" wx:key="index">
<!-- orderClassify 订单类型(1.订单;2:会员权益订单;3:门店服务订单;4:精品升级订单;5:平台商城订单) -->
<block wx:if="{{item.orderClassify == 1}}">
<view class="item" catchtap="jump" data-item="{{item}}">
<view class="top">
<view class="delivery-icon" wx:if="{{item.orderSource != 5}}">
<glsx-image webp src="mine/order/deliveryType-{{item.deliveryType}}.png">
</glsx-image>
</view>
<view class="name text-hide">{{item.merchantName}}</view>
<!-- 订单状态 orderStatus(1:待付款;2:已支付;3:已关闭;4:已发货;5:已收货;6:待发货;7:待安装;8:已安装;9:售后中;10:售后完成)
售后订单状态 afterSaleStatus(1:待审核;2:审核通过;3:审核不通过;4:待确认收到退货;5:退款中;6:已退款;7:退款失败)
-->
<view class="status">{{item.afterSaleStatus ? afterSaleStatus[item.afterSaleStatus]
:statusEnum[item.orderStatus]}}</view>
</view>
<view class="content-top {{item.orderStatus == 5 || item.orderStatus == 8?'':'content-bottom'}}">
<block wx:for="{{item.orderGoods}}" wx:for-item="i" wx:for-index="ind" wx:key="ind">
<view class="goods {{item.orderStatus == 5 || item.orderStatus == 8?'addTo':''}}">
<view class="icon">
<image webp wx:if="{{item.orderSource == 5}}" src="{{item.activityBigImg}}"></image>
<image webp wx:else src="{{i.goodsImage}}"></image>
</view>
<view class="info">
<view class="info-top">
<view class="name text-hide">{{item.orderSource == 5 ? item.activityName: i.goodsName}}</view>
<view class="price">
<text class="unit">¥</text>
{{item.orderSource == 5 ? item.payPrice: (i.activityPrice ||i.retailPrice)}}
</view>
</view>
<view class="info-bottom">
<block wx:if="{{i.specificationData}}">
<view class="specification">{{i.specificationData}}</view>
</block>
<view class="number">
x{{item.orderSource == 5 ? 1: i.goodsNumber}}
</view>
</view>
<!-- !hasUserInfo -->
<view wx:if="{{item.orderGoods.length > 1 && !hasUserInfo}}">
<block wx:if="{{item.orderStatus == 5 || item.orderStatus == 8}}">
<block wx:if="{{item.evaluatedFlag == 'Y'}}">
<view class="btn confirm" catchtap="lookevaluate" data-item="{{item}}">查看评价</view>
</block>
<block wx:else>
<button catchtap="getUserProfile" wx:if="{{!hasUserInfo}}" class="btn confirm userProfile" data-item="{{item}}"> 立即评价 </button>
<view class="btn confirm" catchtap="evaluate" wx:else data-item="{{item}}">立即评价</view>
</block>
</block>
</view>
</view>
</view>
</block>
</view>
<view class="bottom" wx:if="{{item.orderSource == 5}}">
共1件商品,实付款<text class="price">¥{{item.payPrice}}</text>
</view>
<view class="bottom" wx:else>
共{{item.goodsNumber}}件商品,实付款<text class="price">¥{{item.payPrice}}</text>
</view>
<!-- 1:待付款;2:已支付;3:已关闭;4:已发货;5:已收货;6:待发货;7:待安装;8:已安装;9:售后中;10:售后完成 -->
<!-- 售后状态 1:待审核;2:审核通过;3:审核不通过;4:待确认收到退货;5:退款中;6:已退款;7:退款失败 -->
<block wx:if="{{item.orderStatus != 3}}">
<view class="btn-box">
<block wx:if="{{!item.afterSaleStatus}}">
<block wx:if="{{item.orderStatus == 1}}">
<view class="btn pay" catchtap="cancelPay" data-order-code="{{item.orderCode}}">取消付款</view>
<block wx:if="{{item.orderSource != 4}}">
<view class="btn pay" catchtap="pay" data-order-code="{{item.orderCode}}">去支付</view>
</block>
</block>
<block wx:if="{{item.orderSource==5 && (item.orderStatus == 2 || item.orderStatus == 7)}}">
<view class="btn pay" data-item="{{item}}" bind:tap="toGoldDetail">查看详情</view>
</block>
<block wx:elif="{{item.orderStatus > 2 && item.orderStatus < 9}}">
<!-- deliveryType 结算方式(1:到店核销,2:快递发货) -->
<block wx:if="{{item.deliveryType == 2 && item.orderStatus == 4}}">
<view class="btn confirm" catchtap="confirmReceipt" data-order-code="{{item.orderCode}}">确认收货
</view>
</block>
<block wx:if="{{item.payPrice > 0 && item.orderSource != 4}}">
<view class="btn" catchtap="afterSale" data-item="{{item}}" wx:if="{{!(item.relatedUserCouponStatus == 2 || item.relatedUserCouponStatus == 3)}}">申请售后
</view>
</block>
</block>
<!-- !hasUserInfo -->
<view wx:if="{{item.orderGoods.length == 1 && !hasUserInfo}}">
<block wx:if="{{item.orderStatus == 5 || item.orderStatus == 8}}">
<block wx:if="{{item.evaluatedFlag == 'Y'}}">
<view class="btn confirm" catchtap="lookevaluate" data-item="{{item}}">查看评价</view>
</block>
<block wx:else>
<button catchtap="getUserProfile" wx:if="{{!hasUserInfo}}" class="btn confirm userProfile" data-item="{{item}}"> 立即评价 </button>
<view class="btn confirm" catchtap="evaluate" wx:else data-item="{{item}}">立即评价</view>
</block>
</block>
</view>
</block>
<block wx:else>
<block wx:if="{{item.afterSaleStatus == 1}}">
<view class="btn pay" catchtap="cancelOrder" data-order-code="{{item.orderCode}}">取消售后</view>
</block>
<view class="btn" data-item="{{item}}" catchtap="afterSaleDetail">售后详情</view>
</block>
</view>
</block>
</view>
</block>
<block wx:if="{{item.orderClassify == 2 || item.orderClassify == 3}}">
<view class="item" wx:for="{{item.orderGoods}}" wx:for-item="i" wx:for-index="ind" wx:key="ind">
<view class="top">
<!-- <view class="delivery-icon">
<image webp src="../../../images/{{item.orderType == 1?'exchange':'combo'}}.png"></image>
</view> -->
<view class="name text-hide" wx:if="{{item.orderClassify == 3}}">{{item.merchantName}}</view>
<view class="name text-hide" wx:if="{{item.orderClassify == 2}}">平台特供</view>
<!-- 套餐状态 -->
<view class="status" wx:if="{{item.orderClassify == 3 && item.equityOrderStatus !== 4}}">
{{cardStatus[item.equityOrderStatus]}}</view>
<view class="status" wx:if="{{item.orderClassify == 3 && item.equityOrderStatus == 4}}">
{{reStatus[item.equityOrderStatus]}}</view>
<!-- 直冲卡卷状态 -->
<view class="status" wx:if="{{i.appearance == 2}}">{{reStatus[item.equityOrderStatus]}}</view>
<view class="status" wx:if="{{i.appearance == 1 && item.equityOrderStatus !== 3}}">
{{cardStatus[item.equityOrderStatus]}}</view>
<view class="status" wx:if="{{i.appearance == 1 && item.equityOrderStatus == 3}}">已收货</view>
</view>
<view class="content">
<view class="goods">
<view class="icon background-X">
<!-- <image webp src="{{i.goodsImage}}"></image> -->
<glsx-image webp wx:if="{{item.orderClassify == 3}}" src="mine/order/combo.png"></glsx-image>
<image webp wx:else src="{{i.goodsImage}}" class="{{i.appearance == 1 ?'imageHeight':'imageStraight'}}"></image>
</view>
<view class="info">
<view class="info-top">
<view class="name text-hide">{{i.goodsName}}</view>
<view class="price">
<text class="unit">¥</text>
{{i.activityPrice ||i.retailPrice}}
</view>
</view>
<view class="info-bottom">
<view class="specification">
<view wx:if="{{i.appearance==1}}">质保期至 {{item.expiredTime}}</view>
<view wx:if="{{i.appearance == 2}}">充值账号:{{i.rechargeNumber || ''}}</view>
<view wx:if="{{i.appearance == 2}}">购买日期 {{item.time}}</view>
<view wx:if="{{item.orderClassify == 3&&i.appearance==null}}">{{i.specificationData}}</view>
</view>
</view>
</view>
</view>
</view>
<view class="bottom">
<view wx:if="{{i.appearance==2}}">订单编号 {{item.orderCode}}</view>
</view>
<view class="btn-box" wx:if="{{item.orderClassify == 2&&i.appearance == 1}}">
<view wx:if="{{item.equityOrderStatus==4 || item.equityOrderStatus==6}}" class="btn" data-item="{{item}}" bind:tap="toSaleDetailPage">售后详情</view>
<block wx:if="{{item.payPrice > 0 && item.orderSource != 4}}">
<view wx:if="{{item.equityOrderStatus==2}}" data-item="{{item}}" bind:tap="toSaleApplyPage" class="btn">申请售后</view>
</block>
<view wx:if="{{item.equityOrderStatus==2 || item.equityOrderStatus==4}}" data-item="{{item}}" bind:tap="toComfirmPage" class="btn confirm">确认收货</view>
<view wx:if="{{item.equityOrderStatus!=6}}" class="btn pay" data-item="{{item}}" bind:tap="toCheckCard">
查看卡券</view>
</view>
<view class="btn-box" wx:if="{{item.orderClassify==3}}">
<block wx:if="{{item.payPrice > 0 && item.orderSource != 4}}">
<view wx:if="{{item.orderClassify==3&&item.equityOrderStatus==2}}" data-item="{{item}}" bind:tap="toSaleApplyPackage" class="btn">申请售后</view>
</block>
<view wx:if="{{item.orderClassify==3&&item.equityOrderStatus==4}}" data-item="{{item}}" bind:tap="toPackageDetail" class="btn">售后详情</view>
<view wx:if="{{item.orderClassify==3&&item.equityOrderStatus!==4}}" class="btn pay" data-item="{{item}}" bind:tap="toCheckPackage">查看套餐</view>
</view>
</view>
</block>
<block wx:if="{{item.orderClassify == 4}}">
<view class="item">
<view class="top">
<view class="delivery-icon">
<glsx-image webp src="mine/order/boutique.png"></glsx-image>
</view>
<view class="name text-hide">{{item.merchantName}}</view>
</view>
<view class="content">
<view class="goods" wx:for="{{item.orderGoods}}" wx:for-item="i" wx:for-index="ind" wx:key="ind">
<view class="icon">
<!-- <image webp src="{{i.goodsImage}}"></image> -->
<image webp src="{{i.goodsImage}}"></image>
</view>
<view class="info">
<view class="info-top">
<view class="name text-hide">{{i.goodsName}}</view>
<view class="price">
<text class="unit">¥</text>
{{i.activityPrice ||i.retailPrice}}
</view>
</view>
<view class="info-bottom">
<block wx:if="{{i.specificationData}}">
<view class="specification">{{i.specificationData}}</view>
</block>
<view class="number">
x{{i.goodsNumber}}
</view>
</view>
</view>
</view>
</view>
<view class="bottom">
共{{item.goodsNumber}}件商品,实付款<text class="price">¥{{item.payPrice}}</text>
</view>
<!-- !hasUserInfo -->
<block wx:if="{{!hasUserInfo}}">
<view class="btn-box">
<view class="btn confirm" catchtap="boutiqueJump" data-order-code="{{item.orderCode}}">评价</view>
</view>
</block>
</view>
</block>
<block wx:if="{{item.orderClassify == 5}}">
<view class="item" catchtap="jumpPlatformShop" data-item="{{item}}" data-url="orderDetail/orderDetail">
<view class="top">
<view class="name text-hide">平台特供</view>
<!-- 订单状态 orderStatus(1:待付款;2:已支付;3:已关闭;4:已发货;5:已收货;6:待发货;7:待安装;8:已安装;9:售后中;10:售后完成)
售后订单状态 afterSaleStatus(1:待审核;2:审核通过;3:审核不通过;4:待确认收到退货;5:退款中;6:已退款;7:退款失败)
-->
<view class="status">{{item.afterSaleStatus ? afterSaleStatus[item.afterSaleStatus]
:statusEnum[item.orderStatus]}}</view>
</view>
<view class="content-top {{item.orderStatus == 5 || item.orderStatus == 8?'':'content-bottom'}}">
<block wx:for="{{item.orderGoods}}" wx:for-item="i" wx:for-index="ind" wx:key="ind">
<view class="goods {{item.orderStatus == 5 || item.orderStatus == 8?'addTo':''}}">
<view class="icon">
<image webp src="{{i.goodsImage}}"></image>
</view>
<view class="info">
<view class="info-top">
<view class="name text-hide">
<text>{{i.goodsName}}</text>
</view>
<view class="price">
<text class="unit">¥</text>
{{i.retailPrice}}
</view>
</view>
<view class="info-bottom">
<block wx:if="{{i.specificationData}}">
<view class="specification">{{i.specificationData}}</view>
</block>
<view class="number">
x{{i.goodsNumber}}
</view>
</view>
</view>
</view>
</block>
</view>
<view class="bottom" wx:if="{{item.orderSource == 5}}">
共1件商品,实付款<text class="price">¥{{item.payPrice}}</text>
</view>
<view class="bottom" wx:else>
共{{item.goodsNumber}}件商品,实付款<text class="price">¥{{item.payPrice}}</text>
</view>
<!-- 1:待付款;2:已支付;3:已关闭;4:已发货;5:已收货;6:待发货;7:待安装;8:已安装;9:售后中;10:售后完成 -->
<!-- 售后状态 1:待审核;2:审核通过;3:审核不通过;4:待确认收到退货;5:退款中;6:已退款;7:退款失败 -->
<block wx:if="{{item.orderStatus != 3}}">
<view class="btn-box">
<block wx:if="{{!item.afterSaleStatus}}">
<block wx:if="{{item.orderStatus == 1}}">
<view class="btn" catchtap="cancelPlatformOrder" data-order-code="{{item.orderCode}}">取消订单</view>
<view class="btn pay empty" catchtap="toPayOrder" data-order-code="{{item.mainOrderCode}}">立即支付</view>
</block>
<block wx:elif="{{item.orderStatus > 2 && item.orderStatus < 9}}">
<block wx:if="{{item.orderStatus != 6 }}">
<view class="btn confirm" catchtap="jumpPlatformShop" data-item="{{item}}" data-url="orderDetail/orderDetail">查看物流
</view>
</block>
<block wx:if="{{item.platformOrderStatus == 1008 || item.platformOrderStatus == 1009}}">
<view class="btn" catchtap="jumpPlatformShop" data-item="{{item}}" data-url="applySale/index">售后
</view>
</block>
</block>
</block>
<block wx:else>
<view class="btn" catchtap="jumpPlatformShop" data-item="{{item}}" data-url="afterSaleDetail/index">售后</view>
</block>
</view>
</block>
</view>
</block>
</block>
<block wx:if="{{nothing}}">
<view class="list-nothing to-bottom"></view>
</block>
</block>
<block wx:else>
<view class="list-nothing">
暂无相关内容
</view>
</block>
</block>
</view>
</block>
\ No newline at end of file \ No newline at end of file
Page({
/**
* 页面的初始数据
*/
data: {},
//退出登录
logout() {
wx.p.api.userApi.logout().then(async ({
code,
message
}) => {
wx.p.wxApi.showLoading()
if (code == '0') {
// wx.$Track.setTrack({}, 4)
wx.$LoginStatus = true
// wx.$util.removeSystemStorage()
wx.p.storage.rm('userInfo')
wx.p.storage.rm('sessionId')
wx.p.storage.rm('isVIP')
wx.p.router.back(prevPage => {
wx.hideLoading()
prevPage.setData({
userInfo: null,
isMember: false,
vipInfo: null,
orderNumberList: null
})
})
} else {
if (code == '21' || code == '20') {
try {
const res = await wx.p.api.userApi.login()
if (res.code == 0) {
wx.p.storage.set('sessionId', res.data.sessionId)
this.logout()
} else throw res.message
} catch (error) {
wx.p.wxApi.showToast(error)
}
} else wx.p.wxApi.showToast(message)
}
})
},
goAgreement() {
wx.p.router.jumpH5('https://img02.glsx.com.cn/weapp/resource/saas/scrm/html/hmd/privacy.html', true)
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {}
})
\ No newline at end of file \ No newline at end of file
{
"usingComponents": {},
"navigationBarTitleText": "设置"
}
\ No newline at end of file \ No newline at end of file
page {
background-color: #F8F9FC;
}
.ctn {
margin-top: 8rpx;
}
.topCtn {
width: 100%;
height: 88rpx;
background-color: #fff;
display: flex;
justify-content: space-between;
box-sizing: border-box;
padding: 12rpx 48rpx;
line-height: 64rpx;
}
.text {
font-weight: 400;
font-size: 28rpx;
color: #0A0D14;
text-align: center;
}
.default-btn {
background: var(--btnColor);
border-radius: 8rpx;
position: fixed;
bottom: 70rpx;
}
.setting-icon {
width: 36rpx;
vertical-align: middle;
}
\ No newline at end of file \ No newline at end of file
<!--packageMine/pages/setting/index/index.wxml-->
<view class="ctn">
<view class="topCtn" bindtap="goAgreement">
<view class="text">隐私政策</view>
<view>
<glsx-image webp mode="widthFix" class="setting-icon" src="home/setting-icon.png"></glsx-image>
</view>
</view>
<view class="default-btn x-center" bindtap="logout">退出登录</view>
</view>
\ No newline at end of file \ No newline at end of file
/* pages/tab/mine/mine.wxss */ /* pages/tab/mine/mine.wxss */
page { page {
background-color: #FFFFFF; background-color: #F8F8F8;
} }
.layout { .layout {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!