Commit 16a377ee authored by 黄媛媛's avatar 黄媛媛

11

parents 705fb78e 10d51510
//app.js
App({
onLaunch: function () {
// 展示本地存储能力
var logs = wx.getStorageSync('logs') || []
logs.unshift(Date.now())
wx.setStorageSync('logs', logs)
// //app.js
// App({
// onLaunch: function () {
// // 展示本地存储能力
// var logs = wx.getStorageSync('logs') || []
// logs.unshift(Date.now())
// wx.setStorageSync('logs', logs)
// 登录
wx.login({
success: res => {
// 发送 res.code 到后台换取 openId, sessionKey, unionId
}
})
// 获取用户信息
wx.getSetting({
success: res => {
if (res.authSetting['scope.userInfo']) {
// 已经授权,可以直接调用 getUserInfo 获取头像昵称,不会弹框
wx.getUserInfo({
success: res => {
// 可以将 res 发送给后台解码出 unionId
this.globalData.userInfo = res.userInfo
// // 登录
// wx.login({
// success: res => {
// // 发送 res.code 到后台换取 openId, sessionKey, unionId
// }
// })
// // 获取用户信息
// wx.getSetting({
// success: res => {
// if (res.authSetting['scope.userInfo']) {
// // 已经授权,可以直接调用 getUserInfo 获取头像昵称,不会弹框
// wx.getUserInfo({
// success: res => {
// // 可以将 res 发送给后台解码出 unionId
// this.globalData.userInfo = res.userInfo
// // 由于 getUserInfo 是网络请求,可能会在 Page.onLoad 之后才返回
// // 所以此处加入 callback 以防止这种情况
// if (this.userInfoReadyCallback) {
// this.userInfoReadyCallback(res)
// }
// }
// })
// }
// }
// })
// },
// globalData: {
// userInfo: null
// }
// })
import WeAppRedux from './redux/index.js';
import createStore from './redux/createStore.js';
import reducer from './store/reducer.js';
import ENVIRONMENT_CONFIG from './config/envConfig.js'
import PAGE_CONFIG from './config/pageConfig.js'
const { Provider } = WeAppRedux;
const store = createStore(reducer) // redux store
// 由于 getUserInfo 是网络请求,可能会在 Page.onLoad 之后才返回
// 所以此处加入 callback 以防止这种情况
if (this.userInfoReadyCallback) {
this.userInfoReadyCallback(res)
App(
Provider(store)(
{
globalData: {
emitter: null,
netcallController: null,
ENVIRONMENT_CONFIG,
PAGE_CONFIG
},
onShow: function (e) {
if (e.scene == 1007 || e.scene == 1008) {
try {
this.globalData.netcall && this.globalData.netcall.destroy()
this.globalData.nim && this.globalData.nim.destroy({
done: function () {
}
}
})
})
} catch (e) {
}
}
},
onLaunch: function (e) {
let userInfo = {
account: '17308037817',
nick: '罗超',
gender: 0,
createTime: 1514969730701,
updateTime: 1514969730701,
}
if (userInfo) {
this.globalData.userInfo = userInfo
}
let systemInfo = wx.getSystemInfoSync()
this.globalData.videoContainerSize = {
width: systemInfo.windowWidth,
height: systemInfo.windowHeight
}
this.globalData.isPushBeCallPage = false
}
})
},
globalData: {
userInfo: null
}
})
\ No newline at end of file
}
)
)
{
"pages": [
"pages/msg/index/index",
"pages/index/index",
"pages/video/index",
"pages/me/index",
"pages/validateForm/validateEnd/validateEnd",
"pages/welcome/welcome",
"pages/validateForm/validate/validate",
"pages/validateForm/validateEnd/validateEnd",
"pages/logs/logs",
"pages/me/index",
"pages/welcome/welcome",
"pages/msg/index",
"pages/logs/logs"
"pages/video/index"
],
"window": {
"backgroundTextStyle": "light",
"navigationBarBackgroundColor": "#fff",
"navigationBarTitleText": "WeChat",
"navigationBarTextStyle": "black",
"navigationStyle": "custom"
},
"style": "v2",
"sitemapLocation": "sitemap.json",
......@@ -33,7 +30,7 @@
"selectedIconPath": "images/tabbar/homea.png"
},
{
"pagePath": "pages/msg/index",
"pagePath": "pages/msg/index/index",
"text": "消息",
"iconPath": "images/tabbar/msg.png",
"selectedIconPath": "images/tabbar/msga.png"
......
......@@ -18,7 +18,7 @@ let configMap = {
url: 'http://preapp.netease.im:8184'
},
online: {
appkey: 'b612b31e837c79c68f141aeb719d2b20',
appkey: '45c6af3c98409b18a84451215d0bdd6e',
url: 'https://app.netease.im'
},
};
......
......@@ -77,9 +77,9 @@ export default class IMController {
onpushevents: this.onPushEvents,
})
// 发送消息开始登陆
store.dispatch({
type: 'Login_StartLogin'
})
// store.dispatch({
// type: 'Login_StartLogin'
// })
}
/** 1
* 连接成功
......
import NetcallWeixin from '../vendors/NIM_Web_Netcall_weixin_v6.8.0.js'
import NIM from '../vendors/NIM_Web_NIM_weixin_v6.8.0.js'
import NIM from '../vendors/NIM_Web_NIM_weixin_v7.2.0.js'
import Emitter from '../utils/emitter.js'
let app = getApp()
......
// pages/msg/index.js
Page({
/**
* 页面的初始数据
*/
data: {
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
}
})
\ No newline at end of file
<view class='title'>
<text>消息(20)</text>
</view>
<view class="search">
<image src="/images/im/search.png"></image>
<text>搜索</text>
</view>
\ No newline at end of file
page{
font-family: -apple-system-font, Helvetica Neue, Helvetica, sans-serif;
font-size: 10pt;
/* line-height: 150%; */
min-height: 100%;
position: relative;
display: flex;
flex-direction: column;
align-items: stretch;
}
.title{
background: #f1f1f1;
padding: 70rpx 30rpx 2rpx 30rpx;
font-size: 16pt;
border-bottom: 2rpx solid #EEE;
}
.search{
background: #F4F8FB;
height: 60rpx;
margin: 10rpx 30rpx;
border-radius: 12rpx;
text-align: center;
line-height: 60rpx
}
.search image{
width: 30rpx;
height: 30rpx;
margin-right: 10rpx;
margin-top:15rpx;
vertical-align: middle;
}
.search text{
font-size: 28rpx;
color: rgb(175, 178, 185);
}
\ No newline at end of file
This diff is collapsed.
<view class='title'>
<text>消息(20)</text>
</view>
<view class="search">
<view class="{{showSearchBox==0?'':'hide'}}" bindtap="changeSearchBox" data-type="1">
<image src="/images/im/search.png"></image>
<text>搜索</text>
</view>
<input type='text' bindinput='searchInput' class="search-input {{showSearchBox==1?'':'hide'}}" bindblur="changeSearchBox" data-type="0" focus='{{isFocus}}'/>
</view>
<view class="msg-box">
<view class="msg-item">
<image class="avater" src="http://imgfile.oytour.com/New/Upload/User/20191018150051176.png"></image>
<view class="msg-content">
<view class="item-name">
罗超
</view>
<view class="lst-msg">
如果来不及的话,就直接使用Vue-table来做,这样会快一点
</view>
</view>
<view class="times">
<view class="timer">16:23</view>
<view>
<text class="pops">9</text>
</view>
</view>
</view>
<view class="msg-item" wx:if="{{chatList.length != 0}}" wx:for="{{chatList}}" wx:for-item="message" wx:key="message.time" data-session='{{message.session}}'>
<image class="avater" src="{{message.avatar}}"></image>
<view class="msg-content">
<view class="item-name">
{{message.nick}}
</view>
<view class="lst-msg">
{{message.lastestMsg}}
</view>
</view>
<view class="times">
<view class="timer">昨天</view>
<view wx:if="{{message.unread}}">
<text class="pops">{{message.unread || ''}}</text>
</view>
</view>
</view>
</view>
\ No newline at end of file
page{
font-family: -apple-system-font, Helvetica Neue, Helvetica, sans-serif;
font-size: 10pt;
/* line-height: 150%; */
min-height: 100%;
position: relative;
display: flex;
flex-direction: column;
align-items: stretch;
}
.title{
background: #f1f1f1;
padding: 70rpx 30rpx 2rpx 30rpx;
font-size: 16pt;
border-bottom: 2rpx solid #EEE;
}
.search{
background: #F4F8FB;
height: 60rpx;
margin: 10rpx 30rpx;
border-radius: 12rpx;
text-align: center;
line-height: 60rpx
}
.search image{
width: 30rpx;
height: 30rpx;
margin-right: 10rpx;
margin-top:15rpx;
vertical-align: top;
}
.search text{
font-size: 28rpx;
color: rgb(175, 178, 185);
}
.search .search-input{
border: none;
outline: none;
margin: 0 12rpx;
height: 60rpx;
line-height: 60rpx;
font-size: 28rpx;
background: url('http://imgfile.oytour.com/New/Upload/Cloud/2020-02/20200217080946488.png');
background-position:left center;
background-size:30rpx 30rpx;
text-align: left;
padding-left: 40rpx;
background-repeat: no-repeat;
}
.msg-box{
margin-top: 10rpx;
}
.msg-box .msg-item{
display: flex;
height: 100rpx;
padding: 20rpx 30rpx;
flex-direction: row;
justify-content: flex-start;
}
.msg-box .msg-item:active{
background: #F4F8FB;
}
.msg-box .msg-item .avater{
height: 100rpx;
width: 100rpx;
border-radius: 100rpx;
margin-right: 20rpx;
}
.msg-box .msg-item .msg-content{
flex: 1;
}
.msg-box .msg-item .msg-content .item-name{
font-size: 36rpx;
font-weight: 600;
}
.msg-box .msg-item .msg-content .lst-msg{
font-size: 28rpx;
color: #888;
text-overflow: ellipsis;
white-space: normal;
overflow: hidden;
display: -webkit-box;
-webkit-line-clamp: 1;
-webkit-box-orient: vertical;
}
.msg-box .msg-item .times{
width: 100rpx;
text-align: right;
}
.msg-box .msg-item .times .timer{
font-size: 26rpx;
color: #999;
flex: 1;
margin-top: 10rpx;
}
.msg-box .msg-item .times .pops{
font-size: 26rpx;
height: 24rpx;
padding: 10rpx;
min-width: 24rpx;
border-radius: 44rpx;
color: #FFF;
background: #EA005E;
margin-top: 10rpx;
display: inline-block;
text-align: center;
line-height: 24rpx;
}
.hide{
display: none;
}
\ No newline at end of file
......@@ -4,15 +4,23 @@
"ignore": []
},
"setting": {
"urlCheck": true,
"urlCheck": false,
"es6": true,
"postcss": true,
"minified": true,
"newFeature": true,
"autoAudits": false,
"coverView": true,
"autoAudits": false,
"showShadowRootInWxmlPanel": true,
"scopeDataCheck": false
"scopeDataCheck": false,
"checkInvalidKey": true,
"checkSiteMap": true,
"uploadWithSourceMap": true,
"babelSetting": {
"ignore": [],
"disablePlugins": [],
"outputPath": ""
}
},
"compileType": "miniprogram",
"libVersion": "2.0.4",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment