From 2d6c7e554388bc2fff9013ddf7a5a41c9cb6458a Mon Sep 17 00:00:00 2001 From: huliyong <2783385703@qq.com> Date: Mon, 24 Feb 2025 21:04:03 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=8A=E4=BC=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 187 ++++--- api/model/index.js | 7 + components/base/navbar.vue | 2 +- components/sn-swiper/esc-swiper-item/index.vue | 251 ---------- components/sn-swiper/esc-swiper/helper.js | 21 - components/sn-swiper/esc-swiper/index.vue | 198 -------- .../sn-swiper/esc-swiper/mixins/base.mixin.js | 303 ------------ components/sn-swiper/esc-swiper/mixins/bindingx.js | 91 ---- components/sn-swiper/esc-swiper/mixins/index.wxs | 143 ------ components/sn-swiper/esc-swiper/mixins/mpother.js | 62 --- components/sn-swiper/esc-swiper/mixins/mpwxs.js | 7 - components/utils/style.js | 15 - pages.json | 3 - pages_order/components/address/addressList.vue | 2 + .../components/address/redactAddressForm.vue | 227 +++++++++ pages_order/mine/memberCenter.vue | 3 - pages_order/order/giftList.vue | 7 +- pages_order/order/instantGift.vue | 4 +- pages_order/order/receiveGift.vue | 546 +++++++++++++++++++-- pages_order/product/productDetail.vue | 3 +- 20 files changed, 837 insertions(+), 1245 deletions(-) delete mode 100644 components/sn-swiper/esc-swiper-item/index.vue delete mode 100644 components/sn-swiper/esc-swiper/helper.js delete mode 100644 components/sn-swiper/esc-swiper/index.vue delete mode 100644 components/sn-swiper/esc-swiper/mixins/base.mixin.js delete mode 100644 components/sn-swiper/esc-swiper/mixins/bindingx.js delete mode 100644 components/sn-swiper/esc-swiper/mixins/index.wxs delete mode 100644 components/sn-swiper/esc-swiper/mixins/mpother.js delete mode 100644 components/sn-swiper/esc-swiper/mixins/mpwxs.js delete mode 100644 components/utils/style.js create mode 100644 pages_order/components/address/redactAddressForm.vue diff --git a/README.md b/README.md index fb07a08..bd48d6c 100644 --- a/README.md +++ b/README.md @@ -63,6 +63,55 @@ - 模块化组织:按功能模块划分目录,便于维护和管理 - 组件复用:分包内的通用组件集中管理,提高代码复用性 +## 配置文件说明 + +### config.js +项目核心配置文件,包含以下配置: + +**1. 环境配置** +```javascript +// 当前环境 +const type = 'prod' + +// 环境配置 +const config = { + dev: { + baseUrl: 'http://h5.xzaiyp.top/jewelry-admin', + }, + prod: { + baseUrl: 'https://jewelry-admin.hhlm1688.com/jewelry-admin', + } +} +``` + +**2. 默认配置** +```javascript +const defaultConfig = { + // 腾讯地图Key + mapKey: 'XMBBZ-BCPCV-SXPPQ-5Y7MY-PHZXK-YFFVU', + // 阿里云OSS配置 + aliOss: { + url: 'https://image.hhlm1688.com/', + config: { + region: 'oss-cn-guangzhou', + accessKeyId: '***', + accessKeySecret: '***', + bucket: 'hanhaiimage', + endpoint: 'oss-cn-shenzhen.aliyuncs.com', + } + } +} +``` + +**3. UI框架配置** +```javascript +uni.$uv.setConfig({ + config: { + unit: 'rpx' // 设置默认单位 + }, +}) +``` + ## 核心模块详解 ### 1. Mixins 混入 @@ -187,25 +236,49 @@ this.$api('product.create', { - position.js: 定位与位置计算 - oss-upload: 阿里云OSS上传模块 -#### 3.2 OSS上传模块 + +**使用示例:** +```javascript + +// 授权处理 +async preservationImg(img) { + await this.$authorize('scope.writePhotosAlbum') + //在执行$authorize之后,await下面的代码都是确保授权完成的情况下执行 +}, + +// 时间格式化 +const formattedTime = this.$timeUtils.formatTime(new Date()) + +// 微信网页支付调用 +import { wxPay } from '@/utils/pay' +wxPay(orderData) +``` + +#### 3.2 公共组件 +- navbar.vue: 自定义导航栏 +- tabbar.vue: 底部导航栏 +- productItem.vue: 商品列表项 + +**使用示例:** +```html + +``` + + +#### 3.3 OSS上传模块 **配置说明:** 项目使用阿里云OSS进行文件存储,相关配置位于config.js中: -```javascript -const defaultConfig = { - aliOss: { - url: 'https://image.hhlm1688.com/', - config: { - region: 'oss-cn-guangzhou', - accessKeyId: '***', - accessKeySecret: '***', - bucket: 'hanhaiimage', - endpoint: 'oss-cn-shenzhen.aliyuncs.com', - } - } -} -``` **使用示例:** @@ -309,42 +382,6 @@ export default { 3. 支持的文件类型:图片、视频、文档等 4. 上传失败时会抛出异常,请做好错误处理 -**使用示例:** -```javascript - -// 授权处理 -async preservationImg(img) { - await this.$authorize('scope.writePhotosAlbum') - //在执行$authorize之后,await下面的代码都是确保授权完成的情况下执行 -}, - -// 时间格式化 -const formattedTime = this.$timeUtils.formatTime(new Date()) - -// 微信网页支付调用 -import { wxPay } from '@/utils/pay' -wxPay(orderData) -``` - -#### 3.2 公共组件 -- navbar.vue: 自定义导航栏 -- tabbar.vue: 底部导航栏 -- productItem.vue: 商品列表项 - -**使用示例:** -```html - -``` - ## 最佳实践 ### 1. 列表页面开发 @@ -412,51 +449,3 @@ export default { - 确认网络请求是否正常 - 查看请求参数格式是否正确 -## 配置文件说明 - -### config.js -项目核心配置文件,包含以下配置: - -**1. 环境配置** -```javascript -// 当前环境 -const type = 'prod' - -// 环境配置 -const config = { - dev: { - baseUrl: 'http://h5.xzaiyp.top/jewelry-admin', - }, - prod: { - baseUrl: 'https://jewelry-admin.hhlm1688.com/jewelry-admin', - } -} -``` - -**2. 默认配置** -```javascript -const defaultConfig = { - // 腾讯地图Key - mapKey: 'XMBBZ-BCPCV-SXPPQ-5Y7MY-PHZXK-YFFVU', - // 阿里云OSS配置 - aliOss: { - url: 'https://image.hhlm1688.com/', - config: { - region: 'oss-cn-guangzhou', - accessKeyId: '***', - accessKeySecret: '***', - bucket: 'hanhaiimage', - endpoint: 'oss-cn-shenzhen.aliyuncs.com', - } - } -} -``` - -**3. UI框架配置** -```javascript -uni.$uv.setConfig({ - config: { - unit: 'rpx' // 设置默认单位 - }, -}) -``` \ No newline at end of file diff --git a/api/model/index.js b/api/model/index.js index c666109..59d09cd 100644 --- a/api/model/index.js +++ b/api/model/index.js @@ -190,6 +190,13 @@ const api = { auth : true, limit : 1000, }, + // 2.点击抽奖 =》抽奖 + getGiveShopLottery: { + url: '/index_common/getGiveShopLottery', + method: 'GET', + auth : true, + limit : 1000, + }, } export default api \ No newline at end of file diff --git a/components/base/navbar.vue b/components/base/navbar.vue index 49636c4..34d6fee 100644 --- a/components/base/navbar.vue +++ b/components/base/navbar.vue @@ -116,7 +116,7 @@ justify-content: center; font-size: 32rpx; align-items: center; - z-index: 99999; + z-index: 999; .left{ position: absolute; left: 40rpx; diff --git a/components/sn-swiper/esc-swiper-item/index.vue b/components/sn-swiper/esc-swiper-item/index.vue deleted file mode 100644 index 74640a2..0000000 --- a/components/sn-swiper/esc-swiper-item/index.vue +++ /dev/null @@ -1,251 +0,0 @@ - - - - - diff --git a/components/sn-swiper/esc-swiper/helper.js b/components/sn-swiper/esc-swiper/helper.js deleted file mode 100644 index 30936d3..0000000 --- a/components/sn-swiper/esc-swiper/helper.js +++ /dev/null @@ -1,21 +0,0 @@ -/** - * getSwiperList - * @description 获取Swiper数据 - * @param {Array} list 原数据 - * @param {Object} options 配置 - * @param {Boolean} options.circular 是否循环 - * @param {Number} options.plus 左右追加个数(开启循环必填,至少为2) - * @return {Array} - */ -export function getSwiperList(list, options = { - circular: true, - plus: 2 -}) { - if (!options.circular) { - return list - } - const plus = options.plus || 2 - const leftPlusList = [...list].reverse().slice(0, plus).reverse(); - const rightPlusList = [...list].slice(0, plus); - return [].concat(leftPlusList).concat(list).concat(rightPlusList); -} diff --git a/components/sn-swiper/esc-swiper/index.vue b/components/sn-swiper/esc-swiper/index.vue deleted file mode 100644 index cede710..0000000 --- a/components/sn-swiper/esc-swiper/index.vue +++ /dev/null @@ -1,198 +0,0 @@ - - - - - diff --git a/components/sn-swiper/esc-swiper/mixins/base.mixin.js b/components/sn-swiper/esc-swiper/mixins/base.mixin.js deleted file mode 100644 index 5c4299e..0000000 --- a/components/sn-swiper/esc-swiper/mixins/base.mixin.js +++ /dev/null @@ -1,303 +0,0 @@ -import { - getStyleStr -} from '../../../utils/style.js'; -// #ifdef APP-NVUE -const animation = uni.requireNativePlugin('animation') -// #endif -export default { - data() { - return { - timingFunction: 'cubic-bezier(0.25, 0.46, 0.45, 0.94)', - isAnimated: false, - isScrolling: false, - customDuration: 0, - left: 0, - mCurrent: this.current - }; - }, - created() {}, - mounted() { - // #ifdef MP - this.swiperViews = this.$children - // #endif - // #ifdef APP-PLUS || H5 - this.swiperViews = this.$slots.default.map(it => it.child) - // #endif - this._setLeft(); - this.mCurrent = this.current - this._notifyCurrentForItems(this.current, this.position) - }, - watch: { - mCurrent() { - let current = this.mCurrent - if (this.circular) { - if (this.position == 1) { - current = this.actualSize - (this.plus - 1) - // console.log('最前了', current) - } else if (this.position == this._size - 2) { - current = this.plus - 2; - // console.log('最后了', current) - } - if (current < 0) { - current = this.position + 1 - } - current %= this.actualSize - } - // console.log('position', this.position, current) - this.$emit('update:current', current) - this.$emit('change', current) - this._notifyCurrentForItems(current, this.position) - } - }, - computed: { - is3D() { - return this.mode == '3d' - }, - position() { - return this.circular ? (this.mCurrent + this.plus) : this.mCurrent - }, - manualDuration() { - if (this.customDuration > 0) - return this.customDuration - return this.isAnimated ? this.duration : 0 - }, - boxStyle() { - return getStyleStr({ - width: this.width + 'rpx', - height: this.height + 'rpx' - }); - }, - containerStyle() { - const style = { - height: this.height + 'rpx' - }; - // #ifdef APP-NVUE - // FIXME: 理论isAnimated=false应该不设置transform,但是ios有个奇怪的问题,top不为0导致布局错位 - const isIOS = uni.getSystemInfoSync().platform == 'ios' - if (isIOS) { - style.transform = 'translate(' + uni.upx2px(this.left) + 'px' + ',0px)' - } else { - if (this.isAnimated == false) { - style.transform = 'translate(' + uni.upx2px(this.left) + 'px' + ',0px)' - } - } - // #endif - // #ifndef APP-NVUE - style.left = this.left + 'rpx' - style.transition = 'left ' + this.manualDuration + 'ms ' + this.timingFunction - // #endif - return getStyleStr(style); - }, - _size() { - return (this.$slots && this.$slots.default && this.$slots.default.length) || this.size; - }, - // plus * 2 - plusSize() { - return this.circular ? this.plus * 2 : 0; - }, - // 真实长度 - actualSize() { - return this._size - this.plusSize; - } - }, - methods: { - prev() { - if (this.isAnimated) return; - if (this.isScrolling) return; - if (this.mCurrent == 0 && this.circular == false) return - this.mCurrent--; - this._run() - }, - next() { - if (this.isAnimated) return; - if (this.isScrolling) return; - if (this.circular == true) { - this.mCurrent++; - if (this.mCurrent == this._size) { - this.mCurrent = 0; - } - } else { - if (this.mCurrent == this._size - 1) return - this.mCurrent++; - } - this._run() - }, - moveTo(e) { - if (this.isAnimated) return - const { - deltaX, - left - } = e - this.isScrolling = true - if (!this.circular) { - if ( - // 第一项,不能向右滑(上一项) - (deltaX > 0 && this.mCurrent == 0) || - // 最后一项,不能向左滑(下一项) - (deltaX < 0 && this.mCurrent == this._size - 1) - ) { - if (!this.bounce) return - // 添加阻尼滑动 - const _left = this._left || this.wxsData.left - this.left = _left + (deltaX * (1 - Math.abs(deltaX) * 3 / (this.width * 5))) - this._set3DScale(deltaX) - return - } - } - this.left = left - this._set3DScale(deltaX) - }, - moveEnd(e) { - const { - velocity, - deltaX, - deltaY - } = e - this.isScrolling = false - - if (!this.circular) { - // 第一项,不能向右滑(上一项) - if (deltaX > 0 && this.mCurrent == 0) { - this._restoreStartTouch() - return - } - // 最后一项,不能向左滑(下一项) - if (deltaX < 0 && this.mCurrent == this._size - 1) { - this._restoreStartTouch() - return - } - } - - const isTurnPage = Math.abs(deltaX) > this.itemWidth / 2 - if (isTurnPage || velocity > 0.2) { - if (deltaX < 0) { - this.customDuration = 350 - this.next() - } else if (deltaX > 0) { - this.customDuration = 350 - this.prev() - } - } else { - this._restoreStartTouch() - } - }, - _set3DScale(deltaX) { - if (this.is3D) { - const min = Math.min - const maxScale = Math.abs(this.scale - 1) - const mScale = deltaX * maxScale / this.width - const mRealScale = min(this.scale, this.scale - Math.abs(mScale)) - this.swiperViews[this.position].mScale = mRealScale < 1 ? 1 : mRealScale - if (this.position - 1 > -1) { - this.swiperViews[this.position - 1].mScale = mScale > 0 ? min(this.scale, 1 + mScale) : min(1, 1 + mScale) - } - if (this.position + 1 < this._size) { - this.swiperViews[this.position + 1].mScale = mScale > 0 ? min(1, 1 - mScale) : min(this.scale, 1 - mScale) - } - } - }, - _restoreStartTouch() { - const self = this - this.customDuration = 300 - // #ifdef APP-VUE || MP-WEIXIN || H5 - this.left = this.wxsData.left - // #endif - // #ifndef APP-PLUS || MP-WEIXIN || H5 - this.left = this._left - // #endif - this._run(false) - if (this.is3D) { - this.swiperViews[this.position].restoreScale(this.manualDuration) - if (this.position - 1 > -1) { - this.swiperViews[this.position - 1].restoreScale(this.manualDuration) - } - if (this.position + 1 < this._size) { - this.swiperViews[this.position + 1].restoreScale(this.manualDuration) - } - } - }, - _notifyCurrentForItems(current, position) { - this.swiperViews && this.swiperViews.forEach(it => { - it.current = current - it.position = position - }) - }, - _run(isSet = true) { - this.isAnimated = true; - if (isSet) - this._setLeft(); - const self = this; - if (this.is3D) { - this.swiperViews[this.position].restoreToScale(this.scale, this.manualDuration) - if (this.position - 1 > -1) { - this.swiperViews[this.position - 1].restoreToScale(1, this.manualDuration) - } - if (this.position + 1 < this._size) { - this.swiperViews[this.position + 1].restoreToScale(1, this.manualDuration) - } - } - // #ifdef APP-NVUE - animation.transition(this.$refs.container, { - styles: { - transform: 'translate(' + uni.upx2px(this.left) + 'px' + ',0px)', - }, - duration: this.manualDuration, //ms - timingFunction: this.timingFunction, - needLayout: false, - delay: 0 //ms - }, function() { - self._reset(); - }) - // #endif - // #ifndef APP-NVUE - setTimeout(() => { - this._reset(); - }, this.manualDuration); - // #endif - }, - _setLeft() { - if (this.circular == true) { - const s1 = (this.width - this.itemWidth - this.space * 2) / 2; - let left = (this.plus + this.mCurrent) * (this.space + this.itemWidth) - s1; - this.left = -left; - } else { - this.left = -(this.itemWidth + this.space) * this.mCurrent - } - // #ifdef APP-VUE || MP-WEIXIN || H5 - this.wxsData = { - left: this.left, - bounce: this.bounce - } - // #endif - }, - _reset() { - this.isScrolling = false - this.isAnimated = false - this.customDuration = 0 - if (this.circular == true) { - if (this.position == 1) { - this.mCurrent = this.actualSize - (this.plus - 1); - this._setLeft(); - this._restoreScale() - } - // -2:原数组索引-1 + plus数组索引-1 - if (this.position == this._size - 2) { - this.mCurrent = this.plus - 2; - this._setLeft(); - this._restoreScale() - } - } - }, - _restoreScale() { - if (this.is3D) { - this.swiperViews[this.position].restoreToScale(this.scale, 0) - if (this.position - 1 > -1) { - this.swiperViews[this.position - 1].restoreToScale(1, 0) - } - if (this.position + 1 < this._size) { - this.swiperViews[this.position + 1].restoreToScale(1, 0) - } - } - } - } -} diff --git a/components/sn-swiper/esc-swiper/mixins/bindingx.js b/components/sn-swiper/esc-swiper/mixins/bindingx.js deleted file mode 100644 index 928147f..0000000 --- a/components/sn-swiper/esc-swiper/mixins/bindingx.js +++ /dev/null @@ -1,91 +0,0 @@ -const BindingX = uni.requireNativePlugin('bindingx'); -const animation = uni.requireNativePlugin('animation'); -export default { - mounted() { - this.container = this.getEl(this.$refs['container']) - }, - methods: { - _notifyTouchChangeForItems(isTouchEnd) { - this.swiperViews && this.swiperViews.forEach(it => { - it.canClick = isTouchEnd - }) - }, - touchstart(e) { - if (this.isAnimated) return; - if (this.stop) return - this.isScrolling = true - this._notifyTouchChangeForItems(false) - this.stop = true - this.startTime = new Date().getTime() - const props = [{ - element: this.container, - property: 'transform.translateX', - expression: uni.upx2px(this.left) + '+x' - }] - if (this.is3D) { - const deltaScale = `${this.scale}/${this.width}*x` - const currentScale = `${this.scale}-abs(x)/${this.width}*1` - const realScale = `min(${currentScale},${this.scale})` - const currentCardExp = `${realScale} < 1 ? 1 : ${realScale}`; - const leftCardExp = `${deltaScale} > 0 ? min(${this.scale},(1 + ${deltaScale})) : min(1,(1 + ${deltaScale}))`; - const rightCardExp = `${deltaScale} > 0 ? min(1,(1 - ${deltaScale})) : min(${this.scale},(1 - ${deltaScale}))`; - props.push({ - element: this.getSwipteItemEl(this.position), - property: 'transform.scale', - expression: currentCardExp - }) - if (this.position - 1 > -1) { - props.push({ - element: this.getSwipteItemEl(this.position - 1), - property: 'transform.scale', - expression: leftCardExp - }) - } - if (this.position + 1 > this._size) { - props.push({ - element: this.getSwipteItemEl(this.position + 1), - property: 'transform.scale', - expression: rightCardExp - }) - } - } - this.eventpan = BindingX.bind({ - anchor: this.container, - eventType: 'pan', - props - }, (e) => { - if (e.state === 'end' || - e.state === 'exit') { - setTimeout(() => { - this._notifyTouchChangeForItems(true) - }, 10) - const timing = new Date().getTime() - this.startTime - const velocity = Math.abs(e.deltaX / timing) - this.stop = false - this.isScrolling = false - if (this.eventpan && this.eventpan.token) { - BindingX.unbind({ - token: this.eventpan.token, - eventType: 'pan' - }) - } - this.moveEnd({ - velocity, - deltaX: e.deltaX, - deltaY: e.deltaY - }) - } - }) - }, - getSwipteItemEl(idx) { - return this.swiperViews[idx].$el.ref - }, - /** - * 获取ref - * @param {Object} el - */ - getEl(el) { - return el.ref - } - } -} diff --git a/components/sn-swiper/esc-swiper/mixins/index.wxs b/components/sn-swiper/esc-swiper/mixins/index.wxs deleted file mode 100644 index dd6ad61..0000000 --- a/components/sn-swiper/esc-swiper/mixins/index.wxs +++ /dev/null @@ -1,143 +0,0 @@ -var MIN_DISTANCE = 10; - -function changeData(newValue, oldValue, ownerInstance, instance) { - var state = instance.getState(); - if (newValue.left != undefined) { - state.left = newValue.left - } - if (newValue.bounce != undefined) { - state.bounce = newValue.bounce - } - // console.log('changeData', JSON.stringify(newValue)) -} - -/** - * 开始触摸操作 - * @param {Object} e - * @param {Object} ins - */ -function touchstart(e, ins) { - var instance = e.instance; - // 计算滑动开始位置 - stopTouchStart(e, ins) -} - -/** - * 开始滑动操作 - * @param {Object} e - * @param {Object} ownerInstance - */ -function touchmove(e, ownerInstance) { - var instance = e.instance; - // 是否可以滑动页面 - stopTouchMove(e); - if (e.preventDefault) { - // 阻止页面滚动 - e.preventDefault() - } - // var state = instance.getState(); - // && state.bounce - move(instance, ownerInstance) - return false -} - -/** - * 结束触摸操作 - * @param {Object} e - * @param {Object} ownerInstance - */ -function touchend(e, ownerInstance) { - var instance = e.instance; - var state = instance.getState() - ownerInstance.callMethod('moveEnd', { - velocity: Math.abs(state.deltaX / state.timing), - direction: state.direction, - deltaX: state.deltaX, - deltaY: state.deltaY - }) -} - -/** - * 设置移动距离 - * @param {Object} instance - * @param {Object} ownerInstance - */ -function move(instance, ownerInstance) { - var state = instance.getState() - var value = state.deltaX || 0 - var state = instance.getState() - if (state.direction == 'horizontal') { - // instance.requestAnimationFrame(function() { - // instance.setStyle({ - // transform: 'translateX(' + value + 'px)', - // '-webkit-transform': 'translateX(' + value + 'px)' - // }) - // }) - ownerInstance.callMethod('moveTo', { - deltaX: value, - deltaY: state.deltaY || 0, - left: state.left + value - }) - } - -} - -/** - * 滑动中,是否禁止打开 - * @param {Object} event - */ -function stopTouchMove(event) { - var instance = event.instance; - var state = instance.getState(); - var touch = event.touches[0]; - state.timing = getDate().getTime() - state.startTime; - state.deltaX = touch.clientX - state.startX; - state.deltaY = touch.clientY - state.startY; - state.offsetX = Math.abs(state.deltaX); - state.offsetY = Math.abs(state.deltaY); - state.direction = state.direction || getDirection(state.offsetX, state.offsetY); -} - -/** - * 设置滑动开始位置 - * @param {Object} event - */ -function stopTouchStart(event) { - var instance = event.instance; - var state = instance.getState(); - resetTouchStatus(instance); - var touch = event.touches[0]; - state.startTime = getDate().getTime(); - state.startX = touch.clientX; - state.startY = touch.clientY; -} - -function getDirection(x, y) { - if (x > y && x > MIN_DISTANCE) { - return 'horizontal'; - } - if (y > x && y > MIN_DISTANCE) { - return 'vertical'; - } - return ''; -} - -/** - * 重置滑动状态 - * @param {Object} event - */ -function resetTouchStatus(instance) { - var state = instance.getState(); - state.direction = ''; - state.deltaX = 0; - state.deltaY = 0; - state.offsetX = 0; - state.offsetY = 0; -} - -module.exports = { - changeData: changeData, - touchstart: touchstart, - touchmove: touchmove, - touchend: touchend -} diff --git a/components/sn-swiper/esc-swiper/mixins/mpother.js b/components/sn-swiper/esc-swiper/mixins/mpother.js deleted file mode 100644 index eb16f83..0000000 --- a/components/sn-swiper/esc-swiper/mixins/mpother.js +++ /dev/null @@ -1,62 +0,0 @@ -const MIN_DISTANCE = 10; -export default { - methods: { - touchstart(e) { - this._left = this.left - this.stopTouchStart(e) - }, - touchmove(e) { - // 是否可以滑动页面 - this.stopTouchMove(e); - if (this.direction == 'horizontal') { - this.moveTo({ - deltaX: this.deltaX, - deltaY: this.deltaY || 0, - left: this._left + this.deltaX - }) - } - // FIXME: 冒泡 - return false - }, - touchend() { - this.moveEnd({ - velocity: Math.abs(this.deltaX / this.timing), - direction: this.direction, - deltaX: this.deltaX, - deltaY: this.deltaY, - }) - }, - stopTouchStart(event) { - this.resetTouchStatus(); - const touch = event.touches[0]; - this.startTime = new Date().getTime(); - this.startX = touch.clientX; - this.startY = touch.clientY; - }, - stopTouchMove(event) { - const touch = event.touches[0]; - this.timing = new Date().getTime() - this.startTime; - this.deltaX = touch.clientX - this.startX; - this.deltaY = touch.clientY - this.startY; - this.offsetX = Math.abs(this.deltaX); - this.offsetY = Math.abs(this.deltaY); - this.direction = this.direction || this.getDirection(this.offsetX, this.offsetY); - }, - getDirection(x, y) { - if (x > y && x > MIN_DISTANCE) { - return 'horizontal'; - } - if (y > x && y > MIN_DISTANCE) { - return 'vertical'; - } - return ''; - }, - resetTouchStatus() { - this.direction = ''; - this.deltaX = 0; - this.deltaY = 0; - this.offsetX = 0; - this.offsetY = 0; - } - } -} diff --git a/components/sn-swiper/esc-swiper/mixins/mpwxs.js b/components/sn-swiper/esc-swiper/mixins/mpwxs.js deleted file mode 100644 index d7a81a9..0000000 --- a/components/sn-swiper/esc-swiper/mixins/mpwxs.js +++ /dev/null @@ -1,7 +0,0 @@ -export default { - data() { - return { - wxsData: {} - } - } -} diff --git a/components/utils/style.js b/components/utils/style.js deleted file mode 100644 index 9fdd2dd..0000000 --- a/components/utils/style.js +++ /dev/null @@ -1,15 +0,0 @@ -const toLine = (name) => { - return name.replace(/([A-Z])/g, '-$1').toLowerCase(); -} -/** - * style对象转化为style字符串 - * @return {string} - */ -export const getStyleStr = (styleObject) => { - let transfrom = ''; - for (let i in styleObject) { - let line = toLine(i); - transfrom += line + ':' + styleObject[i] + ';'; - } - return transfrom -} diff --git a/pages.json b/pages.json index e101072..7250bd8 100644 --- a/pages.json +++ b/pages.json @@ -1,7 +1,4 @@ { - "easycom": { - "^esc-(.*)": "@/components/sn-swiper/esc-$1/index.vue" - }, "pages": [{ "path": "pages/index/index", "style": { diff --git a/pages_order/components/address/addressList.vue b/pages_order/components/address/addressList.vue index 95bbdcb..03461a7 100644 --- a/pages_order/components/address/addressList.vue +++ b/pages_order/components/address/addressList.vue @@ -123,6 +123,8 @@ overflow: hidden; margin-bottom: 20rpx; padding: 15rpx 15rpx 0rpx 15rpx; + width: 100%; + box-sizing: border-box; .address-item-top { border-bottom: 1px dashed #D3D1D1; diff --git a/pages_order/components/address/redactAddressForm.vue b/pages_order/components/address/redactAddressForm.vue new file mode 100644 index 0000000..18af7e2 --- /dev/null +++ b/pages_order/components/address/redactAddressForm.vue @@ -0,0 +1,227 @@ + + + + + \ No newline at end of file diff --git a/pages_order/mine/memberCenter.vue b/pages_order/mine/memberCenter.vue index cf685f1..90cc64f 100644 --- a/pages_order/mine/memberCenter.vue +++ b/pages_order/mine/memberCenter.vue @@ -134,9 +134,6 @@