Merge remote-tracking branch 'origin/master'
| | |
| | | |
| | | @Target({ElementType.METHOD,ElementType.TYPE}) |
| | | @Retention(RetentionPolicy.RUNTIME) |
| | | public @interface UserLoginRequired {} |
| | | public @interface UserLoginRequired { |
| | | |
| | | } |
| | |
| | | } |
| | | // 授权登录 |
| | | const member = wx.getStorageSync('member') |
| | | if (member) { |
| | | |
| | | } else { |
| | | wx.login({ |
| | | timeout: 5000, |
| | | success(res) { |
| | | if (res.code) { |
| | | //发起网络请求 |
| | | wxLoginCustomer({ |
| | | code: res.code |
| | | }).then(res => { |
| | | console.log(res) |
| | | if (res && res.data.member) { |
| | | wx.setStorageSync('member', res.data.member) |
| | | wx.setStorageSync('openid', res.data.member.openid) |
| | | wx.setStorageSync('sessionKey', res.data.sessionKey) |
| | | wx.setStorageSync('token', res.data.token) |
| | | } else { |
| | | console.log('登录失败!') |
| | | } |
| | | }) |
| | | } else { |
| | | console.log('登录失败!' + res) |
| | | } |
| | | }, |
| | | fail(err) { |
| | | console.log(err) |
| | | wx.login({ |
| | | timeout: 5000, |
| | | success(res) { |
| | | if (res.code) { |
| | | //发起网络请求 |
| | | wxLoginCustomer({ |
| | | code: res.code |
| | | }).then(res => { |
| | | console.log(res) |
| | | if (res && res.data.member) { |
| | | wx.setStorageSync('member', res.data.member) |
| | | wx.setStorageSync('openid', res.data.member.openid) |
| | | wx.setStorageSync('sessionKey', res.data.sessionKey) |
| | | wx.setStorageSync('token', res.data.token) |
| | | } else { |
| | | console.log('登录失败!') |
| | | } |
| | | }) |
| | | } else { |
| | | console.log('登录失败!' + res) |
| | | } |
| | | }) |
| | | } |
| | | }, |
| | | fail(err) { |
| | | console.log(err) |
| | | } |
| | | }) |
| | | |
| | | |
| | | } |
| | |
| | | |
| | | view,text{ |
| | | view,text,scroll-view,image{ |
| | | box-sizing: border-box; |
| | | } |
| | | page{ |
| | |
| | | const index = tagCodes.indexOf(code) |
| | | |
| | | if(index === -1){ |
| | | // 同param里code重复 |
| | | if(activeParam && activeParam.length > 0){ |
| | | activeParam.forEach(item => { |
| | | const indexTemp = tagCodes.indexOf(item.labelValueCode) |
| | | if(indexTemp > -1){ |
| | | tagCodes.splice(indexTemp, 1) |
| | | } |
| | | }) |
| | | } |
| | | tagCodes.push(code) |
| | | cateList[activeIndex].paramIndex = paramIndex |
| | | cateList[activeIndex].paramName = activeParam[paramIndex].labelValueName |
| | |
| | | }, |
| | | subParam() { |
| | | this.setData({ activeParam: [] }) |
| | | this.setData({ pageNum: 1,dataList: [],total: 0}) |
| | | this.getList() |
| | | }, |
| | | changeShowParams(e){ |
| | |
| | | height: 100%; |
| | | padding-top: 120rpx; |
| | | .query_wrap_scroll{ |
| | | width: 670rpx; |
| | | width: 750rpx; |
| | | padding: 0 40rpx; |
| | | } |
| | | .query_wrap { |
| | |
| | | } |
| | | } |
| | | .goods_list{ |
| | | box-sizing: border-box; |
| | | padding: 12rpx 40rpx; |
| | | height: calc( 100% - 188rpx); |
| | | .item{ |
| | |
| | | <view class="content"> |
| | | <view class="name">{{ item.title }}</view> |
| | | <view class="info"> |
| | | <image wx:if="{{ !item.isCollection }}" data-code="like" bindtap="handleAction" class="icon" src="../../static/icon/detail_nav_collect.png" mode="widthFix"></image> |
| | | <image wx:if="{{ !item.collection }}" data-code="like" bindtap="handleAction" class="icon" src="../../static/icon/detail_nav_collect.png" mode="widthFix"></image> |
| | | <image wx:else data-code="like_cancel" bindtap="handleAction" class="icon" src="../../static/icon/detail_nav_collected.png" mode="widthFix"></image> |
| | | <text class="num {{true ? 'primary' : ''}}">{{ item.collectCount }}</text> |
| | | <text class="num {{item.collection ? 'primary' : ''}}">{{ item.collectCount }}</text> |
| | | <image class="icon" src="../../static/icon/zixun_ic_liulan.png" mode="widthFix"></image> |
| | | <text>{{ item.viewCount }}</text> |
| | | </view> |
| | |
| | | padding-top: 120rpx; |
| | | } |
| | | .main_content .query_wrap_scroll { |
| | | width: 670rpx; |
| | | width: 750rpx; |
| | | padding: 0 40rpx; |
| | | } |
| | | .main_content .query_wrap { |
| | |
| | | background-color: #333333; |
| | | } |
| | | .main_content .goods_list { |
| | | box-sizing: border-box; |
| | | padding: 12rpx 40rpx; |
| | | height: calc(100% - 188rpx); |
| | | } |
| | |
| | | * 组件的初始数据 |
| | | */ |
| | | data: { |
| | | showOne: false, |
| | | showTwo: false, |
| | | activeIndex: -1, |
| | | activeParam: [], |
| | | tagCodes: [], |
| | | |
| | | cateList: [], |
| | | secondCateList: [], |
| | | datalist: [], |
| | | pageNum: 1, |
| | | pageSize: 10, |
| | |
| | | const catalogCode = this.data.catalogCode |
| | | getCataLogTagList({ |
| | | catalogCode |
| | | }).then(res => { |
| | | this.setData({ |
| | | secondCateList: res.data || [], |
| | | }) |
| | | }) |
| | | }, |
| | | bindblur() { |
| | | this.getList() |
| | | }, |
| | | getList() { |
| | | const { catalogCode, pageNum, pageSize, sortType, query } = this.data |
| | | const { catalogCode,tagCodes, pageNum, pageSize, sortType, query } = this.data |
| | | getZhongTaiProductPage({ |
| | | catalogCode,pageNum,pageSize,sortType,query |
| | | catalogCode,pageNum,pageSize,sortType,query,tagCodes |
| | | }).then(res => { |
| | | this.setData({ |
| | | datalist: [...this.data.datalist, ...res.data.records], |
| | |
| | | url: '/pages/detailDis/product?id=' + id, |
| | | }) |
| | | }, |
| | | changeOne(){ |
| | | const showOne = !this.data.showOne |
| | | this.setData({showOne}) |
| | | this.setData({showTwo: false}) |
| | | tagClick(e) { |
| | | const code = e.currentTarget.dataset.code |
| | | const paramIndex = e.currentTarget.dataset.index |
| | | const { secondCateList, tagCodes, activeParam, activeIndex } = this.data |
| | | const index = tagCodes.indexOf(code) |
| | | console.log('code', code); |
| | | console.log('tagCodes', tagCodes); |
| | | if(index === -1){ |
| | | // 同param里code重复 |
| | | if(activeParam && activeParam.length > 0){ |
| | | activeParam.forEach(item => { |
| | | const indexTemp = tagCodes.indexOf(item.labelValueCode) |
| | | if(indexTemp > -1){ |
| | | tagCodes.splice(indexTemp, 1) |
| | | } |
| | | }) |
| | | } |
| | | tagCodes.push(code) |
| | | secondCateList[activeIndex].paramIndex = paramIndex |
| | | secondCateList[activeIndex].paramName = activeParam[paramIndex].labelValueName |
| | | }else{ |
| | | tagCodes.splice(index, 1) |
| | | secondCateList[activeIndex].paramIndex = -1 |
| | | secondCateList[activeIndex].paramName = '' |
| | | } |
| | | this.setData({ pageNum: 1,datalist: [],total: 0}) |
| | | this.setData({ tagCodes, secondCateList }) |
| | | }, |
| | | changeTwo(){ |
| | | const showTwo = !this.data.showTwo |
| | | this.setData({showTwo}) |
| | | this.setData({showOne: false}) |
| | | changeShowParams(e){ |
| | | const { secondCateList } = this.data |
| | | const activeIndex = e.currentTarget.dataset.index |
| | | console.log('activeIndex', activeIndex); |
| | | console.log('secondCateList', secondCateList); |
| | | if(activeIndex === this.data.activeIndex){ |
| | | this.setData({ activeIndex: -1, activeParam: [] }) |
| | | }else{ |
| | | this.setData({ |
| | | activeIndex, |
| | | activeParam: secondCateList[activeIndex].valueVos |
| | | }) |
| | | } |
| | | console.log('activeParam', this.data.activeParam); |
| | | // this.setData({showTwo: false}) |
| | | }, |
| | | cancelParam() { |
| | | const { secondCateList } = this.data |
| | | secondCateList.forEach(item => { |
| | | item.paramIndex = -1 |
| | | item.paramName = '' |
| | | }) |
| | | this.setData({ tagCodes: [],activeParam: [],cateList,activeIndex: -1 }) |
| | | }, |
| | | subParam() { |
| | | this.setData({ activeParam: [] }) |
| | | this.setData({ pageNum: 1,datalist: [],total: 0}) |
| | | this.getList() |
| | | }, |
| | | } |
| | | }) |
| | |
| | | |
| | | .goods_list { |
| | | height: calc( 100% - 182rpx); |
| | | width: 590rpx; |
| | | display: flex; |
| | | flex-wrap: wrap; |
| | | box-sizing: border-box; |
| | | justify-content: space-between; |
| | | padding: 12rpx 40rpx; |
| | | .item { |
| | | width: 50%; |
| | | width: 242rpx; |
| | | flex-shrink: 0; |
| | | margin-bottom: 32rpx; |
| | | |
| | | .img_wrap { |
| | | width: 242rpx; |
| | | border-radius: 8rpx; |
| | |
| | | </scroll-view> |
| | | <view class="main_right"> |
| | | <view class="query_wrap"> |
| | | <view class="item" bindtap="changeOne"> |
| | | <view class="name">装修风格</view> |
| | | <van-icon name="{{ showOne ? 'arrow-up' : 'arrow-down' }}" /> |
| | | </view> |
| | | <view class="item" bindtap="changeTwo"> |
| | | <view class="name">空间名称</view> |
| | | <van-icon name="{{ showTwo ? 'arrow-up' : 'arrow-down' }}" /> |
| | | <view data-index="{{index}}" wx:for="{{ secondCateList }}" class="item" bindtap="changeShowParams"> |
| | | <view class="name">{{ item.paramName || item.labelName }}</view> |
| | | <van-icon name="{{ index == activeIndex ? 'arrow-up' : 'arrow-down' }}" /> |
| | | </view> |
| | | </view> |
| | | <view wx:if="{{ showOne }}" class="query_form"> |
| | | <view wx:if="{{ activeParam.length > 0 }}" class="query_form"> |
| | | <view class="list"> |
| | | <view class="item active">东芝电视</view> |
| | | <view class="item">东芝啊的时撒的代电视</view> |
| | | <view class="item">东芝电视</view> |
| | | <view class="item">东芝电视</view> |
| | | <view class="item">东芝电视</view> |
| | | <view data-index="{{index}}" data-code="{{ item.labelValueCode }}" bindtap="tagClick" wx:for="{{ activeParam }}" class="item {{ secondCateList[activeIndex].paramIndex === index ? 'active' : '' }}">{{ item.labelValueName }}</view> |
| | | </view> |
| | | <view class="btns"> |
| | | <view class="btn" bindtap="changeOne">取消</view> |
| | | <view class="btn sub">确认</view> |
| | | </view> |
| | | </view> |
| | | <view wx:if="{{ showTwo }}" class="query_form"> |
| | | <view class="list"> |
| | | <view class="item active">宜家</view> |
| | | <view class="item">宜家</view> |
| | | <view class="item">宜家</view> |
| | | <view class="item">宜家</view> |
| | | <view class="item">宜家</view> |
| | | </view> |
| | | <view class="btns"> |
| | | <view class="btn" bindtap="changeTwo">取消</view> |
| | | <view class="btn sub">确认</view> |
| | | <view class="btn" bindtap="cancelParam">取消</view> |
| | | <view class="btn sub" bindtap="subParam">确认</view> |
| | | </view> |
| | | </view> |
| | | <view class="status"> |
| | |
| | | <view class="item {{ sortType == 'LATEST' ? 'active' : '' }}" data-status="LATEST" bindtap="statusChange">最新</view> |
| | | </view> |
| | | <scroll-view bindscrolltolower="scrolltolower" scroll-y enable-passive enable-flex class="goods_list"> |
| | | <!-- <view class="goods_list"> --> |
| | | <view wx:for="{{ datalist }}" data-id="{{item.id}}" class="item" bindtap="handleDetail"> |
| | | <view class="img_wrap"> |
| | | <image src="{{ item.coverImage }}" class="img" mode="widthFix"></image> |
| | |
| | | <text>{{ item.viewCount || 0 }}</text> |
| | | </view> |
| | | </view> |
| | | <!-- </view> --> |
| | | </scroll-view> |
| | | </view> |
| | | </view> |
| | |
| | | } |
| | | .main_content .main_right .goods_list { |
| | | height: calc(100% - 182rpx); |
| | | width: 590rpx; |
| | | display: flex; |
| | | flex-wrap: wrap; |
| | | box-sizing: border-box; |
| | | justify-content: space-between; |
| | | padding: 12rpx 40rpx; |
| | | } |
| | | .main_content .main_right .goods_list .item { |
| | | width: 50%; |
| | | width: 242rpx; |
| | | flex-shrink: 0; |
| | | margin-bottom: 32rpx; |
| | | } |
| | |
| | | const index = tagCodes.indexOf(code) |
| | | |
| | | if(index === -1){ |
| | | if(activeParam && activeParam.length > 0){ |
| | | activeParam.forEach(item => { |
| | | const indexTemp = tagCodes.indexOf(item.labelValueCode) |
| | | if(indexTemp > -1){ |
| | | tagCodes.splice(indexTemp, 1) |
| | | } |
| | | }) |
| | | } |
| | | tagCodes.push(code) |
| | | cateList[activeIndex].paramIndex = paramIndex |
| | | cateList[activeIndex].paramName = activeParam[paramIndex].labelValueName |
| | |
| | | }, |
| | | subParam() { |
| | | this.setData({ activeParam: [] }) |
| | | this.setData({ pageNum: 1,dataList: [],total: 0}) |
| | | this.getList() |
| | | }, |
| | | changeShowParams(e){ |
| | |
| | | padding-top: 120rpx; |
| | | |
| | | .query_wrap_scroll { |
| | | width: 670rpx; |
| | | width: 750rpx; |
| | | padding: 0 40rpx; |
| | | } |
| | | |
| | |
| | | .goods_list { |
| | | padding: 12rpx 40rpx; |
| | | height: calc( 100% - 188rpx); |
| | | box-sizing: border-box; |
| | | display: flex; |
| | | flex-wrap: wrap; |
| | | justify-content: space-around; |
| | | .item { |
| | | width: 100%; |
| | | width: 324rpx; |
| | | margin-bottom: 32rpx; |
| | | |
| | | .img_wrap { |
| | | width: 100%; |
| | | height: 376rpx; |
| | | height: 182rpx; |
| | | border-radius: 8rpx; |
| | | overflow: hidden; |
| | | position: relative; |
| | |
| | | <view class="item {{ sortType == 'LATEST' ? 'active' : '' }}" data-status="LATEST" bindtap="statusChange">最新</view> |
| | | </view> |
| | | <!-- goods_list --> |
| | | <scroll-view bindscrolltolower="scrolltolower" scroll-y enable-passive enable-flex class="goods_list"> |
| | | <scroll-view bindscrolltolower="scrolltolower" scroll-y enable-passive enable-flex class="goods_list"> |
| | | <view wx:for="{{ dataList }}" data-item="{{item}}" class="item" bindtap="handleDetail"> |
| | | <view class="img_wrap"> |
| | | <image src="{{ item.coverImage }}" class="img"></image> |
| | |
| | | </view> |
| | | <view class="content"> |
| | | <view class="name">{{ item.title }}</view> |
| | | <view class="info"> |
| | | <image wx:if="{{ !item.isCollection }}" data-code="like" bindtap="handleAction" class="icon" src="../../static/icon/detail_nav_collect.png" mode="widthFix"></image> |
| | | <image wx:else data-code="like_cancel" bindtap="handleAction" class="icon" src="../../static/icon/detail_nav_collected.png" mode="widthFix"></image> |
| | | <text class="num {{true ? 'primary' : ''}}">{{ item.collectCount }}</text> |
| | | <image class="icon" src="../../static/icon/zixun_ic_liulan.png" mode="widthFix"></image> |
| | | <text>{{ item.viewCount }}</text> |
| | | </view> |
| | | </view> |
| | | <view class="info"> |
| | | <image wx:if="{{ !item.collection }}" data-code="like" bindtap="handleAction" class="icon" src="../../static/icon/detail_nav_collect.png" mode="widthFix"></image> |
| | | <image wx:else data-code="like_cancel" bindtap="handleAction" class="icon" src="../../static/icon/detail_nav_collected.png" mode="widthFix"></image> |
| | | <text class="num {{item.collection ? 'primary' : ''}}">{{ item.collectCount }}</text> |
| | | <image class="icon" src="../../static/icon/zixun_ic_liulan.png" mode="widthFix"></image> |
| | | <text>{{ item.viewCount }}</text> |
| | | </view> |
| | | </view> |
| | | </scroll-view> |
| | |
| | | padding-top: 120rpx; |
| | | } |
| | | .main_content .query_wrap_scroll { |
| | | width: 670rpx; |
| | | width: 750rpx; |
| | | padding: 0 40rpx; |
| | | } |
| | | .main_content .query_wrap { |
| | |
| | | .main_content .goods_list { |
| | | padding: 12rpx 40rpx; |
| | | height: calc(100% - 188rpx); |
| | | box-sizing: border-box; |
| | | display: flex; |
| | | flex-wrap: wrap; |
| | | justify-content: space-around; |
| | | } |
| | | .main_content .goods_list .item { |
| | | width: 100%; |
| | | width: 324rpx; |
| | | margin-bottom: 32rpx; |
| | | } |
| | | .main_content .goods_list .item .img_wrap { |
| | | width: 100%; |
| | | height: 376rpx; |
| | | height: 182rpx; |
| | | border-radius: 8rpx; |
| | | overflow: hidden; |
| | | position: relative; |
| | |
| | | import { getZhongTaiProductNewsPage, getCatalogList, getCataLogTagList } from '../../api/index' |
| | | import { getZhongTaiProductNewsPage, getCatalogList,actionDo } from '../../api/index' |
| | | Page({ |
| | | |
| | | /** |
| | |
| | | }, |
| | | itemClick(e) { |
| | | const item = e.currentTarget.dataset.item |
| | | actionDo({actionType: 'view',id: item.id}) |
| | | if(item.contentType == 'link'){ |
| | | wx.navigateTo({ |
| | | url: '/pages/webView/index?link=' + item.content, |
| | |
| | | getDetail(id) { |
| | | getProductNewsInfo({ id }).then(res => { |
| | | this.setData({ info: res.data }) |
| | | wx.setNavigationBarTitle({ |
| | | title: res.data.title |
| | | }) |
| | | }) |
| | | }, |
| | | openShare() { |
| | |
| | | "van-popup": "@vant/weapp/popup/index", |
| | | "mp-html": "mp-html" |
| | | }, |
| | | "navigationBarTitleText": "详情" |
| | | "navigationBarTitleText": "" |
| | | } |
| | |
| | | wx.showToast({ |
| | | title: '报名成功' |
| | | }) |
| | | wx.switchTab({ |
| | | url: '/pages/index/index', |
| | | }) |
| | | }) |
| | | }, |
| | | // 显示城市弹窗 |
| | |
| | | this.setData({ addr, showAreaList: false }) |
| | | console.log('selectedOptions', addr); |
| | | }, |
| | | // 切换城市 |
| | | // confirmChange(e) { |
| | | // let { |
| | | // values |
| | | // } = e.detail |
| | | // let region = [] |
| | | // for (let i in values) { |
| | | // region.push(values[i].name) |
| | | // } |
| | | // this.setData({ |
| | | // region, |
| | | // cityCode: values[1].code |
| | | // }) |
| | | // this.getShopList() |
| | | // this.chooseCity() |
| | | // }, |
| | | positionChange (e) { |
| | | console.log(e.detail.value) |
| | | const names = e.detail.value |
| | | const codes = e.detail.code |
| | | let addr = { |
| | | provinceCode: codes[0] + '00', |
| | | provinceName: names[0], |
| | | cityCode: codes[1] + '00', |
| | | cityName: names[1], |
| | | areaCode: codes[2] + '00', |
| | | areaName: names[2], |
| | | } |
| | | this.setData({ addr }) |
| | | }, |
| | | bindRegionChange(e) { |
| | | console.log('picker发送选择改变,携带值为', e.detail.value) |
| | | const temp = e.detail.value |
| | | this.setData({ |
| | | region: e.detail.value |
| | | }) |
| | | }, |
| | | onClose() { |
| | | this.setData({ showAreaList: false }) |
| | | }, |
| | |
| | | border-radius: 8rpx; |
| | | padding: 0 32rpx; |
| | | margin-bottom: 40rpx; |
| | | |
| | | .city_picler{ |
| | | flex: 1; |
| | | padding-left: 30rpx; |
| | | .placeholder9{ |
| | | color: #c8c9cc; |
| | | } |
| | | } |
| | | .icon { |
| | | width: 40rpx; |
| | | } |
| | |
| | | <image class="icon" src="../../static/icon/design_ic_phone.png" mode="widthFix"></image> |
| | | <van-field type="number" class="input" custom-style="background-color: #F6F6F6;" model:value="{{ phone }}" placeholder="请输入联系电话" clearable maxlength="{{ 11 }}" /> |
| | | </view> |
| | | <view class="line" bindtap="chooseCity"> |
| | | <view class="line"> |
| | | <image class="icon" src="../../static/icon/design_ic_city.png" mode="widthFix"></image> |
| | | <view wx:if="{{addr.areaCode}}" class="city">{{addr.provinceName}}{{addr.cityName}}{{addr.areaName}}</view> |
| | | <view wx:else class="placeholder9 city">请选择地区</view> |
| | | <picker class="city_picler" mode="region" value="{{ addr }}" bindchange="bindRegionChange" bindchange="positionChange"> |
| | | <view class="placeholder9" hidden="{{ addr.cityName }}">请选择地址</view> |
| | | <view class="picker" hidden="{{ !addr.cityName }}"> |
| | | {{ addr.provinceName }}{{ addr.cityName }}{{ addr.areaName }} |
| | | </view> |
| | | </picker> |
| | | <image class="arrow_right" src="../../static/icon/arrow_right.png" mode="widthFix"></image> |
| | | </view> |
| | | <view class="btn" bindtap="onSubmit">立即报名</view> |
| | |
| | | padding: 0 32rpx; |
| | | margin-bottom: 40rpx; |
| | | } |
| | | .main_content .line .city_picler { |
| | | flex: 1; |
| | | padding-left: 30rpx; |
| | | } |
| | | .main_content .line .city_picler .placeholder9 { |
| | | color: #c8c9cc; |
| | | } |
| | | .main_content .line .icon { |
| | | width: 40rpx; |
| | | } |
| | |
| | | bottomLift: app.bottomLift |
| | | }) |
| | | this.getDetail(options.id) |
| | | // actionDo({ |
| | | // actionType: 'view', |
| | | // id: options.id |
| | | // }) |
| | | actionDo({ |
| | | actionType: 'view', |
| | | id: options.id |
| | | }) |
| | | const member = wx.getStorageSync('member') |
| | | this.setData({id: options.id, member}) |
| | | }, |
| | |
| | | }, |
| | | handleShare() { |
| | | console.log('点击了分享'); |
| | | shareContent(this.data.info.id) |
| | | actionDo({ actionType: 'share', id: this.data.info.id }) |
| | | }, |
| | | // onShareAppMessage: function () { |
| | | // // let { productDetail, userInfo } = this.data |
| | |
| | | actionType, |
| | | id: this.data.info.id |
| | | }).then(res => { |
| | | info.isCollection = !info.isCollection |
| | | info.collection = !info.collection |
| | | this.setData({info}) |
| | | wx.showToast({ |
| | | title: actionType == 'collect' ? '收藏成功' : '取消收藏', |
| | | }) |
| | | }) |
| | | }, |
| | | getDetail(id) { |
| | |
| | | <view class="footer" style="padding-bottom: {{bottomLift}}px;"> |
| | | <view class="btns"> |
| | | <button class="item btn"> |
| | | <image data-code="like_cancel" bindtap="handleAction" wx:if="{{ info.isCollection }}" class="icon" src="../../static/icon/detail_nav_collected.png" mode="widthFix"></image> |
| | | <image wx:else data-code="like" bindtap="handleAction" class="icon" src="../../static/icon/detail_nav_collect.png" mode="widthFix"></image> |
| | | <image data-code="collect_cancel" bindtap="handleAction" wx:if="{{ info.collection }}" class="icon" src="../../static/icon/detail_nav_collected.png" mode="widthFix"></image> |
| | | <image wx:else data-code="collect" bindtap="handleAction" class="icon" src="../../static/icon/detail_nav_collect.png" mode="widthFix"></image> |
| | | <view class="name">收藏</view> |
| | | </button> |
| | | <button open-type="share" class="item btn" bindtap="handleShare"> |
| | |
| | | import { shareContent, getProductInfo, actionDo } from '../../api/index' |
| | | import { |
| | | shareContent, |
| | | getProductInfo, |
| | | actionDo |
| | | } from '../../api/index' |
| | | Page({ |
| | | |
| | | /** |
| | |
| | | id: options.id |
| | | }) |
| | | const member = wx.getStorageSync('member') |
| | | this.setData({id: options.id, member}) |
| | | this.setData({ |
| | | id: options.id, |
| | | member |
| | | }) |
| | | }, |
| | | handleAction(e){ |
| | | handleAction(e) { |
| | | const actionType = e.currentTarget.dataset.code |
| | | const { info } = this.data |
| | | const { |
| | | info |
| | | } = this.data |
| | | actionDo({ |
| | | actionType, |
| | | id: this.data.info.id |
| | | }).then(res => { |
| | | info.isCollection = !info.isCollection |
| | | this.setData({info}) |
| | | info.collection = !info.collection |
| | | this.setData({ |
| | | info |
| | | }) |
| | | wx.showToast({ |
| | | title: actionType == 'collect' ? '收藏成功' : '取消收藏', |
| | | }) |
| | | }) |
| | | }, |
| | | getDetail(id) { |
| | | getProductInfo({id}).then(res => { |
| | | this.setData({ info: res.data }) |
| | | getProductInfo({ |
| | | id |
| | | }).then(res => { |
| | | this.setData({ |
| | | info: res.data |
| | | }) |
| | | wx.setNavigationBarTitle({ |
| | | title: res.data.title |
| | | }) |
| | | }) |
| | | }) |
| | | }, |
| | | playVideo() { |
| | | wx.previewMedia({ |
| | | sources: [{ url: this.data.info.video, type: 'video' }] |
| | | sources: [{ |
| | | url: this.data.info.video, |
| | | type: 'video' |
| | | }] |
| | | }) |
| | | }, |
| | | bannerbindload(e) { |
| | | const { height, width } = e.detail |
| | | const { |
| | | height, |
| | | width |
| | | } = e.detail |
| | | let activeHeight = height * 670 / width |
| | | this.setData({ |
| | | bannerHeight: activeHeight |
| | |
| | | }) |
| | | }, |
| | | openShare() { |
| | | this.setData({showShare: true}) |
| | | this.setData({ |
| | | showShare: true |
| | | }) |
| | | }, |
| | | handleShare() { |
| | | console.log('点击了分享'); |
| | | actionDo({ actionType: 'share', id: this.data.info.id }) |
| | | actionDo({ |
| | | actionType: 'share', |
| | | id: this.data.info.id |
| | | }) |
| | | // shareContent({id: this.data.info.id || this.data.id}).then(res => { |
| | | // this.setData({showShare: false}) |
| | | // }) |
| | |
| | | // } |
| | | // }, |
| | | onClose() { |
| | | this.setData({showShare: false}) |
| | | this.setData({ |
| | | showShare: false |
| | | }) |
| | | }, |
| | | handleDown() { |
| | | let { info } = this.data |
| | | let { |
| | | info |
| | | } = this.data |
| | | wx.showToast({ |
| | | title: '下载中', |
| | | icon: 'loading' |
| | |
| | | console.log('info.picUrls', info) |
| | | wx.downloadFile({ |
| | | url: info.picUrls, |
| | | success (res) { |
| | | success(res) { |
| | | // console.log(res) |
| | | wx.saveImageToPhotosAlbum({ |
| | | filePath: res.tempFilePath, |
| | |
| | | } |
| | | }) |
| | | }, |
| | | fail (err) { |
| | | fail(err) { |
| | | console.log(err.errMsg) |
| | | wx.showToast({ |
| | | title: '下载失败', |
| | |
| | | <view class="footer" style="padding-bottom: {{bottomLift}}px;"> |
| | | <view class="btns"> |
| | | <button class="item btn"> |
| | | <image data-code="like_cancel" bindtap="handleAction" wx:if="{{ info.isCollection }}" class="icon" src="../../static/icon/detail_nav_collected.png" mode="widthFix"></image> |
| | | <image wx:else data-code="like" bindtap="handleAction" class="icon" src="../../static/icon/detail_nav_collect.png" mode="widthFix"></image> |
| | | <image data-code="collect_cancel" bindtap="handleAction" wx:if="{{ info.collection }}" class="icon" src="../../static/icon/detail_nav_collected.png" mode="widthFix"></image> |
| | | <image wx:else data-code="collect" bindtap="handleAction" class="icon" src="../../static/icon/detail_nav_collect.png" mode="widthFix"></image> |
| | | <view class="name">收藏</view> |
| | | </button> |
| | | <button open-type="share" class="item btn" bindtap="handleShare"> |
| | |
| | | actionType, |
| | | id: this.data.info.id |
| | | }).then(res => { |
| | | info.isCollection = !info.isCollection |
| | | info.collection = !info.collection |
| | | wx.showToast({ |
| | | title: actionType == 'collect' ? '收藏成功' : '取消收藏', |
| | | }) |
| | | this.setData({info}) |
| | | }) |
| | | }, |
| | |
| | | <view class="footer" style="padding-bottom: {{bottomLift}}px;"> |
| | | <view class="btns"> |
| | | <button class="item btn"> |
| | | <image data-code="like_cancel" bindtap="handleAction" wx:if="{{ info.isCollection }}" class="icon" src="../../static/icon/detail_nav_collected.png" mode="widthFix"></image> |
| | | <image wx:else data-code="like" bindtap="handleAction" class="icon" src="../../static/icon/detail_nav_collect.png" mode="widthFix"></image> |
| | | <image data-code="collect_cancel" bindtap="handleAction" wx:if="{{ info.collection }}" class="icon" src="../../static/icon/detail_nav_collected.png" mode="widthFix"></image> |
| | | <image wx:else data-code="collect" bindtap="handleAction" class="icon" src="../../static/icon/detail_nav_collect.png" mode="widthFix"></image> |
| | | <view class="name">收藏</view> |
| | | </button> |
| | | <button open-type="share" class="item btn" bindtap="handleShare"> |
| | |
| | | import { getCataLogTagList, pageZSZXContentList } from '../../api/index' |
| | | import { getCataLogTagList, pageZSZXContentList, actionDo } from '../../api/index' |
| | | Page({ |
| | | |
| | | /** |
| | |
| | | itemClick(e) { |
| | | const item = e.currentTarget.dataset.item |
| | | console.log('item', item); |
| | | actionDo({actionType: 'view',id: item.id}) |
| | | if(item.contentType == 'video'){ |
| | | wx.previewMedia({ |
| | | sources: [{ url: item.content, type: 'video' }] |
| | |
| | | getZSZXCatalogs, |
| | | getCustomizedNewsList, |
| | | getHomeBanner, |
| | | getHomeBannerDetail, |
| | | actionDo, |
| | | getZhongTaiVideoPage, |
| | | getZhongTaiProductNewsPage |
| | | } from '../../api/index' |
| | |
| | | const { id } = e.currentTarget.dataset |
| | | const item = e.currentTarget.dataset.item |
| | | console.log('item', item); |
| | | actionDo({actionType: 'view',id: item.id}) |
| | | if(item.openType == 'video'){ |
| | | wx.previewMedia({ |
| | | sources: [{ url: item.openContent, type: 'video' }] |
| | |
| | | |
| | | .left { |
| | | font-weight: 600; |
| | | font-size: 36rpx; |
| | | font-size: 34rpx; |
| | | color: #111111; |
| | | line-height: 50rpx; |
| | | line-height: 34rpx; |
| | | flex: 1; |
| | | |
| | | .name { |
| | | display: flex; |
| | | align-items: center; |
| | | |
| | | margin-bottom: 10rpx; |
| | | .icon { |
| | | width: 36rpx; |
| | | height: 36rpx; |
| | |
| | | } |
| | | .container .com_header .left { |
| | | font-weight: 600; |
| | | font-size: 36rpx; |
| | | font-size: 34rpx; |
| | | color: #111111; |
| | | line-height: 50rpx; |
| | | line-height: 34rpx; |
| | | flex: 1; |
| | | } |
| | | .container .com_header .left .name { |
| | | display: flex; |
| | | align-items: center; |
| | | margin-bottom: 10rpx; |
| | | } |
| | | .container .com_header .left .name .icon { |
| | | width: 36rpx; |
| | |
| | | } |
| | | .main_content{ |
| | | background-color: #fff; |
| | | position: relative; |
| | | z-index: 9999; |
| | | border-radius: 16rpx 16rpx 0rpx 0rpx; |
| | | padding: 40rpx; |
| | | .func_list{ |
| | |
| | | } |
| | | .container .main_content { |
| | | background-color: #fff; |
| | | position: relative; |
| | | z-index: 9999; |
| | | border-radius: 16rpx 16rpx 0rpx 0rpx; |
| | | padding: 40rpx; |
| | | } |
| | |
| | | }).then(res => { |
| | | if (res.data) { |
| | | this.setData({ |
| | | dataList: [...this.data.dataset, ...res.data.records || []], |
| | | dataList: [...this.data.dataList, ...res.data.records || []], |
| | | total: res.data.total |
| | | }) |
| | | } |
| | |
| | | <view class="name">{{ item.displayName }}</view> |
| | | <view class="info"> |
| | | <image wx:if="{{ false }}" class="icon" src="../../static/icon/detail_nav_collect.png" mode="widthFix"></image> |
| | | <image wx:else="" class="icon" src="../../static/icon/detail_nav_collected.png" mode="widthFix"></image> |
| | | <text class="num {{true ? 'primary' : ''}}">34</text> |
| | | <image wx:else class="icon" src="../../static/icon/detail_nav_collected.png" mode="widthFix"></image> |
| | | <text class="num {{true ? 'primary' : ''}}">{{ item.collectCount }}</text> |
| | | <image class="icon" src="../../static/icon/zixun_ic_liulan.png" mode="widthFix"></image> |
| | | <text>1000</text> |
| | | <text>{{ item.viewCount }}</text> |
| | | </view> |
| | | </view> |
| | | </view> |
| | |
| | | }).then(res => { |
| | | if (res.data) { |
| | | this.setData({ |
| | | dataList: [...this.data.dataset, ...res.data.records || []], |
| | | dataList: [...this.data.dataList, ...res.data.records || []], |
| | | total: res.data.total |
| | | }) |
| | | } |
| | |
| | | margin-bottom: 40rpx; |
| | | display: flex; |
| | | align-items: center; |
| | | .picker{ |
| | | width: 100%; |
| | | display: flex; |
| | | .picker_wrap{ |
| | | width: 528rpx; |
| | | display: flex; |
| | | } |
| | | .text{ |
| | | flex: 1; |
| | | } |
| | | } |
| | | .label{ |
| | | width: 110rpx; |
| | | font-size: 30rpx; |
| | |
| | | <view class="container"> |
| | | <image class="avatar" src="{{ imgurlFull ? imgurlFull : '../../static/images/default_avatar.png' }}" mode="widthFix"></image> |
| | | <image class="avatar" bindtap="selMedia" src="{{ imgurlFull ? imgurlFull : '../../static/images/default_avatar.png' }}"></image> |
| | | <view bindtap="selMedia" class="avatar_btn">更换头像</view> |
| | | <view class="list"> |
| | | <view class="line"> |
| | |
| | | </view> |
| | | <view class="line"> |
| | | <view class="label">姓名</view> |
| | | <van-field type="text" border="{{ false }}" class="input" model:value="{{ name }}" maxlength="{{ 18 }}" clearable /> |
| | | <van-field type="text" border="{{ false }}" class="input" model:value="{{ name }}" maxlength="{{ 10 }}" clearable /> |
| | | </view> |
| | | <view class="line"> |
| | | <view class="label">电话</view> |
| | |
| | | <view class="line"> |
| | | <view class="label">城市</view> |
| | | <view class="val"> |
| | | <view class="df_ac"> |
| | | <picker mode="region" value="{{ addr }}" bindchange="bindRegionChange" bindchange="positionChange"> |
| | | <view class="placeholder9" hidden="{{ addr.cityName }}">请选择地址</view> |
| | | <view class="picker" hidden="{{ !addr.cityName }}"> |
| | | {{ addr.provinceName }}{{ addr.cityName }}{{ addr.areaName }} |
| | | <view class="df_ac" style="width: 100%"> |
| | | <picker class="picker" mode="region" value="{{ addr }}" bindchange="bindRegionChange" bindchange="positionChange"> |
| | | <view class="picker_wrap"> |
| | | <view class="text placeholder9" hidden="{{ addr.cityName }}">请选择地址</view> |
| | | <view class="text" hidden="{{ !addr.cityName }}"> |
| | | {{ addr.provinceName }}{{ addr.cityName }}{{ addr.areaName }} |
| | | </view> |
| | | <image class="icon" src="../../static/icon/home_ar@2x.png" mode="widthFix"></image> |
| | | </view> |
| | | </picker> |
| | | </view> |
| | | <image class="icon" src="../../static/icon/home_ar@2x.png" mode="widthFix"></image> |
| | | </view> |
| | | </view> |
| | | <view class="line"> |
| | |
| | | </view> |
| | | <view class="line"> |
| | | <view class="label">面积</view> |
| | | <van-field type="text" border="{{ false }}" class="input" model:value="{{ housearea }}" maxlength="{{ 15 }}" clearable /> |
| | | <!-- <text>m²</text> --> |
| | | <van-field type="number" border="{{ false }}" class="input" model:value="{{ housearea }}" maxlength="{{ 30 }}" clearable /> |
| | | <text>m²</text> |
| | | </view> |
| | | <view class="line"> |
| | | <view class="label">户型</view> |
| | |
| | | display: flex; |
| | | align-items: center; |
| | | } |
| | | .list .line .picker { |
| | | width: 100%; |
| | | display: flex; |
| | | } |
| | | .list .line .picker .picker_wrap { |
| | | width: 528rpx; |
| | | display: flex; |
| | | } |
| | | .list .line .picker .text { |
| | | flex: 1; |
| | | } |
| | | .list .line .label { |
| | | width: 110rpx; |
| | | font-size: 30rpx; |
| | |
| | | </view> |
| | | <view class="line"> |
| | | <view class="label">房屋面积</view> |
| | | <view class="val">{{ item.area }}</view> |
| | | <view class="val">{{ item.area }} m²</view> |
| | | </view> |
| | | <view class="line"> |
| | | <view class="label">{{ item.budget }}</view> |
| | | <view class="val">男</view> |
| | | <view class="label">装修预算</view> |
| | | <view class="val">{{ item.budget }}万元</view> |
| | | </view> |
| | | </block> |
| | | <view class="time"> |
| | |
| | | }).then(res => { |
| | | console.log(res) |
| | | if (res && res.data.member) { |
| | | wx.switchTab({ |
| | | url: '/pages/index/index', |
| | | }) |
| | | wx.setStorageSync('member', res.data.member) |
| | | wx.setStorageSync('openid', res.data.member.openid) |
| | | wx.setStorageSync('sessionKey', res.data.sessionKey) |
| | |
| | | data |
| | | }) |
| | | } |
| | | // 小程序注销 |
| | | export const getCrmAuthUrl = (data) => { |
| | | return request({ |
| | | url: '/web/customer/getCrmAuthUrl', |
| | | data |
| | | }) |
| | | } |
| | |
| | | // pages/client/index.js |
| | | Page({ |
| | | |
| | | import { getCrmAuthUrl, getDictData } from '../../api/index' |
| | | Page({ |
| | | /** |
| | | * 页面的初始数据 |
| | | */ |
| | | data: { |
| | | |
| | | }, |
| | | |
| | | url:'' |
| | | }, |
| | | /** |
| | | * 生命周期函数--监听页面加载 |
| | | */ |
| | | onLoad(options) { |
| | | |
| | | onLoad(options) { |
| | | this.loadData() |
| | | }, |
| | | |
| | | loadData(){ |
| | | wx.showToast() |
| | | getCrmAuthUrl({type:0}).then(res => { |
| | | console.log(res.data) |
| | | this.setData({ url: res.data }) |
| | | }) |
| | | }, |
| | | /** |
| | | * 生命周期函数--监听页面初次渲染完成 |
| | | */ |
| | |
| | | /** |
| | | * 生命周期函数--监听页面显示 |
| | | */ |
| | | onShow() { |
| | | |
| | | onShow() { |
| | | // if(this.data.url ==null || this.data.url ==''){ |
| | | // this.loadData() |
| | | // } |
| | | }, |
| | | |
| | | /** |
| | |
| | | <!--pages/client/index.wxml--> |
| | | <text>pages/client/index.wxml</text> |
| | | <web-view wx:if="{{url !=null && url !=''}}" src="{{url}}"> </web-view> |
| | | <button wx:else style="margin-top: 50%;width: 200rpx;font-size: 14px;" bind:tap="loadData">重新加载</button> |
| | |
| | | onLoad(options) { |
| | | console.log(options.type) |
| | | if(options.type == 1){ |
| | | wx.setNavigationBarTitle({title:'隐私协议'}) |
| | | wx.setNavigationBarTitle({title:'用户隐私协议'}) |
| | | }else{ |
| | | wx.setNavigationBarTitle({title:'用户协议'}) |
| | | wx.setNavigationBarTitle({title:'用户服务协议'}) |
| | | } |
| | | this.loadDict(options.type); |
| | | }, |
| | |
| | | <button class="btn2" bind:tap="saveCard">保持到相册</button> |
| | | </view> |
| | | </van-popup> |
| | | </view> |
| | | </view>prod |
| | |
| | | |
| | | |
| | | // export const baseUrl = 'https://jiaxuan.zbom.com/jx/wechat/' //正式服务器 |
| | | export const baseUrl = 'https://dmtest.ahapp.net/web_interface/' // 本地 |
| | | // export const baseUrl = 'http://zbtest.ahapp.net/zbom_interface/jx/wechat/' //测试服务器 |
| | | |
| | | // export const imageUrl = 'https://osswebcdn.zbom.com/jiaxuan/images/' |
| | | |
| | | // export const baseUrl = 'https://dmtest.ahapp.net/web_interface/' // 测试服 |
| | | export const baseUrl = 'http://192.168.0.135:10027' // 本地 |
| | | |
| | | // 腾讯地图开发者 key |
| | | export const qqMapKey = 'HIDBZ-2QXL4-TAWUD-XET6Q-EKTJE-CCBSQ' |
| | | |