diff --git a/.gitignore b/.gitignore index 7f32e4b..f93f19d 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ .vscode -node_modules \ No newline at end of file +/node_modules/* +unpackage \ No newline at end of file diff --git a/README.md b/README.md index 446974f..d7273e7 100644 --- a/README.md +++ b/README.md @@ -42,11 +42,11 @@ unescapeHTML(temp){} /** -* php时间戳转为格式化日期 -* @param { String } timestamp 必填 php 返回的时间戳 -* @param { String } spacer 可选 日期间隔符,默认 '-' -* @param { String } end 可选 年月日时分秒截止位置,默认 day,可传 second -* @return { String } 格式化日期 +* 上传文件(只能单文件上传) +* @param { String } url 服务器 url +* @param { String } filePath 要上传文件资源的路径 +* @param { String } type 上传文件验证类型 默认: img 可选: video +* @return { object } promise 对象 resolve 返回文件服务器地址 reject 返回错误信息 */ -timestampToDate({timestamp, spacer = '-', end = 'day'} = {}) {} +uploadFile({ url, filePath, type = 'img' } = {}) {} ``` \ No newline at end of file diff --git a/common/api/shop.js b/common/api/shop.js index e465a2f..6d025d9 100644 --- a/common/api/shop.js +++ b/common/api/shop.js @@ -103,6 +103,14 @@ export default { cart_id: cart_id, }); }, + // 选择地区计算运费 + getFreight({ freight_hash, city_id, area_id }) { + return vm.$u.post('Buy/change_addr', { + freight_hash: freight_hash, + city_id: city_id, + area_id: area_id, + }); + }, // 商品详情 getGoodsDetails({ id }) { return vm.$u.post('Goods/goodDetails', { @@ -114,6 +122,16 @@ export default { id: id, page:page }); + }, + getStoreImgVideoList({id}){ + return vm.$u.post('Store/getStoreImgVideoList', { + id: id + }); + }, + goodsInfo({id}){ + return vm.$u.post('goods/goodsInfo', { + goods_id: id + }); } } } diff --git a/common/api/user.js b/common/api/user.js index d6516b2..48b4f37 100644 --- a/common/api/user.js +++ b/common/api/user.js @@ -195,7 +195,7 @@ export default { }, // 修改绑定手机号 changeMemberPhone({ old_mobile, old_code, new_mobile, new_code }) { - return vm.$u.post('Member/changeMemberInfo', { + return vm.$u.post('Member/memberChangeMobile', { old_mobile: old_mobile, old_code: old_code, new_mobile: new_mobile, @@ -211,16 +211,57 @@ export default { return vm.$u.post('Setting/CertificateInfo'); }, // 用户浏览记录 - getBrowseList() { - return vm.$u.post('Member/BrowseList'); + getBrowseList({ page }) { + return vm.$u.post('Member/BrowseList', { + page: page, + }); + }, + // 意见反馈列表 + getFeedbackList({ page }) { + return vm.$u.post('Member/feedbackList', { + page: page, + }); + }, + // 意见反馈-写意见 + writeFeedback({ fb_content, fb_images }) { + return vm.$u.post('Member/writeFeedback', { + fb_content: fb_content, + fb_images: fb_images, + }); }, // 订单列表 - getOrderList({ page }) { - return vm.$u.post('Goods/orderList', { page }); + getOrderList({ page, type }) { + let params = { page: page }; + if(type >= 0) Object.assign(params, {state_type: type}) + return vm.$u.post('Goods/orderList', params); }, // 订单详情 getOrderInfo({ order_id }) { - return vm.$u.post('Goods/orderInfo', { order_id }); + return vm.$u.post('Goods/orderInfo', { order_id: order_id }); + }, + // 查询订单的评价信息 + getOrderEvaluateInfo({ id }) { + return vm.$u.post('Order/getOrderEvaluateInfo', { id: id }); + }, + // 订单评价/修改评价 + updateOrderEvaluate({ id, content, scores_one, scores_two, scores_three, file }) { + return vm.$u.post('Order/orderEvaluate', { + id: id, + content: content, + scores_one: scores_one, + scores_two: scores_two, + scores_three: scores_three, + file: file, + }); + }, + // 上传图片视频 + uploadfile({ file }) { + const params = { + file: file + } + console.log(params); + + return vm.$u.post('Upload/uploadfile', params); }, // 信息模块 messageIndex({ }) { diff --git a/components/mine/address-active/index.vue b/components/mine/address-active/index.vue index e4e9c26..bcd9000 100644 --- a/components/mine/address-active/index.vue +++ b/components/mine/address-active/index.vue @@ -118,16 +118,19 @@ export default { // latitude, }).then((res)=>{ if (res.errCode == 0) { - this.$refs.uToast.show({ - title: res.message, - type: 'success', - // url: '/pageE/more/Address', - callback() { - uni.redirectTo({ - url: '/pageE/more/Address' - }); - } - }) + uni.redirectTo({ + url: '/pageE/more/Address' + }); + // this.$refs.uToast.show({ + // title: res.message, + // type: 'success', + // // url: '/pageE/more/Address', + // callback() { + // uni.redirectTo({ + // url: '/pageE/more/Address' + // }); + // } + // }) } else { this.showToast(res.message, 'warning'); } @@ -148,16 +151,19 @@ export default { // latitude, }).then((res)=>{ if (res.errCode == 0) { - this.$refs.uToast.show({ - title: res.message, - type: 'success', - // url: '/pageE/more/Address', - callback() { - uni.redirectTo({ - url: '/pageE/more/Address' - }); - } - }) + uni.redirectTo({ + url: '/pageE/more/Address' + }); + // this.$refs.uToast.show({ + // title: res.message, + // type: 'success', + // // url: '/pageE/more/Address', + // callback() { + // uni.redirectTo({ + // url: '/pageE/more/Address' + // }); + // } + // }) } else { this.showToast(res.message, 'warning'); } diff --git a/components/mine/coupon/index.vue b/components/mine/coupon/index.vue new file mode 100644 index 0000000..3448072 --- /dev/null +++ b/components/mine/coupon/index.vue @@ -0,0 +1,131 @@ + + + \ No newline at end of file diff --git a/components/mine/order-item/index.vue b/components/mine/order-item/index.vue index a3a144d..cc7cb64 100644 --- a/components/mine/order-item/index.vue +++ b/components/mine/order-item/index.vue @@ -2,30 +2,32 @@ - - 胖胖的店 + + {{ order.extend_store.store_name }} - 交易成功 + {{ order.order_state | viewState }} - - - - 木糖少女小紫薯西装领连衣裙夏季新款女装夏收腰格子格纹裙子 - XL;红色条纹XL;红色条纹XL;红色条纹 - 距离结束:23:23:38 - 总价:¥99.00,实付款¥99 - - - 2020.05.17 + + + + + {{ goods.goods_name }} + XL;红色条纹XL;红色条纹XL;红色条纹 + 距离结束:23:23:38 + 总价:¥99.00,实付款¥99 + + + 2020.05.17 + - - 查看物流 - 立即评价 - 立即支付 - 联系官方客服 - 提交官方审核 + + 查看物流 + 立即评价 + 立即支付 + 联系官方客服 + 提交官方审核 @@ -35,12 +37,40 @@ export default { return {} }, props: { - current: Number + order: Object + }, + filters: { + viewState(value) { + let state; + switch (value) { + case 10: + state = '待支付'; + break; + case 0: + state = '已取消'; + break; + case 30: + state = '待收货'; + break; + case -1: + state = '试穿试送'; + break; + case 20: + state = '待评价'; + break; + case 40: + state = '售后'; + break; + default: + break; + } + return state; + }, }, methods: { toDetailsPage() { uni.navigateTo({ - url: '/pageE/order/Details?current=' + this.current + url: '/pageE/order/Details?order.order_state=' + this.order.order_state }); }, toLogistics() { @@ -87,49 +117,51 @@ export default { } } .goods-info { - display: flex; - margin-bottom: 28rpx; - > image { - flex-shrink: 0; - width: 180rpx; - height: 160rpx; - border-radius: 10rpx; - margin-right: 30rpx; - } - .goods-text { + .goods-item { display: flex; - flex-direction: column; - justify-content: space-between; - .goods-name { - font-size: 28rpx; - color: rgba(51,51,51,1); - line-height: 38rpx; + margin-bottom: 28rpx; + > image { + flex-shrink: 0; + width: 180rpx; + height: 160rpx; + border-radius: 10rpx; + margin-right: 30rpx; } - .goods-sku { - max-width: 230rpx; - background: rgba(236,236,236,1); - border-radius: 6rpx; - padding: 10rpx 15rpx; - font-size: 24rpx; - color: rgba(153,153,153,1); - } - .goods-time { - font-size: 24rpx; - color: rgba(255,49,49,1); - } - .goods-price { - font-size: 24rpx; - color: rgba(253,211,96,1); - } - .goods-date { + .goods-text { display: flex; - align-items: center; - font-size: 24rpx; - color: rgba(153,153,153,1); - > image { - width: 24rpx; - height: 24rpx; - margin-right: 21rpx; + flex-direction: column; + justify-content: space-between; + .goods-name { + font-size: 28rpx; + color: rgba(51,51,51,1); + line-height: 38rpx; + } + .goods-sku { + max-width: 230rpx; + background: rgba(236,236,236,1); + border-radius: 6rpx; + padding: 10rpx 15rpx; + font-size: 24rpx; + color: rgba(153,153,153,1); + } + .goods-time { + font-size: 24rpx; + color: rgba(255,49,49,1); + } + .goods-price { + font-size: 24rpx; + color: rgba(253,211,96,1); + } + .goods-date { + display: flex; + align-items: center; + font-size: 24rpx; + color: rgba(153,153,153,1); + > image { + width: 24rpx; + height: 24rpx; + margin-right: 21rpx; + } } } } diff --git a/components/uni-swipe-action-item/bindingx.js b/components/uni-swipe-action-item/bindingx.js deleted file mode 100644 index 59c592e..0000000 --- a/components/uni-swipe-action-item/bindingx.js +++ /dev/null @@ -1,245 +0,0 @@ -const BindingX = uni.requireNativePlugin('bindingx'); -const dom = uni.requireNativePlugin('dom'); -const animation = uni.requireNativePlugin('animation'); - -export default { - data() { - return { - right: 0, - button: [], - preventGesture: false - } - }, - - watch: { - show(newVal) { - if (!this.position || JSON.stringify(this.position) === '{}') return; - if (this.autoClose) return - if (this.isInAnimation) return - if (newVal) { - this.open() - } else { - this.close() - } - }, - }, - created() { - if (this.swipeaction.children !== undefined) { - this.swipeaction.children.push(this) - } - }, - mounted() { - this.boxSelector = this.getEl(this.$refs['selector-box-hock']); - this.selector = this.getEl(this.$refs['selector-content-hock']); - this.buttonSelector = this.getEl(this.$refs['selector-button-hock']); - this.position = {} - this.x = 0 - setTimeout(() => { - this.getSelectorQuery() - }, 200) - }, - beforeDestroy() { - if (this.timing) { - BindingX.unbind({ - token: this.timing.token, - eventType: 'timing' - }) - } - if (this.eventpan) { - BindingX.unbind({ - token: this.eventpan.token, - eventType: 'pan' - }) - } - this.swipeaction.children.forEach((item, index) => { - if (item === this) { - this.swipeaction.children.splice(index, 1) - } - }) - }, - methods: { - onClick(index, item) { - this.$emit('click', { - content: item, - index - }) - }, - touchstart(e) { - if (this.isInAnimation) return - if (this.stop) return - this.stop = true - if (this.autoClose) { - this.swipeaction.closeOther(this) - } - let endWidth = this.right - let boxStep = `(x+${this.x})` - let pageX = `${boxStep}> ${-endWidth} && ${boxStep} < 0?${boxStep}:(x+${this.x} < 0? ${-endWidth}:0)` - - let props = [{ - element: this.selector, - property: 'transform.translateX', - expression: pageX - }] - - let left = 0 - for (let i = 0; i < this.options.length; i++) { - let buttonSelectors = this.getEl(this.$refs['button-hock'][i]); - if (this.button.length === 0 || !this.button[i] || !this.button[i].width) return - let moveMix = endWidth - left - left += this.button[i].width - let step = `(${this.x}+x)/${endWidth}` - let moveX = `(${step}) * ${moveMix}` - let pageButtonX = `${moveX}&& (x+${this.x} > ${-endWidth})?${moveX}:${-moveMix}` - props.push({ - element: buttonSelectors, - property: 'transform.translateX', - expression: pageButtonX - }) - } - - this.eventpan = this._bind(this.boxSelector, props, 'pan', (e) => { - if (e.state === 'end') { - this.x = e.deltaX + this.x; - if (this.x < -endWidth) { - this.x = -endWidth - } - if (this.x > 0) { - this.x = 0 - } - this.stop = false - this.bindTiming(); - } - }) - }, - touchend(e) { - this.$nextTick(() => { - if (this.isopen && !this.isDrag && !this.isInAnimation) { - this.close() - } - }) - }, - bindTiming() { - if (this.isopen) { - this.move(this.x, -this.right) - } else { - this.move(this.x, -40) - } - }, - move(left, value) { - if (left >= value) { - this.close() - } else { - this.open() - } - }, - /** - * 开启swipe - */ - open() { - this.animation(true) - }, - /** - * 关闭swipe - */ - close() { - this.animation(false) - }, - /** - * 开启关闭动画 - * @param {Object} type - */ - animation(type) { - this.isDrag = true - let endWidth = this.right - let time = 200 - this.isInAnimation = true; - - let exit = `t>${time}`; - let translate_x_expression = `easeOutExpo(t,${this.x},${type?(-endWidth-this.x):(-this.x)},${time})` - let props = [{ - element: this.selector, - property: 'transform.translateX', - expression: translate_x_expression - }] - - let left = 0 - for (let i = 0; i < this.options.length; i++) { - let buttonSelectors = this.getEl(this.$refs['button-hock'][i]); - if (this.button.length === 0 || !this.button[i] || !this.button[i].width) return - let moveMix = endWidth - left - left += this.button[i].width - let step = `${this.x}/${endWidth}` - let moveX = `(${step}) * ${moveMix}` - let pageButtonX = `easeOutExpo(t,${moveX},${type ? -moveMix + '-' + moveX: 0 + '-' + moveX},${time})` - props.push({ - element: buttonSelectors, - property: 'transform.translateX', - expression: pageButtonX - }) - } - - this.timing = BindingX.bind({ - eventType: 'timing', - exitExpression: exit, - props: props - }, (e) => { - if (e.state === 'end' || e.state === 'exit') { - this.x = type ? -endWidth : 0 - this.isInAnimation = false; - - this.isopen = this.isopen || false - if (this.isopen !== type) { - this.$emit('change', type) - } - this.isopen = type - this.isDrag = false - } - }); - }, - /** - * 绑定 BindingX - * @param {Object} anchor - * @param {Object} props - * @param {Object} fn - */ - _bind(anchor, props, eventType, fn) { - return BindingX.bind({ - anchor, - eventType, - props - }, (e) => { - typeof(fn) === 'function' && fn(e) - }); - }, - /** - * 获取ref - * @param {Object} el - */ - getEl(el) { - return el.ref - }, - /** - * 获取节点信息 - */ - getSelectorQuery() { - dom.getComponentRect(this.$refs['selector-content-hock'], (data) => { - if (this.position.content) return - this.position.content = data.size - }) - for (let i = 0; i < this.options.length; i++) { - dom.getComponentRect(this.$refs['button-hock'][i], (data) => { - if (!this.button) { - this.button = [] - } - if (this.options.length === this.button.length) return - this.button.push(data.size) - this.right += data.size.width - if (this.autoClose) return - if (this.show) { - this.open() - } - }) - } - } - } -} diff --git a/components/uni-swipe-action-item/index.wxs b/components/uni-swipe-action-item/index.wxs deleted file mode 100644 index 79c6f9e..0000000 --- a/components/uni-swipe-action-item/index.wxs +++ /dev/null @@ -1,204 +0,0 @@ -/** - * 监听页面内值的变化,主要用于动态开关swipe-action - * @param {Object} newValue - * @param {Object} oldValue - * @param {Object} ownerInstance - * @param {Object} instance - */ -function sizeReady(newValue, oldValue, ownerInstance, instance) { - var state = instance.getState() - state.position = JSON.parse(newValue) - if (!state.position || state.position.length === 0) return - var show = state.position[0].show - state.left = state.left || state.position[0].left; - // 通过用户变量,开启或关闭 - if (show) { - openState(true, instance, ownerInstance) - } else { - openState(false, instance, ownerInstance) - } -} - -/** - * 开始触摸操作 - * @param {Object} e - * @param {Object} ins - */ -function touchstart(e, ins) { - var instance = e.instance; - var state = instance.getState(); - var pageX = e.touches[0].pageX; - // 开始触摸时移除动画类 - instance.removeClass('ani'); - var owner = ins.selectAllComponents('.button-hock') - for (var i = 0; i < owner.length; i++) { - owner[i].removeClass('ani'); - } - // state.position = JSON.parse(instance.getDataset().position); - state.left = state.left || state.position[0].left; - // 获取最终按钮组的宽度 - state.width = pageX - state.left; - ins.callMethod('closeSwipe') -} - -/** - * 开始滑动操作 - * @param {Object} e - * @param {Object} ownerInstance - */ -function touchmove(e, ownerInstance) { - var instance = e.instance; - var disabled = instance.getDataset().disabled - var state = instance.getState() - // fix by mehaotian, TODO 兼容 app-vue 获取dataset为字符串 , h5 获取 为 undefined 的问题,待框架修复 - disabled = (typeof(disabled) === 'string' ? JSON.parse(disabled) : disabled) || false; - - if (disabled) return - var pageX = e.touches[0].pageX; - move(pageX - state.width, instance, ownerInstance) -} - -/** - * 结束触摸操作 - * @param {Object} e - * @param {Object} ownerInstance - */ -function touchend(e, ownerInstance) { - var instance = e.instance; - var disabled = instance.getDataset().disabled - var state = instance.getState() - - // fix by mehaotian, TODO 兼容 app-vue 获取dataset为字符串 , h5 获取 为 undefined 的问题,待框架修复 - disabled = (typeof(disabled) === 'string' ? JSON.parse(disabled) : disabled) || false; - - if (disabled) return - // 滑动过程中触摸结束,通过阙值判断是开启还是关闭 - // fixed by mehaotian 定时器解决点击按钮,touchend 触发比 click 事件时机早的问题 ,主要是 ios13 - moveDirection(state.left, -40, instance, ownerInstance) -} - -/** - * 设置移动距离 - * @param {Object} value - * @param {Object} instance - * @param {Object} ownerInstance - */ -function move(value, instance, ownerInstance) { - var state = instance.getState() - // 获取可滑动范围 - var x = Math.max(-state.position[1].width, Math.min((value), 0)); - state.left = x; - instance.setStyle({ - transform: 'translateX(' + x + 'px)', - '-webkit-transform': 'translateX(' + x + 'px)' - }) - // 折叠按钮动画 - buttonFold(x, instance, ownerInstance) -} - -/** - * 移动方向判断 - * @param {Object} left - * @param {Object} value - * @param {Object} ownerInstance - * @param {Object} ins - */ -function moveDirection(left, value, ins, ownerInstance) { - var state = ins.getState() - var position = state.position - var isopen = state.isopen - if (!position[1].width) { - openState(false, ins, ownerInstance) - return - } - // 如果已经是打开状态,进行判断是否关闭,还是保留打开状态 - if (isopen) { - if (-left <= position[1].width) { - openState(false, ins, ownerInstance) - } else { - openState(true, ins, ownerInstance) - } - return - } - // 如果是关闭状态,进行判断是否打开,还是保留关闭状态 - if (left <= value) { - openState(true, ins, ownerInstance) - } else { - openState(false, ins, ownerInstance) - } -} - -/** - * 设置按钮移动距离 - * @param {Object} value - * @param {Object} instance - * @param {Object} ownerInstance - */ -function buttonFold(value, instance, ownerInstance) { - var ins = ownerInstance.selectAllComponents('.button-hock'); - var state = instance.getState(); - var position = state.position; - var arr = []; - var w = 0; - for (var i = 0; i < ins.length; i++) { - if (!ins[i].getDataset().button) return - var btnData = JSON.parse(ins[i].getDataset().button) - - // fix by mehaotian TODO 在 app-vue 中,字符串转对象,需要转两次,这里先这么兼容 - if (typeof(btnData) === 'string') { - btnData = JSON.parse(btnData) - } - - var button = btnData[i] && btnData[i].width || 0 - w += button - arr.push(-w) - // 动态计算按钮组每个按钮的折叠动画移动距离 - var distance = arr[i - 1] + value * (arr[i - 1] / position[1].width) - if (i != 0) { - ins[i].setStyle({ - transform: 'translateX(' + distance + 'px)', - }) - } - } -} - -/** - * 开启状态 - * @param {Boolean} type - * @param {Object} ins - * @param {Object} ownerInstance - */ -function openState(type, ins, ownerInstance) { - var state = ins.getState() - var position = state.position - if (state.isopen === undefined) { - state.isopen = false - } - // 只有状态有改变才会通知页面改变状态 - if (state.isopen !== type) { - // 通知页面,已经打开 - ownerInstance.callMethod('change', { - open: type - }) - } - // 设置打开和移动状态 - state.isopen = type - - - // 添加动画类 - ins.addClass('ani'); - var owner = ownerInstance.selectAllComponents('.button-hock') - for (var i = 0; i < owner.length; i++) { - owner[i].addClass('ani'); - } - // 设置最终移动位置 - move(type ? -position[1].width : 0, ins, ownerInstance) - -} - -module.exports = { - sizeReady: sizeReady, - touchstart: touchstart, - touchmove: touchmove, - touchend: touchend -} diff --git a/components/uni-swipe-action-item/mpalipay.js b/components/uni-swipe-action-item/mpalipay.js deleted file mode 100644 index 8537b24..0000000 --- a/components/uni-swipe-action-item/mpalipay.js +++ /dev/null @@ -1,160 +0,0 @@ -export default { - data() { - return { - isshow: false, - viewWidth: 0, - buttonWidth: 0, - disabledView: false, - x: 0, - transition: false - } - }, - watch: { - show(newVal) { - if (this.autoClose) return - if (newVal) { - this.open() - } else { - this.close() - } - }, - }, - created() { - if (this.swipeaction.children !== undefined) { - this.swipeaction.children.push(this) - } - }, - beforeDestroy() { - this.swipeaction.children.forEach((item, index) => { - if (item === this) { - this.swipeaction.children.splice(index, 1) - } - }) - }, - mounted() { - this.isopen = false - this.transition = true - setTimeout(() => { - this.getQuerySelect() - }, 50) - - }, - methods: { - onClick(index, item) { - this.$emit('click', { - content: item, - index - }) - }, - touchstart(e) { - let { - pageX, - pageY - } = e.changedTouches[0] - this.transition = false - this.startX = pageX - if (this.autoClose) { - this.swipeaction.closeOther(this) - } - }, - touchmove(e) { - let { - pageX, - } = e.changedTouches[0] - this.slide = this.getSlide(pageX) - if (this.slide === 0) { - this.disabledView = false - } - - }, - touchend(e) { - this.stop = false - this.transition = true - if (this.isopen) { - if (this.moveX === -this.buttonWidth) { - this.close() - return - } - this.move() - } else { - if (this.moveX === 0) { - this.close() - return - } - this.move() - } - }, - open() { - this.x = this.moveX - this.$nextTick(() => { - this.x = -this.buttonWidth - this.moveX = this.x - - if(!this.isopen){ - this.isopen = true - this.$emit('change', true) - } - }) - }, - close() { - this.x = this.moveX - this.$nextTick(() => { - this.x = 0 - this.moveX = this.x - if(this.isopen){ - this.isopen = false - this.$emit('change', false) - } - }) - }, - move() { - if (this.slide === 0) { - this.open() - } else { - this.close() - } - }, - onChange(e) { - let x = e.detail.x - this.moveX = x - if (x >= this.buttonWidth) { - this.disabledView = true - this.$nextTick(() => { - this.x = this.buttonWidth - }) - } - }, - getSlide(x) { - if (x >= this.startX) { - this.startX = x - return 1 - } else { - this.startX = x - return 0 - } - - }, - getQuerySelect() { - const query = uni.createSelectorQuery().in(this); - query.selectAll('.viewWidth-hook').boundingClientRect(data => { - - this.viewWidth = data[0].width - this.buttonWidth = data[1].width - this.transition = false - this.$nextTick(() => { - this.transition = true - }) - - if (!this.buttonWidth) { - this.disabledView = true - } - - if (this.autoClose) return - if (this.show) { - this.open() - } - }).exec(); - - } - } -} diff --git a/components/uni-swipe-action-item/mpother.js b/components/uni-swipe-action-item/mpother.js deleted file mode 100644 index ae97ba6..0000000 --- a/components/uni-swipe-action-item/mpother.js +++ /dev/null @@ -1,158 +0,0 @@ -// #ifdef APP-NVUE -const dom = weex.requireModule('dom'); -// #endif -export default { - data() { - return { - uniShow: false, - left: 0 - } - }, - computed: { - moveLeft() { - return `translateX(${this.left}px)` - } - }, - watch: { - show(newVal) { - if (!this.position || JSON.stringify(this.position) === '{}') return; - if (this.autoClose) return - if (newVal) { - this.$emit('change', true) - this.open() - } else { - this.$emit('change', false) - this.close() - } - } - }, - mounted() { - this.position = {} - if (this.swipeaction.children !== undefined) { - this.swipeaction.children.push(this) - } - setTimeout(() => { - this.getSelectorQuery() - }, 100) - }, - beforeDestoy() { - this.swipeaction.children.forEach((item, index) => { - if (item === this) { - this.swipeaction.children.splice(index, 1) - } - }) - }, - methods: { - onClick(index, item) { - this.$emit('click', { - content: item, - index - }) - this.close() - }, - touchstart(e) { - const { - pageX - } = e.touches[0] - if (this.disabled) return - const left = this.position.content.left - if (this.autoClose) { - this.swipeaction.closeOther(this) - } - this.width = pageX - left - if (this.isopen) return - if (this.uniShow) { - this.uniShow = false - this.isopen = true - this.openleft = this.left + this.position.button.width - } - }, - touchmove(e, index) { - if (this.disabled) return - const { - pageX - } = e.touches[0] - this.setPosition(pageX) - }, - touchend() { - if (this.disabled) return - if (this.isopen) { - this.move(this.openleft, 0) - return - } - this.move(this.left, -40) - }, - setPosition(x, y) { - if (!this.position.button.width) { - return - } - // this.left = x - this.width - this.setValue(x - this.width) - }, - setValue(value) { - // 设置最大最小值 - this.left = Math.max(-this.position.button.width, Math.min(parseInt(value), 0)) - this.position.content.left = this.left - if (this.isopen) { - this.openleft = this.left + this.position.button.width - } - }, - move(left, value) { - if (left >= value) { - this.$emit('change', false) - this.close() - } else { - this.$emit('change', true) - this.open() - } - }, - open() { - this.uniShow = true - this.left = -this.position.button.width - this.setValue(-this.position.button.width) - }, - close() { - this.uniShow = true - this.setValue(0) - setTimeout(() => { - this.uniShow = false - this.isopen = false - }, 300) - }, - getSelectorQuery() { - // #ifndef APP-NVUE - const views = uni.createSelectorQuery() - .in(this) - views - .selectAll('.selector-query-hock') - .boundingClientRect(data => { - this.position.content = data[1] - this.position.button = data[0] - if (this.autoClose) return - if (this.show) { - this.open() - } else { - this.close() - } - }) - .exec() - // #endif - // #ifdef APP-NVUE - dom.getComponentRect(this.$refs['selector-content-hock'], (data) => { - if (this.position.content) return - this.position.content = data.size - }) - dom.getComponentRect(this.$refs['selector-button-hock'], (data) => { - if (this.position.button) return - this.position.button = data.size - if (this.autoClose) return - if (this.show) { - this.open() - } else { - this.close() - } - }) - // #endif - } - } -} diff --git a/components/uni-swipe-action-item/mpwxs.js b/components/uni-swipe-action-item/mpwxs.js deleted file mode 100644 index 3073ff8..0000000 --- a/components/uni-swipe-action-item/mpwxs.js +++ /dev/null @@ -1,97 +0,0 @@ -export default { - data() { - return { - position: [], - button: [] - } - }, - computed: { - pos() { - return JSON.stringify(this.position) - }, - btn() { - return JSON.stringify(this.button) - } - }, - watch: { - show(newVal) { - if (this.autoClose) return - let valueObj = this.position[0] - if (!valueObj) { - this.init() - return - } - valueObj.show = newVal - this.$set(this.position, 0, valueObj) - } - }, - created() { - if (this.swipeaction.children !== undefined) { - this.swipeaction.children.push(this) - } - }, - mounted() { - this.init() - - }, - beforeDestroy() { - this.swipeaction.children.forEach((item, index) => { - if (item === this) { - this.swipeaction.children.splice(index, 1) - } - }) - }, - methods: { - init() { - - setTimeout(() => { - this.getSize() - this.getButtonSize() - }, 50) - }, - closeSwipe(e) { - if (!this.autoClose) return - this.swipeaction.closeOther(this) - }, - - change(e) { - this.$emit('change', e.open) - let valueObj = this.position[0] - if (valueObj.show !== e.open) { - valueObj.show = e.open - this.$set(this.position, 0, valueObj) - } - }, - onClick(index, item) { - this.$emit('click', { - content: item, - index - }) - }, - appTouchStart(){}, - appTouchEnd(){}, - getSize() { - const views = uni.createSelectorQuery().in(this) - views - .selectAll('.selector-query-hock') - .boundingClientRect(data => { - if (this.autoClose) { - data[0].show = false - } else { - data[0].show = this.show - } - this.position = data - }) - .exec() - }, - getButtonSize() { - const views = uni.createSelectorQuery().in(this) - views - .selectAll('.button-hock') - .boundingClientRect(data => { - this.button = data - }) - .exec() - } - } -} diff --git a/components/uni-swipe-action-item/uni-swipe-action-item.vue b/components/uni-swipe-action-item/uni-swipe-action-item.vue deleted file mode 100644 index 9a0f8f2..0000000 --- a/components/uni-swipe-action-item/uni-swipe-action-item.vue +++ /dev/null @@ -1,270 +0,0 @@ - - - - diff --git a/components/uni-swipe-action/uni-swipe-action.vue b/components/uni-swipe-action/uni-swipe-action.vue deleted file mode 100644 index 9ad5c5e..0000000 --- a/components/uni-swipe-action/uni-swipe-action.vue +++ /dev/null @@ -1,58 +0,0 @@ - - - - - diff --git a/pageB/components/sdetails/guige.vue b/pageB/components/sdetails/guige.vue new file mode 100644 index 0000000..d37f122 --- /dev/null +++ b/pageB/components/sdetails/guige.vue @@ -0,0 +1,64 @@ + + + \ No newline at end of file diff --git a/pageB/components/sdetails/tloos.vue b/pageB/components/sdetails/tloos.vue index 8c4cd7e..354cfe0 100644 --- a/pageB/components/sdetails/tloos.vue +++ b/pageB/components/sdetails/tloos.vue @@ -1,36 +1,109 @@ \ No newline at end of file diff --git a/pageB/sdetails/index.vue b/pageB/sdetails/index.vue index 2d036fa..296bd8a 100644 --- a/pageB/sdetails/index.vue +++ b/pageB/sdetails/index.vue @@ -23,18 +23,22 @@ - + + diff --git a/pageC/cart/ConfirmOrder.vue b/pageC/cart/ConfirmOrder.vue index 5785bb9..3a47718 100644 --- a/pageC/cart/ConfirmOrder.vue +++ b/pageC/cart/ConfirmOrder.vue @@ -4,10 +4,10 @@ - 山东省泰安市泰山区东岳大街与克山路交汇口银山店四楼橙天影视南邻山东省泰安市泰山区东岳大街与克山路交汇口银山店四楼橙天影视南邻 + {{ addressInfo.area_info + addressInfo.address_detail }} @@ -75,6 +75,8 @@ export default { return { orderInfo: {}, totalPrice: '0.00', + addressInfo: {}, + freight: '', } }, filters: { @@ -92,36 +94,24 @@ export default { onLoad(option) { console.log(JSON.parse(option.info)); this.orderInfo = JSON.parse(option.info); - // this.orderListInit(); + this.addressInfo = this.orderInfo.address_info; this.showTotalPrice(); + this.getFreight(); }, methods: { - // orderListInit() { - // this.orderList = this.orderInfo.store_list; - // for (const key in this.orderList) { - // if (this.orderList.hasOwnProperty(key)) { - // const element = this.orderList[key]; - // let tempArray = Object.entries(this.orderInfo.store_cart_list); - // tempArray.forEach(item => { - // if (item[0]) - // }) - // let temp = this.orderInfo.store_cart_list.filters(store => { - // return store.store_id == item.store_id - // }) - // element - // } - // } - // this.orderList.forEach(item => { - // let temp = this.orderInfo.store_cart_list.filters(store => { - // return store.store_id == item.store_id - // }) - // Object.assign(item, { goods_list: temp }); - // }) - // console.log(this.orderList); - - // }, showTotalPrice() { + }, + getFreight() { + this.$u.api.getFreight({ + freight_hash: this.orderInfo.freight_hash, + city_id: this.addressInfo.city_id, + area_id: this.addressInfo.area_id, + }).then(res => { + if(res.errCode == 0) { + // this.freight = res. + } + }) }, settlement() { uni.navigateTo({ @@ -177,6 +167,7 @@ export default { } } .main { + margin-bottom: 100rpx; > view { .goods-info { background-color: #ffffff; @@ -220,6 +211,7 @@ export default { flex-shrink: 0; } .info { + flex: 1; // width: 418rpx; height: 160rpx; display: flex; diff --git a/pageC/cart/index.vue b/pageC/cart/index.vue index 6808320..096bffa 100644 --- a/pageC/cart/index.vue +++ b/pageC/cart/index.vue @@ -85,6 +85,7 @@ export default { }, // 结算 settlementOrder() { + // 拼接后端需要的数据形式 let id = [], temp = ''; this.checkedGoods.forEach(item => { temp = item.cart_id + '|' + item.goods_num; @@ -147,16 +148,14 @@ export default { this.cartUpdateNumber(e.index, e.value); }, async cartUpdateNumber(id, number) { - try { - await this.$u.api.cartUpdateNumber({ - cart_id: id, - quantity: number, - }).then(res => { - this.getCartList(); - }) - } catch (error) { + await this.$u.api.cartUpdateNumber({ + cart_id: id, + quantity: number, + }).then(res => { this.getCartList(); - } + }).catch(() => { + this.geCartList(); + }) }, totalChange(e) { // 切换所有商品的状态 @@ -193,16 +192,7 @@ export default { } }, onNavigationBarButtonTap(btn) { - console.log(btn); - // this.status = btn.text; - // #ifdef H5 - if(this.status == '编辑'){ - this.status = "完成"; - } else { - this.status = "编辑"; - } - console.log(this.status); - // #endif + // console.log(btn); if(btn.index == 0){ let pages = getCurrentPages(); let page = pages[pages.length - 1]; diff --git a/pageC/components/merchant/image-top.vue b/pageC/components/merchant/image-top.vue new file mode 100644 index 0000000..a061379 --- /dev/null +++ b/pageC/components/merchant/image-top.vue @@ -0,0 +1,26 @@ + + + \ No newline at end of file diff --git a/pageC/components/merchant/list-item.vue b/pageC/components/merchant/list-item.vue new file mode 100644 index 0000000..2a057d9 --- /dev/null +++ b/pageC/components/merchant/list-item.vue @@ -0,0 +1,28 @@ + + + \ No newline at end of file diff --git a/pageC/components/merchant/video-top.vue b/pageC/components/merchant/video-top.vue new file mode 100644 index 0000000..eb60ca8 --- /dev/null +++ b/pageC/components/merchant/video-top.vue @@ -0,0 +1,26 @@ + + + \ No newline at end of file diff --git a/pageC/merchant/index.vue b/pageC/merchant/index.vue index a55536e..e63dffb 100644 --- a/pageC/merchant/index.vue +++ b/pageC/merchant/index.vue @@ -38,7 +38,14 @@ - 111 + + + + + + + + @@ -67,16 +74,25 @@ @@ -155,7 +176,7 @@ export default { background-color: #ffffff; width: 100%; margin-bottom: 20rpx; - height: 140rpx; + // height: 140rpx; display: flex; align-items: center; padding: 20rpx 30rpx; diff --git a/pageE/mine/EditUserInfo.vue b/pageE/mine/EditUserInfo.vue index 70a1098..91fc9c1 100644 --- a/pageE/mine/EditUserInfo.vue +++ b/pageE/mine/EditUserInfo.vue @@ -1,8 +1,9 @@ @@ -55,7 +56,7 @@ export default { minute: false, second: false }, - nickname: '胖胖', + nickname: '', gender: '', // 1男 2女 birthday: '', phoneNumber: '', @@ -65,15 +66,37 @@ export default { onLoad() { this.getUserInfo(); }, + onNavigationBarButtonTap(e) { + if( e.index == 0 ) uni.navigateBack(); + }, methods: { + changeAvatar() { + const url = this.$u.http.config.baseUrl + '/Upload/uploadfile'; + uni.chooseImage({ + count: 1, + sizeType: ['original', 'compressed'], + sourceType: ['album'], + success: (res) => { + this.avatar = res.tempFilePaths[0]; + common.uploadFile({ + url: url, + filePath: res.tempFilePaths[0] + }).then(result => { + this.avatar = result; + }, error => { + this.$u.toast(error); + }) + } + }); + }, getUserInfo() { this.$u.api.getMemberInfo().then(res => { if (res.errCode == 0) { let userInfo = res.data.MemberArray; [this.nickname, this.phoneNumber, this.birthday, this.gender, this.avatar] = [ userInfo.member_nickname, - userInfo.member_mobile, - common.timestampToDate({timestamp: userInfo.member_birthday}), + userInfo.member_mobile, + userInfo.member_birthday, userInfo.member_sex, userInfo.member_avatar, ]; @@ -115,15 +138,16 @@ export default { padding-top: 1rpx; .user-info { .info-avatar { - text-align: center; - height: 160rpx; + height: 202rpx; + display: flex; + flex-direction: column; + align-items: center; + justify-content: center; background: rgba(255,255,255,1); - > image { - flex-shrink: 0; - width: 120rpx; - height: 120rpx; - border-radius: 50%; - margin-top: 20rpx; + .avatar-text { + margin-top: 12rpx; + font-size: 24rpx; + color: rgba(255,120,15,1); } } .info-item { diff --git a/pageE/mine/Integral.vue b/pageE/mine/Integral.vue index 4e0b6c3..17d828d 100644 --- a/pageE/mine/Integral.vue +++ b/pageE/mine/Integral.vue @@ -3,37 +3,58 @@ 总积分 - 999 + {{ memberInfo.member_points }} 经验值 - 999 + {{ memberInfo.member_exppoints }} - + 预计进度 - 999 + + + + - + @@ -61,13 +82,19 @@ export default { font-size: 48rpx; font-weight: 500; color: rgba(255,255,255,1); + > image { + width: 52rpx; + height: 35rpx; + } } } } .integral-botom { + box-sizing: border-box; + padding: 30rpx; position: absolute; - width: 750rpx; - height: calc(100vh - 251rpx); + width: 100%; + // height: calc(100vh - 251rpx); background: rgba(255,255,255,1); border-radius: 20rpx 20rpx 0rpx 0rpx; top: 251rpx; diff --git a/pageE/mine/MemberServe.vue b/pageE/mine/MemberServe.vue index 7169298..575dfa1 100644 --- a/pageE/mine/MemberServe.vue +++ b/pageE/mine/MemberServe.vue @@ -1,11 +1,11 @@ @@ -111,18 +122,20 @@ export default { background-color: #ECECEC; display: flex; flex-direction: column; - > uni-swiper { - flex: 1; - } + // > uni-swiper { + // flex: 1; + // height: calc() + // } .swiper-item { padding-top: 10rpx; .integral { height: 100%; position: relative; + overflow: hidden; .integral-top { padding: 79rpx 88rpx; width: 750rpx; - height: 271rpx; + height: 270rpx; background: linear-gradient(0deg,rgba(246,211,119,1) 1%,rgba(240,154,105,1) 100%); display: flex; justify-content: space-between; @@ -142,66 +155,18 @@ export default { } } .integral-botom { + box-sizing: border-box; + padding: 30rpx; position: absolute; - width: 750rpx; - // height: 856rpx; + width: 100%; background: rgba(255,255,255,1); border-radius: 20rpx 20rpx 0rpx 0rpx; - top: 251rpx; + top: 250rpx; z-index: 9; } } .coupon { height: 100%; - .coupon-item { - padding: 30rpx; - background-color: #ffffff; - display: flex; - align-items: flex-end; - margin-bottom: 2rpx; - > img { - width: 180rpx; - height: 160rpx; - border-radius: 10rpx; - margin-right: 30rpx; - } - .coupon-main { - .coupon-title { - font-size: 30rpx; - color: rgba(51,51,51,1); - } - .coupon-date { - display: flex; - align-items: center; - margin: 29rpx 0 20rpx; - > img { - width: 24rpx; - height: 24rpx; - margin-right: 15rpx; - } - > view { - font-size: 24rpx; - color: rgba(153,153,153,1); - } - } - .coupon-integral { - font-size: 30rpx; - font-weight: 500; - color: rgba(255,120,15,1); - } - } - .coupon-btn { - margin-left: auto; - width: 85rpx; - // height: 42rpx; - border: 2rpx solid rgba(255,120,15,1); - border-radius: 10rpx; - font-size: 26rpx; - color: rgba(255,120,15,1); - line-height: 42rpx; - text-align: center; - } - } } .details { height: 100%; diff --git a/pageE/mine/MemberServeCoupon.vue b/pageE/mine/MemberServeCoupon.vue new file mode 100644 index 0000000..796aad4 --- /dev/null +++ b/pageE/mine/MemberServeCoupon.vue @@ -0,0 +1,161 @@ + + + \ No newline at end of file diff --git a/pageE/mine/MineInfo.vue b/pageE/mine/MineInfo.vue index f57a396..a5ee6f0 100644 --- a/pageE/mine/MineInfo.vue +++ b/pageE/mine/MineInfo.vue @@ -1,7 +1,7 @@ diff --git a/pageE/more/Complaints.vue b/pageE/more/Complaints.vue index efab732..7c99502 100644 --- a/pageE/more/Complaints.vue +++ b/pageE/more/Complaints.vue @@ -1,19 +1,19 @@