Compare commits

..

1 Commits

Author SHA1 Message Date
weipengfei
cadc39fc02 9.19预上线 2023-09-19 16:50:27 +08:00
90 changed files with 6159 additions and 14945 deletions

190
App.vue
View File

@ -1,123 +1,91 @@
<script> <script>
//#ifdef APP-PLUS //#ifdef APP-PLUS
const jpushModule = uni.requireNativePlugin("JG-JPush"); const jpushModule = uni.requireNativePlugin("JG-JPush");
// #endif // #endif
import { import { loginShopAccount, userInfo } from "@/api/oaUser.js"
loginShopAccount, export default {
loginParseToken, onLaunch: async function(info) {
userInfo // let noticeArr = []
} from "@/api/oaUser.js" // jpushModule.addNotificationListener(res => {
export default { // if (!noticeArr.includes(res.messageID)) {
onLaunch: async function(info) { // const audioContext = uni.createInnerAudioContext()
// let noticeArr = [] // //
// jpushModule.addNotificationListener(res => { // audioContext.src = `/static/audio/order.mp3`;
// if (!noticeArr.includes(res.messageID)) { // // console.log(res.messageID)
// const audioContext = uni.createInnerAudioContext() // audioContext.play()
// // // noticeArr.push(res.messageID)
// audioContext.src = `/static/audio/order.mp3`; // console.log("app")
// // console.log(res.messageID) // }
// audioContext.play() // })
// noticeArr.push(res.messageID)
// console.log("app")
// }
// })
// uni.showModal({ // uni.showModal({
// content: info.referrerInfo.extraData // content: info.referrerInfo.extraData
// }) // })
if (info.referrerInfo?.extraData?.uniMP) { if (info.referrerInfo?.extraData?.uniMP) {
//宿App uni.setStorageSync('uniMP', info.referrerInfo?.extraData?.uniMP);
uni.onHostEventReceive((event, data) => { uni.setStorageSync('APP_token', info.referrerInfo?.extraData?.token);
if (event == 'getLocation') uni.$emit('uniMP_getLocation', data); try{
}); let res = await loginShopAccount({
uni.setStorageSync('uniMP', info.referrerInfo?.extraData?.uniMP); shop_token: info.referrerInfo?.extraData?.token
uni.setStorageSync('APP_token', info.referrerInfo?.extraData?.token); });
try { this.$store.commit('SET_USERINFO', {
let res = await loginParseToken({ user: data,
// token:"eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJjZXNoaS1taWRkbGUubGloYWluay5jbiIsImF1ZCI6ImNlc2hpLW1pZGRsZS5saWhhaW5rLmNuIiwiaWF0IjoxNzAwNzkzMjY2LCJuYmYiOjE3MDA3OTMyNjYsImV4cCI6MTcwMTM5ODA2NiwiZGF0YSI6eyJ1aWQiOjUsInBob25lIjoiMTc2ODUxNTE2NDMiLCJhdmF0YXIiOiIvcmVzb3VyY2UvaW1hZ2UvYWRtaW5hcGkvZGVmYXVsdC9kZWZhdWx0X2F2YXRhci5wbmciLCJuaWNrbmFtZSI6Ilx1NzUyOFx1NjIzNzE3Njg1MTUxNjQzIn19.ctEIiBUd6T6zpp9m3x5wdop5vnBcnpS6VOliy4uz9bc" token: res.data.token
token: info.referrerInfo?.extraData?.token
}) })
// let res = await loginShopAccount({
// shop_token: info.referrerInfo?.extraData?.token
// });
this.$store.commit('SET_USERINFO', {
user: {},
token: res.data.token
})
this.$store.dispatch('initConfig');
let {
data
} = await userInfo();
this.$store.commit('setUserInfo', data);
// this.$isResolve()
// uni.$emit('home_initUserInfo', data);
// return;
} catch (e) {
// this.$isResolve()
console.log(e);
}
}
console.log('App Launch')
try {
if (!this.$store.state.app.token) uni.reLaunch({
url: '/pages/oaLogin/oaLogin',
success() {
// #ifdef APP-PLUS
plus.navigator.closeSplashscreen(); //
// #endif
this.$isResolve()
}
})
else {
this.$store.dispatch('initConfig'); this.$store.dispatch('initConfig');
let {
data
} = await userInfo();
this.$store.commit('setUserInfo', data);
this.$isResolve() this.$isResolve()
// #ifdef APP-PLUS // uni.$emit('home_initUserInfo', data);
plus.navigator.closeSplashscreen(); // return ;
// #endif }catch(e){
} this.$isResolve()
} catch (e) { console.log(e);
this.$isResolve() }
// #ifdef APP-PLUS }
uni.reLaunch({ console.log('App Launch')
url: '/pages/oaLogin/oaLogin', this.$store.dispatch('initConfig');
success() { this.$isResolve()
// #ifdef APP-PLUS try {
plus.navigator.closeSplashscreen(); // if (!this.$store.state.app.token) uni.reLaunch({
// #endif url: '/pages/oaLogin/oaLogin'
this.$isResolve()
}
}) })
// #endif } catch (e) {
} uni.reLaunch({
}, url: '/pages/oaLogin/oaLogin'
onShow: function() { })
const audioContext = uni.createInnerAudioContext() }
// },
audioContext.src = '/static/mp3/order.mp3' onShow: function() {
// const audioContext = uni.createInnerAudioContext()
//#ifdef APP-PLUS //
jpushModule.addNotificationListener(res => { audioContext.src = '/static/mp3/order.mp3'
if (res.notificationEventType == 'notificationOpened') return //
audioContext.play() //#ifdef APP-PLUS
uni.vibrateLong(); jpushModule.addNotificationListener(res => {
console.log("app的监听") if (res.notificationEventType == 'notificationOpened') return
}) audioContext.play()
// #endif uni.vibrateLong();
console.log('App Show') console.log("app的监听")
}, })
onHide: function() { // #endif
console.log('App Hide') console.log('App Show')
} },
} onHide: function() {
console.log('App Hide')
}
}
</script> </script>
<style> <style>
/*每个页面公共css */ /*每个页面公共css */
@import "static/css/base.css"; @import "static/css/base.css";
@import "static/css/style.scss"; @import "static/css/style.scss";
view { view {
box-sizing: border-box; box-sizing: border-box;
} }
</style> </style>

View File

@ -1,12 +0,0 @@
import oahttp from "@/utils/oahttp.js";
/**
* 商机列表
*/
export const opportunity = (data) => oahttp.get('/information/list', data)
/**
* 商机详情
*/
export const oppordetails = (data) => oahttp.get('/information/details', data)

View File

@ -1,14 +0,0 @@
import oahttp from "@/utils/aa.js";
/**
* 绑定scoket
*/
export const bindScoket = (data) => oahttp.post('/common/im/doBindUid', data)
// 发送消息
export const sendMsgApi = (data) => oahttp.post('/common/im/sendTextMsg', data)
// 发送文件
export const sendFileApi = (data) => oahttp.post('/common/im/sendFileMsg', data)
// 消息列表
export const getMsgListApi = (data) => oahttp.post('/common/im/msgList', data)
// 片区经理id
export const getAreaManagerApi = (data) => oahttp.post('/common/im/getAreaManager', data)

View File

@ -66,12 +66,3 @@ export const postsms = (data) => oahttp.post('/company/postsms', data)
*/ */
export const sss = (data) => oahttp.post('/company/postsms', data) export const sss = (data) => oahttp.post('/company/postsms', data)
/**
* 查询甲方公司信息
*/
export const getPartyACompany = (data) => oahttp.get('/company/getPartyACompany', data)
/**
* 查询押金凭证记录
*/
export const getDepositRechargeTransferVoucherList = (data) => oahttp.get('/company/getDepositRechargeTransferVoucherList', data)

View File

@ -1,7 +0,0 @@
import oahttp from "@/utils/oahttp.js";
/**
* 发起投诉
*/
export const complaintFeedback = (data) => oahttp.post('/company/complaint_feedback', data)

View File

@ -1,51 +1,45 @@
import { import {
HTTP_REQUEST_URL_THREE, HTTP_REQUEST_URL_THREE,
HEADER, HEADER,
TOKENNAME, TOKENNAME,
} from '@/config/app'; } from '@/config/app';
import { import { Toast } from '../libs/uniApi';
Toast
} from '../libs/uniApi';
// import { checkLogin } from '../libs/login'; // import { checkLogin } from '../libs/login';
import store from '../store'; import store from '../store';
function toLogin() { function toLogin() {
store.commit("LOGOUT"); store.commit("LOGOUT");
uni.showToast({ uni.showToast({
title: '请登录', title: '请登录',
icon: 'none', icon: 'none',
duration: 1000 duration: 1000
}); });
} }
function upLoad(url, data) { function upLoad(url, data) {
let Url = HTTP_REQUEST_URL_THREE, let Url = HTTP_REQUEST_URL_THREE,
header = {} header = {}
if (store.state.app.token) header[TOKENNAME] = store.state.app.token; if (store.state.app.token) header[TOKENNAME] = store.state.app.token;
return new Promise((reslove, reject) => { return new Promise((reslove, reject) => {
uni.uploadFile({ uni.uploadFile({
url: Url + '/api' + url, url: Url + '/api' + url,
filePath: data.filePath, filePath: data.filePath,
name: data.name, name: data.name,
success: (uploadFileRes) => { success: (uploadFileRes) => {
uploadFileRes.data = JSON.parse(uploadFileRes.data) uploadFileRes.data = JSON.parse(uploadFileRes.data)
if (uploadFileRes.data.code == 1) reslove(uploadFileRes.data) if(uploadFileRes.data.code==1) reslove(uploadFileRes.data)
else Toast('网络错误') else Toast('网络错误')
}, },
fail: (err) => { fail: (err) => {
Toast('网络错误') Toast('网络错误')
} }
}) })
}); });
} }
export const upLoadImage = (data) => { export const upLoadImage = (data)=>{
return upLoad('/upload/image', data) return upLoad('/upload/image', data)
} }
export const VIDEO_URL = HTTP_REQUEST_URL_THREE + '/api/upload/video' export const VIDEO_URL = HTTP_REQUEST_URL_THREE + '/api/upload/video'
export const FILE_URL = HTTP_REQUEST_URL_THREE + '/api/upload/file' export const FILE_URL = HTTP_REQUEST_URL_THREE + '/api/upload/file'
export const IMG_URL = HTTP_REQUEST_URL_THREE + '/api/upload/image'
// im文件上传
// export const VIDEO_URL_IM = HTTP_REQUEST_URL_THREE + '/api/upload/video'
export const FILE_URL_IM = HTTP_REQUEST_URL_THREE + '/common/im/sendFileMsg'

View File

@ -1,28 +0,0 @@
// let Token = localStorage.getItem("token")
let Token = uni.getStorageSync("token")
let request = (METHOD, URL, DATA) => {
return new Promise((reslove, reject) => {
uni.request({
url: 'https://ceshi-im.lihaink.cn/' + URL,
method: METHOD,
data: {
...DATA
},
header: {
'content-type': 'application/json',
"Authorization": Token || ""
},
success: function(res) {
reslove(res)
},
fail: function(err) {
reject(err)
},
});
})
}
export default request;

View File

@ -40,8 +40,3 @@ export const categoryBusinessList = (data) => oahttp.get('/CategoryBusiness/list
* 字典列表 * 字典列表
*/ */
export const dictDataLists = (data) => oahttp.get('/common/dict_data_lists', data) export const dictDataLists = (data) => oahttp.get('/common/dict_data_lists', data)
/**
* 字典列表: 按数据值取
*/
export const dictDataListsTypeValue = (data) => oahttp.get('/common/dict_data_lists_by_type_value', data)

View File

@ -69,8 +69,3 @@ export const destroyAccount = (data) => oahttp.post('/user/destroy_account', dat
* 商城登录 * 商城登录
*/ */
export const loginShopAccount = (data) => oahttp.post('/login/shop_account', data, { noAuth: true }) export const loginShopAccount = (data) => oahttp.post('/login/shop_account', data, { noAuth: true })
/**
* 中台登录
*/
export const loginParseToken = (data) => oahttp.post('/login/parseToken', data, { noAuth: true })

View File

@ -4,10 +4,7 @@ import oahttp from "@/utils/oahttp.js";
* 充值 * 充值
*/ */
export const recharge = (data) => oahttp.post('/recharge/recharge', data) export const recharge = (data) => oahttp.post('/recharge/recharge', data)
/**
* 押金充值记录
*/
export const deposit_recharge = (data) => oahttp.get('/recharge/deposit_lists', data)
/** /**
* 支付方式 * 支付方式
*/ */

View File

@ -1,5 +1,5 @@
import oahttp from "@/utils/oahttp.js"; import oahttp from "@/utils/oahttp.js";
import oahttp2 from "@/utils/logistics.js";
// http://logistics.lihaink.cn/api/getCarHistory // http://logistics.lihaink.cn/api/getCarHistory
/** /**
* 车辆列表 * 车辆列表
@ -14,10 +14,6 @@ export const upVehicleApi = (data) => oahttp.post('/vehicle/rentApply', data)
export const applycarApi = (data) => oahttp.post('/vehicle/rentApply', data) export const applycarApi = (data) => oahttp.post('/vehicle/rentApply', data)
// 显示轨迹 // 显示轨迹
export const locusApi = (data) => oahttp.post('/vehicle/vehicleTrack', data) export const locusApi = (data) => oahttp.post('/vehicle/vehicleTrack', data)
// 获取可购买车辆列表
export const canBuyCarListApi = (data) => oahttp.get('/vehicle/getFreeCars', data)
// 购买车辆
export const buyCarApi = (data) => oahttp.post('/vehicle/buyCars', data)
// 当前车辆位置信息 // 当前车辆位置信息
// export const locusApi = (data) => oahttp.post('/vehicle/vehicleTrack', data) // export const locusApi = (data) => oahttp.post('/vehicle/vehicleTrack', data)
// api / getCarLocal // api / getCarLocal

View File

@ -5,6 +5,7 @@ import oahttp from "@/utils/oahttp.js";
*/ */
export const companyAccountLog = (data) => oahttp.get('/company_account_log/lists', data) export const companyAccountLog = (data) => oahttp.get('/company_account_log/lists', data)
/** /**
* 股金详情 * 股金详情
*/ */
@ -14,8 +15,3 @@ export const companyShareholderInfo = (data) => oahttp.get('/company/shareholder
* 发起合同 * 发起合同
*/ */
export const initiateShareholderContract = (data) => oahttp.post('/company/initiate_shareholder_contract', data) export const initiateShareholderContract = (data) => oahttp.post('/company/initiate_shareholder_contract', data)
/**
* 上交股金
*/
export const companyPayShareCapital = (data) => oahttp.post('/company/pay_share_capital', data)

View File

@ -39,77 +39,5 @@ export const taskOtherTaskDetail = (data) => oahttp.get('/task/other_task_detail
/** /**
* 任务:提交其他任务 * 任务:提交其他任务
*/ */
export const taskOtherTaskCommit = (data) => oahttp.post('/task/commit_other_task', data) export const taskOtherTaskCommit = (data) => oahttp.post('/task/cimmit_other_task', data)
/**
* 任务:服务任务详情
*/
export const townTaskDetails = (data) => oahttp.get('/task/service_task_detail', data)
/**
* 任务:提交督促小组服务团队学习任务
*/
export const serviceTask4Commit = (data) => oahttp.post('/task/commit_town_task_type4', data)
/**
* 任务:数字农贸宣传加工业务建设和招商任务详情
*/
export const marketTask10Detail = (data) => oahttp.get('/task/town_task_type_marketing_director_10_detail', data)
/**
* 任务:数字农贸宣传加工业务建设和招商任务提交
*/
export const marketTask10Commit = (data) => oahttp.post('/task/commit_town_task_type_marketing_director_10', data)
/**
* 任务:提交村公司任务-信息平台铺设任务接口
*/
export const villageTask6Commit = (data) => oahttp.post('/task/commit_village_task_type_6', data)
/**
* 任务:提交村镇公司收集任务列表
*/
export const townMasterTask3List = (data) => oahttp.get('/task/service_task_detail', data)
/**
* 任务:提交村镇公司收集任务提交
*/
export const townMasterTask3Commit = (data) => oahttp.post('/task/commit_town_master_task_type_3', data)
/**
* 入股任务提交
*/
export const commit_service_group_taskAPI = (data) => oahttp.post('/task/commit_service_group_task', data)
/**
* 督促小组公司入股
*/
export const commit_village_task_4API = (data) => oahttp.post('/task/commit_village_task_4', data)
/**
* 入股甲方公司
*/
export const commit_village_task_5API = (data) => oahttp.post('/task/commit_village_task_5', data)
/**
* 入股甲方公司
*/
export const commit_town_service_manager_task_6API = (data) => oahttp.post('/task/commit_town_service_manager_task_6',
data)
/**
* 促成村联络人员入股
*/
export const commit_town_master_task_6API = (data) => oahttp.post('/task/commit_town_master_task_6',
data)
/**
* 应用软件推广
*/
export const commit_town_master_task_type_2API = (data) => oahttp.post('/task/commit_town_master_task_type_2',
data)
/**
* 应用软件推广
*/
export const commit_town_master_task_type_7API = (data) => oahttp.post('/task/commit_town_master_task_type_7',
data)
/**
* 应用软件推广
*/
export const commit_town_master_task_type_8API = (data) => oahttp.post('/task/commit_town_master_task_type_8',
data)

View File

@ -1,696 +0,0 @@
<template>
<view style="background-color: #F6F7FD;">
<!-- <view class="storeName" style="padding-top:var(--status-bar-height) ;">
<u--image src="/static/right.png" width="50rpx" height="50rpx" @click='backFn'></u--image>
<view class="" @click="timeFn">
{{timeFn()}}
</view>
<view class="">
</view>
</view> -->
<!-- 消息 -->
<view class="content" @click="showPlus=false" id="content">
<view class="">
<u-loadmore :status="status" />
</view>
<!-- -->
<view class="task-li" v-for="item,index in list" :key="index">
<!-- 对方消息 -->
<view v-if="formId==item.fromUser.id">
<view class="task-li-r">
<view class="" style="margin-right: 10rpx;">
<u--image :showLoading="true" :src="a" shape="circle" width="40px" height="40px"></u--image>
</view>
<view @longpress="copyText(item.content)" class="task-li-content" v-if="item.type=='text'"
style="margin-right: 10rpx;">
{{item.content}}
</view>
<!-- 图片 -->
<view class="task-li-content" v-if="item.type=='image'" style="margin-right: 10rpx;"
@tap="showOverLayFn(item.content,item.type)">
<image :src="item.content" style="width:200rpx" mode="widthFix"></image>
</view>
<!-- 视频 -->
<view class="task-li-content" v-if="item.type=='video'"
style="margin-right: 10rpx;position: relative;"
@tap="showOverLayFn(item.content,item.type)">
<u--image :showLoading="true" :src="a" width="100px" height="80px"></u--image>
<view class="yl-text">
点击预览
</view>
<!-- <video :src="item.content" @loadedmetadata="onVideoLoaded" controls id="vi1"
style="width: 400rpx; height: 100px;"></video> -->
<!-- <image src="item.content" style="width:200rpx" mode="widthFix"></image> -->
<!-- <canvas canvas-id="videoCanvas1" style="width: 100px; height: 100px;"></canvas> -->
</view>
</view>
<view class="send-time">
{{item.sendTime}}
</view>
</view>
<!-- 我的消息 -->
<view class="task-li-l" v-if="true">
<!-- 文字 -->
<view class="task-li-content" @longpress="copyText(item.content)" v-if="item.type=='text'"
style="margin-right: 10rpx;">
{{item.content}}
</view>
<!-- 图片 -->
<view class="task-li-content" v-if="item.type=='image'" style="margin-right: 10rpx;"
@tap="showOverLayFn(item.content,item.type)">
<image :src="item.content" style="width:200rpx" mode="widthFix"></image>
</view>
<!-- 视频 -->
<view class="task-li-content" v-if="item.type=='video'"
style="margin-right: 10rpx;position: relative;" @tap="showOverLayFn(item.content,item.type)">
<u--image :showLoading="true" src="/static/YL1.png" width="100px" height="80px"></u--image>
<view class="yl-text">
点击预览
</view>
</view>
<view class="">
<u--image :showLoading="true" :src="a" shape="circle" width="40px" height="40px"></u--image>
</view>
</view>
</view>
<!-- 本地 -->
<view v-if="local">
<view class="localTask" v-if="localType=='video'">
<view class="task-li-content" style="margin-right: 10rpx;">
<video :src="local" controls id="vi1" style="width: 400rpx; height: 100px;"></video>
<u-line-progress :percentage="progress" activeColor="#19BE6B"></u-line-progress>
<!-- <canvas canvas-id="videoCanvas1" style="width: 100px; height: 100px;"></canvas> -->
</view>
<view class="" style="margin-right: 10rpx;">
<u--image :showLoading="true" shape="circle" :src="a" width="40px" height="40px"></u--image>
</view>
</view>
<view class="localTask" v-if="localType=='image'">
<view class="task-li-content" style="margin-right: 10rpx;">
<!-- <image :src="local" controls id="vi1" style="width: 400rpx; height: 100px;"></image> -->
<image :src="local" style="width:200rpx" mode="widthFix"></image>
<u-line-progress :percentage="progress" activeColor="#19BE6B"></u-line-progress>
</view>
<view class="" style="margin-right: 10rpx;">
<u--image :showLoading="true" shape="circle" :src="a" width="40px" height="40px"></u--image>
</view>
</view>
</view>
<view style="height: 50px;background-color: #F6F7FD;">
</view>
</view>
<!-- 底部 -->
<view class="bottom">
<!-- -->
<view class="send-col">
<input type="text" class="send-ipt" @click="scrollFn(300)" v-model="value" placeholder="请输入聊天内容"
placeholder-style="color:#DDD;" :cursor-spacing="6">
<u--image :showLoading="true" src="/static/img/bussness/Plus.png" width="32px" height="32px"
@click="showPlusFn"></u--image>
<button class="send" @tap="sendFn">发送</button>
</view>
<!-- 发送照片 -->
<view class="plus" v-if="showPlus">
<view class="plus_li">
<u--image :showLoading="true" src="/static/img/bussness/XC.png" width="120rpx" height="120rpx"
@click="choseImgFn"></u--image>
<text>图片</text>
</view>
<view class="plus_li">
<u--image :showLoading="true" src="/static/img/bussness/SP.png" width="120rpx" height="120rpx"
@click="choseVideoFn"></u--image>
<text>视频</text>
</view>
<!-- asdas -->
</view>
</view>
<!-- 遮罩图 -->
<u-overlay :show="show" @click="show = false">
<view class="warp">
<view class="rect" @tap.stop @longpress="saveImage(overLaySrc)" v-if="overLayType=='image'">
<image :showLoading="true" style="width: 80vw;" mode="widthFix" :src="overLaySrc"></image>
</view>
<view class="rect" @tap.stop v-if="overLayType=='video'">
<video :src="overLaySrc"></video>
</view>
</view>
</u-overlay>
</view>
</template>
<script>
// import request from "@/api/index.js"
import {
bindScoket,
sendMsgApi
} from "@/api/bussness.js"
export default {
data() {
return {
a: "https://img1.baidu.com/it/u=716638254,3920932970&fm=253&app=138&size=w931&n=0&f=JPEG&fmt=auto?sec=1695920400&t=aeec3d0e86c23759d5f82b3757e9b442",
list: [],
value: "",
showPlus: false,
num: 0,
flags: true,
scollNum: 999999999999,
client_id: "",
formId: "",
name: "",
status: "lodemore",
page: 1,
limit: 10,
formUser: "",
show: false,
overLaySrc: "",
overLayType: "",
canvasContext: null,
timer: "",
local: "",
localType: "",
progress: "",
showNotice: false
}
},
methods: {
timeFn(time) {
// 1695722299000
const currentDate = new Date(); //
const targetDate = new Date(1695722299000);
if (this.isSameDay(currentDate, targetDate)) {
const hours = targetDate.getHours(); //
const minutes = targetDate.getMinutes(); //
return hours + ':' + minutes;
} else if (this.isYesterday(currentDate, targetDate)) {
return '昨天';
}
const month = targetDate.getMonth() + 1; // 01
const day = targetDate.getDate(); //
return month + '月' + day + '日';
},
isSameDay(date1, date2) {
return (
date1.getFullYear() === date2.getFullYear() &&
date1.getMonth() === date2.getMonth() &&
date1.getDate() === date2.getDate()
);
},
isYesterday(currentDate, targetDate) {
const yesterday = new Date(currentDate.getFullYear(), currentDate.getMonth(), currentDate.getDate() - 1);
return this.isSameDay(yesterday, targetDate);
},
saveImage(src) {
uni.saveImageToPhotosAlbum({
filePath: src,
success() {
uni.showToast({
title: '保存成功',
icon: 'none'
});
},
fail() {
uni.showToast({
title: '保存失败',
icon: 'none'
});
}
});
},
copyText(value) {
const text = value;
uni.setClipboardData({
data: text,
success() {
uni.showToast({
title: '复制成功',
icon: 'none'
});
}
});
},
backFn() {
uni.navigateBack()
},
showOverLayFn(src, type) {
this.show = true
this.overLaySrc = src
this.overLayType = type
},
getListFn() {
request("POST", "enterprise/im/getMessageList", {
limit: this.limit,
page: this.page,
toContactId: this.formId,
}).then(res => {
if (res.data.data.length == 0) {
this.status = "nomore"
return
}
this.list.unshift(...res.data.data)
this.status = "loadmore"
}).catch(err => {
console.log(err, "获取消息列表失败")
})
},
scrollFn(time) {
this.scollNum += 500
setTimeout(() => {
uni.pageScrollTo({
scrollTop: this.scollNum,
});
}, time ? time : 100)
},
generateRandId() {
var d = new Date().getTime();
var uuid = "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function(c) {
var r = (d + Math.random() * 16) % 16 | 0;
d = Math.floor(d / 16);
return (c == "x" ? r : r & 0x3 | 0x8).toString(16);
});
return uuid;
},
sendFn() {
if (!this.value) return
this.num++
this.flags = !this.flags
request("POST", "enterprise/im/sendMessage", {
content: this.value,
extends: null,
fileName: "",
fileSize: 0,
file_cate: 0,
file_id: 0,
fromUser: {
...this.fromUser
},
from_user: this.fromUser.id,
id: this.generateRandId(),
is_group: 0,
is_read: 0,
sendTime: Date.now(),
status: "going",
toContactId: this.formId,
type: "text",
}).then(res => {
console.log("发送消息成功")
// this.list.push(res.data.data)
}).catch(err => {
console.log(err, "发送消息失败")
})
this.value = ""
this.scrollFn(100)
},
login() {
return
// request("POST", "common/Pub/login", {
// account: 13800000006,
// password: "123456",
// rememberMe: false,
// }).then(res => {
// uni.setStorageSync("token", (res.data.data.authToken))
// uni.setStorageSync("userinfo", JSON.stringify(res.data.data.userInfo))
// })
},
showPlusFn() {
this.showPlus = !this.showPlus
this.scrollFn(200)
},
choseImgFn() {
this.login()
let time = Date.now()
let that = this
// https://im.raingad.com/common/upload/uploadFile
uni.chooseImage({
count: 1, //
success: res => {
const tempFilePath = res.tempFilePaths[0];
const file = res.tempFiles[0]
console.log(file)
that.local = tempFilePath
that.localType = 'image'
that.showPlus = false
that.scrollFn(200)
const uploadTask = uni.uploadFile({
url: "https://ceshi-im.lihaink.cn/common/upload/uploadFile",
filePath: tempFilePath, //
name: 'file',
header: {
"Authorization": uni.getStorageSync("token")
},
formData: {
message: JSON.stringify({
"id": this.generateRandId(),
"sendTime": Date.now(),
"status": "going",
"type": "image",
// "content": "blob:https://im.raingad.com/e2ffd725-a9e7-4a01-b7da-83fd64af97a4",
"content": `blob:${tempFilePath}`,
"is_read": 0,
"is_group": 0,
"file_id": 0,
"file_cate": 0,
"fileName": file.name,
"fileSize": file.size,
"extends": null,
"fromUser": {
...this.fromUser
},
from_user: this.fromUser.id,
toContactId: this.formId,
})
}, //
success: function(uploadRes) {
that.local = ""
that.list.push(JSON.parse(uploadRes.data).data)
//
},
fail: function(error) {
console.log('上传失败', error);
//
}
});
uploadTask.onProgressUpdate((res) => {
this.progress = res.progress
console.log('上传进度', res.progress);
});
},
fail: err => {
console.log(err, "没有选择图片");
}
});
},
choseVideoFn() {
let that = this
uni.chooseVideo({
sourceType: ['album', 'camera'], //
maxDuration: 600, //
camera: 'back', //
success: res => {
const tempFilePath = res.tempFilePath;
that.local = res.tempFilePath
that.localType = 'video'
that.showPlus = false
that.scrollFn(200)
const uploadTask = uni.uploadFile({
url: "https://ceshi-im.lihaink.cn/common/upload/uploadFile",
filePath: tempFilePath, //
name: 'file',
header: {
"Authorization": uni.getStorageSync("token")
},
formData: {
message: JSON.stringify({
"id": this.generateRandId(),
"sendTime": Date.now(),
"status": "going",
"type": "image",
// "content": "blob:https://im.raingad.com/e2ffd725-a9e7-4a01-b7da-83fd64af97a4",
"content": `blob:${tempFilePath}`,
"is_read": 0,
"is_group": 0,
"file_id": 0,
"file_cate": 0,
"fileName": "20210719150601_4401e.jpg",
"fileSize": 72046,
"extends": null,
"fromUser": {
...this.fromUser
},
from_user: this.fromUser.id,
toContactId: this.formId,
})
}, //
success: function(uploadRes) {
that.local = ""
that.list.push(JSON.parse(uploadRes.data).data)
//
},
fail: function(error) {
uni.showToast({
title: '视频不能超过60s',
duration: 2000,
icon: 'none'
});
that.local = false
}
});
uploadTask.onProgressUpdate((res) => {
this.progress = res.progress
console.log('上传进度', res.progress);
});
},
fail: err => {
uni.showToast({
title: '视频不能超过60s',
duration: 2000,
icon: 'none'
});
}
});
},
},
onShow() {
return
let that = this
this.scrollFn(500)
this.timer = setInterval(() => {
request("POST", "enterprise/im/getMessageList", {
limit: 1,
page: 1,
toContactId: this.formId,
}).then(res => {
if (res.data.data[0]?.id != this.list[this.list.length - 1]?.id) {
this.list.push(res.data.data[0])
if (res.data.data[0].type == 'video' || res.data.data[0].type == 'image') {
this.local = ""
}
// console.log(res.data.data)
}
// this.list.unshift(...res.data.data)
// this.status = "loadmore"
})
}, 3000)
},
async onPullDownRefresh() {
this.status = "loading"
this.page++
await this.getListFn()
// console.log("")
uni.stopPullDownRefresh();
},
created() {
let obj = {
"user_id": 2,
"account": "13800000002",
"realname": "熊大",
"avatar": "https://ceshi-im.lihaink.cn/avatar/熊大/120/2",
"email": "xiongda@kaishanlaw.com",
"sex": 2,
"role": 0,
"motto": null,
"remark": "",
"name_py": "xiongda",
"setting": null,
"is_auth": 0,
"last_login_time": 1695720745,
"last_login_ip": "221.182.82.214",
"delete_time": 0,
"status": 1,
"qrUrl": "https://ceshi-im.lihaink.cn/scan/u/oVQ5OmjEa7zD",
"displayName": "熊大",
"id": 2
}
this.fromUser = obj
console.log(this.fromUser)
return
this.getListFn()
},
onUnload() {
clearInterval(this.timer)
},
}
</script>
<style lang="scss">
.yl-text {
position: absolute;
color: black;
top: 60%;
left: 50%;
transform: translateX(-50%);
font-size: 24rpx;
}
// .storeName {
// position: fixed;
// text-align: center;
// background-color: white;
// font-weight: bold;
// height: 80rpx;
// width: 100vw;
// z-index: 9;
// display: flex;
// align-items: center;
// justify-content: space-between;
// }
.topflag {
height: 80rpx;
background-color: #F6F7FD;
}
.content {
padding: 0 20rpx;
min-height: 100vh;
// height: 89vh;
background-color: #F6F7FD;
overflow: auto;
padding-top: 10rpx;
// padding-bottom: 50px;
.task-li {
margin-bottom: 20rpx;
}
.task-li-l {
display: flex;
justify-content: flex-end;
}
.task-li-r {
display: flex;
}
.task-li-content {
background-color: white;
padding: 20rpx;
border-radius: 20rpx;
color: white;
word-break: break-all;
max-width: 60vw;
}
}
.bottom {
background-color: white;
// height: 8vh;
// padding: 20rpx;
padding: 20rpx 0;
position: fixed;
box-sizing: border-box;
// bottom: 400px;
padding-bottom: 500px;
/* #ifdef APP-PLUS */
bottom: 0px;
padding-bottom: 10px;
/* #endif */
.send-col {
display: flex;
align-items: center;
justify-content: space-around;
.send-ipt {
width: 70vw;
background-color: #F5F5F5;
height: 60rpx;
border-radius: 20rpx;
padding-left: 20rpx;
}
}
.send {
background-color: #2573fb;
color: #fff;
height: 64rpx;
margin-left: 20rpx;
border-radius: 6rpx;
padding: 0;
width: 120rpx;
line-height: 62rpx;
&:active {
background-color: #1573fb;
}
}
.plus {
display: flex;
background-color: white;
padding: 20rpx;
.plus_li {
display: flex;
flex-direction: column;
align-items: center;
margin-right: 20rpx;
flex-wrap: wrap;
}
}
}
.warp {
display: flex;
align-items: center;
justify-content: center;
height: 100%;
}
.rect {}
.localTask {
display: flex;
justify-content: flex-end;
}
</style>

View File

@ -318,7 +318,7 @@
</view> </view>
</template> </template>
<script> <script>
@ -427,6 +427,7 @@
brigade.forEach((item) => { brigade.forEach((item) => {
this.brigade += item.brigade_name ?? '' this.brigade += item.brigade_name ?? ''
}) })
uni.$emit('companyInfo', this.company); //
this.user = res.data.user; this.user = res.data.user;
this.contract = res.data.contract; this.contract = res.data.contract;
this.skeleton = false; this.skeleton = false;

View File

@ -1,13 +1,13 @@
<template> <template>
<view class="c_card"> <view class="c_card">
<view class="f_card"> <view class="f_card">
<view class="item" @click="navTo('/subpkg/topUp/deposit')"> <view class="item" @click="navTo('/subpkg/topUp/topUp')">
<view>押金()</view> <view>押金()</view>
<view class="price" v-if="company.deposit">{{cCount(+company.deposit)}}</view> <view class="price" v-if="company.deposit">{{cCount(+company.deposit)}}</view>
<view class="price" v-else>0.00</view> <view class="price" v-else>0.00</view>
</view> </view>
<view class="item" @click="navTo('/subpkg/withdrawDeposit/company')"> <view class="item" @click="navTo('/subpkg/withdrawDeposit/company')">
<view>公司预计收益总金额()</view> <view>公司收益总金额()</view>
<view class="price" v-if="company.company_money">{{cCount(+company.company_money)}}</view> <view class="price" v-if="company.company_money">{{cCount(+company.company_money)}}</view>
<view class="price" v-else>0.00</view> <view class="price" v-else>0.00</view>
</view> </view>
@ -28,7 +28,9 @@
</view> </view>
</view> </view>
<view class="f_list"> <view class="f_list">
<view class="item" v-for="(item, index) in list" :key="index"> <view class="item" v-for="(item, index) in list" :key="index">
<view class="top"> <view class="top">
账单日期: {{current?item.month:item.create_time}} 账单日期: {{current?item.month:item.create_time}}
</view> </view>
@ -45,10 +47,9 @@
<view class="t_item"> <view class="t_item">
<view class="t_title">收益来源</view> <view class="t_title">收益来源</view>
<view class="tips"> <view class="tips">
<text v-if="item.change_type==202" style="color: #46be61;">{{item.type_desc}}</text> <text v-if="item.change_type==202" style="color: #46be61;">{{item.type_desc}}</text>
<text v-else-if="item.change_type==203" <text v-else-if="item.change_type==203" style="color: #ff7c32;">{{item.type_desc}}</text>
style="color: #ff7c32;">{{item.type_desc}}</text> <text v-else="item.change_type==203">{{item.type_desc}}</text>
<text v-else="item.change_type==203">{{item.type_desc}}</text>
</view> </view>
</view> </view>
</view> </view>
@ -60,6 +61,10 @@
</view> </view>
</view> </view>
</view> </view>
<u-loadmore :status="loadConfig.status" :loading-text="loadConfig.loadingText" <u-loadmore :status="loadConfig.status" :loading-text="loadConfig.loadingText"
:loadmore-text="loadConfig.loadmoreText" :nomore-text="loadConfig.nomoreText" /> :loadmore-text="loadConfig.loadmoreText" :nomore-text="loadConfig.nomoreText" />
</view> </view>
@ -69,8 +74,7 @@
<script> <script>
import { import {
accountMonthList, accountMonthList,
accountDateList, accountDateList
companyView
} from "@/api/company.js" } from "@/api/company.js"
import { import {
Toast Toast
@ -97,30 +101,26 @@
}; };
}, },
mounted() { mounted() {
this.loadCompany(); uni.$on('companyInfo', (e) => {
this.initLoad(); this.company = e;
this.initLoad();
})
}, },
methods: { methods: {
async loadCompany() {
let res = await companyView();
this.company = res.data.company;
},
navTo(url) { navTo(url) {
if (url) { if(url){
uni.showLoading({ uni.showLoading({
title: '加载中', title: '加载中',
mask: true mask: true
}); });
uni.navigateTo({ uni.navigateTo({
url: url, url: url,
success: (res) => { success:(res)=> {
uni.hideLoading(); uni.hideLoading();
res.eventChannel.emit('company_money', { res.eventChannel.emit('company_money', { company_money: this.company.company_money })
company_money: this.company.company_money }
}) })
} }else Toast('暂未开放')
})
} else Toast('暂未开放')
}, },
initLoad() { initLoad() {
this.loadConfig.page = 1; this.loadConfig.page = 1;
@ -254,7 +254,7 @@
&:before { &:before {
display: inline-block; display: inline-block;
content: '预计收益'; content: '账户收益';
width: 137rpx; width: 137rpx;
height: 49rpx; height: 49rpx;
line-height: 49rpx; line-height: 49rpx;

View File

@ -17,7 +17,7 @@
placeholder="请选择村"></u--input> placeholder="请选择村"></u--input>
<u-icon slot="right" name="arrow-right"></u-icon> <u-icon slot="right" name="arrow-right"></u-icon>
</u-form-item> </u-form-item>
<u-form-item v-if="$store.state.app.userInfo.company.company_type==18" label="小队" :required="!readonly" prop="brigade" @click="changeCity('brigade')" borderBottom> <u-form-item label="小队" :required="!readonly" prop="brigade" @click="changeCity('brigade')" borderBottom>
<u--input :value="formDataText.brigade" style="pointer-events: none;" disabled disabledColor="#fff" placeholder="请选择小队"></u--input> <u--input :value="formDataText.brigade" style="pointer-events: none;" disabled disabledColor="#fff" placeholder="请选择小队"></u--input>
<u-icon slot="right" name="arrow-right"></u-icon> <u-icon slot="right" name="arrow-right"></u-icon>
</u-form-item> </u-form-item>

View File

@ -7,7 +7,7 @@
<u-icon name="arrow-right" color="black" size="20"></u-icon> <u-icon name="arrow-right" color="black" size="20"></u-icon>
</view> </view>
</view> </view>
<view class="content" @click.stop="goDetil(goodsInfo.id)"> <view class="content" @click="callFn(goodsInfo.shop_phone)">
<view v-if="goodsInfo.status==0"> <view v-if="goodsInfo.status==0">
<view class="address">店主姓名:&nbsp;&nbsp;{{goodsInfo.shop_user}}</view> <view class="address">店主姓名:&nbsp;&nbsp;{{goodsInfo.shop_user}}</view>
<view @click.stop="callFn(goodsInfo.shop_phone)" class="address"> <view @click.stop="callFn(goodsInfo.shop_phone)" class="address">

View File

@ -37,6 +37,8 @@
<view @click.stop="callFn(goodsInfo.shop_phone)"> <view @click.stop="callFn(goodsInfo.shop_phone)">
<u-icon style="display: inline-block;margin-left: 5rpx;" name="phone" <u-icon style="display: inline-block;margin-left: 5rpx;" name="phone"
color="#0122c7" size="22"></u-icon> color="#0122c7" size="22"></u-icon>
<text class="phone_num"> {{goodsInfo.shop_phone}}</text> <text class="phone_num"> {{goodsInfo.shop_phone}}</text>
</view> </view>
</view> </view>
@ -64,13 +66,11 @@
</view> </view>
<view class="pro_list"> <view class="pro_list">
<text style="color: #999;width: 15vw;"> <text style="color: #999;width: 15vw;">
商品信息: 商品信息
</text> </text>
<view> <view>
<view class="goods_tit" v-for="(item,index) in goodsInfo.products" :key="index"> <view class="goods_tit" v-for="(item,index) in goodsInfo.products">
<u--image style="flex: 2;margin-right: 20rpx;" radius='10' :showLoading="true" <text class="goods_detil">{{item.goods_name}}</text>
:src="item.goods_pic" width="100rpx" height="100rpx"></u--image>
<text style="width: 70vw;margin: 0;padding: 0;">{{item.goods_name}}</text>
<text>X{{item.product_num}}{{item.goods_unit}}</text> <text>X{{item.product_num}}{{item.goods_unit}}</text>
</view> </view>
</view> </view>
@ -120,32 +120,31 @@
</view> </view>
<view class="hr"> <view class="hr">
</view> </view>
<view class="list">
<text>
联系电话
</text>
<view @click.stop="callFn(goodsInfo.receiver_phone)">
<u-icon style="display: inline-block;margin-left: 5rpx;" name="phone"
color="#FF7C32" size="22"></u-icon> {{goodsInfo.receiver_phone}}
</view>
</view>
<view class="pro_list"> <view class="pro_list">
<text style="color: #999;width: 15vw;"> <text style="color: #999;width: 15vw;">
商品信息 商品信息
</text> </text>
<view> <view>
<view class="goods_tit" v-for="(item,index) in goodsInfo.products" :key="index"> <view class="goods_tit" v-for="(item,index) in goodsInfo.products">
<u--image style="flex: 2;margin-right: 20rpx;" radius='10' :showLoading="true" <text class="goods_detil">{{item.goods_name}}</text>
:src="item.goods_pic" width="100rpx" height="100rpx"></u--image>
<text style="width: 70vw;margin: 0;padding: 0;">{{item.goods_name}}</text>
<text>X{{item.product_num}}{{item.goods_unit}}</text> <text>X{{item.product_num}}{{item.goods_unit}}</text>
</view> </view>
</view> </view>
</view> </view>
</view> </view>
<view class="list">
<text>
联系电话
</text>
<view @click.stop="callFn(goodsInfo.receiver_phone)">
<u-icon style="display: inline-block;margin-left: 5rpx;" name="phone" color="#FF7C32"
size="22"></u-icon> {{goodsInfo.receiver_phone}}
</view>
</view>
<view class="total"> <view class="total">
共计{{goodsInfo.product_count}}件商品 共计{{goodsInfo.product_count}}件商品
@ -191,6 +190,7 @@
</text> </text>
<view> <view>
{{goodsInfo.qh_time}} {{goodsInfo.qh_time}}
</view> </view>
</view> </view>
<view class="list"> <view class="list">
@ -226,7 +226,10 @@
<u-button type="primary" class="custom-style" style="background-color: #47BE62;border: 0;"> <u-button type="primary" class="custom-style" style="background-color: #47BE62;border: 0;">
<u-icon name="eye-fill" color="white" size="25" style="margin-right: 10rpx;"></u-icon> <u-icon name="eye-fill" color="white" size="25" style="margin-right: 10rpx;"></u-icon>
查看详情</u-button> 查看详情</u-button>
</view> </view>
<!-- 已取消 --> <!-- 已取消 -->
<view class="left" @click="goDetil" v-if='goodsInfo.status==3'> <view class="left" @click="goDetil" v-if='goodsInfo.status==3'>
<view style="margin: 0;padding:0"> <view style="margin: 0;padding:0">
@ -237,6 +240,7 @@
<view @click.stop="callFn(goodsInfo.receiver_phone)"> <view @click.stop="callFn(goodsInfo.receiver_phone)">
<u-icon style="display: inline-block;margin-left: 5rpx;" name="phone" <u-icon style="display: inline-block;margin-left: 5rpx;" name="phone"
color="#47BE62" size="22"></u-icon> {{goodsInfo.receiver_phone}} color="#47BE62" size="22"></u-icon> {{goodsInfo.receiver_phone}}
</view> </view>
</view> </view>
<view class="list"> <view class="list">
@ -249,6 +253,9 @@
</view> </view>
</view> </view>
</view> </view>
<view class="hr"> <view class="hr">
</view> </view>
<view class="pro_list"> <view class="pro_list">
@ -256,7 +263,7 @@
商品信息 商品信息
</text> </text>
<view> <view>
<view class="goods_tit" v-for="(item,index) in goodsInfo.products" :key="index"> <view class="goods_tit" v-for="(item,index) in goodsInfo.products">
<text class="goods_detil">{{item.goods_name}}</text> <text class="goods_detil">{{item.goods_name}}</text>
<text>X{{item.product_num}}{{item.goods_unit}}</text> <text>X{{item.product_num}}{{item.goods_unit}}</text>
</view> </view>
@ -271,8 +278,15 @@
<u-button type="primary" class="custom-style" style="background-color: red;border: 0;"> <u-button type="primary" class="custom-style" style="background-color: red;border: 0;">
<u-icon name="eye-fill" color="white" size="25" style="margin-right: 10rpx;"></u-icon> <u-icon name="eye-fill" color="white" size="25" style="margin-right: 10rpx;"></u-icon>
查看详情</u-button> 查看详情</u-button>
</view> </view>
</view> </view>
</view> </view>
</view> </view>
@ -282,16 +296,7 @@
<u--input placeholder="请输入收件码" type="number" border="surround" v-model="take_code"></u--input> <u--input placeholder="请输入收件码" type="number" border="surround" v-model="take_code"></u--input>
</view> </view>
</u-modal> </u-modal>
<!-- -->
<u-overlay :show="showToast" @click="showToast = false">
<view class="warp">
<view class="rect">
<view class="cont">
{{tit}}
</view>
</view>
</view>
</u-overlay>
</view> </view>
@ -302,15 +307,10 @@
takeGoods, takeGoods,
doneDelivery doneDelivery
} from "@/api/logistics.js" } from "@/api/logistics.js"
import {
Toast
} from "@/libs/uniApi";
export default { export default {
props: ['goodsInfo'], props: ['goodsInfo'],
data() { data() {
return { return {
tit: "",
showToast: false,
is_captain: 0, is_captain: 0,
list: [], list: [],
flag: undefined, flag: undefined,
@ -344,8 +344,6 @@
// //
qrqodeFn() { qrqodeFn() {
let that = this let that = this
uni.scanCode({ uni.scanCode({
onlyFromCamera: true, onlyFromCamera: true,
@ -362,23 +360,12 @@
order_id: this.goodsInfo.order_id, order_id: this.goodsInfo.order_id,
order_sn: sn order_sn: sn
}).then(res => { }).then(res => {
this.tit = "骑手取货完成" this.$emit('showTost')
this.showToast = true
setTimeout(() => {
this.showToast = false
}, 1000)
this.$emit('getlist') this.$emit('getlist')
}).catch(err => {
Toast(err.msg)
// console.log(err, 65656)
}) })
}, },
confirm() { confirm() {
if (!this.take_code) { if (!this.take_code) {
return return
} }
@ -393,12 +380,8 @@
take_code: this.take_code, take_code: this.take_code,
logistics_id: this.goodsInfo.id logistics_id: this.goodsInfo.id
}).then(res => { }).then(res => {
this.tit = "骑手送货完成" console.log(res)
this.showPop = false this.$emit('showTost')
this.showToast = true
setTimeout(() => {
this.showToast = false
}, 1000)
this.$emit('getlist') this.$emit('getlist')
}).catch(err => { }).catch(err => {
console.log(err.msg) console.log(err.msg)
@ -488,11 +471,11 @@
} }
.pro_list { .pro_list {
/* display: flex; display: flex;
text { text {
margin-right: 20rpx; margin-right: 20rpx;
} */ }
} }
.total { .total {
@ -508,8 +491,6 @@
.goods_tit { .goods_tit {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
align-items: center;
margin-top: 20rpx;
.goods_detil { .goods_detil {
width: 55vw; width: 55vw;
@ -538,48 +519,4 @@
margin-right: 30rpx margin-right: 30rpx
} }
} }
.rect {
width: 455.61rpx;
height: 210.28rpx;
background-color: white;
border-radius: 21.03rpx 21.03rpx 21.03rpx 21.03rpx;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
.cont {
color: #0022C7;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
font-size: 35.05rpx;
}
}
.rect {
width: 455.61rpx;
height: 210.28rpx;
background-color: white;
border-radius: 21.03rpx 21.03rpx 21.03rpx 21.03rpx;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
.cont {
color: #0022C7;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
font-size: 35.05rpx;
}
}
.slot-content {
padding-left: 160rpx;
}
</style> </style>

View File

@ -31,16 +31,9 @@
<u--textarea :disabled="readonly" v-model="formData.notes" autoHeight placeholder="请输入备注" border="surround" <u--textarea :disabled="readonly" v-model="formData.notes" autoHeight placeholder="请输入备注" border="surround"
count></u--textarea> count></u--textarea>
</u-form-item> </u-form-item>
<!-- <u-form-item labelWidth="auto" label="养殖类型" required prop="breeding_type" borderBottom> <u-form-item labelWidth="auto" label="养殖类型" required prop="breeding_type" borderBottom>
<u--input :readonly="readonly" v-model="formData.breeding_type" placeholder="请输入养殖类型"></u--input> <u--input :readonly="readonly" v-model="formData.breeding_type" placeholder="请输入养殖类型"></u--input>
</u-form-item> --> </u-form-item>
<picker :range="breedingTypeList" range-key="name" :disabled="readonly" mode="selector" @change="changeBreeding">
<u-form-item labelWidth="auto" label="养殖类型" required prop="planning" borderBottom>
<u--input :value="breedingName" style="pointer-events: none;" placeholder="请选择养殖类型" disabled
disabledColor="#fff"></u--input>
<u-icon slot="right" name="arrow-right"></u-icon>
</u-form-item>
</picker>
<picker mode="date" @change="changeDate" :disabled="readonly" :data-value="'breeding_time'"> <picker mode="date" @change="changeDate" :disabled="readonly" :data-value="'breeding_time'">
<u-form-item labelWidth="auto" label="养殖开始时间" required prop="breeding_time" borderBottom> <u-form-item labelWidth="auto" label="养殖开始时间" required prop="breeding_time" borderBottom>
<u--input :value="formData.breeding_time" style="pointer-events: none;" placeholder="请选择养殖开始时间" disabled disabledColor="#fff"></u--input> <u--input :value="formData.breeding_time" style="pointer-events: none;" placeholder="请选择养殖开始时间" disabled disabledColor="#fff"></u--input>
@ -128,8 +121,13 @@
border="surround" count></u--textarea> border="surround" count></u--textarea>
</u-form-item> </u-form-item>
</u--form> </u--form>
</view> </view>
</view> </view>
</template> </template>
<script> <script>
@ -151,11 +149,6 @@
data() { data() {
return { return {
landPlanList: ['自己养', '出租', '代养', '租更多地扩大养殖'], landPlanList: ['自己养', '出租', '代养', '租更多地扩大养殖'],
breedingTypeList: [
{ id: 1, name: "水产"},
{ id: 2, name: "禽类" },
{ id: 3, name: "大型动物" },
],
formData: { formData: {
// "breeding_training": 1, // // "breeding_training": 1, //
// "breeding_company": 0, // // "breeding_company": 0, //
@ -230,11 +223,6 @@
} }
} }
}, },
computed:{
breedingName(){
return this.breedingTypeList.find((item)=>item.id==this.formData.breeding_type)?.name;
}
},
methods: { methods: {
// //
initRules() { initRules() {
@ -257,10 +245,10 @@
async validate() { async validate() {
return await this.$refs.breedingForm.validate(); return await this.$refs.breedingForm.validate();
}, },
// //
changeBreeding(e) { changeLanPlan(e) {
// let index = e.currentTarget.dataset.index; let index = e.currentTarget.dataset.index;
this.formData.breeding_type = this.breedingTypeList[e.detail.value].id; this.formData.planning = e.detail.value;
}, },
// //
changeDate(e) { changeDate(e) {

View File

@ -1,30 +1,27 @@
<template> <template>
<view class="c_task_item" @click="clickTask"> <view class="c_task_item" @click="clickTask">
<view class="personnel_list"> <view class="personnel_list">
<view class="cards"> <view class="cards">
<view class="cards_head"> <view class="cards_head">
<view style="font-size: 32rpx; display: flex;padding-right: 16rpx;"> <text style="font-size: 32rpx">任务名称: {{ datas.title }}</text>
<view style="flex-shrink: 0;margin-right: 10rpx;">任务名称: </view> <text>点击查看</text>
<view>{{ datas.title }}</view> </view>
</view> <view class="cards_content">
<view style="flex-shrink: 0;">点击查看</view> <view class="right" style="width: 100%">
</view> <view class="" style="display: flex">
<view class="cards_content"> <view>任务状态 :</view>
<view class="right" style="width: 100%"> <view class="text" style="color: #ff7c32">
<view class="" style="display: flex"> <text v-if="datas.status == 3" style="color: #488f00">已完成</text>
<view>任务状态 :</view> <text v-else-if="datas.status == 5" style="color: #ccc">已关闭</text>
<view class="text" style="color: #ff7c32"> <block v-else-if="
<text v-if="datas.status == 3" style="color: #488f00">已完成</text>
<text v-else-if="datas.status == 5" style="color: #ccc">已关闭</text>
<block v-else-if="
datas.type == 31 || datas.type == 31 ||
datas.type == 32 || datas.type == 32 ||
datas.type == 33 || datas.type == 33 ||
datas.type == 34 || datas.type == 34 ||
datas.type == 35 datas.type == 35
"> ">
<block v-if="datas.extend && datas.extend.informationg"> <block v-if="datas.extend && datas.extend.informationg">
{{ {{
(datas.extend.informationg.update (datas.extend.informationg.update
? datas.extend.informationg.update ? datas.extend.informationg.update
: 0) + : 0) +
@ -33,13 +30,13 @@
? datas.extend.informationg.count ? datas.extend.informationg.count
: 0) : 0)
}} }}
</block> </block>
<block v-else-if=" <block v-else-if="
datas.extend && datas.extend &&
datas.extend.transaction && datas.extend.transaction &&
datas.extend.transaction.arr datas.extend.transaction.arr
"> ">
{{ {{
(datas.extend.transaction.arr.transaction_pool (datas.extend.transaction.arr.transaction_pool
? datas.extend.transaction.arr.transaction_pool ? datas.extend.transaction.arr.transaction_pool
: 0) + : 0) +
@ -49,418 +46,346 @@
: 0) + : 0) +
"元" "元"
}} }}
<!-- <text style="color: #488F00;margin-left: 26rpx;">{{(datas.extend.transaction.arr.transaction_pool?datas.extend.transaction.arr.transaction_pool:1)+'元'}}</text> --> <!-- <text style="color: #488F00;margin-left: 26rpx;">{{(datas.extend.transaction.arr.transaction_pool?datas.extend.transaction.arr.transaction_pool:1)+'元'}}</text> -->
</block> </block>
<block v-else-if="datas.extend && datas.extend.update"> <block v-else-if="datas.extend && datas.extend.update">
<text v-if=" <text v-if="
(datas.extend.update.transfer && (datas.extend.update.transfer &&
datas.extend.update.transfer.lnglat[0]) || datas.extend.update.transfer.lnglat[0]) ||
datas.status == 3 datas.status == 3
" style="color: #488f00">抵达终点</text> " style="color: #488f00">抵达终点</text>
<text v-else-if=" <text v-else-if="
datas.extend.update.terminus && datas.extend.update.terminus &&
datas.extend.update.terminus.lnglat[0] datas.extend.update.terminus.lnglat[0]
">抵达中转点</text> ">抵达中转点</text>
<text v-else>进行中</text> <text v-else>进行中</text>
</block> </block>
<block v-else>进行中</block> <block v-else>进行中</block>
</block> </block>
<block v-else-if="townService(datas.type)"> </view>
<block v-if="datas.type == 44"> </view>
{{extend.total-extend.not_done_count||0}}/{{extend.total||0}} <view style="
</block>
<block v-else-if="datas.type == 45">
{{extend.done_count||0}}/{{extend.total||0}}
</block>
<block v-else>进行中</block>
</block>
<block v-else>进行中</block>
</view>
</view>
<view style="
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
align-items: center; align-items: center;
"> ">
<view> <view>
<text>完成时间 :</text> <text>完成时间 :</text>
<text>{{ datas.end_time }}</text> <text>{{ datas.end_time }}</text>
</view> </view>
<text v-if="datas.status == 2 || datas.status == 1" style="background-color: #ff7c32" <text v-if="datas.status == 2 || datas.status == 1" style="background-color: #ff7c32"
class="status">进行中</text> class="status">进行中</text>
<text v-if="datas.status == 3" style="background-color: #488f00" class="status">已完成</text> <text v-if="datas.status == 3" style="background-color: #488f00" class="status">已完成</text>
<text v-if="datas.status == 5" style="background-color: #ccc" class="status">已关闭</text> <text v-if="datas.status == 5" style="background-color: #ccc" class="status">已关闭</text>
</view> </view>
<view class=""> <view class="">
<text>任务金额 :</text> <text>任务金额 :</text>
<text> {{ datas.money + "元" || "0.00" }} </text> <text> {{ datas.money + "元" || "0.00" }} </text>
</view>
</view>
</view>
</view>
</view>
<!-- <view class="top">
<view class="left">
<view>任务名称:</view>
<view class="text">{{datas.title}}</view>
</view>
<view class="right">
<image class="icon" src="../../static/icons/ok_c.png"></image>
</view>
</view>
<view class="bottom">
<image class="b_left" src="../../static/img/task/task.png"></image>
<view class="b_right">
<view class="item">
<view class="left">
<view>任务状态:</view>
<view class="text">
<text v-if="datas.status==2||datas.status==1" style="color: #ff7c32;">
<block v-if="(datas.type==31||datas.type==32||datas.type==33)">
<block v-if="datas.extend&&datas.extend.informationg">
{{(datas.extend.informationg.update?datas.extend.informationg.update:0)+'/'+(datas.extend.informationg.count?datas.extend.informationg.count:0)}}
</block>
<block
v-else-if="datas.extend&&datas.extend.transaction&&datas.extend.transaction.arr">
{{(datas.extend.transaction.arr.total_price?datas.extend.transaction.arr.total_price:0)+'元/'+(datas.extend.transaction.arr.day_money?datas.extend.transaction.arr.day_money:0)+'元'}}
</block>
<block v-else>进行中</block>
</block>
<block v-else>进行中</block>
</text>
<text v-if="datas.status==3" style="color: #46be61;">已完成</text>
<text v-if="datas.status==5">已关闭</text>
</view> </view>
</view> </view>
<view class="right">{{datas.money||'0.00'}}<text class="price"></text></view>
</view>
<view class="item">
<view class="left">
<view>完成时间:</view>
<view class="text">{{datas.end_time}}</view>
</view>
<view class="right">
<view>进入任务<uni-icons type="right" color="#0122c7"></uni-icons></view>
</view>
</view> </view>
</view> </view>
</view> </view>
</view> -->
</view>
</template> </template>
<script> <script>
import { import {
Toast Toast
} from '../../libs/uniApi'; } from '../../libs/uniApi';
import { export default {
dictDataListsTypeValue name: "task",
} from "@/api/oaPbulic.js" props: {
export default { datas: {
name: "task", type: Object,
props: { default: function() {
datas: { return {}
type: Object, }
default: function() { }
return {} },
} data() {
} return {
},
data() {
return {
extend: {}, };
// : ,, },
taskRoleTypeList: ['town_task_type', 'town_task_type_marketing_director', 'town_task_type_master'], created() {
townServiceList: ["town_task_type_1", "town_task_type_2", "town_task_type_3", "town_task_type_4", try {
"town_task_type_5",
"town_task_type_7"
], //
navToTownServiceList: ["town_task_type_1", "town_task_type_2", "town_task_type_3", "town_task_type_5",
"town_task_type_7"
], // /subpkg/townTask/townTask 0
navToTownMarketList: ["town_task_type_marketing_director_1", "town_task_type_marketing_director_2",
"town_task_type_marketing_director_3",
"town_task_type_marketing_director_4",
"town_task_type_marketing_director_5",
"town_task_type_marketing_director_6",
"town_task_type_marketing_director_7",
"town_task_type_marketing_director_8",
"town_task_type_marketing_director_9"
], // /subpkg/townTask/townTask 1
navToVillageList: ["village_task_type_1", "village_task_type_2", "village_task_type_3",
"village_task_type_7",
], // /subpkg/townTask/townTask 1
navToVillageListA: [
"town_task_type_master_4",
"town_task_type_master_5",
// "",
], // /subpkg/townTask/townTask 1 } catch (e) {
navToList: ["village_task_type_4", "village_task_type_5", "town_task_type_6", "town_task_type_master_6", ], //TODO handle the exception
// /subpkg/townTask/villageTask6 }
navToVillageTask6List: ['village_task_type_8', 'town_task_type_master_2', 'town_task_type_master_7', },
'town_task_type_master_8' methods: {
] navTo(url) {
if(this.isTimeInRange()) return Toast('任务正在结算中')
if (url) {
uni.showLoading({
title: '加载中',
mask: true
});
uni.navigateTo({
url: url,
success() {
uni.hideLoading()
}
})
} else Toast('暂未开放')
},
clickTask() {
// console.log('', this.$props.datas);
// if ((this.$props.datas.type != 31) && this.$props.datas.status !== 2 && this.$props.datas.status !== 1) {
// return this.$props.datas.status == 3 ? Toast('!') : Toast('!');
// }
if (this.$props.datas.type == 31) {
// this.navTo('/subpkg/fileTask/fileTask?id=' + JSON.stringify(this.$props.datas?.extend?.informationg?.arr))
if (this.$store.state.app.userInfo.admin_id) this.navTo(
`/subpkg/captain/captain?task_id=${this.$props.datas?.id}`);
else this.navTo(`/subpkg/archives/archives?task_id=${this.$props.datas?.id}`);
} else if (this.$props.datas.type == 32) {
// this.navTo('/subpkg/fileTask/fileTask?id=' + JSON.stringify(this.$props.datas?.extend?.informationg?.arr))
this.navTo(`/subpkg/property/vehicle?task_id=${this.$props.datas?.id}`)
} else if (this.$props.datas.type == 33) {
let is_show = true;
if(uni.$u.timeFormat(Date.now(), 'yyyy-mm-dd')!=this.$props.datas?.end_time) is_show = false;
this.navTo(`/subpkg/blockTransaction/blockTransaction?task_id=${this.$props.datas?.id}&is_show=${is_show}`)
} else if (this.$props.datas.type == 34) {
this.navTo(`/subpkg/otherTask/otherTask?task_id=${this.$props.datas?.id}`)
} else if (this.$props.datas.type == 35) {
this.navTo(`/subpkg/buyShare/buyShare?task_id=${this.$props.datas?.id}`)
} else this.navTo('');
},
isTimeInRange() {
const now = new Date();
const startTime = new Date(now.getTime());
const endTime = new Date(now.getTime());
// 22:55:00
startTime.setHours(22);
startTime.setMinutes(55);
startTime.setSeconds(0);
}; // 23:59:59
}, endTime.setHours(23);
mounted() { endTime.setMinutes(59);
this.$props.datas.extend ? this.extend = this.$props.datas.extend : null; endTime.setSeconds(59);
// //
// this.$store.state.app.userInfo.group_id return now >= startTime && now <= endTime;
}
}, }
}
methods: {
navTo(url) {
if (url) {
uni.showLoading({
title: '加载中',
mask: true
});
uni.navigateTo({
url: url,
success() {
uni.hideLoading()
}
})
} else Toast('暂未开放')
},
clickTask() {
// console.log(this.navToVillageList.includes(this.$props.datas.type_value))
// return
if (this.isTimeInRange()) return Toast('任务正在结算中');
// if ((this.$props.datas.type != 31) && this.$props.datas.status !== 2 && this.$props.datas.status !== 1) {
// return this.$props.datas.status == 3 ? Toast('!') : Toast('!');
// }
if (this.navToTownServiceList.includes(this.$props.datas.task_type_value))
return this.navTo(
`/subpkg/townTask/townTask?task_id=${this.$props.datas?.id}&type_value=${this.taskRoleTypeList[0]}`
);
if (this.navToTownMarketList.includes(this.$props.datas.task_type_value))
return this.navTo(
`/subpkg/townTask/townTask?task_id=${this.$props.datas?.id}&type_value=${this.taskRoleTypeList[1]}`
);
if (this.navToVillageList.includes(this.$props.datas.task_type_value))
return this.navTo(
`/subpkg/townTask/townTask?task_id=${this.$props.datas?.id}&type_value=${this.taskRoleTypeList[1]}`
);
if (this.navToVillageListA.includes(this.$props.datas.task_type_value))
return this.navTo(
`/subpkg/townTask/townTask?task_id=${this.$props.datas?.id}&type_value=${this.taskRoleTypeList[2]}`
);
if (this.navToList.includes(this.$props.datas.task_type_value))
return this.navTo(
`/subpkg/townTask/villageTask4?task_id=${this.$props.datas?.id}&type_value=${this.$props.datas.task_type_value}`
);
if (this.navToVillageTask6List.includes(this.$props.datas.task_type_value))
return this.navTo(
`/subpkg/townTask/villageTask6?task_id=${this.$props.datas?.id}&type_value=${this.$props.datas.task_type_value}`
);
switch (this.$props.datas.task_type_value) {
case "1":
if (this.$store.state.app.userInfo.admin_id) this.navTo(
`/subpkg/captain/captain?task_id=${this.$props.datas?.id}`);
else this.navTo(`/subpkg/archives/archives?task_id=${this.$props.datas?.id}`);
break;
case "2":
this.navTo(`/subpkg/property/vehicle?task_id=${this.$props.datas?.id}`);
break;
case "3":
let is_show = true;
if (uni.$u.timeFormat(Date.now(), 'yyyy-mm-dd') != this.$props.datas?.end_time) is_show = false;
this.navTo(
`/subpkg/blockTransaction/blockTransaction?task_id=${this.$props.datas?.id}&is_show=${is_show}`
);
break;
case "4":
this.navTo(`/subpkg/otherTask/otherTask?task_id=${this.$props.datas?.id}`);
break;
case "5":
this.navTo(`/subpkg/buyShare/buyShare?task_id=${this.$props.datas?.id}`);
break;
case "town_task_type_4":
this.navTo(`/subpkg/townTask/serviceTask4?task_id=${this.$props.datas?.id}`);
break;
case "town_task_type_marketing_director_10":
this.navTo(
`/subpkg/townTask/marketTask10?task_id=${this.$props.datas?.id}&stage=${this.$props.datas?.stage}`
);
break;
// case 67:
// this.navTo(`/subpkg/townTask/villageTask6?task_id=${this.$props.datas?.id}`);
// break;
// case "village_task_type_8":
// this.navTo(`/subpkg/townTask/villageTask6?task_id=${this.$props.datas?.id}`);
// break;
// case "town_task_type_master_2":
// this.navTo(
// `/subpkg/townTask/villageTask6?task_id=${this.$props.datas?.id}&type_value=${this.$props.datas.task_type_value}`
// );
// break;
case "town_task_type_master_3":
this.navTo(`/subpkg/townTask/gatherRecords?task_id=${this.$props.datas?.id}`);
break;
// case "town_task_type_master_7":
// this.navTo(
// `/subpkg/townTask/villageTask6?task_id=${this.$props.datas?.id}&type_value=${this.$props.datas.task_type_value}`
// );
// break;
// case "town_task_type_master_8":
// this.navTo(
// `/subpkg/townTask/villageTask6?task_id=${this.$props.datas?.id}&type_value=${this.$props.datas.task_type_value}`
// );
// break;
default:
this.navTo('');
break;
}
},
//
townService(type) {
return this.townServiceList.includes(type);
},
isTimeInRange() {
const now = new Date();
const startTime = new Date(now.getTime());
const endTime = new Date(now.getTime());
// 22:55:00
startTime.setHours(22);
startTime.setMinutes(55);
startTime.setSeconds(0);
// 23:59:59
endTime.setHours(23);
endTime.setMinutes(59);
endTime.setSeconds(59);
//
return now >= startTime && now <= endTime;
}
}
}
</script> </script>
<style lang="scss"> <style lang="scss">
.c_task_item { .c_task_item {
margin: 0 auto; margin: 0 auto;
// margin-bottom: 28rpx; // margin-bottom: 28rpx;
width: 694rpx; width: 694rpx;
// background: #FFFFFF; // background: #FFFFFF;
border-radius: 14rpx 14rpx 14rpx 14rpx; border-radius: 14rpx 14rpx 14rpx 14rpx;
opacity: 1; opacity: 1;
font-size: 25rpx; font-size: 25rpx;
font-weight: 400; font-weight: 400;
color: #999999; color: #999999;
line-height: 39rpx; line-height: 39rpx;
.text { .text {
font-size: 28rpx; font-size: 28rpx;
font-weight: 400; font-weight: 400;
color: #333333; color: #333333;
line-height: 39rpx; line-height: 39rpx;
margin-left: 18rpx; margin-left: 18rpx;
} }
.top { .top {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
padding: 28rpx; padding: 28rpx;
border-bottom: 1rpx solid #f5f5f5ff; border-bottom: 1rpx solid #f5f5f5ff;
.left { .left {
display: flex; display: flex;
justify-content: left; justify-content: left;
align-items: center; align-items: center;
} }
.right { .right {
.icon { .icon {
width: 43rpx; width: 43rpx;
height: 43rpx; height: 43rpx;
} }
} }
} }
.bottom { .bottom {
padding: 28rpx; padding: 28rpx;
display: flex; display: flex;
.b_left { .b_left {
width: 103.39rpx; width: 103.39rpx;
height: 94.63rpx; height: 94.63rpx;
margin-right: 18rpx; margin-right: 18rpx;
} }
.b_right { .b_right {
flex: 1; flex: 1;
display: flex; display: flex;
justify-content: space-around; justify-content: space-around;
flex-direction: column; flex-direction: column;
.item { .item {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
// margin: 18rpx 28rpx 0 28rpx; // margin: 18rpx 28rpx 0 28rpx;
// &:last-child { // &:last-child {
// padding-bottom: 18rpx; // padding-bottom: 18rpx;
// } // }
.left { .left {
display: flex; display: flex;
} }
.right { .right {
font-size: 32rpx; font-size: 32rpx;
font-weight: 400; font-weight: 400;
color: #3274f9; color: #3274f9;
line-height: 39rpx; line-height: 39rpx;
.price { .price {
font-size: 25rpx; font-size: 25rpx;
} }
} }
} }
} }
} }
} }
.personnel_list { .personnel_list {
// padding: 28rpx 0; // padding: 28rpx 0;
padding-bottom: 28rpx; padding-bottom: 28rpx;
.cards { .cards {
margin: 0 auto; margin: 0 auto;
// margin-bottom: 28rpx; // margin-bottom: 28rpx;
width: 694rpx; width: 694rpx;
background: #ffffff; background: #ffffff;
border-radius: 30rpx; border-radius: 30rpx;
opacity: 1; opacity: 1;
overflow: hidden; overflow: hidden;
// box-shadow: 2px 2px 4px rgba(0, 0, 0, 0.6); // box-shadow: 2px 2px 4px rgba(0, 0, 0, 0.6);
.cards_head { .cards_head {
padding: 28rpx; padding: 28rpx;
background-color: $theme-oa-color; background-color: $theme-oa-color;
color: white; color: white;
min-height: 100rpx; height: 100rpx;
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
} }
.cards_content { .cards_content {
padding: 28rpx; padding: 28rpx;
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
.left { .left {
text-align: center; text-align: center;
// padding: 15rpx 25rpx; // padding: 15rpx 25rpx;
padding-top: 20rpx; padding-top: 20rpx;
width: 160rpx; width: 160rpx;
background-color: $theme-oa-color; background-color: $theme-oa-color;
color: white; color: white;
border-radius: 40rpx; border-radius: 40rpx;
.cir { .cir {
width: 120rpx; width: 120rpx;
height: 120rpx; height: 120rpx;
background-color: #ffffff; background-color: #ffffff;
margin-left: 25rpx; margin-left: 25rpx;
border-radius: 120rpx; border-radius: 120rpx;
position: relative; position: relative;
} }
} }
.right { .right {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
justify-content: space-between; justify-content: space-between;
view { view {
text:nth-child(2) { text:nth-child(2) {
margin-left: 20rpx; margin-left: 20rpx;
} }
.status { .status {
display: inline-block; display: inline-block;
float: right; float: right;
color: white; color: white;
text-align: center; text-align: center;
padding: 10rpx 30rpx; padding: 10rpx 30rpx;
border-radius: 30rpx; border-radius: 30rpx;
} }
} }
} }
} }
.u_avatar { .u_avatar {
position: absolute; position: absolute;
top: 50%; top: 50%;
left: 50%; left: 50%;
transform: translate(-50%, -50%); transform: translate(-50%, -50%);
} }
} }
} }
</style> </style>

View File

@ -1,245 +0,0 @@
<template>
<view class="c_task_item" @click="clickTask">
<view class="personnel_list">
<view class="cards">
<view class="cards_head">
<view style="font-size: 32rpx; display: flex;padding-right: 16rpx;">
<view style="flex-shrink: 0;margin-right: 10rpx;">完成时间: {{datas.create_time}}</view>
<view>{{ datas.title }}</view>
</view>
<view style="flex-shrink: 0;">点击查看</view>
</view>
<view class="cards_content">
<view class="right" style="width: 100%">
<view style="
display: flex;
justify-content: space-between;
align-items: center;
">
<view>
<text> 人员名称:</text>
<text>{{datas.name }}</text>
</view>
</view>
<view class="" style="display: flex">
<text> 联系电话:</text>
<text>{{datas.phone}}</text>
</view>
<view class="">
<text>所属片区 :</text>
<text> {{ datas.village_name +datas.brigade_name }} </text>
</view>
</view>
</view>
</view>
</view>
</view>
</template>
<script>
import {
Toast
} from '../../libs/uniApi';
export default {
name: "task",
props: {
datas: {
type: Object,
default: function() {
return {}
}
}
},
data() {
return {
extend: {}
};
},
mounted() {
this.$props.datas.extend ? this.extend = this.$props.datas.extend : null;
},
methods: {
clickTask() {
uni.navigateTo({
url: `/pages/business/detail?id=${this.$props.datas?.id}`
})
// if ((this.$props.datas.type != 31) && this.$props.datas.status !== 2 && this.$props.datas.status !== 1) {
// return this.$props.datas.status == 3 ? Toast('!') : Toast('!');
// }
},
}
}
</script>
<style lang="scss">
.c_task_item {
margin: 0 auto;
// margin-bottom: 28rpx;
width: 694rpx;
// background: #FFFFFF;
border-radius: 14rpx 14rpx 14rpx 14rpx;
opacity: 1;
font-size: 25rpx;
font-weight: 400;
color: #999999;
line-height: 39rpx;
.text {
font-size: 28rpx;
font-weight: 400;
color: #333333;
line-height: 39rpx;
margin-left: 18rpx;
}
.top {
display: flex;
justify-content: space-between;
padding: 28rpx;
border-bottom: 1rpx solid #f5f5f5ff;
.left {
display: flex;
justify-content: left;
align-items: center;
}
.right {
.icon {
width: 43rpx;
height: 43rpx;
}
}
}
.bottom {
padding: 28rpx;
display: flex;
.b_left {
width: 103.39rpx;
height: 94.63rpx;
margin-right: 18rpx;
}
.b_right {
flex: 1;
display: flex;
justify-content: space-around;
flex-direction: column;
.item {
display: flex;
justify-content: space-between;
// margin: 18rpx 28rpx 0 28rpx;
// &:last-child {
// padding-bottom: 18rpx;
// }
.left {
display: flex;
}
.right {
font-size: 32rpx;
font-weight: 400;
color: #3274f9;
line-height: 39rpx;
.price {
font-size: 25rpx;
}
}
}
}
}
}
.personnel_list {
// padding: 28rpx 0;
padding-bottom: 28rpx;
.cards {
margin: 0 auto;
// margin-bottom: 28rpx;
width: 694rpx;
background: #ffffff;
border-radius: 30rpx;
opacity: 1;
overflow: hidden;
// box-shadow: 2px 2px 4px rgba(0, 0, 0, 0.6);
.cards_head {
padding: 28rpx;
background-color: $theme-oa-color;
color: white;
min-height: 100rpx;
display: flex;
justify-content: space-between;
}
.cards_content {
padding: 28rpx;
display: flex;
justify-content: space-between;
.left {
text-align: center;
// padding: 15rpx 25rpx;
padding-top: 20rpx;
width: 160rpx;
background-color: $theme-oa-color;
color: white;
border-radius: 40rpx;
.cir {
width: 120rpx;
height: 120rpx;
background-color: #ffffff;
margin-left: 25rpx;
border-radius: 120rpx;
position: relative;
}
}
.right {
display: flex;
flex-direction: column;
justify-content: space-between;
view {
text:nth-child(2) {
margin-left: 20rpx;
}
.status {
display: inline-block;
float: right;
color: white;
text-align: center;
padding: 10rpx 30rpx;
border-radius: 30rpx;
}
}
}
}
.u_avatar {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
}
}
</style>

View File

@ -1,237 +0,0 @@
<template>
<view class="c_task_item" @click="clickTask">
<!-- {{datas.datas[0].data_field}} -->
<view class="personnel_list" v-for="(item ,i) in datas.datas">
<view class="cards" v-if="item.ai_question">
<view class="cards_content">
<view class="right" style="width: 100%">
<view class="">
AI提问
</view>
<view class="" style="white-space: pre-line;">
<view class="">
根据以下信息
</view>
<view class="" style="text-align: left;" v-for="(items,indexs) in item.data_field">
{{indexs}} :{{items}}
</view>
<!-- {{item.ai_question}} -->
<view class="">
请问有那些商机需要购买哪些商品
</view>
</view>
</view>
</view>
<view class="cards_content">
<view class="right" style="width: 100%">
<view class="">
AI回答
</view>
<view class="" style="white-space: pre-line;">
{{item.ai_aianalyse}}
</view>
</view>
</view>
</view>
</view>
</view>
</template>
<script>
import {
Toast
} from '../../libs/uniApi';
export default {
name: "task",
props: {
datas: {
type: Object,
default: function() {
return {}
}
}
},
data() {
return {
extend: {}
};
},
mounted() {
this.$props.datas.extend ? this.extend = this.$props.datas.extend : null;
},
methods: {}
}
</script>
<style lang="scss">
.c_task_item {
margin: 0 auto;
// margin-bottom: 28rpx;
width: 694rpx;
// background: #FFFFFF;
border-radius: 14rpx 14rpx 14rpx 14rpx;
opacity: 1;
font-size: 25rpx;
font-weight: 400;
color: #999999;
line-height: 39rpx;
.text {
font-size: 28rpx;
font-weight: 400;
color: #333333;
line-height: 39rpx;
margin-left: 18rpx;
}
.top {
display: flex;
justify-content: space-between;
padding: 28rpx;
border-bottom: 1rpx solid #f5f5f5ff;
.left {
display: flex;
justify-content: left;
align-items: center;
}
.right {
.icon {
width: 43rpx;
height: 43rpx;
}
}
}
.bottom {
padding: 28rpx;
display: flex;
.b_left {
width: 103.39rpx;
height: 94.63rpx;
margin-right: 18rpx;
}
.b_right {
flex: 1;
display: flex;
justify-content: space-around;
flex-direction: column;
.item {
display: flex;
justify-content: space-between;
// margin: 18rpx 28rpx 0 28rpx;
// &:last-child {
// padding-bottom: 18rpx;
// }
.left {
display: flex;
}
.right {
font-size: 32rpx;
font-weight: 400;
color: #3274f9;
line-height: 39rpx;
.price {
font-size: 25rpx;
}
}
}
}
}
}
.personnel_list {
// padding: 28rpx 0;
padding-bottom: 28rpx;
.cards {
margin: 0 auto;
// margin-bottom: 28rpx;
width: 694rpx;
background: #ffffff;
border-radius: 30rpx;
opacity: 1;
overflow: hidden;
// box-shadow: 2px 2px 4px rgba(0, 0, 0, 0.6);
.cards_head {
padding: 28rpx;
background-color: $theme-oa-color;
color: white;
min-height: 100rpx;
display: flex;
justify-content: space-between;
}
.cards_content {
padding: 28rpx;
.left {
text-align: center;
// padding: 15rpx 25rpx;
padding-top: 20rpx;
width: 160rpx;
background-color: $theme-oa-color;
color: white;
border-radius: 40rpx;
.cir {
width: 120rpx;
height: 120rpx;
background-color: #ffffff;
margin-left: 25rpx;
border-radius: 120rpx;
position: relative;
}
}
.right {
display: flex;
flex-direction: column;
justify-content: space-between;
view {
text:nth-child(2) {
margin-left: 20rpx;
}
.status {
display: inline-block;
float: right;
color: white;
text-align: center;
padding: 10rpx 30rpx;
border-radius: 30rpx;
}
}
}
}
.u_avatar {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
}
}
</style>

View File

@ -3,9 +3,8 @@ let httpApi; // 总域名
let httpApiTwo; // 物流系统域名 let httpApiTwo; // 物流系统域名
// const env = 'dev'; // 开发 // const env = 'dev'; // 开发
const env = 'prod'; // 生产 // const env = 'prod'; // 生产
// const env = 'prew'; // 预上线 const env = 'prew'; // 预上线
// const env = 'local'; // 本地
switch (env) { switch (env) {
case 'prod': case 'prod':
@ -18,16 +17,10 @@ switch (env) {
httpApiThree = 'https://preview-worker-task.lihaink.cn' //预上线 httpApiThree = 'https://preview-worker-task.lihaink.cn' //预上线
httpApiTwo = 'https://preview-logistics.lihaink.cn' //预上线 httpApiTwo = 'https://preview-logistics.lihaink.cn' //预上线
break; break;
case 'local':
httpApi = 'http://192.168.1.20:8000' //预上线
httpApiThree = 'http://192.168.1.20:8000' //预上线
httpApiTwo = 'http://192.168.1.20:8000' //预上线
break;
default: default:
httpApi = 'https://ceshi-worker-task.lihaink.cn' //测试 httpApi = 'https://ceshi-worker-task.lihaink.cn' //测试
httpApiThree = 'https://ceshi-worker-task.lihaink.cn' //测试 httpApiThree = 'https://ceshi-worker-task.lihaink.cn' //测试
httpApiTwo = 'https://ceshi-logistics.lihaink.cn' //测试环境 httpApiTwo = 'https://ceshi-logistics.lihaink.cn' //测试环境
//测试环境
} }
@ -56,7 +49,6 @@ module.exports = {
HTTP_REQUEST_URL_THREE: httpApiThree, HTTP_REQUEST_URL_THREE: httpApiThree,
HTTP_REQUEST_URL_TWO: httpApiTwo, HTTP_REQUEST_URL_TWO: httpApiTwo,
// #ifdef H5 // #ifdef H5
//H5接口是浏览器地址 //H5接口是浏览器地址
// HTTP_REQUEST_URL: httpApi || window.location.protocol + "//" + window.location.host, // HTTP_REQUEST_URL: httpApi || window.location.protocol + "//" + window.location.host,

View File

@ -1,356 +1,339 @@
{ {
"name": "里海社区", "name" : "里海社区",
// "appid" : "__UNI__3A527D1", "appid" : "__UNI__B5B1EDD",
"appid": "__UNI__B5B1EDD", "description" : "",
"description": "", "versionName" : "1.1.3",
"versionName": "1.3.3", "versionCode" : 113,
"versionCode": 133, "transformPx" : false,
"transformPx": false, /* 5+App */
/* 5+App */ "app-plus" : {
"app-plus": { "usingComponents" : true,
"usingComponents": true, "nvueStyleCompiler" : "uni-app",
"nvueStyleCompiler": "uni-app", "compilerVersion" : 3,
"compilerVersion": 3, // "statusbar": {
"compatible": { // "immersed": false
"ignoreVersion": true //trueHBuilderX1.9.0 // },
}, "splashscreen" : {
// "statusbar": { "alwaysShowBeforeRender" : true,
// "immersed": false "waiting" : true,
// }, "autoclose" : true,
"splashscreen": { "delay" : 0
"alwaysShowBeforeRender": false, },
"waiting": true, /* */
"autoclose": false, "modules" : {
"delay": 0 "Payment" : {},
}, "Barcode" : {},
/* */ "Camera" : {},
"modules": { "Maps" : {},
"Payment": {}, "VideoPlayer" : {}
"Barcode": {}, },
"Camera": {}, /* */
"Maps": {}, "distribute" : {
"VideoPlayer": {}, /* android */
"Geolocation": {} "android" : {
}, "permissions" : [
/* */ "<uses-permission android:name=\"android.permission.CALL_PHONE\"/>",
"distribute": { "<uses-feature android:name=\"android.hardware.camera\"/>",
/* android */ "<uses-feature android:name=\"android.hardware.camera.autofocus\"/>",
"android": { "<uses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\"/>",
"permissions": [ "<uses-permission android:name=\"android.permission.ACCESS_WIFI_STATE\"/>",
"<uses-permission android:name=\"android.permission.CALL_PHONE\"/>", "<uses-permission android:name=\"android.permission.CAMERA\"/>",
"<uses-feature android:name=\"android.hardware.camera\"/>", "<uses-permission android:name=\"android.permission.CHANGE_NETWORK_STATE\"/>",
"<uses-feature android:name=\"android.hardware.camera.autofocus\"/>", "<uses-permission android:name=\"android.permission.CHANGE_WIFI_STATE\"/>",
"<uses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\"/>", "<uses-permission android:name=\"android.permission.FLASHLIGHT\"/>",
"<uses-permission android:name=\"android.permission.ACCESS_WIFI_STATE\"/>", "<uses-permission android:name=\"android.permission.GET_ACCOUNTS\"/>",
"<uses-permission android:name=\"android.permission.CAMERA\"/>", "<uses-permission android:name=\"android.permission.MODIFY_AUDIO_SETTINGS\"/>",
"<uses-permission android:name=\"android.permission.CHANGE_NETWORK_STATE\"/>", "<uses-permission android:name=\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\"/>",
"<uses-permission android:name=\"android.permission.CHANGE_WIFI_STATE\"/>", "<uses-permission android:name=\"android.permission.READ_LOGS\"/>",
"<uses-permission android:name=\"android.permission.FLASHLIGHT\"/>", "<uses-permission android:name=\"android.permission.READ_PHONE_STATE\"/>",
"<uses-permission android:name=\"android.permission.GET_ACCOUNTS\"/>", "<uses-permission android:name=\"android.permission.VIBRATE\"/>",
"<uses-permission android:name=\"android.permission.MODIFY_AUDIO_SETTINGS\"/>", "<uses-permission android:name=\"android.permission.WAKE_LOCK\"/>",
"<uses-permission android:name=\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\"/>", "<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>"
"<uses-permission android:name=\"android.permission.READ_LOGS\"/>", ],
"<uses-permission android:name=\"android.permission.READ_PHONE_STATE\"/>", "abiFilters" : [ "armeabi-v7a", "arm64-v8a" ]
"<uses-permission android:name=\"android.permission.VIBRATE\"/>", },
"<uses-permission android:name=\"android.permission.WAKE_LOCK\"/>", /* ios */
"<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>" "ios" : {
], "dSYMs" : false
"abiFilters": ["armeabi-v7a", "arm64-v8a"] },
}, /* SDK */
/* ios */ "sdkConfigs" : {
"ios": { "payment" : {
"dSYMs": false "weixin" : {
}, "__platform__" : [ "ios", "android" ],
/* SDK */ // "appid" : "wx4789d9f1b50390ba",
"sdkConfigs": { "appid" : "wx9d68c92b550ddd1e", //
"payment": { "UniversalLinks" : "https://worker-task.lihaink.cn/"
"weixin": { }
"__platform__": ["ios", "android"], },
// "appid" : "wx4789d9f1b50390ba", "ad" : {},
"appid": "wx9d68c92b550ddd1e", // "maps" : {
"UniversalLinks": "https://worker-task.lihaink.cn/" "amap" : {
} "appkey_ios" : "0799f37420c0784f1e6cba230a68bdb1",
}, "appkey_android" : "0799f37420c0784f1e6cba230a68bdb1"
"ad": {}, }
"maps": { }
"amap": { },
// "appkey_ios" : "0799f37420c0784f1e6cba230a68bdb1", "apple" : {
// "appkey_android" : "0799f37420c0784f1e6cba230a68bdb1", "urlschemewhitelist" : [ "iosamap" ]
"appkey_ios": "82af93ec51139c712c4118d84ba684ee", },
"appkey_android": "0799f37420c0784f1e6cba230a68bdb1" "splashscreen" : {
} "useOriginalMsgbox" : true
}, },
// "appkey_ios" : "4f8f55618010007147aab96fc72bb408", "icons" : {
// "appkey_android" : "4f8f55618010007147aab96fc72bb408" "android" : {
"geolocation": { "hdpi" : "unpackage/res/icons/72x72.png",
"amap": { "xhdpi" : "unpackage/res/icons/96x96.png",
"__platform__": ["ios", "android"], "xxhdpi" : "unpackage/res/icons/144x144.png",
"appkey_ios": "82af93ec51139c712c4118d84ba684ee", "xxxhdpi" : "unpackage/res/icons/192x192.png"
"appkey_android": "0799f37420c0784f1e6cba230a68bdb1" },
} "ios" : {
} "appstore" : "unpackage/res/icons/1024x1024.png",
}, "ipad" : {
"apple": { "app" : "unpackage/res/icons/76x76.png",
"urlschemewhitelist": ["iosamap"] "app@2x" : "unpackage/res/icons/152x152.png",
}, "notification" : "unpackage/res/icons/20x20.png",
"splashscreen": { "notification@2x" : "unpackage/res/icons/40x40.png",
"useOriginalMsgbox": false, "proapp@2x" : "unpackage/res/icons/167x167.png",
"androidStyle": "common" "settings" : "unpackage/res/icons/29x29.png",
}, "settings@2x" : "unpackage/res/icons/58x58.png",
"icons": { "spotlight" : "unpackage/res/icons/40x40.png",
"android": { "spotlight@2x" : "unpackage/res/icons/80x80.png"
"hdpi": "unpackage/res/icons/72x72.png", },
"xhdpi": "unpackage/res/icons/96x96.png", "iphone" : {
"xxhdpi": "unpackage/res/icons/144x144.png", "app@2x" : "unpackage/res/icons/120x120.png",
"xxxhdpi": "unpackage/res/icons/192x192.png" "app@3x" : "unpackage/res/icons/180x180.png",
}, "notification@2x" : "unpackage/res/icons/40x40.png",
"ios": { "notification@3x" : "unpackage/res/icons/60x60.png",
"appstore": "unpackage/res/icons/1024x1024.png", "settings@2x" : "unpackage/res/icons/58x58.png",
"ipad": { "settings@3x" : "unpackage/res/icons/87x87.png",
"app": "unpackage/res/icons/76x76.png", "spotlight@2x" : "unpackage/res/icons/80x80.png",
"app@2x": "unpackage/res/icons/152x152.png", "spotlight@3x" : "unpackage/res/icons/120x120.png"
"notification": "unpackage/res/icons/20x20.png", }
"notification@2x": "unpackage/res/icons/40x40.png", }
"proapp@2x": "unpackage/res/icons/167x167.png", }
"settings": "unpackage/res/icons/29x29.png", },
"settings@2x": "unpackage/res/icons/58x58.png", "nativePlugins" : {
"spotlight": "unpackage/res/icons/40x40.png", "JG-JCore" : {
"spotlight@2x": "unpackage/res/icons/80x80.png" "JPUSH_APPKEY_ANDROID" : "5ced5ec5fa7bb86302944f0f",
}, "JPUSH_APPKEY_IOS" : "5ced5ec5fa7bb86302944f0f",
"iphone": { "JPUSH_CHANNEL_ANDROID" : "",
"app@2x": "unpackage/res/icons/120x120.png", "JPUSH_CHANNEL_IOS" : "",
"app@3x": "unpackage/res/icons/180x180.png", "__plugin_info__" : {
"notification@2x": "unpackage/res/icons/40x40.png", "name" : "极光推送 JCore 官方 SDK",
"notification@3x": "unpackage/res/icons/60x60.png", "description" : "极光推送 JCore 官方 SDK HBuilder 插件版本",
"settings@2x": "unpackage/res/icons/58x58.png", "platforms" : "Android,iOS",
"settings@3x": "unpackage/res/icons/87x87.png", "url" : "https://ext.dcloud.net.cn/plugin?id=4028",
"spotlight@2x": "unpackage/res/icons/80x80.png", "android_package_name" : "uni.UNIB5B1EDD",
"spotlight@3x": "unpackage/res/icons/120x120.png" "ios_bundle_id" : "uni.UNIB5B1EDD",
} "isCloud" : true,
} "bought" : 1,
} "pid" : "4028",
}, "parameters" : {
"nativePlugins": { "JPUSH_APPKEY_ANDROID" : {
"JG-JCore": { "des" : "[Android]极光portal配置应用信息时分配的AppKey",
"JPUSH_APPKEY_ANDROID": "5ced5ec5fa7bb86302944f0f", "key" : "JPUSH_APPKEY",
"JPUSH_APPKEY_IOS": "5ced5ec5fa7bb86302944f0f", "value" : ""
"JPUSH_CHANNEL_ANDROID": "", },
"JPUSH_CHANNEL_IOS": "", "JPUSH_APPKEY_IOS" : {
"__plugin_info__": { "des" : "[iOS]极光portal配置应用信息时分配的AppKey",
"name": "极光推送 JCore 官方 SDK", "key" : "JCore:APP_KEY",
"description": "极光推送 JCore 官方 SDK HBuilder 插件版本", "value" : ""
"platforms": "Android,iOS", },
"url": "https://ext.dcloud.net.cn/plugin?id=4028", "JPUSH_CHANNEL_ANDROID" : {
"android_package_name": "uni.UNIB5B1EDD", "des" : "[Android]用于统计分发渠道不需要可填默认值developer-default",
"ios_bundle_id": "uni.UNIB5B1EDD", "key" : "JPUSH_CHANNEL",
"isCloud": true, "value" : ""
"bought": 1, },
"pid": "4028", "JPUSH_CHANNEL_IOS" : {
"parameters": { "des" : "[iOS]用于统计分发渠道不需要可填默认值developer-default",
"JPUSH_APPKEY_ANDROID": { "key" : "JCore:CHANNEL",
"des": "[Android]极光portal配置应用信息时分配的AppKey", "value" : ""
"key": "JPUSH_APPKEY", }
"value": "" }
}, }
"JPUSH_APPKEY_IOS": { },
"des": "[iOS]极光portal配置应用信息时分配的AppKey", "JG-JPush" : {
"key": "JCore:APP_KEY", "JPUSH_ADVERTISINGID_IOS" : "",
"value": "" "JPUSH_DEFAULTINITJPUSH_IOS" : "",
}, "JPUSH_GOOGLE_API_KEY" : "",
"JPUSH_CHANNEL_ANDROID": { "JPUSH_GOOGLE_APP_ID" : "",
"des": "[Android]用于统计分发渠道不需要可填默认值developer-default", "JPUSH_GOOGLE_PROJECT_ID" : "",
"key": "JPUSH_CHANNEL", "JPUSH_GOOGLE_PROJECT_NUMBER" : "",
"value": "" "JPUSH_GOOGLE_STORAGE_BUCKET" : "",
}, "JPUSH_HONOR_APPID" : "",
"JPUSH_CHANNEL_IOS": { "JPUSH_HUAWEI_APPID" : "",
"des": "[iOS]用于统计分发渠道不需要可填默认值developer-default", "JPUSH_ISPRODUCTION_IOS" : "",
"key": "JCore:CHANNEL", "JPUSH_MEIZU_APPID" : "",
"value": "" "JPUSH_MEIZU_APPKEY" : "",
} "JPUSH_OPPO_APPID" : "",
} "JPUSH_OPPO_APPKEY" : "",
} "JPUSH_OPPO_APPSECRET" : "",
}, "JPUSH_VIVO_APPID" : "",
"JG-JPush": { "JPUSH_VIVO_APPKEY" : "",
"JPUSH_ADVERTISINGID_IOS": "", "JPUSH_XIAOMI_APPID" : "",
"JPUSH_DEFAULTINITJPUSH_IOS": "", "JPUSH_XIAOMI_APPKEY" : "",
"JPUSH_GOOGLE_API_KEY": "", "__plugin_info__" : {
"JPUSH_GOOGLE_APP_ID": "", "name" : "极光推送 JPush 官方 SDK",
"JPUSH_GOOGLE_PROJECT_ID": "", "description" : "极光推送JPush官方SDK HBuilder插件版本",
"JPUSH_GOOGLE_PROJECT_NUMBER": "", "platforms" : "Android,iOS",
"JPUSH_GOOGLE_STORAGE_BUCKET": "", "url" : "https://ext.dcloud.net.cn/plugin?id=4035",
"JPUSH_HONOR_APPID": "", "android_package_name" : "uni.UNIB5B1EDD",
"JPUSH_HUAWEI_APPID": "", "ios_bundle_id" : "uni.UNIB5B1EDD",
"JPUSH_ISPRODUCTION_IOS": "", "isCloud" : true,
"JPUSH_MEIZU_APPID": "", "bought" : 1,
"JPUSH_MEIZU_APPKEY": "", "pid" : "4035",
"JPUSH_OPPO_APPID": "", "parameters" : {
"JPUSH_OPPO_APPKEY": "", "JPUSH_ADVERTISINGID_IOS" : {
"JPUSH_OPPO_APPSECRET": "", "des" : "[iOS]广告标识符IDFA如果不需要使用IDFA可不填",
"JPUSH_VIVO_APPID": "", "key" : "JPush:ADVERTISINGID",
"JPUSH_VIVO_APPKEY": "", "value" : ""
"JPUSH_XIAOMI_APPID": "", },
"JPUSH_XIAOMI_APPKEY": "", "JPUSH_DEFAULTINITJPUSH_IOS" : {
"__plugin_info__": { "des" : "[iOS]是否默认初始化是填true不是填false或者不填",
"name": "极光推送 JPush 官方 SDK", "key" : "JPush:DEFAULTINITJPUSH",
"description": "极光推送JPush官方SDK HBuilder插件版本", "value" : ""
"platforms": "Android,iOS", },
"url": "https://ext.dcloud.net.cn/plugin?id=4035", "JPUSH_GOOGLE_API_KEY" : {
"android_package_name": "uni.UNIB5B1EDD", "des" : "厂商google api_key,示例:g-12346578",
"ios_bundle_id": "uni.UNIB5B1EDD", "key" : "google_api_key",
"isCloud": true, "value" : ""
"bought": 1, },
"pid": "4035", "JPUSH_GOOGLE_APP_ID" : {
"parameters": { "des" : "厂商google mobilesdk_app_id,示例g-12346578",
"JPUSH_ADVERTISINGID_IOS": { "key" : "google_app_id",
"des": "[iOS]广告标识符IDFA如果不需要使用IDFA可不填", "value" : ""
"key": "JPush:ADVERTISINGID", },
"value": "" "JPUSH_GOOGLE_PROJECT_ID" : {
}, "des" : "厂商google project_id ,示例g-12346578",
"JPUSH_DEFAULTINITJPUSH_IOS": { "key" : "project_id",
"des": "[iOS]是否默认初始化是填true不是填false或者不填", "value" : ""
"key": "JPush:DEFAULTINITJPUSH", },
"value": "" "JPUSH_GOOGLE_PROJECT_NUMBER" : {
}, "des" : "厂商google project_number,示例g-12346578",
"JPUSH_GOOGLE_API_KEY": { "key" : "gcm_defaultSenderId",
"des": "厂商google api_key,示例:g-12346578", "value" : ""
"key": "google_api_key", },
"value": "" "JPUSH_GOOGLE_STORAGE_BUCKET" : {
}, "des" : "厂商google storage_bucket,示例g-12346578",
"JPUSH_GOOGLE_APP_ID": { "key" : "google_storage_bucket",
"des": "厂商google mobilesdk_app_id,示例g-12346578", "value" : ""
"key": "google_app_id", },
"value": "" "JPUSH_HONOR_APPID" : {
}, "des" : "厂商HONOR-appId,示例12346578",
"JPUSH_GOOGLE_PROJECT_ID": { "key" : "com.hihonor.push.app_id",
"des": "厂商google project_id ,示例g-12346578", "value" : ""
"key": "project_id", },
"value": "" "JPUSH_HUAWEI_APPID" : {
}, "des" : "厂商HUAWEI-appId,示例appid=12346578",
"JPUSH_GOOGLE_PROJECT_NUMBER": { "key" : "com.huawei.hms.client.appid",
"des": "厂商google project_number,示例g-12346578", "value" : ""
"key": "gcm_defaultSenderId", },
"value": "" "JPUSH_ISPRODUCTION_IOS" : {
}, "des" : "[iOS]是否是生产环境是填true不是填false或者不填",
"JPUSH_GOOGLE_STORAGE_BUCKET": { "key" : "JPush:ISPRODUCTION",
"des": "厂商google storage_bucket,示例g-12346578", "value" : ""
"key": "google_storage_bucket", },
"value": "" "JPUSH_MEIZU_APPID" : {
}, "des" : "厂商MEIZU-appId,示例MZ-12345678",
"JPUSH_HONOR_APPID": { "key" : "MEIZU_APPID",
"des": "厂商HONOR-appId,示例12346578", "value" : ""
"key": "com.hihonor.push.app_id", },
"value": "" "JPUSH_MEIZU_APPKEY" : {
}, "des" : "厂商MEIZU-appKey,示例MZ-12345678",
"JPUSH_HUAWEI_APPID": { "key" : "MEIZU_APPKEY",
"des": "厂商HUAWEI-appId,示例appid=12346578", "value" : ""
"key": "com.huawei.hms.client.appid", },
"value": "" "JPUSH_OPPO_APPID" : {
}, "des" : "厂商OPPO-appId,示例OP-12345678",
"JPUSH_ISPRODUCTION_IOS": { "key" : "OPPO_APPID",
"des": "[iOS]是否是生产环境是填true不是填false或者不填", "value" : ""
"key": "JPush:ISPRODUCTION", },
"value": "" "JPUSH_OPPO_APPKEY" : {
}, "des" : "厂商OPPO-appkey,示例OP-12345678",
"JPUSH_MEIZU_APPID": { "key" : "OPPO_APPKEY",
"des": "厂商MEIZU-appId,示例MZ-12345678", "value" : ""
"key": "MEIZU_APPID", },
"value": "" "JPUSH_OPPO_APPSECRET" : {
}, "des" : "厂商OPPO-appSecret,示例OP-12345678",
"JPUSH_MEIZU_APPKEY": { "key" : "OPPO_APPSECRET",
"des": "厂商MEIZU-appKey,示例MZ-12345678", "value" : ""
"key": "MEIZU_APPKEY", },
"value": "" "JPUSH_VIVO_APPID" : {
}, "des" : "厂商VIVO-appId,示例12345678",
"JPUSH_OPPO_APPID": { "key" : "com.vivo.push.app_id",
"des": "厂商OPPO-appId,示例OP-12345678", "value" : ""
"key": "OPPO_APPID", },
"value": "" "JPUSH_VIVO_APPKEY" : {
}, "des" : "厂商VIVO-appkey,示例12345678",
"JPUSH_OPPO_APPKEY": { "key" : "com.vivo.push.api_key",
"des": "厂商OPPO-appkey,示例OP-12345678", "value" : ""
"key": "OPPO_APPKEY", },
"value": "" "JPUSH_XIAOMI_APPID" : {
}, "des" : "厂商XIAOMI-appId,示例MI-12345678",
"JPUSH_OPPO_APPSECRET": { "key" : "XIAOMI_APPID",
"des": "厂商OPPO-appSecret,示例OP-12345678", "value" : ""
"key": "OPPO_APPSECRET", },
"value": "" "JPUSH_XIAOMI_APPKEY" : {
}, "des" : "厂商XIAOMI-appKey,示例MI-12345678",
"JPUSH_VIVO_APPID": { "key" : "XIAOMI_APPKEY",
"des": "厂商VIVO-appId,示例12345678", "value" : ""
"key": "com.vivo.push.app_id", }
"value": "" }
}, }
"JPUSH_VIVO_APPKEY": { }
"des": "厂商VIVO-appkey,示例12345678", }
"key": "com.vivo.push.api_key", },
"value": "" /* */
}, "quickapp" : {},
"JPUSH_XIAOMI_APPID": { "h5" : {
"des": "厂商XIAOMI-appId,示例MI-12345678", "devServer" : {
"key": "XIAOMI_APPID", "proxy" : {
"value": "" "baseUrlTest/adminapi" : {
}, "target" : "https://worker-task.lihaink.cn",
"JPUSH_XIAOMI_APPKEY": { "changeOrigin" : true,
"des": "厂商XIAOMI-appKey,示例MI-12345678", "pathRewrite" : {
"key": "XIAOMI_APPKEY", "^/baseUrlTest/adminapi" : "/adminapi"
"value": "" }
} },
} "baseUrlTest/api" : {
} "target" : "https://worker-task.lihaink.cn",
} "changeOrigin" : true,
} "pathRewrite" : {
}, "^/baseUrlTest/api" : "/api"
/* */ }
"quickapp": {}, }
"h5": { }
"devServer": { },
"proxy": { "sdkConfigs" : {
"baseUrlTest/adminapi": { "maps" : {
"target": "https://worker-task.lihaink.cn", "amap" : {
"changeOrigin": true, "key" : "275cd3601b1b2d6414f6c988e7911664",
"pathRewrite": { "securityJsCode" : "d2d7c56801819e8bdf71b8a71846f235",
"^/baseUrlTest/adminapi": "/adminapi" "serviceHost" : ""
} }
}, }
"baseUrlTest/api": { }
"target": "https://worker-task.lihaink.cn", },
"changeOrigin": true, /* */
"pathRewrite": { "mp-weixin" : {
"^/baseUrlTest/api": "/api" "appid" : "wx6e14cb98394e36bc",
} "setting" : {
} "urlCheck" : false
} },
}, "usingComponents" : true
"sdkConfigs": { },
"maps": { "mp-alipay" : {
"amap": { "usingComponents" : true
"key": "275cd3601b1b2d6414f6c988e7911664", },
"securityJsCode": "d2d7c56801819e8bdf71b8a71846f235", "mp-baidu" : {
"serviceHost": "" "usingComponents" : true
} },
} "mp-toutiao" : {
} "usingComponents" : true
}, },
/* */ "uniStatistics" : {
"mp-weixin": { "enable" : false
"appid": "wx6e14cb98394e36bc", },
"setting": { "vueVersion" : "2"
"urlCheck": false
},
"usingComponents": true
},
"mp-alipay": {
"usingComponents": true
},
"mp-baidu": {
"usingComponents": true
},
"mp-toutiao": {
"usingComponents": true
},
"uniStatistics": {
"enable": false
},
"vueVersion": "2"
} }

1710
pages.json

File diff suppressed because it is too large Load Diff

View File

@ -1,82 +1,34 @@
<template> <template>
<view class="all_box"> <view class="">
<block v-if="skeleton"> <u-empty icon="/static/img/empty/data.png"></u-empty>
<u-skeleton :loading="skeleton" :animate="true" title rows="2" rows-width="100%" <!-- <u-loadmore :status="loadConfig.status" :loading-text="loadConfig.loadingText" :loadmore-text="loadConfig.loadmoreText" :nomore-text="loadConfig.nomoreText" /> -->
rowsHeight="40" v-for="i in 3" :key="i" style="padding: 28rpx;">
</u-skeleton>
</block>
<block v-else>
<u-empty v-if="list.length==0" icon="/static/img/empty/data.png" text="没有信息"></u-empty>
<view v-else class="task_list">
<!-- <taskCard class="task_card" v-for="item in 10" :key="item"></taskCard> -->
<task-item :datas="item" v-for="item in list" :key="item.id"></task-item>
</view>
</block>
<!-- <u-loadmore v-else :status="loadConfig.status" :loading-text="loadConfig.loadingText"
:loadmore-text="loadConfig.loadmoreText" :nomore-text="loadConfig.nomoreText" /> -->
</view> </view>
</template> </template>
<script> <script>
import { Toast } from '@/libs/uniApi.js'
import taskItem from "@/components/task/taskitemA.vue"
import {
opportunity
} from "@/api/business.js"
export default { export default {
components:{
taskItem
},
data() { data() {
return { return {
skeleton: false, loadConfig: {
loadConfig:{
page: 1, page: 1,
limit: 15, limit: 15,
lastpage: '', lastpage: '',
loadingText: '努力加载中', loadingText: '努力加载中',
loadmoreText: '轻轻上拉', loadmoreText: '轻轻上拉',
nomoreText: '我也是有底线的~~', nomoreText: '暂无商机',
status: 'loadmore', status: 'nomore'
}, },
list: []
}
},
onLoad(e) {
this.skeleton = true;
this.id=e.id
},
onShow() {
this.loadList();
},
onReady() {
uni.$on('initOaTask', this.loadList);
},
methods: {
async loadList(){
let res = await opportunity({});
this.list =res.data;
this.skeleton = false;
} }
}, },
onLoad() {},
onShow() {},
methods: {},
onPullDownRefresh() { onPullDownRefresh() {
this.loadList(); uni.stopPullDownRefresh()
this.$u.sleep(500).then(()=>{uni.stopPullDownRefresh()}); }
},
onReachBottom() {
},
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss">
.task_list{
padding-top: 28rpx;
}
.loading{
padding: 28rpx;
margin-top: 28rpx;
}
</style> </style>

View File

@ -1,91 +0,0 @@
<template>
<view class="all_box">
<block v-if="skeleton">
<u-skeleton :loading="skeleton" :animate="true" title rows="2" rows-width="100%" rowsHeight="40"
v-for="i in 3" :key="i" style="padding: 28rpx;">
</u-skeleton>
</block>
<block v-else>
<u-empty v-if="Object.keys(list).length==0" icon="/static/img/empty/data.png" text="没有信息"></u-empty>
<view v-else class="task_list">
<!-- <taskCard class="task_card" v-for="item in 10" :key="item"></taskCard> -->
<task-item :datas="list" ></task-item>
</view>
</block>
<!-- <u-loadmore v-else :status="loadConfig.status" :loading-text="loadConfig.loadingText"
:loadmore-text="loadConfig.loadmoreText" :nomore-text="loadConfig.nomoreText" /> -->
</view>
</template>
<script>
import {
oppordetails
} from "@/api/business.js"
import {
Toast
} from '@/libs/uniApi.js'
import taskItem from "@/components/task/taskitemB.vue"
import {
opportunity
} from "@/api/business.js"
export default {
components: {
taskItem
},
data() {
return {
skeleton: false,
loadConfig: {
page: 1,
limit: 15,
lastpage: '',
loadingText: '努力加载中',
loadmoreText: '轻轻上拉',
nomoreText: '我也是有底线的~~',
status: 'loadmore'
},
list: [],
id: 0
}
},
onLoad(e) {
this.skeleton = true;
this.id = e.id
},
onShow() {
this.loadList();
},
onReady() {
uni.$on('initOaTask', this.loadList);
},
methods: {
async loadList() {
let res = await oppordetails({
id: this.id
});
this.list = res.data;
this.skeleton = false;
}
},
onPullDownRefresh() {
this.loadList();
this.$u.sleep(500).then(() => {
uni.stopPullDownRefresh()
});
},
onReachBottom() {},
}
</script>
<style lang="scss" scoped>
.task_list {
padding-top: 28rpx;
}
.loading {
padding: 28rpx;
margin-top: 28rpx;
}
</style>

View File

@ -1,522 +1,466 @@
<template> <template>
<view> <view>
<view v-if='showLoading'> <view v-if='showLoading'>
<u-loading-page :loading="showLoading"></u-loading-page> <u-loading-page :loading="showLoading"></u-loading-page>
</view> </view>
<view v-else> <view v-else>
<view class="content"> <view class="content">
<u-toast ref="uToast"></u-toast> <u-toast ref="uToast"></u-toast>
<view class="map"> <view class="map">
<map :class="mapClass" id="map" @markertap='mapFun' :enable-zoom="true" :polyline="polyline" <map :class="mapClass" id="map" @markertap='mapFun' :enable-zoom="true" :polyline="polyline"
:markers='markers' :scale="scale" style="width:100%;height: 70%;" :markers='markers' :scale="scale" style="width:100%;height: 70%;"
:latitude="markers[0].latitude" :enable-scroll="true" :longitude="markers[0].longitude"> :latitude="markers[0].latitude" :enable-scroll="true" :longitude="markers[0].longitude">
<cover-image class="map_btn" @tap="test" src="../../static/img/logistics/DH.png"> <cover-image class="map_btn" @tap="test" src="../../static/img/logistics/DH.png">
</cover-image> </cover-image>
</map>
</map> <view class="map_address">
<view class="map_address"> <view style="display: flex;">
<view style="display: flex;"> <view style="flex-shrink: 0;margin-right: 16rpx;"><text class="cir"
<view style="flex-shrink: 0;margin-right: 16rpx;"><text class="cir" style="background-color: #40BC5E;"></text> 起点:</view>
style="background-color: #40BC5E;"></text> 起点:</view> <view>{{nowAddress}}</view>
<view>{{nowAddress}}</view> </view>
</view> <view style="display: flex;">
<view style="display: flex;"> <view style="flex-shrink: 0;margin-right: 16rpx;"><text class="cir"
<view style="flex-shrink: 0;margin-right: 16rpx;"><text class="cir" style="background-color: #FF7C32;"></text>终点:</view>
style="background-color: #FF7C32;"></text>终点:</view> <view>{{goodsDetil.logistics.shop_address}}</view>
<view>{{goodsDetil.logistics.shop_address}}</view> </view>
</view> </view>
</view> </view>
</view>
<view class="order_info"> <view class="order_info">
<view class="top"> <view class="top">
<view> <view>
订单号信息: 订单号信息:
</view> </view>
<view>订单编号:&nbsp;&nbsp;{{goodsDetil.logistics.order_sn}}</view> <view>订单编号:&nbsp;&nbsp;{{goodsDetil.logistics.order_sn}}</view>
<view> <view>
商户名称:&nbsp;&nbsp; {{goodsDetil.logistics.shop_name}} 商户名称:&nbsp;&nbsp; {{goodsDetil.logistics.shop_name}}
</view> </view>
<view @click.stop="callFn(goodsDetil.logistics.shop_phone)"> <view @click.stop="callFn(goodsDetil.logistics.shop_phone)">
联系电话:&nbsp;&nbsp; <u-icon style="display: inline-block;margin-left: 5rpx;" name="phone" 联系电话:&nbsp;&nbsp; <u-icon style="display: inline-block;margin-left: 5rpx;" name="phone"
color="#fff" size="22"></u-icon>{{goodsDetil.logistics.shop_phone}} color="#fff" size="22"></u-icon>{{goodsDetil.logistics.shop_phone}}
</view> </view>
<view> <view>
店铺地址:&nbsp;&nbsp;{{goodsDetil.logistics.shop_address}} 店铺地址:&nbsp;&nbsp;{{goodsDetil.logistics.shop_address}}
</view>
<view style="margin-top: 10px;">
订单备注:&nbsp;&nbsp;{{goodsDetil.logistics.mark}}
</view>
</view>
<view class="mark">
请详细核对订单信息
</view>
</view>
<view class="order_info" style="background-color: #47BE62;">
<view class="top">
<view>
物流信息:
</view>
<view>用户名称:&nbsp;&nbsp;{{fuzzyName( goodsDetil.logistics.receiver_name)}}</view>
<view @click.stop="callFn(goodsDetil.logistics.shop_phone)">
联系电话:&nbsp;&nbsp; <u-icon style="display: inline-block;margin-left: 5rpx;" name="phone"
color="#fff" size="22"></u-icon>{{goodsDetil.logistics.shop_phone}}
</view>
<view>
联系地址:&nbsp;&nbsp;{{goodsDetil.logistics.receiver_address}}
</view>
<view>
下单时间:&nbsp;&nbsp;{{goodsDetil.logistics.create_time}}
</view>
<view class="pro_list">
<view class="goods">
<text>
商品信息
</text>
<view class="goods-tit" style="align-items: center;"
v-for="(item,index) in goodsDetil.product" :key="index">
<u--image style="flex: 2;" radius='10' :showLoading="true" :src="item.goods_pic"
width="100rpx" height="100rpx"></u--image>
<text style="flex: 7;">{{item.goods_name}}</text>
<text style="flex: 1;">X{{item.product_num}}</text>
</view>
</view> </view>
</view> </view>
</view> <view class="mark">
<view class="mark" style="display: flex; justify-content: space-between;"> 请详细核对订单信息
<text>请详细核对订单信息</text>
<text style="color: #0122C7;">共计{{goodsDetil.product_count}}件商品</text>
</view>
</view>
<view class="">
</view> </view>
<view style="margin-top: 200rpx;height: 1px;"> </view>
<!-- 565 -->
</view> <view class="order_info" style="background-color: #47BE62;">
<view class="btn" v-if="!is_captain"> <view class="top">
<u-button @click="qrqodeFn" type="primary" style="background-color: #0122C7;border: 0;"> <view>
<u-icon name="scan" color="white" size="30" style="margin-right: 10rpx;"></u-icon> 物流信息:
扫码取货</u-button> </view>
<view>用户名称:&nbsp;&nbsp;{{fuzzyName( goodsDetil.logistics.receiver_name)}}</view>
<view>
通知时间:&nbsp;&nbsp;{{goodsDetil.logistics.create_time}}
</view>
<view class="pro_list">
<text>
商品信息
</text>
<view class="goods">
<view class="goods_tit" v-for="(item,index) in goodsDetil.product">
<text style="flex: 8;">{{item.goods_name}}</text>
<text style="flex: 2;">X{{item.product_num}}{{item.goods_unit}}</text>
</view>
</view>
</view>
</view>
<view class="mark" style="display: flex; justify-content: space-between;">
<text>请详细核对订单信息</text>
<text style="color: #0122C7;">共计{{goodsDetil.product_count}}件商品</text>
</view>
</view>
<view style="margin-top: 200rpx;height: 1px;">
<!-- 565 -->
</view>
<view class="btn" v-if="!is_captain">
<u-button @click="qrqodeFn" type="primary" style="background-color: #0122C7;border: 0;">
<u-icon name="scan" color="white" size="30" style="margin-right: 10rpx;"></u-icon>
扫码取货</u-button>
</view>
</view> </view>
</view> </view>
</view> </view>
<!-- 弹窗 --> </template>
<u-overlay :show="showToast" @click="offMaskFn">
<view class="warp">
<view class="rect">
<view class="cont">
骑手送货完成
</view>
</view>
</view>
</u-overlay>
</view> <script>
</template> import {
getDetil
} from "@/api/logistics.js"
import {
takeGoods
} from "@/api/logistics.js"
import {
Toast
} from "../../libs/uniApi";
export default {
data() {
return {
is_captain: 0,
mapClass: 'custom-map',
showLoading: true,
showPop: false,
goodsDetil: undefined,
scale: 17,
nowAddress: "无",
markers: [
//
{
id: 1,
latitude: undefined,
longitude: undefined,
iconPath: '../../static/img/logistics/SJ.png', //
},
//
{
id: 2,
latitude: undefined,
longitude: undefined,
iconPath: '../../static/img/logistics/QS.png', //
}
],
polyline: []
<script> }
import {
getDetil
} from "@/api/logistics.js"
import {
takeGoods
} from "@/api/logistics.js"
import {
Toast
} from "../../libs/uniApi";
export default {
data() {
return {
showToast: false,
is_captain: 0,
mapClass: 'custom-map',
showLoading: true,
showPop: false,
goodsDetil: undefined,
scale: 17,
subNVue: null,
nowAddress: "无",
markers: [
//
{
id: 1,
latitude: undefined,
longitude: undefined,
iconPath: '../../static/img/logistics/SJ.png', //
},
//
{
id: 2,
latitude: undefined,
longitude: undefined,
iconPath: '../../static/img/logistics/QS.png', //
}
],
polyline: []
}
},
methods: {
fuzzyName(name) {
let length = name.length;
let fuzzyChars = "*".repeat(length - 1);
return name[0] + fuzzyChars;
}, },
callFn(num) { methods: {
uni.makePhoneCall({ fuzzyName(name) {
phoneNumber: num let length = name.length;
}); let fuzzyChars = "*".repeat(length - 1);
}, return name[0] + fuzzyChars;
// },
// callFn(num) {
locationFn() { uni.makePhoneCall({
let that = this phoneNumber: num
//#ifdef APP });
uni.getLocation({ },
type: 'gcj02', //
geocode: true, //
isHighAccuracy: true, locationFn() {
success: function async (res) { let that = this
that.nowAddress = res.address.city + res.address.district + res.address.street + res //#ifdef APP
.address.streetNum + res.address.poiName uni.getLocation({
type: 'gcj02',
geocode: true,
isHighAccuracy: true,
success: function async (res) {
that.nowAddress = res.address.city + res.address.district + res.address.street + res
.address.streetNum + res.address.poiName
that.markers[1].latitude = res.latitude that.markers[1].latitude = res.latitude
that.markers[1].longitude = res.longitude that.markers[1].longitude = res.longitude
that.getDriverLine() that.getDriverLine()
} }
}); });
//#endif //#endif
}, },
// //
test() { test() {
if (this.is_captain) return; if (this.is_captain) return;
let that = this; let that = this;
uni.getSystemInfo({ uni.getSystemInfo({
success(e) { success(e) {
if (e.platform === 'ios') { if (e.platform === 'ios') {
// Toast(''); // Toast('');
// iOSmanifest // iOSmanifest
// manifest.jsonapp-plus->distribute->apple->urlschemewhitelist // manifest.jsonapp-plus->distribute->apple->urlschemewhitelist
//urlschemewhitelist:["iosamap","baidumap"] //urlschemewhitelist:["iosamap","baidumap"]
plus.nativeUI.actionSheet({ plus.nativeUI.actionSheet({
title: "选择地图应用", title: "选择地图应用",
cancel: "取消", cancel: "取消",
buttons: [{ buttons: [{
title: "高德地图" title: "高德地图"
}] }]
}, function(e) { }, function(e) {
if (e.index != 1) return; if (e.index != 1) return;
try { try {
let url = let url =
`iosamap://viewMap?sourceApplication=applicationName&poiname=${that.goodsDetil.logistics.shop_name}&lat=${that.markers[0].latitude}&lon=${that.markers[0].longitude}&dev=0`; `iosamap://viewMap?sourceApplication=applicationName&poiname=${that.goodsDetil.logistics.shop_name}&lat=${that.markers[0].latitude}&lon=${that.markers[0].longitude}&dev=0`;
if (url != "") { if (url != "") {
url = encodeURI(url); url = encodeURI(url);
plus.runtime.openURL(url, function(e) { plus.runtime.openURL(url, function(e) {
plus.nativeUI.alert("您的手机没有安装高德地图"); plus.nativeUI.alert("您的手机没有安装高德地图");
});
}
} catch (e) {
console.log(e);
Toast('暂不支持唤起地图')
}
})
} else {
plus.nativeUI.actionSheet({
title: "选择地图应用",
cancel: "取消",
buttons: [{
title: "高德地图"
}]
}, function(e) {
if (e.index != 1) return;
try {
var packageName = 'com.autonavi.minimap';
var main = plus.android.runtimeMainActivity();
var packageManager = main.getPackageManager();
var PackageManager = plus.android.importClass(packageManager)
var packageInfo = packageManager.getPackageInfo(packageName,
PackageManager.GET_ACTIVITIES);
if (packageInfo) {
var Uri = plus.android.importClass("android.net.Uri");
var url =
`amapuri://route/plan?sourceApplication=maxuslife+
&sid=A&slat=36.702558&slon=116.876678&sname=我的位置&did=B&dlat=${that.markers[0].latitude}&dlon=${that.markers[0].longitude}&dname=${that.goodsDetil.logistics.shop_name}&dev=0&t=0`;
var Intent = plus.android.importClass('android.content.Intent');
var intent = new Intent();
intent.setAction(Intent.ACTION_VIEW);
intent.addCategory(Intent.CATEGORY_DEFAULT);
var uri = Uri.parse(url);
//SchemeURIdata
intent.setData(uri);
intent.setPackage("com.autonavi.minimap");
var main = plus.android.runtimeMainActivity();
main.startActivity(intent);
} else {
// alert('' + packageName + '')
uni.showToast({
title: `您的手机没有安装高德地图`,
icon: 'none'
})
}
console.log("唤醒高德线路规划")
} catch (e) {
console.log(e);
Toast('启动出错')
}
});
}
}
})
},
showToast() {
this.$refs.uToast.show({
type: 'success',
title: '成功主题(带图标)',
message: "操作成功",
iconUrl: 'https://cdn.uviewui.com/uview/demo/toast/success.png'
})
},
mapFun() {
uni.openLocation({
latitude: Number(this.goodsDetil.logistics.shop_lat),
longitude: Number(this.goodsDetil.logistics.shop_long),
address: this.goodsDetil.logistics.shop_address,
name: this.goodsDetil.logistics.shop_name,
scale: 15,
});
},
showToast() {
this.$refs.uToast.show({
type: 'success',
title: '成功主题(带图标)',
message: "操作成功",
iconUrl: 'https://cdn.uviewui.com/uview/demo/toast/success.png'
})
},
getDriverLine() {
const that = this;
const key = "997c9a3d88154fa78f4d28bebc1dd84f";
const origin = `${this.markers[1].longitude},${this.markers[1].latitude}`;
const destination = `${this.markers[0].longitude},${this.markers[0].latitude}`;
uni.request({
// url: `https://restapi.amap.com/v3/direction/walking?key=${key}&origin=105.43639400000002,28.908854&destination=105.439304,28.908447`,
url: `https:restapi.amap.com/v4/direction/bicycling?key=${key}&origin=${origin}&destination=${destination}`,
success: (res) => {
const data = res.data.data;
var points = [];
if (data.paths && data.paths[0] && data.paths[0].steps) {
var steps = data.paths[0].steps;
for (var i = 0; i < steps.length; i++) {
//points
var poLen = steps[i].polyline.split(";");
for (var j = 0; j < poLen.length; j++) {
points.push({
longitude: parseFloat(poLen[j].split(",")[0]),
latitude: parseFloat(poLen[j].split(",")[1]),
}); });
} }
} catch (e) {
console.log(e);
Toast('暂不支持唤起地图')
}
})
} else {
plus.nativeUI.actionSheet({
title: "选择地图应用",
cancel: "取消",
buttons: [{
title: "高德地图"
}]
}, function(e) {
if (e.index != 1) return;
try {
var packageName = 'com.autonavi.minimap';
var main = plus.android.runtimeMainActivity();
var packageManager = main.getPackageManager();
var PackageManager = plus.android.importClass(packageManager)
var packageInfo = packageManager.getPackageInfo(packageName,
PackageManager.GET_ACTIVITIES);
if (packageInfo) {
var Uri = plus.android.importClass("android.net.Uri");
var url =
`amapuri://route/plan?sourceApplication=maxuslife+
&sid=A&slat=36.702558&slon=116.876678&sname=我的位置&did=B&dlat=${that.markers[0].latitude}&dlon=${that.markers[0].longitude}&dname=${that.goodsDetil.logistics.shop_name}&dev=0&t=0`;
var Intent = plus.android.importClass('android.content.Intent');
var intent = new Intent();
intent.setAction(Intent.ACTION_VIEW);
intent.addCategory(Intent.CATEGORY_DEFAULT);
var uri = Uri.parse(url);
//SchemeURIdata
intent.setData(uri);
intent.setPackage("com.autonavi.minimap");
var main = plus.android.runtimeMainActivity();
main.startActivity(intent);
} else {
// alert('' + packageName + '')
uni.showToast({
title: `您的手机没有安装高德地图`,
icon: 'none'
})
}
console.log("唤醒高德线路规划")
} catch (e) {
console.log(e);
Toast('启动出错')
} }
}); that.runningRoute = data.paths[0].steps[0].instruction;
}
}
})
},
mapFun() {
uni.openLocation({
latitude: Number(this.goodsDetil.logistics.shop_lat),
longitude: Number(this.goodsDetil.logistics.shop_long),
address: this.goodsDetil.logistics.shop_address,
name: this.goodsDetil.logistics.shop_name,
scale: 15,
});
},
getDriverLine() {
const that = this;
const key = "997c9a3d88154fa78f4d28bebc1dd84f";
const origin = `${this.markers[1].longitude},${this.markers[1].latitude}`;
const destination = `${this.markers[0].longitude},${this.markers[0].latitude}`;
uni.request({
// url: `https://restapi.amap.com/v3/direction/walking?key=${key}&origin=105.43639400000002,28.908854&destination=105.439304,28.908447`,
url: `https:restapi.amap.com/v4/direction/bicycling?key=${key}&origin=${origin}&destination=${destination}`,
success: (res) => {
const data = res.data.data;
var points = [];
if (data.paths && data.paths[0] && data.paths[0].steps) {
var steps = data.paths[0].steps;
for (var i = 0; i < steps.length; i++) {
//points
var poLen = steps[i].polyline.split(";");
for (var j = 0; j < poLen.length; j++) {
points.push({
longitude: parseFloat(poLen[j].split(",")[0]),
latitude: parseFloat(poLen[j].split(",")[1]),
});
}
} }
that.polyline = [{
points: points,
color: "#0091ff",
dottedLine: true,
width: 30,
that.runningRoute = data.paths[0].steps[0].instruction; }, ];
},
fail: function(res) {
console.log("获取路线失败", res);
},
});
},
qrqodeFn() {
let that = this
uni.scanCode({
onlyFromCamera: true,
success: function(res) {
that.takeGood(res.result)
} }
that.polyline = [{ });
points: points, },
color: "#0091ff", // {}
dottedLine: true, takeGood(sn) {
width: 30, takeGoods({
logistics_id: this.goodsDetil.logistics.id,
order_id: this.goodsDetil.logistics.order_id,
order_sn: sn
}).then(res => {
this.showToast()
setTimeout(() => {
uni.navigateBack()
}, 1000)
})
}, ]; },
},
fail: function(res) {
console.log("获取路线失败", res);
},
});
}, },
onLoad(options) {
offMaskFn() { // console.log()
this.showToast = false this.is_captain = JSON.parse(uni.getStorageSync("USER_INFO")).is_captain
this.subNVue.hide() getDetil({
logistics_id: options.id
}, }).then(res => {
this.goodsDetil = res.data
this.markers[0].latitude = res.data.logistics.shop_lat
qrqodeFn() { this.markers[0].longitude = res.data.logistics.shop_long
// uni.navigateBack() this.locationFn()
// return
let that = this
console.log(6666)
uni.scanCode({
onlyFromCamera: true,
success: function(res) {
that.takeGood(res.result)
}
});
},
// {}
takeGood(sn) {
console.log(takeGoods)
takeGoods({
logistics_id: this.goodsDetil.logistics.id,
order_id: this.goodsDetil.logistics.order_id,
order_sn: sn
}).then((res, err) => {
this.showToast = true
this.subNVue.show(300)
setTimeout(() => { setTimeout(() => {
this.showToast = false this.showLoading = false
this.subNVue.hide() }, 500)
uni.navigateBack()
}, 1000)
}).catch(err => {
Toast(err.msg)
// console.log(err, 65656)
}) })
}, },
},
onLoad(options) {
// console.log()
this.is_captain = JSON.parse(uni.getStorageSync("USER_INFO")).is_captain
getDetil({
logistics_id: options.id
}).then(res => {
this.goodsDetil = res.data
this.markers[0].latitude = res.data.logistics.shop_lat
this.markers[0].longitude = res.data.logistics.shop_long
this.locationFn()
setTimeout(() => {
this.showLoading = false
}, 500)
})
},
onShow() {
this.subNVue = uni.getSubNVueById('map');
this.subNVue.hide()
} }
} </script>
</script>
<style lang='scss' scoped> <style lang='scss' scoped>
.custom-map /deep/ .polyline { .custom-map /deep/ .polyline {
stroke-width: 20px; stroke-width: 20px;
} }
.content { .content {
padding: 2vh 3vw; padding: 2vh 3vw;
background-color: #F6F7FC; background-color: #F6F7FC;
height: 100vh; height: 100vh;
box-sizing: border-box; box-sizing: border-box;
} }
.map { .map {
height: 40vh; height: 40vh;
border-radius: 2vw;
overflow: hidden;
}
.map_address {
background-color: white;
padding: 20rpx 10rpx;
.cir {
display: inline-block;
width: 2vw;
height: 4vw;
border-radius: 2vw; border-radius: 2vw;
margin: 0 20rpx; overflow: hidden;
}
}
.map_btn {
width: 50px;
height: 50px;
position: absolute;
bottom: 0px;
right: 0;
z-index: 9999999;
}
.order_info {
border: none;
background-color: #FF7C32;
border-radius: 2vw;
overflow: hidden;
margin-top: 50rpx;
margin-bottom: 30rpx;
color: white;
.top {
padding: 1vw 3vw;
view {
margin: 10rpx 0;
}
} }
.mark { .map_address {
background-color: white; background-color: white;
color: #A8A8A8; padding: 20rpx 10rpx;
padding: 10rpx 20rpx;
.cir {
display: inline-block;
width: 2vw;
height: 4vw;
border-radius: 2vw;
margin: 0 20rpx;
}
} }
.pro_list { .map_btn {
display: flex; width: 50px;
height: 50px;
position: absolute;
bottom: 0px;
right: 0;
z-index: 9999999;
}
text {
flex: 2 .order_info {
} border: none;
background-color: #FF7C32;
border-radius: 2vw;
overflow: hidden;
margin-top: 50rpx;
margin-bottom: 30rpx;
color: white;
.goods { .top {
flex: 8; padding: 1vw 3vw;
margin: 0;
.goods-tit {
margin: 0;
display: flex;
justify-content: space-around;
view {
margin: 10rpx 0;
} }
} }
.mark {
background-color: white;
color: #A8A8A8;
padding: 10rpx 20rpx;
}
.pro_list {
display: flex;
text {
flex: 2
}
.goods {
flex: 8;
margin: 0;
.goods_tit {
margin: 0;
display: flex;
}
}
}
} }
} .btn {
.btn { position: fixed;
bottom: 20rpx;
position: fixed; width: 90vw;
bottom: 20rpx;
width: 90vw;
left: 50%;
transform: translateX(-50%);
}
.rect {
width: 455.61rpx;
height: 210.28rpx;
background-color: white;
border-radius: 21.03rpx 21.03rpx 21.03rpx 21.03rpx;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
.cont {
color: #0022C7;
position: absolute;
top: 50%;
left: 50%; left: 50%;
transform: translate(-50%, -50%); transform: translateX(-50%);
font-size: 35.05rpx;
}
}
.cover { }
width: 100vw; </style>
height: 100vh;
background-color: rgba(0, 0, 0, .5);
}
</style>

View File

@ -13,14 +13,13 @@
</view> </view>
<view v-else @scroll='scrolling'> <view v-else @scroll='scrolling'>
<logistiCard ref="logistiCards" v-for="(item, index) in orderlist" @getlist="getOrderList" <logistiCard ref="logistiCards" v-for="(item, index) in orderlist" @getlist="getOrderList"
@showToast2="showToast2" :goodsInfo="item" :key="index"> @showTost="showToast" @showToast2="showToast2" :goodsInfo="item" :key="index">
</logistiCard> </logistiCard>
<u-loadmore :status="status" /> <u-loadmore :status="status" />
</view> </view>
<!-- --> <!-- -->
<u-toast ref="uToast"></u-toast> <u-toast ref="uToast"></u-toast>
</view> </view>
</view> </view>
</template> </template>
@ -43,7 +42,6 @@
}, },
data() { data() {
return { return {
showToast: false,
is_captain: "", is_captain: "",
notArr: [], notArr: [],
keywords: "", keywords: "",
@ -70,6 +68,14 @@
this.getOrderList() this.getOrderList()
}, },
showToast() {
this.$refs.uToast.show({
type: 'success',
title: '成功主题(带图标)',
message: "操作成功",
iconUrl: 'https://cdn.uviewui.com/uview/demo/toast/success.png'
})
},
showToast2() { showToast2() {
// 6 // 6
this.$refs.uToast.show({ this.$refs.uToast.show({

View File

@ -67,7 +67,7 @@
<view style="margin: 10rpx 0;"> <view style="margin: 10rpx 0;">
<u-steps :current="record.length" direction="column"> <u-steps :current="record.length" direction="column">
<u-steps-item :title="item.content" :error="index==record.length-1?true:false" <u-steps-item :title="item.content" :error="index==record.length-1?true:false"
:desc="item.create_time" v-for="(item,index) in goodsDetil.record" :key="index"> :desc="item.create_time" v-for="(item,index) in goodsDetil.record">
</u-steps-item> </u-steps-item>
</u-steps> </u-steps>
</view> </view>
@ -77,12 +77,9 @@
商品信息 商品信息
</text> </text>
<view> <view>
<view class="goods_tit" v-for="(item,index) in goodsDetil.product" :key="index"> <view class="goods_tit" v-for="(item,index) in goodsDetil.product">
<text style="width: 60vw;margin: 0;padding: 0;">{{item.goods_name}}</text> <text style="width: 60vw;margin: 0;padding: 0;">{{item.goods_name}}</text>
<!-- <u--image style="flex: 2;" :showLoading="true" :src="item.goods_pic" width="100rpx" <text>X{{item.product_num}}{{item.goods_unit}}</text>
height="100rpx" @click="click"></u--image> -->
<text>X{{item.product_num}}</text>
</view> </view>
</view> </view>
</view> </view>
@ -97,95 +94,41 @@
<view> <view>
{{goodsDetil.record[2].create_time}} {{goodsDetil.record[2].create_time}}
</view> </view>
</view>
<view class="hr">
</view> </view>
<view class="list"> <view class="list">
<text> <text>
收货详情: 收获详情
</text>
</view>
<view class="list">
<text>
用户名称:
</text>
<view>
<view>
{{goodsDetil.logistics.receiver_name}}
</view>
</view>
</view>
<view class="list">
<text>
联系方式:
</text>
<view>
<view>
{{goodsDetil.logistics.receiver_phone}}
</view>
</view>
</view>
<view class="list">
<text>
联系地址:
</text> </text>
<view> <view>
<view> <view>
{{goodsDetil.logistics.receiver_address}} {{goodsDetil.logistics.receiver_address}}
</view> </view>
<view>
{{ fuzzyName(goodsDetil.logistics.receiver_name) ||"顾客姓名"}}:&nbsp;&nbsp;{{goodsDetil.logistics.receiver_phone||"顾客电话"}}
</view>
<view>
{{goodsDetil.record[2].create_time}}
</view>
</view> </view>
</view>
<view class="hr">
</view> </view>
<view class="list"> <view class="list">
<text> <text>
取货详情: 取货详情
</text>
</view>
<view class="list">
<text>
店铺名称:
</text> </text>
<view> <view>
<view> <view>
{{goodsDetil.logistics.shop_name}} {{goodsDetil.logistics.shop_address||"商家地址"}}
</view> </view>
</view>
</view>
<view class="list">
<text>
店主姓名:
</text>
<view>
<view> <view>
{{goodsDetil.logistics.shop_user}} {{goodsDetil.logistics.shop_name||"商家电话"}}
:&nbsp;&nbsp;{{goodsDetil.logistics.shop_phone||"商家电话"}}
</view> </view>
</view>
</view>
<view class="list">
<text>
联系方式:
</text>
<view>
<view> <view>
{{goodsDetil.logistics.shop_phone}} {{goodsDetil.record[1].create_time}}
</view> </view>
</view> </view>
</view> </view>
<view class="list">
<text>
联系方式:
</text>
<view>
<view>
{{goodsDetil.logistics.shop_address}}
</view>
</view>
</view>
<!-- 下划线 --> <!-- 下划线 -->
<view class="hr"> <view class="hr">
@ -197,21 +140,19 @@
<view style="margin: 10rpx 0;"> <view style="margin: 10rpx 0;">
<u-steps :current="record.length" direction="column"> <u-steps :current="record.length" direction="column">
<u-steps-item :title="item.content" :desc="item.create_time" <u-steps-item :title="item.content" :desc="item.create_time"
v-for="(item,index) in goodsDetil.record" :key='index'> v-for="(item,index) in goodsDetil.record">
</u-steps-item> </u-steps-item>
</u-steps> </u-steps>
</view> </view>
</view> </view>
<view class="pro_list"> <view class="pro_list">
<text style="width: 15vw;"> <text style="width: 15vw;">
商品信息: 商品信息
</text> </text>
<view> <view>
<view class="goods_tit" v-for="(item,index) in goodsDetil.product" :key='index'> <view class="goods_tit" v-for="(item,index) in goodsDetil.product">
<u--image style="flex: 2;margin-right: 20rpx;" radius='10' :showLoading="true" <text style="width: 60vw;margin: 0;padding: 0;">{{item.goods_name}}</text>
:src="item.goods_pic" width="100rpx" height="100rpx"></u--image> <text>X{{item.product_num}}{{item.goods_unit}}</text>
<text style="width: 70vw;margin: 0;padding: 0;">{{item.goods_name}}</text>
<text>X{{item.product_num}}</text>
</view> </view>
</view> </view>
</view> </view>
@ -219,13 +160,7 @@
<!-- 已取货 --> <!-- 已取货 -->
<view class="left" v-if="goodsDetil.logistics.status==1"> <view class="left" v-if="goodsDetil.logistics.status==1">
<view class="list"> <view class=" list">
<text>
收货详情:
</text>
</view>
<view class="list">
<text> <text>
用户名称 用户名称
</text> </text>
@ -235,7 +170,7 @@
</view> </view>
<view class="list"> <view class="list">
<text> <text>
联系方式: 联系方式
</text> </text>
<view @click.stop="callFn(goodsDetil.logistics.receiver_phone)"> <view @click.stop="callFn(goodsDetil.logistics.receiver_phone)">
<u-icon style="display: inline-block;margin-left: 5rpx;" name="phone" color="#0122c7" <u-icon style="display: inline-block;margin-left: 5rpx;" name="phone" color="#0122c7"
@ -244,7 +179,7 @@
</view> </view>
<view class="list" style="margin: 10rpx 0;"> <view class="list" style="margin: 10rpx 0;">
<text style="width: 16vw;"> <text style="width: 16vw;">
联系地址: 收货地址
</text> </text>
<view> <view>
<view> <view>
@ -252,47 +187,6 @@
</view> </view>
</view> </view>
</view> </view>
<view class="list">
<text>
取货时间
</text>
<view>
{{goodsDetil.logistics.qh_time}}
</view>
</view>
<view class="hr">
</view>
<view class="list" style="">
<text>
取货详情:
</text>
</view>
<view class="list">
<text>
用户名称
</text>
<view>
{{goodsDetil.logistics.shop_name}}
</view>
</view>
<view class="list">
<text>
联系方式
</text>
<view>
{{goodsDetil.logistics.shop_phone}}
</view>
</view>
<view class="list">
<text>
联系地址
</text>
<view>
{{goodsDetil.logistics.shop_address}}
</view>
</view>
<view> <view>
<view> <view>
物流信息 物流信息
@ -300,7 +194,7 @@
<view style="margin: 20rpx 0;"> <view style="margin: 20rpx 0;">
<u-steps :current="record.length-1" direction="column"> <u-steps :current="record.length-1" direction="column">
<u-steps-item :title="item.content" :desc="item.create_time" <u-steps-item :title="item.content" :desc="item.create_time"
v-for="(item,index) in (record)" :key="index"> v-for="(item,index) in (record)">
</u-steps-item> </u-steps-item>
</u-steps> </u-steps>
</view> </view>
@ -310,17 +204,13 @@
</view> </view>
<view class="pro_list"> <view class="pro_list">
<text style="color: #999;width: 15vw;">
商品信息
</text>
<view> <view>
<text style="color: #999;width: 15vw;"> <view class="goods_tit" v-for="(item,index) in goodsDetil.product">
商品信息: <text style="width: 60vw;margin: 0;padding: 0;">{{item.goods_name}}</text>
</text> <text>X{{item.product_num}}{{item.goods_unit}}</text>
<view class="goods_tit" style="align-items: center;"
v-for="(item,index) in goodsDetil.product" :key="index">
<u--image style="flex: 2;margin-right: 20rpx;" radius='10' :showLoading="true"
:src="item.goods_pic" width="100rpx" height="100rpx"></u--image>
<text style="width: 70vw;margin: 0;padding: 0;">{{item.goods_name}}</text>
<text>X{{item.product_num}}</text>
</view> </view>
</view> </view>
</view> </view>
@ -351,15 +241,6 @@
</u-modal> </u-modal>
<u-toast ref="uToast"></u-toast> <u-toast ref="uToast"></u-toast>
</view> </view>
<u-overlay :show="showToast" @click="showToast = false">
<view class="warp">
<view class="rect">
<view class="cont">
骑手送货完成
</view>
</view>
</view>
</u-overlay>
</view> </view>
@ -377,13 +258,9 @@
import { import {
getDetil getDetil
} from "@/api/logistics.js" } from "@/api/logistics.js"
import {
Toast
} from "../../libs/uniApi"
export default { export default {
data() { data() {
return { return {
showToast: false,
showPop: false, showPop: false,
showLoading: true, showLoading: true,
goodsDetil: undefined, goodsDetil: undefined,
@ -409,26 +286,27 @@
return name[0] + fuzzyChars; return name[0] + fuzzyChars;
}, },
confirm() { confirm() {
if (!this.take_code) return if (!this.take_code) return
doneDelivery({ doneDelivery({
take_code: this.take_code, take_code: this.take_code,
logistics_id: this.goodsDetil.logistics.id logistics_id: this.goodsDetil.logistics.id
}).then(res => { }).then(res => {
this.showToast = true this.showToast()
setTimeout(() => {
this.showToast = false
}, 1000)
setTimeout(() => { setTimeout(() => {
uni.navigateBack() uni.navigateBack()
}, 2000) }, 2000)
}).catch((err) => {
Toast(err.msg)
}) })
this.showPop = false this.showPop = false
}, },
showToast() {
this.$refs.uToast.show({
type: 'success',
title: '成功主题(带图标)',
message: "操作成功",
iconUrl: 'https://cdn.uviewui.com/uview/demo/toast/success.png'
})
},
}, },
onLoad(options) { onLoad(options) {
getDetil({ getDetil({
@ -513,7 +391,13 @@
} }
} }
.pro_list {} .pro_list {
display: flex;
text {
margin-right: 20rpx;
}
}
.total { .total {
/* font-family: "宋体"; */ /* font-family: "宋体"; */
@ -547,12 +431,8 @@
} }
.goods_tit { .goods_tit {
margin-top: 10px;
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
/* background-color: red; */
width: 650rpx;
align-items: center;
} }
.tost_tit { .tost_tit {
@ -560,28 +440,4 @@
} }
} }
.rect {
width: 455.61rpx;
height: 210.28rpx;
background-color: white;
border-radius: 21.03rpx 21.03rpx 21.03rpx 21.03rpx;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
.cont {
color: #0022C7;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
font-size: 35.05rpx;
}
}
.slot-content {
padding-left: 155rpx;
}
</style> </style>

View File

@ -1,8 +0,0 @@
<template>
</template>
<script>
</script>
<style>
</style>

View File

@ -11,7 +11,7 @@
<view class="btn_li">收货人姓名: {{fuzzyName(item.receiver_name)}} <u-button type="primary" class="btn" <view class="btn_li">收货人姓名: {{fuzzyName(item.receiver_name)}} <u-button type="primary" class="btn"
@click="doneFn(item.id)"><u-icon name="car-fill" color="white" size="25" @click="doneFn(item.id)"><u-icon name="car-fill" color="white" size="25"
style="margin-right: 10rpx;;"></u-icon> style="margin-right: 10rpx;;"></u-icon>
</u-button></view> 货物送达</u-button></view>
</view> </view>
<view> <view>
@ -53,7 +53,7 @@
showToast() { showToast() {
this.$refs.uToast.show({ this.$refs.uToast.show({
type: 'success', type: 'success',
title: '成功', title: '成功主题(带图标)',
message: "操作成功", message: "操作成功",
iconUrl: 'https://cdn.uviewui.com/uview/demo/toast/success.png' iconUrl: 'https://cdn.uviewui.com/uview/demo/toast/success.png'
}) })

347
pages/logistics/te.vue Normal file
View File

@ -0,0 +1,347 @@
<!-- -->
<template>
<view>
<button @click="test2">按钮</button>
{{a}}
<!-- <map id="map" @markertap='mapFun' :enable-zoom="true" :polyline="polyline" :markers='markers' :scale="scale"
style="width:100vw;height: 70vh;" :latitude="28.908447" :enable-scroll="true" :longitude="105.439304">
</map> -->
</view>
</view>
</template>
<script>
import {
getDetil
} from "@/api/logistics.js"
import {
takeGoods
} from "@/api/logistics.js"
var jpushModule = uni.requireNativePlugin("JG-JPush");
export default {
data() {
return {
a: "暂无",
flag: 0,
showLoading: true,
showPop: false,
goodsDetil: undefined,
scale: 15,
nowAddress: "无",
arr: [
{
latitude: 28.916022,
longitude: 105.442732,
},
{
latitude: 28.916848,
longitude: 105.443175,
},
{
latitude: 28.916918,
longitude: 105.443269,
},
{
latitude: 28.917041,
longitude: 105.443466,
},
{
latitude: 28.917073,
longitude: 105.443522,
},
{
latitude: 28.91705,
longitude: 105.443607,
},
{
latitude: 28.917057,
longitude: 105.443643,
},
{
latitude: 28.916925,
longitude: 105.443546,
},
{
latitude: 28.916796,
longitude: 105.443466,
},
{
latitude: 28.916615,
longitude: 105.443344,
},
{
latitude: 28.916437,
longitude: 105.443274,
},
{
latitude: 28.916356,
longitude: 105.443222,
},
{
latitude: 28.916515,
longitude: 105.442643,
},
{
latitude: 28.916591,
longitude: 105.442448,
},
{
latitude: 28.916944,
longitude: 105.442338,
},
{
latitude: 28.91706,
longitude: 105.442376,
},
{
latitude: 28.917169,
longitude: 105.442489,
},
{
latitude: 28.917345,
longitude: 105.442601,
},
{
latitude: 28.917433,
longitude: 105.442663,
},
{
latitude: 28.917461,
longitude: 105.442683,
},
{
latitude: 28.917461,
longitude: 105.442683,
},
{
latitude: 28.917518,
longitude: 105.442874,
},
{
latitude: 28.917537,
longitude: 105.443032,
},
{
latitude: 28.917537,
longitude: 105.443032,
},
{
latitude: 28.917497,
longitude: 105.443198,
},
{
latitude: 28.917409,
longitude: 105.443256,
},
{
latitude: 28.91732,
longitude: 105.443318,
},
{
latitude: 28.917234,
longitude: 105.443442,
},
{
latitude: 28.917072,
longitude: 105.443497,
},
{
latitude: 28.916977,
longitude: 105.443539,
},
{
latitude: 28.916867,
longitude: 105.443529,
},
{
latitude: 28.916867,
longitude: 105.443529,
},
{
latitude: 28.916761,
longitude: 105.443404,
},
{
latitude: 28.916722,
longitude: 105.443274,
},
{
latitude: 28.916762,
longitude: 105.443132,
},
],
markers: [
//
{
// 105.439304,28.908447
id: 1,
latitude: 28.916022,
longitude: 105.442732,
iconPath: '../../static/img/logistics/QS.png', //
width: 30,
height: 30,
},
//
{
id: 2,
latitude: 28.916762,
longitude: 105.443132,
iconPath: '../../static/img/logistics/SJ.png',
width: 20,
height: 20, //
}
],
polyline: [{ //
name: 'Track 1',
arrowLine: true,
color: '#27bd09e6',
width: 8,
id: 1,
points: [],
},
]
}
},
methods: {
test2() {
// #ifdef APP-PLUS
jpushModule.getRegistrationID(result => {
let registerID = result.registerID
console.log("设备----", result)
})
// #endif
},
test() {
let i = 0
let timer = setInterval(() => {
this.markers[0].latitude = this.arr[i].latitude
this.markers[0].longitude = this.arr[i].longitude
i++
console.log(i)
// this.polyline[0].points.push(this.arr[i])
this.$set(this.polyline[0].points, i, this.arr[i])
if (i >= this.arr.length) {
console.log(this.polyline[0].points)
clearInterval(timer)
}
}, 50)
},
//
//
locationFn() {
let that = this
uni.getLocation({
type: 'wgs84',
geocode: true,
isHighAccuracy: true,
success: function async (res) {
that.markers[1].latitude = res.latitude
that.markers[1].longitude = res.longitude
that.getDriverLine()
}
});
},
getDriverLine() {
const that = this;
const key = "997c9a3d88154fa78f4d28bebc1dd84f";
const origin = `${this.markers[1].longitude},${this.markers[1].latitude}`;
const destination = `${this.markers[0].longitude},${this.markers[0].latitude}`;
console.log(that.markers)
uni.request({
// url: `https://restapi.amap.com/v3/direction/walking?key=${key}&origin=105.43639400000002,28.908854&destination=105.439304,28.908447`,
url: `https:restapi.amap.com/v4/direction/bicycling?key=${key}&origin=${origin}&destination=${destination}`,
success: (res) => {
const data = res.data.data;
console.log(res.data)
var points = [];
if (data.paths && data.paths[0] && data.paths[0].steps) {
var steps = data.paths[0].steps;
for (var i = 0; i < steps.length; i++) {
//points
var poLen = steps[i].polyline.split(";");
for (var j = 0; j < poLen.length; j++) {
points.push({
longitude: parseFloat(poLen[j].split(",")[0]),
latitude: parseFloat(poLen[j].split(",")[1]),
});
}
}
that.runningRoute = data.paths[0].steps[0].instruction;
}
that.polyline = [{
points: points,
color: "#0091ff",
dottedLine: true,
width: 10,
}, ];
},
fail: function(res) {
console.log("获取路线失败", res);
},
});
},
},
onLoad() {
jpushModule.initJPushService()
console.log("初始化完成")
jpushModule.addConnectEventListener(result => {
let connectEnable = result.connectEnable //boolean
console.log("连接状态---", result)
})
// this.locationFn()
},
}
</script>

View File

@ -3,12 +3,13 @@
<view class="fast_track"> <view class="fast_track">
<block v-for="(item, index) in oaHomeData" :key="item.id"> <block v-for="(item, index) in oaHomeData" :key="item.id">
<view class="track_item" @click="navTo(item.paths)"> <view class="track_item" @click="navTo(item.paths)">
<image <u--image
:showLoading="true"
:src="item.icon" :src="item.icon"
mode="aspectFit" mode="widthFix"
style="width: 77rpx;height: 77rpx;" width="77.19rpx"
> height="77.19rpx"
</image> ></u--image>
<view class="title">{{ item.name }}</view> <view class="title">{{ item.name }}</view>
</view> </view>
</block> </block>

View File

@ -1,152 +1,128 @@
<template> <template>
<view class="all_box"> <view class="all_box">
<u-sticky bgColor="#0022C7"> <u-sticky bgColor="#0022C7">
<u-tabs :list="tabLists" @click="changeCurrent" lineColor='white' :scrollable="false" lineWidth='20' <u-tabs :list="tabLists" @click="changeCurrent" lineColor='white' :scrollable="false" lineWidth='20'
inactiveStyle='color:white' activeStyle="color:white"></u-tabs> inactiveStyle='color:white' activeStyle="color:white"></u-tabs>
</u-sticky> </u-sticky>
<u-tabs style="background-color: #fff;" :list="typeTabLists" @click="changeTypeCurrent" lineColor='#0022C7' lineWidth='40'
inactiveStyle='color:#0022C7' activeStyle="color:#0022C7"></u-tabs>
<view v-if="check_status==2||check_status==3" class="p_list">
<block v-for="(item,index) in list" :key="index">
<merchantAudit :datas="item"></merchantAudit>
</block>
</view>
<!-- {{typeTabLists}} --> <u-empty v-if="list.length==0&&loadConfig.status=='nomore'" icon="/static/img/empty/data.png"></u-empty>
<u-loadmore v-else :status="loadConfig.status" :loading-text="loadConfig.loadingText"
<u-tabs style="background-color: #fff;" :list="typeTabLists" @click="changeTypeCurrent" lineColor='#0022C7' :loadmore-text="loadConfig.loadmoreText" :nomore-text="loadConfig.nomoreText" />
lineWidth='40' inactiveStyle='color:#0022C7' activeStyle="color:#0022C7"></u-tabs> </view>
<view v-if="check_status==2||check_status==3" class="p_list">
<block v-for="(item,index) in list" :key="index">
<merchantAudit :datas="item"></merchantAudit>
</block>
</view>
<u-empty v-if="list.length==0&&loadConfig.status=='nomore'" icon="/static/img/empty/data.png"></u-empty>
<u-loadmore v-else :status="loadConfig.status" :loading-text="loadConfig.loadingText"
:loadmore-text="loadConfig.loadmoreText" :nomore-text="loadConfig.nomoreText" />
</view>
</template> </template>
<script> <script>
import { import { Toast } from '@/libs/uniApi.js'
Toast import { approveLists, approveTypes } from "@/api/approve.js"
} from '@/libs/uniApi.js' import merchantAudit from '@/components/merchantAudit/merchantAudit.vue'
import { export default {
approveLists, components: {
approveTypes merchantAudit
} from "@/api/approve.js" },
import merchantAudit from '@/components/merchantAudit/merchantAudit.vue' data() {
export default { return {
components: { tabLists: [{
merchantAudit name: '全部',
}, }, {
data() { name: '审核中',
return { }, {
tabLists: [{ name: '已通过'
name: '审核中', }, {
id: 1 name: '未通过'
}, { }, ],
name: '已通过', typeTabLists: [],
id: 2 current: 0,
}, { typeCurrent: 0,
name: '未通过', check_status: 0,
id: 3 list: [],
}, { loadConfig: {
name: '全部', page: 1,
id: 0 limit: 15,
}, ], lastpage: '',
typeTabLists: [], loadingText: '努力加载中',
current: 0, loadmoreText: '轻轻上拉',
currentID: 1, // ,,, nomoreText: '我也是有底线的~~',
typeCurrent: 0, status: 'loadmore'
check_status: 0, // },
list: [], }
loadConfig: { },
page: 1, onLoad() {
limit: 10, this.initType();
lastpage: '', },
loadingText: '努力加载中', onShow() {
loadmoreText: '轻轻上拉', },
nomoreText: '我也是有底线的~~', async onPullDownRefresh() {
status: 'loadmore' await this.initList();
}, this.$u.sleep(200).then(()=>{
} uni.stopPullDownRefresh();
}, })
onLoad() { },
this.initType(); onReachBottom() {
uni.$on('initMerchant', this.initList); this.loadList();
}, },
onShow() { methods: {
if (this.typeTabLists.length > 0) { async initType(){
this.loadConfig.page = 1; let res = await approveTypes();
this.loadConfig.status = "loading"; res.data.forEach((item)=>{
this.list = []; this.typeTabLists.push({
this.$u.sleep(200).then(() => { id: item.id,
this.loadList(); name: item.title
}) })
} })
}, this.check_status = this.typeTabLists[0].id;
async onPullDownRefresh() { this.$nextTick(()=>{
await this.initList(); this.initList();
this.$u.sleep(200).then(() => { })
uni.stopPullDownRefresh(); },
}) async initList(){
}, this.loadConfig.page = 1;
onReachBottom() { this.loadConfig.status = "loadmore";
this.loadList(); this.list = [];
}, await this.loadList();
methods: { },
async initType() { async loadList(){
let res = await approveTypes(); if (this.loadConfig.status == "nomore") return;
res.data.forEach((item) => { this.loadConfig.status = "loading";
if (item.id != 1) this.typeTabLists.push({ let query = {
id: item.id, type: this.check_status,
name: item.title page: this.loadConfig.page,
}) limit: this.loadConfig.limit
}) }
this.check_status = this.typeTabLists[0].id; this.current?query.check_status=this.current:null;
this.$nextTick(() => { let res = await approveLists(query);
this.initList(); this.loadConfig.status = "loadmore"
}) if (res.data.lists.length < this.loadConfig.limit) {
}, this.loadConfig.status = "nomore"
async initList() { } else {
this.loadConfig.page = 1; this.loadConfig.page++;
this.loadConfig.status = "loadmore"; }
this.list = []; this.list = [...this.list, ...res.data?.lists];
await this.loadList(); },
}, changeCurrent(e) {
async loadList() { this.current = e.index;
if (this.loadConfig.status == "nomore") return; this.initList();
this.loadConfig.status = "loading"; },
let query = { changeTypeCurrent(e) {
type: this.check_status, this.typeCurrent = e.index;
page: this.loadConfig.page, this.check_status = e.id;
limit: this.loadConfig.limit this.initList();
} },
this.currentID ? query.check_status = this.currentID : null; },
let res = await approveLists(query); }
this.loadConfig.status = "loadmore"
if (res.data.lists.length < this.loadConfig.limit) {
this.loadConfig.status = "nomore"
} else {
this.loadConfig.page++;
}
this.list = [...this.list, ...res.data?.lists];
},
changeCurrent(e) {
this.current = e.index;
this.currentID = e.id;
this.initList();
},
changeTypeCurrent(e) {
this.typeCurrent = e.index;
this.check_status = e.id;
this.initList();
},
},
}
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.all_box { .all_box {
padding-bottom: 21rpx; padding-bottom: 21rpx;
} }
.p_list{
.p_list { padding-top: 28rpx;
padding-top: 28rpx; }
}
</style> </style>

File diff suppressed because it is too large Load Diff

View File

@ -1,10 +1,10 @@
<template> <template>
<view class="login"> <view class="login">
<!-- <image class="bg-iamge" src="../../static/img/login/login_back_img.png"></image> --> <!-- <image class="bg-iamge" src="../../static/img/login/login_back_img.png"></image> -->
<hx-lottie :options="options" ref="lottie" <hx-lottie :options="options" ref="lottie" style="width: 100vw;height: 100vh;transform: scale(1.3);background-color: #0122c7;"/>
style="width: 100vw;height: 100vh;transform: scale(1.3);background-color: #0122c7;" /> <u-navbar v-if="uniMP" @leftClick="leftClick" bgColor="rgba(0,0,0,0)"
<u-navbar v-if="uniMP" @leftClick="leftClick" bgColor="rgba(0,0,0,0)" leftIconColor=" #fff" :autoBack="false"> leftIconColor=" #fff" :autoBack="false">
</u-navbar> </u-navbar>
<!-- #ifdef APP-PLUS||H5 --> <!-- #ifdef APP-PLUS||H5 -->
<!-- <view style="height: var(--status-bar-height)"></view> --> <!-- <view style="height: var(--status-bar-height)"></view> -->
<!-- #endif --> <!-- #endif -->
@ -18,10 +18,10 @@
</view> </view>
<input @click="getId" class="mobile item" v-model="formData.account" type="tel" <input @click="getId" class="mobile item" v-model="formData.account" type="tel"
placeholder="输入账号" /> placeholder="输入账号" />
<input style="width: 0;height: 0;opacity: 0;margin: 0;padding: 0;" v-model="formData.account" <input style="width: 0;height: 0;opacity: 0;margin: 0;padding: 0;" v-model="formData.account" type="tel"
type="tel" placeholder="输入账号" /> placeholder="输入账号" />
<input @click="getId" class="mobile item" v-model="formData.password" maxlength="26" <input @click="getId" class="mobile item" v-model="formData.password"
placeholder="输入密码" password type="safe-password" /> maxlength="26" placeholder="输入密码" password type="safe-password" />
<!-- <input v-if="current == 1" class="mobile item" v-model="formData.account" placeholder="输入手机号" /> <!-- <input v-if="current == 1" class="mobile item" v-model="formData.account" placeholder="输入手机号" />
<view v-if="current == 1" class="code item"> <view v-if="current == 1" class="code item">
<input placeholder="输入验证码" v-model="formData.code" maxlength="6" /> <input placeholder="输入验证码" v-model="formData.code" maxlength="6" />
@ -42,14 +42,12 @@
loginAccount, loginAccount,
userInfo userInfo
} from "@/api/oaUser.js" } from "@/api/oaUser.js"
import { import { getConfig } from "@/api/config.js";
getConfig
} from "@/api/config.js";
import { import {
Toast Toast
} from "../../libs/uniApi"; } from "../../libs/uniApi";
import bj from "@/static/animation/bj2.json" import bj from "@/static/animation/bj2.json"
import encrypt from "@/utils/encrypt.js" import encrypt from "@/utils/encrypt.js"
// #ifdef APP-PLUS // #ifdef APP-PLUS
var jpushModule = uni.requireNativePlugin("JG-JPush"); var jpushModule = uni.requireNativePlugin("JG-JPush");
@ -58,11 +56,11 @@
export default { export default {
data() { data() {
return { return {
options: { options: {
data: '', data: '',
}, },
uniMP: false, uniMP: false,
APP_token: '', APP_token: '',
tabList: [{ tabList: [{
name: '账号登录' name: '账号登录'
}, },
@ -76,33 +74,33 @@
terminal: 6, //6APP terminal: 6, //6APP
scene: 1, scene: 1,
register_id: "", register_id: "",
shop_token: "" shop_token: ""
}, },
tips: '获取验证码', tips: '获取验证码',
// refCode: null, // refCode: null,
seconds: 60, seconds: 60,
}; };
}, },
onLoad() { onLoad() {
this.APP_token = uni.getStorageSync('APP_token'); this.APP_token = uni.getStorageSync('APP_token');
this.options.data = bj; this.options.data = bj;
// this.$refs.lottie.call('play'); // this.$refs.lottie.call('play');
this.initTerminal(); this.initTerminal();
}, },
onShow() { onShow() {
if (uni.getStorageSync('uniMP')) this.uniMP = true; if(uni.getStorageSync('uniMP'))this.uniMP = true;
}, },
methods: { methods: {
changeTabs(e) { changeTabs(e) {
this.current = e.index; this.current = e.index;
this.formData.scene = e.index + 1; this.formData.scene = e.index + 1;
}, },
leftClick(e) { leftClick(e) {
uni.sendHostEvent('closeApp', e, (ret) => { uni.sendHostEvent('closeApp', e, (ret) => {
// //
console.log('关闭应用' + JSON.stringify(ret)); console.log('关闭应用'+JSON.stringify(ret));
}); });
}, },
// id // id
getId() { getId() {
// #ifdef APP-PLUS // #ifdef APP-PLUS
@ -120,13 +118,13 @@
if (!this.formData.account) return Toast('账号不能为空'); if (!this.formData.account) return Toast('账号不能为空');
if (this.formData.scene == 1 && !this.formData.password) return Toast('密码不能为空'); if (this.formData.scene == 1 && !this.formData.password) return Toast('密码不能为空');
if (this.formData.scene == 2 && !this.formData.code) return Toast('验证码不能为空'); if (this.formData.scene == 2 && !this.formData.code) return Toast('验证码不能为空');
this.formData.shop_token = uni.getStorageSync('APP_token'); this.formData.shop_token = uni.getStorageSync('APP_token');
let that = this; let that = this;
uni.showLoading({ uni.showLoading({
title: '正在登录中' title: '正在登录中'
}) })
let res = await loginAccount(that.formData); let res = await loginAccount(that.formData);
encrypt.encode('ACT', that.formData); encrypt.encode('ACT', that.formData);
this.$store.commit('SET_USERINFO', { this.$store.commit('SET_USERINFO', {
user: data, user: data,
token: res.data.token token: res.data.token
@ -135,8 +133,8 @@
data data
} = await userInfo(); } = await userInfo();
this.$store.commit('setUserInfo', data); this.$store.commit('setUserInfo', data);
let config = await getConfig(); let config = await getConfig();
this.$store.commit('SET_CONFIG', config.data); this.$store.commit('SET_CONFIG', config.data);
uni.hideLoading() uni.hideLoading()
if (data.is_new_user) { if (data.is_new_user) {
uni.showLoading({ uni.showLoading({
@ -152,13 +150,13 @@
} }
}) })
// #endif // #endif
return uni.reLaunch({ return uni.reLaunch({
url: '/pages/oaHome/oaHome', url: '/pages/oaHome/oaHome',
success: () => { success: () => {
uni.$emit('initOaTask'); // uni.$emit('initOaTask'); //
uni.hideLoading() uni.hideLoading()
} }
}) })
} else uni.navigateTo({ } else uni.navigateTo({
url: '/pages/updatePassword/updatePassword' url: '/pages/updatePassword/updatePassword'
}); });
@ -225,7 +223,7 @@
width: 100vw; width: 100vw;
height: 100vh; height: 100vh;
position: relative; position: relative;
overflow: hidden; overflow: hidden;
background-color: $theme-oa-color; background-color: $theme-oa-color;
/* #ifdef H5 */ /* #ifdef H5 */
// background-image: url("../../static/img/login/login_back_img.png"); // background-image: url("../../static/img/login/login_back_img.png");
@ -240,10 +238,10 @@
// } // }
.body { .body {
position: absolute; position: absolute;
top: 45%; top: 45%;
left: 50%; left: 50%;
transform: translate(-50%, -50%); transform: translate(-50%, -50%);
display: flex; display: flex;
flex-direction: column; flex-direction: column;
align-items: center; align-items: center;
@ -260,9 +258,9 @@
-webkit-background-clip: text; -webkit-background-clip: text;
} }
::v-deep uni-input { ::v-deep uni-input{
min-height: 0 !important; min-height: 0 !important;
} }
.login-card { .login-card {
width: 694rpx; width: 694rpx;

View File

@ -1,133 +1,77 @@
<template> <template>
<view class="all_box"> <view class="all_box">
<block v-if="skeleton"> <block v-if="skeleton">
<u-skeleton :loading="skeleton" :animate="true" title rows="2" rows-width="100%" rowsHeight="40" <u-skeleton :loading="skeleton" :animate="true" title rows="2" rows-width="100%"
v-for="i in 3" :key="i" style="padding: 28rpx;"> rowsHeight="40" v-for="i in 3" :key="i" style="padding: 28rpx;">
</u-skeleton> </u-skeleton>
</block> </block>
<block v-else> <block v-else>
<u-tabs style="background-color: #0022C7;" :list="tabLists" @click="changeTypeCurrent" lineColor='white' <u-empty v-if="list.length==0" icon="/static/img/empty/data.png" text="没有任务"></u-empty>
lineWidth='30' inactiveStyle='color:white' activeStyle="color:white"></u-tabs> <view v-else class="task_list">
<u-empty v-if="list.length==0" icon="/static/img/empty/data.png" text="没有任务"></u-empty> <!-- <taskCard class="task_card" v-for="item in 10" :key="item"></taskCard> -->
<task-item :datas="item" v-for="item in list" :key="item.id"></task-item>
<view v-else class="task_list"> </view>
</block>
<!-- <u-loadmore v-else :status="loadConfig.status" :loading-text="loadConfig.loadingText"
<!-- <taskCard class="task_card" v-for="item in 10" :key="item"></taskCard> -->
<view class="" v-if="baseList.length">
<task-item :datas="item" :taskValueList='taskValueList' v-for="item in baseList"
:key="item.id"></task-item>
</view>
<view class="" v-else>
<u-empty icon="/static/img/empty/data.png" text="没有任务"></u-empty>
</view>
</view>
</block>
<!-- <u-loadmore v-else :status="loadConfig.status" :loading-text="loadConfig.loadingText"
:loadmore-text="loadConfig.loadmoreText" :nomore-text="loadConfig.nomoreText" /> --> :loadmore-text="loadConfig.loadmoreText" :nomore-text="loadConfig.nomoreText" /> -->
</view> </view>
</template> </template>
<script> <script>
import { import { getTaskListApi } from '@/api/oa'
getTaskListApi import { Toast } from '@/libs/uniApi.js'
} from '@/api/oa' import taskItem from "@/components/task/taskItem.vue"
import { import { taskLists } from "@/api/task.js"
Toast export default {
} from '@/libs/uniApi.js' components:{
import taskItem from "@/components/task/taskItem.vue" taskItem
import { },
taskLists data() {
} from "@/api/task.js" return {
import { skeleton: false,
dictDataListsTypeValue loadConfig:{
} from "@/api/oaPbulic.js" page: 1,
export default { limit: 15,
components: { lastpage: '',
taskItem loadingText: '努力加载中',
}, loadmoreText: '轻轻上拉',
data() { nomoreText: '我也是有底线的~~',
return { status: 'loadmore'
status: 2, },
skeleton: false, list: []
baseList: [], }
tabLists: [{ },
name: '进行中', onLoad() {
id: 2 this.skeleton = true;
}, { },
name: '已完成', onShow() {
id: 3 this.loadList();
}, ], },
loadConfig: { onReady() {
page: 1, uni.$on('initOaTask', this.loadList);
limit: 15, },
lastpage: '', methods: {
loadingText: '努力加载中', async loadList(){
loadmoreText: '轻轻上拉', let res = await taskLists({limit: 15, page: 1});
nomoreText: '我也是有底线的~~', this.list = res.data;
status: 'loadmore' this.skeleton = false;
}, }
list: [], },
taskValueList: [], onPullDownRefresh() {
this.loadList();
} this.$u.sleep(500).then(()=>{uni.stopPullDownRefresh()});
}, },
onLoad() { onReachBottom() {
this.skeleton = true; },
}
},
onShow() {
this.loadList();
// this.getTaskValue()
},
onReady() {
uni.$on('initOaTask', this.loadList);
},
methods: {
// async getTaskValue() {
// const desiredElement = this.roleList.find(element => element.id == this.$store.state.app.userInfo
// .group_id);
// let res = await dictDataListsTypeValue({
// type_value: desiredElement.type_vale
// })
// this.taskValueList = res.data
// },
changeTypeCurrent(e) {
this.baseList = []
this.status = e.id
this.baseList = this.list.filter(item => item.status == this.status)
},
async loadList() {
let res = await taskLists({
limit: 15,
page: 1
});
this.list = res.data;
this.baseList = this.list.filter(item => item.status == this.status)
this.skeleton = false;
}
},
onPullDownRefresh() {
this.loadList();
this.$u.sleep(500).then(() => {
uni.stopPullDownRefresh()
});
},
onReachBottom() {},
}
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.task_list { .task_list{
padding-top: 28rpx; padding-top: 28rpx;
} }
.loading{
.loading { padding: 28rpx;
padding: 28rpx; margin-top: 28rpx;
margin-top: 28rpx; }
}
</style> </style>

View File

@ -1,19 +1,19 @@
<template> <template>
<view style="padding: 28rpx 0;"> <view style="padding: 28rpx 0;">
<view class="other_guide"> <view class="other_guide">
<block v-for="(item,i) in myOaData" :key="i"> <block v-for="(item,i) in myOaData" :key="i">
<view class="other_item flex_a_c_j_sb" @click="clickItem(item)"> <view class="other_item flex_a_c_j_sb" @click="clickItem(item)">
<view class="flex_a_c left"> <view class="flex_a_c left">
<!-- <view class="iconfont2" :class="item.icon"></view> --> <!-- <view class="iconfont2" :class="item.icon"></view> -->
<image v-if="item.icon" :src="item.icon"></image> <image v-if="item.icon" :src="item.icon"></image>
<view class="text">{{ item.name }}</view> <view class="text">{{ item.name }}</view>
</view> </view>
<view style="display: flex;align-items: center;"> <view style="display: flex;align-items: center;">
<view v-if="i==0">{{version}}</view> <view v-if="i==0">{{version}}</view>
<uni-icons type="forward"></uni-icons> <uni-icons type="forward"></uni-icons>
</view> </view>
</view> </view>
</block> </block>
</view> </view>
<view class="us" @click="copyPhone"> <view class="us" @click="copyPhone">
<view>联系我们</view> <view>联系我们</view>
@ -23,12 +23,13 @@
</template> </template>
<script> <script>
import { Toast } from '../../libs/uniApi'; import { Toast } from '../../libs/uniApi';
import { destroyAccount } from '@/api/oaUser.js'; import { destroyAccount } from '@/api/oaUser.js';
export default { export default {
data() { data() {
return { return {
myOaData: [{ myOaData: [
{
name: '版本更新' name: '版本更新'
}, },
{ {
@ -42,10 +43,6 @@
name: '用户协议', name: '用户协议',
url: 'https://worker-task.lihaink.cn/pc/policy/service' url: 'https://worker-task.lihaink.cn/pc/policy/service'
}, },
{
name: '投诉反馈',
url: '/subpkg/complaint/complaint'
},
{ {
name: '联系我们' name: '联系我们'
}, },
@ -56,41 +53,26 @@
}, },
onLoad() { onLoad() {
let os = uni.getSystemInfoSync(); let os = uni.getSystemInfoSync();
this.version = 'v' + (os?.appWgtVersion || os?.appVersion); this.version = 'v' + (os?.appWgtVersion||os?.appVersion);
}, },
methods: { methods:{
clickItem(e) { clickItem(e){
switch (e.name) { switch(e.name){
case '版本更新': case '版本更新': this.updateVersion();break;
this.updateVersion(); case '注销账户': this.unsubscribe();break;
break; case '联系我们': this.connectUs();break;
case '注销账户': case '隐私政策': this.navToWebView(e.url,'隐私政策');break;
this.unsubscribe(); case '用户协议': this.navToWebView(e.url,'用户协议');break;
break;
case '联系我们':
this.connectUs();
break;
case '隐私政策':
this.navToWebView(e.url, '隐私政策');
break;
case '用户协议':
this.navToWebView(e.url, '用户协议');
break;
case '投诉反馈':
uni.navigateTo({
url: e.url
});
break;
} }
}, },
updateVersion() { updateVersion(){
this.$store.dispatch('initConfig', true); this.$store.dispatch('initConfig', true);
}, },
async unsubscribe() { async unsubscribe(){
uni.showModal({ uni.showModal({
content: '注销账号后不可恢复,确认要注销吗?', content: '注销账号后不可恢复,确认要注销吗?',
success: async (e) => { success: async (e)=> {
if (e.confirm) { if(e.confirm){
let res = await destroyAccount(); let res = await destroyAccount();
uni.reLaunch({ uni.reLaunch({
url: '/pages/oaLogin/oaLogin' url: '/pages/oaLogin/oaLogin'
@ -99,7 +81,7 @@
} }
}) })
}, },
connectUs() { connectUs(){
// //
uni.makePhoneCall({ uni.makePhoneCall({
phoneNumber: this.us + "", phoneNumber: this.us + "",
@ -112,7 +94,7 @@
} }
}); });
}, },
copyPhone() { copyPhone(){
// //
uni.setClipboardData({ uni.setClipboardData({
data: this.us + "", data: this.us + "",
@ -125,9 +107,9 @@
} }
}) })
}, },
navToWebView(uri, title) { navToWebView(uri, title){
uni.navigateTo({ uni.navigateTo({
url: `/pages/webView/webView?title=${title}&uri=${uri}` url:`/pages/webView/webView?title=${title}&uri=${uri}`
}) })
} }
} }
@ -135,38 +117,38 @@
</script> </script>
<style lang="scss"> <style lang="scss">
.other_guide { .other_guide {
width: 694.74rpx; width: 694.74rpx;
margin: 0 auto; margin: 0 auto;
padding: 28.07rpx; padding: 28.07rpx;
background-color: #fff; background-color: #fff;
border-radius: 12px; border-radius: 12px;
.other_item { .other_item {
height: 87.72rpx; height: 87.72rpx;
border-bottom: 1px solid #F0F5F7; border-bottom: 1px solid #F0F5F7;
.text { .text {
font-size: 28.07rpx; font-size: 28.07rpx;
margin-left: 20.56rpx; margin-left: 20.56rpx;
} }
.left { .left {
align-items: center; align-items: center;
} }
image { image {
width: 42rpx; width: 42rpx;
height: 42rpx; height: 42rpx;
} }
.iconfont2 { .iconfont2 {
font-size: 42.11rpx; font-size: 42.11rpx;
} }
} }
} }
.us { .us{
margin: 60rpx 0; margin: 60rpx 0;
text-align: center; text-align: center;
color: #aaa; color: #aaa;

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.7 KiB

Binary file not shown.

Binary file not shown.

View File

@ -33,8 +33,6 @@ const mutations = {
state.token = null; state.token = null;
Cache.clear('USER_INFO') Cache.clear('USER_INFO')
Cache.clear('TOKEN') Cache.clear('TOKEN')
uni.clearStorageSync()
}, },
UPDATE_USERINFO(state, data) { UPDATE_USERINFO(state, data) {
let time = res.data.result.expires_time - Cache.time(); let time = res.data.result.expires_time - Cache.time();
@ -61,6 +59,7 @@ const actions = {
RE_LOGIN({ state, commit }, data) { RE_LOGIN({ state, commit }, data) {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
let fromData = encrypt.decode('ACT'); let fromData = encrypt.decode('ACT');
console.log(fromData);
if(fromData) { if(fromData) {
loginAccount({ ...fromData }, true).then((res) => { loginAccount({ ...fromData }, true).then((res) => {
commit('SET_TOKEN', res.data); commit('SET_TOKEN', res.data);

View File

@ -25,8 +25,7 @@ function compareVersions(version1, version2) {
const state = { const state = {
eyeType: Cache.get('eyeType') || true, // 小眼睛 eyeType: Cache.get('eyeType') || true, // 小眼睛
request: Cache.get('request') || true, // 网络请求 request: Cache.get('request') || true, // 网络请求
config: JSON.parse(Cache.get('config')||'{}'), config: JSON.parse(Cache.get('config')||'{}')
updateFlag: true
}; };
const mutations = { const mutations = {
@ -41,10 +40,7 @@ const mutations = {
SET_CONFIG(state, data){ SET_CONFIG(state, data){
state.config = {...data}; state.config = {...data};
Cache.set('config', JSON.stringify(state.config)); Cache.set('config', JSON.stringify(state.config));
}, }
SET_UPDATEFLAG(state, data){
state.updateFlag = data;
},
}; };
const actions = { const actions = {
@ -52,7 +48,7 @@ const actions = {
let res = await getConfig(); let res = await getConfig();
commit('SET_CONFIG', res.data); commit('SET_CONFIG', res.data);
// console.log(compareVersions(res.data.version, '1.0.0')==1&&compareVersions(res.data.version, Cache.get('wgt_version'))==1); // console.log(compareVersions(res.data.version, '1.0.0')==1&&compareVersions(res.data.version, Cache.get('wgt_version'))==1);
if(uni.getStorageSync('uniMP')||!state.updateFlag) return ;//是小程序环境时不进行更新 if(uni.getStorageSync('uniMP')) return ;//是小程序环境时不进行更新
let os = uni.getSystemInfoSync(); let os = uni.getSystemInfoSync();
// uni.showModal({ // uni.showModal({
// title: `当前:${os.appVersion},WGT:${Cache.get('wgt_version')},返回:${res.data.version}` // title: `当前:${os.appVersion},WGT:${Cache.get('wgt_version')},返回:${res.data.version}`
@ -62,7 +58,6 @@ const actions = {
title: '检查更新中' title: '检查更新中'
}) })
const wgt_v = uni.getStorageSync('wgt_version')||'1.0.0'; const wgt_v = uni.getStorageSync('wgt_version')||'1.0.0';
commit('SET_UPDATEFLAG', false);
// 版本更新 // 版本更新
if(compareVersions(res.data.version, os.appWgtVersion||wgt_v)==1&&compareVersions(res.data.version, wgt_v)==1){ if(compareVersions(res.data.version, os.appWgtVersion||wgt_v)==1&&compareVersions(res.data.version, wgt_v)==1){
try{ try{

View File

@ -1,320 +1,90 @@
<template> <template>
<view style="padding-top: 28rpx;padding-bottom: 160rpx;"> <view style="padding-top: 28rpx;padding-bottom: 160rpx;">
<view class="card"> <view class="card">
<view class="title">任务名称: {{task.title}}</view> <view class="title">任务名称: {{task.title}}</view>
<u-line style="margin: 14rpx 0;"></u-line> <u-line style="margin: 14rpx 0;"></u-line>
<!-- <view class="text">阶段类型: 单次</view> --> <!-- <view class="text">阶段类型: 单次</view> -->
<view class="text" style="color: #FF7C32;" v-if="task.extend&&task.extend.shareholder">入股金额: <view class="text" style="color: #FF7C32;" v-if="task.extend&&task.extend.shareholder">入股金额: {{task.extend.shareholder.money}}</view>
{{task.extend.shareholder.money}} </view>
</view> <view class="card">
</view> <view class="title">任务描述</view>
<view class="card"> <u-line style="margin: 14rpx 0;"></u-line>
<view class="title">任务描述</view> <view class="text">{{task.content||'暂无任务描述'}}</view>
<u-line style="margin: 14rpx 0;"></u-line> </view>
<view class="text">{{task.content||'暂无任务描述'}}</view> <view class="card">
</view> <view class="title">事件记录</view>
<view class="card"> <u-line style="margin: 14rpx 0;"></u-line>
<view class="title">事件记录</view> <u-steps v-if="task.extend&&task.extend.shareholder" :current="-1" direction="column" activeColor="#0122c7" dot inactiveColor="#0122c7">
<u-line style="margin: 14rpx 0;"></u-line> <u-steps-item v-for="(item, index) in task.extend.shareholder.user_list" :title="item.time" :desc="item.info">
<u-steps v-if="task.extend&&task.extend.shareholder" :current="-1" direction="column" activeColor="#0122c7" </u-steps-item>
dot inactiveColor="#0122c7"> </u-steps>
<u-steps-item v-for="(item, index) in task.extend.shareholder.user_list" :title="item.time" </view>
:desc="item.info"> <view class="card">
</u-steps-item> <view class="title">温馨提示</view>
</u-steps> <u-line style="margin: 14rpx 0;"></u-line>
</view> <view class="text" style="color: #FF7C32;">入股的金额将在次日凌晨更新到"股金管理"请于次日打开"股金管理"页面查看详情</view>
<view class="card" v-if="task.approve_status==3"> </view>
<view class="title" style="color: #FF7C32;">驳回提示</view> <mybtn v-if="task.status!=3 && task.status!=5" text="前往支付页面" @click="navTo(`/subpkg/topUp/topUp?task_id=${task_id}`)"></mybtn>
<u-line style="margin: 14rpx 0;"></u-line> <mybtn v-else :text="task.status==3?'已完成任务':'任务已关闭'" :my_btn_disabled="true"></mybtn>
<view class="text" style="color: #FF7C32;">{{task.deny_notes}}</view> </view>
<!-- <button v-if="other.is_commit==1" class="btn" @click="toUpdate">去修改</button> -->
</view>
<view class="card">
<view class="title">附件上传</view>
<u-line style="margin: 14rpx 0;"></u-line>
<view class="" style="display: flex;align-items: center;">
<text style="margin-right: 10rpx;">金额:</text>
<view class="" style="width: 500rpx;">
<u--input style="border: 1px solid #CCCCCC;" :readonly='isDisabled && task.approve_status!=3'
placeholder="请输入金额" type='number' border="surround" v-model="amount"></u--input>
</view>
</view>
<view class="" :class="{hide:file}" v-if="!isDisabled || task.approve_status==3">
<view class="" :class="{hide:progress!=0}">
<lsjUpload ref="lsjUpload" childId="upload1" :size="10" :option="fileOption" height="200rpx"
style="margin-top: 28rpx;" :debug="false" :formats="'png,jpg,jpeg,pdf,webp'" :multiple="false"
:count="1" :instantly="false" @change="changeFile" @uploadEnd="onuploadEnd"
@progress="onprogress">
<view class="change-file">上传凭证</view>
</lsjUpload>
</view>
<view style="margin-top: 20rpx;" v-if="progress>0">
<u-loading-icon :text=" '正在上传中'+ progress+'%'" textSize="18"></u-loading-icon>
</view>
</view>
<view class="file" v-if='file'>
<view class="">
<image :src="local_src||file" style="width: 150rpx;height: 150rpx;margin-right: 12rpx;"
v-if="file_type=='image'">
</image>
<image src="@/static/img/contract/pdf.png" style="width: 150rpx;height: 150rpx;margin-right: 12rpx;"
v-else>
</image>
</view>
<view class="r-cont">
<view class="">
{{fileTit}}
</view>
<view class="" style="display: flex;">
<view class="" style="color: blue;margin-right: 10rpx;" @click="navToContract">
查看
</view>
<view class="" style="color: red;" @click="delFn" v-if="!isDisabled ||task.approve_status==3">
删除
</view>
</view>
</view>
</view>
<!-- <button @click='uplodeFileFn'>点击上传附件</button> -->
<!-- <image class="contract_img" src="@/static/img/contract/pdf.png"></image> -->
<!-- <view class="text">
<view class="name">{{item.contract_type_name||'合同'}}</view>
<view>
<text>{{item.update_time}}</text>
</view>
</view> -->
<!-- <view class="text" style="color: #FF7C32;">入股的金额将在次日凌晨更新到"股金管理"请于次日打开"股金管理"页面查看详情</view> -->
</view>
<!-- <mybtn v-if="task.status!=3 && task.status!=5" text="前往支付页面"
@click="navTo(`/subpkg/topUp/topUp?task_id=${task_id}`)"></mybtn>
<mybtn v-else :text="task.status==3?'已完成任务':'任务已关闭'" :my_btn_disabled="true"></mybtn> -->
<mybtn v-if="!isDisabled" text="提交" @click="submitFn"></mybtn>
<mybtn v-else-if="task.approve_status==3" text="已驳回,请重新提交" @click="submitFn"></mybtn>
<mybtn v-else-if='task.status==3' text="已完成任务" :my_btn_disabled="true"></mybtn>
<mybtn v-else-if="isDisabled" text="任务已经提交" :my_btn_disabled="true"></mybtn>
</view>
</template> </template>
<script> <script>
import { import { taskShareholder } from "@/api/task.js"
taskShareholder, export default {
commit_service_group_taskAPI data() {
} from "@/api/task.js" return {
import lsjUpload from '@/uni_modules/lsj-upload/components/lsj-upload/lsj-upload.vue' task:{},
import { task_id: -1,
FILE_URL, };
IMG_URL },
} from '@/api/file.js' onLoad(options) {
import { this.task_id = options.task_id;
Toast this.loadTask();
} from "../../libs/uniApi"; uni.$on('upBuyShare', this.loadTask);
},
export default { methods:{
components: { async loadTask(){
lsjUpload let res = await taskShareholder({
}, id: this.task_id
data() { });
return { this.task = res.data;
progress: 0, },
imgTypeList: ["png", "jpg", "jpeg", "webp"], navTo (url) {
isDisabled: false, if(url){
amount: "", uni.showLoading({
fileOption: {}, title: '加载中',
task: {}, mask: true
task_id: -1, });
file: "", uni.navigateTo({
local_src: "", url: url,
fileTit: "", success() {
file_type: "pdf", uni.hideLoading()
}; }
}, })
onLoad(options) { }else Toast('暂未开放')
this.task_id = options.task_id; },
this.loadTask(); }
uni.$on('upBuyShare', this.loadTask); }
this.fileOption = {
url: FILE_URL,
name: 'file',
header: {
token: this.$store.state.app.token
}
}
},
methods: {
navToContract() {
let fileSrc = this.file
if (this.file_type == 'image') {
uni.previewImage({
urls: [fileSrc]
})
} else {
uni.navigateTo({
url: `/subpkg/pdfView/pdfView?url=${fileSrc}`
})
}
},
async submitFn() {
if (!this.amount) return Toast("请输入金额")
if (Number(this.amount) < Number(this.task.extend.shareholder.money)) return Toast("未达到目标入股金额,无法提交")
let data = {
id: this.task_id,
annex: this.file,
amount: this.amount,
file_type: this.file_type
}
let res = await commit_service_group_taskAPI({
...data
})
Toast("操作成功!")
setTimeout(() => {
uni.navigateBack()
}, 1000)
},
delFn() {
if (this.task.approve_status != 3) this.clear()
this.file = ""
this.file_type = "pdf"
this.progress = 0
},
clear() {
this.$refs.lsjUpload.clear();
},
/**
* 某文件上传结束回调(成功失败都回调)
* @param {Object} item 当前上传完成的文件
*/
onuploadEnd(item) {
let res = JSON.parse(item.responseText)
this.file = res.data.uri
this.fileTit = res.data.name
this.$forceUpdate();
},
/**
* 上传进度回调
* 如果网页上md文档没有渲染出事件名称onprogre请复制代码的小伙伴自行添加上哈没有哪个事件是只(item)
* @param {Object} item 当前正在上传的文件
*/
onprogress(item) {
this.progress = item.progress
},
/**
* 文件选择回调
* @param {Object} files 已选择的所有文件Map集合
*/
async changeFile(files) {
let type = [...files.values()][0]?.name || null
if (!type) return
let isImage = null
this.imgTypeList.forEach(item => {
if (type.includes(item)) {
isImage = true
this.file_type = 'image'
}
})
this.local_src = [...files.values()][0].path
if (isImage) {
this.$refs.lsjUpload.setData("url", IMG_URL)
} else {
this.$refs.lsjUpload.setData("url", FILE_URL)
}
this.$refs.lsjUpload.upload()
//
this.files = files;
//
this.$forceUpdate();
},
async loadTask() {
let res = await taskShareholder({
id: this.task_id
});
this.task = res.data;
if (this.task.extend.is_commit == 1) {
this.file = this.task.extend.annex
this.file_type = this.task.extend.file_type
this.amount = this.task.extend.amount || 0
this.fileTit = "附件"
this.isDisabled = true
}
},
navTo(url) {
if (url) {
uni.showLoading({
title: '加载中',
mask: true
});
uni.navigateTo({
url: url,
success() {
uni.hideLoading()
}
})
} else Toast('暂未开放')
},
}
}
</script> </script>
<style lang="scss"> <style lang="scss">
.card { .card {
margin: 0 auto; margin: 0 auto;
margin-bottom: 28rpx; margin-bottom: 28rpx;
width: 694rpx; width: 694rpx;
background: #FFFFFF; background: #FFFFFF;
border-radius: 14rpx; border-radius: 14rpx;
padding: 28rpx; padding: 28rpx;
.title { .title {
font-size: 32rpx; font-size: 32rpx;
font-weight: bold; font-weight: bold;
color: #333333; color: #333333;
} }
.text { .text {
line-height: 50rpx; line-height: 50rpx;
} }
} }
.contract_img {
width: 102rpx;
height: 102rpx;
background: #F5F5F5;
border-radius: 14rpx 14rpx 14rpx 14rpx;
margin-right: 21rpx;
}
.change-file {
margin: 0 auto;
width: 500rpx;
height: 200rpx;
border: 2px dashed #ccc;
border-radius: 14rpx;
color: #999;
font-size: 32rpx;
display: flex;
justify-content: center;
align-items: center;
}
.file {
margin-top: 30rpx;
display: flex;
// justify-content: space-between;
.r-cont {
display: flex;
justify-content: space-around;
flex-direction: column;
}
}
.hide {
height: 0;
overflow: hidden;
}
</style> </style>

View File

@ -1,666 +0,0 @@
<template>
<view style="background-color: #F6F7FD;">
<u-loading-page :loading="showLoading" v-if="showLoading"></u-loading-page>
<!-- 消息 -->
<view class="content" @click="showPlus=false" id="content" v-show='!showLoading'>
<view class="">
<u-loadmore :status="status" :loadmore-text="`你正在与${manager_nmae}聊天`" />
</view>
<view class="task-li" v-for="item,index in list" :key="index">
<view class="" v-if="index %5 ==0" style="text-align: center;">
{{timeFn(item.create_time)}}
</view>
<!-- 对方消息 -->
<view v-if="item.from_user_id!=fromId">
<view class="task-li-r">
<view class="" style="margin-right: 10rpx;">
<u--image :showLoading="true" :src="item.from_user_avatar" shape="circle" width="40px"
height="40px"></u--image>
</view>
<view @longpress="copyText(item.content)" class="task-li-content" v-if="item.type=='text'"
style="margin-right: 10rpx;">
<view style="color: #576B95;" @click="href(item.content)" v-if="isLink(item.content)">
{{item.content}}
</view>
<view class="" v-else>
{{item.content}}
</view>
</view>
<!-- 图片 -->
<view class="task-li-content" v-if="item.type=='image'" style="margin-right: 10rpx;"
@tap="previewImage(item.content)">
<image :src="item.content" style="width:200rpx" mode="widthFix"></image>
</view>
<!-- 视频 -->
<view class="task-li-content" v-if="item.type=='video'"
style="margin-right: 10rpx;position: relative;"
@tap="showOverLayFn(item.content,item.type)">
<u--image :showLoading="true"
:src=" item.content+'?x-oss-process=video\/snapshot,t_1000,m_fast,w_800,f_png' "
width="100px" height="80px"></u--image>
<view class="yl-text">
<u-icon name="play-circle" color='white' size='30'></u-icon>
</view>
</view>
</view>
<view class="send-time">
{{item.sendTime}}
</view>
</view>
<!-- 我的消息 -->
<view class="task-li-l" v-else>
<!-- 文字 -->
<view class="task-li-content" @longpress="copyText(item.content)" v-if="item.type=='text'"
style="margin-right: 10rpx;">
<!-- {{item.content}} -->
<view style="color: #576B95;" @click="href(item.content)" v-if="isLink(item.content)">
{{item.content}}
</view>
<view class="" v-else>
{{item.content}}
</view>
<!-- <a href="item.content" target="_blank"> {{item.content}}</a> -->
</view>
<!-- 图片 -->
<view class="task-li-content" v-if="item.type=='image'" style="margin-right: 10rpx;"
@tap="previewImage(item.content)">
<image :src="item.content" style="width:200rpx" mode="widthFix"></image>
</view>
<!-- 视频 -->
<view class="task-li-content" v-if="item.type=='video'"
style="margin-right: 10rpx;position: relative;" @tap="showOverLayFn(item.content,item.type)">
<u--image :showLoading="true"
:src=" item.content+'?x-oss-process=video\/snapshot,t_1000,m_fast,w_800,f_png' "
width="100px" height="80px"></u--image>
<view class="yl-text">
<u-icon name="play-circle" color='white' size='30'></u-icon>
</view>
</view>
<view class="">
<u--image :showLoading="true" :src="a" shape="circle" width="40px" height="40px"></u--image>
</view>
</view>
</view>
<!-- 本地 -->
<view v-show="item.status" v-for="(item,index) in local">
<view class="localTask" v-if="item.localType=='video'">
<view class="task-li-content" style="margin-right: 10rpx;">
<video :src="item.localSrc" controls id="vi1" style="width: 400rpx; height: 100px;"></video>
<!-- <image :src="" style="width:200rpx" mode="widthFix"></image> -->
<u-loadmore status="loading" loading-text="努力上传中" />
</view>
<view class="" style="margin-right: 10rpx;">
<u--image :showLoading="true" shape="circle" :src="a" width="40px" height="40px"></u--image>
</view>
</view>
<view class="localTask" v-if="item.localType=='image'">
<view class="task-li-content" style="margin-right: 10rpx;">
<image :src="item.localSrc" style="width:200rpx" mode="widthFix"></image>
<u-loadmore status="loading" loading-text="努力上传中" />
</view>
<view class="" style="margin-right: 10rpx;">
<u--image :showLoading="true" shape="circle" :src="a" width="40px" height="40px"></u--image>
</view>
</view>
</view>
<view style="height: 300rpx;background-color: #F6F7FD;" v-if="showPlus">
</view>
<view style="height: 150rpx;background-color: #F6F7FD;" v-else>
</view>
</view>
<!-- 底部 -->
<view class="bottom">
<!-- -->
<view class="send-col">
<input type="text" class="send-ipt" @focus="scrollFn" v-model="value" placeholder="请输入聊天内容"
placeholder-style="color:#DDD;" :cursor-spacing="6">
<u--image :showLoading="true" src="/static/img/bussness/Plus.png" width="32px" height="32px"
@click="showPlusFn"></u--image>
<button class="send" @tap="sendFn">发送</button>
</view>
<!-- 发送照片 -->
<view class="plus" v-if="showPlus">
<view class="plus_li">
<u--image :showLoading="true" src="/static/img/bussness/XC.png" width="120rpx" height="120rpx"
@click="choseImgFn"></u--image>
<text>图片</text>
</view>
<view class="plus_li">
<u--image :showLoading="true" src="/static/img/bussness/SP.png" width="120rpx" height="120rpx"
@click="choseVideoFn"></u--image>
<text>视频</text>
</view>
</view>
</view>
<!-- 遮罩图 -->
<u-overlay :show="show" @click="show = false">
<view class="warp">
<view class="rect" @tap.stop v-if="overLayType=='video'">
<video :src="overLaySrc" controls :autoplay="true"></video>
</view>
</view>
</u-overlay>
</view>
</template>
<script>
import {
FILE_URL_IM
} from "@/api/file.js"
import {
sendMsgApi,
getMsgListApi,
bindScoket,
sendFileApi,
getAreaManagerApi
} from "@/api/bussness.js"
export default {
data() {
return {
showLoading: true,
a: "https://img1.baidu.com/it/u=716638254,3920932970&fm=253&app=138&size=w931&n=0&f=JPEG&fmt=auto?sec=1695920400&t=aeec3d0e86c23759d5f82b3757e9b442",
list: [],
bind: false,
value: "",
showPlus: false,
scollNum: 500000000000,
client_id: "",
fromId: "",
toId: "",
name: "",
status: "loadmore",
page_no: 1,
limit: 10,
show: false,
overLaySrc: "",
overLayType: "",
local: [],
localType: "",
imageList: [],
sendData: {},
manager_nmae: "",
msg_id: "",
aaa: false,
}
},
methods: {
isLink(text) {
var pattern = /^(https?:\/\/|www\.|.*\.com).*$/i;
return pattern.test(text);
},
href(url) {
// uni.navigate
plus.runtime.openURL(url);
// plus.runtime.openUrl(url)
},
previewImage(src) {
this.imageList[0] = src
uni.previewImage({
urls: this.imageList,
})
},
generateRandId() {
var d = new Date().getTime();
var uuid = "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function(c) {
var r = (d + Math.random() * 16) % 16 | 0;
d = Math.floor(d / 16);
return (c == "x" ? r : r & 0x3 | 0x8).toString(16);
});
// return uuid;
this.msg_id = uuid
console.log("改变id")
},
timeFn(time) {
time = time * 1000
const currentDate = new Date(); //
const targetDate = new Date(time);
if (this.isSameDay(currentDate, targetDate)) {
const hours = targetDate.getHours(); //
const minutes = targetDate.getMinutes(); //
return hours + ':' + (minutes >= 10 ? minutes : '0' + minutes);
} else if (this.isYesterday(currentDate, targetDate)) {
return '昨天';
}
const month = targetDate.getMonth() + 1; // 01
const day = targetDate.getDate(); //
return month + '月' + day + '日';
},
isSameDay(date1, date2) {
return (
date1.getFullYear() === date2.getFullYear() &&
date1.getMonth() === date2.getMonth() &&
date1.getDate() === date2.getDate()
);
},
isYesterday(currentDate, targetDate) {
const yesterday = new Date(currentDate.getFullYear(), currentDate.getMonth(), currentDate.getDate() - 1);
return this.isSameDay(yesterday, targetDate);
},
toast(msg) {
uni.showToast({
title: msg,
icon: 'none'
});
},
saveImage(src) {
uni.saveImageToPhotosAlbum({
filePath: src,
success() {
uni.showToast({
title: '保存成功',
icon: 'none'
});
},
fail() {
this.toast('保存失败')
}
});
},
copyText(value) {
const text = value;
uni.setClipboardData({
data: text,
success() {
uni.showToast({
title: '复制成功',
icon: 'none'
});
}
});
},
showOverLayFn(src, type) {
this.show = true
this.overLaySrc = src
this.overLayType = type
},
getListFn() {
getMsgListApi({
from_user_id: this.fromId,
to_user_id: this.toId,
scene: 0,
page_no: this.page_no,
page_size: 10
}).then(res => {
if (res.data.length <= 0) {
uni.stopPullDownRefresh();
this.status = "nomore"
return
}
this.list = res.data.reverse().concat(this.list)
uni.stopPullDownRefresh();
})
},
scrollFn() {
let that = this
this.scollNum += 100
setTimeout(() => {
uni.pageScrollTo({
scrollTop: that.scollNum, //
success: function() {
console.log('滚动')
}
})
}, 100)
},
sendFn() {
let that = this
if (!this.value) {
this.toast("消息不能为空")
return
}
let data = {
from_user_id: this.fromId,
to_user_id: this.toId,
type: "text",
content: this.value,
scene: 0,
create_time: (Date.now() / 1000),
msg_id: this.msg_id
}
sendMsgApi({
...data
}).then(res => {
console.log(data)
this.list.push(data)
this.scrollFn(100)
this.value = ""
this.generateRandId()
}).catch(err => {
this.toast('发送失败')
this.generateRandId()
})
},
showPlusFn() {
this.showPlus = !this.showPlus
this.scrollFn()
},
choseImgFn() {
this.generateRandId()
let time = Date.now()
let that = this
uni.chooseImage({
count: 1, //
success: res => {
const tempFilePath = res.tempFilePaths[0];
that.local.push({
localType: 'image',
localSrc: tempFilePath,
status: true,
msg_id: that.msg_id
})
that.showPlus = false
that.scrollFn()
console.log(that.local)
uni.uploadFile({
url: FILE_URL_IM,
filePath: tempFilePath, //
name: 'file',
header: {
"Authorization": uni.getStorageSync("TOKEN")
},
formData: {
from_user_id: that.fromId,
to_user_id: that.toId,
scene: 0,
msg_id: that.msg_id,
type: 'image'
},
success: function(uploadRes) {
let data = JSON.parse(uploadRes.data).data
var localIndex = that.local.findIndex(function(element) {
return element.msg_id === data.msg_id;
});
that.local[localIndex].status = false
that.list.push(data)
},
fail: function(error) {
this.toast('上传失败')
}
});
},
fail: err => {
this.toast('操作取消')
}
});
},
choseVideoFn() {
this.generateRandId()
let that = this
uni.chooseVideo({
sourceType: ['album', 'camera'], //
maxDuration: 600, //
camera: 'back', //
success: res => {
const tempFilePath = res.tempFilePath;
that.local.push({
localType: 'video',
localSrc: tempFilePath,
status: true,
msg_id: that.msg_id
})
that.showPlus = false
that.scrollFn()
uni.uploadFile({
url: FILE_URL_IM,
filePath: tempFilePath, //
name: 'file',
header: {
"Authorization": uni.getStorageSync("token")
},
formData: {
from_user_id: that.fromId,
to_user_id: that.toId,
scene: 0,
msg_id: that.msg_id,
type: 'video'
}, //
success: function(uploadRes) {
let data = JSON.parse(uploadRes.data).data
var localIndex = that.local.findIndex(function(element) {
return element.msg_id === data.msg_id;
});
that.local[localIndex].status = false
that.list.push(data)
//
},
fail: function(error) {
console.log(error)
uni.showToast({
title: '视频不能超过60s',
duration: 2000,
icon: 'none'
});
// that.local = false
}
});
},
fail: err => {
// uni.showToast({
// title: '60s',
// duration: 2000,
// icon: 'none'
// });
}
});
},
},
onShow() {
this.page_no = 1
this.generateRandId()
this.fromId = JSON.parse(uni.getStorageSync("USER_INFO")).id
getAreaManagerApi({
user_id: this.fromId
}).then(res => {
this.toId = res.data.to_user_id
this.manager_nmae = res.data.manager_name
getMsgListApi({
from_user_id: this.fromId,
to_user_id: this.toId,
scene: 0,
page_no: 1,
page_size: 10
}).then(res => {
this.showLoading = false
this.list = res.data.reverse()
this.scrollFn()
})
})
},
async onPullDownRefresh() {
let that = this
this.status = "loading"
this.page_no++
await this.getListFn()
this.status = "loadmore"
},
onLoad() {
let user = JSON.parse(uni.getStorageSync('USER_INFO'))
this.a = user.avatar
console.log(user.avatar)
uni.connectSocket({
url: 'wss://ceshi-worker-task.lihaink.cn/im'
});
uni.onSocketOpen(function(res) {
console.log('WebSocket连接已打开');
});
uni.onSocketError(function(res) {
console.log('WebSocket连接打开失败请检查');
});
let that = this
uni.onSocketMessage(function(res) {
let data = JSON.parse(res.data)
if (data.client_id) {
let client_id = data.client_id
if (!that.bind) {
bindScoket({
client_id: client_id,
user_id: that.fromId,
scene: 0,
}).then(res => {
that.bind = true
})
}
}
//
else if (data.type != 'ping') {
console.log(data)
that.list.push(data)
that.scrollFn()
}
});
this.generateRandId()
},
}
</script>
<style lang="scss">
.yl-text {
position: absolute;
color: white;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
font-size: 24rpx;
}
.topflag {
height: 80rpx;
background-color: #F6F7FD;
}
.content {
padding: 0 20rpx;
min-height: 95vh;
background-color: #F6F7FD;
padding-top: 10rpx;
.task-li {
margin-bottom: 20rpx;
}
.task-li-l {
display: flex;
justify-content: flex-end;
}
.task-li-r {
display: flex;
}
.task-li-content {
background-color: white;
padding: 10rpx 20rpx;
line-height: 50rpx;
// line-height: 30rpx;
border-radius: 20rpx;
// color: white;
word-break: break-all;
max-width: 535rpx;
overflow-wrap: break-word;
}
}
.bottom {
background-color: white;
padding: 20rpx 0;
position: fixed;
box-sizing: border-box;
bottom: 0px;
padding-bottom: 10px;
/* #ifndef APP-PLUS */
// bottom: 40px;
/* #endif */
.send-col {
display: flex;
align-items: center;
justify-content: space-around;
.send-ipt {
width: 70vw;
background-color: #F5F5F5;
height: 60rpx;
border-radius: 20rpx;
padding-left: 20rpx;
}
}
.send {
background-color: #2573fb;
color: #fff;
height: 64rpx;
margin-left: 20rpx;
border-radius: 6rpx;
padding: 0;
width: 120rpx;
line-height: 62rpx;
&:active {
background-color: #1573fb;
}
}
.plus {
display: flex;
background-color: white;
padding: 20rpx;
.plus_li {
display: flex;
flex-direction: column;
align-items: center;
margin-right: 20rpx;
flex-wrap: wrap;
}
}
}
.warp {
display: flex;
align-items: center;
justify-content: center;
height: 100%;
}
.rect {}
.localTask {
display: flex;
justify-content: flex-end;
}
</style>

View File

@ -95,9 +95,9 @@
<view class="company_info" v-show="current==2"> <view class="company_info" v-show="current==2">
<companyFinance ref="financeRef"></companyFinance> <companyFinance ref="financeRef"></companyFinance>
</view> </view>
<!-- <view v-show="current==3"> <view v-show="current==3">
<task ref="taskRef" style="width: 100vw;"></task> <task ref="taskRef" style="width: 100vw;"></task>
</view> --> </view>
</view> </view>
<u-empty v-else icon="/static/img/empty/data.png" text="没有数据"></u-empty> <u-empty v-else icon="/static/img/empty/data.png" text="没有数据"></u-empty>
</view> </view>
@ -215,10 +215,7 @@
}, },
onPullDownRefresh() { onPullDownRefresh() {
if (this.current == 1) this.initLoad(); if (this.current == 1) this.initLoad();
else if (this.current == 2) { else if (this.current == 2) this.$refs.financeRef.initLoad();
this.$refs.financeRef.loadCompany();
this.$refs.financeRef.initLoad();
}
else if (this.current == 3) this.$refs.taskRef.initLoadConfig(); else if (this.current == 3) this.$refs.taskRef.initLoadConfig();
this.$u.sleep(500).then(() => { this.$u.sleep(500).then(() => {
uni.stopPullDownRefresh() uni.stopPullDownRefresh()

View File

@ -1,123 +0,0 @@
<template>
<view class="page">
<view class="card">
<view class="c_title">内容</view>
<u--textarea v-model="content" placeholder="请输入内容"
placeholderStyle="font-size: 22rpx;" style="font-size: 28rpx;background-color: #eee;min-height: 100px;"
autoHeight maxlength="-1"></u--textarea>
</view>
<mybtn text="确认提交" @click="modelShow=true"></mybtn>
<u-modal :show="modelShow" title="提示" content='确定提交吗' closeOnClickOverlay showCancelButton
@close="modelShow=false" @cancel="modelShow=false" @confirm="$u.throttle(submit, 1500)"></u-modal>
</view>
</template>
<script>
import { complaintFeedback } from "@/api/complaint.js"
import { Toast } from "../../libs/uniApi"
export default {
data() {
return {
content: '',
modelShow: false
}
},
onLoad() {},
onShow() {},
methods: {
async submit(){
this.modelShow = false;
await complaintFeedback({
content: this.content
})
this.$nextTick(()=>{
Toast('提交成功');
this.$u.sleep(800).then(()=>{
uni.navigateBack();
})
})
}
},
}
</script>
<style lang="scss" scoped>
.page {
padding-top: 30rpx;
.card {
margin: 0 auto;
margin-bottom: 28rpx;
width: 694rpx;
background-color: #fff;
border-radius: 26rpx;
padding: 28rpx;
.c_title {
font-size: 32rpx;
font-weight: bold;
color: #333333;
margin-bottom: 20rpx;
}
.file {
display: flex;
justify-content: left;
flex-wrap: wrap;
&_item {
flex-shrink: 0;
width: 200rpx;
height: 200rpx;
margin: 0 auto;
margin-bottom: 16rpx;
border: 2px solid #ccc;
border-radius: 10rpx;
overflow: hidden;
position: relative;
.image {
width: 100%;
height: 100%;
}
.del {
position: absolute;
height: 40rpx;
width: 40rpx;
top: 10rpx;
right: 10rpx;
}
}
&_btn {
flex-shrink: 0;
width: 200rpx;
height: 200rpx;
margin: 0 auto;
margin-bottom: 16rpx;
border: 2px solid #ccc;
display: flex;
justify-content: center;
align-items: center;
flex-direction: column;
border-radius: 10rpx;
image {
width: 100rpx;
height: 100rpx;
}
}
&_empty {
flex-shrink: 0;
width: 200rpx;
height: 200rpx;
margin: 0 auto;
margin-bottom: 16rpx;
border: 2px solid transparent;
}
}
}
}
</style>

File diff suppressed because it is too large Load Diff

View File

@ -1,135 +1,154 @@
<template> <template>
<view class="all_box"> <view class="">
<u-sticky bgColor="#0022C7"> <u-sticky bgColor="#0022C7">
<u-tabs :list="tabLists" @click="changeCurrent" lineColor='white' :scrollable="false" lineWidth='20' <u-tabs :list="tabLists" @click="changeCurrent" lineColor='white' :scrollable="false" lineWidth='20'
inactiveStyle='color:white' activeStyle="color:white"></u-tabs> inactiveStyle='color:white' activeStyle="color:white"></u-tabs>
</u-sticky> </u-sticky>
<!-- <u-tabs style="background-color: #fff;" :list="typeTabLists" @click="changeTypeCurrent" lineColor='#0022C7' lineWidth='40' <view class="p_list">
inactiveStyle='color:#0022C7' activeStyle="color:#0022C7"></u-tabs> --> <view class="card">
<view v-if="check_status==2||check_status==3" class="p_list"> <view class="nav_bar">
<block v-for="(item,index) in list" :key="index"> <view class="left">
<merchantAudit :datas="item"></merchantAudit> <image src="../../static/img/company/company.png"></image>
</block> <view>爱读蛋糕</view>
</view>
<view class="right" @click="navTo(`/subpkg/merchantDetails/merchantDetails?id=${id=1}`)">
<text>查看</text>
<u-icon name="arrow-right" size="12" color="#fff"></u-icon>
</view>
</view>
<view class="body">
<view class="b_item name">
<view class="text"><view>商户姓名:</view> <view>某moods v你的伤口v技能大赛空军第三空间</view></view>
<view class="type">
<text v-if="true" style="color: #ff7c32;">未审核</text>
<text v-else-if="true" style="color: #47be62;">已通过</text>
<text v-else style="color: #FF0000;">未通过</text>
</view>
</view>
<view class="b_item"><view>商户分类:</view> <view>商超</view></view>
<view class="b_item"><view>店铺分类:</view> <view>分类</view></view>
<view class="b_item"><view>镇街店铺:</view> <view>店铺</view></view>
<view class="b_item"><view>联系方式:</view> <view>1999999999</view></view>
<view class="b_item"><view>申请时间:</view> <view>2023-09-09</view></view>
<view class="img">
<image src="../../uni_modules/guyue-updater/assets/bg1.png"></image>
<image src="../../uni_modules/guyue-updater/assets/bg1.png"></image>
<image src="../../uni_modules/guyue-updater/assets/bg1.png"></image>
</view>
</view>
</view>
</view> </view>
<u-empty v-if="list.length==0&&loadConfig.status=='nomore'" icon="/static/img/empty/data.png"></u-empty>
<u-loadmore v-else :status="loadConfig.status" :loading-text="loadConfig.loadingText"
:loadmore-text="loadConfig.loadmoreText" :nomore-text="loadConfig.nomoreText" />
</view> </view>
</template> </template>
<script> <script>
import { Toast } from '@/libs/uniApi.js'
import { approveLists, approveTypes } from "@/api/approve.js"
import merchantAudit from '@/components/merchantAudit/merchantAudit.vue'
export default { export default {
components: {
merchantAudit
},
data() { data() {
return { return {
tabLists: [ { tabLists: [{
name: '审核中', name: '全部',
id: 1 }, {
}, { name: '未审核'
name: '已通过', }, {
id: 2 name: '已开通'
}, { },
name: '未通过', {
id: 3 name: '未通过'
}, { },
name: '全部', ],
id: 0
},],
typeTabLists: [],
current: 0,
currentID: 1, // ,,,
typeCurrent: 0,
check_status: 0, //
list: [],
loadConfig: {
page: 1,
limit: 10,
lastpage: '',
loadingText: '努力加载中',
loadmoreText: '轻轻上拉',
nomoreText: '我也是有底线的~~',
status: 'loadmore'
},
} }
}, },
onLoad() { onLoad() {},
// this.initType(); onShow() {},
this.check_status = 2; onPullDownRefresh() {
this.initList(); uni.stopPullDownRefresh()
uni.$on('initMerchant', this.initList);
},
async onPullDownRefresh() {
await this.initList();
this.$u.sleep(200).then(()=>{
uni.stopPullDownRefresh();
})
},
onReachBottom() {
this.loadList();
}, },
methods: { methods: {
async initType(){
let res = await approveTypes();
res.data.forEach((item)=>{
if(item.id!=1) this.typeTabLists.push({
id: item.id,
name: item.title
})
})
this.check_status = this.typeTabLists[0].id;
this.$nextTick(()=>{
this.initList();
})
},
async initList(){
this.loadConfig.page = 1;
this.loadConfig.status = "loadmore";
this.list = [];
await this.loadList();
},
async loadList(){
if (this.loadConfig.status == "nomore") return;
this.loadConfig.status = "loading";
let query = {
type: this.check_status,
page: this.loadConfig.page,
limit: this.loadConfig.limit
}
this.currentID?query.check_status=this.currentID:null;
let res = await approveLists(query);
this.loadConfig.status = "loadmore"
if (res.data.lists.length < this.loadConfig.limit) {
this.loadConfig.status = "nomore"
} else {
this.loadConfig.page++;
}
this.list = [...this.list, ...res.data?.lists];
},
changeCurrent(e) { changeCurrent(e) {
this.current = e.index; this.current = e.index;
this.currentID = e.id;
this.initList();
}, },
changeTypeCurrent(e) { navTo (url) {
this.typeCurrent = e.index; if (url) {
this.check_status = e.id; uni.navigateTo({
this.initList(); url: url,
})
} else Toast('暂未开放')
}, },
}, },
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss">
.all_box { .p_list{
padding-bottom: 21rpx; padding-top: 28rpx;
} .card{
.p_list{ margin: 0 auto;
padding-top: 28rpx; margin-bottom: 28rpx;
width: 694rpx;
background-color: #fff;
border-radius: 26rpx;
overflow: hidden;
.nav_bar{
background-color: #0122c7;
padding: 28rpx;
color: #fff;
display: flex;
justify-content: space-between;
align-items: center;
.left{
display: flex;
font-size: 32rpx;
image{
width: 40rpx;
height: 40rpx;
margin-right: 16rpx;
}
}
.right{
display: flex;
font-size: 28rpx;
align-items: center;
}
}
.body{
font-size: 28rpx;
padding: 28rpx;
.b_item{
padding-bottom: 16rpx;
display: flex;
view:nth-child(1){
flex-shrink: 0;
padding-right: 10rpx;
}
}
.name{
display: flex;
justify-content: space-between;
.text{
flex: 1;
display: flex;
view:nth-child(1){
flex-shrink: 0;
}
}
.type{
flex-shrink: 0;
}
}
.img{
display: flex;
image{
width: 200rpx;
height: 150rpx;
margin-right: 19rpx;
&:last-child{
margin-right: 0;
}
}
}
}
} }
}
</style> </style>

View File

@ -1,528 +1,387 @@
<template> <template>
<view class=""> <view class="">
<view class="p_list"> <view class="p_list">
<view class="card"> <view class="card">
<view class="nav_bar"> <view class="nav_bar">
<view class="left"> <view class="left">
<image src="../../static/img/company/company.png"></image> <image src="../../static/img/company/company.png"></image>
<view>{{extend.company_name}}</view> <view>{{extend.company_name}}</view>
</view> </view>
</view> </view>
<view class="body"> <view class="body">
<view class="b_item name"> <view class="b_item name">
<view class="text"> <view class="text">
<view>审核类型:</view> <view>审核类型:</view>
<view>{{formData.name}}</view> <view>{{formData.name}}</view>
</view> </view>
<view class="type"> <view class="type">
<text v-if="formData.check_status==1" style="color: #ff7c32;">审核中</text> <text v-if="formData.check_status==1" style="color: #ff7c32;">审核中</text>
<text v-else-if="formData.check_status==2" style="color: #47be62;">已通过</text> <text v-else-if="formData.check_status==2" style="color: #47be62;">已通过</text>
<text v-else-if="formData.check_status==3" style="color: #FF0000;">未通过</text> <text v-else-if="formData.check_status==3" style="color: #FF0000;">未通过</text>
</view> </view>
</view> </view>
<view class="b_item"> <view class="b_item">
<view>商户分类:</view> <view>商户分类:</view>
<view>{{extend.category_name}}</view> <view>{{extend.category_name}}</view>
</view> </view>
<view class="b_item"> <view class="b_item">
<view>店铺类型:</view> <view>店铺类型:</view>
<view>{{extend.type_name}}</view> <view>{{extend.type_name}}</view>
</view> </view>
<view class="b_item"> <view class="b_item">
<view>店铺名称:</view> <view>店铺名称:</view>
<view>{{extend.mer_name}}</view> <view>{{extend.mer_name}}</view>
</view> </view>
<view class="b_item"> <view class="b_item">
<view>申请时间:</view> <view>申请时间:</view>
<view>{{formData.create_time}}</view> <view>{{formData.create_time}}</view>
</view> </view>
<view class="b_item"> <view class="b_item">
<view>联系方式:</view> <view>联系方式:</view>
<view>{{extend.master_phone}}</view> <view>{{extend.master_phone}}</view>
</view> </view>
<!-- <view class="b_item"> <!-- <view class="b_item">
<view>店铺所在地:</view> <view>店铺所在地:</view>
<view>泸州市江阳区通滩镇通滩社区</view> <view>泸州市江阳区通滩镇通滩社区</view>
</view> --> </view> -->
<view class="b_item"> <view class="b_item">
<view>详细地址:</view> <view>详细地址:</view>
<view>{{extend.address}}</view> <view>{{extend.address}}</view>
</view> </view>
<view class="b_item"> <view class="b_item">
<view>公司性质:</view> <view>公司名称:</view>
<view>{{extend.is_company==1?"对公户":"个体户" }}</view> <view>{{extend.company_name}}</view>
</view> </view>
<view class="b_item">
<view class="b_item"> <view>法人姓名:</view>
<view>公司名称:</view> <view>{{extend.master_name}}</view>
<view>{{extend.company_name}}</view> </view>
</view> <view class="b_item">
<view class="b_item"> <view>社会代码:</view>
<view>法人姓名:</view> <view>{{extend.organization_code}}</view>
<view>{{extend.master_name}}</view> </view>
</view> </view>
<view class="b_item"> </view>
<view>社会代码:</view> <view class="card">
<view>{{extend.organization_code}}</view> <view class="nav_bar">
</view> <view class="left">
</view> <image src="../../static/img/company/SHZZ.png"></image>
</view> <view>商户资质信息</view>
<view class="card"> </view>
<view class="nav_bar"> </view>
<view class="left"> <view class="body">
<image src="../../static/img/company/SHZZ.png"></image> <block v-for="(item, index) in extend.qualification">
<view>商户资质信息</view> <image @click="priview(item)"
</view> :src="item"></image>
</view> <view v-if="index<extend.qualification.length-1" style="border-top: 1px dashed #0022c7;margin: 28rpx 0;"></view>
<view class="body"> </block>
<block v-for="(item, index) in extend.qualification" :key=""> </view>
<image @click="priview(item)" :src="item"></image> </view>
<view v-if="index<extend.qualification.length-1" </view>
style="border-top: 1px dashed #0022c7;margin: 28rpx 0;"> <block v-if="formData.check_status!=2&&formData.check_status!=3&&formData.check_status">
</view> <button class="btn" @click="tipShow = true">通过</button>
</block> <button class="btn" @click="modalShow = true" style="background-color: #fff;color: #0122c7;">拒绝</button>
</view> </block>
</view> <block v-else-if="formData.check_status==3">
<view v-if="is_transaction" class="card"> <view class="refuse">
<view class="nav_bar"> 未通过原因: {{formData.remark}}
<view class="left"> </view>
<image src="../../static/img/company/SHZZ.png"></image> </block>
<view>身份证明信息</view> <u-popup :show="modalShow" :round="13" mode="center">
</view> <view class="popup">
</view> <view class="header">
<text>请输入拒绝原因</text>
<image @click="modalShow=false" src="../../static/icons/close.png"></image>
<view class="body" v-if="extend.is_company==1"> </view>
<view class="b_item"> <u--form labelPosition="left" :model="formData" :rules="rules" ref="uForm">
<view>公司名称: </view> <u-form-item prop="remark">
<view>{{extend.company_name}}</view> <u-textarea class="textarea" v-model="formData.remark" placeholder="请输入拒绝原因" type="textarea"
</view> height="100"></u-textarea>
</u-form-item>
<view class="b_item"> </u--form>
<view>对公账号: </view> <view class="p_btn">
<view>{{extend.bank_code}}</view> <view></view>
</view> <view class="right_btn">
<button class="cal" @click="modalShow=false">取消</button>
<view class="b_item"> <button class="pri" @click="$u.throttle(noPass, 1500)">确认</button>
<view>开户银行: </view> </view>
<view>{{extend.bank_username}}</view> </view>
</view> </view>
<view class="b_item"> </u-popup>
<view>开户网点: </view> <u-modal :show="tipShow" title="提示" content='确认信息无误再通过' closeOnClickOverlay showCancelButton @close="tipShow=false"
<view>{{extend.bank_opening}}</view> @cancel="tipShow=false" @confirm="$u.throttle(pass, 1500)"></u-modal>
</view> </view>
<view class="b_item">
<view>开户凭证:</view>
</view>
<image @click="priview(extend.bank_front)" :src="extend.bank_front"></image>
<!-- <view class="b_item">
<view>对公账号: </view>
<view>{{extend.bank_code}}</view>
</view>
<view class="b_item">
<view>开户行名称: </view>
<view>{{extend.bank_username}}</view>
</view>
<view class="b_item">
<view>开户行地址: </view>
<view>{{extend.bank_opening}}</view>
</view> -->
<!-- <view class="b_item">
<view>银行卡号:</view>
<view>{{extend.bank_opening}}</view>
</view>
<view class="b_item">
<view>银行卡正面:</view>
</view>
<image @click="priview(extend.bank_front)" :src="extend.bank_front"></image>
<view class="b_item">
<view>银行卡反面:</view>
</view>
<image @click="priview(extend.bank_back)" :src="extend.bank_back"></image>
<view class="b_item">
<view>身份证正面:</view>
</view>
<image @click="priview(extend.cardno_front)" :src="extend.cardno_front"></image>
<view class="b_item">
<view>身份证反面:</view>
</view>
<image @click="priview(extend.cardno_back)" :src="extend.cardno_back"></image> -->
</view>
<view class="body" v-else>
<view class="b_item">
<view>持卡人: </view>
<view>{{extend.master_name}}</view>
</view>
<view class="b_item">
<view>银行卡号: </view>
<view>{{extend.bank_code}}</view>
</view>
<view class="b_item">
<view>开户银行: </view>
<view>{{extend.bank_username}}</view>
</view>
<view class="b_item">
<view>开户网点: </view>
<view>{{extend.bank_opening}}</view>
</view>
<view class="b_item">
<view>银行卡图片:</view>
</view>
<image @click="priview(extend.bank_front)" :src="extend.bank_front"></image>
<!-- <view class="b_item">
<view>对公账号: </view>
<view>{{extend.bank_code}}</view>
</view>
<view class="b_item">
<view>开户行名称: </view>
<view>{{extend.bank_username}}</view>
</view>
<view class="b_item">
<view>开户行地址: </view>
<view>{{extend.bank_opening}}</view>
</view> -->
<!-- <view class="b_item">
<view>银行卡号:</view>
<view>{{extend.bank_opening}}</view>
</view>
<view class="b_item">
<view>银行卡正面:</view>
</view>
<image @click="priview(extend.bank_front)" :src="extend.bank_front"></image>
<view class="b_item">
<view>银行卡反面:</view>
</view>
<image @click="priview(extend.bank_back)" :src="extend.bank_back"></image>
<view class="b_item">
<view>身份证正面:</view>
</view>
<image @click="priview(extend.cardno_front)" :src="extend.cardno_front"></image>
<view class="b_item">
<view>身份证反面:</view>
</view>
<image @click="priview(extend.cardno_back)" :src="extend.cardno_back"></image> -->
</view>
</view>
</view>
<block v-if="formData.check_status!=2&&formData.check_status!=3&&formData.check_status">
<button class="btn" @click="tipShow = true">通过</button>
<button class="btn" @click="modalShow = true" style="background-color: #fff;color: #0122c7;">拒绝</button>
</block>
<block v-else-if="formData.check_status==3">
<view class="refuse">
未通过原因: {{formData.remark}}
</view>
</block>
<u-popup :show="modalShow" :round="13" mode="center">
<view class="popup">
<view class="header">
<text>请输入拒绝原因</text>
<image @click="modalShow=false" src="../../static/icons/close.png"></image>
</view>
<u--form labelPosition="left" :model="formData" :rules="rules" ref="uForm">
<u-form-item prop="remark">
<u-textarea class="textarea" v-model="formData.remark" placeholder="请输入拒绝原因" type="textarea"
height="100"></u-textarea>
</u-form-item>
</u--form>
<view class="p_btn">
<view></view>
<view class="right_btn">
<button class="cal" @click="modalShow=false">取消</button>
<button class="pri" @click="$u.throttle(noPass, 1500)">确认</button>
</view>
</view>
</view>
</u-popup>
<u-modal :show="tipShow" title="提示" content='确认信息无误再通过' closeOnClickOverlay showCancelButton
@close="tipShow=false" @cancel="tipShow=false" @confirm="$u.throttle(pass, 1500)"></u-modal>
</view>
</template> </template>
<script> <script>
import { import { Toast } from '../../libs/uniApi'
Toast import { approveAudit, approveDetails } from "@/api/approve.js"
} from '../../libs/uniApi' export default {
import { data() {
approveAudit, return {
approveDetails modalShow: false,
} from "@/api/approve.js" tipShow: false,
export default { formData: {
data() { id: '',
return { remark: ''
modalShow: false, },
tipShow: false, extend: {
formData: {
id: '',
remark: ''
},
extend: {
}, },
is_transaction: false, // rules: {
rules: { remark: {
remark: { type: 'string',
type: 'string', required: true,
required: true, message: '请输入原因',
message: '请输入原因', trigger: ['blur', 'change']
trigger: ['blur', 'change'] }
} }
} }
} },
}, onLoad(options) {
onLoad(options) { this.formData.id = +options.id;
this.formData.id = +options.id; options.name ? uni.setNavigationBarTitle({
options.name ? uni.setNavigationBarTitle({ title: options.name
title: options.name }) : null;
}) : null; this.initData();
if (options.name.includes('交易')) this.is_transaction = true; },
this.initData(); onShow() {},
}, methods: {
onShow() {}, async initData() {
methods: { try {
async initData() { let res = await approveDetails({
try { id: this.formData.id
let res = await approveDetails({ });
id: this.formData.id this.formData = res.data;
}); this.extend = this.formData?.extend;
this.formData = res.data; this.extend.qualification ? this.extend.qualification = JSON.parse(this.extend.qualification) : this.extend
this.extend = this.formData?.extend; .qualification = []
this.extend.qualification ? this.extend.qualification = JSON.parse(this.extend.qualification) : } catch (e) {
this.extend //TODO handle the exception
.qualification = [] }
} catch (e) { },
//TODO handle the exception async pass() {
} // check_status 2,3
}, await approveAudit({
async pass() { id: this.formData.id,
// check_status 2,3 check_status: 2
await approveAudit({ })
id: this.formData.id, this.tipShow = false;
check_status: 2 this.$nextTick(() => {
}) Toast('已通过');
this.tipShow = false; this.initData();
this.$nextTick(() => { })
Toast('已通过'); },
uni.$emit('initMerchant'); async noPass() {
uni.navigateBack(); await this.$refs.uForm.validate();
}) await approveAudit({
}, id: this.formData.id,
async noPass() { check_status: 3,
await this.$refs.uForm.validate(); remark: this.formData.remark
await approveAudit({ })
id: this.formData.id, this.modalShow = false;
check_status: 3, this.$nextTick(() => {
remark: this.formData.remark Toast('已拒绝');
}) this.initData();
this.modalShow = false; })
this.$nextTick(() => { },
Toast('已拒绝'); priview(url) {
uni.navigateBack(); uni.previewImage({
}) urls: [url],
}, longPressActions: {
priview(url) { itemList: ['保存图片'],
uni.previewImage({ success: function(data) {
urls: [url], if (data.tapIndex === 0) {
longPressActions: { uni.saveImageToPhotosAlbum({
itemList: ['保存图片'], filePath: url,
success: function(data) { success: function() {
if (data.tapIndex === 0) { uni.showToast({
uni.saveImageToPhotosAlbum({ title: '保存成功',
filePath: url, icon: 'success'
success: function() { })
uni.showToast({ },
title: '保存成功', fail: function() {
icon: 'success' uni.showToast({
}) title: '保存失败',
}, icon: 'none'
fail: function() { })
uni.showToast({ }
title: '保存失败', })
icon: 'none' }
}) }
} }
}) })
} },
} },
} onPullDownRefresh() {
}) uni.stopPullDownRefresh()
}, }
}, }
onPullDownRefresh() {
uni.stopPullDownRefresh()
}
}
</script> </script>
<style lang="scss"> <style lang="scss">
.p_list { .p_list {
padding-top: 28rpx; padding-top: 28rpx;
.card { .card {
margin: 0 auto; margin: 0 auto;
margin-bottom: 28rpx; margin-bottom: 28rpx;
width: 694rpx; width: 694rpx;
background-color: #fff; background-color: #fff;
border-radius: 26rpx; border-radius: 26rpx;
overflow: hidden; overflow: hidden;
.nav_bar { .nav_bar {
background-color: #0122c7; background-color: #0122c7;
padding: 28rpx; padding: 28rpx;
color: #fff; color: #fff;
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
align-items: center; align-items: center;
.left { .left {
display: flex; display: flex;
font-size: 32rpx; font-size: 32rpx;
image { image {
width: 40rpx; width: 40rpx;
height: 40rpx; height: 40rpx;
margin-right: 16rpx; margin-right: 16rpx;
} }
} }
.right { .right {
display: flex; display: flex;
font-size: 28rpx; font-size: 28rpx;
align-items: center; align-items: center;
} }
} }
.body { .body {
font-size: 28rpx; font-size: 28rpx;
padding: 28rpx; padding: 28rpx;
.b_item { .b_item {
padding-bottom: 16rpx; padding-bottom: 16rpx;
display: flex; display: flex;
view:nth-child(1) { view:nth-child(1) {
flex-shrink: 0; flex-shrink: 0;
padding-right: 10rpx; padding-right: 10rpx;
} }
} }
.name { .name {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
.text { .text {
flex: 1; flex: 1;
display: flex; display: flex;
view:nth-child(1) { view:nth-child(1) {
flex-shrink: 0; flex-shrink: 0;
} }
} }
.type { .type {
flex-shrink: 0; flex-shrink: 0;
} }
} }
image { image {
width: 638rpx; width: 638rpx;
height: 400rpx; height: 400rpx;
} }
} }
} }
} }
.btn { .btn {
width: 694rpx; width: 694rpx;
height: 100rpx; height: 100rpx;
margin: 28rpx auto; margin: 28rpx auto;
background-color: #0122c7; background-color: #0122c7;
border: 1rpx solid #0122c7; border: 1rpx solid #0122c7;
color: #fff; color: #fff;
display: flex; display: flex;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
} }
.popup { .popup {
width: 694rpx; width: 694rpx;
border-radius: 26rpx; border-radius: 26rpx;
background-color: #fff; background-color: #fff;
overflow: hidden; overflow: hidden;
.header { .header {
text-align: center; text-align: center;
background-color: #0122c7; background-color: #0122c7;
color: #fff; color: #fff;
font-size: 32rpx; font-size: 32rpx;
height: 100rpx; height: 100rpx;
line-height: 100rpx; line-height: 100rpx;
position: relative; position: relative;
image { image {
width: 50rpx; width: 50rpx;
height: 50rpx; height: 50rpx;
position: absolute; position: absolute;
right: 28rpx; right: 28rpx;
top: 50%; top: 50%;
transform: translate(0, -50%); transform: translate(0, -50%);
} }
} }
.textarea { .textarea {
margin: 0 28rpx; margin: 0 28rpx;
margin-top: 8rpx; margin-top: 8rpx;
padding: 28rpx; padding: 28rpx;
background-color: #f4f4f4; background-color: #f4f4f4;
font-size: 32rpx !important; font-size: 32rpx !important;
border-radius: 26rpx; border-radius: 26rpx;
} }
.p_btn { .p_btn {
margin: 28rpx; margin: 28rpx;
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
.right_btn { .right_btn {
display: flex; display: flex;
align-items: center; align-items: center;
.cal { .cal {
width: 150rpx; width: 150rpx;
font-size: 30rpx; font-size: 30rpx;
height: 86rpx; height: 86rpx;
line-height: 86rpx; line-height: 86rpx;
border-radius: 43rpx; border-radius: 43rpx;
font-size: 30rpx; font-size: 30rpx;
} }
.pri { .pri {
background-color: #0122c7; background-color: #0122c7;
color: #fff; color: #fff;
width: 238rpx; width: 238rpx;
height: 86rpx; height: 86rpx;
line-height: 86rpx; line-height: 86rpx;
border-radius: 43rpx; border-radius: 43rpx;
font-size: 30rpx; font-size: 30rpx;
} }
} }
} }
} }
.refuse { .refuse{
width: 694rpx; width: 694rpx;
padding: 28rpx; padding: 28rpx;
margin: 0 auto; margin: 0 auto;
margin-bottom: 28rpx; margin-bottom: 28rpx;
border-radius: 26rpx; border-radius: 26rpx;
// border: 1px solid #ff7c32; // border: 1px solid #ff7c32;
background-color: rgba(#ff7c32, 0.2); background-color: rgba(#ff7c32, 0.2);
color: #ff7c32; color: #ff7c32;
} }
</style> </style>

View File

@ -1,135 +1,23 @@
<template> <template>
<view class="all_box"> <view class=""></view>
<u-sticky bgColor="#0022C7">
<u-tabs :list="tabLists" @click="changeCurrent" lineColor='white' :scrollable="false" lineWidth='20'
inactiveStyle='color:white' activeStyle="color:white"></u-tabs>
</u-sticky>
<!-- <u-tabs style="background-color: #fff;" :list="typeTabLists" @click="changeTypeCurrent" lineColor='#0022C7' lineWidth='40'
inactiveStyle='color:#0022C7' activeStyle="color:#0022C7"></u-tabs> -->
<view v-if="check_status==2||check_status==3" class="p_list">
<block v-for="(item,index) in list" :key="index">
<merchantAudit :datas="item"></merchantAudit>
</block>
</view>
<u-empty v-if="list.length==0&&loadConfig.status=='nomore'" icon="/static/img/empty/data.png"></u-empty>
<u-loadmore v-else :status="loadConfig.status" :loading-text="loadConfig.loadingText"
:loadmore-text="loadConfig.loadmoreText" :nomore-text="loadConfig.nomoreText" />
</view>
</template> </template>
<script> <script>
import { Toast } from '@/libs/uniApi.js' export default {
import { approveLists, approveTypes } from "@/api/approve.js" data() {
import merchantAudit from '@/components/merchantAudit/merchantAudit.vue' return {
export default {
components: { }
merchantAudit },
}, onLoad() {},
data() { onShow() {},
return { methods: {},
tabLists: [ { onPullDownRefresh() {
name: '审核中', uni.stopPullDownRefresh()
id: 1 }
}, {
name: '已通过',
id: 2
}, {
name: '未通过',
id: 3
}, {
name: '全部',
id: 0
},],
typeTabLists: [],
current: 0,
currentID: 1, // ,,,
typeCurrent: 0,
check_status: 0, //
list: [],
loadConfig: {
page: 1,
limit: 10,
lastpage: '',
loadingText: '努力加载中',
loadmoreText: '轻轻上拉',
nomoreText: '我也是有底线的~~',
status: 'loadmore'
},
}
},
onLoad() {
// this.initType();
this.check_status = 3;
this.initList();
uni.$on('initMerchant', this.initList);
},
async onPullDownRefresh() {
await this.initList();
this.$u.sleep(200).then(()=>{
uni.stopPullDownRefresh();
})
},
onReachBottom() {
this.loadList();
},
methods: {
async initType(){
let res = await approveTypes();
res.data.forEach((item)=>{
if(item.id!=1) this.typeTabLists.push({
id: item.id,
name: item.title
})
})
this.check_status = this.typeTabLists[0].id;
this.$nextTick(()=>{
this.initList();
})
},
async initList(){
this.loadConfig.page = 1;
this.loadConfig.status = "loadmore";
this.list = [];
await this.loadList();
},
async loadList(){
if (this.loadConfig.status == "nomore") return;
this.loadConfig.status = "loading";
let query = {
type: this.check_status,
page: this.loadConfig.page,
limit: this.loadConfig.limit
}
this.currentID?query.check_status=this.currentID:null;
let res = await approveLists(query);
this.loadConfig.status = "loadmore"
if (res.data.lists.length < this.loadConfig.limit) {
this.loadConfig.status = "nomore"
} else {
this.loadConfig.page++;
}
this.list = [...this.list, ...res.data?.lists];
},
changeCurrent(e) {
this.current = e.index;
this.currentID = e.id;
this.initList();
},
changeTypeCurrent(e) {
this.typeCurrent = e.index;
this.check_status = e.id;
this.initList();
},
},
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss">
.all_box {
padding-bottom: 21rpx;
}
.p_list{
padding-top: 28rpx;
}
</style> </style>

View File

@ -46,8 +46,7 @@
<u--input v-model="formData.id_card" placeholder="请输入身份证号" @input="c_idcard" <u--input v-model="formData.id_card" placeholder="请输入身份证号" @input="c_idcard"
type="idcard"></u--input> type="idcard"></u--input>
</u-form-item> </u-form-item>
<u-form-item v-if="$store.state.app.userInfo.company.company_type==18" labelWidth="auto" <u-form-item labelWidth="auto" label="是否为小队长" required prop="is_captain" borderBottom>
label="是否为小队长" required prop="is_captain" borderBottom>
<u-radio-group v-model="formData.is_captain" style="margin: 16rpx;"> <u-radio-group v-model="formData.is_captain" style="margin: 16rpx;">
<u-radio activeColor="#0122C7" :customStyle="{marginRight: '16px'}" <u-radio activeColor="#0122C7" :customStyle="{marginRight: '16px'}"
v-for="(item, index) in [{value:1,label:'是'},{value:0,label:'否'}]" :key="index" v-for="(item, index) in [{value:1,label:'是'},{value:0,label:'否'}]" :key="index"
@ -55,15 +54,6 @@
</u-radio> </u-radio>
</u-radio-group> </u-radio-group>
</u-form-item> </u-form-item>
<u-form-item v-if="$store.state.app.userInfo.company.company_type==16" labelWidth="auto"
label="是否为服务部长" required prop="is_service_manager" borderBottom>
<u-radio-group v-model="formData.is_service_manager" style="margin: 16rpx;">
<u-radio activeColor="#0122C7" :customStyle="{marginRight: '16px'}"
v-for="(item, index) in [{value:1,label:'是'},{value:0,label:'否'}]" :key="index"
:label="item.label" :name="item.value">
</u-radio>
</u-radio-group>
</u-form-item>
<districtSelectorTow style="margin-top: 30rpx;" ref="districtSelectorRef"></districtSelectorTow> <districtSelectorTow style="margin-top: 30rpx;" ref="districtSelectorRef"></districtSelectorTow>
</view> </view>
<view class="cards"> <view class="cards">
@ -297,10 +287,11 @@
</u-upload> </u-upload>
</u-form-item> --> </u-form-item> -->
</u--form> </u--form>
<button @click="modelShow=true" type="primary" class="btn" style="margin: 28rpx;">创建</button> <button @click="modelShow=true" type="primary" class="btn"
style="margin: 28rpx;">创建</button>
</view> </view>
<u-modal :show="modelShow" title="提示" content='请确认人员信息无误后再创建' closeOnClickOverlay showCancelButton <u-modal :show="modelShow" title="提示" content='请确认人员信息无误后再创建' closeOnClickOverlay showCancelButton
@close="modelShow=false" @cancel="modelShow=false" @confirm="$u.throttle(addAcountNum, 2000)"></u-modal> @close="modelShow=false" @cancel="modelShow=false" @confirm="$u.throttle(addAcountNum, 2000)"></u-modal>
</view> </view>
</template> </template>
@ -310,7 +301,7 @@
} from "@/api/file.js" } from "@/api/file.js"
import { import {
loginAdd, loginAdd,
} from "@/api/oaUser.js" } from "@/api/oaUser.js"
import districtSelector from "@/components/districtSelector/districtSelector.vue" // import districtSelector from "@/components/districtSelector/districtSelector.vue" //
import districtSelectorTow from "@/components/districtSelector/districtSelectorTow.vue" // import districtSelectorTow from "@/components/districtSelector/districtSelectorTow.vue" //
import { import {
@ -323,7 +314,7 @@
}, },
data() { data() {
return { return {
modelShow: false, modelShow: false,
formData: { formData: {
account: '', // account: '', //
password: '123456', // password: '123456', //
@ -331,7 +322,6 @@
// channel: 6, //[1- 2- 3-H5 4-PC 5-APP 6-APP] // channel: 6, //[1- 2- 3-H5 4-PC 5-APP 6-APP]
id_card: '', id_card: '',
is_captain: '', // is_captain: '', //
is_service_manager: '', //
sex: '', sex: '',
avatar: '', avatar: '',
nickname: '', nickname: '',
@ -382,12 +372,6 @@
}, },
trigger: ['change', 'blur'] trigger: ['change', 'blur']
}, },
is_service_manager: {
validator: (rule, value, callback) => {
typeof value === 'number' ? callback() : callback('不能为空')
},
trigger: ['change', 'blur']
},
'qualification.id_card': { 'qualification.id_card': {
type: 'string', type: 'string',
required: true, required: true,
@ -429,16 +413,11 @@
}, },
// //
async afterReadAvatar(event) { async afterReadAvatar(event) {
uni.showLoading({
title: '上传中'
})
upLoadImage({ upLoadImage({
filePath: event.file.url, filePath: event.file.url,
name: 'file' name: 'file'
}).then(res => { }).then(res => {
this.formData.avatar = res.data.uri; this.formData.avatar = res.data.uri
}).finally(() => {
uni.hideLoading();
}) })
}, },
// //
@ -447,35 +426,28 @@
}, },
// //
upLoad(url, type) { upLoad(url, type) {
uni.showLoading({
title: '上传中请稍后'
})
upLoadImage({ upLoadImage({
filePath: url, filePath: url,
name: 'file' name: 'file'
}).then(res => { }).then(res => {
this.formData.qualification[type] = res.data.uri this.formData.qualification[type] = res.data.uri
}).finally(() => {
uni.hideLoading();
}) })
}, },
// //
async addAcountNum() { async addAcountNum() {
this.modelShow = false; this.modelShow = false;
await this.$nextTick(); await this.$nextTick();
if (!this.formData.avatar) return Toast('头像未上传'); if (!this.formData.avatar) return Toast('头像未上传');
let flag = this.$refs.districtSelectorRef.validate(); let flag = this.$refs.districtSelectorRef.validate();
if (!this.formData.qualification.id_card || !this.formData.qualification.id_card_b) return Toast( if (!this.formData.qualification.id_card || !this.formData.qualification.id_card_b) return Toast('身份证未上传');
'身份证未上传'); if (!this.formData.qualification.bank_account || !this.formData.qualification.bank_account_b) return Toast(
if (!this.formData.qualification.bank_account || !this.formData.qualification.bank_account_b) '银行卡未上传');
return Toast(
'银行卡未上传');
this.$refs.uForm.validate().then(async (e) => { this.$refs.uForm.validate().then(async (e) => {
if (e && flag) { if (e && flag) {
uni.showLoading() uni.showLoading()
let res = await loginAdd({ let res = await loginAdd({
...this.formData, ...this.formData,
...this.$refs.districtSelectorRef?.formData ...this.$refs.districtSelectorRef.formData
}); });
uni.hideLoading() uni.hideLoading()
uni.showToast({ uni.showToast({

View File

@ -161,7 +161,7 @@
// //
async submit() { async submit() {
if(!this.isReject())return; // if(!this.isReject())return; //
if (this.note.trim() == '') return Toast('详情描述不能为空'); if (this.other.note.trim() == '') return Toast('详情描述不能为空');
await taskOtherTaskCommit({ await taskOtherTaskCommit({
id: this.task_id, id: this.task_id,
note: this.note, note: this.note,

View File

@ -109,9 +109,7 @@
:loadmore-text="loadConfig.loadmoreText" :nomore-text="loadConfig.nomoreText" /> :loadmore-text="loadConfig.loadmoreText" :nomore-text="loadConfig.nomoreText" />
</view> </view>
<!-- <button class="new_btn" @click.stop="navTo('/subpkg/newPersonnel/newPersonnel')">创建账号</button> --> <!-- <button class="new_btn" @click.stop="navTo('/subpkg/newPersonnel/newPersonnel')">创建账号</button> -->
<mybtn <mybtn v-if="$store.state.app.userInfo.company && $store.state.app.userInfo.company.company_type==18" text="创建账号" @click="navTo('/subpkg/newPersonnel/newPersonnel')"></mybtn>
v-if="$store.state.app.userInfo.company && ($store.state.app.userInfo.company.company_type==18||$store.state.app.userInfo.company.company_type==16)"
text="创建账号" @click="navTo('/subpkg/newPersonnel/newPersonnel')"></mybtn>
</view> </view>
</template> </template>
@ -148,18 +146,18 @@
// console.log(a.substring(0, 10)) // console.log(a.substring(0, 10))
}, },
navTo(url) { navTo(url) {
if (url) { if(url){
uni.showLoading({ uni.showLoading({
title: '加载中', title: '加载中',
mask: true mask: true
}); });
uni.navigateTo({ uni.navigateTo({
url: url, url: url,
success() { success() {
uni.hideLoading() uni.hideLoading()
} }
}) })
} else Toast('暂未开放') }else Toast('暂未开放')
}, },
async initLoad() { async initLoad() {
this.loadConfig.page = 1; this.loadConfig.page = 1;
@ -204,9 +202,8 @@
<style lang="scss"> <style lang="scss">
.personnel { .personnel {
padding: 28rpx 0; padding: 28rpx 0;
padding-bottom: 160rpx; padding-bottom: 160rpx;
.new_btn { .new_btn {
position: fixed; position: fixed;
bottom: 30rpx; bottom: 30rpx;

View File

@ -18,39 +18,30 @@
: '../../static/icons/woman.png' : '../../static/icons/woman.png'
"> ">
</image> </image>
<!-- <view class="role" v-if="userInfo.roles">{{userInfo.roles[0]}}</view> -->
</view> </view>
<view class="id_card"> <view class="id_card">
<view>身份证号{{ userInfo.id_card }}</view> <view>身份证号{{ userInfo.id_card }}</view>
<!-- <view class="update" @click="updateShow(userInfo.id_card, 'id_card')">
<uni-icons type="compose" color="#F9AA32"></uni-icons>
</view> -->
</view> </view>
<view class="phone"> 联系电话{{ userInfo.phone }} </view> <view class="phone"> 联系电话{{ userInfo.phone }} </view>
</view> </view>
</view> </view>
<view v-if="$store.state.app.userInfo.company.company_type==18" class="bottom" style="margin-bottom: 10rpx; display: flex; align-items: center"> <view class="bottom" style="margin-bottom: 10rpx; display: flex; align-items: center">
是否为小队长 是否为小队长
<u-radio-group v-model="userInfo.is_captain" style="margin-left: 16rpx" disabled> <u-radio-group v-model="userInfo.is_captain" style="margin-left: 16rpx" disabled>
<u-radio :customStyle="{ marginRight: '16px' }" v-for="(item, index) in [ <u-radio :customStyle="{ marginRight: '16px' }" v-for="(item, index) in [
{ value: 1, label: '是' }, { value: 1, label: '是' },
{ value: 0, label: '否' }, { value: 0, label: '否' },
]" :key="index" :label="item.label" :name="item.value"> ]" :key="index" :label="item.label" :name="item.value">
</u-radio> </u-radio>
</u-radio-group> </u-radio-group>
<view class="update" @click="updateShow(userInfo.is_captain, 'is_captain')"> <view class="update" @click="updateShow(userInfo.is_captain, 'is_captain')">
<uni-icons type="compose" color="#F9AA32"></uni-icons> <uni-icons type="compose" color="#F9AA32"></uni-icons>
</view> </view>
</view> </view>
<view v-else-if="$store.state.app.userInfo.company.company_type==41" class="bottom" style="margin-bottom: 10rpx; display: flex; align-items: center">
是否为服务部长
<u-radio-group v-model="userInfo.is_service_manager" style="margin-left: 16rpx" disabled>
<u-radio :customStyle="{ marginRight: '16px' }" v-for="(item, index) in [
{ value: 1, label: '是' },
{ value: 0, label: '否' },
]" :key="index" :label="item.label" :name="item.value">
</u-radio>
</u-radio-group>
<!-- <view class="update" @click="updateShow(userInfo.is_captain, 'is_captain')">
<uni-icons type="compose" color="#F9AA32"></uni-icons>
</view> -->
</view>
<view class="bottom"> <view class="bottom">
负责区域<text>{{ 负责区域<text>{{
(userInfo.street_name || "") + (userInfo.street_name || "") +

View File

@ -13,15 +13,9 @@
{{item.create_time.slice(0, 10)}} {{item.create_time.slice(0, 10)}}
</view> </view>
<view class="" v-if="item.type==0"> <view class="">
{{item.company_b_name}}提出租赁车辆一辆 {{item.company_b_name}}提出租赁车辆一辆
</view> </view>
<view class="" v-if="item.type==1">
{{item.company_b_name}}上传自有车辆一辆
</view>
<view class="" v-if="item.type==2">
{{item.company_b_name}}提出解除租赁
</view>
</view> </view>
</view> </view>
@ -70,10 +64,6 @@
background-color: #FF7C32; background-color: #FF7C32;
color: white; color: white;
padding: 0 10rpx; padding: 0 10rpx;
font-size: 24rpx;
// line-height: rpx;
display: flex;
align-items: center;
width: 200rpx; width: 200rpx;
height: 50rpx; height: 50rpx;
margin-right: 10rpx; margin-right: 10rpx;

View File

@ -1,268 +0,0 @@
<template>
<view class="box">
<!-- 搜索 -->
<view class="" style="padding:10rpx 20rpx;">
<u-search :showAction="true" bgColor='white' @search="queryCarFn" placeholder="搜索车牌号" actionText="搜索"
:animation="true" v-model="queryCar" @custom='queryCarFn'></u-search>
</view>
<view style="height: 80vh;" v-if="carList.length==0">
<u-empty mode="search" marginTop='100' icon="/static/img/empty/data.png">
</u-empty>
</view>
<view v-else class="car-list" v-for="item,index in carList" :key="index">
<view class="car-info">
<view class="car-info-l">
<view class="">
<u--image :src="item.pic" width="150rpx" height="150rpx" style="margin-right:20rpx"></u--image>
</view>
<view class="car-info-c">
<view class="lincense">
车牌号: {{item.license}}
</view>
<!-- <view class="lincense">
行驶里程: 1212KM
</view> -->
<view class="lincense" v-if="item.flag">
当前状态: 当前使用中
</view>
<view class="lincense" v-else>
当前状态: 闲置中
</view>
</view>
</view>
<!-- -->
<view class="car-info-r">
<view class="" style="margin: 10rpx 50rpx;">
<u-checkbox-group v-model="item.checked" placement="column" @change="checkboxChange(item.id)">
<u-checkbox>
</u-checkbox>
</u-checkbox-group>
</view>
<view class="" v-show="item.id==carCheckedArr[0] &&type!=2">
选择该车辆为监管车辆
</view>
</view>
</view>
</view>
<view class="bottom">
<view class="" @tap="open">
已选择{{carCheckedArr.length}}辆车
</view>
<view class="bottom-btn" @tap="buyCarFn">
<u-button type="primary" style="background-color: #0122C7;border: none;" text="确定"></u-button>
</view>
</view>
<!-- 组件 -->
<u-popup :show="showPop" mode="bottom" @close="close" @open="open">
<view class="pop">
<view class="check-car-list" v-for="item,index in carList" v-show="item.checked.length" :key="index">
<u--image :src="item.pic" width="150rpx" height="150rpx"></u--image>
<view class="" style="margin-top: 10rpx;">
{{item.license}}
</view>
<view class="pop-check">
<u-checkbox-group v-model="item.checked" @change="popChange(item.id)">
<u-checkbox>
</u-checkbox>
</u-checkbox-group>
</view>
</view>
</view>
</u-popup>
</view>
</template>
<script scoped>
// import { methods } from '../../uni_modules/uview-ui/libs/mixin/mixin'
import {
canBuyCarListApi,
buyCarApi
} from "@/api/property.js"
import {
Toast
} from "../../libs/uniApi"
export default {
data() {
return {
queryCar: '',
carList: [],
carListI: [],
showPop: false,
carCheckeList: [],
carCheckedArr: [],
type: "",
}
},
methods: {
buyCarFn() {
if (this.carCheckedArr.length == 0) {
Toast("请先选择车辆!")
return
}
let data = []
this.carList.forEach(item => {
this.carCheckedArr.forEach(items => {
if (item.id == items) {
data.push({
id: item.id,
license: item.license
})
}
})
})
let datas = JSON.stringify(data)
buyCarApi({
cars: datas
}).then(res => {
Toast("申请成功!")
setTimeout(() => {
uni.redirectTo({
url: '/subpkg/property/index'
})
}, 1000)
})
// uni.navigateTo({
// url: '/subpkg/property/index'
// })
},
queryCarFn() {
this.carList = []
this.carListI.forEach(item => {
// console.log(item.license)
if (item.license.includes(this.queryCar)) {
this.carList.push(item)
}
})
},
checkboxChange(i) {
if (this.carCheckedArr.includes(i)) {
// let index=this.ca
let index = this.carCheckedArr.indexOf(i)
// console.log(index)
this.carCheckedArr.splice(index, 1)
// this.arr
} else {
this.carCheckedArr.push(i)
}
console.log(this.carCheckedArr)
},
popChange(index) {
this.checkboxChange(index)
// console.log(this.carCheckedArr)
},
close() {
this.showPop = false
},
open() {
if (this.carCheckedArr.length == 0) return
this.showPop = true
},
change(e) {
console.log(e)
}
},
onLoad(option) {
this.type = option.type
// console.log(option.license)
canBuyCarListApi().then(res => {
res.data.forEach(item => {
if (item.license == option.license) {
item.flag = true
}
})
this.carListI = res.data
this.carList = Array.from(this.carListI);
})
}
}
</script>
<style lang="scss" scoped>
.box {
padding-bottom: 100rpx;
}
.car-list {
padding: 20rpx;
background-color: #fff;
.car-info {
display: flex;
justify-content: space-between;
margin-bottom: 20rpx;
.car-info-l {
display: flex;
}
.car-info-c {
display: flex;
flex-direction: column;
justify-content: space-between;
}
.car-info-r {
max-width: 20vw;
}
}
}
.pop {
min-height: 40vh;
display: flex;
flex-wrap: wrap;
box-sizing: border-box;
padding: 20rpx 10rpx;
padding-right: 0;
padding-bottom: 100rpx;
.check-car-list {
// margin-right: 30rpx;
width: 182.5rpx;
display: flex;
// justify-tent: ;
flex-direction: column;
align-items: center;
position: relative;
}
.pop-check {
position: absolute;
right: 0;
top: -5rpx;
}
}
.bottom {
background-color: white;
height: 100rpx;
position: fixed;
bottom: 0;
z-index: 1000;
width: 100vw;
box-sizing: border-box;
border-radius: 30rpx 30rpx 0 0;
padding: 0 20rpx;
display: flex;
align-items: center;
justify-content: space-between;
.bottom-btn {
width: 200rpx;
}
}
</style>

View File

@ -46,12 +46,12 @@
<view class="car_type"> <view class="car_type">
<text>自有车辆</text> <text>自有车辆</text>
</view> </view>
<view class="car_li" v-for="(item,index) in dataList.cars_info"> <view class="car_li">
<view class="" style="display: flex;justify-content: space-between;align-items: center;"> <view class="" style="display: flex;justify-content: space-between;align-items: center;">
<view class="" style="display: flex;align-items: center;"> <view class="" style="display: flex;align-items: center;">
<u--image :src="item.pic" width="100rpx" height="100rpx"></u--image> <u--image :src="dataList.cars_info.pic" width="100rpx" height="100rpx"></u--image>
<view class="" style="margin-left: 10rpx;"> <view class="" style="margin-left: 10rpx;">
车牌号{{item.license}} 车牌号{{dataList.cars_info.license}}
</view> </view>
</view> </view>
@ -133,7 +133,7 @@
<view class="name">{{typeFn( dataList.type) }} <view class="name">{{typeFn( dataList.type) }}
</view> </view>
<view> <view>
<text>{{dataList.update_time}}</text> <text>{{'2023-03-03'}}</text>
</view> </view>
</view> </view>
</view> </view>
@ -202,11 +202,11 @@
this.dataList = res.data.vehicleContract this.dataList = res.data.vehicleContract
this.carList = res.data.vehicleRentCars this.carList = res.data.vehicleRentCars
this.checked = [this.carList[0]?.car_id] || '' this.checked = [this.carList[0]?.car_id] || ''
this.dataList.cars_info = JSON.parse(this.dataList.cars_info) || ""
// if (this.dataList.status == 3) { // if (this.dataList.status == 3) {
// uni.navigateBack() // uni.navigateBack()
// } // }
console.log(this.dataList.cars_info.pic)
if (this.carList.length > 0 || this.dataList.cars_info) { if (this.carList.length > 0 || this.dataList.cars_info) {
this.flag1 = false this.flag1 = false
} }
@ -244,7 +244,7 @@
return "租赁合同" return "租赁合同"
} }
if (status == 1) { if (status == 1) {
return "自有车" return "自有车"
} }
if (status == 2) { if (status == 2) {
"解除合同" "解除合同"

View File

@ -30,7 +30,7 @@
export default { export default {
data() { data() {
return { return {
datasList: [], datasList: [1, 2, 3],
} }
}, },
onLoad() { onLoad() {

View File

@ -4,23 +4,23 @@
<u-loading-page :loading="showLoading"></u-loading-page> <u-loading-page :loading="showLoading"></u-loading-page>
</view> </view>
<view class="" v-else> <view class="" v-else>
<!-- 小组公司 --> <!-- 小组公司 -->
<view class="noCar" v-if='company_type==18'> <view class="noCar" v-if='company_type==18'>
<!-- 申请 --> <!-- 申请 -->
<view class="" v-if="step==6||step==9999"> <view class="" v-if="step==6||step==9999">
<u-empty text="你还没有所属车辆哦,请向镇公司申请用车或使用自有车辆并绑定系统~" icon="../../static/img/empty/data.png"> <u-empty text="你还没有所属车辆哦,请向镇公司申请用车或使用自有车辆并绑定系统~" icon="../../static/img/empty/data.png">
</u-empty> </u-empty>
<view>
<mytn text='购买车辆' class="buyCar" :position="false" @click="navgo('/subpkg/property/buyCar')">
</mytn>
</view>
<view> <view>
<mytn text='申请用车' class="upCar" :position="false" @click="applycarFn"></mytn> <mytn text='申请用车' class="upCar" :position="false" @click="applycarFn"></mytn>
</view> </view>
<view class=""> <view class="">
<mytn text='上传自有车辆' @click="show=true"></mytn> <mytn text='上传自有车辆' @click="show=true"></mytn>
</view> </view>
<u-modal :show="show" @close="show=false" :showCancelButton="true" @confirm="upCarFn" <u-modal :show="show" @close="show=false" :showCancelButton="true" @confirm="upCarFn"
:closeOnClickOverlay="true" @cancel="show=false" title="车辆上传"> :closeOnClickOverlay="true" @cancel="show=false" title="车辆上传">
<view class="slot-content"> <view class="slot-content">
@ -44,7 +44,7 @@
</view> </view>
<view class="uplode" v-else> <view class="uplode" v-else>
<u-icon name="plus-circle-fill" color="#0022C7" size="28"></u-icon> <u-icon name="plus-circle-fill" color="#0022C7" size="28"></u-icon>
上传车辆图片 上传头像
<view class="up" style="opacity: 0;"> <view class="up" style="opacity: 0;">
<u-upload :fileList="imgUrl?[{url:imgUrl}]:[]" <u-upload :fileList="imgUrl?[{url:imgUrl}]:[]"
@afterRead="afterReadAvatar" :maxCount="1"> @afterRead="afterReadAvatar" :maxCount="1">
@ -60,10 +60,13 @@
</view> </view>
</view> </view>
</u-modal> </u-modal>
</view> </view>
<!-- 等待 --> <!-- 等待 -->
<view class="" v-if='[5,-1,0,1,2].includes(step)'> <view class="" v-if='[5,-1,0,1,2].includes(step)'>
<view class="loading" v-if='step==5'> <view class="loading" v-if='step==5'>
<span>你已提交解除申请,等待签约</span> <span>你已提交解除申请,等待签约</span>
<span class="dots">...</span> <span class="dots">...</span>
@ -76,7 +79,6 @@
<span class="dots">...</span> <span class="dots">...</span>
</view> </view>
</view> </view>
<!-- 申请用车 --> <!-- 申请用车 -->
<view v-if="datas.type ==0"> <view v-if="datas.type ==0">
<view class="loading"> <view class="loading">
@ -84,13 +86,7 @@
<span class="dots">...</span> <span class="dots">...</span>
</view> </view>
</view> </view>
<!-- 购买车辆 -->
<view class="loading" v-if="datas.type==3">
<span>您的购车申请已经提交我们正在加快审核中请耐心等待在此期间您可以继续使用车辆完成配送任务哦~</span>
<span class="dots">...</span>
</view>
</view> </view>
<!-- 审核结束 --> <!-- 审核结束 -->
<view class="" v-if="step==4"> <view class="" v-if="step==4">
<view style="margin-top: 15vh;"> <view style="margin-top: 15vh;">
@ -105,16 +101,16 @@
</view> </view>
</view> </view>
<view class=""> <view class="">
<mytn text='购买车辆' class="buyCar" :position="false" @click="navgo('/subpkg/property/buyCar')">
</mytn>
<view class="" style="margin: 20rpx 0;"> <view class="" style="margin: 20rpx 0;">
<mytn text='上传自有车辆' @click="show=true"></mytn> <mytn text='上传自有车辆' @click="show=true"></mytn>
</view> </view>
<view class=""> <view class="">
<mytn text='申请用车' :position="false" class="upCar" @click="applycarFn"></mytn> <mytn text='申请用车' :position="false" class="upCar" @click="applycarFn"></mytn>
</view> </view>
<u-modal :show="show" @close="show=false" :showCancelButton="true" @confirm="upCarFn" <u-modal :show="show" @close="show=false" :showCancelButton="true" @confirm="upCarFn"
:closeOnClickOverlay="true" @cancel="show=false" title="车辆上传"> :closeOnClickOverlay="true" @cancel="show=false" title="车辆上传">
<view class="slot-content"> <view class="slot-content">
@ -138,7 +134,7 @@
</view> </view>
<view class="uplode" v-else> <view class="uplode" v-else>
<u-icon name="plus-circle-fill" color="#0022C7" size="28"></u-icon> <u-icon name="plus-circle-fill" color="#0022C7" size="28"></u-icon>
上传车辆图片 上传头像
<view class="up" style="opacity: 0;"> <view class="up" style="opacity: 0;">
<u-upload :fileList="imgUrl?[{url:imgUrl}]:[]" <u-upload :fileList="imgUrl?[{url:imgUrl}]:[]"
@afterRead="afterReadAvatar" :maxCount="1"> @afterRead="afterReadAvatar" :maxCount="1">
@ -170,13 +166,13 @@
申请用车</u-button> 申请用车</u-button>
</view> </view>
</view> </view>
</view> </view>
<!-- 镇街公司 --> <!-- 镇街公司 -->
<view v-if='company_type==41'> <view v-if='company_type==16'>
<view class="info"> <view class="info">
<text>可监管车辆数量 {{datas.monitor_num}}</text> <text>可监管车辆数量 {{datas.monitor_num}}</text>
<text>购买车辆 {{datas.buy_num}}</text>
<view @click="showPop=true" class="not_leased"> <view @click="showPop=true" class="not_leased">
<view class=""> <view class="">
租赁 {{datas.rent_num}}<text v-if="datas.apply_num">(待审核:{{datas.apply_num}})</text> 租赁 {{datas.rent_num}}<text v-if="datas.apply_num">(待审核:{{datas.apply_num}})</text>
@ -188,7 +184,6 @@
</view> </view>
</view> </view>
<text v-if="datas.self_num">自有车辆 {{datas.self_num}}</text> <text v-if="datas.self_num">自有车辆 {{datas.self_num}}</text>
<!-- <text v-if="datas.self_num">出售车辆 {{datas.self_num}}</text> -->
</view> </view>
<!-- 公告栏 --> <!-- 公告栏 -->
<view class="application_tit" v-if="applicationList.length"> <view class="application_tit" v-if="applicationList.length">
@ -213,6 +208,7 @@
<u-icon name="arrow-right"></u-icon> <u-icon name="arrow-right"></u-icon>
</view> </view>
</view> </view>
</view> </view>
</view> </view>
<view class="personnel_list"> <view class="personnel_list">
@ -231,8 +227,7 @@
<text> {{item.rent_user.user_name}}</text> <text> {{item.rent_user.user_name}}</text>
<view style="float: right;"> <view style="float: right;">
<text style="color: green;" v-if="item.type==1">自有车辆</text> <text style="color: green;" v-if="item.type==1">自有车辆</text>
<text style="color: orange;" v-if='item.type==0'>租赁车辆</text> <text style="color: orange;" v-else>租赁车辆</text>
<text style="color: orange;" v-if='item.type==2'>购买车辆</text>
</view> </view>
</view> </view>
<view class="li"> <view class="li">
@ -277,6 +272,7 @@
<view class="slot-content"> <view class="slot-content">
<u--input placeholder="请输入内容" type="number" v-model="newCarNum"></u--input> <u--input placeholder="请输入内容" type="number" v-model="newCarNum"></u--input>
<view style="color: red;font-size: 20rpx;" v-show="novalue"> <view style="color: red;font-size: 20rpx;" v-show="novalue">
<view class="" v-if="newCarNum>datas.can_rent_num"> <view class="" v-if="newCarNum>datas.can_rent_num">
数量超过上限 数量超过上限
</view> </view>
@ -300,16 +296,13 @@
</template> </template>
<script> <script>
import {
FILE_URL_IM
} from "@/api/file.js"
import { import {
getvehicleListApi, getvehicleListApi,
getAgencyListApi, getAgencyListApi,
leaseApi, leaseApi,
upVehicleApi, upVehicleApi,
getAgencyDetailApi, getAgencyDetailApi,
// getvehicleDetailApi, getvehicleDetailApi,
villageCompanyApi, villageCompanyApi,
} from "@/api/property.js" } from "@/api/property.js"
@ -348,57 +341,70 @@
newcarTit: "", newcarTit: "",
flag: false, flag: false,
showpopp: false, showpopp: false,
}; };
}, },
onLoad() { onLoad() {
// this.initIndex()
// if (true) {
// uni.navigateTo({
// url: '/subpkg/property/vehicle_a'
// })
// }
// getvehicleListApi().then(res => {
// console.log(res)
// // this.getvehicleList = res
// })
// getAgencyListApi().then(res => {
// // this.applicationList=res
// })
this.initIndex()
setTimeout(() => { setTimeout(() => {
this.flag = true this.flag = true
}) })
}, },
onShow() {
this.initIndex()
},
onPullDownRefresh() { onPullDownRefresh() {
this.initIndex() this.initIndex()
//
// setTimeout(() => {
// const newList = this.hostProduct.reverse();
// this.hostProduct = newList;
uni.stopPullDownRefresh(); uni.stopPullDownRefresh();
// }, 500)
}, },
methods: { methods: {
// //
initIndex() { initIndex() {
let type = this.$store.state.app.userInfo.company.company_type let type = (JSON.parse(Cache.get("USER_INFO")).company.company_type)
this.company_type = type this.company_type = type
// //
if (type == 18) { if (type == 18) {
villageCompanyApi().then(res => { villageCompanyApi().then(res => {
this.showLoading = false this.showLoading = false
this.datas = res.data this.datas = res.data
console.log(res.data?.id) this.step = res.data?.status || 9999
if (res.data?.id) {
this.step = res.data?.status
} else {
this.step = 9999
}
if (this.step == 3) { if (this.step == 3) {
uni.redirectTo({ uni.redirectTo({
url: `/subpkg/property/vehicle_a?id=${res.data.cars_info.id}` url: `/subpkg/property/vehicle_a?id=${res.data.cars_info.id}`
}) })
} }
}) })
} }
// //
else { else {
getvehicleListApi().then(res => { getvehicleListApi().then(res => {
this.datas = res.data this.datas = res.data
res.data.apply.length >= 2 ? this.applicationList = res.data.apply : this.applicationList = res.data.apply.length >= 2 ? this.applicationList = res.data.apply : this.applicationList =
res.data.apply.slice(0, 2) res
.data.apply.slice(0, 2)
this.dataList = res.data.car_list this.dataList = res.data.car_list
this.showLoading = false this.showLoading = false
}) })
} }
@ -413,7 +419,7 @@
}, },
confirmFn() { confirmFn() {
uni.reLaunch({ uni.reLaunch({
url: '/subpkg/property/index' url: '/subpkg/property/index' //
}); });
}, },
@ -448,6 +454,7 @@
}) })
}, 2000) }, 2000)
}) })
this.show = false this.show = false
this.noInfo = false this.noInfo = false
@ -549,19 +556,7 @@
position: fixed; position: fixed;
bottom: 110rpx; bottom: 110rpx;
left: 0; left: 0;
z-index: 1; // z-index: 9999999;
width: 100%;
border-radius: 0;
color: #fff;
height: 90rpx;
line-height: 90rpx;
background-color: $theme-oa-color;
}
.buyCar {
position: fixed;
bottom: 220rpx;
left: 0;
z-index: 1; z-index: 1;
width: 100%; width: 100%;
border-radius: 0; border-radius: 0;

View File

@ -1,67 +1,63 @@
<template> <template>
<view> <view>
<!-- <view v-if='showLoading'> <!-- <view v-if='showLoading'>
<u-loading-page :loading="showLoading"></u-loading-page> <u-loading-page :loading="showLoading"></u-loading-page>
</view> --> </view> -->
<view> <view>
<view class="content"> <view class="content">
<u-toast ref="uToast"></u-toast> <u-toast ref="uToast"></u-toast>
<view class="map" style="position: relative;"> <view class="map" style="position: relative;">
<map :class="mapClass" id="map" @markertap='mapFun' :enable-zoom="true" :polyline="polyline" <map :class="mapClass" id="map" @markertap='mapFun' :enable-zoom="true" :polyline="polyline"
:markers='markers' :scale="scale" style="width:100%;height: 100%;" :latitude="markers[0].latitude" :markers='markers' :scale="scale" style="width:100%;height: 100%;"
:enable-scroll="true" :longitude="markers[0].longitude"> :latitude="markers[0].latitude" :enable-scroll="true" :longitude="markers[0].longitude">
</map> </map>
<!-- <cover-view v-show="modelShow" style="background-color: rgba(#000, 0.9);height: 100px;width: 100px;position: absolute;top: 0;left: 0;"></cover-view> --> <!-- <cover-view v-show="modelShow" style="background-color: rgba(#000, 0.9);height: 100px;width: 100px;position: absolute;top: 0;left: 0;"></cover-view> -->
</view> </view>
<view class="map_address"> <view class="map_address">
<view class="li"> <view class="li">
<view style="display: flex;justify-content: left;"> <view style="display: flex;justify-content: left;">
<view style="flex-shrink: 0;margin-right: 14rpx;"> <view style="flex-shrink: 0;margin-right: 14rpx;">
<text class="cir" style="background-color: #40BC5E;"></text> <text class="cir" style="background-color: #40BC5E;"></text>
中转站: 中转站:
</view> </view>
<view v-if="address.transfer">{{address.transfer.address}}</view> <view v-if="address.transfer">{{address.transfer.address}}</view>
</view> </view>
<view v-if="status!=5||address.transfer.status==2" <view v-if="status!=5||address.transfer.status==2" :class="{lg_status1:address.transfer.status==2,lg_status2:address.transfer.status==1}" style="margin-top: 10rpx;">
:class="{lg_status1:address.transfer.status==2,lg_status2:address.transfer.status==1}" <text class="cir" style="background-color: transparent;"></text>
style="margin-top: 10rpx;"> <text>车辆状态</text>
<text class="cir" style="background-color: transparent;"></text>
<text>车辆状态</text>
<text v-if="address.transfer.status==2">已完成</text> <text v-if="address.transfer.status==2">已完成</text>
<text v-else style="color: #FF7C32;">进行中</text> <text v-else style="color: #FF7C32;">进行中</text>
</view> </view>
<view v-else class="red" style="margin-top: 10rpx;"> <view v-else class="red" style="margin-top: 10rpx;">
<text class="cir" style="background-color: transparent;"></text> <text class="cir" style="background-color: transparent;"></text>
<text>车辆状态</text> <text>车辆状态</text>
<text>未完成</text> <text>未完成</text>
</view> </view>
</view> </view>
<view class="li"> <view class="li">
<view style="display: flex;justify-content: left;"> <view style="display: flex;justify-content: left;">
<view style="flex-shrink: 0;margin-right: 14rpx;"> <view style="flex-shrink: 0;margin-right: 14rpx;">
<text class="cir" style="background-color: #40BC5E;"></text> <text class="cir" style="background-color: #40BC5E;"></text>
&emsp;: &emsp;:
</view> </view>
<view v-if="address.terminus">{{address.terminus.address}}</view> <view v-if="address.terminus">{{address.terminus.address}}</view>
</view> </view>
<view <view :class="{red: address.terminus.status!=2&&address.transfer.status==1,yellow:address.transfer.status!=1&&address.terminus.status!=2, green: address.terminus.status==2}" style="margin-top: 10rpx;">
:class="{red: address.terminus.status!=2&&address.transfer.status==1,yellow:address.transfer.status!=1&&address.terminus.status!=2, green: address.terminus.status==2}" <text class="cir" style="background-color: transparent;"></text>
style="margin-top: 10rpx;"> <text :class="{red: status==5}">车辆状态</text>
<text class="cir" style="background-color: transparent;"></text>
<text :class="{red: status==5}">车辆状态</text>
<text v-if="address.terminus.status==2">已完成</text> <text v-if="address.terminus.status==2">已完成</text>
<text v-else-if="address.transfer.status==1">未开始</text> <text v-else-if="address.transfer.status==1">未开始</text>
<text v-else-if="status!=5">进行中</text> <text v-else-if="status!=5">进行中</text>
<text v-else :class="{red: status==5}">未完成</text> <text v-else :class="{red: status==5}">未完成</text>
</view> </view>
</view> </view>
</view> </view>
</view> </view>
</view> </view>
<mybtn v-if="status==1" @click="modelShow=true" text="抵达地点(中转站) 1/2"></mybtn> <mybtn v-if="status==1" @click="modelShow=true" text="抵达地点(中转站) 1/2"></mybtn>
<mybtn v-else-if="status==2" @click="modelShow=true" text="抵达地点(终点) 2/2"></mybtn> <mybtn v-else-if="status==2" @click="modelShow=true" text="抵达地点(终点) 2/2"></mybtn>
<mybtn v-else-if="status==3" text="任务已完成" my_btn_disabled></mybtn> <mybtn v-else-if="status==3" text="任务已完成" my_btn_disabled></mybtn>
<mybtn v-else-if="status==5" text="任务已关闭" my_btn_disabled></mybtn> <mybtn v-else-if="status==5" text="任务已关闭" my_btn_disabled></mybtn>
<cover-view v-show="modelShow" class="cover"> <cover-view v-show="modelShow" class="cover">
<cover-view class="cover_model"> <cover-view class="cover_model">
<cover-view class="model_title">标题</cover-view> <cover-view class="model_title">标题</cover-view>
@ -78,278 +74,258 @@
</cover-view> </cover-view>
<!-- <u-modal :show="modelShow" title="提示" content='确认您已到达目标地点' closeOnClickOverlay showCancelButton <!-- <u-modal :show="modelShow" title="提示" content='确认您已到达目标地点' closeOnClickOverlay showCancelButton
@close="modelShow=false" @cancel="modelShow=false" @confirm="getFn();modelShow=false"></u-modal> --> @close="modelShow=false" @cancel="modelShow=false" @confirm="getFn();modelShow=false"></u-modal> -->
</view> </view>
</template> </template>
<script> <script>
import mybtn from "@/components/mybtn/mybtn.vue" import mybtn from "@/components/mybtn/mybtn.vue"
import { import {
taskTricycleDetail, taskTricycleDetail,
taskAddTricycleCoordinate taskAddTricycleCoordinate
} from "@/api/task.js" } from "@/api/task.js"
import { import {
Toast Toast
} from "../../libs/uniApi"; } from "../../libs/uniApi";
export default { export default {
components: { components: {
mybtn mybtn
}, },
data() { data() {
return { return {
modelShow: false, modelShow: false,
status: 1, status: 1,
mapClass: 'custom-map', mapClass: 'custom-map',
showLoading: true, showLoading: true,
showPop: false, showPop: false,
goodsDetil: undefined, goodsDetil: undefined,
scale: 17, scale: 17,
nowAddress: "无", nowAddress: "无",
markers: [ markers: [
// //
{ {
id: 1, id: 1,
latitude: 28.8733, latitude: 28.8733,
longitude: 105.445717, longitude: 105.445717,
iconPath: '../../static/img/logistics/WZ.png', // iconPath: '../../static/img/logistics/WZ.png', //
}, },
// //
{ {
id: 2, id: 2,
latitude: undefined, latitude: undefined,
longitude: undefined, longitude: undefined,
iconPath: '../../static/img/logistics/SL.png', // iconPath: '../../static/img/logistics/SL.png', //
} }
], ],
polyline: [], polyline: [],
task_id: -1, task_id: -1,
address: { address: {
transfer: { transfer: {
status: 1 status: 1
}, },
terminus: { terminus: {
status: 1 status: 1
} }
} }
} }
}, },
onLoad(options) { onLoad(options) {
this.task_id = options.task_id; this.task_id = options.task_id;
this.locationFn(); this.locationFn();
this.initPosition(); this.initPosition();
}, },
methods: { methods: {
// //
async initPosition() { async initPosition() {
let res = await taskTricycleDetail({ let res = await taskTricycleDetail({
id: this.task_id id: this.task_id
}); });
this.address = res.data.extend; this.address = res.data.extend;
if (res.data.extend?.update?.transfer?.lnglat[0]) { //, if (res.data.extend?.update?.transfer?.lnglat[0]) { //,
this.markers[0].latitude = +res.data.extend.terminus.lnglat[1]; this.markers[0].latitude = +res.data.extend.terminus.lnglat[1];
this.markers[0].longitude = +res.data.extend.terminus.lnglat[0]; this.markers[0].longitude = +res.data.extend.terminus.lnglat[0];
this.status = 2; this.status = 2;
this.address.transfer['status'] = 2; this.address.transfer['status'] = 2;
} else { // , } else { // ,
this.markers[0].latitude = +res.data.extend.transfer.lnglat[1]; this.markers[0].latitude = +res.data.extend.transfer.lnglat[1];
this.markers[0].longitude = +res.data.extend.transfer.lnglat[0]; this.markers[0].longitude = +res.data.extend.transfer.lnglat[0];
this.address.transfer['status'] = 1; this.address.transfer['status'] = 1;
} }
if (res.data.extend?.update?.terminus?.lnglat[0] || res.data.status == 3) { if (res.data.extend?.update?.terminus?.lnglat[0]||res.data.status==3) {
this.address.terminus['status'] = 2; this.address.terminus['status'] = 2;
this.status = 3; this.status = 3;
} else this.address.terminus['status'] = 1; } else this.address.terminus['status'] = 1;
if (res.data.status == 5) { if(res.data.status==5){
this.status = 5; this.status = 5;
} }
}, },
// //
locationFn() { locationFn() {
let that = this; let that = this;
uni.showLoading({ uni.getLocation({
title: '获取位置中' type: 'gcj02',
}) geocode: true,
if (uni.getStorageSync('uniMP')) { isHighAccuracy: true,
uni.sendHostEvent('getLocation', '获取位置', (ret) => { success: function async (res) {
uni.$on('uniMP_getLocation', (res) => { that.markers[1].latitude = res.latitude;
try { that.markers[1].longitude = res.longitude;
if (!res.latitude) new Error(); that.getDriverLine();
that.markers[1].latitude = res.latitude; that.$u.sleep(500).then(()=>{
that.markers[1].longitude = res.longitude; uni.hideLoading();
that.getDriverLine();
uni.hideLoading();
} catch (e) {
uni.hideLoading();
Toast('获取位置失败');
console.log(e);
}
}) })
}); },
} else { fail() {
uni.getLocation({ that.$u.sleep(1000).then(()=>{
// type: 'gcj02', uni.hideLoading();
// geocode: true, Toast('获取位置失败');
isHighAccuracy: true, })
highAccuracyExpireTime: 5 * 1000, }
accuracy: 'best', });
success: (res) => { },
that.markers[1].latitude = res.latitude; showToast() {
that.markers[1].longitude = res.longitude; this.$refs.uToast.show({
that.getDriverLine(); type: 'success',
uni.hideLoading(); title: '成功主题(带图标)',
console.log(res); message: "操作成功",
}, iconUrl: 'https://cdn.uviewui.com/uview/demo/toast/success.png'
fail(e) { })
uni.hideLoading(); },
Toast('获取位置失败'); mapFun() {
console.log(e); uni.openLocation({
} latitude: Number(this.goodsDetil.logistics.shop_lat),
}); longitude: Number(this.goodsDetil.logistics.shop_long),
} address: this.goodsDetil.logistics.shop_address,
}, name: this.goodsDetil.logistics.shop_name,
showToast() { scale: 15,
this.$refs.uToast.show({ });
type: 'success', },
title: '成功主题(带图标)', showToast() {
message: "操作成功", this.$refs.uToast.show({
iconUrl: 'https://cdn.uviewui.com/uview/demo/toast/success.png' type: 'success',
}) title: '成功主题(带图标)',
}, message: "操作成功",
mapFun() { iconUrl: 'https://cdn.uviewui.com/uview/demo/toast/success.png'
uni.openLocation({ })
latitude: Number(this.goodsDetil.logistics.shop_lat), },
longitude: Number(this.goodsDetil.logistics.shop_long), //
address: this.goodsDetil.logistics.shop_address, getDistance(point1, point2) {
name: this.goodsDetil.logistics.shop_name, const rad = Math.PI / 180.0;
scale: 15, const lat1 = point1.latitude;
}); const lng1 = point1.longitude;
}, const lat2 = point2.latitude;
showToast() { const lng2 = point2.longitude;
this.$refs.uToast.show({ const dlat = lat2 - lat1;
type: 'success', const dlng = lng2 - lng1;
title: '成功主题(带图标)', const a =
message: "操作成功", Math.sin(dlat / 2 * rad) * Math.sin(dlat / 2 * rad) +
iconUrl: 'https://cdn.uviewui.com/uview/demo/toast/success.png' Math.cos(lat1 * rad) * Math.cos(lat2 * rad) *
}) Math.sin(dlng / 2 * rad) * Math.sin(dlng / 2 * rad);
}, const c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a));
// const distance = 6378137 * c;
getDistance(point1, point2) { return distance;
const rad = Math.PI / 180.0; },
const lat1 = point1.latitude; //
const lng1 = point1.longitude; getFn() {
const lat2 = point2.latitude; uni.showLoading({
const lng2 = point2.longitude; title: '上传中',
const dlat = lat2 - lat1; mask: true
const dlng = lng2 - lng1; })
const a = this.locationFn()
Math.sin(dlat / 2 * rad) * Math.sin(dlat / 2 * rad) + // console.log(this.getDistance(this.markers[0], this.markers[1]))
Math.cos(lat1 * rad) * Math.cos(lat2 * rad) * if ((this.getDistance(this.markers[0], this.markers[1]) >> 0) > 10000) {
Math.sin(dlng / 2 * rad) * Math.sin(dlng / 2 * rad); return Toast('距离目标位置过远');
const c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a)); } else {
const distance = 6378137 * c; let data;
return distance; if (this.status == 1) data = {
}, id: this.task_id,
// transfer: {
getFn() { lnglat: [
if(this.markers[0].latitude==undefined||this.markers[0].latitude==undefined) return this.locationFn(); this.markers[1].longitude,
uni.showLoading({ this.markers[1].latitude
title: '上传中', ]
mask: true }
}) };
// this.locationFn() else data = {
if ((this.getDistance(this.markers[0], this.markers[1]) >> 0) > 10000) { id: this.task_id,
return Toast('距离目标位置过远'); terminus: {
} else { lnglat: [
let data; this.markers[1].longitude,
if (this.status == 1) data = { this.markers[1].latitude
id: this.task_id, ]
transfer: { }
lnglat: [ };
this.markers[1].longitude, taskAddTricycleCoordinate(data).then(() => {
this.markers[1].latitude uni.hideLoading()
] Toast('上传成功!')
} this.initPosition();
}; this.locationFn();
else data = { })
id: this.task_id, }
terminus: { },
lnglat: [ getDriverLine() {
this.markers[1].longitude, const that = this;
this.markers[1].latitude const key = "997c9a3d88154fa78f4d28bebc1dd84f";
] const origin = `${this.markers[1].longitude},${this.markers[1].latitude}`;
} const destination = `${this.markers[0].longitude},${this.markers[0].latitude}`;
}; uni.request({
taskAddTricycleCoordinate(data).then(() => { // url: `https://restapi.amap.com/v3/direction/walking?key=${key}&origin=105.43639400000002,28.908854&destination=105.439304,28.908447`,
uni.hideLoading() url: `https:restapi.amap.com/v4/direction/bicycling?key=${key}&origin=${origin}&destination=${destination}`,
Toast('上传成功!') success: (res) => {
this.initPosition(); const data = res.data.data;
this.locationFn(); var points = [];
}) if (data.paths && data.paths[0] && data.paths[0].steps) {
} var steps = data.paths[0].steps;
}, for (var i = 0; i < steps.length; i++) {
getDriverLine() { //points
const that = this; var poLen = steps[i].polyline.split(";");
const key = "997c9a3d88154fa78f4d28bebc1dd84f"; for (var j = 0; j < poLen.length; j++) {
const origin = `${this.markers[1].longitude},${this.markers[1].latitude}`; points.push({
const destination = `${this.markers[0].longitude},${this.markers[0].latitude}`; longitude: parseFloat(poLen[j].split(",")[0]),
uni.request({ latitude: parseFloat(poLen[j].split(",")[1]),
// url: `https://restapi.amap.com/v3/direction/walking?key=${key}&origin=105.43639400000002,28.908854&destination=105.439304,28.908447`, });
url: `https:restapi.amap.com/v4/direction/bicycling?key=${key}&origin=${origin}&destination=${destination}`, }
success: (res) => { }
const data = res.data.data; that.runningRoute = data.paths[0].steps[0].instruction;
var points = []; }
if (data.paths && data.paths[0] && data.paths[0].steps) {
var steps = data.paths[0].steps;
for (var i = 0; i < steps.length; i++) {
//points
var poLen = steps[i].polyline.split(";");
for (var j = 0; j < poLen.length; j++) {
points.push({
longitude: parseFloat(poLen[j].split(",")[0]),
latitude: parseFloat(poLen[j].split(",")[1]),
});
}
}
that.runningRoute = data.paths[0].steps[0].instruction;
}
uni.getSystemInfo({ uni.getSystemInfo({
success: function(e) { success: function(e){
if (e.platform == 'ios') { if (e.platform == 'ios') {
that.polyline = [{ that.polyline = [{
points: points, points: points,
color: "#0091ff", color: "#0091ff",
dottedLine: true, dottedLine: true,
width: 10, width: 10,
}, ]; }, ];
} else { }
else {
that.polyline = [{ that.polyline = [{
points: points, points: points,
color: "#0091ff", color: "#0091ff",
dottedLine: true, dottedLine: true,
width: 15, width: 15,
}, ]; }, ];
} }
} }
}) })
}, },
fail: function(res) { fail: function(res) {
console.log("获取路线失败", res); console.log("获取路线失败", res);
}, },
}); });
}, },
}, },
onPullDownRefresh() { onPullDownRefresh() {
// this.getOrderList(); // this.getOrderList();
// this.getIndexList() // this.getIndexList()
uni.stopPullDownRefresh(); uni.stopPullDownRefresh();
}, },
} }
</script> </script>
<style lang='scss' scoped> <style lang='scss' scoped>
.cover { .cover{
position: absolute; position: absolute;
top: 0; top: 0;
left: 0; left: 0;
@ -357,7 +333,7 @@
height: 100vh; height: 100vh;
background-color: rgba(#000, 0.3); background-color: rgba(#000, 0.3);
.cover_model { .cover_model{
position: absolute; position: absolute;
top: 50%; top: 50%;
left: 50%; left: 50%;
@ -369,102 +345,93 @@
display: flex; display: flex;
flex-direction: column; flex-direction: column;
justify-content: space-between; justify-content: space-between;
.model_title{
.model_title {
height: 92rpx; height: 92rpx;
line-height: 92rpx; line-height: 92rpx;
text-align: center; text-align: center;
font-size: 16px; font-size: 16px;
font-weight: bold; font-weight: bold;
} }
.model_content{
.model_content {
margin: 12px 25px 25px 25px; margin: 12px 25px 25px 25px;
font-size: 15px; font-size: 15px;
} }
.model_btn{
.model_btn {
display: flex; display: flex;
height: 96rpx; height: 96rpx;
font-size: 16px; font-size: 16px;
.item{
.item {
flex: 1; flex: 1;
text-align: center; text-align: center;
line-height: 96rpx; line-height: 96rpx;
} }
.model_confirm{
.model_confirm {
color: #0122c7; color: #0122c7;
} }
} }
} }
} }
.red{
.red {
color: #ff0000; color: #ff0000;
} }
.green{
.green {
color: #40bc5e; color: #40bc5e;
} }
.yellow{
.yellow {
color: #ff7c32; color: #ff7c32;
} }
.custom-map /deep/ .polyline {
stroke-width: 20px;
}
.custom-map /deep/ .polyline { .content {
stroke-width: 20px; padding: 2vh 3vw;
} background-color: #F5F5F5;
height: 100vh;
box-sizing: border-box;
}
.content { .map {
padding: 2vh 3vw; height: 60vh;
background-color: #F5F5F5; border-radius: 2vw;
height: 100vh; overflow: hidden;
box-sizing: border-box; }
}
.map { .map_address {
height: 60vh; background-color: white;
border-radius: 2vw; padding: 20rpx 10rpx;
overflow: hidden;
}
.map_address {
background-color: white;
padding: 20rpx 10rpx;
border-radius: 0 0 14rpx 14rpx; border-radius: 0 0 14rpx 14rpx;
.li { .li {
margin: 20rpx 0; margin: 20rpx 0;
line-height: 40rpx; line-height: 40rpx;
} }
.cir { .cir {
display: inline-block; display: inline-block;
width: 2vw; width: 2vw;
height: 2vw; height: 2vw;
border-radius: 2vw; border-radius: 2vw;
margin: 0 20rpx; margin: 0 20rpx;
} }
} }
.map_btn { .map_btn {
width: 50px; width: 50px;
height: 50px; height: 50px;
position: absolute; position: absolute;
bottom: 0px; bottom: 0px;
right: 0; right: 0;
z-index: 9999999; z-index: 9999999;
} }
.btn { .btn {
position: fixed; position: fixed;
bottom: 20rpx; bottom: 20rpx;
width: 90vw; width: 90vw;
left: 50%; left: 50%;
transform: translateX(-50%); transform: translateX(-50%);
} }
</style> </style>

View File

@ -24,9 +24,7 @@
<view class="right"> <view class="right">
<view class="li" style="display: flex;justify-content: space-between;"> <view class="li" style="display: flex;justify-content: space-between;">
<text>行驶总里程: {{datas.mileage}}</text> <text>行驶总里程: {{datas.mileage}}</text>
<text v-if="datas.type==2" style="color: green;">购买车辆</text> <text v-if="datas.type" style="color: green;">自有车辆</text>
<text v-if="datas.type==0" style="color: green;">租赁车辆</text>
<text v-if="datas.type==1" style="color: green;">自有车辆</text>
</view> </view>
<view class="li"> <view class="li">
<text>承租公司: </text> <text>承租公司: </text>
@ -48,7 +46,7 @@
<text>签约时间: </text> <text>签约时间: </text>
<text>{{datas.rent_time}} </text> <text>{{datas.rent_time}} </text>
</view> </view>
<view class="li" v-if="datas.type==1"> <view class="li" v-if="datas.type">
<text>到期时间: </text> <text>到期时间: </text>
<text> {{overDateFn(datas.rent_time) }} </text> <text> {{overDateFn(datas.rent_time) }} </text>
</view> </view>
@ -70,10 +68,7 @@
<u--image :showLoading="true" src="../../static/img/contract/pdf.png" width="80px" <u--image :showLoading="true" src="../../static/img/contract/pdf.png" width="80px"
height="80px"></u--image> height="80px"></u--image>
<view class="text"> <view class="text">
<view class="name" v-if="datas.type==0">租赁合同</view> <view class="name">租赁合同</view>
<view class="name" v-if="datas.type==1">自有车辆合同</view>
<view class="name" v-if="datas.type==2">购车合同</view>
<!-- <view class="name">购买合同</view> -->
<view> <view>
<text>{{ datas.create_time}}</text> <text>{{ datas.create_time}}</text>
</view> </view>
@ -87,12 +82,6 @@
</view> </view>
</view> </view>
</view> </view>
<mybtn text="购买车辆"
@click="navTo2(`/subpkg/property/buyCar?license=${datas.car_license}&type=${datas.type}`)"
v-if="company_type==18"></mybtn>
</view> </view>
<web-view style="height: 100vh;" :src="pdfUrl" v-if="showPDF"></web-view> <web-view style="height: 100vh;" :src="pdfUrl" v-if="showPDF"></web-view>
@ -174,16 +163,6 @@
}, },
methods: { methods: {
navTo(url) {
uni.navigateTo({
url
})
},
navTo2(url) {
uni.redirectTo({
url
})
},
// //
overDateFn(date) { overDateFn(date) {
var specifiedDate = new Date(date); var specifiedDate = new Date(date);
@ -229,7 +208,7 @@
end_time: `${this.queryData} 23:59:59`, end_time: `${this.queryData} 23:59:59`,
start_time: `${this.queryData} 00:00:00`, start_time: `${this.queryData} 00:00:00`,
}).then(res => { }).then(res => {
// console.log(res.data) console.log(res.data)
this.markers[0].latitude = res.data[0].latitude this.markers[0].latitude = res.data[0].latitude
this.markers[0].longitude = res.data[0].longitude this.markers[0].longitude = res.data[0].longitude
this.polyline = [{ this.polyline = [{

File diff suppressed because it is too large Load Diff

View File

@ -1,393 +0,0 @@
<template>
<view class="">
<view class="info">
<view class="bg"></view>
<view class="card">
<view class="title">充值信息</view>
<view class="item">
<text>充值账户</text>
<text>{{$store.state.app.userInfo.company.company_name||''}}</text>
</view>
</view>
</view>
<view class="price">
<view class="title">充值金额</view>
<view class="tab">
<view v-if="task_id>0" class="item active" style="margin: 0;">{{this.payMoney.money}}</view>
<view v-else class="item" :class="index==changeMoney?'active':''" @click="changePrice(index)"
v-for="(item, index) in priceList" :key="index">{{item}}</view>
</view>
<input v-if="priceList[changeMoney]=='自定义'" class="input" type="digit" placeholder="输入充值金额(元)"
v-model="payMoney.money" />
<button class="btn" @click="pay">充值</button>
<button class="btn btn2" @click="navToRecord">充值记录</button>
</view>
<!-- <view class="tip">
<view class="title">注意事项</view>
<view class="text">充值后帐户的金额不能提现可用于商城消费使用佣金导入账户之后不能再次导出不可提现账户充值出现问题可联系商城客服也可拨打商城客服热线<text @click="copyPhone('4008888888')">4008888888</text>
</view>
</view> -->
</view>
</template>
<script>
import {
recharge,
payWay,
payPrepay,
wechatJsConfig,
payStatus
} from "@/api/pay.js"
import {
userInfo
} from "@/api/oaUser.js"
import {
Toast
} from '@/libs/uniApi.js'
import {
taskShareholder
} from "@/api/task.js"
export default {
data() {
return {
priceList: ['10元', '50元', '100元', '500元', '1000元', '5000元', '10000元', '自定义'],
changeMoney: -1,
payMoney: {
money: ''
},
payTimer: null,
timeCount: 5,
task_id: -1, //id,,
task: {},
obj: "323",
}
},
//
onNavigationBarButtonTap(res) {
if (res.index === 0) {
this.navToRecord();
}
},
onLoad(options) {
if (options.task_id) {
this.task_id = options.task_id;
this.loadTask();
}
},
methods: {
aa() {
return JSON.parse(this.obj)
},
changePrice(index) {
if (this.changeMoney == index) this.changeMoney = -1;
else this.changeMoney = index;
if (this.priceList[index] == '自定义') this.payMoney.money = '';
else this.payMoney.money = this.priceList[index].split('元')[0];
},
//
navToRecord() {
uni.navigateTo({
url: '/subpkg/topUpList/topUpList'
})
},
//
async loadTask() {
uni.showLoading({
title: '加载中',
mask: true
})
let res = await taskShareholder({
id: this.task_id
});
this.task = res.data;
this.payMoney.money = res.data?.extend?.shareholder?.money;
uni.hideLoading();
},
//
pay() {
if (!this.payMoney.money) return Toast('请先填写充值金额!')
if (this.payMoney.money <= 0) return Toast('充值金额不能小于0!')
if (this.payTimer == null) {
this.goRecharge();
this.payTimer = setInterval(() => {
this.timeCount--;
if (this.timeCount <= 0) {
clearInterval(this.payTimer);
this.payTimer = null;
this.timeCount = 5;
}
}, 1000)
} else Toast(this.timeCount + '秒后再支付!')
},
goRecharge() {
let that = this
// console.log(obj);
uni.showLoading({
title: '获取支付信息',
success: async () => {
let queryData = {
money: this.payMoney.money,
type: 300
};
if (this.task_id > 0) {
queryData.task_id = this.task_id;
}
let {
data
} = await recharge(queryData);
let res = await payWay({
order_id: data.order_id,
from: data.from,
})
// console.log(res);
let res1 = await payPrepay({
from: data.from,
order_id: data.order_id,
pay_way: res.data.lists[0].pay_way
})
// console.log(res1.data, res1.data.config.package.split('=')[1]);
let obj = {
"appid": res1.data.config
.appId, // - - AppId AppId
"noncestr": res1.data.config.nonceStr, //
"package": res1.data.config.package, //
"partnerid": res1.data.config.partnerid, //
"prepayid": res1.data.config.package.split('=')[1], //
"timestamp": res1.data.config.timestamp, //
"sign": res1.data.config.paySign
}
uni.getProvider({
service: 'payment',
success: (paymentList) => {
// console.log(paymentList);
uni.hideLoading();
uni.showLoading({
title: '微信支付中'
})
uni.requestPayment({
provider: 'wxpay',
// orderInfo: res1.data.config,
orderInfo: obj,
success: (e) => {
// console.log('', e);
uni.hideLoading();
payStatus({
order_id: data.order_id,
from: data.from,
}).then((status) => {
uni.showToast({
icon: status.data
.pay_status ?
'success' : 'none',
title: status.data
.pay_status ?
'支付成功' : '支付失败'
})
if (this.task_id > 0) {
uni.$emit('upBuyShare');
uni.navigateBack();
} else {
userInfo().then(user => {
this.$store.commit(
'setUserInfo',
user.data);
})
}
})
},
fail: (e) => {
console.log(e);
uni.hideLoading();
uni.showToast({
icon: 'error',
title: '支付失败!'
})
},
complete: () => {
if (this.task_id <= 0) this.payMoney.money =
'';
},
});
}
})
},
fail: (e) => {
uni.showToast({
icon: 'error',
title: '请先安装微信'
})
}
})
}
},
onPullDownRefresh() {
uni.stopPullDownRefresh()
}
}
</script>
<style lang="scss">
page {
background-color: #fff;
}
.info {
display: flex;
flex-direction: column;
align-items: center;
position: relative;
height: 250rpx;
.bg {
background-color: $theme-oa-color;
height: 170rpx;
width: 100vw;
border-radius: 0rpx 0rpx 28rpx 28rpx;
position: absolute;
top: 0;
left: 0;
}
.card {
width: 694rpx;
min-height: 180rpx;
background: #FFFFFF;
margin-top: 38.55rpx;
box-shadow: 0rpx 0rpx 18rpx 2rpx rgba(50, 116, 249, 0.1);
border-radius: 14rpx 14rpx 14rpx 14rpx;
opacity: 1;
padding: 31.5rpx 28rpx;
display: flex;
flex-direction: column;
justify-content: space-around;
position: absolute;
top: 0;
.title {
font-size: 32rpx;
font-weight: 600;
color: #333333;
padding-bottom: 10rpx;
}
.item {
display: flex;
justify-content: space-between;
font-size: 32rpx;
font-weight: 400;
color: #333333;
text:nth-child(1) {
flex-shrink: 0;
margin-right: 18rpx;
}
}
}
}
.price {
display: flex;
flex-direction: column;
padding: 0 28rpx;
margin-top: 50rpx;
.title {
font-size: 32rpx;
font-weight: 600;
color: #333333;
line-height: 39rpx;
margin-bottom: 42rpx;
}
.tab {
display: flex;
flex-wrap: wrap;
justify-content: left;
width: 694rpx;
.item {
width: 217rpx;
height: 131rpx;
margin: 0 auto;
margin-bottom: 20rpx;
border-radius: 7rpx 7rpx 7rpx 7rpx;
border: 2rpx solid #F5F5F5;
display: flex;
justify-content: center;
align-items: center;
font-size: 32rpx;
font-weight: 500;
line-height: 32rpx;
}
.active {
border: 2rpx solid $theme-oa-color;
color: $theme-oa-color;
}
}
.input {
width: 100%;
height: 112rpx;
background: #F5F5F5;
border-radius: 56rpx 56rpx 56rpx 56rpx;
opacity: 1;
padding: 0 45.56rpx;
box-sizing: border-box;
font-size: 28rpx;
font-weight: 400;
color: #333;
line-height: 35rpx;
}
.btn {
width: 694rpx;
height: 84rpx;
margin-top: 73.6rpx;
background: $theme-oa-color;
box-shadow: 0rpx 14rpx 44rpx 2rpx #E9EFF5;
border-radius: 42rpx 42rpx 42rpx 42rpx;
display: flex;
justify-content: center;
align-items: center;
font-size: 32rpx;
font-weight: 400;
color: #FFFFFF;
}
.btn2 {
background-color: #fff;
color: #333;
border: 1px solid #eee;
}
}
.tip {
display: flex;
flex-direction: column;
padding: 0 28rpx;
margin-top: 84rpx;
.title {
font-size: 32rpx;
font-weight: 500;
color: $theme-oa-color;
line-height: 32rpx;
margin-bottom: 21rpx;
}
.text {
font-size: 28rpx;
font-weight: 400;
color: rgba(0, 0, 0, 0.6);
line-height: 42rpx;
-webkit-background-clip: text;
}
}
</style>

View File

@ -1,393 +1,349 @@
<template> <template>
<view class=""> <view class="">
<view class="info"> <view class="info">
<view class="bg"></view> <view class="bg"></view>
<view class="card"> <view class="card">
<view class="title">充值信息</view> <view class="title">充值信息</view>
<view class="item"> <view class="item">
<text>充值账户</text> <text>充值账户</text>
<text>{{$store.state.app.userInfo.company.company_name||''}}</text> <text>{{$store.state.app.userInfo.company.company_name||''}}</text>
</view> </view>
</view> </view>
</view> </view>
<view class="price"> <view class="price">
<view class="title">充值金额</view> <view class="title">充值金额</view>
<view class="tab"> <view class="tab">
<view v-if="task_id>0" class="item active" style="margin: 0;">{{this.payMoney.money}}</view> <view v-if="task_id>0" class="item active" style="margin: 0;">{{this.payMoney.money}}</view>
<view v-else class="item" :class="index==changeMoney?'active':''" @click="changePrice(index)" <view v-else class="item" :class="index==changeMoney?'active':''" @click="changePrice(index)"
v-for="(item, index) in priceList" :key="index">{{item}}</view> v-for="(item, index) in priceList" :key="index">{{item}}</view>
</view> </view>
<input v-if="priceList[changeMoney]=='自定义'" class="input" type="digit" placeholder="输入充值金额(元)" <input v-if="priceList[changeMoney]=='自定义'" class="input" type="digit" placeholder="输入充值金额(元)" v-model="payMoney.money" />
v-model="payMoney.money" /> <button class="btn" @click="pay">充值</button>
<button class="btn" @click="pay">充值</button> </view>
<button class="btn btn2" @click="navToRecord">充值记录</button> <!-- <view class="tip">
</view>
<!-- <view class="tip">
<view class="title">注意事项</view> <view class="title">注意事项</view>
<view class="text">充值后帐户的金额不能提现可用于商城消费使用佣金导入账户之后不能再次导出不可提现账户充值出现问题可联系商城客服也可拨打商城客服热线<text @click="copyPhone('4008888888')">4008888888</text> <view class="text">充值后帐户的金额不能提现可用于商城消费使用佣金导入账户之后不能再次导出不可提现账户充值出现问题可联系商城客服也可拨打商城客服热线<text @click="copyPhone('4008888888')">4008888888</text>
</view> </view>
</view> --> </view> -->
</view> </view>
</template> </template>
<script> <script>
import { import { recharge, payWay, payPrepay, wechatJsConfig, payStatus } from "@/api/pay.js"
recharge, import { userInfo } from "@/api/oaUser.js"
payWay, import { debounce, throttle } from 'lodash'
payPrepay, import { Toast } from '@/libs/uniApi.js'
wechatJsConfig, import { taskShareholder } from "@/api/task.js"
payStatus export default {
} from "@/api/pay.js" data() {
import { return {
userInfo priceList: ['10元','50元','100元','500元','1000元','5000元','10000元', '自定义'],
} from "@/api/oaUser.js" changeMoney: -1,
import { payMoney: {
Toast money: ''
} from '@/libs/uniApi.js' },
import { payTimer: null,
taskShareholder timeCount: 5,
} from "@/api/task.js" task_id: -1, //id,,
export default { task: {}
data() { }
return { },
priceList: ['10元', '50元', '100元', '500元', '1000元', '5000元', '10000元', '自定义'], //
changeMoney: -1, onNavigationBarButtonTap(res){
payMoney: { if (res.index === 0) {
money: '' uni.navigateTo({
}, url: '/subpkg/topUpList/topUpList'
payTimer: null, })
timeCount: 5, }
task_id: -1, //id,, },
task: {}, onLoad(options) {
obj: "323", if(options.task_id){
} this.task_id=options.task_id;
}, this.loadTask();
// }
onNavigationBarButtonTap(res) { },
if (res.index === 0) { methods: {
this.navToRecord(); changePrice(index){
} if(this.changeMoney == index)this.changeMoney = -1;
}, else this.changeMoney = index;
onLoad(options) { if(this.priceList[index]=='自定义')this.payMoney.money = '';
if (options.task_id) { else this.payMoney.money = this.priceList[index].split('元')[0];
this.task_id = options.task_id; },
this.loadTask(); //
} async loadTask(){
}, uni.showLoading({
methods: { title: '加载中',
mask: true
aa() { })
return JSON.parse(this.obj) let res = await taskShareholder({
id: this.task_id
}, });
this.task = res.data;
changePrice(index) { this.payMoney.money = res.data?.extend?.shareholder?.money;
if (this.changeMoney == index) this.changeMoney = -1; uni.hideLoading();
else this.changeMoney = index; },
if (this.priceList[index] == '自定义') this.payMoney.money = ''; //
else this.payMoney.money = this.priceList[index].split('元')[0]; pay(){
}, if(!this.payMoney.money)return Toast('请先填写充值金额!')
// if(this.payMoney.money<=0)return Toast('充值金额不能小于0!')
navToRecord() { if(this.payTimer==null){
uni.navigateTo({ this.goRecharge();
url: '/subpkg/topUpList/topUpList' this.payTimer = setInterval(()=>{
}) this.timeCount--;
}, if(this.timeCount<=0){
// clearInterval(this.payTimer);
async loadTask() { this.payTimer = null;
uni.showLoading({ this.timeCount = 5;
title: '加载中', }
mask: true }, 1000)
}) }
let res = await taskShareholder({ else Toast(this.timeCount+'秒后再支付!')
id: this.task_id },
}); goRecharge() {
this.task = res.data; // console.log(obj);
this.payMoney.money = res.data?.extend?.shareholder?.money; uni.showLoading({
uni.hideLoading(); title:'获取支付信息',
}, success: async () => {
// let queryData = {
pay() { money: this.payMoney.money
if (!this.payMoney.money) return Toast('请先填写充值金额!') };
if (this.payMoney.money <= 0) return Toast('充值金额不能小于0!') if(this.task_id>0) {
if (this.payTimer == null) { queryData.task_id = this.task_id;
this.goRecharge(); }
this.payTimer = setInterval(() => { let { data } = await recharge(queryData);
this.timeCount--; let res = await payWay({
if (this.timeCount <= 0) { order_id: data.order_id,
clearInterval(this.payTimer); from: data.from,
this.payTimer = null; })
this.timeCount = 5; // console.log(res);
} let res1 = await payPrepay({
}, 1000) from: data.from,
} else Toast(this.timeCount + '秒后再支付!') order_id: data.order_id,
}, pay_way: res.data.lists[0].pay_way
goRecharge() { })
let that = this // console.log(res1.data, res1.data.config.package.split('=')[1]);
// console.log(obj); let obj = {
uni.showLoading({ "appid": res1.data.config.appId, // - - AppId AppId
title: '获取支付信息', "noncestr": res1.data.config.nonceStr, //
success: async () => { "package": res1.data.config.package, //
let queryData = { "partnerid": res1.data.config.partnerid, //
money: this.payMoney.money, "prepayid": res1.data.config.package.split('=')[1], //
type: 300 "timestamp": res1.data.config.timestamp, //
}; "sign": res1.data.config.paySign
if (this.task_id > 0) { }
queryData.task_id = this.task_id; uni.getProvider({
} service: 'payment',
let { success: (paymentList) => {
data // console.log(paymentList);
} = await recharge(queryData); uni.hideLoading();
let res = await payWay({ uni.showLoading({
order_id: data.order_id, title:'微信支付中'
from: data.from, })
}) uni.requestPayment({
// console.log(res); provider: 'wxpay',
let res1 = await payPrepay({ // orderInfo: res1.data.config,
from: data.from, orderInfo: obj,
order_id: data.order_id, success: (e) => {
pay_way: res.data.lists[0].pay_way // console.log('', e);
}) uni.hideLoading();
// console.log(res1.data, res1.data.config.package.split('=')[1]); payStatus({
let obj = { order_id: data.order_id,
"appid": res1.data.config from: data.from,
.appId, // - - AppId AppId }).then((status)=>{
"noncestr": res1.data.config.nonceStr, // uni.showToast({
"package": res1.data.config.package, // icon: status.data.pay_status?'success':'none',
"partnerid": res1.data.config.partnerid, // title: status.data.pay_status?'支付成功':'支付失败'
"prepayid": res1.data.config.package.split('=')[1], // })
"timestamp": res1.data.config.timestamp, // if(this.task_id>0){
"sign": res1.data.config.paySign uni.$emit('upBuyShare');
} uni.navigateBack();
}
uni.getProvider({ else{
service: 'payment', userInfo().then(user=>{
success: (paymentList) => { this.$store.commit('setUserInfo', user.data);
// console.log(paymentList); })
uni.hideLoading(); }
uni.showLoading({ })
title: '微信支付中' },
}) fail: (e) => {
uni.requestPayment({ console.log(e);
provider: 'wxpay', uni.hideLoading();
// orderInfo: res1.data.config, uni.showToast({
orderInfo: obj, icon:'error',
success: (e) => { title: '支付失败!'
// console.log('', e); })
uni.hideLoading(); },
payStatus({ complete: () => {
order_id: data.order_id, if(this.task_id<=0)this.payMoney.money = '';
from: data.from, },
}).then((status) => { });
uni.showToast({ }
icon: status.data })
.pay_status ? },
'success' : 'none', fail: (e) => {
title: status.data uni.showToast({
.pay_status ? icon:'error',
'支付成功' : '支付失败' title:'请先安装微信'
}) })
if (this.task_id > 0) { }
uni.$emit('upBuyShare'); })
uni.navigateBack(); }
} else { },
userInfo().then(user => { onPullDownRefresh() {
this.$store.commit( uni.stopPullDownRefresh()
'setUserInfo', }
user.data); }
})
}
})
},
fail: (e) => {
console.log(e);
uni.hideLoading();
uni.showToast({
icon: 'error',
title: '支付失败!'
})
},
complete: () => {
if (this.task_id <= 0) this.payMoney.money =
'';
},
});
}
})
},
fail: (e) => {
uni.showToast({
icon: 'error',
title: '请先安装微信'
})
}
})
}
},
onPullDownRefresh() {
uni.stopPullDownRefresh()
}
}
</script> </script>
<style lang="scss"> <style lang="scss">
page { page {
background-color: #fff; background-color: #fff;
} }
.info { .info {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
align-items: center; align-items: center;
position: relative; position: relative;
height: 250rpx; height: 250rpx;
.bg { .bg {
background-color: $theme-oa-color; background-color: $theme-oa-color;
height: 170rpx; height: 170rpx;
width: 100vw; width: 100vw;
border-radius: 0rpx 0rpx 28rpx 28rpx; border-radius: 0rpx 0rpx 28rpx 28rpx;
position: absolute; position: absolute;
top: 0; top: 0;
left: 0; left: 0;
} }
.card { .card {
width: 694rpx; width: 694rpx;
min-height: 180rpx; min-height: 180rpx;
background: #FFFFFF; background: #FFFFFF;
margin-top: 38.55rpx; margin-top: 38.55rpx;
box-shadow: 0rpx 0rpx 18rpx 2rpx rgba(50, 116, 249, 0.1); box-shadow: 0rpx 0rpx 18rpx 2rpx rgba(50, 116, 249, 0.1);
border-radius: 14rpx 14rpx 14rpx 14rpx; border-radius: 14rpx 14rpx 14rpx 14rpx;
opacity: 1; opacity: 1;
padding: 31.5rpx 28rpx; padding: 31.5rpx 28rpx;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
justify-content: space-around; justify-content: space-around;
position: absolute; position: absolute;
top: 0; top: 0;
.title { .title {
font-size: 32rpx; font-size: 32rpx;
font-weight: 600; font-weight: 600;
color: #333333; color: #333333;
padding-bottom: 10rpx; padding-bottom: 10rpx;
} }
.item { .item {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
font-size: 32rpx; font-size: 32rpx;
font-weight: 400; font-weight: 400;
color: #333333; color: #333333;
text:nth-child(1){
flex-shrink: 0;
margin-right: 18rpx;
}
}
}
}
text:nth-child(1) { .price {
flex-shrink: 0; display: flex;
margin-right: 18rpx; flex-direction: column;
} padding: 0 28rpx;
} margin-top: 50rpx;
}
}
.price { .title {
display: flex; font-size: 32rpx;
flex-direction: column; font-weight: 600;
padding: 0 28rpx; color: #333333;
margin-top: 50rpx; line-height: 39rpx;
margin-bottom: 42rpx;
}
.title { .tab {
font-size: 32rpx; display: flex;
font-weight: 600; flex-wrap: wrap;
color: #333333; justify-content: left;
line-height: 39rpx; width: 694rpx;
margin-bottom: 42rpx;
}
.tab { .item {
display: flex; width: 217rpx;
flex-wrap: wrap; height: 131rpx;
justify-content: left; margin: 0 auto;
width: 694rpx; margin-bottom: 20rpx;
border-radius: 7rpx 7rpx 7rpx 7rpx;
border: 2rpx solid #F5F5F5;
display: flex;
justify-content: center;
align-items: center;
font-size: 32rpx;
font-weight: 500;
line-height: 32rpx;
}
.item { .active {
width: 217rpx; border: 2rpx solid $theme-oa-color;
height: 131rpx; color: $theme-oa-color;
margin: 0 auto; }
margin-bottom: 20rpx; }
border-radius: 7rpx 7rpx 7rpx 7rpx;
border: 2rpx solid #F5F5F5;
display: flex;
justify-content: center;
align-items: center;
font-size: 32rpx;
font-weight: 500;
line-height: 32rpx;
}
.active { .input {
border: 2rpx solid $theme-oa-color; width: 100%;
color: $theme-oa-color; height: 112rpx;
} background: #F5F5F5;
} border-radius: 56rpx 56rpx 56rpx 56rpx;
opacity: 1;
padding: 0 45.56rpx;
box-sizing: border-box;
font-size: 28rpx;
font-weight: 400;
color: #333;
line-height: 35rpx;
}
.input { .btn {
width: 100%; width: 694rpx;
height: 112rpx; height: 84rpx;
background: #F5F5F5; margin-top: 73.6rpx;
border-radius: 56rpx 56rpx 56rpx 56rpx; background: $theme-oa-color;
opacity: 1; box-shadow: 0rpx 14rpx 44rpx 2rpx #E9EFF5;
padding: 0 45.56rpx; border-radius: 42rpx 42rpx 42rpx 42rpx;
box-sizing: border-box; display: flex;
font-size: 28rpx; justify-content: center;
font-weight: 400; align-items: center;
color: #333; font-size: 32rpx;
line-height: 35rpx; font-weight: 400;
} color: #FFFFFF;
}
}
.btn { .tip {
width: 694rpx; display: flex;
height: 84rpx; flex-direction: column;
margin-top: 73.6rpx; padding: 0 28rpx;
background: $theme-oa-color; margin-top: 84rpx;
box-shadow: 0rpx 14rpx 44rpx 2rpx #E9EFF5;
border-radius: 42rpx 42rpx 42rpx 42rpx;
display: flex;
justify-content: center;
align-items: center;
font-size: 32rpx;
font-weight: 400;
color: #FFFFFF;
}
.btn2 { .title {
background-color: #fff; font-size: 32rpx;
color: #333; font-weight: 500;
border: 1px solid #eee; color: $theme-oa-color;
} line-height: 32rpx;
} margin-bottom: 21rpx;
}
.tip { .text {
display: flex; font-size: 28rpx;
flex-direction: column; font-weight: 400;
padding: 0 28rpx; color: rgba(0, 0, 0, 0.6);
margin-top: 84rpx; line-height: 42rpx;
-webkit-background-clip: text;
.title { }
font-size: 32rpx; }
font-weight: 500;
color: $theme-oa-color;
line-height: 32rpx;
margin-bottom: 21rpx;
}
.text {
font-size: 28rpx;
font-weight: 400;
color: rgba(0, 0, 0, 0.6);
line-height: 42rpx;
-webkit-background-clip: text;
}
}
</style> </style>

View File

@ -1,276 +0,0 @@
<template>
<view class="">
<view class="info">
<view class="bg"></view>
<view class="card">
<view class="title">充值信息</view>
<view class="item">
<text>充值账户</text>
<text>{{$store.state.app.userInfo.company.company_name||''}}</text>
</view>
<u-line style="margin: 20rpx 0;"></u-line>
<view class="item">
<text>收款公司</text>
<text>{{partyA.company_name}}</text>
</view>
<view class="item" @click="copyPhone(partyA.qualification.corporate_account, '对公账号')">
<text>对公账号</text>
<text>{{partyA.qualification.corporate_account||'暂无信息'}}</text>
</view>
</view>
</view>
<view class="deposit-list" style="padding-top: 20px;">
<view class="card" v-for="(item, index) in list">
<view class="item">
<view>创建时间:</view>
<view class="text" style="color: black;">{{item.create_time}}</view>
</view>
<view class="item">
<view>充值金额:</view>
<view class="text " style="color: red;">{{item.deposit}}</view>
</view>
<view class="item" @click="previewVoucher(item.voucher)">
<view>充值凭证:</view>
<view class="text blue">查看凭证</view>
</view>
</view>
</view>
<u-empty v-if="list.length==0&&loadConfig.status=='nomore'" icon="/static/img/empty/data.png"
text="没有数据"></u-empty>
<u-loadmore v-else :status="loadConfig.status" :loading-text="loadConfig.loadingText"
:loadmore-text="loadConfig.loadmoreText" :nomore-text="loadConfig.nomoreText" />
</view>
</template>
<script>
import {
Toast
} from '@/libs/uniApi.js'
import {
getPartyACompany,
getDepositRechargeTransferVoucherList
} from "@/api/company.js"
export default {
data() {
return {
partyA: {
id: "",
company_name: "",
qualification: {
corporate_account: ""
}
},
list: [],
loadConfig: {
page: 1,
limit: 15,
lastpage: '',
loadingText: '努力加载中',
loadmoreText: '轻轻上拉',
nomoreText: '我也是有底线的~~',
status: 'loadmore'
},
}
},
//
onNavigationBarButtonTap(res) {
if (res.index === 0) {
uni.navigateTo({
url: '/subpkg/topUpList/topUpList'
})
}
},
onLoad(options) {
this.loadPartyACompany();
this.initLoad();
},
onReachBottom() {
this.loadList()
},
methods: {
async loadPartyACompany() {
let res = await getPartyACompany();
if (res.data.qualification) {
try {
res.data.qualification = JSON.parse(res.data.qualification);
} catch (e) {
console.log(e);
}
}
this.partyA = res.data;
if (!this.partyA.qualification.corporate_account) this.partyA.qualification.corporate_account = "";
},
async initLoad() {
this.loadConfig.page = 1;
this.loadConfig.status = "loadmore";
this.list = [];
await this.loadList();
},
async loadList() {
if (this.loadConfig.status == "nomore") return;
this.loadConfig.status = "loading";
let res = await getDepositRechargeTransferVoucherList({
page: this.loadConfig.page,
limit: this.loadConfig.limit
})
this.loadConfig.status = "loadmore"
if (res.data.data.length < this.loadConfig.limit) {
this.loadConfig.status = "nomore"
} else {
this.loadConfig.page++;
}
this.list = [...this.list, ...res.data?.data]
},
previewVoucher(str = "") {
if (str.substring(str.length - 4, str.length) == '.pdf') { // PDFPDF
uni.navigateTo({
url: `/subpkg/pdfView/pdfView?url=${str}`
})
} else {
uni.previewImage({
urls: [str],
longPressActions: {
itemList: ['保存图片'],
success: function(data) {
if (data.tapIndex === 0) {
uni.saveImageToPhotosAlbum({
filePath: url,
success: function() {
uni.showToast({
title: '保存成功',
icon: 'success'
})
},
fail: function() {
uni.showToast({
title: '保存失败',
icon: 'none'
})
}
})
}
}
}
})
}
},
copyPhone(str = "", type = "号码") {
if (str) uni.setClipboardData({
data: str + "",
success: (e) => {
Toast(type + '已复制')
},
fail: (e) => {
Toast('复制失败')
}
})
}
},
onPullDownRefresh() {
this.initLoad().then(() => {
setTimeout(() => {
uni.stopPullDownRefresh()
}, 500)
})
}
}
</script>
<style lang="scss">
page {
background-color: #fff;
}
.info {
display: flex;
flex-direction: column;
align-items: center;
position: relative;
height: 350rpx;
.bg {
background-color: $theme-oa-color;
height: 200rpx;
width: 100vw;
border-radius: 0rpx 0rpx 28rpx 28rpx;
position: absolute;
top: 0;
left: 0;
}
.card {
width: 694rpx;
min-height: 180rpx;
background: #FFFFFF;
margin-top: 38.55rpx;
box-shadow: 0rpx 0rpx 18rpx 2rpx rgba(50, 116, 249, 0.1);
border-radius: 14rpx 14rpx 14rpx 14rpx;
opacity: 1;
padding: 31.5rpx 28rpx;
display: flex;
flex-direction: column;
justify-content: space-around;
position: absolute;
top: 0;
.title {
font-size: 32rpx;
font-weight: 600;
color: #333333;
padding-bottom: 10rpx;
}
.item {
display: flex;
justify-content: space-between;
font-size: 32rpx;
font-weight: 400;
color: #333333;
text:nth-child(1) {
flex-shrink: 0;
margin-right: 18rpx;
}
}
}
}
.deposit-list {
display: flex;
flex-direction: column;
align-items: center;
.card {
width: 694rpx;
min-height: 180rpx;
background: #FFFFFF;
margin-bottom: 28rpx;
box-shadow: 0rpx 0rpx 18rpx 2rpx rgba(50, 116, 249, 0.1);
border-radius: 14rpx 14rpx 14rpx 14rpx;
opacity: 1;
padding: 31.5rpx 28rpx;
display: flex;
flex-direction: column;
justify-content: space-around;
.item {
font-size: 28rpx;
display: flex;
justify-content: left;
.text {
margin-left: 12rpx;
color: #999;
}
.green {
color: #4cd964;
}
.blue {
color: #0122c7;
}
}
}
}
</style>

View File

@ -3,7 +3,7 @@
<view class="list"> <view class="list">
<view class="card" v-for="(item, index) in list" :key="index"> <view class="card" v-for="(item, index) in list" :key="index">
<view class="top"> <view class="top">
<view class="tips">押金充值</view> <view class="tips">余额充值</view>
<view>充值日期{{item.create_time}}</view> <view>充值日期{{item.create_time}}</view>
</view> </view>
<view class="bottom"> <view class="bottom">
@ -23,7 +23,7 @@
</template> </template>
<script> <script>
import {deposit_recharge} from "@/api/pay.js" import {rechargeLists} from "@/api/pay.js"
export default { export default {
data() { data() {
return { return {
@ -49,7 +49,7 @@ export default {
async loadList(){ async loadList(){
if(this.loadConfig.status=="nomore")return; if(this.loadConfig.status=="nomore")return;
this.loadConfig.status="loading" this.loadConfig.status="loading"
let res = await deposit_recharge({ let res = await rechargeLists({
page_no: this.loadConfig.page, page_no: this.loadConfig.page,
page_size: this.loadConfig.limit page_size: this.loadConfig.limit
}); });

View File

@ -1,236 +0,0 @@
<template>
<view class="personnel_list">
<u-tabs style="background-color: #0022C7;" :list="tabLists" @click="changeTypeCurrent" lineColor='white'
lineWidth='100' inactiveStyle='color:white' activeStyle="color:white"></u-tabs>
<view class="" style="height: 20rpx;">
</view>
<view class="" v-if="gatherList">
<view class="card" v-for="(item,index) in gatherList.planting" :key="item.id" v-if="page==1"
@click="navgo(`/subpkg/townTask/townGather?type=plant&task_id=${task_id}&index=${index}`)">
<view class="card_head">
<view class="">
养植信息
</view>
<view class="">
点击查看
</view>
</view>
<view class="card_content">
<view class="" style="margin-bottom: 20rpx;">
法人姓名: {{item.entityName}}
</view>
<view class="">
联系电话: {{item.phone}}
</view>
</view>
</view>
<view class="card" v-for="(item,index) in gatherList.supply" :key="index" v-if="page==2"
@click="navgo(`/subpkg/townTask/townGather?type=supply&task_id=${task_id}&index=${index}`)">
<view class="card_head">
<view class="">
批发商信息
</view>
<view class="">
点击查看
</view>
</view>
<view class="card_content">
<view class="" style="margin-bottom: 20rpx;">
店主姓名: {{item.storeName}}
</view>
<view class="">
联系电话: {{item.shopkeeperPhone}}
</view>
</view>
</view>
</view>
<!-- <u-popup :show="show" @close="close" :round="10" mode="center" @open="open">
<view style="padding: 20rpx;">
<u-button type="primary" @click="navgo(`/subpkg/townTask/townGather?type=plant&task_id=${task_id}`)"
style="margin-bottom: 20rpx;" color="#0122C7" text="养殖基地信息"></u-button>
<u-button type="primary" @click="navgo(`/subpkg/townTask/townGather?type=supply&task_id=${task_id}`)"
text="批发商信息" color="#0122C7"></u-button>
</view>
</u-popup> -->
<mybtn text="新建信息收集" @click="creatFn">
</mybtn>
</view>
</template>
<script>
import mybtn from "@/components/mybtn/mybtn.vue"
import {
townMasterTask3List
} from "@/api/task.js"
export default {
data() {
return {
show: false,
gatherList: {},
page: 1,
task_id: "",
tabLists: [{
name: '镇种养殖基地信息收集表',
id: 1
}, {
name: '镇批发商信息收集表',
id: 2
}, ],
}
},
onShow() {
townMasterTask3List({
id: this.task_id
}).then(res => {
this.gatherList = res.data.template_info.extend.purchase_sales_info
})
},
onLoad(option) {
this.task_id = option.task_id
townMasterTask3List({
id: option.task_id
}).then(res => {
this.gatherList = res.data.template_info.extend.purchase_sales_info
})
// townTask3List()
},
methods: {
// open() {
// this.show = true
// },
// close() {
// this.show = false
// },
creatFn() {
if (this.page == 1) {
this.navgo(`/subpkg/townTask/townGather?type=plant&task_id=${this.task_id}`)
} else {
this.navgo(`/subpkg/townTask/townGather?type=supply&task_id=${this.task_id}`)
}
},
navgo(url) {
this.show = false
uni.navigateTo({
url
})
},
changeTypeCurrent(e) {
this.page = e.id
// if(e.)
}
}
}
</script>
<style lang="scss">
.new_btn {
position: fixed;
bottom: 28rpx;
left: 50%;
transform: translate(-50%);
margin-top: 32rpx;
// margin-bottom: 40rpx;
width: 694rpx;
height: 84rpx;
background: $theme-oa-color;
border-radius: 42rpx 42rpx 42rpx 42rpx;
color: #fff;
line-height: 80rpx;
text-align: center;
}
.personnel_list {
margin-bottom: 130rpx;
.card {
margin: 0 auto;
margin-bottom: 28rpx;
width: 694rpx;
background: #ffffff;
border-radius: 30rpx;
opacity: 1;
overflow: hidden;
// box-shadow: 2px 2px 4px rgba(0, 0, 0, 0.6);
.card_head {
padding: 28rpx;
background-color: $theme-oa-color;
color: white;
height: 100rpx;
display: flex;
justify-content: space-between;
align-items: center;
}
.card_content {
padding: 28rpx;
.left {
text-align: center;
// padding: 15rpx 25rpx;
padding-top: 20rpx;
width: 160rpx;
// background-color: $theme-oa-color;
color: white;
// border-radius: 40rpx;
.cir {
width: 120rpx;
height: 120rpx;
background-color: #ffffff;
margin-left: 25rpx;
// border-radius: 120rpx;
position: relative;
}
}
.right {
display: flex;
flex-direction: column;
justify-content: space-between;
view {
text:nth-child(2) {
margin-left: 20rpx;
}
}
}
}
.u_avatar {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
}
}
</style>

View File

@ -1,337 +0,0 @@
<template>
<view class="task_page">
<u-skeleton v-if="skeleton" :class="{'loading': skeleton}" :animate="true" title rows="5" rows-width="92%"
rowsHeight="56">
</u-skeleton>
<block v-else>
<view class="card">
<view class="c_title">{{`任务名称: ${taskInfo.title||''}`}}</view>
<view>{{taskInfo.content||''}}</view>
</view>
<view class="card" v-if="taskInfo.approve_status==3">
<view class="c_title" style="color: #FF7C32;">驳回提示</view>
<u-line style="margin: 14rpx 0;"></u-line>
<view class="text" style="color: #FF7C32;">{{taskInfo.deny_notes}}</view>
<button v-if="other.is_commit==1" class="btn" @click="toUpdate">去修改</button>
</view>
<view class="card">
<view class="c_title">任务完成证明</view>
<view class="file">
<view class="file_item" v-for="(item, index) in imgList" :key="'file'+index">
<image class="image" :src="item" @click="priview(index)"></image>
<image v-if="taskInfo.status==2 && other.is_commit==0" class="del" src="/static/icons/delete.png" @click.stop="deleteFile(index)">
</image>
</view>
<view v-if="taskInfo.status==2 && other.is_commit==0" class="file_btn" @click="chooseFile">
<image src="/static/icons/plus.png"></image>
</view>
<view class="file_empty" v-for="k in placeholderLength" :key="'empty'+k"></view>
</view>
</view>
<view class="card" style="margin-bottom: 160rpx;">
<view class="c_title">补充说明</view>
<u--textarea :disabled="taskInfo.status!=2 || other.is_commit==1" v-model="remark" placeholder="请输入内容"
placeholderStyle="font-size: 22rpx;" count maxlength="500" autoHeight
style="font-size: 28rpx;background-color: #eee;min-height: 100px;padding-bottom: 50rpx;"></u--textarea>
</view>
<mybtn v-if="taskInfo.status==2&&other.is_commit==0" text="确认提交" @click="$u.throttle(submit, 1500)"></mybtn>
<mybtn v-else-if="taskInfo.status==3" text="已完成" :my_btn_disabled="true" @click="showToast('任务已完成!')"></mybtn>
<mybtn v-else-if="taskInfo.status==5" text="已关闭" :my_btn_disabled="true" @click="showToast('任务已关闭!')"></mybtn>
<mybtn v-else-if="taskInfo.approve_status==3" text="已驳回,请重新提交" @click="toUpdate"></mybtn>
<mybtn v-else text="已提交,请等待审核" :my_btn_disabled="true" @click="showToast('请耐心等待审核结果')"></mybtn>
</block>
</view>
</template>
<script>
import {
upLoadImage,
} from "@/api/file.js";
import { Toast } from "../../libs/uniApi";
import { marketTask10Detail, marketTask10Commit } from "@/api/task.js"
export default {
data() {
return {
skeleton: true,
other: {
annex: [], //
is_commit: 0, //
note: "", //
video_annex: [] //
},
taskInfo: {
id: '',
title: '',
content: '',
extend: {},
status: 0
},
sign_in_table: '',
remark: '',
imgList: [], //
stage: 1, //
stage1: {},
stage2: {},
stage3: {},
stage4: {},
}
},
onLoad(options) {
options.task_id ? this.taskInfo.id = options.task_id : null;
options.stage ? this.stage = +options.stage : null;
this.initTask();
},
onShow() {},
computed: {
//
placeholderLength() {
if (this.taskInfo.status != 2||this.other.is_commit==1) return this.imgList.length % 3 == 0 ? 0 : 3 - this.imgList.length % 3;
return (this.imgList.length + 1) % 3 == 0 ? 0 : 3 - (this.imgList.length + 1) % 3;
},
},
methods: {
async initTask() {
this.skeleton = true;
let res = await marketTask10Detail({
id: this.taskInfo.id
});
// approve_status 0,1,2,3,4
this.taskInfo = res.data;
if(!this.taskInfo.approve_status)this.taskInfo.approve_status=0;
if(this.taskInfo?.extend?.stage){
//
if(this.taskInfo.extend.stage4?.is_commit==1)this.other.is_commit = 1;
else if(this.taskInfo.extend.stage3?.is_commit==1)this.other.is_commit = 1;
else if(this.taskInfo.extend.stage2?.is_commit==1)this.other.is_commit = 1;
else if(this.taskInfo.extend.stage1?.is_commit==1)this.other.is_commit = 1;
else this.other.is_commit = 0;
let task;
switch(+this.taskInfo?.extend?.stage){
case 1: task = this.taskInfo.extend.stage1;break;
case 2: task = this.taskInfo.extend.stage2;break;
case 3: task = this.taskInfo.extend.stage3;break;
case 4: task = this.taskInfo.extend.stage4;break;
}
this.imgList = task?.file||[];
this.remark = task?.remark;
}
// this.sign_in_table = this.taskInfo?.extend?.town_task_type_4?.sign_in_table;
// this.remark = this.taskInfo?.extend?.town_task_type_4?.remark;
// this.imgList = JSON.parse(JSON.stringify(this.taskInfo?.extend?.town_task_type_4?.imgList || []));
this.skeleton = false;
},
//
toUpdate() {
this.other.is_commit = 0;
},
// , true
isReject(){
if (this.taskInfo.approve_status == 3) { //
let other = {
file: this.imgList,
remark: this.remark
}
let flag = true;
if(JSON.stringify(other)==JSON.stringify({
file: this.taskInfo.extend.file,
remark: this.taskInfo.extend.remark
})) flag = false;
if (!flag) {
Toast('未检测到您的修改,请修改后提交')
}
return flag;
}
else return true;
},
//
async submit() {
if (this.imgList.length < 1) return Toast('证明数量不得小于1');
if(!this.isReject()) return;
let that = this;
switch (that.stage) {
case 1:
that.stage1 = { file: that.imgList, remark: that.remark };
break;
case 2:
that.stage2 = { file: that.imgList, remark: that.remark };
break;
case 3:
that.stage3 = { file: that.imgList, remark: that.remark };
break;
case 4:
that.stage4 = { file: that.imgList, remark: that.remark };
break;
}
await marketTask10Commit({
id: this.taskInfo.id,
stage: this.stage,
stage1: this.stage1,
stage2: this.stage2,
stage3: this.stage3,
stage4: this.stage4,
});
this.other.is_commit = 1;
this.taskInfo.approve_status = 1;
Toast('提交成功');
this.$u.sleep(500).then(()=>{
uni.navigateBack()
})
},
showToast(str) {
Toast(str)
},
chooseFile() {
uni.chooseImage({
count: 9,
sizeType: ['compressed'],
success: async (res) => {
for (let item of res.tempFiles) {
let ul = await upLoadImage({
filePath: item.path,
name: 'file'
});
this.imgList.push(ul.data.uri);
}
}
});
},
priview(index) {
uni.previewImage({
urls: this.imgList,
current: index,
longPressActions: {
itemList: ['删除'],
itemColor: '#ff0000',
success(e) {
if (e.tapIndex == 0) this.deleteFile(e.index);
}
},
})
},
chooseOneFile() {
uni.chooseImage({
count: 1,
sizeType: ['compressed'],
success: async (res) => {
let ul = await upLoadImage({
filePath: res.tempFilePaths[0],
name: 'file'
});
this.sign_in_table = ul.data.uri;
}
});
},
priviewOne(index) {
uni.previewImage({
urls: [this.sign_in_table],
current: index,
longPressActions: {
itemList: ['删除'],
itemColor: '#ff0000',
success(e) {
if (e.tapIndex == 0) this.sign_in_table = '';
}
},
})
},
//
deleteFile(index) {
this.imgList.splice(index, 1);
},
},
}
</script>
<style lang="scss">
.task_page {
padding-top: 30rpx;
.card {
margin: 0 auto;
margin-bottom: 28rpx;
width: 694rpx;
background-color: #fff;
border-radius: 26rpx;
padding: 28rpx;
.c_title {
font-size: 32rpx;
font-weight: bold;
color: #333333;
margin-bottom: 20rpx;
}
.btn {
background-color: $theme-oa-color;
color: #FFFFFF;
font-size: 28rpx;
height: 60rpx;
line-height: 60rpx;
margin-top: 16rpx;
}
.file {
display: flex;
justify-content: left;
flex-wrap: wrap;
&_item {
flex-shrink: 0;
width: 200rpx;
height: 200rpx;
margin: 0 auto;
margin-bottom: 16rpx;
border: 2px solid #ccc;
border-radius: 10rpx;
overflow: hidden;
position: relative;
.image {
width: 100%;
height: 100%;
}
.del {
position: absolute;
height: 40rpx;
width: 40rpx;
top: 10rpx;
right: 10rpx;
}
}
&_btn {
flex-shrink: 0;
width: 200rpx;
height: 200rpx;
margin: 0 auto;
margin-bottom: 16rpx;
border: 2px solid #ccc;
display: flex;
justify-content: center;
align-items: center;
flex-direction: column;
border-radius: 10rpx;
image {
width: 100rpx;
height: 100rpx;
}
}
&_empty {
flex-shrink: 0;
width: 200rpx;
height: 200rpx;
margin: 0 auto;
margin-bottom: 16rpx;
border: 2px solid transparent;
}
}
}
.loading {
padding: 28rpx;
}
}
</style>

View File

@ -1,286 +0,0 @@
<template>
<view class="task_page">
<u-skeleton v-if="skeleton" :class="{'loading': skeleton}" :animate="true" title rows="5" rows-width="92%"
rowsHeight="56">
</u-skeleton>
<block v-else>
<view class="card">
<view class="c_title">{{`任务名称: ${taskInfo.title||''}`}}</view>
<view>{{taskInfo.content||''}}</view>
</view>
<view class="card">
<view class="c_title">{{`学习照片 ( ${study_photo.length}/5 ) 张`}}</view>
<view class="file">
<view class="file_item" v-for="(item, index) in study_photo" :key="'file'+index">
<image class="image" :src="item" @click="priview(index)"></image>
<image v-if="taskInfo.status==2" class="del" src="/static/icons/delete.png"
@click.stop="deleteFile(index)">
</image>
</view>
<view v-if="taskInfo.status==2" class="file_btn" @click="chooseFile">
<image src="/static/icons/plus.png"></image>
</view>
<view class="file_empty" v-for="k in placeholderLength" :key="'empty'+k"></view>
</view>
</view>
<view class="card">
<view class="c_title">{{`签到表照片 ( ${sign_in_table?1:0}/1 ) 张`}}</view>
<view class="file">
<view v-if="sign_in_table" class="file_item">
<image class="image" :src="sign_in_table" @click="priviewOne(index)"></image>
<image v-if="taskInfo.status==2 && other.is_commit==0" class="del"
src="/static/icons/delete.png" @click.stop="deleteFile(index, 'sign_in_table')">
</image>
</view>
<view v-if="taskInfo.status==2 && other.is_commit==0 && !sign_in_table" class="file_btn"
@click="chooseOneFile">
<image src="/static/icons/plus.png"></image>
</view>
<view class="file_empty"></view>
<view class="file_empty"></view>
</view>
</view>
<view class="card" style="margin-bottom: 160rpx;">
<view class="c_title">培训内容大纲 (50字以上)</view>
<u--textarea :disabled="taskInfo.status!=2" v-model="study_content" placeholder="请输入内容"
placeholderStyle="font-size: 22rpx;" count maxlength="500" autoHeight
style="font-size: 28rpx;background-color: #eee;min-height: 100px;padding-bottom: 50rpx;"></u--textarea>
</view>
<mybtn v-if="taskInfo.status==2" text="确认提交" @click="$u.throttle(submit, 1500)"></mybtn>
<mybtn v-else-if="taskInfo.status==3" text="已完成" :my_btn_disabled="true" @click="showToast('任务已完成')">
</mybtn>
<mybtn v-else-if="taskInfo.status==5" text="已关闭" :my_btn_disabled="true" @click="showToast('任务已关闭!')">
</mybtn>
<!-- <mybtn v-else-if="approve_status==3" text="已驳回,请重新提交" @click="toUpdate"></mybtn> -->
<mybtn v-else text="已提交,请等待审核" :my_btn_disabled="true" @click="showToast('请耐心等待审核结果')"></mybtn>
</block>
</view>
</template>
<script>
import {
upLoadImage,
} from "@/api/file.js";
import {
Toast
} from "../../libs/uniApi";
import {
townTaskDetails,
serviceTask4Commit
} from "@/api/task.js"
export default {
data() {
return {
skeleton: true,
other: {
annex: [], //
is_commit: 0, //
note: "", //
video_annex: [] //
},
taskInfo: {
id: '',
title: '',
content: '',
extend: {},
status: 0
},
study_photo: [],
sign_in_table: '',
study_content: ''
}
},
onLoad(options) {
options.task_id ? this.taskInfo.id = options.task_id : null;
this.initTask();
},
onShow() {},
computed: {
//
placeholderLength() {
if (this.taskInfo.status != 2) return this.study_photo.length % 3 == 0 ? 0 : 3 - this.study_photo.length %
3;
return (this.study_photo.length + 1) % 3 == 0 ? 0 : 3 - (this.study_photo.length + 1) % 3;
},
},
methods: {
async initTask() {
this.skeleton = true;
let res = await townTaskDetails({
id: this.taskInfo.id
});
this.taskInfo = res.data;
this.sign_in_table = this.taskInfo?.extend?.town_task_type_4?.sign_in_table;
this.study_content = this.taskInfo?.extend?.town_task_type_4?.study_content;
this.study_photo = JSON.parse(JSON.stringify(this.taskInfo?.extend?.town_task_type_4?.study_photo ||
[]));
this.skeleton = false;
},
//
async submit() {
if (this.study_photo.length < 5) return Toast('学习照片不能低于5张');
if (!this.sign_in_table) return Toast('签到表照片不能为空');
if (this.study_content.trim().length < 50) return Toast('培训内容不得低于50字');
await serviceTask4Commit({
id: this.taskInfo.id,
study_photo: this.study_photo,
sign_in_table: this.sign_in_table,
study_content: this.study_content
});
this.other.is_commit = 1;
// this.taskInfo.approve_status = 1;
Toast('提交成功');
this.$u.sleep(500).then(() => {
uni.navigateBack()
})
},
showToast(str) {
Toast(str)
},
chooseFile() {
uni.chooseImage({
count: 5,
sizeType: ['compressed'],
success: async (res) => {
for (let item of res.tempFiles) {
let ul = await upLoadImage({
filePath: item.path,
name: 'file'
});
this.study_photo.push(ul.data.uri);
}
}
});
},
priview(index) {
uni.previewImage({
urls: this.study_photo,
current: index,
longPressActions: {
itemList: ['删除'],
itemColor: '#ff0000',
success(e) {
if (e.tapIndex == 0) this.deleteFile(e.index);
}
},
})
},
chooseOneFile() {
uni.chooseImage({
count: 1,
sizeType: ['compressed'],
success: async (res) => {
let ul = await upLoadImage({
filePath: res.tempFilePaths[0],
name: 'file'
});
this.sign_in_table = ul.data.uri;
}
});
},
priviewOne(index) {
uni.previewImage({
urls: [this.sign_in_table],
current: index,
longPressActions: {
itemList: ['删除'],
itemColor: '#ff0000',
success(e) {
if (e.tapIndex == 0) this.sign_in_table = '';
}
},
})
},
//
deleteFile(index, type = 'image') {
if (type == 'image') this.study_photo.splice(index, 1);
else if (type == 'sign_in_table') this.sign_in_table = '';
},
},
}
</script>
<style lang="scss">
.task_page {
padding-top: 30rpx;
.card {
margin: 0 auto;
margin-bottom: 28rpx;
width: 694rpx;
background-color: #fff;
border-radius: 26rpx;
padding: 28rpx;
.c_title {
font-size: 32rpx;
font-weight: bold;
color: #333333;
margin-bottom: 20rpx;
}
.file {
display: flex;
justify-content: left;
flex-wrap: wrap;
&_item {
flex-shrink: 0;
width: 200rpx;
height: 200rpx;
margin: 0 auto;
margin-bottom: 16rpx;
border: 2px solid #ccc;
border-radius: 10rpx;
overflow: hidden;
position: relative;
.image {
width: 100%;
height: 100%;
}
.del {
position: absolute;
height: 40rpx;
width: 40rpx;
top: 10rpx;
right: 10rpx;
}
}
&_btn {
flex-shrink: 0;
width: 200rpx;
height: 200rpx;
margin: 0 auto;
margin-bottom: 16rpx;
border: 2px solid #ccc;
display: flex;
justify-content: center;
align-items: center;
flex-direction: column;
border-radius: 10rpx;
image {
width: 100rpx;
height: 100rpx;
}
}
&_empty {
flex-shrink: 0;
width: 200rpx;
height: 200rpx;
margin: 0 auto;
margin-bottom: 16rpx;
border: 2px solid transparent;
}
}
}
.loading {
padding: 28rpx;
}
}
</style>

View File

@ -1,699 +0,0 @@
<template>
<view class="content" v-if="flag">
<view class="tit">
<text v-if="page">养殖信息</text>
<text v-else>镇批发商信息收集表</text>
</view>
<!-- 镇种养殖基地信息收集表 -->
<view class="card" v-if="page">
<u--form labelPosition="left" :model="formData" :rules="rules" ref="breedingForm">
<u-form-item labelWidth="auto" label="法人姓名" required prop="entityName" borderBottom>
<u--input :readonly="readonly" v-model="formData.entityName" placeholder="请输入法人姓名"></u--input>
</u-form-item>
<u-form-item labelWidth="auto" label="联系方式" required prop="phone" borderBottom>
<u--input :readonly="readonly" v-model="formData.phone" placeholder="请输入联系方式"
type="number"></u--input>
</u-form-item>
<u-form-item labelWidth="auto" label="员工人数" borderBottom>
<u--input :readonly="readonly" v-model="formData.employee" placeholder="请输入员工人数"></u--input>
</u-form-item>
<u-form-item labelWidth="auto" label="耕地总面积" borderBottom>
<u--input :readonly="readonly" v-model="formData.arableLand" placeholder="请输入员工人数"></u--input>
</u-form-item>
<view class="">
<u-form-item labelWidth="auto" labelPosition="top" label="土地规划" borderBottom>
<u-radio-group :disabled="readonly" v-model="formData.breeding_company" style="margin: 16rpx;">
<view class="" style="display: flex;justify-content: space-between;flex-wrap: wrap;">
<u-radio :customStyle="{marginRight: '16px',overflow: 'auto',marginBottom:'16rpx'}"
v-for="(item, index) in [{value:'0',label:'自己种'},{value:'1',label:'出租'},{value:'2',label:'代种养'},{value:'3',label:'租更多地扩大种殖'}]"
:key="index" :label="item.label" :name="item.value">
</u-radio>
</view>
</u-radio-group>
</u-form-item>
</view>
<u-form-item labelWidth="auto" label="有无养殖培训" borderBottom>
<u-radio-group :disabled="readonly" v-model="formData.breeding_training" style="margin: 16rpx;">
<u-radio :customStyle="{marginRight: '16px'}"
v-for="(item, index) in [{value:'1',label:'有'},{value:'0',label:'无'}]" :key="index"
:label="item.label" :name="item.value">
</u-radio>
</u-radio-group>
</u-form-item>
<u-form-item labelWidth="auto" label="现代化程度(%)" borderBottom>
<u--input :readonly="readonly" v-model="formData.modernization" placeholder="请输入现代化程度(%)"
type="number" maxlength="3"></u--input>
</u-form-item>
<picker :range="breedingTypeList" range-key="name" :disabled="readonly" mode="selector"
@change="changeBreeding">
<u-form-item labelWidth="auto" label="种养殖类型" borderBottom>
<u--input :value="breedingName" style="pointer-events: none;" placeholder="请选择养殖类型" disabled
disabledColor="#fff"></u--input>
<u-icon slot="right" name="arrow-right"></u-icon>
</u-form-item>
</picker>
<u-form-item labelWidth="auto" label="面积" borderBottom>
<u--input :readonly="readonly" v-model="formData.area" placeholder="请输入面积"></u--input>
</u-form-item>
<u-form-item labelWidth="auto" label="农资农具使用情况" borderBottom>
<u--input :readonly="readonly" v-model="formData.farm_tools" placeholder="请输入面积"></u--input>
</u-form-item>
<u-form-item labelWidth="auto" label="是否生态养殖" borderBottom>
<u-radio-group :disabled="readonly" v-model="formData.ecological_farming" style="margin: 16rpx;">
<u-radio :customStyle="{marginRight: '16px'}"
v-for="(item, index) in [{value:'1',label:'是'},{value:'0',label:'否'}]" :key="index"
:label="item.label" :name="item.value">
</u-radio>
</u-radio-group>
</u-form-item>
<picker mode="date" @change="changeDate" :disabled="readonly" :data-value="'breeding_begin_time'">
<u-form-item labelWidth="auto" label="种植开始时间" borderBottom>
<u--input :value="formData.breeding_begin_time" style="pointer-events: none;"
placeholder="请选择养殖开始时间" disabled disabledColor="#fff"></u--input>
<u-icon slot="right" name="arrow-right"></u-icon>
</u-form-item>
</picker>
<picker mode="date" @change="changeDate" :disabled="readonly" :data-value="'breeding_time'">
<u-form-item labelWidth="auto" label="成熟时间" borderBottom>
<u--input :value="formData.breeding_time" style="pointer-events: none;" placeholder="请选择养殖开始时间"
disabled disabledColor="#fff"></u--input>
<u-icon slot="right" name="arrow-right"></u-icon>
</u-form-item>
</picker>
<picker mode="date" @change="changeDate" :disabled="readonly" :data-value="'mature_time'">
<u-form-item labelWidth="auto" label="上市时间" borderBottom>
<u--input :value="formData.mature_time" style="pointer-events: none;" placeholder="请选择上市时间"
disabled disabledColor="#fff"></u--input>
<u-icon slot="right" name="arrow-right"></u-icon>
</u-form-item>
</picker>
<u-form-item labelWidth="auto" label="产量(斤)" borderBottom>
<u--input :readonly="readonly" v-model="formData.yield" placeholder="请输入产量(斤)"
type="number"></u--input>
</u-form-item>
<u-form-item labelWidth="auto" label="预售卖价格(元/500g)" borderBottom>
<u--input :readonly="readonly" v-model="formData.pre_price" placeholder="请输入预售卖价格"></u--input>
</u-form-item>
<u-form-item labelWidth="auto" label="预计收益(元)" borderBottom>
<u--input :readonly="readonly" v-model="formData.estimated_income" placeholder="请输入预计收益(元)"
type="number"></u--input>
</u-form-item>
<u-form-item labelWidth="auto" label="销售渠道" borderBottom>
<u-radio-group :disabled="readonly" v-model="formData.salesChannels" style="margin: 16rpx;">
<u-radio :customStyle="{marginRight: '16px'}"
v-for="(item, index) in [{value:'1',label:'自销'},{value:'0',label:'定点'}]" :key="index"
:label="item.label" :name="item.value">
</u-radio>
</u-radio-group>
</u-form-item>
<u-form-item labelWidth="auto" label="有无加工仓储" borderBottom>
<u-radio-group :disabled="readonly" v-model="formData.processing_storage" style="margin: 16rpx;">
<u-radio :customStyle="{marginRight: '16px'}"
v-for="(item, index) in [{value:'1',label:'有'},{value:'0',label:'无'}]" :key="index"
:label="item.label" :name="item.value">
</u-radio>
</u-radio-group>
</u-form-item>
<u-form-item labelWidth="auto" label="有无宣传推广" borderBottom>
<u-radio-group :disabled="readonly" v-model="formData.promote" style="margin: 16rpx;">
<u-radio :customStyle="{marginRight: '16px'}"
v-for="(item, index) in [{value:'1',label:'有'},{value:'0',label:'无'}]" :key="index"
:label="item.label" :name="item.value">
</u-radio>
</u-radio-group>
</u-form-item>
<u-form-item labelWidth="auto" label="有无运输" borderBottom>
<u-radio-group :disabled="readonly" v-model="formData.transportation" style="margin: 16rpx;">
<u-radio :customStyle="{marginRight: '16px'}"
v-for="(item, index) in [{value:'1',label:'有'},{value:'0',label:'无'}]" :key="index"
:label="item.label" :name="item.value">
</u-radio>
</u-radio-group>
</u-form-item>
<u-form-item labelWidth="auto" label="是否有扩大经营需求" borderBottom>
<u-radio-group :disabled="readonly" v-model="formData.isExpandOperations" style="margin: 16rpx;">
<u-radio :customStyle="{marginRight: '16px'}"
v-for="(item, index) in [{value:'1',label:'是'},{value:'0',label:'否'}]" :key="index"
:label="item.label" :name="item.value">
</u-radio>
</u-radio-group>
</u-form-item>
<u-form-item labelWidth="auto" labelPosition="top" label="种养殖述求" borderBottom>
<u--textarea :disabled="readonly" v-model="formData.request" autoHeight placeholder="请输入您的述求"
border="surround" count></u--textarea>
</u-form-item>
<u-form-item labelWidth="auto" label="是否有政策补贴" borderBottom>
<u-radio-group :disabled="readonly" v-model="formData.isPolicySubsidies" style="margin: 16rpx;">
<u-radio :customStyle="{marginRight: '16px'}"
v-for="(item, index) in [{value:'1',label:'有'},{value:'0',label:'无'}]" :key="index"
:label="item.label" :name="item.value">
</u-radio>
</u-radio-group>
</u-form-item>
<u-form-item labelWidth="auto" label="有无公益拍卖品" borderBottom>
<u-radio-group :disabled="readonly" v-model="formData.isLots" style="margin: 16rpx;">
<u-radio :customStyle="{marginRight: '16px'}"
v-for="(item, index) in [{value:'1',label:'有'},{value:'0',label:'无'}]" :key="index"
:label="item.label" :name="item.value">
</u-radio>
</u-radio-group>
</u-form-item>
<u-form-item labelWidth="auto" label="有无需求的公益拍卖品" borderBottom>
<u-radio-group :disabled="readonly" v-model="formData.isNeedLots" style="margin: 16rpx;">
<u-radio :customStyle="{marginRight: '16px'}"
v-for="(item, index) in [{value:'1',label:'有'},{value:'0',label:'无'}]" :key="index"
:label="item.label" :name="item.value">
</u-radio>
</u-radio-group>
</u-form-item>
<u-form-item labelWidth="auto" labelPosition="top" label="家庭情况说明" borderBottom>
<u--textarea :disabled="readonly" v-model="formData.family" autoHeight placeholder="请输入"
border="surround" count></u--textarea>
</u-form-item>
<u-form-item labelWidth="auto" labelPosition="top" label="家庭总述求" borderBottom>
<u--textarea :disabled="readonly" v-model="formData.familyNotes" autoHeight placeholder="请输入"
border="surround" count></u--textarea>
</u-form-item>
<u-button v-if="!readonly" type="primary" text="提交" @click="confirm1" color="#0122C7"></u-button>
</u--form>
</view>
<!-- 镇批发商信息收集表 -->
<view class="card" v-show='!page'>
<u--form labelPosition="left" :model="formData1" :rules="rules1" ref="breedingForm1">
<u-form-item labelWidth="auto" label="店铺名称" required prop="storeName" borderBottom>
<u--input :readonly="readonly" v-model="formData1.storeName" placeholder="请输入店铺名称"></u--input>
</u-form-item>
<u-form-item labelWidth="auto" label="经营类型" required prop="type" borderBottom>
<u--input :readonly="readonly" v-model="formData1.type" placeholder="请输入经营类型"></u--input>
</u-form-item>
<u-form-item labelWidth="auto" label="店主姓名" required prop="shopkeeperName" borderBottom>
<u--input :readonly="readonly" v-model="formData1.shopkeeperName" placeholder="请输入店主姓名"></u--input>
</u-form-item>
<u-form-item labelWidth="auto" label="店主性别" required prop="arableLand" borderBottom>
<u-radio-group :disabled="readonly" v-model="formData1.shopkeeperSex" style="margin: 16rpx;">
<u-radio :customStyle="{marginRight: '16px'}"
v-for="(item, index) in [{value:'1',label:'男'},{value:'0',label:'女'}]" :key="index"
:label="item.label" :name="item.value">
</u-radio>
</u-radio-group>
</u-form-item>
<u-form-item labelWidth="auto" label="店主年龄" required prop="shopkeeperAge" borderBottom>
<u--input :readonly="readonly" type='number' v-model="formData1.shopkeeperAge"
placeholder="请输入店主年龄"></u--input>
</u-form-item>
<u-form-item labelWidth="auto" label="联系方式" required prop="shopkeeperPhone" borderBottom>
<u--input :readonly="readonly" type='number' v-model="formData1.shopkeeperPhone"
placeholder="请输入联系方式"></u--input>
</u-form-item>
<u-form-item labelWidth="auto" label="店铺地址" borderBottom>
<u--input :readonly="readonly" v-model="formData1.address" placeholder="请输入地址"></u--input>
</u-form-item>
<u-form-item labelWidth="auto" label="面积" borderBottom>
<u--input :readonly="readonly" type='number' v-model="formData1.area"
placeholder="请输入地址"></u--input>
</u-form-item>
<u-form-item labelWidth="auto" label="经营年限" borderBottom>
<u--input :readonly="readonly" type='number' v-model="formData1.storeAge"
placeholder="请输入经营年限"></u--input>
</u-form-item>
<u-form-item labelWidth="auto" label="人数" borderBottom>
<u--input :readonly="readonly" type='number' v-model="formData1.Number"
placeholder="请输入人数"></u--input>
</u-form-item>
<u-form-item labelWidth="auto" label="店铺规模" required prop="storeScale" borderBottom>
<u-radio-group :disabled="readonly" v-model="formData1.storeScale" style="margin: 16rpx;">
<u-radio :customStyle="{marginRight: '16px'}"
v-for="(item, index) in [{value:'0',label:'批发'},{value:'1',label:'零售'},{value:'2',label:'独家经营'}]"
:key="index" :label="item.label" :name="item.value">
</u-radio>
</u-radio-group>
</u-form-item>
<u-form-item labelWidth="auto" label="店铺规模排名" required prop="storeRanking" borderBottom>
<u-radio-group :disabled="readonly" v-model="formData1.storeRanking" style="margin: 16rpx;">
<u-radio :customStyle="{marginRight: '16px'}"
v-for="(item, index) in [{value:'0',label:'前3'},{value:'1',label:'居中'},{value:'2',label:'小规模'}]"
:key="index" :label="item.label" :name="item.value">
</u-radio>
</u-radio-group>
</u-form-item>
<u-form-item labelWidth="auto" label="店铺影响力" required prop="Influence" borderBottom>
<u-radio-group :disabled="readonly" v-model="formData1.Influence" style="margin: 16rpx;">
<u-radio :customStyle="{marginRight: '16px'}"
v-for="(item, index) in [{value:'0',label:'大'},{value:'1',label:'中'},{value:'2',label:'小'}]"
:key="index" :label="item.label" :name="item.value">
</u-radio>
</u-radio-group>
</u-form-item>
<u-form-item labelWidth="auto" labelPosition="top" label="店铺年营收" required prop="revenue" borderBottom>
<u-radio-group :disabled="readonly" v-model="formData1.revenue" style="margin: 16rpx;">
<u-radio :customStyle="{marginRight: '16px',}"
v-for="(item, index) in [{value:'0',label:'10万以下'},{value:'1',label:'10-30万'},{value:'2',label:'30万以上'}]"
:key="index" :label="item.label" :name="item.value">
</u-radio>
</u-radio-group>
</u-form-item>
<u-form-item labelWidth="auto" label="店铺产权" required prop="propertyRights" borderBottom>
<u-radio-group :disabled="readonly" v-model="formData1.propertyRights" style="margin: 16rpx;">
<u-radio :customStyle="{marginRight: '16px'}"
v-for="(item, index) in [{value:'0',label:'自有'},{value:'1',label:'租赁'}]" :key="index"
:label="item.label" :name="item.value">
</u-radio>
</u-radio-group>
</u-form-item>
<u-form-item labelWidth="auto" label="店铺归属" required prop="ascription" borderBottom>
<u-radio-group :disabled="readonly" v-model="formData1.ascription" style="margin: 16rpx;">
<u-radio :customStyle="{marginRight: '16px',}"
v-for="(item, index) in [{value:'0',label:'私有'},{value:'1',label:'合伙'},{value:'2',label:'加盟'},{value:'3',label:'国有'},]"
:key="index" :label="item.label" :name="item.value">
</u-radio>
</u-radio-group>
</u-form-item>
<u-form-item labelWidth="auto" label="店铺进货渠道" borderBottom>
<u--input :readonly="readonly" v-model="formData1.incomingChannels"
placeholder="请输入进货渠道"></u--input>
</u-form-item>
<u-form-item labelWidth="auto" label="有无仓储" borderBottom>
<u-radio-group :disabled="readonly" v-model="formData1.isWarehousing" style="margin: 16rpx;">
<u-radio :customStyle="{marginRight: '16px'}"
v-for="(item, index) in [{value:'1',label:'有'},{value:'0',label:'无'}]" :key="index"
:label="item.label" :name="item.value">
</u-radio>
</u-radio-group>
</u-form-item>
<u-form-item labelWidth="auto" label="有无冻库" borderBottom>
<u-radio-group :disabled="readonly" v-model="formData1.isColdStorage" style="margin: 16rpx;">
<u-radio :customStyle="{marginRight: '16px'}"
v-for="(item, index) in [{value:'1',label:'有'},{value:'0',label:'无'}]" :key="index"
:label="item.label" :name="item.value">
</u-radio>
</u-radio-group>
</u-form-item>
<u-form-item labelWidth="auto" label="有无入驻其他平台" borderBottom>
<u-radio-group :disabled="readonly" v-model="formData1.isSettled" style="margin: 16rpx;">
<u-radio :customStyle="{marginRight: '16px'}"
v-for="(item, index) in [{value:'1',label:'有'},{value:'0',label:'无'}]" :key="index"
:label="item.label" :name="item.value">
</u-radio>
</u-radio-group>
</u-form-item>
<u-form-item labelWidth="auto" label="现代文化程度" borderBottom>
<u--input :readonly="readonly" v-model="formData1.Education" placeholder="请输入文化程度"></u--input>
</u-form-item>
<u-form-item labelWidth="auto" label="有无宣传推广" borderBottom>
<u-radio-group :disabled="readonly" v-model="formData1.isPublicize" style="margin: 16rpx;">
<u-radio :customStyle="{marginRight: '16px'}"
v-for="(item, index) in [{value:'1',label:'有'},{value:'0',label:'无'}]" :key="index"
:label="item.label" :name="item.value">
</u-radio>
</u-radio-group>
</u-form-item>
<u-form-item labelWidth="auto" label="有无运输" borderBottom>
<u-radio-group :disabled="readonly" v-model="formData1.isTransport" style="margin: 16rpx;">
<u-radio :customStyle="{marginRight: '16px'}"
v-for="(item, index) in [{value:'1',label:'有'},{value:'0',label:'无'}]" :key="index"
:label="item.label" :name="item.value">
</u-radio>
</u-radio-group>
</u-form-item>
<u-form-item labelWidth="auto" label="主要供给明细" borderBottom>
<u--input :readonly="readonly" v-model="formData1.supply" placeholder="请输入供给明细"></u--input>
</u-form-item>
<u-form-item labelWidth="auto" labelPosition="top" label="店铺述求" required prop="notes" borderBottom>
<u--textarea :disabled="readonly" v-model="formData1.notes" autoHeight placeholder="请输入"
border="surround" count></u--textarea>
</u-form-item>
<u-form-item labelWidth="auto" labelPosition="top" label="综合描述与分析" required prop="description"
borderBottom>
<u--textarea :disabled="readonly" v-model="formData1.description" autoHeight placeholder="请输入"
border="surround" count></u--textarea>
</u-form-item>
<view class="" style="height: 20rpx;">
</view>
<u-button v-if="!readonly" type="primary" text="提交" @click="confirm" color="#0122C7"></u-button>
</u--form>
</view>
</view>
<view class="" v-else>
<u-loading-page></u-loading-page>
</view>
</template>
<script>
import {
Toast
} from "../../libs/uniApi.js"
import {
townMasterTask3Commit,
townMasterTask3List
} from "@/api/task.js"
export default {
props: {
datas: {
type: Object,
default: null
},
update_time: {
type: String,
default: null
}
},
data() {
return {
flag: false,
page: 1,
taskId: "",
readonly: false,
landPlanList: ['自己养', '出租', '代养', '租更多地扩大养殖'],
pas_Info: {
planting: [],
supply: []
},
breedingTypeList: [{
id: 1,
name: "水产"
},
{
id: 2,
name: "禽类"
},
{
id: 3,
name: "大型动物"
},
],
formData: {
"entityName": "",
phone: "",
employee: "",
arableLand: "",
"breeding_training": 1, //
"breeding_type": "", //
"area": "", //
breeding_begin_time: "",
"breeding_time": "", //
"mature_time": "", //
"yield": "", //
salesChannels: "",
isExpandOperations: "", //
request: "", //
isPolicySubsidies: "", //
isLots: "", //
isNeedLots: "", //
family: "",
familyNotes: "",
"farm_tools": "", //使
"ecological_farming": "", //
"modernization": "", //
"processing_storage": "", //
"promote": "", //广
"transportation": "", //
},
formData1: {
storeName: "",
type: "",
shopkeeperName: "",
shopkeeperSex: "",
shopkeeperAge: "",
shopkeeperPhone: "",
address: "",
area: "",
storeAge: "",
Number: "",
storeScale: "",
storeRanking: "",
Influence: "",
revenue: "",
propertyRights: "",
ascription: "",
incomingChannels: "",
isWarehousing: "",
isColdStorage: "",
isSettled: "",
Education: "",
isPublicize: "",
isTransport: "",
supply: "",
notes: "",
description: ""
},
rules: {
},
rules1: {
}
}
},
onLoad(option) {
this.taskId = option.task_id
if (option.type == 'supply') this.page = 0
townMasterTask3List({
id: option.task_id
}).then(res => {
this.pas_Info = res.data.template_info.extend.purchase_sales_info || this.pas_Info
if (option.index) {
this.readonly = true
this.flag = true
console.log(option, 6464)
if (option.type == 'supply') {
this.formData1 = this.pas_Info.supply[option.index]
} else {
this.formData = this.pas_Info.planting[option.index]
}
}
// if (option.type == 'supply') {
// this.formData1 = res.data.template_info.extend.purchase_sales_info[option.index]?.supply[0]
// } else {
// this.formData = res.data.template_info.extend.purchase_sales_info[option.index]?.planting[
// 0]
// }
})
// }
this.flag = true
},
created() {
this.initRules();
},
computed: {
breedingName() {
return this.breedingTypeList.find((item) => item.id == this.formData.breeding_type)?.name;
}
},
methods: {
//
initRules() {
let arr = Object.keys(this.formData);
let arr1 = Object.keys(this.formData1);
let white = ['demand', 'policy_subsidies'];
arr = arr.filter(item => {
return !white.includes(item);
})
arr1 = arr1.filter(item => {
return !white.includes(item);
})
arr.forEach(key => {
this.rules[key] = {
validator: (rule, value, callback) => {
this.$refs.breedingForm.clearValidate(rule.field);
value.trim() !== '' ? callback() : callback('不能为空');
},
trigger: ['change', 'blur']
}
if (key == 'phone') {
console.log("phone")
this.rules[key] = [{
required: true,
message: '请输入手机号',
trigger: ['change', 'blur'],
},
{
validator: (rule, value, callback) => {
return uni.$u.test.mobile(value);
},
message: '手机号码不正确',
trigger: ['blur'],
}
]
}
})
arr1.forEach(key => {
this.rules1[key] = {
validator: (rule, value, callback) => {
this.$refs.breedingForm1.clearValidate(rule.field);
value.trim() !== '' ? callback() : callback('不能为空');
},
trigger: ['change', 'blur']
}
if (key == 'shopkeeperPhone') {
this.rules1[key] = [{
required: true,
message: '请输入手机号',
trigger: ['change', 'blur'],
},
{
validator: (rule, value, callback) => {
return uni.$u.test.mobile(value);
},
message: '手机号码不正确',
trigger: ['blur'],
}
]
}
})
},
//
async validate() {
return await this.$refs.breedingForm.validate();
},
async validate1() {
return await this.$refs.breedingForm1.validate();
},
//
changeBreeding(e) {
// let index = e.currentTarget.dataset.index;
this.formData.breeding_type = this.breedingTypeList[e.detail.value].id;
},
//
changeDate(e) {
let data = e.currentTarget.dataset;
this.formData[data.value] = e.detail.value;
},
async commit() {
console.log(this.pas_Info)
if (this.page) {
this.pas_Info.planting.push(this.formData)
await townMasterTask3Commit({
id: Number(this.taskId),
purchase_sales_info: this.pas_Info
})
} else {
this.pas_Info.supply.push(this.formData1)
await townMasterTask3Commit({
id: Number(this.taskId),
purchase_sales_info: this.pas_Info
})
}
Toast("操作成功")
setTimeout(() => {
uni.navigateBack()
}, 1000)
},
// async nextFormFn() {
// await this.validate()
// this.page = 0
// },
async confirm1() {
await this.validate()
this.commit()
},
async confirm() {
await this.validate1()
this.commit()
}
},
}
</script>
<style lang="scss">
.card {
background-color: #fff;
margin: 28rpx;
padding: 28rpx;
margin-top: 0;
padding-top: 0;
border-radius: 0 0 14rpx 14rpx;
}
.tit {
margin: 28rpx 28rpx 0 28rpx;
padding: 28rpx 28rpx 0 28rpx;
border-radius: 14rpx 14rpx 0 0;
background-color: $theme-oa-color;
color: white;
height: 100rpx;
display: flex;
justify-content: space-between;
}
.title {
font-weight: 500;
font-size: 34rpx;
&::before {
width: 8rpx;
height: 26rpx;
border-radius: 4rpx;
background-color: #0122c7;
content: "";
display: inline-block;
margin-right: 8rpx;
}
}
.delete {
margin: 22rpx 0;
// margin-bottom: 40rpx;
width: 100%;
height: 64rpx;
line-height: 64rpx;
background: #f56c6c;
border-radius: 14rpx;
font-size: 28rpx;
color: #fff;
text-align: center;
}
.plus {
margin: 22rpx 0;
// margin-bottom: 40rpx;
width: 100%;
height: 64rpx;
line-height: 64rpx;
background: $theme-oa-color;
border-radius: 14rpx;
font-size: 28rpx;
color: #fff;
text-align: center;
}
</style>

View File

@ -1,210 +0,0 @@
<template>
<view class="task_page">
<!-- {{taskInfo}} -->
<u-skeleton v-if="skeleton" :class="{'loading': skeleton}" :animate="true" title rows="3" rows-width="92%"
rowsHeight="56">
</u-skeleton>
<block v-else>
<view class="card">
<view class="c_title">{{`任务名称: ${taskInfo.title||''}`}}</view>
<view>{{taskInfo.content||''}}</view>
</view>
<view class="card" v-if="extend_info&&extend_info.target">
<view class="c_title">目标数量: {{extend_info.target}}</view>
</view>
<view class="card" v-if="extend_info&&extend_info.store_name">
<view class="c_title">指定商品: </view>
<view class="store">
<view class="store_name" v-for="(item, index) in extend_info.store_name" :key="index"
@click="copyName(item)">
{{item}}
</view>
</view>
</view>
<view class="card">
<view class="c_title">判定条件:</view>
<view style="white-space: pre-line;">{{remark}}</view>
</view>
</block>
</view>
</template>
<script>
import {
Toast
} from "../../libs/uniApi";
import {
townTaskDetails
} from "@/api/task.js"
import {
dictDataListsTypeValue
} from "@/api/oaPbulic.js"
export default {
data() {
return {
taskInfo: {
id: '',
title: '',
content: '',
extend: {}
},
extend_info: null,
remark: '',
skeleton: true,
type_value: 'town_task_type', //
}
},
onLoad(options) {
options.task_id ? this.taskInfo.id = options.task_id : null;
options.type_value ? this.type_value = options.type_value : null;
this.initTask();
},
onShow() {},
methods: {
async initTask() {
this.skeleton = true;
let res = await townTaskDetails({
id: this.taskInfo.id
});
if (res.data?.template_info?.extend) {
if (res.data?.template_info?.extend?.goods_id && typeof res.data?.template_info?.extend
?.goods_id !== 'object') {
res.data.template_info.extend.goods_id = res.data?.template_info?.extend?.goods_id.split(',');
res.data.template_info.extend.store_name = res.data?.template_info?.extend?.store_name.split(
';') || [];
}
this.extend_info = res.data?.template_info?.extend;
}
this.taskInfo = res.data;
let dict = await dictDataListsTypeValue({
type_value: this.type_value
// type_value: 'town_task_type_master'
})
dict.data.forEach((item) => {
if (item.id == this.taskInfo.type) {
this.remark = item.remark;
}
})
this.skeleton = false;
},
copyName(str = "", type = "商品名称") {
if (str) uni.setClipboardData({
data: str + "",
success: (e) => {
Toast(type + '已复制')
},
fail: (e) => {
Toast('复制失败')
}
})
}
},
}
</script>
<style lang="scss">
.task_page {
padding-top: 30rpx;
.card {
margin: 0 auto;
margin-bottom: 28rpx;
width: 694rpx;
background-color: #fff;
border-radius: 26rpx;
padding: 28rpx;
.c_title {
font-size: 32rpx;
font-weight: bold;
color: #333333;
margin-bottom: 20rpx;
}
.file {
display: flex;
justify-content: left;
flex-wrap: wrap;
&_item {
flex-shrink: 0;
width: 200rpx;
height: 200rpx;
margin: 0 auto;
margin-bottom: 16rpx;
border: 2px solid #ccc;
border-radius: 10rpx;
overflow: hidden;
position: relative;
.image {
width: 100%;
height: 100%;
}
.del {
position: absolute;
height: 40rpx;
width: 40rpx;
top: 10rpx;
right: 10rpx;
}
}
&_btn {
flex-shrink: 0;
width: 200rpx;
height: 200rpx;
margin: 0 auto;
margin-bottom: 16rpx;
border: 2px solid #ccc;
display: flex;
justify-content: center;
align-items: center;
flex-direction: column;
border-radius: 10rpx;
image {
width: 100rpx;
height: 100rpx;
}
}
&_empty {
flex-shrink: 0;
width: 200rpx;
height: 200rpx;
margin: 0 auto;
margin-bottom: 16rpx;
border: 2px solid transparent;
}
}
.store {
display: flex;
flex-wrap: wrap;
font-size: 26rpx;
color: #0122c7;
margin-top: -10rpx;
&_name {
flex-shrink: 0;
padding: 8rpx;
border: 5rpx solid #0122c7;
border-radius: 10rpx;
// background-color: rgba(#0122c7, 0.1);
// background-color: rgba(#0122c7, 0.1);
max-width: 80vw;
margin-right: 10rpx;
margin-top: 10rpx;
}
}
}
.loading {
padding: 28rpx;
}
}
</style>

View File

@ -1,344 +0,0 @@
<template>
<view style="padding-top: 28rpx;padding-bottom: 160rpx;">
<view class="card">
<view class="title">任务名称: {{task.title}}</view>
<u-line style="margin: 14rpx 0;"></u-line>
<!-- <view class="text">阶段类型: 单次</view> -->
<view class="text" style="color: #FF7C32;" v-if="task.extend&&task.extend.shareholder">入股金额:
{{task.extend.shareholder.money}}
</view>
</view>
<!-- <view class="card">
<view class="title">任务描述</view>
<u-line style="margin: 14rpx 0;"></u-line>
<view class="text">{{task.content||'暂无任务描述'}}</view>
</view> -->
<!-- <view class="card">
<view class="title">事件记录</view>
<u-line style="margin: 14rpx 0;"></u-line>
<u-steps v-if="task.extend&&task.extend.shareholder" :current="-1" direction="column" activeColor="#0122c7"
dot inactiveColor="#0122c7">
<u-steps-item v-for="(item, index) in task.extend.shareholder.user_list" :title="item.time"
:desc="item.info">
</u-steps-item>
</u-steps>
</view> -->
<view class="card" v-if="task.approve_status==3">
<view class="title" style="color: #FF7C32;">驳回提示</view>
<u-line style="margin: 14rpx 0;"></u-line>
<view class="text" style="color: #FF7C32;">{{task.deny_notes}}</view>
<!-- <button v-if="other.is_commit==1" class="btn" @click="toUpdate">去修改</button> -->
</view>
<view class="card">
<view class="title">凭证上传</view>
<u-line style="margin: 14rpx 0;"></u-line>
<view class="" style="display: flex;align-items: center;">
<text style="margin-right: 10rpx;">金额:</text>
<view class="" style="width: 500rpx;">
<u--input style="border: 1px solid #CCCCCC;" :readonly='isDisabled && task.approve_status!=3'
placeholder="请输入金额" type='number' border="surround" v-model="amount"></u--input>
</view>
</view>
<view class="" :class="{hide:file}" v-if="!isDisabled || task.approve_status==3">
<view class="" :class="{hide:progress!=0}">
<lsjUpload ref="lsjUpload" childId="upload1" :size="10" :option="fileOption" height="200rpx"
style="margin-top: 28rpx;" :debug="false" :formats="'png,jpg,jpeg,pdf,webp'" :multiple="false"
:count="1" :instantly="false" @change="changeFile" @uploadEnd="onuploadEnd"
@progress="onprogress">
<view class="change-file">上传凭证</view>
</lsjUpload>
</view>
<view style="margin-top: 20rpx;" v-if="progress>0">
<u-loading-icon :text=" '正在上传中'+ progress+'%'" textSize="18"></u-loading-icon>
</view>
</view>
<view class="file" v-if='file'>
<view class="">
<image :src="local_src||file" style="width: 150rpx;height: 150rpx;margin-right: 12rpx;"
v-if="file_type=='image'">
</image>
<image src="@/static/img/contract/pdf.png" style="width: 150rpx;height: 150rpx;margin-right: 12rpx;"
v-else>
</image>
</view>
<view class="r-cont">
<view class="">
{{fileTit}}
</view>
<view class="" style="display: flex;">
<view class="" style="color: blue;margin-right: 10rpx;" @click="navToContract">
查看
</view>
<view class="" style="color: red;" @click="delFn" v-if="!isDisabled ||task.approve_status==3">
删除
</view>
</view>
</view>
</view>
<!-- <button @click='uplodeFileFn'>点击上传附件</button> -->
<!-- <image class="contract_img" src="@/static/img/contract/pdf.png"></image> -->
<!-- <view class="text">
<view class="name">{{item.contract_type_name||'合同'}}</view>
<view>
<text>{{item.update_time}}</text>
</view>
</view> -->
<!-- <view class="text" style="color: #FF7C32;">入股的金额将在次日凌晨更新到"股金管理"请于次日打开"股金管理"页面查看详情</view> -->
</view>
<!-- <mybtn v-if="task.status!=3 && task.status!=5" text="前往支付页面"
@click="navTo(`/subpkg/topUp/topUp?task_id=${task_id}`)"></mybtn>
<mybtn v-else :text="task.status==3?'已完成任务':'任务已关闭'" :my_btn_disabled="true"></mybtn> -->
<mybtn v-if="!isDisabled" text="提交" @click="submitFn"></mybtn>
<mybtn v-else-if="task.approve_status==3" text="已驳回,请重新提交" @click="submitFn"></mybtn>
<mybtn v-else-if='task.status==3' text="已完成任务" :my_btn_disabled="true"></mybtn>
<mybtn v-else-if="isDisabled" text="任务已经提交" :my_btn_disabled="true"></mybtn>
</view>
</template>
<script>
import {
taskShareholder,
commit_village_task_4API,
commit_village_task_5API,
commit_town_service_manager_task_6API,
commit_town_master_task_6API
} from "@/api/task.js"
import lsjUpload from '@/uni_modules/lsj-upload/components/lsj-upload/lsj-upload.vue'
import {
FILE_URL,
IMG_URL
} from '@/api/file.js'
import {
Toast
} from "../../libs/uniApi";
export default {
components: {
lsjUpload
},
data() {
return {
progress: 0,
imgTypeList: ["png", "jpg", "jpeg", "webp"],
isDisabled: false,
amount: "",
fileOption: {},
task: {},
task_id: -1,
file: "",
local_src: "",
fileTit: "",
file_type: "pdf",
type_value: "",
};
},
onLoad(options) {
this.task_id = options.task_id;
this.type_value = options.type_value
this.loadTask();
uni.$on('upBuyShare', this.loadTask);
this.fileOption = {
url: FILE_URL,
name: 'file',
header: {
token: this.$store.state.app.token
}
}
},
methods: {
navToContract() {
let fileSrc = this.file
if (this.file_type == 'image') {
uni.previewImage({
urls: [fileSrc]
})
} else {
uni.navigateTo({
url: `/subpkg/pdfView/pdfView?url=${fileSrc}`
})
}
},
async submitFn() {
if (!this.amount) return Toast("请输入金额")
let data = {
id: this.task_id,
annex: this.file,
amount: this.amount,
file_type: this.file_type
}
if (this.type_value == "village_task_type_5") {
let res = await commit_village_task_5API({
...data
})
}
if (this.type_value == "village_task_type_4") {
let res = await commit_village_task_4API({
...data
})
}
if (this.type_value == "town_task_type_6") {
let res = await commit_town_service_manager_task_6API({
...data
})
}
if (this.type_value == "town_task_type_master_6") {
let res = await commit_town_master_task_6API({
...data
})
}
Toast("操作成功!")
setTimeout(() => {
uni.navigateBack()
}, 1000)
},
delFn() {
if (this.task.approve_status != 3) this.clear()
this.file = ""
this.file_type = "pdf"
this.progress = 0
},
clear() {
this.$refs.lsjUpload.clear();
},
/**
* 某文件上传结束回调(成功失败都回调)
* @param {Object} item 当前上传完成的文件
*/
onuploadEnd(item) {
let res = JSON.parse(item.responseText)
this.file = res.data.uri
this.fileTit = res.data.name
this.$forceUpdate();
},
/**
* 上传进度回调
* 如果网页上md文档没有渲染出事件名称onprogre请复制代码的小伙伴自行添加上哈没有哪个事件是只(item)
* @param {Object} item 当前正在上传的文件
*/
onprogress(item) {
this.progress = item.progress
},
/**
* 文件选择回调
* @param {Object} files 已选择的所有文件Map集合
*/
async changeFile(files) {
let type = [...files.values()][0]?.name || null
if (!type) return
let isImage = null
this.imgTypeList.forEach(item => {
if (type.includes(item)) {
isImage = true
this.file_type = 'image'
}
})
this.local_src = [...files.values()][0].path
if (isImage) {
this.$refs.lsjUpload.setData("url", IMG_URL)
} else {
this.$refs.lsjUpload.setData("url", FILE_URL)
}
this.$refs.lsjUpload.upload()
//
this.files = files;
//
this.$forceUpdate();
},
async loadTask() {
let res = await taskShareholder({
id: this.task_id
});
this.task = res.data;
if (this.task.extend?.is_commit == 1) {
this.file = this.task.extend.annex
this.file_type = this.task.extend.file_type
this.amount = this.task.extend.amount || 0
this.fileTit = "附件"
this.isDisabled = true
}
},
navTo(url) {
if (url) {
uni.showLoading({
title: '加载中',
mask: true
});
uni.navigateTo({
url: url,
success() {
uni.hideLoading()
}
})
} else Toast('暂未开放')
},
}
}
</script>
<style lang="scss">
.card {
margin: 0 auto;
margin-bottom: 28rpx;
width: 694rpx;
background: #FFFFFF;
border-radius: 14rpx;
padding: 28rpx;
.title {
font-size: 32rpx;
font-weight: bold;
color: #333333;
}
.text {
line-height: 50rpx;
}
}
.contract_img {
width: 102rpx;
height: 102rpx;
background: #F5F5F5;
border-radius: 14rpx 14rpx 14rpx 14rpx;
margin-right: 21rpx;
}
.change-file {
margin: 0 auto;
width: 500rpx;
height: 200rpx;
border: 2px dashed #ccc;
border-radius: 14rpx;
color: #999;
font-size: 32rpx;
display: flex;
justify-content: center;
align-items: center;
}
.file {
margin-top: 30rpx;
display: flex;
// justify-content: space-between;
.r-cont {
display: flex;
justify-content: space-around;
flex-direction: column;
}
}
.hide {
height: 0;
overflow: hidden;
}
</style>

View File

@ -1,441 +0,0 @@
<template>
<view style="padding-top: 28rpx;padding-bottom: 160rpx;">
<view class="card">
<view class="title">任务名称: {{taskInfo.title}}</view>
<view>{{taskInfo.content||''}}</view>
</view>
<view class="card">
<view class="title">任务描述</view>
<u-line style="margin: 14rpx 0;"></u-line>
<view class="text">{{taskInfo.content}}</view>
</view>
<view class="card" v-if="approve_status==3">
<view class="title" style="color: #FF7C32;">驳回提示</view>
<u-line style="margin: 14rpx 0;"></u-line>
<view class="text" style="color: #FF7C32;">{{deny_notes}}</view>
<button v-if="other.is_commit==1" class="btn" @click="toUpdate">去修改</button>
</view>
<view class="card">
<!-- 图片 -->
<view class="title" style="margin-bottom: 16rpx;">图片凭证</view>
<view class="file">
<view class="file_item" v-for="(item, index) in fileList" :key="'file'+index">
<image class="image" :src="item" @click="priview(index)"></image>
<image v-if="!other.is_commit" class="del" src="/static/icons/delete.png"
@click.stop="deleteFile(index)">
</image>
</view>
<view v-if="!other.is_commit && this.fileList.length<9" class="file_btn" @click="chooseFile">
<image src="/static/icons/plus.png"></image>
</view>
<view class="file_empty" v-for="k in placeholderLength" :key="'empty'+k"></view>
</view>
</view>
<view class="card">
<!-- 视频 -->
<view class="title" style="margin-bottom: 16rpx;">视频凭证</view>
<view class="file">
<view class="file_item" v-for="(item, index) in videoList" :key="'file_v'+index">
<image class="image" src="/static/img/task/video_bg.png" @click="videoshow(item)"></image>
<image v-if="!other.is_commit" class="del" src="/static/icons/delete.png"
@click.stop="deleteFile(index, 'video')">
</image>
</view>
<view v-if="!other.is_commit && this.videoList.length<9" class="file_btn" @click="chooseVideo">
<image src="/static/icons/plus.png"></image>
</view>
<view class="file_empty" v-for="k in placeholderLengthVideo" :key="'empty_v'+k"></view>
</view>
</view>
<view class="card">
<view class="title" style="margin-bottom: 16rpx;">补充说明</view>
<u--textarea :disabled="other.is_commit==1" v-model="note" placeholder="请输入内容"
placeholderStyle="font-size: 22rpx;" style="font-size: 28rpx;background-color: #eee;min-height: 100px;"
autoHeight maxlength="-1"></u--textarea>
</view>
<!-- <mybtn text="确认提交" @click="$u.throttle(submit, 1500)"></mybtn> -->
<mybtn v-if="!other.is_commit" text="确认提交" @click="$u.throttle(submit, 1500)"></mybtn>
<mybtn v-else-if="taskInfo.status==3" text="已完成" :my_btn_disabled="true" @click="showToast('任务已完成')"></mybtn>
<mybtn v-else-if="taskInfo.status==5" text="已关闭" :my_btn_disabled="true" @click="showToast('任务已关闭!')"></mybtn>
<mybtn v-else-if="approve_status==3" text="已驳回,请重新提交" @click="toUpdate"></mybtn>
<mybtn v-else text="已提交,请等待审核" :my_btn_disabled="true" @click="showToast('请耐心等待审核结果')"></mybtn>
<!--视频预览弹窗-->
<view v-if="show_video" class="video-count">
<video id="myVideo" class="videoLink" autoplay loop muted show-mute-btn enable-play-gesture
vslide-gesture-in-fullscreen :src="video_src"></video>
</view>
<view class='mask' catchtouchmove="true" :hidden='show_video==false' @tap="show_video=false"></view>
</view>
</template>
<script>
import {
upLoadImage,
VIDEO_URL
} from "@/api/file.js"
import {
taskOtherTaskDetail,
taskOtherTaskCommit,
villageTask6Commit,
commit_town_master_task_type_2API,
commit_town_master_task_type_7API,
commit_town_master_task_type_8API
} from "@/api/task.js"
import {
Toast
} from "../../libs/uniApi";
export default {
data() {
return {
task_id: -1,
taskInfo: {},
approve_status: 0, // 123
deny_notes: '', //
other: {
annex: [], //
is_commit: 0, //
note: "", //
video_annex: [] //
},
list1: [{
name: '图片',
}, {
name: '视频',
}],
current: 0,
note: '',
fileList: [],
videoList: [],
video_src: '',
show_video: false,
type_value: ""
};
},
onLoad(options) {
this.task_id = options.task_id;
this.type_value = options?.type_value || ""
this.initDetail();
},
computed: {
//
placeholderLength() {
if (this.fileList.length == 9) return 0;
if (this.other.is_commit == 1) return this.fileList.length % 3 == 0 ? 0 : 3 - this.fileList.length % 3;
return (this.fileList.length + 1) % 3 == 0 ? 0 : 3 - (this.fileList.length + 1) % 3;
},
placeholderLengthVideo() {
if (this.videoList.length == 9) return 0;
if (this.other.is_commit == 1) return this.videoList.length % 3 == 0 ? 0 : 3 - this.videoList.length % 3;
return (this.videoList.length + 1) % 3 == 0 ? 0 : 3 - (this.videoList.length + 1) % 3;
},
},
methods: {
//
initDetail() {
taskOtherTaskDetail({
id: this.task_id
}).then((res) => {
this.taskInfo = res.data;
this.other = JSON.parse(JSON.stringify(res.data?.extend?.other || {})); //
this.approve_status = res.data?.approve_status;
this.deny_notes = res.data?.deny_notes;
res.data?.extend?.other?.note ? this.note = res.data?.extend?.other?.note : null;
res.data?.extend?.other?.annex ? this.fileList = res.data?.extend?.other?.annex : null;
res.data?.extend?.other?.video_annex ? this.videoList = res.data?.extend?.other?.video_annex :
null;
// this.other.is_commit = 0;
})
},
//
toUpdate() {
this.other.is_commit = 0;
},
// , true
isReject() {
if (this.approve_status == 3) { //
let other = {
note: this.note,
annex: this.fileList,
video_annex: this.videoList
}
let flag = true;
if (JSON.stringify(other) == JSON.stringify({
note: this.other.note,
annex: this.other.annex,
video_annex: this.other.video_annex
})) flag = false;
if (!flag) {
Toast('未检测到您的修改,请修改后提交')
}
return flag;
} else return true;
},
//
async submit() {
if (!this.isReject()) return; //
if (this.note.trim() == '') return Toast('详情描述不能为空');
if (this.type_value == 'town_task_type_master_2') {
await commit_town_master_task_type_2API({
id: this.task_id,
note: this.note,
annex: this.fileList,
video_annex: this.videoList
});
}
if (this.type_value == 'town_task_type_master_7') {
await commit_town_master_task_type_7API({
id: this.task_id,
note: this.note,
annex: this.fileList,
video_annex: this.videoList
});
}
if (this.type_value == 'town_task_type_master_8') {
await commit_town_master_task_type_8API({
id: this.task_id,
note: this.note,
annex: this.fileList,
video_annex: this.videoList
});
} else {
await villageTask6Commit({
id: this.task_id,
note: this.note,
annex: this.fileList,
video_annex: this.videoList
});
}
this.other.is_commit = 1;
this.approve_status = 1;
Toast('提交成功');
this.$u.sleep(500).then(() => {
uni.navigateBack()
})
},
clickTabs(item) {
this.current = item.index;
},
showToast(str) {
Toast(str)
},
chooseFile() {
uni.chooseImage({
sizeType: ['compressed'],
success: async (res) => {
for (let item of res.tempFiles) {
let ul = await upLoadImage({
filePath: item.path,
name: 'file'
});
this.fileList.push(ul.data.uri);
}
}
});
},
chooseVideo() {
uni.chooseVideo({
sourceType: ['album', 'camera'], //
maxDuration: 60, //
success: (res) => {
const video = res.tempFilePath;
let timer;
let title = '上传中';
timer = setInterval(() => {
uni.showLoading({
title: title
})
}, 1000)
//
let uploadTask = uni.uploadFile({
url: VIDEO_URL,
filePath: video,
name: 'file',
header: {
token: this.$store.state.app.token
},
success: (uploadFileRes) => {
clearInterval(timer);
uni.hideLoading();
uploadFileRes.data = JSON.parse(uploadFileRes.data)
if (uploadFileRes.data.code == 1) {
this.videoList.push(uploadFileRes.data.data.uri)
} else Toast('网络错误')
},
fail: (err) => {
clearInterval(timer);
uni.hideLoading();
Toast('网络错误')
}
})
uploadTask.onProgressUpdate((fileRes) => {
title = `上传中...${fileRes.progress}%`;
})
},
fail() {
Toast('用户取消上传')
}
});
},
priview(index) {
uni.previewImage({
urls: this.fileList,
current: index,
longPressActions: {
itemList: ['删除'],
itemColor: '#ff0000',
success(e) {
if (e.tapIndex == 0) this.deleteFile(e.index);
}
},
})
},
/*查看视频*/
videoshow(src) {
this.video_src = src;
this.show_video = true;
this.$nextTick(() => {
this.videoContext = uni.createVideoContext('myVideo', this);
this.videoContext.play();
})
},
//
deleteFile(index, type = 'image') {
if (type == 'image') this.fileList.splice(index, 1);
else if (type == 'video') this.videoList.splice(index, 1);
},
navTo(url) {
if (url) {
uni.showLoading({
title: '加载中',
mask: true
});
uni.navigateTo({
url: url,
success() {
uni.hideLoading()
}
})
} else Toast('暂未开放')
},
}
}
</script>
<style lang="scss">
::v-deep .u-tabs__wrapper__nav__item__text {
font-size: 28rpx !important;
}
.video-count {
position: fixed;
width: 600rpx;
height: 500rpx;
top: 50%;
left: 50%;
margin-left: -300rpx;
margin-top: -250rpx;
z-index: 100;
display: flex;
align-items: center;
justify-content: center;
.videoLink {
width: 600rpx;
height: 500rpx;
}
}
.card {
margin: 0 auto;
margin-bottom: 28rpx;
width: 694rpx;
background: #FFFFFF;
border-radius: 14rpx;
padding: 28rpx;
.title {
font-size: 32rpx;
font-weight: bold;
color: #333333;
}
.text {
line-height: 50rpx;
}
.btn {
background-color: $theme-oa-color;
color: #FFFFFF;
font-size: 28rpx;
height: 60rpx;
line-height: 60rpx;
margin-top: 16rpx;
}
.file {
display: flex;
justify-content: left;
flex-wrap: wrap;
&_item {
flex-shrink: 0;
width: 200rpx;
height: 200rpx;
margin: 0 auto;
margin-bottom: 16rpx;
border: 2px solid #ccc;
border-radius: 10rpx;
overflow: hidden;
position: relative;
.image {
width: 100%;
height: 100%;
}
.del {
position: absolute;
height: 40rpx;
width: 40rpx;
top: 10rpx;
right: 10rpx;
}
}
&_btn {
flex-shrink: 0;
width: 200rpx;
height: 200rpx;
margin: 0 auto;
margin-bottom: 16rpx;
border: 2px solid #ccc;
display: flex;
justify-content: center;
align-items: center;
flex-direction: column;
border-radius: 10rpx;
image {
width: 100rpx;
height: 100rpx;
}
}
&_empty {
flex-shrink: 0;
width: 200rpx;
height: 200rpx;
margin: 0 auto;
margin-bottom: 16rpx;
border: 2px solid transparent;
}
}
}
</style>

View File

@ -32,17 +32,15 @@
<view class="tip"> <view class="tip">
<view class="title">提示</view> <view class="title">提示</view>
<view class="text"> <view class="text">
<text>{{payMoney.end_cycle}}</text>后可提现本周期金额;<br /> 上一周期截至时间是<text>{{payMoney.end_cycle}}</text>;<br />
可提现金额是上一个周期的收益金额,并不是当前公司收益金额,提现后将会由后台审核,审核通过后会直接往您所上传的银行卡汇款,请耐心等待;<br/> 可提现金额是上一个周期的收益金额,并不是当前公司收益金额,提现后将会由后台审核,审核通过后会直接往您所上传的银行卡汇款,请耐心等待;<br/>
<text style="color: #ff7c32;">提现时请注意,需要先上传PDF类型的电子发票后方可提现</text> <text style="color: #ff7c32;">提现时请注意,需要先上传PDF类型的电子发票后方可提现</text>
<!-- <text @click="copyPhone('4008888888')">4008888888</text> --> <!-- <text @click="copyPhone('4008888888')">4008888888</text> -->
</view> </view>
</view> </view>
<view v-if="payMoney.end_cycle" class="price" style="margin-top: 0;"> <view class="price" style="margin-top: 0;">
<button v-if="is_draw" class="btn" @click="pay">全部提现</button> <button class="btn" @click="pay">全部提现</button>
<button else class="btn disabled" @click="noPay">暂时不可提现</button>
</view> </view>
<view class="price"><button class="btn btn2" @click="navToRecord">提现记录</button></view>
<u-modal :show="modelShow" title="提醒" content="删除后上传的文件将会消失,你确定要删除吗?" showCancelButton <u-modal :show="modelShow" title="提醒" content="删除后上传的文件将会消失,你确定要删除吗?" showCancelButton
@confirm="clear(del_name);modelShow=false" @cancel="modelShow=false"></u-modal> @confirm="clear(del_name);modelShow=false" @cancel="modelShow=false"></u-modal>
</view> </view>
@ -70,7 +68,6 @@
end_cycle_time: '', end_cycle_time: '',
invoice: '' // invoice: '' //
}, },
is_draw: 1,
payTimer: null, payTimer: null,
timeCount: 5, timeCount: 5,
fileOption: {}, fileOption: {},
@ -82,7 +79,9 @@
// //
onNavigationBarButtonTap(res) { onNavigationBarButtonTap(res) {
if (res.index === 0) { if (res.index === 0) {
this.navToRecord(); uni.navigateTo({
url: '/subpkg/withdrawList/withdrawList'
})
} }
}, },
onLoad() { onLoad() {
@ -100,11 +99,6 @@
} }
}, },
methods: { methods: {
navToRecord(){
uni.navigateTo({
url: '/subpkg/withdrawList/withdrawList'
})
},
/** /**
* 某文件上传结束回调(成功失败都回调) * 某文件上传结束回调(成功失败都回调)
* @param {Object} item 当前上传完成的文件 * @param {Object} item 当前上传完成的文件
@ -183,7 +177,6 @@
this.payMoney.end_cycle_time = res.data.end_cycle; this.payMoney.end_cycle_time = res.data.end_cycle;
res.data.end_cycle ? this.payMoney.end_cycle = uni.$u.timeFormat(res.data.end_cycle, 'yyyy-mm-dd') : this res.data.end_cycle ? this.payMoney.end_cycle = uni.$u.timeFormat(res.data.end_cycle, 'yyyy-mm-dd') : this
.payMoney.end_cycle || ''; .payMoney.end_cycle || '';
this.is_draw = res.data.is_draw;
}, },
// //
isFile() { isFile() {
@ -218,9 +211,6 @@
}, 1000) }, 1000)
} else Toast(this.timeCount + '秒后再提现!') } else Toast(this.timeCount + '秒后再提现!')
}, },
noPay(){
Toast('暂时不可提现!')
},
// //
async goApply() { async goApply() {
this.payMoney.invoice = ''; this.payMoney.invoice = '';
@ -372,14 +362,6 @@
font-weight: 400; font-weight: 400;
color: #FFFFFF; color: #FFFFFF;
} }
.btn2{
background-color: #fff;
color: #333;
border: 1px solid #eee;
}
.disabled{
background-color: #666;
}
} }
.tip { .tip {

View File

@ -25,7 +25,6 @@
<input v-if="priceList[changeMoney]=='自定义'" class="input" type="digit" placeholder="输入充值金额(元)" <input v-if="priceList[changeMoney]=='自定义'" class="input" type="digit" placeholder="输入充值金额(元)"
v-model="payMoney.money" /> v-model="payMoney.money" />
<button class="btn" @click="pay">申请提现</button> <button class="btn" @click="pay">申请提现</button>
<button class="btn btn2" @click="navToRecord">提现记录</button>
</view> </view>
<!-- <view class="tip"> <!-- <view class="tip">
<view class="title">备注</view> <view class="title">备注</view>
@ -56,7 +55,9 @@
// //
onNavigationBarButtonTap(res){ onNavigationBarButtonTap(res){
if (res.index === 0) { if (res.index === 0) {
this.navToRecord(); uni.navigateTo({
url: '/subpkg/withdrawList/withdrawList'
})
} }
}, },
onLoad() { onLoad() {
@ -66,11 +67,6 @@
}) })
}, },
methods: { methods: {
navToRecord(){
uni.navigateTo({
url: '/subpkg/withdrawList/withdrawList'
})
},
copyPhone(str = "") { copyPhone(str = "") {
uni.setClipboardData({ uni.setClipboardData({
data: str + "", data: str + "",
@ -253,11 +249,6 @@
font-weight: 400; font-weight: 400;
color: #FFFFFF; color: #FFFFFF;
} }
.btn2{
background-color: #fff;
color: #333;
border: 1px solid #eee;
}
} }
.tip { .tip {

View File

@ -1,67 +0,0 @@
## 1.0.42023-03-29
- 修复 手动上传删除一个文件后不能再上传的bug
## 1.0.32022-12-19
- 新增 sourceType 属性, 可以自定义图片和视频选择的来源
## 1.0.22022-07-04
- 修复 在uni-forms下样式不生效的bug
## 1.0.12021-11-23
- 修复 参数为对象的情况下url在某些情况显示错误的bug
## 1.0.02021-11-19
- 优化 组件UI并提供设计资源详见:[https://uniapp.dcloud.io/component/uniui/resource](https://uniapp.dcloud.io/component/uniui/resource)
- 文档迁移,详见:[https://uniapp.dcloud.io/component/uniui/uni-file-picker](https://uniapp.dcloud.io/component/uniui/uni-file-picker)
## 0.2.162021-11-08
- 修复 传入空对象 显示错误的Bug
## 0.2.152021-08-30
- 修复 return-type="object" 时且存在v-model时无法删除文件的Bug
## 0.2.142021-08-23
- 新增 参数中返回 fileID 字段
## 0.2.132021-08-23
- 修复 腾讯云传入fileID 不能回显的bug
- 修复 选择图片后,不能放大的问题
## 0.2.122021-08-17
- 修复 由于 0.2.11 版本引起的不能回显图片的Bug
## 0.2.112021-08-16
- 新增 clearFiles(index) 方法,可以手动删除指定文件
- 修复 v-model 值设为 null 报错的Bug
## 0.2.102021-08-13
- 修复 return-type="object" 时无法删除文件的Bug
## 0.2.92021-08-03
- 修复 auto-upload 属性失效的Bug
## 0.2.82021-07-31
- 修复 fileExtname属性不指定值报错的Bug
## 0.2.72021-07-31
- 修复 在某种场景下图片不回显的Bug
## 0.2.62021-07-30
- 修复 return-type为object下返回值不正确的Bug
## 0.2.52021-07-30
- 修复(重要) H5 平台下如果和uni-forms组件一同使用导致页面卡死的问题
## 0.2.32021-07-28
- 优化 调整示例代码
## 0.2.22021-07-27
- 修复 vue3 下赋值错误的Bug
- 优化 h5平台下上传文件导致页面卡死的问题
## 0.2.02021-07-13
- 组件兼容 vue3如何创建vue3项目详见 [uni-app 项目支持 vue3 介绍](https://ask.dcloud.net.cn/article/37834)
## 0.1.12021-07-02
- 修复 sourceType 缺少默认值导致 ios 无法选择文件
## 0.1.02021-06-30
- 优化 解耦与uniCloud的强绑定关系 如不绑定服务空间默认autoUpload为false且不可更改
## 0.0.112021-06-30
- 修复 由 0.0.10 版本引发的 returnType 属性失效的问题
## 0.0.102021-06-29
- 优化 文件上传后进度条消失时机
## 0.0.92021-06-29
- 修复 在uni-forms 中,删除文件 获取的值不对的Bug
## 0.0.82021-06-15
- 修复 删除文件时无法触发 v-model 的Bug
## 0.0.72021-05-12
- 新增 组件示例地址
## 0.0.62021-04-09
- 修复 选择的文件非 file-extname 字段指定的扩展名报错的Bug
## 0.0.52021-04-09
- 优化 更新组件示例
## 0.0.42021-04-09
- 优化 file-extname 字段支持字符串写法,多个扩展名需要用逗号分隔
## 0.0.32021-02-05
- 调整为uni_modules目录规范
- 修复 微信小程序不指定 fileExtname 属性选择失败的Bug

View File

@ -1,224 +0,0 @@
'use strict';
const ERR_MSG_OK = 'chooseAndUploadFile:ok';
const ERR_MSG_FAIL = 'chooseAndUploadFile:fail';
function chooseImage(opts) {
const {
count,
sizeType = ['original', 'compressed'],
sourceType,
extension
} = opts
return new Promise((resolve, reject) => {
uni.chooseImage({
count,
sizeType,
sourceType,
extension,
success(res) {
resolve(normalizeChooseAndUploadFileRes(res, 'image'));
},
fail(res) {
reject({
errMsg: res.errMsg.replace('chooseImage:fail', ERR_MSG_FAIL),
});
},
});
});
}
function chooseVideo(opts) {
const {
camera,
compressed,
maxDuration,
sourceType,
extension
} = opts;
return new Promise((resolve, reject) => {
uni.chooseVideo({
camera,
compressed,
maxDuration,
sourceType,
extension,
success(res) {
const {
tempFilePath,
duration,
size,
height,
width
} = res;
resolve(normalizeChooseAndUploadFileRes({
errMsg: 'chooseVideo:ok',
tempFilePaths: [tempFilePath],
tempFiles: [
{
name: (res.tempFile && res.tempFile.name) || '',
path: tempFilePath,
size,
type: (res.tempFile && res.tempFile.type) || '',
width,
height,
duration,
fileType: 'video',
cloudPath: '',
}, ],
}, 'video'));
},
fail(res) {
reject({
errMsg: res.errMsg.replace('chooseVideo:fail', ERR_MSG_FAIL),
});
},
});
});
}
function chooseAll(opts) {
const {
count,
extension
} = opts;
return new Promise((resolve, reject) => {
let chooseFile = uni.chooseFile;
if (typeof wx !== 'undefined' &&
typeof wx.chooseMessageFile === 'function') {
chooseFile = wx.chooseMessageFile;
}
if (typeof chooseFile !== 'function') {
return reject({
errMsg: ERR_MSG_FAIL + ' 请指定 type 类型,该平台仅支持选择 image 或 video。',
});
}
chooseFile({
type: 'all',
count,
extension,
success(res) {
resolve(normalizeChooseAndUploadFileRes(res));
},
fail(res) {
reject({
errMsg: res.errMsg.replace('chooseFile:fail', ERR_MSG_FAIL),
});
},
});
});
}
function normalizeChooseAndUploadFileRes(res, fileType) {
res.tempFiles.forEach((item, index) => {
if (!item.name) {
item.name = item.path.substring(item.path.lastIndexOf('/') + 1);
}
if (fileType) {
item.fileType = fileType;
}
item.cloudPath =
Date.now() + '_' + index + item.name.substring(item.name.lastIndexOf('.'));
});
if (!res.tempFilePaths) {
res.tempFilePaths = res.tempFiles.map((file) => file.path);
}
return res;
}
function uploadCloudFiles(files, max = 5, onUploadProgress) {
files = JSON.parse(JSON.stringify(files))
const len = files.length
let count = 0
let self = this
return new Promise(resolve => {
while (count < max) {
next()
}
function next() {
let cur = count++
if (cur >= len) {
!files.find(item => !item.url && !item.errMsg) && resolve(files)
return
}
const fileItem = files[cur]
const index = self.files.findIndex(v => v.uuid === fileItem.uuid)
fileItem.url = ''
delete fileItem.errMsg
uniCloud
.uploadFile({
filePath: fileItem.path,
cloudPath: fileItem.cloudPath,
fileType: fileItem.fileType,
onUploadProgress: res => {
res.index = index
onUploadProgress && onUploadProgress(res)
}
})
.then(res => {
fileItem.url = res.fileID
fileItem.index = index
if (cur < len) {
next()
}
})
.catch(res => {
fileItem.errMsg = res.errMsg || res.message
fileItem.index = index
if (cur < len) {
next()
}
})
}
})
}
function uploadFiles(choosePromise, {
onChooseFile,
onUploadProgress
}) {
return choosePromise
.then((res) => {
if (onChooseFile) {
const customChooseRes = onChooseFile(res);
if (typeof customChooseRes !== 'undefined') {
return Promise.resolve(customChooseRes).then((chooseRes) => typeof chooseRes === 'undefined' ?
res : chooseRes);
}
}
return res;
})
.then((res) => {
if (res === false) {
return {
errMsg: ERR_MSG_OK,
tempFilePaths: [],
tempFiles: [],
};
}
return res
})
}
function chooseAndUploadFile(opts = {
type: 'all'
}) {
if (opts.type === 'image') {
return uploadFiles(chooseImage(opts), opts);
}
else if (opts.type === 'video') {
return uploadFiles(chooseVideo(opts), opts);
}
return uploadFiles(chooseAll(opts), opts);
}
export {
chooseAndUploadFile,
uploadCloudFiles
};

View File

@ -1,667 +0,0 @@
<template>
<view class="uni-file-picker">
<view v-if="title" class="uni-file-picker__header">
<text class="file-title">{{ title }}</text>
<text class="file-count">{{ filesList.length }}/{{ limitLength }}</text>
</view>
<upload-image v-if="fileMediatype === 'image' && showType === 'grid'" :readonly="readonly"
:image-styles="imageStyles" :files-list="filesList" :limit="limitLength" :disablePreview="disablePreview"
:delIcon="delIcon" @uploadFiles="uploadFiles" @choose="choose" @delFile="delFile">
<slot>
<view class="is-add">
<view class="icon-add"></view>
<view class="icon-add rotate"></view>
</view>
</slot>
</upload-image>
<upload-file v-if="fileMediatype !== 'image' || showType !== 'grid'" :readonly="readonly"
:list-styles="listStyles" :files-list="filesList" :showType="showType" :delIcon="delIcon"
@uploadFiles="uploadFiles" @choose="choose" @delFile="delFile">
<slot><button type="primary" size="mini">选择文件</button></slot>
</upload-file>
</view>
</template>
<script>
import {
chooseAndUploadFile,
uploadCloudFiles
} from './choose-and-upload-file.js'
import {
get_file_ext,
get_extname,
get_files_and_is_max,
get_file_info,
get_file_data
} from './utils.js'
import uploadImage from './upload-image.vue'
import uploadFile from './upload-file.vue'
let fileInput = null
/**
* FilePicker 文件选择上传
* @description 文件选择上传组件可以选择图片视频等任意文件并上传到当前绑定的服务空间
* @tutorial https://ext.dcloud.net.cn/plugin?id=4079
* @property {Object|Array} value 组件数据通常用来回显 ,类型由return-type属性决定
* @property {Boolean} disabled = [true|false] 组件禁用
* @value true 禁用
* @value false 取消禁用
* @property {Boolean} readonly = [true|false] 组件只读不可选择不显示进度不显示删除按钮
* @value true 只读
* @value false 取消只读
* @property {String} return-type = [array|object] 限制 value 格式当为 object 组件只能单选且会覆盖
* @value array 规定 value 属性的类型为数组
* @value object 规定 value 属性的类型为对象
* @property {Boolean} disable-preview = [true|false] 禁用图片预览 mode:grid 时生效
* @value true 禁用图片预览
* @value false 取消禁用图片预览
* @property {Boolean} del-icon = [true|false] 是否显示删除按钮
* @value true 显示删除按钮
* @value false 不显示删除按钮
* @property {Boolean} auto-upload = [true|false] 是否自动上传值为true则只触发@select,可自行上传
* @value true 自动上传
* @value false 取消自动上传
* @property {Number|String} limit 最大选择个数 h5 会自动忽略多选的部分
* @property {String} title 组件标题右侧显示上传计数
* @property {String} mode = [list|grid] 选择文件后的文件列表样式
* @value list 列表显示
* @value grid 宫格显示
* @property {String} file-mediatype = [image|video|all] 选择文件类型
* @value image 只选择图片
* @value video 只选择视频
* @value all 选择所有文件
* @property {Array} file-extname 选择文件后缀根据 file-mediatype 属性而不同
* @property {Object} list-style mode:list 时的样式
* @property {Object} image-styles 选择文件后缀根据 file-mediatype 属性而不同
* @event {Function} select 选择文件后触发
* @event {Function} progress 文件上传时触发
* @event {Function} success 上传成功触发
* @event {Function} fail 上传失败触发
* @event {Function} delete 文件从列表移除时触发
*/
export default {
name: 'uniFilePicker',
components: {
uploadImage,
uploadFile
},
options: {
virtualHost: true
},
emits: ['select', 'success', 'fail', 'progress', 'delete', 'update:modelValue', 'input'],
props: {
// #ifdef VUE3
modelValue: {
type: [Array, Object],
default () {
return []
}
},
// #endif
// #ifndef VUE3
value: {
type: [Array, Object],
default () {
return []
}
},
// #endif
disabled: {
type: Boolean,
default: false
},
disablePreview: {
type: Boolean,
default: false
},
delIcon: {
type: Boolean,
default: true
},
//
autoUpload: {
type: Boolean,
default: true
},
// h5
limit: {
type: [Number, String],
default: 9
},
// grid | list | list-card
mode: {
type: String,
default: 'grid'
},
// image/video/all
fileMediatype: {
type: String,
default: 'image'
},
//
fileExtname: {
type: [Array, String],
default () {
return []
}
},
title: {
type: String,
default: ''
},
listStyles: {
type: Object,
default () {
return {
//
border: true,
// 线
dividline: true,
// 线
borderStyle: {}
}
}
},
imageStyles: {
type: Object,
default () {
return {
width: 'auto',
height: 'auto'
}
}
},
readonly: {
type: Boolean,
default: false
},
returnType: {
type: String,
default: 'array'
},
sizeType: {
type: Array,
default () {
return ['original', 'compressed']
}
},
sourceType: {
type: Array,
default () {
return ['album', 'camera']
}
}
},
data() {
return {
files: [],
localValue: []
}
},
watch: {
// #ifndef VUE3
value: {
handler(newVal, oldVal) {
this.setValue(newVal, oldVal)
},
immediate: true
},
// #endif
// #ifdef VUE3
modelValue: {
handler(newVal, oldVal) {
this.setValue(newVal, oldVal)
},
immediate: true
},
// #endif
},
computed: {
filesList() {
let files = []
this.files.forEach(v => {
files.push(v)
})
return files
},
showType() {
if (this.fileMediatype === 'image') {
return this.mode
}
return 'list'
},
limitLength() {
if (this.returnType === 'object') {
return 1
}
if (!this.limit) {
return 1
}
if (this.limit >= 9) {
return 9
}
return this.limit
}
},
created() {
// TODO
if (!(uniCloud.config && uniCloud.config.provider)) {
this.noSpace = true
uniCloud.chooseAndUploadFile = chooseAndUploadFile
}
this.form = this.getForm('uniForms')
this.formItem = this.getForm('uniFormsItem')
if (this.form && this.formItem) {
if (this.formItem.name) {
this.rename = this.formItem.name
this.form.inputChildrens.push(this)
}
}
},
methods: {
/**
* 公开用户使用清空文件
* @param {Object} index
*/
clearFiles(index) {
if (index !== 0 && !index) {
this.files = []
this.$nextTick(() => {
this.setEmit()
})
} else {
this.files.splice(index, 1)
}
this.$nextTick(() => {
this.setEmit()
})
},
/**
* 公开用户使用继续上传
*/
upload() {
let files = []
this.files.forEach((v, index) => {
if (v.status === 'ready' || v.status === 'error') {
files.push(Object.assign({}, v))
}
})
return this.uploadFiles(files)
},
async setValue(newVal, oldVal) {
const newData = async (v) => {
const reg = /cloud:\/\/([\w.]+\/?)\S*/
let url = ''
if(v.fileID){
url = v.fileID
}else{
url = v.url
}
if (reg.test(url)) {
v.fileID = url
v.url = await this.getTempFileURL(url)
}
if(v.url) v.path = v.url
return v
}
if (this.returnType === 'object') {
if (newVal) {
await newData(newVal)
} else {
newVal = {}
}
} else {
if (!newVal) newVal = []
for(let i =0 ;i < newVal.length ;i++){
let v = newVal[i]
await newData(v)
}
}
this.localValue = newVal
if (this.form && this.formItem &&!this.is_reset) {
this.is_reset = false
this.formItem.setValue(this.localValue)
}
let filesData = Object.keys(newVal).length > 0 ? newVal : [];
this.files = [].concat(filesData)
},
/**
* 选择文件
*/
choose() {
if (this.disabled) return
if (this.files.length >= Number(this.limitLength) && this.showType !== 'grid' && this.returnType ===
'array') {
uni.showToast({
title: `您最多选择 ${this.limitLength} 个文件`,
icon: 'none'
})
return
}
this.chooseFiles()
},
/**
* 选择文件并上传
*/
chooseFiles() {
const _extname = get_extname(this.fileExtname)
//
uniCloud
.chooseAndUploadFile({
type: this.fileMediatype,
compressed: false,
sizeType: this.sizeType,
sourceType: this.sourceType,
// TODO video
extension: _extname.length > 0 ? _extname : undefined,
count: this.limitLength - this.files.length, //9
onChooseFile: this.chooseFileCallback,
onUploadProgress: progressEvent => {
this.setProgress(progressEvent, progressEvent.index)
}
})
.then(result => {
this.setSuccessAndError(result.tempFiles)
})
.catch(err => {
console.log('选择失败', err)
})
},
/**
* 选择文件回调
* @param {Object} res
*/
async chooseFileCallback(res) {
const _extname = get_extname(this.fileExtname)
const is_one = (Number(this.limitLength) === 1 &&
this.disablePreview &&
!this.disabled) ||
this.returnType === 'object'
//
if (is_one) {
this.files = []
}
let {
filePaths,
files
} = get_files_and_is_max(res, _extname)
if (!(_extname && _extname.length > 0)) {
filePaths = res.tempFilePaths
files = res.tempFiles
}
let currentData = []
for (let i = 0; i < files.length; i++) {
if (this.limitLength - this.files.length <= 0) break
files[i].uuid = Date.now()
let filedata = await get_file_data(files[i], this.fileMediatype)
filedata.progress = 0
filedata.status = 'ready'
this.files.push(filedata)
currentData.push({
...filedata,
file: files[i]
})
}
this.$emit('select', {
tempFiles: currentData,
tempFilePaths: filePaths
})
res.tempFiles = files
//
if (!this.autoUpload || this.noSpace) {
res.tempFiles = []
}
},
/**
* 批传
* @param {Object} e
*/
uploadFiles(files) {
files = [].concat(files)
return uploadCloudFiles.call(this, files, 5, res => {
this.setProgress(res, res.index, true)
})
.then(result => {
this.setSuccessAndError(result)
return result;
})
.catch(err => {
console.log(err)
})
},
/**
* 成功或失败
*/
async setSuccessAndError(res, fn) {
let successData = []
let errorData = []
let tempFilePath = []
let errorTempFilePath = []
for (let i = 0; i < res.length; i++) {
const item = res[i]
const index = item.uuid ? this.files.findIndex(p => p.uuid === item.uuid) : item.index
if (index === -1 || !this.files) break
if (item.errMsg === 'request:fail') {
this.files[index].url = item.path
this.files[index].status = 'error'
this.files[index].errMsg = item.errMsg
// this.files[index].progress = -1
errorData.push(this.files[index])
errorTempFilePath.push(this.files[index].url)
} else {
this.files[index].errMsg = ''
this.files[index].fileID = item.url
const reg = /cloud:\/\/([\w.]+\/?)\S*/
if (reg.test(item.url)) {
this.files[index].url = await this.getTempFileURL(item.url)
}else{
this.files[index].url = item.url
}
this.files[index].status = 'success'
this.files[index].progress += 1
successData.push(this.files[index])
tempFilePath.push(this.files[index].fileID)
}
}
if (successData.length > 0) {
this.setEmit()
//
this.$emit('success', {
tempFiles: this.backObject(successData),
tempFilePaths: tempFilePath
})
}
if (errorData.length > 0) {
this.$emit('fail', {
tempFiles: this.backObject(errorData),
tempFilePaths: errorTempFilePath
})
}
},
/**
* 获取进度
* @param {Object} progressEvent
* @param {Object} index
* @param {Object} type
*/
setProgress(progressEvent, index, type) {
const fileLenth = this.files.length
const percentNum = (index / fileLenth) * 100
const percentCompleted = Math.round((progressEvent.loaded * 100) / progressEvent.total)
let idx = index
if (!type) {
idx = this.files.findIndex(p => p.uuid === progressEvent.tempFile.uuid)
}
if (idx === -1 || !this.files[idx]) return
// fix by mehaotian 100 -1
this.files[idx].progress = percentCompleted - 1
//
this.$emit('progress', {
index: idx,
progress: parseInt(percentCompleted),
tempFile: this.files[idx]
})
},
/**
* 删除文件
* @param {Object} index
*/
delFile(index) {
this.$emit('delete', {
tempFile: this.files[index],
tempFilePath: this.files[index].url
})
this.files.splice(index, 1)
this.$nextTick(() => {
this.setEmit()
})
},
/**
* 获取文件名和后缀
* @param {Object} name
*/
getFileExt(name) {
const last_len = name.lastIndexOf('.')
const len = name.length
return {
name: name.substring(0, last_len),
ext: name.substring(last_len + 1, len)
}
},
/**
* 处理返回事件
*/
setEmit() {
let data = []
if (this.returnType === 'object') {
data = this.backObject(this.files)[0]
this.localValue = data?data:null
} else {
data = this.backObject(this.files)
if (!this.localValue) {
this.localValue = []
}
this.localValue = [...data]
}
// #ifdef VUE3
this.$emit('update:modelValue', this.localValue)
// #endif
// #ifndef VUE3
this.$emit('input', this.localValue)
// #endif
},
/**
* 处理返回参数
* @param {Object} files
*/
backObject(files) {
let newFilesData = []
files.forEach(v => {
newFilesData.push({
extname: v.extname,
fileType: v.fileType,
image: v.image,
name: v.name,
path: v.path,
size: v.size,
fileID:v.fileID,
url: v.url,
// bug, #694
uuid: v.uuid,
status: v.status,
cloudPath: v.cloudPath
})
})
return newFilesData
},
async getTempFileURL(fileList) {
fileList = {
fileList: [].concat(fileList)
}
const urls = await uniCloud.getTempFileURL(fileList)
return urls.fileList[0].tempFileURL || ''
},
/**
* 获取父元素实例
*/
getForm(name = 'uniForms') {
let parent = this.$parent;
let parentName = parent.$options.name;
while (parentName !== name) {
parent = parent.$parent;
if (!parent) return false;
parentName = parent.$options.name;
}
return parent;
}
}
}
</script>
<style>
.uni-file-picker {
/* #ifndef APP-NVUE */
box-sizing: border-box;
overflow: hidden;
width: 100%;
/* #endif */
flex: 1;
}
.uni-file-picker__header {
padding-top: 5px;
padding-bottom: 10px;
/* #ifndef APP-NVUE */
display: flex;
/* #endif */
justify-content: space-between;
}
.file-title {
font-size: 14px;
color: #333;
}
.file-count {
font-size: 14px;
color: #999;
}
.is-add {
/* #ifndef APP-NVUE */
display: flex;
/* #endif */
align-items: center;
justify-content: center;
}
.icon-add {
width: 50px;
height: 5px;
background-color: #f1f1f1;
border-radius: 2px;
}
.rotate {
position: absolute;
transform: rotate(90deg);
}
</style>

View File

@ -1,325 +0,0 @@
<template>
<view class="uni-file-picker__files">
<view v-if="!readonly" class="files-button" @click="choose">
<slot></slot>
</view>
<!-- :class="{'is-text-box':showType === 'list'}" -->
<view v-if="list.length > 0" class="uni-file-picker__lists is-text-box" :style="borderStyle">
<!-- ,'is-list-card':showType === 'list-card' -->
<view class="uni-file-picker__lists-box" v-for="(item ,index) in list" :key="index" :class="{
'files-border':index !== 0 && styles.dividline}"
:style="index !== 0 && styles.dividline &&borderLineStyle">
<view class="uni-file-picker__item">
<!-- :class="{'is-text-image':showType === 'list'}" -->
<!-- <view class="files__image is-text-image">
<image class="header-image" :src="item.logo" mode="aspectFit"></image>
</view> -->
<view class="files__name">{{item.name}}</view>
<view v-if="delIcon&&!readonly" class="icon-del-box icon-files" @click="delFile(index)">
<view class="icon-del icon-files"></view>
<view class="icon-del rotate"></view>
</view>
</view>
<view v-if="(item.progress && item.progress !== 100) ||item.progress===0 " class="file-picker__progress">
<progress class="file-picker__progress-item" :percent="item.progress === -1?0:item.progress" stroke-width="4"
:backgroundColor="item.errMsg?'#ff5a5f':'#EBEBEB'" />
</view>
<view v-if="item.status === 'error'" class="file-picker__mask" @click.stop="uploadFiles(item,index)">
点击重试
</view>
</view>
</view>
</view>
</template>
<script>
export default {
name: "uploadFile",
emits:['uploadFiles','choose','delFile'],
props: {
filesList: {
type: Array,
default () {
return []
}
},
delIcon: {
type: Boolean,
default: true
},
limit: {
type: [Number, String],
default: 9
},
showType: {
type: String,
default: ''
},
listStyles: {
type: Object,
default () {
return {
//
border: true,
// 线
dividline: true,
// 线
borderStyle: {}
}
}
},
readonly:{
type:Boolean,
default:false
}
},
computed: {
list() {
let files = []
this.filesList.forEach(v => {
files.push(v)
})
return files
},
styles() {
let styles = {
border: true,
dividline: true,
'border-style': {}
}
return Object.assign(styles, this.listStyles)
},
borderStyle() {
let {
borderStyle,
border
} = this.styles
let obj = {}
if (!border) {
obj.border = 'none'
} else {
let width = (borderStyle && borderStyle.width) || 1
width = this.value2px(width)
let radius = (borderStyle && borderStyle.radius) || 5
radius = this.value2px(radius)
obj = {
'border-width': width,
'border-style': (borderStyle && borderStyle.style) || 'solid',
'border-color': (borderStyle && borderStyle.color) || '#eee',
'border-radius': radius
}
}
let classles = ''
for (let i in obj) {
classles += `${i}:${obj[i]};`
}
return classles
},
borderLineStyle() {
let obj = {}
let {
borderStyle
} = this.styles
if (borderStyle && borderStyle.color) {
obj['border-color'] = borderStyle.color
}
if (borderStyle && borderStyle.width) {
let width = borderStyle && borderStyle.width || 1
let style = borderStyle && borderStyle.style || 0
if (typeof width === 'number') {
width += 'px'
} else {
width = width.indexOf('px') ? width : width + 'px'
}
obj['border-width'] = width
if (typeof style === 'number') {
style += 'px'
} else {
style = style.indexOf('px') ? style : style + 'px'
}
obj['border-top-style'] = style
}
let classles = ''
for (let i in obj) {
classles += `${i}:${obj[i]};`
}
return classles
}
},
methods: {
uploadFiles(item, index) {
this.$emit("uploadFiles", {
item,
index
})
},
choose() {
this.$emit("choose")
},
delFile(index) {
this.$emit('delFile', index)
},
value2px(value) {
if (typeof value === 'number') {
value += 'px'
} else {
value = value.indexOf('px') !== -1 ? value : value + 'px'
}
return value
}
}
}
</script>
<style lang="scss">
.uni-file-picker__files {
/* #ifndef APP-NVUE */
display: flex;
/* #endif */
flex-direction: column;
justify-content: flex-start;
}
.files-button {
// border: 1px red solid;
}
.uni-file-picker__lists {
position: relative;
margin-top: 5px;
overflow: hidden;
}
.file-picker__mask {
/* #ifndef APP-NVUE */
display: flex;
/* #endif */
justify-content: center;
align-items: center;
position: absolute;
right: 0;
top: 0;
bottom: 0;
left: 0;
color: #fff;
font-size: 14px;
background-color: rgba(0, 0, 0, 0.4);
}
.uni-file-picker__lists-box {
position: relative;
}
.uni-file-picker__item {
/* #ifndef APP-NVUE */
display: flex;
/* #endif */
align-items: center;
padding: 8px 10px;
padding-right: 5px;
padding-left: 10px;
}
.files-border {
border-top: 1px #eee solid;
}
.files__name {
flex: 1;
font-size: 14px;
color: #666;
margin-right: 25px;
/* #ifndef APP-NVUE */
word-break: break-all;
word-wrap: break-word;
/* #endif */
}
.icon-files {
/* #ifndef APP-NVUE */
position: static;
background-color: initial;
/* #endif */
}
// .icon-files .icon-del {
// background-color: #333;
// width: 12px;
// height: 1px;
// }
.is-list-card {
border: 1px #eee solid;
margin-bottom: 5px;
border-radius: 5px;
box-shadow: 0 0 2px 0px rgba(0, 0, 0, 0.1);
padding: 5px;
}
.files__image {
width: 40px;
height: 40px;
margin-right: 10px;
}
.header-image {
width: 100%;
height: 100%;
}
.is-text-box {
border: 1px #eee solid;
border-radius: 5px;
}
.is-text-image {
width: 25px;
height: 25px;
margin-left: 5px;
}
.rotate {
position: absolute;
transform: rotate(90deg);
}
.icon-del-box {
/* #ifndef APP-NVUE */
display: flex;
margin: auto 0;
/* #endif */
align-items: center;
justify-content: center;
position: absolute;
top: 0px;
bottom: 0;
right: 5px;
height: 26px;
width: 26px;
// border-radius: 50%;
// background-color: rgba(0, 0, 0, 0.5);
z-index: 2;
transform: rotate(-45deg);
}
.icon-del {
width: 15px;
height: 1px;
background-color: #333;
// border-radius: 1px;
}
/* #ifdef H5 */
@media all and (min-width: 768px) {
.uni-file-picker__files {
max-width: 375px;
}
}
/* #endif */
</style>

View File

@ -1,292 +0,0 @@
<template>
<view class="uni-file-picker__container">
<view class="file-picker__box" v-for="(item,index) in filesList" :key="index" :style="boxStyle">
<view class="file-picker__box-content" :style="borderStyle">
<image class="file-image" :src="item.url" mode="aspectFill" @click.stop="prviewImage(item,index)"></image>
<view v-if="delIcon && !readonly" class="icon-del-box" @click.stop="delFile(index)">
<view class="icon-del"></view>
<view class="icon-del rotate"></view>
</view>
<view v-if="(item.progress && item.progress !== 100) ||item.progress===0 " class="file-picker__progress">
<progress class="file-picker__progress-item" :percent="item.progress === -1?0:item.progress" stroke-width="4"
:backgroundColor="item.errMsg?'#ff5a5f':'#EBEBEB'" />
</view>
<view v-if="item.errMsg" class="file-picker__mask" @click.stop="uploadFiles(item,index)">
点击重试
</view>
</view>
</view>
<view v-if="filesList.length < limit && !readonly" class="file-picker__box" :style="boxStyle">
<view class="file-picker__box-content is-add" :style="borderStyle" @click="choose">
<slot>
<view class="icon-add"></view>
<view class="icon-add rotate"></view>
</slot>
</view>
</view>
</view>
</template>
<script>
export default {
name: "uploadImage",
emits:['uploadFiles','choose','delFile'],
props: {
filesList: {
type: Array,
default () {
return []
}
},
disabled:{
type: Boolean,
default: false
},
disablePreview: {
type: Boolean,
default: false
},
limit: {
type: [Number, String],
default: 9
},
imageStyles: {
type: Object,
default () {
return {
width: 'auto',
height: 'auto',
border: {}
}
}
},
delIcon: {
type: Boolean,
default: true
},
readonly:{
type:Boolean,
default:false
}
},
computed: {
styles() {
let styles = {
width: 'auto',
height: 'auto',
border: {}
}
return Object.assign(styles, this.imageStyles)
},
boxStyle() {
const {
width = 'auto',
height = 'auto'
} = this.styles
let obj = {}
if (height === 'auto') {
if (width !== 'auto') {
obj.height = this.value2px(width)
obj['padding-top'] = 0
} else {
obj.height = 0
}
} else {
obj.height = this.value2px(height)
obj['padding-top'] = 0
}
if (width === 'auto') {
if (height !== 'auto') {
obj.width = this.value2px(height)
} else {
obj.width = '33.3%'
}
} else {
obj.width = this.value2px(width)
}
let classles = ''
for(let i in obj){
classles+= `${i}:${obj[i]};`
}
return classles
},
borderStyle() {
let {
border
} = this.styles
let obj = {}
const widthDefaultValue = 1
const radiusDefaultValue = 3
if (typeof border === 'boolean') {
obj.border = border ? '1px #eee solid' : 'none'
} else {
let width = (border && border.width) || widthDefaultValue
width = this.value2px(width)
let radius = (border && border.radius) || radiusDefaultValue
radius = this.value2px(radius)
obj = {
'border-width': width,
'border-style': (border && border.style) || 'solid',
'border-color': (border && border.color) || '#eee',
'border-radius': radius
}
}
let classles = ''
for(let i in obj){
classles+= `${i}:${obj[i]};`
}
return classles
}
},
methods: {
uploadFiles(item, index) {
this.$emit("uploadFiles", item)
},
choose() {
this.$emit("choose")
},
delFile(index) {
this.$emit('delFile', index)
},
prviewImage(img, index) {
let urls = []
if(Number(this.limit) === 1&&this.disablePreview&&!this.disabled){
this.$emit("choose")
}
if(this.disablePreview) return
this.filesList.forEach(i => {
urls.push(i.url)
})
uni.previewImage({
urls: urls,
current: index
});
},
value2px(value) {
if (typeof value === 'number') {
value += 'px'
} else {
if (value.indexOf('%') === -1) {
value = value.indexOf('px') !== -1 ? value : value + 'px'
}
}
return value
}
}
}
</script>
<style lang="scss">
.uni-file-picker__container {
/* #ifndef APP-NVUE */
display: flex;
box-sizing: border-box;
/* #endif */
flex-wrap: wrap;
margin: -5px;
}
.file-picker__box {
position: relative;
// flex: 0 0 33.3%;
width: 33.3%;
height: 0;
padding-top: 33.33%;
/* #ifndef APP-NVUE */
box-sizing: border-box;
/* #endif */
}
.file-picker__box-content {
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 0;
margin: 5px;
border: 1px #eee solid;
border-radius: 5px;
overflow: hidden;
}
.file-picker__progress {
position: absolute;
bottom: 0;
left: 0;
right: 0;
/* border: 1px red solid; */
z-index: 2;
}
.file-picker__progress-item {
width: 100%;
}
.file-picker__mask {
/* #ifndef APP-NVUE */
display: flex;
/* #endif */
justify-content: center;
align-items: center;
position: absolute;
right: 0;
top: 0;
bottom: 0;
left: 0;
color: #fff;
font-size: 12px;
background-color: rgba(0, 0, 0, 0.4);
}
.file-image {
width: 100%;
height: 100%;
}
.is-add {
/* #ifndef APP-NVUE */
display: flex;
/* #endif */
align-items: center;
justify-content: center;
}
.icon-add {
width: 50px;
height: 5px;
background-color: #f1f1f1;
border-radius: 2px;
}
.rotate {
position: absolute;
transform: rotate(90deg);
}
.icon-del-box {
/* #ifndef APP-NVUE */
display: flex;
/* #endif */
align-items: center;
justify-content: center;
position: absolute;
top: 3px;
right: 3px;
height: 26px;
width: 26px;
border-radius: 50%;
background-color: rgba(0, 0, 0, 0.5);
z-index: 2;
transform: rotate(-45deg);
}
.icon-del {
width: 15px;
height: 2px;
background-color: #fff;
border-radius: 2px;
}
</style>

View File

@ -1,109 +0,0 @@
/**
* 获取文件名和后缀
* @param {String} name
*/
export const get_file_ext = (name) => {
const last_len = name.lastIndexOf('.')
const len = name.length
return {
name: name.substring(0, last_len),
ext: name.substring(last_len + 1, len)
}
}
/**
* 获取扩展名
* @param {Array} fileExtname
*/
export const get_extname = (fileExtname) => {
if (!Array.isArray(fileExtname)) {
let extname = fileExtname.replace(/(\[|\])/g, '')
return extname.split(',')
} else {
return fileExtname
}
return []
}
/**
* 获取文件和检测是否可选
*/
export const get_files_and_is_max = (res, _extname) => {
let filePaths = []
let files = []
if(!_extname || _extname.length === 0){
return {
filePaths,
files
}
}
res.tempFiles.forEach(v => {
let fileFullName = get_file_ext(v.name)
const extname = fileFullName.ext.toLowerCase()
if (_extname.indexOf(extname) !== -1) {
files.push(v)
filePaths.push(v.path)
}
})
if (files.length !== res.tempFiles.length) {
uni.showToast({
title: `当前选择了${res.tempFiles.length}个文件 ${res.tempFiles.length - files.length} 个文件格式不正确`,
icon: 'none',
duration: 5000
})
}
return {
filePaths,
files
}
}
/**
* 获取图片信息
* @param {Object} filepath
*/
export const get_file_info = (filepath) => {
return new Promise((resolve, reject) => {
uni.getImageInfo({
src: filepath,
success(res) {
resolve(res)
},
fail(err) {
reject(err)
}
})
})
}
/**
* 获取封装数据
*/
export const get_file_data = async (files, type = 'image') => {
// 最终需要上传数据库的数据
let fileFullName = get_file_ext(files.name)
const extname = fileFullName.ext.toLowerCase()
let filedata = {
name: files.name,
uuid: files.uuid,
extname: extname || '',
cloudPath: files.cloudPath,
fileType: files.fileType,
url: files.path || files.path,
size: files.size, //单位是字节
image: {},
path: files.path,
video: {}
}
if (type === 'image') {
const imageinfo = await get_file_info(files.path)
delete filedata.video
filedata.image.width = imageinfo.width
filedata.image.height = imageinfo.height
filedata.image.location = imageinfo.path
} else {
delete filedata.image
}
return filedata
}

View File

@ -1,83 +0,0 @@
{
"id": "uni-file-picker",
"displayName": "uni-file-picker 文件选择上传",
"version": "1.0.4",
"description": "文件选择上传组件,可以选择图片、视频等任意文件并上传到当前绑定的服务空间",
"keywords": [
"uni-ui",
"uniui",
"图片上传",
"文件上传"
],
"repository": "https://github.com/dcloudio/uni-ui",
"engines": {
"HBuilderX": ""
},
"directories": {
"example": "../../temps/example_temps"
},
"dcloudext": {
"sale": {
"regular": {
"price": "0.00"
},
"sourcecode": {
"price": "0.00"
}
},
"contact": {
"qq": ""
},
"declaration": {
"ads": "无",
"data": "无",
"permissions": "无"
},
"npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui",
"type": "component-vue"
},
"uni_modules": {
"dependencies": ["uni-scss"],
"encrypt": [],
"platforms": {
"cloud": {
"tcb": "y",
"aliyun": "y"
},
"client": {
"App": {
"app-vue": "y",
"app-nvue": "n"
},
"H5-mobile": {
"Safari": "y",
"Android Browser": "y",
"微信浏览器(Android)": "y",
"QQ浏览器(Android)": "y"
},
"H5-pc": {
"Chrome": "y",
"IE": "y",
"Edge": "y",
"Firefox": "y",
"Safari": "y"
},
"小程序": {
"微信": "y",
"阿里": "y",
"百度": "y",
"字节跳动": "y",
"QQ": "y"
},
"快应用": {
"华为": "u",
"联盟": "u"
},
"Vue": {
"vue2": "y",
"vue3": "y"
}
}
}
}
}

View File

@ -1,11 +0,0 @@
## FilePicker 文件选择上传
> **组件名uni-file-picker**
> 代码块: `uFilePicker`
文件选择上传组件,可以选择图片、视频等任意文件并上传到当前绑定的服务空间
### [查看文档](https://uniapp.dcloud.io/component/uniui/uni-file-picker)
#### 如使用过程中有任何问题或者您对uni-ui有一些好的建议欢迎加入 uni-ui 交流群871950839

View File

@ -1,127 +0,0 @@
import {
HTTP_REQUEST_URL_THREE,
HEADER,
TOKENNAME,
} from '@/config/app';
import {
Toast
} from '../libs/uniApi';
// import { checkLogin } from '../libs/login';
import store from '../store';
function toLogin() {
uni.showToast({
title: '请先登录',
icon: 'none',
duration: 1000
});
}
function baseRequestTwo(url, method, data, {
noAuth = false,
noVerify = false,
onReLogin = false
}) {
let Url = HTTP_REQUEST_URL_THREE,
header = HEADER;
if (!noAuth) {
// 已经未登录了,禁止请求
if (!store.state.config.request) return Promise.reject({
msg: '未登录'
});
//登录过期自动登录
if (!store.state.app.token) {
toLogin();
store.commit("SET_REQUEST", false);
return Promise.reject({
msg: '未登录'
});
}
}
// if (store.state.app.token) header[TOKENNAME] = 'Bearer ' + store.state.app.token;
if (store.state.app.token) header[TOKENNAME] = store.state.app.token;
// header[TOKENNAME] = 'Bearer sdjflidshjgfkbdasgjmasbgvhauuiavhkesvndkaesbvkjsdbv';
return new Promise((reslove, reject) => {
// uni.showLoading({
// title: '加载中'
// })
uni.request({
// url: Url + '/api/v1' + url,
url: Url + url,
method: method || 'GET',
header: {
...header
},
data: method != 'GET' ? data || {} : {},
params: method == 'GET' ? data : {},
success: (res) => {
if (noVerify)
reslove(res.data);
else if (res.data.code == -1) {
if(onReLogin) {
store.commit('LOGOUT');
return reject();
}
// 如果登录超时,自动重新登录并且继续发送请求
store.dispatch("RE_LOGIN", {
url: url,
method: method,
data: data,
opt: {
noAuth,
noVerify
}
}).then((e)=>{
reslove(e);
}).catch((err)=>{
reject(res.data);
})
// store.commit("SET_REQUEST", false);
} else if (res.data.code == 0) {
if (res.data.msg != '无登录信息') {
uni.showToast({
title: res.data.msg || '请检查网络',
icon: 'none',
})
}
reject(res.data);
} else if (res.data.code == 1) {
store.commit("SET_REQUEST");
reslove(res.data);
} else if (res.data.code == 200) {
store.commit("SET_REQUEST");
reslove(res.data.data);
} else if ([410000, 410001, 410002, 40000].indexOf(res.data.code) !== -1) {
toLogin();
reject(res.data);
} else if (res.data.code == 501) {
reject(res.data);
} else {
uni.showToast({
title: res.data.msg || '请检查网络',
icon: 'none'
})
reject(res.data.msg || '请检查网络');
}
},
fail: (message) => {
// uni.hideLoading()
uni.showToast({
title: '网络错误',
icon: 'none'
})
reject('请求失败');
}
})
});
}
const oahttp = {};
['options', 'get', 'post', 'put', 'head', 'delete', 'trace', 'connect'].forEach((method) => {
oahttp[method] = (api, data, opt) => baseRequestTwo(api, method, data, opt || {})
});
export default oahttp;

View File

@ -1,127 +1,127 @@
import { import {
HTTP_REQUEST_URL_THREE, HTTP_REQUEST_URL_THREE,
HEADER, HEADER,
TOKENNAME, TOKENNAME,
} from '@/config/app'; } from '@/config/app';
import { import {
Toast Toast
} from '../libs/uniApi'; } from '../libs/uniApi';
// import { checkLogin } from '../libs/login'; // import { checkLogin } from '../libs/login';
import store from '../store'; import store from '../store';
function toLogin() { function toLogin() {
uni.showToast({ uni.showToast({
title: '请先登录', title: '请先登录',
icon: 'none', icon: 'none',
duration: 1000 duration: 1000
}); });
} }
function baseRequestTwo(url, method, data, { function baseRequestTwo(url, method, data, {
noAuth = false, noAuth = false,
noVerify = false, noVerify = false,
onReLogin = false onReLogin = false
}) { }) {
let Url = HTTP_REQUEST_URL_THREE, let Url = HTTP_REQUEST_URL_THREE,
header = HEADER; header = HEADER;
if (!noAuth) { if (!noAuth) {
// 已经未登录了,禁止请求 // 已经未登录了,禁止请求
if (!store.state.config.request) return Promise.reject({ if (!store.state.config.request) return Promise.reject({
msg: '未登录' msg: '未登录'
}); });
//登录过期自动登录 //登录过期自动登录
if (!store.state.app.token) { if (!store.state.app.token) {
toLogin(); toLogin();
store.commit("SET_REQUEST", false); store.commit("SET_REQUEST", false);
return Promise.reject({ return Promise.reject({
msg: '未登录' msg: '未登录'
}); });
} }
} }
// if (store.state.app.token) header[TOKENNAME] = 'Bearer ' + store.state.app.token; // if (store.state.app.token) header[TOKENNAME] = 'Bearer ' + store.state.app.token;
if (store.state.app.token) header[TOKENNAME] = store.state.app.token; if (store.state.app.token) header[TOKENNAME] = store.state.app.token;
// header[TOKENNAME] = 'Bearer sdjflidshjgfkbdasgjmasbgvhauuiavhkesvndkaesbvkjsdbv'; // header[TOKENNAME] = 'Bearer sdjflidshjgfkbdasgjmasbgvhauuiavhkesvndkaesbvkjsdbv';
return new Promise((reslove, reject) => { return new Promise((reslove, reject) => {
// uni.showLoading({ // uni.showLoading({
// title: '加载中' // title: '加载中'
// }) // })
uni.request({ uni.request({
// url: Url + '/api/v1' + url, // url: Url + '/api/v1' + url,
url: Url + '/api' + url, url: Url + '/api' + url,
method: method || 'GET', method: method || 'GET',
header: { header: {
...header ...header
}, },
data: method != 'GET' ? data || {} : {}, data: method != 'GET' ? data || {} : {},
params: method == 'GET' ? data : {}, params: method == 'GET' ? data : {},
success: (res) => { success: (res) => {
if (noVerify) if (noVerify)
reslove(res.data); reslove(res.data);
else if (res.data.code == -1) { else if (res.data.code == -1) {
if (onReLogin) { if(onReLogin) {
store.commit('LOGOUT'); store.commit('LOGOUT');
return reject(); return reject();
} }
// 如果登录超时,自动重新登录并且继续发送请求 // 如果登录超时,自动重新登录并且继续发送请求
store.dispatch("RE_LOGIN", { store.dispatch("RE_LOGIN", {
url: url, url: url,
method: method, method: method,
data: data, data: data,
opt: { opt: {
noAuth, noAuth,
noVerify noVerify
} }
}).then((e) => { }).then((e)=>{
reslove(e); reslove(e);
}).catch((err) => { }).catch((err)=>{
reject(res.data); reject(res.data);
}) })
// store.commit("SET_REQUEST", false); // store.commit("SET_REQUEST", false);
} else if (res.data.code == 0) { } else if (res.data.code == 0) {
if (res.data.msg != '无登录信息') { if (res.data.msg != '无登录信息') {
uni.showToast({ uni.showToast({
title: res.data.msg || '请检查网络', title: res.data.msg || '请检查网络',
icon: 'none', icon: 'none',
}) })
} }
reject(res.data); reject(res.data);
} else if (res.data.code == 1) { } else if (res.data.code == 1) {
store.commit("SET_REQUEST"); store.commit("SET_REQUEST");
reslove(res.data); reslove(res.data);
} else if (res.data.code == 200) { } else if (res.data.code == 200) {
store.commit("SET_REQUEST"); store.commit("SET_REQUEST");
reslove(res.data.data); reslove(res.data.data);
} else if ([410000, 410001, 410002, 40000].indexOf(res.data.code) !== -1) { } else if ([410000, 410001, 410002, 40000].indexOf(res.data.code) !== -1) {
toLogin(); toLogin();
reject(res.data); reject(res.data);
} else if (res.data.code == 501) { } else if (res.data.code == 501) {
reject(res.data); reject(res.data);
} else { } else {
uni.showToast({ uni.showToast({
title: res.data.msg || '请检查网络', title: res.data.msg || '请检查网络',
icon: 'none' icon: 'none'
}) })
reject(res.data.msg || '请检查网络'); reject(res.data.msg || '请检查网络');
} }
}, },
fail: (message) => { fail: (message) => {
// uni.hideLoading() // uni.hideLoading()
uni.showToast({ uni.showToast({
title: '网络错误', title: '网络错误',
icon: 'none' icon: 'none'
}) })
reject('请求失败'); reject('请求失败');
} }
}) })
}); });
} }
const oahttp = {}; const oahttp = {};
['options', 'get', 'post', 'put', 'head', 'delete', 'trace', 'connect'].forEach((method) => { ['options', 'get', 'post', 'put', 'head', 'delete', 'trace', 'connect'].forEach((method) => {
oahttp[method] = (api, data, opt) => baseRequestTwo(api, method, data, opt || {}) oahttp[method] = (api, data, opt) => baseRequestTwo(api, method, data, opt || {})
}); });
export default oahttp; export default oahttp;