merge
This commit is contained in:
2
App.vue
2
App.vue
@@ -7,7 +7,7 @@
|
|||||||
export default {
|
export default {
|
||||||
onLaunch: function() {
|
onLaunch: function() {
|
||||||
im.initIm('lmxuhwaglu76d')
|
im.initIm('lmxuhwaglu76d')
|
||||||
return
|
// return
|
||||||
//#ifdef APP-PLUS
|
//#ifdef APP-PLUS
|
||||||
// 获取系统版本号
|
// 获取系统版本号
|
||||||
getVersions({
|
getVersions({
|
||||||
|
|||||||
@@ -1,3 +1,6 @@
|
|||||||
# ZhHealth
|
# ZhHealth
|
||||||
|
|
||||||
ZH健康
|
ZH健康
|
||||||
|
|
||||||
|
## uni-icons图标组件
|
||||||
|
[图标组件](https://hellouniapp.dcloud.net.cn/pages/extUI/icons/icons)
|
||||||
25
main.js
25
main.js
@@ -10,15 +10,16 @@ import Vue from 'vue'
|
|||||||
import store from './store'
|
import store from './store'
|
||||||
import uView from 'uview-ui'
|
import uView from 'uview-ui'
|
||||||
import filters from './utils/filters.js'
|
import filters from './utils/filters.js'
|
||||||
import {
|
|
||||||
usqlite
|
|
||||||
} from '@/uni_modules/onemue-USQLite/js_sdk/usqlite.js'
|
|
||||||
import model from '@/utils/im/models.js'
|
|
||||||
|
|
||||||
import {
|
import {
|
||||||
router,
|
router,
|
||||||
RouterMount
|
RouterMount
|
||||||
} from 'router'
|
} from 'router'
|
||||||
|
import {
|
||||||
|
usqlite
|
||||||
|
} from '@/uni_modules/onemue-USQLite/js_sdk/usqlite.js'
|
||||||
|
import {
|
||||||
|
contactModel
|
||||||
|
} from '@/utils/im/models.js'
|
||||||
|
|
||||||
Object.keys(filters).forEach(key => {
|
Object.keys(filters).forEach(key => {
|
||||||
Vue.filter(key, filters[key])
|
Vue.filter(key, filters[key])
|
||||||
@@ -29,12 +30,20 @@ Vue.use(router)
|
|||||||
|
|
||||||
Vue.config.productionTip = false
|
Vue.config.productionTip = false
|
||||||
Vue.prototype.$store = store
|
Vue.prototype.$store = store
|
||||||
uni.$sql = usqlite
|
|
||||||
uni.model = model
|
|
||||||
|
|
||||||
uni.$sql.connect({
|
usqlite.connect({
|
||||||
name: 'zh-health', // 数据库名称
|
name: 'zh-health', // 数据库名称
|
||||||
path: '_doc/health.db', // 路径
|
path: '_doc/health.db', // 路径
|
||||||
|
}, (err, res) => {
|
||||||
|
uni.getStorage({
|
||||||
|
key: 'FIRST_RUN',
|
||||||
|
fail: () => {
|
||||||
|
contactModel.create((err, res) => {
|
||||||
|
console.error('SQLITE 创建表格', err, res)
|
||||||
|
uni.setStorageSync('FIRST_RUN', 'X')
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
App.mpType = 'app'
|
App.mpType = 'app'
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
"name" : "ZH-HEALTH",
|
"name" : "ZH-HEALTH",
|
||||||
"appid" : "__UNI__C29473D",
|
"appid" : "__UNI__C29473D",
|
||||||
"description" : "ZH-HEALTH,您手上的健康管理专家",
|
"description" : "ZH-HEALTH,您手上的健康管理专家",
|
||||||
"versionName" : "1.0.17",
|
"versionName" : "1.0.20",
|
||||||
"versionCode" : 100,
|
"versionCode" : 100,
|
||||||
"transformPx" : false,
|
"transformPx" : false,
|
||||||
/* 5+App特有相关 */
|
/* 5+App特有相关 */
|
||||||
@@ -89,7 +89,7 @@
|
|||||||
"amap" : {
|
"amap" : {
|
||||||
"__platform__" : [ "android" ],
|
"__platform__" : [ "android" ],
|
||||||
"appkey_ios" : "",
|
"appkey_ios" : "",
|
||||||
"appkey_android" : "05b7f32ca9c897c8b63c505d92cd654b"
|
"appkey_android" : "1dfbe526a37dcb1f13263e0b5871ca4d"
|
||||||
},
|
},
|
||||||
"system" : {
|
"system" : {
|
||||||
"__platform__" : [ "android" ]
|
"__platform__" : [ "android" ]
|
||||||
@@ -98,41 +98,44 @@
|
|||||||
"maps" : {
|
"maps" : {
|
||||||
"amap" : {
|
"amap" : {
|
||||||
"appkey_ios" : "",
|
"appkey_ios" : "",
|
||||||
"appkey_android" : "05b7f32ca9c897c8b63c505d92cd654b"
|
"appkey_android" : "1dfbe526a37dcb1f13263e0b5871ca4d"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"icons" : {
|
"icons" : {
|
||||||
"android" : {
|
"android" : {
|
||||||
"hdpi" : "unpackage/res/icons/72x72.png",
|
"hdpi" : "",
|
||||||
"xhdpi" : "unpackage/res/icons/96x96.png",
|
"xhdpi" : "",
|
||||||
"xxhdpi" : "unpackage/res/icons/144x144.png",
|
"xxhdpi" : "",
|
||||||
"xxxhdpi" : "unpackage/res/icons/192x192.png"
|
"xxxhdpi" : ""
|
||||||
},
|
},
|
||||||
"ios" : {
|
"ios" : {
|
||||||
"appstore" : "unpackage/res/icons/1024x1024.png",
|
"appstore" : "",
|
||||||
"ipad" : {
|
"ipad" : {
|
||||||
"app" : "unpackage/res/icons/76x76.png",
|
"app" : "",
|
||||||
"app@2x" : "unpackage/res/icons/152x152.png",
|
"app@2x" : "",
|
||||||
"notification" : "unpackage/res/icons/20x20.png",
|
"notification" : "",
|
||||||
"notification@2x" : "unpackage/res/icons/40x40.png",
|
"notification@2x" : "",
|
||||||
"proapp@2x" : "unpackage/res/icons/167x167.png",
|
"proapp@2x" : "",
|
||||||
"settings" : "unpackage/res/icons/29x29.png",
|
"settings" : "",
|
||||||
"settings@2x" : "unpackage/res/icons/58x58.png",
|
"settings@2x" : "",
|
||||||
"spotlight" : "unpackage/res/icons/40x40.png",
|
"spotlight" : "",
|
||||||
"spotlight@2x" : "unpackage/res/icons/80x80.png"
|
"spotlight@2x" : ""
|
||||||
},
|
},
|
||||||
"iphone" : {
|
"iphone" : {
|
||||||
"app@2x" : "unpackage/res/icons/120x120.png",
|
"app@2x" : "",
|
||||||
"app@3x" : "unpackage/res/icons/180x180.png",
|
"app@3x" : "",
|
||||||
"notification@2x" : "unpackage/res/icons/40x40.png",
|
"notification@2x" : "",
|
||||||
"notification@3x" : "unpackage/res/icons/60x60.png",
|
"notification@3x" : "",
|
||||||
"settings@2x" : "unpackage/res/icons/58x58.png",
|
"settings@2x" : "",
|
||||||
"settings@3x" : "unpackage/res/icons/87x87.png",
|
"settings@3x" : "",
|
||||||
"spotlight@2x" : "unpackage/res/icons/80x80.png",
|
"spotlight@2x" : "",
|
||||||
"spotlight@3x" : "unpackage/res/icons/120x120.png"
|
"spotlight@3x" : ""
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
"splashscreen" : {
|
||||||
|
"androidStyle" : "common"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"nativePlugins" : {
|
"nativePlugins" : {
|
||||||
|
|||||||
@@ -18,9 +18,8 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view class="loadmore">
|
<view class="loadmore" @click="loadMore" v-if="members > users.length">
|
||||||
<u-icon name="arrow-right" @click="loadMore" v-if="members > users.length" color="#999" labelColor="#999"
|
查看更多群成员 <uni-icons size="30rpx" type="right"></uni-icons>
|
||||||
label="查看更多群成员" labelPos="left" :labelSize="labelSize" :size="iconSize" />
|
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<u-action-sheet :actions="actionMap" :title="actionTitle" cancelText="取消" @close="hideAction"
|
<u-action-sheet :actions="actionMap" :title="actionTitle" cancelText="取消" @close="hideAction"
|
||||||
@@ -66,14 +65,11 @@
|
|||||||
actionMap: [],
|
actionMap: [],
|
||||||
actionTitle: '',
|
actionTitle: '',
|
||||||
currentUser: {},
|
currentUser: {},
|
||||||
avatarSize: 40,
|
|
||||||
labelSize: 14,
|
labelSize: 14,
|
||||||
iconSize: 14
|
iconSize: 14
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
this.avatarSize = utils.rpx2px(84)
|
|
||||||
this.labelSize = utils.rpx2px(24)
|
|
||||||
this.iconSize = utils.rpx2px(26)
|
this.iconSize = utils.rpx2px(26)
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
@@ -324,12 +320,16 @@
|
|||||||
|
|
||||||
.loadmore {
|
.loadmore {
|
||||||
font-size: 26rpx;
|
font-size: 26rpx;
|
||||||
color: $text-gray-m;
|
color: $text-gray-m !important;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: row;
|
flex-direction: row;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
|
|
||||||
|
.uni-icons {
|
||||||
|
color: $text-gray-m !important;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -103,16 +103,11 @@
|
|||||||
this.callShow = true
|
this.callShow = true
|
||||||
break;
|
break;
|
||||||
case 'location':
|
case 'location':
|
||||||
// uni.showToast({
|
uni.chooseLocation({
|
||||||
// icon: 'none',
|
success: (c) => {
|
||||||
// title: '功能正在开发中'
|
console.log(c);
|
||||||
// })
|
}
|
||||||
// uni.chooseLocation({
|
})
|
||||||
// success: res => {
|
|
||||||
// console.log(res);
|
|
||||||
// // this.success()
|
|
||||||
// }
|
|
||||||
// })
|
|
||||||
break;
|
break;
|
||||||
case 'redpacket':
|
case 'redpacket':
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
|
|||||||
@@ -2,18 +2,12 @@
|
|||||||
<view v-if="!isRemote">
|
<view v-if="!isRemote">
|
||||||
<view class="state" v-if="isGroup">
|
<view class="state" v-if="isGroup">
|
||||||
<!-- 已发送 -->
|
<!-- 已发送 -->
|
||||||
<u-icon name="checkbox-mark" :size="iconSize" class="sent"
|
<uni-icons class="sent" type="checkmarkempty" size="28rpx" :color="message.sentStatus >= 30 ? '#34CE98' : '#999999'" />
|
||||||
:color="message.sentStatus >= 30 ? '#34CE98' : '#999999' " />
|
|
||||||
<!-- 已阅读 -->
|
|
||||||
<text class="readers">{{ readers }}</text>
|
<text class="readers">{{ readers }}</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="state" v-else>
|
<view class="state" v-else>
|
||||||
<!-- 已发送 -->
|
<uni-icons class="sent" type="checkmarkempty" size="28rpx" :color="message.sentStatus >= 30 ? '#34CE98' : '#999999'" />
|
||||||
<u-icon name="checkbox-mark" :size="iconSize" class="sent"
|
<uni-icons class="receive" type="checkmarkempty" size="28rpx" :color="message.sentStatus >= 50 ? '#34CE98' : '#999999'" />
|
||||||
:color="message.sentStatus >= 30 ? '#34CE98' : '#999999' " />
|
|
||||||
<!-- 已阅读 -->
|
|
||||||
<u-icon name="checkbox-mark" :size="iconSize" class="receive"
|
|
||||||
:color="message.sentStatus >= 50 ? '#34CE98' : '#999999' " />
|
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
@@ -2,8 +2,9 @@
|
|||||||
<view class="msg--call">
|
<view class="msg--call">
|
||||||
<view class="name" v-if="isGroup && isRemote">{{ contact(message.senderUserId).name }}</view>
|
<view class="name" v-if="isGroup && isRemote">{{ contact(message.senderUserId).name }}</view>
|
||||||
<view class="im--text" :class="isRemote ? 'left': 'right'">
|
<view class="im--text" :class="isRemote ? 'left': 'right'">
|
||||||
<u-icon name="camera" size="22" v-if="msg.mediaType == 1" :label="label" />
|
<uni-icons type="videocam" size="44rpx" v-if="msg.mediaType == 1" />
|
||||||
<u-icon name="phone" size="22" v-else :label="label" />
|
<uni-icons type="phone" size="40rpx" v-else />
|
||||||
|
{{ label }}
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
@@ -69,6 +70,7 @@
|
|||||||
color: $text-color;
|
color: $text-color;
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: row;
|
flex-direction: row;
|
||||||
|
align-items: center;
|
||||||
|
|
||||||
&.left {
|
&.left {
|
||||||
border-radius: 0 20rpx 20rpx 20rpx;
|
border-radius: 0 20rpx 20rpx 20rpx;
|
||||||
@@ -80,8 +82,8 @@
|
|||||||
background: $main-color;
|
background: $main-color;
|
||||||
color: white;
|
color: white;
|
||||||
|
|
||||||
.u-icon {
|
.uni-icons {
|
||||||
color: white;
|
color: white !important;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,10 +2,10 @@
|
|||||||
<view class="content">
|
<view class="content">
|
||||||
<!-- 用户信息 -->
|
<!-- 用户信息 -->
|
||||||
<view class="info-flex">
|
<view class="info-flex">
|
||||||
<u-avatar :src="userInfo.portraitUrl || require('@/static/user/cover.png')" shape="square" size="50"
|
<u-avatar :src="userInfo.portraitUrl || require('@/static/user/cover.png')" shape="square"
|
||||||
bg-color="#fff"></u-avatar>
|
:size="rpx2px(100)" bg-color="#fff"></u-avatar>
|
||||||
<view class="info-text">
|
<view class="info-text">
|
||||||
<view class="nickname">{{ userInfo.name }}</view>
|
<view class="nickname">{{ contact(targetId).name }} ({{ userInfo.name }})</view>
|
||||||
<view class="address" @longpress="copyAddress">地址:{{ userInfo.address }}</view>
|
<view class="address" @longpress="copyAddress">地址:{{ userInfo.address }}</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@@ -14,20 +14,16 @@
|
|||||||
<view class="item">
|
<view class="item">
|
||||||
<label>性别</label>
|
<label>性别</label>
|
||||||
<view class="text" v-if="userInfo.gender === 0">保密</view>
|
<view class="text" v-if="userInfo.gender === 0">保密</view>
|
||||||
<view class="text" v-if="userInfo.gender === 1">男</view>
|
<view class="text" v-else-if="userInfo.gender === 1">男</view>
|
||||||
<view class="text" v-if="userInfo.gender === 2">女</view>
|
<view class="text" v-else>女</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
<!-- 如果是好友 -->
|
||||||
<block v-if="userInfo.friendship ==='accepted'">
|
<block v-if="userInfo.friendship ==='accepted'">
|
||||||
<view class="info-btns">
|
<view class="info-btns">
|
||||||
<view class="item u-border-bottom" @click="setRemark">
|
<view class="item u-border-bottom" @click="setRemark">
|
||||||
<label>设置备注</label>
|
<label>设置备注</label>
|
||||||
<u-icon name="arrow-right" color="#eee" size="16" />
|
<uni-icons type="right" size="32rpx" />
|
||||||
</view>
|
|
||||||
<view class="item u-border-bottom" @click="setRemark">
|
|
||||||
<label>设置标签</label>
|
|
||||||
<u-icon name="arrow-right" color="#eee" size="16" />
|
|
||||||
</view>
|
</view>
|
||||||
<view class="item u-border-bottom">
|
<view class="item u-border-bottom">
|
||||||
<label>消息免打扰</label>
|
<label>消息免打扰</label>
|
||||||
@@ -69,6 +65,14 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</block>
|
</block>
|
||||||
|
|
||||||
|
<u-modal negativeTop="300" :show="modalShow" title="修改备注" showCancelButton @cancel="onHideModal"
|
||||||
|
@confirm="onChangeRemark">
|
||||||
|
<view class="slot-content">
|
||||||
|
<u--input placeholder="好友备注" border="surround" focus v-model="contactRemark" maxlength="12" />
|
||||||
|
</view>
|
||||||
|
</u-modal>
|
||||||
|
|
||||||
<u-action-sheet :actions="callActions" cancelText="取消" @close="callShow = false" @select="singleCall"
|
<u-action-sheet :actions="callActions" cancelText="取消" @close="callShow = false" @select="singleCall"
|
||||||
:show="callShow">
|
:show="callShow">
|
||||||
</u-action-sheet>
|
</u-action-sheet>
|
||||||
@@ -83,12 +87,17 @@
|
|||||||
} from '@/apis/interfaces/im.js'
|
} from '@/apis/interfaces/im.js'
|
||||||
import * as RongIMLib from '@/uni_modules/RongCloud-IMWrapper/js_sdk/index'
|
import * as RongIMLib from '@/uni_modules/RongCloud-IMWrapper/js_sdk/index'
|
||||||
import * as CallLib from '@/uni_modules/RongCloud-CallWrapper/lib/index'
|
import * as CallLib from '@/uni_modules/RongCloud-CallWrapper/lib/index'
|
||||||
|
import imBase from '../mixins/imBase.js'
|
||||||
|
|
||||||
// friendship: '' 没有好友关系
|
// friendship: '' 没有好友关系
|
||||||
// accepted 好友
|
// accepted 好友
|
||||||
// pending 申请中
|
// pending 申请中
|
||||||
// denied 拒绝
|
// denied 拒绝
|
||||||
// blocked 黑名单
|
// blocked 黑名单
|
||||||
export default {
|
export default {
|
||||||
|
mixins: [
|
||||||
|
imBase
|
||||||
|
],
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
targetId: '',
|
targetId: '',
|
||||||
@@ -107,7 +116,9 @@
|
|||||||
}
|
}
|
||||||
],
|
],
|
||||||
callShow: false,
|
callShow: false,
|
||||||
hasPeding: false
|
hasPeding: false,
|
||||||
|
modalShow: false,
|
||||||
|
contactRemark: ''
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onLoad(e) {
|
onLoad(e) {
|
||||||
@@ -151,7 +162,26 @@
|
|||||||
url: '/pages/im/private/chat?targetId=' + this.targetId
|
url: '/pages/im/private/chat?targetId=' + this.targetId
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
// 设置好友备注操作
|
||||||
setRemark() {
|
setRemark() {
|
||||||
|
this.modalShow = true
|
||||||
|
this.contactRemark = this.$store.getters.contactInfo(this.targetId).name
|
||||||
|
},
|
||||||
|
onHideModal() {
|
||||||
|
this.modalShow = false
|
||||||
|
},
|
||||||
|
onChangeRemark() {
|
||||||
|
this.$store.dispatch('setContactRemark', {
|
||||||
|
targetId: this.targetId,
|
||||||
|
remark: this.contactRemark
|
||||||
|
})
|
||||||
|
uni.showToast({
|
||||||
|
icon: 'none',
|
||||||
|
title: '备注设置成功'
|
||||||
|
})
|
||||||
|
this.onHideModal()
|
||||||
|
},
|
||||||
|
setTag() {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: '开发中',
|
title: '开发中',
|
||||||
icon: 'none'
|
icon: 'none'
|
||||||
@@ -344,6 +374,10 @@
|
|||||||
width: 200rpx;
|
width: 200rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.uni-icons {
|
||||||
|
color: $text-gray-m !important;
|
||||||
|
}
|
||||||
|
|
||||||
.text {
|
.text {
|
||||||
width: calc(100% - 200rpx);
|
width: calc(100% - 200rpx);
|
||||||
color: $text-gray-m;
|
color: $text-gray-m;
|
||||||
|
|||||||
@@ -26,7 +26,8 @@
|
|||||||
</u-checkbox-group>
|
</u-checkbox-group>
|
||||||
</u-index-list>
|
</u-index-list>
|
||||||
<view class="bottom">
|
<view class="bottom">
|
||||||
<span class="onInvite" @click="onInvite">完成<span>{{`(${checkboxValue.length})` || ''}}</span></span>
|
<span class="onInvite" v-if="canInvite"> 添加中<span>{{`(${checkboxValue.length})` || ''}}</span></span>
|
||||||
|
<span class="onInvite" v-else @click="onInvite">完成<span>{{`(${checkboxValue.length})` || ''}}</span></span>
|
||||||
</view>
|
</view>
|
||||||
</block>
|
</block>
|
||||||
<view class="no-lists" v-else>
|
<view class="no-lists" v-else>
|
||||||
@@ -63,7 +64,8 @@
|
|||||||
friends: [],
|
friends: [],
|
||||||
orignalFriends: [],
|
orignalFriends: [],
|
||||||
checkboxValue: [],
|
checkboxValue: [],
|
||||||
selectValue: []
|
selectValue: [],
|
||||||
|
canInvite:false
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
onLoad(e) {
|
onLoad(e) {
|
||||||
@@ -124,6 +126,7 @@
|
|||||||
onInvite() {
|
onInvite() {
|
||||||
console.log(this.checkboxValue, 'userIds.....')
|
console.log(this.checkboxValue, 'userIds.....')
|
||||||
console.log(this.selectValue, 'userIds.....')
|
console.log(this.selectValue, 'userIds.....')
|
||||||
|
this.canInvite = true
|
||||||
let userIds = []
|
let userIds = []
|
||||||
this.checkboxValue.filter(item => {
|
this.checkboxValue.filter(item => {
|
||||||
if (!utils.inArray(item, this.selectValue)) {
|
if (!utils.inArray(item, this.selectValue)) {
|
||||||
@@ -137,8 +140,10 @@
|
|||||||
animationType: 'pop-out',
|
animationType: 'pop-out',
|
||||||
animationDuration: 200
|
animationDuration: 200
|
||||||
});
|
});
|
||||||
|
this.canInvite = false
|
||||||
uni.$emit('groupInvitedUser')
|
uni.$emit('groupInvitedUser')
|
||||||
}).catch(err => {
|
}).catch(err => {
|
||||||
|
this.canInvite = false
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
icon: 'none',
|
icon: 'none',
|
||||||
title: err.message
|
title: err.message
|
||||||
|
|||||||
@@ -107,6 +107,7 @@
|
|||||||
conversations
|
conversations
|
||||||
}) => {
|
}) => {
|
||||||
if (code === 0) {
|
if (code === 0) {
|
||||||
|
console.log(conversations,',,,,,')
|
||||||
this.conversations = conversations
|
this.conversations = conversations
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -13,5 +13,10 @@ export default {
|
|||||||
sender() {
|
sender() {
|
||||||
return this.$store.getters.sender
|
return this.$store.getters.sender
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
rpx2px(size) {
|
||||||
|
return utils.rpx2px(size)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -70,9 +70,8 @@ export default {
|
|||||||
icon: 'none',
|
icon: 'none',
|
||||||
title: '消息撤回成功'
|
title: '消息撤回成功'
|
||||||
})
|
})
|
||||||
IMLib.getMessage(msg.messageId, res => {
|
msg.objectName = 'RC:RcNtf'
|
||||||
uni.$emit('onRecallMessage_' + msg.targetId, res.message)
|
uni.$emit('onRecallMessage_' + msg.targetId, msg)
|
||||||
})
|
|
||||||
} else {
|
} else {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
icon: 'none',
|
icon: 'none',
|
||||||
|
|||||||
@@ -1,4 +1,7 @@
|
|||||||
import im from "@/utils/im/index.js"
|
import im from "@/utils/im/index.js"
|
||||||
|
import {
|
||||||
|
contactModel
|
||||||
|
} from '@/utils/im/models.js'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
state: {
|
state: {
|
||||||
@@ -14,7 +17,7 @@ export default {
|
|||||||
const info = state.contacts[targetId]
|
const info = state.contacts[targetId]
|
||||||
|
|
||||||
return {
|
return {
|
||||||
name: info.name,
|
name: info.remark ? info.remark : info.name,
|
||||||
hash: info.hash,
|
hash: info.hash,
|
||||||
portraitUrl: info.localAvatar ? info.localAvatar : require('@/static/user/cover.png')
|
portraitUrl: info.localAvatar ? info.localAvatar : require('@/static/user/cover.png')
|
||||||
}
|
}
|
||||||
@@ -44,9 +47,31 @@ export default {
|
|||||||
name: contactInfo.name,
|
name: contactInfo.name,
|
||||||
portraitUrl: contactInfo.portraitUrl
|
portraitUrl: contactInfo.portraitUrl
|
||||||
}
|
}
|
||||||
|
<<<<<<< HEAD
|
||||||
}
|
}
|
||||||
|
=======
|
||||||
|
},
|
||||||
|
setContactRemark(state, contactInfo) {
|
||||||
|
Vue.set(state.contacts, contactInfo.targetId, contactInfo)
|
||||||
|
}
|
||||||
|
>>>>>>> 013c030963aef06a00ac33d5f767cbd97ef2ceac
|
||||||
},
|
},
|
||||||
actions: {
|
actions: {
|
||||||
|
setContactRemark({
|
||||||
|
commit
|
||||||
|
}, {
|
||||||
|
targetId,
|
||||||
|
remark
|
||||||
|
}) {
|
||||||
|
contactModel.find('targetId="' + targetId + '"', (err, result) => {
|
||||||
|
if (!err && result.length > 0) {
|
||||||
|
result[0].remark = remark
|
||||||
|
contactModel.update('targetId="' + targetId + '"', result[0], (err, res) => {
|
||||||
|
commit('setContactRemark', result[0])
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
setSenderInfo({
|
setSenderInfo({
|
||||||
commit
|
commit
|
||||||
}, contactInfo) {
|
}, contactInfo) {
|
||||||
@@ -63,8 +88,7 @@ export default {
|
|||||||
commit,
|
commit,
|
||||||
dispatch
|
dispatch
|
||||||
}, contactInfo) {
|
}, contactInfo) {
|
||||||
const model = uni.model.contactModel
|
contactModel.find('targetId="' + contactInfo.targetId + '"', (err, result) => {
|
||||||
model.find('targetId="' + contactInfo.targetId + '"', (err, result) => {
|
|
||||||
if (result.length == 0) {
|
if (result.length == 0) {
|
||||||
// 没有数据,直接新增一条
|
// 没有数据,直接新增一条
|
||||||
dispatch('initContact', contactInfo)
|
dispatch('initContact', contactInfo)
|
||||||
@@ -75,13 +99,13 @@ export default {
|
|||||||
targetId: contactInfo.targetId,
|
targetId: contactInfo.targetId,
|
||||||
name: contactInfo.name,
|
name: contactInfo.name,
|
||||||
hash: contactInfo.hash,
|
hash: contactInfo.hash,
|
||||||
|
type: contactInfo.type,
|
||||||
portraitUrl: contactInfo.portraitUrl,
|
portraitUrl: contactInfo.portraitUrl,
|
||||||
localAvatar: savedFilePath,
|
localAvatar: savedFilePath
|
||||||
type: contactInfo.type
|
|
||||||
}
|
}
|
||||||
model.update('targetId="' + contactInfo.targetId + '"', info, (err,
|
contactModel.update('targetId="' + contactInfo.targetId + '"', info, (err,
|
||||||
res) => {
|
res) => {
|
||||||
console.log('UPDATE AVATAR, ERR', err, info);
|
console.log('UPDATE AVATAR, ERR', err, info)
|
||||||
})
|
})
|
||||||
commit('updateContactInfo', info)
|
commit('updateContactInfo', info)
|
||||||
})
|
})
|
||||||
@@ -90,17 +114,17 @@ export default {
|
|||||||
targetId: contactInfo.targetId,
|
targetId: contactInfo.targetId,
|
||||||
name: contactInfo.name,
|
name: contactInfo.name,
|
||||||
hash: contactInfo.hash,
|
hash: contactInfo.hash,
|
||||||
|
type: contactInfo.type,
|
||||||
portraitUrl: contactInfo.portraitUrl,
|
portraitUrl: contactInfo.portraitUrl,
|
||||||
localAvatar: result[0].localAvatar,
|
localAvatar: result[0].localAvatar
|
||||||
type: contactInfo.type
|
|
||||||
}
|
}
|
||||||
model.update('targetId="' + contactInfo.targetId + '"', info, (err, res) => {
|
contactModel.update('targetId="' + contactInfo.targetId + '"', info, (err, res) => {
|
||||||
console.log('UPDATE NAME, ERR', err, info);
|
console.log('UPDATE NAME, ERR', err, info);
|
||||||
})
|
})
|
||||||
commit('updateContactInfo', info)
|
commit('updateContactInfo', info)
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
console.log('updateContact, 无操作');
|
console.log('updateContact, 无操作')
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
@@ -110,7 +134,6 @@ export default {
|
|||||||
}, contactInfo) {
|
}, contactInfo) {
|
||||||
// 将好友信息保存到vuex的内存中,方便立即使用
|
// 将好友信息保存到vuex的内存中,方便立即使用
|
||||||
commit('updateContactInfo', contactInfo)
|
commit('updateContactInfo', contactInfo)
|
||||||
const model = uni.model.contactModel
|
|
||||||
// 用户头像,是否需要下载到本地
|
// 用户头像,是否需要下载到本地
|
||||||
if (contactInfo.portraitUrl) {
|
if (contactInfo.portraitUrl) {
|
||||||
saveAvatar(contactInfo, (savedFilePath) => {
|
saveAvatar(contactInfo, (savedFilePath) => {
|
||||||
@@ -118,11 +141,13 @@ export default {
|
|||||||
targetId: contactInfo.targetId,
|
targetId: contactInfo.targetId,
|
||||||
name: contactInfo.name,
|
name: contactInfo.name,
|
||||||
hash: contactInfo.hash,
|
hash: contactInfo.hash,
|
||||||
|
type: contactInfo.type,
|
||||||
portraitUrl: contactInfo.portraitUrl,
|
portraitUrl: contactInfo.portraitUrl,
|
||||||
localAvatar: savedFilePath,
|
localAvatar: savedFilePath
|
||||||
type: contactInfo.type
|
|
||||||
}
|
}
|
||||||
model.insert(info, (err, res) => {})
|
contactModel.insert(info, (err, res) => {
|
||||||
|
console.error('保存头像', err, res)
|
||||||
|
})
|
||||||
// 保存头像后,更新信息
|
// 保存头像后,更新信息
|
||||||
commit('updateContactInfo', info)
|
commit('updateContactInfo', info)
|
||||||
})
|
})
|
||||||
@@ -132,11 +157,13 @@ export default {
|
|||||||
targetId: contactInfo.targetId,
|
targetId: contactInfo.targetId,
|
||||||
name: contactInfo.name,
|
name: contactInfo.name,
|
||||||
hash: contactInfo.hash,
|
hash: contactInfo.hash,
|
||||||
|
type: contactInfo.type,
|
||||||
portraitUrl: contactInfo.portraitUrl,
|
portraitUrl: contactInfo.portraitUrl,
|
||||||
localAvatar: '',
|
localAvatar: ''
|
||||||
type: contactInfo.type
|
|
||||||
}
|
}
|
||||||
model.insert(info, (err, res) => {})
|
contactModel.insert(info, (err, res) => {
|
||||||
|
console.error('没保存头像', err, res)
|
||||||
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
BIN
uni_modules/onemue-USQLite/.DS_Store
vendored
Normal file
BIN
uni_modules/onemue-USQLite/.DS_Store
vendored
Normal file
Binary file not shown.
@@ -1,7 +1,10 @@
|
|||||||
## 2.1.0(2022-01-14)
|
## 2.2.2(2022-02-18)
|
||||||
1. 新增了添加多个数据的事件选项(options, index)(感谢`@风扬`)
|
1. 解决了自增约束的部分bug
|
||||||
## 2.1.2(2022-01-14)
|
2. 解决了处理类型的问题
|
||||||
1. 新增了添加多个数据的事件选项(options, index)(感谢`@风扬`)
|
## 2.2.0(2022-02-16)
|
||||||
|
1. 重新处理了判断类型的方法
|
||||||
|
2. 解决了`no connect`的问题
|
||||||
|
3. 新增了自增约束,需要为数字类型
|
||||||
## 2.1.0(2022-01-14)
|
## 2.1.0(2022-01-14)
|
||||||
1. 新增了添加多个数据的事件选项(options, index)(感谢`@风扬`)
|
1. 新增了添加多个数据的事件选项(options, index)(感谢`@风扬`)
|
||||||
## 2.0.2(2022-01-05)
|
## 2.0.2(2022-01-05)
|
||||||
|
|||||||
@@ -37,10 +37,13 @@ class Utils {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Utils.log(primaryKeyArr.length);
|
Utils.log(primaryKeyArr.length);
|
||||||
if (primaryKeyArr.length>=1) {
|
if (primaryKeyArr.length>1) {
|
||||||
sql = `CREATE TABLE '${name}' (${sqlArr.join(', ')}, PRIMARY KEY (${primaryKeyArr.join()}))`;
|
|
||||||
}else{
|
sql = `CREATE TABLE '${name}' (${sqlArr.join(', ').replaceAll(' PRIMARY KEY','')}, PRIMARY KEY (${primaryKeyArr.join()}))`;
|
||||||
|
}
|
||||||
|
else{
|
||||||
sql = `CREATE TABLE '${name}' (${sqlArr.join(', ')})`;
|
sql = `CREATE TABLE '${name}' (${sqlArr.join(', ')})`;
|
||||||
}
|
}
|
||||||
Utils.log(`modelSql :${sql}`);
|
Utils.log(`modelSql :${sql}`);
|
||||||
@@ -59,6 +62,22 @@ class Utils {
|
|||||||
}
|
}
|
||||||
|
|
||||||
restrainArray.push(Utils.toType(options.type));
|
restrainArray.push(Utils.toType(options.type));
|
||||||
|
|
||||||
|
// 主键
|
||||||
|
if (options.primaryKey == true) {
|
||||||
|
if(options.autoIncrement != true){
|
||||||
|
restrainArray.push('PRIMARY KEY');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 自增
|
||||||
|
if (Utils.isNumber(options.type)&&options.autoIncrement == true) {
|
||||||
|
restrainArray.pop();
|
||||||
|
restrainArray.push('INTEGER');
|
||||||
|
restrainArray.push('PRIMARY KEY');
|
||||||
|
restrainArray.push('AUTOINCREMENT');
|
||||||
|
}
|
||||||
|
|
||||||
// 非空
|
// 非空
|
||||||
if (options.notNull == true) {
|
if (options.notNull == true) {
|
||||||
restrainArray.push('NOT NULL');
|
restrainArray.push('NOT NULL');
|
||||||
@@ -74,10 +93,6 @@ class Utils {
|
|||||||
restrainArray.push('UNIQUE');
|
restrainArray.push('UNIQUE');
|
||||||
}
|
}
|
||||||
|
|
||||||
// 主键
|
|
||||||
// if (options.primaryKey === true) {
|
|
||||||
// restrainArray.push('PRIMARY KEY');
|
|
||||||
// }
|
|
||||||
|
|
||||||
// 检查
|
// 检查
|
||||||
if (options.check) {
|
if (options.check) {
|
||||||
@@ -87,27 +102,44 @@ class Utils {
|
|||||||
return restrainArray.join(' ');
|
return restrainArray.join(' ');
|
||||||
}
|
}
|
||||||
|
|
||||||
// 联合主键
|
|
||||||
static getUnionPrimaryKey() {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
static toType(jsType) {
|
static toType(jsType) {
|
||||||
let sqliteType = '';
|
let sqliteType = '';
|
||||||
if (jsType == Number) {
|
if (Utils.isNumber(jsType)) {
|
||||||
sqliteType = 'numeric';
|
sqliteType = 'numeric';
|
||||||
} else if (jsType == Date) {
|
} else if (Utils.isDate(jsType)) {
|
||||||
sqliteType = 'timestamp';
|
sqliteType = 'timestamp';
|
||||||
} else {
|
} else {
|
||||||
sqliteType = 'varchar';
|
sqliteType = 'varchar';
|
||||||
}
|
}
|
||||||
return sqliteType;
|
return sqliteType;
|
||||||
}
|
}
|
||||||
|
|
||||||
static log() {
|
static log() {
|
||||||
if (config.deBug) {
|
if (config.deBug) {
|
||||||
console.log.apply(null, arguments);
|
console.log.apply(null, arguments);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static warn() {
|
||||||
|
if (config.deBug) {
|
||||||
|
console.warn.apply(null, arguments);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static error() {
|
||||||
|
console.error.apply(null, arguments);
|
||||||
|
}
|
||||||
|
|
||||||
|
static isArray(value){ return Object.prototype.toString.call(value) === '[object Array]'}
|
||||||
|
static isObject(value){ return Object.prototype.toString.call(value) === '[object Object]'}
|
||||||
|
static isString(value){ return Object.prototype.toString.call(value) === '[object String]'}
|
||||||
|
static isFunction(value){ return (value === Function || Object.prototype.toString.call(value) === '[object Function]')}
|
||||||
|
static isNumber(value){ return (value === Number || Object.prototype.toString.call(value) === '[object Number]')}
|
||||||
|
static isNaN(value){ return (Object.prototype.toString.call(value) === '[object Number]' && isNaN(value))}
|
||||||
|
static isBoolean(value){ return Object.prototype.toString.call(value) === '[object Boolean]'}
|
||||||
|
static isUndefined(value){ return Object.prototype.toString.call(value) === '[object Undefined]'}
|
||||||
|
static isModel(value){ return Object.prototype.toString.call(value) === '[object Model]'}
|
||||||
|
static isDate(value){ return (value === Date||Object.prototype.toString.call(value) === '[object Date]')}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -118,7 +150,7 @@ class Model {
|
|||||||
/**
|
/**
|
||||||
* @constructor
|
* @constructor
|
||||||
* @param {String} name 数据库表名
|
* @param {String} name 数据库表名
|
||||||
* @param {Object} options 数据表列对象
|
* @param {} options 数据表列对象
|
||||||
* @returns
|
* @returns
|
||||||
*/
|
*/
|
||||||
constructor(name, options) {
|
constructor(name, options) {
|
||||||
@@ -129,7 +161,10 @@ class Model {
|
|||||||
if (config.isConnect) {
|
if (config.isConnect) {
|
||||||
self.repair();
|
self.repair();
|
||||||
} else {
|
} else {
|
||||||
console.error('no connect');
|
if(!config.name||!config.path){
|
||||||
|
console.error('"config.name" or "config.path" is empty');
|
||||||
|
}
|
||||||
|
usqlite.connect(config);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -138,21 +173,27 @@ class Model {
|
|||||||
* @param {String|Array} options
|
* @param {String|Array} options
|
||||||
* - String WHERE 内容
|
* - String WHERE 内容
|
||||||
* - Array 需要查询的列
|
* - Array 需要查询的列
|
||||||
* @param {*} callback
|
* @param {Function} callback
|
||||||
* @returns
|
* @returns
|
||||||
*/
|
*/
|
||||||
find(options, callback) {
|
find(options, callback) {
|
||||||
let sql = '';
|
let sql = '';
|
||||||
let self = this;
|
let self = this;
|
||||||
self.repair();
|
self.repair();
|
||||||
if (!callback) {
|
if(!(Utils.isString(options)||Utils.isArray(options)||Utils.isFunction(options))) {
|
||||||
|
Utils.error('The first parameter of Model.find should be "Array", "String" or "Function" (when there is only one parameter).')
|
||||||
|
}
|
||||||
|
if(!callback&&!(Utils.isFunction(options))) {
|
||||||
|
Utils.error('The second parameter of Model.find should be "Function".')
|
||||||
|
}
|
||||||
|
if (!callback&&Utils.isFunction(options)) {
|
||||||
sql = `SELECT * FROM '${this.name}'`; // 查找全部
|
sql = `SELECT * FROM '${this.name}'`; // 查找全部
|
||||||
callback = options;
|
callback = options;
|
||||||
} else if (options.constructor == Array) {
|
} else if (Utils.isArray(options)) {
|
||||||
sql = `SELECT ${options.join()} FROM '${this.name}'`; // 查找制定列
|
sql = `SELECT ${options.join()} FROM '${this.name}'`; // 查找制定列
|
||||||
} else if (options.constructor == String) {
|
} else if (Utils.isString(options)) {
|
||||||
sql = `SELECT * FROM '${this.name}' WHERE ${options}`; // 制定条件查询
|
sql = `SELECT * FROM '${this.name}' WHERE ${options}`; // 制定条件查询
|
||||||
};
|
}
|
||||||
|
|
||||||
Utils.log(`find: ${sql}`);
|
Utils.log(`find: ${sql}`);
|
||||||
|
|
||||||
@@ -180,6 +221,12 @@ class Model {
|
|||||||
let sql = '';
|
let sql = '';
|
||||||
let self = this;
|
let self = this;
|
||||||
self.repair();
|
self.repair();
|
||||||
|
if(!Utils.isObject(options)){
|
||||||
|
Utils.error('The first parameter of Model.limit should be "Object".')
|
||||||
|
}
|
||||||
|
if(!Utils.isFunction(callback)){
|
||||||
|
Utils.error('The second parameter of Model.limit should be "Function".')
|
||||||
|
}
|
||||||
|
|
||||||
if (!options.where) {
|
if (!options.where) {
|
||||||
// 不存在 where
|
// 不存在 where
|
||||||
@@ -215,12 +262,19 @@ class Model {
|
|||||||
let self = this;
|
let self = this;
|
||||||
self.repair();
|
self.repair();
|
||||||
|
|
||||||
|
if(!(Utils.isObject(options)||Util.isArray(options))){
|
||||||
|
Utils.error('The first parameter of Model.insert should be "Object" or "Array".')
|
||||||
|
}
|
||||||
|
if(!Utils.isFunction(callback)){
|
||||||
|
Utils.error('The second parameter of Model.insert should be "Function".')
|
||||||
|
}
|
||||||
|
|
||||||
if (config.isConnect) {
|
if (config.isConnect) {
|
||||||
if (options.constructor == Array) {
|
if (Utils.isArray(options)) {
|
||||||
for (var i = 0; i < options.length; i++) {
|
for (var i = 0; i < options.length; i++) {
|
||||||
this.insert(options[i], callback, i);
|
this.insert(options[i], callback, i);
|
||||||
}
|
}
|
||||||
} else if (options.constructor == Object) {
|
} else if (Utils.isObject(options)) {
|
||||||
let keys = [];
|
let keys = [];
|
||||||
let values = [];
|
let values = [];
|
||||||
let index = arguments[3]??null;
|
let index = arguments[3]??null;
|
||||||
@@ -255,7 +309,7 @@ class Model {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @description 更新数据
|
* @description 更新数据
|
||||||
* @param {Object} options:可选参数 更新条件
|
* @param {String} options:可选参数 更新条件
|
||||||
* @param {Object} obj: 修改后的数据
|
* @param {Object} obj: 修改后的数据
|
||||||
* @param {Function} callback :(err,results)=>{}
|
* @param {Function} callback :(err,results)=>{}
|
||||||
*/
|
*/
|
||||||
@@ -265,6 +319,13 @@ class Model {
|
|||||||
let items = [];
|
let items = [];
|
||||||
self.repair();
|
self.repair();
|
||||||
|
|
||||||
|
if(!(Utils.isObject(options)||Utils.isString(options))){
|
||||||
|
Utils.error('The first parameter of Model.update should be "Object" or "String".')
|
||||||
|
}
|
||||||
|
if(!(Utils.isObject(obj)||Utils.isFunction(obj))){
|
||||||
|
Utils.error('The second parameter of Model.update should be "Objrct" or "Function".')
|
||||||
|
}
|
||||||
|
|
||||||
if (!callback) {
|
if (!callback) {
|
||||||
// 不存在options
|
// 不存在options
|
||||||
callback = obj;
|
callback = obj;
|
||||||
@@ -298,7 +359,7 @@ class Model {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @description 删除数据
|
* @description 删除数据
|
||||||
* @param {Object} options :可选参数 删除条件
|
* @param {String} options :可选参数 删除条件
|
||||||
* @param {Function} callback :(err,results)=>{}
|
* @param {Function} callback :(err,results)=>{}
|
||||||
*/
|
*/
|
||||||
delete(options, callback) {
|
delete(options, callback) {
|
||||||
@@ -306,6 +367,13 @@ class Model {
|
|||||||
let self = this;
|
let self = this;
|
||||||
self.repair();
|
self.repair();
|
||||||
|
|
||||||
|
if(!(Utils.isString(options)||Utils.isFunction(options))){
|
||||||
|
Utils.error('The first parameter of Model.delete should be "Object" or "Function".')
|
||||||
|
}
|
||||||
|
if(callback&&!Utils.isFunction(callback)){
|
||||||
|
Utils.error('The second parameter of Model.delete should be "Function".')
|
||||||
|
}
|
||||||
|
|
||||||
if (!callback) {
|
if (!callback) {
|
||||||
sql = `DELETE FROM '${this.name}'`;
|
sql = `DELETE FROM '${this.name}'`;
|
||||||
callback = options;
|
callback = options;
|
||||||
@@ -330,7 +398,7 @@ class Model {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @description 重命名或者新增列
|
* @description 重命名或者新增列
|
||||||
* @param {Object} options 参数 数组为新增多列 对象为新增单列{aa} 字符串重命名
|
* @param {Object|Array|String} options 参数 数组为新增多列 对象为新增单列{aa} 字符串重命名
|
||||||
* @param {Function} callback :(err,results)=>{}
|
* @param {Function} callback :(err,results)=>{}
|
||||||
* @return:
|
* @return:
|
||||||
*/
|
*/
|
||||||
@@ -338,12 +406,18 @@ class Model {
|
|||||||
let self = this;
|
let self = this;
|
||||||
let sql = '';
|
let sql = '';
|
||||||
self.repair();
|
self.repair();
|
||||||
|
if(!(Utils.isObject(options)||Utils.isArray(options)||Utils.isString(options))){
|
||||||
|
Utils.error('The first parameter of Model.alter should be "Object", "Array" or "String".')
|
||||||
|
}
|
||||||
|
if(!Utils.isFunction(callback)){
|
||||||
|
Utils.error('The second parameter of Model.alter should be "Function".')
|
||||||
|
}
|
||||||
|
|
||||||
if (options.constructor == Array) { // 新增多列
|
if (Utils.isArray(options)) { // 新增多列
|
||||||
for (let i = 0; i < options.length; i++) {
|
for (let i = 0; i < options.length; i++) {
|
||||||
self.alter(options[i], callback);
|
self.alter(options[i], callback);
|
||||||
}
|
}
|
||||||
} else if (options.constructor == Object) { // 新增单列
|
} else if (Utils.isObject(options)) { // 新增单列
|
||||||
let column = Utils.restrain(options.name, options.option);
|
let column = Utils.restrain(options.name, options.option);
|
||||||
sql = `ALTER TABLE '${this.name}' ADD COLUMN ${column}`
|
sql = `ALTER TABLE '${this.name}' ADD COLUMN ${column}`
|
||||||
} else if (options.constructor == String) { // 重命名
|
} else if (options.constructor == String) { // 重命名
|
||||||
@@ -374,13 +448,13 @@ class Model {
|
|||||||
*/
|
*/
|
||||||
join(model, options, callback) {
|
join(model, options, callback) {
|
||||||
if (!model) {
|
if (!model) {
|
||||||
console.error('"model" cannot be empty.');
|
Utils.error('"model" cannot be empty.');
|
||||||
}
|
}
|
||||||
if (options.constructor != Object) {
|
if (!Utils.isObject(options)) {
|
||||||
console.error('The type of "options" is wrong, it should be "Object".');
|
Utils.error('The type of "options" is wrong, it should be "Object".');
|
||||||
}
|
}
|
||||||
if (!options.type || !options.predicate) {
|
if (!options.type || !options.predicate) {
|
||||||
console.error('Missing required parameters');
|
Utils.error('Missing required parameters');
|
||||||
}
|
}
|
||||||
|
|
||||||
let leftName = this.name;
|
let leftName = this.name;
|
||||||
@@ -427,6 +501,13 @@ class Model {
|
|||||||
* @param {Function} callback :(err,results)=>{}
|
* @param {Function} callback :(err,results)=>{}
|
||||||
*/
|
*/
|
||||||
sql(sql, callback) {
|
sql(sql, callback) {
|
||||||
|
if (!Utils.isString(sql)) {
|
||||||
|
Utils.error('"The type of "sql" is wrong, it should be "String".');
|
||||||
|
}
|
||||||
|
if (callback&&!Utils.isFunction(callback)) {
|
||||||
|
Utils.error('The type of "callback" is wrong, it should be "Function".');
|
||||||
|
}
|
||||||
|
|
||||||
let self = this;
|
let self = this;
|
||||||
self.repair();
|
self.repair();
|
||||||
|
|
||||||
@@ -449,6 +530,10 @@ class Model {
|
|||||||
* @param {Function} callback
|
* @param {Function} callback
|
||||||
*/
|
*/
|
||||||
isExist(callback) {
|
isExist(callback) {
|
||||||
|
if (callback&&!Utils.isFunction(callback)) {
|
||||||
|
Utils.error('The type of "callback" is wrong, it should be "Function".');
|
||||||
|
}
|
||||||
|
|
||||||
let sql = `SELECT count(*) AS isExist FROM sqlite_master WHERE type='table' AND name='${this.name}'`;
|
let sql = `SELECT count(*) AS isExist FROM sqlite_master WHERE type='table' AND name='${this.name}'`;
|
||||||
let self = this;
|
let self = this;
|
||||||
Utils.log(`isExist: ${sql}`);
|
Utils.log(`isExist: ${sql}`);
|
||||||
@@ -470,6 +555,10 @@ class Model {
|
|||||||
* @param {Function} callback
|
* @param {Function} callback
|
||||||
*/
|
*/
|
||||||
drop(callback) {
|
drop(callback) {
|
||||||
|
if (callback&&!Utils.isFunction(callback)) {
|
||||||
|
Utils.error('The type of "callback" is wrong, it should be "Function".');
|
||||||
|
}
|
||||||
|
|
||||||
var sql = `DROP TABLE '${this.name}'`;
|
var sql = `DROP TABLE '${this.name}'`;
|
||||||
let self = this;
|
let self = this;
|
||||||
self.repair();
|
self.repair();
|
||||||
@@ -493,6 +582,10 @@ class Model {
|
|||||||
* @param {Function} callback
|
* @param {Function} callback
|
||||||
*/
|
*/
|
||||||
create(callback) {
|
create(callback) {
|
||||||
|
if (callback&&!Utils.isFunction(callback)) {
|
||||||
|
Utils.error('The type of "callback" is wrong, it should be "Function".');
|
||||||
|
}
|
||||||
|
|
||||||
let self = this;
|
let self = this;
|
||||||
let sql = Utils.modelSql(self.name, self.options);
|
let sql = Utils.modelSql(self.name, self.options);
|
||||||
Utils.log(`create: ${sql}`);
|
Utils.log(`create: ${sql}`);
|
||||||
@@ -574,6 +667,7 @@ export class usqlite {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @description 断开数据库
|
* @description 断开数据库
|
||||||
* @param {*} callback
|
* @param {*} callback
|
||||||
@@ -591,6 +685,19 @@ export class usqlite {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
static closeAsync(options){
|
||||||
|
plus.sqlite.closeDatabase({
|
||||||
|
name: config.name, //数据库名称
|
||||||
|
path: config.path, //数据库地址
|
||||||
|
success(e) {
|
||||||
|
config.isConnect = false;
|
||||||
|
callback(null, e);
|
||||||
|
},
|
||||||
|
fail(e) {
|
||||||
|
callback(e);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
/**
|
/**
|
||||||
* @description 创建 Model 对象
|
* @description 创建 Model 对象
|
||||||
* @example
|
* @example
|
||||||
|
|||||||
BIN
uni_modules/onemue-USQLite/js_sdk/usqlite.js.zip
Normal file
BIN
uni_modules/onemue-USQLite/js_sdk/usqlite.js.zip
Normal file
Binary file not shown.
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"id": "onemue-USQLite",
|
"id": "onemue-USQLite",
|
||||||
"displayName": "u-SQLite V2",
|
"displayName": "u-SQLite V2",
|
||||||
"version": "2.1.0",
|
"version": "2.2.2",
|
||||||
"description": "基于ORM技术,使用对象的方式来操作sqlite数据库,而无需编写任何sql语句.",
|
"description": "基于ORM技术,使用对象的方式来操作sqlite数据库,而无需编写任何sql语句.",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"USQLite,数据库操作,缓存,大数据缓存,sqlite,sql,orm"
|
"USQLite,数据库操作,缓存,大数据缓存,sqlite,sql,orm"
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
<h2>onemue-USQLite</h2>
|
<h2>onemue-USQLite</h2><h2>onemue-USQLite</h2>
|
||||||
|
|
||||||
|
<h2 style="color:red">没有特别说明,均为异步函数</h2>
|
||||||
> u-SQLite 交流群:643867519
|
> u-SQLite 交流群:643867519
|
||||||
> 如果觉的当前插件对你有帮助可以前往 [github](https://github.com/onemue/u-sqlite) 点 star!
|
> 如果觉的当前插件对你有帮助可以前往 [github](https://github.com/onemue/u-sqlite) 点 star!
|
||||||
|
|
||||||
@@ -49,6 +50,7 @@ let studentModel = uni.$sql.model('student',{
|
|||||||
- unique UNIQUE 不重复
|
- unique UNIQUE 不重复
|
||||||
- default DEFAULT 默认值
|
- default DEFAULT 默认值
|
||||||
- notNull NOT NULL 非空
|
- notNull NOT NULL 非空
|
||||||
|
- autoIncrement AUTOINCREMENT 非空
|
||||||
|
|
||||||
**联合主键**
|
**联合主键**
|
||||||
|
|
||||||
|
|||||||
@@ -1,3 +1,9 @@
|
|||||||
|
## 1.3.5(2022-01-24)
|
||||||
|
- 优化 size 属性可以传入不带单位的字符串数值
|
||||||
|
## 1.3.4(2022-01-24)
|
||||||
|
- 优化 size 支持其他单位
|
||||||
|
## 1.3.3(2022-01-17)
|
||||||
|
- 修复 nvue 有些图标不显示的bug,兼容老版本图标
|
||||||
## 1.3.2(2021-12-01)
|
## 1.3.2(2021-12-01)
|
||||||
- 优化 示例可复制图标名称
|
- 优化 示例可复制图标名称
|
||||||
## 1.3.1(2021-11-23)
|
## 1.3.1(2021-11-23)
|
||||||
|
|||||||
@@ -173,6 +173,13 @@ export default {
|
|||||||
"unicode": "e6bb",
|
"unicode": "e6bb",
|
||||||
"unicode_decimal": 59067
|
"unicode_decimal": 59067
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"icon_id": "24923353",
|
||||||
|
"name": "arrowthinright",
|
||||||
|
"font_class": "arrowthinright",
|
||||||
|
"unicode": "e6bb",
|
||||||
|
"unicode_decimal": 59067
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"icon_id": "24923354",
|
"icon_id": "24923354",
|
||||||
"name": "arrowthinleft",
|
"name": "arrowthinleft",
|
||||||
@@ -180,6 +187,13 @@ export default {
|
|||||||
"unicode": "e6bc",
|
"unicode": "e6bc",
|
||||||
"unicode_decimal": 59068
|
"unicode_decimal": 59068
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"icon_id": "24923354",
|
||||||
|
"name": "arrowthinleft",
|
||||||
|
"font_class": "arrowthinleft",
|
||||||
|
"unicode": "e6bc",
|
||||||
|
"unicode_decimal": 59068
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"icon_id": "24923355",
|
"icon_id": "24923355",
|
||||||
"name": "arrowthinup",
|
"name": "arrowthinup",
|
||||||
@@ -187,12 +201,25 @@ export default {
|
|||||||
"unicode": "e6bd",
|
"unicode": "e6bd",
|
||||||
"unicode_decimal": 59069
|
"unicode_decimal": 59069
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"icon_id": "24923355",
|
||||||
|
"name": "arrowthinup",
|
||||||
|
"font_class": "arrowthinup",
|
||||||
|
"unicode": "e6bd",
|
||||||
|
"unicode_decimal": 59069
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"icon_id": "24923356",
|
"icon_id": "24923356",
|
||||||
"name": "arrowthindown",
|
"name": "arrowthindown",
|
||||||
"font_class": "arrow-down",
|
"font_class": "arrow-down",
|
||||||
"unicode": "e6be",
|
"unicode": "e6be",
|
||||||
"unicode_decimal": 59070
|
"unicode_decimal": 59070
|
||||||
|
},{
|
||||||
|
"icon_id": "24923356",
|
||||||
|
"name": "arrowthindown",
|
||||||
|
"font_class": "arrowthindown",
|
||||||
|
"unicode": "e6be",
|
||||||
|
"unicode_decimal": 59070
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"icon_id": "24923349",
|
"icon_id": "24923349",
|
||||||
@@ -200,6 +227,12 @@ export default {
|
|||||||
"font_class": "bottom",
|
"font_class": "bottom",
|
||||||
"unicode": "e6b8",
|
"unicode": "e6b8",
|
||||||
"unicode_decimal": 59064
|
"unicode_decimal": 59064
|
||||||
|
},{
|
||||||
|
"icon_id": "24923349",
|
||||||
|
"name": "arrowdown",
|
||||||
|
"font_class": "arrowdown",
|
||||||
|
"unicode": "e6b8",
|
||||||
|
"unicode_decimal": 59064
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"icon_id": "24923346",
|
"icon_id": "24923346",
|
||||||
@@ -208,6 +241,13 @@ export default {
|
|||||||
"unicode": "e6b5",
|
"unicode": "e6b5",
|
||||||
"unicode_decimal": 59061
|
"unicode_decimal": 59061
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"icon_id": "24923346",
|
||||||
|
"name": "arrowright",
|
||||||
|
"font_class": "arrowright",
|
||||||
|
"unicode": "e6b5",
|
||||||
|
"unicode_decimal": 59061
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"icon_id": "24923347",
|
"icon_id": "24923347",
|
||||||
"name": "arrowup",
|
"name": "arrowup",
|
||||||
@@ -215,6 +255,13 @@ export default {
|
|||||||
"unicode": "e6b6",
|
"unicode": "e6b6",
|
||||||
"unicode_decimal": 59062
|
"unicode_decimal": 59062
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"icon_id": "24923347",
|
||||||
|
"name": "arrowup",
|
||||||
|
"font_class": "arrowup",
|
||||||
|
"unicode": "e6b6",
|
||||||
|
"unicode_decimal": 59062
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"icon_id": "24923348",
|
"icon_id": "24923348",
|
||||||
"name": "arrowleft",
|
"name": "arrowleft",
|
||||||
@@ -222,6 +269,13 @@ export default {
|
|||||||
"unicode": "e6b7",
|
"unicode": "e6b7",
|
||||||
"unicode_decimal": 59063
|
"unicode_decimal": 59063
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"icon_id": "24923348",
|
||||||
|
"name": "arrowleft",
|
||||||
|
"font_class": "arrowleft",
|
||||||
|
"unicode": "e6b7",
|
||||||
|
"unicode_decimal": 59063
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"icon_id": "24923334",
|
"icon_id": "24923334",
|
||||||
"name": "eye",
|
"name": "eye",
|
||||||
|
|||||||
@@ -1,14 +1,18 @@
|
|||||||
<template>
|
<template>
|
||||||
<!-- #ifdef APP-NVUE -->
|
<!-- #ifdef APP-NVUE -->
|
||||||
<text :style="{ color: color, 'font-size': size + 'px' }" class="uni-icons" @click="_onClick">{{unicode}}</text>
|
<text :style="{ color: color, 'font-size': iconSize }" class="uni-icons" @click="_onClick">{{unicode}}</text>
|
||||||
<!-- #endif -->
|
<!-- #endif -->
|
||||||
<!-- #ifndef APP-NVUE -->
|
<!-- #ifndef APP-NVUE -->
|
||||||
<text :style="{ color: color, 'font-size': size + 'px' }" class="uni-icons" :class="['uniui-'+type,customPrefix,customPrefix?type:'']" @click="_onClick"></text>
|
<text :style="{ color: color, 'font-size': iconSize }" class="uni-icons" :class="['uniui-'+type,customPrefix,customPrefix?type:'']" @click="_onClick"></text>
|
||||||
<!-- #endif -->
|
<!-- #endif -->
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import icons from './icons.js';
|
import icons from './icons.js';
|
||||||
|
const getVal = (val) => {
|
||||||
|
const reg = /^[0-9]*$/g
|
||||||
|
return (typeof val === 'number' || reg.test(val) )? val + 'px' : val;
|
||||||
|
}
|
||||||
// #ifdef APP-NVUE
|
// #ifdef APP-NVUE
|
||||||
var domModule = weex.requireModule('dom');
|
var domModule = weex.requireModule('dom');
|
||||||
import iconUrl from './uniicons.ttf'
|
import iconUrl from './uniicons.ttf'
|
||||||
@@ -61,6 +65,9 @@
|
|||||||
return unescape(`%u${code.unicode}`)
|
return unescape(`%u${code.unicode}`)
|
||||||
}
|
}
|
||||||
return ''
|
return ''
|
||||||
|
},
|
||||||
|
iconSize(){
|
||||||
|
return getVal(this.size)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"id": "uni-icons",
|
"id": "uni-icons",
|
||||||
"displayName": "uni-icons 图标",
|
"displayName": "uni-icons 图标",
|
||||||
"version": "1.3.2",
|
"version": "1.3.5",
|
||||||
"description": "图标组件,用于展示移动端常见的图标,可自定义颜色、大小。",
|
"description": "图标组件,用于展示移动端常见的图标,可自定义颜色、大小。",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"uni-ui",
|
"uni-ui",
|
||||||
|
|||||||
@@ -1,3 +1,13 @@
|
|||||||
|
## 3.3.12(2022-01-15)
|
||||||
|
- 新增 preferedAppPlatform 配置用于解决uni-app vue2版本vue3版本获取platform不一致的问题 [详情](https://uniapp.dcloud.net.cn/uniCloud/uni-id?id=prefered-app-platform)
|
||||||
|
- 修复 checkToken 未返回自定义token内容的Bug
|
||||||
|
## 3.3.11(2022-01-11)
|
||||||
|
- 修复用户名密码登录时多个应用出现重复用户名登录报错的Bug
|
||||||
|
## 3.3.10(2022-01-07)
|
||||||
|
- 新增 自定义国际化语言支持 [详情](https://uniapp.dcloud.net.cn/uniCloud/uni-id?id=custom-i8n)
|
||||||
|
- 修复 一键登录时未校验重复手机号是否已验证的Bug
|
||||||
|
- 修复 Apple登录时用户邮箱为空时报错的Bug
|
||||||
|
- 修复 登录接口未传username时错误提示不正确的Bug
|
||||||
## 3.3.9(2021-11-09)
|
## 3.3.9(2021-11-09)
|
||||||
- 去除重复的context.xxx未找到的提示语
|
- 去除重复的context.xxx未找到的提示语
|
||||||
## 3.3.8(2021-10-28)
|
## 3.3.8(2021-10-28)
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"id": "uni-id",
|
"id": "uni-id",
|
||||||
"displayName": "uni-id",
|
"displayName": "uni-id",
|
||||||
"version": "3.3.9",
|
"version": "3.3.12",
|
||||||
"description": "简单、统一、可扩展的用户中心",
|
"description": "简单、统一、可扩展的用户中心",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"uniid",
|
"uniid",
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "uni-id",
|
"name": "uni-id",
|
||||||
"version": "3.3.5",
|
"version": "3.3.12",
|
||||||
"description": "uni-id for uniCloud",
|
"description": "uni-id for uniCloud",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"homepage": "https://uniapp.dcloud.io/uniCloud/uni-id",
|
"homepage": "https://uniapp.dcloud.io/uniCloud/uni-id",
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
## 1.0.3(2022-01-21)
|
||||||
|
- 优化 组件示例
|
||||||
## 1.0.2(2021-11-22)
|
## 1.0.2(2021-11-22)
|
||||||
- 修复 / 符号在 vue 不同版本兼容问题引起的报错问题
|
- 修复 / 符号在 vue 不同版本兼容问题引起的报错问题
|
||||||
## 1.0.1(2021-11-22)
|
## 1.0.1(2021-11-22)
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"id": "uni-scss",
|
"id": "uni-scss",
|
||||||
"displayName": "uni-scss 辅助样式",
|
"displayName": "uni-scss 辅助样式",
|
||||||
"version": "1.0.2",
|
"version": "1.0.3",
|
||||||
"description": "uni-sass是uni-ui提供的一套全局样式 ,通过一些简单的类名和sass变量,实现简单的页面布局操作,比如颜色、边距、圆角等。",
|
"description": "uni-sass是uni-ui提供的一套全局样式 ,通过一些简单的类名和sass变量,实现简单的页面布局操作,比如颜色、边距、圆角等。",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"uni-scss",
|
"uni-scss",
|
||||||
@@ -14,8 +14,8 @@
|
|||||||
},
|
},
|
||||||
"dcloudext": {
|
"dcloudext": {
|
||||||
"category": [
|
"category": [
|
||||||
"uni-app前端模板",
|
"JS SDK",
|
||||||
"前端页面模板"
|
"通用 SDK"
|
||||||
],
|
],
|
||||||
"sale": {
|
"sale": {
|
||||||
"regular": {
|
"regular": {
|
||||||
|
|||||||
@@ -9,6 +9,9 @@ import {
|
|||||||
getImToken,
|
getImToken,
|
||||||
getMyGroups
|
getMyGroups
|
||||||
} from '@/apis/interfaces/im.js'
|
} from '@/apis/interfaces/im.js'
|
||||||
|
import {
|
||||||
|
contactModel
|
||||||
|
} from './models.js'
|
||||||
|
|
||||||
const initIm = (KEY) => {
|
const initIm = (KEY) => {
|
||||||
RongIMLib.init(KEY)
|
RongIMLib.init(KEY)
|
||||||
@@ -20,6 +23,8 @@ const initIm = (KEY) => {
|
|||||||
getImToken().then(res => {
|
getImToken().then(res => {
|
||||||
connect(res.token, res.userInfo, (res) => {
|
connect(res.token, res.userInfo, (res) => {
|
||||||
console.log('IM.CONNECT', res);
|
console.log('IM.CONNECT', res);
|
||||||
|
// 发布全局事件,有新消息,刷新会话列表
|
||||||
|
uni.$emit('onReceiveMessage')
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@@ -62,13 +67,12 @@ const connect = (token, userInfo, callback) => {
|
|||||||
// 设置未读消息数量
|
// 设置未读消息数量
|
||||||
setNotifyBadge()
|
setNotifyBadge()
|
||||||
// 首次运行获取好友列表
|
// 首次运行获取好友列表
|
||||||
const FK = 'ZH_V_' + userInfo.targetId
|
const FK = 'ZH_CONTACT_' + userInfo.targetId
|
||||||
|
|
||||||
uni.getStorage({
|
uni.getStorage({
|
||||||
key: FK,
|
key: FK,
|
||||||
success: () => {
|
success: () => {
|
||||||
const model = uni.model.contactModel
|
contactModel.find((err, results) => {
|
||||||
model.find((err, results) => {
|
|
||||||
results.map(item => {
|
results.map(item => {
|
||||||
store.dispatch('launchContact', item)
|
store.dispatch('launchContact', item)
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ const contactModel = usqlite.model('contacts', {
|
|||||||
unique: true
|
unique: true
|
||||||
},
|
},
|
||||||
name: String,
|
name: String,
|
||||||
|
remark: String,
|
||||||
hash: {
|
hash: {
|
||||||
type: String,
|
type: String,
|
||||||
unique: true
|
unique: true
|
||||||
@@ -21,6 +22,6 @@ const contactModel = usqlite.model('contacts', {
|
|||||||
localAvatar: String
|
localAvatar: String
|
||||||
})
|
})
|
||||||
|
|
||||||
export default {
|
export {
|
||||||
contactModel
|
contactModel
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user