6
0
Fork 0

添加需求

hui.zhou
H 2022-09-08 17:35:33 +08:00
parent 15ba1ce3c6
commit c93fe4adbd
5 changed files with 459 additions and 151 deletions

View File

@ -1,23 +1,59 @@
<template>
<view class="px-30rpx pt-20rpx">
<!-- -->
<view class="text-txBase text-lg grid grid-cols-3 gap-y-20rpx bg-white box-shadow mb-base py-30rpx">
<view class="flex text-txBase items-center justify-center flex-col">
<view class="text-lg ">{{info.pre|numFormat}}</view>
<view class="mt-10rpx text-lg">预收益</view>
</view>
<view class="flex text-txBase items-center justify-center flex-col">
<view class="text-lg">{{info.receive |numFormat}}</view>
<view class="mt-10rpx text-lg">已获得</view>
</view>
<view class="flex text-txBase items-center justify-center flex-col">
<view class="text-lgprice-text">{{info.total |numFormat}}</view>
<view class="mt-10rpx ">总收益和</view>
</view>
</view>
<!-- -->
<view
class="sticky top-0 z-1500 bg-hex-F5F5F5 rounded-full grid grid-cols-3 text-28rpx text-hex-333 leading-40rpx py-10rpx">
<view class="text-center">时间</view>
<view class="text-center">备注</view>
<view class="text-center">返利</view>
<view class="text-center">状态</view>
</view>
<mescroll-body :height="height" ref="mescrollRef" @init="mescrollInit" @down="downCallback" @up="upCallback"
:down="downOption" :up="upOption">
<block v-for="(item,index) in dataList" :key="index">
<view class="grid grid-cols-3 text-28rpx text-h666 py-18rpx mt-16rpx ">
<view class="text-center line-1 ">{{item.created_at*1000 | date('yyyy-mm-dd')}}</view>
<view class="grid grid-cols-3 text-28rpx text-h666 py-18rpx mt-16rpx " @tap="show=true,selOrder=item.order">
<view class="text-center line-1 h-full" v-if="item.order">
{{item.order.sn}}
</view>
<!-- <view class="text-center line-1 ">{{item.created_at*1000 | date('yyyy-mm-dd')}}</view> -->
<view class="text-center price-text">{{item.money}}</view>
<!-- <view class="text-center ">{{item.status |StatusText}}</view> -->
<view class="text-center ">{{item.status_text}}</view>
</view>
<u-line></u-line>
</block>
</mescroll-body>
<!-- 备注弹窗 -->
<cu-modal v-model="show" title="详情">
<view class="p-base mt-10rpx" v-if="!!selOrder">
<view>
<text class="font-extrabold">订单号</text>
<text>{{selOrder.sn}}</text>
</view>
<view>
<text class="font-extrabold">总金额</text>
<text class="price-text">{{selOrder.total_amount}}</text>
</view>
<view>
<text class="font-extrabold">&nbsp;&nbsp;&nbsp;</text>
<text>{{selOrder.created_at*1000 | date('yyyy-mm-dd')}}</text>
</view>
</view>
</cu-modal>
</view>
</template>
@ -27,6 +63,9 @@
mixins: [MescrollMixin], // 使mixin
data() {
return {
info: {},
show: false,
selOrder: null,
downOption: {
auto: false,
},
@ -67,7 +106,14 @@
return windowHeight - statusBarHeight - 44 + 'px';
},
},
onLoad() {
this.getDate()
},
methods: {
async getDate() {
const res = await this.$api.get('/v1/profit/total')
this.info = res
},
downCallback() {
this.mescroll.resetUpScroll();
},
@ -96,4 +142,13 @@
page {
background: #ffffff;
}
.box-shadow {
box-shadow: 0px 2rpx 10rpx rgba(0, 0, 0, 0.15);
border-radius: 15rpx;
}
.word-break {
word-break: break-word; //
}
</style>

View File

@ -0,0 +1,255 @@
<template>
<view>
<loading-view v-if="isFirstLoading"></loading-view>
<!-- -->
<view class="bg-white rounded-xs mt-24rpx py-base px-40rpx" v-if="goodsList.length">
<block v-for="(item, index) in goodsList" :key="index">
<view>
<view class="flex">
<u-image border-radius="10" width="190rpx" height="190rpx" :src="item.sku.cover" :lazy-load="true">
</u-image>
<view class="flex-1 ml-16rpx w-0 flex justify-between flex-col">
<view>
<view>
<view class="line-2">{{ item.sku.name }}</view>
</view>
<view class="mt-10rpx">
<u-tag v-for="spec in item.sku.specs" :key="spec" size="mini" :text="spec" class="mr-6rpx"
shape="square" color="#A6A6A6" bg-color="transparent" mode="dark" />
</view>
</view>
<view class="flex items-end">
<view class="flex-1">
<view class="">
<view class="flex-1">{{ item.sku.sell_price }}</view>
</view>
<view class="flex items-center" v-if="item.sku.vip_price>0">
<view class="">{{ item.sku.vip_price }}</view>
<image class="w-58rpx h-58rpx ml-10rpx" src="/static/svg/svip.svg" mode=""></image>
</view>
</view>
<view class="text-lg"> x{{ item.quantity }} </view>
</view>
</view>
</view>
</view>
<view class="my-20rpx" v-if="index != goodsList.length - 1">
<u-line color="#E5E5E5" />
</view>
</block>
</view>
<!-- -->
<view class="bg-white mt-base rounded-xs px-40rpx py-20rpx" v-if="type != 'bargains' && type != 'points'">
<view class="flex items-center justify-between">
<view class="text-md">选择优惠卷</view>
<view class="flex items-center" @tap="onOpenCoupon">
<view class="text-md text-txGray mr-10rpx">{{ couponShowText }}</view>
<u-icon name="arrow-right" color="#808080" size="30"></u-icon>
</view>
</view>
<view class="text-gray-400 text-sm">因系统迁移优惠券问题请联系客服</view>
</view>
<!-- -->
<view class="bg-white mt-base rounded-xs pb-base px-40rpx pt-rowSm text-md">
<view class="flex items-center justify-between py-rowSm text-txBase" v-if="orderInfo.total_points>0">
<view>抵扣积分</view>
<view>{{ orderInfo.total_points }}</view>
</view>
<view class="flex items-center justify-between py-rowSm text-txBase">
<view>商品金额</view>
<view>{{ orderInfo.products_total_amount }}</view>
</view>
<view class="flex items-center justify-between py-rowSm text-txBase">
<view>运费</view>
<view>{{ orderInfo.shipping_fee }}</view>
</view>
<view class="flex items-center justify-between py-rowSm text-txBase"
v-if="type != 'bargains' && type != 'points'">
<view>优惠卷</view>
<view class="text-bgSubtitle">-{{ orderInfo.coupon_discount_amount }}</view>
</view>
<view class="flex items-center justify-between py-rowSm text-txBase">
<view>会员优惠</view>
<view class="text-bgSubtitle">-{{ orderInfo.vip_discount_amount }}</view>
</view>
<view class="flex items-center justify-between py-rowSm text-txBase" v-if="type == 'bargains'">
<view>砍价优惠</view>
<view class="text-bgSubtitle">-{{ orderInfo.bargain_amount }}</view>
</view>
<!-- -->
<view class="text-md border-t border-txBorder flex items-center justify-end py-base">
<view class="text-txBase">实付金额</view>
<view class="text-bgSubtitle">{{ orderInfo.total_amount }}</view>
</view>
<!-- -->
<view class="border-t border-txBorder pt-base text-md">
<textarea :adjust-position="false" v-model="remarks" class="min-h-130rpx w-full" placeholder-style="text-h999"
placeholder="订单备注:" maxlength="100" auto-height></textarea>
</view>
</view>
<cu-popup v-model="couponShow" mode="bottom" border-radius="20" closeable close-icon-size="24">
<view>
<view class="text-center py-30rpx text-lg">优惠券</view>
<scroll-view scroll-y="true" class="max-h-900rpx bg-hex-f6f6f6">
<coupon-list v-model="tempCouponId" :list="couponsList"></coupon-list>
</scroll-view>
<view class="p-base">
<view class="btn bg-hex-FB4A34 h-84rpx leading-84rpx text-white" @tap="onCounponChange">
<text>确定</text>
</view>
</view>
</view>
</cu-popup>
<!-- -->
<view class="h-130rpx"></view>
<!-- -->
<view class="flex items-center justify-end bg-white shadow-up fixed right-0 left-0 bottom-0 cu-bar tabbar">
<view class="text-md text-txBase">
合计: <text class="text-xl" v-if="orderInfo.total_points >0"> {{orderInfo.total_points}}+</text> <text
class="text-xl text-txSvip">{{ orderInfo.total_amount }}</text>
</view>
<view @tap="createOrder"
class="w-180rpx h-66rpx leading-66rpx text-center text-lg ml-40rpx text-white bg-primary rounded-lg mr-base">
提交订单
</view>
</view>
</view>
</template>
<script>
let btnLoading = false;
import {
add
} from '@/utils'
export default {
data() {
return {
couponId: '',
goodsList: [],
orderInfo: {},
remarks: '',
tempCouponId: '',
couponShow: false,
isFirstLoading: true,
cuId: null
};
},
onLoad({
id
}) {
this.cuId = id
},
computed: {
//
couponsList() {
return this.orderInfo?.coupons ?? [];
},
//
couponShowText() {
if (!!this.couponId) return this.currentCoupon?.name ?? '已过期';
if (this.couponsList.length) return `${this.couponsList.length}张可用`;
else return '当前无可用';
},
//
currentCoupon() {
const coupon = this.couponsList.find((e) => e.id == this.couponId);
return coupon;
},
},
onShow() {
setTimeout(() => {
this.getDetail();
}, 200)
},
methods: {
//
async createOrder() {
const params = {
coupon_id: this.couponId,
note: this.remarks,
order_pre: this.cuId
};
if (btnLoading) return;
btnLoading = true;
try {
const order = await this.$api.post(`v1/order/orders`, params);
if (order.status == 1 || order.status == 2) { //
this.$u.routeAuth({
url: '/pages/payment_results/payment_results',
type: 'redirectTo',
params: {
id: order.id,
type: 'success',
},
});
} else if (order.status == 0) { //
this.$u.routeAuth({
url: '/pages/confirm_payment/confirm_payment',
type: 'redirectTo',
params: {
id: order.id
}
});
}
} catch (error) {
// console.log(error);
} finally {
btnLoading = false;
}
},
//
onCounponChange() {
this.couponId = this.tempCouponId;
this.getDetail();
this.couponShow = false;
},
onOpenCoupon() {
if (this.couponsList.length == 0) return this.$u.toast('当前无可用优惠券')
this.couponShow = true
},
//
async getDetail() {
if (!this.isLogin) return uni.navigateTo({
url: '/pages/login/index'
});
const params = {
coupon_id: this.couponId,
order_pre: this.cuId
};
try {
let orderInfo = await this.$api.post('/v1/order/verify-order', params);
this.goodsList = orderInfo.products;
this.orderInfo = orderInfo;
} catch (error) {
console.log(error, '32');
uni.switchTab({
url: '/pages/index/index'
})
console.log(error);
} finally {
this.isFirstLoading = false
}
},
},
watch: {
couponShow(e) {
if (e) this.tempCouponId = this.couponId;
},
},
};
</script>
<style lang="scss" scoped>
.listChid:last-child {
border: 0;
}
</style>

View File

@ -3,53 +3,56 @@
<u-image class="flex-none" width="190" height="190" border-radius="10" :src="goods.cover" :lazy-load="true">
</u-image>
<view class="flex-1 ml-15rpx">
<view class="flex justify-between">
<view class=" flex-1 flex-none">
<view class="line-1 w-full text-txBase">{{goods.name}}</view>
<view class="price-text flex-1 text-txBase text-md mt-30rpx">{{goods.sell_price}}</view>
</view>
<view class="flex justify-between ">
<view class=" flex-1 max-w-200rpx">
<view class="line-1 text-txBase">{{goods.name}}</view>
<view class="price-text flex-1 text-txBase text-md mt-30rpx">{{goods.sell_price}}</view>
</view>
<view class="flex-1 w-0 line-1 ml-20rpx text-right ">
{{ specs.join(' ')}}
</view>
</view>
<view class="flex items-center justify-between mt-30rpx flex-1">
<view class="text-txBase text-md price-text">{{goods.vip_price}} vip</view>
</view>
<view class="flex items-center justify-between mt-30rpx flex-1">
<view class="text-txBase text-md price-text">{{goods.vip_price}} vip</view>
<view v-if="isAdd" class="bg-hex-ef4444 text-center px-20rpx py-8rpx text-white rounded-10rpx" @click="add"></view>
<view v-else>
<u-number-box :min="1" v-model="goods.num" @change="valChange">
</u-number-box>
</view>
</view>
<view v-if="isAdd" class="bg-hex-ef4444 text-center px-20rpx py-8rpx text-white rounded-10rpx" @click="add">
</view>
<view v-else>
<u-number-box :min="1" v-model="goods.num" @change="valChange">
</u-number-box>
</view>
</view>
</view>
</view>
</template>
<script>
export default {
props:{
isAdd:{
type:Boolean,
default:false
props: {
isAdd: {
type: Boolean,
default: false
},
goods:{
type:Object,
default:()=>{}
goods: {
type: Object,
default: () => {}
}
},
computed:{
specs(){
return this.goods?.specs??[]
computed: {
specs() {
return this.goods?.specs ?? []
}
},
methods:{
methods: {
//
add(){
this.$emit('addGood',this.goods.id)
add() {
this.$emit('addGood', this.goods.id)
},
//
valChange(e){
const {value}=e
this.$emit('numChange',this.goods.id,value)
valChange(e) {
const {
value
} = e
this.$emit('numChange', this.goods.id, value)
}
}
};

View File

@ -514,93 +514,100 @@
},
{
"root": "pageB",
"pages": [
"pages": [{
"path": "index/index",
"style": {
"navigationBarTitleText": "门店管理",
"enablePullDownRefresh": false,
"navigationStyle": "default"
}
},
{
"path": "index/index",
"style": {
"navigationBarTitleText": "门店管理",
"enablePullDownRefresh": false,
"navigationStyle": "default"
"path": "select_store/index",
"style": {
"navigationBarTitleText": "选择门店",
"enablePullDownRefresh": false,
"navigationStyle": "default"
}
},
{
"path": "select_product/index",
"style": {
"navigationBarTitleText": "选择商品",
"enablePullDownRefresh": false,
"navigationStyle": "default"
}
},
{
"path": "select_product/com_order",
"style": {
"navigationBarTitleText": "确认订单",
"enablePullDownRefresh": false,
"navigationStyle": "default"
}
},
{
"path": "code/index",
"style": {
"navigationBarTitleText": "二维码",
"enablePullDownRefresh": false,
"navigationStyle": "default"
}
},
{
"path": "user_order/index",
"style": {
"navigationBarTitleText": "用户提货",
"enablePullDownRefresh": false,
"navigationStyle": "default"
}
},
{
"path": "user_select_pro/index",
"style": {
"navigationBarTitleText": "选择商品",
"enablePullDownRefresh": false,
"navigationStyle": "default"
}
},
{
"path": "order_details/index",
"style": {
"navigationBarTitleText": "订单详情",
"enablePullDownRefresh": false
}
},
{
"path": "svip/index",
"style": {
"navigationBarTitleText": "",
"enablePullDownRefresh": false,
"navigationStyle": "default"
}
},
{
"path": "record/index",
"style": {
"navigationBarTitleText": "会员购买记录",
"enablePullDownRefresh": false,
"navigationStyle": "default"
}
},
{
"path": "comm_rec/index",
"style": {
"navigationBarTitleText": "推荐返利",
"enablePullDownRefresh": false,
"navigationStyle": "default"
}
},
{
"path": "lucky/index",
"style": {
"navigationBarTitleText": "活动",
"enablePullDownRefresh": false
}
}
},
{
"path": "select_store/index",
"style": {
"navigationBarTitleText": "选择门店",
"enablePullDownRefresh": false,
"navigationStyle": "default"
}
},
{
"path": "select_product/index",
"style": {
"navigationBarTitleText": "选择商品",
"enablePullDownRefresh": false,
"navigationStyle": "default"
}
},
{
"path": "code/index",
"style": {
"navigationBarTitleText": "二维码",
"enablePullDownRefresh": false,
"navigationStyle": "default"
}
},
{
"path": "user_order/index",
"style": {
"navigationBarTitleText": "用户提货",
"enablePullDownRefresh": false,
"navigationStyle": "default"
}
},
{
"path": "user_select_pro/index",
"style": {
"navigationBarTitleText": "选择商品",
"enablePullDownRefresh": false,
"navigationStyle": "default"
}
},
{
"path": "order_details/index",
"style": {
"navigationBarTitleText": "订单详情",
"enablePullDownRefresh": false
}
},
{
"path": "svip/index",
"style": {
"navigationBarTitleText": "",
"enablePullDownRefresh": false,
"navigationStyle": "default"
}
},
{
"path": "record/index",
"style": {
"navigationBarTitleText": "会员购买记录",
"enablePullDownRefresh": false,
"navigationStyle": "default"
}
},
{
"path": "comm_rec/index",
"style": {
"navigationBarTitleText": "推荐返利",
"enablePullDownRefresh": false,
"navigationStyle": "default"
}
},
{
"path": "lucky/index",
"style": {
"navigationBarTitleText": "活动",
"enablePullDownRefresh": false
}
}
]
}
],

View File

@ -8,17 +8,19 @@
import {
strToParams
} from '@/utils/tools';
import { wxMnpLogin } from '@/utils/login'
import {
wxMnpLogin
} from '@/utils/login'
export default {
data() {
return {
scene:null
scene: null
};
},
onLoad(e) {
console.log(111111111111111, e);
const scene = strToParams(decodeURIComponent(e.scene))
this.scene=scene
this.scene = scene
// invite_code
if (scene.invite_code) {
uni.setStorageSync('INVITE_CODE', scene.invite_code)
@ -49,39 +51,25 @@
// }, 1000)
}
//
else {
uni.switchTab({
url: '/pages/index/index'
})
else {
uni.switchTab({
url: '/pages/index/index'
})
}
},
onShow() {
if(this.scene.order_pre){
this.getOrder(this.scene.order_pre)
if (this.scene.order_pre) {
this.getOrder(this.scene.order_pre)
}
},
methods:{
//
async getOrder(id){
try{
const obj = {
id:id
}
const {order_id}=await this.$api.post(`/v1/order-pre/order`,obj,{
custom:{
silence:true
}
})
uni.redirectTo({
url: '/pages/order_details/index?id=' + order_id
})
}catch(err){
if(err.errcode==401){
uni.navigateTo({ url: '/pages/login/index' })
}
}
}
}
methods: {
//
async getOrder(id) {
uni.redirectTo({
url: '/pageB/select_product/com_order?id=' + id
})
}
}
}
</script>