添加我的工具

This commit is contained in:
wangxiaowei 2024-07-25 22:09:55 +08:00
parent 395e6f2218
commit 43263bd99d
5 changed files with 144 additions and 24 deletions

@ -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');

@ -45,9 +45,23 @@
</view>
<view class="form-item">
<u-field v-model="id_card" :label-width="150" label="身份证:" :border-bottom="false"
placeholder="请输入您的身份证">
</u-field>
<u-field label="身份证正面" label-width="160" placeholder="请上传身份证正面" :border-bottom="false" disabled />
<view class="apply-form-upload" @click="uploadFrontCard" v-if="front_id_card">
<image :src="front_id_card" mode="aspectFit"></image>
</view>
<view class="apply-form-upload" @click="uploadFrontCard" v-else>
<u-icon name="plus" color="#e2e2e2" size="48" top="28"></u-icon>
</view>
</view>
<view class="form-item">
<u-field label="身份证反面" label-width="160" placeholder="请上传身份证反面" :border-bottom="false" disabled />
<view class="apply-form-upload" @click="uploadBackCard" v-if="back_id_card">
<image :src="back_id_card" mode="aspectFit"></image>
</view>
<view class="apply-form-upload" @click="uploadBackCard" v-else>
<u-icon name="plus" color="#e2e2e2" size="48" top="28"></u-icon>
</view>
</view>
<view class="form-item">
@ -107,9 +121,13 @@
{{applyObject.district}}
</view>
</view>
<view class="info-item flex nr" v-if="applyObject.id_card">
<view class="label">身份证:</view>
<view class="info-text ml20">{{applyObject.id_card}}</view>
<view class="info-item flex nr" v-if="applyObject.front_id_card">
<view class="label">身份证正面:</view>
<u-image width="300rpx" height="400rpx" mode="widthFix" :src="applyObject.front_id_card"></u-image>
</view>
<view class="info-item flex nr" v-if="applyObject.back_id_card">
<view class="label">身份证反面:</view>
<u-image width="300rpx" height="400rpx" mode="widthFix" :src="applyObject.back_id_card"></u-image>
</view>
<view class="info-item flex nr" v-if="applyObject.hand_id_card">
<view class="label">手持照片:</view>
@ -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 {

@ -6,7 +6,7 @@
<bubble-tips top="280rpx" :discharge="isDischarge"></bubble-tips>
<view class="content">
<view class="nav bg-white m-t-20" v-if="newNavList.length">
<!-- <view class="nav bg-white m-t-20" v-if="newNavList.length">
<swiper :style="'height:' + navSwiperH + 'rpx;'" @change="swiperChange">
<swiper-item v-for="(items, index) in newNavList" :key="index">
<view class="nav-list flex flex-wrap">
@ -46,7 +46,7 @@
</view>
<u-icon name="arrow-right"></u-icon>
</view>
</router-link>
</router-link> -->
<view class="activity-zone m-t-20" v-if="activityArea.length">
<view class="flex p-20 row-center xxl bold white">
活动专区
@ -106,9 +106,9 @@
<active-area :list="newGoods" :price-type="priceType" type="new" title="新品推荐" url="/pages/active_list/active_list?type=new"></active-area>
</view>
<view class="m-t-20" v-if="appConfig.index_setting.community_show && communityArticle.length">
<!-- <view class="m-t-20" v-if="appConfig.index_setting.community_show && communityArticle.length">
<community-recommend :list="communityArticle" title="种草社区" url="/pages/community/community"></community-recommend>
</view>
</view> -->
<view class="m-t-20" v-if="appConfig.index_setting.shop_show && shopLists.length">
<shop-recommend type="shop-recommends" title="店铺推荐" :list="shopLists"></shop-recommend>

@ -45,13 +45,12 @@
<view class="list" v-if="showList">
<view class="search-block" v-for="(item, index) in list" :key="index">
<view class="flex search-list">
<router-link :to="{path: '/pages/goods_details/goods_details', query: {id: item.id}}" class="flex">
<u-icon name="search" size="24"></u-icon>
<view class="m-l-10">{{item.name}}</view>
</router-link>
<view class="flex search-list" @click="toPage(item.id)">
<u-icon name="search" size="24"></u-icon>
<view class="m-l-10">{{item.name}}</view>
</view>
</view>
<view v-if="list == ''" class="m-t-10 bold text-center">{{tip}}</view>
</view>
</view>
</template>
@ -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
})
}
}
};

@ -244,6 +244,27 @@
</view>
</view>
<view class="order-nav bg-white">
<view class="title flex row-between">
<view class="lg bold">我的工具</view>
</view>
<view class="nav flex">
<router-link class="item" :to="{path: item.url}" v-for="(item, index) in toolsList" :key="index">
<view class="flex-col col-center m-b-20">
<view class="icon-contain">
<view v-if="userInfo.wait_pay" class="badge xs flex row-center bg-white">
{{userInfo.wait_pay}}
</view>
<image class="nav-icon"
:src="item.image"></image>
</view>
<view class="sm m-t-10 bold">{{item.name}}</view>
</view>
</router-link>
</view>
</view>
<goods-column ref="mescrollItem"></goods-column>
<tabbar></tabbar>
</view>
@ -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)
},