Commit 5f0208e7 by 张立顺

代码合并

1 parent 76f36651
import { preReleaseAppId } from '~/config'
const target = ['ip', 'dev', 'uat', 'prod', 'preRelease']
let index = 1
let index = 2
/**
*
......
......@@ -15,9 +15,18 @@ module.exports = {
useMemberType: 0
})
},
// 门店发现商城优惠券列表
getMerchantCouponsListApi(data) {
return api.post({
method: `scrm.api.coupon.discover.goods.list`,
...data
})
},
/**获取首页可以领取的券 */
getHomeCardData(data) {
let {merchantId} = wx.p.storage.get('merchant_info')
let {
merchantId
} = wx.p.storage.get('merchant_info')
if (merchantId) {
merchantId = Number(JSON.parse(merchantId))
data.merchantId = merchantId
......@@ -27,7 +36,7 @@ module.exports = {
...data
})
},
/**领取优惠券 */
toReciveCard(data) {
let {
......@@ -157,4 +166,4 @@ module.exports = {
receiveSource: 3
})
},
}
}
\ No newline at end of file
......@@ -14,5 +14,12 @@ module.exports = {
method: 'scrm.api.carlife.merchant.detail',
...data
})
},
/**查询小程序发现频道-配置升级的分类列表 */
getDiscoverChannelCategory(data) {
return api.post({
method: 'scrm.api.shopmall.discover.category.merchant.list',
...data
})
}
}
\ No newline at end of file
......@@ -6,6 +6,7 @@ import api from "./api/index";
import { router } from "./router/index";
// 判断小程序是否需要更新
import { getUpdateManager } from "./lib/index";
import {IMG_URL} from '~/config'
import utils from "./utils/index";
// 埋点 有需要再引入
import TRACK from './utils/track/Track'
......@@ -21,10 +22,20 @@ App({
api,
router,
storage: new utils.cache.Storage(),
$Track: new TRACK(options)
$Track: new TRACK(options),
IMGURL:IMG_URL
};
// 存储设备信息
console.log(wx.p);
const {
scene,
query,
query: {
pageType
}
} = wx.getEnterOptionsSync()
console.log(scene,query,pageType,'二次扫码');
// 存储设备信息
utils.cache.storageApi.setSystem_info();
},
/**页面不存在时触发 */
......
......@@ -70,7 +70,8 @@
"pages": [
"pages/shoppingCart/shoppingCart",
"pages/pay/pay",
"pages/detail/detail"
"pages/detail/detail",
"pages/getCoupon/getCoupon"
]
},
{
......
// packageShopmall/packageMall/pages/getCoupon/getCoupon.js
import { couponsApi,userApi } from "~/api/index";
import { centsToyuan } from '~/utils/format'
// import USER from '~/api/usersApi/index'
const navStyle = "background-color: transparent;";
console.log(couponsApi,'couponsApi');
Page({
/**
* 页面的初始数据
*/
data: {
IMGURL: wx.p.IMGURL,
navStyle,
showSuccessDialog: false,
isLogin: false,
sessionId: '',
couponList: [],
count: 3,
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
this.login()
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
console.log(this.options, '111options')
this.getMerchantCouponList()
},
navbarReady () {
},
login() {
wx.p.wxApi.showLoading()
userApi.login().then(({
data
}) => {
wx.hideLoading()
if (data) {
console.log(data)
let {
sessionId
} = data
this.setData({
sessionId,
})
if (data.isLogin) {
this.setData({
isLogin: true
})
}
}
})
},
getMerchantCouponList(){
const merchantId = wx.p.storage.get('srcm_shopmall_merchant_id')
couponsApi.getMerchantCouponsListApi({merchantId,discoverGoodsType:this.options.discoverGoodsType}).then(res => {
if(res?.length) {
res.forEach(item =>{
item.denomination = Number(centsToyuan(item.denomination||0))
})
this.setData({
couponList : res
})
}
})
},
receiveCoupon(){
const merchantId = wx.p.storage.get('srcm_shopmall_merchant_id')
let couponIds = this.data.couponList?.map(item => item.couponId)
wx.p.wxApi.showLoading()
couponsApi.batchGetMerchantCouponsApi({merchantId,couponIds,discoverGoodsType:this.options.discoverGoodsType}).then(res => {
wx.p.api.hideLoading()
if(res){
this.setData({
showSuccessDialog: true
},()=>{
this.countDown()
})
}
})
},
goPage(){
clearInterval(this.data.countDownTime)
this.toBack()
},
countDown() {
let count = this.data.count
this.data.countDownTime = setInterval(() => {
if (count == 0) {
clearInterval(this.data.countDownTime)
this.toBack()
return
}
count--
this.setData({
count
})
}, 1 * 1000)
},
JumpDiscoverPage(){
const merchantId = wx.p.storage.get('srcm_shopmall_merchant_id')
const channel = this.options.discoverGoodsType==1 ? 5 : 6
wx.$router.reLaunch(`/packageDiscovery/pages/index/index?merchantId=${merchantId}&channel=${channel}`, { notIntercept: true })
},
toBack() {
if(this.options.from) {
wx.$router.back()
}else{
this.JumpDiscoverPage()
}
},
getPhoneNumber({
detail
}) {
if(detail.errMsg.indexOf('fail')>-1){
if(!this.options.from){
this.JumpDiscoverPage()
} //从列表和详情进来的话,如果点击不允许授权,则留在本页面
return;
}
const {
sessionId
} = this.data
if (!sessionId) return
userApi.authUserPhone(detail, sessionId).then(({
data,
code,
message
}) => {
wx.hideLoading()
if (code == '0') {
wx.$authStatus = false
wx.$util.setUserInfo(data)
wx.$util.setSessionId(data.sessionId)
this.setData({
sessionId: '',
})
const merchantId = wx.p.storage.get('srcm_shopmall_merchant_id')
couponsApi.getMerchantCouponsListApi({merchantId,discoverGoodsType:this.options.discoverGoodsType}).then(res => {
if(res?.length) {
this.receiveCoupon()
}
if(res?.length===0) {
this.toBack()
}
})
} else wx.p.api.showToast(message)
})
},
// 客户id
handlerCustomerId() {
let customerId = wx.p.storage.get('srcm_shopmall_customer_id')
if (customerId) userApi.updataCustomerPhone()
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
}
})
\ No newline at end of file
{
"usingComponents": {},
"navigationStyle": "custom"
}
\ No newline at end of file
/* packageShopmall/packageMall/pages/getCoupon/getCoupon.wxss */
.bar-text {
font-weight: 600;
font-size: 34rpx;
color: #fff;
}
.nav-func-icon {
width: 44rpx;
height: 44rpx;
position: absolute;
left: 16rpx;
top: 50%;
transform: translateY(-50%);
}
.bg-img{
position: fixed;
left: 0;
right: 0;
bottom: 0;
top: 0;
}
.coupon-wrap{
width: 100%;
position: relative;
z-index: 5;
padding: 0 32rpx;
margin-top: 400rpx;
box-sizing: border-box;
overflow-x: hidden;
height: 780rpx;
overflow-y: auto;
.coupon-item{
width: 686rpx;
height: 148rpx;
position: relative;
display: flex;
margin-bottom: 20rpx;
.bg{
z-index: -1;
position: absolute;
left: 0;
right: 0;
bottom: 0;
top: 0;
}
.price{
height: 144rpx;
width: 210rpx;
line-height: 144rpx;
text-align: center;
font-weight: 700;
font-size: 68rpx;
color: #FC5B32;
.sign{
font-size: 28rpx;
}
}
.info{
margin-left: 40rpx;
flex: 1;
height: 144rpx;
display: flex;
flex-direction: column;
justify-content: space-between;
padding: 16rpx 0;
box-sizing: border-box;
.name{
font-weight: 600;
font-size: 28rpx;
color: #823C2A;
letter-spacing: 0;
height: 40rpx;
line-height: 40rpx;
}
.desc{
height: 28rpx;
line-height: 28rpx;
font-size: 20rpx;
color: #C45639;
}
.date{
height: 28rpx;
line-height: 28rpx;
font-size: 16rpx;
color: #823c2a70;
}
}
}
}
.btn-box{
position: fixed;
width: 100%;
left: 0;
right: 0;
padding: 0 64rpx 20rpx;
box-sizing: border-box;
.get-coupon-btn{
position: relative;
z-index: 5;
height: 80rpx;
line-height: 80rpx;
background: #FC5B32;
box-shadow: inset 0 0 36rpx 0 #ffffff80;
border-radius: 44rpx;
font-weight: 500;
font-size: 32rpx;
color: #FFFFFF;
text-align: center;
&::after{
border: none;
}
}
}
.success-dialog{
z-index: 9;
position: fixed;
top: 0;
bottom: 0;
left: 0;
right: 0;
background: rgba(45, 45, 51, 0.7);
.success-wrap{
width: 560rpx;
height: 588rpx;
position: absolute;
top: 464rpx;
left: 50%;
transform: translateX(-50%);
.bg{
position: absolute;
top: 0;
bottom: 0;
left: 0;
right: 0;
z-index: -1;
}
.title{
height: 56rpx;
line-height: 56rpx;
margin-top: 260rpx;
font-weight: 600;
font-size: 40rpx;
color: #823C2A;
text-align: center;
}
.tip{
height: 40rpx;
line-height: 40rpx;
font-weight: 400;
font-size: 28rpx;
color: #c45639a6;
text-align: center;
margin-top: 32rpx;
}
.btn{
width: 320rpx;
height: 80rpx;
line-height: 80rpx;
text-align: center;
background: #FC5B32;
box-shadow: inset 0 0 36rpx 0 #ffffff80;
border-radius: 44rpx;
font-weight: 500;
font-size: 32rpx;
color: #FFFFFF;
position: absolute;
left: 50%;
transform: translateX(-50%);
bottom: 56rpx;
}
}
}
// .coupon-dialog{
// z-index: 9;
// position: fixed;
// top: 0;
// bottom: 0;
// left: 0;
// right: 0;
// background: rgba(0, 0, 0, 0.7);
// .coupon-wrap{
// padding: 0 47rpx;
// margin-top: 360rpx;
// // background-color: #fff;
// width: 100%;
// box-sizing: border-box;
// .code-wrap{
// width: 654rpx;
// height: 760rpx;
// position: relative;
// box-sizing: border-box;
// border-radius: 24rpx;
// .bg{
// position: absolute;
// top: 0;
// bottom: 0;
// left: 0;
// right: 0;
// z-index: 1;
// }
// .title{
// height: 200rpx;
// line-height: 200rpx;
// font-weight: 500;
// font-size: 40rpx;
// color: #1B233D;
// text-align: center;
// border-bottom: 10rpx dashed ;
// }
// .code{
// width: 320rpx;
// height: 320rpx;
// }
// }
// .btn-wrap{
// margin-top: 80rpx;
// .btn{
// display: inline-block;
// width: 320rpx;
// height: 88rpx;
// line-height: 88rpx;
// border-radius: 20rpx;
// background-color: #fff;
// font-weight: 400;
// font-size: 32rpx;
// color: #1B233D;
// text-align: center;
// &:last-child{
// color: #FFFFFF;
// background-color: #6686FB;
// margin-left: 16rpx;
// }
// }
// }
// }
// }
\ No newline at end of file
<navigation-bar bindnavbarReady="navbarReady" navStyle="{{navStyle}}" page-title="发现专区">
<view class="bar-nav">
<glsx-image class="nav-func-icon" bind:tap="toBack" webp src="discover/coupons/back_icon_white.png"></glsx-image>
<view class="bar-text">发现专区</view>
</view>
</navigation-bar>
<image class="bg-img" src="{{IMGURL}}mine/getCoponBg.png?v={{img_version}}" />
<view class="coupon-wrap">
<view class="coupon-item" wx:for="{{couponList}}" wx:key="index">
<image class="bg" src="{{IMGURL}}mine/couponItem.png?v={{img_version}}" />
<text class="price"><text class="sign">¥</text>{{item.denomination}}</text>
<view class="info">
<view class="name">
{{item.couponName}}代金券
</view>
<view class="desc">
{{item.useDescription}}
</view>
<view class="date" wx:if="{{item.effectiveType==1}}">有效期:{{item.effectiveDays}}天</view>
<view class="date" wx:if="{{item.effectiveType==2}}">有效期:{{item.effectiveStartTime}}-{{item.effectiveEndTime}}</view>
<view class="date" wx:if="{{item.effectiveType==3}}">永久有效</view>
</view>
</view>
</view>
<view class="btn-box isFullSucreen-bottom">
<view wx:if="{{isLogin}}" class="get-coupon-btn" bindtap="receiveCoupon">免费领取</view>
<button wx:else class="get-coupon-btn" open-type="getPhoneNumber" catchgetphonenumber="getPhoneNumber">免费领取</button>
</view>
<view class="success-dialog" wx:if="{{showSuccessDialog}}">
<view class="success-wrap">
<image class="bg" src="{{IMGURL}}mine/successTipBg.png?v={{img_version}}" />
<view class="title">优惠券领取成功!</view>
<view class="tip">{{count}}秒后自动跳转到发现频道页面</view>
<view class="btn" bindtap="goPage">确定</view>
</view>
</view>
<glsx-privacy appletName="车生活助手"></glsx-privacy>
\ No newline at end of file
/* packageMall/pages/getCoupon/getCoupon.wxss */
\ No newline at end of file
import {
discoveryApi,
shopmallApi,
couponsApi
} from "~/api/index";
import {
decimal,
centsToyuan
} from '~/utils/format'
Component({
/**
* 组件的属性列表
*/
properties: {
height: null,
channelID: {
type: Number,
observer: function (val) {
if (val) {
// this.setList(val);
}
},
},
},
/**
* 组件的初始数据
*/
data: {
curCategoryIdx: 0,
hasCarOwnerCouponFlag: false,
toCategory: 'toCategory-0',
categoryList: [],
categoryStyle: -1,
goodsList: [],
goodsItemHeight: 0,
goodsItemTopList: [],
curPlayIdx: 0
// leftList: [],
// rightList: [],
// leftHeight: 0,
// rightHeight: 0,
},
/**
* 组件的方法列表
*/
methods: {
toSelectCategory(e) {
const {
index,
item
} = e.currentTarget.dataset
this.setData({
curCategoryIdx: index,
toSeri: `toCategory-${index}`,
categoryStyle: item.categoryStyle || 0
})
this.triggerEvent('showShoppingCar', item.categoryStyle)
this.getCategoryGoodsList(item.id)
},
//获取分类
getCategoryList() {
const merchantId = wx.p.storage.get("srcm_shopmall_merchant_id");
const _params = {
merchantId,
categoryType: '2'
}
discoveryApi.getDiscoverChannelCategory(_params).then(res => {
if (res?.length) {
this.setData({
categoryList: res,
categoryStyle: res[0].categoryStyle || 0
})
this.triggerEvent('showShoppingCar', res[0].categoryStyle)
this.getCategoryGoodsList(res[0].id)
}
})
},
//获取商品列表
async getCategoryGoodsList(categoryId) {
const merchantId = wx.p.storage.get("srcm_shopmall_merchant_id");
let _para = {
merchantId,
categoryId,
categoryType: '2'
}
const res = await discoveryApi.getDiscoverChannelCategoryGoods(_para)
console.log(res)
if (res && res.length) {
res.forEach(el => {
el.activityPrice = centsToyuan(el.activityPrice)
el.originalPrice = centsToyuan(el.originalPrice)
})
}
const idx = res.findIndex(item => (item.commerceVideo || item.goodsVideo))
this.setData({
goodsList: [...res] || [],
curPlayIdx: idx > -1 ? idx : 0
})
},
scrollFn(e){
// console.log(e.scrollTop)
// try {
// let idx = this.data.goodsItemTopList.findIndex(item => e.scrollTop+300 < item)
// this.setData({
// curPlayIdx: idx >-1 ? idx : 0
// })
// } catch (error) {
// console.log(error)
// }
// let curPlayId = 'video' + this.data.curPlayIdx
// let videoContext = wx.createvideoContext(curPlayId);
// videoContext.stop();
if(this.data.categoryStyle!=3) return;
const query = wx.createSelectorQuery().in(this)
query.selectAll('.goods_box').boundingClientRect((rect) => {
if(rect?.length){
let curPlayIdx = -1
let goodsItemTopList = rect.map(item => item.top)
let idx = goodsItemTopList.findIndex(item => item > 300)
curPlayIdx = idx-1 >-1 ? idx-1 : 0
const _targetItem = this.data.goodsList[curPlayIdx] || {}
if(!(_targetItem?.commerceVideo || _targetItem?.goodsVideo)){
for(let i = idx; i<this.data.goodsList.length;i++){
if(this.data.goodsList[i]?.commerceVideo || this.data.goodsList[i]?.goodsVideo){
curPlayIdx = i
break;
}
}
}
this.setData({
curPlayIdx: curPlayIdx>-1 ? curPlayIdx : 0
})
}
}).exec() ;
},
// 跳转商品详情
toGoodsDetail(e) {
const {
item
} = e.currentTarget.dataset
const B_userInfo = wx.p.storage.get('userInfo')
if (B_userInfo && B_userInfo.userType) {
wx.navigateTo({
url: '/pages/Login/Login'
})
return
}
if(item.commerceVideo){
const {coverUrl, commerceVideo, commerceDescribe, activityPrice, originalPrice, goodsName, goodsImage,id} = item
wx.$router.go(`/packageShopmall/packageMall/pages/goodsVideo/goodsVideo`, {
id,
notIntercept:true,
coverUrl: goodsImage,
commerceVideo,
commerceDescribe,
activityPrice,
originalPrice,
goodsName,
hasCouponFlag: this.data.hasCarOwnerCouponFlag
});
}else{
wx.$router.go('/packageShopmall/packageMall/pages/detail/detail', {
id: item.id,
hasCouponFlag: this.data.hasCarOwnerCouponFlag,
isCarOwner: true,
notIntercept: true
})
}
},
// imageLoadError(e) {
// this.imageLoaded()
// },
// imageLoaded(e) {
// console.log(e)
// let { goodsList, leftList, rightList } = this.data
// if (!goodsList?.length) return;
// let leftHeight = 0
// let rightHeight = 0
// const query = wx.createSelectorQuery().in(this)
// query.select('.left-box').boundingClientRect();
// query.select('.right-box').boundingClientRect();
// query.exec((res) => {
// if (res[0]) {
// leftHeight = res[0].height; //获取左边列表的高度
// rightHeight = res[1].height; //获取右边列表的高度
// }
// console.log(leftHeight, rightHeight)
// const item = goodsList.shift()
// leftHeight <= rightHeight ? leftList.push(item) : rightList.push(item);
// this.setData({
// leftList,
// rightList
// })
// });
// },
// 获取购物车列表
async getBuyCarList() {
const B_userInfo = wx.p.storage.get('userInfo')
if (B_userInfo && B_userInfo.userType) return;
const merchantId = wx.p.storage.get('srcm_shopmall_merchant_id')
const res = await shopmallApi.getShoppingcartList({
cartType: 4,
merchantId
})
wx.$eventbus.emit('getBuyCarList', res)
},
// 加入购物车
async toAddBuuCar(e) {
if (wx.$authStatus) {
if(this.data.hasCarOwnerCouponFlag){
wx.$router.go(`/packageShopmall/packageMall/pages/getCoupon/getCoupon?discoverGoodsType=2&from=2`, { notIntercept:true });
}else{
wx.navigateTo({
url: '/pages/Login/Login'
})
}
return
}
const {
item
} = e.currentTarget.dataset
let _para = {
goodsId: item.id,
goodsNumber: 1,
cartType: 4
}
const res = await shopmallApi.addShoppingcart(_para)
if (res) {
wx.$api.showToast('添加成功')
this.getBuyCarList()
}
},
getCarOwnerCouponList(){
const merchantId = wx.p.storage.get('srcm_shopmall_merchant_id')
couponsApi.getMerchantCouponsListApi({merchantId, discoverGoodsType: 2}).then(res => {
if(res?.length){
this.setData({
hasCarOwnerCouponFlag: !!res?.length
})
}
})
},
onShow(){
this.getBuyCarList()
}
},
lifetimes: {
ready: function () {
this.getCategoryList()
const B_userInfo = wx.p.storage.get('userInfo')
if(B_userInfo && B_userInfo.userType)return
this.getBuyCarList()
this.getCarOwnerCouponList()
}
}
})
{
"component": true,
"usingComponents": {
}
}
\ No newline at end of file
<view>
<view class="category_wrapper">
<view class="inner">
<scroll-view scroll-into-view="{{toSeri}}" class="scroll" enhanced="{{true}}" show-scrollbar="{{false}}" scroll-x="{{true}}" scroll-with-animation>
<block wx:for="{{categoryList}}" wx:key="index">
<view id="toCategory-{{index}}" data-item="{{item}}" bind:tap="toSelectCategory" data-index="{{index}}" class="image_text">
<view class="box {{curCategoryIdx==index?'box_active':''}}">
<image mode="aspectFill" class="icon" webp src="{{item.categoryImage}}"></image>
<glsx-image wx:if="{{curCategoryIdx==index}}" class="icon_active" webp src="/glsx/discover/version/3_13_0/select_seri.png"></glsx-image>
</view>
<view class="text hide {{curCategoryIdx==index?'text_active':''}}">
{{item.categoryName}}
</view>
</view>
</block>
</scroll-view>
</view>
</view>
<view wx:if="{{categoryStyle>-1}}" class="{{ categoryStyle=='2' ? 'goods_ctnr_waterfall': categoryStyle=='3' ? 'goods_ctnr_grass_B' : categoryStyle=='1' ? 'goods_ctnr_row' : 'goods_ctnr_col' }}">
<view wx:if="{{categoryStyle==0 || categoryStyle==1}}" class="goods_wrap">
<view catch:tap="toGoodsDetail" data-item="{{item}}" class="goods_box" wx:for="{{goodsList}}" wx:key="{{index}}">
<image mode="aspectFill" class="cover" src="{{item.commerceVideo ? item.coverUrl : item.goodsImage}}"/>
<view class="info {{categoryStyle?'flex_cccb':''}}">
<text class="name">{{item.goodsName}}</text>
<block wx:if="{{categoryStyle}}">
<text wx:if="{{item.giveIntegral}}" class="tip">获{{item.giveIntegral}}养车积分</text>
</block>
<view class="price_wrap">
<text>
<text class="unit">¥</text>
<text class="new_price">{{item.activityPrice}}</text>
<text class="old_price">{{item.originalPrice}}</text>
</text>
<glsx-image catch:tap="toAddBuuCar" data-item="{{item}}" class="add_btn" webp src="glsx/discover/version/3_13_0/add_buyCar_icon.png"></glsx-image>
</view>
<block wx:if="{{!categoryStyle}}">
<text wx:if="{{item.giveIntegral}}" class="tip">获{{item.giveIntegral}}养车积分</text>
</block>
</view>
</view>
</view>
<view wx:elif="{{categoryStyle==3}}" class="goods_wrap">
<view catch:tap="toGoodsDetail" data-item="{{item}}" wx:for="{{goodsList}}" wx:key="{{index}}">
<image wx:if="{{item.styleBImg}}" mode="aspectFill" class="publicity-img" src="{{item.styleBImg}}"/>
<view class="goods_box">
<video show-fullscreen-btn="{{false}}" show-play-btn="{{false}}" wx:if="{{curPlayIdx==index && (item.commerceVideo || item.goodsVideo)}}" loop id="video{{index}}" muted="{{false}}" autoplay class="cover" src="{{item.commerceVideo || item.goodsVideo}}"></video>
<image wx:else mode="aspectFill" class="cover" src="{{item.commerceVideo ? item.coverUrl : item.goodsImage}}"/>
<view class="info {{categoryStyle?'flex_cccb':''}}">
<text class="name">{{item.goodsName}}</text>
<text wx:if="{{item.giveIntegral}}" class="tip">获{{item.giveIntegral}}养车积分</text>
<view class="price_wrap">
<text>
<text class="unit">¥</text>
<text class="new_price">{{item.activityPrice}}</text>
<text class="old_price">{{item.originalPrice}}</text>
</text>
<glsx-image catch:tap="toAddBuuCar" data-item="{{item}}" class="add_btn" webp src="glsx/discover/version/3_13_0/add_buyCar_icon.png"></glsx-image>
</view>
</view>
</view>
</view>
</view>
<block wx:else>
<view class="{{parentIndex==0 ? 'left-box' : 'right-box'}}" wx:for-item="parentItem" wx:for-index="parentIndex" wx:for="{{['leftList','rightList']}}" wx:key="{{index}}">
<block wx:for="{{goodsList}}" wx:key="{{index}}">
<view catch:tap="toGoodsDetail" data-item="{{item}}" wx:if="{{index%2 == parentIndex}}" class="goods_box">
<image mode="widthFix" class="cover" src="{{item.commerceVideo ? item.coverUrl : item.goodsImage}}"/>
<view class="info">
<text class="name">{{item.goodsName}}</text>
<text wx:if="{{item.giveIntegral}}" class="tip">获{{item.giveIntegral}}养车积分</text>
<view class="price_wrap">
<text>
<text class="unit">¥</text>
<text class="new_price">{{item.activityPrice}}</text>
<text class="old_price">{{item.originalPrice}}</text>
</text>
</view>
</view>
</view>
</block>
</view>
</block>
<view style="height: 116rpx;">
</view>
</view>
</view>
\ No newline at end of file
Page({
data:{
showCarFlag: false,
currentChannel:{
id:6
}
},
//隐藏购物车
showShoppingCarFn(e){
this.setData({
showCarFlag: e.detail!=2
})
},
})
\ No newline at end of file
{
"usingComponents": {
"carOwner": "./components/CarOwner/CarOwner"
},
"navigationBarTitleText": "商城",
"navigationStyle": "custom"
......
<view class=""></view>
\ No newline at end of file
<!-- <view class=""></view> -->
<!-- 优选 -->
<carOwner id="currentChannel_6" bindshowShoppingCar="showShoppingCarFn" channelID="{{currentChannel.id}}"></carOwner>
\ No newline at end of file
......@@ -51,7 +51,7 @@ class Storage {
* @param {*} syncFlag | 同步状态,默认 false (异步),true 为同步
*/
get = (key, syncFlag = true) => {
console.log(key, '====');
// console.log(key, '====');
// 有值默认取key值
if (key) {
// 判断值是否是指定的对象值
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!