master
liuyongli 3 years ago
parent 57ca48c9de
commit 90f2acacee

@ -15,45 +15,35 @@ App({
wx.setStorageSync('logs', logs)
// 登录
wx.login({
success: res => {
// this.setData({
// code: res.code
// })
http("/user/login", "post", {
code: res.code
}).then(res => {
if (res.msg === "未注册!") {
// this.getUserProfile()
wx.showToast({
title: '您尚未注册,请点击个人头像位置以注册登录',
icon: 'none',
duration: 2000
})
} else {
getApp().globalData.token = res.data.token
// this.setData({
// user_avatar:res.data.user.avatar,
// user_name:res.data.user.name,
// user_tip:'欢迎来到星途~'
// })
wx.setStorage({
key: 'user',
data: res.data.user
})
wx.setStorage({
key: 'token',
data: res.data.token
})
// wx.getStorage({
// key: 'token',
// success (res) {
// }
// })
}
})
}
})
// wx.login({
// success: res => {
// // this.setData({
// // code: res.code
// // })
// http("/user/login", "post", {
// code: res.code
// }).then(res => {
// if (res.msg === "未注册!") {
// // this.getUserProfile()
// wx.showToast({
// title: '您尚未注册,请点击个人头像位置以注册登录',
// icon: 'none',
// duration: 2000
// })
// } else {
// getApp().globalData.token = res.data.token
// wx.setStorage({
// key: 'user',
// data: res.data.user
// })
// wx.setStorage({
// key: 'token',
// data: res.data.token
// })
// }
// })
// }
// })
},
globalData: {
userInfo: null,

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.7 KiB

@ -6,6 +6,7 @@ const app = getApp()
Page({
data: {
cdn:getApp().globalData.cdn,
numlist:[],
toplist: [{
url: '/images/ic_bofang@3x.png',
title: '总播放量',
@ -22,25 +23,37 @@ Page({
url: '/images/comment@3x.png',
title: '总评论数',
num: '0'
}],
},
{
url: '/images/ic_zhuanfa@3x.png',
title: '总转发数',
num: '0'
},
{
url: '/images/ic_tuijian@3x.png',
title: '总推荐数',
num: '0'
},
],
rankurl: [
'/images/img_diyi@3x.png',
'/images/img_dier@3x.png',
'/images/img_disan@3x.png'
],
disranking: [{
url: '/images/img_diyi@3x.png',
name: '罗森便利店(江安店)',
add: '浙江省宁波市江北区江安路487号绿地中心南区3号楼'
}, {
url: '/images/img_dier@3x.png',
name: '罗森(upark店)',
add: '浙江省宁波市海曙区学院路788号'
}, {
url: '/images/img_disan@3x.png',
name: 'LAWSON罗森(博瑞大厦店)',
add: '浙江省宁波市江北区望山路1-4-111号博瑞大厦'
}],
records:[],
// disranking: [{
// url: '/images/img_diyi@3x.png',
// name: '罗森便利店(江安店)',
// add: '浙江省宁波市江北区江安路487号绿地中心南区3号楼'
// }, {
// url: '/images/img_dier@3x.png',
// name: '罗森(upark店)',
// add: '浙江省宁波市海曙区学院路788号'
// }, {
// url: '/images/img_disan@3x.png',
// name: 'LAWSON罗森(博瑞大厦店)',
// add: '浙江省宁波市江北区望山路1-4-111号博瑞大厦'
// }],
staranking: [{
url: '/images/img_diyi@3x.png',
name: '维涅斯',
@ -54,7 +67,9 @@ Page({
name: '希斯拉德',
dis: 'LAWSON罗森(博瑞大厦店)'
}],
records:[],
rows:[],
page:1,
size:10
},
to(e) {
console.log(e.target.dataset.url)
@ -65,10 +80,10 @@ Page({
},
onLoad: function (options) {
wx.setNavigationBarTitle({
title: '',
success: function (res) {}
})
// wx.setNavigationBarTitle({
// title: '',
// success: function (res) {}
// })
wx.setNavigationBarColor({
frontColor: '#ffffff',
backgroundColor: '#006BFF',
@ -78,24 +93,54 @@ Page({
}
})
this.getrecordslist()
this.RankingList()
this.numlist()
},
//总数
numlist(){
http("/rank/myEffect", "post", {
}).then(res =>{
this.setData({
'toplist[0].num': res.data.playNumSum,
'toplist[1].num': res.data.commendNum,
'toplist[2].num': res.data.collectionNum,
'toplist[3].num': res.data.commentNum,
'toplist[4].num': res.data.reSendNum,
'toplist[5].num': res.data.recommendNum
})
})
},
//品牌动态
getrecordslist(){
http("/topicActivity/list", "post", {
showAtIndex:1
}).then(res =>{
this.setData({
records: res.data.records,
records: res.data.records
})
})
},
//排行榜
RankingList(){
http("/rank/list", "post", {
pageNum: this.data.pages,
pageSize:this.data.size,
type:1
}).then(res =>{
this.setData({
rows: res.data.records,
})
})
},
//查看全部
detail(e){
console.log(e)
wx.setStorageSync('info', e.currentTarget.dataset.cycle_id)
wx.navigateTo({
url:"/pages/index/subpage/brand/brandDetails/brandDetails"
url:"/pages/index/subpage/brand/brandDetails/brandDetails?id="
})
},
/**
* 页面相关事件处理函数--监听用户下拉动作

@ -57,15 +57,15 @@
<view class="ranking_mes2" style="margin-right: 9rpx;">
<view class="ranking_top">
<view class="ranking_top_title1">经销商</view>
<view class="rank_top_date">2022-5</view>
<view class="rank_top_date">{{item.createDate}}</view>
</view>
<view class="ranking_one" wx:for="{{disranking}}" wx:key="index">
<view class="ranking_one" wx:for="{{rows}}" wx:key="index" data_id="{{item}}" wx:if="{{index < 3}}">
<view class="ranking_image">
<image style="width: 100%;height: 100%;" src="{{rankurl[index]}}"></image>
</view>
<view class="ranking_text">
<view class="ranking_text1">{{item.name}}</view>
<view class="ranking_text2">{{item.add}}</view>
<view class="ranking_text" >
<view class="ranking_text1">{{item.title}}</view>
<view class="ranking_text2">{{item.subtitle}}</view>
</view>
</view>
</view>
@ -73,15 +73,15 @@
<view class="ranking_mes2" style="margin-left: 9rpx;">
<view class="ranking_top">
<view class="ranking_top_title2">员工</view>
<view class="rank_top_date">2022-5</view>
<view class="rank_top_date">{{item.createDate}}</view>
</view>
<view class="ranking_one" wx:for="{{staranking}}" wx:key="index">
<view class="ranking_one" wx:if="{{index < 3}}" wx:for="{{rows}}" wx:key="index" data_id="{{item}}" >
<view class="ranking_image">
<image style="width: 100%;height: 100%;" src="{{rankurl[index]}}"></image>
</view>
<view class="ranking_text">
<view class="ranking_text1">{{item.name}}</view>
<view class="ranking_text2">{{item.dis}}</view>
<view class="ranking_text1">{{item.title}}</view>
<view class="ranking_text2">{{item.subtitle}}</view>
</view>
</view>
</view>

@ -162,19 +162,45 @@ Page({
},
/**
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
this.onRefresh()
},
onRefresh:function(){
//导航条加载动画
wx.showNavigationBarLoading()
//loading 提示框
wx.showLoading({
title: 'Loading...',
})
console.log("下拉刷新啦");
setTimeout(function () {
wx.hideLoading();
wx.hideNavigationBarLoading();
//停止下拉刷新
wx.stopPullDownRefresh();
}, 2000)
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
// console.log('页面上拉触底事件的处理函数')
this.getbrandlist()
// this.getbrandlist()
if (this.data.page === this.data.maxpage) {
wx.showToast({
title: '到底啦~',
icon: 'none',
duration: 2000
})
} else {
this.setData({
'page': this.data.page + 1
})
this.getdata()
}
},
/**

@ -1,66 +0,0 @@
// pages/index/subpage/brand/brandDetails.js
Page({
/**
* 页面的初始数据
*/
data: {
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
}
})

@ -1,3 +0,0 @@
{
"usingComponents": {}
}

@ -1,2 +0,0 @@
<!--pages/index/subpage/brand/brandDetails.wxml-->
<text>pages/index/subpage/brand/brandDetails.wxml</text>

@ -1 +0,0 @@
/* pages/index/subpage/brand/brandDetails.wxss */

@ -14,7 +14,7 @@ Page({
type: 0,
records: [],
infoObject: {},
isClick: false,
isCollected:false,
// imageUrl:"/pages/index/shortimage/img_xingtue@2x.png"
},
back() {
@ -39,29 +39,26 @@ Page({
})
},
//收藏
collection(e) {
// 收藏
add(e) {
var that = this
let userId = this.data.infoObject.id
// let userId = this.data.id
let referenceId = this.data.infoObject.id
// let referenceId = wx.getStorageSync('referenceId')
let isClick = this.data.isClick
console.log(e)
if (!isClick) {
let isCollected = this.data.isCollected
if (!isCollected) {
that.setData({
isClick: true
isCollected: true
})
wx.showToast({
title: '收藏成功',
icon: 'none'
})
http("/userReference/add", "post", {
userId,
// userId,
referenceId
}).then(res => {
this.setData({
// userId:e.currentTarget.dataset.cycle_id,
// referenceId:this.id
referenceId
})
})
}
@ -79,7 +76,24 @@ Page({
infoObject: wx.getStorageSync('info')
})
this.getrecordslist()
//详情
http("/topicActivity/detail", "post", {
id:this.data.infoObject.id
}).then(res => {
this.setData({
})
})
//点击增加量
http("/topicActivity/noteHits", "post", {
id:this.data.infoObject.id
}).then(res => {
this.setData({
'toplist[0].num': res.data.playNumSum+ 1
})
})
},
//动态列表
getrecordslist() {
http("/topicActivity/list", "post", {}).then(res => {
this.setData({
@ -116,18 +130,43 @@ Page({
},
/**
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
this.onRefresh()
},
onRefresh:function(){
//导航条加载动画
wx.showNavigationBarLoading()
//loading 提示框
wx.showLoading({
title: 'Loading...',
})
console.log("下拉刷新啦");
setTimeout(function () {
wx.hideLoading();
wx.hideNavigationBarLoading();
//停止下拉刷新
wx.stopPullDownRefresh();
}, 2000)
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
if (this.data.page === this.data.maxpage) {
wx.showToast({
title: '到底啦~',
icon: 'none',
duration: 2000
})
} else {
this.setData({
'page': this.data.page + 1
})
this.getdata()
}
},
/**

@ -33,18 +33,23 @@
<image src="../brandDetails/images/ic_fenxiang@3x.png" style="width: 48rpx;height: 48rpx;vertical-align: middle;margin-right: 10rpx;"></image>
<text style="width: 48rpx;height: 48rpx;">分享</text>
</view>
<view class="d-flex-list" bindtap="collection">
<!-- <view class="d-flex-list" bindtap="add" data-cycle_id="item">
<image src="../brandDetails/images/ic_shoucang@3x.png" style="width: 48rpx;height: 48rpx;vertical-align: middle;margin-right: 10rpx;"></image>
<text style="width: 48rpx;height: 48rpx;">{{isClick?'已收藏': '收藏'}}</text>
</view>
<text style="width: 48rpx;height: 48rpx;">{{isCollected?'已收藏': '收藏'}}</text>
</view> -->
<view class="d-flex-list" data-link="{{cdn+(infoObject.content)}}" bindtap="handleDownload" wx:if="{{infoObject.type===1}}">
<image src="../brandDetails/images/ic_baocun@3x.png" style="width: 48rpx;height: 48rpx;vertical-align: middle;margin-right: 10rpx;"></image>
<text>保存</text>
</view>
<view class="d-flex-list" bindtap="preserve" wx:else>
<view class="d-flex-list" bindtap="preserve" wx:if="{{infoObject.type===2}}">
<image src="../brandDetails/images/ic_baocun@3x.png" style="width: 48rpx;height: 48rpx;vertical-align: middle;margin-right: 10rpx;"></image>
<text>保存</text>
</view>
<view style="display:none" class="d-flex-list" wx:if="{{infoObject.type===3}}">
<image src="../brandDetails/images/ic_baocun@3x.png" style="width: 48rpx;height: 48rpx;vertical-align: middle;margin-right: 10rpx;"></image>
<text>保存</text>
</view>
</view>
</view>
@ -67,7 +72,7 @@
<view class="crad_right_num">
<!-- {{item.type === 1 ? item.num+'次播放' : item.num+'次阅读'}}{{item.duration}} -->
</view>
<image class="crad_image" src="{{cdn+(item.cover)}}"></image>
<image mode="aspectFill" class="crad_image" src="{{cdn+(item.cover)}}"></image>
</view>
</view>
<!-- </view> -->

@ -1,48 +1,15 @@
11// pages/index/subpage/ranking/ranking.js
// pages/index/subpage/ranking/ranking.js
import {http} from '../../../../utils/util'
Page({
/**
* 页面的初始数据
*/
data: {
type: "1",
page:1,
title: "经销商排行榜",
as: "-500%",
distributor: [
{
name: "北京福瑞祥云店",
add: "北京市顺义区通顺路",
count: "1200"
},{
name: "北京福瑞祥云店",
add: "北京市顺义区通顺路",
count: "1200"
},{
name: "北京福瑞祥云店",
add: "北京市顺义区通顺路",
count: "1200"
},{
name: "北京福瑞祥云店",
add: "北京市顺义区通顺路",
count: "1200"
},{
name: "北京福瑞祥云店",
add: "北京市顺义区通顺路",
count: "1200"
},{
name: "北京福瑞祥云店",
add: "北京市顺义区通顺路",
count: "1200"
},{
name: "北京福瑞祥云店",
add: "北京市顺义区通顺路",
count: "1200"
},{
name: "北京福瑞祥云店",
add: "北京市顺义区通顺路",
count: "1200"
},
]
records:[],
},
typechange(e){
this.data.type = e.target.dataset.type
@ -59,11 +26,25 @@ Page({
delta: 0,
})
},
//排行榜
RankingList(){
http("/rank/list", "post", {
pageNum: this.data.pages,
pageSize:this.data.size,
type:1
}).then(res =>{
this.setData({
records: res.data.records,
})
})
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
this.RankingList()
},
/**

@ -3,7 +3,7 @@
<view class="top">
<image style="width: 100%;position: absolute;z-index: -1;" src="./image/img_phbang@2x.png"></image>
<view class="title">{{title}}</view>
<view class="time">2022-05-01~2022-06-01</view>
<view class="time">{{item.records.createDate}}</view>
</view>
<view class="nav">
<view class="nav_text" data-type="1" bindtap="typechange">经销商</view>
@ -11,7 +11,7 @@
<view class="nav_tip" style="transform: translateX({{as}});"></view>
</view>
<!-- 经销商排行榜 -->
<view class="dis" wx:if="{{as === '-500%'}}" wx:for="{{distributor}}" wx:key="index">
<view class="dis" wx:if="{{item.type === 1}}" wx:for="{{records}}" wx:key="index" data_id="{{item}}">
<view class="dis_image">
<image class="rank_num" wx:if="{{index === 0}}" src="/images/img_diyi@3x.png"></image>
<image class="rank_num" wx:if="{{index === 1}}" src="/images/img_dier@3x.png"></image>
@ -19,16 +19,16 @@
<view class="rank_num" wx:if="{{index !== 0 &&index !== 1 &&index !== 2 }}">{{index >= 9 ? index + 1 : '0' + (index + 1)}}</view>
</view>
<view class="dis_text">
<view class="text_title">{{item.name}}</view>
<view class="text_tip">{{item.add}}</view>
<view class="text_title">{{item.title}}</view>
<view class="text_tip">{{item.subtitle}}</view>
</view>
<view class="count">
<view class="num">{{item.count}}</view>
<view class="num">{{item.value}}</view>
<view class="num_tip">传播值</view>
</view>
</view>
<!-- 员工排行榜 -->
<view class="dis" wx:if="{{as === '500%'}}" wx:for="{{distributor}}" wx:key="index">
<view class="dis" wx:if="{{item.type === 2}}" wx:for="{{records}}" wx:key="index" data_id="{{item}}">
<view class="dis_image">
<image class="rank_num" wx:if="{{index === 0}}" src="/images/img_diyi@3x.png"></image>
<image class="rank_num" wx:if="{{index === 1}}" src="/images/img_dier@3x.png"></image>
@ -37,11 +37,11 @@
</view>
<view style="width: 68rpx;height: 68rpx;background-color: #FEAC5E;border-radius: 50%;margin-right: 16rpx;"></view>
<view class="dis_text">
<view class="text_title">{{item.name}}</view>
<view class="text_tip">{{item.add}}</view>
<view class="text_title">{{item.title}}</view>
<view class="text_tip">{{item.subtitle}}</view>
</view>
<view class="count">
<view class="num">{{item.count}}</view>
<view class="num">{{item.value}}</view>
<view class="num_tip">传播值</view>
</view>
</view>

@ -28,7 +28,7 @@
<view class="card_hr"></view>
<view class="dou_card">
<view class="card_num">0</view>
<view class="card_tip">收藏量</view>
<view class="card_tip">传播量</view>
</view>
</view>
</view>
@ -56,7 +56,7 @@
<view class="card_hr"></view>
<view class="dou_card">
<view class="card_num">0</view>
<view class="card_tip">收藏量</view>
<view class="card_tip">传播量</view>
</view>
</view>
</view>
@ -102,7 +102,7 @@
<view class="card_hr"></view>
<view class="dou_card">
<view class="card_num">0</view>
<view class="card_tip">收藏量</view>
<view class="card_tip">传播量</view>
</view>
</view>
</view>

@ -28,7 +28,7 @@
<view class="card_hr"></view>
<view class="dou_card">
<view class="card_num">0</view>
<view class="card_tip">收藏量</view>
<view class="card_tip">传播量</view>
</view>
</view>
</view>
@ -56,7 +56,7 @@
<view class="card_hr"></view>
<view class="dou_card">
<view class="card_num">0</view>
<view class="card_tip">收藏量</view>
<view class="card_tip">传播量</view>
</view>
</view>
</view>
@ -102,7 +102,7 @@
<view class="card_hr"></view>
<view class="dou_card">
<view class="card_num">0</view>
<view class="card_tip">收藏量</view>
<view class="card_tip">传播量</view>
</view>
</view>
</view>

@ -1,5 +1,5 @@
{
"projectname": "xx",
"projectname": "EXEEED",
"setting": {
"compileHotReLoad": true,
"urlCheck": true

@ -19,11 +19,12 @@ const formatNumber = n => {
}
const http = (url, method, data, isLoading = true) => {
if (isLoading) {
if (false) {
wx.showLoading({
title: '加载中'
});
}
return new Promise(function (resolve, reject) {
if (url === '/user/login' || url === '/user/register') {
var header = {}
@ -38,11 +39,10 @@ const http = (url, method, data, isLoading = true) => {
url: host + url,
method: 'POST',
data: data,
header:header,
header: header,
success: res => {
if (isLoading) {
wx.hideLoading();
}
console.log(res)
if (200 == res.data.code) {
resolve(res.data);
} else if (10008 === res.data.code && res.data.msg === "未注册!") {
@ -55,7 +55,12 @@ const http = (url, method, data, isLoading = true) => {
})
}
},
complete: res => {
wx.hideLoading();
console.log(res)
},
fail: res => {
console.log(res)
wx.hideLoading();
}
})

Loading…
Cancel
Save