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

师傅端

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