Compare commits

..

60 Commits
master ... main

Author SHA1 Message Date
lxz
0dbbba73ed 更新 2024-01-11 18:17:41 +08:00
lxz
f4c23417b2 个体户与对公账户 2024-01-05 19:01:56 +08:00
lxz
1e613b409c 开通交易审批详情修改 2023-12-27 10:01:48 +08:00
zmj
26958ab87a s 2023-12-20 12:22:33 +08:00
zmj
eff4c97884 修改 2023-12-18 09:42:04 +08:00
zmj
6dc0e69392 首次登录没有头像 2023-12-12 11:08:18 +08:00
zmj
96d2552de2 Merge branch 'main' of https://gitea.lihaink.cn/mkm/OfficeApp into dev 2023-12-04 09:17:36 +08:00
zmj
d18961e965 页面修改 2023-11-29 18:45:48 +08:00
zmj
58986ff80f 订单 2023-11-29 15:14:03 +08:00
zmj
b09c50e18b 页面修改 2023-11-27 18:06:15 +08:00
jia
df37262b5d 用户退出清除token 2023-11-25 15:38:41 +08:00
weipengfei
8bd12a9f2f Merge branch 'main' of https://gitea.lihaink.cn/mkm/OfficeApp 2023-11-24 11:49:45 +08:00
weipengfei
e3ed71c27b 更新 2023-11-24 11:49:39 +08:00
zmj
f365d7459a 支付 2023-11-24 11:46:56 +08:00
zmj
57b85ee519 取货提示框 2023-11-22 13:42:01 +08:00
zmj
1f0ea2fe29 支付 2023-11-20 14:41:58 +08:00
zmj
dcf5a1a22f 页面修改 2023-11-18 20:17:03 +08:00
zmj
eca744e099 页面修改 2023-11-18 13:34:18 +08:00
zmj
6f34382e75 页面修改 2023-11-18 10:17:52 +08:00
zmj
fe1e183499 df 2023-11-17 19:08:23 +08:00
zmj
9946239502 yemain1 2023-11-17 18:15:12 +08:00
zmj
7d6b6db4d9 as 2023-11-16 18:51:55 +08:00
zmj
a2d3d2e156 页面修改 2023-11-16 16:00:13 +08:00
zmj
e23f57f911 页面修改 2023-11-16 14:02:52 +08:00
zmj
41d647bbc2 页面修改 2023-11-16 13:53:52 +08:00
zmj
f5543a12a6 y页面修改 2023-11-16 10:08:53 +08:00
zmj
2c2364849c 页面修改 2023-11-16 10:05:57 +08:00
zmj
3088532b46 页面修改 2023-11-15 18:47:53 +08:00
zmj
a568324da6 页面修改 2023-11-15 16:50:56 +08:00
zmj
65aafaa6b4 页面修改 2023-11-15 10:50:27 +08:00
zmj
c4f9c1f7d8 页面修改 2023-11-13 17:59:22 +08:00
zmj
4408ac20dd bug修复 2023-11-11 13:48:15 +08:00
zmj
715484f773 Merge branch 'main' of https://gitea.lihaink.cn/mkm/OfficeApp 2023-11-11 13:47:48 +08:00
weipengfei
4a67f74e56 合并代码,版本升级 2023-11-11 09:47:44 +08:00
weipengfei
2e264ab444 修复小程序页面打不开跳转不了的bug 2023-11-11 09:35:21 +08:00
zmj
0c93989f39 bug修复 2023-11-10 16:59:01 +08:00
weipengfei
ad020f8435 Merge branch 'main' of https://gitea.lihaink.cn/mkm/OfficeApp 2023-11-10 12:00:11 +08:00
zmj
47a517b653 页面修改 2023-11-09 18:28:19 +08:00
weipengfei
f5d480798b Merge branch 'main' of https://gitea.lihaink.cn/mkm/OfficeApp 2023-11-08 18:02:35 +08:00
weipengfei
b4449971d1 更新页面拦截逻辑 2023-11-08 18:02:28 +08:00
zmj
06f22cbf2b 提示 2023-11-08 11:06:09 +08:00
zmj
d00fd34336 bug修复 2023-11-08 10:26:21 +08:00
zmj
e3c0ae2df9 镇公司采集任务 2023-11-08 09:13:20 +08:00
zmj
ed540901c1 Merge branch 'main' of https://gitea.lihaink.cn/mkm/OfficeApp into dev 2023-11-08 09:11:32 +08:00
zmj
28729caa81 镇公司收集任务 2023-11-07 23:41:56 +08:00
zmj
4192e6cbfd 物流优化 2023-11-07 18:55:04 +08:00
weipengfei
fb84d0a7ce 更新 2023-11-07 16:17:13 +08:00
weipengfei
bf3d93e9b8 取消版本不一致提示 2023-11-07 16:02:15 +08:00
zmj
73aa7f8c19 镇公司身份改变 2023-11-07 09:21:19 +08:00
zmj
670ab6ff0b 合并 2023-11-01 11:21:12 +08:00
weipengfei
766d0692cc 更新任务详情 2023-10-30 18:49:50 +08:00
weipengfei
f41ebd38af 更新文字说明 2023-10-26 18:44:17 +08:00
weipengfei
07f8628a9f 更新任务模板 2023-10-25 15:15:08 +08:00
weipengfei
65d2c65ce0 Merge branch 'main' of https://gitea.lihaink.cn/mkm/OfficeApp 2023-10-23 16:19:53 +08:00
weipengfei
0508210e20 新增村任务 2023-10-23 16:19:46 +08:00
zmj
a58553977e im更新 2023-10-21 09:39:29 +08:00
weipengfei
cb251a9c8e 修复督促团队学习 2023-10-20 18:44:26 +08:00
jia
5d9a08e5e8 代码提交 2023-10-20 16:31:24 +08:00
jia
ed8c00ccb2 商机分析 2023-10-20 16:26:40 +08:00
jia
d80d55e6e8 商机分析 2023-10-16 15:02:02 +08:00
54 changed files with 10658 additions and 5490 deletions

11
App.vue
View File

@ -4,6 +4,7 @@
// #endif // #endif
import { import {
loginShopAccount, loginShopAccount,
loginParseToken,
userInfo userInfo
} from "@/api/oaUser.js" } from "@/api/oaUser.js"
export default { export default {
@ -33,9 +34,13 @@
uni.setStorageSync('uniMP', info.referrerInfo?.extraData?.uniMP); uni.setStorageSync('uniMP', info.referrerInfo?.extraData?.uniMP);
uni.setStorageSync('APP_token', info.referrerInfo?.extraData?.token); uni.setStorageSync('APP_token', info.referrerInfo?.extraData?.token);
try { try {
let res = await loginShopAccount({ let res = await loginParseToken({
shop_token: info.referrerInfo?.extraData?.token // token:"eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJjZXNoaS1taWRkbGUubGloYWluay5jbiIsImF1ZCI6ImNlc2hpLW1pZGRsZS5saWhhaW5rLmNuIiwiaWF0IjoxNzAwNzkzMjY2LCJuYmYiOjE3MDA3OTMyNjYsImV4cCI6MTcwMTM5ODA2NiwiZGF0YSI6eyJ1aWQiOjUsInBob25lIjoiMTc2ODUxNTE2NDMiLCJhdmF0YXIiOiIvcmVzb3VyY2UvaW1hZ2UvYWRtaW5hcGkvZGVmYXVsdC9kZWZhdWx0X2F2YXRhci5wbmciLCJuaWNrbmFtZSI6Ilx1NzUyOFx1NjIzNzE3Njg1MTUxNjQzIn19.ctEIiBUd6T6zpp9m3x5wdop5vnBcnpS6VOliy4uz9bc"
}); token: info.referrerInfo?.extraData?.token
})
// let res = await loginShopAccount({
// shop_token: info.referrerInfo?.extraData?.token
// });
this.$store.commit('SET_USERINFO', { this.$store.commit('SET_USERINFO', {
user: {}, user: {},
token: res.data.token token: res.data.token

12
api/business.js Normal file
View File

@ -0,0 +1,12 @@
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

@ -45,6 +45,7 @@ export const upLoadImage = (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文件上传 // im文件上传
// export const VIDEO_URL_IM = HTTP_REQUEST_URL_THREE + '/api/upload/video' // export const VIDEO_URL_IM = HTTP_REQUEST_URL_THREE + '/api/upload/video'
export const FILE_URL_IM = HTTP_REQUEST_URL_THREE + '/common/im/sendFileMsg' export const FILE_URL_IM = HTTP_REQUEST_URL_THREE + '/common/im/sendFileMsg'

View File

@ -69,3 +69,8 @@ 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

@ -54,9 +54,62 @@ export const serviceTask4Commit = (data) => oahttp.post('/task/commit_town_task_
/** /**
* 任务:数字农贸宣传加工业务建设和招商任务详情 * 任务:数字农贸宣传加工业务建设和招商任务详情
*/ */
export const marketTask10Detail = (data) => oahttp.post('/task/town_task_type_marketing_director_10_detail', 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 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,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/topUpDeposit/topUpDeposit')"> <view class="item" @click="navTo('/subpkg/topUp/deposit')">
<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>
@ -45,9 +45,10 @@
<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" style="color: #ff7c32;">{{item.type_desc}}</text> <text v-else-if="item.change_type==203"
<text v-else="item.change_type==203">{{item.type_desc}}</text> style="color: #ff7c32;">{{item.type_desc}}</text>
<text v-else="item.change_type==203">{{item.type_desc}}</text>
</view> </view>
</view> </view>
</view> </view>
@ -69,7 +70,7 @@
import { import {
accountMonthList, accountMonthList,
accountDateList, accountDateList,
companyView companyView
} from "@/api/company.js" } from "@/api/company.js"
import { import {
Toast Toast
@ -96,28 +97,30 @@
}; };
}, },
mounted() { mounted() {
this.loadCompany(); this.loadCompany();
this.initLoad(); this.initLoad();
}, },
methods: { methods: {
async loadCompany(){ async loadCompany() {
let res = await companyView(); let res = await companyView();
this.company = res.data.company; 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', { company_money: this.company.company_money }) res.eventChannel.emit('company_money', {
} company_money: this.company.company_money
}) })
}else Toast('暂未开放') }
})
} else Toast('暂未开放')
}, },
initLoad() { initLoad() {
this.loadConfig.page = 1; this.loadConfig.page = 1;
@ -251,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

@ -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="callFn(goodsInfo.shop_phone)"> <view class="content" @click.stop="goDetil(goodsInfo.id)">
<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,8 +37,6 @@
<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>
@ -66,11 +64,13 @@
</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"> <view class="goods_tit" v-for="(item,index) in goodsInfo.products" :key="index">
<text class="goods_detil">{{item.goods_name}}</text> <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}}{{item.goods_unit}}</text> <text>X{{item.product_num}}{{item.goods_unit}}</text>
</view> </view>
</view> </view>
@ -120,31 +120,32 @@
</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"> <view class="goods_tit" v-for="(item,index) in goodsInfo.products" :key="index">
<text class="goods_detil">{{item.goods_name}}</text> <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}}{{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}}件商品
@ -190,7 +191,6 @@
</text> </text>
<view> <view>
{{goodsInfo.qh_time}} {{goodsInfo.qh_time}}
</view> </view>
</view> </view>
<view class="list"> <view class="list">
@ -226,10 +226,7 @@
<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">
@ -240,7 +237,6 @@
<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">
@ -253,9 +249,6 @@
</view> </view>
</view> </view>
</view> </view>
<view class="hr"> <view class="hr">
</view> </view>
<view class="pro_list"> <view class="pro_list">
@ -263,7 +256,7 @@
商品信息 商品信息
</text> </text>
<view> <view>
<view class="goods_tit" v-for="(item,index) in goodsInfo.products"> <view class="goods_tit" v-for="(item,index) in goodsInfo.products" :key="index">
<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>
@ -278,15 +271,8 @@
<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>
@ -296,7 +282,16 @@
<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>
@ -307,10 +302,15 @@
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,6 +344,8 @@
// //
qrqodeFn() { qrqodeFn() {
let that = this let that = this
uni.scanCode({ uni.scanCode({
onlyFromCamera: true, onlyFromCamera: true,
@ -360,12 +362,23 @@
order_id: this.goodsInfo.order_id, order_id: this.goodsInfo.order_id,
order_sn: sn order_sn: sn
}).then(res => { }).then(res => {
this.$emit('showTost') this.tit = "骑手取货完成"
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
} }
@ -380,8 +393,12 @@
take_code: this.take_code, take_code: this.take_code,
logistics_id: this.goodsInfo.id logistics_id: this.goodsInfo.id
}).then(res => { }).then(res => {
console.log(res) this.tit = "骑手送货完成"
this.$emit('showTost') this.showPop = false
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)
@ -471,11 +488,11 @@
} }
.pro_list { .pro_list {
display: flex; /* display: flex;
text { text {
margin-right: 20rpx; margin-right: 20rpx;
} } */
} }
.total { .total {
@ -491,6 +508,8 @@
.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;
@ -519,4 +538,48 @@
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

@ -1,30 +1,30 @@
<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;"> <view style="font-size: 32rpx; display: flex;padding-right: 16rpx;">
<view style="flex-shrink: 0;margin-right: 10rpx;">任务名称: </view> <view style="flex-shrink: 0;margin-right: 10rpx;">任务名称: </view>
<view>{{ datas.title }}</view> <view>{{ datas.title }}</view>
</view> </view>
<view style="flex-shrink: 0;">点击查看</view> <view style="flex-shrink: 0;">点击查看</view>
</view> </view>
<view class="cards_content"> <view class="cards_content">
<view class="right" style="width: 100%"> <view class="right" style="width: 100%">
<view class="" style="display: flex"> <view class="" style="display: flex">
<view>任务状态 :</view> <view>任务状态 :</view>
<view class="text" style="color: #ff7c32"> <view class="text" style="color: #ff7c32">
<text v-if="datas.status == 3" style="color: #488f00">已完成</text> <text v-if="datas.status == 3" style="color: #488f00">已完成</text>
<text v-else-if="datas.status == 5" style="color: #ccc">已关闭</text> <text v-else-if="datas.status == 5" style="color: #ccc">已关闭</text>
<block v-else-if=" <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 +33,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,330 +49,418 @@
: 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 <block v-else-if="townService(datas.type)">
v-else-if="townService(datas.type)"> <block v-if="datas.type == 44">
<block v-if="datas.type == 44"> {{extend.total-extend.not_done_count||0}}/{{extend.total||0}}
{{extend.total-extend.not_done_count||0}}/{{extend.total||0}} </block>
</block> <block v-else-if="datas.type == 45">
<block v-else-if="datas.type == 45"> {{extend.done_count||0}}/{{extend.total||0}}
{{extend.done_count||0}}/{{extend.total||0}} </block>
</block> <block v-else>进行中</block>
<block v-else>进行中</block> </block>
</block> <block v-else>进行中</block>
<block v-else>进行中</block> </view>
</view> </view>
</view> <view style="
<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>
</view> </view>
</view> </view>
</view> </view>
</template> </template>
<script> <script>
import { import {
Toast Toast
} from '../../libs/uniApi'; } from '../../libs/uniApi';
export default { import {
name: "task", dictDataListsTypeValue
props: { } from "@/api/oaPbulic.js"
datas: { export default {
type: Object, name: "task",
default: function() { props: {
return {} datas: {
} type: Object,
} default: function() {
}, return {}
data() { }
return { }
extend: {}, },
// : ,, data() {
taskRoleTypeList: ['town_task_type', 'town_task_type_marketing_director', 'town_task_type_master'], return {
townServiceList: [44,45,46,47,48,49,50], //
navToTownServiceList: [44,45,46,48,49,50], // /subpkg/townTask/townTask 0
navToTownMarketList: [51,52,53,54,55,57,58,59] // /subpkg/townTask/townTask 1
};
},
mounted() {
this.$props.datas.extend ? this.extend = this.$props.datas.extend : null;
},
methods: {
navTo(url) {
if (url) {
uni.showLoading({
title: '加载中',
mask: true
});
uni.navigateTo({
url: url,
success() {
uni.hideLoading()
}
})
} else Toast('暂未开放')
},
clickTask() {
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.type))
return this.navTo(`/subpkg/townTask/townTask?task_id=${this.$props.datas?.id}&type_value=${this.taskRoleTypeList[0]}`);
if(this.navToTownMarketList.includes(this.$props.datas.type))
return this.navTo(`/subpkg/townTask/townTask?task_id=${this.$props.datas?.id}&type_value=${this.taskRoleTypeList[1]}`);
switch (this.$props.datas.type) {
case 31:
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 32:
this.navTo(`/subpkg/property/vehicle?task_id=${this.$props.datas?.id}`);
break;
case 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}`);
break;
case 34:
this.navTo(`/subpkg/otherTask/otherTask?task_id=${this.$props.datas?.id}`);
break;
case 35:
this.navTo(`/subpkg/buyShare/buyShare?task_id=${this.$props.datas?.id}`);
break;
case 47:
this.navTo(`/subpkg/townTask/serviceTask4?task_id=${this.$props.datas?.id}`);
break;
case 60:
this.navTo(`/subpkg/townTask/marketTask10?task_id=${this.$props.datas?.id}&stage=${this.$props.datas?.stage}`);
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 extend: {},
startTime.setHours(22); // : ,,
startTime.setMinutes(55); taskRoleTypeList: ['town_task_type', 'town_task_type_marketing_director', 'town_task_type_master'],
startTime.setSeconds(0); townServiceList: ["town_task_type_1", "town_task_type_2", "town_task_type_3", "town_task_type_4",
"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",
// "",
// 23:59:59 ], // /subpkg/townTask/townTask 1
endTime.setHours(23); navToList: ["village_task_type_4", "village_task_type_5", "town_task_type_6", "town_task_type_master_6", ],
endTime.setMinutes(59); // /subpkg/townTask/villageTask6
endTime.setSeconds(59); navToVillageTask6List: ['village_task_type_8', 'town_task_type_master_2', 'town_task_type_master_7',
'town_task_type_master_8'
]
//
return now >= startTime && now <= endTime; };
} },
} mounted() {
} this.$props.datas.extend ? this.extend = this.$props.datas.extend : null;
//
// this.$store.state.app.userInfo.group_id
},
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; min-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

@ -0,0 +1,245 @@
<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

@ -0,0 +1,237 @@
<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

@ -19,9 +19,9 @@ switch (env) {
httpApiTwo = 'https://preview-logistics.lihaink.cn' //预上线 httpApiTwo = 'https://preview-logistics.lihaink.cn' //预上线
break; break;
case 'local': case 'local':
httpApi = 'http://192.168.1.12:8001' //预上线 httpApi = 'http://192.168.1.20:8000' //预上线
httpApiThree = 'http://192.168.1.12:8001' //预上线 httpApiThree = 'http://192.168.1.20:8000' //预上线
httpApiTwo = 'http://192.168.1.12:8001' //预上线 httpApiTwo = 'http://192.168.1.20:8000' //预上线
break; break;
default: default:
httpApi = 'https://ceshi-worker-task.lihaink.cn' //测试 httpApi = 'https://ceshi-worker-task.lihaink.cn' //测试

View File

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

View File

@ -44,7 +44,16 @@
} }
}, },
{
"path": "pages/business/detail",
"style": {
"navigationBarTitleText": "商机详细信息",
"enablePullDownRefresh": true,
"navigationBarBackgroundColor": "#0122C7",
"navigationBarTextStyle": "white"
}
},
{ {
"path": "pages/index/index", "path": "pages/index/index",
"style": { "style": {
@ -124,23 +133,6 @@
"navigationBarTextStyle": "white" "navigationBarTextStyle": "white"
} }
}, {
"path": "pages/logistics/te",
"style": {
"navigationBarTitleText": "测试",
"enablePullDownRefresh": false,
"navigationBarBackgroundColor": "#0122C7",
"navigationBarTextStyle": "white"
}
}, {
"path": "pages/logistics/te",
"style": {
"navigationBarTitleText": "测试",
"enablePullDownRefresh": false,
"navigationBarBackgroundColor": "#0122C7",
"navigationBarTextStyle": "white"
}
}, { }, {
"path": "pages/logistics/logisticDetil", "path": "pages/logistics/logisticDetil",
"style": { "style": {
@ -164,15 +156,23 @@
"navigationBarTitleText": "配送信息", "navigationBarTitleText": "配送信息",
"enablePullDownRefresh": false, "enablePullDownRefresh": false,
"navigationBarBackgroundColor": "#0122C7", "navigationBarBackgroundColor": "#0122C7",
"navigationBarTextStyle": "white" "navigationBarTextStyle": "white",
} "app-plus": {
}, { //
"path": "pages/logistics/deliveryDetil", "subNVues": [{
"style": { "id": "map", //
"navigationBarTitleText": "配送信息", "path": "pages/logistics/mask", //
"enablePullDownRefresh": false, //
"navigationBarBackgroundColor": "#0122C7", "style": {
"navigationBarTextStyle": "white" "position": "absolute",
"width": "750rpx",
"height": "600rpx",
"background": "rgba(0,0,0,.5)"
}
}]
}
} }
}, { }, {
@ -438,6 +438,25 @@
} }
} }
}, {
"path": "topUp/deposit",
"style": {
"navigationBarTitleText": "押金充值",
"enablePullDownRefresh": false,
"navigationBarBackgroundColor": "#0122C7",
"navigationBarTextStyle": "white",
"app-plus": {
"titleNView": {
"buttons": [{
"color": "#fff",
"text": "充值记录",
"fontSize": "15",
"width": "90"
}]
}
}
}
}, { }, {
"path": "contract/contract", "path": "contract/contract",
"style": { "style": {
@ -754,6 +773,15 @@
"navigationBarTextStyle": "white" "navigationBarTextStyle": "white"
} }
}, {
"path": "property/buyCar",
"style": {
"navigationBarTitleText": "三轮车购买",
"enablePullDownRefresh": false,
"navigationBarBackgroundColor": "#0122C7",
"navigationBarTextStyle": "white"
}
}, { }, {
"path": "property/success", "path": "property/success",
"style": { "style": {
@ -781,6 +809,15 @@
"navigationBarTextStyle": "white" "navigationBarTextStyle": "white"
} }
}, {
"path": "townTask/villageTask4",
"style": {
"navigationBarTitleText": "任务:入股任务",
"enablePullDownRefresh": false,
"navigationBarBackgroundColor": "#0122C7",
"navigationBarTextStyle": "white"
}
}, { }, {
"path": "otherTask/otherTask", "path": "otherTask/otherTask",
"style": { "style": {
@ -843,6 +880,14 @@
"navigationBarBackgroundColor": "#0122C7", "navigationBarBackgroundColor": "#0122C7",
"navigationBarTextStyle": "white" "navigationBarTextStyle": "white"
} }
}, {
"path": "townTask/villageTask6",
"style": {
"navigationBarTitleText": "任务详情",
"enablePullDownRefresh": false,
"navigationBarBackgroundColor": "#0122C7",
"navigationBarTextStyle": "white"
}
}, { }, {
"path": "townTask/serviceTask4", "path": "townTask/serviceTask4",
"style": { "style": {
@ -860,6 +905,24 @@
"navigationBarTextStyle": "white" "navigationBarTextStyle": "white"
} }
}, {
"path": "townTask/townGather",
"style": {
"navigationBarTitleText": "养殖信息收集",
"enablePullDownRefresh": false,
"navigationBarBackgroundColor": "#0122C7",
"navigationBarTextStyle": "white"
}
}, {
"path": "townTask/gatherRecords",
"style": {
"navigationBarTitleText": "养殖信息收集",
"enablePullDownRefresh": false,
"navigationBarBackgroundColor": "#0122C7",
"navigationBarTextStyle": "white"
}
}, { }, {
"path": "complaint/complaint", "path": "complaint/complaint",
"style": { "style": {

View File

@ -1,34 +1,82 @@
<template> <template>
<view class=""> <view class="all_box">
<u-empty icon="/static/img/empty/data.png"></u-empty> <block v-if="skeleton">
<!-- <u-loadmore :status="loadConfig.status" :loading-text="loadConfig.loadingText" :loadmore-text="loadConfig.loadmoreText" :nomore-text="loadConfig.nomoreText" /> --> <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="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 {
loadConfig: { skeleton: false,
loadConfig:{
page: 1, page: 1,
limit: 15, limit: 15,
lastpage: '', lastpage: '',
loadingText: '努力加载中', loadingText: '努力加载中',
loadmoreText: '轻轻上拉', loadmoreText: '轻轻上拉',
nomoreText: '暂无商机', nomoreText: '我也是有底线的~~',
status: 'nomore' status: 'loadmore',
}, },
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() {
uni.stopPullDownRefresh() this.loadList();
} this.$u.sleep(500).then(()=>{uni.stopPullDownRefresh()});
},
onReachBottom() {
},
} }
</script> </script>
<style lang="scss"> <style lang="scss" scoped>
.task_list{
</style> padding-top: 28rpx;
}
.loading{
padding: 28rpx;
margin-top: 28rpx;
}
</style>

91
pages/business/detail.vue Normal file
View File

@ -0,0 +1,91 @@
<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,466 +1,522 @@
<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>
<view class="map_address"> </map>
<view style="display: flex;"> <view class="map_address">
<view style="flex-shrink: 0;margin-right: 16rpx;"><text class="cir" <view style="display: flex;">
style="background-color: #40BC5E;"></text> 起点:</view> <view style="flex-shrink: 0;margin-right: 16rpx;"><text class="cir"
<view>{{nowAddress}}</view> style="background-color: #40BC5E;"></text> 起点:</view>
</view> <view>{{nowAddress}}</view>
<view style="display: flex;"> </view>
<view style="flex-shrink: 0;margin-right: 16rpx;"><text class="cir" <view style="display: flex;">
style="background-color: #FF7C32;"></text>终点:</view> <view style="flex-shrink: 0;margin-right: 16rpx;"><text class="cir"
<view>{{goodsDetil.logistics.shop_address}}</view> style="background-color: #FF7C32;"></text>终点:</view>
</view> <view>{{goodsDetil.logistics.shop_address}}</view>
</view> </view>
</view> </view>
</view>
<view class="order_info"> <view class="order_info">
<view class="top"> <view class="top">
<view> <view>
订单号信息: 订单号信息:
</view>
<view>订单编号:&nbsp;&nbsp;{{goodsDetil.logistics.order_sn}}</view>
<view>
商户名称:&nbsp;&nbsp; {{goodsDetil.logistics.shop_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.shop_address}}
</view>
</view> </view>
<view>订单编号:&nbsp;&nbsp;{{goodsDetil.logistics.order_sn}}</view>
<view class="mark"> <view>
请详细核对订单信息 商户名称:&nbsp;&nbsp; {{goodsDetil.logistics.shop_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.shop_address}}
</view>
<view style="margin-top: 10px;">
订单备注:&nbsp;&nbsp;{{goodsDetil.logistics.mark}}
</view> </view>
</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 class="order_info" style="background-color: #47BE62;"> <view>
<view class="top"> 下单时间:&nbsp;&nbsp;{{goodsDetil.logistics.create_time}}
<view> </view>
物流信息: <view class="pro_list">
</view> <view class="goods">
<view>用户名称:&nbsp;&nbsp;{{fuzzyName( goodsDetil.logistics.receiver_name)}}</view>
<view>
通知时间:&nbsp;&nbsp;{{goodsDetil.logistics.create_time}}
</view>
<view class="pro_list">
<text> <text>
商品信息 商品信息
</text> </text>
<view class="goods"> <view class="goods-tit" style="align-items: center;"
<view class="goods_tit" v-for="(item,index) in goodsDetil.product"> v-for="(item,index) in goodsDetil.product" :key="index">
<text style="flex: 8;">{{item.goods_name}}</text> <u--image style="flex: 2;" radius='10' :showLoading="true" :src="item.goods_pic"
<text style="flex: 2;">X{{item.product_num}}{{item.goods_unit}}</text> width="100rpx" height="100rpx"></u--image>
</view> <text style="flex: 7;">{{item.goods_name}}</text>
<text style="flex: 1;">X{{item.product_num}}</text>
</view> </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> </view>
<view class="mark" style="display: flex; justify-content: space-between;">
<view style="margin-top: 200rpx;height: 1px;"> <text>请详细核对订单信息</text>
<!-- 565 --> <text style="color: #0122C7;">共计{{goodsDetil.product_count}}件商品</text>
</view> </view>
<view class="btn" v-if="!is_captain"> </view>
<u-button @click="qrqodeFn" type="primary" style="background-color: #0122C7;border: 0;"> <view class="">
<u-icon name="scan" color="white" size="30" style="margin-right: 10rpx;"></u-icon>
扫码取货</u-button> </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>
<!-- 弹窗 -->
<u-overlay :show="showToast" @click="offMaskFn">
<view class="warp">
<view class="rect">
<view class="cont">
骑手送货完成
</view> </view>
</view> </view>
</view> </view>
</u-overlay>
</view>
</template>
</view> <script>
</template> 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: []
<script> }
import { },
getDetil methods: {
} from "@/api/logistics.js" fuzzyName(name) {
import { let length = name.length;
takeGoods let fuzzyChars = "*".repeat(length - 1);
} from "@/api/logistics.js" return name[0] + fuzzyChars;
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: []
}
}, },
methods: { callFn(num) {
fuzzyName(name) { uni.makePhoneCall({
let length = name.length; phoneNumber: num
let fuzzyChars = "*".repeat(length - 1); });
return name[0] + fuzzyChars; },
}, //
callFn(num) { //
uni.makePhoneCall({ locationFn() {
phoneNumber: num let that = this
}); //#ifdef APP
}, uni.getLocation({
// type: 'gcj02',
// geocode: true,
locationFn() { isHighAccuracy: true,
let that = this success: function async (res) {
//#ifdef APP that.nowAddress = res.address.city + res.address.district + res.address.street + res
uni.getLocation({ .address.streetNum + res.address.poiName
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; });
}
that.polyline = [{
points: points,
color: "#0091ff",
dottedLine: true,
width: 30,
}, ];
},
fail: function(res) {
console.log("获取路线失败", res);
},
});
},
qrqodeFn() {
let that = this
uni.scanCode({
onlyFromCamera: true,
success: function(res) {
that.takeGood(res.result)
} }
}); }
},
// {}
takeGood(sn) {
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)
})
},
},
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)
}) })
}, },
}
</script>
<style lang='scss' scoped> mapFun() {
.custom-map /deep/ .polyline { uni.openLocation({
stroke-width: 20px; 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,
});
},
.content { getDriverLine() {
padding: 2vh 3vw; const that = this;
background-color: #F6F7FC; const key = "997c9a3d88154fa78f4d28bebc1dd84f";
height: 100vh;
box-sizing: border-box;
}
.map { const origin = `${this.markers[1].longitude},${this.markers[1].latitude}`;
height: 40vh;
border-radius: 2vw;
overflow: hidden;
} 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]),
});
}
}
.map_address { that.runningRoute = data.paths[0].steps[0].instruction;
background-color: white;
padding: 20rpx 10rpx;
.cir { }
display: inline-block; that.polyline = [{
width: 2vw; points: points,
height: 4vw; color: "#0091ff",
border-radius: 2vw; dottedLine: true,
margin: 0 20rpx; width: 30,
}
}
.map_btn { }, ];
width: 50px; },
height: 50px; fail: function(res) {
position: absolute; console.log("获取路线失败", res);
bottom: 0px; },
right: 0; });
z-index: 9999999; },
}
offMaskFn() {
this.showToast = false
this.subNVue.hide()
},
.order_info { qrqodeFn() {
border: none; // uni.navigateBack()
background-color: #FF7C32; // return
border-radius: 2vw; let that = this
overflow: hidden; console.log(6666)
margin-top: 50rpx; uni.scanCode({
margin-bottom: 30rpx; onlyFromCamera: true,
color: white; success: function(res) {
that.takeGood(res.result)
.top {
padding: 1vw 3vw;
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;
} }
});
},
// {}
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(() => {
this.showToast = false
this.subNVue.hide()
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>
<style lang='scss' scoped>
.custom-map /deep/ .polyline {
stroke-width: 20px;
}
.content {
padding: 2vh 3vw;
background-color: #F6F7FC;
height: 100vh;
box-sizing: border-box;
}
.map {
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;
margin: 0 20rpx;
}
}
.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;
} }
} }
.btn { .mark {
background-color: white;
position: fixed; color: #A8A8A8;
bottom: 20rpx; padding: 10rpx 20rpx;
width: 90vw;
left: 50%;
transform: translateX(-50%);
} }
</style>
.pro_list {
display: flex;
text {
flex: 2
}
.goods {
flex: 8;
margin: 0;
.goods-tit {
margin: 0;
display: flex;
justify-content: space-around;
}
}
}
}
.btn {
position: fixed;
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%;
transform: translate(-50%, -50%);
font-size: 35.05rpx;
}
}
.cover {
width: 100vw;
height: 100vh;
background-color: rgba(0, 0, 0, .5);
}
</style>

View File

@ -13,13 +13,14 @@
</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"
@showTost="showToast" @showToast2="showToast2" :goodsInfo="item" :key="index"> @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>
@ -42,6 +43,7 @@
}, },
data() { data() {
return { return {
showToast: false,
is_captain: "", is_captain: "",
notArr: [], notArr: [],
keywords: "", keywords: "",
@ -68,14 +70,6 @@
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"> :desc="item.create_time" v-for="(item,index) in goodsDetil.record" :key="index">
</u-steps-item> </u-steps-item>
</u-steps> </u-steps>
</view> </view>
@ -77,9 +77,12 @@
商品信息 商品信息
</text> </text>
<view> <view>
<view class="goods_tit" v-for="(item,index) in goodsDetil.product"> <view class="goods_tit" v-for="(item,index) in goodsDetil.product" :key="index">
<text style="width: 60vw;margin: 0;padding: 0;">{{item.goods_name}}</text> <text style="width: 60vw;margin: 0;padding: 0;">{{item.goods_name}}</text>
<text>X{{item.product_num}}{{item.goods_unit}}</text> <!-- <u--image style="flex: 2;" :showLoading="true" :src="item.goods_pic" width="100rpx"
height="100rpx" @click="click"></u--image> -->
<text>X{{item.product_num}}</text>
</view> </view>
</view> </view>
</view> </view>
@ -94,41 +97,95 @@
<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_address||"商家地址"}} {{goodsDetil.logistics.shop_name}}
</view>
<view>
{{goodsDetil.logistics.shop_name||"商家电话"}}
:&nbsp;&nbsp;{{goodsDetil.logistics.shop_phone||"商家电话"}}
</view>
<view>
{{goodsDetil.record[1].create_time}}
</view> </view>
</view> </view>
</view> </view>
<view class="list">
<text>
店主姓名:
</text>
<view>
<view>
{{goodsDetil.logistics.shop_user}}
</view>
</view>
</view>
<view class="list">
<text>
联系方式:
</text>
<view>
<view>
{{goodsDetil.logistics.shop_phone}}
</view>
</view>
</view>
<view class="list">
<text>
联系方式:
</text>
<view>
<view>
{{goodsDetil.logistics.shop_address}}
</view>
</view>
</view>
<!-- 下划线 --> <!-- 下划线 -->
<view class="hr"> <view class="hr">
@ -140,19 +197,21 @@
<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"> v-for="(item,index) in goodsDetil.record" :key='index'>
</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"> <view class="goods_tit" v-for="(item,index) in goodsDetil.product" :key='index'>
<text style="width: 60vw;margin: 0;padding: 0;">{{item.goods_name}}</text> <u--image style="flex: 2;margin-right: 20rpx;" radius='10' :showLoading="true"
<text>X{{item.product_num}}{{item.goods_unit}}</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}}</text>
</view> </view>
</view> </view>
</view> </view>
@ -160,7 +219,13 @@
<!-- 已取货 --> <!-- 已取货 -->
<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>
@ -170,7 +235,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"
@ -179,7 +244,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>
@ -187,6 +252,47 @@
</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>
物流信息 物流信息
@ -194,7 +300,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)"> v-for="(item,index) in (record)" :key="index">
</u-steps-item> </u-steps-item>
</u-steps> </u-steps>
</view> </view>
@ -204,13 +310,17 @@
</view> </view>
<view class="pro_list"> <view class="pro_list">
<text style="color: #999;width: 15vw;">
商品信息
</text>
<view> <view>
<view class="goods_tit" v-for="(item,index) in goodsDetil.product"> <text style="color: #999;width: 15vw;">
<text style="width: 60vw;margin: 0;padding: 0;">{{item.goods_name}}</text> 商品信息:
<text>X{{item.product_num}}{{item.goods_unit}}</text> </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>
@ -241,6 +351,15 @@
</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>
@ -258,9 +377,13 @@
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,
@ -286,27 +409,26 @@
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() this.showToast = true
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({
@ -391,13 +513,7 @@
} }
} }
.pro_list { .pro_list {}
display: flex;
text {
margin-right: 20rpx;
}
}
.total { .total {
/* font-family: "宋体"; */ /* font-family: "宋体"; */
@ -431,8 +547,12 @@
} }
.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 {
@ -440,4 +560,28 @@
} }
} }
.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

@ -0,0 +1,8 @@
<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'
}) })

View File

@ -1,347 +0,0 @@
<!-- -->
<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

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

File diff suppressed because it is too large Load Diff

View File

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

View File

@ -33,6 +33,8 @@ 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();

View File

@ -1,90 +1,320 @@
<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">入股金额: {{task.extend.shareholder.money}}</view> <view class="text" style="color: #FF7C32;" v-if="task.extend&&task.extend.shareholder">入股金额:
</view> {{task.extend.shareholder.money}}
<view class="card"> </view>
<view class="title">任务描述</view> </view>
<u-line style="margin: 14rpx 0;"></u-line> <view class="card">
<view class="text">{{task.content||'暂无任务描述'}}</view> <view class="title">任务描述</view>
</view> <u-line style="margin: 14rpx 0;"></u-line>
<view class="card"> <view class="text">{{task.content||'暂无任务描述'}}</view>
<view class="title">事件记录</view> </view>
<u-line style="margin: 14rpx 0;"></u-line> <view class="card">
<u-steps v-if="task.extend&&task.extend.shareholder" :current="-1" direction="column" activeColor="#0122c7" dot inactiveColor="#0122c7"> <view class="title">事件记录</view>
<u-steps-item v-for="(item, index) in task.extend.shareholder.user_list" :title="item.time" :desc="item.info"> <u-line style="margin: 14rpx 0;"></u-line>
</u-steps-item> <u-steps v-if="task.extend&&task.extend.shareholder" :current="-1" direction="column" activeColor="#0122c7"
</u-steps> dot inactiveColor="#0122c7">
</view> <u-steps-item v-for="(item, index) in task.extend.shareholder.user_list" :title="item.time"
<view class="card"> :desc="item.info">
<view class="title">温馨提示</view> </u-steps-item>
<u-line style="margin: 14rpx 0;"></u-line> </u-steps>
<view class="text" style="color: #FF7C32;">入股的金额将在次日凌晨更新到"股金管理"请于次日打开"股金管理"页面查看详情</view> </view>
</view> <view class="card" v-if="task.approve_status==3">
<mybtn v-if="task.status!=3 && task.status!=5" text="前往支付页面" @click="navTo(`/subpkg/topUp/topUp?task_id=${task_id}`)"></mybtn> <view class="title" style="color: #FF7C32;">驳回提示</view>
<mybtn v-else :text="task.status==3?'已完成任务':'任务已关闭'" :my_btn_disabled="true"></mybtn> <u-line style="margin: 14rpx 0;"></u-line>
</view> <view class="text" style="color: #FF7C32;">{{task.deny_notes}}</view>
</template> <!-- <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> <script>
import { taskShareholder } from "@/api/task.js" import {
export default { taskShareholder,
data() { commit_service_group_taskAPI
return { } from "@/api/task.js"
task:{}, import lsjUpload from '@/uni_modules/lsj-upload/components/lsj-upload/lsj-upload.vue'
task_id: -1, import {
}; FILE_URL,
}, IMG_URL
onLoad(options) { } from '@/api/file.js'
this.task_id = options.task_id; import {
this.loadTask(); Toast
uni.$on('upBuyShare', this.loadTask); } from "../../libs/uniApi";
},
methods:{ export default {
async loadTask(){ components: {
let res = await taskShareholder({ lsjUpload
id: this.task_id },
}); data() {
this.task = res.data; return {
}, progress: 0,
navTo (url) { imgTypeList: ["png", "jpg", "jpeg", "webp"],
if(url){ isDisabled: false,
uni.showLoading({ amount: "",
title: '加载中', fileOption: {},
mask: true task: {},
}); task_id: -1,
uni.navigateTo({ file: "",
url: url, local_src: "",
success() { fileTit: "",
uni.hideLoading() file_type: "pdf",
} };
}) },
}else Toast('暂未开放') onLoad(options) {
}, 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

@ -496,12 +496,12 @@
}, },
onLoad() { onLoad() {
console.log(F)
let user = JSON.parse(uni.getStorageSync('USER_INFO')) let user = JSON.parse(uni.getStorageSync('USER_INFO'))
this.a = user.avatar this.a = user.avatar
console.log(user.avatar) console.log(user.avatar)
uni.connectSocket({ uni.connectSocket({
url: 'wss://worker-task.lihaink.cn/wss' url: 'wss://ceshi-worker-task.lihaink.cn/im'
}); });
uni.onSocketOpen(function(res) { uni.onSocketOpen(function(res) {
console.log('WebSocket连接已打开'); console.log('WebSocket连接已打开');

File diff suppressed because it is too large Load Diff

View File

@ -1,424 +1,528 @@
<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.company_name}}</view> <view>{{extend.is_company==1?"对公户":"个体户" }}</view>
</view> </view>
<view class="b_item">
<view>法人姓名:</view> <view class="b_item">
<view>{{extend.master_name}}</view> <view>公司名称:</view>
</view> <view>{{extend.company_name}}</view>
<view class="b_item"> </view>
<view>社会代码:</view> <view class="b_item">
<view>{{extend.organization_code}}</view> <view>法人姓名:</view>
</view> <view>{{extend.master_name}}</view>
</view> </view>
</view> <view class="b_item">
<view class="card"> <view>社会代码:</view>
<view class="nav_bar"> <view>{{extend.organization_code}}</view>
<view class="left"> </view>
<image src="../../static/img/company/SHZZ.png"></image> </view>
<view>商户资质信息</view> </view>
</view> <view class="card">
</view> <view class="nav_bar">
<view class="body"> <view class="left">
<block v-for="(item, index) in extend.qualification"> <image src="../../static/img/company/SHZZ.png"></image>
<image @click="priview(item)" :src="item"></image> <view>商户资质信息</view>
<view v-if="index<extend.qualification.length-1" style="border-top: 1px dashed #0022c7;margin: 28rpx 0;"> </view>
</view> </view>
</block> <view class="body">
</view> <block v-for="(item, index) in extend.qualification" :key="">
</view> <image @click="priview(item)" :src="item"></image>
<view v-if="is_transaction" class="card"> <view v-if="index<extend.qualification.length-1"
<view class="nav_bar"> style="border-top: 1px dashed #0022c7;margin: 28rpx 0;">
<view class="left"> </view>
<image src="../../static/img/company/SHZZ.png"></image> </block>
<view>身份证明信息</view> </view>
</view> </view>
</view> <view v-if="is_transaction" class="card">
<view class="body"> <view class="nav_bar">
<view class="b_item"> <view class="left">
<view>银行账户姓名:</view> <image src="../../static/img/company/SHZZ.png"></image>
<view>{{extend.bank_username}}</view> <view>身份证明信息</view>
</view> </view>
<view class="b_item"> </view>
<view>开户行:</view>
<view>{{extend.bank_opening}}</view>
</view> <view class="body" v-if="extend.is_company==1">
<view class="b_item"> <view class="b_item">
<view>银行卡正面:</view> <view>公司名称: </view>
</view> <view>{{extend.company_name}}</view>
<image @click="priview(extend.bank_front)" :src="extend.bank_front"></image> </view>
<view class="b_item">
<view>银行卡反面:</view> <view class="b_item">
</view> <view>对公账号: </view>
<image @click="priview(extend.bank_back)" :src="extend.bank_back"></image> <view>{{extend.bank_code}}</view>
<view class="b_item"> </view>
<view>身份证正面:</view>
</view> <view class="b_item">
<image @click="priview(extend.cardno_front)" :src="extend.cardno_front"></image> <view>开户银行: </view>
<view class="b_item"> <view>{{extend.bank_username}}</view>
<view>身份证反面:</view> </view>
</view> <view class="b_item">
<image @click="priview(extend.cardno_back)" :src="extend.cardno_back"></image> <view>开户网点: </view>
</view> <view>{{extend.bank_opening}}</view>
</view> </view>
</view> <view class="b_item">
<block v-if="formData.check_status!=2&&formData.check_status!=3&&formData.check_status"> <view>开户凭证:</view>
<button class="btn" @click="tipShow = true">通过</button> </view>
<button class="btn" @click="modalShow = true" style="background-color: #fff;color: #0122c7;">拒绝</button> <image @click="priview(extend.bank_front)" :src="extend.bank_front"></image>
</block> <!-- <view class="b_item">
<block v-else-if="formData.check_status==3"> <view>对公账号: </view>
<view class="refuse"> <view>{{extend.bank_code}}</view>
未通过原因: {{formData.remark}} </view>
</view> <view class="b_item">
</block> <view>开户行名称: </view>
<u-popup :show="modalShow" :round="13" mode="center"> <view>{{extend.bank_username}}</view>
<view class="popup"> </view>
<view class="header"> <view class="b_item">
<text>请输入拒绝原因</text> <view>开户行地址: </view>
<image @click="modalShow=false" src="../../static/icons/close.png"></image> <view>{{extend.bank_opening}}</view>
</view> </view> -->
<u--form labelPosition="left" :model="formData" :rules="rules" ref="uForm"> <!-- <view class="b_item">
<u-form-item prop="remark"> <view>银行卡号:</view>
<u-textarea class="textarea" v-model="formData.remark" placeholder="请输入拒绝原因" type="textarea" <view>{{extend.bank_opening}}</view>
height="100"></u-textarea> </view>
</u-form-item> <view class="b_item">
</u--form> <view>银行卡正面:</view>
<view class="p_btn"> </view>
<view></view> <image @click="priview(extend.bank_front)" :src="extend.bank_front"></image>
<view class="right_btn"> <view class="b_item">
<button class="cal" @click="modalShow=false">取消</button> <view>银行卡反面:</view>
<button class="pri" @click="$u.throttle(noPass, 1500)">确认</button> </view>
</view> <image @click="priview(extend.bank_back)" :src="extend.bank_back"></image>
</view> <view class="b_item">
</view> <view>身份证正面:</view>
</u-popup> </view>
<u-modal :show="tipShow" title="提示" content='确认信息无误再通过' closeOnClickOverlay showCancelButton @close="tipShow=false" <image @click="priview(extend.cardno_front)" :src="extend.cardno_front"></image>
@cancel="tipShow=false" @confirm="$u.throttle(pass, 1500)"></u-modal> <view class="b_item">
</view> <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 { Toast } from '../../libs/uniApi' import {
import { approveAudit, approveDetails } from "@/api/approve.js" Toast
export default { } from '../../libs/uniApi'
data() { import {
return { approveAudit,
modalShow: false, approveDetails
tipShow: false, } from "@/api/approve.js"
formData: { export default {
id: '', data() {
remark: '' return {
}, modalShow: false,
extend: { tipShow: false,
formData: {
id: '',
remark: ''
},
extend: {
}, },
is_transaction: false, // 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;
if (options.name.includes('交易')) this.is_transaction = true; if (options.name.includes('交易')) this.is_transaction = true;
this.initData(); this.initData();
}, },
onShow() {}, onShow() {},
methods: { methods: {
async initData() { async initData() {
try { try {
let res = await approveDetails({ let res = await approveDetails({
id: this.formData.id id: this.formData.id
}); });
this.formData = res.data; this.formData = res.data;
this.extend = this.formData?.extend; this.extend = this.formData?.extend;
this.extend.qualification ? this.extend.qualification = JSON.parse(this.extend.qualification) : this.extend this.extend.qualification ? this.extend.qualification = JSON.parse(this.extend.qualification) :
.qualification = [] this.extend
} catch (e) { .qualification = []
//TODO handle the exception } catch (e) {
} //TODO handle the exception
}, }
async pass() { },
// check_status 2,3 async pass() {
await approveAudit({ // check_status 2,3
id: this.formData.id, await approveAudit({
check_status: 2 id: this.formData.id,
}) check_status: 2
this.tipShow = false; })
this.$nextTick(() => { this.tipShow = false;
Toast('已通过'); this.$nextTick(() => {
uni.$emit('initMerchant'); Toast('已通过');
uni.navigateBack(); uni.$emit('initMerchant');
}) uni.navigateBack();
}, })
async noPass() { },
await this.$refs.uForm.validate(); async noPass() {
await approveAudit({ await this.$refs.uForm.validate();
id: this.formData.id, await approveAudit({
check_status: 3, id: this.formData.id,
remark: this.formData.remark check_status: 3,
}) remark: this.formData.remark
this.modalShow = false; })
this.$nextTick(() => { this.modalShow = false;
Toast('已拒绝'); this.$nextTick(() => {
uni.navigateBack(); Toast('已拒绝');
}) uni.navigateBack();
}, })
priview(url) { },
uni.previewImage({ priview(url) {
urls: [url], uni.previewImage({
longPressActions: { urls: [url],
itemList: ['保存图片'], longPressActions: {
success: function(data) { itemList: ['保存图片'],
if (data.tapIndex === 0) { success: function(data) {
uni.saveImageToPhotosAlbum({ if (data.tapIndex === 0) {
filePath: url, uni.saveImageToPhotosAlbum({
success: function() { filePath: url,
uni.showToast({ success: function() {
title: '保存成功', uni.showToast({
icon: 'success' title: '保存成功',
}) icon: 'success'
}, })
fail: function() { },
uni.showToast({ fail: function() {
title: '保存失败', uni.showToast({
icon: 'none' 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

@ -46,7 +46,8 @@
<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" label="是否为小队长" required prop="is_captain" borderBottom> <u-form-item v-if="$store.state.app.userInfo.company.company_type==18" labelWidth="auto"
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"
@ -54,14 +55,15 @@
</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==41" labelWidth="auto" label="是否为服务部长" required prop="is_service_manager" borderBottom> <u-form-item v-if="$store.state.app.userInfo.company.company_type==16" labelWidth="auto"
<u-radio-group v-model="formData.is_service_manager" style="margin: 16rpx;"> label="是否为服务部长" required prop="is_service_manager" borderBottom>
<u-radio activeColor="#0122C7" :customStyle="{marginRight: '16px'}" <u-radio-group v-model="formData.is_service_manager" style="margin: 16rpx;">
v-for="(item, index) in [{value:1,label:'是'},{value:0,label:'否'}]" :key="index" <u-radio activeColor="#0122C7" :customStyle="{marginRight: '16px'}"
:label="item.label" :name="item.value"> v-for="(item, index) in [{value:1,label:'是'},{value:0,label:'否'}]" :key="index"
</u-radio> :label="item.label" :name="item.value">
</u-radio-group> </u-radio>
</u-form-item> </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">
@ -295,11 +297,10 @@
</u-upload> </u-upload>
</u-form-item> --> </u-form-item> -->
</u--form> </u--form>
<button @click="modelShow=true" type="primary" class="btn" <button @click="modelShow=true" type="primary" class="btn" style="margin: 28rpx;">创建</button>
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>
@ -309,7 +310,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 {
@ -322,7 +323,7 @@
}, },
data() { data() {
return { return {
modelShow: false, modelShow: false,
formData: { formData: {
account: '', // account: '', //
password: '123456', // password: '123456', //
@ -330,7 +331,7 @@
// 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: '', // is_service_manager: '', //
sex: '', sex: '',
avatar: '', avatar: '',
nickname: '', nickname: '',
@ -381,12 +382,12 @@
}, },
trigger: ['change', 'blur'] trigger: ['change', 'blur']
}, },
is_service_manager: { is_service_manager: {
validator: (rule, value, callback) => { validator: (rule, value, callback) => {
typeof value === 'number' ? callback() : callback('不能为空') typeof value === 'number' ? callback() : callback('不能为空')
}, },
trigger: ['change', 'blur'] trigger: ['change', 'blur']
}, },
'qualification.id_card': { 'qualification.id_card': {
type: 'string', type: 'string',
required: true, required: true,
@ -428,17 +429,17 @@
}, },
// //
async afterReadAvatar(event) { async afterReadAvatar(event) {
uni.showLoading({ uni.showLoading({
title:'上传中' 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(()=>{ }).finally(() => {
uni.hideLoading(); uni.hideLoading();
}) })
}, },
// //
async afterRead(event) { async afterRead(event) {
@ -446,27 +447,29 @@
}, },
// //
upLoad(url, type) { upLoad(url, type) {
uni.showLoading({ uni.showLoading({
title:'上传中请稍后' 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(()=>{ }).finally(() => {
uni.hideLoading(); 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()

View File

@ -109,7 +109,9 @@
: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 v-if="$store.state.app.userInfo.company && ($store.state.app.userInfo.company.company_type==18||$store.state.app.userInfo.company.company_type==41)" text="创建账号" @click="navTo('/subpkg/newPersonnel/newPersonnel')"></mybtn> <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>
@ -146,18 +148,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;
@ -202,8 +204,9 @@
<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

@ -172,7 +172,7 @@
</view> </view>
</view> </view>
<!-- 镇街公司 --> <!-- 镇街公司 -->
<view v-if='company_type==16'> <view v-if='company_type==41'>
<view class="info"> <view class="info">
<text>可监管车辆数量 {{datas.monitor_num}}</text> <text>可监管车辆数量 {{datas.monitor_num}}</text>
@ -397,6 +397,8 @@
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
}) })
} }

File diff suppressed because it is too large Load Diff

393
subpkg/topUp/deposit.vue Normal file
View File

@ -0,0 +1,393 @@
<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,359 +1,393 @@
<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="输入充值金额(元)" v-model="payMoney.money" /> <input v-if="priceList[changeMoney]=='自定义'" class="input" type="digit" placeholder="输入充值金额(元)"
<button class="btn" @click="pay">充值</button> v-model="payMoney.money" />
<button class="btn btn2" @click="navToRecord">充值记录</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 { recharge, payWay, payPrepay, wechatJsConfig, payStatus } from "@/api/pay.js" import {
import { userInfo } from "@/api/oaUser.js" recharge,
import { Toast } from '@/libs/uniApi.js' payWay,
import { taskShareholder } from "@/api/task.js" payPrepay,
export default { wechatJsConfig,
data() { payStatus
return { } from "@/api/pay.js"
priceList: ['10元','50元','100元','500元','1000元','5000元','10000元', '自定义'], import {
changeMoney: -1, userInfo
payMoney: { } from "@/api/oaUser.js"
money: '' import {
}, Toast
payTimer: null, } from '@/libs/uniApi.js'
timeCount: 5, import {
task_id: -1, //id,, taskShareholder
task: {} } from "@/api/task.js"
} export default {
}, data() {
// return {
onNavigationBarButtonTap(res){ priceList: ['10元', '50元', '100元', '500元', '1000元', '5000元', '10000元', '自定义'],
if (res.index === 0) { changeMoney: -1,
this.navToRecord(); payMoney: {
} money: ''
}, },
onLoad(options) { payTimer: null,
if(options.task_id){ timeCount: 5,
this.task_id=options.task_id; task_id: -1, //id,,
this.loadTask(); task: {},
} obj: "323",
}, }
methods: { },
changePrice(index){ //
if(this.changeMoney == index)this.changeMoney = -1; onNavigationBarButtonTap(res) {
else this.changeMoney = index; if (res.index === 0) {
if(this.priceList[index]=='自定义')this.payMoney.money = ''; this.navToRecord();
else this.payMoney.money = this.priceList[index].split('元')[0]; }
}, },
// onLoad(options) {
navToRecord(){ if (options.task_id) {
uni.navigateTo({ this.task_id = options.task_id;
url: '/subpkg/topUpList/topUpList' this.loadTask();
}) }
}, },
// methods: {
async loadTask(){
uni.showLoading({ aa() {
title: '加载中', return JSON.parse(this.obj)
mask: true
}) },
let res = await taskShareholder({
id: this.task_id changePrice(index) {
}); if (this.changeMoney == index) this.changeMoney = -1;
this.task = res.data; else this.changeMoney = index;
this.payMoney.money = res.data?.extend?.shareholder?.money; if (this.priceList[index] == '自定义') this.payMoney.money = '';
uni.hideLoading(); else this.payMoney.money = this.priceList[index].split('元')[0];
}, },
// //
pay(){ navToRecord() {
if(!this.payMoney.money)return Toast('请先填写充值金额!') uni.navigateTo({
if(this.payMoney.money<=0)return Toast('充值金额不能小于0!') url: '/subpkg/topUpList/topUpList'
if(this.payTimer==null){ })
this.goRecharge(); },
this.payTimer = setInterval(()=>{ //
this.timeCount--; async loadTask() {
if(this.timeCount<=0){ uni.showLoading({
clearInterval(this.payTimer); title: '加载中',
this.payTimer = null; mask: true
this.timeCount = 5; })
} let res = await taskShareholder({
}, 1000) id: this.task_id
} });
else Toast(this.timeCount+'秒后再支付!') this.task = res.data;
}, this.payMoney.money = res.data?.extend?.shareholder?.money;
goRecharge() { uni.hideLoading();
// console.log(obj); },
uni.showLoading({ //
title:'获取支付信息', pay() {
success: async () => { if (!this.payMoney.money) return Toast('请先填写充值金额!')
let queryData = { if (this.payMoney.money <= 0) return Toast('充值金额不能小于0!')
money: this.payMoney.money, if (this.payTimer == null) {
type:300 this.goRecharge();
}; this.payTimer = setInterval(() => {
if(this.task_id>0) { this.timeCount--;
queryData.task_id = this.task_id; if (this.timeCount <= 0) {
} clearInterval(this.payTimer);
let { data } = await recharge(queryData); this.payTimer = null;
let res = await payWay({ this.timeCount = 5;
order_id: data.order_id, }
from: data.from, }, 1000)
}) } else Toast(this.timeCount + '秒后再支付!')
// console.log(res); },
let res1 = await payPrepay({ goRecharge() {
from: data.from, let that = this
order_id: data.order_id, // console.log(obj);
pay_way: res.data.lists[0].pay_way uni.showLoading({
}) title: '获取支付信息',
// console.log(res1.data, res1.data.config.package.split('=')[1]); success: async () => {
let obj = { let queryData = {
"appid": res1.data.config.appId, // - - AppId AppId money: this.payMoney.money,
"noncestr": res1.data.config.nonceStr, // type: 300
"package": res1.data.config.package, // };
"partnerid": res1.data.config.partnerid, // if (this.task_id > 0) {
"prepayid": res1.data.config.package.split('=')[1], // queryData.task_id = this.task_id;
"timestamp": res1.data.config.timestamp, // }
"sign": res1.data.config.paySign let {
} data
uni.getProvider({ } = await recharge(queryData);
service: 'payment', let res = await payWay({
success: (paymentList) => { order_id: data.order_id,
// console.log(paymentList); from: data.from,
uni.hideLoading(); })
uni.showLoading({ // console.log(res);
title:'微信支付中' let res1 = await payPrepay({
}) from: data.from,
uni.requestPayment({ order_id: data.order_id,
provider: 'wxpay', pay_way: res.data.lists[0].pay_way
// orderInfo: res1.data.config, })
orderInfo: obj, // console.log(res1.data, res1.data.config.package.split('=')[1]);
success: (e) => { let obj = {
// console.log('', e); "appid": res1.data.config
uni.hideLoading(); .appId, // - - AppId AppId
payStatus({ "noncestr": res1.data.config.nonceStr, //
order_id: data.order_id, "package": res1.data.config.package, //
from: data.from, "partnerid": res1.data.config.partnerid, //
}).then((status)=>{ "prepayid": res1.data.config.package.split('=')[1], //
uni.showToast({ "timestamp": res1.data.config.timestamp, //
icon: status.data.pay_status?'success':'none', "sign": res1.data.config.paySign
title: status.data.pay_status?'支付成功':'支付失败' }
})
if(this.task_id>0){ uni.getProvider({
uni.$emit('upBuyShare'); service: 'payment',
uni.navigateBack(); success: (paymentList) => {
} // console.log(paymentList);
else{ uni.hideLoading();
userInfo().then(user=>{ uni.showLoading({
this.$store.commit('setUserInfo', user.data); title: '微信支付中'
}) })
} uni.requestPayment({
}) provider: 'wxpay',
}, // orderInfo: res1.data.config,
fail: (e) => { orderInfo: obj,
console.log(e); success: (e) => {
uni.hideLoading(); // console.log('', e);
uni.showToast({ uni.hideLoading();
icon:'error', payStatus({
title: '支付失败!' order_id: data.order_id,
}) from: data.from,
}, }).then((status) => {
complete: () => { uni.showToast({
if(this.task_id<=0)this.payMoney.money = ''; icon: status.data
}, .pay_status ?
}); 'success' : 'none',
} title: status.data
}) .pay_status ?
}, '支付成功' : '支付失败'
fail: (e) => { })
uni.showToast({ if (this.task_id > 0) {
icon:'error', uni.$emit('upBuyShare');
title:'请先安装微信' uni.navigateBack();
}) } else {
} userInfo().then(user => {
}) this.$store.commit(
} 'setUserInfo',
}, user.data);
onPullDownRefresh() { })
uni.stopPullDownRefresh() }
} })
} },
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;
}
}
}
}
.price { text:nth-child(1) {
display: flex; flex-shrink: 0;
flex-direction: column; margin-right: 18rpx;
padding: 0 28rpx; }
margin-top: 50rpx; }
}
}
.title { .price {
font-size: 32rpx; display: flex;
font-weight: 600; flex-direction: column;
color: #333333; padding: 0 28rpx;
line-height: 39rpx; margin-top: 50rpx;
margin-bottom: 42rpx;
}
.tab { .title {
display: flex; font-size: 32rpx;
flex-wrap: wrap; font-weight: 600;
justify-content: left; color: #333333;
width: 694rpx; line-height: 39rpx;
margin-bottom: 42rpx;
}
.item { .tab {
width: 217rpx; display: flex;
height: 131rpx; flex-wrap: wrap;
margin: 0 auto; justify-content: left;
margin-bottom: 20rpx; width: 694rpx;
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 { .item {
border: 2rpx solid $theme-oa-color; width: 217rpx;
color: $theme-oa-color; 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;
}
.input { .active {
width: 100%; border: 2rpx solid $theme-oa-color;
height: 112rpx; color: $theme-oa-color;
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 { .input {
width: 694rpx; width: 100%;
height: 84rpx; height: 112rpx;
margin-top: 73.6rpx; background: #F5F5F5;
background: $theme-oa-color; border-radius: 56rpx 56rpx 56rpx 56rpx;
box-shadow: 0rpx 14rpx 44rpx 2rpx #E9EFF5; opacity: 1;
border-radius: 42rpx 42rpx 42rpx 42rpx; padding: 0 45.56rpx;
display: flex; box-sizing: border-box;
justify-content: center; font-size: 28rpx;
align-items: center; font-weight: 400;
font-size: 32rpx; color: #333;
font-weight: 400; line-height: 35rpx;
color: #FFFFFF; }
}
.btn2{
background-color: #fff;
color: #333;
border: 1px solid #eee;
}
}
.tip { .btn {
display: flex; width: 694rpx;
flex-direction: column; height: 84rpx;
padding: 0 28rpx; margin-top: 73.6rpx;
margin-top: 84rpx; 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;
}
.title { .btn2 {
font-size: 32rpx; background-color: #fff;
font-weight: 500; color: #333;
color: $theme-oa-color; border: 1px solid #eee;
line-height: 32rpx; }
margin-bottom: 21rpx; }
}
.text { .tip {
font-size: 28rpx; display: flex;
font-weight: 400; flex-direction: column;
color: rgba(0, 0, 0, 0.6); padding: 0 28rpx;
line-height: 42rpx; margin-top: 84rpx;
-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,259 +1,276 @@
<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>
<u-line style="margin: 20rpx 0;"></u-line> <u-line style="margin: 20rpx 0;"></u-line>
<view class="item"> <view class="item">
<text>收款公司</text> <text>收款公司</text>
<text>{{partyA.company_name}}</text> <text>{{partyA.company_name}}</text>
</view> </view>
<view class="item" @click="copyPhone(partyA.qualification.corporate_account, '对公账号')"> <view class="item" @click="copyPhone(partyA.qualification.corporate_account, '对公账号')">
<text>对公账号</text> <text>对公账号</text>
<text>{{partyA.qualification.corporate_account||'暂无信息'}}</text> <text>{{partyA.qualification.corporate_account||'暂无信息'}}</text>
</view> </view>
</view> </view>
</view> </view>
<view class="deposit-list"> <view class="deposit-list" style="padding-top: 20px;">
<view class="card" v-for="(item, index) in list"> <view class="card" v-for="(item, index) in list">
<view class="item"><view>创建时间:</view><view class="text">{{item.create_time}}</view></view> <view class="item">
<view class="item"><view>充值金额:</view><view class="text green">{{item.deposit}}</view></view> <view>创建时间:</view>
<view class="item" @click="previewVoucher(item.voucher)"><view>充值凭证:</view><view class="text blue">查看凭证</view></view> <view class="text" style="color: black;">{{item.create_time}}</view>
</view> </view>
</view> <view class="item">
<u-empty v-if="list.length==0&&loadConfig.status=='nomore'" icon="/static/img/empty/data.png" text="没有数据"></u-empty> <view>充值金额:</view>
<u-loadmore v-else :status="loadConfig.status" :loading-text="loadConfig.loadingText" <view class="text " style="color: red;">{{item.deposit}}</view>
:loadmore-text="loadConfig.loadmoreText" :nomore-text="loadConfig.nomoreText" /> </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> </template>
<script> <script>
import { Toast } from '@/libs/uniApi.js' import {
import { getPartyACompany, getDepositRechargeTransferVoucherList } from "@/api/company.js" Toast
export default { } from '@/libs/uniApi.js'
data() { import {
return { getPartyACompany,
partyA: { getDepositRechargeTransferVoucherList
id:"", } from "@/api/company.js"
company_name:"", export default {
qualification:{ data() {
corporate_account: "" return {
} partyA: {
}, id: "",
list: [], company_name: "",
loadConfig: { qualification: {
page: 1, corporate_account: ""
limit: 15, }
lastpage: '', },
loadingText: '努力加载中', list: [],
loadmoreText: '轻轻上拉', loadConfig: {
nomoreText: '我也是有底线的~~', page: 1,
status: 'loadmore' limit: 15,
}, lastpage: '',
} loadingText: '努力加载中',
}, loadmoreText: '轻轻上拉',
// nomoreText: '我也是有底线的~~',
onNavigationBarButtonTap(res){ status: 'loadmore'
if (res.index === 0) { },
uni.navigateTo({ }
url: '/subpkg/topUpList/topUpList' },
}) //
} onNavigationBarButtonTap(res) {
}, if (res.index === 0) {
onLoad(options) { uni.navigateTo({
this.loadPartyACompany(); url: '/subpkg/topUpList/topUpList'
this.initLoad(); })
}, }
onReachBottom() { },
this.loadList() onLoad(options) {
}, this.loadPartyACompany();
methods: { this.initLoad();
async loadPartyACompany(){ },
let res = await getPartyACompany(); onReachBottom() {
if(res.data.qualification){ this.loadList()
try{ },
res.data.qualification = JSON.parse(res.data.qualification); methods: {
}catch(e){ async loadPartyACompany() {
console.log(e); let res = await getPartyACompany();
} if (res.data.qualification) {
} try {
this.partyA = res.data; res.data.qualification = JSON.parse(res.data.qualification);
if(!this.partyA.qualification.corporate_account)this.partyA.qualification.corporate_account=""; } catch (e) {
}, console.log(e);
async initLoad() { }
this.loadConfig.page = 1; }
this.loadConfig.status = "loadmore"; this.partyA = res.data;
this.list = []; if (!this.partyA.qualification.corporate_account) this.partyA.qualification.corporate_account = "";
await this.loadList(); },
}, async initLoad() {
async loadList(){ this.loadConfig.page = 1;
if (this.loadConfig.status == "nomore") return; this.loadConfig.status = "loadmore";
this.loadConfig.status = "loading"; this.list = [];
let res = await getDepositRechargeTransferVoucherList({ await this.loadList();
page: this.loadConfig.page, },
limit: this.loadConfig.limit async loadList() {
}) if (this.loadConfig.status == "nomore") return;
this.loadConfig.status = "loadmore" this.loadConfig.status = "loading";
if (res.data.data.length < this.loadConfig.limit) { let res = await getDepositRechargeTransferVoucherList({
this.loadConfig.status = "nomore" page: this.loadConfig.page,
} else { limit: this.loadConfig.limit
this.loadConfig.page++; })
} this.loadConfig.status = "loadmore"
this.list = [...this.list, ...res.data?.data] if (res.data.data.length < this.loadConfig.limit) {
}, this.loadConfig.status = "nomore"
previewVoucher(str=""){ } else {
if(str.substring(str.length-4, str.length)=='.pdf'){ // PDFPDF this.loadConfig.page++;
uni.navigateTo({ }
url: `/subpkg/pdfView/pdfView?url=${str}` this.list = [...this.list, ...res.data?.data]
}) },
}else { previewVoucher(str = "") {
uni.previewImage({ if (str.substring(str.length - 4, str.length) == '.pdf') { // PDFPDF
urls: [str], uni.navigateTo({
longPressActions: { url: `/subpkg/pdfView/pdfView?url=${str}`
itemList: ['保存图片'], })
success: function(data) { } else {
if (data.tapIndex === 0) { uni.previewImage({
uni.saveImageToPhotosAlbum({ urls: [str],
filePath: url, longPressActions: {
success: function() { itemList: ['保存图片'],
uni.showToast({ success: function(data) {
title: '保存成功', if (data.tapIndex === 0) {
icon: 'success' uni.saveImageToPhotosAlbum({
}) filePath: url,
}, success: function() {
fail: function() { uni.showToast({
uni.showToast({ title: '保存成功',
title: '保存失败', icon: 'success'
icon: 'none' })
}) },
} fail: function() {
}) uni.showToast({
} title: '保存失败',
} icon: 'none'
} })
}) }
} })
}, }
copyPhone(str = "", type = "号码") { }
if (str) uni.setClipboardData({ }
data: str + "", })
success: (e) => { }
Toast(type + '已复制') },
}, copyPhone(str = "", type = "号码") {
fail: (e) => { if (str) uni.setClipboardData({
Toast('复制失败') data: str + "",
} success: (e) => {
}) Toast(type + '已复制')
} },
}, fail: (e) => {
onPullDownRefresh() { Toast('复制失败')
this.initLoad().then(()=>{ }
setTimeout(()=>{ })
uni.stopPullDownRefresh() }
}, 500) },
}) onPullDownRefresh() {
} this.initLoad().then(() => {
} setTimeout(() => {
uni.stopPullDownRefresh()
}, 500)
})
}
}
</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: 350rpx; height: 350rpx;
.bg { .bg {
background-color: $theme-oa-color; background-color: $theme-oa-color;
height: 200rpx; height: 200rpx;
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;
}
}
}
}
.deposit-list{ text:nth-child(1) {
display: flex; flex-shrink: 0;
flex-direction: column; margin-right: 18rpx;
align-items: center; }
.card { }
width: 694rpx; }
min-height: 180rpx; }
background: #FFFFFF;
margin-bottom: 28rpx; .deposit-list {
box-shadow: 0rpx 0rpx 18rpx 2rpx rgba(50, 116, 249, 0.1); display: flex;
border-radius: 14rpx 14rpx 14rpx 14rpx; flex-direction: column;
opacity: 1; align-items: center;
padding: 31.5rpx 28rpx;
display: flex; .card {
flex-direction: column; width: 694rpx;
justify-content: space-around; min-height: 180rpx;
background: #FFFFFF;
.item{ margin-bottom: 28rpx;
font-size: 28rpx; box-shadow: 0rpx 0rpx 18rpx 2rpx rgba(50, 116, 249, 0.1);
display: flex; border-radius: 14rpx 14rpx 14rpx 14rpx;
justify-content: left; opacity: 1;
padding: 31.5rpx 28rpx;
.text{ display: flex;
margin-left: 12rpx; flex-direction: column;
color: #999; justify-content: space-around;
}
.item {
.green{ font-size: 28rpx;
color: #4cd964; display: flex;
} justify-content: left;
.blue{ .text {
color: #0122c7; margin-left: 12rpx;
} color: #999;
} }
}
} .green {
color: #4cd964;
}
.blue {
color: #0122c7;
}
}
}
}
</style> </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">

View File

@ -0,0 +1,236 @@
<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

@ -171,8 +171,11 @@
stage4: this.stage4, stage4: this.stage4,
}); });
this.other.is_commit = 1; this.other.is_commit = 1;
this.taskInfo.approve_status = 1;
Toast('提交成功'); Toast('提交成功');
uni.navigateBack(); this.$u.sleep(500).then(()=>{
uni.navigateBack()
})
}, },
showToast(str) { showToast(str) {
Toast(str) Toast(str)

View File

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

View File

@ -0,0 +1,699 @@
<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,147 +1,210 @@
<template> <template>
<view class="task_page"> <view class="task_page">
<u-skeleton v-if="skeleton" :class="{'loading': skeleton}" :animate="true" title rows="3" rows-width="92%"
rowsHeight="56"> <!-- {{taskInfo}} -->
</u-skeleton>
<block v-else> <u-skeleton v-if="skeleton" :class="{'loading': skeleton}" :animate="true" title rows="3" rows-width="92%"
<view class="card"> rowsHeight="56">
<view class="c_title">{{`任务名称: ${taskInfo.title||''}`}}</view> </u-skeleton>
<view>{{taskInfo.content||''}}</view> <block v-else>
</view> <view class="card">
<view class="card"> <view class="c_title">{{`任务名称: ${taskInfo.title||''}`}}</view>
<view class="c_title">判定条件:</view> <view>{{taskInfo.content||''}}</view>
<view style="white-space: pre-line;">{{remark}}</view> </view>
</view> <view class="card" v-if="extend_info&&extend_info.target">
</block> <view class="c_title">目标数量: {{extend_info.target}}</view>
</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> </template>
<script> <script>
import { Toast } from "../../libs/uniApi"; import {
import { townTaskDetails } from "@/api/task.js" Toast
import { dictDataListsTypeValue } from "@/api/oaPbulic.js" } from "../../libs/uniApi";
export default { import {
data() { townTaskDetails
return { } from "@/api/task.js"
taskInfo:{ import {
id: '', dictDataListsTypeValue
title: '', } from "@/api/oaPbulic.js"
content: '', export default {
extend: {} data() {
}, return {
remark: '', taskInfo: {
skeleton: true, id: '',
type_value: 'town_task_type', // title: '',
} content: '',
}, extend: {}
onLoad(options) { },
options.task_id?this.taskInfo.id=options.task_id:null; extend_info: null,
options.type_value?this.type_value=options.type_value:null; remark: '',
this.initTask(); skeleton: true,
}, type_value: 'town_task_type', //
onShow() {}, }
methods: { },
async initTask(){ onLoad(options) {
this.skeleton = true; options.task_id ? this.taskInfo.id = options.task_id : null;
let res = await townTaskDetails({ options.type_value ? this.type_value = options.type_value : null;
id: this.taskInfo.id this.initTask();
}); },
this.taskInfo = res.data; onShow() {},
let dict = await dictDataListsTypeValue({ methods: {
type_value: this.type_value async initTask() {
}) this.skeleton = true;
dict.data.forEach((item)=>{ let res = await townTaskDetails({
if(item.id==this.taskInfo.type){ id: this.taskInfo.id
this.remark = item.remark; });
} if (res.data?.template_info?.extend) {
}) if (res.data?.template_info?.extend?.goods_id && typeof res.data?.template_info?.extend
this.skeleton = false; ?.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> </script>
<style lang="scss"> <style lang="scss">
.task_page { .task_page {
padding-top: 30rpx; padding-top: 30rpx;
.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;
padding: 28rpx; padding: 28rpx;
.c_title { .c_title {
font-size: 32rpx; font-size: 32rpx;
font-weight: bold; font-weight: bold;
color: #333333; color: #333333;
margin-bottom: 20rpx; margin-bottom: 20rpx;
} }
.file { .file {
display: flex; display: flex;
justify-content: left; justify-content: left;
flex-wrap: wrap; flex-wrap: wrap;
&_item { &_item {
flex-shrink: 0; flex-shrink: 0;
width: 200rpx; width: 200rpx;
height: 200rpx; height: 200rpx;
margin: 0 auto; margin: 0 auto;
margin-bottom: 16rpx; margin-bottom: 16rpx;
border: 2px solid #ccc; border: 2px solid #ccc;
border-radius: 10rpx; border-radius: 10rpx;
overflow: hidden; overflow: hidden;
position: relative; position: relative;
.image { .image {
width: 100%; width: 100%;
height: 100%; height: 100%;
} }
.del { .del {
position: absolute; position: absolute;
height: 40rpx; height: 40rpx;
width: 40rpx; width: 40rpx;
top: 10rpx; top: 10rpx;
right: 10rpx; right: 10rpx;
} }
} }
&_btn { &_btn {
flex-shrink: 0; flex-shrink: 0;
width: 200rpx; width: 200rpx;
height: 200rpx; height: 200rpx;
margin: 0 auto; margin: 0 auto;
margin-bottom: 16rpx; margin-bottom: 16rpx;
border: 2px solid #ccc; border: 2px solid #ccc;
display: flex; display: flex;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
flex-direction: column; flex-direction: column;
border-radius: 10rpx; border-radius: 10rpx;
image { image {
width: 100rpx; width: 100rpx;
height: 100rpx; height: 100rpx;
} }
} }
&_empty { &_empty {
flex-shrink: 0; flex-shrink: 0;
width: 200rpx; width: 200rpx;
height: 200rpx; height: 200rpx;
margin: 0 auto; margin: 0 auto;
margin-bottom: 16rpx; margin-bottom: 16rpx;
border: 2px solid transparent; border: 2px solid transparent;
} }
} }
}
.store {
.loading{ display: flex;
padding: 28rpx; 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> </style>

View File

@ -0,0 +1,344 @@
<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

@ -0,0 +1,441 @@
<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

@ -0,0 +1,67 @@
## 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

@ -0,0 +1,224 @@
'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

@ -0,0 +1,667 @@
<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

@ -0,0 +1,325 @@
<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

@ -0,0 +1,292 @@
<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

@ -0,0 +1,109 @@
/**
* 获取文件名和后缀
* @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

@ -0,0 +1,83 @@
{
"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

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

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;