Browse Source

上传

master
前端-胡立永 8 months ago
parent
commit
d5fa115a37
11 changed files with 586 additions and 10 deletions
  1. +7
    -0
      service-uniapp-client/pages.json
  2. +14
    -0
      service-uniapp-client/pages/index/center.vue
  3. +320
    -0
      service-uniapp-client/pages/mine/merchant.vue
  4. +3
    -3
      service-uniapp-client/pages/mine/setting.vue
  5. +4
    -1
      service-uniapp-client/plugins/api.js
  6. +6
    -0
      service-uniapp-technician/pages.json
  7. +10
    -2
      service-uniapp-technician/pages/index/center.vue
  8. +12
    -4
      service-uniapp-technician/pages/index/order.vue
  9. +208
    -0
      service-uniapp-technician/pages/mine/setting.vue
  10. +2
    -0
      service-uniapp-technician/plugins/api.js
  11. BIN
      service-uniapp-technician/static/icons/icon8.png

+ 7
- 0
service-uniapp-client/pages.json View File

@ -173,6 +173,13 @@
{ {
"navigationBarTitleText" : "钱包提现" "navigationBarTitleText" : "钱包提现"
} }
},
{
"path" : "pages/mine/merchant",
"style" :
{
"navigationBarTitleText" : ""
}
} }
], ],
"globalStyle": { "globalStyle": {


+ 14
- 0
service-uniapp-client/pages/index/center.vue View File

@ -96,6 +96,13 @@
</view> </view>
</view> </view>
<view class="flex flex-sb icons">
<view @click="toUrl">
<image class="icon" src="/static/icons/m1.png" />
<view class="title">商家入驻</view>
</view>
</view>
</view> </view>
<view style="text-align: center;color: #aaa;padding: 20px;line-height: 22px;"> <view style="text-align: center;color: #aaa;padding: 20px;line-height: 22px;">
@ -183,6 +190,13 @@
}) })
}, },
//
toUrl(){
uni.navigateTo({
url: '/pages/mine/merchant'
})
},
// //
clickWallet() { clickWallet() {
uni.navigateTo({ uni.navigateTo({


+ 320
- 0
service-uniapp-client/pages/mine/merchant.vue View File

@ -0,0 +1,320 @@
<template>
<view class="content" style="padding-bottom: 90rpx;">
<mNavbar
:leftClick="toLeft"
/>
<view class="banner"></view>
<view class="b-relative" style="width: 710rpx;height: 310rpx; margin: -174rpx auto 0;">
<image src="/static/ms/1120.jpg" style="width: 710rpx;height: 310rpx;
border-radius: 20rpx;"></image>
<view class="banner-font">
商家招募
</view>
<view class="font-3">打造专业的技术服务</view>
<view class="banner-button">立即联系我们>></view>
</view>
<view>
<view class="item-card">
<view class="item-line flex">
<view class="before"></view>
<view class="label">商家姓名</view>
<input placeholder="请输入姓名" v-model="technician.name" />
</view>
<view class="item-line flex">
<view class="before"></view>
<view class="label">联系方式</view>
<input placeholder="请输入联系方式" v-model="technician.phone" />
</view>
<view class="item-line flex">
<view class="before"></view>
<view class="label" style="width: 100%">请上传营业执照</view>
</view>
<view v-if="!technician.image" @click="fileUploads" class="upload b-relative">
<uni-icons type="plusempty" size="80rpx" color="#6e3009"
style="position: absolute; top: 50rpx; left: 60rpx;" />
</view>
<view v-else @click="fileUploads" class="upload b-relative">
<image class="upload-img" :src="technician.image" mode="aspectFill"></image>
</view>
</view>
</view>
<view class="b-fiexd">
<view @click="addOrUpdateMsgTer" class="button-submit">提交</view>
</view>
</view>
</template>
<script>
import OSS from "ali-oss"
import { v4 as uuidv4 } from 'uuid';
import mNavbar from '@/components/base/m-navbar.vue'
export default {
components : {
mNavbar
},
data() {
return {
technician: {
name : '',
phone : '',
image : '',
},
ossOption: {
region : 'oss-cn-shenzhen',
accessKey: 'LTAI5tMan18fjJPUtr3Aim2W',
secretKey: 'lhALqqgYijc115wY8c1KfTYkbSnq5I',
endpoint: 'oss-cn-shenzhen.aliyuncs.com',
bucketName: 'mangoimageapplet',
staticDomain: 'https://dianpin-img.xzaiyp.top'
},
imgs : []
}
},
onShow(){
},
methods: {
getUserInfo() { //
this.$api('getUserInfo', {}, res => {
if (res.code == 200) {
this.userInfo = res.result;
}
})
},
addOrUpdateMsgTer() { //
let isOk = this.parameterVerification()
if(!isOk.auth){
return uni.showToast({
title : isOk.title,
icon : 'none'
})
}
//
this.$api('addOrUpdateShop', this.technician, res => {
if (res.code == 200) {
uni.showModal({
title: '商家入驻',
content: '商家入驻提交成功',
confirmText : '确认',
cancelText : '取消',
showCancel: false,//
success: function (res) {
if (res.confirm) {
uni.switchTab({
url: '/pages/index/center'
})
} else if (res.cancel) {}
}
});
}
})
},
parameterVerification(){ //
let { name , phone , image } = this.technician
if(name.trim() == ''){
return { title : '请填写用户名' , auth : false }
}else if(phone.trim() == ''){
return { title : '请填写手机号' , auth : false }
}else if(phone){
if(!/^1\d{10}$/.test(phone)){
return { title : '手机号格式不合法' , auth : false }
}
}else if(image.trim() == ''){
return { title : '请上传营业执照' , auth : false }
}
return { title : '验证通过' , auth : true }
},
fileUploads() { //
uni.chooseImage({
count: 1, // 91
sizeType: ['original', 'compressed'], //
sourceType: ['album', 'camera'], //
success: (res) => {
let resultPromise = [];
//
// res.tempFiles.forEach(file => {
// resultPromise.push(this.uploadFileToOSS(file));
// })
// Promise.all(resultPromise).then(imgPathArr => {
// this.imgs = imgPathArr
// })
//
this.uploadFileToOSS(res.tempFiles[0]).then(imgPath => {
this.technician.image = imgPath;
})
}
});
},
toLeft(){
uni.switchTab({
url: '/pages/index/center'
})
}
}
}
</script>
<style scoped lang="scss">
body {
background-color: #f5f5f5;
}
.banner {
width: 100vw;
height: calc(392rpx - 160rpx);
background: linear-gradient(to right, #ecb978, #ffe6ed);
color: $uni-color;
}
.banner-font {
width: 692rpx;
height: 142rpx;
font-size: 72rpx;
line-height: 66rpx;
font-weight: 900;
text-align: left;
color: #ffffff;
letter-spacing: 20rpx;
position: absolute;
left: 0;
text-align: center;
top: 84rpx;
}
.font-3 {
height: 28rpx;
line-height: 28rpx;
font-size: 24rpx;
font-family: PingFang SC, PingFang SC-Regular;
font-weight: 400;
text-align: left;
color: #ffffff;
text-shadow: 0 4rpx 6rpx 0 rgba(0, 165, 141, 0.70);
position: absolute;
left: 52rpx;
top: 228rpx;
}
.banner-button {
width: 240rpx;
height: 56rpx;
line-height: 56rpx;
background: #ffdb75;
border-radius: 24rpx;
box-shadow: 0 6rpx 6rpx 0 rgba(17, 106, 93, 0.23);
position: absolute;
right: 52rpx;
top: 220rpx;
font-size: 24rpx;
font-family: PingFang SC, PingFang SC-Bold;
font-weight: 700;
text-align: center;
color: $uni-color;
}
.item-card {
width: calc(710rpx - 40rpx);
height: 840rpx;
background: #ffffff;
border-radius: 16rpx;
margin: 40rpx auto 20rpx;
padding: 1rpx 20rpx;
}
.item-line {
height: 60rpx;
font-size: 28rpx;
font-family: PingFang SC, PingFang SC-Bold;
font-weight: 700;
text-align: left;
color: #333333;
margin-top: 40rpx;
}
.item-line .before {
content: "";
width: 8rpx;
height: 30rpx;
background: $uni-color;
border-radius: 4rpx;
margin-right: 10rpx;
margin-top: 15rpx;
}
.item-line .label {
display: flex;
align-items: center;
width: 152rpx;
height: 60rpx;
}
.item-line input {
width: 456rpx;
height: 60rpx;
line-height: 60rpx;
background: #f5f5f5;
border-radius: 12rpx;
font-size: 24rpx;
font-family: PingFang SC, PingFang SC-Medium;
font-weight: 500;
text-align: left;
color: #939393;
padding: 0 20rpx;
}
.upload {
display: flex;
align-items: center;
justify-content: center;
width: 200rpx;
height: 200rpx;
background: rgba($uni-color, 0.22);
border: 2rpx dashed $uni-color;
border-radius: 16rpx;
margin: 10rpx 12rpx;
}
.upload-img{
width: calc(100% - 4rpx);
height: calc(100% - 4rpx);
border: 2rpx dashed #ccc;
margin: 2rpx;
}
.button-submit {
display: flex;
align-items: center;
justify-content: center;
width: 596rpx;
height: 90rpx;
border-radius: 46rpx;
margin: 20rpx auto;
font-size: 28rpx;
font-family: PingFang SC, PingFang SC-Regular;
font-weight: 400;
text-align: center;
background: $uni-bg-color;
color: $uni-color;
}
</style>

+ 3
- 3
service-uniapp-client/pages/mine/setting.vue View File

@ -164,7 +164,7 @@
.item-line .before { .item-line .before {
width: 8rpx; width: 8rpx;
height: 30rpx; height: 30rpx;
background: #4fd3bc;
background: #6e3009;
border-radius: 4rpx; border-radius: 4rpx;
margin: 15rpx 12rpx 15rpx 0; margin: 15rpx 12rpx 15rpx 0;
} }
@ -194,7 +194,7 @@
width: 596rpx; width: 596rpx;
height: 90rpx; height: 90rpx;
line-height: 90rpx; line-height: 90rpx;
background: linear-gradient(180deg, #6fdfbe, #5ac796);
background: linear-gradient(178deg, #ffe6ed, #ecb978);
border-radius: 46rpx; border-radius: 46rpx;
margin: 40rpx auto; margin: 40rpx auto;
@ -203,7 +203,7 @@
font-family: PingFang SC, PingFang SC-Regular; font-family: PingFang SC, PingFang SC-Regular;
font-weight: 400; font-weight: 400;
text-align: center; text-align: center;
color: #ffffff;
color: #6e3009;
} }
} }
</style> </style>

+ 4
- 1
service-uniapp-client/plugins/api.js View File

@ -84,8 +84,11 @@ const config = {
getTenRealName : { url : '/order/getTenRealName' , method : 'GET' , auth : true}, getTenRealName : { url : '/order/getTenRealName' , method : 'GET' , auth : true},
//获取我推荐的技师记录 //获取我推荐的技师记录
getTenFans : { url : '/order/getTenFans' , method : 'GET' , auth : true }, getTenFans : { url : '/order/getTenFans' , method : 'GET' , auth : true },
//立即支付
//待支付订单,立即支付
immediatelyPay : { url : '/order/immediatelyPay' , method : 'POST' , auth : true }, immediatelyPay : { url : '/order/immediatelyPay' , method : 'POST' , auth : true },
//商家入驻
addOrUpdateShop : { url : '/post/addOrUpdateShop' , method : 'POST' , auth : true },


+ 6
- 0
service-uniapp-technician/pages.json View File

@ -18,6 +18,12 @@
"navigationBarTitleText": "" "navigationBarTitleText": ""
} }
}, },
{
"path": "pages/mine/setting",
"style": {
"navigationBarTitleText": ""
}
},
{ {
"path": "pages/login/login", "path": "pages/login/login",
"style": { "style": {


+ 10
- 2
service-uniapp-technician/pages/index/center.vue View File

@ -11,10 +11,12 @@
<view class="days">{{ userInfo.notes }}</view> <view class="days">{{ userInfo.notes }}</view>
</view> </view>
</view> </view>
<view style="position: absolute; top: 96rpx;right: 32rpx;">
<image src="/static/icons/icon8.png" mode="aspectFit" style="width: 32rpx; height: 32rpx"></image>
<view style="position: absolute; top: 96rpx;right: 32rpx;" @click="toSetting">
<image src="/static/icons/icon8.png?a=1" mode="aspectFit" style="width: 32rpx; height: 32rpx"></image>
</view> </view>
</view> </view>
<view class="one-card b-relative"> <view class="one-card b-relative">
<view style="position: absolute; top: -65rpx;left: 0rpx;"> <view style="position: absolute; top: -65rpx;left: 0rpx;">
@ -107,6 +109,12 @@
} }
}) })
}, },
//
toSetting() {
uni.navigateTo({
url: '/pages/mine/setting'
})
},
getConfig() { getConfig() {
this.$api('getConfig', {}, res => { this.$api('getConfig', {}, res => {
if (res.code == 200) { if (res.code == 200) {


+ 12
- 4
service-uniapp-technician/pages/index/order.vue View File

@ -33,22 +33,22 @@
<!-- </view> --> <!-- </view> -->
</view> </view>
<view class="flex-sb" style="margin-top: 20rpx;">
<view class="flex-sb Quantity" style="margin-top: 20rpx;">
<view :class="{'status-card' : true, select : queryParams.state == 0}" @click="selectTenState(0)"> <view :class="{'status-card' : true, select : queryParams.state == 0}" @click="selectTenState(0)">
<view> <view>
<view class="num">{{ completedQuantity }}</view>
<!-- <view class="num">{{ completedQuantity }}</view> -->
<view>已完成</view> <view>已完成</view>
</view> </view>
</view> </view>
<view :class="{'status-card' : true, select : queryParams.state == 1}" @click="selectTenState(1)"> <view :class="{'status-card' : true, select : queryParams.state == 1}" @click="selectTenState(1)">
<view> <view>
<view class="num">{{ confirmedQuantity }}</view>
<!-- <view class="num">{{ confirmedQuantity }}</view> -->
<view>待确认</view> <view>待确认</view>
</view> </view>
</view> </view>
<view :class="{'status-card' : true, select : queryParams.state == 2}" @click="selectTenState(2)"> <view :class="{'status-card' : true, select : queryParams.state == 2}" @click="selectTenState(2)">
<view> <view>
<view class="num">{{ numberOfVisits }}</view>
<!-- <view class="num">{{ numberOfVisits }}</view> -->
<view>待上门</view> <view>待上门</view>
</view> </view>
</view> </view>
@ -313,6 +313,14 @@
background-color: #f3f3f3; background-color: #f3f3f3;
font-family: PingFang SC; font-family: PingFang SC;
} }
.Quantity{
&>view{
display: flex;
justify-content: center;
align-items: center;
}
}
.rr { .rr {
height: 52rpx; height: 52rpx;


+ 208
- 0
service-uniapp-technician/pages/mine/setting.vue View File

@ -0,0 +1,208 @@
<template>
<view class="setting">
<mNavbar title="设置" :leftClick="leftClick"></mNavbar>
<van-cell-group>
<van-cell @click="fileUploads" title="头像" style="display: flex;align-items: center;" is-link>
<template #value>
<image style="width: 118rpx;height: 118rpx;border-radius: 50%;" mode="aspectFill" :src="userInfo.image"></image>
</template>
</van-cell>
<van-cell title="昵称" :value="userInfo.title" @click="showBottom = true" is-link></van-cell>
<van-cell title="性别" :value="userInfo.sex || '暂无'" @click="changeGenderShow = true" is-link></van-cell>
</van-cell-group>
<van-cell-group style="margin-top: 10rpx;">
<!-- <van-cell title="手机号" :value="userInfo.phone || '未绑定'" @click="toPhoneDetail" is-link></van-cell> -->
<van-cell title="用户协议" @click="keyValue = 'protocol';configPopupShow = true" is-link></van-cell>
<van-cell title="隐私政策" @click="keyValue = 'policy';configPopupShow = true" is-link></van-cell>
<van-cell title="关于我们" @click="keyValue = 'we';configPopupShow = true" is-link></van-cell>
</van-cell-group>
<configPopup :keyValue="keyValue" :show="configPopupShow" :list="config" @close="configPopupShow = false" />
<van-popup v-model:show="showBottom" round position="bottom" @close="showBottom = false">
<view style="padding: 20rpx;">
<view style="text-align: center;font-size: 35rpx;">修改昵称</view>
<view class="item-line flex">
<view class="before"></view>
<view class="label">用户昵称</view>
<input v-model="userInfo.title" placeholder="请输入昵称" />
</view>
<view @click="editNickName" class="button-submit">立即修改</view>
</view>
</van-popup>
<van-action-sheet v-model:show="changeGenderShow" :actions="actions" @select="selectGender" />
</view>
</template>
<script>
import mNavbar from '@/components/base/m-navbar.vue'
import configPopup from '@/components/configPopup'
import OSS from "ali-oss"
import { v4 as uuidv4 } from 'uuid';
export default {
components: { mNavbar, configPopup },
data() {
return {
userInfo: {},
configPopupShow: false,
keyValue: '',
config: [],
showBottom: false,
changeGenderShow: false,
actions: [
{ name: '男' },
{name: '女'},
{name: '未知'}
]
}
},
onShow() {
this.getUserInfo()
this.getConfig()
},
methods: {
//
leftClick() {
uni.switchTab({
url: '/pages/index/center'
})
},
//
getUserInfo() {
this.$api('giveTenInfo', {}, res => {
if (res.code == 200) {
this.userInfo = res.result.msgTen;
}
})
},
//
getConfig() {
this.$api('getConfig', {}, res => {
if (res.code == 200) {
this.config = res.result
}
})
},
//
selectGender(val) {
this.userInfo.sex = val.name;
this.editNickName();
this.changeGenderShow = false;
},
//
editNickName() {
let data = {
nickName: this.userInfo.title,
sex : this.userInfo.sex,
avatarUrl : this.userInfo.image,
}
this.$api('editUserInfo', data , res => {
if (res.code == 200) {
this.showBottom = false;
uni.showToast({
title : '修改成功',
icon : 'none'
})
this.getUserInfo();
}
})
},
//
fileUploads() {
uni.chooseImage({
count: 1, // 91
sizeType: ['original', 'compressed'], //
sourceType: ['album', 'camera'], //
success: (res) => {
let resultPromise = [];
this.uploadFileToOSS(res.tempFiles[0]).then(imgPath => {
this.userInfo.image = imgPath;
this.editNickName();
})
}
});
}
}
}
</script>
<style scoped lang="scss">
.setting {
background-color: #f3f3f3;
min-height: calc(100vh);
.item-line {
height: 60rpx;
line-height: 60rpx;
font-size: 28rpx;
font-family: PingFang SC, PingFang SC-Bold;
font-weight: 700;
text-align: left;
color: #333333;
margin-top: 40rpx;
}
.item-line .before {
width: 8rpx;
height: 30rpx;
background: $uni-color;
border-radius: 4rpx;
margin: 15rpx 12rpx 15rpx 0;
}
.item-line .label {
width: 152rpx;
height: 60rpx;
}
.item-line input {
width: 456rpx;
height: 60rpx;
line-height: 60rpx;
background: #f5f5f5;
border-radius: 12rpx;
font-size: 24rpx;
font-family: PingFang SC, PingFang SC-Medium;
font-weight: 500;
text-align: left;
color: #939393;
padding: 0 20rpx;
}
.button-submit {
width: 596rpx;
height: 90rpx;
line-height: 90rpx;
border-radius: 46rpx;
margin: 40rpx auto;
font-size: 28rpx;
font-family: PingFang SC, PingFang SC-Regular;
font-weight: 400;
text-align: center;
color: $uni-color;
background: $uni-bg-color;
}
}
</style>

+ 2
- 0
service-uniapp-technician/plugins/api.js View File

@ -108,6 +108,8 @@ const config = {
queryTerProject : { url : '/ter/queryTerProject' , method : 'POST' , auth : true }, queryTerProject : { url : '/ter/queryTerProject' , method : 'POST' , auth : true },
//技师端-提现 //技师端-提现
giveWithdrawal : { url : '/order/giveWithdrawal' , method : 'POST' , auth : true }, giveWithdrawal : { url : '/order/giveWithdrawal' , method : 'POST' , auth : true },
//修改用户信息
editUserInfo : { url : '/ter/updateUser' , method : 'POST' , auth : true },
} }


BIN
service-uniapp-technician/static/icons/icon8.png View File

Before After
Width: 32  |  Height: 32  |  Size: 1.3 KiB Width: 32  |  Height: 32  |  Size: 1.6 KiB

Loading…
Cancel
Save