小程序访问首页活动资讯

This commit is contained in:
mactj 2021-01-20 19:08:32 +08:00
parent 720185aef0
commit 97db9ec003
7 changed files with 87 additions and 25 deletions

View File

@ -83,7 +83,7 @@ public class AppActivityController extends BaseController {
*/
@PreAuthorize("@ss.hasPermi('winery:activity:query')" )
@GetMapping(value = "/{id}" )
public AjaxResult getInfo(@PathVariable("id" ) Long id) {
public AjaxResult getInfo(@PathVariable("id" ) String id) {
return AjaxResult.success(iAppActivityService.getById(id));
}
@ -113,7 +113,32 @@ public class AppActivityController extends BaseController {
@PreAuthorize("@ss.hasPermi('winery:activity:remove')" )
@Log(title = "活动" , businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}" )
public AjaxResult remove(@PathVariable Long[] ids) {
public AjaxResult remove(@PathVariable String[] ids) {
return toAjax(iAppActivityService.removeByIds(Arrays.asList(ids)) ? 1 : 0);
}
/**
* 查询活动列表(开放)
*/
@GetMapping("/open/list")
public TableDataInfo openList(AppActivity appActivity)
{
startPage();
LambdaQueryWrapper<AppActivity> lqw = Wrappers.lambdaQuery(appActivity);
if (StringUtils.isNotBlank(appActivity.getUrl())){
lqw.eq(AppActivity::getUrl ,appActivity.getUrl());
}
if (appActivity.getType() != null){
lqw.eq(AppActivity::getType ,appActivity.getType());
}
if (StringUtils.isNotBlank(appActivity.getImage())){
lqw.eq(AppActivity::getImage ,appActivity.getImage());
}
if (appActivity.getImageHeight() != null){
lqw.eq(AppActivity::getImageHeight ,appActivity.getImageHeight());
}
List<AppActivity> list = iAppActivityService.list(lqw);
return getDataTable(list);
}
}

View File

@ -23,6 +23,12 @@ class MallApis {
url: baseUrl + 'goods/goods_spec/listByIds/' + ids
})
}
getActivityList() {
return request.get({
url: baseUrl + 'winery/activity/open/list'
})
}
}
export default new MallApis()

View File

@ -4,7 +4,8 @@
*
*/
export const baseUrl = 'http://127.0.0.1:18989/'
export const baseUrl = 'http://36.1.50.18:18989/'
// export const baseUrl = 'http://127.0.0.1:18989/'
// export const baseUrl = 'https://mall.xiao4r.com/api/'

View File

@ -76,6 +76,13 @@
</style>
<wxs module="filters" lang="babel">
const parseImage = (imageKey) => {
return 'https://winery-1257413599.cos.ap-beijing.myqcloud.com/' + imageKey
}
module.exports.parseImage = parseImage;
</wxs>
<template>
<div class="container">
<image class="header-image" :src="navDefine.HOME_HEADER.image" />
@ -89,8 +96,8 @@
</van-col>
<van-col offset="1" span="10">
<div class="fxc" style="display: flex;flex-direction: column;">
<span style="font-size: 19px;">{{user.userInfo.nickName}}</span>
<span>{{user.mobile}}</span>
<span style="font-size: 19px;font-weight: bold;">{{user.userInfo.nickName}}</span>
<span style="font-size: 11px;color: #999999;">{{user.mobile}}</span>
</div>
</van-col>
<van-col offset="1" span="7">
@ -152,22 +159,35 @@
</div>
<div style="margin: 22px 2px 12px 2px; display: flex; align-items: center;">
<van-image :src="imageDefine.HOME_WINE_LAB" height="16px" width="5px" />
<span style="margin:0px 5px;font-weight: bold;">热门活动</span>
<!-- <div style="margin: 22px 2px 12px 2px; display: flex; align-items: center;">-->
<!-- <van-image :src="imageDefine.HOME_WINE_LAB" height="16px" width="5px" />-->
<!-- <span style="margin:0px 5px;font-weight: bold;">热门活动</span>-->
<!-- </div>-->
<!-- <van-image width="100%" height="96px" :src="navDefine.HOME_BANNER1.image"-->
<!-- @tap="onNavItem(navDefine.HOME_BANNER1)" />-->
<!-- <div style="margin: 22px 2px 12px 2px; display: flex; align-items: center;">-->
<!-- <van-image :src="imageDefine.HOME_WINE_LAB" height="16px" width="5px" />-->
<!-- <span style="margin:0px 5px;font-weight: bold;">每日精选</span>-->
<!-- </div>-->
<!-- <van-image width="100%" height="128px" :src="navDefine.HOME_BANNER2.image"-->
<!-- @tap="onNavItem(navDefine.HOME_BANNER2)" />-->
<div v-for="(item, index) in records">
<div style="margin: 22px 2px 12px 2px; display: flex; align-items: center;">
<van-image :src="imageDefine.HOME_WINE_LAB" height="16px" width="5px" />
<span style="margin:0px 5px;font-weight: bold;"> {{item.type === 1 ? '每日精选' : '热门活动'}}</span>
</div>
<van-image width="100%" :height="item.imageHeight + 'px'" :src="filters.parseImage(item.image)"
@tap="onWebItem(item)" />
</div>
<van-image width="100%" height="96px" :src="navDefine.HOME_BANNER1.image"
@tap="onNavItem(navDefine.HOME_BANNER1)" />
<div style="margin: 22px 2px 12px 2px; display: flex; align-items: center;">
<van-image :src="imageDefine.HOME_WINE_LAB" height="16px" width="5px" />
<span style="margin:0px 5px;font-weight: bold;">每日精选</span>
</div>
<van-image width="100%" height="128px" :src="navDefine.HOME_BANNER2.image"
@tap="onNavItem(navDefine.HOME_BANNER2)" />
<!-- <div class="column-record-item" v-for="(item, index) in columnRecord" @tap="onNavItem(navDefine.HOME_BANNER2)">-->
<!-- <van-image width="100%" height="128px" :src="navDefine.HOME_BANNER2.image" />-->
<!-- <div class="column-record-item-text">-->
@ -194,6 +214,7 @@ import appManager from '../../../appManager'
import { navDefine } from '../../../store/constant/navDefine'
import xiao4rApis from '../../../apis/xiao4rApis'
import { webViewPage } from '../../../store/constant/nav/pages'
import mallApis from '../../../apis/mallApis'
wepy.component({
store,
@ -206,7 +227,8 @@ wepy.component({
createTime: '2000-11-11',
image: 'https://www.xiao4r.com/xiao4rstatic/img/doctor.png'
}
]
],
records: []
},
@ -222,17 +244,23 @@ wepy.component({
methods: {
onBuy() {
this.$emit('changeTab', 1)
},
onShoppingCar() {
appManager.navigateTo(navDefine.SHOPPING_CAR_LIST)
},
onWebItem(item) {
appManager.navWeb(item.url)
}
},
ready() {
mallApis.getActivityList().then(r => {
this.records = r.rows
})
}
})
</script>

View File

@ -19,6 +19,7 @@ export const imageDefine = {
SHOPPING_BANNER: imgbaseUrl + 'shopping/list-banner.png',
LIST_BAG: imgbaseUrl + 'shopping/list-bag.png',
MY_HEADER: imgbaseUrl + 'my/header.png',
BBS_BG: imgbaseUrl + 'bbs/bg.gif'
BBS_BG: imgbaseUrl + 'bbs/bg.gif',
USER: imgbaseUrl + 'user.png'
}

View File

@ -11,8 +11,8 @@ export default new Vuex.Store({
openid: '',
mobile: '',
userInfo: {
nickName: '未注册用户',
avatarUrl: 'https://img.yzcdn.cn/vant/cat.jpeg'
nickName: '游客',
avatarUrl: imageDefine.USER
},
token: '',
company: '企业名称',

View File

@ -116,6 +116,7 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter
.antMatchers("/druid/**").anonymous()
.antMatchers("/winery/mini/user/**").permitAll()
.antMatchers("/winery/order/pay/**").permitAll()
.antMatchers("/winery/activity/open/**").permitAll()
// 除上面外的所有请求全部需要鉴权认证
.anyRequest().authenticated()
.and()