From 43263bd99da8bf2bed6138f91f05a62c8d3d104f Mon Sep 17 00:00:00 2001 From: wangxiaowei <1121133807@qq.com> Date: Thu, 25 Jul 2024 22:09:55 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=88=91=E7=9A=84=E5=B7=A5?= =?UTF-8?q?=E5=85=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/store.js | 10 ++- bundle/pages/user_spread/user_spread.vue | 91 +++++++++++++++++++++--- components/index-home/index-home.vue | 8 +-- pages/goods_search/goods_search.vue | 27 +++++-- pages/user/user.vue | 32 ++++++++- 5 files changed, 144 insertions(+), 24 deletions(-) diff --git a/api/store.js b/api/store.js index 16417a0..13c59c7 100644 --- a/api/store.js +++ b/api/store.js @@ -15,11 +15,15 @@ export function getIndexCategory(params) { } //获取菜单 export function getMenu(data) { - return request.get('menu/lists', { - params: data, - }); + return request.get('menu/lists', {params: data}); } +//获取我的工具 +export function getTools(data) { + return request.get('menu/tools'); +} + + //商品栏目 export function getGoodsColumn() { return request.get('goods_column/getGoodsColumnList'); diff --git a/bundle/pages/user_spread/user_spread.vue b/bundle/pages/user_spread/user_spread.vue index 1d2fcf7..5724744 100644 --- a/bundle/pages/user_spread/user_spread.vue +++ b/bundle/pages/user_spread/user_spread.vue @@ -45,9 +45,23 @@ - - + + + + + + + + + + + + + + + + + @@ -107,9 +121,13 @@ {{applyObject.district}} - - 身份证: - {{applyObject.id_card}} + + 身份证正面: + + + + 身份证反面: + 手持照片: @@ -270,6 +288,8 @@ mobile: '', realName: '', id_card: '', + front_id_card: '', + back_id_card: '', hand_id_card: '', reason: '', region: '', @@ -312,6 +332,48 @@ this.wxImage = data.wx_image } }, + + // 身份证正面 + uploadFrontCard() { + uni.chooseImage({ + count: 1, + success: async (file) => { + uni.showLoading({ + title: '上传中...' + }) + const {success,data} = await ossUpload(file.tempFilePaths[0], file.tempFiles[0].path, 'user_spread_idcard/') + if(success) { + this.front_id_card = data + uni.hideLoading() + } else { + uni.showToast({icon:'none', title: '上传失败'}) + uni.hideLoading() + } + } + }) + }, + + + // 身份证反面 + uploadBackCard() { + uni.chooseImage({ + count: 1, + success: async (file) => { + uni.showLoading({ + title: '上传中...' + }) + const {success,data} = await ossUpload(file.tempFilePaths[0], file.tempFiles[0].path, 'user_spread_idcard/') + if(success) { + this.back_id_card = data + uni.hideLoading() + } else { + uni.showToast({icon:'none', title: '上传失败'}) + uni.hideLoading() + } + } + }) + }, + // 上传手持身份证 uploadHandCard() { uni.chooseImage({ @@ -410,7 +472,8 @@ reason, mobile, realName, - id_card, + front_id_card, + back_id_card, region, hand_id_card } = this; @@ -422,9 +485,16 @@ return; } - if (!id_card) { + if (!front_id_card) { this.$toast({ - title: "请输入身份证号码" + title: "请上传身份证正面" + }); + return; + } + + if (!back_id_card) { + this.$toast({ + title: "请上传身份证反面" }); return; } @@ -450,7 +520,8 @@ district: districtId, reason: reason, mobile, - id_card, + front_id_card, + back_id_card, hand_id_card }; const { diff --git a/components/index-home/index-home.vue b/components/index-home/index-home.vue index 79225a6..951140a 100644 --- a/components/index-home/index-home.vue +++ b/components/index-home/index-home.vue @@ -6,7 +6,7 @@ - + 活动专区 @@ -106,9 +106,9 @@ - + diff --git a/pages/goods_search/goods_search.vue b/pages/goods_search/goods_search.vue index 29599ae..e8ac785 100644 --- a/pages/goods_search/goods_search.vue +++ b/pages/goods_search/goods_search.vue @@ -45,13 +45,12 @@ - - - - {{item.name}} - + + + {{item.name}} + {{tip}} @@ -100,7 +99,8 @@ historyList: [], price_type: 0, showList: false, - list: [] + list: [], + tip: '' }; }, @@ -246,13 +246,28 @@ getShop(e) { this.showList = true let shop_name = e + uni.showLoading({ + title: '搜索中', + mask: true + }) + setTimeout(() => { searchGoods({shop_name}).then((res) => { if (res.code == 1) { this.list = res.data + if (res.data == '') { + this.tip = '没有搜索到相关商品' + } } + uni.hideLoading() }) }, 200) + }, + toPage(id) { + this.showList = false + uni.navigateTo({ + url: '/pages/goods_details/goods_details?id=' + id + }) } } }; diff --git a/pages/user/user.vue b/pages/user/user.vue index 6510d80..8a5ff76 100644 --- a/pages/user/user.vue +++ b/pages/user/user.vue @@ -244,6 +244,27 @@ + + + 我的工具 + + + + + + + {{userInfo.wait_pay}} + + + + {{item.name}} + + + + + + @@ -256,7 +277,8 @@ mapActions } from 'vuex' import { - getMenu + getMenu, + getTools } from '@/api/store' import { toLogin @@ -274,11 +296,13 @@ showNav: false, navBg: 0, menuList: [], + toolsList: [] }; }, onLoad(options) { this.getMenuFun(); + this.getToolsFun() }, onShow() { @@ -336,6 +360,12 @@ this.menuList = data } }, + async getToolsFun() { + const {data,code} = await getTools() + if (code == 1) { + this.toolsList = data + } + }, onCopy(e) { copy(this.userInfo.sn) },