Commit 9dab5509 by 匡雅琴

接口联调

1 parent 730bd6d7
...@@ -10,21 +10,17 @@ import ssoApi from './ssoApi' ...@@ -10,21 +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()
},
getBaseDataConfig() {
return api.getBaseDataByMock()
},
getProductDetail() {
return api.getProductDetail()
} }
} }
} }
\ 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
)
}
}
\ No newline at end of file \ No newline at end of file
...@@ -14,7 +14,7 @@ const target = ["ip", "dev", "uat", "beta", "prod"]; ...@@ -14,7 +14,7 @@ const target = ["ip", "dev", "uat", "beta", "prod"];
3预发布 3预发布
4生产 4生产
*/ */
const index = 2; const index = 1;
const secretKey = { const secretKey = {
ip: {}, ip: {},
dev: { dev: {
......
...@@ -139,37 +139,5 @@ class Request { ...@@ -139,37 +139,5 @@ class Request {
}) })
}) })
} }
getBaseDataByMock() {
let url = 'https://oss-config.dev.glsx.com.cn/mock/6264ff4760f415276f6dfe62/test'
return new Promise((resolve) => {
wx.request({
url,
data: {},
method: 'GET',
header: {},
dataType: 'json',
responseType: 'text',
success(response) {
resolve(response.data)
}
})
})
}
getProductDetail() {
let url = 'https://oss-config.dev.glsx.com.cn/mock/6264ff4760f415276f6dfe62/test-detail'
return new Promise((resolve) => {
wx.request({
url,
data: {},
method: 'GET',
header: {},
dataType: 'json',
responseType: 'text',
success(response) {
resolve(response.data)
}
})
})
}
} }
export default new Request() export default new Request()
\ No newline at end of file \ No newline at end of file
...@@ -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, commonApi } 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'
// 实例化对象存储 // 实例化对象存储
...@@ -145,7 +145,7 @@ App({ ...@@ -145,7 +145,7 @@ App({
getBaseData() { getBaseData() {
console.log("method") console.log("method")
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
commonApi.getBaseDataConfig().then(res => { busassistantApi.getDiscoverList().then(res => {
console.log(res, '555'); console.log(res, '555');
resolve(res.data) resolve(res.data)
}) })
......
...@@ -9,32 +9,6 @@ Component({ ...@@ -9,32 +9,6 @@ Component({
* 组件的属性列表 * 组件的属性列表
*/ */
properties: { properties: {
// 场景值下标
// actNum: {
// type: Number,
// value: -1,
// observer(n) {
// this.getInfo()
// if (n == 3) {
// this.setVideoCtx()
// }
// this.getImgHeight()
// }
// },
// // 选中的产品
// activeNavIdx: {
// type: Number,
// value: 0
// },
// cardInfo: {
// type: Object,
// value: {}
// },
// // 配置url
// activeUrl: {
// type: String,
// value: ''
// },
detailType: { detailType: {
type: String, type: String,
value: 'pro' value: 'pro'
...@@ -127,9 +101,9 @@ Component({ ...@@ -127,9 +101,9 @@ Component({
}, },
// 1.3查看活动详情按钮 // 1.3查看活动详情按钮
checkActive(e) { checkActive(e) {
let { activeUrl } = e.url 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, '--');
...@@ -166,36 +140,20 @@ Component({ ...@@ -166,36 +140,20 @@ Component({
}, },
// 长按图片 // 长按图片
handleLongPress(e) { handleLongPress(e) {
console.log(e); // 如果图片有长按事件 posterEventType: 1-无 2-有
if (item.posterEventType == 1) return
let {item} = e.currentTarget.dataset let {item} = e.currentTarget.dataset
// 如果图片有长按事件 wx.downloadFile({
if (item.clickEvent == 1) { url: item.posterEventUrl,
wx.downloadFile({ success: function (res) {
url: item.linkUrl, const filePath = res.tempFilePath
success: function (res) { wx.openDocument({
const filePath = res.tempFilePath filePath: filePath,
wx.openDocument({ success: function (res) {
filePath: filePath, }
success: function (res) { })
} }
}) })
}
})
}
// 膨胀金活动,合作方式
// 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) {
// }
// })
// }
// })
// }
}, },
// 点击拨打电话 // 点击拨打电话
phoneCall(e) { phoneCall(e) {
......
...@@ -6,18 +6,18 @@ ...@@ -6,18 +6,18 @@
<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="{{proDetail.mainType == 'video'}}" src="{{proDetail.mainImg}}" bindplay="handleVideoPlay" data-attr="crowdVideoCtx" /> <!-- 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.mainType == 'image'}}" src="{{proDetail.mainImg}}?v={{img_version}}" /> <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">{{proDetail.contentTitle}}</view> <view class="title">{{proDetail.title}}</view>
<image class="check" wx:if="{{proDetail.mainType != 'image'}}" 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="{{proDetail.mainType != 'image'}}">{{proDetail.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>
...@@ -26,33 +26,29 @@ ...@@ -26,33 +26,29 @@
<!-- tab菜单 --> <!-- 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="{{proDetail.contentDetail}}" title="{{item.detailTypeName}}" 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="{{proDetail.contentDetail}}" 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 mode="widthFix" class="img-items" src="{{item.detailImg?item.detailImg:item}}?v={{img_version}}" bindlongpress="handleLongPress" data-item="{{item}}">
<!-- 第一张图的点击拨打电话事件 --> <!-- 第一张图的点击拨打电话事件 -->
<block wx:if="{{ index == 0}}"> <block wx:if="{{ index == 0}}">
<view class="phone" bindtap="phoneCall" data-phone="{{proDetail.telphoneNumber}}"> <view class="phone" bindtap="phoneCall" data-phone="{{proDetail.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.telphoneNumber}}</view> <view style="color:#3666fe">{{proDetail.phone}}</view>
</view> </view>
</block> </block>
<!-- 如果有活动跳转 --> <!-- 如果有活动跳转 -->
<!-- 按钮点击事件 buttonClickEvent:0-无,1-有 --> <!-- 按钮点击事件 buttonClickEvent:1-无 2-有 -->
<block wx:if="{{ item.buttonClickEvent == 1 }}"> <block wx:if="{{ item.buttonEventType == 2 }}">
<view class="check-act" bindtap="checkActive" data-url="{{item.buttonLinkUrl}}">{{item.buttonName}}</view> <view class="check-act" bindtap="checkActive" data-url="{{item.buttonEventUrl}}">{{item.buttonEventName}}</view>
</block> </block>
<!-- 获取更多详情 --> <!-- 获取更多详情 -->
...@@ -63,18 +59,12 @@ ...@@ -63,18 +59,12 @@
</block> --> </block> -->
<!-- 如果有视频 --> <!-- 如果有视频 -->
<block wx:if="{{ item.detailVideo }}"> <block wx:if="{{ item.videoUrl }}">
<video class="crowd-video" id="crowd-video" bindplay="handleVideoPlay" data-attr="videoCtx" src="{{item.detailVideo}}" /> <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}}" mode="widthFix" webp class="img-items {{item.className?item.className:''}}" src="{{item.detailImg?item.detailImg:item}}?v={{img_version}}" bindlongpress="handleLongPress" data-actnum="{{actNum}}" data-index="{{index}}">
<block wx:if="{{ index == 3 && actNum == 3 }}">
<video class="crowd-video" id="crowd-video" bindplay="handleVideoPlay" data-attr="videoCtx" src="{{detailVideo}}" />
</block>
</image> -->
</block> </block>
<view class="occupancy" wx:if="{{!isShare}}"> <view class="occupancy" wx:if="{{!isShare}}">
</view> </view>
......
...@@ -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.9",
"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.9.tgz",
"integrity": "sha512-Ze+HdtFJImhOsWLfV+ZzB86Kf18pm9M9CZWhctPel/qJNMEn29g9ywC16NXmeac+gTu07MOpURyF+YmO8ojkJA==" "integrity": "sha512-8bVPzgXafaAc+kWUjuT0i+kLxCm/2VFxzN4ZqK5ZbRDxdbCKBNAmXjHYcMwN1Eg9Fli4ZqL7mIHsGCbyZU9doQ=="
} }
} }
} }
...@@ -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.9"
}, },
"devDependencies": {}, "devDependencies": {},
"scripts": { "scripts": {
......
...@@ -7,7 +7,7 @@ import { IMG_URL } from "~/utils/constantData.js"; ...@@ -7,7 +7,7 @@ import { IMG_URL } from "~/utils/constantData.js";
// } from "~/pages/tab/index/constant/senceData" // } from "~/pages/tab/index/constant/senceData"
// import USERAPI from '~/api/usersApi/index' // import USERAPI from '~/api/usersApi/index'
import utils from "~/utils/util"; import utils from "~/utils/util";
import { entmicroApi, commonApi } from "~/api/api"; import { entmicroApi, commonApi, busassistantApi } from "~/api/api";
import { trackData } from "../../../utils/data"; import { trackData } from "../../../utils/data";
Page({ Page({
/** /**
...@@ -80,39 +80,15 @@ Page({ ...@@ -80,39 +80,15 @@ Page({
//接受跳转的路由参数(小程序页面跳转) //接受跳转的路由参数(小程序页面跳转)
async onRoute(options) { async onRoute(options) {
// if (!options || utils.isEmptyObj(options)) return
// let {
// actNum = 0, activeNavIdx = 0, phone, hasPhoneNumber, name, proName
// } = options
// this.setData({
// actNum, //选中的场景下标
// activeNavIdx, //选中的产品
// sharephone: phone, //联系电话 (登陆的用户)
// hasPhoneNumber:hasPhoneNumber,
// pageName: name,
// proName
// })
// if (name == '营销增值服务') {
// wx.$Track.sendTrack(this.data.trackList[actNum][activeNavIdx])
// } else if (name == '客户数字化') {
// wx.$Track.sendTrack(this.data.systemTrackList[activeNavIdx])
// }
// setTimeout(() => {
// utils.setNavigationBarTitle(proName)
// this.setData({
// isLoadding: false
// })
// },100)
if (!options || utils.isEmptyObj(options)) return; if (!options || utils.isEmptyObj(options)) return;
let proData = await this.getProductDetail(); let { hasPhoneNumber, id } = options;
console.log(proData, "proData"); let proData = await this.getProductDetail(id);
let { hasPhoneNumber } = options;
this.setData({ this.setData({
hasPhoneNumber, hasPhoneNumber,
productData: proData, productData: proData,
}); });
setTimeout(() => { setTimeout(() => {
utils.setNavigationBarTitle(proData.proTitle); utils.setNavigationBarTitle(proData.proName);
this.setData({ this.setData({
isLoadding: false, isLoadding: false,
}); });
...@@ -120,10 +96,10 @@ Page({ ...@@ -120,10 +96,10 @@ Page({
}, },
// 获取产品详情 // 获取产品详情
getProductDetail() { getProductDetail(id) {
return new Promise((resolve) => { return new Promise((resolve) => {
let _data; let _data;
commonApi.getProductDetail().then((res) => { busassistantApi.getDiscoverDetail({id}).then((res) => {
console.log(res); console.log(res);
_data = res.data; _data = res.data;
resolve(_data); resolve(_data);
...@@ -173,14 +149,11 @@ Page({ ...@@ -173,14 +149,11 @@ Page({
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
async onLoad(options) { async onLoad(options) {
console.log(options, 'options');
// this.getActiveApiFn()
if (options && options.cardId) { if (options && options.cardId) {
wx.$trackData = options; wx.$trackData = options;
// wx.$trackData.cardId = options.cardId
wx.$storage.set("scene", options); wx.$storage.set("scene", options);
const { proId } = options; const { id } = options;
let proData = await this.getProductDetail(); let proData = await this.getProductDetail(id);
this.setData({ this.setData({
productData: proData, productData: proData,
}); });
...@@ -204,7 +177,7 @@ Page({ ...@@ -204,7 +177,7 @@ Page({
// wx.$Track.sendTrack(this.data.systemTrackList[activeNavIdx]); // wx.$Track.sendTrack(this.data.systemTrackList[activeNavIdx]);
// } // }
setTimeout(() => { setTimeout(() => {
utils.setNavigationBarTitle(proData.proTitle); utils.setNavigationBarTitle(proData.proName);
}, 100); }, 100);
} else { } else {
this.getCardDetail(); this.getCardDetail();
...@@ -251,11 +224,11 @@ Page({ ...@@ -251,11 +224,11 @@ Page({
wx.$storage.get("scene").merchant || wx.$storage.get("scene").merchantId; wx.$storage.get("scene").merchant || wx.$storage.get("scene").merchantId;
const shareType = "SHARE_PRO"; const shareType = "SHARE_PRO";
// const {actNum, activeNavIdx, pageName, proName} = this.data // const {actNum, activeNavIdx, pageName, proName} = this.data
const { proId } = this.data.productData; const { id } = this.data.productData;
return { return {
title: `给你分享一个活动,戳我参与~`, title: `给你分享一个活动,戳我参与~`,
// path: `packagesList/pages/productDetail/productDetail?cardId=${cardId}&merchant=${merchant}&shareType=${shareType}&actNum=${actNum}&activeNavIdx=${activeNavIdx}&name=${pageName}&proName=${proName}` // path: `packagesList/pages/productDetail/productDetail?cardId=${cardId}&merchant=${merchant}&shareType=${shareType}&actNum=${actNum}&activeNavIdx=${activeNavIdx}&name=${pageName}&proName=${proName}`
path: `packagesList/pages/productDetail/productDetail?cardId=${cardId}&merchant=${merchant}&shareType=${shareType}&proId=${proId}`, path: `packagesList/pages/productDetail/productDetail?cardId=${cardId}&merchant=${merchant}&shareType=${shareType}&id=${id}`,
}; };
}, },
......
...@@ -3,31 +3,15 @@ import {trackData} from '../../../utils/data' ...@@ -3,31 +3,15 @@ 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, videoId: '',
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]
],
isLoadding: true, isLoadding: true,
showAuth: false showAuth: false
}, },
...@@ -35,77 +19,60 @@ Page({ ...@@ -35,77 +19,60 @@ Page({
/** /**
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
onLoad(options) { async onLoad(options) {
console.log(options); if (!options && options.cardId) return
if (options && options.cardId) { const { id } = options;
wx.$trackData = options let videoData = await this.getDetailWithLike(id);
wx.$storage.set('scene', options) this.setData({
const spcList = [99] videoData,
const {videoIndex, scenIndex, name, leftMenuIndex, videoName, tabsActive } = options videoId: id,
let videoList = [] isLoadding: false
let videoUrl = '' });
// 判断是案例视频还是操作指引视频 setTimeout(() => {
if (tabsActive === '3') { utils.setNavigationBarTitle(videoData.title)
videoList= spcList.includes(+scenIndex) ? subscriptionSystemData[leftMenuIndex].operationVideoList : productData[scenIndex][0].operationVideoList, },100)
videoUrl= spcList.includes(+scenIndex) ? subscriptionSystemData[leftMenuIndex].operationVideoList[+operationVideoList].videoUrl : productData[scenIndex][0].operationVideoList[+videoIndex].videoUrl getApp()
} else { .login()
videoList = spcList.includes(+scenIndex) ? subscriptionSystemData[leftMenuIndex].videoList : productData[scenIndex][0].videoList, .then(({ data }) => {
videoUrl = spcList.includes(+scenIndex) ? subscriptionSystemData[leftMenuIndex].videoList[+videoIndex].videoUrl : productData[scenIndex][0].videoList[+videoIndex].videoUrl if (data && data.phone) {
}
const res = {
index: videoIndex,
scenIndex: scenIndex,
name: name,
videoName,
leftMenuIndex: leftMenuIndex,
videoList: videoList,
videoUrl: videoUrl,
tabsActive: tabsActive
}
this.setData({
videoItem: res
})
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
})
}
})
// wx.$Track.sendTrack(this.data.trackList[scenIndex][res.index])
} else {
wx.$router.getData(res => {
console.log(res, 'res');
this.setData({ this.setData({
videoItem: res, 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])
} async onRoute(options) {
setTimeout(() => { if (!options || utils.isEmptyObj(options)) return;
utils.setNavigationBarTitle(this.data.videoItem.videoName) let { id } = options;
},100) let videoData = await this.getDetailWithLike(id);
}) this.setData({
} videoData,
isLoadding: false,
videoId: id
});
setTimeout(() => {
utils.setNavigationBarTitle(videoData.title)
},100)
}, },
// 获取视频详情
getDetailWithLike(id) {
return new Promise((resolve) => {
let _data;
busassistantApi.getDetailWithLike({id}).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.videoData.likeList.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 +82,7 @@ Page({ ...@@ -115,7 +82,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 +106,14 @@ Page({ ...@@ -139,22 +106,14 @@ Page({
}) })
}, },
// 点击猜你喜欢视频
chooseVideo(e) { chooseVideo(e) {
const {index, info: {name}} = e.detail const {title, id} = e.detail
const {videoItem} = this.data this.setData({
if (videoItem.name == '客户数字化') { videoId: id
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])
}
setTimeout(() => { setTimeout(() => {
utils.setNavigationBarTitle(name) utils.setNavigationBarTitle(title)
},100) },100)
}, },
...@@ -208,11 +167,10 @@ Page({ ...@@ -208,11 +167,10 @@ 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
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}`
} }
} }
}) })
\ 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}}">
<gl-video-detail list="{{videoItem.videoList}}" index="{{videoItem.index}}" bind:chooseVideo="chooseVideo"></gl-video-detail> <gl-video-detail list="{{videoData}}" 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>
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
*/ */
// pages/tab/index/index.js // pages/tab/index/index.js
import Draw from '../../../utils/Draw' import Draw from '../../../utils/Draw'
import { entmicroApi,commonApi } 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'
...@@ -146,41 +146,21 @@ Page({ ...@@ -146,41 +146,21 @@ 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); console.log(e.detail);
const { name } = e.target.dataset const { info, sceneCode } = e.detail
const {
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.id,
name,
tabsActive
}
if (name == '客户数字化') {
obj.leftMenuIndex = leftMenuIndex
} }
wx.$router.go('/packagesList/pages/videoDetal/videoDetal', obj) wx.$router.go('/packagesList/pages/videoDetal/videoDetal', obj)
}, },
...@@ -236,10 +216,8 @@ Page({ ...@@ -236,10 +216,8 @@ Page({
}) })
app.getBaseData().then(res => { app.getBaseData().then(res => {
console.log(res, '999'); const productData = res[0].list
const { const systemData = res[1].list
systemData,
productData} = res
this.setData({ this.setData({
systemData, systemData,
productData productData
......
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
<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 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}}" list="{{productData}}" 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>
<block wx:if="{{curTabIndex == 1}}"> <block wx:if="{{curTabIndex == 1}}">
<gl-subscription list="{{systemData}}" bindmenuClick="sysMenuClick" bannerUrl="{{subscriptionBannerUrl}}" bind:proClick="proClick" data-name="客户数字化" bind:videoClick="videoClick" /> <gl-subscription list="{{systemData}}" bindmenuClick="sysMenuClick" bannerUrl="{{subscriptionBannerUrl}}" bind:proClick="proClick" data-name="客户数字化" bind:videoClick="videoClick" />
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!