提交 e9e10b34 authored 作者: 彭寒菲's avatar 彭寒菲

师傅端

上级 c6f49278
......@@ -89,7 +89,7 @@ export function uploadAttachments(file){
* @param {String} filePath 图片路径
*/
export function postAvatar(filePath){
let name = filePath.replace('http://tmp/','')
let name = filePath.replace('http://tmp/','').replace('http://usr/','').replace('wxfile://tmp/','').replace('wxfile://tmp_','')
let url = apiBaseUrl
return new Promise((resolve,reject) => {
wx.uploadFile({
......@@ -134,6 +134,25 @@ export function cashOut(amount){
}
/**
* @param {String} amount 查询余额提现记录
* @description 查询余额提现记录
*/
export function cashOutView(){
return http({
url:'/api/CashOut/View'
})
}
/**
* @param {String} amount 查询余额提现中数据
* @description 查询余额提现中数据
*/
export function cashOuting(){
return http({
url:'/api/CashOut/GetCashoutingSF'
})
}
/**
* @description 获取帮助主页地址
*/
export function getHelpUrl(){
......@@ -327,6 +346,19 @@ export function sendAppointment(params){
data:params
})
}
/**
* @description 发送确认地址短信
* @param {Object} params
*/
export function confirmCoordinate(params){
return http({
url:'/api/Order/ConfirmCoordinate',
method:'POST',
data:params
})
}
/**
* @description 缴纳信息费
* @param {Object} params
......
import store from '../store/store.js'
//正式环境https://www.jtfw8.com/WXXCX
//正式环境https://www.jtfw8.com/WXXCX "https://www.jtfw8.com/CSWX"
//测试环境http://116.62.129.2/CSWX
const apiBaseUrl = "https://www.jtfw8.com/CSWX"
......
......@@ -6,62 +6,66 @@
加载中...
</view>
</view> -->
<view class="main" >
<order-card v-if="data.length !== 0" :cardData="data" :btnText="btnText" @show="show" @handleDetails="handleDetails"></order-card>
<view class="main">
<order-card v-if="data.length !== 0" :cardData="oDatas" :btnText="bText" @show="show"
@handleDetails="handleDetails"></order-card>
<u-empty v-if="data.length === 0" text="暂无数据" font-size="32"></u-empty>
</view>
<u-modal
v-model="showModal"
title="抢单提示"
:show-cancel-button="true"
:async-close="true"
@confirm="modalConfirm"
ref="uModal"
confirm-color="#7c59fc"
>
<u-modal v-model="showModal" title="抢单提示" :show-cancel-button="true" :async-close="true" @confirm="modalConfirm"
ref="uModal" confirm-color="#7c59fc">
<view style="text-align: center;margin: 5% 0;">
<text>预计此单价格为<text>{{}}</text>元,是否抢单?</text>
<text>预计此单价格为<text>{{QDtipsMount}}</text>元,抢单成功后请在待预约查看,是否抢单?</text>
<!-- <text>抢单成功后请在待预约查看,是否立即抢单?</text> -->
</view>
</u-modal>
</view>
</template>
<script>
import {loading,hidden,toast} from '../tips/myTips.js'
import {grabOrder,SFView} from '../api/apis.js'
import {
loading,
hidden,
toast
} from '../tips/myTips.js'
import {
grabOrder,
SFView
} from '../api/apis.js'
import orderCard from './orderCard'
export default {
props:{
data:{
type:Array
props: {
data: {
type: Array
},
status:{
type:String
status: {
type: String
},
loading:{
type:Boolean
loading: {
type: Boolean
}
},
components:{
components: {
orderCard
},
data(){
data() {
return {
btn:{
background:"#ff9900",
color:"#FFFFFF"
btn: {
background: "#ff9900",
color: "#FFFFFF"
},
showModal:false,
FID:''
showModal: false,
FID: '',
QDtipsMount: 0,
Yfrate: 0 //应付信息费
}
},
computed:{
state:function(){
computed: {
state: function() {
return this.$store.state
},
//不同状态的单据,按钮不同
btnText:function(){
switch(this.$store.state.state){
bText: function() {
switch (this.$store.state.state) {
case '待报价':
return '立即报价'
case '待预约':
......@@ -73,105 +77,125 @@
case '待结算':
return '缴纳信息费'
}
return this.$store.state.state
},
oDatas: function() {
return this.data
}
},
methods:{
handleDetails(index){
console.log("订单内码:",this.data[index].FID)
methods: {
handleDetails(index) {
console.log("订单内码:", this.data[index].FID)
uni.navigateTo({
url:'../orderDetails/orderDetails?FID='+this.data[index].FID
url: '../orderDetails/orderDetails?FID=' + this.data[index].FID
})
},
show(FID){
show(FID, Amount, yfrate) {
this.showModal = true
this.FID = FID
this.QDtipsMount = Amount
this.Yfrate = yfrate
},
modalConfirm(){
modalConfirm() {
let that = this
let params = {FID:''}
let params = {
FID: ''
}
params.FID = this.FID
params.FSFYAmount = this.QDtipsMount
params.FInfoFee = this.Yfrate
grabOrder(params).then((res) => {
if(res.data.code == 0){
console.log("抢单成功:",res)
that.$refs.uModal.clearLoading()
if (res.data.code == 0) {
console.log("抢单成功:", res)
// that.$refs.uModal.clearLoading()
that.showModal = false
this.reload()
}else{
console.log("抢单失败:",res)
} else {
console.log("抢单失败:", res)
toast(res.data.message)
that.$refs.uModal.clearLoading()
// that.$refs.uModal.clearLoading()
that.showModal = false
that.reload()
// that.reload()
}
})
},
//重新加载
reload(){
reload() {
let that = this
this.$store.state.loading = true
SFView(this.state.state).then((res) => {
that.$store.state.loading = false
console.log("查询订单信息结果:",res)
if(res.data.code == 0){
console.log(that.$store.state.state+'信息')
if(Object.values(res.data.result)[0] !== null){
console.log(Object.values(res.data.result)[0][0])
that.orderData = Object.values(res.data.result)[0][0]
}else{
console.log(Object.values(res.data.result)[0])
that.orderData = Object.values(res.data.result)[0]
}
}else{
console.log("查询"+that.$store.state.state+"信息失败")
console.log(res)
toast(res.data.message)
}
})
that.$emit('SFVIVEW')
// this.$store.state.loading = true
// SFView(this.state.state).then((res) => {
// that.$store.state.loading = false
// console.log("查询订单信息结果:", res)
// if (res.data.code == 0) {
// console.log(that.$store.state.state + '信息')
// if (Object.values(res.data.result)[0] !== null) {
// console.log(Object.values(res.data.result)[0][0])
// that.oDatas = Object.values(res.data.result)[0][0]
// } else {
// console.log(Object.values(res.data.result)[0])
// that.oDatas = Object.values(res.data.result)[0]
// }
// } else {
// console.log("查询" + that.$store.state.state + "信息失败")
// console.log(res)
// toast(res.data.message)
// }
// })
}
}
}
</script>
<style>
.order{
.order {
padding: 2%;
overflow-y: scroll;
}
.loading{
.loading {
text-align: center;
}
.head{
.head {
display: flex;
justify-content: space-between;
flex-wrap:wrap;
flex-wrap: wrap;
}
.title{
.title {
color: #000000;
font-size: 16px;
width: 75%;
}
.sub-title{
.sub-title {
color: #ff9900;
}
.tags{
.tags {
margin-top: 10px;
}
.tag{
.tag {
display: inline;
margin-right: 8px;
}
.item{
.item {
margin: 10px 0;
}
.label{
.label {
margin-left: 5px;
}
.foot{
.foot {
display: flex;
flex-direction: row-reverse;
}
.btn{
.btn {
margin: 0 2%;
}
</style>
<template>
<view>
<u-card v-for="(item,index) in cardData" :key="index" @click="handleDetails(index)">
<u-card v-for="(item,index) in listCardData" :key="index" @click="handleDetails(index)">
<view slot="head" class="head">
<view class="title">{{item.ProNAme}}</view>
<view class="sub-title">{{subTitle(item)}}</view>
......@@ -22,7 +22,9 @@
</view>
<view class="item">
<u-icon name="clock" size="36"></u-icon>
<text class="label">期望上门时间:{{item.FHopeServiceTime}}</text>
<text class="label"
v-if="item.caption==='待报价'||item.caption==='待预约'||!item.FAPPOINTMENTDATETIME">期望上门时间:{{item.FHopeServiceTime}}</text>
<text class="label" v-else>{{displayApppointtime(item)}}</text>
</view>
<view class="item">
<u-icon name="rmb-circle" size="36"></u-icon>
......@@ -30,31 +32,32 @@
</view>
</view>
</view>
<view slot="foot" class="foot"
v-if="subTitle(item)=='待报价' || subTitle(item)=='待预约'">
<view slot="foot" class="foot" v-if="subTitle(item)=='待报价' || subTitle(item)=='待预约'">
<view class="btn" v-show="subTitle(item) != '已完成'">
<u-button style="margin-right:5px" v-show="subTitle(item)=='待报价'&&isqiangdan(item)" size="mini"
shape="circle" type="warning" @click="grap(item)">立即抢单
</u-button>
<u-button size="mini" shape="circle" type="warning" @click="handleDetails(index)">{{btnText}}
</u-button>
</view>
</view>
<view slot="foot" class="foot"
v-else-if="subTitle(item)=='待服务' || subTitle(item)=='待验收'">
<view slot="foot" class="foot" v-else-if="subTitle(item)=='待服务' || subTitle(item)=='待验收'">
<view class="btn" v-show="subTitle(item) != '已完成'">
<u-button size="mini" shape="circle" type="warning" @click="handleDetails(index)">{{btnText}}
</u-button>
</view>
</view>
<view slot="foot" class="foot" v-else-if="item.HasQuoted==0 && subTitle(item)=='待雇佣'">
<view class="btn" v-show="subTitle(item) != '已完成'">
<u-button size="mini" shape="circle" type="warning" @click="handleDetails(index)">{{btnText}}
</u-button>
</view>
</view>
<view slot="foot" class="foot" v-else-if="item.FPayWay==3 && subTitle(item)=='待结算'">
<view class="btn" v-show="subTitle(item) != '已完成'">
<u-button size="mini" shape="circle" type="warning" @click="handleDetails(index)">{{btnText}}
</u-button>
......@@ -65,6 +68,14 @@
</template>
<script>
import {
getOrderDetails
} from '../api/apis.js'
import {
loading,
hidden,
toast
} from '../tips/myTips.js'
export default {
name: "card",
props: ['cardData', 'btnText'],
......@@ -85,12 +96,59 @@
return '业主现场支付'
}
},
grap(FID) {
this.$emit('show', FID)
grap(item) {
let that = this
let amount = item.FSHAmount || 0
let infoRate = this.$store.state.userInfo.FInfoRate
let yfrate = Number(amount * infoRate * 0.01).toFixed(2)
let anAmount = Number(Number(amount) - Number(yfrate)).toFixed(2)
this.$emit('show', item.FID, anAmount, yfrate)
// let showamount = 0;
// loading()
// getOrderDetails(FID).then((res) => {
// hidden()
// if (res.data.code == 0) {
// //应收金额字段=订单应付金额-订单应付金额*师傅信息费比例
// let orderDetails = res.data.result
// let amount = orderDetails.Maindata[0].FSHAmount
// let infoRate = that.$store.state.userInfo.FInfoRate
// let yfrate = Number(amount * infoRate * 0.01).toFixed(2)
// showamount = Number(Number(amount) - Number(yfrate)).toFixed(2)
// this.$emit('show', FID, showamount, yfrate)
// }
// })
},
handleDetails(index) {
this.$emit('handleDetails', index)
},
isqiangdan(item) {
let issupport = this.isSupportOrderGrabbing()
let amount = item.FSHAmount || 0
let infoRate = this.$store.state.userInfo.FInfoRate
let yfrate = Number(amount * infoRate * 0.01).toFixed(2)
let anAmount = Number(Number(amount) - Number(yfrate)).toFixed(2)
return anAmount > 0 && (issupport || (item.FPayWay != '1' && issupport === false))
},
getNullEmpty(val) {
if (val === null || val === '' || val === undefined || val === 'null' || val === ' ') {
return ''
}
if (val.trim().length == 0) return ''
return val
},
displayApppointtime(item) {
//显示预约上门时间
let dtext = this.getNullEmpty(item.FAPPOINTMENTDATETIME || '')
if (dtext !== '') {
let textsplit = dtext.split(':')
dtext = textsplit[0] + ":" + (textsplit.length > 1 ? textsplit[1] : '') // this.$u.timeFormat(dtext, 'yyyy-mm-dd hh:MM').replace(/\-/g, "/")
}
return '预约上门时间:' + dtext
},
isSupportOrderGrabbing() {
return this.$store.state.userInfo.FSupportOrderGrabbing;
},
subTitle(item) {
let result = ''
if (parseInt(item.BJcount) > 0 && item.caption == '待报价') {
......@@ -101,7 +159,11 @@
return result
}
},
computed: {}
computed: {
listCardData: function() {
return this.cardData
}
}
}
</script>
......
......@@ -57,11 +57,19 @@
},
"usingComponents" : true,
"plugins" : {
"citySelector" : {
"version" : "1.0.0",
"provider" : "wx63ffb7b7894e99ae",
"export" : "index.js"
}
// "citySelector" : {
// "version" : "1.0.1",
// "provider" : "wx63ffb7b7894e99ae",
// "export" : "index.js"
// }
// ,"ocr-plugin": {
// "version": "3.1.2",
// "provider": "wx4418e3e031e551be"
// },
// "chooseLocation": {
// "version": "1.0.9",
// "provider": "wx76a9a06e5b4e693e"
// }
},
"permission" : {
"scope.userLocation" : {
......
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -6,6 +6,7 @@
"uni-read-pages": "^1.0.5",
"uni-simple-router": "^2.0.7",
"uview-ui": "^1.8.4",
"vuex": "^3.6.2"
"vuex": "^3.6.2",
"wx-server-sdk": "^2.6.1"
}
}
......@@ -4,124 +4,133 @@
},
"pages": [ //pages数组中第一项表示应用启动页,参考:https://uniapp.dcloud.io/collocation/pages
{
"path":"pages/index/index"
"path": "pages/index/index"
},
{
"path":"pages/my/my"
"path": "pages/my/my"
},
{
"path":"pages/myWallet/myWallet"
"path": "pages/deposit/deposit"
},
{
"path":"pages/myWallet/detail/detail"
"path": "pages/realnameAuthentication/realnameAuthentication"
// ,"style":{
// "mp-weixin":{
// "usingComponents":{
// "ocr-navigator": "plugin://ocr-plugin/ocr-navigator"
// }
// }
// }
},
{
"path":"pages/myWallet/withdrawal/withdrawal"
"path": "pages/serviceArea/serviceArea"
},
{
"path":"pages/deposit/deposit"
"path": "pages/serviceCategory/serviceCategory"
},
{
"path":"pages/personalSettings/personalSettings"
"path": "pages/map/map"
},
{
"path":"pages/address/address",
"style":{
"mp-weixin":{
"usingComponents":{
"selector-component": "plugin://citySelector/selector-component"
}
}
}
"path": "pages/customerService/customerService"
},
{
"path":"pages/moreSettings/moreSettings"
"path": "pages/register/register"
},
{
"path":"pages/moreSettings/carInfo/carInfo"
"path": "pages/serviceArea/edit/edit"
},
{
"path":"pages/moreSettings/skillCertificate/skillCertificate"
"path": "pages/orderDetails/orderDetails"
},
{
"path":"pages/moreSettings/thirdVoucher/thirdVoucher"
"path": "pages/search/search"
},
{
"path":"pages/help/help"
"path": "pages/myWallet/myWallet"
},
{
"path":"pages/personalEvaluation/personalEvaluation"
"path": "pages/myWallet/detail/detail"
},
{
"path":"pages/realnameAuthentication/realnameAuthentication"
"path": "pages/myWallet/withdrawal/withdrawal"
},
{
"path":"pages/serviceArea/serviceArea"
"path": "pages/personalSettings/personalSettings"
},
{
"path":"pages/serviceCategory/serviceCategory"
"path": "pages/personalSettings/cut/u-avatar-cropper",
"style": {
"navigationBarTitleText": "头像裁剪",
"navigationBarBackgroundColor": "#000000"
}
},
{
"path":"pages/feedback/feedback"
"path": "pages/moreSettings/moreSettings"
},
{
"path":"pages/personalSettings/cut/u-avatar-cropper",
"style":{
"navigationBarTitleText": "头像裁剪",
"navigationBarBackgroundColor": "#000000"
}
"path": "pages/moreSettings/carInfo/carInfo"
},
{
"path":"pages/map/map"
"path": "pages/moreSettings/skillCertificate/skillCertificate"
},
{
"path":"pages/customerService/customerService"
"path": "pages/moreSettings/thirdVoucher/thirdVoucher"
},
{
"path":"pages/register/register"
"path": "pages/help/help"
},
{
"path":"pages/serviceArea/edit/edit"
"path": "pages/personalEvaluation/personalEvaluation"
},
{
"path":"pages/orderDetails/orderDetails"
"path": "pages/feedback/feedback"
},
{
"path":"pages/search/search"
"path": "pages/address/address"
// ,"style":{
// "mp-weixin":{
// "usingComponents":{
// "selector-component": "plugin://citySelector/selector-component"
// }
// }
// }
}
],
// "subPackages": [{
// "root": "mysheet", // 分包的根目录
// "pages": [
// ] // 当前分包下的页面路径,同pages
// }],
"globalStyle": {
"navigationBarTextStyle": "#ffffff",
"navigationBarTitleText": "京台",
"navigationBarBackgroundColor": "#7c59fc",
"backgroundColor": "#F8F8F8"
},
"tabBar":{
"color":"#c8c8c8",
"selectedColor":"#7c59fc",
"list":[
{
"pagePath":"pages/index/index",
"iconPath":"./static/images/tabbar/home.png",
"selectedIconPath":"./static/images/tabbar/home_selected.png",
"text":"订单"
"tabBar": {
"color": "#c8c8c8",
"selectedColor": "#7c59fc",
"list": [{
"pagePath": "pages/index/index",
"iconPath": "./static/images/tabbar/home.png",
"selectedIconPath": "./static/images/tabbar/home_selected.png",
"text": "订单"
},
{
"pagePath":"pages/my/my",
"iconPath":"./static/images/tabbar/my.png",
"selectedIconPath":"./static/images/tabbar/my_selected.png",
"text":"我的"
"pagePath": "pages/my/my",
"iconPath": "./static/images/tabbar/my.png",
"selectedIconPath": "./static/images/tabbar/my_selected.png",
"text": "我的"
}
]
},
"condition" : { //模式配置,仅开发期间生效
"condition": { //模式配置,仅开发期间生效
"current": 0, //当前激活的模式(list 的索引项)
"list": [
{
"name": "", //模式名称
"path": "", //启动页面,必选
"query": "" //启动参数,在页面的onLoad函数里面得到
}
]
"list": [{
"name": "", //模式名称
"path": "", //启动页面,必选
"query": "" //启动参数,在页面的onLoad函数里面得到
}]
}
}
......@@ -5,9 +5,14 @@
<u-form-item label="居住地址" prop="address" :required="true">
<u-input disabled v-model="form.address" @click="show = true" placeholder="点击选择居住地址"></u-input>
<u-select v-model="show" mode="mutil-column-auto" :list="list" @confirm="save"></u-select>
<u-icon slot="right" name="arrow-right" @click="show = true"></u-icon>
</u-form-item>
<u-form-item label="详细地址" prop="detail" :required="true">
<u-input v-model="form.detail" type="textarea" placeholder="请输入详细地址(如:XXX街道,XXX小区)"></u-input>
<!-- <u-input v-model="form.detail" type="textarea" placeholder="请输入详细地址(如:XXX街道,XXX小区)"
@focus="adressdetailfocus" @input="adressdetailfocus"></u-input>
<u-icon slot="right" size="36" name="map-fill" label-color="#7D5AFC"
@click="getchooseLocationPermission"></u-icon> -->
</u-form-item>
<u-form-item label="服务区域" prop="area">
</u-form-item>
......@@ -32,68 +37,71 @@
</template>
<script>
import {loading,hidden,toast} from '../../tips/myTips.js'
import {getAddress,edit} from '../../api/apis.js'
import {
loading,
hidden,
toast
} from '../../tips/myTips.js'
import {
getAddress,
edit
} from '../../api/apis.js'
export default {
onLoad(){
onLoad() {
this.init()
uni.$u.mpShare.title = '页面分享';
},
onShow(){
onShow() {
},
onReady(){
onReady() {
this.$refs.uform.setRules(this.rules)
},
data(){
data() {
return {
btnStyle:{
background:"#7D5AFC",
color:'#FFFFFF'
btnStyle: {
background: "#7D5AFC",
color: '#FFFFFF'
},
form:{
address:'',
detail:''
form: {
address: '',
detail: ''
},
area:[],
rules:{
address:[
{
required: true,
message:'请选择居住地址',
trigger:['blur']
}
],
detail:[
{
required: true,
message:'请输入详细地址',
trigger:['blur']
}
]
area: [],
rules: {
address: [{
required: true,
message: '请选择居住地址',
trigger: ['blur']
}],
detail: [{
required: true,
message: '请输入详细地址',
trigger: ['blur']
}]
},
show:false,
list:[],
params:{
Model:{
FID:this.$store.state.userInfo.Id,
FPROVINCE_ID:'',
FPROVINCE:'',
FCity_ID:'',
FCity:'',
FCOUNTY_ID:'',
FCOUNTY:'',
FAdress:''
show: false,
list: [],
params: {
Model: {
FID: this.$store.state.userInfo.Id,
FPROVINCE_ID: '',
FPROVINCE: '',
FCity_ID: '',
FCity: '',
FCOUNTY_ID: '',
FCOUNTY: '',
FAdress: ''
}
}
}
},
methods:{
init(){
methods: {
init() {
let that = this
let userInfo = this.$store.state.userInfo
if(userInfo.FPROVINCE || userInfo.FCity || userInfo.FCOUNTY){
if (userInfo.FPROVINCE || userInfo.FCity || userInfo.FCOUNTY) {
this.form.address = userInfo.FPROVINCE + userInfo.FCity + userInfo.FCOUNTY
console.log(userInfo)
this.params.Model.FPROVINCE = userInfo.FPROVINCE
......@@ -103,26 +111,29 @@
this.params.Model.FCOUNTY = userInfo.FCOUNTY
this.params.Model.FCOUNTY_ID = userInfo.FCOUNTY_ID
}
if(userInfo.FAdress){
if (userInfo.FAdress) {
this.form.detail = userInfo.FAdress
this.params.Model.FAdress = userInfo.FAdress
}
if(userInfo.FServiceArea.length !== 0){
if (userInfo.FLocation) {
this.params.Model.FLocation = userInfo.FLocation
}
if (userInfo.FServiceArea.length !== 0) {
this.area = userInfo.FServiceArea
}
loading()
getAddress().then((res) => {
hidden()
console.log("城区信息:",res)
if(res.data.code == 0){
console.log("城区信息:", res)
if (res.data.code == 0) {
that.list = res.data.result
}else{
} else {
toast(res.data.message)
}
})
},
save(res){
save(res) {
this.form.address = res[0].label + res[1].label + res[2].label
this.params.Model.FPROVINCE = res[0].label
this.params.Model.FPROVINCE_ID = res[0].value
......@@ -131,46 +142,136 @@
this.params.Model.FCOUNTY = res[2].label
this.params.Model.FCOUNTY_ID = res[2].value
},
confirm(){
confirm() {
let that = this
if(this.form.address!=""){
if(this.form.detail!=""){
if (this.form.address != "") {
if (this.form.detail != "") {
this.$refs.uform.validate(valid => {
if(valid){
if (valid) {
this.params.Model.FAdress = this.form.detail
loading()
edit(this.params).then((res) => {
hidden()
console.log("传递参数:",this.params)
console.log("请求信息:",res)
if(res.data.code == 0){
console.log("传递参数:", this.params)
console.log("请求信息:", res)
if (res.data.code == 0) {
uni.navigateBack()
}else{
} else {
toast(res.data.message)
}
})
}
})
}
else{
} else {
toast('请输入详细地址')
}
}
else{
} else {
toast('请选择地址')
}
},
adressdetailfocus() {
// if (!this.paramsC.Model.FLocation) {
if (!this.form.detail) {
this.getchooseLocationPermission()
}
},
getchooseLocationPermission() {
let that = this
let setdata = function(res) {
console.log(res)
that.form.detail = res.address
that.params.Model.FLocation = res.latitude + ',' + res.longitude
}
let location = {}
if (that.params.Model.FLocation) {
let locsplit = that.params.Model.FLocation.split(',')
location = {
latitude: locsplit[0],
longitude: locsplit.length > 1 ? locsplit[1] : ''
}
}
wx.chooseLocation({
latitude: location.latitude,
longitude:location.longitude,
success: function(res) {
// obj.setData({
// addr: res.address //调用成功直接设置地址
// })
setdata(res)
},
fail: function() {
wx.getSetting({
success: function(res) {
var statu = res.authSetting;
if (!statu['scope.userLocation']) {
wx.showModal({
title: '是否授权当前位置',
content: '需要获取您的地理位置,请确认授权,否则地图功能将无法使用',
success: function(tip) {
if (tip.confirm) {
wx.openSetting({
success: function(data) {
if (data
.authSetting[
"scope.userLocation"
] === true
) {
wx.showToast({
title: '授权成功',
icon: 'success',
duration: 1000
})
//授权成功之后,再调用chooseLocation选择地方
wx.chooseLocation({
success: function(
res
) {
// obj.setData({
// addr: res
// .address
// })
setdata
(
res
)
},
})
} else {
wx.showToast({
title: '授权失败',
icon: 'success',
duration: 1000
})
}
}
})
}
}
})
}
},
fail: function(res) {
wx.showToast({
title: '调用授权窗口失败',
icon: 'success',
duration: 1000
})
}
})
}
})
}
},
computed:{
computed: {
}
}
</script>
<style>
.btn{
.btn {
margin: 5% auto;
width: 95%;
}
......
......@@ -3,11 +3,11 @@
<view class="header">
<view class="search-bar">
<u-row class="searchTest">
<u-col span="10">
<u-col> <!-- span="10" -->
<u-search placeholder="客户姓名/手机号/订单号/订单名称" :disabled="true" bg-color="#ffffff"
:show-action="false" @click="navigator('/pages/search/search')"></u-search>
</u-col>
<u-col span="2" @click="navigator('/pages/map/map')">
<u-col span="2" @click="navigator('/pages/map/map')" v-show="false">
<view class="map-container">
<view class="font-size map"></view>
</view>
......@@ -40,7 +40,7 @@
</view>
<view v-if="state.login && state.register">
<view v-if="titleCurrent == 0">
<order :data="orderData"></order>
<order :data="orderData" :key="titleTabs[0].timer" @SFVIVEW="sfview"></order>
</view>
<view v-if="titleCurrent == 1">
<u-tabs active-color="#ff9900" :list="subTabs" :current="subCurrent" @change="subTabsChange"
......@@ -87,7 +87,8 @@
} from '../../tips/myTips.js'
import {
Validation,
SFView
SFView,
edit
} from '../../api/apis.js'
import order from '../../components/order.vue'
import store from '../../store/store.js'
......@@ -109,8 +110,33 @@
// if(this.state.initComplete == true){
// this.$store.state.loading = true
// //查询订单信息
// this.sfview()
// this.sfview()
// }
if (that.$store.state.initedAndChecked === true) {
if (this.titleTabs[this.titleCurrent].name == '进行中'){
if(this.$store.state.IncreaseDFW){
//待服务+1
this.subTabs[1].count += 1
this.$store.state.IncreaseDFW=false
}
else if(this.$store.state.IncreaseDYS){
//待验收+1
this.subTabs[3].count += 1
this.$store.state.IncreaseDYS=false
}
else if(this.$store.state.IncreaseYZF){
//待验收+1
that.subTabs[5].count += 1
this.$store.state.IncreaseYZF=false
}
else if(this.$store.state.IncreaseDJS){
//待验收+1
that.subTabs[4].count += 1
this.$store.state.IncreaseDJS=false
}
}
this.sfview()
}
},
data() {
return {
......@@ -142,15 +168,18 @@
titleCurrent: 0,
titleTabs: [{
name: "待报价",
count: 0
count: 0,
timer: new Date().getTime()
},
{
name: "进行中",
count: 0
count: 0,
timer: new Date().getTime()
},
{
name: "已完成",
count: 0
count: 0,
timer: new Date().getTime()
}
],
subTabs: [{
......@@ -186,7 +215,8 @@
loading: false,
authModal: false,
//订单信息
orderData: []
orderData: [],
realLocation:''
}
},
computed: {
......@@ -206,6 +236,8 @@
that.$store.state.sysInfo = res
}
})
// that.navigator('../register/register')
// return
wx.login({
success(res) {
that.$store.state.login = true
......@@ -230,12 +262,15 @@
console.log("师傅信息:", that.$store.state.userInfo)
that.$store.state.initComplete = true
that.$store.state.loading = true
that.editFRealTimeLocation();
//查询订单信息
that.sfview()
if(that.$store.state.userInfo.FCheckStatus == '0'){
if (that.$store.state.userInfo.FCheckStatus == '0') {
that.$store.state.initedAndChecked = false
console.log("未实名认证,弹出认证窗口")
that.authModal = true
}else{
} else {
that.$store.state.initedAndChecked = true
console.log("实名认证了,继续操作吧")
}
}
......@@ -251,7 +286,87 @@
}
})
},
editFRealTimeLocation() {
//获取实时登录坐标进行保存
let that=this
this.getUserLocation(()=>{
let model = {
Model: {
FID: this.$store.state.userInfo.Id,
FRealTimeLocation: that.realLocation,
F_PAEZ_DateTime: that.$u.timeFormat(new Date(),'yyyy-mm-dd hh:MM:ss')
}
}
edit(model).then((res) => {
console.log("修改个人实时坐标:", res)
// if (res.data.code == 0) {
// } else {
// toast(res.data.message)
// }
})
})
},
getUserLocation(afterfun) {
let that = this
wx.getLocation({
success(res) {
console.log("用户位置信息:", res)
that.realLocation=res.latitude + ',' + res.longitude
if(afterfun){
afterfun();
}
},
fail(res) {
console.log("出现错误:", res)
if (res.errMsg === 'getLocation:fail:ERROR_NOCELL&WIFI_LOCATIONSWITCHOFF') {
uni.showModal({
content: '请开启手机定位服务',
showCancel: false
})
}
if (res.errMsg === 'getLocation:fail auth deny') {
wx.showModal({ //引导用户授权
content: '小程序需要实时获取位置,请设置为后台前台都可运行',
confirmText: "确认",
cancelText: "取消",
success: function(res) {
//点击“确认”时打开设置页面
if (res.confirm) {
wx.openSetting({ //打开设置页面让用户选择权限
success: (res) => {
if (res.authSetting[
"scope.userLocationBackground"
] == true) {
wx.getLocation({
success(res) {
console.log("用户位置信息:",
res)
that.realLocation=res.latitude + ',' + res.longitude
if(afterfun){
afterfun();
}
},
fail(res) {
console.log("出现错误:",
res)
}
})
}
}
})
} else { //取消打开设置授权页面
wx.showToast({
title: "取消授权",
icon: 'none',
})
}
}
})
}
}
})
},
//手动登录
handleLogin() {
let that = this
......@@ -279,15 +394,18 @@
console.log("师傅信息:", that.$store.state.userInfo)
that.$store.state.initComplete = true
that.$store.state.loading = true
that.editFRealTimeLocation();
//查询订单信息
that.sfview()
if(that.$store.state.userInfo.FCheckStatus == '0'){
if (that.$store.state.userInfo.FCheckStatus == '0') {
that.$store.state.initedAndChecked = false
console.log("未实名认证,弹出认证窗口")
that.authModal = true
}else{
} else {
that.$store.state.initedAndChecked = true
console.log("实名认证了,继续操作吧")
}
if(that.$store.state.userInfo.FServiceTypeEntity.length<1){
if (that.$store.state.userInfo.FServiceTypeEntity.length < 1) {
toast("请去设置服务类目,以防无法查询相应订单")
}
}
......@@ -346,7 +464,6 @@
if (list[i].caption === "待服务") {
that.subTabs[1].count += 1
}
if (list[i].caption === "已超时") {
that.subTabs[2].count += 1
}
......@@ -433,6 +550,9 @@
that.subTabs[that.subCurrent].count = 0
that.setCount()
}
// if(that.$store.state.state=="待报价"){
// that.titleTabs[0].timer=new Date().getTime()
// }
} else {
console.log("查询" + that.$store.state.state + "信息失败")
console.log(res)
......@@ -444,7 +564,7 @@
setCount() {
if (this.titleCurrent != 1) {
this.clearCount()
let count = this.orderData.length
let count = this.orderData ? this.orderData.length : 0
if (count > 99) {
this.titleTabs[this.titleCurrent].count = '99+'
} else {
......
......@@ -26,18 +26,13 @@
<u-tabs active-color="#7c59fc" :list="items"></u-tabs>
<u-grid :col="4" :border="false">
<u-grid-item v-for="(item,key) in items[0].list" :key="key" @click="navigator(item.url)">
<u-icon
label-pos="bottom"
label-color="#000000"
:label="item.label"
:margin-top="20"
:name="item.iconUrl"
:size="60"></u-icon>
<u-icon label-pos="bottom" label-color="#000000" :label="item.label" :margin-top="20"
:name="item.iconUrl" :size="60"></u-icon>
</u-grid-item>
</u-grid>
</view>
</view>
<u-popup v-model="showPop" mode="center" border-radius="15">
<view style="padding: 10px;">
<view>
......@@ -64,112 +59,113 @@
</template>
<script>
import {loading,hidden,toast} from '../../tips/myTips.js'
import {getFileUrl,getKFQRcode} from '../../api/api.js'
import {Validation,getUrl} from '../../api/apis.js'
import {
loading,
hidden,
toast
} from '../../tips/myTips.js'
import {
getFileUrl,
getKFQRcode
} from '../../api/api.js'
import {
Validation,
getUrl
} from '../../api/apis.js'
export default {
onShow(){
onShow() {
this.init()
uni.$u.mpShare.title = '页面分享';
},
data(){
data() {
return {
gridList:[
[
{
name:'金融',
list:[
{
label:'我的钱包',
iconUrl:'/static/images/my/money.png',
url:'/pages/myWallet/myWallet'
},
{
label:'缴纳保证金',
iconUrl:'/static/images/my/bond.png',
url:'/pages/deposit/deposit'
}
]
}
],
[
{
name:'个人',
list:[
{
label:'个人设置',
iconUrl:'/static/images/my/user.png',
url:'/pages/personalSettings/personalSettings'
},
{
label:'居住住址',
iconUrl:'/static/images/my/location.png',
url:'/pages/address/address'
},
{
label:'服务区域',
iconUrl:'/static/images/my/quyu.png',
url:'/pages/serviceArea/serviceArea'
},
{
label:'服务类目',
iconUrl:'/static/images/my/category.png',
url:'/pages/serviceCategory/serviceCategory'
},
{
label:'实名认证',
iconUrl:'/static/images/my/renzheng.png',
url:'/pages/realnameAuthentication/realnameAuthentication'
},
{
label:'个人评价',
iconUrl:'/static/images/my/feedback.png',
url:'/pages/personalEvaluation/personalEvaluation'
}
]
}
],
[
{
name:'更多',
list:[
{
label:'更多设置',
iconUrl:'/static/images/my/set.png',
url:'/pages/moreSettings/moreSettings'
},
{
label:'帮助中心',
iconUrl:'/static/images/my/help1.png',
url:'/pages/help/help'
},
{
label:'意见反馈',
iconUrl:'/static/images/my/feedback1.png',
url:'/pages/feedback/feedback'
},
{
label:'联系客服',
iconUrl:'/static/images/my/customer.png',
url:'kf'
},
{
label:'京台服务',
iconUrl:'/static/images/my/feedback.png',
url:'jt'
}
]
}
]
gridList: [
[{
name: '金融',
list: [{
label: '我的钱包',
iconUrl: '/static/images/my/money.png',
url: '/pages/myWallet/myWallet'
},
{
label: '缴纳保证金',
iconUrl: '/static/images/my/bond.png',
url: '/pages/deposit/deposit'
}
]
}],
[{
name: '个人',
list: [{
label: '个人设置',
iconUrl: '/static/images/my/user.png',
url: '/pages/personalSettings/personalSettings'
},
{
label: '居住住址',
iconUrl: '/static/images/my/location.png',
url: '/pages/address/address'
},
{
label: '服务区域',
iconUrl: '/static/images/my/quyu.png',
url: '/pages/serviceArea/serviceArea'
},
{
label: '服务类目',
iconUrl: '/static/images/my/category.png',
url: '/pages/serviceCategory/serviceCategory'
},
{
label: '实名认证',
iconUrl: '/static/images/my/renzheng.png',
url: '/pages/realnameAuthentication/realnameAuthentication'
},
{
label: '个人评价',
iconUrl: '/static/images/my/feedback.png',
url: '/pages/personalEvaluation/personalEvaluation'
}
]
}],
[{
name: '更多',
list: [{
label: '更多设置',
iconUrl: '/static/images/my/set.png',
url: '/pages/moreSettings/moreSettings'
},
{
label: '帮助中心',
iconUrl: '/static/images/my/help1.png',
url: '/pages/help/help'
},
{
label: '意见反馈',
iconUrl: '/static/images/my/feedback1.png',
url: '/pages/feedback/feedback'
},
{
label: '联系客服',
iconUrl: '/static/images/my/customer.png',
url: 'kf'
},
{
label: '分享推广',
iconUrl: '/static/images/my/feedback.png',
url: 'jt'
}
]
}]
],
avatarUrl:'',
showPop:false,
showPopA:false,
kfurl:'',
avatarUrl: '',
showPop: false,
showPopA: false,
kfurl: '',
}
},
methods:{
init(){
methods: {
init() {
let that = this
loading()
wx.login({
......@@ -179,68 +175,68 @@
that.$store.state.code = res.code
Validation(res.code).then((res) => {
hidden()
if(res.data.result.isRegister == false){
if (res.data.result.isRegister == false) {
console.log("此处设置token,注册状态(注册失败),没有师傅信息")
that.$store.state.token = res.data.result.token
that.$store.state.register = res.data.result.isRegister
}else{
} else {
console.log("此处设置token,注册状态(注册成功),师傅信息")
that.$store.state.token = res.data.result.token
that.$store.state.register = res.data.result.isRegister
that.$store.state.userInfo = JSON.parse(res.data.result.result)
console.log("师傅信息:",that.$store.state.userInfo)
console.log("师傅信息:", that.$store.state.userInfo)
that.$store.state.initComplete = true
that.$store.state.loading = true
loading()
getUrl(that.$store.state.userInfo.FUserImage).then((res) => {
hidden()
if(res.data.code == 0){
if (res.data.code == 0) {
that.avatarUrl = res.data.result[0].fileurl
}else{
} else {
// toast(res.data.message)
}
})
}
})
}
})
},
navigator(url){
if(!this.$store.state.register){
navigator(url) {
if (!this.$store.state.register) {
uni.showToast({
title:'请先登录',
icon:'none'
title: '请先登录',
icon: 'none'
})
}else if(url == 'kf'){
} else if (url == 'kf') {
console.log("弹出客服二维码")
let that = this
loading()
getKFQRcode().then((res) => {
if(res.data.code == 0){
if (res.data.code == 0) {
hidden()
that.kfurl = res.data.result[0].fileurl
that.showPop = true
console.log("客服二维码:",res.data.result[0].fileurl)
}else{
console.log("客服二维码:", res.data.result[0].fileurl)
} else {
hidden()
}
})
}else if(url == 'jt'){
} else if (url == 'jt') {
console.log("弹出京台小程序二维码")
this.kfurl = '/static/images/jt.jpg'
this.showPopA = true
}else{
} else {
uni.navigateTo({
url:url
url: url
})
}
},
},
computed:{
checkStatus:function(){
switch(this.info.FCheckStatus){
computed: {
checkStatus: function() {
switch (this.info.FCheckStatus) {
case '0':
return '未认证'
case '1':
......@@ -249,7 +245,7 @@
return '已认证'
}
},
info:function(){
info: function() {
return this.$store.state.userInfo
}
}
......@@ -257,7 +253,7 @@
</script>
<style>
.header{
.header {
padding: 5% 2%;
background-color: #7c59fc;
}
......
......@@ -10,7 +10,8 @@
</view>
<view class="container">
<u-cell-group>
<u-cell-item v-for="(item,key) in cellList" :key="key" :arrow="true" @click="navigator(item.url)">
<u-cell-item v-for="(item,key) in cellList" :key="key" :arrow="!item.disable" :value="item.value"
@click="navigator(item)">
<view slot="icon">
<u-icon size="35" margin-left="20" :name="item.icon" :label="item.label"></u-icon>
</view>
......@@ -21,35 +22,59 @@
</template>
<script>
import {init} from '../../api/api.js'
import {
init
} from '../../api/api.js'
import {
cashOutView
} from '../../api/apis.js'
export default {
onShow(){
onShow() {
init()
},
onLoad() {
let that = this
uni.$u.mpShare.title = '页面分享';
cashOutView().then((res) => {
if (res.data.code == 0 && res.data.result && res.data.result.length > 0) {
for(let i=0;i<res.data.result.length;i++){
let firstdata = res.data.result[i]
if (firstdata.FSTATUS == 'YTJ') {
that.cellList[0].disable = true
that.cellList[0].value = '有' + (firstdata.FAMOUNT).toFixed(2) + '金额正在提现中'
break;
}
}
} else {
console.log("获取提现记录失败:", res)
}
})
},
data(){
data() {
return {
cellList:[
{
label:'提现',
url:'withdrawal/withdrawal',
icon:'/static/images/my/money.png'
cellList: [{
label: '提现',
url: 'withdrawal/withdrawal',
icon: '/static/images/my/money.png',
disable: false,
value: ''
},
{
label:'账户工单结算明细',
url:'detail/detail',
icon:'/static/images/my/renzheng.png'
label: '账户工单结算明细',
url: 'detail/detail',
icon: '/static/images/my/renzheng.png',
disable: false,
value: ''
}
],
userInfo:this.$store.state.userInfo
userInfo: this.$store.state.userInfo
}
},
methods:{
navigator(url){
methods: {
navigator(item) {
if (item.disable) return
uni.navigateTo({
url:url
url: item.url
})
}
}
......@@ -57,15 +82,17 @@
</script>
<style>
.header{
.header {
background-color: #7c59fc;
color: #FFFFFF;
padding: 5% 5%;
}
.title{
.title {
margin-bottom: 5%;
}
.money{
.money {
font-size: 40px;
font-weight: 1000;
}
......
......@@ -16,20 +16,22 @@
<u-icon size="36" name='account'></u-icon>
<text class="label">{{orderDetails.Maindata[0].FCustomerName}}</text>
</view>
<view class="item"
v-show="orderDetails.Maindata[0].caption != '待报价'">
<view class="item" v-show="orderDetails.Maindata[0].caption != '待报价'">
<u-icon size="36" name='phone'></u-icon>
<text class="label">{{orderDetails.Maindata[0].FCustomerPhone}}</text>
<u-icon size="50" name='phone-fill' @click="callPhone" class="phonestyle"></u-icon>
<u-icon size="45" name='phone-fill' @click="callPhone" class="phonestyle"></u-icon>
</view>
<view class="item">
<u-icon size="36" name='map'></u-icon>
<text
class="label">{{orderDetails.Maindata[0].FPROVINCE + orderDetails.Maindata[0].FCITY + orderDetails.Maindata[0].FCOUNTY + orderDetails.Maindata[0].FAdress}}</text>
<text class="label">{{orderDetails.Maindata[0].FPROVINCE + orderDetails.Maindata[0].FCITY + orderDetails.Maindata[0].FCOUNTY + orderDetails.Maindata[0].FAdress}}</text>
<view class="map-container" @click="openadress()" v-show="adressMapShow">
<view class="font-size map" style="margin-left:5px;color:#7c59fc"></view>
</view>
</view>
<view class="item">
<u-icon size="36" name='clock'></u-icon>
<text class="label">{{orderDetails.Maindata[0].FHopeServiceTime}}</text>
<text class="label" v-if="orderDetails.Maindata[0].caption === '待报价' || orderDetails.Maindata[0].caption === '待预约'">{{orderDetails.Maindata[0].FHopeServiceTime}}</text>
<text class="label" v-else>{{orderDetails.Maindata[0].FAPPOINTMENTDATETIME}}</text>
</view>
<view class="item">
<u-icon size="36" name='rmb-circle'></u-icon>
......@@ -47,9 +49,10 @@
<view v-for="(item,index) in orderDetails.SPdata" :key="index">
<view class="item">
<u-icon :label="'商品名称:'+item.CPGG" v-show="item.CPGG.length>1"></u-icon>
</view>
</view>
<view class="item">
<u-icon :label="'商品规格:'+item.CPMC" v-show="item.CPGG.length>1"></u-icon>
<u-icon :label="'商品规格:'+(item.CPMC==null?'':item.CPMC)" v-show="item.CPGG.length>1">
</u-icon>
</view>
<view class="item">
<u-icon :label="'商品数量:'+item.FGOODSQTY" v-show="item.CPGG.length>1"></u-icon>
......@@ -59,7 +62,9 @@
</view>
<view class="grid">
<view :class="'grid-item-3'" v-for="(jtem,jndex) in item.GoodsImgArray" :key="jndex">
<image :src="picUrlDic[jtem]"></image>
<image :src="picUrlDic[jtem]" mode="aspectFill"
@click="imgpreview(picUrlDic[jtem])">
</image>
</view>
</view>
</view>
......@@ -237,7 +242,12 @@
<view class="btn-group">
<view
v-if="(orderDetails.Maindata[0].caption == '待报价' && orderDetails.Maindata[0].HasQuoted == 0) || (orderDetails.Maindata[0].caption == '待预约') || (orderDetails.Maindata[0].caption == '待服务') || (orderDetails.Maindata[0].caption == '待验收')">
<view class="btn" :style="'width:'+width*0.3+'px'">
<view class="btn" :style="'width:'+width*0.3+'px'" v-if="orderDetails.Maindata[0].caption == '待预约'">
<u-button :hair-line="false" @click="showCoordinateModel=true">
核对地址
</u-button>
</view>
<view class="btn" :style="'width:'+width*0.3+'px'" v-else>
<u-button open-type="contact" :hair-line="false">联系客服</u-button>
</view>
<view class="btn" :style="'width:'+width*0.7+'px'">
......@@ -251,7 +261,8 @@
<u-button open-type="contact" border-radius=0px :hair-line="false">联系客服</u-button>
</view>
<view class="btn" :style="'width:'+width*0.7+'px'">
<u-button :hair-line="false" border-radius=0px hover-class="none" :custom-style="btnStyle" @click="bottomBtn">
<u-button :hair-line="false" border-radius=0px hover-class="none" :custom-style="btnStyle"
@click="bottomBtn">
{{btnText}}
</u-button>
</view>
......@@ -309,6 +320,9 @@
<u-input placeholder="请输入完工验证码" type="number" v-model="form.WanGongCode"></u-input>
</u-form-item>
</u-form>
<view style="margin:5px 15px;font-size: 0.9em;">
<span>提示:验证码已短信发送给用户, 如果用户未收到,可联系客服提供</span>
</view>
</view>
<view v-show="orderDetails.Maindata[0].caption == '待结算'&&orderDetails.Maindata[0].FPayWay==3">
<u-form label-width="190" label-align="center" ref="Cform" :model="form">
......@@ -318,27 +332,34 @@
<u-icon margin-left=10px :label="'应缴信息费'"></u-icon>
</view>
<view :class="'value-vitem'">
<u-icon :label="orderDetails.Maindata[0].FINFOFEE == null?0:orderDetails.Maindata[0].FINFOFEE"></u-icon>
<u-icon
:label="orderDetails.Maindata[0].FINFOFEE == null?0:orderDetails.Maindata[0].FINFOFEE">
</u-icon>
</view>
</view>
<view class="wanningLabelValue">
<view :class="'label-item'">
<u-icon label-color="#f00" label="*"></u-icon><u-icon :label="'实缴信息费'"></u-icon>
<u-icon label-color="#f00" label="*"></u-icon>
<u-icon :label="'实缴信息费'"></u-icon>
</view>
<view :class="'value-item'">
<input type="number" placeholder="请输入实缴信息费" placeholder-style="color:#AAAAAA" v-model="InfoSFee"></input>
<input type="number" placeholder="请输入实缴信息费" placeholder-style="color:#AAAAAA"
v-model="InfoSFee"></input>
</view>
</view>
<view class="wanningLabelValue">
<view :class="'label-item'">
<u-icon label-color="#f00" label="*"></u-icon><u-icon :label="'现场实收费用'"></u-icon>
<u-icon label-color="#f00" label="*"></u-icon>
<u-icon :label="'现场实收费用'"></u-icon>
</view>
<view :class="'value-item'">
<input type="number" placeholder="请输入现场实收费用" placeholder-style="color:#AAAAAA" v-model="XCSSAmount"></input>
<input type="number" placeholder="请输入现场实收费用" placeholder-style="color:#AAAAAA"
v-model="XCSSAmount"></input>
</view>
</view>
<view class="checkboxgroup">
<uni-data-checkbox v-model="payType" icon="right" mode="list" :localdata="payWays"></uni-data-checkbox>
<uni-data-checkbox v-model="payType" icon="right" mode="list" :localdata="payWays">
</uni-data-checkbox>
</view>
</u-form-item>
</u-form>
......@@ -375,10 +396,12 @@
<view style="color: #909399;">
<text>图片大小不能超过5MB,最多上传9张</text>
</view>
<u-form label-width="150" label-align="center" ref="Iform" :model="form">
<u-form-item label="上传图片" prop="ufile" :required="true">
<u-upload :header="header" ref="uUpload" :action="action" max-count="9" v-model="form.ufile"
max-size="5242880" @on-success="uploadSuccess1">
<u-form label-width="5" label-align="center" ref="Iform" :model="form">
<!-- lable去掉了上传图片4个字 -->
<u-form-item :label="' '" prop="ufile" :required="true">
<u-upload :header="header" ref="uUpload" :action="action" max-count="9" max-size="5242880"
@on-change="uploadSuccess1" @on-remove="uploadRemove1">
<!-- @on-success="uploadSuccess1" -->
</u-upload>
</u-form-item>
</u-form>
......@@ -386,6 +409,15 @@
</view>
</u-popup>
<u-modal v-model="showCoordinateModel" title="提示" :show-cancel-button="true" :async-close="true"
@confirm="sendCoordinate" ref="coorModal" confirm-color="#7c59fc">
<view style="text-align: left;margin:15px 15px 5px 15px;">
<text align="left">发送地址信息后,用户将收到位置标记的短信,用户操作可便于上门导航。</text>
</view>
<view style="text-align: center;margin: 0 0 15px 0;">
<text align="left">是否确认发送?</text>
</view>
</u-modal>
</view>
</template>
......@@ -399,7 +431,8 @@
sendAppointment,
donePic,
postInformationCost,
payDeposit
payDeposit,
confirmCoordinate
} from '../../api/apis.js'
import {
loading,
......@@ -430,8 +463,16 @@
width: '',
height: '',
FID: '',
payWays: [{"value": 1,"text": "账户余额:", "iconname": "red-packet"},{"value": 2,"text": "微信支付:", "iconname": "weixin-fill"}],
payType:1,
payWays: [{
"value": 1,
"text": "账户余额:",
"iconname": "red-packet"
}, {
"value": 2,
"text": "微信支付:",
"iconname": "weixin-fill"
}],
payType: 1,
//预约成功弹窗控制数据
yyShow: false,
showT: false,
......@@ -440,11 +481,11 @@
backgroundColor: '#7D5AFC',
color: '#fcfcfc'
},
//现场实收费用
XCSSAmount:'',
XCSSAmount: '',
//实收信息费
InfoSFee:'',
InfoSFee: '',
//订单详情数据
orderDetails: '',
//服务类目()
......@@ -452,7 +493,7 @@
//付款方式
payWay: '',
//商品图片路径
picUrlDic:{},
picUrlDic: {},
//底部按钮文本
btnText: '',
//预约数据
......@@ -688,7 +729,10 @@
},
//重新加载需要
obj: ''
obj: '',
WGImgFileList: [], //完工上传图片集合
showCoordinateModel: false,
adressMapShow: true
}
},
components: {
......@@ -708,19 +752,33 @@
if (res.data.code == 0) {
console.log("查询订单详情信息成功:", res.data.result)
that.orderDetails = res.data.result
let yfFee = that.orderDetails.Maindata[0].FINFOFEE
let lefFee = that.$store.state.userInfo.FBalanceAmount
if(yfFee > lefFee)
{
if (yfFee > lefFee) {
that.payType = 2
that.payWays = [{"value": 1,"text": "账户余额(" + lefFee + "元)", disabled:true, "iconname": "red-packet"},{"value": 2,"text": "微信支付","iconname": "weixin-fill"}];
}
else
{
that.payWays = [{"value": 1,"text": "账户余额(" + lefFee + "元)", "iconname": "red-packet"},{"value": 2,"text": "微信支付", "iconname": "weixin-fill"}];
that.payWays = [{
"value": 1,
"text": "账户余额(" + lefFee + "元)",
disabled: true,
"iconname": "red-packet"
}, {
"value": 2,
"text": "微信支付",
"iconname": "weixin-fill"
}];
} else {
that.payWays = [{
"value": 1,
"text": "账户余额(" + lefFee + "元)",
"iconname": "red-packet"
}, {
"value": 2,
"text": "微信支付",
"iconname": "weixin-fill"
}];
}
that.form.YuYueAddress = that.orderDetails.Maindata[0].FPROVINCE + that.orderDetails
.Maindata[0]
.FCITY + that.orderDetails.Maindata[0].FCOUNTY + that.orderDetails.Maindata[0].FAdress
......@@ -732,7 +790,9 @@
.FSFQUOTEDPRICEAMOUNTSF.toFixed(2)
}
that.orderDetails.Maindata[0].FAPPOINTMENTDATE = that.$u.timeFormat(that.orderDetails
.Maindata[0].FAPPOINTMENTDATE, 'yyyy-mm-dd hh:MM:ss')
.Maindata[0].FAPPOINTMENTDATE, 'yyyy-mm-dd hh:MM')
let focation = that.getNullEmpty(this.orderDetails.Maindata[0].FLocation)
if(!focation){that.adressMapShow=false}else{that.adressMapShow=true}
} else {
toast(res.data.message)
console.log("查询订单详情信息失败:", res)
......@@ -753,7 +813,13 @@
YuYue() {
this.showPopup = true
},
getNullEmpty(val) {
if (val === null || val === '' || val === undefined || val === 'null' || val===' ') {
return ''
}
if(val.trim().length==0)return ''
return val
},
//选择预约状态
YuYueStateSelect(index) {
this.YuYueState = this.YuYueStateList[index].value
......@@ -767,6 +833,16 @@
YuYueTimeConfirm(e) {
this.form.YuYueTime = e[1].value
},
sendCoordinate() {
this.showCoordinateModel = false
//发送确认地址
let conforParams = {
FID: this.FID
}
confirmCoordinate(conforParams).then((conres) => {
console.log(conres)
})
},
//提交预约信息
YuYueConfirm() {
let that = this
......@@ -819,6 +895,7 @@
},
FAppointmentResult: '1',
FAppointmentDate: '', //时间 YYYY-MM-DD MM:SS
FAppointmentTime: '',//时间段
FAppointmentAdress: '', //地址
FAppointmentNote: '' //备注
}]
......@@ -828,6 +905,7 @@
paramsTrue.Model.FID = that.FID
paramsTrue.Model.FAppointmentTimeEntity[0].FAppointmentDate = that.form.YuYueDate +
' ' + that.form.YuYueTime
paramsTrue.Model.FAppointmentTimeEntity[0].FAppointmentTime = that.form.YuYueTime
paramsTrue.Model.FAppointmentTimeEntity[0].FAppointmentAdress = that.form
.YuYueAddress
paramsTrue.Model.FAppointmentTimeEntity[0].FAppointmentNote = that.orderDetails
......@@ -837,10 +915,15 @@
loading()
sendAppointment(paramsTrue).then((res) => {
hidden()
let focation = that.getNullEmpty(this.orderDetails.Maindata[0].FLocation)
if(!focation){
that.sendCoordinate()
}
console.log("预约成功返回信息:", res.data)
if (res.data.code == 0) {
that.showPopup = false
that.init(that.obj)
this.$store.state.IncreaseDFW=true
} else {
toast(res.data.message)
}
......@@ -856,11 +939,10 @@
//完工图片提交
WanGongConfirm() {
let that = this
let files = []
files = that.$refs.uUpload.lists.filter(val => {
return val.progress == 100
})
// let files = []
// files = that.$refs.uUpload.lists.filter(val => {
// return val.progress == 100
// })
let params = {
Model: {
FID: '',
......@@ -868,12 +950,13 @@
FFinishImagesEntity: []
}
}
for (let i in files) {
for (let i in this.WGImgFileList) {
let obj = {
FFinishImage: ''
}
console.log("files[i]", files[i]);
obj.FFinishImage = files[i].response.result.fileid
//console.log("files[i]", files[i]);
obj.FFinishImage = this.WGImgFileList[i].fileid //files[i].response.result.fileid
obj.url = this.WGImgFileList[i].url
params.Model.FFinishImagesEntity.push(obj)
}
params.Model.FID = that.FID
......@@ -889,6 +972,7 @@
if (res.data.code == 0) {
that.showPopup = false
that.init(that.obj)
that.$store.state.IncreaseDYS=true
} else {
toast(res.data.message)
}
......@@ -900,15 +984,30 @@
},
//图片上传成功,计数加一
uploadSuccess1(data, index, lists) {
if (data.code == 100) {
// uploadSuccess1(data, index, lists) {
uploadSuccess1(res, index, lists, name) {
// if (data.code == 100) {
} else {
// } else {
// this.form.ufile = lists.length
// console.log(this.form.ufile)
// }
if (JSON.parse(res.data).code == 0) {
this.form.ufile = lists.length
console.log(this.form.ufile)
console.log(lists[index].response.result.fileurl)
let tempObj = {
fileid: '',
url: ''
}
tempObj.fileid = lists[index].response.result.fileid
tempObj.url = lists[index].response.result.fileurl
// lists[index].fileid = tempObj.fileid
this.WGImgFileList.push(tempObj)
}
},
uploadRemove1(index) {
this.WGImgFileList.splice(index, 1)
},
//报价信息提交(待报价) || 验收信息提交(完工验证码,待验收)
modalConfirm() {
let that = this
......@@ -923,6 +1022,10 @@
}
params.FID = that.orderDetails.Maindata[0].FID
params.Amount = that.form.BaoJiaValue
// let amount = that.orderDetails.Maindata[0].FSHAmount
// let infoRate = that.$store.state.userInfo.FInfoRate
// let yfrate = Number(amount * infoRate * 0.01).toFixed(2)
// showamount = Number(Number(amount) - Number(yfrate)).toFixed(2)
console.log('信息' + params.FID + ' ' + that.form.BaoJiaValue)
postOffer(params).then((res) => {
console.log('报价请求返回信息:', res)
......@@ -959,6 +1062,11 @@
that.$refs.uModal.clearLoading()
that.showModal = false
that.init(that.obj)
if(that.orderDetails.Maindata[0].FPayWay=="1"){
that.$store.state.IncreaseYZF=true
}else{
that.$store.state.IncreaseDJS=true
}
} else {
that.$refs.uModal.clearLoading()
toast(res.data.message)
......@@ -971,65 +1079,61 @@
});
}
if (this.orderDetails.Maindata[0].caption == '待结算') {
let params={
let params = {
FID: '',
appid:'',
appid: '',
}
if(that.InfoSFee === "") {
if (that.InfoSFee === "") {
toast("请输入实缴信息费")
that.$refs.uModal.clearLoading()
return
}
if(that.XCSSAmount === "") {
if (that.XCSSAmount === "") {
toast("请输入现场实收费用")
that.$refs.uModal.clearLoading()
return
}
params.appid=that.$store.state.appid
params.appid = that.$store.state.appid
params.FID = that.orderDetails.Maindata[0].FID
params.Infofee = that.InfoSFee
params.FXCSSAmount = that.XCSSAmount
params.orderno = that.orderDetails.Maindata[0].FBILLNO
if(that.payType == 1)
{
postInformationCost(params).then((res)=>{
if (that.payType == 1) {
postInformationCost(params).then((res) => {
console.info(res);
if(res.data.code==0){
if (res.data.code == 0) {
that.$refs.uModal.clearLoading()
that.showModal = false
that.orderDetails.Maindata[0].caption = "已完成"
let yfFee = that.orderDetails.Maindata[0].FINFOFEE
let lefFee = that.$store.state.userInfo.FBalanceAmount
that.$store.state.userInfo.FBalanceAmount = lefFee - yfFee
}
else{
that.$store.state.userInfo.FBalanceAmount = lefFee - yfFee
} else {
toast(res.data.message)
that.$refs.uModal.clearLoading()
}
})
}
else
{
} else {
params.amount = params.Infofee
params.paytype = "信息费"
console.info("params");
console.info(params);
payDeposit(params).then((res) => {
console.info(res);
if(res.data.code == 0){
if (res.data.code == 0) {
hidden()
let payParams = {
timeStamp:res.data.result.timeStamp,
nonceStr:res.data.result.nonceStr,
package:res.data.result.package,
signType:res.data.result.signType,
paySign:res.data.result.paySign
timeStamp: res.data.result.timeStamp,
nonceStr: res.data.result.nonceStr,
package: res.data.result.package,
signType: res.data.result.signType,
paySign: res.data.result.paySign
}
loading()
wx.requestPayment(payParams).then((res) => {
......@@ -1064,14 +1168,95 @@
break
}
},
callPhone() {
let that = this
wx.makePhoneCall({
phoneNumber: this.orderDetails.Maindata[0].FCustomerPhone
})
},
imgpreview(url) {
let array = [];
array.push(url);
uni.previewImage({
urls: array,
current: array[0]
});
},
openadress() {
let detailadress = this.orderDetails.Maindata[0].FPROVINCE + this.orderDetails.Maindata[0].FCITY + this.orderDetails
.Maindata[0].FCOUNTY + this.orderDetails.Maindata[0].FAdress
let openlocation = (latitude, longitude) => {
wx.openLocation({
latitude: latitude,
longitude: longitude,
name: detailadress,
address: detailadress,
success: function(res) {
console.log(res)
},
fail: function(failres) {
console.log(failres)
}
})
}
let floaction = this.getNullEmpty(this.orderDetails.Maindata[0].FLocation)
wx.getLocation({
success(res) {
let latide=res.latitude
let longde=res.longitude
if(floaction){
latide=Number(floaction.split(',')[0])
longde=Number(floaction.split(',')[1])
}
openlocation(latide, longde)
},
fail(res) {
console.log("出现错误:", res)
if (res.errMsg === 'getLocation:fail:ERROR_NOCELL&WIFI_LOCATIONSWITCHOFF') {
uni.showModal({
content: '请开启手机定位服务',
showCancel: false
})
}
if (res.errMsg === 'getLocation:fail auth deny') {
wx.showModal({ //引导用户授权
content: '小程序需要实时获取位置,请设置为后台前台都可运行',
confirmText: "确认",
cancelText: "取消",
success: function(res) {
//点击“确认”时打开设置页面
if (res.confirm) {
wx.openSetting({ //打开设置页面让用户选择权限
success: (res) => {
if (res.authSetting[
"scope.userLocationBackground"
] == true) {
wx.getLocation({
success(res) {
openlocation(res
.latitude, res
.longitude)
},
fail(res) {
console.log("出现错误:",
res)
}
})
}
}
})
} else { //取消打开设置授权页面
wx.showToast({
title: "取消授权",
icon: 'none',
})
}
}
})
}
}
})
}
},
computed: {
minDate: function() {
......@@ -1086,6 +1271,9 @@
},
recommendedPrice: function() {
let result = ''
if (!this.orderDetails || !this.orderDetails.Maindata || this.orderDetails.Maindata.length === 0) {
return '';
}
try {
let main = this.orderDetails.Maindata[0]
let JYJG = main.JYJG
......@@ -1094,10 +1282,11 @@
console.log("建议价格:", main.JYJG)
result = JYJG - (JYJG * InfoRate)
console.log("最终建议价格:", result)
return result
} catch {
return Number(result).toFixed(0)
} catch (ex) {
console.log(ex)
}
return result
},
subTitle: function() {
let result = ''
......@@ -1133,31 +1322,38 @@
},
orderDetails(val, oldval) {
let that = this
that.picUrlDic = {}
//设置服务类目(订单详情第一张card的标题:多个服务类目合并)
let getfileurl = function(filestr, item) {
getUrl(filestr).then((res) => {
hidden()
console.log("商品图片结果:", res)
if (res.data.code == 0) {
for (let index in res.data.result) {
let curResult = res.data.result[index];
that.picUrlDic[curResult.fileid] = curResult.fileurl
that.$forceUpdate()
}
} else {
// toast(res.data.message)
}
})
}
//请求商品图片链接
let myServiceName = ''
let goodsArray = []
loading()
for (let i in val.SPdata) {
myServiceName = myServiceName + val.SPdata[i].CPGG + ' '
let goodsArray = []
goodsArray.splice(0, 0, val.SPdata[i].GoodsImgArray)
}
loading()
let goodsStr = goodsArray.join(",")
console.log("商品图片请求:", goodsStr)
getUrl(goodsStr).then((res) => {
hidden()
console.log("商品图片结果:", res)
if (res.data.code == 0) {
for(let index in res.data.result)
{
let curResult = res.data.result[index];
that.picUrlDic[curResult.fileid] = curResult.fileurl
}
console.log(that.picUrlDic)
let goodsStr = goodsArray.join(",")
if (goodsStr === '' || goodsStr === ",") {
val.SPdata[i].GoodsImgArray = []
} else {
// toast(res.data.message)
getfileurl(goodsStr, val.SPdata[i])
}
})
}
hidden()
this.serviceName = myServiceName
//设置付款方式
switch (val.Maindata[0].FPayWay) {
......@@ -1189,6 +1385,17 @@
this.btnText = '缴纳信息费'
break
}
val.Maindata[0].FAPPOINTMENTDATE = this.getNullEmpty(val.Maindata[0].FAPPOINTMENTDATE)
val.Maindata[0].FAPPOINTMENTADRESS = this.getNullEmpty(val.Maindata[0].FAPPOINTMENTADRESS)
let appointime = this.getNullEmpty(val.Maindata[0].FAPPOINTMENTDATETIME)
if(appointime) appointime = that.$u.timeFormat(appointime, 'yyyy-mm-dd hh:MM')
val.Maindata[0].FAPPOINTMENTDATETIME=appointime
let focation = that.getNullEmpty(this.orderDetails.Maindata[0].FLocation)
if(!focation){that.adressMapShow=false}else{that.adressMapShow=true}
val.Maindata[0].FSFQUOTEDPRICETIME = this.getNullEmpty(val.Maindata[0].FSFQUOTEDPRICETIME)
val.Maindata[0].FSFQUOTEDPRICEAMOUNTSF = this.getNullEmpty(val.Maindata[0].FSFQUOTEDPRICEAMOUNTSF)
val.Maindata[0].FAPPOINTMENTRESULT = this.getNullEmpty(val.Maindata[0].FAPPOINTMENTRESULT)
this.$forceUpdate()
}
}
}
......@@ -1298,31 +1505,37 @@
margin-top: 5rpx;
margin-bottom: 10prx;
}
.phonestyle{
margin-left: 300rpx;
border: 1rpx,solid,#000000;
.phonestyle {
margin-left: 50rpx;
border: 1rpx, solid, #000000;
border-radius: 50%;
background-color: #626262;
color: #ffffff;
background-color: #3333;
color: #7c59fc;
}
.checkboxgroup{
padding-top:20upx;
.checkboxgroup {
padding-top: 20upx;
}
.wanningLabelValue{
.wanningLabelValue {
display: flex;
.label-item{
.label-item {
box-sizing: border-box;
width: calc(35%);
text-align: left;
position: relative;
}
.value-vitem{
.value-vitem {
box-sizing: border-box;
width: calc(65%);
text-align: left;
position: relative;
}
.value-item{
.value-item {
box-sizing: border-box;
width: calc(65%);
text-align: left;
......@@ -1330,42 +1543,61 @@
position: relative;
}
}
.labelValue{
.labelValue {
display: flex;
.label-item{
.label-item {
box-sizing: border-box;
width: calc(35%);
text-align: right;
position: relative;
}
.value-item{
.value-item {
box-sizing: border-box;
width: calc(65%);
text-align: left;
position: relative;
}
}
.grid{
.grid {
display: flex;
align-items: center;
flex-wrap: wrap;
border-top: 2upx solid rgba(255,255,255,.2);
.grid-item-3,.grid-item-4{
border-top: 2upx solid rgba(255, 255, 255, .2);
.grid-item-3,
.grid-item-4 {
box-sizing: border-box;
width: calc(100% / 3);
text-align: center;
padding: 40upx 0;
position: relative;
image{
image {
width: 200upx;
height: 200upx;
}
}
.grid-item-3:nth-child(3n + 3),.grid-item-4:nth-child(4n + 4){
.grid-item-3:nth-child(3n + 3),
.grid-item-4:nth-child(4n + 4) {
border-right: none;
}
.grid-item-4{
.grid-item-4 {
width: calc(100% / 4);
}
}
</style>
<style>
@import "../../icon.css";
.map-container {
display: inline-block;
position: relative;
top: 2px;
}
</style>
......@@ -9,7 +9,7 @@
<u-input v-model="form.name" placeholder="请输入真实姓名"></u-input>
</u-form-item>
<u-form-item label="手机号" prop="phone">
<u-input v-model="form.phone" type="number" placeholder="请输入11位手机号" maxlength="11"></u-input>
<u-input disabled v-model="form.phone" type="number" placeholder="请输入11位手机号" maxlength="11"></u-input>
</u-form-item>
<u-form-item label="验证码" prop="code">
<view style="width: 60%;display: inline-block;">
......
......@@ -12,21 +12,29 @@
<view class="positive">
<u-form label-width="150" label-align="center" ref="Iform" :model="form">
<u-form-item prop="ufilePositive" :required="true">
<u-upload :file-list="fileList1" :maxCount="1" width="650" height="350" uploadText="请上传身份证正面照片"
<u-upload ref="uUpload1" :file-list="fileList1" :maxCount="1" width="650" height="350"
uploadText="请上传身份证正面照片" :action="action1" :form-data="formData1" :header="header"
:before-upload="beforeUpload1" @on-success="uploadSuccess1" @on-remove="uploadremove1">
</u-upload>
<!-- <u-upload :file-list="fileList1" :maxCount="1" width="650" height="350" uploadText="请上传身份证正面照片"
:action="action1" :form-data="formData1" :header="header" :before-upload="beforeUpload1"
@on-success="uploadSuccess1">
</u-upload>
</u-upload> -->
</u-form-item>
<u-form-item prop="ufileBack" :required="true">
<u-upload :file-list="fileList2" :maxCount="1" width="650" height="350" uploadText="请上传身份证背面照片"
<u-upload ref="uUpload2" :file-list="fileList2" :maxCount="1" width="650" height="350"
uploadText="请上传身份证背面照片" :action="action2" :form-data="formData2" :header="header"
:before-upload="beforeUpload2" @on-success="uploadSuccess2" @on-remove="uploadremove2">
</u-upload>
<!-- <u-upload :file-list="fileList2" :maxCount="1" width="650" height="350" uploadText="请上传身份证背面照片"
:action="action2" :form-data="formData2" :header="header" :before-upload="beforeUpload2"
@on-success="uploadSuccess2">
</u-upload>
</u-upload> -->
</u-form-item>
</u-form>
</view>
<view class="btn">
<u-button :custom-style="btnStyle" @click="save">保存</u-button>
<u-button :custom-style="btnStyle" @click="save">{{BTTEXT||'保存'}}</u-button>
</view>
</view>
</view>
......@@ -40,18 +48,17 @@
apiBaseUrl
} from '../../api/request.js'
import {
edit
edit,
getUrl
} from '../../api/apis.js'
import {
loading,
hidden
hidden,
toast
} from '../../tips/myTips.js'
export default {
onLoad() {
this.url = apiBaseUrl
this.cellList[1].value = this.$store.state.userInfo.FCARD
uni.$u.mpShare.title = '页面分享';
this.id = this.$store.state.userInfo.Id
// this.onload()
},
onShow() {
this.$refs.Iform.setRules(this.iRule);
......@@ -103,6 +110,12 @@
name: 'card',
value: ''
}
// ,
// {
// title: '有效期',
// name: 'vailddate',
// value: ''
// }
],
tip: '提现账户必须与身份证姓名一致,图片大小不超过(5MB)',
header: {
......@@ -116,16 +129,182 @@
fileList2: [],
formData2: {
file: ''
},
fileList2: []
}
}
},
created() {
// wx.cloud.init({
// traceUser: true
// })
this.onload()
},
props: ['Eflag', 'FID', 'BTTEXT'],
methods: {
resetinit(fid) {
this.id = fid
this.onload(fid)
},
onload(fid) {
this.url = apiBaseUrl
if (this.Eflag && !fid) {
return
}
let that = this
let realname = this.$store.state.userInfo.FRealName
this.cellList[0].value = (realname === null || realname === 'null' || realname === '' || realname === undefined) ? '' : realname
let fcard = this.$store.state.userInfo.FCARD
this.cellList[1].value = (fcard === null || fcard === 'null' || fcard === '' || fcard === undefined) ? '' : fcard
let fileid1 = this.$store.state.userInfo.FidFrontImage
let fileid2 = this.$store.state.userInfo.FidBackImage
uni.$u.mpShare.title = '页面分享';
this.id = this.$store.state.userInfo.Id
if (fileid1)
getUrl(fileid1).then((res) => {
if (res.data.code == 0) {
that.fileList1.push({
url: res.data.result[0].fileurl
})
that.formData1.file = res.data.result[0].fileid
that.form.ufilePositive = 1
} else {
console.log("获取头像失败:", res)
}
})
if (fileid2)
getUrl(fileid2).then((res) => {
if (res.data.code == 0) {
that.fileList2.push({
url: res.data.result[0].fileurl
})
that.formData2.file = res.data.result[0].fileid
that.form.ufileBack = 1
} else {
console.log("获取头像失败:", res)
}
})
},
oppositeFalseCallback(res) {
console.log(123, res)
},
ocrcardcallback(formdata, resdata) {
if (resdata) {
this.cellList.forEach(item => {
switch (item.name) {
case "name":
item.value = resdata.name || ""
break;
case "vailddata":
item.value = resdata.valid_date || ""
break;
case "card":
item.value = resdata.id || ""
break;
}
})
}
hidden()
},
// getAppIdAccess(formData, imgurl) {
// let self = this
// let appid = 'wx6e2d664687c88632'
// let secret = 'fd9f861950556225abbdcca3876576ed'
// return new Promise((resolve, reject) => {
// uni.request({
// url: 'https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=' +
// appid + '&secret=' + secret,
// }).then(response => {
// // 这里的返回结果是经过我们自己封装的,请根据自己的实际情况返回
// if (response[1].statusCode === 200) {
// let accessToken = response[1].data.access_token
// resolve(accessToken)
// wx.request({
// url: 'https://api.weixin.qq.com/cv/ocr/idcard?type=photo&img_url=' +
// encodeURIComponent(imgurl) + '&access_token=' + accessToken,
// method: 'POST',
// success: function(response) {
// console.log(response)
// if (response.statusCode === 200 && response.data
// .errcode === 0) {
// // wx.showToast({
// // title: response.data.name + '识别成功'
// // })
// console.log(response.data)
// self.ocrcardcallback(formData, response.data)
// loading()
// toast('识别成功,正在上传')
// if (formData.actIdx === 0)
// this.$refs.uUpload1.upload();
// else if (formData.actIdx === 1)
// this.$refs.uUpload2.upload();
// } else {
// // wx.showToast({
// // title: '识别失败,请重新上传识别'//response.data.errmsg
// // })
// toast('识别失败,请重新上传识别')
// }
// },
// fail: function(error) {
// wx.showToast({
// title: error
// })
// }
// })
// } else {
// reject(error)
// }
// }).catch(error => {
// reject(error)
// })
// })
// },
// beforeUpload(formData, fileurl) {
// let self = this
// const suffix = fileurl.substr(fileurl.lastIndexOf('.'), fileurl.length)
// const newName = new Date().valueOf().toString() + Math.round(Math.random() * 100000) + suffix
// wx.cloud.uploadFile({
// cloudPath: newName,
// filePath: fileurl, // 文件路径
// success: res => {
// // get resource ID
// console.log(res.fileID)
// // 此处要得到图片的url,就需要用fileID去换
// wx.cloud.getTempFileURL({
// fileList: [{
// fileID: res.fileID,
// maxAge: 60 * 60, // one hour
// }]
// }).then(res => {
// // get temp file URL
// console.log(res.fileList[0].tempFileURL)
// // 后续操作见第三步操作【识别】
// self.getAppIdAccess(res.fileList[0].tempFileURL);
// }).catch(error => {
// // handle error
// })
// },
// fail: err => {
// // handle error
// console.log(err)
// }
// })
// return false
// },
beforeUpload1(index, list) {
loading()
this.formData1.file = list[index].url
this.formData1.actIdx = 0
// this.beforeUpload(this.formData1, list[index].url)
// return false
return true;
},
beforeUpload2(index, list) {
loading()
this.formData2.file = list[index].url
this.formData1.actIdx = 1
// this.beforeUpload(this.formData2, list[index].url)
// return false
return true
},
uploadSuccess1(data, index, lists) {
if (data.code == 100) {
......@@ -137,9 +316,14 @@
lists.splice(index, 1)
} else {
console.log(data)
this.formData1.file = data.result.fileurl
this.formData1.file = data.result.fileid
this.form.ufilePositive = 1
this.ocrcardcallback(this.formData1, {
id: data.result.idcardno,
name: data.result.name
})
}
hidden()
},
uploadSuccess2(data, index, lists) {
if (data.code == 100) {
......@@ -151,16 +335,49 @@
lists.splice(index, 1)
} else {
console.log(data)
this.formData2.file = data.result.fileurl
this.formData2.file = data.result.fileid
this.form.ufileBack = 1
// this.ocrcardcallback(this.formData1,{
// id:data.result.idcardno,
// name:data.result.name
// })
}
hidden()
},
uploadremove1(index, lists, name) {
this.form.ufilePositive = 0
},
uploadremove2(index, lists, name) {
this.form.ufileBack = 0
},
save() {
this.$refs.Iform.validate(valid => {
if (valid) {
console.log('验证通过');
let iname, idate, icard
this.cellList.forEach(item => {
switch (item.name) {
case "name":
iname = item.value || ""
break;
case "vailddata":
idate = item.value || ""
break;
case "card":
icard = item.value || ""
break;
}
})
if (!iname || !icard) {
toast('身份信息为空,保存失败')
return false
}
this.postdata.Model.FID = this.id
this.postdata.Model.FRealName = iname
this.postdata.Model.FCARD = icard
this.postdata.Model.FCheckStatus = 1
this.postdata.Model.FidFrontImage = this.formData1.file
this.postdata.Model.FidBackImage = this.formData2.file
loading()
edit(this.postdata).then((res) => {
hidden()
......
<template>
<view>
<view class="steps">
<u-steps mode="number" active-color="#7D5AFC" :list="steps" :current="current"></u-steps>
<u-steps mode="dot" active-color="#7D5AFC" :list="steps" :current="current"></u-steps>
<u-gap height="20" bg-color="transparent"></u-gap>
<!-- <u-steps mode="dot" active-color="#7D5AFC" :list="steps1" :current="current1"></u-steps> -->
</view>
<view class="form" v-if="current == 0">
<u-form label-width="190" label-align="center">
<u-form-item label="手机号">
......@@ -23,7 +25,8 @@
<u-checkbox @change="checkboxChange" v-model="checked"></u-checkbox><text>隐私协议和服务协议</text>
</view>
<view class="btn">
<u-button :disabled="!checked" :customStyle="checked ? btnStyle:disAbleStyle" hover-class="none" shape="circle" @click="register">下一步</u-button>
<u-button :disabled="!checked" :customStyle="checked ? btnStyle:disAbleStyle" hover-class="none"
shape="circle" @click="register">下一步</u-button>
</view>
</view>
<!-- 个人信息 -->
......@@ -36,13 +39,15 @@
<u-input v-model="formB.realname" placeholder="请输入真实姓名"></u-input>
</u-form-item>
<u-form-item label="手机号" prop="phone">
<u-input v-model="formB.phone" type="number" placeholder="请输入11位手机号" maxlength="11"></u-input>
<u-input disabled v-model="formB.phone" type="number" placeholder="请输入11位手机号" maxlength="11">
</u-input>
</u-form-item>
<u-form-item label="紧急联系电话" prop="ephone">
<u-input v-model="formB.ephone" type="number" placeholder="请输入11位手机号" maxlength="11"></u-input>
</u-form-item>
<view class="btn">
<u-button :customStyle="btnStyle" hover-class="none" shape="circle" @click="personalInfo">下一步</u-button>
<u-button :customStyle="btnStyle" hover-class="none" shape="circle" @click="personalInfo">下一步
</u-button>
</view>
</u-form>
</view>
......@@ -52,19 +57,49 @@
<u-form-item label="居住地址" prop="address">
<u-input disabled v-model="formC.address" @click="show = true" placeholder="点击选择居住地址"></u-input>
<u-select v-model="show" mode="mutil-column-auto" :list="list" @confirm="save"></u-select>
<u-icon slot="right" name="arrow-right" @click="show = true"></u-icon>
</u-form-item>
<u-form-item label="详细地址" prop="detail">
<u-input v-model="formC.detail" type="textarea" placeholder="请输入详细地址(如:XXX街道,XXX小区)"></u-input>
<u-input v-model="formC.detail" type="textarea" placeholder="请输入详细地址(如:XXX街道,XXX小区)"
@focus="adressdetailfocus" @input="adressdetailfocus"></u-input>
<u-icon slot="right" size="36" name="map-fill" label-color="#7D5AFC"
@click="getchooseLocationPermission"></u-icon>
</u-form-item>
<view class="btn">
<u-button :customStyle="btnStyle" hover-class="none" shape="circle" @click="addressInfo">下一步</u-button>
<u-button :customStyle="btnStyle" hover-class="none" shape="circle" @click="addressInfo">下一步
</u-button>
</view>
</u-form>
</view>
<!-- 服务区域 -->
<view class="form" v-show="current == 3">
<view class="setEdit" >
<editPage :style="'height:'+height*0.6+'px'" :Eflag="Eflag" :FID="FID"></editPage>
<view class="setEdit">
<editPage :style="'height:'+height*0.6+'px'" :Eflag="Eflag" :FID="FID" BTTEXT="下一步"
@NextStep='nextStep'>
</editPage>
</view>
</view>
<!-- 服务类目 -->
<view class="form" v-show="current == 4">
<view>
<serviceCategory ref="serviceCategory" :Eflag="Eflag" :FID="FID" BTTEXT="下一步" @NextStep='nextStep'>
</serviceCategory>
</view>
</view>
<!-- 身份认证 -->
<view class="form" v-show="current == 5">
<view>
<realnameAuthentication ref="realnameAuthentication" :Eflag="Eflag" :FID="FID" BTTEXT="完成注册"
@NextStep='nextStep'></realnameAuthentication>
</view>
<!-- <view class="btn" >
<u-button :customStyle="btnStyle" hover-class="none" shape="circle" @click="serviceArea">完成注册</u-button>
</view> -->
</view>
<!-- 缴纳保证金 -->
<view class="form" v-show="current1 == 2">
<view>
</view>
<!-- <view class="btn" >
<u-button :customStyle="btnStyle" hover-class="none" shape="circle" @click="serviceArea">完成注册</u-button>
......@@ -74,27 +109,48 @@
</template>
<script>
import {loading,hidden,toast} from '../../tips/myTips.js'
import {getCode,register} from '../../api/api.js'
import {edit,postAvatar,getAddress} from '../../api/apis.js'
import{editPage}from'../serviceArea/edit/edit.vue'
import {
loading,
hidden,
toast
} from '../../tips/myTips.js'
import {
getCode,
register
} from '../../api/api.js'
import {
edit,
postAvatar,
getAddress
} from '../../api/apis.js'
import {
editPage
} from '../serviceArea/edit/edit.vue'
import {
serviceCategory
} from '../serviceCategory/serviceCategory.vue'
import {
realnameAuthentication
} from '../realnameAuthentication/realnameAuthentication.vue'
export default {
components:{
editPage
components: {
editPage,
serviceCategory,
realnameAuthentication
},
created(){
created() {
let that = this
uni.$on('uAvatarCropper',path => {
uni.$on('uAvatarCropper', path => {
this.formB.avatar = path
})
},
onLoad(){
onLoad() {
uni.$u.mpShare.title = '页面分享';
let that = this
this.width = this.$store.state.sysInfo.windowWidth
this.height = this.$store.state.sysInfo.screenHeight
wx.getUserInfo({
success(res){
success(res) {
that.formA.encryptedData = res.encryptedData
that.formA.iv = res.iv
}
......@@ -102,274 +158,411 @@
loading()
getAddress().then((res) => {
hidden()
console.log("城区信息:",res)
if(res.data.code == 0){
console.log("城区信息:", res)
if (res.data.code == 0) {
that.list = res.data.result
}else{
} else {
toast(res.data.message)
}
})
},
onReady(){
onReady() {
this.$refs.uformB.setRules(this.rulesB)
this.$refs.uformC.setRules(this.rulesC)
},
data(){
return{
btnStyle:{
background:"#7D5AFC",
color:'#FFFFFF'
watch: {
formC: {
handler(newValue, oldValue) {
if (oldValue.address === '' || !oldValue.address)
paramsC.Model.FLocation = ''
},
deep: true
}
},
data() {
return {
btnStyle: {
background: "#7D5AFC",
color: '#FFFFFF'
},
disAbleStyle:{
background:"#7D5AFC4d",
color:'#FFFFFF'
disAbleStyle: {
background: "#7D5AFC4d",
color: '#FFFFFF'
},
FID:'',
steps:[
FID: '',
steps: [{
name: '账号认证'
},
{
name:'账号认证'
name: '基本信息'
},
{
name:'基本信息'
name: '地址/区域'
},
{
name:'地址/区域'
name: '服务地址'
},
{
name:'服务类目'
name: '服务类目'
}, {
name: '身份认证'
}
],
current:0,
steps1: [{
name: '服务类目'
}, {
name: '身份认证'
}
// , {
// name: '缴纳保证金'
// },
],
current: 0,
current1: -1,
//注册表
formA:{
Phone:this.$store.state.userInfo.FPHONE,
VerificationCode:'',
encryptedData:'',
iv:''
formA: {
Phone: this.$store.state.userInfo.FPHONE,
VerificationCode: '',
encryptedData: '',
iv: ''
},
//个人信息表
formB:{
avatar:'',
realname:'',
phone:'',
ephone:''
formB: {
avatar: '',
realname: '',
phone: '',
ephone: ''
},
paramsB:{
Model:{
FID:this.$store.state.userInfo.Id,
FName:'',
FPHONE:'',
FUserImage:'',
FEmergentPHONE:''
paramsB: {
Model: {
FID: this.$store.state.userInfo.Id,
FName: '',
FPHONE: '',
FUserImage: '',
FEmergentPHONE: ''
}
},
rulesB:{
realname:[
{
required:true,
message: '请输入真实姓名',
trigger: 'blur'
}
],
phone:[
{
required:true,
rulesB: {
realname: [{
required: true,
message: '请输入真实姓名',
trigger: 'blur'
}],
phone: [{
required: true,
message: '请输入11位手机号',
trigger: 'blur'
},
{
len:11,
len: 11,
message: '请输入正确格式的手机号',
trigger: 'change'
}
],
code:[
{
required:true,
message: '请输入6位数字验证码',
trigger: 'blur'
}
],
ephone:[
{
required:true,
code: [{
required: true,
message: '请输入6位数字验证码',
trigger: 'blur'
}],
ephone: [{
required: true,
message: '请输入11位紧急手机号',
trigger: 'blur'
},
{
len:11,
len: 11,
message: '请输入正确格式的紧急手机号',
trigger: 'change'
}
]
},
list:'',
list: '',
//地址表
formC:{
address:'',
detail:''
formC: {
address: '',
detail: ''
},
rulesC:{
address:[
{
required:true,
message: '请选择居住地址',
trigger: 'blur,change'
}
],
detail:[
{
required:true,
message: '请输入详细地址',
trigger: 'blur'
}
]
rulesC: {
address: [{
required: true,
message: '请选择居住地址',
trigger: 'blur,change'
}],
detail: [{
required: true,
message: '请输入详细地址',
trigger: 'blur'
}]
},
paramsC:{
Model:{
FID:this.$store.state.userInfo.Id,
FPROVINCE_ID:'',
FPROVINCE:'',
FCity_ID:'',
FCity:'',
FCOUNTY_ID:'',
FCOUNTY:'',
FAdress:''
paramsC: {
Model: {
FID: this.$store.state.userInfo.Id,
FPROVINCE_ID: '',
FPROVINCE: '',
FCity_ID: '',
FCity: '',
FCOUNTY_ID: '',
FCOUNTY: '',
FAdress: '',
FLocation: ''
}
},
show:false,
show: false,
//服务区域表
formD:{
formD: {
},
text:'获取验证码',
checked:false,
text: '获取验证码',
checked: true,
width: "",
height: "",
Eflag:true,
Eflag: true,
userList: {}
}
},
methods:{
codeChange(text){
methods: {
nextStep() {
if (this.current >= this.steps.length - 1) {
this.current += 1
this.current1 += 1
} else {
this.current += 1
}
if (this.current === 4) {
//刷新服务类目
this.$refs.serviceCategory.resetinit(this.FID);
} else if (this.current === 5) {
//刷新实名认证
this.$refs.realnameAuthentication.resetinit(this.FID);
}
},
codeChange(text) {
this.text = text
},
getcode(){
getcode() {
getCode(this.formA.Phone).then((res) => {
console.log("请求二维码信息:",res)
if(res.data.code == 0){
console.log("请求二维码信息:", res)
if (res.data.code == 0) {
this.$refs.uCode.start()
console.log(res)
}else{
} else {
toast(res.data.result)
console.log(res)
}
})
},
checkboxChange(){
checkboxChange() {
this.checked = true
},
//第一步注册
register(){
register() {
let that = this
register(this.formA).then((res) => {
console.log("注册返回信息:",res)
if(res.data.code == 0){
that.$store.state.userInfo=res.data.result.Result
that.FID=res.data.result.Result.Id
that.current += 1
console.log(that.FID)
}else{
toast(res.data.message)
console.log("注册出现错误:",res)
// that.nextStep()
// return
let registfn = () => {
register(that.formA).then((res) => {
hidden()
console.log("注册返回信息:", res)
if (res.data.code == 0) {
that.$store.state.userInfo = res.data.result.Result
that.FID = res.data.result.Result.Id
// that.current += 1
that.formB.phone = that.formA.Phone
that.nextStep()
console.log(that.FID)
} else {
toast(res.data.message)
console.log("注册出现错误:", res)
}
})
// that.nextStep()
}
wx.getUserProfile({
desc: "获取个人信息",
success: (res) => {
loading()
that.userList = res.userInfo;
that.formB.avatar = that.userList.avatarUrl
// let filePath = wx.env.USER_DATA_PATH + '/' + new Date().valueOf().toString() + Math.round(Math.random() * 100000) + '.png';
wx.downloadFile({
url: that.formB.avatar, // 图片下载地址
// filePath: filePath,
success: (res) => {
hidden()
//如果要保存手机相册就需要访问权限,方式:saveimg
that.formB.avatar = res.tempFilePath;
console.log(res);
// wx.showModal({
// content: res.tempFilePath,
// success: function(res) {
// that.nextStep()
// }
// });
registfn()
// that.nextStep()
},
fail: err => {
// hidden()
registfn()
}
})
console.log(res)
},
fail: res => {
loading()
registfn()
}
})
},
saveimg(tempfilepath) {
let that = this
wx.authorize({
scope: 'scope.writePhotosAlbum',
/* 这个就是保存相册的 */
success() {
/* 保存图片方法 */
that.saveImageToPhotosAlbum(tempfilepath);
},
complete(res) {
console.log(res);
/* 这里判断一下如果没有授权重新打开设置选项 */
wx.getSetting({
success(res) {
if (!res.authSetting['scope.writePhotosAlbum']) {
/* 打开设置的方法 */
that.opensit(tempfilepath);
}
}
});
}
})
},
opensit(tempfilepath) {
let that = this
wx.showModal({
content: '需要访问您的相册权限,点击确定允许授权',
success: function(res) {
if (res.confirm) {
/* 这个就是打开设置的API*/
wx.openSetting({
success(res) {
that.saveImageToPhotosAlbum(tempfilepath);
console.log(res.authSetting);
}
});
} else if (res.cancel) {
wx.showModal({
cancelText: '依然取消',
confirmText: '重新授权',
content: '很遗憾你点击了取消,无法继续操作',
success: function(res) {
if (res.confirm) {
wx.openSetting({
success(res) {
that.saveImageToPhotosAlbum(tempfilepath);
console.log(res.authSetting);
}
});
} else if (res.cancel) {
console.log('用户不授权');
}
}
});
}
}
});
},
saveImageToPhotosAlbum(filepath) {
wx.saveImageToPhotosAlbum({
filePath: filepath,
success: (data) => {
that.formB.avatar = filePath;
console.log(filePath);
//that.nextStep()
},
fail: err => {
console.log(err)
}
})
},
//第二步填写用户基本信息
personalInfo(){
personalInfo() {
let that = this
// that.nextStep()
// return
let editsave = () => {
edit(that.paramsB).then((res) => {
hidden()
console.log("修改个人信息结果:", res)
if (res.data.code == 0) {
// that.current += 1
that.nextStep()
} else {
toast(res.data.message)
}
})
}
this.$refs.uformB.validate(valid => {
if(valid){
if (valid) {
that.paramsB.Model.FName = that.formB.realname
that.paramsB.Model.FPHONE = that.formB.phone
that.paramsB.Model.FEmergentPHONE = that.formB.ephone
console.log(that.paramsB.Model.FID)
that.paramsB.Model.FID=that.FID
console.log("用户参数:",that.paramsB)
that.paramsB.Model.FID = that.FID
console.log("用户参数:", that.paramsB)
console.log(that.paramsB.Model.FID)
console.log("avatar:",this.formB.avatar == "")
console.log("avatar:", this.formB.avatar == "")
loading()
if(this.formB.avatar != "")
{
if (this.formB.avatar != "") {
postAvatar(this.formB.avatar).then((res) => {
hidden()
console.log("上传头像结果:",res)
if(JSON.parse(res.data).code == 0){
console.log("上传头像结果:", res)
if (JSON.parse(res.data).code == 0) {
let result = JSON.parse(res.data).result
that.paramsB.Model.FUserImage = result.fileid
loading()
edit(that.paramsB).then((res) => {
hidden()
console.log("修改个人信息结果:",res)
if(res.data.code == 0){
that.current += 1
}else{
toast(res.data.message)
}
})
}else{
toast(res.data.message)
}
editsave()
})
} else {
editsave()
}
else
{
edit(that.paramsB).then((res) => {
hidden()
console.log("修改个人信息结果:",res)
if(res.data.code == 0){
that.current += 1
}else{
toast(res.data.message)
}
})
}
}else{
} else {
console.log('验证失败')
}
})
},
//第三步填写地址
addressInfo(){
addressInfo() {
let that = this
// that.nextStep()
// return
this.$refs.uformC.validate(valid => {
if(valid){
that.paramsC.Model.FAdress = that.formC.address
that.paramsC.Model.FID=that.FID
console.log("地址参数:",this.paramsC)
if (valid) {
that.paramsC.Model.FAdress = that.formC.detail
that.paramsC.Model.FID = that.FID
console.log("地址参数:", this.paramsC)
loading()
edit(that.paramsC).then((res) => {
hidden()
console.log("修改地址信息结果:",res)
if(res.data.code == 0){
that.current += 1
}else{
console.log("修改地址信息结果:", res)
if (res.data.code == 0) {
// that.current += 1
that.nextStep()
} else {
toast(res.data.message)
}
})
}
})
},
serviceArea(){
serviceArea() {
uni.navigateBack()
},
avatarCut(){
avatarCut() {
this.$u.route({
url:'/pages/personalSettings/cut/u-avatar-cropper',
url: '/pages/personalSettings/cut/u-avatar-cropper',
params: {
// 输出图片宽度,高等于宽,单位px
destWidth: 200,
......@@ -380,7 +573,7 @@
}
})
},
save(res){
save(res) {
this.formC.address = res[0].label + res[1].label + res[2].label
this.paramsC.Model.FPROVINCE = res[0].label
this.paramsC.Model.FPROVINCE_ID = res[0].value
......@@ -389,23 +582,117 @@
this.paramsC.Model.FCOUNTY = res[2].label
this.paramsC.Model.FCOUNTY_ID = res[2].value
},
adressdetailfocus() {
// if (!this.paramsC.Model.FLocation) {
if (!this.formC.detail) {
this.getchooseLocationPermission()
}
},
getchooseLocationPermission() {
let that = this
let setdata = function(res) {
console.log(res)
that.formC.detail = res.address
that.paramsC.Model.FLocation = res.latitude + ',' + res.longitude
}
let location = {}
if (that.paramsC.Model.FLocation) {
let locsplit = that.paramsC.Model.FLocation.split(',')
location = {
latitude: locsplit[0],
longitude: locsplit.length > 1 ? locsplit[1] : ''
}
}
wx.chooseLocation({
latitude: location.latitude,
longitude: location.longitude,
success: function(res) {
// obj.setData({
// addr: res.address //调用成功直接设置地址
// })
setdata(res)
},
fail: function() {
wx.getSetting({
success: function(res) {
var statu = res.authSetting;
if (!statu['scope.userLocation']) {
wx.showModal({
title: '是否授权当前位置',
content: '需要获取您的地理位置,请确认授权,否则地图功能将无法使用',
success: function(tip) {
if (tip.confirm) {
wx.openSetting({
success: function(data) {
if (data
.authSetting[
"scope.userLocation"
] === true
) {
wx.showToast({
title: '授权成功',
icon: 'success',
duration: 1000
})
//授权成功之后,再调用chooseLocation选择地方
wx.chooseLocation({
success: function(
res
) {
// obj.setData({
// addr: res
// .address
// })
setdata
(
res
)
},
})
} else {
wx.showToast({
title: '授权失败',
icon: 'success',
duration: 1000
})
}
}
})
}
}
})
}
},
fail: function(res) {
wx.showToast({
title: '调用授权窗口失败',
icon: 'success',
duration: 1000
})
}
})
}
})
}
},
}
</script>
<style>
.steps{
.steps {
margin-top: 5%;
}
.checkbox{
.checkbox {
margin: 3% 6%;
}
.btn{
.btn {
margin: 5% auto;
width: 95%;
}
.setEdit{
.setEdit {
padding-left: 26rpx;
padding-right: 26rpx;
border: 1rpx solid #000000;
......
......@@ -40,7 +40,7 @@
<view class="container">
<view class="editTable">
<u-button hover-class="none" :custom-style="btnStyle" shape="circle" @click="bottomBtn">
提交
{{BTTEXT||'提交'}}
</u-button>
</view>
</view>
......@@ -53,7 +53,8 @@
} from '../../../api/apis.js'
import {
loading,
hidden
hidden,
toast
} from '../../../tips/myTips.js'
export default {
//xxxxxxx
......@@ -128,8 +129,8 @@
this.height = this.$store.state.sysInfo.screenHeight
this.id = this.$store.state.userInfo.Id
this.Uarea = this.$store.state.userInfo.FServiceArea
if(this.Eflag==true){
this.Uarea=false
if (this.Eflag == true) {
this.Uarea = false
}
},
onLoad() {
......@@ -138,7 +139,7 @@
onshow() {
},
props: ['Eflag','FID'],
props: ['Eflag', 'FID', 'BTTEXT'],
data() {
return {
rSelectY: [0],
......@@ -186,6 +187,21 @@
methods: {
//获取省列表的下标,并给省id赋值,传递该省所含的市列表
tapInfo(e) {
if (!this.addressData[e].count) {
let selcount = 0
for (let i = 0; i < this.addressData.length; i++) {
if (this.addressData[i].count && this.addressData[i].count > 0) {
selcount++;
if (selcount >= 3) {
break;
}
}
}
if (selcount >= 3) {
toast('不能选择大于3个省份')
return;
}
}
if (this.rSelectY.indexOf(e) !== -1) {
this.city = this.addressData[e].children
} else {
......@@ -295,31 +311,21 @@
} else {
this.$set(this.provinceCount, 'count', 0)
}
},
bottomBtn() {
let that=this
this.postdata.Model.FServiceArea = this.choice
this.postdata.Model.FID = this.id
console.log(this.postdata)
console.log(this.Eflag)
if (this.Eflag == true) {
this.postdata.Model.FID=this.FID
this.postdata.Model.FID = this.FID
loading()
edit(this.postdata).then((res) => {
hidden()
if (res.data.code == 0) {
console.log(res)
uni.switchTab({
url: '/pages/index/index'
})
} else {
console.log("error")
uni.switchTab({
url: '/pages/index/index'
})
}
that.$emit('NextStep')
})
// this.$emit('NextStep')
} else {
loading()
edit(this.postdata).then((res) => {
......
......@@ -3,13 +3,8 @@
<view class="checkbox">
<u-checkbox-group @change="checkSelect">
<u-checkbox name="全选" v-model="selectAll" @change="checkedAll">{{selectAllText}}</u-checkbox>
<u-checkbox
v-for="(item,key) in checkList"
:key="key"
:name="item.name"
v-model="item.checked"
@change="checkChange"
>
<u-checkbox v-for="(item,key) in checkList" :key="key" :name="item.name" v-model="item.checked"
@change="checkChange">
{{item.name}}
</u-checkbox>
</u-checkbox-group>
......@@ -18,7 +13,8 @@
<view style="margin: 5% 0;">
<text style="color:#000000">其他技能</text>
</view>
<u-input type="textarea" placeholder="如:修电脑 修手机等" :border="true" v-model="form.Model.FOtherSkills"></u-input>
<u-input type="textarea" placeholder="如:修电脑 修手机等" :border="true" v-model="form.Model.FOtherSkills">
</u-input>
</view>
<view class="tips">
<view>
......@@ -30,61 +26,77 @@
</view>
<view class="pics">
<view style="margin: 5% 0;">
<text style="color:#000000">请上传擅长安装产品完工的照片</text>
<text style="color:#000000">请上传擅长安装产品完工的照片(最多上传9张)</text>
</view>
<u-upload
ref="upload"
:file-list="uploadFileList"
:action="action"
:header="header"
@on-change="uploaded"
@on-remove="remove"
></u-upload>
<u-upload ref="upload" :file-list="uploadFileList" :action="action" :header="header" :maxCount="9"
@on-change="uploaded" @on-remove="remove"></u-upload>
</view>
<view class="btn">
<u-button @click="confirm" :custom-style="btnStyle">确定</u-button>
<u-button @click="confirm" :custom-style="btnStyle">{{BTTEXT||'确定'}}</u-button>
</view>
</view>
</template>
<script>
import {apiBaseUrl} from '../../api/request.js'
import {loading,hidden,toast} from '../../tips/myTips.js'
import {getServiceItem,getFileUrl,uploadpic,editInfo} from '../../api/api.js'
import {
apiBaseUrl
} from '../../api/request.js'
import {
loading,
hidden,
toast
} from '../../tips/myTips.js'
import {
getServiceItem,
getFileUrl,
uploadpic,
editInfo
} from '../../api/api.js'
export default {
onLoad(){
onLoad() {
// this.init()
// uni.$u.mpShare.title = '页面分享';
},
created() {
this.init()
uni.$u.mpShare.title = '页面分享';
},
data(){
props: ['Eflag', 'FID', 'BTTEXT'],
data() {
return {
btnStyle:{
background:"#7D5AFC",
color:'#FFFFFF'
btnStyle: {
background: "#7D5AFC",
color: '#FFFFFF'
},
checkList:[],
selectAll:false,
selectAllText:'全选',
form:{
IsDeleteEntry:true,
Model:{
FID:this.$store.state.userInfo.Id,
FOtherSkills:'',
FServiceTypeEntity:[],
FServiceImagesEntity:[]
checkList: [],
selectAll: false,
selectAllText: '全选',
form: {
IsDeleteEntry: true,
Model: {
FID: this.$store.state.userInfo.Id,
FOtherSkills: '',
FServiceTypeEntity: [],
FServiceImagesEntity: []
}
},
url:'',
header:{
test:11
url: '',
header: {
test: 11
},
//上传图片列表
uploadFileList:[]
uploadFileList: []
}
},
methods:{
init(){
methods: {
resetinit(fid) {
this.init(fid)
},
init(fid) {
if(this.Eflag && !fid){
return
}
this.url = apiBaseUrl
let userInfo = this.$store.state.userInfo
let that = this
......@@ -93,82 +105,87 @@
loading()
getServiceItem().then((res) => {
hidden()
if(res.data.code == 0){
for(let i in res.data.result){
if (res.data.code == 0) {
for (let i in res.data.result) {
res.data.result[i].checked = false
this.checkList.push(res.data.result[i])
}
//获取已选择的服务类目
for(let i in this.checkList){
for(let j in userInfo.FServiceTypeEntity){
if(userInfo.FServiceTypeEntity[j].FSERVICEREMARK == this.checkList[i].name){
for (let i in this.checkList) {
for (let j in userInfo.FServiceTypeEntity) {
if (userInfo.FServiceTypeEntity[j].FSERVICEREMARK == this.checkList[i].name) {
this.checkList[i].checked = true
break
}
}
}
let count=0
for(var i =0,len=this.checkList.length;i<len;i++){
if(this.checkList[i].checked == true){
count+=1
let count = 0
for (var i = 0, len = this.checkList.length; i < len; i++) {
if (this.checkList[i].checked == true) {
count += 1
}
}
if(count==this.checkList.length){
this.selectAll=true
if (count == this.checkList.length) {
this.selectAll = true
}
}
})
//循环获取完工图片
console.log("服务类目实体类:",userInfo.FServiceImagesEntity)
if(userInfo.FServiceImagesEntity.length !== 0){
for(let i in userInfo.FServiceImagesEntity){
console.log("服务类目实体类:", userInfo.FServiceImagesEntity)
if (userInfo.FServiceImagesEntity && userInfo.FServiceImagesEntity.length !== 0) {
for (let i in userInfo.FServiceImagesEntity) {
loading()
getFileUrl(userInfo.FServiceImagesEntity[i].FServiceImage).then((res) => {
hidden()
if(res.data.code == 0){
let tempFormImagesEntity = {url:'',FServiceImage:''}
if (res.data.code == 0) {
let tempFormImagesEntity = {
url: '',
FServiceImage: ''
}
tempFormImagesEntity.FServiceImage = res.data.result[0].fileid
tempFormImagesEntity.url = res.data.result[0].fileurl
that.form.Model.FServiceImagesEntity.push(tempFormImagesEntity)
that.uploadFileList.push(tempFormImagesEntity)
}else{
} else {
toast(res.data.message)
}
})
}
}
},
checkChange(e){
checkChange(e) {
},
checkSelect(e){
if(e.length==this.checkList.length&&this.selectAll==false)
{
this.selectAll=true
}
else if(this.selectAll==true&&e.length<=this.checkList.length){
this.selectAll=false
checkSelect(e) {
if (e.length == this.checkList.length && this.selectAll == false) {
this.selectAll = true
} else if (this.selectAll == true && e.length <= this.checkList.length) {
this.selectAll = false
}
},
checkedAll(e){
if(e.value == true){
checkedAll(e) {
if (e.value == true) {
this.checkList.map(val => {
val.checked = true
})
}else{
} else {
this.checkList.map(val => {
val.checked = false
})
}
},
uploaded(res, index, lists, name){
uploaded(res, index, lists, name) {
console.log(JSON.parse(res.data))
if(JSON.parse(res.data).code == 0){
if (JSON.parse(res.data).code == 0) {
console.log(lists[index].response.result.fileurl)
let tempObj = {FServiceImage:'',fileurl:''}
let tempObj = {
FServiceImage: '',
fileurl: ''
}
tempObj.FServiceImage = lists[index].response.result.fileid
tempObj.fileurl = lists[index].response.result.fileurl
// this.uploadFileList.push(tempObj)
this.form.Model.FServiceImagesEntity.push(tempObj)
}
// if(data.code == 0){
......@@ -186,38 +203,51 @@
// })
// lists.splice(index,1)
// }
},
remove(index, lists, name){
lists.splice(index,1)
this.form.Model.FServiceImagesEntity.splice(index,1)
console.log("删除后:",this.form.Model.FServiceImagesEntity)
remove(index) {
this.uploadFileList.splice(index, 1)
this.form.Model.FServiceImagesEntity.splice(index, 1)
console.log("删除后:", this.form.Model.FServiceImagesEntity)
},
confirm(){
for(let i in this.checkList){
confirm() {
let that=this
for (let i in this.checkList) {
let temp = {
FSERVICEITEM:{
FNUMBER:''
FSERVICEITEM: {
FNUMBER: ''
},
FSERVICEREMARK:''
FSERVICEREMARK: ''
}
if(this.checkList[i].checked == true){
if (this.checkList[i].checked == true) {
temp.FSERVICEITEM.FNUMBER = this.checkList[i].number
temp.FSERVICEREMARK = this.checkList[i].name
this.form.Model.FServiceTypeEntity.push(temp)
}
}
console.log("修改参数:",this.form)
console.log("修改参数:", this.form)
loading()
editInfo(this.form).then((res) => {
console.log(res)
hidden()
uni.navigateBack()
})
if (this.Eflag == true) {
this.form.Model.FID = this.FID
editInfo(this.form).then((res) => {
console.log(res)
hidden()
// uni.navigateBack()
that.$emit('NextStep')
})
// hidden()
// this.$emit('NextStep')
} else {
editInfo(this.form).then((res) => {
console.log(res)
hidden()
uni.navigateBack()
})
}
}
},
computed:{
action:function(){
computed: {
action: function() {
return this.url + '/api/UploadAttachments'
}
}
......@@ -225,19 +255,23 @@
</script>
<style>
.serviceCategory{
.serviceCategory {
padding: 7% 4%;
}
.checkbox{
.checkbox {
margin: 5% 0;
}
.order-skill{
.order-skill {
margin: 2% 0;
}
.tips{
.tips {
margin: 2% 0;
}
.pics{
.pics {
margin: 2% 0;
}
</style>
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论