commit e3a0666d5ab9c6d8ff6385ddf418c46b4d308e89 Author: quantulr <35954003+quantulr@users.noreply.github.com> Date: Mon May 6 15:34:15 2024 +0800 Initial Commit diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..14ea590 --- /dev/null +++ b/.gitignore @@ -0,0 +1,14 @@ +# Windows +[Dd]esktop.ini +Thumbs.db +$RECYCLE.BIN/ + +# macOS +.DS_Store +.fseventsd +.Spotlight-V100 +.TemporaryItems +.Trashes + +# Node.js +node_modules/ diff --git a/.idea/inspectionProfiles/Project_Default.xml b/.idea/inspectionProfiles/Project_Default.xml new file mode 100644 index 0000000..6560a98 --- /dev/null +++ b/.idea/inspectionProfiles/Project_Default.xml @@ -0,0 +1,36 @@ + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 0000000..893f829 --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,7 @@ + + + + + + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 0000000..7c2a7d0 --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/sphc.iml b/.idea/sphc.iml new file mode 100644 index 0000000..d6ebd48 --- /dev/null +++ b/.idea/sphc.iml @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..b2bdec2 --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/.idea/workspace.xml b/.idea/workspace.xml new file mode 100644 index 0000000..f5dc9d2 --- /dev/null +++ b/.idea/workspace.xml @@ -0,0 +1,171 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 手机号 + + + + + 验证码 + + + {{sendyzm}} + + + + 公司名 + {{company}} + 选择所属公司 + + + + + + 确认绑定 + + + + + + + + + + + + 搜索 + + + + + {{item.companyName}} + + + 暂无数据~ + + \ No newline at end of file diff --git a/pages/bindCompany/bindCompany.wxss b/pages/bindCompany/bindCompany.wxss new file mode 100644 index 0000000..125a479 --- /dev/null +++ b/pages/bindCompany/bindCompany.wxss @@ -0,0 +1,162 @@ +/* pages/bindCompany/bindCompany.wxss */ + +.top { + background: #f5f5f5; + width: 750rpx; + height: 286rpx; +} + +.top image { + width: 200rpx; + height: 200rpx; + margin: 40rpx 0rpx 0rpx 275rpx; +} + +.main { + background: #fff; + width: 750rpx; + border-radius: 40rpx 40rpx 0rpx 0rpx; +} + +.main-input { + width: 600rpx; + margin: 0 auto; +} + +.ipt { + width: 100%; + height: 90rpx; + margin-top: 30rpx; + border-bottom: 1rpx solid #dce1eb; +} +.input-text { + font-size: 28rpx; + color: #8e8e93; + width: 130rpx; +} +.int{ + color:#000; + font-size: 28rpx; + letter-spacing: 1rpx; + width: 300rpx; +} +.fsyl{ + padding: 0 10rpx; + height: 48rpx; + border-radius: 4rpx; + border: solid 2rpx #ee7b1e; + line-height: 48rpx; + text-align: center; + font-size: 24rpx; + color: #ee7b1e; +} +.check-jt{ + width: 26rpx; + height: 14rpx; +} +.btn{ + width: 690rpx; + height: 80rpx; + background-image: linear-gradient(-90deg, + #ee7b1e 0%, + #fdae03 100%); + border-radius: 40rpx; + font-size: 32rpx; + line-height: 80rpx; + color: #ffffff; + text-align: center; + margin: 240rpx 0rpx 0rpx 30rpx; +} +/* 遮罩层 */ + +.mask { + width: 100%; + height: 100%; + position: fixed; + top: 0; + left: 0; + background: #000; + z-index: 9000; + opacity: 0.5; +} + +/* 弹出层 */ + +.modalDlg { + width: 750rpx; + height: 911rpx; + background-color: #ffffff; + border-radius: 40rpx 40rpx 0rpx 0rpx; + position: fixed; + bottom: 0; + left: 0; + right: 0; + z-index: 9999; + display: flex; + flex-direction: column; +} + +.modal-title { + width: 690rpx; + height: 56rpx; + margin: 60rpx 30rpx; +} +.modal-title-view{ + background-color: #f3f4f8; + border-radius: 27rpx; + padding-right:20rpx; + height: 56rpx; +} +.search { + width: 35rpx; + height: 34rpx; + margin-left: 26rpx; + margin-right: 20rpx; +} +.search-int{ + width: 415rpx; + font-size: 28rpx; + color: #333; +} +.empty{ + margin: 150rpx auto 0; + text-align: center; + color: #ccc; + font-size: 28rpx; +} +.none{ + width: 32rpx; + height: 32rpx; +} +.search-right{ + width: 120rpx; + height: 56rpx; + background-color: #ee7b1e; + border-radius: 27rpx; + font-size: 32rpx; + color: #ffffff; + text-align: center; + line-height: 56rpx; +} +.modal-main { + width: 690rpx; + height: 620rpx; + overflow-y: scroll; + margin: 40rpx 0 0 30rpx; +} + +.modal-main::-webkit-scrollbar { + display: none; +} + +.modal-list-mk { + width: 690rpx; + height: 80rpx; + font-size: 32rpx; + color: #333333; + line-height: 80rpx; + text-align: center; +} +.text-xz{ + color: #ee7b1e; +} diff --git a/pages/cart/cart.js b/pages/cart/cart.js new file mode 100644 index 0000000..4249fc9 --- /dev/null +++ b/pages/cart/cart.js @@ -0,0 +1,353 @@ +// pages/cart/cart.js +const app = getApp(); +Page({ + + /** + * 页面的初始数据 + */ + data: { + checkNum: 0,//勾选数量 + checkAll: false,//全选 + cartData: [], + login: false, + price:0, + + }, + + //商品详情 + goodsDetails(e) { + let id = e.currentTarget.dataset.id; + wx.navigateTo({ + url: '/pages/goodsDetails/goodsDetails?goodsId=' + id, + }) + }, + + + //去购物 + goShop(e) { + wx.switchTab({ + url: '/pages/classify/classify' + }) + }, + onLoad: function (options) { + if (options.pId) { + wx.setStorage({ + data: options.pId, + key: 'pId', + }) + } + }, + + onShow: function () { + wx.getStorage({ + key: 'user', + success: s => { + wx.showLoading({ + title: '加载中..', + }) + wx.request({ + url: app.globalData.ip + '/wisdommining/api/goods/getCart', + method: 'POST', + header: { + "content-type": "application/x-www-form-urlencoded", + }, + data: { + userId: s.data.id + }, + success: res => { + wx.hideLoading() + console.log(res) + if (res.data.code == 1) { + this.setData({ + cartData: res.data.value, + }) + //判断全选 数量 + this.judgeCheckAll(); + if (res.data.value.length == 0) { + app.globalData.cartNum = ''; + wx.hideTabBarRedDot({ + index: 3 + }) + } else { + app.globalData.cartNum = res.data.value.length.toString() + //购物车数量显示 + wx.setTabBarBadge({ + index: 3, + text: app.globalData.cartNum + }) + } + } else { + wx.showModal({ + title: '提示!', + content: res.data.message, + showCancel: false, + }) + } + } + }) + } + }) + }, + + //结算 recommendedBulyPrice + pay() { + let goodsList = this.data.cartData; + let goods = []; + + for (let i = 0; i < goodsList.length; i++) { + goodsList[i].wisdGoods.wisdGoodsSpec.price = goodsList[i].wisdGoods.wisdGoodsSpec.specBulyPrice == null ? goodsList[i].wisdGoods.wisdGoodsSpec.specPrice : goodsList[i].wisdGoods.wisdGoodsSpec.specBulyPrice + if (goodsList[i].check) { + goods.push({ + isDiscount: goodsList[i].wisdGoods.isDiscount, + goodsPhoto: goodsList[i].wisdGoods.goodsPhoto, + goodsName: goodsList[i].wisdGoods.goodsName, + goodsId: goodsList[i].wisdGoods.id, + num: goodsList[i].goodsNum, + specs: goodsList[i].wisdGoods.wisdGoodsSpec + }) + } + } + if (goods.length == 0) { + return + } + wx.navigateTo({ + url: '/pages/cartPay/cartPay?goods=' + JSON.stringify(goods) + '&isCar=1', + }) + }, + + //加 减 + add(e) { + let id = e.currentTarget.dataset.id; + let type = e.currentTarget.dataset.type; + let index = e.currentTarget.dataset.index; + let cartData = this.data.cartData; + if (type == 2 && cartData[index].goodsNum <= 1) { + wx.showToast({ + title: '不能再减了~', + icon: 'none', + duration: 1000 + }) + return + } + wx.showLoading({ + title: '加载中..', + }) + wx.request({ + url: app.globalData.ip + '/wisdommining/api/goods/updateCartNum', + method: 'POST', + header: { + "content-type": "application/x-www-form-urlencoded", + }, + data: { + id: id, + type: type, + }, + success: res => { + wx.hideLoading() + console.log(res) + if (res.data.code == 1) { + if(type==1){ + cartData[index].goodsNum++ + }else{ + cartData[index].goodsNum-- + } + this.setData({ + cartData:cartData + }) + //判断全选 数量 + this.judgeCheckAll(); + } else { + wx.showModal({ + title: '提示!', + content: res.data.message, + showCancel: false, + }) + } + } + }) + }, + + //全选 + checkAll() { + this.setData({ + checkAll: !this.data.checkAll, + }) + let cartData = this.data.cartData; + for (let i = 0; i < cartData.length; i++) { + if (this.data.checkAll) { + cartData[i].check = true; + } else { + cartData[i].check = false; + } + } + this.setData({ + cartData: cartData, + + // total: total.toFixed(2), + // totalIntegral: total, + }) + //判断全选 数量 + this.judgeCheckAll(); + }, + + //勾选 + check(e) { + let index = e.currentTarget.dataset.index; + let cartData = this.data.cartData; + cartData[index].check = !cartData[index].check; + this.setData({ + cartData: cartData, + }) + //判断全选 数量 + this.judgeCheckAll(); + }, + + + + //判断全选 数量 + judgeCheckAll() { + + let cartData = this.data.cartData; + let all = 0; + let checkNum = 0; + let price = 0; + for (let i = 0; i < cartData.length; i++) { + if (!cartData[i].check) { + //有未选中 + all = 1; + } else { + + + let p = cartData[i].wisdGoods.wisdGoodsSpec.specBulyPrice==null?cartData[i].wisdGoods.wisdGoodsSpec.specPrice:cartData[i].wisdGoods.wisdGoodsSpec.specBulyPrice + checkNum++ + + + price = price + parseFloat((cartData[i].goodsNum*p ).toFixed(2)) + console.log(p) + + } + } + this.setData({ + checkNum: checkNum, + price:price + }) + if (all === 0) { + this.setData({ + checkAll: true, + }) + } else { + this.setData({ + checkAll: false, + }) + } + }, + + //删除 + del() { + if (this.data.checkNum == 0) { + wx.showToast({ + title: '请先选择商品~', + icon: 'none', + duration: 500 + }) + return + } + wx.showModal({ + title: '提示', + content: '您确认删除当前购物车中商品么?', + success: c => { + if (c.confirm) { + let shopCartId = ''; + for (var i = 0; i < this.data.cartData.length; i++) { + if (this.data.cartData[i].check) { + shopCartId = shopCartId + this.data.cartData[i].id + ','; + } + } + // shopCartId = shopCartId.substr(1); + console.log(shopCartId) + wx.showLoading({ + title: '删除中..', + mask: true, + }) + wx.request({ + url: app.globalData.ip + '/wisdommining/api/goods/delCart', + method: 'DELETE', + header: { + "content-type": "application/x-www-form-urlencoded", + }, + data: { + ids: shopCartId, + }, + success: res => { + console.log(res) + wx.hideLoading() + if (res.data.code == 1) { + wx.showToast({ + title: '删除成功', + success: e => { + setTimeout(() => { + this.onShow(); + }, 1500) + } + }) + } else { + wx.showModal({ + content: res.data.message, + showCancel: false, + }) + } + } + }) + } + } + }) + }, + + + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady: function () { + + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide: function () { + + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload: function () { + + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh: function () { + + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom: function () { + + }, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage: function () { + app.share(); + return { + path: '/pages/index/index?pId=' + app.globalData.userId, + title: '三品慧采小程序等你来~' + } + }, + +}) \ No newline at end of file diff --git a/pages/cart/cart.json b/pages/cart/cart.json new file mode 100644 index 0000000..b83a5b7 --- /dev/null +++ b/pages/cart/cart.json @@ -0,0 +1,4 @@ +{ + "usingComponents": {}, + "navigationBarTitleText": "购物车" +} \ No newline at end of file diff --git a/pages/cart/cart.wxml b/pages/cart/cart.wxml new file mode 100644 index 0000000..53cff1f --- /dev/null +++ b/pages/cart/cart.wxml @@ -0,0 +1,60 @@ + + + + + 共计{{cartData.length}}件商品 + 删除 + + + + + + + + + {{item.wisdGoods.goodsName}} + 规格:{{item.wisdGoods.wisdGoodsSpec.specName}} + + + ¥{{item.wisdGoods.wisdGoodsSpec.specBulyPrice==null?item.wisdGoods.wisdGoodsSpec.specPrice:item.wisdGoods.wisdGoodsSpec.specBulyPrice}} + ¥{{item.wisdGoods.wisdGoodsSpec.originalPrice}} + + + - + {{item.goodsNum}} + + + + + + + + + + + + 全选 + + + + + 共计:{{filters.toFix(price) }} + 去结算 + + + + + + + + 暂无商品,先去添加~ + 去购物 + + + + + 全选 + + 已选中0件商品 + 去结算 + + \ No newline at end of file diff --git a/pages/cart/cart.wxss b/pages/cart/cart.wxss new file mode 100644 index 0000000..24e3d71 --- /dev/null +++ b/pages/cart/cart.wxss @@ -0,0 +1,201 @@ +/* pages/cart/cart.wxss */ +page { + background-color: #f5f5f5; +} + +.data { + width: 690rpx; + background-color: #ffffff; + border-radius: 20rpx; + padding: 0 30rpx; + margin-top: 30rpx; +} + +.top { + font-size: 32rpx; + color: #333333; + height: 80rpx; + width: 100%; + line-height: 80rpx; +} + +.cont { + width: 100%; + padding: 30rpx 0; + border-bottom: 1rpx #dcdcdc solid; +} + +.cont:last-child { + border-bottom: none; +} + +.check { + width: 42rpx; +} + +.check image { + width: 42rpx; + height: 42rpx; +} + +.data-img { + width: 160rpx; + height: 160rpx; + border-radius: 10rpx; +} + +.name-price { + padding: 10rpx 0; + width: 430rpx; + display: flex; + flex-wrap: wrap; + align-content: space-between; +} + +.name-price>view { + width: 100%; +} + +.name-price .name { + font-size: 28rpx; + color: #333333; + width: 250rpx; +} + +.specName{ + font-size: 24rpx; + color: #999999; +} + +.price { + font-size: 36rpx; + color: #ee7b1e; +} + +.price text { + font-size: 24rpx; + color: #999999; + text-decoration: line-through; + margin-left: 10rpx; +} + +.num1 { + width: 40rpx; + height: 40rpx; + border: solid 2rpx #ff5502; + font-size: 28rpx; + text-align: center; + line-height: 40rpx; + border-radius: 50%; + color: #ff291e; +} + +.num3 { + width: 40rpx; + height: 40rpx; + border: solid 2rpx #ee7b1e; + background-color: #ee7b1e; + font-size: 28rpx; + text-align: center; + line-height: 40rpx; + border-radius: 50%; + color: #ffffff; +} + +.num2 { + font-size: 32rpx; + color: #0b0b0b; + height: 44rpx; + text-align: center; + line-height: 44rpx; + padding: 0 25rpx; +} + +.bom { + width: 690rpx; + padding: 0 30rpx; + height: 100rpx; + background-color: #ffffff; + border-radius: 20rpx 20rpx 0rpx 0rpx; + position: fixed; + bottom: 0; + left: 0; + z-index: 10; +} + +.bom-l { + font-size: 32rpx; + color: #999999; +} + +.bom-l image { + width: 42rpx; + height: 42rpx; + margin-right: 20rpx; +} + +.bom-m { + font-size: 28rpx; + color: #333333; +} +.bom-m text{ + color: #ee7b1e; +} +.bom-m text text{ + font-size: 36rpx; +} + +.bom-r { + width: 190rpx; + height: 60rpx; + line-height: 60rpx; + background-image: linear-gradient(-90deg, + #ee7b1e 0%, + #fdae03 100%); + border-radius: 30rpx; + font-size: 32rpx; + color: #ffffff; + text-align: center; +} + +/* 无 */ +.bom-r__empty{ + width: 190rpx; + height: 60rpx; + line-height: 60rpx; + background-color: #cccccc; + border-radius: 30rpx; + font-size: 32rpx; + color: #ffffff; + text-align: center; +} +.empty{ + width: 100%; +} +.empty-img{ + width: 300rpx; + height: 300rpx; + margin: 200rpx auto 40rpx; +} +.empty-img image{ + width:293rpx; + height: 317rpx; +} +.tips{ + font-size: 28rpx; + letter-spacing: 3rpx; + color: #bababa; + text-align: center; +} +.goShop{ + margin: 70rpx auto 0; + width: 180rpx; + height: 60rpx; + border-radius: 10rpx; + border: solid 2rpx #ee7b1e; + font-size: 28rpx; + letter-spacing: 3rpx; + color: #ee7b1e; + text-align: center; + line-height: 60rpx; +} diff --git a/pages/cartPay/cartPay.js b/pages/cartPay/cartPay.js new file mode 100644 index 0000000..1bb302e --- /dev/null +++ b/pages/cartPay/cartPay.js @@ -0,0 +1,757 @@ +// pages/cartPay/cartPay.js +import {monthDealWith} from '../../utils/date' +const app = getApp(); +Page({ + + /** + * 页面的初始数据 + */ + data: { + integral: 0, //积分 + goods: [], + reduceType: false, //优惠方式 + addressType: false, //收货方式 + reduceTypeXz: 0, //0不选 1现金券 2折扣券 + freight: 0, //运费 + discount: 0, //优惠 + payActual: 0, //实际支付 + note: '', + addressId: '', //地址ID + address: '选择收货方式', //地址 + province: '', + orderPick: 2, //1自提 2物流 + isCar: 0, //购物车进入 + wxVipType: 1, + date: '', + time: '', + startTime: '', + pay_can: 0, //是否能点击支付 + telNum: '' //联系方式 + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow: function () { + if (this.data.orderPick == 2) { + //收货地址 + if (this.data.total && this.data.province != '') { + //订单个人信息获取 + wx.showLoading({ + title: '加载中', + }) + wx.request({ + url: app.globalData.ip + '/wisdommining/api/order/getUserInfo', + method: 'GET', + header: { + "content-type": "application/x-www-form-urlencoded", + }, + data: { + userId: app.globalData.userId + }, + success: res => { + wx.hideLoading(); + console.log(res) + if (res.data.code == 1) { + let dataList = res.data.value; + this.setData({ + dataList: dataList, + pay: (parseFloat(this.data.payActual) * parseFloat(dataList.userVipDiscount) / 100).toFixed(2), + }) + //运费获取 + wx.request({ + url: app.globalData.ip + '/wisdommining/api/order/getFreight', + method: 'GET', + header: { + "content-type": "application/x-www-form-urlencoded", + }, + data: { + freightAddress: this.data.province, + price: this.data.total, + }, + success: res => { + wx.hideLoading(); + console.log(res) + if (res.data.code == 1) { + this.setData({ + freight: res.data.value, + payActual: (parseFloat(this.data.total) + parseFloat(res.data.value) - parseFloat(this.data.discount)).toFixed(2), + payActualIntegral: parseFloat(this.data.total), + }) + this.setData({ + pay: (parseFloat(this.data.payActual) * parseFloat(this.data.dataList.userVipDiscount) / 100).toFixed(2), + }) + } else { + wx.showModal({ + title: '提示!', + content: res.data.message, + showCancel: false, + }) + } + } + }) + } else { + wx.showModal({ + title: '提示!', + content: res.data.message, + showCancel: false, + }) + } + } + }) + } + } else { + // 自提点 + this.setData({ + freight: 0, + payActual: (parseFloat(this.data.total) - parseFloat(this.data.discount)).toFixed(2), + payActualIntegral: parseFloat(this.data.total), + }) + this.setData({ + pay: (parseFloat(this.data.payActual) * parseFloat(this.data.dataList.userVipDiscount) / 100).toFixed(2), + }) + console.log(this.data.address) + } + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad: function (options) { + // let myDate = new Date(); + // let startTime = myDate.getFullYear() + '-' + (parseFloat(myDate.getMonth()) + 1) + '-' + (parseFloat(myDate.getDate()) + 3) + console.log(monthDealWith()) + this.setData({ + startTime: monthDealWith() + }) + // console.log(this.data.startTime) + //积分商城进入 + if (options.integral) { + console.log(options.integral) + this.setData({ + integral: 1 + }) + } + //购物车进入 + if (options.isCar) { + console.log(options.isCar) + this.setData({ + isCar: options.isCar + }) + } +// +// var sumpay=this.pay+, + + + if (options.goods) { + let goods = JSON.parse(options.goods) + for (let i = 0; i < goods.length; i++) { + if(goods[i].isDiscount ==0){ + this.setData({ + wxVipType: goods[i].isDiscount, + }) + } + + } + console.log(goods) + let total = 0; + let numAll = 0; + let specPriceArr = []; + for (let i = 0; i < goods.length; i++) { + total = total + parseFloat(goods[i].specs.price) * parseFloat(goods[i].num) + numAll = numAll + parseFloat(goods[i].num); + specPriceArr.push(parseFloat(goods[i].specs.price)); + } + this.setData({ + goods: goods, + total: total.toFixed(2), + total_int: parseInt(total), + totalIntegral: total, + specPriceArr: specPriceArr, + numAll: numAll, + payActual: (parseFloat(total) + parseFloat(this.data.freight) - parseFloat(this.data.discount)).toFixed(2), + payActualIntegral: parseFloat(total) + }) + //订单个人信息获取 + wx.showLoading({ + title: '加载中', + }) + wx.request({ + url: app.globalData.ip + '/wisdommining/api/order/getUserInfo', + method: 'GET', + header: { + "content-type": "application/x-www-form-urlencoded", + }, + data: { + userId: app.globalData.userId + }, + success: res => { + wx.hideLoading(); + console.log(res) + if (res.data.code == 1) { + let dataList = res.data.value; + //--------------------------------------------------------------- + if(this.data.wxVipType == 1){ + this.setData({ + dataList: dataList, + pay: (parseFloat(this.data.payActual) * parseFloat(dataList.userVipDiscount) / 100).toFixed(2), + }) + }else{ + this.setData({ + dataList: dataList, + pay: (parseFloat(this.data.payActual)).toFixed(2), + + }) + } + + //------------------------------------------------------------------- + // this.setData({ + // dataList: dataList, + // pay: (parseFloat(this.data.payActual) * parseFloat(dataList.userVipDiscount) / 100).toFixed(2), + // }) + if (dataList.wisdUserAddress) { + //默认地址ID + this.setData({ + province: dataList.wisdUserAddress.addressProvince, + addressId: dataList.wisdUserAddress.id, + address: dataList.wisdUserAddress.addressProvince + dataList.wisdUserAddress.addressCity + dataList.wisdUserAddress.addressArea + dataList.wisdUserAddress.addressDetailed, + }) + //运费获取 + wx.request({ + url: app.globalData.ip + '/wisdommining/api/order/getFreight', + method: 'GET', + header: { + "content-type": "application/x-www-form-urlencoded", + }, + data: { + freightAddress: dataList.wisdUserAddress.addressProvince, + price: total, + }, + success: res => { + wx.hideLoading(); + console.log(res) + if (res.data.code == 1) { + this.setData({ + freight: res.data.value, + payActual: (parseFloat(this.data.total) + parseFloat(res.data.value) - parseFloat(this.data.discount)).toFixed(2), + payActualIntegral: parseFloat(this.data.total), + }) + if(this.data.wxVipType == 1){ + this.setData({ + pay: (parseFloat(this.data.payActual) * parseFloat(dataList.userVipDiscount) / 100).toFixed(2), + }) + }else{ + this.setData({ + pay: (parseFloat(this.data.payActual)).toFixed(2), + }) + } + + // this.setData({ + // pay: (parseFloat(this.data.payActual) * parseFloat(dataList.userVipDiscount) / 100).toFixed(2), + // }) + } else { + wx.showModal({ + title: '提示!', + content: res.data.message, + showCancel: false, + }) + } + } + }) + } + } else { + wx.showModal({ + title: '提示!', + content: res.data.message, + showCancel: false, + }) + } + } + }) + } + }, + //备注 + note(e) { + this.setData({ + note: e.detail.value + }) + }, + //选择地址类型 + addressType() { + this.setData({ + addressType: true, //收货 + }) + }, + + //选择收货地址 + address() { + wx.navigateTo({ + url: '/pages/my/my_address/my_address?orderAddress=true&addressId=' + this.data.addressId, + }) + this.setData({ + addressType: false, //收货 + }) + }, + //选择自提点 + ztd() { + wx.navigateTo({ + url: '/pages/index/index_address/index_address?pay=true', + }) + this.setData({ + addressType: false, //收货 + }) + }, + //收获 遮罩层 + addressZzc() { + this.setData({ + addressType: false, //收货 + }) + }, + + //选择优惠方式 + reduceType() { + this.setData({ + reduceType: true, //优惠 + }) + }, + + //选择优惠 + reduceTypeXz(e) { + let index = e.currentTarget.dataset.index; + let reduceTypeXz = this.data.reduceTypeXz; + let goods = this.data.goods; + console.log("**********") + if (reduceTypeXz == index) { + console.log("**********") + this.setData({ + reduceTypeXz: 0, //优惠 + }) + //改变显示价格为员工价格 + console.log(goods) + let total = 0; + let specPriceArr = []; + let userVipDiscountYN = 0; //判断是否有商品为团购价 + for (let i = 0; i < goods.length; i++) { + total = total + parseFloat(goods[i].specs.price) * parseFloat(goods[i].num); + specPriceArr.push(parseFloat(goods[i].specs.price)); + if (goods[i].isDiscount == 1) { + if (goods[i].specs.specBulyPrice != null) { + userVipDiscountYN++ + } + } + } + this.setData({ + goods: goods, + total: total.toFixed(2), + total_int: parseInt(total), + specPriceArr: specPriceArr, + payActual: (parseFloat(total) + parseFloat(this.data.freight)).toFixed(2) + }) + if (userVipDiscountYN > 0 && this.data.wxVipType ==0) { + this.setData({ + pay: parseFloat(this.data.payActual).toFixed(2), + }) + } else { + this.setData({ + pay: (parseFloat(this.data.payActual) * parseFloat(this.data.dataList.userVipDiscount) / 100).toFixed(2), + }) + } + + } else { + wx.showModal({ + title: '提示!', + content: '选择优惠后,公司员工不再享有员工价~', + success: ss => { + if (ss.confirm) { + if (index == 1 && this.data.dataList.userVolumeBalance == 0) { + return + } + if (index == 2 && this.data.dataList.userDiscountBalance == 0) { + return + } + //改变显示价格为普通价格 + console.log(goods) + let total = 0; + let specPriceArr = []; + for (let i = 0; i < goods.length; i++) { + total = total + parseFloat(goods[i].specs.specPrice) * parseFloat(goods[i].num); + specPriceArr.push(parseFloat(goods[i].specs.specPrice)); + } + this.setData({ + goods: goods, + total: total.toFixed(2), + total_int: parseInt(total), + specPriceArr: specPriceArr, + payActual: (parseFloat(total) + parseFloat(this.data.freight) - parseFloat(this.data.discount)).toFixed(2) + }) + + let goodsList = []; + for (let i = 0; i < goods.length; i++) { + goodsList.push({ + goodsId: goods[i].goodsId, + specId: goods[i].specs.id, + num: goods[i].num, + }) + } + wx.showLoading({ + title: '加载中', + }) + wx.request({ + url: app.globalData.ip + '/wisdommining/api/order/amountCalculation', + method: 'POST', + data: { + goods: goodsList, + userId: app.globalData.userId, + volumeType: parseInt(index) //1现金券 2折扣券 + }, + success: res => { + wx.hideLoading(); + console.log(res) + if (res.data.code == 1) { + this.setData({ + reduceTypeXz: index, //优惠 + reduceType: false, + discount: res.data.value.volumeBalance, //当前商品优惠数 + priceSum: res.data.value.priceSum, //折扣券現金券減少数 + payActual: (parseFloat(this.data.total) + parseFloat(this.data.freight) - parseFloat(res.data.value.volumeBalance)).toFixed(2), + }) + // if(this.data.wxVipType == 1){ + // this.setData({ + // pay: (parseFloat(this.data.payActual) * parseFloat(dataList.userVipDiscount) / 100).toFixed(2), + // }) + // }else{ + // this.setData({ + // pay: (parseFloat(this.data.payActual)).toFixed(2), + // }) + // } + this.setData({ + pay: (parseFloat(this.data.payActual) * parseFloat(this.data.dataList.userVipDiscount) / 100).toFixed(2), + }) + } else { + wx.showModal({ + title: '提示!', + content: res.data.message, + showCancel: false, + }) + } + } + }) + } + } + }) + } + }, + // 联系方式 + telNum(e) { + this.setData({ + telNum: e.detail.value + }) + }, + //立即支付 + pay(e) { + + if (this.data.pay_can == 1) { + return + } + + if (this.data.addressId == '') { + wx.showToast({ + title: '请选择收货方式', + icon: 'none' + }) + return + } + if (this.data.orderPick == 1) { + if (this.data.date == '') { + wx.showToast({ + title: '请选择提货日期', + icon: 'none' + }) + return + } + if (this.data.time == '') { + wx.showToast({ + title: '请选择提货时间', + icon: 'none' + }) + return + } + if (this.data.telNum === '') { + wx.showToast({ + title: '请输入联系方式~', + icon: 'none' + }) + return + } + // 手机号验证 + let phoneReg = /^1(3|4|5|6|7|8|9)\d{9}$/; + if (!phoneReg.test(this.data.telNum)) { + wx.showToast({ + title: '请输入正确的手机号~', + icon: 'none' + }) + return; + } + } + wx.showModal({ + title: '提示!', + content: '确认要购买吗', + success: sss => { + if (sss.confirm) { + let orderActualPay = ''; + let orderOtherPay = ''; + let orderPayWay = ''; + let orderPick = this.data.orderPick; + let wisdOrderDetailList = []; + let orderAllPay = +this.data.freight + (+this.data.total) //订单原价 + let orderVolumePay = this.data.discount //优惠金额 + console.log(this.data.goods) + //商品信息 + for (let i = 0; i < this.data.goods.length; i++) { + wisdOrderDetailList.push({ + goodsId: this.data.goods[i].goodsId, + goodsNum: this.data.goods[i].num, + specId: this.data.goods[i].specs.id, + specPrice: this.data.specPriceArr[i], //规格价格集合 + }) + } + console.log(wisdOrderDetailList) + //支付方式 + if (!this.data.integral == 1) { + orderActualPay = parseFloat(this.data.pay) + if (this.data.reduceTypeXz == 0) { + //1纯微信支付 + orderPayWay = 1; + orderOtherPay = 0; + } + if (this.data.reduceTypeXz == 1) { + //4现金券(+微信支付) + orderPayWay = 4; + orderOtherPay = parseFloat(this.data.priceSum) + } + if (this.data.reduceTypeXz == 2) { + //5折扣券(+微信支付) + orderPayWay = 5; + orderOtherPay = parseFloat(this.data.priceSum) + } + } else { + //2积分支付 + orderPayWay = 2; + orderActualPay = 0; + orderVolumePay = 0; + orderOtherPay = parseFloat(this.data.payActualIntegral); + orderAllPay = +this.data.freight + (+this.data.totalIntegral); //订单原价 + } + wx.showLoading({ + title: '加载中', + mask: true + }) + wx.request({ + url: app.globalData.ip + '/wisdommining/api/order/addOrder', + method: 'POST', + data: { + userId: app.globalData.userId, + addressId: this.data.addressId, + orderActualPay: orderActualPay, //微信支付的钱 其余传0 + orderOtherPay: orderOtherPay, //积分 现金券 折扣券 套餐0 + orderPayWay: orderPayWay, //1纯微信支付 2积分支付 3套餐券 4现金券(+微信支付) 5折扣券(+微信支付) + orderPick: orderPick, //1自提 2物流 + orderPickTime: orderPick == 1 ? this.data.date + ' ' + this.data.time : '', + orderRemark: this.data.note, + orderFreight: this.data.freight, + wisdOrderDetailList: wisdOrderDetailList, + isCar: parseInt(this.data.isCar), //购物车1 别的0 + orderAllPay: orderAllPay, + orderVolumePay: orderVolumePay, + userPhone: this.data.telNum + }, + success: res => { + wx.hideLoading(); + console.log(res) + if (res.data.code == 1) { + //支付 + this.payM({ + orderNumber: res.data.value + }) + //是否能点击支付 + this.setData({ + pay_can: 1 + }) + } else { + wx.showModal({ + title: '提示!', + content: res.data.message, + showCancel: false, + }) + } + } + }) + } + } + }) + }, + + //支付 + payM(options) { + wx.showLoading({ + title: '支付中', + mask: true + }) + wx.request({ + url: app.globalData.ip + '/wisdommining/api/pay/payOrder', + method: 'PUT', + header: { + "content-type": "application/x-www-form-urlencoded", + }, + data: { + userId: app.globalData.userId, + orderNumber: options.orderNumber + }, + success: res => { + wx.hideLoading(); + console.log(res) + if (res.data.code == 1) { + //调用微信支付API + wx.requestPayment({ + timeStamp: res.data.value.timeStamp, + nonceStr: res.data.value.nonceStr, + package: res.data.value.package, + signType: 'MD5', + paySign: res.data.value.paySign, + success(res) { + console.log(res) + //支付成功 + wx.showToast({ + title: '支付成功', + icon: 'success', + duration: 1000, + mask: true, + success() { + setTimeout(() => { + wx.showLoading({ + title: '跳转中..', + mask: true + }) + wx.redirectTo({ + url: '/pages/order_details/order_details?orderNumber=' + options.orderNumber, + }) + }, 1000); + } + }) + }, + fail(res) { + console.log(res) + wx.showToast({ + title: '支付失败', + icon: 'none', + duration: 1000, + mask: true, + success() { + setTimeout(() => { + wx.showLoading({ + title: '跳转中..', + mask: true + }) + wx.redirectTo({ + url: '/pages/order_details/order_details?orderNumber=' + options.orderNumber, + }) + }, 1000); + } + }) + } + }) + } else if (res.data.code == 2) { + //支付成功 + wx.showToast({ + title: '支付成功', + icon: 'success', + duration: 1000, + mask: true, + success() { + setTimeout(() => { + wx.showLoading({ + title: '跳转中..', + mask: true + }) + wx.redirectTo({ + url: '/pages/order_details/order_details?orderNumber=' + options.orderNumber, + }) + }, 1000); + } + }) + } else { + wx.showModal({ + title: '提示!', + content: res.data.message, + showCancel: false, + success: sss => { + if (sss.confirm) { + // wx.redirectTo({ + // url: '/pages/order_details/order_details?orderNumber=' + options.orderNumber, + // }) + wx.navigateBack() + } + } + }) + } + } + }) + }, + + //优惠方式遮罩层 + reduceZzc() { + this.setData({ + reduceType: false, //优惠方式 + }) + }, + + bindDateChange: function (e) { + console.log('picker发送选择改变,携带值为', e.detail.value) + this.setData({ + date: e.detail.value + }) + }, + bindTimeChange: function (e) { + console.log('picker发送选择改变,携带值为', e.detail.value) + this.setData({ + time: e.detail.value + }) + }, + + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady: function () { + + }, + + + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide: function () { + + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload: function () { + + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh: function () { + + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom: function () { + + }, +}) \ No newline at end of file diff --git a/pages/cartPay/cartPay.json b/pages/cartPay/cartPay.json new file mode 100644 index 0000000..19fa411 --- /dev/null +++ b/pages/cartPay/cartPay.json @@ -0,0 +1,4 @@ +{ + "usingComponents": {}, + "navigationBarTitleText": "订单支付" +} \ No newline at end of file diff --git a/pages/cartPay/cartPay.wxml b/pages/cartPay/cartPay.wxml new file mode 100644 index 0000000..62c7e15 --- /dev/null +++ b/pages/cartPay/cartPay.wxml @@ -0,0 +1,209 @@ + + + + + + + + {{address}} + + + + + + + + + + + + + {{item.goodsName}} + 规格:{{item.specs.specName}} + + ¥{{reduceTypeXz==0?item.specs.price:item.specs.specPrice}} + ¥{{item.specs.originalPrice}} + + + {{item.specs.price}}积分 + + x{{item.num}} + + + + + + 商品合计(预计获得{{total_int}}积分) + {{integral==1?totalIntegral + '积分':'¥' + total}} + + + 运费 + {{orderPick==1?'自提':integral==1?'包邮':freight==0?'包邮':('¥'+freight)}} + + + + + {{reduceTypeXz==2?'折扣券':'现金券'}} + -¥{{priceSum}} + + + 优惠 + + -¥{{discount}} + + + + + + 请选择优惠类别 + + + 暂无优惠 + + + + + + + + + 备注 + + + + + + 实际支付 + {{integral==1?payActualIntegral+'积分':'¥'+payActual}} + + + + + + + + + 微信支付 + + + {{dataList.userVip}}会员尊享{{dataList.userVipDiscount/10}}折优惠 + + 暂无优惠(注:如有折扣商品请单独购买) + + + + + + + 自提时间* + + + + {{date==''?'选择提货日期':date}} + + + + + + {{time==''?'选择提货时间':time}} + + + + + + + + 联系方式* + + + + +由于进货和配货需要时间,您的提货时间要3天后开始选择 + + + + + + + + 共计{{numAll}}件 + + 合计:¥ + {{pay}} + + + + 立即支付 + + + + + 共计1{{numAll}}件合计:{{payActualIntegral}}积分 + + {{dataList.userIntegral + + + + + + + + + 选择优惠方式(一经核销不予退还) + + + + 现金券:{{dataList.userVolumeBalance}} + + + + + + + + 折扣券:{{dataList.userDiscountBalance}} + ({{dataList.userDiscount/10}}折) + + + + + + + + + + + + + 选择收货方式 + + + 我的收货地址 + + + + + + + + 自提点 + + + + + + + \ No newline at end of file diff --git a/pages/cartPay/cartPay.wxss b/pages/cartPay/cartPay.wxss new file mode 100644 index 0000000..9b39211 --- /dev/null +++ b/pages/cartPay/cartPay.wxss @@ -0,0 +1,371 @@ +/* pages/cartPay/cartPay.wxss */ +page{ + background-color: #f5f5f5; +} +.djs{ + font-size: 28rpx; + color: #333333; + width: 750rpx; + height: 80rpx; + background-color: #f7e0cd; + text-align: center; + line-height: 80rpx; +} +.djs text{ + color: #ff372d; + margin-left: 10rpx; +} +.address{ + margin-top: 34rpx; + width: 690rpx; + padding: 0 30rpx; + height: 156rpx; + background-color: #ffffff; + border-radius: 20rpx; +} +.address-l{ + height: 100%; +} +.address-l image{ + width: 46rpx; + height: 46rpx; + margin:0 55rpx 0 15rpx; +} +.address-cont{ + font-size: 32rpx; + color: #ee7b1e; + width: 500rpx; +} +.address-r{ + height: 100%; +} +.address-r image{ + width:30rpx; + height:30rpx; +} +.goods{ + width: 690rpx; + padding: 0 30rpx; + background-color: #ffffff; + border-radius: 20rpx; + margin: 30rpx 0; +} +.cont{ + padding: 30rpx 0; + border-bottom: 1rpx #dcdcdc solid; +} +.cont:last-child{ + border-bottom: none; +} +.cont-l image{ + width: 160rpx; + height: 160rpx; +} +.cont-m{ + width: 400rpx; + padding: 10rpx 0; + display: flex; + flex-wrap: wrap; + align-content: space-between; +} +.name{ + font-size: 28rpx; + color: #333333; +} +.spec{ + width:100%; + font-size: 24rpx; + color: #999999; +} +.price{ + width:100%; + font-size: 36rpx; + color: #ee7b1e; +} +.price text{ + font-size: 24rpx; + color: #999999; + text-decoration: line-through; + margin-left: 11rpx; +} +.cont-r{ + display: flex; + align-items : flex-end; + font-size: 32rpx; + color: #0b0b0b; + height: 130rpx; +} + +.data{ + width: 690rpx; + padding:10rpx 30rpx 0; + background-color: #ffffff; + border-radius: 20rpx; +} +.data-t{ + height: 70rpx; +} +.data-t_last{ + padding-top:20rpx; + border-top: 1rpx #d9d9d9 solid; + margin-top: 30rpx; +} +.t-l{ + font-size: 28rpx; + letter-spacing: 1rpx; + color: #444444; +} +.t-l text{ + color: #ff291e; + font-size: 24rpx; +} +.t-r{ + font-size: 28rpx; + letter-spacing: 1rpx; + height: 70rpx; + line-height: 70rpx; +} +.t-r__1{ + color: #333333; + font-weight: bold; +} +.t-r__2{ + color: #999999; +} +.t-r__3{ + color: #ee7b1e; + /*border: red solid 1rpx; + background-color: #ffffff; + width:300rpx; + text-align: right; + margin-left: 180rpx; + z-index: 99; + */ +} +.t-r__4{ + color: #333333; + font-weight: bold; + font-size: 34rpx; +} +t-r__5{ + color: #ee7b1e; + font-weight: bold; + font-size: 34rpx; +} +.t-r input{ + font-size: 28rpx; + letter-spacing: 1rpx; + color: #999999; + width: 500rpx; + text-align: right; + line-height: 70rpx; + height: 70rpx; + border: none; +} +.t-r image{ + width: 30rpx; + height: 30rpx; +} + +.pay-type{ + width: 690rpx; + padding: 0 30rpx; + height: 100rpx; + background-color: #ffffff; + border-radius: 20rpx; + margin-top:20rpx; +} +.pay-type__l{ + height: 100%; + font-size: 28rpx; + color: #333333; +} +.pay-type__l image{ + width: 50rpx; + height: 50rpx; + margin-right: 20rpx; +} +.pay-type__r{ + height: 100%; + font-size: 24rpx; + letter-spacing: 1rpx; + color: #ee7b1e; +} +.pay-type__r image{ + width: 30rpx; + height: 30rpx; + margin-left: 20rpx; +} +.pay{ + /*border: red solid 1rpx;*/ + width: 690rpx; + padding: 0 30rpx; + height: 100rpx; + background-color: #ffffff; + line-height: 56rpx; + position: fixed; + bottom: 0; + left: 0; + z-index: 2; +} +.pay-l i{ + /*border: springgreen solid 1rpx;*/ + padding-right: 32rpx; + font-size: 28rpx; + color: #333333; +} +.pay-l{ + padding-left: 90rpx; + width: 500rpx; + font-size: 28rpx; + color: #ee7b1e; + /*border: blue solid 1rpx;*/ +} + +.pay-l text{ + /* border: green solid 1rpx;*/ + + font-size: 40rpx; + color: #ee7b1e; +} +.pay-r{ + width: 180rpx; + height: 56rpx; + background-image: linear-gradient(-90deg, + #ee7b1e 0%, + #fdae03 100%); + border-radius: 28rpx; + font-size: 28rpx; + color: #ffffff; + text-align: center; +} +.pay-r_bz{ + width: 180rpx; + height: 56rpx; + background-color: #999999; + border-radius: 28rpx; + font-size: 28rpx; + color: #ffffff; + text-align: center; +} +.reduce-zzc{ + width: 100vw; + height: 100vh; + position: fixed; + left: 0; + top: 0; + z-index: 9; + background-color: rgba(0, 0, 0, 0.6); +} +.reduce-cont{ + position: fixed; + left: 0; + bottom: 0; + z-index: 9; + width: 690rpx; + padding: 0 30rpx 50rpx; + background-color: #ffffff; + border-radius: 20rpx 20rpx 0px 0px; +} +.reduce-title{ + font-size: 36rpx; + color: #333333; + border-bottom: 1rpx solid #d2d2d2; + height: 106rpx; + line-height: 106rpx; + text-align: center; + margin-bottom: 40rpx; + padding-left: 70rpx; +} +.titlezk{ + font-size: 28rpx; + color: #ff0000; + margin-left: 15rpx; +} +.reduce-c{ + width: 690rpx; + height: 100rpx; + background-color: #ffffff; + border-radius: 20rpx; + margin-bottom: 30rpx; +} +.reduce-c__l{ + font-size: 36rpx; + color: #333333; +} +.reduce-c__l text{ + color: #ee7b1e; +} +.reduce-c__l text text{ + font-size: 24rpx; +} +.reduce-c__l .zk{ + font-size: 36rpx; + color: #ff0000; + margin-left: 15rpx; +} +.reduce-c__l{ + height: 100%; +} +.reduce-c__l image{ + width: 46rpx; + height: 46rpx; + margin-right: 58rpx; +} + +.reduce-c__r{ + height: 100%; +} +.reduce-c__r image{ + width: 42rpx; + height: 42rpx; +} + + +.ztTime{ + box-sizing: border-box; + padding: 0 30rpx; + margin-top: 30rpx; + width: 750rpx; + height: 100rpx; + background-color: #ffffff; + border-radius: 20rpx; +} +.ztt_l{ + font-size: 28rpx; + line-height: 100rpx; + letter-spacing: 1rpx; + color: #333333; +} +.ztt_l text{ + color: #ff0000; + margin-left: 20rpx; + display: inline-block; + position: relative; + top: 6rpx; +} + +.ztt_r{ + font-size: 28rpx; + line-height: 100rpx; + letter-spacing: 1rpx; + color: #999999; + width:500rpx; +} +.ztt_r_time{ + color: #333333; +} +.ztt_r image{ + width: 14rpx; + height: 8rpx; + margin-left: 20rpx; +} + +.ztTimeTs{ + font-size: 24rpx; + line-height: 35rpx; + letter-spacing: 1rpx; + color: #ff0000; + text-align: center; + margin-top: 20rpx; +} \ No newline at end of file diff --git a/pages/chuxiao/cartPay/cartPay.js b/pages/chuxiao/cartPay/cartPay.js new file mode 100644 index 0000000..c8e3828 --- /dev/null +++ b/pages/chuxiao/cartPay/cartPay.js @@ -0,0 +1,441 @@ +// pages/cartPay/cartPay.js +const app = getApp(); +Page({ + + /** + * 页面的初始数据 + */ + data: { + goods: [], + reduceType: false,//优惠方式 + addressType: false,//收货方式 + reduceTypeXz: 0,//0不选 1现金券 2折扣券 + freight: 0,//运费 + discount: 0,//优惠 + payActual: 0,//实际支付 + note: '', + addressId: '',//地址ID + address: '选择收货方式',//地址 + province: '', + orderPick: 2,//1自提 2物流 + isCar: 0,//购物车进入 + + date: '', + time: '', + startTime: '', + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow: function () { + if (this.data.orderPick == 2) { + //收货地址 + if (this.data.total && this.data.province != '') { + //订单个人信息获取 + wx.showLoading({ + title: '加载中', + }) + wx.request({ + url: app.globalData.ip + '/wisdommining/api/order/getUserInfo', + method: 'GET', + header: { + "content-type": "application/x-www-form-urlencoded", + }, + data: { + userId: app.globalData.userId + }, + success: res => { + wx.hideLoading(); + console.log(res) + if (res.data.code == 1) { + let dataList = res.data.value; + this.setData({ + dataList: dataList, + }) + //运费获取 + wx.request({ + url: app.globalData.ip + '/wisdommining/api/order/getFreight', + method: 'GET', + header: { + "content-type": "application/x-www-form-urlencoded", + }, + data: { + freightAddress: this.data.province, + price: this.data.total, + }, + success: res => { + wx.hideLoading(); + console.log(res) + if (res.data.code == 1) { + this.setData({ + freight: res.data.value, + payActual: (parseFloat(this.data.total) + parseFloat(res.data.value)).toFixed(2), + }) + } else { + wx.showModal({ + title: '提示!', + content: res.data.message, + showCancel: false, + }) + } + } + }) + } else { + wx.showModal({ + title: '提示!', + content: res.data.message, + showCancel: false, + }) + } + } + }) + } + } else { + // 自提点 + this.setData({ + freight: 0, + payActual:parseFloat(this.data.total).toFixed(2), + }) + console.log(this.data.address) + } + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad: function (options) { + let myDate = new Date(); + this.setData({ + startTime: myDate.getFullYear() + '-' + (parseFloat(myDate.getMonth()) + 1) + '-' + (parseFloat(myDate.getDate()) + 3) + }) + + //购物车进入 + if (options.isCar) { + console.log(options.isCar) + this.setData({ + isCar: options.isCar + }) + } + if (options.goods) { + let goods = JSON.parse(options.goods) + console.log(goods) + let total = 0; + let numAll = 0; + let specPriceArr = []; + for (let i = 0; i < goods.length; i++) { + total = total + parseFloat(goods[i].specs.specPromotionPrice) * parseFloat(goods[i].num) + numAll = numAll + parseFloat(goods[i].num); + specPriceArr.push(parseFloat(goods[i].specs.specPromotionPrice)); + } + this.setData({ + goods: goods, + total: total.toFixed(2), + total_int: parseInt(total), + specPriceArr: specPriceArr, + numAll: numAll, + payActual: (parseFloat(total) + parseFloat(this.data.freight)).toFixed(2), + }) + //订单个人信息获取 + wx.showLoading({ + title: '加载中', + }) + wx.request({ + url: app.globalData.ip + '/wisdommining/api/order/getUserInfo', + method: 'GET', + header: { + "content-type": "application/x-www-form-urlencoded", + }, + data: { + userId: app.globalData.userId + }, + success: res => { + wx.hideLoading(); + console.log(res) + if (res.data.code == 1) { + let dataList = res.data.value; + this.setData({ + dataList: dataList, + }) + if (dataList.wisdUserAddress) { + //默认地址ID + this.setData({ + province: dataList.wisdUserAddress.addressProvince, + addressId: dataList.wisdUserAddress.id, + address: dataList.wisdUserAddress.addressProvince + dataList.wisdUserAddress.addressCity + dataList.wisdUserAddress.addressArea + dataList.wisdUserAddress.addressDetailed, + }) + //运费获取 + wx.request({ + url: app.globalData.ip + '/wisdommining/api/order/getFreight', + method: 'GET', + header: { + "content-type": "application/x-www-form-urlencoded", + }, + data: { + freightAddress: dataList.wisdUserAddress.addressProvince, + price: total, + }, + success: res => { + wx.hideLoading(); + console.log(res) + if (res.data.code == 1) { + this.setData({ + freight: res.data.value, + payActual: (parseFloat(this.data.total) + parseFloat(res.data.value)).toFixed(2), + }) + } else { + wx.showModal({ + title: '提示!', + content: res.data.message, + showCancel: false, + }) + } + } + }) + } + } else { + wx.showModal({ + title: '提示!', + content: res.data.message, + showCancel: false, + }) + } + } + }) + } + }, + //备注 + note(e) { + this.setData({ + note: e.detail.value + }) + }, + //选择地址类型 + addressType() { + this.setData({ + addressType: true,//收货 + }) + }, + + //选择收货地址 + address() { + wx.navigateTo({ + url: '/pages/my/my_address/my_address?orderAddress=true&addressId=' + this.data.addressId, + }) + this.setData({ + addressType: false,//收货 + }) + }, + //选择自提点 + ztd() { + wx.navigateTo({ + url: '/pages/index/index_address/index_address?pay=true', + }) + this.setData({ + addressType: false,//收货 + }) + }, + //收获 遮罩层 + addressZzc() { + this.setData({ + addressType: false,//收货 + }) + }, + + //选择优惠方式 + reduceType() { + this.setData({ + reduceType: true,//优惠 + }) + }, + + //立即支付 + pay(e) { + if (this.data.addressId == '') { + wx.showToast({ + title: '请选择收货方式', + icon: 'none' + }) + return + } + if (this.data.orderPick == 1) { + if (this.data.date == '') { + wx.showToast({ + title: '请选择提货日期', + icon: 'none' + }) + return + } + if (this.data.time == '') { + wx.showToast({ + title: '请选择提货时间', + icon: 'none' + }) + return + } + } + wx.showModal({ + title: '提示!', + content: '确认要购买吗', + success: sss => { + if (sss.confirm) { + let orderActualPay = ''; + let orderOtherPay = ''; + let orderPayWay = ''; + let orderPick = this.data.orderPick; + let wisdOrderDetailList = []; + let orderAllPay = +this.data.freight + (+this.data.total) //订单原价 + let orderVolumePay = this.data.discount //优惠金额 + console.log(this.data.goods) + //商品信息 + for (let i = 0; i < this.data.goods.length; i++) { + wisdOrderDetailList.push({ + goodsId: this.data.goods[i].goodsId, + goodsNum: this.data.goods[i].num, + specId: this.data.goods[i].specs.id, + specPrice: this.data.specPriceArr[i], //规格价格集合 + }) + } + console.log(wisdOrderDetailList) + //支付方式 + orderActualPay = parseFloat(this.data.payActual) + if (this.data.reduceTypeXz == 0) { + //1纯微信支付 + orderPayWay = 1; + orderOtherPay = 0; + } + wx.showLoading({ + title: '加载中', + mask: true + }) + wx.request({ + url: app.globalData.ip + '/wisdommining/api/order/addOrder', + method: 'POST', + data: { + userId: app.globalData.userId, + addressId: this.data.addressId, + orderActualPay: orderActualPay, //微信支付的钱 其余传0 + orderOtherPay: orderOtherPay, //积分 现金券 折扣券 套餐0 + orderPayWay: orderPayWay, //1纯微信支付 2积分支付 3套餐券 4现金券(+微信支付) 5折扣券(+微信支付) + orderPick: orderPick, //1自提 2物流 + orderPickTime:orderPick==1?this.data.date+' '+this.data.time:'', + orderRemark: this.data.note, + orderFreight: this.data.freight, + wisdOrderDetailList: wisdOrderDetailList, + isCar: parseInt(this.data.isCar), //购物车1 别的0 + orderAllPay: orderAllPay, + orderVolumePay: orderVolumePay, + }, + success: res => { + wx.hideLoading(); + console.log(res) + if (res.data.code == 1) { + //支付 + this.payM({ + orderNumber: res.data.value + }) + } else { + wx.showModal({ + title: '提示!', + content: res.data.message, + showCancel: false, + }) + } + } + }) + } + } + }) + }, + + //支付 + payM(options) { + wx.showLoading({ + title: '支付中', + mask: true + }) + wx.request({ + url: app.globalData.ip + '/wisdommining/api/pay/payOrder', + method: 'PUT', + header: { + "content-type": "application/x-www-form-urlencoded", + }, + data: { + userId: app.globalData.userId, + orderNumber: options.orderNumber + }, + success: res => { + wx.hideLoading(); + console.log(res) + if (res.data.code == 1) { + //调用微信支付API + wx.requestPayment({ + timeStamp: res.data.value.timeStamp, + nonceStr: res.data.value.nonceStr, + package: res.data.value.package, + signType: 'MD5', + paySign: res.data.value.paySign, + success(res) { + console.log(res) + //支付成功 + wx.showToast({ + title: '支付成功', + icon: 'success', + duration: 1000, + success() { + setTimeout(() => { + wx.redirectTo({ + url: '/pages/order_details/order_details?orderNumber=' + options.orderNumber, + }) + }, 1000); + } + }) + }, + fail(res) { + console.log(res) + wx.showToast({ + title: '支付失败', + icon: 'none', + duration: 1000, + success() { + setTimeout(() => { + wx.redirectTo({ + url: '/pages/order_details/order_details?orderNumber=' + options.orderNumber, + }) + }, 1000); + } + }) + } + }) + }else { + wx.showModal({ + title: '提示!', + content: res.data.message, + showCancel: false, + success: sss => { + if (sss.confirm) { + wx.navigateBack() + } + } + }) + } + } + }) + }, + + + bindDateChange: function (e) { + console.log('picker发送选择改变,携带值为', e.detail.value) + this.setData({ + date: e.detail.value + }) + }, + bindTimeChange: function (e) { + console.log('picker发送选择改变,携带值为', e.detail.value) + this.setData({ + time: e.detail.value + }) + }, + + +}) \ No newline at end of file diff --git a/pages/chuxiao/cartPay/cartPay.json b/pages/chuxiao/cartPay/cartPay.json new file mode 100644 index 0000000..19fa411 --- /dev/null +++ b/pages/chuxiao/cartPay/cartPay.json @@ -0,0 +1,4 @@ +{ + "usingComponents": {}, + "navigationBarTitleText": "订单支付" +} \ No newline at end of file diff --git a/pages/chuxiao/cartPay/cartPay.wxml b/pages/chuxiao/cartPay/cartPay.wxml new file mode 100644 index 0000000..8814f3d --- /dev/null +++ b/pages/chuxiao/cartPay/cartPay.wxml @@ -0,0 +1,110 @@ + + + + + + + {{address}} + + + + + + + + + + + + + {{item.goodsName}} + 规格:{{item.specs.specName}} + + ¥{{item.specs.specPromotionPrice}} + ¥{{item.specs.originalPrice}} + + + x{{item.num}} + + + + + + 商品合计(预计获得{{total_int}}积分) + + + 运费 + {{orderPick==1?'自提':freight==0?'包邮':('¥'+freight)}} + + + + 备注 + + + + + + 实际支付 + {{'¥'+payActual}} + + + + + + 微信支付 + + + + + + + + + 自提时间* + + + + {{date==''?'选择提货日期':date}} + + + + + + {{time==''?'选择提货时间':time}} + + + + + +由于进货和配货需要时间,您的提货时间要3天后开始选择 + + + + + 共计{{numAll}}件合计:¥{{payActual}} + 立即支付 + + + + + + + 选择收货方式 + + + 我的收货地址 + + + + + + + + 自提点 + + + + + + + \ No newline at end of file diff --git a/pages/chuxiao/cartPay/cartPay.wxss b/pages/chuxiao/cartPay/cartPay.wxss new file mode 100644 index 0000000..396d4df --- /dev/null +++ b/pages/chuxiao/cartPay/cartPay.wxss @@ -0,0 +1,355 @@ +/* pages/cartPay/cartPay.wxss */ +page{ + background-color: #f5f5f5; +} +.djs{ + font-size: 28rpx; + color: #333333; + width: 750rpx; + height: 80rpx; + background-color: #f7e0cd; + text-align: center; + line-height: 80rpx; +} +.djs text{ + color: #ff372d; + margin-left: 10rpx; +} +.address{ + margin-top: 34rpx; + width: 690rpx; + padding: 0 30rpx; + height: 156rpx; + background-color: #ffffff; + border-radius: 20rpx; +} +.address-l{ + height: 100%; +} +.address-l image{ + width: 46rpx; + height: 46rpx; + margin:0 55rpx 0 15rpx; +} +.address-cont{ + font-size: 32rpx; + color: #ee7b1e; + width: 500rpx; +} +.address-r{ + height: 100%; +} +.address-r image{ + width:30rpx; + height:30rpx; +} +.goods{ + width: 690rpx; + padding: 0 30rpx; + background-color: #ffffff; + border-radius: 20rpx; + margin: 30rpx 0; +} +.cont{ + padding: 30rpx 0; + border-bottom: 1rpx #dcdcdc solid; +} +.cont:last-child{ + border-bottom: none; +} +.cont-l image{ + width: 160rpx; + height: 160rpx; +} +.cont-m{ + width: 400rpx; + padding: 10rpx 0; + display: flex; + flex-wrap: wrap; + align-content: space-between; +} +.name{ + font-size: 28rpx; + color: #333333; +} +.spec{ + width:100%; + font-size: 24rpx; + color: #999999; +} +.price{ + width:100%; + font-size: 36rpx; + color: #ee7b1e; +} +.price text{ + font-size: 24rpx; + color: #999999; + text-decoration: line-through; + margin-left: 11rpx; +} +.cont-r{ + display: flex; + align-items : flex-end; + font-size: 32rpx; + color: #0b0b0b; + height: 130rpx; +} + +.data{ + width: 690rpx; + padding:10rpx 30rpx 0; + background-color: #ffffff; + border-radius: 20rpx; +} +.data-t{ + height: 70rpx; +} +.data-t_last{ + padding-top:20rpx; + border-top: 1rpx #d9d9d9 solid; + margin-top: 30rpx; +} +.t-l{ + font-size: 28rpx; + letter-spacing: 1rpx; + color: #444444; +} +.t-l text{ + color: #ff291e; + font-size: 24rpx; +} +.t-r{ + font-size: 28rpx; + letter-spacing: 1rpx; + height: 70rpx; + line-height: 70rpx; +} +.t-r__1{ + color: #333333; + font-weight: bold; +} +.t-r__2{ + color: #999999; +} +.t-r__3{ + color: #ee7b1e; +} +.t-r__4{ + color: #333333; + font-weight: bold; + font-size: 34rpx; +} +t-r__5{ + color: #ee7b1e; + font-weight: bold; + font-size: 34rpx; +} +.t-r input{ + font-size: 28rpx; + letter-spacing: 1rpx; + color: #999999; + width: 500rpx; + text-align: right; + line-height: 70rpx; + height: 70rpx; + border: none; +} +.t-r image{ + width: 30rpx; + height: 30rpx; +} + +.pay-type{ + width: 690rpx; + padding: 0 30rpx; + height: 100rpx; + background-color: #ffffff; + border-radius: 20rpx; + margin-top:20rpx; +} +.pay-type__l{ + height: 100%; + font-size: 28rpx; + color: #333333; +} +.pay-type__l image{ + width: 50rpx; + height: 50rpx; + margin-right: 20rpx; +} +.pay-type__r{ + height: 100%; + font-size: 24rpx; + letter-spacing: 1rpx; + color: #ee7b1e; +} +.pay-type__r image{ + width: 30rpx; + height: 30rpx; + margin-left: 20rpx; +} +.pay{ + width: 690rpx; + padding: 0 30rpx; + height: 100rpx; + background-color: #ffffff; + line-height: 56rpx; + position: fixed; + bottom: 0; + left: 0; +} +.pay-l i{ + padding-right: 32rpx; + font-size: 28rpx; + color: #333333; +} +.pay-l{ + padding-left: 90rpx; + font-size: 28rpx; + color: #ee7b1e; +} +.pay-l text{ + font-size: 40rpx; + color: #ee7b1e; +} +.pay-r{ + width: 180rpx; + height: 56rpx; + background-image: linear-gradient(-90deg, + #ee7b1e 0%, + #fdae03 100%); + border-radius: 28rpx; + font-size: 28rpx; + color: #ffffff; + text-align: center; +} +.pay-r_bz{ + width: 180rpx; + height: 56rpx; + background-color: #999999; + border-radius: 28rpx; + font-size: 28rpx; + color: #ffffff; + text-align: center; +} +.reduce-zzc{ + width: 100vw; + height: 100vh; + position: fixed; + left: 0; + top: 0; + z-index: 9; + background-color: rgba(0, 0, 0, 0.6); +} +.reduce-cont{ + position: fixed; + left: 0; + bottom: 0; + z-index: 9; + width: 690rpx; + padding: 0 30rpx 50rpx; + background-color: #ffffff; + border-radius: 20rpx 20rpx 0px 0px; +} +.reduce-title{ + font-size: 36rpx; + color: #333333; + border-bottom: 1rpx solid #d2d2d2; + height: 106rpx; + line-height: 106rpx; + text-align: center; + margin-bottom: 40rpx; + padding-left: 70rpx; +} +.titlezk{ + font-size: 28rpx; + color: #ff0000; + margin-left: 15rpx; +} +.reduce-c{ + width: 690rpx; + height: 100rpx; + background-color: #ffffff; + border-radius: 20rpx; + margin-bottom: 30rpx; +} +.reduce-c__l{ + font-size: 36rpx; + color: #333333; +} +.reduce-c__l text{ + color: #ee7b1e; +} +.reduce-c__l text text{ + font-size: 24rpx; +} +.reduce-c__l .zk{ + font-size: 36rpx; + color: #ff0000; + margin-left: 15rpx; +} +.reduce-c__l{ + height: 100%; +} +.reduce-c__l image{ + width: 46rpx; + height: 46rpx; + margin-right: 58rpx; +} + +.reduce-c__r{ + height: 100%; +} +.reduce-c__r image{ + width: 42rpx; + height: 42rpx; +} + +.ztTime{ + box-sizing: border-box; + padding: 0 30rpx; + margin-top: 30rpx; + width: 750rpx; + height: 100rpx; + background-color: #ffffff; + border-radius: 20rpx; +} +.ztt_l{ + font-size: 28rpx; + line-height: 100rpx; + letter-spacing: 1rpx; + color: #333333; +} +.ztt_l text{ + color: #ff0000; + margin-left: 20rpx; + display: inline-block; + position: relative; + top: 6rpx; +} + +.ztt_r{ + font-size: 28rpx; + line-height: 100rpx; + letter-spacing: 1rpx; + color: #999999; + width:500rpx; +} +.ztt_r_time{ + color: #333333; +} +.ztt_r image{ + width: 14rpx; + height: 8rpx; + margin-left: 20rpx; +} + +.ztTimeTs{ + font-size: 24rpx; + line-height: 35rpx; + letter-spacing: 1rpx; + color: #ff0000; + text-align: center; + margin-top: 20rpx; +} \ No newline at end of file diff --git a/pages/chuxiao/cx_details/goodsDetails.js b/pages/chuxiao/cx_details/goodsDetails.js new file mode 100644 index 0000000..0d48ee5 --- /dev/null +++ b/pages/chuxiao/cx_details/goodsDetails.js @@ -0,0 +1,296 @@ +// pages/goodsDetails/goodsDetails.js +const app = getApp() +const WxParse = require('../../../wxParse/wxParse.js'); +Page({ + + data: { + ip: app.globalData.ipUrl, + contents: '',//富文本 + standardNum: 1,//商品数量 + minusStatus: 'disabled', + goodsList: [], + bnrUrl: [],//轮播图 + specsIndex: 0,//选择规格 + specs: '',//规格 + integral: 0,//积分商城进入 + login: true + }, + // 页面加载时 + onLoad: function (options) { + console.log(options.goodsId) + //商品ID进入 + if (options.goodsId) { + this.setData({ + goodsId: options.goodsId + }) + this.goodDtail() + } + //上级id + if (options.pId) { + wx.setStorage({ + data: options.pId, + key: 'pId', + }) + } + //判断登录 + wx.getStorage({ + key: 'user', + success: s => { + this.setData({ + login: true + }) + }, fail: f => { + this.setData({ + login: false + }) + } + }) + }, + + // 商品详情 + goodDtail() { + wx.showLoading({ + title: '加载中', + mask: true, + }) + wx.request({ + url: app.globalData.ip + '/wisdommining/api/goods/getGoodsDetail', + method: 'GET', + header: { + "content-type": "application/x-www-form-urlencoded", + }, + data: { + goodsId: this.data.goodsId, + userId: app.globalData.userId + }, + success: res => { + wx.hideLoading(); + console.log(res) + if (res.data.code == 1) { + let goods = res.data.value; + WxParse.wxParse('contents', 'html', goods.goodsInfo, this, 20); + this.setData({ + goodsList: goods, + bnrUrl: goods.goodsBanner.split(',') + }) + } else { + wx.showModal({ + title: '提示!', + content: res.data.message, + showCancel: false, + }) + } + } + }) + }, + // 轮播 + onSlideChange(e) { + this.setData({ + lunboindex: e.detail.current + 1 + }) + }, + //点击显示底部弹窗 + choose: function (e) { + var choose = e.currentTarget.dataset.choose + if(choose==1){ + wx.showToast({ + title: '促销商品无法加入购物车', + icon:'none' + }) + return + } + this.setData({ + choose: choose, + }) + this.showModal(); + }, + + //选择规格 + showModal: function () { + // 显示遮罩层 + var animation = wx.createAnimation({ + duration: 200, + timingFunction: "linear", + delay: 0 + }) + this.animation = animation + animation.translateY(300).step() + this.setData({ + animationData: animation.export(), + showModalStatus: true + }) + setTimeout(function () { + animation.translateY(0).step() + this.setData({ + animationData: animation.export() + }) + }.bind(this), 200) + }, + //隐藏对话框 + hideModal(e) { + console.log(this.data.goodsList.wisdGoodsSpecList[this.data.specsIndex].specStock) + if(this.data.goodsList.wisdGoodsSpecList[this.data.specsIndex].specStock==0){ + wx.showToast({ + title: '库存不足!', + icon:'none' + }) + return + } + let hide = e.currentTarget.dataset.hide; + let goodsList = this.data.goodsList + let goods = [{ + isDiscount:goodsList.isDiscount,//判断是否为会员折扣 + goodsPhoto: goodsList.goodsPhoto, + goodsName: goodsList.goodsName, + goodsId: goodsList.id, + num: this.data.standardNum, + specs: goodsList.wisdGoodsSpecList[this.data.specsIndex] + }] + + if (hide == 1) { + // 加入购物车 + wx.showToast({ + title: '促销商品无法加入购物车~', + icon:'none' + }) + } else if (hide == 2) { + //普通商品 + wx.navigateTo({ + url: '/pages/chuxiao/cartPay/cartPay?goods=' + JSON.stringify(goods), + }) + } + + // 隐藏遮罩层 + var animation = wx.createAnimation({ + duration: 200, + timingFunction: "linear", + delay: 0 + }) + this.animation = animation + animation.translateY(300).step() + this.setData({ + animationData: animation.export(), + }) + setTimeout(function () { + animation.translateY(0).step() + this.setData({ + animationData: animation.export(), + showModalStatus: false + }) + }.bind(this), 200) + }, + + // 加入购物车 + carAdd(e) { + wx.request({ + url: app.globalData.ip + '/wisdommining/api/goods/addCart', + method: 'POST', + header: { + "content-type": "application/x-www-form-urlencoded", + "token": app.globalData.token + }, + data: { + userId: app.globalData.userId, + goodsId: this.data.goodsId, + goodsNum: this.data.standardNum, + specId: this.data.goodsList.wisdGoodsSpecList[this.data.specsIndex].id, + }, + success: res => { + wx.hideLoading(); + console.log(res) + if (res.data.code == 1) { + wx.showToast({ + title: '添加成功,快去购物车中查看~', + icon: 'none', + success: s => { + setTimeout(() => { + this.goodDtail() + }, 1000); + } + }) + } else { + wx.showModal({ + title: '提示!', + content: res.data.message, + showCancel: false, + }) + } + } + }) + }, + + // 输入数量 + standardNum(e) { + console.log('form发生了submit事件,携带数据为:', e.detail.value) + var standardNum = e.detail.value; + this.setData({ + standardNum: standardNum, + }); + }, + //点击数量减少 + clickReduce: function () { + var num = this.data.standardNum; + if (num > 1) { + num--; + } + var minusStatus = num <= 1 ? 'disabled' : 'normal'; + this.setData({ + standardNum: num, + minusStatus: minusStatus + }); + }, + clickAdd: function () { + var num = this.data.standardNum; + num++; + var minusStatus = num < 1 ? 'disabled' : 'normal'; + this.setData({ + standardNum: num, + minusStatus: minusStatus + }) + }, + + //选择规格 + specsClick: function (e) { + let index = e.target.dataset.index; + this.setData({ + specsIndex: index + }) + }, + + // 跳转首页 + toIndex() { + wx.reLaunch({ + url: '/pages/index/index', + }) + }, + // 跳转购物车 + toCar() { + wx.reLaunch({ + url: '/pages/cart/cart', + }) + }, + //去登录 + login() { + wx.navigateTo({ + url: '/pages/login/login?goodsId=' + this.data.goodsId, + }) + }, + /** + * 生命周期函数--监听页面卸载 + */ + onUnload: function () { + + }, + /** + * 用户点击右上角分享 + */ + onShareAppMessage: function () { + app.share(); + return { + path: '/pages/goodsDetails/goodsDetails?goodsId=' + this.data.goodsId + '&pId=' + app.globalData.userId, + title: '三品慧采小程序等你来~' + } + } + +}) + diff --git a/pages/chuxiao/cx_details/goodsDetails.json b/pages/chuxiao/cx_details/goodsDetails.json new file mode 100644 index 0000000..ae4a221 --- /dev/null +++ b/pages/chuxiao/cx_details/goodsDetails.json @@ -0,0 +1,4 @@ +{ + "usingComponents": {}, + "navigationBarTitleText": "商品详情" +} \ No newline at end of file diff --git a/pages/chuxiao/cx_details/goodsDetails.wxml b/pages/chuxiao/cx_details/goodsDetails.wxml new file mode 100644 index 0000000..9829d7e --- /dev/null +++ b/pages/chuxiao/cx_details/goodsDetails.wxml @@ -0,0 +1,122 @@ + + + + + + + + + + + + + {{lunboindex}} / {{bnrUrl.length}}张 + + + 1 / {{bnrUrl.length}}张 + + + + + + + {{goodsList.wisdGoodsSpecList[0].specPromotionPrice}} + + + {{goodsList.wisdGoodsSpecList[0].originalPrice}} + + + {{goodsList.goodsName}} + + + 满¥{{goodsList.freightPrice}}包邮 + 分享得积分 + + + + 销量 {{goodsList.goodsSales}} + + + + + + + + + + + + + ¥{{goodsList.wisdGoodsSpecList[specsIndex].specPromotionPrice}} + + + 库存{{goodsList.wisdGoodsSpecList[specsIndex].specStock}} + {{goodsList.goodsName}} + + + + 规格 + + {{item.specName}} + + + + + 数量 + + + - + + + + + + + 加入购物车 + 立即购买 + + + + + + + + + + +