From 5ddeeeee5866e2938523c250257f3fdd4153a306 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E6=85=A2=E6=85=A2?= <994797151@qq.com> Date: Mon, 28 Dec 2020 17:06:05 +0800 Subject: [PATCH 1/3] =?UTF-8?q?[=E4=BF=AE=E6=94=B9=E8=AE=A2=E5=8D=95?= =?UTF-8?q?=E7=AD=BE=E6=94=B6=E3=80=81=E9=80=80=E6=AC=BE=EF=BC=8C=E6=94=AF?= =?UTF-8?q?=E4=BB=98=EF=BC=8C=E8=B4=AD=E7=89=A9=E8=BD=A6=E7=BB=93=E7=AE=97?= =?UTF-8?q?]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apis/interfaces/order.js | 25 +- app.json | 20 +- pages/mall/mall_cart/mall_cart.js | 47 ++-- pages/mall/mall_details/mall_details.wxml | 53 +++-- pages/mall/mall_details/mall_details.wxss | 6 + pages/mall/mall_order/mall_order.js | 90 ++++--- pages/mall/mall_order/mall_order.json | 5 +- pages/mall/mall_order/mall_order.wxml | 29 ++- pages/mall/mall_order/mall_order.wxss | 20 ++ pages/mall/mall_order_data/mall_order_data.js | 16 +- .../mall/mall_order_data/mall_order_data.wxml | 20 +- .../mall_order_submit/mall_order_submit.js | 98 +++++--- pages/mall/mall_pay/mall_pay.js | 59 ++--- pages/mall/mall_refund/mall_refund.js | 131 ++++++++++ pages/mall/mall_refund/mall_refund.json | 4 + pages/mall/mall_refund/mall_refund.wxml | 87 +++++++ pages/mall/mall_refund/mall_refund.wxss | 223 ++++++++++++++++++ project.config.json | 7 + 18 files changed, 782 insertions(+), 158 deletions(-) create mode 100644 pages/mall/mall_refund/mall_refund.js create mode 100644 pages/mall/mall_refund/mall_refund.json create mode 100644 pages/mall/mall_refund/mall_refund.wxml create mode 100644 pages/mall/mall_refund/mall_refund.wxss diff --git a/apis/interfaces/order.js b/apis/interfaces/order.js index c49d8d7..cc381a9 100644 --- a/apis/interfaces/order.js +++ b/apis/interfaces/order.js @@ -5,14 +5,17 @@ import {req} from "../request" -const index = () => req({url: "orders"}) //全部订单 -const unpaid = () => req({url: "orders/unpaid"}) //待付款 -const paid = () => req({url: "orders/paid"}) //待发货 -const delive = () => req({url: "orders/delivered"}) //待收货 -const refund = () => req({url: "orders/refunds"}) //退款 -const cancel = (orderId) => req({url: "orders/cancel/" + orderId}) //取消订单 -const orders = (orderId) => req({url: "orders/" + orderId}) //订单-详情 -const paymen = (orderId) => req({url: "payments/order/" + orderId}) //订单支付-详情 +const index = data => req({url: "orders", data: data}) //全部订单 +const unpaid = () => req({url: "orders/unpaid"}) //待付款 +const paid = () => req({url: "orders/paid"}) //待发货 +const delive = () => req({url: "orders/delivered"}) //待收货 +const refund = () => req({url: "orders/refunds"}) //退款 +const cancel = (orderId) => req({url: "orders/cancel/" + orderId}) //取消订单 +const orders = (orderId) => req({url: "orders/" + orderId}) //订单-详情 +const paymen = (orderId) => req({url: "payments/order/" + orderId}) //订单支付-详情 +const sign = (orderId) => req({url: "orders/sign/" + orderId}) //订单签收 +const goosRefund = (orderId) => req({url: "orders/refund/" + orderId}) //订单退货 +const formRefund = (orderId,data) => req({url: "orders/refund/" + orderId, method: "POST", data: data}) //订单退货-提交 export default({ index, @@ -22,5 +25,9 @@ export default({ refund, cancel, orders, - paymen + paymen, + sign, + refund, + goosRefund, + formRefund }) \ No newline at end of file diff --git a/app.json b/app.json index 65f1f83..1fec665 100644 --- a/app.json +++ b/app.json @@ -8,9 +8,26 @@ "pages/login/login", "pages/card/index", "pages/user/index", + "pages/user/user_coupon/user_coupon", + "pages/user/user_coupon_data/user_coupon_data", "pages/mall/index", + "pages/mall/mall_address/mall_address", + "pages/mall/mall_address_form/mall_address_form", + "pages/mall/mall_assess/mall_assess", + "pages/mall/mall_assess_form/mall_assess_form", + "pages/mall/mall_cart/mall_cart", + "pages/mall/mall_classify/mall_classify", + "pages/mall/mall_details/mall_details", + "pages/mall/mall_goods/mall_goods", + "pages/mall/mall_order/mall_order", + "pages/mall/mall_order_data/mall_order_data", + "pages/mall/mall_order_submit/mall_order_submit", + "pages/mall/mall_pay/mall_pay", + "pages/mall/mall_search/mall_search", + "pages/mall/mall_video/mall_video", "pages/live/index", "pages/ticket/index", + "pages/ticket/goods/goods", "pages/home/index", "pages/home/companyInfo/companyInfo", "pages/home/noticeDetail/noticeDetail", @@ -20,7 +37,8 @@ "pages/home/beSureOrder/beSureOrder", "pages/home/companyMore/companyMore", "pages/home/projectSuccess/projectSuccess", - "pages/home/activeSuccess/activeSuccess" + "pages/home/activeSuccess/activeSuccess", + "pages/mall/mall_refund/mall_refund" ], "window": { "backgroundTextStyle": "light", diff --git a/pages/mall/mall_cart/mall_cart.js b/pages/mall/mall_cart/mall_cart.js index 0a06cf4..f58a272 100644 --- a/pages/mall/mall_cart/mall_cart.js +++ b/pages/mall/mall_cart/mall_cart.js @@ -66,22 +66,24 @@ Page({ if(i.is_check){ sellerLength++ if(sellerLength == goodsList.length){ - this.setData({ - allCheckbox: true - }) + goodsList[goodsIndex].is_check = true + // this.setData({ + // allCheckbox: true + // }) } }else{ - if(this.data.allCheckbox){ - this.setData({ - allCheckbox: false - }) - } + goodsList[goodsIndex].is_check = false + this.setData({ + allCheckbox: false + }) } } this.setData({ carArr : goodsList }) + this.allCheckbox('checkbox') + // 获取计算价格 this.totalPrice() }, @@ -89,25 +91,35 @@ Page({ /** * 全选 */ - allCheckbox(){ - let bagList = this.data.carArr, + allCheckbox(type){ + let goodsList = this.data.carArr, + goodsLenght = 0, allCheckbox = this.data.allCheckbox - + + if (type == 'checkbox'){ + for (let j in goodsList) { + if (goodsList[j].is_check) { + goodsLenght++ + if (goodsLenght == goodsList.length) { + allCheckbox = true + } + } + } + }else{ allCheckbox = !allCheckbox - for(let i of bagList){ - i.is_check = allCheckbox + for (var i in goodsList){ + goodsList[i].is_check = allCheckbox + } } + this.setData({ - paramsCart : params, allCheckbox : allCheckbox, - carArr : bagList + carArr : goodsList }) - console.log(this.data.paramsCart) - // 获取计算价格 this.totalPrice() }, @@ -160,6 +172,7 @@ Page({ goodsList = this.data.carArr for (let i of goodsList){ + console.log(goodsList) if(i.is_check){ bagNumber = bagNumber + i.number allPrice = allPrice + i.total diff --git a/pages/mall/mall_details/mall_details.wxml b/pages/mall/mall_details/mall_details.wxml index 4b12036..0da9738 100644 --- a/pages/mall/mall_details/mall_details.wxml +++ b/pages/mall/mall_details/mall_details.wxml @@ -141,10 +141,13 @@ 1 - + 加入购物车 立即购买 + + 暂无库存 + @@ -171,7 +174,9 @@ {{item.title}}无门槛免费使用 - + 立即领取 @@ -193,7 +198,8 @@ - {{item.title}}{{item.type_text == '免费券' ? '免费券' : item.full}} + + {{item.title}}{{item.type_text == '免费券' ? '免费券' : item.full}} 立即领取 {{item.start_at}} - {{item.end_at}} @@ -252,23 +258,24 @@ - - 分享 - - - - - - - 好物推荐,和大家一起分享你发现的好物 - + + 分享 + + + + + + + + 好物推荐,和大家一起分享你发现的好物 + \ No newline at end of file diff --git a/pages/mall/mall_details/mall_details.wxss b/pages/mall/mall_details/mall_details.wxss index f468ff9..e395575 100644 --- a/pages/mall/mall_details/mall_details.wxss +++ b/pages/mall/mall_details/mall_details.wxss @@ -440,6 +440,12 @@ view.footer-btn-buy { background-color: #f97b35; } +.footer-btn-stock { + width: 100% !important; + background-color: #999; + color: #eee; +} + /* 优惠券弹出层 */ .couponBack, .specsBack { diff --git a/pages/mall/mall_order/mall_order.js b/pages/mall/mall_order/mall_order.js index c5230ab..b44cd03 100644 --- a/pages/mall/mall_order/mall_order.js +++ b/pages/mall/mall_order/mall_order.js @@ -10,8 +10,10 @@ Page({ * 页面的初始数据 */ data: { - stateType : 'all', //订单类型 - orderArr : [], //订单列表 + stateType : 'index', //订单类型 + orderArr : [], //订单列表 + page : {}, //分页信息 + lodingStats : false //加载状态 }, /** @@ -47,41 +49,22 @@ Page({ /** * 订单列表 */ - orderInfo(){ + orderInfo(page){ let stateType = this.data.stateType - - if(stateType == 'all') { - wx.$api.order.index().then(res=>{ - this.setData({ - orderArr : res.data - }) + wx.$api.order[stateType]({ + page : page || '' + }).then(res=>{ + console.log(res) + let listArr = this.data.orderArr, + newData = [] + if(page == 1 || page == undefined) listArr = [] + newData = listArr.concat(res.data) + this.setData({ + orderArr : newData, + page : res.page, + lodingStats : false }) - } else if(stateType == 'unpaid') { - wx.$api.order.unpaid().then(res=>{ - this.setData({ - orderArr : res.data - }) - }) - } else if(stateType == 'paid') { - wx.$api.order.paid().then(res=>{ - this.setData({ - orderArr : res.data - }) - }) - } else if(stateType == 'delive') { - wx.$api.order.delive().then(res=>{ - this.setData({ - orderArr : res.data - }) - }) - } else if(stateType == 'refunds') { - wx.$api.order.refund().then(res=>{ - this.setData({ - orderArr : res.data - }) - }) - } - + }) }, /** @@ -100,9 +83,44 @@ Page({ */ orderDelete(e) { let orderId = e.currentTarget.dataset.orderid - wx.$api.orders.cancel(orderId).then(res=>{ + wx.$api.order.cancel(orderId).then(res=>{ // 获取列表 this.orderInfo() }) }, + + /** + * 签收订单 + */ + orderSign(e) { + let orderId = e.currentTarget.dataset.orderid + wx.$api.order.sign(orderId).then(res=>{ + // 获取列表 + this.orderInfo() + }) + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh() { + // 获取订单列表 + this.orderInfo() + }, + + /** + * 上拉加载 + */ + onReachBottom(){ + this.setData({ + lodingStats: true + }) + let pageNumber = this.data.page.current + if(this.data.page.has_more){ + pageNumber++ + + // 获取订单列表 + this.orderInfo(pageNumber) + } + } }) \ No newline at end of file diff --git a/pages/mall/mall_order/mall_order.json b/pages/mall/mall_order/mall_order.json index 24dafe1..2ccbdb7 100644 --- a/pages/mall/mall_order/mall_order.json +++ b/pages/mall/mall_order/mall_order.json @@ -1,4 +1,5 @@ { - "usingComponents" : {}, - "navigationBarTitleText" : "订单列表" + "usingComponents" : {}, + "navigationBarTitleText" : "订单列表", + "enablePullDownRefresh" : true } \ No newline at end of file diff --git a/pages/mall/mall_order/mall_order.wxml b/pages/mall/mall_order/mall_order.wxml index cc0b101..fc726c1 100644 --- a/pages/mall/mall_order/mall_order.wxml +++ b/pages/mall/mall_order/mall_order.wxml @@ -1,6 +1,6 @@ - + 全部 @@ -12,8 +12,9 @@ 待收货 - - 已完成 + + 申请退款 + @@ -22,7 +23,7 @@ {{goods.orderid}} - + {{goods.state_text}} @@ -39,13 +40,27 @@ - 立即支付 + 立即支付 取消订单 - 订单详情 + + 立即签收 + + 申请退款 + 订单详情 + + + 加载中... + + + 没有更多了~ + + diff --git a/pages/mall/mall_order/mall_order.wxss b/pages/mall/mall_order/mall_order.wxss index 1cde509..d017a41 100644 --- a/pages/mall/mall_order/mall_order.wxss +++ b/pages/mall/mall_order/mall_order.wxss @@ -156,3 +156,23 @@ page { border-color: #eb532a; color: #eb532a; } + +/* +* 页面信息提醒 +*/ + +.pages-loding { + text-align: center; + color: #747788; + font-size: 28rpx; + background: white; +} + +.pages-loding image { + width: 38rpx; + height: 38rpx; +} + +.pagesLoding { + text-align: center; +} \ No newline at end of file diff --git a/pages/mall/mall_order_data/mall_order_data.js b/pages/mall/mall_order_data/mall_order_data.js index 235eb12..bae756c 100644 --- a/pages/mall/mall_order_data/mall_order_data.js +++ b/pages/mall/mall_order_data/mall_order_data.js @@ -18,7 +18,6 @@ Page({ * 生命周期函数--监听页面加载 */ onLoad (options) { - console.log(options.orderId) this.orderData(options.orderId) }, @@ -52,6 +51,9 @@ Page({ }) }, + /** + * 返回订单 + */ orderRun() { wx.navigateBack({ delta: 1, @@ -80,4 +82,16 @@ Page({ }) }) }, + + /** + * 签收订单 + */ + orderSign(e) { + let orderId = e.currentTarget.dataset.orderid + wx.$api.order.sign(orderId).then(res=>{ + wx.redirectTo({ + url: '/pages/mall/mall_order/mall_order', + }) + }) + }, }) \ No newline at end of file diff --git a/pages/mall/mall_order_data/mall_order_data.wxml b/pages/mall/mall_order_data/mall_order_data.wxml index 64c7e75..3edf314 100644 --- a/pages/mall/mall_order_data/mall_order_data.wxml +++ b/pages/mall/mall_order_data/mall_order_data.wxml @@ -18,7 +18,7 @@ {{orderData.type_text}} - + @@ -58,14 +58,14 @@ 运费 ¥{{orderData.freight}} - - 需付款 + 优惠 + ¥{{orderData.coupons_all_price}} + + + 实际付款 - ¥{{orderData.amount}} + ¥{{orderData.total}} @@ -82,7 +82,11 @@ 立即支付 - + + 立即签收 + + 申请退款 + 返回订单 diff --git a/pages/mall/mall_order_submit/mall_order_submit.js b/pages/mall/mall_order_submit/mall_order_submit.js index e40f72a..f5a148f 100644 --- a/pages/mall/mall_order_submit/mall_order_submit.js +++ b/pages/mall/mall_order_submit/mall_order_submit.js @@ -107,7 +107,43 @@ Page({ remark : this.data.remark, address_id : this.data.addressDel.address_id }).then(res=>{ - console.log(res) + let trade_no = res.trade_no + // 获取code + wx.login({ + success: res=>{ + wx.$api.mall.wechat({ + code : res.code, + trade_no : trade_no + }).then(res=>{ + let payInfo = JSON.parse(res) + wx.requestPayment({ + timeStamp: payInfo.timeStamp, + nonceStr : payInfo.nonceStr, + package : payInfo.package, + paySign : payInfo.paySign, + signType : payInfo.signType, + success : res=>{ + if(res.errMsg == "requestPayment:ok"){ + wx.showToast({ + title: '支付成功', + icon : 'success' + }) + setTimeout(()=>{ + wx.reLaunch({ + url: '/pages/mall/mall_order/mall_order' + }) + },2000) + } + }, + fail : res=>{ + wx.reLaunch({ + url: '/pages/mall/mall_order/mall_order?stateType=unpaid' + }) + } + }) + }) + } + }) }) } else { wx.$api.mall.orderBuy({ @@ -117,35 +153,43 @@ Page({ remark : this.data.remark, address_id : this.data.addressDel.address_id }).then(res=>{ - wx.$api.mall.wechat({ - trade_no : res.trade_no - }).then(res=>{ - let payInfo = JSON.parse(res) - wx.requestPayment({ - timeStamp: payInfo.timeStamp, - nonceStr : payInfo.nonceStr, - package : payInfo.package, - paySign : payInfo.paySign, - signType : payInfo.signType, - success : res=>{ - if(res.errMsg == "requestPayment:ok"){ - wx.showToast({ - title: '支付成功', - icon : 'success' - }) - setTimeout(()=>{ + let trade_no = res.trade_no + + // 获取code + wx.login({ + success: res=>{ + wx.$api.mall.wechat({ + code : res.code, + trade_no : trade_no + }).then(res=>{ + let payInfo = JSON.parse(res) + wx.requestPayment({ + timeStamp: payInfo.timeStamp, + nonceStr : payInfo.nonceStr, + package : payInfo.package, + paySign : payInfo.paySign, + signType : payInfo.signType, + success : res=>{ + if(res.errMsg == "requestPayment:ok"){ + wx.showToast({ + title: '支付成功', + icon : 'success' + }) + setTimeout(()=>{ + wx.reLaunch({ + url: '/pages/mall/mall_order/mall_order' + }) + },2000) + } + }, + fail : res=>{ wx.reLaunch({ - url: '/pages/mall/mall_order/mall_order' + url: '/pages/mall/mall_order/mall_order?stateType=unpaid' }) - },2000) - } - }, - fail : res=>{ - wx.reLaunch({ - url: '/pages/mall/mall_order/mall_order?stateType=unpaid' + } }) - } - }) + }) + } }) }) } diff --git a/pages/mall/mall_pay/mall_pay.js b/pages/mall/mall_pay/mall_pay.js index 68ed375..34513a6 100644 --- a/pages/mall/mall_pay/mall_pay.js +++ b/pages/mall/mall_pay/mall_pay.js @@ -36,36 +36,41 @@ Page({ * 订单支付 */ payment() { - wx.$api.mall.wechat({ - trade_no : this.data.orderData.trade_no - }).then(res=>{ - console.log(res) - let payInfo = JSON.parse(res) - wx.requestPayment({ - timeStamp: payInfo.timeStamp, - nonceStr : payInfo.nonceStr, - package : payInfo.package, - paySign : payInfo.paySign, - signType : payInfo.signType, - success : res=>{ - if(res.errMsg == "requestPayment:ok"){ - wx.showToast({ - title: '支付成功', - icon : 'success' - }) - setTimeout(()=>{ + // 获取code + wx.login({ + success: res=>{ + wx.$api.mall.wechat({ + code : res.code, + trade_no : this.data.orderData.trade_no + }).then(res=>{ + let payInfo = JSON.parse(res) + wx.requestPayment({ + timeStamp: payInfo.timeStamp, + nonceStr : payInfo.nonceStr, + package : payInfo.package, + paySign : payInfo.paySign, + signType : payInfo.signType, + success : res=>{ + if(res.errMsg == "requestPayment:ok"){ + wx.showToast({ + title: '支付成功', + icon : 'success' + }) + setTimeout(()=>{ + wx.reLaunch({ + url: '/pages/mall/mall_order/mall_order?stateType=all' + }) + },2000) + } + }, + fail : res=>{ wx.reLaunch({ - url: '/pages/mall/mall_order/mall_order?stateType=all' + url: '/pages/mall/mall_order/mall_order?stateType=unpaid' }) - },2000) - } - }, - fail : res=>{ - wx.reLaunch({ - url: '/pages/mall/mall_order/mall_order?stateType=unpaid' + } }) - } - }) + }) + } }) } }) \ No newline at end of file diff --git a/pages/mall/mall_refund/mall_refund.js b/pages/mall/mall_refund/mall_refund.js new file mode 100644 index 0000000..a383a51 --- /dev/null +++ b/pages/mall/mall_refund/mall_refund.js @@ -0,0 +1,131 @@ +/* + * 手太欠 + * 企获客商城 + */ + +const app = getApp() +Page({ + + /** + * 页面的初始数据 + */ + data: { + orderId : '', //商品id + orderData : '', //退货商品 + refundTitle : [], //退货理由 + refundType : '', //退货类型 + refundIndex : 0, //退货理由index + title : '', //退款原因 + typeIndex : 0, //退货类型index + imgs : [], //图片页面显示 + paths : [], //图片上传服务器 + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad(options) { + this.setData({ + orderId: options.orderId + }) + wx.$api.order.goosRefund(options.orderId).then(res => { + console.log(res) + this.setData({ + orderData : res.order, + refundTitle : res.refund_title, + refundType : res.refund_type + }) + }) + + }, + + /** + *选择退款原因 + */ + refundChange(e) { + this.setData({ + refundIndex : e.detail.value + }) + }, + + /** + * 上传图片 + */ + + formUploadFile(){ + let count = 9 - this.data.imgs.length + wx.chooseImage({ + count : count, + success : res=>{ + // 上传图片 + if (res.tempFilePaths){ + let pathArr = res.tempFilePaths + wx.showLoading({ + title: '上传中', + }) + for (let i = 0; i < pathArr.length; i++){ + wx.$api.file.uploadImg(pathArr[i], {}).then(res=>{ + let imgArr = this.data.imgs, + pathArr = this.data.paths + imgArr.push(res.showpath) + pathArr.push(res.path) + this.setData({ + imgs : imgArr, + paths: pathArr + }) + }) + + if (i == pathArr.length - 1) { + wx.hideLoading() + } + } + }else{ + wx.showToast({ + title: '上传图片失败', + icon : 'none' + }) + } + } + }) + }, + + /** + * 删除图片 + */ + removeImg(e){ + let imgArr = this.data.imgs, + pathArr = this.data.paths, + index = e.currentTarget.dataset.index + + imgArr.splice(index, 1) + pathArr.splice(index, 1) + + this.setData({ + imgs : imgArr, + paths : pathArr + }) + }, + + /** + * 申请退货 + */ + refundSign(e) { + let refundTitle = this.data.refundTitle, + refundIndex = this.data.refundIndex, + remark = e.detail.value.remark, + paths = this.data.paths + + console.log(paths) + + wx.$api.order.formRefund(this.data.orderId,{ + title : refundTitle[refundIndex].title, + remark : remark, + type : 1, + pictures: paths + }).then(res => { + wx.redirectTo({ + url: '/pages/mall/mall_order/mall_order', + }) + }) + }, +}) \ No newline at end of file diff --git a/pages/mall/mall_refund/mall_refund.json b/pages/mall/mall_refund/mall_refund.json new file mode 100644 index 0000000..4f7775a --- /dev/null +++ b/pages/mall/mall_refund/mall_refund.json @@ -0,0 +1,4 @@ +{ + "usingComponents" : {}, + "navigationBarTitleText": "退款" +} \ No newline at end of file diff --git a/pages/mall/mall_refund/mall_refund.wxml b/pages/mall/mall_refund/mall_refund.wxml new file mode 100644 index 0000000..7a7f197 --- /dev/null +++ b/pages/mall/mall_refund/mall_refund.wxml @@ -0,0 +1,87 @@ +
+ + + + + + + {{item.title}} + {{item.value}} + 单价:{{item.price}} X {{item.qty}} + + + + + + + + 商品总金额 + + + + 运费 + + + + 优惠券抵扣 + + + + 实际支付金额 + + + + + + + + 退款金额 + + + + + + 选择退款原因 + + + {{refundTitle[refundIndex].remark}} + + + + + + + 退款类型 + + + + + + 退款原因 + + + + + + 添加图片 + + + + × + + + + + 添加图片 + + + + + + + + + + +
\ No newline at end of file diff --git a/pages/mall/mall_refund/mall_refund.wxss b/pages/mall/mall_refund/mall_refund.wxss new file mode 100644 index 0000000..5005c3b --- /dev/null +++ b/pages/mall/mall_refund/mall_refund.wxss @@ -0,0 +1,223 @@ +.refund-content { + padding-bottom: 190rpx; +} + +.refund-goods { + background-color: white; +} + +.refund-good { + position: relative; + padding: 15rpx 30rpx; + min-height: 198rpx; +} + +.refund-good::before { + position: absolute; + left: 30rpx; + right: 0; + height: 1rpx; + bottom: 1rpx; + content: " "; + background-color: #f5f5f5; + z-index: 9; +} + +.refund-good-cover { + height: 178rpx; + width: 178rpx; + background: #f6f6f6; + position: absolute; + left: 30rpx; + top: 15rpx; +} + +.refund-good-info { + padding-left: 198rpx; +} + +.refund-good-title { + font-weight: bold; + margin: 15rpx 0; + font-size: 32rpx; +} + +.refund-good-value { + line-height: 40rpx; + font-size: 28rpx; + color: gray; +} + +.refund-good-price { + line-height: 40rpx; + color: gray; + font-size: 28rpx; + padding-top: 10rpx; +} + +.refund-good-price text { + color: red; + font-weight: bold; + font-size: 32rpx; +} + +/* 统计信息 */ +.refundTitle-item { + display: flex; +} + +.refundTitle-item picker { + flex: 1; + text-align: right; + color: #000; +} + +.refund-statistical { + background: white; +} + +.refund-statistical-item { + position: relative; + padding: 0 30rpx; + line-height: 90rpx; + color: gray; +} + +.refund-statistical-item::before { + position: absolute; + left: 30rpx; + right: 0; + height: 1rpx; + bottom: 1rpx; + content: " "; + background-color: #f5f5f5; + z-index: 9; +} + +.refund-statistical-item:last-child::before { + display: none; +} + +.refund-statistical-item-label { + position: absolute; + right: 30rpx; + top: 0; + width: 300rpx; + text-align: right; + color: #000; +} + +/* 退款 */ +.refund-info { + margin-top: 20rpx; +} + +.refund-info-item-label { + color: red; + font-weight: bold; +} + +.refund-info-item-text { + padding: 30rpx 30rpx 30rpx 30rpx; +} + +.refund-info-item-textarea { + width: 100%; + height: 150rpx; + margin-top: 20rpx; +} + +/* footer */ +.refund-footer { + background: white; + position: fixed; + bottom: 0; + left: 0; + right: 0; + padding: 20rpx 30rpx 30rpx 30rpx; + width: 100%; + box-sizing: border-box; + z-index: 9999; +} + +.refund-footer-btn[size="mini"] { + background: #eb532a; + width: 100%; + height: 90rpx; + line-height: 90rpx; + color: white; + font-size: 32rpx; +} + + +/* 多图上传 */ + +.issue-info-img { + padding: 20rpx 0; + display: flex; + flex-wrap: wrap; + margin: 0 -10rpx; +} + +.issue-info-img-itme { + width: calc(33.33% - 20rpx); + padding-top: calc(33.33% - 20rpx); + box-sizing: border-box; + position: relative; + margin: 10rpx; +} + +.issue-info-img-itme>image { + width: 100%; + height: calc(100% - 20rpx); + height: -webkit-calc(100% - 20rpx); + position: absolute; + top: 10rpx; + left: 0; +} + +.issue-info-img-remove { + position: absolute; + z-index: 5; + top: -5rpx; + right: -6rpx; + height: 36rpx; + width: 36rpx; + text-align: center; + line-height: 34rpx; + background: #ec202c; + color: white; + font-size: 28rpx; + font-weight: bold; + border-radius: 50%; +} + +.issue-info-img-add { + position: absolute; + top: 10rpx; + bottom: 10rpx; + width: 100%; + left: 0; + text-align: center; + background: #f3f4f8; + color: #8d8d8d; + font-size: 24rpx; + display: -webkit-box; + -webkit-box-orient: vertical; + -webkit-box-pack: center; +} + +.issue-info-img-add image { + width: 100rpx; + height: 100rpx; + vertical-align: bottom; + margin-bottom: 15rpx; + margin-top: 15rpx; +} + +.issue-info-img-hint { + line-height: 60rpx; + color: #666; + font-size: 26rpx; + padding: 0 30rpx 15rpx 30rpx; +} diff --git a/project.config.json b/project.config.json index ad5d907..87dc3de 100644 --- a/project.config.json +++ b/project.config.json @@ -76,6 +76,13 @@ { "name": "商城", "pathName": "pages/mall/index", + "query": "", + "scene": null + }, + { + "name": "pages/user/index", + "pathName": "pages/user/index", + "query": "", "scene": null } ] From e93ee1ed174e9dae4f281b78ad2f66b040c445ba Mon Sep 17 00:00:00 2001 From: zdx <731335498@qq.com> Date: Mon, 28 Dec 2020 17:25:45 +0800 Subject: [PATCH 2/3] beifen --- apis/interfaces/home.js | 10 ++ app.json | 62 +++---- pages/home/activeSuccess/activeSuccess.js | 50 +----- pages/home/beSureOrder/beSureOrder.js | 97 ++++++----- pages/home/index.js | 19 ++- pages/home/projectReturn/projectReturn.wxss | 2 +- pages/home/projectSuccess/projectSuccess.js | 7 +- pages/home/projectSuccess/projectSuccess.wxss | 4 + pages/user/companyMine/companyOrder.js | 4 +- pages/user/companyMine/companyOrder.wxml | 40 +++-- pages/user/companyMine/companyOrder.wxss | 56 ++++++- pages/user/companyMine/companyOrder1 (2).js | 108 ++++++++++++ pages/user/companyMine/companyOrder1 (2).json | 6 + pages/user/companyMine/companyOrder1 (2).wxml | 54 ++++++ pages/user/companyMine/companyOrder1 (2).wxss | 154 ++++++++++++++++++ .../focusedProject/focusedProject.js | 84 ++++++++++ .../focusedProject/focusedProject.json | 6 + .../focusedProject/focusedProject.wxml | 12 ++ .../focusedProject/focusedProject.wxss | 59 +++++++ pages/user/companyMine/myActives/myActives.js | 5 +- pages/user/index.wxml | 9 +- 21 files changed, 703 insertions(+), 145 deletions(-) create mode 100644 pages/user/companyMine/companyOrder1 (2).js create mode 100644 pages/user/companyMine/companyOrder1 (2).json create mode 100644 pages/user/companyMine/companyOrder1 (2).wxml create mode 100644 pages/user/companyMine/companyOrder1 (2).wxss create mode 100644 pages/user/companyMine/focusedProject/focusedProject.js create mode 100644 pages/user/companyMine/focusedProject/focusedProject.json create mode 100644 pages/user/companyMine/focusedProject/focusedProject.wxml create mode 100644 pages/user/companyMine/focusedProject/focusedProject.wxss diff --git a/apis/interfaces/home.js b/apis/interfaces/home.js index 1bdd8e2..bb9cf4a 100644 --- a/apis/interfaces/home.js +++ b/apis/interfaces/home.js @@ -26,6 +26,14 @@ const crowdfunds = (company_id, category_id, page) => req({ const crowdfundsDetail = crowdfund_id => req({ url: "crowdfunds/" + crowdfund_id }) +// 获取关注列表 +const getCrowdfundsLike = page => req({ + url: "user/crowdfunds", + method: "get", + data: { + page: page + } +}) //项目关注 const crowdfundsLike = crowdfund_id => req({ url: "crowdfunds/like", @@ -148,10 +156,12 @@ const signed = (active_id) => req({ + export default ({ crowdfundcategory, //项目筹集分类 crowdfunds, //根据项目筹集获取列表 crowdfundsDetail, //项目详情 + getCrowdfundsLike, //获取已关注列表 crowdfundsLike, //关注项目 crowdfundsUnLike, //取消关注项目 crowdfundsCreat, //获取确认订单信息 diff --git a/app.json b/app.json index 4c76a63..e89c8e9 100644 --- a/app.json +++ b/app.json @@ -1,34 +1,36 @@ { - "pages": [ - "pages/user/index", - "pages/user/companyMine/myActives/myActives", - "pages/welcome/index", - "pages/company/index", - "pages/company/search/search", - "pages/shortVideo/index", - "pages/richText/richText", - "pages/login/login", - "pages/card/index", - "pages/mall/index", - "pages/live/index", - "pages/ticket/index", - "pages/home/index", - "pages/home/companyInfo/companyInfo", - "pages/home/noticeDetail/noticeDetail", - "pages/home/activeDetail/activeDetail", - "pages/home/projectDetail/projectDetail", - "pages/home/projectReturn/projectReturn", - "pages/home/beSureOrder/beSureOrder", - "pages/home/companyMore/companyMore", - "pages/home/projectSuccess/projectSuccess", - "pages/home/activeSuccess/activeSuccess" + "pages": [ + "pages/user/companyMine/companyOrder", + "pages/welcome/index", + "pages/company/index", + "pages/company/search/search", + "pages/shortVideo/index", + "pages/richText/richText", + "pages/login/login", + "pages/card/index", + "pages/mall/index", + "pages/live/index", + "pages/ticket/index", + "pages/user/index", + "pages/user/companyMine/myActives/myActives", + "pages/user/companyMine/focusedProject/focusedProject", + "pages/home/index", + "pages/home/companyInfo/companyInfo", + "pages/home/noticeDetail/noticeDetail", + "pages/home/activeDetail/activeDetail", + "pages/home/projectDetail/projectDetail", + "pages/home/projectReturn/projectReturn", + "pages/home/beSureOrder/beSureOrder", + "pages/home/companyMore/companyMore", + "pages/home/projectSuccess/projectSuccess", + "pages/home/activeSuccess/activeSuccess" ], "window": { - "backgroundTextStyle": "light", - "navigationBarBackgroundColor": "#fff", - "navigationBarTitleText": "", - "navigationBarTextStyle": "black" - }, - "style": "v2", - "sitemapLocation": "sitemap.json" + "backgroundTextStyle": "light", + "navigationBarBackgroundColor": "#fff", + "navigationBarTitleText": "", + "navigationBarTextStyle": "black" + }, + "style": "v2", + "sitemapLocation": "sitemap.json" } \ No newline at end of file diff --git a/pages/home/activeSuccess/activeSuccess.js b/pages/home/activeSuccess/activeSuccess.js index 7649127..c425aec 100644 --- a/pages/home/activeSuccess/activeSuccess.js +++ b/pages/home/activeSuccess/activeSuccess.js @@ -19,51 +19,13 @@ Page({ }, /** - * 生命周期函数--监听页面初次渲染完成 + * 跳转个人中心 */ - onReady: function () { - + beSure: function () { + wx.navigateTo({ + url: '/pages/user/companyMine/myActives/myActives', + }) }, - /** - * 生命周期函数--监听页面显示 - */ - onShow: function () { - - }, - - /** - * 生命周期函数--监听页面隐藏 - */ - onHide: function () { - - }, - - /** - * 生命周期函数--监听页面卸载 - */ - onUnload: function () { - - }, - - /** - * 页面相关事件处理函数--监听用户下拉动作 - */ - onPullDownRefresh: function () { - - }, - - /** - * 页面上拉触底事件的处理函数 - */ - onReachBottom: function () { - - }, - - /** - * 用户点击右上角分享 - */ - onShareAppMessage: function () { - - } + }) \ No newline at end of file diff --git a/pages/home/beSureOrder/beSureOrder.js b/pages/home/beSureOrder/beSureOrder.js index 6fcac25..9339f00 100644 --- a/pages/home/beSureOrder/beSureOrder.js +++ b/pages/home/beSureOrder/beSureOrder.js @@ -5,7 +5,7 @@ Page({ info: '', remark: '', crowdfund_id: '', - addressDel: {}, + addressDel:'', }, onLoad(e) { @@ -41,50 +41,63 @@ Page({ title: '创建中...', mask: 'true' }) - wx.$api.companyModule.crowdfundsCreatOrder(this.data.crowdfund_item_id, this.data.addressDel.address_id, this.data.remark).then(res => { - var data = {}; - if (res.trade_no) { - wx.login({ - success: res1 => { - data = { - trade_no: res.trade_no, - code: res1.code - } - wx.$api.companyModule.wechat(data).then(res => { - var ress = JSON.parse(res); - wx.hideLoading({}); - wx.requestPayment({ - timeStamp: ress.timeStamp, - nonceStr: ress.nonceStr, - package: ress.package, - signType: 'MD5', - paySign: ress.paySign, - success: res => { - wx.showToast({ - title: '创建订单成功', - }) - wx.navigateTo({ - url: '/pages/home/projectSuccess/projectSuccess?crowdfund_id=' + this.data.crowdfund_id, - }) - }, - fail(res) { - wx.showToast({ - title: '支付失败', - }) - } + if (this.data.addressDel) { + wx.$api.companyModule.crowdfundsCreatOrder(this.data.crowdfund_item_id, this.data.addressDel.address_id, this.data.remark).then(res => { + var data = {}; + if (res.trade_no) { + wx.login({ + success: res1 => { + data = { + trade_no: res.trade_no, + code: res1.code + } + wx.$api.companyModule.wechat(data).then(res => { + var ress = JSON.parse(res); + wx.hideLoading({}); + wx.requestPayment({ + timeStamp: ress.timeStamp, + nonceStr: ress.nonceStr, + package: ress.package, + signType: 'MD5', + paySign: ress.paySign, + success: res => { + wx.showToast({ + title: '创建订单成功', + }) + wx.navigateTo({ + url: '/pages/home/projectSuccess/projectSuccess?crowdfund_id=' + this.data.crowdfund_id, + }) + }, + fail(res) { + wx.showToast({ + title: '支付失败', + }) + } + }) + }).catch(res => { + console.log(res) }) - }).catch(res => { - console.log(res) - }) - } - }) - } - }).catch(res => { - wx.navigateBack({}) - }) + } + }) + } + }).catch(res => { + wx.navigateBack({}) + }) + } else { + wx.hideLoading({ + success: (res) => { + wx.showToast({ + icon: 'none', + title: '请选择收货地址', + duration: 2000 + }) + }, + }) + + } }, // 跳转到地址列表和新增地址页面 - goAddress(){ + goAddress() { wx.navigateTo({ url: '/pages/mall/mall_address/mall_address?type=selectAddress', }) diff --git a/pages/home/index.js b/pages/home/index.js index 818cf6b..efdf1dc 100644 --- a/pages/home/index.js +++ b/pages/home/index.js @@ -7,10 +7,9 @@ Page({ selectMenuId: 0, //默认是企业信息0 视频1 活动2 项目筹集3 company_id: wx.getStorageSync('company_id'), //企业Id, info: '', //企业信息 - loaded:false - }, - onLoad(e) { + loaded: false }, + onLoad(e) {}, onShow() { this.company(wx.getStorageSync('company_id')) }, @@ -57,12 +56,20 @@ Page({ * 请求项目筹集分类接口 */ company() { + wx.showLoading({ + title: 'title', + mask: 'true' + }) wx.$api.companyModule.company(this.data.company_id, this.data.page).then(res => { - console.log(res) this.setData({ info: res, - loaded:true, + loaded: true, }) + wx.hideLoading({}) + }).catch(res => { + if(res.status_code=='404'){ + // this.company(wx.getStorageSync('company_id')) + } }) }, @@ -77,7 +84,7 @@ Page({ /** * 进入商城 */ - goMall(e){ + goMall(e) { console.log('1111') wx.navigateTo({ url: '/pages/mall/index', diff --git a/pages/home/projectReturn/projectReturn.wxss b/pages/home/projectReturn/projectReturn.wxss index f1091f2..c238933 100644 --- a/pages/home/projectReturn/projectReturn.wxss +++ b/pages/home/projectReturn/projectReturn.wxss @@ -88,7 +88,7 @@ align-items: flex-start; box-sizing: border-box; padding: 20rpx 0; - border-bottom: solid 2rpx #f7f7f7; + border-bottom: solid 2rpx #f9f9f9; } .item_title{ diff --git a/pages/home/projectSuccess/projectSuccess.js b/pages/home/projectSuccess/projectSuccess.js index e8c2a9d..d80ff3b 100644 --- a/pages/home/projectSuccess/projectSuccess.js +++ b/pages/home/projectSuccess/projectSuccess.js @@ -32,6 +32,11 @@ Page({ } }, /** - * 跳转到个人 + * 跳转到订单列表 */ + beSure(){ + wx.navigateTo({ + url: '/pages/user/companyMine/companyOrder', + }) + } }) \ No newline at end of file diff --git a/pages/home/projectSuccess/projectSuccess.wxss b/pages/home/projectSuccess/projectSuccess.wxss index 6d1e741..e4f7c39 100644 --- a/pages/home/projectSuccess/projectSuccess.wxss +++ b/pages/home/projectSuccess/projectSuccess.wxss @@ -80,6 +80,10 @@ page { color: #fff; font-size: 34rpx; padding: 0 30rpx; + display:-webkit-box; + -webkit-line-clamp:3; + -webkit-box-orient:vertical; + overflow:hidden; } .share_content .des{ color: #fff; diff --git a/pages/user/companyMine/companyOrder.js b/pages/user/companyMine/companyOrder.js index 015fe61..ad3f62e 100644 --- a/pages/user/companyMine/companyOrder.js +++ b/pages/user/companyMine/companyOrder.js @@ -6,6 +6,7 @@ Page({ */ data: { type: 0, //全部0 待付款1 待发货2 待收货3 退款/售后4 + company_id:wx.getStorageSync('company_id') }, onLoad() { @@ -21,9 +22,6 @@ Page({ this.setData({ type: e.currentTarget.dataset.id }) - if (e.currentTarget.dataset.id == 3) { - this.selectComponent('#categoryTypeList').crowdfundcategory(this.data.company_id); - } } }, }) \ No newline at end of file diff --git a/pages/user/companyMine/companyOrder.wxml b/pages/user/companyMine/companyOrder.wxml index 42ed3e9..62557c5 100644 --- a/pages/user/companyMine/companyOrder.wxml +++ b/pages/user/companyMine/companyOrder.wxml @@ -1,16 +1,36 @@ - 全部 - 待付款 - 待发货 - 待收货 - 退款/售后 + 全部 + + + 待付款 + + 待发货 + + 待收货 + + 退款/售后 + + + 2020-11-22 13:30:00 待付款 + + + + 亲自跑到义乌,待会今年就新鲜上线亲自跑到义乌,待会今年就新鲜上线¥60.00 + 小饼干*4 + + + + 1件商品 实付:¥202.00 + 项目结束时间:2020-10-29 + + + + 取消订单 + 立即付款 + + \ No newline at end of file diff --git a/pages/user/companyMine/companyOrder.wxss b/pages/user/companyMine/companyOrder.wxss index ac6ccf0..9d81f53 100644 --- a/pages/user/companyMine/companyOrder.wxss +++ b/pages/user/companyMine/companyOrder.wxss @@ -3,6 +3,7 @@ background-color: #fff; box-shadow: 0 0rpx 10px rgba(0, 0, 0, 0.1); font-size: 28rpx; + margin-bottom: 20rpx; } .scroll-view_H { @@ -30,4 +31,57 @@ font-weight: 600; } -/* 列表 */ \ No newline at end of file +/* 列表 */ +.lists { + background-color: #fff; +} + +.top { + font-size: 28rpx; + color: #333; +} + +.top image { + width: 150rpx; + height: 150rpx; + border-radius: 10rpx; +} + +.top .ctime { + width: 100%; + display: flex; + flex-direction: row; + justify-content: space-between; + align-items: center; + box-sizing: border-box; + padding: 20rpx 30rpx; +} + +.top .ctime span { + color: #666; +} + +.top .content { + padding: 20rpx 30rpx; + display: flex; + flex-direction: row; + justify-content: flex-start; + align-items: flex-start; + box-sizing: border-box; +} + +.top .title { + display: flex; + flex-direction: row; + justify-content: space-between; + align-items: center; + box-sizing: border-box; +} + +.top .title .title1 { + overflow: hidden; + display: inline-block; + text-overflow: ellipsis; + white-space: nowrap; + width: 400rpx; +} \ No newline at end of file diff --git a/pages/user/companyMine/companyOrder1 (2).js b/pages/user/companyMine/companyOrder1 (2).js new file mode 100644 index 0000000..c5230ab --- /dev/null +++ b/pages/user/companyMine/companyOrder1 (2).js @@ -0,0 +1,108 @@ +/* + * 手太欠 + * 企获客商城 + */ + +const app = getApp() +Page({ + + /** + * 页面的初始数据 + */ + data: { + stateType : 'all', //订单类型 + orderArr : [], //订单列表 + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad (options) {}, + + /** + * 生命周期函数--监听页面显示 + */ + onShow: function () { + if(wx.getStorageSync("token") == ""){ + wx.navigateTo({ + url: '/pages/login/login' + }) + return + } + + // 获取订单列表 + this.orderInfo() + }, + + /** + * 订单tab + */ + orderTab(e){ + this.setData({ + stateType: e.currentTarget.dataset.state + }) + this.orderInfo() + }, + + /** + * 订单列表 + */ + orderInfo(){ + let stateType = this.data.stateType + + if(stateType == 'all') { + wx.$api.order.index().then(res=>{ + this.setData({ + orderArr : res.data + }) + }) + } else if(stateType == 'unpaid') { + wx.$api.order.unpaid().then(res=>{ + this.setData({ + orderArr : res.data + }) + }) + } else if(stateType == 'paid') { + wx.$api.order.paid().then(res=>{ + this.setData({ + orderArr : res.data + }) + }) + } else if(stateType == 'delive') { + wx.$api.order.delive().then(res=>{ + this.setData({ + orderArr : res.data + }) + }) + } else if(stateType == 'refunds') { + wx.$api.order.refund().then(res=>{ + this.setData({ + orderArr : res.data + }) + }) + } + + }, + + /** + * 订单支付 + */ + orderPay(e){ + let orderId = e.currentTarget.dataset.orderid + wx.navigateTo({ + url: '/pages/mall/mall_pay/mall_pay?orderid=' + orderId, + }) + + }, + + /** + * 取消订单 + */ + orderDelete(e) { + let orderId = e.currentTarget.dataset.orderid + wx.$api.orders.cancel(orderId).then(res=>{ + // 获取列表 + this.orderInfo() + }) + }, +}) \ No newline at end of file diff --git a/pages/user/companyMine/companyOrder1 (2).json b/pages/user/companyMine/companyOrder1 (2).json new file mode 100644 index 0000000..8d21f2a --- /dev/null +++ b/pages/user/companyMine/companyOrder1 (2).json @@ -0,0 +1,6 @@ +{ + "usingComponents": {}, + "navigationBarTitleText": "项目预购", + "navigationBarTextStyle": "white", + "navigationBarBackgroundColor": "#378fff" +} \ No newline at end of file diff --git a/pages/user/companyMine/companyOrder1 (2).wxml b/pages/user/companyMine/companyOrder1 (2).wxml new file mode 100644 index 0000000..c9599bf --- /dev/null +++ b/pages/user/companyMine/companyOrder1 (2).wxml @@ -0,0 +1,54 @@ + + + + 全部 + + + 待支付 + + + 待发货 + + + 待收货 + + + 已完成 + + + + + + + + {{goods.orderid}} + + + + {{goods.state_text}} + + + + + + {{item.title}} + + ¥{{item.price}} + 共{{item.qty}}件 + + + + + 立即支付 + 取消订单 + 订单详情 + + + + + + + 暂无订单 + \ No newline at end of file diff --git a/pages/user/companyMine/companyOrder1 (2).wxss b/pages/user/companyMine/companyOrder1 (2).wxss new file mode 100644 index 0000000..9ed17b8 --- /dev/null +++ b/pages/user/companyMine/companyOrder1 (2).wxss @@ -0,0 +1,154 @@ + +page { + background-color: #eee; +} + +/* 订单tab */ +.order-tab{ + position: fixed; + left: 0; + top: 0; + width: 100%; + display: flex; + height: 80rpx; + line-height: 80rpx; + z-index: 9; + background: white; +} + +.order-tab-item{ + font-size: 28rpx; + width: 20%; + text-align: center; + border-bottom: solid 2rpx #f7f7f7; + color: #464854; + background: white; + position: relative; +} + +.order-tab-item:after { + position: absolute; + content: ''; + left: calc(50% - 30rpx); + bottom: 0; + background-color: transparent; + width: 60rpx; + height: 8rpx; + border-radius: 50rpx; + color: #666666; +} + +.order-tab-item.active{ + color:#000; + font-weight: 600; +} + +.order-tab-item.active:after { + background-color: #378fff; +} + +/* 订单列表 */ +.order-content{ + border-bottom: solid 100rpx transparent; + padding: 80rpx 0 20rpx 0; +} + +.order-list { + background-color: white; + margin: 30rpx 0; +} + +.order-company { + display: flex; + line-height: 50rpx; + margin-bottom: 20rpx; + padding: 20rpx 30rpx; + box-sizing: border-box; +} + +.order-company-name { + font-weight: 600; + flex: 1; + display: flex; +} + +.order-logo { + width: 50rpx; + height: 50rpx; + margin-right: 20rpx; +} + +.order-arrow { + width: 28rpx; + height: 28rpx; + margin: 10rpx 0 10rpx 20rpx; +} + +.order-company-state { + color: #378fff; +} + +.order-goods { + position: relative; + padding: 0 30rpx; + box-sizing: border-box; +} + +.order-goods-img { + width: 160rpx; + height: 160rpx; + border-radius: 10rpx; +} + +.order-goods-text { + position: absolute; + padding-left: 220rpx; + padding-right: 30rpx; + right: 0; + top: 0; + left: 0; + width: 100%; + box-sizing: border-box; +} + +.order-goods-name { + height: 80rpx; + margin-bottom: 30rpx; +} + +.order-goods-price { + display: flex; + font-size: 28rpx; + color: #999999; +} + +.order-goods-price text { + flex: 1; + display: block; + font-size: 32rpx; + color: #000; +} + +.order-footer { + border-top: 2rpx solid #eee; + margin-top: 20rpx; + padding: 30rpx; + overflow: hidden; +} + +.order-footer-btn { + margin-left: 20rpx; + height: 60rpx; + line-height: 56rpx; + box-sizing: border-box; + border: solid 1rpx #dddddd; + padding: 0 20rpx; + font-size: 26rpx; + border-radius: 40rpx; + float: right; +} + +.order-footer-btn-back { + border-color: #378fff; + color: #378fff; +} diff --git a/pages/user/companyMine/focusedProject/focusedProject.js b/pages/user/companyMine/focusedProject/focusedProject.js new file mode 100644 index 0000000..c820175 --- /dev/null +++ b/pages/user/companyMine/focusedProject/focusedProject.js @@ -0,0 +1,84 @@ +// pages/user/companyMine/focusedProject/focusedProject.js +Page({ + + /** + * 页面的初始数据 + */ + data: { + lists: [], + page: 1, + has_more: true + }, + onShow() { + this.getList(); + }, + + // 获取活动列表 + getList() { + wx.$api.companyModule.getCrowdfundsLike(this.data.page).then(res => { + setTimeout(() => { + wx.hideLoading({}) + }, 1000); + var lists = this.data.lists.concat(res.data) + if (res.page.has_more) { + this.setData({ + has_more: res.page.has_more, + page: this.data.page + 1, + lists: lists + }) + } else { + this.setData({ + has_more: res.page.has_more, + lists: lists + }) + } + }) + }, + // 触底加载更多 + onReachBottom() { + if (this.data.has_more) { + this.getList(); + } else { + wx.showToast({ + icon: 'none', + title: '没有更多', + }) + } + }, + //跳转到详情页 + goUrl(e) { + wx.navigateTo({ + url: '/pages/home/activeDetail/activeDetail?id=' + e.currentTarget.dataset.id, + }) + }, + // 取消项目 + crowdfundsUnLike(e) { + var id = e.currentTarget.dataset.id + var index = e.currentTarget.dataset.index + var arr = this.data.lists + var temp = [] + for (var i = 0; i < arr.length; i++) { + if (i != index) { + temp.push(arr[i]); + } + } + console.log(temp) + wx.showModal({ + title: '提示', + content: '是否确认取消关注', + success: res => { + if (res.confirm) { + wx.showLoading({ + title: '取消中', + }) + wx.$api.companyModule.crowdfundsUnLike(id).then(res => { + this.setData({ + lists: temp + }) + wx.hideLoading({}) + }); + } + } + }) + } +}) \ No newline at end of file diff --git a/pages/user/companyMine/focusedProject/focusedProject.json b/pages/user/companyMine/focusedProject/focusedProject.json new file mode 100644 index 0000000..807cda9 --- /dev/null +++ b/pages/user/companyMine/focusedProject/focusedProject.json @@ -0,0 +1,6 @@ +{ + "usingComponents": {}, + "navigationBarTitleText": "项目关注", + "navigationBarTextStyle": "white", + "navigationBarBackgroundColor": "#378fff" +} \ No newline at end of file diff --git a/pages/user/companyMine/focusedProject/focusedProject.wxml b/pages/user/companyMine/focusedProject/focusedProject.wxml new file mode 100644 index 0000000..9a50915 --- /dev/null +++ b/pages/user/companyMine/focusedProject/focusedProject.wxml @@ -0,0 +1,12 @@ + + + + {{item.title}} + {{item.status_text}}取消关注 + + + + + + {{has_more?'~ 上拉加载更多 ~':'~ 暂无更多数据 ~'}} + \ No newline at end of file diff --git a/pages/user/companyMine/focusedProject/focusedProject.wxss b/pages/user/companyMine/focusedProject/focusedProject.wxss new file mode 100644 index 0000000..c38bb5b --- /dev/null +++ b/pages/user/companyMine/focusedProject/focusedProject.wxss @@ -0,0 +1,59 @@ +.content { + display: flex; + flex-direction: row; + justify-content: flex-start; + align-items: center; + box-sizing: border-box; + background-color: #fff; + padding: 10rpx 20rpx; + /* box-shadow: 0 0 5rpx rgba(0, 0, 0, 0.1); */ + height: 200rpx; + margin-top: 10rpx; +} + +.content>image { + width: 200rpx; + height: 150rpx; +} + +.content .left { + width: 100%; + margin-left: 20rpx; + box-sizing: border-box; +} + +.content .title { + height: 120rpx; + display: -webkit-box; + -webkit-line-clamp: 3; + -webkit-box-orient: vertical; + overflow: hidden; +} + +.content .bottom { + justify-content: space-between; + display: flex; + flex-direction: row; + align-items: stretch; + box-sizing: border-box; + font-size: 24rpx; + color: #999; + padding: 10rpx 0; +} + +.has_more { + color: #999; + font-size: 26rpx; + text-align: center; + padding: 30rpx; + display: flex; + flex-direction: column; + align-items: center; + justify-content: center; + box-sizing: border-box; + padding-top: 30rpx; +} + +.has_more image { + margin-bottom: 30rpx; +} \ No newline at end of file diff --git a/pages/user/companyMine/myActives/myActives.js b/pages/user/companyMine/myActives/myActives.js index 1be6ea1..fd07c36 100644 --- a/pages/user/companyMine/myActives/myActives.js +++ b/pages/user/companyMine/myActives/myActives.js @@ -43,7 +43,7 @@ Page({ if (res.page.has_more) { this.setData({ has_more: res.page.has_more, - page: page + 1, + page: this.data.page + 1, lists: lists }) } else { @@ -56,7 +56,6 @@ Page({ }, // 触底加载更多 onReachBottom() { - console.log('触底') if (this.data.has_more) { this.userActives(); } else { @@ -69,7 +68,7 @@ Page({ //跳转到详情页 goUrl(e) { wx.navigateTo({ - url: '/pages/companyModule/activeDetail/activeDetail?id=' + e.currentTarget.dataset.id, + url: '/pages/home/activeDetail/activeDetail?id=' + e.currentTarget.dataset.id, }) } }) \ No newline at end of file diff --git a/pages/user/index.wxml b/pages/user/index.wxml index 6351ba4..110d4d5 100644 --- a/pages/user/index.wxml +++ b/pages/user/index.wxml @@ -65,12 +65,12 @@ 活动参与 - + 项目预购 - + @@ -90,12 +90,13 @@ 收货地址 - + 项目关注 - + From cab9d7f7838fc53de6111d3f353a7e3e6379cb97 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E6=85=A2=E6=85=A2?= <994797151@qq.com> Date: Tue, 29 Dec 2020 09:31:50 +0800 Subject: [PATCH 3/3] =?UTF-8?q?[=E5=95=86=E5=93=81=E8=AF=A6=E6=83=85?= =?UTF-8?q?=E7=9A=84=E8=B4=AD=E7=89=A9=E8=BD=A6=E8=B7=B3=E8=BD=AC]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/mall/mall_details/mall_details.js | 9 +++++++++ pages/mall/mall_details/mall_details.wxml | 15 +++++++++------ pages/mall/mall_details/mall_details.wxss | 5 +++++ pages/mall/mall_order_submit/mall_order_submit.js | 4 ++-- 4 files changed, 25 insertions(+), 8 deletions(-) diff --git a/pages/mall/mall_details/mall_details.js b/pages/mall/mall_details/mall_details.js index 64d9690..c2897a8 100644 --- a/pages/mall/mall_details/mall_details.js +++ b/pages/mall/mall_details/mall_details.js @@ -285,8 +285,17 @@ Page({ * 用户点击右上角分享 */ onShareAppMessage() { + console.log(this.data.storyData.cover) this.setData({ shareShow: false }) + return({ + title : "#" + this.data.storyData.title, + path : '/pages/mall/mall_details/mall_details?id=' + this.data.storyData.id + '&nameList=share', + imageUrl: this.data.storyData.cover + }) + + // + '&share_user_id=' + app.globalData.userInfo.user_id || 0 }, + }) \ No newline at end of file diff --git a/pages/mall/mall_details/mall_details.wxml b/pages/mall/mall_details/mall_details.wxml index 0da9738..9194875 100644 --- a/pages/mall/mall_details/mall_details.wxml +++ b/pages/mall/mall_details/mall_details.wxml @@ -27,7 +27,9 @@ {{storyData.title}} {{storyData.description}} - + + + - + + @@ -135,10 +138,10 @@ 客服 - + 购物车 - 1 + @@ -270,12 +273,12 @@ 微信好友 -