Commit daf31429 by 前端

Merge branch 'v3.11.1' into 'master'

V3.11.1

See merge request !22
2 parents 6f1c1085 59afe212
......@@ -10,15 +10,17 @@ import ssoApi from './ssoApi'
import wechatApi from './wechatApi'
import entmicroApi from './entmicroApi'
import businessApi from './businessApi'
import busassistantApi from './busassistantApi'
module.exports = {
ssoApi,
entmicroApi,
wechatApi,
businessApi,
busassistantApi,
commonApi: {
/**获取图片版本号 */
getMockConfig() {
return api.getMock()
},
}
}
}
\ No newline at end of file
import api from "./request";
module.exports = {
// 获取小程序首页数据列表
getDiscoverList(data) {
return api.post({
method: 'scrm.api.busassistant.discover.weapp.list',
...data
},
true
)
},
// 获取特色产品内容详情
getDiscoverDetail(data) {
return api.post({
method: 'scrm.api.busassistant.discover.content.detail',
...data
},
true
)
},
// 获取案例视频、操作指引详情
getDetailWithLike(data) {
return api.post({
method: 'scrm.api.busassistant.discover.content.detailWithLike',
...data
},
true
)
},
// 获取一级菜单下所在类别所有数据
getContentList(data) {
return api.post({
method: 'scrm.api.busassistant.discover.weapp.contentList',
...data
},
true
)
},
}
\ No newline at end of file
......@@ -47,6 +47,7 @@ const domain = {
ip: "http://192.168.3.181:8394",
dev: "https://scrm.dev.glsx.com.cn",
uat: "https://scrm.test.glsx.com.cn",
// uat: "https://scrm.glsx.com.cn",
beta: "https://scrm.beta.glsx.com.cn",
prod: "https://scrm.glsx.com.cn",
}[target[index]];
......
......@@ -11,7 +11,7 @@ env.includes(accountInfo.miniProgram.envVersion) &&
import router from './router/index.js'
import util from './utils/util.js'
import './utils/Track'
import { ssoApi, wechatApi } from './api/api'
import { ssoApi, wechatApi, busassistantApi } from './api/api'
import { trackData } from './utils/data'
// import eventbus from './utils/evenbus'
// 实例化对象存储
......@@ -44,6 +44,7 @@ App({
})
},
login(returnResponse) {
console.log(222);
let _this = this
let openId = null
let wechatInfo = null
......@@ -88,6 +89,12 @@ App({
case 'SHARE_D':
wx.$storage.set('scene', wx.$trackData)
break
case 'SHARE_PRO':
wx.$storage.set('scene', wx.$trackData)
break
case 'SHARE_VIDEO':
wx.$storage.set('scene', wx.$trackData)
break
default:
if (wx.$trackData.cardId) {
wx.$storage.set('scene', wx.$trackData)
......@@ -97,7 +104,8 @@ App({
})
}
})
.catch(() => {
.catch((err) => {
console.log(err)
wx.$authStatus = true
reject()
})
......@@ -141,6 +149,16 @@ App({
})
})
},
// 获取公共数据
getBaseData() {
console.log("method")
return new Promise((resolve, reject) => {
busassistantApi.getDiscoverList().then(res => {
console.log(res, '555');
resolve(res.data)
})
})
},
/**
* 下载小程序新版本并重启应用
......
......@@ -32,7 +32,8 @@
"phone-number": "components/PhoneNumber/PhoneNumber",
"navigation-bar": "/components/NavigationBar/NavigationBar",
"glsx-image": "/components/image/index",
"loadding": "/components/loadding/loadding"
"loadding": "/components/loadding/loadding",
"no-product": "/components/NoProduct/index"
},
"resolveAlias": {
"~/*": "/*"
......
// components/NoProduct/index.js
Component({
/**
* 组件的属性列表
*/
properties: {
},
/**
* 组件的初始数据
*/
data: {
IMG_URL: 'https://img02.glsx.com.cn/weapp/resource/saas/business-assistant/',
img_version: 'v1.0.0'
},
/**
* 组件的方法列表
*/
methods: {
}
})
{
"component": true,
"usingComponents": {}
}
\ No newline at end of file
/* components/NoProduct/index.wxss */
.no-product {
height: 100vh;
font-weight: 500;
font-size: 48rpx;
color: #2D2D33;
text-align: center;
margin-top: 340rpx;
&-img {
width: 434rpx;
height: 276rpx;
margin-bottom: 50rpx;
}
}
\ No newline at end of file
<!--components/NoProduct/index.wxml-->
<view class="no-product">
<image class="no-product-img" src="{{IMG_URL}}index/productImgs/no-product.png?v={{img_version}}" />
<view>产品已下架</view>
</view>
......@@ -35,7 +35,7 @@ Component({
hasPhone: n
})
}
}
},
},
/**
* 组件的初始数据
......@@ -67,7 +67,7 @@ Component({
this.setData({
hasPhone: true
})
if(type == 'home') this.jump()
if (this.data.type == 'home') this.jump()
} else {
wx.showToast({
title: message,
......
// packagesList/pages/productDetail/components/proDetail/proDetail.js
import { senceData, productData1 } from '~/pages/tab/index/constant/senceData'
// import { senceData, productData1 } from '~/pages/tab/index/constant/senceData'
const norTabList = ['海报案例', '测算营销', '产品介绍', '项目亮点']
import { componentsMixin } from "../../mixins/index";
Component({
......@@ -9,35 +9,17 @@ Component({
* 组件的属性列表
*/
properties: {
// 场景值下标
actNum: {
type: Number,
value: -1,
observer(n) {
this.getInfo()
if (n == 3) {
this.setVideoCtx()
}
this.getImgHeight()
}
detailType: {
type: String,
value: 'pro'
},
// 选中的产品
activeNavIdx: {
type: Number,
value: 0
proDetail: {
type: Object,
value: {}
},
cardInfo: {
type: Object,
value: {}
},
// 配置url
activeUrl: {
type: String,
value: ''
},
detailType: {
type: String,
value: 'pro'
}
},
......@@ -47,7 +29,7 @@ Component({
data: {
IMG_URL: 'https://img02.glsx.com.cn/weapp/resource/saas/business-assistant/',
videoBaseUrl: 'https://img02.glsx.com.cn/weapp/resource/saas/business-assistant/index/',
productData: productData1,
// productData: productData1,
proInfo: {},
prodItemVideo: '', //选中的场景下的video的第一个
tabAct: 0,
......@@ -79,26 +61,58 @@ Component({
let { attr } = e.currentTarget.dataset
this.data[attr] && this.data[attr].pause()
},
getInfo() {
let { activeNavIdx, actNum } = this.data
const spcList = [99] // 订阅模块需要特殊处理
const senceList = productData1[actNum].filter(item => item.name != '全部')
for (let i = 0; i < senceList.length; i++) {
let item = senceList[i]
let proIdList = item?.productList.map(k => k.id)
if (proIdList.includes(activeNavIdx)) {
let proInfo = item.productList.find(k => k.id == activeNavIdx)
// getInfo() {
// let { activeNavIdx, actNum } = this.data
// const spcList = [99] // 订阅模块需要特殊处理
// const senceList = productData1[actNum].filter(item => item.name != '全部')
// for (let i = 0; i < senceList.length; i++) {
// let item = senceList[i]
// let proIdList = item?.productList.map(k => k.id)
// if (proIdList.includes(activeNavIdx)) {
// let proInfo = item.productList.find(k => k.id == activeNavIdx)
// this.setData({
// proInfo,
// // productImgs: spcList.includes(actNum) ? proInfo.sceneImgs : item.productImgs,
// productImgs: spcList.includes(actNum) ? proInfo.sceneImgs : (proInfo.productImgs ? proInfo.productImgs : item.productImgs),
// tabList: spcList.includes(actNum) ? proInfo.tabList : norTabList,
// prodItemVideo: item.videoList.length ? spcList.includes(actNum) ?item.videoList[proInfo.currentIndex] : item.videoList[activeNavIdx] : item.noVideoPicture[0]
// })
// break
// }
// }
// },
async loadImg(e){
this.data.loadedNum += 1
if(e.currentTarget.dataset.len==this.data.loadedNum){
let imgTopArr = [];
const topList = await this.getDomInfo('.calc-wrap')
const top = topList.reduce((prev, cur)=>{
return prev + cur.height;
}, 0)
imgTopArr.push(top)
const imgList = await this.getDomInfo('.img-items')
imgList.reduce((prev, cur, index)=>{
if(index<imgList.length-1){
imgTopArr.push(prev + cur.height)
}
return prev + cur.height;
}, top)
this.setData({
proInfo,
// productImgs: spcList.includes(actNum) ? proInfo.sceneImgs : item.productImgs,
productImgs: spcList.includes(actNum) ? proInfo.sceneImgs : (proInfo.productImgs ? proInfo.productImgs : item.productImgs),
tabList: spcList.includes(actNum) ? proInfo.tabList : norTabList,
prodItemVideo: item.videoList.length ? spcList.includes(actNum) ?item.videoList[proInfo.currentIndex] : item.videoList[activeNavIdx] : item.noVideoPicture[0]
imgTopArr
})
break
}
}
},
},
getDomInfo(dom){
return new Promise((resolve,reject)=>{
let query = wx.createSelectorQuery().in(this);
query
.selectAll(dom)
.boundingClientRect((rt) => {
resolve(rt)
})
.exec();
})
},
getImgHeight() {
let query = wx.createSelectorQuery().in(this)
let heightArr = []
......@@ -122,10 +136,10 @@ Component({
.exec()
},
// 1.3查看活动详情按钮
checkActive() {
let { activeUrl } = this.data
wx.$router.jumpH5(activeUrl);
checkActive(e) {
console.log(e);
let { url } = e.currentTarget.dataset
wx.$router.jumpH5(url);
},
onClickTab(event) {
console.log(event, '--');
......@@ -162,21 +176,30 @@ Component({
},
// 长按图片
handleLongPress(e) {
let { actnum, index } = e.target.dataset
// 膨胀金活动,合作方式
if (actnum == 99 && index == 4) {
wx.downloadFile({
url: 'https://scrm.glsx.com.cn/frontpdf/expand_agreement.pdf',
success: function (res) {
const filePath = res.tempFilePath
wx.openDocument({
filePath: filePath,
success: function (res) {
}
})
}
})
}
}
console.log(e);
let {item} = e.currentTarget.dataset
// 如果图片有长按事件 posterEventType: 1-无 2-有
if (item.posterEventType == 1) return
wx.downloadFile({
url: item.posterEventUrl,
success: function (res) {
const filePath = res.tempFilePath
wx.openDocument({
filePath: filePath,
success: function (res) {
}
})
}
})
},
// 点击拨打电话
phoneCall(e) {
console.log(e);
let { phone } = e.currentTarget.dataset;
// wx.$api.phoneCall(phone);
wx.makePhoneCall({
phoneNumber: phone,
});
},
}
})
<!-- packagesList/pages/productDetail/components/proDetail/proDetail.wxml -->
<view class="view-prod custom-class">
<view class="pro-head">
<view class="select-card" wx:if="{{detailType == 'pro'}}" bindtap="selectCard">
<glsx-image custom-class="icon-card" src="home/icon-card.png"></glsx-image>
<view>{{showCard ? '视频' : '名片'}}</view>
</view>
<!-- 有视频 -->
<view class="select-card" wx:if="{{detailType == 'pro'}}" bindtap="selectCard">
<glsx-image custom-class="icon-card" src="home/icon-card.png"></glsx-image>
<view>{{showCard ? '视频' : '名片'}}</view>
</view>
<block wx:if="{{!showCard}}">
<!-- <video class="frame" wx:if="{{actNum != 2}}" src="{{prodItemVideo.videoUrl}}" /> -->
<video class="frame" id="video" wx:if="{{actNum != 2}}" src="{{prodItemVideo.videoUrl}}" bindplay="handleVideoPlay" data-attr="crowdVideoCtx"/>
<image class="no-video" wx:if="{{actNum == 2}}" src="{{prodItemVideo.posterUrl}}?v={{img_version}}" />
<!-- 产品详情是视频 -->
<!-- mediaType: 1-图片,2-视频 -->
<video class="frame" id="video" wx:if="{{proDetail.mediaType == '2'}}" src="{{proDetail.vedioUrl}}" bindplay="handleVideoPlay" data-attr="crowdVideoCtx" />
<!-- 产品详情是图片 -->
<image class="no-video" wx:if="{{proDetail.mediaType == '1'}}" src="{{proDetail.imageUrl}}?v={{img_version}}" />
<!-- 标题+视频时展示观看人数 -->
<view class="title-wrap">
<view class="title">{{prodItemVideo.name}}</view>
<image class="check" wx:if="{{actNum != 2}}" src="{{IMG_URL}}index/poster/check.png?v={{img_version}}" />
<view class="num" wx:if="{{actNum != 2}}">{{prodItemVideo.view}}</view>
<view class="title">{{proDetail.title}}</view>
<image class="check" wx:if="{{proDetail.mediaType != '1'}}" src="{{IMG_URL}}index/poster/check.png?v={{img_version}}" />
<view class="num" wx:if="{{proDetail.mediaType != '1'}}">{{proDetail.view}}</view>
</view>
</block>
<user-info wx:if="{{detailType == 'pro' && showCard}}" class="card-info" cardInfo="{{cardInfo}}"></user-info>
</view>
<!-- tab菜单 -->
<view class="tab-wrap">
<van-tabs sticky bind:click="onClickTab" active="{{tabAct}}">
<van-tab wx:for="{{tabList}}" title="{{item}}" wx:key="idnex" />
<!-- <van-tab title="合作案例" />
<van-tab title="合作方式" />
<van-tab title="适配产品" /> -->
<van-tab wx:for="{{proDetail.detailList}}" title="{{item.name}}" wx:key="idnex" />
</van-tabs>
</view>
<!-- 详情介绍 -->
<view class="prod-detail">
<block wx:for="{{productImgs}}" wx:key="index">
<!-- <image webp wx:if="{{ index < 3}}" mode="widthFix" class="img-items" webp src="{{item.url?item.url:item}}?v={{img_version}}"> -->
<image webp wx:if="{{ index < 3}}" mode="widthFix" class="img-items" src="{{item.url?item.url:item}}?v={{img_version}}">
<block wx:for="{{proDetail.detailList}}" wx:key="index">
<image webp mode="widthFix" class="img-items" src="{{item.posterUrl}}?v={{img_version}}" bindlongpress="handleLongPress" data-item="{{item}}">
<!-- 第一张图的点击拨打电话事件 -->
<block wx:if="{{ index == 0}}">
<!-- && phone -->
<view class="phone" bindtap="phoneCall" data-phone="{{phone}}">
<!-- <image src="{{IMGURL}}share-phone.png?v={{img_version}}" class="icon"></image> -->
<!-- <glsx-image webp src="index/phone.png" class="icon" />
请联系我 -->
<view style="color:#3666fe">{{sharephone}}</view>
<view class="phone" bindtap="phoneCall" data-phone="{{proDetail.phone}}">
<image src="{{IMGURL}}share-phone.png?v={{img_version}}" class="icon"></image>
<glsx-image webp src="index/phone.png" class="icon" />
请联系我
<view style="color:#3666fe">{{proDetail.phone}}</view>
</view>
</block>
<!-- 查看活动那个详情 1.3才有 -->
<!-- <block wx:if="{{ index == 1 && actNum == 3 && activeUrl}}"> -->
<block wx:if="{{ index == 0 && actNum == 3 && activeUrl}}">
<view class="check-act" bindtap="checkActive">点击查看活动页面</view>
<!-- <button class="check-act" type="default" plain="true" bindtap="checkActive">查看活动详情</button> -->
<!-- 如果有活动跳转 -->
<!-- 按钮点击事件 buttonClickEvent:1-无 2-有 -->
<block wx:if="{{ item.buttonEventType == 2 }}">
<view class="check-act" bindtap="checkActive" data-url="{{item.buttonEventUrl}}">{{item.buttonEventName}}</view>
</block>
<!-- 获取更多详情 -->
<block wx:if="{{ index == 2 && showLeftFlag}}">
<!-- <block wx:if="{{ index == 2 && showLeftFlag}}">
<button class="more-btn" data-index="{{index}}" bindgetphonenumber="getUserInfo" open-type="getPhoneNumber">
点击查看更多详情
</button>
</block> -->
<!-- 如果有视频 -->
<block wx:if="{{ item.videoUrl }}">
<video class="crowd-video" id="crowd-video" bindplay="handleVideoPlay" data-attr="videoCtx" src="{{item.videoUrl}}" />
</block>
</image>
<!-- <image webp wx:if="{{ index >= 3 && !showLeftFlag}}" webp class="img-item {{item.className?item.className:''}} img-item{{index}} img-item{{actNum}}{{index}}" src="{{item.url?item.url:item}}?v={{img_version}}" bindlongpress="handleLongPress" data-actnum="{{actNum}}" data-index="{{index}}" /> -->
<image webp wx:if="{{ index >= 3 && !showLeftFlag}}" mode="widthFix" webp class="img-items {{item.className?item.className:''}}" src="{{item.url?item.url:item}}?v={{img_version}}" bindlongpress="handleLongPress" data-actnum="{{actNum}}" data-index="{{index}}">
<!-- 众筹-视频 -->
<block wx:if="{{ index == 3 && actNum == 3 }}">
<!-- <video class="crowd-video" src="{{videoBaseUrl}}video/crowd-detail.mp4" /> -->
<video class="crowd-video" id="crowd-video" bindplay="handleVideoPlay" data-attr="videoCtx" src="{{videoBaseUrl}}video/crowd-detail.mp4" />
</block>
</image>
</block>
<view class="occupancy" wx:if="{{!isShare}}">
<!-- padding底部 占位元素 -->
</view>
</view>
</view>
<!-- 申请按钮 不是分享出去的显示按钮 -->
<!-- <apply-button wx:if="{{!isShare}}" downShow="{{false}}"></apply-button> -->
<!-- 授权昵称 -->
<!-- <view wx:if="{{authNcknameShow}}" class="user-profile" bindtap="getUserProfile"></view> -->
\ No newline at end of file
</view>
\ No newline at end of file
......@@ -10,9 +10,9 @@
"integrity": "sha512-hFJ48SCSvRgcwT/9TcxwNnNnWSpy2BpaBfwQwVdU6uwgFH+2OqGL435VQN7EDpIMH8YjHbiM84hueTyxAzIPqQ=="
},
"glsx-applet-component": {
"version": "1.1.3",
"resolved": "https://registry.npmjs.org/glsx-applet-component/-/glsx-applet-component-1.1.3.tgz",
"integrity": "sha512-Ze+HdtFJImhOsWLfV+ZzB86Kf18pm9M9CZWhctPel/qJNMEn29g9ywC16NXmeac+gTu07MOpURyF+YmO8ojkJA=="
"version": "1.1.16",
"resolved": "https://registry.npmjs.org/glsx-applet-component/-/glsx-applet-component-1.1.16.tgz",
"integrity": "sha512-XlBqP5ja4TqGB0nTW4dW6fdSQ9m/hAspbBKTJZ9CNUGVCKorkyjv/RfY85ta4OU5PiQCKTFZBbTELtz5MoxaVQ=="
}
}
}
......@@ -5,7 +5,7 @@
"main": "app.js",
"dependencies": {
"@vant/weapp": "^1.10.9",
"glsx-applet-component": "^1.1.3"
"glsx-applet-component": "^1.1.16"
},
"devDependencies": {},
"scripts": {
......
<!--packagesList/pages/productDetail/productDetail.wxml-->
<loadding wx:if="{{isLoadding}}"></loadding>
<view wx:if="{{!isLoadding}}">
<pro-detail id="pro-detail" custom-class="{{!hasPhoneNumber?'max_page_height':''}}" activeUrl="{{activeUrl}}" actNum="{{actNum}}" cardInfo="{{cardInfo}}" activeNavIdx="{{activeNavIdx}}" currentIndex="{{currentIndex}}"></pro-detail>
<view wx:if="{{!isLoadding && hasProduct}}">
<!-- <pro-detail id="pro-detail" custom-class="{{!hasPhoneNumber?'max_page_height':''}}" activeUrl="{{activeUrl}}" actNum="{{actNum}}" cardInfo="{{cardInfo}}" activeNavIdx="{{activeNavIdx}}" currentIndex="{{currentIndex}}"></pro-detail> -->
<pro-detail id="pro-detail" custom-class="{{!hasPhoneNumber?'max_page_height':''}}" cardInfo="{{cardInfo}}" proDetail="{{productData}}"></pro-detail>
<pro-phone-number custom-class="pro_phone_number" type="product" hasPhoneNumber="{{hasPhoneNumber}}" bind:updatePhoneNumber="updatePhoneNumber"></pro-phone-number>
</view>
\ No newline at end of file
</view>
<no-product wx:if="{{!hasProduct}}"></no-product>
\ No newline at end of file
// packagesList/pages/videoDetal/videoDetal.js
import {trackData} from '../../../utils/data'
import {productData} from '../../../pages/tab/index/constant/senceData'
import {subscriptionSystemData} from '../../../pages/tab/index/constant/systemData'
// import {productData} from '../../../pages/tab/index/constant/senceData'
// import {subscriptionSystemData} from '../../../pages/tab/index/constant/systemData'
import utils from '~/utils/util'
import { busassistantApi } from "~/api/api";
Page({
/**
* 页面的初始数据
*/
data: {
videoItem: {
index: 0,
videoList: [],
videoUrl: '',
hasPhoneNumber: false,
tabsActive: 1
},
trackList: [
[trackData.EQUITYVIDEO0, trackData.EQUITYVIDEO1, trackData.EQUITYVIDEO2, trackData.EQUITYVIDEO3],
[trackData.SOLARFILMVIDEO],
[],
[trackData.CROWDVIDEO0, trackData.CROWDVIDEO1, trackData.CROWDVIDEO2, trackData.CROWDVIDEO3, trackData.CROWDVIDEO4, trackData.CROWDVIDEO5],
[trackData.EXPANGOLDVIDEO1]
],
systemTrackList: [
[trackData.SYSUSERVIDEO1, trackData.SYSUSERVIDEO2],
[trackData.SYSNUMBERVIDEO1],
[trackData.SYSUSERVIDEO1, trackData.SYSUSERVIDEO2, trackData.SYSNUMBERVIDEO1]
],
videoData: {},
videoLikeList: [],
videoId: '',
isLoadding: true,
showAuth: false
showAuth: false,
hasProduct: true,
isDigitalCase: false
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
console.log(options);
if (options && options.cardId) {
wx.$trackData = options
wx.$storage.set('scene', options)
const spcList = [99]
const {videoIndex, scenIndex, name, leftMenuIndex, videoName, tabsActive } = options
let videoList = []
let videoUrl = ''
// 判断是案例视频还是操作指引视频
if (tabsActive === '3') {
videoList= spcList.includes(+scenIndex) ? subscriptionSystemData[leftMenuIndex].operationVideoList : productData[scenIndex][0].operationVideoList,
videoUrl= spcList.includes(+scenIndex) ? subscriptionSystemData[leftMenuIndex].operationVideoList[+operationVideoList].videoUrl : productData[scenIndex][0].operationVideoList[+videoIndex].videoUrl
} else {
videoList = spcList.includes(+scenIndex) ? subscriptionSystemData[leftMenuIndex].videoList : productData[scenIndex][0].videoList,
videoUrl = spcList.includes(+scenIndex) ? subscriptionSystemData[leftMenuIndex].videoList[+videoIndex].videoUrl : productData[scenIndex][0].videoList[+videoIndex].videoUrl
}
const res = {
index: videoIndex,
scenIndex: scenIndex,
name: name,
videoName,
leftMenuIndex: leftMenuIndex,
videoList: videoList,
videoUrl: videoUrl,
tabsActive: tabsActive
}
async onLoad(options) {
if (!options?.cardId && !options?.shareType) return
wx.$trackData = options
wx.$storage.set('scene', options)
const { id,typeId,isDigitalCase,tabsActive } = options;
let videoLikeList = [];
let videoData = await this.getDetailWithLike(id);
videoLikeList = videoData.likeList
// 判断是不是在数字化转型案例菜单下
if (JSON.parse(isDigitalCase)) {
console.log(isDigitalCase);
// 调接口获取当前一级菜单下所有视频
videoLikeList = await this.getVideoLikeList(typeId,tabsActive);
this.setData({
videoItem: res
isDigitalCase: true
})
if (name == '营销增值服务') {
wx.$Track.sendTrack(this.data.trackList[scenIndex][videoIndex])
} else if (name == '客户数字化') {
wx.$Track.sendTrack(this.data.systemTrackList[leftMenuIndex][videoIndex])
}
setTimeout(() => {
utils.setNavigationBarTitle(videoName)
},100)
getApp()
.login()
.then(({ data }) => {
if (data && data.phone) {
this.setData({
hasPhoneNumber: true,
isLoadding: false
})
}
}
// videoData?.status 1-上架 2-下架
if (!videoData || videoData?.status == 2) {
this.setData({
isLoadding: false,
hasProduct: false
})
// wx.$Track.sendTrack(this.data.trackList[scenIndex][res.index])
} else {
wx.$router.getData(res => {
console.log(res, 'res');
return
}
this.setData({
videoData,
videoLikeList,
videoId: id,
isLoadding: false,
typeId,
tabsActive
});
setTimeout(() => {
utils.setNavigationBarTitle(videoData.proName)
},100)
getApp().login()
.then(({ data }) => {
console.log(data);
if (data && data.phone) {
this.setData({
videoItem: res,
isLoadding: false
hasPhoneNumber: true,
isLoadding: false,
})
if (res.name == '营销增值服务') {
wx.$Track.sendTrack(this.data.trackList[res.scenIndex][res.index])
} else if (res.name == '客户数字化') {
wx.$Track.sendTrack(this.data.systemTrackList[res.leftMenuIndex][res.index])
}
setTimeout(() => {
utils.setNavigationBarTitle(this.data.videoItem.videoName)
},100)
}
})
},
async onRoute(options) {
if (!options || utils.isEmptyObj(options)) return;
console.log(options, '000');
let { id,typeId,sceneCode,tabsActive,hasPhoneNumber } = options;
let videoLikeList = [];
let videoData = await this.getDetailWithLike(id);
videoLikeList = videoData.likeList
// 判断是不是在数字化转型案例菜单下
if (!sceneCode) {
// 调接口获取当前一级菜单下所有视频
videoLikeList = await this.getVideoLikeList(typeId,tabsActive);
this.setData({
isDigitalCase: true
})
}
// videoData?.status 1-上架 2-下架
if (!videoData || videoData?.status == 2) {
this.setData({
isLoadding: false,
hasProduct: false
})
return
}
this.setData({
videoData,
videoLikeList,
isLoadding: false,
videoId: id,
typeId,
tabsActive,
hasPhoneNumber
});
setTimeout(() => {
utils.setNavigationBarTitle(videoData.proName)
},100)
},
// 获取视频详情
getDetailWithLike(id) {
return new Promise((resolve) => {
let _data;
busassistantApi.getDetailWithLike({id}).then((res) => {
console.log(res);
_data = res.data;
resolve(_data);
});
});
},
// 获取一级菜单下所有视频
getVideoLikeList(id,type) {
return new Promise((resolve) => {
let _data;
let params = {
menuId: id,
// 内容专区(1:特色产品,2:案例视频,3:营销海报,4:操作指引,5:banner)
type: type == 1 ? 2 : 4
}
console.log(params);
busassistantApi.getContentList(params).then((res) => {
console.log(res);
_data = res.data;
resolve(_data);
});
});
},
// 下载视频
downVideo() {
const _this = this
let {videoItem: {videoUrl}} = this.data
let {videoId} = this.data
const {vedioUrl} = this.data.videoLikeList.find(item => item.id == videoId)
wx.getSetting({
success: (res)=> {
if(res.authSetting['scope.writePhotosAlbum']===false){
......@@ -115,7 +156,7 @@ Page({
}else{
wx.$util.showToast('正在下载视频...')
wx.downloadFile({
url: videoUrl,
url: vedioUrl,
success(res) {
if (res.statusCode === 200) {
wx.saveVideoToPhotosAlbum({
......@@ -139,22 +180,14 @@ Page({
})
},
// 点击猜你喜欢视频
chooseVideo(e) {
const {index, info: {name}} = e.detail
const {videoItem} = this.data
if (videoItem.name == '客户数字化') {
this.setData({
'videoItem.index': index
})
wx.$Track.sendTrack(this.data.systemTrackList[videoItem.leftMenuIndex][index])
} else if (videoItem.name == '营销增值服务') {
this.setData({
'videoItem.index': index
})
wx.$Track.sendTrack(this.data.trackList[videoItem.scenIndex][index])
}
const {proName, id} = e.detail
this.setData({
videoId: id
})
setTimeout(() => {
utils.setNavigationBarTitle(name)
utils.setNavigationBarTitle(proName)
},100)
},
......@@ -208,11 +241,11 @@ Page({
// merchantId 兼容旧链接
const merchant = wx.$storage.get('scene').merchant || wx.$storage.get('scene').merchantId
const shareType = 'SHARE_VIDEO'
console.log(this.data.videoItem, 'this.data.videoItem');
const {index, scenIndex, videoUrl, name, leftMenuIndex, videoName, tabsActive} = this.data.videoItem
const id = this.data.videoId
const {isDigitalCase,typeId,tabsActive} = this.data
return {
title: `您好,我向你分享了一个视频`,
path: `packagesList/pages/videoDetal/videoDetal?cardId=${cardId}&merchant=${merchant}&shareType=${shareType}&scenIndex=${scenIndex}&videoIndex=${index}&name=${name}&leftMenuIndex=${leftMenuIndex}&videoName=${videoName}&tabsActive=${tabsActive}`
path: `packagesList/pages/videoDetal/videoDetal?cardId=${cardId}&merchant=${merchant}&shareType=${shareType}&id=${id}&isDigitalCase=${isDigitalCase}&typeId=${typeId}&tabsActive=${tabsActive}`
}
}
})
\ No newline at end of file
<!--packagesList/pages/videoDetal/videoDetal.wxml-->
<loadding wx:if="{{isLoadding}}"></loadding>
<view wx:if="{{!isLoadding}}">
<gl-video-detail list="{{videoItem.videoList}}" index="{{videoItem.index}}" bind:chooseVideo="chooseVideo"></gl-video-detail>
<view wx:if="{{!isLoadding && hasProduct }}">
<gl-video-detail list="{{videoData}}" likeList="{{videoLikeList}}" bind:chooseVideo="chooseVideo"></gl-video-detail>
<phone-number type="{{'video'}}" bindvideodown="downVideo" hasPhoneNumber="{{hasPhoneNumber}}"></phone-number>
<block wx:if="{{showAuth}}">
<authorize title="下载前需要获取您的‘添加到相册’权限,是否打开授权设置?" scopeType="writePhotosAlbum" buttonType="openSetting" bindfail="authFail" bindsuccess="authSuccess" show="{{showAuth}}"></authorize>
</block>
</view>
\ No newline at end of file
</view>
<no-product wx:if="{{!hasProduct}}"></no-product>
\ No newline at end of file
......@@ -10,9 +10,9 @@ import Draw from '../../../utils/Draw'
import { entmicroApi } from '../../../api/api'
import { commonMixin } from '../../../mixins/index'
import { trackData } from '../../../utils/data'
import { senceData, productData } from './constant/senceData'
import { subscriptionBannerUrl, subscriptionSystemData } from './constant/systemData'
import {scenceList} from "./constant/data"
// import { senceData, productData } from './constant/senceData'
// import { subscriptionBannerUrl, subscriptionSystemData } from './constant/systemData'
// import {scenceList} from "./constant/data"
let leftMenuIndex = 0
Page({
behaviors: [commonMixin],
......@@ -61,13 +61,13 @@ Page({
shareDisabled: true,
autoplay: true,
// 增值转化模块
senceData,
productData,
systemData: [],
productData: [],
activityList: [],
subscriptionBannerUrl: Object.freeze(subscriptionBannerUrl),
subscriptionSystemData: Object.freeze(subscriptionSystemData),
// subscriptionBannerUrl: Object.freeze(subscriptionBannerUrl),
// subscriptionSystemData: Object.freeze(subscriptionSystemData),
showCooperate: false,
scenceList: scenceList,
// scenceList: scenceList,
// bannerUrl:'https://img02.glsx.com.cn/weapp/resource/saas/business-assistant/index/banner/banner0.png'
},
......@@ -146,41 +146,25 @@ Page({
},
proClick(e) {
const { name } = e.target.dataset
let { detail } = e
const { info, sceneCode } = e.detail
let obj = {
name,
actNum: isNaN(detail.scenIndex) ? 99 : detail.scenIndex, //选中的场景 没有就是订阅系统的
activeNavIdx: detail.id, //选中的产品,
hasPhoneNumber: this.data.hasPhoneNumber,
proName: detail.proName
id:info.id,
sceneCode
}
wx.$router.go('/packagesList/pages/productDetail/productDetail', obj)
},
// 跳转视频详情
videoClick(e) {
console.log(e.detail);
const { name } = e.target.dataset
const {
index,
info: { videoUrl },
scenIndex,
list,
tabsActive
} = e.detail
const videoList = list
const { info, sceneCode } = e.detail
// 一级菜单ID
const typeId = this.data.curTabIndex == 0 ? this.data.productDataId : this.data.systemDataId
const obj = {
index,
videoList,
videoUrl: videoUrl,
videoName: e.detail.info.name,
hasPhoneNumber: this.data.hasPhoneNumber,
scenIndex: isNaN(scenIndex) ? 99 : scenIndex,
name,
tabsActive
}
if (name == '客户数字化') {
obj.leftMenuIndex = leftMenuIndex
id:info.info.id,
tabsActive: info.tabsActive,
sceneCode,
typeId
}
wx.$router.go('/packagesList/pages/videoDetal/videoDetal', obj)
},
......@@ -194,13 +178,25 @@ Page({
// 场景跳转
senceClick(e) {
// 如果有sceneCode,并且没有配置banner跳转 isBannerLink 1-有配置 2-没有配置
if (!e.detail.sceneCode || e.detail.isBannerLink != 1) return
const { hasPhoneNumber } = this.data
const { scenIndex } = e.detail
wx.$router.go('/packagesList/pages/scenarioDetail/scenarioDetail', { hasPhoneNumber, actNum: scenIndex })
// 获取场景
let systemItem = this.data.systemData.find(item => item.sceneCode == e.detail.sceneCode)
let productItem = this.data.productData.find(item => item.sceneCode == e.detail.sceneCode)
// let id = ''
// const itemList = systemItem ? systemItem : productItem
// const subList = itemList.subList.length ? itemList.subList[0] : null
// const productList = subList ? subList.productList : itemList.productList
// id = productList.length ? productList[0]?.id : ''
let obj = systemItem || productItem
const id = obj?.subList.length ? obj?.subList[0]?.productList[0]?.id : obj?.productList[0]?.id
if (!id) return
wx.$router.go('/packagesList/pages/productDetail/productDetail', { hasPhoneNumber, id })
},
// 获取全部活动列表
getActivityRecord() {
entmicroApi.getActivityRecord({}).then(({ data, code, message }) => {
entmicroApi.getActivityRecord({}).then(({ data, code, message }) => {meifaxi
if (code == -1) {
wx.showToast({
title: message,
......@@ -218,8 +214,20 @@ Page({
* 生命周期函数--监听页面加载
*/
onLoad(options) {
getApp()
.login()
const app = getApp()
app.getBaseData().then(res => {
const productData = res[0].subList
const systemData = res[1].subList
this.setData({
[`tabList[0].name`]: res[0].name,
[`tabList[1]name`]: res[1].name,
systemData,
systemDataId: res[1].id,
productData,
productDataId: res[0].id,
})
})
app.login()
.then(({ data }) => {
if (data && data.phone) {
this.setData({
......@@ -234,8 +242,16 @@ Page({
wx.hideShareMenu({
menus: ['shareAppMessage']
})
// this.setData({
// productData: this.addAll(this.data.productData)
// app.getBaseData().then(res => {
// const productData = res[0].list
// const systemData = res[1].list
// this.setData({
// [`tabList[0].name`]: res[0].name,
// [`tabList[1]name`]: res[1].name,
// systemData,
// productData
// })
// })
},
......@@ -282,6 +298,19 @@ Page({
* 生命周期函数--监听页面显示
*/
onShow() {
const app = getApp()
// app.getBaseData().then(res => {
// const productData = res[0].subList
// const systemData = res[1].subList
// this.setData({
// [`tabList[0].name`]: res[0].name,
// [`tabList[1]name`]: res[1].name,
// systemData,
// systemDataId: res[1].id,
// productData,
// productDataId: res[0].id,
// })
// })
const userInfo = wx.$util.getUserInfo()
this.setData({
hasPhoneNumber: !!(userInfo && userInfo.phone)
......@@ -365,10 +394,10 @@ Page({
},
{
url: 'https://img02.glsx.com.cn/weapp/resource/miniprogram/ai-card/share/logo.png',
x: 15,
y: 18,
width: 152,
height: 10
x: 18,
y: 13,
width: 58,
height: 15
},
// 头像的
{
......
......@@ -18,19 +18,20 @@
</view>
</block>
</view>
<view class="main-content">
<block wx:if="{{productData.length}}">
<view class="main-content">
<block wx:if="{{curTabIndex == 0}}">
<!-- 增值转化 -->
<!-- <gl-scenario currentScenIndex="{{1}}" productData="{{productData}}" senceData="{{senceData}}" activityList="{{activityList}}" data-name="增值转化" bindactivityClick="activityClick" bind:proClick="proClick" bind:videoClick="videoClick" bind:senceClick="senceClick" bindcurrentScen="getCurrentScen" /> -->
<gl-scenario discoverIndex="{{2}}" currentScenIndex="{{3}}" productData="{{productData}}" list="{{scenceList}}" senceData="{{senceData}}" activityList="{{activityList}}" bindactivityClick="activityClick" bindproClick="proClick" bind:videoClick="videoClick" bindsenceClick="senceClick" activityList="{{activityList}}" bindleftClick="leftClick" bindcurrentScen="getCurrentScen"></gl-scenario>
<gl-scenario list="{{productData}}" activityList="{{activityList}}" bindactivityClick="activityClick" bindproClick="proClick" bind:videoClick="videoClick" bindsenceClick="senceClick" bindleftClick="leftClick" bindcurrentScen="getCurrentScen"></gl-scenario>
</block>
<block wx:if="{{curTabIndex == 1}}">
<gl-subscription list="{{subscriptionSystemData}}" bindmenuClick="sysMenuClick" bannerUrl="{{subscriptionBannerUrl}}" bind:proClick="proClick" data-name="客户数字化" bind:videoClick="videoClick" />
<gl-subscription list="{{systemData}}" bindmenuClick="sysMenuClick" bind:proClick="proClick" data-name="客户数字化" bind:videoClick="videoClick" bindsenceClick="senceClick" />
</block>
<block wx-if="{{curTabIndex == 2}}">
<company-introduce autoplay="{{autoplay}}" />
</block>
</view>
</block>
</view>
<!-- 服务咨询 -->
<!-- <view class="floating-box">
......
......@@ -93,7 +93,7 @@
}
},
"setting": {
"urlCheck": false,
"urlCheck": true,
"compileHotReLoad": false,
"autoAudits": true
},
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!