Commit 72213356 by 程南

合并代码

parent d0f53858
......@@ -12,7 +12,18 @@ let config = require('./configScreen/configScreen');
const envInfo = require('config/index').envInfo
let isPlusVip = false
// SDK需要先通过init初始化才能正常使用
let sr = require('lib/sdk-weapp-1.2.3.js').init({
appid: envInfo.appId, // 微信小程序 appid,以 wx 开头
token: 'bi3ecddbcbf3ef4553', // token是有数 appid,以 bi 开头,值为 https://srdata.tencent.com/ 中的密钥管理_APP ID
trackApp: true, //SDK 默认上报小程序的 启动 、显示 、隐藏 事件, false 关闭该功能。
proxyPage: true, // 是否开启自动代理 Page,默认是:false。
usePlugin: true,// 是否使用插件,默认是:false。
debug: true
})
App({
sr,
onLaunch: function (e) {
// console.log('onLaunch---',e);
// "navigationStyle": "custom"
......@@ -63,7 +74,6 @@ App({
}
wxService.post(`/member/minaLogin`, params).then(response => {
if (response) {
console.log('*****************************')
let dataResp = response.data.data
wx.setStorageSync('token', dataResp.token)
wx.setStorageSync('_baseUserInfo', dataResp);
......
......@@ -112,14 +112,17 @@
"pages/moneyBuyCouponInfo/moneyBuyCouponInfo",
"pages/moneyBuyCouponRecords/moneyBuyCouponRecords",
"pages/TimelimitedSales/TimelimitedSales",
"pages/belongWithGuide/belongWithGuide"
"pages/belongWithGuide/belongWithGuide",
"pages/promotionProducts/promotionProducts"
]
},
{
"root": "omniChannel/",
"pages": [
"pages/productDetail/productDetail"
"pages/productDetail/productDetail",
"pages/carts/carts",
"pages/submitOrder/submitOrder"
]
},
......@@ -127,7 +130,8 @@
"root": "subPackageMarketing/page",
"pages": [
"pages/scratch/scratch",
"pages/scratchRule/scratchRule"
"pages/scratchRule/scratchRule",
"pages/sign/sign"
]
}
],
......
......@@ -69,7 +69,7 @@ Component({
});
return ;
}
//有弹框
this.data.showDialog = true;
let dialogInfo = page.dialogInfo ? JSON.parse(page.dialogInfo) : null;
......@@ -80,8 +80,10 @@ Component({
// 父组件 更新
const urls = getCurrentPages()
const currentPath = urls[0]
// const currentPath = '/subPackage/page/pages/subPage/subPage'
const pageId = dialogInfo.link.url
dialogInfo.link.newPath = `/${currentPath.route}`
dialogInfo.link.newPath = `/${currentPath.route}`
}
} else if (dialogInfo.row) {
let newRow = JSON.parse(dialogInfo.row)
......@@ -151,8 +153,7 @@ Component({
else{
//先设置进去
dialogInfo[key] = true;
wx.setStorageSync('dialogInfo',dialogInfo);
//获取今天的当前也的key
let expiredAllKey = [];
for(let k in dialogInfo){
......@@ -165,6 +166,8 @@ Component({
expiredAllKey.forEach(item => {
delete dialogInfo[item];
});
wx.setStorageSync('dialogInfo',dialogInfo);
}
},
//获取今天是否已经弹出了
......
......@@ -16,41 +16,44 @@
<template name="water-list">
<navigator hover-class="none" url="/pages/productDetail/productDetail?id={{productId}}">
<view class="item">
<image wx:if="{{isFlashSale}}" class="limited-icon" src="https://img3.bigaka.com/prd/3001/202005/20200508/3001a6dcdf69-369a-4f43-8757-60f071946ea8.png" />
<!-- 图片主图时 -->
<image class="item-img"
src="{{indexUrl}}"
mode="widthFix" lazy-load
wx:if="{{!utils.isVideo(indexUrl)}}"
binderror="imgLoadError"
data-index="{{index}}"></image>
<video id="myVideo"
class="item-img video-cover"
src="{{indexUrl}}"
muted="{{true}}"
wx:if="{{utils.isVideo(indexUrl)}}"></video>
<view class="product-cover-imgs">
<image wx:if="{{isFlashSale}}" class="limited-icon" src="https://img3.bigaka.com/prd/3001/202005/20200508/3001a6dcdf69-369a-4f43-8757-60f071946ea8.png" />
<!-- 图片主图时 -->
<image class="item-img"
src="{{indexUrl}}"
mode="widthFix" lazy-load
wx:if="{{!utils.isVideo(indexUrl)}}"
binderror="imgLoadError"
data-index="{{index}}"></image>
<video id="myVideo"
class="item-img video-cover"
src="{{indexUrl}}"
muted="{{true}}"
wx:if="{{utils.isVideo(indexUrl)}}"></video>
<!-- 营销标签 -->
<view class="promotion-tag" wx:if="{{hasPromotionTag}}">
<view class="promotion-item">
<image src="{{tagPic}}" mode="widthFix" lazy-load></image>
<view class="promotion-price" wx:if="{{tagType != 1}}">
¥<label>{{tagPrice}}</label>
</view>
</view>
</view>
</view>
<view class="item-title-box">
<view class="item-title">{{productName}}</view>
</view>
<view class="pro-price-wrap">
<view class="pro-plus-price" wx:if="{{falshSaleActivityPrice}}">
<text>¥</text>
<text class="plus-price">{{utils.numberFormat(falshSaleActivityPrice / 100)}}</text>
<text class="sale-price">¥{{utils.numberFormat(minSalePrice / 100)}}</text>
</view>
<view class="pro-plus-price" wx:if="{{!falshSaleActivityPrice}}">
<text>¥</text>
<text class="plus-price">{{memberPrice ? utils.numberFormat(memberPrice / 100) : utils.numberFormat(minSalePrice / 100)}}</text>
<image wx:if="{{memberPrice}}" mode="widthFix" src="/assets/imgs/7_1_0/member-icon.png"></image>
</view>
<view class="pro-member-price" wx:if="{{plusPrice}}">
<text>¥</text>
<text class="member-price">{{utils.numberFormat(plusPrice / 100)}}</text>
......
......@@ -83,13 +83,14 @@
}
.pro-plus-price{
color: #cb3c3c;
font-size: 24rpx;
font-size: 26rpx;
display: flex;
align-items: center;
font-weight: bold;
}
.pro-member-price{
color: #333333;
font-size: 24rpx;
font-size: 26rpx;
margin-top: 10rpx;
}
.plus-price,.member-price{
......@@ -102,4 +103,65 @@
.pro-member-price image{
width: 51rpx;
margin-left: 13rpx;
}
\ No newline at end of file
}
.product-cover-imgs{
position: relative;
}
.product-cover-imgs .promotion-tag{
position: absolute;
width: 100%;
height: auto;
left: 0;
bottom: 0;
}
.product-cover-imgs .promotion-tag .promotion-item{
width: 100%;
position: relative;
}
.product-cover-imgs .promotion-tag .promotion-item .promotion-price{
position: absolute;
left: 0rpx;
bottom: 0rpx;
color: #ffffff;
font-size: 18rpx;
width: 125rpx;
height: 100%;
box-sizing: border-box;
-webkit-box-sizing: border-box;
padding-bottom: 15rpx;
display: flex;
align-items: flex-end;
justify-content: center;
}
.product-cover-imgs .promotion-tag .promotion-item .promotion-price label{
font-size: 24rpx;
font-weight: bold;
}
/* .product-cover-imgs .promotion-tag .promotion-item .promotion-price label{
} */
/* .product-cover-imgs .promotion-tag .promotion-item label{
position: absolute;
left: 10rpx;
bottom: 10rpx;
color: #ffffff;
font-size: 18rpx;
}
.product-cover-imgs .promotion-tag .promotion-item label text{
font-size: 24rpx;
font-weight: bold;
} */
.product-cover-imgs .promotion-tag .promotion-item image{
width: 100%;
}
......@@ -7,23 +7,26 @@
<image wx:if="{{item.isFlashSale}}" class="limited-icon" src="https://img3.bigaka.com/prd/3001/202005/20200508/3001a6dcdf69-369a-4f43-8757-60f071946ea8.png" />
<image class="hot-img" src="{{item.indexUrl}}" mode="aspectFit" lazy-load wx:if="{{!utils.isVideo(item.indexUrl)}}" />
<video id="myVideo" class="hot-img" src="{{item.indexUrl}}" muted wx:if="{{utils.isVideo(item.indexUrl)}}"></video>
<view class="promotion-tag" wx:if="{{item.hasPromotionTag}}">
<view class="promotion-item">
<image src="{{item.tagPic}}" lazy-load mode="widthFix"></image>
<label wx:if="{{item.tagType != 1}}">¥<text>{{item.tagPrice}}</text></label>
</view>
</view>
</view>
<view class="hot-item-desc border_box">
<view class="item-name">{{item.productName}}</view>
<!-- <view class="item-desc">{{item.productStatusDesc}}</view> -->
<view class="item-desc">{{item.subtitle}}</view>
<view class="item-vip-price weui-flex">
<text class="vip-sale-price border_box" wx:if="{{item.falshSaleActivityPrice}}">
<text class="vip-sale-price border_box product-price-red" wx:if="{{item.falshSaleActivityPrice}}">
¥{{utils.numberFormat(item.falshSaleActivityPrice / 100)}}<text class="sale-price">¥{{utils.numberFormat(item.minSalePrice / 100)}}</text>
</text>
<text class="vip-sale-price border_box" wx:if="{{!item.falshSaleActivityPrice}}">
<text class="vip-sale-price border_box product-price-red" wx:if="{{!item.falshSaleActivityPrice}}">
¥{{item.memberPrice ? utils.numberFormat(item.memberPrice / 100) : utils.numberFormat(item.minSalePrice / 100)}}
</text>
<view class="">
<image class="item-vip" src="https://img3.bigaka.com/prd/3001/202003/20200309/3001918ef881-b117-44da-8cfe-72e26f051e29.png" mode="widthFix" wx:if="{{item.memberPrice}}" />
<view class="" wx:if="{{item.memberPrice}}">
<image class="item-vip" src="https://img3.bigaka.com/prd/3001/202003/20200309/3001918ef881-b117-44da-8cfe-72e26f051e29.png" mode="widthFix" />
</view>
<!-- <text class="vip-original-price">¥189</text> -->
</view>
......@@ -35,7 +38,6 @@
<image class="item-plus" src="https://img3.bigaka.com/prd/3001/202003/20200309/3001fce746fd-c6f9-4016-bc0a-9aee0ac93f7a.png" mode="widthFix" lazy-load="false" />
</view>
</view>
<view />
</view>
</view>
</navigator>
......
......@@ -23,9 +23,51 @@
margin-left: 12rpx;
text-decoration: line-through;
}
.product-price-red{
color: #cb3c3c;
font-weight: bold;
}
.hot-img-box{
position: relative;
}
.hot-img-box .promotion-tag{
position: absolute;
width: 100%;
height: auto;
left: 0;
bottom: 0;
}
.hot-img-box .promotion-tag .promotion-item{
width: 100%;
position: relative;
display: flex;
align-items: flex-end;
}
.hot-img-box .promotion-tag .promotion-item label{
position: absolute;
left: 10rpx;
bottom: 0rpx;
color: #ffffff;
font-size: 18rpx;
}
.hot-img-box .promotion-tag .promotion-item label text{
font-size: 24rpx;
font-weight: bold;
}
.hot-img-box .promotion-tag .promotion-item image{
width: 100%;
}
.limited-icon{
position: absolute;
height: 36rpx;
......@@ -40,7 +82,7 @@
.item-name {
width: 338rpx;
color: rgba(0, 0, 0, 1);
font-size: 26rpx;
font-size: 30rpx;
text-align: left;
font-family: PingFangSC-Light;
font-weight: bold;
......@@ -51,7 +93,7 @@
overflow: hidden;
}
.item-desc{
color: #C09A74;
color: #999999;
font-size: 22rpx;
width: 378rpx;
margin-top: 12rpx;
......@@ -66,7 +108,7 @@
.item-plus-price,
.item-vip-price{
display: flex;
height: 45rpx;
height: auto;
color: rgba(51, 51, 51, 1);
font-size: 32rpx;
font-family: PingFangSC-Medium;
......@@ -74,7 +116,7 @@
align-items: baseline;
}
.item-vip-price{
margin-top: 12rpx;
/* margin-top: 12rpx; */
}
.vip-sale-price {
padding: 0 10rpx 0 0;
......@@ -87,7 +129,7 @@
text-decoration: line-through;
}
.vip-plus-price {
color: rgba(203, 60, 60, 1);
color: #cb3c3c;
}
.buy-btn {
text-align: right;
......@@ -99,7 +141,7 @@
line-height: 35rpx;
border-radius: 19rpx;
text-align: center;
background-color: var(--themecolor);
background-color: #cb3c3c;
border: 2rpx solid rgba(151, 151, 151, 1);
color: rgba(255, 255, 255, 1);
font-size: 18rpx;
......
......@@ -97,11 +97,7 @@ Component({
productPrice:{
type: Number,
value: 0
},
currentHasMobile: {
type: Boolean,
type: false
},
}
},
attached () {
......@@ -150,13 +146,6 @@ Component({
* 组件的方法列表
*/
methods: {
//获取手机号回调
getPhoneNumber(res = {}) {
wxService.nextTick(() => {
this.triggerEvent('getMobile', res);
})
},
confirm() {
if (this.data.curSpec.length < 1){
wx.showToast({
......@@ -195,6 +184,7 @@ Component({
this.triggerEvent('skuselect', {
skuId: this.data.skuId,
count: this.data.proNum,
selectSku : this.data.skuText
})
this.setData({
......
......@@ -6,26 +6,12 @@
// 修改 BRANCH_ID 为对应的商户id
// app.js 中brandId 修改为对应
const PROJECT_ENV = 'prod' // 生产 prod, 开发 dev, 测试 test , 测试门户 test_store, 预生产 pre
const PROJECT_ENV = 'test' // 生产 prod, 开发 dev, 测试 test , 测试门户 test_store, 预生产 pre
//仅生产环境时 配置 :
//3001 3001 , wx313ec36b710125d4 有直播
//2006 泰华 , wx40fec8944623c8b3 有直播
//2007 多多一上 , wxf7bc302c51166dc0 有直播
//2012 悦芙媞 wxfe14ebde4a6eea3d 有直播
//2008 雪岛书屋 wx207f8a95bbc9d3ab
//2003 苏州邻里 , wxe7770946f9d93d38
//2010 热风 wxe6d270a3e399ade9
//2009 拉如 wxa0db9cb42b1cbdc9
//2013 阿特里里
//2014 包鞋
//2015 花在花园 wx8a35f9a57afd13e9
//2016 阿吉豆
//2017 ACTREE wx2aae34874e88cdf5
//2992 山东盛联微商城 wx53dedc202ae0d0c2
//2002 巴黎贝甜 wx21968cb3a486d4ab
const BRANCH_ID = 2010
const BRANCH_ID = 1002
const isMall = true
// const needMock = '' //
......@@ -75,14 +61,14 @@ const prod_brand_config = {
canRefundDaysAfterDelivery : 15,//发货后多少天之内可显示申请退款按钮
isNeedGetLocation : true,//是否开启小程序获取位置(提交订单时获取门店信息)
guiderCanScanQrcode : true,//导购是否有扫一扫功能
hasKeFu : true,//是否有客服功能
shareTitle: '【舞象星品荟-社交商城】',
themeColor: '#cb3c3c',//主题颜色
logo: 'https://img3.bigaka.com/prd/3001/202003/20200331/3001842823fb-2601-4b58-a648-79ad799ad425.png',
openRefundTips : true,//是否开启退货须知显示
refundTips : '温馨提示:退货通过审核后需将清单随包裹一起寄回或纸条备注(订单号与退货商品款号)【请务必审核通过后24小时内填写寄回运单号,拒签到付/顺丰/EMS/天天快递 不影响二次销售】',//退货须知文本
//wx654ce96a7324e76f 小程序微信支付券
signUrl : 'https://crm-m.bigaka.com/activity/sign.html?brandId=3001',
},
//热风
2010 : {
appId: 'wxe6d270a3e399ade9',
......@@ -90,13 +76,13 @@ const prod_brand_config = {
brandId: 2010,
plusIsOpen: false,
contactUsIsOpen: false,
hasKeFu : false,//是否有客服功能
contactUsPluginId: 'f86b306023ec790b70c0b45fcf308b04',
hasTrial: false,
isMall: isMall,
hasLiveVideo: false,//是否有直播功能
canUseWechatAddress: false,//是否使用获取微信地址
orderingMustOpenCard: false,
themeColor: '#007d63',//主题颜色
touchPointStorageTime: 48 * 60 * 60 * 1000,//单位毫秒
guiderCanScanQrcode: false,//导购是否有扫一扫功能
canRefundDaysAfterDelivery: 15,//发货后多少天之内可显示申请退款按钮
......@@ -106,9 +92,8 @@ const prod_brand_config = {
logo: 'https://img3.bigaka.com/prd/3001/202003/20200331/3001377a0bb9-8f7f-4b40-8966-9fc5f8a69cdd.png',
openRefundTips : true,//是否开启退货须知显示
refundTips : '温馨提示:退货通过审核后需将清单随包裹一起寄回或纸条备注(订单号与退货商品款号)【请务必审核通过后24小时内填写寄回运单号,拒签到付/顺丰/EMS/天天快递 不影响二次销售】',//退货须知文本
}
signUrl : 'https://crm-m.bigaka.com/activity/sign.html?brandId=2010',
},
}
//默认分享logo
......@@ -186,6 +171,11 @@ const token = {
pre: 'aa8a1bfb7f6c5031d172d94b6574293ef954a6f2d4e16657da008e0cc15588feD', //预生产
}
const CONST_SIGN_URL = {
dev: 'https://crm-m.bigaka.net/activity/sign.html?brandId=1002', //开发
test: 'https://crm-m.bigaka.net/activity/sign.html?brandId=1002', //测试
}
//获取配置信息
let brandId = PROJECT_ENV == 'prod' ? prod_brand_config[BRANCH_ID].brandId : (PROJECT_ENV == 'dev' ? 1001 : 1002);
let fixed_appId = PROJECT_ENV == 'prod' ?
......@@ -208,8 +198,8 @@ let canRefundDaysAfterDelivery = PROJECT_ENV == 'prod' ? prod_brand_config[BRANC
let touchPointStorageTime = PROJECT_ENV == 'prod' ? prod_brand_config[BRANCH_ID].touchPointStorageTime : 1800000;
let openRefundTips = PROJECT_ENV == 'prod' ? prod_brand_config[BRANCH_ID].openRefundTips : true;
let refundTips = PROJECT_ENV == 'prod' ? prod_brand_config[BRANCH_ID].refundTips : '温馨提示:退货通过审核后需将清单随包裹一起寄回或纸条备注(订单号与退货商品款号)【请务必审核通过后24小时内填写寄回运单号,拒签到付/顺丰/EMS/天天快递 不影响二次销售】';
let themeColor = PROJECT_ENV == 'prod' ? prod_brand_config[BRANCH_ID].themeColor : '#cb3c3c';
let hasKeFu = PROJECT_ENV == 'prod' ? prod_brand_config[BRANCH_ID].hasKeFu : true;
let signUrl = PROJECT_ENV == 'prod' ? prod_brand_config[BRANCH_ID].signUrl : CONST_SIGN_URL[PROJECT_ENV];
//配置信息导出
const envInfo = (() => {
return {
......@@ -237,7 +227,8 @@ const envInfo = (() => {
touchPointStorageTime: touchPointStorageTime,
openRefundTips : openRefundTips,
refundTips : refundTips,
themeColor : themeColor,
hasKeFu : hasKeFu,
signUrl : signUrl,
}
})()
......
// component/chooseAddress/chooseAddress.js
const wxService = require('../../../../utils/wxService')
const utils = require('../../../../utils/util')
Component({
/**
* 组件的属性列表
*/
properties: {
address: {
type: Object,
value: null,
observe: '_addressChange'
}
},
/**
* 组件的初始数据
*/
data: {
},
attached() {
let address = this.data.address
if (!address) {
// utils.getUserDefaultAddress().then(res => {
// this.setData({
// address: res
// })
// wxService.nextTick(() => {
// this.triggerEvent('selectAddrSuccess', {
// ...res, addressId: res.id
// })
// })
// })
} else {
this.setData({
address
})
}
},
detached() {
this._addressChange = null
},
/**
* 组件的方法列表
*/
methods: {
_addressChange(newV, oldV) {
if (newV !== oldV) {
this.setData({
address: newV
})
}
},
selectAddress: function () {
// wxService.selectAddress().then(res => {
// this.setData({
// address: res
// })
// wxService.nextTick(() => {
// this.triggerEvent('selectAddrSuccess', {
// ...res, addressId: res.id
// })
// })
// })
}
}
})
{
"component": true
}
\ No newline at end of file
<view class="address-select" bindtap="selectAddress">
<view wx:if="{{!address}}" class='detail-content'>
<view class='addr-icon-wapper'><image class='addr-icon' src='https://hwimagecdn.ihotwind.cn/hotwind-mini/images/hotnewicon/addr.png' mode="widthFix"></image></view>
<view class='addr-detail-info'>
<text class='user-name-text user-info-ft'>请选择收货地址</text>
</view>
<view class='addr-arrow-icon-wapper'><image class='addr-arrow-icon' src='https://hwimagecdn.ihotwind.cn/hotwind-mini/images/hotnewicon/big-right-arrow.png' mode="widthFix"></image></view>
</view>
<view wx:if="{{address}}" class='detail-content'>
<view class='addr-icon-wapper'><image class='addr-icon' src='https://hwimagecdn.ihotwind.cn/hotwind-mini/images/hotnewicon/addr.png' mode="widthFix"></image></view>
<view class='addr-detail-info'>
<text class='user-name-text user-info-ft'>{{address.userName}}</text>
<text class="user-info-ft">{{address.telNumber}}</text>
<view class='user-addr-ft'>{{address.detailInfo}}</view>
</view>
<view class='addr-arrow-icon-wapper'><image class='addr-arrow-icon' src='https://hwimagecdn.ihotwind.cn/hotwind-mini/images/hotnewicon/big-right-arrow.png' mode="widthFix"></image></view>
</view>
</view>
/* component/chooseAddress/chooseAddress.wxss */
page {
background: #f5f5f5;
padding-bottom: 120rpx; }
.address-select {
background: #ffffff;
margin-bottom:20rpx;
}
.addr-detail-info{
font-size: 23rpx;
color: #666666;
}
.detail-content{
display:flex;
flex-direction:row;
align-items:center;
padding:40rpx 30rpx;
background:#ffffff;
border-top:1rpx solid #e6e6e6;
justify-content:space-between;
}
.addr-icon-wapper {
margin-bottom:0rpx !important;
}
.addr-icon{
width:35rpx;
height:44rpx;
margin-right:25rpx;
}
.user-name-text{
margin-right: 40rpx
}
.user-info-ft{
font-size: 28rpx;
color: #333333;
}
.user-addr-ft{
font-size: 26rpx;
color: #666666;
}
.addr-arrow-icon-wapper{
margin-bottom:0rpx !important;
}
.addr-arrow-icon{
width:12rpx;
height:23rpx;
}
.addr-detail-info{
flex: 2
}
\ No newline at end of file
// component/couponPopup/couponPopup.js
Component({
/**
* 组件的属性列表
*/
properties: {
show: { // 显示标识
type: Boolean,
value: false
},
popupTitle: {// 弹窗标题
type: String,
value: ''
},
showTip: { //显示请在支付前选用
type: Boolean,
value: false
},
showCouponTipTitle: {//
type: String,
value: ''
},
couponDatas: { // 所有券
type: Object,
value: []
},
},
/**
* 组件的初始数据
*/
data: {
},
/**
* 组件的方法列表
*/
methods: {
// 隐藏弹出框
hidePopup: function () {
this.setData({
show: false
})
},
//选择券
chooseCoupon: function(e){
if(e.currentTarget.dataset.useflag){//可用
const { id, index, name, cptype, obj} = e.currentTarget.dataset
this.triggerEvent('showCouponDetail', { 'id': id, 'index': index, 'name': name, 'type': cptype ,'obj':obj});
this.hidePopup()
}else{//不可用
wx.showToast({
title: '该优惠券不可用',
icon: 'none'
})
}
},
}
})
{
"component": true,
"usingComponents": {}
}
\ No newline at end of file
<!--component/couponPopup/couponPopup.wxml-->
<view class="popup-container{{show ? ' active' : ''}}" bindtap="hidePopup"></view>
<view class="popup-content{{show ? ' active' : ''}}">
<view class='top'>
<text class='top-title'>{{popupTitle}}</text>
<text class='top-title-tip' wx:if="{{showTip}}">{{showCouponTipTitle}}</text>
<image class="popup-close" mode="widthFix" src="img/coupon-close.png" bindtap="hidePopup"></image>
</view>
<!-- 加 catchtouchmove="return" 仅触摸背景区域时不穿透底部 -->
<scroll-view catchtouchmove="return" class='coupon-content' scroll-y='true' >
<view class='cp-banner-wapper' wx:for="{{couponDatas}}" wx:key="*this" wx:for-item="coupon" bindtap="{{coupon.choose ? 'chooseCoupon': ''}}" data-useflag="{{coupon.useFlag}}" data-id="{{coupon.id ? coupon.id : ''}}" data-name="{{coupon.name ? coupon.name : ''}}"
data-index="{{coupon.index}}" data-cptype="{{coupon.CouponUseType ? coupon.CouponUseType : ''}}" data-obj="{{coupon.obj ? coupon.obj : '' }}">
<block wx:if="{{coupon.useFlag || coupon.displayFlag}}">
<image src='img/coupon-popup-banner.png' mode="widthFix" class='cp-banner'></image>
<block wx:if="{{coupon.promotionType == 2}}">
<view class='discount-banner'>
<image mode="widthFix" src="img/coupon-rmb-icon.png" class="rmb-icon"></image>
<text class='rmb'>{{coupon.price}}</text>
</view>
</block>
<block wx:if="{{coupon.promotionType == 1}}">
<view class='discount-banner'>
<text class='rmb'>{{coupon.price}}</text>
<text class='zhe-icon'>折</text>
</view>
</block>
<view class='cp-detail-info'>
<text class='cp-name'>{{coupon.name}}</text>
<view class='cp-time'>有效期:{{coupon.startTime}} 至 {{coupon.endTime}}</view>
</view>
</block>
<block wx:else>
<image src='img/coupon-popup-banner-gray.png' mode="widthFix" class='cp-banner'></image>
<block wx:if="{{coupon.promotionType == 2}}">
<view class='discount-banner'>
<image mode="widthFix" src="img/coupon-rmb-icon-gray.png" class="rmb-icon"></image>
<text class='rmb-gray'>{{coupon.price}}</text>
</view>
</block>
<block wx:if="{{coupon.promotionType == 1}}">
<view class='discount-banner'>
<text class='rmb-gray'>{{coupon.price}}</text>
<text class='zhe-icon-gray'>折</text>
</view>
</block>
<view class='cp-detail-info'>
<text class='cp-name-gray'>{{coupon.name}}</text>
<view class='cp-time-gray'>有效期:{{coupon.startTime}} 至 {{coupon.endTime}}</view>
</view>
</block>
</view>
</scroll-view>
</view>
/* component/couponPopup/couponPopup.wxss */
.popup-container {
position: fixed;
width: 100%;
height: 100%;
top: 0;
left: 0;
background: rgba(0, 0, 0, 0.5);
transform: translateY(100%);
opacity: 0;
transition: opacity 200ms;
z-index: 98;
}
.popup-container.active {
opacity: 1;
transform: translateY(0); }
.popup-content.active {
transform: translateY(0); }
.popup-content {
position: fixed;
z-index: 99;
width: 100%;
min-height: 400rpx;
bottom: 0;
left: 0;
background: #fff;
transition: transform 300ms;
transform: translateY(100%); }
.top{
display: flex;
flex-direction: row;
align-items: center;
margin: 30rpx 30rpx 25rpx 30rpx;
padding-bottom: 26rpx;
border-bottom: 1rpx solid #f2f2f2;
}
.top-title{
color: #333;
font-size: 28rpx;
}
.top-title-tip{
margin-left: 30rpx;
font-size: 23rpx;
color: #cb3c3c;
}
.popup-content .popup-close {
position: absolute;
right: 30rpx;
top: 30rpx;
width: 30rpx;
height: 30rpx; }
.clearfix::after {
content: '';
display: block;
clear: both; }
.coupon-content{
margin: 0 30rpx 30rpx 30rpx;
height: 600rpx;
}
.cp-banner-wapper{
position: relative;
height: 148rpx;
margin-bottom: 25rpx;
}
.cp-banner{
width: 690rpx;
}
.discount-banner{
position: absolute;
text-align: center;
width: 209rpx;
height: 148rpx;
line-height: 148rpx;
top: 0rpx;
left: 0rpx;
}
.rmb-icon{
width: 15rpx;
margin-right: 10rpx;
}
.zhe-icon{
font-size: 20rpx;
color: #007d63;
margin-left: 8rpx;
}
.zhe-icon-gray{
font-size: 20rpx;
color: #727171;
margin-left: 8rpx;
}
.rmb{
font-size: 60rpx;
font-weight: bolder;
color: #007d63;
}
.rmb-gray{
font-size: 60rpx;
font-weight: bolder;
color: #727171;
}
.cp-detail-info{
position: absolute;
top: 35rpx;
left: 247rpx;
width: 57%;
}
.cp-name{
font-size: 28rpx;
font-weight: bold;
color: #333;
display: inline-block;
white-space: nowrap;
width: 100%;
overflow: hidden;
text-overflow:ellipsis;
}
.cp-name-gray{
font-size: 28rpx;
font-weight: bold;
color: #727171;
display: inline-block;
white-space: nowrap;
width: 100%;
overflow: hidden;
text-overflow:ellipsis;
}
.cp-time{
font-size: 24rpx;
color: #787878;
}
.cp-time-gray{
font-size: 24rpx;
color: #B5B5B6;
}
\ No newline at end of file
const app = getApp()
const wxService = require('../../../utils/wxService')
const util = require('../../../utils/util')
const envInfo = require('../../../config/index').envInfo
wxService.page({
data: {
goodList: [], // 商品列表
chooseList: [], // 选中的商品
custNo: null, // 用户编号
shoppingCartId: null, // 购物车id
colorUrl1: '../images/choose-good.png', // 列表未选择
colorUrl2: '../images/choosen-good.png', // 选中
iconId: -1, // 总计选中标识
editFlag: false, // 编辑标识
totalPrice: 0, // 总价
toFlag: false, // 是否选择商品
pageNo: null,
payOrderConfig: {},
// storeName: null,
isGoods: true,
outGoods: [], //失效商品
outGoodIds: [], //失效商品ids
checkAll: true,
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
wx.showLoading({
title: '加载中'
})
this.getCarList()
},
getCarList(){
let cartList = wx.getStorageSync('_cartList');
let totalPrice = 0;
cartList = cartList ? cartList.map(item => {
item.count = item.count ? item.count : 1;
totalPrice = totalPrice + (item.price * item.count * 1000) / 1000
item.isChoose = true;
return item;
}) : [];
this.setData({
goodList: cartList,
totalPrice: parseFloat(totalPrice).toFixed(2)
})
},
// 选择商品
chooseGood: function (e) {
var checkAll = false
let _scope = this
let id = e.currentTarget.dataset.id;
let num = e.currentTarget.dataset.num;
let data = _scope.data.goodList;
let list = _scope.data.chooseList
if (num != 0) {
data[id].isChoose = !data[id].isChoose
_scope.setData({
goodList: data,
iconId: id
})
list = data.filter(item => {
return item.isChoose
}).map(item => {
return {
...item,
storeName: this.data.storeName
}
})
// 所有单个选中 ,全选
if (data.filter(function (item) {
if (item.stockNum != 0) {
return item
}
}).length === data.filter(function (item) {
return item.isChoose
}).length) {
checkAll = true
} else {
checkAll = false
}
_scope.setData({
chooseList: list,
checkAll: checkAll
})
_scope.setTotalPrice()
} else {
util.alert('该商品没有库存哦~')
}
},
// 删除商品
cancelGood: function (e) {
let index = e.currentTarget.dataset.id;
let list = this.data.goodList;
list.splice(index, 1);
wx.setStorageSync('_cartList', list);
this.setTotalPrice();
this.setData({
goodList: list
})
wx.showToast({
title: '删除商品成功',
icon: 'none'
})
},
// 验证是否满足下单设置
validateOrder(storeLimitNum, { inventoryLimitQuantity, inventoryLimitFlag }) {
let pass = false
if (inventoryLimitFlag && (inventoryLimitQuantity - storeLimitNum > 0)) {
pass = true
} else if (!inventoryLimitFlag) {
pass = true
}
return pass
},
// 跳转提交页
toDetail: function () {
let _scope = this
if (_scope.data.isGoods) {
let goodArr = _scope.data.goodList
let choose = goodArr.filter(item => item.isChoose)
if (choose && choose.length) {
_scope.setData({
toFlag: true
})
}
if (choose.length == 0) {
util.alert('您还没有选择商品哦~')
return false
}
const storeInventoryQuantity = choose && choose[0].storeInventoryQuantity || 0
const chooseFilter = choose.filter((item) => {
return this.validateOrder(storeInventoryQuantity, this.data.payOrderConfig)
})
if (chooseFilter.length === 0) {
wx.showToast({
title: '您选择的商品门店中都有存库,您可以直接在门店进行购买。',
icon: 'none'
})
return false
}
if (choose.length > 0) {
let goodsList = choose.map(item => {
return {
skuCode: item.barCode,
quantity: item.count
}
})
let goodsInfo = {
goodsList: goodsList,
storeId: wx.getStorageSync('_storeId')
};
wx.setStorageSync('goodsInfo',goodsInfo);
wx.navigateTo({
url : '/omniChannel/pages/submitOrder/submitOrder?from=cart'
});
} else {
util.alert('您还没有选择商品哦~')
}
}
},
setTotalPrice(){
let that = this;
let totalPrice = 0;
this.data.goodList.map((item) => {
if (item.stockNum && item.isChoose) {
totalPrice = totalPrice + (item.price * item.count * 1000) / 1000
}
})
that.setData({
totalPrice: parseFloat(totalPrice).toFixed(2)
})
},
//清空失效商品
clearOutTimeGoods() {
let ids = this.data.outGoodIds.join(',')
let token = wx.getStorageSync('token')
let that = this
wxService.get('shopCart/deleteShopCartInfoByIds', {
ids,
token: token
}).then(res => {
if (res.data.code === 200) {
wx.showToast({
title: '失效商品已清除',
icon: 'none'
})
}
that.setData({
outGoods: [],
outGoodIds: []
})
})
},
// 全选
checkAll: function () {
let that = this
var goodList = this.data.goodList || []
if (!goodList.length) return false
if (this.data.checkAll) {
this.setData({
goodList: goodList.map(function (item) {
item.isChoose = false
return item
}),
checkAll: false
}, () => {
that.setTotalPrice()
})
} else {
this.setData({
goodList: goodList.map(function (item) {
// 区分失效商品
if (item.stockNum != 0) {
item.isChoose = true
return item
} else {
item.isChoose = false
return item
}
}),
checkAll: true,
}, () => {
that.setTotalPrice()
})
}
},
})
{
"navigationBarTitleText": "购物车"
}
\ No newline at end of file
<!-- pages/car/car.wxml -->
<!-- <import src="../temp/header.wxml" /> -->
<wxs src="../../wxs/utils.wxs" module="tools" />
<view class="cart-pros" style="margin-bottom: 20rpx;" wx:if="{{goodList.length > 0}}">
<view wx:for="{{goodList}}" wx:key="*this" class="order-product">
<block wx:if="{{item.stockNum}}">
<icon type="{{item.isChoose ? 'success' : 'circle'}}" size="16" data-num="{{item.stockNum}}" data-id="{{index}}" catchtap="chooseGood"></icon>
<view class='pro-detail-wapper'>
<image class="pro-image" mode="widthFix" src="{{tools.getImageUrlCar(item.listImgUrlList)}}"></image>
<view class="pro-info">
<view class="pro-name">{{item.name}}{{item.girard}}</view>
<view class='skuAndNum-wapper'>
<view class='select-sku-wapper'>
<view class="pro-sku text-gray">
{{item.colorName}},{{item.sizeName}}码
</view>
</view>
<view class="pro-num-edit">
<text class='text-gray'>x{{item.count}}</text>
</view>
</view>
<view class="pro-price">
<text class="price-red">¥{{item.price}}</text>
</view>
<view class='del-icon-wapper'>
<image mode="widthFix" data-id="{{index}}" catchtap='cancelGood' data-num="{{item.stockNum}}" class='del-pro-icon' src='https://hwimagecdn.ihotwind.cn/hotwind-mini/images/hotnewicon/del-icon.png'></image>
</view>
</view>
</view>
</block>
</view>
</view>
<view class='outTime-wapper' wx:if="{{outGoods.length>0}}">
<view class='outTime-pro-info'>
<text class='outTime-pro-text'>失效宝贝</text>
<text class='clear-outTime-pro-btn' bindtap='clearOutTimeGoods'>清除失效宝贝</text>
</view>
<view class="cart-pros1 fa-bg" style="margin-bottom: 20rpx;" wx:if="{{outGoods.length}}">
<view wx:for="{{outGoods}}" wx:key="*this" class="order-product disabled">
<block wx:if="{{item.stockNum == 0}}">
<view class='out-time'>
<text>失效</text>
</view>
<view class='pro-detail-wapper'>
<image class="pro-image" mode="widthFix" src="{{tools.getImageUrlCar(item.listImgUrlList)}}"></image>
<view class="pro-info">
<view class="pro-name">{{item.name}}{{item.girard}}</view>
<view class='skuAndNum-wapper'>
<view class='select-sku-wapper'>
<view class="pro-sku text-gray">
{{item.colorName}},{{item.sizeName}}码
</view>
</view>
<view class="pro-num-edit">
<text class='text-gray'>x{{item.purchaseQuantity}}</text>
</view>
</view>
<view class="pro-price">
<text class="price-red">¥{{item.price}}</text>
</view>
<view class='del-icon-wapper'>
<image mode="widthFix" data-id="{{index}}" catchtap='cancelGood' data-num="{{item.stockNum}}" class='del-pro-icon' src='https://hwimagecdn.ihotwind.cn/hotwind-mini/images/hotnewicon/del-icon.png'></image>
</view>
</view>
</view>
</block>
</view>
</view>
</view>
<view style='height:110rpx;'></view>
<view class="cart-bottom">
<icon type="{{checkAll ? 'success' : 'circle'}}" bindtap="checkAll" size="16"></icon>
<text class='check-all-txt'>全选</text>
<text class="price-red bottom-price">合计:¥{{totalPrice}}</text>
<text class='buy-now-btn buy-btn' bindtap="toDetail">立即购买</text>
</view>
\ No newline at end of file
/* pages/car/car.wxss */
.content {
height: 100%;
display: flex;
flex-direction: column;
align-items: center;
justify-content: space-between;
box-sizing: border-box;
margin-top: 7rpx;
margin-bottom: 100rpx;
}
.goodsList {
width: 100%;
background-color: #fff;
}
.goodsList2 {
display: flex;
flex-direction: row;
align-items: center;
margin-bottom: 5rpx;
box-sizing: border-box;
}
.goodIcon {
width: 33rpx;
height: 33rpx;
margin: 48rpx 31rpx 64rpx 26rpx;
}
.goodInfo {
display: flex;
flex: 1;
justify-content: flex-start;
align-items: center;
}
.good-title {
font-size: 28rpx;
color: #535353;
}
.color-9 {
color: #959595;
flex: 1;
font-size: 27rpx;
}
.goodCode {
margin-right: 30rpx;
}
.goodColor {
margin-right: 10rpx;
text-align: center;
}
.goodSize {
margin-right: 64rpx;
text-align: center;
}
.title-bottom {
display: flex;
}
.goodPrice {
display: inline-block;
width: 90rpx;
color: #fc6d57;
font-size: 26rpx;
margin: auto 27rpx 0 0;
}
.goodPrice-icon {
width: 40rpx;
height: 50rpx;
margin: 0 46rpx 0 20rpx;
}
.footer-btn {
position: fixed;
left: 0;
bottom: 0;
display: flex;
width: 100%;
height: 90rpx;
line-height: 90rpx;
background-color: #fff;
}
.total {
flex: 2;
position: relative;
padding-right: 38rpx;
font-size: 30rpx;
color: #565656;
text-align: right;
background-color: #fff;
}
.total-money {
color: #fc6d57;
font-size: 33rpx;
}
.editBtn {
flex: 1;
background-color: #69b8b5;
color: #fff;
font-size: 35rpx;
text-align: center;
}
.editBtn2 {
flex: 1;
background-color: #999;
color: #fff;
font-size: 35rpx;
text-align: center;
}
.buyNow {
flex: 1;
background-color: #ffa334;
color: #fff;
font-size: 35rpx;
text-align: center;
}
.buyNow2 {
flex: 1;
background-color: #999;
color: #fff;
font-size: 35rpx;
text-align: center;
}
.finshed {
flex: 1;
margin-left: 178rpx;
background-color: #ffa334;
color: #fff;
font-size: 35rpx;
text-align: center;
}
.total-icon {
width: 30rpx;
height: 30rpx;
position: absolute;
left: 80rpx;
top: 33rpx;
}
.goods-image {
width: 71rpx;
height: 71rpx;
margin-right: 22rpx;
}
.goods-desc {
display: flex;
flex-direction: column;
flex: 1;
}
.cart-pros {
border-top:1rpx solid #e6e6e6;
padding: 12rpx 30rpx 10rpx 30rpx;
background: #ffffff;
}
.order-product {
display: flex;
background: #ffffff;
}
.order-product .pro-image {
width: 170rpx;
margin-right: 28rpx;
}
.order-product .pro-info {
flex: 1;
color: #616161;
padding-top:16rpx;
}
.order-product .pro-info view {
margin-bottom:10rpx;
}
.order-product .pro-info .pro-sku {
font-size: 24rpx;
}
.order-product .pro-info .pro-price {
display: flex;
justify-content: space-between;
margin-bottom: 0;
}
.order-product .pro-info .pro-price text {
font-size: 26rpx;
}
.order-product icon {
align-self: center;
margin-right: 30rpx;
}
.del-icon-wapper{
text-align:right;
margin-bottom: 0rpx !important;
}
.del-icon-wapper .del-pro-icon{
width: 23rpx;
height: 26rpx;
}
.skuAndNum-wapper{
display:flex;
margin-bottom: 0rpx !important;
justify-content: space-between;
align-items: center;
height:42rpx;
margin-top: 10rpx;
}
.pro-sku.inline-flex{
margin-top: 6rpx;
padding: 6rpx 15rpx;
background-color: #f5f5f5;
}
.inline-flex{
display: inline-flex
}
.pro-detail-wapper{
display:flex;flex:1;border-bottom:2rpx solid #ebeaea;padding: 28rpx 0 22rpx 0
}
.select-sku-wapper{
display: flex;
flex: 2;
flex-direction: row;
align-items: center;
}
.pro-name{
font-size: 26rpx;
/* 控制商品名称两行高度 */
line-height: 30rpx;
color: #333333;
}
.order-product:last-child .pro-detail-wapper{
border-bottom: none
}
.outTime-wapper{
background: #fafafa;
}
.outTime-pro-info{
padding: 20rpx;
}
.outTime-pro-text{
font-size: 22rpx;
color: #333333;
}
.clear-outTime-pro-btn{
display:inline-block;
float: right;
background:#e6e6e6;
padding:7rpx 20rpx;
border-radius:26rpx;
color:#898989;
font-size:21rpx;
}
.cart-pros1{
padding: 0 22rpx;
}
.fa-bg{
background: #fafafa;
}
.order-product.disabled {
background: none !important;
}
.out-time {
display:flex;
align-items: center;
justify-content: center;
margin-right:20rpx;
}
.out-time text {
display: inline-block;
background: #b5b5b5;
padding: 2rpx 8rpx;
border-radius: 2rpx;
color: #fff;
font-size: 20rpx;
}
.cart-bottom {
background: #ffffff;
position: fixed;
width: 100%;
height: 100rpx;
bottom: 0;
left: 0;
display: flex;
align-items: center;
box-shadow: 0 0 4px #dddddd;
z-index:10;
}
.cart-bottom icon {
margin: 0 20rpx;
}
.cart-bottom .bottom-price {
flex: 1;
font-size: 30rpx;
text-align:right;
margin-right:25rpx;
}
.cart-bottom .bottom-buttons {
display: flex;
}
.cart-bottom .bottom-buttons button {
border: 0;
border-radius: 0;
line-height: 100rpx;
color: #ffffff;
font-size: 32rpx;
padding: 0 40rpx;
}
.cart-bottom .bottom-buttons button::after {
border: 0;
border-radius: 0;
}
.cart-bottom .bottom-buttons button:nth-child(1) {
background: #39b99e;
}
.cart-bottom .bottom-buttons button:nth-child(2) {
background: #007d63;
}
.buy-now-btn{
display:inline-block;
padding:7rpx 20rpx;
margin-right: 30rpx;
border-radius:26rpx;
border: 2rpx solid #DC0E30;
font-size:26rpx;
color: #DC0E30;
}
.pro-out-tip-txt{
margin-top: 60rpx;
color:#666666;
font-size:24rpx;
}
.price-red{
color: #DC0E30;
}
\ No newline at end of file
......@@ -7,58 +7,6 @@ const wxService = require('../../../utils/wxService')
const utils = require('../../../utils/util')
const envInfo = require('../../../config/index').envInfo
const addGoods = utils._.debounce(function () {
let _scope = this
let storeInventoryQuantity = _scope.data.storeLimitNum
let storeName = _scope.data.goodInfo.storeName
const vaildate = this.validateStockNum()
if (!vaildate) {
return false
}
wx.showLoading({
title: '正在加载...',
mask: true
})
api.customer.post('i-shopCart/add', {
storeId: _scope.data.storeId,
storeInventoryQuantity,
cartType: 2,
storeName,
skuCode: _scope.data.barCode,
quantity: 1
}).then(res => {
}).finally(() => {
wx.hideLoading()
wx.showToast({
title: '加入购物车成功',
icon: 'success',
duration: 1500
})
this.getUserShopCartCount()
})
}, 300)
const buyNow = utils._.debounce(function () {
let _scope = this
if (!this.validateOrder(_scope.data.storeLimitNum, _scope.data.payOrderConfig)) {
return false
}
const vaildate = this.validateStockNum()
if (!vaildate) {
return false
}
// 传给商品提交页面的参数对象
pageParmas.setObject('_goodsDetail', {
goodsList: [{
quantity: 1,
skuCode: _scope.data.goodInfo.barCode
}],
storeId: _scope.data.storeId
})
wxService.router('../goodDetail/goodDetail').search({
from: 'goods_detail'
})
}, 300)
wxService.page({
data: {
goodInfo: {}, // 商品信息
......@@ -81,6 +29,7 @@ wxService.page({
isFirst: false,
carNum: 0,
scanCode: true,
cartNumber: 0,
showProGuarantee: false, //是否展示商品质保弹窗
scrollTips: '继续拖动,查看图文详情', // 滑动文案
......@@ -170,9 +119,8 @@ wxService.page({
toCar: function () {
// 传给购物车的参数
wxService
.router('/subPackage/express/pages/car/car')
.router('/omniChannel/pages/carts/carts')
.search({
// custNo: this.data.custNo
custNo: app.globalData.baseUserInfo.custNo
})
},
......@@ -193,7 +141,29 @@ wxService.page({
})
},
// 添加购物车
addGood: addGoods,
// addGood: addGoods,
addGood(){
let cartList = wx.getStorageSync('_cartList');
cartList = cartList ? cartList : [];
let isAdded = false;
cartList = cartList.map(item => {
if(item.barCode == this.data.goodInfo.barCode){
item.count = item.count?item.count:1;
item.count = item.count + 1;
isAdded = true;
}
return item;
});
if(!isAdded){
cartList.push(this.data.goodInfo);
}
wx.setStorageSync('_cartList', cartList);
this.setData({
cartNumber: this.data.cartNumber + 1
})
},
validateStockNum() {
let res = true
if (!this.data.goodInfo.stockNum) {
......@@ -231,7 +201,36 @@ wxService.page({
return pass
},
// 立即购买
buyNow: buyNow,
// buyNow: buyNow,
buyNow(){
let goodsInfo = {
goodsList: [{
quantity: 1,
skuCode: this.data.goodInfo.barCode
}],
storeId: this.data.storeId
};
wx.setStorageSync('goodsInfo',goodsInfo);
wx.navigateTo({
url : '/omniChannel/pages/submitOrder/submitOrder?from=pro_info'
});
},
initCartNumber(){
let cartList = wx.getStorageSync('_cartList')?wx.getStorageSync('_cartList'):[];
let cartNumber = 0;
cartList.forEach(item => {
item.count = item.count?item.count:1;
cartNumber = cartNumber + item.count;
})
this.setData({
cartNumber: cartNumber
})
},
// 页面初始化
init: function (params) {
let _scope = this
......@@ -239,6 +238,10 @@ wxService.page({
let skuId = params[1]
let storeLimitNum = params[2]
app.globalData.storeId = storeId
wx.setStorageSync('_storeId', storeId)
app.globalData.storeInventoryQuantity = storeLimitNum || 0
this.setData({
skuId
......@@ -246,6 +249,7 @@ wxService.page({
wx.showLoading({
title: '加载中'
})
this.initCartNumber();
// 获取下单配置
// api.orderConfig.get('i-offline-order/config', { orderConfigId: 1 }).
wxService.get(`i-offline-order/config`, { orderConfigId: 1 }).then(res => {
......@@ -259,10 +263,11 @@ wxService.page({
// }).
wxService.get(`i-goods/offline/detail`,{
wxService.get(`/hotwind-express/i-goods/offline/detail`,{
storeId: storeId,
skuCode: skuId
}).then(data => {
}).then(res => {
let data = res.data.data;
const imageUrls = (data.posterImgUrlList && data.posterImgUrlList.length) ? data.posterImgUrlList : ['https://hwimagecdn.ihotwind.cn/hotwind-mini/images/kuaididaojia/kuaidaojia_default_goods_big.png']// 默认图片;
const showDot = (data.posterImgUrlList && data.posterImgUrlList.length) ? true : false
......@@ -274,11 +279,11 @@ wxService.page({
})
}
app.globalData.storeName = data.storeName
wxService.get('/i-mini/offlineGoodsStatistical', {
skuCode: skuId,
storeId: storeId,
storeName: data.storeName
})
// wxService.get('/hotwind-express/i-mini/offlineGoodsStatistical', {
// skuCode: skuId,
// storeId: storeId,
// storeName: data.storeName
// })
wxService.nextTick(() => {
this.setData({
goodInfo: data,
......@@ -347,6 +352,7 @@ wxService.page({
}
},
onShow() {
this.initCartNumber();
let baseUserInfo = wx.getStorageSync('_baseUserInfo')
if (this.judgeDate()) {
this.setData({
......
......@@ -15,8 +15,7 @@
<view class="info">
<view class="price-info">
<text class="price">
<text class='rmb-unit'>¥</text>
{{goodInfo.price}}
<text class='rmb-unit'>¥</text>{{goodInfo.price}}
</text>
</view>
</view>
......@@ -84,11 +83,11 @@
<view class="tab-text">客服</view>
</button>
</form>
<block wx:if="{{!pageIsAuth}}">
<block wx:if="{{!currentHasUserInfo}}">
<view class='get-formId'>
<view class=''>
<button bindgetuserinfo="_getUserInfo" data-jflag="false" open-type='getUserInfo' class='getuserinfo_btn footer-icon' hover-class="btn-hover" style="background-color:transparent">
<text class='car-num' wx:if="{{carNum}}">{{carNum}}</text>
<text class='car-num' wx:if="{{cartNumber}}">{{cartNumber}}</text>
<image class="contact-share-img" src="https://hwimagecdn.ihotwind.cn/hotwind-mini/images/hotnewicon/bottom-shop-cart.png" />
<view class="add-car-text">购物车</view>
</button>
......@@ -98,7 +97,7 @@
<block wx:else>
<view class='get-formId' bindtap='toCar'>
<view class='footer-icon'>
<text class='car-num' wx:if="{{carNum}}">{{carNum}}</text>
<text class='car-num' wx:if="{{cartNumber}}">{{cartNumber}}</text>
<image class="contact-share-img" src="https://hwimagecdn.ihotwind.cn/hotwind-mini/images/hotnewicon/bottom-shop-cart.png" />
<view class="add-car-text">购物车</view>
</view>
......@@ -106,7 +105,7 @@
</block>
</view>
<view class="footer-buttons">
<block wx:if="{{!pageIsAuth}}">
<block wx:if="{{!currentHasUserInfo}}">
<button bindgetuserinfo="_getUserInfo" data-jflag="false" open-type='getUserInfo' class='getuserinfo_btn cart-button' hover-class="btn-hover">
<view class=''>加入购物车</view>
</button>
......@@ -114,7 +113,7 @@
<block wx:else>
<button class="cart-button get-formId--btn" bindtap='addGood'>加入购物车</button>
</block>
<block wx:if="{{!pageIsAuth}}">
<block wx:if="{{!currentHasUserInfo}}">
<button bindgetuserinfo="_getUserInfo" data-jflag="false" open-type='getUserInfo' class='getuserinfo_btn buy-button' hover-class="btn-hover">
<view class=''>立即购买</view>
</button>
......
{
"navigationBarTitleText": "订单提交 ",
"usingComponents": {
"goods-item": "../../components/goods/goodsItem",
"choose-address": "../../components/booking/chooseAddress/chooseAddress",
"coupon-popup": "../../components/couponPopup/couponPopup"
}
}
\ No newline at end of file
<wxs src="../../../wxs/utils.wxs" module="tools" />
<!-- <choose-address bind:selectAddrSuccess="selectAddress"></choose-address> -->
<view class="address-wrap">
<view class="address-list" bindtap="selectAddress">
<view class="address-info">
<view style="display:flex;align-items:center;">
<image class="defalut-add-img" src="{{addressInfo.type == 1 ? 'https://img3.bigaka.com/prd/3001/202003/20200309/3001f7a6186d-6882-422c-a77c-61b8291c091a.png' : 'https://img3.bigaka.com/prd/3001/202003/20200309/300129705d0a-bf5c-4b2f-aedd-0c3fc9f78ba1.png'}}" />
<text class="user-name">{{addressInfo.name}}</text>
<text class="phone-number">{{addressInfo.phone}}</text>
</view>
<view class="address-list-detail">
{{addressInfo.fullArea}} {{addressInfo.address}}
</view>
<view class="arrow-right-wrap">
<image class="arrow-right" src="/assets/imgs/7_1_0/arrow-right.png" />
</view>
</view>
</view>
</view>
<view class="address-special">
<text class="address-special-h">温馨提示:</text>
因疫情原因,湖北地区不接收除物资外的其他包裹,故湖北地区暂停发货,可选择其他可收货的地址,造成不便,敬请谅解!
</view>
<view class="order-products">
<view wx:for="{{goodInfo}}" wx:for-item="product" wx:for-index="k" wx:key="*this" class="order-product">
<image class="pro-image" mode="widthFix" src="{{product.listImgUrlList[0] ? product.listImgUrlList[0] : 'https://hwimagecdn.ihotwind.cn/hotwind-mini/images/kuaididaojia/kuaidaojia_default_goods_small.png'}}"></image>
<view class="pro-info">
<view class="pro-name">{{product.name}}{{product.girard}}</view>
<view class="pro-sku">
数量:{{product.count}}, {{product.colorName}},{{product.sizeName}}
</view>
<view class="pro-price">
<text class="price-red">¥{{product.price}}</text>
</view>
<view class="product-badge" bindtap="toggleBadgeText">
<view>
<image mode="widthFix" src="https://hwimagecdn.ihotwind.cn/hotwind-mini/images/official.png"></image>
<text wx:if="{{showBadge}}">官方正品保证</text>
</view>
<view>
<image mode="widthFix" src="https://hwimagecdn.ihotwind.cn/hotwind-mini/images/return-icon.png"></image>
<text wx:if="{{showBadge}}">30天无忧退换</text>
</view>
</view>
</view>
</view>
</view>
<!-- 优惠券 -->
<view class="order-items-wapper">
<view class="order-item coupon-order" bindtap="showCoupon">
<text class='font-tp'>优惠券</text>
<view class="order-item-right">
<text>{{selectedCoupon ? selectedCoupon : '请选择'}}</text>
</view>
</view>
<view class="order-item" wx:if="{{promotionName}}">
<text class='font-tp'>促销名称</text>
<view class="order-item-right">
<text>{{promotionName}}</text>
</view>
</view>
<view class="order-tab-line"></view>
<view class="order-item">
<text class='font-tp'>商品金额</text>
<text class="price-red ft">¥{{tools.numberFormat(goodsTotalPrice/100)}}</text>
</view>
<view class="order-item" wx:if="{{promotionInfo.price > 0}}">
<text class='font-tp'>优惠金额</text>
<text class="price-red ft">-¥{{promotionInfo.price}}</text>
</view>
</view>
<!-- 提示 -->
<view class='detail-tips'>
<image src='https://hwimagecdn.ihotwind.cn/hotwind-mini/images/tips.png' class='tips-png'></image>
<view class='tips-text'>下单后72小时内发货,仅支持线上退换货。</view>
</view>
<form bindsubmit="toPay" report-submit name='submitForm'>
<view class="order-bottom">
<text class="price-red">实付款:¥{{tools.numberFormat(totalPrice/100)}}</text>
<button type="primary" formType="submit">提交订单</button>
</view>
</form>
<view class="mask {{stock ? 'active' : 'hide'}}">
<view class='reason'>您购买的【{{goodInfo[0].name}}】,因库存不足,请返回重新下单,谢谢。</view>
<view class='maskBtn' bindtap='closeMask'>我知道了</view>
</view>
<view class="mask_load" wx:if="{{loadF}}"></view>
<coupon-popup show="{{showCouponPopup}}" popupTitle="{{showCouponTitle}}" showTip="{{showCouponTip}}" showCouponTipTitle="{{showCouponTipTitle}}" couponDatas="{{couponDatas}}" bind:showCouponDetail="showCouponDetail" />
\ No newline at end of file
var getImageUrl = function (imageUrls, size) {
var url = ''
if (imageUrls && imageUrls !== 'null') {
var urls = imageUrls
var len = urls.length
switch (size) {
case 'big':
url = urls[len - 1]
break
case 'normal':
url = urls[1]
break
case 'small':
url = urls[0]
break
}
}
return url || '/subPackage/express/pages/images/sign-logo.png'
}
var getImageUrlCar = function (obj) {
if (obj && obj.length) {
return getImageUrl(obj, 'small')
} else {
return 'https://hwimagecdn.ihotwind.cn/hotwind-mini/images/kuaididaojia/kuaidaojia_default_goods_small.png'
}
}
module.exports = {
getImageUrl: getImageUrl,
getImageUrlCar: getImageUrlCar
}
......@@ -73,7 +73,8 @@ wxService.page({
wx.showLoading({
title: '加载中'
})
wxService.get(`/sale/product/mallCategory/buyer/findCategoryTree`).then(res => {
// wxService.get(`/sale/product/mallCategory/buyer/findCategoryTree`).then(res => {
wxService.get(`/sale/product/mallCategory/findCategoryTree?state=c`).then(res => {
let { result, data } = res.data
if (result == 0) {
wx.hideLoading();
......
......@@ -28,11 +28,39 @@ page{
justify-content: space-between;
align-items: center;
}
.pro-new-price{
display: flex;
justify-content: space-between;
align-items: center;
position: relative;
}
.pro-new-price .price-text{
flex: 1;
display: flex;
align-items: center;
}
.pro-new-price .rg-share{
position: absolute;
width: 120rpx;
height: 60rpx;
right: -16rpx;
top: 0;
}
.pro-new-price .rg-share image{
width: 120rpx;
}
.dots{
position: absolute;
left: 0;
right: 0;
top: 700rpx;
top: 670rpx;
display: flex;
justify-content: center;
}
......@@ -53,13 +81,14 @@ page{
.product-detail-wrap{
padding: 0 16rpx 0 24rpx;
margin-top: 17rpx;
padding-bottom: 10rpx;
}
.price-icon{
display: inline-block;
width: 88rpx;
height: 30rpx;
border-radius: 3rpx;
background-color: rgba(203, 60, 60, 0.08);
background-color: var(--themeColorRgba01);
font-size: 13rpx;
color: #cb3c3c;
line-height: 30rpx;
......@@ -67,10 +96,20 @@ page{
vertical-align: middle;
}
.price{
font-size: 36rpx;
color: #333333;
vertical-align: middle;
color: #cb3c3c;
display: flex;
align-items: center;
}
.price text{
font-size: 22rpx;
}
.price label{
font-size: 40rpx;
font-weight: bold;
}
.cost-price{
text-decoration:line-through;
font-size: 24rpx;
......@@ -97,13 +136,16 @@ page{
}
.product-name{
color: #333333;
font-size: 40rpx;
font-size: 36rpx;
margin-top: 16rpx;
}
.product-desc{
color: #808080;
font-size: 28rpx;
margin-top: 11rpx;
display: flex;
align-items: center;
justify-content: space-between;
}
.member-price{
background-color: rgba(192, 154, 116, 0.07);
......@@ -243,7 +285,7 @@ page{
width: 240rpx;
}
.product-footer .footer-buttons button.btn-cart {
background: var(--themeColorRgba07);
background: var(--themeColorRgba07);
}
.product-footer .footer-buttons button.buy-button {
......@@ -272,4 +314,363 @@ page{
}
.scroll-tips-text {
margin: 20rpx 0;
}
.clear-box{
box-sizing: border-box;
-webkit-box-sizing: border-box;
}
.activity-list{
width: 100%;
height: auto;
background: #ffffff;
padding: 0 20rpx;
}
.activity-list .activity-list-item{
border-bottom: solid 1rpx #dddddd;
padding: 30rpx;
font-size: 24rpx;
color: #333333;
display: flex;
align-items: center;
}
.activity-list .activity-list-item:last-child{
border-bottom: none;
}
.activity-list .activity-list-item:active{
opacity: 0.7;
}
.activity-list .activity-list-item .right-ac-info{
flex: 1;
display: flex;
align-items: center;
justify-content: flex-end;
}
.activity-list .activity-list-item .right-ac-info .ac-coupon-item{
width: 160rpx;
height: auto;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
padding: 4rpx 10rpx;
color: #cb3c3c;
font-size: 20rpx;
border-radius: 4rpx;
margin-right: 15rpx;
background-image: url(https://img3.bigaka.com/prd/3001/202005/20200515/300127cf838a-ef78-4214-b473-9b85d463abbb.png);
background-size: contain;
background-repeat: no-repeat;
background-position: center;
font-weight: bold;
text-align: center;
}
.activity-list .activity-list-item .right-ac-info .ac-pro-item{
width: 160rpx;
height: auto;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
padding: 4rpx 10rpx;
color: #cb3c3c;
font-size: 20rpx;
border-radius: 4rpx;
margin-right: 15rpx;
background-image: url(https://img3.bigaka.com/prd/3001/202005/20200515/3001e0c1a67f-4ac7-46d8-8018-e4c4d78d9c90.png);
background-size: contain;
background-repeat: no-repeat;
background-position: center;
font-weight: bold;
text-align: center;
}
.activity-list .activity-list-item .right-ac-info .coupon-flex{
display: flex;
flex: 1;
align-items: center;
padding-left: 20rpx;
}
.activity-list .activity-list-item .right-ac-info image{
width: 16rpx;
height: 24rpx;
}
.activity-list .activity-list-item:last-child{
margin-bottom: 0;
}
.coupon-activity-modal{
position: fixed;
width: 100%;
height: 100%;
top: 0;
left: 0;
background: rgba(0, 0, 0, 0.5);
transform: translateY(100%);
opacity: 0;
transition: opacity 200ms;
z-index: 98;
/* transition: all 0.3s; */
}
.coupon-activity-modal.active {
opacity: 1;
transform: translateY(0);}
.coupon-activity-content.active {
opacity: 1;
transform: translateY(0);}
.coupon-activity-content{
position: fixed;
z-index: 99;
width: 100%;
bottom: 0;
left: 0;
height: 70vh;
background: #ffffff;
transform: translateY(100%);
transition: all 0.3s;
display: flex;
opacity: 0;
flex-direction: column;
}
.coupon-activity-content .coupon-header{
height: 8vh;
display: flex;
align-items: center;
justify-content: center;
font-size: 28rpx;
color: #333333;
}
.coupon-activity-content .content-body{
flex: 1;
height: 50vh;
box-sizing: border-box;
-webkit-box-sizing: border-box;
padding: 20rpx 30rpx;
overflow: hidden;
overflow-y: auto;
position: relative;
}
.coupon-activity-content .content-body .content-body-item{
width: 100%;
height: 12vh;
box-sizing: border-box;
-webkit-box-sizing: border-box;
background-position: center;
background-size: 100%;
padding: 20rpx 140rpx;
margin-bottom: 20rpx;
position: relative;
background-image: url(https://img3.bigaka.com/prd/3001/202005/20200515/3001532008bb-42f7-4bea-8611-b482f2137d2d.png);
}
.coupon-activity-content .content-body .content-body-item .coupon-price{
position: absolute;
top: 0;
left: 0;
height: 12vh;
width: 140rpx;
color: #cb3c3c;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
}
.coupon-activity-content .content-body .content-body-item .coupon-price .top-price{
font-size: 22rpx;
}
.coupon-activity-content .content-body .content-body-item .coupon-price .top-price text{
font-size: 22rpx;
}
.coupon-activity-content .content-body .content-body-item .coupon-price .top-price label{
font-size: 36rpx;
font-weight: bold;
}
.coupon-activity-content .content-body .content-body-item .right-btn{
position: absolute;
top: 0;
right: 0;
height: 12vh;
width: 140rpx;
display: flex;
justify-content: center;
align-items: center;
}
.coupon-activity-content .content-body .content-body-item .right-btn view{
width: 110rpx;
height: 40rpx;
background: var(--themecolor);
color: #ffffff;
font-size: 22rpx;
border-radius: 20rpx;
display: flex;
align-items: center;
justify-content: center;
}
.coupon-activity-content .content-body .content-body-item .right-btn view.user-has-got{
width: 110rpx;
height: 40rpx;
background: #cccccc;
color: #999999;
font-size: 22rpx;
border-radius: 20rpx;
display: flex;
align-items: center;
justify-content: center;
}
.coupon-activity-content .content-body .content-body-item .right-btn view:active{
opacity: 0.7;
}
.coupon-activity-content .content-body .content-body-item .coupon-detail{
display: flex;
flex-direction: column;
justify-content: space-around;
align-items: space-around;
font-size: 24rpx;
color: #cb3c3c;
height: 100%;
}
.coupon-activity-content .content-body .content-body-item .coupon-detail .coupon-t{
font-size: 32rpx;
font-weight: bold;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
.coupon-activity-content .content-footer{
flex: 0;
min-height: 12vh;
max-height: 12vh;
display: flex;
align-items: center;
justify-content: center;
}
.coupon-activity-content .content-footer .footer-btn{
width: 70vw;
height: 6vh;
background: #D8D8D8;
color: #000000;
display: flex;
align-items: center;
justify-content: center;
border-radius: 3vh;
}
.coupon-activity-content .content-footer .footer-btn:active{
opacity: 0.7;
}
.promition-item{
width: 100%;
height: 6vh;
box-sizing: border-box;
-webkit-box-sizing: border-box;
margin-bottom: 20rpx;
position: relative;
display: flex;
align-items: center;
justify-content: space-between;
}
.promition-item:active{
opacity: 0.7;
}
.promition-item image{
width: 16rpx;
height: 24rpx;
}
.promition-item .promotions-name{
display: flex;
align-items: center;
justify-content: flex-start;
}
.promition-item .promotions-name .pro-title{
font-size: 28rpx;
width: 440rpx;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
.promition-item .promotions-name .promotion-type{
font-size: 22rpx;
width: 120rpx;
height: 40rpx;
background-position: center;
background-size: 100%;
display: flex;
align-items: center;
justify-content: center;
color: #cb3c3c;
margin-right: 10rpx;
background-image: url(https://img3.bigaka.com/prd/3001/202005/20200515/30015eb5843a-88a9-4ba1-86ad-74b26c15591a.png);
}
.promotion-tags{
position: absolute;
width: 100%;
height: auto;
left: 0;
bottom: 0;
}
.promotion-tags .promotion-item-img{
width: 100%;
position: relative;
display: flex;
align-items: flex-end;
}
.promotion-tags .promotion-item-img .promotion-price{
position: absolute;
left: 0rpx;
bottom: 0rpx;
color: #ffffff;
font-size: 28rpx;
width: 280rpx;
height: 100%;
box-sizing: border-box;
-webkit-box-sizing: border-box;
padding-bottom: 15rpx;
display: flex;
align-items: flex-end;
justify-content: center;
}
.promotion-tags .promotion-item-img .promotion-price label{
font-size: 48rpx;
font-weight: bold;
}
.promotion-tags .promotion-item-img image{
width: 100%;
}
\ No newline at end of file
......@@ -9,11 +9,23 @@
"postcss": true,
"minified": true,
"newFeature": true,
"autoAudits": false
"coverView": true,
"autoAudits": false,
"showShadowRootInWxmlPanel": true,
"scopeDataCheck": false,
"checkInvalidKey": true,
"checkSiteMap": true,
"uploadWithSourceMap": true,
"babelSetting": {
"ignore": [],
"disablePlugins": [],
"outputPath": ""
},
"useCompilerModule": true
},
"compileType": "miniprogram",
"libVersion": "2.8.2",
"appid": "wxe6d270a3e399ade9",
"appid": "wxac09792264c49b5c",
"projectname": "7.0-%E7%83%AD%E9%A3%8E%E5%BE%AE%E5%95%86%E5%9F%8E",
"debugOptions": {
"hidedInDevtools": []
......@@ -694,6 +706,27 @@
"pathName": "omniChannel/pages/productDetail/productDetail",
"query": "scene=11002054%3aH14W970801235%3a3",
"scene": null
},
{
"id": -1,
"name": "全渠道-购物车",
"pathName": "omniChannel/pages/carts/carts",
"query": "",
"scene": null
},
{
"id": -1,
"name": "全渠道-提交订单",
"pathName": "omniChannel/pages/submitOrder/submitOrder",
"query": "",
"scene": null
},
{
"id": -1,
"name": "签到",
"pathName": "subPackageMarketing/page/pages/sign/sign",
"query": "",
"scene": null
}
]
}
......
......@@ -144,19 +144,43 @@ wxService.page({
let pageNo = this.data.pageNo,
pageSize = this.data.pageSize;
// wxService.post(`/sale/product/buyer/listPageByCategoryId?pageNo=${pageNo}&pageSize=${pageSize}`, this.data.form).then(res => {
wxService.post(`/sale/product/buyer/findCategoryTreeIdByProductList?pageNo=${pageNo}&pageSize=${pageSize}&id=${this.data.form.mallCategoryId}`).then(res => {
this.data.form.state = 2;
wxService.post(`/sale/product/mallCategory/listPageProductByMallCategoryIdAndItsSons?pageNo=${pageNo}&pageSize=${pageSize}`, this.data.form).then(res => {
const { result, data } = res.data
if (result == 0 && data.content) {
wx.hideLoading()
this.data.proData = this.data.pageNo == 1 ? [...data.content] : [...this.data.proData, ...data.content];
this.data.proData.forEach(item => {
//营销标签类型 1固定样式 2左下角显示商品当前金额 3左下角显示指定数额
item.indexUrl = item.indexUrl ? item.indexUrl : defaultImg;
//处理商品身上的营销标签数据
item.hasPromotionTag = item.markTagInfo ? true : false;
let tagPrice = item.minSalePrice;
if(item.hasPromotionTag){
item.tagPic = item.markTagInfo.tagPicUrl;
if(item.markTagInfo.tagType == 2){
tagPrice = item.minSalePrice;
}
else{
tagPrice = item.markTagInfo.assignPrice;
}
item.tagType = item.markTagInfo.tagType;
}
//判断价格是否大于1000了
if(tagPrice/100 > 1000){
tagPrice = parseFloat(tagPrice/10/10).toFixed(1);
}
else{
tagPrice = parseFloat(tagPrice/10/10).toFixed(2);
}
item.tagPrice = tagPrice;
});
this.setData({
proData: this.data.proData,
totalPages: data.totalPages,
totalElements: data.totalElements
})
});
}
if (refresh) {
......
......@@ -13,8 +13,8 @@
<image mode="widthFix" src="{{!proStyle ? '/assets/imgs/7_1_0/category-style-01.png' : '/assets/imgs/7_1_0/category-style-02.png'}}" />
</view>
</view>
<product-list-style-one image-data="{{proData}}" wx:if="{{!proStyle}}" />
<product-list-style-one image-data="{{proData}}" wx:if="{{!proStyle}}" />
<product-list-style-two image-data="{{proData}}" wx:if="{{proStyle}}" />
<view class="empty" wx:if="{{proData.length < 1}}">
......
const wxService = require('../../../../utils/wxService')
const utils = require('../../../../utils/util')
const envInfo = require('../../../../config/index').envInfo
const app = getApp();
const PTOMOTION_TYPE = {1:'满减满折',2:'一口价',3:'限时折扣',4:'限时调价',5:'限时抢购'}
wxService.page({
/**
* 页面的初始数据
*/
data: {
activityId : '',
type : '',
goodsList : [],
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
wx.hideShareMenu();
this.data.activityId = options.id ;
this.data.type = options.type;
wx.setNavigationBarTitle({
title: PTOMOTION_TYPE[this.data.type],
});
if(this.data.type == 2){
this.getFixedActivityInfo();
}
},
//跳转到商品详情
onTapToGoodsDetail(e){
let item = e.currentTarget.dataset.item;
let productId = item.productId;
wx.navigateTo({
url: '/pages/productDetail/productDetail?id=' + productId,
});
},
//获取一口价详情
getFixedActivityInfo(){
wxService.post(`/marketing/itemPriceActivity/getDetail?id=${this.data.activityId}`).then(res => {
if(res){
let data = res.data.data ? res.data.data : null;
if(data){
let iteamPrice = data.iteamPrice;
let productInfos = data.productInfos;
let productIds = productInfos.map(item => {
return item.productId;
});
let proIds = new Set(productIds);
this.getProductsByIds([...proIds],productInfos,iteamPrice);
}
}
})
},
//根据商品Ids获取商品列表
getProductsByIds(ids,productInfos,iteamPrice){
wxService.post(`/sale/product/listPage?pageNo=1&pageSize=10000`,{
productIds : ids,
showListUrls : true,
}).then(res => {
if(res){
let list = res.data.data.content ? res.data.data.content : [];
this.data.goodsList = list;
list.forEach(item => {
item.indexUrl = utils.getFirstImgUrl(item.listUrls);
item.price = parseFloat(item.minSalePrice/10/10).toFixed(2);
});
this.setData({
goodsList : this.data.goodsList
});
}
});
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
},
})
\ No newline at end of file
{
"navigationBarTitleText": "",
"usingComponents": {}
}
\ No newline at end of file
<!--subPackageA/page/pages/promotionProducts/promotionProducts.wxml-->
<view class='main-container'>
<view>
<!-- list -->
<view class='goods-list' wx:if="{{goodsList.length > 0}}">
<view class='goods-item'
wx:for="{{goodsList}}"
wx:for-item="item"
wx:for-index="idx"
data-item="{{item}}"
bindtap='onTapToGoodsDetail'
wx:key="*this">
<image class='goods-lf-icon' src='{{item.indexUrl}}' mode='aspectFit'></image>
<view class='goods-rg-info'>
<view class='goods-title'>{{item.productName}}</view>
<view class='goods-second-title'>{{item.subtitle}}</view>
<view class='goods-price'>
<view class='price'>
<view class='plus'>
<!-- <image src='/assets/imgs/point.png' mode='aspectFit'></image> -->
¥<text class='original-price'>{{item.price}}</text>
</view>
<!-- <view class='original-price'>¥126.08</view> -->
</view>
</view>
</view>
</view>
</view>
</view>
<view class='empty' wx:if="{{goodsList.length == 0}}">活动中未配置商品或商品已下架~</view>
</view>
/* subPackageA/page/pages/promotionProducts/promotionProducts.wxss */
page{
background: #f2f2f2;
box-sizing: border-box;
-webkit-box-sizing: border-box;
font-size: 28rpx;
color: #333333;
}
view{
box-sizing: border-box;
-webkit-box-sizing: border-box;
}
/* 商品信息布局 */
/* 主要布局 */
.main-container{
width: 100%;
height: auto;
padding: 0 30rpx;
background: #ffffff;
margin-top: 10rpx;
}
.mg-b-40{
margin-bottom: 40rpx;
}
/* 爆款 */
.goods-list{
width: 100%;
height: auto;
}
.goods-list .goods-item{
background: #ffffff;
display: flex;
padding: 20rpx 0;
border-bottom: solid 1rpx #dddddd;
}
.goods-list .goods-item:last-child{
border-bottom: none;
}
.goods-list .goods-item .goods-lf-icon{
flex: 0;
min-width: 180rpx;
max-width: 180rpx;
height: 180rpx;
border-top-left-radius: 10rpx;
border-bottom-left-radius: 10rpx;
display: flex;
align-items: center;
}
.goods-list .goods-item .goods-rg-info{
flex: 1;
padding: 15rpx 20rpx;
font-size: 24rpx;
display: flex;
flex-direction: column;
justify-content: space-around;
}
.goods-list .goods-item .goods-rg-info .goods-title{
color: #333333;
font-size: 28rpx;
text-overflow: -o-ellipsis-lastline;
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 2;
line-clamp: 2;
-webkit-box-orient: vertical;
font-weight: bold;
margin-bottom: 8rpx;
}
.goods-list .goods-item .goods-rg-info .goods-second-title{
font-size: 22rpx;
color: #999999;
margin-bottom: 20rpx;
}
.goods-list .goods-item .goods-rg-info .goods-price{
display: flex;
align-items: flex-end;
}
.goods-list .goods-item .goods-rg-info .goods-price .price{
flex: 1;
}
.goods-list .goods-item .goods-rg-info .goods-price .price .original-price{
font-weight: bold;
font-size: 32rpx;
}
.goods-list .goods-item .goods-rg-info .goods-price .price .plus{
display: flex;
align-items: center;
color: #ff3333;
margin-bottom: 8rpx;
font-size: 22rpx;
}
.goods-list .goods-item .goods-rg-info .goods-price .price .plus image{
width: 28rpx;
height: 28rpx;
margin-right: 8rpx;
}
.goods-list .goods-item .goods-rg-info .goods-share{
flex: 0;
min-width: 220rpx;
max-width: 220rpx;
height: 52rpx;
border: solid 2rpx #ff3333;
border-radius: 26rpx;
display: flex;
font-size: 22rpx;
}
.goods-list .goods-item .goods-rg-info .goods-share .send-coupon{
flex: 0;
min-width: 50%;
max-width: 50%;
height: 100%;
display: flex;
justify-content: center;
align-items: center;
}
.goods-list .goods-item .goods-rg-info .goods-share .send-coupon:first-child{
color: #FA6400;
}
.goods-list .goods-item .goods-rg-info .goods-share .send-coupon:first-child:active{
opacity: 0.7;
}
.goods-list .goods-item .goods-rg-info .goods-share .send-coupon:last-child:active{
opacity: 0.7;
}
.goods-list .goods-item .goods-rg-info .goods-share .send-coupon:last-child{
color: #ffffff;
background: #ff3333;
border-top-right-radius: 26rpx;
border-bottom-right-radius: 26rpx;
}
\ No newline at end of file
// subPackageMarketing/page/pages/sign/sign.js
const wxService = require('../../../../utils/wxService')
const utils = require('../../../../utils/util');
wxService.page({
/**
* 页面的初始数据
*/
data: {
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
wx.hideShareMenu();
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
}
})
\ No newline at end of file
{
"usingComponents": {}
}
\ No newline at end of file
<!--subPackageMarketing/page/pages/sign/sign.wxml-->
<view class="main-page">
<web-view src="{{signUrl}}"></web-view>
</view>
\ No newline at end of file
/* subPackageMarketing/page/pages/sign/sign.wxss */
\ No newline at end of file
......@@ -400,7 +400,8 @@ function getSum(preValue,curValue,index, array) {
function _getUserInfo(ev,authType) {
const userInfo = ev.detail || ev;
if (ev && ev.detail.errMsg.indexOf('fail') > -1){
console.log(ev.detail)
if (userInfo.errMsg.indexOf('fail') > -1){
wx.hideLoading();
return Promise.reject({
state : -1,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment