1、我发布的新增修改、编辑和重发按钮

2、编辑页面的接参逻辑和提交修改的逻辑
3、tabbar页面的发布活动的活动人数的input框的修改
This commit is contained in:
wangzimeng 2025-07-03 18:25:28 +08:00
parent e19474eed0
commit ded0c3cbd4
4 changed files with 637 additions and 152 deletions

View File

@ -2,7 +2,6 @@
export {};
; declare global {
const __VLS_intrinsicElements: __VLS_IntrinsicElements;
const __VLS_directiveBindingRestFields: { instance: null, oldValue: null, modifiers: any, dir: any };
const __VLS_unref: typeof import('vue').unref;
const __VLS_placeholder: any;
@ -24,10 +23,31 @@ export {};
N2 extends keyof __VLS_GlobalComponents ? N2 extends N0 ? Pick<__VLS_GlobalComponents, N0 extends keyof __VLS_GlobalComponents ? N0 : never> : { [K in N0]: __VLS_GlobalComponents[N2] } :
N3 extends keyof __VLS_GlobalComponents ? N3 extends N0 ? Pick<__VLS_GlobalComponents, N0 extends keyof __VLS_GlobalComponents ? N0 : never> : { [K in N0]: __VLS_GlobalComponents[N3] } :
{ [K in N0]: unknown };
type __VLS_FunctionalComponentProps<T, K> =
'__ctx' extends keyof __VLS_PickNotAny<K, {}> ? K extends { __ctx?: { props?: infer P } } ? NonNullable<P> : never
: T extends (props: infer P, ...args: any) => any ? P :
{};
type __VLS_FunctionalComponentCtx<T, K> = __VLS_PickNotAny<'__ctx' extends keyof __VLS_PickNotAny<K, {}>
? K extends { __ctx?: infer Ctx } ? NonNullable<Ctx> : never : any
, T extends (props: any, ctx: infer Ctx) => any ? Ctx : any
>;
type __VLS_FunctionalComponentProps<T, K> = '__ctx' extends keyof __VLS_PickNotAny<K, {}>
? K extends { __ctx?: { props?: infer P } } ? NonNullable<P> : never
: T extends (props: infer P, ...args: any) => any ? P
: {};
type __VLS_FunctionalComponent<T> = (props: (T extends { $props: infer Props } ? Props : {}) & Record<string, unknown>, ctx?: any) => __VLS_Element & {
__ctx?: {
attrs?: any,
slots?: T extends { $slots: infer Slots } ? Slots : Record<string, any>,
emit?: T extends { $emit: infer Emit } ? Emit : {},
props?: (T extends { $props: infer Props } ? Props : {}) & Record<string, unknown>,
expose?: (exposed: T) => void,
}
};
type __VLS_NormalizeSlotReturns<S, R = NonNullable<S> extends (...args: any) => infer K ? K : any> = R extends any[] ? {
[K in keyof R]: R[K] extends infer V
? V extends Element ? V
: V extends new (...args: any) => infer R ? ReturnType<__VLS_FunctionalComponent<R>>
: V extends (...args: any) => infer R ? R
: any
: never
} : R;
type __VLS_IsFunction<T, K> = K extends keyof T
? __VLS_IsAny<T[K]> extends false
? unknown extends T[K]
@ -35,13 +55,13 @@ export {};
: true
: false
: false;
type __VLS_NormalizeComponentEvent<Props, Events, onEvent extends keyof Props, Event extends keyof Events, CamelizedEvent extends keyof Events> = (
type __VLS_NormalizeComponentEvent<Props, Emits, onEvent extends keyof Props, Event extends keyof Emits, CamelizedEvent extends keyof Emits> = (
__VLS_IsFunction<Props, onEvent> extends true
? Props
: __VLS_IsFunction<Events, Event> extends true
? { [K in onEvent]?: Events[Event] }
: __VLS_IsFunction<Events, CamelizedEvent> extends true
? { [K in onEvent]?: Events[CamelizedEvent] }
: __VLS_IsFunction<Emits, Event> extends true
? { [K in onEvent]?: Emits[Event] }
: __VLS_IsFunction<Emits, CamelizedEvent> extends true
? { [K in onEvent]?: Emits[CamelizedEvent] }
: Props
) & Record<string, unknown>;
// fix https://github.com/vuejs/language-tools/issues/926
@ -67,11 +87,16 @@ export {};
}
>
>;
type __VLS_PrettifyGlobal<T> = { [K in keyof T]: T[K]; } & {};
type __VLS_PickFunctionalComponentCtx<T, K> = NonNullable<__VLS_PickNotAny<
'__ctx' extends keyof __VLS_PickNotAny<K, {}> ? K extends { __ctx?: infer Ctx } ? Ctx : never : any
, T extends (props: any, ctx: infer Ctx) => any ? Ctx : any
>>;
type __VLS_ResolveEmits<
Comp,
Emits,
TypeEmits = Comp extends { __typeEmits?: infer T } ? unknown extends T ? {} : import('vue').ShortEmitsToObject<T> : {},
NormalizedEmits = __VLS_NormalizeEmits<Emits> extends infer E ? string extends keyof E ? {} : E : never,
> = __VLS_SpreadMerge<NormalizedEmits, TypeEmits>;
type __VLS_ResolveDirectives<T> = {
[K in Exclude<keyof T, keyof __VLS_GlobalDirectives> & string as `v${Capitalize<K>}`]: T[K];
};
type __VLS_PrettifyGlobal<T> = { [K in keyof T as K]: T[K]; } & {};
type __VLS_UseTemplateRef<T> = Readonly<import('vue').ShallowRef<T | null>>;
function __VLS_getVForSourceType<T extends number | string | any[] | Iterable<any>>(source: T): [
@ -87,10 +112,8 @@ export {};
key: keyof T,
index: number,
][];
// @ts-ignore
function __VLS_getSlotParams<T>(slot: T): Parameters<__VLS_PickNotAny<NonNullable<T>, (...args: any[]) => any>>;
// @ts-ignore
function __VLS_getSlotParam<T>(slot: T): Parameters<__VLS_PickNotAny<NonNullable<T>, (...args: any[]) => any>>[0];
function __VLS_getSlotParameters<S, D extends S>(slot: S, decl?: D):
__VLS_PickNotAny<NonNullable<D>, (...args: any) => any> extends (...args: infer P) => any ? P : any[];
function __VLS_asFunctionalDirective<T>(dir: T): T extends import('vue').ObjectDirective
? NonNullable<T['created' | 'beforeMount' | 'mounted' | 'beforeUpdate' | 'updated' | 'beforeUnmount' | 'unmounted']>
: T extends (...args: any) => any
@ -98,19 +121,10 @@ export {};
: (arg1: unknown, arg2: unknown, arg3: unknown, arg4: unknown) => void;
function __VLS_makeOptional<T>(t: T): { [K in keyof T]?: T[K] };
function __VLS_asFunctionalComponent<T, K = T extends new (...args: any) => any ? InstanceType<T> : unknown>(t: T, instance?: K):
T extends new (...args: any) => any
? (props: (K extends { $props: infer Props } ? Props : any) & Record<string, unknown>, ctx?: any) => __VLS_Element & {
__ctx?: {
attrs?: any;
slots?: K extends { $slots: infer Slots } ? Slots : any;
emit?: K extends { $emit: infer Emit } ? Emit : any;
expose?(exposed: K): void;
props?: (K extends { $props: infer Props } ? Props : any) & Record<string, unknown>;
}
}
T extends new (...args: any) => any ? __VLS_FunctionalComponent<K>
: T extends () => any ? (props: {}, ctx?: any) => ReturnType<T>
: T extends (...args: any) => any ? T
: (_: {} & Record<string, unknown>, ctx?: any) => { __ctx?: { attrs?: any, expose?: any, slots?: any, emit?: any, props?: {} & Record<string, unknown> } };
: __VLS_FunctionalComponent<{}>;
function __VLS_functionalComponentArgsRest<T extends (...args: any) => any>(t: T): 2 extends Parameters<T>['length'] ? [any] : [];
function __VLS_asFunctionalElement<T>(tag: T, endTag?: T): (attrs: T & Record<string, unknown>) => void;
function __VLS_asFunctionalSlot<S>(slot: S): S extends () => infer R ? (props: {}) => R : NonNullable<S>;

View File

@ -43,8 +43,9 @@
style="width: 134rpx; height: 106rpx;position: absolute;right: 0;"></image>
<view class="flex" style="margin-top: 24rpx">
<view class="right flex flex-column" style="align-items: self-start;">
<span class="title white-space" style="padding-left: 30rpx;font-weight: 600;">{{ item.title }}</span>
<span class="title white-space"
style="padding-left: 30rpx;font-weight: 600;">{{ item.title }}</span>
<span class="first-image flex align-items"
style="margin-top: 20rpx; width: 100%;padding-left: 30rpx;">
<image :src="item.user.avatar"
@ -57,7 +58,7 @@
v-for="items_t in item.classes_cate">#{{ items_t }}</span>
</view>
</span>
<view class="flex flex-column" style="margin-top: 20rpx;padding-left: 30rpx;">
<view class="time flex align-items white-space">
<span class="time_tex" v-if="item.status == 2">{{
@ -67,27 +68,33 @@
style="margin: 0 20rpx">{{ dateWeeks(item.sign_start_time) }}</span>
<span v-if="item.status != 2"
style="margin: 0 20rpx 0 0">{{ dateWeeks(item.sign_start_time) }}
</span><span style="width: 1rpx;height: 22rpx;background: #323232;"></span>
</span><span
style="width: 1rpx;height: 22rpx;background: #323232;"></span>
<span class="white-space" style="margin-left: 20rpx; width: 260rpx">{{
item.address_detail }}</span>
</view>
</view>
<view class="flex align-items justify-center"
style="gap: 16rpx;width: 100%;margin-top: 20rpx;margin-bottom: 32rpx;">
<view class="imgs_con_div" v-for="(items_img, index) in item.images.slice(0, 3)"
:key="index">
<view class="imgs_con_div"
v-for="(items_img, index) in item.images.slice(0, 3)" :key="index">
<image class="imgs_con" :src="items_img"></image>
</view>
</view>
<view style="display: flex;align-items: center;justify-content: flex-end;gap: 20rpx;width: 96%;margin-bottom: 30rpx;">
<view class="part flex justify-center align-items" v-if="item.auth_status == 0 || item.status == 1"
<view
style="display: flex;align-items: center;justify-content: flex-end;gap: 20rpx;width: 96%;margin-bottom: 30rpx;"
v-if="item.auth_status == 0 || item.status == 1">
<view class="part flex justify-center align-items"
v-if="item.auth_status == 0 || item.status == 1"
@click.stop="editItem(item.id)"> 修改 </view>
</view>
</view>
</view>
<view class="bottom flex align-items" v-if="item.auth_status != 0"
@ -95,11 +102,12 @@
<view v-if="item.status == 1">
<image src="/static/index/dian.png"
style="width: 60rpx;height: 60rpx;vertical-align: middle;"></image>
<text style="margin-left: 20rpx;vertical-align: middle;font-size: 26rpx;">未开始</text>
<text
style="margin-left: 20rpx;vertical-align: middle;font-size: 26rpx;">未开始</text>
</view>
<view v-if="item.status == 2" style="display: flex;align-items: center;">
<u-avatar-group :urls="item.join_info.users" keyName="avatar" size="30" maxCount="1"
gap="0.4"></u-avatar-group>
<u-avatar-group :urls="item.join_info.users" keyName="avatar" size="30"
maxCount="1" gap="0.4"></u-avatar-group>
<image src="/static/index/dian.png" style="
width: 60rpx;
height: 60rpx;
@ -110,25 +118,45 @@
</view>
</view>
<!-- <view v-if="item.auth_status != 2 || item.status != 1" style="font-size: 26rpx; width: 24%;"> -->
<view v-if="item.status == 4 || item.status == 5" style="font-size: 26rpx; width: 24%;">
<view v-if="item.status == 4 || item.status == 5"
style="font-size: 26rpx; width: 24%;">
<text>核销</text>
<text style="color: orangered;">{{ item.verification_num }}</text>
<text>/{{ item.stock }}</text>
</view>
<view style="display: flex;align-items: center;justify-content: flex-end;gap: 20rpx;">
<view
style="display: flex;align-items: center;justify-content: flex-end;gap: 20rpx;width: 96%;">
<view v-if="item.status == 3 || item.status == 4"
class="part1 flex justify-center align-items" @click.stop="toHexiao"> 核销 </view>
<view class="part flex justify-center align-items" v-if="item.auth_status == 0 || item.status == 1"
class="part1 flex justify-center align-items" @click.stop="toHexiao"> 核销
</view>
<view class="part flex justify-center align-items"
v-if="item.auth_status == 0 || item.status == 1"
@click.stop="editItem(item.id)"> 修改 </view>
<view class="part flex justify-center align-items" v-if="item.auth_status != 2"
<view class="part flex justify-center align-items" v-if="item.status == -1 && item.auth_status != 2"
@click.stop="copyNewItem(item.id)"> 重发 </view>
<view class="part flex justify-center align-items" v-if="item.auth_status != 2 "
@click.stop="detail(item.id)"> 详情 </view>
</view>
<!-- <view style="display: flex;align-items: center;justify-content: flex-end;gap: 20rpx;width: 1005;">
<view class="part flex justify-center align-items" v-if="item.auth_status == 0 || item.status == 1"
@click.stop="editItem(item.id)"> 重发 </view>
<view class="part flex justify-center align-items" @click.stop="detail(item.id)"> 详情 </view>
</view> -->
</view>
<view style="padding: 30rpx;" v-if="item.auth_status == 2">
<view style="height: 160rpx;color: #323232;font-size: 26rpx;;padding: 20rpx;background: #F7F7F7;border: 1rpx solid #C1C1C1;border-radius: 18rpx 18rpx 18rpx 18rpx;">
<view style="padding: 30rpx;" v-if="item.auth_status == 2 ">
<view
style="height: 160rpx;color: #323232;font-size: 26rpx;;padding: 20rpx;background: #F7F7F7;border: 1rpx solid #C1C1C1;border-radius: 18rpx 18rpx 18rpx 18rpx;">
未通过原因{{item.reason}}
</view>
</view>
<view
style="display: flex;align-items: center;justify-content: flex-end;gap: 20rpx;width: 96%;margin-bottom: 30rpx;">
<view class="part1 flex justify-center align-items" v-if="item.auth_status == 2 "
@click.stop="cancelsOpen(item.id)"> 取消 </view>
<view class="part flex justify-center align-items" v-if="item.auth_status == 2 "
@click.stop="copyItem(item.id)"> 编辑 </view>
</view>
</view>
<view v-if="status == -2" @click.stop="detail(item.activity_id)">
<view class="flex" style="margin-top: 30rpx">
@ -140,7 +168,8 @@
}}</span>
</view>
</view>
<view style="height: 1px;width: 98%;background-color: #eeeeee;margin: 30rpx 0px;">
<view
style="height: 1px;width: 98%;background-color: #eeeeee;margin: 30rpx 0px;">
</view>
<view class="flex align-items" style="width: 100%;">
<view>
@ -160,7 +189,8 @@
style="color: #FF4810;font-weight: 600;">{{ item.real_refundprice }}</text>
</view>
<view v-if="item.before_status==-3"
style="font-size: 26rpx;color: #9C9C9C;">数量{{ item.num }}</view>
style="font-size: 26rpx;color: #9C9C9C;">数量{{ item.num }}
</view>
<view v-if="item.before_status!=-3"
style="font-size: 26rpx;color: #9C9C9C;">数量{{ item.auth_num }}
</view>
@ -187,7 +217,7 @@
</view>
</view>
</view>
<view class="flex flex-column flex-start align-items" v-if="hotList.length == 0"
style="margin-top: 300rpx;">
<image src="/static/message/activen.png" mode="" style="width: 180rpx;height: 180rpx;">
@ -195,7 +225,7 @@
<view style="margin-top: 30rpx;font-size: 28rpx;color: #323232;">暂无发布活动</view>
<view class="tofb" @click="tofb">前往发布</view>
</view>
</view>
</view>
</view>
@ -228,6 +258,29 @@
<!-- <u-loadmore :status="loadStatus" /> -->
<!-- 二次确认弹窗 -->
<u-popup :show="cancelsShow" mode="center" :round="10" :zIndex="99999" :custom-style="popupCancelStyle"
@close="cancelsClose" @open="cancelsOpen" :safeAreaInsetBottom="false" :closeable="false">
<view class="popupBox flex justify-start align-items flex-column">
<view class="pop-header flex align-items flex-column flex-start">
<span class="name white-space">是否确认取消活动</span>
<span class="price">
取消活动即删除活动后若再次举办活动需重新设置活动内容并提交平台审核
</span>
<!-- <image src="../../static/center/buy.png" mode="" style="width: 168rpx; height: 48rpx;">
</image> -->
</view>
<view class="popup-footer flex ">
<span @click="cancelsClose" class="span1">关闭</span>
<span @click="deleteItem()">确认取消</span>
<!-- <image src="../../static/center/price.png" mode="" style="width: 642rpx;height: 80rpx;"></image> -->
<!-- <u-loading-icon :vertical="true" v-if="uloadingShow"></u-loading-icon> -->
</view>
</view>
</u-popup>
</view>
</template>
@ -247,6 +300,15 @@
padding: "0",
borderRadius: "20rpx",
},
popupCancelStyle: {
width: '640rpx',
height: '414rpx',
margin: '0 auto', //
display: 'flex',
justifyContent: 'flex-start',
alignItems: 'center',
borderRadius: '50rpx'
},
sortList: [{
text: "按照价格排序",
value: ["acs", "desc"],
@ -305,20 +367,36 @@
//
auth_status: 0,
status: 0,
server_status: '3'
server_status: '3',
cancelsShow: false, //
deleteId: null, //id
};
},
onLoad(option) {
this.list = []
this.page = 1
if (option?.status) {
this.selected = option.status
this.getHotList(option.status);
} else {
this.getHotList('0');
}
// if (option?.status) {
// this.selected = option.status
// console.log('11');
// this.getHotList(option.status);
// } else {
// console.log('22');
// this.getHotList('0');
// }
},
onShow() {
this.list = []
this.page = 1
this.hotList = []
console.log('hotList',this.hotList);
// this.getHotList(this.selected);
if (this.status == -2) {
this.getAfterList();
} else {
this.getHotList(this.selected);
}
},
onPullDownRefresh() {
uni.showLoading({
title: '加载中...'
@ -355,7 +433,7 @@
url: "/packageA/afterSales/info?id=" + id,
});
},
//
//+
editItem(id) {
uni.navigateTo({
url: "/packageB/editAct?id=" + id,
@ -364,6 +442,67 @@
// url:"/pages/center/index?id=" + id,
// })//tabbar
},
//+
copyItem(id) {
const type = 1
uni.navigateTo({
url: "/packageB/editAct?original_activity_id=" + id + '&type=' + type,
});
// uni.switchTab({
// url:"/pages/center/index?id=" + id,
// })//tabbar
},
copyNewItem(id) {
const type = 2
uni.navigateTo({
url: "/packageB/editAct?original_activity_id=" + id + '&type=' + type,
});
// uni.switchTab({
// url:"/pages/center/index?id=" + id,
// })//tabbar
},
//
deleteItem() {
console.log('deleteItem', this.deleteId);
uni.$u.http.post('/api/school.new_activity/del', {
id: this.deleteId,
}).then(res => {
if (res.code == 1) {
this.cancelsShow = false
uni.showToast({
title: '删除成功',
icon: 'success',
duration: 2000
})
// this.getHotList('0');
this.toShlist('2')
// setTimeout(() => {
// uni.redirectTo({
// url: "/packageA/my/orderList"
// })
// }, 1000)
} else {
uni.showToast({
title: res.msg,
icon: 'none',
duration: 2000
})
}
}).catch(error => {});
},
//
cancelsOpen(id) {
this.cancelsShow = true
if (!this.deleteId) {
this.deleteId = id
}
console.log('cancelsOpen', this.deleteId);
},
cancelsClose() {
this.cancelsShow = false
this.deleteId = ""
},
//
detail(id) {
uni.navigateTo({
@ -381,16 +520,16 @@
},
//
getAfterList() {
var auth_status='';
var server_status=this.server_status;
var status='4,5,6'
var auth_status = '';
var server_status = this.server_status;
var status = '4,5,6'
//-1退
if(this.server_status== -1){
auth_status='2';
server_status='6';
status="4,5,6,7";
}else{
if (this.server_status == -1) {
auth_status = '2';
server_status = '6';
status = "4,5,6,7";
} else {
}
uni.$u.http
.get("/api/school.newworker.activity.order/order_list", {
@ -399,7 +538,7 @@
limit: 20,
server_status: server_status,
status: status,
auth_status:auth_status,
auth_status: auth_status,
},
})
.then((res) => {
@ -424,11 +563,12 @@
},
//
getHotList(val) {
console.log(val);
console.log('跳转接口', val, this.auth_status);
var auth_status = '';
if (val == 0) {
val = '1,2,3,4,5';
val = '1,2,3,4,5,-1';
auth_status = this.auth_status;
console.log('val==0', this.auth_status);
} else {
if (val == '-1') {
auth_status = '0,1,2';
@ -691,9 +831,11 @@
return this.selected === status;
},
toShlist(val) {
this.page = 1;
this.hotList = [];
this.auth_status = val
console.log('toShlist', val, this.auth_status, this.status);
this.getHotList(this.status);
},
toAfter(val) {
@ -1077,7 +1219,7 @@
margin-top: 80rpx;
margin-bottom: 70rpx;
min-height: 100vh;
padding:0rpx 30rpx;
padding: 0rpx 30rpx;
.hot-top {
@ -1318,4 +1460,116 @@
align-items: center;
justify-content: center;
}
.popupBox {
width: 640rpx;
height: 414rpx;
background-image: url("https://naweigetetest2.hschool.com.cn/dyqc/confirm2.png");
background-size: 100%;
background-repeat: no-repeat;
border-radius: 44rpx;
.pop-header {
width: 100%;
background-repeat: no-repeat;
background-position: left bottom;
height: 414rpx;
margin-top: 80rpx;
span {
font-family: PingFang SC, PingFang SC;
font-weight: 400;
font-size: 20rpx;
color: #343434;
}
.name {
width: 288rpx;
height: 36rpx;
font-family: PingFang SC Bold, PingFang SC Bold;
font-weight: 600;
font-size: 36rpx;
color: #202020;
line-height: 36rpx;
text-align: center;
font-style: normal;
text-transform: none;
}
.price {
width: 520rpx;
height: 68rpx;
margin-top: 30rpx;
font-family: PingFang SC, PingFang SC;
font-weight: 400;
font-size: 24rpx;
color: #202020;
line-height: 34rpx;
text-align: center;
font-style: normal;
text-transform: none;
}
}
.popup {
display: flex;
align-items: self-start;
justify-content: center;
width: 594rpx;
}
.popup-footer {
position: absolute;
left: 75rpx;
bottom: 60rpx;
span {
width: 230rpx;
height: 90rpx;
background: #323232;
border-radius: 200rpx 200rpx 200rpx 200rpx;
font-family: PingFang SC Regular, PingFang SC Regular;
font-weight: 400;
font-size: 32rpx;
color: #BBFC5B;
display: flex;
justify-content: center;
align-items: center;
}
.span1 {
background: rgba(193, 193, 193, 0.22);
color: #202020;
margin-right: 30rpx;
}
}
.line {
width: 642rpx;
height: 1rpx;
background: #F0F0F0;
box-shadow: 1rpx 1rpx 0rpx 0rpx rgba(102, 102, 102, 0.25);
border-radius: 0rpx 0rpx 0rpx 0rpx;
}
.selectTime.selected {
width: 288rpx;
height: 50rpx;
border-radius: 12rpx 12rpx 12rpx 12rpx;
background: #008CFF;
font-family: PingFang SC, PingFang SC;
font-weight: 800;
font-size: 24rpx;
color: #FFFFFF;
cursor: pointer;
margin: 24rpx 32rpx 0 0;
}
}
</style>

View File

@ -20,7 +20,7 @@
<view class="row flex align-items textarea_fb" style="margin-top: 25rpx;">
<u--textarea :confirmType="null" v-model="form.content" :maxlength="800"
<u--textarea :confirmType="null" v-model="form.content" :maxlength="800" type="text"
placeholder="描述一下活动的亮点、活动内容、推荐的人群、叫大家一起运动吧~" :height="120"
placeholder-class="bttop"></u--textarea>
</view>
@ -132,7 +132,10 @@
<u-upload @afterRead="uploadQun" :maxCount="1">
<view style="display: flex;justify-content: flex-end;align-items: center;">
<view v-if="qunQrcode == ''" style="color: #9C9C9C;font-size: 28rpx;">未上传</view>
<view v-if="qunQrcode != ''" style="color: #FF4810;font-size: 28rpx;">已上传</view>
<!-- <view v-if="qunQrcode != ''" style="color: #FF4810;font-size: 28rpx;">已上传</view> -->
<view v-if="qunQrcode != ''" style="color: #FF4810;font-size: 28rpx;">
<image :src="qunQrcode.url" style="width: 70rpx;height: 70rpx;"></image>
</view>
<u-icon name="arrow-right" color="#323232"></u-icon>
</view>
</u-upload>
@ -190,7 +193,7 @@
<view class="btns">
<view class="saveDraft">存草稿</view>
<!-- <view class="draftBox">草稿箱</view> -->
<view class="submitPublish">确认发布</view>
<view class="submitPublish" @click="apply()">确认发布</view>
</view>
<!-- <span class="flex align-items justify-center" @click="apply()" v-if="agreeAdd == true">确认发布</span>
<span class="flex align-items justify-center" v-if="agreeAdd == false"
@ -506,14 +509,26 @@
boxHeight: 0,
cardShow: false,
cardStatus: 0,
id: 0,
id: null,
original_activity_id: null,
type: null,
};
},
onLoad(options) {
console.log('options', options.id);
this.id = options.id
console.log('options', options.id,options.original_activity_id);
this.id = options.id
this.original_activity_id = options.original_activity_id
this.type = options.type
console.log('this.id', this.id);
console.log('this.original_activity_id ', this.original_activity_id );
console.log('this.type', this.type);
if (this.id || this.original_activity_id) {
this.agree = true
}
// if(options.original_activity_id) {
// this.original_activity_id = options.original_activity_id
// }
this.getDetail()
uni.hideShareMenu();
this.getAgreement()
this.getBqList();
@ -548,7 +563,7 @@
// })//tabbar
uni.$u.http.get('/api/school.new_activity/detail', {
params: {
id: this.id,
id: this.id || this.original_activity_id,
}
}).then(res => {
if (res.code == 1) {
@ -562,9 +577,48 @@
return acc;
}, []);
console.log('bqArray', bqArray);
// if (this.detail.user.realname) {
// this.detail.user.realname = this.detail.user.realname.slice(0, 1) + 'XX';
// }
let arrIdsName = bqArray.map((item) => {
return item.name
})
this.form.cate_idsName = arrIdsName.join(',');
console.log('cate_idsName', this.form.cate_idsName);
this.list = bqArray
this.form.cate_ids = res.data.detail.cate_ids;
console.log('cate_ids', this.form.cate_ids);
this.form.refund_idn = this.form.refund_info.title;
// fileList
this.fileList1 = this.form.images.map(url => ({
url: url,
status: 'success',
message: ''
}));
this.list1 = this.form.images
console.log('fileList1', this.fileList1);
this.qunQrcode = ({
url: this.form.image,
status: 'success',
message: ''
})
console.log('qunQrcode', this.qunQrcode);
if(!this.original_activity_id){
this.times_b_int = this.form.start_time_text
this.times_e_int = this.form.end_time_text
this.times_sinb_int = this.form.sign_start_time_text
this.times_sine_int = this.form.sign_end_time_text
}else{
this.times_b_int = ''
this.times_e_int = ''
this.times_sinb_int = ''
this.times_sine_int = ''
this.form.sign_time = ''
this.form.time = ''
}
if(this.type == 2){
this.form.title = ''
}
this.mobile = this.detail.user.mobile.slice(0, 3) + 'XXXX' + this.detail.user.mobile.slice(
7);
} else {
@ -628,9 +682,50 @@
this.form.refund_id = item.id;
this.form.refund_idn = item.title;
},
// async uploadQun(item) {
// const result = await this.uploadFilePromise(item.file.url, 'user');
// this.qunQrcode = result;
// console.log('qunQrcode',this,qunQrcode);
// },
async uploadQun(item) {
const result = await this.uploadFilePromise(item.file.url, 'user');
console.log(result);
this.qunQrcode = result;
console.log('qunQrcode', this.qunQrcode);
if (result.code != 1) {
uni.showToast({
title: result.msg,
icon: 'none',
duration: 2000
});
return;
} else {
// uni.$u.http.post('/api/school.new_activity/edit_qrcode', {
// id: this.id,
// image: result.data.url,
// }).then(res => {
// if (res.code == 1) {
// uni.showToast({
// title: '',
// icon: 'none',
// duration: 2000
// });
// this.getDetail();
// } else {
// uni.showToast({
// title: res.msg,
// icon: 'none',
// duration: 2000
// });
// }
// }).catch(error => {
// uni.showToast({
// title: '',
// icon: 'none',
// duration: 2000
// });
// });
}
},
//123
// tofb() {
@ -706,7 +801,7 @@
return item.name
})
this.form.cate_idsName = arr.join(',');
console.log('this.form.cate_idsName',this.form.cate_idsName);
console.log('this.form.cate_idsName', this.form.cate_idsName);
},
dateWeeks(e) {
return dateWeek(e);
@ -915,16 +1010,18 @@
// this.times_sinb = this.dateWeeks(e.value / 1000);
// this.birthShow = false
// this.birthShow1 = true
console.log(e)
console.log('报名时间:',e)
var time = e.time;
if (index == 1) {
//this.form.date = time;
this.times_sinb = time;
this.times_sinb_int = time;
console.log('报名时间11',e)
} else {
this.times_sine = time;
this.times_sine_int = time;
//this.dateShow = false
console.log('报名时间22',this.times_sine,this.times_sine_int)
this.form.sign_time = this.times_sinb + ' - ' + this.times_sine
}
},
@ -1175,6 +1272,7 @@
if (event.name === '1') {
// this.list1 = this.fileList1[0]?.url || ''; //
this.list1 = this.fileList1.map(item => item.url).join(',');
console.log('this.list1', this.list1);
}
}
},
@ -1265,8 +1363,11 @@
return;
}
let url = '/api/school.new_activity/add';
let urlEdit = '/api/school.new_activity/edit'
let params = {};
this.form.cate_ids = this.list.map(item => item.id).join(',');
if (!this.id) {
this.form.cate_ids = this.list.map(item => item.id).join(',');
}
//
if (this.form.address_detail == '') {
uni.showToast({
@ -1350,7 +1451,6 @@
});
return;
}
//
if (this.form.sign_time == '') {
uni.showToast({
@ -1380,6 +1480,8 @@
}
let hdtime = this.times_b_int + ' - ' + this.times_e_int;
let bmtime = this.times_sinb_int + ' - ' + this.times_sine_int;
console.log('formparams', this.form, this.form.cate_ids);
console.log('images',this.form.images);
params = {
title: this.form.title,
cate_ids: this.form.cate_ids,
@ -1395,66 +1497,176 @@
latitude: this.form.latitude,
address: this.form.address,
address_detail: this.form.address_detail,
image: this.qunQrcode
image: this.qunQrcode,
ids:this.id
}
uni.$u.http.post(url, params).then(res => {
if (res.code == 1) {
//
this.fileList1 = [];
this.agree = false;
this.list1 = '';
this.price = '';
this.priceName = '免费';
this.qunQrcode = '';
this.form = {
cate_ids: '',
//
cate_idsName: "",
content: '',
refund_id: '',
refund_idn: '',
price: 1,
stock: '',
sign_time: '',
time: '',
images: '',
title: '',
address: '',
latitude: '',
longitude: '',
address_detail: '', //
date: '', //
date1: '', //
birth: '', //
birth1: '', //
}
uni.showToast({
title: '发布成功!',
icon: 'none',
duration: 2000,
});
setTimeout(function() {
uni.navigateTo({
url: "/packageA/my/orderList"
})
}, 1000);
} else {
this.$u.toast(res.msg);
// uni.showToast({
// title: res.msg,
// icon: 'none',
// duration: 2000
// });
console.log('params00', params);
console.log('params01', this.id );
console.log('params01', this.original_activity_id );
//
if (this.id) {
console.log('编辑',params.images);
params.images = params.images.map(url => {
// 使URL
// const urlObj = new URL(url);
const urlObj = url.split('qingchunta.hschool.com.cn')[1]
console.log('urlObj', urlObj);
return urlObj;
}).join(',');
console.log('params', params.images);
// params.image = new URL(params.image).pathname ;
// params.image = params.image.replace(/^https?:\/\/[^/]+/, '')
// params.image
if (typeof params.image === 'object' && params.image.url) {
params.image = params.image.url; // url
}
}).catch(error => {
uni.showToast({
title: error.msg,
icon: 'none',
duration: 2000
//
params.image = params.image.replace(/^https?:\/\/[^/]+/, '');
console.log('params', params.image);
uni.$u.http.post(urlEdit, params).then(res => {
if (res.code == 1) {
//
this.fileList1 = [];
this.agree = false;
this.list1 = '';
this.price = '';
this.priceName = '免费';
this.qunQrcode = '';
this.form = {
cate_ids: '',
//
cate_idsName: "",
content: '',
refund_id: '',
refund_idn: '',
price: 1,
stock: '',
sign_time: '',
time: '',
images: '',
title: '',
address: '',
latitude: '',
longitude: '',
address_detail: '', //
date: '', //
date1: '', //
birth: '', //
birth1: '', //
}
uni.showToast({
title: '发布成功!',
icon: 'none',
duration: 2000,
});
setTimeout(function() {
uni.navigateBack()
// uni.navigateTo({
// url: "/packageA/my/orderList"
// })
}, 1000);
} else {
this.$u.toast(res.msg);
// uni.showToast({
// title: res.msg,
// icon: 'none',
// duration: 2000
// });
}
}).catch(error => {
uni.showToast({
title: error.msg,
icon: 'none',
duration: 2000
});
});
});
} else {
console.log('新增');
if(this.type == 1 || this.type == 2) {
params.images = params.images.map(url => {
// 使URL
// const urlObj = new URL(url);
const urlObj = url.split('qingchunta.hschool.com.cn')[1]
console.log('urlObj', urlObj);
return urlObj;
}).join(',');
console.log('params', params.images);
// params.image = new URL(params.image).pathname ;
// params.image = params.image.replace(/^https?:\/\/[^/]+/, '')
// params.image
if (typeof params.image === 'object' && params.image.url) {
params.image = params.image.url; // url
}
//
params.image = params.image.replace(/^https?:\/\/[^/]+/, '');
console.log('params', params.image);
}
uni.$u.http.post(url, params).then(res => {
if (res.code == 1) {
//
this.fileList1 = [];
this.agree = false;
this.list1 = '';
this.price = '';
this.priceName = '免费';
this.qunQrcode = '';
this.form = {
cate_ids: '',
//
cate_idsName: "",
content: '',
refund_id: '',
refund_idn: '',
price: 1,
stock: '',
sign_time: '',
time: '',
images: '',
title: '',
address: '',
latitude: '',
longitude: '',
address_detail: '', //
date: '', //
date1: '', //
birth: '', //
birth1: '', //
}
uni.showToast({
title: '发布成功!',
icon: 'none',
duration: 2000,
});
setTimeout(function() {
uni.navigateBack()
// uni.navigateTo({
// url: "/packageA/my/orderList"
// })
}, 1000);
} else {
this.$u.toast(res.msg);
// uni.showToast({
// title: res.msg,
// icon: 'none',
// duration: 2000
// });
}
}).catch(error => {
uni.showToast({
title: error.msg,
icon: 'none',
duration: 2000
});
});
}
}
}

View File

@ -146,8 +146,12 @@
<span style="color: #3D3D3D;">*</span>
活动人数
</span>
<span class="row-right">
<!-- <span class="row-right">
<input type="number" placeholder="请填写活动人数" placeholder-class="plasty" class="input"
v-model.number="form.stock" />
</span> -->
<span class="row-right">
<input type="number" placeholder="请填写活动人数" class="input"
v-model="form.stock" />
</span>
</view>
@ -1368,6 +1372,7 @@ uni.hideShareMenu();
this.fileList1 = [];
this.agree = false;
this.list1 = '';
this.list = [];
this.price = '';
this.priceName = '免费';
this.qunQrcode='';
@ -1580,7 +1585,7 @@ uni.hideShareMenu();
::v-deep .plasty {
text-align: right;
z-index: 10;
z-index: 10000;
color: #9c9c9c;
}