Compare commits

...

19 Commits
master ... main

Author SHA1 Message Date
THK3121
5ce6dd0e9e 先货后款,样式修改 2023-07-15 17:27:06 +08:00
THK3121
cc5ff53177 交易大厅的一点样式 2023-07-14 13:34:12 +08:00
THK3121
fbbaf79080 先货后款,流程,样式,交互,修改 2023-07-14 11:37:34 +08:00
THK3121
b4c6386686 订单跳转,订单详情,商品导入,线上导入,样式修改 2023-07-12 15:23:13 +08:00
THK3121
b8178bdf2b 订单列表,订单详情修改 2023-07-11 18:01:46 +08:00
THK3121
893ca1ed81 订单监控,付款跳转,商户设置 2023-07-11 16:08:44 +08:00
THK3121
1231351d29 商户开通信用购 2023-07-10 13:38:39 +08:00
THK3121
24415dc4ad 先货后款,入库,下单.收货,同意 2023-07-10 10:11:29 +08:00
THK3121
42b860b90e 完整先货后款付款流程 2023-07-08 16:58:21 +08:00
THK3121
05ef84a30b Merge branch 'bill' of http://git.excellentkk.cn/C.C/nk-shop2.0 into bill
# Conflicts:
#	pages/users/order_list/index.vue
2023-07-08 10:55:14 +08:00
THK3121
133493ecb8 入库样式修改 2023-07-08 10:46:55 +08:00
67063a6190 修改订单列表 2023-07-08 10:42:02 +08:00
222d240bd7 回滚订单列表 2023-07-07 17:59:40 +08:00
THK3121
acb22b28da 先货后款完成后订单付款 2023-07-07 17:31:44 +08:00
THK3121
1054b127c4 Merge branch 'bill' of http://git.excellentkk.cn/C.C/nk-shop2.0 into bill 2023-07-07 11:03:37 +08:00
THK3121
4261b729f1 先货后款部分页面布局+功能 2023-07-07 11:03:32 +08:00
ea83d7c29c 添加订单监控页面 2023-07-07 10:56:09 +08:00
THK3121
273fa133ed 先货后款,支付流程 2023-07-05 16:39:46 +08:00
THK3121
0379a03adc 订单详情弹窗 2023-07-04 15:26:00 +08:00
64 changed files with 11221 additions and 4738 deletions

View File

@ -9,8 +9,9 @@
// | Author: CRMEB Team <admin@crmeb.com> // | Author: CRMEB Team <admin@crmeb.com>
// +---------------------------------------------------------------------- // +----------------------------------------------------------------------
// #ifdef APP-PLUS // #ifdef APP-PLUS
var jpushModule = uni.requireNativePlugin("JG-JPush"); let jpushModule = uni.requireNativePlugin("JG-JPush");
// #endif import { // #endif
import {
checkLogin checkLogin
} from "./libs/login"; } from "./libs/login";
import { import {
@ -289,6 +290,7 @@
@import 'static/css/base.css'; @import 'static/css/base.css';
@import 'static/iconfont/iconfont.css'; @import 'static/iconfont/iconfont.css';
@import 'static/iconfont/iconlihai.css'; @import 'static/iconfont/iconlihai.css';
@import 'static/iconfont/icontan.css';
@import 'static/css/style.scss'; @import 'static/css/style.scss';
view { view {

View File

@ -15,6 +15,7 @@ import request from "@/utils/request.js";
export function getStatisticsInfo() { export function getStatisticsInfo() {
return request.get("admin/order/statistics", {}, { login: true }); return request.get("admin/order/statistics", {}, { login: true });
} }
/** /**
* 订单月统计 * 订单月统计
*/ */
@ -33,6 +34,18 @@ export function getAdminOrderList(where) {
export function setAdminOrderPrice(merId, id, data) { export function setAdminOrderPrice(merId, id, data) {
return request.post("admin/" + merId + "/price/" + id, data, { login: true }); return request.post("admin/" + merId + "/price/" + id, data, { login: true });
} }
/**
* 同意先货后款
*/
export function postconfirm(merId, data) {
return request.post("admin/" + merId + "/confirm" , data, { login: true });
}
/**
* 先货后款订单结算
*/
export function postsettle(merId, data) {
return request.post("admin/" + merId + "/settle" , data, { login: true });
}
/** /**
* 订单备注 * 订单备注
*/ */
@ -211,3 +224,10 @@ export function setRefundMark(merId, orderId, data) {
export function orderCancellation(merId, id) { export function orderCancellation(merId, id) {
return request.post(`admin/${merId}/verify/${id}`); return request.post(`admin/${merId}/verify/${id}`);
} }
/**
* 去核销
* @param object data
*/
export function purchaseOrder(where, merId) {
return request.get(`admin/${merId}/purchaseOrder`, where, { login: true });
}

View File

@ -107,7 +107,7 @@ export function orderDel(id) {
} }
/** /**
* 订单详情 * 已付款订单详情
* @param string uni * @param string uni
*/ */
export function getOrderDetail(uni) { export function getOrderDetail(uni) {
@ -115,11 +115,11 @@ export function getOrderDetail(uni) {
} }
/** /**
* 订单详情 * 未付款订单详情
* @param string uni * @param string uni
*/ */
export function groupOrderDetail(uni) { export function groupOrderDetail(uni,product_type) {
return request.get('order/group_order_detail/' + uni); return request.get('order/group_order_detail/' + uni+'?product_type=' + product_type);
} }
// 支付状态订单 // 支付状态订单

View File

@ -13,7 +13,12 @@ import request from "@/utils/request.js";
* 获取商品详情 * 获取商品详情
*/ */
export const getProductDetailsAPI = (data) => request.get('micro/product_details', data) export const getProductDetailsAPI = (data) => request.get('micro/product_details', data)
/**
* 线下导入
*/
export function postImport(merid,data) {
return request.post(`server/${merid}/product/stockIn`, data);
}
/** /**
* 获取商户基本信息 http://127.0.0.1:8324/api/store/merchant/info?id=4 * 获取商户基本信息 http://127.0.0.1:8324/api/store/merchant/info?id=4
*/ */

View File

@ -73,7 +73,7 @@
<view class="right-btn-box"> <view class="right-btn-box">
<view class="btn-item err" v-if="item.is_refund ==1">退款中 x {{item.product_num - item.refund_num}}</view> <view class="btn-item err" v-if="item.is_refund ==1">退款中 x {{item.product_num - item.refund_num}}</view>
<view class='btn-item err' v-if="item.is_refund >1">已退款 x {{item.product_num - item.refund_num}}</view> <view class='btn-item err' v-if="item.is_refund >1">已退款 x {{item.product_num - item.refund_num}}</view>
<view class="btn-item" v-if="item.is_refund ==0 && evaluate!=9 && orderData.refund_status || item.refund_num > 0" @click.stop="refund(item)">申请退款</view> <view class="btn-item" v-if="item.is_reply == 0 && evaluate !==2 && item.is_refund < 1" @click.stop="refund(item)">申请退款</view>
<view class='btn-item' v-if='item.is_reply==0 && evaluate==2 && item.refund_num > 0' @click.stop="evaluateTap(item.order_product_id,orderId)">去评价</view> <view class='btn-item' v-if='item.is_reply==0 && evaluate==2 && item.refund_num > 0' @click.stop="evaluateTap(item.order_product_id,orderId)">去评价</view>
<view class='btn-item on' v-else-if="item.is_reply==1 && evaluate==2">已评价</view> <view class='btn-item on' v-else-if="item.is_reply==1 && evaluate==2">已评价</view>
</view> </view>

View File

@ -78,6 +78,7 @@
}); });
}, },
goPay: function(number, paytype) { goPay: function(number, paytype) {
console.log(this.payMode);
if (this.isCall) { if (this.isCall) {
return this.$emit('onChangeFun', { return this.$emit('onChangeFun', {
action: 'payCheck', action: 'payCheck',
@ -98,6 +99,7 @@
// #endif // #endif
} else if (paytype == 'balance') { } else if (paytype == 'balance') {
type = 'balance'; type = 'balance';
console.log('123');
}else if(paytype == 'alipay'){ }else if(paytype == 'alipay'){
// #ifndef MP // #ifndef MP
type = 'alipay'; type = 'alipay';
@ -105,6 +107,9 @@
// #ifdef MP // #ifdef MP
type = 'alipayQr'; type = 'alipayQr';
// #endif // #endif
}else if(paytype =='creditBuy'){
console.log('123123');
type='creditBuy'
} }
if (!that.order_id) return that.$util.Tips({ if (!that.order_id) return that.$util.Tips({
title: '请选择要支付的订单' title: '请选择要支付的订单'
@ -375,7 +380,7 @@
border-radius: 16rpx 16rpx 0 0; border-radius: 16rpx 16rpx 0 0;
background-color: #fff; background-color: #fff;
padding-bottom: 60rpx; padding-bottom: 60rpx;
z-index: 99; z-index: 99999;
transition: all 0.3s cubic-bezier(0.25, 0.5, 0.5, 0.9); transition: all 0.3s cubic-bezier(0.25, 0.5, 0.5, 0.9);
transform: translate3d(0, 100%, 0); transform: translate3d(0, 100%, 0);
} }

View File

@ -1,9 +1,9 @@
{ {
"name" : "CRMEB", "name" : "惠农生活",
"appid" : "__UNI__3A527D1", "appid" : "__UNI__3A527D1",
"description" : "", "description" : "",
"versionName" : "1.0.15", "versionName" : "1.0.18",
"versionCode" : 138, "versionCode" : 142,
"transformPx" : false, "transformPx" : false,
/* 5+App */ /* 5+App */
"app-plus" : { "app-plus" : {

View File

@ -227,11 +227,9 @@
"enablePullDownRefresh": false "enablePullDownRefresh": false
} }
} }, {
,{ "path": "teach_video/teach_video",
"path" : "teach_video/teach_video", "style": {
"style" :
{
"navigationBarTitleText": "教学视频", "navigationBarTitleText": "教学视频",
"enablePullDownRefresh": false, "enablePullDownRefresh": false,
"navigationStyle": "custom" "navigationStyle": "custom"
@ -249,12 +247,24 @@
"navigationBarTitleText": "忘记密码" "navigationBarTitleText": "忘记密码"
} }
}, },
{
"path": "online_warehousing/index",
"style": {
"navigationBarTitleText": "采购订单"
}
},
{ {
"path": "user_setting/index", "path": "user_setting/index",
"style": { "style": {
"navigationBarTitleText": "设置" "navigationBarTitleText": "设置"
} }
}, },
{
"path": "supply_procurement/index",
"style": {
"navigationBarTitleText": "供货采购"
}
},
// //
{ {
"path": "user_about/index", "path": "user_about/index",
@ -381,7 +391,7 @@
} }
}, },
{ {
"path": "gather_list/index" , "path": "gather_list/index",
"style": { "style": {
"navigationBarTitleText": "提现流水" "navigationBarTitleText": "提现流水"
} }
@ -474,6 +484,12 @@
"navigationBarTitleText": "我的订单" "navigationBarTitleText": "我的订单"
} }
}, },
{
"path": "order_list/order",
"style": {
"navigationBarTitleText": "我的订单"
}
},
{ {
"path": "order_list/search", "path": "order_list/search",
"style": { "style": {
@ -661,6 +677,20 @@
"enablePullDownRefresh": false "enablePullDownRefresh": false
} }
}, {
"path": "payment/payment",
"style": {
"navigationBarTitleText": "",
"enablePullDownRefresh": false
}
}, {
"path": "trading_hall/index",
"style": {
"navigationBarTitleText": "",
"enablePullDownRefresh": false
}
} }
] ]
}, },
@ -822,6 +852,12 @@
"enablePullDownRefresh": false "enablePullDownRefresh": false
} }
}, {
"path": "order/monitor",
"style": {
"navigationBarTitleText": "订单监控",
"enablePullDownRefresh": false
}
} }
] ]
}, },
@ -949,7 +985,7 @@
"path": "plant_release/index", "path": "plant_release/index",
"style": { "style": {
"navigationBarTitleText": "内容发布", "navigationBarTitleText": "内容发布",
"enablePullDownRefresh":true "enablePullDownRefresh": false
} }
}, },
{ {

View File

@ -77,13 +77,69 @@
</view> </view>
</view> </view>
</view> </view>
<view class="public_footer" v-if="this.type_id == 12">
<view class="footer_top">
<image src="@/static/images/jiankong.png"></image>
<text>订单监控</text>
</view>
<view class="footer_bon" v-for="(item,index) in OrderList" :key="index">
<view class="" v-for="(val, key) in item.orderProduct">
<view class="bon_top" :key="key" @click="toDetail(item)">
<view class="public_img">
<image class="public_img" :src="val.cart_info.product.image" mode=""></image>
</view>
<view>
<view class="text_top">
<view class="text">
{{ val.cart_info.product.store_name }}
</view>
<view class="monry">
{{ val.total_price }}
</view>
</view>
<view class="text_order">
订单号: {{ item.order_sn }}
</view>
</view>
</view>
<view class="bon_bon" :key="key" @click="toDetail(item)">
<view class="order">
采购数量
<view class="txt">
{{ val.product_num }}
</view>
</view>
<view class="order" style="border-left: 1px solid #999999;border-right: 1px solid #999999;">
已售数量
<view class="txt">
{{ val.sales_volume }}
</view>
</view>
<view class="order">
库存数量
<view class="txt">
{{ val.product_num - val.sales_volume }}
</view>
</view>
</view>
</view>
</view>
</view>
</view>
<button v-if="this.type_id == 12" class="footer-bnt" @click="navigator()">查看更多 ></button>
<!-- <view class="public-wrapper">
<navigator class="item" :url="`/pages/admin/order/monitor?merId=${mer_id}`"
hover-class="none">
<view class="num">订单监控</view>
</navigator>
</view> -->
<Loading :loaded="loaded" :loading="loading"></Loading> <Loading :loaded="loaded" :loading="loading"></Loading>
</view> </view>
</view> </view>
</template> </template>
<script> <script>
import { getStatisticsInfo, getStatisticsMonth, orderStatistics, orderPrice } from "@/api/admin"; import { getStatisticsInfo, getStatisticsMonth, orderStatistics, orderPrice, purchaseOrder } from "@/api/admin";
import Loading from '@/components/Loading/index.vue' import Loading from '@/components/Loading/index.vue'
export default { export default {
name: 'adminOrder', name: 'adminOrder',
@ -99,22 +155,28 @@
month: {} month: {}
}, },
list: [], list: [],
OrderList: [], //
where: { where: {
page: 1, page: 1,
limit: 15, limit: 10,
status: 1,
keyword: '',
product_type: '' product_type: ''
}, },
loaded: false, loaded: false,
loading: false, loading: false,
mer_id: '', mer_id: '',
type_id: '', //
} }
}, },
onLoad(options) { onLoad(options) {
this.type_id = options.type_id
this.where.product_type = options.product_type ?? 0 this.where.product_type = options.product_type ?? 0
this.mer_id = options.mer_id this.mer_id = options.mer_id
options.product_type ? uni.setStorageSync("PRODUCT_TYPE", 98) : uni.removeStorageSync("PRODUCT_TYPE"); options.product_type ? uni.setStorageSync("PRODUCT_TYPE", 98) : uni.removeStorageSync("PRODUCT_TYPE");
this.getOrderStatistics(this.mer_id); this.getOrderStatistics(this.mer_id);
this.getList(this.mer_id) this.getList(this.mer_id)
this.purchaseOrderList(this.mer_id)
}, },
methods: { methods: {
getIndex: function() { getIndex: function() {
@ -164,6 +226,24 @@
}) })
} }
); );
},
toDetail(item) {
uni.navigateTo({
url: `/pages/admin/orderDetail/index?id=${item.order_id}&mer_id=${item.mer_id}`
})
},
navigator() {
uni.navigateTo({
url: `/pages/admin/order/monitor?merId=${this.mer_id}`
})
},
purchaseOrderList(mer_id) {
this.where.limit = 2
purchaseOrder(this.where, mer_id).then(res => {
console.log(res);
this.OrderList = res.data
console.log(this.OrderList);
})
} }
}, },
onReachBottom() { onReachBottom() {
@ -172,7 +252,7 @@
} }
</script> </script>
<style lang="scss"> <style lang="scss" scoped>
.popupn { .popupn {
position: fixed; position: fixed;
width: 100%; width: 100%;
@ -307,6 +387,14 @@
background-color: #fff; background-color: #fff;
border-radius: 10upx; border-radius: 10upx;
padding-top: 25upx; padding-top: 25upx;
.item {
.num {
display: flex;
justify-content: flex-start;
align-items: center;
}
}
} }
.public-wrapper .nav { .public-wrapper .nav {
@ -340,9 +428,107 @@
border-bottom: 1px solid #f7f7f7; border-bottom: 1px solid #f7f7f7;
height: 70upx; height: 70upx;
font-size: 24upx; font-size: 24upx;
} }
.public-wrapper .conter .item .turnover { .public-wrapper .conter .item .turnover {
color: #d84242; color: #d84242;
} }
.public_footer {
width: 90vw;
margin: auto;
.footer_top {
display: flex;
align-items: center;
margin: 16px 0 16px 0;
image {
width: 22px;
height: 22px;
margin-right: 5px;
}
}
.footer_bon {
width: 100%;
border-radius: 8px;
background-color: #fff;
padding-bottom: 10px;
margin-bottom: 10px;
.bon_top {
display: flex;
justify-content: flex-start;
align-items: center;
.public_img {
width: 60px;
height: 60px;
margin: 12px;
}
.text_top {
display: flex;
justify-content: flex-start;
align-items: center;
margin: 3px 0 3px 3px;
.text {
width: 140px;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
.monry {
margin-left: 10px;
color: #F84221;
}
}
.text_order{
width: 200px;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
margin-left: 3px;
}
}
.bon_bon {
width: 90%;
height: 66px;
background: #F5F5F5;
border-radius: 4px 4px 4px 4px;
display: flex;
justify-content: center;
align-items: center;
text-align: center;
margin: auto;
margin-bottom: 10px;
margin-top: 5px;
.order {
width: 120px;
.txt {
margin-top: 5px;
}
}
}
}
}
.footer-bnt {
width: 100px;
height: 40px;
border-radius: 15px;
margin: auto;
line-height: 40px;
border: 1px solid #CCCCCC;
background-color: #f5f5f5;
color: #999999;
font-size: 13px
}
</style> </style>

View File

@ -0,0 +1,663 @@
<template>
<view class="pos-order-list" ref="container">
<view class="top-header">
<view class="search">
<view class="search-content acea-row row-middle">
<text class="iconfont icon-sousuo"></text>
<input v-model="where.keyword" confirm-type="search" placeholder="请输收货人手机号或订单号搜索" class="input"
@confirm="handleSearch" />
</view>
</view>
</view>
<view class="pubilc_footer">
<view class="footer_bon" v-for="(item,index) in list" :key="index">
<view class="" v-for="(val, key) in item.orderProduct">
<view class="bon_top" :key="key" @click="toDetail(item)">
<view class="public_img">
<image class="public_img" :src="val.cart_info.product.image" mode=""></image>
</view>
<view>
<view class="text_top">
<view class="text">
{{ val.cart_info.product.store_name }}
</view>
<view class="monry">
{{ val.total_price }}
</view>
</view>
<view class="text_order">
订单号: {{ item.order_sn }}
</view>
</view>
</view>
<view class="bon_bon" :key="key" @click="toDetail(item)">
<view class="order">
采购数量
<view class="txt">
{{ val.product_num }}
</view>
</view>
<view class="order" style="border-left: 1px solid #999999;border-right: 1px solid #999999;">
已售数量
<view class="txt">
{{ val.sales_volume }}
</view>
</view>
<view class="order">
库存数量
<view class="txt">
{{ val.product_num - val.sales_volume }}
</view>
</view>
</view>
</view>
</view>
</view>
<Loading :loaded="loaded" :loading="loading"></Loading>
<view v-if="!loading && list.length <= 0" class="nothing">
<image src="/static/images/no_thing.png" mode="widthFix"></image>
<view class="nothing_text">暂无订单~</view>
</view>
</view>
</template>
<script>
import {
purchaseOrder
} from "@/api/admin";
import Loading from '@/components/Loading/index'
export default {
name: "AdminOrderList",
components: {
Loading
},
data() {
return {
current: "",
change: false,
refundMark: false,
types: 1,
where: {
page: 1,
limit: 10,
status: 1,
keyword: '',
product_type: ''
},
list: [],
loaded: false,
loading: false,
refundInfo: {},
orderInfo: {},
status: "",
merId: ''
};
},
watch: {
"$route.params.types": function(newVal) {
let that = this;
if (newVal != undefined) {
that.where.status = newVal;
that.init();
}
},
types: function() {
this.getIndex();
}
},
onLoad(option) {
this.where.product_type = uni.getStorageSync("PRODUCT_TYPE") ?? ""
this.current = "";
this.merId = option.merId;
this.getIndex();
},
methods: {
handleSearch() {
this.loaded = false;
this.where.page = 1;
this.list = [];
this.getIndex();
},
//
getIndex() {
let that = this;
if (that.loading || that.loaded) return;
that.loading = true;
purchaseOrder(that.where, that.merId).then(
res => {
that.loading = false;
that.loaded = res.data.length < that.where.limit;
that.list.push.apply(that.list, res.data);
that.where.page = that.where.page + 1;
},
err => {
that.$util.Tips({
title: err
});
}
);
},
//
init: function() {
this.list = [];
this.where.page = 1;
this.loaded = false;
this.loading = false;
this.getIndex();
this.current = "";
},
toDetail(item) {
uni.navigateTo({
url: `/pages/admin/orderDetail/index?id=${item.order_id}&mer_id=${item.mer_id}`
})
}
},
onReachBottom() {
this.getIndex()
}
}
</script>
<style lang="scss">
.pos-order-list .top-header {
position: fixed;
top: 0;
left: 0;
z-index: 9999;
width: 100%;
background-color: #fff;
}
.pos-order-list .nav {
// width: 100%;
height: 96upx;
font-size: 30upx;
color: #282828;
width: 690rpx;
margin: 0 auto;
}
.pos-order-list .nav .item {
display: inline-block;
text-align: center;
color: #333333;
max-width: 160rpx;
margin-right: 50rpx;
line-height: 96upx;
&:last-child {
margin-right: 0;
}
}
.pos-order-list .nav .item.on {
color: #2291f8;
}
.pos-order-list .list {
margin-top: 100upx;
}
.pos-order-list .list .item {
background-color: #fff;
width: 100%;
position: relative;
}
.pos-order-list .list .item .item-status {
position: absolute;
top: 14rpx;
right: 20rpx;
.iconfont {
font-size: 98rpx;
color: #CCCCCC;
&.on {
color: #FFE3BC;
}
}
}
.pos-order-list .list .item~.item {
margin-top: 24upx;
}
.pos-order-list .list .activity_type {
display: inline-block;
color: #E93323;
font-size: 20rpx;
text-align: center;
border-radius: 5rpx;
padding: 0 4rpx;
line-height: 28rpx;
margin-right: 8rpx;
border: 1rpx solid #E93323;
}
.pos-order-list .list .item .order-num {
height: 124upx;
border-bottom: 1px solid #eee;
font-size: 30upx;
font-weight: bold;
color: #282828;
padding: 0 30upx;
position: relative;
}
.pos-order-list .list .item .order-status {
color: #ff9600;
position: absolute;
top: 24rpx;
right: 20rpx;
text-align: right;
width: 160rpx;
font-weight: normal;
font-size: 26rpx;
}
.pos-order-list .list .item .order-num .time {
font-size: 26upx;
font-weight: normal;
color: #999;
margin-top: -40upx;
}
.pos-order-list .list .item .operation {
padding: 20upx 30upx 20upx 0;
margin: 30upx 0 0 30upx;
border-top: 1rpx solid #EEEEEE;
}
.pos-order-list .list .item .operation .more {
position: relative;
}
.pos-order-list .list .item .operation .icon-gengduo {
font-size: 50upx;
color: #aaa;
}
.pos-order-list .list .item .operation .order .arrow {
width: 0;
height: 0;
border-left: 11upx solid transparent;
border-right: 11upx solid transparent;
border-top: 20upx solid #e5e5e5;
position: absolute;
left: 15upx;
bottom: -18upx;
}
.pos-order-list .list .item .operation .order .arrow:before {
content: '';
width: 0;
height: 0;
border-left: 7upx solid transparent;
border-right: 7upx solid transparent;
border-top: 20upx solid #fff;
position: absolute;
left: -7upx;
bottom: 0;
}
.pos-order-list .list .item .operation .order {
width: 200upx;
background-color: #fff;
border: 1px solid #eee;
border-radius: 10upx;
position: absolute;
top: -100upx;
z-index: 9;
}
.pos-order-list .list .item .operation .order .items {
height: 77upx;
line-height: 77upx;
text-align: center;
}
.pos-order-list .list .item .operation .order .items~.items {
border-top: 1px solid #f5f5f5;
}
.pos-order-list .list .item .operation .bnt {
font-size: 28upx;
color: #5c5c5c;
width: 170upx;
height: 60upx;
border-radius: 30upx;
border: 1px solid #bbb;
text-align: center;
line-height: 60upx;
}
.pos-order-list .list .item .operation .bnt_color {
border: none;
color: #fff;
background: linear-gradient(90deg, #2291F8 0%, #1CD1DC 100%);
}
.pos-order-list .list .item .operation .bnt~.bnt {
margin-left: 14upx;
}
.pos-order-goods {
padding: 0 30upx;
background-color: #fff;
}
.pos-order-goods .goods {
padding-top: 20rpx;
overflow: hidden;
}
.pos-order-goods .goods~.goods {
border-top: 1px dashed #e5e5e5;
}
.pos-order-goods .cancellate {
font-size: 24rpx;
float: right;
margin-top: 10rpx;
text {
margin-left: 26rpx;
}
}
.pos-order-goods .cancelled {
color: #FF9600;
}
.pos-order-goods .goods .uncancell {
color: #999999;
}
.pos-order-goods .goods .picTxt {
width: 515upx;
}
.pos-order-goods .goods .picTxt .pictrue {
width: 130upx;
height: 130upx;
}
.pos-order-goods .goods .picTxt .pictrue image {
width: 100%;
height: 100%;
border-radius: 6upx;
}
.pos-order-goods .goods .picTxt .text {
flex-direction: column;
width: 365upx;
}
.pos-order-goods .goods .picTxt .text .info {
font-size: 28upx;
color: #282828;
&.refund-info {
width: 460upx;
}
}
.refund-y-money {
margin-top: 16rpx;
font-size: 26rpx;
}
.pos-order-goods .goods .picTxt .text .attr {
margin-top: 5rpx;
font-size: 24upx;
color: #999;
}
.pos-order-goods .goods .money {
width: 164upx;
text-align: right;
font-size: 28upx;
&.refund-money {
width: auto;
position: relative;
top: -50rpx;
.num {
color: #999999;
}
}
.refund-num {
font-size: 24rpx;
color: #282828;
}
}
.pos-order-goods .goods .money .x-money {
color: #282828;
}
.pos-order-goods .goods .money .num {
color: #ff9600;
margin: 5upx 0;
}
.pos-order-goods .goods .money .y-money {
color: #999;
text-decoration: line-through;
}
.pos-order-goods .goods .refund_num {
display: inline-block;
margin-left: 10rpx;
}
.public-total {
font-size: 28upx;
color: #282828;
height: 92upx;
line-height: 92upx;
text-align: right;
padding: 0 30upx;
background-color: #fff;
}
.public-total .money {
color: #ff4c3c;
}
.nothing {
margin-top: 200rpx;
text-align: center;
}
.nothing_text {
margin-top: 20rpx;
color: #999999;
}
.priceChange {
position: fixed;
width: 580upx;
background-color: #fff;
border-radius: 10upx;
top: 50%;
left: 50%;
margin-left: -290upx;
margin-top: -335upx;
z-index: 666;
transition: all 0.3s ease-in-out 0s;
transform: scale(0);
opacity: 0;
}
.priceChange.on {
opacity: 1;
transform: scale(1);
}
.priceChange .priceTitle {
background: url("~@/static/images/pricetitle.jpg") no-repeat;
background-size: 100% 100%;
width: 100%;
height: 160upx;
border-radius: 10upx 10upx 0 0;
text-align: center;
font-size: 40upx;
color: #fff;
line-height: 160upx;
position: relative;
}
.priceChange .priceTitle .iconfont {
position: absolute;
font-size: 40upx;
right: 26upx;
top: 23upx;
width: 40upx;
height: 40upx;
line-height: 40upx;
}
.priceChange .listChange {
padding: 0 40upx;
}
.priceChange .listChange textarea {
box-sizing: border-box;
}
.priceChange .listChange .item {
height: 103upx;
border-bottom: 1px solid #e3e3e3;
font-size: 32upx;
color: #333;
}
.priceChange .modify {
font-size: 32upx;
color: #fff;
width: 490upx;
height: 90upx;
text-align: center;
line-height: 90upx;
border-radius: 45upx;
background-color: #2291f8;
margin: 53upx auto;
}
.priceChange .listChange textarea {
border: 1px solid #eee;
width: 100%;
height: 200upx;
margin-top: 50upx;
border-radius: 10upx;
color: #333;
padding: 20upx;
}
.search {
padding: 17rpx 30rpx;
.search-content {
width: 100%;
height: 60rpx;
padding: 0 30rpx;
border-radius: 30rpx;
background-color: #F5F5F5;
font-size: 26rpx;
}
.iconfont {
margin-right: 10rpx;
font-size: 26rpx;
color: #999999;
}
.input-placeholder {
font-size: 26rpx;
color: #999999;
}
.input {
flex: 1;
}
}
.pubilc_footer {
margin-top: 50px;
.footer_bon {
width: 100%;
border-radius: 8px;
background-color: #fff;
padding-bottom: 10px;
margin-bottom: 10px;
.bon_top {
display: flex;
justify-content: flex-start;
align-items: center;
.public_img {
width: 60px;
height: 60px;
margin: 12px;
}
.text_top {
display: flex;
justify-content: flex-start;
align-items: center;
margin: 3px 0 3px 3px;
.text {
width: 180px;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
.monry {
margin-left: 20px;
color: #F84221;
}
}
.text_order {
width: 200px;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
margin-left: 3px;
}
}
.bon_bon {
width: 90%;
height: 66px;
background: #F5F5F5;
border-radius: 4px 4px 4px 4px;
display: flex;
justify-content: center;
align-items: center;
text-align: center;
margin: auto;
margin-bottom: 10px;
margin-top: 5px;
.order {
width: 120px;
.txt {
margin-top: 5px;
}
}
}
}
}
</style>

View File

@ -86,7 +86,7 @@
</view> </view>
<view class="item acea-row row-between"> <view class="item acea-row row-between">
<view>支付方式</view> <view>支付方式</view>
<view class="conter">{{ orderInfo.pay_type == 0 ? "余额支付" : (orderInfo.pay_type == 1 || orderInfo.pay_type == 2 || orderInfo.pay_type == 3) ? "微信支付" : "支付宝支付" }}</view> <view class="conter">{{ orderInfo.pay_type == 0 ? "余额支付" : (orderInfo.pay_type == 1 || orderInfo.pay_type == 2 || orderInfo.pay_type == 3) ? "微信支付" : "先货后款" }}</view>
</view> </view>
<view class="item acea-row row-between"> <view class="item acea-row row-between">
<view>买家留言</view> <view>买家留言</view>
@ -148,6 +148,12 @@
<view style="height:120upx;"></view> <view style="height:120upx;"></view>
<view class="footer acea-row row-right row-middle" v-if="goname != 'looks'"> <view class="footer acea-row row-right row-middle" v-if="goname != 'looks'">
<view class="more"></view> <view class="more"></view>
<view class="bnt cancel" v-if="orderInfo.pay_type == 8 && orderInfo.status == 12" @click="tongyi(order_id,1)">
同意
</view>
<view class="bnt cancel" v-if="orderInfo.pay_type == 8 && orderInfo.status == 12" @click="tongyi(order_id,2)">
拒绝
</view>
<view class="bnt cancel" @click="modify('0')" v-if="orderInfo.paid == 0"> <view class="bnt cancel" @click="modify('0')" v-if="orderInfo.paid == 0">
一键改价 一键改价
</view> </view>
@ -185,7 +191,8 @@
setAdminOrderRemark, setAdminOrderRemark,
setOfflinePay, setOfflinePay,
setOrderRefund, setOrderRefund,
orderCancellation orderCancellation,
postconfirm
} from "@/api/admin"; } from "@/api/admin";
import { isMoney } from '@/utils/validate.js' import { isMoney } from '@/utils/validate.js'
import { HTTP_REQUEST_URL } from '@/config/app'; import { HTTP_REQUEST_URL } from '@/config/app';
@ -225,12 +232,12 @@
}, },
onLoad: function(option) { onLoad: function(option) {
let self = this let self = this
this.order_id = option.id self.order_id = option.id
this.mer_id = option.mer_id self.mer_id = option.mer_id
this.goname = option.goname self.goname = option.goname
this.getIndex(); self.getIndex();
// #ifdef H5 // #ifdef H5
this.$nextTick(function() { self.$nextTick(function() {
var clipboard = new ClipboardJS('.copy-data'); var clipboard = new ClipboardJS('.copy-data');
// var copybtn = document.getElementsByClassName("copy-data"); // var copybtn = document.getElementsByClassName("copy-data");
// var clipboard = new Clipboard(copybtn); // var clipboard = new Clipboard(copybtn);
@ -249,6 +256,26 @@
}, },
methods: { methods: {
//
tongyi(id,number){
let data={
id:id,
type:number
}
if(number == 1){
this.$nextTick(()=>{
uni.navigateTo({
url:`/pages/admin/orderList/index?types=1&merId=${this.mer_id}`
})
})
}else if(number == 2){
uni.navigateTo({
url:`/pages/admin/orderList/index?types=1&merId=${this.mer_id}`
})
}
postconfirm(this.mer_id,data).then(res=>{
})
},
more: function() { more: function() {
this.order = !this.order; this.order = !this.order;
}, },

View File

@ -130,17 +130,33 @@
</view> </view>
</view> </view>
<view class="public-total"> <view class="public-total" v-if="item.pay_type !== 8">
{{ item.total_num }}件商品 {{ item.total_num }}件商品
<span v-if="where.status <= 1"></span> <span v-if="where.status <= 1"></span>
<span v-else></span> <span v-else></span>
支付 支付
<span class="money">{{ item.pay_price }}</span> (邮费 ¥{{ item.pay_postage}}) <span class="money">{{ item.pay_price }}</span> (邮费 ¥{{ item.pay_postage}})
</view> </view>
<view class="public-total" v-else >
先货后款
<span v-if="where.status <= 1"></span>
<span v-else></span>
支付
<span class="money">0.00</span> (邮费 ¥{{ item.pay_postage}})
</view>
<view class="public-total" v-if="item.pay_type == 8 ">
{{item.total_num}}件商品结算周期到期后付款{{ item.pay_price }}
</view>
<view class="operation acea-row row-between-wrapper"> <view class="operation acea-row row-between-wrapper">
<view class="more"> <view class="more">
</view> </view>
<view class="acea-row row-middle"> <view class="acea-row row-middle">
<view class="bnt" v-if="item.pay_type == 8 && item.status == 12" @click="tongyi(item.group_order_id,1)">
同意
</view>
<view class="bnt" v-if="item.pay_type == 8 && item.status == 12 " @click="tongyi(item.group_order_id,2)">
拒绝
</view>
<view class="bnt" @click="modify(item, 0)" v-if="where.status == 1 && item.activity_type != 2"> <view class="bnt" @click="modify(item, 0)" v-if="where.status == 1 && item.activity_type != 2">
一键改价 一键改价
</view> </view>
@ -196,7 +212,8 @@
setOfflinePay, setOfflinePay,
setOrderRefund, setOrderRefund,
refundOrderReceive, refundOrderReceive,
setRefundMark setRefundMark,
postconfirm
} from "@/api/admin"; } from "@/api/admin";
import Loading from '@/components/Loading/index' import Loading from '@/components/Loading/index'
import PriceChange from '@/components/PriceChange/index' import PriceChange from '@/components/PriceChange/index'
@ -249,9 +266,30 @@
this.getIndex(); this.getIndex();
}, },
methods: { methods: {
//
tongyi(id,number){
let data={
id:id,
type:number
}
if(number == 1){
this.$nextTick(()=>{
this.where.status = 2;
delete this.where.is_verify;
this.init();
})
}else if(number == 2){
uni.navigateTo({
url:`/pages/admin/orderList/index?types=1&merId=${this.merId}`
})
}
postconfirm(this.merId,data).then(res=>{
console.log(res);
})
},
handleSearch() { handleSearch() {
this.loaded = false; this.loaded = false;
this.where.page = 1; this.where.page = 3;
this.list = []; this.list = [];
this.getIndex(); this.getIndex();
}, },
@ -279,6 +317,7 @@
that.loaded = res.data.list.length < that.where.limit; that.loaded = res.data.list.length < that.where.limit;
that.list.push.apply(that.list, res.data.list); that.list.push.apply(that.list, res.data.list);
that.where.page = that.where.page + 1; that.where.page = that.where.page + 1;
console.log(that.list);
}, },
err => { err => {
that.$util.Tips({ title: err }); that.$util.Tips({ title: err });
@ -631,7 +670,7 @@
.pos-order-list .list .item .operation .bnt { .pos-order-list .list .item .operation .bnt {
font-size: 28upx; font-size: 28upx;
color: #5c5c5c; color: #5c5c5c;
width: 170upx; width: 160upx;
height: 60upx; height: 60upx;
border-radius: 30upx; border-radius: 30upx;
border: 1px solid #bbb; border: 1px solid #bbb;

View File

@ -13,7 +13,7 @@
<text class="text">在售管理</text> <text class="text">在售管理</text>
</view> </view>
<view class="examine" <view class="examine"
@click="navigator(`/pages/admin/order/index?mer_id=${mer_id}&product_type=98`)"> @click="navigator(`/pages/admin/order/index?mer_id=${mer_id}&product_type=98&type_id=${userInfoData.mer_info.type_id}`)">
<image class="icon_img" :src="`${prefix}cwgl.png`" mode="aspectFill"></image> <image class="icon_img" :src="`${prefix}cwgl.png`" mode="aspectFill"></image>
<text class="text">财务管理</text> <text class="text">财务管理</text>
</view> </view>
@ -64,11 +64,12 @@
<view class="title">我的店铺</view> <view class="title">我的店铺</view>
<view class="content "> <view class="content ">
<view class="examine" <view class="examine"
@click="navigator(`/pages/nongKe/supply_chain/supplier?type_id=12&isDetail=1&product_type=98&cate_id=${userInfoData.mer_info.category_id}`)"> @click="navigator(`/pages/users/supply_procurement/index?type_id=12&isDetail=1&product_type=98&cate_id=${userInfoData.mer_info.category_id}`)">
<!-- @click="navigator(`/pages/nongKe/supply_chain/supplier?type_id=12&isDetail=1&product_type=98&cate_id=${userInfoData.mer_info.category_id}`) -->
<image class="icon_img" :src="`${prefix}ghcg.png`" mode="aspectFill"></image> <image class="icon_img" :src="`${prefix}ghcg.png`" mode="aspectFill"></image>
<text class="text">供货采购</text> <text class="text">供货采购</text>
</view> </view>
<view class="examine" @click="navigator('/pages/users/order_list/index?status=-1')"> <view class="examine" @click="navigator('/pages/users/order_list/index?status=-1&product_type=98')">
<image class="icon_img" :src="`${prefix}jhgl.png`" mode="aspectFill"></image> <image class="icon_img" :src="`${prefix}jhgl.png`" mode="aspectFill"></image>
<text class="text">进货管理</text> <text class="text">进货管理</text>
</view> </view>
@ -101,7 +102,7 @@
</image> </image>
<text class="text">订单核销</text> <text class="text">订单核销</text>
</view> </view>
<view class="examine" @click="navigator(`/pages/admin/order/index?mer_id=${mer_id}`)"> <view class="examine" @click="navigator(`/pages/admin/order/index?mer_id=${mer_id}&type_id=${userInfoData.mer_info.type_id}`)">
<image class="icon_img" :src="`${prefix}ddgl.png`" mode="aspectFill"> <image class="icon_img" :src="`${prefix}ddgl.png`" mode="aspectFill">
</image> </image>
<text class="text">订单管理</text> <text class="text">订单管理</text>
@ -116,6 +117,21 @@
</image> </image>
<text class="text">商户设置</text> <text class="text">商户设置</text>
</view> </view>
<view class="examine" @click="navigator(`/pages/users/trading_hall/index?mer_id=${mer_id}`)">
<image class="icon_img" src="@/static/images/diaohuo.png" mode="aspectFill">
</image>
<text class="text">交易大厅</text>
</view>
<view class="examine" @click="navigator(`/pages/product/basicSet?mer_id=${mer_id}`, '商户设置')">
<image class="icon_img" src="@/static/images/weituo.png" mode="aspectFill">
</image>
<text class="text">委托销售</text>
</view>
<view class="examine" @click="navigator(`/pages/product/basicSet?mer_id=${mer_id}`, '商户设置')">
<image class="icon_img" src="@/static/images/fabu.png" mode="aspectFill">
</image>
<text class="text">发布管理</text>
</view>
<!-- <view class="examine" @click="navigator(`/pages/users/user_invoice_Finance/index?mer_id=${mer_id}`)"> <!-- <view class="examine" @click="navigator(`/pages/users/user_invoice_Finance/index?mer_id=${mer_id}`)">
<image class="icon_img" src="@/static/images/cwgk.png" mode="aspectFill"> <image class="icon_img" src="@/static/images/cwgk.png" mode="aspectFill">
</image> </image>
@ -172,7 +188,7 @@
</image> </image>
<text class="text">订单核销</text> <text class="text">订单核销</text>
</view> </view>
<view class="examine" @click="navigator(`/pages/admin/order/index?mer_id=${mer_id}`)"> <view class="examine" @click="navigator(`/pages/admin/order/index?mer_id=${mer_id}&type_id=${userInfoData.mer_info.type_id}`)">
<image class="icon_img" :src="`${prefix}ddgl.png`" mode="aspectFill"> <image class="icon_img" :src="`${prefix}ddgl.png`" mode="aspectFill">
</image> </image>
<text class="text">订单管理</text> <text class="text">订单管理</text>

View File

@ -1349,9 +1349,10 @@
postCartAdd(q) postCartAdd(q)
.then(function(res) { .then(function(res) {
that.isOpen = that.attr.cartAttr = false; that.isOpen = that.attr.cartAttr = false;
console.log(that.storeInfo);
if (news) { if (news) {
uni.navigateTo({ uni.navigateTo({
url: `/pages/users/order_confirm/index?cartId=${res.data.cart_id}` url: `/pages/users/order_confirm/index?cartId=${res.data.cart_id}&type_id=${that.storeInfo.merchant.type_id}`
}); });
} else { } else {
that.$util.Tips({ that.$util.Tips({

View File

@ -108,6 +108,8 @@
this.getGoods() this.getGoods()
this.selfLocation() this.selfLocation()
this.Area() this.Area()
this.setPermissions()
// this.openTongZhi()
uni.$on('connectstatusChange',(connectstatus) =>{ uni.$on('connectstatusChange',(connectstatus) =>{
var connectstr = '' var connectstr = ''
if (connectstatus == true) { if (connectstatus == true) {
@ -236,7 +238,7 @@
selfLocation() { selfLocation() {
const that = this const that = this
uni.getLocation({ uni.getLocation({
type: 'gcj02', type: 'wgs84',
timeout: '10', timeout: '10',
success: (res) => { success: (res) => {
let latitude, longitude; let latitude, longitude;
@ -261,6 +263,85 @@
} }
}); });
}, },
/**
* 设置手机通知权限
*/
setPermissions() {
// #ifdef APP-PLUS
if (plus.os.name == 'Android') { // Android
var main = plus.android.runtimeMainActivity();
var pkName = main.getPackageName();
var uid = main.getApplicationInfo().plusGetAttribute("uid");
var NotificationManagerCompat = plus.android.importClass("android.support.v4.app.NotificationManagerCompat");
//android.support.v4androidx
if (NotificationManagerCompat == null) {
NotificationManagerCompat = plus.android.importClass("androidx.core.app.NotificationManagerCompat");
}
var areNotificationsEnabled = NotificationManagerCompat.from(main).areNotificationsEnabled();
//
if (!areNotificationsEnabled) {
uni.showModal({
title: '通知权限开启提醒',
content: '您还没有开启通知权限,无法接受到消息通知,请前往设置!',
showCancel: false,
confirmText: '去设置',
success: function(res) {
if (res.confirm) {
var Intent = plus.android.importClass('android.content.Intent');
var Build = plus.android.importClass("android.os.Build");
//android 8.0
if (Build.VERSION.SDK_INT >= 26) {
var intent = new Intent('android.settings.APP_NOTIFICATION_SETTINGS');
intent.putExtra('android.provider.extra.APP_PACKAGE', pkName);
} else if (Build.VERSION.SDK_INT >= 21) { //android 5.0-7.0
var intent = new Intent('android.settings.APP_NOTIFICATION_SETTINGS');
intent.putExtra("app_package", pkName);
intent.putExtra("app_uid", uid);
} else { //(<21)--
intent.setAction(Settings.ACTION_APPLICATION_DETAILS_SETTINGS);
var uri = Uri.fromParts("package", mainActivity.getPackageName(), null);
intent.setData(uri);
}
//
main.startActivity(intent);
}
}
});
}
} else if (plus.os.name == 'iOS') { // ISO
var isOn = undefined;
var types = 0;
var app = plus.ios.invoke('UIApplication', 'sharedApplication');
var settings = plus.ios.invoke(app, 'currentUserNotificationSettings');
if (settings) {
types = settings.plusGetAttribute('types');
plus.ios.deleteObject(settings);
} else {
types = plus.ios.invoke(app, 'enabledRemoteNotificationTypes');
}
plus.ios.deleteObject(app);
isOn = (0 != types);
if (isOn == false) {
uni.showModal({
title: '通知权限开启提醒',
content: '您还没有开启通知权限,无法接受到消息通知,请前往设置!',
showCancel: false,
confirmText: '去设置',
success: function(res) {
if (res.confirm) {
var app = plus.ios.invoke('UIApplication', 'sharedApplication');
var setting = plus.ios.invoke('NSURL', 'URLWithString:', 'app-settings:');
plus.ios.invoke(app, 'openURL:', setting);
plus.ios.deleteObject(setting);
plus.ios.deleteObject(app);
}
}
});
}
}
// #endif
}
} }
} }
</script> </script>

View File

@ -41,6 +41,35 @@
<navigator class="bottom_purchase" url="./shopping_trolley" open-type="navigate">采购清单</navigator> <navigator class="bottom_purchase" url="./shopping_trolley" open-type="navigate">采购清单</navigator>
<goodsPopup :goodsStatu="isPopupShow" @colses="isPopupShow=false" :goods_info="goodsInfo"></goodsPopup> <goodsPopup :goodsStatu="isPopupShow" @colses="isPopupShow=false" :goods_info="goodsInfo"></goodsPopup>
<u-popup :show="show" @close="close">
<view>
<h3 style=" margin: 15px 5px 5px 24px;">颜色规格</h3>
<scroll-view :scroll-top="scrollTop" scroll-y="true" class="scroll-Y">
<view class="scroll-view-item" v-for="(item,index) in attrValue" :key="index">
<view class="scroll_item_top">
<image :src="Image" mode=""></image>
<view class="text">
<view>{{item.sku}}</view>
<view>库存: <text>{{item.stock}}</text> </view>
</view>
</view>
<view class="scroll_item_bon">
<view class="reduce" @click.stop='subCart(item,index)'>-</view>
<input type="text" v-model="goods[index].cart_num" />
<view class="plus" :class="goods.numAdd ? 'on' : ''" @click.stop='addCart(item,index)'>+</view>
<!-- <u-number-box
button-size="36"
color="#ffffff"
bgColor="#2979ff"
iconStyle="color: #fff"
v-model="number.cart_num"
></u-number-box> -->
</view>
</view>
</scroll-view>
<button class="btn" @click="addshopcart">确定</button>
</view>
</u-popup>
</view> </view>
</template> </template>
@ -52,6 +81,9 @@
} from '@/api/store.js' } from '@/api/store.js'
import { Toast } from '@/libs/uniApi' import { Toast } from '@/libs/uniApi'
import goodsPopup from '../cpns/goodsPopup.vue' import goodsPopup from '../cpns/goodsPopup.vue'
import {
changeCartNum
} from '@/api/order.js';
export default { export default {
components: { components: {
goodsPopup goodsPopup
@ -88,7 +120,16 @@
}, },
id: '', id: '',
order: true, order: true,
num: '' num: '',
show: false,
scrollTop: 0,
attrValue: [],
Image: '',
goods: [{
cart_num: 0
}],
goodsLite: {},
goodsindexL: ''
} }
}, },
onLoad(e) { onLoad(e) {
@ -176,23 +217,27 @@
* 获取产品详情 * 获取产品详情
*/ */
getGoodsDetails(item) { getGoodsDetails(item) {
// console.log('e,item',e,item); console.log(item);
// let that = this; if (item.product.attrValue.length == 1) {
// const count = e.value
// getProductDetail(item.product_id).then(res => {
// const unique = Object.values(res.data.sku)[0].unique
// console.log(res.data.product_id, count, unique,'123123');
// that.goCat(res.data.product_id, count, unique)
// })
let that = this; let that = this;
const count = '1' const count = '1'
// console.log(111);
getProductDetail(item.product_id, { product_type: 98 }).then(res => { getProductDetail(item.product_id, { product_type: 98 }).then(res => {
const unique = Object.values(res.data.sku)[0].unique const unique = Object.values(res.data.sku)[0].unique
that.goCat(res.data.product_id, count, unique) that.goCat(res.data.product_id, count, unique)
}).catch(err => { }).catch(err => {
Toast(err) Toast(err)
}) })
} else {
this.show = true
this.attrValue = item.product.attrValue
this.Image = item.image
for (let i = 1; i < item.product.attrValue.length; i++) {
this.goods.push({
cart_num: 0
})
}
}
}, },
/* /*
* 加入购物车 * 加入购物车
@ -220,8 +265,97 @@
}); });
}); });
}, },
close() {
this.show = false
},
//
addCart(item, index) {
let that = this
that.goods[index].cart_num = that.goods[index].cart_num + 1
that.goods.numAdd = true
that.goodsLite = item
that.goodsindexL = index
let q = {
is_new: 0,
product_id: that.goodsLite.product_id,
cart_num: that.goods[that.goodsindexL].cart_num,
product_attr_unique: that.goodsLite.unique,
// source: this.source,
product_type: 98,
spread_id: ''
};
postCartAdd(q).then(res => {
that.$util.Tips({
title: "添加购物车成功",
});
})
.catch(res => {
this.show = false
return that.$util.Tips({
title: res
});
});
}, },
subCart(item, index) {
let that = this
if (that.goods[index].cart_num == 0) {
return
} else {
that.goods[index].cart_num = that.goods[index].cart_num - 1
that.goods.numAdd = true
that.goodsLite = item
that.goodsindexL = index
let q = {
is_new: 0,
product_id: that.goodsLite.product_id,
cart_num: that.goods[that.goodsindexL].cart_num,
product_attr_unique: that.goodsLite.unique,
// source: this.source,
product_type: 98,
spread_id: ''
};
postCartAdd(q).then(res => {
that.$util.Tips({
title: "添加购物车成功",
});
})
.catch(res => {
this.show = false
return that.$util.Tips({
title: res
});
});
}
},
addshopcart() {
console.log(this.goodsLite);
console.log(this.goodsindexL);
this.show = false
// let that = this
// let q = {
// is_new: 0,
// product_id: that.goodsLite.product_id,
// cart_num: that.goods[that.goodsindexL].cart_num,
// product_attr_unique: that.goodsLite.unique,
// // source: this.source,
// product_type: 98,
// spread_id: ''
// };
// postCartAdd(q).then(res => {
// this.show = false
// that.$util.Tips({
// title: "",
// });
// })
// .catch(res => {
// this.show = false
// return that.$util.Tips({
// title: res
// });
// });
}
},
onReachBottom() { onReachBottom() {
//nomore //nomore
if (this.status != 'nomore') { if (this.status != 'nomore') {
@ -395,4 +529,91 @@
background-color: $uni-theme-color; background-color: $uni-theme-color;
color: #fff; color: #fff;
} }
.scroll-Y {
height: 50vh;
width: 90%;
margin: auto;
}
.scroll-view-item {
font-size: 36rpx;
border-bottom: 1px solid #ccc;
.scroll_item_top {
height: 60px;
display: flex;
justify-content: flex-start;
align-items: center;
image {
width: 50px;
height: 50px;
margin: 5px;
}
.text {
width: 200px;
height: 60px;
float: left;
view {
height: 30px;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
text {
color: #F84221;
}
}
}
}
.scroll_item_bon {
width: 100%;
height: 40px;
display: flex;
justify-content: flex-end;
align-items: center;
.reduce {
width: 30px;
height: 30px;
text-align: center;
color: #BDC4CE;
background: #EEEEEE;
}
input {
width: 50px;
height: 30px;
text-align: center;
}
.plus {
width: 30px;
text-align: center;
height: 30px;
color: #FFFFFF;
background: linear-gradient(180deg, #F98649 0%, #F34E45 100%);
}
.on {
background-color: #e3e3e3;
color: #dedede;
}
}
}
.btn {
width: 100%;
height: 50px;
background: linear-gradient(84deg, #F98649 0%, #F34E45 100%);
border-radius: 24px 24px 24px 24px;
line-height: 50px;
color: white;
}
</style> </style>

View File

@ -242,6 +242,7 @@
currSku: '', currSku: '',
newData: {}, newData: {},
activeRouter: '', activeRouter: '',
type_id:''
}; };
}, },
computed: configMap({ hide_mer_status: 1, recommend_switch: 0, navigation: {} }, mapGetters(['isLogin', computed: configMap({ hide_mer_status: 1, recommend_switch: 0, navigation: {} }, mapGetters(['isLogin',
@ -568,7 +569,7 @@
}) })
if (selectValue.length > 0) { if (selectValue.length > 0) {
uni.navigateTo({ uni.navigateTo({
url: '/pages/users/order_confirm/index?product_type=98&cartId=' + selectValue.join(',') url: `/pages/users/order_confirm/index?product_type=98&cartId=${selectValue.join(',')}&type_id=12`
}); });
} else { } else {
return this.$util.Tips({ return this.$util.Tips({
@ -578,6 +579,7 @@
}, },
// //
addCart: function(goods, index) { addCart: function(goods, index) {
console.log(goods.cart_id);
let that = this; let that = this;
changeCartNum(goods.cart_id, { changeCartNum(goods.cart_id, {
cart_num: goods.cart_num + 1 cart_num: goods.cart_num + 1
@ -671,6 +673,7 @@
let that = this; let that = this;
getCartList({ product_type: 98 }).then(res => { getCartList({ product_type: 98 }).then(res => {
// console.log("", res) // console.log("", res)
this.type_id=res.data.list[0].type_id
res.data.list.forEach((item, index) => { res.data.list.forEach((item, index) => {
item.allCheck = true item.allCheck = true
item.list.forEach((goods, j) => { item.list.forEach((goods, j) => {

View File

@ -289,7 +289,8 @@
merList: [], // merList: [], //
product_type: 0, product_type: 0,
show:false, show:false,
image: '' // image: '' ,//,
credit_buy:'',//
}; };
}, },
onLoad(options) { onLoad(options) {
@ -298,6 +299,7 @@
if (options.street_id != undefined) { if (options.street_id != undefined) {
this.sotreParam.street_id = options.street_id this.sotreParam.street_id = options.street_id
} }
this.credit_buy=options.credit_buy
this.sotreParam.type_id = options.type_id this.sotreParam.type_id = options.type_id
this.sotreParam.type_id = options.type_id && options.type_id.split(',').toString() || '' this.sotreParam.type_id = options.type_id && options.type_id.split(',').toString() || ''
this.sotreParam.category_id = options.cate_id && options.cate_id.split(',').toString() || '' this.sotreParam.category_id = options.cate_id && options.cate_id.split(',').toString() || ''
@ -496,7 +498,8 @@
order: this.sotreParam.order, order: this.sotreParam.order,
category_id: this.sotreParam.category_id, category_id: this.sotreParam.category_id,
type_id: this.sotreParam.type_id, type_id: this.sotreParam.type_id,
street_id: this.sotreParam.street_id street_id: this.sotreParam.street_id,
credit_buy:this.credit_buy
} }
if (this.latitude) { if (this.latitude) {
rqData.location = this.latitude + ',' + this.longitude rqData.location = this.latitude + ',' + this.longitude

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -119,7 +119,8 @@
isOpen:false ,// isOpen:false ,//
moneyBg: '/static/images/couponBg', moneyBg: '/static/images/couponBg',
text: '展开更多', text: '展开更多',
timer: null timer: null,
product_type:'',
}; };
}, },
computed: mapGetters(['isLogin','viewColor','keyColor']), computed: mapGetters(['isLogin','viewColor','keyColor']),
@ -134,12 +135,14 @@
this.order_type = options.order_type; this.order_type = options.order_type;
this.status = options.status || 0; this.status = options.status || 0;
this.msg = options.msg || ''; this.msg = options.msg || '';
this.product_type=options.product_type
if (this.isLogin) { if (this.isLogin) {
this.refreshData(); this.refreshData();
} else { } else {
this.isAuto = true; this.isAuto = true;
this.isShowAuth = true this.isShowAuth = true
} }
console.log(options);
}, },
methods: { methods: {
refreshData(){ refreshData(){
@ -200,14 +203,15 @@
* 去订单详情页面 * 去订单详情页面
*/ */
goOrderDetails: function(e) { goOrderDetails: function(e) {
console.log(this.product_type);
let that = this; let that = this;
if (this.order_pay_info.paid == 0) { if (this.product_type == 98) {
uni.redirectTo({ uni.navigateTo({
url: '/pages/users/order_list/index' url: `/pages/users/order_list/index?status=1&product_type=${this.product_type}`
}) })
} else { } else {
uni.redirectTo({ uni.navigateTo({
url: '/pages/users/order_list/index?status=1' url: '/pages/users/order_list/index?status=1&product_type=0'
}) })
} }

View File

@ -542,8 +542,7 @@
}); });
} else { } else {
uni.redirectTo({ uni.redirectTo({
url: '/pages/plantGrass/plant_detail/index?id=' + res.data.community_id + '&type=' + that url: '/pages/plantGrass/plant_detail/index?id=' + res.data.community_id + '&type=' + that.tabActive
.tabActive
}) })
} }
/** /**

View File

@ -39,11 +39,6 @@
</view> </view>
<view v-if="item.more_thanFlag"> <view v-if="item.more_thanFlag">
<view class="multiSpecifica_container_item">
<view class="multiSpecifica_container_item_label flex-start">库存</view>
<view class="multiSpecifica_container_item_value"><input v-model="item.stock" type="number" placeholder="请填写商品库存" /></view>
</view>
<view class="multiSpecifica_container_item"> <view class="multiSpecifica_container_item">
<view class="multiSpecifica_container_item_label flex-start">商品编号</view> <view class="multiSpecifica_container_item_label flex-start">商品编号</view>
<view class="multiSpecifica_container_item_value"><input v-model="item.bar_code" type="text" placeholder="请填写商品编号" /></view> <view class="multiSpecifica_container_item_value"><input v-model="item.bar_code" type="text" placeholder="请填写商品编号" /></view>
@ -112,12 +107,6 @@
<view class="changePopup_container_content_item_label">原价</view> <view class="changePopup_container_content_item_label">原价</view>
<view class="changePopup_container_content_item_value"><input v-model="batchData.ot_price" type="number" placeholder="0.00" /></view> <view class="changePopup_container_content_item_value"><input v-model="batchData.ot_price" type="number" placeholder="0.00" /></view>
</view> </view>
<view class="changePopup_container_content_item">
<view class="changePopup_container_content_item_label">库存</view>
<view class="changePopup_container_content_item_value"><input v-model="batchData.stock" type="number" placeholder="0.00" /></view>
</view>
<view class="popup_moreThan" @click="popupOpenModel = !popupOpenModel" v-if="!popupOpenModel"> <view class="popup_moreThan" @click="popupOpenModel = !popupOpenModel" v-if="!popupOpenModel">
<text>展开</text> <text>展开</text>
<text class="iconfont">&#xe8ca;</text> <text class="iconfont">&#xe8ca;</text>
@ -182,7 +171,6 @@ export default {
price: '', // price: '', //
cost: '', // cost: '', //
ot_price: '', // ot_price: '', //
stock: '', //
bar_code: '', // bar_code: '', //
weight: '', // weight: '', //
volume: '', // volume: '', //
@ -363,7 +351,6 @@ export default {
price: 0, price: 0,
cost: 0, cost: 0,
ot_price: 0, ot_price: 0,
stock: 0,
bar_code: '', bar_code: '',
weight: 0, weight: 0,
volume: 0, volume: 0,
@ -397,7 +384,6 @@ export default {
price: 0, price: 0,
cost: 0, cost: 0,
ot_price: 0, ot_price: 0,
stock: 0,
bar_code: '', bar_code: '',
weight: 0, weight: 0,
volume: 0, volume: 0,

View File

@ -26,7 +26,6 @@
price: '', // price: '', //
cost: '', // cost: '', //
ot_price: '', // ot_price: '', //
stock: '', //
bar_code: '', // bar_code: '', //
weight: '', // weight: '', //
volume: '', // volume: '', //
@ -56,13 +55,6 @@
type: 'digit', type: 'digit',
holder: '请填写原价', holder: '请填写原价',
model: 'ot_price' model: 'ot_price'
},
{
id: 4,
label: '库存',
type: 'number',
holder: '请填写库存',
model: 'stock'
} }
], ],
moreThanList: [ moreThanList: [

View File

@ -54,7 +54,7 @@
<view class="street_bg"> <view class="street_bg">
<view class="text flex_a_c"> <i class="iconfont icon-xinghao"></i> 店铺街背景图</view> <view class="text flex_a_c"> <i class="iconfont icon-xinghao"></i> 店铺街背景图</view>
<block v-if="images[2].img"> <block v-if="images[2].img">
<u--image :showLoading="true" :src="images[2].img" width="388px" height="210.53rpx" radius="4px" <u--image :showLoading="true" :src="images[2].img" width="360px" height="210.53rpx" radius="4px"
@click="delImg(2)"></u--image> @click="delImg(2)"></u--image>
</block> </block>
<view v-else class="street_img flex_a_c" @click="seleckImage(2)"> <view v-else class="street_img flex_a_c" @click="seleckImage(2)">
@ -126,6 +126,20 @@
<view class="sub_title flex_a_c"><i class="iconfont icon-xinghao"></i>客服电话</view> <view class="sub_title flex_a_c"><i class="iconfont icon-xinghao"></i>客服电话</view>
<input class="com_input" type="number" v-model="servicePhone" placeholder="输入客服电话"> <input class="com_input" type="number" v-model="servicePhone" placeholder="输入客服电话">
</view> </view>
<view class="item_cell flex_a_c">
<view class="sub_title flex_a_c"><i class="iconfont icon-xinghao"></i>开启先货后款</view>
<u-switch v-model="credit_buy" @change="change"></u-switch>
</view>
<view class="item_cell flex_a_c">
<view class="sub_title flex_a_c"><i class="iconfont icon-xinghao"></i>先货后款结算周期</view>
<input type="number" v-model="settle_cycle" placeholder="请输入 /周期单位为:天" >
</view>
<view class="remarks">*周期结算时间范围为:15~90 周期单位为:</view>
<view class="item_cell flex_a_c">
<view class="sub_title flex_a_c"><i class="iconfont icon-xinghao"></i>先货后款结算利率</view>
<input type="number" maxlength="5" v-model="interest_rate" placeholder="请输入 /利率单位为: %">
</view>
<view class="remarks">*利率结算范围为:0.01 ~ 0.1 利率单位为:%</view>
<!-- <view class="item_cell"> <!-- <view class="item_cell">
<view class="if_btn flex_a_c_j_sb"> <view class="if_btn flex_a_c_j_sb">
<text class="sub_title">是否开启商户</text> <text class="sub_title">是否开启商户</text>
@ -224,7 +238,10 @@
overTimeShow: false, overTimeShow: false,
mer_address: '', mer_address: '',
id: '', id: '',
mer_certificate: '' mer_certificate: '',
credit_buy:false,//
interest_rate:'',//
settle_cycle:'',//
} }
}, },
onLoad(e) { onLoad(e) {
@ -258,6 +275,18 @@
this.servicePhone = res.data.service_phone this.servicePhone = res.data.service_phone
this.mer_address = res.data.mer_address this.mer_address = res.data.mer_address
this.merState = res.data.mer_state === 1 ? true : false this.merState = res.data.mer_state === 1 ? true : false
this.credit_buy = res.data.credit_buy === 1 ?true : false
if( res.data.settle_cycle == 0){
this.settle_cycle=''
}else{
this.settle_cycle=res.data.settle_cycle
}
if( res.data.interest_rate == 0){
this.interest_rate=''
}else{
this.interest_rate=res.data.interest_rate
}
// console.log('res', res.data); // console.log('res', res.data);
}).catch(err => { }).catch(err => {
// console.log('err', err); // console.log('err', err);
@ -266,6 +295,11 @@
checkboxChange(val) { checkboxChange(val) {
this.delivery_way = val.detail.value this.delivery_way = val.detail.value
}, },
//
change(e){
this.credit_buy = e
console.log(e);
},
// //
sel(item, i) { sel(item, i) {
if (item.isCheck == false) { if (item.isCheck == false) {
@ -287,6 +321,16 @@
}) })
}, },
submitData() { submitData() {
if(this.settle_cycle<15){
this.settle_cycle=15
}else if(this.settle_cycle > 90){
this.settle_cycle=90
}
if(this.interest_rate<0.01){
this.interest_rate=0.01
}else if(this.interest_rate > 0.1){
this.interest_rate=0.1
}
let data = { let data = {
mer_banner: this.images[0].img, mer_banner: this.images[0].img,
mer_avatar: this.images[1].img, mer_avatar: this.images[1].img,
@ -308,7 +352,10 @@
mer_state: this.merState ? '1' : '0', mer_state: this.merState ? '1' : '0',
type: '2', type: '2',
uploadedqualifications: '', uploadedqualifications: '',
id: this.id id: this.id,
credit_buy:this.credit_buy,
settle_cycle:this.settle_cycle,
interest_rate:this.interest_rate
} }
merchantUpdateAPI(data).then(res => { merchantUpdateAPI(data).then(res => {
Toast(res.message) Toast(res.message)
@ -325,8 +372,9 @@
}) })
}, },
selfLocation() { selfLocation() {
console.log('123');
uni.getLocation({ uni.getLocation({
type: 'gcj02', type: 'wgs84',
success: (res) => { success: (res) => {
this.latitude = res.latitude.toString(); this.latitude = res.latitude.toString();
this.longitude = res.longitude.toString(); this.longitude = res.longitude.toString();
@ -554,6 +602,11 @@
font-size: 24.56rpx; font-size: 24.56rpx;
color: #CCCCCC; color: #CCCCCC;
} }
.remarks{
margin-left:20px ;
font-size: 24.56rpx;
color: #CCCCCC;
}
.long_lat { .long_lat {
margin: 31.58rpx 0; margin: 31.58rpx 0;

View File

@ -9,27 +9,32 @@
<swiper-item :class="{ active: 0 == swiperCur }"> <swiper-item :class="{ active: 0 == swiperCur }">
<view class="slide-navigator"> <view class="slide-navigator">
<view class="item" hover-class='none' @click="jumpAddGoods"> <view class="item" hover-class='none' @click="jumpAddGoods">
<image mode='widthFix' class="image" src="../static/images/product_add.png"></image> <image mode='widthFix' class="image" src="../static/images/product_add.png">
</image>
<text class="text">添加商品</text> <text class="text">添加商品</text>
</view> </view>
<navigator class="item" :url="`/pages/product/goodsOnSale/index?mer_id=${mer_id}&type=1`" <navigator class="item" :url="`/pages/product/goodsOnSale/index?mer_id=${mer_id}&type=1`"
hover-class='none'> hover-class='none'>
<image mode='widthFix' class="image" src="../static/images/product_sales.png"></image> <image mode='widthFix' class="image" src="../static/images/product_sales.png">
</image>
<text class="text">在售商品</text> <text class="text">在售商品</text>
</navigator> </navigator>
<navigator class="item" :url="`/pages/product/goodsOnSale/index?mer_id=${mer_id}&type=3`" <navigator class="item" :url="`/pages/product/goodsOnSale/index?mer_id=${mer_id}&type=3`"
hover-class='none'> hover-class='none'>
<image mode='widthFix' class="image" src="../static/images/product_out.png"></image> <image mode='widthFix' class="image" src="../static/images/product_out.png">
</image>
<text class="text">售罄商品</text> <text class="text">售罄商品</text>
</navigator> </navigator>
<navigator class="item" :url="`/pages/product/goodsOnSale/index?mer_id=${mer_id}&type=5`" <navigator class="item" :url="`/pages/product/goodsOnSale/index?mer_id=${mer_id}&type=5`"
hover-class='none'> hover-class='none'>
<image mode='widthFix' class="image" src="../static/images/product_recycle.png"></image> <image mode='widthFix' class="image" src="../static/images/product_recycle.png">
</image>
<text class="text">回收站</text> <text class="text">回收站</text>
</navigator> </navigator>
<navigator class="item" :url="`/pages/product/storeClassification/index?mer_id=${mer_id}`" <navigator class="item" :url="`/pages/product/storeClassification/index?mer_id=${mer_id}`"
hover-class='none'> hover-class='none'>
<image mode='widthFix' class="image" src="../static/images/product_cate.png"></image> <image mode='widthFix' class="image" src="../static/images/product_cate.png">
</image>
<text class="text">店铺分类</text> <text class="text">店铺分类</text>
</navigator> </navigator>
</view> </view>
@ -38,7 +43,8 @@
<view class="slide-navigator"> <view class="slide-navigator">
<navigator class="item" :url="`/pages/product/addGoods/freightTemplate?mer_id=${mer_id}`" <navigator class="item" :url="`/pages/product/addGoods/freightTemplate?mer_id=${mer_id}`"
hover-class='none'> hover-class='none'>
<image mode='widthFix' class="image" src="../static/images/product_freight.png"></image> <image mode='widthFix' class="image" src="../static/images/product_freight.png">
</image>
<text class="text">运费模板</text> <text class="text">运费模板</text>
</navigator> </navigator>
<navigator class="item" :url="`/pages/product/addGoods/mulSpecification?mer_id=${mer_id}`" <navigator class="item" :url="`/pages/product/addGoods/mulSpecification?mer_id=${mer_id}`"
@ -46,6 +52,12 @@
<image mode='widthFix' class="image" src="../static/images/product_specification.png"></image> <image mode='widthFix' class="image" src="../static/images/product_specification.png"></image>
<text class="text">规格模板</text> <text class="text">规格模板</text>
</navigator> </navigator>
<navigator class="item"
:url="`/pages/users/online_warehousing/index?mer_id=${mer_id}&product_id=${data.product_id}&unique=${data.unique}`"
hover-class='none'>
<image mode='widthFix' class="image" src="@/static/images/daoru.png"></image>
<text class="text">商品导入</text>
</navigator>
</view> </view>
</swiper-item> </swiper-item>
</block> </block>
@ -75,28 +87,60 @@
<text class='ot_price'>{{item.ot_price}}</text> <text class='ot_price'>{{item.ot_price}}</text>
</view> </view>
</view> </view>
<view style="position: absolute; top: 10px; right: 10px;">
<!-- 插件无需手动引入直接使用即可 -->
<!-- 里面···可以改为任意东西图片也可以 -->
<!-- 参数$event不可修改否则取不到点击事件详情 -->
<rudon-rowMenuDotDotDot :localdata="options" @change="menuAction($event, item.attrValue)">
. . .
</rudon-rowMenuDotDotDot>
</view>
</view> </view>
<view class="operation acea-row row-between-wrapper"> <view class="operation acea-row row-between-wrapper">
<view></view>
<view class="acea-row row-middle"> <view class="acea-row row-middle">
<view v-if="item.is_show == 1 && item.status == 1" class="bnt" @tap.stop="handleShelves(item,0)">下架 <view v-if="item.is_show == 1 && item.status == 1" class="bnt" @tap.stop="handleShelves(item,0)">下架
</view> </view>
<view v-if="item.is_show == 0 && item.status == 1" class="bnt" @tap.stop="handleShelves(item),1">上架 <view v-if="item.is_show == 0 && item.status == 1" class="bnt" @tap.stop="handleShelves(item),1">上架
</view> </view>
<view @click="editGoods(item)" class="bnt">编辑</view> <view @click="editGoods(item)" class="bnt">编辑</view>
<navigator :url="'/pages/admin/goods_details/index?product_id='+item.product_id+'&product_type=0'" <view class="bnt" v-if="item.is_show == 0" @tap.stop="handleRecycle(item,index)">删除
class="bnt" hover-class='none'>预览</navigator> </view>
<view class="bnt" v-if="item.is_show == 0" @tap.stop="handleRecycle(item,index)">删除</view>
<view class="bnt bnt_recommend" v-if="item.is_show == 1" @tap.stop="handleRecommend(item)"> <view class="bnt bnt_recommend" v-if="item.is_show == 1" @tap.stop="handleRecommend(item)">
{{item.is_good ? '取消推荐' : '店铺推荐'}} {{item.is_good ? '取消推荐' : '店铺推荐'}}
</view> </view>
</view> </view>
</view> </view>
</block> </block>
</view> </view>
</view> </view>
<Loading :loaded="loaded" :loading="loading"></Loading> <Loading :loaded="loaded" :loading="loading"></Loading>
</view> </view>
<u-popup :show="show" @close="close" mode="center" bgColor='transparent'>
<image src="@/static/images/xianxia.png" mode="widthFix"></image>
<view class="popen">
<h4 v-if="this.on_line==1">线下入库</h4>
<h4 v-else>线上入库</h4>
<view class="guige">
<scroll-view scroll-y="true" class="scroll_y">
<view>
<u-radio-group v-model="checkboxValue1" placement="column" @change="checkboxChange">
<u-radio :customStyle="{marginBottom: '8px'}" v-for="(item, index) in checkboxList1"
@change="radioChange(item)" :key="index" :label="item.sku" :name="item.unique" v-if="item.sku">
</u-radio>
</u-radio-group>
</view>
</scroll-view>
</view>
<view class="shuru" v-if="this.on_line == 1">
数量: <input type="number" v-model="data.number" placeholder="请输入">
</view>
<view class="btn">
<button class="btn_l" @click="close()">取消</button>
<button class="btn_r" @click="creat()">提交</button>
</view>
</view>
</u-popup>
</view> </view>
</template> </template>
@ -114,7 +158,8 @@
productLstApi, productLstApi,
productDeleteApi, productDeleteApi,
productOffApi, productOffApi,
productRecommendApi productRecommendApi,
postImport
} from "@/api/product"; } from "@/api/product";
import Loading from '@/components/Loading/index.vue'; import Loading from '@/components/Loading/index.vue';
import { import {
@ -145,6 +190,32 @@
productList: [], productList: [],
swiperCur: 0, swiperCur: 0,
circular: true, circular: true,
attrValue: [],
options: [{
value: '0',
text: '线上入库'
},
{
value: '1',
text: '线下入库'
},
{
value: '2',
text: '预览'
}
],
//线
show: false,
//
checkboxValue1: [],
//
checkboxList1: [],
data: {
product_id: '',
unique: "",
number: 1
},
on_line: ''
} }
}, },
onLoad(options) { onLoad(options) {
@ -158,7 +229,94 @@
this.getList(this.mer_id); this.getList(this.mer_id);
uni.stopPullDownRefresh() uni.stopPullDownRefresh()
}, },
onHide() {
this.show = false
},
methods: { methods: {
menuAction(action, rowId) {
//
if (action === '') {
return
}
this.on_line = action
this.checkboxList1 = rowId
console.log(this.on_line);
if (this.checkboxList1.length == 1 && action == 0) {
// this.show = true
navigateTo(1, '/pages/users/online_warehousing/index', {
mer_id: this.mer_id,
product_id: this.data.product_id,
unique: this.data.unique,
});
} else if (this.checkboxList1.length == 1 && action == 1) {
this.show = true
this.data.product_id = this.checkboxList1[0].product_id
this.data.unique = this.checkboxList1[0].unique
console.log(this.data);
} else {
this.show = true
}
if (action == 2) {
uni.navigateTo({
url: `/pages/admin/goods_details/index?product_id=${this.checkboxList1[0].product_id}&product_type=0`
})
}
},
close() {
this.show = false
},
//
creat() {
if (this.on_line == 1) {
if (this.data.number < 1) {
this.show = false
this.$util.Tips({
title: '入库数量不得小于一件'
})
} else {
postImport(this.mer_id, this.data).then(res => {
console.log(res);
this.show = false
this.$util.Tips({
title: res.message
})
}).catch(err => {
this.show = false
this.$util.Tips({
title: '请选择规格后再次进行入库'
})
})
}
}
if (this.on_line == 0) {
console.log('12');
if (!this.data.product_id) {
this.show = false
this.$util.Tips({
title: '请选择规格'
})
} else {
navigateTo(1, '/pages/users/online_warehousing/index', {
mer_id: this.mer_id,
product_id: this.data.product_id,
unique: this.data.unique,
});
}
}
},
//
checkboxChange(n) {
this.data.unique = n
console.log(n);
},
radioChange(n) {
this.data.product_id = n.product_id
console.log(this.data);
},
// //
jumpAddGoods() { jumpAddGoods() {
const data = getStorage('addGoodsFormData'); const data = getStorage('addGoodsFormData');
@ -172,11 +330,16 @@
} }
}) })
} }
navigateTo(1, '/pages/product/addGoods/index', { mer_id: this.mer_id }); navigateTo(1, '/pages/product/addGoods/index', {
mer_id: this.mer_id
});
}, },
// swiper // swiper
swiperChange(e) { swiperChange(e) {
let { current, source } = e.detail; let {
current,
source
} = e.detail;
if (source === 'touch') { if (source === 'touch') {
// source swiperchangeautoplaytouchcurrentbug // source swiperchangeautoplaytouchcurrentbug
this.swiperCur = e.detail.current; this.swiperCur = e.detail.current;
@ -192,6 +355,7 @@
that.loaded = res.data.list.length < that.where.limit; that.loaded = res.data.list.length < that.where.limit;
that.productList.push.apply(that.productList, res.data.list); that.productList.push.apply(that.productList, res.data.list);
that.where.page = that.where.page + 1; that.where.page = that.where.page + 1;
}, },
error => { error => {
that.$util.Tips({ that.$util.Tips({
@ -217,7 +381,10 @@
removeStorage(item); removeStorage(item);
} }
}); });
navigateTo(1, '/pages/product/addGoods/index', { mer_id: item.mer_id, product_id: item.product_id }); navigateTo(1, '/pages/product/addGoods/index', {
mer_id: item.mer_id,
product_id: item.product_id
});
}, },
handleRecycle(item, index) { handleRecycle(item, index) {
let that = this; let that = this;
@ -261,7 +428,9 @@
// //
onAndOff(item, status) { onAndOff(item, status) {
let that = this; let that = this;
productOffApi(that.mer_id, item.product_id, { status: status }).then((res) => { productOffApi(that.mer_id, item.product_id, {
status: status
}).then((res) => {
that.$util.Tips({ that.$util.Tips({
title: res.message, title: res.message,
icon: 'success' icon: 'success'
@ -278,7 +447,9 @@
handleRecommend(item) { handleRecommend(item) {
let that = this let that = this
let is_good = item.is_good ? 0 : 1 let is_good = item.is_good ? 0 : 1
productRecommendApi(that.mer_id, item.product_id, { is_good: is_good }).then((res) => { productRecommendApi(that.mer_id, item.product_id, {
is_good: is_good
}).then((res) => {
that.$util.Tips({ that.$util.Tips({
title: res.message, title: res.message,
icon: 'success' icon: 'success'
@ -528,7 +699,7 @@
} }
.operation { .operation {
padding: 20upx 30upx; padding: 20upx 10px;
background: #ffffff; background: #ffffff;
width: 100%; width: 100%;
border-radius: 0 0 10rpx 10rpx; border-radius: 0 0 10rpx 10rpx;
@ -555,5 +726,91 @@
} }
} }
} }
.acea-row.row-between-wrapper {
justify-content: flex-end;
}
}
.genduo {
display: flex;
justify-content: center;
align-items: center;
border: 1px solid #999999;
border-radius: 10px;
width: 30px;
height: 10px;
.gen_sel {
font-size: 12px
}
}
.popen {
position: absolute;
top: 110px;
width: 100%;
margin: auto;
padding: 10px;
z-index: 0;
h4 {
font-weight: 400;
font-size: 20px;
padding: 5px;
text-align: center;
}
.guige {
margin: 10px 0 10px 20px;
.scroll_y {
max-height: 150px;
}
}
.guiges {
height: 100px;
margin: 10px 0 10px 20px;
}
.shuru {
display: flex;
justify-content: flex-start;
align-items: center;
padding: 5px;
margin-left: 20px;
input {
background: #F5F5F5;
border-radius: 8px 8px 8px 8px;
border: 1px solid #999999;
padding-left: 3px;
margin-left: 3px;
}
}
.btn {
display: flex;
justify-content: flex-start;
align-items: center;
margin: 10px;
.btn_l {
padding: 5px;
width: 100px;
border-radius: 4px;
}
.btn_r {
width: 100px;
padding: 5px;
border-radius: 4px;
background: linear-gradient(180deg, #F98649 0%, #F34E45 100%);
border-radius: 27px 27px 27px 27px;
color: white;
}
}
} }
</style> </style>

View File

@ -113,6 +113,7 @@
}, },
onLoad() { onLoad() {
getHotBanner('good').then(res => { getHotBanner('good').then(res => {
console.log(res);
this.bgData = res.data this.bgData = res.data
}) })
this.getArticle() this.getArticle()

View File

@ -105,7 +105,7 @@
<view class="order-wrapper"> <view class="order-wrapper">
<view class="order-hd flex skeleton-rect"> <view class="order-hd flex skeleton-rect">
<view class="left">我的订单</view> <view class="left">我的订单</view>
<view class="right flex" @click="authTo('/pages/users/order_list/index?status=-1')" hover-class="none" <view class="right flex" @click="authTo('/pages/users/order_list/index?status=-1&product_type=0')" hover-class="none"
open-type="navigate"> open-type="navigate">
全部订单 全部订单
<text class="iconfont icon-xiangyou"></text> <text class="iconfont icon-xiangyou"></text>

View File

@ -80,39 +80,7 @@
class="font_pro">隐私政策</text></text> class="font_pro">隐私政策</text></text>
</checkbox-group> </checkbox-group>
</div> </div>
<!-- #ifdef MP -->
<!-- <view class="appLogin">
<view class="hds">
<span class="line"></span>
<p>其他方式登录</p>
<span class="line"></span>
</view>
<view class="btn-wrapper">
<button form-type="submit" open-type="getPhoneNumber" @getphonenumber="getPhoneNumber">
<view class="btn wx">
<span class="iconfont icon-s-weixindenglu1"></span>
</view>
</button>
</view>
</view> -->
<!-- #endif -->
<!-- #ifdef APP-PLUS -->
<!-- <view class="appLogin" v-if="!appLoginStatus && !appleLoginStatus">
<view class="hds">
<span class="line"></span>
<p>其他方式登录</p>
<span class="line"></span>
</view>
<view class="btn-wrapper">
<view class="btn wx" @click="wxLogin">
<span class="iconfont icon-s-weixindenglu1"></span>
</view>
<view class="btn wx btn-apple" @click="appleLogin" v-if="appleShow">
<span class="iconfont icon-s-pingguo"></span>
</view>
</view>
</view> -->
<!-- #endif -->
</div> </div>
<div class="whiteBg" v-else> <div class="whiteBg" v-else>
<div class="title">注册账号</div> <div class="title">注册账号</div>
@ -168,24 +136,6 @@
class="font_pro">隐私政策</text></text> class="font_pro">隐私政策</text></text>
</checkbox-group> </checkbox-group>
</div> </div>
<!-- #ifdef APP-PLUS -->
<view class="appLogin" v-if="!appLoginStatus && !appleLoginStatus">
<view class="hds">
<span class="line"></span>
<p>其他方式登录</p>
<span class="line"></span>
</view>
<view class="btn-wrapper">
<view class="btn wx" @click="wxLogin">
<span class="iconfont icon-s-weixindenglu1"></span>
</view>
<view class="btn wx btn-apple" @click="appleLogin" v-if="appleShow">
<span class="iconfont icon-s-pingguo"></span>
</view>
</view>
</view>
<!-- #endif -->
</div> </div>
</div> </div>
<div class="bottom"></div> <div class="bottom"></div>

View File

@ -0,0 +1,457 @@
<template>
<view class="center">
<view class="top">
<view class="top-header">
<view class="search">
<view class="search-content acea-row row-middle">
<text class="iconfont icon-sousuo"></text>
<input v-model="where.store_name" confirm-type="search" placeholder="请输收货人手机号或订单号搜索" class="input"
@confirm="handleSearch" />
</view>
</view>
</view>
</view>
<view class="bgc_img" v-if="this.shopList == ![]">
<image src="@/static/images/empty-box.png" mode="widthFix"></image>
<view class="txt">
暂无商品订单~
</view>
</view>
<view class='list' v-else>
<block>
<view class='item' v-for="(item,index) in shopList" :key="index">
<view >
<view class='title acea-row row-between-wrapper'>
<view class="acea-row row-middle left-wrapper">
{{item.merchant.mer_name}}
</view>
</view>
<view>
<view>
<block>
<view class="_order">
订单号: {{item.order_sn}}
</view>
<view class='item-info acea-row row-between row-top' v-for="(items,indexs) in item.orderProduct" :key="indexs">
<view class='pictrue'>
<image :src="items.cart_info.product.image">
</image>
</view>
<view class='text'>
<view class='_left'>
{{items.cart_info.product.store_name}}
<view class="">
{{items.cart_info.productAttr.sku}}
</view>
</view>
<view class="_right">
<view class='name'>{{items.cart_info.productAttr.price}}</view>
<view class='name'>x {{items.product_num}}</view>
</view>
<!-- <view class="totalfooter">
<view class='bnt b-color' v-if="items.is_imported == 0 && item.orderProduct.length > 1"
@click="importshop(items.order_id,items.product_id,items.product_sku)">
立即导入</view>
</view> -->
</view>
</view>
</block>
</view>
</view>
<view class='totalPrice'>
共1件商品总金额
<text class='money'>{{item.pay_price}}</text>
</view>
<view class="totalfooter">
<view class='bnt b-color' v-if="item.orderProduct[index]"
@click="importshop(item.order_id,item.orderProduct[index].product_id,item.orderProduct[index].cart_info.productAttr.product_sku)">
立即导入</view>
</view>
<view>
{{item.orderProduct[0].is_imported}}
</view>
</view>
</view>
</block>
</view>
<u-popup :show="show" @close="close" mode="center" bgColor='transparent'>
<image src="@/static/images/xianshang.png" mode="widthFix"></image>
<view class="popen">
<h4>{{title}}</h4>
<view class="shuru">
点击确定返回商品管理
</view>
<view class="btn">
<button class="btn_l" @click="closeasd()">取消</button>
<button class="btn_r" @click="getback()">确定</button>
</view>
</view>
</u-popup>
<Loading :loaded="loaded" :loading="loading"></Loading>
</view>
</template>
<script>
import {
getPreviewProDetail,
} from '@/api/store.js'
import {
postImport
} from '@/api/product.js'
import {
getOrderList
} from '@/api/order.js'
import Loading from '@/components/Loading/index'
export default {
data() {
return {
shopList: [],
shopinfo: {},
mer_id: '',
keyword: '',
where: {
page: 1,
limit: 10,
status: 20,
product_type: 98,
store_name: '',
},
data: {
product_id: '',
unique: "",
order_id: '',
order_product_id: '',
order_unique: ''
},
show: false,
title: '',
loaded: false,
}
},
onLoad(option) {
console.log(option);
this.mer_id = option.mer_id
this.getList();
this.data.product_id = option.product_id
this.data.unique = option.unique
},
methods: {
handleSearch() {
let that = this
that.loaded = false;
that.where.page = 1;
that.shopList = [];
getOrderList(that.where, that.mer_id).then(res => {
console.log(res);
that.shopList = res.data.list
console.log(that.shopList);
})
},
getList: function() {
if (this.loading || this.loaded) return;
this.loading = true;
getOrderList(this.where, this.mer_id).then(res => {
console.log(res);
this.shopList = res.data.list
console.log(this.shopList);
})
},
importshop(order_id, product_id, unique) {
this.data.order_id = order_id
this.data.order_product_id = product_id
this.data.order_unique = unique
this.show = true
postImport(this.mer_id, this.data).then(res => {
console.log(res);
this.title = res.message
this.$util.Tips({
title: res.message
})
})
},
close() {
this.show = false
},
closeasd: function() {
this.show = false
getOrderList(this.where, this.mer_id).then(res => {
console.log(res);
this.shopList = res.data.list
console.log(this.shopList);
})
},
getback() {
uni.navigateBack({
delta: 1
});
}
}
}
</script>
<style lang="scss" scoped>
.top {
background-color: red;
.top-header {
position: fixed;
top: 0;
left: 0;
z-index: 9999;
width: 100%;
background-color: #fff;
.search {
padding: 17rpx 30rpx;
.search-content {
width: 100%;
height: 60rpx;
padding: 0 30rpx;
border-radius: 30rpx;
background-color: #F5F5F5;
font-size: 26rpx;
}
.iconfont {
margin-right: 10rpx;
font-size: 26rpx;
color: #999999;
}
.input-placeholder {
font-size: 26rpx;
color: #999999;
}
.input {
flex: 1;
}
}
}
}
.bgc_img {
position: absolute;
top: 30vh;
left: 10vw;
image {
width: 300px;
}
.txt {
text-align: center;
}
}
.list {
width: 690rpx;
margin: 50px auto 0 auto;
.title {
height: 84rpx;
padding: 0 30rpx;
border-bottom: 1px solid #CCCCCC;
font-size: 32rpx;
font-weight: 700;
color: #282828;
.left-wrapper {
.iconfont {
margin-top: 5rpx;
}
.store-name {
margin: 0 10rpx;
}
.icon-xiangyou {
font-size: 20rpx;
}
}
.sign {
font-size: 24rpx;
padding: 0 7rpx;
height: 36rpx;
margin-right: 15rpx;
}
}
.item {
background-color: #fff;
margin: 5px 0 5px 0;
.item-info {
padding: 0 30rpx;
margin-top: 22rpx;
.pictrue {
width: 120rpx;
height: 120rpx;
image {
width: 100%;
height: 100%;
border-radius: 6rpx;
}
}
.text {
width: 486rpx;
font-size: 28rpx;
color: #999;
margin-top: 6rpx;
display: flex;
justify-content: space-between;
._left {
width: 300rpx;
color: #282828;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.name {
width: 100rpx;
color: #282828;
}
.money {
text-align: right;
float: right;
}
}
}
.event_name {
display: inline-block;
margin-right: 9rpx;
color: #fff;
font-size: 20rpx;
padding: 0 8rpx;
line-height: 30rpx;
text-align: center;
border-radius: 6rpx;
}
.event_ship {
font-size: 20rpx;
margin-top: 10rpx;
}
._order {
font-size: 28rpx;
margin: 5px 0 0 15px;
}
.totalPrice {
font-size: 26rpx;
color: #282828;
text-align: right;
margin: 27rpx 0 0 30rpx;
padding: 0 30rpx 30rpx 0;
.money {
font-size: 34rpx;
font-weight: bold;
color: rgb(233, 51, 35);
}
}
.totalfooter {
width: 100%;
height: 50px;
position: relative;
border-top: 1px solid #CCCCCC;
.bnt {
position: absolute;
right: 10px;
width: 176rpx;
height: 60rpx;
display: flex;
align-items: center;
justify-content: center;
border-radius: 50rpx;
font-size: 27rpx;
background: linear-gradient(180deg, #F98649 0%, #F34E45 100%);
color: white;
margin-left: 70%;
margin-top: 5px;
}
}
.bottom {
height: 107rpx;
padding: 0 30rpx;
border-top: 1px solid #f0f0f0;
}
}
.event_price {
margin: 0 0 50rpx 120rpx;
}
}
.popen {
position: absolute;
top: 110px;
width: 100%;
margin: auto;
padding: 10px;
h4 {
font-weight: 400;
font-size: 20px;
padding: 5px;
text-align: center;
}
.guige {
margin: 10px 0 10px 20px;
}
.shuru {
display: flex;
justify-content: center;
align-items: center;
font-size: 18px;
padding: 5px;
}
.btn {
display: flex;
justify-content: flex-start;
align-items: center;
margin: 10px;
.btn_l {
padding: 5px;
width: 100px;
border-radius: 4px;
}
.btn_r {
width: 100px;
padding: 5px;
border-radius: 4px;
background: linear-gradient(180deg, #F98649 0%, #F34E45 100%);
border-radius: 27px 27px 27px 27px;
color: white;
}
}
}
</style>

View File

@ -68,8 +68,7 @@
</view> </view>
<view class="progress_step"> <view class="progress_step">
<text class="name">尾款</text> <text class="name">尾款</text>
<text <text class="price">{{ (goods.productPresellAttr.final_price * goods.cart_num).toFixed(2) }}</text>
class="price">{{ (goods.productPresellAttr.final_price * goods.cart_num).toFixed(2) }}</text>
</view> </view>
<view class="progress_pay"> <view class="progress_pay">
{{ goods.productPresell.final_start_time | filterDay}}开始支付尾款 {{ goods.productPresell.final_start_time | filterDay}}开始支付尾款
@ -119,8 +118,7 @@
<view class="boxs"> <view class="boxs">
<view class='item acea-row row-between-wrapper'> <view class='item acea-row row-between-wrapper'>
<view>配送方式</view> <view>配送方式</view>
<view <view v-if="item.delivery_way.length == 2 && (item.order.allow_delivery && item.order.allow_take)"
v-if="item.delivery_way.length == 2 && (item.order.allow_delivery && item.order.allow_take)"
class='discount' @tap="openShowBox(item,index)"> class='discount' @tap="openShowBox(item,index)">
{{item.order.isTake==0 ? deliveryName :'到店核销'}} {{item.order.isTake==0 ? deliveryName :'到店核销'}}
<text class='iconfont icon-jiantou'></text> <text class='iconfont icon-jiantou'></text>
@ -179,15 +177,18 @@
</view> </view>
<view class='item acea-row row-between-wrapper' v-if="textareaStatus"> <view class='item acea-row row-between-wrapper' v-if="textareaStatus">
<view style="width: 100px;">备注信息</view> <view style="width: 100px;">备注信息</view>
<input v-if="coupon.status===false" placeholder-class='placeholder' <input v-if="coupon.status===false" placeholder-class='placeholder' @input='bindHideKeyboard' value=""
@input='bindHideKeyboard' value="" name="mark" placeholder='选填备注信息' name="mark" placeholder='选填备注信息' v-model="msgObj[item.mer_id]"></input>
v-model="msgObj[item.mer_id]"></input>
</view> </view>
<view class="total"> <view class="total">
{{item.order.total_num}} 小计 {{item.order.total_num}} 小计
<view class="price" v-if="item.isTake == 0"><text></text>{{ item.order.pay_price }}</view> <view class="price" v-if="item.isTake == 0"><text></text>{{ item.order.pay_price }}</view>
<view class="price" v-if="item.isTake == 1"><text></text>{{ item.order.org_price}}</view> <view class="price" v-if="item.isTake == 1"><text></text>{{ item.order.org_price}}</view>
</view> </view>
<view class="total" v-if="item.credit_buy == 1 && active == 4">
实付价
<view class="price"><text></text>0.00</view>
</view>
</view> </view>
</view> </view>
</view> </view>
@ -198,40 +199,36 @@
<view v-if="item.key == 'mobile'" class='item acea-row row-between-wrapper'> <view v-if="item.key == 'mobile'" class='item acea-row row-between-wrapper'>
<view><text class="item-require" v-if="item.require">*</text>{{item.title}}</view> <view><text class="item-require" v-if="item.require">*</text>{{item.title}}</view>
<view class='discount'> <view class='discount'>
<input type="text" v-model="item.value" placeholder="请填写手机号" <input type="text" v-model="item.value" placeholder="请填写手机号" placeholder-class='placeholder' />
placeholder-class='placeholder' />
</view> </view>
</view> </view>
<view v-if="item.key == 'email'" class='item acea-row row-between-wrapper'> <view v-if="item.key == 'email'" class='item acea-row row-between-wrapper'>
<view><text class="item-require" v-if="item.require">*</text>{{item.title}}</view> <view><text class="item-require" v-if="item.require">*</text>{{item.title}}</view>
<view class='discount'> <view class='discount'>
<input type="text" v-model="item.value" placeholder="请填写邮箱" <input type="text" v-model="item.value" placeholder="请填写邮箱" placeholder-class='placeholder' />
placeholder-class='placeholder' />
</view> </view>
</view> </view>
<view v-if="item.key == 'idCard'" class='item acea-row row-between-wrapper'> <view v-if="item.key == 'idCard'" class='item acea-row row-between-wrapper'>
<view><text class="item-require" v-if="item.require">*</text>{{item.title}}</view> <view><text class="item-require" v-if="item.require">*</text>{{item.title}}</view>
<view class='discount'> <view class='discount'>
<input type="text" v-model="item.value" placeholder="请填写身份证号" <input type="text" v-model="item.value" placeholder="请填写身份证号" placeholder-class='placeholder' />
placeholder-class='placeholder' />
</view> </view>
</view> </view>
<view v-if="item.key == 'text' || item.key == 'number'" <view v-if="item.key == 'text' || item.key == 'number'" class='item acea-row row-between-wrapper'>
class='item acea-row row-between-wrapper'>
<view><text class="item-require" v-if="item.require">*</text>{{item.title}}</view> <view><text class="item-require" v-if="item.require">*</text>{{item.title}}</view>
<view class='discount'> <view class='discount'>
<input v-if="item.key == 'text'" type="text" v-model="item.value" <input v-if="item.key == 'text'" type="text" v-model="item.value" :placeholder="'请填写'+item.title"
:placeholder="'请填写'+item.title" placeholder-class='placeholder' /> placeholder-class='placeholder' />
<input v-if="item.key == 'number'" type="number" v-model="item.value" <input v-if="item.key == 'number'" type="number" v-model="item.value" :placeholder="'请填写'+item.title"
:placeholder="'请填写'+item.title" placeholder-class='placeholder' /> placeholder-class='placeholder' />
</view> </view>
</view> </view>
<view v-if="item.key == 'date'" class='item acea-row row-between-wrapper'> <view v-if="item.key == 'date'" class='item acea-row row-between-wrapper'>
<view><text class="item-require" v-if="item.require">*</text>{{item.title}}</view> <view><text class="item-require" v-if="item.require">*</text>{{item.title}}</view>
<view class='discount'> <view class='discount'>
<picker mode="date" :value="item.value" start="1970-01-01" @change="bindDateChange"> <picker mode="date" :value="item.value" start="1970-01-01" @change="bindDateChange">
<input type="text" @click="getTime(index)" disabled v-model="item.value" <input type="text" @click="getTime(index)" disabled v-model="item.value" placeholder="请选择日期"
placeholder="请选择日期" placeholder-class='placeholder' /> placeholder-class='placeholder' />
</picker> </picker>
</view> </view>
</view> </view>
@ -239,16 +236,16 @@
<view><text class="item-require" v-if="item.require">*</text>{{item.title}}</view> <view><text class="item-require" v-if="item.require">*</text>{{item.title}}</view>
<view class='discount'> <view class='discount'>
<picker mode="time" :value="item.value" start="1970-01-01" @change="bindDateChange"> <picker mode="time" :value="item.value" start="1970-01-01" @change="bindDateChange">
<input type="text" @click="getTime(index)" disabled v-model="item.value" <input type="text" @click="getTime(index)" disabled v-model="item.value" placeholder="请选择时间"
placeholder="请选择时间" placeholder-class='placeholder' /> placeholder-class='placeholder' />
</picker> </picker>
</view> </view>
</view> </view>
<view v-if="item.key == 'image'" class='item'> <view v-if="item.key == 'image'" class='item'>
<view><text class="item-require" v-if="item.require">*</text>{{item.title}}</view> <view><text class="item-require" v-if="item.require">*</text>{{item.title}}</view>
<view class="upload"> <view class="upload">
<view class='pictrue' v-for="(itemn,indexn) in item.value" :key="indexn" <view class='pictrue' v-for="(itemn,indexn) in item.value" :key="indexn" :data-index="indexn"
:data-index="indexn" @click="getPhotoClickIdx"> @click="getPhotoClickIdx">
<image :src="itemn"></image> <image :src="itemn"></image>
<text class="iconfont icon-guanbi4" @click.stop="DelPic(item,indexn)"></text> <text class="iconfont icon-guanbi4" @click.stop="DelPic(item,indexn)"></text>
</view> </view>
@ -277,15 +274,13 @@
<view class='item acea-row row-between-wrapper'> <view class='item acea-row row-between-wrapper'>
<view><text class="item-require">*</text>收货人姓名</view> <view><text class="item-require">*</text>收货人姓名</view>
<view class='discount'> <view class='discount'>
<input type="text" v-model="post.real_name" placeholder="请填写收货人姓名" <input type="text" v-model="post.real_name" placeholder="请填写收货人姓名" placeholder-class='placeholder' />
placeholder-class='placeholder' />
</view> </view>
</view> </view>
<view class='item acea-row row-between-wrapper'> <view class='item acea-row row-between-wrapper'>
<view><text class="item-require">*</text>收货人电话</view> <view><text class="item-require">*</text>收货人电话</view>
<view class='discount'> <view class='discount'>
<input type="number" v-model="post.phone" placeholder="请填写收货人电话" <input type="number" v-model="post.phone" placeholder="请填写收货人电话" placeholder-class='placeholder' />
placeholder-class='placeholder' />
</view> </view>
</view> </view>
</form> </form>
@ -342,8 +337,7 @@
<view>店铺优惠金额</view> <view>店铺优惠金额</view>
<view class='money'>-{{coupon_price}}</view> <view class='money'>-{{coupon_price}}</view>
</view> </view>
<view class='item acea-row row-between-wrapper' <view class='item acea-row row-between-wrapper' v-if="open_integral && userInfo.integral>0 && order_type == 0">
v-if="open_integral && userInfo.integral>0 && order_type == 0">
<view>积分抵扣</view> <view>积分抵扣</view>
<view class='money'> <view class='money'>
<text v-if="!use_integral">当前积分<text class="pColor">{{userInfo.integral}}</text></text> <text v-if="!use_integral">当前积分<text class="pColor">{{userInfo.integral}}</text></text>
@ -379,7 +373,11 @@
<view class="footer_count"> <view class="footer_count">
<view> <view>
合计: 合计:
<text class='pColor'>{{totalPrice || 0}}</text> <text class='pColor' v-if="cartArr[4].payStatus == 1 && active == 4">0.00</text>
<text class='pColor' v-else>{{totalPrice }}</text>
</view>
<view style="font-size: 14px;color: #F84221;" v-if="cartArr[4].payStatus == 1 && active == 4">
可结算周期到期后再付款{{totalPrice}}
</view> </view>
<view class="coupon_price" v-if="couponData.total_coupon > 0"> <view class="coupon_price" v-if="couponData.total_coupon > 0">
优惠:¥ {{couponData.total_coupon}} 优惠:¥ {{couponData.total_coupon}}
@ -392,8 +390,8 @@
</view> </view>
<block v-if="coupon.status"> <block v-if="coupon.status">
<couponListWindow :coupon='coupon' :couponTitle="plantCoupon ? '平台优惠券' : '优惠券'" <couponListWindow :coupon='coupon' :couponTitle="plantCoupon ? '平台优惠券' : '优惠券'"
@ChangCouponsClone="ChangCouponsClone" @getCoupon="getCoupon" :openType='openType' @ChangCouponsClone="ChangCouponsClone" @getCoupon="getCoupon" :openType='openType' @ChangCoupons="ChangCoupons"
@ChangCoupons="ChangCoupons" :coupon_amount='coupon_amount' :coupon_number='coupon_number'> :coupon_amount='coupon_amount' :coupon_number='coupon_number'>
</couponListWindow> </couponListWindow>
</block> </block>
<addressWindow ref="addressWindow" @changeTextareaStatus="changeTextareaStatus" :address='address' <addressWindow ref="addressWindow" @changeTextareaStatus="changeTextareaStatus" :address='address'
@ -401,8 +399,8 @@
<addInvoicing ref="addInvoicing" @changeInvoiceClose="changeInvoiceClose" :invoice='invoice'></addInvoicing> <addInvoicing ref="addInvoicing" @changeInvoiceClose="changeInvoiceClose" :invoice='invoice'></addInvoicing>
<authorize @onLoadFun="onLoadFun" :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse"></authorize> <authorize @onLoadFun="onLoadFun" :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse"></authorize>
<block v-if="isShowBox"> <block v-if="isShowBox">
<checkDelivery :deliveryName="deliveryName" :isShowBox="isShowBox" :activeObj="activeObj" <checkDelivery :deliveryName="deliveryName" :isShowBox="isShowBox" :activeObj="activeObj" :radioList="radioList"
:radioList="radioList" @close="boxClose" @confirmBtn="getData"> @close="boxClose" @confirmBtn="getData">
</checkDelivery> </checkDelivery>
</block> </block>
<!--优惠明细弹窗--> <!--优惠明细弹窗-->
@ -524,6 +522,12 @@
value: 'offline', value: 'offline',
title: '线下支付', title: '线下支付',
payStatus: 2, payStatus: 2,
}, {
"name": "先货后款",
"icon": "tan-a-lujing17324",
value: 'creditBuy',
title: `结算周期:${this.settle_cycle}天 日利率:${this.interest_rate}%`,
payStatus: '',
}, },
], ],
tagStyle: { tagStyle: {
@ -638,6 +642,10 @@
order_key: '', order_key: '',
is_take: '', is_take: '',
domain: HTTP_REQUEST_URL, domain: HTTP_REQUEST_URL,
product_type: '',
interest_rate: '', //
settle_cycle: '', //
type_id:'',//
}; };
}, },
computed: { computed: {
@ -655,6 +663,8 @@
onReady() {}, onReady() {},
mounted: function() {}, mounted: function() {},
onLoad: function(options) { onLoad: function(options) {
this.type_id=options.type_id
this.product_type = options.product_type
this.seckillId = options.seckillId this.seckillId = options.seckillId
// #ifdef H5 // #ifdef H5
this.from = this.$wechat.isWeixin() ? 'weixin' : 'h5' this.from = this.$wechat.isWeixin() ? 'weixin' : 'h5'
@ -794,6 +804,7 @@
getUserInfo() { getUserInfo() {
getUserInfo().then(res => { getUserInfo().then(res => {
this.userInfo = res.data this.userInfo = res.data
}) })
}, },
/*获取发票说明*/ /*获取发票说明*/
@ -989,6 +1000,9 @@
*/ */
getConfirm: function(address_id) { getConfirm: function(address_id) {
// console.log(address_id, 'address_id') // console.log(address_id, 'address_id')
// console.log(this.take,)
// console.log(this.subCoupon,)
// console.log(this.use_integral, )
let that = this; let that = this;
// console.log(that.cartId.split(",")) // console.log(that.cartId.split(","))
uni.showLoading({ uni.showLoading({
@ -1003,6 +1017,7 @@
use_integral: that.use_integral use_integral: that.use_integral
}).then(res => { }).then(res => {
// //
console.log(res);
that.is_take = false that.is_take = false
res.data.order.forEach(el => { res.data.order.forEach(el => {
if (el.order.isTake == 1) that.is_take = true if (el.order.isTake == 1) that.is_take = true
@ -1053,6 +1068,16 @@
that.allow_address = res.data.allow_address that.allow_address = res.data.allow_address
that.deliveryName = res.data.order_model == 0 ? '快递配送' : '虚拟发货' that.deliveryName = res.data.order_model == 0 ? '快递配送' : '虚拟发货'
that.order_key = res.data.key that.order_key = res.data.key
that.cartArr[4].title =
`结算周期:${res.data.order[0].settle_cycle}天 日利率:${res.data.order[0].interest_rate}%`
console.log(res.data.order[0]);
if (res.data.order[0].credit_buy == 1 && this.type_id == 12 ){
this.cartArr[4].payStatus = 1
} else {
this.cartArr[4].payStatus = 0
}
uni.getStorage({ uni.getStorage({
key: "invoice_Data", key: "invoice_Data",
success: function(res) { success: function(res) {
@ -1087,8 +1112,11 @@
real_name: res.data.real_name, real_name: res.data.real_name,
phone: res.data.phone phone: res.data.phone
} }
console.log(that.addressId);
this.$nextTick(() => {
this.getConfirm(that.addressId); this.getConfirm(that.addressId);
}) })
})
} else { } else {
getAddressList().then(res => { getAddressList().then(res => {
that.addressInfo = res.data.list.length > 0 ? res.data.list[0] : {}; that.addressInfo = res.data.list.length > 0 ? res.data.list[0] : {};
@ -1106,10 +1134,10 @@
} }
}, },
payItem: function(e) { payItem: function(e) {
console.log(e);
let that = this; let that = this;
let active = e; let active = e;
that.active = active; that.active = active;
console.log(this.active);
that.animated = true; that.animated = true;
that.payType = that.cartArr[active].value; that.payType = that.cartArr[active].value;
if (that.payType == 'weixin') { if (that.payType == 'weixin') {
@ -1174,7 +1202,8 @@
orderId = res.data.result.order_id, orderId = res.data.result.order_id,
callback_key = res.data.result.pay_key, callback_key = res.data.result.pay_key,
jsConfig = res.data.result.config, jsConfig = res.data.result.config,
goPages = '/pages/order_pay_status/index?order_id=' + orderId + '&msg=' + res.message; goPages = '/pages/order_pay_status/index?order_id=' + orderId + '&msg=' + res.message +'&product_type=' + that.product_type,
goPagesOrder = '/pages/order_details/stay?order_id=' + orderId + '&credit_buy=1&product_type=' + that.product_type;
that.orderPay = true; that.orderPay = true;
uni.hideLoading(); uni.hideLoading();
switch (status) { switch (status) {
@ -1186,7 +1215,7 @@
title: res.message title: res.message
}, { }, {
tab: 5, tab: 5,
url: goPages url: goPagesOrder
}); });
break; break;
case 'success': case 'success':
@ -1241,7 +1270,7 @@
orderInfo: jsConfig, orderInfo: jsConfig,
success: (e) => { success: (e) => {
let url = '/pages/order_pay_status/index?order_id=' + orderId + let url = '/pages/order_pay_status/index?order_id=' + orderId +
'&msg=支付成功'; '&msg=支付成功'+'&product_type=' + that.product_type;
return that.$util.Tips({ return that.$util.Tips({
title: '支付成功', title: '支付成功',
icon: 'success' icon: 'success'
@ -1252,7 +1281,7 @@
}, },
fail: (e) => { fail: (e) => {
let url = '/pages/order_pay_status/index?order_id=' + orderId + let url = '/pages/order_pay_status/index?order_id=' + orderId +
'&msg=取消支付'; '&msg=取消支付'+'&product_type=' + that.product_type;
return that.$util.Tips({ return that.$util.Tips({
title: '取消支付', title: '取消支付',
}, { }, {
@ -1262,7 +1291,7 @@
}, },
complete: () => { complete: () => {
let url = '/pages/order_pay_status/index?order_id=' + orderId + let url = '/pages/order_pay_status/index?order_id=' + orderId +
'&msg=取消支付'; '&msg=取消支付'+'&product_type=' + that.product_type;
return that.$util.Tips({ return that.$util.Tips({
title: '取消支付', title: '取消支付',
}, { }, {
@ -1298,7 +1327,7 @@
}, },
fail: function(e) { fail: function(e) {
let pages = '/pages/order_pay_status/index?order_id=' + let pages = '/pages/order_pay_status/index?order_id=' +
orderId + '&msg=取消支付' orderId + '&msg=取消支付'+'&product_type=' + that.product_type
return that.$util.Tips({ return that.$util.Tips({
title: '取消支付' title: '取消支付'
}, { }, {
@ -1322,7 +1351,7 @@
case 'h5': case 'h5':
let host = window.location.protocol + "//" + window.location.host; let host = window.location.protocol + "//" + window.location.host;
let url = let url =
`${host}/pages/order_pay_status/index?order_id=${orderId}&msg=${res.message}` `${host}/pages/order_pay_status/index?order_id=${orderId}&msg=${res.message}&product_type=${that.product_type}`
let eUrl = encodeURIComponent(url) let eUrl = encodeURIComponent(url)
let jsurl = jsConfig.mweb_url || jsConfig.h5_url let jsurl = jsConfig.mweb_url || jsConfig.h5_url
let locations = `${jsurl}&redirect_url=${eUrl}` let locations = `${jsurl}&redirect_url=${eUrl}`
@ -1347,7 +1376,7 @@
}, },
fail: (e) => { fail: (e) => {
let pages = '/pages/order_pay_status/index?order_id=' + let pages = '/pages/order_pay_status/index?order_id=' +
orderId + '&msg=支付失败' orderId + '&msg=支付失败'+'&product_type=' + that.product_type
return that.$util.Tips({ return that.$util.Tips({
title: '支付失败' title: '支付失败'
}, { }, {
@ -1358,7 +1387,7 @@
complete: () => { complete: () => {
uni.hideLoading(); uni.hideLoading();
let pages = '/pages/order_pay_status/index?order_id=' + let pages = '/pages/order_pay_status/index?order_id=' +
orderId + '&msg=取消支付' orderId + '&msg=取消支付'+'&product_type=' + that.product_type
return that.$util.Tips({ return that.$util.Tips({
title: '取消支付' title: '取消支付'
}, { }, {
@ -1371,7 +1400,7 @@
// #endif // #endif
default: default:
let pages = '/pages/order_pay_status/index?order_id=' + let pages = '/pages/order_pay_status/index?order_id=' +
orderId + '&msg=取消支付' orderId + '&msg=取消支付'+'&product_type=' + that.product_type
return that.$util.Tips({ return that.$util.Tips({
title: '取消支付' title: '取消支付'
}, { }, {
@ -1429,7 +1458,6 @@
this.virtualIndex = index; this.virtualIndex = index;
}, },
SubOrder: function(e) { SubOrder: function(e) {
console.log(this.active);
let that = this, let that = this,
data = {}; data = {};

View File

@ -40,14 +40,17 @@
</view> </view>
<!--定金预售订单--> <!--定金预售订单-->
<view v-if="presellProList.length > 0" class="event_container"> <view v-if="presellProList.length > 0" class="event_container">
<navigator class="acea-row row-between" url="/pages/users/presell_order_list/index" hover-class='none' > <navigator class="acea-row row-between" url="/pages/users/presell_order_list/index" hover-class='none'>
<view class="info"> <view class="info">
<view class="title">预售尾款订单转到这里了</view> <view class="title">预售尾款订单转到这里了</view>
<view class="desc"> <text class="t-color">{{ presellOrderCount }}</text> 笔预售尾款订单待付款请点击查看</view> <view class="desc"> <text class="t-color">{{ presellOrderCount }}</text> 笔预售尾款订单待付款请点击查看
</view>
</view> </view>
<view class="photo acea-row row-between"> <view class="photo acea-row row-between">
<view class='picture'> <view class='picture'>
<image :src='(presellProList[0].orderProduct[0].cart_info.productAttr && presellProList[0].orderProduct[0].cart_info.productAttr.image) || presellProList[0].orderProduct[0].cart_info.product.image'></image> <image
:src='(presellProList[0].orderProduct[0].cart_info.productAttr && presellProList[0].orderProduct[0].cart_info.productAttr.image) || presellProList[0].orderProduct[0].cart_info.product.image'>
</image>
</view> </view>
<view class="more_btn"><text class="iconfont icon-gengduo3"></text></view> <view class="more_btn"><text class="iconfont icon-gengduo3"></text></view>
</view> </view>
@ -58,12 +61,17 @@
<view v-if="orderList.length > 0"> <view v-if="orderList.length > 0">
<block v-if="orderStatus == 0"> <block v-if="orderStatus == 0">
<view class='item' v-for="(item,index) in orderList" :key="index"> <view class='item' v-for="(item,index) in orderList" :key="index">
<view @click='goOrderDetails(item.group_order_id)'> <view @click='goOrderDetails(item.group_order_id,item.orderList[0].activity_type)'>
<view class='title acea-row row-between-wrapper'> <view class='title acea-row row-between-wrapper'>
<view class="acea-row row-middle left-wrapper"> <view class="acea-row row-middle left-wrapper">
{{item.group_order_sn}} {{item.group_order_sn}}
</view> </view>
<view class='t-color'>{{ item.orderList[0].activity_type === 2 && item.orderList[0].orderProduct[0].cart_info.productPresell.presell_type ==2 ? "待付定金" : "待付款" }}</view> <view class='t-color' v-if="item.pay_type == 3 || item.pay_type == 1">
待付款
</view>
<view class='t-color' v-if="item.pay_type == 8">
待结算
</view>
</view> </view>
<view v-for="(order,j) in item.orderList" :key="order.order_id+j"> <view v-for="(order,j) in item.orderList" :key="order.order_id+j">
<!--预售--> <!--预售-->
@ -71,24 +79,37 @@
<block v-for="(goods,g) in order.orderProduct"> <block v-for="(goods,g) in order.orderProduct">
<view class='item-info acea-row row-between row-top'> <view class='item-info acea-row row-between row-top'>
<view class='pictrue'> <view class='pictrue'>
<image :src='(goods.cart_info.productAttr && goods.cart_info.productAttr.image) || goods.cart_info.product.image'></image> <image
:src='(goods.cart_info.productAttr && goods.cart_info.productAttr.image) || goods.cart_info.product.image'>
</image>
</view> </view>
<view class='text acea-row row-between'> <view class='text acea-row row-between'>
<view class='name line1'> <view class='name line1'>
<text class="event_name event_bg">预售</text><text>{{goods.cart_info.product.store_name}}</text> <text
class="event_name event_bg">预售</text><text>{{goods.cart_info.product.store_name}}</text>
<view class="event_ship event_color">发货时间 <view class="event_ship event_color">发货时间
<!--全款预售--> <!--全款预售-->
<text v-if="goods.cart_info.productPresell.presell_type === 1"> <text v-if="goods.cart_info.productPresell.presell_type === 1">
{{ goods.cart_info.productPresell.delivery_type === 1 ? '支付成功后' : '预售结束后' }}{{ goods.cart_info.productPresell.delivery_day }}天内 {{ goods.cart_info.productPresell.delivery_type === 1 ? '支付成功后' : '预售结束后' }}{{ goods.cart_info.productPresell.delivery_day }}天内
</text> </text>
<!--定金预售--> <!--定金预售-->
<text v-if="goods.cart_info.productPresell.presell_type === 2">{{ goods.cart_info.productPresell.delivery_type === 1 ? '支付尾款后' : '预售结束后' }}{{ goods.cart_info.productPresell.delivery_day }}天内</text> <text
v-if="goods.cart_info.productPresell.presell_type === 2">{{ goods.cart_info.productPresell.delivery_type === 1 ? '支付尾款后' : '预售结束后' }}{{ goods.cart_info.productPresell.delivery_day }}天内</text>
</view> </view>
</view> </view>
<view class='money'> <view class='money'>
<view>{{goods.cart_info.productPresellAttr.presell_price}}</view> <view>{{goods.cart_info.productPresellAttr.presell_price}}
</view>
<view>x{{goods.product_num}}</view> <view>x{{goods.product_num}}</view>
</view> </view>
<view class="money" style="margin-left: 117px;" v-if="item.pay_type == 8">
<view>
先货后款 实付:0.00
</view>
</view>
<view class="totalPrice" v-if="item.pay_type == 8">
{{item.total_num || 0}}件商品结算周期到期后付款{{goods.cart_info.productAttr.price || item.interest.total_amount}}
</view>
</view> </view>
<view v-if="goods.cart_info.productPresell.presell_type === 2" class="event_price"> <view v-if="goods.cart_info.productPresell.presell_type === 2" class="event_price">
定金待支付 <text class="t-color">{{ order.pay_price }}</text> 定金待支付 <text class="t-color">{{ order.pay_price }}</text>
@ -101,15 +122,28 @@
<block v-for="(goods,g) in order.orderProduct"> <block v-for="(goods,g) in order.orderProduct">
<view class='item-info acea-row row-between row-top'> <view class='item-info acea-row row-between row-top'>
<view class='pictrue'> <view class='pictrue'>
<image :src='(goods.cart_info.productAttr && goods.cart_info.productAttr.image) || goods.cart_info.product.image'></image> <image
:src='(goods.cart_info.productAttr && goods.cart_info.productAttr.image) || goods.cart_info.product.image'>
</image>
</view> </view>
<view class='text acea-row row-between'> <view class='text acea-row row-between'>
<view class='name line2'>{{goods.cart_info.product.store_name}}</view> <view class='name line2'>{{goods.cart_info.product.store_name}}
</view>
<view class='money' v-if="item.orderList[0].activity_type == 4"> <view class="name line2">{{goods.cart_info.productAttr.sku}}
<view v-if="goods.cart_info.activeSku">{{goods.cart_info.activeSku.active_price}}</view> </view>
<view class='money' v-if="item.pay_type == 8">
<view>
{{goods.cart_info.productAttr.price}}</view>
<view>x{{goods.product_num}}</view> <view>x{{goods.product_num}}</view>
<!-- <view class="money" style="margin-left: 117px;" v-if="item.pay_type == 8">
<view>
先货后款 实付:0.00
</view>
</view>
<view class="totalPrice" v-if="item.pay_type == 8">
{{item.total_num || 0}}件商品结算周期到期后付款{{goods.cart_info.productAttr.price || item.interest.total_amount}}
</view> -->
</view> </view>
<view v-else class='money'> <view v-else class='money'>
<view>{{goods.cart_info.productAttr.price}}</view> <view>{{goods.cart_info.productAttr.price}}</view>
@ -120,11 +154,24 @@
</block> </block>
</view> </view>
</view> </view>
<view class='totalPrice' v-if="item.orderList[0].activity_type !== 2">{{item.total_num || 0}}件商品总金额 <view class='totalPrice' style="margin-right: 15px;" v-if="item.pay_type !== 8">
{{item.total_num || 0}}件商品总金额
<text class='money p-color'>{{item.pay_price}}</text> <text class='money p-color'>{{item.pay_price}}</text>
</view> </view>
<view class='bottom acea-row row-right row-middle'> <view class='totalPrice' style="margin-right: 15px;" v-else>先货后款 实付款:
<view class='bnt b-color' @click.stop='goPay(item.pay_price,item.group_order_id)'>立即付款</view> <text class='money p-color'>0.00</text>
</view>
<view class="totalPrice" style="margin-right: 15px;" v-if="item.pay_type == 8">
{{item.total_num || 0}}件商品结算周期到期后付款{{item.interest.total_amount}}
</view>
<view class='bottom acea-row row-right row-middle' v-if="item.pay_type == 3 || item.pay_type == 1">
<view class='bnt cancelBnt' @click.stop='cancelOrder(index,item.group_order_id)'>取消订单</view>
<view class='bnt b-color' @click.stop='goPay(item.pay_price,item.group_order_id)'>
立即付款</view>
</view>
<view class='bottom acea-row row-right row-middle' v-else>
<view class='bnt b-color' @click.stop='goPay(item.pay_price,item.group_order_id)'>
去结算</view>
</view> </view>
</view> </view>
</view> </view>
@ -144,14 +191,19 @@
<text v-else>待发货</text> <text v-else>待发货</text>
</view> </view>
<view v-if="item.status == 1" class='t-color'>待收货</view> <view v-if="item.status == 1" class='t-color'>待收货</view>
<view v-if="item.status == 2" class='t-color'>待评价</view> <view v-if="item.status == 2 && item.pay_type !== 8" class='t-color'>待评价</view>
<view v-if="item.status == 3" class='t-color'>已完成</view> <view v-if="item.status == 3" class='t-color'>已完成</view>
<view v-if="item.status == -1" class='t-color'>已退款</view> <view v-if="item.status == -1" class='t-color'>已退款</view>
<view v-if="item.status == 2 && item.pay_type == 8" class='t-color'>待结算</view>
</view> </view>
<view v-if="item.activity_type === 2"> <view v-if="item.activity_type === 2">
<view class='item-info acea-row row-between row-top' v-for="(goods,index) in item.orderProduct" :key="index"> <view class='item-info acea-row row-between row-top' v-for="(goods,index) in item.orderProduct"
:key="index">
<view class='pictrue'> <view class='pictrue'>
<image :src='(goods.cart_info.productAttr && goods.cart_info.productAttr.image) || goods.cart_info.product.image'></image> <image
:src='(goods.cart_info.productAttr && goods.cart_info.productAttr.image) || goods.cart_info.product.image'>
</image>
</view> </view>
<view class='text acea-row row-between'> <view class='text acea-row row-between'>
<view class='name '> <view class='name '>
@ -159,73 +211,117 @@
<text class="event_name event_bg">预售</text><text>{{goods.cart_info.product.store_name}}</text> <text class="event_name event_bg">预售</text><text>{{goods.cart_info.product.store_name}}</text>
<view v-if="item.status == 0" class="event_ship event_color">发货时间 <view v-if="item.status == 0" class="event_ship event_color">发货时间
<!--全款预售--> <!--全款预售-->
<text v-if="goods.cart_info.productPresell.presell_type === 1">{{ goods.cart_info.productPresell.delivery_type === 1 ? '支付成功后' : '预售结束后' }}{{ goods.cart_info.productPresell.delivery_day }}天内</text> <text
v-if="goods.cart_info.productPresell.presell_type === 1">{{ goods.cart_info.productPresell.delivery_type === 1 ? '支付成功后' : '预售结束后' }}{{ goods.cart_info.productPresell.delivery_day }}天内</text>
<!--定金预售--> <!--定金预售-->
<text v-if="goods.cart_info.productPresell.presell_type === 2">{{ goods.cart_info.productPresell.delivery_type === 1 ? '支付尾款后' : '预售结束后' }}{{ goods.cart_info.productPresell.delivery_day }}天内</text> <text
v-if="goods.cart_info.productPresell.presell_type === 2">{{ goods.cart_info.productPresell.delivery_type === 1 ? '支付尾款后' : '预售结束后' }}{{ goods.cart_info.productPresell.delivery_day }}天内</text>
</view> </view>
</view> </view>
<view style="margin-top: 10rpx;" class="t-color">{{goods.is_refund==1?'退款中':goods.is_refund==2?'部分退款':goods.is_refund==3?'全部退款':''}}</view> <view style="margin-top: 10rpx;" class="t-color">
{{goods.is_refund==1?'退款中':goods.is_refund==2?'部分退款':goods.is_refund==3?'全部退款':''}}
</view>
</view> </view>
<view class='money'> <view class='money'>
<view>{{goods.cart_info.productPresellAttr.presell_price}}</view> <view>{{goods.cart_info.productPresellAttr.presell_price}}</view>
<view>x{{goods.product_num}}</view> <view>x{{goods.product_num}}</view>
<view class="money" style="margin-left: 117px;" v-if="item.pay_type == 0">
<view>
先货后款 实付:0.00
</view>
</view>
<view class="totalPrice" v-if="item.pay_type == 8">
{{item.total_num || 0}}件商品结算周期到期后付款{{goods.cart_info.productAttr.price || item.interest.total_amount}}
</view>
</view> </view>
</view> </view>
</view> </view>
</view> </view>
<view v-else> <view v-else>
<view class='item-info acea-row row-between row-top' v-for="(goods,index) in item.orderProduct" :key="index"> <view class='item-info acea-row row-between row-top' v-for="(goods,index) in item.orderProduct"
:key="index">
<view class='pictrue'> <view class='pictrue'>
<image :src='(goods.cart_info.productAttr && goods.cart_info.productAttr.image) || goods.cart_info.product.image'></image> <image
:src='(goods.cart_info.productAttr && goods.cart_info.productAttr.image) || goods.cart_info.product.image'>
</image>
</view> </view>
<view class='text acea-row row-between'> <view class='text acea-row row-between'>
<view class='name '> <view class='name '>
<view class='name line2'> <view class='name line2'>
<text>{{goods.cart_info.product.store_name}}</text> <text>{{goods.cart_info.product.store_name}}</text>
</view> </view>
<view style="margin-top: 10rpx;" class="t-color">{{goods.is_refund==1?'退款中':goods.is_refund==2?'部分退款':goods.is_refund==3?'全部退款':''}}</view> <view class='name line2'>
<text>{{goods.cart_info.productAttr.sku}}</text>
</view>
<view style="margin-top: 10rpx;" class="t-color">
{{goods.is_refund==1?'退款中':goods.is_refund==2?'部分退款':goods.is_refund==3?'全部退款':''}}
</view>
</view> </view>
<view class='money' v-if="item.activity_type == 3"> <view class='money' v-if="item.activity_type == 3">
<view v-if="goods.cart_info.productAssistAttr">{{goods.cart_info.productAssistAttr.assist_price}}</view> <view v-if="goods.cart_info.productAssistAttr">
{{goods.cart_info.productAssistAttr.assist_price}}</view>
<view>x{{goods.product_num}}</view> <view>x{{goods.product_num}}</view>
<view class="money" style="margin-left: 117px;" v-if="item.pay_type == 8">
<view>
先货后款 实付:0.00
</view>
</view>
<view class="totalPrice" v-if="item.pay_type == 8">
{{item.total_num || 0}}件商品结算周期到期后付款{{goods.cart_info.productAttr.price || item.interest.total_amount}}
</view>
</view> </view>
<view class='money' v-else-if="item.activity_type == 4"> <view class='money' v-else-if="item.activity_type == 4">
<view v-if="goods.cart_info.activeSku">{{goods.cart_info.activeSku.active_price}}</view> <view v-if="goods.cart_info.activeSku">
{{goods.cart_info.activeSku.active_price}}</view>
<view>x{{goods.product_num}}</view> <view>x{{goods.product_num}}</view>
</view> </view>
<view class='money' v-else> <view class='money' v-else>
<view>{{goods.cart_info.productAttr.price}}</view> <view>{{goods.cart_info.productAttr.price}}</view>
<view>x{{goods.product_num}}</view> <view>x{{goods.product_num}}</view>
</view> </view>
</view> </view>
</view> </view>
</view> <view class='totalPrice' v-if="item.activity_type == 2">
<view class='totalPrice' v-if="item.activity_type == 2">{{item.orderNum || 0}}件商品总金额 {{item.orderNum || 0}}件商品总金额
<text class='money p-color'>{{item.presell_price}}</text> <text class='money p-color'>{{item.presell_price}}</text>
</view> </view>
<view class='totalPrice' v-else>{{item.orderNum || 0}}件商品总金额 <view class="money" style="margin-left: 206px;" v-if="item.pay_type == 8 ">
<text class='money p-color'>{{item.pay_price}}</text> <view>
先货后款 实付:0.00
</view>
</view>
</view>
<view class="totalPrice" style="margin-right: 18px;" v-if="item.pay_type == 8">
{{item.total_num || 0}}件商品结算周期到期后付款{{item.total_price || item.interest.total_amount}}
</view> </view>
</view> </view>
<view class='bottom acea-row row-right row-middle'> <view class='bottom acea-row row-right row-middle'>
<view v-if="!item.receipt && item.status != -1" class='bnt cancelBnt' @click.stop='applyInvoice(item.order_id)'>申请开票</view> <view v-if="!item.receipt && item.status != -1" class='bnt cancelBnt'
@click.stop='applyInvoice(item.order_id)'>申请开票</view>
<block v-if="item.status == 0 || item.status == 9 || item.status == -1"> <block v-if="item.status == 0 || item.status == 9 || item.status == -1">
<view class='bnt b-color' @click='goOrderDetails(item.order_id)'>查看详情</view> <view class='bnt b-color' @click='goOrderDetails(item.order_id)'>查看详情</view>
</block> </block>
<block v-if="item.status == 1"> <block v-if="item.status == 1">
<view class='bnt cancelBnt' v-if="item.delivery_type == 1 || item.delivery_type == 2" @click='goOrderDetails(item.order_id)'>查看物流</view> <view class='bnt cancelBnt' v-if="item.delivery_type == 1 || item.delivery_type == 2"
@click='goOrderDetails(item.order_id)'>查看物流</view>
<view class='bnt b-color' @tap='confirmOrder(item,index)'>确认收货</view> <view class='bnt b-color' @tap='confirmOrder(item,index)'>确认收货</view>
</block> </block>
<block v-if="item.status == 2"> <block v-if="item.status == 2 && item.pay_type !== 8 ">
<navigator v-if="community_status == 1 && !item.community_id" :url="'/pages/plantGrass/plant_release/index?order_id='+item.order_id" class='bnt colorBnt' hover-class="none"> <view class='bnt b-color' @click='goOrderDetails_Evaluation(item.order_id)'>去评价
<text class="iconfont icon-fabu"></text> </view>
发布种草 </block>
</navigator> <block v-if="item.status == 2 && item.pay_type == 8">
<view class='bnt b-color' @click='goOrderDetails_Evaluation(item.order_id)'>去评价</view> <view class='bnt b-color' @click='pay_open(item.order_id)'>去结算
</view>
</block> </block>
<block v-if="item.status == 3"> <block v-if="item.status == 3">
<view class='bnt b-color' @click='goOrderDetails(item.order_id)' v-if="item.activity_type == 2 || item.activity_type == 3 || item.activity_type == 10">查看详情</view> <view class='bnt b-color' @click='goOrderDetails(item.order_id)'
<navigator v-if="community_status == 1 && !item.community_id" :url="'/pages/plantGrass/plant_release/index?order_id='+item.order_id" class='bnt colorBnt' hover-class="none"> v-if="item.activity_type == 2 || item.activity_type == 3 || item.activity_type == 10">
查看详情</view>
<navigator v-if="community_status == 1 && !item.community_id"
:url="'/pages/plantGrass/plant_release/index?order_id='+item.order_id" class='bnt colorBnt'
hover-class="none">
<text class="iconfont icon-fabu"></text> <text class="iconfont icon-fabu"></text>
发布种草 发布种草
</navigator> </navigator>
@ -245,8 +341,21 @@
</view> </view>
<home></home> <home></home>
<authorize @onLoadFun="onLoadFun" :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse"></authorize> <authorize @onLoadFun="onLoadFun" :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse"></authorize>
<payment :payMode='payMode' :pay_close="pay_close" @onChangeFun='onChangeFun' :order_id="pay_order_id" :totalPrice='totalPrice'></payment> <payment :payMode='payMode' :pay_close="pay_close" @onChangeFun='onChangeFun' :order_id="pay_order_id"
:totalPrice='totalPrice'></payment>
<addInvoicing ref="addInvoicing" @changeInvoiceClose="changeInvoiceClose" :invoice='invoice'></addInvoicing> <addInvoicing ref="addInvoicing" @changeInvoiceClose="changeInvoiceClose" :invoice='invoice'></addInvoicing>
<u-popup :show="show" bgColor='transparent' mode='center'>
<view class="warp">
<image @click="close" class="guanbi" src="@/static/images/guanbi.png"></image>
<image src="@/static/images/shouhuo.png" mode="widthFix"></image>
</view>
<view class="textp">
<h3>确认收到货了吗?</h3>
<span>此订单为先货后款订单确认收货后将开始计算结算周期为保障售后权益请检查后再确认收货</span>
<button class="shouhuobtn" @click="queding()">确认收货</button>
<view class="cle" @click="close">取消</view>
</view>
</u-popup>
</view> </view>
</template> </template>
@ -269,20 +378,28 @@
orderPay, orderPay,
groupOrderList, groupOrderList,
orderTake, orderTake,
applyInvoiceApi applyInvoiceApi,
} from '@/api/order.js'; } from '@/api/order.js';
import { import {
getUserInfo getUserInfo
} from '@/api/user.js'; } from '@/api/user.js';
import {openOrderSubscribe} from '@/utils/SubscribeMessage.js'; import {
openOrderSubscribe
} from '@/utils/SubscribeMessage.js';
import payment from '@/components/payment'; import payment from '@/components/payment';
import home from '@/components/home/index.vue'; import home from '@/components/home/index.vue';
import addInvoicing from '@/components/addInvoicing'; import addInvoicing from '@/components/addInvoicing';
import { mapGetters } from "vuex"; import {
mapGetters
} from "vuex";
import authorize from '@/components/Authorize'; import authorize from '@/components/Authorize';
import emptyPage from '@/components/emptyPage.vue'; import emptyPage from '@/components/emptyPage.vue';
import { configMap } from '@/utils' import {
import { HTTP_REQUEST_URL } from '@/config/app'; configMap
} from '@/utils'
import {
HTTP_REQUEST_URL
} from '@/config/app';
export default { export default {
components: { components: {
payment, payment,
@ -325,7 +442,8 @@
title: '可用余额:', title: '可用余额:',
number: 0, number: 0,
payStatus: this.$store.getters.globalData.yue_pay_status payStatus: this.$store.getters.globalData.yue_pay_status
} },
], ],
pay_close: false, pay_close: false,
pay_order_id: '', pay_order_id: '',
@ -337,18 +455,26 @@
invoice: { invoice: {
invoice: false, invoice: false,
add: false, add: false,
} },
show: false,
shouhuo: {
index: '',
id: ''
},
//
activity_type: '',
product_type: 0
}; };
}, },
computed: { computed: {
...mapGetters(['isLogin','viewColor']), ...mapGetters(['isLogin', 'viewColor']),
...configMap(['hide_mer_status', 'community_status', 'alipay_open', 'yue_pay_status']), ...configMap(['hide_mer_status', 'community_status', 'alipay_open', 'yue_pay_status']),
}, },
watch: { watch: {
alipay_open(n){ alipay_open(n) {
this.payMode[1].payStatus = n this.payMode[1].payStatus = n
}, },
yue_pay_status(n){ yue_pay_status(n) {
this.payMode[2].payStatus = n this.payMode[2].payStatus = n
} }
}, },
@ -366,16 +492,20 @@
this.isShowAuth = true this.isShowAuth = true
} }
}, },
onReady(){ onReady() {},
}, mounted: function() {},
mounted: function() {
},
methods: { methods: {
// //
goMall(item){ pay_open: function(order_id) {
if(this.hide_mer_status == 0){
uni.navigateTo({ uni.navigateTo({
url:'/pages/store/home/index?id='+item.mer_id url: '/pages/order_details/stay?order_id=' + order_id + '&product_type=' + this.product_type
})
},
//
goMall(item) {
if (this.hide_mer_status == 0) {
uni.navigateTo({
url: '/pages/store/home/index?id=' + item.mer_id
}) })
} }
}, },
@ -422,6 +552,7 @@
*/ */
onLoad: function(options) { onLoad: function(options) {
if (options.status) this.orderStatus = options.status; if (options.status) this.orderStatus = options.status;
if (options.product_type) this.product_type = options.product_type;
}, },
/** /**
* 获取订单统计数据 * 获取订单统计数据
@ -429,7 +560,9 @@
*/ */
getOrderData: function() { getOrderData: function() {
let that = this; let that = this;
orderData().then(res => { orderData({
product_type: this.product_type
}).then(res => {
that.$set(that, 'orderData', res.data); that.$set(that, 'orderData', res.data);
}) })
}, },
@ -463,10 +596,14 @@
* *
*/ */
goPay: function(pay_price, order_id) { goPay: function(pay_price, order_id) {
this.$set(this, 'pay_close', true); console.log(order_id);
this.order_id = order_id; uni.navigateTo({
this.pay_order_id = order_id.toString() url: '/pages/users/payment/payment?order_id=' + order_id + '&product_type=' + this.product_type
this.$set(this, 'totalPrice', pay_price); });
// this.$set(this, 'pay_close', true);
// this.order_id = order_id;
// this.pay_order_id = order_id.toString()
// this.$set(this, 'totalPrice', pay_price);
}, },
/** /**
* 支付成功回调 * 支付成功回调
@ -492,7 +629,7 @@
/** /**
* 去订单详情 * 去订单详情
*/ */
goOrderDetails: function(order_id) { goOrderDetails: function(order_id, product_type) {
let self = this let self = this
if (!order_id) return that.$util.Tips({ if (!order_id) return that.$util.Tips({
title: '缺少订单号无法查看订单详情' title: '缺少订单号无法查看订单详情'
@ -505,7 +642,7 @@
uni.hideLoading(); uni.hideLoading();
if (self.orderStatus == 0) { if (self.orderStatus == 0) {
uni.navigateTo({ uni.navigateTo({
url: '/pages/order_details/stay?order_id=' + order_id url: '/pages/order_details/stay?order_id=' + order_id + '&product_type=' + product_type
}) })
} else { } else {
uni.navigateTo({ uni.navigateTo({
@ -519,7 +656,7 @@
// #ifndef MP // #ifndef MP
if (self.orderStatus == 0) { if (self.orderStatus == 0) {
uni.navigateTo({ uni.navigateTo({
url: '/pages/order_details/stay?order_id=' + order_id url: '/pages/order_details/stay?order_id=' + order_id + '&product_type=' + product_type
}) })
} else { } else {
uni.navigateTo({ uni.navigateTo({
@ -580,18 +717,21 @@
if (that.loading) return; if (that.loading) return;
that.loading = true; that.loading = true;
that.loadTitle = "加载更多"; that.loadTitle = "加载更多";
if(that.isReady){ if (that.isReady) {
that.isReady = false that.isReady = false
if (that.orderStatus == 0) { if (that.orderStatus == 0) {
groupOrderList({ groupOrderList({
page: that.page, page: that.page,
limit: that.limit, limit: that.limit,
product_type: that.product_type,
}).then(res => { }).then(res => {
console.log(res);
that.isReady = true; that.isReady = true;
let list = res.data.list || []; let list = res.data.return || [];
let loadend = list.length < that.limit; let loadend = list.length < that.limit;
// console.log(that.orderList) console.log(that.orderList)
that.orderList = that.page == 1 ? list : that.$util.SplitArray(list, that.orderList); that.orderList = that.page == 1 ? list : that.$util.SplitArray(list, that
.orderList);
that.$set(that, 'orderList', that.orderList); that.$set(that, 'orderList', that.orderList);
// console.log(that.orderList) // console.log(that.orderList)
that.getProductCount(); that.getProductCount();
@ -605,10 +745,13 @@
status: that.orderStatus - 1, status: that.orderStatus - 1,
page: that.page, page: that.page,
limit: that.limit, limit: that.limit,
product_type: that.product_type,
}).then(res => { }).then(res => {
console.log(res);
let list = res.data.list || []; let list = res.data.list || [];
let loadend = list.length < that.limit; let loadend = list.length < that.limit;
that.orderList = that.page == 1 ? list : that.$util.SplitArray(list, that.orderList); that.orderList = that.page == 1 ? list : that.$util.SplitArray(list, that
.orderList);
that.$set(that, 'orderList', that.orderList); that.$set(that, 'orderList', that.orderList);
that.getProductCount(); that.getProductCount();
that.loadend = loadend; that.loadend = loadend;
@ -641,15 +784,15 @@
/** /**
* 获取单个订单商品数量 * 获取单个订单商品数量
*/ */
getProductCount: function(){ getProductCount: function() {
if(this.orderStatus !== 0){ if (this.orderStatus !== 0) {
this.orderList.forEach((item,i) => { this.orderList.forEach((item, i) => {
let orderNum = 0 let orderNum = 0
if(item.orderProduct){ if (item.orderProduct) {
item.orderProduct.forEach((val) => { item.orderProduct.forEach((val) => {
orderNum += val.product_num orderNum += val.product_num
}) })
this.orderList[i]['orderNum']=orderNum; this.orderList[i]['orderNum'] = orderNum;
} }
}) })
} }
@ -676,27 +819,26 @@
}, },
// //
confirmOrder: function(item, index) { confirmOrder: function(item, index) {
this.show = true
this.shouhuo.id = item.order_id
this.shouhuo.index = index
},
queding() {
let that = this; let that = this;
uni.showModal({ orderTake(that.shouhuo.id).then(res => {
title: '确认收货', that.show = false
content: '为保障权益,请收到货确认无误后,再确认收货', that.orderList.splice(that.shouhuo.index, 1);
success: function(res) { that.getOrderData();
if (res.confirm) {
orderTake(item.order_id).then(res => {
return that.$util.Tips({ return that.$util.Tips({
title: '操作成功', title: '操作成功',
icon: 'success' icon: 'success',
}, function() { })
that.orderList.splice(index, 1);
that.getOrderData();
});
}).catch(err => { }).catch(err => {
return that.$util.Tips({ return that.$util.Tips({
title: err title: err
}); });
}) that.show = false
}
}
}) })
}, },
/*申请开票*/ /*申请开票*/
@ -709,13 +851,13 @@
}, },
// //
changeInvoiceClose: function(data) { changeInvoiceClose: function(data) {
if(data)this.getInvoiceData(data); if (data) this.getInvoiceData(data);
this.$set(this.invoice, 'invoice', false); this.$set(this.invoice, 'invoice', false);
}, },
// //
getInvoiceData(data) { getInvoiceData(data) {
let that = this let that = this
applyInvoiceApi(that.invoice_order_id,data).then(res => { applyInvoiceApi(that.invoice_order_id, data).then(res => {
return that.$util.Tips({ return that.$util.Tips({
title: res.message, title: res.message,
}); });
@ -724,7 +866,11 @@
title: err title: err
}); });
}) })
} },
close() {
this.show = false
},
}, },
onReachBottom: function() { onReachBottom: function() {
this.getOrderList(); this.getOrderList();
@ -738,9 +884,19 @@
padding: 0 30rpx; padding: 0 30rpx;
background-color: var(--view-theme); background-color: var(--view-theme);
} }
.t-color{color: var(--view-theme);}
.p-color{color: var(--view-priceColor);} .t-color {
.b-color{background-color:var(--view-theme);} color: var(--view-theme);
}
.p-color {
color: var(--view-priceColor);
}
.b-color {
background-color: var(--view-theme);
}
.my-order .header .picTxt { .my-order .header .picTxt {
height: 190rpx; height: 190rpx;
} }
@ -756,6 +912,8 @@
font-weight: bold; font-weight: bold;
color: #fff; color: #fff;
margin-bottom: 20rpx; margin-bottom: 20rpx;
} }
.my-order .header .picTxt .pictrue { .my-order .header .picTxt .pictrue {
@ -853,19 +1011,28 @@
font-size: 28rpx; font-size: 28rpx;
color: #999; color: #999;
margin-top: 6rpx; margin-top: 6rpx;
.totalPrice {
font-size: 26rpx;
color: #282828;
text-align: right;
padding-left: 28px;
}
} }
.my-order .list .item .item-info .text .name { .my-order .list .item .item-info .text .name {
width: 320rpx; width: 320rpx;
color: #282828; color: #282828;
} }
.event_bg{
.event_bg {
background: #FF7F00; background: #FF7F00;
} }
.event_color{
.event_color {
color: #FF7F00; color: #FF7F00;
} }
.my-order .list .item .event_name{
.my-order .list .item .event_name {
display: inline-block; display: inline-block;
margin-right: 9rpx; margin-right: 9rpx;
color: #fff; color: #fff;
@ -875,13 +1042,16 @@
text-align: center; text-align: center;
border-radius: 6rpx; border-radius: 6rpx;
} }
.my-order .list .item .event_ship{
.my-order .list .item .event_ship {
font-size: 20rpx; font-size: 20rpx;
margin-top: 10rpx; margin-top: 10rpx;
} }
.my-order .list .event_price{
.my-order .list .event_price {
margin: 0 0 50rpx 120rpx; margin: 0 0 50rpx 120rpx;
} }
.my-order .list .item .item-info .text .money { .my-order .list .item .item-info .text .money {
text-align: right; text-align: right;
} }
@ -890,8 +1060,8 @@
font-size: 26rpx; font-size: 26rpx;
color: #282828; color: #282828;
text-align: right; text-align: right;
margin: 27rpx 0 0 30rpx; margin: 27rpx 0 0 -30rpx;
padding: 0 30rpx 30rpx 0; padding: -1px 20rpx 30rpx 0;
} }
.my-order .list .item .totalPrice .money { .my-order .list .item .totalPrice .money {
@ -920,14 +1090,17 @@
border: 1px solid #ddd; border: 1px solid #ddd;
color: #aaa; color: #aaa;
} }
.my-order .list .item .bottom .bnt.colorBnt { .my-order .list .item .bottom .bnt.colorBnt {
border: 1px solid var(--view-theme); border: 1px solid var(--view-theme);
color: var(--view-theme); color: var(--view-theme);
} }
.my-order .list .item .bottom .bnt .icon-fabu{
.my-order .list .item .bottom .bnt .icon-fabu {
font-size: 26rpx; font-size: 26rpx;
margin-right: 10rpx; margin-right: 10rpx;
} }
.my-order .list .item .bottom .bnt~.bnt { .my-order .list .item .bottom .bnt~.bnt {
margin-left: 17rpx; margin-left: 17rpx;
} }
@ -947,7 +1120,8 @@
width: 100%; width: 100%;
height: 100%; height: 100%;
} }
.event_container{
.event_container {
width: 690rpx; width: 690rpx;
background-image: url(../static/images/presell_orderBg.png); background-image: url(../static/images/presell_orderBg.png);
background-size: cover; background-size: cover;
@ -955,30 +1129,37 @@
margin: 20rpx auto; margin: 20rpx auto;
padding: 26rpx 30rpx; padding: 26rpx 30rpx;
border-radius: 16rpx; border-radius: 16rpx;
.info{
.info {
width: 420rpx; width: 420rpx;
.title{
.title {
color: #282828; color: #282828;
font-size: 26rpx; font-size: 26rpx;
} }
.desc{
.desc {
color: #999; color: #999;
font-size: 24rpx; font-size: 24rpx;
margin-top: 30rpx; margin-top: 30rpx;
} }
} }
.photo{
.photo {
width: 180rpx; width: 180rpx;
.picture{
.picture {
width: 120rpx; width: 120rpx;
height: 120rpx; height: 120rpx;
image{
image {
width: 100%; width: 100%;
height: 100%; height: 100%;
border-radius: 8rpx; border-radius: 8rpx;
} }
} }
.more_btn{
.more_btn {
color: #fff; color: #fff;
background: #F97E3B; background: #F97E3B;
width: 40rpx; width: 40rpx;
@ -988,7 +1169,8 @@
line-height: 40rpx; line-height: 40rpx;
position: relative; position: relative;
top: 40rpx; top: 40rpx;
text{
text {
font-size: 20rpx; font-size: 20rpx;
} }
} }
@ -1009,4 +1191,60 @@
font-size: 23rpx; font-size: 23rpx;
} }
} }
.warp {
margin: auto;
image{
}
.guanbi {
position: absolute;
right: 0px;
z-index: 1;
width: 30px;
height: 30px;
}
}
.textp {
width: 320px;
padding-bottom: 20px;
position: absolute;
top: 130px;
border-radius: 10px;
h3 {
text-align: center;
}
span {
display: block;
width: 280px;
padding-top: 20px;
margin: auto;
}
.shouhuobtn {
margin: auto;
line-height: 54px;
margin-top: 30px;
width: 191px;
height: 54px;
color: white;
background: linear-gradient(180deg, #F98649 0%, #F34E45 100%);
border-radius: 27px 27px 27px 27px;
}
.cle {
margin: auto;
text-align: center;
margin-top: 15px;
height: 40px;
background-color: #FFFFFF;
border-radius: 10px;
color: #999999;
}
}
.line2{
-webkit-line-clamp: 1;
}
</style> </style>

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,438 @@
<template>
<view class="center">
<view class='wrapper'>
<view class='item'>
<view>支付方式</view>
<view class='list'>
<!-- #ifdef H5 -->
<view class='payItem acea-row row-middle' :class='active==index ?"on":""' @tap='payItem(index)'
v-for="(item,index) in cartArr" :key='index' v-if="item.payStatus==1">
<view class='name acea-row row-center-wrapper'>
<view class='iconfont animated'
:class='(item.icon) + " " + (animated==true&&active==index ?"bounceIn":"")'></view>
{{item.name}}
</view>
<view class='tip'>
{{item.title}}
<block v-if="item.value == 'balance'">
{{userInfo.now_money}}
</block>
</view>
</view>
<!-- #endif -->
<!-- #ifdef MP || APP-PLUS -->
<view class='payItem acea-row row-middle' :class='active==index ?"on":""' @tap='payItem(index)'
v-for="(item,index) in cartArr" :key='index' v-if="item.payStatus==1">
<view class='name acea-row row-center-wrapper'>
<view class='iconfont animated'
:class='(item.icon) + " " + (animated==true&&active==index ?"bounceIn":"")'></view>
{{item.name}}
</view>
<view class='tip'>
{{item.title}}
<block v-if="item.value == 'balance'">
{{userInfo.now_money}}
</block>
</view>
</view>
<!-- #endif -->
</view>
</view>
</view>
<view class="settel">
<view class='settel-t'>
<view>商品总价</view>
<view class='conter'> {{couponData.interest.total_price}}</view>
</view>
</view>
<view class="settel" v-if="this.be_overdue == 0 || this.be_overdue < 0">
<view class='settel-t'>
<view>利息合计:</view>
<view class="conter">
<view class='con_text'> {{couponData.interest.interest}}</view>
<view class='con_text' style="color: #F84221;" v-if="couponData.pay_type == 8">
已逾期{{this.be_overday}}</view>
</view>
</view>
</view>
<view class='footer acea-row row-between-wrapper'>
<view class="footer_count">
<view>
合计:
<text class='pColor' v-if="cartArr[4].payStatus == 1">0.00</text>
<text class='pColor' v-else>{{couponData.interest.total_amount}}</text>
</view>
<!-- <view style="font-size: 14px;color: #F84221;" v-if="this.be_overdue == 0 || this.be_overdue < 0 ">
可结算周期到期后再付款{{totalPrice}}
</view> -->
</view>
<view class='settlement' @tap="SubOrder">
提交订单
</view>
</view>
</view>
</template>
<script>
import {
getUserInfo,
} from '@/api/user.js';
import {
groupOrderDetail,
orderPay
} from '@/api/order.js'
import {
postsettle,
} from '@/api/admin.js'
export default {
data() {
return {
animated: false,
totalPrice: 0,
couponData: {},
active: 0, // ,
userInfo: {}, //
cartArr: [{
"name": "微信支付",
"icon": "icon-weixin2",
value: 'weixin',
title: '微信快捷支付',
payStatus: 1,
},
{
name: "支付宝支付",
icon: "icon-icon34",
// #ifdef H5 || APP-PLUS
value: 'alipay',
// #endif
// #ifdef MP
value: 'alipayQr',
// #endif
title: '支付宝支付',
payStatus: this.$store.getters.globalData.alipay_open
},
{
"name": "余额支付",
"icon": "icon-icon-test",
value: 'balance',
title: '可用余额:',
payStatus: this.$store.getters.globalData.yue_pay_status,
},
{
"name": "线下支付",
"icon": "icon-yinhangqia",
value: 'offline',
title: '线下支付',
payStatus: 2,
}, {
"name": "先货后款",
"icon": "tan-a-lujing17324",
value: 'creditBuy',
title: `结算周期30天 `,
label: '日利率0.05%',
order_id: '',
},
],
order_id: '',
product_type: 0,
mer_id:'',
be_overdue:'',//
be_overday:'',//
};
},
onLoad(options) {
this.payType='weixin'
this.order_id = options.order_id
if (options.product_type) { this.product_type = options.product_type }
console.log(this.product_type);
this.$nextTick(()=>{
this.getOrderInfo()
this.getUserInfo()
})
},
methods: {
payItem: function(e) {
let that = this;
let active = e;
that.active = active;
that.animated = true;
console.log(active);
that.payType = that.cartArr[active].value;
console.log(that.payType);
},
getUserInfo() {
getUserInfo().then(res => {
this.userInfo = res.data
this.mer_id = res.data.service.mer_id
})
},
getOrderInfo() {
groupOrderDetail(this.order_id, this.product_type).then(res => {
this.couponData = res.data
this.$nextTick(()=>{
if(this.couponData.interest !== null){
this.moerTime(this.couponData.interest.start_time)
}
})
})
},
SubOrder() {
if (this.couponData.pay_type == 8) {
postsettle(
this.mer_id, {
id:this.order_id,
pay_type: this.payType
}
).then(res => {
if(res.message == 'success'){
uni.showToast({
title: '付款成功'
})
setTimeout(() => {
uni.navigateBack({
delta: 1
})
}, 1000)
}
}).catch(err=>{
uni.showToast({
title: err.message
})
})
} else {
orderPay(this.order_id, {
type: this.payType
}).then(res => {
console.log(res);
setTimeout(() => {
uni.navigateBack({
delta: 1
})
}, 1000)
uni.showToast({
title: res.message
})
})
}
},
//
moerTime(autoTime){
var date1 = (Date.parse(new Date()))/1000;
var date2 = (Date.parse(new Date(autoTime)))/1000;
var date3 = (date2- date1)*1000;
this.be_overdue = Math.floor(date3 / (24 * 3600 * 1000));
if(this.be_overdue == 0 || this.be_overdue < 0 ){
var date1 = (Date.parse(new Date()))/1000;
var date2 = (Date.parse(new Date(autoTime)))/1000;
var date3 = (date1- date2)*1000;
this.be_overday =Math.floor(date3 / (24 * 3600 * 1000));
}
}
}
}
</script>
<style lang="scss" scoped>
.center {
.wrapper .item .discount .placeholder {
color: #ccc;
text-align: right;
}
.wrapper {
margin-bottom: 12rpx;
background-color: #fff;
padding-top: 20px;
}
.wrapper .item {
padding: 27rpx 30rpx;
font-size: 30rpx;
color: #282828;
}
.wrapper .item .discount .iconfont {
color: #515151;
font-size: 30rpx;
margin-left: 15rpx;
}
.wrapper .item .discount .num {
font-size: 32rpx;
margin-right: 20rpx;
}
.wrapper .item .shipping {
font-size: 30rpx;
color: #999;
position: relative;
padding-right: 58rpx;
}
.wrapper .item .shipping .iconfont {
font-size: 35rpx;
color: #707070;
position: absolute;
right: 0;
top: 50%;
transform: translateY(-50%);
margin-left: 30rpx;
}
.wrapper .item input {
flex: 1;
height: 100%;
margin-left: 20rpx;
text-align: right;
}
.wrapper .item .placeholder {
color: #ccc;
}
.wrapper .item .list {
margin-top: 35rpx;
}
.wrapper .item .list .payItem {
border: 1px solid #eee;
border-radius: 6rpx;
height: 86rpx;
width: 100%;
box-sizing: border-box;
margin-top: 20rpx;
font-size: 28rpx;
color: #282828;
}
.wrapper .item .list .payItem.on {
border-color: var(--view-theme);
color: var(--view-theme);
}
.wrapper .item .list .payItem .name {
width: 50%;
text-align: center;
border-right: 1px solid #eee;
justify-content: left;
padding-left: 80rpx;
}
.wrapper .item .list .payItem .name .iconfont {
width: 44rpx;
height: 44rpx;
border-radius: 50%;
text-align: center;
line-height: 44rpx;
background-color: #fe960f;
color: #fff;
font-size: 30rpx;
margin-right: 15rpx;
}
.wrapper .item .list .payItem .name .iconfont.icon-weixin2 {
background-color: #41b035;
}
.wrapper .item .list .payItem .name .iconfont.icon-icon34 {
background-color: #4295D5;
}
.wrapper .item .list .payItem .tip {
width: 49%;
text-align: center;
font-size: 26rpx;
color: #aaa;
}
.footer {
width: 100%;
height: 100rpx;
height: calc(100rpx+ constant(safe-area-inset-bottom)); /// IOS<11.2/
height: calc(100rpx + env(safe-area-inset-bottom)); /// IOS>11.2/
background-color: #fff;
padding: 0 30rpx;
font-size: 28rpx;
color: #333;
box-sizing: border-box;
position: fixed;
bottom: 0;
left: 0;
z-index: 30;
.footer_count {
font-size: 28rpx;
}
.coupon_price {
color: #999999;
font-size: 20rpx;
margin-top: 10rpx;
text {
color: #282828;
padding: 2rpx 10rpx;
background: #F5F5F5;
border-radius: 26rpx;
margin-left: 20rpx;
line-height: 30rpx;
height: 30rpx;
display: inline-block;
}
}
.settlement {
font-size: 30rpx;
color: #fff;
width: 240rpx;
height: 70rpx;
background: linear-gradient(90deg, #F98649 0%, #F34E45 100%);
border-radius: 50rpx;
text-align: center;
line-height: 70rpx;
&.disabled {
background-color: #cccccc;
}
}
.transparent {
opacity: 0
}
}
.settel {
width: 100%;
background-color: #fff;
height: 70px;
padding: 0 15px 0 15px;
line-height: 70px;
.settel-t {
width: 100%;
display: flex;
justify-content: space-between;
align-items: center;
}
.con_text {
display: flex;
justify-content: flex-end;
height: 20px;
margin: auto;
line-height: 30px;
}
}
}
</style>

View File

@ -0,0 +1,75 @@
<template>
<view class="conent">
<view class="con_kuo" @click="navigator(`/pages/nongKe/supply_chain/supplier?type_id=12&isDetail=1&product_type=98&cate_id=${id}`)">
<image class="con_img" src="@/static/images/bg1.png" mode=""></image>
<image class="con_ico" src="@/static/images/bgic1.png" mode=""></image>
<view class="con_text">
<h3>先款后货</h3>
<span>先付款后发货</span>
</view>
</view>
<view class="con_kuo" @click="navigator(`/pages/nongKe/supply_chain/supplier?type_id=12&isDetail=1&product_type=98&cate_id=${id}&credit_buy=1`)">
<image class="con_img" src="@/static/images/bg2.png" mode=""></image>
<image class="con_ico" src="@/static/images/bgic2.png" mode=""></image>
<view class="con_text">
<h3>先货后款</h3>
<span>先发货后付款</span>
</view>
</view>
</view>
</template>
<script>
export default {
data(){
return{
id:''
}
},
onLoad(option) {
console.log(option);
this.id=option.cate_id
},
methods:{
navigator(url, t) {
uni.navigateTo({
url: url
})
},
}
}
</script>
<style lang="scss" scoped>
*{
padding: 0;
margin: 0;
}
.conent{
width: 100%;
display: flex;
justify-content: space-around;
margin-top: 20px;
.con_kuo{
position: relative;
.con_img{
width: 192px;
height: 92px;
}
.con_ico{
position: absolute;
left: 25px;
top: 32px;
width: 31px;
height: 32px;
}
.con_text{
position: absolute;
left: 66px;
top: 20px;
color: white;
}
}
}
</style>

View File

@ -0,0 +1,208 @@
<template>
<view>
<view class="header">
<view class="top-header">
<view class="search">
<view class="search-content acea-row row-middle">
<text class="iconfont icon-sousuo"></text>
<input v-model="where.keyword" confirm-type="search" placeholder="请输收货人手机号或订单号搜索" class="input"
@confirm="handleSearch" />
</view>
</view>
</view>
<view class="recom">
<view class="recom_bnt">
<rudon-rowMenuDotDotDot :localdata="options" @change="menuAction($event)">
{{this.recomname}}
</rudon-rowMenuDotDotDot>
</view>
</view>
</view>
<view class="type_switch">
<view class="recom_mend">
推荐
</view>
</view>
<view class="type_switch">
<view class="recom_mend">
调货
</view>
</view>
<view class="type_switch">
<view class="recom_mend">
打折专区
</view>
</view>
<view class="list">
<view class="item">
<image class="shopimg" src="@/static/images/2-002.png" mode="widthFix"></image>
<view class="item_text">
<span>调货</span> 夹岸数范德萨范德萨衣服上的
</view>
<view class="item_prices">
啊沙发上
</view>
<view class="item_name">
<image class="avater" src="../user_grade/images/suozi.png" mode="widthFix"></image>
<view class="item_name_text">
啊沙发上
</view>
</view>
</view>
</view>
</view>
</template>
<script>
import { methods } from '../../../uni_modules/uview-ui/libs/mixin/mixin'
export default {
data() {
return {
where: {
page: 1,
limit: 10,
status: 20,
product_type: 98,
keyword: '',
},
options: [{
value: '0',
text: '推荐'
},
{
value: '1',
text: '调货'
},
{
value: '2',
text: '打折专区'
}
],
recomname: '',
}
},
methods: {
menuAction(action, rowId) {
console.log(action);
//
if (action === '') {
this.recomname = this.options[0].text
} else {
this.recomname = this.options[action].text
}
},
}
}
</script>
<style lang="scss" scoped>
.header {
width: 100%;
display: flex;
justify-content: flex-start;
align-items: center;
.top-header {
z-index: 9999;
width: 80%;
background-color: #fff;
.search {
padding: 17rpx 30rpx;
.search-content {
width: 100%;
height: 60rpx;
padding: 0 30rpx;
border-radius: 30rpx;
background-color: #F5F5F5;
font-size: 26rpx;
}
.iconfont {
margin-right: 10rpx;
font-size: 26rpx;
color: #999999;
}
.input-placeholder {
font-size: 26rpx;
color: #999999;
}
.input {
flex: 1;
}
}
}
.recom {
width: 78px;
height: 34px;
text-align: center;
border-radius: 30px;
border: 1px solid #F84221;
display: flex;
justify-content: center;
align-items: center;
.recom_bnt {}
}
}
.list {
width: 100%;
display: flex;
justify-content: flex-start;
align-items: center;
flex-wrap: wrap;
.item {
width: 45%;
margin: 9px;
.shopimg {
width: 100%;
}
.item_text {
width: 100%;
padding: 15px 10px 15px 10px;
text-overflow: ellipsis;
overflow: hidden;
white-space: nowrap;
span {
height: 20px;
padding: 3px;
margin: 2px;
background: linear-gradient(180deg, #F98649 0%, #F34E45 100%);
border-radius: 4px 0px 4px 0px;
color: white;
}
}
.item_prices {
font-size: 18px;
color: #F84221;
padding-left: 15px;
border-bottom: 1px solid #707070;
}
.item_name {
width: 100%;
height: 50px;
display: flex;
align-items: center;
.avater {
margin: 5px;
width: 40px;
height: 40px;
}
}
}
}
</style>

View File

@ -19,6 +19,7 @@
<view>协议规则</view> <view>协议规则</view>
<text class='iconfont icon-you'></text> <text class='iconfont icon-you'></text>
</view> </view>
<!-- #ifdef MP --> <!-- #ifdef MP -->
<view class='item acea-row row-between-wrapper' @click="Setting"> <view class='item acea-row row-between-wrapper' @click="Setting">
<view>隐私设置</view> <view>隐私设置</view>

View File

@ -0,0 +1,82 @@
@font-face {
font-family: "icontan"; /* Project id 3552766 */
src: url('//at.alicdn.com/t/c/font_3552766_bmogttr4zyj.woff2?t=1688542944134') format('woff2'),
url('//at.alicdn.com/t/c/font_3552766_bmogttr4zyj.woff?t=1688542944134') format('woff'),
url('//at.alicdn.com/t/c/font_3552766_bmogttr4zyj.ttf?t=1688542944134') format('truetype');
}
.icontan {
font-family: "icontan" !important;
font-size: 16px;
font-style: normal;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
.tan-a-lujing17324:before {
content: "\e602";
}
.tan-xianhuo:before {
content: "\e601";
}
.tan-dianpu:before {
content: "\e600";
}
.tan-clock:before {
content: "\e627";
}
.tan-ditu_dingwei_o:before {
content: "\ebbb";
}
.tan-f24gl-telephone:before {
content: "\e953";
}
.tan-sound-Mute:before {
content: "\e766";
}
.tan-vehivles:before {
content: "\e76b";
}
.tan-shoes:before {
content: "\e76c";
}
.tan-aviation:before {
content: "\e770";
}
.tan-landtransportation:before {
content: "\e773";
}
.tan-dingwei:before {
content: "\e8c4";
}
.tan-favorites-fill:before {
content: "\e721";
}
.tan-rmb:before {
content: "\e761";
}
.tan-scanning:before {
content: "\e762";
}
.tan-raw:before {
content: "\e75e";
}
.tan-service:before {
content: "\e764";
}

BIN
static/images/bg1.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

BIN
static/images/bg2.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

BIN
static/images/bgic1.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.4 KiB

BIN
static/images/bgic2.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.4 KiB

BIN
static/images/daoru.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.0 KiB

BIN
static/images/diaohuo.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

BIN
static/images/fabu.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

BIN
static/images/jiankong.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 635 B

BIN
static/images/shouhuo.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 76 KiB

BIN
static/images/weituo.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

BIN
static/images/wenhao.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

BIN
static/images/xianshang.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 45 KiB

BIN
static/images/xianxia.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 48 KiB

BIN
static/images/yuqi.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 56 KiB

View File

@ -0,0 +1,2 @@
## 1.0.02022-09-29

View File

@ -0,0 +1,422 @@
<template>
<view class="uni-stat__select">
<!-- 组件介绍 -->
<!-- 名称rudon-rowMenuDotDotDot 行内三点式下拉菜单 -->
<!-- 作者Rudon <https://rudon.blog.csdn.net> -->
<!-- 用途点击三点 -->
<!-- 用法
0参考https://uniapp.dcloud.net.cn/component/uniui/uni-data-select.html
1项目安装本组件
2vue中直接引用即可例如下面的例子 插槽可随意修改例如...
-->
<!-- 例如:
<rudon-rowMenuDotDotDot :clear="false" :localdata="菜单对象" @change="ccc($event, item)">
...
</rudon-rowMenuDotDotDot>
-->
<span v-if="label" class="uni-label-text hide-on-phone">{{label + ''}}</span>
<view class="uni-select">
<view class="uni-select__input-box" @click="toggleSelector">
<!-- 显示插槽内容 -->
<slot></slot>
</view>
<view class="uni-select--mask" v-if="showSelector" @click="toggleSelector" />
<view class="uni-select__selector" v-if="showSelector">
<view class="uni-popper__arrow"></view>
<scroll-view scroll-y="true" class="uni-select__selector-scroll">
<view class="uni-select__selector-empty" v-if="mixinDatacomResData.length === 0">
<text>{{emptyTips}}</text>
</view>
<view v-else class="uni-select__selector-item" v-for="(item,index) in mixinDatacomResData"
:key="index" @click="change(item)">
<text :class="{'uni-select__selector__disabled': item.disable}">{{formatItemName(item)}}</text>
</view>
</scroll-view>
</view>
</view>
</view>
</template>
<script>
/**
* DataChecklist 数据选择器
* @description 通过数据渲染的下拉框组件
* @tutorial https://uniapp.dcloud.io/component/uniui/uni-data-select
* @property {String} value 默认值
* @property {Array} localdata 本地数据 格式 [{text:'',value:''}]
* @property {Boolean} clear 是否可以清空已选项
* @property {Boolean} emptyText 没有数据时显示的文字 本地数据无效
* @property {String} label 左侧标题
* @property {String} placeholder 输入框的提示文字
* @event {Function} change 选中发生变化触发
*/
export default {
name: "uni-stat-select",
mixins: [uniCloud.mixinDatacom || {}],
data() {
return {
showSelector: false,
current: '',
mixinDatacomResData: [],
apps: [],
channels: []
};
},
props: {
localdata: {
type: Array,
default () {
return []
}
},
value: {
type: [String, Number],
default: ''
},
modelValue: {
type: [String, Number],
default: ''
},
label: {
type: String,
default: ''
},
placeholder: {
type: String,
default: '...'
},
emptyTips: {
type: String,
default: '无选项'
},
clear: {
type: Boolean,
default: true
},
defItem: {
type: Number,
default: 0
}
},
created() {
this.last = `${this.collection}_last_selected_option_value`
if (this.collection && !this.localdata.length) {
this.mixinDatacomEasyGet()
}
},
computed: {
typePlaceholder() {
const text = {
'opendb-stat-app-versions': '版本',
'opendb-app-channels': '渠道',
'opendb-app-list': '应用'
}
const common = '请选择'
const placeholder = text[this.collection]
return placeholder ?
common + placeholder :
common
}
},
watch: {
localdata: {
immediate: true,
handler(val, old) {
if (Array.isArray(val)) {
this.mixinDatacomResData = val
}
}
},
// #ifndef VUE3
value() {
this.initDefVal()
},
// #endif
// #ifdef VUE3
modelValue() {
this.initDefVal()
},
// #endif
mixinDatacomResData: {
immediate: true,
handler(val) {
if (val.length) {
this.initDefVal()
}
}
}
},
methods: {
initDefVal() {
let defValue = ''
if ((this.value || this.value === 0) && !this.isDisabled(this.value)) {
defValue = this.value
} else if ((this.modelValue || this.modelValue === 0) && !this.isDisabled(this.modelValue)) {
defValue = this.modelValue
} else {
let strogeValue
if (this.collection) {
strogeValue = uni.getStorageSync(this.last)
}
if (strogeValue || strogeValue === 0) {
defValue = strogeValue
} else {
let defItem = ''
if (this.defItem > 0 && this.defItem < this.mixinDatacomResData.length) {
defItem = this.mixinDatacomResData[this.defItem - 1].value
}
defValue = defItem
}
this.emit(defValue)
}
const def = this.mixinDatacomResData.find(item => item.value === defValue)
this.current = def ? this.formatItemName(def) : ''
},
/**
* @param {[String, Number]} value
* 判断用户给的 value 是否同时为禁用状态
*/
isDisabled(value) {
let isDisabled = false;
this.mixinDatacomResData.forEach(item => {
if (item.value === value) {
isDisabled = item.disable
}
})
return isDisabled;
},
clearVal() {
this.emit('')
if (this.collection) {
uni.removeStorageSync(this.last)
}
},
change(item) {
if (!item.disable) {
this.showSelector = false
this.current = this.formatItemName(item)
this.emit(item.value)
}
},
emit(val) {
this.$emit('change', val)
this.$emit('input', val)
this.$emit('update:modelValue', val)
if (this.collection) {
uni.setStorageSync(this.last, val)
}
},
toggleSelector() {
this.showSelector = !this.showSelector
},
formatItemName(item) {
let {
text,
value,
channel_code
} = item
channel_code = channel_code ? `(${channel_code})` : ''
return this.collection.indexOf('app-list') > 0 ?
`${text}(${value})` :
(
text ?
text :
`未命名${channel_code}`
)
}
}
}
</script>
<style lang="scss">
$uni-base-color: #6a6a6a !default;
$uni-main-color: #3a3a3a !default;
$uni-secondary-color: #909399 !default;
$uni-border-3: #DCDCDC;
/* #ifndef APP-NVUE */
@media screen and (max-width: 100%) {
.hide-on-phone {
display: none;
}
}
/* #endif */
.uni-stat__select {
display: flex;
align-items: center;
cursor: pointer;
}
.uni-label-text {
font-size: 14px;
font-weight: bold;
color: $uni-base-color;
margin: auto 0;
margin-right: 5px;
}
.uni-select {
font-size: 14px;
// border: 1px solid $uni-border-3;
box-sizing: border-box;
border-radius: 1px;
padding: 0 5px;
position: relative;
/* #ifndef APP-NVUE */
display: flex;
user-select: none;
/* #endif */
flex-direction: row;
align-items: center;
// border-bottom: solid 1px $uni-border-3;
}
.uni-select__label {
font-size: 16px;
line-height: 22px;
padding-right: 10px;
color: $uni-secondary-color;
}
.uni-select__input-box {
min-height: 20px;
position: relative;
/* #ifndef APP-NVUE */
display: flex;
/* #endif */
flex: 1;
flex-direction: row;
align-items: center;
}
.uni-select__input {
flex: 1;
font-size: 14px;
height: 22px;
line-height: 22px;
}
.uni-select__input-plac {
font-size: 14px;
color: $uni-secondary-color;
}
.uni-select__selector {
/* #ifndef APP-NVUE */
box-sizing: border-box;
/* #endif */
position: absolute;
top: calc(100% + 12px);
left: 0;
width: auto;
background-color: #FFFFFF;
border: 1px solid #EBEEF5;
border-radius: 6px;
box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
z-index: 2;
padding: 4px 0;
}
.uni-select__selector-scroll {
/* #ifndef APP-NVUE */
max-height: 200px;
box-sizing: border-box;
/* #endif */
}
.uni-select__selector-empty,
.uni-select__selector-item {
/* #ifndef APP-NVUE */
display: flex;
cursor: pointer;
/* #endif */
line-height: 20px;
font-size: 14px;
text-align: center;
/* border-bottom: solid 1px $uni-border-3; */
padding: 10px 20px;
width: auto;
white-space: nowrap;
flex-wrap: nowrap;
}
.uni-select__selector-item:hover {
background-color: #f9f9f9;
}
.uni-select__selector-empty:last-child,
.uni-select__selector-item:last-child {
/* #ifndef APP-NVUE */
border-bottom: none;
/* #endif */
}
.uni-select__selector__disabled {
opacity: 0.4;
cursor: default;
}
/* picker 弹出层通用的指示小三角 */
.uni-popper__arrow,
.uni-popper__arrow::after {
position: absolute;
display: block;
width: 0;
height: 0;
border-color: transparent;
border-style: solid;
border-width: 6px;
}
.uni-popper__arrow {
filter: drop-shadow(0 2px 12px rgba(0, 0, 0, 0.03));
top: -6px;
left: 10%;
margin-right: 3px;
border-top-width: 0;
border-bottom-color: #EBEEF5;
}
.uni-popper__arrow::after {
content: " ";
top: 1px;
margin-left: -6px;
border-top-width: 0;
border-bottom-color: #fff;
}
.uni-select__input-text {
color: $uni-main-color;
white-space: nowrap;
text-overflow: ellipsis;
-o-text-overflow: ellipsis;
overflow: hidden;
width: auto;
}
.uni-select__input-placeholder {
color: $uni-base-color;
}
.uni-select--mask {
position: fixed;
top: 0;
bottom: 0;
right: 0;
left: 0;
}
</style>

View File

@ -0,0 +1,82 @@
{
"id": "rudon-rowMenuDotDotDot-left",
"displayName": "行内三点式下拉菜单-左对齐-向下展开",
"version": "1.0.0",
"description": "行内三点式下拉菜单(左对齐)",
"keywords": [
"select",
"picker",
"下拉菜单"
],
"repository": "",
"engines": {
},
"dcloudext": {
"type": "component-vue",
"sale": {
"regular": {
"price": "0.00"
},
"sourcecode": {
"price": "0.00"
}
},
"contact": {
"qq": ""
},
"declaration": {
"ads": "使用方法参考: https://ext.dcloud.net.cn/plugin?id=9350",
"data": "使用方法参考: https://ext.dcloud.net.cn/plugin?id=9350",
"permissions": "使用方法参考: https://ext.dcloud.net.cn/plugin?id=9350"
},
"npmurl": ""
},
"uni_modules": {
"dependencies": [],
"encrypt": [],
"platforms": {
"cloud": {
"tcb": "y",
"aliyun": "y"
},
"client": {
"Vue": {
"vue2": "u",
"vue3": "u"
},
"App": {
"app-vue": "u",
"app-nvue": "u"
},
"H5-mobile": {
"Safari": "u",
"Android Browser": "u",
"微信浏览器(Android)": "u",
"QQ浏览器(Android)": "u"
},
"H5-pc": {
"Chrome": "u",
"IE": "u",
"Edge": "u",
"Firefox": "u",
"Safari": "u"
},
"小程序": {
"微信": "u",
"阿里": "u",
"百度": "u",
"字节跳动": "u",
"QQ": "u",
"钉钉": "u",
"快手": "u",
"飞书": "u",
"京东": "u"
},
"快应用": {
"华为": "u",
"联盟": "u"
}
}
}
}
}

View File

@ -0,0 +1 @@
# rudon-rowMenuDotDotDot-left

View File

@ -0,0 +1,2 @@
## 1.0.02022-09-05
模仿并改进uniapp官方ui的组件uni-data-select自定义显示插槽允许变量手册https://uniapp.dcloud.net.cn/component/uniui/uni-data-select.html

View File

@ -0,0 +1,422 @@
<template>
<view class="uni-stat__select">
<!-- 组件介绍 -->
<!-- 名称rudon-rowMenuDotDotDot 行内三点式下拉菜单 -->
<!-- 作者Rudon <https://rudon.blog.csdn.net> -->
<!-- 用途点击三点 -->
<!-- 用法
0参考https://uniapp.dcloud.net.cn/component/uniui/uni-data-select.html
1项目安装本组件
2vue中直接引用即可例如下面的例子 插槽可随意修改例如...
-->
<!-- 例如:
<rudon-rowMenuDotDotDot :clear="false" :localdata="菜单对象" @change="ccc($event, item)">
...
</rudon-rowMenuDotDotDot>
-->
<span v-if="label" class="uni-label-text hide-on-phone">{{label + ''}}</span>
<view class="uni-select">
<view class="uni-select__input-box" @click="toggleSelector">
<!-- 显示插槽内容 -->
<slot></slot>
</view>
<view class="uni-select--mask" v-if="showSelector" @click="toggleSelector" />
<view class="uni-select__selector" v-if="showSelector">
<view class="uni-popper__arrow"></view>
<scroll-view scroll-y="true" class="uni-select__selector-scroll">
<view class="uni-select__selector-empty" v-if="mixinDatacomResData.length === 0">
<text>{{emptyTips}}</text>
</view>
<view v-else class="uni-select__selector-item" v-for="(item,index) in mixinDatacomResData"
:key="index" @click="change(item)">
<text :class="{'uni-select__selector__disabled': item.disable}">{{formatItemName(item)}}</text>
</view>
</scroll-view>
</view>
</view>
</view>
</template>
<script>
/**
* DataChecklist 数据选择器
* @description 通过数据渲染的下拉框组件
* @tutorial https://uniapp.dcloud.io/component/uniui/uni-data-select
* @property {String} value 默认值
* @property {Array} localdata 本地数据 格式 [{text:'',value:''}]
* @property {Boolean} clear 是否可以清空已选项
* @property {Boolean} emptyText 没有数据时显示的文字 本地数据无效
* @property {String} label 左侧标题
* @property {String} placeholder 输入框的提示文字
* @event {Function} change 选中发生变化触发
*/
export default {
name: "uni-stat-select",
mixins: [uniCloud.mixinDatacom || {}],
data() {
return {
showSelector: false,
current: '',
mixinDatacomResData: [],
apps: [],
channels: []
};
},
props: {
localdata: {
type: Array,
default () {
return []
}
},
value: {
type: [String, Number],
default: ''
},
modelValue: {
type: [String, Number],
default: ''
},
label: {
type: String,
default: ''
},
placeholder: {
type: String,
default: '...'
},
emptyTips: {
type: String,
default: '无选项'
},
clear: {
type: Boolean,
default: true
},
defItem: {
type: Number,
default: 0
}
},
created() {
this.last = `${this.collection}_last_selected_option_value`
if (this.collection && !this.localdata.length) {
this.mixinDatacomEasyGet()
}
},
computed: {
typePlaceholder() {
const text = {
'opendb-stat-app-versions': '版本',
'opendb-app-channels': '渠道',
'opendb-app-list': '应用'
}
const common = '请选择'
const placeholder = text[this.collection]
return placeholder ?
common + placeholder :
common
}
},
watch: {
localdata: {
immediate: true,
handler(val, old) {
if (Array.isArray(val)) {
this.mixinDatacomResData = val
}
}
},
// #ifndef VUE3
value() {
this.initDefVal()
},
// #endif
// #ifdef VUE3
modelValue() {
this.initDefVal()
},
// #endif
mixinDatacomResData: {
immediate: true,
handler(val) {
if (val.length) {
this.initDefVal()
}
}
}
},
methods: {
initDefVal() {
let defValue = ''
if ((this.value || this.value === 0) && !this.isDisabled(this.value)) {
defValue = this.value
} else if ((this.modelValue || this.modelValue === 0) && !this.isDisabled(this.modelValue)) {
defValue = this.modelValue
} else {
let strogeValue
if (this.collection) {
strogeValue = uni.getStorageSync(this.last)
}
if (strogeValue || strogeValue === 0) {
defValue = strogeValue
} else {
let defItem = ''
if (this.defItem > 0 && this.defItem < this.mixinDatacomResData.length) {
defItem = this.mixinDatacomResData[this.defItem - 1].value
}
defValue = defItem
}
this.emit(defValue)
}
const def = this.mixinDatacomResData.find(item => item.value === defValue)
this.current = def ? this.formatItemName(def) : ''
},
/**
* @param {[String, Number]} value
* 判断用户给的 value 是否同时为禁用状态
*/
isDisabled(value) {
let isDisabled = false;
this.mixinDatacomResData.forEach(item => {
if (item.value === value) {
isDisabled = item.disable
}
})
return isDisabled;
},
clearVal() {
this.emit('')
if (this.collection) {
uni.removeStorageSync(this.last)
}
},
change(item) {
if (!item.disable) {
this.showSelector = false
this.current = this.formatItemName(item)
this.emit(item.value)
}
},
emit(val) {
this.$emit('change', val)
this.$emit('input', val)
this.$emit('update:modelValue', val)
if (this.collection) {
uni.setStorageSync(this.last, val)
}
},
toggleSelector() {
this.showSelector = !this.showSelector
},
formatItemName(item) {
let {
text,
value,
channel_code
} = item
channel_code = channel_code ? `(${channel_code})` : ''
return this.collection.indexOf('app-list') > 0 ?
`${text}(${value})` :
(
text ?
text :
`未命名${channel_code}`
)
}
}
}
</script>
<style lang="scss">
$uni-base-color: #6a6a6a !default;
$uni-main-color: #3a3a3a !default;
$uni-secondary-color: #909399 !default;
$uni-border-3: #DCDCDC;
/* #ifndef APP-NVUE */
@media screen and (max-width: 100%) {
.hide-on-phone {
display: none;
}
}
/* #endif */
.uni-stat__select {
display: flex;
align-items: center;
cursor: pointer;
}
.uni-label-text {
font-size: 14px;
font-weight: bold;
color: $uni-base-color;
margin: auto 0;
margin-right: 5px;
}
.uni-select {
font-size: 14px;
// border: 1px solid $uni-border-3;
box-sizing: border-box;
border-radius: 1px;
padding: 0 5px;
position: relative;
/* #ifndef APP-NVUE */
display: flex;
user-select: none;
/* #endif */
flex-direction: row;
align-items: center;
// border-bottom: solid 1px $uni-border-3;
}
.uni-select__label {
font-size: 16px;
line-height: 22px;
padding-right: 10px;
color: $uni-secondary-color;
}
.uni-select__input-box {
min-height: 20px;
position: relative;
/* #ifndef APP-NVUE */
display: flex;
/* #endif */
flex: 1;
flex-direction: row;
align-items: center;
}
.uni-select__input {
flex: 1;
font-size: 14px;
height: 22px;
line-height: 22px;
}
.uni-select__input-plac {
font-size: 14px;
color: $uni-secondary-color;
}
.uni-select__selector {
/* #ifndef APP-NVUE */
box-sizing: border-box;
/* #endif */
position: absolute;
top: calc(100% + 12px);
right: 0;
width: auto;
background-color: #FFFFFF;
border: 1px solid #EBEEF5;
border-radius: 6px;
box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
z-index: 2;
padding: 4px 0;
}
.uni-select__selector-scroll {
/* #ifndef APP-NVUE */
max-height: 200px;
box-sizing: border-box;
/* #endif */
}
.uni-select__selector-empty,
.uni-select__selector-item {
/* #ifndef APP-NVUE */
display: flex;
cursor: pointer;
/* #endif */
line-height: 20px;
font-size: 14px;
text-align: center;
/* border-bottom: solid 1px $uni-border-3; */
padding: 10px 20px;
width: auto;
white-space: nowrap;
flex-wrap: nowrap;
}
.uni-select__selector-item:hover {
background-color: #f9f9f9;
}
.uni-select__selector-empty:last-child,
.uni-select__selector-item:last-child {
/* #ifndef APP-NVUE */
border-bottom: none;
/* #endif */
}
.uni-select__selector__disabled {
opacity: 0.4;
cursor: default;
}
/* picker 弹出层通用的指示小三角 */
.uni-popper__arrow,
.uni-popper__arrow::after {
position: absolute;
display: block;
width: 0;
height: 0;
border-color: transparent;
border-style: solid;
border-width: 6px;
}
.uni-popper__arrow {
filter: drop-shadow(0 2px 12px rgba(0, 0, 0, 0.03));
top: -6px;
right: 10%;
margin-right: 3px;
border-top-width: 0;
border-bottom-color: #EBEEF5;
}
.uni-popper__arrow::after {
content: " ";
top: 1px;
margin-left: -6px;
border-top-width: 0;
border-bottom-color: #fff;
}
.uni-select__input-text {
color: $uni-main-color;
white-space: nowrap;
text-overflow: ellipsis;
-o-text-overflow: ellipsis;
overflow: hidden;
width: auto;
}
.uni-select__input-placeholder {
color: $uni-base-color;
}
.uni-select--mask {
position: fixed;
top: 0;
bottom: 0;
right: 0;
left: 0;
}
</style>

View File

@ -0,0 +1,82 @@
{
"id": "rudon-rowMenuDotDotDot",
"displayName": "行内三点式下拉菜单-右对齐-向下展开",
"version": "1.0.0",
"description": "行内三点式下拉菜单",
"keywords": [
"select",
"picker",
"下拉菜单"
],
"repository": "",
"engines": {
},
"dcloudext": {
"type": "component-vue",
"sale": {
"regular": {
"price": "0.00"
},
"sourcecode": {
"price": "0.00"
}
},
"contact": {
"qq": ""
},
"declaration": {
"ads": "【相关插件】\r\n行内三点式下拉菜单-左对齐-向下展开 https://ext.dcloud.net.cn/plugin?id=9651\r\n行内三点式下拉菜单-左对齐-向上展开 https://ext.dcloud.net.cn/plugin?id=9652\r\n行内三点式下拉菜单-右对齐-向下展开 https://ext.dcloud.net.cn/plugin?id=9350",
"data": "【相关插件】\r\n行内三点式下拉菜单-左对齐-向下展开 https://ext.dcloud.net.cn/plugin?id=9651\r\n行内三点式下拉菜单-左对齐-向上展开 https://ext.dcloud.net.cn/plugin?id=9652\r\n行内三点式下拉菜单-右对齐-向下展开 https://ext.dcloud.net.cn/plugin?id=9350",
"permissions": "【相关插件】\r\n行内三点式下拉菜单-左对齐-向下展开 https://ext.dcloud.net.cn/plugin?id=9651\r\n行内三点式下拉菜单-左对齐-向上展开 https://ext.dcloud.net.cn/plugin?id=9652\r\n行内三点式下拉菜单-右对齐-向下展开 https://ext.dcloud.net.cn/plugin?id=9350"
},
"npmurl": ""
},
"uni_modules": {
"dependencies": [],
"encrypt": [],
"platforms": {
"cloud": {
"tcb": "y",
"aliyun": "y"
},
"client": {
"Vue": {
"vue2": "y",
"vue3": "y"
},
"App": {
"app-vue": "y",
"app-nvue": "y"
},
"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",
"钉钉": "y",
"快手": "y",
"飞书": "y",
"京东": "y"
},
"快应用": {
"华为": "y",
"联盟": "y"
}
}
}
}
}

View File

@ -0,0 +1 @@
# rudon-rowMenuDotDotDot

View File

@ -0,0 +1,35 @@
## 1.0.62023-04-12
- 修复 微信小程序点击时会改变背景颜色的 bug
## 1.0.52023-02-03
- 修复 禁用时会显示清空按钮
## 1.0.42023-02-02
- 优化 查询条件短期内多次变更只查询最后一次变更后的结果
- 调整 内部缓存键名调整为 uni-data-select-lastSelectedValue
## 1.0.32023-01-16
- 修复 不关联服务空间报错的问题
## 1.0.22023-01-14
- 新增 属性 `format` 可用于格式化显示选项内容
## 1.0.12022-12-06
- 修复 当where变化时数据不会自动更新的问题
## 0.1.92022-09-05
- 修复 微信小程序下拉框出现后选择会点击到蒙板后面的输入框
## 0.1.82022-08-29
- 修复 点击的位置不准确
## 0.1.72022-08-12
- 新增 支持 disabled 属性
## 0.1.62022-07-06
- 修复 pc端宽度异常的bug
## 0.1.5
- 修复 pc端宽度异常的bug
## 0.1.42022-07-05
- 优化 显示样式
## 0.1.32022-06-02
- 修复 localdata 赋值不生效的 bug
- 新增 支持 uni.scss 修改颜色
- 新增 支持选项禁用(数据选项设置 disabled: true 即禁用)
## 0.1.22022-05-08
- 修复 当 value 为 0 时选择不生效的 bug
## 0.1.12022-05-07
- 新增 记住上次的选项(仅 collection 存在时有效)
## 0.1.02022-04-22
- 初始化

View File

@ -0,0 +1,517 @@
<template>
<view class="uni-stat__select">
<span v-if="label" class="uni-label-text hide-on-phone">{{label + ''}}</span>
<view class="uni-stat-box" :class="{'uni-stat__actived': current}">
<view class="uni-select" :class="{'uni-select--disabled':disabled}">
<view class="uni-select__input-box" @click="toggleSelector">
<view v-if="current" class="uni-select__input-text">{{current}}</view>
<view v-else class="uni-select__input-text uni-select__input-placeholder">{{typePlaceholder}}</view>
<view v-if="current && clear && !disabled" @click.stop="clearVal" >
<uni-icons type="clear" color="#c0c4cc" size="24"/>
</view>
<view v-else>
<uni-icons :type="showSelector? 'top' : 'bottom'" size="14" color="#999" />
</view>
</view>
<view class="uni-select--mask" v-if="showSelector" @click="toggleSelector" />
<view class="uni-select__selector" v-if="showSelector">
<view class="uni-popper__arrow"></view>
<scroll-view scroll-y="true" class="uni-select__selector-scroll">
<view class="uni-select__selector-empty" v-if="mixinDatacomResData.length === 0">
<text>{{emptyTips}}</text>
</view>
<view v-else class="uni-select__selector-item" v-for="(item,index) in mixinDatacomResData" :key="index"
@click="change(item)">
<text :class="{'uni-select__selector__disabled': item.disable}">{{formatItemName(item)}}</text>
</view>
</scroll-view>
</view>
</view>
</view>
</view>
</template>
<script>
/**
* DataChecklist 数据选择器
* @description 通过数据渲染的下拉框组件
* @tutorial https://uniapp.dcloud.io/component/uniui/uni-data-select
* @property {String} value 默认值
* @property {Array} localdata 本地数据 格式 [{text:'',value:''}]
* @property {Boolean} clear 是否可以清空已选项
* @property {Boolean} emptyText 没有数据时显示的文字 本地数据无效
* @property {String} label 左侧标题
* @property {String} placeholder 输入框的提示文字
* @property {Boolean} disabled 是否禁用
* @event {Function} change 选中发生变化触发
*/
export default {
name: "uni-data-select",
mixins: [uniCloud.mixinDatacom || {}],
props: {
localdata: {
type: Array,
default () {
return []
}
},
value: {
type: [String, Number],
default: ''
},
modelValue: {
type: [String, Number],
default: ''
},
label: {
type: String,
default: ''
},
placeholder: {
type: String,
default: '请选择'
},
emptyTips: {
type: String,
default: '无选项'
},
clear: {
type: Boolean,
default: true
},
defItem: {
type: Number,
default: 0
},
disabled: {
type: Boolean,
default: false
},
// field="_id as value, version as text, uni_platform as label" format="{label} - {text}"
format: {
type: String,
default: ''
},
},
data() {
return {
showSelector: false,
current: '',
mixinDatacomResData: [],
apps: [],
channels: [],
cacheKey: "uni-data-select-lastSelectedValue",
};
},
created() {
this.debounceGet = this.debounce(() => {
this.query();
}, 300);
if (this.collection && !this.localdata.length) {
this.debounceGet();
}
},
computed: {
typePlaceholder() {
const text = {
'opendb-stat-app-versions': '版本',
'opendb-app-channels': '渠道',
'opendb-app-list': '应用'
}
const common = this.placeholder
const placeholder = text[this.collection]
return placeholder ?
common + placeholder :
common
},
valueCom(){
// #ifdef VUE3
return this.modelValue;
// #endif
// #ifndef VUE3
return this.value;
// #endif
}
},
watch: {
localdata: {
immediate: true,
handler(val, old) {
if (Array.isArray(val) && old !== val) {
this.mixinDatacomResData = val
}
}
},
valueCom(val, old) {
this.initDefVal()
},
mixinDatacomResData: {
immediate: true,
handler(val) {
if (val.length) {
this.initDefVal()
}
}
}
},
methods: {
debounce(fn, time = 100){
let timer = null
return function(...args) {
if (timer) clearTimeout(timer)
timer = setTimeout(() => {
fn.apply(this, args)
}, time)
}
},
//
query(){
this.mixinDatacomEasyGet();
},
//
onMixinDatacomPropsChange(){
if (this.collection) {
this.debounceGet();
}
},
initDefVal() {
let defValue = ''
if ((this.valueCom || this.valueCom === 0) && !this.isDisabled(this.valueCom)) {
defValue = this.valueCom
} else {
let strogeValue
if (this.collection) {
strogeValue = this.getCache()
}
if (strogeValue || strogeValue === 0) {
defValue = strogeValue
} else {
let defItem = ''
if (this.defItem > 0 && this.defItem <= this.mixinDatacomResData.length) {
defItem = this.mixinDatacomResData[this.defItem - 1].value
}
defValue = defItem
}
if (defValue || defValue === 0) {
this.emit(defValue)
}
}
const def = this.mixinDatacomResData.find(item => item.value === defValue)
this.current = def ? this.formatItemName(def) : ''
},
/**
* @param {[String, Number]} value
* 判断用户给的 value 是否同时为禁用状态
*/
isDisabled(value) {
let isDisabled = false;
this.mixinDatacomResData.forEach(item => {
if (item.value === value) {
isDisabled = item.disable
}
})
return isDisabled;
},
clearVal() {
this.emit('')
if (this.collection) {
this.removeCache()
}
},
change(item) {
if (!item.disable) {
this.showSelector = false
this.current = this.formatItemName(item)
this.emit(item.value)
}
},
emit(val) {
this.$emit('input', val)
this.$emit('update:modelValue', val)
this.$emit('change', val)
if (this.collection) {
this.setCache(val);
}
},
toggleSelector() {
if (this.disabled) {
return
}
this.showSelector = !this.showSelector
},
formatItemName(item) {
let {
text,
value,
channel_code
} = item
channel_code = channel_code ? `(${channel_code})` : ''
if (this.format) {
//
let str = "";
str = this.format;
for (let key in item) {
str = str.replace(new RegExp(`{${key}}`,"g"),item[key]);
}
return str;
} else {
return this.collection.indexOf('app-list') > 0 ?
`${text}(${value})` :
(
text ?
text :
`未命名${channel_code}`
)
}
},
//
getLoadData(){
return this.mixinDatacomResData;
},
// key
getCurrentCacheKey(){
return this.collection;
},
//
getCache(name=this.getCurrentCacheKey()){
let cacheData = uni.getStorageSync(this.cacheKey) || {};
return cacheData[name];
},
//
setCache(value, name=this.getCurrentCacheKey()){
let cacheData = uni.getStorageSync(this.cacheKey) || {};
cacheData[name] = value;
uni.setStorageSync(this.cacheKey, cacheData);
},
//
removeCache(name=this.getCurrentCacheKey()){
let cacheData = uni.getStorageSync(this.cacheKey) || {};
delete cacheData[name];
uni.setStorageSync(this.cacheKey, cacheData);
},
}
}
</script>
<style lang="scss">
$uni-base-color: #6a6a6a !default;
$uni-main-color: #333 !default;
$uni-secondary-color: #909399 !default;
$uni-border-3: #e5e5e5;
/* #ifndef APP-NVUE */
@media screen and (max-width: 500px) {
.hide-on-phone {
display: none;
}
}
/* #endif */
.uni-stat__select {
display: flex;
align-items: center;
// padding: 15px;
/* #ifdef H5 */
cursor: pointer;
/* #endif */
width: 100%;
flex: 1;
box-sizing: border-box;
}
.uni-stat-box {
width: 100%;
flex: 1;
}
.uni-stat__actived {
width: 100%;
flex: 1;
// outline: 1px solid #2979ff;
}
.uni-label-text {
font-size: 14px;
font-weight: bold;
color: $uni-base-color;
margin: auto 0;
margin-right: 5px;
}
.uni-select {
font-size: 14px;
border: 1px solid $uni-border-3;
box-sizing: border-box;
border-radius: 4px;
padding: 0 5px;
padding-left: 10px;
position: relative;
/* #ifndef APP-NVUE */
display: flex;
user-select: none;
/* #endif */
flex-direction: row;
align-items: center;
border-bottom: solid 1px $uni-border-3;
width: 100%;
flex: 1;
height: 35px;
&--disabled {
background-color: #f5f7fa;
cursor: not-allowed;
}
}
.uni-select__label {
font-size: 16px;
// line-height: 22px;
height: 35px;
padding-right: 10px;
color: $uni-secondary-color;
}
.uni-select__input-box {
height: 35px;
position: relative;
/* #ifndef APP-NVUE */
display: flex;
/* #endif */
flex: 1;
flex-direction: row;
align-items: center;
}
.uni-select__input {
flex: 1;
font-size: 14px;
height: 22px;
line-height: 22px;
}
.uni-select__input-plac {
font-size: 14px;
color: $uni-secondary-color;
}
.uni-select__selector {
/* #ifndef APP-NVUE */
box-sizing: border-box;
/* #endif */
position: absolute;
top: calc(100% + 12px);
left: 0;
width: 100%;
background-color: #FFFFFF;
border: 1px solid #EBEEF5;
border-radius: 6px;
box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
z-index: 3;
padding: 4px 0;
}
.uni-select__selector-scroll {
/* #ifndef APP-NVUE */
max-height: 200px;
box-sizing: border-box;
/* #endif */
}
/* #ifdef H5 */
@media (min-width: 768px) {
.uni-select__selector-scroll {
max-height: 600px;
}
}
/* #endif */
.uni-select__selector-empty,
.uni-select__selector-item {
/* #ifndef APP-NVUE */
display: flex;
cursor: pointer;
/* #endif */
line-height: 35px;
font-size: 14px;
text-align: center;
/* border-bottom: solid 1px $uni-border-3; */
padding: 0px 10px;
}
.uni-select__selector-item:hover {
background-color: #f9f9f9;
}
.uni-select__selector-empty:last-child,
.uni-select__selector-item:last-child {
/* #ifndef APP-NVUE */
border-bottom: none;
/* #endif */
}
.uni-select__selector__disabled {
opacity: 0.4;
cursor: default;
}
/* picker 弹出层通用的指示小三角 */
.uni-popper__arrow,
.uni-popper__arrow::after {
position: absolute;
display: block;
width: 0;
height: 0;
border-color: transparent;
border-style: solid;
border-width: 6px;
}
.uni-popper__arrow {
filter: drop-shadow(0 2px 12px rgba(0, 0, 0, 0.03));
top: -6px;
left: 10%;
margin-right: 3px;
border-top-width: 0;
border-bottom-color: #EBEEF5;
}
.uni-popper__arrow::after {
content: " ";
top: 1px;
margin-left: -6px;
border-top-width: 0;
border-bottom-color: #fff;
}
.uni-select__input-text {
// width: 280px;
width: 100%;
color: $uni-main-color;
white-space: nowrap;
text-overflow: ellipsis;
-o-text-overflow: ellipsis;
overflow: hidden;
}
.uni-select__input-placeholder {
color: $uni-base-color;
font-size: 12px;
}
.uni-select--mask {
position: fixed;
top: 0;
bottom: 0;
right: 0;
left: 0;
z-index: 2;
}
</style>

View File

@ -0,0 +1,85 @@
{
"id": "uni-data-select",
"displayName": "uni-data-select 下拉框选择器",
"version": "1.0.6",
"description": "通过数据驱动的下拉框选择器",
"keywords": [
"uni-ui",
"select",
"uni-data-select",
"下拉框",
"下拉选"
],
"repository": "https://github.com/dcloudio/uni-ui",
"engines": {
"HBuilderX": "^3.1.1"
},
"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-load-more"],
"encrypt": [],
"platforms": {
"cloud": {
"tcb": "y",
"aliyun": "y"
},
"client": {
"App": {
"app-vue": "u",
"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",
"阿里": "u",
"百度": "u",
"字节跳动": "u",
"QQ": "u",
"京东": "u"
},
"快应用": {
"华为": "u",
"联盟": "u"
},
"Vue": {
"vue2": "y",
"vue3": "y"
}
}
}
}
}

View File

@ -0,0 +1,8 @@
## DataSelect 下拉框选择器
> **组件名uni-data-select**
> 代码块: `uDataSelect`
当选项过多时,使用下拉菜单展示并选择内容
### [查看文档](https://uniapp.dcloud.io/component/uniui/uni-data-select)
#### 如使用过程中有任何问题或者您对uni-ui有一些好的建议欢迎加入 uni-ui 交流群871950839