Commit cb664ab0 by 胡悦

添加公司介绍和修改手机号授权组件

1 parent 86764238
...@@ -24,11 +24,12 @@ App({ ...@@ -24,11 +24,12 @@ App({
/**挂载到wx对象 */ /**挂载到wx对象 */
this.autoUpdate() this.autoUpdate()
wx.$storage = $Storage /** 挂载全局缓存方法 */ wx.$storage = $Storage /** 挂载全局缓存方法 */
wx.$eventbus = eventbus // wx.$eventbus = eventbus
wx.$util = util wx.$util = util
wx.$router = router wx.$router = router
wx.$imgUrl = 'https://img02.glsx.com.cn/weapp/resource/miniprogram/ai-card/' wx.$imgUrl = 'https://img02.glsx.com.cn/weapp/resource/miniprogram/ai-card/'
wx.$appId = wx.getAccountInfoSync().miniProgram.appId wx.$appId = wx.getAccountInfoSync().miniProgram.appId
this.clearFileSystem()
const systemInfo = wx.$storage.get('aicard_system_info') const systemInfo = wx.$storage.get('aicard_system_info')
if (!systemInfo) if (!systemInfo)
wx.getSystemInfo({ wx.getSystemInfo({
...@@ -39,8 +40,10 @@ App({ ...@@ -39,8 +40,10 @@ App({
if (options.path != 'pages/tab/index/index') { if (options.path != 'pages/tab/index/index') {
this.login() this.login()
} }
// wx.showMeasure = false
wx.showMeasure = !!(options.query && options.query.scene) wx.showMeasure = !!(options.query && options.query.scene)
wx.onMemoryWarning(function () {
console.log('onMemoryWarningReceive')
})
}, },
login(returnResponse) { login(returnResponse) {
let _this = this let _this = this
...@@ -185,5 +188,21 @@ App({ ...@@ -185,5 +188,21 @@ App({
// 新版本下载失败 // 新版本下载失败
}) })
}, },
// 清内存
clearFileSystem: function() {
const fn = wx.getFileSystemManager()
fn.readdir({
dirPath: wx.env.USER_DATA_PATH,
success({
files
}) {
files.length && files.map(e => {
fn.unlink({
filePath: `${wx.env.USER_DATA_PATH}/${e}`
})
})
}
})
},
globalData: {} globalData: {}
}) })
...@@ -22,6 +22,13 @@ Component({ ...@@ -22,6 +22,13 @@ Component({
showIcon: { showIcon: {
type: Boolean, type: Boolean,
value: true value: true
},
/**
* type: 场景类型: 1.首页,整行;2.详情中的查看更多和申请合作切换;3.透明的;
*/
type: {
type: Number,
value: 1
} }
}, },
observers: {}, observers: {},
......
.fixBottom {
position: fixed;
bottom: 0;
width: 100%;
box-sizing: border-box;
background-color: #fff;
padding: 16rpx 48rpx 76rpx;
box-shadow: inset 0 2rpx 0 0 #F2F3F7;
filter: blur(0);
.phoneNumber {
width: 100%;
color: #fff;
background-color: #5850FF;
font-weight: 500;
font-size: 32rpx;
color: #FFFFFF;
letter-spacing: 0;
}
}
button{
margin: 0;
line-height: 88rpx;
}
\ No newline at end of file \ No newline at end of file
<block wx:if="{{isImage}}"> <view wx:if="{{type}}" class="fixBottom">
<button class="phoneNumber" open-type="getPhoneNumber" bindgetphonenumber="getPhoneNumber">合作申请</button>
</view>
<!-- <block wx:else>
<block wx:if="{{isImage}}">
<button class="imageBtn" open-type="getPhoneNumber" bindgetphonenumber="getPhoneNumber"> <button class="imageBtn" open-type="getPhoneNumber" bindgetphonenumber="getPhoneNumber">
</button> </button>
</block> </block>
<block wx:else> <block wx:else>
<button class="{{isHidden ? 'hidden-phone':'phone-number'}}" open-type="getPhoneNumber" bindgetphonenumber="getPhoneNumber"> <button class="{{isHidden ? 'hidden-phone':'phone-number'}}" open-type="getPhoneNumber" bindgetphonenumber="getPhoneNumber">
<image wx:if="{{showIcon}}" class="icon-arrow" webp src="{{IMGURL}}home/icon-arrow.png"></image> <image wx:if="{{showIcon}}" class="icon-arrow" webp src="{{IMGURL}}home/icon-arrow.png"></image>
{{phoneText}} {{phoneText}}
<image wx:if="{{showIcon}}" class="icon-arrow" webp src="{{IMGURL}}home/icon-arrow.png"></image> <image wx:if="{{showIcon}}" class="icon-arrow" webp src="{{IMGURL}}home/icon-arrow.png"></image>
</button> </button>
</block>
\ No newline at end of file \ No newline at end of file
</block>
</block> -->
\ No newline at end of file \ No newline at end of file
module.exports = Behavior({
methods: {
/** 跳转门店助手 */
toStoreMiniProgram () {
wx.$util.getMockConfig().then(({storeParams, storeappId}) => {
console.log(storeParams, storeappId)
wx.navigateToMiniProgram({
appId: storeappId,
path: 'packageStoreAssistant/packageAuth/pages/authentication/loading/loading',
extraData: storeParams,
envVersion: 'trial',
success(res) {
console.log(res, storeParams)
// 打开成功
}
})
})
},
/** 跳转生意助手 */
toBusinessMiniProgram (){
wx.$util.getMockConfig().then(({businessParams, businessappId}) => {
console.log(businessParams, businessappId)
wx.navigateToMiniProgram({
appId: businessappId,
path: 'login/loading/loading',
extraData: businessParams,
envVersion: 'trial',
success(res) {
// 打开成功
}
})
})
}
}
})
\ No newline at end of file \ No newline at end of file
import componentsMixin from './componentsMixin' import componentsMixin from './componentsMixin'
import menuMixin from './menuMixin'
import shareTrackMixin from './shareTrackMixin' import shareTrackMixin from './shareTrackMixin'
import commonMixin from './commonMixin'
module.exports = { module.exports = {
componentsMixin, componentsMixin,
menuMixin, shareTrackMixin,
shareTrackMixin commonMixin
} }
\ No newline at end of file \ No newline at end of file
/*
* @Description:
* @Author: huyue
* @Date: 2022-12-09 13:58:15
* @LastEditors: huyue
* @LastEditTime: 2022-12-09 14:34:08
*/
import { trackData } from "../utils/data";
module.exports = Behavior({
data: {
menuList: ["企微魔方", "数字化权益", "智能线索", "D+增值转化"],
templateMethods: [{"tap": "selectIntroduce"}],
curIntroduceIndex: 0,
menuTab: [trackData.CUBE,trackData.EQUITY,trackData.CLUE],
clueAutoplay: true
},
methods: {
// 0-企微魔方 1-数字化权益 2-智能线索 3-D+增值转化
selectIntroduce(e) {
const curIntroduceIndex = e.currentTarget.dataset.index;
this.setData({
clueAutoplay: false
})
switch(curIntroduceIndex) {
case 3:
// wx.$router.go('scene');
// wx.$router.go('addTransform', {notIntercept: true});
wx.showToast({
title: '敬请期待',
icon: 'none'
})
// wx.$Track.sendTrack(trackData.DIJIA)
break
case 2:
this.setData({
curIntroduceIndex: curIntroduceIndex,clueAutoplay: true
})
wx.$Track.sendTrack(this.data.menuTab[this.data.curIntroduceIndex]);
break
default:
this.setData({
curIntroduceIndex: curIntroduceIndex,
});
wx.$Track.sendTrack(this.data.menuTab[this.data.curIntroduceIndex]);
break
}
},
},
});
\ No newline at end of file \ No newline at end of file
// pages/tab/index/components/companyIntroduce/companyIntroduce.js
import { componentsMixin } from "../../../../../mixins/index";
Component({
behaviors: [componentsMixin],
/**
* 组件的属性列表
*/
properties: {
autoplay: {
type: Boolean,
observer(n) {
this.setData({
autoplay: n,
});
},
}
},
/**
* 组件的初始数据
*/
data: {
current: 0,
banner: ['company-img3.png', 'company-img31.png'],
awardCurrent: 0,
awardBanner: [{src: 'company-img7.png', name: '组织荣誉'}, {src: 'company-img71.png', name: '行业奖项'}]
},
/**
* 组件的方法列表
*/
methods: {
// 政府与行业资质轮播切换
changePage(e) {
let current = e.detail.current
this.setData({
current: current
})
},
// 荣誉与奖项轮播切换
changeBanner(e) {
let awardCurrent = e.detail.current
this.setData({
awardCurrent: awardCurrent
})
},
tapBanner(e) {
console.log(e)
let current = e.target.dataset.current
this.setData({
awardCurrent: current
})
},
}
})
{
"component": true,
"usingComponents": {}
}
\ No newline at end of file \ No newline at end of file
/* pages/tab/index/components/companyIntroduce/companyIntroduce.wxss */
.img {
width: 100%;
}
.relative {
position: relative;
}
.box2 {
position: absolute;
width: 716rpx;
top: 240rpx;
left: 50%;
transform: translateX(-50%);
&-content {
width: 716rpx;
height: 344rpx;
}
}
.box3 {
position: absolute;
top: 240rpx;
left: 50%;
transform: translateX(-50%);
&-img, &-swiper {
width: 704rpx;
height: 432rpx;
}
}
// .box3-img, .box3-swiper {
// }
.box4 {
width: 100%;
height: 956rpx;
background-color: #fff;
}
.box4-title {
position: absolute;
width: 278rpx;
height: 112rpx;
top: 96rpx;
left: 50%;
transform: translateX(-50%);
}
.box4-content {
position: absolute;
width: 496rpx;
height: 460rpx;
top: 384rpx;
left: 50%;
transform: translateX(-50%);
}
.swiper {
height: 432rpx;
}
.company-dots {
position: absolute;
bottom: -64rpx;
display: flex;
justify-content: center;
align-items: center;
width: 100%;
}
.company-dots view {
width: 96rpx;
height: 8rpx;
background-color: #E6E7EB;
}
.company-dots .company-active {
background-color: #5850FF;
}
.box5 {
width: 100%;
height: 1016rpx;
background-color: #fff;
}
.box5-title {
width: 278rpx;
height: 112rpx;
position: absolute;
top: 96rpx;
left: 50%;
transform: translateX(-50%);
}
.box5-swiper {
position: absolute;
top: 384rpx;
left: 50%;
transform: translateX(-50%);
width: 496rpx;
height: 460rpx;
}
.box5-content {
width: 496rpx;
height: 460rpx;
}
.banner-dots {
position: absolute;
top: 256rpx;
left: 50%;
transform: translateX(-50%);
display: flex;
justify-content: center;
align-items: center;
width: 656rpx;
font-size: 28rpx;
color: #6E6E7A;
font-weight: 400;
border-radius: 32rpx;
background-color: #F5F6FA;
}
.banner-dots view {
display: flex;
align-items: center;
justify-content: center;
width: 328rpx;
height: 64rpx;
}
.banner-dots .banner-active {
background-color: #fff;
box-shadow: 0 2rpx 12rpx 0 rgba(165,163,204,0.40);
border-radius: 32rpx;
color: #2D2D33;
font-weight: 500;
}
\ No newline at end of file \ No newline at end of file
<!--pages/tab/index/components/companyIntroduce/companyIntroduce.wxml-->
<image mode="widthFix" class="img" webp src="{{IMGURL}}image/company/company-img1.png?v={{img_version}}"></image>
<!-- 合同客户 -->
<view class="relative">
<image mode="widthFix" class="img" webp src="{{IMGURL}}image/company/bg1.png?v={{img_version}}"></image>
<view class="box2">
<swiper class="swiper" autoplay="{{autoplay}}" duration="5000" interval="5000" circular>
<swiper-item class="swiper-item">
<image class="box2-content" webp src="{{IMGURL}}image/company/company-img2.png?v={{img_version}}"></image>
</swiper-item>
<swiper-item class="swiper-item">
<image class="box2-content" webp src="{{IMGURL}}image/company/company-img21.png?v={{img_version}}"></image>
</swiper-item>
</swiper>
</view>
</view>
<!-- 政府与行业资质 -->
<view class="relative">
<image mode="widthFix" class="img" webp src="{{IMGURL}}image/company/bg2.png?v={{img_version}}"></image>
<view class="box3">
<swiper class="box3-swiper" autoplay="{{autoplay}}" bindchange="changePage" current="{{current}}" indicator-dots="{{false}}" indicator-color="#E6E7EB" indicator-active-color="#5850FF" interval="5000" circular>
<block wx:for="{{banner}}" wx:key="ind">
<swiper-item class="swiper-item">
<image class="box3-img" webp src="{{IMGURL}}image/company/{{item}}?v={{img_version}}"></image>
</swiper-item>
</block>
</swiper>
<view class="company-dots">
<block wx:for="{{banner}}" wx:for-index="index" wx:key="index">
<view class="{{current == index ? 'company-active' : ''}}"></view>
</block>
</view>
</view>
</view>
<!-- 荣誉及奖项 -->
<view class="relative box5">
<image class="box5-title" webp src="{{IMGURL}}image/company/company-img6.png?v={{img_version}}"></image>
<swiper class="box5-swiper" autoplay bindchange="changeBanner" current="{{awardCurrent}}" indicator-dots="{{false}}" indicator-color="#E6E7EB" indicator-active-color="#5850FF" interval="5000" circular>
<block wx:for="{{awardBanner}}" wx:key="ind">
<swiper-item class="swiper-item">
<image class="box5-content" webp src="{{IMGURL}}image/company/{{item.src}}?v={{img_version}}"></image>
</swiper-item>
</block>
</swiper>
<view class="banner-dots">
<block wx:for="{{awardBanner}}" wx:for-index="index" wx:key="index">
<view bindtap="tapBanner" data-current="{{index}}" class="{{awardCurrent == index ? 'banner-active' : ''}}">{{item.name}}</view>
</block>
</view>
</view>
<!-- <image mode="widthFix" class="img" src="{{IMGURL}}image/company/company-img5.png?v={{img_version}}"></image> -->
<image mode="widthFix" webp class="img" src="{{IMGURL}}image/company/company-img5.png?v={{img_version}}"></image>
...@@ -3,14 +3,15 @@ ...@@ -3,14 +3,15 @@
* @Author: huyue * @Author: huyue
* @Date: 2022-08-30 11:26:21 * @Date: 2022-08-30 11:26:21
* @LastEditors: huyue * @LastEditors: huyue
* @LastEditTime: 2022-12-09 15:44:51 * @LastEditTime: 2022-12-11 15:24:56
*/ */
// pages/tab/index/index.js // pages/tab/index/index.js
import Draw from "../../../utils/Draw"; import Draw from "../../../utils/Draw";
import { entmicroApi } from "../../../api/api"; import { entmicroApi } from "../../../api/api";
import util from "../../../utils/util"; import { commonMixin } from '../../../mixins/index'
import { trackData } from "../../../utils/data"; import { trackData } from "../../../utils/data";
Page({ Page({
behaviors: [commonMixin],
/** /**
* 页面的初始数据 * 页面的初始数据
*/ */
...@@ -53,16 +54,15 @@ Page({ ...@@ -53,16 +54,15 @@ Page({
// 是否授权手机号 // 是否授权手机号
hasPhoneNumber: false, hasPhoneNumber: false,
curTab: [trackData.COMPANY, trackData.CUBE], curTab: [trackData.COMPANY, trackData.CUBE],
banner: ['company-img3.png', 'company-img31.png'], shareDisabled: true,
current: 0, autoplay: true
shareDisabled: true
}, },
introduce(e) { introduce(e) {
const curTabIndex = e.currentTarget.dataset.index; const curTabIndex = e.currentTarget.dataset.index;
this.setData({ this.setData({
autoplay: false autoplay: false
}) })
// 视频直播和合作申请是跳转新页面,不需要设置激活样式 // 视频直播是跳转新页面,不需要设置激活样式
// 0-增值转化 1-系统订阅 2-公司介绍 3-视频直播 // 0-增值转化 1-系统订阅 2-公司介绍 3-视频直播
switch (curTabIndex) { switch (curTabIndex) {
case 2: case 2:
...@@ -86,53 +86,9 @@ Page({ ...@@ -86,53 +86,9 @@ Page({
} }
}, },
/** // 咨询
* 跳转其他内容
* name: 跳转事件名称
*/
handleOpen(e) { handleOpen(e) {
console.log(e)
const name = e.target.dataset.name
switch(name) {
case 'store':
util.getMockConfig().then(({storeParams, storeappId}) => {
console.log(storeParams, storeappId)
wx.navigateToMiniProgram({
appId: storeappId,
path: 'packageStoreAssistant/packageAuth/pages/authentication/loading/loading',
extraData: storeParams,
envVersion: 'trial',
success(res) {
console.log(res, storeParams)
// 打开成功
}
})
})
break
case 'business':
util.getMockConfig().then(({businessParams, businessappId}) => {
console.log(businessParams, businessappId)
wx.navigateToMiniProgram({
appId: businessappId,
path: 'login/loading/loading',
extraData: businessParams,
envVersion: 'trial',
success(res) {
// 打开成功
}
})
})
break
case 'custom':
wx.openCustomerServiceChat({
extInfo: {url: 'https://work.weixin.qq.com/kfid/kfcf7b721472201345e'},
corpId: 'ww047bdc0f1e76cc13',
complete: r => {
console.log(r)
}
})
break
}
}, },
// 更新手机号 // 更新手机号
...@@ -145,41 +101,9 @@ Page({ ...@@ -145,41 +101,9 @@ Page({
}, },
jump() { jump() {
// wx.navigateTo({
// url: '/packagesList/pages/measure/measure/measure',
// })
wx.$router.go('/packagesList/pages/measure/measure/measure') wx.$router.go('/packagesList/pages/measure/measure/measure')
}, },
// 政府与行业资质轮播切换
changePage(e) {
let current = e.detail.current
this.setData({
current: current
})
},
// 荣誉与奖项轮播切换
changeBanner(e) {
let awardCurrent = e.detail.current
this.setData({
awardCurrent: awardCurrent
})
},
tapBanner(e) {
console.log(e)
let current = e.target.dataset.current
this.setData({
awardCurrent: current
})
},
// 智能线索轮播切换
clueChange(e) {
let clueCurrent = e.detail.current
this.setData({
clueCurrent: clueCurrent
})
},
/** /**
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
...@@ -210,7 +134,7 @@ Page({ ...@@ -210,7 +134,7 @@ Page({
*/ */
onShow() { onShow() {
this.setData({ this.setData({
hasPhoneNumber: util.getUserInfo() && util.getUserInfo().phone hasPhoneNumber: wx.$util.getUserInfo() && wx.$util.getUserInfo().phone
}) })
const options = wx.getEnterOptionsSync() const options = wx.getEnterOptionsSync()
wx.$trackData = options.query wx.$trackData = options.query
...@@ -382,23 +306,7 @@ Page({ ...@@ -382,23 +306,7 @@ Page({
}; };
drawCard(); drawCard();
}, },
// banner跳转
jumpBanner(e) {
console.log(e)
const path = e.target.dataset.path
switch(path) {
case 'left':
console.log('数字化+新能源汽车')
wx.$router.go("newEnergy");
wx.$Track.sendTrack(trackData.NEWENERGY);
break
case 'right':
console.log('众筹活动助力')
wx.$router.go("activityApplication");
wx.$Track.sendTrack(trackData.ACTIVITYAPPLICATION);
break
}
},
// 获取员工名片信息 // 获取员工名片信息
getCardDetail() { getCardDetail() {
console.log(wx.showMeasure) console.log(wx.showMeasure)
......
{ {
"usingComponents": { "usingComponents": {
"user-info": "../../../components/UserInfo/UserInfo" "user-info": "../../../components/UserInfo/UserInfo",
"company-introduce": "./components/companyIntroduce/companyIntroduce"
}, },
"navigationBarTitleText": "广联数科智能名片" "navigationBarTitleText": "广联数科智能名片"
} }
\ No newline at end of file \ No newline at end of file
...@@ -16,6 +16,9 @@ page { ...@@ -16,6 +16,9 @@ page {
flex: 1; flex: 1;
} }
} }
.main-content {
padding-bottom: 180rpx;
}
/** 菜单tab样式开始 */ /** 菜单tab样式开始 */
.tab-list { .tab-list {
...@@ -73,7 +76,7 @@ page { ...@@ -73,7 +76,7 @@ page {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
right: 6rpx; right: 6rpx;
bottom: 90rpx; bottom: 180rpx;
} }
.floating-icon { .floating-icon {
......
...@@ -13,17 +13,22 @@ ...@@ -13,17 +13,22 @@
</block> </block>
</view> </view>
<view class="main-content"> <view class="main-content">
<view wx:if="{{curTabIndex == 0}}"> <block wx:if="{{curTabIndex == 0}}">
增值转化内容 增值转化内容
<button bindtap="jump">跳转详情</button> <button bindtap="jump">跳转详情</button>
</view> </block>
<view wx:if="{{curTabIndex == 1}}">系统订阅</view> <block wx:if="{{curTabIndex == 1}}">系统订阅</block>
<block wx-if="{{curTabIndex == 2}}">
<company-introduce autoplay="{{autoplay}}"></company-introduce>
</block>
</view> </view>
</view> </view>
<!-- 服务咨询 --> <!-- 服务咨询 -->
<view class="floating-box"> <view class="floating-box">
<image class="floating-icon" style="margin-bottom: 10rpx;" webp bindtap="handleOpen" data-name="store" src="{{IMGURL}}home/icon-store.png?v={{img_version}}"></image> <image class="floating-icon" style="margin-bottom: 10rpx;" webp bindtap="toStoreMiniProgram" src="{{IMGURL}}home/icon-store.png?v={{img_version}}"></image>
<image class="floating-icon" bindtap="handleOpen" data-name="business" webp src="{{IMGURL}}home/icon-business.png?v={{img_version}}"></image> <image class="floating-icon" bindtap="toBusinessMiniProgram" webp src="{{IMGURL}}home/icon-business.png?v={{img_version}}"></image>
<image class="floating-icon" bindtap="handleOpen" data-name="custom" webp src="{{IMGURL}}home/custom.png?v={{img_version}}"></image> <image class="floating-icon" bindtap="handleOpen" webp src="{{IMGURL}}home/custom.png?v={{img_version}}"></image>
</view> </view>
</view> </view>
<phone-number type="{{1}}"></phone-number>
\ No newline at end of file \ No newline at end of file
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!