init
This commit is contained in:
parent
01669b8c2b
commit
c5a47ab3a3
4
app.js
4
app.js
@ -1,8 +1,8 @@
|
||||
import updateManager from './common/updateManager';
|
||||
|
||||
export const ServerBasePath = 'http://localhost:8888/api/';
|
||||
// export const ServerBasePath = 'http://localhost:8888/api/';
|
||||
// export const ServerBasePath = 'http://192.168.1.102:8888/api/';
|
||||
// export const ServerBasePath = 'http://mall.api.aerwen.net/api/';
|
||||
export const ServerBasePath = 'http://emo-api.aerwen.net/api/';
|
||||
|
||||
App({
|
||||
onLaunch: function () {},
|
||||
|
@ -1,5 +1,8 @@
|
||||
/* eslint-disable no-param-reassign */
|
||||
|
||||
import {
|
||||
getEmotionCategoryList,
|
||||
getEmoticonDataList,
|
||||
} from '~/services/emoticon/index';
|
||||
import Toast from 'tdesign-miniprogram/toast/index';
|
||||
|
||||
const initFilters = {
|
||||
@ -9,20 +12,11 @@ const initFilters = {
|
||||
|
||||
Page({
|
||||
data: {
|
||||
emoticonDataList: [{
|
||||
emoticonDataId: 1,
|
||||
emoticonDataImg: "http://mall.api.aerwen.net/Uploads/uploads/20231029/C59225894486D6A4.jpg",
|
||||
emoticonDataName: "loopy表情包"
|
||||
},],
|
||||
emoticonDataList: [],
|
||||
tabList: [{
|
||||
text: "全部",
|
||||
key: 0,
|
||||
},
|
||||
{
|
||||
text: "可爱loopy",
|
||||
key: 1,
|
||||
},
|
||||
],
|
||||
text: "全部",
|
||||
key: 0,
|
||||
}],
|
||||
categoryGuid: 0,
|
||||
overall: 1,
|
||||
show: false,
|
||||
@ -48,14 +42,20 @@ Page({
|
||||
keywords: searchValue,
|
||||
},
|
||||
() => {
|
||||
this.getCategotyList()
|
||||
this.init(true);
|
||||
},
|
||||
);
|
||||
},
|
||||
|
||||
OnShow() {
|
||||
this.getCategotyList()
|
||||
},
|
||||
|
||||
generalQueryData(reset = false) {
|
||||
const {
|
||||
keywords,
|
||||
categoryGuid
|
||||
} = this.data;
|
||||
const {
|
||||
pageNum,
|
||||
@ -64,8 +64,9 @@ Page({
|
||||
|
||||
const params = {
|
||||
pageNum: 1,
|
||||
pageSize: 6,
|
||||
goodsName: keywords,
|
||||
pageSize: 10,
|
||||
search: keywords,
|
||||
emoticonCategoryGuid: categoryGuid
|
||||
};
|
||||
|
||||
if (reset) return params;
|
||||
@ -74,16 +75,28 @@ Page({
|
||||
pageNum: pageNum + 1,
|
||||
pageSize,
|
||||
};
|
||||
|
||||
},
|
||||
|
||||
getCategotyList() {
|
||||
// 获取表情包分类列表
|
||||
getEmotionCategoryList().then((res) => {
|
||||
if (res.code == 200) {
|
||||
this.setData({
|
||||
tabList: this.data.tabList.concat(res.data),
|
||||
});
|
||||
} else {}
|
||||
});
|
||||
},
|
||||
|
||||
// 点击分类
|
||||
tabChangeHandle(e) {
|
||||
this.privateData.tabIndex = e.detail;
|
||||
async tabChangeHandle(e) {
|
||||
this.setData({
|
||||
categoryGuid: e.detail.value,
|
||||
keywords: ""
|
||||
});
|
||||
// 刷新列表
|
||||
this.init()
|
||||
await this.init()
|
||||
},
|
||||
|
||||
async init(reset = true) {
|
||||
@ -97,49 +110,49 @@ Page({
|
||||
loadMoreStatus: 1,
|
||||
loading: true,
|
||||
});
|
||||
// try {
|
||||
// const result = await getemoticonList(params);
|
||||
// const data = result.data;
|
||||
// if (result.code == 200) {
|
||||
// const {
|
||||
// result,
|
||||
// totalPage = 0
|
||||
// } = data;
|
||||
// if (totalPage === 0 && reset) {
|
||||
// this.total = totalPage;
|
||||
// this.setData({
|
||||
// emptyInfo: {
|
||||
// tip: '抱歉,未找到相关商品',
|
||||
// },
|
||||
// hasLoaded: true,
|
||||
// loadMoreStatus: 0,
|
||||
// loading: false,
|
||||
// emoticonDataList: [],
|
||||
// });
|
||||
// return;
|
||||
// }
|
||||
try {
|
||||
const result = await getEmoticonDataList(params);
|
||||
const data = result.data;
|
||||
if (result.code == 200) {
|
||||
const {
|
||||
result,
|
||||
totalPage = 0
|
||||
} = data;
|
||||
if (totalPage === 0 && reset) {
|
||||
this.total = totalPage;
|
||||
this.setData({
|
||||
emptyInfo: {
|
||||
tip: '抱歉,未找到相关表情包',
|
||||
},
|
||||
hasLoaded: true,
|
||||
loadMoreStatus: 0,
|
||||
loading: false,
|
||||
emoticonDataList: [],
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
// const _emoticonDataList = reset ? result : emoticonDataList.concat(result);
|
||||
// const _loadMoreStatus = _emoticonDataList.length === totalPage ? 2 : 0;
|
||||
// this.pageNum = params.pageNum || 1;
|
||||
// this.total = totalPage;
|
||||
// this.setData({
|
||||
// emoticonDataList: _emoticonDataList,
|
||||
// loadMoreStatus: _loadMoreStatus,
|
||||
// });
|
||||
// } else {
|
||||
// this.setData({
|
||||
// loading: false,
|
||||
// });
|
||||
// wx.showToast({
|
||||
// title: '查询失败,请稍候重试',
|
||||
// });
|
||||
// }
|
||||
// } catch (error) {
|
||||
// this.setData({
|
||||
// loading: false,
|
||||
// });
|
||||
// }
|
||||
const _emoticonDataList = reset ? result : emoticonDataList.concat(result);
|
||||
const _loadMoreStatus = _emoticonDataList.length === totalPage ? 2 : 0;
|
||||
this.pageNum = params.pageNum || 1;
|
||||
this.total = totalPage;
|
||||
this.setData({
|
||||
emoticonDataList: _emoticonDataList,
|
||||
loadMoreStatus: _loadMoreStatus,
|
||||
});
|
||||
} else {
|
||||
this.setData({
|
||||
loading: false,
|
||||
});
|
||||
wx.showToast({
|
||||
title: '查询失败,请稍候重试',
|
||||
});
|
||||
}
|
||||
} catch (error) {
|
||||
this.setData({
|
||||
loading: false,
|
||||
});
|
||||
}
|
||||
this.setData({
|
||||
hasLoaded: true,
|
||||
loading: false,
|
||||
|
@ -6,7 +6,7 @@
|
||||
t-class-input="t-search__input"
|
||||
value="{{keywords}}"
|
||||
leftIcon=""
|
||||
placeholder="搜索你想要的表情/头像/壁纸"
|
||||
placeholder="搜索你想要的表情 / 获取码"
|
||||
bind:submit="handleSubmit"
|
||||
>
|
||||
<t-icon slot="left-icon" prefix="wr" name="search" size="40rpx" color="#bbb" />
|
||||
|
@ -132,11 +132,11 @@ page view {
|
||||
}
|
||||
|
||||
.last-updated-list-item{
|
||||
width: 200rpx;
|
||||
height: 200rpx;
|
||||
width: 220rpx;
|
||||
height: 220rpx;
|
||||
border: 1rpx solid #E0E0E0;
|
||||
border-radius: 10rpx;
|
||||
margin: 15rpx;
|
||||
margin: 15.5rpx;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
|
@ -7,6 +7,10 @@ import {
|
||||
import {
|
||||
getSearchRecList
|
||||
} from '~/services/home/getSearchRecList';
|
||||
import {
|
||||
getHotEmotionCategoryList,
|
||||
getEmoticonDataList,
|
||||
} from '~/services/emoticon/index';
|
||||
import Toast from 'tdesign-miniprogram/toast/index';
|
||||
|
||||
Page({
|
||||
@ -17,44 +21,10 @@ Page({
|
||||
key: 0,
|
||||
categoryGuid: 1,
|
||||
}],
|
||||
hotCategoryList: [{
|
||||
emotionCategoryId: 1,
|
||||
emotionCategoryImg: "http://mall.api.aerwen.net/Uploads/uploads/20231029/C59225894486D6A4.jpg",
|
||||
emotionCategoryName: "loopy表情包"
|
||||
},
|
||||
{
|
||||
emotionCategoryId: 2,
|
||||
emotionCategoryImg: "http://mall.api.aerwen.net/Uploads/uploads/20231029/C59225894486D6A4.jpg",
|
||||
emotionCategoryName: "loopy表情包"
|
||||
},
|
||||
{
|
||||
emotionCategoryId: 2,
|
||||
emotionCategoryImg: "http://mall.api.aerwen.net/Uploads/uploads/20231029/C59225894486D6A4.jpg",
|
||||
emotionCategoryName: "loopy表情包"
|
||||
},
|
||||
{
|
||||
emotionCategoryId: 2,
|
||||
emotionCategoryImg: "http://mall.api.aerwen.net/Uploads/uploads/20231029/C59225894486D6A4.jpg",
|
||||
emotionCategoryName: "loopy表情包"
|
||||
},
|
||||
{
|
||||
emotionCategoryId: 2,
|
||||
emotionCategoryImg: "http://mall.api.aerwen.net/Uploads/uploads/20231029/C59225894486D6A4.jpg",
|
||||
emotionCategoryName: "loopy表情包"
|
||||
},
|
||||
],
|
||||
lastUpdatedList: [{
|
||||
emoticonDataId: 1,
|
||||
emoticonDataImg: "http://mall.api.aerwen.net/Uploads/uploads/20231029/C59225894486D6A4.jpg",
|
||||
emoticonDataName: "loopy表情包"
|
||||
}, ],
|
||||
hotCategoryList: [],
|
||||
lastUpdatedList: [],
|
||||
noticeList: [],
|
||||
popularWords: [],
|
||||
marquee: {
|
||||
speed: 40,
|
||||
loop: -1,
|
||||
delay: 0,
|
||||
},
|
||||
pageLoading: false,
|
||||
current: 0,
|
||||
autoplay: true,
|
||||
@ -67,9 +37,13 @@ Page({
|
||||
mode: 'scaleToFill',
|
||||
},
|
||||
categoryGuid: 0,
|
||||
loadMoreStatus: 0
|
||||
},
|
||||
|
||||
|
||||
page: {
|
||||
size: 20,
|
||||
num: 1,
|
||||
},
|
||||
privateData: {
|
||||
tabIndex: 0,
|
||||
},
|
||||
@ -84,7 +58,7 @@ Page({
|
||||
|
||||
// 划到底部触发
|
||||
onReachBottom() {
|
||||
|
||||
this.getEmocticonLastData()
|
||||
},
|
||||
|
||||
onPullDownRefresh() {
|
||||
@ -102,6 +76,15 @@ Page({
|
||||
pageLoading: true,
|
||||
});
|
||||
|
||||
this.getBanner()
|
||||
this.getRec()
|
||||
// this.getNotice()
|
||||
this.getHot()
|
||||
this.getEmocticonLastData()
|
||||
},
|
||||
|
||||
|
||||
getBanner() {
|
||||
// 获取轮播图列表
|
||||
getbannerList().then((res) => {
|
||||
if (res.code == 200) {
|
||||
@ -110,7 +93,9 @@ Page({
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
getRec() {
|
||||
// 获取搜索推荐
|
||||
getSearchRecList().then((res) => {
|
||||
if (res.code == 200) {
|
||||
@ -120,34 +105,59 @@ Page({
|
||||
});
|
||||
} else {}
|
||||
});
|
||||
|
||||
// 获取公告列表
|
||||
// getNoticeList().then((res) => {
|
||||
// if (res.code == 200) {
|
||||
// const _noticeData = res.data.map((v) => {
|
||||
// return {
|
||||
// ...v,
|
||||
// visible: true
|
||||
// };
|
||||
// });
|
||||
// this.setData({
|
||||
// noticeList: _noticeData,
|
||||
// pageLoading: false
|
||||
// });
|
||||
// }
|
||||
// });
|
||||
},
|
||||
|
||||
// 点击分类
|
||||
tabChangeHandle(e) {
|
||||
this.privateData.tabIndex = e.detail;
|
||||
this.setData({
|
||||
categoryGuid: e.detail.value,
|
||||
getHot() {
|
||||
// 获取热门表情包分类列表
|
||||
getHotEmotionCategoryList().then((res) => {
|
||||
if (res.code == 200) {
|
||||
this.setData({
|
||||
hotCategoryList: res.data,
|
||||
});
|
||||
} else {}
|
||||
});
|
||||
// 刷新列表
|
||||
|
||||
},
|
||||
|
||||
getEmocticonLastData() {
|
||||
const params = {
|
||||
pageSize: this.page.size,
|
||||
pageNum: this.page.num,
|
||||
isLastUpdate: true
|
||||
};
|
||||
this.setData({
|
||||
loadMoreStatus: 1,
|
||||
});
|
||||
// 获取最近更新表情包列表
|
||||
getEmoticonDataList(params).then((res) => {
|
||||
if (res.code == 200) {
|
||||
this.page.num++;
|
||||
|
||||
this.setData({
|
||||
lastUpdatedList: this.data.lastUpdatedList.concat(res.data.result),
|
||||
loadMoreStatus: 0
|
||||
});
|
||||
|
||||
} else {}
|
||||
});
|
||||
},
|
||||
|
||||
getNotice() {
|
||||
// 获取公告列表
|
||||
getNoticeList().then((res) => {
|
||||
if (res.code == 200) {
|
||||
const _noticeData = res.data.map((v) => {
|
||||
return {
|
||||
...v,
|
||||
visible: true
|
||||
};
|
||||
});
|
||||
this.setData({
|
||||
noticeList: _noticeData,
|
||||
pageLoading: false
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
|
||||
navToSearchPage() {
|
||||
|
@ -23,7 +23,7 @@
|
||||
</view>
|
||||
<!-- 搜索框 -->
|
||||
<view class="search" bind:tap="navToSearchPage">
|
||||
<t-search t-class-input="t-search__input" t-class-input-container="t-search__input-container" placeholder="搜索你想要的表情/头像/壁纸" leftIcon="" disabled>
|
||||
<t-search t-class-input="t-search__input" t-class-input-container="t-search__input-container" placeholder="搜索你想要的表情 / 获取码" leftIcon="" disabled>
|
||||
<t-icon slot="left-icon" prefix="wr" name="search" size="40rpx" color="#bbb" />
|
||||
</t-search>
|
||||
<!-- 热门搜索 -->
|
||||
@ -96,6 +96,7 @@
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<load-more wx:if="{{lastUpdatedList.length > 0}}" status="{{loadMoreStatus}}" no-more-text="没有更多了" />
|
||||
</view>
|
||||
|
||||
</view>
|
||||
|
@ -1,5 +1,5 @@
|
||||
<view class="search-page">
|
||||
<t-search t-class-input-container="t-class__input-container" t-class-input="t-search__input" value="{{searchValue}}" leftIcon="" placeholder="请输入关键词" bind:submit="handleSubmit" focus>
|
||||
<t-search t-class-input-container="t-class__input-container" t-class-input="t-search__input" value="{{searchValue}}" leftIcon="" placeholder="搜索你想要的表情/获取码" bind:submit="handleSubmit" focus>
|
||||
<t-icon slot="left-icon" prefix="wr" name="search" size="40rpx" color="#bbb" />
|
||||
</t-search>
|
||||
<view class="search-wrap">
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
<!-- 背景图盒子 -->
|
||||
<view class="bg-box">
|
||||
<image class="bg-box-img" src="http://tool.aerwen.net/prod-api/Uploads/uploads/20230606/6CC15E3D7D4EB305.png" />
|
||||
<image class="bg-box-img" src="http://mall.api.aerwen.net/Uploads/uploads/20231029/E47DAEBE34756E17.jpg" />
|
||||
</view>
|
||||
|
||||
|
||||
@ -12,19 +12,17 @@
|
||||
<view class="login-box">
|
||||
<view class="login-btn-box">
|
||||
<van-button open-type="getPhoneNumber" bindgetphonenumber="getPhoneNumber" icon="wechat" type="primary" size="large" custom-style="font-size: 31rpx;font-weight: bold;" round block>微信一键登录</van-button>
|
||||
<view class="mb-30"></view>
|
||||
<van-button icon="phone" color="#eff0f1" size="large" custom-style="font-size: 31rpx;color: #999999;font-weight: bold;" round block bind:click="gotoPhoneRegister">手机号登录/注册</van-button>
|
||||
<!-- <view class="mb-30"></view>
|
||||
<van-button icon="phone" color="#eff0f1" size="large" custom-style="font-size: 31rpx;color: #999999;font-weight: bold;" round block bind:click="gotoPhoneRegister">手机号登录/注册</van-button> -->
|
||||
</view>
|
||||
|
||||
<view class="agree-box">
|
||||
<!-- <view class="agree-box">
|
||||
<van-checkbox icon-size="35rpx" value="{{ checked }}" checked-color="#fc2e2a" bind:change="onChangeChecked"></van-checkbox>
|
||||
<view class="agree-text">
|
||||
我已阅读并同意
|
||||
<span class="agree-link" wx:for="{{agree_Link}}" bindtap='agreeLink' data-Guid='{{item.platformSpecGuid}}'>《{{item.platformSpecTitle}}》</span>
|
||||
<!-- <span class="agree-link">《阿尔文电商用户协议》</span>
|
||||
<span class="agree-link">《阿尔文电商隐私政策》</span> -->
|
||||
</view>
|
||||
</view>
|
||||
</view> -->
|
||||
|
||||
</view>
|
||||
</view>
|
||||
|
@ -29,8 +29,8 @@
|
||||
.login-container-box{
|
||||
width: 90%;
|
||||
position: absolute;
|
||||
bottom: 25%;
|
||||
height: 430rpx;
|
||||
top: 20%;
|
||||
height: 220rpx;
|
||||
background-color: white;
|
||||
border-radius: 20rpx;
|
||||
}
|
||||
|
@ -35,7 +35,6 @@ Page({
|
||||
return getGoodsCollectionList(params)
|
||||
.then((res) => {
|
||||
this.page.num++;
|
||||
let list = [];
|
||||
|
||||
if (res && res.data && res.data.result) {
|
||||
this.setData({
|
||||
|
52
services/emoticon/index.js
Normal file
52
services/emoticon/index.js
Normal file
@ -0,0 +1,52 @@
|
||||
import {
|
||||
request
|
||||
} from '../_utils/request';
|
||||
|
||||
/** 获取热门表情包分类列表 */
|
||||
export function getHotEmotionCategoryList() {
|
||||
return new Promise((resolve, reject) => {
|
||||
request({
|
||||
url: `EmotionCategoryApi/getHotEmotionCategoryList`,
|
||||
method: 'GET',
|
||||
success: function (res) {
|
||||
resolve(res);
|
||||
},
|
||||
fail: function (error) {
|
||||
reject(error);
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
/** 获取表情包分类列表 */
|
||||
export function getEmotionCategoryList() {
|
||||
return new Promise((resolve, reject) => {
|
||||
request({
|
||||
url: `EmotionCategoryApi/getEmotionCategoryList`,
|
||||
method: 'GET',
|
||||
success: function (res) {
|
||||
resolve(res);
|
||||
},
|
||||
fail: function (error) {
|
||||
reject(error);
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
/** 获取表情包列表 */
|
||||
export function getEmoticonDataList(parm) {
|
||||
return new Promise((resolve, reject) => {
|
||||
request({
|
||||
url: `EmoticonDataApi/getEmoticonDataList`,
|
||||
method: 'GET',
|
||||
data: parm,
|
||||
success: function (res) {
|
||||
resolve(res);
|
||||
},
|
||||
fail: function (error) {
|
||||
reject(error);
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
@ -1,6 +1,6 @@
|
||||
/* 主题定制 */
|
||||
.root-bg-color {
|
||||
background-color: #1989fa;
|
||||
background-color: #F4E6CF;
|
||||
}
|
||||
|
||||
.t-input {
|
||||
@ -14,7 +14,7 @@
|
||||
}
|
||||
|
||||
.t-cascader {
|
||||
--td-cascader-active-color: #1989fa;
|
||||
--td-cascader-active-color: #F4E6CF;
|
||||
}
|
||||
|
||||
.t-switch {
|
||||
@ -25,13 +25,13 @@
|
||||
--td-button-font-weight: 500;
|
||||
--td-button-medium-font-size: 32rpx;
|
||||
--td-button-default-color: #fff;
|
||||
--td-button-default-bg-color: #1989fa;
|
||||
--td-button-default-border-color: #1989fa;
|
||||
--td-button-default-bg-color: #F4E6CF;
|
||||
--td-button-default-border-color: #F4E6CF;
|
||||
--td-button-default-disabled-color: #fff;
|
||||
--td-button-default-disabled-bg: #cccccc;
|
||||
--td-button-default-disabled-border-color: #cccccc;
|
||||
--td-button-default-active-bg-color: #1989fa;
|
||||
--td-button-default-active-border-color: #1989fa;
|
||||
--td-button-default-active-bg-color: #F4E6CF;
|
||||
--td-button-default-active-border-color: #F4E6CF;
|
||||
}
|
||||
|
||||
.t-textarea {
|
||||
@ -39,26 +39,26 @@
|
||||
}
|
||||
|
||||
.t-checkbox {
|
||||
--td-checkbox-icon-checked-color: #1989fa;
|
||||
--td-checkbox-icon-checked-color: #F4E6CF;
|
||||
}
|
||||
|
||||
.t-tabs {
|
||||
--td-tab-item-active-color: #1989fa;
|
||||
--td-tab-track-color: #1989fa;
|
||||
--td-tab-item-active-color: #F4E6CF;
|
||||
--td-tab-track-color: #F4E6CF;
|
||||
}
|
||||
|
||||
.t-button {
|
||||
--td-button-default-color: #000;
|
||||
--td-button-primary-text-color: #1989fa;
|
||||
--td-button-primary-text-color: #F4E6CF;
|
||||
}
|
||||
|
||||
.t-side-bar{
|
||||
--td-side-bar-active-color: #1989fa;
|
||||
--td-side-bar-disabled-color: #1989fa;
|
||||
--td-side-bar-active-color: #F4E6CF;
|
||||
--td-side-bar-disabled-color: #F4E6CF;
|
||||
}
|
||||
|
||||
.dialog__button-confirm {
|
||||
color: #1989fa !important;
|
||||
color: #F4E6CF !important;
|
||||
}
|
||||
|
||||
.dialog__button-cancel {
|
||||
|
Loading…
Reference in New Issue
Block a user