diff --git a/pages/Orderstatistics/index.vue b/pages/Orderstatistics/index.vue index 35c7f14..9d11f07 100644 --- a/pages/Orderstatistics/index.vue +++ b/pages/Orderstatistics/index.vue @@ -283,9 +283,7 @@ }) }, gotomapdetail(item) { - // uni.navigateTo({ - // url: '../detailmap/index?oid=' + item.id, - // }); + this.$refs.detailPopup.open() }, getlist() { diff --git a/pages/detailmap/index.nvue b/pages/detailmap/index.vue similarity index 100% rename from pages/detailmap/index.nvue rename to pages/detailmap/index.vue diff --git a/pages/index/index.vue b/pages/index/index.vue index f2ebaca..972c6d9 100644 --- a/pages/index/index.vue +++ b/pages/index/index.vue @@ -14,8 +14,9 @@ - + {{shop.shopName}} + {{businessStatus == '1'?'暂停营业':'正常营业'}} @@ -29,7 +30,7 @@ - + 0 @@ -37,7 +38,7 @@ 待接单 - + 0 @@ -45,7 +46,7 @@ 待取货 - + 0 @@ -55,7 +56,7 @@ - + 0 @@ -63,7 +64,7 @@ 待消费 - + 0 @@ -71,7 +72,7 @@ 待退款 - + 0 @@ -140,7 +141,7 @@ 店铺管理 - + @@ -172,6 +173,14 @@ 扫码核销 + + + + + + 打印设置 + + @@ -182,6 +191,17 @@ + + + + + 请选择所属区域 + + + {{item.shop.shopName}} + + + @@ -196,7 +216,9 @@ width: 0, currentIndex: 0, businessStatus:1, - shop:{} + shop:{}, + areaList:[], + shopList: [], } }, components: { @@ -205,18 +227,58 @@ myCenter }, onShow() { - let that = this - uni.getSystemInfo({ - success: function(info) { - that.width = info.screenWidth * 2; - } - }); - this.getBusinessStatus() + this.indexInit() }, onLoad() { }, methods: { + indexInit(){ + let that = this + uni.getSystemInfo({ + success: function(info) { + that.width = info.screenWidth * 2; + } + }); + this.getBusinessStatus() + if(!uni.getStorageSync('area')){ + this.checkArea() + } + }, + //切换店铺 + onActionItemClick(item) { + if(this.type == 'wuliu'){ + this.current = item.id + this.name = item.companyName + }else{ + this.current = item.shop.id + this.name = item.shopName + this.shopOwnerPhone = item.shopOwnerPhone + } + if (!this.shopName) return this.tui.toast('请输入新店铺名称', 2000) + this.tui.request("/app/shop/modifyShopNameById", "put", { + id: this.shopId, + shopName: this.shopName + }, false, true).then((res) => { + if (res.code === 200) { + this.getList() + this.onPopupClose() + } else { + this.tui.toast(res.message) + } + }) + }, + checkArea(){ + this.NB.sendRequest("/auth/getShopByUser", {}, false, 'post', 'application/x-www-form-urlencoded').then((res) => { + if (res.code == 200) { + this.areaList = res.result + this.$refs.areaPopup.open() + } else { + this.tui.toast(res.message) + } + + }) + }, //获取营业状态 getBusinessStatus(){ this.NB.sendRequest("/app/shoptakeaway/getByShopId", { @@ -232,6 +294,25 @@ uni.hideLoading() }).catch((res) => {}) }, + onClickArea(item){ + uni.setStorageSync('area',JSON.stringify(item)) + // this.searchForm.regionId = item.id + // this.getDelivery(); + // this.getShopArea(); + // let that = this + // that.tui.request("/worker/admin/add", "POST", {userId:uni.getStorageSync('id'),isChangeArea:0,region:item.id}, false, true).then((res) => { + // if (res.code == 200) { + // if(res.result != null){ + // uni.setStorageSync('worker',res.result) + // } + // } else { + // that.tui.toast(res.message) + // return + // } + // uni.hideLoading() + // }).catch((res) => {}) + this.$refs.areaPopup.close() + }, //更改营业状态 updateStatus(){ let that = this; @@ -261,33 +342,36 @@ let url = '' switch (type) { case 'tj': - url = '/package1/myCenter/dataStatistics' + url = '/pages/shop/dataStatistics' break; case 'db': - url = '/package2/shop/shopOrderList?index=' + index + url = '/pages/shop/shopOrderList?index=' + index break; case 'sp': - url = '/package1/myCenter/goodsList' + url = '/pages/shop/goodsList' break; case 'dp': url = '' break; case 'dd': - url = '/package2/shop/shopOrderList' + url = '/pages/shop/shopOrderList' break; case 'zd': - url = '/package2/shop/shopBill' + url = '/pages/shop/shopBill' break; case 'pj': let item = { shopScore:uni.getStorageSync('shopScore'), id:uni.getStorageSync('id') } - url = '/package1/group/shopEvaluate?item=' + JSON.stringify(item) + url = '/pages/shop/shopEvaluate' break; case 'hx': this.scanCodeAdd() break; + case 'dy': + url = '/pages/myCenter/setPrint' + break; default: } uni.navigateTo({ @@ -346,6 +430,9 @@ this.lastIndex = this.currentIndex this.currentIndex = index switch (index) { + case 0: + this.indexInit() + break; case 1: that.$refs.deLivery.init() break; @@ -474,4 +561,31 @@ height: 40rpx; line-height: 40rpx; } + .popup-area-content { + align-items: center; + justify-content: center; + padding: 30rpx; + width: 500rpx; + height: auto; + background-color: #fff; + } + + .popup-area-title { + font-size: 36rpx; + font-weight: bold; + text-align: center; + position: relative; + } + + .popup-area-container { + margin-top: 20rpx; + height: 100rpx; + border-radius: 20rpx; + background: #088FEB; + line-height: 100rpx; + text-align: center; + border-bottom: 1px solid #eee; + border-top: 1px solid #eee; + color: #fff; + } \ No newline at end of file diff --git a/pages/login/login.vue b/pages/login/login.vue index 65a84d9..7f54e5a 100644 --- a/pages/login/login.vue +++ b/pages/login/login.vue @@ -47,7 +47,16 @@ :class="{ opatity: enabled}" @click="submit"> {{i18n.login.login}} - + + + + 选择登录店铺 + + + {{item.shopName}} + + + @@ -322,6 +331,8 @@ uni.setStorageSync('shopAddress',res.result.shopAddress) uni.setStorageSync('shopRemark',res.result.remark) uni.setStorageSync("shopOwnerPhone", item.shopOwnerPhone) + uni.setStorageSync('schoolShop',res.result.shop) + uni.setStorageSync('area',JSON.stringify(item)) uni.setStorageSync("isShop",true) setTimeout(() => { uni.reLaunch({ @@ -338,6 +349,11 @@ } }); }, + //打开弹出层 + toggle(type) { + this.type = type + this.$refs.popup.open(type) + }, submit() { if (this.enabled) { uni.showToast({ @@ -383,9 +399,14 @@ uni.setStorageSync("wayValue", this.wayValue) uni.setStorageSync("nickname", res.result.user.nickname) uni.setStorageSync('username',this.mobile) - uni.setStorageSync('shop',JSON.stringify(res.result.shopList[0].shop)) - this.checkShop(res.result.shopList[0]) + if (res.result.shopList.length > 1) { + this.shopList = res.result.shopList; + + this.toggle("center"); + }else{ + this.checkShop(res.result.shopList[0]) + } }) } diff --git a/pages/myCenter/setPrint.vue b/pages/myCenter/setPrint.vue new file mode 100644 index 0000000..042ceac --- /dev/null +++ b/pages/myCenter/setPrint.vue @@ -0,0 +1,319 @@ + + + + + + diff --git a/pages/shop/addGoods.vue b/pages/shop/addGoods.vue new file mode 100644 index 0000000..bb04381 --- /dev/null +++ b/pages/shop/addGoods.vue @@ -0,0 +1,881 @@ + + + + + + \ No newline at end of file diff --git a/pages/shop/addType.vue b/pages/shop/addType.vue new file mode 100644 index 0000000..e0a98bd --- /dev/null +++ b/pages/shop/addType.vue @@ -0,0 +1,381 @@ + + + + + \ No newline at end of file diff --git a/pages/shop/dataStatistics.vue b/pages/shop/dataStatistics.vue new file mode 100644 index 0000000..9b1b030 --- /dev/null +++ b/pages/shop/dataStatistics.vue @@ -0,0 +1,333 @@ + + + + + \ No newline at end of file diff --git a/pages/shop/goodsList.vue b/pages/shop/goodsList.vue new file mode 100644 index 0000000..a8ab062 --- /dev/null +++ b/pages/shop/goodsList.vue @@ -0,0 +1,570 @@ + + + + + \ No newline at end of file diff --git a/pages/shop/orderDetail.vue b/pages/shop/orderDetail.vue new file mode 100644 index 0000000..b729866 --- /dev/null +++ b/pages/shop/orderDetail.vue @@ -0,0 +1,271 @@ + + + + + \ No newline at end of file diff --git a/pages/shop/shopBill.vue b/pages/shop/shopBill.vue new file mode 100644 index 0000000..b7f685f --- /dev/null +++ b/pages/shop/shopBill.vue @@ -0,0 +1,189 @@ + + + + + \ No newline at end of file diff --git a/pages/shop/shopEvaluate.vue b/pages/shop/shopEvaluate.vue new file mode 100644 index 0000000..9d4a669 --- /dev/null +++ b/pages/shop/shopEvaluate.vue @@ -0,0 +1,434 @@ + + + + + \ No newline at end of file diff --git a/pages/shop/shopOrderList.vue b/pages/shop/shopOrderList.vue new file mode 100644 index 0000000..2c1efd1 --- /dev/null +++ b/pages/shop/shopOrderList.vue @@ -0,0 +1,330 @@ + + + + + \ No newline at end of file diff --git a/pages/shop/shopSettlementDetail.vue b/pages/shop/shopSettlementDetail.vue new file mode 100644 index 0000000..ea5188a --- /dev/null +++ b/pages/shop/shopSettlementDetail.vue @@ -0,0 +1,154 @@ + + + + + \ No newline at end of file