第一次上传
This commit is contained in:
@@ -0,0 +1,82 @@
|
||||
import { Service } from '@/Service/Service';
|
||||
/*****社区*****/
|
||||
class vpMerchService {
|
||||
private static GetMerchListPath: string = '/Merch/GetMerchList';
|
||||
/*****商家列表*****/
|
||||
static GetMerchList(assId: string,comId:string,lon:number,lat:number,page:number) {
|
||||
var result = Service.Request(this.GetMerchListPath, 'GET', {assId,comId,lon,lat,page});
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
private static GetMerchInfoPath: string = '/Merch/GetMerchInfo';
|
||||
/*****店铺详情*****/
|
||||
static GetMerchInfo(merchId: string,page:number) {
|
||||
var result = Service.Request(this.GetMerchInfoPath, 'GET', {merchId,page});
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
private static GetGoodsInfoPath: string = '/Merch/GetGoodsInfo';
|
||||
/*****商品详情*****/
|
||||
static GetGoodsInfo(goodsId: string,page:number) {
|
||||
var result = Service.Request(this.GetGoodsInfoPath, 'GET', {goodsId,page});
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
private static GetMyMerchInfoPath: string = '/Merch/GetMyMerchInfo';
|
||||
/*****获取用户个人绑定商家*****/
|
||||
static GetMyMerchInfo() {
|
||||
var result = Service.Request(this.GetMyMerchInfoPath, 'GET', {});
|
||||
return result;
|
||||
}
|
||||
|
||||
private static UpdateMerchPath: string = '/Merch/UpdateMerch';
|
||||
/*****修改用户个人绑定商家*****/
|
||||
static UpdateMerch(comId:string,name:string,showImg:string,phone:string,price:number,province:string,city:string,county:string,address:string,lon:number,lat:number,busTime:string,tag:string) {
|
||||
var result = Service.Request(this.UpdateMerchPath, 'POST', {comId,name,showImg,phone,price,province,city,county,address,lon,lat,busTime,tag});
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
private static GetMerchGoodsPath: string = '/Merch/GetMerchGoods';
|
||||
/*****获取商家商品列表*****/
|
||||
static GetMerchGoods(page:number) {
|
||||
var result = Service.Request(this.GetMerchGoodsPath, 'GET', {page});
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
private static UpdateGoodsStatusPath: string = '/Merch/UpdateGoodsStatus';
|
||||
/*****修改商品上下架*****/
|
||||
static UpdateGoodsStatus(goodsId:string) {
|
||||
var result = Service.Request(this.UpdateGoodsStatusPath, 'POST', {goodsId});
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
private static UpdateMerchGoodsPath: string = '/Merch/UpdateMerchGoods';
|
||||
/*****修改商品*****/
|
||||
static UpdateMerchGoods(goodsId:string,name:string,img:string,price:number,brief:string,status:number) {
|
||||
var result = Service.Request(this.UpdateMerchGoodsPath, 'POST', {goodsId,name,img,price,brief,status});
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
private static DelGoodsPath: string = '/Merch/DelGoods';
|
||||
/*****删除商品*****/
|
||||
static DelGoods(goodsId:string) {
|
||||
var result = Service.Request(this.DelGoodsPath, 'POST', {goodsId});
|
||||
return result;
|
||||
}
|
||||
|
||||
private static GetUnitMerchInfoPath: string = '/Order/GetUnitMerchInfo';
|
||||
/*****商家详情*****/
|
||||
static GetUnitMerchInfo(merchId:string) {
|
||||
var result = Service.Request(this.GetUnitMerchInfoPath, 'GET', {merchId});
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
||||
export { Service, vpMerchService };
|
||||
@@ -0,0 +1,5 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="48" height="48" viewBox="0 0 48 48" fill="none">
|
||||
<rect x="0" y="0" width="48" height="48" fill="white" fill-opacity="0"/>
|
||||
<circle cx="24" cy="14" r="6" stroke="#FFCC00" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
|
||||
<path d="M24 24V42M12 32H36" stroke="#FFCC00" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 406 B |
Binary file not shown.
|
After Width: | Height: | Size: 774 B |
@@ -0,0 +1,102 @@
|
||||
<template>
|
||||
<view>
|
||||
<view class="" style=" margin: 25rpx 0; padding: 0 20rpx; display: flex; align-items: center; justify-content: space-between;">
|
||||
<view @click="changetab(index)" v-for="(item,index) in tag" :key="index"
|
||||
:class="{active:index!=currentIndex,actived:index==currentIndex}" class="tag"
|
||||
style=" padding: 14rpx 36rpx; border-radius: 14rpx; ">
|
||||
{{item}}
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="" style=" margin:20rpx; margin-top: 30rpx; " >
|
||||
<view class="" style="display: flex; align-items: center; padding: 40rpx 30rpx; margin-top: 20rpx; justify-content: space-between; border-radius: 20rpx; box-shadow: 0 0 10rpx 4rpx #e2e2e2; " >
|
||||
<view class="">
|
||||
<view class="" style="display: flex; align-items: center;" >
|
||||
<img :src="Service.GetMateUrlByImg('/static/dele/dele1.jpg')" style=" border-radius: 10rpx; width: 60rpx; height: 60rpx;" alt="" />
|
||||
<text style="margin-left: 10rpx;" >星巴克咖啡</text>
|
||||
</view>
|
||||
<view class="" style="margin-top: 15rpx; color: #999999; " >
|
||||
今天 14:30
|
||||
</view>
|
||||
</view>
|
||||
<view class="" style="font-weight: 600; color: #666666;" >
|
||||
¥-38.00
|
||||
</view>
|
||||
</view>
|
||||
<up-loadmore :status="status" />
|
||||
</view>
|
||||
|
||||
<view class="" style=" margin:20rpx; margin-top: 30rpx; " >
|
||||
<view class="" style="display: flex; align-items: center; padding: 40rpx 30rpx; margin-top: 20rpx; justify-content: space-between; border-radius: 20rpx; box-shadow: 0 0 10rpx 4rpx #e2e2e2; " >
|
||||
<view class="">
|
||||
<view class="" style="display: flex; align-items: center;" >
|
||||
<img :src="Service.GetMateUrlByImg('/static/dele/dele1.jpg')" style=" border-radius: 10rpx; width: 60rpx; height: 60rpx;" alt="" />
|
||||
<text style="margin-left: 10rpx;" >星巴克咖啡</text>
|
||||
</view>
|
||||
<view class="" style="margin-top: 15rpx; color: #999999; " >
|
||||
今天 14:30
|
||||
</view>
|
||||
</view>
|
||||
<view class="" style="font-weight: 600; color: #666666;" >
|
||||
¥-38.00
|
||||
</view>
|
||||
</view>
|
||||
<up-loadmore :status="status" />
|
||||
</view>
|
||||
|
||||
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { onShow, onLoad } from "@dcloudio/uni-app";
|
||||
import { ref } from "vue";
|
||||
import { Service } from '@/Service/Service'
|
||||
|
||||
let status=ref('nomore')
|
||||
let currentIndex=ref(0)
|
||||
let tag = ref([
|
||||
'全部',
|
||||
'今日',
|
||||
'本周',
|
||||
'本月'
|
||||
])
|
||||
onLoad((data:any) => {
|
||||
|
||||
if(data.type==0){
|
||||
uni.setNavigationBarTitle({
|
||||
title:'交易明细'
|
||||
})
|
||||
}else{
|
||||
uni.setNavigationBarTitle({
|
||||
title:'交易记录'
|
||||
})
|
||||
}
|
||||
});
|
||||
|
||||
onShow(() => {
|
||||
|
||||
});
|
||||
const changetab=(e:number)=>{
|
||||
currentIndex.value=e
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.active{
|
||||
background-color: #F3F4F6;
|
||||
color: #4B5563;
|
||||
}
|
||||
.actived{
|
||||
background-color: #FF6B35;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.tag{
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: fit-content;
|
||||
font-size: 28rpx;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,310 @@
|
||||
<template>
|
||||
<view style="display: flex; flex-direction: column; height: 100vh; ">
|
||||
<view class="merchant-info">
|
||||
<view class="">
|
||||
<text class="section-title">付款给商户</text>
|
||||
<text class="merchant-name">{{ storeInfo.name }}</text>
|
||||
</view>
|
||||
<image :src="Service.GetMateUrlByImg(storeInfo.logo)" mode="aspectFill" class="merchant-icon">
|
||||
</image>
|
||||
</view>
|
||||
|
||||
<view class=""
|
||||
style=" padding: 30rpx 40rpx; flex: 1; background-color: #fff; width: 100%; border-top-right-radius: 30rpx; border-top-left-radius: 30rpx; ">
|
||||
<view class="" style="font-size: 24rpx; font-weight: 600;">
|
||||
余额
|
||||
</view>
|
||||
<view class="" style="margin: 20rpx 0; padding: 20rpx 0; border-bottom: 1rpx solid #e2e2e2; ">
|
||||
<!-- <up-input prefixIcon='rmb' :prefixIconStyle="{ 'color':'#000','font-weight': 600,'font-size':'60rpx' }"
|
||||
fontSize='50rpx'
|
||||
auto-blur="false"
|
||||
@focus="focusFunc"
|
||||
:customStyle="{'color':'#000', height: '90rpx', 'padding-left': 0, 'font-weight': 600,'padding-bottom':'20rpx' }"
|
||||
border="bottom" v-model="account"></up-input> -->
|
||||
<view class="" style="display: flex; align-items: center; width: 100%; ">
|
||||
<view class="" style="height: 70rpx; display: flex; align-items: center; ">
|
||||
<up-icon name="rmb" :bold='true' size='50rpx' color="#000"></up-icon>
|
||||
</view>
|
||||
<view class="" style=" height: 70rpx; line-height: 70rpx; font-weight: 600;font-size: 70rpx; ">
|
||||
{{account}}
|
||||
</view>
|
||||
<view class="" v-if="isShow"
|
||||
style="margin: 0 10rpx; width: 4rpx; height: 70rpx; background-color: var(--nav-mian); ">
|
||||
|
||||
</view>
|
||||
|
||||
</view>
|
||||
|
||||
|
||||
</view>
|
||||
<view class="" style="font-size: 24rpx; color: #6B6B6B; ">
|
||||
<text>当前拥有{{ userInfo.integral }}积分</text>
|
||||
<text style="margin-left: 10rpx;">可抵扣 ¥{{ userInfo.integral }}元</text>
|
||||
</view>
|
||||
<!-- <view class="" style="font-size: 28rpx; margin-top: 10rpx; ">
|
||||
<text :style="{'margin-right':!des?'':'15rpx'}">{{des}}</text>
|
||||
<text @click="showDes=true" style="font-weight: 600; color: #586B95;">添加备注</text>
|
||||
</view> -->
|
||||
<view class=""
|
||||
style="background-color: #f5f5f5; padding: 20rpx; position: fixed; bottom: 0; left: 0; width: 100%; padding-top: 25rpx; padding-bottom: 20rpx; ">
|
||||
<view class="" style="display: grid; grid-template-columns: repeat(4,1fr); ">
|
||||
<view class="button" @click="input(item)" v-for="(item,index) in 3" :key="index">
|
||||
{{item}}
|
||||
</view>
|
||||
<view @click="deleInput()" class="button">
|
||||
<up-icon name="backspace" :bold='true' size="26"></up-icon>
|
||||
</view>
|
||||
</view>
|
||||
<view class="" style="display: grid; grid-template-columns: 3fr 1fr; ">
|
||||
<view class="">
|
||||
<view class="" style="display: grid; grid-template-columns: repeat(3,1fr); ">
|
||||
<view class="button" @click="input(item+3)" v-for="(item,index) in 3" :key="index">
|
||||
{{item+3}}
|
||||
</view>
|
||||
</view>
|
||||
<view class="" style="display: grid; grid-template-columns: repeat(3,1fr); ">
|
||||
<view class="button" @click="input(item+6)" v-for="(item,index) in 3" :key="index">
|
||||
{{item+6}}
|
||||
</view>
|
||||
</view>
|
||||
<view class="" style="display: grid; grid-template-columns: 2fr 1fr; ">
|
||||
<view @click="input(0)" class="button">
|
||||
0
|
||||
</view>
|
||||
<view @click="input('.')" class="button">
|
||||
.
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view @click="save()" class="button" style="background-color: var(--nav-mian); color: #fff; ">
|
||||
付款
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
|
||||
|
||||
|
||||
|
||||
<!-- <up-popup :show="showDes">
|
||||
<view style="width: 100%; padding: 50rpx 30rpx; ">
|
||||
<view class="">
|
||||
<text style="font-size: 28rpx; font-weight: 600;">添加备注</text>
|
||||
</view>
|
||||
<view class=""
|
||||
style=" margin-top: 30rpx; padding: 20rpx 0; border-bottom: 1rpx solid #e2e2e2; border-top: 1rpx solid #e2e2e2; ">
|
||||
<up-input placeholder="请输入内容" border="none" v-model="des"></up-input>
|
||||
</view>
|
||||
|
||||
<view class=""
|
||||
style=" margin: 0 110rpx; margin-top: 50rpx; display: flex; align-items: center; justify-content: space-between; ">
|
||||
<view class="" @click="showDes=false,des=''"
|
||||
style=" background-color: #f2f2f2; color: #000; padding: 20rpx 80rpx;border-radius: 20rpx; display: flex; align-items: center; justify-content: center; ">
|
||||
取消
|
||||
</view>
|
||||
<view class="" @click="showDes=false"
|
||||
style=" background-color: #07c160; color: #fff; padding: 20rpx 80rpx;border-radius: 20rpx; display: flex; align-items: center; justify-content: center; ">
|
||||
确定
|
||||
</view>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
</up-popup> -->
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { onShow, onLoad } from "@dcloudio/uni-app";
|
||||
import { Service } from "@/Service/Service"
|
||||
import { onUnmounted, ref } from "vue";
|
||||
import { vpMerchService } from "@/Service/vp/vpMerchService";
|
||||
import { vpUserService } from "@/Service/vp/vpUserService";
|
||||
import { vpLoginService } from "@/Service/vp/vpLoginService";
|
||||
|
||||
let account = ref('')
|
||||
// let showDes = ref(false)
|
||||
let des = ref()
|
||||
let isShow = ref(false)
|
||||
let timeOut = ref()
|
||||
|
||||
let par = ref('')
|
||||
let openId=ref('')
|
||||
let storeInfo = ref<any>({})
|
||||
let userInfo = ref<any>({})
|
||||
onLoad((data : any) => {
|
||||
focusFunc()
|
||||
getOpid()
|
||||
// 支付宝
|
||||
// #ifdef MP-ALIPAY
|
||||
let querdata = Service.GetStorageCache('quer')
|
||||
par.value = querdata.query.par
|
||||
getData()
|
||||
// #endif
|
||||
// #ifdef MP-WEIXIN
|
||||
if (data.par) {
|
||||
console.log(data);
|
||||
par.value = data.par
|
||||
|
||||
getData()
|
||||
} else {
|
||||
par.value = ''
|
||||
getData()
|
||||
}
|
||||
// #endif
|
||||
});
|
||||
|
||||
onShow(() => {
|
||||
|
||||
});
|
||||
|
||||
onUnmounted(() => {
|
||||
clearInterval(timeOut.value)
|
||||
})
|
||||
|
||||
const getData = () => {
|
||||
vpMerchService.GetUnitMerchInfo(par.value).then(res => {
|
||||
if (res.code == 0) {
|
||||
storeInfo.value = res.data.merchInfo
|
||||
userInfo.value = res.data.accInfo
|
||||
} else {
|
||||
Service.Msg(res.msg)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
const input = (val : any) => {
|
||||
|
||||
if (account.value.split('').length > 8) {
|
||||
return
|
||||
}
|
||||
|
||||
if (val == '.') {
|
||||
let arr = account.value.split('').filter((item => item == val))
|
||||
if (arr.length > 0) {
|
||||
return
|
||||
}
|
||||
|
||||
if (!account.value) {
|
||||
account.value = '0.'
|
||||
return
|
||||
}
|
||||
}
|
||||
account.value = account.value + val
|
||||
|
||||
|
||||
|
||||
}
|
||||
const deleInput = () => {
|
||||
let arr = account.value.split('')
|
||||
arr.pop()
|
||||
account.value = arr.join('')
|
||||
}
|
||||
|
||||
const save = () => {
|
||||
if(!account.value){
|
||||
Service.Msg('请输入金额')
|
||||
return
|
||||
}
|
||||
Service.LoadIng('支付中')
|
||||
vpUserService.PayMerch(storeInfo.value.merchId,Number(account.value),'wx',openId.value).then(res=>{
|
||||
if(res.code==0){
|
||||
wx.requestPayment({
|
||||
timeStamp: res.data.resdata.timeStamp,
|
||||
nonceStr: res.data.resdata.nonceStr,
|
||||
package: res.data.resdata.package,
|
||||
signType: res.data.resdata.signType,
|
||||
paySign: res.data.resdata.paySign,
|
||||
success(payRes) {
|
||||
Service.LoadClose()
|
||||
//支付完成处理逻辑
|
||||
Service.Msg("支付成功");
|
||||
},
|
||||
fail(err) {
|
||||
Service.Msg("支付失败");
|
||||
console.error('pay fail', err)
|
||||
}
|
||||
})
|
||||
}else{
|
||||
Service.Msg(res.msg)
|
||||
}
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
const focusFunc = () => {
|
||||
timeOut.value = setInterval(() => {
|
||||
isShow.value = !isShow.value
|
||||
}, 1000)
|
||||
}
|
||||
|
||||
const getOpid=()=>{
|
||||
uni.login({
|
||||
onlyAuthorize: true,
|
||||
provider: 'weixin',
|
||||
success: function (loginRes) {
|
||||
vpLoginService.GetOpenIdByWeixin(loginRes.code,1).then(res=>{
|
||||
if(res.code==0){
|
||||
openId.value=res.data
|
||||
}else{
|
||||
Service.Msg(res.msg)
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
page {
|
||||
background-color: #f5f5f5;
|
||||
}
|
||||
|
||||
// 按键
|
||||
.button {
|
||||
background-color: #fff;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
padding: 18rpx 0;
|
||||
border-radius: 10rpx;
|
||||
font-weight: 700;
|
||||
margin: 8rpx;
|
||||
font-size: 38rpx;
|
||||
}
|
||||
|
||||
.button:active {
|
||||
background-color: #ababab;
|
||||
}
|
||||
|
||||
/* 商户信息 */
|
||||
.merchant-info {
|
||||
padding: 30rpx 40rpx;
|
||||
margin-bottom: 20rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
.merchant-name {
|
||||
font-size: 24rpx;
|
||||
color: #999999;
|
||||
display: block;
|
||||
margin-top: 20rpx;
|
||||
}
|
||||
|
||||
.section-title {
|
||||
font-size: 32rpx;
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
|
||||
.merchant-icon {
|
||||
width: 95rpx;
|
||||
height: 95rpx;
|
||||
border-radius: 50%;
|
||||
margin-right: 20rpx;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,137 @@
|
||||
<template>
|
||||
<view style=" margin: 20rpx; padding: 20rpx;">
|
||||
|
||||
<view @click="uploadFImg()" class=""
|
||||
style=" display: flex; flex-direction: column; justify-content: center; align-items: center; ">
|
||||
<img v-if="userInfo.headImg!=''" :src="Service.GetMateUrlByImg(userInfo.headImg)" style="width: 140rpx; height: 140rpx; border-radius: 50%; " alt="" />
|
||||
<view v-else class=""
|
||||
style="background-color: #EBEBEB; width: 140rpx; height: 140rpx; border-radius: 50%; display: flex; align-items: center; justify-content: center; ">
|
||||
<img :src="Service.GetIconImg('/static/userFunc/photo.png')" style="width: 50rpx; height: 50rpx; "
|
||||
alt="" />
|
||||
</view>
|
||||
<view class="" style="margin-top: 15rpx; font-size: 26rpx; color: #999999; ">
|
||||
点击更换头像
|
||||
</view>
|
||||
</view>
|
||||
|
||||
|
||||
<view class="" style=" margin-top: 30rpx; ">
|
||||
<up-form labelWidth='90' labelPosition="left" :model="userInfo" ref="form1">
|
||||
<up-form-item label="昵称" prop="userInfo.name" :borderBottom="true" ref="item1">
|
||||
<up-input inputAlign='right' v-model="userInfo.nick" border="none"></up-input>
|
||||
</up-form-item>
|
||||
|
||||
<up-form-item label="性别" prop="userInfo.sex" :borderBottom="true">
|
||||
<view class="" style="position: relative; width: 100%;" >
|
||||
<view class="" style=" position: absolute; top: -8rpx; right: 0; ">
|
||||
<up-radio-group style="width: 300rpx;" v-model="userInfo.sex" placement="row">
|
||||
<up-radio v-for="(item, index) in radiolist1" activeColor='#FF6A00' :key="index"
|
||||
iconPlacement="right" :label="item.name" :name="item.name">
|
||||
</up-radio>
|
||||
</up-radio-group>
|
||||
</view>
|
||||
</view>
|
||||
</up-form-item>
|
||||
<up-form-item label="生日" prop="userInfo.sex" :borderBottom="true" >
|
||||
<view class="" style="position: relative;width: 100%;" >
|
||||
<view @click="showDate=true" class="" style=" position: absolute; right: 0; display: flex; align-items: center; ">
|
||||
{{Service.formatDate(userInfo.date,2)}}
|
||||
<u-icon name="arrow-right" size="24rpx" color="#000"></u-icon>
|
||||
</view>
|
||||
</view>
|
||||
</up-form-item>
|
||||
<up-form-item label="手机号" prop="userInfo.sex" :borderBottom="true">
|
||||
<up-input inputAlign='right' v-model="userInfo.phone" border="none"></up-input>
|
||||
</up-form-item>
|
||||
<up-form-item label="邮箱" prop="userInfo.sex" :borderBottom="true">
|
||||
<up-input inputAlign='right' v-model="userInfo.age" border="none"></up-input>
|
||||
</up-form-item>
|
||||
</up-form>
|
||||
</view>
|
||||
|
||||
<up-datetime-picker :show="showDate" @cancel="showDate=!showDate" @confirm="dateConfirm" v-model="userInfo.date" mode="date"></up-datetime-picker>
|
||||
<view class="" style="width: 100%; height: 200rpx;">
|
||||
|
||||
</view>
|
||||
<view class="" style=" width: 100% ; background-color: #fff; position: fixed; bottom: 15rpx; left: 0; ">
|
||||
<view class=""
|
||||
style=" margin: 0 20rpx; padding: 20rpx 0; color: #fff; display: flex; align-items: center; justify-content: center; border-radius: 10rpx; background-color: #FF6A00;">
|
||||
保存信息
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { onShow, onLoad } from "@dcloudio/uni-app";
|
||||
import { Service } from '@/Service/Service';
|
||||
import { ref } from "vue";
|
||||
|
||||
|
||||
let showDate=ref(false)
|
||||
const userInfo = ref({
|
||||
headImg: '',
|
||||
age: '1',
|
||||
sex: '',
|
||||
phone: '1',
|
||||
date:Date.now(),
|
||||
nick: '大大怪将军'
|
||||
})
|
||||
|
||||
|
||||
let nowDate=ref()
|
||||
|
||||
const radiolist1 = ref([
|
||||
{
|
||||
name: '男',
|
||||
disabled: false,
|
||||
},
|
||||
{
|
||||
name: '女',
|
||||
disabled: false,
|
||||
}
|
||||
]);
|
||||
|
||||
|
||||
onLoad(() => {
|
||||
nowDate.value=new Date()
|
||||
});
|
||||
|
||||
onShow(() => {
|
||||
|
||||
});
|
||||
|
||||
const dateConfirm=(e)=>{
|
||||
showDate.value=!showDate.value
|
||||
userInfo.value.date=e.value
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
const uploadFImg = () => {
|
||||
uni.chooseImage({
|
||||
count: 1, // 最多选择3张图片
|
||||
sizeType: ['original', 'compressed'], // 支持原图和压缩图
|
||||
sourceType: ['album', 'camera'], // 可从相册选择或使用相机拍照
|
||||
success: function (res) {
|
||||
let path = res.tempFiles[0].path
|
||||
userInfo.value.headImg=path
|
||||
// Service.uploadH5(path, 'Avatar', data => {
|
||||
// userInfo.value.headImg = data.split(',')[2].split(':')[1].split('"')[1]
|
||||
// })
|
||||
|
||||
},
|
||||
fail: function (err) {
|
||||
console.error('选择失败:', err.errMsg);
|
||||
}
|
||||
})
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
page {
|
||||
background-color: #fff;
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user