diff --git a/pages.json b/pages.json index 801c5d6..b018799 100644 --- a/pages.json +++ b/pages.json @@ -48,6 +48,24 @@ "navigationBarTitleText": "uni-app" } }, + { + "path" : "search/index", + "style" : { + "navigationBarTitleText" : "搜索" + } + }, + { + "path" : "search/result", + "style" : { + "navigationBarTitleText" : "搜索" + } + }, + { + "path" : "search/techanResult", + "style" : { + "navigationBarTitleText" : "搜索" + } + }, { "path" : "video/video", "style" : { @@ -133,6 +151,12 @@ "navigationBarTitleText" : "填写订单" } }, + { + "path" : "order/cartOrder", + "style" : { + "navigationBarTitleText" : "提交订单" + } + }, { "path" : "line/orders", "style" : { diff --git a/pages/cart/cart.vue b/pages/cart/cart.vue index 0488387..b9a8146 100644 --- a/pages/cart/cart.vue +++ b/pages/cart/cart.vue @@ -1,5 +1,11 @@ + + + 购物车为空 + 去逛逛 + + 全部删除 @@ -68,6 +74,8 @@ 去下单 + + @@ -94,7 +102,15 @@ methods: { getList () { this.Post({},"/api/cart/get_list").then(res=>{ - let resData = (res.data ||[]) + // let resData = (res.data ||[]) + let resData = (res.data ||[]).map(v=>{ + return { + id: 1, + name: '1', + goods: [v] + } + }) + let shopSelectIds = [] let skuSelectIds = [] this.cartList.forEach(v=>{ @@ -230,14 +246,19 @@ // 判断全选 judgeSelectAll () { this.cartList.forEach(v=>{ - if(v.goods.some(x=>x.sku&& x.sku.flag!= "off"&&!x.is_seld)) { - v.is_seld = false; + if (v.goods.some(x=>x.sku.flag != 'off')) { + + if(v.goods.some(x=>x.sku&& x.sku.flag!= "off"&&!x.is_seld)) { + v.is_seld = false; + } else { + v.is_seld = true; + } } else { - v.is_seld = true; + v.is_seld = false } }) - if (this.cartList.every(v=>v.is_seld)) { + if (this.cartList.every(v=>v.is_seld) && this.cartList.length>0) { this.selectAll = true } else { this.selectAll = false @@ -248,7 +269,14 @@ // 去下单 goOrder () { - let buyGoods = this.cartList.filter(v=>v.is_seld) + let buyGoods = [] + this.cartList.forEach(v=>{ + v.goods.forEach(x=>{ + if(x.is_seld) { + buyGoods.push(x) + } + }) + }) if (buyGoods.length<=0) { uni.showToast({ title: '请选择要购买的产品', @@ -275,7 +303,7 @@ } else if (v.product.type == "post") { techanOrderList.push({ pInfo: v.product, - sInfo: {...v.sku, buyNum: v.num} + sInfo: {...v.sku, buyNum: v.num, use_type: 3} }) } else if (v.product.type == "hotel") { hotelOrderList.push(v) @@ -499,4 +527,29 @@ text-align: right; padding-bottom: 25rpx; } + .no-cart{ + display: flex; + flex-direction: column; + align-items: center; + font-weight: 500; + font-size: 32rpx; + color: #000000; + text-align: center; + padding-top: 90rpx; + image{ + width: 347.33rpx; + height: 320.67rpx; + } + .no-cart-btn{ + width: 167rpx; + height: 62rpx; + border-radius: 11rpx; + border: 1px solid #6A8A27; + font-weight: 400; + font-size: 24rpx; + color: #6A8A27; + text-align: center; + line-height: 62rpx; + } + } diff --git a/static/js/CommonFunction.js b/static/js/CommonFunction.js index e31cd14..8a7dc85 100644 --- a/static/js/CommonFunction.js +++ b/static/js/CommonFunction.js @@ -307,5 +307,9 @@ Vue.prototype.goCartNextPage= function(currentPageIndex){ } else { console.log(orderPage, nextPage, '结束') // todo 最后下单页面 + uni.navigateTo({ + url: '/subPackages/order/cartOrder' + }) + } } \ No newline at end of file diff --git a/subPackages/food/detail.vue b/subPackages/food/detail.vue index 7a4f31f..553e749 100644 --- a/subPackages/food/detail.vue +++ b/subPackages/food/detail.vue @@ -204,7 +204,7 @@ // 获取景点信息 getInfo() { - this.Post({id: this.id},'/api/product/get_product_detail').then(res => { + this.Post({id: this.id,order:'desc'},'/api/product/get_product_detail').then(res => { if (res.data.title) { uni.setNavigationBarTitle({ title: res.data.title @@ -281,6 +281,7 @@ goods.buyNum = this.buyNum this.Post({sku_id: goods.id,num: this.buyNum },'/api/cart/add_sku').then(res => { if (res.code == 1) { + uni.showToast({title: res.msg,icon: 'none'}); // uni.$emit("updateDataByConnect", {msgType:'updateCartDataInfo',data:null}) this.closePopup() // this.$refs.cartDataVueRef.openPop() diff --git a/subPackages/food/order.vue b/subPackages/food/order.vue index 4111660..8643782 100644 --- a/subPackages/food/order.vue +++ b/subPackages/food/order.vue @@ -226,6 +226,7 @@ product_num: sku.buyNum, remark: sku.remark, phone: this.phone, + "start_time":"","end_time":"","use_date":"","visitors":"" } goods.push(param) }) @@ -256,10 +257,10 @@ order_id: order_id, type: "miniprogram", platform: 'miniprogram' - }, '/api/pay/unify').then(res => { + }, '/api/order/pay').then(res => { if (res.data) { uni.requestPayment({ - nonceStr: res.data.nonceStr, + nonceStr: res.data.nonceStr , package: res.data.package, paySign: res.data.paySign, signType: res.data.signType, diff --git a/subPackages/order/cartOrder.vue b/subPackages/order/cartOrder.vue new file mode 100644 index 0000000..1dc1c16 --- /dev/null +++ b/subPackages/order/cartOrder.vue @@ -0,0 +1,457 @@ + + + + 酒店 + + + + + + 自提 + + + + + + {{item.pInfo.title}} + ¥{{item.sInfo.price/100}} + + + {{item.sInfo.sku_name}} + x{{item.sInfo.buyNum}} + + + {{tag}} + + + + + + 自提点: + {{item.pickupAddress.title}} + + + + + 小计: 205 + + + + + 邮寄 + + + + + + {{item.pInfo.title}} + ¥{{item.sInfo.price/100}} + + + {{item.sInfo.sku_name}} + x{{item.sInfo.buyNum}} + + + {{tag}} + + + + + + 运费: + ¥{{item.post}} + + + 收货人信息: + {{item.contacts.name}} {{item.contacts.tel}} + + + 收货人地址: + {{item.contacts.address}} + + + + + 小计: 205 + + + + + + 游玩 + + + + + + + + + 优惠券 + + 选择优惠券 + + + + -¥{{coupon.activity.money/100}} + -{{coupon.activity.fold*10}}% + > + + + + + + + + + + 合计: + {{ total() }} + + + 提交订单 + + + + + + + + \ No newline at end of file diff --git a/subPackages/search/index.vue b/subPackages/search/index.vue new file mode 100644 index 0000000..3c173cb --- /dev/null +++ b/subPackages/search/index.vue @@ -0,0 +1,225 @@ + + + + + + 搜索 + + + 搜索历史 + + + + {{his}} + + 大家在搜 + + + {{hot.name}} + + + + + + + diff --git a/subPackages/search/result.vue b/subPackages/search/result.vue new file mode 100644 index 0000000..4f5ec7a --- /dev/null +++ b/subPackages/search/result.vue @@ -0,0 +1,326 @@ + + + + + + + 搜索 + + + + + {{ item.name }} + + + + + + + + + + {{item.ext.title}} + + + + {{item.ext.address}} + {{item.ext.scene_address}} + + + + + + {{item.ext.price/100}} + + + + + + + + + + + —— 暂无更多 —— + + + + + + + diff --git a/subPackages/search/techanResult.vue b/subPackages/search/techanResult.vue new file mode 100644 index 0000000..99f3e9c --- /dev/null +++ b/subPackages/search/techanResult.vue @@ -0,0 +1,699 @@ + + + + + + + + + 搜索 + + + + + + + 综合 + + + 销量 + + ▼ + ▼ + + + + 价格 + + ▼ + ▼ + + + + + + 暂无搜索结果 + + + + + + + + {{item.title}} + + + {{tag}} + + + + + + {{item.price/100}} + {{item.market_price/100}} + + + + + + + + + + + + + + + + + + + + + {{(sku[productIndex].price||0)/100}} + 已选择:{{sku[productIndex].sku_name}} + + + + + 规格 + + + + + {{botItem.sku_name}} + + + 不可购买 + + + + + + 数量 + + + - + + {{ buyNum }} + + + + + + + + + + + 加入购物车 + + + + + + + + + + + + diff --git a/subPackages/techan/detail.vue b/subPackages/techan/detail.vue index 762cb41..c9d740e 100644 --- a/subPackages/techan/detail.vue +++ b/subPackages/techan/detail.vue @@ -255,7 +255,8 @@ goods.buyNum = this.buyNum this.Post({sku_id: goods.id,num: this.buyNum },'/api/cart/add_sku').then(res => { if (res.code == 1) { - uni.$emit("updateDataByConnect", {msgType:'updateCartDataInfo',data:null}) + uni.showToast({title: res.msg,icon: 'none'}); + // uni.$emit("updateDataByConnect", {msgType:'updateCartDataInfo',data:null}) this.closePopup() // this.$refs.cartDataVueRef.openPop() } diff --git a/subPackages/techan/index.vue b/subPackages/techan/index.vue index e7cddbe..820022d 100644 --- a/subPackages/techan/index.vue +++ b/subPackages/techan/index.vue @@ -2,17 +2,17 @@ - + - - 搜索 + + 搜索 - + @@ -37,14 +37,14 @@ 综合 - 销量 + 销量 ▼ ▼ - 价格 + 价格 ▼ ▼ @@ -75,52 +75,56 @@ - + - + 自提点 - {{info.pickupAddress.title||'选择提货地址'}} + + {{info.pickupAddress.title}} + + 选择提货地址 @@ -248,7 +251,7 @@ export default { orderList.forEach(v=>{ v.is_post = v.sInfo.use_type==3?3:v.sInfo.use_type==1?2:1 // 产品自己的方式 v.is_user_post = v.sInfo.use_type==1?2:1 // 用户自选方式 - v.pickupAddress = v.pickupAddress || {} // 自提信息 + v.pickupAddress = v.pickupAddress || null // 自提信息 v.contacts = v.contacts || null // 收货地址 v.post = v.post || null // 运费信息 v.remark = v.remark||"" @@ -467,7 +470,7 @@ export default { } } if (info.is_user_post == 2) { - if (!this.pickupAddress.id) { + if (!info.pickupAddress.id) { uni.showToast({title: '请选择自提点',icon: 'none'}); return; } else { @@ -482,6 +485,8 @@ export default { // 如果是购物车下单 if (this.isShoppingCart) { this.$store.commit("changeTechanOrderList", this.orderList); + uni.setStorageSync("techanOrderList", JSON.stringify(this.orderList)) + console.log(this.orderList) this.goCartNextPage(1) return } @@ -537,11 +542,18 @@ export default { getDataByConnect(data) { if (data.msgType == "updatePickUpPoint") { - let tempData = this.orderList.find(v=>v.pInfo.id == data.data.pInfoId) - console.log(tempData) - if (tempData) { - tempData.pickupAddress = data.data.selectItem + for(let p of this.orderList) { + if (p.sInfo.id == data.data.skuId) { + let selectItem = data.data.selectItem + p.pickupAddress = selectItem + p.pickupAddress.address = selectItem.address; + p.pickupAddress.title = selectItem.title; + p.pickupAddress.id = selectItem.id; + p.pickupAddress.tel = selectItem.tel; + break; + } } + this.$forceUpdate() } }, diff --git a/subPackages/techan/selfPickUpPoint.vue b/subPackages/techan/selfPickUpPoint.vue index 86d2478..4a5691d 100644 --- a/subPackages/techan/selfPickUpPoint.vue +++ b/subPackages/techan/selfPickUpPoint.vue @@ -40,12 +40,14 @@ list: [], pickupId: null, goodsId: null, + skuId: null, selectItem: {}, }; }, onLoad(options) { this.pickupId = options.pickupId || null this.goodsId = options.goodsId + this.skuId = options.skuId }, onShow(options) { this.getList() @@ -107,7 +109,7 @@ return; } // 返回上一个页面并带回selectItem - uni.$emit("updateDataByConnect", {msgType:'updatePickUpPoint',data:{selectItem: this.selectItem, pInfoId: this.goodsId}}) + uni.$emit("updateDataByConnect", {msgType:'updatePickUpPoint',data:{selectItem: this.selectItem, pInfoId: this.goodsId,skuId: this.skuId}}) uni.navigateBack() } }, diff --git a/subPackages/ticket/detail.vue b/subPackages/ticket/detail.vue index cf5e608..3b66823 100644 --- a/subPackages/ticket/detail.vue +++ b/subPackages/ticket/detail.vue @@ -551,6 +551,7 @@ goods.buyNum = this.buyNum this.Post({sku_id: goods.id,num: this.buyNum },'/api/cart/add_sku').then(res => { if (res.code == 1) { + uni.showToast({title: res.msg,icon: 'none'}); // uni.$emit("updateDataByConnect", {msgType:'updateCartDataInfo',data:null}) this.closeCartPopup() // this.$refs.cartDataVueRef.openPop() diff --git a/subPackages/ticket/order.vue b/subPackages/ticket/order.vue index ae64bc9..c654917 100644 --- a/subPackages/ticket/order.vue +++ b/subPackages/ticket/order.vue @@ -52,7 +52,7 @@ - + 优惠券 选择优惠券 @@ -171,6 +171,7 @@ singleOrder: {}, // 深拷贝修改的数据 skuInfo: {}, // 预定须知当前点击的sku + isShoppingCart: false, } }, onLoad(options) { @@ -180,6 +181,7 @@ // this.getList(); this.$store.commit("choseCoupon", ""); this.initPageData() + this.getUserInfo() }, onShow() { @@ -240,7 +242,9 @@ } catch(e){ console.log(e) } - this.getMaxCouponData() + if (!this.isShoppingCart) { + this.getMaxCouponData() + } }, clearTel () {this.phone = ''}, @@ -320,6 +324,12 @@ if (this.singleOrder.seldDateIndex<0) { this.singleOrder.seldDateIndex = this.singleOrder.allSeldDate.findIndex(item => item.stock > 0) } + if (this.singleOrder.seldDateIndex) { + uni.showToast({ + title: '暂无库存' + }) + return + } this.getTimeStock(this.singleOrder.allSeldDate[this.singleOrder.seldDateIndex].date) this.openPop() }) @@ -404,8 +414,16 @@ /*---------------------------价格日历-----------------------------------*/ order() { let goods = [] + if (this.orderList.some(v=>v.allSeldDate).length<=0) { + uni.showToast({title: '请选择价格日历',icon:'none'}) + return + } + if (this.orderList.some(v=>v.sInfo.is_time_stock && v.seldTimeIndex < 0)) { + uni.showToast({title:'请选择分时',icon:'none'}) + return; + } + // 设置参数 - let canSubmit = true this.orderList.filter(v=>v.sInfo.buyNum>0).forEach(item=>{ let sku = item.sInfo let use_date = item.allSeldDate[item.seldDateIndex].date @@ -428,6 +446,7 @@ // 如果是购物车下单 if (this.isShoppingCart) { this.$store.commit("changeTicketOrderList", this.orderList); + uni.setStorageSync("ticketOrderList", this.orderList) this.goCartNextPage(2) return } @@ -471,8 +490,16 @@ }) } }) - } + }, + // 获取默认手机号 + getUserInfo () { + this.Post({},'/api/uservice/user/getMyInfo').then(res=>{ + if (res.code==1 && res.data &&res.data.mobile) { + this.phone = res.data.mobile + } + }) + }, } } @@ -961,6 +988,7 @@ padding: 20rpx 50rpx; align-items: center; justify-content: space-between; + z-index: 99; .btn { width: 250rpx; height: 80rpx;
—— 暂无更多 ——