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 @@ @@ -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 @@ + + + + + \ 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 @@ + + + + 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 @@ + + + + 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 @@ + + + + + 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 @@ - + - - 搜索 + + 搜索
-