| | |
| | | }) |
| | | } else { |
| | | this.globalData.token = token |
| | | // if (op.query.scene) { |
| | | // let temp = op.query.scene.split('_') |
| | | // wx.navigateTo({ |
| | | // url: `${pathMap[temp[1]]}?id=${temp[0]}&userId=${temp[2]}`, |
| | | // }) |
| | | // } |
| | | wx.setStorageSync('member', res.data) |
| | | if (op.query.scene) { |
| | | let temp = op.query.scene.split('_') |
| | | wx.navigateTo({ |
| | | url: `${pathMap[temp[1]]}?id=${temp[0]}&userId=${temp[2]}`, |
| | | }) |
| | | } |
| | | } |
| | | }) |
| | | } else { |
| | |
| | | display: flex; |
| | | border-radius: 8rpx; |
| | | } |
| | | |
| | | .container { |
| | | min-height: 100vh; |
| | | padding: 0; |
| | |
| | | |
| | | import { |
| | | getArea |
| | | } from '../../api/index' |
| | | Component({ |
| | | properties: { |
| | | // placeholder为选择器的默认提示文字 |
| | | placeholder: { |
| | | type: String, |
| | | value: '请选择省市地区', |
| | | }, |
| | | // value为选择器的默认值,类型为数组 |
| | | value: { |
| | | type: Array, |
| | | value: [], |
| | | // observer监听value的变化,如果有值则调用setLabel方法设置选择器的label |
| | | observer(selectedValues) { |
| | | if (selectedValues && selectedValues.length) { |
| | | this.resetValus(selectedValues) |
| | | this.setLabel(); |
| | | } |
| | | } |
| | | } |
| | | }, |
| | | data: { |
| | | // label为选择器的显示值 |
| | | label: '', |
| | | // range为选择器的可选项,类型为数组,包含三个数组,分别为省、市、区/县 |
| | | range: [], |
| | | // pickerValue为选择器的选中值,类型为数组,包含三个数字,分别为省、市、区/县的下标 |
| | | pickerValue: [], |
| | | // addressList为选择器的数据源,类型为数组,包含省、市、区/县的信息 |
| | | addressList: [], |
| | | }, |
| | | // attached生命周期函数,在组件实例进入页面节点树时执行 |
| | | attached() { |
| | | this.initData() |
| | | }, |
| | | import { |
| | | getArea |
| | | } from '../../api/index' |
| | | Component({ |
| | | properties: { |
| | | // placeholder为选择器的默认提示文字 |
| | | placeholder: { |
| | | type: String, |
| | | value: '请选择省市地区', |
| | | }, |
| | | // value为选择器的默认值,类型为数组 |
| | | value: { |
| | | type: Array, |
| | | value: [], |
| | | // observer监听value的变化,如果有值则调用setLabel方法设置选择器的label |
| | | observer(selectedValues) { |
| | | if (selectedValues && selectedValues.length) { |
| | | this.resetValus(selectedValues) |
| | | this.setLabel(); |
| | | } |
| | | } |
| | | } |
| | | }, |
| | | data: { |
| | | // label为选择器的显示值 |
| | | label: '', |
| | | // range为选择器的可选项,类型为数组,包含三个数组,分别为省、市、区/县 |
| | | range: [], |
| | | // pickerValue为选择器的选中值,类型为数组,包含三个数字,分别为省、市、区/县的下标 |
| | | pickerValue: [], |
| | | // addressList为选择器的数据源,类型为数组,包含省、市、区/县的信息 |
| | | addressList: [], |
| | | }, |
| | | // attached生命周期函数,在组件实例进入页面节点树时执行 |
| | | attached() { |
| | | this.initData() |
| | | }, |
| | | |
| | | methods: { |
| | | // wx.setStorageSync('addressList', tl) |
| | | initData(){ |
| | | let list = wx.getStorageSync('addressList') |
| | | if(list && list.length){ |
| | | this.setData({addressList: list}) |
| | | this.resetValus(list) |
| | | this.setLabel(); |
| | | if (!this.data.value.length) { |
| | | this.initRange(); |
| | | } |
| | | }else{ |
| | | getArea({ |
| | | "level": "", |
| | | "pid": "" |
| | | }).then(res => { |
| | | var tl = [] |
| | | if(res && res.data && res.data.length){ |
| | | res.data.forEach(element => { |
| | | let tc = [] |
| | | if(element.children &&element.children.length){ |
| | | element.children.forEach(c => { |
| | | let ta = [] |
| | | if(c.children &&c.children.length){ |
| | | c.children.forEach(a => { |
| | | ta.push({ |
| | | label: a.name, |
| | | value: a.id , |
| | | regionLevel: '3', |
| | | parentRegionCode: c.id |
| | | }) |
| | | }) |
| | | } |
| | | tc.push({ |
| | | label: c.name, |
| | | value: c.id, |
| | | regionLevel:"2", |
| | | children:ta, |
| | | parentRegionCode:element.id |
| | | }) |
| | | }) |
| | | } |
| | | tl.push({ |
| | | label: element.name, |
| | | value: element.id, |
| | | regionLevel:"1", |
| | | children: tc, |
| | | parentRegionCode:"0" |
| | | }) |
| | | }); |
| | | } |
| | | wx.setStorageSync('addressList', tl) |
| | | this.setData({addressList: tl}) |
| | | this.resetValus() |
| | | this.setLabel(); |
| | | if (!this.data.value.length) { |
| | | this.initRange(); |
| | | } |
| | | }) |
| | | } |
| | | }, |
| | | resetValus(selectedValues){ |
| | | selectedValues = selectedValues || this.data.value |
| | | let temVal = [] |
| | | let tlable ='' |
| | | if (selectedValues.length == 3) { |
| | | var v1 = selectedValues[0] |
| | | var v2 = selectedValues[1] |
| | | var v3= selectedValues[2] |
| | | var t1,t2,t3; |
| | | this.data.addressList.forEach(item =>{ |
| | | if(v1 && v1.length ==6 |
| | | &&v2 && v2.length ==6 |
| | | &&v3 && v3.length ==6){ |
| | | if(item.value.indexOf(v1) == 0){ |
| | | t1 = item.value |
| | | if(item.children){ |
| | | item.children.forEach(item2 =>{ |
| | | if(item2.value.indexOf(v2) == 0){ |
| | | if(item2.children){ |
| | | item2.children.forEach(item3 =>{ |
| | | if(item3.value.indexOf(v3) == 0){ |
| | | tlable = item.label +"-"+item2.label+'-'+item3.label |
| | | t1 = item.value |
| | | t2 = item2.value |
| | | t3 = item3.value |
| | | temVal = [t1,t2,t3] |
| | | // this.value = temVal |
| | | // this.data.label=tlable |
| | | this.triggerEvent("change", { |
| | | value: temVal, |
| | | label:tlable |
| | | }); |
| | | this.setData({value:temVal,label:tlable}) |
| | | } |
| | | }) |
| | | } |
| | | } |
| | | }) |
| | | } |
| | | } |
| | | } |
| | | }) |
| | | } |
| | | }, |
| | | // getAddressItem方法用于将地址信息转换为选择器可用的格式 |
| | | getAddressItem(data) { |
| | | return { |
| | | label: data.label, |
| | | value: data.value |
| | | }; |
| | | }, |
| | | // setAddressList方法用于将地址列表转换为选择器可用的格式 |
| | | setAddressList(list) { |
| | | return list.map((v) => this.getAddressItem(v)); |
| | | }, |
| | | // getAddressByCode方法用于根据value值获取地址信息及其在数组中的下标 |
| | | getAddressByCode(list = [], value) { |
| | | let index = list.findIndex(item => item.value === value); |
| | | return [index, list[index] || {}]; |
| | | }, |
| | | // openChildren方法用于根据value值打开下一级选择器 |
| | | openChildren(list, keys) { |
| | | let result = []; |
| | | const handle = (arr, keys) => { |
| | | let newarr = arr.map((v, index) => { |
| | | if (keys && keys.length) { |
| | | let [currentKey, ...nextKey] = keys; |
| | | if (currentKey === index && Array.isArray(v.children)) { |
| | | handle(v.children, nextKey); |
| | | } |
| | | } |
| | | return this.getAddressItem(v); |
| | | }); |
| | | result.push(newarr); |
| | | } |
| | | handle(list, keys); |
| | | return result.reverse(); |
| | | }, |
| | | // onChange方法为选择器的change事件处理函数,用于设置label和触发change事件 |
| | | onChange(e) { |
| | | let [r1, r2, r3] = this.data.range; |
| | | const [v1, v2, v3] = e.detail.value; |
| | | const selected = [r1[v1], r2[v2], r3[v3]]; |
| | | const values = selected.map(v => v.value); |
| | | const label = selected.map(v => v.label).join('-'); |
| | | |
| | | this.triggerEvent("change", { |
| | | value: values, |
| | | label:label |
| | | }); |
| | | this.setData({ |
| | | label:label |
| | | }); |
| | | }, |
| | | // columnChange方法为选择器的columnchange事件处理函数,用于设置range和pickerValue |
| | | columnChange(e) { |
| | | const { |
| | | column, |
| | | value |
| | | } = e.detail; |
| | | this.setColumn(column, value); |
| | | }, |
| | | // setColumn方法用于设置range和pickerValue |
| | | setColumn(column, value) { |
| | | let addressList = this.data.addressList; |
| | | if (!addressList || addressList.length === 0) return; |
| | | let [r1, r2, r3] = this.data.range; |
| | | if (column === 0) { |
| | | r2 = this.setAddressList(addressList[value].children); |
| | | r3 = this.setAddressList(addressList[value].children[0].children); |
| | | this.setData({ |
| | | pickerValue: [value, 0, 0] |
| | | }); |
| | | } else if (column === 1) { |
| | | const [v1] = this.data.pickerValue; |
| | | r3 = this.setAddressList(addressList[v1].children[value].children); |
| | | this.setData({ |
| | | pickerValue: [v1, value, 0] |
| | | }); |
| | | } |
| | | this.setData({ |
| | | range: [r1, r2, r3] |
| | | }); |
| | | }, |
| | | // setLabel方法用于设置label |
| | | setLabel() { |
| | | let addressList = this.data.addressList; |
| | | if (addressList && addressList.length) { |
| | | const [v1, v2, v3] = this.data.value; |
| | | const [s1, { |
| | | label: t1, |
| | | children: l1 |
| | | }] = this.getAddressByCode(addressList, v1); |
| | | const [s2, { |
| | | label: t2, |
| | | children: l2 |
| | | }] = this.getAddressByCode(l1, v2); |
| | | const [s3, { |
| | | label: t3 |
| | | }] = this.getAddressByCode(l2, v3); |
| | | const label = [t1, t2, t3].filter(v => v).join('-'); |
| | | |
| | | const pickerValue = [s1, s2, s3]; |
| | | const range = this.openChildren(addressList, [s1, s2, s3]); |
| | | if (label.length) { |
| | | this.setData({ |
| | | label, |
| | | range, |
| | | pickerValue |
| | | }); |
| | | } |
| | | } |
| | | }, |
| | | // initRange方法用于初始化range |
| | | initRange() { |
| | | if (!this.data.value.length) { |
| | | const range = this.openChildren(this.data.addressList, [0, 0, 0]); |
| | | this.setData({ |
| | | range |
| | | }); |
| | | } |
| | | }, |
| | | |
| | | }, |
| | | }); |
| | | methods: { |
| | | initData() { |
| | | let list = wx.getStorageSync('addressList') || [] |
| | | if (list && list.length) { |
| | | this.setData({ |
| | | addressList: list |
| | | }) |
| | | this.resetValus(list) |
| | | this.setLabel(); |
| | | if (!this.data.value.length) { |
| | | this.initRange(); |
| | | } |
| | | } else { |
| | | getArea({ |
| | | "level": "", |
| | | "pid": "" |
| | | }).then(res => { |
| | | var tl = [] |
| | | if (res && res.data && res.data.length) { |
| | | res.data.forEach(element => { |
| | | let tc = [] |
| | | if (element.children && element.children.length) { |
| | | element.children.forEach(c => { |
| | | let ta = [] |
| | | if (c.children && c.children.length) { |
| | | c.children.forEach(a => { |
| | | ta.push({ |
| | | label: a.name, |
| | | value: a.id, |
| | | regionLevel: '3', |
| | | parentRegionCode: c.id |
| | | }) |
| | | }) |
| | | } |
| | | tc.push({ |
| | | label: c.name, |
| | | value: c.id, |
| | | regionLevel: "2", |
| | | children: ta, |
| | | parentRegionCode: element.id |
| | | }) |
| | | }) |
| | | } |
| | | tl.push({ |
| | | label: element.name, |
| | | value: element.id, |
| | | regionLevel: "1", |
| | | children: tc, |
| | | parentRegionCode: "0" |
| | | }) |
| | | }); |
| | | } |
| | | wx.setStorageSync('addressList', tl) |
| | | this.setData({ |
| | | addressList: tl |
| | | }) |
| | | this.resetValus() |
| | | this.setLabel(); |
| | | if (!this.data.value.length) { |
| | | this.initRange(); |
| | | } |
| | | }) |
| | | } |
| | | }, |
| | | resetValus(selectedValues) { |
| | | selectedValues = selectedValues || this.data.value |
| | | let temVal = [] |
| | | let tlable = '' |
| | | if (selectedValues.length == 3) { |
| | | var v1 = selectedValues[0] |
| | | var v2 = selectedValues[1] |
| | | var v3 = selectedValues[2] |
| | | var t1, t2, t3; |
| | | this.data.addressList.forEach(item => { |
| | | if (v1 && v1.length == 6 && |
| | | v2 && v2.length == 6 && |
| | | v3 && v3.length == 6) { |
| | | if (item.value.indexOf(v1) == 0) { |
| | | t1 = item.value |
| | | if (item.children) { |
| | | item.children.forEach(item2 => { |
| | | if (item2.value.indexOf(v2) == 0) { |
| | | if (item2.children) { |
| | | item2.children.forEach(item3 => { |
| | | if (item3.value.indexOf(v3) == 0) { |
| | | tlable = item.label + "-" + item2.label + '-' + item3.label |
| | | t1 = item.value |
| | | t2 = item2.value |
| | | t3 = item3.value |
| | | temVal = [t1, t2, t3] |
| | | // this.value = temVal |
| | | // this.data.label=tlable |
| | | this.triggerEvent("change", { |
| | | value: temVal, |
| | | label: tlable |
| | | }); |
| | | this.setData({ |
| | | value: temVal, |
| | | label: tlable |
| | | }) |
| | | } |
| | | }) |
| | | } |
| | | } |
| | | }) |
| | | } |
| | | } |
| | | } |
| | | }) |
| | | } |
| | | }, |
| | | // getAddressItem方法用于将地址信息转换为选择器可用的格式 |
| | | getAddressItem(data) { |
| | | return { |
| | | label: data.label, |
| | | value: data.value |
| | | }; |
| | | }, |
| | | // setAddressList方法用于将地址列表转换为选择器可用的格式 |
| | | setAddressList(list) { |
| | | return list.map((v) => this.getAddressItem(v)); |
| | | }, |
| | | // getAddressByCode方法用于根据value值获取地址信息及其在数组中的下标 |
| | | getAddressByCode(list = [], value) { |
| | | let index = list.findIndex(item => item.value === value); |
| | | return [index, list[index] || {}]; |
| | | }, |
| | | // openChildren方法用于根据value值打开下一级选择器 |
| | | openChildren(list, keys) { |
| | | let result = []; |
| | | const handle = (arr, keys) => { |
| | | let newarr = arr.map((v, index) => { |
| | | if (keys && keys.length) { |
| | | let [currentKey, ...nextKey] = keys; |
| | | if (currentKey === index && Array.isArray(v.children)) { |
| | | handle(v.children, nextKey); |
| | | } |
| | | } |
| | | return this.getAddressItem(v); |
| | | }); |
| | | result.push(newarr); |
| | | } |
| | | handle(list, keys); |
| | | return result.reverse(); |
| | | }, |
| | | // onChange方法为选择器的change事件处理函数,用于设置label和触发change事件 |
| | | onChange(e) { |
| | | let [r1, r2, r3] = this.data.range; |
| | | const [v1, v2, v3] = e.detail.value; |
| | | const selected = [r1[v1], r2[v2], r3[v3]]; |
| | | const values = selected.map(v => v.value); |
| | | const label = selected.map(v => v.label).join('-'); |
| | | |
| | | this.triggerEvent("change", { |
| | | value: values, |
| | | label: label |
| | | }); |
| | | this.setData({ |
| | | label: label |
| | | }); |
| | | }, |
| | | // columnChange方法为选择器的columnchange事件处理函数,用于设置range和pickerValue |
| | | columnChange(e) { |
| | | const { |
| | | column, |
| | | value |
| | | } = e.detail; |
| | | this.setColumn(column, value); |
| | | }, |
| | | // setColumn方法用于设置range和pickerValue |
| | | setColumn(column, value) { |
| | | let addressList = this.data.addressList; |
| | | if (!addressList || addressList.length === 0) return; |
| | | let [r1, r2, r3] = this.data.range; |
| | | if (column === 0) { |
| | | r2 = this.setAddressList(addressList[value].children); |
| | | r3 = this.setAddressList(addressList[value].children[0].children); |
| | | this.setData({ |
| | | pickerValue: [value, 0, 0] |
| | | }); |
| | | } else if (column === 1) { |
| | | const [v1] = this.data.pickerValue; |
| | | r3 = this.setAddressList(addressList[v1].children[value].children); |
| | | this.setData({ |
| | | pickerValue: [v1, value, 0] |
| | | }); |
| | | } |
| | | this.setData({ |
| | | range: [r1, r2, r3] |
| | | }); |
| | | }, |
| | | // setLabel方法用于设置label |
| | | setLabel() { |
| | | let addressList = this.data.addressList; |
| | | if (addressList && addressList.length) { |
| | | const [v1, v2, v3] = this.data.value; |
| | | const [s1, { |
| | | label: t1, |
| | | children: l1 |
| | | }] = this.getAddressByCode(addressList, v1); |
| | | const [s2, { |
| | | label: t2, |
| | | children: l2 |
| | | }] = this.getAddressByCode(l1, v2); |
| | | const [s3, { |
| | | label: t3 |
| | | }] = this.getAddressByCode(l2, v3); |
| | | const label = [t1, t2, t3].filter(v => v).join('-'); |
| | | |
| | | const pickerValue = [s1, s2, s3]; |
| | | const range = this.openChildren(addressList, [s1, s2, s3]); |
| | | if (label.length) { |
| | | this.setData({ |
| | | label, |
| | | range, |
| | | pickerValue |
| | | }); |
| | | } |
| | | } |
| | | }, |
| | | // initRange方法用于初始化range |
| | | initRange() { |
| | | if (!this.data.value.length) { |
| | | const range = this.openChildren(this.data.addressList, [0, 0, 0]); |
| | | this.setData({ |
| | | range |
| | | }); |
| | | } |
| | | }, |
| | | |
| | | }, |
| | | }); |
| | |
| | | }, |
| | | touchmove(e) { |
| | | var touchMove = e.detail.scrollTop; |
| | | if(touchDot - touchMove > 16){ |
| | | if(touchMove - touchDot > 24){ |
| | | touchDot = touchMove |
| | | this.fadeOut(); |
| | | } |
| | | if(touchDot - touchMove > 16){ |
| | | if(touchDot - touchMove > 24){ |
| | | touchDot = touchMove |
| | | setTimeout(() => { |
| | | this.setData({ showTouch: true }) |
| | |
| | | padding: 0 10rpx; |
| | | } |
| | | .name{ |
| | | font-size: 30rpx; |
| | | margin: 12rpx 0 8rpx; |
| | | white-space: nowrap; |
| | | overflow: hidden; |
| | |
| | | padding: 0 10rpx; |
| | | } |
| | | .main_content .goods_list .item .name { |
| | | font-size: 30rpx; |
| | | margin: 12rpx 0 8rpx; |
| | | white-space: nowrap; |
| | | overflow: hidden; |
| | |
| | | }, |
| | | touchmove(e) { |
| | | var touchMove = e.detail.scrollTop; |
| | | if(touchDot - touchMove > 16){ |
| | | if(touchMove - touchDot > 24){ |
| | | touchDot = touchMove |
| | | this.fadeOut(); |
| | | } |
| | | if(touchDot - touchMove > 16){ |
| | | if(touchDot - touchMove > 24){ |
| | | touchDot = touchMove |
| | | setTimeout(() => { |
| | | this.setData({ showTouch: true }) |
| | |
| | | |
| | | .main_content { |
| | | display: flex; |
| | | height: 100%; |
| | | height: calc( 100% - 120rpx ); |
| | | .main_left { |
| | | width: 160rpx; |
| | | height: 100%; |
| | | border-radius: 0rpx 16rpx 16rpx 0rpx; |
| | | |
| | | .item { |
| | | width: 160rpx; |
| | | height: 100rpx; |
| | |
| | | } |
| | | } |
| | | .goods_list { |
| | | height: calc( 100% - 222rpx); |
| | | height: 100%; |
| | | width: 590rpx; |
| | | box-sizing: border-box; |
| | | padding: 12rpx 40rpx; |
| | |
| | | } |
| | | .main_content { |
| | | display: flex; |
| | | height: 100%; |
| | | height: calc(100% - 120rpx); |
| | | } |
| | | .main_content .main_left { |
| | | width: 160rpx; |
| | |
| | | background-color: #333333; |
| | | } |
| | | .main_content .main_right .goods_list { |
| | | height: calc(100% - 222rpx); |
| | | height: 100%; |
| | | width: 590rpx; |
| | | box-sizing: border-box; |
| | | padding: 12rpx 40rpx; |
| | |
| | | menuButtonInfo: Object |
| | | }, |
| | | data: { |
| | | acVid: '', |
| | | viewIdList: [], |
| | | // 动画 |
| | | showTouch: true, |
| | | animationData: {}, |
| | |
| | | }, |
| | | touchmove(e) { |
| | | var touchMove = e.detail.scrollTop; |
| | | if (touchDot - touchMove > 16) { |
| | | if(touchMove - touchDot > 24){ |
| | | touchDot = touchMove |
| | | this.fadeOut(); |
| | | } |
| | | if (touchDot - touchMove > 16) { |
| | | if(touchDot - touchMove > 24){ |
| | | touchDot = touchMove |
| | | setTimeout(() => { |
| | | this.setData({ showTouch: true }) |
| | |
| | | } |
| | | }, |
| | | videoClick(e) { |
| | | const { |
| | | videourl |
| | | } = e.currentTarget.dataset |
| | | |
| | | let videoPlay = this.selectComponent('.videoPlay'); |
| | | if (videoPlay) { |
| | | videoPlay.startPlayVideo(videourl, this); |
| | | const { id } = e.currentTarget.dataset |
| | | const { dataList, acVid, viewIdList } = this.data |
| | | const index = viewIdList.findIndex(i => i === 'video' + id) |
| | | if(acVid){ |
| | | if('video' + id != acVid){ |
| | | wx.createVideoContext(acVid, this).pause() |
| | | wx.createVideoContext('video' + id, this).play() |
| | | this.setData({ acVid: 'video' + id }) |
| | | } |
| | | }else{ |
| | | this.setData({ acVid: 'video' + id }) |
| | | wx.createVideoContext('video' + id, this).play() |
| | | } |
| | | console.log(videourl + "-------------------------------------") |
| | | // wx.previewMedia({ |
| | | // sources: [{ url: videourl, type: 'video' }] |
| | | // }) |
| | | dataList.forEach(ite => { |
| | | if(id === ite.id && index === -1){ |
| | | ite.viewCount += 1 |
| | | viewIdList.push('video' + id) |
| | | actionDo({ |
| | | actionType: 'view', |
| | | id: id |
| | | }) |
| | | this.setData({ viewIdList }) |
| | | } |
| | | }) |
| | | this.setData({ dataList }) |
| | | }, |
| | | priviewFull(e) { |
| | | const item = e.currentTarget.dataset.item |
| | |
| | | const item = e.currentTarget.dataset.item |
| | | console.log('item', item); |
| | | if (item.openType == 'video') { |
| | | |
| | | let videoPlay = this.selectComponent('.videoPlay'); |
| | | if (videoPlay) { |
| | | videoPlay.startPlayVideo(item.openContent, this); |
| | | } |
| | | // wx.previewMedia({ |
| | | // sources: [{ url: item.openContent, type: 'video' }] |
| | | // }) |
| | | return |
| | | } |
| | | if (item.openType == 'link') { |
| | | wx.navigateTo({ |
| | |
| | | { |
| | | "component": true, |
| | | "usingComponents": { |
| | | "videoPlay": "/components/videoPlay/index" |
| | | } |
| | | "component": true |
| | | } |
| | |
| | | height: 100rpx; |
| | | } |
| | | .item { |
| | | width: 324rpx; |
| | | float: left; |
| | | width: 100%; |
| | | margin-bottom: 32rpx; |
| | | margin-right: 0; |
| | | &:nth-of-type(2n){ |
| | | margin-right: 22rpx; |
| | | } |
| | | .img_wrap { |
| | | width: 100%; |
| | | height: 182rpx; |
| | | height: 376rpx; |
| | | border-radius: 8rpx; |
| | | overflow: hidden; |
| | | position: relative; |
| | |
| | | } |
| | | |
| | | .name { |
| | | font-size: 30rpx; |
| | | margin: 12rpx 0 8rpx; |
| | | white-space: nowrap; |
| | | overflow: hidden; |
| | |
| | | <!-- goods_list --> |
| | | <scroll-view bindscrolltoupper="bindscrolltoupper" bindscrolltolower="scrolltolower" binddragging="touchmove" binddragstart="touchstart" scroll-y enhanced class="goods_list"> |
| | | <view class="empty"></view> |
| | | <view wx:for="{{ dataList }}" data-item="{{item}}" class="item" bindtap="handleDetail"> |
| | | <view class="img_wrap"> |
| | | <view wx:for="{{ dataList }}" class="item" > |
| | | <view data-item="{{item}}" bindtap="handleDetail" wx:if="{{ item.openType != 'video' }}" class="img_wrap"> |
| | | <image src="{{ item.coverImage }}" class="img"></image> |
| | | <view wx:if="{{ item.openType == 'link' }}" data-item="{{item}}" bindtap="priviewFull" class="full"> |
| | | <text>VR</text> |
| | | </view> |
| | | <image wx:if="{{ item.openType == 'video' }}" bindtap="videoClick" data-videourl="{{ item.openContent }}" class="play" src="../../static/icon/ic_play.png" mode="widthFix"></image> |
| | | <image wx:if="{{ false }}" class="new" src="../../static/icon/chanpin_ic_new@2x.png" mode="widthFix"></image> |
| | | </view> |
| | | <video id="video{{item.id}}" class="img_wrap" wx:if="{{ item.openType == 'video' }}" src="{{item.openContent}}" poster="{{ item.coverImage }}" data-id="{{ item.id }}" bindplay="videoClick"></video> |
| | | <view class="content"> |
| | | <view class="name">{{ item.title }}</view> |
| | | </view> |
| | |
| | | </scroll-view> |
| | | </view> |
| | | </view> |
| | | |
| | | |
| | | <videoPlay class="videoPlay"/> |
| | | </view> |
| | | <wxs module="math" src="../../utils/math.wxs"></wxs> |
| | |
| | | height: 100rpx; |
| | | } |
| | | .main_content .goods_list .item { |
| | | width: 324rpx; |
| | | float: left; |
| | | width: 100%; |
| | | margin-bottom: 32rpx; |
| | | margin-right: 0; |
| | | } |
| | | .main_content .goods_list .item:nth-of-type(2n) { |
| | | margin-right: 22rpx; |
| | | } |
| | | .main_content .goods_list .item .img_wrap { |
| | | width: 100%; |
| | | height: 182rpx; |
| | | height: 376rpx; |
| | | border-radius: 8rpx; |
| | | overflow: hidden; |
| | | position: relative; |
| | |
| | | padding: 0 10rpx; |
| | | } |
| | | .main_content .goods_list .item .name { |
| | | font-size: 30rpx; |
| | | margin: 12rpx 0 8rpx; |
| | | white-space: nowrap; |
| | | overflow: hidden; |
| | |
| | | <text data-index="1" bindtap="onOpen" class="primary">《ZBOM用户隐私政策》</text> |
| | | </view> |
| | | </view> |
| | | <button class="btn" wx:if="{{ !agreementFalg }}" bindtap="loginIn">手机号快捷登录</button> |
| | | <button wx:else class="btn" open-type="getPhoneNumber" bindgetphonenumber="getPhoneNumber">手机号快捷登录</button> |
| | | <button hover-class="none" class="btn" wx:if="{{ !agreementFalg }}" bindtap="loginIn">手机号快捷登录</button> |
| | | <button hover-class="none" wx:else class="btn" open-type="getPhoneNumber" bindgetphonenumber="getPhoneNumber">手机号快捷登录</button> |
| | | </view> |
| | | </view> |
| | | <!-- --> |
| | |
| | | |
| | | <view class="form-item"> |
| | | <view class="submit-btn" bindtap="submit" wx:if="{{ userPhone != null && userPhone != 'undefined' && userPhone.length === 11 }}">立即计算</view> |
| | | <button class="submit-btn" wx:else |
| | | <button hover-class="none" class="submit-btn" wx:else |
| | | open-type="getPhoneNumber" bindgetphonenumber="getPhoneNumber">立即计算</button> |
| | | </view> |
| | | </view> |
| | |
| | | }, |
| | | touchmove(e) { |
| | | var touchMove = e.detail.scrollTop; |
| | | if(touchDot - touchMove > 16){ |
| | | if(touchMove - touchDot >24){ |
| | | touchDot = touchMove |
| | | this.fadeOut(); |
| | | } |
| | | if(touchDot - touchMove > 16){ |
| | | if(touchDot - touchMove > 24){ |
| | | touchDot = touchMove |
| | | setTimeout(() => { |
| | | this.setData({ showCate: true }) |
| | | this.fadeIn(); |
| | | }, 200) |
| | | }, 300) |
| | | } |
| | | }, |
| | | fadeIn: function () { |
| | |
| | | }); |
| | | setTimeout(() => { |
| | | this.setData({ showCate: false }); |
| | | }, 200); // 动画持续时间 |
| | | }, 300); // 动画持续时间 |
| | | }, |
| | | /** |
| | | * 生命周期函数--监听页面显示 |
| | |
| | | |
| | | <!-- footer --> |
| | | <view wx:if="{{ origin && origin == 'b' }}"> |
| | | <button open-type="share" style="bottom: {{bottomLift + 6}}px;" class="share_btn">分享</button> |
| | | <button hover-class="none" open-type="share" style="bottom: {{bottomLift + 6}}px;" class="share_btn">分享</button> |
| | | </view> |
| | | <view wx:else class="footer" style="padding-bottom: {{bottomLift}}px;"> |
| | | <view class="btns"> |
| | |
| | | <image class="icon" src="../../static/icon/detail_nav_collected.png" mode="widthFix"></image> |
| | | <view class="name">收藏</view> |
| | | </view> --> |
| | | <button open-type="share" class="item" bindtap="handleShare"> |
| | | <button hover-class="none" open-type="share" class="item" bindtap="handleShare"> |
| | | <image class="icon" src="../../static/icon/detail_nav_share.png" mode="widthFix"></image> |
| | | <view class="name">分享</view> |
| | | </button> |
| | |
| | | </view> |
| | | <!-- footer --> |
| | | <view wx:if="{{ origin && origin == 'b' }}"> |
| | | <button open-type="share" style="bottom: {{bottomLift + 6}}px;" class="share_btn">分享</button> |
| | | <button hover-class="none" open-type="share" style="bottom: {{bottomLift + 6}}px;" class="share_btn">分享</button> |
| | | </view> |
| | | <view wx:else class="footer" style="padding-bottom: {{bottomLift}}px;"> |
| | | <view class="btns"> |
| | | <button class="item btn"> |
| | | <image data-code="collect_cancel" bindtap="handleAction" wx:if="{{ info.isCollection }}" 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> |
| | | <button hover-class="none" data-code="{{ info.isCollection ? 'collect_cancel' : 'collect' }}" bindtap="handleAction" class="item btn"> |
| | | <image wx:if="{{ info.isCollection }}" class="icon" src="../../static/icon/detail_nav_collected.png" mode="widthFix"></image> |
| | | <image wx:else 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"> |
| | | <button hover-class="none" open-type="share" class="item btn" bindtap="handleShare"> |
| | | <image class="icon" src="../../static/icon/detail_nav_share.png" mode="widthFix"></image> |
| | | <view class="name">分享</view> |
| | | </button> |
| | |
| | | </view> |
| | | <!-- footer --> |
| | | <view wx:if="{{ origin && origin == 'b' }}"> |
| | | <button open-type="share" style="bottom: {{bottomLift + 6}}px;" class="share_btn">分享</button> |
| | | <button hover-class="none" open-type="share" style="bottom: {{bottomLift + 6}}px;" class="share_btn">分享</button> |
| | | </view> |
| | | <view wx:else class="footer" style="padding-bottom: {{bottomLift}}px;"> |
| | | <view class="btns"> |
| | | <button class="item btn"> |
| | | <image data-code="collect_cancel" bindtap="handleAction" wx:if="{{ info.isCollection }}" 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> |
| | | <button hover-class="none" data-code="{{ info.isCollection ? 'collect_cancel' : 'collect' }}" bindtap="handleAction" class="item btn"> |
| | | <image wx:if="{{ info.isCollection }}" class="icon" src="../../static/icon/detail_nav_collected.png" mode="widthFix"></image> |
| | | <image wx:else 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"> |
| | | <button hover-class="none" open-type="share" class="item btn" bindtap="handleShare"> |
| | | <image class="icon" src="../../static/icon/detail_nav_share.png" mode="widthFix"></image> |
| | | <view class="name">分享</view> |
| | | </button> |
| | |
| | | <image data-url="{{ item }}" bindtap="priviewSpace" class="info_item" wx:for="{{ info.contentImgList }}" src="{{ item }}" mode="widthFix"></image> |
| | | <view class="desc">{{ info.contentText || '' }}</view> |
| | | <view wx:if="{{ origin && origin == 'b' }}"> |
| | | <button open-type="share" style="bottom: {{bottomLift + 6}}px;" class="share_btn">分享</button> |
| | | <button hover-class="none" open-type="share" style="bottom: {{bottomLift + 6}}px;" class="share_btn">分享</button> |
| | | </view> |
| | | <view wx:else class="footer" style="padding-bottom: {{bottomLift}}px;"> |
| | | <view class="btns"> |
| | | <button class="item btn"> |
| | | <image data-code="collect_cancel" bindtap="handleAction" wx:if="{{ info.isCollection }}" 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> |
| | | <button hover-class="none" data-code="{{ info.isCollection ? 'collect_cancel' : 'collect' }}" bindtap="handleAction" class="item btn"> |
| | | <image wx:if="{{ info.isCollection }}" class="icon" src="../../static/icon/detail_nav_collected.png" mode="widthFix"></image> |
| | | <image wx:else 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"> |
| | | <button hover-class="none" open-type="share" class="item btn" bindtap="handleShare"> |
| | | <image class="icon" src="../../static/icon/detail_nav_share.png" mode="widthFix"></image> |
| | | <view class="name">分享</view> |
| | | </button> |
| | |
| | | <!-- footer --> |
| | | <view class="footer" style="padding-bottom: {{bottomLift}}px;"> |
| | | <view class="btns"> |
| | | <button open-type="share" class="item btn" bindtap="handleShare"> |
| | | <button hover-class="none" open-type="share" class="item btn" bindtap="handleShare"> |
| | | <image class="icon" src="../../static/icon/detail_nav_share.png" mode="widthFix"></image> |
| | | <view class="name">分享</view> |
| | | </button> |
| | |
| | | import { getMemberInfo, getDictData } from '../../api/index' |
| | | import { |
| | | getMemberInfo, |
| | | getDictData |
| | | } from '../../api/index' |
| | | Page({ |
| | | /** |
| | | * 页面的初始数据 |
| | |
| | | clientTop: 0, |
| | | |
| | | member: {}, |
| | | housetype: '', |
| | | houseType: {}, |
| | | IMG_LIUCHENG: '', |
| | | MINE_BG: '' |
| | | }, |
| | |
| | | */ |
| | | onLoad(options) { |
| | | const res = wx.getMenuButtonBoundingClientRect() |
| | | this.setData({clientHeight: res.height}) |
| | | this.setData({clientTop: res.top}) |
| | | this.setData({ |
| | | clientHeight: res.height |
| | | }) |
| | | this.setData({ |
| | | clientTop: res.top |
| | | }) |
| | | }, |
| | | onShow(){ |
| | | onShow() { |
| | | this.initData() |
| | | }, |
| | | initData() { |
| | | getMemberInfo().then(res => { |
| | | this.setData({member: res.data}) |
| | | if(res.data.housetype){ |
| | | const temp = res.data.housetype.split('-') |
| | | let houseType = { |
| | | val1: temp[0], |
| | | val2: temp[1], |
| | | val3: temp[2], |
| | | val4: temp[3], |
| | | val5: temp[4], |
| | | console.log('res', res); |
| | | if (res.code == 200) { |
| | | this.setData({ |
| | | member: res.data |
| | | }) |
| | | if (res.data.housetype) { |
| | | const temp = res.data.housetype.split('-') |
| | | let houseType = { |
| | | val1: temp[0], |
| | | val2: temp[1], |
| | | val3: temp[2], |
| | | val4: temp[3], |
| | | val5: temp[4], |
| | | } |
| | | this.setData({ |
| | | houseType |
| | | }) |
| | | }else{ |
| | | this.setData({ houseType: {} }) |
| | | } |
| | | this.setData({houseType}) |
| | | }else{ |
| | | this.setData({ member: {}, houseType: {} }) |
| | | } |
| | | |
| | | }) |
| | | getDictData({ |
| | | code: 'WEIXIN_DEFAULT_IMGS', |
| | | label: 'IMG_LIUCHENG' |
| | | }).then(res => { |
| | | this.setData({ IMG_LIUCHENG: res.data.code }) |
| | | this.setData({ |
| | | IMG_LIUCHENG: res.data.code |
| | | }) |
| | | }) |
| | | getDictData({ |
| | | code: 'WEIXIN_DEFAULT_IMGS', |
| | | label: 'MINE_BG' |
| | | }).then(res => { |
| | | this.setData({ MINE_BG: res.data.code }) |
| | | this.setData({ |
| | | MINE_BG: res.data.code |
| | | }) |
| | | }) |
| | | }, |
| | | changePath(e) { |
| | | // 页面跳转 |
| | | let temp = ['mysub', 'collect', 'favorite','index'] |
| | | let temp = ['mysub', 'collect', 'favorite', 'index'] |
| | | const index = e.currentTarget.dataset.index |
| | | if(index == '4'){ |
| | | if (index == '4') { |
| | | wx.navigateToMiniProgram({ |
| | | appId: 'wx9910433b937fff92', |
| | | path: '', |
| | | envVersion: 'trial', |
| | | extraData: { |
| | | extraData: { |
| | | origin: 'c' |
| | | } |
| | | }) |
| | | } |
| | | if(index == '5'){ |
| | | if (index == '5') { |
| | | wx.navigateTo({ |
| | | url: `/pages/sets/index`, |
| | | }) |
| | |
| | | if (res && res.data.token) { |
| | | wx.setStorageSync('sessionKey', res.data.sessionKey) |
| | | wx.setStorageSync('token', res.data.token) |
| | | wx.setStorageSync('member', res.data) |
| | | this.setData({ |
| | | showLogout: false |
| | | }) |
| | |
| | | } |
| | | .modal{ |
| | | width: 610rpx; |
| | | height: 450rpx; |
| | | max-height: 450rpx; |
| | | background: #FFFFFF; |
| | | border-radius: 8rpx; |
| | | padding: 60rpx 40rpx 30rpx; |
| | |
| | | </view> |
| | | </view> |
| | | </van-popup> |
| | | <van-popup show="{{ showLogout }}" round bind:close="appClose"> |
| | | <van-popup show="{{ showLogout }}" close-on-click-overlay="{{false}}" round bind:close="appClose"> |
| | | <view class="modal"> |
| | | <view class="title">提醒</view> |
| | | <view class="text">你是否要退出该小程序吗</view> |
| | |
| | | } |
| | | .modal { |
| | | width: 610rpx; |
| | | height: 450rpx; |
| | | max-height: 450rpx; |
| | | background: #FFFFFF; |
| | | border-radius: 8rpx; |
| | | padding: 60rpx 40rpx 30rpx; |
| | |
| | | this.getList() |
| | | }, |
| | | onShow() { |
| | | const dataList = this.data.dataList |
| | | eventBus.once('caseDeBack', (info) => { |
| | | const temp = dataList.filter(item => { |
| | | const temp = this.data.dataList.filter(item => { |
| | | if (item.id === info.id) { |
| | | item.isCollection = info.isCollection |
| | | item.viewCount++ |
| | |
| | | this.setData({ dataList: temp}) |
| | | }) |
| | | eventBus.once('productDeBack', (info) => { |
| | | const temp = dataList.filter(item => { |
| | | const temp = this.data.dataList.filter(item => { |
| | | if (item.id === info.id) { |
| | | item.isCollection = info.isCollection |
| | | item.viewCount++ |
| | |
| | | this.setData({ dataList: temp}) |
| | | }) |
| | | eventBus.once('realpicDeBack', (info) => { |
| | | const temp = dataList.filter(item => { |
| | | const temp = this.data.dataList.filter(item => { |
| | | if (item.id === info.id) { |
| | | item.isCollection = info.isCollection |
| | | item.viewCount++ |
| | |
| | | uploadUrl, |
| | | editMember, |
| | | getMemberInfo, |
| | | getArea, |
| | | getWxMiniPhone |
| | | } from '../../api/index' |
| | | Page({ |
| | |
| | | } |
| | | |
| | | }) |
| | | }) |
| | | getArea().then(res => { |
| | | this.setData({ areaData: res.data }) |
| | | }) |
| | | }, |
| | | regionChange(e) { |
| | |
| | | <view class="container"> |
| | | <image class="avatar" src="{{ imgurlFull ? imgurlFull : '../../static/images/default_avatar.png' }}"></image> |
| | | <button open-type="chooseAvatar" bindchooseavatar="getBindchooseavatar" class="avatar_btn">更换头像</button> |
| | | <button hover-class="none" open-type="chooseAvatar" bindchooseavatar="getBindchooseavatar" class="avatar_btn">更换头像</button> |
| | | <view class="list"> |
| | | <view class="line"> |
| | | <view class="label">昵称</view> |
| | |
| | | <view class="label">电话</view> |
| | | <view class="wechat_phone"> |
| | | <van-field placeholder="请输入电话" class="field" type="number" border="{{ false }}" model:value="{{ phone }}" maxlength="{{ 11 }}" clearable /> |
| | | <button open-type="getPhoneNumber" bindgetphonenumber="getPhoneNumber" class="btn">微信授权</button> |
| | | <button hover-class="none" open-type="getPhoneNumber" bindgetphonenumber="getPhoneNumber" class="btn">微信授权</button> |
| | | </view> |
| | | </view> |
| | | <view class="line"> |
| | |
| | | }, |
| | | { |
| | | "name": "", |
| | | "pathName": "pages/auth/auth", |
| | | "pathName": "pages/userinfo/collect", |
| | | "query": "", |
| | | "launchMode": "default", |
| | | "scene": null |
| | |
| | | }, |
| | | { |
| | | "name": "", |
| | | "pathName": "pages/productVideo/index", |
| | | "pathName": "pages/auth/auth", |
| | | "query": "", |
| | | "launchMode": "default", |
| | | "scene": null |
| | |
| | | resolve(res.data || true) |
| | | } else { |
| | | if (options.data && options.data.isAuth && (res.data.code == 5111 || res.data.code == 5112 || res.data.code == 5110)) { |
| | | // wx.switchTab({ |
| | | // url: '/pages/index/index', |
| | | // }) |
| | | resolve(res.data) |
| | | res.data.message && wx.showToast({ |
| | | title: res.data.message || '发生错误', |
| | |
| | | return |
| | | } |
| | | if(res.data.code == 5111 || res.data.code == 5112 || res.data.code == 5110){ |
| | | resolve(res.data) |
| | | return |
| | | } |
| | | res.data.message && wx.showToast({ |
| | |
| | | onShow() { |
| | | let users = wx.getStorageSync('token') |
| | | if (users == null) { |
| | | wx.redirectTo({ |
| | | wx.reLaunch({ |
| | | url: '/pages/login/index', |
| | | }) |
| | | wx.showLoading({ |
| | |
| | | display: flex; |
| | | border-radius: 8rpx; |
| | | } |
| | | button.button-hover { |
| | | box-shadow: none; |
| | | } |
| | | .container { |
| | | min-height: 100vh; |
| | | padding: 0; |
| | |
| | | <!-- --> |
| | | <view wx:if="{{ showShare }}" class="shade_modal" style="padding-bottom: {{bottomLift}}px;"> |
| | | <view class="btns"> |
| | | <button class="item" bindtap="handleShare"> |
| | | <button hover-class="none" class="item" bindtap="handleShare"> |
| | | <image src="../../static/icon/wechat.png"></image> |
| | | <view>小程序分享</view> |
| | | </button> |
| | | <button class="item" bindtap="handleDown"> |
| | | <button hover-class="none" class="item" bindtap="handleDown"> |
| | | <image src="../../static/icon/download.png"></image> |
| | | <view>下载海报</view> |
| | | </button> |
| | |
| | | }, |
| | | touchmove(e) { |
| | | var touchMove = e.detail.scrollTop; |
| | | if(touchMove - touchDot > 16){ |
| | | if(touchMove - touchDot > 24){ |
| | | touchDot = touchMove |
| | | this.fadeOut(); |
| | | } |
| | | if(touchDot - touchMove > 20){ |
| | | if(touchDot - touchMove > 24){ |
| | | touchDot = touchMove |
| | | setTimeout(() => { |
| | | this.setData({ showTouch: true }) |
| | | this.fadeIn(); |
| | | }) |
| | | }, 200) |
| | | } |
| | | }, |
| | | fadeIn: function () { |
| | |
| | | padding: 0 10rpx; |
| | | } |
| | | .name{ |
| | | font-size: 30rpx; |
| | | margin: 12rpx 0 8rpx; |
| | | white-space: nowrap; |
| | | overflow: hidden; |
| | |
| | | padding: 0 10rpx; |
| | | } |
| | | .main_content .goods_list .item .name { |
| | | font-size: 30rpx; |
| | | margin: 12rpx 0 8rpx; |
| | | white-space: nowrap; |
| | | overflow: hidden; |
| | |
| | | }, |
| | | touchmove(e) { |
| | | var touchMove = e.detail.scrollTop; |
| | | if(touchMove - touchDot > 16){ |
| | | if(touchMove - touchDot > 24){ |
| | | touchDot = touchMove |
| | | this.fadeOut(); |
| | | } |
| | | if(touchDot - touchMove > 20){ |
| | | if(touchDot - touchMove > 24){ |
| | | touchDot = touchMove |
| | | setTimeout(() => { |
| | | this.setData({ showTouch: true }) |
| | | this.fadeIn(); |
| | | }) |
| | | }, 200) |
| | | } |
| | | }, |
| | | fadeIn: function () { |
| | |
| | | |
| | | .main_content { |
| | | display: flex; |
| | | height: 100%; |
| | | height: calc( 100% - 120rpx ); |
| | | .main_left { |
| | | width: 160rpx; |
| | | height: 100%; |
| | | border-radius: 0rpx 16rpx 16rpx 0rpx; |
| | | |
| | | .item { |
| | | width: 160rpx; |
| | | height: 100rpx; |
| | |
| | | } |
| | | |
| | | .goods_list { |
| | | height: calc( 100% - 222rpx); |
| | | height: 100%; |
| | | width: 590rpx; |
| | | box-sizing: border-box; |
| | | padding: 12rpx 40rpx; |
| | |
| | | } |
| | | .main_content { |
| | | display: flex; |
| | | height: 100%; |
| | | height: calc(100% - 120rpx); |
| | | } |
| | | .main_content .main_left { |
| | | width: 160rpx; |
| | |
| | | background-color: #333333; |
| | | } |
| | | .main_content .main_right .goods_list { |
| | | height: calc(100% - 222rpx); |
| | | height: 100%; |
| | | width: 590rpx; |
| | | box-sizing: border-box; |
| | | padding: 12rpx 40rpx; |
| | |
| | | menuButtonInfo: Object |
| | | }, |
| | | data: { |
| | | acVid: '', |
| | | viewIdList: [], |
| | | // 动画 |
| | | showTouch: true, |
| | | animationData: {}, |
| | |
| | | }, |
| | | touchmove(e) { |
| | | var touchMove = e.detail.scrollTop; |
| | | if(touchMove - touchDot > 16){ |
| | | if(touchMove - touchDot > 24){ |
| | | touchDot = touchMove |
| | | this.fadeOut(); |
| | | } |
| | | if(touchDot - touchMove > 16){ |
| | | if(touchDot - touchMove > 24){ |
| | | touchDot = touchMove |
| | | setTimeout(() => { |
| | | this.setData({ showTouch: true }) |
| | | this.fadeIn(); |
| | | }) |
| | | }, 200) |
| | | } |
| | | }, |
| | | fadeIn: function () { |
| | |
| | | handleDetail(e) { |
| | | const item = e.currentTarget.dataset.item |
| | | console.log('item', item); |
| | | if(item.openType == 'video'){ |
| | | let videoPlay = this.selectComponent('.videoPlay'); |
| | | if(videoPlay){ |
| | | videoPlay.startPlayVideo(item.openContent,this ); |
| | | } |
| | | } |
| | | if(item.openType == 'link'){ |
| | | wx.navigateTo({ |
| | | url: '/pages/webView/index', |
| | |
| | | }) |
| | | } |
| | | }, |
| | | videoClick(e) { |
| | | const { id } = e.currentTarget.dataset |
| | | const { dataList, acVid, viewIdList } = this.data |
| | | const index = viewIdList.findIndex(i => i === 'video' + id) |
| | | console.log('acVid', acVid); |
| | | console.log('id', id); |
| | | if(acVid){ |
| | | if('video' + id != acVid){ |
| | | wx.createVideoContext(acVid, this).pause() |
| | | wx.createVideoContext('video' + id, this).play() |
| | | this.setData({ acVid: 'video' + id }) |
| | | } |
| | | }else{ |
| | | this.setData({ acVid: 'video' + id }) |
| | | wx.createVideoContext('video' + id, this).play() |
| | | } |
| | | dataList.forEach(ite => { |
| | | if(id === ite.id && index === -1){ |
| | | ite.viewCount += 1 |
| | | viewIdList.push('video' + id) |
| | | actionDo({ |
| | | actionType: 'view', |
| | | id: id |
| | | }) |
| | | this.setData({ viewIdList }) |
| | | } |
| | | }) |
| | | this.setData({ dataList }) |
| | | }, |
| | | tagClick(e) { |
| | | if(this.data.isLoading){ |
| | | return |
| | |
| | | { |
| | | "component": true, |
| | | "usingComponents": { |
| | | "videoPlay": "/components/videoPlay/index" |
| | | } |
| | | "component": true |
| | | } |
| | |
| | | height: 100rpx; |
| | | } |
| | | .item { |
| | | width: 324rpx; |
| | | margin-bottom: 32rpx; |
| | | float: left; |
| | | &:nth-of-type(2n){ |
| | | margin-right: 22rpx; |
| | | } |
| | | width: 100%; |
| | | margin-bottom: 32rpx; |
| | | margin-right: 0; |
| | | .img_wrap { |
| | | width: 100%; |
| | | height: 182rpx; |
| | | height: 376rpx; |
| | | border-radius: 8rpx; |
| | | overflow: hidden; |
| | | position: relative; |
| | |
| | | } |
| | | |
| | | .name { |
| | | font-size: 30rpx; |
| | | margin: 12rpx 0 8rpx; |
| | | white-space: nowrap; |
| | | overflow: hidden; |
| | |
| | | <!-- goods_list --> |
| | | <scroll-view bindscrolltoupper="bindscrolltoupper" binddragging="touchmove" binddragstart="touchstart" bindscrolltolower="scrolltolower" scroll-y enhanced class="goods_list"> |
| | | <view class="empty"></view> |
| | | <view wx:for="{{ dataList }}" data-index="index" data-item="{{item}}" class="item {{(index%2 == 0 && index == dataList.length-1)?'lastitem':''}}" bindtap="handleDetail"> |
| | | <view class="img_wrap"> |
| | | <view wx:for="{{ dataList }}" class="item {{(index%2 == 0 && index == dataList.length-1)?'lastitem':''}}"> |
| | | <view data-item="{{item}}" bindtap="handleDetail" wx:if="{{ item.openType != 'video' }}" class="img_wrap"> |
| | | <image src="{{ item.coverImage }}" class="img"></image> |
| | | <view wx:if="{{ item.openType == 'link' }}" data-item="{{item}}" bindtap="priviewFull" class="full"> |
| | | <text>VR</text> |
| | | </view> |
| | | <image wx:if="{{ item.openType == 'video' }}" bindtap="videoClick" data-videourl="{{ item.openContent }}" class="play" src="../../static/icon/ic_play.png" mode="widthFix"></image> |
| | | <image wx:if="{{ false }}" class="new" src="../../static/icon/chanpin_ic_new@2x.png" mode="widthFix"></image> |
| | | </view> |
| | | <video id="video{{item.id}}" class="img_wrap" wx:if="{{ item.openType == 'video' }}" src="{{item.openContent}}" poster="{{ item.coverImage }}" data-id="{{ item.id }}" bindplay="videoClick"></video> |
| | | <view class="content"> |
| | | <view class="name">{{ item.title }}</view> |
| | | </view> |
| | |
| | | </scroll-view> |
| | | </view> |
| | | </view> |
| | | |
| | | <videoPlay class="videoPlay"/> |
| | | </view> |
| | | <wxs module="format" src="../../utils/format.wxs"></wxs> |
| | |
| | | height: 100rpx; |
| | | } |
| | | .main_content .goods_list .item { |
| | | width: 324rpx; |
| | | width: 100%; |
| | | margin-bottom: 32rpx; |
| | | float: left; |
| | | } |
| | | .main_content .goods_list .item:nth-of-type(2n) { |
| | | margin-right: 22rpx; |
| | | margin-right: 0; |
| | | } |
| | | .main_content .goods_list .item .img_wrap { |
| | | width: 100%; |
| | | height: 182rpx; |
| | | height: 376rpx; |
| | | border-radius: 8rpx; |
| | | overflow: hidden; |
| | | position: relative; |
| | |
| | | padding: 0 10rpx; |
| | | } |
| | | .main_content .goods_list .item .name { |
| | | font-size: 30rpx; |
| | | margin: 12rpx 0 8rpx; |
| | | white-space: nowrap; |
| | | overflow: hidden; |
| | |
| | | { |
| | | "usingComponents": {} |
| | | "usingComponents": {}, |
| | | "navigationStyle": "custom" |
| | | } |
| | |
| | | <!--pages/client/index.wxml--> |
| | | <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> |
| | | <button hover-class="none" wx:else style="margin-top: 50%;width: 200rpx;font-size: 14px;" bind:tap="loadData">重新加载</button> |
| | |
| | | }, |
| | | touchmove(e) { |
| | | var touchMove = e.detail.scrollTop; |
| | | if(touchMove - touchDot > 16){ |
| | | if(touchMove - touchDot > 24){ |
| | | touchDot = touchMove |
| | | this.fadeOut(); |
| | | } |
| | | if(touchDot - touchMove > 20){ |
| | | if(touchDot - touchMove > 24){ |
| | | setTimeout(() => { |
| | | this.setData({ showCate: true }) |
| | | this.fadeIn(); |
| | |
| | | <van-popup position="bottom" show="{{ showShare }}" bind:close="onClose"> |
| | | <view class="share_modal"> |
| | | <view class="btns"> |
| | | <button open-type="share" class="item" bindtap="handleShare"> |
| | | <button hover-class="none" open-type="share" class="item" bindtap="handleShare"> |
| | | <image src="../../static/icon/wechat.png"></image> |
| | | <view>发送好友</view> |
| | | </button> |
| | | <button class="item"> |
| | | <button hover-class="none" class="item"> |
| | | <image src="../../static/icon/download.png"></image> |
| | | <view>下载海报</view> |
| | | </button> |
| | |
| | | <!-- footer --> |
| | | <view class="footer" style="padding-bottom: {{bottomLift}}px;"> |
| | | <view class="btns"> |
| | | <button class="item btn"> |
| | | <button hover-class="none" class="item btn"> |
| | | <image data-code="collect_cancel" bindtap="handleAction" wx:if="{{ info.isCollection }}" 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"> |
| | | <button hover-class="none" open-type="share" class="item btn" bindtap="handleShare"> |
| | | <image class="icon" src="../../static/icon/detail_nav_share.png" mode="widthFix"></image> |
| | | <view class="name">分享</view> |
| | | </button> |
| | |
| | | <!-- footer --> |
| | | <view class="footer" style="padding-bottom: {{bottomLift}}px;"> |
| | | <view class="btns"> |
| | | <button class="item btn"> |
| | | <button class="item btn"> |
| | | <image data-code="collect_cancel" bindtap="handleAction" wx:if="{{ info.isCollection }}" 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> |
| | |
| | | <!-- --> |
| | | <view wx:if="{{ showShare }}" class="shade_modal" style="padding-bottom: {{bottomLift}}px;"> |
| | | <view class="btns"> |
| | | <button class="item" bindtap="handleShare"> |
| | | <button hover-class="none" class="item" bindtap="handleShare"> |
| | | <image src="../../static/icon/wechat.png"></image> |
| | | <view>小程序分享</view> |
| | | </button> |
| | | <button class="item" bindtap="handleDown"> |
| | | <button hover-class="none" class="item" bindtap="handleDown"> |
| | | <image src="../../static/icon/download.png"></image> |
| | | <view>下载海报</view> |
| | | </button> |
| | |
| | | <image class="icon" src="../../static/icon/detail_nav_share.png" mode="widthFix"></image> |
| | | <view class="name">分享</view> |
| | | </button> --> |
| | | <button class="item btn" bindtap="handleShare"> |
| | | <button hover-class="none" class="item btn" bindtap="handleShare"> |
| | | <image class="icon" src="../../static/icon/detail_nav_share.png" mode="widthFix"></image> |
| | | <view class="name">分享</view> |
| | | </button> |
| | | <view class="sub_btn" > |
| | | <image class="icon" src="../../static/icon/home_ic_kefu.png" mode="widthFix"></image> |
| | | <button class="sub_btn1" open-type="contact" bindcontact="handleContact">立即咨询客服</button> |
| | | <button hover-class="none" class="sub_btn1" open-type="contact" bindcontact="handleContact">立即咨询客服</button> |
| | | <!-- <view>立即咨询客服</view> --> |
| | | </view> |
| | | </view> |
| | |
| | | } |
| | | }) |
| | | } else { |
| | | wx.redirectTo({ |
| | | wx.reLaunch({ |
| | | url: '/pages/login/index', |
| | | }) |
| | | wx.hideLoading() |
| | |
| | | <!-- --> |
| | | <view class="btns"> |
| | | <block wx:if="{{ status == '0' }}"> |
| | | <button class="btn speedy" wx:if="{{ !agreementFalg }}" bindtap="loginIn">手机号快捷登录</button> |
| | | <button hover-class="none" class="btn speedy" wx:if="{{ !agreementFalg }}" bindtap="loginIn">手机号快捷登录</button> |
| | | <button wx:else class="btn speedy" open-type="getPhoneNumber" bindgetphonenumber="getPhoneNumber">手机号快捷登录</button> |
| | | <view bindtap="changeStatus" class="btn">手机验证码登录</view> |
| | | </block> |
| | | <block wx:if="{{ status == '1' }}"> |
| | | <view class="line"> |
| | | <image class="icon" src="../../static/login_ic_phone@2x.png" mode="widthFix"></image> |
| | | <van-field class="input" maxlength="{{ 11 }}" border="{{false}}" model:value="{{ phone }}" placeholder="请输入手机号" /> |
| | | <van-field class="input" type="number" maxlength="{{ 11 }}" border="{{false}}" model:value="{{ phone }}" placeholder="请输入手机号" /> |
| | | <view bindtap="getCode" wx:if="{{ countDown === 0 }}" class="get_code primary">获取验证码</view> |
| | | <view wx:else class="placeholder9">{{ countDown }}s</view> |
| | | </view> |
| | | <view class="line"> |
| | | <image class="icon" src="../../static/login_ic_password@2x.png" mode="widthFix"></image> |
| | | <van-field class="input" maxlength="{{ 6 }}" border="{{false}}" model:value="{{ code }}" placeholder="请输入验证码" /> |
| | | <van-field type="number" class="input" maxlength="{{ 6 }}" border="{{false}}" model:value="{{ code }}" placeholder="请输入验证码" /> |
| | | </view> |
| | | <view bindtap="loginPhone" class="btn speedy sub_btn">立即登录</view> |
| | | </block> |
| | |
| | | wx.clearStorageSync() |
| | | setTimeout(() => { |
| | | wx.setStorageSync('sessionKey', sessionKey) |
| | | wx.redirectTo({ |
| | | wx.reLaunch({ |
| | | url: '/pages/login/index', |
| | | }) |
| | | }, 300) |
| | |
| | | </view> --> |
| | | |
| | | <view class="outbut" > |
| | | <button bindtap="showLogout" class="btn">退出登录</button> |
| | | <button hover-class="none" bindtap="showLogout" class="btn">退出登录</button> |
| | | </view> |
| | | </view> |
| | | |
| | |
| | | */ |
| | | onShow() { |
| | | this.setData({ |
| | | pageNum: 1 |
| | | pageNum: 1, |
| | | dataList: [] |
| | | }) |
| | | this.getList() |
| | | }, |
| | |
| | | flex: 1; |
| | | color: #111111; |
| | | text-align: right; |
| | | display: -webkit-box; |
| | | overflow: hidden; |
| | | -webkit-line-clamp: 2; |
| | | -webkit-box-orient: vertical; |
| | | text-overflow: ellipsis; |
| | | .van-cell{ |
| | | padding: 0; |
| | | } |
| | |
| | | <view class="container"> |
| | | <image class="avatar" src="{{ userInfo.imgurlFull ? userInfo.imgurlFull : '../../static/images/default_avatar.png' }}"></image> |
| | | <!-- <button open-type="chooseAvatar" bindchooseavatar="getBindchooseavatar" class="avatar_btn">更换头像</button> --> |
| | | <button bind:tap="selMedia3" class="avatar_btn">更换头像</button> |
| | | <button hover-class="none" bind:tap="selMedia3" class="avatar_btn">更换头像</button> |
| | | <view class="list"> |
| | | <view class="line"> |
| | | <view class="label">姓名</view> |
| | |
| | | flex: 1; |
| | | color: #111111; |
| | | text-align: right; |
| | | white-space: break-spaces; |
| | | word-break: break-word; |
| | | display: -webkit-box; |
| | | overflow: hidden; |
| | | -webkit-line-clamp: 2; |
| | | -webkit-box-orient: vertical; |
| | | text-overflow: ellipsis; |
| | | } |
| | | .list .line .input .van-cell { |
| | | padding: 0; |
| | |
| | | border-radius: 8rpx; |
| | | font-weight: 500; |
| | | font-size: 32rpx; |
| | | margin-top: 20rpx; |
| | | margin-top: 20rpx; |
| | | margin-bottom: 10rpx; |
| | | } |
| | |
| | | ] |
| | | } |
| | | }, |
| | | "libVersion": "3.5.1" |
| | | "libVersion": "3.4.10" |
| | | } |
| | |
| | | if (res.data.code && (res.data.code == 5112 || res.data.code == 5111)) { |
| | | if(options.data && options.data.goLogin){ |
| | | console.log("==================") |
| | | wx.redirectTo({ |
| | | wx.reLaunch({ |
| | | url: '/pages/login/index', |
| | | }) |
| | | } |