From 26d52368a2bf465c3d1cc3745d7b2668eab0d0eb Mon Sep 17 00:00:00 2001 From: zhouzhenyuan Date: Sat, 3 Feb 2024 15:53:20 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B8=AE=E5=8A=A9=E4=B8=AD=E5=BF=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages.json | 16 ++++++++++ pages/goods/detail.vue | 56 +++++++++++++++++++++++----------- pages/news/rules/index.vue | 38 +++++++++++++++++++++++ pages/news/rules/rulesList.vue | 55 +++++++++++++++++++++++++++++++++ pages/news1/help.vue | 14 +++++++-- pages/sureOrder/index.vue | 43 ++++++++++++++------------ 6 files changed, 182 insertions(+), 40 deletions(-) create mode 100644 pages/news/rules/index.vue create mode 100644 pages/news/rules/rulesList.vue diff --git a/pages.json b/pages.json index bef6559..3c2a220 100644 --- a/pages.json +++ b/pages.json @@ -512,6 +512,22 @@ "enablePullDownRefresh": false } }, + { + "path": "rules/index", + "style": { + "navigationBarTitleText": "", + "enablePullDownRefresh": false, + "navigationStyle": "custom" + } + }, + { + "path": "rules/rulesList", + "style": { + "navigationBarTitleText": "", + "enablePullDownRefresh": false, + "navigationStyle": "custom" + } + }, { "path": "article/detail", "style": { diff --git a/pages/goods/detail.vue b/pages/goods/detail.vue index e5478d7..e61a16d 100644 --- a/pages/goods/detail.vue +++ b/pages/goods/detail.vue @@ -20,19 +20,6 @@ - @@ -74,8 +61,8 @@ {{goods.goods_name}} - - {{goods.skuList[0].goods_sku_no}} + + {{goods.skuList[0].goods_sku_id}} @@ -103,7 +90,7 @@ - 河北省秦皇岛市某某区 + {{}} @@ -295,6 +282,7 @@ import * as GoodsApi from '@/api/goods' import * as goodsCar from '@/api/cart.js' import SkuPopup from './components/SkuPopup' + import * as address from '@/api/address.js' export default { components: { SkuPopup @@ -314,7 +302,8 @@ goods: {}, suggestGoodsList: [], userInfo: {}, - + addressList:[], + addressInfo:{}, } }, onLoad(options) { @@ -322,11 +311,42 @@ this.getGoodsDetail(options.goodsId) }, onShow() { + this.getAddressList() this.getSuggestGoods() - this.userInfo = uni.getStorageSync('userInfo') + this.userInfo = uni.getStorageSync('userInfo'); + }, methods: { // 选择商品规格 + getAddressList(){ + const that = this + return new Promise((resolve, reject) => { + address.list().then(res => { + if (res.code == 200) { + that.addressList = res.data.list + console.log('58555559999') + that.getDefaultAddress() + } + }) + .catch() + }) + }, + getDefaultAddress() { + console.log('5855555') + const that = this + return new Promise((resolve, reject) => { + address.defaultId().then(res => { + if (res.code == 200) { + for (var i = 0; i < that.addressList.length; i++) { + if (res.data.defaultId == that.addressList[i].address_id) { + that.addressInfo = that.addressList[i] + } + } + } + }) + .catch() + }) + }, choseSku() { this.showSkuPopup = true }, diff --git a/pages/news/rules/index.vue b/pages/news/rules/index.vue new file mode 100644 index 0000000..10d3ffb --- /dev/null +++ b/pages/news/rules/index.vue @@ -0,0 +1,38 @@ + + + + + \ No newline at end of file diff --git a/pages/news/rules/rulesList.vue b/pages/news/rules/rulesList.vue new file mode 100644 index 0000000..dabe8a8 --- /dev/null +++ b/pages/news/rules/rulesList.vue @@ -0,0 +1,55 @@ + + + + + \ No newline at end of file diff --git a/pages/news1/help.vue b/pages/news1/help.vue index 26df32d..909bc71 100644 --- a/pages/news1/help.vue +++ b/pages/news1/help.vue @@ -3,7 +3,7 @@ 帮助中心 - + @@ -47,6 +47,11 @@ this.getHelpList() }, methods: { + goListPage(item){ + uni.navigateTo({ + url:'/pages/news/rules/rulesList?itemInfo='+JSON.stringify(item) + }) + }, getHelpList() { const that = this help.helpList() @@ -59,8 +64,11 @@ .finally(() => that.isLoading = false) }, openContent(item) { - this.strings = item.content - this.dialog = true + uni.navigateTo({ + url:'/pages/news/rules/index?itemInfo='+JSON.stringify(item) + }) + // this.strings = item.content + // this.dialog = true }, } } diff --git a/pages/sureOrder/index.vue b/pages/sureOrder/index.vue index 07aa581..68675ae 100644 --- a/pages/sureOrder/index.vue +++ b/pages/sureOrder/index.vue @@ -5,14 +5,16 @@ :background="background"> - + 送货上门 - + 到店自取 - + 请点击添加收货地址 @@ -240,34 +242,37 @@ export default { data() { return { - buyType: false, + buyType: 'sm', background: { background: 'url(' + img + ') center top no-repeat', backgroundSize: '100% auto', }, goodsInfo: {}, - shopInfo:{}, - addressList:[], - addressInfo:{} + shopInfo: {}, + addressList: [], + addressInfo: {} } }, onLoad(options) { - if(options.goodsInfo){ + if (options.goodsInfo) { this.goodsInfo = JSON.parse(options.goodsInfo) } }, onShow() { this.getGoodsInfo() this.getAddressList(); - + }, methods: { - getDefaultAddress(){ + choseType(val) { + this.buyType = val + }, + getDefaultAddress() { return new Promise((resolve, reject) => { address.defaultId().then(res => { - if(res.code==200){ - for(var i=0;i { address.list().then(res => { - if(res.code==200){ + if (res.code == 200) { that.addressList = res.data.list that.getDefaultAddress() } @@ -289,11 +294,11 @@ .catch() }) }, - getAddressList(){ + getAddressList() { const that = this return new Promise((resolve, reject) => { address.list().then(res => { - if(res.code==200){ + if (res.code == 200) { that.addressList = res.data.list that.getDefaultAddress() } @@ -304,11 +309,11 @@ getGoodsInfo() { return new Promise((resolve, reject) => { storeShop.list().then(res => { - console.log(res,'获取店铺信息') + console.log(res, '获取店铺信息') }) .catch() }) - + }, orderSubmit() { const that = this