Commit 2e35b30e by 前端

Merge branch 'v3.12.0' into 'master'

V3.12.0

See merge request !4
2 parents 48ae36b3 97e7a4f8
Showing 38 changed files with 714 additions and 433 deletions
...@@ -279,7 +279,7 @@ class ActivityApi { ...@@ -279,7 +279,7 @@ class ActivityApi {
/**查询4s店商户产值总览、当日新增产值 --精品升级 */ /**查询4s店商户产值总览、当日新增产值 --精品升级 */
boutiquecouponOutputValue(data) { boutiquecouponOutputValue(data) {
return api.post({ return api.post({
method: `scrm.api.boutiquecoupon.outputValue.overview`, method: `scrm.api.boutiquecoupon.outputValue.overview.byDayReport`,
...data ...data
}) })
} }
......
import api from "~/utils/request/request";
const path = "scrm.api.stoassistant";
class BusassistantApi {
// 获取小程序首页数据列表
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
)
}
}
export default BusassistantApi;
\ No newline at end of file \ No newline at end of file
import BusassistantApi from './BusassistantApi.js'
export default new BusassistantApi()
\ No newline at end of file \ No newline at end of file
import api from '~/utils/request/request' import api from '~/utils/request/request'
module.exports = { module.exports = {
/**根据商户查询商户下级列表 */
findSubordinateListByPage(data) {
return api.post({
method: `merchants.api.open.findSubordinateListByPage`,
...data
})
}
}
\ No newline at end of file \ No newline at end of file
/**根据商户查询商户下级列表 */
findSubordinateListByPage(data) {
return api.post({
method: `merchants.api.open.findSubordinateListByPage`,
...data
})
},
/**查找二级流量方商户 */
secondFlow(data) {
return api.post({
method: `scrm.api.boutiquecoupon.partnermerchant.secondFlow`,
...data
})
}
}
...@@ -128,7 +128,7 @@ class outputApi { ...@@ -128,7 +128,7 @@ class outputApi {
/** 业务经营汇总列表查询 */ /** 业务经营汇总列表查询 */
getBusiStatistics(data) { getBusiStatistics(data) {
return api.post({ return api.post({
method: 'scrm.api.boutiquecoupon.store.assistant.merchants.total.statistics', method: 'scrm.api.boutiquecoupon.store.assistant.merchants.total.statistics.forStoreManager',
...data ...data
}) })
} }
......
...@@ -23,7 +23,6 @@ class UsersApi { ...@@ -23,7 +23,6 @@ class UsersApi {
true true
) )
} catch (error) { } catch (error) {
console.log(error)
return Promise.reject() return Promise.reject()
} }
} }
...@@ -186,5 +185,13 @@ class UsersApi { ...@@ -186,5 +185,13 @@ class UsersApi {
},false,'merchant') },false,'merchant')
} }
/**查找二级流量方商户 */
secondFlow(data) {
return api.post({
method: `scrm.api.boutiquecoupon.partnermerchant.secondFlow`,
...data,
})
}
} }
export default UsersApi export default UsersApi
\ No newline at end of file \ No newline at end of file
...@@ -8,11 +8,14 @@ import util from './utils/util' ...@@ -8,11 +8,14 @@ import util from './utils/util'
import wxApi from './utils/utils_wx' import wxApi from './utils/utils_wx'
import '~/router/routerBefore' import '~/router/routerBefore'
import router from './router/index' import router from './router/index'
import BusassistantApi from "~/api/busassistantApi/index";
// 有问题 前后顺序不能随意调整 // 有问题 前后顺序不能随意调整
// console.log(test) // console.log(test)
import { setSystem_info } from '~/utils/cache/storageApi' import {
setSystem_info
} from '~/utils/cache/storageApi'
// console.log(setSystem_info) // console.log(setSystem_info)
// 判断小程序是否需要更新 // 判断小程序是否需要更新
import getUpdateManager from './utils/lib/wxUpdateManager' import getUpdateManager from './utils/lib/wxUpdateManager'
...@@ -23,12 +26,16 @@ import getUpdateManager from './utils/lib/wxUpdateManager' ...@@ -23,12 +26,16 @@ import getUpdateManager from './utils/lib/wxUpdateManager'
import eventbus from './utils/evenbus' import eventbus from './utils/evenbus'
// 微信小程序异步使用 使用方法wx.pro+对应api即可 promisify 这个是配置单独某个api // 微信小程序异步使用 使用方法wx.pro+对应api即可 promisify 这个是配置单独某个api
import { promisifyAll } from './utils/lib/wx-promise-pro' import {
promisifyAll
} from './utils/lib/wx-promise-pro'
promisifyAll() promisifyAll()
// promisify(wx.getSystemInfo)().then(console.log) // promisify(wx.getSystemInfo)().then(console.log)
// 实例化对象存储 // 实例化对象存储
import { Storage } from './utils/cache/storage' import {
Storage
} from './utils/cache/storage'
const $Storage = new Storage() const $Storage = new Storage()
//全局分享 //全局分享
...@@ -55,9 +62,17 @@ App({ ...@@ -55,9 +62,17 @@ App({
onShow(options) { onShow(options) {
getUpdateManager() getUpdateManager()
}, },
// 获取公共数据
getBaseData() {
return new Promise((resolve, reject) => {
BusassistantApi.getDiscoverList().then(res => {
resolve(res.data)
})
})
},
/**页面不存在时触发 */ /**页面不存在时触发 */
onPageNotFound(e) { onPageNotFound(e) {
wx.$router.goHome() wx.$router.goHome()
}, },
onHide() {} onHide() {}
}) })
\ No newline at end of file \ No newline at end of file
...@@ -123,7 +123,9 @@ ...@@ -123,7 +123,9 @@
"crowdfund-poster": "/components/CrowdfundPoster/CrowdfundPoster", "crowdfund-poster": "/components/CrowdfundPoster/CrowdfundPoster",
"glsx-image": "/components/image/index", "glsx-image": "/components/image/index",
"van-datetime-picker": "@vant/weapp/datetime-picker/index", "van-datetime-picker": "@vant/weapp/datetime-picker/index",
"van-calendar": "@vant/weapp/calendar/index" "van-calendar": "@vant/weapp/calendar/index",
"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: {
}
})
\ No newline at end of file \ No newline at end of file
{
"component": true,
"usingComponents": {}
}
\ No newline at end of file \ No newline at end of file
.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>
...@@ -43,12 +43,23 @@ const findSubordinateListByPage = (userInfo)=> { ...@@ -43,12 +43,23 @@ const findSubordinateListByPage = (userInfo)=> {
USERAPI.findSubordinateListByPage({pageSize:10000,pageNum:1,merchantId:userInfo.merchantId,apiProjectName:'rop-merchants'}).then(res=>{ USERAPI.findSubordinateListByPage({pageSize:10000,pageNum:1,merchantId:userInfo.merchantId,apiProjectName:'rop-merchants'}).then(res=>{
const list = res.data||[] const list = res.data||[]
const merchant = list.map(i=>i.merchantNo) const merchant = list.map(i=>i.merchantNo)
setSubMerchant(merchant) resolve(merchant)
resolve()
}) })
}) })
} }
/**查找二级流量方商户 */
const secondFlow = (userInfo)=> {
return new Promise(resolve=>{
USERAPI.secondFlow({merchantId:userInfo.merchantId}).then(res=>{
const list = res||{}
const merchant = list.merchantNoList||[]
resolve(merchant)
})
})
}
/**设置登录信息 */ /**设置登录信息 */
const setLoginInfo = async (userInfo, sessionId) => { const setLoginInfo = async (userInfo, sessionId) => {
if (!userInfo) { if (!userInfo) {
...@@ -58,7 +69,8 @@ const setLoginInfo = async (userInfo, sessionId) => { ...@@ -58,7 +69,8 @@ const setLoginInfo = async (userInfo, sessionId) => {
setUserInfo(userInfo) setUserInfo(userInfo)
setSessionId(sessionId) setSessionId(sessionId)
try { try {
await findSubordinateListByPage(userInfo) const merchant = await Promise.all([findSubordinateListByPage(userInfo),secondFlow(userInfo)])
setSubMerchant(merchant.flat())
} catch (error) { } catch (error) {
} }
loginSuccess() loginSuccess()
...@@ -73,7 +85,6 @@ const loginSuccess = () => { ...@@ -73,7 +85,6 @@ const loginSuccess = () => {
targetPath targetPath
} }
} = wx.$router.getPageInstance() } = wx.$router.getPageInstance()
console.log(targetPath)
if (targetPath) { if (targetPath) {
const { const {
url, url,
......
...@@ -10,9 +10,9 @@ ...@@ -10,9 +10,9 @@
"integrity": "sha512-swM4k3pVwt/6Tnijvq86paLiKE1CzbrBQ4lR7+9uRhwKOM0HS3ooK1Q4IjSEyxQ59ZFKmYYvZln77RZcnSDqmA==" "integrity": "sha512-swM4k3pVwt/6Tnijvq86paLiKE1CzbrBQ4lR7+9uRhwKOM0HS3ooK1Q4IjSEyxQ59ZFKmYYvZln77RZcnSDqmA=="
}, },
"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.7", "@vant/weapp": "^1.10.7",
"glsx-applet-component": "^1.1.3" "glsx-applet-component": "^1.1.16"
}, },
"devDependencies": {}, "devDependencies": {},
"scripts": { "scripts": {
......
...@@ -81,15 +81,15 @@ Component({ ...@@ -81,15 +81,15 @@ Component({
}], }],
todayOutiqueOutputValue: [{ todayOutiqueOutputValue: [{
label: '发券量/张', label: '发券量/张',
name: 'sendCouponCountToday', name: 'sendCouponCountTotal',
unit: '' unit: ''
}, { }, {
label: '升级订单/单', label: '升级订单/单',
name: 'upgradeCountToday', name: 'upgradeCountTotal',
unit: '' unit: ''
}, { }, {
label: '营业额(总)/元', label: '营业额(总)/元',
name: 'orderMoneyTotalToday', name: 'orderMoneyTotal',
unit: '' unit: ''
}], }],
todayOutputValue: [{ todayOutputValue: [{
...@@ -224,15 +224,21 @@ Component({ ...@@ -224,15 +224,21 @@ Component({
const { const {
type, type,
} = this.data } = this.data
let apiName = 'boutiquecouponOutputValue' console.log(type)
let apiName = 'merchantsOutput'
let params = { let params = {
merchantId: thisPage.data.merchantId merchantIds: [thisPage.data.merchantId]
} }
if ([2].includes(type)) { if ([1].includes(type)) {
apiName = 'merchantsOutput' apiName = 'boutiquecouponOutputValue'
params = { params = {
merchantIds: [thisPage.data.merchantId] merchantId: thisPage.data.merchantId
} }
ActivityApi.boutiquecouponOutputValue({merchantId: thisPage.data.merchantId,startDate: new Date().format('yyyy-MM-dd'),endDate:new Date().format('yyyy-MM-dd')}).then(res => {
this.setData({
outputTodayData: res
})
})
} }
ActivityApi[apiName](params).then(res => { ActivityApi[apiName](params).then(res => {
thisPage.setData({ loading: false }) thisPage.setData({ loading: false })
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
<view class="output-title">当日新增</view> <view class="output-title">当日新增</view>
<view class="output-value today"> <view class="output-value today">
<view class="output-item" wx:key="index" wx:for="{{outputView[entranceType ==2 ?'todayOutputValue':'todayOutiqueOutputValue']}}"> <view class="output-item" wx:key="index" wx:for="{{outputView[entranceType ==2 ?'todayOutputValue':'todayOutiqueOutputValue']}}">
<view class="output-num">{{outputData[item.name]|| 0}} </view> <view class="output-num">{{entranceType ==2?(outputData[item.name]|| 0):(outputTodayData[item.name]|| 0)}} </view>
<view class="output-label">{{item.label}}</view> <view class="output-label">{{item.label}}</view>
</view> </view>
</view> </view>
......
import { imgUrlMixin } from '~/mixins/index' import { imgUrlMixin } from '~/mixins/index'
Component({ Component({
/** /**
* 组件的属性列表 * 组件的属性列表
*/ */
behaviors: [imgUrlMixin], behaviors: [imgUrlMixin],
properties: { properties: {
data: { data: {
type: Object, type: Object,
value: {}, value: {},
observer(v) { observer(v) {
if (v) { if (v) {
// 活动概览数据处理 // 活动概览数据处理
let s = v let s = v
v.overviewData = { // 活动中 v.overviewData = { // 活动中
browseData: { browseData: {
all: { title: '总浏览', num: s.browsCount} all: { title: '总浏览', num: s.browsCount }
}, },
shareData: { shareData: {
all: { title: '产值(总)/元', num: this.priceFormat(s.realAmount || 0), unit: '¥' } all: { title: '产值(总)/元', num: this.priceFormat(s.realAmount || 0), unit: '¥' }
}, },
visitorData: { visitorData: {
all: { title: '总访客', num: s.visitCount}, all: { title: '总访客', num: s.visitCount },
}, },
}
console.log(v)
this.setData({ data: v })
}
} }
console.log(v) },
this.setData({ data: v }) activityOverviewList: {
type: Array,
value: []
},
backStyle: {
type: Array,
value: []
},
textType: {
type: Number,
value: 0
} }
}
},
activityOverviewList: {
type: Array,
value: []
},
backStyle: {
type: Array,
value: []
}, },
textType: {
type: Number,
value: 0
}
},
/**
* 组件的初始数据
*/
data: {
textTypeList: ['', '当前排名:', '最终排名:']
},
/** /**
* 组件的方法列表 * 组件的初始数据
*/ */
methods: { data: {
// 实时战报 textTypeList: ['', '当前排名:', '最终排名:']
jumpReport(e) {
let { item } = e.currentTarget.dataset
if (item.activityStatus == 1) return wx.$api.showToast('当前活动尚未开始')
if(item.activityStatus == 2)
wx.navigateTo({
url: `/packagesList/packageOutput/pages/shareWebview/shareWebview?url=${encodeURIComponent(item.reportUrl)}`,
});
else
wx.$router.go('/packagesList/packageOutput/pages/warReport/warReport', item)
},
// 跳转
jump(e) {
let { item } = e.currentTarget.dataset
wx.$router.go("/packagesList/packageOutput/pages/visitor/visitor", { ...item })
},
jumpOutput(e) {
let { item } = e.currentTarget.dataset
wx.$router.go("/packagesList/packageOutput/pages/crowdDetail/crowdDetail", { ...item })
},
// 价格格式化
priceFormat(num, point = 2) {
let numStr = (num/100).toString().split('.')[0]
if (numStr.length < 6) { // 判断数字有多长,如果小于6,,表示10万以内的数字,让其直接显示
return numStr;
} else if (numStr.length >= 6 && numStr.length <= 8) { // 如果数字大于6位,小于8位,让其数字后面加单位万
point = 0
let decimal = numStr.substring(numStr.length - 4, numStr.length - 4 + point)
console.log(decimal);
// 由千位,百位组成的一个数字
return parseFloat(parseInt(num / 10000) + '.' + decimal) + '万'
} else if (numStr.length > 8) { // 如果数字大于8位,让其数字后面加单位亿
let decimal = numStr.substring(numStr.length - 8, numStr.length - 8 + point);
return parseFloat(parseInt(num / 100000000) + '.' + decimal) + '亿'
}
}, },
}
/**
* 组件的方法列表
*/
methods: {
// 实时战报
jumpReport(e) {
let { item } = e.currentTarget.dataset
if (item.activityStatus == 1) return wx.$api.showToast('当前活动尚未开始')
// if(item.activityStatus == 2)
// 不区分活动是否在进行中 有返回值就跳转
item.reportUrl && wx.navigateTo({
url: `/packagesList/packageOutput/pages/shareWebview/shareWebview?url=${encodeURIComponent(item.reportUrl)}`,
});
// else
// wx.$router.go('/packagesList/packageOutput/pages/warReport/warReport', item)
},
// 跳转
jump(e) {
let { item } = e.currentTarget.dataset
wx.$router.go("/packagesList/packageOutput/pages/visitor/visitor", { ...item })
},
jumpOutput(e) {
let { item } = e.currentTarget.dataset
wx.$router.go("/packagesList/packageOutput/pages/crowdDetail/crowdDetail", { ...item })
},
// 价格格式化
priceFormat(num, point = 2) {
let numStr = (num / 100).toString()
return numStr;
},
// priceFormat(num, point = 2) {
// let numStr = (num/100).toString().split('.')[0]
// if (numStr.length < 6) { // 判断数字有多长,如果小于6,,表示10万以内的数字,让其直接显示
// return numStr;
// } else if (numStr.length >= 6 && numStr.length <= 8) { // 如果数字大于6位,小于8位,让其数字后面加单位万
// let decimal = numStr.substring(numStr.length - 4, numStr.length - 4 + point)
// console.log(decimal);
// // 由千位,百位组成的一个数字
// return parseFloat(parseInt(numStr / 10000) + '.' + decimal) + '万'
// } else if (numStr.length > 8) { // 如果数字大于8位,让其数字后面加单位亿
// let decimal = numStr.substring(numStr.length - 8, numStr.length - 8 + point);
// return parseFloat(parseInt(numStr / 100000000) + '.' + decimal) + '亿'
// }
// }
}
}) })
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
} }
.number{ .number{
color: #2D2D33; color: #2D2D33;
font-size: 44rpx; font-size: 36rpx;
font-weight: 600; font-weight: 600;
text { text {
font-size: 28rpx; font-size: 28rpx;
......
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
image { image {
object-fit: cover; object-fit: cover;
background-size: 100% auto; background-size: 100% 100%;
} }
} }
......
var arrInclues = function(num,arr){ var arrInclues = function (num, arr) {
var flag = false var flag = false
for(var i = 0;i<arr.length;i++){ for (var i = 0; i < arr.length; i++) {
if(num==arr[i]){ if (num == arr[i]) {
flag = true flag = true
} }
} }
return flag return flag
} }
var accMul = function(arg1, arg2){ var accMul = function (arg1, arg2) {
if (isNaN(arg1)) { if (isNaN(arg1)) {
arg1 = 0; arg1 = 0;
} }
if (isNaN(arg2)) { if (isNaN(arg2)) {
arg2 = 0; arg2 = 0;
} }
var m=0, s1 = arg1.toString(), var m = 0, s1 = arg1 + '',
s2 = arg2.toString(); s2 = arg2 + '';
m += (s1.split(".")[1] && s1.split(".")[1].length) || 0; m += (s1.split(".")[1] && s1.split(".")[1].length) || 0;
m += (s2.split(".")[1] && s2.split(".")[1].length) || 0; m += (s2.split(".")[1] && s2.split(".")[1].length) || 0;
var s = s1.replace(".", "") * s2.replace(".", ""), var s = s1.replace(".", "") * s2.replace(".", ""),
p = Math.pow(10,m) p = Math.pow(10, m)
return s/p return s / p
}; };
module.exports = { module.exports = {
arrInclues: arrInclues, arrInclues: arrInclues,
accMul:accMul
}
\ No newline at end of file \ No newline at end of file
accMul: accMul
}
\ No newline at end of file \ No newline at end of file
// packagesList/pages/productDetail/components/proDetail/proDetail.js // packagesList/pages/productDetail/components/proDetail/proDetail.js
import { senceData, productData } from '~/pages/tab/discovery/constant/senceData' // import { senceData, productData } from '~/pages/tab/storeAssistant/pages/discovery/constant/senceData'
const norTabList = ['海报案例', '测算营销', '产品介绍', '项目亮点'] const norTabList = ['海报案例', '测算营销', '产品介绍', '项目亮点']
Component({ Component({
externalClasses: ['custom-class'], externalClasses: ['custom-class'],
...@@ -8,30 +8,30 @@ Component({ ...@@ -8,30 +8,30 @@ Component({
*/ */
properties: { properties: {
// 场景值下标 // 场景值下标
actNum: { // actNum: {
type: Number, // type: Number,
value: -1, // value: -1,
observer(n) { // observer(n) {
this.getInfo() // this.getInfo()
if (n == 3) { // if (n == 3) {
this.setVideoCtx() // this.setVideoCtx()
} // }
} // }
}, // },
// 选中的产品 // // 选中的产品
activeNavIdx: { // activeNavIdx: {
type: Number, // type: Number,
value: 0 // value: 0
}, // },
cardInfo: { // cardInfo: {
type: Object, // type: Object,
value: {} // value: {}
}, // },
// 配置url // // 配置url
activeUrl: { // activeUrl: {
type: String, // type: String,
value: '' // value: ''
}, // },
sharephone: { sharephone: {
type: String, type: String,
value: '' value: ''
...@@ -39,6 +39,14 @@ Component({ ...@@ -39,6 +39,14 @@ Component({
showLeftFlag: { showLeftFlag: {
type: Boolean, type: Boolean,
value: false value: false
},
detailType: {
type: String,
value: 'pro'
},
proDetail: {
type: Object,
value: {}
} }
}, },
...@@ -48,7 +56,7 @@ Component({ ...@@ -48,7 +56,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, // productData,
proInfo: {}, proInfo: {},
prodItemVideo: '', //选中的场景下的video的第一个 prodItemVideo: '', //选中的场景下的video的第一个
tabAct: 0, tabAct: 0,
...@@ -59,6 +67,14 @@ Component({ ...@@ -59,6 +67,14 @@ Component({
imgTopArr: [] imgTopArr: []
}, },
// lifetimes: {
// attached() {
// setTimeout(() => {
// this.getImgHeight()
// }, 800)
// },
// },
/** /**
* 组件的方法列表 * 组件的方法列表
*/ */
...@@ -73,44 +89,58 @@ Component({ ...@@ -73,44 +89,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 = this.data.productData[actNum].filter(item => item.name != '全部') // const senceList = this.data.productData[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({ // this.setData({
proInfo, // proInfo,
productImgs: spcList.includes(actNum) ? proInfo.sceneImgs : (proInfo.productImgs ? proInfo.productImgs : item.productImgs), // productImgs: spcList.includes(actNum) ? proInfo.sceneImgs : (proInfo.productImgs ? proInfo.productImgs : item.productImgs),
tabList: spcList.includes(actNum) ? proInfo.tabList : norTabList, // tabList: spcList.includes(actNum) ? proInfo.tabList : norTabList,
prodItemVideo: item.videoList.length ? spcList.includes(actNum) ? item.videoList[proInfo.currentIndex] : item.videoList[activeNavIdx] : item.noVideoPicture[0] // prodItemVideo: item.videoList.length ? spcList.includes(actNum) ? item.videoList[proInfo.currentIndex] : item.videoList[activeNavIdx] : item.noVideoPicture[0]
}) // })
break // break
} // }
} // }
}, // },
handleLongPress(e) { handleLongPress(e) {
let { actnum, index } = e.target.dataset // 如果图片有长按事件 posterEventType: 1-无 2-有
console.log(actnum, index) let {item} = e.currentTarget.dataset
// 膨胀金活动,合作方式 if (item.posterEventType == 1) return
if (actnum == 99 && index == 4) { wx.downloadFile({
wx.downloadFile({ url: item.posterEventUrl,
// 示例 url,并非真实存在 success: function (res) {
url: 'https://scrm.glsx.com.cn/frontpdf/expand_agreement.pdf', const filePath = res.tempFilePath
wx.openDocument({
filePath: filePath,
success: function (res) { success: function (res) {
const filePath = res.tempFilePath
wx.openDocument({
filePath: filePath,
success: function (res) {
console.log('打开文档成功')
}
})
} }
}) })
} }
})
// let { actnum, index } = e.target.dataset
// console.log(actnum, index)
// // 膨胀金活动,合作方式
// if (actnum == 99 && index == 4) {
// wx.downloadFile({
// // 示例 url,并非真实存在
// 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('打开文档成功')
// }
// })
// }
// })
// }
}, },
async loadImg(e){ async loadImg(e){
this.data.loadedNum += 1 this.data.loadedNum += 1
...@@ -121,7 +151,7 @@ Component({ ...@@ -121,7 +151,7 @@ Component({
return prev + cur.height; return prev + cur.height;
}, 0) }, 0)
imgTopArr.push(top) imgTopArr.push(top)
const imgList = await this.getDomInfo('.img-item') const imgList = await this.getDomInfo('.img-items')
imgList.reduce((prev, cur, index)=>{ imgList.reduce((prev, cur, index)=>{
if(index<imgList.length-1){ if(index<imgList.length-1){
imgTopArr.push(prev + cur.height) imgTopArr.push(prev + cur.height)
...@@ -154,7 +184,7 @@ Component({ ...@@ -154,7 +184,7 @@ Component({
let _this = this let _this = this
query query
.selectAll('.img-item') .selectAll('.img-items')
.boundingClientRect(react => { .boundingClientRect(react => {
react.forEach((item, index) => { react.forEach((item, index) => {
//44 tab的高度 //44 tab的高度
...@@ -171,9 +201,11 @@ Component({ ...@@ -171,9 +201,11 @@ Component({
// },500) // },500)
}, },
// 1.3查看活动详情按钮 // 1.3查看活动详情按钮
checkActive() { checkActive(e) {
let { activeUrl } = this.data // let { activeUrl } = this.data
wx.$router.jumpH5(activeUrl); // wx.$router.jumpH5(activeUrl);
let { url } = e.currentTarget.dataset
wx.$router.jumpH5(url);
}, },
onClickTab(event) { onClickTab(event) {
......
...@@ -78,6 +78,10 @@ page { ...@@ -78,6 +78,10 @@ page {
} }
.prod-detail { .prod-detail {
.img-items {
width: 100%;
position: relative;
}
.occupancy { .occupancy {
height: 120rpx; height: 120rpx;
...@@ -85,6 +89,7 @@ page { ...@@ -85,6 +89,7 @@ page {
.img-item { .img-item {
position: relative; position: relative;
width: 100%;
} }
.phone { .phone {
...@@ -108,6 +113,9 @@ page { ...@@ -108,6 +113,9 @@ page {
width: 100%; width: 100%;
text-align: center; text-align: center;
position: absolute; position: absolute;
// bottom: 94rpx;
// right: 60rpx;
// font-size: 24rpx;
bottom: 64rpx; bottom: 64rpx;
right: 0; right: 0;
font-weight: 600; font-weight: 600;
...@@ -115,7 +123,6 @@ page { ...@@ -115,7 +123,6 @@ page {
color: #3666FE; color: #3666FE;
text-decoration: underline; text-decoration: underline;
} }
.crowd-video { .crowd-video {
width: calc(100% - 64rpx); width: calc(100% - 64rpx);
height: 386rpx; height: 386rpx;
...@@ -238,6 +245,11 @@ page { ...@@ -238,6 +245,11 @@ page {
height: 490rpx; height: 490rpx;
} }
.img-item33 {
width: 100%;
height: 2002rpx;
}
.img-item46 { .img-item46 {
width: 100%; width: 100%;
height: 1684rpx; height: 1684rpx;
...@@ -287,6 +299,24 @@ page { ...@@ -287,6 +299,24 @@ page {
width: 100%; width: 100%;
height: 428rpx; height: 428rpx;
} }
.img-item40 {
height: 1564rpx;
}
.img-item41 {
height: 1144rpx;
}
.img-item42 {
height: 1148rpx;
}
.img-item43 {
height: 3504rpx;
}
.img-item44 {
height: 3188rpx;
}
.img-item45 {
height: 1092rpx;
}
} }
} }
...@@ -340,4 +370,4 @@ page { ...@@ -340,4 +370,4 @@ page {
height: 4rpx !important; height: 4rpx !important;
background: #3666fe; background: #3666fe;
} }
} }
\ No newline at end of file \ No newline at end of file
<!-- packagesList/pages/productDetail/components/proDetail/proDetail.wxml --> <!-- packagesList/pages/productDetail/components/proDetail/proDetail.wxml -->
<view class="view-prod custom-class"> <view class="view-prod custom-class">
<view class="pro-head calc-wrap"> <view class="pro-head calc-wrap">
<!-- 有视频 --> <!-- 产品详情是视频 -->
<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>
</view> </view>
<view class="tab-wrap calc-wrap"> <view class="tab-wrap calc-wrap" wx:if="{{proDetail.detailList}}" >
<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-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 bindload="loadImg" data-len="{{ productImgs.length}}" webp wx:if="{{ index < 3}}" webp mode="widthFix" class="img-item {{item.className?item.className:''}}" src="{{item.url?item.url:item}}?v={{img_version}}"> <image webp bindload="loadImg" data-len="{{ proDetail.detailList.length}}" mode="widthFix" class="img-items" src="{{item.posterUrl}}?v={{img_version}}" bindlongpress="handleLongPress" data-item="{{item}}">
<!-- <block wx:if="{{ index == 0}}">
<view class="phone" bindtap="phoneCall" data-phone="{{sharephone}}"> <!-- 第一张图的点击拨打电话事件 -->
<block wx:if="{{ index == 0}}">
<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" /> <glsx-image webp src="index/phone.png" class="icon" />
请联系我 请联系我
<view style="color:#3666fe">{{sharephone}}</view> <view style="color:#3666fe">{{proDetail.phone}}</view>
</view> </view>
</block> -->
<!-- 查看活动那个详情 1.3才有 -->
<block wx:if="{{ index == 0 && actNum == 3 && activeUrl}}">
<view class="check-act" bindtap="checkActive">点击查看活动页面</view>
</block> </block>
<!-- 如果有活动跳转 -->
<!-- 按钮点击事件 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 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 bindlongpress="handleLongPress" data-actnum="{{actNum}}" data-index="{{index}}" bindload="loadImg" data-len="{{ productImgs.length}}" webp wx:if="{{ index >= 3 && !showLeftFlag}}" mode="widthFix" webp class="img-item {{item.className?item.className:''}}" src="{{item.url?item.url:item}}?v={{img_version}}">
<!-- 众筹-视频 -->
<block wx:if="{{ index == 3 && actNum == 3 }}">
<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底部 占位元素 --> <!-- padding底部 占位元素 -->
......
<!--packagesList/pages/productDetail/productDetail.wxml--> <!--packagesList/pages/productDetail/productDetail.wxml-->
<pro-detail id="pro-detail" showLeftFlag="{{showLeftFlag}}" sharephone="{{sharephone}}" actNum="{{actNum}}" activeNavIdx="{{activeNavIdx}}" activeUrl="{{activeUrl}}"></pro-detail> <!-- <pro-detail id="pro-detail" showLeftFlag="{{showLeftFlag}}" sharephone="{{sharephone}}" actNum="{{actNum}}" activeNavIdx="{{activeNavIdx}}" activeUrl="{{activeUrl}}"></pro-detail> -->
<block wx:if="{{!hasProduct}}">
<no-product></no-product>
</block>
<block wx:else>
<pro-detail id="pro-detail" showLeftFlag="{{showLeftFlag}}" sharephone="{{sharephone}}" proDetail="{{productData}}"></pro-detail>
<!-- <block wx:if="{{showLeftFlag}}"> <!-- <block wx:if="{{showLeftFlag}}">
<button class="more-btn" bindgetphonenumber="getUserInfo" open-type="getPhoneNumber"> <button class="more-btn" bindgetphonenumber="getUserInfo" open-type="getPhoneNumber">
...@@ -7,4 +12,5 @@ ...@@ -7,4 +12,5 @@
</button> </button>
</block> --> </block> -->
<!-- 申请按钮 不是分享出去的显示按钮 --> <!-- 申请按钮 不是分享出去的显示按钮 -->
<apply-button wx:if="{{!isShare}}" downShow="{{false}}"></apply-button>
\ No newline at end of file \ No newline at end of file
<apply-button wx:if="{{!isShare}}" downShow="{{false}}"></apply-button>
</block>
\ No newline at end of file \ No newline at end of file
// packagesList/pages/videoDetal/videoDetal.js
import { IMG_URL } from "~/utils/constantData.js"; // packagesList/pages/videoDetal/videoDetal.js
// import { senceData, productData } from "../constant/senceData"; import {
import { senceData, productData } from "~/pages/tab/discovery/constant/senceData"; IMG_URL
// 导入方法 } from "~/utils/constantData.js";
import { behavior as computedBehavior } from "~/utils/lib/miniprogram-computed"; // import { senceData, productData } from "../constant/senceData";
import utils from '~/utils/util.js' import {
senceData,
productData
} from "~/pages/tab/discovery/constant/senceData";
// 导入方法
import {
behavior as computedBehavior
} from "~/utils/lib/miniprogram-computed";
import utils from '~/utils/util.js'
import busassistantApi from "~/api/busassistantApi/index";
Page({ Page({
noPageAuth: true, noPageAuth: true,
/** /**
* 页面的初始数据 * 页面的初始数据
*/ */
data: { data: {
senceData, // senceData,
productData, // productData,
videoItem: { // videoItem: {
index: 0, // index: 0,
videoList: [], // videoList: [],
videoUrl: '', // videoUrl: '',
isShare: false,//是否是被分享出去 // isShare: false,//是否是被分享出去
tabsActive: 1 // tabsActive: 1
}, // },
isShare: false,
hasVideo: true,
videoObj: {}, videoObj: {},
showAuth: false videoData: {},
videoId: '',
showAuth: false,
sceneCode: ''
}, },
/** /**
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
onLoad(options) { async onLoad(options) {
wx.$router.getData(res => { if (utils.isEmptyObj(options)) return
this.setData({ const { id,typeId,isDigitalCase,tabsActive, isShare } = options;
videoItem: res let videoLikeList = [];
}) let videoData = await this.getDetailWithLike(id);
}) videoLikeList = videoData.likeList
if (!utils.isEmptyObj(options)) {
let { isShare, videoIndex, tabActive, sceneCode, leftMenuIndex = 0, tabsActive } = options; if (isDigitalCase=='true') {
let item = this.data.productData[tabActive].find(item => item.sceneCode == sceneCode) // 调接口获取当前一级菜单下所有视频
let videoList = [] videoLikeList = await this.getVideoLikeList(typeId,tabsActive);
let videoUrl = '' this.setData({
let videoObj = {} isDigitalCase: true
if (tabsActive == '3') { })
videoList = item?.operationVideoList }
videoUrl = item?.operationVideoList[videoIndex]?.videoUrl if(!videoData || videoData?.status == 2) {
videoObj = item?.operationVideoList[videoIndex] this.setData({
}else{ isLoadding: false,
videoList = item?.videoList, hasVideo: false
videoUrl = item.videoList[videoIndex]?.videoUrl })
videoObj = item?.videoList[videoIndex] return
}
let videoItem = {
index: videoIndex,
videoList: videoList,
videoUrl: videoUrl,
tabsActive: tabsActive
}
this.setData({
videoItem: videoItem,
isShare: isShare,
videoObj: videoObj,
leftMenuIndex: leftMenuIndex
})
this.setpagesTitle()
this.shareDataFn(options)
} }
this.setData({
videoData,
videoLikeList,
videoId: id,
isLoadding: false,
typeId,
isShare,
tabsActive
});
this.setpagesTitle(videoData.proName)
this.changeShareData()
}, },
//接受跳转的路由参数(小程序页面跳转) //接受跳转的路由参数(小程序页面跳转)
onRoute(options) { async onRoute(options) {
if (!options || utils.isEmptyObj(options) || options.isShare) return if (!options || utils.isEmptyObj(options) || options.isShare) return
let { scenIndex, videoList, index, leftMenuIndex = 0 } = options let { id,typeId,sceneCode,tabsActive } = options;
options.videoIndex = index let videoLikeList = [];
options.tabActive = scenIndex let videoData = await this.getDetailWithLike(id);
this.setData({ videoLikeList = videoData.likeList
videoObj: videoList[index],
leftMenuIndex: leftMenuIndex // 判断是不是在数字化转型案例菜单下
}) if (!sceneCode) {
this.setpagesTitle() // 调接口获取当前一级菜单下所有视频
this.shareDataFn(options) videoLikeList = await this.getVideoLikeList(typeId,tabsActive);
},// 分享数据函数 this.setData({
shareDataFn(options) { isDigitalCase: true
if (!options || utils.isEmptyObj(options)) return })
let { tabActive, videoIndex, tabsActive } = options }
if(!videoData || videoData?.status == 2) {
this.setData({
isLoadding: false,
hasVideo: false
})
return
}
this.setData({ this.setData({
tabsActive, videoData,
tabActive: tabActive, videoLikeList,
videoIndex: videoIndex, isLoadding: false,
},()=>{ videoId: id,
this.changeShareData(options) typeId,
tabsActive
}); });
this.setpagesTitle(videoData.proName)
this.changeShareData()
},// 分享数据函数
// 获取视频详情
getDetailWithLike(id) {
return new Promise((resolve) => {
let _data;
busassistantApi.getDetailWithLike({id}).then((res) => {
console.log(res);
_data = res.data;
resolve(_data);
});
});
}, },
changeShareData(options) { changeShareData() {
let { senceData, tabActive, videoIndex, videoObj, leftMenuIndex = 0, tabsActive } = this.data let { title } = this.data.videoData
let { sceneCode, videoId, isDigitalCase,typeId,tabsActive } = this.data
// // 设置转发标题 // // 设置转发标题
// let userInfoObj = wx.$storage.get("userInfo"); // let userInfoObj = wx.$storage.get("userInfo");
// // #服务商账号#取该分享者商户的联系人字段,无则取商户简称,无则取商户全称 // // #服务商账号#取该分享者商户的联系人字段,无则取商户简称,无则取商户全称
// let name = userInfoObj.merchantName; // let name = userInfoObj.merchantName;
this.shareTitle = `给您分享一个${videoObj.name} 视频`; let { proName } = this.data.videoData
this.shareTitle = `给您分享一个${proName} 视频`;
//分享的数据 //分享的数据
let senceItem = productData[tabActive][leftMenuIndex] // let senceItem = productData[tabActive][leftMenuIndex]
this.shareQuery = `sceneCode=${senceItem?.sceneCode}&isShare=${true}&tabActive=${tabActive}&videoIndex=${videoIndex}&leftMenuIndex=${leftMenuIndex}&tabsActive=${tabsActive}` this.shareQuery = `sceneCode=${sceneCode}&isShare=${true}&id=${videoId}&isDigitalCase=${isDigitalCase}&typeId=${typeId}&tabsActive=${tabsActive}`
this.shareAppMessage = { this.shareAppMessage = {
title:this.shareTitle, title:this.shareTitle,
path: `/${this.route}?${this.shareQuery}`, path: `/${this.route}?${this.shareQuery}`,
...@@ -107,22 +140,41 @@ Page({ ...@@ -107,22 +140,41 @@ Page({
} }
}, },
// 切换视频 // 切换视频
chooseVideo(e) { async chooseVideo(e) {
let { detail } = e const {title, id} = e.detail
let videoData = await this.getDetailWithLike(id);
this.setData({ this.setData({
videoIndex: detail.index, videoId: id,
['videoItem.index']: detail.index, videoData
['videoItem.videoUrl']: detail?.info?.videoUrl,
videoObj: detail?.info
}) })
this.setpagesTitle()
this.setpagesTitle(videoData.proName)
this.changeShareData() this.changeShareData()
}, },
// 获取一级菜单下所有视频
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 { videoObj } = this.data // let { videoObj } = this.data
let url = videoObj.videoUrl // let url = videoObj.videoUrl
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){
...@@ -132,7 +184,7 @@ Page({ ...@@ -132,7 +184,7 @@ Page({
}else{ }else{
wx.$api.showToast('正在下载视频...') wx.$api.showToast('正在下载视频...')
wx.downloadFile({ wx.downloadFile({
url: url, url: vedioUrl,
success(res) { success(res) {
if (res.statusCode === 200) { if (res.statusCode === 200) {
wx.saveVideoToPhotosAlbum({ wx.saveVideoToPhotosAlbum({
...@@ -169,11 +221,10 @@ Page({ ...@@ -169,11 +221,10 @@ Page({
*/ */
onReady() { }, onReady() { },
//设置标题 //设置标题
setpagesTitle() { setpagesTitle(title) {
//设置标题 //设置标题
let { videoObj } = this.data
setTimeout(() => { setTimeout(() => {
utils.setNavigationBarTitle(videoObj.name) utils.setNavigationBarTitle(title)
}, 100) }, 100)
}, },
......
<!--packagesList/pages/videoDetal/videoDetal.wxml--> <!--packagesList/pages/videoDetal/videoDetal.wxml-->
<gl-video-detail list="{{videoItem.videoList}}" index="{{videoItem.index}}" bindchooseVideo="chooseVideo"></gl-video-detail> <!-- <gl-video-detail list="{{videoItem.videoList}}" index="{{videoItem.index}}" bindchooseVideo="chooseVideo"></gl-video-detail> -->
<block wx:if="{{!hasVideo}}">
<no-product></no-product>
</block>
<block wx:else>
<gl-video-detail list="{{videoData}}" likeList="{{videoLikeList}}" bind:chooseVideo="chooseVideo"></gl-video-detail>
<!-- 申请按钮 --> <!-- 申请按钮 -->
<apply-button wx:if="{{!isShare}}" bindvideodown="downVideo"></apply-button> <apply-button wx:if="{{!isShare}}" bindvideodown="downVideo"></apply-button>
<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> </block>
\ No newline at end of file \ No newline at end of file
...@@ -13,8 +13,8 @@ Component({ ...@@ -13,8 +13,8 @@ Component({
{ title: '订单量', num: s.orderCount } { title: '订单量', num: s.orderCount }
] ]
v.sortList = [ v.sortList = [
{ title: '访客率', sort: s.fansRate }, { title: '访客率', sort: Number(s.fansRate).toFixed(2) },
{ title: '转化率', sort: s.conversionRate } { title: '转化率', sort: Number(s.conversionRate).toFixed(2) }
] ]
} }
this.setData({ data: v }) this.setData({ data: v })
......
...@@ -4,119 +4,121 @@ import index_const from "~/packagesList/outDetail/index_const" ...@@ -4,119 +4,121 @@ import index_const from "~/packagesList/outDetail/index_const"
import { commentTime } from '~/utils/format' import { commentTime } from '~/utils/format'
Page({ Page({
/** /**
* 页面的初始数据 * 页面的初始数据
*/ */
data: { data: {
list: [], list: [],
allNum: 0, allNum: 0,
todayNum: 0, todayNum: 0,
activityTypList: index_const.data.activityTypList, activityTypList: index_const.data.activityTypList,
IMG_URL:IMG_URL_STORE, IMG_URL: IMG_URL_STORE,
isPravite:false isPravite: false
}, },
/** /**
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
onLoad(options) { onLoad(options) {
}, },
onRoute(options) { onRoute(options) {
let activityId = options.activityId wx.showLoading()
ActivityApi.getActivityVisitorList({ let activityId = options.activityId
activityId, ActivityApi.getActivityVisitorList({
staffFlag:true activityId,
}).then(res => { staffFlag: true
res.visitorList && res.visitorList.forEach(val => { }).then(res => {
val.lastVisitFormatTime = commentTime(val.lastVisitDate) res.visitorList && res.visitorList.forEach(val => {
if(!val.customerPhone&&val.guestId){ val.lastVisitFormatTime = commentTime(val.lastVisitDate)
val.gId = (val.guestId.split('_')).pop() || '' if (!val.customerPhone && val.guestId) {
val.gId = (val.guestId.split('_')).pop() || ''
}
})
this.setData({
allNum: res.visitorTotal,
todayNum: res.todayTotal,
list: res.visitorList
})
wx.hideLoading()
})
},
toCopyName(e) {
const { name } = e.currentTarget.dataset
if (name) {
wx.setClipboardData({
data: name
})
} }
}) },
this.setData({
allNum: res.visitorTotal, // 打电话
todayNum: res.todayTotal, callPhone(e) {
list: res.visitorList let { mobile } = e.currentTarget.dataset
}) wx.makePhoneCall({
}) phoneNumber: mobile.toString()
},
toCopyName(e){
const {name} = e.currentTarget.dataset
if(name){
wx.setClipboardData({
data: name
})
}
},
// 打电话
callPhone(e) {
let { mobile } = e.currentTarget.dataset
wx.makePhoneCall({
phoneNumber: mobile.toString()
})
},
// 复制微信号
copyWechart(e) {
let { wechartno } = e.currentTarget.dataset
wx.setClipboardData({
data: wechartno.toString(),
success (res) {
wx.showToast({
title: '微信号已复制',
icon: "none"
}) })
} },
}) // 复制微信号
}, copyWechart(e) {
let { wechartno } = e.currentTarget.dataset
wx.setClipboardData({
data: wechartno.toString(),
success(res) {
wx.showToast({
title: '微信号已复制',
icon: "none"
})
}
})
},
/** /**
* 生命周期函数--监听页面初次渲染完成 * 生命周期函数--监听页面初次渲染完成
*/ */
onReady() { onReady() {
}, },
/** /**
* 生命周期函数--监听页面显示 * 生命周期函数--监听页面显示
*/ */
onShow() { onShow() {
}, },
/** /**
* 生命周期函数--监听页面隐藏 * 生命周期函数--监听页面隐藏
*/ */
onHide() { onHide() {
}, },
/** /**
* 生命周期函数--监听页面卸载 * 生命周期函数--监听页面卸载
*/ */
onUnload() { onUnload() {
}, },
/** /**
* 页面相关事件处理函数--监听用户下拉动作 * 页面相关事件处理函数--监听用户下拉动作
*/ */
onPullDownRefresh() { onPullDownRefresh() {
}, },
/** /**
* 页面上拉触底事件的处理函数 * 页面上拉触底事件的处理函数
*/ */
onReachBottom() { onReachBottom() {
}, },
/** /**
* 用户点击右上角分享 * 用户点击右上角分享
*/ */
onShareAppMessage() { onShareAppMessage() {
} }
}) })
\ No newline at end of file \ No newline at end of file
...@@ -61,7 +61,7 @@ page{ ...@@ -61,7 +61,7 @@ page{
} }
.tab-item-active{ .tab-item-active{
font-weight: 600; font-weight: 600;
font-size: 36rpx; font-size: 34rpx;
color: #323436; color: #323436;
} }
} }
......
<view class="container" style="padding-bottom: calc(100rpx + {{isFullSucreen ? '34' : 0}}px);"> <view class="container" style="padding-bottom: calc(100rpx + {{isFullSucreen ? '34' : 0}}px);">
<navigation-bar bindnavbarReady="navbarReady" navStyle="{{navStyle}}"> <navigation-bar bindnavbarReady="navbarReady">
<view class="my-tab"> <view class="my-tab">
<view wx:for="{{navList}}" wx:key="index" bindtap="changeMyTab" data-id="{{index}}" class='my-tab-item {{myTabIdx==index ? "tab-item-active": ""}}'>{{item}}</view> <view wx:for="{{tabList}}" wx:key="index" bindtap="changeMyTab" data-id="{{index}}" class='my-tab-item {{myTabIdx==index ? "tab-item-active": ""}}'>{{item.name}}</view>
</view> </view>
</navigation-bar> </navigation-bar>
<view class="topBg" style="height:{{headerHeight}}px; background-image: url('https://img02.glsx.com.cn/weapp/resource/miniprogram/store-assistant/mine_center_bg.png?v=1.0.3')"></view> <view class="topBg" style="height:{{headerHeight}}px; background-image: url('https://img02.glsx.com.cn/weapp/resource/miniprogram/store-assistant/mine_center_bg.png?v=1.0.3')"></view>
<!-- 系统订阅 --> <!-- 系统订阅 -->
<block wx:if="{{myTabIdx == 1}}"> <block wx:if="{{myTabIdx == 1}}">
<gl-subscription list="{{subscriptionSystemData}}" bindmenuClick="sysMenuClick" bannerUrl="{{subscriptionBannerUrl}}" bind:proClick="proClick" bindcurrentScen="getCurrentScen" data-name="客户数字化" bind:videoClick="videoClick" /> <!-- <gl-subscription list="{{subscriptionSystemData}}" bindmenuClick="sysMenuClick" bannerUrl="{{subscriptionBannerUrl}}" bind:proClick="proClick" bindcurrentScen="getCurrentScen" data-name="客户数字化" bind:videoClick="videoClick" /> -->
<gl-subscription list="{{systemData}}" novideo-img="novideo-img" bindmenuClick="sysMenuClick" bind:proClick="proClick" data-name="客户数字化" bind:videoClick="videoClick" bindsenceClick="senceClick" />
</block> </block>
<!-- 增值服务 --> <!-- 增值服务 -->
<block wx:if="{{myTabIdx==0 && resScenceList.length && showPage}}"> <block wx:if="{{myTabIdx==0}}">
<gl-scenario discoverIndex="{{curTabIdx}}" currentScenIndex="{{curTabId}}" novideo-img="novideo-img" list="{{resScenceList}}" activityList="{{activityList}}" bindactivityClick="activityClick" bindproClick="proClick" bind:videoClick="videoClick" bindsenceClick="senceClick" activityList="{{activityList}}" bindleftClick="leftClick"></gl-scenario> <!-- <gl-scenario discoverIndex="{{curTabIdx}}" currentScenIndex="{{curTabId}}" novideo-img="novideo-img" list="{{resScenceList}}" activityList="{{activityList}}" bindactivityClick="activityClick" bindproClick="proClick" bind:videoClick="videoClick" bindsenceClick="senceClick" activityList="{{activityList}}" bindleftClick="leftClick"></gl-scenario> -->
<gl-scenario list="{{productData}}" activityList="{{activityList}}" novideo-img="novideo-img" bindactivityClick="activityClick" bindproClick="proClick" bind:videoClick="videoClick" bindsenceClick="senceClick" bindleftClick="leftClick" bindcurrentScen="getCurrentScen"></gl-scenario>
</block> </block>
<!-- 测算按钮 --> <!-- 测算按钮 -->
<block wx:if="{{myTabIdx==1 || myTabIdx==0 && resScenceList.length && showPage}}"> <block wx:if="{{myTabIdx==1 || myTabIdx==0 && resScenceList.length && showPage}}">
...@@ -20,7 +22,7 @@ ...@@ -20,7 +22,7 @@
</view> </view>
</block> </block>
<!-- 增值服务无数据时展示 --> <!-- 增值服务无数据时展示 -->
<block wx:if="{{myTabIdx==0 && resScenceList.length<=0 && showPage}}"> <block wx:if="{{myTabIdx==0 && productData.length<=0 && showPage}}">
<view class="emptyData" style="margin-top: {{headerHeight+32}}px;"> <view class="emptyData" style="margin-top: {{headerHeight+32}}px;">
<glsx-image webp src="store-assistant/toLink.png" class="nodata_icon"></glsx-image> <glsx-image webp src="store-assistant/toLink.png" class="nodata_icon"></glsx-image>
<view class="tip"> <view class="tip">
......
...@@ -75,7 +75,6 @@ Page({ ...@@ -75,7 +75,6 @@ Page({
// 重新刷新 // 重新刷新
// let { detail } = e || null // let { detail } = e || null
// console.log(detail) // console.log(detail)
console.log(e)
if (e) { if (e) {
this.setUserInfo() this.setUserInfo()
let clientModule = this.selectComponent('#client') let clientModule = this.selectComponent('#client')
...@@ -85,7 +84,7 @@ Page({ ...@@ -85,7 +84,7 @@ Page({
// merchantModule.init && merchantModule.init() // merchantModule.init && merchantModule.init()
} }
let { isSuper, userInfo } = this.data let { isSuper, userInfo } = this.data
console.log(isSuper)
// 判断是超管才需要切换账号 // 判断是超管才需要切换账号
if (isSuper) { if (isSuper) {
USERAPI.adminSelectLogin() USERAPI.adminSelectLogin()
...@@ -101,7 +100,6 @@ Page({ ...@@ -101,7 +100,6 @@ Page({
item.act = true item.act = true
} }
}) })
console.log(subIndex)
this.setData({ this.setData({
merchantRange, merchantRange,
subIndex subIndex
...@@ -110,7 +108,6 @@ Page({ ...@@ -110,7 +108,6 @@ Page({
.catch(err => { }) .catch(err => { })
} else { } else {
let merchantRange = [{ merchantId: userInfo.subLoginUser.merchantId, merchantName: userInfo.subLoginUser.merchantName }] let merchantRange = [{ merchantId: userInfo.subLoginUser.merchantId, merchantName: userInfo.subLoginUser.merchantName }]
console.log('merchantRange', merchantRange)
this.setData({ this.setData({
merchantRange, merchantRange,
subIndex: 0 subIndex: 0
......
...@@ -92,5 +92,6 @@ ...@@ -92,5 +92,6 @@
"editorSetting": { "editorSetting": {
"tabIndent": "insertSpaces", "tabIndent": "insertSpaces",
"tabSize": 2 "tabSize": 2
} },
"libVersion": "2.31.0"
} }
\ No newline at end of file \ No newline at end of file
...@@ -120,7 +120,7 @@ ...@@ -120,7 +120,7 @@
} }
}, },
"setting": { "setting": {
"urlCheck": true "urlCheck": false
}, },
"projectname": "store-assistant-assemble" "projectname": "store-assistant-assemble"
} }
\ No newline at end of file \ No newline at end of file
...@@ -110,7 +110,7 @@ const domain = { ...@@ -110,7 +110,7 @@ const domain = {
dev: { dev: {
dj: 'https://dj.dev.glsx.com.cn', dj: 'https://dj.dev.glsx.com.cn',
scrm: 'https://scrm.dev.glsx.com.cn', scrm: 'https://scrm.dev.glsx.com.cn',
merchant: "https://rop-merchant.dev.glsx.com.cn", merchant: "http://rop-merchant.dev.glsx.com.cn",
}, },
uat: { uat: {
dj: 'https://dj.test.glsx.com.cn', dj: 'https://dj.test.glsx.com.cn',
......
...@@ -23,12 +23,10 @@ class Request { ...@@ -23,12 +23,10 @@ class Request {
let projectName = params.apiProjectName || this.getRopProject(params.method) let projectName = params.apiProjectName || this.getRopProject(params.method)
if (!projectName) projectName = this.getRopProject(params.method) if (!projectName) projectName = this.getRopProject(params.method)
let path = pathEnum[projectName] let path = pathEnum[projectName]
console.log(path,11)
if (!path) { if (!path) {
path = requestPath == 'dj' ? `/rop-dj-${projectName}/` : `/rop-scrm-${projectName}/` path = requestPath == 'dj' ? `/rop-dj-${projectName}/` : `/rop-scrm-${projectName}/`
} }
params = this.getData(params, requestPath) params = this.getData(params, requestPath)
console.log(domain,requestPath,9)
wx.request({ wx.request({
url: `${domain[requestPath]}${path}router?method=${params.method}`, url: `${domain[requestPath]}${path}router?method=${params.method}`,
data: params, data: params,
...@@ -63,7 +61,6 @@ class Request { ...@@ -63,7 +61,6 @@ class Request {
if (code == '0') { if (code == '0') {
resolve(data.data) resolve(data.data)
} else { } else {
// console.trace(data)
wx.showToast({ wx.showToast({
title: message || '网络请求失败', title: message || '网络请求失败',
icon: 'none' icon: 'none'
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!