Commit ed7b7e34 by 李伟康

增加商品详情

1 parent 0216500b
Showing 44 changed files with 2147 additions and 154 deletions
......@@ -63,4 +63,11 @@ module.exports = {
...data
})
},
/**获取订单状态数量 */
getOrderNumberList(data) {
return api.post({
method: 'scrm.api.shopmall.weapp.order.statis',
...data
})
}
}
\ No newline at end of file
......@@ -45,8 +45,8 @@ module.exports = {
})
},
/**购物车结算 */
settlementShoppingcart(data) {
/**购物车结算 */
settlementShoppingcart(data) {
return api.post({
method: `scrm.api.shopmall.weapp.shoppingcart.settlement`,
...data
......@@ -81,4 +81,37 @@ module.exports = {
orderCode
})
},
/**活动详情 */
getActivityDetail(id) {
return api.fetch('scrm.api.shopmall.weapp.activity.detail', {
id
})
},
/** 根据商品ID获取商品 */
getGoodsDetail(id) {
return api.fetch('scrm.api.shopmall.weapp.goods.getById', {
id,
viewAmount: true
})
},
/** 获取商品关联优惠券列表 */
getGoodscouponList(data) {
return api.fetch('scrm.api.shopmall.weapp.goods.user.coupons.get', data)
},
/** 领取商品详情优惠券 */
getCoupon(data) {
return api.fetch('scrm.api.coupon.customer.receive', data)
},
/**根据规格值组合获取规格组合库存及零售价 */
getGoodsSpecificationExtra(data) {
return api.post({
method: `scrm.api.shopmall.weapp.goods.getGoodsSpecificationExtra`,
...data
})
},
}
\ No newline at end of file
......@@ -65,7 +65,9 @@
"pages": [
"pages/index/index",
"pages/shoppingCart/shoppingCart",
"pages/pay/pay"
"pages/pay/pay",
"pages/detail/detail",
"pages/search/search"
]
},
{
......@@ -92,10 +94,11 @@
}
],
"usingComponents": {
"calendar": "/components/Calendar/Calendar",
"navigation-bar": "/components/NavigationBar/NavigationBar",
"glsx-image": "/components/image/index",
"authorize": "/components/Authorize/Authorize"
"authorize": "/components/Authorize/Authorize",
"popup": "/components/Popup/Popup",
"goods-action": "/components/GoodsAction/GoodsAction"
},
"style": "v2",
"resolveAlias": {
......
// components/GoodsAction/GoodsAction.js
Component({
/**
* 组件的属性列表
*/
properties: {
hideShop: Boolean,
payDisabled: Boolean,
custom: Boolean,
stock: Boolean,
buyFlag: Boolean,
platformShop:Boolean
},
/**
* 组件的初始数据
*/
data: {},
/**
* 组件的方法列表
*/
methods: {
getViewInfo() {
wx.p.wxApi.getViewInfo(
'.goods-action-box',
res => {
this.triggerEvent('ready', res.height)
},
this
)
},
jump(e) {
let { url } = e.currentTarget.dataset
if (url == 'home') wx.p.router.goHome()
else wx.p.router.go('/packageMall/pages/shoppingCart/shoppingCart')
},
click(e) {
let { event } = e.currentTarget.dataset
this.triggerEvent('click', event)
}
},
lifetimes: {
attached() {
this.getViewInfo()
}
}
})
{
"component": true,
"usingComponents": {}
}
\ No newline at end of file
<view class="goods-action-box isFullSucreen">
<block wx:if="{{custom}}">
<slot></slot>
</block>
<block wx:else>
<view class="goods-action">
<view class="navigation-box">
<view class="item" bindtap="jump" data-url="home">
<view class="sprite-icon">
<glsx-image src="mall/goods-home.png"></glsx-image>
</view>
首页
</view>
<view class="item" wx:if="{{!hideShop}}" bindtap="jump">
<view class="sprite-icon" >
<glsx-image src="mall/goods-shopping.png"></glsx-image>
</view>
购物车
</view>
</view>
<view class="btn-box {{hideShop}}">
<view class="btn join text-center {{stock?'disabled':''}}" bindtap="click" data-event="join">
加入购物车
</view>
<view class="btn pay text-center {{payDisabled && hideShop?'disabled':''}} {{stock?'disabled':''}} {{buyFlag?'disabled':''}}" bindtap="click" data-event="pay">
立即购买
</view>
</view>
</view>
</block>
</view>
\ No newline at end of file
/* components/GoodsAction/GoodsAction.wxss */
.text-center {
display: flex;
align-items: center;
justify-content: center;
}
.goods-action-box {
position: fixed;
bottom: 0;
left: 0;
width: 100%;
background-color: #fff;
z-index: 9;
animation: show-goods-action .55s forwards;
}
@keyframes show-goods-action{
0%{
bottom: -100%;
}
100%{
bottom: 0;
}
}
.goods-action {
padding: 10rpx var(--margin);
display: flex;
align-items: center;
box-sizing: border-box;
height: 100rpx;
}
.isFullSucreen {
padding-bottom: constant(safe-area-inset-bottom) !important;
padding-bottom: env(safe-area-inset-bottom) !important;
}
.navigation-box {
display: flex;
align-items: center;
font-size: 20rpx;
justify-content: space-between;
}
.navigation-box .item{
display: flex;
flex-direction: column;
align-items: center;
margin:0 14rpx;
}
.navigation-box .sprite-icon{
width: 40rpx;
height: 40rpx;
}
.btn-box {
display: flex;
align-items: center;
margin-left: auto;
border-radius: var(--borderRadius);
overflow: hidden;
}
.btn-box .btn {
width: 258rpx;
height: 80rpx;
color: #fff;
font-size: 28rpx;
}
.btn-box .pay {
background-color: var(--btnColor);
}
.btn-box .join {
background-color: #FDC23E;
}
.btn-box.true .join{
display: none;
}
.btn-box.true .btn{
width: 588rpx;
background-color: var(--themeColor);
}
.btn-box .pay.disabled{
background-color: #B1B1B3 !important;
}
.btn-box .disabled{
background-color: #B1B1B3 !important;
}
\ No newline at end of file
// tabWorkOrder/pages/createOrder/createOrderComponents/Popup/Popup.js
import {
componentsMixin
} from '../../mixins/index'
Component({
behaviors: [componentsMixin],
/**
* 组件的属性列表
*/
......@@ -64,13 +60,5 @@ Component({
confirm() {
this.triggerEvent('confirm')
}
},
attached() {
const {
isTab
} = wx.p.router.getRouterList().find(item => item.url === `/${wx.p.router.getPageInstance().route}`)
this.setData({
isTab
})
},
}
})
\ No newline at end of file
......@@ -4,14 +4,14 @@
<block wx:if="{{title}}">
<view class="popup-title text-center">{{title}}</view>
</block>
<view class="popup-slot {{isTab && !hideTab? '': title?'isFullSucreen':'isFullSucreen-notitle'}}">
<view class="popup-slot {{title?'':'notitle' }}">
<slot></slot>
</view>
<view class="popup-footer {{isTab && !hideTab?'':'isFullSucreen'}}" wx:if="{{only}}">
<view class="popup-footer isFullSucreen" wx:if="{{only}}">
<view class="cancel btn text-center" bindtap="hidePopup">取消</view>
<view class="confirm btn text-center" bindtap="confirm">确认</view>
</view>
<view class="popup-footer {{isTab && !hideTabb?'':'isFullSucreen'}}" wx:else>
<view class="popup-footer isFullSucreen" wx:else>
<view class="confirm doubtn text-center" bindtap="confirm">确认</view>
</view>
</view>
......
/* tabWorkOrder/pages/createOrder/createOrderComponents/Popup/Popup.wxss */
@import "/assets/style/common.wxss";
.popup {
position: fixed;
top: 0;
......@@ -45,15 +46,14 @@
}
.popup-slot {
height: calc(100% - 200rpx);
height: calc(100% - 200rpx - var(--constantSafeAreaInsetBottom));
height: calc(100% - 200rpx - var(--envSafeAreaInsetBottom));
}
.popup-slot.isFullSucreen {
height: calc(100% - 258rpx);
}
.popup-slot.isFullSucreen-notitle {
height: calc(100% - 158rpx);
.popup-slot.notitle {
height: calc(100% - 158rpx - var(--constantSafeAreaInsetBottom));
height: calc(100% - 158rpx - var(--envSafeAreaInsetBottom));
}
.popup-footer {
......@@ -66,10 +66,6 @@
z-index: 2;
}
.popup-footer.isFullSucreen {
padding-bottom: constant(safe-area-inset-bottom) !important;
padding-bottom: env(safe-area-inset-bottom) !important;
}
.popup-footer .btn {
width: 330rpx;
......
Component({
/**
* 组件的属性列表
*/
properties: {
show: {
type: Boolean,
observer: function (n) {
if (n) setTimeout(() => {}, 0.5 * 1000)
}
},
only: {
type: Boolean,
value: true
},
couponData: {
type: Object,
observer(n) {
if (n.length)
this.setData({
noData: true
})
return n
}
},
order: {
type: Number
},
defaultData: String
},
observers: {
couponData: function (newVal) {
return newVal
}
},
/**
* 组件的初始数据
*/
data: {
noData: false,
IMGURL: wx.$imgUrl
},
/**
* 组件的方法列表
*/
methods: {
getCoupon(e) {
let {merchantId} = wx.p.storage.get('merchant_info')
let { item } = e.currentTarget.dataset
wx.p.wxApi.showLoading('领取中...')
wx.p.api.shopmallApi
.getCoupon({
couponIdList: [item.couponId],
receiveWay: 1,
receiveSource: 3,
merchantId: Number(merchantId)
})
.then(({ code, data, message }) => {
console.log(data)
wx.hideLoading()
if (code == '0') {
wx.showToast({
title: '领取成功',
icon: 'none'
})
let thisPage = wx.p.router.getPageInstance()
if (thisPage.getGoodscouponList) thisPage.getGoodscouponList()
}
})
},
// 更换优惠券
selectCoupon(e) {
let { index } = e.currentTarget.dataset
for (let i = 0; i < this.data.couponData.length; i++) {
if (index == i) {
this.data.couponData[i].isChecked = !this.data.couponData[i].isChecked
} else {
this.data.couponData[i].isChecked = false
}
this.setData({
couponData: this.data.couponData
})
}
},
//确认
confirm() {
this.triggerEvent('click', this.data.couponData)
this.setData({
couponData: this.data.couponData
})
}
},
lifetimes: {
attached() {}
}
})
{
"component": true,
"usingComponents": {}
}
\ No newline at end of file
<popup title="优惠详情" show="{{show}}" only="{{only}}" bindconfirm="confirm" height="75%">
<view class="coupon-box">
<view class="box">
<scroll-view style="height:100%;" scroll-y>
<block wx:if="{{noData}}">
<view class="coupon-wrap" wx:for="{{couponData}}" wx:key="index">
<view class="left_icon_box">
<image webp wx:if="{{true}}" class="left_bg" src="{{IMGURL}}coupons/coupons_active.png?v={{img_version}}" />
<image webp wx:else class="left_bg" src="{{IMGURL}}coupons/coupons.png?v={{img_version}}" />
<view class="left_text_one left_text_two">
<text class="price_icon">¥</text>
<text>{{(item.denomination)/100}}</text>
</view>
<view class="left_text_five left_text_three" wx:if="{{item.full}}">满{{(item.full)/100}}可用</view>
</view>
<view class="main_box">
<view class="title_text">{{item.couponName}}</view>
<view class="h4_text" wx:if="{{item.useBarriers == 1}}">无限制</view>
<view class="h4_text" wx:if="{{item.useBarriers == 2}}">满减</view>
<!-- 未领取,effectiveType == 1,就显示effectiveDays有效,effectiveType == 2 显示时间段,effectiveType == 3 无限制 -->
<view class="h4_text drive" wx:if="{{item.couponStatus == 0&&item.effectiveType == 1}}">领取后{{item.effectiveDays}}天内有效</view>
<view class="h4_text drive" wx:if="{{item.couponStatus == 0&&item.effectiveType == 2}}">{{item.effectiveStartTime}}-{{item.effectiveEndTime}}</view>
<view class="h4_text drive" wx:if="{{item.couponStatus == 0&&item.effectiveType == 3}}">无期限</view>
<!-- 已领取,effectiveType == 1 或者2,都显示时间段,effectiveType == 3 无限制 -->
<view class="h4_text drive" wx:if="{{item.couponStatus == 1&&item.effectiveType == 1||item.couponStatus == 1&&item.effectiveType == 2 }}">{{item.effectiveStartTime}}-{{item.effectiveEndTime}}</view>
<view class="h4_text drive" wx:if="{{item.couponStatus == 1&&item.effectiveType == 3}}">无期限</view>
</view>
<block wx:if="{{order == 0}}">
<view class="box_btn box_btn_color" bindtap="toDetail" wx:if="{{item.couponStatus == 0&&item.residueAmount >0}}" data-item="{{item}}" bindtap="getCoupon">领取</view>
<view class="box_btn_color_been_gray " bind:tap="toDetail" wx:elif="{{item.couponStatus != 1&&item.residueAmount ==0}}">已抢光</view>
<view class="box_btn_color_been" bind:tap="toDetail" wx:elif="{{item.couponStatus == 1}}">已领取</view>
<view class="already" wx:if="{{item.couponStatus == 1}}">
<image webp src="{{IMGURL}}coupons/been.png?v={{img_version}}" />
</view>
</block>
<block wx:else>
<view class="circle-selected" data-item="{{item}}" data-index="{{index}}" wx:if="{{item.isChecked}}" bindtap="selectCoupon">
<image webp src="{{IMGURL}}coupons/select.png?v={{img_version}}" />
</view>
<view class="noSelect" data-item="{{item}}" data-index="{{index}}" wx:if="{{!item.isChecked}}" bindtap="selectCoupon"></view>
</block>
</view>
</block>
<!-- <block>
<view class="dissatisfy">以下不满足使用条件</view>
<view class="coupon-wrap gray" >
<view class="left_icon_box">
<image webp class="left_bg" src="../../packageMall/images/coupons.png" />
<view class="left_text_one left_text_two">
<text class="price_icon">¥</text>
<text>50</text>
</view>
<view class="left_text_five left_text_three">满99可用</view>
</view>
<view class="main_box">
<view class="title_text">优惠券名称</view>
<view class="h4_text">满300减50,仅限会场商品</view>
<view class="h4_text drive">无限期</view>
</view>
<view class="circle-gray"></view>
<view class="reason">不可用原因:仅可购买XXX商品A</view>
</view>
</block> -->
</scroll-view>
</view>
</view>
<view wx:if="{{!noData}}" class="no_data">
<image webp class="nodata_bg" src="{{IMGURL}}coupons/no_card_bg.png?v={{img_version}}" />
<view class="nodata_text">暂无优惠券</view>
</view>
</popup>
\ No newline at end of file
/* components/CarBrands/CarBrands.wxss */
.coupon-wrap {
width: 686rpx;
height: 196rpx;
background: rgba(252, 91, 50, 0.05);
border-radius: 8rpx;
box-sizing: border-box;
padding: 20rpx;
display: flex;
align-items: center;
position: relative;
margin-top: 24rpx;
}
.gray {
width: 686rpx;
height: 196rpx;
background: rgba(201, 202, 204, 0.1) !important;
border-radius: 8rpx;
box-sizing: border-box;
padding: 20rpx;
display: flex;
align-items: center;
position: relative;
margin-top: 24rpx;
}
.left_icon_box {
width: 156rpx;
height: 156rpx;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
position: relative;
}
.left_bg {
position: absolute;
left: 0;
right: 0;
top: 0;
bottom: 0;
width: 156rpx;
height: 156rpx;
z-index: 1;
}
.left_text_one {
font-size: 36rpx;
font-weight: 600;
color: #FFFFFF;
z-index: 2;
}
.left_text_two {
display: flex;
align-items: flex-end;
}
.left_text_four {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
}
.left_text_three {
font-size: 28rpx;
margin-top: 6rpx;
width:156rpx;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
text-align: center;
}
.left_text_five {
font-size: 28rpx;
color: #FFFFFF;
z-index: 2;
}
.anText {
font-size: 70rpx;
/* color: rgba(white, white, white, 0.45); */
font-weight: 600;
color: #FFF;
opacity: 0.45;
}
.price_icon {
font-size: 20rpx;
margin-right: 4rpx;
margin-bottom: 7rpx;
}
.main_box {
height: 156rpx;
box-sizing: border-box;
padding: 4rpx 0 4rpx 20rpx;
}
.box_btn {
position: absolute;
right: 20rpx;
top: 50%;
transform: translate(0, -50%);
width: 132rpx;
height: 50rpx;
background: #B1B1B3;
border-radius: 22rpx;
color: #FFF;
font-size: 20rpx;
text-align: center;
line-height: 50rpx;
}
.box_btn_color {
background: var(--btnColor);
color: #FFFFFF;
}
.box_btn_color_grey {
background: #B1B1B3;
}
.title_text {
color: #282829;
font-weight: 600;
color: #282829;
font-size: 28rpx;
width: 420rpx;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
.box_btn_color_been {
font-size: 28rpx;
font-weight: 400;
color: var(--btnColor);
line-height: 40rpx;
white-space: nowrap;
position: absolute;
right: 20rpx;
top: 50%;
transform: translate(0, -50%);
}
.h4_text {
font-weight: 400;
color: #B1B1B3;
font-size: 24rpx;
}
.drive {
margin-top: 38rpx;
}
.y-center {
display: flex;
align-items: center;
}
.no_data {
padding-top: 48rpx;
display: flex;
flex-direction: column;
align-items: center;
}
.nodata_bg {
width: 320rpx;
height: 320rpx;
}
.nodata_text {
color: #B1B1B3;
font-size: 28rpx;
line-height: 44rpx;
margin-top: 8rpx;
}
.already {
width: 75rpx;
height: 74rpx;
position: absolute;
bottom: 0;
right: 0;
z-index: 99;
}
.dissatisfy {
font-size: 28rpx;
font-weight: 500;
color: #282829;
line-height: 44rpx;
margin-top: 32rpx;
}
.circle-gray {
width: 40rpx;
height: 40rpx;
background: #E3E3E6;
border: 2rpx solid rgba(177, 177, 179, 1);
border-radius: 50%;
}
.reason {
width: 686rpx;
height: 60rpx;
background: rgba(253, 194, 62, 0.06);
font-size: 24rpx;
font-weight: 400;
color: #F13C3D;
line-height: 60rpx;
padding: 0 20rpx;
box-sizing: border-box;
position: absolute;
bottom: -60rpx;
left: 0;
}
.reason::before {
content: '!';
width: 28rpx;
height: 28rpx;
border: 1rpx solid #F13C3D;
color: #F13C3D;
box-sizing: border-box;
border-radius: 50%;
display: inline-block;
text-align: center;
line-height: 24rpx;
margin-right: 12rpx;
}
.circle-selected {
width: 40rpx;
height: 40rpx;
}
.noSelect {
width: 40rpx;
height: 40rpx;
background: #ffffff;
border: 2rpx solid rgba(177, 177, 179, 1);
border-radius: 50%;
}
.box{
height:55vh;
overflow-y: scroll;
padding-bottom: 50rpx;
}
.box_btn_color_been_gray{
font-size: 28rpx;
font-weight: 400;
color: #B1B1B3;
line-height: 40rpx;
white-space: nowrap;
position: absolute;
right: 20rpx;
top: 50%;
transform: translate(0, -50%);
}
\ No newline at end of file
// components/Sku/Sku.js
import { centsToyuan } from '~/utils/format'
Component({
/**
* 组件的属性列表
*/
properties: {
show: {
type: Boolean,
observer(n) {
if (n)
this.setData({
close: false
})
}
},
showName: String,
skuData: {
type: Object,
observer(n) {
this.setDefaultSku(n)
}
},
isActivity: Boolean
},
/**
* 组件的初始数据
*/
data: {
goodsNumber: 1
},
/**
* 组件的方法列表
*/
methods: {
noScroll() {},
setDefaultSku(skuData) {
let { isActivity } = this.data
let { specificationList } = skuData
let [specificationDetailList] = isActivity ? skuData.specificationExtraList : skuData.specificationDetailList
let defaultGoods = specificationDetailList.specificationData.split('&')
specificationList.map(e => {
defaultGoods.map(i => {
let [key, value] = i.split('-')
if (key == e.specificationName) {
e.specificationValueList.map(c => {
if (c.specificationValue == value) c.active = true
})
}
})
})
specificationDetailList.retailPrice = centsToyuan(specificationDetailList.retailPrice)
this.setData({
skuObj: skuData,
goodsInfo: specificationDetailList
})
},
choose(e) {
let { ind, index } = e.currentTarget.dataset
let {
skuObj: { specificationList, id, specificationExtraList },
isActivity
} = this.data
let activeList = []
if (specificationList[index].specificationValueList[ind].active) return
specificationList[index].specificationValueList.map(i => (i.active = false))
specificationList[index].specificationValueList[ind].active = true
specificationList.map(i => {
i.specificationValueList.map(c => {
if (c.active) activeList.push(`${i.specificationName}-${c.specificationValue}`)
})
})
let specificationData = activeList.join('&')
this.setData({
[`skuObj.specificationList[${index}]`]: specificationList[index]
})
if (isActivity) {
specificationExtraList.map((i, i_index) => {
if (i.specificationData == specificationData) {
let retailPrice = i.retailPrice
if (i_index != 0) retailPrice = centsToyuan(i.retailPrice)
this.setData({
goodsInfo: {
retailPrice,
stock: i.stock,
specificationData,
specificationKey: i.specificationKey
}
})
}
})
} else {
wx.p.api.shopmallApi
.getGoodsSpecificationExtra({
goodsId: id,
specificationData
})
.then(data => {
data.retailPrice = centsToyuan(data.retailPrice)
this.setData({
goodsInfo: data
})
console.log(this.data.goodsInfo)
})
}
this.setData({
goodsNumber: 1
})
const thisPage = wx.p.router.getPageInstance()
thisPage.setData({
activeSku: specificationData
})
},
changeCount(e) {
let goodsNumber = e.detail
this.setData({
goodsNumber
})
},
closeSku() {
let thisPage = wx.p.router.getPageInstance()
let { showName } = this.data
this.setData({
close: true
})
setTimeout(() => {
thisPage.setData({
[showName]: false
})
}, 0.5 * 1000)
},
click(e) {
let { type } = e.currentTarget.dataset
let {
goodsInfo: { goodsId, specificationKey, stock },
goodsNumber
} = this.data
if (stock === 0) return
this.triggerEvent(type, {
goodsId,
specificationKey,
goodsNumber,
stock
})
this.closeSku()
}
}
})
{
"component": true,
"usingComponents": {}
}
\ No newline at end of file
<view class="sku" catchtouchmove="noScroll" hidden="{{!show}}">
<view class="sku-bg" bindtap="closeSku"></view>
<view class="sku-box isFullSucreen {{close?'close':''}}">
<scroll-view class="sku-content" scroll-y>
<view class="view">
<view class="goods-box">
<view class="preview">
<image webp src="{{skuObj.goodsImage || skuObj.activityImg}}"></image>
</view>
<view class="goods-info">
<view class="price">
<text class="unit">¥</text>{{goodsInfo.retailPrice}}
</view>
<view class="count">
<block wx:if="{{goodsInfo.stock}}">
有货(库存{{goodsInfo.stock}})
</block>
<block wx:else>无货</block>
</view>
<view class="active text-hide">已选:{{goodsInfo.specificationData}}</view>
</view>
</view>
<view class="sku-list">
<block wx:for="{{skuObj.specificationList}}" wx:key="index">
<view class="sku-title">{{item.specificationName}}</view>
<view class="sku-item">
<block wx:for="{{item.specificationValueList}}" wx:key="ind" wx:for-index="ind" wx:for-item="i">
<view class="item text-center {{i.active?'active':''}} {{i.stock ===0?'disabled':''}}" bindtap="choose" data-index="{{index}}"
data-ind="{{ind}}">{{i.specificationValue}}</view>
</block>
</view>
</block>
<view class="sku-title">
数量
<stepper count="{{goodsNumber}}" max="{{goodsInfo.stock}}" bindchange="changeCount"></stepper>
</view>
<view class="sku-title">
发货
<view class="value">快递:{{skuObj.expressFee||'免运费(请以提交订单时为准)'}}</view>
</view>
</view>
</view>
</scroll-view>
<view class="sku-btn-box">
<view class="sku-btn">
<block wx:if="{{!isActivity}}">
<view class="join text-center {{goodsInfo.stock === 0?'disabled':''}}" bindtap="click" data-type="join">加入购物车</view>
</block>
<view class="pay text-center {{goodsInfo.stock === 0?'disabled':''}} " bindtap="click" data-type="pay">立即购买</view>
</view>
</view>
</view>
</view>
\ No newline at end of file
/* components/Sku/Sku.wxss */
@import '/style/common.wxss';
.sku {
position: fixed;
left: 0;
bottom: 0;
right: 0;
top: 0;
z-index: 9;
}
.sku-bg {
position: absolute;
width: 100%;
height: 100%;
background-color: rgba(0, 0, 0, .5);
}
.sku-box {
position: absolute;
width: 100%;
height: 76%;
background: #FFFFFF;
border-radius: 16rpx 16rpx 0 0;
left: 0;
animation: show-sku-box .5s forwards;
z-index: 2;
}
.sku-box.close {
animation: hide-popup-box .5s forwards;
}
.sku-box.isFullSucreen {
padding-bottom: constant(safe-area-inset-bottom) !important;
padding-bottom: env(safe-area-inset-bottom) !important;
}
@keyframes show-sku-box {
0% {
bottom: -100%;
}
100% {
bottom: 0;
}
}
@keyframes hide-popup-box {
0% {
bottom: 0;
}
100% {
bottom: -100%;
}
}
.sku-content {
box-sizing: border-box;
height: calc(100% - 100rpx);
}
.sku-content .view {
padding: 0 40rpx;
}
.sku-content .goods-box {
display: flex;
align-items: center;
position: sticky;
background-color: #fff;
z-index: 2;
top: 0;
padding-bottom: 18rpx;
}
.sku-content .goods-box .preview {
width: 180rpx;
height: 180rpx;
border-radius: 4rpx;
margin-right: 40rpx;
overflow: hidden;
margin-top: 40rpx;
}
.sku-content .goods-box .goods-info {
width: calc(100% - 220rpx);
}
.sku-content .goods-box .price {
color: var(--btnColor);
font-size: 64rpx;
margin-bottom: 10rpx;
}
.sku-content .goods-box .price .unit {
font-size: 40rpx;
}
.sku-content .goods-box .count {
color: #B9BABB;
font-size: 20rpx;
margin-bottom: var(--borderRadius);
}
.sku-content .goods-box .active {
font-size: 20rpx;
color: #707071;
}
.sku-box .sku-list {
padding-bottom: 40rpx;
}
.sku-box .sku-title {
color: #2D2D2E;
font-weight: 500;
padding-top: var(--margin);
display: flex;
align-items: center;
justify-content: space-between;
}
.sku-title .value {
color: #565759;
font-weight: normal;
}
.sku-box .sku-item {
display: flex;
flex-wrap: wrap;
}
.sku-box .sku-item .item {
height: 52rpx;
background: #F7F8FA;
padding: 0 20rpx;
margin: 20rpx 20rpx 0 0;
font-size: 24rpx;
color: #656566;
border: 2rpx solid #F7F8FA;
box-sizing: border-box;
border-radius: 4rpx;
}
.sku-box .sku-item .item.active {
border-color: rgb(252, 91, 50);
color: rgb(252, 91, 50);
background-color: rgba(252, 91, 50, .06);
}
.sku-btn-box {
height: 100rpx;
padding: 10rpx var(--margin);
}
.sku-btn {
border-radius: var(--borderRadius);
display: flex;
overflow: hidden;
}
.sku-btn .join,
.sku-btn .pay {
flex: 1;
height: 80rpx;
color: #fff;
}
.sku-btn .join {
background-color: #FDC23E;
}
.sku-btn .pay {
background-color: var(--btnColor);
}
.disabled{
background-color: #B1B1B3 !important;
/* border-color: #B1B1B3 !important; */
color: #000000!important;
}
\ No newline at end of file
{
"navigationStyle": "custom",
"usingComponents": {
"coupon-goods": "../../components/CouponGoods/CouponGoods",
"sku": "../../components/Sku/Sku"
}
}
\ No newline at end of file
/* packageMall/pages/detail/detail.wxss */
.flex {
display: flex;
align-items: center;
position: relative;
}
.navigation-bar {
position: fixed;
top: 0;
left: 0;
z-index: 2;
}
.empty-page {
box-sizing: border-box;
width: 100%;
height: calc(100vh - 128rpx);
padding-top: 128rpx;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
font-size: 28rpx;
color: #ACACAC;
}
.empty-img {
width: 446rpx;
height: 240rpx;
margin-bottom: 60rpx;
}
.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;
}
.box {
margin-bottom: 16rpx;
background-color: #fff;
}
.banner-box {
height: 750rpx;
position: relative;
}
.banner {
height: 100%;
}
.dot-box {
position: absolute;
bottom: 24rpx;
border-radius: 2rpx;
overflow: hidden;
display: flex;
}
.banner video {
width: 100%;
height: 100%;
}
.dot {
width: 20rpx;
height: var(--borderRadius);
background: rgba(255, 255, 255, 0.3);
transition: all .5s;
}
.dot.active {
background-color: #fff;
}
.activity-box {
height: 100rpx;
position: relative;
}
.activity-box .activity-bg {
width: 100%;
height: 100%;
position: absolute;
left: 0;
top: 0;
}
.activity-box .activity-info {
width: 100%;
height: 100%;
position: absolute;
left: 0;
top: 0;
z-index: 2;
display: flex;
align-items: center;
justify-content: space-between;
box-sizing: border-box;
padding: 0 23rpx 0 15rpx;
color: #fff;
}
.activity-box .activity-info .price,
.activity-box .activity-info .now,
.activity-box .activity-info .text {
display: flex;
font-size: 24rpx;
}
.activity-box .activity-info .price {
align-items: baseline;
}
.activity-box .activity-info .text {
align-items: center;
}
.activity-box .activity-info .now {
font-size: 40rpx;
align-items: baseline;
margin-left: var(--borderRadius);
}
.activity-box .activity-info .now .num {
font-size: 60rpx;
line-height: 60rpx;
letter-spacing: -2rpx;
}
.activity-box .activity-info .activity-unit {
font-size: 40rpx;
margin-left: 6rpx;
transform: translateY(-5rpx);
}
.activity-box .activity-info .count {
opacity: .5;
font-size: 20rpx;
transform: translateY(-5rpx);
}
.activity-box .activity-info .text .old {
padding: 0 12rpx;
height: 28rpx;
background: #FFEAD1;
border-radius: 14rpx;
font-size: 20rpx;
color: var(--themeColor);
flex-direction: column;
margin-left: 6rpx;
}
.activity-box .activity-info .activity-time {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
font-size: 20rpx;
color: var(--themeColor);
animation: show-activity-time .5s forwards;
}
@keyframes show-activity-time {
0% {
opacity: 0;
}
100% {
opacity: 1;
}
}
.activity-box .activity-info .activity-time .time {
font-size: 24rpx;
display: flex;
align-items: center;
justify-content: flex-end;
color: var(--themeColor);
margin-top: 10rpx;
}
.activity-box .activity-info .activity-time .day {
margin-right: var(--borderRadius);
}
.activity-box .activity-info .time-box {
background: var(--themeColor);
border-radius: 4rpx;
width: 36rpx;
height: 36rpx;
color: #fff;
}
.activity-box .activity-info .unit {
text-align: center;
width: 16rpx;
}
.activity-time .finished {
font-size: 32rpx;
}
.goods-info {
padding: 28rpx 40rpx 32rpx;
}
.goods-info .price {
margin-bottom: 2rpx;
}
.goods-info .price,
.goods-info .price .now {
display: flex;
align-items: baseline;
}
.goods-info .price .now {
font-size: 64rpx;
color: var(--btnColor);
margin-right: 8rpx;
line-height: 64rpx;
}
.goods-info .price .now .unit {
font-size: 40rpx;
}
.goods-info .price .now .up {
transform: translateY(-2rpx);
}
.goods-info .price .old {
color: #B1B1B3;
text-decoration: line-through;
}
.goods-info .name {
font-size: 36rpx;
font-weight: 500;
position: relative;
width: 85%;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
.goods-info .count {
margin-top: 20rpx;
font-size: 24rpx;
color: #B1B1B3;
display: flex;
position: relative;
}
.goods-info .count view:nth-child(2) {
margin-left: 100rpx;
}
.goods-param {
padding: 0 40rpx;
}
.goods-param .item {
position: relative;
height: 98rpx;
border-bottom: 2rpx solid #EFF0F2;
display: flex;
align-items: center;
font-size: 24rpx;
}
.goods-param .item:last-child {
border-bottom: none;
}
.goods-param .item .label {
width: 136rpx;
color: #656566;
}
.goods-param .item .value {
width: 490rpx;
color: #3B3B3D;
}
.goods-param .item .coupon {
font-size: 24rpx;
padding: 0 20rpx;
font-weight: 500;
color: var(--btnColor);
line-height: 40rpx;
height: 40rpx;
width: auto;
background: rgba(252, 91, 50, 0.12);
border-radius: 4rpx;
box-sizing: border-box;
}
.goods-param .address {
height: 134rpx;
align-items: flex-start;
box-sizing: border-box;
padding: var(--margin) 0;
position: relative;
}
.goods-param .address .tips {
position: absolute;
color: #B1B1B3;
left: 136rpx;
bottom: var(--margin);
}
.goods-param .item .icon-mine-arrow {
margin-left: auto;
transform: scale(1.3) translateY(9rpx);
}
.goods-param .address .icon-mine-arrow {
position: absolute;
right: 0;
top: 50%;
transform: scale(1.3) translateY(0);
}
.activity-detail {
background-color: #fff;
}
.activity-detail .title {
display: flex;
align-items: center;
padding: 0 40rpx 20rpx;
}
.activity-detail .title .icon {
width: 32rpx;
height: 32rpx;
margin-right: var(--borderRadius);
}
.detail-time {
margin-bottom: 20rpx;
}
.content {
font-size: 24rpx;
background-color: #fff;
padding: 0 40rpx;
}
.content:first-of-type,
.activity-detail .title:first-of-type {
padding-top: 40rpx;
}
.content:last-of-type {
padding-bottom: 40rpx;
}
.goods-comment {
padding: 40rpx 32rpx;
}
.goods-comment .comment-head {
display: flex;
align-items: center;
justify-content: space-between;
padding-bottom: 12rpx;
}
.goods-comment .comment-content {
font-size: 28rpx;
font-weight: 400;
color: #282829;
line-height: 40rpx;
padding: 0 0 20rpx 0;
white-space:normal;
word-break:break-all;
}
.goods-comment .comment-head .comment-total {
font-size: 32rpx;
font-weight: 500;
color: #282829;
line-height: 44rpx;
}
.comment-all {
font-size: 24rpx;
font-weight: 400;
color: #3B3B3D;
line-height: 34rpx;
display: flex;
align-items: center;
}
.comment-all .icon-mine-arrow {
margin-left: 12rpx;
}
.comment-user {
padding: 16rpx 0 20rpx 0;
display: flex;
align-items: center;
}
.comment-user .user-portrait {
width: 72rpx;
height: 72rpx;
margin-right: 16rpx;
background-color: #333333;
border-radius: 50%;
}
.user-portrait image{
border-radius: 50%;
}
.comment-user .user-info .name {
font-size: 32rpx;
font-weight: 600;
color: #282829;
line-height: 44rpx;
}
.comment-user .user-info .comment-time {
font-size: 20rpx;
font-weight: 400;
color: #B1B1B3;
line-height: 28rpx;
}
.goods-comment .comment-images {
display: flex;
align-items: center;
flex-wrap: wrap;
margin-right: -40rpx;
}
.goods-comment .comment-images .icon {
width: 160rpx;
height: 160rpx;
border-radius: 8rpx;
box-sizing: border-box;
margin-right: 16rpx;
background-color: #e7e7e7;
margin-bottom: 10rpx;
}
.goods-comment .comment-images .icon image {
border-radius: 8rpx;
}
.share {
width: 108rpx;
height: 34rpx;
background: rgba(252, 91, 50, 0.1);
border-radius: 4rpx;
font-size: 24rpx;
color: var(--btnColor);
line-height: 34rpx;
display: flex;
align-items: center;
position: absolute;
right: 0;
padding-left: 12rpx;
box-sizing: border-box;
}
.share text {
flex-shrink: 0;
}
.icon-goods-share {
transform: scale(0.54);
}
.model {
position: fixed;
left: 0;
right: 0;
top: 0;
right: 0;
background: rgba(0, 0, 0, 0.5);
width: 100%;
height: 100%;
z-index: 999999;
display: flex;
align-items: center;
justify-content: center;
}
.poster {
width: 540rpx;
height: 860rpx;
border-radius: 8rpx;
}
.hidden{
height:100%;
overflow: hidden;
}
.shop {
height: 62rpx;
background-color: white;
padding: 30rpx;
display: flex;
align-items: center;
border-bottom: 2rpx solid #F7F8FA;
}
.shop .right {
width: 24rpx;
height: 18rpx;
margin: 0 14rpx 0 26rpx;
}
.shop .processBox {
display: flex;
}
.shop .processBox .describe {
margin-left: 8rpx;
}
.shop .processBox .describe .describeTop {
font-size: 24rpx;
color: #333333;
}
.shop .processBox .describe .describeBottom {
font-size: 20rpx;
color: #999999;
}
.shop .processBox image {
width: 60rpx;
height: 60rpx;
}
.goods-param .items {
min-height: 34rpx;
display: flex;
font-size: 24rpx;
padding: 32rpx 0;
}
.goods-param .items .labels {
width: 136rpx;
color: #656566;
}
.goods-param .items .values {
width: 490rpx;
color: #3B3B3D;
}
.tab-widget{
width: 100%;
height: 88rpx;
background: white;
position: fixed;
left: 0;
top: 88rpx;
right: 0;
z-index: 999;
}
.tab-widget .tab-item{
width: 50%;
height: 100%;
position: relative;
}
.tab-widget .tab-item .text{
font-size: 28rpx;
color: #656566;
line-height: 40rpx;
}
.tab-widget .tab-item .text-ative{
font-weight: 500;
font-size: 28rpx;
color: #2C2C2C;
}
.tab-widget .tab-item .line{
position: absolute;
left: 50%;
bottom: 0;
transform: translateX(-50%);
width: 66rpx;
height: 6rpx;
background: var(--btnColor);
border-radius: 2rpx;
}
\ No newline at end of file
<view class="navigation-bar">
<navigation-bar custom navStyle="{{navStyle}}" bindnavbarReady="navbarReady" page-title="{{isActivity?goodsInfo.activityName:goodsInfo.goodsName}}">
<view class="navigation">
<view class="back text-center y-center" bindtap="back">
<glsx-image webp src="mall/{{showHomeBtn?'home':'back'}}.png" class="icon"></glsx-image>
</view>
</view>
</navigation-bar>
</view>
<view class="empty-page" wx:if="{{!goodsFlag && !isLoading}}">
<glsx-image webp class="empty-img" src="mall/active-empty.png" />
活动重新配置中,请稍后重试
</view>
<block wx:if="{{goodsFlag}}">
<view class="{{posterUrl==''?'layout':'layout hidden'}} " style="padding-bottom:{{padding_bottom + 20}}px;">
<view class="banner-box">
<swiper class="banner" bindchange="changeBanner">
<block wx:for="{{goodsInfo.goodsDetailImageList}}" wx:key="index">
<swiper-item>
<block wx:if="{{item.resType == 1}}">
<image webp src="{{item.content}}" bindtap="previewImage" data-current="{{item.content}}" data-item="{{goodsInfo.goodsDetailImageList}}"></image>
</block>
<block wx:elif="{{item.resType == 3}}">
<video src="{{item.content}}"></video>
</block>
</swiper-item>
</block>
</swiper>
<block wx:if="{{goodsInfo.goodsDetailImageList.length > 1}}">
<view class="dot-box x-center">
<block wx:for="{{goodsInfo.goodsDetailImageList}}" wx:key="index">
<view class="dot {{bannerIndex == index ? 'active':''}}">
</view>
</block>
</view>
</block>
</view>
<block wx:if="{{isActivity}}">
<view class="activity-box">
<view class="activity-info">
<view class="price-info">
<view class="price">
<text>秒杀价</text>
<view class="text">
<view class="now">
<text>¥</text>
<view class="num">{{goodsInfo.retailPrice}}</view>
<block wx:if="{{goodsInfo.unit}}">
<view class="activity-unit">{{goodsInfo.unit}}</view>
</block>
</view>
<view class="old text-center">
限时直降{{goodsInfo.priceReduce}}
</view>
</view>
</view>
<view class="count">已售出{{goodsInfo.saleAmount || 0}}件</view>
</view>
<!-- activityStatus:1:未开始,2进行中,3已结束 -->
<block wx:if="{{goodsInfo.activityStatus != 3}}">
<view class="activity-time" wx:if="{{timeFlag}}">
<view class="title">{{activityTime.type}}还剩:</view>
<view class="time">
<view class="day">{{activityTime.day || ''}}</view>
<block wx:for="{{activityTime.dayList}}" wx:key="index">
<view class="time-box text-center">
{{item}}
</view>
<view class="unit" wx:if="{{index < 2}}"> :</view>
</block>
</view>
</view>
</block>
<block wx:else>
<view class="activity-time">
<view class="finished">{{finished}}</view>
</view>
</block>
</view>
<view class="activity-bg">
<glsx-image webp src="mall/activity.png"></glsx-image>
</view>
</view>
</block>
<view class="goods-info box">
<block wx:if="{{!isActivity}}">
<view class="price">
<view class="now">
<text class="unit">¥</text>
<block wx:if="{{activeSku}}">
{{goodsInfo.skuPrice}}
<text class="unit up">起</text>
</block>
<block wx:else>{{goodsInfo.retailPrice}}</block>
</view>
<view class="old">¥{{goodsInfo.originalPrice}}</view>
</view>
</block>
<view class="flex">
<view class="name"> {{isActivity?goodsInfo.activityName:goodsInfo.goodsName}}
</view>
</view>
<block wx:if="{{!isActivity}}">
<view class="count">
<view>剩余: {{goodsInfo.goodsStock || goodsInfo.specificationDetailList[0].stock || 0}}</view>
<view>销售: {{goodsInfo.goodsStatistics.saleAmount || 0}}</view>
</view>
</block>
</view>
<view class="goods-param box">
<block wx:if="{{!isActivity}}">
<block wx:if="{{couponData.length>0}}">
<view class="item" bindtap="showCouponFun">
<view class="label">优惠</view>
<view class="value coupon">优惠券</view>
<view class="sprite-icon icon-mine-arrow"></view>
</view>
</block>
</block>
<block wx:if="{{activeSku}}">
<view class="item" bindtap="showSkuFun">
<view class="label">已选</view>
<view class="value text-hide">{{activeSku}}</view>
<view class="sprite-icon icon-mine-arrow"></view>
</view>
</block>
<block wx:if="{{goodsInfo.deliveryType != 1}}">
<view class="item address" bindtap="jump" data-url="/packageMine/pages/address/index/index" data-is-choose-address>
<view class="label">配送</view>
<view class="value text-hide">
<block wx:if="{{addressFlag}}">
{{contactAddress||'填写地址'}}
</block>
</view>
<view class="tips">支付后,预计48小时内发货</view>
<view class="sprite-icon icon-mine-arrow"></view>
</view>
</block>
<block wx:if="{{goodsInfo.deliveryType != 1}}">
<view class="item">
<view class="label">运费</view>
<view class="value text-hide">
<block wx:if="{{goodsInfo.expressFee}}">{{goodsInfo.expressFee}}元</block>
<block wx:else>免运费(请以提交订单时为准)</block>
</view>
</view>
</block>
<block wx:if="{{isActivity && goodsInfo.limitPurchaseFlag == 2}}">
<view class="item">
<view class="label">说明</view>
<view class="value text-hide">
<text>此商品活动期间每人限购{{goodsInfo.limitPurchaseNumber}}件</text>
</view>
</view>
</block>
<block wx:if="{{goodsInfo.serviceDesc}}">
<view class="items">
<view class="labels">服务说明</view>
<view class="values">
<text>{{goodsInfo.serviceDesc}}</text>
</view>
</view>
</block>
</view>
<view class="activity-detail">
<block wx:if="{{isActivity}}">
<view class="title">
<view class="sprite-icon icon-goods-time"></view>
活动时间
</view>
<view class="content detail-time">
{{goodsInfo.startTime}} - {{goodsInfo.endTime}}
</view>
<view class="title">
<view class="sprite-icon icon-goods-text"></view>
活动详情
</view>
</block>
<block wx:for="{{goodsInfo.goodsDescList}}" wx:key="index">
<view class="content">
<block wx:if="{{item.resType == 1}}">
<image webp src="{{item.content}}" mode="widthFix" bindtap="previewImage" data-current="{{item.content}}" data-item="{{goodsInfo.goodsDescList}}" lazy-load></image>
</block>
<block wx:elif="{{item.resType == 2}}">
{{item.content}}
</block>
<block wx:else>
<video src="{{item.content}}" style="height:{{item.height}}px;"></video>
</block>
</view>
</block>
</view>
</view>
</block>
<coupon-goods show="{{showCoupon}}" only="{{only}}" couponData="{{couponData}}" bindclick="showCouponFun"></coupon-goods>
<block wx:if="{{navHeight && goodsFlag}}">
<goods-action bindready="goodsActionReady" pay-disabled="{{goodsInfo.activityStatus != 2 }}" stock="{{goodsInfo.goodsStock === 0}}" buyFlag="{{goodsInfo.buyFlag == 2}}" bindclick="goodsActionClick" hideShop="{{isActivity}}"></goods-action>
<block wx:if="{{activeSku}}">
<sku show="{{showSku}}" showName="showSku" isActivity="{{isActivity}}" skuData="{{goodsInfo}}" bindpay="pay" bindjoin="join"></sku>
</block>
</block>
\ No newline at end of file
// packageMall/pages/search/search.js
Page({
/**
* 页面的初始数据
*/
data: {
searchList: []
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
this.setData(options)
this.getSearchList(options.value)
},
getSearchList(value) {
wx.p.wxApi.showLoading()
let {
goodsList
} = this.data
const searchList = []
goodsList.map(e => {
if (e.goodsName.indexOf(value) != -1) searchList.push(e)
})
this.setData({
searchList,
flag: true
})
wx.hideLoading()
},
search(e) {
this.getSearchList(e.detail)
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
}
})
\ No newline at end of file
{
"usingComponents": {
"search-box": "/pages/tab/mall/components/SearchBox/SearchBox",
"goods": "/pages/tab/mall/components/Goods/Goods"
}
}
\ No newline at end of file
/* packageMall/pages/search/search.wxss */
.box{
display: flex;
flex-wrap: wrap;
justify-content: space-between;
padding: var(--margin) 60rpx;
}
.goods{
width: 252rpx;
padding: 18rpx;
margin-bottom: 18rpx;
background-color: #fff;
}
\ No newline at end of file
<view class="layout">
<view class="sticky">
<search-box bindsearch="search" search-type="2" value="{{value}}"></search-box>
</view>
<view class="box">
<block wx:if="{{flag}}">
<block wx:if="{{searchList.length}}">
<block wx:key="index" wx:for="{{searchList}}">
<view class="goods">
<goods item="{{item}}"></goods>
</view>
</block>
</block>
<block wx:else>
<view class="list-nothing ">
<view class="list-not">没找到相关商品</view>
</view>
</block>
</block>
</view>
</view>
\ No newline at end of file
......@@ -10,7 +10,7 @@ page {
.btn_wrapper {
/* width: calc(100% - 64rpx); */
width: 100%;
background: #FC5B32;
background: var(--btnColor);
height: 88rpx;
text-align: center;
line-height: 88rpx;
......
......@@ -130,7 +130,7 @@ page {
}
.brightColor {
color: #FC5B32;
color: var(--btnColor);
}
.darkColor {
color: #6D6D6D;
......
......@@ -82,7 +82,7 @@ page {
font-size: 64rpx;
font-family: DINAlternate-Bold, DINAlternate;
font-weight: bold;
color: #FC5B32;
color: var(--btnColor);
letter-spacing: 20rpx;
}
......@@ -222,7 +222,7 @@ page {
top: 144rpx;
transform: translate(-50%, 0);
padding: 10rpx 50rpx;
color: #FC5B32;
color: var(--btnColor);
background: #FDDED5;
border-radius: 16rpx;
}
......@@ -294,7 +294,7 @@ page {
}
.qrText {
color: #FC5B32;
color: var(--btnColor);
}
.code_main_text {
......
......@@ -40,7 +40,7 @@ page {
.active_tab_line {
width: 48rpx;
height: 8rpx;
background: #FC5B32;
background: var(--btnColor);
border-radius: 2rpx;
position: absolute;
left: 50%;
......@@ -366,7 +366,7 @@ page {
margin-left: 10rpx;
}
.stretchColor {
color: #FC5B32;
color: var(--btnColor);
font-size: 32rpx;
font-weight: 500;
margin-left: 10rpx;
......@@ -405,7 +405,7 @@ page {
text-overflow: ellipsis;
}
.associatedOrder .checkOrder {
color: #FC5B32;
color: var(--btnColor);
position: absolute;
right: 0;
}
......@@ -429,21 +429,21 @@ page {
justify-content: center;
width: 154rpx;
flex-shrink: 0;
color: #FC5B32;
color: var(--btnColor);
}
.price_wrap .num{
height: 84rpx;
font-weight: 600;
font-size: 42rpx;
color: #FC5B32;
color: var(--btnColor);
}
.price_wrap .unit{
height: 28rpx;
font-weight: 500;
font-size: 20rpx;
color: #FC5B32;
color: var(--btnColor);
vertical-align: text-top;
margin-left: 4rpx;
}
......@@ -486,7 +486,7 @@ page {
width: 136rpx;
height: 48rpx;
line-height: 48rpx;
background-image: linear-gradient(90deg, #FC5B32 2%, #FF1A33 96%);
background-image: linear-gradient(90deg, var(--btnColor) 2%, #FF1A33 96%);
border-radius: 23rpx;
color: #fff;
text-align: center;
......
......@@ -69,7 +69,7 @@
<view class="involid_btn isFullSucreen-btn">
<view class="view_involid" bindtap="goInvolidPage">
<text class="text">查看失效券</text>
<glsx-image class="right" src="mine/right.png?v=1.0.0"></image>
<glsx-image class="right" src="mine/right.png"></glsx-image>
</view>
</view>
</block>
......@@ -77,10 +77,10 @@
<view wx:if="{{showGiftsModal}}" class="gifts_modal flex_ccc">
<view class="gifts_wrap flex_ccc">
<view wx:if="{{giftsList.length>2}}" class="gifts_wrapper flex_ccc">
<image webp mode="widthFix" class="gifts_modal_bg" src="{{imgBaseURL}}gifts_list_bg.png" />
<glsx-image webp mode="widthFix" class="gifts_modal_bg" src="{{imgBaseURL}}gifts_list_bg.png" />
<view class="gifts_content_wrap">
<view wx:for="{{giftsList}}" class="gifts_item_wrap">
<image webp mode="widthFix" class="gifts_item_bg" src="{{imgBaseURL}}gifts_coupons_bg.png" />
<glsx-image webp mode="widthFix" class="gifts_item_bg" src="{{imgBaseURL}}gifts_coupons_bg.png" />
<view class="gifts_po_wrap">
<view class="left_widget">
<view class="coup_title">{{item.couponName}}</view>
......@@ -89,21 +89,21 @@
<view wx:if="{{item.effectiveType==1}}" class="coup_tip">有效至{{item.receiveEndTime}}</view>
</view>
<view class="right_widget">
<image webp mode="widthFix" bind:tap="toUseGifts" data-item="{{item}}" class="gifts_to_use_bg" src="{{imgBaseURL}}gifts_touse.png" />
<glsx-image webp mode="widthFix" bind:tap="toUseGifts" data-item="{{item}}" class="gifts_to_use_bg" src="{{imgBaseURL}}gifts_touse.png" />
</view>
</view>
</view>
<view style="height:88rpx"></view>
</view>
<image webp mode="widthFix" class="gifts_modal_bottom_bg" src="{{imgBaseURL}}gifts_fixed_bottom.png" />
<glsx-image webp mode="widthFix" class="gifts_modal_bottom_bg" src="{{imgBaseURL}}gifts_fixed_bottom.png" />
</view>
<view wx:if="{{giftsList.length<3}}" class="mini_widget flex_ccc">
<image webp mode="widthFix" class="mini_header_bg" src="{{imgBaseURL}}gifts_header_bg.png" />
<glsx-image webp mode="widthFix" class="mini_header_bg" src="{{imgBaseURL}}gifts_header_bg.png" />
<view class="mini_box_wrap" style="height:{{giftsList.length==2?408:298}}rpx">
<image webp class="mini_box_bg" style="height:{{giftsList.length==2?450:340}}rpx" src="{{imgBaseURL}}gifts_box_bg.png" />
<glsx-image webp class="mini_box_bg" style="height:{{giftsList.length==2?450:340}}rpx" src="{{imgBaseURL}}gifts_box_bg.png" />
<view style="height:50rpx"></view>
<view wx:for="{{giftsList}}" class="gifts_item_wrap">
<image webp mode="widthFix" class="gifts_item_bg" src="{{imgBaseURL}}gifts_coupons_bg.png" />
<glsx-image webp mode="widthFix" class="gifts_item_bg" src="{{imgBaseURL}}gifts_coupons_bg.png" />
<view class="gifts_po_wrap">
<view class="left_widget">
<view class="coup_title">{{item.couponName}}</view>
......@@ -112,13 +112,13 @@
<view wx:if="{{item.effectiveType==1}}" class="coup_tip">有效至{{item.receiveEndTime}}</view>
</view>
<view class="right_widget">
<image webp mode="widthFix" bind:tap="toUseGifts" data-item="{{item}}" class="gifts_to_use_bg" src="{{imgBaseURL}}gifts_touse.png" />
<glsx-image webp mode="widthFix" bind:tap="toUseGifts" data-item="{{item}}" class="gifts_to_use_bg" src="{{imgBaseURL}}gifts_touse.png" />
</view>
</view>
</view>
</view>
</view>
<image webp mode="widthFix" bind:tap="clickClose" class="gifts_modal_btn" src="{{imgBaseURL}}gifts_comfirm_btn.png" />
<glsx-image webp mode="widthFix" bind:tap="clickClose" class="gifts_modal_btn" src="{{imgBaseURL}}gifts_comfirm_btn.png" />
</view>
</view>
</block>
......
......@@ -79,7 +79,7 @@ page {
font-weight: 400;
}
.brightColor {
color: #FC5B32;
color: var(--btnColor);
}
.darkColor {
color: #666;
......@@ -135,7 +135,7 @@ page {
margin-top: 50rpx;
font-size: 36rpx;
font-weight: 600;
color: #FC5B32;
color: var(--btnColor);
}
.box .good .info .price .price-X {
margin-left: 10rpx;
......
......@@ -50,8 +50,8 @@ page {
}
.btn_orage {
background: #FC5B32;
border: 2rpx solid #FC5B32;
background: var(--btnColor);
border: 2rpx solid var(--btnColor);
color: #FFFFFF;
}
......
......@@ -40,7 +40,7 @@ page {
.active_tab_line {
width: 48rpx;
height: 8rpx;
background: #FC5B32;
background: var(--btnColor);
border-radius: 2rpx;
position: absolute;
left: 50%;
......@@ -352,7 +352,7 @@ page {
margin-left: 10rpx;
}
.stretchColor {
color: #FC5B32;
color: var(--btnColor);
font-size: 32rpx;
font-weight: 500;
margin-left: 10rpx;
......@@ -391,7 +391,7 @@ page {
text-overflow: ellipsis;
}
.associatedOrder .checkOrder {
color: #FC5B32;
color: var(--btnColor);
position: absolute;
right: 0;
}
......@@ -415,7 +415,7 @@ page {
justify-content: center;
width: 154rpx;
flex-shrink: 0;
color: #FC5B32;
color: var(--btnColor);
}
.price_wrap .num{
......
......@@ -130,7 +130,7 @@
border-radius: 4rpx;
font-size: 24rpx;
font-weight: 500;
color: #FC5B32;
color: var(--btnColor);
line-height: 40rpx;
padding: 0 20rpx;
position: absolute;
......@@ -238,7 +238,7 @@
font-size: 70rpx;
/* color: rgba(white, white, white, 0.45); */
font-weight: 600;
color: #FC5B32;
color: var(--btnColor);
/* opacity: 0.45; */
}
......@@ -297,7 +297,7 @@
font-size: 24rpx;
}
.brightColor {
color: #FC5B32;
color: var(--btnColor);
}
.darkColor {
color: #6D6D6D;
......
......@@ -280,7 +280,7 @@
}
.layout .coupon-item .orderPrices {
position: absolute;
color: #fc5b32;
color: var(--btnColor);
font-size: 48rpx;
right: 32rpx;
}
......@@ -306,7 +306,7 @@
.layout .coupon-item .info .order-btn {
width: 138rpx;
height: 48rpx;
background: #fc5b32;
background: var(--btnColor);
border-radius: 24rpx;
margin-top: 40rpx;
color: #ffffff;
......
......@@ -44,7 +44,7 @@ Component({
methods: {
jump(e) {
let { id } = e.currentTarget.dataset
wx.p.router.go('/packageShopmall/packageMall/pages/detail/detail', { id, isActivity: true, notIntercept: true })
wx.p.router.go('/packageMall/pages/detail/detail', { id, isActivity: true, notIntercept: true })
},
countDown(params) {
params.forEach(v => {
......
@import "/style/common.wxss";
@import "/assets/style/common.wxss";
.Activity {
display: flex;
......@@ -87,7 +87,7 @@
.item-box-price .now {
font-size: 40rpx;
color: #FF6038;
color: var(--btnColor);
font-weight: 600;
}
......@@ -115,7 +115,7 @@
border-radius: 0 8rpx 8rpx 8rpx;
margin-top: 14rpx;
font-size: 20rpx;
color: #FF6038;
color: var(--btnColor);
display: flex;
}
......@@ -152,7 +152,7 @@
}
.time.end {
color: #FA2C18;
color:var(--btnColor);
}
.time.start {
......@@ -164,5 +164,5 @@
}
.time.end .time-content {
background: #FA2C18;
background: var(--btnColor);
}
\ No newline at end of file
......@@ -84,7 +84,7 @@ Component({
if (item.classifyName && item.classifyName == '秒杀') {
isActivity = true
}
wx.p.router.go('/packageShopmall/packageMall/pages/detail/detail', {
wx.p.router.go('/packageMall/pages/detail/detail', {
id,
isActivity,
notIntercept: true
......
<wxs module="fn">
module.exports = {
priceFilter: function(e, num) {
return e.toString().split('.')[num] || ''
}
}
module.exports = {
priceFilter: function (e, num) {
return e.toString().split('.')[num] || ''
}
}
</wxs>
<view class="Goods">
<view class="left">
<block
wx:for="{{list}}"
wx:for-index="idx"
wx:key="idx"
wx:for-item="item">
<template is="item" data="{{item}}" wx:if="{{idx%2==0}}" />
</block>
</view>
<view class="right">
<block
wx:for="{{list}}"
wx:for-index="idx"
wx:key="idx"
wx:for-item="item">
<template is="item" data="{{item}}" wx:if="{{idx%2==1}}" />
</block>
</view>
<template name="item">
<view
class='item-box'
wx:if="{{item.goods}}"
bindtap='jump'
data-item="{{item}}">
<view class="preview">
<image webp src="{{item.goods.goodsImage}}" lazy-load></image>
</view>
<view class="item-box-content">
<view class='item-box-title'>
<image wx:if="{{item.goods.isMemberGoods}}" webp src="{{item.IMGURL}}index/member-goods-icon.png" />
<text>{{item.goods.goodsName}}</text>
</view>
<view class='item-box-time'>
<view class="text text-hide">
{{item.goodsStatistics.viewAmount||0}}人查看|售出{{item.goodsStatistics.saleAmount || 0}}
</view>
</view>
<view class="item-box-price">
<view class="now">
<text class="unit">¥</text>
<text>{{fn.priceFilter(item.goods.retailPrice || 0, 0)}}.</text>
<text class="price-last">{{fn.priceFilter(item.goods.retailPrice || 0, 1)}}</text>
<text class="unit up" wx:if="{{item.unit}}">{{item.unit}}</text>
<text class="unit up" wx:if="{{item.up}}">起</text>
</view>
<block wx:if="{{item.goods.originalPrice >= 0 && item.goods.originalPrice}}">
<view class="old">¥{{item.goods.originalPrice || 0}}</view>
</block>
</view>
<view class="item-box-bubble">
<!-- 会员商品 -->
<view wx:if="{{item.goods.isMemberGoods}}" class="text">
<text>会员价</text>
开通会员权益立享
</view>
</view>
<view class="item-box-goods-label">
<view wx:if="{{item.goods.relatedCoupon}}" class="coupon-logotype">
<text wx:if="{{item.goods.relatedCoupon}}" class="coupon-logo">券</text>
<text class="coupon-name">{{item.goods.relatedCoupon.couponName}}</text>
</view>
<view wx:if="{{item.goods.freeShipping}}" class="free-shipping">包邮</view>
</view>
</view>
</view>
</template>
</view>
<view class="left">
<block wx:for="{{list}}" wx:for-index="idx" wx:key="idx" wx:for-item="item">
<template is="item" data="{{item}}" wx:if="{{idx%2==0}}" />
</block>
</view>
<view class="right">
<block wx:for="{{list}}" wx:for-index="idx" wx:key="idx" wx:for-item="item">
<template is="item" data="{{item}}" wx:if="{{idx%2==1}}" />
</block>
</view>
<template name="item">
<view class='item-box' wx:if="{{item.goods}}" bindtap='jump' data-item="{{item}}">
<view class="preview">
<image webp src="{{item.goods.goodsImage}}" lazy-load></image>
</view>
<view class="item-box-content">
<view class='item-box-title'>
<image wx:if="{{item.goods.isMemberGoods}}" webp src="{{item.IMGURL}}index/member-goods-icon.png" />
<text>{{item.goods.goodsName}}</text>
</view>
<view class='item-box-time'>
<view class="text text-hide">
{{item.goodsStatistics.viewAmount||0}}人查看|售出{{item.goodsStatistics.saleAmount || 0}}
</view>
</view>
<view class="item-box-price">
<view class="now">
<text class="unit">¥</text>
<text>{{fn.priceFilter(item.goods.retailPrice || 0, 0)}}.</text>
<text class="price-last">{{fn.priceFilter(item.goods.retailPrice || 0, 1)}}</text>
<text class="unit up" wx:if="{{item.unit}}">{{item.unit}}</text>
<text class="unit up" wx:if="{{item.up}}">起</text>
</view>
<block wx:if="{{item.goods.originalPrice >= 0 && item.goods.originalPrice}}">
<view class="old">¥{{item.goods.originalPrice || 0}}</view>
</block>
</view>
<view class="item-box-bubble">
<!-- 会员商品 -->
<view wx:if="{{item.goods.isMemberGoods}}" class="text">
<text>会员价</text>
开通会员权益立享
</view>
</view>
<view class="item-box-goods-label">
<view wx:if="{{item.goods.relatedCoupon}}" class="coupon-logotype">
<text wx:if="{{item.goods.relatedCoupon}}" class="coupon-logo">券</text>
<text class="coupon-name">{{item.goods.relatedCoupon.couponName}}</text>
</view>
<view wx:if="{{item.goods.freeShipping}}" class="free-shipping">包邮</view>
</view>
</view>
</view>
</template>
</view>
\ No newline at end of file
......@@ -84,7 +84,7 @@
.item-box-price .now{
font-size: 40rpx;
color: #FF6038;
color: var(--btnColor);
font-weight: 600;
}
......
......@@ -62,7 +62,7 @@
.Goods .price .old {
color: #C9CACC;
text-decoration: line-through;
margin-left: 8rpx;
margin-left: auto;
}
.text-hide {
......
......@@ -17,6 +17,14 @@ Page({
navHeight: height,
})
},
search(e) {
let value = e.detail
let { goodsList } = this.data
wx.$router.go('/packageMall/pages/search/search', {
value,
goodsList
})
},
/**
* 生命周期函数--监听页面加载
*/
......
......@@ -5,8 +5,7 @@ Page({
* 页面的初始数据
*/
data: {
toolList: [
{
toolList: [{
text: '购物车',
icon: 'myShopping',
url: '/packageMall/pages/shoppingCart/shoppingCart'
......@@ -23,7 +22,12 @@ Page({
* 生命周期函数--监听页面加载
*/
onLoad(options) {
let {
userInfo
} = this.data
if (userInfo) {
this.getOrderNumberList()
}
},
navbarReady(e) {
let {
......@@ -36,13 +40,22 @@ Page({
login() {
wx.p.router.go('/pages/Login/Login')
},
goSetUp(){
goSetUp() {
wx.p.router.go('/packageMine/pages/setting/index')
},
jump(e){
const {url} = e.currentTarget.dataset
jump(e) {
const {
url
} = e.currentTarget.dataset
wx.p.router.go(url)
},
getOrderNumberList() {
wx.p.api.mineApi.getOrderNumberList().then(res => {
this.setData({
orderNumberList: [res.unPayCount, res.unShippedCount, res.unReceivedCount, res.unServiceCount]
})
})
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!