uview 更新
parent
b71fff7e00
commit
19dd57f4dd
|
@ -1,6 +1,6 @@
|
|||
import request from '@/utils/request'
|
||||
|
||||
// 使用租户名,获得租户编号
|
||||
// 使用店铺名,获得店铺编号
|
||||
export function getTenantIdByName(name) {
|
||||
return request({
|
||||
url: '/system/tenant/get-id-by-name',
|
||||
|
@ -11,7 +11,7 @@ export function getTenantIdByName(name) {
|
|||
})
|
||||
}
|
||||
|
||||
// 创建租户
|
||||
// 创建店铺
|
||||
export function createTenant(data) {
|
||||
return request({
|
||||
url: '/system/tenant/create',
|
||||
|
@ -20,7 +20,7 @@ export function createTenant(data) {
|
|||
})
|
||||
}
|
||||
|
||||
// 更新租户
|
||||
// 更新店铺
|
||||
export function updateTenant(data) {
|
||||
return request({
|
||||
url: '/system/tenant/update',
|
||||
|
@ -29,7 +29,7 @@ export function updateTenant(data) {
|
|||
})
|
||||
}
|
||||
|
||||
// 删除租户
|
||||
// 删除店铺
|
||||
export function deleteTenant(id) {
|
||||
return request({
|
||||
url: '/system/tenant/delete?id=' + id,
|
||||
|
@ -37,7 +37,7 @@ export function deleteTenant(id) {
|
|||
})
|
||||
}
|
||||
|
||||
// 获得租户
|
||||
// 获得店铺
|
||||
export function getTenant(id) {
|
||||
return request({
|
||||
url: '/system/tenant/get?id=' + id,
|
||||
|
@ -45,7 +45,7 @@ export function getTenant(id) {
|
|||
})
|
||||
}
|
||||
|
||||
// 获得租户分页
|
||||
// 获得店铺分页
|
||||
export function getTenantPage(query) {
|
||||
return request({
|
||||
url: '/system/tenant/page',
|
||||
|
@ -54,7 +54,7 @@ export function getTenantPage(query) {
|
|||
})
|
||||
}
|
||||
|
||||
// 导出租户 Excel
|
||||
// 导出店铺 Excel
|
||||
export function exportTenantExcel(query) {
|
||||
return request({
|
||||
url: '/system/tenant/export-excel',
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import request from '@/utils/request'
|
||||
|
||||
// 创建租户套餐
|
||||
// 创建店铺套餐
|
||||
export function createTenantPackage(data) {
|
||||
return request({
|
||||
url: '/system/tenant-package/create',
|
||||
|
@ -9,7 +9,7 @@ export function createTenantPackage(data) {
|
|||
})
|
||||
}
|
||||
|
||||
// 更新租户套餐
|
||||
// 更新店铺套餐
|
||||
export function updateTenantPackage(data) {
|
||||
return request({
|
||||
url: '/system/tenant-package/update',
|
||||
|
@ -18,7 +18,7 @@ export function updateTenantPackage(data) {
|
|||
})
|
||||
}
|
||||
|
||||
// 删除租户套餐
|
||||
// 删除店铺套餐
|
||||
export function deleteTenantPackage(id) {
|
||||
return request({
|
||||
url: '/system/tenant-package/delete?id=' + id,
|
||||
|
@ -26,7 +26,7 @@ export function deleteTenantPackage(id) {
|
|||
})
|
||||
}
|
||||
|
||||
// 获得租户套餐
|
||||
// 获得店铺套餐
|
||||
export function getTenantPackage(id) {
|
||||
return request({
|
||||
url: '/system/tenant-package/get?id=' + id,
|
||||
|
@ -34,7 +34,7 @@ export function getTenantPackage(id) {
|
|||
})
|
||||
}
|
||||
|
||||
// 获得租户套餐分页
|
||||
// 获得店铺套餐分页
|
||||
export function getTenantPackagePage(query) {
|
||||
return request({
|
||||
url: '/system/tenant-package/page',
|
||||
|
@ -43,7 +43,7 @@ export function getTenantPackagePage(query) {
|
|||
})
|
||||
}
|
||||
|
||||
// 获取租户套餐精简信息列表
|
||||
// 获取店铺套餐精简信息列表
|
||||
export function getTenantPackageList() {
|
||||
return request({
|
||||
url: '/system/tenant-package/get-simple-list',
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<template>
|
||||
<div>
|
||||
<el-form ref="editPram" :model="editPram" label-width="130px">
|
||||
<el-form ref="editPram" :model="editPram" label-width="160px">
|
||||
<el-form-item
|
||||
label="分类名称"
|
||||
prop="name"
|
||||
|
|
|
@ -66,7 +66,7 @@ export function removeRememberMe() {
|
|||
localStorage.removeItem(RememberMeKey)
|
||||
}
|
||||
|
||||
// ========== 租户相关 ==========
|
||||
// ========== 店铺相关 ==========
|
||||
|
||||
const TenantIdKey = 'TENANT_ID'
|
||||
const TenantNameKey = 'TENANT_NAME'
|
||||
|
|
|
@ -37,7 +37,7 @@ service.interceptors.request.use(config => {
|
|||
if (getAccessToken() && !isToken) {
|
||||
config.headers['Authorization'] = 'Bearer ' + getAccessToken() // 让每个请求携带自定义token 请根据实际情况自行修改
|
||||
}
|
||||
// 设置租户
|
||||
// 设置店铺
|
||||
if (getTenantEnable()) {
|
||||
const tenantId = getTenantId();
|
||||
if (tenantId) {
|
||||
|
|
|
@ -174,7 +174,7 @@ export function getNowDateTime(timeStr) {
|
|||
}
|
||||
|
||||
/**
|
||||
* 获得租户功能是否开启
|
||||
* 获得店铺功能是否开启
|
||||
*/
|
||||
export function getTenantEnable() {
|
||||
// console.log("enable: " + process.env.VUE_APP_TENANT_ENABLE)
|
||||
|
|
|
@ -469,7 +469,8 @@ export default {
|
|||
}
|
||||
if (this.ruleForm.noDelivery) {
|
||||
param.shippingTemplatesNoDeliveryRespVOS = this.ruleForm.shippingTemplatesNoDeliveryRespVOS.map(a => {
|
||||
return a.slice(0, 2).join(',')
|
||||
console.log(a)
|
||||
return a.slice(1, 3).join(',')
|
||||
}).join(',')
|
||||
}
|
||||
if (this.type === 0) {
|
||||
|
|
|
@ -70,8 +70,8 @@
|
|||
label="操作"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<el-button type="text" size="small" @click="bindEdit(scope.row)" v-hasPermi="['admin:shipping:templates:info']">修改</el-button>
|
||||
<el-button type="text" size="small" @click="bindDelete(scope.row)" v-hasPermi="['admin:shipping:templates:delete']">删除</el-button>
|
||||
<el-button type="text" size="small" @click="bindEdit(scope.row)" v-hasPermi="['deliverGoods:freightSet:update']">修改</el-button>
|
||||
<el-button type="text" size="small" @click="bindDelete(scope.row)" v-hasPermi="['deliverGoods:freightSet:delete']">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
|
|
@ -23,7 +23,7 @@
|
|||
<div>
|
||||
<el-form ref="loginForm" :model="loginForm" :rules="LoginRules" class="login-form">
|
||||
<el-form-item prop="tenantName" v-if="tenantEnable">
|
||||
<el-input v-model="loginForm.tenantName" type="text" auto-complete="off" placeholder='租户'>
|
||||
<el-input v-model="loginForm.tenantName" type="text" auto-complete="off" placeholder='店铺'>
|
||||
<svg-icon slot="prefix" icon-class="tree" class="el-input__icon input-icon"/>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
|
@ -162,18 +162,18 @@ export default {
|
|||
}
|
||||
],
|
||||
tenantName: [
|
||||
{required: true, trigger: "blur", message: "租户不能为空"},
|
||||
{required: true, trigger: "blur", message: "店铺不能为空"},
|
||||
{
|
||||
validator: (rule, value, callback) => {
|
||||
// debugger
|
||||
getTenantIdByName(value).then(res => {
|
||||
const tenantId = res.data;
|
||||
if (tenantId && tenantId >= 0) {
|
||||
// 设置租户
|
||||
// 设置店铺
|
||||
setTenantId(tenantId)
|
||||
callback();
|
||||
} else {
|
||||
callback('租户不存在');
|
||||
callback('店铺不存在');
|
||||
}
|
||||
});
|
||||
},
|
||||
|
@ -188,10 +188,10 @@ export default {
|
|||
};
|
||||
},
|
||||
created() {
|
||||
// 租户开关
|
||||
// 店铺开关
|
||||
this.tenantEnable = getTenantEnable();
|
||||
if (this.tenantEnable) {
|
||||
getTenantIdByName(this.loginForm.tenantName).then(res => { // 设置租户
|
||||
getTenantIdByName(this.loginForm.tenantName).then(res => { // 设置店铺
|
||||
const tenantId = res.data;
|
||||
if (tenantId && tenantId >= 0) {
|
||||
setTenantId(tenantId)
|
||||
|
@ -262,7 +262,7 @@ export default {
|
|||
this.loading = true;
|
||||
let tenant = false;
|
||||
if (this.tenantEnable) {
|
||||
await this.$prompt('请输入租户名称', "提示", {
|
||||
await this.$prompt('请输入店铺名称', "提示", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消"
|
||||
}).then(async ({value}) => {
|
||||
|
|
|
@ -0,0 +1,720 @@
|
|||
<template>
|
||||
<div class="divBox relative">
|
||||
<el-card class="box-card">
|
||||
<div class="clearfix">
|
||||
<div class="container">
|
||||
<el-form size="small" label-width="100px">
|
||||
<el-form-item label="订单状态:" v-if="checkPermi(['trade:order:type'])">
|
||||
<el-radio-group v-model="tableFrom.status" type="button" @change="seachList">
|
||||
<el-radio-button label="all">全部 {{ '(' +orderChartType.all?orderChartType.all:0 + ')' }}</el-radio-button>
|
||||
<el-radio-button label="unPaid">未支付 {{ '(' +orderChartType.unPaid?orderChartType.unPaid:0+ ')' }}</el-radio-button>
|
||||
<el-radio-button label="notShipped">未发货 {{ '(' +orderChartType.notShipped?orderChartType.notShipped:0+ ')' }}</el-radio-button>
|
||||
<el-radio-button label="spike">待收货 {{ '(' +orderChartType.spike?orderChartType.spike:0+ ')' }}</el-radio-button>
|
||||
<el-radio-button label="bargain">待评价 {{ '(' +orderChartType.bargain?orderChartType.bargain:0+ ')' }}</el-radio-button>
|
||||
<el-radio-button label="complete">交易完成 {{ '(' +orderChartType.complete?orderChartType.complete:0+ ')' }}</el-radio-button>
|
||||
<el-radio-button label="toBeWrittenOff">待核销 {{ '(' +orderChartType.toBeWrittenOff?orderChartType.toBeWrittenOff:0+ ')' }}</el-radio-button>
|
||||
<el-radio-button label="refunding">退款中 {{ '(' +orderChartType.refunding?orderChartType.refunding:0+ ')' }}</el-radio-button>
|
||||
<el-radio-button label="refunded">已退款 {{ '(' +orderChartType.refunded?orderChartType.refunded:0+ ')' }}</el-radio-button>
|
||||
<el-radio-button label="deleted">已删除 {{ '(' +orderChartType.deleted?orderChartType.deleted:0+ ')' }}</el-radio-button>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="时间选择:" class="width100">
|
||||
<el-radio-group v-model="tableFrom.dateLimit" type="button" class="mr20" size="small" @change="selectChange(tableFrom.dateLimit)">
|
||||
<el-radio-button v-for="(item,i) in fromList.fromTxt" :key="i" :label="item.val">{{ item.text }}</el-radio-button>
|
||||
</el-radio-group>
|
||||
<el-date-picker v-model="timeVal" value-format="yyyy-MM-dd" format="yyyy-MM-dd" size="small" type="daterange" placement="bottom-end" placeholder="自定义时间" style="width: 220px;" @change="onchangeTime" />
|
||||
</el-form-item>
|
||||
<!-- <el-form-item label="订单类型:" class="width100">
|
||||
<el-select v-model="tableFrom.type" clearable placeholder="请选择" class="selWidth" @change="seachList">
|
||||
<el-option
|
||||
v-for="item in options"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item> -->
|
||||
<el-form-item label="订单编号:" class="width100">
|
||||
<el-input v-model="tableFrom.orderNo" placeholder="请输入订单编号" class="selWidth" size="small" clearable>
|
||||
<el-button slot="append" icon="el-icon-search" size="small" @click="seachList" />
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="商品名称:" class="width100">
|
||||
<el-input v-model="tableFrom.orderNo" placeholder="请输入商品名称" class="selWidth" size="small" clearable>
|
||||
<el-button slot="append" icon="el-icon-search" size="small" @click="seachList" />
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="商品编号:" class="width100">
|
||||
<el-input v-model="tableFrom.orderNo" placeholder="请输入商品编号" class="selWidth" size="small" clearable>
|
||||
<el-button slot="append" icon="el-icon-search" size="small" @click="seachList" />
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="订单编号:" class="width100">
|
||||
<el-input v-model="tableFrom.orderNo" placeholder="请输入订单编号" class="selWidth" size="small" clearable>
|
||||
<el-button slot="append" icon="el-icon-search" size="small" @click="seachList" />
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="收货人:" class="width100">
|
||||
<el-input v-model="tableFrom.orderNo" placeholder="请输入收货人" class="selWidth" size="small" clearable>
|
||||
<el-button slot="append" icon="el-icon-search" size="small" @click="seachList" />
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="收货电话:" class="width100">
|
||||
<el-input v-model="tableFrom.orderNo" placeholder="请输入收货电话" class="selWidth" size="small" clearable>
|
||||
<el-button slot="append" icon="el-icon-search" size="small" @click="seachList" />
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
<el-form-item class="width100">
|
||||
<el-button size="small" @click="exports" v-hasPermi="['admin:export:excel:order']">导出</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
</div>
|
||||
</el-card>
|
||||
<div class="mt20">
|
||||
<!-- <cards-data :cardLists="cardLists" v-if="checkPermi(['admin:order:list:data'])"></cards-data> -->
|
||||
</div>
|
||||
<el-card class="box-card">
|
||||
<el-table
|
||||
v-loading="listLoading"
|
||||
:data="tableData.data"
|
||||
size="mini"
|
||||
class="table"
|
||||
highlight-current-row
|
||||
:header-cell-style=" {fontWeight:'bold'}"
|
||||
:row-key="(row)=>{ return row.orderId}"
|
||||
>
|
||||
<!-- @selection-change="handleSelectionChange" -->
|
||||
<!-- <el-table-column
|
||||
type="selection"
|
||||
:reserve-selection="true"
|
||||
width="55"
|
||||
/> -->
|
||||
<el-table-column
|
||||
label="订单编号"
|
||||
min-width="210"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<span style="display: block;" v-text="scope.row.orderId" />
|
||||
<span v-show="scope.row.isDel" style="color: #ED4014;display: block;">用户已删除</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="createTime"
|
||||
label="下单时间"
|
||||
min-width="150"
|
||||
/>
|
||||
<el-table-column
|
||||
prop="realName"
|
||||
label="收货人"
|
||||
min-width="100"
|
||||
/>
|
||||
<el-table-column
|
||||
prop="orderType"
|
||||
label="卖家id"
|
||||
min-width="110"
|
||||
/>
|
||||
<el-table-column
|
||||
label="商品信息"
|
||||
min-width="400"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<el-popover trigger="hover" placement="right" :open-delay="800">
|
||||
<div v-if=" scope.row.productList && scope.row.productList.length" slot="reference">
|
||||
<div v-for="(val, i ) in scope.row.productList" :key="i" class="tabBox acea-row row-middle" style="flex-wrap: inherit;">
|
||||
<div class="demo-image__preview mr10">
|
||||
<el-image
|
||||
:src="val.info.image"
|
||||
:preview-src-list="[val.info.image]"
|
||||
/>
|
||||
</div>
|
||||
<div class="text_overflow">
|
||||
<span class="tabBox_tit mr10">{{ val.info.productName + ' | ' }}{{ val.info.sku ? val.info.sku:'-' }}</span>
|
||||
<span class="tabBox_pice">{{ '¥'+ val.info.price ? val.info.price + ' x '+ val.info.payNum : '-' }}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="pup_card" v-if=" scope.row.productList && scope.row.productList.length">
|
||||
<div v-for="(val, i ) in scope.row.productList" :key="i" class="tabBox acea-row row-middle" style="flex-wrap: inherit;">
|
||||
<div class="">
|
||||
<span class="tabBox_tit mr10">{{ val.info.productName + ' | ' }}{{ val.info.sku ? val.info.sku:'-' }}</span>
|
||||
<span class="tabBox_pice">{{ '¥'+ val.info.price ? val.info.price + ' x '+ val.info.payNum : '-' }}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</el-popover>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="payPrice"
|
||||
label="实际支付"
|
||||
min-width="80"
|
||||
/>
|
||||
<el-table-column
|
||||
label="支付方式"
|
||||
min-width="80"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<span>{{ scope.row.payTypeStr }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="订单状态"
|
||||
min-width="100"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<div>
|
||||
<div v-if="scope.row.refundStatus === 1 || scope.row.refundStatus === 2" class="refunding" >
|
||||
<template>
|
||||
<el-popover trigger="hover" placement="left" :open-delay="800">
|
||||
<b style="color: #f124c7;" slot="reference">{{scope.row.statusStr.value}}</b>
|
||||
<div class="pup_card flex-column">
|
||||
<span>退款原因:{{scope.row.refundReasonWap}}</span>
|
||||
<span>备注说明:{{scope.row.refundReasonWapExplain}}</span>
|
||||
<span>退款时间:{{scope.row.refundReasonTime}}</span>
|
||||
<span class="acea-row">
|
||||
退款凭证:
|
||||
<template v-if="scope.row.refundReasonWapImg">
|
||||
<div v-for="(item, index) in scope.row.refundReasonWapImg.split(',')" :key="index" class="demo-image__preview" style="width: 35px;height: auto;display: inline-block;">
|
||||
<el-image
|
||||
:src="item"
|
||||
:preview-src-list="[item]"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
<span v-else style="display: inline-block">无</span>
|
||||
</span>
|
||||
</div>
|
||||
</el-popover>
|
||||
</template>
|
||||
</div>
|
||||
<span v-else>{{ scope.row.statusStr.value }}</span>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="操作" min-width="150" fixed="right" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-button v-if="scope.row.paid === false" type="text" size="small" @click="edit(scope.row)" class="mr10" v-hasPermi="['admin:order:update:price']">编辑</el-button>
|
||||
<el-button v-if="scope.row.statusStr.key === 'notShipped' && scope.row.refundStatus ===0" type="text" size="small" class="mr10" @click="sendOrder(scope.row)" v-hasPermi="['admin:order:send']">发送货</el-button>
|
||||
<el-button v-if=" scope.row.statusStr.key === 'toBeWrittenOff' && scope.row.paid == true && scope.row.refundStatus === 0 " type="text" size="small" class="mr10" v-hasPermi="['admin:order:write:update']" @click="onWriteOff(scope.row)">立即核销</el-button>
|
||||
<el-dropdown trigger="click">
|
||||
<span class="el-dropdown-link">
|
||||
更多<i class="el-icon-arrow-down el-icon--right" />
|
||||
</span>
|
||||
<el-dropdown-menu slot="dropdown">
|
||||
<el-dropdown-item @click.native="onOrderDetails(scope.row.orderId)" v-if="checkPermi(['admin:order:info'])">订单详情</el-dropdown-item>
|
||||
<el-dropdown-item @click.native="onOrderLog(scope.row.orderId)" v-if="checkPermi(['admin:order:status:list'])">订单记录</el-dropdown-item>
|
||||
<el-dropdown-item @click.native="onOrderMark(scope.row)" v-if="checkPermi(['admin:order:mark'])">订单备注</el-dropdown-item>
|
||||
<el-dropdown-item v-if="scope.row.refundStatus === 1 && checkPermi(['admin:order:refund:refuse'])" @click.native="onOrderRefuse(scope.row)">拒绝退款</el-dropdown-item>
|
||||
<!--v-show="((scope.row.statusStr.key !== 'refunded' && scope.row.statusStr.key !== 'unPaid') && (parseFloat(scope.row.payPrice) >= parseFloat(scope.row.refundPrice))) || (scope.row.payPrice == 0 && [0,1].indexOf(scope.row.refundStatus) !== -1)"-->
|
||||
<el-dropdown-item v-if="scope.row.refundStatus === 1 && checkPermi(['admin:order:refund'])" @click.native="onOrderRefund(scope.row)" >立即退款</el-dropdown-item>
|
||||
<el-dropdown-item v-if="scope.row.statusStr.key === 'deleted' && checkPermi(['admin:order:delete'])" @click.native="handleDelete(scope.row, scope.$index)">删除订单</el-dropdown-item>
|
||||
<el-dropdown-item v-if="scope.row.statusStr.key !== 'unPaid'" @click.native="onOrderPrint(scope.row)" >打印小票</el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
</el-dropdown>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<div class="block">
|
||||
<el-pagination
|
||||
:page-sizes="[20, 40, 60, 80]"
|
||||
:page-size="tableFrom.limit"
|
||||
:current-page="tableFrom.page"
|
||||
layout="total, sizes, prev, pager, next, jumper"
|
||||
:total="tableData.total"
|
||||
@size-change="handleSizeChange"
|
||||
@current-change="pageChange"
|
||||
/>
|
||||
</div>
|
||||
</el-card>
|
||||
<!--编辑-->
|
||||
<el-dialog
|
||||
title="编辑订单"
|
||||
:visible.sync="dialogVisible"
|
||||
width="500px"
|
||||
:before-close="handleClose">
|
||||
<zb-parser
|
||||
v-if="dialogVisible"
|
||||
:form-id="104"
|
||||
:is-create="isCreate"
|
||||
:edit-data="editData"
|
||||
@submit="handlerSubmit"
|
||||
@resetForm="resetForm"
|
||||
/>
|
||||
</el-dialog>
|
||||
|
||||
<!--记录-->
|
||||
<el-dialog
|
||||
title="操作记录"
|
||||
:visible.sync="dialogVisibleJI"
|
||||
width="700px"
|
||||
>
|
||||
<el-table
|
||||
v-loading="LogLoading"
|
||||
border
|
||||
:data="tableDataLog.data"
|
||||
style="width: 100%"
|
||||
>
|
||||
<el-table-column
|
||||
prop="oid"
|
||||
align="center"
|
||||
label="ID"
|
||||
min-width="80"
|
||||
/>
|
||||
<el-table-column
|
||||
prop="changeMessage"
|
||||
label="操作记录"
|
||||
align="center"
|
||||
min-width="280"
|
||||
/>
|
||||
<el-table-column
|
||||
prop="createTime"
|
||||
label="操作时间"
|
||||
align="center"
|
||||
min-width="280"
|
||||
/>
|
||||
</el-table>
|
||||
<div class="block">
|
||||
<el-pagination
|
||||
:page-sizes="[10, 20, 30, 40]"
|
||||
:page-size="tableFromLog.limit"
|
||||
:current-page="tableFromLog.page"
|
||||
layout="total, sizes, prev, pager, next, jumper"
|
||||
:total="tableDataLog.total"
|
||||
@size-change="handleSizeChangeLog"
|
||||
@current-change="pageChangeLog"
|
||||
/>
|
||||
</div>
|
||||
</el-dialog>
|
||||
|
||||
<!--详情-->
|
||||
<details-from ref="orderDetail" :orderId="orderId"/>
|
||||
|
||||
<!-- 发送货 -->
|
||||
<order-send ref="send" :orderId="orderId" @submitFail="getList"></order-send>
|
||||
|
||||
<!-- 发送货视频号商品 -->
|
||||
<order-video-send ref="videoSend" :orderId="orderId" @submitFail="getList"></order-video-send>
|
||||
|
||||
<!--拒绝退款-->
|
||||
<el-dialog
|
||||
title="拒绝退款原因"
|
||||
v-if="RefuseVisible"
|
||||
:visible.sync="RefuseVisible"
|
||||
width="500px"
|
||||
:before-close="RefusehandleClose">
|
||||
<zb-parser
|
||||
:form-id="106"
|
||||
:is-create="1"
|
||||
:edit-data="RefuseData"
|
||||
@submit="RefusehandlerSubmit"
|
||||
@resetForm="resetFormRefusehand"
|
||||
/>
|
||||
</el-dialog>
|
||||
|
||||
<!--立即退款-->
|
||||
<el-dialog
|
||||
title="退款处理"
|
||||
:visible.sync="refundVisible"
|
||||
width="500px"
|
||||
:before-close="refundhandleClose">
|
||||
<zb-parser
|
||||
:form-id="107"
|
||||
:is-create="1"
|
||||
:edit-data="refundData"
|
||||
@submit="refundhandlerSubmit"
|
||||
v-if="refundVisible"
|
||||
@resetForm="resetFormRefundhandler"
|
||||
/>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { orderListDataApi, orderStatusNumApi, writeUpdateApi, orderListApi, updatePriceApi, orderLogApi, orderMarkApi, orderDeleteApi, orderRefuseApi, orderRefundApi,orderPrint } from '@/api/cremb/order'
|
||||
import cardsData from '@/components/cards/index'
|
||||
import zbParser from '@/components/FormGenerator/components/parser/ZBParser'
|
||||
import detailsFrom from './orderDetail'
|
||||
import orderSend from './orderSend'
|
||||
import orderVideoSend from './orderVideoSend'
|
||||
import { storeStaffListApi } from '@/api/storePoint'
|
||||
import Cookies from 'js-cookie'
|
||||
import { isWriteOff } from "@/utils";
|
||||
import {orderExcelApi} from '@/api/cremb/store'
|
||||
import { checkPermi } from "@/utils/permission"; // 权限判断函数
|
||||
export default {
|
||||
name: 'orderlistDetails',
|
||||
components: {
|
||||
cardsData,
|
||||
zbParser,
|
||||
detailsFrom,
|
||||
orderSend,
|
||||
orderVideoSend
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
RefuseVisible: false,
|
||||
RefuseData:{},
|
||||
orderId: '',
|
||||
refundVisible: false,
|
||||
refundData: {},
|
||||
dialogVisibleJI: false,
|
||||
tableDataLog: {
|
||||
data: [],
|
||||
total: 0
|
||||
},
|
||||
tableFromLog: {
|
||||
page: 1,
|
||||
limit: 10,
|
||||
orderNo: 0
|
||||
},
|
||||
LogLoading: false,
|
||||
isCreate: 1,
|
||||
editData: null,
|
||||
dialogVisible: false,
|
||||
tableData: {
|
||||
data: [],
|
||||
total: 0
|
||||
},
|
||||
listLoading: true,
|
||||
tableFrom: {
|
||||
status: 'all',
|
||||
dateLimit: '',
|
||||
orderNo: '',
|
||||
page: 1,
|
||||
limit: 10,
|
||||
type: 0
|
||||
},
|
||||
orderChartType: {},
|
||||
timeVal: [],
|
||||
fromList: this.$constants.fromList,
|
||||
fromType:[
|
||||
{value:'all',text:'全部'},
|
||||
{value:'info',text:'普通'},
|
||||
{value:'pintuan',text:'拼团'},
|
||||
{value:'bragin',text:'砍价'},
|
||||
{value:'miaosha',text:'秒杀'},
|
||||
],
|
||||
selectionList: [],
|
||||
ids: '',
|
||||
orderids: '',
|
||||
cardLists: [],
|
||||
isWriteOff: isWriteOff(),
|
||||
proType: 0,
|
||||
active:false,
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.getList();
|
||||
this.getOrderStatusNum();
|
||||
// this.getOrderListData();
|
||||
},
|
||||
methods: {
|
||||
checkPermi,
|
||||
resetFormRefundhandler(){
|
||||
this.refundVisible = false
|
||||
},
|
||||
resetFormRefusehand(){
|
||||
this.RefuseVisible = false
|
||||
},
|
||||
resetForm(formValue) {
|
||||
this.dialogVisible = false
|
||||
},
|
||||
// 核销订单
|
||||
onWriteOff(row) {
|
||||
this.$modalSure('核销订单吗').then(() => {
|
||||
writeUpdateApi(row.verifyCode).then(() => {
|
||||
this.$message.success('核销成功')
|
||||
this.tableFrom.page = 1
|
||||
this.getList()
|
||||
})
|
||||
})
|
||||
},
|
||||
seachList() {
|
||||
this.tableFrom.page = 1
|
||||
this.getList()
|
||||
this.getOrderStatusNum()
|
||||
},
|
||||
// 拒绝退款
|
||||
RefusehandleClose() {
|
||||
this.RefuseVisible = false
|
||||
},
|
||||
onOrderRefuse(row) {
|
||||
this.orderids = row.orderId
|
||||
this.RefuseData = {
|
||||
orderId: row.orderId,
|
||||
reason: ''
|
||||
}
|
||||
this.RefuseVisible = true
|
||||
},
|
||||
RefusehandlerSubmit(formValue) {
|
||||
orderRefuseApi({ orderNo: this.orderids, reason: formValue.reason}).then(data => {
|
||||
this.$message.success('操作成功')
|
||||
this.RefuseVisible = false
|
||||
this.getList()
|
||||
})
|
||||
},
|
||||
// 立即退款
|
||||
refundhandleClose() {
|
||||
this.refundVisible = false
|
||||
},
|
||||
onOrderRefund(row) {
|
||||
this.refundData = {
|
||||
orderId: row.orderId,
|
||||
amount: row.payPrice,
|
||||
type: ''
|
||||
}
|
||||
this.orderids = row.orderId
|
||||
this.refundVisible = true
|
||||
},
|
||||
refundhandlerSubmit(formValue) {
|
||||
orderRefundApi({ amount: formValue.amount, orderNo: this.orderids}).then(data => {
|
||||
this.$message.success('操作成功')
|
||||
this.refundVisible = false
|
||||
this.getList()
|
||||
})
|
||||
},
|
||||
// 发送
|
||||
sendOrder(row) {
|
||||
if(row.type===0){
|
||||
this.$refs.send.modals = true;
|
||||
this.$refs.send.getList();
|
||||
this.$refs.send.sheetInfo();
|
||||
}else{
|
||||
this.$refs.videoSend.modals = true;
|
||||
if(!JSON.parse(sessionStorage.getItem('videoExpress'))) this.$refs.videoSend.companyGetList();
|
||||
}
|
||||
this.orderId = row.orderId;
|
||||
},
|
||||
// 订单删除
|
||||
handleDelete(row, idx) {
|
||||
if (row.isDel) {
|
||||
this.$modalSure().then(() => {
|
||||
orderDeleteApi({ orderNo: row.orderId }).then(() => {
|
||||
this.$message.success('删除成功')
|
||||
this.tableData.data.splice(idx, 1)
|
||||
})
|
||||
})
|
||||
} else {
|
||||
this.$confirm('您选择的的订单存在用户未删除的订单,无法删除用户未删除的订单!', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
type: 'error'
|
||||
})
|
||||
}
|
||||
},
|
||||
// 详情
|
||||
onOrderDetails(id) {
|
||||
this.orderId = id
|
||||
this.$refs.orderDetail.getDetail(id)
|
||||
this.$refs.orderDetail.dialogVisible = true
|
||||
},
|
||||
// 订单记录
|
||||
onOrderLog(id) {
|
||||
this.dialogVisibleJI = true
|
||||
this.LogLoading = true
|
||||
this.tableFromLog.orderNo = id
|
||||
orderLogApi( this.tableFromLog ).then(res => {
|
||||
this.tableDataLog.data = res.list
|
||||
this.tableDataLog.total = res.total
|
||||
this.LogLoading = false
|
||||
}).catch(() => {
|
||||
this.LogLoading = false
|
||||
})
|
||||
},
|
||||
pageChangeLog(page) {
|
||||
this.tableFromLog.page = page
|
||||
this.onOrderLog()
|
||||
},
|
||||
handleSizeChangeLog(val) {
|
||||
this.tableFromLog.limit = val
|
||||
this.onOrderLog()
|
||||
},
|
||||
handleClose() {
|
||||
this.dialogVisible = false;
|
||||
},
|
||||
// 备注
|
||||
onOrderMark(row) {
|
||||
this.$prompt('订单备注', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
inputErrorMessage: '请输入订单备注',
|
||||
inputType: 'textarea',
|
||||
inputValue: row.remark,
|
||||
inputPlaceholder: '请输入订单备注',
|
||||
inputValidator: (value) => { if(!value) return '输入不能为空'}
|
||||
}).then(({value}) => {
|
||||
orderMarkApi({ mark : value, orderNo: row.orderId}).then(() => {
|
||||
this.$message.success('操作成功')
|
||||
this.getList();
|
||||
})
|
||||
}).catch(() => {
|
||||
this.$message.info('取消输入')
|
||||
})
|
||||
},
|
||||
handleSelectionChange(val) {
|
||||
this.selectionList = val
|
||||
const data = []
|
||||
this.selectionList.map((item) => {
|
||||
data.push(item.orderId)
|
||||
})
|
||||
this.ids = data.join(',')
|
||||
},
|
||||
// 选择时间
|
||||
selectChange (tab) {
|
||||
this.timeVal = [];
|
||||
this.tableFrom.page = 1
|
||||
this.getList();
|
||||
this.getOrderStatusNum();
|
||||
// this.getOrderListData();
|
||||
},
|
||||
// 具体日期
|
||||
onchangeTime (e) {
|
||||
this.timeVal = e;
|
||||
this.tableFrom.dateLimit = e ? this.timeVal.join(',') : ''
|
||||
this.tableFrom.page = 1
|
||||
this.getList();
|
||||
this.getOrderStatusNum();
|
||||
// this.getOrderListData();
|
||||
},
|
||||
// 编辑
|
||||
edit(row) {
|
||||
this.orderId = row.orderId
|
||||
this.editData = {
|
||||
orderId: row.orderId,
|
||||
totalPrice: row.totalPrice,
|
||||
totalPostage: row.totalPostage,
|
||||
payPrice: row.payPrice,
|
||||
payPostage: row.payPostage,
|
||||
gainIntegral: row.gainIntegral,
|
||||
}
|
||||
this.dialogVisible = true
|
||||
},
|
||||
handlerSubmit(formValue) {
|
||||
let data = {
|
||||
orderNo:formValue.orderId,
|
||||
payPrice:formValue.payPrice
|
||||
}
|
||||
updatePriceApi(data).then(data => {
|
||||
this.$message.success('编辑数据成功')
|
||||
this.dialogVisible = false
|
||||
this.getList()
|
||||
})
|
||||
},
|
||||
// 列表
|
||||
getList() {
|
||||
this.listLoading = true
|
||||
orderListApi(this.tableFrom).then(res => {
|
||||
this.tableData.data = res.data.list || [];
|
||||
this.tableData.total = res.data.total;
|
||||
this.listLoading = false
|
||||
this.checkedCities = this.$cache.local.has('order_stroge') ? this.$cache.local.getJSON('order_stroge') : this.checkedCities;
|
||||
}).catch(() => {
|
||||
this.listLoading = false
|
||||
})
|
||||
},
|
||||
// 数据统计
|
||||
getOrderListData() {
|
||||
orderListDataApi({dateLimit:this.tableFrom.dateLimit}).then(res => {
|
||||
this.cardLists = [
|
||||
{ name: '订单数量', count: res.count,color:'#1890FF',class:'one',icon:'icondingdan' },
|
||||
{ name: '订单金额', count: res.amount, color:'#A277FF',class:'two',icon:'icondingdanjine' },
|
||||
{ name: '微信支付金额', count: res.weChatAmount, color:'#EF9C20',class:'three',icon:'iconweixinzhifujine' },
|
||||
{ name: '余额支付金额', count: res.yueAmount,color:'#1BBE6B',class:'four',icon:'iconyuezhifujine2' }
|
||||
]
|
||||
});
|
||||
},
|
||||
// 获取各状态数量
|
||||
getOrderStatusNum() {
|
||||
orderStatusNumApi({dateLimit:this.tableFrom.dateLimit,type:this.tableFrom.type}).then(res => {
|
||||
this.orderChartType = res;
|
||||
});
|
||||
},
|
||||
pageChange(page) {
|
||||
this.tableFrom.page = page
|
||||
this.getList()
|
||||
},
|
||||
handleSizeChange(val) {
|
||||
this.tableFrom.limit = val
|
||||
this.getList()
|
||||
},
|
||||
exports(){
|
||||
let data = {
|
||||
dateLimit:this.tableFrom.dateLimit,
|
||||
orderNo:this.tableFrom.orderNo,
|
||||
status:this.tableFrom.status,
|
||||
type:this.tableFrom.type
|
||||
};
|
||||
orderExcelApi(data).then(res=>{
|
||||
window.open(res.fileName);
|
||||
})
|
||||
},
|
||||
//打印小票
|
||||
onOrderPrint(data){
|
||||
orderPrint(data.orderId).then(res=>{
|
||||
this.$modal.msgSuccess('打印成功');
|
||||
}).catch(error=>{
|
||||
this.$modal.msgError(error.message)
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.el-table__body {
|
||||
width: 100%;
|
||||
table-layout: fixed !important;
|
||||
}
|
||||
.demo-table-expand{
|
||||
::v-deeplabel{
|
||||
width: 83px !important;
|
||||
}
|
||||
}
|
||||
.refunding{
|
||||
span{
|
||||
display: block;
|
||||
}
|
||||
}
|
||||
.selWidth{
|
||||
width: 300px;
|
||||
}
|
||||
.el-dropdown-link {
|
||||
cursor: pointer;
|
||||
color: #409EFF;
|
||||
font-size: 12px;
|
||||
}
|
||||
.el-icon-arrow-down {
|
||||
font-size: 12px;
|
||||
}
|
||||
.tabBox_tit {
|
||||
font-size: 12px !important;
|
||||
/*margin: 0 2px 0 10px;*/
|
||||
letter-spacing: 1px;
|
||||
/*padding: 5px 0;*/
|
||||
box-sizing: border-box;
|
||||
}
|
||||
.text_overflow{
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
max-width: 400px;
|
||||
}
|
||||
.pup_card{
|
||||
width: 200px;
|
||||
border-radius: 5px;
|
||||
padding: 5px;
|
||||
box-sizing: border-box;
|
||||
font-size: 12px;
|
||||
line-height: 16px;
|
||||
}
|
||||
.flex-column{
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
.mt20{
|
||||
margin-top:20px
|
||||
}
|
||||
.relative{
|
||||
position: relative;
|
||||
}
|
||||
</style>
|
|
@ -0,0 +1,220 @@
|
|||
<template>
|
||||
<div>
|
||||
<el-dialog
|
||||
title="订单信息"
|
||||
:visible.sync="dialogVisible"
|
||||
width="700px"
|
||||
v-if="orderDatalist"
|
||||
>
|
||||
<div class="description" v-loading="loading">
|
||||
<div class="title">用户信息</div>
|
||||
<div class="acea-row">
|
||||
<div class="description-term">用户昵称:{{orderDatalist.nikeName}}</div>
|
||||
<div class="description-term">绑定电话:{{orderDatalist.phone ? orderDatalist.phone : '无'}}</div>
|
||||
</div>
|
||||
<el-divider></el-divider>
|
||||
<div class="title">{{orderDatalist.statusStr.key === 'toBeWrittenOff'?'提货信息': '收货信息'}}</div>
|
||||
<div class="acea-row">
|
||||
<div class="description-term">{{orderDatalist.statusStr.key === 'toBeWrittenOff'?'提货人': '收货人'}}:{{orderDatalist.realName}}</div>
|
||||
<div class="description-term">{{orderDatalist.statusStr.key === 'toBeWrittenOff'?'提货电话': '收货电话'}}:{{orderDatalist.userPhone}}</div>
|
||||
<div class="description-term" v-if="orderDatalist.statusStr.key !== 'toBeWrittenOff'">{{orderDatalist.statusStr.key === 'toBeWrittenOff'?'提货地址': '收货地址'}}:{{orderDatalist.userAddress}}</div>
|
||||
</div>
|
||||
<el-divider></el-divider>
|
||||
<div class="title">订单信息</div>
|
||||
<div class="acea-row">
|
||||
<div class="description-term">订单编号:{{orderDatalist.orderId}}</div>
|
||||
<div class="description-term" style="color: red">订单状态:{{orderDatalist.statusStr.value}}</div>
|
||||
<div class="description-term">商品总数:{{orderDatalist.totalNum}}</div>
|
||||
<div class="description-term">商品总价:{{orderDatalist.proTotalPrice}}</div>
|
||||
<div class="description-term">支付邮费:{{orderDatalist.payPostage}}</div>
|
||||
<div class="description-term">优惠券金额:{{orderDatalist.couponPrice}}</div>
|
||||
<div class="description-term">实际支付:{{orderDatalist.payPrice}}</div>
|
||||
<div class="description-term">抵扣金额:{{orderDatalist.deductionPrice}}</div>
|
||||
<div class="description-term fontColor3" v-if="orderDatalist.refundPrice">退款金额:{{orderDatalist.refundPrice}}</div>
|
||||
<div class="description-term" v-if="orderDatalist.useIntegral">使用积分:{{orderDatalist.useIntegral}}</div>
|
||||
<div class="description-term" v-if="orderDatalist.backIntegral">退回积分:{{orderDatalist.backIntegral}}</div>
|
||||
<div class="description-term">创建时间:{{orderDatalist.createTime}}</div>
|
||||
<div class="description-term" v-if="orderDatalist.refundReasonTime">退款时间:{{orderDatalist.refundReasonTime}}</div>
|
||||
<div class="description-term">支付方式:{{orderDatalist.payTypeStr}}</div>
|
||||
<div class="description-term">推广人:{{orderDatalist.spreadName | filterEmpty}}</div>
|
||||
<div class="description-term" v-if="orderDatalist.shippingType === 2 && orderDatalist.statusStr.key === 'notShipped'">门店名称:{{orderDatalist.storeName}}</div>
|
||||
<div class="description-term" v-if="orderDatalist.shippingType === 2 && orderDatalist.statusStr.key === 'notShipped'">核销码:{{orderDatalist.user_phone}}</div>
|
||||
<div class="description-term">商家备注:{{orderDatalist.remark}}</div>
|
||||
<template v-if="orderDatalist.statusStr.key === 'toBeWrittenOff' && orderDatalist.systemStore">
|
||||
<div class="description-term">提货码:{{orderDatalist.verifyCode}}</div>
|
||||
<div class="description-term">门店名称:{{orderDatalist.systemStore.name}}</div>
|
||||
<div class="description-term">门店电话:{{orderDatalist.systemStore.phone}}</div>
|
||||
<div class="description-term">门店地址:{{orderDatalist.systemStore.address + orderDatalist.systemStore.detailedAddress}}</div>
|
||||
</template>
|
||||
|
||||
</div>
|
||||
<template v-if="orderDatalist.deliveryType === 'express'">
|
||||
<el-divider></el-divider>
|
||||
<div class="title">物流信息</div>
|
||||
<div class="acea-row">
|
||||
<div class="description-term">快递公司:{{orderDatalist.deliveryName}}</div>
|
||||
<div class="description-term">快递单号:{{orderDatalist.deliveryId}}
|
||||
<el-button type="primary" size="mini" @click="openLogistics" style="margin-left: 5px" v-hasPermi="['admin:order:logistics:info']">物流查询</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<template v-if="orderDatalist.deliveryType === 'send'">
|
||||
<el-divider></el-divider>
|
||||
<div class="title">配送信息</div>
|
||||
<div class="acea-row">
|
||||
<div class="description-term">送货人姓名:{{orderDatalist.deliveryName}}</div>
|
||||
<div class="description-term">送货人电话:{{orderDatalist.deliveryId}}</div>
|
||||
</div>
|
||||
</template>
|
||||
<template v-if="orderDatalist.mark">
|
||||
<el-divider></el-divider>
|
||||
<div class="title">用户备注</div>
|
||||
<div class="acea-row">
|
||||
<div class="description-term">{{orderDatalist.mark}}</div>
|
||||
</div>
|
||||
</template>
|
||||
</div>
|
||||
</el-dialog>
|
||||
<el-dialog
|
||||
v-if="orderDatalist"
|
||||
title="提示"
|
||||
:visible.sync="modal2"
|
||||
width="30%">
|
||||
<div class="logistics acea-row row-top">
|
||||
<div class="logistics_img"><img src="@/assets/imgs/expressi.jpg"></div>
|
||||
<div class="logistics_cent">
|
||||
<span class="mb10">物流公司:{{orderDatalist.deliveryName}}</span>
|
||||
<span>物流单号:{{orderDatalist.deliveryId}}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="acea-row row-column-around trees-coadd">
|
||||
<div class="scollhide">
|
||||
<el-timeline :reverse="reverse">
|
||||
<el-timeline-item v-for="(item,i) in result" :key="i">
|
||||
<p class="time" v-text="item.time"></p>
|
||||
<p class="content" v-text="item.status"></p>
|
||||
</el-timeline-item>
|
||||
</el-timeline >
|
||||
</div>
|
||||
</div>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="modal2 = false">关闭</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>0
|
||||
import { orderDetailApi, getLogisticsInfoApi } from '@/api/cremb/order'
|
||||
export default {
|
||||
name: 'OrderDetail',
|
||||
props: {
|
||||
orderId: {
|
||||
type: String,
|
||||
default: 0
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
reverse: true,
|
||||
dialogVisible: false,
|
||||
orderDatalist: null,
|
||||
loading: false,
|
||||
modal2: false,
|
||||
result: []
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
},
|
||||
methods: {
|
||||
openLogistics () {
|
||||
this.getOrderData()
|
||||
this.modal2 = true;
|
||||
},
|
||||
// 获取订单物流信息
|
||||
getOrderData () {
|
||||
getLogisticsInfoApi({orderNo:this.orderId}).then(async res => {
|
||||
this.result = res.list;
|
||||
})
|
||||
},
|
||||
getDetail(id) {
|
||||
this.loading = true
|
||||
orderDetailApi({orderNo: id}).then(res => {
|
||||
this.orderDatalist = res
|
||||
this.loading = false
|
||||
}).catch(() => {
|
||||
this.orderDatalist = null
|
||||
this.loading = false
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.logistics {
|
||||
align-items: center;
|
||||
padding: 10px 0px;
|
||||
.logistics_img {
|
||||
width: 45px;
|
||||
height: 45px;
|
||||
margin-right: 12px;
|
||||
img {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
}
|
||||
.logistics_cent {
|
||||
span {
|
||||
display: block;
|
||||
font-size: 12px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.trees-coadd {
|
||||
width: 100%;
|
||||
height: 400px;
|
||||
border-radius: 4px;
|
||||
overflow: hidden;
|
||||
.scollhide {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
overflow: auto;
|
||||
margin-left: 18px;
|
||||
padding: 10px 0 10px 0;
|
||||
box-sizing: border-box;
|
||||
.content {
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
.time {
|
||||
font-size: 12px;
|
||||
color: #2d8cf0;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
.title {
|
||||
margin-bottom: 14px;
|
||||
color: #303133;
|
||||
font-weight: 500;
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.description {
|
||||
&-term {
|
||||
display: table-cell;
|
||||
padding-bottom: 5px;
|
||||
line-height: 20px;
|
||||
width: 50%;
|
||||
font-size: 12px;
|
||||
color: #606266;
|
||||
}
|
||||
::v-deep .el-divider--horizontal {
|
||||
margin: 12px 0 !important;
|
||||
}
|
||||
}
|
||||
|
||||
</style>
|
|
@ -0,0 +1,252 @@
|
|||
<template>
|
||||
<el-dialog :visible.sync="modals" title="发送货" class="order_box" :before-close="handleClose" width="600px">
|
||||
<el-form ref="formItem" :model="formItem" label-width="110px" @submit.native.prevent :rules="rules">
|
||||
<el-form-item label="选择类型:">
|
||||
<el-radio-group v-model="formItem.type" @change="changeRadioType(formItem.type)">
|
||||
<el-radio label="1">发货</el-radio>
|
||||
<el-radio label="2">送货</el-radio>
|
||||
<el-radio label="3">虚拟</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<div v-if="formItem.type==='1'">
|
||||
<el-form-item label="发货类型:" prop="expressId">
|
||||
<el-radio-group v-model="formItem.expressRecordType" @change="changeRadio(formItem.expressRecordType)">
|
||||
<el-radio label="1">手动填写</el-radio>
|
||||
<el-radio label="2" v-if="checkPermi(['admin:order:sheet:info'])">电子面单打印</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="快递公司:" prop="expressCode">
|
||||
<el-select v-model="formItem.expressCode" filterable style="width:80%;"
|
||||
@change="onChangeExport(formItem.expressCode)">
|
||||
<el-option v-for="(item,i) in express" :value="item.code" :key="i" :label="item.name"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item v-if="formItem.expressRecordType === '1'" label="快递单号:" prop="expressNumber">
|
||||
<el-input v-model="formItem.expressNumber" placeholder="请输入快递单号" style="width:80%;"></el-input>
|
||||
</el-form-item>
|
||||
<template v-if="formItem.expressRecordType === '2'">
|
||||
<el-form-item label="电子面单:" class="express_temp_id" prop="expressTempId">
|
||||
<div class="acea-row">
|
||||
<el-select v-model="formItem.expressTempId" placeholder="请选择电子面单"
|
||||
:class="[formItem.expressTempId?'width9':'width8']" @change="onChangeImg">
|
||||
<el-option v-for="(item,i) in exportTempList" :value="item.temp_id" :key="i"
|
||||
:label="item.title"></el-option>
|
||||
</el-select>
|
||||
<div v-if="formItem.expressTempId" style="position: relative;">
|
||||
<!--<span class="tempImg" @click="">预览</span>-->
|
||||
<div class="tempImgList ml10">
|
||||
<div class="demo-image__preview">
|
||||
<el-image
|
||||
style="width: 36px; height: 36px"
|
||||
:src="tempImg"
|
||||
:preview-src-list="[tempImg]"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!--<Button v-if="formItem.expressTempId" type="text" @click="preview">预览</Button>-->
|
||||
</div>
|
||||
|
||||
</el-form-item>
|
||||
<el-form-item label="寄件人姓名:" prop="toName">
|
||||
<el-input v-model="formItem.toName" placeholder="请输入寄件人姓名" style="width:80%;"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="寄件人电话:" prop="toTel">
|
||||
<el-input v-model="formItem.toTel" placeholder="请输入寄件人电话" style="width:80%;"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="寄件人地址:" prop="toAddr">
|
||||
<el-input v-model="formItem.toAddr" placeholder="请输入寄件人地址" style="width:80%;"></el-input>
|
||||
</el-form-item>
|
||||
</template>
|
||||
</div>
|
||||
<div v-if="formItem.type==='2'">
|
||||
<el-form-item label="送货人姓名:" prop="deliveryName">
|
||||
<el-input v-model="formItem.deliveryName" placeholder="请输入送货人姓名" style="width:80%;"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="送货人电话:" prop="deliveryTel">
|
||||
<el-input v-model="formItem.deliveryTel" placeholder="请输入送货人电话" style="width:80%;"></el-input>
|
||||
</el-form-item>
|
||||
</div>
|
||||
<div>
|
||||
<el-form-item label="" >
|
||||
<div style="color:#CECECE;">顺丰请输入单号:收件人或寄件人手机号后四位</div>
|
||||
<div style="color:#CECECE;">例如:SF000000000000:3941</div>
|
||||
</el-form-item>
|
||||
</div>
|
||||
</el-form>
|
||||
<div slot="footer">
|
||||
<el-button type="primary" @click="putSend('formItem')">提交</el-button>
|
||||
<el-button @click="cancel('formItem')">取消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {orderSendApi, sheetInfoApi} from '@/api/cremb/order'
|
||||
import {expressAllApi, exportTempApi} from '@/api/cremb/sms'
|
||||
import { checkPermi } from "@/utils/permission"; // 权限判断函数
|
||||
import {Debounce} from '@/utils/validate'
|
||||
const validatePhone = (rule, value, callback) => {
|
||||
if (!value) {
|
||||
return callback(new Error('请填写手机号'));
|
||||
} else if (!/^1[3456789]\d{9}$/.test(value)) {
|
||||
callback(new Error('手机号格式不正确!'));
|
||||
} else {
|
||||
callback();
|
||||
}
|
||||
};
|
||||
export default {
|
||||
name: 'orderSend',
|
||||
props: {
|
||||
orderId: String
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
formItem: {
|
||||
type: '1',
|
||||
expressRecordType: '1',
|
||||
expressId: '',
|
||||
expressCode: '',
|
||||
deliveryName: '',
|
||||
deliveryTel: '',
|
||||
// expressName: '',
|
||||
expressNumber: '',
|
||||
expressTempId: '',
|
||||
toAddr: '',
|
||||
toName: '',
|
||||
toTel: '',
|
||||
orderNo: ''
|
||||
},
|
||||
modals: false,
|
||||
express: [],
|
||||
exportTempList: [],
|
||||
tempImg: '',
|
||||
rules: {
|
||||
toName: [
|
||||
{required: true, message: '请输寄件人姓名', trigger: 'blur'}
|
||||
],
|
||||
toTel: [
|
||||
{required: true, validator: validatePhone, trigger: 'blur'}
|
||||
],
|
||||
toAddr: [
|
||||
{required: true, message: '请输入寄件人地址', trigger: 'blur'}
|
||||
],
|
||||
expressCode: [
|
||||
{required: true, message: '请选择快递公司', trigger: 'change'}
|
||||
],
|
||||
expressNumber: [
|
||||
{required: true, message: '请输入快递单号', trigger: 'blur'}
|
||||
],
|
||||
expressTempId: [
|
||||
{required: true, message: '请选择电子面单', trigger: 'change'}
|
||||
],
|
||||
deliveryName: [
|
||||
{required: true, message: '请输入送货人姓名', trigger: 'blur'}
|
||||
],
|
||||
deliveryTel: [
|
||||
{required: true, validator: validatePhone, trigger: 'blur'}
|
||||
]
|
||||
},
|
||||
expressType: 'normal'
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
},
|
||||
methods: {
|
||||
checkPermi,
|
||||
// 默认信息
|
||||
sheetInfo() {
|
||||
sheetInfoApi().then(async res => {
|
||||
this.formItem.toAddr = res.exportToAddress || '';
|
||||
this.formItem.toName = res.exportToName || '';
|
||||
this.formItem.toTel = res.exportToTel || '';
|
||||
})
|
||||
},
|
||||
// 快递公司选择
|
||||
onChangeExport(val) {
|
||||
this.formItem.expressTempId = '';
|
||||
if (this.formItem.expressRecordType === '2') this.exportTemp(val);
|
||||
},
|
||||
// 电子面单模板
|
||||
exportTemp(val) {
|
||||
exportTempApi({com: val}).then(async res => {
|
||||
this.exportTempList = res.data.data || [];
|
||||
})
|
||||
},
|
||||
onChangeImg(item) {
|
||||
this.exportTempList.map(i => {
|
||||
if (i.temp_id === item) this.tempImg = i.pic
|
||||
})
|
||||
},
|
||||
changeRadioType() {
|
||||
this.formItem.expressId = ''
|
||||
this.formItem.expressCode = ''
|
||||
},
|
||||
changeRadio(o) {
|
||||
if (o == 2){
|
||||
this.expressType = 'elec'
|
||||
}else{
|
||||
this.expressType = 'normal'
|
||||
}
|
||||
this.formItem.expressId = ''
|
||||
this.formItem.expressCode = ''
|
||||
this.getList();
|
||||
},
|
||||
// 物流公司列表
|
||||
getList() {
|
||||
expressAllApi({type: this.expressType}).then(async res => {
|
||||
this.express = res
|
||||
})
|
||||
},
|
||||
// 提交
|
||||
putSend:Debounce(function(name) {
|
||||
this.formItem.orderNo = this.orderId;
|
||||
this.$refs[name].validate((valid) => {
|
||||
if (valid) {
|
||||
orderSendApi(this.formItem).then(async => {
|
||||
this.$message.success('发送货成功');
|
||||
this.modals = false;
|
||||
this.$refs[name].resetFields();
|
||||
this.$emit('submitFail')
|
||||
})
|
||||
} else {
|
||||
this.$message.error('请填写信息');
|
||||
}
|
||||
})
|
||||
}),
|
||||
handleClose() {
|
||||
this.cancel('formItem');
|
||||
},
|
||||
cancel(name) {
|
||||
this.modals = false;
|
||||
this.$refs[name].resetFields();
|
||||
this.formItem.type = '1';
|
||||
this.formItem.expressRecordType = '1';
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.width8 {
|
||||
width: 80%;
|
||||
}
|
||||
|
||||
.width9 {
|
||||
width: 70%;
|
||||
}
|
||||
|
||||
.tempImgList {
|
||||
// opacity: 1;
|
||||
width: 38px !important;
|
||||
height: 30px !important;
|
||||
// margin-top: -30px;
|
||||
cursor: pointer;
|
||||
position: absolute;
|
||||
z-index: 11;
|
||||
img {
|
||||
width: 38px !important;
|
||||
height: 30px !important;
|
||||
}
|
||||
}
|
||||
</style>
|
|
@ -0,0 +1,121 @@
|
|||
<template>
|
||||
<el-dialog :visible.sync="modals" title="发送货" class="order_box" :before-close="handleClose" width="600px">
|
||||
<el-form ref="formItem" :model="formItem" label-width="110px" @submit.native.prevent :rules="rules">
|
||||
<el-form-item label="快递公司:" prop="expressCode">
|
||||
<el-select v-model="formItem.deliveryId" filterable style="width:80%;">
|
||||
<el-option v-for="(item,i) in express" :value="item.deliveryId" :key="i" :label="item.deliveryName"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="快递单号:" prop="waybillId">
|
||||
<el-input v-model="formItem.waybillId" placeholder="请输入快递单号" style="width:80%;"></el-input>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer">
|
||||
<el-button size="mini" type="primary" @click="putSend('formItem')" v-hasPermi="['admin:order:video:send']">提交</el-button>
|
||||
<el-button size="mini" @click="cancel('formItem')">取消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {videoSendApi, sheetInfoApi, companyGetListApi} from '@/api/cremb/order'
|
||||
import {Debounce} from '@/utils/validate'
|
||||
const validatePhone = (rule, value, callback) => {
|
||||
if (!value) {
|
||||
return callback(new Error('请填写手机号'));
|
||||
} else if (!/^1[3456789]\d{9}$/.test(value)) {
|
||||
callback(new Error('手机号格式不正确!'));
|
||||
} else {
|
||||
callback();
|
||||
}
|
||||
};
|
||||
export default {
|
||||
name: 'orderSend',
|
||||
props: {
|
||||
orderId: String
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
formItem: {
|
||||
deliveryId: '',
|
||||
orderNo: '',
|
||||
waybillId: ''
|
||||
},
|
||||
modals: false,
|
||||
express: [],
|
||||
exportTempList: [],
|
||||
tempImg: '',
|
||||
rules: {
|
||||
deliveryId: [
|
||||
{required: true, message: '请选择快递公司', trigger: 'change'}
|
||||
],
|
||||
waybillId: [
|
||||
{required: true, message: '请输入快递单号', trigger: 'blur'}
|
||||
]
|
||||
},
|
||||
expressType: 'normal'
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.express = JSON.parse(sessionStorage.getItem('videoExpress'));
|
||||
},
|
||||
methods: {
|
||||
// 视频号快递公司
|
||||
companyGetList() {
|
||||
companyGetListApi().then(async res => {
|
||||
this.express = res;
|
||||
sessionStorage.setItem('videoExpress', JSON.stringify(res))
|
||||
})
|
||||
},
|
||||
// 提交
|
||||
putSend:Debounce(function(name) {
|
||||
this.formItem.orderNo = this.orderId;
|
||||
this.$refs[name].validate((valid) => {
|
||||
if (valid) {
|
||||
videoSendApi(this.formItem).then(async => {
|
||||
this.$message.success('发送货成功');
|
||||
this.modals = false;
|
||||
this.$refs[name].resetFields();
|
||||
this.$emit('submitFail')
|
||||
})
|
||||
} else {
|
||||
this.$message.error('请填写信息');
|
||||
}
|
||||
})
|
||||
}),
|
||||
handleClose() {
|
||||
this.cancel('formItem');
|
||||
},
|
||||
cancel(name) {
|
||||
this.modals = false;
|
||||
this.$refs[name].resetFields();
|
||||
this.formItem.type = '1';
|
||||
this.formItem.expressRecordType = '1';
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.width8 {
|
||||
width: 80%;
|
||||
}
|
||||
|
||||
.width9 {
|
||||
width: 70%;
|
||||
}
|
||||
|
||||
.tempImgList {
|
||||
// opacity: 1;
|
||||
width: 38px !important;
|
||||
height: 30px !important;
|
||||
// margin-top: -30px;
|
||||
cursor: pointer;
|
||||
position: absolute;
|
||||
z-index: 11;
|
||||
img {
|
||||
width: 38px !important;
|
||||
height: 30px !important;
|
||||
}
|
||||
}
|
||||
</style>
|
|
@ -4,7 +4,7 @@
|
|||
<div class="clearfix">
|
||||
<div class="container">
|
||||
<el-form size="small" label-width="100px">
|
||||
<el-form-item label="订单状态:" v-if="checkPermi(['admin:order:status:num'])">
|
||||
<el-form-item label="订单状态:" v-if="checkPermi(['trade:order:type'])">
|
||||
<el-radio-group v-model="tableFrom.status" type="button" @change="seachList">
|
||||
<el-radio-button label="all">全部 {{ '(' +orderChartType.all?orderChartType.all:0 + ')' }}</el-radio-button>
|
||||
<el-radio-button label="unPaid">未支付 {{ '(' +orderChartType.unPaid?orderChartType.unPaid:0+ ')' }}</el-radio-button>
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<template>
|
||||
<div class="app-container">
|
||||
<doc-alert title="SaaS 多租户" url="https://doc.iocoder.cn/saas-tenant/" />
|
||||
<doc-alert title="SaaS 多店铺" url="https://doc.iocoder.cn/saas-tenant/" />
|
||||
<!-- 搜索工作栏 -->
|
||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
|
||||
<el-form-item label="套餐名" prop="name">
|
||||
|
@ -108,7 +108,7 @@ export default {
|
|||
showSearch: true,
|
||||
// 总条数
|
||||
total: 0,
|
||||
// 租户套餐列表
|
||||
// 店铺套餐列表
|
||||
list: [],
|
||||
// 弹出层标题
|
||||
title: "",
|
||||
|
@ -195,7 +195,7 @@ export default {
|
|||
handleAdd() {
|
||||
this.reset();
|
||||
this.open = true;
|
||||
this.title = "添加租户套餐";
|
||||
this.title = "添加店铺套餐";
|
||||
// 设置为非严格,继续使用半选中
|
||||
this.menuCheckStrictly = false;
|
||||
},
|
||||
|
@ -204,7 +204,7 @@ export default {
|
|||
this.reset();
|
||||
const id = row.id;
|
||||
this.open = true;
|
||||
this.title = "修改租户套餐";
|
||||
this.title = "修改店铺套餐";
|
||||
// 获得菜单列表
|
||||
getTenantPackage(id).then(response => {
|
||||
this.form = response.data;
|
||||
|
@ -258,7 +258,7 @@ export default {
|
|||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
const id = row.id;
|
||||
this.$modal.confirm('是否确认删除租户套餐编号为"' + id + '"的数据项?').then(function() {
|
||||
this.$modal.confirm('是否确认删除店铺套餐编号为"' + id + '"的数据项?').then(function() {
|
||||
return deleteTenantPackage(id);
|
||||
}).then(() => {
|
||||
this.getList();
|
||||
|
|
|
@ -17,7 +17,7 @@ function prePage(){
|
|||
export const toLogin = Debounce(_toLogin,800)
|
||||
|
||||
export function _toLogin(push, pathLogin) {
|
||||
|
||||
|
||||
store.commit("LOGOUT");
|
||||
let path = prePage();
|
||||
let login_back_url = Cache.get(BACK_URL);
|
||||
|
@ -26,10 +26,10 @@ export function _toLogin(push, pathLogin) {
|
|||
path = location.pathname + location.search;
|
||||
// #endif
|
||||
if(!pathLogin){
|
||||
pathLogin = '/page/users/login/index'
|
||||
Cache.set('login_back_url',path);
|
||||
// pathLogin = '/page/users/login/index'
|
||||
// Cache.set('login_back_url',path);
|
||||
}
|
||||
|
||||
|
||||
// #ifdef H5
|
||||
if (isWeixin()) {
|
||||
let urlData = location.pathname + location.search
|
||||
|
@ -49,13 +49,13 @@ export function _toLogin(push, pathLogin) {
|
|||
}
|
||||
} else {
|
||||
if (['/pages/user/index'].indexOf(login_back_url) == -1) {
|
||||
uni.navigateTo({
|
||||
url: '/pages/users/login/index'
|
||||
})
|
||||
// uni.navigateTo({
|
||||
// url: '/pages/users/login/index'
|
||||
// })
|
||||
}
|
||||
}
|
||||
// #endif
|
||||
|
||||
|
||||
if (['pages/user/index','/pages/user/index'].indexOf(login_back_url) == -1) {
|
||||
// #ifdef MP
|
||||
uni.navigateTo({
|
||||
|
|
|
@ -54,6 +54,9 @@ if (vconsole !== undefined && vconsole === md5Crmeb) {
|
|||
App.mpType = 'app'
|
||||
|
||||
|
||||
import uView from 'uni_modules/uview-ui'
|
||||
Vue.use(uView)
|
||||
uni.$u.config.unit = 'rpx'
|
||||
const app = new Vue({
|
||||
...App,
|
||||
store,
|
||||
|
|
|
@ -10,6 +10,18 @@
|
|||
// }
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/member_equity/index",
|
||||
"style": {
|
||||
"navigationBarTitleText": "会员申请"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/member_application/index",
|
||||
"style": {
|
||||
"navigationBarTitleText": "会员权益"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/order_addcart/order_addcart",
|
||||
"style": {
|
||||
|
@ -529,9 +541,9 @@
|
|||
"text": "分类"
|
||||
},
|
||||
{
|
||||
"pagePath": "pages/order_addcart/order_addcart",
|
||||
"iconPath": "static/images/3-001.png",
|
||||
"selectedIconPath": "static/images/3-002.png",
|
||||
"pagePath": "pages/member_application/index",
|
||||
"iconPath": "static/images/2-001.png",
|
||||
"selectedIconPath": "static/images/2-002.png",
|
||||
"text": "会员申请"
|
||||
},
|
||||
{
|
||||
|
@ -557,3 +569,4 @@
|
|||
}]
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -0,0 +1,198 @@
|
|||
<template>
|
||||
<view class="box">
|
||||
<view class="box-phone">
|
||||
<u--form :model="form" :rules="rules" ref="uForm" labelWidth="100">
|
||||
<u-form-item label="手机号" prop="phone">
|
||||
<u--input v-model="form.phone" placeholder="请输入您的手机号"></u--input>
|
||||
</u-form-item>
|
||||
<u-form-item label="手机号" prop="phone">
|
||||
<u--input v-model="form.phone" placeholder="请输入您的手机号"></u--input>
|
||||
</u-form-item>
|
||||
</u--form>
|
||||
</view>
|
||||
<view class="box-member">
|
||||
<view class="member-item" v-for="(item,index) in 3" :key="index">
|
||||
<view class="member-image">
|
||||
<image src='../../static/images/f.png'></image>
|
||||
</view>
|
||||
<view class="member-text">
|
||||
<text class="text-title">办理240得<text style="color: red;">360元</text></text>
|
||||
<text class="text-content">办理档次【240】元,可享连续12个月每个月返利30元</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="box-privilege">
|
||||
<view class="privilege-item" v-for="(item,index) in 4" :key="index">
|
||||
<image src='../../static/images/f.png'></image>
|
||||
<text class="privilege-text">
|
||||
开通立享大额话费返送。
|
||||
</text>
|
||||
</view>
|
||||
</view>
|
||||
<button class="box-submit" @click="submit">立即充值</button>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: "member_application",
|
||||
data() {
|
||||
return {
|
||||
form: {
|
||||
phone:''
|
||||
},
|
||||
rules: {
|
||||
phone: [
|
||||
{
|
||||
type: 'string',
|
||||
min: 2,
|
||||
max: 12,
|
||||
required: true,
|
||||
message: '请填写收件人名称',
|
||||
trigger: ['blur', 'change']
|
||||
},
|
||||
{
|
||||
message: '收件人名称不能为空',
|
||||
// 触发器可以同时用blur和change
|
||||
trigger: ['change', 'blur']
|
||||
}
|
||||
]
|
||||
}
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
|
||||
},
|
||||
onLoad() {
|
||||
|
||||
},
|
||||
methods: {
|
||||
submit() {
|
||||
|
||||
this.$refs.uForm.validate().then(res => {
|
||||
uni.$u.toast('校验通过')
|
||||
}).catch(errors => {
|
||||
uni.$u.toast('校验失败')
|
||||
})
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.box {
|
||||
// position: relative;
|
||||
padding: 0 24rpx;
|
||||
|
||||
.box-phone {
|
||||
.u-form-item{
|
||||
margin-bottom: 20rpx;
|
||||
}
|
||||
::v-deep .u-form-item__body {
|
||||
height: 100rpx;
|
||||
border-radius: 20rpx;
|
||||
padding: 0 30rpx;
|
||||
background: #fff;
|
||||
margin-bottom: 10rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.box-member {
|
||||
border-radius: 20rpx;
|
||||
width: 100%;
|
||||
margin-top: 40%;
|
||||
padding: 100rpx 20rpx 30rpx 20rpx;
|
||||
// position: absolute;
|
||||
// top: 20%;
|
||||
// left: 0;
|
||||
background: rgb(255, 210, 91);
|
||||
|
||||
.member-item {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
background: #fff;
|
||||
margin-bottom: 20rpx;
|
||||
padding: 30rpx;
|
||||
border-radius: 20rpx;
|
||||
|
||||
.member-image {
|
||||
width: 120rpx;
|
||||
height: 120rpx;
|
||||
border-radius: 34rpx;
|
||||
background: red;
|
||||
padding: 20rpx;
|
||||
|
||||
image {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
.member-text {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: space-between;
|
||||
flex: .9;
|
||||
|
||||
.text-title {
|
||||
margin-top: -16rpx;
|
||||
font-size: 40rpx;
|
||||
font-weight: bolder;
|
||||
transform: skew(-6deg, 0);
|
||||
}
|
||||
|
||||
.text-content {
|
||||
font-size: 24rpx;
|
||||
color: #aaa;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.box-privilege {
|
||||
border-radius: 20rpx;
|
||||
width: 100%;
|
||||
margin-top: 10%;
|
||||
padding: 100rpx 10rpx 30rpx 10rpx;
|
||||
background: rgb(255, 210, 91);
|
||||
display: flex;
|
||||
flex: 1;
|
||||
|
||||
.privilege-item {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
background: #fff;
|
||||
padding: 30rpx 20rpx;
|
||||
border-radius: 20rpx;
|
||||
margin: 10rpx;
|
||||
|
||||
image {
|
||||
width: 100rpx;
|
||||
height: 100rpx;
|
||||
border-radius: 50%;
|
||||
margin-bottom: 10rpx;
|
||||
}
|
||||
|
||||
.privilege-text {
|
||||
line-height: 36rpx;
|
||||
text-align: center;
|
||||
font-size: 24rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.box-submit {
|
||||
margin-top: 10%;
|
||||
margin-bottom: 6%;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
height: 90rpx;
|
||||
border-radius: 60rpx;
|
||||
background: royalblue;
|
||||
color: #fff;
|
||||
}
|
||||
}
|
||||
</style>
|
|
@ -0,0 +1,178 @@
|
|||
<template>
|
||||
<view class="box">
|
||||
<view class="box-member">
|
||||
<view class="member-left">
|
||||
<view class="left-title">
|
||||
<text>创盈普通会员</text>
|
||||
<text>152****0693</text>
|
||||
</view>
|
||||
<text>会员积分:240/640</text>
|
||||
<text>再升1级即可获得【XX】等6项权益</text>
|
||||
</view>
|
||||
<view class="member-right">
|
||||
<image src='../../static/images/f.png'></image>
|
||||
<text >
|
||||
立即续费
|
||||
</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="box-equity">
|
||||
<view class="equity-text">
|
||||
<text class="equity-title">我的会员权益</text>
|
||||
<text class="equity-look">查看权益></text>
|
||||
</view>
|
||||
<view class="equity-item" v-for="(item,index) in 2" :key="index">
|
||||
<view class="equity-grade">
|
||||
<text>办理档次【640元】档</text>
|
||||
<text>办理日期:2021.12.30</text>
|
||||
</view>
|
||||
<view class="equity-money">
|
||||
<view class="money-text">
|
||||
<text>已返回金额(元)</text>
|
||||
<view>
|
||||
<text>80</text>
|
||||
<text class="money-detailed">查看明细></text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="money-text">
|
||||
<text>已返回金额(元)</text>
|
||||
<text>80</text>
|
||||
</view>
|
||||
<view class="money-text">
|
||||
<text>已返回金额(元)</text>
|
||||
<text>80</text>
|
||||
</view>
|
||||
<view class="money-text">
|
||||
<text>已返回金额(元)</text>
|
||||
<text>80</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: "member_application",
|
||||
data() {
|
||||
return {
|
||||
form: {
|
||||
phone:''
|
||||
},
|
||||
rules: {
|
||||
phone: [
|
||||
{
|
||||
type: 'string',
|
||||
min: 2,
|
||||
max: 12,
|
||||
required: true,
|
||||
message: '请填写收件人名称',
|
||||
trigger: ['blur', 'change']
|
||||
},
|
||||
{
|
||||
message: '收件人名称不能为空',
|
||||
// 触发器可以同时用blur和change
|
||||
trigger: ['change', 'blur']
|
||||
}
|
||||
]
|
||||
}
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
|
||||
},
|
||||
onLoad() {
|
||||
|
||||
},
|
||||
methods: {
|
||||
submit() {
|
||||
|
||||
this.$refs.uForm.validate().then(res => {
|
||||
uni.$u.toast('校验通过')
|
||||
}).catch(errors => {
|
||||
uni.$u.toast('校验失败')
|
||||
})
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.box {
|
||||
padding: 10rpx 24rpx;
|
||||
|
||||
.box-member {
|
||||
border-radius: 20rpx;
|
||||
width: 100%;
|
||||
padding: 20rpx 20rpx 30rpx 20rpx;
|
||||
background: rgb(255, 210, 91);
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
.member-left{
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: space-between;
|
||||
flex: .8;
|
||||
}
|
||||
.member-right{
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
flex: .2;
|
||||
image {
|
||||
width: 100rpx;
|
||||
height: 100rpx;
|
||||
border-radius: 50%;
|
||||
margin-bottom: 10rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.box-equity {
|
||||
border-radius: 20rpx;
|
||||
width: 100%;
|
||||
margin-top: 10%;
|
||||
padding: 40rpx 10rpx 40rpx 10rpx;
|
||||
background: #fff;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
.equity-text{
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
.equity-title{
|
||||
font-size: 36rpx;
|
||||
font-weight: bolder;
|
||||
}
|
||||
}
|
||||
.equity-item {
|
||||
background: #eee;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: space-between;
|
||||
border-radius: 20rpx;
|
||||
margin: 10rpx;
|
||||
|
||||
.equity-grade{
|
||||
background: greenyellow;
|
||||
border-radius: 10rpx 10rpx;
|
||||
padding: 20rpx;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
}
|
||||
.equity-money {
|
||||
// background: #fff;
|
||||
// line-height: 36rpx;
|
||||
// text-align: center;
|
||||
// font-size: 24rpx;
|
||||
.equity-money{
|
||||
background: #fff;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
</style>
|
|
@ -14,6 +14,7 @@
|
|||
|
||||
/* 颜色变量 */
|
||||
|
||||
@import "uni_modules/uview-ui/theme.scss";
|
||||
/* 行为相关颜色 */
|
||||
$uni-color-primary: #007aff;
|
||||
$uni-color-success: #4cd964;
|
||||
|
@ -75,4 +76,4 @@ $uni-font-size-title:40upx;
|
|||
$uni-color-subtitle: #555555; // 二级标题颜色
|
||||
$uni-font-size-subtitle:36upx;
|
||||
$uni-color-paragraph: #3F536E; // 文章段落颜色
|
||||
$uni-font-size-paragraph:30upx;
|
||||
$uni-font-size-paragraph:30upx;
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
MIT License
|
||||
|
||||
Copyright (c) 2020 www.uviewui.com
|
||||
Copyright (c) 2023 www.uviewui.com
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
|
@ -18,4 +18,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
SOFTWARE.
|
||||
|
|
|
@ -1,4 +1,9 @@
|
|||
## 2.0.34(2022-09-25)
|
||||
## 2.0.36(2023-03-27)
|
||||
# uView2.0重磅发布,利剑出鞘,一统江湖
|
||||
|
||||
1. 重构`deepClone` & `deepMerge`方法
|
||||
2. 其他优化
|
||||
## 2.0.34(2022-09-24)
|
||||
# uView2.0重磅发布,利剑出鞘,一统江湖
|
||||
|
||||
1. `u-input`、`u-textarea`增加`ignoreCompositionEvent`属性
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
:zoom="zoom"
|
||||
:show="show"
|
||||
:customStyle="{
|
||||
borderRadius: '6px',
|
||||
borderRadius: '6px',
|
||||
overflow: 'hidden',
|
||||
marginTop: `-${$u.addUnit(negativeTop)}`
|
||||
}"
|
||||
|
@ -114,7 +114,7 @@
|
|||
* @event {Function} confirm 点击确认按钮时触发
|
||||
* @event {Function} cancel 点击取消按钮时触发
|
||||
* @event {Function} close 点击遮罩关闭出发,closeOnClickOverlay为true有效
|
||||
* @example <u-loadmore :status="status" icon-type="iconType" load-text="loadText" />
|
||||
* @example <u-modal :show="true" title="title" content="content"></u-modal>
|
||||
*/
|
||||
export default {
|
||||
name: 'u-modal',
|
||||
|
@ -146,7 +146,7 @@
|
|||
},
|
||||
// 点击遮罩
|
||||
// 从原理上来说,modal的遮罩点击,并不是真的点击到了遮罩
|
||||
// 因为modal依赖于popup的中部弹窗类型,中部弹窗比较特殊,虽有然遮罩,但是为了让弹窗内容能flex居中
|
||||
// 因为modal依赖于popup的中部弹窗类型,中部弹窗比较特殊,虽然有遮罩,但是为了让弹窗内容能flex居中
|
||||
// 多了一个透明的遮罩,此透明的遮罩会覆盖在灰色的遮罩上,所以实际上是点击不到灰色遮罩的,popup内部在
|
||||
// 透明遮罩的子元素做了.stop处理,所以点击内容区,也不会导致误触发
|
||||
clickHandler() {
|
||||
|
@ -201,12 +201,12 @@
|
|||
justify-content: center;
|
||||
align-items: center;
|
||||
height: 48px;
|
||||
|
||||
|
||||
&--confirm,
|
||||
&--only-cancel {
|
||||
border-bottom-right-radius: $u-modal-border-radius;
|
||||
}
|
||||
|
||||
|
||||
&--cancel,
|
||||
&--only-confirm {
|
||||
border-bottom-left-radius: $u-modal-border-radius;
|
||||
|
|
|
@ -83,7 +83,7 @@ export default {
|
|||
},
|
||||
// 文字装饰,下划线,中划线等,可选值 none|underline|line-through
|
||||
decoration: {
|
||||
tepe: String,
|
||||
type: String,
|
||||
default: uni.$u.props.text.decoration
|
||||
},
|
||||
// 外边距,对象、字符串,数值形式均可
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
// 此版本发布于2022-00-24
|
||||
const version = '2.0.34'
|
||||
// 此版本发布于2023-03-27
|
||||
const version = '2.0.36'
|
||||
|
||||
// 开发环境才提示,生产环境不会提示
|
||||
if (process.env.NODE_ENV === 'development') {
|
||||
|
|
|
@ -2,8 +2,8 @@ import test from './test.js'
|
|||
import { round } from './digit.js'
|
||||
/**
|
||||
* @description 如果value小于min,取min;如果value大于max,取max
|
||||
* @param {number} min
|
||||
* @param {number} max
|
||||
* @param {number} min
|
||||
* @param {number} max
|
||||
* @param {number} value
|
||||
*/
|
||||
function range(min = 0, max = 0, value = 0) {
|
||||
|
@ -13,7 +13,7 @@ function range(min = 0, max = 0, value = 0) {
|
|||
/**
|
||||
* @description 用于获取用户传递值的px值 如果用户传递了"xxpx"或者"xxrpx",取出其数值部分,如果是"xxxrpx"还需要用过uni.upx2px进行转换
|
||||
* @param {number|string} value 用户传递值的px值
|
||||
* @param {boolean} unit
|
||||
* @param {boolean} unit
|
||||
* @returns {number|string}
|
||||
*/
|
||||
function getPx(value, unit = false) {
|
||||
|
@ -41,7 +41,7 @@ function sleep(value = 30) {
|
|||
}
|
||||
/**
|
||||
* @description 运行期判断平台
|
||||
* @returns {string} 返回所在平台(小写)
|
||||
* @returns {string} 返回所在平台(小写)
|
||||
* @link 运行期判断平台 https://uniapp.dcloud.io/frame?id=判断平台
|
||||
*/
|
||||
function os() {
|
||||
|
@ -49,7 +49,7 @@ function os() {
|
|||
}
|
||||
/**
|
||||
* @description 获取系统信息同步接口
|
||||
* @link 获取系统信息同步接口 https://uniapp.dcloud.io/api/system/info?id=getsysteminfosync
|
||||
* @link 获取系统信息同步接口 https://uniapp.dcloud.io/api/system/info?id=getsysteminfosync
|
||||
*/
|
||||
function sys() {
|
||||
return uni.getSystemInfoSync()
|
||||
|
@ -179,22 +179,34 @@ function addUnit(value = 'auto', unit = uni?.$u?.config?.unit ?? 'px') {
|
|||
/**
|
||||
* @description 深度克隆
|
||||
* @param {object} obj 需要深度克隆的对象
|
||||
* @param cache 缓存
|
||||
* @returns {*} 克隆后的对象或者原值(不是对象)
|
||||
*/
|
||||
function deepClone(obj) {
|
||||
// 对常见的“非”值,直接返回原来值
|
||||
if ([null, undefined, NaN, false].includes(obj)) return obj
|
||||
if (typeof obj !== 'object' && typeof obj !== 'function') {
|
||||
// 原始类型直接返回
|
||||
return obj
|
||||
}
|
||||
const o = test.array(obj) ? [] : {}
|
||||
for (const i in obj) {
|
||||
if (obj.hasOwnProperty(i)) {
|
||||
o[i] = typeof obj[i] === 'object' ? deepClone(obj[i]) : obj[i]
|
||||
function deepClone(obj, cache = new WeakMap()) {
|
||||
if (obj === null || typeof obj !== 'object') return obj;
|
||||
if (cache.has(obj)) return cache.get(obj);
|
||||
let clone;
|
||||
if (obj instanceof Date) {
|
||||
clone = new Date(obj.getTime());
|
||||
} else if (obj instanceof RegExp) {
|
||||
clone = new RegExp(obj);
|
||||
} else if (obj instanceof Map) {
|
||||
clone = new Map(Array.from(obj, ([key, value]) => [key, deepClone(value, cache)]));
|
||||
} else if (obj instanceof Set) {
|
||||
clone = new Set(Array.from(obj, value => deepClone(value, cache)));
|
||||
} else if (Array.isArray(obj)) {
|
||||
clone = obj.map(value => deepClone(value, cache));
|
||||
} else if (Object.prototype.toString.call(obj) === '[object Object]') {
|
||||
clone = Object.create(Object.getPrototypeOf(obj));
|
||||
cache.set(obj, clone);
|
||||
for (const [key, value] of Object.entries(obj)) {
|
||||
clone[key] = deepClone(value, cache);
|
||||
}
|
||||
} else {
|
||||
clone = Object.assign({}, obj);
|
||||
}
|
||||
return o
|
||||
cache.set(obj, clone);
|
||||
return clone;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -205,24 +217,27 @@ function deepClone(obj) {
|
|||
*/
|
||||
function deepMerge(target = {}, source = {}) {
|
||||
target = deepClone(target)
|
||||
if (typeof target !== 'object' || typeof source !== 'object') return false
|
||||
if (typeof target !== 'object' || target === null || typeof source !== 'object' || source === null) return target;
|
||||
const merged = Array.isArray(target) ? target.slice() : Object.assign({}, target);
|
||||
for (const prop in source) {
|
||||
if (!source.hasOwnProperty(prop)) continue
|
||||
if (prop in target) {
|
||||
if (typeof target[prop] !== 'object') {
|
||||
target[prop] = source[prop]
|
||||
} else if (typeof source[prop] !== 'object') {
|
||||
target[prop] = source[prop]
|
||||
} else if (target[prop].concat && source[prop].concat) {
|
||||
target[prop] = target[prop].concat(source[prop])
|
||||
} else {
|
||||
target[prop] = deepMerge(target[prop], source[prop])
|
||||
}
|
||||
if (!source.hasOwnProperty(prop)) continue;
|
||||
const sourceValue = source[prop];
|
||||
const targetValue = merged[prop];
|
||||
if (sourceValue instanceof Date) {
|
||||
merged[prop] = new Date(sourceValue);
|
||||
} else if (sourceValue instanceof RegExp) {
|
||||
merged[prop] = new RegExp(sourceValue);
|
||||
} else if (sourceValue instanceof Map) {
|
||||
merged[prop] = new Map(sourceValue);
|
||||
} else if (sourceValue instanceof Set) {
|
||||
merged[prop] = new Set(sourceValue);
|
||||
} else if (typeof sourceValue === 'object' && sourceValue !== null) {
|
||||
merged[prop] = deepMerge(targetValue, sourceValue);
|
||||
} else {
|
||||
target[prop] = source[prop]
|
||||
merged[prop] = sourceValue;
|
||||
}
|
||||
}
|
||||
return target
|
||||
return merged;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -327,7 +342,7 @@ if (!String.prototype.padStart) {
|
|||
/**
|
||||
* @description 时间戳转为多久之前
|
||||
* @param {String|Number} timestamp 时间戳
|
||||
* @param {String|Boolean} format
|
||||
* @param {String|Boolean} format
|
||||
* 格式化规则如果为时间格式字符串,超出一定时间范围,返回固定的时间格式;
|
||||
* 如果为布尔值false,无论什么时间,都返回多久以前的格式
|
||||
* @returns {string} 转化后的内容
|
||||
|
@ -517,7 +532,7 @@ function priceFormat(number, decimals = 0, decimalPoint = '.', thousandsSeparato
|
|||
while (re.test(s[0])) {
|
||||
s[0] = s[0].replace(re, `$1${sep}$2`)
|
||||
}
|
||||
|
||||
|
||||
if ((s[1] || '').length < prec) {
|
||||
s[1] = s[1] || ''
|
||||
s[1] += new Array(prec - s[1].length + 1).join('0')
|
||||
|
@ -531,7 +546,7 @@ function priceFormat(number, decimals = 0, decimalPoint = '.', thousandsSeparato
|
|||
* 比如以30位阈值,那么300大于30,可以理解为用户想要的是300ms,而不是想花300s去执行一个动画
|
||||
* @param {String|number} value 比如: "1s"|"100ms"|1|100
|
||||
* @param {boolean} unit 提示: 如果是false 默认返回number
|
||||
* @return {string|number}
|
||||
* @return {string|number}
|
||||
*/
|
||||
function getDuration(value, unit = true) {
|
||||
const valueNum = parseInt(value)
|
||||
|
@ -650,6 +665,16 @@ function pages() {
|
|||
return pages
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取页面历史栈指定层实例
|
||||
* @param back {number} [0] - 0或者负数,表示获取历史栈的哪一层,0表示获取当前页面实例,-1 表示获取上一个页面实例。默认0。
|
||||
*/
|
||||
function getHistoryPage(back = 0) {
|
||||
const pages = getCurrentPages()
|
||||
const len = pages.length
|
||||
return pages[len - 1 + back]
|
||||
}
|
||||
|
||||
/**
|
||||
* @description 修改uView内置属性值
|
||||
* @param {object} props 修改内置props属性
|
||||
|
@ -701,5 +726,6 @@ export default {
|
|||
setProperty,
|
||||
page,
|
||||
pages,
|
||||
getHistoryPage,
|
||||
setConfig
|
||||
}
|
||||
|
|
|
@ -4,121 +4,121 @@
|
|||
*/
|
||||
|
||||
class Router {
|
||||
constructor() {
|
||||
// 原始属性定义
|
||||
this.config = {
|
||||
type: 'navigateTo',
|
||||
url: '',
|
||||
delta: 1, // navigateBack页面后退时,回退的层数
|
||||
params: {}, // 传递的参数
|
||||
animationType: 'pop-in', // 窗口动画,只在APP有效
|
||||
animationDuration: 300, // 窗口动画持续时间,单位毫秒,只在APP有效
|
||||
intercept: false // 是否需要拦截
|
||||
}
|
||||
// 因为route方法是需要对外赋值给另外的对象使用,同时route内部有使用this,会导致route失去上下文
|
||||
// 这里在构造函数中进行this绑定
|
||||
this.route = this.route.bind(this)
|
||||
}
|
||||
constructor() {
|
||||
// 原始属性定义
|
||||
this.config = {
|
||||
type: 'navigateTo',
|
||||
url: '',
|
||||
delta: 1, // navigateBack页面后退时,回退的层数
|
||||
params: {}, // 传递的参数
|
||||
animationType: 'pop-in', // 窗口动画,只在APP有效
|
||||
animationDuration: 300, // 窗口动画持续时间,单位毫秒,只在APP有效
|
||||
intercept: false // 是否需要拦截
|
||||
}
|
||||
// 因为route方法是需要对外赋值给另外的对象使用,同时route内部有使用this,会导致route失去上下文
|
||||
// 这里在构造函数中进行this绑定
|
||||
this.route = this.route.bind(this)
|
||||
}
|
||||
|
||||
// 判断url前面是否有"/",如果没有则加上,否则无法跳转
|
||||
addRootPath(url) {
|
||||
return url[0] === '/' ? url : `/${url}`
|
||||
}
|
||||
// 判断url前面是否有"/",如果没有则加上,否则无法跳转
|
||||
addRootPath(url) {
|
||||
return url[0] === '/' ? url : `/${url}`
|
||||
}
|
||||
|
||||
// 整合路由参数
|
||||
mixinParam(url, params) {
|
||||
url = url && this.addRootPath(url)
|
||||
// 整合路由参数
|
||||
mixinParam(url, params) {
|
||||
url = url && this.addRootPath(url)
|
||||
|
||||
// 使用正则匹配,主要依据是判断是否有"/","?","="等,如“/page/index/index?name=mary"
|
||||
// 如果有url中有get参数,转换后无需带上"?"
|
||||
let query = ''
|
||||
if (/.*\/.*\?.*=.*/.test(url)) {
|
||||
// object对象转为get类型的参数
|
||||
query = uni.$u.queryParams(params, false)
|
||||
// 因为已有get参数,所以后面拼接的参数需要带上"&"隔开
|
||||
return url += `&${query}`
|
||||
}
|
||||
// 直接拼接参数,因为此处url中没有后面的query参数,也就没有"?/&"之类的符号
|
||||
query = uni.$u.queryParams(params)
|
||||
return url += query
|
||||
}
|
||||
// 使用正则匹配,主要依据是判断是否有"/","?","="等,如“/page/index/index?name=mary"
|
||||
// 如果有url中有get参数,转换后无需带上"?"
|
||||
let query = ''
|
||||
if (/.*\/.*\?.*=.*/.test(url)) {
|
||||
// object对象转为get类型的参数
|
||||
query = uni.$u.queryParams(params, false)
|
||||
// 因为已有get参数,所以后面拼接的参数需要带上"&"隔开
|
||||
return url += `&${query}`
|
||||
}
|
||||
// 直接拼接参数,因为此处url中没有后面的query参数,也就没有"?/&"之类的符号
|
||||
query = uni.$u.queryParams(params)
|
||||
return url += query
|
||||
}
|
||||
|
||||
// 对外的方法名称
|
||||
async route(options = {}, params = {}) {
|
||||
// 合并用户的配置和内部的默认配置
|
||||
let mergeConfig = {}
|
||||
// 对外的方法名称
|
||||
async route(options = {}, params = {}) {
|
||||
// 合并用户的配置和内部的默认配置
|
||||
let mergeConfig = {}
|
||||
|
||||
if (typeof options === 'string') {
|
||||
// 如果options为字符串,则为route(url, params)的形式
|
||||
mergeConfig.url = this.mixinParam(options, params)
|
||||
mergeConfig.type = 'navigateTo'
|
||||
} else {
|
||||
mergeConfig = uni.$u.deepMerge(options, this.config)
|
||||
// 否则正常使用mergeConfig中的url和params进行拼接
|
||||
mergeConfig.url = this.mixinParam(options.url, options.params)
|
||||
}
|
||||
if (typeof options === 'string') {
|
||||
// 如果options为字符串,则为route(url, params)的形式
|
||||
mergeConfig.url = this.mixinParam(options, params)
|
||||
mergeConfig.type = 'navigateTo'
|
||||
} else {
|
||||
mergeConfig = uni.$u.deepMerge(this.config, options)
|
||||
// 否则正常使用mergeConfig中的url和params进行拼接
|
||||
mergeConfig.url = this.mixinParam(options.url, options.params)
|
||||
}
|
||||
|
||||
// 如果本次跳转的路径和本页面路径一致,不执行跳转,防止用户快速点击跳转按钮,造成多次跳转同一个页面的问题
|
||||
if (mergeConfig.url === uni.$u.page()) return
|
||||
// 如果本次跳转的路径和本页面路径一致,不执行跳转,防止用户快速点击跳转按钮,造成多次跳转同一个页面的问题
|
||||
if (mergeConfig.url === uni.$u.page()) return
|
||||
|
||||
if (params.intercept) {
|
||||
this.config.intercept = params.intercept
|
||||
}
|
||||
// params参数也带给拦截器
|
||||
mergeConfig.params = params
|
||||
// 合并内外部参数
|
||||
mergeConfig = uni.$u.deepMerge(this.config, mergeConfig)
|
||||
// 判断用户是否定义了拦截器
|
||||
if (typeof uni.$u.routeIntercept === 'function') {
|
||||
// 定一个promise,根据用户执行resolve(true)或者resolve(false)来决定是否进行路由跳转
|
||||
const isNext = await new Promise((resolve, reject) => {
|
||||
uni.$u.routeIntercept(mergeConfig, resolve)
|
||||
})
|
||||
// 如果isNext为true,则执行路由跳转
|
||||
isNext && this.openPage(mergeConfig)
|
||||
} else {
|
||||
this.openPage(mergeConfig)
|
||||
}
|
||||
}
|
||||
if (params.intercept) {
|
||||
this.config.intercept = params.intercept
|
||||
}
|
||||
// params参数也带给拦截器
|
||||
mergeConfig.params = params
|
||||
// 合并内外部参数
|
||||
mergeConfig = uni.$u.deepMerge(this.config, mergeConfig)
|
||||
// 判断用户是否定义了拦截器
|
||||
if (typeof uni.$u.routeIntercept === 'function') {
|
||||
// 定一个promise,根据用户执行resolve(true)或者resolve(false)来决定是否进行路由跳转
|
||||
const isNext = await new Promise((resolve, reject) => {
|
||||
uni.$u.routeIntercept(mergeConfig, resolve)
|
||||
})
|
||||
// 如果isNext为true,则执行路由跳转
|
||||
isNext && this.openPage(mergeConfig)
|
||||
} else {
|
||||
this.openPage(mergeConfig)
|
||||
}
|
||||
}
|
||||
|
||||
// 执行路由跳转
|
||||
openPage(config) {
|
||||
// 解构参数
|
||||
const {
|
||||
url,
|
||||
type,
|
||||
delta,
|
||||
animationType,
|
||||
animationDuration
|
||||
} = config
|
||||
if (config.type == 'navigateTo' || config.type == 'to') {
|
||||
uni.navigateTo({
|
||||
url,
|
||||
animationType,
|
||||
animationDuration
|
||||
})
|
||||
}
|
||||
if (config.type == 'redirectTo' || config.type == 'redirect') {
|
||||
uni.redirectTo({
|
||||
url
|
||||
})
|
||||
}
|
||||
if (config.type == 'switchTab' || config.type == 'tab') {
|
||||
uni.switchTab({
|
||||
url
|
||||
})
|
||||
}
|
||||
if (config.type == 'reLaunch' || config.type == 'launch') {
|
||||
uni.reLaunch({
|
||||
url
|
||||
})
|
||||
}
|
||||
if (config.type == 'navigateBack' || config.type == 'back') {
|
||||
uni.navigateBack({
|
||||
delta
|
||||
})
|
||||
}
|
||||
}
|
||||
// 执行路由跳转
|
||||
openPage(config) {
|
||||
// 解构参数
|
||||
const {
|
||||
url,
|
||||
type,
|
||||
delta,
|
||||
animationType,
|
||||
animationDuration
|
||||
} = config
|
||||
if (config.type == 'navigateTo' || config.type == 'to') {
|
||||
uni.navigateTo({
|
||||
url,
|
||||
animationType,
|
||||
animationDuration
|
||||
})
|
||||
}
|
||||
if (config.type == 'redirectTo' || config.type == 'redirect') {
|
||||
uni.redirectTo({
|
||||
url
|
||||
})
|
||||
}
|
||||
if (config.type == 'switchTab' || config.type == 'tab') {
|
||||
uni.switchTab({
|
||||
url
|
||||
})
|
||||
}
|
||||
if (config.type == 'reLaunch' || config.type == 'launch') {
|
||||
uni.reLaunch({
|
||||
url
|
||||
})
|
||||
}
|
||||
if (config.type == 'navigateBack' || config.type == 'back') {
|
||||
uni.navigateBack({
|
||||
delta
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export default (new Router()).route
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
"id": "uview-ui",
|
||||
"name": "uview-ui",
|
||||
"displayName": "uView2.0重磅发布,利剑出鞘,一统江湖",
|
||||
"version": "2.0.34",
|
||||
"version": "2.0.36",
|
||||
"description": "uView UI已完美兼容nvue,全面的组件和便捷的工具会让您信手拈来,如鱼得水",
|
||||
"keywords": [
|
||||
"uview",
|
||||
|
|
Loading…
Reference in New Issue