| | |
| | | bottomLift: '' |
| | | }, |
| | | onLaunch: function (op) { |
| | | console.log('options', op.query.scene); |
| | | console.log('options', op.query.scene) |
| | | let pathMap = [ |
| | | '/pages/detailDis/product', |
| | | '/pages/detailDis/case', |
| | |
| | | //è·åå½å设å¤ä¿¡æ¯ |
| | | const WindowInfo = wx.getWindowInfo() |
| | | if (WindowInfo.safeArea.top > 20) { |
| | | this.globalData.bottomLift = WindowInfo.screenHeight - WindowInfo.safeArea.bottom; |
| | | this.globalData.bottomLift = WindowInfo.screenHeight - WindowInfo.safeArea.bottom |
| | | } |
| | | // ææç»å½ |
| | | wx.login({ |
| | |
| | | wx.setStorageSync('sessionKey', res.data.sessionKey) |
| | | wx.setStorageSync('token', res.data.token) |
| | | if(op.query.scene){ |
| | | let temp = op.query.scene.split('&') |
| | | let temp = op.query.scene.split('_') |
| | | wx.navigateTo({ |
| | | url: `${pathMap[temp[1]]}?id=${temp[0]}`, |
| | | url: `${pathMap[temp[1]]}?id=${temp[0]}&userId=${temp[2]}`, |
| | | }) |
| | | } |
| | | } else { |
¶Ô±ÈÐÂÎļþ |
| | |
| | | // components/idCard/index.js |
| | | Component({ |
| | | /** |
| | | * ç»ä»¶ç屿§å表 |
| | | */ |
| | | properties: { |
| | | users: Object |
| | | }, |
| | | |
| | | /** |
| | | * ç»ä»¶çåå§æ°æ® |
| | | */ |
| | | data: { |
| | | |
| | | }, |
| | | |
| | | /** |
| | | * ç»ä»¶çæ¹æ³å表 |
| | | */ |
| | | methods: { |
| | | |
| | | } |
| | | }) |
¶Ô±ÈÐÂÎļþ |
| | |
| | | { |
| | | "component": true, |
| | | "usingComponents": {} |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | .user { |
| | | width: 750rpx; |
| | | padding: 0 40rpx; |
| | | height: 148rpx; |
| | | background: #FFFFFF; |
| | | border-radius: 8rpx; |
| | | padding: 0 30rpx; |
| | | display: flex; |
| | | align-items: center; |
| | | .content { |
| | | flex: 1; |
| | | |
| | | .name { |
| | | font-size: 30rpx; |
| | | margin-bottom: 12rpx; |
| | | } |
| | | |
| | | .desc { |
| | | font-size: 24rpx; |
| | | color: #999999; |
| | | } |
| | | } |
| | | |
| | | .avatar { |
| | | width: 80rpx; |
| | | height: 80rpx; |
| | | border-radius: 50%; |
| | | margin-right: 24rpx; |
| | | } |
| | | |
| | | .btns{ |
| | | display: flex; |
| | | .item{ |
| | | display: flex; |
| | | flex-direction: column; |
| | | align-items: center; |
| | | justify-content: center; |
| | | margin-left: 70rpx; |
| | | .icon{ |
| | | width: 44rpx; |
| | | height: 44rpx; |
| | | } |
| | | } |
| | | } |
| | | .btn { |
| | | width: 118rpx; |
| | | height: 56rpx; |
| | | line-height: 52rpx; |
| | | text-align: center; |
| | | background: var(--themeColor); |
| | | border-radius: 8rpx; |
| | | font-weight: 500; |
| | | font-size: 26rpx; |
| | | color: #fff; |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <view class="user"> |
| | | <image class="avatar" src="{{ users.imgurlFull ? users.imgurlFull : '../../static/images/default_avatar.png' }}"></image> |
| | | <view class="content"> |
| | | <view class="name">{{ users.name }}</view> |
| | | <view class="desc">导è´ï½{{ users.jobDate || 1 }}å¹´ç»éª</view> |
| | | </view> |
| | | <view class="btns"> |
| | | <view class="item"> |
| | | <image class="icon" src="../../static/icon/mingpian_bg_nianxian@2x.png"></image> |
| | | <text>åç</text> |
| | | </view> |
| | | <view class="item"> |
| | | <image class="icon" src="../../static/icon/mingpian_bg_nianxian@2x.png"></image> |
| | | <text>åç</text> |
| | | </view> |
| | | </view> |
| | | </view> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | .user { |
| | | width: 750rpx; |
| | | padding: 0 40rpx; |
| | | height: 148rpx; |
| | | background: #FFFFFF; |
| | | border-radius: 8rpx; |
| | | padding: 0 30rpx; |
| | | display: flex; |
| | | align-items: center; |
| | | } |
| | | .user .content { |
| | | flex: 1; |
| | | } |
| | | .user .content .name { |
| | | font-size: 30rpx; |
| | | margin-bottom: 12rpx; |
| | | } |
| | | .user .content .desc { |
| | | font-size: 24rpx; |
| | | color: #999999; |
| | | } |
| | | .user .avatar { |
| | | width: 80rpx; |
| | | height: 80rpx; |
| | | border-radius: 50%; |
| | | margin-right: 24rpx; |
| | | } |
| | | .user .btns { |
| | | display: flex; |
| | | } |
| | | .user .btns .item { |
| | | display: flex; |
| | | flex-direction: column; |
| | | align-items: center; |
| | | justify-content: center; |
| | | margin-left: 70rpx; |
| | | } |
| | | .user .btns .item .icon { |
| | | width: 44rpx; |
| | | height: 44rpx; |
| | | } |
| | | .user .btn { |
| | | width: 118rpx; |
| | | height: 56rpx; |
| | | line-height: 52rpx; |
| | | text-align: center; |
| | | background: var(--themeColor); |
| | | border-radius: 8rpx; |
| | | font-weight: 500; |
| | | font-size: 26rpx; |
| | | color: #fff; |
| | | } |
| | |
| | | this.setData({ |
| | | bottomLift: app.bottomLift |
| | | }) |
| | | this.getDetail(options.id) |
| | | this.getDetail(options.id, options.userId || '') |
| | | actionDo({ |
| | | actionType: 'view', |
| | | id: options.id |
| | |
| | | }) |
| | | }) |
| | | }, |
| | | getDetail(id) { |
| | | getDetail(id, userId) { |
| | | getProductInfo({ |
| | | id |
| | | id, salesId: userId || null |
| | | }).then(res => { |
| | | this.setData({ |
| | | info: res.data |
| | |
| | | "usingComponents": { |
| | | "van-popup": "@vant/weapp/popup/index", |
| | | "authCard": "/components/authCard/authCard", |
| | | "idCard": "../../components/idCard/index", |
| | | "mp-html": "mp-html" |
| | | }, |
| | | "navigationBarTitleText": "" |
| | |
| | | padding: 0 30rpx; |
| | | display: flex; |
| | | align-items: center; |
| | | |
| | | .content { |
| | | flex: 1; |
| | | |
| | |
| | | |
| | | .avatar { |
| | | width: 80rpx; |
| | | height: 80rpx; |
| | | border-radius: 50%; |
| | | margin-right: 24rpx; |
| | | } |
| | |
| | | color: #fff; |
| | | } |
| | | } |
| | | |
| | | .container{ |
| | | padding-bottom: 200rpx; |
| | | } |
| | | page { |
| | | background-color: #f7f7f7; |
| | | } |
| | |
| | | <view> |
| | | <view class="user" wx:if="{{ false }}"> |
| | | <view class="avatar"></view> |
| | | <view class="content"> |
| | | <view class="name">䏿¢æ</view> |
| | | <view class="desc">导è´ï½5å¹´ç»éª</view> |
| | | </view> |
| | | <view class="btn">èç³»TA</view> |
| | | </view> |
| | | <view class="container"> |
| | | <!-- åç --> |
| | | <idCard users="{{ info.users }}" wx:if="{{ info.users && info.users.id }}" /> |
| | | <!-- bannerè½®æ --> |
| | | <swiper class="banner_swiper" circular indicator-dots autoplay style="height:{{bannerHeight}}rpx" duration> |
| | | <block wx:for="{{ info.bannerImgList }}"> |
| | |
| | | } |
| | | .user .avatar { |
| | | width: 80rpx; |
| | | height: 80rpx; |
| | | border-radius: 50%; |
| | | margin-right: 24rpx; |
| | | } |
| | |
| | | font-size: 26rpx; |
| | | color: #fff; |
| | | } |
| | | .container { |
| | | padding-bottom: 200rpx; |
| | | } |
| | | page { |
| | | background-color: #f7f7f7; |
| | | } |
| | |
| | | |
| | | |
| | | // export const baseUrl = 'https://jiaxuan.zbom.com/jx/wechat/' //æ£å¼æå¡å¨ |
| | | // export const baseUrl = 'http://192.168.0.135:10027' // æ¬å° |
| | | export const baseUrl = 'https://dmtest.ahapp.net/web_interface' //æµè¯æå¡å¨ |
| | | export const baseUrl = 'http://192.168.0.135:10027' // æ¬å° |
| | | // export const baseUrl = 'https://dmtest.ahapp.net/web_interface' //æµè¯æå¡å¨ |
| | | |
| | | // export const imageUrl = 'https://osswebcdn.zbom.com/jiaxuan/images/' |
| | | |
| | |
| | | console.log(res.data) |
| | | this.setData({ url: res.data }) |
| | | wx.navigateTo({ |
| | | url: '/pages/webView/index?link=' + res.data, |
| | | url: '/pages/webView/index', |
| | | success: function(res) { |
| | | // éè¿eventChannelå被æå¼é¡µé¢ä¼ éæ°æ® |
| | | res.eventChannel.emit('acceptDataFromOpenerPage', { link: res.data }) |
| | | } |
| | | }) |
| | | }) |
| | | } |
| | |
| | | import { |
| | | getContentShareImg |
| | | } from '../../api/index' |
| | | const { HYEventBus } = require('hy-event-store') |
| | | const eventBus = new HYEventBus() |
| | | Component({ |
| | | /** |
| | | * ç»ä»¶ç屿§å表 |
| | |
| | | } = this.data |
| | | let that = this |
| | | getContentShareImg({ |
| | | articleId: `${info.id}&${path}&${wx.getStorageSync('member').id}`, |
| | | articleId: `${info.id}_${path}`, |
| | | type: '1', |
| | | // pageUrl: path, |
| | | imgurl: info.coverImage, |
| | |
| | | batchDown() { |
| | | const downloadList = this.data.info.imageurlList || [] |
| | | wx.setStorageSync('downloadList', downloadList) |
| | | wx.setStorageSync('downloadConfig', { |
| | | path: this.data.path,id: this.data.info.id |
| | | }) |
| | | wx.navigateTo({ |
| | | url: '/pages/download/index', |
| | | }, 1000) |
| | |
| | | <view class="main_app"> |
| | | <buoyClient showPurpose="1" /> |
| | | <detailFooter binddown="handleDown" bindenjoy="handleEnjoy" path="0" info="{{info}}" /> |
| | | <detailFooter bindenjoy="handleEnjoy" path="0" info="{{info}}" /> |
| | | <!-- bannerè½®æ --> |
| | | <swiper class="banner_swiper" circular indicator-dots autoplay style="height:{{bannerHeight}}rpx" duration> |
| | | <block wx:for="{{ info.bannerImgList }}"> |
| | |
| | | // pages/download/index.js |
| | | const { HYEventBus } = require('hy-event-store') |
| | | const eventBus = new HYEventBus() |
| | | import { |
| | | getContentShareImg |
| | | } from '../../api/index' |
| | | import { |
| | | checkAuth, |
| | | downloadSaveFile |
| | | } from '../../utils/downloadSaveFile' |
| | | Page({ |
| | | |
| | | /** |
| | |
| | | data: { |
| | | bottomLift: '', |
| | | downloadList: [], |
| | | downloadConfig: {}, |
| | | checkedAll: false, |
| | | showParam: false, |
| | | takeQrcode: true |
| | |
| | | bottomLift: app.bottomLift |
| | | }) |
| | | }, |
| | | subDownload() { |
| | | let that = this |
| | | const downloadList = this.data.downloadList |
| | | const downloadConfig = this.data.downloadConfig |
| | | checkAuth(() => { |
| | | wx.showLoading({ |
| | | title: 'æ£å¨ä¸è½½', |
| | | mask: true |
| | | }) |
| | | downloadList.forEach(item => { |
| | | if (item.checked) { |
| | | item.paddingStatus = 2 |
| | | } |
| | | }) |
| | | this.setData({ downloadList }) |
| | | downloadList.forEach(item => { |
| | | if (item.checked) { |
| | | getContentShareImg({ |
| | | articleId: `${downloadConfig.id}_${downloadConfig.path}`, |
| | | type: this.takeQrcode ? 1 : 0, |
| | | imgurl: item.url |
| | | }).then(res => { |
| | | wx.downloadFile({ |
| | | url: res.data, |
| | | success: res => { |
| | | if (res.statusCode === 200) { |
| | | wx.saveImageToPhotosAlbum({ |
| | | filePath: res.tempFilePath, |
| | | success: res => { |
| | | item.paddingStatus = 3 |
| | | item.checked = false |
| | | that.setData({ downloadList }) |
| | | wx.showToast({ |
| | | title: 'ä¿åæå', |
| | | icon: "none" |
| | | }) |
| | | }, |
| | | fail: res => { |
| | | item.paddingStatus = 4 |
| | | item.checked = false |
| | | that.setData({ downloadList }) |
| | | wx.showToast({ |
| | | title: 'ä¿å失败', |
| | | icon: "none" |
| | | }) |
| | | } |
| | | }) |
| | | |
| | | } |
| | | } |
| | | }) |
| | | }) |
| | | } |
| | | }) |
| | | }) |
| | | this.setData({ |
| | | showParam: false |
| | | }) |
| | | }, |
| | | onShow() { |
| | | const downloadList = wx.getStorageSync('downloadList') || [] |
| | | const downloadConfig = wx.getStorageSync('downloadConfig') || {} |
| | | let temp = downloadList.map(i => { |
| | | // paddingStatusï¼ 0æªä¸è½½1æ£å¨ä¸è½½2çå¾
ä¸è½½3ä¸è½½å®æ |
| | | return { |
| | |
| | | checked: false |
| | | } |
| | | }) |
| | | this.setData({ downloadList: temp }) |
| | | this.setData({ |
| | | downloadList: temp, |
| | | downloadConfig |
| | | }) |
| | | setTimeout(() => { |
| | | wx.setStorageSync('downloadList', []) |
| | | wx.setStorageSync('downloadConfig', {}) |
| | | },500) |
| | | }, |
| | | openParam() { |
| | | const downloadList = this.data.downloadList.filter(i => i.checked) |
| | | if(downloadList.length === 0) return wx.showToast({title: '请å
éæ©è¦ä¸è½½çæµ·æ¥', icon: 'none'}) |
| | | this.setData({ showParam: true }) |
| | | if (downloadList.length === 0) return wx.showToast({ |
| | | title: '请å
éæ©è¦ä¸è½½çæµ·æ¥', |
| | | icon: 'none' |
| | | }) |
| | | this.setData({ |
| | | showParam: true |
| | | }) |
| | | }, |
| | | onClose() { |
| | | this.setData({ showParam: false }) |
| | | this.setData({ |
| | | showParam: false |
| | | }) |
| | | }, |
| | | downCheck(e) { |
| | | const takeQrcode = e.currentTarget.dataset.flag |
| | | console.log('takeQrcode', takeQrcode); |
| | | this.setData({ takeQrcode }) |
| | | }, |
| | | subDownload() { |
| | | const downloadList = this.data.downloadList |
| | | downloadList.forEach(item => { |
| | | if(item.checked){ |
| | | |
| | | } |
| | | this.setData({ |
| | | takeQrcode |
| | | }) |
| | | |
| | | this.setData({ showParam: false }) |
| | | }, |
| | | itemCheck(e) { |
| | | const i = e.currentTarget.dataset.i |
| | | const { downloadList, checkedAll } = this.data |
| | | const { |
| | | downloadList, |
| | | checkedAll |
| | | } = this.data |
| | | let count = 0 |
| | | downloadList.forEach((item, index) => { |
| | | if(index === i){ |
| | |
| | | count ++ |
| | | } |
| | | }) |
| | | this.setData({ checkedAll: count == downloadList.length, downloadList}) |
| | | this.setData({ |
| | | checkedAll: count == downloadList.length, |
| | | downloadList |
| | | }) |
| | | }, |
| | | allCheck() { |
| | | const { downloadList, checkedAll } = this.data |
| | | const { |
| | | downloadList, |
| | | checkedAll |
| | | } = this.data |
| | | downloadList.forEach(item => { |
| | | item.checked = !checkedAll |
| | | }) |
| | | this.setData({ checkedAll: !checkedAll, downloadList }) |
| | | this.setData({ |
| | | checkedAll: !checkedAll, |
| | | downloadList |
| | | }) |
| | | }, |
| | | onHide() { |
| | | |
| | |
| | | .list{ |
| | | display: flex; |
| | | flex-wrap: wrap; |
| | | padding: 40rpx; |
| | | padding: 40rpx 40rpx 200rpx; |
| | | .item{ |
| | | width: 210rpx; |
| | | height: 210rpx; |
| | |
| | | <view class="list"> |
| | | <view wx:for="{{ downloadList }}" class="item"> |
| | | <image class="img" src="{{ item.url }}" mode="scaleToFill"></image> |
| | | <view wx:if="{{ item.paddingStatus }}" class="shade">çå¾
ä¸è½½</view> |
| | | <view wx:if="{{ item.paddingStatus == 2 }}" class="shade">çå¾
ä¸è½½</view> |
| | | <image data-i="{{index}}" bindtap="itemCheck" wx:if="{{ item.checked }}" class="check" src="../../static/icon/ic_select_sel@2x.png"></image> |
| | | <image wx:else data-i="{{index}}" bindtap="itemCheck" class="check" src="../../static/icon/ic_select.png"></image> |
| | | </view> |
| | |
| | | .list { |
| | | display: flex; |
| | | flex-wrap: wrap; |
| | | padding: 40rpx; |
| | | padding: 40rpx 40rpx 200rpx; |
| | | } |
| | | .list .item { |
| | | width: 210rpx; |
¶Ô±ÈÐÂÎļþ |
| | |
| | | // å°è£
ä¸ä¸ªæ¹æ³ å¨utilsä¸ å为 downloadSaveFile.js |
| | | // ä½¿ç¨æ¶ å¼å
¥ï¼æç
§èªå·±çè·¯å²åï¼ import { downloadFiles} from '../../utils/downloadSaveFile' |
| | | |
| | | |
| | | function downloadFiles(type, urls) { |
| | | checkAuth(() => { |
| | | wx.showLoading({ |
| | | title: 'æ£å¨ä¸è½½', |
| | | mask: true |
| | | }) |
| | | for (let i = 0; i < urls.length; i++) { |
| | | downloadSaveFile( |
| | | urls[i], |
| | | ); |
| | | } |
| | | }) |
| | | } |
| | | |
| | | //ä¸è½½æä»¶ |
| | | function downloadSaveFile(url, successc) { |
| | | let isimg = 'bmp,jpg,png,tif,gif,pcx,tga,exif,fpx,svg,psd,cdr,pcd,dxf,ufo,eps,ai,raw,wmf, jpeg'.includes(url.split('.').slice(-1)) |
| | | if (isimg) { |
| | | // 妿æ¯å¾çç±»å |
| | | wx.downloadFile({ |
| | | url: url, |
| | | success: res => { |
| | | if (res.statusCode === 200) { |
| | | wx.saveImageToPhotosAlbum({ |
| | | filePath: res.tempFilePath, |
| | | success: res => { |
| | | wx.showToast({ |
| | | title: 'ä¿åæå', |
| | | icon: "none" |
| | | }) |
| | | }, |
| | | fail: res => { |
| | | wx.showToast({ |
| | | title: 'ä¿å失败', |
| | | icon: "none" |
| | | }) |
| | | } |
| | | }) |
| | | |
| | | } |
| | | } |
| | | }) |
| | | |
| | | } else { |
| | | // 妿æ¯è§é¢ç±»å |
| | | wx.downloadFile({ |
| | | url: url, |
| | | success: res => { |
| | | if (res.statusCode === 200) { |
| | | wx.saveVideoToPhotosAlbum({ |
| | | filePath: res.tempFilePath, |
| | | success: res => { |
| | | // successc && successc(); |
| | | wx.showToast({ |
| | | title: 'ä¿åæå', |
| | | icon: "none" |
| | | }) |
| | | }, |
| | | fail: res => { |
| | | wx.showToast({ |
| | | title: 'ä¿å失败', |
| | | icon: "none" |
| | | }) |
| | | } |
| | | }) |
| | | } |
| | | } |
| | | }) |
| | | } |
| | | } |
| | | |
| | | //æ£æ¥æé |
| | | function checkAuth(gotc) { |
| | | //æ¥è¯¢æé |
| | | wx.showLoading({ |
| | | title: 'æ£æ¥æææ
åµ', |
| | | mask: true |
| | | }) |
| | | wx.getSetting({ |
| | | success(res) { |
| | | wx.hideLoading(); |
| | | if (!res.authSetting['scope.writePhotosAlbum']) { |
| | | //è¯·æ±ææ |
| | | wx.authorize({ |
| | | scope: 'scope.writePhotosAlbum', |
| | | success() { |
| | | //è·å¾ææï¼å¼å§ä¸è½½ |
| | | gotc && gotc(); |
| | | }, |
| | | fail() { |
| | | wx.showModal({ |
| | | title: '', |
| | | content: 'ä¿åå°ç³»ç»ç¸åéè¦ææ', |
| | | confirmText: 'ææ', |
| | | success(res) { |
| | | if (res.confirm) { |
| | | wx.openSetting({ |
| | | success(res) { |
| | | if (res.authSetting['scope.writePhotosAlbum'] === true) { |
| | | gotc && gotc(); |
| | | } |
| | | } |
| | | }) |
| | | } |
| | | }, |
| | | fail() { |
| | | wx.showToast({ |
| | | title: 'æå¼è®¾ç½®é¡µå¤±è´¥', |
| | | icon: 'none', |
| | | }) |
| | | } |
| | | }) |
| | | } |
| | | }) |
| | | } else { |
| | | //å·²æææ |
| | | gotc && gotc(); |
| | | } |
| | | }, |
| | | fail() { |
| | | wx.hideLoading(); |
| | | wx.showToast({ |
| | | title: 'è·åææå¤±è´¥', |
| | | icon: 'none', |
| | | }) |
| | | } |
| | | }) |
| | | } |
| | | |
| | | module.exports = { |
| | | downloadFiles, |
| | | checkAuth, |
| | | downloadSaveFile |
| | | }; |
| | | |
| | | |
| | | |