mirror of
http://git.coreshop.cn/jianweie/coreshoppro.git
synced 2025-12-06 18:33:27 +08:00
【新增】前端个人中心增加【万能表单】入口,并可以通过后台开启或关闭。
This commit is contained in:
@@ -584,6 +584,12 @@ namespace CoreCms.Net.Configuration
|
||||
/// </summary>
|
||||
public const string ShowCalendar = "showCalendar";
|
||||
|
||||
/// <summary>
|
||||
/// 显示自定义表单按钮
|
||||
/// </summary>
|
||||
public const string ShowCustomForm = "showCustomForm";
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 显示首页弹窗
|
||||
/// </summary>
|
||||
|
||||
@@ -57,6 +57,7 @@ namespace CoreCms.Net.Configuration
|
||||
di.Add(SystemSettingConstVars.ShowGroupBuying, new DictionaryKeyValues() { sKey = "显示团购按钮", sValue = "2" });
|
||||
di.Add(SystemSettingConstVars.ShowSolitaire, new DictionaryKeyValues() { sKey = "显示接龙按钮", sValue = "2" });
|
||||
di.Add(SystemSettingConstVars.ShowCalendar, new DictionaryKeyValues() { sKey = "显示签到按钮", sValue = "2" });
|
||||
di.Add(SystemSettingConstVars.ShowCustomForm, new DictionaryKeyValues() { sKey = "显示自定义表单按钮", sValue = "2" });
|
||||
|
||||
di.Add(SystemSettingConstVars.ShowIndexPopupWindow, new DictionaryKeyValues() { sKey = "显示首页弹窗", sValue = "2" });
|
||||
|
||||
|
||||
@@ -328,7 +328,10 @@ const install = (Vue, vm) => {
|
||||
let getInviteQRCode = (params, config = {}) => http.post('/Api/Store/GetInviteQrCode', params, { custom: { methodName: 'store.getinviteqrcode', needToken: false } });
|
||||
// 生成海报
|
||||
let createPoster = (params, config = {}) => http.post('/Api/User/GetPoster', params, { custom: { methodName: 'user.getposter', needToken: false } });
|
||||
//============================================================//万能表单
|
||||
|
||||
//获取表单列表
|
||||
let getFormList = (params, config = {}) => http.post('/Api/Form/GetList', params, { custom: { methodName: 'form.getformdetial', needToken: false } });
|
||||
//获取表单详情
|
||||
let getFormDetial = (params, config = {}) => http.post('/Api/Form/GetFormDetial', params, { custom: { methodName: 'form.getformdetial', needToken: false } });
|
||||
//============================================================//提交表单
|
||||
let addSubmitForm = (params, config = {}) => http.post('/Api/Form/AddSubmit', params, { custom: { methodName: 'form.addsubmit', needToken: false } });
|
||||
@@ -571,6 +574,7 @@ const install = (Vue, vm) => {
|
||||
getInviteQRCode,
|
||||
createPoster,
|
||||
getFormDetial,
|
||||
getFormList,
|
||||
addSubmitForm,
|
||||
lotteryConfig,
|
||||
lottery,
|
||||
|
||||
@@ -159,7 +159,14 @@
|
||||
"path": "details/details",
|
||||
"style": {
|
||||
"navigationBarTextStyle": "black",
|
||||
"navigationBarTitleText": "万能表单"
|
||||
"navigationBarTitleText": "表单详情"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "list/list",
|
||||
"style": {
|
||||
"navigationBarTextStyle": "black",
|
||||
"navigationBarTitleText": "表单列表"
|
||||
}
|
||||
}
|
||||
]
|
||||
|
||||
110
CoreCms.Net.Uni-App/CoreShop/pages/form/list/list.vue
Normal file
110
CoreCms.Net.Uni-App/CoreShop/pages/form/list/list.vue
Normal file
@@ -0,0 +1,110 @@
|
||||
<template>
|
||||
<view>
|
||||
<u-toast ref="uToast" /><u-no-network></u-no-network>
|
||||
<u-navbar title="万能表单" safeAreaInsetTop fixed placeholder>
|
||||
<view class="coreshop-navbar-left-slot" slot="left">
|
||||
<u-icon name="arrow-left" size="19" @click="goNavigateBack"></u-icon>
|
||||
<u-line direction="column" :hairline="false" length="16" margin="0 8px"></u-line>
|
||||
<u-icon name="home" size="22" @click="goHome"></u-icon>
|
||||
</view>
|
||||
<view slot="right">
|
||||
</view>
|
||||
</u-navbar>
|
||||
<block v-if="list.length > 0">
|
||||
<view class="coreshop-bg-white coreshop-margin-10">
|
||||
<view class="coreshop-flex coreshop-solid-bottom coreshop-justify-between coreshop-flex-nowrap coreshop-padding-top-10 coreshop-padding-bottom-10 coreshop-padding-left-10 coreshop-padding-right-10" v-for="item in list" :key="item.id" @click="goDetail(item.id)">
|
||||
<view class="coreshop-flex coreshop-flex-nowrap">
|
||||
<u--image width="25px" height="25px" :src="item.image" mode="aspectFill" :showLoading="true"></u--image>
|
||||
<view class="u-line-2 coreshop-padding-left-5 coreshop-font-14">{{item.name}}</view>
|
||||
</view>
|
||||
<view class="coreshop-text-gray coreshop-text-right coreshop-justify-end">
|
||||
<u-icon name="arrow-right-double"></u-icon>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view>
|
||||
<u-loadmore :status="status" :icon-type="iconType" :load-text="loadText" margin-top="0" margin-bottom="20" class="coreshop-padding-top-10" />
|
||||
</view>
|
||||
</block>
|
||||
<!-- 无数据时默认显示 -->
|
||||
<view class="coreshop-emptybox" v-else>
|
||||
<u-empty :icon="$globalConstVars.apiFilesUrl+'/static/images/empty/data.png'" icon-size="150" text="暂无数据" mode="list"></u-empty>
|
||||
</view>
|
||||
<!-- 登录提示 -->
|
||||
<coreshop-login-modal></coreshop-login-modal>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
export default {
|
||||
|
||||
data() {
|
||||
return {
|
||||
page: 1,
|
||||
limit: 10,
|
||||
list: [],
|
||||
status: 'loadmore',
|
||||
iconType: 'flower',
|
||||
loadText: {
|
||||
loadmore: '轻轻上拉',
|
||||
loading: '努力加载中',
|
||||
nomore: '实在没有了'
|
||||
},
|
||||
};
|
||||
},
|
||||
onLoad(options) {
|
||||
this.getFormList();
|
||||
},
|
||||
onReachBottom() {
|
||||
if (this.status === 'loadmore') {
|
||||
this.getFormList();
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
getFormList() {
|
||||
let data = {
|
||||
page: this.page,
|
||||
limit: this.limit,
|
||||
};
|
||||
this.status = 'loading';
|
||||
this.$u.api.getFormList(data).then(res => {
|
||||
if (res.status) {
|
||||
if (res.data.length > 0) {
|
||||
const _list = res.data;
|
||||
|
||||
for (var i = 0; i < _list.length; i++) {
|
||||
if (_list[i].images) {
|
||||
_list[i].image = _list[i].images.split(',')[0];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
this.list = [...this.list, ..._list];
|
||||
if (res.data.count > this.list.length) {
|
||||
this.status = 'loadmore';
|
||||
this.page++;
|
||||
} else {
|
||||
// 数据已加载完毕
|
||||
this.status = 'nomore';
|
||||
}
|
||||
} else {
|
||||
// 数据已加载完毕
|
||||
this.status = 'nomore';
|
||||
}
|
||||
|
||||
} else {
|
||||
// 接口请求出错了
|
||||
this.$u.toast(res.msg);
|
||||
}
|
||||
});
|
||||
},
|
||||
goDetail(id) {
|
||||
this.$u.route('/pages/form/details/details', { id: id });
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
</style>
|
||||
@@ -361,6 +361,12 @@
|
||||
router: '/pages/activity/checkIn/checkIn/checkIn',
|
||||
showItem: false
|
||||
},
|
||||
customForm: {
|
||||
name: '万能表单',
|
||||
icon: 'file-text',
|
||||
router: '/pages/form/list/list',
|
||||
showItem: false
|
||||
},
|
||||
},
|
||||
other: {
|
||||
invite: {
|
||||
@@ -499,9 +505,10 @@
|
||||
_this.vas.solitaire.showItem = _this.config.showSolitaire == 1;
|
||||
//签到
|
||||
_this.vas.calendar.showItem = _this.config.showCalendar == 1;
|
||||
//自定义表单
|
||||
_this.vas.customForm.showItem = _this.config.showCustomForm == 1;
|
||||
//显示我的发票
|
||||
_this.utilityMenus.myInvoice.showItem = _this.config.invoiceSwitch == 1;
|
||||
|
||||
//获取用户信息
|
||||
_this.getUserInfo();
|
||||
},
|
||||
|
||||
@@ -144,6 +144,13 @@
|
||||
<input type="radio" lay-filter="showCalendar" name="showCalendar" value="2" title="不开启" {{d.data.configs['showCalendar']['sValue']==="2" ? 'checked':''}}>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">{{d.data.configs['showCustomForm']['sKey']}}:</label>
|
||||
<div class="layui-input-inline layui-inline-7">
|
||||
<input type="radio" lay-filter="showCustomForm" name="showCustomForm" value="1" title="开启" {{d.data.configs['showCustomForm']['sValue']==="1" ? 'checked':''}}>
|
||||
<input type="radio" lay-filter="showCustomForm" name="showCustomForm" value="2" title="不开启" {{d.data.configs['showCustomForm']['sValue']==="2" ? 'checked':''}}>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label"> </label>
|
||||
<div class="layui-input-block">
|
||||
|
||||
@@ -109,7 +109,8 @@ namespace CoreCms.Net.Web.WebApi.Controllers
|
||||
var showGroupBuying = CommonHelper.GetConfigDictionary(allConfigs, SystemSettingConstVars.ShowGroupBuying).ObjectToInt(2); //显示团购按钮
|
||||
var showSolitaire = CommonHelper.GetConfigDictionary(allConfigs, SystemSettingConstVars.ShowSolitaire).ObjectToInt(2); //显示接龙按钮
|
||||
var showCalendar = CommonHelper.GetConfigDictionary(allConfigs, SystemSettingConstVars.ShowCalendar).ObjectToInt(2); //显示签到按钮
|
||||
var showIndexPopupWindow = CommonHelper.GetConfigDictionary(allConfigs, SystemSettingConstVars.ShowIndexPopupWindow).ObjectToInt(2); //显示签到按钮
|
||||
var showIndexPopupWindow = CommonHelper.GetConfigDictionary(allConfigs, SystemSettingConstVars.ShowIndexPopupWindow).ObjectToInt(2); //显示首页弹窗
|
||||
var showCustomForm = CommonHelper.GetConfigDictionary(allConfigs, SystemSettingConstVars.ShowCustomForm).ObjectToInt(2); //显示自定义表单按钮
|
||||
|
||||
var imageMax = 5; //前端上传图片最多几张
|
||||
var storeSwitch = CommonHelper.GetConfigDictionary(allConfigs, SystemSettingConstVars.StoreSwitch).ObjectToInt(); //开启门店自提状态
|
||||
@@ -241,7 +242,8 @@ namespace CoreCms.Net.Web.WebApi.Controllers
|
||||
showGroupBuying,
|
||||
showSolitaire,
|
||||
showCalendar,
|
||||
showIndexPopupWindow
|
||||
showIndexPopupWindow,
|
||||
showCustomForm
|
||||
};
|
||||
jm.data = model;
|
||||
return jm;
|
||||
|
||||
@@ -42,6 +42,26 @@ namespace CoreCms.Net.Web.WebApi.Controllers
|
||||
}
|
||||
|
||||
|
||||
#region 获取表单列表
|
||||
/// <summary>
|
||||
/// 获取表单列表
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
public async Task<WebApiCallBack> GetList([FromBody] FMPageByIntId entity)
|
||||
{
|
||||
var jm = new WebApiCallBack();
|
||||
|
||||
var list = await _formServices.QueryPageAsync(p => p.endDateTime >= DateTime.Now, p => p.sort, OrderByType.Desc, entity.page, entity.limit);
|
||||
jm.status = true;
|
||||
jm.data = list;
|
||||
|
||||
return jm;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
#region 万能表单/获取活动商品详情=============================================================================
|
||||
/// <summary>
|
||||
/// 万能表单/获取活动商品详情
|
||||
@@ -56,7 +76,6 @@ namespace CoreCms.Net.Web.WebApi.Controllers
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
||||
#region 万能表单/提交表单=============================================================================
|
||||
/// <summary>
|
||||
/// 万能表单/提交表单
|
||||
|
||||
Reference in New Issue
Block a user