diff --git a/pages/index/addHangOrder.vue b/pages/index/addHangOrder.vue index 081a9d2..a7a9cea 100644 --- a/pages/index/addHangOrder.vue +++ b/pages/index/addHangOrder.vue @@ -5,7 +5,7 @@ - + - + 备注: @@ -32,11 +32,11 @@ 女士连衣裙(HD738206579) - + 颜色:黑色,尺码:s码 * 2 颜色:黑色,尺码:s码 * 2 - @@ -115,7 +115,7 @@ ¥2952.00 - 选好了 + 选好了 @@ -146,7 +146,6 @@ export default { data() { return { - isCollapse: false, voiceText: '', recordState: false, pageNumber: 1, @@ -170,8 +169,12 @@ } } this.tui.request("/app/sale/listPages", "POST", obj, false, false).then((res) => { - if (res.code == 200) { - this.regList = res.result.records; + if (res.code == 200) { + for (let i=0;i { + if (res.code == 200) { + + } else { + this.tui.toast(res.message) + } + }).catch((res) => {}) }, //弹出商品规格选择 toggle(type, id) { @@ -281,10 +305,10 @@ //通过商品id查询商品详细信息 getById(id) { this.tui.request("/app/product/getById", "POST", { - id: id + id: "XD1718301576285786112" }, false, true).then((res) => { if (res.code == 200) { - + } else { this.tui.toast(res.message) } diff --git a/pages/index/checkShop.vue b/pages/index/checkShop.vue index eeccb76..c167186 100644 --- a/pages/index/checkShop.vue +++ b/pages/index/checkShop.vue @@ -8,13 +8,13 @@ :options="options1" index="1" v-for="item in shopList" - :key="item.id" + :key="item.shopId" @click="onActionItemSwipe(item)" > - + {{ item.shopName }} - + @@ -71,38 +71,45 @@ export default { shopNameOld: '', shopList: [], shopId: null, - current: '' + current: '', + name:'' } }, onLoad() { this.getList() }, - mounted() { - console.log(this.shopIndex) - this.current = this.shopIndex - }, methods: { ...mapMutations(['setShopIndex']), - submit() { - const shop = this.shopList.find(v => v.id === this.current) - if (shop.hasOwnProperty('id')) { - this.setShopIndex(shop) - this.tui.toast('切换店铺名称成功!', 2000,) - setTimeout(() => { - uni.reLaunch({ - url: '/pages/index/index' - // url: '/pages/index/index' - }) - }, 200) - } - }, + submit() { + this.tui.request("/auth/chooseShop", "POST", { + shopId: this.current + }, false, true).then((res) => { + if (res.code == 200) { + uni.setStorageSync('shopName',this.name) + this.tui.toast('切换店铺成功', 2000, true) + setTimeout(() => { + uni.reLaunch({ + url: '/pages/index/index' + }) + }, 200) + } else { + this.tui.toast(res.message) + return + } + }).catch((res) => {}) + }, + //初始化店铺列表 getList() { - this.tui.request("/app/shop/getAll", "get", { + this.tui.request("/auth/getShopByUser", "post", { // shopId: 1, }, false, true).then((res) => { if(res.code == 200){ - console.log(this.shopIndex) - this.shopList = res.result + for (let i=0;i