diff --git a/components/shopro-auth-modal/shopro-auth-modal.vue b/components/shopro-auth-modal/shopro-auth-modal.vue index 49174fc..edf502e 100644 --- a/components/shopro-auth-modal/shopro-auth-modal.vue +++ b/components/shopro-auth-modal/shopro-auth-modal.vue @@ -3,7 +3,7 @@ - + @@ -46,13 +46,14 @@ 立即注册 - + - @@ -68,7 +72,12 @@ * @property {Array} tagTextList - 活动标签 * @event {Function} click 商品被点击 */ - import { mapMutations, mapActions, mapState, mapGetters } from 'vuex'; + import { + mapMutations, + mapActions, + mapState, + mapGetters + } from 'vuex'; export default { components: {}, data() { @@ -184,7 +193,10 @@ confirmColor: '#f0c785', content: `是否确认从购物车中删除此商品?`, success: res => { - res.confirm && this.changeCartList({ ids: [cartGoodId], art: 'delete' }); + res.confirm && this.changeCartList({ + ids: [cartGoodId], + art: 'delete' + }); } }); }, @@ -206,8 +218,14 @@ // 添加购物车,多规格 async selSku(info) { + console.log("selSku") if (this.detail.activity_type) { - this.$Router.push({ path: '/pages/goods/detail', query: { id: this.detail.id } }); + this.$Router.push({ + path: '/pages/goods/detail', + query: { + id: this.detail.id + } + }); return; } this.goodsInfo = {}; @@ -229,14 +247,21 @@ // 加入购物车 addCart(sku) { + console.log("cart ") if (sku.stock <= 0) { this.$u.toast('库存不足'); return; } if (this.detail.activity_type) { - this.$Router.push({ path: '/pages/goods/detail', query: { id: this.detail.id } }); + this.$Router.push({ + path: '/pages/goods/detail', + query: { + id: this.detail.id + } + }); return; } + let confirmGoodsList = { list: [{ goods_id: sku.goods_id, @@ -244,7 +269,7 @@ sku_price_id: sku.id, goods_price: sku.price }], - from: 'goods' + // from: 'goods' }; this.addCartGoods(confirmGoodsList).then(res => { if (res.code === 1) { @@ -345,4 +370,4 @@ } } } - + \ No newline at end of file diff --git a/components/shopro-sku/shopro-sku.vue b/components/shopro-sku/shopro-sku.vue index 14044c9..5d0a8c1 100644 --- a/components/shopro-sku/shopro-sku.vue +++ b/components/shopro-sku/shopro-sku.vue @@ -160,7 +160,7 @@ }, methods: { - ...mapActions(['addCartGoods', 'getCartList']), + ...mapActions(['addCartGoodsJson','addCartGoods', 'getCartList']), jump(path, parmas) { this.$Router.push({ path: path, @@ -343,10 +343,11 @@ list: [that.confirmGoodsInfo], from: 'goods' }; - that.addCartGoods(confirmGoodsList).then(res => { - if (res.code === 1) { + that.addCartGoodsJson(confirmGoodsList).then(res => { + console.log(res) + if (res.error.code === 200) { that.showModal = false; - that.$u.toast(res.msg); + that.$u.toast(res.error.msg); } }); } @@ -369,6 +370,7 @@ }, // 确定 confirm() { + console.log("confirm") if (this.confirmSku()) { switch (this.buyType) { case 'cart': diff --git a/main.js b/main.js index 760391b..228060f 100644 --- a/main.js +++ b/main.js @@ -17,7 +17,7 @@ async function bootstrap() { Vue.use(uView); // 加载shopro Vue.use(shopro); -Vue.use(jsonrpc); + Vue.use(jsonrpc); const app = new Vue({ store, ...App diff --git a/pages/goods/detail.vue b/pages/goods/detail.vue index 9fc648b..ae48e7b 100644 --- a/pages/goods/detail.vue +++ b/pages/goods/detail.vue @@ -210,6 +210,7 @@ import shComment from './components/sh-comment.vue'; import share from '@/shopro/share'; import { mapMutations, mapActions, mapState, mapGetters } from 'vuex'; +import jsonrpc from "@/shopro/request/indexJson.js" export default { components: { shServe, @@ -361,7 +362,7 @@ export default { getGoodsDetail() { let that = this; return new Promise((resolve, reject) => { - that.$jsonrpc('goods.detail',{id: that.$Route.query.id},'', + jsonrpc('goods.detail',{id: that.$Route.query.id},'', false).then(res=>{ console.log(res) if (res.error.code === 200) { diff --git a/pages/goods/list.vue b/pages/goods/list.vue index fd460c2..b48e7fb 100644 --- a/pages/goods/list.vue +++ b/pages/goods/list.vue @@ -15,7 +15,7 @@ - - import shFilter from './components/sh-filter.vue'; +import jsonrpc from '@/shopro/request/indexJson.js'; import { mapMutations, mapActions, mapState } from 'vuex'; let systemInfo = uni.getSystemInfoSync(); let historyTag = uni.getStorageSync('searchHistoryArr') ? JSON.parse(uni.getStorageSync('searchHistoryArr')) : []; @@ -181,7 +182,7 @@ export default { let that = this; that.loadStatus = 'loading'; console.log("good list ") - this.$jsonrpc('goods.list2',this.listParams,'加载中...').then(res=>{ + jsonrpc('goods.list2',this.listParams,'加载中...').then(res=>{ console.log(res) if (this.searchVal && !historyTag.includes(this.searchVal)) { let searchHistoryArr = JSON.stringify(this.getArr(historyTag, this.searchVal)); diff --git a/pages/index/cart.vue b/pages/index/cart.vue index fed6e4e..50828a6 100644 --- a/pages/index/cart.vue +++ b/pages/index/cart.vue @@ -40,8 +40,9 @@ ¥{{ g.sku_price ? g.sku_price.price : 0 }} @@ -73,7 +74,12 @@ + .category-box { + height: 100%; + flex: 1; + overflow: hidden; + } + \ No newline at end of file diff --git a/pages/index/category/takeout-catgory.vue b/pages/index/category/takeout-catgory.vue index c61c23c..3582df0 100644 --- a/pages/index/category/takeout-catgory.vue +++ b/pages/index/category/takeout-catgory.vue @@ -2,8 +2,7 @@ - + @@ -103,7 +102,13 @@ + \ No newline at end of file diff --git a/pages/index/category/two-catgory.vue b/pages/index/category/two-catgory.vue index d0f8880..14a509e 100644 --- a/pages/index/category/two-catgory.vue +++ b/pages/index/category/two-catgory.vue @@ -3,14 +3,10 @@ - - {{ item.name }} + + + {{ item.name }} @@ -18,7 +14,8 @@ - + {{ categoryData[listId].name }} @@ -26,24 +23,18 @@ - + v-for="(list, index1) in categoryData[listId].children" :key="index1"> {{ list.name }} - + @@ -54,168 +45,179 @@ + \ No newline at end of file diff --git a/pages/index/index.vue b/pages/index/index.vue index 728ead7..1b6d473 100644 --- a/pages/index/index.vue +++ b/pages/index/index.vue @@ -154,7 +154,7 @@ export default { }; }, computed: { - ...mapGetters(['initShop', 'homeTemplate', 'hasTemplate', 'isLogin']), + ...mapGetters(['getCartListJson','initShop', 'homeTemplate', 'hasTemplate', 'isLogin']), // 头部模块数据 headSwiperList() { if (this.homeTemplate?.length) { @@ -177,7 +177,8 @@ export default { onShow() { let that = this; this.enable = true; - this.isLogin && this.getCartList(); + // this.isLogin && this.getCartList(); + this.isLogin && this.getCartListJson(); // 网络变化检测 uni.onNetworkStatusChange(res => { this.isConnected = res.isConnected; diff --git a/pages/index/user.vue b/pages/index/user.vue index e18f843..183df8f 100644 --- a/pages/index/user.vue +++ b/pages/index/user.vue @@ -107,21 +107,23 @@ export default { onShow() { if (this.isLogin) { this.init(); - this.getUserData(); + // this.getUserData(); } this.enable = true; }, methods: { - ...mapActions(['getUserInfo', 'showAuthModal', 'getUserData']), + ...mapActions(['getUserInfoJson','getUserInfo', 'showAuthModal', 'getUserData']), onShare() { this.showShare = true; uni.hideTabBar(); }, // 初始化 init() { - this.getUserInfo() + this.getUserInfoJson() + // this.getUserInfo() .then(res => { + uni.stopPullDownRefresh(); }) .catch(e => { diff --git a/pages/index/user/userinfo-card.vue b/pages/index/user/userinfo-card.vue index 4c65ebf..4d5a36c 100644 --- a/pages/index/user/userinfo-card.vue +++ b/pages/index/user/userinfo-card.vue @@ -81,6 +81,7 @@ */ import { mapMutations, mapActions, mapState, mapGetters } from 'vuex'; import wechat from '@/shopro/wechat/wechat'; +import jsonrpc from '@/shopro/request/indexJson.js' export default { components: {}, data() { @@ -126,7 +127,7 @@ export default { } }, methods: { - ...mapActions(['getUserInfo', 'showAuthModal']), + ...mapActions(['getUserInfoJson','getUserInfo', 'showAuthModal']), jump(path, query) { this.$Router.push({ path: path, @@ -141,7 +142,8 @@ export default { async refreshWechatUser() { this.showModal = false; let token = await wechat.refresh(); - token && this.getUserInfo(token); + token && this.getUserInfoJson(token); + // token && this.getUserInfo(token); }, // 跳转门店 goStore() { diff --git a/pages/order/confirm.vue b/pages/order/confirm.vue index dc14bd5..4e5ad35 100644 --- a/pages/order/confirm.vue +++ b/pages/order/confirm.vue @@ -1,2059 +1,1859 @@ + // 发票弹窗 + .invoice-modal { + width: 750rpx; + background-color: #fff; + border-radius: 20rpx 20rpx 0 0; + height: 700rpx; + overflow: visible; + + .invoice-foot { + .price-title { + font-size: 28rpx; + font-weight: 400; + color: #333333; + } + + .price-num { + font-size: 28rpx; + font-weight: 500; + color: #eab662; + } + + .cancel-btn { + width: 335rpx; + line-height: 74rpx; + background: rgba(238, 238, 238, 1); + border-radius: 37rpx; + font-size: 28rpx; + font-weight: 400; + color: rgba(51, 51, 51, 1); + } + + .save-btn { + width: 335rpx; + line-height: 74rpx; + background: linear-gradient(90deg, + rgba(233, 180, 97, 1), + rgba(238, 204, 137, 1)); + border-radius: 37rpx; + font-size: 28rpx; + font-weight: 400; + color: rgba(255, 255, 255, 1); + } + } + + .invoice-head { + width: 100%; + height: 80rpx; + background: #f8e3bd; + border-radius: 20rpx 20rpx 0 0; + + .head-nav { + width: (750rpx/2); + position: relative; + height: 100%; + } + + .nav-title { + font-size: 24rpx; + font-weight: 500; + color: #666; + position: relative; + z-index: 6; + } + + .nav-title--active { + color: #a8700d; + font-size: 26rpx; + } + + .head-nav--active { + position: absolute; + left: 50%; + transform: translateX(-50%); + bottom: 0; + background: #fff; + width: 100%; + height: 80rpx; + background-color: #fff; + border-radius: 20rpx 20rpx 0px 0px; + + &::after { + content: ""; + display: block; + width: 40rpx; + height: 80rpx; + position: absolute; + transform: skewX(20deg); + background: #fff; + border-top-right-radius: 20rpx; + top: 0; + right: -15rpx; + } + + &::before { + content: ""; + display: block; + width: 40rpx; + height: 80rpx; + position: absolute; + transform: skewX(-20deg); + background: #fff; + border-top-left-radius: 20rpx; + top: 0; + left: -15rpx; + } + } + } + } + + // 收货地址栏 + .head_box { + background-color: #fff; + } + + .add-address-box { + min-height: 100rpx; + background: url($IMG_URL + "/imgs/order/order_address_line.png") no-repeat; + background-size: 100% auto; + background-position: bottom center; + + .select-notice { + font-weight: 400; + color: rgba(153, 153, 153, 1); + line-height: 40rpx; + } + + .name, + .phone { + font-size: 30rpx; + font-weight: 500; + } + + .phone { + margin: 0 20rpx; + } + + .tag { + background: rgba(233, 191, 113, 0.2); + border-radius: 6rpx; + padding: 0 16rpx; + line-height: 38rpx; + color: #a8700d; + font-size: 22rpx; + } + + .detail { + .address { + margin-top: 25rpx; + width: 543rpx; + font-size: 26rpx; + + font-weight: 400; + color: rgba(153, 153, 153, 1); + line-height: 40rpx; + } + } + } + + // 备注 + .remark-box { + margin-top: 20rpx; + background: #fff; + padding: 25rpx; + + .item-input { + flex: 1; + text-align: end; + font-size: 28rpx; + } + + .input-pl { + color: #c4c4c4; + } + } + + // 商品卡片 + .goods-list { + background: #fff; + margin-top: 20rpx; + + .goods-card { + min-height: 200rpx; + + .goods-price { + font-size: 30rpx; + font-weight: 500; + width: 480rpx; + color: #333333; + + .goods-num { + font-size: 28rpx; + color: #c4c4c4; + } + } + + .order-sku { + font-size: 24rpx; + font-weight: 400; + color: rgba(153, 153, 153, 1); + width: 440rpx; + margin-bottom: 20rpx; + + .order-num { + margin-right: 10rpx; + } + } + } + } + + .item-list { + height: 100rpx; + background: #fff; + padding: 0 25rpx; + + .item-title { + font-size: 28rpx; + margin-right: 20rpx; + + .activity-title { + font-size: 26rpx; + color: #999; + } + } + + .detail { + font-size: 28rpx; + color: #333; + } + + .origin-price { + font-size: 26rpx; + color: #666; + text-decoration: line-through; + } + + .price { + font-size: 26rpx; + color: #ff0000; + margin-right: 40rpx; + } + + .sel-coupon { + font-size: 26rpx; + color: #c4c4c4; + margin-right: 20rpx; + } + } + + .logistic, + .price-box, + .remark-box, + .score, + .coupon { + border-top: 1rpx solid rgba(#dfdfdf, 0.5); + } + + .border-top { + border-top: 1rpx solid rgba(#dfdfdf, 0.5); + } + + .foot-box-wrap { + height: calc(100rpx + env(safe-area-inset-bottom) / 2); + padding-bottom: calc(env(safe-area-inset-bottom) / 2); + position: relative; + width: 100%; + z-index: 70; + } + + .foot-box { + position: fixed; + display: flex; + align-items: center; + width: 100%; + height: calc(100rpx + env(safe-area-inset-bottom) / 2); + border-top: 1rpx solid #eeeeee; + background-color: #fff; + z-index: 998; + bottom: 0; + padding-bottom: calc(env(safe-area-inset-bottom) / 2); + padding: 0 30rpx; + + .btn-hover { + color: #fff; + } + + .num { + font-size: 26rpx; + color: #999; + } + + .all-money { + margin: 0 60rpx 0 20rpx; + + .price { + color: #ff0000; + } + } + + .sub-btn { + width: 210rpx; + line-height: 70rpx; + background: linear-gradient(90deg, + rgba(233, 180, 97, 1), + rgba(238, 204, 137, 1)); + box-shadow: 0px 7rpx 6rpx 0px rgba(229, 138, 0, 0.22); + border-radius: 50rpx; + font-size: 28rpx; + color: #fff; + } + } + + // 弹窗之配送方式 + // 配送方式 + .express-type { + width: 750rpx; + background-color: #fff; + border-radius: 20rpx 20rpx 0 0; + height: 700rpx; + overflow: visible; + + .express-type__head { + width: 100%; + height: 80rpx; + background: #f8e3bd; + border-radius: 20rpx 20rpx 0 0; + + &-nav { + width: (750rpx/4); + position: relative; + height: 100%; + } + + .head-nav--active { + position: absolute; + left: 50%; + transform: translateX(-50%); + bottom: 0; + background: #fff; + width: 100%; + height: 80rpx; + background-color: #fff; + border-radius: 20rpx 20rpx 0px 0px; + + &::after { + content: ""; + display: block; + width: 40rpx; + height: 80rpx; + position: absolute; + transform: skewX(20deg); + background: #fff; + border-top-right-radius: 20rpx; + top: 0; + right: -15rpx; + } + + &::before { + content: ""; + display: block; + width: 40rpx; + height: 80rpx; + position: absolute; + transform: skewX(-20deg); + background: #fff; + border-top-left-radius: 20rpx; + top: 0; + left: -15rpx; + } + } + + .head-nav__left--active { + position: absolute; + left: 50%; + transform: translateX(-50%); + bottom: 0; + background: #fff; + width: 100%; + height: 74rpx; + background-color: #fff; + border-radius: 20rpx 20rpx 0px 0px; + + &::after { + content: ""; + display: block; + width: 40rpx; + height: 74rpx; + position: absolute; + transform: skewX(20deg); + background: #fff; + border-top-right-radius: 20rpx; + top: 0; + right: -15rpx; + } + } + + .head-nav__right--active { + position: absolute; + left: 50%; + transform: translateX(-50%); + bottom: 0; + background: #fff; + width: 100%; + height: 74rpx; + background-color: #fff; + border-radius: 20rpx 20rpx 0px 0px; + + &::before { + content: ""; + display: block; + width: 40rpx; + height: 74rpx; + position: absolute; + transform: skewX(-20deg); + background: #fff; + border-top-left-radius: 20rpx; + top: 0; + left: -15rpx; + } + } + + .head-nav__title { + font-size: 24rpx; + font-weight: 500; + color: #666; + position: relative; + z-index: 6; + } + + .head-nav__title--active { + color: #a8700d; + font-size: 26rpx; + } + } + + .express-type__content { + .empty-address { + height: 120rpx; + padding: 0 25rpx; + font-size: 28rpx; + + font-weight: 400; + color: rgba(153, 153, 153, 1); + } + + // 无定位 + .location-box { + height: 500rpx; + justify-content: center; + + .nolocation-img { + width: 74rpx; + height: 90rpx; + margin-bottom: 40rpx; + } + + .location-title { + font-size: 35rpx; + + font-weight: bold; + color: rgba(70, 53, 27, 1); + margin-bottom: 20rpx; + } + + .location-tip { + font-size: 28rpx; + + font-weight: 400; + color: rgba(153, 153, 153, 1); + margin-bottom: 40rpx; + } + + .open-location { + width: 492rpx; + line-height: 70rpx; + background: linear-gradient(90deg, + rgba(233, 180, 97, 1), + rgba(238, 204, 137, 1)); + box-shadow: 0px 7rpx 6rpx 0px rgba(229, 138, 0, 0.22); + border-radius: 35rpx; + font-size: 28rpx; + + font-weight: 500; + color: rgba(255, 255, 255, 1); + } + } + + // 快递 + .express-address { + position: relative; + padding: 30rpx 25rpx; + background: url($IMG_URL + "/imgs/order/address_bg.png") no-repeat; + background-size: 430rpx 300rpx; + background-position: top right; + + .express-top { + margin-bottom: 20rpx; + width: 550rpx; + text-align: left; + + .address { + font-size: 28rpx; + font-weight: 500; + color: rgba(51, 51, 51, 1); + line-height: 40rpx; + text-align: left; + } + + .dispatch-notice { + font-size: 28rpx; + + font-weight: 500; + color: rgba(51, 51, 51, 1); + line-height: 40rpx; + text-align: left; + } + + .address-location { + position: absolute; + right: 60rpx; + top: 30rpx; + + .location-img { + width: 80rpx; + height: 90rpx; + } + + .location-text { + font-size: 18rpx; + + font-weight: 500; + color: rgba(51, 51, 51, 1); + } + } + + .tag { + background: rgba(233, 191, 113, 0.2); + border-radius: 6rpx; + padding: 0 16rpx; + line-height: 38rpx; + color: #a8700d; + font-size: 22rpx; + margin-right: 20rpx; + } + + .tag1 { + background: rgba(53, 190, 105, 0.2); + border-radius: 6rpx; + padding: 0 16rpx; + line-height: 38rpx; + color: #1bbc50; + font-size: 22rpx; + margin-right: 20rpx; + } + + .address-guide { + position: absolute; + right: 25rpx; + top: 40rpx; + color: #999999; + } + } + + .express-content { + margin-bottom: 20rpx; + + .box-line { + width: 1rpx; + height: 61rpx; + border-left: 1rpx solid rgba(238, 238, 238, 1); + margin: 0 40rpx; + } + + .phone-box1 { + + .name, + .phone { + font-size: 26rpx; + + font-weight: 400; + color: rgba(102, 102, 102, 1); + } + + .phone { + margin-left: 20rpx; + } + } + + .time-box, + .phone-box { + text-align: left; + min-height: 120rpx; + + .box-title { + font-size: 24rpx; + + font-weight: 400; + color: #666; + padding-bottom: 10rpx; + } + + .box-text { + font-size: 24rpx; + + font-weight: 500; + color: #333; + } + + .edit-phone { + width: 160rpx; + font-size: 24rpx; + + font-weight: 500; + color: #333; + } + + .box-icon { + font-size: 28rpx; + color: #999; + display: inline-block; + width: 40rpx; + text-align: center; + line-height: 40rpx; + } + } + } + + .express-bottom { + .protocol { + font-size: 24rpx; + + font-weight: 400; + color: rgba(102, 102, 102, 1); + + .protocol-text { + color: #6487a4; + } + } + } + } + } + + .express-type__bottom { + height: 90rpx; + padding: 0 30rpx; + + .cancel-btn { + width: 335rpx; + line-height: 74rpx; + background: rgba(238, 238, 238, 1); + border-radius: 37rpx; + font-size: 28rpx; + font-weight: 400; + color: rgba(51, 51, 51, 1); + } + + .save-btn { + width: 335rpx; + line-height: 74rpx; + background: linear-gradient(90deg, + rgba(233, 180, 97, 1), + rgba(238, 204, 137, 1)); + border-radius: 37rpx; + font-size: 28rpx; + font-weight: 400; + color: rgba(255, 255, 255, 1); + } + } + } + + // 选择配送给时间 + .checkTime-box { + background: rgba(255, 255, 255, 1); + border-radius: 20rpx 20rpx 0px 0px; + height: 720rpx; + text-align: center; + + .checkTime-head { + font-size: 32rpx; + + font-weight: 500; + color: rgba(51, 51, 51, 1); + line-height: 100rpx; + position: relative; + } + + .checkTime-foot { + height: 100rpx; + + .save-btn { + width: 690rpx; + line-height: 80rpx; + background: linear-gradient(90deg, + rgba(240, 199, 133, 1), + rgba(246, 214, 157, 1)); + border-radius: 40rpx; + font-size: 30rpx; + + font-weight: 500; + color: rgba(255, 255, 255, 1); + } + } + + .checkTime-content { + .checkTime-content__left { + height: 100%; + width: 190rpx; + background: #f5f5f5; + + .left-item { + font-size: 26rpx; + + font-weight: 500; + color: rgba(51, 51, 51, 1); + height: 100rpx; + width: 100%; + } + } + + .checkTime-content__right { + flex: 1; + height: 100%; + overflow-y: auto; + + .right-item { + font-size: 26rpx; + + font-weight: 500; + color: rgba(51, 51, 51, 1); + width: 100%; + text-align: center; + border-bottom: 1rpx solid rgba(#dfdfdf, 0.6); + margin: 0 30rpx; + line-height: 100rpx; + } + + .right-item-none { + font-size: 32rpx; + font-weight: 500; + color: #999999; + width: 100%; + text-align: center; + margin-top: 200rpx; + } + } + + .item--active { + font-size: 26rpx; + font-weight: 500; + color: rgba(168, 112, 13, 1) !important; + background-color: #fff; + } + } + } + \ No newline at end of file diff --git a/pages/order/detail.vue b/pages/order/detail.vue index 5983d0d..ca2bca4 100644 --- a/pages/order/detail.vue +++ b/pages/order/detail.vue @@ -24,7 +24,7 @@ - + @@ -180,6 +180,7 @@