Compare commits
60 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
0dbbba73ed | ||
![]() |
f4c23417b2 | ||
![]() |
1e613b409c | ||
![]() |
26958ab87a | ||
![]() |
eff4c97884 | ||
![]() |
6dc0e69392 | ||
![]() |
96d2552de2 | ||
![]() |
d18961e965 | ||
![]() |
58986ff80f | ||
![]() |
b09c50e18b | ||
![]() |
df37262b5d | ||
![]() |
8bd12a9f2f | ||
![]() |
e3ed71c27b | ||
![]() |
f365d7459a | ||
![]() |
57b85ee519 | ||
![]() |
1f0ea2fe29 | ||
![]() |
dcf5a1a22f | ||
![]() |
eca744e099 | ||
![]() |
6f34382e75 | ||
![]() |
fe1e183499 | ||
![]() |
9946239502 | ||
![]() |
7d6b6db4d9 | ||
![]() |
a2d3d2e156 | ||
![]() |
e23f57f911 | ||
![]() |
41d647bbc2 | ||
![]() |
f5543a12a6 | ||
![]() |
2c2364849c | ||
![]() |
3088532b46 | ||
![]() |
a568324da6 | ||
![]() |
65aafaa6b4 | ||
![]() |
c4f9c1f7d8 | ||
![]() |
4408ac20dd | ||
![]() |
715484f773 | ||
![]() |
4a67f74e56 | ||
![]() |
2e264ab444 | ||
![]() |
0c93989f39 | ||
![]() |
ad020f8435 | ||
![]() |
47a517b653 | ||
![]() |
f5d480798b | ||
![]() |
b4449971d1 | ||
![]() |
06f22cbf2b | ||
![]() |
d00fd34336 | ||
![]() |
e3c0ae2df9 | ||
![]() |
ed540901c1 | ||
![]() |
28729caa81 | ||
![]() |
4192e6cbfd | ||
![]() |
fb84d0a7ce | ||
![]() |
bf3d93e9b8 | ||
![]() |
73aa7f8c19 | ||
![]() |
670ab6ff0b | ||
![]() |
766d0692cc | ||
![]() |
f41ebd38af | ||
![]() |
07f8628a9f | ||
![]() |
65d2c65ce0 | ||
![]() |
0508210e20 | ||
![]() |
a58553977e | ||
![]() |
cb251a9c8e | ||
![]() |
5d9a08e5e8 | ||
![]() |
ed8c00ccb2 | ||
![]() |
d80d55e6e8 |
11
App.vue
11
App.vue
@ -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
12
api/business.js
Normal 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)
|
@ -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'
|
@ -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 })
|
||||||
|
55
api/task.js
55
api/task.js
@ -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)
|
@ -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>
|
||||||
@ -46,7 +46,8 @@
|
|||||||
<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"
|
||||||
|
style="color: #ff7c32;">{{item.type_desc}}</text>
|
||||||
<text v-else="item.change_type==203">{{item.type_desc}}</text>
|
<text v-else="item.change_type==203">{{item.type_desc}}</text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@ -114,7 +115,9 @@
|
|||||||
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('暂未开放')
|
||||||
@ -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;
|
||||||
|
@ -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">店主姓名: {{goodsInfo.shop_user}}</view>
|
<view class="address">店主姓名: {{goodsInfo.shop_user}}</view>
|
||||||
<view @click.stop="callFn(goodsInfo.shop_phone)" class="address">
|
<view @click.stop="callFn(goodsInfo.shop_phone)" class="address">
|
||||||
|
@ -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="pro_list">
|
|
||||||
<text style="color: #999;width: 15vw;">
|
|
||||||
商品信息
|
|
||||||
</text>
|
|
||||||
<view>
|
|
||||||
<view class="goods_tit" v-for="(item,index) in goodsInfo.products">
|
|
||||||
<text class="goods_detil">{{item.goods_name}}</text>
|
|
||||||
<text>X{{item.product_num}}{{item.goods_unit}}</text>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
|
|
||||||
|
|
||||||
</view>
|
|
||||||
|
|
||||||
<view class="list">
|
<view class="list">
|
||||||
<text>
|
<text>
|
||||||
联系电话
|
联系电话
|
||||||
</text>
|
</text>
|
||||||
<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" color="#FF7C32"
|
<u-icon style="display: inline-block;margin-left: 5rpx;" name="phone"
|
||||||
size="22"></u-icon> {{goodsInfo.receiver_phone}}
|
color="#FF7C32" size="22"></u-icon> {{goodsInfo.receiver_phone}}
|
||||||
|
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
<view class="pro_list">
|
||||||
|
<text style="color: #999;width: 15vw;">
|
||||||
|
商品信息
|
||||||
|
</text>
|
||||||
|
<view>
|
||||||
|
<view class="goods_tit" v-for="(item,index) in goodsInfo.products" :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}}{{item.goods_unit}}</text>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</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>
|
@ -65,8 +65,7 @@
|
|||||||
</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>
|
||||||
@ -107,6 +106,9 @@
|
|||||||
import {
|
import {
|
||||||
Toast
|
Toast
|
||||||
} from '../../libs/uniApi';
|
} from '../../libs/uniApi';
|
||||||
|
import {
|
||||||
|
dictDataListsTypeValue
|
||||||
|
} from "@/api/oaPbulic.js"
|
||||||
export default {
|
export default {
|
||||||
name: "task",
|
name: "task",
|
||||||
props: {
|
props: {
|
||||||
@ -119,17 +121,52 @@
|
|||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
|
||||||
extend: {},
|
extend: {},
|
||||||
// 以下从左至右分别为: 服务部长,市场部长,负责人
|
// 以下从左至右分别为: 服务部长,市场部长,负责人
|
||||||
taskRoleTypeList: ['town_task_type', 'town_task_type_marketing_director', 'town_task_type_master'],
|
taskRoleTypeList: ['town_task_type', 'town_task_type_marketing_director', 'town_task_type_master'],
|
||||||
townServiceList: [44,45,46,47,48,49,50], // 镇农科服务部长任务
|
townServiceList: ["town_task_type_1", "town_task_type_2", "town_task_type_3", "town_task_type_4",
|
||||||
navToTownServiceList: [44,45,46,48,49,50], // 镇农科服务部长跳转/subpkg/townTask/townTask的任务 0
|
"town_task_type_5",
|
||||||
navToTownMarketList: [51,52,53,54,55,57,58,59] // 镇农科市场部长跳转/subpkg/townTask/townTask的任务 1
|
"town_task_type_7"
|
||||||
|
], // 镇农科服务部长任务
|
||||||
|
navToTownServiceList: ["town_task_type_1", "town_task_type_2", "town_task_type_3", "town_task_type_5",
|
||||||
|
"town_task_type_7"
|
||||||
|
], // 镇农科服务部长跳转/subpkg/townTask/townTask的任务 0
|
||||||
|
navToTownMarketList: ["town_task_type_marketing_director_1", "town_task_type_marketing_director_2",
|
||||||
|
"town_task_type_marketing_director_3",
|
||||||
|
"town_task_type_marketing_director_4",
|
||||||
|
"town_task_type_marketing_director_5",
|
||||||
|
"town_task_type_marketing_director_6",
|
||||||
|
"town_task_type_marketing_director_7",
|
||||||
|
"town_task_type_marketing_director_8",
|
||||||
|
"town_task_type_marketing_director_9"
|
||||||
|
], // 镇农科市场部长跳转/subpkg/townTask/townTask的任务 1
|
||||||
|
navToVillageList: ["village_task_type_1", "village_task_type_2", "village_task_type_3",
|
||||||
|
"village_task_type_7",
|
||||||
|
], // 村管理跳转/subpkg/townTask/townTask的任务 1
|
||||||
|
navToVillageListA: [
|
||||||
|
"town_task_type_master_4",
|
||||||
|
"town_task_type_master_5",
|
||||||
|
// "",
|
||||||
|
|
||||||
|
], // 村管理跳转/subpkg/townTask/townTask的任务 1
|
||||||
|
navToList: ["village_task_type_4", "village_task_type_5", "town_task_type_6", "town_task_type_master_6", ],
|
||||||
|
// 新增入股任务跳转/subpkg/townTask/villageTask6
|
||||||
|
navToVillageTask6List: ['village_task_type_8', 'town_task_type_master_2', 'town_task_type_master_7',
|
||||||
|
'town_task_type_master_8'
|
||||||
|
]
|
||||||
|
|
||||||
|
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
this.$props.datas.extend ? this.extend = this.$props.datas.extend : null;
|
this.$props.datas.extend ? this.extend = this.$props.datas.extend : null;
|
||||||
|
|
||||||
|
// 获取用户角色
|
||||||
|
// this.$store.state.app.userInfo.group_id
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
navTo(url) {
|
navTo(url) {
|
||||||
if (url) {
|
if (url) {
|
||||||
@ -146,40 +183,91 @@
|
|||||||
} else Toast('暂未开放')
|
} else Toast('暂未开放')
|
||||||
},
|
},
|
||||||
clickTask() {
|
clickTask() {
|
||||||
|
|
||||||
|
// console.log(this.navToVillageList.includes(this.$props.datas.type_value))
|
||||||
|
// return
|
||||||
if (this.isTimeInRange()) return Toast('任务正在结算中');
|
if (this.isTimeInRange()) return Toast('任务正在结算中');
|
||||||
// if ((this.$props.datas.type != 31) && this.$props.datas.status !== 2 && this.$props.datas.status !== 1) {
|
// if ((this.$props.datas.type != 31) && this.$props.datas.status !== 2 && this.$props.datas.status !== 1) {
|
||||||
// return this.$props.datas.status == 3 ? Toast('任务已完成!') : Toast('任务已结束!');
|
// return this.$props.datas.status == 3 ? Toast('任务已完成!') : Toast('任务已结束!');
|
||||||
// }
|
// }
|
||||||
if(this.navToTownServiceList.includes(this.$props.datas.type))
|
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]}`);
|
return this.navTo(
|
||||||
if(this.navToTownMarketList.includes(this.$props.datas.type))
|
`/subpkg/townTask/townTask?task_id=${this.$props.datas?.id}&type_value=${this.taskRoleTypeList[0]}`
|
||||||
return this.navTo(`/subpkg/townTask/townTask?task_id=${this.$props.datas?.id}&type_value=${this.taskRoleTypeList[1]}`);
|
);
|
||||||
switch (this.$props.datas.type) {
|
if (this.navToTownMarketList.includes(this.$props.datas.task_type_value))
|
||||||
case 31:
|
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(
|
if (this.$store.state.app.userInfo.admin_id) this.navTo(
|
||||||
`/subpkg/captain/captain?task_id=${this.$props.datas?.id}`);
|
`/subpkg/captain/captain?task_id=${this.$props.datas?.id}`);
|
||||||
else this.navTo(`/subpkg/archives/archives?task_id=${this.$props.datas?.id}`);
|
else this.navTo(`/subpkg/archives/archives?task_id=${this.$props.datas?.id}`);
|
||||||
break;
|
break;
|
||||||
case 32:
|
case "2":
|
||||||
this.navTo(`/subpkg/property/vehicle?task_id=${this.$props.datas?.id}`);
|
this.navTo(`/subpkg/property/vehicle?task_id=${this.$props.datas?.id}`);
|
||||||
break;
|
break;
|
||||||
case 33:
|
case "3":
|
||||||
let is_show = true;
|
let is_show = true;
|
||||||
if (uni.$u.timeFormat(Date.now(), 'yyyy-mm-dd') != this.$props.datas?.end_time) is_show = false;
|
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}`);
|
this.navTo(
|
||||||
|
`/subpkg/blockTransaction/blockTransaction?task_id=${this.$props.datas?.id}&is_show=${is_show}`
|
||||||
|
);
|
||||||
break;
|
break;
|
||||||
case 34:
|
case "4":
|
||||||
this.navTo(`/subpkg/otherTask/otherTask?task_id=${this.$props.datas?.id}`);
|
this.navTo(`/subpkg/otherTask/otherTask?task_id=${this.$props.datas?.id}`);
|
||||||
break;
|
break;
|
||||||
case 35:
|
case "5":
|
||||||
this.navTo(`/subpkg/buyShare/buyShare?task_id=${this.$props.datas?.id}`);
|
this.navTo(`/subpkg/buyShare/buyShare?task_id=${this.$props.datas?.id}`);
|
||||||
break;
|
break;
|
||||||
case 47:
|
case "town_task_type_4":
|
||||||
this.navTo(`/subpkg/townTask/serviceTask4?task_id=${this.$props.datas?.id}`);
|
this.navTo(`/subpkg/townTask/serviceTask4?task_id=${this.$props.datas?.id}`);
|
||||||
break;
|
break;
|
||||||
case 60:
|
case "town_task_type_marketing_director_10":
|
||||||
this.navTo(`/subpkg/townTask/marketTask10?task_id=${this.$props.datas?.id}&stage=${this.$props.datas?.stage}`);
|
this.navTo(
|
||||||
|
`/subpkg/townTask/marketTask10?task_id=${this.$props.datas?.id}&stage=${this.$props.datas?.stage}`
|
||||||
|
);
|
||||||
break;
|
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:
|
default:
|
||||||
this.navTo('');
|
this.navTo('');
|
||||||
break;
|
break;
|
||||||
|
245
components/task/taskitemA.vue
Normal file
245
components/task/taskitemA.vue
Normal 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>
|
237
components/task/taskitemB.vue
Normal file
237
components/task/taskitemB.vue
Normal 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>
|
@ -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' //测试
|
||||||
|
@ -3,14 +3,17 @@
|
|||||||
// "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,
|
||||||
|
"compatible": {
|
||||||
|
"ignoreVersion": true //true表示忽略版本检查提示框,HBuilderX1.9.0及以上版本支持
|
||||||
|
},
|
||||||
// "statusbar": {
|
// "statusbar": {
|
||||||
// "immersed": false
|
// "immersed": false
|
||||||
// },
|
// },
|
||||||
@ -91,7 +94,8 @@
|
|||||||
"urlschemewhitelist": ["iosamap"]
|
"urlschemewhitelist": ["iosamap"]
|
||||||
},
|
},
|
||||||
"splashscreen": {
|
"splashscreen": {
|
||||||
"useOriginalMsgbox" : true
|
"useOriginalMsgbox": false,
|
||||||
|
"androidStyle": "common"
|
||||||
},
|
},
|
||||||
"icons": {
|
"icons": {
|
||||||
"android": {
|
"android": {
|
||||||
|
113
pages.json
113
pages.json
@ -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": [{
|
||||||
|
"id": "map", // 唯一标识
|
||||||
|
"path": "pages/logistics/mask", // 页面路径
|
||||||
|
//样式
|
||||||
"style": {
|
"style": {
|
||||||
"navigationBarTitleText": "配送信息",
|
"position": "absolute",
|
||||||
"enablePullDownRefresh": false,
|
"width": "750rpx",
|
||||||
"navigationBarBackgroundColor": "#0122C7",
|
"height": "600rpx",
|
||||||
"navigationBarTextStyle": "white"
|
|
||||||
|
"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": {
|
||||||
|
@ -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 {
|
||||||
|
skeleton: false,
|
||||||
loadConfig:{
|
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{
|
||||||
|
padding-top: 28rpx;
|
||||||
|
}
|
||||||
|
.loading{
|
||||||
|
padding: 28rpx;
|
||||||
|
margin-top: 28rpx;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
91
pages/business/detail.vue
Normal file
91
pages/business/detail.vue
Normal 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>
|
@ -12,6 +12,7 @@
|
|||||||
:latitude="markers[0].latitude" :enable-scroll="true" :longitude="markers[0].longitude">
|
:latitude="markers[0].latitude" :enable-scroll="true" :longitude="markers[0].longitude">
|
||||||
<cover-image class="map_btn" @tap="test" src="../../static/img/logistics/DH.png">
|
<cover-image class="map_btn" @tap="test" src="../../static/img/logistics/DH.png">
|
||||||
</cover-image>
|
</cover-image>
|
||||||
|
|
||||||
</map>
|
</map>
|
||||||
<view class="map_address">
|
<view class="map_address">
|
||||||
<view style="display: flex;">
|
<view style="display: flex;">
|
||||||
@ -43,32 +44,42 @@
|
|||||||
<view>
|
<view>
|
||||||
店铺地址: {{goodsDetil.logistics.shop_address}}
|
店铺地址: {{goodsDetil.logistics.shop_address}}
|
||||||
</view>
|
</view>
|
||||||
|
<view style="margin-top: 10px;">
|
||||||
|
订单备注: {{goodsDetil.logistics.mark}}
|
||||||
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view class="mark">
|
<view class="mark">
|
||||||
请详细核对订单信息
|
请详细核对订单信息
|
||||||
|
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view class="order_info" style="background-color: #47BE62;">
|
<view class="order_info" style="background-color: #47BE62;">
|
||||||
<view class="top">
|
<view class="top">
|
||||||
<view>
|
<view>
|
||||||
物流信息:
|
物流信息:
|
||||||
</view>
|
</view>
|
||||||
<view>用户名称: {{fuzzyName( goodsDetil.logistics.receiver_name)}}</view>
|
<view>用户名称: {{fuzzyName( goodsDetil.logistics.receiver_name)}}</view>
|
||||||
|
<view @click.stop="callFn(goodsDetil.logistics.shop_phone)">
|
||||||
|
联系电话: <u-icon style="display: inline-block;margin-left: 5rpx;" name="phone"
|
||||||
|
color="#fff" size="22"></u-icon>{{goodsDetil.logistics.shop_phone}}
|
||||||
|
</view>
|
||||||
<view>
|
<view>
|
||||||
通知时间: {{goodsDetil.logistics.create_time}}
|
联系地址: {{goodsDetil.logistics.receiver_address}}
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view>
|
||||||
|
下单时间: {{goodsDetil.logistics.create_time}}
|
||||||
</view>
|
</view>
|
||||||
<view class="pro_list">
|
<view class="pro_list">
|
||||||
|
<view class="goods">
|
||||||
<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>
|
||||||
|
<text style="flex: 7;">{{item.goods_name}}</text>
|
||||||
|
<text style="flex: 1;">X{{item.product_num}}</text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@ -78,6 +89,8 @@
|
|||||||
<text>请详细核对订单信息</text>
|
<text>请详细核对订单信息</text>
|
||||||
<text style="color: #0122C7;">共计{{goodsDetil.product_count}}件商品</text>
|
<text style="color: #0122C7;">共计{{goodsDetil.product_count}}件商品</text>
|
||||||
</view>
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="">
|
||||||
|
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
@ -91,7 +104,16 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
<!-- 弹窗 -->
|
||||||
|
<u-overlay :show="showToast" @click="offMaskFn">
|
||||||
|
<view class="warp">
|
||||||
|
<view class="rect">
|
||||||
|
<view class="cont">
|
||||||
|
骑手送货完成
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</u-overlay>
|
||||||
|
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
@ -109,12 +131,14 @@
|
|||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
showToast: false,
|
||||||
is_captain: 0,
|
is_captain: 0,
|
||||||
mapClass: 'custom-map',
|
mapClass: 'custom-map',
|
||||||
showLoading: true,
|
showLoading: true,
|
||||||
showPop: false,
|
showPop: false,
|
||||||
goodsDetil: undefined,
|
goodsDetil: undefined,
|
||||||
scale: 17,
|
scale: 17,
|
||||||
|
subNVue: null,
|
||||||
nowAddress: "无",
|
nowAddress: "无",
|
||||||
markers: [
|
markers: [
|
||||||
// 商家
|
// 商家
|
||||||
@ -251,14 +275,7 @@
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
showToast() {
|
|
||||||
this.$refs.uToast.show({
|
|
||||||
type: 'success',
|
|
||||||
title: '成功主题(带图标)',
|
|
||||||
message: "操作成功",
|
|
||||||
iconUrl: 'https://cdn.uviewui.com/uview/demo/toast/success.png'
|
|
||||||
})
|
|
||||||
},
|
|
||||||
mapFun() {
|
mapFun() {
|
||||||
uni.openLocation({
|
uni.openLocation({
|
||||||
latitude: Number(this.goodsDetil.logistics.shop_lat),
|
latitude: Number(this.goodsDetil.logistics.shop_lat),
|
||||||
@ -268,14 +285,7 @@
|
|||||||
scale: 15,
|
scale: 15,
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
showToast() {
|
|
||||||
this.$refs.uToast.show({
|
|
||||||
type: 'success',
|
|
||||||
title: '成功主题(带图标)',
|
|
||||||
message: "操作成功",
|
|
||||||
iconUrl: 'https://cdn.uviewui.com/uview/demo/toast/success.png'
|
|
||||||
})
|
|
||||||
},
|
|
||||||
getDriverLine() {
|
getDriverLine() {
|
||||||
const that = this;
|
const that = this;
|
||||||
const key = "997c9a3d88154fa78f4d28bebc1dd84f";
|
const key = "997c9a3d88154fa78f4d28bebc1dd84f";
|
||||||
@ -319,11 +329,18 @@
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
|
offMaskFn() {
|
||||||
|
this.showToast = false
|
||||||
|
this.subNVue.hide()
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
qrqodeFn() {
|
qrqodeFn() {
|
||||||
|
// uni.navigateBack()
|
||||||
|
// return
|
||||||
let that = this
|
let that = this
|
||||||
|
console.log(6666)
|
||||||
uni.scanCode({
|
uni.scanCode({
|
||||||
onlyFromCamera: true,
|
onlyFromCamera: true,
|
||||||
success: function(res) {
|
success: function(res) {
|
||||||
@ -333,15 +350,23 @@
|
|||||||
},
|
},
|
||||||
// 取货{}
|
// 取货{}
|
||||||
takeGood(sn) {
|
takeGood(sn) {
|
||||||
|
console.log(takeGoods)
|
||||||
takeGoods({
|
takeGoods({
|
||||||
logistics_id: this.goodsDetil.logistics.id,
|
logistics_id: this.goodsDetil.logistics.id,
|
||||||
order_id: this.goodsDetil.logistics.order_id,
|
order_id: this.goodsDetil.logistics.order_id,
|
||||||
order_sn: sn
|
order_sn: sn
|
||||||
}).then(res => {
|
}).then((res, err) => {
|
||||||
this.showToast()
|
this.showToast = true
|
||||||
|
this.subNVue.show(300)
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
|
this.showToast = false
|
||||||
|
this.subNVue.hide()
|
||||||
uni.navigateBack()
|
uni.navigateBack()
|
||||||
}, 1000)
|
}, 1000)
|
||||||
|
}).catch(err => {
|
||||||
|
Toast(err.msg)
|
||||||
|
// console.log(err, 65656)
|
||||||
|
|
||||||
})
|
})
|
||||||
|
|
||||||
},
|
},
|
||||||
@ -361,6 +386,10 @@
|
|||||||
}, 500)
|
}, 500)
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
onShow() {
|
||||||
|
this.subNVue = uni.getSubNVueById('map');
|
||||||
|
this.subNVue.hide()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
@ -443,9 +472,10 @@
|
|||||||
flex: 8;
|
flex: 8;
|
||||||
margin: 0;
|
margin: 0;
|
||||||
|
|
||||||
.goods_tit {
|
.goods-tit {
|
||||||
margin: 0;
|
margin: 0;
|
||||||
display: flex;
|
display: flex;
|
||||||
|
justify-content: space-around;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -463,4 +493,30 @@
|
|||||||
transform: translateX(-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>
|
</style>
|
@ -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({
|
||||||
|
@ -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) ||"顾客姓名"}}: {{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>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="list">
|
||||||
|
<text>
|
||||||
|
店主姓名:
|
||||||
|
</text>
|
||||||
<view>
|
<view>
|
||||||
{{goodsDetil.logistics.shop_name||"商家电话"}}
|
|
||||||
: {{goodsDetil.logistics.shop_phone||"商家电话"}}
|
|
||||||
</view>
|
|
||||||
<view>
|
<view>
|
||||||
{{goodsDetil.record[1].create_time}}
|
{{goodsDetil.logistics.shop_user}}
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</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,6 +219,12 @@
|
|||||||
|
|
||||||
<!-- 已取货 -->
|
<!-- 已取货 -->
|
||||||
<view class="left" v-if="goodsDetil.logistics.status==1">
|
<view class="left" v-if="goodsDetil.logistics.status==1">
|
||||||
|
<view class="list">
|
||||||
|
<text>
|
||||||
|
收货详情:
|
||||||
|
</text>
|
||||||
|
|
||||||
|
</view>
|
||||||
<view class="list">
|
<view class="list">
|
||||||
<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>
|
8
pages/logistics/mask.nvue
Normal file
8
pages/logistics/mask.nvue
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
<template>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style>
|
||||||
|
</style>
|
@ -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'
|
||||||
})
|
})
|
||||||
|
@ -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>
|
|
@ -4,8 +4,11 @@
|
|||||||
<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}} -->
|
||||||
|
|
||||||
|
<u-tabs style="background-color: #fff;" :list="typeTabLists" @click="changeTypeCurrent" lineColor='#0022C7'
|
||||||
|
lineWidth='40' inactiveStyle='color:#0022C7' activeStyle="color:#0022C7"></u-tabs>
|
||||||
<view v-if="check_status==2||check_status==3" class="p_list">
|
<view v-if="check_status==2||check_status==3" class="p_list">
|
||||||
<block v-for="(item,index) in list" :key="index">
|
<block v-for="(item,index) in list" :key="index">
|
||||||
<merchantAudit :datas="item"></merchantAudit>
|
<merchantAudit :datas="item"></merchantAudit>
|
||||||
@ -19,8 +22,13 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { Toast } from '@/libs/uniApi.js'
|
import {
|
||||||
import { approveLists, approveTypes } from "@/api/approve.js"
|
Toast
|
||||||
|
} from '@/libs/uniApi.js'
|
||||||
|
import {
|
||||||
|
approveLists,
|
||||||
|
approveTypes
|
||||||
|
} from "@/api/approve.js"
|
||||||
import merchantAudit from '@/components/merchantAudit/merchantAudit.vue'
|
import merchantAudit from '@/components/merchantAudit/merchantAudit.vue'
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
@ -137,6 +145,7 @@
|
|||||||
.all_box {
|
.all_box {
|
||||||
padding-bottom: 21rpx;
|
padding-bottom: 21rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.p_list {
|
.p_list {
|
||||||
padding-top: 28rpx;
|
padding-top: 28rpx;
|
||||||
}
|
}
|
||||||
|
@ -4,39 +4,25 @@
|
|||||||
<!-- <u-navbar @leftClick="leftClick" bgColor="rgba(0,0,0,0)"
|
<!-- <u-navbar @leftClick="leftClick" bgColor="rgba(0,0,0,0)"
|
||||||
leftIconColor=" #fff" :autoBack="false">
|
leftIconColor=" #fff" :autoBack="false">
|
||||||
</u-navbar> -->
|
</u-navbar> -->
|
||||||
<view
|
<view class="home_header" :class="!ApproveList.length > 0 ? 'home_header_no_data' : ''">
|
||||||
class="home_header"
|
<view style="
|
||||||
:class="!ApproveList.length > 0 ? 'home_header_no_data' : ''"
|
|
||||||
>
|
|
||||||
<view
|
|
||||||
style="
|
|
||||||
position: absolute;
|
position: absolute;
|
||||||
bottom: 0;
|
bottom: 0;
|
||||||
left: 0;
|
left: 0;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
border-radius: 0 0 30rpx 30rpx;
|
border-radius: 0 0 30rpx 30rpx;
|
||||||
"
|
">
|
||||||
>
|
<hx-lottie :options="options" ref="lottie" style="
|
||||||
<hx-lottie
|
|
||||||
:options="options"
|
|
||||||
ref="lottie"
|
|
||||||
style="
|
|
||||||
width: 100vw;
|
width: 100vw;
|
||||||
height: 440rpx;
|
height: 440rpx;
|
||||||
transform: scale(1.2);
|
transform: scale(1.2);
|
||||||
background-color: #0122c7;
|
background-color: #0122c7;
|
||||||
"
|
" />
|
||||||
/>
|
|
||||||
</view>
|
</view>
|
||||||
<!-- #ifdef APP-PLUS||H5 -->
|
<!-- #ifdef APP-PLUS||H5 -->
|
||||||
<view style="height: var(--status-bar-height)"></view>
|
<view style="height: var(--status-bar-height)"></view>
|
||||||
<view v-if="uniMP" style="height: 44px">
|
<view v-if="uniMP" style="height: 44px">
|
||||||
<u-icon
|
<u-icon name="arrow-left" color="#fff" size="20" @click="leftClick"></u-icon>
|
||||||
name="arrow-left"
|
|
||||||
color="#fff"
|
|
||||||
size="20"
|
|
||||||
@click="leftClick"
|
|
||||||
></u-icon>
|
|
||||||
</view>
|
</view>
|
||||||
<view v-else style="height: 30rpx"></view>
|
<view v-else style="height: 30rpx"></view>
|
||||||
<!-- <view v-if="uniMP" style="height: 44px;"></view> -->
|
<!-- <view v-if="uniMP" style="height: 44px;"></view> -->
|
||||||
@ -50,46 +36,30 @@
|
|||||||
</view>
|
</view>
|
||||||
<view class="head_img">
|
<view class="head_img">
|
||||||
<view class="img_box">
|
<view class="img_box">
|
||||||
<u--image
|
<u--image :showLoading="true" width="131.43rpx" height="131.43rpx" class="img_box_img"
|
||||||
:showLoading="true"
|
:src="myOaInfo.avatar || '../../static/img/public/avatar.png'" shape="circle"></u--image>
|
||||||
width="131.43rpx"
|
|
||||||
height="131.43rpx"
|
|
||||||
class="img_box_img"
|
|
||||||
:src="myOaInfo.avatar || '../../static/img/public/avatar.png'"
|
|
||||||
shape="circle"
|
|
||||||
></u--image>
|
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<text class="head_text">工作证: {{ myOaInfo.nickname }}</text>
|
<text class="head_text">工作证: {{ myOaInfo.nickname }}</text>
|
||||||
<text class="head_text" style="flex-shrink: 0"
|
<text class="head_text" style="flex-shrink: 0">身份: {{ myOaInfo.admin_id ? "管理员" : "普通用户" }}</text>
|
||||||
>身份: {{ myOaInfo.admin_id ? "管理员" : "普通用户" }}</text
|
|
||||||
>
|
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<!-- 占位 -->
|
<!-- 占位 -->
|
||||||
<view style="height: 150rpx"></view>
|
<view style="height: 150rpx"></view>
|
||||||
|
|
||||||
<view
|
<view class="backlog" :class="!ApproveList.length > 0 ? 'backlog_no_data' : ''">
|
||||||
class="backlog"
|
|
||||||
:class="!ApproveList.length > 0 ? 'backlog_no_data' : ''"
|
|
||||||
>
|
|
||||||
<view class="head_title flex_a_c_j_sb">
|
<view class="head_title flex_a_c_j_sb">
|
||||||
<view class="title">公告列表</view>
|
<view class="title">公告列表</view>
|
||||||
<view class="flex_a_c" @click="navTo('/subpkg/noticeList/noticeList')"
|
<view class="flex_a_c" @click="navTo('/subpkg/noticeList/noticeList')">更多
|
||||||
>更多
|
|
||||||
<view class="iconfont icon-you">
|
<view class="iconfont icon-you">
|
||||||
<uni-icons type="forward"></uni-icons>
|
<uni-icons type="forward"></uni-icons>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<block v-if="ApproveList.length > 0">
|
<block v-if="ApproveList.length > 0">
|
||||||
<view
|
<view class="backlog_item flex_a_c_j_sb" v-for="(item, index) in ApproveList.slice(0, 2)"
|
||||||
class="backlog_item flex_a_c_j_sb"
|
:key="index" @click="clickNotice(item.id)">
|
||||||
v-for="(item, index) in ApproveList.slice(0, 2)"
|
|
||||||
:key="index"
|
|
||||||
@click="clickNotice(item.id)"
|
|
||||||
>
|
|
||||||
<view class="text">
|
<view class="text">
|
||||||
<text class="text_time">{{
|
<text class="text_time">{{
|
||||||
item.create_time.substring(0, 10).replace(/-/g, ".")
|
item.create_time.substring(0, 10).replace(/-/g, ".")
|
||||||
@ -97,23 +67,20 @@
|
|||||||
{{ item.title }}
|
{{ item.title }}
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<i class="iconfont icon-you"
|
<i class="iconfont icon-you"><uni-icons type="forward"></uni-icons></i>
|
||||||
><uni-icons type="forward"></uni-icons
|
|
||||||
></i>
|
|
||||||
</view>
|
</view>
|
||||||
</block>
|
</block>
|
||||||
<view v-else class="backlog_no flex_a_c_j_sb">
|
<view v-else class="backlog_no flex_a_c_j_sb">
|
||||||
<view class="text">暂无更多消息</view>
|
<view class="text">暂无更多消息</view>
|
||||||
<i class="iconfont icon-you"
|
<i class="iconfont icon-you"><uni-icons type="forward"></uni-icons></i>
|
||||||
><uni-icons type="forward"></uni-icons
|
|
||||||
></i>
|
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<!-- 片区经理聊天 -->
|
<!-- 片区经理聊天 -->
|
||||||
<!-- <view class="chat" @click="navTo('/subpkg/chatMang/index')" style="margin-top: 130rpx;">
|
<view class="chat" @click="navTo('/subpkg/chatMang/index')" style="margin-top: 130rpx;">
|
||||||
<view class="chat-l">
|
<view class="chat-l">
|
||||||
<u--image shape="circle" :showLoading="true" :src="managerInfo.manager_avatar" width="91rpx" height="91rpx"></u--image>
|
<u--image shape="circle" :showLoading="true" :src="managerInfo.manager_avatar" width="91rpx"
|
||||||
|
height="91rpx"></u--image>
|
||||||
<view class="" style="margin-left: 40rpx;">
|
<view class="" style="margin-left: 40rpx;">
|
||||||
{{managerInfo.manager_name}}
|
{{managerInfo.manager_name}}
|
||||||
</view>
|
</view>
|
||||||
@ -127,7 +94,7 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
</view> -->
|
</view>
|
||||||
|
|
||||||
<view class="my_task">
|
<view class="my_task">
|
||||||
<view class="task_title flex_a_c_j_sb">
|
<view class="task_title flex_a_c_j_sb">
|
||||||
@ -144,11 +111,7 @@
|
|||||||
<view class="fast_track">
|
<view class="fast_track">
|
||||||
<block v-for="(item, index) in oaHomeData" :key="item.id">
|
<block v-for="(item, index) in oaHomeData" :key="item.id">
|
||||||
<view class="track_item" @click="navTwo(item.paths, index)">
|
<view class="track_item" @click="navTwo(item.paths, index)">
|
||||||
<image
|
<image :src="item.icon" mode="aspectFit" style="width: 77rpx;height: 77rpx;">
|
||||||
:src="item.icon"
|
|
||||||
mode="aspectFit"
|
|
||||||
style="width: 77rpx;height: 77rpx;"
|
|
||||||
>
|
|
||||||
</image>
|
</image>
|
||||||
<view class="title">{{ item.name }}</view>
|
<view class="title">{{ item.name }}</view>
|
||||||
</view>
|
</view>
|
||||||
@ -158,8 +121,7 @@
|
|||||||
<view class="my_task">
|
<view class="my_task">
|
||||||
<view class="task_title flex_a_c_j_sb">
|
<view class="task_title flex_a_c_j_sb">
|
||||||
<view class="title">配送信息</view>
|
<view class="title">配送信息</view>
|
||||||
<view class="flex_a_c" @click="goOrderList"
|
<view class="flex_a_c" @click="goOrderList">更多
|
||||||
>更多
|
|
||||||
<view class="iconfont icon-you">
|
<view class="iconfont icon-you">
|
||||||
<uni-icons type="forward"></uni-icons>
|
<uni-icons type="forward"></uni-icons>
|
||||||
</view>
|
</view>
|
||||||
@ -168,20 +130,14 @@
|
|||||||
|
|
||||||
<view v-if="orderList.length > 0">
|
<view v-if="orderList.length > 0">
|
||||||
<globalPopup ref="globalPopup"></globalPopup>
|
<globalPopup ref="globalPopup"></globalPopup>
|
||||||
<logistiBriefCard
|
<logistiBriefCard v-for="(item, index) in orderList" :key="index" :goodsInfo="item">
|
||||||
v-for="(item, index) in orderList"
|
|
||||||
:key="index"
|
|
||||||
:goodsInfo="item"
|
|
||||||
>
|
|
||||||
</logistiBriefCard>
|
</logistiBriefCard>
|
||||||
<u-loadmore :status="status" />
|
<u-loadmore :status="status" />
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view v-else class="no_task">
|
<view v-else class="no_task">
|
||||||
<view class="title">暂无配送信息</view>
|
<view class="title">暂无配送信息</view>
|
||||||
<view class="tips" v-if="!$store.state.app.token"
|
<view class="tips" v-if="!$store.state.app.token">登录后查看配送信息详情</view>
|
||||||
>登录后查看配送信息详情</view
|
|
||||||
>
|
|
||||||
</view>
|
</view>
|
||||||
<!-- <view class="head_title flex_a_c_j_sb">
|
<!-- <view class="head_title flex_a_c_j_sb">
|
||||||
<view class="">我的任务</view>
|
<view class="">我的任务</view>
|
||||||
@ -314,7 +270,14 @@ export default {
|
|||||||
};
|
};
|
||||||
},
|
},
|
||||||
async onLoad() {
|
async onLoad() {
|
||||||
|
// console.log('asdashg')
|
||||||
|
if (uni.getStorageSync('USER_INFO')) {
|
||||||
|
let userData = JSON.parse(uni.getStorageSync('USER_INFO'))
|
||||||
|
|
||||||
|
this.initUserInfo(userData);
|
||||||
|
// console.log(545)
|
||||||
|
}
|
||||||
|
console.log(7787878)
|
||||||
await this.$onLaunched;
|
await this.$onLaunched;
|
||||||
this.is_captain = JSON.parse(uni.getStorageSync("USER_INFO") || '{}')?.is_captain
|
this.is_captain = JSON.parse(uni.getStorageSync("USER_INFO") || '{}')?.is_captain
|
||||||
this.options.data = bj;
|
this.options.data = bj;
|
||||||
@ -330,6 +293,10 @@ export default {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
// #endif
|
// #endif
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
},
|
},
|
||||||
onReachBottom() {
|
onReachBottom() {
|
||||||
if (this.flag) return
|
if (this.flag) return
|
||||||
@ -358,9 +325,16 @@ export default {
|
|||||||
// }
|
// }
|
||||||
// this.getUserIndex()
|
// this.getUserIndex()
|
||||||
// this.getIndexList()
|
// this.getIndexList()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
let user_id = JSON.parse(uni.getStorageSync("USER_INFO")).id
|
let user_id = JSON.parse(uni.getStorageSync("USER_INFO")).id
|
||||||
getAreaManagerApi({user_id}).then(res=>{
|
this.getOrderList();
|
||||||
console.log(res.data)
|
console.log("show")
|
||||||
|
getAreaManagerApi({
|
||||||
|
user_id
|
||||||
|
}).then(res => {
|
||||||
|
// console.log(res.data)
|
||||||
this.managerInfo = res.data
|
this.managerInfo = res.data
|
||||||
})
|
})
|
||||||
await this.$onLaunched;
|
await this.$onLaunched;
|
||||||
@ -377,7 +351,6 @@ export default {
|
|||||||
this.initUserInfo();
|
this.initUserInfo();
|
||||||
this.showToask();
|
this.showToask();
|
||||||
// this.initOaHomeDada();
|
// this.initOaHomeDada();
|
||||||
this.getOrderList();
|
|
||||||
//#ifdef APP-PLUS
|
//#ifdef APP-PLUS
|
||||||
this.noticeFn();
|
this.noticeFn();
|
||||||
// #endif
|
// #endif
|
||||||
@ -426,6 +399,7 @@ export default {
|
|||||||
const route = '/pages/oaHome/oaHome';
|
const route = '/pages/oaHome/oaHome';
|
||||||
let arr = [];
|
let arr = [];
|
||||||
n.forEach((item) => {
|
n.forEach((item) => {
|
||||||
|
|
||||||
if (item.paths.includes(route)) {
|
if (item.paths.includes(route)) {
|
||||||
arr = item.children;
|
arr = item.children;
|
||||||
}
|
}
|
||||||
@ -476,6 +450,7 @@ export default {
|
|||||||
// courier_id: 167
|
// courier_id: 167
|
||||||
});
|
});
|
||||||
this.orderList = res.data.data;
|
this.orderList = res.data.data;
|
||||||
|
console.log("获取列表")
|
||||||
},
|
},
|
||||||
goOrderList() {
|
goOrderList() {
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
@ -1001,6 +976,7 @@ export default {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.chat {
|
.chat {
|
||||||
margin-top: 1000px;
|
margin-top: 1000px;
|
||||||
// margin-top: 2000rpx;
|
// margin-top: 2000rpx;
|
||||||
@ -1014,11 +990,13 @@ export default {
|
|||||||
display: flex;
|
display: flex;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
|
||||||
.chat-l {
|
.chat-l {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.brange {
|
.brange {
|
||||||
color: white;
|
color: white;
|
||||||
background-color: red;
|
background-color: red;
|
||||||
|
@ -1,15 +1,27 @@
|
|||||||
<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-tabs style="background-color: #0022C7;" :list="tabLists" @click="changeTypeCurrent" lineColor='white'
|
||||||
|
lineWidth='30' inactiveStyle='color:white' activeStyle="color:white"></u-tabs>
|
||||||
<u-empty v-if="list.length==0" icon="/static/img/empty/data.png" text="没有任务"></u-empty>
|
<u-empty v-if="list.length==0" icon="/static/img/empty/data.png" text="没有任务"></u-empty>
|
||||||
|
|
||||||
<view v-else class="task_list">
|
<view v-else class="task_list">
|
||||||
|
|
||||||
|
|
||||||
<!-- <taskCard class="task_card" v-for="item in 10" :key="item"></taskCard> -->
|
<!-- <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 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>
|
</view>
|
||||||
</block>
|
</block>
|
||||||
<!-- <u-loadmore v-else :status="loadConfig.status" :loading-text="loadConfig.loadingText"
|
<!-- <u-loadmore v-else :status="loadConfig.status" :loading-text="loadConfig.loadingText"
|
||||||
@ -18,17 +30,35 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { getTaskListApi } from '@/api/oa'
|
import {
|
||||||
import { Toast } from '@/libs/uniApi.js'
|
getTaskListApi
|
||||||
|
} from '@/api/oa'
|
||||||
|
import {
|
||||||
|
Toast
|
||||||
|
} from '@/libs/uniApi.js'
|
||||||
import taskItem from "@/components/task/taskItem.vue"
|
import taskItem from "@/components/task/taskItem.vue"
|
||||||
import { taskLists } from "@/api/task.js"
|
import {
|
||||||
|
taskLists
|
||||||
|
} from "@/api/task.js"
|
||||||
|
import {
|
||||||
|
dictDataListsTypeValue
|
||||||
|
} from "@/api/oaPbulic.js"
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
taskItem
|
taskItem
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
status: 2,
|
||||||
skeleton: false,
|
skeleton: false,
|
||||||
|
baseList: [],
|
||||||
|
tabLists: [{
|
||||||
|
name: '进行中',
|
||||||
|
id: 2
|
||||||
|
}, {
|
||||||
|
name: '已完成',
|
||||||
|
id: 3
|
||||||
|
}, ],
|
||||||
loadConfig: {
|
loadConfig: {
|
||||||
page: 1,
|
page: 1,
|
||||||
limit: 15,
|
limit: 15,
|
||||||
@ -38,31 +68,56 @@
|
|||||||
nomoreText: '我也是有底线的~~',
|
nomoreText: '我也是有底线的~~',
|
||||||
status: 'loadmore'
|
status: 'loadmore'
|
||||||
},
|
},
|
||||||
list: []
|
list: [],
|
||||||
|
taskValueList: [],
|
||||||
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onLoad() {
|
onLoad() {
|
||||||
this.skeleton = true;
|
this.skeleton = true;
|
||||||
|
|
||||||
},
|
},
|
||||||
onShow() {
|
onShow() {
|
||||||
this.loadList();
|
this.loadList();
|
||||||
|
// this.getTaskValue()
|
||||||
},
|
},
|
||||||
onReady() {
|
onReady() {
|
||||||
uni.$on('initOaTask', this.loadList);
|
uni.$on('initOaTask', this.loadList);
|
||||||
},
|
},
|
||||||
methods: {
|
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() {
|
async loadList() {
|
||||||
let res = await taskLists({limit: 15, page: 1});
|
let res = await taskLists({
|
||||||
|
limit: 15,
|
||||||
|
page: 1
|
||||||
|
});
|
||||||
this.list = res.data;
|
this.list = res.data;
|
||||||
|
this.baseList = this.list.filter(item => item.status == this.status)
|
||||||
|
|
||||||
this.skeleton = false;
|
this.skeleton = false;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onPullDownRefresh() {
|
onPullDownRefresh() {
|
||||||
this.loadList();
|
this.loadList();
|
||||||
this.$u.sleep(500).then(()=>{uni.stopPullDownRefresh()});
|
this.$u.sleep(500).then(() => {
|
||||||
},
|
uni.stopPullDownRefresh()
|
||||||
onReachBottom() {
|
});
|
||||||
},
|
},
|
||||||
|
onReachBottom() {},
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
@ -70,6 +125,7 @@
|
|||||||
.task_list {
|
.task_list {
|
||||||
padding-top: 28rpx;
|
padding-top: 28rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.loading {
|
.loading {
|
||||||
padding: 28rpx;
|
padding: 28rpx;
|
||||||
margin-top: 28rpx;
|
margin-top: 28rpx;
|
||||||
|
@ -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();
|
||||||
|
@ -4,7 +4,9 @@
|
|||||||
<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">入股金额:
|
||||||
|
{{task.extend.shareholder.money}}元
|
||||||
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="card">
|
<view class="card">
|
||||||
<view class="title">任务描述</view>
|
<view class="title">任务描述</view>
|
||||||
@ -14,41 +16,231 @@
|
|||||||
<view class="card">
|
<view class="card">
|
||||||
<view class="title">事件记录</view>
|
<view class="title">事件记录</view>
|
||||||
<u-line style="margin: 14rpx 0;"></u-line>
|
<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 v-if="task.extend&&task.extend.shareholder" :current="-1" direction="column" activeColor="#0122c7"
|
||||||
<u-steps-item v-for="(item, index) in task.extend.shareholder.user_list" :title="item.time" :desc="item.info">
|
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-item>
|
||||||
</u-steps>
|
</u-steps>
|
||||||
</view>
|
</view>
|
||||||
<view class="card">
|
<view class="card" v-if="task.approve_status==3">
|
||||||
<view class="title">温馨提示</view>
|
<view class="title" style="color: #FF7C32;">驳回提示</view>
|
||||||
<u-line style="margin: 14rpx 0;"></u-line>
|
<u-line style="margin: 14rpx 0;"></u-line>
|
||||||
<view class="text" style="color: #FF7C32;">入股的金额将在次日凌晨更新到"股金管理"内,请于次日打开"股金管理"页面查看详情</view>
|
<view class="text" style="color: #FF7C32;">{{task.deny_notes}}</view>
|
||||||
|
<!-- <button v-if="other.is_commit==1" class="btn" @click="toUpdate">去修改</button> -->
|
||||||
</view>
|
</view>
|
||||||
<mybtn v-if="task.status!=3 && task.status!=5" text="前往支付页面" @click="navTo(`/subpkg/topUp/topUp?task_id=${task_id}`)"></mybtn>
|
<view class="card">
|
||||||
<mybtn v-else :text="task.status==3?'已完成任务':'任务已关闭'" :my_btn_disabled="true"></mybtn>
|
<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>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { taskShareholder } from "@/api/task.js"
|
import {
|
||||||
|
taskShareholder,
|
||||||
|
commit_service_group_taskAPI
|
||||||
|
} 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 {
|
export default {
|
||||||
|
components: {
|
||||||
|
lsjUpload
|
||||||
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
progress: 0,
|
||||||
|
imgTypeList: ["png", "jpg", "jpeg", "webp"],
|
||||||
|
isDisabled: false,
|
||||||
|
amount: "",
|
||||||
|
fileOption: {},
|
||||||
task: {},
|
task: {},
|
||||||
task_id: -1,
|
task_id: -1,
|
||||||
|
file: "",
|
||||||
|
local_src: "",
|
||||||
|
fileTit: "",
|
||||||
|
file_type: "pdf",
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
onLoad(options) {
|
onLoad(options) {
|
||||||
this.task_id = options.task_id;
|
this.task_id = options.task_id;
|
||||||
this.loadTask();
|
this.loadTask();
|
||||||
uni.$on('upBuyShare', this.loadTask);
|
uni.$on('upBuyShare', this.loadTask);
|
||||||
|
this.fileOption = {
|
||||||
|
url: FILE_URL,
|
||||||
|
name: 'file',
|
||||||
|
header: {
|
||||||
|
token: this.$store.state.app.token
|
||||||
|
}
|
||||||
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
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() {
|
async loadTask() {
|
||||||
let res = await taskShareholder({
|
let res = await taskShareholder({
|
||||||
id: this.task_id
|
id: this.task_id
|
||||||
});
|
});
|
||||||
this.task = res.data;
|
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) {
|
navTo(url) {
|
||||||
if (url) {
|
if (url) {
|
||||||
@ -87,4 +279,42 @@
|
|||||||
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>
|
@ -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连接已打开!');
|
||||||
|
@ -4,24 +4,14 @@
|
|||||||
<view class="top">
|
<view class="top">
|
||||||
<view>
|
<view>
|
||||||
<view v-if="user_id == 0" class="accont">
|
<view v-if="user_id == 0" class="accont">
|
||||||
<u--image
|
<u--image :showLoading="true" :src="userInfo.avatar || '../../static/img/public/man.png'"
|
||||||
:showLoading="true"
|
width="44px" height="44px" shape="circle"></u--image>
|
||||||
:src="userInfo.avatar || '../../static/img/public/man.png'"
|
|
||||||
width="44px"
|
|
||||||
height="44px"
|
|
||||||
shape="circle"
|
|
||||||
></u--image>
|
|
||||||
<view class="name">{{ userInfo.nickname }}</view>
|
<view class="name">{{ userInfo.nickname }}</view>
|
||||||
<!-- <u-icon name="setting-fill" color="white" size="20"></u-icon> -->
|
<!-- <u-icon name="setting-fill" color="white" size="20"></u-icon> -->
|
||||||
</view>
|
</view>
|
||||||
<view v-else class="accont">
|
<view v-else class="accont">
|
||||||
<u--image
|
<u--image :showLoading="true" :src="userInfo.avatar || '../../static/img/public/man.png'"
|
||||||
:showLoading="true"
|
width="44px" height="44px" shape="circle"></u--image>
|
||||||
:src="userInfo.avatar || '../../static/img/public/man.png'"
|
|
||||||
width="44px"
|
|
||||||
height="44px"
|
|
||||||
shape="circle"
|
|
||||||
></u--image>
|
|
||||||
|
|
||||||
<view class="name">{{ userInfo.nickname }}</view>
|
<view class="name">{{ userInfo.nickname }}</view>
|
||||||
<!-- <u-icon name="setting-fill" color="white" size="20"></u-icon> -->
|
<!-- <u-icon name="setting-fill" color="white" size="20"></u-icon> -->
|
||||||
@ -33,22 +23,14 @@
|
|||||||
</view>
|
</view>
|
||||||
<view class="center">
|
<view class="center">
|
||||||
<view class="title">
|
<view class="title">
|
||||||
<text style="margin-right: 20rpx">账户总金额(元)</text
|
<text style="margin-right: 20rpx">账户总金额(元)</text><uni-icons @click="updateEye()"
|
||||||
><uni-icons
|
:type="eyeType ? 'eye-filled' : 'eye-slash-filled'" color="#fff"></uni-icons>
|
||||||
@click="updateEye()"
|
|
||||||
:type="eyeType ? 'eye-filled' : 'eye-slash-filled'"
|
|
||||||
color="#fff"
|
|
||||||
></uni-icons>
|
|
||||||
</view>
|
</view>
|
||||||
<view class="price" v-show="eyeType"
|
<view class="price" v-show="eyeType">{{ all_money }}元</view>
|
||||||
>{{ all_money }}元</view
|
|
||||||
>
|
|
||||||
<view class="price" v-show="!eyeType">****元</view>
|
<view class="price" v-show="!eyeType">****元</view>
|
||||||
<view class="bubble">
|
<view class="bubble">
|
||||||
<!-- <image src="../../static/img/contract/bubble.png"></image> -->
|
<!-- <image src="../../static/img/contract/bubble.png"></image> -->
|
||||||
<view class="text" v-show="eyeType"
|
<view class="text" v-show="eyeType">可提现金额{{ userInfo.user_money || 0.0 }}元</view>
|
||||||
>可提现金额{{ userInfo.user_money || 0.0 }}元</view
|
|
||||||
>
|
|
||||||
<view class="text" v-show="!eyeType">可提现金额****元</view>
|
<view class="text" v-show="!eyeType">可提现金额****元</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@ -62,7 +44,7 @@
|
|||||||
</view>
|
</view>
|
||||||
<u-line direction="col" length="40%" color="#999999FF"></u-line>
|
<u-line direction="col" length="40%" color="#999999FF"></u-line>
|
||||||
<view class="item">
|
<view class="item">
|
||||||
<view>个人收益金额(元)</view>
|
<view>个人预计收益金额(元)</view>
|
||||||
<view class="num" v-show="eyeType">{{
|
<view class="num" v-show="eyeType">{{
|
||||||
userInfo.user_money || 0.0
|
userInfo.user_money || 0.0
|
||||||
}}</view>
|
}}</view>
|
||||||
@ -72,11 +54,7 @@
|
|||||||
</view>
|
</view>
|
||||||
<view class="bill">
|
<view class="bill">
|
||||||
<view style="width: 100%; height: 90rpx; background-color: #fff"></view>
|
<view style="width: 100%; height: 90rpx; background-color: #fff"></view>
|
||||||
<uni-section
|
<uni-section titleFontSize="32rpx" type="line" title="账单流水"></uni-section>
|
||||||
titleFontSize="32rpx"
|
|
||||||
type="line"
|
|
||||||
title="账单流水"
|
|
||||||
></uni-section>
|
|
||||||
<!-- <u-subsection :list="billTypeList" :current="current" mode="subsection"></u-subsection> -->
|
<!-- <u-subsection :list="billTypeList" :current="current" mode="subsection"></u-subsection> -->
|
||||||
<!-- <view class="type_box">
|
<!-- <view class="type_box">
|
||||||
<view class="type">
|
<view class="type">
|
||||||
@ -128,11 +106,8 @@
|
|||||||
<text v-if="item.change_type == 202" style="color: #46be61">{{
|
<text v-if="item.change_type == 202" style="color: #46be61">{{
|
||||||
item.type_desc
|
item.type_desc
|
||||||
}}</text>
|
}}</text>
|
||||||
<text
|
<text v-else-if="item.change_type == 203"
|
||||||
v-else-if="item.change_type == 203"
|
style="color: #ff7c32">{{ item.type_desc }}</text>
|
||||||
style="color: #ff7c32"
|
|
||||||
>{{ item.type_desc }}</text
|
|
||||||
>
|
|
||||||
<text v-else="item.change_type == 203">{{
|
<text v-else="item.change_type == 203">{{
|
||||||
item.type_desc
|
item.type_desc
|
||||||
}}</text>
|
}}</text>
|
||||||
@ -171,12 +146,8 @@
|
|||||||
</view>
|
</view>
|
||||||
|
|
||||||
-->
|
-->
|
||||||
<u-loadmore
|
<u-loadmore :status="loadConfig.status" :loading-text="loadConfig.loadingText"
|
||||||
:status="loadConfig.status"
|
:loadmore-text="loadConfig.loadmoreText" :nomore-text="loadConfig.nomoreText" />
|
||||||
:loading-text="loadConfig.loadingText"
|
|
||||||
:loadmore-text="loadConfig.loadmoreText"
|
|
||||||
:nomore-text="loadConfig.nomoreText"
|
|
||||||
/>
|
|
||||||
</view>
|
</view>
|
||||||
<!-- 月账单 -->
|
<!-- 月账单 -->
|
||||||
<view class="bill_list" v-show="current == 1">
|
<view class="bill_list" v-show="current == 1">
|
||||||
@ -187,15 +158,13 @@
|
|||||||
</view>
|
</view>
|
||||||
<view class="bottom">
|
<view class="bottom">
|
||||||
<view class="left">
|
<view class="left">
|
||||||
<view>个人收益金额(元)</view>
|
<view>个人预计收益金额(元)</view>
|
||||||
<view class="num">{{ item.income }}</view>
|
<view class="num">{{ item.income }}</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="right">
|
<view class="right">
|
||||||
<view
|
<view>支出金额:{{
|
||||||
>支出金额:{{
|
|
||||||
item.expenditure > 0 ? item.expenditure : "0.00"
|
item.expenditure > 0 ? item.expenditure : "0.00"
|
||||||
}}</view
|
}}</view>
|
||||||
>
|
|
||||||
<view>入账金额:{{ item.income > 0 ? item.income : "0.00" }}</view>
|
<view>入账金额:{{ item.income > 0 ? item.income : "0.00" }}</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@ -424,8 +393,7 @@ page {
|
|||||||
background-repeat: no-repeat;
|
background-repeat: no-repeat;
|
||||||
background-size: 100% 100%;
|
background-size: 100% 100%;
|
||||||
|
|
||||||
.text {
|
.text {}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -48,6 +48,11 @@
|
|||||||
<view>详细地址:</view>
|
<view>详细地址:</view>
|
||||||
<view>{{extend.address}}</view>
|
<view>{{extend.address}}</view>
|
||||||
</view>
|
</view>
|
||||||
|
<view class="b_item">
|
||||||
|
<view>公司性质:</view>
|
||||||
|
<view>{{extend.is_company==1?"对公户":"个体户" }}</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
<view class="b_item">
|
<view class="b_item">
|
||||||
<view>公司名称:</view>
|
<view>公司名称:</view>
|
||||||
<view>{{extend.company_name}}</view>
|
<view>{{extend.company_name}}</view>
|
||||||
@ -70,9 +75,10 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="body">
|
<view class="body">
|
||||||
<block v-for="(item, index) in extend.qualification">
|
<block v-for="(item, index) in extend.qualification" :key="">
|
||||||
<image @click="priview(item)" :src="item"></image>
|
<image @click="priview(item)" :src="item"></image>
|
||||||
<view v-if="index<extend.qualification.length-1" style="border-top: 1px dashed #0022c7;margin: 28rpx 0;">
|
<view v-if="index<extend.qualification.length-1"
|
||||||
|
style="border-top: 1px dashed #0022c7;margin: 28rpx 0;">
|
||||||
</view>
|
</view>
|
||||||
</block>
|
</block>
|
||||||
</view>
|
</view>
|
||||||
@ -84,13 +90,45 @@
|
|||||||
<view>身份证明信息</view>
|
<view>身份证明信息</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="body">
|
|
||||||
|
|
||||||
|
<view class="body" v-if="extend.is_company==1">
|
||||||
<view class="b_item">
|
<view class="b_item">
|
||||||
<view>银行账户姓名:</view>
|
<view>公司名称: </view>
|
||||||
|
<view>{{extend.company_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>{{extend.bank_username}}</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="b_item">
|
<view class="b_item">
|
||||||
<view>开户行:</view>
|
<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>{{extend.bank_opening}}</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="b_item">
|
<view class="b_item">
|
||||||
@ -108,8 +146,68 @@
|
|||||||
<view class="b_item">
|
<view class="b_item">
|
||||||
<view>身份证反面:</view>
|
<view>身份证反面:</view>
|
||||||
</view>
|
</view>
|
||||||
<image @click="priview(extend.cardno_back)" :src="extend.cardno_back"></image>
|
<image @click="priview(extend.cardno_back)" :src="extend.cardno_back"></image> -->
|
||||||
</view>
|
</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>
|
||||||
</view>
|
</view>
|
||||||
<block v-if="formData.check_status!=2&&formData.check_status!=3&&formData.check_status">
|
<block v-if="formData.check_status!=2&&formData.check_status!=3&&formData.check_status">
|
||||||
@ -142,14 +240,19 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</u-popup>
|
</u-popup>
|
||||||
<u-modal :show="tipShow" title="提示" content='确认信息无误再通过' closeOnClickOverlay showCancelButton @close="tipShow=false"
|
<u-modal :show="tipShow" title="提示" content='确认信息无误再通过' closeOnClickOverlay showCancelButton
|
||||||
@cancel="tipShow=false" @confirm="$u.throttle(pass, 1500)"></u-modal>
|
@close="tipShow=false" @cancel="tipShow=false" @confirm="$u.throttle(pass, 1500)"></u-modal>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { Toast } from '../../libs/uniApi'
|
import {
|
||||||
import { approveAudit, approveDetails } from "@/api/approve.js"
|
Toast
|
||||||
|
} from '../../libs/uniApi'
|
||||||
|
import {
|
||||||
|
approveAudit,
|
||||||
|
approveDetails
|
||||||
|
} from "@/api/approve.js"
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
@ -190,7 +293,8 @@
|
|||||||
});
|
});
|
||||||
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) :
|
||||||
|
this.extend
|
||||||
.qualification = []
|
.qualification = []
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
//TODO handle the exception
|
//TODO handle the exception
|
||||||
|
@ -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,7 +55,8 @@
|
|||||||
</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"
|
||||||
|
label="是否为服务部长" required prop="is_service_manager" borderBottom>
|
||||||
<u-radio-group v-model="formData.is_service_manager" style="margin: 16rpx;">
|
<u-radio-group v-model="formData.is_service_manager" 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"
|
||||||
@ -295,8 +297,7 @@
|
|||||||
</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>
|
||||||
@ -464,8 +465,10 @@
|
|||||||
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) {
|
||||||
|
@ -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>
|
||||||
|
|
||||||
@ -204,6 +206,7 @@
|
|||||||
.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;
|
||||||
|
@ -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
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
@ -1,11 +1,11 @@
|
|||||||
<template>
|
<template>
|
||||||
<view style="padding-bottom: 160rpx;">
|
<view style="padding-bottom: 160rpx;">
|
||||||
<view class="price_card">
|
<!-- <view class="price_card">
|
||||||
<view>账户入股金额</view>
|
<view>账户入股金额</view>
|
||||||
<view><text class="money">{{shareholder.shareholder_money}}</text>元</view>
|
<view><text class="money">{{shareholder.shareholder_money}}</text>元</view>
|
||||||
</view>
|
</view> -->
|
||||||
<view v-if="!shareholder.is_village" style="text-align: center;color: #aaa;">暂无直属上级公司</view>
|
<!-- <view v-if="!shareholder.is_village" style="text-align: center;color: #aaa;">暂无直属上级公司</view> -->
|
||||||
<view class="card" v-else-if="shareholder.is_contract">
|
<!-- <view class="card" v-else-if="shareholder.is_contract">
|
||||||
<view class="contract">
|
<view class="contract">
|
||||||
<view class="left">
|
<view class="left">
|
||||||
<image class="contract_img" src="../../static/img/contract/pdf.png"></image>
|
<image class="contract_img" src="../../static/img/contract/pdf.png"></image>
|
||||||
@ -22,8 +22,13 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="need_contract" v-else>
|
-->
|
||||||
<button v-if="shareholder.check_status==0" class="btns" style="width: 694rpx;height: 90rpx; margin: 0 auto;border-radius: 54rpx;overflow: hidden;background-color: #0122c7;color: #fff;" @click="clickContract(1)">
|
|
||||||
|
|
||||||
|
<!-- <view class="need_contract" v-else>
|
||||||
|
<button v-if="shareholder.check_status==0" class="btns"
|
||||||
|
style="width: 694rpx;height: 90rpx; margin: 0 auto;border-radius: 54rpx;overflow: hidden;background-color: #0122c7;color: #fff;"
|
||||||
|
@click="clickContract(1)">
|
||||||
<u-icon name="../../static/img/company/HT.png" size="20" style="margin-right: 10rpx;"></u-icon>
|
<u-icon name="../../static/img/company/HT.png" size="20" style="margin-right: 10rpx;"></u-icon>
|
||||||
发起合同
|
发起合同
|
||||||
</button>
|
</button>
|
||||||
@ -42,7 +47,6 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="right" @click="navToContract(shareholder.contract_url)">
|
<view class="right" @click="navToContract(shareholder.contract_url)">
|
||||||
<!-- <image class="icon"></image> -->
|
|
||||||
<uni-icons type="paperclip" color="#3274F9"></uni-icons>
|
<uni-icons type="paperclip" color="#3274F9"></uni-icons>
|
||||||
<view>查看</view>
|
<view>查看</view>
|
||||||
</view>
|
</view>
|
||||||
@ -64,7 +68,6 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="right" @click="navToContract(shareholder.contract_url)">
|
<view class="right" @click="navToContract(shareholder.contract_url)">
|
||||||
<!-- <image class="icon"></image> -->
|
|
||||||
<uni-icons type="paperclip" color="#3274F9"></uni-icons>
|
<uni-icons type="paperclip" color="#3274F9"></uni-icons>
|
||||||
<view>查看</view>
|
<view>查看</view>
|
||||||
</view>
|
</view>
|
||||||
@ -75,7 +78,12 @@
|
|||||||
<button class="send_btn tips_center" v-else>{{cTimerCount+'秒后可继续再次发送短信'}}</button>
|
<button class="send_btn tips_center" v-else>{{cTimerCount+'秒后可继续再次发送短信'}}</button>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view> -->
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<view class="card">
|
<view class="card">
|
||||||
<view class="c_title">账单记录</view>
|
<view class="c_title">账单记录</view>
|
||||||
<u-line></u-line>
|
<u-line></u-line>
|
||||||
@ -106,16 +114,21 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view> -->
|
</view> -->
|
||||||
<view class="button">
|
<!-- <view class="button">
|
||||||
<view class="retreat" @click="retreat">退股</view>
|
<view class="retreat" @click="retreat">退股</view>
|
||||||
<view class="hand" :class="{'disable': !shareholder.is_done_task || !shareholder.is_contract }" @click="hand">上交</view>
|
<view class="hand" :class="{'disable': !shareholder.is_done_task || !shareholder.is_contract }"
|
||||||
</view>
|
@click="hand">上交</view>
|
||||||
<u-modal :show="modelShow" title="提醒" :content="modelType==1?'确定要生成合同吗':'请确认合同无误后再发送'" closeOnClickOverlay showCancelButton cancel-text="取消" confirm-text="确认" close="modelShow=false" @cancel="modelShow=false" @confirm="modelType==1?createContract():addContract();modelShow=false"></u-modal>
|
</view> -->
|
||||||
|
<!-- <u-modal :show="modelShow" title="提醒" :content="modelType==1?'确定要生成合同吗':'请确认合同无误后再发送'" closeOnClickOverlay
|
||||||
|
showCancelButton cancel-text="取消" confirm-text="确认" close="modelShow=false" @cancel="modelShow=false"
|
||||||
|
@confirm="modelType==1?createContract():addContract();modelShow=false"></u-modal> -->
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { Toast } from '../../libs/uniApi';
|
import {
|
||||||
|
Toast
|
||||||
|
} from '../../libs/uniApi';
|
||||||
import {
|
import {
|
||||||
download_file
|
download_file
|
||||||
} from "@/api/junziqian.js"
|
} from "@/api/junziqian.js"
|
||||||
@ -245,7 +258,10 @@
|
|||||||
async handShare() {
|
async handShare() {
|
||||||
await companyPayShareCapital();
|
await companyPayShareCapital();
|
||||||
Toast('上交成功!');
|
Toast('上交成功!');
|
||||||
|
setTimeout(() => {
|
||||||
uni.navigateBack();
|
uni.navigateBack();
|
||||||
|
}, 1000)
|
||||||
|
|
||||||
},
|
},
|
||||||
clickContract(e) {
|
clickContract(e) {
|
||||||
this.modelType = e;
|
this.modelType = e;
|
||||||
@ -636,6 +652,7 @@
|
|||||||
color: #eee;
|
color: #eee;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.btns {
|
.btns {
|
||||||
color: white;
|
color: white;
|
||||||
background-color: $theme-oa-color;
|
background-color: $theme-oa-color;
|
||||||
|
393
subpkg/topUp/deposit.vue
Normal file
393
subpkg/topUp/deposit.vue
Normal 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>
|
@ -17,9 +17,12 @@
|
|||||||
<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="输入充值金额(元)"
|
||||||
|
v-model="payMoney.money" />
|
||||||
<button class="btn" @click="pay">充值</button>
|
<button class="btn" @click="pay">充值</button>
|
||||||
<button class="btn btn2" @click="navToRecord">充值记录</button>
|
<button class="btn btn2" @click="navToRecord">充值记录</button>
|
||||||
|
|
||||||
|
|
||||||
</view>
|
</view>
|
||||||
<!-- <view class="tip">
|
<!-- <view class="tip">
|
||||||
<view class="title">注意事项</view>
|
<view class="title">注意事项</view>
|
||||||
@ -30,10 +33,22 @@
|
|||||||
</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,
|
||||||
|
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 {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
@ -45,7 +60,8 @@
|
|||||||
payTimer: null,
|
payTimer: null,
|
||||||
timeCount: 5,
|
timeCount: 5,
|
||||||
task_id: -1, //任务id,当为任务时,不可自选充值金额
|
task_id: -1, //任务id,当为任务时,不可自选充值金额
|
||||||
task: {}
|
task: {},
|
||||||
|
obj: "323",
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
// 点击充值记录
|
// 点击充值记录
|
||||||
@ -61,6 +77,12 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
|
||||||
|
aa() {
|
||||||
|
return JSON.parse(this.obj)
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
changePrice(index) {
|
changePrice(index) {
|
||||||
if (this.changeMoney == index) this.changeMoney = -1;
|
if (this.changeMoney == index) this.changeMoney = -1;
|
||||||
else this.changeMoney = index;
|
else this.changeMoney = index;
|
||||||
@ -100,10 +122,10 @@
|
|||||||
this.timeCount = 5;
|
this.timeCount = 5;
|
||||||
}
|
}
|
||||||
}, 1000)
|
}, 1000)
|
||||||
}
|
} else Toast(this.timeCount + '秒后再支付!')
|
||||||
else Toast(this.timeCount+'秒后再支付!')
|
|
||||||
},
|
},
|
||||||
goRecharge() {
|
goRecharge() {
|
||||||
|
let that = this
|
||||||
// console.log(obj);
|
// console.log(obj);
|
||||||
uni.showLoading({
|
uni.showLoading({
|
||||||
title: '获取支付信息',
|
title: '获取支付信息',
|
||||||
@ -115,7 +137,9 @@
|
|||||||
if (this.task_id > 0) {
|
if (this.task_id > 0) {
|
||||||
queryData.task_id = this.task_id;
|
queryData.task_id = this.task_id;
|
||||||
}
|
}
|
||||||
let { data } = await recharge(queryData);
|
let {
|
||||||
|
data
|
||||||
|
} = await recharge(queryData);
|
||||||
let res = await payWay({
|
let res = await payWay({
|
||||||
order_id: data.order_id,
|
order_id: data.order_id,
|
||||||
from: data.from,
|
from: data.from,
|
||||||
@ -128,7 +152,8 @@
|
|||||||
})
|
})
|
||||||
// console.log(res1.data, res1.data.config.package.split('=')[1]);
|
// console.log(res1.data, res1.data.config.package.split('=')[1]);
|
||||||
let obj = {
|
let obj = {
|
||||||
"appid": res1.data.config.appId, // 微信开放平台 - 应用 - AppId,注意和微信小程序、公众号 AppId 可能不一致
|
"appid": res1.data.config
|
||||||
|
.appId, // 微信开放平台 - 应用 - AppId,注意和微信小程序、公众号 AppId 可能不一致
|
||||||
"noncestr": res1.data.config.nonceStr, // 随机字符串
|
"noncestr": res1.data.config.nonceStr, // 随机字符串
|
||||||
"package": res1.data.config.package, // 固定值
|
"package": res1.data.config.package, // 固定值
|
||||||
"partnerid": res1.data.config.partnerid, // 微信支付商户号
|
"partnerid": res1.data.config.partnerid, // 微信支付商户号
|
||||||
@ -136,6 +161,7 @@
|
|||||||
"timestamp": res1.data.config.timestamp, // 时间戳(单位:秒)
|
"timestamp": res1.data.config.timestamp, // 时间戳(单位:秒)
|
||||||
"sign": res1.data.config.paySign
|
"sign": res1.data.config.paySign
|
||||||
}
|
}
|
||||||
|
|
||||||
uni.getProvider({
|
uni.getProvider({
|
||||||
service: 'payment',
|
service: 'payment',
|
||||||
success: (paymentList) => {
|
success: (paymentList) => {
|
||||||
@ -156,16 +182,21 @@
|
|||||||
from: data.from,
|
from: data.from,
|
||||||
}).then((status) => {
|
}).then((status) => {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
icon: status.data.pay_status?'success':'none',
|
icon: status.data
|
||||||
title: status.data.pay_status?'支付成功':'支付失败'
|
.pay_status ?
|
||||||
|
'success' : 'none',
|
||||||
|
title: status.data
|
||||||
|
.pay_status ?
|
||||||
|
'支付成功' : '支付失败'
|
||||||
})
|
})
|
||||||
if (this.task_id > 0) {
|
if (this.task_id > 0) {
|
||||||
uni.$emit('upBuyShare');
|
uni.$emit('upBuyShare');
|
||||||
uni.navigateBack();
|
uni.navigateBack();
|
||||||
}
|
} else {
|
||||||
else{
|
|
||||||
userInfo().then(user => {
|
userInfo().then(user => {
|
||||||
this.$store.commit('setUserInfo', user.data);
|
this.$store.commit(
|
||||||
|
'setUserInfo',
|
||||||
|
user.data);
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
@ -179,7 +210,8 @@
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
complete: () => {
|
complete: () => {
|
||||||
if(this.task_id<=0)this.payMoney.money = '';
|
if (this.task_id <= 0) this.payMoney.money =
|
||||||
|
'';
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -250,6 +282,7 @@
|
|||||||
font-size: 32rpx;
|
font-size: 32rpx;
|
||||||
font-weight: 400;
|
font-weight: 400;
|
||||||
color: #333333;
|
color: #333333;
|
||||||
|
|
||||||
text:nth-child(1) {
|
text:nth-child(1) {
|
||||||
flex-shrink: 0;
|
flex-shrink: 0;
|
||||||
margin-right: 18rpx;
|
margin-right: 18rpx;
|
||||||
@ -327,6 +360,7 @@
|
|||||||
font-weight: 400;
|
font-weight: 400;
|
||||||
color: #FFFFFF;
|
color: #FFFFFF;
|
||||||
}
|
}
|
||||||
|
|
||||||
.btn2 {
|
.btn2 {
|
||||||
background-color: #fff;
|
background-color: #fff;
|
||||||
color: #333;
|
color: #333;
|
||||||
|
@ -19,22 +19,37 @@
|
|||||||
</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 class="item">
|
||||||
|
<view>充值金额:</view>
|
||||||
|
<view class="text " style="color: red;">{{item.deposit}}</view>元
|
||||||
|
</view>
|
||||||
|
<view class="item" @click="previewVoucher(item.voucher)">
|
||||||
|
<view>充值凭证:</view>
|
||||||
|
<view class="text blue">查看凭证</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<u-empty v-if="list.length==0&&loadConfig.status=='nomore'" icon="/static/img/empty/data.png" text="没有数据"></u-empty>
|
</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"
|
<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 { Toast } from '@/libs/uniApi.js'
|
import {
|
||||||
import { getPartyACompany, getDepositRechargeTransferVoucherList } from "@/api/company.js"
|
Toast
|
||||||
|
} from '@/libs/uniApi.js'
|
||||||
|
import {
|
||||||
|
getPartyACompany,
|
||||||
|
getDepositRechargeTransferVoucherList
|
||||||
|
} from "@/api/company.js"
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
@ -211,6 +226,7 @@
|
|||||||
font-size: 32rpx;
|
font-size: 32rpx;
|
||||||
font-weight: 400;
|
font-weight: 400;
|
||||||
color: #333333;
|
color: #333333;
|
||||||
|
|
||||||
text:nth-child(1) {
|
text:nth-child(1) {
|
||||||
flex-shrink: 0;
|
flex-shrink: 0;
|
||||||
margin-right: 18rpx;
|
margin-right: 18rpx;
|
||||||
@ -223,6 +239,7 @@
|
|||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
|
||||||
.card {
|
.card {
|
||||||
width: 694rpx;
|
width: 694rpx;
|
||||||
min-height: 180rpx;
|
min-height: 180rpx;
|
||||||
|
@ -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">
|
||||||
|
236
subpkg/townTask/gatherRecords.vue
Normal file
236
subpkg/townTask/gatherRecords.vue
Normal 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>
|
@ -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)
|
||||||
|
@ -13,7 +13,8 @@
|
|||||||
<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"
|
||||||
|
@click.stop="deleteFile(index)">
|
||||||
</image>
|
</image>
|
||||||
</view>
|
</view>
|
||||||
<view v-if="taskInfo.status==2" class="file_btn" @click="chooseFile">
|
<view v-if="taskInfo.status==2" class="file_btn" @click="chooseFile">
|
||||||
@ -27,14 +28,16 @@
|
|||||||
<view class="file">
|
<view class="file">
|
||||||
<view v-if="sign_in_table" class="file_item">
|
<view v-if="sign_in_table" class="file_item">
|
||||||
<image class="image" :src="sign_in_table" @click="priviewOne(index)"></image>
|
<image class="image" :src="sign_in_table" @click="priviewOne(index)"></image>
|
||||||
<image v-if="taskInfo.status==2" class="del" src="/static/icons/delete.png"
|
<image v-if="taskInfo.status==2 && other.is_commit==0" class="del"
|
||||||
@click.stop="deleteFile(index, 'sign_in_table')">
|
src="/static/icons/delete.png" @click.stop="deleteFile(index, 'sign_in_table')">
|
||||||
</image>
|
</image>
|
||||||
</view>
|
</view>
|
||||||
<view v-if="taskInfo.status==2" class="file_btn" @click="chooseOneFile">
|
<view v-if="taskInfo.status==2 && other.is_commit==0 && !sign_in_table" class="file_btn"
|
||||||
|
@click="chooseOneFile">
|
||||||
<image src="/static/icons/plus.png"></image>
|
<image src="/static/icons/plus.png"></image>
|
||||||
</view>
|
</view>
|
||||||
<view v-if="taskInfo.status==2" class="file_empty" v-for="k in 2" :key="'empty'+k"></view>
|
<view class="file_empty"></view>
|
||||||
|
<view class="file_empty"></view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="card" style="margin-bottom: 160rpx;">
|
<view class="card" style="margin-bottom: 160rpx;">
|
||||||
@ -44,8 +47,10 @@
|
|||||||
style="font-size: 28rpx;background-color: #eee;min-height: 100px;padding-bottom: 50rpx;"></u--textarea>
|
style="font-size: 28rpx;background-color: #eee;min-height: 100px;padding-bottom: 50rpx;"></u--textarea>
|
||||||
</view>
|
</view>
|
||||||
<mybtn v-if="taskInfo.status==2" text="确认提交" @click="$u.throttle(submit, 1500)"></mybtn>
|
<mybtn v-if="taskInfo.status==2" text="确认提交" @click="$u.throttle(submit, 1500)"></mybtn>
|
||||||
<mybtn v-else-if="taskInfo.status==3" text="已完成" :my_btn_disabled="true" @click="showToast('任务已完成')"></mybtn>
|
<mybtn v-else-if="taskInfo.status==3" text="已完成" :my_btn_disabled="true" @click="showToast('任务已完成')">
|
||||||
<mybtn v-else-if="taskInfo.status==5" text="已关闭" :my_btn_disabled="true" @click="showToast('任务已关闭!')"></mybtn>
|
</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-if="approve_status==3" text="已驳回,请重新提交" @click="toUpdate"></mybtn> -->
|
||||||
<mybtn v-else text="已提交,请等待审核" :my_btn_disabled="true" @click="showToast('请耐心等待审核结果')"></mybtn>
|
<mybtn v-else text="已提交,请等待审核" :my_btn_disabled="true" @click="showToast('请耐心等待审核结果')"></mybtn>
|
||||||
</block>
|
</block>
|
||||||
@ -56,8 +61,13 @@
|
|||||||
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
|
||||||
|
} from "../../libs/uniApi";
|
||||||
|
import {
|
||||||
|
townTaskDetails,
|
||||||
|
serviceTask4Commit
|
||||||
|
} from "@/api/task.js"
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
@ -88,7 +98,8 @@
|
|||||||
computed: {
|
computed: {
|
||||||
// 占位长度
|
// 占位长度
|
||||||
placeholderLength() {
|
placeholderLength() {
|
||||||
if (this.taskInfo.status!=2) return this.study_photo.length % 3 == 0 ? 0 : 3 - this.study_photo.length % 3;
|
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;
|
return (this.study_photo.length + 1) % 3 == 0 ? 0 : 3 - (this.study_photo.length + 1) % 3;
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@ -101,14 +112,15 @@
|
|||||||
this.taskInfo = res.data;
|
this.taskInfo = res.data;
|
||||||
this.sign_in_table = this.taskInfo?.extend?.town_task_type_4?.sign_in_table;
|
this.sign_in_table = this.taskInfo?.extend?.town_task_type_4?.sign_in_table;
|
||||||
this.study_content = this.taskInfo?.extend?.town_task_type_4?.study_content;
|
this.study_content = this.taskInfo?.extend?.town_task_type_4?.study_content;
|
||||||
this.study_photo = JSON.parse(JSON.stringify(this.taskInfo?.extend?.town_task_type_4?.study_photo || []));
|
this.study_photo = JSON.parse(JSON.stringify(this.taskInfo?.extend?.town_task_type_4?.study_photo ||
|
||||||
|
[]));
|
||||||
this.skeleton = false;
|
this.skeleton = false;
|
||||||
},
|
},
|
||||||
// 提交
|
// 提交
|
||||||
async submit() {
|
async submit() {
|
||||||
if (this.study_photo.length < 5) return Toast('学习照片不能低于5张');
|
if (this.study_photo.length < 5) return Toast('学习照片不能低于5张');
|
||||||
if (!this.sign_in_table) return Toast('签到表照片不能为空');
|
if (!this.sign_in_table) return Toast('签到表照片不能为空');
|
||||||
// if (this.study_content.trim().length < 50) return Toast('培训内容不得低于50字');
|
if (this.study_content.trim().length < 50) return Toast('培训内容不得低于50字');
|
||||||
await serviceTask4Commit({
|
await serviceTask4Commit({
|
||||||
id: this.taskInfo.id,
|
id: this.taskInfo.id,
|
||||||
study_photo: this.study_photo,
|
study_photo: this.study_photo,
|
||||||
@ -116,8 +128,11 @@
|
|||||||
study_content: this.study_content
|
study_content: this.study_content
|
||||||
});
|
});
|
||||||
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)
|
||||||
|
699
subpkg/townTask/townGather.vue
Normal file
699
subpkg/townTask/townGather.vue
Normal 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>
|
@ -1,5 +1,8 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="task_page">
|
<view class="task_page">
|
||||||
|
|
||||||
|
<!-- {{taskInfo}} -->
|
||||||
|
|
||||||
<u-skeleton v-if="skeleton" :class="{'loading': skeleton}" :animate="true" title rows="3" rows-width="92%"
|
<u-skeleton v-if="skeleton" :class="{'loading': skeleton}" :animate="true" title rows="3" rows-width="92%"
|
||||||
rowsHeight="56">
|
rowsHeight="56">
|
||||||
</u-skeleton>
|
</u-skeleton>
|
||||||
@ -8,6 +11,18 @@
|
|||||||
<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" v-if="extend_info&&extend_info.target">
|
||||||
|
<view class="c_title">目标数量: {{extend_info.target}}</view>
|
||||||
|
</view>
|
||||||
|
<view class="card" v-if="extend_info&&extend_info.store_name">
|
||||||
|
<view class="c_title">指定商品: </view>
|
||||||
|
<view class="store">
|
||||||
|
<view class="store_name" v-for="(item, index) in extend_info.store_name" :key="index"
|
||||||
|
@click="copyName(item)">
|
||||||
|
{{item}}
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
<view class="card">
|
<view class="card">
|
||||||
<view class="c_title">判定条件:</view>
|
<view class="c_title">判定条件:</view>
|
||||||
<view style="white-space: pre-line;">{{remark}}</view>
|
<view style="white-space: pre-line;">{{remark}}</view>
|
||||||
@ -17,9 +32,15 @@
|
|||||||
</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";
|
||||||
|
import {
|
||||||
|
townTaskDetails
|
||||||
|
} from "@/api/task.js"
|
||||||
|
import {
|
||||||
|
dictDataListsTypeValue
|
||||||
|
} from "@/api/oaPbulic.js"
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
@ -29,6 +50,7 @@
|
|||||||
content: '',
|
content: '',
|
||||||
extend: {}
|
extend: {}
|
||||||
},
|
},
|
||||||
|
extend_info: null,
|
||||||
remark: '',
|
remark: '',
|
||||||
skeleton: true,
|
skeleton: true,
|
||||||
type_value: 'town_task_type', // 任务类型
|
type_value: 'town_task_type', // 任务类型
|
||||||
@ -46,9 +68,19 @@
|
|||||||
let res = await townTaskDetails({
|
let res = await townTaskDetails({
|
||||||
id: this.taskInfo.id
|
id: this.taskInfo.id
|
||||||
});
|
});
|
||||||
|
if (res.data?.template_info?.extend) {
|
||||||
|
if (res.data?.template_info?.extend?.goods_id && typeof res.data?.template_info?.extend
|
||||||
|
?.goods_id !== 'object') {
|
||||||
|
res.data.template_info.extend.goods_id = res.data?.template_info?.extend?.goods_id.split(',');
|
||||||
|
res.data.template_info.extend.store_name = res.data?.template_info?.extend?.store_name.split(
|
||||||
|
';') || [];
|
||||||
|
}
|
||||||
|
this.extend_info = res.data?.template_info?.extend;
|
||||||
|
}
|
||||||
this.taskInfo = res.data;
|
this.taskInfo = res.data;
|
||||||
let dict = await dictDataListsTypeValue({
|
let dict = await dictDataListsTypeValue({
|
||||||
type_value: this.type_value
|
type_value: this.type_value
|
||||||
|
// type_value: 'town_task_type_master'
|
||||||
})
|
})
|
||||||
dict.data.forEach((item) => {
|
dict.data.forEach((item) => {
|
||||||
if (item.id == this.taskInfo.type) {
|
if (item.id == this.taskInfo.type) {
|
||||||
@ -57,6 +89,17 @@
|
|||||||
})
|
})
|
||||||
this.skeleton = false;
|
this.skeleton = false;
|
||||||
},
|
},
|
||||||
|
copyName(str = "", type = "商品名称") {
|
||||||
|
if (str) uni.setClipboardData({
|
||||||
|
data: str + "",
|
||||||
|
success: (e) => {
|
||||||
|
Toast(type + '已复制')
|
||||||
|
},
|
||||||
|
fail: (e) => {
|
||||||
|
Toast('复制失败')
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
@ -138,6 +181,26 @@
|
|||||||
border: 2px solid transparent;
|
border: 2px solid transparent;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.store {
|
||||||
|
display: flex;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
font-size: 26rpx;
|
||||||
|
color: #0122c7;
|
||||||
|
margin-top: -10rpx;
|
||||||
|
|
||||||
|
&_name {
|
||||||
|
flex-shrink: 0;
|
||||||
|
padding: 8rpx;
|
||||||
|
border: 5rpx solid #0122c7;
|
||||||
|
border-radius: 10rpx;
|
||||||
|
// background-color: rgba(#0122c7, 0.1);
|
||||||
|
// background-color: rgba(#0122c7, 0.1);
|
||||||
|
max-width: 80vw;
|
||||||
|
margin-right: 10rpx;
|
||||||
|
margin-top: 10rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.loading {
|
.loading {
|
||||||
|
344
subpkg/townTask/villageTask4.vue
Normal file
344
subpkg/townTask/villageTask4.vue
Normal 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>
|
441
subpkg/townTask/villageTask6.vue
Normal file
441
subpkg/townTask/villageTask6.vue
Normal 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, // 审核状态: 1待审核,2已通过,3已驳回
|
||||||
|
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>
|
67
uni_modules/uni-file-picker/changelog.md
Normal file
67
uni_modules/uni-file-picker/changelog.md
Normal file
@ -0,0 +1,67 @@
|
|||||||
|
## 1.0.4(2023-03-29)
|
||||||
|
- 修复 手动上传删除一个文件后不能再上传的bug
|
||||||
|
## 1.0.3(2022-12-19)
|
||||||
|
- 新增 sourceType 属性, 可以自定义图片和视频选择的来源
|
||||||
|
## 1.0.2(2022-07-04)
|
||||||
|
- 修复 在uni-forms下样式不生效的bug
|
||||||
|
## 1.0.1(2021-11-23)
|
||||||
|
- 修复 参数为对象的情况下,url在某些情况显示错误的bug
|
||||||
|
## 1.0.0(2021-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.16(2021-11-08)
|
||||||
|
- 修复 传入空对象 ,显示错误的Bug
|
||||||
|
## 0.2.15(2021-08-30)
|
||||||
|
- 修复 return-type="object" 时且存在v-model时,无法删除文件的Bug
|
||||||
|
## 0.2.14(2021-08-23)
|
||||||
|
- 新增 参数中返回 fileID 字段
|
||||||
|
## 0.2.13(2021-08-23)
|
||||||
|
- 修复 腾讯云传入fileID 不能回显的bug
|
||||||
|
- 修复 选择图片后,不能放大的问题
|
||||||
|
## 0.2.12(2021-08-17)
|
||||||
|
- 修复 由于 0.2.11 版本引起的不能回显图片的Bug
|
||||||
|
## 0.2.11(2021-08-16)
|
||||||
|
- 新增 clearFiles(index) 方法,可以手动删除指定文件
|
||||||
|
- 修复 v-model 值设为 null 报错的Bug
|
||||||
|
## 0.2.10(2021-08-13)
|
||||||
|
- 修复 return-type="object" 时,无法删除文件的Bug
|
||||||
|
## 0.2.9(2021-08-03)
|
||||||
|
- 修复 auto-upload 属性失效的Bug
|
||||||
|
## 0.2.8(2021-07-31)
|
||||||
|
- 修复 fileExtname属性不指定值报错的Bug
|
||||||
|
## 0.2.7(2021-07-31)
|
||||||
|
- 修复 在某种场景下图片不回显的Bug
|
||||||
|
## 0.2.6(2021-07-30)
|
||||||
|
- 修复 return-type为object下,返回值不正确的Bug
|
||||||
|
## 0.2.5(2021-07-30)
|
||||||
|
- 修复(重要) H5 平台下如果和uni-forms组件一同使用导致页面卡死的问题
|
||||||
|
## 0.2.3(2021-07-28)
|
||||||
|
- 优化 调整示例代码
|
||||||
|
## 0.2.2(2021-07-27)
|
||||||
|
- 修复 vue3 下赋值错误的Bug
|
||||||
|
- 优化 h5平台下上传文件导致页面卡死的问题
|
||||||
|
## 0.2.0(2021-07-13)
|
||||||
|
- 组件兼容 vue3,如何创建vue3项目,详见 [uni-app 项目支持 vue3 介绍](https://ask.dcloud.net.cn/article/37834)
|
||||||
|
## 0.1.1(2021-07-02)
|
||||||
|
- 修复 sourceType 缺少默认值导致 ios 无法选择文件
|
||||||
|
## 0.1.0(2021-06-30)
|
||||||
|
- 优化 解耦与uniCloud的强绑定关系 ,如不绑定服务空间,默认autoUpload为false且不可更改
|
||||||
|
## 0.0.11(2021-06-30)
|
||||||
|
- 修复 由 0.0.10 版本引发的 returnType 属性失效的问题
|
||||||
|
## 0.0.10(2021-06-29)
|
||||||
|
- 优化 文件上传后进度条消失时机
|
||||||
|
## 0.0.9(2021-06-29)
|
||||||
|
- 修复 在uni-forms 中,删除文件 ,获取的值不对的Bug
|
||||||
|
## 0.0.8(2021-06-15)
|
||||||
|
- 修复 删除文件时无法触发 v-model 的Bug
|
||||||
|
## 0.0.7(2021-05-12)
|
||||||
|
- 新增 组件示例地址
|
||||||
|
## 0.0.6(2021-04-09)
|
||||||
|
- 修复 选择的文件非 file-extname 字段指定的扩展名报错的Bug
|
||||||
|
## 0.0.5(2021-04-09)
|
||||||
|
- 优化 更新组件示例
|
||||||
|
## 0.0.4(2021-04-09)
|
||||||
|
- 优化 file-extname 字段支持字符串写法,多个扩展名需要用逗号分隔
|
||||||
|
## 0.0.3(2021-02-05)
|
||||||
|
- 调整为uni_modules目录规范
|
||||||
|
- 修复 微信小程序不指定 fileExtname 属性选择失败的Bug
|
@ -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
|
||||||
|
};
|
@ -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>
|
@ -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>
|
@ -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>
|
109
uni_modules/uni-file-picker/components/uni-file-picker/utils.js
Normal file
109
uni_modules/uni-file-picker/components/uni-file-picker/utils.js
Normal 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
|
||||||
|
}
|
83
uni_modules/uni-file-picker/package.json
Normal file
83
uni_modules/uni-file-picker/package.json
Normal 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"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
11
uni_modules/uni-file-picker/readme.md
Normal file
11
uni_modules/uni-file-picker/readme.md
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
|
||||||
|
## FilePicker 文件选择上传
|
||||||
|
|
||||||
|
> **组件名:uni-file-picker**
|
||||||
|
> 代码块: `uFilePicker`
|
||||||
|
|
||||||
|
|
||||||
|
文件选择上传组件,可以选择图片、视频等任意文件并上传到当前绑定的服务空间
|
||||||
|
|
||||||
|
### [查看文档](https://uniapp.dcloud.io/component/uniui/uni-file-picker)
|
||||||
|
#### 如使用过程中有任何问题,或者您对uni-ui有一些好的建议,欢迎加入 uni-ui 交流群:871950839
|
Loading…
x
Reference in New Issue
Block a user