Commit 300fef09 by 谢中龙

刮刮卡完成

parent f5cc13cf
...@@ -112,7 +112,8 @@ ...@@ -112,7 +112,8 @@
{ {
"root": "subPackageMarketing/page", "root": "subPackageMarketing/page",
"pages": [ "pages": [
"pages/scratch/scratch" "pages/scratch/scratch",
"pages/scratchRule/scratchRule"
] ]
} }
], ],
......
// component/adDialog/adDialog.js
var app = getApp()
const wxService = require('../../utils/wxService')
const utils = require('../../utils/util')
const envInfo = require('../../config/index').envInfo
Component({
/**
* 组件的属性列表
*/
properties: {
showDialog : {
type: Boolean,
value: false
},
},
/**
* 组件的初始数据
*/
data: {
},
/**
* 组件的方法列表
*/
methods: {
//关闭
onTapClose(){
this.setData({
showDialog :false
});
}
}
})
{
"component": true,
"usingComponents": {}
}
\ No newline at end of file
<!--component/adDialog/adDialog.wxml-->
<view class="ad-modal-bg" wx:if="{{showDialog}}">
<view class="ad-modal-body">
<image mode="widthFix" src="https://hwimagecdn.ihotwind.cn/hotwind-activity/home_get_coupon.png"></image>
<view class="close-dia">
<image src="/assets/imgs/close.png" mode="aspectFit" bindtap="onTapClose"></image>
</view>
</view>
</view>
/* component/adDialog/adDialog.wxss */
.ad-modal-bg{
position: fixed;
z-index: 9999;
width: 100vw;
height: 100vh;
background: rgba(0, 0, 0, 0.5);
left: 0;
top: 0;
display: flex;
justify-content: center;
align-items: center;
}
.ad-modal-bg .ad-modal-body{
width: 70vw;
height: auto;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
}
.ad-modal-bg .ad-modal-body image{
width: 100%;
}
.ad-modal-bg .ad-modal-body .close-dia{
width: 100%;
height: auto;
padding-top: 10rpx;
display: flex;
align-items: center;
justify-content: center;
}
.ad-modal-bg .ad-modal-body .close-dia image{
width: 80rpx;
height: 80rpx;
}
.ad-modal-bg .ad-modal-body .close-dia image:active{
opacity: 0.7;
}
\ No newline at end of file
...@@ -86,7 +86,26 @@ Component({ ...@@ -86,7 +86,26 @@ Component({
swiperChange(e){ swiperChange(e){
this.setData({ this.setData({
swiperCurrent: e.detail.current swiperCurrent: e.detail.current
}) });
this.swiperChangePauseVideo();
},
//切换的时候
swiperChangePauseVideo(){
this.videoContext = [];
this.data.imageData.forEach((item,index) => {
let isVideo = utils.isVideo(item.url || item.videoUrl);
if(isVideo){
this.videoContext.push(wx.createVideoContext('myVideo' + index, this));
} }
});
setTimeout(() => {
this.videoContext.forEach(item => {
item.pause();
});
});
},
} }
}) })
...@@ -10,10 +10,25 @@ ...@@ -10,10 +10,25 @@
class="image-swiper" class="image-swiper"
bindchange="swiperChange" bindchange="swiperChange"
> >
<block wx:for="{{imageData}}" wx:key="{{item}}"> <block wx:for="{{imageData}}" wx:key="*this" wx:for-index="index">
<swiper-item class="swiper-item"> <swiper-item class="swiper-item">
<image src="{{item.url}}" wx:if="{{!item.videoUrl}}" data-appid="{{item.id}}" data-path="{{item.link.url}}" data-link="{{item.link}}" data-item="{{item}}" bindtap='preview' class="slide-image" mode="aspectFit"/> <image src="{{item.url}}"
<video class="slide-image" src="{{utils.formateUrl(item.videoUrl,baseImgUrl)}}" wx:if="{{item.videoUrl}}" controls="true" autoplay="true"></video> wx:if="{{!item.videoUrl}}"
data-appid="{{item.id}}"
data-path="{{item.link.url}}"
data-link="{{item.link}}"
data-item="{{item}}"
bindtap='preview'
class="slide-image"
mode="aspectFit"/>
<video object-fit="cover"
id="myVideo{{index}}"
class="slide-image"
src="{{utils.formateUrl(item.videoUrl,baseImgUrl)}}"
wx:if="{{item.videoUrl}}"
controls="true"
autoplay="true"></video>
</swiper-item> </swiper-item>
</block> </block>
......
/* component/buyImageSwiper/buyImageSwiper.wxss */ /* component/buyImageSwiper/buyImageSwiper.wxss */
swiper {
width: 100%;
}
.image-swiper{ .image-swiper{
height: 425.15rpx; height: 100%;
top: 20rpx; /* top: 20rpx; */
} }
.image-wrap{ .image-wrap{
position: relative; position: relative;
width: 100%; width: 100%;
height: 500rpx; height: 750rpx;
margin-bottom: 30rpx;
} }
.swiper-item{ .swiper-item{
height: 374rpx; height: 100%;
} }
.slide-image { .slide-image {
width: 100%; width: 100%;
...@@ -20,7 +25,7 @@ ...@@ -20,7 +25,7 @@
position: absolute; position: absolute;
left: 0; left: 0;
right: 0; right: 0;
top: 460rpx; top: 730rpx;
display: flex; display: flex;
justify-content: center; justify-content: center;
} }
......
...@@ -110,8 +110,8 @@ Component({ ...@@ -110,8 +110,8 @@ Component({
//获取等级列表 //获取等级列表
getLevelList(){ getLevelList(){
// /member/memberLevel/get // /member/memberLevel/get
// wxService.get('/member/memberLevel/get').then(res => { wxService.get('/member/memberLevelSet/get').then(res => {
wxService.post('/merchant/settingLevel/get').then(res => { // wxService.post('/merchant/settingLevel/get').then(res => {
if(res){ if(res){
let levelList = res.data.data ? res.data.data : []; let levelList = res.data.data ? res.data.data : [];
if (levelList.length == 0){ if (levelList.length == 0){
......
...@@ -102,19 +102,10 @@ Component({ ...@@ -102,19 +102,10 @@ Component({
wxService.nextTick(() => { wxService.nextTick(() => {
this.triggerEvent('getAuth', res); this.triggerEvent('getAuth', res);
}) })
} },
//获取图片高度 //获取图片高度
// imageLoad(e) { imageLoad(e) {
// console.log('height', utils.imageUtil(e))
// let imageSize = utils.imageUtil(e) }
// this.data.imageData.forEach((item)=>{
// item.imageheight = imageSize.imageHeight
// })
// // this.setData({
// // // imagewidth: imageSize.imageWidth,
// // imageheight: imageSize.imageHeight
// // })
// console.log('imageData',this.data.imageData)
// }
} }
}) })
...@@ -3,12 +3,12 @@ ...@@ -3,12 +3,12 @@
<view class="water-wrap {{type == 2 ? 'release-water' : ''}}"> <view class="water-wrap {{type == 2 ? 'release-water' : ''}}">
<view class="left"> <view class="left">
<block wx:for="{{imageData}}" wx:key=""> <block wx:for="{{imageData}}" wx:key="*this">
<template is="water-list" data="{{...item,urlBase}}" wx:if="{{index%2==0}}" /> <template is="water-list" data="{{...item,urlBase}}" wx:if="{{index%2==0}}" />
</block> </block>
</view> </view>
<view class="right"> <view class="right">
<block wx:for="{{imageData}}" wx:key=""> <block wx:for="{{imageData}}" wx:key="*this">
<template is="water-list" data="{{...item, urlBase}}" wx:if="{{index%2==1}}" /> <template is="water-list" data="{{...item, urlBase}}" wx:if="{{index%2==1}}" />
</block> </block>
</view> </view>
...@@ -28,33 +28,13 @@ ...@@ -28,33 +28,13 @@
src="{{utils.formateUrl(url,urlBase)}}" src="{{utils.formateUrl(url,urlBase)}}"
data-id="{{id}}" data-id="{{id}}"
mode="widthFix" mode="widthFix"
lazy-load
bindload="imageLoad" bindload="imageLoad"
/> />
<view class="item-title-box"> <view class="item-title-box">
<view class="item-title">{{headline}}</view> <view class="item-title">{{headline}}</view>
</view> </view>
<view/> <view/>
<!-- 未登錄時 -->
<!-- <view class="share-wrap" wx:if="{{!userIsLogin}}">
<button wx:if="{{!userIsLogin}}"
bindgetuserinfo="_getUserInfo"
open-type='getUserInfo' class="clear-btn">
<view class="share-oprate" catchtap="onTapLike">
<image class="share-img" src="{{contentInfo.type ? '/assets/imgs/heart-primary.png' : '/assets/imgs/heart-default.png'}}" />
<text class="share-number">{{enjoySum || 0}}</text>
</view>
</button>
<button wx:if="{{!userIsLogin}}"
bindgetuserinfo="_getUserInfo"
open-type='getUserInfo' class="clear-btn">
<view class="share-oprate" catchtap="onTapShare">
<image class="share-img" src="/assets/imgs/share.png" />
<text class="share-number">{{transmitSum || 0}}</text>
</view>
</button>
</view> -->
<view class="share-wrap"> <view class="share-wrap">
<view <view
class="share-oprate" class="share-oprate"
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
// 修改 BRANCH_ID 为对应的商户id // 修改 BRANCH_ID 为对应的商户id
// app.js 中brandId 修改为对应 // app.js 中brandId 修改为对应
const PROJECT_ENV = 'prod' // 生产 prod, 开发 dev, 测试 test , 测试门户 test_store, 预生产 pre const PROJECT_ENV = 'dev' // 生产 prod, 开发 dev, 测试 test , 测试门户 test_store, 预生产 pre
//仅生产环境时 配置 : //仅生产环境时 配置 :
//3001 3001 , wx313ec36b710125d4 有直播 //3001 3001 , wx313ec36b710125d4 有直播
//2006 泰华 , wx40fec8944623c8b3 有直播 //2006 泰华 , wx40fec8944623c8b3 有直播
...@@ -25,7 +25,7 @@ const PROJECT_ENV = 'prod' // 生产 prod, 开发 dev, 测试 test , 测试门 ...@@ -25,7 +25,7 @@ const PROJECT_ENV = 'prod' // 生产 prod, 开发 dev, 测试 test , 测试门
//2992 山东盛联微商城 wx53dedc202ae0d0c2 //2992 山东盛联微商城 wx53dedc202ae0d0c2
//2002 巴黎贝甜 wx21968cb3a486d4ab //2002 巴黎贝甜 wx21968cb3a486d4ab
const BRANCH_ID = 2010 const BRANCH_ID = 1001
const isMall = true const isMall = true
// const needMock = '' // // const needMock = '' //
......
...@@ -111,7 +111,10 @@ wxService.page({ ...@@ -111,7 +111,10 @@ wxService.page({
}) })
}, },
goUserCenter() { goUserCenter() {
wxService.router(`/pages/userCenter/userCenter`).replace() // wxService.router(`/pages/userCenter/userCenter`).replace()
wx.reLaunch({
url: '/pages/userCenter/userCenter',
});
}, },
/** /**
* 生命周期函数--监听页面隐藏 * 生命周期函数--监听页面隐藏
......
...@@ -143,6 +143,13 @@ ...@@ -143,6 +143,13 @@
<text class="total-price">¥{{utils.numberFormat(currentOrderList.promotionDiscount)}}</text> <text class="total-price">¥{{utils.numberFormat(currentOrderList.promotionDiscount)}}</text>
</view> </view>
</view> </view>
<!-- 积分抵扣 -->
<view class="coupon">
<view>
<text class="price-label">积分抵扣</text>
<text class="total-price">¥{{0}}</text>
</view>
</view>
<view class="coupon"> <view class="coupon">
<!-- class='coupon-items' --> <!-- class='coupon-items' -->
<view bindtap="selectCoupon"> <view bindtap="selectCoupon">
......
...@@ -17,6 +17,7 @@ ...@@ -17,6 +17,7 @@
type="1" type="1"
image-data="{{contentList}}" image-data="{{contentList}}"
bind:updataLike="gotoLike" bind:updataLike="gotoLike"
url-base="{{baseImgUrl}}"
bind:_onTapShare="_onTapShare" bind:_onTapShare="_onTapShare"
bind:getAuth="_getUserInfo" bind:getAuth="_getUserInfo"
currentHasUserInfo="{{currentHasUserInfo}}" currentHasUserInfo="{{currentHasUserInfo}}"
......
...@@ -82,6 +82,16 @@ wxService.page({ ...@@ -82,6 +82,16 @@ wxService.page({
wx.hideShareMenu() wx.hideShareMenu()
}, },
//跳转商品详情
onTapToProductInfo(e){
let sku = e.currentTarget.dataset.item;
let productId = sku.productId;
wx.navigateTo({
url: '/pages/productDetail/productDetail?id=' + productId,
});
},
//复制 //复制
onTapCopy(e){ onTapCopy(e){
wx.setClipboardData({ wx.setClipboardData({
......
...@@ -40,10 +40,12 @@ ...@@ -40,10 +40,12 @@
<view class="{{packageInfo.statusClass}}">{{packageInfo.statusText}}</view> <view class="{{packageInfo.statusClass}}">{{packageInfo.statusText}}</view>
</view> </view>
<!-- 商品数据 --> <!-- 商品数据 -->
<view class="package-products clear-box" data-id="{{item.id}}" bindtap="handelDetail"> <view class="package-products clear-box" >
<view class="product-item" <view class="product-item"
wx:for="{{packageInfo.sendOutList}}" wx:for="{{packageInfo.sendOutList}}"
wx:for-item="sku" wx:for-item="sku"
data-item="{{sku}}"
bindtap="onTapToProductInfo"
wx:for-index="sIndex" wx:for-index="sIndex"
wx:key="*this"> wx:key="*this">
<image src="{{sku.skuImgUrl ? sku.skuImgUrl : sku.mainImgUrl}}" class="lf-product-img" mode="aspectFit"></image> <image src="{{sku.skuImgUrl ? sku.skuImgUrl : sku.mainImgUrl}}" class="lf-product-img" mode="aspectFit"></image>
......
...@@ -44,6 +44,16 @@ wxService.page({ ...@@ -44,6 +44,16 @@ wxService.page({
} }
}, },
//跳转商品详情
onTapToProductInfo(e){
let sku = e.currentTarget.dataset.item;
let productId = sku.productId;
wx.navigateTo({
url: '/pages/productDetail/productDetail?id=' + productId,
});
},
/** /**
* 页面相关事件处理函数--监听用户下拉动作 * 页面相关事件处理函数--监听用户下拉动作
*/ */
......
...@@ -73,6 +73,8 @@ ...@@ -73,6 +73,8 @@
<view class="product-item" <view class="product-item"
wx:for="{{item.sendOutList}}" wx:for="{{item.sendOutList}}"
wx:for-item="skuInfo" wx:for-item="skuInfo"
data-item="{{skuInfo}}"
bindtap="onTapToProductInfo"
wx:for-index="cIndex" wx:for-index="cIndex"
wx:key="*this"> wx:key="*this">
<image src="{{skuInfo.skuImgUrl ? skuInfo.skuImgUrl : skuInfo.mainImgUrl}}" class="lf-product-img" mode="aspectFit"></image> <image src="{{skuInfo.skuImgUrl ? skuInfo.skuImgUrl : skuInfo.mainImgUrl}}" class="lf-product-img" mode="aspectFit"></image>
......
...@@ -40,6 +40,8 @@ wxService.page({ ...@@ -40,6 +40,8 @@ wxService.page({
y : 0, y : 0,
contactUsModal : false, contactUsModal : false,
apiIsOk : true, apiIsOk : true,
//显示广告
showDialog : true,
}, },
/** /**
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
......
...@@ -17,6 +17,7 @@ ...@@ -17,6 +17,7 @@
"plus": "/component/plus/plus", "plus": "/component/plus/plus",
"go-guid": "/component/goGuid/goGuid", "go-guid": "/component/goGuid/goGuid",
"share-benefit-modal": "/component/shareBenefitModal/shareBenefitModal", "share-benefit-modal": "/component/shareBenefitModal/shareBenefitModal",
"ad-dialog": "/component/adDialog/adDialog",
"cell": "plugin://contactPlugin/cell" "cell": "plugin://contactPlugin/cell"
} }
} }
\ No newline at end of file
...@@ -79,3 +79,6 @@ ...@@ -79,3 +79,6 @@
<!-- 异常 --> <!-- 异常 -->
<exception wx:if="{{!apiIsOk}}" bind:reCall="onTapReCall"/> <exception wx:if="{{!apiIsOk}}" bind:reCall="onTapReCall"/>
<!-- 广告 -->
<!-- <ad-dialog showDialog="{{showDialog}}"/> -->
...@@ -5,6 +5,7 @@ const utils = require('../../utils/util') ...@@ -5,6 +5,7 @@ const utils = require('../../utils/util')
const envInfo = require('../../config/index').envInfo const envInfo = require('../../config/index').envInfo
import { Integer } from '../../utils/integerDigitalConvertion' import { Integer } from '../../utils/integerDigitalConvertion'
const { memberId, member } = wx.getStorageSync('_baseUserInfo') const { memberId, member } = wx.getStorageSync('_baseUserInfo')
const defaultGoodsImg = 'https://img3.bigaka.com/prd/3001/202003/20200331/30019aa78220-546f-41e0-8075-c2feb69e10b8.jpg';
wxService.page({ wxService.page({
/** /**
...@@ -12,6 +13,7 @@ wxService.page({ ...@@ -12,6 +13,7 @@ wxService.page({
*/ */
data: { data: {
contentInfo:[], contentInfo:[],
baseImgUrl: app.globalData.imageUrl,
id:'', id:'',
pageNo:1, pageNo:1,
pageSize:100, pageSize:100,
...@@ -204,6 +206,15 @@ wxService.page({ ...@@ -204,6 +206,15 @@ wxService.page({
if (!res) return false if (!res) return false
const { result, data } = res.data const { result, data } = res.data
if (result == 0) { if (result == 0) {
let shareShowPictureRESDTOList = data.shareShowPictureRESDTOList ? data.shareShowPictureRESDTOList : [];
shareShowPictureRESDTOList.forEach(item => {
if(item.url){
item.url = item.url.indexOf('http') > -1 ? item.url : this.data.baseImgUrl + item.url;
}
if(item.videoUrl){
item.videoUrl = item.videoUrl.indexOf('http') > -1 ? item.videoUrl : this.data.baseImgUrl + item.videoUrl;
}
})
this.setData({ this.setData({
contentInfo: data contentInfo: data
}); });
...@@ -227,7 +238,8 @@ wxService.page({ ...@@ -227,7 +238,8 @@ wxService.page({
//获取内容下商品列表 //获取内容下商品列表
getProList(){ getProList(){
var params = { var params = {
productIds: this.data.contentInfo.productIds productIds: this.data.contentInfo.productIds,
showListUrls : true,
} }
if (this.data.contentInfo.productIds && this.data.contentInfo.productIds.length > 0){ if (this.data.contentInfo.productIds && this.data.contentInfo.productIds.length > 0){
wxService.post(`/sale/product/buyer/listPage?pageNo=${this.data.pageNo}&pageSize=${this.data.pageSize}`, wxService.post(`/sale/product/buyer/listPage?pageNo=${this.data.pageNo}&pageSize=${this.data.pageSize}`,
...@@ -235,8 +247,14 @@ wxService.page({ ...@@ -235,8 +247,14 @@ wxService.page({
if (!res) return false if (!res) return false
const { result, data } = res.data const { result, data } = res.data
if (result == 0 && data.content) { if (result == 0 && data.content) {
let list = data.content ? data.content : [];
list.forEach(item => {
item.indexUrl = utils.getFirstImgUrl(item.listUrls);
item.productImgUrl = item.indexUrl ? item.indexUrl :defaultGoodsImg;
});
this.setData({ this.setData({
proList: data.content proList: list
}) })
} }
}).finally(() => { }).finally(() => {
......
...@@ -34,15 +34,7 @@ scroll-view{ ...@@ -34,15 +34,7 @@ scroll-view{
color: #C09A74; color: #C09A74;
border-bottom: 5rpx solid #C09A74; border-bottom: 5rpx solid #C09A74;
} }
swiper {
width: 100%;
flex: 1;
height:100vh;
/* padding-bottom:20rpx; */
position: absolute;
overflow: scroll;
top: 46rpx;
}
.buy-desc{ .buy-desc{
padding: 0 30rpx; padding: 0 30rpx;
} }
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
}, },
"compileType": "miniprogram", "compileType": "miniprogram",
"libVersion": "2.8.2", "libVersion": "2.8.2",
"appid": "wxe6d270a3e399ade9", "appid": "wxc3b64b09b1d3dfc2",
"projectname": "%E5%BE%AE%E5%95%86%E5%9F%8E", "projectname": "%E5%BE%AE%E5%95%86%E5%9F%8E",
"debugOptions": { "debugOptions": {
"hidedInDevtools": [] "hidedInDevtools": []
...@@ -593,7 +593,7 @@ ...@@ -593,7 +593,7 @@
"id": 81, "id": 81,
"name": "导购发布种草内容", "name": "导购发布种草内容",
"pathName": "shoppingGuid/page/pages/releaseContent/releaseContent", "pathName": "shoppingGuid/page/pages/releaseContent/releaseContent",
"query": "id=690150609835417600", "query": "",
"scene": null "scene": null
}, },
{ {
...@@ -632,10 +632,10 @@ ...@@ -632,10 +632,10 @@
"scene": null "scene": null
}, },
{ {
"id": -1, "id": 87,
"name": "刮刮卡", "name": "刮刮卡",
"pathName": "subPackageMarketing/page/pages/scratch/scratch", "pathName": "subPackageMarketing/page/pages/scratch/scratch",
"query": "", "query": "id=700043642982764548",
"scene": null "scene": null
} }
] ]
......
...@@ -530,8 +530,6 @@ wxService.page({ ...@@ -530,8 +530,6 @@ wxService.page({
* 用户点击右上角分享 * 用户点击右上角分享
*/ */
onShareAppMessage: function (res) { onShareAppMessage: function (res) {
console.log(res)
console.log(this.data.shareModel)
if (res.from == 'button') { if (res.from == 'button') {
return { return {
title: this.data.shareModel.title, title: this.data.shareModel.title,
......
...@@ -310,7 +310,7 @@ wxService.page({ ...@@ -310,7 +310,7 @@ wxService.page({
if(this.data.videoUrl){ if(this.data.videoUrl){
sspList.push({ sspList.push({
cover: 0, cover: 0,
videoUrl: item videoUrl: this.data.videoUrl
}); });
} }
......
...@@ -15,7 +15,7 @@ wxService.page({ ...@@ -15,7 +15,7 @@ wxService.page({
categoryList: [], //分类 categoryList: [], //分类
baseImgUrl: app.globalData.imageUrl, baseImgUrl: app.globalData.imageUrl,
pageNum: 1, pageNum: 1,
pageSize: 3, pageSize: 10,
totalPages: 0, totalPages: 0,
totalElements: 0, totalElements: 0,
currentTab: 0, currentTab: 0,
......
...@@ -5,7 +5,7 @@ const utils = require('../../../../utils/util') ...@@ -5,7 +5,7 @@ const utils = require('../../../../utils/util')
const { memberId } = wx.getStorageSync('_baseUserInfo') const { memberId } = wx.getStorageSync('_baseUserInfo')
import { Integer } from '../../../../utils/integerDigitalConvertion' import { Integer } from '../../../../utils/integerDigitalConvertion'
const envInfo = require('../../../../config/index').envInfo const envInfo = require('../../../../config/index').envInfo
const defaultGoodsImg = 'https://img3.bigaka.com/prd/3001/202003/20200331/30019aa78220-546f-41e0-8075-c2feb69e10b8.jpg';
wxService.page({ wxService.page({
/** /**
...@@ -13,6 +13,7 @@ wxService.page({ ...@@ -13,6 +13,7 @@ wxService.page({
*/ */
data: { data: {
id: '', id: '',
baseImgUrl: app.globalData.imageUrl,
showDialig: false, showDialig: false,
showCardModal: false, showCardModal: false,
currentShareContent: null, currentShareContent: null,
...@@ -136,7 +137,6 @@ wxService.page({ ...@@ -136,7 +137,6 @@ wxService.page({
//跳转商品详情 //跳转商品详情
onTapToGoodsInfo(e) { onTapToGoodsInfo(e) {
console.log('0000',e)
let item = e.currentTarget.dataset.item; let item = e.currentTarget.dataset.item;
let productId = e.currentTarget.dataset.productid; let productId = e.currentTarget.dataset.productid;
//组装一个临时触点信息对象到本地 //组装一个临时触点信息对象到本地
...@@ -161,15 +161,21 @@ wxService.page({ ...@@ -161,15 +161,21 @@ wxService.page({
//获取内容下商品列表 //获取内容下商品列表
getProList() { getProList() {
var params = { var params = {
productIds: this.data.contentInfo.productIds productIds: this.data.contentInfo.productIds,
showListUrls : true,
} }
if (this.data.contentInfo.productIds && this.data.contentInfo.productIds.length > 0) { if (this.data.contentInfo.productIds && this.data.contentInfo.productIds.length > 0) {
wxService.post(`/sale/product/buyer/listPage?pageNo=${this.data.pageNo}&pageSize=${this.data.pageSize}`, params).then(res => { wxService.post(`/sale/product/buyer/listPage?pageNo=${this.data.pageNo}&pageSize=${this.data.pageSize}`, params).then(res => {
if (!res) return false if (!res) return false
const { result, data } = res.data const { result, data } = res.data
if (result == 0 && data.content) { if (result == 0 && data.content) {
let list = data.content ? data.content : [];
list.forEach(item => {
item.indexUrl = utils.getFirstImgUrl(item.listUrls);
item.productImgUrl = item.indexUrl ? item.indexUrl :defaultGoodsImg;
});
this.setData({ this.setData({
proList: data.content proList: list
}) })
} }
}).finally(() => { }).finally(() => {
...@@ -185,13 +191,22 @@ wxService.page({ ...@@ -185,13 +191,22 @@ wxService.page({
userId: memberId userId: memberId
}).then(res => { }).then(res => {
if (!res) return false if (!res) return false
const { result, data } = res.data const { result, data } = res.data;
console.log('content info ----------------------------------')
console.log(data)
if (result == 0) { if (result == 0) {
let shareShowPictureRESDTOList = data.sspList ? data.sspList : [];
shareShowPictureRESDTOList.forEach(item => {
if(item.url){
item.url = item.url.indexOf('http') > -1 ? item.url : this.data.baseImgUrl + item.url;
}
if(item.videoUrl){
item.videoUrl = item.videoUrl.indexOf('http') > -1 ? item.videoUrl : this.data.baseImgUrl + item.videoUrl;
}
});
this.setData({ this.setData({
contentInfo: data contentInfo: data
}) });
this.getProList() this.getProList()
} }
...@@ -346,7 +361,6 @@ wxService.page({ ...@@ -346,7 +361,6 @@ wxService.page({
//修改为参数memberId //修改为参数memberId
var path = `pages/wantToBuyDetail/wantToBuyDetail`; var path = `pages/wantToBuyDetail/wantToBuyDetail`;
const { memberId, member } = wx.getStorageSync('_baseUserInfo') const { memberId, member } = wx.getStorageSync('_baseUserInfo')
console.log('--------------------memberId-=---', memberId)
if (memberId) { if (memberId) {
let m = Integer.digit(memberId, 10, 64); let m = Integer.digit(memberId, 10, 64);
let contentId = Integer.digit(this.data.contentInfo.id,10,64); let contentId = Integer.digit(this.data.contentInfo.id,10,64);
......
...@@ -20,7 +20,7 @@ page{ ...@@ -20,7 +20,7 @@ page{
margin-bottom: 30rpx; margin-bottom: 30rpx;
} }
.detail-desc { .detail-desc {
min-height: 486rpx; /* min-height: 486rpx; */
line-height: 23px; line-height: 23px;
color: rgba(0, 0, 0, 1); color: rgba(0, 0, 0, 1);
font-size: 30rpx; font-size: 30rpx;
......
...@@ -2,7 +2,9 @@ ...@@ -2,7 +2,9 @@
<import src="../../components/scratch/scratch.wxml" /> <import src="../../components/scratch/scratch.wxml" />
<!-- 布局 --> <!-- 布局 -->
<!-- style="background-image:url(https://img3.bigaka.com/test/1002/202004/20200413/10021096c17c-fbc6-49a8-a53c-8bbf0502df44.jpg)" --> <!-- style="background-image:url(https://img3.bigaka.com/test/1002/202004/20200413/10021096c17c-fbc6-49a8-a53c-8bbf0502df44.jpg)" -->
<view class="acticity-bg" style="background-image:url(https://img3.bigaka.com/test/1002/202004/20200413/10021096c17c-fbc6-49a8-a53c-8bbf0502df44.jpg)">
<block wx:if="{{!hasNoActivity}}">
<view class="acticity-bg" style="background-image:url({{activityInfo.welcomeImage}})">
<!-- 展示还有几次 --> <!-- 展示还有几次 -->
<view class="scratch-count">您还有{{leftNum}}次刮奖机会</view> <view class="scratch-count">您还有{{leftNum}}次刮奖机会</view>
<view class="scratch-area" style="background-image:url(https://img3.bigaka.com/test/1002/202004/20200413/1002cc8ea3b2-7697-48e7-85e5-76e937f611e8.png)"> <view class="scratch-area" style="background-image:url(https://img3.bigaka.com/test/1002/202004/20200413/1002cc8ea3b2-7697-48e7-85e5-76e937f611e8.png)">
...@@ -10,15 +12,23 @@ ...@@ -10,15 +12,23 @@
<template is = "scratch" data = "{{scratch, isScroll}}"></template> <template is = "scratch" data = "{{scratch, isScroll}}"></template>
</view> </view>
</view> </view>
<!-- 未登录 -->
<view class="scratch-btn" bindtap="onClickStartScratch">{{btnName}}</view> <button wx:if="{{!currentHasUserInfo}}"
</view> bindgetuserinfo="_getUserInfo"
<!-- 查看规则 --> class="scratch-btn"
<view class="view-rule">查看规则</view> open-type='getUserInfo'>登录刮奖</button>
<!-- <view wx:if="{{currentHasUserInfo && btnName == '再刮一次'}}" class="scratch-btn" bindtap="onClickStartScratch">{{btnName}}</view> -->
</view>
<!-- 查看规则 -->
<view class="view-rule" bindtap="onTapToRule">查看规则</view>
</block>
<!-- loading --> <!-- loading -->
<loading wx:if="{{loading}}"/> <loading wx:if="{{loading}}"/>
<!-- 未获取活动信息时 -->
<view wx:if="{{hasNoActivity}}"></view>
...@@ -69,7 +69,10 @@ view{ ...@@ -69,7 +69,10 @@ view{
.scratch-btn{ .scratch-btn{
width: 35vw; width: 35vw;
height: 70rpx; height: 70rpx;
background: #ffffff; background: #ffe88e;
/* background: transparent; */
/* border: solid 1rpx #ffffff; */
color: #ffffff;
font-size: 28rpx; font-size: 28rpx;
display: flex; display: flex;
align-items: center; align-items: center;
......
/**app.wxss**/
.container {
height: 100%;
display: flex;
flex-direction: column;
align-items: center;
justify-content: space-between;
padding: 200rpx 0;
box-sizing: border-box;
}
.wpl {
white-space:pre-line;
}
/* 主题色 */
.theme-color {
background-color: #cb3c3c;
}
.theme-text-color {
color: #cb3c3c;
}
.empty{
width: 100%;
height: 200rpx;
display: flex;
color: #999999;
justify-content: center;
align-items: center;
font-size: 24rpx;
}
.no-more-data{
width: 100%;
height: auto;
padding: 20rpx 0;
display: flex;
color: #999999;
justify-content: center;
align-items: center;
font-size: 24rpx;
}
/* 按钮样式 */
.btn {
width: 100%;
margin-left: 0;
margin-right: 0;
padding-left: 0;
padding-right: 0;
border-radius: 0;
}
.btn:active {
opacity: 0.5;
}
.btn-default {
background: none;
color: #808080;
border: 1px solid #808080;
}
.btn-primary {
background-color: #cb3c3c;
color: #ffffff;
border: 1px solid #cb3c3c;
font-size: 25rpx;
}
.btn-gray {
background-color: #959595;
color: #ffffff;
border: 1px solid #959595;
font-size: 25rpx;
}
.btn-outline {
background: none;
color: #cb3c3c;
}
.clear-btn{
appearance: none;
border: none;
background: transparent;
margin: 0;
}
.positionRe{
position: relative;
}
.positionAbs{
position: absolute;
z-index: 2;
width: 100%;
height: 100%;
left: 0;
top: 0;
}
/* 按钮大小 */
.btn-xs {
height: 39rpx;
line-height: 39rpx;
}
.btn-sm {
height: 46rpx;
line-height: 46rpx;
}
.btn-lg {
height: 88rpx;
line-height: 88rpx;
}
.fixed-bottom0 {
position: fixed;
bottom: 0;
width: 100%;
z-index: 9999;
}
.pr {
float: right;
}
.df {
display: flex;
align-items: center;
justify-content: center;
}
/*文字居中*/
.tc {
text-align: center;
}
.df-1 {
flex: 1;
}
// subPackageMarketing/page/pages/scratchRule/scratchRule.js
const wxService = require('../../../../utils/wxService')
const utils = require('../../../../utils/util')
wxService.page({
/**
* 页面的初始数据
*/
data: {
ruleSrc : ''
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
let rule = options.rule ? decodeURIComponent(options.rule) : null;
this.data.ruleSrc = rule;
this.setData({
ruleSrc : this.data.ruleSrc
});
wx.hideShareMenu();
},
})
\ No newline at end of file
{
"disableScroll": true,
"navigationBarTitleText": "刮刮卡",
"usingComponents": {}
}
\ No newline at end of file
<!--subPackageMarketing/page/pages/scratchRule/scratchRule.wxml-->
<image mode="widthFix" src="{{ruleSrc}}"></image>
/* subPackageMarketing/page/pages/scratchRule/scratchRule.wxss */
page{
box-sizing: border-box;
-webkit-box-sizing: border-box;
}
view{
box-sizing: border-box;
-webkit-box-sizing: border-box;
}
image{
display: block;
width: 100%;
}
\ No newline at end of file
...@@ -12,7 +12,8 @@ ...@@ -12,7 +12,8 @@
.wxParser-inline { .wxParser-inline {
display: inline; display: inline;
margin: 0; margin: 0;
padding: 0; } padding: 0;
}
.wxParser-div { .wxParser-div {
margin: 0; margin: 0;
......
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