Commit 27be333c by chenwq

滚动条

1 parent 62c7e9fc
...@@ -70,6 +70,24 @@ const battleMessageApi = data => { ...@@ -70,6 +70,24 @@ const battleMessageApi = data => {
}) })
} }
// 获取活动记录全集
const getActivityRecordApi = data => {
return api.post({
method: `entmicro.api.business.activityRecord.list`,
apiProjectName: 'drac',
...data
}, true)
}
// 根据id查询
const getActivityDetailApi = data => {
return api.post({
method: `entmicro.api.business.activityRecord.detail`,
apiProjectName: 'drac',
...data
})
}
module.exports = { module.exports = {
/** 线索埋点数据上报 /** 线索埋点数据上报
* operationType 操作类型(0:分享 1:浏览 2:申请活动) * operationType 操作类型(0:分享 1:浏览 2:申请活动)
...@@ -87,5 +105,7 @@ module.exports = { ...@@ -87,5 +105,7 @@ module.exports = {
pageApi, pageApi,
readApi, readApi,
tagApi, tagApi,
battleMessageApi battleMessageApi,
getActivityRecordApi,
getActivityDetailApi
} }
...@@ -11,7 +11,8 @@ ...@@ -11,7 +11,8 @@
"pages/viewProd/index", "pages/viewProd/index",
"pages/viewProdBanner/index", "pages/viewProdBanner/index",
"pages/measure/measure/measure", "pages/measure/measure/measure",
"pages/measure/measureResult/measureResult" "pages/measure/measureResult/measureResult",
"packagesList/activityDetail/activityDetail"
], ],
"requiredPrivateInfos": [ "requiredPrivateInfos": [
"getLocation" "getLocation"
......
...@@ -8,6 +8,11 @@ ...@@ -8,6 +8,11 @@
"version": "1.10.7", "version": "1.10.7",
"resolved": "https://registry.npmmirror.com/@vant/weapp/-/weapp-1.10.7.tgz", "resolved": "https://registry.npmmirror.com/@vant/weapp/-/weapp-1.10.7.tgz",
"integrity": "sha512-R2FyCk0mK2xvUX2dMgVZjVG512RKBj7ELMDxjRJjhQWtw4495WBgbl5Yb4v2A6d4vWJe6z9toKgDJTciN0Bo9A==" "integrity": "sha512-R2FyCk0mK2xvUX2dMgVZjVG512RKBj7ELMDxjRJjhQWtw4495WBgbl5Yb4v2A6d4vWJe6z9toKgDJTciN0Bo9A=="
},
"glsx-applet-component": {
"version": "1.0.26",
"resolved": "https://registry.npmjs.org/glsx-applet-component/-/glsx-applet-component-1.0.26.tgz",
"integrity": "sha512-piMTmDIUq4x7fpE3/GgZI1pIFV6SlmsJdtm/TxBqM5VG4i38+7bXZSkjqvu3xdb2TIXw6FuA4lq6I/QfVVX7LQ=="
} }
} }
} }
...@@ -4,7 +4,8 @@ ...@@ -4,7 +4,8 @@
"description": "", "description": "",
"main": "app.js", "main": "app.js",
"dependencies": { "dependencies": {
"@vant/weapp": "^1.10.7" "@vant/weapp": "^1.10.7",
"glsx-applet-component": "^1.0.26"
}, },
"devDependencies": {}, "devDependencies": {},
"scripts": { "scripts": {
......
// packagesList/pages/activityDetail/activityDetail.js
import { getActivityDetailApi } from '~/api/index.js'
Page({
/**
* 页面的初始数据
*/
data: {
activityInfo: {}
},
toActivity(){
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
console.log(options)
wx.$router.getData(res => {
console.log(res)
this.getActivityDetail(res.id)
// this.setData({
// hasPhoneNumber: res.hasPhoneNumber
// })
})
},
getActivityDetail(id) {
getActivityDetailApi({id}).then(res => {
res.beginTime = new Date(res.beginTime).format('yyyy年MM月dd日')
res.endTime = new Date(res.endTime).format('yyyy年MM月dd日')
this.setData({
activityInfo: res
})
})
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
}
})
\ No newline at end of file \ No newline at end of file
{
"usingComponents": {}
}
\ No newline at end of file \ No newline at end of file
/* packagesList/pages/activityDetail/activityDetail.wxss */
.activity-detail {
background-color: #F5F5F7;
.swiper {
height: 422rpx;
}
.swiper-img {
width: 100%;
height: 422rpx;
}
}
.activity-introduction {
margin-top: 20rpx;
background-color: #fff;
padding: 24rpx 32rpx;
.activity-title {
font-weight: 500;
font-size: 36rpx;
color: #2D2D33;
}
.activity-content {
margin: 16rpx 0 48rpx;
font-weight: 400;
font-size: 28rpx;
color: #444444;
line-height: 52rpx;
}
.activity-info {
margin-top: 16rpx;
.activity-item {
display: flex;
align-items: center;
margin-bottom: 8rpx;
.activity-icon {
width: 40rpx;
height: 40rpx;
margin-right: 16rpx;
}
.text {
font-weight: 400;
font-size: 28rpx;
color: #444444;
}
}
}
.activity-btn {
margin-top: 48rpx;
margin-bottom: 136rpx;
font-weight: 500;
font-size: 32rpx;
color: #5850FF;
text-align: center;
line-height: 48rpx;
}
}
\ No newline at end of file \ No newline at end of file
<!--packagesList/pages/activityDetail/activityDetail.wxml-->
<view class="activity-detail">
<swiper class="swiper" autoplay circular="true" current="{{current}}" interval="5000">
<swiper-item class="swiper-item">
<video class="swiper-img" src="{{IMGURL}}video/solar.mp4?v={{img_version}}"></video>
</swiper-item>
<swiper-item class="swiper-item">
<image class="swiper-img" webp src="{{IMGURL}}video/solar_bitmap.png?v={{img_version}}"></image>
</swiper-item>
</swiper>
<view class="activity-introduction">
<view class="activity-title">活动介绍</view>
<view class="activity-content">
{{activityInfo.activityEvent}}
</view>
<view class="activity-title">活动举办方</view>
<view class="activity-info">
<view class="activity-item">
<glsx-image custom-class="activity-icon" webp src="image/activity/icon-company.png"></glsx-image>
<view class="text">{{activityInfo.merchantName}}</view>
</view>
<view class="activity-item">
<glsx-image custom-class="activity-icon" webp src="image/activity/icon-address.png"></glsx-image>
<view class="text">兰州鑫通汽车销售有限公司</view>
</view>
<view class="activity-item">
<glsx-image custom-class="activity-icon" webp src="image/activity/icon-time.png"></glsx-image>
<view class="text">{{activityInfo.beginTime + ' - ' + activityInfo.endTime}}</view>
</view>
</view>
<view class="activity-btn" bindtap="toActivity">查看活动详情页面</view>
</view>
</view>
<!-- <phone-number type="{{'scenario'}}" bindtoApplication="toApplication" bindupdatePhoneNumber="updatePhoneNumber" hasPhoneNumber="{{hasPhoneNumber}}"></phone-number> -->
...@@ -3,6 +3,8 @@ import { IMG_URL } from "~/utils/constantData.js"; ...@@ -3,6 +3,8 @@ import { IMG_URL } from "~/utils/constantData.js";
// 导入方法 // 导入方法
import { behavior as computedBehavior } from "~/utils/lib/miniprogram-computed"; import { behavior as computedBehavior } from "~/utils/lib/miniprogram-computed";
import { getActivityRecordApi } from '~/api/index.js'
const videoBaseUrl = const videoBaseUrl =
"https://img02.glsx.com.cn/weapp/resource/miniprogram/ai-card/"; "https://img02.glsx.com.cn/weapp/resource/miniprogram/ai-card/";
...@@ -72,6 +74,8 @@ Component({ ...@@ -72,6 +74,8 @@ Component({
], ],
mainActiveIndex: 0, mainActiveIndex: 0,
contentHeight: 0, contentHeight: 0,
// 滚动条
activityList: [],
// 视频海报 // 视频海报
videoActive: 0, videoActive: 0,
overlayShow: false, overlayShow: false,
...@@ -83,6 +87,7 @@ Component({ ...@@ -83,6 +87,7 @@ Component({
lifetimes: { lifetimes: {
attached() { attached() {
this.setProType(); this.setProType();
this.getActivityRecord()
}, },
ready() { ready() {
// console.log('lifetimes',this) // console.log('lifetimes',this)
...@@ -152,6 +157,30 @@ Component({ ...@@ -152,6 +157,30 @@ Component({
return res; return res;
}, },
// 获取全部活动列表
getActivityRecord() {
getActivityRecordApi({}).then(({data, code, message}) => {
if (code == -1) {
wx.showToast({
title: message,
icon: "none",
duration: 2000,
});
}
this.setData({
activityList: data
})
})
},
// 跳转活动页
activityClick(e) {
// const {hasPhoneNumber} = this.data
const id = e.detail
console.log(e)
wx.$router.go('/packagesList/activityDetail/activityDetail', {id})
},
// 开通 // 开通
openPro() { openPro() {
let obj = { let obj = {
......
...@@ -7,7 +7,8 @@ ...@@ -7,7 +7,8 @@
"van-tree-select": "@vant/weapp/tree-select/index", "van-tree-select": "@vant/weapp/tree-select/index",
"video-item":"../video-item/index", "video-item":"../video-item/index",
"poster-item":"../poster-item/index", "poster-item":"../poster-item/index",
"van-overlay": "@vant/weapp/overlay/index" "van-overlay": "@vant/weapp/overlay/index",
"activity-swiper": "glsx-applet-component/activity-swiper/index"
}, },
"styleIsolation": "shared" "styleIsolation": "shared"
} }
\ No newline at end of file \ No newline at end of file
...@@ -7,7 +7,9 @@ ...@@ -7,7 +7,9 @@
</van-tabs> </van-tabs>
</view> </view>
<view> <view>
<van-notice-bar custom-class="dy-notice" left-icon="{{IMG_URL}}index/ad.png" speed="{{20}}" text="{{scrollText}}" /> <!-- <van-notice-bar custom-class="dy-notice" left-icon="{{IMG_URL}}index/ad.png" speed="{{20}}" text="{{scrollText}}" /> -->
<!-- 滚动条 -->
<activity-swiper activityList="{{activityList}}" bindactivityClick="activityClick"></activity-swiper>
</view> </view>
<view class="pro-cont" id="pro-cont"> <view class="pro-cont" id="pro-cont">
<van-tree-select items="{{ items }}" height="{{contentHeight}}" main-active-index="{{ mainActiveIndex }}" bind:click-nav="onClickNav"> <van-tree-select items="{{ items }}" height="{{contentHeight}}" main-active-index="{{ mainActiveIndex }}" bind:click-nav="onClickNav">
......
...@@ -17,7 +17,7 @@ const systemInfo = wx.getSystemInfoSync() ...@@ -17,7 +17,7 @@ const systemInfo = wx.getSystemInfoSync()
const manual = false const manual = false
const release = false const release = false
let index = 2 let index = 1
// 判断小程序环境 // 判断小程序环境
// develop:开发版(正常开发工具,测试时) // develop:开发版(正常开发工具,测试时)
......
...@@ -20,7 +20,7 @@ class Request { ...@@ -20,7 +20,7 @@ class Request {
'content-type': 'application/x-www-form-urlencoded' 'content-type': 'application/x-www-form-urlencoded'
} }
: {} : {}
let projectName = this.getRopProject(params.method) let projectName = params.apiProjectName || this.getRopProject(params.method)
if (!projectName) projectName = this.getRopProject(params.method) if (!projectName) projectName = this.getRopProject(params.method)
let path = pathEnum[projectName] let path = pathEnum[projectName]
if (!path) path = `/rop-scrm-${projectName}/` if (!path) path = `/rop-scrm-${projectName}/`
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!