Commit 6c1d8c83 authored by xieyishang's avatar xieyishang

addxx

parent 4c44adb2
...@@ -70,11 +70,11 @@ ...@@ -70,11 +70,11 @@
this.is_closed=this.$store.state.is_closed; this.is_closed=this.$store.state.is_closed;
}, },
updated (){ updated (){
console.log('玩了') // console.log('玩了')
}, },
watch:{ watch:{
dataorder(){ dataorder(){
console.log('变了') // console.log('变了')
} }
}, },
computed: { computed: {
......
...@@ -33,8 +33,8 @@ ...@@ -33,8 +33,8 @@
<view @tap="catphone" class="iconsbtn"> <view @tap="catphone" class="iconsbtn">
<image class="iconsimg" src="/static/chat/telephony.png" mode=""></image> <image class="iconsimg" src="/static/chat/telephony.png" mode=""></image>
</view> </view>
<view @tap="tostorehome" class="iconsbtn"> <view @tap="toorderinfo" class="iconsbtn">
<image class="iconsimg" src="/static/chat/storeicon.png" mode=""></image> <image class="iconsimg" src="/static/chat/ordericonss.png" mode=""></image>
</view> </view>
</view> </view>
</view> </view>
...@@ -328,25 +328,25 @@ ...@@ -328,25 +328,25 @@
scrollInputh: 0, //底部的高度 scrollInputh: 0, //底部的高度
commonwords: [{ commonwords: [{
name: "请问门店位置在哪?" name: "你好,我们的出餐速度很快的"
}, },
{ {
name: "请问营业时间是几点到几点?" name: "你好,您的订单骑手已经取餐。"
}, },
{ {
name: "请问有什么优惠活动吗?" name: "你还,店铺主页有优惠券可以领取。"
}, },
{ {
name: "请问你们店铺支持配送吗?" name: "我们的店铺是支持配送的"
}, },
{ {
name: "你好,微辣谢谢" name: "好的,收到"
}, },
{ {
name: "你好,我不吃香菜" name: "你好,请问要微辣还是中辣?"
}, },
], ],
isshowtisgoods: true, //是否显示提示产品 isshowtisgoods: false, //是否显示提示产品
qunusermelist: [], qunusermelist: [],
...@@ -627,20 +627,12 @@ ...@@ -627,20 +627,12 @@
//打电话 //打电话
catphone() { catphone() {
uni.showActionSheet({ uni.showActionSheet({
itemList: ['商家电话', '骑手电话', '客服电话', '用户电话'], itemList: ['用户电话','客服电话','骑手电话'],
success: (res) => { success: (res) => {
let sleectindex = res.tapIndex; let sleectindex = res.tapIndex;
let callphone = ''; let callphone = '';
switch (sleectindex) { switch (sleectindex) {
case 0: case 2:
let Merchantinfo = this.Merchantinfo;//商家
if (Merchantinfo.customInfo) {
if (Merchantinfo.customInfo.identity == '2') {
callphone = Merchantinfo.customInfo.stel;
}
}
break;
case 1:
let riderinfo = this.riderinfo;//骑手 let riderinfo = this.riderinfo;//骑手
if (riderinfo.customInfo) { if (riderinfo.customInfo) {
if (riderinfo.customInfo.identity == '3') { if (riderinfo.customInfo.identity == '3') {
...@@ -648,7 +640,7 @@ ...@@ -648,7 +640,7 @@
} }
} }
break; break;
case 2: case 1:
let serviceinfo = this.serviceinfo;//客服 let serviceinfo = this.serviceinfo;//客服
if (serviceinfo.customInfo) { if (serviceinfo.customInfo) {
if (serviceinfo.customInfo.identity == '4') { if (serviceinfo.customInfo.identity == '4') {
...@@ -656,8 +648,8 @@ ...@@ -656,8 +648,8 @@
} }
} }
break; break;
case 3: case 0:
let Userinformation = this.Userinformation; let Userinformation = this.Userinformation;//用户
if (Userinformation.customInfo) { if (Userinformation.customInfo) {
if (Userinformation.customInfo.identity == '1') { if (Userinformation.customInfo.identity == '1') {
callphone = Userinformation.customInfo.utel; callphone = Userinformation.customInfo.utel;
...@@ -679,9 +671,10 @@ ...@@ -679,9 +671,10 @@
} }
}); });
}, },
//进入店铺主页 //查看订单
tostorehome() { toorderinfo() {
console.info('进入店铺主页'); console.info('查看订单详情');
return false;
let Merchantinfo = this.Merchantinfo;//商家 let Merchantinfo = this.Merchantinfo;//商家
let shopid = ''; let shopid = '';
let shoptype = ''; let shoptype = '';
......
...@@ -12,8 +12,8 @@ ...@@ -12,8 +12,8 @@
<view class="usertxbox"> <view class="usertxbox">
<view class="tagmsgs" v-if="item.unreadCount!=0 && item.unreadCount<99">{{item.unreadCount}}</view> <view class="tagmsgs" v-if="item.unreadCount!=0 && item.unreadCount<99">{{item.unreadCount}}</view>
<view class="tagmsgs" v-else-if="item.unreadCount!=0 && item.unreadCount>=99">99</view> <view class="tagmsgs" v-else-if="item.unreadCount!=0 && item.unreadCount>=99">99</view>
<view v-if="item.type==2 && item.txlen" :class="'avatar-box-'+item.txlen"> <view v-if="item.type==2 && qunavatarlist[index].txlen" :class="'avatar-box-'+qunavatarlist[index].txlen">
<image class="img" :src="dataa" v-for="(dataa,i) in item.migtxs" :key="i"></image> <image class="img" :src="dataa" v-for="(dataa,i) in qunavatarlist[index].migtxs" :key="i"></image>
</view> </view>
<image v-else class="usertx" :src="item.avatar" mode=""></image> <image v-else class="usertx" :src="item.avatar" mode=""></image>
</view> </view>
...@@ -29,7 +29,7 @@ ...@@ -29,7 +29,7 @@
<view v-if="item.lastMessage" class="isliaotcon oneline"> <view v-if="item.lastMessage" class="isliaotcon oneline">
<text v-show="item.unreadCount==0">[已读]</text> <text v-show="item.unreadCount==0">[已读]</text>
<text v-show="item.unreadCount!=0">[未读]</text> <text v-show="item.unreadCount!=0">[未读]</text>
<text v-if="item.lastMessage.textElem && item.type==1">{{item.lastMessage.textElem.msg}}</text> <text v-if="item.lastMessage.textElem && (item.type==1 || item.type==2)">{{item.lastMessage.textElem.msg}}</text>
<text v-if="item.lastMessage.elemType==2">[自定义消息]</text> <text v-if="item.lastMessage.elemType==2">[自定义消息]</text>
<text v-if="item.lastMessage.elemType==3">[图片消息]</text> <text v-if="item.lastMessage.elemType==3">[图片消息]</text>
<text v-if="item.lastMessage.elemType==4">[语音消息]</text> <text v-if="item.lastMessage.elemType==4">[语音消息]</text>
...@@ -62,6 +62,9 @@ ...@@ -62,6 +62,9 @@
data() { data() {
return { return {
conversationListtwo:[], conversationListtwo:[],
//先这样写 暂时没有找到更好的写法
//群头像
qunavatarlist:[{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},],
}; };
}, },
onLoad() { onLoad() {
...@@ -80,39 +83,45 @@ ...@@ -80,39 +83,45 @@
}, },
}, },
watch:{ watch:{
conversationList(){ conversationList: {
this.conversationListtwo = this.conversationList;   handler(newName, oldName) {
console.info("conversationList 监听ooo");
let {conversationList} = this;
this.conversationListtwo = conversationList;
this.handchangelist();
  },
deep: false,
  immediate: true
} }
}, },
methods: { methods: {
loginfun() { loginfun() {
this.$store.dispatch("loginStatus").then((res)=>{
let IMUserID = uni.getStorageSync("IMUserID"); if (res.loginStatus != 1) {
this.$store.dispatch("baselogin", IMUserID); //登录 //没登录
let IMUserID = uni.getStorageSync("IMUserID");
// let IMUserID = 'u_817157'; this.$store.dispatch("baselogin", IMUserID); //登录
// this.$store.dispatch("baselogin", IMUserID); //登录 setTimeout(()=>{
if(this.conversationList.length==0){
setTimeout(()=>{ // #ifdef APP-PLUS
if(this.conversationList.length==0){ this.getConversationList();
// #ifdef APP-PLUS // #endif
this.getConversationList(); }
// #endif },4000)
} else {
//已经登录了
if(this.conversationList.length==0){
// #ifdef APP-PLUS
this.getConversationList();
// #endif
}
} }
},4000) })
// let userInfo = uni.getStorageSync("userInfo");
// if(userInfo.shop_id ){
// let userids = 'u_'+String(userInfo.shop_id)
// }
}, },
//获取会话列表 APP //获取会话列表 APP
getConversationList() { getConversationList() {
this.$store.dispatch("getConversationList", {}).then((res)=>{ this.$store.dispatch("getConversationList", {}).then((res)=>{
console.info("APP获取会话列表成功"); console.info("APP获取会话列表成功");
setTimeout(()=>{
this.handchangelist();
},1000)
}); //获取会话列表 }); //获取会话列表
}, },
tochats(item) { tochats(item) {
...@@ -126,8 +135,11 @@ ...@@ -126,8 +135,11 @@
//获取群回话里面的群成员 生成群头像 //获取群回话里面的群成员 生成群头像
handchangelist(){ handchangelist(){
let {conversationList} = this; let {conversationList} = this;
let succunm = 0;
let qunavatarlist = [{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},];
for(let i=0;i<conversationList.length;i++){ for(let i=0;i<conversationList.length;i++){
let item = conversationList[i]; let item = conversationList[i];
let qunavatarobj = {};
if(item.type==2){//群 if(item.type==2){//群
this.$store.dispatch("getGroupMemberList", {groupId:item.groupId}).then((res) => { this.$store.dispatch("getGroupMemberList", {groupId:item.groupId}).then((res) => {
if(res.code==0){ if(res.code==0){
...@@ -138,17 +150,25 @@ ...@@ -138,17 +150,25 @@
migtxs.push(ulist[j].userAvatar); migtxs.push(ulist[j].userAvatar);
} }
} }
conversationList[i].migtxs = migtxs; qunavatarobj.migtxs = migtxs;
conversationList[i].txlen = String(migtxs.length); qunavatarobj.txlen = String(migtxs.length);
this.$set(this.conversationListtwo, i,conversationList[i]); qunavatarlist[i] = qunavatarobj;
succunm++;
}else{
succunm++;
} }
}); });
}else{
succunm++;
} }
} }
setTimeout(()=>{ //等待异步函数执行成功
console.info("conversationListtwo",this.conversationListtwo); let valss = setInterval(()=>{
},6000) if(succunm==conversationList.length){
this.qunavatarlist = qunavatarlist;
clearInterval(valss);
}
},100)
} }
} }
} }
......
...@@ -93,10 +93,7 @@ ...@@ -93,10 +93,7 @@
<script> <script>
import uniIcon from "@/components/uni/uni-icon/uni-icon.vue" import uniIcon from "@/components/uni/uni-icon/uni-icon.vue"
import {userLogin,userUpdatePassword,userSendSms,importShopAccount} from "@/utils/api/api.js"; import {userLogin,userUpdatePassword,userSendSms,importShopAccount} from "@/utils/api/api.js";
import showxieyi from "@/components/showxieyi/showxieyi.vue" import showxieyi from "@/components/showxieyi/showxieyi.vue"
console.info("importShopAccount",importShopAccount);
export default { export default {
components:{ components:{
...@@ -274,7 +271,6 @@ ...@@ -274,7 +271,6 @@
//有多个门店 需要切换 //有多个门店 需要切换
uni.setStorageSync('token', tokens); uni.setStorageSync('token', tokens);
this.$store.commit('changetoken',tokens); this.$store.commit('changetoken',tokens);
this.importShopAccountfun();//去导账号
uni.setStorageSync('storelsit', res.data.store); uni.setStorageSync('storelsit', res.data.store);
uni.navigateTo({ uni.navigateTo({
url:"/pages/tagglestore/tagglestore?istologin=1" url:"/pages/tagglestore/tagglestore?istologin=1"
...@@ -348,14 +344,10 @@ ...@@ -348,14 +344,10 @@
} }
}, },
//导入账号信息 //导入账号信息
async importShopAccountfun(){ importShopAccountfun(){
console.info("导入账号66"); this.$store.dispatch('importShopAccountfun',{}).then((res)=>{
let res = await importShopAccount({});
console.info(res,"导入账号");
if(res.code==0){
} });
} }
} }
} }
......
...@@ -8,7 +8,6 @@ ...@@ -8,7 +8,6 @@
<view class="info towline">{{item.addr}}</view> <view class="info towline">{{item.addr}}</view>
</view> </view>
</view> </view>
</view> </view>
</view> </view>
</template> </template>
...@@ -52,6 +51,7 @@ ...@@ -52,6 +51,7 @@
//登录的时候选的 //登录的时候选的
this.$store.commit('changeuserInfo', this.storelsit[index]); this.$store.commit('changeuserInfo', this.storelsit[index]);
uni.setStorageSync('userInfo', this.storelsit[index]); uni.setStorageSync('userInfo', this.storelsit[index]);
this.importShopAccountfun();
uni.switchTab({ uni.switchTab({
url:'/pages/index/index' url:'/pages/index/index'
}); });
...@@ -59,10 +59,17 @@ ...@@ -59,10 +59,17 @@
}else{ }else{
this.$store.commit('changeuserInfo', this.storelsit[index]); this.$store.commit('changeuserInfo', this.storelsit[index]);
uni.setStorageSync('userInfo', this.storelsit[index]); uni.setStorageSync('userInfo', this.storelsit[index]);
this.importShopAccountfun();
setTimeout(()=>{ setTimeout(()=>{
uni.navigateBack({}); uni.navigateBack({});
},1000) },1000)
} }
},
//导入账号信息
importShopAccountfun(){
this.$store.dispatch('importShopAccountfun',{}).then((res)=>{
});
} }
} }
} }
......
...@@ -69,12 +69,12 @@ const Im_store = { ...@@ -69,12 +69,12 @@ const Im_store = {
}, },
//APP或者小程序 都调用 初始化IM登录 //APP或者小程序 都调用 初始化IM登录
InItImlogin(store, type) { InItImlogin(store, type) {
let userinfo = uni.getStorageSync("userinfo"); let IMUserID = uni.getStorageSync("IMUserID");
// #ifdef APP-PLUS // #ifdef APP-PLUS
store.dispatch("loginStatus", String(userinfo.id)).then((res) => { //获取登录状态 store.dispatch("loginStatus", String(IMUserID)).then((res) => { //获取登录状态
if (res.loginStatus != 0) { if (res.loginStatus != 1) {
//没登录 //没登录
store.dispatch("baselogin", String(userinfo.id)) store.dispatch("baselogin", String(IMUserID))
} else { } else {
//已经登录了 //已经登录了
} }
...@@ -105,6 +105,7 @@ const Im_store = { ...@@ -105,6 +105,7 @@ const Im_store = {
txIm = uni.requireNativePlugin('TX-TencentIM'); txIm = uni.requireNativePlugin('TX-TencentIM');
// #endif // #endif
console.info("新消息来了");
//新消息来了 //新消息来了
//震动 //震动
// uni.vibrateLong({ // uni.vibrateLong({
......
...@@ -7,16 +7,7 @@ import debug from "@/utils/debug.js"; ...@@ -7,16 +7,7 @@ import debug from "@/utils/debug.js";
Vue.use(Vuex) Vue.use(Vuex)
import Voice from '@/utils/QS-baiduyy/QS-baiduyy.js';//接入百度语音播报api import Voice from '@/utils/QS-baiduyy/QS-baiduyy.js';//接入百度语音播报api
// let obj = { import {importShopAccount} from "@/utils/api/api.js";
// staticUrl:"https://kazuma.jxdsy.cn/attachs/",//图片静态资源地址
// staticUrl1:"https://zxluma.jxdsy.cn/attachs/",
// joinurl:"https://kazuma.jxdsy.cn/static/applet5/",//关于我们里面的url
// statictowUrl:"https://kazuma.jxdsy.cn/",//域名
// staticFile:"static/applet5/images/bank/",//图片路径
// uploadurl:"https://kazuma.jxdsy.cn/",//上传图片的地址 用在上传图片组件
// uploadurl1:"https://zxluma.jxdsy.cn/merchant.php/FileUpload/uploadify",
// };
//IMadd //IMadd
...@@ -215,6 +206,23 @@ const store = new Vuex.Store({ ...@@ -215,6 +206,23 @@ const store = new Vuex.Store({
}) })
}) })
}, },
//导入IM 账号信息
importShopAccountfun(context,text){
console.log(uni.getStorageSync('token'));
return new Promise((resolve, reject) => {
importShopAccount({}).then((res)=>{
console.info(res,"导入账号");
if(res.code==0){
if(res.data.code==0){
let IMUserID = res.data.data.Identifier?res.data.data.Identifier:res.data.data.UserID;
uni.setStorageSync("IMUserID",IMUserID);
context.dispatch("baselogin", IMUserID); //登录
}
}
resolve(res);
})
})
},
...Im_store.actions,//IMadd ...Im_store.actions,//IMadd
} }
}) })
......
...@@ -578,4 +578,15 @@ $bordercodes:rgba(242,242,242,1); ...@@ -578,4 +578,15 @@ $bordercodes:rgba(242,242,242,1);
} }
} }
} }
// 高级搜索end // 高级搜索end
\ No newline at end of file
.emptybox{
padding-top: 20upx;
text-align: center;
}
.emptybox .img{
width: 300upx;
height: 300upx;
}
\ No newline at end of file
...@@ -119,7 +119,7 @@ export default function request(api, method, data, {noAuth = false, noVerify = f ...@@ -119,7 +119,7 @@ export default function request(api, method, data, {noAuth = false, noVerify = f
header: header, header: header,
data: data || {}, data: data || {},
success: (res) => { success: (res) => {
console.info("res",res); // console.info("res",res);
// uni.hideLoading(); // uni.hideLoading();
if (noVerify) if (noVerify)
reslove(res.data, res); reslove(res.data, res);
......
...@@ -362,6 +362,38 @@ const checkPhone = (phone)=>{ ...@@ -362,6 +362,38 @@ const checkPhone = (phone)=>{
} }
} }
//时间戳解析多久前
const formatMsgTime = (timespan)=> {
timespan = timespan*1000;//
var dateTime = new Date(timespan) // 将传进来的字符串或者毫秒转为标准时间
var year = dateTime.getFullYear()
var month = dateTime.getMonth() + 1
var day = dateTime.getDate()
var hour = dateTime.getHours()
var minute = dateTime.getMinutes()
// var second = dateTime.getSeconds()
var millisecond = dateTime.getTime() // 将当前编辑的时间转换为毫秒
var now = new Date() // 获取本机当前的时间
var nowNew = now.getTime() // 将本机的时间转换为毫秒
var milliseconds = 0
var timeSpanStr
milliseconds = nowNew - millisecond
if (milliseconds <= 1000 * 60 * 1) { // 小于一分钟展示为刚刚
timeSpanStr = '刚刚'
} else if (1000 * 60 * 1 < milliseconds && milliseconds <= 1000 * 60 * 60) { // 大于一分钟小于一小时展示为分钟
timeSpanStr = Math.round((milliseconds / (1000 * 60))) + '分钟前'
} else if (1000 * 60 * 60 * 1 < milliseconds && milliseconds <= 1000 * 60 * 60 * 24) { // 大于一小时小于一天展示为小时
timeSpanStr = Math.round(milliseconds / (1000 * 60 * 60)) + '小时前'
} else if (1000 * 60 * 60 * 24 < milliseconds && milliseconds <= 1000 * 60 * 60 * 24 * 15) { // 大于一天小于十五天展示位天
timeSpanStr = Math.round(milliseconds / (1000 * 60 * 60 * 24)) + '天前'
} else if (milliseconds > 1000 * 60 * 60 * 24 * 15 && year === now.getFullYear()) {
timeSpanStr = month + '-' + day + ' ' + hour + ':' + minute
} else {
timeSpanStr = year + '-' + month + '-' + day + ' ' + hour + ':' + minute
}
return timeSpanStr
}
export { export {
getTimeOut, getTimeOut,
timestampToTime,//10位时间戳 转年月日时分秒 timestampToTime,//10位时间戳 转年月日时分秒
...@@ -382,6 +414,7 @@ export { ...@@ -382,6 +414,7 @@ export {
getRandomColor,//生成随机颜色 getRandomColor,//生成随机颜色
checkPwd,//检测密码强度 checkPwd,//检测密码强度
checkPhone,//检测手机号码 checkPhone,//检测手机号码
formatMsgTime
} }
......
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