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