Commit e55bbdde by 杨北旺

修复bug

1 parent 9ac60758
Showing 48 changed files with 2079 additions and 87 deletions
...@@ -4,7 +4,7 @@ module.exports = { ...@@ -4,7 +4,7 @@ module.exports = {
/** 分页查询商城专区的商品信息 */ /** 分页查询商城专区的商品信息 */
getGoodsList(data) { getGoodsList(data) {
return api.post({ return api.post({
method: `scrm.api.shopmall.zoneInfo.weapp.goodsPage.HMD`, method: `scrm.api.shopmall.zoneInfo.weapp.goodsPage`,
pageNum: 1, pageNum: 1,
pageSize: 999, pageSize: 999,
...data, ...data,
...@@ -49,7 +49,7 @@ module.exports = { ...@@ -49,7 +49,7 @@ module.exports = {
}, },
/** 领取确认订单最大优惠券 */ /** 领取确认订单最大优惠券 */
getMaxCoupon(orderGoods) { getMaxCoupon(orderGoods) {
return api.fetch("scrm.api.shopmall.weapp.order.coupons.get.HMD", { return api.fetch("scrm.api.shopmall.weapp.order.coupons.get", {
orderGoods, orderGoods,
}); });
}, },
...@@ -100,7 +100,7 @@ module.exports = { ...@@ -100,7 +100,7 @@ module.exports = {
/** 根据商品ID获取商品 */ /** 根据商品ID获取商品 */
getGoodsDetail(id) { getGoodsDetail(id) {
return api.fetch("scrm.api.shopmall.weapp.goods.getById.HMD", { return api.fetch("scrm.api.shopmall.weapp.goods.getById", {
id, id,
viewAmount: true, viewAmount: true,
}); });
...@@ -220,4 +220,13 @@ module.exports = { ...@@ -220,4 +220,13 @@ module.exports = {
...data, ...data,
}); });
}, },
/** 获取商品关联优惠券列表 */
getEquitycouponList(id) {
return api.post({
method: `scrm.api.shopmall.weapp.equitygoods.user.coupons.get`,
...id
},
true
)
},
}; };
...@@ -73,7 +73,8 @@ ...@@ -73,7 +73,8 @@
"pages/pay/pay", "pages/pay/pay",
"pages/detail/detail", "pages/detail/detail",
"pages/getCoupon/getCoupon", "pages/getCoupon/getCoupon",
"pages/goodsVideo/goodsVideo" "pages/goodsVideo/goodsVideo",
"pages/coupon/coupon"
] ]
}, },
{ {
...@@ -154,7 +155,10 @@ ...@@ -154,7 +155,10 @@
"pages/road/roadInfo/roadInfo", "pages/road/roadInfo/roadInfo",
"pages/freecard/freecard", "pages/freecard/freecard",
"pages/gCoupons/index", "pages/gCoupons/index",
"pages/receiveRed/receiveRed" "pages/receiveRed/receiveRed",
"pages/package/package",
"pages/success/success",
"pages/packageDetail/packageDetail"
] ]
} }
], ],
......
...@@ -37,6 +37,10 @@ Component({ ...@@ -37,6 +37,10 @@ Component({
only: { only: {
type: Boolean, type: Boolean,
value: true value: true
},
needFooter:{
type: Boolean,
value: true
} }
}, },
......
...@@ -7,12 +7,14 @@ ...@@ -7,12 +7,14 @@
<view class="popup-slot {{title?'':'notitle' }}"> <view class="popup-slot {{title?'':'notitle' }}">
<slot></slot> <slot></slot>
</view> </view>
<view class="popup-footer isFullSucreen" wx:if="{{only}}"> <block wx:if="{{needFooter}}">
<view class="cancel btn text-center" bindtap="hidePopup">取消</view> <view class="popup-footer isFullSucreen" wx:if="{{only}}">
<view class="confirm btn text-center" bindtap="confirm">确认</view> <view class="cancel btn text-center" bindtap="hidePopup">取消</view>
</view> <view class="confirm btn text-center" bindtap="confirm">确认</view>
<view class="popup-footer isFullSucreen" wx:else> </view>
<view class="confirm doubtn text-center" bindtap="confirm">确认</view> <view class="popup-footer isFullSucreen" wx:else>
</view> <view class="confirm doubtn text-center" bindtap="confirm">确认</view>
</view>
</block>
</view> </view>
</view> </view>
\ No newline at end of file \ No newline at end of file
.container {
.container{
padding-top: 482rpx; padding-top: 482rpx;
padding-bottom: 140rpx; padding-bottom: 140rpx;
} }
.main_box { .main_box {
width: 100%; width: 100%;
height: 664rpx; height: 664rpx;
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
.title { .title {
position: absolute; position: absolute;
left: 50%; left: 50%;
top: 90rpx; top: 94rpx;
transform: translateX(-50%); transform: translateX(-50%);
.price { .price {
...@@ -38,16 +38,29 @@ ...@@ -38,16 +38,29 @@
position: absolute; position: absolute;
left: 50%; left: 50%;
top: 218rpx; top: 218rpx;
transform: translateX(-60%); transform: translateX(-50%);
.cover { .cover_box {
background-image: linear-gradient(180deg, #FFFFEC 0%, #FFF0C4 100%);
border: 2rpx solid #FFD3A6;
border-radius: 12rpx;
width: 80rpx; width: 80rpx;
height: 80rpx; height: 80rpx;
display: flex;
align-items: center;
justify-content: center;
margin-right: 20rpx;
}
.cover {
width: 64rpx;
height: 64rpx;
border-radius: 50%; border-radius: 50%;
} }
.right { .right {
padding-left: 20rpx; // padding-left: 20rpx;
width: 344rpx;
.name { .name {
font-weight: 400; font-weight: 400;
font-size: 24rpx; font-size: 24rpx;
...@@ -58,6 +71,7 @@ ...@@ -58,6 +71,7 @@
font-weight: 600; font-weight: 600;
font-size: 30rpx; font-size: 30rpx;
color: #7E3F10; color: #7E3F10;
margin-top: 8rpx;
} }
} }
...@@ -115,5 +129,6 @@ ...@@ -115,5 +129,6 @@
font-weight: 400; font-weight: 400;
font-size: 26rpx; font-size: 26rpx;
color: #CD4E22; color: #CD4E22;
line-height: 36rpx;
} }
} }
\ No newline at end of file \ No newline at end of file
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
<text class="tip">无门槛</text> <text class="tip">无门槛</text>
</view> </view>
<view class="info_box"> <view class="info_box">
<view class="cover"> <view class="cover_box">
<image class="cover" src="{{detailInfo.goodsImage}}" /> <image class="cover" src="{{detailInfo.goodsImage}}" />
</view> </view>
<view class="right"> <view class="right">
......
import USERAPI from "~/api/usersApi/index";
Page({
/**
* 页面的初始数据
*/
data: {
packageInfo: {},
showAuthBtn: false,
shareStaff: {}
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
wx.p.routerApi.decodeUrlLink(options)
if (!options.id) {
return
}
this.login()
this.getPackageDetail(options.id)
// 推荐人
if (options.shareStaffUuid) {
this.data.shareStaff = {
shareStaffUuid: options.shareStaffUuid,
shareStaffName: options.shareStaffName
}
options.item_type = 4
options.action_type = 1
options.item_id = options.id
this.data.recommandOptions = options
// wx.$util.reportData(options, false, false, true)
}
if (options.activity_id) {
this.data.options = options
// wx.$util.reportData(options, true, false)
}
},
// 登录
login() {
USERAPI.login().then(res => {
if (res.data) {
wx.$authStatus = res.data.phone ? false : true
this.setNaviTitle(res.data.merchantName)
this.setData({
sessionId: res.data.sessionId,
showAuthBtn: res.data.phone ? false : true
})
if (res.data.isLogin) {
wx.p.util.setUserInfo(res.data)
wx.p.util.setSessionId(res.data.sessionId)
this.handlerCustomerId()
}
}
})
},
// 设置标题名称
setNaviTitle(title) {
wx.setNavigationBarTitle({
title
})
},
getPhoneNumber({ detail }) {
const { sessionId } = this.data
if (!sessionId) return
USERAPI.authUserPhone(detail, sessionId).then(({ data, code, message }) => {
wx.hideLoading()
if (code == '0') {
wx.p.authStatus = false
wx.p.util.setUserInfo(data)
wx.p.util.setSessionId(data.sessionId)
this.toCreatePackageNum()
this.handlerCustomerId()
} else wx.p.wxApi.showToast(message)
})
},
// 获取套餐详情
getPackageDetail(id) {
wx.p.api.couponsApi
.packageInfo({
id
})
.then(res => {
if (res.couponsDetailList.length) {
res.couponsDetailList.map(item => {
item.effectiveEndTime = new Date(item.effectiveEndTime).format('yyyy-MM-dd hh:mm:ss')
// item.shopTotalPrice = this.priceFormat(item.shopTotalPrice)
return item
})
}
this.setData({
packageInfo: res,
packageId: id
})
})
},
// 获取门店单号
toCreatePackageNum() {
wx.p.wxApi.showLoading()
wx.p.api.couponsApi.createOrderNum().then(res => {
wx.hideLoading()
if (res) {
// this.setData({
// orderCode:res
// })
this.createStoreOrder(res)
}
})
},
// 创建订单
createStoreOrder(orderCode) {
let { packageId, sessionId, packageInfo, shareStaff } = this.data
let para = {
packageId,
paySource: 3,
sessionId,
orderCode,
...shareStaff
}
let jumpParam = {
orderCode,
name: packageInfo.packageName,
price: packageInfo.packagePrice
}
wx.p.wxApi.showLoading()
let _this = this
wx.p.api.couponsApi.createOrder(para).then(res => {
wx.hideLoading()
if (res) {
const { timeStamp, nonceStr, packages, signType, paySign } = res
wx.requestPayment({
timeStamp: timeStamp,
nonceStr: nonceStr,
package: packages,
signType: signType,
paySign: paySign,
success() {
let temp = JSON.stringify(jumpParam)
wx.navigateTo({
url: '/packageEquity/pages/success/success?order=' + temp
})
},
fail(res) {
if (res.errMsg == 'requestPayment:fail cancel') {
wx.p.wxApi.showToast('取消支付')
}
}
})
}
})
},
// 客户id
handlerCustomerId() {
let customerId = wx.p.storage.get('srcm_shopmall_customer_id')
if (customerId) USERAPI.updataCustomerPhone()
},
// 价格格式化
// priceFormat(num, point = 2) {
// let numStr = num.toString().split('.')[0]
// if (numStr.length < 6) { // 判断数字有多长,如果小于6,,表示10万以内的数字,让其直接显示
// return numStr;
// } else if (numStr.length >= 6 && numStr.length <= 8) { // 如果数字大于6位,小于8位,让其数字后面加单位万
// point = 0
// let decimal = numStr.substring(numStr.length - 4, numStr.length - 4 + point)
// console.log(decimal);
// // 由千位,百位组成的一个数字
// return parseFloat(parseInt(num / 10000) + '.' + decimal) + '万'
// } else if (numStr.length > 8) { // 如果数字大于8位,让其数字后面加单位亿
// let decimal = numStr.substring(numStr.length - 8, numStr.length - 8 + point);
// console.log(decimal);
// return parseFloat(parseInt(num / 100000000) + '.' + decimal) + '亿'
// }
// },
onUnload: function () {
wx.$util.customerbehavior(2)
}
})
{ {
"component": true,
"usingComponents": {} "usingComponents": {}
} }
\ No newline at end of file \ No newline at end of file
<view class="package-container">
<view class="top_wrapper">{{packageInfo.packageName }}
<view class="limit-number" wx:if="{{packageInfo.limitPurchaseFlag == 2}}">限购{{packageInfo.limitPurchaseNumber}}次</view>
</view>
<view class="title_widget">
现在购买尊享<text class="title_num">{{packageInfo.count }}项</text>超值权益
</view>
<view class="package_content_wrapper">
<block wx:for="{{packageInfo.couponsDetailList}}" wx:key="index">
<view class="package_element">
<view class="ele_top">{{ index + 1 }}、{{ item.couponName }}</view>
<view class="ele_right">数量:x{{ item.serviceQuantity }}</view>
<view wx:if="{{item.effectiveType == 3}}" class="ele_left">
有效期:无有效期
</view>
<view wx:if="{{item.effectiveType == 1}}" class="ele_left">
有效期:{{ item.effectiveDays }}天
</view>
<view wx:if="{{item.effectiveType == 2}}" class="ele_left">
有效期:{{item.effectiveEndTime}}
</view>
<view wx:if="{{item.useType == 1}}" class="ele_bottom">
可用{{ item.useAmount }}次
</view>
<view wx:if="{{item.useType == 2}}" class="ele_bottom">
{{ item.useLimitDays }}天可用{{ item.useAmount }}次
</view>
<view wx:if="{{item.useType == 0}}" class="ele_bottom">不限次数</view>
</view>
</block>
<view wx:if="{{packageInfo.notes}}" class="content_tip">
附:{{ packageInfo.notes }}
</view>
</view>
<view class="fixed-button-wrap">
<block wx:if="{{showAuthBtn}}">
<button open-type="getPhoneNumber" bindgetphonenumber="getPhoneNumber" class="auth-button"></button>
</block>
<view class="button-item dis" wx:if="{{packageInfo.limitPurchaseFlag==2&&packageInfo.purchaseNumber >= packageInfo.limitPurchaseNumber}}">已达套餐购买次数上限</view>
<view class="button-item" wx:else bind:tap="toCreatePackageNum"> 限时特价仅需¥{{packageInfo.packagePrice }},点击购买</view>
</view>
<view style="height: 164rpx"></view>
</view>
\ No newline at end of file \ No newline at end of file
/* packageEquity/pages/package/package.wxss */
.package-container {
width: 100%;
box-sizing: border-box;
padding: 0 32rpx;
}
.top_wrapper {
width: 100%;
height: 160rpx;
background-image: url("https://img02.glsx.com.cn/weapp/resource/miniprogram/glsx/equity/scrm_package_bg.png");
background-size: 100% 160rpx;
box-sizing: border-box;
padding-left: 128rpx;
display: flex;
align-items: center;
font-size: 36rpx;
color: #fff;
position: relative;
}
.limit-number {
font-size: 24rpx;
color: #999999;
position: absolute;
bottom: 20rpx;
right: 24rpx;
}
.title_widget {
width: 100%;
color: #282829;
font-size: 36rpx;
margin: 32rpx 0 24rpx 0;
text-align: center;
font-weight: 500;
}
.title_num {
color: #fc5b32;
margin: 0 10rpx;
}
.package_content_wrapper {
box-sizing: border-box;
background: #fff;
border-radius: 8rpx;
width: 100%;
padding: 24rpx;
}
.package_element {
position: relative;
height: 82rpx;
margin-bottom: 48rpx;
}
.ele_top {
width: 70%;
color: #282829;
font-size: 28rpx;
font-weight: 500;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
.ele_right {
color: #282829;
font-size: 24rpx;
position: absolute;
right: 0;
top: 4rpx;
font-weight: 500;
}
.ele_left {
color: #b1b1b3;
font-size: 24rpx;
position: absolute;
left: 40rpx;
bottom: 0;
}
.ele_bottom {
color: #b1b1b3;
font-size: 24rpx;
position: absolute;
right: 0;
bottom: 0;
}
.content_tip {
color: #656566;
font-size: 22rpx;
box-sizing: border-box;
padding-left: 24rpx;
word-wrap: break-word;
}
.fixed-button-wrap {
position: fixed;
left: 0;
right: 0;
bottom: 0;
background: #F5F5F5;
box-sizing: border-box;
padding: 0 32rpx;
padding-bottom: 40rpx;
padding-top: 20rpx;
}
.button-item {
width: 100%;
height: 88rpx;
background: #fc5b32;
border-radius: 8rpx;
display: flex;
align-items: center;
justify-content: center;
font-size: 32rpx;
color: #ffffff;
}
.dis{
background: #CCCCCC;
}
.auth-button {
position: absolute;
left: 0;
right: 0;
bottom: 0;
top: 0;
opacity: 0;
z-index: 102;
}
.price_total_title {
font-size: 36rpx;
font-weight: 500;
color: #282829;
margin: 32rpx 0 24rpx 0;
text-align: center;
}
.statistical_wrapper {
/* margin: 0 32rpx; */
box-sizing: border-box;
padding: 32rpx 24rpx;
background: #FFFFFF;
border-radius: 16rpx;
}
.price_line_item {
display: flex;
align-items: center;
}
.line_label {
font-size: 24rpx;
font-weight: 500;
color: #282829;
line-height: 34rpx;
width: 40%;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
.line_num {
width: 20%;
font-size: 24rpx;
font-weight: 500;
color: #656566;
line-height: 34rpx;
text-align: center;
}
.line_price {
width: 40%;
font-size: 24rpx;
font-weight: 500;
color: #656566;
line-height: 34rpx;
text-align: right;
display: flex;
align-items: center;
justify-content: flex-end;
}
.total_desc {
font-size: 28rpx;
font-weight: 500;
color: #282829;
line-height: 40rpx;
text-align: center;
margin-bottom: 22rpx;
}
.price_text {
font-size: 32rpx;
font-weight: 500;
color: #FC5B32;
line-height: 44rpx;
margin: 0 10rpx;
}
\ No newline at end of file \ No newline at end of file
import { IMG_URL } from '~/config';
Page({
data: {
orderStatus: 2,
IMGURL:IMG_URL
},
getPackageDetail(orderCode) {
wx.p.api.equityApi.packageOrderDetail({ orderCode }).then(res => {
if (res.createDate) {
res.createDate = new Date(res.createDate).format('yyyy-MM-dd hh:mm:ss')
}
if (res.refundDate) {
res.refundDate = new Date(res.refundDate).format('yyyy年MM月dd日 hh:mm')
}
this.setData({
packageInfo: res,
orderStatus: res.orderStatus
})
})
},
toUserCoupons(e) {
let { item } = e.currentTarget.dataset
// 页面接受的参数为id,所以这里得另起变量存
item.id = item.userCouponsId
let temp = JSON.stringify(item)
let { discountType, useChannel, useMemberType } = item
let detailInfo = { xx: 'xx' }
if (discountType == 2 || discountType == 4) {
wx.p.router.go('/packageMall/pages/coupon/coupon', {
userCouponId: item.id,
useMemberType,
detailInfo
})
return
}
/**线上商品代金券 */
if (discountType == 3 && useChannel == 1) {
// if(this.data.useMemberType == 1) {
// wx.$api.showToast('代金券已使用')
// return
// }
wx.p.router.go('/packageMine/pages/coupon/recommend/recommend', {
couponInfo: item
})
return
}
wx.navigateTo({
url: '/packageMine/pages/coupon/detail/detail?item=' + temp
})
},
// 套餐提交申请售后
packageSumbit() {
wx.$api.showLoading()
const { packageInfo } = this.data
let para = {
orderCode: packageInfo.orderCode,
reason: packageInfo.reason
}
wx.p.api.equityApi.packageApply(para).then(res => {
wx.hideLoading()
this.getPackageDetail(packageInfo.orderCode)
})
},
openMap() {
const { packageInfo } = this.data
wx.openLocation({
latitude: parseFloat(packageInfo.latitude),
longitude: parseFloat(packageInfo.longitude),
address: packageInfo.merchantAddress
})
},
onLoad: function (options) {
this.getPackageDetail(options.orderCode)
}
})
{
"usingComponents": {}
}
\ No newline at end of file \ No newline at end of file
<view class="package-detail-container">
<view wx:if="{{orderStatus>3}}" class="afterSale_wrapper">
<view wx:if="{{orderStatus==4}}" class="after_title flex_cc">
<image webp class="sale_icon" src="{{IMGURL}}equity/return_icon.png?v={{img_version}}" />
<view class="sale_text">退款中</view>
</view>
<view wx:if="{{orderStatus==5}}" class="after_title flex_cc">
<image webp class="sale_icon" src="{{IMGURL}}equity/return_fail.png?v={{img_version}}" />
<view class="sale_text">退款失败</view>
</view>
<view wx:if="{{orderStatus==6}}" class="after_title flex_cc">
<image webp class="sale_icon" src="{{IMGURL}}equity/return_success.png?v={{img_version}}" />
<view class="sale_text">已退款</view>
</view>
<view wx:if="{{orderStatus==4}}" class="return_message">
<view class="title_one">退款金额<text class="price_icon">{{packageInfo.orderPrice}}</text></view>
<view class="title_two">预计三个工作日内退回至原账户</view>
</view>
<view wx:if="{{orderStatus==5}}" class="return_message">
<view class="title_one">退款金额<text class="price_icon">{{packageInfo.orderPrice}}</text></view>
<view class="restBtn" bind:tap="packageSumbit">重新发起</view>
<view class="title_two">退款失败,别慌,重新发起试试</view>
<view wx:if="{{packageInfo.refundDate}}" class="title_two">{{packageInfo.refundDate}}</view>
</view>
<view wx:if="{{orderStatus==6}}" class="return_message">
<view class="title_one">退款金额<text class="price_icon">{{packageInfo.orderPrice}}</text></view>
<view class="title_two">已退回至原账户</view>
<view wx:if="{{packageInfo.refundDate}}" class="title_two">{{packageInfo.refundDate}}</view>
</view>
</view>
<view class="wrapper">
<block wx:for="{{packageInfo.couponsDetails}}" wx:key="index">
<view class="line_widget">
<view class="left_wrap flex_sc">
<view class="color_icon"></view>
<view class="line_label hide-text">{{index+1}}、{{item.couponName}}</view>
</view>
<view wx:if="{{orderStatus!=4&&orderStatus!=6&&orderStatus!=3}}" data-item="{{item}}" bind:tap="toUserCoupons" class="right_btn flex_cc">去使用</view>
</view>
</block>
<view wx:if="{{packageInfo.notes}}" class="textarea_text">附:{{packageInfo.notes}}</view>
</view>
<view style="height:32rpx"></view>
<view class="wrapper">
<view class="image_icon_text" bind:tap="openMap">
<image webp class="image_icon" src="{{IMGURL}}equity/scrm_location_icon.png?v={{img_version}}" />
<view class="image_text">导航</view>
</view>
<view class="row_wrap flex_sc">
<view class="row_label">服务门店</view>
<view class="row_value">{{packageInfo.merchantName}}</view>
</view>
<view class="row_wrap flex_sc">
<view class="row_label">付款金额</view>
<view class="row_value">{{packageInfo.orderPrice}}</view>
</view>
<view class="row_wrap flex_sc">
<view class="row_label">订单编号</view>
<view class="row_value">{{packageInfo.orderCode}}</view>
</view>
<view class="row_wrap flex_sc">
<view class="row_label">下单时间</view>
<view class="row_value">{{packageInfo.createDate}}</view>
</view>
</view>
</view>
\ No newline at end of file \ No newline at end of file
page {
background: #F5F5F5;
}
.package-detail-container {
box-sizing: border-box;
padding: 32rpx;
}
.wrapper {
background: #FFFFFF;
border-radius: 8rpx;
box-sizing: border-box;
padding: 36rpx 24rpx 44rpx 24rpx;
position: relative;
}
.line_widget {
display: flex;
align-items: center;
justify-content: space-between;
margin-bottom: 24rpx;
}
.left_wrap {
width: 80%;
}
.color_icon {
width: 20rpx;
height: 20rpx;
border-radius: 50%;
background: linear-gradient(180deg, rgba(252, 91, 50, 0.14) 0%, #FC5B32 100%);
margin-right: 10rpx;
}
.line_label {
font-size: 28rpx;
font-weight: 600;
color: #282829;
width: 90%;
}
.right_btn {
width: 138rpx;
height: 48rpx;
border-radius: 24rpx;
border: 2rpx solid #FC5B32;
font-size: 24rpx;
font-weight: 400;
color: #FC5B32;
}
.textarea_text {
font-size: 24rpx;
font-weight: 500;
color: #656566;
line-height: 34rpx;
word-break: break-all;
}
.row_wrap {
margin-bottom: 20rpx;
}
.row_label {
font-size: 24rpx;
font-weight: 500;
color: #282829;
}
.row_value {
font-size: 24rpx;
font-weight: 400;
color: #B1B1B3;
margin-left: 32rpx;
}
.image_icon_text {
position: absolute;
right: 32rpx;
top: 32rpx;
}
.image_icon {
width: 40rpx;
height: 40rpx;
}
.image_text {
font-size: 18rpx;
font-weight: 400;
color: #FC5B32;
line-height: 22rpx;
margin-top: 6rpx;
}
.flex_sc {
display: flex;
align-items: center;
}
.flex_cc {
display: flex;
align-items: center;
justify-content: center;
}
.hide-text {
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
.afterSale_wrapper{
width: 100%;
background-image: linear-gradient(180deg, #ffffff 0%, #ffffff 100%);
border-radius: 8rpx;
box-sizing: border-box;
padding: 37rpx 24rpx 24rpx 24rpx;
margin-bottom: 32rpx;
}
.sale_icon{
width: 60rpx;
height: 60rpx;
}
.sale_text{
margin-left: 12rpx;
font-size: 40rpx;
color: #2c2c2c;
}
.return_message{
margin-top: 59rpx;
position: relative;
}
.title_one{
font-size: 36rpx;
color: #282829;
position: relative;
}
.price_icon {
font-size: 36rpx;
color: #fc5b32;
margin-left: 28rpx;
}
.title_two {
font-size: 24rpx;
color: #282829;
margin-top: 20rpx;
}
.restBtn{
position: absolute;
top: 0;
right: 0;
border: 2rpx solid #fc5b32;
border-radius: 24rpx;
width: 138rpx;
height: 48rpx;
display: flex;
align-items: center;
justify-content: center;
font-size: 24rpx;
color: #fc5b32;
}
\ No newline at end of file \ No newline at end of file
import { IMG_URL } from '~/config';
Page({
/**
* 页面的初始数据
*/
data: {
IMGURL:IMG_URL
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
console.log(options)
// let aaa = '{"orderCode":"GL467176510294597632","name":"全车精品套餐","price":"0.01"}'
let temp = JSON.parse(options.order)
// let temp = JSON.parse(aaa)
this.setData({
order: temp
})
},
toMyCoupons() {
wx.redirectTo({
url: '/packageMine/pages/coupon/index/index'
})
// wx.$router.redirectTo('packageMine.coupon.index', {
// success: true
// })
},
toHtmlOrder() {
const { orderCode, name } = this.data.order
// const sessionId = wx.$util.getSessionId()
// let merchantId = wx.$storage.get('srcm_shopmall_merchant_id')
// merchantId = merchantId || defaultMerchantId
// let para = {
// sessionId,
// merchantId,
// appId: equityAppId,
// orderCode,
// name,
// refresh: true
// }
// let urlParam = JSON.stringify(para)
// // 需要的参数,订单号,套餐名字
// let url = `${domain}/scrm-equity-h5/#/commodity/packageDetail?urlParam=${urlParam}`
// wx.$router.jumpH5(url)
// wx.redirectTo({
// url: `/pages/webView/webView?url=${encodeURIComponent(url)}`
// })
wx.redirectTo({
url: '/packageEquity/pages/packageDetail/packageDetail?orderCode=' + orderCode
})
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {}
})
{
"usingComponents": {}
}
\ No newline at end of file \ No newline at end of file
<view class="pay-after-page">
<image webp class="status-icon" src="{{IMGURL}}equity/return_success.png" />
<view class="status-title">支付成功</view>
<view class="pay-price">¥{{order.price}}</view>
<view class="btn-group">
<view class="button-item margin1" bind:tap="toHtmlOrder">查看订单</view>
<view class="button-item" bind:tap="toMyCoupons">去卡包使用</view>
</view>
</view>
\ No newline at end of file \ No newline at end of file
/* packageEquity/pages/success/success.wxss */
.pay-after-page {
display: flex;
flex-direction: column;
align-items: center;
}
.status-icon {
width: 140rpx;
height: 140rpx;
margin-top: 112rpx;
}
.status-title {
font-size: 32rpx;
font-weight: 500;
color: #282829;
margin-top: 40rpx;
}
.pay-price {
font-size: 32rpx;
font-weight: 500;
color: #FC5B32;
margin-top: 20rpx;
}
.btn-group {
display: flex;
align-items: center;
justify-content: center;
margin-top: 76rpx;
}
.button-item {
width: 226rpx;
height: 88rpx;
border-radius: 8rpx;
border: 2rpx solid #FC5B32;
font-size: 32rpx;
font-weight: 400;
color: #FC5B32;
display: flex;
align-items: center;
justify-content: center;
}
.margin1 {
margin-right: 40rpx;
}
\ No newline at end of file \ No newline at end of file
import QR from '~/lib/wxqrcode'
import { IMG_URL } from '~/config';
Page({
/**
* 页面的初始数据
*/
data: {
shareStaff: {},
discountType: {
1: '满减券',
2: '折扣券',
3: '代金券',
4: '兑换券',
5: '购车代金券',
6: '商品折扣券',
7: '会员服务券'
},
useMemberType: 0,
list: [],
pageNum: 1,
IMGURL:IMG_URL
},
navbarReady(e) {
this.setData({
navBarHeight: e.detail.height
})
},
unique(arr) {
let res = new Set()
return arr.filter(item => {
let id = JSON.stringify(item)
if (res.has(id)) {
return false
} else {
res.add(id)
return true
}
})
},
getCouponGoodsPage(res) {
wx.p.wxApi.showLoading()
let total = 0
let {
list,
pageNum
} = this.data
wx.p.api.shopmallApi
.getCouponGoodsPage({
pageNum,
couponId: res.couponId || res.id,
merchantId: res.merchantId
})
.then(data => {
console.log(data)
// let lists = this.unique([..., ...data.list])
this.setData({
list: data.list,
total
})
wx.hideLoading()
})
},
jumpCommodity(e) {
let {
item
} = e.currentTarget.dataset
// console.log('item',item);
let {
id
} = item
let isActivity = false
wx.p.router.go('/packageShopmall/packageMall/pages/detail/detail', {
id,
isActivity,
notIntercept: true
})
},
jump(e) {
let {
item
} = e.currentTarget.dataset
wx.openLocation({
latitude: item.lat,
longitude: item.lng,
name: item.merchantName,
address: item.merchantAddress
})
},
jumpMap() {
let {
couponDetail
} = this.data
wx.openLocation({
latitude: couponDetail.lat,
longitude: couponDetail.lng,
name: couponDetail.merchantName,
address: couponDetail.merchantAddress
})
},
jump() {
console.log()
let {
length
} = getCurrentPages()
if (length == 1) wx.p.router.redirectTo('/packageMine/pages/coupon/index/index')
else wx.p.router.back()
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
console.log(options)
// 0616添加推荐人
if (options.shareStaffUuid) {
this.data.shareStaff = {
shareStaffUuid: options.shareStaffUuid,
shareStaffName: options.shareStaffName
}
options.item_type = 2
options.action_type = 1
options.item_id = options.couponId
this.data.recommandOptions = options
// wx.$util.reportData(options, false, false, true)
}
wx.p.routerApi.decodeUrlLink(options)
// console.log('options',options);
wx.p.router.getData(({
userCouponId,
useMemberType,
detailInfo
}) => {
console.log(userCouponId)
wx.p.wxApi.showLoading('加载中...')
this.setData({
detailInfo
})
wx.p.api.couponsApi
.getWWCoupon({
userCouponId
})
.then(res => {
wx.hideLoading()
wx.nextTick(() => {
this.setCouponData(res)
})
let code = res.verificationCode.replace(/(.{4})/g, '$1 ')
this.setData({
qr: QR.createQrCodeImg(`t=2&c=${res.verificationCode}`),
verificationCode: code
})
})
})
if (options && options.couponId) {
console.log(options)
wx.p.wxApi.showLoading('加载中...')
this.checkCoupon(options)
if (options.activity_id) {
this.data.activiOptions = options
// wx.$util.reportData(options, true, false)
}
} else {
let {
isReceive
} = this.data
if (isReceive) this.confirm()
}
},
checkCoupon(options, callBack) {
wx.p.api.couponsApi.checkCoupon(options).then(couponInfo => {
console.log(couponInfo)
if (couponInfo) {
couponInfo.receiveEndTime = new Date(couponInfo.receiveEndTime).format('yyyy.MM.dd hh:mm:ss')
couponInfo.receiveStartTime = new Date(couponInfo.receiveStartTime).format('yyyy.MM.dd hh:mm:ss')
couponInfo.receiveTime = new Date(couponInfo.receiveTime).format('yyyy.MM.dd hh:mm:ss')
}
this.setData({
detailInfo: couponInfo
})
// wx.hideLoading()
wx.p.api.couponsApi.getCouponInfo(options).then(res => {
this.setCouponData(res)
this.setData({
...options
})
if (couponInfo) {
let code = couponInfo.verificationCode.replace(/(.{4})/g, '$1 ')
console.log(couponInfo.verificationCode)
this.setData({
useMemberType: couponInfo.useMemberType,
qr: QR.createQrCodeImg(`t=2&c=${couponInfo.verificationCode}`),
verificationCode: code
})
} else {
if (callBack) callBack(couponInfo)
}
})
})
wx.hideLoading()
},
setCouponData(res) {
if (res.receiveStartTime) res.receiveStartTime = new Date(res.receiveStartTime).format('yyyy.MM.dd hh:mm:ss')
if (res.receiveEndTime) res.receiveEndTime = new Date(res.receiveEndTime).format('yyyy.MM.dd hh:mm:ss')
if (res.receiveTime) res.receiveTime = new Date(res.receiveTime).format('yyyy.MM.dd hh:mm:ss')
if (res.list) {
res.list.map(val => (val.verificationTime = new Date(val.verificationTime).format('yyyy.MM.dd hh:mm:ss')))
}
if (res.effectiveStartTime) res.effectiveStartTime = res.effectiveStartTime.replace(/-/g, '.')
if (res.effectiveEndTime) res.effectiveEndTime = res.effectiveEndTime.replace(/-/g, '.')
if (res.full) res.full = res.full / 100
if (res.discountType == 3 && res.useChannel == 1) {
this.getCouponGoodsPage(res)
}
console.log(res, '///////////')
this.setData({
couponDetail: res,
useMemberType: res.useMemberType,
})
// setTimeout(() => {
// this.setData({
// flag: true
// })
// }, 500)
},
confirm() {
let {
couponId,
issueName,
issueDate,
userCouponId,
merchantId,
shareSource
} = this.data
if (!couponId && !userCouponId) return
wx.p.router.intercept().then(response => {
if (response) {
this.setData({
isReceive: true
})
return
}
let obj = {
...this.data.shareStaff
}
if (userCouponId) obj.userCouponId = userCouponId
if (couponId) obj.couponId = couponId
if (issueName) obj.issueName = issueName
if (issueDate) obj.issueDate = issueDate
if (merchantId) obj.merchantId = merchantId
if (shareSource) obj.shareSource = shareSource
this.checkCoupon(obj, () => {
wx.p.api.couponsApi.receiveCoupon(obj).then(({
code,
data,
message
}) => {
if (code == '0') {
// wx.$Track.setTrack({
// data,
// type: '领取优惠券'
// },
// 7
// )
console.log(data)
if (data.discountType == 3) {
this.jump()
return
}
this.setData({
qr: QR.createQrCodeImg(`t=2&c=${data.verificationCode}`),
verificationCode: data.verificationCode
})
wx.p.wxApi.showToast('领取成功')
this.checkCoupon(obj)
if (this.data.activiOptions) {
// wx.$util.reportData(this.data.activiOptions, false, true)
}
if (this.data.recommandOptions) {
let options = this.data.recommandOptions
options.item_type = 2
options.action_type = 2
options.item_id = options.couponId
// wx.$util.reportData(options, false, false, true)
}
} else {
wx.p.wxApi.showToast(message)
}
})
})
})
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
// wx.$util.customerbehavior(2)
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {}
})
\ No newline at end of file \ No newline at end of file
{
"navigationStyle": "custom"
}
\ No newline at end of file \ No newline at end of file
/* packageMall/pages/coupon/coupon.wxss */
@import '/style/sprite.wxss';
.navigation-bar {
position: fixed;
top: 0;
left: 0;
z-index: 2;
}
.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;
}
.navigation .text {
max-width: 50%;
font-size: 32rpx;
color: #333333;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
font-weight: 500;
box-sizing: border-box;
text-align: center;
letter-spacing: 1rpx;
}
.layout {
padding: 32rpx;
}
.layout .box {
background: #ffffff;
box-shadow: 0px 8rpx 16rpx 0px rgba(224, 224, 224, 0.5);
border-radius: 8rpx;
}
.layout .qr-box {
padding: 32rpx 32rpx 20rpx 32rpx;
margin-bottom: 20rpx;
position: relative;
}
.layout .qr-box .type {
position: absolute;
right: 0;
top: 0;
width: 140rpx;
height: 120rpx;
background-color: var(--btnColor);
}
.layout .qr-box .type text {
color: #fff;
display: block;
transform: rotate(45deg);
font-size: 24rpx;
}
.layout .qr-box .top {
position: relative;
z-index: 2;
/* border-bottom: 2rpx solid #eeeeee;
padding-bottom: 32rpx; */
box-sizing: border-box;
}
.layout .qr-box .top .title {
font-weight: 600;
font-size: 36rpx;
color: #3a3a3a;
padding-bottom: 20rpx;
}
.layout .qr-box .top .title .coupon {
background-color: var(--btnColor);
margin-left: 20rpx;
font-size: 24rpx;
border-radius: 8rpx;
padding: 4rpx 20rpx;
color: #fff;
flex-shrink: 0;
}
.layout .qr-box .top .title .disabled {
background-color: #999999;
}
.layout .qr-box .top .time {
font-size: 24rpx;
color: #bebebe;
}
.layout .qr-box .bottom {
/* min-height: 506rpx; */
flex-direction: column;
}
.layout .qr-box .bottom .title {
padding: 22rpx 0 24rpx;
font-size: 32rpx;
}
.layout .qr-box .bottom .qr {
width: 280rpx;
height: 280rpx;
margin-bottom: 44rpx;
position: relative;
}
.layout .qr-box .bottom .qr .qr-text {
font-size: 24rpx;
color: #bebebe;
width: 200%;
text-align: center;
}
.layout .qr-box .bottom .qr .mask {
position: absolute;
left: 50%;
top: 50%;
transform: translate(-50%, -50%);
font-size: 28rpx;
font-weight: 500;
line-height: 32rpx;
width: 181rpx;
height: 84rpx;
background: #000;
border-radius: 8rpx;
opacity: 0.7;
color: #FFFFFF;
}
.layout .qr-box .bottom .qr .mask.lose {
font-size: 28rpx;
color: #999999;
}
.layout .qr-box .btn-box {
height: 304rpx;
background: #FFF5F3;
border-radius: 8rpx;
padding: 32rpx;
}
.layout .qr-box .btn-box .text {
width: 100%;
text-align: center;
font-size: 20rpx;
color: #FC5B32;
line-height: 28px;
}
.layout .qr-box .btn {
/* animation: huxi 2.5s infinite; */
/* margin-bottom: 40rpx; */
font-size: 28rpx;
color: #FFFFFF;
margin-top: 38rpx;
width: 400rpx;
height: 68rpx;
background: #FC5B32;
box-shadow: 0px 4rpx 12rpx 4rpx rgba(252, 91, 50, 0.1);
border-radius: 34rpx;
}
/* @keyframes huxi {
0% {
transform: scale(1);
}
50% {
transform: scale(1.1);
}
100% {
transform: scale(1);
}
} */
.layout .qr-box .bottom .code {
font-size: 28rpx;
}
.layout .info {
padding: 32rpx;
line-height: 40rpx;
font-size: 28rpx;
color: #666666;
}
.layout .info .title {
color: #333333;
}
.layout .info .title .sprite-icon {
margin-right: 16rpx;
}
.icon-explain {
width: 32rpx;
height: 32rpx;
}
.layout .info .item {
margin-top: 24rpx;
word-break: break-all;
position: relative;
}
.layout .info .item .num {
position: absolute;
left: 0;
top: 0;
}
.bottom-box {
position: fixed;
left: 0;
bottom: 0;
width: 100%;
z-index: 2;
background-color: #fff;
padding-top: 10rpx;
}
.default-btn {
margin: 0 auto 10rpx;
}
.isFullSucreen {
padding-bottom: constant(safe-area-inset-bottom) !important;
padding-bottom: env(safe-area-inset-bottom) !important;
}
.isFullSucreen-btn {
padding-bottom: constant(safe-area-inset-bottom) !important;
padding-bottom: env(safe-area-inset-bottom) !important;
}
.box-X {
border-radius: 8rpx;
background-color: #fff;
padding: 24rpx 24rpx 40rpx;
}
.associationBox .title {
font-size: 32rpx;
padding-bottom: 24rpx;
font-weight: 500;
}
.associationBox .goods {
margin-top: 24rpx;
display: flex;
align-items: center;
height: 160rpx;
}
.associationBox .goods .icon {
width: 160rpx;
height: 100%;
overflow: hidden;
border-radius: 8rpx;
margin-right: 20rpx;
}
.associationBox .goods .info {
width: calc(100% - 180rpx);
height: 100%;
display: flex;
flex-direction: column;
justify-content: space-between;
}
.associationBox .goods .info .name {
font-size: 30rpx;
color: #333;
}
.associationBox .goods .info .price {
display: flex;
color: var(--btnColor);
font-weight: 500;
}
.associationBox .goods .info .price-X {
margin-top: -8rpx;
font-size: 36rpx;
font-family: DINAlternate-Bold, DINAlternate;
}
.top .title .title_text {
font-size: 36rpx;
font-weight: 600;
max-width: 510rpx;
}
.top .title .baseImage {
width: 140rpx;
height: 138rpx;
background-size: cover;
position: absolute;
right: -40rpx;
top: -41rpx;
}
.qrText {
color: #FC5B32;
}
.changeColor {
color: #333;
}
.lines {
height: 2rpx;
background: #EEE;
margin: 32rpx 0 0;
}
.title .discount {
font-size: 40rpx;
font-weight: 600;
}
.title .discount_text {
font-size: 24rpx;
padding-top: 8rpx;
}
.title .discount_text_x {
font-size: 32rpx;
padding-left: 10rpx;
}
.numberColor {
color: #B4B4B4;
}
.darkColor {
color: #666;
}
.box .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;
}
.qr-box .storeTitle {
font-size: 32rpx;
font-weight: 500;
color: #333;
margin-bottom: 32rpx;
}
.qr-box .store-box {
background: #F9F9F9;
border: 2rpx solid #E9E9E9;
border-radius: 8rpx;
padding: 16rpx 32rpx;
margin-bottom: 18rpx;
}
.qr-box .store-box:last-child {
margin-bottom: 0;
}
.qr-box .storeName {
font-size: 28rpx;
color: #333;
margin-top: -4rpx;
}
.qr-box .businessTime {
font-size: 24rpx;
color: #999;
margin-top: 4rpx;
padding-bottom: 18rpx;
}
.qr-box .line {
height: 2rpx;
background: #EEE;
}
.qr-box .addressBox {
padding-top: 20rpx;
font-size: 24rpx;
color: #666;
display: flex;
align-items: center;
}
.qr-box .addressBox .navigation-X {
width: 32rpx;
height: 32rpx;
}
.qr-box .couponBox-X {
max-width: 610rpx;
line-height: 48rpx;
}
.qr-box .couponBox-X .titleDay {
font-size: 28rpx;
font-weight: 500;
color: #333;
}
.titleDay_text {
font-size: 24rpx;
color: #666;
}
.darkColor {
color: #666;
}
.an_title_text {
font-size: 32rpx;
font-weight: 500;
color: #333;
margin-bottom: 20rpx;
}
.note_line {
box-sizing: border-box;
line-height: 48rpx;
}
.note_line .line_text_name {
font-size: 28rpx;
color: #333;
}
.note_line .line {
height: 2rpx;
background: #EEE;
margin: 16rpx 0 14rpx;
}
.line_text {
font-size: 24rpx;
color: #666;
}
.btn-box .title_text_X {
font-size: 36rpx;
font-weight: 600;
max-width: 510rpx;
}
.btn-box .baseImage{
width: 138rpx;
height: 138rpx;
background-size: cover;
position: absolute;
right: -9rpx;
top: -13rpx;
}
.btn-box .times {
font-size: 24rpx;
color: #D83C14;
margin: 20rpx 0 32rpx;
}
.qr-box .good {
display: flex;
padding-bottom: 12rpx;
}
.qr-box .good .icons {
width: 144rpx;
height: 144rpx;
}
.qr-box .good .infos {
margin-left: 32rpx;
}
.qr-box .good .infos .names {
font-size: 28rpx;
color: #282829;
}
.qr-box .good .infos .prices {
display: flex;
margin-top: 50rpx;
font-size: 36rpx;
font-weight: 600;
color: #FC5B32;
}
.qr-box .good .icons image {
border-radius: 8rpx;
}
.qr-box .good .infos .prices .prices-X {
margin-left: 10rpx;
}
.qr-box .liness {
height: 2rpx;
background: #EFF0F2;
margin: 20rpx 0 32rpx 0;
}
.coupon-X {
height: 203rpx;
margin: 0 -8rpx;
position: relative;
}
.coupon-X .left_box {
width: 230rpx;
height: 150rpx;
color: #FFFFFF;
font-size: 56rpx;
font-weight: 600;
text-align: center;
line-height: 150rpx;
}
.coupon-X .left_box .price_icon {
font-size: 24rpx;
font-weight: 500;
}
.coupon-X .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;
}
.describeColor {
color: #D83C14;
}
.timeColor {
color: #999;
}
.bottom_box {
height: 42rpx;
line-height: 42rpx;
}
.coupon-X .bg {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
}
.coupon-X .infoss {
position: relative;
z-index: 2;
display: flex;
width: 100%;
height: 100%;
right: 0;
top: 0;
}
\ No newline at end of file \ No newline at end of file
// packageShopmall/packageMall/pages/getCoupon/getCoupon.js // packageShopmall/packageMall/pages/getCoupon/getCoupon.js
import { userApi } from "~/api/index"; import USERAPI from "~/api/usersApi/index";
// import USER from '~/api/usersApi/index' // import USER from '~/api/usersApi/index'
const navStyle = "background-color: transparent;"; const navStyle = "background-color: transparent;";
import { IMG_URL } from '~/config'; import { IMG_URL } from '~/config';
...@@ -44,7 +44,7 @@ Page({ ...@@ -44,7 +44,7 @@ Page({
}, },
login() { login() {
wx.p.wxApi.showLoading() wx.p.wxApi.showLoading()
userApi.login().then(({ USERAPI.login().then(({
data data
}) => { }) => {
wx.hideLoading() wx.hideLoading()
...@@ -119,11 +119,11 @@ Page({ ...@@ -119,11 +119,11 @@ Page({
merchantId merchantId
} = wx.p.storage.get('merchant_info') } = wx.p.storage.get('merchant_info')
const channel = this.options.discoverGoodsType==1 ? 5 : 6 const channel = this.options.discoverGoodsType==1 ? 5 : 6
wx.$router.reLaunch(`/packageDiscovery/pages/index/index?merchantId=${merchantId}&channel=${channel}`, { notIntercept: true }) wx.p.router.reLaunch(`/packageDiscovery/pages/index/index?merchantId=${merchantId}&channel=${channel}`, { notIntercept: true })
}, },
toBack() { toBack() {
if(this.options.from) { if(this.options.from) {
wx.$router.back() wx.p.router.back()
}else{ }else{
this.JumpDiscoverPage() this.JumpDiscoverPage()
} }
...@@ -141,16 +141,16 @@ Page({ ...@@ -141,16 +141,16 @@ Page({
sessionId sessionId
} = this.data } = this.data
if (!sessionId) return if (!sessionId) return
userApi.authUserPhone(detail, sessionId).then(({ USERAPI.authUserPhone(detail, sessionId).then(({
data, data,
code, code,
message message
}) => { }) => {
wx.hideLoading() wx.hideLoading()
if (code == '0') { if (code == '0') {
wx.$authStatus = false wx.p.authStatus = false
wx.$util.setUserInfo(data) wx.p.util.setUserInfo(data)
wx.$util.setSessionId(data.sessionId) wx.p.util.setSessionId(data.sessionId)
this.setData({ this.setData({
sessionId: '', sessionId: '',
}) })
...@@ -171,7 +171,7 @@ Page({ ...@@ -171,7 +171,7 @@ Page({
// 客户id // 客户id
handlerCustomerId() { handlerCustomerId() {
let customerId = wx.p.storage.get('srcm_shopmall_customer_id') let customerId = wx.p.storage.get('srcm_shopmall_customer_id')
if (customerId) userApi.updataCustomerPhone() if (customerId) USERAPI.updataCustomerPhone()
}, },
/** /**
* 生命周期函数--监听页面隐藏 * 生命周期函数--监听页面隐藏
......
...@@ -72,6 +72,7 @@ ...@@ -72,6 +72,7 @@
background-color: #fff; background-color: #fff;
} }
.btn-box .btn{ .btn-box .btn{
width: 100% !important;
margin: 6rpx var(--margin); margin: 6rpx var(--margin);
background-color:var(--btnColor); background-color:var(--btnColor);
height: 88rpx; height: 88rpx;
......
...@@ -168,7 +168,7 @@ Page({ ...@@ -168,7 +168,7 @@ Page({
goodsName, goodsName,
couponId couponId
} = e.currentTarget.dataset.item } = e.currentTarget.dataset.item
let path = '/packageEquity/pages/commodity/detail/detail' let path = '/packageSaveMoney/pages/detail/detail'
let param = { let param = {
supplier: 'HW', supplier: 'HW',
brandName, brandName,
...@@ -177,7 +177,7 @@ Page({ ...@@ -177,7 +177,7 @@ Page({
couponId couponId
} }
if (appearance == 2) { if (appearance == 2) {
path = '/packageEquity/pages/commodity/chargeDetail/chargeDetail' path = '/packageSaveMoney/pages/chargeDetail/chargeDetail'
param.productName = goodsName param.productName = goodsName
param.icon = goodsLogo param.icon = goodsLogo
} }
......
// packageMine/pages/order/components/OrderItem/OrderItem.js
Component({
/**
* 组件的属性列表
*/
properties: {
},
/**
* 组件的初始数据
*/
data: {
},
/**
* 组件的方法列表
*/
methods: {
}
})
/* 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>
...@@ -32,7 +32,7 @@ Page({ ...@@ -32,7 +32,7 @@ Page({
url = `plugin://collectionPlugin/sbkHome?shareCode=${shareCode}&extra=wuye` url = `plugin://collectionPlugin/sbkHome?shareCode=${shareCode}&extra=wuye`
break; break;
case 2: case 2:
url = `plugin://collectionPlugin/sbkHome?shareCode=${shareCode}&extra=wuye` url = `plugin://collectionPlugin/mdlHome?shareCode=${shareCode}&extra=wuye`
break; break;
case 3: case 3:
url = `plugin://collectionPlugin/naixueHome?shareCode=${shareCode}&extra=wuye` url = `plugin://collectionPlugin/naixueHome?shareCode=${shareCode}&extra=wuye`
......
...@@ -251,7 +251,7 @@ Page({ ...@@ -251,7 +251,7 @@ Page({
onLoad(options) { onLoad(options) {
this.data.isGameUse = options.inType=='game' this.data.isGameUse = options.inType=='game'
this.data.isGH = options.source=='GH' this.data.isGH = options.source=='GH'
const query = options ? JSON.parse(decodeURIComponent(options.param)) : this.data.query const query = options ? options.param : this.data.query
this.getChargeDetail(query,options) this.getChargeDetail(query,options)
this.setNaviTitle(query.brandName) this.setNaviTitle(query.brandName)
if(options.inType=='game')return if(options.inType=='game')return
......
{ {
"navigationBarTitleText": "权益中心", "navigationBarTitleText": "权益中心",
"usingComponents": { "usingComponents": {
"coupons-list": "../components/couponsList/index"
} }
} }
\ No newline at end of file \ No newline at end of file
/* pages/changeDetail/changeDetail.wxss */ /* pages/changeDetail/changeDetail.wxss */
page{ page{
background: white; background: white !important;
} }
.detail_container{ .detail_container{
padding-bottom: 100rpx; padding-bottom: 100rpx;
......
import { IMG_URL } from '~/config';
Component({
/**
* 组件的属性列表
*/
properties: {
show: Boolean,
goodsId: {
type: Number,
observer: function (val) {
if (val) {
this.getGoodscouponList(val);
}
},
},
couponsId:Number
},
/**
* 组件的初始数据
*/
data: {
IMG_URL: IMG_URL,
currentIndex: 0,
current: null
},
/**
* 组件的方法列表
*/
methods: {
selectCoupons(e) {
const { index } = e.currentTarget.dataset
this.setData({
currentIndex: index
})
},
cancel() {
this.setData({
show: false
})
},
comfirm() {
const { couponData, currentIndex } = this.data
this.triggerEvent('getCoupons', couponData[currentIndex])
this.cancel()
},
async getGoodscouponList(id) {
const authStatus = await wx.p.router.intercept(false)
if (authStatus) return
let currentIndex = 0
wx.p.api.shopmallApi
.getEquitycouponList({
id,
couponType: 8
})
.then(({ code, data, message }) => {
let list =
data &&
data.map(item => {
item.denomination = wx.p.format.decimal(item.denomination / 100, 2)
if (item.effectiveEndTime || item.effectiveStartTime) {
item.effectiveEndTime = new Date(item.effectiveEndTime).format('yyyy.MM.dd')
item.effectiveStartTime = new Date(item.effectiveStartTime).format('yyyy.MM.dd')
}
return item
})
if (list.length) {
if(this.data.couponsId){
let flag = false
list.forEach((el,index)=>{
if(el.couponId==this.data.couponsId){
flag = true
this.triggerEvent('getCoupons', el)
currentIndex = index
}
})
if(!flag){
this.triggerEvent('getCoupons', list[0])
}
}else{
this.triggerEvent('getCoupons', list[0])
}
}
this.setData({
couponData: list,
currentIndex
})
})
},
}
})
{
"component": true,
"usingComponents": {
}
}
\ No newline at end of file \ No newline at end of file
.popclass {
border-radius: 48rpx 48rpx 0 0;
}
.container{
width: 100%;
height: 100%;
.header{
height: 102rpx;
width: 100%;
box-sizing: border-box;
padding: 0 64rpx;
display: flex;
align-items: center;
justify-content: space-between;
border-bottom: 2rpx solid #efefef;
.text{
font-weight: 400;
font-size: 32rpx;
color: #999999;
}
.comfirm{
font-weight: 500;
color: #FC5B32;
}
.title{
font-weight: 400;
color: #333333;
}
}
.pannel{
width: 100%;
height: calc(100% - 102rpx);
box-sizing: border-box;
padding: 32rpx 40rpx;
}
.element{
width: 670rpx;
height: 156rpx;
border-radius: 8rpx;
display: flex;
align-items: center;
margin-bottom: 20rpx;
position: relative;
.left-wrap{
width: 162rpx;
height: 100%;
display: flex;
flex-direction: column;
justify-content: center;
box-sizing: border-box;
// padding-left: 24rpx;
.price-widget{
font-weight: 600;
font-size: 40rpx;
color: #FC5B32;
text-align: center;
.mini{
font-weight: 500;
font-size: 20rpx;
}
}
.tip{
font-weight: 400;
font-size: 24rpx;
color: #D83C14;
text-align: center;
}
}
.right-wrap{
width: calc(100% - 170rpx);
height: calc(100% - 16rpx);
background: #FFFFFF;
box-sizing: border-box;
padding: 16rpx 24rpx;
.title{
font-weight: 600;
font-size: 28rpx;
color: #333333;
}
.tip{
font-weight: 400;
font-size: 20rpx;
color: #D83C14;
}
.mar{
margin: 4rpx 0 8rpx 0;
}
}
.radius{
width: 32rpx;
height: 32rpx;
border: 2rpx solid #DADADA;
border-radius: 50%;
position: absolute;
right: 32rpx;
top: 50%;
transform: translateY(-50%);
}
.active{
width: 32rpx;
height: 32rpx;
position: absolute;
right: 16rpx;
top: 50%;
transform: translateY(-50%);
}
}
}
\ No newline at end of file \ No newline at end of file
<popup show="{{ show }}" needFooter="{{false}}" bind:click-overlay="cancel" custom-class="popclass" position="bottom" custom-style="height: 65%">
<view class="container">
<view class="header">
<view class="text" catch:tap="cancel">取消</view>
<view class="text title">选择优惠券</view>
<view class="text comfirm" catch:tap="comfirm">完成</view>
</view>
<view class="pannel">
<scroll-view enhanced scroll-with-animation enable-passive scroll-y="{{true}}" style="height:calc(100% - 68rpx)">
<block wx:for="{{couponData}}" wx:key="index">
<view catch:tap="selectCoupons" data-index="{{index}}" class="element" style="background: url({{IMG_URL}}equity/coupons-bg-list.png);background-size: 100% 100%;">
<view class="left-wrap">
<view class="price-widget">
<text>{{item.denomination}}</text>
<text class="mini">元</text>
</view>
<view class="tip">立减</view>
</view>
<view class="right-wrap" wx:if="{{item.discountType != 8}}">
<view class="title">{{item.couponName}}</view>
<view class="tip mar">{{item.useBarriers==2?'满减':'无门槛'}}</view>
<view wx:if="{{item.effectiveType==1}}" class="tip">有效期:{{item.effectiveDays}}天</view>
<view wx:elif="{{item.effectiveType==2}}" class="tip">有效期{{item.effectiveStartTime}}-{{item.effectiveEndTime}}</view>
<view wx:elif="{{item.effectiveType==3}}" class="tip">无有效期</view>
</view>
<view class="right-wrap" wx:else>
<view class="title">{{item.couponName}}</view>
<view class="tip mar">{{item.amount}}张</view>
<view wx:if="{{item.effectiveType==1}}" class="tip">最近过期优先抵扣</view>
</view>
<glsx-image wx:if="{{currentIndex==index}}" class="active" webp src="equity/checked_icon.png"></glsx-image>
<view wx:else class="radius"></view>
</view>
</block>
</scroll-view>
</view>
</view>
</popup>
\ No newline at end of file \ No newline at end of file
...@@ -22,9 +22,10 @@ Page({ ...@@ -22,9 +22,10 @@ Page({
this.toCheckMember() this.toCheckMember()
}, },
onLoad: function (options) { onLoad: function (options) {
options = JSON.stringify(options)==='{}'?this.options:options // console.log(options);
// options = JSON.stringify(options)==='{}'?this.options:options
this.data.isGameUse = options.inType=='game' this.data.isGameUse = options.inType=='game'
const query = options ? JSON.parse(decodeURIComponent(options.param)) : this.data.query const query = options ? options.param : this.data.query
this.setNaviTitle(query.brandName) this.setNaviTitle(query.brandName)
if (!query.lat) { if (!query.lat) {
const tem = wx.p.storage.get('address_info') const tem = wx.p.storage.get('address_info')
......
{ {
"navigationBarTitleText": "权益中心", "navigationBarTitleText": "权益中心",
"usingComponents": { "usingComponents": {
"coupons-list":"../components/couponsList/index"
} }
} }
\ No newline at end of file \ No newline at end of file
...@@ -56,7 +56,7 @@ ...@@ -56,7 +56,7 @@
</view> </view>
<view wx:if="{{isGameUse}}" class="line_wrapper"> <view wx:if="{{isGameUse}}" class="line_wrapper">
<view class="line_label"> <view class="line_label">
<glsx-image class="logo" webp src="glsx/equity/comodity_use_logo.png"></glsx-image> <glsx-image class="logo" webp src="equity/comodity_use_logo.png"></glsx-image>
优惠券 优惠券
</view> </view>
<view catch:tap="toSelectCoupons" class="line_con class3 class4 class5"> <view catch:tap="toSelectCoupons" class="line_con class3 class4 class5">
...@@ -64,7 +64,7 @@ ...@@ -64,7 +64,7 @@
<text class="price_min_icon">¥</text> <text class="price_min_icon">¥</text>
<view>{{coupons.denomination}}</view> <view>{{coupons.denomination}}</view>
</block> </block>
<glsx-image wx:if="{{!isGH}}" class="logo" webp src="glsx/mine/arrow.png"></glsx-image> <glsx-image wx:if="{{!isGH}}" class="logo" webp src="mine/arrow.png"></glsx-image>
</view> </view>
</view> </view>
<view class="line_wrapper"> <view class="line_wrapper">
......
page { page {
background: white; background: white !important;
} }
.goods_scroll_wrapper { .goods_scroll_wrapper {
......
...@@ -66,7 +66,7 @@ ...@@ -66,7 +66,7 @@
.h1 { .h1 {
padding: 20rpx 0; padding: 44rpx 0 20rpx 0;
font-size: 44rpx; font-size: 44rpx;
color: #fff; color: #fff;
text-align: center; text-align: center;
...@@ -94,7 +94,7 @@ ...@@ -94,7 +94,7 @@
width: 590rpx !important; width: 590rpx !important;
height: 96rpx; height: 96rpx;
background: #3772EC; background: #3772EC;
border-radius: 16rpx; border-radius: 48rpx;
font-weight: 500; font-weight: 500;
font-size: 32rpx; font-size: 32rpx;
color: #FFFFFF; color: #FFFFFF;
...@@ -194,6 +194,7 @@ ...@@ -194,6 +194,7 @@
padding: 8rpx 16rpx !important; padding: 8rpx 16rpx !important;
width: fit-content !important; width: fit-content !important;
background-color: #3772EC; background-color: #3772EC;
border-radius: 28rpx;
} }
.code-btn[disabled]:not([type]) { .code-btn[disabled]:not([type]) {
......
...@@ -4,12 +4,12 @@ ...@@ -4,12 +4,12 @@
height: 268rpx; height: 268rpx;
overflow: hidden; overflow: hidden;
position: relative; position: relative;
border-radius: 16rpx; border-radius: 4rpx;
} }
.banner .swiper { .banner .swiper {
height: 100%; height: 100%;
border-radius: 16rpx; border-radius: 4rpx;
overflow: hidden; overflow: hidden;
position: relative; position: relative;
transform: translateY(0); transform: translateY(0);
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
.banner .swiper-item, .banner .swiper-item,
.banner .banner-img { .banner .banner-img {
border-radius: 16rpx; border-radius: 4rpx;
overflow: hidden; overflow: hidden;
} }
......
...@@ -28,7 +28,7 @@ Page({ ...@@ -28,7 +28,7 @@ Page({
let { height } = e.detail; let { height } = e.detail;
this.setData({ this.setData({
navBarHeight: height, navBarHeight: height,
user_box_style: `padding-top:${height + 20}px`, user_box_style: `padding-top:${height+10}px`,
}); });
}, },
// 处理滚动事件 // 处理滚动事件
......
...@@ -237,19 +237,20 @@ Component({ ...@@ -237,19 +237,20 @@ Component({
wx.p.router.go(`/packageMall/pages/getCoupon/getCoupon?discoverGoodsType=2&from=2`, { notIntercept: true }); wx.p.router.go(`/packageMall/pages/getCoupon/getCoupon?discoverGoodsType=2&from=2`, { notIntercept: true });
return return
} }
const deliveryType = item.deliveryType == 2 ? 0 : 1
const goodsListItem = {
...item,
goodsNumber: 1,
goodsId: item.id,
}
let _para = { let _para = {
goodsList: { goodsList:deliveryType==1? goodsListItem:[goodsListItem],
...item,
goodsNumber: 1
},
isCarOwner: true, isCarOwner: true,
showAddr: item.deliveryType == 1 ? 0 : 1, showAddr: deliveryType==0?1:0,
buyType: 'pay', buyType: 'pay',
discoverGoodsSource: item.discoverGoodsSource, discoverGoodsSource: item.discoverGoodsSource,
deliveryType:item.deliveryType == 1 ? 0 : 1 deliveryType:deliveryType
} }
console.log(_para);
wx.p.router.go('/packageDiscovery/pages/pay/index', _para) wx.p.router.go('/packageDiscovery/pages/pay/index', _para)
// const res = await shopmallApi.addShoppingcart(_para) // const res = await shopmallApi.addShoppingcart(_para)
// if (res) { // if (res) {
......
...@@ -27,6 +27,7 @@ ...@@ -27,6 +27,7 @@
</block> --> </block> -->
<view class="price_wrap"> <view class="price_wrap">
<text> <text>
<text class="price_tip">到手价</text>
<text class="unit">¥</text> <text class="unit">¥</text>
<text class="new_price">{{item.activityPrice}}</text> <text class="new_price">{{item.activityPrice}}</text>
<text class="old_price">{{item.originalPrice}}</text> <text class="old_price">{{item.originalPrice}}</text>
......
...@@ -39,6 +39,7 @@ ...@@ -39,6 +39,7 @@
justify-content: center; justify-content: center;
align-items: center; align-items: center;
position: relative; position: relative;
width: 96rpx;
} }
.order-box .btnBox .independentBox .order-img { .order-box .btnBox .independentBox .order-img {
width: 64rpx; width: 64rpx;
......
...@@ -351,7 +351,7 @@ page { ...@@ -351,7 +351,7 @@ page {
.tool-box .btnBox { .tool-box .btnBox {
display: flex; display: flex;
// justify-content: space-evenly; justify-content: space-between;
} }
.tool-box .btnBox .independentBox { .tool-box .btnBox .independentBox {
...@@ -359,7 +359,8 @@ page { ...@@ -359,7 +359,8 @@ page {
flex-direction: column; flex-direction: column;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
margin-right: 57rpx; // margin-right: 57rpx;
width: 96rpx;
} }
.tool-box .btnBox .independentBox:nth-child(5) { .tool-box .btnBox .independentBox:nth-child(5) {
......
...@@ -42,7 +42,11 @@ ...@@ -42,7 +42,11 @@
</view> </view>
<view class="left-content"> <view class="left-content">
<view class="card">{{memberInfo.equityName || '甄选会员卡'}}</view> <view class="card">{{memberInfo.equityName || '甄选会员卡'}}</view>
<view class="describe" wx:if="{{!isMember}}">专享十余项养车特权,劲省<text class="member-price-text">{{memberInfo.goodPrice}}元</text>/年</view> <view class="describe" wx:if="{{!isMember}}">
专享十余项养车特权,劲省
<text class="member-price-text">{{memberInfo.goodPrice}}元</text>
/年
</view>
<view class="describe" wx:else>{{vipInfo.time}} 到期</view> <view class="describe" wx:else>{{vipInfo.time}} 到期</view>
</view> </view>
</view> </view>
...@@ -136,6 +140,12 @@ ...@@ -136,6 +140,12 @@
<text class="tool-content">{{item.text}}</text> <text class="tool-content">{{item.text}}</text>
</view> </view>
</block> </block>
<view class="independentBox">
<view class="tool-img"></view>
</view>
<view class="independentBox">
<view class="tool-img"></view>
</view>
</view> </view>
</view> </view>
</view> </view>
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!